@fusion.dev/helix-headless 0.148.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 +6966 -1798
- package/dist/announcement/root/announcement-root.d.ts +5 -0
- package/dist/announcement/root/announcement-root.js +5 -2
- package/dist/area-chart/root/area-chart-root.d.ts +11 -0
- package/dist/area-chart/root/area-chart-root.js +20 -7
- 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 +6 -1
- package/dist/badge/count.js +3 -3
- package/dist/badge/root/badge-root.d.ts +6 -2
- package/dist/badge/root/badge-root.js +3 -3
- 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/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/root/button-group-root.d.ts +3 -0
- package/dist/button-group/root/button-group-root.js +2 -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/neighbor.d.ts +17 -0
- package/dist/canvas/neighbor.js +1 -0
- package/dist/canvas/node/canvas-node.js +3 -2
- package/dist/canvas/root/canvas-root.d.ts +65 -8
- package/dist/canvas/root/canvas-root.js +115 -49
- package/dist/carousel/root/carousel-root.d.ts +5 -0
- package/dist/carousel/root/carousel-root.js +16 -5
- 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 +27 -1
- package/dist/chat/root/chat-root.js +37 -9
- 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 +11 -0
- package/dist/checkbox-group/root/checkbox-group-root.js +11 -3
- package/dist/code-block/root/code-block-root.d.ts +12 -2
- package/dist/code-block/root/code-block-root.js +12 -2
- 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 +47 -13
- package/dist/combobox/root/combobox-root.d.ts +36 -7
- package/dist/combobox/root/combobox-root.js +37 -12
- package/dist/command/root/command-root.d.ts +15 -6
- 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 +268 -118
- 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/dialog/root/dialog-root.d.ts +12 -1
- package/dist/dialog/root/dialog-root.js +11 -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/root/drilldown-root.d.ts +5 -0
- package/dist/drilldown/root/drilldown-root.js +4 -1
- package/dist/element-events.generated.js +25 -3
- package/dist/file-input/root/file-input-root.d.ts +18 -3
- package/dist/file-input/root/file-input-root.js +34 -17
- package/dist/filter-input/chip/filter-chip.d.ts +13 -0
- package/dist/filter-input/chip/filter-chip.js +6 -1
- 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/root/format-date-root.d.ts +20 -2
- package/dist/format-date/root/format-date-root.js +5 -2
- 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 +78 -9
- package/dist/graph/root/graph-root.js +124 -27
- package/dist/heatmap/root/heatmap-root.d.ts +25 -4
- package/dist/heatmap/root/heatmap-root.js +27 -7
- 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/input/root/input-root.d.ts +5 -0
- package/dist/input/root/input-root.js +4 -1
- 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 +112 -2
- 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 +68 -11
- package/dist/listbox/root/listbox-root.js +41 -9
- 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 +16 -1
- 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 +33 -14
- package/dist/map/root/map-root.js +59 -22
- 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/menu/root/menu-root.d.ts +5 -0
- 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 +3 -1
- package/dist/notifications/notification/notification.d.ts +5 -0
- package/dist/notifications/notification/notification.js +3 -1
- package/dist/notifications/root/notifications-root.d.ts +8 -0
- package/dist/notifications/root/notifications-root.js +10 -2
- 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 +51 -12
- package/dist/object-inspector/root/object-inspector-root.js +21 -20
- 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 +7 -3
- package/dist/pagination/size/pagination-size.js +4 -2
- 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 +6 -6
- package/dist/pin-input/code.js +1 -5
- package/dist/pin-input/root/pin-input-root.d.ts +9 -3
- package/dist/pin-input/root/pin-input-root.js +6 -2
- 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 +12 -2
- package/dist/qr-code/root/qr-code-root.js +9 -2
- 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/root/scatter-chart-root.d.ts +20 -2
- package/dist/scatter-chart/root/scatter-chart-root.js +20 -5
- package/dist/select/root/select-root.d.ts +11 -0
- package/dist/select/root/select-root.js +13 -3
- 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/root/speed-dial-root.d.ts +5 -0
- package/dist/speed-dial/root/speed-dial-root.js +4 -1
- package/dist/splitter/root/splitter-root.d.ts +6 -1
- package/dist/splitter/root/splitter-root.js +9 -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/column/table-column.d.ts +11 -4
- package/dist/table/column/table-column.js +15 -10
- package/dist/table/grid-controller.d.ts +8 -3
- package/dist/table/grid-controller.js +17 -11
- package/dist/table/root/table-root.d.ts +107 -5
- package/dist/table/root/table-root.js +122 -20
- package/dist/table/row/table-row.d.ts +42 -0
- package/dist/table/row/table-row.js +40 -1
- 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 +3 -1
- 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 +15 -7
- package/dist/time-picker/root/time-picker-root.js +25 -12
- package/dist/toast/item/toast-item.d.ts +7 -0
- package/dist/toast/item/toast-item.js +1 -0
- package/dist/toast/root/toast-root.d.ts +9 -1
- package/dist/toast/root/toast-root.js +5 -4
- package/dist/toolbar/root/toolbar-root.d.ts +5 -0
- package/dist/toolbar/root/toolbar-root.js +5 -2
- package/dist/tooltip/root/tooltip-root.d.ts +27 -17
- 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 +12 -3
- package/dist/video/root/video-root.js +41 -14
- 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 +5 -2
- package/lint.json +1 -1
- package/package.json +7 -6
- package/types/jsx.d.ts +4014 -1862
- package/types/vue.d.ts +1266 -624
- package/types/words.d.ts +3280 -0
- package/dist/toast/hotkey.d.ts +0 -22
- package/dist/toast/hotkey.js +0 -23
|
@@ -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, HelixCompleteEvent, HelixFormElement, MixinControllerValue, MixinField, restoreValue, submitImplicitly, verdictFlags, } from '@fusion.dev/helix-core';
|
|
7
|
+
import { AriaForwardController, customElement, formatWords, HelixCompleteEvent, HelixFormElement, MixinControllerValue, MixinField, restoreValue, submitImplicitly, verdictFlags, words, } from '@fusion.dev/helix-core';
|
|
8
8
|
import { html, nothing } from 'lit';
|
|
9
9
|
import { property, state } from 'lit/decorators.js';
|
|
10
10
|
import { caretTo, cleanCode, codeVerdict, overwriteCode, readTyped, } from '../code.js';
|
|
@@ -28,6 +28,7 @@ let HelixHeadlessPinInput = class HelixHeadlessPinInput extends MixinControllerV
|
|
|
28
28
|
this.maskCharacter = '•';
|
|
29
29
|
this.placeholder = '';
|
|
30
30
|
this.readOnly = false;
|
|
31
|
+
this.tooShortMessage = '{length, plural, one {Please enter the # character.} other {Please enter all # characters.}}';
|
|
31
32
|
this.type = 'numeric';
|
|
32
33
|
this.active = -1;
|
|
33
34
|
this.pressedAt = undefined;
|
|
@@ -104,6 +105,7 @@ let HelixHeadlessPinInput = class HelixHeadlessPinInput extends MixinControllerV
|
|
|
104
105
|
}
|
|
105
106
|
};
|
|
106
107
|
}
|
|
108
|
+
static { this.words = 'helix-pin-input'; }
|
|
107
109
|
static { this.shadowRootOptions = {
|
|
108
110
|
...HelixFormElement.shadowRootOptions,
|
|
109
111
|
delegatesFocus: true,
|
|
@@ -166,7 +168,7 @@ let HelixHeadlessPinInput = class HelixHeadlessPinInput extends MixinControllerV
|
|
|
166
168
|
}
|
|
167
169
|
const found = verdictFlags(codeVerdict(this.value, this.count, this.required, {
|
|
168
170
|
missing: this.valueMissingMessage,
|
|
169
|
-
short: this
|
|
171
|
+
short: (length) => formatWords(this, 'tooShortMessage', { length }),
|
|
170
172
|
}));
|
|
171
173
|
this.internals.setValidity(found?.[0] ?? {}, found?.[1] ?? '', control);
|
|
172
174
|
this.refreshFeedback();
|
|
@@ -260,6 +262,7 @@ __decorate([
|
|
|
260
262
|
property()
|
|
261
263
|
], HelixHeadlessPinInput.prototype, "case", void 0);
|
|
262
264
|
__decorate([
|
|
265
|
+
words,
|
|
263
266
|
property({ attribute: 'cell-label' })
|
|
264
267
|
], HelixHeadlessPinInput.prototype, "cellLabel", void 0);
|
|
265
268
|
__decorate([
|
|
@@ -281,6 +284,7 @@ __decorate([
|
|
|
281
284
|
property({ attribute: 'readonly', reflect: true, type: Boolean })
|
|
282
285
|
], HelixHeadlessPinInput.prototype, "readOnly", void 0);
|
|
283
286
|
__decorate([
|
|
287
|
+
words,
|
|
284
288
|
property({ attribute: 'too-short-message' })
|
|
285
289
|
], HelixHeadlessPinInput.prototype, "tooShortMessage", void 0);
|
|
286
290
|
__decorate([
|
|
@@ -81,6 +81,11 @@ declare const HelixHeadlessPopover_base: (new (...args: any[]) => import("@fusio
|
|
|
81
81
|
* @cssstate placed-top - While the panel sits above its trigger.
|
|
82
82
|
*/
|
|
83
83
|
export declare class HelixHeadlessPopover extends HelixHeadlessPopover_base {
|
|
84
|
+
/**
|
|
85
|
+
* The key this family's words are registered under, its styled tag:
|
|
86
|
+
* `registerWords('de', { 'helix-popover': { fallbackLabel: 'Popup' } })`.
|
|
87
|
+
*/
|
|
88
|
+
static words: string;
|
|
84
89
|
/**
|
|
85
90
|
* Draws a point on the panel's edge facing the trigger.
|
|
86
91
|
*
|
|
@@ -89,8 +94,13 @@ export declare class HelixHeadlessPopover extends HelixHeadlessPopover_base {
|
|
|
89
94
|
*/
|
|
90
95
|
arrow: boolean;
|
|
91
96
|
/**
|
|
92
|
-
* The panel's name
|
|
93
|
-
*
|
|
97
|
+
* The panel's name where nothing else names it: no `label`, no heading in
|
|
98
|
+
* the panel, and no `aria-labelledby` on the host.
|
|
99
|
+
*/
|
|
100
|
+
fallbackLabel: string;
|
|
101
|
+
/**
|
|
102
|
+
* The panel's name, read by screen readers. Left empty, the first heading in
|
|
103
|
+
* the panel names it, and then `fallback-label`.
|
|
94
104
|
*/
|
|
95
105
|
label: string;
|
|
96
106
|
/**
|
|
@@ -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, anchorElement, arrowReach, CommandController, customElement, deepActiveElement, FocusScopeController, HelixElement, headingIn, MixinControllerOpen, OpenPhaseController, PopoverController, reflectElements, sideOf, tellDisclosure, } from '@fusion.dev/helix-core';
|
|
7
|
+
import { AriaForwardController, anchorElement, arrowReach, CommandController, customElement, deepActiveElement, FocusScopeController, HelixElement, headingIn, MixinControllerOpen, OpenPhaseController, PopoverController, reflectElements, sideOf, tellDisclosure, words, } from '@fusion.dev/helix-core';
|
|
8
8
|
import { html, nothing } from 'lit';
|
|
9
9
|
import { property, state } from 'lit/decorators.js';
|
|
10
10
|
import { hideOutside } from '../hide-outside.js';
|
|
@@ -12,7 +12,8 @@ let HelixHeadlessPopover = class HelixHeadlessPopover extends MixinControllerOpe
|
|
|
12
12
|
constructor() {
|
|
13
13
|
super(...arguments);
|
|
14
14
|
this.arrow = false;
|
|
15
|
-
this.
|
|
15
|
+
this.fallbackLabel = 'Popover';
|
|
16
|
+
this.label = '';
|
|
16
17
|
this.modal = false;
|
|
17
18
|
this.aria = new AriaForwardController(this, {
|
|
18
19
|
target: () => this.partNamed('popover'),
|
|
@@ -99,13 +100,14 @@ let HelixHeadlessPopover = class HelixHeadlessPopover extends MixinControllerOpe
|
|
|
99
100
|
this.pressed = false;
|
|
100
101
|
this.settled = false;
|
|
101
102
|
}
|
|
103
|
+
static { this.words = 'helix-popover'; }
|
|
102
104
|
get slotted() {
|
|
103
105
|
return (this.renderRoot
|
|
104
106
|
?.querySelector('slot:not([name])')
|
|
105
107
|
?.assignedElements({ flatten: true }) ?? []);
|
|
106
108
|
}
|
|
107
109
|
nameByHeading() {
|
|
108
|
-
const asked = this.label !== '
|
|
110
|
+
const asked = this.label !== '' || this.hasAttribute('aria-labelledby');
|
|
109
111
|
const heading = asked ? null : headingIn(this.slotted);
|
|
110
112
|
this.namedByHeading = reflectElements(this.partNamed('popover'), 'ariaLabelledByElements', heading ? [heading] : [], this.namedByHeading);
|
|
111
113
|
}
|
|
@@ -196,7 +198,7 @@ let HelixHeadlessPopover = class HelixHeadlessPopover extends MixinControllerOpe
|
|
|
196
198
|
part="popover"
|
|
197
199
|
popover="manual"
|
|
198
200
|
role="dialog"
|
|
199
|
-
aria-label=${this.label}
|
|
201
|
+
aria-label=${this.label || this.fallbackLabel}
|
|
200
202
|
aria-modal=${this.modal ? 'true' : nothing}
|
|
201
203
|
tabindex="-1"
|
|
202
204
|
?hidden=${!this.open}
|
|
@@ -214,6 +216,10 @@ let HelixHeadlessPopover = class HelixHeadlessPopover extends MixinControllerOpe
|
|
|
214
216
|
__decorate([
|
|
215
217
|
property({ type: Boolean })
|
|
216
218
|
], HelixHeadlessPopover.prototype, "arrow", void 0);
|
|
219
|
+
__decorate([
|
|
220
|
+
words,
|
|
221
|
+
property({ attribute: 'fallback-label' })
|
|
222
|
+
], HelixHeadlessPopover.prototype, "fallbackLabel", void 0);
|
|
217
223
|
__decorate([
|
|
218
224
|
property()
|
|
219
225
|
], HelixHeadlessPopover.prototype, "label", void 0);
|
|
@@ -43,6 +43,11 @@ import { type PropertyValues, type TemplateResult } from 'lit';
|
|
|
43
43
|
* @cssstate complete - The value is at `max` and the bar is not indeterminate.
|
|
44
44
|
*/
|
|
45
45
|
export declare class HelixHeadlessProgress extends HelixElement {
|
|
46
|
+
/**
|
|
47
|
+
* The key this family's words are registered under, its styled tag:
|
|
48
|
+
* `registerWords('de', { 'helix-progress': { completeLabel: 'Fertig' } })`.
|
|
49
|
+
*/
|
|
50
|
+
static words: string;
|
|
46
51
|
/**
|
|
47
52
|
* The words a screen reader hears when the value reaches `max`, such as
|
|
48
53
|
* "Upload complete".
|
|
@@ -88,9 +93,9 @@ export declare class HelixHeadlessProgress extends HelixElement {
|
|
|
88
93
|
*/
|
|
89
94
|
label: string;
|
|
90
95
|
/**
|
|
91
|
-
* The locale the percentage
|
|
96
|
+
* The locale the words and the percentage are in, such as `fr` for `72 %`.
|
|
92
97
|
*
|
|
93
|
-
* Absent
|
|
98
|
+
* Absent reads the nearest `lang`, then the runtime's own.
|
|
94
99
|
*/
|
|
95
100
|
locale: string;
|
|
96
101
|
/**
|
|
@@ -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, drawStatus, HelixCompleteEvent, HelixElement, hostAria, readingText, StatusController, slottedWords, } from '@fusion.dev/helix-core';
|
|
7
|
+
import { customElement, drawStatus, HelixCompleteEvent, HelixElement, hostAria, readingText, StatusController, slottedWords, words, wordsLocale, } from '@fusion.dev/helix-core';
|
|
8
8
|
import { html } from 'lit';
|
|
9
9
|
import { property } from 'lit/decorators.js';
|
|
10
10
|
let HelixHeadlessProgress = class HelixHeadlessProgress extends HelixElement {
|
|
@@ -24,6 +24,7 @@ let HelixHeadlessProgress = class HelixHeadlessProgress extends HelixElement {
|
|
|
24
24
|
this.requestUpdate();
|
|
25
25
|
};
|
|
26
26
|
}
|
|
27
|
+
static { this.words = 'helix-progress'; }
|
|
27
28
|
get complete() {
|
|
28
29
|
return !this.indeterminate && this.fraction >= 1;
|
|
29
30
|
}
|
|
@@ -66,7 +67,7 @@ let HelixHeadlessProgress = class HelixHeadlessProgress extends HelixElement {
|
|
|
66
67
|
}
|
|
67
68
|
get text() {
|
|
68
69
|
return (this.valueText ||
|
|
69
|
-
readingText(Math.min(Math.max(this.value, this.range.min), this.range.max), this.fraction, this
|
|
70
|
+
readingText(Math.min(Math.max(this.value, this.range.min), this.range.max), this.fraction, wordsLocale(this), this.formatOptions));
|
|
70
71
|
}
|
|
71
72
|
render() {
|
|
72
73
|
const fraction = this.indeterminate ? 1 : this.fraction;
|
|
@@ -87,6 +88,7 @@ let HelixHeadlessProgress = class HelixHeadlessProgress extends HelixElement {
|
|
|
87
88
|
}
|
|
88
89
|
};
|
|
89
90
|
__decorate([
|
|
91
|
+
words,
|
|
90
92
|
property({ attribute: 'complete-label' })
|
|
91
93
|
], HelixHeadlessProgress.prototype, "completeLabel", void 0);
|
|
92
94
|
__decorate([
|
|
@@ -96,6 +98,7 @@ __decorate([
|
|
|
96
98
|
property({ reflect: true, type: Boolean })
|
|
97
99
|
], HelixHeadlessProgress.prototype, "indeterminate", void 0);
|
|
98
100
|
__decorate([
|
|
101
|
+
words,
|
|
99
102
|
property()
|
|
100
103
|
], HelixHeadlessProgress.prototype, "label", void 0);
|
|
101
104
|
__decorate([
|
package/dist/qr-code/name.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The name a code is read by: its `label`, or with none, the word for a code,
|
|
3
|
-
*
|
|
3
|
+
* or where the value is a web address, `addressed` with it, which puts the
|
|
4
|
+
* word and the address in one sentence.
|
|
4
5
|
*
|
|
5
6
|
* **A value that is no web address is never read out.** A code that sets up
|
|
6
7
|
* an authenticator (`otpauth://…?secret=…`) or joins a network
|
|
@@ -8,4 +9,4 @@
|
|
|
8
9
|
* read that secret aloud to anyone in earshot. A web address is what a
|
|
9
10
|
* sighted reader gets by scanning, so it is said after the word.
|
|
10
11
|
*/
|
|
11
|
-
export declare const qrName: (label: string, value: string, word: string) => string;
|
|
12
|
+
export declare const qrName: (label: string, value: string, word: string, addressed: (address: string) => string) => string;
|
package/dist/qr-code/name.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export const qrName = (label, value, word) => {
|
|
1
|
+
export const qrName = (label, value, word, addressed) => {
|
|
2
2
|
if (label.trim() !== '') {
|
|
3
3
|
return label;
|
|
4
4
|
}
|
|
5
5
|
const address = value.trim();
|
|
6
|
-
return /^https?:\/\/\S+$/iu.test(address) ?
|
|
6
|
+
return /^https?:\/\/\S+$/iu.test(address) ? addressed(address) : word;
|
|
7
7
|
};
|
|
@@ -62,8 +62,18 @@ export type QrStyle = 'dots' | 'rounded' | 'square';
|
|
|
62
62
|
*/
|
|
63
63
|
export declare class HelixHeadlessQrCode extends HelixElement {
|
|
64
64
|
/**
|
|
65
|
-
* The
|
|
66
|
-
*
|
|
65
|
+
* The key this family's words are registered under, its styled tag:
|
|
66
|
+
* `registerWords('de', { 'helix-qr-code': { codeLabel: 'QR-Code' } })`.
|
|
67
|
+
*/
|
|
68
|
+
static words: string;
|
|
69
|
+
/**
|
|
70
|
+
* The name of a code with no `label` whose value is a web address.
|
|
71
|
+
* `{code}` is `code-label` and `{address}` the address.
|
|
72
|
+
*/
|
|
73
|
+
addressLabel: string;
|
|
74
|
+
/**
|
|
75
|
+
* The words a code with no `label` is named by, with its value where the
|
|
76
|
+
* value is a web address, as `address-label` says.
|
|
67
77
|
*/
|
|
68
78
|
codeLabel: string;
|
|
69
79
|
/**
|
|
@@ -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, rgbOf, slotFilled, } from '@fusion.dev/helix-core';
|
|
7
|
+
import { customElement, formatWords, HelixElement, reportRuntime, rgbOf, slotFilled, words, } from '@fusion.dev/helix-core';
|
|
8
8
|
import { html, nothing, svg, } from 'lit';
|
|
9
9
|
import { property } from 'lit/decorators.js';
|
|
10
10
|
import { encode } from 'uqr';
|
|
@@ -77,6 +77,7 @@ const pathFor = (matrix, style, only = 'all') => {
|
|
|
77
77
|
let HelixHeadlessQrCode = class HelixHeadlessQrCode extends HelixElement {
|
|
78
78
|
constructor() {
|
|
79
79
|
super(...arguments);
|
|
80
|
+
this.addressLabel = '{code}, {address}';
|
|
80
81
|
this.codeLabel = 'QR code';
|
|
81
82
|
this.label = '';
|
|
82
83
|
this.value = '';
|
|
@@ -84,6 +85,7 @@ let HelixHeadlessQrCode = class HelixHeadlessQrCode extends HelixElement {
|
|
|
84
85
|
this.toldLogo = false;
|
|
85
86
|
this.overflowed = '';
|
|
86
87
|
}
|
|
88
|
+
static { this.words = 'helix-qr-code'; }
|
|
87
89
|
willUpdate(changed) {
|
|
88
90
|
super.willUpdate(changed);
|
|
89
91
|
if (this.childrenKnown) {
|
|
@@ -224,7 +226,7 @@ let HelixHeadlessQrCode = class HelixHeadlessQrCode extends HelixElement {
|
|
|
224
226
|
viewBox="0 0 ${box} ${box}"
|
|
225
227
|
xmlns="http://www.w3.org/2000/svg"
|
|
226
228
|
role="img"
|
|
227
|
-
aria-label=${qrName(this.label, this.value, this.codeLabel)}
|
|
229
|
+
aria-label=${qrName(this.label, this.value, this.codeLabel, (address) => formatWords(this, 'addressLabel', { address, code: this.codeLabel }))}
|
|
228
230
|
shape-rendering="crispEdges"
|
|
229
231
|
>
|
|
230
232
|
<path
|
|
@@ -260,6 +262,11 @@ let HelixHeadlessQrCode = class HelixHeadlessQrCode extends HelixElement {
|
|
|
260
262
|
}
|
|
261
263
|
};
|
|
262
264
|
__decorate([
|
|
265
|
+
words,
|
|
266
|
+
property({ attribute: 'address-label' })
|
|
267
|
+
], HelixHeadlessQrCode.prototype, "addressLabel", void 0);
|
|
268
|
+
__decorate([
|
|
269
|
+
words,
|
|
263
270
|
property({ attribute: 'code-label' })
|
|
264
271
|
], HelixHeadlessQrCode.prototype, "codeLabel", void 0);
|
|
265
272
|
__decorate([
|
|
@@ -68,6 +68,11 @@ declare const HelixHeadlessRadioGroup_base: (new (...args: any[]) => import("@fu
|
|
|
68
68
|
* @cssstate invalid - The group has an error to show, from the browser's validation or from your `feedback`.
|
|
69
69
|
*/
|
|
70
70
|
export declare class HelixHeadlessRadioGroup extends HelixHeadlessRadioGroup_base {
|
|
71
|
+
/**
|
|
72
|
+
* The key this family's words are registered under, its styled tag:
|
|
73
|
+
* `registerWords('de', { 'helix-radio-group': { valueMissingMessage: '...' } })`.
|
|
74
|
+
*/
|
|
75
|
+
static words: string;
|
|
71
76
|
/**
|
|
72
77
|
* Whether the group holds a tab stop of its own.
|
|
73
78
|
*
|
|
@@ -101,6 +106,12 @@ export declare class HelixHeadlessRadioGroup extends HelixHeadlessRadioGroup_bas
|
|
|
101
106
|
* `aria-readonly`. A script can still set `value`.
|
|
102
107
|
*/
|
|
103
108
|
readOnly: boolean;
|
|
109
|
+
/**
|
|
110
|
+
* The message reported when the field is required and no option is chosen.
|
|
111
|
+
* Absent, or empty, is this sentence, or the words registered for the page's
|
|
112
|
+
* locale.
|
|
113
|
+
*/
|
|
114
|
+
valueMissingMessage: string;
|
|
104
115
|
protected readonly keys: KeyboardNavigationController;
|
|
105
116
|
protected readonly cascade: DisabledCascadeController;
|
|
106
117
|
/** The radios, in light-DOM order. Client only: the server has no tree. */
|
|
@@ -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, DisabledCascadeController, HelixFormElement, hostAria, KeyboardNavigationController, MixinControllerValue, MixinField, } from '@fusion.dev/helix-core';
|
|
7
|
+
import { customElement, DisabledCascadeController, HelixFormElement, hostAria, KeyboardNavigationController, MixinControllerValue, MixinField, words, } from '@fusion.dev/helix-core';
|
|
8
8
|
import { html } from 'lit';
|
|
9
9
|
import { property } from 'lit/decorators.js';
|
|
10
10
|
import { HelixHeadlessRadio } from '../root/radio-root.js';
|
|
@@ -13,6 +13,7 @@ let HelixHeadlessRadioGroup = class HelixHeadlessRadioGroup extends MixinControl
|
|
|
13
13
|
super(...arguments);
|
|
14
14
|
this.focusable = true;
|
|
15
15
|
this.readOnly = false;
|
|
16
|
+
this.valueMissingMessage = 'Choose one to continue.';
|
|
16
17
|
this.keys = new KeyboardNavigationController(this, {
|
|
17
18
|
items: () => this.items,
|
|
18
19
|
origin: () => (this.readOnly ? 'focus' : 'selection'),
|
|
@@ -39,6 +40,7 @@ let HelixHeadlessRadioGroup = class HelixHeadlessRadioGroup extends MixinControl
|
|
|
39
40
|
});
|
|
40
41
|
};
|
|
41
42
|
}
|
|
43
|
+
static { this.words = 'helix-radio-group'; }
|
|
42
44
|
get items() {
|
|
43
45
|
return [...(this.children ?? [])].filter((child) => child instanceof HelixHeadlessRadio);
|
|
44
46
|
}
|
|
@@ -84,7 +86,7 @@ let HelixHeadlessRadioGroup = class HelixHeadlessRadioGroup extends MixinControl
|
|
|
84
86
|
sync() {
|
|
85
87
|
const answered = this.answered;
|
|
86
88
|
this.internals.setFormValue(answered ? this.value : null);
|
|
87
|
-
this.reportRequired(!answered,
|
|
89
|
+
this.reportRequired(!answered, this.valueMissingMessage, 'items');
|
|
88
90
|
}
|
|
89
91
|
connectedCallback() {
|
|
90
92
|
super.connectedCallback();
|
|
@@ -124,6 +126,10 @@ __decorate([
|
|
|
124
126
|
__decorate([
|
|
125
127
|
property({ attribute: 'readonly', reflect: true, type: Boolean })
|
|
126
128
|
], HelixHeadlessRadioGroup.prototype, "readOnly", void 0);
|
|
129
|
+
__decorate([
|
|
130
|
+
words,
|
|
131
|
+
property({ attribute: 'value-missing-message' })
|
|
132
|
+
], HelixHeadlessRadioGroup.prototype, "valueMissingMessage", void 0);
|
|
127
133
|
HelixHeadlessRadioGroup = __decorate([
|
|
128
134
|
customElement('helix-headless-radio-group')
|
|
129
135
|
], HelixHeadlessRadioGroup);
|
|
@@ -69,6 +69,11 @@ declare const HelixHeadlessRating_base: (new (...args: any[]) => import("@fusion
|
|
|
69
69
|
* @cssstate invalid - The control has an error to show, from the browser's validation or from your `feedback`.
|
|
70
70
|
*/
|
|
71
71
|
export declare class HelixHeadlessRating extends HelixHeadlessRating_base {
|
|
72
|
+
/**
|
|
73
|
+
* The key this family's words are registered under, its styled tag:
|
|
74
|
+
* `registerWords('de', { 'helix-rating': { optionLabel: '{score} von {max}' } })`.
|
|
75
|
+
*/
|
|
76
|
+
static words: string;
|
|
72
77
|
protected readonly announcesInput = false;
|
|
73
78
|
/**
|
|
74
79
|
* Whether a reader can take the rating back to unrated: by pressing the
|
|
@@ -125,7 +130,7 @@ export declare class HelixHeadlessRating extends HelixHeadlessRating_base {
|
|
|
125
130
|
min: number;
|
|
126
131
|
/**
|
|
127
132
|
* The name of each mark a reader can choose, with `{score}` and `{max}`
|
|
128
|
-
* filled in. Set it to translate "3 out of 5".
|
|
133
|
+
* filled in, written in the locale. Set it to translate "3 out of 5".
|
|
129
134
|
*
|
|
130
135
|
* Also what a read-only rating says for its score where `value-text` is
|
|
131
136
|
* empty.
|
|
@@ -158,6 +163,12 @@ export declare class HelixHeadlessRating extends HelixHeadlessRating_base {
|
|
|
158
163
|
* than an index: with halves, five marks are ten answers.
|
|
159
164
|
*/
|
|
160
165
|
step: number;
|
|
166
|
+
/**
|
|
167
|
+
* The message reported when the field is required and no rating is chosen.
|
|
168
|
+
* Absent, or empty, is this sentence, or the words registered for the page's
|
|
169
|
+
* locale.
|
|
170
|
+
*/
|
|
171
|
+
valueMissingMessage: string;
|
|
161
172
|
/**
|
|
162
173
|
* The text screen readers read for the score, in place of "3.5 out of 5".
|
|
163
174
|
*
|
|
@@ -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, valueAsNumber as asNumber, customElement,
|
|
7
|
+
import { AriaForwardController, valueAsNumber as asNumber, customElement, formatWords, numberAsValue as fromNumber, HelixClearEvent, HelixFormElement, HelixPreviewEvent, KeyboardNavigationController, MixinControllerValue, MixinField, nearest, reportRuntime, SlottedGlyph, words, } from '@fusion.dev/helix-core';
|
|
8
8
|
import { html, nothing } from 'lit';
|
|
9
9
|
import { property, state } from 'lit/decorators.js';
|
|
10
10
|
let HelixHeadlessRating = class HelixHeadlessRating extends MixinControllerValue(MixinField(HelixFormElement)) {
|
|
@@ -18,6 +18,7 @@ let HelixHeadlessRating = class HelixHeadlessRating extends MixinControllerValue
|
|
|
18
18
|
this.readOnly = false;
|
|
19
19
|
this.showValue = false;
|
|
20
20
|
this.step = 1;
|
|
21
|
+
this.valueMissingMessage = 'Choose a rating to continue.';
|
|
21
22
|
this.valueText = '';
|
|
22
23
|
this.aria = new AriaForwardController(this, {
|
|
23
24
|
target: () => this.partNamed('marks'),
|
|
@@ -123,6 +124,7 @@ let HelixHeadlessRating = class HelixHeadlessRating extends MixinControllerValue
|
|
|
123
124
|
};
|
|
124
125
|
this.warned = false;
|
|
125
126
|
}
|
|
127
|
+
static { this.words = 'helix-rating'; }
|
|
126
128
|
get namedControl() {
|
|
127
129
|
return this.partNamed('marks');
|
|
128
130
|
}
|
|
@@ -183,7 +185,7 @@ let HelixHeadlessRating = class HelixHeadlessRating extends MixinControllerValue
|
|
|
183
185
|
}
|
|
184
186
|
sync() {
|
|
185
187
|
this.internals.setFormValue(this.value === '' ? null : this.value);
|
|
186
|
-
this.reportRequired(this.value === '',
|
|
188
|
+
this.reportRequired(this.value === '', this.valueMissingMessage, 'marks');
|
|
187
189
|
}
|
|
188
190
|
clear() {
|
|
189
191
|
if (this.value !== '' && !this.readOnly && !this.isDisabled && this.requestValue('')) {
|
|
@@ -231,7 +233,7 @@ let HelixHeadlessRating = class HelixHeadlessRating extends MixinControllerValue
|
|
|
231
233
|
this.sync();
|
|
232
234
|
}
|
|
233
235
|
nameFor(score) {
|
|
234
|
-
return
|
|
236
|
+
return formatWords(this, 'optionLabel', { max: this.max, score });
|
|
235
237
|
}
|
|
236
238
|
stopAt(answered, first) {
|
|
237
239
|
if (!answered) {
|
|
@@ -335,6 +337,7 @@ __decorate([
|
|
|
335
337
|
property({ type: Number })
|
|
336
338
|
], HelixHeadlessRating.prototype, "min", void 0);
|
|
337
339
|
__decorate([
|
|
340
|
+
words,
|
|
338
341
|
property({ attribute: 'option-label' })
|
|
339
342
|
], HelixHeadlessRating.prototype, "optionLabel", void 0);
|
|
340
343
|
__decorate([
|
|
@@ -346,6 +349,10 @@ __decorate([
|
|
|
346
349
|
__decorate([
|
|
347
350
|
property({ type: Number })
|
|
348
351
|
], HelixHeadlessRating.prototype, "step", void 0);
|
|
352
|
+
__decorate([
|
|
353
|
+
words,
|
|
354
|
+
property({ attribute: 'value-missing-message' })
|
|
355
|
+
], HelixHeadlessRating.prototype, "valueMissingMessage", void 0);
|
|
349
356
|
__decorate([
|
|
350
357
|
property({ attribute: 'value-text' })
|
|
351
358
|
], HelixHeadlessRating.prototype, "valueText", void 0);
|
|
@@ -112,7 +112,13 @@ declare const HelixHeadlessScatterChart_base: typeof HelixElement & (new (...arg
|
|
|
112
112
|
*/
|
|
113
113
|
export declare class HelixHeadlessScatterChart extends HelixHeadlessScatterChart_base {
|
|
114
114
|
/**
|
|
115
|
-
* The
|
|
115
|
+
* The key this family's words are registered under, its styled tag:
|
|
116
|
+
* `registerWords('de', { 'helix-scatter-chart': { seriesLabel: '…' } })`.
|
|
117
|
+
*/
|
|
118
|
+
static words: string;
|
|
119
|
+
/**
|
|
120
|
+
* The word for the strength of the relation, `{correlationLabel}` in
|
|
121
|
+
* `series-label`.
|
|
116
122
|
*/
|
|
117
123
|
correlationLabel: string;
|
|
118
124
|
/**
|
|
@@ -125,9 +131,21 @@ export declare class HelixHeadlessScatterChart extends HelixHeadlessScatterChart
|
|
|
125
131
|
*/
|
|
126
132
|
gridlines?: 'both' | 'x' | 'y';
|
|
127
133
|
/**
|
|
128
|
-
* The word the
|
|
134
|
+
* The word for the rows a series rests on, `{pointsLabel}` in
|
|
135
|
+
* `series-label`. `{count}` is how many, so the word takes its plural
|
|
136
|
+
* forms: `{count, plural, one {punkt} few {punkty} other {punktów}}`.
|
|
129
137
|
*/
|
|
130
138
|
pointsLabel: string;
|
|
139
|
+
/**
|
|
140
|
+
* What the summary says of each series. `{y}` is what the series measures up,
|
|
141
|
+
* `{x}` what the chart measures across, `{count}` how many rows it rests on,
|
|
142
|
+
* written in the locale, `{pointsLabel}` the word for them, and
|
|
143
|
+
* `{correlation}` its correlation, or `none` where there are fewer than
|
|
144
|
+
* three points or no spread to measure, so each case is a whole sentence:
|
|
145
|
+
* `{correlation, select, none {...} other {...}}`. `{correlationLabel}` is
|
|
146
|
+
* `correlation-label`.
|
|
147
|
+
*/
|
|
148
|
+
seriesLabel: string;
|
|
131
149
|
/**
|
|
132
150
|
* The heading of a column whose numbers size the points, such as
|
|
133
151
|
* `Population`, which makes the chart a bubble chart.
|
|
@@ -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 { CHART_PLOT, customElement, drawTooltip, extent, formatNumbers, HelixElement, isRtl, linear, MixinChartSource, PLOT_HEIGHT, PLOT_WIDTH, seriesIndex, ticks, } from '@fusion.dev/helix-core';
|
|
7
|
+
import { CHART_PLOT, customElement, drawTooltip, extent, formatNumbers, formatWords, HelixElement, isRtl, linear, MixinChartSource, PLOT_HEIGHT, PLOT_WIDTH, seriesIndex, ticks, words, wordsLocale, } from '@fusion.dev/helix-core';
|
|
8
8
|
import { html, nothing, svg } from 'lit';
|
|
9
9
|
import { property } from 'lit/decorators.js';
|
|
10
10
|
import '../../tooltip/index.js';
|
|
@@ -37,7 +37,8 @@ let HelixHeadlessScatterChart = class HelixHeadlessScatterChart extends MixinCha
|
|
|
37
37
|
constructor() {
|
|
38
38
|
super(...arguments);
|
|
39
39
|
this.correlationLabel = 'correlation';
|
|
40
|
-
this.pointsLabel = 'points';
|
|
40
|
+
this.pointsLabel = '{count, plural, one {point} other {points}}';
|
|
41
|
+
this.seriesLabel = '{correlation, select, none {{y} / {x}: {count} {pointsLabel}} other {{y} / {x}: {count} {pointsLabel}, {correlationLabel} {correlation}}}';
|
|
41
42
|
this.sizeBy = '';
|
|
42
43
|
this.trend = false;
|
|
43
44
|
this.drawn = [];
|
|
@@ -72,6 +73,7 @@ let HelixHeadlessScatterChart = class HelixHeadlessScatterChart extends MixinCha
|
|
|
72
73
|
this.nearest = undefined;
|
|
73
74
|
};
|
|
74
75
|
}
|
|
76
|
+
static { this.words = 'helix-scatter-chart'; }
|
|
75
77
|
connectedCallback() {
|
|
76
78
|
super.connectedCallback();
|
|
77
79
|
this.pointer.axis = 'none';
|
|
@@ -137,7 +139,7 @@ let HelixHeadlessScatterChart = class HelixHeadlessScatterChart extends MixinCha
|
|
|
137
139
|
<div id=${CHART_PLOT} part="plot"></div>
|
|
138
140
|
</div>`;
|
|
139
141
|
}
|
|
140
|
-
const format = formatNumbers(this
|
|
142
|
+
const format = formatNumbers(wordsLocale(this));
|
|
141
143
|
const along = linear(field.x, [0, PLOT_WIDTH]);
|
|
142
144
|
const up = linear(field.y, [PLOT_HEIGHT, 0]);
|
|
143
145
|
return html `<div dir="ltr" part="plane">
|
|
@@ -216,11 +218,18 @@ let HelixHeadlessScatterChart = class HelixHeadlessScatterChart extends MixinCha
|
|
|
216
218
|
});
|
|
217
219
|
}
|
|
218
220
|
renderSummary(field) {
|
|
221
|
+
const coefficient = coefficientIn(wordsLocale(this));
|
|
219
222
|
const clauses = field.yNames.map((name, depth) => {
|
|
220
223
|
const pairs = field.pairs[depth] ?? [];
|
|
221
224
|
const r = correlation(pairs);
|
|
222
|
-
|
|
223
|
-
|
|
225
|
+
return formatWords(this, 'seriesLabel', {
|
|
226
|
+
correlation: r === undefined ? 'none' : coefficient.format(r),
|
|
227
|
+
correlationLabel: this.correlationLabel,
|
|
228
|
+
count: pairs.length,
|
|
229
|
+
pointsLabel: formatWords(this, 'pointsLabel', { count: pairs.length }),
|
|
230
|
+
x: field.xName,
|
|
231
|
+
y: name,
|
|
232
|
+
});
|
|
224
233
|
});
|
|
225
234
|
const named = this.named ? `${this.named}. ` : '';
|
|
226
235
|
return html `<p id="helix-chart-summary" part="summary">${named}${clauses.join('; ')}.</p>`;
|
|
@@ -246,14 +255,20 @@ let HelixHeadlessScatterChart = class HelixHeadlessScatterChart extends MixinCha
|
|
|
246
255
|
}
|
|
247
256
|
};
|
|
248
257
|
__decorate([
|
|
258
|
+
words,
|
|
249
259
|
property({ attribute: 'correlation-label' })
|
|
250
260
|
], HelixHeadlessScatterChart.prototype, "correlationLabel", void 0);
|
|
251
261
|
__decorate([
|
|
252
262
|
property()
|
|
253
263
|
], HelixHeadlessScatterChart.prototype, "gridlines", void 0);
|
|
254
264
|
__decorate([
|
|
265
|
+
words,
|
|
255
266
|
property({ attribute: 'points-label' })
|
|
256
267
|
], HelixHeadlessScatterChart.prototype, "pointsLabel", void 0);
|
|
268
|
+
__decorate([
|
|
269
|
+
words,
|
|
270
|
+
property({ attribute: 'series-label' })
|
|
271
|
+
], HelixHeadlessScatterChart.prototype, "seriesLabel", void 0);
|
|
257
272
|
__decorate([
|
|
258
273
|
property({ attribute: 'size-by' })
|
|
259
274
|
], HelixHeadlessScatterChart.prototype, "sizeBy", void 0);
|
|
@@ -104,6 +104,11 @@ declare const HelixHeadlessSelect_base: (new (...args: any[]) => import("@fusion
|
|
|
104
104
|
* @cssstate open - While the list is open.
|
|
105
105
|
*/
|
|
106
106
|
export declare class HelixHeadlessSelect extends HelixHeadlessSelect_base {
|
|
107
|
+
/**
|
|
108
|
+
* The key this family's words are registered under, its styled tag:
|
|
109
|
+
* `registerWords('de', { 'helix-select': { placeholder: 'Auswählen' } })`.
|
|
110
|
+
*/
|
|
111
|
+
static words: string;
|
|
107
112
|
protected readonly aria: AriaForwardController;
|
|
108
113
|
/** The region a choice made on the closed trigger is said from. */
|
|
109
114
|
private readonly status;
|
|
@@ -194,6 +199,12 @@ export declare class HelixHeadlessSelect extends HelixHeadlessSelect_base {
|
|
|
194
199
|
* write a function in markup.
|
|
195
200
|
*/
|
|
196
201
|
valueContent?: ((chosen: readonly HelixHeadlessOption[]) => unknown) | undefined;
|
|
202
|
+
/**
|
|
203
|
+
* The message reported when the field is required and nothing is chosen.
|
|
204
|
+
* Absent, or empty, is this sentence, or the words registered for the page's
|
|
205
|
+
* locale.
|
|
206
|
+
*/
|
|
207
|
+
valueMissingMessage: string;
|
|
197
208
|
/**
|
|
198
209
|
* Which option is chosen, as an index, or `-1` where none is.
|
|
199
210
|
*
|