@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
|
@@ -4,11 +4,12 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
4
4
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
|
-
import { AriaForwardController, appleTouch, valueAsNumber as asNumber, customElement, fillTemplate, formatNumber, numberAsValue as fromNumber, HelixFormElement, holdCaret, MixinControllerValue, MixinField, parseNumber, restoreValue, } from '@fusion.dev/helix-core';
|
|
7
|
+
import { AriaForwardController, appleTouch, valueAsNumber as asNumber, customElement, fillTemplate, formatNumber, numberAsValue as fromNumber, HelixFormElement, holdCaret, MixinControllerValue, MixinField, parseNumber, restoreValue, submitImplicitly, } from '@fusion.dev/helix-core';
|
|
8
8
|
import { minus, plus } from '@fusion.dev/helix-icons';
|
|
9
9
|
import { html, nothing } from 'lit';
|
|
10
10
|
import { property, state } from 'lit/decorators.js';
|
|
11
11
|
import { unsafeSVG } from 'lit/directives/unsafe-svg.js';
|
|
12
|
+
import { decimals, formatGrain, strideOf } from '../grain.js';
|
|
12
13
|
const SCRUB_PITCH = 4;
|
|
13
14
|
const SCRUB_FINE = 16;
|
|
14
15
|
let HelixHeadlessNumberInput = class HelixHeadlessNumberInput extends MixinControllerValue(MixinField(HelixFormElement)) {
|
|
@@ -24,9 +25,7 @@ let HelixHeadlessNumberInput = class HelixHeadlessNumberInput extends MixinContr
|
|
|
24
25
|
this.locale = '';
|
|
25
26
|
this.placeholder = '';
|
|
26
27
|
this.readOnly = false;
|
|
27
|
-
this.roleDescription = 'number field';
|
|
28
28
|
this.scrub = false;
|
|
29
|
-
this.step = 1;
|
|
30
29
|
this.valueText = '';
|
|
31
30
|
this.wheel = false;
|
|
32
31
|
this.editing = false;
|
|
@@ -58,6 +57,7 @@ let HelixHeadlessNumberInput = class HelixHeadlessNumberInput extends MixinContr
|
|
|
58
57
|
this.scrubFrom = event.clientX;
|
|
59
58
|
this.scrubValue = this.numeric ?? this.min ?? 0;
|
|
60
59
|
this.scrubStart = this.value;
|
|
60
|
+
this.toggleState('scrubbing', true);
|
|
61
61
|
event.preventDefault();
|
|
62
62
|
};
|
|
63
63
|
this.handleScrubMove = (event) => {
|
|
@@ -65,7 +65,7 @@ let HelixHeadlessNumberInput = class HelixHeadlessNumberInput extends MixinContr
|
|
|
65
65
|
if (!grip.hasPointerCapture(event.pointerId)) {
|
|
66
66
|
return;
|
|
67
67
|
}
|
|
68
|
-
const step =
|
|
68
|
+
const step = this.stride;
|
|
69
69
|
const unit = event.shiftKey ? (this.largeStep ?? 10) * step : step;
|
|
70
70
|
const pitch = event.altKey ? SCRUB_FINE : SCRUB_PITCH;
|
|
71
71
|
const steps = Math.round((event.clientX - this.scrubFrom) / pitch);
|
|
@@ -76,7 +76,7 @@ let HelixHeadlessNumberInput = class HelixHeadlessNumberInput extends MixinContr
|
|
|
76
76
|
this.requestValue(next);
|
|
77
77
|
const control = this.control;
|
|
78
78
|
if (control) {
|
|
79
|
-
restoreValue(control, this.
|
|
79
|
+
restoreValue(control, this.shown);
|
|
80
80
|
}
|
|
81
81
|
};
|
|
82
82
|
this.handleScrubEnd = (event) => {
|
|
@@ -85,6 +85,7 @@ let HelixHeadlessNumberInput = class HelixHeadlessNumberInput extends MixinContr
|
|
|
85
85
|
return;
|
|
86
86
|
}
|
|
87
87
|
grip.releasePointerCapture(event.pointerId);
|
|
88
|
+
this.toggleState('scrubbing', false);
|
|
88
89
|
if (this.value !== this.scrubStart) {
|
|
89
90
|
this.announceChange();
|
|
90
91
|
}
|
|
@@ -93,7 +94,7 @@ let HelixHeadlessNumberInput = class HelixHeadlessNumberInput extends MixinContr
|
|
|
93
94
|
event.stopPropagation();
|
|
94
95
|
const control = event.target;
|
|
95
96
|
this.requestValue(control.value);
|
|
96
|
-
restoreValue(control, this.
|
|
97
|
+
restoreValue(control, this.shown);
|
|
97
98
|
};
|
|
98
99
|
this.handleBlur = () => {
|
|
99
100
|
this.editing = false;
|
|
@@ -138,7 +139,7 @@ let HelixHeadlessNumberInput = class HelixHeadlessNumberInput extends MixinContr
|
|
|
138
139
|
};
|
|
139
140
|
this.handleKeypress = (event) => {
|
|
140
141
|
if (event.key === 'Enter' && !event.defaultPrevented) {
|
|
141
|
-
this.
|
|
142
|
+
submitImplicitly(this.form);
|
|
142
143
|
}
|
|
143
144
|
};
|
|
144
145
|
}
|
|
@@ -159,14 +160,31 @@ let HelixHeadlessNumberInput = class HelixHeadlessNumberInput extends MixinContr
|
|
|
159
160
|
}
|
|
160
161
|
return parseNumber(text, this.locale, this.formatOptions);
|
|
161
162
|
}
|
|
163
|
+
get stride() {
|
|
164
|
+
return Math.abs(this.step ?? 0) || strideOf(this.formatOptions);
|
|
165
|
+
}
|
|
166
|
+
get grid() {
|
|
167
|
+
const step = Math.abs(this.step ?? 0);
|
|
168
|
+
const options = this.formatOptions;
|
|
169
|
+
if (step || !options) {
|
|
170
|
+
return step || 1;
|
|
171
|
+
}
|
|
172
|
+
const [locale, read, grain] = this.grainOf ?? [];
|
|
173
|
+
if (locale === this.locale && read === options && grain !== undefined) {
|
|
174
|
+
return grain;
|
|
175
|
+
}
|
|
176
|
+
const fresh = formatGrain(this.locale, options);
|
|
177
|
+
this.grainOf = [this.locale, options, fresh];
|
|
178
|
+
return fresh;
|
|
179
|
+
}
|
|
162
180
|
onStep(value) {
|
|
163
|
-
const step =
|
|
181
|
+
const step = this.grid;
|
|
164
182
|
const anchor = this.min ?? 0;
|
|
165
183
|
const steps = (value - anchor) / step;
|
|
166
184
|
return Math.abs(steps - Math.round(steps)) < 1e-9;
|
|
167
185
|
}
|
|
168
186
|
clamp(value) {
|
|
169
|
-
const step =
|
|
187
|
+
const step = this.grid;
|
|
170
188
|
const anchor = this.min ?? 0;
|
|
171
189
|
const stepped = anchor + Math.round((value - anchor) / step) * step;
|
|
172
190
|
const floored = this.min === undefined ? stepped : Math.max(this.min, stepped);
|
|
@@ -178,7 +196,7 @@ let HelixHeadlessNumberInput = class HelixHeadlessNumberInput extends MixinContr
|
|
|
178
196
|
if (this.isDisabled || this.readOnly) {
|
|
179
197
|
return;
|
|
180
198
|
}
|
|
181
|
-
const step =
|
|
199
|
+
const step = this.stride;
|
|
182
200
|
const from = this.numeric ?? this.min ?? 0;
|
|
183
201
|
const next = this.clamp(this.numeric === null ? from : from + steps * step);
|
|
184
202
|
this.land(String(next));
|
|
@@ -188,7 +206,7 @@ let HelixHeadlessNumberInput = class HelixHeadlessNumberInput extends MixinContr
|
|
|
188
206
|
const applied = this.requestValue(next);
|
|
189
207
|
const control = this.control;
|
|
190
208
|
if (control) {
|
|
191
|
-
restoreValue(control, this.
|
|
209
|
+
restoreValue(control, this.shown);
|
|
192
210
|
}
|
|
193
211
|
if (applied && this.value !== before) {
|
|
194
212
|
this.announceChange();
|
|
@@ -224,7 +242,7 @@ let HelixHeadlessNumberInput = class HelixHeadlessNumberInput extends MixinContr
|
|
|
224
242
|
}
|
|
225
243
|
const before = this.value;
|
|
226
244
|
this.requestValue(String(this.clamp(parsed)));
|
|
227
|
-
restoreValue(control, this.
|
|
245
|
+
restoreValue(control, this.shown);
|
|
228
246
|
return this.value !== before;
|
|
229
247
|
}
|
|
230
248
|
sync() {
|
|
@@ -254,7 +272,7 @@ let HelixHeadlessNumberInput = class HelixHeadlessNumberInput extends MixinContr
|
|
|
254
272
|
}), control);
|
|
255
273
|
}
|
|
256
274
|
else if (parsed !== null && !this.onStep(parsed)) {
|
|
257
|
-
const step =
|
|
275
|
+
const step = this.grid;
|
|
258
276
|
const anchor = this.min ?? 0;
|
|
259
277
|
const below = this.clamp(anchor + Math.floor((parsed - anchor) / step) * step);
|
|
260
278
|
const above = this.clamp(anchor + Math.ceil((parsed - anchor) / step) * step);
|
|
@@ -317,7 +335,6 @@ let HelixHeadlessNumberInput = class HelixHeadlessNumberInput extends MixinContr
|
|
|
317
335
|
.value=${this.shown}
|
|
318
336
|
type="text"
|
|
319
337
|
role=${this.touchApple ? nothing : 'spinbutton'}
|
|
320
|
-
aria-roledescription=${this.touchApple ? this.roleDescription : nothing}
|
|
321
338
|
inputmode="decimal"
|
|
322
339
|
autocomplete=${this.autocomplete || nothing}
|
|
323
340
|
name=${this.name || nothing}
|
|
@@ -411,9 +428,6 @@ __decorate([
|
|
|
411
428
|
__decorate([
|
|
412
429
|
property({ attribute: 'readonly', reflect: true, type: Boolean })
|
|
413
430
|
], HelixHeadlessNumberInput.prototype, "readOnly", void 0);
|
|
414
|
-
__decorate([
|
|
415
|
-
property({ attribute: 'role-description' })
|
|
416
|
-
], HelixHeadlessNumberInput.prototype, "roleDescription", void 0);
|
|
417
431
|
__decorate([
|
|
418
432
|
property({ reflect: true, type: Boolean })
|
|
419
433
|
], HelixHeadlessNumberInput.prototype, "scrub", void 0);
|
|
@@ -436,11 +450,3 @@ HelixHeadlessNumberInput = __decorate([
|
|
|
436
450
|
customElement('helix-headless-number-input')
|
|
437
451
|
], HelixHeadlessNumberInput);
|
|
438
452
|
export { HelixHeadlessNumberInput };
|
|
439
|
-
const decimals = (value) => {
|
|
440
|
-
const text = String(value);
|
|
441
|
-
const exponent = /e-(\d+)$/.exec(text);
|
|
442
|
-
if (exponent) {
|
|
443
|
-
return Number(exponent[1]);
|
|
444
|
-
}
|
|
445
|
-
return (text.split('.')[1] ?? '').length;
|
|
446
|
-
};
|
|
@@ -15,13 +15,30 @@ import { type Row } from '../rows.js';
|
|
|
15
15
|
* works with server rendering and with React hydration, which skips object
|
|
16
16
|
* properties. `value` wins when both are set.
|
|
17
17
|
*
|
|
18
|
-
* The tree is one tab stop
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
* a
|
|
18
|
+
* **Keyboard.** The tree is one tab stop, and focus moves from row to row.
|
|
19
|
+
*
|
|
20
|
+
* | Key | What it does |
|
|
21
|
+
* |---|---|
|
|
22
|
+
* | Down, Up | Moves to the next or the previous row. |
|
|
23
|
+
* | Right | Opens a closed branch, or moves into an open one. Left on a right-to-left page. |
|
|
24
|
+
* | Left | Closes an open branch, or moves to the parent. Right on a right-to-left page. |
|
|
25
|
+
* | Home, End | Moves to the first or the last row. |
|
|
26
|
+
* | Page Down, Page Up | Moves a box's height of rows, so the row at one edge lands at the other. |
|
|
27
|
+
* | Enter, Space | Opens or closes a branch. |
|
|
28
|
+
* | `*` | Opens every branch beside the active row. |
|
|
29
|
+
* | A letter or a word | Moves to the next row whose key starts with what you typed. |
|
|
30
|
+
* | Command+C, Control+C | Copies the active row, where no text is selected. |
|
|
31
|
+
*
|
|
32
|
+
* The tree is a `treegrid`, as React Aria's Tree is: each entry is a `row` with
|
|
33
|
+
* one cell, and carries its real level, position, and set size, including in a
|
|
34
|
+
* windowed tree. Nothing in it is chosen, so no row carries `aria-selected`,
|
|
35
|
+
* and a focused row is not announced as selected.
|
|
36
|
+
*
|
|
37
|
+
* A reader opening or closing a branch sends `helix-before-open` or
|
|
38
|
+
* `helix-before-close`, which you can cancel, and then `toggle` with
|
|
39
|
+
* `newState` and `oldState`, as `<details>` does. The branch is the active
|
|
40
|
+
* row, and `expanded` holds every open branch. `*` asks once for all the
|
|
41
|
+
* branches it opens. A script writing `expanded` or `active` sends nothing.
|
|
25
42
|
*
|
|
26
43
|
* `active` is the active row's path, written the way a JSON Pointer writes it:
|
|
27
44
|
* the empty string for the root and `/meta/tags/0` for an entry under it.
|
|
@@ -60,9 +77,12 @@ import { type Row } from '../rows.js';
|
|
|
60
77
|
*
|
|
61
78
|
* @event {HelixActivateEvent} helix-activate - The active row moved, by a key or a click. The detail's `value` is its path.
|
|
62
79
|
* @event {HelixBeforeActivateEvent} helix-before-activate - The active row is about to move, with its new path. Cancelable: cancel it to keep the row where it is.
|
|
80
|
+
* @event {HelixBeforeCloseEvent} helix-before-close - A reader is about to close the active branch. Cancelable: cancel it to keep the branch open.
|
|
81
|
+
* @event {HelixBeforeOpenEvent} helix-before-open - A reader is about to open the active branch, or `*` the branches beside it. Cancelable: cancel it to keep them closed.
|
|
63
82
|
* @event {HelixCopyEvent} helix-copy - A value was put on the clipboard, from the copy button or the keyboard.
|
|
64
83
|
* @event {HelixFilterEvent} helix-filter - Text was typed in the filter field, with what it now holds. Cancelable: cancel it to keep the filter as it was.
|
|
65
84
|
* @event {HelixFilteredEvent} helix-filtered - The filter field changed `filter`, which now holds the text.
|
|
85
|
+
* @event {ToggleEvent} toggle - A reader opened or closed a branch, with `newState` and `oldState`. `expanded` holds every open branch.
|
|
66
86
|
*
|
|
67
87
|
* @csspart after - The space the rows below the drawn rows would take, when `windowed` is set.
|
|
68
88
|
* @csspart before - The space the rows above the drawn rows would take, when `windowed` is set.
|
|
@@ -71,6 +91,7 @@ import { type Row } from '../rows.js';
|
|
|
71
91
|
* @csspart copy-button - The button inside the copy control.
|
|
72
92
|
* @csspart copy-live - The live region inside the copy button, which says its `pending-label` when the copy becomes pending under focus.
|
|
73
93
|
* @csspart copy-mark - The clipboard icon, and the confirmation icon that replaces it.
|
|
94
|
+
* @csspart copy-spinner - The ring the copy button turns while it is pending.
|
|
74
95
|
* @csspart copy-text - The words on that button, trimmed to their capitals and baseline.
|
|
75
96
|
* @csspart copy-tooltip - The tooltip, forwarded from the copy button's tooltip.
|
|
76
97
|
* @csspart copy-tooltip-arrow - The tooltip's arrow, pointing at the copy button.
|
|
@@ -90,14 +111,14 @@ import { type Row } from '../rows.js';
|
|
|
90
111
|
* @csspart live - How many entries a filter matched, in a region that screen readers announce when it changes. Drawn from the first filter on. Visually hidden in the styled tier.
|
|
91
112
|
* @csspart null - A `null`.
|
|
92
113
|
* @csspart number - A number.
|
|
93
|
-
* @csspart row - One entry, as a tree
|
|
94
|
-
* @csspart row-active - The entry the keyboard is on. Set alongside `row`.
|
|
114
|
+
* @csspart row - One entry, as a row of the tree grid, which takes focus.
|
|
115
|
+
* @csspart row-active - The entry the keyboard is on, which holds the tab stop. Set alongside `row`.
|
|
95
116
|
* @csspart row-match - An entry whose key or value holds the filter. Set alongside `row`.
|
|
96
117
|
* @csspart search-field - The field that sets `filter`, with `filterable`.
|
|
97
118
|
* @csspart string - A string, in quotes.
|
|
98
119
|
* @csspart summary - The brackets that stand for a branch's contents.
|
|
99
120
|
* @csspart toggle - The caret on a branch. It points down when the branch is open and sideways when it is closed.
|
|
100
|
-
* @csspart tree - The tree
|
|
121
|
+
* @csspart tree - The tree grid that holds the rows.
|
|
101
122
|
*
|
|
102
123
|
* @cssproperty --object-inspector-level - How deep a row is, from 0 at the root, for indenting it.
|
|
103
124
|
*/
|
|
@@ -230,8 +251,12 @@ export declare class HelixHeadlessObjectInspector extends HelixElement {
|
|
|
230
251
|
private found;
|
|
231
252
|
/** Set by a keyboard move, so the next render brings the active row into view. */
|
|
232
253
|
private revealing;
|
|
254
|
+
/** Set by a reader's move, so the next render moves focus to the active row. */
|
|
255
|
+
private focusing;
|
|
256
|
+
/** Whether a row held focus as this update began, so a row the render moved gets it back. */
|
|
257
|
+
private hadFocus;
|
|
233
258
|
/** What has been typed toward a key, and when the last letter came. */
|
|
234
|
-
private typed;
|
|
259
|
+
private readonly typed;
|
|
235
260
|
/** The branches of the last value seen, by path, so a new value can tell old ones from new. */
|
|
236
261
|
private branches;
|
|
237
262
|
/** Carries a host `aria-label` and `aria-labelledby` to the tree, which is what takes focus. */
|
|
@@ -266,16 +291,17 @@ export declare class HelixHeadlessObjectInspector extends HelixElement {
|
|
|
266
291
|
/** Opens the branches around each path, where the value has them. */
|
|
267
292
|
private openAround;
|
|
268
293
|
protected willUpdate(changed: PropertyValues): void;
|
|
269
|
-
/**
|
|
270
|
-
* Where the active row goes once the rows have moved: onto `path` where it
|
|
271
|
-
* is still shown, onto the first match where a filter just hid it, and
|
|
272
|
-
* otherwise onto the nearest branch around it that is.
|
|
273
|
-
*/
|
|
274
|
-
private place;
|
|
275
294
|
/** Says how many entries the filter matched, and nothing for an empty one. */
|
|
276
295
|
private tell;
|
|
277
296
|
protected firstUpdated(changed: PropertyValues): void;
|
|
278
297
|
protected updated(changed: PropertyValues): void;
|
|
298
|
+
/**
|
|
299
|
+
* Moves focus to the active row, once it is drawn.
|
|
300
|
+
*
|
|
301
|
+
* After a reader's move only, so a script writing `active` does not take
|
|
302
|
+
* focus from wherever the reader is.
|
|
303
|
+
*/
|
|
304
|
+
private focusActive;
|
|
279
305
|
private load;
|
|
280
306
|
/**
|
|
281
307
|
* Brings the active row into the box.
|
|
@@ -292,6 +318,20 @@ export declare class HelixHeadlessObjectInspector extends HelixElement {
|
|
|
292
318
|
private reveal;
|
|
293
319
|
/** What copying takes: a branch as indented JSON, a string as itself. */
|
|
294
320
|
private copyable;
|
|
321
|
+
/**
|
|
322
|
+
* Asks to open or close branches, and then does and says so:
|
|
323
|
+
* `helix-before-open` or `helix-before-close`, which a listener can cancel,
|
|
324
|
+
* then `toggle`. A reader's act only. Returns whether they moved.
|
|
325
|
+
*/
|
|
326
|
+
private requestOpen;
|
|
327
|
+
/**
|
|
328
|
+
* Says a branch opened or closed under the platform's own name and in its
|
|
329
|
+
* shape: `toggle` with `newState` and `oldState`, not bubbling, as
|
|
330
|
+
* `<details>` sends it and as the open mixin does for the families whose
|
|
331
|
+
* open state it owns. A real `ToggleEvent` where the platform has one, and a
|
|
332
|
+
* plain event carrying the same two fields where it does not.
|
|
333
|
+
*/
|
|
334
|
+
private announceToggle;
|
|
295
335
|
private toggle;
|
|
296
336
|
/**
|
|
297
337
|
* Moves the active row, asking first: `helix-before-activate` with the path,
|
|
@@ -299,21 +339,24 @@ export declare class HelixHeadlessObjectInspector extends HelixElement {
|
|
|
299
339
|
*/
|
|
300
340
|
private move;
|
|
301
341
|
private readonly handleKeydown;
|
|
302
|
-
/** Opens every branch at the active row's level under the same parent, as `*` asks. */
|
|
303
|
-
private openSiblings;
|
|
304
342
|
/**
|
|
305
|
-
* Moves to the next row whose key starts with what was typed
|
|
306
|
-
*
|
|
307
|
-
*
|
|
308
|
-
*
|
|
309
|
-
* keys that start with it.
|
|
343
|
+
* Moves to the next row whose key starts with what was typed, through core's
|
|
344
|
+
* `Typeahead`: letters within half a second run together, so `me` finds
|
|
345
|
+
* `meta` past `message`, and a repeated letter cycles through the keys that
|
|
346
|
+
* start with it.
|
|
310
347
|
*/
|
|
311
348
|
private typeahead;
|
|
349
|
+
/**
|
|
350
|
+
* How many rows Page Down and Page Up move: the rows that fit in the tree's
|
|
351
|
+
* box, or in the window where the box does not scroll, less one, so the row
|
|
352
|
+
* at one edge lands at the other.
|
|
353
|
+
*/
|
|
354
|
+
private pageRows;
|
|
312
355
|
/** A press opens or closes the row it lands on, once that row is the active one. */
|
|
313
356
|
private handleRowClick;
|
|
314
357
|
/** Text typed in the filter field, asked for before the tree narrows to it. */
|
|
315
358
|
private readonly handleFilterInput;
|
|
316
|
-
/** Down from the filter field goes to the
|
|
359
|
+
/** Down from the filter field goes to the active row, where the matches are. */
|
|
317
360
|
private readonly handleFilterKeydown;
|
|
318
361
|
private renderValue;
|
|
319
362
|
/**
|
|
@@ -321,17 +364,29 @@ export declare class HelixHeadlessObjectInspector extends HelixElement {
|
|
|
321
364
|
*
|
|
322
365
|
* **`row-active` and no attribute beside it.** Which row the keys are on is
|
|
323
366
|
* drawn by a sheet and by nothing else: the accessibility tree hears it from
|
|
324
|
-
*
|
|
325
|
-
*
|
|
326
|
-
*
|
|
327
|
-
* attribute selector.
|
|
367
|
+
* focus, which the row holds, so an attribute would be a second spelling with
|
|
368
|
+
* no reader. The name is the one a consumer can reach, nothing being able to
|
|
369
|
+
* follow `::part()` with an attribute selector.
|
|
328
370
|
*
|
|
329
|
-
*
|
|
330
|
-
*
|
|
331
|
-
*
|
|
332
|
-
*
|
|
371
|
+
* **A `row` of a `treegrid` with one cell, focused itself, and no
|
|
372
|
+
* `aria-selected`**, because nothing here is chosen. Chromium takes the
|
|
373
|
+
* focused item of a single-selection `tree` as selected, by focus or by
|
|
374
|
+
* `aria-activedescendant` (measured), so every arrow press was also announced
|
|
375
|
+
* as a selection, and `aria-selected="false"` on every row was the one way to
|
|
376
|
+
* turn it off. A row of a tree grid is not selected by focus, which is why
|
|
377
|
+
* React Aria's Tree is one. The cell is `display: contents`, so the row lays
|
|
378
|
+
* out its text as it did.
|
|
333
379
|
*/
|
|
334
380
|
private renderRow;
|
|
381
|
+
/** Whether a row of the tree holds focus. */
|
|
382
|
+
private hasFocusedRow;
|
|
383
|
+
/**
|
|
384
|
+
* A row that takes focus some other way than the keys, from a script or a
|
|
385
|
+
* screen reader, becomes the active row, so focus and the keys agree.
|
|
386
|
+
*/
|
|
387
|
+
private readonly handleFocusIn;
|
|
388
|
+
/** A row kept drawn for focus is let go once focus leaves it. */
|
|
389
|
+
private readonly handleFocusOut;
|
|
335
390
|
/** The copy button, behind the seam Code Block's uses, so each tier renders its own. */
|
|
336
391
|
protected renderCopyButton(row: Row | undefined): TemplateResult;
|
|
337
392
|
protected render(): TemplateResult;
|