@fusion.dev/helix-headless 0.144.0 → 0.146.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/custom-elements.json +15195 -4240
- package/dist/accordion/item/accordion-item.d.ts +62 -12
- package/dist/accordion/item/accordion-item.js +41 -10
- package/dist/accordion/root/accordion-root.d.ts +14 -5
- package/dist/accordion/root/accordion-root.js +7 -1
- package/dist/announcement/root/announcement-root.d.ts +24 -3
- package/dist/announcement/root/announcement-root.js +39 -2
- package/dist/app-header/root/app-header-root.d.ts +12 -0
- package/dist/app-header/root/app-header-root.js +13 -1
- package/dist/app-header/sectioning.d.ts +9 -0
- package/dist/app-header/sectioning.js +27 -0
- package/dist/avatar/group/avatar-group.d.ts +20 -14
- package/dist/avatar/group/avatar-group.js +17 -19
- package/dist/badge/root/badge-root.d.ts +3 -1
- package/dist/badge/root/badge-root.js +2 -2
- package/dist/bar-chart/root/bar-chart-root.d.ts +18 -1
- package/dist/bar-chart/root/bar-chart-root.js +52 -15
- package/dist/bar-chart/stack.d.ts +15 -0
- package/dist/bar-chart/stack.js +19 -0
- package/dist/breadcrumbs/root/breadcrumbs-root.d.ts +57 -1
- package/dist/breadcrumbs/root/breadcrumbs-root.js +73 -3
- package/dist/button/root/button-root.d.ts +26 -0
- package/dist/button/root/button-root.js +38 -18
- package/dist/button-group/root/button-group-root.d.ts +2 -1
- package/dist/button-group/root/button-group-root.js +5 -1
- package/dist/canvas/node/canvas-node.d.ts +4 -3
- package/dist/canvas/node/canvas-node.js +3 -2
- package/dist/canvas/root/canvas-root.d.ts +38 -3
- package/dist/canvas/root/canvas-root.js +123 -42
- package/dist/card/root/card-root.d.ts +24 -3
- package/dist/card/root/card-root.js +20 -8
- package/dist/carousel/root/carousel-root.d.ts +133 -4
- package/dist/carousel/root/carousel-root.js +174 -24
- package/dist/carousel/stops.d.ts +20 -0
- package/dist/carousel/stops.js +30 -0
- package/dist/chat/composer/chat-composer.d.ts +38 -6
- package/dist/chat/composer/chat-composer.js +42 -9
- package/dist/chat/message/chat-message.d.ts +32 -1
- package/dist/chat/message/chat-message.js +27 -10
- package/dist/chat/naming.d.ts +26 -0
- package/dist/chat/naming.js +14 -0
- package/dist/chat/root/chat-root.d.ts +58 -0
- package/dist/chat/root/chat-root.js +43 -3
- package/dist/checkbox/root/checkbox-root.d.ts +20 -0
- package/dist/checkbox/root/checkbox-root.js +14 -1
- package/dist/checkbox-group/root/checkbox-group-root.d.ts +8 -2
- package/dist/checkbox-group/root/checkbox-group-root.js +12 -10
- package/dist/checkbox-group/select-all.d.ts +27 -0
- package/dist/checkbox-group/select-all.js +12 -0
- package/dist/code-block/highlight.d.ts +15 -0
- package/dist/code-block/highlight.js +4 -0
- package/dist/code-block/root/code-block-root.d.ts +57 -2
- package/dist/code-block/root/code-block-root.js +63 -8
- package/dist/color-input/root/color-input-root.d.ts +3 -0
- package/dist/color-input/root/color-input-root.js +6 -3
- package/dist/color-picker/root/color-picker-root.d.ts +33 -4
- package/dist/color-picker/root/color-picker-root.js +80 -21
- package/dist/color-picker/swatches.d.ts +12 -0
- package/dist/color-picker/swatches.js +26 -0
- package/dist/combobox/root/combobox-root.d.ts +43 -0
- package/dist/combobox/root/combobox-root.js +79 -15
- package/dist/command/root/command-root.d.ts +16 -1
- package/dist/command/root/command-root.js +22 -4
- package/dist/copy-button/root/copy-button-root.d.ts +26 -1
- package/dist/copy-button/root/copy-button-root.js +12 -5
- package/dist/data-table/index.d.ts +1 -1
- package/dist/data-table/index.js +1 -1
- package/dist/data-table/keys.d.ts +24 -0
- package/dist/data-table/keys.js +24 -0
- package/dist/data-table/root/data-table-root.d.ts +170 -13
- package/dist/data-table/root/data-table-root.js +294 -52
- package/dist/data-table/tree.d.ts +55 -0
- package/dist/data-table/tree.js +54 -0
- package/dist/date-input/root/date-input-root.d.ts +3 -1
- package/dist/date-input/root/date-input-root.js +18 -7
- package/dist/date-picker/root/date-picker-root.js +12 -6
- package/dist/description-list/item/description-list-item.d.ts +17 -2
- package/dist/description-list/item/description-list-item.js +15 -2
- package/dist/description-list/root/description-list-root.d.ts +27 -1
- package/dist/description-list/root/description-list-root.js +26 -1
- package/dist/dialog/description.js +15 -1
- package/dist/dialog/root/dialog-root.d.ts +8 -2
- package/dist/dialog/root/dialog-root.js +16 -1
- package/dist/divider/root/divider-root.d.ts +3 -0
- package/dist/divider/root/divider-root.js +2 -1
- package/dist/donut-chart/root/donut-chart-root.d.ts +31 -0
- package/dist/donut-chart/root/donut-chart-root.js +48 -1
- package/dist/drawer/reveal.d.ts +8 -0
- package/dist/drawer/reveal.js +1 -0
- package/dist/drawer/root/drawer-root.d.ts +59 -0
- package/dist/drawer/root/drawer-root.js +63 -4
- package/dist/drilldown/item/drilldown-item.d.ts +11 -6
- package/dist/drilldown/item/drilldown-item.js +8 -5
- package/dist/drilldown/root/drilldown-root.d.ts +29 -0
- package/dist/drilldown/root/drilldown-root.js +28 -5
- package/dist/element-events.generated.js +83 -12
- package/dist/empty/root/empty-root.d.ts +3 -1
- package/dist/empty/root/empty-root.js +3 -2
- package/dist/file-input/root/file-input-root.d.ts +69 -6
- package/dist/file-input/root/file-input-root.js +82 -19
- package/dist/file-input/screen.d.ts +2 -1
- package/dist/filter-input/menu/filter-menu.d.ts +5 -0
- package/dist/filter-input/menu/filter-menu.js +16 -4
- package/dist/filter-input/root/filter-input-root.d.ts +30 -6
- package/dist/filter-input/root/filter-input-root.js +1 -1
- package/dist/filter-input/suggest.d.ts +28 -3
- package/dist/filter-input/suggest.js +18 -8
- package/dist/format-date/root/format-date-root.d.ts +9 -16
- package/dist/format-date/root/format-date-root.js +10 -27
- package/dist/heatmap/root/heatmap-root.d.ts +24 -13
- package/dist/heatmap/root/heatmap-root.js +34 -12
- package/dist/icon/root/icon-root.d.ts +12 -1
- package/dist/icon/root/icon-root.js +21 -10
- package/dist/icon/settle.d.ts +7 -0
- package/dist/icon/settle.js +10 -0
- package/dist/icon-button/root/icon-button-root.d.ts +2 -0
- package/dist/image/root/image-root.d.ts +5 -1
- package/dist/image/root/image-root.js +10 -2
- package/dist/input/root/input-root.d.ts +13 -3
- package/dist/input/root/input-root.js +12 -3
- package/dist/kbd/root/kbd-root.d.ts +35 -1
- package/dist/kbd/root/kbd-root.js +23 -4
- package/dist/legend/root/legend-root.d.ts +55 -8
- package/dist/legend/root/legend-root.js +55 -13
- package/dist/lightbox/root/lightbox-root.d.ts +49 -6
- package/dist/lightbox/root/lightbox-root.js +86 -19
- package/dist/lightbox/zoom-controller.d.ts +59 -0
- package/dist/lightbox/zoom-controller.js +128 -0
- package/dist/lightbox/zoom.d.ts +22 -0
- package/dist/lightbox/zoom.js +16 -0
- package/dist/line-chart/root/line-chart-root.d.ts +22 -1
- package/dist/line-chart/root/line-chart-root.js +21 -1
- package/dist/list/item/list-item.d.ts +70 -1
- package/dist/list/item/list-item.js +77 -6
- package/dist/list/numbering.d.ts +14 -0
- package/dist/list/numbering.js +8 -0
- package/dist/list/root/list-root.d.ts +155 -9
- package/dist/list/root/list-root.js +246 -4
- package/dist/list/selection.d.ts +49 -0
- package/dist/list/selection.js +30 -0
- package/dist/listbox/root/listbox-root.d.ts +37 -1
- package/dist/listbox/root/listbox-root.js +49 -4
- package/dist/loader/busy.d.ts +10 -0
- package/dist/loader/busy.js +11 -0
- package/dist/loader/root/loader-root.d.ts +9 -2
- package/dist/loader/root/loader-root.js +23 -3
- package/dist/map/root/map-root.d.ts +6 -2
- package/dist/map/root/map-root.js +5 -2
- package/dist/megamenu/root/megamenu-root.d.ts +62 -0
- package/dist/megamenu/root/megamenu-root.js +90 -5
- package/dist/menu/index.d.ts +1 -0
- package/dist/menu/index.js +1 -0
- package/dist/menu/item/menu-item.d.ts +87 -11
- package/dist/menu/item/menu-item.js +78 -22
- package/dist/menu/root/menu-root.d.ts +39 -1
- package/dist/menu/root/menu-root.js +65 -8
- package/dist/menu/section/menu-section.d.ts +55 -0
- package/dist/menu/section/menu-section.js +60 -0
- package/dist/meter/root/meter-root.d.ts +20 -1
- package/dist/meter/root/meter-root.js +11 -15
- package/dist/navigation/root/navigation-root.d.ts +18 -2
- package/dist/navigation/root/navigation-root.js +29 -3
- package/dist/notifications/root/notifications-root.d.ts +25 -0
- package/dist/notifications/root/notifications-root.js +33 -5
- package/dist/number-input/root/number-input-root.d.ts +17 -8
- package/dist/number-input/root/number-input-root.js +2 -7
- package/dist/object-inspector/root/object-inspector-root.d.ts +161 -32
- package/dist/object-inspector/root/object-inspector-root.js +264 -123
- package/dist/object-inspector/rows.d.ts +75 -0
- package/dist/object-inspector/rows.js +119 -0
- package/dist/option/root/option-root.d.ts +5 -3
- package/dist/outline/levels.d.ts +31 -0
- package/dist/outline/levels.js +23 -0
- package/dist/outline/root/outline-root.d.ts +86 -3
- package/dist/outline/root/outline-root.js +95 -12
- package/dist/pagination/size/pagination-size.d.ts +12 -2
- package/dist/pagination/size/pagination-size.js +20 -5
- package/dist/pin-input/code.d.ts +10 -0
- package/dist/pin-input/code.js +13 -0
- package/dist/pin-input/root/pin-input-root.d.ts +25 -1
- package/dist/pin-input/root/pin-input-root.js +10 -11
- package/dist/popover/hide-outside.d.ts +14 -0
- package/dist/popover/hide-outside.js +41 -0
- package/dist/popover/root/popover-root.d.ts +57 -7
- package/dist/popover/root/popover-root.js +58 -3
- package/dist/progress/root/progress-root.d.ts +20 -0
- package/dist/progress/root/progress-root.js +15 -15
- package/dist/qr-code/export.d.ts +26 -1
- package/dist/qr-code/export.js +14 -0
- package/dist/qr-code/root/qr-code-root.d.ts +19 -5
- package/dist/qr-code/root/qr-code-root.js +58 -9
- package/dist/quote/marks.d.ts +8 -0
- package/dist/quote/marks.js +5 -0
- package/dist/quote/root/quote-root.d.ts +14 -2
- package/dist/quote/root/quote-root.js +23 -1
- package/dist/radio/group/radio-group.d.ts +4 -10
- package/dist/radio/group/radio-group.js +5 -10
- package/dist/radio/root/radio-root.d.ts +6 -2
- package/dist/radio/root/radio-root.js +6 -1
- package/dist/rating/root/rating-root.d.ts +10 -5
- package/dist/rating/root/rating-root.js +32 -8
- package/dist/rating/steps.d.ts +7 -0
- package/dist/rating/steps.js +9 -0
- package/dist/scatter-chart/fit.d.ts +15 -0
- package/dist/scatter-chart/fit.js +35 -0
- package/dist/scatter-chart/root/scatter-chart-root.d.ts +21 -1
- package/dist/scatter-chart/root/scatter-chart-root.js +30 -17
- package/dist/scroll-area/root/scroll-area-root.d.ts +84 -0
- package/dist/scroll-area/root/scroll-area-root.js +106 -7
- package/dist/scroll-area/scrollbar-controller.d.ts +111 -0
- package/dist/scroll-area/scrollbar-controller.js +172 -0
- package/dist/scroll-area/scrollbar.d.ts +92 -0
- package/dist/scroll-area/scrollbar.js +33 -0
- package/dist/select/root/select-root.d.ts +15 -0
- package/dist/select/root/select-root.js +18 -6
- package/dist/skeleton/root/skeleton-root.d.ts +3 -0
- package/dist/skeleton/root/skeleton-root.js +4 -2
- package/dist/skip-link/root/skip-link-root.js +2 -2
- package/dist/slider/root/slider-root.d.ts +41 -4
- package/dist/slider/root/slider-root.js +23 -3
- package/dist/sparkline/readings.d.ts +18 -0
- package/dist/sparkline/readings.js +19 -0
- package/dist/sparkline/root/sparkline-root.d.ts +78 -7
- package/dist/sparkline/root/sparkline-root.js +118 -23
- package/dist/speed-dial/root/speed-dial-root.js +2 -2
- package/dist/splitter/root/splitter-root.d.ts +20 -12
- package/dist/splitter/root/splitter-root.js +226 -203
- package/dist/splitter/snap.d.ts +9 -0
- package/dist/splitter/snap.js +12 -0
- package/dist/stat/root/stat-root.d.ts +14 -5
- package/dist/stat/root/stat-root.js +21 -5
- package/dist/steps/reach.d.ts +20 -0
- package/dist/steps/reach.js +15 -0
- package/dist/steps/root/steps-root.d.ts +76 -0
- package/dist/steps/root/steps-root.js +93 -1
- package/dist/steps/step/step.d.ts +45 -2
- package/dist/steps/step/step.js +33 -6
- package/dist/switch/root/switch-root.d.ts +10 -0
- package/dist/table/column/table-column.d.ts +11 -10
- package/dist/table/column/table-column.js +8 -19
- package/dist/table/root/table-root.d.ts +126 -4
- package/dist/table/root/table-root.js +156 -6
- package/dist/table/row/table-row.d.ts +47 -1
- package/dist/table/row/table-row.js +39 -2
- package/dist/tabs/panel/tab-panel.d.ts +22 -5
- package/dist/tabs/panel/tab-panel.js +34 -6
- package/dist/tabs/root/tabs-root.d.ts +37 -1
- package/dist/tabs/root/tabs-root.js +22 -4
- package/dist/tabs/tab/tab.d.ts +41 -4
- package/dist/tabs/tab/tab.js +49 -3
- package/dist/tag/group/tag-group.d.ts +31 -4
- package/dist/tag/group/tag-group.js +46 -7
- package/dist/tag/root/tag-root.js +9 -2
- package/dist/textarea/root/textarea-root.d.ts +28 -1
- package/dist/textarea/root/textarea-root.js +40 -1
- package/dist/time-input/root/time-input-root.d.ts +5 -1
- package/dist/time-input/root/time-input-root.js +16 -8
- package/dist/time-picker/root/time-picker-root.d.ts +18 -4
- package/dist/time-picker/root/time-picker-root.js +7 -10
- package/dist/time-picker/wheel-name.d.ts +9 -0
- package/dist/time-picker/wheel-name.js +15 -0
- package/dist/timeline/group/timeline-group.d.ts +46 -0
- package/dist/timeline/group/timeline-group.js +37 -0
- package/dist/timeline/index.d.ts +1 -0
- package/dist/timeline/index.js +1 -0
- package/dist/timeline/root/timeline-root.d.ts +10 -3
- package/dist/toast/item/toast-item.d.ts +24 -18
- package/dist/toast/item/toast-item.js +36 -40
- package/dist/toast/root/toast-root.d.ts +6 -0
- package/dist/toast/root/toast-root.js +16 -1
- package/dist/toggle/group/toggle-group.d.ts +24 -3
- package/dist/toggle/group/toggle-group.js +34 -5
- package/dist/toolbar/root/toolbar-root.d.ts +13 -0
- package/dist/toolbar/root/toolbar-root.js +15 -5
- package/dist/tooltip/root/tooltip-root.d.ts +13 -2
- package/dist/tooltip/root/tooltip-root.js +9 -1
- package/dist/tour/back.d.ts +10 -0
- package/dist/tour/back.js +8 -0
- package/dist/tour/root/tour-root.d.ts +30 -2
- package/dist/tour/root/tour-root.js +34 -8
- package/dist/tree/item/tree-item.d.ts +61 -4
- package/dist/tree/item/tree-item.js +92 -20
- package/dist/tree/root/tree-root.d.ts +58 -0
- package/dist/tree/root/tree-root.js +80 -16
- package/dist/tree/selection.d.ts +24 -0
- package/dist/tree/selection.js +13 -0
- package/dist/trend/root/trend-root.d.ts +43 -18
- package/dist/trend/root/trend-root.js +31 -6
- package/dist/video/media-events.d.ts +44 -0
- package/dist/video/media-events.js +35 -0
- package/dist/video/root/video-root.d.ts +117 -18
- package/dist/video/root/video-root.js +93 -47
- package/dist/video-playlist/menu/video-playlist-menu.d.ts +5 -0
- package/dist/video-playlist/menu/video-playlist-menu.js +3 -1
- package/dist/video-playlist/order.d.ts +41 -0
- package/dist/video-playlist/order.js +34 -0
- package/dist/video-playlist/root/video-playlist-root.d.ts +77 -3
- package/dist/video-playlist/root/video-playlist-root.js +60 -16
- package/dist/virtual-list/controls.d.ts +4 -0
- package/dist/virtual-list/controls.js +30 -0
- package/dist/virtual-list/fill.d.ts +22 -0
- package/dist/virtual-list/fill.js +23 -0
- package/dist/virtual-list/keys.d.ts +15 -0
- package/dist/virtual-list/keys.js +24 -0
- package/dist/virtual-list/plan.d.ts +49 -0
- package/dist/virtual-list/plan.js +16 -0
- package/dist/virtual-list/root/virtual-list-root.d.ts +259 -26
- package/dist/virtual-list/root/virtual-list-root.js +333 -49
- package/lint.json +1 -1
- package/package.json +8 -8
- package/types/jsx.d.ts +8113 -1394
- package/types/svelte.d.ts +2 -0
- package/types/vue.d.ts +1678 -353
- package/dist/data-table/root/order.d.ts +0 -141
- package/dist/data-table/root/order.js +0 -76
- package/dist/listbox/range.d.ts +0 -17
- package/dist/listbox/range.js +0 -5
- package/dist/tag/selection.d.ts +0 -10
- package/dist/tag/selection.js +0 -12
|
@@ -17,6 +17,11 @@ declare const HelixHeadlessTextarea_base: (new (...args: any[]) => import("@fusi
|
|
|
17
17
|
* `max-rows` stops the growth at that many lines, and the field scrolls past
|
|
18
18
|
* them.
|
|
19
19
|
*
|
|
20
|
+
* `clearable` draws a button that empties the field while it holds text, and
|
|
21
|
+
* sends `helix-clear`, as `Input` does. `validate` adds your own rule, run on
|
|
22
|
+
* every change once the browser finds nothing wrong, as React Aria's
|
|
23
|
+
* TextField `validate` does.
|
|
24
|
+
*
|
|
20
25
|
* @since 0.1.0
|
|
21
26
|
* @status stable
|
|
22
27
|
* @category forms
|
|
@@ -31,15 +36,18 @@ declare const HelixHeadlessTextarea_base: (new (...args: any[]) => import("@fusi
|
|
|
31
36
|
*
|
|
32
37
|
* @event {Event} change - Sent from the textarea when the user finishes an edit.
|
|
33
38
|
* @event {HelixBeforeChangeEvent} helix-before-change - Fired as the text changes, and cancelable.
|
|
39
|
+
* @event {HelixClearEvent} helix-clear - Fired after the clear button has emptied the field, after `input` and `change`.
|
|
34
40
|
* @event {Event} input - Fired after the value changes.
|
|
35
41
|
*
|
|
42
|
+
* @csspart clear - The button that empties the field, under `clearable`.
|
|
36
43
|
* @csspart control - The textarea itself.
|
|
37
44
|
* @csspart feedback - The message that says what is wrong.
|
|
38
45
|
* @csspart field - The box that holds the textarea.
|
|
39
46
|
* @csspart hint - Help under the field, while nothing is wrong.
|
|
40
47
|
* @csspart label - The label above the field.
|
|
41
48
|
*
|
|
42
|
-
* @cssstate
|
|
49
|
+
* @cssstate blank - The field holds no text.
|
|
50
|
+
* @cssstate invalid - The control has an error to show, from the browser's validation, `validate`, or your `feedback`.
|
|
43
51
|
*/
|
|
44
52
|
export declare class HelixHeadlessTextarea extends HelixHeadlessTextarea_base {
|
|
45
53
|
protected readonly aria: AriaForwardController;
|
|
@@ -57,6 +65,14 @@ export declare class HelixHeadlessTextarea extends HelixHeadlessTextarea_base {
|
|
|
57
65
|
* Grows the box to fit its content, so it does not scroll.
|
|
58
66
|
*/
|
|
59
67
|
autoGrow: boolean;
|
|
68
|
+
/**
|
|
69
|
+
* Draws a button that empties the field while it holds text.
|
|
70
|
+
*/
|
|
71
|
+
clearable: boolean;
|
|
72
|
+
/**
|
|
73
|
+
* The accessible name of the clear button, which shows only an icon.
|
|
74
|
+
*/
|
|
75
|
+
clearLabel: string;
|
|
60
76
|
/**
|
|
61
77
|
* How many characters wide the box is, when the layout does not set its
|
|
62
78
|
* width.
|
|
@@ -194,6 +210,11 @@ export declare class HelixHeadlessTextarea extends HelixHeadlessTextarea_base {
|
|
|
194
210
|
focus(options?: FocusOptions): void;
|
|
195
211
|
/** Reports the value and the validity the host stands behind. */
|
|
196
212
|
private sync;
|
|
213
|
+
/**
|
|
214
|
+
* Empties the field and puts the caret back in it, through `requestValue`,
|
|
215
|
+
* so a consumer who owns the value can refuse. `Input` clears the same way.
|
|
216
|
+
*/
|
|
217
|
+
private readonly handleClear;
|
|
197
218
|
connectedCallback(): void;
|
|
198
219
|
disconnectedCallback(): void;
|
|
199
220
|
protected firstUpdated(changed: PropertyValues): void;
|
|
@@ -212,6 +233,12 @@ export declare class HelixHeadlessTextarea extends HelixHeadlessTextarea_base {
|
|
|
212
233
|
* How many lines the box is before anything is typed.
|
|
213
234
|
*/
|
|
214
235
|
rows: number;
|
|
236
|
+
/**
|
|
237
|
+
* Your own rule for the value, run on every change once the browser finds
|
|
238
|
+
* nothing wrong. Return a message, or a list of them, to mark the field
|
|
239
|
+
* invalid, and `true`, `null`, or nothing to accept the value.
|
|
240
|
+
*/
|
|
241
|
+
validate?: (value: string) => string | string[] | true | null | undefined;
|
|
215
242
|
/**
|
|
216
243
|
* How the browser wraps the text, and whether the breaks are submitted with
|
|
217
244
|
* it.
|
|
@@ -4,7 +4,8 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
4
4
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
|
-
import { AriaForwardController, customElement, HelixFormElement, holdCaret, isRtl, MixinControllerValue, MixinField, restoreValue, } from '@fusion.dev/helix-core';
|
|
7
|
+
import { AriaForwardController, customElement, drawIcon, HelixClearEvent, HelixFormElement, holdCaret, isRtl, MixinControllerValue, MixinField, restoreValue, } from '@fusion.dev/helix-core';
|
|
8
|
+
import { x } from '@fusion.dev/helix-icons';
|
|
8
9
|
import { html, nothing } from 'lit';
|
|
9
10
|
import { property } from 'lit/decorators.js';
|
|
10
11
|
import { grownHeight, lineMetrics } from '../grow.js';
|
|
@@ -17,6 +18,8 @@ let HelixHeadlessTextarea = class HelixHeadlessTextarea extends MixinControllerV
|
|
|
17
18
|
this.announcesInput = true;
|
|
18
19
|
this.autocomplete = '';
|
|
19
20
|
this.autoGrow = false;
|
|
21
|
+
this.clearable = false;
|
|
22
|
+
this.clearLabel = 'Clear';
|
|
20
23
|
this.dirName = '';
|
|
21
24
|
this.placeholder = '';
|
|
22
25
|
this.readOnly = false;
|
|
@@ -32,6 +35,17 @@ let HelixHeadlessTextarea = class HelixHeadlessTextarea extends MixinControllerV
|
|
|
32
35
|
event.stopPropagation();
|
|
33
36
|
this.announceChange();
|
|
34
37
|
};
|
|
38
|
+
this.handleClear = () => {
|
|
39
|
+
if (this.value !== '' && this.requestValue('')) {
|
|
40
|
+
this.announceChange();
|
|
41
|
+
this.dispatchEvent(new HelixClearEvent());
|
|
42
|
+
}
|
|
43
|
+
const control = this.control;
|
|
44
|
+
if (control) {
|
|
45
|
+
restoreValue(control, this.value);
|
|
46
|
+
control.focus();
|
|
47
|
+
}
|
|
48
|
+
};
|
|
35
49
|
this.rows = 3;
|
|
36
50
|
this.wrap = 'soft';
|
|
37
51
|
}
|
|
@@ -112,6 +126,11 @@ let HelixHeadlessTextarea = class HelixHeadlessTextarea extends MixinControllerV
|
|
|
112
126
|
return;
|
|
113
127
|
}
|
|
114
128
|
this.copyValidity(control);
|
|
129
|
+
const own = control.validity.valid ? this.validate?.(this.value) : undefined;
|
|
130
|
+
const message = Array.isArray(own) ? own.join(' ') : typeof own === 'string' ? own : '';
|
|
131
|
+
if (message !== '') {
|
|
132
|
+
this.internals.setValidity({ customError: true }, message, control);
|
|
133
|
+
}
|
|
115
134
|
this.refreshFeedback();
|
|
116
135
|
}
|
|
117
136
|
connectedCallback() {
|
|
@@ -140,6 +159,7 @@ let HelixHeadlessTextarea = class HelixHeadlessTextarea extends MixinControllerV
|
|
|
140
159
|
}
|
|
141
160
|
willUpdate(changed) {
|
|
142
161
|
super.willUpdate(changed);
|
|
162
|
+
this.toggleState('blank', this.value === '');
|
|
143
163
|
if (!this.hasUpdated) {
|
|
144
164
|
return;
|
|
145
165
|
}
|
|
@@ -180,6 +200,16 @@ let HelixHeadlessTextarea = class HelixHeadlessTextarea extends MixinControllerV
|
|
|
180
200
|
@change=${this.handleChange}
|
|
181
201
|
></textarea>
|
|
182
202
|
<slot name="end"></slot>
|
|
203
|
+
${this.clearable && this.value !== '' && !this.isDisabled && !this.readOnly
|
|
204
|
+
? html `<button
|
|
205
|
+
part="clear"
|
|
206
|
+
type="button"
|
|
207
|
+
aria-label=${this.clearLabel}
|
|
208
|
+
@click=${this.handleClear}
|
|
209
|
+
>
|
|
210
|
+
${drawIcon(x)}
|
|
211
|
+
</button>`
|
|
212
|
+
: nothing}
|
|
183
213
|
</div>
|
|
184
214
|
${this.renderHint()}${this.renderFeedback()}`;
|
|
185
215
|
}
|
|
@@ -190,6 +220,12 @@ __decorate([
|
|
|
190
220
|
__decorate([
|
|
191
221
|
property({ attribute: 'auto-grow', reflect: true, type: Boolean })
|
|
192
222
|
], HelixHeadlessTextarea.prototype, "autoGrow", void 0);
|
|
223
|
+
__decorate([
|
|
224
|
+
property({ type: Boolean })
|
|
225
|
+
], HelixHeadlessTextarea.prototype, "clearable", void 0);
|
|
226
|
+
__decorate([
|
|
227
|
+
property({ attribute: 'clear-label' })
|
|
228
|
+
], HelixHeadlessTextarea.prototype, "clearLabel", void 0);
|
|
193
229
|
__decorate([
|
|
194
230
|
property({ type: Number })
|
|
195
231
|
], HelixHeadlessTextarea.prototype, "cols", void 0);
|
|
@@ -214,6 +250,9 @@ __decorate([
|
|
|
214
250
|
__decorate([
|
|
215
251
|
property({ type: Number })
|
|
216
252
|
], HelixHeadlessTextarea.prototype, "rows", void 0);
|
|
253
|
+
__decorate([
|
|
254
|
+
property({ attribute: false })
|
|
255
|
+
], HelixHeadlessTextarea.prototype, "validate", void 0);
|
|
217
256
|
__decorate([
|
|
218
257
|
property()
|
|
219
258
|
], HelixHeadlessTextarea.prototype, "wrap", void 0);
|
|
@@ -42,6 +42,8 @@ declare const HelixHeadlessTimeInput_base: (new (...args: any[]) => import("@fus
|
|
|
42
42
|
*
|
|
43
43
|
* @slot feedback - The message that says what is wrong with the value.
|
|
44
44
|
* @slot hint - Help under the field.
|
|
45
|
+
* @slot panel-footer - Content in the panel under the times, such as a note or an action.
|
|
46
|
+
* @slot panel-header - Content in the panel above the times, such as a heading or a shortcut.
|
|
45
47
|
* @slot trigger - The icon on the field that shows a list opens.
|
|
46
48
|
*
|
|
47
49
|
* @event {Event} change - Fired after the value changes.
|
|
@@ -60,6 +62,7 @@ declare const HelixHeadlessTimeInput_base: (new (...args: any[]) => import("@fus
|
|
|
60
62
|
* @csspart picker - The time picker inside the panel.
|
|
61
63
|
* @csspart picker-column - One column of the picker.
|
|
62
64
|
* @csspart picker-column-empty - The text shown when the filter hides every option.
|
|
65
|
+
* @csspart picker-column-error - A wheel's `error` part, which the list never sets: its times do not load.
|
|
63
66
|
* @csspart picker-column-feedback - The column's message that says what is wrong with the value.
|
|
64
67
|
* @csspart picker-column-filter-icon - The icon beside the filter field.
|
|
65
68
|
* @csspart picker-column-filter-mark - The default icon beside the filter field, shown when none is slotted.
|
|
@@ -73,6 +76,7 @@ declare const HelixHeadlessTimeInput_base: (new (...args: any[]) => import("@fus
|
|
|
73
76
|
* @csspart picker-columns - The row of columns, in `wheels`.
|
|
74
77
|
* @csspart picker-list - The listbox holding the times, in `list`.
|
|
75
78
|
* @csspart picker-list-empty - The text shown when the filter hides every option.
|
|
79
|
+
* @csspart picker-list-error - The list's `error` part, which the list never sets: its times do not load.
|
|
76
80
|
* @csspart picker-list-feedback - The inner list's message that says what is wrong with the value.
|
|
77
81
|
* @csspart picker-list-filter-icon - The icon beside the filter field.
|
|
78
82
|
* @csspart picker-list-filter-mark - The default icon beside the filter field, shown when none is slotted.
|
|
@@ -272,7 +276,7 @@ export declare class HelixHeadlessTimeInput extends HelixHeadlessTimeInput_base
|
|
|
272
276
|
/** Each time, where `mode` holds several, sent one entry each. */
|
|
273
277
|
protected get answers(): readonly string[] | undefined;
|
|
274
278
|
/** What is wrong with the times, which the text input cannot say. */
|
|
275
|
-
protected validate(): string;
|
|
279
|
+
protected validate(): string | readonly [keyof ValidityStateFlags, string];
|
|
276
280
|
/**
|
|
277
281
|
* Whether the panel shows one list of times or a column for each part of the
|
|
278
282
|
* time.
|
|
@@ -152,14 +152,20 @@ let HelixHeadlessTimeInput = class HelixHeadlessTimeInput extends MixinSegmented
|
|
|
152
152
|
const rules = { disableTimes: this.disableTimes, max: this.max, min: this.min };
|
|
153
153
|
const faults = held.map((one) => timeFault(one, rules));
|
|
154
154
|
if (faults.includes('rangeUnderflow')) {
|
|
155
|
-
return
|
|
156
|
-
|
|
157
|
-
|
|
155
|
+
return [
|
|
156
|
+
'rangeUnderflow',
|
|
157
|
+
fillTemplate(this.rangeUnderflowMessage || 'Choose a time at or after {min}.', {
|
|
158
|
+
min: writeClock(this.min, clockLocale(this.locale, this.hourCycle), this.seconds),
|
|
159
|
+
}),
|
|
160
|
+
];
|
|
158
161
|
}
|
|
159
162
|
if (faults.includes('rangeOverflow')) {
|
|
160
|
-
return
|
|
161
|
-
|
|
162
|
-
|
|
163
|
+
return [
|
|
164
|
+
'rangeOverflow',
|
|
165
|
+
fillTemplate(this.rangeOverflowMessage || 'Choose a time at or before {max}.', {
|
|
166
|
+
max: writeClock(this.max, clockLocale(this.locale, this.hourCycle), this.seconds),
|
|
167
|
+
}),
|
|
168
|
+
];
|
|
163
169
|
}
|
|
164
170
|
if (faults.includes('unavailable')) {
|
|
165
171
|
return this.unavailableMessage || 'Choose a time that is available.';
|
|
@@ -178,13 +184,13 @@ let HelixHeadlessTimeInput = class HelixHeadlessTimeInput extends MixinSegmented
|
|
|
178
184
|
renderPicker() {
|
|
179
185
|
return html `<${this.tag('time-picker')}
|
|
180
186
|
part="picker"
|
|
181
|
-
exportparts="column: picker-column, column-empty: picker-column-empty,
|
|
187
|
+
exportparts="column: picker-column, column-empty: picker-column-empty, column-error: picker-column-error,
|
|
182
188
|
column-feedback: picker-column-feedback, column-filter-icon: picker-column-filter-icon,
|
|
183
189
|
column-filter-mark: picker-column-filter-mark, column-hint: picker-column-hint,
|
|
184
190
|
column-items: picker-column-items, column-label: picker-column-label,
|
|
185
191
|
column-live: picker-column-live, column-loading: picker-column-loading, column-search: picker-column-search,
|
|
186
192
|
column-search-field: picker-column-search-field, columns: picker-columns, list: picker-list,
|
|
187
|
-
list-empty: picker-list-empty, list-feedback: picker-list-feedback,
|
|
193
|
+
list-empty: picker-list-empty, list-error: picker-list-error, list-feedback: picker-list-feedback,
|
|
188
194
|
list-filter-icon: picker-list-filter-icon, list-filter-mark: picker-list-filter-mark,
|
|
189
195
|
list-hint: picker-list-hint, list-items: picker-list-items, list-label: picker-list-label,
|
|
190
196
|
list-live: picker-list-live, list-loading: picker-list-loading, list-search: picker-list-search,
|
|
@@ -285,7 +291,9 @@ let HelixHeadlessTimeInput = class HelixHeadlessTimeInput extends MixinSegmented
|
|
|
285
291
|
?hidden=${!this.open}
|
|
286
292
|
@keydown=${this.handleWheelEnter}
|
|
287
293
|
>
|
|
294
|
+
<slot name="panel-header"></slot>
|
|
288
295
|
${this.renderPicker()}
|
|
296
|
+
<slot name="panel-footer"></slot>
|
|
289
297
|
</div>
|
|
290
298
|
${this.renderHint()}${this.renderFeedback()}`;
|
|
291
299
|
}
|
|
@@ -47,6 +47,7 @@ declare const HelixHeadlessTimePicker_base: (new (...args: any[]) => import("@fu
|
|
|
47
47
|
*
|
|
48
48
|
* @csspart column - One column of the wheels.
|
|
49
49
|
* @csspart column-empty - The text shown when the filter hides every option.
|
|
50
|
+
* @csspart column-error - A wheel's `error` part, which Time Picker never sets: its times do not load.
|
|
50
51
|
* @csspart column-feedback - The message that says what is wrong with the value.
|
|
51
52
|
* @csspart column-filter-icon - The icon beside the filter field.
|
|
52
53
|
* @csspart column-filter-mark - The default icon beside the filter field, shown when none is slotted.
|
|
@@ -60,6 +61,7 @@ declare const HelixHeadlessTimePicker_base: (new (...args: any[]) => import("@fu
|
|
|
60
61
|
* @csspart columns - The row of columns, in `wheels`.
|
|
61
62
|
* @csspart list - The listbox holding the times, in `list`.
|
|
62
63
|
* @csspart list-empty - The text shown when the filter hides every option.
|
|
64
|
+
* @csspart list-error - The list's `error` part, which Time Picker never sets: its times do not load.
|
|
63
65
|
* @csspart list-feedback - The message that says what is wrong with the value.
|
|
64
66
|
* @csspart list-filter-icon - The icon beside the filter field.
|
|
65
67
|
* @csspart list-filter-mark - The default icon beside the filter field, shown when none is slotted.
|
|
@@ -112,8 +114,11 @@ export declare class HelixHeadlessTimePicker extends HelixHeadlessTimePicker_bas
|
|
|
112
114
|
hourCycle?: HourCycle;
|
|
113
115
|
/**
|
|
114
116
|
* What the wheel of hours is called, read by screen readers.
|
|
117
|
+
*
|
|
118
|
+
* Absent is the locale's own word, from `Intl.DisplayNames`: "Hour" in
|
|
119
|
+
* English, "Stunde" in German.
|
|
115
120
|
*/
|
|
116
|
-
hourLabel
|
|
121
|
+
hourLabel?: string;
|
|
117
122
|
/**
|
|
118
123
|
* Whether the current selection fails validation.
|
|
119
124
|
*
|
|
@@ -151,16 +156,22 @@ export declare class HelixHeadlessTimePicker extends HelixHeadlessTimePicker_bas
|
|
|
151
156
|
/**
|
|
152
157
|
* What the wheel of the half of the day is called, read by screen readers.
|
|
153
158
|
* Its two options are written as the locale writes them, such as AM and PM.
|
|
159
|
+
*
|
|
160
|
+
* Absent is the locale's own word, from `Intl.DisplayNames`: "AM/PM" in
|
|
161
|
+
* English, "Tageshälfte" in German.
|
|
154
162
|
*/
|
|
155
|
-
meridiemLabel
|
|
163
|
+
meridiemLabel?: string;
|
|
156
164
|
/**
|
|
157
165
|
* Earliest time offered, as `HH:mm`.
|
|
158
166
|
*/
|
|
159
167
|
min: string;
|
|
160
168
|
/**
|
|
161
169
|
* What the wheel of minutes is called, read by screen readers.
|
|
170
|
+
*
|
|
171
|
+
* Absent is the locale's own word, from `Intl.DisplayNames`: "Minute" in
|
|
172
|
+
* English and German, "分" in Japanese.
|
|
162
173
|
*/
|
|
163
|
-
minuteLabel
|
|
174
|
+
minuteLabel?: string;
|
|
164
175
|
/**
|
|
165
176
|
* How many times can be held at once.
|
|
166
177
|
*
|
|
@@ -322,8 +333,11 @@ export declare class HelixHeadlessTimePicker extends HelixHeadlessTimePicker_bas
|
|
|
322
333
|
required: boolean;
|
|
323
334
|
/**
|
|
324
335
|
* What the wheel of seconds is called, read by screen readers.
|
|
336
|
+
*
|
|
337
|
+
* Absent is the locale's own word, from `Intl.DisplayNames`: "Second" in
|
|
338
|
+
* English, "Sekunde" in German.
|
|
325
339
|
*/
|
|
326
|
-
secondLabel
|
|
340
|
+
secondLabel?: string;
|
|
327
341
|
/**
|
|
328
342
|
* Whether times carry their seconds.
|
|
329
343
|
*
|
|
@@ -8,21 +8,19 @@ import { clockLocale, commaList, customElement, dayPeriod, elementById, fillTemp
|
|
|
8
8
|
import { nothing } from 'lit';
|
|
9
9
|
import { property } from 'lit/decorators.js';
|
|
10
10
|
import { html } from 'lit/static-html.js';
|
|
11
|
+
import { wheelName } from '../wheel-name.js';
|
|
11
12
|
import '../../listbox/index.js';
|
|
12
13
|
import '../../option/index.js';
|
|
13
14
|
let HelixHeadlessTimePicker = class HelixHeadlessTimePicker extends MixinControllerValue(HelixFormElement) {
|
|
14
15
|
constructor() {
|
|
15
16
|
super(...arguments);
|
|
16
17
|
this.disableTimes = '';
|
|
17
|
-
this.hourLabel = 'Hour';
|
|
18
18
|
this.invalid = false;
|
|
19
19
|
this.label = 'Time';
|
|
20
20
|
this.locale = '';
|
|
21
21
|
this.manual = false;
|
|
22
22
|
this.max = '23:59';
|
|
23
|
-
this.meridiemLabel = 'Before or after noon';
|
|
24
23
|
this.min = '00:00';
|
|
25
|
-
this.minuteLabel = 'Minute';
|
|
26
24
|
this.handleListInput = (event) => {
|
|
27
25
|
event.stopPropagation();
|
|
28
26
|
};
|
|
@@ -77,7 +75,6 @@ let HelixHeadlessTimePicker = class HelixHeadlessTimePicker extends MixinControl
|
|
|
77
75
|
};
|
|
78
76
|
this.readOnly = false;
|
|
79
77
|
this.required = false;
|
|
80
|
-
this.secondLabel = 'Second';
|
|
81
78
|
this.seconds = false;
|
|
82
79
|
this.step = 15;
|
|
83
80
|
this.listRevealed = false;
|
|
@@ -286,7 +283,7 @@ let HelixHeadlessTimePicker = class HelixHeadlessTimePicker extends MixinControl
|
|
|
286
283
|
part="column"
|
|
287
284
|
data-column=${part}
|
|
288
285
|
aria-invalid=${this.invalid ? 'true' : nothing}
|
|
289
|
-
exportparts="empty: column-empty, feedback: column-feedback, filter-icon: column-filter-icon,
|
|
286
|
+
exportparts="empty: column-empty, error: column-error, feedback: column-feedback, filter-icon: column-filter-icon,
|
|
290
287
|
filter-mark: column-filter-mark, hint: column-hint, items: column-items, label: column-label,
|
|
291
288
|
live: column-live, loading: column-loading, search: column-search, search-field: column-search-field"
|
|
292
289
|
aria-label=${label}
|
|
@@ -323,13 +320,13 @@ let HelixHeadlessTimePicker = class HelixHeadlessTimePicker extends MixinControl
|
|
|
323
320
|
data-unset=${this.value === '' ? '' : nothing}
|
|
324
321
|
@keydown=${this.handleColumnsKeydown}
|
|
325
322
|
>
|
|
326
|
-
${this.renderColumn('hour', this.hourLabel, hours.map(String), (one) => (twelve ? one : one.padStart(2, '0')), String(shown), (one) => this.wholeHourBarred(Number(one), twelve ? meridiem : undefined))}
|
|
327
|
-
${this.renderColumn('minute', this.minuteLabel, this.minutes.map(String), (one) => one.padStart(2, '0'), String(minute), (one) => this.barredAt(hour * 3600 + Number(one) * 60))}
|
|
323
|
+
${this.renderColumn('hour', this.hourLabel ?? wheelName('hour', this.locale), hours.map(String), (one) => (twelve ? one : one.padStart(2, '0')), String(shown), (one) => this.wholeHourBarred(Number(one), twelve ? meridiem : undefined))}
|
|
324
|
+
${this.renderColumn('minute', this.minuteLabel ?? wheelName('minute', this.locale), this.minutes.map(String), (one) => one.padStart(2, '0'), String(minute), (one) => this.barredAt(hour * 3600 + Number(one) * 60))}
|
|
328
325
|
${this.seconds
|
|
329
|
-
? this.renderColumn('second', this.secondLabel, this.secondsShown.map(String), (one) => one.padStart(2, '0'), String(second), (one) => this.barredAt(hour * 3600 + minute * 60 + Number(one)))
|
|
326
|
+
? this.renderColumn('second', this.secondLabel ?? wheelName('second', this.locale), this.secondsShown.map(String), (one) => one.padStart(2, '0'), String(second), (one) => this.barredAt(hour * 3600 + minute * 60 + Number(one)))
|
|
330
327
|
: nothing}
|
|
331
328
|
${twelve
|
|
332
|
-
? this.renderColumn('meridiem', this.meridiemLabel, ['AM', 'PM'], (one) => dayPeriod(one, this.clock), meridiem, (one) => this.halfBarred(one))
|
|
329
|
+
? this.renderColumn('meridiem', this.meridiemLabel ?? wheelName('dayPeriod', this.locale), ['AM', 'PM'], (one) => dayPeriod(one, this.clock), meridiem, (one) => this.halfBarred(one))
|
|
333
330
|
: nothing}
|
|
334
331
|
</div>`;
|
|
335
332
|
}
|
|
@@ -337,7 +334,7 @@ let HelixHeadlessTimePicker = class HelixHeadlessTimePicker extends MixinControl
|
|
|
337
334
|
return html `<${this.tag('listbox')}
|
|
338
335
|
part="list"
|
|
339
336
|
aria-invalid=${this.invalid ? 'true' : nothing}
|
|
340
|
-
exportparts="empty: list-empty, feedback: list-feedback, filter-icon: list-filter-icon,
|
|
337
|
+
exportparts="empty: list-empty, error: list-error, feedback: list-feedback, filter-icon: list-filter-icon,
|
|
341
338
|
filter-mark: list-filter-mark, hint: list-hint, items: list-items, label: list-label,
|
|
342
339
|
live: list-live, loading: list-loading, search: list-search, search-field: list-search-field"
|
|
343
340
|
aria-label=${this.listName}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** A part of the time a Time Picker wheel sets. */
|
|
2
|
+
export type WheelField = 'dayPeriod' | 'hour' | 'minute' | 'second';
|
|
3
|
+
/**
|
|
4
|
+
* What a locale calls a wheel, core's `segmentName`, with its first letter in
|
|
5
|
+
* capitals as a name standing on its own: "Hour" in English, "Stunde" in
|
|
6
|
+
* German, "時" in Japanese, and "AM/PM" for the half of the day, React Aria's
|
|
7
|
+
* name for it.
|
|
8
|
+
*/
|
|
9
|
+
export declare const wheelName: (field: WheelField, locale: string) => string;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { segmentName } from '@fusion.dev/helix-core';
|
|
2
|
+
const ENGLISH = {
|
|
3
|
+
dayPeriod: 'AM/PM',
|
|
4
|
+
hour: 'Hour',
|
|
5
|
+
minute: 'Minute',
|
|
6
|
+
second: 'Second',
|
|
7
|
+
};
|
|
8
|
+
export const wheelName = (field, locale) => {
|
|
9
|
+
const name = segmentName(field, locale);
|
|
10
|
+
if (name === field || name === '') {
|
|
11
|
+
return ENGLISH[field];
|
|
12
|
+
}
|
|
13
|
+
const lead = String.fromCodePoint(name.codePointAt(0));
|
|
14
|
+
return `${lead.toLocaleUpperCase(locale || undefined)}${name.slice(lead.length)}`;
|
|
15
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { HelixElement } from '@fusion.dev/helix-core';
|
|
2
|
+
import { type PropertyValues, type TemplateResult } from 'lit';
|
|
3
|
+
/**
|
|
4
|
+
* @summary A run of timeline entries under a heading, such as a day.
|
|
5
|
+
*
|
|
6
|
+
* @description
|
|
7
|
+
* Groups entries by date, such as "Today" and "Yesterday", in a timeline that
|
|
8
|
+
* holds many. The group is an entry of the timeline, and its entries are a
|
|
9
|
+
* list of their own, named by the heading. A screen reader lists the heading
|
|
10
|
+
* with the page's headings and hears how many entries each day holds.
|
|
11
|
+
*
|
|
12
|
+
* The heading's level is `heading-level`, and 3 where it is not set.
|
|
13
|
+
*
|
|
14
|
+
* Each group draws its own line, so the line stops at the last entry of one
|
|
15
|
+
* day and starts again at the first entry of the next.
|
|
16
|
+
*
|
|
17
|
+
* @since 0.1.0
|
|
18
|
+
* @status stable
|
|
19
|
+
* @aliases Day, Section, Date group
|
|
20
|
+
* @documentation https://fusion.dev/helix/components/timeline
|
|
21
|
+
*
|
|
22
|
+
* @slot - The entries.
|
|
23
|
+
* @slot heading - The heading, when it is more than text. Falls back to `label`.
|
|
24
|
+
*
|
|
25
|
+
* @csspart entries - The list that holds the entries.
|
|
26
|
+
* @csspart heading - The heading.
|
|
27
|
+
*/
|
|
28
|
+
export declare class HelixHeadlessTimelineGroup extends HelixElement {
|
|
29
|
+
/**
|
|
30
|
+
* The level of the group's heading, from 1 to 6.
|
|
31
|
+
*/
|
|
32
|
+
headingLevel?: number;
|
|
33
|
+
/**
|
|
34
|
+
* The heading, when it is plain text, such as "Today".
|
|
35
|
+
*
|
|
36
|
+
* The fallback of the `heading` slot, so slotted content replaces it.
|
|
37
|
+
*/
|
|
38
|
+
label: string;
|
|
39
|
+
protected willUpdate(changed: PropertyValues): void;
|
|
40
|
+
protected render(): TemplateResult;
|
|
41
|
+
}
|
|
42
|
+
declare global {
|
|
43
|
+
interface HTMLElementTagNameMap {
|
|
44
|
+
'helix-headless-timeline-group': HelixHeadlessTimelineGroup;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { customElement, HelixElement, headingLevel, hostAria } from '@fusion.dev/helix-core';
|
|
8
|
+
import { html } from 'lit';
|
|
9
|
+
import { property } from 'lit/decorators.js';
|
|
10
|
+
const HEADING_ID = 'heading';
|
|
11
|
+
let HelixHeadlessTimelineGroup = class HelixHeadlessTimelineGroup extends HelixElement {
|
|
12
|
+
constructor() {
|
|
13
|
+
super(...arguments);
|
|
14
|
+
this.label = '';
|
|
15
|
+
}
|
|
16
|
+
willUpdate(changed) {
|
|
17
|
+
super.willUpdate(changed);
|
|
18
|
+
hostAria(this.internals, { role: 'listitem' });
|
|
19
|
+
}
|
|
20
|
+
render() {
|
|
21
|
+
const level = headingLevel(this.headingLevel);
|
|
22
|
+
return html `<div part="heading" id=${HEADING_ID} role="heading" aria-level=${level}>
|
|
23
|
+
<slot name="heading">${this.label}</slot>
|
|
24
|
+
</div>
|
|
25
|
+
<div part="entries" role="list" aria-labelledby=${HEADING_ID}><slot></slot></div>`;
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
__decorate([
|
|
29
|
+
property({ attribute: 'heading-level', type: Number })
|
|
30
|
+
], HelixHeadlessTimelineGroup.prototype, "headingLevel", void 0);
|
|
31
|
+
__decorate([
|
|
32
|
+
property()
|
|
33
|
+
], HelixHeadlessTimelineGroup.prototype, "label", void 0);
|
|
34
|
+
HelixHeadlessTimelineGroup = __decorate([
|
|
35
|
+
customElement('helix-headless-timeline-group')
|
|
36
|
+
], HelixHeadlessTimelineGroup);
|
|
37
|
+
export { HelixHeadlessTimelineGroup };
|
package/dist/timeline/index.d.ts
CHANGED
package/dist/timeline/index.js
CHANGED
|
@@ -16,8 +16,15 @@ import { type PropertyValues, type TemplateResult } from 'lit';
|
|
|
16
16
|
* The host has `role="list"`, because the entries are your elements in the
|
|
17
17
|
* light DOM. `Steps` does the same.
|
|
18
18
|
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
19
|
+
* **Group entries by date with `Timeline.Group`**, which puts a heading such as
|
|
20
|
+
* "Today" over its entries. The group is an entry of the timeline, and its
|
|
21
|
+
* entries are a list of their own named by the heading.
|
|
22
|
+
*
|
|
23
|
+
* **The reading order is the order you write the entries in**, in every layout
|
|
24
|
+
* the styled tier draws: down the page, either side of a line down the middle,
|
|
25
|
+
* or across the page. Inside each entry the time is read before what happened.
|
|
26
|
+
* Write the entries in the order the events happened, oldest or newest first,
|
|
27
|
+
* and the layout only moves where they are drawn.
|
|
21
28
|
*
|
|
22
29
|
* @since 0.1.0
|
|
23
30
|
* @status stable
|
|
@@ -25,7 +32,7 @@ import { type PropertyValues, type TemplateResult } from 'lit';
|
|
|
25
32
|
* @aliases Activity feed, History, Changelog, Audit trail
|
|
26
33
|
* @documentation https://fusion.dev/helix/components/timeline
|
|
27
34
|
*
|
|
28
|
-
* @slot - The entries.
|
|
35
|
+
* @slot - The entries, and any groups of them.
|
|
29
36
|
*/
|
|
30
37
|
export declare class HelixHeadlessTimeline extends HelixElement {
|
|
31
38
|
/**
|
|
@@ -13,7 +13,9 @@ declare const HelixHeadlessToastItem_base: (new (...args: any[]) => import("@fus
|
|
|
13
13
|
* seconds.
|
|
14
14
|
*
|
|
15
15
|
* **Each message is an `alertdialog` named by its words**, which is how a reader
|
|
16
|
-
* who moves into the stack hears which message they are on.
|
|
16
|
+
* who moves into the stack hears which message they are on. Give it a
|
|
17
|
+
* `heading` and a `description`, and the heading names it and the description
|
|
18
|
+
* describes it, for a message with a title and a line of detail. A `danger` message
|
|
17
19
|
* is its own assertive live region, so it is announced at once; every other one
|
|
18
20
|
* is announced politely by the region.
|
|
19
21
|
*
|
|
@@ -31,7 +33,9 @@ declare const HelixHeadlessToastItem_base: (new (...args: any[]) => import("@fus
|
|
|
31
33
|
*
|
|
32
34
|
* @slot - The message.
|
|
33
35
|
* @slot actions - Actions for the message, usually a button or a link.
|
|
36
|
+
* @slot description - A line of detail under the heading, which describes the message.
|
|
34
37
|
* @slot dismiss-icon - Replaces the glyph inside the dismiss control.
|
|
38
|
+
* @slot heading - The message's title, which names it.
|
|
35
39
|
* @slot icon - Replaces the tone mark. The name matches `Callout`. The dismiss
|
|
36
40
|
* control's glyph uses `dismiss-icon`, because two slots cannot share a name:
|
|
37
41
|
* content goes to whichever slot comes first in the tree, and the tone mark is
|
|
@@ -41,8 +45,10 @@ declare const HelixHeadlessToastItem_base: (new (...args: any[]) => import("@fus
|
|
|
41
45
|
*
|
|
42
46
|
* @csspart actions - The region that holds the actions.
|
|
43
47
|
* @csspart content - The message.
|
|
48
|
+
* @csspart description - The slot the description is in. It draws no box until you give it one.
|
|
44
49
|
* @csspart dismiss - The control that dismisses the message.
|
|
45
50
|
* @csspart dismiss-mark - The glyph on the dismiss control, where none is slotted.
|
|
51
|
+
* @csspart heading - The slot the heading is in. It draws no box until you give it one.
|
|
46
52
|
* @csspart icon - The tone mark, where the message has one.
|
|
47
53
|
* @csspart icon-mark - The tone glyph, where none is slotted.
|
|
48
54
|
* @csspart item - The message's own surface.
|
|
@@ -78,11 +84,16 @@ export declare class HelixHeadlessToastItem extends HelixHeadlessToastItem_base
|
|
|
78
84
|
protected readonly swipes: SwipeController;
|
|
79
85
|
/** Writes how far a swipe has moved the message toward the end of the line. */
|
|
80
86
|
private slide;
|
|
81
|
-
/**
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
87
|
+
/**
|
|
88
|
+
* The dismiss timer, which pauses while a reader is on the message and
|
|
89
|
+
* continues from what was left.
|
|
90
|
+
*
|
|
91
|
+
* Paused is said on the host so the indicator can freeze with the clock. A
|
|
92
|
+
* `data-` attribute rather than a property, because it is written after
|
|
93
|
+
* upgrade from a pointer moving: nothing declares it and no server rendered
|
|
94
|
+
* it, which is the same reason `Carousel` names its slides from here.
|
|
95
|
+
*/
|
|
96
|
+
private readonly countdown;
|
|
86
97
|
/**
|
|
87
98
|
* The kind of message, which sets its mark and the mark's accessible name.
|
|
88
99
|
*
|
|
@@ -104,23 +115,18 @@ export declare class HelixHeadlessToastItem extends HelixHeadlessToastItem_base
|
|
|
104
115
|
pause(): void;
|
|
105
116
|
/** Restarts the dismiss timer from where it paused. */
|
|
106
117
|
resume(): void;
|
|
107
|
-
/**
|
|
108
|
-
* How many reasons there are to hold the clock, rather than whether there is
|
|
109
|
-
* one.
|
|
110
|
-
*
|
|
111
|
-
* Hover and focus stop the same timer, and the two are genuinely independent:
|
|
112
|
-
* a pointer can leave while focus stays, and focus can leave while the
|
|
113
|
-
* pointer stays. Uncounted, a reader who tabs into a message and then moves
|
|
114
|
-
* the pointer off it has the clock restarted underneath them, which is the
|
|
115
|
-
* case the pause exists for. Only the last one out starts it again.
|
|
116
|
-
*/
|
|
117
|
-
private holds;
|
|
118
118
|
private readonly handlePause;
|
|
119
119
|
private readonly handleResume;
|
|
120
120
|
connectedCallback(): void;
|
|
121
|
-
disconnectedCallback(): void;
|
|
122
121
|
protected willUpdate(changed: PropertyValues): void;
|
|
123
122
|
protected updated(changed: PropertyValues): void;
|
|
123
|
+
/** The elements assigned to one of the message's named slots. */
|
|
124
|
+
private assigned;
|
|
125
|
+
/**
|
|
126
|
+
* Names the message by its heading and describes it by its description,
|
|
127
|
+
* where it has them, and otherwise names it by all its words.
|
|
128
|
+
*/
|
|
129
|
+
private readonly name;
|
|
124
130
|
protected firstUpdated(changed: PropertyValues): void;
|
|
125
131
|
/**
|
|
126
132
|
* The mark for the message's tone, behind a seam.
|