@fusion.dev/helix-headless 0.0.0-dev → 0.0.3
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 +4513 -4483
- package/dist/accordion/item/accordion-item.d.ts +13 -15
- package/dist/accordion/item/accordion-item.js +15 -17
- package/dist/announcement/root/announcement-root.d.ts +7 -25
- package/dist/announcement/root/announcement-root.js +7 -20
- package/dist/app-header/root/app-header-root.d.ts +10 -17
- package/dist/app-header/root/app-header-root.js +9 -18
- package/dist/avatar/group/avatar-group.d.ts +10 -19
- package/dist/avatar/group/avatar-group.js +12 -17
- package/dist/avatar/root/avatar-root.d.ts +8 -8
- package/dist/avatar/root/avatar-root.js +19 -20
- package/dist/badge/root/badge-root.d.ts +6 -6
- package/dist/badge/root/badge-root.js +13 -13
- package/dist/bar-chart/root/bar-chart-root.d.ts +21 -29
- package/dist/bar-chart/root/bar-chart-root.js +42 -57
- package/dist/breadcrumbs/breadcrumb/breadcrumb.d.ts +12 -18
- package/dist/breadcrumbs/breadcrumb/breadcrumb.js +13 -16
- package/dist/breadcrumbs/root/breadcrumbs-root.d.ts +9 -28
- package/dist/breadcrumbs/root/breadcrumbs-root.js +9 -28
- package/dist/button/root/button-root.d.ts +84 -94
- package/dist/button/root/button-root.js +82 -92
- package/dist/callout/root/callout-root.d.ts +4 -5
- package/dist/carousel/root/carousel-root.d.ts +59 -71
- package/dist/carousel/root/carousel-root.js +73 -101
- package/dist/chat/composer/chat-composer.d.ts +29 -33
- package/dist/chat/composer/chat-composer.js +40 -44
- package/dist/chat/message/chat-message.d.ts +25 -25
- package/dist/chat/message/chat-message.js +26 -26
- package/dist/chat/root/chat-root.d.ts +28 -41
- package/dist/chat/root/chat-root.js +27 -40
- package/dist/checkbox/root/checkbox-root.d.ts +10 -12
- package/dist/checkbox/root/checkbox-root.js +29 -35
- package/dist/checkbox-group/root/checkbox-group-root.d.ts +32 -45
- package/dist/checkbox-group/root/checkbox-group-root.js +53 -79
- package/dist/code-block/root/code-block-root.d.ts +3 -4
- package/dist/code-block/root/code-block-root.js +8 -12
- package/dist/color-input/root/color-input-root.d.ts +36 -37
- package/dist/color-input/root/color-input-root.js +29 -34
- package/dist/color-picker/color.d.ts +7 -8
- package/dist/color-picker/color.js +7 -8
- package/dist/color-picker/root/color-picker-root.d.ts +55 -57
- package/dist/color-picker/root/color-picker-root.js +60 -64
- package/dist/combobox/root/combobox-root.d.ts +53 -58
- package/dist/combobox/root/combobox-root.js +85 -94
- package/dist/command/root/command-root.d.ts +8 -8
- package/dist/command/root/command-root.js +29 -33
- package/dist/copy-button/root/copy-button-root.d.ts +21 -24
- package/dist/copy-button/root/copy-button-root.js +25 -35
- package/dist/data-table/root/data-table-root.d.ts +77 -76
- package/dist/data-table/root/data-table-root.js +95 -84
- package/dist/data-table/root/order.d.ts +2 -2
- package/dist/data-table/root/order.js +1 -3
- package/dist/date-input/root/date-input-root.d.ts +88 -93
- package/dist/date-input/root/date-input-root.js +147 -158
- package/dist/date-picker/root/date-picker-root.d.ts +75 -83
- package/dist/date-picker/root/date-picker-root.js +120 -143
- package/dist/dialog/root/dialog-root.d.ts +41 -24
- package/dist/dialog/root/dialog-root.js +47 -24
- package/dist/divider/root/divider-root.d.ts +5 -6
- package/dist/divider/root/divider-root.js +4 -5
- package/dist/donut-chart/root/donut-chart-root.d.ts +22 -25
- package/dist/donut-chart/root/donut-chart-root.js +37 -51
- package/dist/drawer/root/drawer-root.d.ts +24 -29
- package/dist/drawer/root/drawer-root.js +15 -22
- package/dist/drilldown/item/drilldown-item.d.ts +14 -14
- package/dist/drilldown/item/drilldown-item.js +24 -26
- package/dist/drilldown/root/drilldown-root.d.ts +8 -10
- package/dist/drilldown/root/drilldown-root.js +6 -7
- package/dist/element-events.generated.js +1 -1
- package/dist/file-input/root/file-input-root.d.ts +20 -24
- package/dist/file-input/root/file-input-root.js +42 -57
- package/dist/format-date/root/format-date-root.js +1 -1
- package/dist/heatmap/root/buckets.d.ts +8 -8
- package/dist/heatmap/root/buckets.js +8 -8
- package/dist/heatmap/root/heatmap-root.d.ts +57 -63
- package/dist/heatmap/root/heatmap-root.js +72 -83
- package/dist/icon/root/icon-root.d.ts +4 -4
- package/dist/icon/root/icon-root.js +9 -9
- package/dist/icon-button/root/icon-button-root.d.ts +4 -6
- package/dist/icon-button/root/icon-button-root.js +4 -6
- package/dist/image/root/image-root.d.ts +49 -59
- package/dist/image/root/image-root.js +55 -65
- package/dist/index.d.ts +5 -5
- package/dist/index.js +5 -5
- package/dist/input/root/input-root.d.ts +61 -85
- package/dist/input/root/input-root.js +79 -106
- package/dist/kbd/root/kbd-root.d.ts +8 -7
- package/dist/kbd/root/kbd-root.js +71 -11
- package/dist/legend/root/legend-root.d.ts +1 -1
- package/dist/legend/root/legend-root.js +4 -5
- package/dist/line-chart/root/line-chart-root.d.ts +26 -30
- package/dist/line-chart/root/line-chart-root.js +10 -10
- package/dist/list/item/list-item.d.ts +14 -18
- package/dist/list/item/list-item.js +18 -22
- package/dist/list/root/list-root.d.ts +4 -4
- package/dist/list/root/list-root.js +3 -3
- package/dist/listbox/root/listbox-root.d.ts +31 -58
- package/dist/listbox/root/listbox-root.js +66 -109
- package/dist/megamenu/root/megamenu-root.d.ts +34 -35
- package/dist/megamenu/root/megamenu-root.js +53 -58
- package/dist/menu/item/menu-item.d.ts +39 -53
- package/dist/menu/item/menu-item.js +50 -64
- package/dist/menu/root/menu-root.d.ts +30 -40
- package/dist/menu/root/menu-root.js +49 -82
- package/dist/meter/root/meter-root.d.ts +49 -53
- package/dist/meter/root/meter-root.js +22 -27
- package/dist/navigation/root/navigation-root.js +11 -19
- package/dist/notifications/notification/notification.d.ts +16 -22
- package/dist/notifications/notification/notification.js +21 -27
- package/dist/notifications/root/notifications-root.d.ts +31 -39
- package/dist/notifications/root/notifications-root.js +41 -52
- package/dist/number-input/root/number-input-root.d.ts +31 -33
- package/dist/number-input/root/number-input-root.js +37 -39
- package/dist/option/root/option-root.d.ts +73 -74
- package/dist/option/root/option-root.js +62 -64
- package/dist/outline/root/outline-root.d.ts +38 -44
- package/dist/outline/root/outline-root.js +66 -82
- package/dist/pagination/root/pagination-root.d.ts +87 -92
- package/dist/pagination/root/pagination-root.js +116 -123
- package/dist/pagination/size/pagination-size.d.ts +31 -50
- package/dist/pagination/size/pagination-size.js +35 -55
- package/dist/pagination/summary/pagination-summary.d.ts +12 -12
- package/dist/pagination/summary/pagination-summary.js +18 -18
- package/dist/pin-input/root/pin-input-root.d.ts +53 -70
- package/dist/pin-input/root/pin-input-root.js +74 -94
- package/dist/popover/root/popover-root.d.ts +15 -20
- package/dist/popover/root/popover-root.js +19 -36
- package/dist/progress/root/progress-root.d.ts +12 -14
- package/dist/progress/root/progress-root.js +22 -25
- package/dist/qr-code/root/qr-code-root.d.ts +11 -11
- package/dist/qr-code/root/qr-code-root.js +12 -14
- package/dist/radio/group/radio-group.js +19 -26
- package/dist/radio/root/radio-root.d.ts +12 -13
- package/dist/radio/root/radio-root.js +12 -13
- package/dist/rating/root/rating-root.d.ts +25 -30
- package/dist/rating/root/rating-root.js +43 -50
- package/dist/scroll-area/root/scroll-area-root.d.ts +11 -14
- package/dist/scroll-area/root/scroll-area-root.js +39 -33
- package/dist/select/root/select-root.d.ts +7 -12
- package/dist/select/root/select-root.js +40 -55
- package/dist/slider/root/slider-root.d.ts +53 -60
- package/dist/slider/root/slider-root.js +74 -85
- package/dist/sparkline/root/sparkline-root.d.ts +43 -47
- package/dist/sparkline/root/sparkline-root.js +23 -32
- package/dist/speed-dial/item/speed-dial-item.d.ts +6 -6
- package/dist/speed-dial/item/speed-dial-item.js +9 -9
- package/dist/speed-dial/root/speed-dial-root.d.ts +21 -25
- package/dist/speed-dial/root/speed-dial-root.js +32 -40
- package/dist/splitter/root/splitter-root.d.ts +98 -111
- package/dist/splitter/root/splitter-root.js +96 -123
- package/dist/stat/root/stat-root.d.ts +2 -7
- package/dist/stat/root/stat-root.js +0 -5
- package/dist/steps/step/step.d.ts +19 -24
- package/dist/steps/step/step.js +27 -32
- package/dist/switch/root/switch-root.js +2 -2
- package/dist/table/column/table-column.d.ts +54 -60
- package/dist/table/column/table-column.js +95 -68
- package/dist/table/root/table-root.d.ts +5 -6
- package/dist/table/root/table-root.js +7 -10
- package/dist/tabs/panel/tab-panel.d.ts +21 -25
- package/dist/tabs/panel/tab-panel.js +25 -29
- package/dist/tabs/root/tabs-root.d.ts +25 -34
- package/dist/tabs/root/tabs-root.js +22 -28
- package/dist/tabs/tab/tab.d.ts +12 -12
- package/dist/tabs/tab/tab.js +19 -20
- package/dist/textarea/root/textarea-root.d.ts +36 -36
- package/dist/textarea/root/textarea-root.js +43 -47
- package/dist/time-input/root/time-input-root.d.ts +58 -68
- package/dist/time-input/root/time-input-root.js +62 -77
- package/dist/time-picker/root/time-picker-root.d.ts +73 -79
- package/dist/time-picker/root/time-picker-root.js +72 -84
- package/dist/timeline/item/timeline-item.d.ts +8 -11
- package/dist/timeline/item/timeline-item.js +8 -11
- package/dist/timeline/root/timeline-root.d.ts +5 -7
- package/dist/timeline/root/timeline-root.js +5 -7
- package/dist/toast/item/toast-item.d.ts +9 -27
- package/dist/toast/item/toast-item.js +19 -41
- package/dist/toast/root/toast-root.d.ts +10 -14
- package/dist/toast/root/toast-root.js +4 -5
- package/dist/toggle/group/toggle-group.d.ts +6 -15
- package/dist/toggle/group/toggle-group.js +21 -36
- package/dist/toggle/root/toggle-root.d.ts +26 -27
- package/dist/toggle/root/toggle-root.js +30 -31
- package/dist/toolbar/root/toolbar-root.d.ts +7 -10
- package/dist/toolbar/root/toolbar-root.js +10 -14
- package/dist/tooltip/root/tooltip-root.d.ts +52 -59
- package/dist/tooltip/root/tooltip-root.js +98 -93
- package/dist/tour/root/tour-root.d.ts +19 -23
- package/dist/tour/root/tour-root.js +31 -41
- package/dist/tour/stop/tour-stop.d.ts +14 -15
- package/dist/tour/stop/tour-stop.js +31 -34
- package/dist/tree/item/tree-item.d.ts +30 -35
- package/dist/tree/item/tree-item.js +43 -55
- package/dist/tree/root/tree-root.d.ts +7 -10
- package/dist/tree/root/tree-root.js +33 -42
- package/dist/trend/root/trend-root.d.ts +3 -5
- package/dist/trend/root/trend-root.js +5 -9
- package/dist/video/root/video-root.d.ts +100 -124
- package/dist/video/root/video-root.js +142 -176
- package/dist/video-playlist/item/video-playlist-item.d.ts +16 -16
- package/dist/video-playlist/item/video-playlist-item.js +24 -24
- package/dist/video-playlist/menu/video-playlist-menu.d.ts +5 -8
- package/dist/video-playlist/menu/video-playlist-menu.js +20 -29
- package/dist/video-playlist/root/video-playlist-root.d.ts +16 -11
- package/dist/video-playlist/root/video-playlist-root.js +21 -25
- package/dist/virtual-list/root/virtual-list-root.d.ts +8 -12
- package/dist/virtual-list/root/virtual-list-root.js +11 -16
- package/jsx.d.ts +9797 -12561
- package/package.json +6 -6
- package/vue.d.ts +2684 -3228
|
@@ -21,10 +21,8 @@ const isFinder = (x, y, size) => {
|
|
|
21
21
|
* tree walks, and every one of them is a one-unit square.
|
|
22
22
|
*
|
|
23
23
|
* **`square` joins runs and the other styles cannot.** A row of eight square
|
|
24
|
-
* modules is one `h8
|
|
25
|
-
*
|
|
26
|
-
* and a joined run has no corners in the middle of it. So the cost of the other
|
|
27
|
-
* styles is real and is paid only by the codes that ask for them.
|
|
24
|
+
* modules is one `h8`; a row of eight *rounded* ones is eight shapes, because
|
|
25
|
+
* the corners are what is being drawn and a joined run has none in the middle.
|
|
28
26
|
*
|
|
29
27
|
* `only` splits the drawing in two without walking the matrix twice: the finder
|
|
30
28
|
* squares are structural, at three known corners, so a caller can ask for them
|
|
@@ -59,7 +57,7 @@ const pathFor = (matrix, style, only = 'all') => {
|
|
|
59
57
|
return parts.join('');
|
|
60
58
|
}
|
|
61
59
|
/* A circle for `dots` and a squircle for `rounded`, both drawn as arcs on a
|
|
62
|
-
one-unit square. The radius is a little under half so
|
|
60
|
+
one-unit square. The radius is a little under half so neighboring dots do
|
|
63
61
|
not touch, which is what makes a dotted code read as dots rather than as a
|
|
64
62
|
square one with soft edges. */
|
|
65
63
|
const r = style === 'dots' ? 0.45 : 0.28;
|
|
@@ -123,10 +121,6 @@ const pathFor = (matrix, style, only = 'all') => {
|
|
|
123
121
|
let HelixHeadlessQrCode = class HelixHeadlessQrCode extends HelixElement {
|
|
124
122
|
constructor() {
|
|
125
123
|
super(...arguments);
|
|
126
|
-
/**
|
|
127
|
-
* What the code encodes, which is usually a URL.
|
|
128
|
-
*/
|
|
129
|
-
this.value = '';
|
|
130
124
|
/**
|
|
131
125
|
* What the image is called.
|
|
132
126
|
*
|
|
@@ -144,10 +138,14 @@ let HelixHeadlessQrCode = class HelixHeadlessQrCode extends HelixElement {
|
|
|
144
138
|
* middle. That cost is paid only by a code that asks for them.
|
|
145
139
|
*
|
|
146
140
|
* A scanner reads contrast between cells, not their shape, so all three
|
|
147
|
-
* scan. `dots` sits a little under half a module so
|
|
141
|
+
* scan. `dots` sits a little under half a module so neighbors do not touch,
|
|
148
142
|
* which is what makes it read as dots rather than as a softened square code.
|
|
149
143
|
*/
|
|
150
144
|
this.shape = 'square';
|
|
145
|
+
/**
|
|
146
|
+
* What the code encodes, which is usually a URL.
|
|
147
|
+
*/
|
|
148
|
+
this.value = '';
|
|
151
149
|
/** Whether anything is slotted into the middle. */
|
|
152
150
|
this.logo = false;
|
|
153
151
|
}
|
|
@@ -216,8 +214,8 @@ let HelixHeadlessQrCode = class HelixHeadlessQrCode extends HelixElement {
|
|
|
216
214
|
}
|
|
217
215
|
};
|
|
218
216
|
__decorate([
|
|
219
|
-
property()
|
|
220
|
-
], HelixHeadlessQrCode.prototype, "
|
|
217
|
+
property({ attribute: 'correction' })
|
|
218
|
+
], HelixHeadlessQrCode.prototype, "correction", void 0);
|
|
221
219
|
__decorate([
|
|
222
220
|
property()
|
|
223
221
|
], HelixHeadlessQrCode.prototype, "label", void 0);
|
|
@@ -225,8 +223,8 @@ __decorate([
|
|
|
225
223
|
property()
|
|
226
224
|
], HelixHeadlessQrCode.prototype, "shape", void 0);
|
|
227
225
|
__decorate([
|
|
228
|
-
property(
|
|
229
|
-
], HelixHeadlessQrCode.prototype, "
|
|
226
|
+
property()
|
|
227
|
+
], HelixHeadlessQrCode.prototype, "value", void 0);
|
|
230
228
|
HelixHeadlessQrCode = __decorate([
|
|
231
229
|
customElement('helix-headless-qr-code')
|
|
232
230
|
], HelixHeadlessQrCode);
|
|
@@ -55,15 +55,14 @@ let HelixHeadlessRadioGroup = class HelixHeadlessRadioGroup extends MixinControl
|
|
|
55
55
|
/* Moving and choosing are one act, which is the radio group pattern and is
|
|
56
56
|
what this controller exists to stop being written per component. */
|
|
57
57
|
/* Registered rather than held. A controller adds itself to the host, so there
|
|
58
|
-
is no reference to keep
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
58
|
+
is no reference to keep, and nothing here talks to it after construction.
|
|
59
|
+
`protected` rather than `private` because a private field nothing reads is
|
|
60
|
+
an unused one, and the subclass tier is where a consumer would reach for
|
|
61
|
+
it. */
|
|
62
62
|
this.keys = new KeyboardNavigationController(this, { items: () => this.items });
|
|
63
|
-
/* Stated once, and the group never thinks about it again.
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
group would have got none at all. */
|
|
63
|
+
/* Stated once, and the group never thinks about it again. Hand calls from
|
|
64
|
+
each method that could disable an item reach different paths per
|
|
65
|
+
component; the controller is what stops that being written per group. */
|
|
67
66
|
this.cascade = new DisabledCascadeController(this, {
|
|
68
67
|
items: () => this.items,
|
|
69
68
|
});
|
|
@@ -93,17 +92,14 @@ let HelixHeadlessRadioGroup = class HelixHeadlessRadioGroup extends MixinControl
|
|
|
93
92
|
item.selected = item.value === this.value;
|
|
94
93
|
}
|
|
95
94
|
/* Nothing chosen yet, so the first item is the tab stop. A group where
|
|
96
|
-
every item is `tabindex="-1"` is a group the keyboard cannot enter
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
* `entered` rather than a bare toggle, because this also runs when the
|
|
105
|
-
* group is answered and the attribute has to go whether or not this call is
|
|
106
|
-
* the one that put it there. */
|
|
95
|
+
every item is `tabindex="-1"` is a group the keyboard cannot enter, and
|
|
96
|
+
an answered group that keeps the entry stop carries two, so tabbing
|
|
97
|
+
through a form stops twice on one question and the first stop is on an
|
|
98
|
+
item that is not the answer.
|
|
99
|
+
|
|
100
|
+
`entered` rather than a bare toggle, because this also runs when the
|
|
101
|
+
group is answered and the attribute has to go whether or not this call is
|
|
102
|
+
the one that put it there. */
|
|
107
103
|
const entered = this.value === '' && items.length > 0 ? items[0] : undefined;
|
|
108
104
|
for (const item of items) {
|
|
109
105
|
if (item === entered) {
|
|
@@ -135,13 +131,10 @@ let HelixHeadlessRadioGroup = class HelixHeadlessRadioGroup extends MixinControl
|
|
|
135
131
|
element references on the client, and those win where a consumer slotted
|
|
136
132
|
a label richer than a string. */
|
|
137
133
|
hostAria(this.internals, { label: this.label, role: 'radiogroup' });
|
|
138
|
-
/*
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
* a mark beside its label they could not see and no announcement of why the
|
|
143
|
-
* form would refuse it. The stylesheet drawing that asterisk depends on the
|
|
144
|
-
* control saying so. */
|
|
134
|
+
/* `required` reflects, sets validity and paints the asterisk the field
|
|
135
|
+
sheet draws, and tells the accessibility tree nothing on its own. Without
|
|
136
|
+
this a reader meets a mark beside the label they cannot see, and no
|
|
137
|
+
announcement of why the form would refuse the group. */
|
|
145
138
|
this.internals.ariaRequired = this.required ? 'true' : null;
|
|
146
139
|
}
|
|
147
140
|
updated(changed) {
|
|
@@ -53,11 +53,10 @@ export declare class HelixHeadlessRadio extends HelixElement {
|
|
|
53
53
|
* the markup said at upgrade, before anything could overwrite it: read the
|
|
54
54
|
* attribute later and the listbox's own writes answer instead.
|
|
55
55
|
*
|
|
56
|
-
* **The deeper half is
|
|
57
|
-
*
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
* on, which is a change of its own rather than a property being added.
|
|
56
|
+
* **The deeper half is not this.** State reflecting under the declaration's
|
|
57
|
+
* name is the fault `TreeItem` avoids by mirroring to `data-selected`.
|
|
58
|
+
* Splitting them means moving what every stylesheet selects on, which is a
|
|
59
|
+
* change of its own rather than a property being added.
|
|
61
60
|
*/
|
|
62
61
|
get defaultSelected(): boolean;
|
|
63
62
|
set defaultSelected(next: boolean);
|
|
@@ -80,17 +79,17 @@ export declare class HelixHeadlessRadio extends HelixElement {
|
|
|
80
79
|
/**
|
|
81
80
|
* Mirrors the chosen state where a stylesheet can select on it.
|
|
82
81
|
*
|
|
83
|
-
* **A custom state
|
|
84
|
-
*
|
|
85
|
-
*
|
|
86
|
-
*
|
|
87
|
-
*
|
|
88
|
-
*
|
|
89
|
-
*
|
|
82
|
+
* **A custom state rather than the `selected` attribute.** The parent writes
|
|
83
|
+
* this: a listbox choosing a row, a tab strip moving the tab, a radio group
|
|
84
|
+
* answering for its set. Reflected, that puts the element's own bookkeeping
|
|
85
|
+
* onto markup a consumer wrote and a consumer's server never sent, which
|
|
86
|
+
* React reconciles and reports as a mismatch, and which a serialized element
|
|
87
|
+
* pasted back declares as a choice nobody made. `ElementInternals` holds it
|
|
88
|
+
* instead, where it is not in the DOM at all.
|
|
90
89
|
*
|
|
91
90
|
* Reading `selected` is unaffected and so is writing it: the attribute still
|
|
92
91
|
* seeds the property, which is what `<helix-radio selected>` in a consumer's
|
|
93
|
-
* markup means.
|
|
92
|
+
* markup means. There is no write back.
|
|
94
93
|
*/
|
|
95
94
|
protected willUpdate(changed: PropertyValues): void;
|
|
96
95
|
protected render(): TemplateResult;
|
|
@@ -75,11 +75,10 @@ let HelixHeadlessRadio = class HelixHeadlessRadio extends HelixElement {
|
|
|
75
75
|
* the markup said at upgrade, before anything could overwrite it: read the
|
|
76
76
|
* attribute later and the listbox's own writes answer instead.
|
|
77
77
|
*
|
|
78
|
-
* **The deeper half is
|
|
79
|
-
*
|
|
80
|
-
*
|
|
81
|
-
*
|
|
82
|
-
* on, which is a change of its own rather than a property being added.
|
|
78
|
+
* **The deeper half is not this.** State reflecting under the declaration's
|
|
79
|
+
* name is the fault `TreeItem` avoids by mirroring to `data-selected`.
|
|
80
|
+
* Splitting them means moving what every stylesheet selects on, which is a
|
|
81
|
+
* change of its own rather than a property being added.
|
|
83
82
|
*/
|
|
84
83
|
get defaultSelected() {
|
|
85
84
|
return this.seeded;
|
|
@@ -101,17 +100,17 @@ let HelixHeadlessRadio = class HelixHeadlessRadio extends HelixElement {
|
|
|
101
100
|
/**
|
|
102
101
|
* Mirrors the chosen state where a stylesheet can select on it.
|
|
103
102
|
*
|
|
104
|
-
* **A custom state
|
|
105
|
-
*
|
|
106
|
-
*
|
|
107
|
-
*
|
|
108
|
-
*
|
|
109
|
-
*
|
|
110
|
-
*
|
|
103
|
+
* **A custom state rather than the `selected` attribute.** The parent writes
|
|
104
|
+
* this: a listbox choosing a row, a tab strip moving the tab, a radio group
|
|
105
|
+
* answering for its set. Reflected, that puts the element's own bookkeeping
|
|
106
|
+
* onto markup a consumer wrote and a consumer's server never sent, which
|
|
107
|
+
* React reconciles and reports as a mismatch, and which a serialized element
|
|
108
|
+
* pasted back declares as a choice nobody made. `ElementInternals` holds it
|
|
109
|
+
* instead, where it is not in the DOM at all.
|
|
111
110
|
*
|
|
112
111
|
* Reading `selected` is unaffected and so is writing it: the attribute still
|
|
113
112
|
* seeds the property, which is what `<helix-radio selected>` in a consumer's
|
|
114
|
-
* markup means.
|
|
113
|
+
* markup means. There is no write back.
|
|
115
114
|
*/
|
|
116
115
|
willUpdate(changed) {
|
|
117
116
|
super.willUpdate(changed);
|
|
@@ -5,12 +5,10 @@ declare const HelixHeadlessRating_base: (new (...args: any[]) => import("@fusion
|
|
|
5
5
|
* @summary A score out of a few marks, given or shown.
|
|
6
6
|
*
|
|
7
7
|
* @description
|
|
8
|
-
* **Half marks decide the shape
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
* than added later, when the pointer handling would have to be rewritten around
|
|
13
|
-
* it.
|
|
8
|
+
* **Half marks decide the shape.** Supporting them means the value is not an
|
|
9
|
+
* integer and the targets are not the marks: five stars at a half step is ten
|
|
10
|
+
* places to press, and a mark that is filled to the middle. The pointer handling
|
|
11
|
+
* and `step` are both built around that rather than added over it.
|
|
14
12
|
*
|
|
15
13
|
* **A partial mark is the whole mark, clipped.** Not a second glyph filled to
|
|
16
14
|
* the middle: that needs a matching pair drawn for every mark anybody uses, and
|
|
@@ -18,7 +16,7 @@ declare const HelixHeadlessRating_base: (new (...args: any[]) => import("@fusion
|
|
|
18
16
|
* fill is the same marks over the same marks, cut off partway, so any mark works
|
|
19
17
|
* and any fraction does.
|
|
20
18
|
*
|
|
21
|
-
* **Read-only is not this control
|
|
19
|
+
* **Read-only is not this control grayed out, it is a different thing.** The
|
|
22
20
|
* commoner use is showing a score nobody is being asked for, a product's
|
|
23
21
|
* average, and that is not a control at all: it takes no focus, answers no keys,
|
|
24
22
|
* has no options to choose between, and reads as one thing rather than as five.
|
|
@@ -83,13 +81,6 @@ export declare class HelixHeadlessRating extends HelixHeadlessRating_base {
|
|
|
83
81
|
* `required`, not by making one unreachable.
|
|
84
82
|
*/
|
|
85
83
|
min: number;
|
|
86
|
-
/**
|
|
87
|
-
* The smallest part of a mark that can be chosen.
|
|
88
|
-
*
|
|
89
|
-
* `0.5` is the half star, and it is the reason the value is a number rather
|
|
90
|
-
* than an index: with halves, five marks are ten answers.
|
|
91
|
-
*/
|
|
92
|
-
step: number;
|
|
93
84
|
/**
|
|
94
85
|
* Whether this shows a score rather than asks for one.
|
|
95
86
|
*
|
|
@@ -97,15 +88,6 @@ export declare class HelixHeadlessRating extends HelixHeadlessRating_base {
|
|
|
97
88
|
* answers no keys, and reads as one thing: see the note on the class.
|
|
98
89
|
*/
|
|
99
90
|
readOnly: boolean;
|
|
100
|
-
/**
|
|
101
|
-
* How the score is read out, where "3.5 out of 5" is not what it should say.
|
|
102
|
-
*
|
|
103
|
-
* A rating out of five is one of the few places a screen reader gets a worse
|
|
104
|
-
* answer from the value than from a sentence: "3.5" alone is a number without
|
|
105
|
-
* a subject. This names the readout, where a control is named by its `label`
|
|
106
|
-
* and each of its options by the score that option is.
|
|
107
|
-
*/
|
|
108
|
-
valueText: string;
|
|
109
91
|
/**
|
|
110
92
|
* Whether the score is written out beside the marks.
|
|
111
93
|
*
|
|
@@ -119,6 +101,22 @@ export declare class HelixHeadlessRating extends HelixHeadlessRating_base {
|
|
|
119
101
|
* reader's own cursor would be worse than no label.
|
|
120
102
|
*/
|
|
121
103
|
showValue: boolean;
|
|
104
|
+
/**
|
|
105
|
+
* The smallest part of a mark that can be chosen.
|
|
106
|
+
*
|
|
107
|
+
* `0.5` is the half star, and it is the reason the value is a number rather
|
|
108
|
+
* than an index: with halves, five marks are ten answers.
|
|
109
|
+
*/
|
|
110
|
+
step: number;
|
|
111
|
+
/**
|
|
112
|
+
* How the score is read out, where "3.5 out of 5" is not what it should say.
|
|
113
|
+
*
|
|
114
|
+
* A rating out of five is one of the few places a screen reader gets a worse
|
|
115
|
+
* answer from the value than from a sentence: "3.5" alone is a number without
|
|
116
|
+
* a subject. This names the readout, where a control is named by its `label`
|
|
117
|
+
* and each of its options by the score that option is.
|
|
118
|
+
*/
|
|
119
|
+
valueText: string;
|
|
122
120
|
/**
|
|
123
121
|
* The shape a consumer slotted, if they slotted one.
|
|
124
122
|
*
|
|
@@ -198,13 +196,10 @@ export declare class HelixHeadlessRating extends HelixHeadlessRating_base {
|
|
|
198
196
|
/**
|
|
199
197
|
* Reports the value, and whether the form may go without one.
|
|
200
198
|
*
|
|
201
|
-
* **`required`
|
|
202
|
-
*
|
|
203
|
-
*
|
|
204
|
-
*
|
|
205
|
-
* This is the case `min` argues for in its own note, that "no rating" and
|
|
206
|
-
* "the worst rating" are different answers and a survey that requires one
|
|
207
|
-
* says so with `required`.
|
|
199
|
+
* **`required` arrives from the mixin, so it prints on the reference page
|
|
200
|
+
* whether or not anything here enforces it.** Without a `setValidity` call a
|
|
201
|
+
* form holding an unrated required rating submits, `:valid` true and the
|
|
202
|
+
* entry present but empty. `reportRequired` is what makes the property real.
|
|
208
203
|
*
|
|
209
204
|
* **Empty is `value === ''` rather than a score of zero**, because zero is a
|
|
210
205
|
* rating a reader can deliberately give when `min` allows it, and refusing to
|
|
@@ -11,12 +11,10 @@ import { property, state } from 'lit/decorators.js';
|
|
|
11
11
|
* @summary A score out of a few marks, given or shown.
|
|
12
12
|
*
|
|
13
13
|
* @description
|
|
14
|
-
* **Half marks decide the shape
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
* than added later, when the pointer handling would have to be rewritten around
|
|
19
|
-
* it.
|
|
14
|
+
* **Half marks decide the shape.** Supporting them means the value is not an
|
|
15
|
+
* integer and the targets are not the marks: five stars at a half step is ten
|
|
16
|
+
* places to press, and a mark that is filled to the middle. The pointer handling
|
|
17
|
+
* and `step` are both built around that rather than added over it.
|
|
20
18
|
*
|
|
21
19
|
* **A partial mark is the whole mark, clipped.** Not a second glyph filled to
|
|
22
20
|
* the middle: that needs a matching pair drawn for every mark anybody uses, and
|
|
@@ -24,7 +22,7 @@ import { property, state } from 'lit/decorators.js';
|
|
|
24
22
|
* fill is the same marks over the same marks, cut off partway, so any mark works
|
|
25
23
|
* and any fraction does.
|
|
26
24
|
*
|
|
27
|
-
* **Read-only is not this control
|
|
25
|
+
* **Read-only is not this control grayed out, it is a different thing.** The
|
|
28
26
|
* commoner use is showing a score nobody is being asked for, a product's
|
|
29
27
|
* average, and that is not a control at all: it takes no focus, answers no keys,
|
|
30
28
|
* has no options to choose between, and reads as one thing rather than as five.
|
|
@@ -78,15 +76,13 @@ let HelixHeadlessRating = class HelixHeadlessRating extends MixinControllerValue
|
|
|
78
76
|
constructor() {
|
|
79
77
|
super(...arguments);
|
|
80
78
|
/*
|
|
81
|
-
* Discrete
|
|
82
|
-
*
|
|
83
|
-
*
|
|
84
|
-
*
|
|
85
|
-
*
|
|
86
|
-
*
|
|
87
|
-
*
|
|
88
|
-
* is the chosen one. That is `helix-before-change`, the same as the radio group this
|
|
89
|
-
* announces itself as.
|
|
79
|
+
* Discrete. `Input`, `Slider`, `NumberInput`, `Textarea` and `PinInput` all
|
|
80
|
+
* announce input, and every one of them is edited continuously: a value passes
|
|
81
|
+
* through every keystroke or pixel on its way to the one meant. A rating does
|
|
82
|
+
* not. A press picks a score, an arrow picks the next one, and the drag
|
|
83
|
+
* deliberately asks for nothing until it is let go, so there is exactly one
|
|
84
|
+
* value and it is the chosen one. That is `helix-before-change`, the same as
|
|
85
|
+
* the radio group this announces itself as.
|
|
90
86
|
*/
|
|
91
87
|
this.announcesInput = false;
|
|
92
88
|
/**
|
|
@@ -102,13 +98,6 @@ let HelixHeadlessRating = class HelixHeadlessRating extends MixinControllerValue
|
|
|
102
98
|
* `required`, not by making one unreachable.
|
|
103
99
|
*/
|
|
104
100
|
this.min = 0;
|
|
105
|
-
/**
|
|
106
|
-
* The smallest part of a mark that can be chosen.
|
|
107
|
-
*
|
|
108
|
-
* `0.5` is the half star, and it is the reason the value is a number rather
|
|
109
|
-
* than an index: with halves, five marks are ten answers.
|
|
110
|
-
*/
|
|
111
|
-
this.step = 1;
|
|
112
101
|
/**
|
|
113
102
|
* Whether this shows a score rather than asks for one.
|
|
114
103
|
*
|
|
@@ -116,15 +105,6 @@ let HelixHeadlessRating = class HelixHeadlessRating extends MixinControllerValue
|
|
|
116
105
|
* answers no keys, and reads as one thing: see the note on the class.
|
|
117
106
|
*/
|
|
118
107
|
this.readOnly = false;
|
|
119
|
-
/**
|
|
120
|
-
* How the score is read out, where "3.5 out of 5" is not what it should say.
|
|
121
|
-
*
|
|
122
|
-
* A rating out of five is one of the few places a screen reader gets a worse
|
|
123
|
-
* answer from the value than from a sentence: "3.5" alone is a number without
|
|
124
|
-
* a subject. This names the readout, where a control is named by its `label`
|
|
125
|
-
* and each of its options by the score that option is.
|
|
126
|
-
*/
|
|
127
|
-
this.valueText = '';
|
|
128
108
|
/**
|
|
129
109
|
* Whether the score is written out beside the marks.
|
|
130
110
|
*
|
|
@@ -138,6 +118,22 @@ let HelixHeadlessRating = class HelixHeadlessRating extends MixinControllerValue
|
|
|
138
118
|
* reader's own cursor would be worse than no label.
|
|
139
119
|
*/
|
|
140
120
|
this.showValue = false;
|
|
121
|
+
/**
|
|
122
|
+
* The smallest part of a mark that can be chosen.
|
|
123
|
+
*
|
|
124
|
+
* `0.5` is the half star, and it is the reason the value is a number rather
|
|
125
|
+
* than an index: with halves, five marks are ten answers.
|
|
126
|
+
*/
|
|
127
|
+
this.step = 1;
|
|
128
|
+
/**
|
|
129
|
+
* How the score is read out, where "3.5 out of 5" is not what it should say.
|
|
130
|
+
*
|
|
131
|
+
* A rating out of five is one of the few places a screen reader gets a worse
|
|
132
|
+
* answer from the value than from a sentence: "3.5" alone is a number without
|
|
133
|
+
* a subject. This names the readout, where a control is named by its `label`
|
|
134
|
+
* and each of its options by the score that option is.
|
|
135
|
+
*/
|
|
136
|
+
this.valueText = '';
|
|
141
137
|
/**
|
|
142
138
|
* The shape a consumer slotted, if they slotted one.
|
|
143
139
|
*
|
|
@@ -206,7 +202,7 @@ let HelixHeadlessRating = class HelixHeadlessRating extends MixinControllerValue
|
|
|
206
202
|
event.currentTarget.setPointerCapture(event.pointerId);
|
|
207
203
|
}
|
|
208
204
|
catch {
|
|
209
|
-
/* A
|
|
205
|
+
/* A synthesized pointer has no capture to take, and the drag works
|
|
210
206
|
without it right up until the pointer leaves the row. Worth having the
|
|
211
207
|
gesture testable rather than making the specs drive a real device. */
|
|
212
208
|
}
|
|
@@ -335,13 +331,10 @@ let HelixHeadlessRating = class HelixHeadlessRating extends MixinControllerValue
|
|
|
335
331
|
/**
|
|
336
332
|
* Reports the value, and whether the form may go without one.
|
|
337
333
|
*
|
|
338
|
-
* **`required`
|
|
339
|
-
*
|
|
340
|
-
*
|
|
341
|
-
*
|
|
342
|
-
* This is the case `min` argues for in its own note, that "no rating" and
|
|
343
|
-
* "the worst rating" are different answers and a survey that requires one
|
|
344
|
-
* says so with `required`.
|
|
334
|
+
* **`required` arrives from the mixin, so it prints on the reference page
|
|
335
|
+
* whether or not anything here enforces it.** Without a `setValidity` call a
|
|
336
|
+
* form holding an unrated required rating submits, `:valid` true and the
|
|
337
|
+
* entry present but empty. `reportRequired` is what makes the property real.
|
|
345
338
|
*
|
|
346
339
|
* **Empty is `value === ''` rather than a score of zero**, because zero is a
|
|
347
340
|
* rating a reader can deliberately give when `min` allows it, and refusing to
|
|
@@ -367,7 +360,7 @@ let HelixHeadlessRating = class HelixHeadlessRating extends MixinControllerValue
|
|
|
367
360
|
updated(changed) {
|
|
368
361
|
super.updated?.(changed);
|
|
369
362
|
// Every update, not only the ones that name `value`: see the note on
|
|
370
|
-
// `ColorInput.updated
|
|
363
|
+
// `ColorInput.updated`.
|
|
371
364
|
this.sync();
|
|
372
365
|
}
|
|
373
366
|
firstUpdated(changed) {
|
|
@@ -384,9 +377,9 @@ let HelixHeadlessRating = class HelixHeadlessRating extends MixinControllerValue
|
|
|
384
377
|
rather than a count of the filled ones.
|
|
385
378
|
|
|
386
379
|
Written out twice rather than through one helper taking the part name:
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
`[part="
|
|
380
|
+
a part is read from the source as a literal, and a `part=${name}`
|
|
381
|
+
binding is invisible. The stylesheet's `[part="track"]` and
|
|
382
|
+
`[part="fill"]` read as dead. */
|
|
390
383
|
const marksIn = (layer) => Array.from({ length: count }, (_, index) => mark(layer, index));
|
|
391
384
|
return html `<div
|
|
392
385
|
part="marks"
|
|
@@ -460,18 +453,18 @@ __decorate([
|
|
|
460
453
|
__decorate([
|
|
461
454
|
property({ type: Number })
|
|
462
455
|
], HelixHeadlessRating.prototype, "min", void 0);
|
|
463
|
-
__decorate([
|
|
464
|
-
property({ type: Number })
|
|
465
|
-
], HelixHeadlessRating.prototype, "step", void 0);
|
|
466
456
|
__decorate([
|
|
467
457
|
property({ attribute: 'readonly', reflect: true, type: Boolean })
|
|
468
458
|
], HelixHeadlessRating.prototype, "readOnly", void 0);
|
|
469
|
-
__decorate([
|
|
470
|
-
property({ attribute: 'value-text' })
|
|
471
|
-
], HelixHeadlessRating.prototype, "valueText", void 0);
|
|
472
459
|
__decorate([
|
|
473
460
|
property({ attribute: 'show-value', reflect: true, type: Boolean })
|
|
474
461
|
], HelixHeadlessRating.prototype, "showValue", void 0);
|
|
462
|
+
__decorate([
|
|
463
|
+
property({ type: Number })
|
|
464
|
+
], HelixHeadlessRating.prototype, "step", void 0);
|
|
465
|
+
__decorate([
|
|
466
|
+
property({ attribute: 'value-text' })
|
|
467
|
+
], HelixHeadlessRating.prototype, "valueText", void 0);
|
|
475
468
|
__decorate([
|
|
476
469
|
state()
|
|
477
470
|
], HelixHeadlessRating.prototype, "markSource", void 0);
|
|
@@ -9,12 +9,12 @@ declare const EDGES: readonly ['block-start', 'block-end', 'inline-start', 'inli
|
|
|
9
9
|
* **The whole component is one fact a stylesheet cannot work out for itself:
|
|
10
10
|
* which edges have content past them.** A fade at the bottom of a list is easy
|
|
11
11
|
* to draw and impossible to decide, because CSS has no reading of scroll
|
|
12
|
-
* position. So this measures and says, in
|
|
13
|
-
* draws whatever it likes on the edges named.
|
|
12
|
+
* position. So this measures and says, in a custom state per edge, and the
|
|
13
|
+
* styled tier draws whatever it likes on the edges named.
|
|
14
14
|
*
|
|
15
|
-
* **
|
|
16
|
-
*
|
|
17
|
-
*
|
|
15
|
+
* **States rather than attributes**, so an element that upgrades after a
|
|
16
|
+
* framework rendered its markup does not hand that framework markup it did not
|
|
17
|
+
* write. A stylesheet asks `:host(:state(more-block-end))`.
|
|
18
18
|
*
|
|
19
19
|
* **A scrolling region takes the keyboard when it scrolls, and not before.**
|
|
20
20
|
* A box a reader can only reach with a pointer is a box some readers cannot
|
|
@@ -56,17 +56,14 @@ export declare class HelixHeadlessScrollArea extends HelixElement {
|
|
|
56
56
|
/**
|
|
57
57
|
* The box that actually scrolls, for anything that needs to move it.
|
|
58
58
|
*
|
|
59
|
-
* **Public because the alternative is silence.**
|
|
60
|
-
*
|
|
61
|
-
*
|
|
62
|
-
*
|
|
63
|
-
*
|
|
64
|
-
* `offsetParent` default fails, and the sandbox sidebar spent an afternoon
|
|
65
|
-
* scrolled to zero because of it.
|
|
59
|
+
* **Public because the alternative is silence.** The scrolling box is inside
|
|
60
|
+
* this shadow root: a consumer holding a reference to this element holds the
|
|
61
|
+
* host, which does not scroll, and `scrollBy` on it is a no-op that reports
|
|
62
|
+
* nothing. That is how `scrollItemIntoView`'s `offsetParent` default fails
|
|
63
|
+
* here.
|
|
66
64
|
*
|
|
67
65
|
* The element rather than a method of our own, because the utilities that
|
|
68
|
-
* want it already take one
|
|
69
|
-
* long list all want the same thing from it.
|
|
66
|
+
* want it already take one.
|
|
70
67
|
*/
|
|
71
68
|
get scroller(): HTMLElement | null;
|
|
72
69
|
/**
|