@fusion.dev/helix-headless 0.147.0 → 0.149.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/custom-elements.json +11222 -2332
- package/dist/accordion/item/accordion-item.d.ts +5 -2
- package/dist/accordion/item/accordion-item.js +11 -7
- package/dist/accordion/root/accordion-root.js +4 -6
- package/dist/announcement/root/announcement-root.d.ts +61 -5
- package/dist/announcement/root/announcement-root.js +126 -20
- package/dist/area-chart/root/area-chart-root.d.ts +11 -0
- package/dist/area-chart/root/area-chart-root.js +21 -9
- package/dist/avatar/group/avatar-group.d.ts +10 -2
- package/dist/avatar/group/avatar-group.js +10 -5
- package/dist/badge/count.d.ts +19 -0
- package/dist/badge/count.js +20 -0
- package/dist/badge/root/badge-root.d.ts +6 -2
- package/dist/badge/root/badge-root.js +8 -22
- package/dist/bar-chart/root/bar-chart-root.d.ts +13 -1
- package/dist/bar-chart/root/bar-chart-root.js +17 -4
- package/dist/blockquote/root/blockquote-root.d.ts +66 -8
- package/dist/blockquote/root/blockquote-root.js +85 -8
- package/dist/breadcrumbs/breadcrumb/breadcrumb.js +2 -2
- package/dist/breadcrumbs/root/breadcrumbs-root.d.ts +8 -1
- package/dist/breadcrumbs/root/breadcrumbs-root.js +5 -2
- package/dist/button/root/button-root.d.ts +10 -1
- package/dist/button/root/button-root.js +3 -2
- package/dist/button-group/arrows.d.ts +14 -0
- package/dist/button-group/arrows.js +10 -0
- package/dist/button-group/root/button-group-root.d.ts +144 -3
- package/dist/button-group/root/button-group-root.js +142 -2
- package/dist/callout/root/callout-root.d.ts +16 -2
- package/dist/callout/root/callout-root.js +16 -4
- package/dist/canvas/describe.d.ts +10 -0
- package/dist/canvas/describe.js +9 -0
- package/dist/canvas/edge-pan.d.ts +61 -0
- package/dist/canvas/edge-pan.js +63 -0
- package/dist/canvas/neighbor.d.ts +17 -0
- package/dist/canvas/neighbor.js +1 -0
- package/dist/canvas/node/canvas-node.d.ts +12 -2
- package/dist/canvas/node/canvas-node.js +8 -3
- package/dist/canvas/root/canvas-document.d.ts +10 -0
- package/dist/canvas/root/canvas-document.js +1 -0
- package/dist/canvas/root/canvas-root.d.ts +168 -9
- package/dist/canvas/root/canvas-root.js +239 -69
- package/dist/canvas/snap.d.ts +42 -0
- package/dist/canvas/snap.js +32 -0
- package/dist/carousel/root/carousel-root.d.ts +9 -3
- package/dist/carousel/root/carousel-root.js +17 -10
- package/dist/chat/composer/chat-composer.d.ts +5 -0
- package/dist/chat/composer/chat-composer.js +4 -1
- package/dist/chat/message/chat-message.d.ts +9 -5
- package/dist/chat/message/chat-message.js +8 -4
- package/dist/chat/naming.js +2 -2
- package/dist/chat/root/chat-root.d.ts +40 -4
- package/dist/chat/root/chat-root.js +38 -14
- package/dist/checkbox/root/checkbox-root.d.ts +11 -0
- package/dist/checkbox/root/checkbox-root.js +8 -2
- package/dist/checkbox-group/root/checkbox-group-root.d.ts +24 -0
- package/dist/checkbox-group/root/checkbox-group-root.js +28 -12
- package/dist/checkbox-group/select-all.d.ts +11 -0
- package/dist/checkbox-group/select-all.js +5 -0
- package/dist/code-block/root/code-block-root.d.ts +20 -8
- package/dist/code-block/root/code-block-root.js +16 -5
- package/dist/color-input/root/color-input-root.d.ts +13 -0
- package/dist/color-input/root/color-input-root.js +18 -5
- package/dist/color-picker/root/color-picker-root.d.ts +19 -3
- package/dist/color-picker/root/color-picker-root.js +52 -24
- package/dist/color-picker/wheel.d.ts +11 -0
- package/dist/color-picker/wheel.js +9 -0
- package/dist/combobox/root/combobox-root.d.ts +106 -18
- package/dist/combobox/root/combobox-root.js +101 -26
- package/dist/command/root/command-root.d.ts +19 -9
- package/dist/command/root/command-root.js +9 -4
- package/dist/copy-button/root/copy-button-root.d.ts +5 -0
- package/dist/copy-button/root/copy-button-root.js +7 -2
- package/dist/data-table/root/data-table-root.d.ts +171 -29
- package/dist/data-table/root/data-table-root.js +284 -161
- package/dist/date-input/root/date-input-root.d.ts +32 -9
- package/dist/date-input/root/date-input-root.js +66 -44
- package/dist/date-picker/root/date-picker-root.d.ts +38 -15
- package/dist/date-picker/root/date-picker-root.js +52 -33
- package/dist/description-list/item/description-list-item.d.ts +4 -0
- package/dist/description-list/item/description-list-item.js +7 -1
- package/dist/dialog/root/dialog-root.d.ts +12 -1
- package/dist/dialog/root/dialog-root.js +11 -4
- package/dist/divider/root/divider-root.d.ts +45 -16
- package/dist/divider/root/divider-root.js +28 -4
- package/dist/donut-chart/root/donut-chart-root.d.ts +5 -0
- package/dist/donut-chart/root/donut-chart-root.js +8 -5
- package/dist/drawer/root/drawer-root.d.ts +12 -1
- package/dist/drawer/root/drawer-root.js +9 -2
- package/dist/drilldown/item/drilldown-item.js +3 -4
- package/dist/drilldown/root/drilldown-root.d.ts +5 -0
- package/dist/drilldown/root/drilldown-root.js +4 -1
- package/dist/element-events.generated.js +26 -3
- package/dist/empty/root/empty-root.d.ts +17 -3
- package/dist/empty/root/empty-root.js +29 -5
- package/dist/file-input/root/file-input-root.d.ts +18 -3
- package/dist/file-input/root/file-input-root.js +34 -18
- package/dist/file-input/status.js +2 -1
- package/dist/filter-input/chip/filter-chip.d.ts +13 -0
- package/dist/filter-input/chip/filter-chip.js +7 -3
- package/dist/filter-input/menu/filter-menu.d.ts +5 -0
- package/dist/filter-input/menu/filter-menu.js +3 -1
- package/dist/filter-input/root/filter-input-root.d.ts +20 -3
- package/dist/filter-input/root/filter-input-root.js +8 -4
- package/dist/format-date/fields.d.ts +20 -0
- package/dist/format-date/fields.js +14 -0
- package/dist/format-date/options.d.ts +2 -1
- package/dist/format-date/options.js +9 -38
- package/dist/format-date/root/format-date-root.d.ts +55 -5
- package/dist/format-date/root/format-date-root.js +29 -34
- package/dist/graph/root/graph-model.d.ts +11 -0
- package/dist/graph/root/graph-model.js +4 -0
- package/dist/graph/root/graph-root.d.ts +101 -14
- package/dist/graph/root/graph-root.js +140 -46
- package/dist/heatmap/root/heatmap-root.d.ts +37 -4
- package/dist/heatmap/root/heatmap-root.js +51 -16
- package/dist/icon-button/root/icon-button-root.d.ts +5 -0
- package/dist/icon-button/root/icon-button-root.js +1 -0
- package/dist/image/root/image-root.d.ts +11 -0
- package/dist/input/root/input-root.d.ts +5 -0
- package/dist/input/root/input-root.js +4 -1
- package/dist/kbd/root/kbd-root.js +1 -2
- package/dist/legend/root/legend-root.js +4 -17
- package/dist/lightbox/root/lightbox-root.d.ts +14 -4
- package/dist/lightbox/root/lightbox-root.js +25 -7
- package/dist/line-chart/root/line-chart-root.d.ts +5 -0
- package/dist/line-chart/root/line-chart-root.js +4 -2
- package/dist/list/item/list-item.d.ts +32 -0
- package/dist/list/item/list-item.js +34 -7
- package/dist/list/root/list-root.d.ts +87 -0
- package/dist/list/root/list-root.js +119 -23
- package/dist/listbox/reorder/index.d.ts +1 -0
- package/dist/listbox/reorder/index.js +4 -0
- package/dist/listbox/reorder/listbox-reorder.d.ts +83 -0
- package/dist/listbox/reorder/listbox-reorder.js +151 -0
- package/dist/listbox/root/listbox-root.d.ts +185 -33
- package/dist/listbox/root/listbox-root.js +166 -136
- package/dist/loader/root/loader-root.d.ts +5 -0
- package/dist/loader/root/loader-root.js +3 -1
- package/dist/map/area/map-area.d.ts +5 -0
- package/dist/map/area/map-area.js +3 -1
- package/dist/map/buildings/map-buildings.d.ts +5 -0
- package/dist/map/buildings/map-buildings.js +3 -1
- package/dist/map/contours/map-contours.d.ts +5 -0
- package/dist/map/contours/map-contours.js +3 -1
- package/dist/map/landcover/map-landcover.d.ts +5 -0
- package/dist/map/landcover/map-landcover.js +3 -1
- package/dist/map/marker/map-marker.d.ts +18 -2
- package/dist/map/marker/map-marker.js +13 -5
- package/dist/map/points/map-points.d.ts +5 -0
- package/dist/map/points/map-points.js +6 -4
- package/dist/map/position/map-position.d.ts +5 -0
- package/dist/map/position/map-position.js +3 -1
- package/dist/map/raster/map-raster.d.ts +5 -0
- package/dist/map/raster/map-raster.js +3 -1
- package/dist/map/root/map-root.d.ts +73 -16
- package/dist/map/root/map-root.js +122 -44
- package/dist/map/route/map-route.d.ts +5 -0
- package/dist/map/route/map-route.js +3 -1
- package/dist/map/terrain/map-terrain.d.ts +5 -0
- package/dist/map/terrain/map-terrain.js +3 -1
- package/dist/megamenu/root/megamenu-root.js +4 -11
- package/dist/menu/root/menu-root.d.ts +7 -2
- package/dist/menu/root/menu-root.js +3 -1
- package/dist/meter/root/meter-root.d.ts +16 -3
- package/dist/meter/root/meter-root.js +12 -5
- package/dist/navigation/root/navigation-root.d.ts +5 -0
- package/dist/navigation/root/navigation-root.js +7 -8
- package/dist/notifications/group/notification-group.d.ts +8 -1
- package/dist/notifications/group/notification-group.js +12 -6
- package/dist/notifications/notification/notification.d.ts +17 -1
- package/dist/notifications/notification/notification.js +6 -2
- package/dist/notifications/root/notifications-root.d.ts +49 -5
- package/dist/notifications/root/notifications-root.js +36 -8
- package/dist/number-input/root/number-input-root.d.ts +21 -8
- package/dist/number-input/root/number-input-root.js +26 -11
- package/dist/object-inspector/root/object-inspector-root.d.ts +56 -13
- package/dist/object-inspector/root/object-inspector-root.js +41 -30
- package/dist/outline/root/outline-root.d.ts +5 -0
- package/dist/outline/root/outline-root.js +3 -1
- package/dist/pagination/root/pagination-root.d.ts +7 -1
- package/dist/pagination/root/pagination-root.js +16 -7
- package/dist/pagination/size/pagination-size.d.ts +8 -3
- package/dist/pagination/size/pagination-size.js +5 -3
- package/dist/pagination/summary/pagination-summary.d.ts +8 -6
- package/dist/pagination/summary/pagination-summary.js +4 -9
- package/dist/pin-input/code.d.ts +23 -0
- package/dist/pin-input/code.js +21 -0
- package/dist/pin-input/root/pin-input-root.d.ts +9 -3
- package/dist/pin-input/root/pin-input-root.js +13 -23
- package/dist/popover/root/popover-root.d.ts +12 -2
- package/dist/popover/root/popover-root.js +10 -4
- package/dist/progress/root/progress-root.d.ts +7 -2
- package/dist/progress/root/progress-root.js +5 -2
- package/dist/qr-code/name.d.ts +3 -2
- package/dist/qr-code/name.js +2 -2
- package/dist/qr-code/root/qr-code-root.d.ts +26 -5
- package/dist/qr-code/root/qr-code-root.js +27 -6
- package/dist/radio/group/radio-group.d.ts +11 -0
- package/dist/radio/group/radio-group.js +8 -2
- package/dist/rating/root/rating-root.d.ts +12 -1
- package/dist/rating/root/rating-root.js +10 -3
- package/dist/scatter-chart/measures.d.ts +22 -0
- package/dist/scatter-chart/measures.js +11 -0
- package/dist/scatter-chart/root/scatter-chart-root.d.ts +22 -8
- package/dist/scatter-chart/root/scatter-chart-root.js +25 -23
- package/dist/select/root/select-root.d.ts +67 -8
- package/dist/select/root/select-root.js +45 -11
- package/dist/skip-link/root/skip-link-root.d.ts +5 -0
- package/dist/skip-link/root/skip-link-root.js +3 -1
- package/dist/slider/root/slider-root.d.ts +7 -2
- package/dist/slider/root/slider-root.js +11 -5
- package/dist/sparkline/readings.d.ts +15 -5
- package/dist/sparkline/readings.js +3 -3
- package/dist/sparkline/root/sparkline-root.d.ts +9 -4
- package/dist/sparkline/root/sparkline-root.js +9 -3
- package/dist/speed-dial/group/speed-dial-group.d.ts +48 -0
- package/dist/speed-dial/group/speed-dial-group.js +43 -0
- package/dist/speed-dial/index.d.ts +1 -0
- package/dist/speed-dial/index.js +1 -0
- package/dist/speed-dial/item/speed-dial-item.d.ts +26 -1
- package/dist/speed-dial/item/speed-dial-item.js +41 -3
- package/dist/speed-dial/long-press.d.ts +50 -0
- package/dist/speed-dial/long-press.js +48 -0
- package/dist/speed-dial/root/speed-dial-root.d.ts +85 -1
- package/dist/speed-dial/root/speed-dial-root.js +117 -5
- package/dist/splitter/root/splitter-root.d.ts +12 -3
- package/dist/splitter/root/splitter-root.js +22 -4
- package/dist/steps/root/steps-root.d.ts +9 -2
- package/dist/steps/root/steps-root.js +6 -3
- package/dist/steps/step/step.d.ts +12 -0
- package/dist/steps/step/step.js +11 -2
- package/dist/switch/root/switch-root.d.ts +11 -0
- package/dist/switch/root/switch-root.js +8 -2
- package/dist/table/cell/table-cell.d.ts +8 -1
- package/dist/table/cell/table-cell.js +6 -2
- package/dist/table/column/table-column.d.ts +11 -4
- package/dist/table/column/table-column.js +15 -10
- package/dist/table/grid-controller.d.ts +122 -0
- package/dist/table/grid-controller.js +299 -0
- package/dist/table/root/table-root.d.ts +154 -8
- package/dist/table/root/table-root.js +197 -38
- package/dist/table/row/table-row.d.ts +55 -1
- package/dist/table/row/table-row.js +60 -7
- package/dist/tabs/root/tabs-root.d.ts +5 -0
- package/dist/tabs/root/tabs-root.js +3 -1
- package/dist/tag/group/tag-group.d.ts +5 -0
- package/dist/tag/group/tag-group.js +8 -15
- package/dist/tag/root/tag-root.d.ts +14 -1
- package/dist/tag/root/tag-root.js +11 -8
- package/dist/textarea/root/textarea-root.d.ts +5 -0
- package/dist/textarea/root/textarea-root.js +3 -1
- package/dist/time-input/root/time-input-root.d.ts +14 -7
- package/dist/time-input/root/time-input-root.js +43 -32
- package/dist/time-picker/root/time-picker-root.d.ts +16 -7
- package/dist/time-picker/root/time-picker-root.js +28 -12
- package/dist/toast/item/toast-item.d.ts +13 -3
- package/dist/toast/item/toast-item.js +2 -0
- package/dist/toast/root/toast-root.d.ts +22 -2
- package/dist/toast/root/toast-root.js +24 -17
- package/dist/toggle/group/toggle-group.js +3 -5
- package/dist/toolbar/root/toolbar-root.d.ts +36 -0
- package/dist/toolbar/root/toolbar-root.js +43 -9
- package/dist/tooltip/root/tooltip-root.d.ts +27 -17
- package/dist/tooltip/root/tooltip-root.js +1 -2
- package/dist/tour/root/tour-root.d.ts +8 -2
- package/dist/tour/root/tour-root.js +4 -2
- package/dist/tour/stop/tour-stop.d.ts +5 -0
- package/dist/tour/stop/tour-stop.js +6 -1
- package/dist/tree/grip.d.ts +5 -0
- package/dist/tree/grip.js +1 -0
- package/dist/tree/item/tree-item.d.ts +24 -0
- package/dist/tree/item/tree-item.js +27 -5
- package/dist/tree/root/tree-root.d.ts +66 -1
- package/dist/tree/root/tree-root.js +77 -5
- package/dist/trend/root/trend-root.d.ts +20 -4
- package/dist/trend/root/trend-root.js +20 -5
- package/dist/video/root/video-root.d.ts +23 -3
- package/dist/video/root/video-root.js +56 -15
- package/dist/video-playlist/menu/video-playlist-menu.d.ts +5 -0
- package/dist/video-playlist/menu/video-playlist-menu.js +3 -1
- package/dist/video-playlist/root/video-playlist-root.d.ts +5 -0
- package/dist/video-playlist/root/video-playlist-root.js +3 -1
- package/dist/virtual-list/root/virtual-list-root.d.ts +19 -3
- package/dist/virtual-list/root/virtual-list-root.js +10 -19
- package/lint.json +1 -1
- package/package.json +7 -6
- package/types/jsx.d.ts +6005 -2114
- package/types/svelte.d.ts +1 -0
- package/types/vue.d.ts +1594 -676
- package/types/words.d.ts +3280 -0
- package/dist/kbd/keys.d.ts +0 -29
- package/dist/kbd/keys.js +0 -52
- package/dist/toast/hotkey.d.ts +0 -22
- package/dist/toast/hotkey.js +0 -23
- package/dist/tooltip/focus-target.d.ts +0 -6
- package/dist/tooltip/focus-target.js +0 -9
|
@@ -4,7 +4,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
4
4
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
|
-
import { customElement, HelixElement, reportRuntime } from '@fusion.dev/helix-core';
|
|
7
|
+
import { customElement, formatWords, HelixElement, reportRuntime, words, wordsLocale, } from '@fusion.dev/helix-core';
|
|
8
8
|
import { arrowDown, arrowUp, minus } from '@fusion.dev/helix-icons';
|
|
9
9
|
import { html } from 'lit';
|
|
10
10
|
import { property } from 'lit/decorators.js';
|
|
@@ -21,11 +21,13 @@ let HelixHeadlessTrend = class HelixHeadlessTrend extends HelixElement {
|
|
|
21
21
|
super(...arguments);
|
|
22
22
|
this.betterLabel = 'better';
|
|
23
23
|
this.downLabel = 'Down';
|
|
24
|
+
this.judgmentLabel = '{judgment, select, better {{direction}, {betterLabel}} worse {{direction}, {worseLabel}} other {{direction}}}';
|
|
24
25
|
this.locale = '';
|
|
25
26
|
this.unchangedLabel = 'Unchanged';
|
|
26
27
|
this.upLabel = 'Up';
|
|
27
28
|
this.worseLabel = 'worse';
|
|
28
29
|
}
|
|
30
|
+
static { this.words = 'helix-trend'; }
|
|
29
31
|
renderIcon(icon) {
|
|
30
32
|
return html `<slot aria-hidden="true" name="icon"
|
|
31
33
|
><svg
|
|
@@ -69,8 +71,12 @@ let HelixHeadlessTrend = class HelixHeadlessTrend extends HelixElement {
|
|
|
69
71
|
render() {
|
|
70
72
|
const moved = this.moved;
|
|
71
73
|
const direction = readDirection(moved);
|
|
72
|
-
const
|
|
73
|
-
|
|
74
|
+
const said = formatWords(this, 'judgmentLabel', {
|
|
75
|
+
betterLabel: this.betterLabel,
|
|
76
|
+
direction: this[direction.word],
|
|
77
|
+
judgment: this.judged ?? 'none',
|
|
78
|
+
worseLabel: this.worseLabel,
|
|
79
|
+
});
|
|
74
80
|
const icon = this.renderIcon(direction.icon);
|
|
75
81
|
const glyph = moved === 'up'
|
|
76
82
|
? html `<slot aria-hidden="true" name="up-icon">${icon}</slot>`
|
|
@@ -80,20 +86,22 @@ let HelixHeadlessTrend = class HelixHeadlessTrend extends HelixElement {
|
|
|
80
86
|
const value = this.value;
|
|
81
87
|
const figure = value === undefined || !Number.isFinite(value)
|
|
82
88
|
? ''
|
|
83
|
-
: figureOf(value, this
|
|
89
|
+
: figureOf(value, wordsLocale(this), this.formatOptions);
|
|
84
90
|
return html `${glyph}
|
|
85
|
-
<span part="direction">${
|
|
91
|
+
<span part="direction">${said}</span>
|
|
86
92
|
<span part="value" ?hidden=${figure === ''}>${figure}</span><slot></slot>
|
|
87
93
|
<slot name="label"></slot>`;
|
|
88
94
|
}
|
|
89
95
|
};
|
|
90
96
|
__decorate([
|
|
97
|
+
words,
|
|
91
98
|
property({ attribute: 'better-label' })
|
|
92
99
|
], HelixHeadlessTrend.prototype, "betterLabel", void 0);
|
|
93
100
|
__decorate([
|
|
94
101
|
property({ reflect: true })
|
|
95
102
|
], HelixHeadlessTrend.prototype, "direction", void 0);
|
|
96
103
|
__decorate([
|
|
104
|
+
words,
|
|
97
105
|
property({ attribute: 'down-label' })
|
|
98
106
|
], HelixHeadlessTrend.prototype, "downLabel", void 0);
|
|
99
107
|
__decorate([
|
|
@@ -102,6 +110,10 @@ __decorate([
|
|
|
102
110
|
__decorate([
|
|
103
111
|
property({ reflect: true })
|
|
104
112
|
], HelixHeadlessTrend.prototype, "good", void 0);
|
|
113
|
+
__decorate([
|
|
114
|
+
words,
|
|
115
|
+
property({ attribute: 'judgment-label' })
|
|
116
|
+
], HelixHeadlessTrend.prototype, "judgmentLabel", void 0);
|
|
105
117
|
__decorate([
|
|
106
118
|
property()
|
|
107
119
|
], HelixHeadlessTrend.prototype, "locale", void 0);
|
|
@@ -109,15 +121,18 @@ __decorate([
|
|
|
109
121
|
property({ reflect: true })
|
|
110
122
|
], HelixHeadlessTrend.prototype, "movement", void 0);
|
|
111
123
|
__decorate([
|
|
124
|
+
words,
|
|
112
125
|
property({ attribute: 'unchanged-label' })
|
|
113
126
|
], HelixHeadlessTrend.prototype, "unchangedLabel", void 0);
|
|
114
127
|
__decorate([
|
|
128
|
+
words,
|
|
115
129
|
property({ attribute: 'up-label' })
|
|
116
130
|
], HelixHeadlessTrend.prototype, "upLabel", void 0);
|
|
117
131
|
__decorate([
|
|
118
132
|
property({ type: Number })
|
|
119
133
|
], HelixHeadlessTrend.prototype, "value", void 0);
|
|
120
134
|
__decorate([
|
|
135
|
+
words,
|
|
121
136
|
property({ attribute: 'worse-label' })
|
|
122
137
|
], HelixHeadlessTrend.prototype, "worseLabel", void 0);
|
|
123
138
|
HelixHeadlessTrend = __decorate([
|
|
@@ -161,8 +161,22 @@ import '../../menu/index.js';
|
|
|
161
161
|
* @cssproperty --video-intrinsic-ratio - The media's own aspect ratio, once it is known. `--video-aspect-ratio` overrides it.
|
|
162
162
|
* @cssproperty --video-level - The current volume, 0 to 1.
|
|
163
163
|
* @cssproperty --video-progress - How far playback has reached, as a fraction of the duration.
|
|
164
|
+
*
|
|
165
|
+
* @cssstate ended - Playback reached the end, until it starts again or the source changes.
|
|
166
|
+
* @cssstate error - The source could not be played, and `failure` shows.
|
|
167
|
+
* @cssstate fullscreen - The player fills the screen.
|
|
168
|
+
* @cssstate idle - The video plays and the user has been still for `idle-delay`, so the bar hides.
|
|
169
|
+
* @cssstate muted - The sound is off.
|
|
170
|
+
* @cssstate paused - Playback is paused, which is where every player starts.
|
|
171
|
+
* @cssstate playing - Playback runs, waiting for data included.
|
|
172
|
+
* @cssstate waiting - Playback stopped to wait for more data, and `loading` shows.
|
|
164
173
|
*/
|
|
165
174
|
export declare class HelixHeadlessVideo extends HelixElement {
|
|
175
|
+
/**
|
|
176
|
+
* The key this family's words are registered under, its styled tag:
|
|
177
|
+
* `registerWords('de', { 'helix-video': { playLabel: 'Abspielen' } })`.
|
|
178
|
+
*/
|
|
179
|
+
static words: string;
|
|
166
180
|
/**
|
|
167
181
|
* Whether the video starts playing on its own. Browsers allow this only while
|
|
168
182
|
* it is muted.
|
|
@@ -265,7 +279,8 @@ export declare class HelixHeadlessVideo extends HelixElement {
|
|
|
265
279
|
*/
|
|
266
280
|
extraControls: string;
|
|
267
281
|
/**
|
|
268
|
-
* What the control that skips ahead is called
|
|
282
|
+
* What the control that skips ahead is called. `{seconds}` is how far, written
|
|
283
|
+
* in the locale, and each language writes the forms it has.
|
|
269
284
|
*/
|
|
270
285
|
forwardLabel: string;
|
|
271
286
|
/**
|
|
@@ -337,7 +352,9 @@ export declare class HelixHeadlessVideo extends HelixElement {
|
|
|
337
352
|
*/
|
|
338
353
|
pauseLabel: string;
|
|
339
354
|
/**
|
|
340
|
-
* How the volume is read out
|
|
355
|
+
* How the volume is read out. `{percent}` is the volume from 0 to 100,
|
|
356
|
+
* written in the locale, and a language that needs plural forms writes them
|
|
357
|
+
* with `{percent, plural, ...}`.
|
|
341
358
|
*/
|
|
342
359
|
percentLabel: string;
|
|
343
360
|
/**
|
|
@@ -374,7 +391,8 @@ export declare class HelixHeadlessVideo extends HelixElement {
|
|
|
374
391
|
*/
|
|
375
392
|
remoteLabel: string;
|
|
376
393
|
/**
|
|
377
|
-
* What the control that skips back is called
|
|
394
|
+
* What the control that skips back is called. `{seconds}` is how far, written
|
|
395
|
+
* in the locale, and each language writes the forms it has.
|
|
378
396
|
*/
|
|
379
397
|
rewindLabel: string;
|
|
380
398
|
/**
|
|
@@ -452,6 +470,8 @@ export declare class HelixHeadlessVideo extends HelixElement {
|
|
|
452
470
|
*/
|
|
453
471
|
private failed;
|
|
454
472
|
private playing;
|
|
473
|
+
/** Whether playback reached the end, for `:state(ended)`. */
|
|
474
|
+
private finished;
|
|
455
475
|
private position;
|
|
456
476
|
private knownDuration;
|
|
457
477
|
private loudness;
|
|
@@ -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 { activeCue, adoptTrack, CueController, captionsAmong, captionTracks, copiesOf, customElement, drawIcon, FullscreenController,
|
|
7
|
+
import { activeCue, adoptTrack, CueController, captionsAmong, captionTracks, copiesOf, customElement, drawIcon, FullscreenController, formatWords, HelixElement, HelixNextEvent, HelixPreviousEvent, IdleController, MediaSessionController, onUnlessFalse, RemotePlaybackController, reportRuntime, SKIP_SECONDS, sameCopies, showCaption, words, writtenList, writtenNumbers, } from '@fusion.dev/helix-core';
|
|
8
8
|
import { airplay, arrowClockwise, arrowCounterClockwise, closedCaptioning, cornersIn, cornersOut, dotsThreeVertical, download, gauge, pause, pictureInPicture, play, skipBack, skipForward, speakerHigh, speakerX, } from '@fusion.dev/helix-icons';
|
|
9
9
|
import { nothing } from 'lit';
|
|
10
10
|
import { property, state } from 'lit/decorators.js';
|
|
@@ -41,7 +41,7 @@ let HelixHeadlessVideo = class HelixHeadlessVideo extends HelixElement {
|
|
|
41
41
|
this.downloadLabel = 'Download';
|
|
42
42
|
this.errorLabel = 'This video could not be played';
|
|
43
43
|
this.extraControls = '';
|
|
44
|
-
this.forwardLabel = 'Forward {seconds}
|
|
44
|
+
this.forwardLabel = '{seconds, plural, one {Forward # second} other {Forward # seconds}}';
|
|
45
45
|
this.fullscreenLabel = 'Fullscreen';
|
|
46
46
|
this.idleDelay = 2500;
|
|
47
47
|
this.label = '';
|
|
@@ -61,7 +61,7 @@ let HelixHeadlessVideo = class HelixHeadlessVideo extends HelixElement {
|
|
|
61
61
|
this.preload = 'metadata';
|
|
62
62
|
this.previousLabel = 'Previous';
|
|
63
63
|
this.remoteLabel = 'Play on another device';
|
|
64
|
-
this.rewindLabel = 'Back {seconds}
|
|
64
|
+
this.rewindLabel = '{seconds, plural, one {Back # second} other {Back # seconds}}';
|
|
65
65
|
this.seekLabel = 'Seek';
|
|
66
66
|
this.speedLabel = 'Playback speed';
|
|
67
67
|
this.speeds = '0.5 1 1.5 2';
|
|
@@ -72,6 +72,7 @@ let HelixHeadlessVideo = class HelixHeadlessVideo extends HelixElement {
|
|
|
72
72
|
this.buffering = false;
|
|
73
73
|
this.failed = false;
|
|
74
74
|
this.playing = false;
|
|
75
|
+
this.finished = false;
|
|
75
76
|
this.position = 0;
|
|
76
77
|
this.knownDuration = 0;
|
|
77
78
|
this.loudness = 1;
|
|
@@ -127,6 +128,7 @@ let HelixHeadlessVideo = class HelixHeadlessVideo extends HelixElement {
|
|
|
127
128
|
};
|
|
128
129
|
this.handleTime = () => {
|
|
129
130
|
this.position = this.video?.currentTime ?? 0;
|
|
131
|
+
this.finished = this.video?.ended ?? false;
|
|
130
132
|
};
|
|
131
133
|
this.handleWaiting = () => {
|
|
132
134
|
this.buffering = true;
|
|
@@ -144,7 +146,8 @@ let HelixHeadlessVideo = class HelixHeadlessVideo extends HelixElement {
|
|
|
144
146
|
this.handleState = (event) => {
|
|
145
147
|
const video = this.video;
|
|
146
148
|
this.playing = video ? !video.paused : false;
|
|
147
|
-
|
|
149
|
+
this.finished = video?.ended ?? false;
|
|
150
|
+
if (event.type === 'emptied' || event.type === 'ended' || event.type === 'pause') {
|
|
148
151
|
this.buffering = false;
|
|
149
152
|
}
|
|
150
153
|
if (event.type === 'play') {
|
|
@@ -207,6 +210,7 @@ let HelixHeadlessVideo = class HelixHeadlessVideo extends HelixElement {
|
|
|
207
210
|
};
|
|
208
211
|
this.captions = [];
|
|
209
212
|
}
|
|
213
|
+
static { this.words = 'helix-video'; }
|
|
210
214
|
get conditions() {
|
|
211
215
|
return {
|
|
212
216
|
hydrating: this.hydrating,
|
|
@@ -438,6 +442,14 @@ let HelixHeadlessVideo = class HelixHeadlessVideo extends HelixElement {
|
|
|
438
442
|
super.updated?.(changed);
|
|
439
443
|
this.toggleAttribute('data-playing', this.playing);
|
|
440
444
|
this.toggleAttribute('data-idle', this.idle && this.playing);
|
|
445
|
+
this.toggleState('ended', this.finished);
|
|
446
|
+
this.toggleState('error', this.failed);
|
|
447
|
+
this.toggleState('fullscreen', this.full);
|
|
448
|
+
this.toggleState('idle', this.idle && this.playing);
|
|
449
|
+
this.toggleState('muted', this.silent);
|
|
450
|
+
this.toggleState('paused', !this.playing);
|
|
451
|
+
this.toggleState('playing', this.playing);
|
|
452
|
+
this.toggleState('waiting', this.buffering);
|
|
441
453
|
if (changed.has('media')) {
|
|
442
454
|
this.video?.load();
|
|
443
455
|
}
|
|
@@ -458,7 +470,7 @@ let HelixHeadlessVideo = class HelixHeadlessVideo extends HelixElement {
|
|
|
458
470
|
return html `<button
|
|
459
471
|
part="rewind"
|
|
460
472
|
type="button"
|
|
461
|
-
aria-label=${
|
|
473
|
+
aria-label=${formatWords(this, 'rewindLabel', { seconds: SKIP_SECONDS })}
|
|
462
474
|
@click=${() => this.skipBy(-SKIP_SECONDS)}
|
|
463
475
|
>
|
|
464
476
|
<slot name="rewind-icon">${drawIcon(arrowCounterClockwise)}</slot>
|
|
@@ -468,7 +480,7 @@ let HelixHeadlessVideo = class HelixHeadlessVideo extends HelixElement {
|
|
|
468
480
|
return html `<button
|
|
469
481
|
part="forward"
|
|
470
482
|
type="button"
|
|
471
|
-
aria-label=${
|
|
483
|
+
aria-label=${formatWords(this, 'forwardLabel', { seconds: SKIP_SECONDS })}
|
|
472
484
|
@click=${() => this.skipBy(SKIP_SECONDS)}
|
|
473
485
|
>
|
|
474
486
|
<slot name="forward-icon">${drawIcon(arrowClockwise)}</slot>
|
|
@@ -632,7 +644,7 @@ let HelixHeadlessVideo = class HelixHeadlessVideo extends HelixElement {
|
|
|
632
644
|
${back
|
|
633
645
|
? html `<slot name="rewind-icon" slot="start">${drawIcon(arrowCounterClockwise)}</slot>`
|
|
634
646
|
: html `<slot name="forward-icon" slot="start">${drawIcon(arrowClockwise)}</slot>`}
|
|
635
|
-
${
|
|
647
|
+
${formatWords(this, back ? 'rewindLabel' : 'forwardLabel', { seconds: SKIP_SECONDS })}
|
|
636
648
|
</${this.tag('menu-item')}>`;
|
|
637
649
|
}
|
|
638
650
|
if (one === 'previous') {
|
|
@@ -679,6 +691,9 @@ let HelixHeadlessVideo = class HelixHeadlessVideo extends HelixElement {
|
|
|
679
691
|
}
|
|
680
692
|
renderBar() {
|
|
681
693
|
const done = this.knownDuration > 0 ? this.position / this.knownDuration : 0;
|
|
694
|
+
const progress = `--video-progress: ${done}`;
|
|
695
|
+
const level = `--video-level: ${this.silent ? 0 : this.loudness}`;
|
|
696
|
+
const { fullscreenLabel, muteLabel, seekLabel, volumeLabel } = this;
|
|
682
697
|
return html `<div part="controls">
|
|
683
698
|
<button
|
|
684
699
|
part="play"
|
|
@@ -705,19 +720,19 @@ let HelixHeadlessVideo = class HelixHeadlessVideo extends HelixElement {
|
|
|
705
720
|
max=${Number.isFinite(this.knownDuration) && this.knownDuration > 0 ? this.knownDuration : 0}
|
|
706
721
|
step="0.01"
|
|
707
722
|
.value=${String(this.position)}
|
|
708
|
-
aria-label=${
|
|
709
|
-
aria-valuetext=${
|
|
723
|
+
aria-label=${seekLabel}
|
|
724
|
+
aria-valuetext=${formatWords(this, 'timeLabel', {
|
|
710
725
|
duration: clock(this.knownDuration),
|
|
711
726
|
position: clock(this.position),
|
|
712
727
|
})}
|
|
713
|
-
style=${
|
|
728
|
+
style=${progress}
|
|
714
729
|
@input=${this.takeScrub}
|
|
715
730
|
/>
|
|
716
731
|
<span part="sound">
|
|
717
732
|
<button
|
|
718
733
|
part="mute"
|
|
719
734
|
type="button"
|
|
720
|
-
aria-label=${
|
|
735
|
+
aria-label=${muteLabel}
|
|
721
736
|
aria-pressed=${this.silent ? 'true' : 'false'}
|
|
722
737
|
@click=${() => {
|
|
723
738
|
const video = this.video;
|
|
@@ -737,11 +752,11 @@ let HelixHeadlessVideo = class HelixHeadlessVideo extends HelixElement {
|
|
|
737
752
|
max="1"
|
|
738
753
|
step="0.05"
|
|
739
754
|
.value=${String(this.silent ? 0 : this.loudness)}
|
|
740
|
-
aria-label=${
|
|
741
|
-
aria-valuetext=${
|
|
755
|
+
aria-label=${volumeLabel}
|
|
756
|
+
aria-valuetext=${formatWords(this, 'percentLabel', {
|
|
742
757
|
percent: Math.round((this.silent ? 0 : this.loudness) * 100),
|
|
743
758
|
})}
|
|
744
|
-
style=${
|
|
759
|
+
style=${level}
|
|
745
760
|
@input=${this.takeVolume}
|
|
746
761
|
/>
|
|
747
762
|
</span>
|
|
@@ -771,7 +786,7 @@ let HelixHeadlessVideo = class HelixHeadlessVideo extends HelixElement {
|
|
|
771
786
|
<button
|
|
772
787
|
part="fullscreen"
|
|
773
788
|
type="button"
|
|
774
|
-
aria-label=${
|
|
789
|
+
aria-label=${fullscreenLabel}
|
|
775
790
|
aria-pressed=${this.full ? 'true' : 'false'}
|
|
776
791
|
@click=${() => void this.fullscreen.toggle()}
|
|
777
792
|
>
|
|
@@ -885,9 +900,11 @@ __decorate([
|
|
|
885
900
|
property({ reflect: true, type: Boolean })
|
|
886
901
|
], HelixHeadlessVideo.prototype, "autoplay", void 0);
|
|
887
902
|
__decorate([
|
|
903
|
+
words,
|
|
888
904
|
property({ attribute: 'captions-label' })
|
|
889
905
|
], HelixHeadlessVideo.prototype, "captionsLabel", void 0);
|
|
890
906
|
__decorate([
|
|
907
|
+
words,
|
|
891
908
|
property({ attribute: 'captions-off-label' })
|
|
892
909
|
], HelixHeadlessVideo.prototype, "captionsOffLabel", void 0);
|
|
893
910
|
__decorate([
|
|
@@ -906,18 +923,22 @@ __decorate([
|
|
|
906
923
|
property({ attribute: 'disableremoteplayback', reflect: true, type: Boolean })
|
|
907
924
|
], HelixHeadlessVideo.prototype, "disableRemotePlayback", void 0);
|
|
908
925
|
__decorate([
|
|
926
|
+
words,
|
|
909
927
|
property({ attribute: 'download-label' })
|
|
910
928
|
], HelixHeadlessVideo.prototype, "downloadLabel", void 0);
|
|
911
929
|
__decorate([
|
|
930
|
+
words,
|
|
912
931
|
property({ attribute: 'error-label' })
|
|
913
932
|
], HelixHeadlessVideo.prototype, "errorLabel", void 0);
|
|
914
933
|
__decorate([
|
|
915
934
|
property({ attribute: 'extra-controls' })
|
|
916
935
|
], HelixHeadlessVideo.prototype, "extraControls", void 0);
|
|
917
936
|
__decorate([
|
|
937
|
+
words,
|
|
918
938
|
property({ attribute: 'forward-label' })
|
|
919
939
|
], HelixHeadlessVideo.prototype, "forwardLabel", void 0);
|
|
920
940
|
__decorate([
|
|
941
|
+
words,
|
|
921
942
|
property({ attribute: 'fullscreen-label' })
|
|
922
943
|
], HelixHeadlessVideo.prototype, "fullscreenLabel", void 0);
|
|
923
944
|
__decorate([
|
|
@@ -927,36 +948,45 @@ __decorate([
|
|
|
927
948
|
property()
|
|
928
949
|
], HelixHeadlessVideo.prototype, "label", void 0);
|
|
929
950
|
__decorate([
|
|
951
|
+
words,
|
|
930
952
|
property({ attribute: 'loading-label' })
|
|
931
953
|
], HelixHeadlessVideo.prototype, "loadingLabel", void 0);
|
|
932
954
|
__decorate([
|
|
933
955
|
property({ reflect: true, type: Boolean })
|
|
934
956
|
], HelixHeadlessVideo.prototype, "loop", void 0);
|
|
935
957
|
__decorate([
|
|
958
|
+
words,
|
|
936
959
|
property({ attribute: 'more-label' })
|
|
937
960
|
], HelixHeadlessVideo.prototype, "moreLabel", void 0);
|
|
938
961
|
__decorate([
|
|
962
|
+
words,
|
|
939
963
|
property({ attribute: 'mute-label' })
|
|
940
964
|
], HelixHeadlessVideo.prototype, "muteLabel", void 0);
|
|
941
965
|
__decorate([
|
|
966
|
+
words,
|
|
942
967
|
property({ attribute: 'next-label' })
|
|
943
968
|
], HelixHeadlessVideo.prototype, "nextLabel", void 0);
|
|
944
969
|
__decorate([
|
|
945
970
|
property({ attribute: 'overflow-controls' })
|
|
946
971
|
], HelixHeadlessVideo.prototype, "overflowControls", void 0);
|
|
947
972
|
__decorate([
|
|
973
|
+
words,
|
|
948
974
|
property({ attribute: 'pause-label' })
|
|
949
975
|
], HelixHeadlessVideo.prototype, "pauseLabel", void 0);
|
|
950
976
|
__decorate([
|
|
977
|
+
words,
|
|
951
978
|
property({ attribute: 'percent-label' })
|
|
952
979
|
], HelixHeadlessVideo.prototype, "percentLabel", void 0);
|
|
953
980
|
__decorate([
|
|
981
|
+
words,
|
|
954
982
|
property({ attribute: 'pip-label' })
|
|
955
983
|
], HelixHeadlessVideo.prototype, "pipLabel", void 0);
|
|
956
984
|
__decorate([
|
|
985
|
+
words,
|
|
957
986
|
property({ attribute: 'player-label' })
|
|
958
987
|
], HelixHeadlessVideo.prototype, "playerLabel", void 0);
|
|
959
988
|
__decorate([
|
|
989
|
+
words,
|
|
960
990
|
property({ attribute: 'play-label' })
|
|
961
991
|
], HelixHeadlessVideo.prototype, "playLabel", void 0);
|
|
962
992
|
__decorate([
|
|
@@ -969,18 +999,23 @@ __decorate([
|
|
|
969
999
|
property()
|
|
970
1000
|
], HelixHeadlessVideo.prototype, "preload", void 0);
|
|
971
1001
|
__decorate([
|
|
1002
|
+
words,
|
|
972
1003
|
property({ attribute: 'previous-label' })
|
|
973
1004
|
], HelixHeadlessVideo.prototype, "previousLabel", void 0);
|
|
974
1005
|
__decorate([
|
|
1006
|
+
words,
|
|
975
1007
|
property({ attribute: 'remote-label' })
|
|
976
1008
|
], HelixHeadlessVideo.prototype, "remoteLabel", void 0);
|
|
977
1009
|
__decorate([
|
|
1010
|
+
words,
|
|
978
1011
|
property({ attribute: 'rewind-label' })
|
|
979
1012
|
], HelixHeadlessVideo.prototype, "rewindLabel", void 0);
|
|
980
1013
|
__decorate([
|
|
1014
|
+
words,
|
|
981
1015
|
property({ attribute: 'seek-label' })
|
|
982
1016
|
], HelixHeadlessVideo.prototype, "seekLabel", void 0);
|
|
983
1017
|
__decorate([
|
|
1018
|
+
words,
|
|
984
1019
|
property({ attribute: 'speed-label' })
|
|
985
1020
|
], HelixHeadlessVideo.prototype, "speedLabel", void 0);
|
|
986
1021
|
__decorate([
|
|
@@ -993,12 +1028,15 @@ __decorate([
|
|
|
993
1028
|
property({ attribute: 'start-control' })
|
|
994
1029
|
], HelixHeadlessVideo.prototype, "startControl", void 0);
|
|
995
1030
|
__decorate([
|
|
1031
|
+
words,
|
|
996
1032
|
property({ attribute: 'subtitles-label' })
|
|
997
1033
|
], HelixHeadlessVideo.prototype, "subtitlesLabel", void 0);
|
|
998
1034
|
__decorate([
|
|
1035
|
+
words,
|
|
999
1036
|
property({ attribute: 'time-label' })
|
|
1000
1037
|
], HelixHeadlessVideo.prototype, "timeLabel", void 0);
|
|
1001
1038
|
__decorate([
|
|
1039
|
+
words,
|
|
1002
1040
|
property({ attribute: 'volume-label' })
|
|
1003
1041
|
], HelixHeadlessVideo.prototype, "volumeLabel", void 0);
|
|
1004
1042
|
__decorate([
|
|
@@ -1010,6 +1048,9 @@ __decorate([
|
|
|
1010
1048
|
__decorate([
|
|
1011
1049
|
state()
|
|
1012
1050
|
], HelixHeadlessVideo.prototype, "playing", void 0);
|
|
1051
|
+
__decorate([
|
|
1052
|
+
state()
|
|
1053
|
+
], HelixHeadlessVideo.prototype, "finished", void 0);
|
|
1013
1054
|
__decorate([
|
|
1014
1055
|
state()
|
|
1015
1056
|
], HelixHeadlessVideo.prototype, "position", void 0);
|
|
@@ -43,6 +43,11 @@ import '../../menu/index.js';
|
|
|
43
43
|
* @csspart trigger - The button that opens the menu.
|
|
44
44
|
*/
|
|
45
45
|
export declare class HelixHeadlessVideoPlaylistMenu extends HelixElement {
|
|
46
|
+
/**
|
|
47
|
+
* The key this part's words are registered under, its styled tag:
|
|
48
|
+
* `registerWords('de', { 'helix-video-playlist-menu': { label: 'Folgen' } })`.
|
|
49
|
+
*/
|
|
50
|
+
static words: string;
|
|
46
51
|
/**
|
|
47
52
|
* The name of the menu and its trigger, read by screen readers.
|
|
48
53
|
*
|
|
@@ -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 { closestInstance, customElement, drawIcon, HelixElement, HelixSelectEvent, } from '@fusion.dev/helix-core';
|
|
7
|
+
import { closestInstance, customElement, drawIcon, HelixElement, HelixSelectEvent, words, } from '@fusion.dev/helix-core';
|
|
8
8
|
import { list } from '@fusion.dev/helix-icons';
|
|
9
9
|
import { nothing } from 'lit';
|
|
10
10
|
import { property, state } from 'lit/decorators.js';
|
|
@@ -36,6 +36,7 @@ let HelixHeadlessVideoPlaylistMenu = class HelixHeadlessVideoPlaylistMenu extend
|
|
|
36
36
|
this.dispatchEvent(new HelixSelectEvent({ value }));
|
|
37
37
|
};
|
|
38
38
|
}
|
|
39
|
+
static { this.words = 'helix-video-playlist-menu'; }
|
|
39
40
|
connectedCallback() {
|
|
40
41
|
super.connectedCallback();
|
|
41
42
|
this.updateComplete.then(() => this.watch());
|
|
@@ -108,6 +109,7 @@ let HelixHeadlessVideoPlaylistMenu = class HelixHeadlessVideoPlaylistMenu extend
|
|
|
108
109
|
}
|
|
109
110
|
};
|
|
110
111
|
__decorate([
|
|
112
|
+
words,
|
|
111
113
|
property()
|
|
112
114
|
], HelixHeadlessVideoPlaylistMenu.prototype, "label", void 0);
|
|
113
115
|
__decorate([
|
|
@@ -53,6 +53,11 @@ declare const HelixHeadlessVideoPlaylist_base: (new (...args: any[]) => import("
|
|
|
53
53
|
* @csspart player - The region that holds the player.
|
|
54
54
|
*/
|
|
55
55
|
export declare class HelixHeadlessVideoPlaylist extends HelixHeadlessVideoPlaylist_base {
|
|
56
|
+
/**
|
|
57
|
+
* The key this family's words are registered under, its styled tag:
|
|
58
|
+
* `registerWords('de', { 'helix-video-playlist': { label: 'Wiedergabeliste' } })`.
|
|
59
|
+
*/
|
|
60
|
+
static words: string;
|
|
56
61
|
/**
|
|
57
62
|
* The list's name, read by screen readers.
|
|
58
63
|
*/
|
|
@@ -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, HelixEndEvent, MixinControllerActive, } from '@fusion.dev/helix-core';
|
|
7
|
+
import { customElement, HelixElement, HelixEndEvent, MixinControllerActive, words, } from '@fusion.dev/helix-core';
|
|
8
8
|
import { html } from 'lit';
|
|
9
9
|
import { property } from 'lit/decorators.js';
|
|
10
10
|
import { HelixHeadlessVideoPlaylistItem } from '../item/video-playlist-item.js';
|
|
@@ -44,6 +44,7 @@ let HelixHeadlessVideoPlaylist = class HelixHeadlessVideoPlaylist extends MixinC
|
|
|
44
44
|
this.step(1);
|
|
45
45
|
};
|
|
46
46
|
}
|
|
47
|
+
static { this.words = 'helix-video-playlist'; }
|
|
47
48
|
get items() {
|
|
48
49
|
return [...this.querySelectorAll('*')].filter((one) => one instanceof HelixHeadlessVideoPlaylistItem && one.value !== '');
|
|
49
50
|
}
|
|
@@ -139,6 +140,7 @@ let HelixHeadlessVideoPlaylist = class HelixHeadlessVideoPlaylist extends MixinC
|
|
|
139
140
|
}
|
|
140
141
|
};
|
|
141
142
|
__decorate([
|
|
143
|
+
words,
|
|
142
144
|
property()
|
|
143
145
|
], HelixHeadlessVideoPlaylist.prototype, "label", void 0);
|
|
144
146
|
__decorate([
|
|
@@ -94,7 +94,9 @@ export interface VirtualListRange {
|
|
|
94
94
|
* **Row height.** Rows are placed by `estimate` until they are drawn. Then the
|
|
95
95
|
* list reads the drawn rows' height once and places every row by it, so a
|
|
96
96
|
* wrong estimate still reaches the last item. Set `measured` for rows of
|
|
97
|
-
* different heights.
|
|
97
|
+
* different heights. Once the list draws rows of different heights, such as
|
|
98
|
+
* rows that wrap on a narrow screen, it places each row by its own height
|
|
99
|
+
* whether `measured` is set or not.
|
|
98
100
|
*
|
|
99
101
|
* The list follows its source. A new `items` array, an edit to the script's
|
|
100
102
|
* text, or a script replaced under the same id draws the new rows. A row that
|
|
@@ -123,6 +125,11 @@ export interface VirtualListRange {
|
|
|
123
125
|
* @csspart viewport - The scrolling box. On this tier, it needs only a block size.
|
|
124
126
|
*/
|
|
125
127
|
export declare class HelixHeadlessVirtualList extends HelixElement {
|
|
128
|
+
/**
|
|
129
|
+
* The key this family's words are registered under, its styled tag:
|
|
130
|
+
* `registerWords('de', { 'helix-virtual-list': { loadingLabel: 'Weitere werden geladen' } })`.
|
|
131
|
+
*/
|
|
132
|
+
static words: string;
|
|
126
133
|
/**
|
|
127
134
|
* How many items a line holds. One, the default, is a list; more lays the
|
|
128
135
|
* items out as a grid of that many equal columns, windowed a line at a
|
|
@@ -176,7 +183,8 @@ export declare class HelixHeadlessVirtualList extends HelixElement {
|
|
|
176
183
|
/**
|
|
177
184
|
* Places each row by its own measured height. Without it, rows are placed
|
|
178
185
|
* by one height: `estimate` until rows are drawn, then the drawn rows' height,
|
|
179
|
-
* read once.
|
|
186
|
+
* read once. Rows that come out different heights are placed by their own
|
|
187
|
+
* heights either way.
|
|
180
188
|
*
|
|
181
189
|
* **Off by default, because the straight line is better when it holds.** One
|
|
182
190
|
* height makes offset and index convert by division, which can never
|
|
@@ -393,7 +401,15 @@ export declare class HelixHeadlessVirtualList extends HelixElement {
|
|
|
393
401
|
private stamp;
|
|
394
402
|
/** Fills a drawn row from its item, by `renderItem` or by the template's holes. */
|
|
395
403
|
private fill;
|
|
396
|
-
/**
|
|
404
|
+
/**
|
|
405
|
+
* New elements for item `at`: a `<div>` for `renderItem`, or the template's clone.
|
|
406
|
+
*
|
|
407
|
+
* **Only the template's elements are drawn.** The whitespace around them is
|
|
408
|
+
* text, and `place` takes rows out by their elements, so every text node
|
|
409
|
+
* drawn stayed in the list. Measured on the preview in Chromium: 3,846 nodes
|
|
410
|
+
* after 1,900 rows, and a window move cost 1.9 milliseconds where it had
|
|
411
|
+
* cost 0.34 at the top.
|
|
412
|
+
*/
|
|
397
413
|
private draw;
|
|
398
414
|
/**
|
|
399
415
|
* Puts the windowed rows into the light DOM, and takes the rest out.
|
|
@@ -4,7 +4,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
4
4
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
|
-
import { AriaForwardController, commaList, customElement, elementById,
|
|
7
|
+
import { AriaForwardController, anchorAt, commaList, customElement, elementById, HelixElement, HelixLoadMoreEvent, HelixRangeChangeEvent, inRowOrder, isRtl, pressedOwnControl, rangeAdd, requestValue, searchableById, selectsAll, Typeahead, toggleValue, typesCharacter, VirtualizeController, words, } from '@fusion.dev/helix-core';
|
|
8
8
|
import { html, nothing, render } from 'lit';
|
|
9
9
|
import { property, state } from 'lit/decorators.js';
|
|
10
10
|
import { holdControls, releaseControls } from '../controls.js';
|
|
@@ -98,9 +98,7 @@ let HelixHeadlessVirtualList = class HelixHeadlessVirtualList extends HelixEleme
|
|
|
98
98
|
if (at === undefined) {
|
|
99
99
|
return;
|
|
100
100
|
}
|
|
101
|
-
|
|
102
|
-
if (inner.some((node) => node instanceof HTMLElement &&
|
|
103
|
-
node.matches('a[href], button, input, select, textarea, label'))) {
|
|
101
|
+
if (pressedOwnControl(event, row, 'a[href], button, input, select, textarea, label')) {
|
|
104
102
|
return;
|
|
105
103
|
}
|
|
106
104
|
this.press(at, event.shiftKey && this.selectionMode === 'multiple');
|
|
@@ -120,6 +118,7 @@ let HelixHeadlessVirtualList = class HelixHeadlessVirtualList extends HelixEleme
|
|
|
120
118
|
this.requestUpdate();
|
|
121
119
|
};
|
|
122
120
|
}
|
|
121
|
+
static { this.words = 'helix-virtual-list'; }
|
|
123
122
|
get range() {
|
|
124
123
|
return this.itemsOn(this.virtualize.visible());
|
|
125
124
|
}
|
|
@@ -206,6 +205,7 @@ let HelixHeadlessVirtualList = class HelixHeadlessVirtualList extends HelixEleme
|
|
|
206
205
|
super.updated?.(changed);
|
|
207
206
|
this.virtualize.measure();
|
|
208
207
|
this.place();
|
|
208
|
+
this.virtualize.settle();
|
|
209
209
|
this.report();
|
|
210
210
|
}
|
|
211
211
|
read() {
|
|
@@ -270,8 +270,7 @@ let HelixHeadlessVirtualList = class HelixHeadlessVirtualList extends HelixEleme
|
|
|
270
270
|
const now = commaList(this.value);
|
|
271
271
|
if (extend && mode === 'multiple') {
|
|
272
272
|
const keys = this.keys();
|
|
273
|
-
const
|
|
274
|
-
const range = rangeAdd(now, keys, from, at);
|
|
273
|
+
const range = rangeAdd(now, keys, anchorAt(keys, this.anchor, at).anchor, at);
|
|
275
274
|
if (range) {
|
|
276
275
|
this.choose(this.inOrder(range));
|
|
277
276
|
}
|
|
@@ -285,23 +284,14 @@ let HelixHeadlessVirtualList = class HelixHeadlessVirtualList extends HelixEleme
|
|
|
285
284
|
this.choose(this.inOrder(toggleValue(now, key)));
|
|
286
285
|
}
|
|
287
286
|
inOrder(keys) {
|
|
288
|
-
|
|
289
|
-
const ordered = this.keys().filter((key) => wanted.has(key));
|
|
290
|
-
const placed = new Set(ordered);
|
|
291
|
-
return [...ordered, ...keys.filter((key) => !placed.has(key))].join(',');
|
|
287
|
+
return inRowOrder(keys, this.keys()).join(',');
|
|
292
288
|
}
|
|
293
289
|
choose(next) {
|
|
294
290
|
if (next === this.value) {
|
|
295
291
|
return;
|
|
296
292
|
}
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
this.value = value;
|
|
300
|
-
this.dispatchEvent(new Event('change', { bubbles: true, composed: true }));
|
|
301
|
-
},
|
|
302
|
-
event: (value) => new HelixBeforeChangeEvent({ value }),
|
|
303
|
-
host: this,
|
|
304
|
-
next,
|
|
293
|
+
requestValue(this, next, (value) => {
|
|
294
|
+
this.value = value;
|
|
305
295
|
});
|
|
306
296
|
}
|
|
307
297
|
async focusIndex(index) {
|
|
@@ -366,7 +356,7 @@ let HelixHeadlessVirtualList = class HelixHeadlessVirtualList extends HelixEleme
|
|
|
366
356
|
fragment.append(document.createElement('div'));
|
|
367
357
|
}
|
|
368
358
|
else if (template) {
|
|
369
|
-
fragment.append(template.content.cloneNode(true));
|
|
359
|
+
fragment.append(...template.content.cloneNode(true).children);
|
|
370
360
|
}
|
|
371
361
|
this.fill([...fragment.children], at);
|
|
372
362
|
return fragment;
|
|
@@ -492,6 +482,7 @@ __decorate([
|
|
|
492
482
|
property({ type: Boolean })
|
|
493
483
|
], HelixHeadlessVirtualList.prototype, "loading", void 0);
|
|
494
484
|
__decorate([
|
|
485
|
+
words,
|
|
495
486
|
property({ attribute: 'loading-label' })
|
|
496
487
|
], HelixHeadlessVirtualList.prototype, "loadingLabel", void 0);
|
|
497
488
|
__decorate([
|