@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,16 +4,16 @@ 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, drawStatus, HelixBandEvent, HelixElement, hostAria, readingText, StatusController, slottedWords, wordsConverter, } from '@fusion.dev/helix-core';
|
|
7
|
+
import { customElement, drawStatus, formatWords, HelixBandEvent, HelixElement, hostAria, readingText, StatusController, slottedWords, words, wordsConverter, wordsLocale, } from '@fusion.dev/helix-core';
|
|
8
8
|
import { html, nothing, svg } from 'lit';
|
|
9
9
|
import { property } from 'lit/decorators.js';
|
|
10
|
-
const BAND_WORDS = { fair: 'Fair', good: 'Good', poor: 'Poor' };
|
|
11
10
|
let HelixHeadlessMeter = class HelixHeadlessMeter extends HelixElement {
|
|
12
11
|
constructor() {
|
|
13
12
|
super(...arguments);
|
|
14
|
-
this.bandLabels = {};
|
|
13
|
+
this.bandLabels = { fair: 'Fair', good: 'Good', poor: 'Poor' };
|
|
15
14
|
this.label = 'Meter';
|
|
16
15
|
this.live = false;
|
|
16
|
+
this.liveLabel = '{reading}, {band}';
|
|
17
17
|
this.locale = '';
|
|
18
18
|
this.max = 100;
|
|
19
19
|
this.min = 0;
|
|
@@ -25,6 +25,7 @@ let HelixHeadlessMeter = class HelixHeadlessMeter extends HelixElement {
|
|
|
25
25
|
this.requestUpdate();
|
|
26
26
|
};
|
|
27
27
|
}
|
|
28
|
+
static { this.words = 'helix-meter'; }
|
|
28
29
|
get span() {
|
|
29
30
|
const min = Number.isFinite(this.min) ? this.min : 0;
|
|
30
31
|
const max = Number.isFinite(this.max) && this.max > min ? this.max : min + 1;
|
|
@@ -73,7 +74,7 @@ let HelixHeadlessMeter = class HelixHeadlessMeter extends HelixElement {
|
|
|
73
74
|
}
|
|
74
75
|
get text() {
|
|
75
76
|
return (this.valueText ||
|
|
76
|
-
readingText(Number.isFinite(this.value) ? this.value : this.span.min, this.ratio, this
|
|
77
|
+
readingText(Number.isFinite(this.value) ? this.value : this.span.min, this.ratio, wordsLocale(this), this.formatOptions));
|
|
77
78
|
}
|
|
78
79
|
willUpdate(changed) {
|
|
79
80
|
super.willUpdate(changed);
|
|
@@ -102,7 +103,7 @@ let HelixHeadlessMeter = class HelixHeadlessMeter extends HelixElement {
|
|
|
102
103
|
}
|
|
103
104
|
this.dispatchEvent(new HelixBandEvent({ band: band ?? '' }));
|
|
104
105
|
if (band && this.live) {
|
|
105
|
-
this.status.say(
|
|
106
|
+
this.status.say(formatWords(this, 'liveLabel', { band: this.bandLabels[band] ?? '', reading: this.text }));
|
|
106
107
|
}
|
|
107
108
|
}
|
|
108
109
|
renderRound() {
|
|
@@ -158,6 +159,7 @@ __decorate([
|
|
|
158
159
|
property()
|
|
159
160
|
], HelixHeadlessMeter.prototype, "band", void 0);
|
|
160
161
|
__decorate([
|
|
162
|
+
words,
|
|
161
163
|
property({ attribute: 'band-labels', converter: wordsConverter })
|
|
162
164
|
], HelixHeadlessMeter.prototype, "bandLabels", void 0);
|
|
163
165
|
__decorate([
|
|
@@ -167,11 +169,16 @@ __decorate([
|
|
|
167
169
|
property({ type: Number })
|
|
168
170
|
], HelixHeadlessMeter.prototype, "high", void 0);
|
|
169
171
|
__decorate([
|
|
172
|
+
words,
|
|
170
173
|
property()
|
|
171
174
|
], HelixHeadlessMeter.prototype, "label", void 0);
|
|
172
175
|
__decorate([
|
|
173
176
|
property({ type: Boolean })
|
|
174
177
|
], HelixHeadlessMeter.prototype, "live", void 0);
|
|
178
|
+
__decorate([
|
|
179
|
+
words,
|
|
180
|
+
property({ attribute: 'live-label' })
|
|
181
|
+
], HelixHeadlessMeter.prototype, "liveLabel", void 0);
|
|
175
182
|
__decorate([
|
|
176
183
|
property()
|
|
177
184
|
], HelixHeadlessMeter.prototype, "locale", void 0);
|
|
@@ -42,6 +42,11 @@ import { type PropertyValues, type TemplateResult } from 'lit';
|
|
|
42
42
|
* @csspart nav - The navigation landmark.
|
|
43
43
|
*/
|
|
44
44
|
export declare class HelixHeadlessNavigation extends HelixElement {
|
|
45
|
+
/**
|
|
46
|
+
* The key this family's words are registered under, its styled tag:
|
|
47
|
+
* `registerWords('de', { 'helix-navigation': { label: 'Hauptmenü' } })`.
|
|
48
|
+
*/
|
|
49
|
+
static words: string;
|
|
45
50
|
private readonly indicator;
|
|
46
51
|
/**
|
|
47
52
|
* Whether the arrow keys move focus between the destinations.
|
|
@@ -4,23 +4,20 @@ 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, focusableElements, HelixElement, IndicatorController, KeyboardNavigationController, } from '@fusion.dev/helix-core';
|
|
7
|
+
import { AriaForwardController, customElement, focusableElements, focusItemOf, HelixElement, IndicatorController, KeyboardNavigationController, words, } from '@fusion.dev/helix-core';
|
|
8
8
|
import { html } from 'lit';
|
|
9
9
|
import { property } from 'lit/decorators.js';
|
|
10
10
|
const FOCUSABLE = 'a[href], button, input, select, textarea, [tabindex]:not([tabindex="-1"])';
|
|
11
11
|
const navigable = (item) => {
|
|
12
12
|
const control = () => item.navigationControl ??
|
|
13
13
|
(item.matches(FOCUSABLE) ? item : focusableElements(item)[0]);
|
|
14
|
-
return {
|
|
15
|
-
|
|
14
|
+
return focusItemOf(item, {
|
|
15
|
+
focus: () => control()?.focus(),
|
|
16
|
+
owns: (node) => {
|
|
16
17
|
const target = control();
|
|
17
18
|
return target !== undefined && node !== null && (node === target || target.contains(node));
|
|
18
19
|
},
|
|
19
|
-
|
|
20
|
-
focusItem: () => control()?.focus(),
|
|
21
|
-
select: () => { },
|
|
22
|
-
selected: false,
|
|
23
|
-
};
|
|
20
|
+
});
|
|
24
21
|
};
|
|
25
22
|
let HelixHeadlessNavigation = class HelixHeadlessNavigation extends HelixElement {
|
|
26
23
|
constructor() {
|
|
@@ -52,6 +49,7 @@ let HelixHeadlessNavigation = class HelixHeadlessNavigation extends HelixElement
|
|
|
52
49
|
target: () => this.partNamed('nav'),
|
|
53
50
|
});
|
|
54
51
|
}
|
|
52
|
+
static { this.words = 'helix-navigation'; }
|
|
55
53
|
get items() {
|
|
56
54
|
const slot = this.renderRoot.querySelector('slot:not([name])');
|
|
57
55
|
return (slot?.assignedElements() ?? []);
|
|
@@ -89,6 +87,7 @@ __decorate([
|
|
|
89
87
|
property({ type: Boolean })
|
|
90
88
|
], HelixHeadlessNavigation.prototype, "arrows", void 0);
|
|
91
89
|
__decorate([
|
|
90
|
+
words,
|
|
92
91
|
property()
|
|
93
92
|
], HelixHeadlessNavigation.prototype, "label", void 0);
|
|
94
93
|
__decorate([
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { HelixElement } from '@fusion.dev/helix-core';
|
|
1
|
+
import { ChildrenController, HelixElement } from '@fusion.dev/helix-core';
|
|
2
2
|
import { type PropertyValues, type TemplateResult } from 'lit';
|
|
3
3
|
import type { HelixHeadlessNotification } from '../notification/notification.js';
|
|
4
4
|
declare const HelixHeadlessNotificationGroup_base: (new (...args: any[]) => import("@fusion.dev/helix-core").MixinControllerOpenInterface) & typeof HelixElement;
|
|
@@ -134,6 +134,13 @@ export declare class HelixHeadlessNotificationGroup extends HelixHeadlessNotific
|
|
|
134
134
|
* is anything behind it. The one row is the evidence.
|
|
135
135
|
*/
|
|
136
136
|
private assign;
|
|
137
|
+
/**
|
|
138
|
+
* Hears a row arrive after the render. The slot is assigned by hand, so a
|
|
139
|
+
* new row is in no slot and sends no `slotchange` to say it came. The feed
|
|
140
|
+
* the group is in is asked to update as well, since it counts the group's
|
|
141
|
+
* rows and does not watch inside the group.
|
|
142
|
+
*/
|
|
143
|
+
protected readonly childWatch: ChildrenController;
|
|
137
144
|
private readonly handleToggle;
|
|
138
145
|
protected render(): TemplateResult;
|
|
139
146
|
}
|
|
@@ -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, hostAria, MixinControllerOpen } from '@fusion.dev/helix-core';
|
|
7
|
+
import { assignSlots, ChildrenController, customElement, HelixElement, hostAria, MixinControllerOpen, } from '@fusion.dev/helix-core';
|
|
8
8
|
import { html, nothing } from 'lit';
|
|
9
9
|
import { property } from 'lit/decorators.js';
|
|
10
10
|
const TRIGGER_ID = 'trigger';
|
|
@@ -16,6 +16,10 @@ let HelixHeadlessNotificationGroup = class HelixHeadlessNotificationGroup extend
|
|
|
16
16
|
this.collapsible = false;
|
|
17
17
|
this.label = '';
|
|
18
18
|
this.isNotificationGroup = true;
|
|
19
|
+
this.childWatch = new ChildrenController(this, () => {
|
|
20
|
+
this.requestUpdate();
|
|
21
|
+
this.parentElement?.requestUpdate?.();
|
|
22
|
+
});
|
|
19
23
|
this.handleToggle = () => {
|
|
20
24
|
this.toggleOpen();
|
|
21
25
|
};
|
|
@@ -58,11 +62,13 @@ let HelixHeadlessNotificationGroup = class HelixHeadlessNotificationGroup extend
|
|
|
58
62
|
}
|
|
59
63
|
return;
|
|
60
64
|
}
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
65
|
+
assignSlots(this.renderRoot, this.children, (child) => {
|
|
66
|
+
const row = child;
|
|
67
|
+
if (showing.includes(row)) {
|
|
68
|
+
return '';
|
|
69
|
+
}
|
|
70
|
+
return items.includes(row) || !child.hasAttribute('slot') ? 'folded' : undefined;
|
|
71
|
+
});
|
|
66
72
|
}
|
|
67
73
|
render() {
|
|
68
74
|
const counted = this.counted;
|
|
@@ -53,6 +53,16 @@ declare const HelixHeadlessNotification_base: (new (...args: any[]) => import("@
|
|
|
53
53
|
* @csspart label - What happened, on the first line.
|
|
54
54
|
* @csspart media - The leading slot's box.
|
|
55
55
|
* @csspart time - When it happened, formatted for people to read.
|
|
56
|
+
* @csspart time-day - Format Date's `day`, forwarded for a time drawn as fields. An elapsed time draws none.
|
|
57
|
+
* @csspart time-day-period - Format Date's `day-period`, forwarded for a time drawn as fields. An elapsed time draws none.
|
|
58
|
+
* @csspart time-era - Format Date's `era`, forwarded for a time drawn as fields. An elapsed time draws none.
|
|
59
|
+
* @csspart time-hour - Format Date's `hour`, forwarded for a time drawn as fields. An elapsed time draws none.
|
|
60
|
+
* @csspart time-minute - Format Date's `minute`, forwarded for a time drawn as fields. An elapsed time draws none.
|
|
61
|
+
* @csspart time-month - Format Date's `month`, forwarded for a time drawn as fields. An elapsed time draws none.
|
|
62
|
+
* @csspart time-second - Format Date's `second`, forwarded for a time drawn as fields. An elapsed time draws none.
|
|
63
|
+
* @csspart time-time-zone-name - Format Date's `time-zone-name`, forwarded for a time drawn as fields. An elapsed time draws none.
|
|
64
|
+
* @csspart time-weekday - Format Date's `weekday`, forwarded for a time drawn as fields. An elapsed time draws none.
|
|
65
|
+
* @csspart time-year - Format Date's `year`, forwarded for a time drawn as fields. An elapsed time draws none.
|
|
56
66
|
* @csspart trailing - The column holding the time and the controls.
|
|
57
67
|
*
|
|
58
68
|
* @cssstate actions - While the actions slot holds something, so the words above make room for it.
|
|
@@ -60,6 +70,11 @@ declare const HelixHeadlessNotification_base: (new (...args: any[]) => import("@
|
|
|
60
70
|
* @cssstate read - While it has been read.
|
|
61
71
|
*/
|
|
62
72
|
export declare class HelixHeadlessNotification extends HelixHeadlessNotification_base {
|
|
73
|
+
/**
|
|
74
|
+
* The key this part's words are registered under, its styled tag:
|
|
75
|
+
* `registerWords('de', { 'helix-notification': { unreadLabel: 'Ungelesen' } })`.
|
|
76
|
+
*/
|
|
77
|
+
static words: string;
|
|
63
78
|
/**
|
|
64
79
|
* When it happened, as anything `Date` parses.
|
|
65
80
|
*
|
|
@@ -210,7 +225,8 @@ export declare class HelixHeadlessNotification extends HelixHeadlessNotification
|
|
|
210
225
|
* already named for its role: the child publishes `time`, the role here is
|
|
211
226
|
* `time`, and naming both would leave `::part(time)` matching two elements.
|
|
212
227
|
* What a consumer wants to reach is the `<time>`, so that is what the name
|
|
213
|
-
* reaches.
|
|
228
|
+
* reaches. Format Date's field parts go on under `time-`, as every composed
|
|
229
|
+
* child's do, though an elapsed time draws no fields.
|
|
214
230
|
*/
|
|
215
231
|
private renderTime;
|
|
216
232
|
protected render(): TemplateResult;
|
|
@@ -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, deepActiveElement, deepContains, focusableElements, HelixElement, HelixReadEvent, hostAria, MixinDismissible, requestChange, slotFilled, } from '@fusion.dev/helix-core';
|
|
7
|
+
import { customElement, deepActiveElement, deepContains, focusableElements, HelixElement, HelixReadEvent, hostAria, MixinDismissible, requestChange, slotFilled, words, } from '@fusion.dev/helix-core';
|
|
8
8
|
import { x } from '@fusion.dev/helix-icons';
|
|
9
9
|
import { nothing } from 'lit';
|
|
10
10
|
import { property } from 'lit/decorators.js';
|
|
@@ -35,6 +35,7 @@ let HelixHeadlessNotification = class HelixHeadlessNotification extends MixinDis
|
|
|
35
35
|
}
|
|
36
36
|
};
|
|
37
37
|
}
|
|
38
|
+
static { this.words = 'helix-notification'; }
|
|
38
39
|
get read() {
|
|
39
40
|
return this.readState ?? this.defaultRead;
|
|
40
41
|
}
|
|
@@ -103,7 +104,9 @@ let HelixHeadlessNotification = class HelixHeadlessNotification extends MixinDis
|
|
|
103
104
|
renderTime() {
|
|
104
105
|
const stamp = this.tag('format-date');
|
|
105
106
|
return html `<${stamp}
|
|
106
|
-
exportparts="time
|
|
107
|
+
exportparts="time, day: time-day, day-period: time-day-period, era: time-era, hour: time-hour,
|
|
108
|
+
minute: time-minute, month: time-month, second: time-second,
|
|
109
|
+
time-zone-name: time-time-zone-name, weekday: time-weekday, year: time-year"
|
|
107
110
|
elapsed
|
|
108
111
|
date=${this.at}
|
|
109
112
|
locale=${this.locale}
|
|
@@ -175,6 +178,7 @@ __decorate([
|
|
|
175
178
|
property({ attribute: false })
|
|
176
179
|
], HelixHeadlessNotification.prototype, "stop", void 0);
|
|
177
180
|
__decorate([
|
|
181
|
+
words,
|
|
178
182
|
property({ attribute: 'unread-label' })
|
|
179
183
|
], HelixHeadlessNotification.prototype, "unreadLabel", void 0);
|
|
180
184
|
HelixHeadlessNotification = __decorate([
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { HelixElement } from '@fusion.dev/helix-core';
|
|
1
|
+
import { ChildrenController, HelixElement } from '@fusion.dev/helix-core';
|
|
2
2
|
import { nothing, type PropertyValues, type TemplateResult } from 'lit';
|
|
3
3
|
import type { HelixHeadlessNotificationGroup } from '../group/notification-group.js';
|
|
4
4
|
import type { HelixHeadlessNotification } from '../notification/notification.js';
|
|
@@ -35,6 +35,11 @@ declare const HelixHeadlessNotifications_base: (new (...args: any[]) => import("
|
|
|
35
35
|
* nothing more. While the feed is loading the button stays, so focus stays on
|
|
36
36
|
* it, and it is `aria-disabled` and sends nothing.
|
|
37
37
|
*
|
|
38
|
+
* **`load-error` says a page could not be fetched**, such as "Could not load
|
|
39
|
+
* notifications": it shows under the rows there are, in the `error` part, in
|
|
40
|
+
* place of the empty and loading lines, and a screen reader hears it. Clear it
|
|
41
|
+
* when you ask again.
|
|
42
|
+
*
|
|
38
43
|
* @since 0.1.0
|
|
39
44
|
* @status stable
|
|
40
45
|
* @category feedback
|
|
@@ -43,6 +48,7 @@ declare const HelixHeadlessNotifications_base: (new (...args: any[]) => import("
|
|
|
43
48
|
*
|
|
44
49
|
* @slot - The notifications.
|
|
45
50
|
* @slot empty - Replaces the words of `empty-text` in the `empty` part, such as a picture and a line of your own. The live region still says `empty-text`.
|
|
51
|
+
* @slot error - Replaces the words of `load-error` in the `error` part, such as a line with a retry button. The live region still says `load-error`.
|
|
46
52
|
* @slot footer - Below the list, for a link to everything.
|
|
47
53
|
* @slot header - Above the list, for a title and the mark-all control.
|
|
48
54
|
* @slot loading - Replaces the words of `loading-text` in the `loading` part, such as a loader. The live region still says `loading-text`.
|
|
@@ -52,15 +58,17 @@ declare const HelixHeadlessNotifications_base: (new (...args: any[]) => import("
|
|
|
52
58
|
* @event {HelixReadEvent} helix-read - Fired by an item when it is marked read or unread, and by the feed when everything is marked read. Cancelable.
|
|
53
59
|
*
|
|
54
60
|
* @csspart empty - Shown when there is nothing in the feed.
|
|
61
|
+
* @csspart error - Shown while `load-error` is set, under any rows there are, in place of the empty and loading lines.
|
|
55
62
|
* @csspart footer - The region below the list.
|
|
56
63
|
* @csspart header - The region above the list.
|
|
57
64
|
* @csspart list - The list itself.
|
|
58
|
-
* @csspart live - A copy of the empty and
|
|
65
|
+
* @csspart live - A copy of the empty, loading and error messages, in a live region that screen readers announce when they change. Visually hidden in the styled tier.
|
|
59
66
|
* @csspart loading - Shown while the feed is loading.
|
|
60
67
|
* @csspart mark-all - The control that marks everything read.
|
|
61
68
|
* @csspart more - The button after the list that asks for more, while `load-more` is set. It is `aria-disabled` while the feed is loading.
|
|
62
69
|
*
|
|
63
|
-
* @cssstate empty - While the feed holds no notification and is not loading. Never on the server, which cannot count the rows.
|
|
70
|
+
* @cssstate empty - While the feed holds no notification and is not loading, and `load-error` is not set. Never on the server, which cannot count the rows.
|
|
71
|
+
* @cssstate error - While `load-error` is set.
|
|
64
72
|
* @cssstate loading - While `loading` is set.
|
|
65
73
|
* @cssstate media - While a notification in the list holds something in its media slot, so every row keeps that column.
|
|
66
74
|
*/
|
|
@@ -75,10 +83,27 @@ export declare class HelixHeadlessNotifications extends HelixHeadlessNotificatio
|
|
|
75
83
|
* and does not patch up.
|
|
76
84
|
*/
|
|
77
85
|
static shadowRootOptions: ShadowRootInit;
|
|
86
|
+
/**
|
|
87
|
+
* The key this family's words are registered under, its styled tag:
|
|
88
|
+
* `registerWords('de', { 'helix-notifications': { markAllLabel: 'Alle als gelesen markieren' } })`.
|
|
89
|
+
* A notification's own words are under `helix-notification`.
|
|
90
|
+
*/
|
|
91
|
+
static words: string;
|
|
92
|
+
/** The region's name where `label` is empty. */
|
|
93
|
+
fallbackLabel: string;
|
|
78
94
|
/**
|
|
79
95
|
* The feed's name, read by screen readers.
|
|
80
96
|
*/
|
|
81
97
|
label: string;
|
|
98
|
+
/**
|
|
99
|
+
* What the feed says when a page of it could not be loaded, such as after a
|
|
100
|
+
* request to a server fails. Empty, null or no attribute is no error, so
|
|
101
|
+
* removing the attribute clears it.
|
|
102
|
+
*
|
|
103
|
+
* Set, it shows under the rows there are, in place of `empty-text` and
|
|
104
|
+
* `loading-text`, and a screen reader hears it. Clear it when you ask again.
|
|
105
|
+
*/
|
|
106
|
+
loadError: string | null;
|
|
82
107
|
/**
|
|
83
108
|
* Whether to draw a button after the list that asks for the next page, by
|
|
84
109
|
* sending `helix-load-more`. Take it off once there is nothing more.
|
|
@@ -186,6 +211,13 @@ export declare class HelixHeadlessNotifications extends HelixHeadlessNotificatio
|
|
|
186
211
|
markEveryoneRead(): number;
|
|
187
212
|
/** Items arrive from the light DOM, which changes no property here. */
|
|
188
213
|
private readonly handleSlotChange;
|
|
214
|
+
/**
|
|
215
|
+
* Hears a row arrive after the render. The list slot is assigned by hand, so
|
|
216
|
+
* a new row is in no slot and sends no `slotchange`: without this it was
|
|
217
|
+
* drawn nowhere and an emptied feed kept saying it was empty. A row added to
|
|
218
|
+
* a group is the group's to hear, and the group asks the feed to count again.
|
|
219
|
+
*/
|
|
220
|
+
protected readonly childWatch: ChildrenController;
|
|
189
221
|
/**
|
|
190
222
|
* An item's own read event, heard on the way past, so the count follows.
|
|
191
223
|
*
|
|
@@ -225,10 +257,22 @@ export declare class HelixHeadlessNotifications extends HelixHeadlessNotificatio
|
|
|
225
257
|
disconnectedCallback(): void;
|
|
226
258
|
protected willUpdate(changed: PropertyValues): void;
|
|
227
259
|
/**
|
|
228
|
-
* The empty or the loading line, each around a slot of the same
|
|
229
|
-
* fallback is the words, so a page can put its own in.
|
|
260
|
+
* The error, the empty or the loading line, each around a slot of the same
|
|
261
|
+
* name whose fallback is the words, so a page can put its own in. The error
|
|
262
|
+
* shows under the rows there are, since a page that failed is news even to
|
|
263
|
+
* a feed that holds some.
|
|
230
264
|
*/
|
|
231
265
|
protected renderStatus(hasContent: boolean): TemplateResult | typeof nothing;
|
|
266
|
+
/**
|
|
267
|
+
* The error before the shared words, which it wins over.
|
|
268
|
+
*
|
|
269
|
+
* **One region whose words change**, as the shared one is. The error was a
|
|
270
|
+
* second template, so setting it put a new region in the tree with its
|
|
271
|
+
* words already in it, which a reader may not hear.
|
|
272
|
+
*/
|
|
273
|
+
protected renderLive(hasContent: boolean): TemplateResult;
|
|
274
|
+
/** Whether `load-error` holds words, which a removed attribute does not. */
|
|
275
|
+
private get failed();
|
|
232
276
|
/**
|
|
233
277
|
* Says whether anything in the feed has media, so every item can hold the
|
|
234
278
|
* column open whether or not it has one of its own.
|
|
@@ -4,14 +4,16 @@ 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, deepContains, focusableElements, HelixElement, HelixLoadMoreEvent, HelixReadEvent, hostAria, MixinCollection, markRegion, rovingStop, whenHydrated, } from '@fusion.dev/helix-core';
|
|
7
|
+
import { assignSlots, ChildrenController, customElement, deepContains, focusableElements, HelixElement, HelixLoadMoreEvent, HelixReadEvent, hostAria, MixinCollection, markRegion, rovingStop, whenHydrated, words, } from '@fusion.dev/helix-core';
|
|
8
8
|
import { html, nothing } from 'lit';
|
|
9
9
|
import { property } from 'lit/decorators.js';
|
|
10
10
|
import { feedStep } from '../feed-keys.js';
|
|
11
11
|
let HelixHeadlessNotifications = class HelixHeadlessNotifications extends MixinCollection(HelixElement) {
|
|
12
12
|
constructor() {
|
|
13
13
|
super(...arguments);
|
|
14
|
+
this.fallbackLabel = 'Notifications';
|
|
14
15
|
this.label = '';
|
|
16
|
+
this.loadError = '';
|
|
15
17
|
this.loadMore = false;
|
|
16
18
|
this.loadMoreLabel = 'Load more';
|
|
17
19
|
this.markAll = false;
|
|
@@ -20,6 +22,7 @@ let HelixHeadlessNotifications = class HelixHeadlessNotifications extends MixinC
|
|
|
20
22
|
this.assign();
|
|
21
23
|
this.requestUpdate();
|
|
22
24
|
};
|
|
25
|
+
this.childWatch = new ChildrenController(this, this.handleSlotChange);
|
|
23
26
|
this.handleRead = () => {
|
|
24
27
|
queueMicrotask(() => this.requestUpdate());
|
|
25
28
|
};
|
|
@@ -81,6 +84,7 @@ let HelixHeadlessNotifications = class HelixHeadlessNotifications extends MixinC
|
|
|
81
84
|
...HelixElement.shadowRootOptions,
|
|
82
85
|
slotAssignment: 'manual',
|
|
83
86
|
}; }
|
|
87
|
+
static { this.words = 'helix-notifications'; }
|
|
84
88
|
get unread() {
|
|
85
89
|
return this.items.filter((item) => !item.read).length;
|
|
86
90
|
}
|
|
@@ -138,11 +142,8 @@ let HelixHeadlessNotifications = class HelixHeadlessNotifications extends MixinC
|
|
|
138
142
|
}
|
|
139
143
|
return;
|
|
140
144
|
}
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
const slot = root?.querySelector?.(`slot[name="${name}"]`);
|
|
144
|
-
slot?.assign?.(...[...this.children].filter((child) => child.getAttribute('slot') === name));
|
|
145
|
-
}
|
|
145
|
+
const rows = this.rows;
|
|
146
|
+
assignSlots(root, this.children, (child) => rows.includes(child) ? 'items' : child.getAttribute('slot') === 'items' ? '' : undefined);
|
|
146
147
|
}
|
|
147
148
|
get reachable() {
|
|
148
149
|
return this.items.filter((row) => !('assignedSlot' in row) || row.assignedSlot !== null);
|
|
@@ -177,11 +178,16 @@ let HelixHeadlessNotifications = class HelixHeadlessNotifications extends MixinC
|
|
|
177
178
|
}
|
|
178
179
|
willUpdate(changed) {
|
|
179
180
|
super.willUpdate(changed);
|
|
180
|
-
hostAria(this.internals, { label: this.label ||
|
|
181
|
+
hostAria(this.internals, { label: this.label || this.fallbackLabel, role: 'region' });
|
|
182
|
+
const failed = this.failed;
|
|
183
|
+
this.toggleState('error', failed);
|
|
181
184
|
this.toggleState('loading', this.loading);
|
|
182
|
-
this.toggleState('empty', !this.loading && this.childrenKnown && this.items.length === 0);
|
|
185
|
+
this.toggleState('empty', !this.loading && !failed && this.childrenKnown && this.items.length === 0);
|
|
183
186
|
}
|
|
184
187
|
renderStatus(hasContent) {
|
|
188
|
+
if (this.failed) {
|
|
189
|
+
return html `<p part="error"><slot name="error">${this.loadError}</slot></p>`;
|
|
190
|
+
}
|
|
185
191
|
if (!this.loading && hasContent) {
|
|
186
192
|
return nothing;
|
|
187
193
|
}
|
|
@@ -189,6 +195,19 @@ let HelixHeadlessNotifications = class HelixHeadlessNotifications extends MixinC
|
|
|
189
195
|
? html `<p part="loading"><slot name="loading">${this.loadingText}</slot></p>`
|
|
190
196
|
: html `<p part="empty"><slot name="empty">${this.emptyText}</slot></p>`;
|
|
191
197
|
}
|
|
198
|
+
renderLive(hasContent) {
|
|
199
|
+
const said = this.failed
|
|
200
|
+
? this.loadError
|
|
201
|
+
: this.loading
|
|
202
|
+
? this.loadingText
|
|
203
|
+
: hasContent
|
|
204
|
+
? this.announced
|
|
205
|
+
: this.emptyText;
|
|
206
|
+
return html `<span part="live" role="status">${said}</span>`;
|
|
207
|
+
}
|
|
208
|
+
get failed() {
|
|
209
|
+
return Boolean(this.loadError);
|
|
210
|
+
}
|
|
192
211
|
markMedia() {
|
|
193
212
|
this.toggleState('media', this.items.some((item) => item.querySelector(':scope > [slot="media"]') !== null));
|
|
194
213
|
}
|
|
@@ -245,19 +264,28 @@ let HelixHeadlessNotifications = class HelixHeadlessNotifications extends MixinC
|
|
|
245
264
|
<div part="footer"><slot name="footer"></slot></div>`;
|
|
246
265
|
}
|
|
247
266
|
};
|
|
267
|
+
__decorate([
|
|
268
|
+
words,
|
|
269
|
+
property({ attribute: 'fallback-label' })
|
|
270
|
+
], HelixHeadlessNotifications.prototype, "fallbackLabel", void 0);
|
|
248
271
|
__decorate([
|
|
249
272
|
property()
|
|
250
273
|
], HelixHeadlessNotifications.prototype, "label", void 0);
|
|
274
|
+
__decorate([
|
|
275
|
+
property({ attribute: 'load-error' })
|
|
276
|
+
], HelixHeadlessNotifications.prototype, "loadError", void 0);
|
|
251
277
|
__decorate([
|
|
252
278
|
property({ attribute: 'load-more', type: Boolean })
|
|
253
279
|
], HelixHeadlessNotifications.prototype, "loadMore", void 0);
|
|
254
280
|
__decorate([
|
|
281
|
+
words,
|
|
255
282
|
property({ attribute: 'load-more-label' })
|
|
256
283
|
], HelixHeadlessNotifications.prototype, "loadMoreLabel", void 0);
|
|
257
284
|
__decorate([
|
|
258
285
|
property({ attribute: 'mark-all', type: Boolean })
|
|
259
286
|
], HelixHeadlessNotifications.prototype, "markAll", void 0);
|
|
260
287
|
__decorate([
|
|
288
|
+
words,
|
|
261
289
|
property({ attribute: 'mark-all-label' })
|
|
262
290
|
], HelixHeadlessNotifications.prototype, "markAllLabel", void 0);
|
|
263
291
|
__decorate([
|
|
@@ -80,6 +80,11 @@ declare const HelixHeadlessNumberInput_base: (new (...args: any[]) => import("@f
|
|
|
80
80
|
* @cssstate scrubbing - The label is being dragged to change the value, under `scrub`, as Zag's scrubber says while it is held.
|
|
81
81
|
*/
|
|
82
82
|
export declare class HelixHeadlessNumberInput extends HelixHeadlessNumberInput_base {
|
|
83
|
+
/**
|
|
84
|
+
* The key this family's words are registered under, its styled tag:
|
|
85
|
+
* `registerWords('de', { 'helix-number-input': { incrementLabel: 'Erhöhen' } })`.
|
|
86
|
+
*/
|
|
87
|
+
static words: string;
|
|
83
88
|
protected readonly aria: AriaForwardController;
|
|
84
89
|
/** Typed or dragged, so every edit is announced. See `announcesInput`. */
|
|
85
90
|
protected readonly announcesInput = true;
|
|
@@ -99,9 +104,10 @@ export declare class HelixHeadlessNumberInput extends HelixHeadlessNumberInput_b
|
|
|
99
104
|
* **Every sentence a control raises in the browser's bubble is a property**,
|
|
100
105
|
* named for the validity flag it reports, so a form in another language
|
|
101
106
|
* speaks it: `feedback` replaces the message under the field and does not
|
|
102
|
-
* reach the bubble.
|
|
107
|
+
* reach the bubble. Unset is the sentence registered for the page's
|
|
108
|
+
* language, then the English.
|
|
103
109
|
*/
|
|
104
|
-
badInputMessage
|
|
110
|
+
badInputMessage: string;
|
|
105
111
|
/**
|
|
106
112
|
* The name of the step down button, read by screen readers.
|
|
107
113
|
*/
|
|
@@ -157,14 +163,14 @@ export declare class HelixHeadlessNumberInput extends HelixHeadlessNumberInput_b
|
|
|
157
163
|
placeholder: string;
|
|
158
164
|
/**
|
|
159
165
|
* The message the browser shows when the number is above `max`, with `{max}`
|
|
160
|
-
* filled in.
|
|
166
|
+
* filled in, written in the locale.
|
|
161
167
|
*/
|
|
162
|
-
rangeOverflowMessage
|
|
168
|
+
rangeOverflowMessage: string;
|
|
163
169
|
/**
|
|
164
170
|
* The message the browser shows when the number is below `min`, with `{min}`
|
|
165
|
-
* filled in.
|
|
171
|
+
* filled in, written in the locale.
|
|
166
172
|
*/
|
|
167
|
-
rangeUnderflowMessage
|
|
173
|
+
rangeUnderflowMessage: string;
|
|
168
174
|
/**
|
|
169
175
|
* Prevents editing. The value is still submitted with the form.
|
|
170
176
|
*/
|
|
@@ -193,9 +199,10 @@ export declare class HelixHeadlessNumberInput extends HelixHeadlessNumberInput_b
|
|
|
193
199
|
step?: number;
|
|
194
200
|
/**
|
|
195
201
|
* The message the browser shows when the number is off the step grid, with
|
|
196
|
-
* `{below}` and `{above}` filled in with the nearest valid values
|
|
202
|
+
* `{below}` and `{above}` filled in with the nearest valid values, written in
|
|
203
|
+
* the locale.
|
|
197
204
|
*/
|
|
198
|
-
stepMismatchMessage
|
|
205
|
+
stepMismatchMessage: string;
|
|
199
206
|
/**
|
|
200
207
|
* What a screen reader says for the value, with `{value}` filled in, such as
|
|
201
208
|
* `{value} kilograms`.
|
|
@@ -238,6 +245,12 @@ export declare class HelixHeadlessNumberInput extends HelixHeadlessNumberInput_b
|
|
|
238
245
|
* otherwise the smallest amount the format shows, or whole numbers.
|
|
239
246
|
*/
|
|
240
247
|
private get grid();
|
|
248
|
+
/**
|
|
249
|
+
* A number as a message writes it: in the locale the words are in, every
|
|
250
|
+
* digit kept and no grouping, which in English is the number as it was
|
|
251
|
+
* always written.
|
|
252
|
+
*/
|
|
253
|
+
private written;
|
|
241
254
|
/** Whether `value` is on the step grid, counted from `min`. */
|
|
242
255
|
private onStep;
|
|
243
256
|
/**
|