@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, DelayController,
|
|
7
|
+
import { AriaForwardController, afterLinkFollowed, countLabel, customElement, DelayController, drawAutofill, drawStatus, formatWords, HelixCreateEvent, HelixFilterEvent, HelixFormElement, handedLocale, MixinControllerOpen, MixinControllerValue, MixinField, MixinTokens, onApple, PopoverController, reportValues, StatusController, submitImplicitly, 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, state } from 'lit/decorators.js';
|
|
@@ -21,24 +21,28 @@ let HelixHeadlessCombobox = class HelixHeadlessCombobox extends MixinControllerO
|
|
|
21
21
|
this.aria = new AriaForwardController(this, {
|
|
22
22
|
target: () => this.partNamed('control'),
|
|
23
23
|
});
|
|
24
|
+
this.status = new StatusController(this);
|
|
25
|
+
this.told = undefined;
|
|
24
26
|
this.allowsCustomValue = false;
|
|
25
27
|
this.autocomplete = 'off';
|
|
26
28
|
this.creatable = false;
|
|
27
|
-
this.createLabel = 'Add';
|
|
29
|
+
this.createLabel = 'Add "{value}"';
|
|
28
30
|
this.emptyText = 'No matches';
|
|
29
31
|
this.filterDelay = 0;
|
|
30
32
|
this.listLabel = 'Options';
|
|
31
33
|
this.loadError = '';
|
|
32
34
|
this.loading = false;
|
|
33
35
|
this.loadingText = 'Loading';
|
|
36
|
+
this.locale = '';
|
|
34
37
|
this.multiple = false;
|
|
35
38
|
this.openOn = 'input';
|
|
36
39
|
this.placeholder = '';
|
|
37
40
|
this.readOnly = false;
|
|
38
41
|
this.removeLabel = 'Remove {name}';
|
|
39
|
-
this.
|
|
40
|
-
this.
|
|
42
|
+
this.resultsLabel = '{count, plural, one {# result} other {# results}}';
|
|
43
|
+
this.selectedLabel = '{name}, selected';
|
|
41
44
|
this.suggest = false;
|
|
45
|
+
this.valueMissingMessage = 'Choose one to continue.';
|
|
42
46
|
this.typed = '';
|
|
43
47
|
this.suggestion = '';
|
|
44
48
|
this.editing = false;
|
|
@@ -166,12 +170,17 @@ let HelixHeadlessCombobox = class HelixHeadlessCombobox extends MixinControllerO
|
|
|
166
170
|
submitImplicitly(this.form);
|
|
167
171
|
}
|
|
168
172
|
};
|
|
173
|
+
this.counted = '';
|
|
169
174
|
this.handleChange = (event) => {
|
|
170
175
|
event.stopPropagation();
|
|
171
176
|
const { value } = event.detail;
|
|
172
177
|
if (!this.requestValue(value)) {
|
|
173
178
|
return;
|
|
174
179
|
}
|
|
180
|
+
const chosen = this.listbox?.options.find((option) => option.value === value);
|
|
181
|
+
if (chosen && onApple()) {
|
|
182
|
+
this.status.say(formatWords(this, 'selectedLabel', { name: chosen.text }));
|
|
183
|
+
}
|
|
175
184
|
this.emptied = false;
|
|
176
185
|
this.typed = '';
|
|
177
186
|
this.suggestion = '';
|
|
@@ -204,6 +213,7 @@ let HelixHeadlessCombobox = class HelixHeadlessCombobox extends MixinControllerO
|
|
|
204
213
|
afterLinkFollowed(event, () => this.requestOpen(false));
|
|
205
214
|
};
|
|
206
215
|
}
|
|
216
|
+
static { this.words = 'helix-combobox'; }
|
|
207
217
|
requestValue(next) {
|
|
208
218
|
if (this.readOnly) {
|
|
209
219
|
return false;
|
|
@@ -247,7 +257,9 @@ let HelixHeadlessCombobox = class HelixHeadlessCombobox extends MixinControllerO
|
|
|
247
257
|
}
|
|
248
258
|
markStatus() {
|
|
249
259
|
const list = this.listbox;
|
|
250
|
-
this.toggleState('
|
|
260
|
+
this.toggleState('blank', this.value === '');
|
|
261
|
+
this.toggleState('loading', this.loading);
|
|
262
|
+
this.toggleState('error', Boolean(this.loadError));
|
|
251
263
|
this.toggleState('no-results', list !== null &&
|
|
252
264
|
!this.loading &&
|
|
253
265
|
list.filter !== '' &&
|
|
@@ -382,16 +394,52 @@ let HelixHeadlessCombobox = class HelixHeadlessCombobox extends MixinControllerO
|
|
|
382
394
|
}
|
|
383
395
|
linkActive() {
|
|
384
396
|
const control = this.partNamed('control');
|
|
385
|
-
if (!control || !('ariaActiveDescendantElement' in control)) {
|
|
386
|
-
return;
|
|
387
|
-
}
|
|
388
397
|
const active = !this.open
|
|
389
398
|
? undefined
|
|
390
399
|
: this.onCreate
|
|
391
400
|
? this.partNamed('create')
|
|
392
401
|
: (this.listbox?.options ?? []).find((option) => option.active && !option.hidden);
|
|
402
|
+
this.tell(active);
|
|
403
|
+
if (!control || !('ariaActiveDescendantElement' in control)) {
|
|
404
|
+
return;
|
|
405
|
+
}
|
|
406
|
+
;
|
|
393
407
|
control.ariaActiveDescendantElement = active ?? null;
|
|
394
408
|
}
|
|
409
|
+
tell(active) {
|
|
410
|
+
if (!this.open) {
|
|
411
|
+
this.told = undefined;
|
|
412
|
+
return;
|
|
413
|
+
}
|
|
414
|
+
if ((active ?? null) === this.told ||
|
|
415
|
+
!onApple() ||
|
|
416
|
+
this.renderRoot.activeElement !== this.partNamed('control')) {
|
|
417
|
+
return;
|
|
418
|
+
}
|
|
419
|
+
if (this.listbox?.isUpdatePending) {
|
|
420
|
+
void this.listbox.updateComplete.then(() => this.linkActive());
|
|
421
|
+
return;
|
|
422
|
+
}
|
|
423
|
+
if (this.told === undefined) {
|
|
424
|
+
this.counted = this.countSaid(this.reachable.length);
|
|
425
|
+
}
|
|
426
|
+
this.told = active ?? null;
|
|
427
|
+
const option = active;
|
|
428
|
+
const words = option?.text === undefined
|
|
429
|
+
? (active?.textContent?.trim() ?? '')
|
|
430
|
+
: option.selected
|
|
431
|
+
? formatWords(this, 'selectedLabel', { name: option.text })
|
|
432
|
+
: option.text;
|
|
433
|
+
this.status.say([this.counted, words].filter(Boolean).join('. '));
|
|
434
|
+
if (active) {
|
|
435
|
+
this.counted = '';
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
countSaid(count) {
|
|
439
|
+
return this.resultLabel
|
|
440
|
+
? countLabel(count, this.resultLabel, this.resultsLabel, wordsLocale(this))
|
|
441
|
+
: formatWords(this, 'resultsLabel', { count });
|
|
442
|
+
}
|
|
395
443
|
removeLastToken() {
|
|
396
444
|
const last = this.values.at(-1);
|
|
397
445
|
if (last !== undefined) {
|
|
@@ -405,7 +453,7 @@ let HelixHeadlessCombobox = class HelixHeadlessCombobox extends MixinControllerO
|
|
|
405
453
|
else {
|
|
406
454
|
this.internals.setFormValue(this.value === '' ? null : this.value);
|
|
407
455
|
}
|
|
408
|
-
this.reportRequired(this.value === '',
|
|
456
|
+
this.reportRequired(this.value === '', this.valueMissingMessage, 'control');
|
|
409
457
|
}
|
|
410
458
|
connectedCallback() {
|
|
411
459
|
super.connectedCallback();
|
|
@@ -468,7 +516,11 @@ let HelixHeadlessCombobox = class HelixHeadlessCombobox extends MixinControllerO
|
|
|
468
516
|
this.opening = undefined;
|
|
469
517
|
void this.listbox?.updateComplete.then(() => this.linkActive());
|
|
470
518
|
}
|
|
471
|
-
if (control &&
|
|
519
|
+
if (control &&
|
|
520
|
+
!this.editing &&
|
|
521
|
+
!this.multiple &&
|
|
522
|
+
control.value !== '' &&
|
|
523
|
+
this.renderRoot.activeElement === control) {
|
|
472
524
|
control.select();
|
|
473
525
|
}
|
|
474
526
|
}
|
|
@@ -492,30 +544,22 @@ let HelixHeadlessCombobox = class HelixHeadlessCombobox extends MixinControllerO
|
|
|
492
544
|
load-error=${this.loadError}
|
|
493
545
|
loading-text=${this.loadingText}
|
|
494
546
|
no-results-text=${this.noResultsText ?? nothing}
|
|
495
|
-
|
|
547
|
+
lang=${handedLocale(this) || nothing}
|
|
548
|
+
result-label=${this.resultLabel ?? ''}
|
|
496
549
|
results-label=${this.resultsLabel}
|
|
497
550
|
?loading=${this.loading}
|
|
498
551
|
?multiple=${this.multiple}
|
|
499
552
|
.value=${this.value}
|
|
553
|
+
.chosenAgain=${() => this.close()}
|
|
500
554
|
@helix-before-change=${this.handleChange}
|
|
501
555
|
@change=${this.stopInner}
|
|
502
556
|
@helix-filter=${this.stopInner}
|
|
503
557
|
@input=${this.stopInner}
|
|
504
558
|
>
|
|
505
|
-
<!-- The field's words are read off the options, and on the first
|
|
506
|
-
render there are none: the slot has not been assigned yet, so a
|
|
507
|
-
combobox with a value comes up empty. Assignment changes no
|
|
508
|
-
property, so nothing else would schedule the update that fixes
|
|
509
|
-
it. -->
|
|
510
559
|
<slot @slotchange=${() => this.requestUpdate()}></slot>
|
|
511
|
-
<!-- Handed on to the list's own, with the text as this slot's fallback:
|
|
512
|
-
a slot passed into another is assigned there whether or not anything
|
|
513
|
-
fills it, so the list's fallback would never show. -->
|
|
514
560
|
<slot name="empty" slot="empty">${this.emptyText}</slot>
|
|
515
561
|
<slot name="loading" slot="loading">${this.loadingText}</slot>
|
|
516
562
|
<slot name="error" slot="error">${this.loadError}</slot>
|
|
517
|
-
<!-- Handed on only while something fills it: an assigned slot hides the
|
|
518
|
-
list's own fallback, which is no-results-text or empty-text. -->
|
|
519
563
|
<slot
|
|
520
564
|
name="no-results"
|
|
521
565
|
slot=${this.querySelector?.(':scope > [slot="no-results"]') ? 'no-results' : nothing}
|
|
@@ -528,7 +572,7 @@ let HelixHeadlessCombobox = class HelixHeadlessCombobox extends MixinControllerO
|
|
|
528
572
|
part="tag"
|
|
529
573
|
exportparts="cell: tag-cell, dismiss: tag-dismiss, dismiss-mark: tag-dismiss-mark, label: tag-label, link: tag-link, start: tag-start"
|
|
530
574
|
data-value=${option.value}
|
|
531
|
-
dismiss-label=${
|
|
575
|
+
dismiss-label=${formatWords(this, 'removeLabel', { name: option.text })}
|
|
532
576
|
?dismissible=${!this.isDisabled && !this.readOnly}
|
|
533
577
|
@helix-dismiss=${this.handleDismiss}
|
|
534
578
|
>${option.text}</${this.tag('tag')}
|
|
@@ -545,12 +589,15 @@ let HelixHeadlessCombobox = class HelixHeadlessCombobox extends MixinControllerO
|
|
|
545
589
|
if (this.creation === '') {
|
|
546
590
|
return nothing;
|
|
547
591
|
}
|
|
592
|
+
const words = this.createLabel.includes('{value}')
|
|
593
|
+
? formatWords(this, 'createLabel', { value: this.creation })
|
|
594
|
+
: html `${this.createLabel} "${this.creation}"`;
|
|
548
595
|
return this.onCreate
|
|
549
596
|
? html `<button part="create create-active" id="create" type="button" @click=${() => this.create()}>
|
|
550
|
-
${
|
|
597
|
+
${words}
|
|
551
598
|
</button>`
|
|
552
599
|
: html `<button part="create" id="create" type="button" @click=${() => this.create()}>
|
|
553
|
-
${
|
|
600
|
+
${words}
|
|
554
601
|
</button>`;
|
|
555
602
|
}
|
|
556
603
|
render() {
|
|
@@ -565,7 +612,7 @@ let HelixHeadlessCombobox = class HelixHeadlessCombobox extends MixinControllerO
|
|
|
565
612
|
id=${this.controlId}
|
|
566
613
|
type="text"
|
|
567
614
|
role="combobox"
|
|
568
|
-
autocomplete=${this.autocomplete || nothing}
|
|
615
|
+
autocomplete=${(this.fills ? 'off' : this.autocomplete) || nothing}
|
|
569
616
|
spellcheck="false"
|
|
570
617
|
aria-controls="listbox"
|
|
571
618
|
aria-autocomplete=${this.suggest ? 'both' : 'list'}
|
|
@@ -588,7 +635,18 @@ let HelixHeadlessCombobox = class HelixHeadlessCombobox extends MixinControllerO
|
|
|
588
635
|
${this.renderListbox()}
|
|
589
636
|
${this.renderCreate()}
|
|
590
637
|
</div>
|
|
591
|
-
${this.renderHint()}${this.renderFeedback()}
|
|
638
|
+
${this.renderHint()}${this.renderFeedback()}${drawStatus(this.status)}
|
|
639
|
+
${drawAutofill({
|
|
640
|
+
autocomplete: this.fills ? this.autocomplete : '',
|
|
641
|
+
disabled: this.isDisabled || this.readOnly,
|
|
642
|
+
multiple: this.multiple,
|
|
643
|
+
onFill: (value) => this.requestValue(value),
|
|
644
|
+
options: optionsAmong(this.knownChildren),
|
|
645
|
+
value: this.value,
|
|
646
|
+
})}`;
|
|
647
|
+
}
|
|
648
|
+
get fills() {
|
|
649
|
+
return !this.allowsCustomValue && this.autocomplete !== 'off' && this.autocomplete !== '';
|
|
592
650
|
}
|
|
593
651
|
};
|
|
594
652
|
__decorate([
|
|
@@ -601,15 +659,18 @@ __decorate([
|
|
|
601
659
|
property({ type: Boolean })
|
|
602
660
|
], HelixHeadlessCombobox.prototype, "creatable", void 0);
|
|
603
661
|
__decorate([
|
|
662
|
+
words,
|
|
604
663
|
property({ attribute: 'create-label' })
|
|
605
664
|
], HelixHeadlessCombobox.prototype, "createLabel", void 0);
|
|
606
665
|
__decorate([
|
|
666
|
+
words,
|
|
607
667
|
property({ attribute: 'empty-text' })
|
|
608
668
|
], HelixHeadlessCombobox.prototype, "emptyText", void 0);
|
|
609
669
|
__decorate([
|
|
610
670
|
property({ attribute: 'filter-delay', type: Number })
|
|
611
671
|
], HelixHeadlessCombobox.prototype, "filterDelay", void 0);
|
|
612
672
|
__decorate([
|
|
673
|
+
words,
|
|
613
674
|
property({ attribute: 'list-label' })
|
|
614
675
|
], HelixHeadlessCombobox.prototype, "listLabel", void 0);
|
|
615
676
|
__decorate([
|
|
@@ -619,8 +680,12 @@ __decorate([
|
|
|
619
680
|
property({ reflect: true, type: Boolean })
|
|
620
681
|
], HelixHeadlessCombobox.prototype, "loading", void 0);
|
|
621
682
|
__decorate([
|
|
683
|
+
words,
|
|
622
684
|
property({ attribute: 'loading-text' })
|
|
623
685
|
], HelixHeadlessCombobox.prototype, "loadingText", void 0);
|
|
686
|
+
__decorate([
|
|
687
|
+
property()
|
|
688
|
+
], HelixHeadlessCombobox.prototype, "locale", void 0);
|
|
624
689
|
__decorate([
|
|
625
690
|
property({ type: Boolean })
|
|
626
691
|
], HelixHeadlessCombobox.prototype, "multiple", void 0);
|
|
@@ -637,17 +702,27 @@ __decorate([
|
|
|
637
702
|
property({ attribute: 'readonly', reflect: true, type: Boolean })
|
|
638
703
|
], HelixHeadlessCombobox.prototype, "readOnly", void 0);
|
|
639
704
|
__decorate([
|
|
705
|
+
words,
|
|
640
706
|
property({ attribute: 'remove-label' })
|
|
641
707
|
], HelixHeadlessCombobox.prototype, "removeLabel", void 0);
|
|
642
708
|
__decorate([
|
|
643
709
|
property({ attribute: 'result-label' })
|
|
644
710
|
], HelixHeadlessCombobox.prototype, "resultLabel", void 0);
|
|
645
711
|
__decorate([
|
|
712
|
+
words,
|
|
646
713
|
property({ attribute: 'results-label' })
|
|
647
714
|
], HelixHeadlessCombobox.prototype, "resultsLabel", void 0);
|
|
715
|
+
__decorate([
|
|
716
|
+
words,
|
|
717
|
+
property({ attribute: 'selected-label' })
|
|
718
|
+
], HelixHeadlessCombobox.prototype, "selectedLabel", void 0);
|
|
648
719
|
__decorate([
|
|
649
720
|
property({ type: Boolean })
|
|
650
721
|
], HelixHeadlessCombobox.prototype, "suggest", void 0);
|
|
722
|
+
__decorate([
|
|
723
|
+
words,
|
|
724
|
+
property({ attribute: 'value-missing-message' })
|
|
725
|
+
], HelixHeadlessCombobox.prototype, "valueMissingMessage", void 0);
|
|
651
726
|
__decorate([
|
|
652
727
|
state()
|
|
653
728
|
], HelixHeadlessCombobox.prototype, "typed", void 0);
|
|
@@ -70,6 +70,11 @@ declare const HelixHeadlessCommand_base: (new (...args: any[]) => import("@fusio
|
|
|
70
70
|
* @cssstate open - While the palette is open.
|
|
71
71
|
*/
|
|
72
72
|
export declare class HelixHeadlessCommand extends HelixHeadlessCommand_base {
|
|
73
|
+
/**
|
|
74
|
+
* The key this family's words are registered under, its styled tag:
|
|
75
|
+
* `registerWords('de', { 'helix-command': { placeholder: 'Befehle suchen' } })`.
|
|
76
|
+
*/
|
|
77
|
+
static words: string;
|
|
73
78
|
/**
|
|
74
79
|
* The text shown when the filter matches no commands.
|
|
75
80
|
*/
|
|
@@ -96,10 +101,11 @@ export declare class HelixHeadlessCommand extends HelixHeadlessCommand_base {
|
|
|
96
101
|
label: string;
|
|
97
102
|
/**
|
|
98
103
|
* What the list says when its commands could not be loaded, such as after a
|
|
99
|
-
* request to a server fails. Empty
|
|
100
|
-
*
|
|
104
|
+
* request to a server fails. Empty, null or no attribute is no error, so
|
|
105
|
+
* removing the attribute clears it. Passed to the list, which shows it
|
|
106
|
+
* under any commands there are and tells screen readers.
|
|
101
107
|
*/
|
|
102
|
-
loadError: string;
|
|
108
|
+
loadError: string | null;
|
|
103
109
|
/**
|
|
104
110
|
* Whether the commands are still loading, for a palette that asks a server
|
|
105
111
|
* for them as the user types.
|
|
@@ -121,14 +127,18 @@ export declare class HelixHeadlessCommand extends HelixHeadlessCommand_base {
|
|
|
121
127
|
*/
|
|
122
128
|
placeholder: string;
|
|
123
129
|
/**
|
|
124
|
-
* What a screen reader hears when typing leaves one command
|
|
125
|
-
* the count.
|
|
130
|
+
* What a screen reader hears when typing leaves one command, where
|
|
131
|
+
* `results-label` should not say it. `{count}` is the count.
|
|
132
|
+
*
|
|
133
|
+
* @deprecated Write every form in `results-label`, as `{count, plural, one
|
|
134
|
+
* {# command} other {# commands}}`. Removed in the next major version.
|
|
126
135
|
*/
|
|
127
|
-
resultLabel
|
|
136
|
+
resultLabel?: string;
|
|
128
137
|
/**
|
|
129
|
-
* What a screen reader hears when typing
|
|
130
|
-
*
|
|
131
|
-
*
|
|
138
|
+
* What a screen reader hears when typing narrows the commands. `{count}` is
|
|
139
|
+
* how many are left, written in the locale, and each language writes the
|
|
140
|
+
* forms it has: `{count, plural, one {# polecenie} few {# polecenia} many
|
|
141
|
+
* {# poleceń} other {# polecenia}}`.
|
|
132
142
|
*/
|
|
133
143
|
resultsLabel: string;
|
|
134
144
|
/**
|
|
@@ -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, HelixElement, HelixSelectEvent, MixinControllerOpen, matchesChord, } from '@fusion.dev/helix-core';
|
|
7
|
+
import { customElement, HelixElement, HelixSelectEvent, MixinControllerOpen, matchesChord, words, } from '@fusion.dev/helix-core';
|
|
8
8
|
import { nothing } from 'lit';
|
|
9
9
|
import { property, state } from 'lit/decorators.js';
|
|
10
10
|
import { html } from 'lit/static-html.js';
|
|
@@ -21,8 +21,7 @@ let HelixHeadlessCommand = class HelixHeadlessCommand extends MixinControllerOpe
|
|
|
21
21
|
this.loading = false;
|
|
22
22
|
this.loadingText = 'Loading';
|
|
23
23
|
this.placeholder = 'Search commands';
|
|
24
|
-
this.
|
|
25
|
-
this.resultsLabel = '{count} commands';
|
|
24
|
+
this.resultsLabel = '{count, plural, one {# command} other {# commands}}';
|
|
26
25
|
this.footed = false;
|
|
27
26
|
this.handleHotkey = (event) => {
|
|
28
27
|
if (!matchesChord(event, this.hotkey, true) && !matchesChord(event, this.hotkey, false)) {
|
|
@@ -76,6 +75,7 @@ let HelixHeadlessCommand = class HelixHeadlessCommand extends MixinControllerOpe
|
|
|
76
75
|
this.requestOpen(false);
|
|
77
76
|
};
|
|
78
77
|
}
|
|
78
|
+
static { this.words = 'helix-command'; }
|
|
79
79
|
get listbox() {
|
|
80
80
|
return this.partNamed('listbox');
|
|
81
81
|
}
|
|
@@ -146,7 +146,7 @@ let HelixHeadlessCommand = class HelixHeadlessCommand extends MixinControllerOpe
|
|
|
146
146
|
load-error=${this.loadError}
|
|
147
147
|
loading-text=${this.loadingText}
|
|
148
148
|
no-results-text=${this.noResultsText ?? nothing}
|
|
149
|
-
result-label=${this.resultLabel}
|
|
149
|
+
result-label=${this.resultLabel ?? ''}
|
|
150
150
|
results-label=${this.resultsLabel}
|
|
151
151
|
?loading=${this.loading}
|
|
152
152
|
filterable
|
|
@@ -183,6 +183,7 @@ let HelixHeadlessCommand = class HelixHeadlessCommand extends MixinControllerOpe
|
|
|
183
183
|
}
|
|
184
184
|
};
|
|
185
185
|
__decorate([
|
|
186
|
+
words,
|
|
186
187
|
property({ attribute: 'empty-text' })
|
|
187
188
|
], HelixHeadlessCommand.prototype, "emptyText", void 0);
|
|
188
189
|
__decorate([
|
|
@@ -192,6 +193,7 @@ __decorate([
|
|
|
192
193
|
property()
|
|
193
194
|
], HelixHeadlessCommand.prototype, "hotkey", void 0);
|
|
194
195
|
__decorate([
|
|
196
|
+
words,
|
|
195
197
|
property()
|
|
196
198
|
], HelixHeadlessCommand.prototype, "label", void 0);
|
|
197
199
|
__decorate([
|
|
@@ -201,18 +203,21 @@ __decorate([
|
|
|
201
203
|
property({ reflect: true, type: Boolean })
|
|
202
204
|
], HelixHeadlessCommand.prototype, "loading", void 0);
|
|
203
205
|
__decorate([
|
|
206
|
+
words,
|
|
204
207
|
property({ attribute: 'loading-text' })
|
|
205
208
|
], HelixHeadlessCommand.prototype, "loadingText", void 0);
|
|
206
209
|
__decorate([
|
|
207
210
|
property({ attribute: 'no-results-text' })
|
|
208
211
|
], HelixHeadlessCommand.prototype, "noResultsText", void 0);
|
|
209
212
|
__decorate([
|
|
213
|
+
words,
|
|
210
214
|
property()
|
|
211
215
|
], HelixHeadlessCommand.prototype, "placeholder", void 0);
|
|
212
216
|
__decorate([
|
|
213
217
|
property({ attribute: 'result-label' })
|
|
214
218
|
], HelixHeadlessCommand.prototype, "resultLabel", void 0);
|
|
215
219
|
__decorate([
|
|
220
|
+
words,
|
|
216
221
|
property({ attribute: 'results-label' })
|
|
217
222
|
], HelixHeadlessCommand.prototype, "resultsLabel", void 0);
|
|
218
223
|
__decorate([
|
|
@@ -68,6 +68,11 @@ import '../../tooltip/index.js';
|
|
|
68
68
|
* @withheld slot start - Button's, which this does not render.
|
|
69
69
|
*/
|
|
70
70
|
export declare class HelixHeadlessCopyButton extends HelixHeadlessIconButton {
|
|
71
|
+
/**
|
|
72
|
+
* The key this family's words are registered under, its styled tag:
|
|
73
|
+
* `registerWords('de', { 'helix-copy-button': { copiedLabel: 'Kopiert' } })`.
|
|
74
|
+
*/
|
|
75
|
+
static words: string;
|
|
71
76
|
/**
|
|
72
77
|
* The button's name and tooltip text after a copy.
|
|
73
78
|
*
|
|
@@ -5,7 +5,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
7
|
var HelixHeadlessCopyButton_1;
|
|
8
|
-
import { CopyController, customElement, HelixCopyErrorEvent } from '@fusion.dev/helix-core';
|
|
8
|
+
import { CopyController, customElement, HelixCopyErrorEvent, words } from '@fusion.dev/helix-core';
|
|
9
9
|
import { check, copy, x } from '@fusion.dev/helix-icons';
|
|
10
10
|
import { nothing } from 'lit';
|
|
11
11
|
import { property } from 'lit/decorators.js';
|
|
@@ -14,7 +14,7 @@ import { html } from 'lit/static-html.js';
|
|
|
14
14
|
import { HelixHeadlessIconButton } from '../../icon-button/root/icon-button-root.js';
|
|
15
15
|
import { readFrom } from '../from.js';
|
|
16
16
|
import '../../tooltip/index.js';
|
|
17
|
-
let HelixHeadlessCopyButton =
|
|
17
|
+
let HelixHeadlessCopyButton = class HelixHeadlessCopyButton extends HelixHeadlessIconButton {
|
|
18
18
|
constructor() {
|
|
19
19
|
super(...arguments);
|
|
20
20
|
this.copiedLabel = 'Copied';
|
|
@@ -42,6 +42,8 @@ let HelixHeadlessCopyButton = HelixHeadlessCopyButton_1 = class HelixHeadlessCop
|
|
|
42
42
|
}
|
|
43
43
|
};
|
|
44
44
|
}
|
|
45
|
+
static { HelixHeadlessCopyButton_1 = this; }
|
|
46
|
+
static { this.words = 'helix-copy-button'; }
|
|
45
47
|
get says() {
|
|
46
48
|
if (this.failed) {
|
|
47
49
|
return this.errorLabel;
|
|
@@ -117,9 +119,11 @@ let HelixHeadlessCopyButton = HelixHeadlessCopyButton_1 = class HelixHeadlessCop
|
|
|
117
119
|
}
|
|
118
120
|
};
|
|
119
121
|
__decorate([
|
|
122
|
+
words,
|
|
120
123
|
property({ attribute: 'copied-label' })
|
|
121
124
|
], HelixHeadlessCopyButton.prototype, "copiedLabel", void 0);
|
|
122
125
|
__decorate([
|
|
126
|
+
words,
|
|
123
127
|
property({ attribute: 'error-label' })
|
|
124
128
|
], HelixHeadlessCopyButton.prototype, "errorLabel", void 0);
|
|
125
129
|
__decorate([
|
|
@@ -129,6 +133,7 @@ __decorate([
|
|
|
129
133
|
property()
|
|
130
134
|
], HelixHeadlessCopyButton.prototype, "from", void 0);
|
|
131
135
|
__decorate([
|
|
136
|
+
words,
|
|
132
137
|
property()
|
|
133
138
|
], HelixHeadlessCopyButton.prototype, "label", void 0);
|
|
134
139
|
__decorate([
|