@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
|
@@ -39,7 +39,8 @@ declare const HelixHeadlessDrawer_base: (new (...args: any[]) => import("@fusion
|
|
|
39
39
|
* `dismiss-label`, as `Dialog` draws one.
|
|
40
40
|
*
|
|
41
41
|
* The panel's name is `label` when you set it. Otherwise it is the heading in
|
|
42
|
-
* the `header` slot, or the elements an `aria-labelledby` on the host names
|
|
42
|
+
* the `header` slot, or the elements an `aria-labelledby` on the host names,
|
|
43
|
+
* and `fallback-label` where nothing names it.
|
|
43
44
|
*
|
|
44
45
|
* Content stays mounted when the drawer is closed, so it is in the server
|
|
45
46
|
* markup and can animate. A closed `<dialog>` is already out of the tab order
|
|
@@ -87,6 +88,11 @@ declare const HelixHeadlessDrawer_base: (new (...args: any[]) => import("@fusion
|
|
|
87
88
|
* @cssstate snapped - While the panel rests at a snap point that shows less than the whole panel.
|
|
88
89
|
*/
|
|
89
90
|
export declare class HelixHeadlessDrawer extends HelixHeadlessDrawer_base {
|
|
91
|
+
/**
|
|
92
|
+
* The key this family's words are registered under, its styled tag:
|
|
93
|
+
* `registerWords('de', { 'helix-drawer': { dismissLabel: 'Schließen' } })`.
|
|
94
|
+
*/
|
|
95
|
+
static words: string;
|
|
90
96
|
protected readonly commands: CommandController;
|
|
91
97
|
/**
|
|
92
98
|
* Which close requests the browser handles on its own.
|
|
@@ -113,6 +119,11 @@ export declare class HelixHeadlessDrawer extends HelixHeadlessDrawer_base {
|
|
|
113
119
|
* interface.
|
|
114
120
|
*/
|
|
115
121
|
dismissLabel: string;
|
|
122
|
+
/**
|
|
123
|
+
* The panel's name where nothing names it: no `label`, no heading in the
|
|
124
|
+
* `header` slot, and no `aria-labelledby` on the host.
|
|
125
|
+
*/
|
|
126
|
+
fallbackLabel: string;
|
|
116
127
|
/**
|
|
117
128
|
* Accessible name for the panel. When it is empty, the heading in the
|
|
118
129
|
* `header` slot names the panel.
|
|
@@ -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, CommandController, customElement, drawDismiss, drawDismissGlyph, edgeOffset, FocusScopeController, HelixElement, headingsIn, isRtl, lockScroll, MixinControllerOpen, nearest, OpenPhaseController, onUnlessFalse, parseSnapPoints, reflectElements, SwipeController, settleSwipe, snapTravel, swipeAxis, swipeEdge, towardEdge, unlockScroll, } from '@fusion.dev/helix-core';
|
|
7
|
+
import { AriaForwardController, CommandController, customElement, drawDismiss, drawDismissGlyph, edgeOffset, FocusScopeController, HelixElement, headingsIn, isRtl, lockScroll, MixinControllerOpen, nearest, OpenPhaseController, onUnlessFalse, parseSnapPoints, reflectElements, SwipeController, settleSwipe, snapTravel, swipeAxis, swipeEdge, towardEdge, unlockScroll, words, } from '@fusion.dev/helix-core';
|
|
8
8
|
import { html, nothing } from 'lit';
|
|
9
9
|
import { property } from 'lit/decorators.js';
|
|
10
10
|
import { beyondWindow } from '../reveal.js';
|
|
@@ -21,6 +21,7 @@ let HelixHeadlessDrawer = class HelixHeadlessDrawer extends MixinControllerOpen(
|
|
|
21
21
|
});
|
|
22
22
|
this.dismissible = false;
|
|
23
23
|
this.dismissLabel = 'Close';
|
|
24
|
+
this.fallbackLabel = 'Drawer';
|
|
24
25
|
this.label = '';
|
|
25
26
|
this.aria = new AriaForwardController(this, { target: () => this.panel });
|
|
26
27
|
this.modal = true;
|
|
@@ -100,6 +101,7 @@ let HelixHeadlessDrawer = class HelixHeadlessDrawer extends MixinControllerOpen(
|
|
|
100
101
|
};
|
|
101
102
|
this.namedByHeader = false;
|
|
102
103
|
}
|
|
104
|
+
static { this.words = 'helix-drawer'; }
|
|
103
105
|
get returnValue() {
|
|
104
106
|
return this.panel?.returnValue ?? this.returned;
|
|
105
107
|
}
|
|
@@ -236,7 +238,7 @@ let HelixHeadlessDrawer = class HelixHeadlessDrawer extends MixinControllerOpen(
|
|
|
236
238
|
return html `<dialog
|
|
237
239
|
part="panel"
|
|
238
240
|
closedby=${closedBy ?? nothing}
|
|
239
|
-
aria-label=${this.label ||
|
|
241
|
+
aria-label=${this.label || this.fallbackLabel}
|
|
240
242
|
@cancel=${this.handleCancel}
|
|
241
243
|
@click=${this.handleBackdrop}
|
|
242
244
|
@close=${this.handleClose}
|
|
@@ -267,8 +269,13 @@ __decorate([
|
|
|
267
269
|
property({ reflect: true, type: Boolean })
|
|
268
270
|
], HelixHeadlessDrawer.prototype, "dismissible", void 0);
|
|
269
271
|
__decorate([
|
|
272
|
+
words,
|
|
270
273
|
property({ attribute: 'dismiss-label' })
|
|
271
274
|
], HelixHeadlessDrawer.prototype, "dismissLabel", void 0);
|
|
275
|
+
__decorate([
|
|
276
|
+
words,
|
|
277
|
+
property({ attribute: 'fallback-label' })
|
|
278
|
+
], HelixHeadlessDrawer.prototype, "fallbackLabel", void 0);
|
|
272
279
|
__decorate([
|
|
273
280
|
property()
|
|
274
281
|
], HelixHeadlessDrawer.prototype, "label", void 0);
|
|
@@ -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, HelixElement, HelixSelectEvent, slotFilled, } from '@fusion.dev/helix-core';
|
|
7
|
+
import { customElement, deepActiveElement, HelixElement, HelixSelectEvent, slotFilled, slotNamed, } from '@fusion.dev/helix-core';
|
|
8
8
|
import { caretRight } from '@fusion.dev/helix-icons';
|
|
9
9
|
import { html, nothing } from 'lit';
|
|
10
10
|
import { property, state } from 'lit/decorators.js';
|
|
@@ -27,9 +27,8 @@ let HelixHeadlessDrilldownItem = class HelixHeadlessDrilldownItem extends HelixE
|
|
|
27
27
|
this.page = (slot?.assignedElements().length ?? 0) > 0;
|
|
28
28
|
};
|
|
29
29
|
this.readWords = () => {
|
|
30
|
-
|
|
31
|
-
this.
|
|
32
|
-
this.end = slotFilled(slot('end'));
|
|
30
|
+
this.description = slotFilled(slotNamed(this.renderRoot, 'description'));
|
|
31
|
+
this.end = slotFilled(slotNamed(this.renderRoot, 'end'));
|
|
33
32
|
};
|
|
34
33
|
}
|
|
35
34
|
willUpdate(changed) {
|
|
@@ -62,6 +62,11 @@ declare const HelixHeadlessDrilldown_base: (new (...args: any[]) => import("@fus
|
|
|
62
62
|
* @cssstate forward - The last move went into a page.
|
|
63
63
|
*/
|
|
64
64
|
export declare class HelixHeadlessDrilldown extends HelixHeadlessDrilldown_base {
|
|
65
|
+
/**
|
|
66
|
+
* The key this family's words are registered under, its styled tag:
|
|
67
|
+
* `registerWords('de', { 'helix-drilldown': { backLabel: 'Zurück' } })`.
|
|
68
|
+
*/
|
|
69
|
+
static words: string;
|
|
65
70
|
/**
|
|
66
71
|
* The name of the top page's menu, read by screen readers. A page below it is
|
|
67
72
|
* named by its title.
|
|
@@ -4,7 +4,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
4
4
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
|
-
import { AriaForwardController, customElement, DrilldownController, HelixElement, inlineStep, KeyboardNavigationController, keyClaimed, MixinCollection, slottedWords, typeaheadByWords, } from '@fusion.dev/helix-core';
|
|
7
|
+
import { AriaForwardController, customElement, DrilldownController, HelixElement, inlineStep, KeyboardNavigationController, keyClaimed, MixinCollection, slottedWords, typeaheadByWords, words, } from '@fusion.dev/helix-core';
|
|
8
8
|
import { caretLeft } from '@fusion.dev/helix-icons';
|
|
9
9
|
import { html, nothing } from 'lit';
|
|
10
10
|
import { property, state } from 'lit/decorators.js';
|
|
@@ -85,6 +85,7 @@ let HelixHeadlessDrilldown = class HelixHeadlessDrilldown extends MixinCollectio
|
|
|
85
85
|
}
|
|
86
86
|
};
|
|
87
87
|
}
|
|
88
|
+
static { this.words = 'helix-drilldown'; }
|
|
88
89
|
get items() {
|
|
89
90
|
return this.drilldown.rows;
|
|
90
91
|
}
|
|
@@ -198,9 +199,11 @@ let HelixHeadlessDrilldown = class HelixHeadlessDrilldown extends MixinCollectio
|
|
|
198
199
|
}
|
|
199
200
|
};
|
|
200
201
|
__decorate([
|
|
202
|
+
words,
|
|
201
203
|
property()
|
|
202
204
|
], HelixHeadlessDrilldown.prototype, "label", void 0);
|
|
203
205
|
__decorate([
|
|
206
|
+
words,
|
|
204
207
|
property({ attribute: 'back-label' })
|
|
205
208
|
], HelixHeadlessDrilldown.prototype, "backLabel", void 0);
|
|
206
209
|
__decorate([
|
|
@@ -5,6 +5,7 @@ registerElementEvents({
|
|
|
5
5
|
'helix-headless-app-header': ['helix-scrolled'],
|
|
6
6
|
'helix-headless-avatar': ['error', 'load'],
|
|
7
7
|
'helix-headless-button': ['helix-press'],
|
|
8
|
+
'helix-headless-button-group': ['change', 'helix-before-change'],
|
|
8
9
|
'helix-headless-callout': ['helix-dismiss'],
|
|
9
10
|
'helix-headless-canvas': [
|
|
10
11
|
'helix-before-move',
|
|
@@ -65,6 +66,7 @@ registerElementEvents({
|
|
|
65
66
|
'helix-headless-copy-button': ['helix-copy', 'helix-copy-error', 'helix-press'],
|
|
66
67
|
'helix-headless-data-table': [
|
|
67
68
|
'helix-activate',
|
|
69
|
+
'helix-before-reorder',
|
|
68
70
|
'helix-expand',
|
|
69
71
|
'helix-filter',
|
|
70
72
|
'helix-filtered',
|
|
@@ -130,13 +132,21 @@ registerElementEvents({
|
|
|
130
132
|
'helix-before-open',
|
|
131
133
|
'toggle',
|
|
132
134
|
],
|
|
133
|
-
'helix-headless-list': [
|
|
135
|
+
'helix-headless-list': [
|
|
136
|
+
'change',
|
|
137
|
+
'helix-action',
|
|
138
|
+
'helix-before-change',
|
|
139
|
+
'helix-before-reorder',
|
|
140
|
+
'helix-reorder',
|
|
141
|
+
],
|
|
134
142
|
'helix-headless-list-item': ['helix-action'],
|
|
135
143
|
'helix-headless-listbox': [
|
|
136
144
|
'change',
|
|
137
145
|
'helix-before-change',
|
|
146
|
+
'helix-before-reorder',
|
|
138
147
|
'helix-filter',
|
|
139
148
|
'helix-load-more',
|
|
149
|
+
'helix-reorder',
|
|
140
150
|
'input',
|
|
141
151
|
],
|
|
142
152
|
'helix-headless-map': [
|
|
@@ -228,7 +238,14 @@ registerElementEvents({
|
|
|
228
238
|
'helix-headless-steps': ['helix-activate', 'helix-before-activate', 'helix-select'],
|
|
229
239
|
'helix-headless-switch': ['change', 'helix-before-toggle', 'input'],
|
|
230
240
|
'helix-headless-tab': ['helix-select'],
|
|
231
|
-
'helix-headless-table': [
|
|
241
|
+
'helix-headless-table': [
|
|
242
|
+
'helix-before-reorder',
|
|
243
|
+
'helix-reorder',
|
|
244
|
+
'helix-select',
|
|
245
|
+
'helix-selected',
|
|
246
|
+
'helix-sort',
|
|
247
|
+
'helix-sorted',
|
|
248
|
+
],
|
|
232
249
|
'helix-headless-table-column': ['helix-before-resize', 'helix-resized'],
|
|
233
250
|
'helix-headless-tabs': ['helix-activate', 'helix-before-activate', 'helix-select'],
|
|
234
251
|
'helix-headless-tag': ['helix-dismiss'],
|
|
@@ -259,7 +276,13 @@ registerElementEvents({
|
|
|
259
276
|
'toggle',
|
|
260
277
|
],
|
|
261
278
|
'helix-headless-tour-stop': ['helix-tour-ask'],
|
|
262
|
-
'helix-headless-tree': [
|
|
279
|
+
'helix-headless-tree': [
|
|
280
|
+
'helix-activate',
|
|
281
|
+
'helix-before-activate',
|
|
282
|
+
'helix-before-reorder',
|
|
283
|
+
'helix-reorder',
|
|
284
|
+
'helix-select',
|
|
285
|
+
],
|
|
263
286
|
'helix-headless-tree-item': [
|
|
264
287
|
'helix-before-close',
|
|
265
288
|
'helix-before-open',
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ArrivalController, HelixElement } from '@fusion.dev/helix-core';
|
|
2
|
-
import { type TemplateResult } from 'lit';
|
|
2
|
+
import { type PropertyValues, type TemplateResult } from 'lit';
|
|
3
3
|
/**
|
|
4
4
|
* @summary A message that a region has nothing in it, and the next step to take.
|
|
5
5
|
*
|
|
@@ -24,6 +24,13 @@ import { type TemplateResult } from 'lit';
|
|
|
24
24
|
* rendering from data or on a server gets a heading a reader finds in the
|
|
25
25
|
* outline without writing the element. A heading slotted in replaces it.
|
|
26
26
|
*
|
|
27
|
+
* **Whatever is slotted into `heading` is read as a heading.** An element that
|
|
28
|
+
* is no heading, such as a `<span>` or a `<p>`, is set inside the `heading`
|
|
29
|
+
* part at `heading-level`, so a screen reader still finds it in the outline.
|
|
30
|
+
* A heading element, or an element holding one, keeps its own level. A server
|
|
31
|
+
* cannot see the slotted element, so a served `<span>` becomes a heading once
|
|
32
|
+
* the script runs.
|
|
33
|
+
*
|
|
27
34
|
* @since 0.1.0
|
|
28
35
|
* @status stable
|
|
29
36
|
* @category feedback
|
|
@@ -32,10 +39,10 @@ import { type TemplateResult } from 'lit';
|
|
|
32
39
|
*
|
|
33
40
|
* @slot - The message: why the region is empty, and what to do about it.
|
|
34
41
|
* @slot actions - The action that would put something in the region.
|
|
35
|
-
* @slot heading - The heading, which names what is missing.
|
|
42
|
+
* @slot heading - The heading, which names what is missing. A heading element, such as an `<h3>`, keeps its level; any other element is read as a heading at `heading-level`. Replaces the one `heading` draws.
|
|
36
43
|
* @slot icon - An icon above the heading.
|
|
37
44
|
*
|
|
38
|
-
* @csspart heading - The heading
|
|
45
|
+
* @csspart heading - The heading at `heading-level`: the one `heading` draws while nothing is slotted into `heading`, or the one around a slotted element that is no heading.
|
|
39
46
|
* @csspart live - A copy of the heading and the message, in a live region that screen readers announce when the view appears. Visually hidden in the styled tier.
|
|
40
47
|
*/
|
|
41
48
|
export declare class HelixHeadlessEmpty extends HelixElement {
|
|
@@ -61,6 +68,13 @@ export declare class HelixHeadlessEmpty extends HelixElement {
|
|
|
61
68
|
* has nothing to announce because nothing changed.
|
|
62
69
|
*/
|
|
63
70
|
noAnnounce: boolean;
|
|
71
|
+
/**
|
|
72
|
+
* Whether the `heading` slot holds elements and none of them is or holds a
|
|
73
|
+
* heading, read from the children before each render.
|
|
74
|
+
*/
|
|
75
|
+
private looseHeading;
|
|
76
|
+
protected willUpdate(changed: PropertyValues): void;
|
|
77
|
+
protected firstUpdated(changed: PropertyValues): void;
|
|
64
78
|
protected readonly arrival: ArrivalController;
|
|
65
79
|
/**
|
|
66
80
|
* The `heading` slot, with the heading `heading` draws as its fallback, so
|
|
@@ -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 { ArrivalController, customElement, HelixElement, headingLevel, slottedWords, } from '@fusion.dev/helix-core';
|
|
7
|
+
import { ArrivalController, customElement, HelixElement, headingIn, headingLevel, slottedWords, } from '@fusion.dev/helix-core';
|
|
8
8
|
import { html, nothing } from 'lit';
|
|
9
9
|
import { property } from 'lit/decorators.js';
|
|
10
10
|
let HelixHeadlessEmpty = class HelixHeadlessEmpty extends HelixElement {
|
|
@@ -12,6 +12,7 @@ let HelixHeadlessEmpty = class HelixHeadlessEmpty extends HelixElement {
|
|
|
12
12
|
super(...arguments);
|
|
13
13
|
this.heading = '';
|
|
14
14
|
this.noAnnounce = false;
|
|
15
|
+
this.looseHeading = false;
|
|
15
16
|
this.arrival = new ArrivalController(this, {
|
|
16
17
|
arriving: () => !this.serverRendered && document.readyState === 'complete',
|
|
17
18
|
text: () => [slottedWords(this, ['heading']) || this.heading.trim(), slottedWords(this, [''])]
|
|
@@ -19,17 +20,40 @@ let HelixHeadlessEmpty = class HelixHeadlessEmpty extends HelixElement {
|
|
|
19
20
|
.join(' '),
|
|
20
21
|
});
|
|
21
22
|
}
|
|
23
|
+
willUpdate(changed) {
|
|
24
|
+
super.willUpdate(changed);
|
|
25
|
+
if (this.childrenKnown) {
|
|
26
|
+
const slotted = this.knownChildren.filter((child) => child.slot === 'heading');
|
|
27
|
+
this.looseHeading = slotted.length > 0 && headingIn(slotted) === null;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
firstUpdated(changed) {
|
|
31
|
+
super.firstUpdated(changed);
|
|
32
|
+
this.finishHydration();
|
|
33
|
+
}
|
|
22
34
|
renderHeading(hidden) {
|
|
23
|
-
|
|
24
|
-
|
|
35
|
+
const level = headingLevel(this.headingLevel);
|
|
36
|
+
const slot = html `<slot
|
|
37
|
+
aria-hidden=${hidden && !this.looseHeading ? 'true' : nothing}
|
|
25
38
|
name="heading"
|
|
26
|
-
@slotchange=${() =>
|
|
39
|
+
@slotchange=${() => {
|
|
40
|
+
this.arrival.say();
|
|
41
|
+
this.requestUpdate();
|
|
42
|
+
}}
|
|
27
43
|
>${this.heading.trim()
|
|
28
|
-
? html `<div aria-level=${
|
|
44
|
+
? html `<div aria-level=${level} part="heading" role="heading">
|
|
29
45
|
${this.heading}
|
|
30
46
|
</div>`
|
|
31
47
|
: nothing}</slot
|
|
32
48
|
>`;
|
|
49
|
+
return this.looseHeading
|
|
50
|
+
? html `<div
|
|
51
|
+
aria-hidden=${hidden ? 'true' : nothing}
|
|
52
|
+
aria-level=${level}
|
|
53
|
+
part="heading"
|
|
54
|
+
role="heading"
|
|
55
|
+
>${slot}</div>`
|
|
56
|
+
: slot;
|
|
33
57
|
}
|
|
34
58
|
render() {
|
|
35
59
|
const say = () => this.arrival.say();
|
|
@@ -95,6 +95,11 @@ declare const HelixHeadlessFileInput_base: (new (...args: any[]) => import("@fus
|
|
|
95
95
|
* @cssstate invalid - The control has an error to show, from the browser's validation or from your `feedback`.
|
|
96
96
|
*/
|
|
97
97
|
export declare class HelixHeadlessFileInput extends HelixHeadlessFileInput_base {
|
|
98
|
+
/**
|
|
99
|
+
* The key this family's words are registered under, its styled tag:
|
|
100
|
+
* `registerWords('de', { 'helix-file-input': { triggerLabel: 'Dateien auswählen' } })`.
|
|
101
|
+
*/
|
|
102
|
+
static words: string;
|
|
98
103
|
protected readonly aria: AriaForwardController;
|
|
99
104
|
/**
|
|
100
105
|
* Which files the picker offers and a drop takes, as a native `accept` list.
|
|
@@ -108,6 +113,11 @@ export declare class HelixHeadlessFileInput extends HelixHeadlessFileInput_base
|
|
|
108
113
|
* `{count}` filled in.
|
|
109
114
|
*/
|
|
110
115
|
addedText: string;
|
|
116
|
+
/**
|
|
117
|
+
* A file's size under a kilobyte. `{count}` is how many bytes, written in
|
|
118
|
+
* the locale, and each language writes the forms it has.
|
|
119
|
+
*/
|
|
120
|
+
bytesLabel: string;
|
|
111
121
|
/**
|
|
112
122
|
* Which camera or microphone a mobile picker should offer, if any.
|
|
113
123
|
*/
|
|
@@ -118,9 +128,9 @@ export declare class HelixHeadlessFileInput extends HelixHeadlessFileInput_base
|
|
|
118
128
|
*/
|
|
119
129
|
directory: boolean;
|
|
120
130
|
/**
|
|
121
|
-
*
|
|
122
|
-
*
|
|
123
|
-
*
|
|
131
|
+
* The locale the words, the sizes, and the numbers and lists in sentences
|
|
132
|
+
* are in, as a BCP 47 tag such as `pl`. Empty reads the nearest `lang`, then
|
|
133
|
+
* the browser's language.
|
|
124
134
|
*/
|
|
125
135
|
locale: string;
|
|
126
136
|
/**
|
|
@@ -219,6 +229,11 @@ export declare class HelixHeadlessFileInput extends HelixHeadlessFileInput_base
|
|
|
219
229
|
* count is written as the language writes a number.
|
|
220
230
|
*/
|
|
221
231
|
private listed;
|
|
232
|
+
/**
|
|
233
|
+
* A name about one file: `{name}` filled in, or the file's name after a
|
|
234
|
+
* page's label that has no `{name}`.
|
|
235
|
+
*/
|
|
236
|
+
private aboutFile;
|
|
222
237
|
/** The element slotted into `remove-icon`, one copy per row's remove button. */
|
|
223
238
|
private readonly removeIcon;
|
|
224
239
|
private readonly handleRemoveIcon;
|
|
@@ -4,7 +4,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
4
4
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
|
-
import { AriaForwardController, customElement, drawIcon, drawStatus,
|
|
7
|
+
import { AriaForwardController, customElement, drawIcon, drawStatus, formatWords, HelixBeforeChangeEvent, HelixFormElement, HelixRejectEvent, labelWith, MixinField, requestChange, restoreValue, SlottedGlyph, StatusController, words, wordsLocale, } from '@fusion.dev/helix-core';
|
|
8
8
|
import { trash } from '@fusion.dev/helix-icons';
|
|
9
9
|
import { nothing } from 'lit';
|
|
10
10
|
import { property, state } from 'lit/decorators.js';
|
|
@@ -12,20 +12,19 @@ import { html } from 'lit/static-html.js';
|
|
|
12
12
|
import { screenFiles } from '../screen.js';
|
|
13
13
|
import { barOf, saysStatus } from '../status.js';
|
|
14
14
|
import '../../tag/index.js';
|
|
15
|
-
const
|
|
16
|
-
const
|
|
17
|
-
const units = ['bytes', 'KB', 'MB', 'GB', 'TB'];
|
|
15
|
+
const size = (bytes, locale, inBytes) => {
|
|
16
|
+
const units = ['', 'KB', 'MB', 'GB', 'TB'];
|
|
18
17
|
let value = bytes;
|
|
19
18
|
let step = 0;
|
|
20
19
|
while (value >= 1024 && step < units.length - 1) {
|
|
21
20
|
value /= 1024;
|
|
22
21
|
step += 1;
|
|
23
22
|
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}
|
|
27
|
-
const
|
|
28
|
-
return `${written} ${
|
|
23
|
+
if (step === 0) {
|
|
24
|
+
return inBytes(value);
|
|
25
|
+
}
|
|
26
|
+
const written = new Intl.NumberFormat(locale || undefined, { maximumFractionDigits: 1 }).format(value);
|
|
27
|
+
return `${written} ${units[step]}`;
|
|
29
28
|
};
|
|
30
29
|
const kind = (file) => {
|
|
31
30
|
const extension = /\.([a-z0-9]{1,6})$/i.exec(file.name)?.[1];
|
|
@@ -44,6 +43,7 @@ let HelixHeadlessFileInput = class HelixHeadlessFileInput extends MixinField(Hel
|
|
|
44
43
|
});
|
|
45
44
|
this.accept = '';
|
|
46
45
|
this.addedText = 'Added: {names}';
|
|
46
|
+
this.bytesLabel = '{count, plural, one {# byte} other {# bytes}}';
|
|
47
47
|
this.directory = false;
|
|
48
48
|
this.locale = '';
|
|
49
49
|
this.multiple = false;
|
|
@@ -108,6 +108,7 @@ let HelixHeadlessFileInput = class HelixHeadlessFileInput extends MixinField(Hel
|
|
|
108
108
|
});
|
|
109
109
|
};
|
|
110
110
|
}
|
|
111
|
+
static { this.words = 'helix-file-input'; }
|
|
111
112
|
setFileStatus(file, status) {
|
|
112
113
|
const was = this.statuses.get(file);
|
|
113
114
|
if (status) {
|
|
@@ -151,9 +152,9 @@ let HelixHeadlessFileInput = class HelixHeadlessFileInput extends MixinField(Hel
|
|
|
151
152
|
this.dispatchEvent(new HelixRejectEvent({ files: refused }));
|
|
152
153
|
}
|
|
153
154
|
const words = [
|
|
154
|
-
applied && !picked && added.length > 0 ? this.listed(
|
|
155
|
+
applied && !picked && added.length > 0 ? this.listed('addedText', added) : '',
|
|
155
156
|
refused.length > 0
|
|
156
|
-
? this.listed(
|
|
157
|
+
? this.listed('rejectedText', refused.map((one) => one.file))
|
|
157
158
|
: '',
|
|
158
159
|
].filter((one) => one !== '');
|
|
159
160
|
if (words.length > 0) {
|
|
@@ -161,11 +162,16 @@ let HelixHeadlessFileInput = class HelixHeadlessFileInput extends MixinField(Hel
|
|
|
161
162
|
}
|
|
162
163
|
}
|
|
163
164
|
listed(sentence, files) {
|
|
164
|
-
return
|
|
165
|
-
count:
|
|
166
|
-
names: new Intl.ListFormat(this
|
|
165
|
+
return formatWords(this, sentence, {
|
|
166
|
+
count: files.length,
|
|
167
|
+
names: new Intl.ListFormat(wordsLocale(this), { style: 'short', type: 'unit' }).format(files.map((file) => file.name)),
|
|
167
168
|
});
|
|
168
169
|
}
|
|
170
|
+
aboutFile(label, name) {
|
|
171
|
+
return this[label].includes('{name}')
|
|
172
|
+
? formatWords(this, label, { name })
|
|
173
|
+
: labelWith(this[label], 'name', name);
|
|
174
|
+
}
|
|
169
175
|
removeMark(at) {
|
|
170
176
|
return this.removeIcon.copyFor(at) ?? drawIcon(trash);
|
|
171
177
|
}
|
|
@@ -181,7 +187,7 @@ let HelixHeadlessFileInput = class HelixHeadlessFileInput extends MixinField(Hel
|
|
|
181
187
|
removeAt(at) {
|
|
182
188
|
const gone = this.files[at];
|
|
183
189
|
if (gone && this.commit(this.files.filter((_, index) => index !== at))) {
|
|
184
|
-
this.status.say(
|
|
190
|
+
this.status.say(formatWords(this, 'removedText', { name: gone.name }));
|
|
185
191
|
}
|
|
186
192
|
}
|
|
187
193
|
commit(next) {
|
|
@@ -263,7 +269,7 @@ let HelixHeadlessFileInput = class HelixHeadlessFileInput extends MixinField(Hel
|
|
|
263
269
|
}
|
|
264
270
|
renderMeta(file) {
|
|
265
271
|
return html `<${this.tag('tag')} part="size"
|
|
266
|
-
exportparts="cell: size-cell, dismiss: size-dismiss, dismiss-mark: size-dismiss-mark, label: size-label, link: size-link, start: size-start">${size(file.size, this
|
|
272
|
+
exportparts="cell: size-cell, dismiss: size-dismiss, dismiss-mark: size-dismiss-mark, label: size-label, link: size-link, start: size-start">${size(file.size, wordsLocale(this), (count) => formatWords(this, 'bytesLabel', { count }))}</${this.tag('tag')}>
|
|
267
273
|
<${this.tag('tag')}
|
|
268
274
|
part="kind"
|
|
269
275
|
exportparts="cell: kind-cell, dismiss: kind-dismiss, dismiss-mark: kind-dismiss-mark, label: kind-label, link: kind-link, start: kind-start">${kind(file)}</${this.tag('tag')}>`;
|
|
@@ -281,7 +287,7 @@ let HelixHeadlessFileInput = class HelixHeadlessFileInput extends MixinField(Hel
|
|
|
281
287
|
part="progress"
|
|
282
288
|
max="1"
|
|
283
289
|
value=${bar === 'unmeasured' ? nothing : bar}
|
|
284
|
-
aria-label=${
|
|
290
|
+
aria-label=${this.aboutFile('progressLabel', file.name)}
|
|
285
291
|
></progress>`}${status.text ? html `<span part="status-text">${status.text}</span>` : nothing}</span
|
|
286
292
|
>`;
|
|
287
293
|
}
|
|
@@ -346,7 +352,7 @@ let HelixHeadlessFileInput = class HelixHeadlessFileInput extends MixinField(Hel
|
|
|
346
352
|
<button
|
|
347
353
|
part="remove"
|
|
348
354
|
type="button"
|
|
349
|
-
aria-label=${
|
|
355
|
+
aria-label=${this.aboutFile('removeLabel', file.name)}
|
|
350
356
|
data-at=${at}
|
|
351
357
|
?disabled=${this.isDisabled}
|
|
352
358
|
@click=${this.handleRemove}
|
|
@@ -362,8 +368,13 @@ __decorate([
|
|
|
362
368
|
property()
|
|
363
369
|
], HelixHeadlessFileInput.prototype, "accept", void 0);
|
|
364
370
|
__decorate([
|
|
371
|
+
words,
|
|
365
372
|
property({ attribute: 'added-text' })
|
|
366
373
|
], HelixHeadlessFileInput.prototype, "addedText", void 0);
|
|
374
|
+
__decorate([
|
|
375
|
+
words,
|
|
376
|
+
property({ attribute: 'bytes-label' })
|
|
377
|
+
], HelixHeadlessFileInput.prototype, "bytesLabel", void 0);
|
|
367
378
|
__decorate([
|
|
368
379
|
property()
|
|
369
380
|
], HelixHeadlessFileInput.prototype, "capture", void 0);
|
|
@@ -383,15 +394,19 @@ __decorate([
|
|
|
383
394
|
property({ reflect: true, type: Boolean })
|
|
384
395
|
], HelixHeadlessFileInput.prototype, "multiple", void 0);
|
|
385
396
|
__decorate([
|
|
397
|
+
words,
|
|
386
398
|
property({ attribute: 'progress-label' })
|
|
387
399
|
], HelixHeadlessFileInput.prototype, "progressLabel", void 0);
|
|
388
400
|
__decorate([
|
|
401
|
+
words,
|
|
389
402
|
property({ attribute: 'rejected-text' })
|
|
390
403
|
], HelixHeadlessFileInput.prototype, "rejectedText", void 0);
|
|
391
404
|
__decorate([
|
|
405
|
+
words,
|
|
392
406
|
property({ attribute: 'removed-text' })
|
|
393
407
|
], HelixHeadlessFileInput.prototype, "removedText", void 0);
|
|
394
408
|
__decorate([
|
|
409
|
+
words,
|
|
395
410
|
property({ attribute: 'remove-label' })
|
|
396
411
|
], HelixHeadlessFileInput.prototype, "removeLabel", void 0);
|
|
397
412
|
__decorate([
|
|
@@ -401,6 +416,7 @@ __decorate([
|
|
|
401
416
|
property({ attribute: false })
|
|
402
417
|
], HelixHeadlessFileInput.prototype, "transformFiles", void 0);
|
|
403
418
|
__decorate([
|
|
419
|
+
words,
|
|
404
420
|
property({ attribute: 'trigger-label' })
|
|
405
421
|
], HelixHeadlessFileInput.prototype, "triggerLabel", void 0);
|
|
406
422
|
__decorate([
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import { clamp } from '@fusion.dev/helix-core';
|
|
1
2
|
export const barOf = (status) => {
|
|
2
3
|
const { progress, state } = status;
|
|
3
4
|
if (typeof progress === 'number' && Number.isFinite(progress)) {
|
|
4
|
-
return
|
|
5
|
+
return clamp(progress, 0, 1);
|
|
5
6
|
}
|
|
6
7
|
return state === 'uploading' ? 'unmeasured' : undefined;
|
|
7
8
|
};
|
|
@@ -63,6 +63,19 @@ declare const HelixHeadlessFilterChip_base: (new (...args: any[]) => import("@fu
|
|
|
63
63
|
* @csspart values - The values the field is compared to.
|
|
64
64
|
*/
|
|
65
65
|
export declare class HelixHeadlessFilterChip extends HelixHeadlessFilterChip_base {
|
|
66
|
+
/**
|
|
67
|
+
* The key this family's words are registered under, its styled tag:
|
|
68
|
+
* `registerWords('de', { 'helix-filter-chip': { dismissLabel: 'Filter entfernen' } })`.
|
|
69
|
+
*/
|
|
70
|
+
static words: string;
|
|
71
|
+
/**
|
|
72
|
+
* The remove button's name, read by screen readers. The chip's own words
|
|
73
|
+
* follow it, so several chips are told apart.
|
|
74
|
+
*
|
|
75
|
+
* "Remove filter" rather than the mixin's "Dismiss", for the reason `Tag`
|
|
76
|
+
* gives its own: taking a filter out of a set is a different act from
|
|
77
|
+
* closing a message.
|
|
78
|
+
*/
|
|
66
79
|
dismissLabel: string;
|
|
67
80
|
/**
|
|
68
81
|
* The name of the field the filter is on, as shown on the chip.
|
|
@@ -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, MixinDismissible, slottedWords } from '@fusion.dev/helix-core';
|
|
7
|
+
import { customElement, HelixElement, labelWith, MixinDismissible, slottedWords, words, } from '@fusion.dev/helix-core';
|
|
8
8
|
import { x } from '@fusion.dev/helix-icons';
|
|
9
9
|
import { html, nothing } from 'lit';
|
|
10
10
|
import { property } from 'lit/decorators.js';
|
|
@@ -16,13 +16,13 @@ let HelixHeadlessFilterChip = class HelixHeadlessFilterChip extends MixinDismiss
|
|
|
16
16
|
this.label = '';
|
|
17
17
|
this.operatorLabel = '';
|
|
18
18
|
}
|
|
19
|
+
static { this.words = 'helix-filter-chip'; }
|
|
19
20
|
get removeName() {
|
|
20
21
|
const read = (slot, fallback) => (this.childrenKnown && slottedWords(this, [slot])) || fallback;
|
|
21
22
|
const words = [read('field', this.label), read('operator', this.operatorLabel), read('', '')]
|
|
22
23
|
.filter(Boolean)
|
|
23
24
|
.join(' ');
|
|
24
|
-
|
|
25
|
-
return label.includes('{label}') ? label.replace('{label}', words) : `${label} ${words}`.trim();
|
|
25
|
+
return labelWith(this.dismissLabel, 'label', words);
|
|
26
26
|
}
|
|
27
27
|
firstUpdated(changed) {
|
|
28
28
|
super.firstUpdated(changed);
|
|
@@ -52,6 +52,10 @@ let HelixHeadlessFilterChip = class HelixHeadlessFilterChip extends MixinDismiss
|
|
|
52
52
|
: nothing}`;
|
|
53
53
|
}
|
|
54
54
|
};
|
|
55
|
+
__decorate([
|
|
56
|
+
words,
|
|
57
|
+
property({ attribute: 'dismiss-label' })
|
|
58
|
+
], HelixHeadlessFilterChip.prototype, "dismissLabel", void 0);
|
|
55
59
|
__decorate([
|
|
56
60
|
property()
|
|
57
61
|
], HelixHeadlessFilterChip.prototype, "label", void 0);
|
|
@@ -85,6 +85,11 @@ import '../../menu/index.js';
|
|
|
85
85
|
* @csspart menu-title - The name of the field whose page is showing.
|
|
86
86
|
*/
|
|
87
87
|
export declare class HelixHeadlessFilterMenu extends HelixElement {
|
|
88
|
+
/**
|
|
89
|
+
* The key this family's words are registered under, its styled tag:
|
|
90
|
+
* `registerWords('de', { 'helix-filter-menu': { label: 'Filtern' } })`.
|
|
91
|
+
*/
|
|
92
|
+
static words: string;
|
|
88
93
|
/**
|
|
89
94
|
* The menu's name, read by screen readers.
|
|
90
95
|
*/
|
|
@@ -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, HelixFacetEvent } from '@fusion.dev/helix-core';
|
|
7
|
+
import { customElement, HelixElement, HelixFacetEvent, words } from '@fusion.dev/helix-core';
|
|
8
8
|
import { nothing } from 'lit';
|
|
9
9
|
import { property } from 'lit/decorators.js';
|
|
10
10
|
import { html } from 'lit/static-html.js';
|
|
@@ -55,6 +55,7 @@ let HelixHeadlessFilterMenu = class HelixHeadlessFilterMenu extends HelixElement
|
|
|
55
55
|
this.apply(field, [...ticked]);
|
|
56
56
|
};
|
|
57
57
|
}
|
|
58
|
+
static { this.words = 'helix-filter-menu'; }
|
|
58
59
|
get fields() {
|
|
59
60
|
return this.knownChildren.filter((child) => child instanceof HelixHeadlessFilterField);
|
|
60
61
|
}
|
|
@@ -203,6 +204,7 @@ let HelixHeadlessFilterMenu = class HelixHeadlessFilterMenu extends HelixElement
|
|
|
203
204
|
}
|
|
204
205
|
};
|
|
205
206
|
__decorate([
|
|
207
|
+
words,
|
|
206
208
|
property()
|
|
207
209
|
], HelixHeadlessFilterMenu.prototype, "label", void 0);
|
|
208
210
|
HelixHeadlessFilterMenu = __decorate([
|