@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
|
@@ -22,13 +22,12 @@ import { property } from 'lit/decorators.js';
|
|
|
22
22
|
* value rather than the value itself. `valueAsNumber` is there for anything
|
|
23
23
|
* doing arithmetic on it.
|
|
24
24
|
*
|
|
25
|
-
* **Marks are drawn rather than left to `<datalist
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
* enforces whether or not anything is drawn.
|
|
25
|
+
* **Marks are drawn rather than left to `<datalist>`.** A datalist's ticks
|
|
26
|
+
* cannot be styled at all, and Firefox does not render them for a range at all,
|
|
27
|
+
* so the platform's version is a mark that looks like someone else's design
|
|
28
|
+
* where it appears and no mark where it does not. Drawing them costs the
|
|
29
|
+
* semantics nothing, because a mark is decoration: what a reader can actually
|
|
30
|
+
* land on is `step`, which the input enforces whether or not anything is drawn.
|
|
32
31
|
*
|
|
33
32
|
* `markers` is a count rather than a flag tied to `step`. A flag reads well
|
|
34
33
|
* until a slider from zero to a hundred stepping by one asks for a hundred and
|
|
@@ -36,11 +35,10 @@ import { property } from 'lit/decorators.js';
|
|
|
36
35
|
* is what the reader sees, so it cannot surprise anyone.
|
|
37
36
|
*
|
|
38
37
|
* **A range is two of them, not a hand-built one.** There is no native
|
|
39
|
-
* two-thumb range,
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
* handle.
|
|
38
|
+
* two-thumb range, so two are stacked on one track and each thumb keeps its own
|
|
39
|
+
* drag, its own arrow keys, its own Home and End and its own finger-sized hit
|
|
40
|
+
* area. Rebuilding would throw away every argument this component is made of,
|
|
41
|
+
* to gain a second handle.
|
|
44
42
|
*
|
|
45
43
|
* Crossing is stopped in the handler rather than by the bounds, and that is not
|
|
46
44
|
* the obvious way round. Giving the lower input `max` of the upper reads well
|
|
@@ -93,25 +91,9 @@ let HelixHeadlessSlider = class HelixHeadlessSlider extends MixinControllerValue
|
|
|
93
91
|
/** Typed or dragged, so every edit is announced. See `announcesInput`. */
|
|
94
92
|
this.announcesInput = true;
|
|
95
93
|
/**
|
|
96
|
-
* Whether
|
|
97
|
-
*
|
|
98
|
-
* The pair is one string, `"10,50"`, which is what a form submits and what
|
|
99
|
-
* `MixinControllerValue` already holds. `valueAsNumber` reads the lower of
|
|
100
|
-
* the two, since a range has no single number.
|
|
101
|
-
*/
|
|
102
|
-
this.range = false;
|
|
103
|
-
/**
|
|
104
|
-
* The largest value the reader can choose.
|
|
105
|
-
*/
|
|
106
|
-
this.max = 100;
|
|
107
|
-
/**
|
|
108
|
-
* The smallest value the reader can choose.
|
|
109
|
-
*/
|
|
110
|
-
this.min = 0;
|
|
111
|
-
/**
|
|
112
|
-
* Whether the chosen value is shown beside the track.
|
|
94
|
+
* Whether each mark says which value it stands at.
|
|
113
95
|
*/
|
|
114
|
-
this.
|
|
96
|
+
this.markerLabels = false;
|
|
115
97
|
/**
|
|
116
98
|
* How many marks to draw along the track, evenly spaced, ends included.
|
|
117
99
|
*
|
|
@@ -129,11 +111,25 @@ let HelixHeadlessSlider = class HelixHeadlessSlider extends MixinControllerValue
|
|
|
129
111
|
*/
|
|
130
112
|
this.markers = 0;
|
|
131
113
|
/**
|
|
132
|
-
*
|
|
114
|
+
* The largest value the reader can choose.
|
|
133
115
|
*/
|
|
134
|
-
this.
|
|
135
|
-
/**
|
|
136
|
-
|
|
116
|
+
this.max = 100;
|
|
117
|
+
/**
|
|
118
|
+
* The smallest value the reader can choose.
|
|
119
|
+
*/
|
|
120
|
+
this.min = 0;
|
|
121
|
+
/**
|
|
122
|
+
* Whether there are two thumbs and the value is a pair.
|
|
123
|
+
*
|
|
124
|
+
* The pair is one string, `"10,50"`, which is what a form submits and what
|
|
125
|
+
* `MixinControllerValue` already holds. `valueAsNumber` reads the lower of
|
|
126
|
+
* the two, since a range has no single number.
|
|
127
|
+
*/
|
|
128
|
+
this.range = false;
|
|
129
|
+
/**
|
|
130
|
+
* Whether the chosen value is shown beside the track.
|
|
131
|
+
*/
|
|
132
|
+
this.showValue = false;
|
|
137
133
|
this.handleInput = (event) => {
|
|
138
134
|
// Stopped for the reason `Input.handleInput` gives: the inner control's own
|
|
139
135
|
// `input` is composed and would reach a consumer beside this element's.
|
|
@@ -165,6 +161,8 @@ let HelixHeadlessSlider = class HelixHeadlessSlider extends MixinControllerValue
|
|
|
165
161
|
event.stopPropagation();
|
|
166
162
|
this.dispatchEvent(new Event('change', { bubbles: true, composed: false }));
|
|
167
163
|
};
|
|
164
|
+
/** How far one press of an arrow key moves it. */
|
|
165
|
+
this.step = 1;
|
|
168
166
|
}
|
|
169
167
|
/**
|
|
170
168
|
* How many characters the readout has to be able to hold, widest case.
|
|
@@ -201,7 +199,7 @@ let HelixHeadlessSlider = class HelixHeadlessSlider extends MixinControllerValue
|
|
|
201
199
|
return String(this.step).split('.')[1]?.length ?? 0;
|
|
202
200
|
}
|
|
203
201
|
/**
|
|
204
|
-
*
|
|
202
|
+
* The values the marks stand at, evenly spaced, each snapped to a step.
|
|
205
203
|
*/
|
|
206
204
|
get markerValues() {
|
|
207
205
|
const span = this.max - this.min;
|
|
@@ -275,18 +273,13 @@ let HelixHeadlessSlider = class HelixHeadlessSlider extends MixinControllerValue
|
|
|
275
273
|
* Arithmetic rather than a measurement, because the browser already knows
|
|
276
274
|
* where it drew the handle and measuring it would be a guess at that.
|
|
277
275
|
*
|
|
278
|
-
* **Sanitized here,
|
|
279
|
-
* its value
|
|
280
|
-
*
|
|
281
|
-
*
|
|
282
|
-
*
|
|
283
|
-
*
|
|
284
|
-
*
|
|
285
|
-
* read the seeded midpoint and stayed there.
|
|
286
|
-
*
|
|
287
|
-
* Measured on a slider from 0 to 1: after dragging to either end, the host's
|
|
288
|
-
* `value` was `1`, the control's was `1`, and `--slider-fraction` was still
|
|
289
|
-
* `0.5`. Off by half a track, and stable, which is what made it look like a
|
|
276
|
+
* **Sanitized here, never read back off the control.** Asking the input for
|
|
277
|
+
* its value reads well, a range clamping and snapping whatever it is given,
|
|
278
|
+
* and the timing defeats it: `fraction` is evaluated inside `render()` and the
|
|
279
|
+
* `style` binding carrying it is committed *before* the `.value` binding below
|
|
280
|
+
* it, so it reads the value this very render is about to replace. The fill
|
|
281
|
+
* ends up a render behind the thumb, and on the first pass it reads the seeded
|
|
282
|
+
* midpoint and stays there: stable and off by half a track, which reads as a
|
|
290
283
|
* drawing bug rather than a timing one.
|
|
291
284
|
*
|
|
292
285
|
* So the same two operations a range performs are done here: snap to the step
|
|
@@ -323,11 +316,11 @@ let HelixHeadlessSlider = class HelixHeadlessSlider extends MixinControllerValue
|
|
|
323
316
|
here so the value the form would submit matches the thumb from the first
|
|
324
317
|
render rather than from the first drag. */
|
|
325
318
|
if (!this.hasUpdated && this.value === '') {
|
|
326
|
-
/* Onto `defaultValue`, never onto `value`.
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
319
|
+
/* Onto `defaultValue`, never onto `value`. `defaultValue` is where the
|
|
320
|
+
markup's intent lives and where a reset returns to, and "no value given"
|
|
321
|
+
is exactly a fact about the markup. Writing `value` would record the
|
|
322
|
+
midpoint as something the reader chose, so a form reset would return to
|
|
323
|
+
it rather than clearing it. */
|
|
331
324
|
this.defaultValue = String(this.min + (this.max - this.min) / 2);
|
|
332
325
|
}
|
|
333
326
|
}
|
|
@@ -342,25 +335,23 @@ let HelixHeadlessSlider = class HelixHeadlessSlider extends MixinControllerValue
|
|
|
342
335
|
bounds it holds at that moment: with the value first, a slider from 0 to
|
|
343
336
|
360 given 225 took the default max of 100, clamped to 100, and drew its
|
|
344
337
|
handle at 100/360.
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
338
|
+
|
|
339
|
+
The symptom is the fill and the handle disagreeing, because they are
|
|
340
|
+
computed from different things: the fill is arithmetic on this element's
|
|
341
|
+
property, and the handle is the platform's reading of the input's own
|
|
342
|
+
clamped value. It appears on any slider with a max above 100, and the
|
|
343
|
+
fill being right is what makes it read as a drawing bug rather than a
|
|
344
|
+
value one. */
|
|
352
345
|
const [start, end] = this.bounds;
|
|
353
346
|
/* One input per thumb, each spanning the whole range so both read against
|
|
354
347
|
the same track. The lower one paints the fill and the upper one's track
|
|
355
348
|
is transparent, because two stacked tracks would paint the ramp twice. */
|
|
356
349
|
/* **The lower thumb answers to `control`, and it has to answer to
|
|
357
350
|
something.** `MixinField.renderLabel` writes `<label for="control">` for
|
|
358
|
-
every field in the library,
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
in the whole corpus, which is the shape this class of fault takes, valid
|
|
363
|
-
markup that reaches nothing and says nothing.
|
|
351
|
+
every field in the library, so a range branch that does not render that id
|
|
352
|
+
ships a label pointing at nothing: pressing the words focuses no thumb and
|
|
353
|
+
the `<output for>` beside it names a missing element too. Valid markup
|
|
354
|
+
that reaches nothing and says nothing.
|
|
364
355
|
|
|
365
356
|
The lower one, because a label forwards a press to the first control it
|
|
366
357
|
names and the reader expects the start of the range. The upper takes
|
|
@@ -383,10 +374,10 @@ let HelixHeadlessSlider = class HelixHeadlessSlider extends MixinControllerValue
|
|
|
383
374
|
/>`;
|
|
384
375
|
/* `data-markers` mirrors "there are marks" for the stylesheet.
|
|
385
376
|
*
|
|
386
|
-
*
|
|
387
|
-
*
|
|
388
|
-
*
|
|
389
|
-
*
|
|
377
|
+
* `markers` does not reflect, so a marker layout hung off `:host([markers])`
|
|
378
|
+
* draws nothing for `slider.markers = 5`: only the attribute written in the
|
|
379
|
+
* markup works, and the property that is the documented API silently does
|
|
380
|
+
* not.
|
|
390
381
|
*
|
|
391
382
|
* Reflecting the count instead would put `markers="0"` on every slider, an
|
|
392
383
|
* attribute the server's markup does not have and one that selector would
|
|
@@ -397,11 +388,9 @@ let HelixHeadlessSlider = class HelixHeadlessSlider extends MixinControllerValue
|
|
|
397
388
|
* already draws the line.
|
|
398
389
|
*
|
|
399
390
|
* A `/*` and written here, because it describes this binding and not a
|
|
400
|
-
* member.
|
|
401
|
-
*
|
|
402
|
-
*
|
|
403
|
-
* at". `check:orphans` cannot see an unclosed block, only one sitting on
|
|
404
|
-
* another. */
|
|
391
|
+
* member. Nothing catches an unclosed block, only one sitting on another,
|
|
392
|
+
* so a `/**` that swallows the member below it ships as that member's
|
|
393
|
+
* description. */
|
|
405
394
|
return html `${this.renderLabel()}
|
|
406
395
|
<div
|
|
407
396
|
part="field"
|
|
@@ -459,8 +448,11 @@ let HelixHeadlessSlider = class HelixHeadlessSlider extends MixinControllerValue
|
|
|
459
448
|
}
|
|
460
449
|
};
|
|
461
450
|
__decorate([
|
|
462
|
-
property({ reflect: true, type: Boolean })
|
|
463
|
-
], HelixHeadlessSlider.prototype, "
|
|
451
|
+
property({ attribute: 'marker-labels', reflect: true, type: Boolean })
|
|
452
|
+
], HelixHeadlessSlider.prototype, "markerLabels", void 0);
|
|
453
|
+
__decorate([
|
|
454
|
+
property({ type: Number })
|
|
455
|
+
], HelixHeadlessSlider.prototype, "markers", void 0);
|
|
464
456
|
__decorate([
|
|
465
457
|
property({ type: Number })
|
|
466
458
|
], HelixHeadlessSlider.prototype, "max", void 0);
|
|
@@ -468,20 +460,17 @@ __decorate([
|
|
|
468
460
|
property({ type: Number })
|
|
469
461
|
], HelixHeadlessSlider.prototype, "min", void 0);
|
|
470
462
|
__decorate([
|
|
471
|
-
property({
|
|
472
|
-
], HelixHeadlessSlider.prototype, "
|
|
463
|
+
property({ reflect: true })
|
|
464
|
+
], HelixHeadlessSlider.prototype, "orientation", void 0);
|
|
473
465
|
__decorate([
|
|
474
|
-
property({ type:
|
|
475
|
-
], HelixHeadlessSlider.prototype, "
|
|
466
|
+
property({ reflect: true, type: Boolean })
|
|
467
|
+
], HelixHeadlessSlider.prototype, "range", void 0);
|
|
476
468
|
__decorate([
|
|
477
|
-
property({ attribute: '
|
|
478
|
-
], HelixHeadlessSlider.prototype, "
|
|
469
|
+
property({ attribute: 'show-value', reflect: true, type: Boolean })
|
|
470
|
+
], HelixHeadlessSlider.prototype, "showValue", void 0);
|
|
479
471
|
__decorate([
|
|
480
472
|
property({ type: Number })
|
|
481
473
|
], HelixHeadlessSlider.prototype, "step", void 0);
|
|
482
|
-
__decorate([
|
|
483
|
-
property({ reflect: true })
|
|
484
|
-
], HelixHeadlessSlider.prototype, "orientation", void 0);
|
|
485
474
|
HelixHeadlessSlider = __decorate([
|
|
486
475
|
customElement('helix-headless-slider')
|
|
487
476
|
], HelixHeadlessSlider);
|
|
@@ -19,13 +19,12 @@ import { type PropertyValues, type TemplateResult } from 'lit';
|
|
|
19
19
|
* **No label means decorative, and that is a choice rather than an oversight.**
|
|
20
20
|
* A sparkline beside a stat that already says "Sessions, 1,102" has nothing of
|
|
21
21
|
* its own to announce, and an unnamed `role="img"` announces "graphic" and
|
|
22
|
-
* stops. So an
|
|
22
|
+
* stops. So an unlabeled sparkline is `aria-hidden`, and a labeled one is an
|
|
23
23
|
* image named by its sentence.
|
|
24
24
|
*
|
|
25
|
-
* It goes *beside* a `Stat` rather than inside one
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
* right. `Trend` composes the same way.
|
|
25
|
+
* It goes *beside* a `Stat` rather than inside one: a change beside a figure is
|
|
26
|
+
* a second fact, which is what `Stat`'s own spec says. `Trend` composes the same
|
|
27
|
+
* way.
|
|
29
28
|
*
|
|
30
29
|
* The properties below are written by this component and read by whoever draws
|
|
31
30
|
* it. A consumer sets none of them: they carry a number this element computed
|
|
@@ -51,51 +50,18 @@ import { type PropertyValues, type TemplateResult } from 'lit';
|
|
|
51
50
|
*/
|
|
52
51
|
export declare class HelixHeadlessSparkline extends HelixElement {
|
|
53
52
|
#private;
|
|
54
|
-
/**
|
|
55
|
-
* What the readings are drawn as.
|
|
56
|
-
*
|
|
57
|
-
* Absent is a line, `area` is a line with the region beneath it washed, and
|
|
58
|
-
* `bar` is a column per reading.
|
|
59
|
-
*
|
|
60
|
-
* **A bar plot measures from zero and the other two measure from the data's
|
|
61
|
-
* own range**, which is the one way the plots are not interchangeable. A line
|
|
62
|
-
* says where the readings sit relative to each other, so a scale over their
|
|
63
|
-
* extent uses the whole box and claims nothing about absolute size. A bar's
|
|
64
|
-
* length *is* the value, so any baseline but zero makes the lengths
|
|
65
|
-
* proportional to nothing.
|
|
66
|
-
*
|
|
67
|
-
* **Which is a reason to prefer a line for readings in a narrow band far from
|
|
68
|
-
* zero.** Seven values between 1,102 and 1,408 drawn as columns from zero are
|
|
69
|
-
* seven columns of nearly the same height, and that is the true picture: they
|
|
70
|
-
* *are* nearly the same. The same readings as a line fill the box and show
|
|
71
|
-
* the movement, because a line is only ever claiming a shape.
|
|
72
|
-
*
|
|
73
|
-
* **Absent is `area`**, which is the departure from the rule that a resting
|
|
74
|
-
* arrangement is the plainest thing. At the size a sparkline is actually
|
|
75
|
-
* drawn, a hairline in a wide box is mostly box: the wash under it is what
|
|
76
|
-
* gives the shape a body and lets a reader see it at a glance rather than
|
|
77
|
-
* hunting for it, which is the entire job. `line` is the bare stroke for
|
|
78
|
-
* anywhere the fill would be noise, several of them in one box for instance.
|
|
79
|
-
*
|
|
80
|
-
* This tier rather than the one above: a plot type is geometry and geometry
|
|
81
|
-
* is markup, the same reason `curve` lives here.
|
|
82
|
-
*/
|
|
83
|
-
plot?: 'area' | 'bar' | 'line';
|
|
84
53
|
/**
|
|
85
54
|
* How the line gets from one reading to the next.
|
|
86
55
|
*
|
|
87
|
-
* **`smooth` is the resting curve.**
|
|
88
|
-
*
|
|
89
|
-
*
|
|
90
|
-
*
|
|
91
|
-
* the
|
|
92
|
-
*
|
|
93
|
-
*
|
|
94
|
-
*
|
|
95
|
-
*
|
|
96
|
-
* that bound the smoothed line is the easier one to follow across a long
|
|
97
|
-
* series, which is what the drawing is for. `straight` becomes the claim a
|
|
98
|
-
* consumer makes deliberately rather than the one they get by saying nothing.
|
|
56
|
+
* **`smooth` is the resting curve.** A straight segment asserts nothing about
|
|
57
|
+
* the values between two readings and a curve invents them, which is why
|
|
58
|
+
* `straight` exists. What settles the default the other way is that the
|
|
59
|
+
* invention is bounded: the interpolation is monotone cubic, so it never
|
|
60
|
+
* leaves the band the data sets and never introduces a peak or a trough the
|
|
61
|
+
* series does not have. Within that bound the smoothed line is the easier one
|
|
62
|
+
* to follow across a long series, which is what the drawing is for. `straight`
|
|
63
|
+
* becomes the claim a consumer makes deliberately rather than the one they get
|
|
64
|
+
* by saying nothing.
|
|
99
65
|
*
|
|
100
66
|
* **The property stays optional and the default lives in the render.** A
|
|
101
67
|
* reflecting property with a default writes its attribute onto every host
|
|
@@ -127,6 +93,36 @@ export declare class HelixHeadlessSparkline extends HelixElement {
|
|
|
127
93
|
* than announced without a name.
|
|
128
94
|
*/
|
|
129
95
|
label: string;
|
|
96
|
+
/**
|
|
97
|
+
* What the readings are drawn as.
|
|
98
|
+
*
|
|
99
|
+
* Absent is a line, `area` is a line with the region beneath it washed, and
|
|
100
|
+
* `bar` is a column per reading.
|
|
101
|
+
*
|
|
102
|
+
* **A bar plot measures from zero and the other two measure from the data's
|
|
103
|
+
* own range**, which is the one way the plots are not interchangeable. A line
|
|
104
|
+
* says where the readings sit relative to each other, so a scale over their
|
|
105
|
+
* extent uses the whole box and claims nothing about absolute size. A bar's
|
|
106
|
+
* length *is* the value, so any baseline but zero makes the lengths
|
|
107
|
+
* proportional to nothing.
|
|
108
|
+
*
|
|
109
|
+
* **Which is a reason to prefer a line for readings in a narrow band far from
|
|
110
|
+
* zero.** Seven values between 1,102 and 1,408 drawn as columns from zero are
|
|
111
|
+
* seven columns of nearly the same height, and that is the true picture: they
|
|
112
|
+
* *are* nearly the same. The same readings as a line fill the box and show
|
|
113
|
+
* the movement, because a line is only ever claiming a shape.
|
|
114
|
+
*
|
|
115
|
+
* **Absent is `area`**, which is the departure from the rule that a resting
|
|
116
|
+
* arrangement is the plainest thing. At the size a sparkline is actually
|
|
117
|
+
* drawn, a hairline in a wide box is mostly box: the wash under it is what
|
|
118
|
+
* gives the shape a body and lets a reader see it at a glance rather than
|
|
119
|
+
* hunting for it, which is the entire job. `line` is the bare stroke for
|
|
120
|
+
* anywhere the fill would be noise, several of them in one box for instance.
|
|
121
|
+
*
|
|
122
|
+
* This tier rather than the one above: a plot type is geometry and geometry
|
|
123
|
+
* is markup, the same reason `curve` lives here.
|
|
124
|
+
*/
|
|
125
|
+
plot?: 'area' | 'bar' | 'line';
|
|
130
126
|
/**
|
|
131
127
|
* The numbers, separated by whitespace or by commas.
|
|
132
128
|
*
|
|
@@ -37,13 +37,12 @@ const readValues = (input) => input
|
|
|
37
37
|
* **No label means decorative, and that is a choice rather than an oversight.**
|
|
38
38
|
* A sparkline beside a stat that already says "Sessions, 1,102" has nothing of
|
|
39
39
|
* its own to announce, and an unnamed `role="img"` announces "graphic" and
|
|
40
|
-
* stops. So an
|
|
40
|
+
* stops. So an unlabeled sparkline is `aria-hidden`, and a labeled one is an
|
|
41
41
|
* image named by its sentence.
|
|
42
42
|
*
|
|
43
|
-
* It goes *beside* a `Stat` rather than inside one
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
* right. `Trend` composes the same way.
|
|
43
|
+
* It goes *beside* a `Stat` rather than inside one: a change beside a figure is
|
|
44
|
+
* a second fact, which is what `Stat`'s own spec says. `Trend` composes the same
|
|
45
|
+
* way.
|
|
47
46
|
*
|
|
48
47
|
* The properties below are written by this component and read by whoever draws
|
|
49
48
|
* it. A consumer sets none of them: they carry a number this element computed
|
|
@@ -100,8 +99,7 @@ let HelixHeadlessSparkline = class HelixHeadlessSparkline extends HelixElement {
|
|
|
100
99
|
*/
|
|
101
100
|
this.values = '';
|
|
102
101
|
/* One controller rather than the resolve-and-watch each chart had written
|
|
103
|
-
out for itself.
|
|
104
|
-
same lookup. */
|
|
102
|
+
out for itself. */
|
|
105
103
|
this.source = new SourceController(this);
|
|
106
104
|
}
|
|
107
105
|
willUpdate(changed) {
|
|
@@ -123,22 +121,16 @@ let HelixHeadlessSparkline = class HelixHeadlessSparkline extends HelixElement {
|
|
|
123
121
|
so the empty case is stated here rather than left to look like a bug. */
|
|
124
122
|
const x = linear([0, Math.max(points.length - 1, 1)], [0, BOX.width]);
|
|
125
123
|
/* **A bar measures from zero and a line measures from its own range**, and
|
|
126
|
-
that is a correctness difference rather than a preference.
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
* floor and its column had no height at all: seven readings between 1,102
|
|
137
|
-
* and 1,408 came out as six columns and a gap, which looks like missing
|
|
138
|
-
* data and is really a scale saying the minimum is nothing.
|
|
139
|
-
*
|
|
140
|
-
* The zero is included at both ends, so a series that goes negative gets a
|
|
141
|
-
* baseline inside the box and its columns hang below it. */
|
|
124
|
+
that is a correctness difference rather than a preference. A bar's
|
|
125
|
+
*length* is the value, so a baseline anywhere but zero makes the lengths
|
|
126
|
+
proportional to nothing. Drawn over the data's extent, the smallest
|
|
127
|
+
reading lands exactly on the floor and its column has no height at all:
|
|
128
|
+
seven readings between 1,102 and 1,408 come out as six columns and a gap,
|
|
129
|
+
which looks like missing data and is really a scale saying the minimum is
|
|
130
|
+
nothing.
|
|
131
|
+
|
|
132
|
+
The zero is included at both ends, so a series that goes negative gets a
|
|
133
|
+
baseline inside the box and its columns hang below it. */
|
|
142
134
|
const [low, high] = extent(points.length > 0 ? points : [0]);
|
|
143
135
|
const y = this.plot === 'bar'
|
|
144
136
|
? linear([Math.min(0, low), Math.max(0, high)], [BOX.height, 0])
|
|
@@ -149,10 +141,9 @@ let HelixHeadlessSparkline = class HelixHeadlessSparkline extends HelixElement {
|
|
|
149
141
|
the wash goes. Its own path rather than a fill on the line, because a
|
|
150
142
|
closed path strokes its closing edges too: filling the line itself would
|
|
151
143
|
draw a rule along the bottom of the box and up both sides.
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
* wrong writing this themselves, and it is why the shape is built here. */
|
|
144
|
+
|
|
145
|
+
The floor is the smallest reading and not a true zero, because the scale
|
|
146
|
+
runs over the data's own extent. */
|
|
156
147
|
/* Asked negatively, because absent *is* an area here and the class doc
|
|
157
148
|
above says why. This is the one property in the family where the resting
|
|
158
149
|
arrangement is not the plainest thing, so the test has to answer true for
|
|
@@ -160,7 +151,7 @@ let HelixHeadlessSparkline = class HelixHeadlessSparkline extends HelixElement {
|
|
|
160
151
|
const area = this.plot !== 'bar' && this.plot !== 'line' && path !== ''
|
|
161
152
|
? `${path}L${BOX.width},${BOX.height}L0,${BOX.height}Z`
|
|
162
153
|
: '';
|
|
163
|
-
/* One column per reading, inset so
|
|
154
|
+
/* One column per reading, inset so neighbors do not touch.
|
|
164
155
|
*
|
|
165
156
|
* A rect rather than a thick stroked line, because a bar has two ends and a
|
|
166
157
|
* stroke has a cap: `stroke-linecap` would round or square both ends of
|
|
@@ -208,7 +199,7 @@ let HelixHeadlessSparkline = class HelixHeadlessSparkline extends HelixElement {
|
|
|
208
199
|
>
|
|
209
200
|
${
|
|
210
201
|
/* The ramp the area is poured with, drawn here because a gradient is
|
|
211
|
-
an element and elements are this tier's business, and
|
|
202
|
+
an element and elements are this tier's business, and colored
|
|
212
203
|
above because a color is not. Measured rather than assumed: a
|
|
213
204
|
fragment id inside a shadow root resolves within that root, so two
|
|
214
205
|
sparklines on a page carrying the same id stay independent, and CSS
|
|
@@ -257,9 +248,6 @@ let HelixHeadlessSparkline = class HelixHeadlessSparkline extends HelixElement {
|
|
|
257
248
|
: html `<span aria-hidden="true" part="terminus" style=${end ?? nothing}></span>`}`;
|
|
258
249
|
}
|
|
259
250
|
};
|
|
260
|
-
__decorate([
|
|
261
|
-
property({ reflect: true })
|
|
262
|
-
], HelixHeadlessSparkline.prototype, "plot", void 0);
|
|
263
251
|
__decorate([
|
|
264
252
|
property({ reflect: true })
|
|
265
253
|
], HelixHeadlessSparkline.prototype, "curve", void 0);
|
|
@@ -269,6 +257,9 @@ __decorate([
|
|
|
269
257
|
__decorate([
|
|
270
258
|
property()
|
|
271
259
|
], HelixHeadlessSparkline.prototype, "label", void 0);
|
|
260
|
+
__decorate([
|
|
261
|
+
property({ reflect: true })
|
|
262
|
+
], HelixHeadlessSparkline.prototype, "plot", void 0);
|
|
272
263
|
__decorate([
|
|
273
264
|
property()
|
|
274
265
|
], HelixHeadlessSparkline.prototype, "values", void 0);
|
|
@@ -31,14 +31,14 @@ import { type TemplateResult } from 'lit';
|
|
|
31
31
|
* @csspart label - The name beside it.
|
|
32
32
|
*/
|
|
33
33
|
export declare class HelixHeadlessSpeedDialItem extends HelixElement {
|
|
34
|
-
/**
|
|
35
|
-
* What this action stands for, carried in the event when it is chosen.
|
|
36
|
-
*/
|
|
37
|
-
value: string;
|
|
38
34
|
/**
|
|
39
35
|
* Whether the action can be chosen.
|
|
40
36
|
*/
|
|
41
37
|
disabled: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* What this action stands for, carried in the event when it is chosen.
|
|
40
|
+
*/
|
|
41
|
+
value: string;
|
|
42
42
|
/**
|
|
43
43
|
* @internal Read by a parent to identify its children across the light DOM,
|
|
44
44
|
* which is cheaper than `instanceof` and is why this is public rather than
|
|
@@ -56,8 +56,8 @@ export declare class HelixHeadlessSpeedDialItem extends HelixElement {
|
|
|
56
56
|
*
|
|
57
57
|
* Asked of the document rather than of the shadow root: focus lands on the
|
|
58
58
|
* control inside this element and the platform retargets it, so from outside
|
|
59
|
-
* `activeElement` already is this element. `Menu.Item` records the same
|
|
60
|
-
*
|
|
59
|
+
* `activeElement` already is this element. `Menu.Item` records the same;
|
|
60
|
+
* reading it off the shadow root does not survive happy-dom.
|
|
61
61
|
*/
|
|
62
62
|
get selected(): boolean;
|
|
63
63
|
private choose;
|
|
@@ -40,14 +40,14 @@ import { property } from 'lit/decorators.js';
|
|
|
40
40
|
let HelixHeadlessSpeedDialItem = class HelixHeadlessSpeedDialItem extends HelixElement {
|
|
41
41
|
constructor() {
|
|
42
42
|
super(...arguments);
|
|
43
|
-
/**
|
|
44
|
-
* What this action stands for, carried in the event when it is chosen.
|
|
45
|
-
*/
|
|
46
|
-
this.value = '';
|
|
47
43
|
/**
|
|
48
44
|
* Whether the action can be chosen.
|
|
49
45
|
*/
|
|
50
46
|
this.disabled = false;
|
|
47
|
+
/**
|
|
48
|
+
* What this action stands for, carried in the event when it is chosen.
|
|
49
|
+
*/
|
|
50
|
+
this.value = '';
|
|
51
51
|
/**
|
|
52
52
|
* @internal Read by a parent to identify its children across the light DOM,
|
|
53
53
|
* which is cheaper than `instanceof` and is why this is public rather than
|
|
@@ -75,8 +75,8 @@ let HelixHeadlessSpeedDialItem = class HelixHeadlessSpeedDialItem extends HelixE
|
|
|
75
75
|
*
|
|
76
76
|
* Asked of the document rather than of the shadow root: focus lands on the
|
|
77
77
|
* control inside this element and the platform retargets it, so from outside
|
|
78
|
-
* `activeElement` already is this element. `Menu.Item` records the same
|
|
79
|
-
*
|
|
78
|
+
* `activeElement` already is this element. `Menu.Item` records the same;
|
|
79
|
+
* reading it off the shadow root does not survive happy-dom.
|
|
80
80
|
*/
|
|
81
81
|
get selected() {
|
|
82
82
|
return this.ownerDocument.activeElement === this;
|
|
@@ -101,12 +101,12 @@ let HelixHeadlessSpeedDialItem = class HelixHeadlessSpeedDialItem extends HelixE
|
|
|
101
101
|
</button>`;
|
|
102
102
|
}
|
|
103
103
|
};
|
|
104
|
-
__decorate([
|
|
105
|
-
property()
|
|
106
|
-
], HelixHeadlessSpeedDialItem.prototype, "value", void 0);
|
|
107
104
|
__decorate([
|
|
108
105
|
property({ reflect: true, type: Boolean })
|
|
109
106
|
], HelixHeadlessSpeedDialItem.prototype, "disabled", void 0);
|
|
107
|
+
__decorate([
|
|
108
|
+
property()
|
|
109
|
+
], HelixHeadlessSpeedDialItem.prototype, "value", void 0);
|
|
110
110
|
HelixHeadlessSpeedDialItem = __decorate([
|
|
111
111
|
customElement('helix-headless-speed-dial-item')
|
|
112
112
|
], HelixHeadlessSpeedDialItem);
|