@fusion.dev/helix-headless 0.145.0 → 0.147.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 +12286 -4281
- package/dist/accordion/item/accordion-item.d.ts +51 -18
- package/dist/accordion/item/accordion-item.js +45 -13
- package/dist/accordion/root/accordion-root.d.ts +16 -7
- package/dist/accordion/root/accordion-root.js +3 -3
- package/dist/announcement/root/announcement-root.d.ts +16 -6
- package/dist/announcement/root/announcement-root.js +37 -7
- package/dist/app-header/root/app-header-root.d.ts +7 -2
- package/dist/app-header/root/app-header-root.js +9 -1
- package/dist/app-header/sectioning.d.ts +3 -1
- package/dist/app-header/sectioning.js +3 -2
- package/dist/area-chart/root/area-chart-root.d.ts +18 -1
- package/dist/area-chart/root/area-chart-root.js +11 -3
- package/dist/avatar/group/avatar-group.d.ts +20 -14
- package/dist/avatar/group/avatar-group.js +17 -19
- package/dist/avatar/root/avatar-root.d.ts +31 -1
- package/dist/avatar/root/avatar-root.js +11 -1
- package/dist/badge/root/badge-root.d.ts +60 -7
- package/dist/badge/root/badge-root.js +89 -6
- package/dist/bar-chart/root/bar-chart-root.d.ts +18 -1
- package/dist/bar-chart/root/bar-chart-root.js +48 -20
- package/dist/bar-chart/stack.d.ts +25 -0
- package/dist/bar-chart/stack.js +27 -0
- package/dist/breadcrumbs/breadcrumb/breadcrumb.d.ts +14 -0
- package/dist/breadcrumbs/breadcrumb/breadcrumb.js +12 -2
- package/dist/breadcrumbs/root/breadcrumbs-root.d.ts +25 -0
- package/dist/breadcrumbs/root/breadcrumbs-root.js +51 -4
- package/dist/button/root/button-root.d.ts +50 -38
- package/dist/button/root/button-root.js +42 -53
- package/dist/button/submitter.d.ts +27 -0
- package/dist/button/submitter.js +25 -0
- 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.js +2 -2
- package/dist/card/root/card-root.d.ts +36 -4
- package/dist/card/root/card-root.js +29 -10
- package/dist/carousel/root/carousel-root.d.ts +43 -4
- package/dist/carousel/root/carousel-root.js +40 -12
- package/dist/carousel/stops.d.ts +20 -0
- package/dist/carousel/stops.js +30 -0
- package/dist/chat/message/chat-message.js +5 -4
- package/dist/chat/naming.d.ts +5 -1
- package/dist/chat/naming.js +4 -2
- package/dist/chat/root/chat-root.d.ts +40 -4
- package/dist/chat/root/chat-root.js +32 -6
- package/dist/checkbox/root/checkbox-root.d.ts +20 -0
- package/dist/checkbox/root/checkbox-root.js +18 -7
- package/dist/checkbox-group/root/checkbox-group-root.d.ts +8 -2
- package/dist/checkbox-group/root/checkbox-group-root.js +14 -11
- package/dist/checkbox-group/select-all.d.ts +21 -0
- package/dist/checkbox-group/select-all.js +7 -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 +79 -10
- package/dist/code-block/root/code-block-root.js +74 -5
- package/dist/color-input/root/color-input-root.d.ts +14 -0
- package/dist/color-input/root/color-input-root.js +17 -7
- package/dist/color-picker/channels.js +1 -2
- package/dist/color-picker/root/color-picker-root.d.ts +53 -16
- package/dist/color-picker/root/color-picker-root.js +155 -46
- package/dist/color-picker/wheel.d.ts +17 -0
- package/dist/color-picker/wheel.js +6 -0
- package/dist/combobox/root/combobox-root.d.ts +56 -0
- package/dist/combobox/root/combobox-root.js +92 -15
- package/dist/command/root/command-root.d.ts +19 -2
- package/dist/command/root/command-root.js +24 -23
- package/dist/copy-button/root/copy-button-root.d.ts +21 -1
- package/dist/copy-button/root/copy-button-root.js +16 -4
- package/dist/data-table/index.d.ts +1 -1
- package/dist/data-table/index.js +1 -1
- package/dist/data-table/keys.d.ts +6 -0
- package/dist/data-table/keys.js +14 -0
- package/dist/data-table/root/data-table-root.d.ts +27 -18
- package/dist/data-table/root/data-table-root.js +31 -57
- package/dist/data-table/tree.d.ts +16 -1
- package/dist/data-table/tree.js +2 -3
- package/dist/date-input/root/date-input-root.d.ts +11 -2
- package/dist/date-input/root/date-input-root.js +26 -12
- package/dist/date-picker/root/date-picker-root.d.ts +14 -9
- package/dist/date-picker/root/date-picker-root.js +33 -22
- package/dist/description-list/item/description-list-item.d.ts +18 -4
- package/dist/description-list/item/description-list-item.js +8 -4
- 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 +55 -1
- package/dist/donut-chart/slice-label.d.ts +35 -0
- package/dist/donut-chart/slice-label.js +11 -0
- package/dist/drawer/reveal.d.ts +8 -0
- package/dist/drawer/reveal.js +1 -0
- package/dist/drawer/root/drawer-root.d.ts +63 -2
- package/dist/drawer/root/drawer-root.js +75 -4
- package/dist/drilldown/item/drilldown-item.d.ts +21 -1
- package/dist/drilldown/item/drilldown-item.js +40 -5
- package/dist/drilldown/root/drilldown-root.d.ts +21 -3
- package/dist/drilldown/root/drilldown-root.js +22 -3
- package/dist/element-events.generated.js +35 -6
- package/dist/empty/root/empty-root.d.ts +34 -2
- package/dist/empty/root/empty-root.js +26 -4
- package/dist/file-input/root/file-input-root.d.ts +99 -8
- package/dist/file-input/root/file-input-root.js +120 -22
- package/dist/file-input/screen.d.ts +2 -1
- package/dist/file-input/status.d.ts +24 -0
- package/dist/file-input/status.js +10 -0
- package/dist/filter-input/chip/filter-chip.d.ts +23 -0
- package/dist/filter-input/chip/filter-chip.js +11 -2
- package/dist/filter-input/menu/filter-menu.d.ts +2 -0
- package/dist/filter-input/menu/filter-menu.js +12 -4
- package/dist/filter-input/root/filter-input-root.d.ts +38 -6
- package/dist/filter-input/root/filter-input-root.js +18 -28
- package/dist/filter-input/suggest.d.ts +28 -3
- package/dist/filter-input/suggest.js +18 -8
- package/dist/format-date/options.d.ts +3 -4
- package/dist/format-date/options.js +2 -2
- package/dist/format-date/root/format-date-root.d.ts +27 -17
- package/dist/format-date/root/format-date-root.js +27 -48
- package/dist/heatmap/root/buckets.d.ts +21 -0
- package/dist/heatmap/root/buckets.js +34 -0
- package/dist/heatmap/root/heatmap-root.d.ts +83 -11
- package/dist/heatmap/root/heatmap-root.js +104 -12
- package/dist/icon/index.d.ts +1 -1
- package/dist/icon/index.js +1 -1
- package/dist/icon/registry.d.ts +26 -1
- package/dist/icon/registry.js +12 -1
- package/dist/icon/root/icon-root.d.ts +25 -1
- package/dist/icon/root/icon-root.js +44 -12
- package/dist/icon/root/index.d.ts +1 -1
- package/dist/icon/root/index.js +1 -1
- 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 +14 -1
- package/dist/image/root/image-root.js +7 -2
- package/dist/input/root/input-root.d.ts +34 -3
- package/dist/input/root/input-root.js +17 -4
- package/dist/kbd/keys.d.ts +29 -0
- package/dist/kbd/keys.js +52 -0
- package/dist/kbd/root/kbd-root.d.ts +52 -1
- package/dist/kbd/root/kbd-root.js +40 -47
- package/dist/legend/hidden-series.d.ts +10 -2
- package/dist/legend/hidden-series.js +5 -2
- package/dist/legend/root/legend-root.d.ts +77 -12
- package/dist/legend/root/legend-root.js +71 -17
- package/dist/lightbox/root/lightbox-root.d.ts +98 -10
- package/dist/lightbox/root/lightbox-root.js +153 -18
- package/dist/lightbox/zoom-controller.d.ts +59 -0
- package/dist/lightbox/zoom-controller.js +128 -0
- package/dist/lightbox/zoom.d.ts +24 -0
- package/dist/lightbox/zoom.js +18 -0
- package/dist/line-chart/root/line-chart-root.d.ts +38 -1
- package/dist/line-chart/root/line-chart-root.js +31 -3
- package/dist/list/item/list-item.d.ts +2 -0
- package/dist/list/item/list-item.js +11 -2
- package/dist/list/root/list-root.d.ts +70 -13
- package/dist/list/root/list-root.js +91 -13
- package/dist/list/selection.d.ts +54 -7
- package/dist/list/selection.js +32 -7
- package/dist/listbox/root/listbox-root.d.ts +44 -4
- package/dist/listbox/root/listbox-root.js +72 -34
- 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/megamenu/hand-over.d.ts +75 -0
- package/dist/megamenu/hand-over.js +67 -0
- package/dist/megamenu/root/megamenu-root.d.ts +80 -15
- package/dist/megamenu/root/megamenu-root.js +76 -19
- package/dist/menu/item/menu-item.d.ts +51 -2
- package/dist/menu/item/menu-item.js +50 -26
- package/dist/menu/root/menu-root.d.ts +17 -0
- package/dist/menu/root/menu-root.js +2 -2
- package/dist/meter/root/meter-root.d.ts +62 -1
- package/dist/meter/root/meter-root.js +38 -16
- package/dist/navigation/root/navigation-root.d.ts +2 -1
- package/dist/navigation/root/navigation-root.js +2 -2
- package/dist/notifications/root/notifications-root.d.ts +20 -4
- package/dist/notifications/root/notifications-root.js +30 -8
- package/dist/number-input/grain.d.ts +28 -0
- package/dist/number-input/grain.js +14 -0
- package/dist/number-input/root/number-input-root.d.ts +34 -9
- package/dist/number-input/root/number-input-root.js +31 -25
- package/dist/object-inspector/root/object-inspector-root.d.ts +88 -33
- package/dist/object-inspector/root/object-inspector-root.js +134 -92
- package/dist/object-inspector/rows.d.ts +18 -0
- package/dist/object-inspector/rows.js +33 -0
- package/dist/option/index.d.ts +1 -0
- package/dist/option/index.js +1 -0
- package/dist/option/root/option-root.d.ts +5 -3
- package/dist/option/separator/option-separator.d.ts +30 -0
- package/dist/option/separator/option-separator.js +21 -0
- package/dist/outline/root/outline-root.d.ts +30 -0
- package/dist/outline/root/outline-root.js +17 -13
- package/dist/pagination/size/pagination-size.d.ts +6 -0
- package/dist/pagination/size/pagination-size.js +5 -3
- package/dist/pin-input/code.d.ts +37 -0
- package/dist/pin-input/code.js +25 -0
- package/dist/pin-input/root/pin-input-root.d.ts +116 -115
- package/dist/pin-input/root/pin-input-root.js +163 -155
- package/dist/popover/hide-outside.d.ts +14 -0
- package/dist/popover/hide-outside.js +34 -0
- package/dist/popover/root/popover-root.d.ts +64 -8
- package/dist/popover/root/popover-root.js +67 -4
- package/dist/progress/root/progress-root.d.ts +47 -0
- package/dist/progress/root/progress-root.js +34 -16
- package/dist/qr-code/export.d.ts +45 -1
- package/dist/qr-code/export.js +28 -0
- package/dist/qr-code/name.d.ts +11 -0
- package/dist/qr-code/name.js +7 -0
- package/dist/qr-code/root/qr-code-root.d.ts +36 -11
- package/dist/qr-code/root/qr-code-root.js +58 -11
- 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 +15 -0
- package/dist/radio/root/radio-root.d.ts +6 -2
- package/dist/radio/root/radio-root.js +7 -2
- package/dist/rating/root/rating-root.d.ts +30 -12
- package/dist/rating/root/rating-root.js +27 -27
- 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 +51 -1
- package/dist/scatter-chart/root/scatter-chart-root.js +64 -24
- package/dist/scroll-area/root/scroll-area-root.d.ts +22 -51
- package/dist/scroll-area/root/scroll-area-root.js +57 -173
- 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 +27 -8
- package/dist/scroll-area/scrollbar.js +10 -1
- package/dist/select/align.d.ts +47 -0
- package/dist/select/align.js +7 -0
- package/dist/select/root/select-root.d.ts +71 -0
- package/dist/select/root/select-root.js +78 -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 +59 -5
- package/dist/slider/root/slider-root.js +45 -3
- package/dist/sparkline/readings.d.ts +36 -0
- package/dist/sparkline/readings.js +36 -0
- package/dist/sparkline/root/sparkline-root.d.ts +121 -7
- package/dist/sparkline/root/sparkline-root.js +160 -26
- package/dist/speed-dial/item/speed-dial-item.d.ts +1 -1
- package/dist/speed-dial/item/speed-dial-item.js +2 -2
- package/dist/speed-dial/root/speed-dial-root.d.ts +6 -0
- package/dist/speed-dial/root/speed-dial-root.js +11 -3
- package/dist/splitter/root/splitter-root.d.ts +10 -12
- package/dist/splitter/root/splitter-root.js +211 -204
- 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 +5 -0
- package/dist/steps/reach.js +3 -0
- package/dist/steps/root/steps-root.d.ts +56 -3
- package/dist/steps/root/steps-root.js +50 -6
- package/dist/steps/step/step.d.ts +8 -0
- package/dist/steps/step/step.js +8 -3
- package/dist/switch/root/switch-root.d.ts +10 -0
- package/dist/table/column/table-column.d.ts +6 -10
- package/dist/table/column/table-column.js +8 -20
- package/dist/table/root/table-root.d.ts +31 -10
- package/dist/table/root/table-root.js +14 -18
- package/dist/table/row/table-row.d.ts +24 -0
- package/dist/table/row/table-row.js +37 -1
- package/dist/tabs/panel/tab-panel.d.ts +16 -3
- package/dist/tabs/panel/tab-panel.js +34 -5
- package/dist/tabs/root/tabs-root.d.ts +17 -3
- package/dist/tabs/root/tabs-root.js +1 -1
- package/dist/tabs/tab/tab.d.ts +5 -0
- package/dist/tabs/tab/tab.js +5 -2
- package/dist/tag/group/tag-group.d.ts +44 -5
- package/dist/tag/group/tag-group.js +60 -9
- package/dist/tag/root/tag-root.js +9 -2
- package/dist/textarea/root/textarea-root.d.ts +41 -2
- package/dist/textarea/root/textarea-root.js +39 -1
- package/dist/time-input/root/time-input-root.d.ts +10 -2
- package/dist/time-input/root/time-input-root.js +24 -13
- package/dist/time-picker/root/time-picker-root.d.ts +28 -17
- package/dist/time-picker/root/time-picker-root.js +18 -29
- 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.js +2 -2
- package/dist/toast/item/toast-item.d.ts +16 -3
- package/dist/toast/item/toast-item.js +22 -6
- package/dist/toast/root/toast-root.d.ts +34 -4
- package/dist/toast/root/toast-root.js +74 -13
- package/dist/toast/words.d.ts +12 -0
- package/dist/toast/words.js +25 -0
- package/dist/toggle/group/toggle-group.d.ts +52 -7
- package/dist/toggle/group/toggle-group.js +58 -44
- package/dist/toggle/root/toggle-root.js +2 -4
- package/dist/toolbar/root/toolbar-root.d.ts +21 -5
- package/dist/toolbar/root/toolbar-root.js +52 -8
- package/dist/tooltip/root/tooltip-root.d.ts +20 -3
- package/dist/tooltip/root/tooltip-root.js +18 -1
- package/dist/tour/back.d.ts +10 -0
- package/dist/tour/back.js +8 -0
- package/dist/tour/root/tour-root.d.ts +45 -2
- package/dist/tour/root/tour-root.js +53 -8
- package/dist/tour/stop/tour-stop.d.ts +3 -0
- package/dist/tour/stop/tour-stop.js +3 -3
- package/dist/tree/item/tree-item.d.ts +7 -3
- package/dist/tree/item/tree-item.js +3 -0
- package/dist/tree/root/tree-root.d.ts +24 -3
- package/dist/tree/root/tree-root.js +32 -13
- package/dist/tree/selection.js +2 -15
- package/dist/trend/figure.d.ts +16 -0
- package/dist/trend/figure.js +8 -0
- package/dist/trend/root/trend-root.d.ts +83 -19
- package/dist/trend/root/trend-root.js +59 -8
- package/dist/video/media-events.d.ts +13 -18
- package/dist/video/media-events.js +1 -5
- package/dist/video/root/extra-controls.d.ts +12 -0
- package/dist/video/root/extra-controls.js +6 -2
- package/dist/video/root/video-root.d.ts +23 -6
- package/dist/video/root/video-root.js +19 -10
- package/dist/video-playlist/menu/video-playlist-menu.d.ts +2 -0
- package/dist/video-playlist/menu/video-playlist-menu.js +2 -1
- package/dist/video-playlist/root/video-playlist-root.d.ts +17 -1
- package/dist/video-playlist/root/video-playlist-root.js +3 -0
- package/dist/virtual-list/fill.d.ts +11 -8
- package/dist/virtual-list/fill.js +10 -17
- package/dist/virtual-list/keys.d.ts +16 -7
- package/dist/virtual-list/keys.js +17 -6
- package/dist/virtual-list/plan.d.ts +65 -0
- package/dist/virtual-list/plan.js +27 -0
- package/dist/virtual-list/root/virtual-list-root.d.ts +136 -13
- package/dist/virtual-list/root/virtual-list-root.js +218 -51
- package/lint.json +1 -1
- package/package.json +8 -8
- package/types/jsx.d.ts +7441 -1458
- package/types/svelte.d.ts +1 -0
- package/types/vue.d.ts +1501 -326
- package/dist/chat/relative-clock.d.ts +0 -39
- package/dist/chat/relative-clock.js +0 -31
- package/dist/data-table/root/order.d.ts +0 -141
- package/dist/data-table/root/order.js +0 -76
- package/dist/tag/selection.d.ts +0 -10
- package/dist/tag/selection.js +0 -12
|
@@ -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.
|
|
@@ -71,8 +74,10 @@ declare const HelixHeadlessTimeInput_base: (new (...args: any[]) => import("@fus
|
|
|
71
74
|
* @csspart picker-column-search - The region that holds the filter field.
|
|
72
75
|
* @csspart picker-column-search-field - The filter field.
|
|
73
76
|
* @csspart picker-columns - The row of columns, in `wheels`.
|
|
77
|
+
* @csspart picker-feedback - The picker's own message, under the times, while the picker's `feedback` is set.
|
|
74
78
|
* @csspart picker-list - The listbox holding the times, in `list`.
|
|
75
79
|
* @csspart picker-list-empty - The text shown when the filter hides every option.
|
|
80
|
+
* @csspart picker-list-error - The list's `error` part, which the list never sets: its times do not load.
|
|
76
81
|
* @csspart picker-list-feedback - The inner list's message that says what is wrong with the value.
|
|
77
82
|
* @csspart picker-list-filter-icon - The icon beside the filter field.
|
|
78
83
|
* @csspart picker-list-filter-mark - The default icon beside the filter field, shown when none is slotted.
|
|
@@ -138,9 +143,12 @@ export declare class HelixHeadlessTimeInput extends HelixHeadlessTimeInput_base
|
|
|
138
143
|
/**
|
|
139
144
|
* Language tag the times are written in.
|
|
140
145
|
*
|
|
141
|
-
* Absent
|
|
146
|
+
* Absent is the page's: the `lang` of the nearest element with one, as
|
|
147
|
+
* Shoelace and Web Awesome read it, then the runtime's own.
|
|
142
148
|
*/
|
|
143
149
|
locale: string;
|
|
150
|
+
/** The locale the words are written in: `locale`, or the page's `lang`. */
|
|
151
|
+
private get language();
|
|
144
152
|
/**
|
|
145
153
|
* Latest time that can be chosen, as `HH:mm`.
|
|
146
154
|
*/
|
|
@@ -272,7 +280,7 @@ export declare class HelixHeadlessTimeInput extends HelixHeadlessTimeInput_base
|
|
|
272
280
|
/** Each time, where `mode` holds several, sent one entry each. */
|
|
273
281
|
protected get answers(): readonly string[] | undefined;
|
|
274
282
|
/** What is wrong with the times, which the text input cannot say. */
|
|
275
|
-
protected validate(): string;
|
|
283
|
+
protected validate(): string | readonly [keyof ValidityStateFlags, string];
|
|
276
284
|
/**
|
|
277
285
|
* Whether the panel shows one list of times or a column for each part of the
|
|
278
286
|
* time.
|
|
@@ -4,7 +4,7 @@ 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, valueAsTime as asTime, clockLocale, customElement, fillTemplate, timeAsValue as fromTime, HelixFormElement, isClockValue, MixinControllerOpen, MixinControllerValue, MixinField, MixinPickerEditing, MixinPickerField, MixinSegmentedField, MixinTokens, timeFault, writeClock, } from '@fusion.dev/helix-core';
|
|
7
|
+
import { AriaForwardController, valueAsTime as asTime, clockLocale, customElement, fillTemplate, timeAsValue as fromTime, HelixFormElement, isClockValue, localeOf, MixinControllerOpen, MixinControllerValue, MixinField, MixinPickerEditing, MixinPickerField, MixinSegmentedField, MixinTokens, timeFault, writeClock, } from '@fusion.dev/helix-core';
|
|
8
8
|
import { clock } from '@fusion.dev/helix-icons';
|
|
9
9
|
import { nothing } from 'lit';
|
|
10
10
|
import { property, state } from 'lit/decorators.js';
|
|
@@ -88,6 +88,9 @@ let HelixHeadlessTimeInput = class HelixHeadlessTimeInput extends MixinSegmented
|
|
|
88
88
|
}
|
|
89
89
|
};
|
|
90
90
|
}
|
|
91
|
+
get language() {
|
|
92
|
+
return localeOf(this, this.locale);
|
|
93
|
+
}
|
|
91
94
|
get held() {
|
|
92
95
|
return this.value
|
|
93
96
|
.replace(/\s+[–-]\s+/g, ',')
|
|
@@ -102,7 +105,7 @@ let HelixHeadlessTimeInput = class HelixHeadlessTimeInput extends MixinSegmented
|
|
|
102
105
|
return 'time';
|
|
103
106
|
}
|
|
104
107
|
get segmentLocale() {
|
|
105
|
-
return this.
|
|
108
|
+
return this.language;
|
|
106
109
|
}
|
|
107
110
|
get segmentOptions() {
|
|
108
111
|
return { hourCycle: this.hourCycle, seconds: this.seconds };
|
|
@@ -113,7 +116,7 @@ let HelixHeadlessTimeInput = class HelixHeadlessTimeInput extends MixinSegmented
|
|
|
113
116
|
written(at) {
|
|
114
117
|
return this.timeStyle === 'iso' || !this.isTime(at)
|
|
115
118
|
? at
|
|
116
|
-
: writeClock(at, clockLocale(this.
|
|
119
|
+
: writeClock(at, clockLocale(this.language, this.hourCycle), this.seconds);
|
|
117
120
|
}
|
|
118
121
|
get display() {
|
|
119
122
|
if (this.mode === 'multiple') {
|
|
@@ -152,14 +155,20 @@ let HelixHeadlessTimeInput = class HelixHeadlessTimeInput extends MixinSegmented
|
|
|
152
155
|
const rules = { disableTimes: this.disableTimes, max: this.max, min: this.min };
|
|
153
156
|
const faults = held.map((one) => timeFault(one, rules));
|
|
154
157
|
if (faults.includes('rangeUnderflow')) {
|
|
155
|
-
return
|
|
156
|
-
|
|
157
|
-
|
|
158
|
+
return [
|
|
159
|
+
'rangeUnderflow',
|
|
160
|
+
fillTemplate(this.rangeUnderflowMessage || 'Choose a time at or after {min}.', {
|
|
161
|
+
min: writeClock(this.min, clockLocale(this.language, this.hourCycle), this.seconds),
|
|
162
|
+
}),
|
|
163
|
+
];
|
|
158
164
|
}
|
|
159
165
|
if (faults.includes('rangeOverflow')) {
|
|
160
|
-
return
|
|
161
|
-
|
|
162
|
-
|
|
166
|
+
return [
|
|
167
|
+
'rangeOverflow',
|
|
168
|
+
fillTemplate(this.rangeOverflowMessage || 'Choose a time at or before {max}.', {
|
|
169
|
+
max: writeClock(this.max, clockLocale(this.language, this.hourCycle), this.seconds),
|
|
170
|
+
}),
|
|
171
|
+
];
|
|
163
172
|
}
|
|
164
173
|
if (faults.includes('unavailable')) {
|
|
165
174
|
return this.unavailableMessage || 'Choose a time that is available.';
|
|
@@ -178,13 +187,13 @@ let HelixHeadlessTimeInput = class HelixHeadlessTimeInput extends MixinSegmented
|
|
|
178
187
|
renderPicker() {
|
|
179
188
|
return html `<${this.tag('time-picker')}
|
|
180
189
|
part="picker"
|
|
181
|
-
exportparts="column: picker-column, column-empty: picker-column-empty,
|
|
190
|
+
exportparts="column: picker-column, column-empty: picker-column-empty, column-error: picker-column-error,
|
|
182
191
|
column-feedback: picker-column-feedback, column-filter-icon: picker-column-filter-icon,
|
|
183
192
|
column-filter-mark: picker-column-filter-mark, column-hint: picker-column-hint,
|
|
184
193
|
column-items: picker-column-items, column-label: picker-column-label,
|
|
185
194
|
column-live: picker-column-live, column-loading: picker-column-loading, column-search: picker-column-search,
|
|
186
|
-
column-search-field: picker-column-search-field, columns: picker-columns, list: picker-list,
|
|
187
|
-
list-empty: picker-list-empty, list-feedback: picker-list-feedback,
|
|
195
|
+
column-search-field: picker-column-search-field, columns: picker-columns, feedback: picker-feedback, list: picker-list,
|
|
196
|
+
list-empty: picker-list-empty, list-error: picker-list-error, list-feedback: picker-list-feedback,
|
|
188
197
|
list-filter-icon: picker-list-filter-icon, list-filter-mark: picker-list-filter-mark,
|
|
189
198
|
list-hint: picker-list-hint, list-items: picker-list-items, list-label: picker-list-label,
|
|
190
199
|
list-live: picker-list-live, list-loading: picker-list-loading, list-search: picker-list-search,
|
|
@@ -200,7 +209,7 @@ let HelixHeadlessTimeInput = class HelixHeadlessTimeInput extends MixinSegmented
|
|
|
200
209
|
manual
|
|
201
210
|
label=${this.label || 'Time'}
|
|
202
211
|
hour-cycle=${this.hourCycle ?? nothing}
|
|
203
|
-
locale=${this.
|
|
212
|
+
locale=${this.language || nothing}
|
|
204
213
|
max=${this.max}
|
|
205
214
|
min=${this.min}
|
|
206
215
|
?seconds=${this.seconds}
|
|
@@ -285,7 +294,9 @@ let HelixHeadlessTimeInput = class HelixHeadlessTimeInput extends MixinSegmented
|
|
|
285
294
|
?hidden=${!this.open}
|
|
286
295
|
@keydown=${this.handleWheelEnter}
|
|
287
296
|
>
|
|
297
|
+
<slot name="panel-header"></slot>
|
|
288
298
|
${this.renderPicker()}
|
|
299
|
+
<slot name="panel-footer"></slot>
|
|
289
300
|
</div>
|
|
290
301
|
${this.renderHint()}${this.renderFeedback()}`;
|
|
291
302
|
}
|
|
@@ -2,7 +2,7 @@ import { HelixFormElement, type HourCycle } from '@fusion.dev/helix-core';
|
|
|
2
2
|
import { type PropertyValues, type TemplateResult } from 'lit';
|
|
3
3
|
import '../../listbox/index.js';
|
|
4
4
|
import '../../option/index.js';
|
|
5
|
-
declare const HelixHeadlessTimePicker_base: (new (...args: any[]) => import("@fusion.dev/helix-core").MixinControllerValueInterface) & typeof HelixFormElement;
|
|
5
|
+
declare const HelixHeadlessTimePicker_base: (new (...args: any[]) => import("@fusion.dev/helix-core").MixinPickerFeedbackInterface) & (new (...args: any[]) => import("@fusion.dev/helix-core").MixinControllerValueInterface) & typeof HelixFormElement;
|
|
6
6
|
/**
|
|
7
7
|
* @summary A control for choosing a time from a list or from wheels.
|
|
8
8
|
*
|
|
@@ -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.
|
|
@@ -58,8 +59,10 @@ declare const HelixHeadlessTimePicker_base: (new (...args: any[]) => import("@fu
|
|
|
58
59
|
* @csspart column-search - The region that holds the filter field.
|
|
59
60
|
* @csspart column-search-field - The filter field.
|
|
60
61
|
* @csspart columns - The row of columns, in `wheels`.
|
|
62
|
+
* @csspart feedback - The message under the times, while `feedback` is set.
|
|
61
63
|
* @csspart list - The listbox holding the times, in `list`.
|
|
62
64
|
* @csspart list-empty - The text shown when the filter hides every option.
|
|
65
|
+
* @csspart list-error - The list's `error` part, which Time Picker never sets: its times do not load.
|
|
63
66
|
* @csspart list-feedback - The message that says what is wrong with the value.
|
|
64
67
|
* @csspart list-filter-icon - The icon beside the filter field.
|
|
65
68
|
* @csspart list-filter-mark - The default icon beside the filter field, shown when none is slotted.
|
|
@@ -78,6 +81,8 @@ declare const HelixHeadlessTimePicker_base: (new (...args: any[]) => import("@fu
|
|
|
78
81
|
* @csspart option-item-selected - The row of a chosen time: the one time, or either end of a range.
|
|
79
82
|
* @csspart option-label - The time's label.
|
|
80
83
|
* @csspart option-text - The label and the caption, as one column.
|
|
84
|
+
*
|
|
85
|
+
* @cssstate invalid - While `invalid` is set or `feedback` says what is wrong.
|
|
81
86
|
*/
|
|
82
87
|
export declare class HelixHeadlessTimePicker extends HelixHeadlessTimePicker_base {
|
|
83
88
|
/**
|
|
@@ -112,18 +117,11 @@ export declare class HelixHeadlessTimePicker extends HelixHeadlessTimePicker_bas
|
|
|
112
117
|
hourCycle?: HourCycle;
|
|
113
118
|
/**
|
|
114
119
|
* What the wheel of hours is called, read by screen readers.
|
|
115
|
-
*/
|
|
116
|
-
hourLabel: string;
|
|
117
|
-
/**
|
|
118
|
-
* Whether the current selection fails validation.
|
|
119
120
|
*
|
|
120
|
-
*
|
|
121
|
-
*
|
|
122
|
-
* the label, the hint and the feedback, and a second message inside the panel
|
|
123
|
-
* would be the same error said twice. What is left for the picker is the one
|
|
124
|
-
* thing the field cannot draw from outside, the mark on the answer itself.
|
|
121
|
+
* Absent is the locale's own word, from `Intl.DisplayNames`: "Hour" in
|
|
122
|
+
* English, "Stunde" in German.
|
|
125
123
|
*/
|
|
126
|
-
|
|
124
|
+
hourLabel?: string;
|
|
127
125
|
/**
|
|
128
126
|
* Accessible name for the list, which has no visible one of its own.
|
|
129
127
|
*
|
|
@@ -131,11 +129,14 @@ export declare class HelixHeadlessTimePicker extends HelixHeadlessTimePicker_bas
|
|
|
131
129
|
*/
|
|
132
130
|
label: string;
|
|
133
131
|
/**
|
|
134
|
-
* Language tag the times are written in.
|
|
132
|
+
* Language tag the times and the wheels' names are written in.
|
|
135
133
|
*
|
|
136
|
-
* Absent
|
|
134
|
+
* Absent is the page's: the `lang` of the nearest element with one, as
|
|
135
|
+
* Shoelace and Web Awesome read it, then the runtime's own.
|
|
137
136
|
*/
|
|
138
137
|
locale: string;
|
|
138
|
+
/** The locale the words are written in: `locale`, or the page's `lang`. */
|
|
139
|
+
private get language();
|
|
139
140
|
/**
|
|
140
141
|
* Stops the arrow keys in the list from choosing each time they move to.
|
|
141
142
|
* Enter, Space or a click chooses.
|
|
@@ -151,16 +152,22 @@ export declare class HelixHeadlessTimePicker extends HelixHeadlessTimePicker_bas
|
|
|
151
152
|
/**
|
|
152
153
|
* What the wheel of the half of the day is called, read by screen readers.
|
|
153
154
|
* Its two options are written as the locale writes them, such as AM and PM.
|
|
155
|
+
*
|
|
156
|
+
* Absent is the locale's own word, from `Intl.DisplayNames`: "AM/PM" in
|
|
157
|
+
* English, "Tageshälfte" in German.
|
|
154
158
|
*/
|
|
155
|
-
meridiemLabel
|
|
159
|
+
meridiemLabel?: string;
|
|
156
160
|
/**
|
|
157
161
|
* Earliest time offered, as `HH:mm`.
|
|
158
162
|
*/
|
|
159
163
|
min: string;
|
|
160
164
|
/**
|
|
161
165
|
* What the wheel of minutes is called, read by screen readers.
|
|
166
|
+
*
|
|
167
|
+
* Absent is the locale's own word, from `Intl.DisplayNames`: "Minute" in
|
|
168
|
+
* English and German, "分" in Japanese.
|
|
162
169
|
*/
|
|
163
|
-
minuteLabel
|
|
170
|
+
minuteLabel?: string;
|
|
164
171
|
/**
|
|
165
172
|
* How many times can be held at once.
|
|
166
173
|
*
|
|
@@ -322,8 +329,11 @@ export declare class HelixHeadlessTimePicker extends HelixHeadlessTimePicker_bas
|
|
|
322
329
|
required: boolean;
|
|
323
330
|
/**
|
|
324
331
|
* What the wheel of seconds is called, read by screen readers.
|
|
332
|
+
*
|
|
333
|
+
* Absent is the locale's own word, from `Intl.DisplayNames`: "Second" in
|
|
334
|
+
* English, "Sekunde" in German.
|
|
325
335
|
*/
|
|
326
|
-
secondLabel
|
|
336
|
+
secondLabel?: string;
|
|
327
337
|
/**
|
|
328
338
|
* Whether times carry their seconds.
|
|
329
339
|
*
|
|
@@ -446,7 +456,8 @@ export declare class HelixHeadlessTimePicker extends HelixHeadlessTimePicker_bas
|
|
|
446
456
|
private listRevealed;
|
|
447
457
|
/**
|
|
448
458
|
* The list's name: the host's `aria-labelledby` read out, then its
|
|
449
|
-
* `aria-label`, then `label
|
|
459
|
+
* `aria-label`, then `label`, through core's `hostWords`, which Select reads
|
|
460
|
+
* its list's name through too.
|
|
450
461
|
*
|
|
451
462
|
* Read out as words, because the list is inside two shadow roots and an id on
|
|
452
463
|
* the page reaches neither. Measured before this: `<helix-time-picker
|
|
@@ -4,25 +4,22 @@ 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 { clockLocale, commaList, customElement, dayPeriod,
|
|
7
|
+
import { clockLocale, commaList, customElement, dayPeriod, fillTemplate, HelixFormElement, hostWords, inlineStep, isTwelveHour, localeOf, MixinControllerValue, MixinPickerFeedback, nearestTime, offeredTimes, reportValues, secondsAsValue, timeBarred, timeFault, valueAsSeconds, wheelParts, wholeHour, writeClock, } from '@fusion.dev/helix-core';
|
|
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
|
-
let HelixHeadlessTimePicker = class HelixHeadlessTimePicker extends MixinControllerValue(HelixFormElement) {
|
|
14
|
+
let HelixHeadlessTimePicker = class HelixHeadlessTimePicker extends MixinPickerFeedback(MixinControllerValue(HelixFormElement)) {
|
|
14
15
|
constructor() {
|
|
15
16
|
super(...arguments);
|
|
16
17
|
this.disableTimes = '';
|
|
17
|
-
this.hourLabel = 'Hour';
|
|
18
|
-
this.invalid = false;
|
|
19
18
|
this.label = 'Time';
|
|
20
19
|
this.locale = '';
|
|
21
20
|
this.manual = false;
|
|
22
21
|
this.max = '23:59';
|
|
23
|
-
this.meridiemLabel = 'Before or after noon';
|
|
24
22
|
this.min = '00:00';
|
|
25
|
-
this.minuteLabel = 'Minute';
|
|
26
23
|
this.handleListInput = (event) => {
|
|
27
24
|
event.stopPropagation();
|
|
28
25
|
};
|
|
@@ -77,7 +74,6 @@ let HelixHeadlessTimePicker = class HelixHeadlessTimePicker extends MixinControl
|
|
|
77
74
|
};
|
|
78
75
|
this.readOnly = false;
|
|
79
76
|
this.required = false;
|
|
80
|
-
this.secondLabel = 'Second';
|
|
81
77
|
this.seconds = false;
|
|
82
78
|
this.step = 15;
|
|
83
79
|
this.listRevealed = false;
|
|
@@ -97,11 +93,14 @@ let HelixHeadlessTimePicker = class HelixHeadlessTimePicker extends MixinControl
|
|
|
97
93
|
next.focus();
|
|
98
94
|
};
|
|
99
95
|
}
|
|
96
|
+
get language() {
|
|
97
|
+
return localeOf(this, this.locale);
|
|
98
|
+
}
|
|
100
99
|
get times() {
|
|
101
100
|
return offeredTimes(this.min, this.max, this.step, this.seconds);
|
|
102
101
|
}
|
|
103
102
|
get clock() {
|
|
104
|
-
return clockLocale(this.
|
|
103
|
+
return clockLocale(this.language, this.hourCycle);
|
|
105
104
|
}
|
|
106
105
|
valueFor(at) {
|
|
107
106
|
return secondsAsValue(at, this.seconds);
|
|
@@ -242,13 +241,7 @@ let HelixHeadlessTimePicker = class HelixHeadlessTimePicker extends MixinControl
|
|
|
242
241
|
this.reveal();
|
|
243
242
|
}
|
|
244
243
|
get listName() {
|
|
245
|
-
|
|
246
|
-
.split(/\s+/)
|
|
247
|
-
.filter(Boolean)
|
|
248
|
-
.map((id) => elementById(this, id)?.textContent?.trim() ?? '')
|
|
249
|
-
.filter(Boolean)
|
|
250
|
-
.join(' ');
|
|
251
|
-
return named || this.getAttribute('aria-label') || this.label;
|
|
244
|
+
return hostWords(this, this.label);
|
|
252
245
|
}
|
|
253
246
|
connectedCallback() {
|
|
254
247
|
super.connectedCallback();
|
|
@@ -262,7 +255,6 @@ let HelixHeadlessTimePicker = class HelixHeadlessTimePicker extends MixinControl
|
|
|
262
255
|
}
|
|
263
256
|
willUpdate(changed) {
|
|
264
257
|
super.willUpdate(changed);
|
|
265
|
-
this.internals.ariaInvalid = this.invalid ? 'true' : null;
|
|
266
258
|
this.report();
|
|
267
259
|
}
|
|
268
260
|
updated(changed) {
|
|
@@ -285,8 +277,8 @@ let HelixHeadlessTimePicker = class HelixHeadlessTimePicker extends MixinControl
|
|
|
285
277
|
return html `<${this.tag('listbox')}
|
|
286
278
|
part="column"
|
|
287
279
|
data-column=${part}
|
|
288
|
-
aria-invalid=${this.
|
|
289
|
-
exportparts="empty: column-empty, feedback: column-feedback, filter-icon: column-filter-icon,
|
|
280
|
+
aria-invalid=${this.marked ? 'true' : nothing}
|
|
281
|
+
exportparts="empty: column-empty, error: column-error, feedback: column-feedback, filter-icon: column-filter-icon,
|
|
290
282
|
filter-mark: column-filter-mark, hint: column-hint, items: column-items, label: column-label,
|
|
291
283
|
live: column-live, loading: column-loading, search: column-search, search-field: column-search-field"
|
|
292
284
|
aria-label=${label}
|
|
@@ -323,21 +315,21 @@ let HelixHeadlessTimePicker = class HelixHeadlessTimePicker extends MixinControl
|
|
|
323
315
|
data-unset=${this.value === '' ? '' : nothing}
|
|
324
316
|
@keydown=${this.handleColumnsKeydown}
|
|
325
317
|
>
|
|
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))}
|
|
318
|
+
${this.renderColumn('hour', this.hourLabel ?? wheelName('hour', this.language), hours.map(String), (one) => (twelve ? one : one.padStart(2, '0')), String(shown), (one) => this.wholeHourBarred(Number(one), twelve ? meridiem : undefined))}
|
|
319
|
+
${this.renderColumn('minute', this.minuteLabel ?? wheelName('minute', this.language), this.minutes.map(String), (one) => one.padStart(2, '0'), String(minute), (one) => this.barredAt(hour * 3600 + Number(one) * 60))}
|
|
328
320
|
${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)))
|
|
321
|
+
? this.renderColumn('second', this.secondLabel ?? wheelName('second', this.language), this.secondsShown.map(String), (one) => one.padStart(2, '0'), String(second), (one) => this.barredAt(hour * 3600 + minute * 60 + Number(one)))
|
|
330
322
|
: nothing}
|
|
331
323
|
${twelve
|
|
332
|
-
? this.renderColumn('meridiem', this.meridiemLabel, ['AM', 'PM'], (one) => dayPeriod(one, this.clock), meridiem, (one) => this.halfBarred(one))
|
|
324
|
+
? this.renderColumn('meridiem', this.meridiemLabel ?? wheelName('dayPeriod', this.language), ['AM', 'PM'], (one) => dayPeriod(one, this.clock), meridiem, (one) => this.halfBarred(one))
|
|
333
325
|
: nothing}
|
|
334
326
|
</div>`;
|
|
335
327
|
}
|
|
336
328
|
renderList() {
|
|
337
329
|
return html `<${this.tag('listbox')}
|
|
338
330
|
part="list"
|
|
339
|
-
aria-invalid=${this.
|
|
340
|
-
exportparts="empty: list-empty, feedback: list-feedback, filter-icon: list-filter-icon,
|
|
331
|
+
aria-invalid=${this.marked ? 'true' : nothing}
|
|
332
|
+
exportparts="empty: list-empty, error: list-error, feedback: list-feedback, filter-icon: list-filter-icon,
|
|
341
333
|
filter-mark: list-filter-mark, hint: list-hint, items: list-items, label: list-label,
|
|
342
334
|
live: list-live, loading: list-loading, search: list-search, search-field: list-search-field"
|
|
343
335
|
aria-label=${this.listName}
|
|
@@ -368,9 +360,9 @@ let HelixHeadlessTimePicker = class HelixHeadlessTimePicker extends MixinControl
|
|
|
368
360
|
}
|
|
369
361
|
render() {
|
|
370
362
|
if (this.variant === 'wheels' && this.mode === undefined) {
|
|
371
|
-
return this.renderSpinner()
|
|
363
|
+
return html `${this.renderSpinner()}${this.renderPickerFeedback()}`;
|
|
372
364
|
}
|
|
373
|
-
return html `${this.renderList()}`;
|
|
365
|
+
return html `${this.renderList()}${this.renderPickerFeedback()}`;
|
|
374
366
|
}
|
|
375
367
|
get valueAsDate() {
|
|
376
368
|
const at = valueAsSeconds(this.value);
|
|
@@ -401,9 +393,6 @@ __decorate([
|
|
|
401
393
|
__decorate([
|
|
402
394
|
property({ attribute: 'hour-label' })
|
|
403
395
|
], HelixHeadlessTimePicker.prototype, "hourLabel", void 0);
|
|
404
|
-
__decorate([
|
|
405
|
-
property({ reflect: true, type: Boolean })
|
|
406
|
-
], HelixHeadlessTimePicker.prototype, "invalid", void 0);
|
|
407
396
|
__decorate([
|
|
408
397
|
property()
|
|
409
398
|
], HelixHeadlessTimePicker.prototype, "label", void 0);
|
|
@@ -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
|
+
};
|
|
@@ -4,7 +4,7 @@ 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 { customElement, HelixElement, hostAria } from '@fusion.dev/helix-core';
|
|
7
|
+
import { customElement, HelixElement, headingLevel, hostAria } from '@fusion.dev/helix-core';
|
|
8
8
|
import { html } from 'lit';
|
|
9
9
|
import { property } from 'lit/decorators.js';
|
|
10
10
|
const HEADING_ID = 'heading';
|
|
@@ -18,7 +18,7 @@ let HelixHeadlessTimelineGroup = class HelixHeadlessTimelineGroup extends HelixE
|
|
|
18
18
|
hostAria(this.internals, { role: 'listitem' });
|
|
19
19
|
}
|
|
20
20
|
render() {
|
|
21
|
-
const level =
|
|
21
|
+
const level = headingLevel(this.headingLevel);
|
|
22
22
|
return html `<div part="heading" id=${HEADING_ID} role="heading" aria-level=${level}>
|
|
23
23
|
<slot name="heading">${this.label}</slot>
|
|
24
24
|
</div>
|
|
@@ -13,9 +13,11 @@ 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.
|
|
17
|
-
*
|
|
18
|
-
*
|
|
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. The region
|
|
19
|
+
* says each message once as it arrives, a `danger` one assertively, so a
|
|
20
|
+
* message is never a live region of its own.
|
|
19
21
|
*
|
|
20
22
|
* A touch or a pen swipes a message toward the end of the line, and past
|
|
21
23
|
* halfway, or quickly, dismisses it through the same `helix-dismiss` as its
|
|
@@ -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.
|
|
@@ -114,6 +120,13 @@ export declare class HelixHeadlessToastItem extends HelixHeadlessToastItem_base
|
|
|
114
120
|
connectedCallback(): void;
|
|
115
121
|
protected willUpdate(changed: PropertyValues): void;
|
|
116
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;
|
|
117
130
|
protected firstUpdated(changed: PropertyValues): void;
|
|
118
131
|
/**
|
|
119
132
|
* The mark for the message's tone, behind a seam.
|
|
@@ -46,6 +46,17 @@ let HelixHeadlessToastItem = class HelixHeadlessToastItem extends MixinDismissib
|
|
|
46
46
|
this.handleResume = () => {
|
|
47
47
|
this.countdown.release();
|
|
48
48
|
};
|
|
49
|
+
this.name = () => {
|
|
50
|
+
const words = this.partNamed('content');
|
|
51
|
+
if (!words) {
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
const heading = this.assigned('heading');
|
|
55
|
+
hostAria(this.internals, {
|
|
56
|
+
describedBy: this.assigned('description'),
|
|
57
|
+
labelledBy: heading.length > 0 ? heading : [words],
|
|
58
|
+
});
|
|
59
|
+
};
|
|
49
60
|
}
|
|
50
61
|
get open() {
|
|
51
62
|
return this.openState ?? true;
|
|
@@ -93,14 +104,15 @@ let HelixHeadlessToastItem = class HelixHeadlessToastItem extends MixinDismissib
|
|
|
93
104
|
this.toggleAttribute('hidden', !this.open);
|
|
94
105
|
hostAria(this.internals, { role: 'alertdialog' });
|
|
95
106
|
this.internals.ariaModal = 'false';
|
|
96
|
-
this.internals.ariaLive = this.tone === 'danger' ? 'assertive' : null;
|
|
97
107
|
}
|
|
98
108
|
updated(changed) {
|
|
99
109
|
super.updated(changed);
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
110
|
+
this.name();
|
|
111
|
+
}
|
|
112
|
+
assigned(name) {
|
|
113
|
+
return (this.renderRoot
|
|
114
|
+
?.querySelector(`slot[name="${name}"]`)
|
|
115
|
+
?.assignedElements({ flatten: true }) ?? []);
|
|
104
116
|
}
|
|
105
117
|
firstUpdated(changed) {
|
|
106
118
|
super.firstUpdated(changed);
|
|
@@ -137,7 +149,11 @@ let HelixHeadlessToastItem = class HelixHeadlessToastItem extends MixinDismissib
|
|
|
137
149
|
${this.renderIcon(mark)}
|
|
138
150
|
</span>`
|
|
139
151
|
: nothing}
|
|
140
|
-
<div part="content"
|
|
152
|
+
<div part="content">
|
|
153
|
+
<slot name="heading" part="heading" @slotchange=${this.name}></slot>
|
|
154
|
+
<slot name="description" part="description" @slotchange=${this.name}></slot>
|
|
155
|
+
<slot></slot>
|
|
156
|
+
</div>
|
|
141
157
|
<div part="actions"><slot name="actions"></slot></div>
|
|
142
158
|
${this.dismissible
|
|
143
159
|
? drawDismiss({
|
|
@@ -9,10 +9,15 @@ import { type PropertyValues, type TemplateResult } from 'lit';
|
|
|
9
9
|
* announce a region that arrives already holding its message. `Radio.Group` is
|
|
10
10
|
* part of its family for the same reason.
|
|
11
11
|
*
|
|
12
|
-
* **The region is a landmark named by `label`, and
|
|
13
|
-
* `danger` message
|
|
14
|
-
*
|
|
15
|
-
*
|
|
12
|
+
* **The region is a landmark named by `label`, and it says each message once
|
|
13
|
+
* as it arrives**: a `danger` message assertively, and every other one
|
|
14
|
+
* politely. It says the word for the tone, the heading, the description and
|
|
15
|
+
* the text, and not the actions, through two live regions of its own, the
|
|
16
|
+
* `live` parts, which it empties again a moment later. The stack itself is not
|
|
17
|
+
* a live region, so a message is never said twice, and changing the words of a
|
|
18
|
+
* message already showing says nothing. Each message is an `alertdialog` named
|
|
19
|
+
* by its words, so a reader who moves into the stack hears which message they
|
|
20
|
+
* are on.
|
|
16
21
|
*
|
|
17
22
|
* **`hotkey` takes focus to the stack and back**, F8 unless you set it, and
|
|
18
23
|
* `label` says which key: `{hotkey}` in it is filled in, so the default name
|
|
@@ -54,6 +59,7 @@ import { type PropertyValues, type TemplateResult } from 'lit';
|
|
|
54
59
|
*
|
|
55
60
|
* @event {HelixDismissEvent} helix-dismiss - A message is being dismissed, by its control or by its timer. The message sends it, and you can listen for it on the region. Cancelable: canceling it keeps the message.
|
|
56
61
|
*
|
|
62
|
+
* @csspart live - The two regions that say each message as it arrives, a polite `status` and an assertive `alert`, inside the stack. Empty at rest, and hide them with the standard clip, never `display: none`.
|
|
57
63
|
* @csspart region - The stack the messages are in. It is in the top layer while a message shows, and takes focus from `hotkey` where no message holds a control.
|
|
58
64
|
*/
|
|
59
65
|
export declare class HelixHeadlessToast extends HelixElement {
|
|
@@ -95,6 +101,24 @@ export declare class HelixHeadlessToast extends HelixElement {
|
|
|
95
101
|
*/
|
|
96
102
|
placement?: 'bottom-center' | 'bottom-end' | 'bottom-start' | 'top-center' | 'top-end' | 'top-start';
|
|
97
103
|
protected willUpdate(changed: PropertyValues): void;
|
|
104
|
+
/** What the polite region is saying. */
|
|
105
|
+
private said;
|
|
106
|
+
/** What the assertive region is saying. */
|
|
107
|
+
private urgent;
|
|
108
|
+
private readonly hush;
|
|
109
|
+
/**
|
|
110
|
+
* Says messages that have just arrived, each once, `danger` ones assertively.
|
|
111
|
+
*
|
|
112
|
+
* Emptied first and filled a frame later, so a message with the same words
|
|
113
|
+
* as the one before is still a change, and so a region the stack has just
|
|
114
|
+
* shown is in the accessibility tree before its words land.
|
|
115
|
+
*/
|
|
116
|
+
private announce;
|
|
117
|
+
/**
|
|
118
|
+
* Says the messages that have just arrived: through the regions, or through
|
|
119
|
+
* `ariaNotify` where a modal dialog has made them inert.
|
|
120
|
+
*/
|
|
121
|
+
private tell;
|
|
98
122
|
/** The element focus came from when it entered the stack. */
|
|
99
123
|
private focusOrigin;
|
|
100
124
|
private readonly scope;
|
|
@@ -109,10 +133,16 @@ export declare class HelixHeadlessToast extends HelixElement {
|
|
|
109
133
|
* stack, holding `message` as its text. The region removes it once it has
|
|
110
134
|
* been dismissed and has finished leaving, which is the one case where it
|
|
111
135
|
* removes anything: a message you render stays yours.
|
|
136
|
+
*
|
|
137
|
+
* `heading` gives the message a title, which names it, and `message` becomes
|
|
138
|
+
* the line of detail under it. `action` is an element for the message's
|
|
139
|
+
* `actions` slot, such as an Undo button you have wired up.
|
|
112
140
|
*/
|
|
113
141
|
add(message: string, options?: {
|
|
142
|
+
action?: Element;
|
|
114
143
|
dismissible?: boolean;
|
|
115
144
|
duration?: number;
|
|
145
|
+
heading?: string;
|
|
116
146
|
tone?: 'danger' | 'info' | 'success' | 'warning';
|
|
117
147
|
}): HTMLElement;
|
|
118
148
|
/** Removes a message `add()` made, once it has hidden and finished leaving. */
|