Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| d5c265860c | |||
| 0f6bfe45aa |
@@ -1,5 +1,14 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## 2026-02-23 - 2.5.0 - feat(sz-config-section)
|
||||||
|
add header action buttons to sz-config-section allowing configurable actions/events
|
||||||
|
|
||||||
|
- Introduce IConfigSectionAction interface (label, icon, event, detail).
|
||||||
|
- Add actions property to SzConfigSection and render header action buttons in the component template.
|
||||||
|
- Add styles for .header-action and hover state to match design system.
|
||||||
|
- Dispatch CustomEvent when an action is clicked, using action.event (defaults to 'action') and action.detail.
|
||||||
|
- Update demo (sz-demo-view-config) to include a sample 'View Routes' action showing usage.
|
||||||
|
|
||||||
## 2026-02-23 - 2.4.0 - feat(elements)
|
## 2026-02-23 - 2.4.0 - feat(elements)
|
||||||
add configuration overview and section components with demo view and index exports
|
add configuration overview and section components with demo view and index exports
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@serve.zone/catalog",
|
"name": "@serve.zone/catalog",
|
||||||
"version": "2.4.0",
|
"version": "2.5.0",
|
||||||
"private": false,
|
"private": false,
|
||||||
"description": "UI component catalog for serve.zone",
|
"description": "UI component catalog for serve.zone",
|
||||||
"main": "dist_ts_web/index.js",
|
"main": "dist_ts_web/index.js",
|
||||||
|
|||||||
@@ -3,6 +3,6 @@
|
|||||||
*/
|
*/
|
||||||
export const commitinfo = {
|
export const commitinfo = {
|
||||||
name: '@serve.zone/catalog',
|
name: '@serve.zone/catalog',
|
||||||
version: '2.4.0',
|
version: '2.5.0',
|
||||||
description: 'UI component catalog for serve.zone'
|
description: 'UI component catalog for serve.zone'
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,6 +17,13 @@ export interface IConfigField {
|
|||||||
linkTo?: string;
|
linkTo?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface IConfigSectionAction {
|
||||||
|
label: string;
|
||||||
|
icon?: string;
|
||||||
|
event?: string;
|
||||||
|
detail?: any;
|
||||||
|
}
|
||||||
|
|
||||||
declare global {
|
declare global {
|
||||||
interface HTMLElementTagNameMap {
|
interface HTMLElementTagNameMap {
|
||||||
'sz-config-section': SzConfigSection;
|
'sz-config-section': SzConfigSection;
|
||||||
@@ -81,6 +88,9 @@ export class SzConfigSection extends DeesElement {
|
|||||||
@property({ type: Array })
|
@property({ type: Array })
|
||||||
public accessor fields: IConfigField[] = [];
|
public accessor fields: IConfigField[] = [];
|
||||||
|
|
||||||
|
@property({ type: Array })
|
||||||
|
public accessor actions: IConfigSectionAction[] = [];
|
||||||
|
|
||||||
@property({ type: Boolean })
|
@property({ type: Boolean })
|
||||||
public accessor collapsible: boolean = false;
|
public accessor collapsible: boolean = false;
|
||||||
|
|
||||||
@@ -226,6 +236,32 @@ export class SzConfigSection extends DeesElement {
|
|||||||
background: ${cssManager.bdTheme('#f59e0b', '#fbbf24')};
|
background: ${cssManager.bdTheme('#f59e0b', '#fbbf24')};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Action buttons */
|
||||||
|
.header-action {
|
||||||
|
display: inline-flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 5px;
|
||||||
|
padding: 4px 12px;
|
||||||
|
border-radius: 6px;
|
||||||
|
font-size: 12px;
|
||||||
|
font-weight: 500;
|
||||||
|
color: ${cssManager.bdTheme('#2563eb', '#60a5fa')};
|
||||||
|
background: transparent;
|
||||||
|
border: none;
|
||||||
|
cursor: pointer;
|
||||||
|
transition: background 150ms ease;
|
||||||
|
white-space: nowrap;
|
||||||
|
font-family: inherit;
|
||||||
|
}
|
||||||
|
|
||||||
|
.header-action:hover {
|
||||||
|
background: ${cssManager.bdTheme('rgba(37,99,235,0.08)', 'rgba(96,165,250,0.1)')};
|
||||||
|
}
|
||||||
|
|
||||||
|
.header-action dees-icon {
|
||||||
|
font-size: 14px;
|
||||||
|
}
|
||||||
|
|
||||||
/* Chevron */
|
/* Chevron */
|
||||||
.chevron {
|
.chevron {
|
||||||
display: flex;
|
display: flex;
|
||||||
@@ -439,6 +475,19 @@ export class SzConfigSection extends DeesElement {
|
|||||||
${statusLabels[this.status] || this.status}
|
${statusLabels[this.status] || this.status}
|
||||||
</span>
|
</span>
|
||||||
` : ''}
|
` : ''}
|
||||||
|
${this.actions.map(action => html`
|
||||||
|
<button class="header-action" @click=${(e: Event) => {
|
||||||
|
e.stopPropagation();
|
||||||
|
this.dispatchEvent(new CustomEvent(action.event || 'action', {
|
||||||
|
detail: action.detail || { label: action.label },
|
||||||
|
bubbles: true,
|
||||||
|
composed: true,
|
||||||
|
}));
|
||||||
|
}}>
|
||||||
|
${action.icon ? html`<dees-icon .icon=${action.icon}></dees-icon>` : ''}
|
||||||
|
${action.label}
|
||||||
|
</button>
|
||||||
|
`)}
|
||||||
${this.collapsible ? html`
|
${this.collapsible ? html`
|
||||||
<span class="chevron ${this.isCollapsed ? 'collapsed' : ''}">
|
<span class="chevron ${this.isCollapsed ? 'collapsed' : ''}">
|
||||||
<dees-icon .icon=${'lucide:chevronDown'}></dees-icon>
|
<dees-icon .icon=${'lucide:chevronDown'}></dees-icon>
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import {
|
|||||||
cssManager,
|
cssManager,
|
||||||
type TemplateResult,
|
type TemplateResult,
|
||||||
} from '@design.estate/dees-element';
|
} from '@design.estate/dees-element';
|
||||||
import type { IConfigField } from './sz-config-section.js';
|
import type { IConfigField, IConfigSectionAction } from './sz-config-section.js';
|
||||||
import './index.js';
|
import './index.js';
|
||||||
|
|
||||||
declare global {
|
declare global {
|
||||||
@@ -109,6 +109,7 @@ export class SzDemoViewConfig extends DeesElement {
|
|||||||
icon="lucide:network"
|
icon="lucide:network"
|
||||||
status="enabled"
|
status="enabled"
|
||||||
.fields=${proxyFields}
|
.fields=${proxyFields}
|
||||||
|
.actions=${[{ label: 'View Routes', icon: 'lucide:arrow-right', event: 'navigate', detail: { view: 'routes' } }] as IConfigSectionAction[]}
|
||||||
></sz-config-section>
|
></sz-config-section>
|
||||||
|
|
||||||
<sz-config-section
|
<sz-config-section
|
||||||
|
|||||||
Reference in New Issue
Block a user