@zeyos/zx 4.3.4 → 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 +438 -0
- package/README.md +49 -10
- package/dist/types/components/activity-item/activity-item.d.ts +351 -0
- package/dist/types/components/activity-list/activity-list.d.ts +217 -0
- package/dist/types/components/app-sidebar/app-sidebar.d.ts +33 -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 +23 -0
- package/dist/types/components/calendar/calendar.d.ts +19 -0
- package/dist/types/components/card/card.d.ts +7 -0
- package/dist/types/components/card-view/card-view.d.ts +11 -3
- package/dist/types/components/card-view/record-card.d.ts +7 -1
- 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 +149 -0
- package/dist/types/components/code-editor/field-adapter.d.ts +5 -0
- package/dist/types/components/context-menu/context-menu.d.ts +18 -2
- package/dist/types/components/date-picker/date-picker.d.ts +8 -0
- package/dist/types/components/date-picker/time-picker.d.ts +7 -0
- 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 +75 -6
- package/dist/types/components/dropdown/dropdown.d.ts +2 -2
- package/dist/types/components/entity-ref/entity-ref.d.ts +331 -0
- 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 +262 -0
- package/dist/types/components/file-list/file-list.d.ts +171 -0
- package/dist/types/components/filter/filter.d.ts +91 -36
- package/dist/types/components/filter-panel/filter-panel.d.ts +449 -0
- package/dist/types/components/form/form.d.ts +12 -1
- package/dist/types/components/kanban-view/kanban-card.d.ts +146 -0
- package/dist/types/components/kanban-view/kanban-view.d.ts +170 -4
- package/dist/types/components/launcher/launcher.d.ts +278 -26
- package/dist/types/components/list-toolbar/list-toolbar.d.ts +599 -0
- package/dist/types/components/menu-button/menu-button.d.ts +37 -42
- package/dist/types/components/message/message.d.ts +126 -17
- package/dist/types/components/modal/modal.d.ts +61 -2
- package/dist/types/components/navigation-bar/navigation-bar.d.ts +105 -21
- package/dist/types/components/panel/panel.d.ts +7 -0
- package/dist/types/components/search/search.d.ts +7 -0
- 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 +15 -3
- package/dist/types/components/sort-control/sort-control.d.ts +105 -0
- package/dist/types/components/stat-tile/stat-tile.d.ts +288 -0
- package/dist/types/components/tabbox/tabbox.d.ts +16 -0
- package/dist/types/components/table/table.d.ts +190 -1
- package/dist/types/components/table-view/table-view.d.ts +11 -5
- package/dist/types/components/tag-picker/tag-picker.d.ts +21 -4
- package/dist/types/components/timebox/timebox.d.ts +7 -0
- package/dist/types/components/tree/tree.d.ts +13 -0
- package/dist/types/components/value-list/value-list.d.ts +8 -0
- package/dist/types/components/view/record-view.d.ts +96 -5
- package/dist/types/core/breakpoint.d.ts +1 -1
- package/dist/types/core/icons.d.ts +37 -22
- 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 +16 -3
- package/dist/types/internal/app-rail.d.ts +10 -0
- package/dist/types/internal/menu-items.d.ts +134 -0
- 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 +2206 -489
- package/dist/zx-zeyos.esm.min.js +56 -1
- package/dist/zx.css +3322 -724
- package/dist/zx.esm.js +12244 -5809
- package/dist/zx.esm.min.js +58 -3
- package/dist/zx.global.js +12246 -5811
- package/dist/zx.global.min.js +58 -3
- package/dist/zx.min.css +1 -1
- package/docs/api.json +1683 -146
- package/docs/llms.md +777 -110
- package/docs/llms.txt +14 -8
- package/package.json +1 -1
- package/src/components/account-menu/account-menu.css +35 -10
- package/src/components/activity-item/activity-item.css +137 -0
- package/src/components/activity-item/activity-item.js +602 -0
- package/src/components/activity-list/activity-list.css +99 -0
- package/src/components/activity-list/activity-list.js +409 -0
- package/src/components/app-icon/app-icon.css +1 -1
- package/src/components/app-rail/app-rail.css +191 -22
- package/src/components/app-sidebar/app-sidebar.css +349 -24
- package/src/components/app-sidebar/app-sidebar.js +86 -11
- 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 +74 -8
- package/src/components/button/button.js +44 -1
- package/src/components/calendar/calendar.css +46 -46
- package/src/components/calendar/calendar.js +33 -3
- package/src/components/card/card.css +2 -2
- package/src/components/card/card.js +12 -1
- package/src/components/card-view/card-view.css +10 -7
- package/src/components/card-view/card-view.js +25 -9
- package/src/components/card-view/record-card.js +7 -3
- 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 +68 -0
- package/src/components/code-editor/code-editor.js +306 -0
- package/src/components/code-editor/field-adapter.js +34 -0
- package/src/components/context-menu/context-menu.css +87 -5
- package/src/components/context-menu/context-menu.js +22 -30
- 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-picker.js +22 -8
- package/src/components/date-picker/date-range-picker.css +3 -3
- package/src/components/date-picker/month-picker.js +3 -3
- package/src/components/date-picker/time-picker.css +1 -1
- package/src/components/date-picker/time-picker.js +20 -8
- 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 +174 -70
- package/src/components/dropdown/dropdown.css +1 -1
- package/src/components/dropdown/dropdown.js +7 -5
- package/src/components/empty-state/empty-state.css +2 -2
- package/src/components/entity-ref/entity-ref.css +182 -0
- package/src/components/entity-ref/entity-ref.js +496 -0
- 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.css +88 -0
- package/src/components/file-item/file-item.js +505 -0
- package/src/components/file-list/file-list.css +51 -0
- package/src/components/file-list/file-list.js +320 -0
- package/src/components/filter/filter.css +27 -1
- package/src/components/filter/filter.js +205 -47
- package/src/components/filter-panel/filter-panel.css +104 -0
- package/src/components/filter-panel/filter-panel.js +964 -0
- 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 +247 -0
- package/src/components/kanban-view/kanban-view.css +226 -8
- package/src/components/kanban-view/kanban-view.js +255 -12
- package/src/components/launcher/launcher.css +107 -25
- package/src/components/launcher/launcher.js +557 -63
- package/src/components/list-toolbar/list-toolbar.css +194 -0
- package/src/components/list-toolbar/list-toolbar.js +851 -0
- package/src/components/master-panel/master-panel.css +2 -0
- package/src/components/menu-button/menu-button.css +87 -5
- package/src/components/menu-button/menu-button.js +86 -46
- package/src/components/message/message.css +38 -5
- package/src/components/message/message.js +230 -17
- package/src/components/modal/modal.css +15 -0
- package/src/components/modal/modal.js +159 -3
- package/src/components/navigation-bar/navigation-bar.css +95 -11
- package/src/components/navigation-bar/navigation-bar.js +171 -4
- 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/panel/panel.js +13 -2
- package/src/components/rating/rating.css +7 -0
- package/src/components/search/search.js +17 -5
- package/src/components/select/color.js +22 -0
- package/src/components/select/field-adapter.js +6 -1
- package/src/components/select/glyphs.js +165 -0
- package/src/components/select/select.css +138 -45
- package/src/components/select/select.js +86 -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 +20 -0
- package/src/components/sort-control/sort-control.js +140 -0
- package/src/components/stat-tile/stat-tile.css +208 -0
- package/src/components/stat-tile/stat-tile.js +601 -0
- package/src/components/tabbox/tabbox.css +32 -27
- package/src/components/tabbox/tabbox.js +17 -2
- package/src/components/table/table.css +155 -31
- package/src/components/table/table.js +386 -33
- package/src/components/table-view/table-view.css +8 -2
- package/src/components/table-view/table-view.js +21 -6
- package/src/components/tag-picker/tag-picker.css +86 -6
- package/src/components/tag-picker/tag-picker.js +25 -8
- package/src/components/timebox/timebox.css +22 -2
- package/src/components/timebox/timebox.js +18 -5
- 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/value-list/value-list.js +22 -6
- package/src/components/view/record-view.css +5 -0
- package/src/components/view/record-view.js +100 -7
- package/src/core/breakpoint.js +1 -1
- package/src/core/icons.js +259 -57
- package/src/core/motion.js +147 -0
- package/src/core/overlay-host.js +21 -2
- package/src/index.js +30 -3
- package/src/internal/app-rail.js +18 -1
- package/src/internal/menu-items.js +142 -0
- 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/print.css +192 -0
- 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 +11 -1
- package/styles/tokens/density.css +0 -9
|
@@ -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 = {
|
|
@@ -25,6 +26,29 @@ export type TableHierarchyOptions = {
|
|
|
25
26
|
*/
|
|
26
27
|
expanded?: boolean | unknown[];
|
|
27
28
|
};
|
|
29
|
+
export type TableRowKind = {
|
|
30
|
+
/**
|
|
31
|
+
* Draw the row as a single cell across every rendered column — a
|
|
32
|
+
* section heading rather than a record. The cell is a `<th scope="colgroup">`, not a `<td>`,
|
|
33
|
+
* because it labels the columns of the rows beneath it and a screen reader walking the table
|
|
34
|
+
* should meet it as a heading rather than as a value. A spanning row carries no selection
|
|
35
|
+
* checkbox, is never editable, and is skipped by `rowReorder`; it still emits `rowclick` and still
|
|
36
|
+
* participates in `getData()` and `updateRow()`.
|
|
37
|
+
*/
|
|
38
|
+
span?: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* Content
|
|
41
|
+
* of the spanning cell. Omitted, the cell falls back to the row's raw value for the first visible
|
|
42
|
+
* column, which is what a host otherwise writes by hand.
|
|
43
|
+
*/
|
|
44
|
+
render?: (row: TableRow, index: number) => Node | string | number | null | undefined;
|
|
45
|
+
/**
|
|
46
|
+
* Space-separated classes added to the row, on top of `rowClass`. Zx
|
|
47
|
+
* ships no section look: a billing section is not a kanban swimlane, so the tint, the weight and
|
|
48
|
+
* the rule above it are the host's to decide.
|
|
49
|
+
*/
|
|
50
|
+
class?: string;
|
|
51
|
+
};
|
|
28
52
|
export type TableEditorApi = {
|
|
29
53
|
/**
|
|
30
54
|
* Value the cell holds when the editor opens.
|
|
@@ -53,9 +77,16 @@ export type TableColumn = {
|
|
|
53
77
|
*/
|
|
54
78
|
id: string;
|
|
55
79
|
/**
|
|
56
|
-
* 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.
|
|
57
82
|
*/
|
|
58
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;
|
|
59
90
|
/**
|
|
60
91
|
* Whether the header changes the active sort.
|
|
61
92
|
*/
|
|
@@ -207,10 +238,31 @@ export type TableOptions = {
|
|
|
207
238
|
* Additional row class callback.
|
|
208
239
|
*/
|
|
209
240
|
rowClass?: ((row: TableRow) => string) | null;
|
|
241
|
+
/**
|
|
242
|
+
* Row property or callback
|
|
243
|
+
* naming each row's kind — the `type` on a ZeyOS transaction line, where one value is a position
|
|
244
|
+
* carrying quantities and amounts and another is a section heading that groups the positions under
|
|
245
|
+
* it. `null`, the default, renders every row exactly as before.
|
|
246
|
+
*/
|
|
247
|
+
rowKind?: string | ((row: TableRow) => unknown) | null;
|
|
248
|
+
/**
|
|
249
|
+
* Presentation per kind, keyed by the
|
|
250
|
+
* resolved kind coerced to a string. A kind with no entry here renders as an ordinary row. While
|
|
251
|
+
* any row in the current data resolves to a `span` kind the header sort controls are withheld and
|
|
252
|
+
* `setSort()` is inert: sorting a grouped table scatters the positions out of their sections, and
|
|
253
|
+
* doing that silently is worse than not offering it. `sortMode: 'server'` still owns its own order.
|
|
254
|
+
*/
|
|
255
|
+
rowKinds?: Record<string, TableRowKind> | null;
|
|
210
256
|
/**
|
|
211
257
|
* Whether alternate rows use the zebra background.
|
|
212
258
|
*/
|
|
213
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;
|
|
214
266
|
/**
|
|
215
267
|
* Inline editing mode. `'cell'` edits one cell, `'row'`
|
|
216
268
|
* opens every editable cell of the row together and commits them as a unit. Editing is completely
|
|
@@ -487,6 +539,10 @@ export declare class Table extends Component<TableOptions> {
|
|
|
487
539
|
_original: import("../../core/dom.js").TargetSnapshot;
|
|
488
540
|
_columns: any[] | TableColumn[];
|
|
489
541
|
_data: any[] | TableRow[];
|
|
542
|
+
_rowKind: string | ((row: TableRow) => unknown);
|
|
543
|
+
_rowKinds: Record<string, TableRowKind>;
|
|
544
|
+
_spanning: boolean;
|
|
545
|
+
_sortWarned: boolean;
|
|
490
546
|
_selected: Set<any>;
|
|
491
547
|
_selectionAnchorId: any;
|
|
492
548
|
_sort: any;
|
|
@@ -533,6 +589,7 @@ export declare class Table extends Component<TableOptions> {
|
|
|
533
589
|
_columnList: HTMLElement;
|
|
534
590
|
_selectAll: HTMLElement;
|
|
535
591
|
_headers: Map<any, any>;
|
|
592
|
+
_headerSpanning: boolean;
|
|
536
593
|
_hierarchyMeta: Map<unknown, TableHierarchyEntry>;
|
|
537
594
|
static cssName: string;
|
|
538
595
|
/** @type {TableOptions} */
|
|
@@ -678,6 +735,10 @@ export declare class Table extends Component<TableOptions> {
|
|
|
678
735
|
/**
|
|
679
736
|
* Activates a column sort. Local mode stably reorders data; server mode only updates the
|
|
680
737
|
* header state and emits the request event.
|
|
738
|
+
*
|
|
739
|
+
* Inert while the data holds a spanning row: a sort would scatter the positions out of the
|
|
740
|
+
* sections that group them, in either sort mode. The header withholds its controls for the same
|
|
741
|
+
* reason, so nothing on screen invites the call.
|
|
681
742
|
* @param {string} id Column id.
|
|
682
743
|
* @param {TableSortDirection} [dir] Direction; omitted toggles the current column.
|
|
683
744
|
* @param {{silent?: boolean}} [options={}] Event options.
|
|
@@ -896,6 +957,28 @@ export declare class Table extends Component<TableOptions> {
|
|
|
896
957
|
destroy(): void;
|
|
897
958
|
/** @returns {TableColumn[]} */
|
|
898
959
|
_visibleColumns(): TableColumn[];
|
|
960
|
+
/**
|
|
961
|
+
* Whether a row draws as one cell across the table instead of as a record.
|
|
962
|
+
* @param {TableRow} row Row to classify.
|
|
963
|
+
* @returns {boolean}
|
|
964
|
+
*/
|
|
965
|
+
_isSpanningRow(row: TableRow): boolean;
|
|
966
|
+
/**
|
|
967
|
+
* Whether any row in the current data — not only the rendered prefix — spans. This is what
|
|
968
|
+
* withholds the sort controls, and the reader must not be offered a control that the next
|
|
969
|
+
* `growBy()` would have to take away again.
|
|
970
|
+
* @returns {boolean}
|
|
971
|
+
*/
|
|
972
|
+
_hasSpanningRow(): boolean;
|
|
973
|
+
/**
|
|
974
|
+
* How many cells one row occupies: every visible column plus the structural columns the table
|
|
975
|
+
* renders beside them. Shared by the spanning cell and the empty-state cell so the two can never
|
|
976
|
+
* disagree about the table's width.
|
|
977
|
+
* @returns {number}
|
|
978
|
+
*/
|
|
979
|
+
_spanColspan(): number;
|
|
980
|
+
/** @returns {TableRow[]} Rendered rows that can carry a selection; spanning rows cannot. */
|
|
981
|
+
_selectableData(): TableRow[];
|
|
899
982
|
/** @returns {HTMLElement} */
|
|
900
983
|
_createColumnControls(): HTMLElement;
|
|
901
984
|
/**
|
|
@@ -1091,6 +1174,8 @@ export declare class Table extends Component<TableOptions> {
|
|
|
1091
1174
|
_emitRowToggle(id: unknown, expanded: boolean): void;
|
|
1092
1175
|
/** Keeps the reader's current expansion state limited to branches still present in the data. */
|
|
1093
1176
|
_reconcileExpanded(): void;
|
|
1177
|
+
/** @returns {Set<unknown>} Ids of every row in the data that may hold a selection. */
|
|
1178
|
+
_selectableIds(): Set<unknown>;
|
|
1094
1179
|
/** @returns {boolean} Whether selection changed. */
|
|
1095
1180
|
_pruneSelection(): boolean;
|
|
1096
1181
|
/** @param {TableRow} row @returns {unknown} */
|
|
@@ -1141,6 +1226,79 @@ export declare class Table extends Component<TableOptions> {
|
|
|
1141
1226
|
* @event Table#editinvalid
|
|
1142
1227
|
* @type {CustomEvent<TableEditInvalidDetail>}
|
|
1143
1228
|
*/
|
|
1229
|
+
/**
|
|
1230
|
+
* Resolves a row's kind through the `rowKind` accessor and coerces it to the string `rowKinds` is
|
|
1231
|
+
* keyed by.
|
|
1232
|
+
*
|
|
1233
|
+
* Only `null` and `undefined` mean "no kind". `0` and `''` are kinds like any other: a ZeyOS
|
|
1234
|
+
* transaction line uses `0` for a position and `1` for a section, so a falsy test here would render
|
|
1235
|
+
* every position as though the table had never been told about kinds at all.
|
|
1236
|
+
* @param {TableRow} row Row to classify.
|
|
1237
|
+
* @param {string|((row: TableRow) => unknown)|null|undefined} rowKind Field name or accessor.
|
|
1238
|
+
* @returns {string|null} The kind as a string, or null when there is none.
|
|
1239
|
+
*/
|
|
1240
|
+
export declare function resolveRowKind(row: TableRow, rowKind: string | ((row: TableRow) => unknown) | null | undefined): string | null;
|
|
1241
|
+
/**
|
|
1242
|
+
* Looks one resolved kind up in the `rowKinds` map.
|
|
1243
|
+
*
|
|
1244
|
+
* Own properties only: a kind read out of server data could just as easily be `toString` or
|
|
1245
|
+
* `constructor`, and inherited members of `Object.prototype` are not configuration.
|
|
1246
|
+
* @param {Record<string, TableRowKind>|null|undefined} rowKinds Kind map.
|
|
1247
|
+
* @param {string|null} kind Resolved kind.
|
|
1248
|
+
* @returns {TableRowKind|null} Matching entry, or null.
|
|
1249
|
+
*/
|
|
1250
|
+
export declare function resolveRowKindSpec(rowKinds: Record<string, TableRowKind> | null | undefined, kind: string | null): TableRowKind | null;
|
|
1251
|
+
/**
|
|
1252
|
+
* Whether a row draws as one spanning cell under the given configuration.
|
|
1253
|
+
* @param {TableRow} row Row to classify.
|
|
1254
|
+
* @param {string|((row: TableRow) => unknown)|null|undefined} rowKind Field name or accessor.
|
|
1255
|
+
* @param {Record<string, TableRowKind>|null|undefined} rowKinds Kind map.
|
|
1256
|
+
* @returns {boolean}
|
|
1257
|
+
*/
|
|
1258
|
+
export declare function isSpanningRow(row: TableRow, rowKind: string | ((row: TableRow) => unknown) | null | undefined, rowKinds: Record<string, TableRowKind> | null | undefined): boolean;
|
|
1259
|
+
/**
|
|
1260
|
+
* Whether a data set holds a row that spans — the question that decides whether `Table` offers its
|
|
1261
|
+
* sort controls at all.
|
|
1262
|
+
*
|
|
1263
|
+
* Asked of the whole data rather than of the rendered prefix: with `growing` on, a sort control
|
|
1264
|
+
* that disappeared the moment the reader pressed "show 20 more" would be worse than one that was
|
|
1265
|
+
* never there. Asked again on every data change, so a filter that removes the last section gives
|
|
1266
|
+
* the sort back.
|
|
1267
|
+
* @param {TableRow[]} rows Rows to scan.
|
|
1268
|
+
* @param {string|((row: TableRow) => unknown)|null|undefined} rowKind Field name or accessor.
|
|
1269
|
+
* @param {Record<string, TableRowKind>|null|undefined} rowKinds Kind map.
|
|
1270
|
+
* @returns {boolean}
|
|
1271
|
+
*/
|
|
1272
|
+
export declare function hasSpanningRow(rows: TableRow[], rowKind: string | ((row: TableRow) => unknown) | null | undefined, rowKinds: Record<string, TableRowKind> | null | undefined): boolean;
|
|
1273
|
+
/**
|
|
1274
|
+
* How many cells one table row occupies.
|
|
1275
|
+
*
|
|
1276
|
+
* `selectable: 'multi'` and `rowReorder` each render a `<col>` and a leading cell of their own, and
|
|
1277
|
+
* a spanning cell that ignored them would leave the row one or two columns short — the table would
|
|
1278
|
+
* still lay out, silently and wrongly. `selectable: 'single'` adds no column: the whole row is the
|
|
1279
|
+
* control there.
|
|
1280
|
+
* @param {number} columnCount Number of visible data columns.
|
|
1281
|
+
* @param {{selectable?: TableSelectionMode, rowReorder?: boolean}} [structure={}] Structural columns.
|
|
1282
|
+
* @returns {number} Colspan covering every rendered cell, never below 1.
|
|
1283
|
+
*/
|
|
1284
|
+
export declare function tableSpanColspan(columnCount: number, structure?: {
|
|
1285
|
+
selectable?: TableSelectionMode;
|
|
1286
|
+
rowReorder?: boolean;
|
|
1287
|
+
}): number;
|
|
1288
|
+
/**
|
|
1289
|
+
* Content for a spanning row's single cell.
|
|
1290
|
+
*
|
|
1291
|
+
* Without a `render` the cell shows the row's raw value for the first visible column — the same
|
|
1292
|
+
* thing a host writes by hand today. Deliberately raw rather than routed through the column's own
|
|
1293
|
+
* renderer or display type: that renderer was written for a record, and running it against a
|
|
1294
|
+
* heading that carries no quantities or amounts is how a section row ends up showing `0,00 €`.
|
|
1295
|
+
* @param {TableRow} row Row being rendered.
|
|
1296
|
+
* @param {TableRowKind|null|undefined} spec Resolved kind presentation.
|
|
1297
|
+
* @param {TableColumn[]} visibleColumns Columns currently rendered, in display order.
|
|
1298
|
+
* @param {number} [index=0] Flat row index.
|
|
1299
|
+
* @returns {Node|string|number|null|undefined} Cell content.
|
|
1300
|
+
*/
|
|
1301
|
+
export declare function spanRowContent(row: TableRow, spec: TableRowKind | null | undefined, visibleColumns: TableColumn[], index?: number): Node | string | number | null | undefined;
|
|
1144
1302
|
/**
|
|
1145
1303
|
* Applies a column's built-in display type. A custom renderer always wins and may still return a
|
|
1146
1304
|
* Node; all built-in results are strings so `_renderCellContent` can insert them as text.
|
|
@@ -1248,12 +1406,43 @@ export declare function firstValidationError(values: Record<string, unknown>, co
|
|
|
1248
1406
|
columnId: string;
|
|
1249
1407
|
message: string;
|
|
1250
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;
|
|
1251
1415
|
/**
|
|
1252
1416
|
* Validates and shallow-clones table columns so stable-id APIs never mutate caller descriptors.
|
|
1253
1417
|
* @param {unknown} columns Column descriptors.
|
|
1254
1418
|
* @returns {TableColumn[]} Normalized descriptors.
|
|
1255
1419
|
*/
|
|
1256
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;
|
|
1257
1446
|
/**
|
|
1258
1447
|
* Reconciles saved or partial column IDs with every current column.
|
|
1259
1448
|
* @param {TableColumn[]} columns Current columns.
|
|
@@ -43,9 +43,11 @@ export type TableViewOptions = {
|
|
|
43
43
|
*/
|
|
44
44
|
hiddenFields?: string[];
|
|
45
45
|
/**
|
|
46
|
-
* Show the accessible visibility and reorder disclosure.
|
|
46
|
+
* Show the accessible visibility and reorder disclosure. `true` keeps the composed Table's own
|
|
47
|
+
* column chooser and `false` omits it; an object renders the shared record-view chooser instead,
|
|
48
|
+
* with a translated `label` and, with `target`, mounted into a host element.
|
|
47
49
|
*/
|
|
48
|
-
fieldControls?: boolean;
|
|
50
|
+
fieldControls?: boolean | import('../view/record-view.js').ViewFieldControlsConfig;
|
|
49
51
|
/**
|
|
50
52
|
* Empty-result content.
|
|
51
53
|
*/
|
|
@@ -93,7 +95,10 @@ export type TableViewOptions = {
|
|
|
93
95
|
* @property {unknown[]} [selection=[]] Initially selected record ids.
|
|
94
96
|
* @property {string[]} [fieldOrder=[]] Preferred stable field order.
|
|
95
97
|
* @property {string[]} [hiddenFields=[]] Initially hidden field ids.
|
|
96
|
-
* @property {boolean} [fieldControls=true]
|
|
98
|
+
* @property {boolean|import('../view/record-view.js').ViewFieldControlsConfig} [fieldControls=true]
|
|
99
|
+
* Show the accessible visibility and reorder disclosure. `true` keeps the composed Table's own
|
|
100
|
+
* column chooser and `false` omits it; an object renders the shared record-view chooser instead,
|
|
101
|
+
* with a translated `label` and, with `target`, mounted into a host element.
|
|
97
102
|
* @property {string|Node|(()=>string|Node)|null} [emptyText=null] Empty-result content.
|
|
98
103
|
* @property {TableOptions} [table={}] Advanced low-level Table options. Shared options win where
|
|
99
104
|
* their contracts overlap; all other options and callbacks are forwarded unchanged.
|
|
@@ -126,6 +131,7 @@ export declare class TableView extends RecordView {
|
|
|
126
131
|
_tableSyncDepth: number;
|
|
127
132
|
_tableViewDestroyed: boolean;
|
|
128
133
|
_tableHost: HTMLElement;
|
|
134
|
+
_tableViewToolbar: HTMLElement;
|
|
129
135
|
table: Table;
|
|
130
136
|
static cssName: string;
|
|
131
137
|
/** @type {Readonly<TableViewOptions>} */
|
|
@@ -176,7 +182,7 @@ export declare function fieldsToTableColumns(fields: ViewField[]): TableColumn[]
|
|
|
176
182
|
* Builds the composed Table configuration. Shared options deliberately overwrite overlapping
|
|
177
183
|
* low-level options; every advanced option remains untouched.
|
|
178
184
|
* @param {TableOptions|undefined} table Advanced Table options.
|
|
179
|
-
* @param {{fields:ViewField[],data:TableViewRecord[],recordId:string|((record:TableViewRecord)=>unknown),sort:ViewSort|null,sortMode:'local'|'server',selectable:false|'single'|'multi',hiddenFields:string[],fieldControls:boolean,emptyText:string|Node|(()=>string|Node)|null}} shared Shared state.
|
|
185
|
+
* @param {{fields:ViewField[],data:TableViewRecord[],recordId:string|((record:TableViewRecord)=>unknown),sort:ViewSort|null,sortMode:'local'|'server',selectable:false|'single'|'multi',hiddenFields:string[],fieldControls:boolean|import('../view/record-view.js').ViewFieldControlsConfig,emptyText:string|Node|(()=>string|Node)|null}} shared Shared state.
|
|
180
186
|
* @returns {TableOptions} Table configuration.
|
|
181
187
|
*/
|
|
182
188
|
export declare function tableOptionsForView(table: TableOptions | undefined, shared: {
|
|
@@ -187,6 +193,6 @@ export declare function tableOptionsForView(table: TableOptions | undefined, sha
|
|
|
187
193
|
sortMode: 'local' | 'server';
|
|
188
194
|
selectable: false | 'single' | 'multi';
|
|
189
195
|
hiddenFields: string[];
|
|
190
|
-
fieldControls: boolean;
|
|
196
|
+
fieldControls: boolean | import('../view/record-view.js').ViewFieldControlsConfig;
|
|
191
197
|
emptyText: string | Node | (() => string | Node) | null;
|
|
192
198
|
}): TableOptions;
|
|
@@ -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} */
|
|
@@ -118,4 +118,11 @@ export declare class Timebox extends Component<TimeboxOptions> {
|
|
|
118
118
|
_syncDisabled(): void;
|
|
119
119
|
/** @returns {void} */
|
|
120
120
|
_emitChange(): void;
|
|
121
|
+
/**
|
|
122
|
+
* Resolves a message through the host translator, falling back to the built-in English text.
|
|
123
|
+
* @param {string} key Message key.
|
|
124
|
+
* @param {string} fallback English default.
|
|
125
|
+
* @returns {string}
|
|
126
|
+
*/
|
|
127
|
+
_message(key: string, fallback: string): string;
|
|
121
128
|
}
|
|
@@ -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;
|
|
@@ -144,6 +144,14 @@ export declare class ValueList extends Component<ValueListOptions> {
|
|
|
144
144
|
_removeAt(index: number, focusIndex?: number): void;
|
|
145
145
|
/** @param {string} message @returns {void} */
|
|
146
146
|
_showError(message: string): void;
|
|
147
|
+
/**
|
|
148
|
+
* Resolves a message through the host translator, falling back to the built-in English text.
|
|
149
|
+
* @param {string} key Message key.
|
|
150
|
+
* @param {string} fallback Built-in text, with `%1`-style placeholders.
|
|
151
|
+
* @param {...unknown} args Interpolation values.
|
|
152
|
+
* @returns {string}
|
|
153
|
+
*/
|
|
154
|
+
_message(key: string, fallback: string, ...args: unknown[]): string;
|
|
147
155
|
/** @returns {void} */
|
|
148
156
|
destroy(): void;
|
|
149
157
|
}
|
|
@@ -62,6 +62,35 @@ export type ViewSort = {
|
|
|
62
62
|
*/
|
|
63
63
|
dir: ViewSortDirection;
|
|
64
64
|
};
|
|
65
|
+
export type ViewFieldControlsConfig = {
|
|
66
|
+
/**
|
|
67
|
+
* Trigger label. Omitted resolves `recordView.fields`, English `Fields`.
|
|
68
|
+
*/
|
|
69
|
+
label?: string;
|
|
70
|
+
/**
|
|
71
|
+
* Element or selector the disclosure is mounted into
|
|
72
|
+
* instead of the view's own toolbar. An unresolvable target falls back to the view.
|
|
73
|
+
*/
|
|
74
|
+
target?: Element | string | null;
|
|
75
|
+
};
|
|
76
|
+
export type ViewFieldControlsSettings = {
|
|
77
|
+
/**
|
|
78
|
+
* Whether a concrete view renders the chooser at all.
|
|
79
|
+
*/
|
|
80
|
+
enabled: boolean;
|
|
81
|
+
/**
|
|
82
|
+
* Whether the option was given as a `ViewFieldControlsConfig` object.
|
|
83
|
+
*/
|
|
84
|
+
custom: boolean;
|
|
85
|
+
/**
|
|
86
|
+
* Configured trigger label, or null to resolve the message.
|
|
87
|
+
*/
|
|
88
|
+
label: string | null;
|
|
89
|
+
/**
|
|
90
|
+
* Configured mount point, before resolution.
|
|
91
|
+
*/
|
|
92
|
+
target: Element | string | null;
|
|
93
|
+
};
|
|
65
94
|
export type RecordViewState = {
|
|
66
95
|
/**
|
|
67
96
|
* State schema version.
|
|
@@ -118,9 +147,12 @@ export type RecordViewOptions = {
|
|
|
118
147
|
*/
|
|
119
148
|
hiddenFields?: string[];
|
|
120
149
|
/**
|
|
121
|
-
* Whether concrete views show the
|
|
150
|
+
* Whether concrete views show the
|
|
151
|
+
* shared field chooser. `true` renders it in the view's own toolbar and `false` omits it; a
|
|
152
|
+
* `ViewFieldControlsConfig` object renders the same control with a translated `label` and, with
|
|
153
|
+
* `target`, mounts it into a host element such as a list toolbar.
|
|
122
154
|
*/
|
|
123
|
-
fieldControls?: boolean;
|
|
155
|
+
fieldControls?: boolean | ViewFieldControlsConfig;
|
|
124
156
|
/**
|
|
125
157
|
* Empty-result content.
|
|
126
158
|
*/
|
|
@@ -174,6 +206,21 @@ export type RecordViewOptions = {
|
|
|
174
206
|
* @property {string} id Field id.
|
|
175
207
|
* @property {ViewSortDirection} dir Sort direction.
|
|
176
208
|
*/
|
|
209
|
+
/**
|
|
210
|
+
* Trigger customisation for the shared field chooser. Passing this object in place of `true` keeps
|
|
211
|
+
* the control and its state model exactly as they are; only its wording and mount point change.
|
|
212
|
+
* @typedef {Object} ViewFieldControlsConfig
|
|
213
|
+
* @property {string} [label] Trigger label. Omitted resolves `recordView.fields`, English `Fields`.
|
|
214
|
+
* @property {Element|string|null} [target=null] Element or selector the disclosure is mounted into
|
|
215
|
+
* instead of the view's own toolbar. An unresolvable target falls back to the view.
|
|
216
|
+
*/
|
|
217
|
+
/**
|
|
218
|
+
* @typedef {Object} ViewFieldControlsSettings
|
|
219
|
+
* @property {boolean} enabled Whether a concrete view renders the chooser at all.
|
|
220
|
+
* @property {boolean} custom Whether the option was given as a `ViewFieldControlsConfig` object.
|
|
221
|
+
* @property {string|null} label Configured trigger label, or null to resolve the message.
|
|
222
|
+
* @property {Element|string|null} target Configured mount point, before resolution.
|
|
223
|
+
*/
|
|
177
224
|
/**
|
|
178
225
|
* @typedef {Object} RecordViewState
|
|
179
226
|
* @property {1} version State schema version.
|
|
@@ -192,7 +239,10 @@ export type RecordViewOptions = {
|
|
|
192
239
|
* @property {unknown[]} [selection=[]] Initially selected record ids.
|
|
193
240
|
* @property {string[]} [fieldOrder=[]] Field ids in preferred order.
|
|
194
241
|
* @property {string[]} [hiddenFields=[]] Initially hidden field ids.
|
|
195
|
-
* @property {boolean} [fieldControls=true] Whether concrete views show the
|
|
242
|
+
* @property {boolean|ViewFieldControlsConfig} [fieldControls=true] Whether concrete views show the
|
|
243
|
+
* shared field chooser. `true` renders it in the view's own toolbar and `false` omits it; a
|
|
244
|
+
* `ViewFieldControlsConfig` object renders the same control with a translated `label` and, with
|
|
245
|
+
* `target`, mounts it into a host element such as a list toolbar.
|
|
196
246
|
* @property {string|Node|(() => string|Node)|null} [emptyText=null] Empty-result content.
|
|
197
247
|
* @property {(event: CustomEvent<Record<string, unknown>>) => void} [onrecordclick]
|
|
198
248
|
* @property {(event: CustomEvent<Record<string, unknown>>) => void} [onrecorddblclick]
|
|
@@ -226,6 +276,8 @@ export declare class RecordView extends Component<RecordViewOptions> {
|
|
|
226
276
|
_viewSelectionAnchor: unknown;
|
|
227
277
|
_viewFieldControls: HTMLElement;
|
|
228
278
|
_viewFieldList: HTMLElement;
|
|
279
|
+
_viewFieldSettings: ViewFieldControlsSettings;
|
|
280
|
+
_viewFieldControlsTarget: Element;
|
|
229
281
|
_viewInitialized: boolean;
|
|
230
282
|
static cssName: string;
|
|
231
283
|
/** @type {Readonly<RecordViewOptions>} */
|
|
@@ -384,10 +436,42 @@ export declare class RecordView extends Component<RecordViewOptions> {
|
|
|
384
436
|
/**
|
|
385
437
|
* Builds the shared show/hide and ordering disclosure for a concrete view toolbar.
|
|
386
438
|
* @protected
|
|
387
|
-
* @param {string} [label=
|
|
439
|
+
* @param {string|null} [label=null] Explicit trigger label. Omitted resolves the configured
|
|
440
|
+
* `fieldControls.label` and then the `recordView.fields` message.
|
|
388
441
|
* @returns {HTMLElement} Disclosure element.
|
|
389
442
|
*/
|
|
390
|
-
protected _createViewFieldControls(label?: string): HTMLElement;
|
|
443
|
+
protected _createViewFieldControls(label?: string | null): HTMLElement;
|
|
444
|
+
/**
|
|
445
|
+
* Builds the shared field disclosure and mounts it where `fieldControls` asks for it: the host
|
|
446
|
+
* element named by `target`, or the view's own toolbar when no target resolves.
|
|
447
|
+
* @protected
|
|
448
|
+
* @param {Element} toolbar The view's own toolbar.
|
|
449
|
+
* @param {string|null} [label=null] Explicit trigger label, for views that own their wording.
|
|
450
|
+
* @returns {HTMLElement} The mounted disclosure.
|
|
451
|
+
*/
|
|
452
|
+
protected _mountViewFieldControls(toolbar: Element, label?: string | null): HTMLElement;
|
|
453
|
+
/**
|
|
454
|
+
* Removes the shared field disclosure from wherever it was mounted. An external `target` keeps
|
|
455
|
+
* every node it had before the view was created.
|
|
456
|
+
* @protected
|
|
457
|
+
* @returns {void}
|
|
458
|
+
*/
|
|
459
|
+
protected _removeViewFieldControls(): void;
|
|
460
|
+
/**
|
|
461
|
+
* Resolves the field-chooser trigger label: the configured one, else the translated message.
|
|
462
|
+
* @protected
|
|
463
|
+
* @returns {string} Trigger label.
|
|
464
|
+
*/
|
|
465
|
+
protected _viewFieldControlsLabel(): string;
|
|
466
|
+
/**
|
|
467
|
+
* Resolves a message through the host translator, falling back to the built-in English text.
|
|
468
|
+
* @protected
|
|
469
|
+
* @param {string} key Message key.
|
|
470
|
+
* @param {string} fallback Built-in text, with `%1`-style placeholders.
|
|
471
|
+
* @param {...unknown} args Interpolation values.
|
|
472
|
+
* @returns {string} Translated or built-in text.
|
|
473
|
+
*/
|
|
474
|
+
protected _message(key: string, fallback: string, ...args: unknown[]): string;
|
|
391
475
|
/** Concrete renderers override this hook. @protected @param {string} _reason Refresh reason. @returns {void} */
|
|
392
476
|
protected _refreshView(_reason: string): void;
|
|
393
477
|
/** Reads one record's stable id. @protected @param {ViewRecord} record Record. @returns {unknown} */
|
|
@@ -407,6 +491,13 @@ export declare class RecordView extends Component<RecordViewOptions> {
|
|
|
407
491
|
/** @private @param {string|null} [focusId=null] @returns {void} */
|
|
408
492
|
private _renderViewFieldControls;
|
|
409
493
|
}
|
|
494
|
+
/**
|
|
495
|
+
* Reads the `fieldControls` option in its three shapes. `true` and `false` keep their exact
|
|
496
|
+
* meaning; an object additionally carries the trigger label and the host element to mount into.
|
|
497
|
+
* @param {boolean|ViewFieldControlsConfig|null|undefined} value Raw option value.
|
|
498
|
+
* @returns {ViewFieldControlsSettings} Normalized settings.
|
|
499
|
+
*/
|
|
500
|
+
export declare function normalizeViewFieldControls(value: boolean | ViewFieldControlsConfig | null | undefined): ViewFieldControlsSettings;
|
|
410
501
|
/**
|
|
411
502
|
* Validates and clones field descriptors.
|
|
412
503
|
* @param {ViewField[]} fields Fields.
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* used inside a media query, so a `--zx-bp-*` token would be a value no stylesheet could read.
|
|
6
6
|
* Zx's own layout utilities avoid the problem entirely — `.zx-grid` reflows on intrinsic track
|
|
7
7
|
* widths, not on breakpoints — which leaves this module for the cases only script can decide:
|
|
8
|
-
* rendering a Table as cards below a width, collapsing a MasterPanel, choosing a chart
|
|
8
|
+
* rendering a Table as cards below a width, collapsing a MasterPanel, choosing how many labels a chart shows.
|
|
9
9
|
* @module zx/core/breakpoint
|
|
10
10
|
*/
|
|
11
11
|
export type BreakpointName = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|