@zeyos/zx 4.3.0 → 4.4.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 (136) hide show
  1. package/CHANGELOG.md +266 -1
  2. package/README.md +7 -3
  3. package/dist/types/components/activity-item/activity-item.d.ts +351 -0
  4. package/dist/types/components/activity-list/activity-list.d.ts +195 -0
  5. package/dist/types/components/app-sidebar/app-sidebar.d.ts +28 -0
  6. package/dist/types/components/button/button.d.ts +8 -0
  7. package/dist/types/components/calendar/calendar-model.d.ts +22 -0
  8. package/dist/types/components/calendar/calendar.d.ts +19 -0
  9. package/dist/types/components/card/card.d.ts +7 -0
  10. package/dist/types/components/card-view/card-view.d.ts +12 -4
  11. package/dist/types/components/card-view/record-card.d.ts +53 -5
  12. package/dist/types/components/code-editor/code-editor.d.ts +160 -0
  13. package/dist/types/components/code-editor/field-adapter.d.ts +5 -0
  14. package/dist/types/components/context-menu/context-menu.d.ts +18 -2
  15. package/dist/types/components/date-picker/date-picker.d.ts +8 -0
  16. package/dist/types/components/date-picker/time-picker.d.ts +7 -0
  17. package/dist/types/components/dialog/dialog.d.ts +29 -0
  18. package/dist/types/components/entity-ref/entity-ref.d.ts +331 -0
  19. package/dist/types/components/file-item/file-item.d.ts +234 -0
  20. package/dist/types/components/file-list/file-list.d.ts +171 -0
  21. package/dist/types/components/filter/filter.d.ts +91 -36
  22. package/dist/types/components/filter-panel/filter-panel.d.ts +449 -0
  23. package/dist/types/components/kanban-view/kanban-card.d.ts +138 -0
  24. package/dist/types/components/kanban-view/kanban-policy.d.ts +268 -0
  25. package/dist/types/components/kanban-view/kanban-view.d.ts +837 -26
  26. package/dist/types/components/launcher/launcher.d.ts +19 -12
  27. package/dist/types/components/list-toolbar/list-toolbar.d.ts +599 -0
  28. package/dist/types/components/menu-button/menu-button.d.ts +4 -37
  29. package/dist/types/components/message/message.d.ts +7 -0
  30. package/dist/types/components/modal/modal.d.ts +48 -0
  31. package/dist/types/components/navigation-bar/navigation-bar.d.ts +105 -21
  32. package/dist/types/components/panel/panel.d.ts +7 -0
  33. package/dist/types/components/search/search.d.ts +7 -0
  34. package/dist/types/components/select/select.d.ts +4 -0
  35. package/dist/types/components/sort-control/sort-control.d.ts +105 -0
  36. package/dist/types/components/stat-tile/stat-tile.d.ts +277 -0
  37. package/dist/types/components/tabbox/tabbox.d.ts +7 -0
  38. package/dist/types/components/table/table.d.ts +144 -0
  39. package/dist/types/components/table-view/table-view.d.ts +11 -5
  40. package/dist/types/components/timebox/timebox.d.ts +7 -0
  41. package/dist/types/components/value-list/value-list.d.ts +8 -0
  42. package/dist/types/components/view/record-view.d.ts +96 -5
  43. package/dist/types/core/component.d.ts +6 -1
  44. package/dist/types/core/icons.d.ts +17 -0
  45. package/dist/types/index.d.ts +13 -1
  46. package/dist/types/internal/app-rail.d.ts +10 -0
  47. package/dist/types/internal/menu-items.d.ts +134 -0
  48. package/dist/zx-zeyos.esm.js +651 -88
  49. package/dist/zx-zeyos.esm.min.js +8 -1
  50. package/dist/zx.css +6266 -3900
  51. package/dist/zx.esm.js +8487 -1805
  52. package/dist/zx.esm.min.js +10 -3
  53. package/dist/zx.global.js +8487 -1805
  54. package/dist/zx.global.min.js +10 -3
  55. package/dist/zx.min.css +1 -1
  56. package/docs/api.json +1811 -247
  57. package/docs/llms.md +345 -40
  58. package/docs/llms.txt +11 -7
  59. package/package.json +1 -2
  60. package/src/components/activity-item/activity-item.css +137 -0
  61. package/src/components/activity-item/activity-item.js +599 -0
  62. package/src/components/activity-list/activity-list.css +64 -0
  63. package/src/components/activity-list/activity-list.js +375 -0
  64. package/src/components/app-rail/app-rail.css +227 -19
  65. package/src/components/app-sidebar/app-sidebar.css +414 -24
  66. package/src/components/app-sidebar/app-sidebar.js +65 -5
  67. package/src/components/button/button.css +8 -0
  68. package/src/components/button/button.js +6 -1
  69. package/src/components/calendar/calendar-model.js +45 -0
  70. package/src/components/calendar/calendar.css +30 -10
  71. package/src/components/calendar/calendar.js +41 -13
  72. package/src/components/card/card.js +12 -1
  73. package/src/components/card-view/card-view.css +212 -9
  74. package/src/components/card-view/card-view.js +32 -16
  75. package/src/components/card-view/record-card.js +98 -21
  76. package/src/components/code-editor/code-editor.css +67 -0
  77. package/src/components/code-editor/code-editor.js +288 -0
  78. package/src/components/code-editor/field-adapter.js +34 -0
  79. package/src/components/context-menu/context-menu.css +80 -3
  80. package/src/components/context-menu/context-menu.js +22 -30
  81. package/src/components/date-picker/date-picker.js +22 -8
  82. package/src/components/date-picker/month-picker.js +3 -3
  83. package/src/components/date-picker/time-picker.js +20 -8
  84. package/src/components/dialog/dialog.js +88 -66
  85. package/src/components/dropdown/dropdown.js +2 -2
  86. package/src/components/entity-ref/entity-ref.css +182 -0
  87. package/src/components/entity-ref/entity-ref.js +496 -0
  88. package/src/components/file-item/file-item.css +88 -0
  89. package/src/components/file-item/file-item.js +371 -0
  90. package/src/components/file-list/file-list.css +51 -0
  91. package/src/components/file-list/file-list.js +320 -0
  92. package/src/components/filter/filter.css +27 -1
  93. package/src/components/filter/filter.js +199 -45
  94. package/src/components/filter-panel/filter-panel.css +104 -0
  95. package/src/components/filter-panel/filter-panel.js +964 -0
  96. package/src/components/kanban-view/kanban-card.js +239 -0
  97. package/src/components/kanban-view/kanban-policy.js +412 -0
  98. package/src/components/kanban-view/kanban-view.css +674 -36
  99. package/src/components/kanban-view/kanban-view.js +1762 -240
  100. package/src/components/launcher/launcher.js +59 -27
  101. package/src/components/list-toolbar/list-toolbar.css +189 -0
  102. package/src/components/list-toolbar/list-toolbar.js +851 -0
  103. package/src/components/menu-button/menu-button.css +80 -3
  104. package/src/components/menu-button/menu-button.js +21 -37
  105. package/src/components/message/message.css +14 -12
  106. package/src/components/message/message.js +13 -2
  107. package/src/components/modal/modal.css +15 -0
  108. package/src/components/modal/modal.js +141 -0
  109. package/src/components/navigation-bar/navigation-bar.css +77 -2
  110. package/src/components/navigation-bar/navigation-bar.js +171 -4
  111. package/src/components/panel/panel.js +13 -2
  112. package/src/components/search/search.js +17 -5
  113. package/src/components/select/field-adapter.js +4 -1
  114. package/src/components/select/select.js +3 -0
  115. package/src/components/sort-control/sort-control.css +17 -0
  116. package/src/components/sort-control/sort-control.js +140 -0
  117. package/src/components/stat-tile/stat-tile.css +213 -0
  118. package/src/components/stat-tile/stat-tile.js +590 -0
  119. package/src/components/tabbox/tabbox.js +12 -1
  120. package/src/components/table/table.css +51 -2
  121. package/src/components/table/table.js +298 -19
  122. package/src/components/table-view/table-view.css +8 -2
  123. package/src/components/table-view/table-view.js +21 -6
  124. package/src/components/tag-picker/tag-picker.css +3 -1
  125. package/src/components/timebox/timebox.js +18 -5
  126. package/src/components/value-list/value-list.js +22 -6
  127. package/src/components/view/record-view.css +5 -0
  128. package/src/components/view/record-view.js +100 -7
  129. package/src/core/component.js +8 -3
  130. package/src/core/icons.js +74 -5
  131. package/src/index.js +33 -3
  132. package/src/internal/app-rail.js +19 -1
  133. package/src/internal/menu-items.js +142 -0
  134. package/styles/print.css +192 -0
  135. package/styles/zx.css +11 -0
  136. package/DESIGN-SYSTEM.md +0 -182
@@ -0,0 +1,449 @@
1
+ import { Component } from '../../core/component.js';
2
+ import { NumberField } from '../number-field/number-field.js';
3
+ export type FilterPanelEdge = 'from' | 'to';
4
+ export type FilterPanelKind = 'text' | 'select' | 'date' | 'number';
5
+ export type FilterPanelMode = 'draft' | 'live';
6
+ export type FilterPanelSerialize = 'seconds' | 'ms' | 'iso' | ((date: Date, edge: FilterPanelEdge) => unknown);
7
+ export type FilterPanelOption = {
8
+ /**
9
+ * Option value, emitted unchanged.
10
+ */
11
+ value: unknown;
12
+ /**
13
+ * Visible label; defaults to the value.
14
+ */
15
+ label?: string;
16
+ };
17
+ export type FilterPanelField = {
18
+ /**
19
+ * One of `text`, `select`, `date`, `date:range`, `int`, `float`, `number`,
20
+ * `int:range`, `float:range`, `number:range`. Any other type renders as a labelled placeholder
21
+ * naming it and is left out of the value.
22
+ */
23
+ type: string;
24
+ /**
25
+ * Visible filter name; defaults to the field key.
26
+ */
27
+ label?: string;
28
+ /**
29
+ * Select
30
+ * options. `{value, label}` and `{ID, name}` are both understood, as are bare primitives.
31
+ */
32
+ options?: Array<FilterPanelOption | Record<string, unknown> | string | number>;
33
+ /**
34
+ * Lowest accepted number, applied to both range edges.
35
+ */
36
+ min?: number | null;
37
+ /**
38
+ * Highest accepted number, applied to both range edges.
39
+ */
40
+ max?: number | null;
41
+ /**
42
+ * Number increment; defaults to 1 for `int` and 0.01 for `float`.
43
+ */
44
+ step?: number;
45
+ /**
46
+ * Placeholder for the text and number inputs.
47
+ */
48
+ placeholder?: string;
49
+ /**
50
+ * Forces the select filter's search box on or off, overriding the
51
+ * eight-option threshold.
52
+ */
53
+ search?: boolean;
54
+ };
55
+ export type FilterPanelSpec = {
56
+ /**
57
+ * Control family the type belongs to.
58
+ */
59
+ kind: FilterPanelKind;
60
+ /**
61
+ * Whether the type carries a `from`/`to` pair.
62
+ */
63
+ range: boolean;
64
+ /**
65
+ * Whether a number type is whole-valued.
66
+ */
67
+ integer: boolean;
68
+ };
69
+ export type FilterPanelApplyDetail = {
70
+ /**
71
+ * Committed filter values, pruned and serialized.
72
+ */
73
+ value: Record<string, unknown>;
74
+ };
75
+ export type FilterPanelChangeDetail = {
76
+ /**
77
+ * The draft as it would be applied.
78
+ */
79
+ value: Record<string, unknown>;
80
+ /**
81
+ * Field that moved, or null when the whole value was replaced.
82
+ */
83
+ field: string | null;
84
+ };
85
+ export type FilterPanelOptions = {
86
+ /**
87
+ * Field metadata exactly as a list
88
+ * response publishes it. An empty map is the ordinary case, not an error: it renders `emptyText`.
89
+ */
90
+ fields?: Record<string, FilterPanelField>;
91
+ /**
92
+ * Display order by field key; omitted keeps object order.
93
+ * Keys the map does not declare are ignored, and fields the order omits follow in map order.
94
+ */
95
+ order?: string[] | null;
96
+ /**
97
+ * Applied filters. The draft starts as a copy.
98
+ */
99
+ value?: Record<string, unknown>;
100
+ /**
101
+ * `'draft'` collects edits until `apply()`; `'live'`
102
+ * applies every committed edit.
103
+ */
104
+ mode?: FilterPanelMode;
105
+ /**
106
+ * How a date leaves the component. A range's
107
+ * lower bound takes the start of its day and its upper bound the end, so a one-day range matches.
108
+ */
109
+ serialize?: FilterPanelSerialize;
110
+ /**
111
+ * Text shown when `fields` is empty; null resolves
112
+ * `filterPanel.empty`.
113
+ */
114
+ emptyText?: string | null;
115
+ /**
116
+ * Localized messages.
117
+ */
118
+ msg?: Record<string, string> | Record<string, Record<string, string>>;
119
+ /**
120
+ * Apply listener.
121
+ */
122
+ onapply?: (event: CustomEvent<FilterPanelApplyDetail>) => void;
123
+ /**
124
+ * Change listener.
125
+ */
126
+ onchange?: (event: CustomEvent<FilterPanelChangeDetail>) => void;
127
+ };
128
+ /** @typedef {'from'|'to'} FilterPanelEdge */
129
+ /** @typedef {'text'|'select'|'date'|'number'} FilterPanelKind */
130
+ /** @typedef {'draft'|'live'} FilterPanelMode */
131
+ /** @typedef {'seconds'|'ms'|'iso'|((date: Date, edge: FilterPanelEdge) => unknown)} FilterPanelSerialize */
132
+ /**
133
+ * @typedef {Object} FilterPanelOption
134
+ * @property {unknown} value Option value, emitted unchanged.
135
+ * @property {string} [label] Visible label; defaults to the value.
136
+ */
137
+ /**
138
+ * @typedef {Object} FilterPanelField
139
+ * @property {string} type One of `text`, `select`, `date`, `date:range`, `int`, `float`, `number`,
140
+ * `int:range`, `float:range`, `number:range`. Any other type renders as a labelled placeholder
141
+ * naming it and is left out of the value.
142
+ * @property {string} [label] Visible filter name; defaults to the field key.
143
+ * @property {Array<FilterPanelOption|Record<string, unknown>|string|number>} [options] Select
144
+ * options. `{value, label}` and `{ID, name}` are both understood, as are bare primitives.
145
+ * @property {number|null} [min] Lowest accepted number, applied to both range edges.
146
+ * @property {number|null} [max] Highest accepted number, applied to both range edges.
147
+ * @property {number} [step] Number increment; defaults to 1 for `int` and 0.01 for `float`.
148
+ * @property {string} [placeholder] Placeholder for the text and number inputs.
149
+ * @property {boolean} [search] Forces the select filter's search box on or off, overriding the
150
+ * eight-option threshold.
151
+ */
152
+ /**
153
+ * @typedef {Object} FilterPanelSpec
154
+ * @property {FilterPanelKind} kind Control family the type belongs to.
155
+ * @property {boolean} range Whether the type carries a `from`/`to` pair.
156
+ * @property {boolean} integer Whether a number type is whole-valued.
157
+ */
158
+ /**
159
+ * @typedef {Object} FilterPanelApplyDetail
160
+ * @property {Record<string, unknown>} value Committed filter values, pruned and serialized.
161
+ */
162
+ /**
163
+ * @typedef {Object} FilterPanelChangeDetail
164
+ * @property {Record<string, unknown>} value The draft as it would be applied.
165
+ * @property {string|null} field Field that moved, or null when the whole value was replaced.
166
+ */
167
+ /**
168
+ * @typedef {Object} FilterPanelOptions
169
+ * @property {Record<string, FilterPanelField>} [fields={}] Field metadata exactly as a list
170
+ * response publishes it. An empty map is the ordinary case, not an error: it renders `emptyText`.
171
+ * @property {string[]|null} [order=null] Display order by field key; omitted keeps object order.
172
+ * Keys the map does not declare are ignored, and fields the order omits follow in map order.
173
+ * @property {Record<string, unknown>} [value={}] Applied filters. The draft starts as a copy.
174
+ * @property {FilterPanelMode} [mode='draft'] `'draft'` collects edits until `apply()`; `'live'`
175
+ * applies every committed edit.
176
+ * @property {FilterPanelSerialize} [serialize='seconds'] How a date leaves the component. A range's
177
+ * lower bound takes the start of its day and its upper bound the end, so a one-day range matches.
178
+ * @property {string|null} [emptyText=null] Text shown when `fields` is empty; null resolves
179
+ * `filterPanel.empty`.
180
+ * @property {Record<string, string>|Record<string, Record<string, string>>} [msg] Localized messages.
181
+ * @property {(event: CustomEvent<FilterPanelApplyDetail>) => void} [onapply] Apply listener.
182
+ * @property {(event: CustomEvent<FilterPanelChangeDetail>) => void} [onchange] Change listener.
183
+ */
184
+ /**
185
+ * Declarative filter form built from the field metadata a list endpoint publishes, producing the
186
+ * query object that endpoint expects back.
187
+ *
188
+ * It is neither of the other two filter components: `DataFilter` filters rows that are already in
189
+ * the browser, and `Filter` builds an operator AST. This one turns `{key: {type, label, options}}`
190
+ * into controls and gives back `{key: value}` — pruned to the constraints that are actually set,
191
+ * with `0` counted as one of them.
192
+ *
193
+ * Draft mode is the default because a control that applies on change reflows the list underneath
194
+ * the panel being read, and costs a request per edit. `'live'` is the deliberate opt-in.
195
+ *
196
+ * Each control family commits at its own natural granularity: text filters on every keystroke,
197
+ * dates when the picker produces a complete date, checkboxes immediately, and numbers when
198
+ * `NumberField` commits them (blur, Enter, or a step) rather than half-typed.
199
+ *
200
+ * @fires FilterPanel#apply
201
+ * @fires FilterPanel#change
202
+ * @extends {Component<FilterPanelOptions>}
203
+ */
204
+ export declare class FilterPanel extends Component<FilterPanelOptions> {
205
+ _createdRoot: boolean;
206
+ _snapshot: import("../../core/dom.js").TargetSnapshot;
207
+ _restored: boolean;
208
+ _entries: any[];
209
+ _children: any[];
210
+ _writing: boolean;
211
+ _draft: {};
212
+ _applied: {};
213
+ _appliedDraft: string;
214
+ _fields: {
215
+ key: string;
216
+ field: FilterPanelField;
217
+ spec: FilterPanelSpec | null;
218
+ }[];
219
+ static cssName: string;
220
+ /** @type {FilterPanelOptions} */
221
+ static defaults: FilterPanelOptions;
222
+ /** @returns {HTMLElement} Panel root. */
223
+ render(): HTMLElement;
224
+ /**
225
+ * Returns the applied value: only the constraints that are set, with dates serialized through
226
+ * `serialize`. Unknown field types are never part of it.
227
+ * @returns {Record<string, unknown>}
228
+ */
229
+ getValue(): Record<string, unknown>;
230
+ /**
231
+ * Replaces both the applied value and the draft the controls show. Accepts what `getValue()`
232
+ * returns as well as raw input values, so a value that survived a URL round-trip goes back in.
233
+ * @param {Record<string, unknown>} value Filter values keyed by field.
234
+ * @returns {this}
235
+ * @fires FilterPanel#change
236
+ */
237
+ setValue(value: Record<string, unknown>): this;
238
+ /**
239
+ * Commits the draft. In live mode every committed edit already does this; calling it directly is
240
+ * how a host forces a reload with the values that are on screen.
241
+ * @returns {this}
242
+ * @fires FilterPanel#apply
243
+ */
244
+ apply(): this;
245
+ /**
246
+ * Restores the controls to the `value` the panel was constructed with **without committing**, so
247
+ * the filters in force stay in force. This is the Cancel half of a sheet: the panel goes back to
248
+ * showing what is being filtered by. Contrast `clear()`, which commits. In live mode there is no
249
+ * uncommitted draft to hold back, so there it applies like any other edit.
250
+ * @returns {this}
251
+ * @fires FilterPanel#change
252
+ * @fires FilterPanel#apply
253
+ */
254
+ reset(): this;
255
+ /**
256
+ * Empties every control **and commits**, in both modes. "Clear the filters" has one meaning, and
257
+ * leaving a list filtered behind a panel showing no filters is not it — the records look missing
258
+ * and nothing on screen explains why. Contrast `reset()`, which restores the controls without
259
+ * committing. The price is one unfiltered load at the moment the button is pressed, which is
260
+ * also the feedback that says the filters are gone.
261
+ * @returns {this}
262
+ * @fires FilterPanel#change
263
+ * @fires FilterPanel#apply
264
+ */
265
+ clear(): this;
266
+ /** Destroys the composed controls and puts an enhanced target back as found. @returns {void} */
267
+ destroy(): void;
268
+ /** @returns {HTMLElement} The actions row. */
269
+ _buildActions(): HTMLElement;
270
+ /**
271
+ * @param {string} key Field key.
272
+ * @param {FilterPanelField} field Field metadata.
273
+ * @param {FilterPanelSpec|null} spec Resolved type, or null when the type is unknown.
274
+ * @returns {HTMLElement}
275
+ */
276
+ _buildField(key: string, field: FilterPanelField, spec: FilterPanelSpec | null): HTMLElement;
277
+ /**
278
+ * @param {string} key Field key.
279
+ * @param {FilterPanelField} field Field metadata.
280
+ * @param {string} label Visible filter name.
281
+ * @returns {Element} The checklist root.
282
+ */
283
+ _buildSelect(key: string, field: FilterPanelField, label: string): Element;
284
+ /**
285
+ * @param {string} key Field key.
286
+ * @param {FilterPanelField} field Field metadata.
287
+ * @param {string} label Visible filter name.
288
+ * @returns {Element[]}
289
+ */
290
+ _buildText(key: string, field: FilterPanelField, label: string): Element[];
291
+ /**
292
+ * @param {string} key Field key.
293
+ * @param {FilterPanelField} field Field metadata.
294
+ * @param {string} label Visible filter name.
295
+ * @param {FilterPanelSpec} spec Resolved type.
296
+ * @returns {Element[]}
297
+ */
298
+ _buildDate(key: string, field: FilterPanelField, label: string, spec: FilterPanelSpec): Element[];
299
+ /**
300
+ * @param {string} value Initial `YYYY-MM-DD` value.
301
+ * @param {Record<string, unknown>} props Extra properties.
302
+ * @returns {HTMLInputElement}
303
+ */
304
+ _dateInput(value: string, props: Record<string, unknown>): HTMLInputElement;
305
+ /**
306
+ * @param {string} key Field key.
307
+ * @param {FilterPanelField} field Field metadata.
308
+ * @param {string} label Visible filter name.
309
+ * @param {FilterPanelSpec} spec Resolved type.
310
+ * @returns {Element[]}
311
+ */
312
+ _buildNumber(key: string, field: FilterPanelField, label: string, spec: FilterPanelSpec): Element[];
313
+ /**
314
+ * @param {FilterPanelField} field Field metadata.
315
+ * @param {FilterPanelSpec} spec Resolved type.
316
+ * @param {string} name Accessible name for the spinbutton.
317
+ * @param {number|null} value Initial value.
318
+ * @returns {NumberField}
319
+ */
320
+ _numberField(field: FilterPanelField, spec: FilterPanelSpec, name: string, value: number | null): NumberField;
321
+ /** @param {FilterPanelEdge} edge Range edge. @returns {string} */
322
+ _edgeLabel(edge: FilterPanelEdge): string;
323
+ /** @param {string} label Filter name. @param {FilterPanelEdge} edge Range edge. @returns {string} */
324
+ _edgeName(label: string, edge: FilterPanelEdge): string;
325
+ /** @param {string} key Field key. @param {unknown} value Raw draft value. @returns {void} */
326
+ _edited(key: string, value: unknown): void;
327
+ /**
328
+ * @param {string} key Field key.
329
+ * @param {FilterPanelEdge} edge Range edge.
330
+ * @param {unknown} value Raw edge value.
331
+ * @returns {void}
332
+ */
333
+ _editedEdge(key: string, edge: FilterPanelEdge, value: unknown): void;
334
+ /** @param {string} key Field key. @returns {void} */
335
+ _afterEdit(key: string): void;
336
+ /**
337
+ * Keeps a composed control's own bubbling DOM events off the panel root. `Checklist` and
338
+ * `NumberField` both emit `zx-change`, which is a name this panel uses with a different detail,
339
+ * so a host listening on the panel root would otherwise see two shapes of one event. They stay
340
+ * available on the control's own root, exactly where that control put them.
341
+ * @param {Component} child Composed control.
342
+ * @returns {void}
343
+ */
344
+ _isolate(child: Component): void;
345
+ /**
346
+ * @param {Record<string, unknown>} draft Replacement draft.
347
+ * @param {{commit?: boolean}} [options={}] Set `commit` to apply the replacement as well.
348
+ * @returns {this}
349
+ */
350
+ _replaceDraft(draft: Record<string, unknown>, { commit }?: {
351
+ commit?: boolean;
352
+ }): this;
353
+ /** @param {Record<string, unknown>} value The draft value becoming the applied one. @returns {void} */
354
+ _commit(value: Record<string, unknown>): void;
355
+ /** @returns {Record<string, unknown>} The draft, serialized and pruned. */
356
+ _draftValue(): Record<string, unknown>;
357
+ /** Pushes the draft back into the controls without re-entering the edit path. @returns {void} */
358
+ _writeControls(): void;
359
+ /** @param {Record<string, unknown>} [value] The draft value, when it is already at hand. @returns {void} */
360
+ _syncActions(value?: Record<string, unknown>): void;
361
+ /**
362
+ * Resolves a message through the host translator, falling back to the built-in English text.
363
+ * @param {string} key Message key.
364
+ * @param {string} fallback Built-in text, with `%1`-style placeholders.
365
+ * @param {...unknown} args Interpolation values.
366
+ * @returns {string}
367
+ */
368
+ _message(key: string, fallback: string, ...args: unknown[]): string;
369
+ }
370
+ /**
371
+ * Committed filter values, ready to send to the list endpoint. In draft mode this is the Apply
372
+ * button or `apply()`; in live mode it is every committed edit.
373
+ * @event FilterPanel#apply
374
+ * @type {CustomEvent<FilterPanelApplyDetail>}
375
+ */
376
+ /**
377
+ * Any change to the draft, with the field that moved (null when the whole value was replaced).
378
+ * `value` is the draft as it would be applied.
379
+ * @event FilterPanel#change
380
+ * @type {CustomEvent<FilterPanelChangeDetail>}
381
+ */
382
+ /**
383
+ * Resolves a declared field type. Returns null for a type the panel cannot render, which is what
384
+ * makes an unknown type a visible placeholder rather than a guess.
385
+ * @param {unknown} type Declared type.
386
+ * @returns {FilterPanelSpec|null}
387
+ */
388
+ export declare function parseFieldType(type: unknown): FilterPanelSpec | null;
389
+ /**
390
+ * Whether a value is a constraint rather than an absent one. `0` is a value; `''`, `null`,
391
+ * `undefined`, `NaN`, `[]` and `{from: null, to: null}` are not.
392
+ * @param {unknown} value Candidate value.
393
+ * @returns {boolean}
394
+ */
395
+ export declare function isActiveValue(value: unknown): boolean;
396
+ /**
397
+ * Drops every entry that is not a constraint, and every inactive edge of a range, so an
398
+ * open-ended range emits only the bound it has.
399
+ * @param {Record<string, unknown>} value Candidate values keyed by field.
400
+ * @returns {Record<string, unknown>}
401
+ */
402
+ export declare function pruneValue(value: Record<string, unknown>): Record<string, unknown>;
403
+ /**
404
+ * Converts anything a calendar day can arrive as — a `YYYY-MM-DD` string, an ISO timestamp, a
405
+ * `Date`, Unix seconds or milliseconds — into the local calendar day a native date input holds.
406
+ * Numbers below 1e11 are read as seconds, which is the boundary between the two epochs in use.
407
+ * @param {unknown} value Candidate day.
408
+ * @returns {string} `YYYY-MM-DD`, or an empty string when there is no day in it.
409
+ */
410
+ export declare function toDateInput(value: unknown): string;
411
+ /**
412
+ * Serializes one calendar day at one edge of a range. The `from` edge takes the first instant of
413
+ * its local day and the `to` edge the last, so a range whose ends name the same day still matches
414
+ * everything recorded on it.
415
+ * @param {unknown} day Calendar day in any form `toDateInput()` accepts.
416
+ * @param {FilterPanelEdge} edge Which end of the range the day is.
417
+ * @param {FilterPanelSerialize} [serialize='seconds'] Output format, or a function receiving the
418
+ * edge instant as a `Date`.
419
+ * @returns {unknown} The serialized day, or null when there is no day.
420
+ */
421
+ export declare function serializeDate(day: unknown, edge: FilterPanelEdge, serialize?: FilterPanelSerialize): unknown;
422
+ /**
423
+ * Normalizes declared select options. `{value, label}`, `{ID, name}`, and bare primitives all
424
+ * arrive from one instance or another.
425
+ * @param {unknown} options Declared options.
426
+ * @returns {Array<{value: unknown, label: string}>}
427
+ */
428
+ export declare function normalizeOptions(options: unknown): Array<{
429
+ value: unknown;
430
+ label: string;
431
+ }>;
432
+ /**
433
+ * Converts incoming values into the internal draft shape the controls hold: trimmed text, canonical
434
+ * option values, `YYYY-MM-DD` days, and finite numbers. Fields with an unknown type are left out.
435
+ * Running it on a draft returns the same draft, so it is safe on either shape.
436
+ * @param {Record<string, unknown>|null|undefined} value Incoming values keyed by field.
437
+ * @param {Record<string, FilterPanelField>} fields Field metadata.
438
+ * @returns {Record<string, unknown>}
439
+ */
440
+ export declare function toDraft(value: Record<string, unknown> | null | undefined, fields: Record<string, FilterPanelField>): Record<string, unknown>;
441
+ /**
442
+ * Turns values into the query object a list endpoint is sent: only the constraints that are set,
443
+ * dates serialized at the right edge, unknown field types excluded.
444
+ * @param {Record<string, unknown>|null|undefined} value Values keyed by field, raw or drafted.
445
+ * @param {Record<string, FilterPanelField>} fields Field metadata.
446
+ * @param {FilterPanelSerialize} [serialize='seconds'] Date output format.
447
+ * @returns {Record<string, unknown>}
448
+ */
449
+ export declare function serializeFilterValue(value: Record<string, unknown> | null | undefined, fields: Record<string, FilterPanelField>, serialize?: FilterPanelSerialize): Record<string, unknown>;
@@ -0,0 +1,138 @@
1
+ export type KanbanRecord = Record<string, any>;
2
+ export type KanbanIndicator = {
3
+ /**
4
+ * Visible text.
5
+ */
6
+ label: string;
7
+ /**
8
+ * Semantic intent.
9
+ */
10
+ tone?: 'neutral' | 'accent' | 'success' | 'warning' | 'danger' | 'info';
11
+ /**
12
+ * Optional leading icon name, used instead of the status dot.
13
+ */
14
+ icon?: string | null;
15
+ /**
16
+ * Whether a leading status dot is drawn.
17
+ */
18
+ dot?: boolean;
19
+ /**
20
+ * Native title, useful when the label alone is terse.
21
+ */
22
+ title?: string;
23
+ };
24
+ export type KanbanProgress = {
25
+ /**
26
+ * Completed amount, clamped into `[0, max]`.
27
+ */
28
+ value: number;
29
+ /**
30
+ * Amount that counts as finished.
31
+ */
32
+ max: number;
33
+ /**
34
+ * Rounded completion percentage.
35
+ */
36
+ percent: number;
37
+ /**
38
+ * Visible meter label, or null for the caller's default.
39
+ */
40
+ label: string | null;
41
+ };
42
+ export type KanbanAssignee = {
43
+ /**
44
+ * Person's name, used as the accessible label.
45
+ */
46
+ name: string;
47
+ /**
48
+ * Safe image URL, or null for the initials fallback.
49
+ */
50
+ src: string | null;
51
+ /**
52
+ * Fallback initials.
53
+ */
54
+ initials: string;
55
+ };
56
+ /**
57
+ * Normalizes one indicator value into the descriptor the badge is built from. A plain value
58
+ * becomes the label and looks its tone up in the supplied map, so an application expresses
59
+ * "High means danger" as data rather than as a renderer.
60
+ * @param {unknown} value Raw field value, descriptor, or null.
61
+ * @param {Record<string, string>} [tones={}] Value-to-tone map.
62
+ * @returns {KanbanIndicator|null} Descriptor, or null when there is nothing to show.
63
+ */
64
+ export declare function resolveKanbanIndicator(value: unknown, tones?: Record<string, string>): KanbanIndicator | null;
65
+ /**
66
+ * Builds one indicator badge.
67
+ * @param {KanbanIndicator} indicator Normalized descriptor.
68
+ * @returns {HTMLElement} Badge element.
69
+ */
70
+ export declare function createKanbanIndicator(indicator: KanbanIndicator): HTMLElement;
71
+ /**
72
+ * Normalizes a completion value against an explicit scale. The scale is never guessed: a `0.72`
73
+ * on a 0–100 board is seven-tenths of a percent, and only the application knows which it meant.
74
+ * @param {unknown} value Raw field value, or `{value, max, label}`.
75
+ * @param {number} [max=100] Amount that counts as finished.
76
+ * @returns {KanbanProgress|null} Descriptor, or null when there is nothing to show.
77
+ */
78
+ export declare function resolveKanbanProgress(value: unknown, max?: number): KanbanProgress | null;
79
+ /**
80
+ * Builds the card's completion meter. The track is the accessible progress element itself, so the
81
+ * value is available without depending on the visible percentage text.
82
+ * @param {KanbanProgress} progress Normalized descriptor.
83
+ * @param {string} label Meter label.
84
+ * @param {string} valueText Formatted readout drawn opposite the label.
85
+ * @returns {HTMLElement} Meter element.
86
+ */
87
+ export declare function createKanbanProgress(progress: KanbanProgress, label: string, valueText: string): HTMLElement;
88
+ /**
89
+ * Normalizes one or more responsible people. Names, name lists, and descriptor objects all
90
+ * resolve to the same shape, and an unsafe image URL degrades to initials rather than failing.
91
+ * @param {unknown} value Raw field value.
92
+ * @returns {KanbanAssignee[]} Normalized people, in the order supplied.
93
+ */
94
+ export declare function resolveKanbanAssignees(value: unknown): KanbanAssignee[];
95
+ /**
96
+ * Splits a list of people into the faces that are drawn and the number the overflow chip stands
97
+ * for. Exists as one function so the slice and the chip can never be computed from different
98
+ * normalizations of the same option — a fractional limit used to floor every face away while the
99
+ * chip still counted from the raw value.
100
+ * @param {number} max Requested face count.
101
+ * @param {number} total People available.
102
+ * @returns {{shown:number,hidden:number}} Normalized split.
103
+ */
104
+ export declare function kanbanAvatarLimit(max: number, total: number): {
105
+ shown: number;
106
+ hidden: number;
107
+ };
108
+ /**
109
+ * Builds the assignee avatar group. The group carries one accessible name listing everyone,
110
+ * including the people behind the overflow chip, and the chips themselves are hidden so a screen
111
+ * reader announces the list once rather than once per face.
112
+ * @param {KanbanAssignee[]} people Normalized people.
113
+ * @param {number} max Faces drawn before the overflow chip.
114
+ * @param {string} groupLabel Accessible name for the whole group.
115
+ * @param {(count: number) => string} overflowLabel Text for the overflow chip, given how many
116
+ * people it stands for. The count is derived here so it can never disagree with the slice.
117
+ * @returns {HTMLElement|null} Group element, or null when nobody is assigned.
118
+ */
119
+ export declare function createKanbanAvatars(people: KanbanAssignee[], max: number, groupLabel: string, overflowLabel: (count: number) => string): HTMLElement | null;
120
+ /**
121
+ * Builds the card's head row: what the record is, and how urgent it is.
122
+ * @param {Object} parts Row content.
123
+ * @param {string|null} parts.entityIcon Icon name, or null.
124
+ * @param {string} parts.identifier Record key, or an empty string.
125
+ * @param {{indicator:Node|KanbanIndicator|null,prefix:string}[]} parts.flags Trailing indicators,
126
+ * each with the visually hidden text that names what it measures.
127
+ * @param {string} parts.identifierPrefix Visually hidden text read before the record key.
128
+ * @returns {HTMLElement|null} Head row, or null when it would be empty.
129
+ */
130
+ export declare function createKanbanCardHead(parts: {
131
+ entityIcon: string | null;
132
+ identifier: string;
133
+ flags: {
134
+ indicator: Node | KanbanIndicator | null;
135
+ prefix: string;
136
+ }[];
137
+ identifierPrefix: string;
138
+ }): HTMLElement | null;