@zeyos/zx 5.7.0 → 5.8.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 +330 -0
- package/README.md +47 -9
- package/dist/types/components/activity-item/activity-item.d.ts +14 -3
- package/dist/types/components/agent-avatar/agent-avatar.d.ts +165 -0
- package/dist/types/components/agent-avatar/agent-face.d.ts +93 -0
- package/dist/types/components/agent-thread/ag-ui.d.ts +21 -9
- package/dist/types/components/agent-thread/agent-thread.d.ts +26 -0
- package/dist/types/components/agent-thread/ui-message-stream.d.ts +3 -1
- package/dist/types/components/approval-card/approval-card.d.ts +31 -2
- package/dist/types/components/aurora/aurora.d.ts +31 -5
- package/dist/types/components/calendar/calendar.d.ts +39 -26
- package/dist/types/components/chart/chart.d.ts +250 -20
- package/dist/types/components/chart/color.d.ts +66 -0
- package/dist/types/components/chart/svg-adapter.d.ts +103 -0
- package/dist/types/components/chart/svg-geometry.d.ts +203 -0
- package/dist/types/components/check-button/check-button.d.ts +1 -4
- package/dist/types/components/checklist/checklist.d.ts +48 -5
- package/dist/types/components/code-editor/code-editor.d.ts +55 -1
- package/dist/types/components/composer/composer.d.ts +41 -6
- package/dist/types/components/context-menu/context-menu.d.ts +36 -8
- package/dist/types/components/copy/copy-button.d.ts +6 -0
- package/dist/types/components/copy/copy-input.d.ts +1 -0
- package/dist/types/components/date-picker/date-picker.d.ts +14 -0
- package/dist/types/components/date-picker/time-picker.d.ts +26 -17
- package/dist/types/components/datebox/datebox.d.ts +8 -4
- package/dist/types/components/dialog/dialog.d.ts +15 -4
- package/dist/types/components/empty-state/empty-state.d.ts +10 -1
- package/dist/types/components/field/field.d.ts +4 -2
- package/dist/types/components/form/form.d.ts +2 -1
- package/dist/types/components/kanban-view/kanban-card.d.ts +7 -0
- package/dist/types/components/kanban-view/kanban-view.d.ts +15 -3
- package/dist/types/components/launcher/launcher.d.ts +26 -0
- package/dist/types/components/master-panel/master-panel.d.ts +9 -4
- package/dist/types/components/menu-button/menu-button.d.ts +29 -5
- package/dist/types/components/message/message.d.ts +308 -5
- package/dist/types/components/modal/modal.d.ts +45 -8
- package/dist/types/components/modal/native-dialog.d.ts +40 -0
- package/dist/types/components/module-bar/module-bar.d.ts +9 -2
- package/dist/types/components/multi-value-editor/multi-value-editor.d.ts +5 -4
- package/dist/types/components/number-field/number-field.d.ts +31 -1
- package/dist/types/components/pagination/pagination.d.ts +341 -19
- package/dist/types/components/run-status/run-status.d.ts +26 -0
- package/dist/types/components/run-trace/run-trace.d.ts +10 -6
- package/dist/types/components/search/search.d.ts +16 -4
- package/dist/types/components/select/select.d.ts +19 -1
- package/dist/types/components/sheet/sheet.d.ts +20 -6
- package/dist/types/components/slider/slider.d.ts +2 -1
- package/dist/types/components/stat-tile/stat-tile.d.ts +20 -3
- package/dist/types/components/stepper/stepper.d.ts +17 -4
- package/dist/types/components/surface/catalog.d.ts +61 -17
- package/dist/types/components/surface/surface.d.ts +6 -4
- package/dist/types/components/table/table.d.ts +207 -5
- package/dist/types/components/table/window.d.ts +25 -1
- package/dist/types/components/toggle/toggle.d.ts +38 -6
- package/dist/types/components/tooltip/tooltip.d.ts +5 -4
- package/dist/types/components/tree/tree.d.ts +43 -6
- package/dist/types/components/truncate/truncate.d.ts +4 -2
- package/dist/types/components/value-list/value-list.d.ts +9 -2
- package/dist/types/core/date.d.ts +2 -1
- package/dist/types/core/dom.d.ts +14 -0
- package/dist/types/core/drag-axis.d.ts +10 -5
- package/dist/types/core/export.d.ts +2 -2
- package/dist/types/core/format.d.ts +3 -1
- package/dist/types/core/icons.d.ts +36 -3
- package/dist/types/core/keyboard.d.ts +7 -3
- package/dist/types/core/messages.d.ts +3 -0
- package/dist/types/core/storage.d.ts +4 -3
- package/dist/types/core/util.d.ts +3 -1
- package/dist/types/elements/define.d.ts +5 -2
- package/dist/types/index.d.ts +6 -4
- package/dist/types/internal/agent-model.d.ts +99 -0
- package/dist/types/internal/app-rail.d.ts +37 -2
- package/dist/types/internal/collections.d.ts +18 -0
- package/dist/types/internal/menu-items.d.ts +27 -0
- package/dist/types/internal/overlay-content.d.ts +23 -0
- package/dist/types/internal/presence-loop.d.ts +5 -2
- package/dist/types/locales/index.d.ts +3 -0
- package/dist/types/zeyos/calendar.d.ts +43 -7
- package/dist/types/zeyos/connect.d.ts +4 -0
- package/dist/types/zeyos/form.d.ts +13 -5
- package/dist/types/zeyos/select.d.ts +5 -2
- package/dist/types/zeyos/table.d.ts +16 -8
- package/dist/types/zeyos/view.d.ts +2 -1
- package/dist/zx-zeyos.esm.js +3161 -515
- package/dist/zx-zeyos.esm.min.js +4 -4
- package/dist/zx.core.css +4 -0
- package/dist/zx.core.min.css +1 -1
- package/dist/zx.css +970 -57
- package/dist/zx.esm.js +6405 -2249
- package/dist/zx.esm.min.js +26 -26
- package/dist/zx.global.js +6405 -2249
- package/dist/zx.global.min.js +26 -26
- package/dist/zx.layered.css +972 -57
- package/dist/zx.layered.min.css +1 -1
- package/dist/zx.min.css +1 -1
- package/docs/agent-catalog.json +159 -1
- package/docs/agent-surfaces.md +21 -21
- package/docs/api.json +3154 -518
- package/docs/components/account-menu.md +24 -0
- package/docs/components/activity-item.md +23 -0
- package/docs/components/activity-list.md +28 -0
- package/docs/components/agent-avatar.md +59 -0
- package/docs/components/agent-thread.md +275 -0
- package/docs/components/app-icon.md +36 -0
- package/docs/components/app-sidebar.md +92 -0
- package/docs/components/approval-card.md +71 -0
- package/docs/components/aurora.md +34 -0
- package/docs/components/avatar.md +37 -0
- package/docs/components/badge.md +36 -0
- package/docs/components/block-view.md +34 -0
- package/docs/components/breadcrumb.md +20 -0
- package/docs/components/button.md +23 -0
- package/docs/components/calendar.md +68 -0
- package/docs/components/card-view.md +73 -0
- package/docs/components/card.md +25 -0
- package/docs/components/chart.md +109 -0
- package/docs/components/check-button.md +16 -0
- package/docs/components/checklist.md +19 -0
- package/docs/components/code-editor.md +38 -0
- package/docs/components/composer.md +107 -0
- package/docs/components/context-menu.md +32 -0
- package/docs/components/copy.md +37 -0
- package/docs/components/data-filter.md +16 -0
- package/docs/components/date-picker.md +31 -0
- package/docs/components/date-range.md +21 -0
- package/docs/components/datebox.md +31 -0
- package/docs/components/dialog.md +25 -0
- package/docs/components/dock.md +57 -0
- package/docs/components/dropdown.md +39 -0
- package/docs/components/elements.md +63 -0
- package/docs/components/empty-state.md +17 -0
- package/docs/components/entity-ref.md +26 -0
- package/docs/components/field-upload.md +18 -0
- package/docs/components/file-item.md +27 -0
- package/docs/components/file-list.md +23 -0
- package/docs/components/filter-panel.md +45 -0
- package/docs/components/filter.md +47 -0
- package/docs/components/finder.md +25 -0
- package/docs/components/form-widgets.md +42 -0
- package/docs/components/form.md +80 -0
- package/docs/components/grid.md +26 -0
- package/docs/components/groupbox.md +11 -0
- package/docs/components/helpers.md +359 -0
- package/docs/components/icons.md +87 -0
- package/docs/components/index.md +99 -0
- package/docs/components/kanban-view.md +42 -0
- package/docs/components/kbd.md +23 -0
- package/docs/components/kernel.md +41 -0
- package/docs/components/launcher.md +66 -0
- package/docs/components/layout.md +33 -0
- package/docs/components/list-toolbar.md +38 -0
- package/docs/components/loading.md +48 -0
- package/docs/components/menu-button.md +47 -0
- package/docs/components/message.md +76 -0
- package/docs/components/modal.md +27 -0
- package/docs/components/module-bar.md +71 -0
- package/docs/components/multi-value-editor.md +16 -0
- package/docs/components/navigation-bar.md +22 -0
- package/docs/components/number-field.md +34 -0
- package/docs/components/pagination.md +73 -0
- package/docs/components/panel.md +28 -0
- package/docs/components/prompt-starters.md +40 -0
- package/docs/components/prose.md +38 -0
- package/docs/components/questionnaire.md +115 -0
- package/docs/components/rating.md +19 -0
- package/docs/components/run-status.md +50 -0
- package/docs/components/run-trace.md +72 -0
- package/docs/components/search.md +11 -0
- package/docs/components/select.md +129 -0
- package/docs/components/sheet-stack.md +39 -0
- package/docs/components/sheet.md +77 -0
- package/docs/components/skeleton.md +27 -0
- package/docs/components/slider.md +29 -0
- package/docs/components/sort-control.md +21 -0
- package/docs/components/source-list.md +30 -0
- package/docs/components/split-view.md +12 -0
- package/docs/components/stat-tile.md +49 -0
- package/docs/components/stepper.md +27 -0
- package/docs/components/surface.md +152 -0
- package/docs/components/tabbox.md +33 -0
- package/docs/components/table-view.md +43 -0
- package/docs/components/table.md +232 -0
- package/docs/components/tag-picker.md +39 -0
- package/docs/components/timebox.md +16 -0
- package/docs/components/toggle.md +21 -0
- package/docs/components/tokens.md +82 -0
- package/docs/components/toolbar.md +26 -0
- package/docs/components/tooltip.md +16 -0
- package/docs/components/tree.md +48 -0
- package/docs/components/truncate.md +21 -0
- package/docs/components/value-list.md +14 -0
- package/docs/components/view-settings.md +56 -0
- package/docs/components/workspace-switcher.md +42 -0
- package/docs/components/zeyos.md +196 -0
- package/docs/llms-small.txt +299 -0
- package/docs/llms.md +725 -109
- package/docs/llms.txt +46 -19
- package/package.json +9 -4
- package/src/components/activity-item/activity-item.js +21 -2
- package/src/components/agent-avatar/agent-avatar.css +195 -0
- package/src/components/agent-avatar/agent-avatar.js +333 -0
- package/src/components/agent-avatar/agent-face.js +292 -0
- package/src/components/agent-thread/ag-ui.js +44 -11
- package/src/components/agent-thread/agent-thread.js +103 -11
- package/src/components/agent-thread/ui-message-stream.js +3 -1
- package/src/components/app-rail/app-rail.css +5 -0
- package/src/components/app-sidebar/app-sidebar.css +3 -0
- package/src/components/app-sidebar/app-sidebar.js +4 -3
- package/src/components/approval-card/approval-card.css +6 -0
- package/src/components/approval-card/approval-card.js +55 -7
- package/src/components/aurora/aurora.css +149 -14
- package/src/components/aurora/aurora.js +49 -6
- package/src/components/button/button.css +24 -11
- package/src/components/calendar/calendar.css +6 -2
- package/src/components/calendar/calendar.js +127 -47
- package/src/components/card-view/card-view.js +5 -6
- package/src/components/chart/chart.css +159 -1
- package/src/components/chart/chart.js +450 -62
- package/src/components/chart/color.js +297 -0
- package/src/components/chart/svg-adapter.js +576 -0
- package/src/components/chart/svg-geometry.js +323 -0
- package/src/components/check-button/check-button.js +3 -18
- package/src/components/checklist/checklist.css +9 -1
- package/src/components/checklist/checklist.js +105 -20
- package/src/components/checklist/field-adapter.js +6 -12
- package/src/components/code-editor/code-editor.css +33 -0
- package/src/components/code-editor/code-editor.js +97 -8
- package/src/components/code-editor/field-adapter.js +3 -0
- package/src/components/composer/composer.css +3 -0
- package/src/components/composer/composer.js +100 -22
- package/src/components/context-menu/context-menu.js +41 -5
- package/src/components/copy/copy-button.js +9 -1
- package/src/components/copy/copy-input.js +5 -0
- package/src/components/data-filter/filter-core.js +0 -1
- package/src/components/date-picker/date-picker.css +8 -0
- package/src/components/date-picker/date-picker.js +47 -8
- package/src/components/date-picker/date-range-picker.js +1 -1
- package/src/components/date-picker/month-picker.js +19 -3
- package/src/components/date-picker/time-picker.js +54 -19
- package/src/components/datebox/date-range-box.js +7 -3
- package/src/components/datebox/datebox.js +32 -6
- package/src/components/dialog/dialog.css +6 -0
- package/src/components/dialog/dialog.js +24 -33
- package/src/components/dropdown/dropdown.js +1 -18
- package/src/components/empty-state/empty-state.js +21 -2
- package/src/components/field/field.js +19 -3
- package/src/components/fieldset/fieldset.js +3 -1
- package/src/components/filter/filter.js +9 -0
- package/src/components/form/form.js +19 -2
- package/src/components/kanban-view/kanban-card.js +15 -2
- package/src/components/kanban-view/kanban-view.css +21 -0
- package/src/components/kanban-view/kanban-view.js +29 -16
- package/src/components/launcher/launcher.css +14 -0
- package/src/components/launcher/launcher.js +54 -9
- package/src/components/master-panel/master-panel.js +24 -22
- package/src/components/menu-button/menu-button.js +26 -4
- package/src/components/message/message.css +228 -29
- package/src/components/message/message.js +664 -30
- package/src/components/modal/modal.js +129 -30
- package/src/components/modal/native-dialog.js +91 -0
- package/src/components/module-bar/module-bar.css +3 -0
- package/src/components/module-bar/module-bar.js +17 -4
- package/src/components/multi-value-editor/multi-value-editor.css +7 -2
- package/src/components/multi-value-editor/multi-value-editor.js +3 -2
- package/src/components/navigation-bar/navigation-bar.js +13 -1
- package/src/components/number-field/field-adapter.js +3 -0
- package/src/components/number-field/number-field.js +70 -16
- package/src/components/pagination/pagination.css +26 -2
- package/src/components/pagination/pagination.js +551 -65
- package/src/components/prose/prose.js +7 -1
- package/src/components/rating/field-adapter.js +3 -0
- package/src/components/run-status/run-status.js +43 -3
- package/src/components/run-trace/run-trace.js +15 -7
- package/src/components/search/search.js +3 -18
- package/src/components/select/field-adapter.js +8 -1
- package/src/components/select/select.js +68 -13
- package/src/components/sheet/sheet.js +39 -13
- package/src/components/slider/field-adapter.js +3 -0
- package/src/components/slider/slider.js +4 -6
- package/src/components/stat-tile/stat-tile.js +24 -9
- package/src/components/stepper/stepper.css +15 -0
- package/src/components/stepper/stepper.js +34 -2
- package/src/components/surface/catalog.js +185 -28
- package/src/components/surface/surface.js +10 -5
- package/src/components/tabbox/tabbox.js +13 -1
- package/src/components/table/table.css +160 -2
- package/src/components/table/table.js +479 -52
- package/src/components/table/window.js +46 -4
- package/src/components/table-view/table-view.js +1 -10
- package/src/components/tag-picker/field-adapter.js +3 -0
- package/src/components/tag-picker/tag-picker.js +2 -0
- package/src/components/timebox/field-adapter.js +3 -0
- package/src/components/toggle/toggle.js +51 -27
- package/src/components/tooltip/tooltip.js +21 -14
- package/src/components/tree/tree.js +87 -14
- package/src/components/truncate/truncate.js +21 -5
- package/src/components/value-list/value-list.js +37 -9
- package/src/components/view-settings/view-settings.js +1 -5
- package/src/core/component.js +34 -2
- package/src/core/date.js +5 -4
- package/src/core/dom.js +45 -2
- package/src/core/drag-axis.js +24 -7
- package/src/core/export.js +4 -4
- package/src/core/fontawesome.js +34 -3
- package/src/core/format.js +3 -1
- package/src/core/http.js +23 -11
- package/src/core/icons.js +60 -8
- package/src/core/keyboard.js +83 -9
- package/src/core/messages.js +3 -0
- package/src/core/position.js +4 -3
- package/src/core/storage.js +80 -31
- package/src/core/util.js +16 -5
- package/src/elements/define.js +82 -47
- package/src/elements/kit.js +46 -35
- package/src/index.js +8 -4
- package/src/internal/agent-model.js +152 -0
- package/src/internal/app-rail.js +53 -2
- package/src/internal/collections.js +25 -0
- package/src/internal/menu-items.js +59 -0
- package/src/internal/overlay-content.js +35 -0
- package/src/internal/presence-loop.js +61 -14
- package/src/locales/de.js +3 -0
- package/src/zeyos/calendar.js +81 -19
- package/src/zeyos/connect.js +5 -1
- package/src/zeyos/form.js +29 -10
- package/src/zeyos/select.js +36 -12
- package/src/zeyos/table.js +43 -11
- package/src/zeyos/view.js +2 -1
- package/styles/tokens/semantic.css +7 -1
- package/styles/zx.css +1 -0
|
@@ -24,6 +24,7 @@ export type TableHierarchyOptions = {
|
|
|
24
24
|
column?: string;
|
|
25
25
|
/**
|
|
26
26
|
* Initially expanded branches: all, none, or ids.
|
|
27
|
+
* Read at construction only; `setExpanded()` replaces the set afterwards.
|
|
27
28
|
*/
|
|
28
29
|
expanded?: boolean | unknown[];
|
|
29
30
|
};
|
|
@@ -95,9 +96,38 @@ export type TableColumn = {
|
|
|
95
96
|
/**
|
|
96
97
|
* CSS width, `auto`, or an `fr` proportion. `fr` values are
|
|
97
98
|
* converted into proportional percentages on `<col>` elements and enable `table-layout: fixed`;
|
|
98
|
-
* this preserves a single aligned header/body table without measuring layout in JavaScript.
|
|
99
|
+
* this preserves a single aligned header/body table without measuring layout in JavaScript. The
|
|
100
|
+
* `fr` columns share what the columns with a CSS length leave over, and never less than their
|
|
101
|
+
* `minWidth`: a container too narrow for that scrolls the table inline instead of squeezing them.
|
|
99
102
|
*/
|
|
100
103
|
width?: string;
|
|
104
|
+
/**
|
|
105
|
+
* Narrowest an `fr` column gets, as a CSS length or a
|
|
106
|
+
* number of pixels; `0` lifts the floor. Also honoured on an `auto` column of a table with a fixed
|
|
107
|
+
* layout (one with `fr` columns, or `virtual`), where it has no default. The table takes a minimum
|
|
108
|
+
* width from it, so every `fr` column keeps at least its floor whatever its share. A column with
|
|
109
|
+
* a CSS length `width` ignores it.
|
|
110
|
+
*/
|
|
111
|
+
minWidth?: string | number;
|
|
112
|
+
/**
|
|
113
|
+
* Keeps the column in view at the inline start or end edge of the
|
|
114
|
+
* scroll region while the table scrolls sideways (`position: sticky`, so it follows the writing
|
|
115
|
+
* direction). A pinned column stays where the column order puts it and sticks once it reaches the
|
|
116
|
+
* edge, so declare a `'start'` column before the columns it should stay in front of and an `'end'`
|
|
117
|
+
* column after them. Several pinned columns stack beside each other in column order, and the row
|
|
118
|
+
* handle and selection checkbox columns are pinned along with the first `'start'` column. Give a
|
|
119
|
+
* pinned column a `width` or keep it short: what is pinned is taken from the room the other
|
|
120
|
+
* columns scroll in. Not applied while the table is stacked (`responsive`).
|
|
121
|
+
*/
|
|
122
|
+
pin?: 'start' | 'end';
|
|
123
|
+
/**
|
|
124
|
+
* Label of a header group. Adjacent visible columns with the same
|
|
125
|
+
* `group` (and the same `pin`) share one header cell in a second header row above the column
|
|
126
|
+
* labels: a `<th scope="col">` spanning them, so assistive technology announces it with every
|
|
127
|
+
* cell beneath. Columns without a `group` leave that row blank above them. The group row takes
|
|
128
|
+
* no part in sorting or keyboard navigation.
|
|
129
|
+
*/
|
|
130
|
+
group?: string;
|
|
101
131
|
/**
|
|
102
132
|
* Cell alignment.
|
|
103
133
|
*/
|
|
@@ -209,7 +239,10 @@ export type TableOptions = {
|
|
|
209
239
|
*/
|
|
210
240
|
selectable?: TableSelectionMode;
|
|
211
241
|
/**
|
|
212
|
-
* Whether column headers stick
|
|
242
|
+
* Whether column headers stick to the top of the table's
|
|
243
|
+
* own scroll region while its rows scroll. That takes a bounded region: set `height` (or use
|
|
244
|
+
* `virtual`, which caps the region at the window height). A table without one grows to the height
|
|
245
|
+
* of its rows, never scrolls itself, and its header leaves with the page.
|
|
213
246
|
*/
|
|
214
247
|
stickyHeader?: boolean;
|
|
215
248
|
/**
|
|
@@ -561,7 +594,9 @@ export type TableEditorEntry = {
|
|
|
561
594
|
* does not scroll). Enter activates the row exactly as a click does (`rowclick`), Space toggles the
|
|
562
595
|
* row's selection when `selectable` (and activates otherwise), Shift+Arrow extends a `multi`
|
|
563
596
|
* selection, and Ctrl/Cmd+A selects every rendered row. The focused row survives `setData`, sorting,
|
|
564
|
-
* expansion, and `updateRow`. Column headers keep their sort buttons in the Tab order
|
|
597
|
+
* expansion, and `updateRow`. Column headers keep their sort buttons in the Tab order; the header
|
|
598
|
+
* row of column groups (`TableColumn.group`) holds no controls and takes no focus. A cell focused
|
|
599
|
+
* by keyboard scrolls clear of pinned columns (`TableColumn.pin`). With `virtual`
|
|
565
600
|
* all of this runs over every row, drawn or not: the keys draw the row they move to, and a selection
|
|
566
601
|
* reaches rows that are not in the DOM.
|
|
567
602
|
* @fires Table#rowclick
|
|
@@ -628,6 +663,22 @@ export declare class Table extends Component<TableOptions> {
|
|
|
628
663
|
_columnControlIds: Map<any, any>;
|
|
629
664
|
_columnStatus: HTMLElement;
|
|
630
665
|
_expanded: Set<unknown>;
|
|
666
|
+
_pinLayout: {
|
|
667
|
+
start: number;
|
|
668
|
+
end: number;
|
|
669
|
+
structural: boolean;
|
|
670
|
+
columns: Map<string, {
|
|
671
|
+
side: 'start' | 'end';
|
|
672
|
+
slot: number;
|
|
673
|
+
edge: boolean;
|
|
674
|
+
}>;
|
|
675
|
+
};
|
|
676
|
+
_headerRows: number;
|
|
677
|
+
_headerRow: HTMLTableRowElement;
|
|
678
|
+
_groupRow: HTMLTableRowElement;
|
|
679
|
+
_pinObserver: any;
|
|
680
|
+
_pinFrame: number;
|
|
681
|
+
_pinProps: any[] | string[];
|
|
631
682
|
_table: HTMLElement;
|
|
632
683
|
_colgroup: HTMLElement;
|
|
633
684
|
_thead: HTMLElement;
|
|
@@ -881,6 +932,24 @@ export declare class Table extends Component<TableOptions> {
|
|
|
881
932
|
collapseAll(options?: {
|
|
882
933
|
silent?: boolean;
|
|
883
934
|
}): this;
|
|
935
|
+
/**
|
|
936
|
+
* Replaces the set of expanded branches in one render — the runtime counterpart of
|
|
937
|
+
* `hierarchy.expanded`, which is read at construction only, and what to call when restoring a
|
|
938
|
+
* saved state: a loop over `expandRow()` renders the body once per branch. Ids are compared as
|
|
939
|
+
* `rowId` returns them (`1` is not `'1'`); ids that are not in the data, or name a row without
|
|
940
|
+
* children, are dropped. A set equal to the current one renders nothing and fires nothing.
|
|
941
|
+
* @param {unknown[]|boolean} ids Branch ids to leave expanded; `true` expands every branch and
|
|
942
|
+
* `false` (or an empty array) collapses them all, as in `hierarchy.expanded`.
|
|
943
|
+
* @param {{silent?: boolean}} [options={}] Event behavior. When not silent, one `rowtoggle`
|
|
944
|
+
* event is emitted per branch whose state changed, after the render: the collapsed branches
|
|
945
|
+
* first, then the expanded ones, each in data order — the same events `expandAll()` and
|
|
946
|
+
* `collapseAll()` fire.
|
|
947
|
+
* @returns {this}
|
|
948
|
+
* @fires Table#rowtoggle
|
|
949
|
+
*/
|
|
950
|
+
setExpanded(ids: unknown[] | boolean, options?: {
|
|
951
|
+
silent?: boolean;
|
|
952
|
+
}): this;
|
|
884
953
|
/**
|
|
885
954
|
* Returns expanded branch ids in current flat-data order.
|
|
886
955
|
* @returns {unknown[]} Expanded branch ids.
|
|
@@ -1123,6 +1192,44 @@ export declare class Table extends Component<TableOptions> {
|
|
|
1123
1192
|
_hierarchyColumn(): string | null;
|
|
1124
1193
|
/** @returns {void} */
|
|
1125
1194
|
_renderColumns(): void;
|
|
1195
|
+
/** @returns {number} Columns the table renders before the data columns: row handle, checkbox. */
|
|
1196
|
+
_structuralColumns(): number;
|
|
1197
|
+
/**
|
|
1198
|
+
* Marks a header or body cell as part of a pinned column. The offset is a reference to a custom
|
|
1199
|
+
* property on the scroll region, which `_measurePins()` keeps at the width of the pinned columns
|
|
1200
|
+
* before this one, so a row drawn later — a windowed table draws them all the time — needs no
|
|
1201
|
+
* measuring of its own.
|
|
1202
|
+
* @param {HTMLElement} cell Header or body cell.
|
|
1203
|
+
* @param {'start'|'end'} side Edge the column is pinned to.
|
|
1204
|
+
* @param {number} slot Position among the columns pinned to that edge, counted from the edge.
|
|
1205
|
+
* @param {boolean} [edge=false] Whether this is the pinned column next to the scrolling ones.
|
|
1206
|
+
* @returns {void}
|
|
1207
|
+
*/
|
|
1208
|
+
_markPin(cell: HTMLElement, side: 'start' | 'end', slot: number, edge?: boolean): void;
|
|
1209
|
+
/**
|
|
1210
|
+
* Builds the header row that names column groups, or null when no visible column has a group.
|
|
1211
|
+
* One cell per run of adjacent columns sharing a group and a pin: a `<th scope="col">` spanning
|
|
1212
|
+
* the run, or a blank `<td>` above columns that belong to no group and above the structural
|
|
1213
|
+
* columns. Native `colspan` carries the span to assistive technology; the cells take no focus.
|
|
1214
|
+
* @returns {HTMLTableRowElement|null}
|
|
1215
|
+
*/
|
|
1216
|
+
_renderGroupRow(): HTMLTableRowElement | null;
|
|
1217
|
+
/**
|
|
1218
|
+
* Follows the widths the pinned offsets are made of: the header cells of the pinned columns, and
|
|
1219
|
+
* the group row, whose height is where the column labels stick below it.
|
|
1220
|
+
* @returns {void}
|
|
1221
|
+
*/
|
|
1222
|
+
_watchPins(): void;
|
|
1223
|
+
/** Measures the pinned offsets on the next frame. @returns {void} */
|
|
1224
|
+
_schedulePins(): void;
|
|
1225
|
+
/**
|
|
1226
|
+
* Writes where each pinned column sticks, as custom properties on the scroll region: the summed
|
|
1227
|
+
* width of the pinned columns between it and its edge. Also the room the pinned columns take on
|
|
1228
|
+
* each side, which pads the scroll region so a cell focused by keyboard scrolls clear of them,
|
|
1229
|
+
* and the height of the group row. A table that is not laid out keeps what it had.
|
|
1230
|
+
* @returns {void}
|
|
1231
|
+
*/
|
|
1232
|
+
_measurePins(): void;
|
|
1126
1233
|
/** @returns {void} */
|
|
1127
1234
|
_renderHeader(): void;
|
|
1128
1235
|
/** @returns {void} @fires Table#editcancel */
|
|
@@ -1414,12 +1521,15 @@ export declare class Table extends Component<TableOptions> {
|
|
|
1414
1521
|
_emitDataChange(): void;
|
|
1415
1522
|
}
|
|
1416
1523
|
/**
|
|
1417
|
-
* Row activation event.
|
|
1524
|
+
* Row activation event: a click on a row, or Enter on the focused row or cell. A click on a
|
|
1525
|
+
* control inside a cell — a button, link, field, `<label>`, an element with a widget role or in
|
|
1526
|
+
* the Tab order, editable content, or anything marked `data-zx-table-no-edit` — belongs to that
|
|
1527
|
+
* control and does not fire it, nor select the row in a `single` selection.
|
|
1418
1528
|
* @event Table#rowclick
|
|
1419
1529
|
* @type {CustomEvent<TableRowClickDetail>}
|
|
1420
1530
|
*/
|
|
1421
1531
|
/**
|
|
1422
|
-
* Row double-activation event.
|
|
1532
|
+
* Row double-activation event. Like `rowclick`, not fired for a control inside a cell.
|
|
1423
1533
|
* @event Table#rowdblclick
|
|
1424
1534
|
* @type {CustomEvent<TableRowClickDetail>}
|
|
1425
1535
|
*/
|
|
@@ -1712,6 +1822,13 @@ export declare function firstValidationError(values: Record<string, unknown>, co
|
|
|
1712
1822
|
* @returns {TableVariant}
|
|
1713
1823
|
*/
|
|
1714
1824
|
export declare function normalizeTableVariant(value: unknown): TableVariant;
|
|
1825
|
+
/**
|
|
1826
|
+
* What counts as a control inside a cell: native controls and links, a `<label>` (a click on one
|
|
1827
|
+
* is a click on its control), editable content, the ARIA widget roles, anything in the Tab order,
|
|
1828
|
+
* and anything the host marks with `data-zx-table-no-edit`. Zx controls rendered into a cell are
|
|
1829
|
+
* covered by the first and the last three: each is, or wraps, one of these.
|
|
1830
|
+
*/
|
|
1831
|
+
export declare const TABLE_INTERACTIVE_SELECTOR: string;
|
|
1715
1832
|
/**
|
|
1716
1833
|
* Validates and shallow-clones table columns so stable-id APIs never mutate caller descriptors.
|
|
1717
1834
|
* @param {unknown} columns Column descriptors.
|
|
@@ -1759,3 +1876,88 @@ export declare function reconcileTableColumnOrder(columns: TableColumn[], order:
|
|
|
1759
1876
|
* @returns {string[]} Reordered copy, or an unchanged copy for unknown/same IDs.
|
|
1760
1877
|
*/
|
|
1761
1878
|
export declare function moveTableColumn(order: string[], id: string, targetId: string, position?: 'before' | 'after'): string[];
|
|
1879
|
+
/** Narrowest an `fr` column gets when its `minWidth` does not say. */
|
|
1880
|
+
export declare const TABLE_FR_MIN_WIDTH = "5rem";
|
|
1881
|
+
/**
|
|
1882
|
+
* How the visible columns are sized: the table layout, the width of each `<col>`, and the
|
|
1883
|
+
* narrowest the table may get. Pure, so the decisions can be tested without a layout engine.
|
|
1884
|
+
*
|
|
1885
|
+
* `fr` columns become percentages in proportion to each other and switch the table to a fixed
|
|
1886
|
+
* layout, as a windowed table always is. In a fixed layout the columns with a CSS length keep it
|
|
1887
|
+
* and the `fr` columns share what is left — which in a narrow container is next to nothing. So the
|
|
1888
|
+
* table gets a minimum width: the lengths, plus enough for the `fr` column that needs the most
|
|
1889
|
+
* room to reach its floor at its share, and the scroll region scrolls inline below that. The floor
|
|
1890
|
+
* is the column's `minWidth`, or `TABLE_FR_MIN_WIDTH`; an `auto` column counts with its `minWidth`
|
|
1891
|
+
* when it has one, and percentage widths are left out of the sum.
|
|
1892
|
+
* @param {Array<Partial<TableColumn>>} columns Visible columns, in display order.
|
|
1893
|
+
* @param {{virtual?: boolean, structural?: number}} [options={}] Whether the table is windowed, and
|
|
1894
|
+
* how many control-height columns (row handle, checkbox) it renders before the data columns.
|
|
1895
|
+
* @returns {{layout: 'fixed'|'auto', widths: Array<string|null>, minInlineSize: string|null}}
|
|
1896
|
+
* `widths` holds one `<col>` width per column, null where the column has none.
|
|
1897
|
+
*/
|
|
1898
|
+
export declare function tableColumnSizing(columns: Array<Partial<TableColumn>>, options?: {
|
|
1899
|
+
virtual?: boolean;
|
|
1900
|
+
structural?: number;
|
|
1901
|
+
}): {
|
|
1902
|
+
layout: 'fixed' | 'auto';
|
|
1903
|
+
widths: Array<string | null>;
|
|
1904
|
+
minInlineSize: string | null;
|
|
1905
|
+
};
|
|
1906
|
+
/**
|
|
1907
|
+
* The edge a column is pinned to.
|
|
1908
|
+
* @param {Partial<TableColumn>|null|undefined} column Column descriptor.
|
|
1909
|
+
* @returns {'start'|'end'|null} Null for an unpinned column and for any other value.
|
|
1910
|
+
*/
|
|
1911
|
+
export declare function tableColumnPin(column: Partial<TableColumn> | null | undefined): 'start' | 'end' | null;
|
|
1912
|
+
/**
|
|
1913
|
+
* Where each pinned column sits among the columns pinned to its edge. A slot counts from the edge:
|
|
1914
|
+
* slot 0 at the start is the first pinned column in display order, slot 0 at the end the last. The
|
|
1915
|
+
* structural columns (row handle, selection checkbox) take the first start slots once any column
|
|
1916
|
+
* is pinned to the start, so they stay in view with it. The `edge` column of a side is the one next
|
|
1917
|
+
* to the scrolling columns — the last pinned to the start, the first pinned to the end — which is
|
|
1918
|
+
* where the dividing rule is drawn.
|
|
1919
|
+
* @param {Array<Partial<TableColumn>>} columns Visible columns, in display order.
|
|
1920
|
+
* @param {number} [structural=0] Structural columns rendered before them.
|
|
1921
|
+
* @returns {{start: number, end: number, structural: boolean,
|
|
1922
|
+
* columns: Map<string, {side: 'start'|'end', slot: number, edge: boolean}>}} Slots taken on each
|
|
1923
|
+
* side, whether the structural columns are pinned, and the placement of each pinned column by id.
|
|
1924
|
+
*/
|
|
1925
|
+
export declare function tablePinLayout(columns: Array<Partial<TableColumn>>, structural?: number): {
|
|
1926
|
+
start: number;
|
|
1927
|
+
end: number;
|
|
1928
|
+
structural: boolean;
|
|
1929
|
+
columns: Map<string, {
|
|
1930
|
+
side: 'start' | 'end';
|
|
1931
|
+
slot: number;
|
|
1932
|
+
edge: boolean;
|
|
1933
|
+
}>;
|
|
1934
|
+
};
|
|
1935
|
+
/**
|
|
1936
|
+
* The cells of the header row that names column groups: one per run of adjacent columns sharing a
|
|
1937
|
+
* `group` and a `pin`, in display order, with a null label for a run that belongs to no group. A
|
|
1938
|
+
* run is split where the pin changes because a header cell sticks as a whole or not at all. Empty
|
|
1939
|
+
* when no column has a group, which is when the table renders no such row.
|
|
1940
|
+
* @param {Array<Partial<TableColumn>>} columns Visible columns, in display order.
|
|
1941
|
+
* @returns {Array<{label: string|null, pin: 'start'|'end'|null, columns: string[]}>} Runs; the
|
|
1942
|
+
* length of `columns` is the cell's `colspan`.
|
|
1943
|
+
*/
|
|
1944
|
+
export declare function tableHeaderGroups(columns: Array<Partial<TableColumn>>): Array<{
|
|
1945
|
+
label: string | null;
|
|
1946
|
+
pin: 'start' | 'end' | null;
|
|
1947
|
+
columns: string[];
|
|
1948
|
+
}>;
|
|
1949
|
+
/**
|
|
1950
|
+
* What replacing the set of expanded branches changes. Ids that are not branches of the current
|
|
1951
|
+
* data are dropped, exactly as the table drops them from `hierarchy.expanded`.
|
|
1952
|
+
* @param {unknown[]} branchIds Ids of every row that has children, in data order.
|
|
1953
|
+
* @param {Set<unknown>} current Branches expanded now.
|
|
1954
|
+
* @param {unknown} ids Branches to leave expanded: an array (or any iterable) of ids, `true` for
|
|
1955
|
+
* every branch, anything else for none.
|
|
1956
|
+
* @returns {{expanded: Set<unknown>, opened: unknown[], closed: unknown[]}} The new set, and the
|
|
1957
|
+
* branches whose state changes, each in data order.
|
|
1958
|
+
*/
|
|
1959
|
+
export declare function resolveExpandedChange(branchIds: unknown[], current: Set<unknown>, ids: unknown): {
|
|
1960
|
+
expanded: Set<unknown>;
|
|
1961
|
+
opened: unknown[];
|
|
1962
|
+
closed: unknown[];
|
|
1963
|
+
};
|
|
@@ -1,3 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Runs a callback before the next paint, or shortly after where there are no animation frames
|
|
3
|
+
* (jsdom without `pretendToBeVisual`, a server-side DOM).
|
|
4
|
+
* @param {() => void} callback Work to run.
|
|
5
|
+
* @returns {number} Handle for `cancelFrame()`.
|
|
6
|
+
*/
|
|
7
|
+
export declare function nextFrame(callback: () => void): number;
|
|
8
|
+
/** @param {number} handle What `nextFrame()` returned. @returns {void} */
|
|
9
|
+
export declare function cancelFrame(handle: number): void;
|
|
10
|
+
/**
|
|
11
|
+
* How many rows a PageUp or PageDown moves: the rows that fit in the visible height, less one so
|
|
12
|
+
* the row focus leaves stays in view as context. Falls back when either height is unknown. Shared
|
|
13
|
+
* by the components that page through rows with the keyboard.
|
|
14
|
+
* @param {number} viewport Visible height of the scroll region, below any sticky header.
|
|
15
|
+
* @param {number} rowHeight Height of one row.
|
|
16
|
+
* @param {number} [fallback=10] Rows to move when the heights are unusable.
|
|
17
|
+
* @returns {number} At least 1.
|
|
18
|
+
*/
|
|
19
|
+
export declare function pageStepRows(viewport: number, rowHeight: number, fallback?: number): number;
|
|
1
20
|
/**
|
|
2
21
|
* Which rows to draw for a scroll position: those in view, plus `overscan` viewports' worth above
|
|
3
22
|
* and below. Positions are zero-based and `end` is exclusive. The scroll position is clamped to
|
|
@@ -102,7 +121,7 @@ export type RowWindowHost = {
|
|
|
102
121
|
* Keeps a table body down to the rows around the scroll position. Spacer rows stand in for the rest,
|
|
103
122
|
* sized from one measured row, so the scroll height is the height of every row. Rows that stay in
|
|
104
123
|
* the window are never touched: moving one would blur it. Holds no listeners of its own except the
|
|
105
|
-
* `ResizeObserver` released by `stop()
|
|
124
|
+
* `ResizeObserver` released by `stop()`, and does without one where the environment has none.
|
|
106
125
|
*/
|
|
107
126
|
export declare class RowWindow {
|
|
108
127
|
host: RowWindowHost;
|
|
@@ -130,6 +149,11 @@ export declare class RowWindow {
|
|
|
130
149
|
* through the observer too, so it happens once the table is laid out and styled, however late it
|
|
131
150
|
* is attached. It waits for the next frame because a measurement may resize the scroll region
|
|
132
151
|
* itself, which an observer callback must not do.
|
|
152
|
+
*
|
|
153
|
+
* Where there is no `ResizeObserver` (jsdom) the window still works: it measures once on the next
|
|
154
|
+
* frame and again whenever the host calls `schedule()` — `Table` does on a window resize — and
|
|
155
|
+
* until a measurement succeeds it draws for the assumed row height and viewport, which is what a
|
|
156
|
+
* DOM without layout gets for good.
|
|
133
157
|
* @returns {void}
|
|
134
158
|
*/
|
|
135
159
|
start(): void;
|
|
@@ -9,9 +9,17 @@ export type ToggleOptions = {
|
|
|
9
9
|
*/
|
|
10
10
|
value?: any;
|
|
11
11
|
/**
|
|
12
|
-
*
|
|
12
|
+
* The switch's name, drawn beside the track and read as its
|
|
13
|
+
* accessible name. Null renders no text: the switch then needs a name from somewhere else — a
|
|
14
|
+
* Field or `<label for>` around it, or `aria-labelledby` on the element.
|
|
13
15
|
*/
|
|
14
16
|
label?: string | null;
|
|
17
|
+
/**
|
|
18
|
+
* Whether the label is kept for assistive technology only:
|
|
19
|
+
* no visible text, and the label becomes the switch's `aria-label`. For a switch whose meaning
|
|
20
|
+
* the surrounding layout already shows — a table cell under a column header, a settings row.
|
|
21
|
+
*/
|
|
22
|
+
hideLabel?: boolean;
|
|
15
23
|
/**
|
|
16
24
|
* Initial disabled state.
|
|
17
25
|
*/
|
|
@@ -28,7 +36,12 @@ export type ToggleOptions = {
|
|
|
28
36
|
* @typedef {Object} ToggleOptions
|
|
29
37
|
* @property {boolean} [checked=false] Initial switch state.
|
|
30
38
|
* @property {*} [value=true] Value returned while on.
|
|
31
|
-
* @property {string|null} [label=null]
|
|
39
|
+
* @property {string|null} [label=null] The switch's name, drawn beside the track and read as its
|
|
40
|
+
* accessible name. Null renders no text: the switch then needs a name from somewhere else — a
|
|
41
|
+
* Field or `<label for>` around it, or `aria-labelledby` on the element.
|
|
42
|
+
* @property {boolean} [hideLabel=false] Whether the label is kept for assistive technology only:
|
|
43
|
+
* no visible text, and the label becomes the switch's `aria-label`. For a switch whose meaning
|
|
44
|
+
* the surrounding layout already shows — a table cell under a column header, a settings row.
|
|
32
45
|
* @property {boolean} [disabled=false] Initial disabled state.
|
|
33
46
|
* @property {(event: CustomEvent<{checked: boolean, value: *}>) => void} [onchange] Change callback.
|
|
34
47
|
*/
|
|
@@ -39,12 +52,13 @@ export type ToggleOptions = {
|
|
|
39
52
|
*/
|
|
40
53
|
export declare class Toggle extends Component<ToggleOptions> {
|
|
41
54
|
_createdRoot: boolean;
|
|
42
|
-
_original:
|
|
43
|
-
attributes: [string, string][];
|
|
44
|
-
children: Node[];
|
|
45
|
-
};
|
|
55
|
+
_original: import("../../core/dom.js").TargetSnapshot;
|
|
46
56
|
_checked: any;
|
|
47
57
|
_disabled: boolean;
|
|
58
|
+
/** The `aria-label` the target arrived with, put back whenever the switch stops writing its own. */
|
|
59
|
+
_ariaLabel: string;
|
|
60
|
+
/** @type {HTMLElement|null} The visible label, when there is one. */
|
|
61
|
+
_labelEl: HTMLElement | null;
|
|
48
62
|
_cleaned: boolean;
|
|
49
63
|
static cssName: string;
|
|
50
64
|
/** @type {Readonly<ToggleOptions>} */
|
|
@@ -77,6 +91,12 @@ export declare class Toggle extends Component<ToggleOptions> {
|
|
|
77
91
|
* @returns {*}
|
|
78
92
|
*/
|
|
79
93
|
getValue(): any;
|
|
94
|
+
/**
|
|
95
|
+
* Replaces the switch's name: the visible label, or the `aria-label` under `hideLabel`.
|
|
96
|
+
* @param {string|null} label New name; null removes it.
|
|
97
|
+
* @returns {this}
|
|
98
|
+
*/
|
|
99
|
+
setLabel(label: string | null): this;
|
|
80
100
|
/**
|
|
81
101
|
* Enables user interaction.
|
|
82
102
|
* @returns {this}
|
|
@@ -89,6 +109,18 @@ export declare class Toggle extends Component<ToggleOptions> {
|
|
|
89
109
|
disable(): this;
|
|
90
110
|
/** @returns {void} */
|
|
91
111
|
destroy(): void;
|
|
112
|
+
/**
|
|
113
|
+
* Writes the name where the options put it: a text node beside the track, or `aria-label` when
|
|
114
|
+
* the label is hidden. With no name of its own the switch leaves `aria-label` as it found it.
|
|
115
|
+
* @param {string|null} label Name, or null for none.
|
|
116
|
+
* @returns {void}
|
|
117
|
+
*/
|
|
118
|
+
_syncLabel(label: string | null): void;
|
|
92
119
|
/** @returns {void} */
|
|
93
120
|
_sync(): void;
|
|
94
121
|
}
|
|
122
|
+
/**
|
|
123
|
+
* Change emitted after a real state transition.
|
|
124
|
+
* @event Toggle#change
|
|
125
|
+
* @type {CustomEvent<{checked: boolean, value: *}>}
|
|
126
|
+
*/
|
|
@@ -73,8 +73,9 @@ export type TooltipOptions = {
|
|
|
73
73
|
* The bubble is a manual popover in the top layer, positioned by `position()` from the kernel, so
|
|
74
74
|
* it escapes clipping and stacking contexts and flips near a viewport edge. It never takes focus
|
|
75
75
|
* but remains visible while the pointer is over either the anchor or the bubble. While open, the
|
|
76
|
-
* anchor
|
|
77
|
-
*
|
|
76
|
+
* anchor's `aria-describedby` also names the bubble; closing takes out that one id and leaves the
|
|
77
|
+
* rest of the list as it is then, ids the application added meanwhile included — and removes the
|
|
78
|
+
* attribute only when the bubble's id was all it held.
|
|
78
79
|
*
|
|
79
80
|
* A hover opens it after `delay`; keyboard focus opens it at once, because a keyboard user has no
|
|
80
81
|
* way to "hover a little longer". Touch never opens it: a bubble that cannot be dismissed by
|
|
@@ -108,7 +109,7 @@ export declare class Tooltip extends Component<TooltipOptions> {
|
|
|
108
109
|
*/
|
|
109
110
|
show(): this;
|
|
110
111
|
/**
|
|
111
|
-
* Closes the tooltip and
|
|
112
|
+
* Closes the tooltip and takes its id out of the anchor's `aria-describedby`.
|
|
112
113
|
* @returns {this}
|
|
113
114
|
* @fires Tooltip#close
|
|
114
115
|
*/
|
|
@@ -151,7 +152,7 @@ export declare class Tooltip extends Component<TooltipOptions> {
|
|
|
151
152
|
*/
|
|
152
153
|
getAnchor(): Element;
|
|
153
154
|
/**
|
|
154
|
-
* Closes the tooltip, removes the bubble, and
|
|
155
|
+
* Closes the tooltip, removes the bubble, and takes its id out of the anchor's ARIA.
|
|
155
156
|
* @returns {void}
|
|
156
157
|
*/
|
|
157
158
|
destroy(): void;
|
|
@@ -19,7 +19,9 @@ export type TreeOptions = {
|
|
|
19
19
|
*/
|
|
20
20
|
childrenKey?: string;
|
|
21
21
|
/**
|
|
22
|
-
* Initially expanded node IDs.
|
|
22
|
+
* Initially expanded node IDs. A lazy branch among them
|
|
23
|
+
* (`hasChildren` with no children loaded yet) shows collapsed until it is expanded on its own —
|
|
24
|
+
* clicked, →, or `expand()` — which loads it.
|
|
23
25
|
*/
|
|
24
26
|
expanded?: unknown[];
|
|
25
27
|
/**
|
|
@@ -138,7 +140,9 @@ export type TreeOptions = {
|
|
|
138
140
|
* @property {string|((node: TreeNode) => unknown)} [valueKey='ID'] Node ID property or reader.
|
|
139
141
|
* @property {string|((node: TreeNode) => string)} [labelKey='name'] Node label property or reader.
|
|
140
142
|
* @property {string} [childrenKey='children'] Property holding child nodes.
|
|
141
|
-
* @property {unknown[]} [expanded=[]] Initially expanded node IDs.
|
|
143
|
+
* @property {unknown[]} [expanded=[]] Initially expanded node IDs. A lazy branch among them
|
|
144
|
+
* (`hasChildren` with no children loaded yet) shows collapsed until it is expanded on its own —
|
|
145
|
+
* clicked, →, or `expand()` — which loads it.
|
|
142
146
|
* @property {false|'single'|'multi'} [selection='single'] Selection mode.
|
|
143
147
|
* @property {unknown[]} [selected=[]] Initially selected node IDs.
|
|
144
148
|
* @property {boolean} [checkboxes=false] Whether to render tri-state checkboxes.
|
|
@@ -197,6 +201,8 @@ export declare class TreeView extends Component<TreeOptions> {
|
|
|
197
201
|
_checked: Set<any>;
|
|
198
202
|
/** @type {Map<unknown, Promise<boolean>>} In-flight lazy loads, keyed by node ID. */
|
|
199
203
|
_loading: Map<unknown, Promise<boolean>>;
|
|
204
|
+
/** @type {Set<unknown>} Lazy branches whose children are not loaded yet, as of the last render. */
|
|
205
|
+
_unloaded: Set<unknown>;
|
|
200
206
|
_loadGeneration: number;
|
|
201
207
|
_destroyed: boolean;
|
|
202
208
|
_expanding: Map<any, any>;
|
|
@@ -239,7 +245,8 @@ export declare class TreeView extends Component<TreeOptions> {
|
|
|
239
245
|
*/
|
|
240
246
|
getPath(id: unknown): TreeNode[];
|
|
241
247
|
/**
|
|
242
|
-
* Filters the tree by a label substring, keeping the ancestors of every match.
|
|
248
|
+
* Filters the tree by a label substring, keeping the ancestors of every match. Only loaded
|
|
249
|
+
* children are searched, and every surviving branch opens except a lazy one not loaded yet.
|
|
243
250
|
* @param {string} query Search text; an empty string restores the full tree.
|
|
244
251
|
* @returns {this}
|
|
245
252
|
*/
|
|
@@ -259,13 +266,15 @@ export declare class TreeView extends Component<TreeOptions> {
|
|
|
259
266
|
*/
|
|
260
267
|
collapse(id: unknown): this;
|
|
261
268
|
/**
|
|
262
|
-
* Expands or collapses one branch.
|
|
269
|
+
* Expands or collapses one branch. A lazy branch not loaded yet counts as collapsed, so this
|
|
270
|
+
* loads and expands it.
|
|
263
271
|
* @param {unknown} id Node ID.
|
|
264
272
|
* @returns {Promise<this>}
|
|
265
273
|
*/
|
|
266
274
|
toggle(id: unknown): Promise<this>;
|
|
267
275
|
/**
|
|
268
|
-
* Expands every already-loaded branch.
|
|
276
|
+
* Expands every already-loaded branch. A lazy branch whose children have not been loaded stays
|
|
277
|
+
* collapsed; `expand(id)` loads it.
|
|
269
278
|
* @returns {this}
|
|
270
279
|
*/
|
|
271
280
|
expandAll(): this;
|
|
@@ -364,13 +373,41 @@ export declare class TreeView extends Component<TreeOptions> {
|
|
|
364
373
|
/** @param {KeyboardEvent} event @returns {void} */
|
|
365
374
|
_onKeydown(event: KeyboardEvent): void;
|
|
366
375
|
/**
|
|
367
|
-
* Expands every sibling branch of a row, the APG `*` shortcut.
|
|
376
|
+
* Expands every sibling branch of a row, the APG `*` shortcut. A lazy sibling is loaded first,
|
|
377
|
+
* exactly as → on it would; each one opens as its children arrive, and focus stays put.
|
|
368
378
|
* @param {{parent: TreeNode|null}} row Focused row.
|
|
369
379
|
* @returns {void}
|
|
370
380
|
*/
|
|
371
381
|
_expandSiblings(row: {
|
|
372
382
|
parent: TreeNode | null;
|
|
373
383
|
}): void;
|
|
384
|
+
/**
|
|
385
|
+
* Whether expanding a branch has to call the loader first: a loader is configured and the
|
|
386
|
+
* branch has no children yet. The same test `expand()` applies.
|
|
387
|
+
* @param {TreeNode|null} node Node in the working tree.
|
|
388
|
+
* @returns {boolean}
|
|
389
|
+
*/
|
|
390
|
+
_needsLoad(node: TreeNode | null): boolean;
|
|
391
|
+
/**
|
|
392
|
+
* Whether a branch is open now: expanded, and not a lazy branch still waiting for its children —
|
|
393
|
+
* an ID can sit in the expanded set before its children were ever fetched.
|
|
394
|
+
* @param {unknown} id Node ID.
|
|
395
|
+
* @param {TreeNode|null} node The node in the working tree.
|
|
396
|
+
* @returns {boolean}
|
|
397
|
+
*/
|
|
398
|
+
_isOpen(id: unknown, node: TreeNode | null): boolean;
|
|
399
|
+
/**
|
|
400
|
+
* The lazy branches whose children have not been loaded, read off the working tree — a filtered
|
|
401
|
+
* copy's pruned children say nothing about whether a branch was ever loaded.
|
|
402
|
+
* @returns {Set<unknown>} Their IDs; empty without a loader.
|
|
403
|
+
*/
|
|
404
|
+
_unloadedIds(): Set<unknown>;
|
|
405
|
+
/**
|
|
406
|
+
* {@link _isOpen} for a rendered row, from what the last render found unloaded.
|
|
407
|
+
* @param {unknown} id Node ID.
|
|
408
|
+
* @returns {boolean}
|
|
409
|
+
*/
|
|
410
|
+
_shownOpen(id: unknown): boolean;
|
|
374
411
|
/**
|
|
375
412
|
* Loads a branch's children through the configured loader, once.
|
|
376
413
|
* @param {TreeNode} node Branch node.
|
|
@@ -19,7 +19,8 @@ export type TruncateController = {
|
|
|
19
19
|
*/
|
|
20
20
|
isTruncated: () => boolean;
|
|
21
21
|
/**
|
|
22
|
-
* Removes the classes, the observer, and any title
|
|
22
|
+
* Removes the classes, the observer, and any title or line count
|
|
23
|
+
* this set, putting back the `title`, `data-lines`, and `--zx-truncate-lines` the element had.
|
|
23
24
|
*/
|
|
24
25
|
destroy: () => void;
|
|
25
26
|
};
|
|
@@ -33,7 +34,8 @@ export type TruncateController = {
|
|
|
33
34
|
* @typedef {Object} TruncateController
|
|
34
35
|
* @property {() => boolean} update Re-measures and returns whether the text is currently cut off.
|
|
35
36
|
* @property {() => boolean} isTruncated Whether the text was cut off at the last measurement.
|
|
36
|
-
* @property {() => void} destroy Removes the classes, the observer, and any title
|
|
37
|
+
* @property {() => void} destroy Removes the classes, the observer, and any title or line count
|
|
38
|
+
* this set, putting back the `title`, `data-lines`, and `--zx-truncate-lines` the element had.
|
|
37
39
|
*/
|
|
38
40
|
/**
|
|
39
41
|
* Clamps an element's text to a number of lines, and gives the cut-off text back on hover.
|
|
@@ -56,8 +56,9 @@ export type ValueListOptions = {
|
|
|
56
56
|
* @property {(event: CustomEvent<{value: string}>) => void} [onremove] Value removed listener.
|
|
57
57
|
*/
|
|
58
58
|
/**
|
|
59
|
-
* Tag/chip editor. It uses the APG listbox/option focus model:
|
|
60
|
-
* move focus,
|
|
59
|
+
* Tag/chip editor. It uses the APG listbox/option focus model: the list is one tab stop (a roving
|
|
60
|
+
* tabindex), each chip is an option, arrow keys move focus, Home/End go to the first and last
|
|
61
|
+
* chip, Ctrl+Left/Right reorders, and Delete/Backspace removes the focused option.
|
|
61
62
|
* @fires ValueList#change
|
|
62
63
|
* @fires ValueList#add
|
|
63
64
|
* @fires ValueList#remove
|
|
@@ -66,6 +67,7 @@ export type ValueListOptions = {
|
|
|
66
67
|
export declare class ValueList extends Component<ValueListOptions> {
|
|
67
68
|
_ownedNodes: any[];
|
|
68
69
|
_disabled: boolean;
|
|
70
|
+
_roving: any;
|
|
69
71
|
_dragIndex: number;
|
|
70
72
|
_initialState: string;
|
|
71
73
|
_initialDisabled: string;
|
|
@@ -124,6 +126,11 @@ export declare class ValueList extends Component<ValueListOptions> {
|
|
|
124
126
|
* @returns {this}
|
|
125
127
|
*/
|
|
126
128
|
disable(): this;
|
|
129
|
+
/**
|
|
130
|
+
* Keeps the chips one tab stop while the list is editable; a disabled list keeps none.
|
|
131
|
+
* @returns {void}
|
|
132
|
+
*/
|
|
133
|
+
_syncRoving(): void;
|
|
127
134
|
/** @returns {void} */
|
|
128
135
|
_renderChips(focusIndex?: number): void;
|
|
129
136
|
/** @param {KeyboardEvent} event @returns {void} */
|
|
@@ -14,7 +14,8 @@ export declare function formatDate(date: Date, fmt: string, options?: {
|
|
|
14
14
|
} | null): string;
|
|
15
15
|
/**
|
|
16
16
|
* Parses numeric date tokens from a string, returning null for mismatches or invalid dates.
|
|
17
|
-
* Unspecified fields default to 1970-01-01 00:00:00 local time.
|
|
17
|
+
* Unspecified fields default to 1970-01-01 00:00:00 local time. A time that the local clock skips
|
|
18
|
+
* at a daylight-saving change is accepted and moved forward, as `Date` does.
|
|
18
19
|
* @param {string} str Date text.
|
|
19
20
|
* @param {string} fmt Matching numeric format.
|
|
20
21
|
* @returns {Date|null}
|
package/dist/types/core/dom.d.ts
CHANGED
|
@@ -146,6 +146,20 @@ export declare function snapshotTarget(element: Element): TargetSnapshot;
|
|
|
146
146
|
* @returns {void}
|
|
147
147
|
*/
|
|
148
148
|
export declare function restoreTarget(element: Element, snapshot: TargetSnapshot | null): void;
|
|
149
|
+
/**
|
|
150
|
+
* Puts an element's inline style back to a captured attribute value.
|
|
151
|
+
*
|
|
152
|
+
* Written through the CSSOM, never the attribute: under a `style-src` policy without
|
|
153
|
+
* `'unsafe-inline'`, setting the `style` attribute is an inline style the browser blocks and
|
|
154
|
+
* reports, while `style.cssText` is not governed by it. A style that was absent (or empty) is
|
|
155
|
+
* cleared and its attribute removed — after a read, because Chrome reflects CSSOM changes into the
|
|
156
|
+
* attribute lazily, and a removal it has not reflected yet comes back as an empty `style=""`,
|
|
157
|
+
* which the next capture would then try to restore.
|
|
158
|
+
* @param {Element & ElementCSSInlineStyle} element Element whose inline style to restore.
|
|
159
|
+
* @param {string|null} value Attribute value captured earlier, or null when it was absent.
|
|
160
|
+
* @returns {void}
|
|
161
|
+
*/
|
|
162
|
+
export declare function restoreInlineStyle(element: Element & ElementCSSInlineStyle, value: string | null): void;
|
|
149
163
|
/**
|
|
150
164
|
* Escapes text for safe insertion into an HTML string.
|
|
151
165
|
* @param {unknown} str Value to escape.
|