@zeyos/zx 4.4.0 → 5.0.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 +283 -0
- package/README.md +42 -10
- package/dist/types/components/activity-list/activity-list.d.ts +22 -0
- package/dist/types/components/app-sidebar/app-sidebar.d.ts +5 -3
- package/dist/types/components/avatar/avatar.d.ts +46 -7
- package/dist/types/components/badge/badge.d.ts +21 -1
- package/dist/types/components/button/button.d.ts +15 -0
- package/dist/types/components/chart/chart.d.ts +10 -0
- package/dist/types/components/checklist/checklist.d.ts +9 -0
- package/dist/types/components/code-editor/code-editor.d.ts +6 -17
- package/dist/types/components/datebox/date-range-box.d.ts +5 -1
- package/dist/types/components/datebox/datebox.d.ts +7 -2
- package/dist/types/components/dialog/dialog.d.ts +46 -6
- package/dist/types/components/dropdown/dropdown.d.ts +2 -2
- package/dist/types/components/entity-ref/entity-ref.d.ts +2 -2
- package/dist/types/components/field/field.d.ts +24 -2
- package/dist/types/components/fieldset/fieldset.d.ts +19 -1
- package/dist/types/components/file-item/file-item.d.ts +34 -6
- package/dist/types/components/form/form.d.ts +12 -1
- package/dist/types/components/kanban-view/kanban-card.d.ts +8 -0
- package/dist/types/components/launcher/launcher.d.ts +260 -15
- package/dist/types/components/list-toolbar/list-toolbar.d.ts +1 -1
- package/dist/types/components/menu-button/menu-button.d.ts +33 -5
- package/dist/types/components/message/message.d.ts +119 -17
- package/dist/types/components/modal/modal.d.ts +13 -2
- package/dist/types/components/select/color.d.ts +12 -0
- package/dist/types/components/select/glyphs.d.ts +124 -0
- package/dist/types/components/select/select.d.ts +11 -3
- package/dist/types/components/stat-tile/stat-tile.d.ts +16 -5
- package/dist/types/components/tabbox/tabbox.d.ts +9 -0
- package/dist/types/components/table/table.d.ts +46 -1
- package/dist/types/components/tag-picker/tag-picker.d.ts +21 -4
- package/dist/types/components/tree/tree.d.ts +13 -0
- package/dist/types/core/breakpoint.d.ts +1 -1
- package/dist/types/core/icons.d.ts +23 -25
- package/dist/types/core/motion.d.ts +59 -0
- package/dist/types/core/overlay-host.d.ts +15 -1
- package/dist/types/index.d.ts +5 -3
- package/dist/types/zeyos/connect.d.ts +6 -0
- package/dist/types/zeyos/form.d.ts +50 -9
- package/dist/types/zeyos/index.d.ts +1 -1
- package/dist/types/zeyos/query.d.ts +79 -0
- package/dist/types/zeyos/schema.d.ts +24 -1
- package/dist/types/zeyos/table.d.ts +100 -14
- package/dist/types/zeyos/view.d.ts +10 -0
- package/dist/zx-zeyos.esm.js +1621 -443
- package/dist/zx-zeyos.esm.min.js +53 -5
- package/dist/zx.css +1411 -660
- package/dist/zx.esm.js +1976 -703
- package/dist/zx.esm.min.js +56 -8
- package/dist/zx.global.js +1978 -705
- package/dist/zx.global.min.js +56 -8
- package/dist/zx.min.css +1 -1
- package/docs/api.json +219 -34
- package/docs/llms.md +472 -110
- package/docs/llms.txt +3 -3
- package/package.json +1 -1
- package/src/components/account-menu/account-menu.css +35 -10
- package/src/components/activity-item/activity-item.css +1 -1
- package/src/components/activity-item/activity-item.js +3 -0
- package/src/components/activity-list/activity-list.css +38 -3
- package/src/components/activity-list/activity-list.js +34 -0
- package/src/components/app-icon/app-icon.css +1 -1
- package/src/components/app-rail/app-rail.css +40 -79
- package/src/components/app-sidebar/app-sidebar.css +109 -174
- package/src/components/app-sidebar/app-sidebar.js +21 -6
- package/src/components/aurora/aurora.css +5 -3
- package/src/components/avatar/avatar.css +32 -7
- package/src/components/avatar/avatar.js +72 -8
- package/src/components/badge/badge.css +54 -2
- package/src/components/badge/badge.js +29 -2
- package/src/components/button/button.css +67 -9
- package/src/components/button/button.js +38 -0
- package/src/components/calendar/calendar.css +46 -46
- package/src/components/card/card.css +2 -2
- package/src/components/card-view/card-view.css +9 -7
- package/src/components/chart/chart.css +4 -1
- package/src/components/chart/chart.js +12 -0
- package/src/components/check-button/check-button.css +10 -2
- package/src/components/checklist/checklist.css +9 -2
- package/src/components/checklist/checklist.js +11 -5
- package/src/components/checklist/field-adapter.js +3 -1
- package/src/components/code-editor/code-editor.css +6 -5
- package/src/components/code-editor/code-editor.js +19 -1
- package/src/components/context-menu/context-menu.css +9 -4
- package/src/components/copy/copy-button.css +6 -0
- package/src/components/copy/copy-input.css +8 -3
- package/src/components/data-filter/data-filter.css +5 -4
- package/src/components/date-picker/date-picker.css +6 -6
- package/src/components/date-picker/date-range-picker.css +3 -3
- package/src/components/date-picker/time-picker.css +1 -1
- package/src/components/datebox/date-range-box.css +79 -2
- package/src/components/datebox/date-range-box.js +13 -2
- package/src/components/datebox/datebox.css +79 -2
- package/src/components/datebox/datebox.js +13 -2
- package/src/components/dialog/dialog.css +26 -0
- package/src/components/dialog/dialog.js +99 -17
- package/src/components/dropdown/dropdown.css +1 -1
- package/src/components/dropdown/dropdown.js +5 -3
- package/src/components/empty-state/empty-state.css +2 -2
- package/src/components/entity-ref/entity-ref.css +1 -1
- package/src/components/entity-ref/entity-ref.js +1 -1
- package/src/components/field/field.css +28 -9
- package/src/components/field/field.js +68 -26
- package/src/components/field-upload/field-upload.css +1 -1
- package/src/components/fieldset/fieldset.css +5 -3
- package/src/components/fieldset/fieldset.js +28 -5
- package/src/components/file-item/file-item.js +144 -10
- package/src/components/filter/filter.js +7 -3
- package/src/components/filter-panel/filter-panel.css +1 -1
- package/src/components/finder/finder.css +15 -13
- package/src/components/form/form.css +5 -4
- package/src/components/form/form.js +11 -2
- package/src/components/grid/grid.css +1 -1
- package/src/components/groupbox/groupbox.css +1 -1
- package/src/components/kanban-view/kanban-card.js +11 -3
- package/src/components/kanban-view/kanban-view.css +39 -15
- package/src/components/kanban-view/kanban-view.js +4 -4
- package/src/components/launcher/launcher.css +107 -25
- package/src/components/launcher/launcher.js +503 -41
- package/src/components/list-toolbar/list-toolbar.css +13 -8
- package/src/components/list-toolbar/list-toolbar.js +1 -1
- package/src/components/master-panel/master-panel.css +2 -0
- package/src/components/menu-button/menu-button.css +9 -4
- package/src/components/menu-button/menu-button.js +65 -9
- package/src/components/message/message.css +33 -3
- package/src/components/message/message.js +217 -15
- package/src/components/modal/modal.js +18 -3
- package/src/components/navigation-bar/navigation-bar.css +18 -9
- package/src/components/number-field/field-adapter.js +1 -0
- package/src/components/number-field/number-field.css +70 -0
- package/src/components/number-field/number-field.js +2 -0
- package/src/components/pagination/pagination.css +8 -6
- package/src/components/panel/panel.css +1 -1
- package/src/components/rating/rating.css +7 -0
- package/src/components/select/color.js +22 -0
- package/src/components/select/field-adapter.js +2 -0
- package/src/components/select/glyphs.js +165 -0
- package/src/components/select/select.css +138 -45
- package/src/components/select/select.js +83 -47
- package/src/components/sheet/sheet.css +11 -8
- package/src/components/slider/slider.css +16 -2
- package/src/components/slider/slider.js +1 -1
- package/src/components/sort-control/sort-control.css +4 -1
- package/src/components/stat-tile/stat-tile.css +41 -46
- package/src/components/stat-tile/stat-tile.js +17 -6
- package/src/components/tabbox/tabbox.css +32 -27
- package/src/components/tabbox/tabbox.js +5 -1
- package/src/components/table/table.css +104 -29
- package/src/components/table/table.js +90 -16
- package/src/components/tag-picker/tag-picker.css +83 -5
- package/src/components/tag-picker/tag-picker.js +25 -8
- package/src/components/timebox/timebox.css +22 -2
- package/src/components/toggle/toggle.css +12 -1
- package/src/components/toolbar/toolbar.js +2 -2
- package/src/components/tooltip/tooltip.css +4 -0
- package/src/components/tooltip/tooltip.js +10 -3
- package/src/components/tree/tree.css +25 -16
- package/src/components/tree/tree.js +31 -0
- package/src/components/value-list/value-list.css +3 -3
- package/src/components/view/record-view.js +1 -1
- package/src/core/breakpoint.js +1 -1
- package/src/core/icons.js +193 -60
- package/src/core/motion.js +147 -0
- package/src/core/overlay-host.js +21 -2
- package/src/index.js +5 -3
- package/src/internal/app-rail.js +1 -2
- package/src/zeyos/connect.js +6 -2
- package/src/zeyos/form.js +67 -27
- package/src/zeyos/index.js +1 -1
- package/src/zeyos/query.js +153 -0
- package/src/zeyos/schema.js +144 -27
- package/src/zeyos/table.js +68 -5
- package/src/zeyos/view.js +6 -0
- package/styles/base.css +56 -0
- package/styles/icons.css +11 -1
- package/styles/tokens/dark.css +113 -37
- package/styles/tokens/global.css +121 -27
- package/styles/tokens/semantic.css +100 -31
- package/styles/tokens/themes.css +7 -6
- package/styles/zx.css +0 -1
- package/styles/tokens/density.css +0 -9
|
@@ -1,18 +1,48 @@
|
|
|
1
1
|
import { Component } from '../../core/component.js';
|
|
2
2
|
export type MessageKind = 'info' | 'success' | 'warning' | 'error';
|
|
3
|
+
export type MessageAction = {
|
|
4
|
+
/**
|
|
5
|
+
* Button text: a verb naming what happens ("Undo", "Approve", "Retry").
|
|
6
|
+
*/
|
|
7
|
+
label: string;
|
|
8
|
+
/**
|
|
9
|
+
* Runs when the button is activated, by pointer
|
|
10
|
+
* or keyboard; the message closes right after it.
|
|
11
|
+
*/
|
|
12
|
+
onclick?: (event: MouseEvent) => void;
|
|
13
|
+
/**
|
|
14
|
+
* Button kind; the default is the
|
|
15
|
+
* secondary button.
|
|
16
|
+
*/
|
|
17
|
+
kind?: 'default' | 'primary' | 'danger' | 'ghost';
|
|
18
|
+
};
|
|
3
19
|
export type MessageShowOptions = {
|
|
4
20
|
/**
|
|
5
21
|
* Message intent (`danger` aliases `error`).
|
|
6
22
|
*/
|
|
7
23
|
kind?: MessageKind | 'danger';
|
|
8
24
|
/**
|
|
9
|
-
* Auto-dismiss delay in milliseconds; zero persists.
|
|
25
|
+
* Auto-dismiss delay in milliseconds; zero persists. A message
|
|
26
|
+
* with an `action` stays at least 8000ms.
|
|
10
27
|
*/
|
|
11
28
|
timeout?: number;
|
|
12
29
|
/**
|
|
13
30
|
* Whether to render a close button.
|
|
14
31
|
*/
|
|
15
32
|
closable?: boolean;
|
|
33
|
+
/**
|
|
34
|
+
* A command button inside the message. The message
|
|
35
|
+
* never times out while the pointer is over it or focus is inside it.
|
|
36
|
+
*/
|
|
37
|
+
action?: MessageAction | null;
|
|
38
|
+
/**
|
|
39
|
+
* Visual shown in place of the
|
|
40
|
+
* kind icon, such as an Avatar's element. It is decorative — the message text must say what it
|
|
41
|
+
* shows.
|
|
42
|
+
*/
|
|
43
|
+
leading?: Node | {
|
|
44
|
+
toElement: () => Node | null;
|
|
45
|
+
} | null;
|
|
16
46
|
/**
|
|
17
47
|
* Element whose nearest Zx theme scope owns a floating toast.
|
|
18
48
|
*/
|
|
@@ -37,28 +67,32 @@ export type MessageOptions = {
|
|
|
37
67
|
maxVisible?: number;
|
|
38
68
|
};
|
|
39
69
|
export type MessageHandle = {
|
|
40
|
-
close: () => void;
|
|
41
|
-
};
|
|
42
|
-
export type ProgressHandle = {
|
|
43
70
|
/**
|
|
44
|
-
*
|
|
71
|
+
* Closes the message.
|
|
45
72
|
*/
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* Completes and dismisses the progress message.
|
|
49
|
-
*/
|
|
50
|
-
done: () => void;
|
|
51
|
-
/**
|
|
52
|
-
* Marks progress as failed and dismisses it later.
|
|
53
|
-
*/
|
|
54
|
-
fail: (text?: string) => void;
|
|
73
|
+
close: () => void;
|
|
55
74
|
};
|
|
56
75
|
/** @typedef {'info'|'success'|'warning'|'error'} MessageKind */
|
|
76
|
+
/**
|
|
77
|
+
* The one command a message may carry, drawn as a small button beside its text.
|
|
78
|
+
* @typedef {Object} MessageAction
|
|
79
|
+
* @property {string} label Button text: a verb naming what happens ("Undo", "Approve", "Retry").
|
|
80
|
+
* @property {(event: MouseEvent) => void} [onclick] Runs when the button is activated, by pointer
|
|
81
|
+
* or keyboard; the message closes right after it.
|
|
82
|
+
* @property {'default'|'primary'|'danger'|'ghost'} [kind='default'] Button kind; the default is the
|
|
83
|
+
* secondary button.
|
|
84
|
+
*/
|
|
57
85
|
/**
|
|
58
86
|
* @typedef {Object} MessageShowOptions
|
|
59
87
|
* @property {MessageKind|'danger'} [kind='info'] Message intent (`danger` aliases `error`).
|
|
60
|
-
* @property {number} [timeout=4000] Auto-dismiss delay in milliseconds; zero persists.
|
|
88
|
+
* @property {number} [timeout=4000] Auto-dismiss delay in milliseconds; zero persists. A message
|
|
89
|
+
* with an `action` stays at least 8000ms.
|
|
61
90
|
* @property {boolean} [closable=true] Whether to render a close button.
|
|
91
|
+
* @property {MessageAction|null} [action=null] A command button inside the message. The message
|
|
92
|
+
* never times out while the pointer is over it or focus is inside it.
|
|
93
|
+
* @property {Node|{toElement: () => Node|null}|null} [leading=null] Visual shown in place of the
|
|
94
|
+
* kind icon, such as an Avatar's element. It is decorative — the message text must say what it
|
|
95
|
+
* shows.
|
|
62
96
|
* @property {Element|string|null} [scope=null] Element whose nearest Zx theme scope owns a floating toast.
|
|
63
97
|
*/
|
|
64
98
|
/**
|
|
@@ -68,7 +102,28 @@ export type ProgressHandle = {
|
|
|
68
102
|
* @property {boolean} [closable=true] Default close-button visibility.
|
|
69
103
|
* @property {number} [maxVisible=5] Maximum number of visible messages.
|
|
70
104
|
*/
|
|
71
|
-
/**
|
|
105
|
+
/**
|
|
106
|
+
* Returned by every `show()`: closes that message early. Closing one that already closed, or one
|
|
107
|
+
* still waiting in the queue, is safe.
|
|
108
|
+
* @typedef {Object} MessageHandle
|
|
109
|
+
* @property {() => void} close Closes the message.
|
|
110
|
+
*/
|
|
111
|
+
/** The shortest time a message that carries an action stays, in milliseconds. */
|
|
112
|
+
export declare const MESSAGE_ACTION_MIN_TIMEOUT = 8000;
|
|
113
|
+
export type ProgressHandle = {
|
|
114
|
+
/**
|
|
115
|
+
* Updates progress and optional text.
|
|
116
|
+
*/
|
|
117
|
+
update: (pct: number, text?: string) => void;
|
|
118
|
+
/**
|
|
119
|
+
* Completes and dismisses the progress message.
|
|
120
|
+
*/
|
|
121
|
+
done: () => void;
|
|
122
|
+
/**
|
|
123
|
+
* Marks progress as failed and dismisses it later.
|
|
124
|
+
*/
|
|
125
|
+
fail: (text?: string) => void;
|
|
126
|
+
};
|
|
72
127
|
/**
|
|
73
128
|
* @typedef {Object} ProgressHandle
|
|
74
129
|
* @property {(pct: number, text?: string) => void} update Updates progress and optional text.
|
|
@@ -129,6 +184,8 @@ export declare class Message extends Component<MessageOptions> {
|
|
|
129
184
|
children: Node[];
|
|
130
185
|
};
|
|
131
186
|
_entries: Set<any>;
|
|
187
|
+
/** @type {Element|null} The overlay host this instance is the floating region of; null when inline. */
|
|
188
|
+
_floatingHost: Element | null;
|
|
132
189
|
_queue: MessageQueue<any>;
|
|
133
190
|
_cleaned: boolean;
|
|
134
191
|
static cssName: string;
|
|
@@ -187,13 +244,24 @@ export declare class Message extends Component<MessageOptions> {
|
|
|
187
244
|
static progress(text: string, options?: {
|
|
188
245
|
scope?: Element | string | null;
|
|
189
246
|
}): ProgressHandle;
|
|
247
|
+
/**
|
|
248
|
+
* Removes a floating region at once, toasts and all, without waiting for them to time out.
|
|
249
|
+
*
|
|
250
|
+
* A region already removes itself when its last toast closes, and one whose host has left the
|
|
251
|
+
* document is replaced on the next toast, so this is only for a host being torn down while
|
|
252
|
+
* toasts are still showing — an application view unmounting its themed shell, say.
|
|
253
|
+
* @param {Element|string} scope Element or selector whose nearest Zx theme scope owns the region,
|
|
254
|
+
* as passed to `show()`.
|
|
255
|
+
* @returns {boolean} Whether there was a region to remove.
|
|
256
|
+
*/
|
|
257
|
+
static disposeRegion(scope: Element | string): boolean;
|
|
190
258
|
/** @returns {void} */
|
|
191
259
|
destroy(): void;
|
|
192
260
|
/** @param {string} text @returns {ProgressHandle} */
|
|
193
261
|
_progress(text: string): ProgressHandle;
|
|
194
262
|
/**
|
|
195
263
|
* @param {string|Node} msg
|
|
196
|
-
* @param {{kind: MessageKind, timeout: number, closable: boolean}} settings
|
|
264
|
+
* @param {{kind: MessageKind, timeout: number, closable: boolean, action?: MessageAction|null, leading?: Node|null}} settings
|
|
197
265
|
* @param {{pct: number, text: string}|null} [progress=null]
|
|
198
266
|
* @returns {any}
|
|
199
267
|
*/
|
|
@@ -201,6 +269,8 @@ export declare class Message extends Component<MessageOptions> {
|
|
|
201
269
|
kind: MessageKind;
|
|
202
270
|
timeout: number;
|
|
203
271
|
closable: boolean;
|
|
272
|
+
action?: MessageAction | null;
|
|
273
|
+
leading?: Node | null;
|
|
204
274
|
}, progress?: {
|
|
205
275
|
pct: number;
|
|
206
276
|
text: string;
|
|
@@ -217,6 +287,17 @@ export declare class Message extends Component<MessageOptions> {
|
|
|
217
287
|
_close(entry: any): void;
|
|
218
288
|
/** @param {any} entry @returns {void} */
|
|
219
289
|
_finish(entry: any): void;
|
|
290
|
+
/**
|
|
291
|
+
* Takes a floating region out of the document once its last toast has gone, so an emptied host
|
|
292
|
+
* is not left holding a region nobody uses. Inline areas stay: their element is the caller's.
|
|
293
|
+
* @returns {void}
|
|
294
|
+
*/
|
|
295
|
+
_releaseIfEmpty(): void;
|
|
296
|
+
/**
|
|
297
|
+
* Destroys a floating region and removes its element.
|
|
298
|
+
* @returns {void}
|
|
299
|
+
*/
|
|
300
|
+
_disposeFloating(): void;
|
|
220
301
|
/**
|
|
221
302
|
* Resolves a message through the host translator, falling back to the built-in English text.
|
|
222
303
|
* @param {string} key Message key.
|
|
@@ -225,3 +306,24 @@ export declare class Message extends Component<MessageOptions> {
|
|
|
225
306
|
*/
|
|
226
307
|
_message(key: string, fallback: string): string;
|
|
227
308
|
}
|
|
309
|
+
/**
|
|
310
|
+
* Settles how long a message stays. A message that carries an action stays at least
|
|
311
|
+
* `MESSAGE_ACTION_MIN_TIMEOUT`, so there is time to reach it; zero still means it stays until
|
|
312
|
+
* closed, and anything that is not a finite number falls back to the 4000ms default.
|
|
313
|
+
* @param {unknown} timeout Requested auto-dismiss delay in milliseconds.
|
|
314
|
+
* @param {boolean} [hasAction=false] Whether the message carries an action.
|
|
315
|
+
* @returns {number}
|
|
316
|
+
*/
|
|
317
|
+
export declare function messageTimeout(timeout: unknown, hasAction?: boolean): number;
|
|
318
|
+
/**
|
|
319
|
+
* Copies a message action into the shape the message renders, or returns null when there is
|
|
320
|
+
* nothing to render: no object, or no label. An unknown `kind` reads as the default, secondary
|
|
321
|
+
* button, and a missing `onclick` leaves a button that only closes the message.
|
|
322
|
+
* @param {unknown} value Action descriptor.
|
|
323
|
+
* @returns {{label: string, kind: 'default'|'primary'|'danger'|'ghost', onclick: ((event: MouseEvent) => void)|null}|null}
|
|
324
|
+
*/
|
|
325
|
+
export declare function normalizeMessageAction(value: unknown): {
|
|
326
|
+
label: string;
|
|
327
|
+
kind: 'default' | 'primary' | 'danger' | 'ghost';
|
|
328
|
+
onclick: ((event: MouseEvent) => void) | null;
|
|
329
|
+
} | null;
|
|
@@ -23,7 +23,7 @@ export type ModalOptions = {
|
|
|
23
23
|
*/
|
|
24
24
|
destroyOnClose?: boolean;
|
|
25
25
|
/**
|
|
26
|
-
* Element whose nearest Zx theme scope owns the overlay; defaults to the opener.
|
|
26
|
+
* Element whose nearest Zx theme scope owns the overlay; defaults to the opener. Resolved on every open, so a scope connected after construction still owns it.
|
|
27
27
|
*/
|
|
28
28
|
scope?: Element | string | null;
|
|
29
29
|
/**
|
|
@@ -48,7 +48,7 @@ export type ModalOptions = {
|
|
|
48
48
|
* @property {boolean} [closable=true] Whether Escape may close the modal.
|
|
49
49
|
* @property {boolean} [lightDismiss=false] Whether a backdrop click closes the modal.
|
|
50
50
|
* @property {boolean} [destroyOnClose=false] Whether to destroy the modal after it closes.
|
|
51
|
-
* @property {Element|string|null} [scope=null] Element whose nearest Zx theme scope owns the overlay; defaults to the opener.
|
|
51
|
+
* @property {Element|string|null} [scope=null] Element whose nearest Zx theme scope owns the overlay; defaults to the opener. Resolved on every open, so a scope connected after construction still owns it.
|
|
52
52
|
* @property {(event: CustomEvent<Record<string, never>>) => void} [onopen] Open event listener.
|
|
53
53
|
* @property {(event: CustomEvent<{result: unknown}>) => void} [onclose] Close event listener.
|
|
54
54
|
* @property {(event: CustomEvent<Record<string, never>>) => void} [oncancel] Cancel event listener.
|
|
@@ -154,6 +154,17 @@ export declare class Modal extends Component<ModalOptions> {
|
|
|
154
154
|
* @returns {HTMLDialogElement}
|
|
155
155
|
*/
|
|
156
156
|
render(): HTMLDialogElement;
|
|
157
|
+
/**
|
|
158
|
+
* Gives a freshly rendered dialog its first home.
|
|
159
|
+
*
|
|
160
|
+
* A `scope` that is not in the document yet cannot say which theme it belongs to, and the
|
|
161
|
+
* `<body>` that `mountTarget()` would answer is outside it. The dialog then stays detached and
|
|
162
|
+
* `open()` places it, by which time the scope is in place. Called from `render()`, so it may
|
|
163
|
+
* read `this.options` but no instance state.
|
|
164
|
+
* @param {HTMLDialogElement} dialog The rendered dialog.
|
|
165
|
+
* @returns {void}
|
|
166
|
+
*/
|
|
167
|
+
_mountInitial(dialog: HTMLDialogElement): void;
|
|
157
168
|
/**
|
|
158
169
|
* Opens the modal in the browser top layer.
|
|
159
170
|
* @returns {this}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Accepts an item colour for an inline custom property: a CSS colour literal (`#0b7285`, `rgb(…)`,
|
|
3
|
+
* `oklch(…)`, a named colour) or a reference to a design token (`var(--zx-color-tone-blue-fg)`),
|
|
4
|
+
* so an item can follow the theme rather than fix one colour for light and dark alike. Anything
|
|
5
|
+
* else — other functions, declarations, a `var()` with a fallback — is refused.
|
|
6
|
+
*
|
|
7
|
+
* Shared by `Select.entity()` and `TagPicker`, the two components that take a colour per item.
|
|
8
|
+
*
|
|
9
|
+
* @param {unknown} value Candidate colour.
|
|
10
|
+
* @returns {string|null} The trimmed colour, or null when the value is not one.
|
|
11
|
+
*/
|
|
12
|
+
export declare function itemColor(value: unknown): string | null;
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
export type StatusIndicator = 'dotted' | 'ring' | 'progress' | 'review' | 'ready' | 'waiting' | 'done' | 'canceled' | 'duplicate';
|
|
2
|
+
export type StatusTone = 'muted' | 'neutral' | 'warning' | 'info' | 'accent' | 'success' | 'danger';
|
|
3
|
+
export type StatusId = 'backlog' | 'todo' | 'in-progress' | 'in-review' | 'review' | 'ready' | 'waiting' | 'done' | 'canceled' | 'cancelled' | 'duplicate';
|
|
4
|
+
export type StatusIconOptions = {
|
|
5
|
+
/**
|
|
6
|
+
* Shape, overriding the status's own.
|
|
7
|
+
*/
|
|
8
|
+
indicator?: StatusIndicator;
|
|
9
|
+
/**
|
|
10
|
+
* Colour, overriding the status's own.
|
|
11
|
+
*/
|
|
12
|
+
tone?: StatusTone;
|
|
13
|
+
/**
|
|
14
|
+
* Accessible name. Without one the glyph is decorative
|
|
15
|
+
* (`aria-hidden`) and must sit beside text, or inside a control with a tooltip, that says the
|
|
16
|
+
* status.
|
|
17
|
+
*/
|
|
18
|
+
label?: string | null;
|
|
19
|
+
};
|
|
20
|
+
export type PriorityIconOptions = {
|
|
21
|
+
/**
|
|
22
|
+
* Accessible name. Without one the glyph is decorative
|
|
23
|
+
* (`aria-hidden`) and must sit beside text, or inside a control with a tooltip, that says the
|
|
24
|
+
* priority.
|
|
25
|
+
*/
|
|
26
|
+
label?: string | null;
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* The shapes a workflow-status glyph can take. Each status reads by shape first and colour
|
|
30
|
+
* second, so the set stays legible to readers who do not see the colour.
|
|
31
|
+
* @typedef {'dotted'|'ring'|'progress'|'review'|'ready'|'waiting'|'done'|'canceled'|'duplicate'} StatusIndicator
|
|
32
|
+
*/
|
|
33
|
+
/** @typedef {'muted'|'neutral'|'warning'|'info'|'accent'|'success'|'danger'} StatusTone */
|
|
34
|
+
/**
|
|
35
|
+
* The built-in workflow statuses. `review` and `cancelled` are accepted as spellings of
|
|
36
|
+
* `in-review` and `canceled`.
|
|
37
|
+
* @typedef {'backlog'|'todo'|'in-progress'|'in-review'|'review'|'ready'|'waiting'|'done'|'canceled'|'cancelled'|'duplicate'} StatusId
|
|
38
|
+
*/
|
|
39
|
+
/**
|
|
40
|
+
* @typedef {Object} StatusIconOptions
|
|
41
|
+
* @property {StatusIndicator} [indicator] Shape, overriding the status's own.
|
|
42
|
+
* @property {StatusTone} [tone] Colour, overriding the status's own.
|
|
43
|
+
* @property {string|null} [label=null] Accessible name. Without one the glyph is decorative
|
|
44
|
+
* (`aria-hidden`) and must sit beside text, or inside a control with a tooltip, that says the
|
|
45
|
+
* status.
|
|
46
|
+
*/
|
|
47
|
+
/**
|
|
48
|
+
* @typedef {Object} PriorityIconOptions
|
|
49
|
+
* @property {string|null} [label=null] Accessible name. Without one the glyph is decorative
|
|
50
|
+
* (`aria-hidden`) and must sit beside text, or inside a control with a tooltip, that says the
|
|
51
|
+
* priority.
|
|
52
|
+
*/
|
|
53
|
+
/** Every shape `statusIcon()` draws. */
|
|
54
|
+
export declare const STATUS_INDICATORS: readonly string[];
|
|
55
|
+
/** Every colour a status glyph takes, from the semantic set. */
|
|
56
|
+
export declare const STATUS_TONES: readonly string[];
|
|
57
|
+
/**
|
|
58
|
+
* The built-in statuses in workflow order, as `[id, message key, English name, indicator, tone]`.
|
|
59
|
+
* `Select.status()` lists them; `statusIcon()` draws them.
|
|
60
|
+
*/
|
|
61
|
+
export declare const DEFAULT_STATUSES: readonly string[][];
|
|
62
|
+
/** The top priority level, the one coloured level: a danger square with an exclamation mark. */
|
|
63
|
+
export declare const PRIORITY_URGENT = 4;
|
|
64
|
+
/**
|
|
65
|
+
* Resolves the shape and colour of a status glyph.
|
|
66
|
+
*
|
|
67
|
+
* A status is a built-in id (or one of its other spellings), or a status item of the kind
|
|
68
|
+
* `Select.status({items})` takes, whose own `indicator` and `tone` win over the built-in status
|
|
69
|
+
* its `ID` names. Options win over both. An unknown shape falls back to the empty ring and an
|
|
70
|
+
* unknown colour to muted, as `Select.status()` does with a custom item.
|
|
71
|
+
* @param {StatusId|string|{ID?: unknown, id?: unknown, indicator?: unknown, tone?: unknown}|null|undefined} status
|
|
72
|
+
* @param {StatusIconOptions} [options={}] Overrides.
|
|
73
|
+
* @returns {{indicator: StatusIndicator, tone: StatusTone}}
|
|
74
|
+
*/
|
|
75
|
+
export declare function resolveStatusGlyph(status: StatusId | string | {
|
|
76
|
+
ID?: unknown;
|
|
77
|
+
id?: unknown;
|
|
78
|
+
indicator?: unknown;
|
|
79
|
+
tone?: unknown;
|
|
80
|
+
} | null | undefined, options?: StatusIconOptions): {
|
|
81
|
+
indicator: StatusIndicator;
|
|
82
|
+
tone: StatusTone;
|
|
83
|
+
};
|
|
84
|
+
/**
|
|
85
|
+
* Maps a status id to its built-in spelling: trimmed, lower-cased, and `review` / `cancelled`
|
|
86
|
+
* read as `in-review` / `canceled`.
|
|
87
|
+
* @param {unknown} id Status id.
|
|
88
|
+
* @returns {string}
|
|
89
|
+
*/
|
|
90
|
+
export declare function normalizeStatusId(id: unknown): string;
|
|
91
|
+
/**
|
|
92
|
+
* Settles a priority level: an integer from 0 (lowest) to 4 (highest), or `null` for no priority.
|
|
93
|
+
* Out-of-range numbers clamp; anything that is not a number reads as 0.
|
|
94
|
+
* @param {unknown} level Priority level.
|
|
95
|
+
* @returns {number|null}
|
|
96
|
+
*/
|
|
97
|
+
export declare function normalizePriorityLevel(level: unknown): number | null;
|
|
98
|
+
/**
|
|
99
|
+
* Draws the workflow-status glyph `Select.status()` shows, for a list row, a board column, a
|
|
100
|
+
* filter chip, or a heading — so every place a status appears reads as the picker that changes it.
|
|
101
|
+
*
|
|
102
|
+
* Built-in statuses: `backlog` (dotted ring), `todo` (empty ring), `in-progress` (ring with a
|
|
103
|
+
* centre dot), `in-review` (half filled; also `review`), `ready` (a third filled), `waiting` (two
|
|
104
|
+
* thirds filled), `done` (filled, with a check), `canceled` (filled, with a cross; also
|
|
105
|
+
* `cancelled`), and `duplicate` (ring with a slash). Colour only repeats what the shape says.
|
|
106
|
+
* @param {StatusId|string|{ID?: unknown, indicator?: unknown, tone?: unknown}} status Built-in id,
|
|
107
|
+
* or a status item with its own `indicator` and `tone`.
|
|
108
|
+
* @param {StatusIconOptions} [options={}] Shape, colour, and accessible-name overrides.
|
|
109
|
+
* @returns {HTMLSpanElement} A `.zx-status-icon` element, decorative unless `label` is given.
|
|
110
|
+
*/
|
|
111
|
+
export declare function statusIcon(status: StatusId | string | {
|
|
112
|
+
ID?: unknown;
|
|
113
|
+
indicator?: unknown;
|
|
114
|
+
tone?: unknown;
|
|
115
|
+
}, options?: StatusIconOptions): HTMLSpanElement;
|
|
116
|
+
/**
|
|
117
|
+
* Draws the priority glyph `Select.priority()` shows. Levels 0–3 are four signal bars in muted
|
|
118
|
+
* ink, filled up to the level; level 4, the highest, is a filled danger square whose "!" the
|
|
119
|
+
* stylesheet draws, so it never joins the text beside it; no priority (`null`) is a row of dashes.
|
|
120
|
+
* @param {number|null} level Priority level, 0 (lowest) to 4 (highest), or `null` for none.
|
|
121
|
+
* @param {PriorityIconOptions} [options={}] Accessible-name option.
|
|
122
|
+
* @returns {HTMLSpanElement} A `.zx-priority-icon` element, decorative unless `label` is given.
|
|
123
|
+
*/
|
|
124
|
+
export declare function priorityIcon(level: number | null, options?: PriorityIconOptions): HTMLSpanElement;
|
|
@@ -147,7 +147,9 @@ export type EntitySelectOptions = {
|
|
|
147
147
|
*/
|
|
148
148
|
iconKey?: string | ((item: SelectItem) => unknown);
|
|
149
149
|
/**
|
|
150
|
-
* Optional icon colour reader
|
|
150
|
+
* Optional icon colour reader: a CSS
|
|
151
|
+
* colour or a token reference such as `var(--zx-color-tone-blue-fg)`. Without one the glyph is a
|
|
152
|
+
* neutral tile in muted ink.
|
|
151
153
|
*/
|
|
152
154
|
colorKey?: string | ((item: SelectItem) => unknown);
|
|
153
155
|
/**
|
|
@@ -214,6 +216,7 @@ export declare class Select extends Component<SelectOptions> {
|
|
|
214
216
|
_createdRoot: boolean;
|
|
215
217
|
_root: HTMLElement;
|
|
216
218
|
_snapshot: import("../../core/dom.js").TargetSnapshot;
|
|
219
|
+
_pointerModality: boolean;
|
|
217
220
|
_handleTypeahead: (event: KeyboardEvent | string) => void;
|
|
218
221
|
static cssName: string;
|
|
219
222
|
/** @type {SelectOptions} */
|
|
@@ -267,9 +270,14 @@ export declare class Select extends Component<SelectOptions> {
|
|
|
267
270
|
/** Moves focus to the combobox input. @returns {this} */
|
|
268
271
|
focus(): this;
|
|
269
272
|
/**
|
|
270
|
-
* Creates the five-level priority preset
|
|
273
|
+
* Creates the five-level priority preset: values 0 (lowest) to 4 (highest), each drawn as grey
|
|
274
|
+
* signal bars filled to its level, except the highest, which is the one coloured level — a
|
|
275
|
+
* danger square with an exclamation mark. A "No priority" row (value null, a row of dashes)
|
|
276
|
+
* heads the list and labels the empty control; `clearable: false` removes it.
|
|
271
277
|
* @param {Element|string|null} target Component target.
|
|
272
|
-
* @param {SelectOptions} [options={}] Select overrides other than
|
|
278
|
+
* @param {SelectOptions} [options={}] Select overrides other than items and renderers.
|
|
279
|
+
* `clearable` defaults to true here; `noneLabel` and `placeholder` default to the
|
|
280
|
+
* `priority.none` message ("No priority").
|
|
273
281
|
* @returns {Select}
|
|
274
282
|
*/
|
|
275
283
|
static priority(target: Element | string | null, options?: SelectOptions): Select;
|
|
@@ -31,6 +31,10 @@ export type StatTileNameParts = {
|
|
|
31
31
|
* The formatted value.
|
|
32
32
|
*/
|
|
33
33
|
value?: string;
|
|
34
|
+
/**
|
|
35
|
+
* The context line under the value, e.g. `'of 13,184'`.
|
|
36
|
+
*/
|
|
37
|
+
caption?: string;
|
|
34
38
|
/**
|
|
35
39
|
* The change, already worded for speech (`'up 2'`, not `'+2'`).
|
|
36
40
|
*/
|
|
@@ -58,6 +62,11 @@ export type StatTileOptions = {
|
|
|
58
62
|
* ISO 4217 code used by `format: 'currency'`.
|
|
59
63
|
*/
|
|
60
64
|
currency?: string | null;
|
|
65
|
+
/**
|
|
66
|
+
* A muted context line under the value — what the number is out
|
|
67
|
+
* of or measured in, e.g. `'of 13,184'` or `'open tickets'`. Part of the accessible name.
|
|
68
|
+
*/
|
|
69
|
+
caption?: string;
|
|
61
70
|
/**
|
|
62
71
|
* BCP 47 tag for every formatter; defaults to the active language.
|
|
63
72
|
*/
|
|
@@ -87,12 +96,13 @@ export type StatTileOptions = {
|
|
|
87
96
|
*/
|
|
88
97
|
trend?: number[];
|
|
89
98
|
/**
|
|
90
|
-
* Icon name from `icons.js`, shown beside the label
|
|
99
|
+
* Icon name from `icons.js`, shown muted beside the label —
|
|
100
|
+
* a glyph, not a coloured chip.
|
|
91
101
|
*/
|
|
92
102
|
icon?: string | null;
|
|
93
103
|
/**
|
|
94
|
-
* Semantic intent. It tints the
|
|
95
|
-
*
|
|
104
|
+
* Semantic intent. It tints the sparkline and never the
|
|
105
|
+
* value, which stays at full text contrast whatever intent a record carries.
|
|
96
106
|
*/
|
|
97
107
|
kind?: StatTileKind;
|
|
98
108
|
/**
|
|
@@ -245,10 +255,11 @@ export declare function statTileTag(options?: {
|
|
|
245
255
|
onclick?: unknown;
|
|
246
256
|
}): 'a' | 'button' | 'div';
|
|
247
257
|
/**
|
|
248
|
-
* Composes the tile's accessible name: label, then value, then how it changed.
|
|
258
|
+
* Composes the tile's accessible name: label, then value with its caption, then how it changed.
|
|
249
259
|
*
|
|
250
260
|
* The sparkline is decoration and contributes nothing, and the delta arrives already worded —
|
|
251
|
-
* `'up 2'` rather than `'+2'` — because a screen reader should not have to interpret a glyph.
|
|
261
|
+
* `'up 2'` rather than `'+2'` — because a screen reader should not have to interpret a glyph. The
|
|
262
|
+
* caption is read with the value it qualifies (`'2,184 of 13,184'`), not as a separate clause.
|
|
252
263
|
*
|
|
253
264
|
* @param {StatTileNameParts} [parts={}] The pieces, already formatted and translated.
|
|
254
265
|
* @returns {string} The name, with empty pieces dropped rather than left as stray punctuation.
|
|
@@ -53,6 +53,12 @@ export type TabboxOptions = {
|
|
|
53
53
|
* Keep inactive panel elements mounted.
|
|
54
54
|
*/
|
|
55
55
|
keepAlive?: boolean;
|
|
56
|
+
/**
|
|
57
|
+
* Accessible name of the tab list — what the tabs switch between
|
|
58
|
+
* ("Record sections"). A tab list needs one whenever the page has more than one, and screen
|
|
59
|
+
* readers announce it on entry.
|
|
60
|
+
*/
|
|
61
|
+
label?: string;
|
|
56
62
|
/**
|
|
57
63
|
* Change callback.
|
|
58
64
|
*/
|
|
@@ -107,6 +113,9 @@ export type TabRecord = {
|
|
|
107
113
|
* the active tab across a full-width rule; `segmented` renders a compact group that reads as one
|
|
108
114
|
* control, for a toolbar or card header.
|
|
109
115
|
* @property {boolean} [keepAlive=true] Keep inactive panel elements mounted.
|
|
116
|
+
* @property {string} [label] Accessible name of the tab list — what the tabs switch between
|
|
117
|
+
* ("Record sections"). A tab list needs one whenever the page has more than one, and screen
|
|
118
|
+
* readers announce it on entry.
|
|
110
119
|
* @property {(event: CustomEvent<{name: string, previous: string|null}>) => void} [onchange] Change callback.
|
|
111
120
|
* @property {(event: CustomEvent<{name: string}>) => void} [onclose] Close callback, fired when the
|
|
112
121
|
* user dismisses a closable tab.
|
|
@@ -3,6 +3,7 @@ export type TableRow = Record<string, any>;
|
|
|
3
3
|
export type TableSortDirection = 'asc' | 'desc';
|
|
4
4
|
export type TableSelectionMode = false | 'single' | 'multi';
|
|
5
5
|
export type TableEditMode = false | 'cell' | 'row';
|
|
6
|
+
export type TableVariant = 'default' | 'plain';
|
|
6
7
|
export type TableEditorType = 'text' | 'number' | 'select' | 'date' | 'checkbox' | 'textarea' | 'custom';
|
|
7
8
|
export type TableColumnType = 'text' | 'number' | 'currency' | 'percent' | 'unit';
|
|
8
9
|
export type TableEditorOption = {
|
|
@@ -76,9 +77,16 @@ export type TableColumn = {
|
|
|
76
77
|
*/
|
|
77
78
|
id: string;
|
|
78
79
|
/**
|
|
79
|
-
* Visible header label.
|
|
80
|
+
* Visible header label. An empty label leaves the header blank — an
|
|
81
|
+
* icon or actions column — and the header is then named by `ariaLabel`, or by the id.
|
|
80
82
|
*/
|
|
81
83
|
label: string;
|
|
84
|
+
/**
|
|
85
|
+
* Accessible name of the column header, and the name the column
|
|
86
|
+
* chooser and the cell editors use. Needed when `label` is empty or terse (`'#'`); include the
|
|
87
|
+
* visible label's words in it when there is one.
|
|
88
|
+
*/
|
|
89
|
+
ariaLabel?: string;
|
|
82
90
|
/**
|
|
83
91
|
* Whether the header changes the active sort.
|
|
84
92
|
*/
|
|
@@ -249,6 +257,12 @@ export type TableOptions = {
|
|
|
249
257
|
* Whether alternate rows use the zebra background.
|
|
250
258
|
*/
|
|
251
259
|
zebra?: boolean;
|
|
260
|
+
/**
|
|
261
|
+
* Frame treatment. `'default'` draws the table's own
|
|
262
|
+
* bordered box; `'plain'` is for a table inside a card or panel that already draws one — no outer
|
|
263
|
+
* frame, no header band, no zebra, hairline row dividers. Reflected as `data-variant` on the root.
|
|
264
|
+
*/
|
|
265
|
+
variant?: TableVariant;
|
|
252
266
|
/**
|
|
253
267
|
* Inline editing mode. `'cell'` edits one cell, `'row'`
|
|
254
268
|
* opens every editable cell of the row together and commits them as a unit. Editing is completely
|
|
@@ -1392,12 +1406,43 @@ export declare function firstValidationError(values: Record<string, unknown>, co
|
|
|
1392
1406
|
columnId: string;
|
|
1393
1407
|
message: string;
|
|
1394
1408
|
} | null;
|
|
1409
|
+
/**
|
|
1410
|
+
* Resolves the `variant` option to one the stylesheet knows; anything else is the default frame.
|
|
1411
|
+
* @param {unknown} value Requested variant.
|
|
1412
|
+
* @returns {TableVariant}
|
|
1413
|
+
*/
|
|
1414
|
+
export declare function normalizeTableVariant(value: unknown): TableVariant;
|
|
1395
1415
|
/**
|
|
1396
1416
|
* Validates and shallow-clones table columns so stable-id APIs never mutate caller descriptors.
|
|
1397
1417
|
* @param {unknown} columns Column descriptors.
|
|
1398
1418
|
* @returns {TableColumn[]} Normalized descriptors.
|
|
1399
1419
|
*/
|
|
1400
1420
|
export declare function normalizeTableColumns(columns: unknown): TableColumn[];
|
|
1421
|
+
/**
|
|
1422
|
+
* The name a column goes by wherever it is named rather than shown: its `ariaLabel`, else its
|
|
1423
|
+
* visible label, else its id. The column chooser lists columns by it and cell editors are labelled
|
|
1424
|
+
* with it, so a column with a blank header still has a name in both.
|
|
1425
|
+
* @param {Partial<TableColumn>|null|undefined} column Column descriptor.
|
|
1426
|
+
* @returns {string} Non-empty name, unless the column has no id either.
|
|
1427
|
+
*/
|
|
1428
|
+
export declare function tableColumnName(column: Partial<TableColumn> | null | undefined): string;
|
|
1429
|
+
/**
|
|
1430
|
+
* The accessible name a column header needs on top of its content, or null when its visible label
|
|
1431
|
+
* already names it. That is the `ariaLabel` when one is given, and the column id when the label is
|
|
1432
|
+
* blank — an icon or actions column — so no header is announced as an empty column.
|
|
1433
|
+
* @param {Partial<TableColumn>|null|undefined} column Column descriptor.
|
|
1434
|
+
* @returns {string|null} Name to set as `aria-label`, or null.
|
|
1435
|
+
*/
|
|
1436
|
+
export declare function tableHeaderName(column: Partial<TableColumn> | null | undefined): string | null;
|
|
1437
|
+
/**
|
|
1438
|
+
* Whether opening an editor of this type selects its content, so the first keystroke replaces the
|
|
1439
|
+
* value instead of being appended to it. True for the single-line text, number, and date editors;
|
|
1440
|
+
* a textarea keeps its caret, and a select, checkbox, or custom editor keeps its own focus
|
|
1441
|
+
* behaviour.
|
|
1442
|
+
* @param {TableEditorType|string} type Resolved editor type.
|
|
1443
|
+
* @returns {boolean}
|
|
1444
|
+
*/
|
|
1445
|
+
export declare function editorSelectsOnEntry(type: TableEditorType | string): boolean;
|
|
1401
1446
|
/**
|
|
1402
1447
|
* Reconciles saved or partial column IDs with every current column.
|
|
1403
1448
|
* @param {TableColumn[]} columns Current columns.
|
|
@@ -24,9 +24,17 @@ export type TagPickerOptions = {
|
|
|
24
24
|
*/
|
|
25
25
|
iconKey?: TagValueReader;
|
|
26
26
|
/**
|
|
27
|
-
* Optional item colour property or reader
|
|
27
|
+
* Optional item colour property or reader: a CSS colour
|
|
28
|
+
* or a token reference such as `var(--zx-color-tone-blue-fg)`.
|
|
28
29
|
*/
|
|
29
30
|
colorKey?: TagValueReader;
|
|
31
|
+
/**
|
|
32
|
+
* Optional item tone property or reader: a categorical
|
|
33
|
+
* tone name from the Badge palette (`blue`, `teal`, `green`, `amber`, `orange`, `red`, `pink`,
|
|
34
|
+
* `violet`, `slate`). A toned tag takes the palette's fill and ink, as a Badge with that `tone`
|
|
35
|
+
* does; a tone wins over a colour, and unknown names are ignored.
|
|
36
|
+
*/
|
|
37
|
+
toneKey?: TagValueReader;
|
|
30
38
|
/**
|
|
31
39
|
* Fields searched by local filtering.
|
|
32
40
|
*/
|
|
@@ -68,7 +76,8 @@ export type TagPickerOptions = {
|
|
|
68
76
|
*/
|
|
69
77
|
disabled?: boolean;
|
|
70
78
|
/**
|
|
71
|
-
*
|
|
79
|
+
* When true the picker shows only its tags — no input, chevron, or
|
|
80
|
+
* remove buttons.
|
|
72
81
|
*/
|
|
73
82
|
readonly?: boolean;
|
|
74
83
|
/**
|
|
@@ -142,7 +151,12 @@ export type TagPickerOptions = {
|
|
|
142
151
|
* @property {TagValueReader} [valueKey='ID'] Item ID property or reader.
|
|
143
152
|
* @property {TagLabelReader} [labelKey='name'] Item label property or reader.
|
|
144
153
|
* @property {TagValueReader} [iconKey='icon'] Optional item icon property or reader.
|
|
145
|
-
* @property {TagValueReader} [colorKey='color'] Optional item colour property or reader
|
|
154
|
+
* @property {TagValueReader} [colorKey='color'] Optional item colour property or reader: a CSS colour
|
|
155
|
+
* or a token reference such as `var(--zx-color-tone-blue-fg)`.
|
|
156
|
+
* @property {TagValueReader} [toneKey='tone'] Optional item tone property or reader: a categorical
|
|
157
|
+
* tone name from the Badge palette (`blue`, `teal`, `green`, `amber`, `orange`, `red`, `pink`,
|
|
158
|
+
* `violet`, `slate`). A toned tag takes the palette's fill and ink, as a Badge with that `tone`
|
|
159
|
+
* does; a tone wins over a colour, and unknown names are ignored.
|
|
146
160
|
* @property {Array<TagValueReader>|null} [searchKeys=null] Fields searched by local filtering.
|
|
147
161
|
* @property {'local'|((query: string) => Promise<TagItem[]>|TagItem[])} [filter='local'] Filtering mode.
|
|
148
162
|
* @property {number} [minQuery=0] Minimum async query length.
|
|
@@ -153,7 +167,8 @@ export type TagPickerOptions = {
|
|
|
153
167
|
* @property {string} [placeholder=''] Empty-state input text.
|
|
154
168
|
* @property {number} [listHeight=260] Maximum list height in pixels.
|
|
155
169
|
* @property {boolean} [disabled=false] Whether interaction is disabled.
|
|
156
|
-
* @property {boolean} [readonly=false]
|
|
170
|
+
* @property {boolean} [readonly=false] When true the picker shows only its tags — no input, chevron, or
|
|
171
|
+
* remove buttons.
|
|
157
172
|
* @property {((item: TagItem) => Node|string)|null} [renderItem=null] Option renderer.
|
|
158
173
|
* @property {((item: TagItem) => Node|string)|null} [renderTag=null] Tag-label renderer.
|
|
159
174
|
* @property {Record<string, string>|Record<string, Record<string, string>>} [msg] Localized messages.
|
|
@@ -373,6 +388,8 @@ export declare class TagPicker extends Component<TagPickerOptions> {
|
|
|
373
388
|
_iconOf(item: unknown): Node | null;
|
|
374
389
|
/** @param {unknown} item @returns {string|null} */
|
|
375
390
|
_colorOf(item: unknown): string | null;
|
|
391
|
+
/** @param {unknown} item @returns {string|null} */
|
|
392
|
+
_toneOf(item: unknown): string | null;
|
|
376
393
|
/** @param {unknown} item @param {unknown} reader @returns {unknown} */
|
|
377
394
|
_readItem(item: unknown, reader: unknown): unknown;
|
|
378
395
|
/** @returns {void} */
|
|
@@ -381,3 +381,16 @@ export declare class TreeView extends Component<TreeOptions> {
|
|
|
381
381
|
/** Restores an enhanced target to the markup it had before the takeover. @returns {void} */
|
|
382
382
|
destroy(): void;
|
|
383
383
|
}
|
|
384
|
+
/**
|
|
385
|
+
* Whether a key press is one the type-ahead consumes: a single printable character, not a space
|
|
386
|
+
* (Space selects), with no Ctrl, Meta, or Alt (those are shortcuts). Shift is allowed, since it
|
|
387
|
+
* only changes the letter's case.
|
|
388
|
+
* @param {{key?: string, ctrlKey?: boolean, metaKey?: boolean, altKey?: boolean}} event Key event.
|
|
389
|
+
* @returns {boolean}
|
|
390
|
+
*/
|
|
391
|
+
export declare function isTreeTypeaheadKey(event: {
|
|
392
|
+
key?: string;
|
|
393
|
+
ctrlKey?: boolean;
|
|
394
|
+
metaKey?: boolean;
|
|
395
|
+
altKey?: boolean;
|
|
396
|
+
}): boolean;
|