@zeyos/zx 2.3.0 → 4.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.
Files changed (150) hide show
  1. package/CHANGELOG.md +138 -0
  2. package/DESIGN-SYSTEM.md +96 -0
  3. package/README.md +29 -39
  4. package/dist/types/components/account-menu/account-menu.d.ts +144 -0
  5. package/dist/types/components/app-sidebar/app-sidebar.d.ts +243 -0
  6. package/dist/types/components/avatar/avatar.d.ts +100 -0
  7. package/dist/types/components/card/card.d.ts +128 -0
  8. package/dist/types/components/chart/chart.d.ts +322 -0
  9. package/dist/types/components/date-picker/month-picker.d.ts +6 -0
  10. package/dist/types/components/dialog/dialog.d.ts +9 -0
  11. package/dist/types/components/dock/dock.d.ts +495 -0
  12. package/dist/types/components/dropdown/dropdown.d.ts +2 -2
  13. package/dist/types/components/field/field.d.ts +14 -0
  14. package/dist/types/components/field-upload/field-upload.d.ts +37 -4
  15. package/dist/types/components/form/form.d.ts +25 -3
  16. package/dist/types/components/grid/grid.d.ts +172 -0
  17. package/dist/types/components/launcher/launcher.d.ts +359 -0
  18. package/dist/types/components/layout/layout.d.ts +4 -4
  19. package/dist/types/components/menu-button/menu-button.d.ts +10 -2
  20. package/dist/types/components/modal/modal.d.ts +25 -0
  21. package/dist/types/components/multi-value-editor/multi-value-editor.d.ts +7 -1
  22. package/dist/types/components/questionnaire/items.d.ts +327 -0
  23. package/dist/types/components/questionnaire/questionnaire.d.ts +449 -0
  24. package/dist/types/components/select/select.d.ts +51 -0
  25. package/dist/types/components/sheet/sheet-stack.d.ts +167 -0
  26. package/dist/types/components/sheet/sheet.d.ts +294 -0
  27. package/dist/types/components/split-view/split-view.d.ts +2 -21
  28. package/dist/types/components/table/table.d.ts +223 -15
  29. package/dist/types/components/tooltip/tooltip.d.ts +2 -2
  30. package/dist/types/components/value-list/value-list.d.ts +24 -3
  31. package/dist/types/core/dom.d.ts +122 -0
  32. package/dist/types/core/drag-axis.d.ts +111 -0
  33. package/dist/types/core/position.d.ts +4 -2
  34. package/dist/types/index.d.ts +13 -2
  35. package/dist/types/internal/app-rail.d.ts +265 -0
  36. package/dist/types/zeyos/icons.d.ts +5 -0
  37. package/dist/types/zeyos/index.d.ts +2 -1
  38. package/dist/types/zeyos/launcher.d.ts +147 -0
  39. package/dist/types/zeyos/select.d.ts +39 -0
  40. package/dist/zx-zeyos.esm.js +1870 -133
  41. package/dist/zx-zeyos.esm.min.js +1 -1
  42. package/dist/zx.css +2006 -267
  43. package/dist/zx.esm.js +8987 -2757
  44. package/dist/zx.esm.min.js +3 -3
  45. package/dist/zx.global.js +8987 -2757
  46. package/dist/zx.global.min.js +3 -3
  47. package/dist/zx.min.css +1 -1
  48. package/docs/api.json +4396 -2344
  49. package/docs/llms.md +463 -86
  50. package/docs/llms.txt +32 -19
  51. package/package.json +10 -17
  52. package/src/components/account-menu/account-menu.css +70 -0
  53. package/src/components/account-menu/account-menu.js +208 -0
  54. package/src/components/app-rail/app-rail.css +107 -0
  55. package/src/components/app-sidebar/app-sidebar.css +80 -0
  56. package/src/components/app-sidebar/app-sidebar.js +588 -0
  57. package/src/components/avatar/avatar.css +61 -0
  58. package/src/components/avatar/avatar.js +222 -0
  59. package/src/components/button/button.css +0 -1
  60. package/src/components/card/card.css +149 -0
  61. package/src/components/card/card.js +285 -0
  62. package/src/components/chart/chart.css +61 -0
  63. package/src/components/chart/chart.js +523 -0
  64. package/src/components/date-picker/month-picker.js +9 -0
  65. package/src/components/dialog/dialog.js +11 -4
  66. package/src/components/dock/dock.css +228 -0
  67. package/src/components/dock/dock.js +977 -0
  68. package/src/components/dropdown/dropdown.js +1 -1
  69. package/src/components/field/field.js +2 -0
  70. package/src/components/field-upload/field-upload.js +9 -4
  71. package/src/components/form/form.js +6 -3
  72. package/src/components/grid/grid.css +6 -0
  73. package/src/components/grid/grid.js +220 -0
  74. package/src/components/launcher/launcher.css +210 -0
  75. package/src/components/launcher/launcher.js +765 -0
  76. package/src/components/layout/layout.js +2 -2
  77. package/src/components/menu-button/menu-button.js +27 -2
  78. package/src/components/modal/modal.css +5 -1
  79. package/src/components/modal/modal.js +37 -2
  80. package/src/components/multi-value-editor/multi-value-editor.js +2 -1
  81. package/src/components/questionnaire/items.js +370 -0
  82. package/src/components/questionnaire/questionnaire.css +387 -0
  83. package/src/components/questionnaire/questionnaire.js +1033 -0
  84. package/src/components/select/field-adapter.js +9 -4
  85. package/src/components/select/select.css +144 -11
  86. package/src/components/select/select.js +259 -27
  87. package/src/components/sheet/sheet-stack.js +304 -0
  88. package/src/components/sheet/sheet.css +351 -0
  89. package/src/components/sheet/sheet.js +551 -0
  90. package/src/components/split-view/split-view.js +76 -161
  91. package/src/components/table/table.css +43 -0
  92. package/src/components/table/table.js +531 -52
  93. package/src/components/tooltip/tooltip.js +5 -2
  94. package/src/components/value-list/value-list.js +6 -3
  95. package/src/core/dom.js +322 -0
  96. package/src/core/drag-axis.js +203 -0
  97. package/src/core/position.js +68 -22
  98. package/src/index.js +20 -2
  99. package/src/internal/app-rail.js +718 -0
  100. package/src/zeyos/icons.js +8 -3
  101. package/src/zeyos/index.js +7 -1
  102. package/src/zeyos/launcher.js +338 -0
  103. package/src/zeyos/modules.js +1 -0
  104. package/src/zeyos/select.js +115 -1
  105. package/styles/tokens/dark.css +2 -3
  106. package/styles/tokens/global.css +6 -6
  107. package/styles/tokens/modules.css +1 -0
  108. package/styles/tokens/semantic.css +5 -3
  109. package/styles/tokens/themes.css +1 -1
  110. package/styles/zx.css +11 -1
  111. package/MIGRATION.md +0 -598
  112. package/dist/types/compat/base.d.ts +0 -156
  113. package/dist/types/compat/globals.d.ts +0 -20
  114. package/dist/types/compat/index.d.ts +0 -128
  115. package/dist/types/compat/map/basic.d.ts +0 -175
  116. package/dist/types/compat/map/data.d.ts +0 -102
  117. package/dist/types/compat/map/date-time.d.ts +0 -80
  118. package/dist/types/compat/map/factory.d.ts +0 -9
  119. package/dist/types/compat/map/form.d.ts +0 -98
  120. package/dist/types/compat/map/helpers.d.ts +0 -12
  121. package/dist/types/compat/map/http.d.ts +0 -36
  122. package/dist/types/compat/map/layout.d.ts +0 -106
  123. package/dist/types/compat/map/options.d.ts +0 -80
  124. package/dist/types/compat/map/select.d.ts +0 -95
  125. package/dist/types/compat/map/stubs.d.ts +0 -32
  126. package/dist/types/compat/map/utilities.d.ts +0 -37
  127. package/dist/types/compat-entry.d.ts +0 -5
  128. package/dist/types/components/permission/permission.d.ts +0 -96
  129. package/dist/zx-compat.esm.js +0 -17484
  130. package/dist/zx-compat.esm.min.js +0 -1
  131. package/dist/zx-compat.global.js +0 -23635
  132. package/dist/zx-compat.global.min.js +0 -3
  133. package/src/compat/base.js +0 -291
  134. package/src/compat/globals.js +0 -165
  135. package/src/compat/index.js +0 -84
  136. package/src/compat/map/basic.js +0 -464
  137. package/src/compat/map/data.js +0 -232
  138. package/src/compat/map/date-time.js +0 -177
  139. package/src/compat/map/factory.js +0 -45
  140. package/src/compat/map/form.js +0 -330
  141. package/src/compat/map/helpers.js +0 -46
  142. package/src/compat/map/http.js +0 -117
  143. package/src/compat/map/layout.js +0 -256
  144. package/src/compat/map/options.js +0 -267
  145. package/src/compat/map/select.js +0 -198
  146. package/src/compat/map/stubs.js +0 -26
  147. package/src/compat/map/utilities.js +0 -113
  148. package/src/compat-entry.js +0 -11
  149. package/src/components/permission/permission.css +0 -47
  150. package/src/components/permission/permission.js +0 -201
@@ -0,0 +1,172 @@
1
+ import { Table } from '../table/table.js';
2
+ export type BillingRow = Record<string, any>;
3
+ export type GridOptions = Object;
4
+ export type BillingFields = {
5
+ /**
6
+ * Row identifier field.
7
+ */
8
+ id?: string;
9
+ /**
10
+ * Parent identifier field.
11
+ */
12
+ parent?: string;
13
+ /**
14
+ * Line description field.
15
+ */
16
+ item?: string;
17
+ /**
18
+ * Line-kind field (`group`/`subtotal` rows are read-only).
19
+ */
20
+ kind?: string;
21
+ /**
22
+ * Quantity field.
23
+ */
24
+ quantity?: string;
25
+ /**
26
+ * Unit field.
27
+ */
28
+ unit?: string;
29
+ /**
30
+ * Unit-price field.
31
+ */
32
+ unitPrice?: string;
33
+ /**
34
+ * Currency-code field.
35
+ */
36
+ currency?: string;
37
+ /**
38
+ * Line-total field.
39
+ */
40
+ total?: string;
41
+ };
42
+ export type BillingItemsOptions = {
43
+ /**
44
+ * Billing rows.
45
+ */
46
+ data?: BillingRow[];
47
+ /**
48
+ * Schema field overrides.
49
+ */
50
+ fields?: Partial<BillingFields>;
51
+ /**
52
+ * Unit choices.
53
+ */
54
+ units?: Array<{
55
+ value: unknown;
56
+ label: string;
57
+ }> | Record<string, string>;
58
+ /**
59
+ * Currency choices.
60
+ */
61
+ currencies?: Array<{
62
+ value: unknown;
63
+ label: string;
64
+ }> | Record<string, string>;
65
+ /**
66
+ * Fallback currency.
67
+ */
68
+ currency?: string;
69
+ /**
70
+ * Number/currency locale.
71
+ */
72
+ locale?: string;
73
+ /**
74
+ * Currency fraction digits.
75
+ */
76
+ decimals?: number;
77
+ /**
78
+ * Per-canonical-column overrides.
79
+ */
80
+ columnOverrides?: Record<string, object>;
81
+ /**
82
+ * Optional total calculation; defaults to quantity × unit price.
83
+ */
84
+ lineTotal?: (row: BillingRow, changes: Record<string, unknown>) => number | null | undefined;
85
+ /**
86
+ * Complete column replacement.
87
+ */
88
+ columns?: import('../table/table.js').TableColumn[];
89
+ /**
90
+ * Caller edit listener, invoked after total calculation.
91
+ */
92
+ oneditcommit?: (event: CustomEvent<import('../table/table.js').TableEditCommitDetail>) => void;
93
+ };
94
+ /** @typedef {Record<string, any>} BillingRow */
95
+ /**
96
+ * @typedef {Object} GridOptions
97
+ * Grid inherits its constructor options and runtime API from `Table`; this record owns the Grid
98
+ * name in generated documentation, where the Table API is shown alongside it.
99
+ */
100
+ /**
101
+ * @typedef {Object} BillingFields
102
+ * @property {string} [id='id'] Row identifier field.
103
+ * @property {string} [parent='parent'] Parent identifier field.
104
+ * @property {string} [item='item'] Line description field.
105
+ * @property {string} [kind='kind'] Line-kind field (`group`/`subtotal` rows are read-only).
106
+ * @property {string} [quantity='quantity'] Quantity field.
107
+ * @property {string} [unit='unit'] Unit field.
108
+ * @property {string} [unitPrice='unitPrice'] Unit-price field.
109
+ * @property {string} [currency='currency'] Currency-code field.
110
+ * @property {string} [total='total'] Line-total field.
111
+ */
112
+ /**
113
+ * @typedef {Object} BillingItemsOptions
114
+ * @property {BillingRow[]} [data=[]] Billing rows.
115
+ * @property {Partial<BillingFields>} [fields={}] Schema field overrides.
116
+ * @property {Array<{value: unknown, label: string}>|Record<string, string>} [units=[]] Unit choices.
117
+ * @property {Array<{value: unknown, label: string}>|Record<string, string>} [currencies=[]] Currency choices.
118
+ * @property {string} [currency='EUR'] Fallback currency.
119
+ * @property {string} [locale] Number/currency locale.
120
+ * @property {number} [decimals=2] Currency fraction digits.
121
+ * @property {Record<string, object>} [columnOverrides={}] Per-canonical-column overrides.
122
+ * @property {(row: BillingRow, changes: Record<string, unknown>) => number|null|undefined} [lineTotal] Optional total calculation; defaults to quantity × unit price.
123
+ * @property {import('../table/table.js').TableColumn[]} [columns] Complete column replacement.
124
+ * @property {(event: CustomEvent<import('../table/table.js').TableEditCommitDetail>) => void} [oneditcommit] Caller edit listener, invoked after total calculation.
125
+ */
126
+ /**
127
+ * Public data grid. It deliberately inherits Table's DOM/CSS/API instead of forking the data layer.
128
+ * @extends {Table}
129
+ */
130
+ export declare class Grid extends Table {
131
+ static cssName: string;
132
+ /**
133
+ * Creates a generic data grid with the complete inherited Table contract.
134
+ * @param {Element|string|null} target Grid target.
135
+ * @param {GridOptions & import('../table/table.js').TableOptions} [options={}] Grid/Table options.
136
+ */
137
+ constructor(target?: Element | string | null, options?: GridOptions & import('../table/table.js').TableOptions);
138
+ /**
139
+ * Creates an editable hierarchical billing-line grid.
140
+ * @param {Element|string|null} target Grid target.
141
+ * @param {BillingItemsOptions & import('../table/table.js').TableOptions} [options={}] Preset and Table overrides.
142
+ * @returns {Grid}
143
+ */
144
+ static BillingItems(target: Element | string | null, options?: BillingItemsOptions & import('../table/table.js').TableOptions): Grid;
145
+ }
146
+ /**
147
+ * Builds the Table-compatible options behind `Grid.BillingItems()` without touching the DOM.
148
+ * @param {BillingItemsOptions & import('../table/table.js').TableOptions} [options={}] Preset and Table overrides.
149
+ * @returns {import('../table/table.js').TableOptions}
150
+ */
151
+ export declare function billingItemsConfig(options?: BillingItemsOptions & import('../table/table.js').TableOptions): import('../table/table.js').TableOptions;
152
+ /**
153
+ * Returns whether a billing row is an editable line rather than a group/subtotal.
154
+ * @param {BillingRow} row Row.
155
+ * @param {BillingFields} [fields=DEFAULT_FIELDS] Field map.
156
+ * @returns {boolean}
157
+ */
158
+ export declare function isBillingLine(row: BillingRow, fields?: BillingFields): boolean;
159
+ /**
160
+ * Produces the preset columns without mutating overrides.
161
+ * @param {BillingFields} fields Field map.
162
+ * @param {{units: unknown, currencies: unknown, currency: string, locale?: string, decimals: number, columnOverrides: Record<string, object>}} options Formatting/editor options.
163
+ * @returns {import('../table/table.js').TableColumn[]}
164
+ */
165
+ export declare function billingColumns(fields: BillingFields, { units, currencies, currency, locale, decimals, columnOverrides }: {
166
+ units: unknown;
167
+ currencies: unknown;
168
+ currency: string;
169
+ locale?: string;
170
+ decimals: number;
171
+ columnOverrides: Record<string, object>;
172
+ }): import('../table/table.js').TableColumn[];
@@ -0,0 +1,359 @@
1
+ import { Component } from '../../core/component.js';
2
+ export type LauncherItem = {
3
+ /**
4
+ * Stable item identifier.
5
+ */
6
+ id: string | number;
7
+ /**
8
+ * Visible label.
9
+ */
10
+ label: string;
11
+ /**
12
+ * Secondary text.
13
+ */
14
+ description?: string;
15
+ /**
16
+ * Additional search text.
17
+ */
18
+ keywords?: string | string[];
19
+ /**
20
+ * Result group.
21
+ */
22
+ group?: string;
23
+ /**
24
+ * Decorative icon name, node, or factory.
25
+ */
26
+ icon?: string | Node | ((item: LauncherItem) => Node | null);
27
+ /**
28
+ * Compact metadata.
29
+ */
30
+ badge?: string | number;
31
+ /**
32
+ * Tile or row presentation.
33
+ */
34
+ kind?: 'application' | 'record' | 'action';
35
+ /**
36
+ * Whether this is the current application or destination.
37
+ */
38
+ current?: boolean;
39
+ /**
40
+ * Query state in which the item is visible.
41
+ */
42
+ when?: 'always' | 'empty' | 'query';
43
+ /**
44
+ * Explicit group order.
45
+ */
46
+ groupOrder?: number;
47
+ /**
48
+ * Stable order within equally ranked results.
49
+ */
50
+ itemOrder?: number;
51
+ /**
52
+ * Emitted value; defaults to `id`.
53
+ */
54
+ value?: unknown;
55
+ /**
56
+ * Native link target; executable/data schemes are disabled.
57
+ */
58
+ href?: string;
59
+ /**
60
+ * Native link browsing context.
61
+ */
62
+ target?: string;
63
+ /**
64
+ * Application-owned callback for non-link actions.
65
+ */
66
+ invoke?: () => void;
67
+ /**
68
+ * Pinned state or explicit pinned order.
69
+ */
70
+ pinned?: boolean | number;
71
+ /**
72
+ * Whether activation is unavailable.
73
+ */
74
+ disabled?: boolean;
75
+ };
76
+ export type LauncherSource = {
77
+ /**
78
+ * Source identifier.
79
+ */
80
+ id: string;
81
+ /**
82
+ * Default group label.
83
+ */
84
+ label?: string;
85
+ /**
86
+ * Per-source minimum query length.
87
+ */
88
+ minQuery?: number;
89
+ /**
90
+ * Query state in which the source runs.
91
+ */
92
+ when?: 'always' | 'empty' | 'query';
93
+ /**
94
+ * Whether Zx ranks results or preserves source order.
95
+ */
96
+ order?: 'rank' | 'source';
97
+ /**
98
+ * Loader.
99
+ */
100
+ load: (query: string, context: {
101
+ signal: AbortSignal;
102
+ }) => Promise<LauncherItem[]> | LauncherItem[];
103
+ };
104
+ export type LauncherOptions = {
105
+ /**
106
+ * Local application/action catalogue.
107
+ */
108
+ items?: LauncherItem[];
109
+ /**
110
+ * Abortable asynchronous result sources.
111
+ */
112
+ sources?: LauncherSource[];
113
+ /**
114
+ * Initial query.
115
+ */
116
+ query?: string;
117
+ /**
118
+ * Source-query delay in milliseconds.
119
+ */
120
+ debounce?: number;
121
+ /**
122
+ * Global source minimum query length.
123
+ */
124
+ minQuery?: number;
125
+ /**
126
+ * Maximum combined results.
127
+ */
128
+ maxResults?: number;
129
+ /**
130
+ * Search-field placeholder.
131
+ */
132
+ placeholder?: string;
133
+ /**
134
+ * Dialog and field label.
135
+ */
136
+ label?: string;
137
+ /**
138
+ * Close-button accessible label.
139
+ */
140
+ closeLabel?: string;
141
+ /**
142
+ * Results-region accessible label.
143
+ */
144
+ resultsLabel?: string;
145
+ /**
146
+ * Empty-state text.
147
+ */
148
+ emptyText?: string;
149
+ /**
150
+ * Loading-state text.
151
+ */
152
+ loadingText?: string;
153
+ /**
154
+ * Optional global keyboard shortcut.
155
+ */
156
+ shortcut?: 'mod+k' | false;
157
+ /**
158
+ * Visible keyboard hints, or false.
159
+ */
160
+ hints?: false | {
161
+ move?: string;
162
+ open?: string;
163
+ close?: string;
164
+ };
165
+ /**
166
+ * Preventable selection listener.
167
+ */
168
+ onselect?: (event: CustomEvent<LauncherSelectDetail>) => void;
169
+ /**
170
+ * Query-change listener.
171
+ */
172
+ onquery?: (event: CustomEvent<{
173
+ query: string;
174
+ }>) => void;
175
+ /**
176
+ * Open listener.
177
+ */
178
+ onopen?: (event: CustomEvent<Record<string, never>>) => void;
179
+ /**
180
+ * Close listener.
181
+ */
182
+ onclose?: (event: CustomEvent<Record<string, never>>) => void;
183
+ /**
184
+ * Source error listener.
185
+ */
186
+ onerror?: (event: CustomEvent<{
187
+ source: LauncherSource;
188
+ error: unknown;
189
+ }>) => void;
190
+ };
191
+ export type LauncherSelectDetail = {
192
+ item: LauncherItem;
193
+ value: unknown;
194
+ source: string | null;
195
+ query: string;
196
+ };
197
+ export type RankedLauncherItem = LauncherItem & {
198
+ _source?: string | null;
199
+ _score?: number;
200
+ };
201
+ /**
202
+ * @typedef {Object} LauncherItem
203
+ * @property {string|number} id Stable item identifier.
204
+ * @property {string} label Visible label.
205
+ * @property {string} [description] Secondary text.
206
+ * @property {string|string[]} [keywords] Additional search text.
207
+ * @property {string} [group] Result group.
208
+ * @property {string|Node|((item: LauncherItem) => Node|null)} [icon] Decorative icon name, node, or factory.
209
+ * @property {string|number} [badge] Compact metadata.
210
+ * @property {'application'|'record'|'action'} [kind='action'] Tile or row presentation.
211
+ * @property {boolean} [current=false] Whether this is the current application or destination.
212
+ * @property {'always'|'empty'|'query'} [when='always'] Query state in which the item is visible.
213
+ * @property {number} [groupOrder] Explicit group order.
214
+ * @property {number} [itemOrder] Stable order within equally ranked results.
215
+ * @property {unknown} [value] Emitted value; defaults to `id`.
216
+ * @property {string} [href] Native link target; executable/data schemes are disabled.
217
+ * @property {string} [target] Native link browsing context.
218
+ * @property {() => void} [invoke] Application-owned callback for non-link actions.
219
+ * @property {boolean|number} [pinned] Pinned state or explicit pinned order.
220
+ * @property {boolean} [disabled] Whether activation is unavailable.
221
+ */
222
+ /**
223
+ * @typedef {Object} LauncherSource
224
+ * @property {string} id Source identifier.
225
+ * @property {string} [label] Default group label.
226
+ * @property {number} [minQuery] Per-source minimum query length.
227
+ * @property {'always'|'empty'|'query'} [when='always'] Query state in which the source runs.
228
+ * @property {'rank'|'source'} [order='rank'] Whether Zx ranks results or preserves source order.
229
+ * @property {(query: string, context: {signal: AbortSignal}) => Promise<LauncherItem[]>|LauncherItem[]} load Loader.
230
+ */
231
+ /**
232
+ * @typedef {Object} LauncherOptions
233
+ * @property {LauncherItem[]} [items=[]] Local application/action catalogue.
234
+ * @property {LauncherSource[]} [sources=[]] Abortable asynchronous result sources.
235
+ * @property {string} [query=''] Initial query.
236
+ * @property {number} [debounce=250] Source-query delay in milliseconds.
237
+ * @property {number} [minQuery=0] Global source minimum query length.
238
+ * @property {number} [maxResults=100] Maximum combined results.
239
+ * @property {string} [placeholder='Search applications and records'] Search-field placeholder.
240
+ * @property {string} [label='Launcher'] Dialog and field label.
241
+ * @property {string} [closeLabel='Close launcher'] Close-button accessible label.
242
+ * @property {string} [resultsLabel='Launcher results'] Results-region accessible label.
243
+ * @property {string} [emptyText='No results'] Empty-state text.
244
+ * @property {string} [loadingText='Searching…'] Loading-state text.
245
+ * @property {'mod+k'|false} [shortcut='mod+k'] Optional global keyboard shortcut.
246
+ * @property {false|{move?: string, open?: string, close?: string}} [hints] Visible keyboard hints, or false.
247
+ * @property {(event: CustomEvent<LauncherSelectDetail>) => void} [onselect] Preventable selection listener.
248
+ * @property {(event: CustomEvent<{query: string}>) => void} [onquery] Query-change listener.
249
+ * @property {(event: CustomEvent<Record<string, never>>) => void} [onopen] Open listener.
250
+ * @property {(event: CustomEvent<Record<string, never>>) => void} [onclose] Close listener.
251
+ * @property {(event: CustomEvent<{source: LauncherSource, error: unknown}>) => void} [onerror] Source error listener.
252
+ */
253
+ /** @typedef {{item: LauncherItem, value: unknown, source: string|null, query: string}} LauncherSelectDetail */
254
+ /** @typedef {LauncherItem & {_source?: string|null, _score?: number}} RankedLauncherItem */
255
+ /**
256
+ * Abortable command/search dialog that emits application-owned actions without routing itself.
257
+ * @fires Launcher#select
258
+ * @fires Launcher#query
259
+ * @fires Launcher#open
260
+ * @fires Launcher#close
261
+ * @fires Launcher#error
262
+ * @extends {Component<LauncherOptions>}
263
+ */
264
+ export declare class Launcher extends Component<LauncherOptions> {
265
+ _createdRoot: boolean;
266
+ _original: {
267
+ attributes: string[][];
268
+ children: ChildNode[];
269
+ };
270
+ _items: LauncherItem[];
271
+ _sources: LauncherSource[];
272
+ _sourceItems: Map<any, any>;
273
+ _query: string;
274
+ _renderedQuery: string;
275
+ _results: any[];
276
+ _active: any;
277
+ _request: AbortController;
278
+ _requestSequence: number;
279
+ _queryTimer: number;
280
+ _busy: boolean;
281
+ _destroyed: boolean;
282
+ static cssName: string;
283
+ /** @type {Readonly<LauncherOptions>} */
284
+ static defaults: Readonly<LauncherOptions>;
285
+ /**
286
+ * Creates an owned launcher dialog or enhances an existing `<dialog>` target.
287
+ * @param {HTMLDialogElement|string|null} [target=null] Dialog target, selector, or null.
288
+ * @param {LauncherOptions} [options={}] Launcher options.
289
+ */
290
+ constructor(target?: HTMLDialogElement | string | null, options?: LauncherOptions);
291
+ /** @returns {HTMLDialogElement} */
292
+ render(): HTMLDialogElement;
293
+ /** Opens the launcher and focuses/selects its query. @returns {this} @fires Launcher#open */
294
+ open(): this;
295
+ /** Closes the launcher. @returns {this} */
296
+ close(): this;
297
+ /** Toggles the launcher. @returns {this} */
298
+ toggle(): this;
299
+ /** Reports whether the launcher is open. @returns {boolean} */
300
+ isOpen(): boolean;
301
+ /** Focuses and selects the query field. @returns {this} */
302
+ focus(): this;
303
+ /** Replaces the query and refreshes local and remote results. @param {string} query @returns {this} */
304
+ setQuery(query: string): this;
305
+ /** Returns the untrimmed query. @returns {string} */
306
+ getQuery(): string;
307
+ /** Replaces local catalogue items. @param {LauncherItem[]} items @returns {this} */
308
+ setItems(items: LauncherItem[]): this;
309
+ /** Marks one local item as the current destination. @param {string|number|null} id Item id. @returns {this} */
310
+ setCurrent(id: string | number | null): this;
311
+ /** Replaces asynchronous sources and aborts work from the old set. @param {LauncherSource[]} sources @returns {this} */
312
+ setSources(sources: LauncherSource[]): this;
313
+ /** Aborts sources and removes the owned dialog. @returns {void} */
314
+ destroy(): void;
315
+ /** @returns {void} */
316
+ _refresh(): void;
317
+ /** @returns {Promise<void>} */
318
+ _loadSources(): Promise<void>;
319
+ /** @param {boolean} busy @returns {void} */
320
+ _setBusy(busy: boolean): void;
321
+ /** @returns {void} */
322
+ _abortRequest(): void;
323
+ /** @returns {void} */
324
+ _renderResults(): void;
325
+ /** @param {RankedLauncherItem} item @param {number} index @returns {HTMLElement} */
326
+ _option(item: RankedLauncherItem, index: number): HTMLElement;
327
+ /** @returns {void} */
328
+ _renderStatus(): void;
329
+ /** @returns {void} */
330
+ _syncActive(): void;
331
+ /** @param {KeyboardEvent} event @returns {void} */
332
+ _onKeydown(event: KeyboardEvent): void;
333
+ /** @param {string} direction @param {number[]} enabled @returns {number|null} */
334
+ _spatialIndex(direction: string, enabled: number[]): number | null;
335
+ /** @param {number} index @param {Event} event @returns {void} */
336
+ _activate(index: number, event: Event): void;
337
+ /** @param {KeyboardEvent} event @returns {void} */
338
+ _onDocumentKeydown(event: KeyboardEvent): void;
339
+ }
340
+ /**
341
+ * Ranks launcher items using the current ZeyOS application tiers.
342
+ * @param {RankedLauncherItem[]} items Items to rank.
343
+ * @param {string} query Query.
344
+ * @param {number} [limit=100] Maximum returned items.
345
+ * @returns {RankedLauncherItem[]}
346
+ */
347
+ export declare function rankLauncherItems(items: RankedLauncherItem[], query: string, limit?: number): RankedLauncherItem[];
348
+ /**
349
+ * Flattens loaded source results in configured source order rather than response-completion order.
350
+ * @param {LauncherSource[]} sources Configured sources.
351
+ * @param {Map<string, RankedLauncherItem[]>} sourceItems Loaded result map.
352
+ * @returns {RankedLauncherItem[]}
353
+ */
354
+ export declare function orderedLauncherSourceItems(sources: LauncherSource[], sourceItems: Map<string, RankedLauncherItem[]>): RankedLauncherItem[];
355
+ /** Fired when a result is activated. @event Launcher#select @type {CustomEvent<LauncherSelectDetail>} */
356
+ /** Fired when the query changes. @event Launcher#query @type {CustomEvent<{query: string}>} */
357
+ /** Fired after the dialog opens. @event Launcher#open @type {CustomEvent<Record<string, never>>} */
358
+ /** Fired after the dialog closes. @event Launcher#close @type {CustomEvent<Record<string, never>>} */
359
+ /** Fired when one asynchronous source fails. @event Launcher#error @type {CustomEvent<{source: LauncherSource, error: unknown}>} */
@@ -29,7 +29,7 @@ export type StackOptions = {
29
29
  */
30
30
  class?: string;
31
31
  };
32
- export type GridOptions = {
32
+ export type LayoutGridOptions = {
33
33
  /**
34
34
  * Column count at full width. Null fills the row with as
35
35
  * many tracks of `min` width as fit.
@@ -80,7 +80,7 @@ export type DomChild = import('../../core/dom.js').DomChild;
80
80
  * @property {string} [class=''] Extra class names.
81
81
  */
82
82
  /**
83
- * @typedef {Object} GridOptions
83
+ * @typedef {Object} LayoutGridOptions
84
84
  * @property {number|null} [columns=null] Column count at full width. Null fills the row with as
85
85
  * many tracks of `min` width as fit.
86
86
  * @property {number|string} [min='16rem'] Narrowest a track may get before the grid drops a
@@ -117,11 +117,11 @@ export declare function stack(options?: StackOptions, ...children: DomChild[]):
117
117
  * in a full-width page, a split pane, and a modal. Nothing here consults the viewport, which is
118
118
  * the usual reason a "responsive" grid still breaks inside a narrow panel.
119
119
  *
120
- * @param {GridOptions} [options={}] Grid options.
120
+ * @param {LayoutGridOptions} [options={}] Grid options.
121
121
  * @param {...DomChild} children Cells.
122
122
  * @returns {HTMLDivElement}
123
123
  */
124
- export declare function grid(options?: GridOptions, ...children: DomChild[]): HTMLDivElement;
124
+ export declare function grid(options?: LayoutGridOptions, ...children: DomChild[]): HTMLDivElement;
125
125
  /**
126
126
  * Creates a box that holds a fixed aspect ratio whatever its width, so an image, a map, or a
127
127
  * chart placeholder reserves its space before it loads.
@@ -46,7 +46,7 @@ export type MenuButtonOptions = {
46
46
  /**
47
47
  * Menu placement.
48
48
  */
49
- placement?: 'bottom-start' | 'bottom-end' | 'top-start' | 'top-end' | 'bottom' | 'top';
49
+ placement?: 'bottom-start' | 'bottom-end' | 'top-start' | 'top-end' | 'bottom' | 'top' | 'right-start' | 'right-end' | 'left-start' | 'left-end' | 'right' | 'left';
50
50
  /**
51
51
  * Select event listener.
52
52
  */
@@ -79,7 +79,7 @@ export type MenuButtonOptions = {
79
79
  * @property {string|null} [icon=null] Trigger icon name.
80
80
  * @property {'default'|'primary'|'danger'|'ghost'} [kind='default'] Trigger button kind.
81
81
  * @property {MenuButtonItem[]} [items=[]] Menu items and separators.
82
- * @property {'bottom-start'|'bottom-end'|'top-start'|'top-end'|'bottom'|'top'} [placement='bottom-start'] Menu placement.
82
+ * @property {'bottom-start'|'bottom-end'|'top-start'|'top-end'|'bottom'|'top'|'right-start'|'right-end'|'left-start'|'left-end'|'right'|'left'} [placement='bottom-start'] Menu placement.
83
83
  * @property {(event: CustomEvent<{value: unknown, item: MenuItem}>) => void} [onselect] Select event listener.
84
84
  * @property {(event: CustomEvent<Record<string, never>>) => void} [onopen] Open event listener.
85
85
  * @property {(event: CustomEvent<Record<string, never>>) => void} [onclose] Close event listener.
@@ -128,6 +128,14 @@ export declare class MenuButton extends Component<MenuButtonOptions> {
128
128
  * @returns {boolean}
129
129
  */
130
130
  isOpen(): boolean;
131
+ /** Returns the trigger button. @returns {HTMLElement} */
132
+ getTrigger(): HTMLElement;
133
+ /** Returns the owned menu panel. @returns {HTMLElement} */
134
+ getPanel(): HTMLElement;
135
+ /** Opens the menu and focuses its first enabled item. @returns {this} */
136
+ focusFirst(): this;
137
+ /** Opens the menu and focuses its last enabled item. @returns {this} */
138
+ focusLast(): this;
131
139
  /**
132
140
  * Sets the visible trigger label.
133
141
  * @param {string} label Trigger label.
@@ -67,6 +67,31 @@ export declare class Modal extends Component<ModalOptions> {
67
67
  * @param {ModalOptions} [options={}] Modal options.
68
68
  */
69
69
  constructor(_target?: Element | string | null, options?: ModalOptions);
70
+ /**
71
+ * Element the owned dialog is appended to. Overridden by subclasses that live inside a host
72
+ * rather than at the document level.
73
+ *
74
+ * Called from `render()`, which the base constructor runs before any subclass field
75
+ * initializers, so an override may read `this.options` but must not touch instance state.
76
+ * @returns {Element}
77
+ */
78
+ mountTarget(): Element;
79
+ /**
80
+ * Puts the dialog on screen. Overridden by subclasses that open non-modally.
81
+ * @returns {void}
82
+ */
83
+ _show(): void;
84
+ /**
85
+ * Whether an incoming `close` event is a real dismissal.
86
+ *
87
+ * A dialog cannot move between the top layer and the page flow while it is open, so a subclass
88
+ * that re-hosts itself has to close and immediately reopen. `close` is dispatched in a queued
89
+ * task, not synchronously, so that stale event arrives once the dialog is already open again —
90
+ * late enough to clobber `data-state`, fire a `close` nobody asked for, and trip
91
+ * `destroyOnClose`. Returning false from an override drops it at the source instead.
92
+ * @returns {boolean}
93
+ */
94
+ _isRealClose(): boolean;
70
95
  /**
71
96
  * Creates the owned native dialog.
72
97
  * @returns {HTMLDialogElement}
@@ -17,6 +17,12 @@ export type MultiValueEditorOptions = {
17
17
  * a drag handle, the up/down buttons, both, or neither.
18
18
  */
19
19
  reorder?: 'both' | 'buttons' | 'drag' | 'none';
20
+ /**
21
+ * Values change listener.
22
+ */
23
+ onchange?: (event: CustomEvent<{
24
+ values: string[];
25
+ }>) => void;
20
26
  };
21
27
  /**
22
28
  * Ordered value editor with explicit editable rows and controls.
@@ -121,5 +127,5 @@ export declare class MultiValueEditor extends Component<MultiValueEditorOptions>
121
127
  /**
122
128
  * Ordered values changed event.
123
129
  * @event MultiValueEditor#change
124
- * @type {CustomEvent<{values: string[]}>
130
+ * @type {CustomEvent<{values: string[]}>}
125
131
  */