@fusion.dev/helix-headless 0.147.0 → 0.149.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 +11222 -2332
- package/dist/accordion/item/accordion-item.d.ts +5 -2
- package/dist/accordion/item/accordion-item.js +11 -7
- package/dist/accordion/root/accordion-root.js +4 -6
- package/dist/announcement/root/announcement-root.d.ts +61 -5
- package/dist/announcement/root/announcement-root.js +126 -20
- package/dist/area-chart/root/area-chart-root.d.ts +11 -0
- package/dist/area-chart/root/area-chart-root.js +21 -9
- package/dist/avatar/group/avatar-group.d.ts +10 -2
- package/dist/avatar/group/avatar-group.js +10 -5
- package/dist/badge/count.d.ts +19 -0
- package/dist/badge/count.js +20 -0
- package/dist/badge/root/badge-root.d.ts +6 -2
- package/dist/badge/root/badge-root.js +8 -22
- package/dist/bar-chart/root/bar-chart-root.d.ts +13 -1
- package/dist/bar-chart/root/bar-chart-root.js +17 -4
- package/dist/blockquote/root/blockquote-root.d.ts +66 -8
- package/dist/blockquote/root/blockquote-root.js +85 -8
- package/dist/breadcrumbs/breadcrumb/breadcrumb.js +2 -2
- package/dist/breadcrumbs/root/breadcrumbs-root.d.ts +8 -1
- package/dist/breadcrumbs/root/breadcrumbs-root.js +5 -2
- package/dist/button/root/button-root.d.ts +10 -1
- package/dist/button/root/button-root.js +3 -2
- package/dist/button-group/arrows.d.ts +14 -0
- package/dist/button-group/arrows.js +10 -0
- package/dist/button-group/root/button-group-root.d.ts +144 -3
- package/dist/button-group/root/button-group-root.js +142 -2
- package/dist/callout/root/callout-root.d.ts +16 -2
- package/dist/callout/root/callout-root.js +16 -4
- package/dist/canvas/describe.d.ts +10 -0
- package/dist/canvas/describe.js +9 -0
- package/dist/canvas/edge-pan.d.ts +61 -0
- package/dist/canvas/edge-pan.js +63 -0
- package/dist/canvas/neighbor.d.ts +17 -0
- package/dist/canvas/neighbor.js +1 -0
- package/dist/canvas/node/canvas-node.d.ts +12 -2
- package/dist/canvas/node/canvas-node.js +8 -3
- package/dist/canvas/root/canvas-document.d.ts +10 -0
- package/dist/canvas/root/canvas-document.js +1 -0
- package/dist/canvas/root/canvas-root.d.ts +168 -9
- package/dist/canvas/root/canvas-root.js +239 -69
- package/dist/canvas/snap.d.ts +42 -0
- package/dist/canvas/snap.js +32 -0
- package/dist/carousel/root/carousel-root.d.ts +9 -3
- package/dist/carousel/root/carousel-root.js +17 -10
- package/dist/chat/composer/chat-composer.d.ts +5 -0
- package/dist/chat/composer/chat-composer.js +4 -1
- package/dist/chat/message/chat-message.d.ts +9 -5
- package/dist/chat/message/chat-message.js +8 -4
- package/dist/chat/naming.js +2 -2
- package/dist/chat/root/chat-root.d.ts +40 -4
- package/dist/chat/root/chat-root.js +38 -14
- package/dist/checkbox/root/checkbox-root.d.ts +11 -0
- package/dist/checkbox/root/checkbox-root.js +8 -2
- package/dist/checkbox-group/root/checkbox-group-root.d.ts +24 -0
- package/dist/checkbox-group/root/checkbox-group-root.js +28 -12
- package/dist/checkbox-group/select-all.d.ts +11 -0
- package/dist/checkbox-group/select-all.js +5 -0
- package/dist/code-block/root/code-block-root.d.ts +20 -8
- package/dist/code-block/root/code-block-root.js +16 -5
- package/dist/color-input/root/color-input-root.d.ts +13 -0
- package/dist/color-input/root/color-input-root.js +18 -5
- package/dist/color-picker/root/color-picker-root.d.ts +19 -3
- package/dist/color-picker/root/color-picker-root.js +52 -24
- package/dist/color-picker/wheel.d.ts +11 -0
- package/dist/color-picker/wheel.js +9 -0
- package/dist/combobox/root/combobox-root.d.ts +106 -18
- package/dist/combobox/root/combobox-root.js +101 -26
- package/dist/command/root/command-root.d.ts +19 -9
- package/dist/command/root/command-root.js +9 -4
- package/dist/copy-button/root/copy-button-root.d.ts +5 -0
- package/dist/copy-button/root/copy-button-root.js +7 -2
- package/dist/data-table/root/data-table-root.d.ts +171 -29
- package/dist/data-table/root/data-table-root.js +284 -161
- package/dist/date-input/root/date-input-root.d.ts +32 -9
- package/dist/date-input/root/date-input-root.js +66 -44
- package/dist/date-picker/root/date-picker-root.d.ts +38 -15
- package/dist/date-picker/root/date-picker-root.js +52 -33
- package/dist/description-list/item/description-list-item.d.ts +4 -0
- package/dist/description-list/item/description-list-item.js +7 -1
- package/dist/dialog/root/dialog-root.d.ts +12 -1
- package/dist/dialog/root/dialog-root.js +11 -4
- package/dist/divider/root/divider-root.d.ts +45 -16
- package/dist/divider/root/divider-root.js +28 -4
- package/dist/donut-chart/root/donut-chart-root.d.ts +5 -0
- package/dist/donut-chart/root/donut-chart-root.js +8 -5
- package/dist/drawer/root/drawer-root.d.ts +12 -1
- package/dist/drawer/root/drawer-root.js +9 -2
- package/dist/drilldown/item/drilldown-item.js +3 -4
- package/dist/drilldown/root/drilldown-root.d.ts +5 -0
- package/dist/drilldown/root/drilldown-root.js +4 -1
- package/dist/element-events.generated.js +26 -3
- package/dist/empty/root/empty-root.d.ts +17 -3
- package/dist/empty/root/empty-root.js +29 -5
- package/dist/file-input/root/file-input-root.d.ts +18 -3
- package/dist/file-input/root/file-input-root.js +34 -18
- package/dist/file-input/status.js +2 -1
- package/dist/filter-input/chip/filter-chip.d.ts +13 -0
- package/dist/filter-input/chip/filter-chip.js +7 -3
- package/dist/filter-input/menu/filter-menu.d.ts +5 -0
- package/dist/filter-input/menu/filter-menu.js +3 -1
- package/dist/filter-input/root/filter-input-root.d.ts +20 -3
- package/dist/filter-input/root/filter-input-root.js +8 -4
- package/dist/format-date/fields.d.ts +20 -0
- package/dist/format-date/fields.js +14 -0
- package/dist/format-date/options.d.ts +2 -1
- package/dist/format-date/options.js +9 -38
- package/dist/format-date/root/format-date-root.d.ts +55 -5
- package/dist/format-date/root/format-date-root.js +29 -34
- package/dist/graph/root/graph-model.d.ts +11 -0
- package/dist/graph/root/graph-model.js +4 -0
- package/dist/graph/root/graph-root.d.ts +101 -14
- package/dist/graph/root/graph-root.js +140 -46
- package/dist/heatmap/root/heatmap-root.d.ts +37 -4
- package/dist/heatmap/root/heatmap-root.js +51 -16
- package/dist/icon-button/root/icon-button-root.d.ts +5 -0
- package/dist/icon-button/root/icon-button-root.js +1 -0
- package/dist/image/root/image-root.d.ts +11 -0
- package/dist/input/root/input-root.d.ts +5 -0
- package/dist/input/root/input-root.js +4 -1
- package/dist/kbd/root/kbd-root.js +1 -2
- package/dist/legend/root/legend-root.js +4 -17
- package/dist/lightbox/root/lightbox-root.d.ts +14 -4
- package/dist/lightbox/root/lightbox-root.js +25 -7
- package/dist/line-chart/root/line-chart-root.d.ts +5 -0
- package/dist/line-chart/root/line-chart-root.js +4 -2
- package/dist/list/item/list-item.d.ts +32 -0
- package/dist/list/item/list-item.js +34 -7
- package/dist/list/root/list-root.d.ts +87 -0
- package/dist/list/root/list-root.js +119 -23
- package/dist/listbox/reorder/index.d.ts +1 -0
- package/dist/listbox/reorder/index.js +4 -0
- package/dist/listbox/reorder/listbox-reorder.d.ts +83 -0
- package/dist/listbox/reorder/listbox-reorder.js +151 -0
- package/dist/listbox/root/listbox-root.d.ts +185 -33
- package/dist/listbox/root/listbox-root.js +166 -136
- package/dist/loader/root/loader-root.d.ts +5 -0
- package/dist/loader/root/loader-root.js +3 -1
- package/dist/map/area/map-area.d.ts +5 -0
- package/dist/map/area/map-area.js +3 -1
- package/dist/map/buildings/map-buildings.d.ts +5 -0
- package/dist/map/buildings/map-buildings.js +3 -1
- package/dist/map/contours/map-contours.d.ts +5 -0
- package/dist/map/contours/map-contours.js +3 -1
- package/dist/map/landcover/map-landcover.d.ts +5 -0
- package/dist/map/landcover/map-landcover.js +3 -1
- package/dist/map/marker/map-marker.d.ts +18 -2
- package/dist/map/marker/map-marker.js +13 -5
- package/dist/map/points/map-points.d.ts +5 -0
- package/dist/map/points/map-points.js +6 -4
- package/dist/map/position/map-position.d.ts +5 -0
- package/dist/map/position/map-position.js +3 -1
- package/dist/map/raster/map-raster.d.ts +5 -0
- package/dist/map/raster/map-raster.js +3 -1
- package/dist/map/root/map-root.d.ts +73 -16
- package/dist/map/root/map-root.js +122 -44
- package/dist/map/route/map-route.d.ts +5 -0
- package/dist/map/route/map-route.js +3 -1
- package/dist/map/terrain/map-terrain.d.ts +5 -0
- package/dist/map/terrain/map-terrain.js +3 -1
- package/dist/megamenu/root/megamenu-root.js +4 -11
- package/dist/menu/root/menu-root.d.ts +7 -2
- package/dist/menu/root/menu-root.js +3 -1
- package/dist/meter/root/meter-root.d.ts +16 -3
- package/dist/meter/root/meter-root.js +12 -5
- package/dist/navigation/root/navigation-root.d.ts +5 -0
- package/dist/navigation/root/navigation-root.js +7 -8
- package/dist/notifications/group/notification-group.d.ts +8 -1
- package/dist/notifications/group/notification-group.js +12 -6
- package/dist/notifications/notification/notification.d.ts +17 -1
- package/dist/notifications/notification/notification.js +6 -2
- package/dist/notifications/root/notifications-root.d.ts +49 -5
- package/dist/notifications/root/notifications-root.js +36 -8
- package/dist/number-input/root/number-input-root.d.ts +21 -8
- package/dist/number-input/root/number-input-root.js +26 -11
- package/dist/object-inspector/root/object-inspector-root.d.ts +56 -13
- package/dist/object-inspector/root/object-inspector-root.js +41 -30
- package/dist/outline/root/outline-root.d.ts +5 -0
- package/dist/outline/root/outline-root.js +3 -1
- package/dist/pagination/root/pagination-root.d.ts +7 -1
- package/dist/pagination/root/pagination-root.js +16 -7
- package/dist/pagination/size/pagination-size.d.ts +8 -3
- package/dist/pagination/size/pagination-size.js +5 -3
- package/dist/pagination/summary/pagination-summary.d.ts +8 -6
- package/dist/pagination/summary/pagination-summary.js +4 -9
- package/dist/pin-input/code.d.ts +23 -0
- package/dist/pin-input/code.js +21 -0
- package/dist/pin-input/root/pin-input-root.d.ts +9 -3
- package/dist/pin-input/root/pin-input-root.js +13 -23
- package/dist/popover/root/popover-root.d.ts +12 -2
- package/dist/popover/root/popover-root.js +10 -4
- package/dist/progress/root/progress-root.d.ts +7 -2
- package/dist/progress/root/progress-root.js +5 -2
- package/dist/qr-code/name.d.ts +3 -2
- package/dist/qr-code/name.js +2 -2
- package/dist/qr-code/root/qr-code-root.d.ts +26 -5
- package/dist/qr-code/root/qr-code-root.js +27 -6
- package/dist/radio/group/radio-group.d.ts +11 -0
- package/dist/radio/group/radio-group.js +8 -2
- package/dist/rating/root/rating-root.d.ts +12 -1
- package/dist/rating/root/rating-root.js +10 -3
- package/dist/scatter-chart/measures.d.ts +22 -0
- package/dist/scatter-chart/measures.js +11 -0
- package/dist/scatter-chart/root/scatter-chart-root.d.ts +22 -8
- package/dist/scatter-chart/root/scatter-chart-root.js +25 -23
- package/dist/select/root/select-root.d.ts +67 -8
- package/dist/select/root/select-root.js +45 -11
- package/dist/skip-link/root/skip-link-root.d.ts +5 -0
- package/dist/skip-link/root/skip-link-root.js +3 -1
- package/dist/slider/root/slider-root.d.ts +7 -2
- package/dist/slider/root/slider-root.js +11 -5
- package/dist/sparkline/readings.d.ts +15 -5
- package/dist/sparkline/readings.js +3 -3
- package/dist/sparkline/root/sparkline-root.d.ts +9 -4
- package/dist/sparkline/root/sparkline-root.js +9 -3
- package/dist/speed-dial/group/speed-dial-group.d.ts +48 -0
- package/dist/speed-dial/group/speed-dial-group.js +43 -0
- package/dist/speed-dial/index.d.ts +1 -0
- package/dist/speed-dial/index.js +1 -0
- package/dist/speed-dial/item/speed-dial-item.d.ts +26 -1
- package/dist/speed-dial/item/speed-dial-item.js +41 -3
- package/dist/speed-dial/long-press.d.ts +50 -0
- package/dist/speed-dial/long-press.js +48 -0
- package/dist/speed-dial/root/speed-dial-root.d.ts +85 -1
- package/dist/speed-dial/root/speed-dial-root.js +117 -5
- package/dist/splitter/root/splitter-root.d.ts +12 -3
- package/dist/splitter/root/splitter-root.js +22 -4
- package/dist/steps/root/steps-root.d.ts +9 -2
- package/dist/steps/root/steps-root.js +6 -3
- package/dist/steps/step/step.d.ts +12 -0
- package/dist/steps/step/step.js +11 -2
- package/dist/switch/root/switch-root.d.ts +11 -0
- package/dist/switch/root/switch-root.js +8 -2
- package/dist/table/cell/table-cell.d.ts +8 -1
- package/dist/table/cell/table-cell.js +6 -2
- package/dist/table/column/table-column.d.ts +11 -4
- package/dist/table/column/table-column.js +15 -10
- package/dist/table/grid-controller.d.ts +122 -0
- package/dist/table/grid-controller.js +299 -0
- package/dist/table/root/table-root.d.ts +154 -8
- package/dist/table/root/table-root.js +197 -38
- package/dist/table/row/table-row.d.ts +55 -1
- package/dist/table/row/table-row.js +60 -7
- package/dist/tabs/root/tabs-root.d.ts +5 -0
- package/dist/tabs/root/tabs-root.js +3 -1
- package/dist/tag/group/tag-group.d.ts +5 -0
- package/dist/tag/group/tag-group.js +8 -15
- package/dist/tag/root/tag-root.d.ts +14 -1
- package/dist/tag/root/tag-root.js +11 -8
- package/dist/textarea/root/textarea-root.d.ts +5 -0
- package/dist/textarea/root/textarea-root.js +3 -1
- package/dist/time-input/root/time-input-root.d.ts +14 -7
- package/dist/time-input/root/time-input-root.js +43 -32
- package/dist/time-picker/root/time-picker-root.d.ts +16 -7
- package/dist/time-picker/root/time-picker-root.js +28 -12
- package/dist/toast/item/toast-item.d.ts +13 -3
- package/dist/toast/item/toast-item.js +2 -0
- package/dist/toast/root/toast-root.d.ts +22 -2
- package/dist/toast/root/toast-root.js +24 -17
- package/dist/toggle/group/toggle-group.js +3 -5
- package/dist/toolbar/root/toolbar-root.d.ts +36 -0
- package/dist/toolbar/root/toolbar-root.js +43 -9
- package/dist/tooltip/root/tooltip-root.d.ts +27 -17
- package/dist/tooltip/root/tooltip-root.js +1 -2
- package/dist/tour/root/tour-root.d.ts +8 -2
- package/dist/tour/root/tour-root.js +4 -2
- package/dist/tour/stop/tour-stop.d.ts +5 -0
- package/dist/tour/stop/tour-stop.js +6 -1
- package/dist/tree/grip.d.ts +5 -0
- package/dist/tree/grip.js +1 -0
- package/dist/tree/item/tree-item.d.ts +24 -0
- package/dist/tree/item/tree-item.js +27 -5
- package/dist/tree/root/tree-root.d.ts +66 -1
- package/dist/tree/root/tree-root.js +77 -5
- package/dist/trend/root/trend-root.d.ts +20 -4
- package/dist/trend/root/trend-root.js +20 -5
- package/dist/video/root/video-root.d.ts +23 -3
- package/dist/video/root/video-root.js +56 -15
- package/dist/video-playlist/menu/video-playlist-menu.d.ts +5 -0
- package/dist/video-playlist/menu/video-playlist-menu.js +3 -1
- package/dist/video-playlist/root/video-playlist-root.d.ts +5 -0
- package/dist/video-playlist/root/video-playlist-root.js +3 -1
- package/dist/virtual-list/root/virtual-list-root.d.ts +19 -3
- package/dist/virtual-list/root/virtual-list-root.js +10 -19
- package/lint.json +1 -1
- package/package.json +7 -6
- package/types/jsx.d.ts +6005 -2114
- package/types/svelte.d.ts +1 -0
- package/types/vue.d.ts +1594 -676
- package/types/words.d.ts +3280 -0
- package/dist/kbd/keys.d.ts +0 -29
- package/dist/kbd/keys.js +0 -52
- package/dist/toast/hotkey.d.ts +0 -22
- package/dist/toast/hotkey.js +0 -23
- package/dist/tooltip/focus-target.d.ts +0 -6
- package/dist/tooltip/focus-target.js +0 -9
|
@@ -4,7 +4,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
4
4
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
|
-
import { AriaForwardController, afterLinkFollowed, customElement, HelixFormElement, hostAria, hostWords, isRtl, MixinControllerOpen, MixinControllerValue, MixinField, PopoverController, reportValues, typesCharacter, } from '@fusion.dev/helix-core';
|
|
7
|
+
import { AriaForwardController, afterLinkFollowed, customElement, drawAutofill, drawStatus, HelixFormElement, hostAria, hostWords, isRtl, MixinControllerOpen, MixinControllerValue, MixinField, onApple, PopoverController, reportValues, StatusController, typesCharacter, words, wordsLocale, } from '@fusion.dev/helix-core';
|
|
8
8
|
import { caretDown } from '@fusion.dev/helix-icons';
|
|
9
9
|
import { nothing } from 'lit';
|
|
10
10
|
import { property } from 'lit/decorators.js';
|
|
@@ -23,6 +23,8 @@ let HelixHeadlessSelect = class HelixHeadlessSelect extends MixinControllerOpen(
|
|
|
23
23
|
},
|
|
24
24
|
target: () => this.partNamed('trigger'),
|
|
25
25
|
});
|
|
26
|
+
this.status = new StatusController(this);
|
|
27
|
+
this.autocomplete = '';
|
|
26
28
|
this.emptyText = 'No matches';
|
|
27
29
|
this.filterable = false;
|
|
28
30
|
this.focusable = true;
|
|
@@ -32,6 +34,7 @@ let HelixHeadlessSelect = class HelixHeadlessSelect extends MixinControllerOpen(
|
|
|
32
34
|
this.multiple = false;
|
|
33
35
|
this.placeholder = 'Choose';
|
|
34
36
|
this.position = 'floating';
|
|
37
|
+
this.valueMissingMessage = 'Choose one to continue.';
|
|
35
38
|
this.panel = new PopoverController(this, {
|
|
36
39
|
anchor: () => this.partNamed('trigger'),
|
|
37
40
|
boundary: () => [
|
|
@@ -114,7 +117,17 @@ let HelixHeadlessSelect = class HelixHeadlessSelect extends MixinControllerOpen(
|
|
|
114
117
|
this.requestOpen(true);
|
|
115
118
|
}
|
|
116
119
|
else {
|
|
117
|
-
this.
|
|
120
|
+
this.choose(match);
|
|
121
|
+
}
|
|
122
|
+
return;
|
|
123
|
+
}
|
|
124
|
+
const step = event.key === 'ArrowRight' ? 1 : event.key === 'ArrowLeft' ? -1 : 0;
|
|
125
|
+
if (step !== 0 && !this.multiple && !(event.altKey || event.ctrlKey || event.metaKey)) {
|
|
126
|
+
event.preventDefault();
|
|
127
|
+
const reachable = listbox?.options.filter((option) => !option.hidden && !option.disabled) ?? [];
|
|
128
|
+
const next = reachable[Math.max(0, reachable.findIndex((one) => one.value === this.value) + step)];
|
|
129
|
+
if (next) {
|
|
130
|
+
this.choose(next.value);
|
|
118
131
|
}
|
|
119
132
|
return;
|
|
120
133
|
}
|
|
@@ -138,6 +151,7 @@ let HelixHeadlessSelect = class HelixHeadlessSelect extends MixinControllerOpen(
|
|
|
138
151
|
}
|
|
139
152
|
};
|
|
140
153
|
}
|
|
154
|
+
static { this.words = 'helix-select'; }
|
|
141
155
|
get selectedIndex() {
|
|
142
156
|
return this.listbox?.selectedIndex ?? -1;
|
|
143
157
|
}
|
|
@@ -151,12 +165,11 @@ let HelixHeadlessSelect = class HelixHeadlessSelect extends MixinControllerOpen(
|
|
|
151
165
|
return this.partNamed('listbox');
|
|
152
166
|
}
|
|
153
167
|
get display() {
|
|
154
|
-
const chosen = new Set(this.value === '' ? [] : this.value.split(','));
|
|
155
168
|
const words = this.chosenOptions.map((option) => option.text);
|
|
156
169
|
if (words.length > 0) {
|
|
157
|
-
return new Intl.ListFormat(this
|
|
170
|
+
return new Intl.ListFormat(wordsLocale(this), { style: 'short', type: 'unit' }).format(words);
|
|
158
171
|
}
|
|
159
|
-
return
|
|
172
|
+
return this.value !== '' && !this.childrenKnown ? nothing : this.placeholder;
|
|
160
173
|
}
|
|
161
174
|
get chosenOptions() {
|
|
162
175
|
const chosen = new Set(this.value === '' ? [] : this.value.split(','));
|
|
@@ -207,6 +220,11 @@ let HelixHeadlessSelect = class HelixHeadlessSelect extends MixinControllerOpen(
|
|
|
207
220
|
this.requestOpen(false);
|
|
208
221
|
this.partNamed('trigger')?.focus();
|
|
209
222
|
}
|
|
223
|
+
choose(value) {
|
|
224
|
+
if (this.requestValue(value) && onApple()) {
|
|
225
|
+
this.status.say(String(this.display));
|
|
226
|
+
}
|
|
227
|
+
}
|
|
210
228
|
reconcileOptions() {
|
|
211
229
|
const options = optionsAmong(this.knownChildren);
|
|
212
230
|
if (this.defaultValue === '' && !this.hasAttribute('default-value')) {
|
|
@@ -232,7 +250,7 @@ let HelixHeadlessSelect = class HelixHeadlessSelect extends MixinControllerOpen(
|
|
|
232
250
|
else {
|
|
233
251
|
this.internals.setFormValue(this.value === '' ? null : this.value);
|
|
234
252
|
}
|
|
235
|
-
this.reportRequired(this.value === '',
|
|
253
|
+
this.reportRequired(this.value === '', this.valueMissingMessage, 'trigger');
|
|
236
254
|
}
|
|
237
255
|
willUpdate(changed) {
|
|
238
256
|
super.willUpdate(changed);
|
|
@@ -283,12 +301,11 @@ let HelixHeadlessSelect = class HelixHeadlessSelect extends MixinControllerOpen(
|
|
|
283
301
|
manual
|
|
284
302
|
aria-label=${this.listName || this.listLabel || nothing}
|
|
285
303
|
@keydown=${this.handleListKeydown}
|
|
304
|
+
.chosenAgain=${() => this.close()}
|
|
286
305
|
@helix-before-change=${this.handleChange}
|
|
287
306
|
@change=${this.stopInner}
|
|
288
307
|
@input=${this.stopInner}
|
|
289
308
|
>
|
|
290
|
-
<!-- An option arriving or leaving changes no property, so this is what
|
|
291
|
-
schedules the update that rereads the trigger's words. -->
|
|
292
309
|
<slot @slotchange=${() => this.requestUpdate()}></slot>
|
|
293
310
|
</${this.tag('listbox')}>`;
|
|
294
311
|
}
|
|
@@ -327,19 +344,29 @@ let HelixHeadlessSelect = class HelixHeadlessSelect extends MixinControllerOpen(
|
|
|
327
344
|
>
|
|
328
345
|
<slot name="start"></slot>
|
|
329
346
|
<span part="value" id="value">${this.renderValue()}</span>
|
|
330
|
-
${''}
|
|
331
347
|
<slot name="end"></slot>
|
|
332
|
-
${''}
|
|
333
348
|
${this.renderIndicator()}
|
|
334
349
|
</button>
|
|
335
350
|
|
|
336
351
|
<div part="surface" popover="manual" ?hidden=${!this.open}>
|
|
337
352
|
${this.renderListbox()}
|
|
338
353
|
</div>
|
|
339
|
-
${this.renderHint()}${this.renderFeedback()}
|
|
354
|
+
${this.renderHint()}${this.renderFeedback()}${drawStatus(this.status)}
|
|
355
|
+
${drawAutofill({
|
|
356
|
+
autocomplete: this.autocomplete,
|
|
357
|
+
disabled: this.isDisabled,
|
|
358
|
+
multiple: this.multiple,
|
|
359
|
+
onFill: (value) => this.requestValue(value),
|
|
360
|
+
options: optionsAmong(this.knownChildren),
|
|
361
|
+
value: this.value,
|
|
362
|
+
})}`;
|
|
340
363
|
}
|
|
341
364
|
};
|
|
342
365
|
__decorate([
|
|
366
|
+
property()
|
|
367
|
+
], HelixHeadlessSelect.prototype, "autocomplete", void 0);
|
|
368
|
+
__decorate([
|
|
369
|
+
words,
|
|
343
370
|
property({ attribute: 'empty-text' })
|
|
344
371
|
], HelixHeadlessSelect.prototype, "emptyText", void 0);
|
|
345
372
|
__decorate([
|
|
@@ -349,18 +376,21 @@ __decorate([
|
|
|
349
376
|
property({ attribute: false })
|
|
350
377
|
], HelixHeadlessSelect.prototype, "focusable", void 0);
|
|
351
378
|
__decorate([
|
|
379
|
+
words,
|
|
352
380
|
property({ attribute: 'list-label' })
|
|
353
381
|
], HelixHeadlessSelect.prototype, "listLabel", void 0);
|
|
354
382
|
__decorate([
|
|
355
383
|
property({ reflect: true, type: Boolean })
|
|
356
384
|
], HelixHeadlessSelect.prototype, "loading", void 0);
|
|
357
385
|
__decorate([
|
|
386
|
+
words,
|
|
358
387
|
property({ attribute: 'loading-text' })
|
|
359
388
|
], HelixHeadlessSelect.prototype, "loadingText", void 0);
|
|
360
389
|
__decorate([
|
|
361
390
|
property({ reflect: true, type: Boolean })
|
|
362
391
|
], HelixHeadlessSelect.prototype, "multiple", void 0);
|
|
363
392
|
__decorate([
|
|
393
|
+
words,
|
|
364
394
|
property()
|
|
365
395
|
], HelixHeadlessSelect.prototype, "placeholder", void 0);
|
|
366
396
|
__decorate([
|
|
@@ -369,6 +399,10 @@ __decorate([
|
|
|
369
399
|
__decorate([
|
|
370
400
|
property({ attribute: false })
|
|
371
401
|
], HelixHeadlessSelect.prototype, "valueContent", void 0);
|
|
402
|
+
__decorate([
|
|
403
|
+
words,
|
|
404
|
+
property({ attribute: 'value-missing-message' })
|
|
405
|
+
], HelixHeadlessSelect.prototype, "valueMissingMessage", void 0);
|
|
372
406
|
HelixHeadlessSelect = __decorate([
|
|
373
407
|
customElement('helix-headless-select')
|
|
374
408
|
], HelixHeadlessSelect);
|
|
@@ -35,6 +35,11 @@ import { type TemplateResult } from 'lit';
|
|
|
35
35
|
* @csspart link - The anchor. It takes the focus.
|
|
36
36
|
*/
|
|
37
37
|
export declare class HelixHeadlessSkipLink extends HelixElement {
|
|
38
|
+
/**
|
|
39
|
+
* The key this family's words are registered under, its styled tag:
|
|
40
|
+
* `registerWords('de', { 'helix-skip-link': { label: 'Zum Inhalt springen' } })`.
|
|
41
|
+
*/
|
|
42
|
+
static words: string;
|
|
38
43
|
/** Focus goes to the anchor inside, so the host is never the focus target. */
|
|
39
44
|
static shadowRootOptions: ShadowRootInit;
|
|
40
45
|
/**
|
|
@@ -4,7 +4,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
4
4
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
|
-
import { customElement, elementById, HelixElement, plainClick, reportRuntime, } from '@fusion.dev/helix-core';
|
|
7
|
+
import { customElement, elementById, HelixElement, plainClick, reportRuntime, words, } from '@fusion.dev/helix-core';
|
|
8
8
|
import { html } from 'lit';
|
|
9
9
|
import { property } from 'lit/decorators.js';
|
|
10
10
|
let HelixHeadlessSkipLink = class HelixHeadlessSkipLink extends HelixElement {
|
|
@@ -32,6 +32,7 @@ let HelixHeadlessSkipLink = class HelixHeadlessSkipLink extends HelixElement {
|
|
|
32
32
|
};
|
|
33
33
|
this.missed = '';
|
|
34
34
|
}
|
|
35
|
+
static { this.words = 'helix-skip-link'; }
|
|
35
36
|
static { this.shadowRootOptions = {
|
|
36
37
|
...HelixElement.shadowRootOptions,
|
|
37
38
|
delegatesFocus: true,
|
|
@@ -62,6 +63,7 @@ __decorate([
|
|
|
62
63
|
property()
|
|
63
64
|
], HelixHeadlessSkipLink.prototype, "href", void 0);
|
|
64
65
|
__decorate([
|
|
66
|
+
words,
|
|
65
67
|
property()
|
|
66
68
|
], HelixHeadlessSkipLink.prototype, "label", void 0);
|
|
67
69
|
HelixHeadlessSkipLink = __decorate([
|
|
@@ -89,6 +89,11 @@ declare const HelixHeadlessSlider_base: (new (...args: any[]) => import("@fusion
|
|
|
89
89
|
* @cssstate invalid - The slider has an error to show, from the browser's validation or from your `feedback`.
|
|
90
90
|
*/
|
|
91
91
|
export declare class HelixHeadlessSlider extends HelixHeadlessSlider_base {
|
|
92
|
+
/**
|
|
93
|
+
* The key this family's words are registered under, its styled tag:
|
|
94
|
+
* `registerWords('de', { 'helix-slider': { rangeText: '{start} bis {end}' } })`.
|
|
95
|
+
*/
|
|
96
|
+
static words: string;
|
|
92
97
|
protected readonly aria: AriaForwardController;
|
|
93
98
|
/** Typed or dragged, so every edit is announced. See `announcesInput`. */
|
|
94
99
|
protected readonly announcesInput = true;
|
|
@@ -109,8 +114,8 @@ export declare class HelixHeadlessSlider extends HelixHeadlessSlider_base {
|
|
|
109
114
|
*/
|
|
110
115
|
formatter?: (value: number) => string;
|
|
111
116
|
/**
|
|
112
|
-
* The locale
|
|
113
|
-
* the
|
|
117
|
+
* The locale the value and the words are written in, such as `de-DE`. Empty
|
|
118
|
+
* reads the nearest `lang`, then the browser's language.
|
|
114
119
|
*/
|
|
115
120
|
locale: string;
|
|
116
121
|
/**
|
|
@@ -4,7 +4,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
4
4
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
|
-
import { AriaForwardController, customElement,
|
|
7
|
+
import { AriaForwardController, customElement, formatNumber, formatWords, HelixFormElement, MixinControllerValue, MixinField, restoreValue, words, wordsLocale, } from '@fusion.dev/helix-core';
|
|
8
8
|
import { html, nothing } from 'lit';
|
|
9
9
|
import { property } from 'lit/decorators.js';
|
|
10
10
|
let HelixHeadlessSlider = class HelixHeadlessSlider extends MixinControllerValue(MixinField(HelixFormElement)) {
|
|
@@ -51,10 +51,11 @@ let HelixHeadlessSlider = class HelixHeadlessSlider extends MixinControllerValue
|
|
|
51
51
|
};
|
|
52
52
|
this.valueText = '';
|
|
53
53
|
}
|
|
54
|
+
static { this.words = 'helix-slider'; }
|
|
54
55
|
get reserve() {
|
|
55
56
|
const widest = Math.max(this.said(this.min).length, this.said(this.max).length);
|
|
56
57
|
return this.range
|
|
57
|
-
? widest * 2 +
|
|
58
|
+
? widest * 2 + formatWords(this, 'rangeText', { end: '', start: '' }).length
|
|
58
59
|
: widest;
|
|
59
60
|
}
|
|
60
61
|
get precision() {
|
|
@@ -170,11 +171,13 @@ let HelixHeadlessSlider = class HelixHeadlessSlider extends MixinControllerValue
|
|
|
170
171
|
if (this.formatter) {
|
|
171
172
|
return this.formatter(number);
|
|
172
173
|
}
|
|
173
|
-
return this.formatOptions
|
|
174
|
+
return this.formatOptions
|
|
175
|
+
? formatNumber(number, wordsLocale(this), this.formatOptions)
|
|
176
|
+
: String(at);
|
|
174
177
|
}
|
|
175
178
|
spoken(at) {
|
|
176
179
|
if (this.valueText) {
|
|
177
|
-
return
|
|
180
|
+
return formatWords(this, 'valueText', { value: this.said(at) });
|
|
178
181
|
}
|
|
179
182
|
return this.formats ? this.said(at) : nothing;
|
|
180
183
|
}
|
|
@@ -273,7 +276,7 @@ let HelixHeadlessSlider = class HelixHeadlessSlider extends MixinControllerValue
|
|
|
273
276
|
aria-hidden="true"
|
|
274
277
|
style=${`--_slider-output-reserve: ${this.reserve}ch`}
|
|
275
278
|
>${this.range
|
|
276
|
-
?
|
|
279
|
+
? formatWords(this, 'rangeText', { end: this.said(end), start: this.said(start) })
|
|
277
280
|
: this.said(this.value)}</output
|
|
278
281
|
>`
|
|
279
282
|
: nothing}
|
|
@@ -300,12 +303,14 @@ __decorate([
|
|
|
300
303
|
property({ type: Number })
|
|
301
304
|
], HelixHeadlessSlider.prototype, "max", void 0);
|
|
302
305
|
__decorate([
|
|
306
|
+
words,
|
|
303
307
|
property({ attribute: 'maximum-label' })
|
|
304
308
|
], HelixHeadlessSlider.prototype, "maximumLabel", void 0);
|
|
305
309
|
__decorate([
|
|
306
310
|
property({ type: Number })
|
|
307
311
|
], HelixHeadlessSlider.prototype, "min", void 0);
|
|
308
312
|
__decorate([
|
|
313
|
+
words,
|
|
309
314
|
property({ attribute: 'minimum-label' })
|
|
310
315
|
], HelixHeadlessSlider.prototype, "minimumLabel", void 0);
|
|
311
316
|
__decorate([
|
|
@@ -321,6 +326,7 @@ __decorate([
|
|
|
321
326
|
property({ reflect: true, type: Boolean })
|
|
322
327
|
], HelixHeadlessSlider.prototype, "range", void 0);
|
|
323
328
|
__decorate([
|
|
329
|
+
words,
|
|
324
330
|
property({ attribute: 'range-text' })
|
|
325
331
|
], HelixHeadlessSlider.prototype, "rangeText", void 0);
|
|
326
332
|
__decorate([
|
|
@@ -27,10 +27,20 @@ export interface Run {
|
|
|
27
27
|
* first. Empty where there are no runs.
|
|
28
28
|
*/
|
|
29
29
|
export declare const areaPath: (runs: readonly Run[], floor: number) => string;
|
|
30
|
+
/** The readings an overview names, each as the readout writes it. */
|
|
31
|
+
export interface Overview {
|
|
32
|
+
/** The first reading. */
|
|
33
|
+
first: string;
|
|
34
|
+
/** The highest reading. */
|
|
35
|
+
high: string;
|
|
36
|
+
/** The last reading. */
|
|
37
|
+
last: string;
|
|
38
|
+
/** The lowest reading. */
|
|
39
|
+
low: string;
|
|
40
|
+
}
|
|
30
41
|
/**
|
|
31
|
-
* What the readings come to,
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
* readings, which make no trend.
|
|
42
|
+
* What the readings come to, as `say` puts it: the first and the last
|
|
43
|
+
* reading, and the highest and the lowest, each written by `write`. Empty
|
|
44
|
+
* where there are fewer than two readings, which make no trend.
|
|
35
45
|
*/
|
|
36
|
-
export declare const overviewWords: (
|
|
46
|
+
export declare const overviewWords: (say: (overview: Overview) => string, slots: readonly (number | undefined)[], write: (at: number) => string) => string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { extremesOf
|
|
1
|
+
import { extremesOf } from '@fusion.dev/helix-core';
|
|
2
2
|
export const readingWords = (label, text, position) => {
|
|
3
3
|
const named = label === '' ? text : text === '' ? label : `${label}: ${text}`;
|
|
4
4
|
return position === '' ? named : `${named} (${position})`;
|
|
@@ -19,7 +19,7 @@ export const areaPath = (runs, floor) => runs
|
|
|
19
19
|
return `${one.path}L${last[0]},${floor}L${first[0]},${floor}Z`;
|
|
20
20
|
})
|
|
21
21
|
.join('');
|
|
22
|
-
export const overviewWords = (
|
|
22
|
+
export const overviewWords = (say, slots, write) => {
|
|
23
23
|
const placed = slots.flatMap((value, at) => (value === undefined ? [] : [at]));
|
|
24
24
|
const first = placed[0];
|
|
25
25
|
const last = placed.at(-1);
|
|
@@ -27,7 +27,7 @@ export const overviewWords = (template, slots, write) => {
|
|
|
27
27
|
if (placed.length < 2 || first === undefined || last === undefined) {
|
|
28
28
|
return '';
|
|
29
29
|
}
|
|
30
|
-
return
|
|
30
|
+
return say({
|
|
31
31
|
first: write(first),
|
|
32
32
|
high: write(high),
|
|
33
33
|
last: write(last),
|
|
@@ -64,6 +64,11 @@ import { nothing, type PropertyValues, type TemplateResult } from 'lit';
|
|
|
64
64
|
* @cssproperty --chart-terminus-y - Where the last point sits vertically, as a percentage.
|
|
65
65
|
*/
|
|
66
66
|
export declare class HelixHeadlessSparkline extends HelixElement {
|
|
67
|
+
/**
|
|
68
|
+
* The key this family's words are registered under, its styled tag:
|
|
69
|
+
* `registerWords('de', { 'helix-sparkline': { positionLabel: '{position} von {count}' } })`.
|
|
70
|
+
*/
|
|
71
|
+
static words: string;
|
|
67
72
|
/**
|
|
68
73
|
* How the line is drawn from one reading to the next.
|
|
69
74
|
*
|
|
@@ -114,11 +119,11 @@ export declare class HelixHeadlessSparkline extends HelixElement {
|
|
|
114
119
|
*/
|
|
115
120
|
label: string;
|
|
116
121
|
/**
|
|
117
|
-
* The locale the readout's numbers and positions are
|
|
118
|
-
* `de` for `1.240`.
|
|
122
|
+
* The locale the words, the readout's numbers and positions are in, such
|
|
123
|
+
* as `de` for `1.240`.
|
|
119
124
|
*
|
|
120
|
-
* Absent
|
|
121
|
-
* writes them, whatever this says.
|
|
125
|
+
* Absent reads the nearest `lang`, then the runtime's own. A table's cells
|
|
126
|
+
* are shown as the table writes them, whatever this says.
|
|
122
127
|
*/
|
|
123
128
|
locale: string;
|
|
124
129
|
/**
|
|
@@ -4,7 +4,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
4
4
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
|
-
import { CHART_PLOT, ChartPointerController, customElement, extent, extremesOf, formatNumbers, HelixElement, linear, linePath, PLOT_WIDTH, SourceController, unbroken, writtenList, writtenNumbers, } from '@fusion.dev/helix-core';
|
|
7
|
+
import { CHART_PLOT, ChartPointerController, customElement, extent, extremesOf, formatNumbers, formatWords, HelixElement, linear, linePath, PLOT_WIDTH, SourceController, unbroken, words, wordsLocale, writtenList, writtenNumbers, } from '@fusion.dev/helix-core';
|
|
8
8
|
import { html, nothing, svg } from 'lit';
|
|
9
9
|
import { property } from 'lit/decorators.js';
|
|
10
10
|
import { areaPath, overviewWords, readingWords, slotsOf } from '../readings.js';
|
|
@@ -23,6 +23,7 @@ let HelixHeadlessSparkline = class HelixHeadlessSparkline extends HelixElement {
|
|
|
23
23
|
this.source = new SourceController(this);
|
|
24
24
|
this.pointer = new ChartPointerController(this);
|
|
25
25
|
}
|
|
26
|
+
static { this.words = 'helix-sparkline'; }
|
|
26
27
|
static get observedAttributes() {
|
|
27
28
|
return [...super.observedAttributes, 'aria-label'];
|
|
28
29
|
}
|
|
@@ -67,7 +68,10 @@ let HelixHeadlessSparkline = class HelixHeadlessSparkline extends HelixElement {
|
|
|
67
68
|
const rows = this.source.rows;
|
|
68
69
|
const row = rows[at];
|
|
69
70
|
if (!row) {
|
|
70
|
-
return {
|
|
71
|
+
return {
|
|
72
|
+
label: '',
|
|
73
|
+
text: value === undefined ? '' : formatNumbers(wordsLocale(this))(value),
|
|
74
|
+
};
|
|
71
75
|
}
|
|
72
76
|
const column = row.cells.findIndex((_, index) => rows.some((one) => one.cells[index]?.value !== undefined));
|
|
73
77
|
return { label: row.label, text: row.cells[column]?.text ?? '' };
|
|
@@ -115,7 +119,7 @@ let HelixHeadlessSparkline = class HelixHeadlessSparkline extends HelixElement {
|
|
|
115
119
|
const name = this.named;
|
|
116
120
|
const named = name !== '';
|
|
117
121
|
const overview = named
|
|
118
|
-
? overviewWords(this
|
|
122
|
+
? overviewWords((values) => formatWords(this, 'overviewLabel', { ...values }), slots, (index) => this.reading(index, slots[index]).text)
|
|
119
123
|
: '';
|
|
120
124
|
return html `<svg
|
|
121
125
|
aria-describedby=${overview === '' ? nothing : 'sparkline-overview'}
|
|
@@ -218,12 +222,14 @@ __decorate([
|
|
|
218
222
|
property()
|
|
219
223
|
], HelixHeadlessSparkline.prototype, "marks", void 0);
|
|
220
224
|
__decorate([
|
|
225
|
+
words,
|
|
221
226
|
property({ attribute: 'overview-label' })
|
|
222
227
|
], HelixHeadlessSparkline.prototype, "overviewLabel", void 0);
|
|
223
228
|
__decorate([
|
|
224
229
|
property({ reflect: true })
|
|
225
230
|
], HelixHeadlessSparkline.prototype, "plot", void 0);
|
|
226
231
|
__decorate([
|
|
232
|
+
words,
|
|
227
233
|
property({ attribute: 'position-label' })
|
|
228
234
|
], HelixHeadlessSparkline.prototype, "positionLabel", void 0);
|
|
229
235
|
__decorate([
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { HelixElement } from '@fusion.dev/helix-core';
|
|
2
|
+
import { type PropertyValues, type TemplateResult } from 'lit';
|
|
3
|
+
/**
|
|
4
|
+
* @summary A named set of actions inside a speed dial, set apart from the rest.
|
|
5
|
+
*
|
|
6
|
+
* @description
|
|
7
|
+
* A `group` of the dial's menu, named by its label, as React Aria's menu
|
|
8
|
+
* sections and Menu's groups are: a reader hears the name on entering the set,
|
|
9
|
+
* and the arrow keys walk through every group's actions in order, from the
|
|
10
|
+
* last action of one group to the first of the next.
|
|
11
|
+
*
|
|
12
|
+
* Put actions straight into the group, and the group straight into the dial.
|
|
13
|
+
* Anything else slotted here is drawn and is not an action.
|
|
14
|
+
*
|
|
15
|
+
* @since 0.141.0
|
|
16
|
+
* @status stable
|
|
17
|
+
* @category actions
|
|
18
|
+
* @aliases Speed dial section, Action group
|
|
19
|
+
* @documentation https://fusion.dev/helix/components/speed-dial
|
|
20
|
+
*
|
|
21
|
+
* @slot - The group's actions.
|
|
22
|
+
* @slot label - The group's name, for content richer than the `label` text.
|
|
23
|
+
*
|
|
24
|
+
* @csspart group - The set, which carries the `group` role.
|
|
25
|
+
* @csspart label - The group's name, drawn above its actions while there is one.
|
|
26
|
+
*/
|
|
27
|
+
export declare class HelixHeadlessSpeedDialGroup extends HelixElement {
|
|
28
|
+
/**
|
|
29
|
+
* The group's name, drawn above its actions and read by screen readers.
|
|
30
|
+
*/
|
|
31
|
+
label: string;
|
|
32
|
+
/**
|
|
33
|
+
* @internal Read by the dial to find the actions inside a group, which is
|
|
34
|
+
* cheaper than `instanceof` and is why this is public rather than protected.
|
|
35
|
+
* Not a consumer's to read or set.
|
|
36
|
+
*/
|
|
37
|
+
readonly isSpeedDialGroup = true;
|
|
38
|
+
/** Whether anything is in the `label` slot, so the name is drawn from it. */
|
|
39
|
+
private labelSlotted;
|
|
40
|
+
private readonly readLabel;
|
|
41
|
+
protected firstUpdated(changed: PropertyValues): void;
|
|
42
|
+
protected render(): TemplateResult;
|
|
43
|
+
}
|
|
44
|
+
declare global {
|
|
45
|
+
interface HTMLElementTagNameMap {
|
|
46
|
+
'helix-headless-speed-dial-group': HelixHeadlessSpeedDialGroup;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
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
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { customElement, HelixElement, slotFilled } from '@fusion.dev/helix-core';
|
|
8
|
+
import { html, nothing } from 'lit';
|
|
9
|
+
import { property, state } from 'lit/decorators.js';
|
|
10
|
+
let HelixHeadlessSpeedDialGroup = class HelixHeadlessSpeedDialGroup extends HelixElement {
|
|
11
|
+
constructor() {
|
|
12
|
+
super(...arguments);
|
|
13
|
+
this.label = '';
|
|
14
|
+
this.isSpeedDialGroup = true;
|
|
15
|
+
this.labelSlotted = false;
|
|
16
|
+
this.readLabel = () => {
|
|
17
|
+
this.labelSlotted = slotFilled(this.renderRoot.querySelector('slot[name="label"]'));
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
firstUpdated(changed) {
|
|
21
|
+
super.firstUpdated(changed);
|
|
22
|
+
this.readLabel();
|
|
23
|
+
}
|
|
24
|
+
render() {
|
|
25
|
+
const named = this.label !== '' || this.labelSlotted;
|
|
26
|
+
return html `<div part="group" role="group" aria-labelledby=${named ? 'label' : nothing}>
|
|
27
|
+
<span id="label" part="label" ?hidden=${!named}
|
|
28
|
+
><slot name="label" @slotchange=${this.readLabel}>${this.label}</slot></span
|
|
29
|
+
>
|
|
30
|
+
<slot></slot>
|
|
31
|
+
</div>`;
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
__decorate([
|
|
35
|
+
property()
|
|
36
|
+
], HelixHeadlessSpeedDialGroup.prototype, "label", void 0);
|
|
37
|
+
__decorate([
|
|
38
|
+
state()
|
|
39
|
+
], HelixHeadlessSpeedDialGroup.prototype, "labelSlotted", void 0);
|
|
40
|
+
HelixHeadlessSpeedDialGroup = __decorate([
|
|
41
|
+
customElement('helix-headless-speed-dial-group')
|
|
42
|
+
], HelixHeadlessSpeedDialGroup);
|
|
43
|
+
export { HelixHeadlessSpeedDialGroup };
|
package/dist/speed-dial/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { HelixElement } from '@fusion.dev/helix-core';
|
|
2
|
-
import { type TemplateResult } from 'lit';
|
|
2
|
+
import { type PropertyValues, type TemplateResult } from 'lit';
|
|
3
3
|
/**
|
|
4
4
|
* @summary One action in a speed dial: an icon and a name beside it.
|
|
5
5
|
*
|
|
@@ -12,6 +12,13 @@ import { type TemplateResult } from 'lit';
|
|
|
12
12
|
* `title` on an icon shows only on hover. Visible text is read, searched, and
|
|
13
13
|
* translated like other text.
|
|
14
14
|
*
|
|
15
|
+
* `shortcut` gives the action's keyboard shortcut as a chord, such as `mod+s`,
|
|
16
|
+
* the grammar Menu's rows use. The action carries it as `aria-keyshortcuts`
|
|
17
|
+
* and draws it after the name in the platform's glyphs or words, `⌘S` on an
|
|
18
|
+
* Apple keyboard and `Ctrl+S` elsewhere, as Menu draws its rows' shortcuts.
|
|
19
|
+
* Put a `Kbd` in the `shortcut` slot to draw it as keys instead; the dial
|
|
20
|
+
* imports no `Kbd` of its own. Showing a shortcut does not bind it.
|
|
21
|
+
*
|
|
15
22
|
* @since 0.1.0
|
|
16
23
|
* @status stable
|
|
17
24
|
* @category actions
|
|
@@ -20,18 +27,26 @@ import { type TemplateResult } from 'lit';
|
|
|
20
27
|
*
|
|
21
28
|
* @slot - The action's name.
|
|
22
29
|
* @slot icon - The action's icon, the main way the action is recognized.
|
|
30
|
+
* @slot shortcut - The action's keyboard shortcut, drawn after its name, such as a `Kbd`. It replaces the text drawn for `shortcut`, and is hidden from the name, which `aria-keyshortcuts` carries instead.
|
|
23
31
|
*
|
|
24
32
|
* @event {HelixSelectEvent} helix-select - The action was chosen. Cancelable: cancel it to keep the dial open.
|
|
25
33
|
*
|
|
26
34
|
* @csspart icon - The box that holds the icon.
|
|
27
35
|
* @csspart item - The control for the action.
|
|
28
36
|
* @csspart label - The action's name, beside the icon.
|
|
37
|
+
* @csspart shortcut - The box after the name that holds the shortcut, shown while `shortcut` is set or something is in the `shortcut` slot.
|
|
29
38
|
*/
|
|
30
39
|
export declare class HelixHeadlessSpeedDialItem extends HelixElement {
|
|
31
40
|
/**
|
|
32
41
|
* Whether the action is disabled, so it cannot be chosen.
|
|
33
42
|
*/
|
|
34
43
|
disabled: boolean;
|
|
44
|
+
/**
|
|
45
|
+
* The action's keyboard shortcut as a chord, such as `mod+s`, carried as
|
|
46
|
+
* `aria-keyshortcuts` and drawn after the name. `mod` is Command on an Apple
|
|
47
|
+
* keyboard and Control elsewhere. Showing a shortcut does not bind it.
|
|
48
|
+
*/
|
|
49
|
+
shortcut: string;
|
|
35
50
|
/**
|
|
36
51
|
* The action's value, sent in `helix-select` when the action is chosen.
|
|
37
52
|
*/
|
|
@@ -66,9 +81,19 @@ export declare class HelixHeadlessSpeedDialItem extends HelixElement {
|
|
|
66
81
|
* chosen out of a set, and a speed dial's action is never chosen that way.
|
|
67
82
|
*/
|
|
68
83
|
get selected(): boolean;
|
|
84
|
+
/** Whether anything is in the `shortcut` slot, so its box is drawn. */
|
|
85
|
+
private hasShortcut;
|
|
86
|
+
private readonly readShortcut;
|
|
69
87
|
private choose;
|
|
70
88
|
private readonly handleClick;
|
|
71
89
|
protected render(): TemplateResult;
|
|
90
|
+
/**
|
|
91
|
+
* The `shortcut` slot, holding the shortcut drawn after the name as Kbd
|
|
92
|
+
* draws a chord and from the same table: the slot's fallback, so a `Kbd`
|
|
93
|
+
* slotted in replaces it.
|
|
94
|
+
*/
|
|
95
|
+
protected renderShortcut(): TemplateResult;
|
|
96
|
+
protected firstUpdated(changed: PropertyValues): void;
|
|
72
97
|
}
|
|
73
98
|
declare global {
|
|
74
99
|
interface HTMLElementTagNameMap {
|