@zeyos/zx 5.7.1 → 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 +296 -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 +19 -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 +13 -2
- 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 +11 -0
- 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 +7 -0
- 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 +18 -4
- 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/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 +2998 -451
- 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 +948 -48
- package/dist/zx.esm.js +7432 -3408
- package/dist/zx.esm.min.js +26 -26
- package/dist/zx.global.js +7432 -3408
- package/dist/zx.global.min.js +26 -26
- package/dist/zx.layered.css +950 -48
- 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 +3122 -528
- 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 +697 -100
- 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/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.js +46 -17
- package/src/components/checklist/field-adapter.js +4 -1
- 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 +22 -30
- 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 +70 -25
- 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 +2 -1
- 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 +27 -8
- 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/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 +51 -10
- package/src/core/keyboard.js +83 -9
- package/src/core/messages.js +3 -0
- package/src/core/position.js +2 -2
- 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
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Geometry for `SvgChartAdapter`: a value scale with round ticks, the bars of a category, how
|
|
3
|
+
* often a category label fits, a line with gaps, and the slices and rings of a pie.
|
|
4
|
+
*
|
|
5
|
+
* Plain numbers in, plain numbers and SVG path strings out — no DOM — so the arithmetic is tested
|
|
6
|
+
* on its own (`tests/unit/chart-svg.test.js`). Angles are radians clockwise from twelve o'clock,
|
|
7
|
+
* the way a pie is read; coordinates are SVG user units, y growing downwards. Path coordinates are
|
|
8
|
+
* rounded to two decimals, which is finer than any screen draws and keeps the markup short.
|
|
9
|
+
* @module zx/components/chart/svg-geometry
|
|
10
|
+
*/
|
|
11
|
+
export type NiceScale = {
|
|
12
|
+
/**
|
|
13
|
+
* The lowest tick, at or below the lowest value.
|
|
14
|
+
*/
|
|
15
|
+
min: number;
|
|
16
|
+
/**
|
|
17
|
+
* The highest tick, at or above the highest value.
|
|
18
|
+
*/
|
|
19
|
+
max: number;
|
|
20
|
+
/**
|
|
21
|
+
* The distance between ticks: 1, 2 or 5 × 10ⁿ.
|
|
22
|
+
*/
|
|
23
|
+
step: number;
|
|
24
|
+
/**
|
|
25
|
+
* Every tick from `min` to `max`, distinct and free of float noise
|
|
26
|
+
* (0.3, not 0.30000000000000004).
|
|
27
|
+
*/
|
|
28
|
+
ticks: number[];
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* @typedef {Object} NiceScale
|
|
32
|
+
* @property {number} min The lowest tick, at or below the lowest value.
|
|
33
|
+
* @property {number} max The highest tick, at or above the highest value.
|
|
34
|
+
* @property {number} step The distance between ticks: 1, 2 or 5 × 10ⁿ.
|
|
35
|
+
* @property {number[]} ticks Every tick from `min` to `max`, distinct and free of float noise
|
|
36
|
+
* (0.3, not 0.30000000000000004).
|
|
37
|
+
*/
|
|
38
|
+
/**
|
|
39
|
+
* A linear scale over `[min, max]`, widened outwards to round ticks. A range of one value is
|
|
40
|
+
* widened to zero (or to one when the value is zero), so a flat series still sits on an axis;
|
|
41
|
+
* values that are not finite count as zero. Any finite bounds give a few distinct ticks: the step
|
|
42
|
+
* is never finer than the values can tell apart, and an outer tick a double cannot hold is the
|
|
43
|
+
* largest one it can.
|
|
44
|
+
* @param {number} min Lowest value.
|
|
45
|
+
* @param {number} max Highest value.
|
|
46
|
+
* @param {number} [count=5] About how many intervals the scale should have, 1 to 50.
|
|
47
|
+
* @returns {NiceScale}
|
|
48
|
+
*/
|
|
49
|
+
export declare function niceScale(min: number, max: number, count?: number): NiceScale;
|
|
50
|
+
/**
|
|
51
|
+
* The round step nearest `raw`: 1, 2 or 5 × 10ⁿ, choosing at the geometric midpoints between
|
|
52
|
+
* them, as most axis libraries do.
|
|
53
|
+
* @param {number} raw Unrounded step, positive.
|
|
54
|
+
* @returns {number}
|
|
55
|
+
*/
|
|
56
|
+
export declare function niceStep(raw: number): number;
|
|
57
|
+
/**
|
|
58
|
+
* Maps a value of `[min, max]` to a position of `[from, to]`; the range may run backwards, as a
|
|
59
|
+
* vertical axis does.
|
|
60
|
+
* @param {number} min Domain start.
|
|
61
|
+
* @param {number} max Domain end.
|
|
62
|
+
* @param {number} from Position of `min`.
|
|
63
|
+
* @param {number} to Position of `max`.
|
|
64
|
+
* @returns {(value: number) => number}
|
|
65
|
+
*/
|
|
66
|
+
export declare function linearScale(min: number, max: number, from: number, to: number): (value: number) => number;
|
|
67
|
+
export type BarSlot = {
|
|
68
|
+
/**
|
|
69
|
+
* Left edge.
|
|
70
|
+
*/
|
|
71
|
+
x: number;
|
|
72
|
+
/**
|
|
73
|
+
* Width, never more than its slot.
|
|
74
|
+
*/
|
|
75
|
+
width: number;
|
|
76
|
+
};
|
|
77
|
+
/**
|
|
78
|
+
* @typedef {Object} BarSlot
|
|
79
|
+
* @property {number} x Left edge.
|
|
80
|
+
* @property {number} width Width, never more than its slot.
|
|
81
|
+
*/
|
|
82
|
+
/**
|
|
83
|
+
* Where the bars of one category go: `count` series side by side across the middle 80% of the
|
|
84
|
+
* band, each bar 90% of its slot (at least one unit where the slot has room) and at most
|
|
85
|
+
* `maxWidth` wide, the group centred in the band. A bar never leaves its slot, so in a band too
|
|
86
|
+
* narrow for whole pixels the bars grow thin rather than paint over each other.
|
|
87
|
+
* @param {number} start Left edge of the band.
|
|
88
|
+
* @param {number} band Width of the band.
|
|
89
|
+
* @param {number} count Series in the group, at least 1.
|
|
90
|
+
* @param {number} [maxWidth=Infinity] Widest a bar may be.
|
|
91
|
+
* @returns {BarSlot[]}
|
|
92
|
+
*/
|
|
93
|
+
export declare function barSlots(start: number, band: number, count: number, maxWidth?: number): BarSlot[];
|
|
94
|
+
/**
|
|
95
|
+
* Every how many categories a label is written so that none overlaps the next: 1 when the
|
|
96
|
+
* widest label and a gap fit in one band, more as bands get narrow.
|
|
97
|
+
* @param {number} widest Width of the widest label.
|
|
98
|
+
* @param {number} band Width of one category.
|
|
99
|
+
* @param {number} [gap=0] Least space between two labels.
|
|
100
|
+
* @returns {number} A whole number, at least 1.
|
|
101
|
+
*/
|
|
102
|
+
export declare function labelStep(widest: number, band: number, gap?: number): number;
|
|
103
|
+
/**
|
|
104
|
+
* A polyline through the points, broken where a point is missing: each run of points starts a
|
|
105
|
+
* new subpath, so a gap in the data is a gap in the line.
|
|
106
|
+
* @param {Array<[number, number]|null>} points Positions in order; null where there is no value.
|
|
107
|
+
* @returns {string} SVG path data; empty for no points.
|
|
108
|
+
*/
|
|
109
|
+
export declare function linePath(points: Array<[number, number] | null>): string;
|
|
110
|
+
export type ArcSlice = {
|
|
111
|
+
/**
|
|
112
|
+
* Position of the value in the list.
|
|
113
|
+
*/
|
|
114
|
+
index: number;
|
|
115
|
+
/**
|
|
116
|
+
* The value.
|
|
117
|
+
*/
|
|
118
|
+
value: number;
|
|
119
|
+
/**
|
|
120
|
+
* The value's part of the whole, 0 to 1.
|
|
121
|
+
*/
|
|
122
|
+
share: number;
|
|
123
|
+
/**
|
|
124
|
+
* Start angle.
|
|
125
|
+
*/
|
|
126
|
+
start: number;
|
|
127
|
+
/**
|
|
128
|
+
* End angle.
|
|
129
|
+
*/
|
|
130
|
+
end: number;
|
|
131
|
+
};
|
|
132
|
+
/**
|
|
133
|
+
* @typedef {Object} ArcSlice
|
|
134
|
+
* @property {number} index Position of the value in the list.
|
|
135
|
+
* @property {number} value The value.
|
|
136
|
+
* @property {number} share The value's part of the whole, 0 to 1.
|
|
137
|
+
* @property {number} start Start angle.
|
|
138
|
+
* @property {number} end End angle.
|
|
139
|
+
*/
|
|
140
|
+
/**
|
|
141
|
+
* The slices of a pie: one per positive value, in order clockwise from twelve o'clock, each
|
|
142
|
+
* sweeping its share of the circle. Zero, negative and non-finite values have no slice. With two
|
|
143
|
+
* slices or more, each gives up `padAngle` (half at either edge, never more than half its sweep)
|
|
144
|
+
* so neighbours stand apart whatever lies behind the chart. Shares are taken relative to the
|
|
145
|
+
* largest value, so values whose sum a double cannot hold (1e308 twice) still divide the circle.
|
|
146
|
+
* @param {unknown[]} values Values.
|
|
147
|
+
* @param {number} [padAngle=0] Gap between slices.
|
|
148
|
+
* @returns {ArcSlice[]} Empty when no value is positive.
|
|
149
|
+
*/
|
|
150
|
+
export declare function arcSlices(values: unknown[], padAngle?: number): ArcSlice[];
|
|
151
|
+
export type Ring = {
|
|
152
|
+
/**
|
|
153
|
+
* Outer radius.
|
|
154
|
+
*/
|
|
155
|
+
outer: number;
|
|
156
|
+
/**
|
|
157
|
+
* Inner radius; 0 for the centre of a pie.
|
|
158
|
+
*/
|
|
159
|
+
inner: number;
|
|
160
|
+
};
|
|
161
|
+
/**
|
|
162
|
+
* @typedef {Object} Ring
|
|
163
|
+
* @property {number} outer Outer radius.
|
|
164
|
+
* @property {number} inner Inner radius; 0 for the centre of a pie.
|
|
165
|
+
*/
|
|
166
|
+
/**
|
|
167
|
+
* The rings of a pie or doughnut with several datasets, outermost first: equal thickness between
|
|
168
|
+
* `radius` and the hole, `gap` apart. The gap gives up at most half a ring's share of the radius,
|
|
169
|
+
* so however many datasets there are, each keeps a ring of its own.
|
|
170
|
+
* @param {number} count Rings, at least 1.
|
|
171
|
+
* @param {number} radius Outer radius of the outermost ring.
|
|
172
|
+
* @param {number} [hole=0] Radius of the hole as a fraction of `radius`: 0 for a pie.
|
|
173
|
+
* @param {number} [gap=0] Space between neighbouring rings.
|
|
174
|
+
* @returns {Ring[]}
|
|
175
|
+
*/
|
|
176
|
+
export declare function ringRadii(count: number, radius: number, hole?: number, gap?: number): Ring[];
|
|
177
|
+
/**
|
|
178
|
+
* The outline of a slice: a wedge from the centre when `inner` is 0, a band of a ring otherwise.
|
|
179
|
+
* A sweep of the whole circle is drawn as two half circles (an arc command cannot close on its
|
|
180
|
+
* own start), the hole of a ring the other way round so the default fill rule leaves it empty.
|
|
181
|
+
* @param {number} cx Centre x.
|
|
182
|
+
* @param {number} cy Centre y.
|
|
183
|
+
* @param {number} outer Outer radius.
|
|
184
|
+
* @param {number} inner Inner radius.
|
|
185
|
+
* @param {number} start Start angle.
|
|
186
|
+
* @param {number} end End angle.
|
|
187
|
+
* @returns {string} SVG path data; empty when there is nothing to draw.
|
|
188
|
+
*/
|
|
189
|
+
export declare function arcPath(cx: number, cy: number, outer: number, inner: number, start: number, end: number): string;
|
|
190
|
+
/**
|
|
191
|
+
* The point at `radius` from the centre, `angle` clockwise from twelve o'clock.
|
|
192
|
+
* @param {number} cx @param {number} cy @param {number} radius @param {number} angle
|
|
193
|
+
* @returns {[number, number]}
|
|
194
|
+
*/
|
|
195
|
+
export declare function polar(cx: number, cy: number, radius: number, angle: number): [number, number];
|
|
196
|
+
/**
|
|
197
|
+
* Significant digits a tick label needs so that no two ticks read alike: enough for the largest
|
|
198
|
+
* tick's magnitude down to the step's, whatever unit a compact number format abbreviates to.
|
|
199
|
+
* @param {number[]} ticks Ticks of a `niceScale()`.
|
|
200
|
+
* @param {number} step Its step.
|
|
201
|
+
* @returns {number} 1 to 21.
|
|
202
|
+
*/
|
|
203
|
+
export declare function tickPrecision(ticks: number[], step: number): number;
|
|
@@ -38,10 +38,7 @@ export type CheckButtonOptions = {
|
|
|
38
38
|
*/
|
|
39
39
|
export declare class CheckButton extends Component<CheckButtonOptions> {
|
|
40
40
|
_createdRoot: boolean;
|
|
41
|
-
_original:
|
|
42
|
-
attributes: [string, string][];
|
|
43
|
-
children: Node[];
|
|
44
|
-
};
|
|
41
|
+
_original: import("../../core/dom.js").TargetSnapshot;
|
|
45
42
|
_checked: any;
|
|
46
43
|
_disabled: boolean;
|
|
47
44
|
_labels: {
|
|
@@ -101,6 +101,7 @@ export declare class Checklist extends Component<ChecklistOptions> {
|
|
|
101
101
|
_items: any[] | ChecklistItem[];
|
|
102
102
|
_visibleItems: any[];
|
|
103
103
|
_checked: Set<any> | Set<unknown>;
|
|
104
|
+
_pending: any;
|
|
104
105
|
_query: string;
|
|
105
106
|
_loadSequence: number;
|
|
106
107
|
_createdRoot: boolean;
|
|
@@ -114,7 +115,9 @@ export declare class Checklist extends Component<ChecklistOptions> {
|
|
|
114
115
|
/** @returns {HTMLElement} */
|
|
115
116
|
render(): HTMLElement;
|
|
116
117
|
/**
|
|
117
|
-
* Replaces items and derives checked state from `checkedKey` and `defaultChecked
|
|
118
|
+
* Replaces items and derives checked state from `checkedKey` and `defaultChecked` — unless
|
|
119
|
+
* `setValues()` asked for IDs the earlier items did not have yet, in which case the requested
|
|
120
|
+
* values are checked instead.
|
|
118
121
|
* @param {ChecklistItem[]} items New items.
|
|
119
122
|
* @returns {this}
|
|
120
123
|
*/
|
|
@@ -131,10 +134,16 @@ export declare class Checklist extends Component<ChecklistOptions> {
|
|
|
131
134
|
disable(): this;
|
|
132
135
|
/** Whether the checklist is disabled. @returns {boolean} */
|
|
133
136
|
isDisabled(): boolean;
|
|
134
|
-
/**
|
|
137
|
+
/**
|
|
138
|
+
* Returns checked IDs in item order, followed by requested IDs whose items have not been loaded
|
|
139
|
+
* yet (see `setValues()`).
|
|
140
|
+
* @returns {unknown[]}
|
|
141
|
+
*/
|
|
135
142
|
getValues(): unknown[];
|
|
136
143
|
/**
|
|
137
|
-
* Replaces the checked IDs.
|
|
144
|
+
* Replaces the checked IDs. IDs that none of the current items carries are kept as requested,
|
|
145
|
+
* and checked as soon as items carrying them arrive — through `setItems()` or the `load`
|
|
146
|
+
* loader — so a value set before the items load is not lost.
|
|
138
147
|
* @param {Iterable<unknown>|unknown[]} ids Checked item IDs.
|
|
139
148
|
* @returns {this}
|
|
140
149
|
* @fires Checklist#change
|
|
@@ -166,8 +175,13 @@ export declare class Checklist extends Component<ChecklistOptions> {
|
|
|
166
175
|
_syncDisabled(): void;
|
|
167
176
|
/** @param {string|null|undefined} label @returns {string} */
|
|
168
177
|
_labelText(label: string | null | undefined): string;
|
|
169
|
-
/**
|
|
170
|
-
|
|
178
|
+
/**
|
|
179
|
+
* @param {Set<unknown>} next
|
|
180
|
+
* @param {unknown[]|null} pending Requested IDs no item carries yet, or null when no request waits
|
|
181
|
+
* for items; an empty array is a request made before any item existed.
|
|
182
|
+
* @returns {void}
|
|
183
|
+
*/
|
|
184
|
+
_replaceChecked(next: Set<unknown>, pending: unknown[] | null): void;
|
|
171
185
|
/** @param {ChecklistItem} item @returns {unknown} */
|
|
172
186
|
_itemValue(item: ChecklistItem): unknown;
|
|
173
187
|
/** @param {ChecklistItem} item @returns {string} */
|
|
@@ -26,7 +26,13 @@ export type CodeEditorOptions = {
|
|
|
26
26
|
*/
|
|
27
27
|
rows?: number;
|
|
28
28
|
/**
|
|
29
|
-
* Text inserted by Tab and removed by Shift+Tab
|
|
29
|
+
* Text inserted by Tab and removed by Shift+Tab — a tab by
|
|
30
|
+
* default, `' '` for two spaces. While it is non-empty the editor captures Tab: Tab inserts it at
|
|
31
|
+
* the caret or indents every selected line, Shift+Tab outdents them, and focus stays in the
|
|
32
|
+
* editor. Escape releases the capture for the next keystroke, so Escape then Tab (or Shift+Tab)
|
|
33
|
+
* moves focus on. `indent: ''` switches the capture off: Tab and Shift+Tab move focus as in any
|
|
34
|
+
* other field and nothing is indented. Tab with Ctrl, Alt or Meta, and Tab in a read-only or
|
|
35
|
+
* disabled editor, are never captured.
|
|
30
36
|
*/
|
|
31
37
|
indent?: string;
|
|
32
38
|
/**
|
|
@@ -61,6 +67,13 @@ export type CodeEditorOptions = {
|
|
|
61
67
|
onchange?: (event: CustomEvent<{
|
|
62
68
|
value: string;
|
|
63
69
|
}>) => void;
|
|
70
|
+
/**
|
|
71
|
+
* Listener called when
|
|
72
|
+
* `setHighlight()` puts the editor in its error state.
|
|
73
|
+
*/
|
|
74
|
+
oninvalid?: (event: CustomEvent<{
|
|
75
|
+
message: string;
|
|
76
|
+
}>) => void;
|
|
64
77
|
};
|
|
65
78
|
/**
|
|
66
79
|
* Dependency-free source editor for structured text, Markdown, JSON and code. It deliberately uses
|
|
@@ -70,8 +83,13 @@ export type CodeEditorOptions = {
|
|
|
70
83
|
* Capturing Tab is what a code surface has to do, and it would be a keyboard trap if nothing undid
|
|
71
84
|
* it: Escape releases the capture until the next keystroke in the editor, so Escape then Tab (or
|
|
72
85
|
* Shift+Tab) moves focus out of the editor as it would leave any other field.
|
|
86
|
+
*
|
|
87
|
+
* A standalone editor reports a validation or status message the way a Field does, with
|
|
88
|
+
* `setHighlight()` and `clearHighlight()`. Inside a Field (the `code` field type) the Field's own
|
|
89
|
+
* message is the one to set; it marks the editor's textarea invalid and the frame follows.
|
|
73
90
|
* @fires CodeEditor#input
|
|
74
91
|
* @fires CodeEditor#change
|
|
92
|
+
* @fires CodeEditor#invalid
|
|
75
93
|
* @extends {Component<CodeEditorOptions>}
|
|
76
94
|
*/
|
|
77
95
|
export declare class CodeEditor extends Component<CodeEditorOptions> {
|
|
@@ -83,6 +101,7 @@ export declare class CodeEditor extends Component<CodeEditorOptions> {
|
|
|
83
101
|
_position: HTMLElement;
|
|
84
102
|
_header: HTMLElement;
|
|
85
103
|
_input: HTMLTextAreaElement;
|
|
104
|
+
_highlight: HTMLElement;
|
|
86
105
|
_committedValue: any;
|
|
87
106
|
_indentEditing: boolean;
|
|
88
107
|
/** Set by Escape: the next Tab moves focus instead of indenting. */
|
|
@@ -105,6 +124,29 @@ export declare class CodeEditor extends Component<CodeEditorOptions> {
|
|
|
105
124
|
}): this;
|
|
106
125
|
/** @param {unknown} language New language identifier. @returns {this} */
|
|
107
126
|
setLanguage(language: unknown): this;
|
|
127
|
+
/**
|
|
128
|
+
* Returns the native textarea — the element that carries the editor's name, validity and
|
|
129
|
+
* description, and the one a `<label for>` or a Field labels.
|
|
130
|
+
* @returns {HTMLTextAreaElement}
|
|
131
|
+
*/
|
|
132
|
+
getInput(): HTMLTextAreaElement;
|
|
133
|
+
/**
|
|
134
|
+
* Displays a validation or status message under the text, as `Field#setHighlight()` does for a
|
|
135
|
+
* field: the kind is reflected as `data-state` on the root, and `'danger'` is the error state —
|
|
136
|
+
* the textarea gets `aria-invalid="true"`, the message is announced as an alert, the frame takes
|
|
137
|
+
* the danger colour, and `invalid` is emitted. The message is the textarea's description
|
|
138
|
+
* (`aria-describedby`) for as long as it is shown. An empty message clears it.
|
|
139
|
+
* @param {string} message Message text.
|
|
140
|
+
* @param {'danger'|'warning'|'success'} [kind='danger'] Message kind.
|
|
141
|
+
* @returns {this}
|
|
142
|
+
* @fires CodeEditor#invalid
|
|
143
|
+
*/
|
|
144
|
+
setHighlight(message: string, kind?: 'danger' | 'warning' | 'success'): this;
|
|
145
|
+
/**
|
|
146
|
+
* Clears the current validation or status message.
|
|
147
|
+
* @returns {this}
|
|
148
|
+
*/
|
|
149
|
+
clearHighlight(): this;
|
|
108
150
|
/** @returns {this} */
|
|
109
151
|
focus(): this;
|
|
110
152
|
/** @returns {this} */
|
|
@@ -115,6 +157,13 @@ export declare class CodeEditor extends Component<CodeEditorOptions> {
|
|
|
115
157
|
setReadOnly(value: boolean): this;
|
|
116
158
|
/** @param {KeyboardEvent} event @returns {void} */
|
|
117
159
|
_handleKeydown(event: KeyboardEvent): void;
|
|
160
|
+
/**
|
|
161
|
+
* Adds the message to, or takes it out of, the textarea's `aria-describedby`, leaving any id
|
|
162
|
+
* something else put there (a Field's description) in place.
|
|
163
|
+
* @param {boolean} described Whether the message describes the textarea.
|
|
164
|
+
* @returns {void}
|
|
165
|
+
*/
|
|
166
|
+
_describe(described: boolean): void;
|
|
118
167
|
/** Commits once, whether the browser emits change before blur or the fallback edited text. @returns {void} */
|
|
119
168
|
_commitValue(): void;
|
|
120
169
|
/** @returns {void} */
|
|
@@ -152,3 +201,8 @@ export declare function editorPosition(value: string, start: number, end?: numbe
|
|
|
152
201
|
* @event CodeEditor#change
|
|
153
202
|
* @type {CustomEvent<{value:string}>}
|
|
154
203
|
*/
|
|
204
|
+
/**
|
|
205
|
+
* Emitted when `setHighlight()` puts the editor in its error state (`kind: 'danger'`).
|
|
206
|
+
* @event CodeEditor#invalid
|
|
207
|
+
* @type {CustomEvent<{message:string}>}
|
|
208
|
+
*/
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { Component } from '../../core/component.js';
|
|
2
|
+
import { AgentAvatar } from '../agent-avatar/agent-avatar.js';
|
|
3
|
+
import { Dialog } from '../dialog/dialog.js';
|
|
2
4
|
import { Launcher } from '../launcher/launcher.js';
|
|
3
5
|
export type LauncherItem = import('../launcher/launcher.js').LauncherItem;
|
|
4
6
|
export type MentionItem = {
|
|
@@ -18,6 +20,12 @@ export type MentionItem = {
|
|
|
18
20
|
* Icon name drawn before the label.
|
|
19
21
|
*/
|
|
20
22
|
icon?: string;
|
|
23
|
+
/**
|
|
24
|
+
* Draws the item as an
|
|
25
|
+
* agent: its AgentAvatar, still, in place of `icon` — these options, or `true` to derive it from
|
|
26
|
+
* the label. An activity's word joins the option's accessible name.
|
|
27
|
+
*/
|
|
28
|
+
agent?: import('../../internal/app-rail.js').AppNavAgent | true;
|
|
21
29
|
};
|
|
22
30
|
export type MentionSource = {
|
|
23
31
|
/**
|
|
@@ -235,8 +243,9 @@ export type ComposerOptions = {
|
|
|
235
243
|
busy?: boolean;
|
|
236
244
|
/**
|
|
237
245
|
* Whether the send key holds a message back while the agent works.
|
|
238
|
-
* It is sent when the agent is no longer busy, one message each time busy ends, in order
|
|
239
|
-
*
|
|
246
|
+
* It is sent when the agent is no longer busy, one message each time busy ends, in order; busy that
|
|
247
|
+
* ends while the composer is disabled sends when it is enabled again. The queue lives as long as
|
|
248
|
+
* the composer: it is not kept with the draft.
|
|
240
249
|
*/
|
|
241
250
|
queue?: boolean;
|
|
242
251
|
/**
|
|
@@ -398,7 +407,9 @@ export declare function mentionQuery(text: string, caret: number, trigger?: stri
|
|
|
398
407
|
*/
|
|
399
408
|
export declare function filterMentions(items: MentionItem[], query: string): MentionItem[];
|
|
400
409
|
/**
|
|
401
|
-
* The picked mentions whose `@<label>` is still in the text, each once
|
|
410
|
+
* The picked mentions whose `@<label>` is still in the text as a whole mention, each once: not
|
|
411
|
+
* right after a letter or digit (`ann@ledger.example` mentions nobody) and not right before one
|
|
412
|
+
* (`@Annabel` does not mention Ann), in any script — the rule AgentThread marks mentions by.
|
|
402
413
|
* @param {string} text
|
|
403
414
|
* @param {MentionItem[]} mentions Mentions in the order they were picked.
|
|
404
415
|
* @param {string} [trigger='@']
|
|
@@ -497,6 +508,15 @@ export declare function normalizeTools(tools: unknown): ComposerTool[];
|
|
|
497
508
|
*/
|
|
498
509
|
export declare class Composer extends Component<ComposerOptions> {
|
|
499
510
|
_original: import("../../core/dom.js").TargetSnapshot;
|
|
511
|
+
/**
|
|
512
|
+
* The faces of agent mentions, one per item id, reused while the list redraws on every
|
|
513
|
+
* keystroke and destroyed with the composer.
|
|
514
|
+
* @type {Map<string, {signature: string, avatar: AgentAvatar}>}
|
|
515
|
+
*/
|
|
516
|
+
_mentionFaces: Map<string, {
|
|
517
|
+
signature: string;
|
|
518
|
+
avatar: AgentAvatar;
|
|
519
|
+
}>;
|
|
500
520
|
/** @type {{id: string, file: File}[]} */
|
|
501
521
|
_files: {
|
|
502
522
|
id: string;
|
|
@@ -537,6 +557,10 @@ export declare class Composer extends Component<ComposerOptions> {
|
|
|
537
557
|
/** Whether a queued message is being sent, and whether busy ended again meanwhile. */
|
|
538
558
|
_sendingQueued: boolean;
|
|
539
559
|
_busyEndedAgain: boolean;
|
|
560
|
+
/** Whether busy ended while input was off, so a queued message goes when it is back on. */
|
|
561
|
+
_sendOwed: boolean;
|
|
562
|
+
/** @type {Dialog|null} The question before a queued message replaces the text, while it is open. */
|
|
563
|
+
_confirm: Dialog | null;
|
|
540
564
|
/** The application's hint, which `_syncHint()` shows unless the queue has something to say. */
|
|
541
565
|
_hint: string;
|
|
542
566
|
_mentionSource: {
|
|
@@ -585,7 +609,8 @@ export declare class Composer extends Component<ComposerOptions> {
|
|
|
585
609
|
clear(): this;
|
|
586
610
|
/**
|
|
587
611
|
* Shows Stop in place of Send while an agent works; Escape in the text then emits `stop`. When
|
|
588
|
-
* busy ends, the first queued message is sent; the next waits for the next time it ends.
|
|
612
|
+
* busy ends, the first queued message is sent; the next waits for the next time it ends. Busy
|
|
613
|
+
* that ends while the composer is disabled sends when it is enabled again.
|
|
589
614
|
* @param {boolean} busy
|
|
590
615
|
* @returns {this}
|
|
591
616
|
* @fires Composer#send
|
|
@@ -609,9 +634,12 @@ export declare class Composer extends Component<ComposerOptions> {
|
|
|
609
634
|
*/
|
|
610
635
|
setNote(text: string): this;
|
|
611
636
|
/**
|
|
612
|
-
* Turns input on or off.
|
|
637
|
+
* Turns input on or off. Turned back on, it sends the queued message that an end of busy owed
|
|
638
|
+
* while it was off.
|
|
613
639
|
* @param {boolean} disabled
|
|
614
640
|
* @returns {this}
|
|
641
|
+
* @fires Composer#send
|
|
642
|
+
* @fires Composer#dequeue
|
|
615
643
|
*/
|
|
616
644
|
setDisabled(disabled: boolean): this;
|
|
617
645
|
/**
|
|
@@ -763,7 +791,14 @@ export declare class Composer extends Component<ComposerOptions> {
|
|
|
763
791
|
*/
|
|
764
792
|
private _highlight;
|
|
765
793
|
/** @private @returns {void} */
|
|
766
|
-
|
|
794
|
+
/**
|
|
795
|
+
* The AgentAvatar an agent mention draws, kept per item id and rebuilt only when the item changes.
|
|
796
|
+
* @private
|
|
797
|
+
* @param {MentionItem} item
|
|
798
|
+
* @returns {AgentAvatar|null}
|
|
799
|
+
*/
|
|
800
|
+
private _mentionFace;
|
|
801
|
+
_closeMentions(): void;
|
|
767
802
|
/**
|
|
768
803
|
* Writes `@<label> ` where the mention was typed and records the item.
|
|
769
804
|
* @private
|
|
@@ -18,11 +18,7 @@ export type ContextMenuOptions = {
|
|
|
18
18
|
/**
|
|
19
19
|
* Selection listener.
|
|
20
20
|
*/
|
|
21
|
-
onselect?: (event: CustomEvent<
|
|
22
|
-
value: unknown;
|
|
23
|
-
item: MenuItem;
|
|
24
|
-
context: Element | null;
|
|
25
|
-
}>) => void;
|
|
21
|
+
onselect?: (event: CustomEvent<ContextMenuSelectDetail>) => void;
|
|
26
22
|
/**
|
|
27
23
|
* Open listener.
|
|
28
24
|
*/
|
|
@@ -34,6 +30,25 @@ export type ContextMenuOptions = {
|
|
|
34
30
|
*/
|
|
35
31
|
onclose?: (event: CustomEvent<Record<string, never>>) => void;
|
|
36
32
|
};
|
|
33
|
+
export type ContextMenuSelectDetail = {
|
|
34
|
+
/**
|
|
35
|
+
* The chosen item's value.
|
|
36
|
+
*/
|
|
37
|
+
value: unknown;
|
|
38
|
+
/**
|
|
39
|
+
* The chosen item, as the application gave it.
|
|
40
|
+
*/
|
|
41
|
+
item: MenuItem;
|
|
42
|
+
/**
|
|
43
|
+
* The element the menu was opened on.
|
|
44
|
+
*/
|
|
45
|
+
context: Element | null;
|
|
46
|
+
/**
|
|
47
|
+
* For a `menuitemcheckbox` or `menuitemradio`, the state choosing it
|
|
48
|
+
* gives the item: a checkbox toggles, a radio is checked. Absent for a plain item.
|
|
49
|
+
*/
|
|
50
|
+
checked?: boolean;
|
|
51
|
+
};
|
|
37
52
|
/** @typedef {import('../../internal/menu-items.js').MenuItem} MenuItem */
|
|
38
53
|
/**
|
|
39
54
|
* A context menu's entries: the shared menu model without `choice` rows, which a menu that closes
|
|
@@ -49,11 +64,18 @@ export type ContextMenuOptions = {
|
|
|
49
64
|
* @property {string|null} [selector=null] Restricts the menu to descendants matching this
|
|
50
65
|
* selector, and reports the matched element as the context of the selection. A table passes
|
|
51
66
|
* `'tbody tr'` here to get a per-row menu from one listener.
|
|
52
|
-
* @property {(event: CustomEvent<
|
|
53
|
-
* Selection listener.
|
|
67
|
+
* @property {(event: CustomEvent<ContextMenuSelectDetail>) => void} [onselect] Selection listener.
|
|
54
68
|
* @property {(event: CustomEvent<{context: Element|null}>) => void} [onopen] Open listener.
|
|
55
69
|
* @property {(event: CustomEvent<Record<string, never>>) => void} [onclose] Close listener.
|
|
56
70
|
*/
|
|
71
|
+
/**
|
|
72
|
+
* @typedef {Object} ContextMenuSelectDetail
|
|
73
|
+
* @property {unknown} value The chosen item's value.
|
|
74
|
+
* @property {MenuItem} item The chosen item, as the application gave it.
|
|
75
|
+
* @property {Element|null} context The element the menu was opened on.
|
|
76
|
+
* @property {boolean} [checked] For a `menuitemcheckbox` or `menuitemradio`, the state choosing it
|
|
77
|
+
* gives the item: a checkbox toggles, a radio is checked. Absent for a plain item.
|
|
78
|
+
*/
|
|
57
79
|
/**
|
|
58
80
|
* Right-click menu for a region, implementing the APG menu pattern.
|
|
59
81
|
*
|
|
@@ -67,6 +89,11 @@ export type ContextMenuOptions = {
|
|
|
67
89
|
* menus are a common accessibility failure, so both routes are wired here rather than left to the
|
|
68
90
|
* application.
|
|
69
91
|
*
|
|
92
|
+
* Choosing a `menuitemcheckbox` toggles its `aria-checked`, and choosing a `menuitemradio` checks
|
|
93
|
+
* it and unchecks the other radio items of its section (between separators or headings); the new
|
|
94
|
+
* state arrives as `detail.checked`. A prevented `select` keeps the state as it was. Items given as
|
|
95
|
+
* a function are resolved again on every opening, so there the function's answer is the state.
|
|
96
|
+
*
|
|
70
97
|
* Note that the component's root is the anchor, which lives on `<body>` — so the bubbling `zx-*`
|
|
71
98
|
* DOM events land there, not in the target's tree. Listen with `on('select')` or `onselect`.
|
|
72
99
|
*
|
|
@@ -135,8 +162,9 @@ export declare class ContextMenu extends Component<ContextMenuOptions> {
|
|
|
135
162
|
}
|
|
136
163
|
/**
|
|
137
164
|
* Fired when an enabled item is activated. `context` is the element the menu was opened on.
|
|
165
|
+
* Preventing it keeps the menu open and a checkbox or radio item's state unchanged.
|
|
138
166
|
* @event ContextMenu#select
|
|
139
|
-
* @type {CustomEvent<
|
|
167
|
+
* @type {CustomEvent<ContextMenuSelectDetail>}
|
|
140
168
|
*/
|
|
141
169
|
/**
|
|
142
170
|
* Fired when the menu opens.
|
|
@@ -35,6 +35,12 @@ export type CopyButtonOptions = {
|
|
|
35
35
|
* the clipboard accepted it.
|
|
36
36
|
*/
|
|
37
37
|
oncopy?: (text: string, copied: boolean) => void;
|
|
38
|
+
/**
|
|
39
|
+
* Ends the button's life: aborting removes its click listener,
|
|
40
|
+
* stops a pending confirmation, and makes a copy still waiting on the clipboard report nothing.
|
|
41
|
+
* For a button owned by something that is destroyed before the page is.
|
|
42
|
+
*/
|
|
43
|
+
signal?: AbortSignal;
|
|
38
44
|
};
|
|
39
45
|
/**
|
|
40
46
|
* Creates a button that copies a string and confirms it in place.
|
|
@@ -60,6 +60,7 @@ export type CopyInputOptions = {
|
|
|
60
60
|
export declare class CopyInput extends Component<CopyInputOptions> {
|
|
61
61
|
_createdRoot: boolean;
|
|
62
62
|
_snapshot: import("../../core/dom.js").TargetSnapshot;
|
|
63
|
+
_buttonLife: AbortController;
|
|
63
64
|
static cssName: string;
|
|
64
65
|
/** @type {CopyInputOptions} */
|
|
65
66
|
static defaults: CopyInputOptions;
|
|
@@ -143,3 +143,17 @@ export declare class DatePicker extends Component<DatePickerOptions> {
|
|
|
143
143
|
*/
|
|
144
144
|
_message(key: string, fallback: string, ...args: unknown[]): string;
|
|
145
145
|
}
|
|
146
|
+
/**
|
|
147
|
+
* ISO 8601 week number of a local calendar day.
|
|
148
|
+
* @param {Date} date Any time on the day.
|
|
149
|
+
* @returns {number}
|
|
150
|
+
*/
|
|
151
|
+
export declare function isoWeekNumber(date: Date): number;
|
|
152
|
+
/**
|
|
153
|
+
* ISO week number for a calendar row of seven days starting on `rowStart`. A row that does not
|
|
154
|
+
* start on Monday straddles two ISO weeks; its Thursday always falls in the week that holds most of
|
|
155
|
+
* the row (for a Sunday start, Monday to Saturday), which is the week the row is labelled with.
|
|
156
|
+
* @param {Date} rowStart First day of the row.
|
|
157
|
+
* @returns {number}
|
|
158
|
+
*/
|
|
159
|
+
export declare function rowWeekNumber(rowStart: Date): number;
|
|
@@ -46,16 +46,8 @@ export type ClockMark = {
|
|
|
46
46
|
* @extends {Component<TimePickerOptions>}
|
|
47
47
|
*/
|
|
48
48
|
export declare class TimePicker extends Component<TimePickerOptions> {
|
|
49
|
-
_value:
|
|
50
|
-
|
|
51
|
-
m: number;
|
|
52
|
-
s: number;
|
|
53
|
-
};
|
|
54
|
-
_display: TimePickerValue | {
|
|
55
|
-
h: number;
|
|
56
|
-
m: number;
|
|
57
|
-
s: number;
|
|
58
|
-
};
|
|
49
|
+
_value: any;
|
|
50
|
+
_display: any;
|
|
59
51
|
_inputs: any[];
|
|
60
52
|
_clockOpen: boolean;
|
|
61
53
|
/** @type {ClockUnit} */
|
|
@@ -110,20 +102,28 @@ export declare class TimePicker extends Component<TimePickerOptions> {
|
|
|
110
102
|
*/
|
|
111
103
|
_buildClock(id: string): HTMLElement;
|
|
112
104
|
/**
|
|
113
|
-
* Applies a mark's value to the active unit
|
|
114
|
-
* be set with two clicks
|
|
105
|
+
* Applies a mark's value to the active unit. An explicit pick (click, Enter, Space) of an hour
|
|
106
|
+
* then moves on to the minutes so a whole time can be set with two clicks; arrowing through the
|
|
107
|
+
* radio group passes `advance: false` and stays on the dial it is in.
|
|
115
108
|
* @param {number} value Hour or minute the mark stands for.
|
|
109
|
+
* @param {{advance?: boolean}} [options={}] Whether an hour pick opens the minute dial.
|
|
116
110
|
* @returns {void}
|
|
117
111
|
*/
|
|
118
|
-
_pick(value: number
|
|
112
|
+
_pick(value: number, { advance }?: {
|
|
113
|
+
advance?: boolean;
|
|
114
|
+
}): void;
|
|
119
115
|
/** @param {KeyboardEvent} event @returns {void} */
|
|
120
116
|
_onDialKeydown(event: KeyboardEvent): void;
|
|
121
117
|
/** Reflects the open state, the active unit, the marks, and the hand. @returns {void} */
|
|
122
118
|
_syncClock(): void;
|
|
123
|
-
/** @param {ClockMark} mark @param {number} selected @returns {HTMLElement} */
|
|
124
|
-
_buildMark(mark: ClockMark, selected: number): HTMLElement;
|
|
125
|
-
/**
|
|
126
|
-
|
|
119
|
+
/** @param {ClockMark} mark @param {number} selected @param {number} stop @returns {HTMLElement} */
|
|
120
|
+
_buildMark(mark: ClockMark, selected: number, stop: number): HTMLElement;
|
|
121
|
+
/**
|
|
122
|
+
* @param {HTMLElement} element @param {ClockMark} mark @param {number} selected
|
|
123
|
+
* @param {number} stop Value of the one mark in the Tab order.
|
|
124
|
+
* @returns {void}
|
|
125
|
+
*/
|
|
126
|
+
_syncMark(element: HTMLElement, mark: ClockMark, selected: number, stop: number): void;
|
|
127
127
|
/**
|
|
128
128
|
* Resolves a message through the host translator, falling back to the built-in English text.
|
|
129
129
|
* @param {string} key Message key.
|
|
@@ -132,3 +132,12 @@ export declare class TimePicker extends Component<TimePickerOptions> {
|
|
|
132
132
|
*/
|
|
133
133
|
_message(key: string, fallback: string): string;
|
|
134
134
|
}
|
|
135
|
+
/**
|
|
136
|
+
* The mark that takes the dial's Tab stop: the checked one, or — when the value falls between
|
|
137
|
+
* marks, as 12:07 does on a five-minute dial — the nearest, so the group is always reachable.
|
|
138
|
+
* @param {ClockMark[]} marks Marks on the dial.
|
|
139
|
+
* @param {number} selected Current hour or minute.
|
|
140
|
+
* @param {number} cycle Values around the dial (24 or 60).
|
|
141
|
+
* @returns {number}
|
|
142
|
+
*/
|
|
143
|
+
export declare function tabStop(marks: ClockMark[], selected: number, cycle: number): number;
|