@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
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type Curve, HelixElement, SourceController } from '@fusion.dev/helix-core';
|
|
2
|
-
import { type PropertyValues, type TemplateResult } from 'lit';
|
|
1
|
+
import { ChartPointerController, type Curve, HelixElement, type Series, SourceController } from '@fusion.dev/helix-core';
|
|
2
|
+
import { nothing, type PropertyValues, type TemplateResult } from 'lit';
|
|
3
3
|
/**
|
|
4
4
|
* @summary A small chart with no axes that shows the shape of a series beside its number.
|
|
5
5
|
*
|
|
@@ -13,8 +13,22 @@ import { type PropertyValues, type TemplateResult } from 'lit';
|
|
|
13
13
|
* are set.
|
|
14
14
|
*
|
|
15
15
|
* Without a `label` the sparkline is decorative and `aria-hidden`, for example
|
|
16
|
-
* beside a stat that already says "Sessions, 1,102". With a `label` it is
|
|
17
|
-
*
|
|
16
|
+
* beside a stat that already says "Sessions, 1,102". With a `label` it is
|
|
17
|
+
* named by that sentence and read by key, as every chart is: the drawing takes
|
|
18
|
+
* focus, the arrow keys walk the readings, Home and End go to the first and
|
|
19
|
+
* the last, Escape puts the reading away, and the `live` part says each
|
|
20
|
+
* reading with where it stands, such as "Mon: 12 (3 of 7)".
|
|
21
|
+
*
|
|
22
|
+
* **A named sparkline describes itself.** Beside its name, a screen reader
|
|
23
|
+
* hears what the readings come to, the first and the last, the highest and
|
|
24
|
+
* the lowest, in `overview-label`: "From 12 to 20, highest 30, lowest 8". An
|
|
25
|
+
* `aria-label` on the element names it as `label` does.
|
|
26
|
+
*
|
|
27
|
+
* A pointer resting on the drawing shows the reading under it: the `cursor`
|
|
28
|
+
* part marks it and the `readout` part writes it. `marks` adds a mark on the
|
|
29
|
+
* highest and the lowest reading, and `range` draws a band between two values,
|
|
30
|
+
* such as a normal range. A blank cell in a `for` table is a gap in the line,
|
|
31
|
+
* and a reading alone between two blanks is a `lone` mark.
|
|
18
32
|
*
|
|
19
33
|
* Place it beside a `Stat`, because a change beside a figure is a second fact,
|
|
20
34
|
* as `Stat`'s own spec says. `Trend` is composed the same way.
|
|
@@ -32,8 +46,16 @@ import { type PropertyValues, type TemplateResult } from 'lit';
|
|
|
32
46
|
*
|
|
33
47
|
* @csspart area - The region between the line and the bottom of its range.
|
|
34
48
|
* @csspart bar - One column, drawn when `plot="bar"`.
|
|
49
|
+
* @csspart cursor - The mark on the reading a pointer or a key rests on, rendered only while there is one. Placed with `inset-inline-start` and `inset-block-start`.
|
|
50
|
+
* @csspart high - The mark on the highest reading, under `marks="high"`. Placed as `cursor` is.
|
|
35
51
|
* @csspart line - The line's path.
|
|
36
|
-
* @csspart
|
|
52
|
+
* @csspart live - A polite region that says the reading a key moved to, rendered only with a `label`. Hide it visually.
|
|
53
|
+
* @csspart lone - The mark on a reading no line reaches, with a blank or an end on each side. Placed as `cursor` is.
|
|
54
|
+
* @csspart low - The mark on the lowest reading, under `marks="low"`. Placed as `cursor` is.
|
|
55
|
+
* @csspart overview - What the readings come to, in `overview-label`, which describes the drawing. Rendered `hidden` with a name, since it is read through the description and not shown.
|
|
56
|
+
* @csspart range - The band between the two values of `range`, drawn behind the line.
|
|
57
|
+
* @csspart readout - The reading a pointer or a key rests on, as the table or `values` writes it, rendered only while there is one. Placed as `cursor` is.
|
|
58
|
+
* @csspart svg - The drawing, which takes focus to be read by key where there is a `label`.
|
|
37
59
|
* @csspart terminus - The mark on the last value.
|
|
38
60
|
* @csspart wash-end - The far stop of the area's gradient.
|
|
39
61
|
* @csspart wash-start - The stop of the area's gradient that meets the line.
|
|
@@ -91,6 +113,31 @@ export declare class HelixHeadlessSparkline extends HelixElement {
|
|
|
91
113
|
* than announced without a name.
|
|
92
114
|
*/
|
|
93
115
|
label: string;
|
|
116
|
+
/**
|
|
117
|
+
* The locale the readout's numbers and positions are written in, such as
|
|
118
|
+
* `de` for `1.240`.
|
|
119
|
+
*
|
|
120
|
+
* Absent uses the runtime's own. A table's cells are shown as the table
|
|
121
|
+
* writes them, whatever this says.
|
|
122
|
+
*/
|
|
123
|
+
locale: string;
|
|
124
|
+
/**
|
|
125
|
+
* Which readings take a mark of their own: `high`, `low`, or both,
|
|
126
|
+
* separated by spaces.
|
|
127
|
+
*
|
|
128
|
+
* Absent marks none, and the drawing is what it was. Each mark is a part,
|
|
129
|
+
* placed at its reading, for a stylesheet to draw.
|
|
130
|
+
*/
|
|
131
|
+
marks: string;
|
|
132
|
+
/**
|
|
133
|
+
* What the readings come to, said after the name: `{first}` and `{last}`
|
|
134
|
+
* for the first and the last reading, `{high}` and `{low}` for the highest
|
|
135
|
+
* and the lowest, each written as the readout writes it.
|
|
136
|
+
*
|
|
137
|
+
* Set it to the words of the page's language, or to nothing to say no
|
|
138
|
+
* more than the name. Said only where the sparkline is named.
|
|
139
|
+
*/
|
|
140
|
+
overviewLabel: string;
|
|
94
141
|
/**
|
|
95
142
|
* What the readings are drawn as.
|
|
96
143
|
*
|
|
@@ -121,6 +168,23 @@ export declare class HelixHeadlessSparkline extends HelixElement {
|
|
|
121
168
|
* is markup, the same reason `curve` lives here.
|
|
122
169
|
*/
|
|
123
170
|
plot?: 'area' | 'bar' | 'line';
|
|
171
|
+
/**
|
|
172
|
+
* Where a reading the keys moved to stands among the readings, said after
|
|
173
|
+
* it. `{position}` and `{count}` are replaced with the numbers, written in
|
|
174
|
+
* `locale`.
|
|
175
|
+
*
|
|
176
|
+
* Set it to the words of the page's language, such as `{position} von
|
|
177
|
+
* {count}`, or to nothing to say no position.
|
|
178
|
+
*/
|
|
179
|
+
positionLabel: string;
|
|
180
|
+
/**
|
|
181
|
+
* Two values a band is drawn between, behind the line, separated by a
|
|
182
|
+
* space: `range="60 100"` marks a normal range.
|
|
183
|
+
*
|
|
184
|
+
* The scale stretches to hold the band where the readings do not reach it.
|
|
185
|
+
* Absent draws none.
|
|
186
|
+
*/
|
|
187
|
+
range: string;
|
|
124
188
|
/**
|
|
125
189
|
* The numbers, separated by whitespace or by commas.
|
|
126
190
|
*
|
|
@@ -131,10 +195,60 @@ export declare class HelixHeadlessSparkline extends HelixElement {
|
|
|
131
195
|
*/
|
|
132
196
|
values: string | readonly number[];
|
|
133
197
|
protected readonly source: SourceController;
|
|
198
|
+
/**
|
|
199
|
+
* Finds the reading a pointer or a key rests on, as it does for every
|
|
200
|
+
* chart, so a sparkline is read the way they are.
|
|
201
|
+
*/
|
|
202
|
+
readonly pointer: ChartPointerController;
|
|
203
|
+
/**
|
|
204
|
+
* Hears an `aria-label` written on the sparkline, which no property mirrors,
|
|
205
|
+
* because it names the drawing as `label` does, as on every chart.
|
|
206
|
+
*/
|
|
207
|
+
static get observedAttributes(): string[];
|
|
208
|
+
/** Called by the browser when an observed attribute changes; a new `aria-label` renames the drawing. */
|
|
209
|
+
attributeChangedCallback(name: string, old: string | null, value: string | null): void;
|
|
210
|
+
/** The drawing's name: an `aria-label` written on the sparkline, then `label`. */
|
|
211
|
+
get named(): string;
|
|
212
|
+
/** The two values of `range`, lower first, or none. */
|
|
213
|
+
private get band();
|
|
134
214
|
protected willUpdate(changed: PropertyValues<this>): void;
|
|
135
|
-
/**
|
|
136
|
-
|
|
215
|
+
/**
|
|
216
|
+
* The series to draw, and how many readings it has room for: the table's
|
|
217
|
+
* first series over the table's rows if there is one, the attribute
|
|
218
|
+
* otherwise.
|
|
219
|
+
*
|
|
220
|
+
* Over the rows, so a blank cell is a reading with nothing in it and the
|
|
221
|
+
* line breaks there, as `LineChart` draws one. Joined across, the line
|
|
222
|
+
* claimed a value the table does not have.
|
|
223
|
+
*/
|
|
224
|
+
private drawn;
|
|
225
|
+
/** How many readings there are, which the pointer and the keys walk. */
|
|
226
|
+
get readings(): number;
|
|
227
|
+
/**
|
|
228
|
+
* The reading at a place, in words: the table's cell as it is written, or
|
|
229
|
+
* the number in `locale`, after the row's name where a table gave one.
|
|
230
|
+
*/
|
|
231
|
+
private reading;
|
|
137
232
|
protected render(): TemplateResult;
|
|
233
|
+
/**
|
|
234
|
+
* A mark on each reading with a blank on either side, which no line can
|
|
235
|
+
* reach, so a line and an area show it as `LineChart` does. Not on a bar
|
|
236
|
+
* plot, whose column already shows it.
|
|
237
|
+
*/
|
|
238
|
+
protected renderLone(series: Series | undefined, at: (index: number, value: number) => string): TemplateResult | typeof nothing;
|
|
239
|
+
/** The marks `marks` asks for, on the highest and the lowest reading. */
|
|
240
|
+
protected renderMarks(slots: (number | undefined)[], at: (index: number, value: number) => string): TemplateResult | typeof nothing;
|
|
241
|
+
/**
|
|
242
|
+
* The reading a pointer or a key rests on: a mark on it and its words
|
|
243
|
+
* beside it. Hidden from a screen reader, which hears the `live` part.
|
|
244
|
+
*/
|
|
245
|
+
protected renderReading(slots: (number | undefined)[], at: (index: number, value: number) => string): TemplateResult | typeof nothing;
|
|
246
|
+
/**
|
|
247
|
+
* The polite region that says a reading the keys moved to, in words and
|
|
248
|
+
* with where it stands. Rendered from the first drawing and empty until a
|
|
249
|
+
* key moves the reading, so it is heard when its words change.
|
|
250
|
+
*/
|
|
251
|
+
protected renderLive(slots: (number | undefined)[]): TemplateResult;
|
|
138
252
|
}
|
|
139
253
|
declare global {
|
|
140
254
|
interface HTMLElementTagNameMap {
|
|
@@ -4,62 +4,130 @@ 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, extent, HelixElement, linear, linePath, PLOT_WIDTH, SourceController, writtenNumbers, } from '@fusion.dev/helix-core';
|
|
7
|
+
import { CHART_PLOT, ChartPointerController, customElement, extent, extremesOf, formatNumbers, HelixElement, linear, linePath, PLOT_WIDTH, SourceController, unbroken, writtenList, writtenNumbers, } from '@fusion.dev/helix-core';
|
|
8
8
|
import { html, nothing, svg } from 'lit';
|
|
9
9
|
import { property } from 'lit/decorators.js';
|
|
10
|
+
import { areaPath, overviewWords, readingWords, slotsOf } from '../readings.js';
|
|
10
11
|
const STRIP_HEIGHT = 32;
|
|
11
12
|
let HelixHeadlessSparkline = class HelixHeadlessSparkline extends HelixElement {
|
|
12
13
|
constructor() {
|
|
13
14
|
super(...arguments);
|
|
14
15
|
this.for = '';
|
|
15
16
|
this.label = '';
|
|
17
|
+
this.locale = '';
|
|
18
|
+
this.marks = '';
|
|
19
|
+
this.overviewLabel = 'From {first} to {last}, highest {high}, lowest {low}';
|
|
20
|
+
this.positionLabel = '{position} of {count}';
|
|
21
|
+
this.range = '';
|
|
16
22
|
this.values = '';
|
|
17
23
|
this.source = new SourceController(this);
|
|
24
|
+
this.pointer = new ChartPointerController(this);
|
|
25
|
+
}
|
|
26
|
+
static get observedAttributes() {
|
|
27
|
+
return [...super.observedAttributes, 'aria-label'];
|
|
28
|
+
}
|
|
29
|
+
attributeChangedCallback(name, old, value) {
|
|
30
|
+
super.attributeChangedCallback(name, old, value);
|
|
31
|
+
if (name === 'aria-label') {
|
|
32
|
+
this.requestUpdate();
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
get named() {
|
|
36
|
+
return this.getAttribute?.('aria-label') || this.label;
|
|
37
|
+
}
|
|
38
|
+
get band() {
|
|
39
|
+
const [one, two] = writtenNumbers(this.range);
|
|
40
|
+
return one === undefined || two === undefined
|
|
41
|
+
? undefined
|
|
42
|
+
: [Math.min(one, two), Math.max(one, two)];
|
|
18
43
|
}
|
|
19
44
|
willUpdate(changed) {
|
|
20
45
|
if (changed.has('for')) {
|
|
21
46
|
this.source.watch();
|
|
22
47
|
}
|
|
23
48
|
}
|
|
24
|
-
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
49
|
+
drawn() {
|
|
50
|
+
const read = this.source.series;
|
|
51
|
+
if (read.length > 0) {
|
|
52
|
+
return {
|
|
53
|
+
count: this.source.rows.length,
|
|
54
|
+
series: read[0] ?? { name: '', points: [] },
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
const values = writtenNumbers(this.values);
|
|
58
|
+
return {
|
|
59
|
+
count: values.length,
|
|
60
|
+
series: { name: '', points: values.map((value, at) => ({ at, label: '', value })) },
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
get readings() {
|
|
64
|
+
return this.drawn().count;
|
|
65
|
+
}
|
|
66
|
+
reading(at, value) {
|
|
67
|
+
const rows = this.source.rows;
|
|
68
|
+
const row = rows[at];
|
|
69
|
+
if (!row) {
|
|
70
|
+
return { label: '', text: value === undefined ? '' : formatNumbers(this.locale)(value) };
|
|
71
|
+
}
|
|
72
|
+
const column = row.cells.findIndex((_, index) => rows.some((one) => one.cells[index]?.value !== undefined));
|
|
73
|
+
return { label: row.label, text: row.cells[column]?.text ?? '' };
|
|
29
74
|
}
|
|
30
75
|
render() {
|
|
31
|
-
const
|
|
32
|
-
const
|
|
33
|
-
const
|
|
76
|
+
const { count, series } = this.drawn();
|
|
77
|
+
const slots = slotsOf(series.points, count);
|
|
78
|
+
const points = slots.filter((value) => value !== undefined);
|
|
79
|
+
const band = this.band;
|
|
80
|
+
const x = linear([0, Math.max(count - 1, 1)], [0, PLOT_WIDTH]);
|
|
81
|
+
const [low, high] = extent(points.length > 0 ? [...points, ...(band ?? [])] : [0]);
|
|
34
82
|
const y = this.plot === 'bar'
|
|
35
83
|
? linear([Math.min(0, low), Math.max(0, high)], [STRIP_HEIGHT, 0])
|
|
36
84
|
: linear([low, high], [STRIP_HEIGHT, 0]);
|
|
37
|
-
const
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
85
|
+
const runs = this.plot === 'bar'
|
|
86
|
+
? []
|
|
87
|
+
: unbroken(series)
|
|
88
|
+
.map((run) => run.map((point) => [x(point.at), y(point.value)]))
|
|
89
|
+
.map((run) => ({ path: linePath(run, this.curve ?? 'smooth'), run }))
|
|
90
|
+
.filter((one) => one.path !== '');
|
|
91
|
+
const path = runs.map((one) => one.path).join('');
|
|
92
|
+
const area = this.plot !== 'bar' && this.plot !== 'line' && path !== '' ? areaPath(runs, STRIP_HEIGHT) : '';
|
|
93
|
+
const slot = PLOT_WIDTH / Math.max(count, 1);
|
|
43
94
|
const floor = y(0);
|
|
44
95
|
const bars = this.plot === 'bar'
|
|
45
|
-
?
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
96
|
+
? slots.flatMap((value, index) => value === undefined
|
|
97
|
+
? []
|
|
98
|
+
: [
|
|
99
|
+
{
|
|
100
|
+
height: Math.abs(floor - y(value)),
|
|
101
|
+
width: slot * 0.72,
|
|
102
|
+
x: index * slot + slot * 0.14,
|
|
103
|
+
y: Math.min(floor, y(value)),
|
|
104
|
+
},
|
|
105
|
+
])
|
|
51
106
|
: [];
|
|
107
|
+
const lastAt = slots.findLastIndex((value) => value !== undefined);
|
|
52
108
|
const end = points.length < 2
|
|
53
109
|
? undefined
|
|
54
|
-
: `--chart-terminus-x: 100%; --chart-terminus-y: ${(y(
|
|
110
|
+
: `--chart-terminus-x: ${(x(lastAt) / PLOT_WIDTH) * 100}%; --chart-terminus-y: ${(y(slots[lastAt]) / STRIP_HEIGHT) * 100}%`;
|
|
111
|
+
const at = (index, value) => {
|
|
112
|
+
const across = this.plot === 'bar' ? index * slot + slot / 2 : x(index);
|
|
113
|
+
return `inset-inline-start: ${(across / PLOT_WIDTH) * 100}%; inset-block-start: ${(y(value) / STRIP_HEIGHT) * 100}%`;
|
|
114
|
+
};
|
|
115
|
+
const name = this.named;
|
|
116
|
+
const named = name !== '';
|
|
117
|
+
const overview = named
|
|
118
|
+
? overviewWords(this.overviewLabel, slots, (index) => this.reading(index, slots[index]).text)
|
|
119
|
+
: '';
|
|
55
120
|
return html `<svg
|
|
56
|
-
aria-
|
|
57
|
-
aria-
|
|
121
|
+
aria-describedby=${overview === '' ? nothing : 'sparkline-overview'}
|
|
122
|
+
aria-hidden=${named ? nothing : 'true'}
|
|
123
|
+
aria-label=${named ? name : nothing}
|
|
58
124
|
data-mirror
|
|
125
|
+
id=${CHART_PLOT}
|
|
59
126
|
part="svg"
|
|
60
127
|
preserveAspectRatio="none"
|
|
61
|
-
role=${
|
|
128
|
+
role=${named ? (points.length > 0 ? 'application' : 'img') : nothing}
|
|
62
129
|
style=${end ?? nothing}
|
|
130
|
+
tabindex=${named && points.length > 0 ? '0' : nothing}
|
|
63
131
|
viewBox="0 0 ${PLOT_WIDTH} ${STRIP_HEIGHT}"
|
|
64
132
|
>
|
|
65
133
|
${svg `<defs>
|
|
@@ -68,6 +136,15 @@ let HelixHeadlessSparkline = class HelixHeadlessSparkline extends HelixElement {
|
|
|
68
136
|
<stop offset="1" part="wash-end" />
|
|
69
137
|
</linearGradient>
|
|
70
138
|
</defs>`}
|
|
139
|
+
${band === undefined
|
|
140
|
+
? nothing
|
|
141
|
+
: svg `<rect
|
|
142
|
+
height=${Math.abs(y(band[0]) - y(band[1]))}
|
|
143
|
+
part="range"
|
|
144
|
+
width=${PLOT_WIDTH}
|
|
145
|
+
x="0"
|
|
146
|
+
y=${Math.min(y(band[0]), y(band[1]))}
|
|
147
|
+
/>`}
|
|
71
148
|
${path === '' ? nothing : svg `<path d=${path} part="line" />`}
|
|
72
149
|
${area === '' ? nothing : svg `<path d=${area} part="area" />`}
|
|
73
150
|
${bars.map((bar) => svg `<rect
|
|
@@ -80,7 +157,49 @@ let HelixHeadlessSparkline = class HelixHeadlessSparkline extends HelixElement {
|
|
|
80
157
|
</svg>
|
|
81
158
|
${points.length < 2 || this.plot === 'bar'
|
|
82
159
|
? nothing
|
|
83
|
-
: html `<span aria-hidden="true" part="terminus" style=${end ?? nothing}></span>`}
|
|
160
|
+
: html `<span aria-hidden="true" part="terminus" style=${end ?? nothing}></span>`}${this.renderLone(points.length < 2 ? undefined : series, at)}${this.renderMarks(slots, at)}${this.renderReading(slots, at)}${named && count > 0 ? this.renderLive(slots) : nothing}${overview === ''
|
|
161
|
+
? nothing
|
|
162
|
+
: html `<span hidden id="sparkline-overview" part="overview">${overview}</span>`}`;
|
|
163
|
+
}
|
|
164
|
+
renderLone(series, at) {
|
|
165
|
+
if (!series || this.plot === 'bar') {
|
|
166
|
+
return nothing;
|
|
167
|
+
}
|
|
168
|
+
const alone = unbroken(series).filter((run) => run.length === 1);
|
|
169
|
+
return alone.length === 0
|
|
170
|
+
? nothing
|
|
171
|
+
: html `${alone.map(([point]) => html `<span aria-hidden="true" part="lone" style=${at(point?.at ?? 0, point?.value ?? 0)}></span>`)}`;
|
|
172
|
+
}
|
|
173
|
+
renderMarks(slots, at) {
|
|
174
|
+
const asked = writtenList(this.marks);
|
|
175
|
+
if (asked.length === 0) {
|
|
176
|
+
return nothing;
|
|
177
|
+
}
|
|
178
|
+
const found = extremesOf(slots);
|
|
179
|
+
const place = (index, name) => asked.includes(name) && index !== undefined ? at(index, slots[index]) : undefined;
|
|
180
|
+
const high = place(found.high, 'high');
|
|
181
|
+
const low = place(found.low, 'low');
|
|
182
|
+
return html `${high === undefined ? nothing : html `<span aria-hidden="true" part="high" style=${high}></span>`}${low === undefined ? nothing : html `<span aria-hidden="true" part="low" style=${low}></span>`}`;
|
|
183
|
+
}
|
|
184
|
+
renderReading(slots, at) {
|
|
185
|
+
const index = this.pointer.at;
|
|
186
|
+
const value = slots[index];
|
|
187
|
+
if (index < 0 || value === undefined) {
|
|
188
|
+
return nothing;
|
|
189
|
+
}
|
|
190
|
+
const { label, text } = this.reading(index, value);
|
|
191
|
+
const place = at(index, value);
|
|
192
|
+
return html `<span aria-hidden="true" part="cursor" style=${place}></span
|
|
193
|
+
><span aria-hidden="true" part="readout" style=${place}
|
|
194
|
+
>${readingWords(label, text, '')}</span
|
|
195
|
+
>`;
|
|
196
|
+
}
|
|
197
|
+
renderLive(slots) {
|
|
198
|
+
const index = this.pointer.at;
|
|
199
|
+
const said = this.pointer.keyed && index >= 0 ? this.reading(index, slots[index]) : undefined;
|
|
200
|
+
return html `<span aria-live="polite" part="live" role="status"
|
|
201
|
+
>${said ? readingWords(said.label, said.text, this.pointer.position) : ''}</span
|
|
202
|
+
>`;
|
|
84
203
|
}
|
|
85
204
|
};
|
|
86
205
|
__decorate([
|
|
@@ -92,9 +211,24 @@ __decorate([
|
|
|
92
211
|
__decorate([
|
|
93
212
|
property()
|
|
94
213
|
], HelixHeadlessSparkline.prototype, "label", void 0);
|
|
214
|
+
__decorate([
|
|
215
|
+
property()
|
|
216
|
+
], HelixHeadlessSparkline.prototype, "locale", void 0);
|
|
217
|
+
__decorate([
|
|
218
|
+
property()
|
|
219
|
+
], HelixHeadlessSparkline.prototype, "marks", void 0);
|
|
220
|
+
__decorate([
|
|
221
|
+
property({ attribute: 'overview-label' })
|
|
222
|
+
], HelixHeadlessSparkline.prototype, "overviewLabel", void 0);
|
|
95
223
|
__decorate([
|
|
96
224
|
property({ reflect: true })
|
|
97
225
|
], HelixHeadlessSparkline.prototype, "plot", void 0);
|
|
226
|
+
__decorate([
|
|
227
|
+
property({ attribute: 'position-label' })
|
|
228
|
+
], HelixHeadlessSparkline.prototype, "positionLabel", void 0);
|
|
229
|
+
__decorate([
|
|
230
|
+
property()
|
|
231
|
+
], HelixHeadlessSparkline.prototype, "range", void 0);
|
|
98
232
|
__decorate([
|
|
99
233
|
property()
|
|
100
234
|
], HelixHeadlessSparkline.prototype, "values", void 0);
|
|
@@ -43,7 +43,7 @@ export declare class HelixHeadlessSpeedDialItem extends HelixElement {
|
|
|
43
43
|
*/
|
|
44
44
|
readonly isSpeedDialItem = true;
|
|
45
45
|
/** Puts focus on the control inside the item. */
|
|
46
|
-
focus(): void;
|
|
46
|
+
focus(options?: FocusOptions): void;
|
|
47
47
|
/**
|
|
48
48
|
* Moves focus to the action. Part of `NavigableItem`, which the shared
|
|
49
49
|
* keyboard controller uses for the arrow keys.
|
|
@@ -17,8 +17,8 @@ let HelixHeadlessSpeedDialItem = class HelixHeadlessSpeedDialItem extends HelixE
|
|
|
17
17
|
this.choose();
|
|
18
18
|
};
|
|
19
19
|
}
|
|
20
|
-
focus() {
|
|
21
|
-
this.partNamed('item')?.focus();
|
|
20
|
+
focus(options) {
|
|
21
|
+
this.partNamed('item')?.focus(options);
|
|
22
22
|
}
|
|
23
23
|
focusItem() {
|
|
24
24
|
this.focus();
|
|
@@ -76,6 +76,12 @@ export declare class HelixHeadlessSpeedDial extends HelixHeadlessSpeedDial_base
|
|
|
76
76
|
private get trigger();
|
|
77
77
|
/** The actions, which are this element's own rows and nothing else slotted. */
|
|
78
78
|
private get items();
|
|
79
|
+
/**
|
|
80
|
+
* Puts focus on the trigger, the slotted one or the button drawn in its
|
|
81
|
+
* place, as a `focus()` on a native control would. The host itself takes no
|
|
82
|
+
* focus, so a page focusing it after a dialog closes landed nowhere.
|
|
83
|
+
*/
|
|
84
|
+
focus(options?: FocusOptions): void;
|
|
79
85
|
/** Shuts it and puts the reader back on the trigger. */
|
|
80
86
|
private close;
|
|
81
87
|
private readonly handleTriggerClick;
|
|
@@ -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 { anchorElement, customElement, drawIcon, HelixElement, KeyboardNavigationController, MixinControllerOpen, PopoverController, slottedWords, tellDisclosure, } from '@fusion.dev/helix-core';
|
|
7
|
+
import { anchorElement, customElement, drawIcon, HelixElement, KeyboardNavigationController, MixinControllerOpen, PopoverController, slottedWords, tellDisclosure, typeaheadBy, } from '@fusion.dev/helix-core';
|
|
8
8
|
import { plus } from '@fusion.dev/helix-icons';
|
|
9
9
|
import { html, nothing } from 'lit';
|
|
10
10
|
import { property } from 'lit/decorators.js';
|
|
@@ -17,7 +17,7 @@ let HelixHeadlessSpeedDial = class HelixHeadlessSpeedDial extends MixinControlle
|
|
|
17
17
|
this.keys = new KeyboardNavigationController(this, {
|
|
18
18
|
items: () => (this.open ? this.items : []),
|
|
19
19
|
selects: () => false,
|
|
20
|
-
typeahead: (item) => slottedWords(item, ['']),
|
|
20
|
+
typeahead: typeaheadBy((item) => slottedWords(item, [''])),
|
|
21
21
|
});
|
|
22
22
|
this.focusOnOpen = false;
|
|
23
23
|
this.panel = new PopoverController(this, {
|
|
@@ -66,11 +66,19 @@ let HelixHeadlessSpeedDial = class HelixHeadlessSpeedDial extends MixinControlle
|
|
|
66
66
|
const slot = this.renderRoot?.querySelector('slot:not([name])');
|
|
67
67
|
return (slot?.assignedElements?.() ?? []).filter((one) => one.isSpeedDialItem === true);
|
|
68
68
|
}
|
|
69
|
+
focus(options) {
|
|
70
|
+
const trigger = this.trigger;
|
|
71
|
+
if (trigger === this) {
|
|
72
|
+
super.focus(options);
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
trigger.focus(options);
|
|
76
|
+
}
|
|
69
77
|
close() {
|
|
70
78
|
if (!this.requestOpen(false)) {
|
|
71
79
|
return;
|
|
72
80
|
}
|
|
73
|
-
this.
|
|
81
|
+
this.focus();
|
|
74
82
|
}
|
|
75
83
|
connectedCallback() {
|
|
76
84
|
super.connectedCallback();
|
|
@@ -42,6 +42,7 @@ import { type PropertyValues, type TemplateResult } from 'lit';
|
|
|
42
42
|
* @event {HelixBeforeResizeEvent} helix-before-resize - Fired before the divider settles, and only when the gesture moved it. A press that moved nothing, a drag that came back, an arrow key with no room left, and a corner that moved only the other divider do not fire it. Cancelable: canceling it leaves the position to you and keeps the rest of the gesture, so a collapse the gesture reached still fires `helix-before-collapse`, which you can also cancel. A dragged divider stays where it was dropped until you set your own `position`.
|
|
43
43
|
* @event {HelixCollapseEvent} helix-collapse - Fired after a pane shuts or reopens, with the side that is shut, or empty where both are open.
|
|
44
44
|
* @event {HelixResizedEvent} helix-resized - Fired after the divider settles somewhere new, with the new position.
|
|
45
|
+
* @event {Event} input - Fired each time a drag moves the divider, before it settles, as a range input does while it is dragged. Read `position` for where it is now.
|
|
45
46
|
*
|
|
46
47
|
* @csspart corner - The handle where two dividers cross, added on the client.
|
|
47
48
|
* @csspart end - The box that holds the second pane.
|
|
@@ -50,6 +51,8 @@ import { type PropertyValues, type TemplateResult } from 'lit';
|
|
|
50
51
|
*
|
|
51
52
|
* @cssproperty --splitter-corner-at - Where a nested splitter crosses this one, as a percentage.
|
|
52
53
|
* @cssproperty --splitter-position - Where the divider sits, as a percentage of the box.
|
|
54
|
+
*
|
|
55
|
+
* @cssstate dragging - While the pointer or a corner holds the divider.
|
|
53
56
|
*/
|
|
54
57
|
export declare class HelixHeadlessSplitter extends HelixElement {
|
|
55
58
|
/**
|
|
@@ -264,8 +267,8 @@ export declare class HelixHeadlessSplitter extends HelixElement {
|
|
|
264
267
|
* divider, because the child fills the pane and the pane spans this splitter
|
|
265
268
|
* end to end on the axis the divider runs.
|
|
266
269
|
*
|
|
267
|
-
* Not `@state`, because the array is mutated in place.
|
|
268
|
-
* request the update themselves.
|
|
270
|
+
* Not `@state`, because the array is mutated in place. The channel's `cross`
|
|
271
|
+
* and `uncross` request the update themselves.
|
|
269
272
|
*/
|
|
270
273
|
private crossings;
|
|
271
274
|
/** The splitter this one is nested in, once it has found it. */
|
|
@@ -499,17 +502,12 @@ export declare class HelixHeadlessSplitter extends HelixElement {
|
|
|
499
502
|
*/
|
|
500
503
|
private readonly handleCornerDoubleClick;
|
|
501
504
|
/**
|
|
502
|
-
*
|
|
503
|
-
*
|
|
504
|
-
*
|
|
505
|
-
*
|
|
506
|
-
* one way: the child tells the parent where it is, and the parent draws the
|
|
507
|
-
* corner and drives them both. Nothing is read back, so neither has to know
|
|
508
|
-
* anything about the other's state.
|
|
505
|
+
* Opens the channel a nested splitter reports through: where it crosses this
|
|
506
|
+
* one, and when it has left. It runs one way, the child telling the parent
|
|
507
|
+
* where it is and the parent drawing the corner and driving them both, so
|
|
508
|
+
* nothing is read back. Kept off the element, so it is no API of it.
|
|
509
509
|
*/
|
|
510
|
-
|
|
511
|
-
/** @internal Forgets a nested splitter that has left the tree. See `cross`. */
|
|
512
|
-
uncross(by: HelixHeadlessSplitter): void;
|
|
510
|
+
constructor();
|
|
513
511
|
/**
|
|
514
512
|
* Announces this splitter to the one it is nested in, if they cross.
|
|
515
513
|
*
|