@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
|
@@ -8,6 +8,7 @@ import { badge } from '../badge/badge.js';
|
|
|
8
8
|
import { renderBlocks } from '../block-view/block-view.js';
|
|
9
9
|
import { button } from '../button/button.js';
|
|
10
10
|
import { Chart } from '../chart/chart.js';
|
|
11
|
+
import { SvgChartAdapter } from '../chart/svg-adapter.js';
|
|
11
12
|
import { registerChecklistFieldAdapter } from '../checklist/field-adapter.js';
|
|
12
13
|
import { registerDateboxFieldAdapters } from '../datebox/field-adapter.js';
|
|
13
14
|
import { Dialog } from '../dialog/dialog.js';
|
|
@@ -109,8 +110,10 @@ import { dateLocale } from '../../internal/date-locale.js';
|
|
|
109
110
|
* restored from a stored conversation: it starts as its receipt and replies no more.
|
|
110
111
|
* @property {string|null} [labelledBy=null] The id of an element that already shows the title,
|
|
111
112
|
* such as a Dialog's; the surface then draws no title of its own and is labelled by it.
|
|
112
|
-
* @property {ChartAdapter|null} [chartAdapter
|
|
113
|
-
*
|
|
113
|
+
* @property {ChartAdapter|null} [chartAdapter] The engine that draws `chart` nodes: a shared
|
|
114
|
+
* `SvgChartAdapter` by default, which needs no library; another adapter, such as a
|
|
115
|
+
* `ChartJsAdapter`, to draw with that engine; null to draw none, so that each chart shows its
|
|
116
|
+
* data table instead.
|
|
114
117
|
* @property {Record<string, string>|Record<string, Record<string, string>>} [msg] Localized messages.
|
|
115
118
|
* @property {(event: CustomEvent<{reply: SurfaceReply}>) => void} [onreply] Reply listener.
|
|
116
119
|
* @property {(event: CustomEvent<{errors: SurfaceError[]}>) => void} [onerror] Error listener.
|
|
@@ -165,6 +168,8 @@ const MAX_TOKEN = 512;
|
|
|
165
168
|
const SURFACE_ID = new RegExp(ID_PATTERN);
|
|
166
169
|
/** The defaults that answer: they check the inputs and send their values. */
|
|
167
170
|
const ANSWERING = new Set(['submit', 'confirm', 'approve']);
|
|
171
|
+
/** What draws a surface's charts unless the application says otherwise: no dependency, no state. */
|
|
172
|
+
const SVG_CHARTS = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ new SvgChartAdapter());
|
|
168
173
|
|
|
169
174
|
/**
|
|
170
175
|
* A surface an agent composed as JSON — a rich answer, or a dialog asking the person something —
|
|
@@ -201,7 +206,7 @@ export class Surface extends Component {
|
|
|
201
206
|
token: null,
|
|
202
207
|
reply: null,
|
|
203
208
|
labelledBy: null,
|
|
204
|
-
chartAdapter:
|
|
209
|
+
chartAdapter: SVG_CHARTS
|
|
205
210
|
};
|
|
206
211
|
|
|
207
212
|
/** @returns {HTMLElement} */
|
|
@@ -1026,8 +1031,8 @@ export class Surface extends Component {
|
|
|
1026
1031
|
}
|
|
1027
1032
|
|
|
1028
1033
|
/**
|
|
1029
|
-
* A chart; its data table is shown when there is no engine, and offered
|
|
1030
|
-
* there is.
|
|
1034
|
+
* A chart; its data table is shown when there is no engine (`chartAdapter: null`), and offered
|
|
1035
|
+
* behind a toggle when there is.
|
|
1031
1036
|
* @private
|
|
1032
1037
|
* @param {NodeView} view @param {Record<string, any>} props
|
|
1033
1038
|
* @returns {NodeView}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Component } from '../../core/component.js';
|
|
2
2
|
import { h } from '../../core/dom.js';
|
|
3
3
|
import { ICON_SIZE, icon } from '../../core/icons.js';
|
|
4
|
+
import { rovingStep } from '../../core/keyboard.js';
|
|
4
5
|
import { uid } from '../../core/util.js';
|
|
5
6
|
|
|
6
7
|
/** @typedef {Node|Component|(() => Node|Component)} TabContent */
|
|
@@ -353,7 +354,9 @@ export class Tabbox extends Component {
|
|
|
353
354
|
const enabled = this._enabledTabs();
|
|
354
355
|
if (event.key === 'ArrowLeft' || event.key === 'ArrowRight') {
|
|
355
356
|
event.preventDefault();
|
|
356
|
-
|
|
357
|
+
// The arrows follow the visual order, which `dir="rtl"` reverses.
|
|
358
|
+
const step = rovingStep(event.key, 'horizontal', isRightToLeft(this.refs.tablist));
|
|
359
|
+
const offset = step === 'next' ? 1 : -1;
|
|
357
360
|
const index = enabled.indexOf(current);
|
|
358
361
|
const next = enabled[(index + offset + enabled.length) % enabled.length];
|
|
359
362
|
if (next) this._setFocused(next);
|
|
@@ -506,6 +509,15 @@ export class Tabbox extends Component {
|
|
|
506
509
|
* @type {CustomEvent<{name: string}>}
|
|
507
510
|
*/
|
|
508
511
|
|
|
512
|
+
/**
|
|
513
|
+
* Whether an element is laid out right to left, as its computed `direction` says.
|
|
514
|
+
* @param {Element} element Element to ask.
|
|
515
|
+
* @returns {boolean}
|
|
516
|
+
*/
|
|
517
|
+
function isRightToLeft(element) {
|
|
518
|
+
return globalThis.getComputedStyle?.(element)?.direction === 'rtl';
|
|
519
|
+
}
|
|
520
|
+
|
|
509
521
|
/** @param {unknown} content @returns {content is TabContent} */
|
|
510
522
|
function isTabContent(content) {
|
|
511
523
|
if (typeof content === 'function' || content instanceof Component) return true;
|
|
@@ -203,7 +203,8 @@
|
|
|
203
203
|
margin-block-end: -2px;
|
|
204
204
|
background: var(--zx-color-accent);
|
|
205
205
|
opacity: 0.85;
|
|
206
|
-
|
|
206
|
+
/* Above the sticky header, pinned header cells included. */
|
|
207
|
+
z-index: 4;
|
|
207
208
|
}
|
|
208
209
|
|
|
209
210
|
@media (prefers-reduced-motion: no-preference) {
|
|
@@ -239,8 +240,12 @@
|
|
|
239
240
|
|
|
240
241
|
/* Fixed layout (fr/proportional columns): fill the container. `max-content` must NOT apply here —
|
|
241
242
|
with table-layout:fixed and percentage <col> widths it resolves to a runaway width. */
|
|
243
|
+
/* The minimum is what the fixed-width columns take plus the floor of the `fr` ones (see
|
|
244
|
+
`tableColumnSizing`): below it the scroll region scrolls inline instead of the `fr` columns
|
|
245
|
+
being handed the few pixels that are left. */
|
|
242
246
|
.zx-table__table[data-layout="fixed"] {
|
|
243
247
|
table-layout: fixed;
|
|
248
|
+
min-inline-size: var(--zx-table-min-inline-size, 0);
|
|
244
249
|
}
|
|
245
250
|
|
|
246
251
|
/*
|
|
@@ -273,10 +278,134 @@
|
|
|
273
278
|
|
|
274
279
|
.zx-table__scroll[data-sticky-header="true"] th {
|
|
275
280
|
position: sticky;
|
|
276
|
-
|
|
281
|
+
/* Over the pinned body cells, which sit at 1. */
|
|
282
|
+
z-index: 2;
|
|
283
|
+
inset-block-start: 0;
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
/* --- Header groups (TableColumn group) ------------------------------------------------------- */
|
|
287
|
+
|
|
288
|
+
/*
|
|
289
|
+
* A second header row above the column labels: one cell per run of columns sharing a `group`, and
|
|
290
|
+
* a blank one above the columns that have none. The row is one row height whatever it holds, so
|
|
291
|
+
* the labels beneath can stick right below it; the measured height takes over once there is one.
|
|
292
|
+
*/
|
|
293
|
+
.zx-table__group-row > * {
|
|
294
|
+
box-sizing: border-box;
|
|
295
|
+
block-size: var(--zx-row-height);
|
|
296
|
+
padding-block: var(--zx-space-1);
|
|
297
|
+
white-space: nowrap;
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
/* Blank above an ungrouped column: the header's surface with no rule under it, so the column
|
|
301
|
+
reads as one tall header. Stated here because the blank is a `<td>`, not a header cell. */
|
|
302
|
+
.zx-table .zx-table__group-blank {
|
|
303
|
+
border-block-end-color: transparent;
|
|
304
|
+
background: var(--zx-table-header-bg, var(--zx-color-bg-surface));
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
.zx-table .zx-table__group {
|
|
308
|
+
color: var(--zx-color-text);
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
/* Where one group ends and the next begins. */
|
|
312
|
+
.zx-table .zx-table__group + .zx-table__group {
|
|
313
|
+
border-inline-start: 1px solid var(--zx-table-border-color, var(--zx-color-border));
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
/* The label stays in view for as long as any of its columns is: it follows the scroll position
|
|
317
|
+
inside its cell, clear of the columns pinned to the start edge. */
|
|
318
|
+
.zx-table__group-label {
|
|
319
|
+
position: sticky;
|
|
320
|
+
inset-inline-start: calc(var(--zx-table-pin-start, 0px) + var(--zx-space-3));
|
|
321
|
+
display: inline-block;
|
|
322
|
+
max-inline-size: 100%;
|
|
323
|
+
overflow: hidden;
|
|
324
|
+
text-overflow: ellipsis;
|
|
325
|
+
vertical-align: middle;
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
/* A pinned group never scrolls, so its label has nothing to follow: sticking clear of the pinned
|
|
329
|
+
columns would push it to the far end of its own cell. */
|
|
330
|
+
.zx-table__group[data-pin] .zx-table__group-label {
|
|
331
|
+
position: static;
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
.zx-table__scroll[data-sticky-header="true"] .zx-table__group-blank {
|
|
335
|
+
position: sticky;
|
|
336
|
+
z-index: 2;
|
|
277
337
|
inset-block-start: 0;
|
|
278
338
|
}
|
|
279
339
|
|
|
340
|
+
.zx-table__scroll[data-sticky-header="true"] .zx-table__group-row ~ tr > th {
|
|
341
|
+
inset-block-start: var(--zx-table-group-row-size, var(--zx-row-height));
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
/* --- Pinned columns (TableColumn pin) --------------------------------------------------------- */
|
|
345
|
+
|
|
346
|
+
/*
|
|
347
|
+
* A pinned cell sticks to the inline edge of the scroll region at the summed width of the pinned
|
|
348
|
+
* columns before it, which the component measures off the header and publishes on the scroll
|
|
349
|
+
* region (`--zx-table-pin-start-0`…, read here through the cell's own `--zx-table-pin-offset`).
|
|
350
|
+
* Logical insets, so the start edge is the right one in a right-to-left table.
|
|
351
|
+
*
|
|
352
|
+
* Rows are filled on the `<tr>` and cells are see-through, which a cell that other cells scroll
|
|
353
|
+
* under cannot be. A pinned cell therefore paints the row's fill itself, over an opaque base: the
|
|
354
|
+
* hover step, then the stripe or selection fill, then the surface — the same layers the row
|
|
355
|
+
* shows, so it never reads as a different colour from the rest of its row.
|
|
356
|
+
*/
|
|
357
|
+
.zx-table__scroll {
|
|
358
|
+
scroll-padding-inline: var(--zx-table-pin-start, 0px) var(--zx-table-pin-end, 0px);
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
.zx-table :is(th, td)[data-pin] {
|
|
362
|
+
position: sticky;
|
|
363
|
+
z-index: 1;
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
.zx-table :is(th, td)[data-pin="start"] {
|
|
367
|
+
inset-inline-start: var(--zx-table-pin-offset, 0px);
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
.zx-table :is(th, td)[data-pin="end"] {
|
|
371
|
+
inset-inline-end: var(--zx-table-pin-offset, 0px);
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
/* Header cells of pinned columns stay over both the header row and the pinned body cells. */
|
|
375
|
+
.zx-table .zx-table__head :is(th, td)[data-pin] {
|
|
376
|
+
z-index: 3;
|
|
377
|
+
background: var(--zx-table-pin-bg, var(--zx-table-header-bg, var(--zx-color-bg-surface)));
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
.zx-table__body td[data-pin] {
|
|
381
|
+
background:
|
|
382
|
+
linear-gradient(var(--zx-table-pin-hover, transparent), var(--zx-table-pin-hover, transparent)),
|
|
383
|
+
linear-gradient(var(--zx-table-row-fill, transparent), var(--zx-table-row-fill, transparent)),
|
|
384
|
+
var(--zx-table-pin-bg, var(--zx-table-header-bg, var(--zx-color-bg-surface)));
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
.zx-table__body tr[data-row]:hover > td[data-pin] {
|
|
388
|
+
--zx-table-pin-hover: var(--zx-table-row-hover-bg, var(--zx-color-bg-hover));
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
/* The rule between the pinned columns and the ones that scroll under them. */
|
|
392
|
+
.zx-table :is(th, td)[data-pin="start"][data-pin-edge] {
|
|
393
|
+
border-inline-end: 1px solid var(--zx-table-border-color, var(--zx-color-border));
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
.zx-table :is(th, td)[data-pin="end"][data-pin-edge] {
|
|
397
|
+
border-inline-start: 1px solid var(--zx-table-border-color, var(--zx-color-border));
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
/* The row draws its focus ring and its drop marker on the `<tr>`, under the cells; a pinned cell
|
|
401
|
+
is opaque, so it repeats them. */
|
|
402
|
+
.zx-table__body tr[data-row][tabindex]:focus-visible > td[data-pin] {
|
|
403
|
+
box-shadow: inset var(--zx-focus-ring);
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
.zx-table__body tr[data-drop="before"] > td[data-pin] { box-shadow: inset 0 2px 0 var(--zx-color-accent); }
|
|
407
|
+
.zx-table__body tr[data-drop="after"] > td[data-pin] { box-shadow: inset 0 -2px 0 var(--zx-color-accent); }
|
|
408
|
+
|
|
280
409
|
/*
|
|
281
410
|
* Body rows keep one rhythm: a single-line row is exactly `--zx-row-height`, its divider included,
|
|
282
411
|
* whatever the cells hold. On a table cell `block-size` is a minimum, so wrapped text or a taller
|
|
@@ -434,6 +563,11 @@
|
|
|
434
563
|
background: transparent;
|
|
435
564
|
}
|
|
436
565
|
|
|
566
|
+
/* A pinned header cell has cells scrolling under it whether or not the header sticks. */
|
|
567
|
+
.zx-table[data-variant="plain"] .zx-table__scroll[data-sticky-header="false"] th[data-pin] {
|
|
568
|
+
background: var(--zx-table-pin-bg, var(--zx-table-header-bg, var(--zx-color-bg-surface)));
|
|
569
|
+
}
|
|
570
|
+
|
|
437
571
|
/* The stripe's own rule paints this fill, and the hover step lays over it, so nothing more. */
|
|
438
572
|
.zx-table[data-variant="plain"] .zx-table__scroll[data-zebra="true"] .zx-table__body tr:nth-child(even):not([aria-selected="true"]),
|
|
439
573
|
.zx-table[data-variant="plain"] .zx-table__scroll[data-zebra="index"] .zx-table__body tr[data-stripe]:not([aria-selected="true"]) {
|
|
@@ -639,10 +773,19 @@
|
|
|
639
773
|
scroll-margin-block: calc(var(--zx-control-height) + var(--zx-space-2)) var(--zx-space-2);
|
|
640
774
|
}
|
|
641
775
|
|
|
776
|
+
.zx-table[data-header-groups] .zx-table__body > tr[data-row] {
|
|
777
|
+
scroll-margin-block-start: calc(var(--zx-control-height) + var(--zx-row-height) + var(--zx-space-2));
|
|
778
|
+
}
|
|
779
|
+
|
|
642
780
|
.zx-table__body td[data-editing="true"] {
|
|
643
781
|
position: relative;
|
|
644
782
|
}
|
|
645
783
|
|
|
784
|
+
/* A pinned cell is positioned already, and has to stay pinned while it is edited. */
|
|
785
|
+
.zx-table .zx-table__body td[data-editing="true"][data-pin] {
|
|
786
|
+
position: sticky;
|
|
787
|
+
}
|
|
788
|
+
|
|
646
789
|
/* The cell keeps its rendered content while editing — invisible, but still contributing its
|
|
647
790
|
intrinsic width, so no column resizes when an editor opens. */
|
|
648
791
|
.zx-table__cell-shadow {
|
|
@@ -723,6 +866,21 @@
|
|
|
723
866
|
inline-size: 100%;
|
|
724
867
|
}
|
|
725
868
|
|
|
869
|
+
/* A card has no columns to keep a width for, and none to pin. */
|
|
870
|
+
.zx-table[data-stacked] .zx-table__table {
|
|
871
|
+
min-inline-size: 0;
|
|
872
|
+
}
|
|
873
|
+
|
|
874
|
+
.zx-table[data-stacked] .zx-table__body td[data-pin] {
|
|
875
|
+
position: static;
|
|
876
|
+
border-inline: 0;
|
|
877
|
+
background: none;
|
|
878
|
+
}
|
|
879
|
+
|
|
880
|
+
.zx-table[data-stacked] .zx-table__scroll {
|
|
881
|
+
scroll-padding-inline: 0;
|
|
882
|
+
}
|
|
883
|
+
|
|
726
884
|
/* The header is redundant once every cell carries its own label, and its widths would fight the
|
|
727
885
|
card layout. Hidden outright rather than visually: the labels replace it in the a11y tree too. */
|
|
728
886
|
.zx-table[data-stacked] .zx-table__head,
|