@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
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import type { ReactiveController, ReactiveControllerHost } from 'lit';
|
|
2
|
+
import { type Axis, type Scrollbars } from './scrollbar.js';
|
|
3
|
+
/** What one drawn scrollbar shows: whether it is there, and its thumb's facts. */
|
|
4
|
+
export interface Bar {
|
|
5
|
+
/** Whether the axis has a scrollbar at all. See `hasScrollbar`. */
|
|
6
|
+
drawn: boolean;
|
|
7
|
+
/** How far along the axis is scrolled, from 0 to 1. */
|
|
8
|
+
along: number;
|
|
9
|
+
/** The share of the track the thumb covers, from 0 to 1. */
|
|
10
|
+
thumb: number;
|
|
11
|
+
}
|
|
12
|
+
/** What the controller needs of the scroll area it serves. */
|
|
13
|
+
export interface ScrollbarOptions {
|
|
14
|
+
/** The box that scrolls, or null before it renders. */
|
|
15
|
+
box: () => HTMLElement | null;
|
|
16
|
+
/** The host's `hide-delay`, in milliseconds. */
|
|
17
|
+
hideDelay: () => number;
|
|
18
|
+
/** The host's `scrollbars`, or undefined for the browser's own. */
|
|
19
|
+
mode: () => Scrollbars | undefined;
|
|
20
|
+
/** Sends a `scrollend` from the host, for the one a drag held back. */
|
|
21
|
+
scrollEnd: () => void;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* The scrollbars a scroll area draws under `scrollbars`: what each shows, when
|
|
25
|
+
* they show, and the thumb a pointer drags.
|
|
26
|
+
*
|
|
27
|
+
* **A controller, so the element only draws.** It holds the drag, whether the
|
|
28
|
+
* pointer is over the area or a scrollbar, and the wait that puts the
|
|
29
|
+
* scrollbars away, and asks the host to render when any of them changes.
|
|
30
|
+
*
|
|
31
|
+
* **A drag sends one `scrollend`.** The thumb moves the content by
|
|
32
|
+
* `scrollTo`, and the browser ends each of those steps with a `scrollend` of
|
|
33
|
+
* its own, so a drag sent a burst of them. While a thumb is held they are held
|
|
34
|
+
* back, and once it is let go one is sent: the browser's own for the last
|
|
35
|
+
* step, or the held one where none comes.
|
|
36
|
+
*/
|
|
37
|
+
export declare class ScrollbarController implements ReactiveController {
|
|
38
|
+
/** What each scrollbar shows, measured, and `undefined` until it has been. */
|
|
39
|
+
bars: Record<Axis, Bar> | undefined;
|
|
40
|
+
/** Whether the content moved, or the pointer left, within the hide delay. */
|
|
41
|
+
active: boolean;
|
|
42
|
+
/** Whether the pointer is over the scroll area. */
|
|
43
|
+
hovered: boolean;
|
|
44
|
+
/** Whether the pointer is over a scrollbar. */
|
|
45
|
+
over: boolean;
|
|
46
|
+
/** The thumb being dragged, if one is. */
|
|
47
|
+
private drag;
|
|
48
|
+
/** Whether a `scrollend` was held back by a drag and not sent yet. */
|
|
49
|
+
private heldEnd;
|
|
50
|
+
private readonly host;
|
|
51
|
+
private readonly options;
|
|
52
|
+
/** Puts the scrollbars away once nothing has moved for the hide delay. */
|
|
53
|
+
private readonly hide;
|
|
54
|
+
/** Waits after a drag for the browser's last `scrollend`. */
|
|
55
|
+
private readonly settle;
|
|
56
|
+
constructor(host: ReactiveControllerHost & HTMLElement, options: ScrollbarOptions);
|
|
57
|
+
hostConnected(): void;
|
|
58
|
+
hostDisconnected(): void;
|
|
59
|
+
/** Whether a thumb is held. */
|
|
60
|
+
get dragging(): boolean;
|
|
61
|
+
/** Whether the scrollbars that are drawn are showing at this moment. */
|
|
62
|
+
get shown(): boolean;
|
|
63
|
+
/**
|
|
64
|
+
* Reads what each scrollbar shows off the box.
|
|
65
|
+
*
|
|
66
|
+
* An axis scrolls unless its `overflow` says it cannot. An empty reading is a
|
|
67
|
+
* harness with no layout, where the mark `core` puts on the viewport is
|
|
68
|
+
* `overflow: auto` on both axes, so it counts as one that scrolls.
|
|
69
|
+
*
|
|
70
|
+
* Asks for a render only on a change, so a scroll that moves no thumb
|
|
71
|
+
* renders nothing.
|
|
72
|
+
*/
|
|
73
|
+
read(box: HTMLElement): void;
|
|
74
|
+
/**
|
|
75
|
+
* Shows the scrollbars and starts the wait that puts them away again, under
|
|
76
|
+
* `scroll` and `hover`.
|
|
77
|
+
*/
|
|
78
|
+
wake(): void;
|
|
79
|
+
/**
|
|
80
|
+
* Whether to hold back a `scrollend` the viewport sent: true while a thumb is
|
|
81
|
+
* held. One arriving after the drag ends is the browser's last, and stands
|
|
82
|
+
* for the one held back.
|
|
83
|
+
*/
|
|
84
|
+
holdsScrollEnd(): boolean;
|
|
85
|
+
/** Writes one of the moment's facts, and renders where it changed. */
|
|
86
|
+
private set;
|
|
87
|
+
/** Sends the content to `offset` along an axis, counted from its start. */
|
|
88
|
+
private scrollAlong;
|
|
89
|
+
/**
|
|
90
|
+
* Takes hold of a thumb, or presses the track.
|
|
91
|
+
*
|
|
92
|
+
* A press on the track sends the thumb's middle to the press first, and the
|
|
93
|
+
* drag carries on from there, so a press and a drag are one gesture as they
|
|
94
|
+
* are on the browser's own scrollbar. `preventDefault` keeps the press from
|
|
95
|
+
* starting a text selection, and from moving focus off the viewport.
|
|
96
|
+
*/
|
|
97
|
+
private grab;
|
|
98
|
+
readonly handleVerticalDown: (event: PointerEvent) => void;
|
|
99
|
+
readonly handleHorizontalDown: (event: PointerEvent) => void;
|
|
100
|
+
/** Moves the content with a dragged thumb. Nothing while no thumb is held. */
|
|
101
|
+
readonly handleDragMove: (event: PointerEvent) => void;
|
|
102
|
+
/**
|
|
103
|
+
* Lets go of the thumb. A `scrollend` the drag held back goes out once the
|
|
104
|
+
* browser's last one has had a frame or two to arrive and has not.
|
|
105
|
+
*/
|
|
106
|
+
readonly handleDragEnd: () => void;
|
|
107
|
+
readonly handleBarEnter: () => void;
|
|
108
|
+
readonly handleBarLeave: () => void;
|
|
109
|
+
private readonly handleEnter;
|
|
110
|
+
private readonly handleLeave;
|
|
111
|
+
}
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
import { capturePointer, DelayController, isRtl } from '@fusion.dev/helix-core';
|
|
2
|
+
import { alongTrack, extentOf, hasScrollbar, offsetAt, scrollFraction, scrollPerPixel, showsScrollbar, thumbFraction, } from './scrollbar.js';
|
|
3
|
+
const SETTLE = 100;
|
|
4
|
+
export class ScrollbarController {
|
|
5
|
+
constructor(host, options) {
|
|
6
|
+
this.active = false;
|
|
7
|
+
this.hovered = false;
|
|
8
|
+
this.over = false;
|
|
9
|
+
this.heldEnd = false;
|
|
10
|
+
this.handleVerticalDown = (event) => {
|
|
11
|
+
this.grab(event, 'vertical');
|
|
12
|
+
};
|
|
13
|
+
this.handleHorizontalDown = (event) => {
|
|
14
|
+
this.grab(event, 'horizontal');
|
|
15
|
+
};
|
|
16
|
+
this.handleDragMove = (event) => {
|
|
17
|
+
const drag = this.drag;
|
|
18
|
+
const box = this.options.box();
|
|
19
|
+
if (!drag || !box) {
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
const pointer = drag.axis === 'vertical' ? event.clientY : event.clientX;
|
|
23
|
+
this.scrollAlong(box, drag.axis, drag.from + (pointer - drag.pointer) * drag.sign * drag.perPixel);
|
|
24
|
+
};
|
|
25
|
+
this.handleDragEnd = () => {
|
|
26
|
+
if (!this.drag) {
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
this.drag = undefined;
|
|
30
|
+
if (this.heldEnd) {
|
|
31
|
+
this.settle.start(SETTLE, () => {
|
|
32
|
+
if (this.heldEnd) {
|
|
33
|
+
this.heldEnd = false;
|
|
34
|
+
this.options.scrollEnd();
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
this.wake();
|
|
39
|
+
this.host.requestUpdate();
|
|
40
|
+
};
|
|
41
|
+
this.handleBarEnter = () => {
|
|
42
|
+
this.set('over', true);
|
|
43
|
+
};
|
|
44
|
+
this.handleBarLeave = () => {
|
|
45
|
+
this.set('over', false);
|
|
46
|
+
this.wake();
|
|
47
|
+
};
|
|
48
|
+
this.handleEnter = () => {
|
|
49
|
+
this.set('hovered', true);
|
|
50
|
+
};
|
|
51
|
+
this.handleLeave = () => {
|
|
52
|
+
this.set('hovered', false);
|
|
53
|
+
if (this.options.mode() === 'hover') {
|
|
54
|
+
this.wake();
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
this.host = host;
|
|
58
|
+
this.options = options;
|
|
59
|
+
this.hide = new DelayController(host, { renders: false });
|
|
60
|
+
this.settle = new DelayController(host, { renders: false });
|
|
61
|
+
host.addController(this);
|
|
62
|
+
}
|
|
63
|
+
hostConnected() {
|
|
64
|
+
this.host.addEventListener('pointerenter', this.handleEnter);
|
|
65
|
+
this.host.addEventListener('pointerleave', this.handleLeave);
|
|
66
|
+
}
|
|
67
|
+
hostDisconnected() {
|
|
68
|
+
this.host.removeEventListener('pointerenter', this.handleEnter);
|
|
69
|
+
this.host.removeEventListener('pointerleave', this.handleLeave);
|
|
70
|
+
this.drag = undefined;
|
|
71
|
+
this.heldEnd = false;
|
|
72
|
+
this.active = false;
|
|
73
|
+
this.hovered = false;
|
|
74
|
+
this.over = false;
|
|
75
|
+
}
|
|
76
|
+
get dragging() {
|
|
77
|
+
return this.drag !== undefined;
|
|
78
|
+
}
|
|
79
|
+
get shown() {
|
|
80
|
+
const mode = this.options.mode();
|
|
81
|
+
return mode
|
|
82
|
+
? showsScrollbar(mode, {
|
|
83
|
+
active: this.active,
|
|
84
|
+
held: this.over || this.drag !== undefined,
|
|
85
|
+
hovered: this.hovered,
|
|
86
|
+
})
|
|
87
|
+
: false;
|
|
88
|
+
}
|
|
89
|
+
read(box) {
|
|
90
|
+
const mode = this.options.mode() ?? 'auto';
|
|
91
|
+
const style = getComputedStyle(box);
|
|
92
|
+
const bar = (axis, overflow) => {
|
|
93
|
+
const extent = extentOf(box, axis);
|
|
94
|
+
return {
|
|
95
|
+
along: scrollFraction(extent),
|
|
96
|
+
drawn: hasScrollbar(mode, !['clip', 'hidden', 'visible'].includes(overflow), extent.offset > 1 || extent.client < extent.scroll - 1),
|
|
97
|
+
thumb: thumbFraction(extent),
|
|
98
|
+
};
|
|
99
|
+
};
|
|
100
|
+
const next = {
|
|
101
|
+
horizontal: bar('horizontal', style.overflowX),
|
|
102
|
+
vertical: bar('vertical', style.overflowY),
|
|
103
|
+
};
|
|
104
|
+
if (JSON.stringify(next) !== JSON.stringify(this.bars)) {
|
|
105
|
+
this.bars = next;
|
|
106
|
+
this.host.requestUpdate();
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
wake() {
|
|
110
|
+
const mode = this.options.mode();
|
|
111
|
+
if (mode !== 'scroll' && mode !== 'hover') {
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
this.set('active', true);
|
|
115
|
+
this.hide.start(this.options.hideDelay(), () => {
|
|
116
|
+
this.set('active', false);
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
holdsScrollEnd() {
|
|
120
|
+
if (this.drag) {
|
|
121
|
+
this.heldEnd = true;
|
|
122
|
+
return true;
|
|
123
|
+
}
|
|
124
|
+
if (this.heldEnd) {
|
|
125
|
+
this.heldEnd = false;
|
|
126
|
+
this.settle.cancel();
|
|
127
|
+
}
|
|
128
|
+
return false;
|
|
129
|
+
}
|
|
130
|
+
set(key, value) {
|
|
131
|
+
if (this[key] !== value) {
|
|
132
|
+
this[key] = value;
|
|
133
|
+
this.host.requestUpdate();
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
scrollAlong(box, axis, offset) {
|
|
137
|
+
box.scrollTo(axis === 'vertical'
|
|
138
|
+
? { behavior: 'instant', top: offset }
|
|
139
|
+
: { behavior: 'instant', left: isRtl(box) ? -offset : offset });
|
|
140
|
+
}
|
|
141
|
+
grab(event, axis) {
|
|
142
|
+
const box = this.options.box();
|
|
143
|
+
const bar = event.currentTarget;
|
|
144
|
+
const thumb = bar.querySelector('[part~="thumb"]');
|
|
145
|
+
if (event.button !== 0 || !box || !thumb) {
|
|
146
|
+
return;
|
|
147
|
+
}
|
|
148
|
+
event.preventDefault();
|
|
149
|
+
const vertical = axis === 'vertical';
|
|
150
|
+
const rtl = !vertical && isRtl(box);
|
|
151
|
+
const track = bar.getBoundingClientRect();
|
|
152
|
+
const held = thumb.getBoundingClientRect();
|
|
153
|
+
const length = vertical ? track.height : track.width;
|
|
154
|
+
const size = vertical ? held.height : held.width;
|
|
155
|
+
const extent = extentOf(box, axis);
|
|
156
|
+
const pointer = vertical ? event.clientY : event.clientX;
|
|
157
|
+
let from = extent.offset;
|
|
158
|
+
if (!thumb.contains(event.target)) {
|
|
159
|
+
from = offsetAt(extent, alongTrack(pointer, track, axis, rtl), length, size);
|
|
160
|
+
this.scrollAlong(box, axis, from);
|
|
161
|
+
}
|
|
162
|
+
this.drag = {
|
|
163
|
+
axis,
|
|
164
|
+
from,
|
|
165
|
+
perPixel: scrollPerPixel(extent, length, size),
|
|
166
|
+
pointer,
|
|
167
|
+
sign: rtl ? -1 : 1,
|
|
168
|
+
};
|
|
169
|
+
capturePointer(bar, event.pointerId);
|
|
170
|
+
this.host.requestUpdate();
|
|
171
|
+
}
|
|
172
|
+
}
|
|
@@ -1,13 +1,16 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The arithmetic behind the scrollbars a scroll area draws under `scrollbars`.
|
|
3
|
-
*
|
|
4
|
-
* Every length here is along one axis and counted from that axis' start, which
|
|
5
|
-
* is the right-hand edge on a right-to-left page for the horizontal one. The
|
|
6
|
-
* component turns a pointer and a `scrollLeft` into those counts, so nothing
|
|
7
|
-
* below has to know which way the line runs.
|
|
8
|
-
*/
|
|
9
1
|
/** Which scrollbars are drawn, and when. Absent keeps the browser's own. */
|
|
10
2
|
export type Scrollbars = 'always' | 'auto' | 'hover' | 'scroll';
|
|
3
|
+
/** The two axes a scrollbar runs along. */
|
|
4
|
+
export type Axis = 'horizontal' | 'vertical';
|
|
5
|
+
/** The box a scrollbar reads, as the numbers it reads off it. */
|
|
6
|
+
export interface Box {
|
|
7
|
+
clientHeight: number;
|
|
8
|
+
clientWidth: number;
|
|
9
|
+
scrollHeight: number;
|
|
10
|
+
scrollLeft: number;
|
|
11
|
+
scrollTop: number;
|
|
12
|
+
scrollWidth: number;
|
|
13
|
+
}
|
|
11
14
|
/** One axis of the viewport, read off the box. */
|
|
12
15
|
export interface Extent {
|
|
13
16
|
/** How much of the content the viewport shows, `clientHeight` or `clientWidth`. */
|
|
@@ -63,3 +66,19 @@ export declare const showsScrollbar: (mode: Scrollbars, moment: {
|
|
|
63
66
|
held: boolean;
|
|
64
67
|
hovered: boolean;
|
|
65
68
|
}) => boolean;
|
|
69
|
+
/**
|
|
70
|
+
* One axis of a box, counted from its start whichever way the line runs: a
|
|
71
|
+
* right-to-left box counts `scrollLeft` down from zero, so its offset is the
|
|
72
|
+
* distance from zero.
|
|
73
|
+
*/
|
|
74
|
+
export declare const extentOf: (box: Box, axis: Axis) => Extent;
|
|
75
|
+
/**
|
|
76
|
+
* Where a pointer is along a track, counted from the track's start: its top,
|
|
77
|
+
* or its left edge, or its right edge on a right-to-left page.
|
|
78
|
+
*/
|
|
79
|
+
export declare const alongTrack: (pointer: number, track: {
|
|
80
|
+
bottom: number;
|
|
81
|
+
left: number;
|
|
82
|
+
right: number;
|
|
83
|
+
top: number;
|
|
84
|
+
}, axis: Axis, rtl: boolean) => number;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import { clamp } from '@fusion.dev/helix-core';
|
|
2
2
|
export const thumbFraction = ({ client, scroll }) => scroll <= 0 ? 1 : clamp(client / scroll, 0, 1);
|
|
3
3
|
export const scrollFraction = ({ client, offset, scroll }) => {
|
|
4
4
|
const room = scroll - client;
|
|
@@ -22,3 +22,12 @@ export const showsScrollbar = (mode, moment) => {
|
|
|
22
22
|
}
|
|
23
23
|
return moment.active || moment.held || (mode === 'hover' && moment.hovered);
|
|
24
24
|
};
|
|
25
|
+
export const extentOf = (box, axis) => axis === 'vertical'
|
|
26
|
+
? { client: box.clientHeight, offset: box.scrollTop, scroll: box.scrollHeight }
|
|
27
|
+
: { client: box.clientWidth, offset: Math.abs(box.scrollLeft), scroll: box.scrollWidth };
|
|
28
|
+
export const alongTrack = (pointer, track, axis, rtl) => {
|
|
29
|
+
if (axis === 'vertical') {
|
|
30
|
+
return pointer - track.top;
|
|
31
|
+
}
|
|
32
|
+
return rtl ? track.right - pointer : pointer - track.left;
|
|
33
|
+
};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/** A box on the screen, in viewport pixels. */
|
|
2
|
+
export interface Box {
|
|
3
|
+
height: number;
|
|
4
|
+
left: number;
|
|
5
|
+
top: number;
|
|
6
|
+
width: number;
|
|
7
|
+
}
|
|
8
|
+
/** What places a list over its trigger. */
|
|
9
|
+
export interface Over {
|
|
10
|
+
/** How far inside the screen's edges the list stays, in pixels. */
|
|
11
|
+
margin: number;
|
|
12
|
+
/** The option to sit on the trigger: its top within the list, and its height. */
|
|
13
|
+
option: {
|
|
14
|
+
height: number;
|
|
15
|
+
top: number;
|
|
16
|
+
};
|
|
17
|
+
/** The list's own size. */
|
|
18
|
+
panel: {
|
|
19
|
+
height: number;
|
|
20
|
+
width: number;
|
|
21
|
+
};
|
|
22
|
+
/** Whether the line of text runs right to left, which aligns the end edges. */
|
|
23
|
+
rtl: boolean;
|
|
24
|
+
/** The trigger. */
|
|
25
|
+
trigger: Box;
|
|
26
|
+
/** The screen. */
|
|
27
|
+
viewport: {
|
|
28
|
+
height: number;
|
|
29
|
+
width: number;
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Where a list opened over its trigger goes, so the option it opens on sits
|
|
34
|
+
* where the trigger is: the native select's place on macOS, and Radix's
|
|
35
|
+
* `item-aligned`.
|
|
36
|
+
*
|
|
37
|
+
* The option's middle on the trigger's middle, then kept on the screen: a
|
|
38
|
+
* list that would run off the bottom moves up, and one that would run off the
|
|
39
|
+
* top moves down, so near an edge the option is beside the trigger rather than
|
|
40
|
+
* on it. A list taller than the screen starts at its top edge. The start edges
|
|
41
|
+
* line up, the left in English and the right in Arabic, kept on the screen the
|
|
42
|
+
* same way.
|
|
43
|
+
*/
|
|
44
|
+
export declare const over: ({ margin, option, panel, rtl, trigger, viewport, }: Over) => {
|
|
45
|
+
left: number;
|
|
46
|
+
top: number;
|
|
47
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export const over = ({ margin, option, panel, rtl, trigger, viewport, }) => {
|
|
2
|
+
const centered = trigger.top + trigger.height / 2 - (option.top + option.height / 2);
|
|
3
|
+
const top = Math.max(margin, Math.min(centered, viewport.height - margin - panel.height));
|
|
4
|
+
const start = rtl ? trigger.left + trigger.width - panel.width : trigger.left;
|
|
5
|
+
const left = Math.max(margin, Math.min(start, viewport.width - margin - panel.width));
|
|
6
|
+
return { left: Math.round(left), top: Math.round(top) };
|
|
7
|
+
};
|
|
@@ -48,6 +48,7 @@ declare const HelixHeadlessSelect_base: (new (...args: any[]) => import("@fusion
|
|
|
48
48
|
* @event {HelixBeforeCloseEvent} helix-before-close - Fired before the list closes. Cancelable: canceling it keeps the list open and leaves the decision to you.
|
|
49
49
|
* @event {HelixBeforeOpenEvent} helix-before-open - Fired before the list opens. Cancelable: canceling it keeps the list closed and leaves the decision to you.
|
|
50
50
|
* @event {HelixFilterEvent} helix-filter - Fired as the user types in the filter field of a `filterable` select, with the text the list is filtered by. Cancelable: cancel it to leave the list unfiltered and filter the options yourself.
|
|
51
|
+
* @event {HelixLoadMoreEvent} helix-load-more - Fired once the list is scrolled within a screen of its end, once for each number of options, and not while `loading` is set. Add the next page and set `loading` while you fetch it.
|
|
51
52
|
* @event {Event} input - Fired after the value changes.
|
|
52
53
|
* @event {ToggleEvent} toggle - Fired after the list opens or closes, with `newState` and `oldState`.
|
|
53
54
|
*
|
|
@@ -57,6 +58,7 @@ declare const HelixHeadlessSelect_base: (new (...args: any[]) => import("@fusion
|
|
|
57
58
|
* @csspart label - The label above the trigger.
|
|
58
59
|
* @csspart listbox - The list inside the panel.
|
|
59
60
|
* @csspart listbox-empty - The text shown when the filter hides every option.
|
|
61
|
+
* @csspart listbox-error - The inner list's `error` part, shown while its `load-error` is set.
|
|
60
62
|
* @csspart listbox-feedback - The inner list's message that says what is wrong with the value.
|
|
61
63
|
* @csspart listbox-filter-icon - The icon beside the filter field.
|
|
62
64
|
* @csspart listbox-filter-mark - The default icon beside the filter field, shown when none is slotted.
|
|
@@ -71,6 +73,9 @@ declare const HelixHeadlessSelect_base: (new (...args: any[]) => import("@fusion
|
|
|
71
73
|
* @csspart trigger - The closed control, which shows the chosen value.
|
|
72
74
|
* @csspart value - The chosen option's text inside the trigger.
|
|
73
75
|
*
|
|
76
|
+
* @cssproperty --floating-anchor-inline-size - The trigger's width, written on the panel while it is open, as in `min-inline-size: var(--floating-anchor-inline-size)`. Read it; a value set here is written over.
|
|
77
|
+
* @cssproperty --floating-available-block-size - The room between the panel and the edge of the screen it opens toward, written on the panel while it is open. Read it; a value set here is written over.
|
|
78
|
+
*
|
|
74
79
|
* @cssstate invalid - The control has an error to show, from the browser's validation or from your `feedback`.
|
|
75
80
|
* @cssstate open - While the list is open.
|
|
76
81
|
*/
|
|
@@ -87,6 +92,29 @@ export declare class HelixHeadlessSelect extends HelixHeadlessSelect_base {
|
|
|
87
92
|
* the filtering, the empty state and the keyboard.
|
|
88
93
|
*/
|
|
89
94
|
filterable: boolean;
|
|
95
|
+
/**
|
|
96
|
+
* Whether the trigger holds its group's tab stop.
|
|
97
|
+
*
|
|
98
|
+
* A toolbar keeps one tab stop across its controls, and writing `tabindex`
|
|
99
|
+
* onto this element would change markup the consumer rendered, which a React
|
|
100
|
+
* consumer's hydration reports. A toolbar sets this property instead, and
|
|
101
|
+
* the stop moves on the trigger inside the shadow root, as Button's does.
|
|
102
|
+
*
|
|
103
|
+
* No attribute, because it is coordination between elements rather than
|
|
104
|
+
* anything a consumer sets.
|
|
105
|
+
*/
|
|
106
|
+
focusable: boolean;
|
|
107
|
+
/**
|
|
108
|
+
* The open list's name where nothing names the Select, read by screen
|
|
109
|
+
* readers. The list has no visible name.
|
|
110
|
+
*
|
|
111
|
+
* A Select named by `label`, `aria-label`, `aria-labelledby` or a `<label>`
|
|
112
|
+
* gives its list that name, and this is not used. Unnamed, the Select is
|
|
113
|
+
* reported once by the missing-name warning, and its list is not reported a
|
|
114
|
+
* second time for a name the page never wrote: the list is this element's,
|
|
115
|
+
* and so is the fallback. Combobox calls its list the same.
|
|
116
|
+
*/
|
|
117
|
+
listLabel: string;
|
|
90
118
|
/**
|
|
91
119
|
* Whether the options are still loading.
|
|
92
120
|
*
|
|
@@ -107,6 +135,18 @@ export declare class HelixHeadlessSelect extends HelixHeadlessSelect_base {
|
|
|
107
135
|
* Shown on the trigger while nothing is chosen.
|
|
108
136
|
*/
|
|
109
137
|
placeholder: string;
|
|
138
|
+
/**
|
|
139
|
+
* Where the list opens: `floating`, under the trigger and above it where
|
|
140
|
+
* there is no room, or `item-aligned`, over the trigger with the chosen
|
|
141
|
+
* option where the trigger is, as a native select does on macOS and Radix
|
|
142
|
+
* Select does by default.
|
|
143
|
+
*
|
|
144
|
+
* Over the trigger, a reader's eye stays on the answer as the list opens
|
|
145
|
+
* round it, and a short move reaches the options either side. Near an edge
|
|
146
|
+
* of the screen the list moves to stay on it, so the option may sit beside
|
|
147
|
+
* the trigger rather than on it. It follows the page as it scrolls.
|
|
148
|
+
*/
|
|
149
|
+
position: 'floating' | 'item-aligned';
|
|
110
150
|
/**
|
|
111
151
|
* What the trigger shows for the chosen options: a function given them, in
|
|
112
152
|
* the order they appear, that returns text, an element or a Lit template.
|
|
@@ -213,8 +253,26 @@ export declare class HelixHeadlessSelect extends HelixHeadlessSelect_base {
|
|
|
213
253
|
private readonly handleLinkFollowed;
|
|
214
254
|
connectedCallback(): void;
|
|
215
255
|
disconnectedCallback(): void;
|
|
256
|
+
/**
|
|
257
|
+
* Puts the open list over the trigger, with the option it opened on where
|
|
258
|
+
* the trigger is, for `position="item-aligned"`.
|
|
259
|
+
*
|
|
260
|
+
* Measured once the list has drawn and scrolled to that option, and again as
|
|
261
|
+
* the page scrolls or the window changes size. The offset of the option in
|
|
262
|
+
* the list is read from the boxes on screen and divided by the list's scale,
|
|
263
|
+
* since a styled list opens from a little under full size. Written as the
|
|
264
|
+
* floating controller writes a position, so the same entrance runs and the
|
|
265
|
+
* controller takes it back on close.
|
|
266
|
+
*/
|
|
267
|
+
private readonly alignOver;
|
|
268
|
+
/** The option the open list was put over the trigger by. */
|
|
269
|
+
private alignedTo;
|
|
270
|
+
/** Stops following the page, once the list over the trigger closes. */
|
|
271
|
+
private stopAligning;
|
|
216
272
|
/** Opens the list with the highlight where the opening key says. */
|
|
217
273
|
private openAt;
|
|
274
|
+
/** Puts focus on the trigger, which is what a toolbar moving its stop here asks. */
|
|
275
|
+
focus(options?: FocusOptions): void;
|
|
218
276
|
/** Closes the list and puts focus back where it came from. */
|
|
219
277
|
private close;
|
|
220
278
|
private readonly handleChange;
|
|
@@ -276,6 +334,19 @@ export declare class HelixHeadlessSelect extends HelixHeadlessSelect_base {
|
|
|
276
334
|
* cannot change.
|
|
277
335
|
*/
|
|
278
336
|
protected renderIndicator(): TemplateResult;
|
|
337
|
+
/**
|
|
338
|
+
* What names the list once it opens, read through core's `hostWords` in
|
|
339
|
+
* the order a browser names the host: its `aria-labelledby`, its
|
|
340
|
+
* `aria-label`, the `label`, then a `<label>` for it.
|
|
341
|
+
*
|
|
342
|
+
* **Words rather than a reference**, because the list is inside another
|
|
343
|
+
* element's shadow root and neither an IDREF nor the host's labels reach it.
|
|
344
|
+
* Read as the list renders, which opening it makes happen, so a label
|
|
345
|
+
* changed while the list is closed is read when it next opens. Without the
|
|
346
|
+
* last two routes a Select named by a `<label for>` opened onto a listbox
|
|
347
|
+
* with no name, which the missing-name warning reported.
|
|
348
|
+
*/
|
|
349
|
+
private get listName();
|
|
279
350
|
/**
|
|
280
351
|
* What names the trigger: the label, then the choice.
|
|
281
352
|
*
|