@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,59 +4,15 @@ 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, countLabel, customElement, DelayController, DisabledCascadeController, endInSight, HelixFilterEvent, HelixFormElement, HelixLoadMoreEvent, hostAria, MixinCollection, MixinControllerValue, MixinField, rangeAdd, reportValues, requestChange, scrollItemIntoView, selectsAll, Typeahead, typesCharacter, } from '@fusion.dev/helix-core';
|
|
7
|
+
import { AriaForwardController, centerInView, columnStep, countLabel, customElement, DelayController, DisabledCascadeController, drawAutofill, endInSight, formatWords, HelixFilterEvent, HelixFormElement, HelixLoadMoreEvent, hostAria, inlineStep, MixinCollection, MixinControllerValue, MixinField, markMatches, OptionWindowController, onApple, pageRows, rangeAdd, reportValues, requestChange, scrollItemIntoView, selectsAll, Typeahead, toggleEvery, typesCharacter, words, wordsLocale, } from '@fusion.dev/helix-core';
|
|
8
8
|
import { magnifyingGlass } 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 { HelixHeadlessOptionGroup } from '../../option/group/option-group.js';
|
|
13
12
|
import { HelixHeadlessOption } from '../../option/root/option-root.js';
|
|
14
|
-
const MOVES = new Set(['ArrowDown', 'ArrowUp', 'End', 'Home', 'PageDown', 'PageUp']);
|
|
15
13
|
const FIELD_MOVES = new Set(['ArrowDown', 'ArrowUp', 'PageDown', 'PageUp']);
|
|
14
|
+
const MOVES = new Set([...FIELD_MOVES, 'End', 'Home']);
|
|
16
15
|
const PAGE = 10;
|
|
17
|
-
const matched = new Map();
|
|
18
|
-
const HIGHLIGHT = 'helix-filter-match';
|
|
19
|
-
const paintable = () => typeof CSS !== 'undefined' && 'highlights' in CSS && typeof Highlight !== 'undefined';
|
|
20
|
-
const paintMatches = () => {
|
|
21
|
-
if (!paintable()) {
|
|
22
|
-
return;
|
|
23
|
-
}
|
|
24
|
-
const all = [...matched.values()].flat();
|
|
25
|
-
if (all.length === 0) {
|
|
26
|
-
CSS.highlights.delete(HIGHLIGHT);
|
|
27
|
-
return;
|
|
28
|
-
}
|
|
29
|
-
CSS.highlights.set(HIGHLIGHT, new Highlight(...all));
|
|
30
|
-
};
|
|
31
|
-
const rangeFor = (root, needle) => {
|
|
32
|
-
const walker = document.createTreeWalker(root, NodeFilter.SHOW_TEXT);
|
|
33
|
-
const nodes = [];
|
|
34
|
-
let whole = '';
|
|
35
|
-
for (let node = walker.nextNode(); node !== null; node = walker.nextNode()) {
|
|
36
|
-
nodes.push(node);
|
|
37
|
-
whole += node.nodeValue ?? '';
|
|
38
|
-
}
|
|
39
|
-
const at = whole.toLowerCase().indexOf(needle);
|
|
40
|
-
if (at < 0) {
|
|
41
|
-
return [];
|
|
42
|
-
}
|
|
43
|
-
const range = document.createRange();
|
|
44
|
-
let seen = 0;
|
|
45
|
-
let started = false;
|
|
46
|
-
for (const node of nodes) {
|
|
47
|
-
const length = node.nodeValue?.length ?? 0;
|
|
48
|
-
if (!started && at < seen + length) {
|
|
49
|
-
range.setStart(node, at - seen);
|
|
50
|
-
started = true;
|
|
51
|
-
}
|
|
52
|
-
if (started && at + needle.length <= seen + length) {
|
|
53
|
-
range.setEnd(node, at + needle.length - seen);
|
|
54
|
-
return [range];
|
|
55
|
-
}
|
|
56
|
-
seen += length;
|
|
57
|
-
}
|
|
58
|
-
return [];
|
|
59
|
-
};
|
|
60
16
|
let HelixHeadlessListbox = class HelixHeadlessListbox extends MixinCollection(MixinControllerValue(MixinField(HelixFormElement))) {
|
|
61
17
|
constructor() {
|
|
62
18
|
super(...arguments);
|
|
@@ -70,13 +26,22 @@ let HelixHeadlessListbox = class HelixHeadlessListbox extends MixinCollection(Mi
|
|
|
70
26
|
this.filterable = false;
|
|
71
27
|
this.filterDelay = 0;
|
|
72
28
|
this.filterLabel = 'Filter';
|
|
29
|
+
this.items = undefined;
|
|
30
|
+
this.data = new OptionWindowController(this, {
|
|
31
|
+
current: () => this.currentValue,
|
|
32
|
+
items: () => this.items,
|
|
33
|
+
});
|
|
73
34
|
this.loadError = '';
|
|
74
35
|
this.manual = false;
|
|
75
36
|
this.multiple = false;
|
|
76
|
-
this.
|
|
77
|
-
this.resultsLabel = '{count} results';
|
|
37
|
+
this.reorderable = false;
|
|
38
|
+
this.resultsLabel = '{count, plural, one {# result} other {# results}}';
|
|
39
|
+
this.selectedLabel = '{name}, selected';
|
|
40
|
+
this.valueMissingMessage = 'Choose one to continue.';
|
|
78
41
|
this.activeValue = '';
|
|
79
42
|
this.parked = false;
|
|
43
|
+
this.anchor = '';
|
|
44
|
+
this.shifted = false;
|
|
80
45
|
this.typeahead = new Typeahead();
|
|
81
46
|
this.seen = new Set();
|
|
82
47
|
this.forwarded = false;
|
|
@@ -85,6 +50,7 @@ let HelixHeadlessListbox = class HelixHeadlessListbox extends MixinCollection(Mi
|
|
|
85
50
|
this.cascade = new DisabledCascadeController(this, {
|
|
86
51
|
items: () => this.options,
|
|
87
52
|
});
|
|
53
|
+
this.chosenAgain = undefined;
|
|
88
54
|
this.handleSelection = (event) => {
|
|
89
55
|
if (event.detail.href !== undefined) {
|
|
90
56
|
return;
|
|
@@ -93,8 +59,18 @@ let HelixHeadlessListbox = class HelixHeadlessListbox extends MixinCollection(Mi
|
|
|
93
59
|
if (event.defaultPrevented) {
|
|
94
60
|
return;
|
|
95
61
|
}
|
|
96
|
-
|
|
97
|
-
this.
|
|
62
|
+
const { value } = event.detail;
|
|
63
|
+
this.activeValue = value;
|
|
64
|
+
if (this.multiple && this.shifted) {
|
|
65
|
+
this.extend(value);
|
|
66
|
+
}
|
|
67
|
+
else {
|
|
68
|
+
this.choose(value);
|
|
69
|
+
}
|
|
70
|
+
this.shifted = false;
|
|
71
|
+
};
|
|
72
|
+
this.handleClick = (event) => {
|
|
73
|
+
this.shifted = event.shiftKey;
|
|
98
74
|
};
|
|
99
75
|
this.handleKeydown = (event) => {
|
|
100
76
|
const shown = this.shown.filter((option) => !option.disabled);
|
|
@@ -102,11 +78,17 @@ let HelixHeadlessListbox = class HelixHeadlessListbox extends MixinCollection(Mi
|
|
|
102
78
|
return;
|
|
103
79
|
}
|
|
104
80
|
const typing = this.forwarded || event.composedPath()[0] === this.partNamed('search-field');
|
|
81
|
+
if (this.multiple && event.key === ' ' && event.shiftKey && !typing) {
|
|
82
|
+
event.preventDefault();
|
|
83
|
+
this.extend(this.activeValue);
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
105
86
|
if (event.key === 'Enter' || (event.key === ' ' && !typing && !this.typeahead.typing())) {
|
|
106
87
|
const link = shown.find((option) => option.value === this.activeValue && Boolean(option.href));
|
|
107
88
|
if (link !== undefined) {
|
|
108
89
|
event.preventDefault();
|
|
109
90
|
if (event.key === 'Enter') {
|
|
91
|
+
;
|
|
110
92
|
link.select(event);
|
|
111
93
|
}
|
|
112
94
|
}
|
|
@@ -121,10 +103,7 @@ let HelixHeadlessListbox = class HelixHeadlessListbox extends MixinCollection(Mi
|
|
|
121
103
|
}
|
|
122
104
|
if (this.multiple && !typing && selectsAll(event)) {
|
|
123
105
|
event.preventDefault();
|
|
124
|
-
|
|
125
|
-
const all = reachable.every((value) => this.values.includes(value));
|
|
126
|
-
const kept = this.values.filter((value) => !reachable.includes(value));
|
|
127
|
-
this.requestValue((all ? kept : [...kept, ...reachable]).join(','));
|
|
106
|
+
this.requestValue(toggleEvery(this.values, shown.map((option) => option.value)).join(','));
|
|
128
107
|
return;
|
|
129
108
|
}
|
|
130
109
|
if (!typing && typesCharacter(event)) {
|
|
@@ -140,7 +119,9 @@ let HelixHeadlessListbox = class HelixHeadlessListbox extends MixinCollection(Mi
|
|
|
140
119
|
event.shiftKey &&
|
|
141
120
|
(event.ctrlKey || event.metaKey) &&
|
|
142
121
|
(event.key === 'Home' || event.key === 'End');
|
|
143
|
-
|
|
122
|
+
const grid = this.layout === 'grid' && !this.data.records;
|
|
123
|
+
const along = grid && !typing ? inlineStep(this, event.key) : 0;
|
|
124
|
+
if (!fieldRange && !along && !(typing ? FIELD_MOVES : MOVES).has(event.key)) {
|
|
144
125
|
return;
|
|
145
126
|
}
|
|
146
127
|
event.preventDefault();
|
|
@@ -149,7 +130,13 @@ let HelixHeadlessListbox = class HelixHeadlessListbox extends MixinCollection(Mi
|
|
|
149
130
|
const at = shown.findIndex((option) => option.value === from);
|
|
150
131
|
const last = shown.length - 1;
|
|
151
132
|
let next = at;
|
|
152
|
-
if (
|
|
133
|
+
if (along) {
|
|
134
|
+
next = Math.min(Math.max(at + along, 0), last);
|
|
135
|
+
}
|
|
136
|
+
else if (grid && at >= 0 && (event.key === 'ArrowDown' || event.key === 'ArrowUp')) {
|
|
137
|
+
next = columnStep(shown.map((option) => option.getBoundingClientRect().left), at, event.key === 'ArrowDown' ? 1 : -1);
|
|
138
|
+
}
|
|
139
|
+
else if (event.key === 'ArrowDown') {
|
|
153
140
|
next = at < 0 ? 0 : (at + 1) % shown.length;
|
|
154
141
|
}
|
|
155
142
|
else if (event.key === 'ArrowUp') {
|
|
@@ -197,7 +184,7 @@ let HelixHeadlessListbox = class HelixHeadlessListbox extends MixinCollection(Mi
|
|
|
197
184
|
this.askedAt = -1;
|
|
198
185
|
this.handleScroll = (event) => {
|
|
199
186
|
const items = event.currentTarget;
|
|
200
|
-
const count = this.
|
|
187
|
+
const count = this.entries.length;
|
|
201
188
|
if (this.loading ||
|
|
202
189
|
!endInSight({
|
|
203
190
|
askedAt: this.askedAt,
|
|
@@ -232,6 +219,7 @@ let HelixHeadlessListbox = class HelixHeadlessListbox extends MixinCollection(Mi
|
|
|
232
219
|
this.navigate(event);
|
|
233
220
|
};
|
|
234
221
|
}
|
|
222
|
+
static { this.words = 'helix-listbox'; }
|
|
235
223
|
get filter() {
|
|
236
224
|
return this.filterState ?? this.defaultFilter;
|
|
237
225
|
}
|
|
@@ -241,43 +229,54 @@ let HelixHeadlessListbox = class HelixHeadlessListbox extends MixinCollection(Mi
|
|
|
241
229
|
this.requestUpdate('filter', previous);
|
|
242
230
|
}
|
|
243
231
|
get selectedIndex() {
|
|
244
|
-
return this.
|
|
232
|
+
return this.entries.findIndex((option) => option.selected);
|
|
245
233
|
}
|
|
246
234
|
set selectedIndex(at) {
|
|
247
|
-
const option = this.
|
|
235
|
+
const option = this.entries[at];
|
|
248
236
|
this.value = option?.value ?? '';
|
|
249
237
|
}
|
|
250
238
|
highlight(where) {
|
|
251
239
|
const shown = this.shown.filter((option) => !option.disabled);
|
|
252
240
|
this.typeahead.reset();
|
|
253
241
|
this.parked = where === 'none';
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
}
|
|
260
|
-
else if (where === 'last') {
|
|
261
|
-
this.activeValue = shown.at(-1)?.value ?? '';
|
|
262
|
-
}
|
|
263
|
-
else {
|
|
264
|
-
const chosen = shown.find((option) => this.values.includes(option.value));
|
|
265
|
-
this.activeValue = (chosen ?? shown[0])?.value ?? '';
|
|
266
|
-
}
|
|
242
|
+
const chosen = where === 'selected' ? shown.find((option) => this.values.includes(option.value)) : undefined;
|
|
243
|
+
this.activeValue =
|
|
244
|
+
where === 'none'
|
|
245
|
+
? ''
|
|
246
|
+
: ((where === 'last' ? shown.at(-1) : (chosen ?? shown[0]))?.value ?? '');
|
|
267
247
|
if (this.childrenKnown) {
|
|
268
248
|
this.place();
|
|
269
249
|
}
|
|
270
250
|
}
|
|
271
251
|
tell(changed) {
|
|
272
|
-
if (!
|
|
252
|
+
if (!this.hasUpdated) {
|
|
253
|
+
return;
|
|
254
|
+
}
|
|
255
|
+
if (!changed.has('filter')) {
|
|
256
|
+
this.tellActive(changed);
|
|
273
257
|
return;
|
|
274
258
|
}
|
|
275
259
|
const count = this.shown.length;
|
|
276
|
-
|
|
277
|
-
this.
|
|
260
|
+
this.announced =
|
|
261
|
+
this.filter.trim() && count
|
|
262
|
+
? this.resultLabel
|
|
263
|
+
? countLabel(count, this.resultLabel, this.resultsLabel, wordsLocale(this))
|
|
264
|
+
: formatWords(this, 'resultsLabel', { count })
|
|
265
|
+
: '';
|
|
266
|
+
}
|
|
267
|
+
tellActive(changed) {
|
|
268
|
+
if (!changed.has('activeValue') ||
|
|
269
|
+
!this.filterable ||
|
|
270
|
+
!onApple() ||
|
|
271
|
+
this.renderRoot.activeElement?.getAttribute('part') !== 'search-field') {
|
|
278
272
|
return;
|
|
279
273
|
}
|
|
280
|
-
|
|
274
|
+
const active = this.entries.find((option) => option.value === this.activeValue);
|
|
275
|
+
if (active) {
|
|
276
|
+
this.announced = active.selected
|
|
277
|
+
? formatWords(this, 'selectedLabel', { name: active.text })
|
|
278
|
+
: active.text;
|
|
279
|
+
}
|
|
281
280
|
}
|
|
282
281
|
typeaheadTo(key) {
|
|
283
282
|
const shown = this.shown.filter((option) => !option.disabled);
|
|
@@ -315,16 +314,25 @@ let HelixHeadlessListbox = class HelixHeadlessListbox extends MixinCollection(Mi
|
|
|
315
314
|
return found;
|
|
316
315
|
}
|
|
317
316
|
get groups() {
|
|
318
|
-
return this.among((node) => node
|
|
317
|
+
return this.among((node) => node.localName.endsWith('-option-group'), this.children);
|
|
318
|
+
}
|
|
319
|
+
get entries() {
|
|
320
|
+
return this.data.records ?? this.options;
|
|
321
|
+
}
|
|
322
|
+
get elements() {
|
|
323
|
+
return this.data.records ? this.data.drawn : this.options;
|
|
319
324
|
}
|
|
320
325
|
get shown() {
|
|
321
|
-
return this.
|
|
326
|
+
return this.entries.filter((option) => !option.hidden);
|
|
322
327
|
}
|
|
323
328
|
get values() {
|
|
324
329
|
return this.value === '' ? [] : this.value.split(',');
|
|
325
330
|
}
|
|
326
331
|
choose(value) {
|
|
327
332
|
const chosen = this.values;
|
|
333
|
+
if (!chosen.includes(value)) {
|
|
334
|
+
this.anchor = value;
|
|
335
|
+
}
|
|
328
336
|
const next = this.multiple
|
|
329
337
|
? chosen.includes(value)
|
|
330
338
|
? chosen.filter((each) => each !== value)
|
|
@@ -332,23 +340,35 @@ let HelixHeadlessListbox = class HelixHeadlessListbox extends MixinCollection(Mi
|
|
|
332
340
|
: [value];
|
|
333
341
|
const joined = next.join(',');
|
|
334
342
|
if (joined === this.value) {
|
|
343
|
+
this.chosenAgain?.();
|
|
335
344
|
return;
|
|
336
345
|
}
|
|
337
346
|
this.requestValue(joined);
|
|
338
347
|
}
|
|
348
|
+
extend(to) {
|
|
349
|
+
const reach = this.shown.filter((option) => !option.disabled).map((option) => option.value);
|
|
350
|
+
const from = reach.indexOf(this.anchor);
|
|
351
|
+
if (from < 0 && reach.includes(to)) {
|
|
352
|
+
this.anchor = to;
|
|
353
|
+
}
|
|
354
|
+
const taken = rangeAdd(this.values, reach, from, reach.indexOf(to));
|
|
355
|
+
if (taken) {
|
|
356
|
+
this.requestValue(taken.join(','));
|
|
357
|
+
}
|
|
358
|
+
}
|
|
339
359
|
arrive(value) {
|
|
340
360
|
this.parked = false;
|
|
341
361
|
this.activeValue = value;
|
|
342
|
-
const link = this.
|
|
362
|
+
const link = this.entries.some((option) => option.value === value && Boolean(option.href));
|
|
343
363
|
if (!this.multiple && !this.manual && !this.forwarded && !link) {
|
|
344
364
|
this.choose(value);
|
|
345
365
|
}
|
|
346
366
|
}
|
|
347
367
|
pageSize() {
|
|
348
368
|
const items = this.partNamed('items');
|
|
349
|
-
const row = this.
|
|
369
|
+
const row = this.elements.find((option) => !option.hidden)?.getBoundingClientRect().height ?? 0;
|
|
350
370
|
const height = items?.clientHeight ?? 0;
|
|
351
|
-
return row > 0 && height > 0 ?
|
|
371
|
+
return row > 0 && height > 0 ? pageRows(height, row) : PAGE;
|
|
352
372
|
}
|
|
353
373
|
navigate(event) {
|
|
354
374
|
this.forwarded = true;
|
|
@@ -360,29 +380,21 @@ let HelixHeadlessListbox = class HelixHeadlessListbox extends MixinCollection(Mi
|
|
|
360
380
|
}
|
|
361
381
|
}
|
|
362
382
|
reveal() {
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
if (!items || !chosen) {
|
|
383
|
+
if (this.data.records) {
|
|
384
|
+
this.data.center(this.values[0] ?? '');
|
|
366
385
|
return;
|
|
367
386
|
}
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
return;
|
|
373
|
-
}
|
|
374
|
-
const off = row.top + row.height / 2 - (box.top + box.height / 2);
|
|
375
|
-
if (Math.abs(off) < 1) {
|
|
376
|
-
return;
|
|
377
|
-
}
|
|
378
|
-
items.scrollTop += off;
|
|
387
|
+
const items = this.partNamed('items');
|
|
388
|
+
const chosen = this.options.find((option) => option.selected && !option.hidden);
|
|
389
|
+
if (items && chosen) {
|
|
390
|
+
centerInView(items, chosen);
|
|
379
391
|
}
|
|
380
392
|
}
|
|
381
393
|
place() {
|
|
382
394
|
this.forgetRemoved();
|
|
383
395
|
const needle = this.filter.trim().toLowerCase();
|
|
384
396
|
const chosen = new Set(this.values);
|
|
385
|
-
for (const option of this.
|
|
397
|
+
for (const option of this.entries) {
|
|
386
398
|
option.hidden = needle !== '' && !option.text.toLowerCase().includes(needle);
|
|
387
399
|
option.selected = chosen.has(option.value);
|
|
388
400
|
}
|
|
@@ -398,20 +410,10 @@ let HelixHeadlessListbox = class HelixHeadlessListbox extends MixinCollection(Mi
|
|
|
398
410
|
if (rescue && !shown.some((option) => option.value === this.activeValue)) {
|
|
399
411
|
this.activeValue = shown.find((option) => !option.disabled)?.value ?? '';
|
|
400
412
|
}
|
|
401
|
-
for (const option of this.
|
|
413
|
+
for (const option of this.entries) {
|
|
402
414
|
option.active = option.value === this.activeValue;
|
|
403
415
|
}
|
|
404
|
-
|
|
405
|
-
matched.delete(this);
|
|
406
|
-
}
|
|
407
|
-
else {
|
|
408
|
-
matched.set(this, shown.flatMap((option) => rangeFor(option, needle)));
|
|
409
|
-
}
|
|
410
|
-
paintMatches();
|
|
411
|
-
const anyShown = shown.length > 0;
|
|
412
|
-
if (anyShown !== this.hasMatches) {
|
|
413
|
-
this.hasMatches = anyShown;
|
|
414
|
-
}
|
|
416
|
+
this.hasMatches = shown.length > 0;
|
|
415
417
|
this.counted = true;
|
|
416
418
|
}
|
|
417
419
|
get owned() {
|
|
@@ -422,15 +424,19 @@ let HelixHeadlessListbox = class HelixHeadlessListbox extends MixinCollection(Mi
|
|
|
422
424
|
if (this.owned) {
|
|
423
425
|
return;
|
|
424
426
|
}
|
|
425
|
-
const present = new Set(this.
|
|
427
|
+
const present = new Set(this.entries.map((option) => option.value));
|
|
426
428
|
const gone = this.values.filter((value) => this.seen.has(value) && !present.has(value));
|
|
427
429
|
this.seen = present;
|
|
428
430
|
if (gone.length > 0) {
|
|
429
431
|
this.value = this.values.filter((value) => !gone.includes(value)).join(',');
|
|
430
432
|
}
|
|
431
433
|
}
|
|
432
|
-
followActive() {
|
|
433
|
-
|
|
434
|
+
followActive(changed) {
|
|
435
|
+
if (this.data.records &&
|
|
436
|
+
!this.data.follow(changed.has('activeValue') || changed.has('filter'))) {
|
|
437
|
+
return;
|
|
438
|
+
}
|
|
439
|
+
const active = this.elements.find((option) => !option.hidden && option.value === this.activeValue);
|
|
434
440
|
if (active) {
|
|
435
441
|
const items = this.partNamed('items');
|
|
436
442
|
scrollItemIntoView(active, { padding: 4, ...(items ? { scroller: items } : {}) });
|
|
@@ -443,19 +449,20 @@ let HelixHeadlessListbox = class HelixHeadlessListbox extends MixinCollection(Mi
|
|
|
443
449
|
else {
|
|
444
450
|
this.internals.setFormValue(this.value === '' ? null : this.value);
|
|
445
451
|
}
|
|
446
|
-
this.reportRequired(this.value === '',
|
|
452
|
+
this.reportRequired(this.value === '', this.valueMissingMessage, 'items');
|
|
447
453
|
}
|
|
448
454
|
connectedCallback() {
|
|
449
455
|
super.connectedCallback();
|
|
450
456
|
this.addEventListener('helix-select', this.handleSelection);
|
|
451
457
|
this.addEventListener('keydown', this.handleKeydown);
|
|
458
|
+
this.addEventListener('click', this.handleClick, true);
|
|
452
459
|
}
|
|
453
460
|
disconnectedCallback() {
|
|
454
461
|
super.disconnectedCallback();
|
|
455
462
|
this.removeEventListener('helix-select', this.handleSelection);
|
|
456
463
|
this.removeEventListener('keydown', this.handleKeydown);
|
|
457
|
-
|
|
458
|
-
|
|
464
|
+
this.removeEventListener('click', this.handleClick, true);
|
|
465
|
+
markMatches(this, [], '');
|
|
459
466
|
}
|
|
460
467
|
willUpdate(changed) {
|
|
461
468
|
super.willUpdate(changed);
|
|
@@ -476,7 +483,7 @@ let HelixHeadlessListbox = class HelixHeadlessListbox extends MixinCollection(Mi
|
|
|
476
483
|
}
|
|
477
484
|
this.toggleState('empty', !this.showsOptions);
|
|
478
485
|
this.toggleState('loading', this.loading);
|
|
479
|
-
this.toggleState('error', this.
|
|
486
|
+
this.toggleState('error', this.failed);
|
|
480
487
|
this.toggleState('no-results', this.noResults);
|
|
481
488
|
}
|
|
482
489
|
seedDeclared() {
|
|
@@ -498,14 +505,15 @@ let HelixHeadlessListbox = class HelixHeadlessListbox extends MixinCollection(Mi
|
|
|
498
505
|
if (!list || !('ariaActiveDescendantElement' in list)) {
|
|
499
506
|
return;
|
|
500
507
|
}
|
|
501
|
-
const active = this.
|
|
508
|
+
const active = this.elements.find((option) => option.value === this.currentValue);
|
|
502
509
|
list.ariaActiveDescendantElement = active ?? null;
|
|
503
510
|
}
|
|
504
511
|
updated(changed) {
|
|
505
512
|
super.updated(changed);
|
|
506
|
-
this.followActive();
|
|
513
|
+
this.followActive(changed);
|
|
507
514
|
this.sync();
|
|
508
515
|
this.linkActive();
|
|
516
|
+
markMatches(this, this.elements.filter((option) => !option.hidden), this.filter.trim());
|
|
509
517
|
}
|
|
510
518
|
takeFilter(control) {
|
|
511
519
|
this.filtering.cancel();
|
|
@@ -547,12 +555,12 @@ let HelixHeadlessListbox = class HelixHeadlessListbox extends MixinCollection(Mi
|
|
|
547
555
|
get showsOptions() {
|
|
548
556
|
return this.counted && !this.loading
|
|
549
557
|
? this.filter === ''
|
|
550
|
-
? this.
|
|
558
|
+
? this.entries.length > 0
|
|
551
559
|
: this.hasMatches
|
|
552
560
|
: true;
|
|
553
561
|
}
|
|
554
562
|
renderStatus(hasContent) {
|
|
555
|
-
if (this.
|
|
563
|
+
if (this.failed) {
|
|
556
564
|
return html `<p part="error"><slot name="error">${this.loadError}</slot></p>`;
|
|
557
565
|
}
|
|
558
566
|
if (!this.loading && hasContent) {
|
|
@@ -571,17 +579,17 @@ let HelixHeadlessListbox = class HelixHeadlessListbox extends MixinCollection(Mi
|
|
|
571
579
|
return (this.counted &&
|
|
572
580
|
!this.loading &&
|
|
573
581
|
this.filter !== '' &&
|
|
574
|
-
this.
|
|
582
|
+
this.entries.length > 0 &&
|
|
575
583
|
!this.hasMatches);
|
|
576
584
|
}
|
|
585
|
+
get failed() {
|
|
586
|
+
return Boolean(this.loadError);
|
|
587
|
+
}
|
|
577
588
|
renderLive(hasContent) {
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
return html `<span part="live" role="status">${this.noResultsText}</span>`;
|
|
583
|
-
}
|
|
584
|
-
return super.renderLive(hasContent);
|
|
589
|
+
const words = this.loadError || (this.noResults ? this.noResultsText : undefined);
|
|
590
|
+
return words === undefined
|
|
591
|
+
? super.renderLive(hasContent)
|
|
592
|
+
: html `<span part="live" role="status">${words}</span>`;
|
|
585
593
|
}
|
|
586
594
|
render() {
|
|
587
595
|
const shown = this.showsOptions;
|
|
@@ -594,7 +602,7 @@ let HelixHeadlessListbox = class HelixHeadlessListbox extends MixinCollection(Mi
|
|
|
594
602
|
<input
|
|
595
603
|
part="search-field"
|
|
596
604
|
type="text"
|
|
597
|
-
autocomplete
|
|
605
|
+
autocomplete="off"
|
|
598
606
|
spellcheck="false"
|
|
599
607
|
.value=${this.filter}
|
|
600
608
|
placeholder=${this.filterLabel}
|
|
@@ -617,14 +625,22 @@ let HelixHeadlessListbox = class HelixHeadlessListbox extends MixinCollection(Mi
|
|
|
617
625
|
aria-labelledby=${this.labeled ? this.labelId : nothing}
|
|
618
626
|
aria-multiselectable=${this.multiple ? 'true' : nothing}
|
|
619
627
|
aria-required=${this.required ? 'true' : nothing}
|
|
620
|
-
${''}
|
|
621
628
|
tabindex=${this.filterable ? nothing : this.isDisabled ? -1 : 0}
|
|
622
629
|
@scroll=${this.handleScroll}
|
|
623
630
|
>
|
|
624
|
-
|
|
631
|
+
${this.data.render() ?? html `<slot @slotchange=${() => this.requestUpdate()}></slot>`}
|
|
625
632
|
${this.renderStatus(shown)}
|
|
626
633
|
</div>
|
|
627
|
-
${this.renderLive(shown)}${this.renderHint()}${this.renderFeedback()}
|
|
634
|
+
${this.renderLive(shown)}${this.renderHint()}${this.renderFeedback()}${this.autocomplete === 'off'
|
|
635
|
+
? nothing
|
|
636
|
+
: drawAutofill({
|
|
637
|
+
autocomplete: this.autocomplete,
|
|
638
|
+
disabled: this.isDisabled,
|
|
639
|
+
multiple: this.multiple,
|
|
640
|
+
onFill: (value) => this.requestValue(value),
|
|
641
|
+
options: this.childrenKnown ? this.entries : [],
|
|
642
|
+
value: this.value,
|
|
643
|
+
})}`;
|
|
628
644
|
}
|
|
629
645
|
};
|
|
630
646
|
__decorate([
|
|
@@ -634,6 +650,7 @@ __decorate([
|
|
|
634
650
|
property({ attribute: 'default-filter' })
|
|
635
651
|
], HelixHeadlessListbox.prototype, "defaultFilter", void 0);
|
|
636
652
|
__decorate([
|
|
653
|
+
words,
|
|
637
654
|
property({ attribute: 'empty-text' })
|
|
638
655
|
], HelixHeadlessListbox.prototype, "emptyText", void 0);
|
|
639
656
|
__decorate([
|
|
@@ -646,8 +663,15 @@ __decorate([
|
|
|
646
663
|
property({ attribute: 'filter-delay', type: Number })
|
|
647
664
|
], HelixHeadlessListbox.prototype, "filterDelay", void 0);
|
|
648
665
|
__decorate([
|
|
666
|
+
words,
|
|
649
667
|
property({ attribute: 'filter-label' })
|
|
650
668
|
], HelixHeadlessListbox.prototype, "filterLabel", void 0);
|
|
669
|
+
__decorate([
|
|
670
|
+
property({ attribute: false })
|
|
671
|
+
], HelixHeadlessListbox.prototype, "items", void 0);
|
|
672
|
+
__decorate([
|
|
673
|
+
property({ reflect: true })
|
|
674
|
+
], HelixHeadlessListbox.prototype, "layout", void 0);
|
|
651
675
|
__decorate([
|
|
652
676
|
property({ attribute: 'load-error' })
|
|
653
677
|
], HelixHeadlessListbox.prototype, "loadError", void 0);
|
|
@@ -660,21 +684,27 @@ __decorate([
|
|
|
660
684
|
__decorate([
|
|
661
685
|
property({ attribute: 'no-results-text' })
|
|
662
686
|
], HelixHeadlessListbox.prototype, "noResultsText", void 0);
|
|
687
|
+
__decorate([
|
|
688
|
+
property({ type: Boolean })
|
|
689
|
+
], HelixHeadlessListbox.prototype, "reorderable", void 0);
|
|
663
690
|
__decorate([
|
|
664
691
|
property({ attribute: 'result-label' })
|
|
665
692
|
], HelixHeadlessListbox.prototype, "resultLabel", void 0);
|
|
666
693
|
__decorate([
|
|
694
|
+
words,
|
|
667
695
|
property({ attribute: 'results-label' })
|
|
668
696
|
], HelixHeadlessListbox.prototype, "resultsLabel", void 0);
|
|
669
697
|
__decorate([
|
|
670
|
-
|
|
671
|
-
|
|
698
|
+
words,
|
|
699
|
+
property({ attribute: 'selected-label' })
|
|
700
|
+
], HelixHeadlessListbox.prototype, "selectedLabel", void 0);
|
|
672
701
|
__decorate([
|
|
673
|
-
|
|
674
|
-
|
|
702
|
+
words,
|
|
703
|
+
property({ attribute: 'value-missing-message' })
|
|
704
|
+
], HelixHeadlessListbox.prototype, "valueMissingMessage", void 0);
|
|
675
705
|
__decorate([
|
|
676
706
|
state()
|
|
677
|
-
], HelixHeadlessListbox.prototype, "
|
|
707
|
+
], HelixHeadlessListbox.prototype, "activeValue", void 0);
|
|
678
708
|
HelixHeadlessListbox = __decorate([
|
|
679
709
|
customElement('helix-headless-listbox')
|
|
680
710
|
], HelixHeadlessListbox);
|
|
@@ -45,6 +45,11 @@ import { type PropertyValues, type TemplateResult } from 'lit';
|
|
|
45
45
|
* @cssstate waiting - The loader is waiting out its `delay`, hidden and silent.
|
|
46
46
|
*/
|
|
47
47
|
export declare class HelixHeadlessLoader extends HelixElement {
|
|
48
|
+
/**
|
|
49
|
+
* The key this family's words are registered under, its styled tag:
|
|
50
|
+
* `registerWords('de', { 'helix-loader': { label: 'Wird geladen' } })`.
|
|
51
|
+
*/
|
|
52
|
+
static words: string;
|
|
48
53
|
/**
|
|
49
54
|
* How long the loader waits before it shows, in milliseconds, so work that
|
|
50
55
|
* finishes quickly never flashes one.
|
|
@@ -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, DelayController, elementById, HelixElement, hostAria, reportRuntime, } from '@fusion.dev/helix-core';
|
|
7
|
+
import { customElement, DelayController, elementById, HelixElement, hostAria, reportRuntime, words, } from '@fusion.dev/helix-core';
|
|
8
8
|
import { html } from 'lit';
|
|
9
9
|
import { property } from 'lit/decorators.js';
|
|
10
10
|
import { awaitRegion, claimBusy, releaseBusy } from '../busy.js';
|
|
@@ -18,6 +18,7 @@ let HelixHeadlessLoader = class HelixHeadlessLoader extends HelixElement {
|
|
|
18
18
|
this.region = null;
|
|
19
19
|
this.found = false;
|
|
20
20
|
}
|
|
21
|
+
static { this.words = 'helix-loader'; }
|
|
21
22
|
get waiting() {
|
|
22
23
|
return this.delay > 0 && !this.due.elapsed;
|
|
23
24
|
}
|
|
@@ -95,6 +96,7 @@ __decorate([
|
|
|
95
96
|
property()
|
|
96
97
|
], HelixHeadlessLoader.prototype, "for", void 0);
|
|
97
98
|
__decorate([
|
|
99
|
+
words,
|
|
98
100
|
property()
|
|
99
101
|
], HelixHeadlessLoader.prototype, "label", void 0);
|
|
100
102
|
HelixHeadlessLoader = __decorate([
|
|
@@ -23,6 +23,11 @@ import { type MapPoint } from '../route/map-route.js';
|
|
|
23
23
|
* @event {HelixMapPartChangeEvent} helix-map-part-change - The area's points, name, or color changed. Used by `connectMap`; pages do not need to listen for it.
|
|
24
24
|
*/
|
|
25
25
|
export declare class HelixHeadlessMapArea extends HelixElement {
|
|
26
|
+
/**
|
|
27
|
+
* The key this part's words are registered under, its styled tag:
|
|
28
|
+
* `registerWords('de', { 'helix-map-area': { label: 'Gebiet' } })`.
|
|
29
|
+
*/
|
|
30
|
+
static words: string;
|
|
26
31
|
/**
|
|
27
32
|
* Words drawn on the map with the area, such as `A` for a search sector.
|
|
28
33
|
* Unset, nothing is drawn. Keep it short: it is a caption on a map, and the
|
|
@@ -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, HelixMapPartChangeEvent } from '@fusion.dev/helix-core';
|
|
7
|
+
import { customElement, HelixElement, HelixMapPartChangeEvent, words } from '@fusion.dev/helix-core';
|
|
8
8
|
import { nothing } from 'lit';
|
|
9
9
|
import { property } from 'lit/decorators.js';
|
|
10
10
|
import { pointsConverter } from '../route/map-route.js';
|
|
@@ -16,6 +16,7 @@ let HelixHeadlessMapArea = class HelixHeadlessMapArea extends HelixElement {
|
|
|
16
16
|
this.layerKind = 'area';
|
|
17
17
|
this.label = 'Area';
|
|
18
18
|
}
|
|
19
|
+
static { this.words = 'helix-map-area'; }
|
|
19
20
|
updated(changed) {
|
|
20
21
|
super.updated(changed);
|
|
21
22
|
this.dispatchEvent(new HelixMapPartChangeEvent({ kind: 'layer' }));
|
|
@@ -37,6 +38,7 @@ __decorate([
|
|
|
37
38
|
property()
|
|
38
39
|
], HelixHeadlessMapArea.prototype, "group", void 0);
|
|
39
40
|
__decorate([
|
|
41
|
+
words,
|
|
40
42
|
property()
|
|
41
43
|
], HelixHeadlessMapArea.prototype, "label", void 0);
|
|
42
44
|
__decorate([
|