@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
|
@@ -10,190 +10,8 @@ import { html, nothing } from 'lit';
|
|
|
10
10
|
import { property, state } from 'lit/decorators.js';
|
|
11
11
|
import { snapTo } from '../snap.js';
|
|
12
12
|
const STACK_BELOW = 512;
|
|
13
|
+
const channel = new WeakMap();
|
|
13
14
|
let HelixHeadlessSplitter = HelixHeadlessSplitter_1 = class HelixHeadlessSplitter extends HelixElement {
|
|
14
|
-
constructor() {
|
|
15
|
-
super(...arguments);
|
|
16
|
-
this.collapsedLabel = 'Collapsed';
|
|
17
|
-
this.collapsedSize = 0;
|
|
18
|
-
this.cornerLabel = 'Resize both';
|
|
19
|
-
this.defaultPosition = 50;
|
|
20
|
-
this.label = 'Resize panes';
|
|
21
|
-
this.aria = new AriaForwardController(this, {
|
|
22
|
-
label: true,
|
|
23
|
-
target: () => this.partNamed('separator'),
|
|
24
|
-
});
|
|
25
|
-
this.max = 100;
|
|
26
|
-
this.min = 0;
|
|
27
|
-
this.snap = '';
|
|
28
|
-
this.snapThreshold = 12;
|
|
29
|
-
this.step = 2;
|
|
30
|
-
this.positionState = undefined;
|
|
31
|
-
this.collapsedState = undefined;
|
|
32
|
-
this.opened = undefined;
|
|
33
|
-
this.began = undefined;
|
|
34
|
-
this.reached = undefined;
|
|
35
|
-
this.dragging = false;
|
|
36
|
-
this.crossings = [];
|
|
37
|
-
this.outer = null;
|
|
38
|
-
this.crossedAt = undefined;
|
|
39
|
-
this.cornerOrigin = null;
|
|
40
|
-
this.origin = null;
|
|
41
|
-
this.stacked = false;
|
|
42
|
-
this.handlePointerDown = (event) => {
|
|
43
|
-
const separator = event.currentTarget;
|
|
44
|
-
const box = this.getBoundingClientRect();
|
|
45
|
-
this.origin = this.vertical
|
|
46
|
-
? { length: box.height, start: box.top }
|
|
47
|
-
: { length: box.width, start: box.left };
|
|
48
|
-
capturePointer(separator, event.pointerId);
|
|
49
|
-
this.opened = this.collapsed ? undefined : this.position;
|
|
50
|
-
this.began = this.position;
|
|
51
|
-
this.reached = undefined;
|
|
52
|
-
this.dragging = true;
|
|
53
|
-
event.preventDefault();
|
|
54
|
-
};
|
|
55
|
-
this.handlePointerMove = (event) => {
|
|
56
|
-
const origin = this.origin;
|
|
57
|
-
if (!origin || origin.length === 0) {
|
|
58
|
-
return;
|
|
59
|
-
}
|
|
60
|
-
const along = this.vertical ? event.clientY : event.clientX;
|
|
61
|
-
const raw = ((along - origin.start) / origin.length) * 100;
|
|
62
|
-
const rtl = !this.vertical && isRtl(this);
|
|
63
|
-
this.move(this.snapped(rtl ? 100 - raw : raw, origin.length));
|
|
64
|
-
};
|
|
65
|
-
this.handlePointerUp = (event) => {
|
|
66
|
-
if (!this.origin) {
|
|
67
|
-
return;
|
|
68
|
-
}
|
|
69
|
-
const separator = event.currentTarget;
|
|
70
|
-
if (separator.hasPointerCapture(event.pointerId)) {
|
|
71
|
-
separator.releasePointerCapture(event.pointerId);
|
|
72
|
-
}
|
|
73
|
-
this.origin = null;
|
|
74
|
-
this.dragging = false;
|
|
75
|
-
this.settle(this.reached ?? this.position);
|
|
76
|
-
};
|
|
77
|
-
this.handleKeydown = (event) => {
|
|
78
|
-
if (event.key === 'Enter') {
|
|
79
|
-
this.toggleCollapse();
|
|
80
|
-
event.preventDefault();
|
|
81
|
-
return;
|
|
82
|
-
}
|
|
83
|
-
const toward = this.travel(event.key);
|
|
84
|
-
let next;
|
|
85
|
-
if (toward !== 0) {
|
|
86
|
-
next = this.position + toward * this.step;
|
|
87
|
-
}
|
|
88
|
-
else if (event.key === 'Home') {
|
|
89
|
-
next = this.minPercent;
|
|
90
|
-
}
|
|
91
|
-
else if (event.key === 'End') {
|
|
92
|
-
next = this.maxPercent;
|
|
93
|
-
}
|
|
94
|
-
else {
|
|
95
|
-
return;
|
|
96
|
-
}
|
|
97
|
-
this.settle(next);
|
|
98
|
-
event.preventDefault();
|
|
99
|
-
};
|
|
100
|
-
this.handleDoubleClick = () => {
|
|
101
|
-
this.reset();
|
|
102
|
-
};
|
|
103
|
-
this.handleCornerDoubleClick = (event) => {
|
|
104
|
-
const crossing = this.crossings[Number(event.currentTarget.dataset.cross)];
|
|
105
|
-
if (!crossing) {
|
|
106
|
-
return;
|
|
107
|
-
}
|
|
108
|
-
this.reset();
|
|
109
|
-
crossing.by.reset();
|
|
110
|
-
this.leaveSeparator(event);
|
|
111
|
-
};
|
|
112
|
-
this.handleCornerDown = (event) => {
|
|
113
|
-
const handle = event.currentTarget;
|
|
114
|
-
const crossing = this.crossings[Number(handle.dataset.cross)];
|
|
115
|
-
if (!crossing) {
|
|
116
|
-
return;
|
|
117
|
-
}
|
|
118
|
-
const mine = this.getBoundingClientRect();
|
|
119
|
-
const theirs = crossing.by.getBoundingClientRect();
|
|
120
|
-
this.cornerOrigin = {
|
|
121
|
-
by: crossing.by,
|
|
122
|
-
inner: crossing.by.vertical
|
|
123
|
-
? { length: theirs.height, start: theirs.top }
|
|
124
|
-
: { length: theirs.width, start: theirs.left },
|
|
125
|
-
outer: this.vertical
|
|
126
|
-
? { length: mine.height, start: mine.top }
|
|
127
|
-
: { length: mine.width, start: mine.left },
|
|
128
|
-
};
|
|
129
|
-
capturePointer(handle, event.pointerId);
|
|
130
|
-
this.opened = this.collapsed ? undefined : this.position;
|
|
131
|
-
crossing.by.opened = crossing.by.collapsed ? undefined : crossing.by.position;
|
|
132
|
-
this.began = this.position;
|
|
133
|
-
crossing.by.began = crossing.by.position;
|
|
134
|
-
this.reached = undefined;
|
|
135
|
-
crossing.by.reached = undefined;
|
|
136
|
-
this.dragging = true;
|
|
137
|
-
crossing.by.dragging = true;
|
|
138
|
-
this.leaveSeparator(event);
|
|
139
|
-
};
|
|
140
|
-
this.handleCornerMove = (event) => {
|
|
141
|
-
const origin = this.cornerOrigin;
|
|
142
|
-
if (!origin) {
|
|
143
|
-
return;
|
|
144
|
-
}
|
|
145
|
-
const rtl = isRtl(this);
|
|
146
|
-
const along = (box, at, inline) => {
|
|
147
|
-
if (box.length === 0) {
|
|
148
|
-
return undefined;
|
|
149
|
-
}
|
|
150
|
-
const raw = ((at - box.start) / box.length) * 100;
|
|
151
|
-
return inline && rtl ? 100 - raw : raw;
|
|
152
|
-
};
|
|
153
|
-
const mine = along(origin.outer, this.vertical ? event.clientY : event.clientX, !this.vertical);
|
|
154
|
-
const theirs = along(origin.inner, origin.by.vertical ? event.clientY : event.clientX, !origin.by.vertical);
|
|
155
|
-
if (mine !== undefined) {
|
|
156
|
-
this.moveTo(mine);
|
|
157
|
-
}
|
|
158
|
-
if (theirs !== undefined) {
|
|
159
|
-
origin.by.moveTo(theirs);
|
|
160
|
-
}
|
|
161
|
-
this.leaveSeparator(event);
|
|
162
|
-
};
|
|
163
|
-
this.handleCornerUp = (event) => {
|
|
164
|
-
const origin = this.cornerOrigin;
|
|
165
|
-
if (!origin) {
|
|
166
|
-
return;
|
|
167
|
-
}
|
|
168
|
-
const handle = event.currentTarget;
|
|
169
|
-
if (handle.hasPointerCapture(event.pointerId)) {
|
|
170
|
-
handle.releasePointerCapture(event.pointerId);
|
|
171
|
-
}
|
|
172
|
-
this.cornerOrigin = null;
|
|
173
|
-
this.moveTo(this.reached ?? this.position, true);
|
|
174
|
-
origin.by.moveTo(origin.by.reached ?? origin.by.position, true);
|
|
175
|
-
this.leaveSeparator(event);
|
|
176
|
-
};
|
|
177
|
-
this.handleCornerKeydown = (event) => {
|
|
178
|
-
const crossing = this.crossings[Number(event.currentTarget.dataset.cross)];
|
|
179
|
-
if (!crossing) {
|
|
180
|
-
return;
|
|
181
|
-
}
|
|
182
|
-
const inner = crossing.by;
|
|
183
|
-
const mine = this.travel(event.key);
|
|
184
|
-
const theirs = inner.travel(event.key);
|
|
185
|
-
if (mine !== 0) {
|
|
186
|
-
this.moveTo(this.position + mine * this.step, true);
|
|
187
|
-
}
|
|
188
|
-
else if (theirs !== 0) {
|
|
189
|
-
inner.moveTo(inner.position + theirs * inner.step, true);
|
|
190
|
-
}
|
|
191
|
-
else {
|
|
192
|
-
return;
|
|
193
|
-
}
|
|
194
|
-
this.leaveSeparator(event);
|
|
195
|
-
};
|
|
196
|
-
}
|
|
197
15
|
get collapsed() {
|
|
198
16
|
const held = this.collapsedState;
|
|
199
17
|
if (held === undefined) {
|
|
@@ -309,6 +127,7 @@ let HelixHeadlessSplitter = HelixHeadlessSplitter_1 = class HelixHeadlessSplitte
|
|
|
309
127
|
this.positionState = wanted;
|
|
310
128
|
this.collapsedState = 'none';
|
|
311
129
|
this.requestUpdate('position', previous);
|
|
130
|
+
this.dispatchEvent(new Event('input', { bubbles: true, composed: true }));
|
|
312
131
|
}
|
|
313
132
|
settle(next) {
|
|
314
133
|
const wanted = this.clamp(next);
|
|
@@ -388,26 +207,211 @@ let HelixHeadlessSplitter = HelixHeadlessSplitter_1 = class HelixHeadlessSplitte
|
|
|
388
207
|
const home = this.clamp(this.defaultPosition);
|
|
389
208
|
this.settle(home);
|
|
390
209
|
}
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
210
|
+
constructor() {
|
|
211
|
+
super();
|
|
212
|
+
this.collapsedLabel = 'Collapsed';
|
|
213
|
+
this.collapsedSize = 0;
|
|
214
|
+
this.cornerLabel = 'Resize both';
|
|
215
|
+
this.defaultPosition = 50;
|
|
216
|
+
this.label = 'Resize panes';
|
|
217
|
+
this.aria = new AriaForwardController(this, {
|
|
218
|
+
label: true,
|
|
219
|
+
target: () => this.partNamed('separator'),
|
|
220
|
+
});
|
|
221
|
+
this.max = 100;
|
|
222
|
+
this.min = 0;
|
|
223
|
+
this.snap = '';
|
|
224
|
+
this.snapThreshold = 12;
|
|
225
|
+
this.step = 2;
|
|
226
|
+
this.positionState = undefined;
|
|
227
|
+
this.collapsedState = undefined;
|
|
228
|
+
this.opened = undefined;
|
|
229
|
+
this.began = undefined;
|
|
230
|
+
this.reached = undefined;
|
|
231
|
+
this.dragging = false;
|
|
232
|
+
this.crossings = [];
|
|
233
|
+
this.outer = null;
|
|
234
|
+
this.crossedAt = undefined;
|
|
235
|
+
this.cornerOrigin = null;
|
|
236
|
+
this.origin = null;
|
|
237
|
+
this.stacked = false;
|
|
238
|
+
this.handlePointerDown = (event) => {
|
|
239
|
+
const separator = event.currentTarget;
|
|
240
|
+
const box = this.getBoundingClientRect();
|
|
241
|
+
this.origin = this.vertical
|
|
242
|
+
? { length: box.height, start: box.top }
|
|
243
|
+
: { length: box.width, start: box.left };
|
|
244
|
+
capturePointer(separator, event.pointerId);
|
|
245
|
+
this.opened = this.collapsed ? undefined : this.position;
|
|
246
|
+
this.began = this.position;
|
|
247
|
+
this.reached = undefined;
|
|
248
|
+
this.dragging = true;
|
|
249
|
+
event.preventDefault();
|
|
250
|
+
};
|
|
251
|
+
this.handlePointerMove = (event) => {
|
|
252
|
+
const origin = this.origin;
|
|
253
|
+
if (!origin || origin.length === 0) {
|
|
395
254
|
return;
|
|
396
255
|
}
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
this.
|
|
401
|
-
}
|
|
402
|
-
this.
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
256
|
+
const along = this.vertical ? event.clientY : event.clientX;
|
|
257
|
+
const raw = ((along - origin.start) / origin.length) * 100;
|
|
258
|
+
const rtl = !this.vertical && isRtl(this);
|
|
259
|
+
this.move(this.snapped(rtl ? 100 - raw : raw, origin.length));
|
|
260
|
+
};
|
|
261
|
+
this.handlePointerUp = (event) => {
|
|
262
|
+
if (!this.origin) {
|
|
263
|
+
return;
|
|
264
|
+
}
|
|
265
|
+
const separator = event.currentTarget;
|
|
266
|
+
if (separator.hasPointerCapture(event.pointerId)) {
|
|
267
|
+
separator.releasePointerCapture(event.pointerId);
|
|
268
|
+
}
|
|
269
|
+
this.origin = null;
|
|
270
|
+
this.dragging = false;
|
|
271
|
+
this.settle(this.reached ?? this.position);
|
|
272
|
+
};
|
|
273
|
+
this.handleKeydown = (event) => {
|
|
274
|
+
if (event.key === 'Enter') {
|
|
275
|
+
this.toggleCollapse();
|
|
276
|
+
event.preventDefault();
|
|
277
|
+
return;
|
|
278
|
+
}
|
|
279
|
+
const toward = this.travel(event.key);
|
|
280
|
+
let next;
|
|
281
|
+
if (toward !== 0) {
|
|
282
|
+
next = this.position + toward * this.step;
|
|
283
|
+
}
|
|
284
|
+
else if (event.key === 'Home') {
|
|
285
|
+
next = this.minPercent;
|
|
286
|
+
}
|
|
287
|
+
else if (event.key === 'End') {
|
|
288
|
+
next = this.maxPercent;
|
|
289
|
+
}
|
|
290
|
+
else {
|
|
291
|
+
return;
|
|
292
|
+
}
|
|
293
|
+
this.settle(next);
|
|
294
|
+
event.preventDefault();
|
|
295
|
+
};
|
|
296
|
+
this.handleDoubleClick = () => {
|
|
297
|
+
this.reset();
|
|
298
|
+
};
|
|
299
|
+
this.handleCornerDoubleClick = (event) => {
|
|
300
|
+
const crossing = this.crossings[Number(event.currentTarget.dataset.cross)];
|
|
301
|
+
if (!crossing) {
|
|
302
|
+
return;
|
|
303
|
+
}
|
|
304
|
+
this.reset();
|
|
305
|
+
crossing.by.reset();
|
|
306
|
+
this.leaveSeparator(event);
|
|
307
|
+
};
|
|
308
|
+
this.handleCornerDown = (event) => {
|
|
309
|
+
const handle = event.currentTarget;
|
|
310
|
+
const crossing = this.crossings[Number(handle.dataset.cross)];
|
|
311
|
+
if (!crossing) {
|
|
312
|
+
return;
|
|
313
|
+
}
|
|
314
|
+
const mine = this.getBoundingClientRect();
|
|
315
|
+
const theirs = crossing.by.getBoundingClientRect();
|
|
316
|
+
this.cornerOrigin = {
|
|
317
|
+
by: crossing.by,
|
|
318
|
+
inner: crossing.by.vertical
|
|
319
|
+
? { length: theirs.height, start: theirs.top }
|
|
320
|
+
: { length: theirs.width, start: theirs.left },
|
|
321
|
+
outer: this.vertical
|
|
322
|
+
? { length: mine.height, start: mine.top }
|
|
323
|
+
: { length: mine.width, start: mine.left },
|
|
324
|
+
};
|
|
325
|
+
capturePointer(handle, event.pointerId);
|
|
326
|
+
this.opened = this.collapsed ? undefined : this.position;
|
|
327
|
+
crossing.by.opened = crossing.by.collapsed ? undefined : crossing.by.position;
|
|
328
|
+
this.began = this.position;
|
|
329
|
+
crossing.by.began = crossing.by.position;
|
|
330
|
+
this.reached = undefined;
|
|
331
|
+
crossing.by.reached = undefined;
|
|
332
|
+
this.dragging = true;
|
|
333
|
+
crossing.by.dragging = true;
|
|
334
|
+
this.leaveSeparator(event);
|
|
335
|
+
};
|
|
336
|
+
this.handleCornerMove = (event) => {
|
|
337
|
+
const origin = this.cornerOrigin;
|
|
338
|
+
if (!origin) {
|
|
339
|
+
return;
|
|
340
|
+
}
|
|
341
|
+
const rtl = isRtl(this);
|
|
342
|
+
const along = (box, at, inline) => {
|
|
343
|
+
if (box.length === 0) {
|
|
344
|
+
return undefined;
|
|
345
|
+
}
|
|
346
|
+
const raw = ((at - box.start) / box.length) * 100;
|
|
347
|
+
return inline && rtl ? 100 - raw : raw;
|
|
348
|
+
};
|
|
349
|
+
const mine = along(origin.outer, this.vertical ? event.clientY : event.clientX, !this.vertical);
|
|
350
|
+
const theirs = along(origin.inner, origin.by.vertical ? event.clientY : event.clientX, !origin.by.vertical);
|
|
351
|
+
if (mine !== undefined) {
|
|
352
|
+
this.moveTo(mine);
|
|
353
|
+
}
|
|
354
|
+
if (theirs !== undefined) {
|
|
355
|
+
origin.by.moveTo(theirs);
|
|
356
|
+
}
|
|
357
|
+
this.leaveSeparator(event);
|
|
358
|
+
};
|
|
359
|
+
this.handleCornerUp = (event) => {
|
|
360
|
+
const origin = this.cornerOrigin;
|
|
361
|
+
if (!origin) {
|
|
362
|
+
return;
|
|
363
|
+
}
|
|
364
|
+
const handle = event.currentTarget;
|
|
365
|
+
if (handle.hasPointerCapture(event.pointerId)) {
|
|
366
|
+
handle.releasePointerCapture(event.pointerId);
|
|
367
|
+
}
|
|
368
|
+
this.cornerOrigin = null;
|
|
369
|
+
this.moveTo(this.reached ?? this.position, true);
|
|
370
|
+
origin.by.moveTo(origin.by.reached ?? origin.by.position, true);
|
|
371
|
+
this.leaveSeparator(event);
|
|
372
|
+
};
|
|
373
|
+
this.handleCornerKeydown = (event) => {
|
|
374
|
+
const crossing = this.crossings[Number(event.currentTarget.dataset.cross)];
|
|
375
|
+
if (!crossing) {
|
|
376
|
+
return;
|
|
377
|
+
}
|
|
378
|
+
const inner = crossing.by;
|
|
379
|
+
const mine = this.travel(event.key);
|
|
380
|
+
const theirs = inner.travel(event.key);
|
|
381
|
+
if (mine !== 0) {
|
|
382
|
+
this.moveTo(this.position + mine * this.step, true);
|
|
383
|
+
}
|
|
384
|
+
else if (theirs !== 0) {
|
|
385
|
+
inner.moveTo(inner.position + theirs * inner.step, true);
|
|
386
|
+
}
|
|
387
|
+
else {
|
|
388
|
+
return;
|
|
389
|
+
}
|
|
390
|
+
this.leaveSeparator(event);
|
|
391
|
+
};
|
|
392
|
+
channel.set(this, {
|
|
393
|
+
cross: (by, at) => {
|
|
394
|
+
const found = this.crossings.find((crossing) => crossing.by === by);
|
|
395
|
+
if (found) {
|
|
396
|
+
if (found.at === at) {
|
|
397
|
+
return;
|
|
398
|
+
}
|
|
399
|
+
found.at = at;
|
|
400
|
+
}
|
|
401
|
+
else {
|
|
402
|
+
this.crossings.push({ at, by });
|
|
403
|
+
}
|
|
404
|
+
this.requestUpdate();
|
|
405
|
+
},
|
|
406
|
+
uncross: (by) => {
|
|
407
|
+
const at = this.crossings.findIndex((crossing) => crossing.by === by);
|
|
408
|
+
if (at === -1) {
|
|
409
|
+
return;
|
|
410
|
+
}
|
|
411
|
+
this.crossings.splice(at, 1);
|
|
412
|
+
this.requestUpdate();
|
|
413
|
+
},
|
|
414
|
+
});
|
|
411
415
|
}
|
|
412
416
|
findOuter() {
|
|
413
417
|
const outer = closestInstance(this.parentElement, HelixHeadlessSplitter_1);
|
|
@@ -416,7 +420,7 @@ let HelixHeadlessSplitter = HelixHeadlessSplitter_1 = class HelixHeadlessSplitte
|
|
|
416
420
|
}
|
|
417
421
|
this.outer = outer;
|
|
418
422
|
this.crossedAt = this.position;
|
|
419
|
-
outer
|
|
423
|
+
channel.get(outer)?.cross(this, this.position);
|
|
420
424
|
}
|
|
421
425
|
leaveSeparator(event) {
|
|
422
426
|
event.stopPropagation();
|
|
@@ -433,7 +437,9 @@ let HelixHeadlessSplitter = HelixHeadlessSplitter_1 = class HelixHeadlessSplitte
|
|
|
433
437
|
super.disconnectedCallback();
|
|
434
438
|
this.sizes?.disconnect();
|
|
435
439
|
this.sizes = undefined;
|
|
436
|
-
this.outer
|
|
440
|
+
if (this.outer) {
|
|
441
|
+
channel.get(this.outer)?.uncross(this);
|
|
442
|
+
}
|
|
437
443
|
this.outer = null;
|
|
438
444
|
this.crossedAt = undefined;
|
|
439
445
|
}
|
|
@@ -461,11 +467,12 @@ let HelixHeadlessSplitter = HelixHeadlessSplitter_1 = class HelixHeadlessSplitte
|
|
|
461
467
|
}
|
|
462
468
|
if (this.outer && this.showing !== this.crossedAt) {
|
|
463
469
|
this.crossedAt = this.showing;
|
|
464
|
-
this.outer
|
|
470
|
+
channel.get(this.outer)?.cross(this, this.showing);
|
|
465
471
|
}
|
|
466
472
|
}
|
|
467
473
|
willUpdate(changed) {
|
|
468
474
|
super.willUpdate(changed);
|
|
475
|
+
this.toggleState('dragging', this.dragging);
|
|
469
476
|
}
|
|
470
477
|
render() {
|
|
471
478
|
const position = this.showing;
|
|
@@ -12,6 +12,13 @@ import { type PropertyValues, type TemplateResult } from 'lit';
|
|
|
12
12
|
* add an attribute after upgrade, which markup rendered on the server by React
|
|
13
13
|
* does not have.
|
|
14
14
|
*
|
|
15
|
+
* **A stat with a label is a group named by it**, so a reader moving through a
|
|
16
|
+
* dashboard hears "Revenue, group" and then the figure, its unit and its
|
|
17
|
+
* trend as one reading, rather than a run of loose words. The role and the name
|
|
18
|
+
* are set through `ElementInternals` once the label is known, which writes no
|
|
19
|
+
* attribute; a stat with no label has no role. Put a `Trend` in the `trend`
|
|
20
|
+
* slot to have it read inside the group, after the figure it qualifies.
|
|
21
|
+
*
|
|
15
22
|
* @since 0.1.0
|
|
16
23
|
* @status stable
|
|
17
24
|
* @category data
|
|
@@ -19,7 +26,8 @@ import { type PropertyValues, type TemplateResult } from 'lit';
|
|
|
19
26
|
* @documentation https://fusion.dev/helix/components/stat
|
|
20
27
|
*
|
|
21
28
|
* @slot - The value.
|
|
22
|
-
* @slot label - What the value measures.
|
|
29
|
+
* @slot label - What the value measures, which also names the stat for a screen reader.
|
|
30
|
+
* @slot trend - How the value moved, usually a `Trend`, read after the value inside the stat's group.
|
|
23
31
|
* @slot unit - The unit, shown beside the value.
|
|
24
32
|
*
|
|
25
33
|
* @csspart value - The slot the value is written in. A slot draws no box, so it takes the inherited properties, such as color and font, and passes them to the value.
|
|
@@ -40,10 +48,9 @@ export declare class HelixHeadlessStat extends HelixElement {
|
|
|
40
48
|
* the value's baseline whichever way the pair goes, and only this element
|
|
41
49
|
* knows which of its children the unit belongs to.
|
|
42
50
|
*
|
|
43
|
-
*
|
|
44
|
-
* moved
|
|
45
|
-
*
|
|
46
|
-
* layouts, and the pair stays the column.
|
|
51
|
+
* The name and the values are `Flex`'s, which lays out the same way. Which
|
|
52
|
+
* way a number moved is `Trend`'s `movement`. On a Stat, `up`, `down` and
|
|
53
|
+
* `neutral` are not layouts, and the pair stays the column.
|
|
47
54
|
*
|
|
48
55
|
* **Optional rather than defaulted to `column`, which is not a style
|
|
49
56
|
* preference.** A reflecting property with a default writes its attribute onto
|
|
@@ -54,6 +61,8 @@ export declare class HelixHeadlessStat extends HelixElement {
|
|
|
54
61
|
* carries nothing nobody wrote.
|
|
55
62
|
*/
|
|
56
63
|
direction?: 'column-reverse' | 'row' | 'row-reverse';
|
|
64
|
+
protected willUpdate(changed: PropertyValues): void;
|
|
65
|
+
protected firstUpdated(changed: PropertyValues): void;
|
|
57
66
|
protected updated(changed: PropertyValues): void;
|
|
58
67
|
protected render(): TemplateResult;
|
|
59
68
|
}
|
|
@@ -4,10 +4,25 @@ 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, reportRuntime } from '@fusion.dev/helix-core';
|
|
7
|
+
import { customElement, HelixElement, hostAria, reportRuntime, slottedWords, } from '@fusion.dev/helix-core';
|
|
8
8
|
import { html } from 'lit';
|
|
9
9
|
import { property } from 'lit/decorators.js';
|
|
10
10
|
let HelixHeadlessStat = class HelixHeadlessStat extends HelixElement {
|
|
11
|
+
willUpdate(changed) {
|
|
12
|
+
super.willUpdate(changed);
|
|
13
|
+
const labels = this.knownChildren.filter((child) => child.slot === 'label');
|
|
14
|
+
hostAria(this.internals, {
|
|
15
|
+
label: labels.length > 0 && !('ariaLabelledByElements' in this.internals)
|
|
16
|
+
? slottedWords(this, ['label'])
|
|
17
|
+
: '',
|
|
18
|
+
labelledBy: labels,
|
|
19
|
+
role: labels.length > 0 ? 'group' : '',
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
firstUpdated(changed) {
|
|
23
|
+
super.firstUpdated(changed);
|
|
24
|
+
this.finishHydration();
|
|
25
|
+
}
|
|
11
26
|
updated(changed) {
|
|
12
27
|
super.updated(changed);
|
|
13
28
|
const given = this.direction;
|
|
@@ -15,16 +30,17 @@ let HelixHeadlessStat = class HelixHeadlessStat extends HelixElement {
|
|
|
15
30
|
reportRuntime({
|
|
16
31
|
kind: 'misread-direction',
|
|
17
32
|
message: `<${this.localName} direction="${given}"> lays out as the column: \`${given}\` is a ` +
|
|
18
|
-
"
|
|
19
|
-
|
|
33
|
+
"`movement` of Trend's, which says which way a number moved. Put it on the " +
|
|
34
|
+
"`helix-trend` in the stat's `trend` slot.",
|
|
20
35
|
tag: this.localName,
|
|
21
36
|
});
|
|
22
37
|
}
|
|
23
38
|
}
|
|
24
39
|
render() {
|
|
25
|
-
return html `<slot name="label"></slot>
|
|
40
|
+
return html `<slot name="label" @slotchange=${() => this.requestUpdate()}></slot>
|
|
26
41
|
<slot part="value"></slot>
|
|
27
|
-
<slot name="unit"></slot
|
|
42
|
+
<slot name="unit"></slot>
|
|
43
|
+
<slot name="trend"></slot>`;
|
|
28
44
|
}
|
|
29
45
|
};
|
|
30
46
|
__decorate([
|
package/dist/steps/reach.d.ts
CHANGED
|
@@ -13,3 +13,8 @@ export interface ReachableStep {
|
|
|
13
13
|
* complete or optional, so no stage is passed unfinished.
|
|
14
14
|
*/
|
|
15
15
|
export declare const canReach: (steps: readonly ReachableStep[], from: number, to: number) => boolean;
|
|
16
|
+
/**
|
|
17
|
+
* How far through a sequence is, from 0 to 100: the share of its stages that
|
|
18
|
+
* are complete, rounded to a whole number. An empty sequence is at 0.
|
|
19
|
+
*/
|
|
20
|
+
export declare const progressOf: (steps: readonly Pick<ReachableStep, 'complete'>[]) => number;
|
package/dist/steps/reach.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { HelixElement } from '@fusion.dev/helix-core';
|
|
2
2
|
import { type PropertyValues, type TemplateResult } from 'lit';
|
|
3
|
+
import type { HelixHeadlessStep } from '../step/step.js';
|
|
3
4
|
declare const HelixHeadlessSteps_base: (new (...args: any[]) => import("@fusion.dev/helix-core").MixinControllerActiveInterface) & typeof HelixElement;
|
|
4
5
|
/**
|
|
5
6
|
* @summary A sequence of stages that shows which stage the user is on.
|
|
@@ -16,9 +17,27 @@ declare const HelixHeadlessSteps_base: (new (...args: any[]) => import("@fusion.
|
|
|
16
17
|
* `linear` keeps a reader from passing a stage they have not finished, as Ark
|
|
17
18
|
* UI's linear steps do: a stage ahead is out of reach, and its button disabled,
|
|
18
19
|
* until every stage before it is `complete` or `optional`. Going back is always
|
|
19
|
-
* allowed.
|
|
20
|
-
*
|
|
21
|
-
*
|
|
20
|
+
* allowed. `next()` and `previous()` move one stage either way, under the
|
|
21
|
+
* same rules, for your own buttons.
|
|
22
|
+
*
|
|
23
|
+
* To check a stage before a reader moves on from it, set `validate` to a
|
|
24
|
+
* function that answers whether the stage is valid, as Ark UI's `isStepValid`
|
|
25
|
+
* does. Moving forward asks it about the stage the reader is on, and where it
|
|
26
|
+
* answers `false` the reader stays and the stage is `:state(invalid)` until it
|
|
27
|
+
* answers `true`. An `optional` stage is not asked. `helix-before-activate`
|
|
28
|
+
* is still sent for every move, for a check of your own.
|
|
29
|
+
*
|
|
30
|
+
* `progress` is how far through the sequence is, from 0 to 100: the share of
|
|
31
|
+
* its stages that are `complete`. The `progress` part carries it as a
|
|
32
|
+
* `progressbar` and as `--steps-progress`, and is hidden until a stylesheet
|
|
33
|
+
* gives it a `display`, so a bar of your own costs nothing until you draw it.
|
|
34
|
+
* A screen reader hears it as `progress-label` says, "33% complete" unless
|
|
35
|
+
* set, as Ark UI's steps write it. The sequence is `:state(complete)` once
|
|
36
|
+
* every stage is.
|
|
37
|
+
*
|
|
38
|
+
* The sequence is a list named by `label`, and each step a list item. The
|
|
39
|
+
* current stage's button says `aria-current="step"`, and a finished stage's
|
|
40
|
+
* button is described by its `complete-label`.
|
|
22
41
|
*
|
|
23
42
|
* @since 0.1.0
|
|
24
43
|
* @status stable
|
|
@@ -31,6 +50,12 @@ declare const HelixHeadlessSteps_base: (new (...args: any[]) => import("@fusion.
|
|
|
31
50
|
* @event {HelixActivateEvent} helix-activate - Fired after the current step changes, when the element already holds the new step.
|
|
32
51
|
* @event {HelixBeforeActivateEvent} helix-before-activate - Fired before the active step changes. Cancelable: cancel it to keep the current step.
|
|
33
52
|
* @event {HelixSelectEvent} helix-select - Fired when a step is pressed. The step dispatches it, and you can listen for it on the sequence. Cancelable: cancel it to keep the current step.
|
|
53
|
+
*
|
|
54
|
+
* @csspart progress - How far through the sequence is, as a `progressbar` carrying `--steps-progress`. Hidden until a stylesheet gives it a `display`.
|
|
55
|
+
*
|
|
56
|
+
* @cssproperty --steps-progress - How far through the sequence is, as a percentage, written on the `progress` part.
|
|
57
|
+
*
|
|
58
|
+
* @cssstate complete - Every stage is complete.
|
|
34
59
|
*/
|
|
35
60
|
export declare class HelixHeadlessSteps extends HelixHeadlessSteps_base {
|
|
36
61
|
/**
|
|
@@ -59,6 +84,22 @@ export declare class HelixHeadlessSteps extends HelixHeadlessSteps_base {
|
|
|
59
84
|
* catches people out.
|
|
60
85
|
*/
|
|
61
86
|
orientation?: 'vertical';
|
|
87
|
+
/**
|
|
88
|
+
* What the `progress` part says to a screen reader, with `{percent}` filled
|
|
89
|
+
* in with `progress`.
|
|
90
|
+
*/
|
|
91
|
+
progressLabel: string;
|
|
92
|
+
/**
|
|
93
|
+
* A function that answers whether a stage is valid, asked about the stage a
|
|
94
|
+
* reader is on before they move forward from it. Return `false` to keep them
|
|
95
|
+
* there. Not asked of an `optional` stage, nor for a move back.
|
|
96
|
+
*/
|
|
97
|
+
validate?: (step: HelixHeadlessStep) => boolean;
|
|
98
|
+
/**
|
|
99
|
+
* How far through the sequence is, from 0 to 100: the share of its stages
|
|
100
|
+
* that are `complete`, rounded to a whole number.
|
|
101
|
+
*/
|
|
102
|
+
get progress(): number;
|
|
62
103
|
/**
|
|
63
104
|
* What each step is marked with.
|
|
64
105
|
*
|
|
@@ -86,6 +127,12 @@ export declare class HelixHeadlessSteps extends HelixHeadlessSteps_base {
|
|
|
86
127
|
previous(): boolean;
|
|
87
128
|
/** Moves `delta` stages, skipping disabled ones. */
|
|
88
129
|
private step;
|
|
130
|
+
/**
|
|
131
|
+
* Whether the stage the reader is on lets them go to the stage at `index`,
|
|
132
|
+
* by `validate`. Only a move forward is asked, and an `optional` stage is
|
|
133
|
+
* never asked. The stage is marked invalid while the answer is no.
|
|
134
|
+
*/
|
|
135
|
+
private valid;
|
|
89
136
|
/** Whether the stage at `index` can be gone to from where the reader is. */
|
|
90
137
|
private reachable;
|
|
91
138
|
/** Marks the stages a linear sequence holds out of reach. Client only. */
|
|
@@ -108,7 +155,13 @@ export declare class HelixHeadlessSteps extends HelixHeadlessSteps_base {
|
|
|
108
155
|
private readonly handleSlotChange;
|
|
109
156
|
connectedCallback(): void;
|
|
110
157
|
disconnectedCallback(): void;
|
|
158
|
+
/**
|
|
159
|
+
* The steps where they can be known, and none on a server or while
|
|
160
|
+
* hydrating, so the progress drawn first is the server's.
|
|
161
|
+
*/
|
|
162
|
+
private get known();
|
|
111
163
|
protected willUpdate(changed: PropertyValues): void;
|
|
164
|
+
protected firstUpdated(changed: PropertyValues): void;
|
|
112
165
|
protected updated(changed: PropertyValues): void;
|
|
113
166
|
protected render(): TemplateResult;
|
|
114
167
|
}
|