@zeyos/zx 3.0.0 → 4.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +95 -0
- package/DESIGN-SYSTEM.md +87 -71
- package/README.md +16 -37
- package/dist/types/components/app-icon/app-icon.d.ts +88 -0
- package/dist/types/components/app-sidebar/app-sidebar.d.ts +106 -32
- package/dist/types/components/card/card.d.ts +128 -0
- package/dist/types/components/chart/chart.d.ts +1 -0
- package/dist/types/components/filter/filter-model.d.ts +87 -0
- package/dist/types/components/filter/filter.d.ts +331 -0
- package/dist/types/components/launcher/launcher.d.ts +65 -6
- package/dist/types/components/select/select.d.ts +97 -4
- package/dist/types/components/table/table.d.ts +107 -3
- package/dist/types/components/tag-picker/tag-picker.d.ts +16 -0
- package/dist/types/core/dom.d.ts +9 -1
- package/dist/types/core/util.d.ts +9 -0
- package/dist/types/index.d.ts +6 -2
- package/dist/types/{components/app-rail → internal}/app-rail.d.ts +34 -19
- package/dist/types/zeyos/icons.d.ts +24 -2
- package/dist/types/zeyos/index.d.ts +3 -2
- package/dist/types/zeyos/launcher.d.ts +147 -0
- package/dist/types/zeyos/select.d.ts +41 -0
- package/dist/zx-zeyos.esm.js +2018 -113
- package/dist/zx-zeyos.esm.min.js +1 -1
- package/dist/zx.css +815 -16
- package/dist/zx.esm.js +2661 -338
- package/dist/zx.esm.min.js +3 -3
- package/dist/zx.global.js +2661 -338
- package/dist/zx.global.min.js +3 -3
- package/dist/zx.min.css +1 -1
- package/docs/api.json +602 -110
- package/docs/llms.md +181 -123
- package/docs/llms.txt +24 -21
- package/package.json +8 -17
- package/src/components/app-icon/app-icon.css +105 -0
- package/src/components/app-icon/app-icon.js +134 -0
- package/src/components/app-sidebar/app-sidebar.css +12 -0
- package/src/components/app-sidebar/app-sidebar.js +310 -110
- package/src/components/card/card.css +149 -0
- package/src/components/card/card.js +285 -0
- package/src/components/chart/chart.js +8 -3
- package/src/components/filter/filter-model.js +226 -0
- package/src/components/filter/filter.css +147 -0
- package/src/components/filter/filter.js +554 -0
- package/src/components/grid/grid.css +1 -1
- package/src/components/grid/grid.js +14 -4
- package/src/components/launcher/launcher.css +113 -3
- package/src/components/launcher/launcher.js +234 -26
- package/src/components/message/message.css +36 -3
- package/src/components/select/field-adapter.js +9 -4
- package/src/components/select/select.css +161 -10
- package/src/components/select/select.js +361 -48
- package/src/components/table/table.css +85 -0
- package/src/components/table/table.js +426 -31
- package/src/components/tag-picker/tag-picker.css +19 -0
- package/src/components/tag-picker/tag-picker.js +42 -5
- package/src/core/dom.js +21 -1
- package/src/core/util.js +20 -0
- package/src/index.js +9 -2
- package/src/{components/app-rail → internal}/app-rail.js +80 -30
- package/src/zeyos/icons.js +38 -20
- package/src/zeyos/index.js +8 -2
- package/src/zeyos/launcher.js +338 -0
- package/src/zeyos/modules.js +1 -0
- package/src/zeyos/select.js +116 -1
- package/styles/tokens/global.css +1 -1
- package/styles/tokens/modules.css +1 -0
- package/styles/tokens/semantic.css +9 -0
- package/styles/tokens/themes.css +2 -2
- package/styles/zx.css +3 -0
- package/MIGRATION.md +0 -749
- package/dist/types/compat/base.d.ts +0 -156
- package/dist/types/compat/globals.d.ts +0 -20
- package/dist/types/compat/index.d.ts +0 -128
- package/dist/types/compat/map/basic.d.ts +0 -175
- package/dist/types/compat/map/data.d.ts +0 -103
- package/dist/types/compat/map/date-time.d.ts +0 -80
- package/dist/types/compat/map/factory.d.ts +0 -9
- package/dist/types/compat/map/form.d.ts +0 -98
- package/dist/types/compat/map/helpers.d.ts +0 -12
- package/dist/types/compat/map/http.d.ts +0 -36
- package/dist/types/compat/map/layout.d.ts +0 -106
- package/dist/types/compat/map/options.d.ts +0 -80
- package/dist/types/compat/map/select.d.ts +0 -95
- package/dist/types/compat/map/stubs.d.ts +0 -32
- package/dist/types/compat/map/utilities.d.ts +0 -37
- package/dist/types/compat-entry.d.ts +0 -5
- package/dist/zx-compat.esm.js +0 -17848
- package/dist/zx-compat.esm.min.js +0 -1
- package/dist/zx-compat.global.js +0 -29008
- package/dist/zx-compat.global.min.js +0 -3
- package/src/compat/base.js +0 -291
- package/src/compat/globals.js +0 -167
- package/src/compat/index.js +0 -84
- package/src/compat/map/basic.js +0 -464
- package/src/compat/map/data.js +0 -254
- package/src/compat/map/date-time.js +0 -177
- package/src/compat/map/factory.js +0 -45
- package/src/compat/map/form.js +0 -330
- package/src/compat/map/helpers.js +0 -46
- package/src/compat/map/http.js +0 -117
- package/src/compat/map/layout.js +0 -256
- package/src/compat/map/options.js +0 -267
- package/src/compat/map/select.js +0 -198
- package/src/compat/map/stubs.js +0 -26
- package/src/compat/map/utilities.js +0 -113
- package/src/compat-entry.js +0 -11
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Component } from '../../core/component.js';
|
|
2
|
-
import {
|
|
3
|
-
export type AppNavItem = import('
|
|
4
|
-
export type AppNavSelectDetail = import('
|
|
2
|
+
import { AppRailPresenter as MinimizedPresenter } from '../../internal/app-rail.js';
|
|
3
|
+
export type AppNavItem = import('../../internal/app-rail.js').AppNavItem;
|
|
4
|
+
export type AppNavSelectDetail = import('../../internal/app-rail.js').AppNavSelectDetail;
|
|
5
5
|
export type AppSidebarOptions = {
|
|
6
6
|
/**
|
|
7
7
|
* Application navigation tree.
|
|
@@ -16,13 +16,21 @@ export type AppSidebarOptions = {
|
|
|
16
16
|
*/
|
|
17
17
|
expanded?: Array<string | number>;
|
|
18
18
|
/**
|
|
19
|
-
* Whether the minimized
|
|
19
|
+
* Whether the minimized presentation is shown.
|
|
20
20
|
*/
|
|
21
21
|
collapsed?: boolean;
|
|
22
22
|
/**
|
|
23
|
-
*
|
|
23
|
+
* Whether vertical navigation exposes a mode toggle.
|
|
24
24
|
*/
|
|
25
|
-
|
|
25
|
+
collapsible?: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Navigation flow; horizontal is always minimized.
|
|
28
|
+
*/
|
|
29
|
+
orientation?: 'vertical' | 'horizontal';
|
|
30
|
+
/**
|
|
31
|
+
* Workspace edge occupied by navigation.
|
|
32
|
+
*/
|
|
33
|
+
side?: 'left' | 'right' | 'top' | 'bottom';
|
|
26
34
|
/**
|
|
27
35
|
* Navigation accessible label.
|
|
28
36
|
*/
|
|
@@ -40,23 +48,35 @@ export type AppSidebarOptions = {
|
|
|
40
48
|
toElement: () => Node | null;
|
|
41
49
|
} | null;
|
|
42
50
|
/**
|
|
43
|
-
* Minimized
|
|
51
|
+
* Minimized leading content.
|
|
44
52
|
*/
|
|
45
53
|
railHeader?: Node | string | number | {
|
|
46
54
|
toElement: () => Node | null;
|
|
47
55
|
} | null;
|
|
48
56
|
/**
|
|
49
|
-
* Minimized
|
|
57
|
+
* Minimized trailing content.
|
|
50
58
|
*/
|
|
51
59
|
railFooter?: Node | string | number | {
|
|
52
60
|
toElement: () => Node | null;
|
|
53
61
|
} | null;
|
|
62
|
+
/**
|
|
63
|
+
* Minimized flyout hover-open delay.
|
|
64
|
+
*/
|
|
65
|
+
openDelay?: number;
|
|
66
|
+
/**
|
|
67
|
+
* Minimized flyout crossing grace.
|
|
68
|
+
*/
|
|
69
|
+
closeDelay?: number;
|
|
70
|
+
/**
|
|
71
|
+
* Optional host icon renderer.
|
|
72
|
+
*/
|
|
73
|
+
renderIcon?: (item: AppNavItem, context: Record<string, any>) => Node | null;
|
|
54
74
|
/**
|
|
55
75
|
* Preventable action listener.
|
|
56
76
|
*/
|
|
57
77
|
onselect?: (event: CustomEvent<AppNavSelectDetail>) => void;
|
|
58
78
|
/**
|
|
59
|
-
* Branch-state listener
|
|
79
|
+
* Branch-state listener.
|
|
60
80
|
*/
|
|
61
81
|
onbranchchange?: (event: CustomEvent<{
|
|
62
82
|
item: AppNavItem | null;
|
|
@@ -70,58 +90,79 @@ export type AppSidebarOptions = {
|
|
|
70
90
|
oncollapsechange?: (event: CustomEvent<{
|
|
71
91
|
collapsed: boolean;
|
|
72
92
|
}>) => void;
|
|
93
|
+
/**
|
|
94
|
+
* Minimized flyout-state listener.
|
|
95
|
+
*/
|
|
96
|
+
onflyoutchange?: (event: CustomEvent<{
|
|
97
|
+
item: AppNavItem;
|
|
98
|
+
id: string | number;
|
|
99
|
+
open: boolean;
|
|
100
|
+
}>) => void;
|
|
73
101
|
};
|
|
74
|
-
/** @typedef {import('
|
|
75
|
-
/** @typedef {import('
|
|
102
|
+
/** @typedef {import('../../internal/app-rail.js').AppNavItem} AppNavItem */
|
|
103
|
+
/** @typedef {import('../../internal/app-rail.js').AppNavSelectDetail} AppNavSelectDetail */
|
|
76
104
|
/**
|
|
77
105
|
* @typedef {Object} AppSidebarOptions
|
|
78
106
|
* @property {AppNavItem[]} [items=[]] Application navigation tree.
|
|
79
107
|
* @property {string|number|null} [active=null] Active item id.
|
|
80
108
|
* @property {Array<string|number>} [expanded=[]] Initially expanded branch ids.
|
|
81
|
-
* @property {boolean} [collapsed=false] Whether the minimized
|
|
82
|
-
* @property {
|
|
109
|
+
* @property {boolean} [collapsed=false] Whether the minimized presentation is shown.
|
|
110
|
+
* @property {boolean} [collapsible=true] Whether vertical navigation exposes a mode toggle.
|
|
111
|
+
* @property {'vertical'|'horizontal'} [orientation='vertical'] Navigation flow; horizontal is always minimized.
|
|
112
|
+
* @property {'left'|'right'|'top'|'bottom'} [side='left'] Workspace edge occupied by navigation.
|
|
83
113
|
* @property {string} [label='Applications'] Navigation accessible label.
|
|
84
114
|
* @property {Node|string|number|{toElement: () => Node|null}|null} [header=null] Expanded header content.
|
|
85
115
|
* @property {Node|string|number|{toElement: () => Node|null}|null} [footer=null] Expanded sticky footer content.
|
|
86
|
-
* @property {Node|string|number|{toElement: () => Node|null}|null} [railHeader=null] Minimized
|
|
87
|
-
* @property {Node|string|number|{toElement: () => Node|null}|null} [railFooter=null] Minimized
|
|
116
|
+
* @property {Node|string|number|{toElement: () => Node|null}|null} [railHeader=null] Minimized leading content.
|
|
117
|
+
* @property {Node|string|number|{toElement: () => Node|null}|null} [railFooter=null] Minimized trailing content.
|
|
118
|
+
* @property {number} [openDelay=80] Minimized flyout hover-open delay.
|
|
119
|
+
* @property {number} [closeDelay=160] Minimized flyout crossing grace.
|
|
120
|
+
* @property {(item: AppNavItem, context: Record<string, any>) => Node|null} [renderIcon] Optional host icon renderer.
|
|
88
121
|
* @property {(event: CustomEvent<AppNavSelectDetail>) => void} [onselect] Preventable action listener.
|
|
89
|
-
* @property {(event: CustomEvent<{item: AppNavItem|null, id: string|number|null, expanded: boolean|null, ids: Array<string|number>}>) => void} [onbranchchange] Branch-state listener
|
|
122
|
+
* @property {(event: CustomEvent<{item: AppNavItem|null, id: string|number|null, expanded: boolean|null, ids: Array<string|number>}>) => void} [onbranchchange] Branch-state listener.
|
|
90
123
|
* @property {(event: CustomEvent<{collapsed: boolean}>) => void} [oncollapsechange] Presentation-state listener.
|
|
124
|
+
* @property {(event: CustomEvent<{item: AppNavItem, id: string|number, open: boolean}>) => void} [onflyoutchange] Minimized flyout-state listener.
|
|
91
125
|
*/
|
|
92
126
|
/**
|
|
93
|
-
*
|
|
127
|
+
* One application navigation component. Vertical expanded descendants render inline; minimized
|
|
128
|
+
* vertical and horizontal descendants use pointer-, focus-, and keyboard-accessible flyouts.
|
|
94
129
|
* @fires AppSidebar#select
|
|
95
130
|
* @fires AppSidebar#branchchange
|
|
96
131
|
* @fires AppSidebar#collapsechange
|
|
132
|
+
* @fires AppSidebar#flyoutchange
|
|
97
133
|
* @extends {Component<AppSidebarOptions>}
|
|
98
134
|
*/
|
|
99
135
|
export declare class AppSidebar extends Component<AppSidebarOptions> {
|
|
136
|
+
_rail: MinimizedPresenter;
|
|
100
137
|
_railExpandButton: HTMLElement;
|
|
101
|
-
_rail: AppRail;
|
|
102
138
|
_createdRoot: boolean;
|
|
103
139
|
_original: {
|
|
104
140
|
attributes: string[][];
|
|
105
141
|
children: ChildNode[];
|
|
106
142
|
};
|
|
107
|
-
_items: import("
|
|
143
|
+
_items: import("../../internal/app-rail.js").AppNavItem[];
|
|
108
144
|
_active: string | number;
|
|
109
145
|
_expanded: Set<string>;
|
|
110
146
|
_collapsed: boolean;
|
|
147
|
+
_orientation: any;
|
|
148
|
+
_side: "bottom" | "left" | "right" | "top";
|
|
149
|
+
_modeAbort: AbortController;
|
|
111
150
|
static cssName: string;
|
|
112
151
|
/** @type {Readonly<AppSidebarOptions>} */
|
|
113
152
|
static defaults: Readonly<AppSidebarOptions>;
|
|
114
153
|
/**
|
|
115
|
-
* Creates or enhances an application-
|
|
116
|
-
* @param {Element|string|null} target
|
|
117
|
-
* @param {AppSidebarOptions} [options={}]
|
|
154
|
+
* Creates or enhances an application-navigation host.
|
|
155
|
+
* @param {Element|string|null} [target=null] Navigation target.
|
|
156
|
+
* @param {AppSidebarOptions} [options={}] Navigation options.
|
|
118
157
|
*/
|
|
119
158
|
constructor(target?: Element | string | null, options?: AppSidebarOptions);
|
|
120
159
|
/** @returns {HTMLElement} */
|
|
121
160
|
render(): HTMLElement;
|
|
122
|
-
/** Replaces the navigation tree in
|
|
161
|
+
/** Replaces the navigation tree in the active presentation. @param {AppNavItem[]} items @returns {this} */
|
|
123
162
|
setItems(items: AppNavItem[]): this;
|
|
124
|
-
/**
|
|
163
|
+
/** Returns a shallow copy of normalized items. @returns {AppNavItem[]} */
|
|
164
|
+
getItems(): AppNavItem[];
|
|
165
|
+
/** Sets the active id without routing. @param {string|number|null} id @returns {this} */
|
|
125
166
|
setActive(id: string | number | null): this;
|
|
126
167
|
/** Replaces expanded branch ids. @param {Array<string|number>} ids @param {{silent?: boolean}} [options={}] @returns {this} */
|
|
127
168
|
setExpanded(ids: Array<string | number>, { silent }?: {
|
|
@@ -133,30 +174,62 @@ export declare class AppSidebar extends Component<AppSidebarOptions> {
|
|
|
133
174
|
toggleBranch(id: string | number, { silent }?: {
|
|
134
175
|
silent?: boolean;
|
|
135
176
|
}): this;
|
|
136
|
-
/** Shows the expanded
|
|
177
|
+
/** Shows the expanded vertical presentation. @param {{silent?: boolean}} [options={}] @returns {this} */
|
|
137
178
|
expand(options?: {
|
|
138
179
|
silent?: boolean;
|
|
139
180
|
}): this;
|
|
140
|
-
/** Shows the minimized
|
|
181
|
+
/** Shows the minimized presentation. @param {{silent?: boolean}} [options={}] @returns {this} */
|
|
141
182
|
collapse(options?: {
|
|
142
183
|
silent?: boolean;
|
|
143
184
|
}): this;
|
|
144
|
-
/** Sets expanded/minimized
|
|
185
|
+
/** Sets the saved vertical expanded/minimized state. @param {boolean} collapsed @param {{silent?: boolean}} [options={}] @returns {this} */
|
|
145
186
|
setCollapsed(collapsed: boolean, { silent }?: {
|
|
146
187
|
silent?: boolean;
|
|
147
188
|
}): this;
|
|
148
|
-
/** Reports
|
|
189
|
+
/** Reports the effective presentation state; horizontal navigation is always minimized. @returns {boolean} */
|
|
149
190
|
isCollapsed(): boolean;
|
|
150
|
-
/**
|
|
151
|
-
|
|
152
|
-
|
|
191
|
+
/**
|
|
192
|
+
* Changes navigation flow/edge without replacing state.
|
|
193
|
+
* @param {{orientation?: 'vertical'|'horizontal', side?: 'left'|'right'|'top'|'bottom'}} layout
|
|
194
|
+
* @param {{silent?: boolean}} [options]
|
|
195
|
+
* @returns {this}
|
|
196
|
+
*/
|
|
197
|
+
setLayout(layout?: {
|
|
198
|
+
orientation?: 'vertical' | 'horizontal';
|
|
199
|
+
side?: 'left' | 'right' | 'top' | 'bottom';
|
|
200
|
+
}, { silent }?: {
|
|
201
|
+
silent?: boolean;
|
|
202
|
+
}): this;
|
|
203
|
+
/** Opens a minimized descendant flyout. @param {string|number} id @param {{focus?: boolean}} [options={}] @returns {this} */
|
|
204
|
+
openFlyout(id: string | number, options?: {
|
|
205
|
+
focus?: boolean;
|
|
206
|
+
}): this;
|
|
207
|
+
/** Closes a minimized descendant flyout. @param {string|number} id @returns {this} */
|
|
208
|
+
closeFlyout(id: string | number): this;
|
|
209
|
+
/** Closes every minimized flyout. @returns {this} */
|
|
210
|
+
closeAllFlyouts(): this;
|
|
211
|
+
/** Reports whether a minimized flyout is open. @param {string|number} id @returns {boolean} */
|
|
212
|
+
isFlyoutOpen(id: string | number): boolean;
|
|
213
|
+
/** Focuses the first navigation action. @returns {this} */
|
|
214
|
+
focus(): this;
|
|
215
|
+
/** Destroys flyouts and restores/removes the host. @returns {void} */
|
|
153
216
|
destroy(): void;
|
|
217
|
+
/** Mounts exactly one expanded tree or minimized flyout presentation. @returns {void} */
|
|
218
|
+
_renderMode(): void;
|
|
219
|
+
/** @returns {void} */
|
|
220
|
+
_renderExpanded(): void;
|
|
221
|
+
/** @returns {void} */
|
|
222
|
+
_renderRail(): void;
|
|
223
|
+
/** @param {EventTarget} target @param {string} type @param {EventListener} listener @returns {void} */
|
|
224
|
+
_listenMode(target: EventTarget, type: string, listener: EventListener): void;
|
|
154
225
|
/** @returns {void} */
|
|
155
226
|
_renderTree(): void;
|
|
156
227
|
/** @param {AppNavItem} item @param {number} level @returns {HTMLElement} */
|
|
157
228
|
_treeRow(item: AppNavItem, level: number): HTMLElement;
|
|
158
|
-
/**
|
|
229
|
+
/** @param {Event} event @returns {void} */
|
|
159
230
|
_onTreeClick(event: Event): void;
|
|
231
|
+
/** @param {KeyboardEvent} event @returns {void} */
|
|
232
|
+
_onTreeKeydown(event: KeyboardEvent): void;
|
|
160
233
|
/** @param {AppNavItem} item @param {Event} event @returns {void} */
|
|
161
234
|
_select(item: AppNavItem, event: Event): void;
|
|
162
235
|
/** @returns {void} */
|
|
@@ -167,3 +240,4 @@ export declare class AppSidebar extends Component<AppSidebarOptions> {
|
|
|
167
240
|
/** Fired when a destination/action is activated. @event AppSidebar#select @type {CustomEvent<AppNavSelectDetail>} */
|
|
168
241
|
/** Fired when an inline branch changes. @event AppSidebar#branchchange @type {CustomEvent<{item: AppNavItem|null, id: string|number|null, expanded: boolean|null, ids: Array<string|number>}>} */
|
|
169
242
|
/** Fired when expanded/minimized presentation changes. @event AppSidebar#collapsechange @type {CustomEvent<{collapsed: boolean}>} */
|
|
243
|
+
/** Fired when a minimized flyout changes. @event AppSidebar#flyoutchange @type {CustomEvent<{item: AppNavItem, id: string|number, open: boolean}>} */
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import { Component } from '../../core/component.js';
|
|
2
|
+
export type CardContent = string | Node | Component | null;
|
|
3
|
+
export type ButtonOptions = import('../button/button.js').ButtonOptions;
|
|
4
|
+
export type CardAction = Element | ButtonOptions;
|
|
5
|
+
export type CardLinkDescriptor = {
|
|
6
|
+
/**
|
|
7
|
+
* Native link destination; executable/data schemes are rejected.
|
|
8
|
+
*/
|
|
9
|
+
href: string;
|
|
10
|
+
/**
|
|
11
|
+
* Native browsing context.
|
|
12
|
+
*/
|
|
13
|
+
target?: string;
|
|
14
|
+
/**
|
|
15
|
+
* Native link relationship.
|
|
16
|
+
*/
|
|
17
|
+
rel?: string;
|
|
18
|
+
/**
|
|
19
|
+
* Native click listener.
|
|
20
|
+
*/
|
|
21
|
+
onclick?: (event: MouseEvent) => void;
|
|
22
|
+
};
|
|
23
|
+
export type CardLink = string | CardLinkDescriptor | null;
|
|
24
|
+
export type CardOptions = {
|
|
25
|
+
/**
|
|
26
|
+
* Card title.
|
|
27
|
+
*/
|
|
28
|
+
title?: string;
|
|
29
|
+
/**
|
|
30
|
+
* Optional image, avatar, icon, or other media.
|
|
31
|
+
*/
|
|
32
|
+
media?: CardContent;
|
|
33
|
+
/**
|
|
34
|
+
* Main card content; enhanced children are adopted by default.
|
|
35
|
+
*/
|
|
36
|
+
content?: CardContent;
|
|
37
|
+
/**
|
|
38
|
+
* Secondary native controls beside the title.
|
|
39
|
+
*/
|
|
40
|
+
actions?: CardAction[];
|
|
41
|
+
/**
|
|
42
|
+
* Optional metadata or trailing content.
|
|
43
|
+
*/
|
|
44
|
+
footer?: CardContent;
|
|
45
|
+
/**
|
|
46
|
+
* Optional native primary link rendered around the title.
|
|
47
|
+
*/
|
|
48
|
+
link?: CardLink;
|
|
49
|
+
/**
|
|
50
|
+
* Surface treatment.
|
|
51
|
+
*/
|
|
52
|
+
variant?: 'outlined' | 'raised' | 'filled';
|
|
53
|
+
/**
|
|
54
|
+
* Media/content arrangement.
|
|
55
|
+
*/
|
|
56
|
+
orientation?: 'vertical' | 'horizontal';
|
|
57
|
+
/**
|
|
58
|
+
* Semantic title heading level.
|
|
59
|
+
*/
|
|
60
|
+
headingLevel?: 1 | 2 | 3 | 4 | 5 | 6;
|
|
61
|
+
};
|
|
62
|
+
/** @typedef {string|Node|Component|null} CardContent */
|
|
63
|
+
/** @typedef {import('../button/button.js').ButtonOptions} ButtonOptions */
|
|
64
|
+
/** @typedef {Element|ButtonOptions} CardAction */
|
|
65
|
+
/**
|
|
66
|
+
* @typedef {Object} CardLinkDescriptor
|
|
67
|
+
* @property {string} href Native link destination; executable/data schemes are rejected.
|
|
68
|
+
* @property {string} [target] Native browsing context.
|
|
69
|
+
* @property {string} [rel] Native link relationship.
|
|
70
|
+
* @property {(event: MouseEvent) => void} [onclick] Native click listener.
|
|
71
|
+
*/
|
|
72
|
+
/** @typedef {string|CardLinkDescriptor|null} CardLink */
|
|
73
|
+
/**
|
|
74
|
+
* @typedef {Object} CardOptions
|
|
75
|
+
* @property {string} [title=''] Card title.
|
|
76
|
+
* @property {CardContent} [media=null] Optional image, avatar, icon, or other media.
|
|
77
|
+
* @property {CardContent} [content=null] Main card content; enhanced children are adopted by default.
|
|
78
|
+
* @property {CardAction[]} [actions=[]] Secondary native controls beside the title.
|
|
79
|
+
* @property {CardContent} [footer=null] Optional metadata or trailing content.
|
|
80
|
+
* @property {CardLink} [link=null] Optional native primary link rendered around the title.
|
|
81
|
+
* @property {'outlined'|'raised'|'filled'} [variant='outlined'] Surface treatment.
|
|
82
|
+
* @property {'vertical'|'horizontal'} [orientation='vertical'] Media/content arrangement.
|
|
83
|
+
* @property {1|2|3|4|5|6} [headingLevel=3] Semantic title heading level.
|
|
84
|
+
*/
|
|
85
|
+
/**
|
|
86
|
+
* Semantic content or record surface with optional media, native primary link, actions, and footer.
|
|
87
|
+
* The root is never interactive: linked cards keep a real title anchor, so secondary controls are
|
|
88
|
+
* siblings rather than invalid nested actions.
|
|
89
|
+
* @extends {Component<CardOptions>}
|
|
90
|
+
*/
|
|
91
|
+
export declare class Card extends Component<CardOptions> {
|
|
92
|
+
_createdRoot: boolean;
|
|
93
|
+
_original: import("../../core/dom.js").TargetSnapshot;
|
|
94
|
+
_cleaned: boolean;
|
|
95
|
+
_title: string;
|
|
96
|
+
_link: CardLinkDescriptor;
|
|
97
|
+
_actionAbort: AbortController;
|
|
98
|
+
_linkAbort: AbortController;
|
|
99
|
+
static cssName: string;
|
|
100
|
+
/** @type {Readonly<CardOptions>} */
|
|
101
|
+
static defaults: Readonly<CardOptions>;
|
|
102
|
+
/**
|
|
103
|
+
* Creates or enhances one card.
|
|
104
|
+
* @param {Element|string|null} [target=null] Existing card container, selector, or null.
|
|
105
|
+
* @param {CardOptions} [options={}] Card options.
|
|
106
|
+
*/
|
|
107
|
+
constructor(target?: Element | string | null, options?: CardOptions);
|
|
108
|
+
/** @returns {HTMLElement} */
|
|
109
|
+
render(): HTMLElement;
|
|
110
|
+
/** Replaces the card title. @param {string} title Next title. @returns {this} */
|
|
111
|
+
setTitle(title: string): this;
|
|
112
|
+
/** Replaces or removes the media region. @param {CardContent} content Media. @returns {this} */
|
|
113
|
+
setMedia(content: CardContent): this;
|
|
114
|
+
/** Replaces or clears the main content. @param {CardContent} content Content. @returns {this} */
|
|
115
|
+
setContent(content: CardContent): this;
|
|
116
|
+
/** Replaces the secondary action controls. @param {CardAction[]} actions Actions. @returns {this} */
|
|
117
|
+
setActions(actions: CardAction[]): this;
|
|
118
|
+
/** Replaces or removes the footer. @param {CardContent} content Footer. @returns {this} */
|
|
119
|
+
setFooter(content: CardContent): this;
|
|
120
|
+
/** Sets or removes the title's native primary link. @param {CardLink} link Link. @returns {this} */
|
|
121
|
+
setLink(link: CardLink): this;
|
|
122
|
+
/** Restores an enhanced target exactly, or removes an owned card. @returns {void} */
|
|
123
|
+
destroy(): void;
|
|
124
|
+
/** @returns {void} */
|
|
125
|
+
_renderHeading(): void;
|
|
126
|
+
/** @returns {void} */
|
|
127
|
+
_syncHeader(): void;
|
|
128
|
+
}
|
|
@@ -219,6 +219,7 @@ export declare class Chart extends Component<ChartOptions> {
|
|
|
219
219
|
_chartOptions: Record<string, unknown>;
|
|
220
220
|
_loading: boolean;
|
|
221
221
|
_error: unknown;
|
|
222
|
+
_hasError: boolean;
|
|
222
223
|
_handle: ChartHandle;
|
|
223
224
|
_destroyed: boolean;
|
|
224
225
|
_observer: ResizeObserver;
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
export type FilterJson = null | boolean | number | string | FilterJson[] | {
|
|
2
|
+
[key: string]: FilterJson;
|
|
3
|
+
};
|
|
4
|
+
export type FilterCondition = {
|
|
5
|
+
kind: 'condition';
|
|
6
|
+
id: string;
|
|
7
|
+
field: string;
|
|
8
|
+
operator: string;
|
|
9
|
+
value: FilterJson;
|
|
10
|
+
};
|
|
11
|
+
export type FilterGroup = {
|
|
12
|
+
kind: 'group';
|
|
13
|
+
id: string;
|
|
14
|
+
logic: 'and' | 'or';
|
|
15
|
+
children: FilterNode[];
|
|
16
|
+
};
|
|
17
|
+
export type FilterNode = FilterCondition | FilterGroup;
|
|
18
|
+
export type FilterAst = {
|
|
19
|
+
version: 1;
|
|
20
|
+
root: FilterGroup;
|
|
21
|
+
};
|
|
22
|
+
export type FilterOperator = {
|
|
23
|
+
id: string;
|
|
24
|
+
label: string;
|
|
25
|
+
arity: 'none' | 'single' | 'pair' | 'many';
|
|
26
|
+
types: string[];
|
|
27
|
+
};
|
|
28
|
+
export type FilterField = {
|
|
29
|
+
id: string;
|
|
30
|
+
label: string;
|
|
31
|
+
type: string;
|
|
32
|
+
operators?: string[];
|
|
33
|
+
defaultOperator?: string;
|
|
34
|
+
};
|
|
35
|
+
export type FilterValidationError = {
|
|
36
|
+
nodeId: string;
|
|
37
|
+
code: string;
|
|
38
|
+
message: string;
|
|
39
|
+
};
|
|
40
|
+
/** @typedef {null|boolean|number|string|FilterJson[]|{[key:string]: FilterJson}} FilterJson */
|
|
41
|
+
/** @typedef {{kind:'condition', id:string, field:string, operator:string, value:FilterJson}} FilterCondition */
|
|
42
|
+
/** @typedef {{kind:'group', id:string, logic:'and'|'or', children:FilterNode[]}} FilterGroup */
|
|
43
|
+
/** @typedef {FilterCondition|FilterGroup} FilterNode */
|
|
44
|
+
/** @typedef {{version:1, root:FilterGroup}} FilterAst */
|
|
45
|
+
/** @typedef {{id:string, label:string, arity:'none'|'single'|'pair'|'many', types:string[]}} FilterOperator */
|
|
46
|
+
/** @typedef {{id:string, label:string, type:string, operators?:string[], defaultOperator?:string}} FilterField */
|
|
47
|
+
/** @typedef {{nodeId:string, code:string, message:string}} FilterValidationError */
|
|
48
|
+
/** Core operators are application-neutral IDs; an adapter maps them to executable query syntax. */
|
|
49
|
+
export declare const filterOperators: readonly FilterOperator[];
|
|
50
|
+
/** @returns {FilterAst} */
|
|
51
|
+
export declare function emptyFilterAst(): FilterAst;
|
|
52
|
+
/** @param {Partial<FilterCondition>} [initial={}] @returns {FilterCondition} */
|
|
53
|
+
export declare function filterCondition(initial?: Partial<FilterCondition>): FilterCondition;
|
|
54
|
+
/**
|
|
55
|
+
* Returns a defensive JSON-safe copy suitable for a condition value.
|
|
56
|
+
* @param {unknown} value
|
|
57
|
+
* @returns {FilterJson}
|
|
58
|
+
*/
|
|
59
|
+
export declare function cloneFilterValue(value: unknown): FilterJson;
|
|
60
|
+
/** @param {'and'|'or'} [logic='and'] @param {FilterNode[]} [children=[]] @returns {FilterGroup} */
|
|
61
|
+
export declare function filterGroup(logic?: 'and' | 'or', children?: FilterNode[]): FilterGroup;
|
|
62
|
+
/**
|
|
63
|
+
* Parses untrusted state into a defensive JSON-safe AST. It rejects structural corruption but
|
|
64
|
+
* deliberately keeps unknown field/operator IDs for semantic validation and migration UI.
|
|
65
|
+
* @param {unknown} value
|
|
66
|
+
* @param {{maxDepth?:number, maxConditions?:number}} [limits={}]
|
|
67
|
+
* @returns {FilterAst}
|
|
68
|
+
*/
|
|
69
|
+
export declare function parseFilterAst(value: unknown, limits?: {
|
|
70
|
+
maxDepth?: number;
|
|
71
|
+
maxConditions?: number;
|
|
72
|
+
}): FilterAst;
|
|
73
|
+
/** @param {FilterAst} value @returns {FilterAst} */
|
|
74
|
+
export declare function cloneFilterAst(value: FilterAst): FilterAst;
|
|
75
|
+
/** @param {FilterAst} value @returns {string} */
|
|
76
|
+
export declare function stringifyFilterAst(value: FilterAst): string;
|
|
77
|
+
/**
|
|
78
|
+
* Performs field/operator/arity validation without compiling or executing the expression.
|
|
79
|
+
* @param {FilterAst} ast
|
|
80
|
+
* @param {FilterField[]} fields
|
|
81
|
+
* @param {FilterOperator[]} [operators=filterOperators]
|
|
82
|
+
* @returns {{valid:boolean, errors:FilterValidationError[]}}
|
|
83
|
+
*/
|
|
84
|
+
export declare function validateFilterAst(ast: FilterAst, fields: FilterField[], operators?: FilterOperator[]): {
|
|
85
|
+
valid: boolean;
|
|
86
|
+
errors: FilterValidationError[];
|
|
87
|
+
};
|