@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
|
@@ -11,11 +11,10 @@ import { property } from 'lit/decorators.js';
|
|
|
11
11
|
* @summary A short code, one character to a box.
|
|
12
12
|
*
|
|
13
13
|
* @description
|
|
14
|
-
* **One `<input>` per cell, rather than one input drawn as cells.**
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
* the second, and then closes autofill's gap rather than living with it, below.
|
|
14
|
+
* **One `<input>` per cell, rather than one input drawn as cells.** A single
|
|
15
|
+
* field autofills perfectly and needs a drawn caret nobody can style well;
|
|
16
|
+
* separate fields give every box a real focus ring, a real caret and a real tab
|
|
17
|
+
* stop for free. Autofill's gap is closed below rather than lived with.
|
|
19
18
|
*
|
|
20
19
|
* **Anything longer than one character is treated as a paste, wherever it
|
|
21
20
|
* lands.** That covers the obvious case and two that are not: a browser
|
|
@@ -72,33 +71,13 @@ let HelixHeadlessPinInput = class HelixHeadlessPinInput extends MixinControllerV
|
|
|
72
71
|
*/
|
|
73
72
|
this.autocomplete = 'one-time-code';
|
|
74
73
|
/**
|
|
75
|
-
*
|
|
74
|
+
* Accessible name for one box, with `{index}` and `{length}` filled in.
|
|
76
75
|
*/
|
|
77
|
-
this.
|
|
76
|
+
this.cellLabel = 'Character {index} of {length}';
|
|
78
77
|
/**
|
|
79
|
-
*
|
|
80
|
-
*
|
|
81
|
-
* `numeric` and `alphanumeric` also refuse anything else on the way in,
|
|
82
|
-
* because a code that is digits is digits: letting a letter into a box a
|
|
83
|
-
* reader cannot submit is a mistake they have to find and undo themselves.
|
|
84
|
-
* `text` refuses nothing and only trims, so it is the mode for a code with a
|
|
85
|
-
* hyphen in it.
|
|
86
|
-
*
|
|
87
|
-
* **`alphanumeric` is ASCII letters and digits**, which is narrower than the
|
|
88
|
-
* word is in general and is the right narrowness here. A code of this kind
|
|
89
|
-
* comes off a keypad, an SMS or an authenticator, and none of them emit `é`;
|
|
90
|
-
* a filter that accepted it would let through a character the service on the
|
|
91
|
-
* other end is going to reject. A consumer whose codes really do carry
|
|
92
|
-
* marked letters wants `text`, which judges nothing.
|
|
93
|
-
*
|
|
94
|
-
* **Not reflected**, and it was until this component's own server spec caught
|
|
95
|
-
* it: nothing selects on it, so all reflection did was write `type="numeric"`
|
|
96
|
-
* onto every `<helix-pin-input>` ever rendered, an attribute no consumer's
|
|
97
|
-
* markup had. That is the fault `Input`'s own `type` had and the reason the
|
|
98
|
-
* area rules carry the sentence "reflect only what CSS selects on". The real
|
|
99
|
-
* inputs take it as a binding, which is what makes the keyboard follow.
|
|
78
|
+
* How many characters the code has.
|
|
100
79
|
*/
|
|
101
|
-
this.
|
|
80
|
+
this.length = 6;
|
|
102
81
|
/**
|
|
103
82
|
* Whether the characters are hidden, the way a password is.
|
|
104
83
|
*/
|
|
@@ -112,9 +91,7 @@ let HelixHeadlessPinInput = class HelixHeadlessPinInput extends MixinControllerV
|
|
|
112
91
|
* `mask`, where the cell is a password input and a hand-drawn glyph would
|
|
113
92
|
* have to know that.
|
|
114
93
|
*
|
|
115
|
-
* Empty by default, because a row of boxes already reads as a row of boxes
|
|
116
|
-
* and a dot in each is a choice about how much the field should announce
|
|
117
|
-
* itself before anybody has touched it.
|
|
94
|
+
* Empty by default, because a row of boxes already reads as a row of boxes.
|
|
118
95
|
*/
|
|
119
96
|
this.placeholder = '';
|
|
120
97
|
/**
|
|
@@ -122,9 +99,28 @@ let HelixHeadlessPinInput = class HelixHeadlessPinInput extends MixinControllerV
|
|
|
122
99
|
*/
|
|
123
100
|
this.readOnly = false;
|
|
124
101
|
/**
|
|
125
|
-
*
|
|
102
|
+
* What a box accepts, which decides the keyboard a phone offers.
|
|
103
|
+
*
|
|
104
|
+
* `numeric` and `alphanumeric` also refuse anything else on the way in,
|
|
105
|
+
* because a code that is digits is digits: letting a letter into a box a
|
|
106
|
+
* reader cannot submit is a mistake they have to find and undo themselves.
|
|
107
|
+
* `text` refuses nothing and only trims, so it is the mode for a code with a
|
|
108
|
+
* hyphen in it.
|
|
109
|
+
*
|
|
110
|
+
* **`alphanumeric` is ASCII letters and digits**, which is narrower than the
|
|
111
|
+
* word is in general and is the right narrowness here. A code of this kind
|
|
112
|
+
* comes off a keypad, an SMS or an authenticator, and none of them emit `é`;
|
|
113
|
+
* a filter that accepted it would let through a character the service on the
|
|
114
|
+
* other end is going to reject. A consumer whose codes really do carry
|
|
115
|
+
* marked letters wants `text`, which judges nothing.
|
|
116
|
+
*
|
|
117
|
+
* **Not reflected**: nothing selects on it, so reflecting only writes
|
|
118
|
+
* `type="numeric"` onto every `<helix-pin-input>` ever rendered, an attribute
|
|
119
|
+
* no consumer's markup had. The area rules carry the sentence "reflect only
|
|
120
|
+
* what CSS selects on". The real inputs take it as a binding, which is what
|
|
121
|
+
* makes the keyboard follow.
|
|
126
122
|
*/
|
|
127
|
-
this.
|
|
123
|
+
this.type = 'numeric';
|
|
128
124
|
this.handleInput = (event) => {
|
|
129
125
|
// Stopped for the reason `Input.handleInput` gives: the inner control's own
|
|
130
126
|
// `input` is composed and would reach a consumer beside this element's.
|
|
@@ -134,15 +130,14 @@ let HelixHeadlessPinInput = class HelixHeadlessPinInput extends MixinControllerV
|
|
|
134
130
|
if (at === -1) {
|
|
135
131
|
return;
|
|
136
132
|
}
|
|
137
|
-
/* **An emptied box is a deletion, and this
|
|
138
|
-
Backspace in a *filled* box is the browser's own: the
|
|
139
|
-
leaves it alone, the character goes, and `input` arrives
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
133
|
+
/* **An emptied box is a deletion, and without this branch it is
|
|
134
|
+
unreachable.** A Backspace in a *filled* box is the browser's own: the
|
|
135
|
+
keydown handler leaves it alone, the character goes, and `input` arrives
|
|
136
|
+
carrying "". That falls through to `write`, which returns early on empty,
|
|
137
|
+
and then `paint` puts the character straight back. Only real keystrokes
|
|
138
|
+
reproduce it: dispatched events do not, which is why the specs pass over
|
|
139
|
+
it.
|
|
140
|
+
|
|
146
141
|
The rest collapse left, which is what the model already requires and what
|
|
147
142
|
a single text field does: "123456" with the 2 deleted is "13456", not a
|
|
148
143
|
hole. Focus stays where the reader was, so the box under the caret now
|
|
@@ -214,17 +209,9 @@ let HelixHeadlessPinInput = class HelixHeadlessPinInput extends MixinControllerV
|
|
|
214
209
|
* The code as it stood when focus arrived, so a visit that changed nothing
|
|
215
210
|
* says nothing.
|
|
216
211
|
*
|
|
217
|
-
* **
|
|
218
|
-
*
|
|
219
|
-
*
|
|
220
|
-
* every character, so most `focus` events are ones it caused, and telling
|
|
221
|
-
* those apart rests entirely on `relatedTarget`. That is true and it is not
|
|
222
|
-
* an obstacle, because `handleFocusOut` was already doing exactly that guard
|
|
223
|
-
* one method away. The reasoning had talked itself out of a check it had
|
|
224
|
-
* already written.
|
|
225
|
-
*
|
|
226
|
-
* **What the two readings do to a real browser**, measured in Chromium
|
|
227
|
-
* against a native `<input>` with real keystrokes:
|
|
212
|
+
* **Baselined on arrival, not at the last commit**, which is the platform's
|
|
213
|
+
* reading. What the two do to a real browser, measured in Chromium against a
|
|
214
|
+
* native `<input>` with real keystrokes:
|
|
228
215
|
*
|
|
229
216
|
* | | native | last commit | on arrival |
|
|
230
217
|
* |---|---|---|---|
|
|
@@ -259,13 +246,12 @@ let HelixHeadlessPinInput = class HelixHeadlessPinInput extends MixinControllerV
|
|
|
259
246
|
* Whether focus is currently somewhere inside the row.
|
|
260
247
|
*
|
|
261
248
|
* **The arrival is a transition, not a `relatedTarget` reading**, which is
|
|
262
|
-
* what the
|
|
263
|
-
*
|
|
264
|
-
*
|
|
265
|
-
*
|
|
266
|
-
*
|
|
267
|
-
*
|
|
268
|
-
* guard written on it is a guard that holds in production and not in the
|
|
249
|
+
* what the exit still does. `relatedTarget` does not work on the way in for
|
|
250
|
+
* two reasons and the second decides it. Every character moves focus to the
|
|
251
|
+
* next box, so an unguarded `focusin` re-baselines on each keystroke and the
|
|
252
|
+
* row can never report anything: measured, the three commit specs went silent
|
|
253
|
+
* at once. And `focusin` carries `relatedTarget` in a browser and not in
|
|
254
|
+
* happy-dom, so a guard written on it holds in production and not in the
|
|
269
255
|
* specs, which is the worse half. This flag needs neither: entering is
|
|
270
256
|
* `focusin` while it is `false`, and nothing else is.
|
|
271
257
|
*/
|
|
@@ -284,16 +270,15 @@ let HelixHeadlessPinInput = class HelixHeadlessPinInput extends MixinControllerV
|
|
|
284
270
|
this.committed = this.value;
|
|
285
271
|
};
|
|
286
272
|
/**
|
|
287
|
-
* Commits when focus leaves the row
|
|
288
|
-
* the library has and this one did not.
|
|
273
|
+
* Commits when focus leaves the row.
|
|
289
274
|
*
|
|
290
275
|
* `change` is one of the two events `MixinField` reads as "the reader has had
|
|
291
|
-
* a go at this", so a code that was never completed
|
|
292
|
-
* its own `tooShort` message
|
|
293
|
-
* tabbed away from
|
|
294
|
-
* free by relaying its control's own `change`; here the cells each
|
|
295
|
-
* none of them means the code is entered, and neither does any
|
|
296
|
-
* them mean the reader has left.
|
|
276
|
+
* a go at this", so without this a code that was never completed is never
|
|
277
|
+
* `touched` and its own `tooShort` message cannot show: two boxes of four
|
|
278
|
+
* filled and tabbed away from is answered with nothing at all. `Input` gets
|
|
279
|
+
* this for free by relaying its control's own `change`; here the cells each
|
|
280
|
+
* fire one, none of them means the code is entered, and neither does any
|
|
281
|
+
* single one of them mean the reader has left.
|
|
297
282
|
*
|
|
298
283
|
* **Focus leaving the row, and not a cell.** Every character moves focus to
|
|
299
284
|
* the next box, so a per-cell blur would commit on every keystroke, which is
|
|
@@ -349,16 +334,14 @@ let HelixHeadlessPinInput = class HelixHeadlessPinInput extends MixinControllerV
|
|
|
349
334
|
}
|
|
350
335
|
/* **A code has no holes in it**, so a character cannot land past the end of
|
|
351
336
|
what is already there. Clamped rather than allowed, because the value is
|
|
352
|
-
one compact string and a gap in the middle of it does not exist:
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
Pasting two characters into box three of a field with two already in it
|
|
361
|
-
fills from box three, because that is where the end was. */
|
|
337
|
+
one compact string and a gap in the middle of it does not exist: unclamped,
|
|
338
|
+
the boxes and the value disagree about where the reader typed.
|
|
339
|
+
|
|
340
|
+
It reads correctly in both directions. Pasting a whole code while the
|
|
341
|
+
caret happens to sit in box three fills from the start, which is what a
|
|
342
|
+
reader pasting a code means. Pasting two characters into box three of a
|
|
343
|
+
field with two already in it fills from box three, because that is where
|
|
344
|
+
the end was. */
|
|
362
345
|
const start = Math.min(from, this.value.length);
|
|
363
346
|
const characters = this.characters;
|
|
364
347
|
for (let at = 0; at < cleaned.length && start + at < this.count; at += 1) {
|
|
@@ -401,11 +384,9 @@ let HelixHeadlessPinInput = class HelixHeadlessPinInput extends MixinControllerV
|
|
|
401
384
|
* Announces the code as entered, from whichever moment reached it first.
|
|
402
385
|
*
|
|
403
386
|
* **One writer, because the fact has two moments and only one meaning.** A
|
|
404
|
-
* filled code and a row being left are both "the reader is done with this"
|
|
405
|
-
*
|
|
406
|
-
*
|
|
407
|
-
* added that fires without baselining, which is the way the pair would have
|
|
408
|
-
* drifted.
|
|
387
|
+
* filled code and a row being left are both "the reader is done with this".
|
|
388
|
+
* Dispatching from either site directly is how a moment gets added that fires
|
|
389
|
+
* without baselining.
|
|
409
390
|
*
|
|
410
391
|
* Silent when nothing moved since the baseline, which is what makes it safe
|
|
411
392
|
* to call from both: completing a code that is already the committed one, or
|
|
@@ -425,11 +406,10 @@ let HelixHeadlessPinInput = class HelixHeadlessPinInput extends MixinControllerV
|
|
|
425
406
|
* Reports the code and a verdict on it.
|
|
426
407
|
*
|
|
427
408
|
* **A half-entered code is invalid whether or not it is required, and that is
|
|
428
|
-
* the platform's answer rather than ours.**
|
|
429
|
-
*
|
|
430
|
-
*
|
|
431
|
-
*
|
|
432
|
-
* feature this is the same shape as:
|
|
409
|
+
* the platform's answer rather than ours.** `required` guards `valueMissing`
|
|
410
|
+
* and nothing guards `tooShort`, so an optional code is refused for being half
|
|
411
|
+
* filled. Measured in Chromium against a native `<input minlength="4">` with
|
|
412
|
+
* real keystrokes, which is the feature this is the same shape as:
|
|
433
413
|
*
|
|
434
414
|
* | | optional | required |
|
|
435
415
|
* |---|---|---|
|
|
@@ -529,12 +509,12 @@ let HelixHeadlessPinInput = class HelixHeadlessPinInput extends MixinControllerV
|
|
|
529
509
|
__decorate([
|
|
530
510
|
property()
|
|
531
511
|
], HelixHeadlessPinInput.prototype, "autocomplete", void 0);
|
|
512
|
+
__decorate([
|
|
513
|
+
property({ attribute: 'cell-label' })
|
|
514
|
+
], HelixHeadlessPinInput.prototype, "cellLabel", void 0);
|
|
532
515
|
__decorate([
|
|
533
516
|
property({ type: Number })
|
|
534
517
|
], HelixHeadlessPinInput.prototype, "length", void 0);
|
|
535
|
-
__decorate([
|
|
536
|
-
property()
|
|
537
|
-
], HelixHeadlessPinInput.prototype, "type", void 0);
|
|
538
518
|
__decorate([
|
|
539
519
|
property({ reflect: true, type: Boolean })
|
|
540
520
|
], HelixHeadlessPinInput.prototype, "mask", void 0);
|
|
@@ -545,8 +525,8 @@ __decorate([
|
|
|
545
525
|
property({ attribute: 'readonly', reflect: true, type: Boolean })
|
|
546
526
|
], HelixHeadlessPinInput.prototype, "readOnly", void 0);
|
|
547
527
|
__decorate([
|
|
548
|
-
property(
|
|
549
|
-
], HelixHeadlessPinInput.prototype, "
|
|
528
|
+
property()
|
|
529
|
+
], HelixHeadlessPinInput.prototype, "type", void 0);
|
|
550
530
|
HelixHeadlessPinInput = __decorate([
|
|
551
531
|
customElement('helix-headless-pin-input')
|
|
552
532
|
], HelixHeadlessPinInput);
|
|
@@ -61,14 +61,13 @@ export declare class HelixHeadlessPopover extends HelixHeadlessPopover_base {
|
|
|
61
61
|
/**
|
|
62
62
|
* The invoker that last opened the panel, when a command did.
|
|
63
63
|
*
|
|
64
|
-
*
|
|
65
|
-
*
|
|
66
|
-
*
|
|
67
|
-
*
|
|
68
|
-
*
|
|
69
|
-
*
|
|
70
|
-
*
|
|
71
|
-
* and immediately reopened it, for ever.
|
|
64
|
+
* Kept because the `source` a command hands the handlers is needed twice
|
|
65
|
+
* over. It is the anchor: the styled host is a boxless `display: contents`
|
|
66
|
+
* element, so a popover opened by a command outside it would otherwise open
|
|
67
|
+
* against the window origin. And the outside-press dismissal has to know the
|
|
68
|
+
* invoker is part of the control, the press firing on `pointerdown` and the
|
|
69
|
+
* command arriving on the `click` after it, or a `--toggle` button outside
|
|
70
|
+
* the host closes the panel and immediately reopens it, for ever.
|
|
72
71
|
*/
|
|
73
72
|
private invoker;
|
|
74
73
|
protected readonly commands: CommandController;
|
|
@@ -84,20 +83,16 @@ export declare class HelixHeadlessPopover extends HelixHeadlessPopover_base {
|
|
|
84
83
|
/**
|
|
85
84
|
* Puts the panel where `open` says it should be, however it got there.
|
|
86
85
|
*
|
|
87
|
-
* `show()` and `hide()
|
|
88
|
-
*
|
|
89
|
-
*
|
|
90
|
-
*
|
|
91
|
-
*
|
|
92
|
-
* positioned wherever normal flow left it.
|
|
93
|
-
*
|
|
94
|
-
*
|
|
95
|
-
* methods is what makes the two paths the same path. The controller ignores a
|
|
96
|
-
* `show()` on something already raised, so this costs nothing when the
|
|
97
|
-
* methods did the work.
|
|
86
|
+
* Driven from the resolved state rather than from `show()` and `hide()`,
|
|
87
|
+
* which is what makes the imperative and the declarative paths one path. Left
|
|
88
|
+
* to the two methods, a panel opened by *declaring* `open` (or `default-open`,
|
|
89
|
+
* or a consumer assigning the property) renders visible while never reaching
|
|
90
|
+
* the top layer and never being anchored: clipped by the first ancestor with
|
|
91
|
+
* `overflow`, and positioned wherever normal flow left it. The controller
|
|
92
|
+
* ignores a `show()` on something already raised, so this costs nothing when
|
|
93
|
+
* the methods did the work.
|
|
98
94
|
*/
|
|
99
95
|
protected updated(changed: PropertyValues): void;
|
|
100
|
-
protected willUpdate(changed: PropertyValues): void;
|
|
101
96
|
protected render(): TemplateResult;
|
|
102
97
|
}
|
|
103
98
|
declare global {
|
|
@@ -65,9 +65,7 @@ let HelixHeadlessPopover = class HelixHeadlessPopover extends MixinControllerOpe
|
|
|
65
65
|
* It moves if that side does not fit.
|
|
66
66
|
*/
|
|
67
67
|
this.placement = 'bottom-start';
|
|
68
|
-
/* The panel, plus everything that has to happen around it
|
|
69
|
-
rather than the three this took at every call site, which is what let
|
|
70
|
-
`Select` quietly never reach the top layer at all.
|
|
68
|
+
/* The panel, plus everything that has to happen around it.
|
|
71
69
|
*
|
|
72
70
|
* Called `panel` rather than `popover`, because `HTMLElement.popover` is the
|
|
73
71
|
* popover API's own IDL attribute and a field of that name shadows it with
|
|
@@ -75,15 +73,13 @@ let HelixHeadlessPopover = class HelixHeadlessPopover extends MixinControllerOpe
|
|
|
75
73
|
* at runtime is break the API this is built on. */
|
|
76
74
|
this.panel = new PopoverController(this, {
|
|
77
75
|
anchor: () => this.trigger,
|
|
78
|
-
/* The host
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
it.
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
should close it once, not close it on `pointerdown` and reopen it on the
|
|
86
|
-
`click` that follows. */
|
|
76
|
+
/* The host *and* whatever invoked it, never the panel alone. An outside
|
|
77
|
+
press is measured against this, and the styled host is
|
|
78
|
+
`display: contents` with no box of its own, so a boundary of the panel
|
|
79
|
+
alone would close on the very press that opened it. A `--toggle` button
|
|
80
|
+
outside the host is part of the control by any reading a reader would
|
|
81
|
+
give it: pressing it while the panel is open should close it once, not
|
|
82
|
+
close it on `pointerdown` and reopen it on the `click` that follows. */
|
|
87
83
|
boundary: () => [this, this.invoker],
|
|
88
84
|
offset: () => this.offset,
|
|
89
85
|
onDismiss: () => this.hide(),
|
|
@@ -159,17 +155,14 @@ let HelixHeadlessPopover = class HelixHeadlessPopover extends MixinControllerOpe
|
|
|
159
155
|
/**
|
|
160
156
|
* Puts the panel where `open` says it should be, however it got there.
|
|
161
157
|
*
|
|
162
|
-
* `show()` and `hide()
|
|
163
|
-
*
|
|
164
|
-
*
|
|
165
|
-
*
|
|
166
|
-
*
|
|
167
|
-
* positioned wherever normal flow left it.
|
|
168
|
-
*
|
|
169
|
-
*
|
|
170
|
-
* methods is what makes the two paths the same path. The controller ignores a
|
|
171
|
-
* `show()` on something already raised, so this costs nothing when the
|
|
172
|
-
* methods did the work.
|
|
158
|
+
* Driven from the resolved state rather than from `show()` and `hide()`,
|
|
159
|
+
* which is what makes the imperative and the declarative paths one path. Left
|
|
160
|
+
* to the two methods, a panel opened by *declaring* `open` (or `default-open`,
|
|
161
|
+
* or a consumer assigning the property) renders visible while never reaching
|
|
162
|
+
* the top layer and never being anchored: clipped by the first ancestor with
|
|
163
|
+
* `overflow`, and positioned wherever normal flow left it. The controller
|
|
164
|
+
* ignores a `show()` on something already raised, so this costs nothing when
|
|
165
|
+
* the methods did the work.
|
|
173
166
|
*/
|
|
174
167
|
updated(changed) {
|
|
175
168
|
super.updated(changed);
|
|
@@ -183,9 +176,9 @@ let HelixHeadlessPopover = class HelixHeadlessPopover extends MixinControllerOpe
|
|
|
183
176
|
}
|
|
184
177
|
/* Raised here rather than a microtask later, and `updated()` is what makes
|
|
185
178
|
that safe: the render has already been written, so the panel is no longer
|
|
186
|
-
`display: none` and `showPopover` will not throw on it.
|
|
187
|
-
|
|
188
|
-
|
|
179
|
+
`display: none` and `showPopover` will not throw on it. Anything raising
|
|
180
|
+
it before the render has to wait for `updateComplete`; from here there is
|
|
181
|
+
nothing left to wait for. */
|
|
189
182
|
if (this.open) {
|
|
190
183
|
this.panel.show();
|
|
191
184
|
}
|
|
@@ -193,16 +186,6 @@ let HelixHeadlessPopover = class HelixHeadlessPopover extends MixinControllerOpe
|
|
|
193
186
|
this.panel.hide();
|
|
194
187
|
}
|
|
195
188
|
}
|
|
196
|
-
willUpdate(changed) {
|
|
197
|
-
super.willUpdate(changed);
|
|
198
|
-
/* The name is the panel's, not the host's.
|
|
199
|
-
*
|
|
200
|
-
* `label` is documented as the panel's accessible name and was written to
|
|
201
|
-
* the host's internals, and the host carries no role at all: the name
|
|
202
|
-
* landed on a generic element while the panel it names rendered with none.
|
|
203
|
-
* A `dialog` role goes with it, because a name needs something to be the
|
|
204
|
-
* name of, and that is what a popover is. */
|
|
205
|
-
}
|
|
206
189
|
render() {
|
|
207
190
|
return html `<slot name="trigger" @click=${this.handleTriggerClick}></slot>
|
|
208
191
|
<div
|
|
@@ -14,10 +14,13 @@ import { type PropertyValues, type TemplateResult } from 'lit';
|
|
|
14
14
|
* says work is happening and claims no proportion at all. `aria-valuenow` is
|
|
15
15
|
* omitted with it, which is the platform's own signal for the same thing.
|
|
16
16
|
*
|
|
17
|
-
* **The fill is a
|
|
18
|
-
* is derived from `value` and `max` rather than measured,
|
|
19
|
-
* server with no layout and needs nothing after upgrade. That
|
|
20
|
-
* out of the class of geometry this library writes only on the
|
|
17
|
+
* **The fill is a fraction of the track, written as a custom property.**
|
|
18
|
+
* `--progress-fraction` is derived from `value` and `max` rather than measured,
|
|
19
|
+
* so it renders on a server with no layout and needs nothing after upgrade. That
|
|
20
|
+
* is what keeps it out of the class of geometry this library writes only on the
|
|
21
|
+
* client. A consumer never sets it: it carries a number this element computed
|
|
22
|
+
* and CSS cannot, which is what lets a stylesheet draw the thing without
|
|
23
|
+
* measuring anything itself.
|
|
21
24
|
*
|
|
22
25
|
* **`value` is clamped, and out-of-range input is not an error.** A count that
|
|
23
26
|
* runs past its own total is ordinary in real applications, and a bar that
|
|
@@ -29,11 +32,6 @@ import { type PropertyValues, type TemplateResult } from 'lit';
|
|
|
29
32
|
* anonymous to anything walking the light DOM, and a `role` written onto the
|
|
30
33
|
* host as an attribute is one a server's markup never had.
|
|
31
34
|
*
|
|
32
|
-
* The properties below are written by this component and read by whoever draws
|
|
33
|
-
* it. A consumer sets none of them: they carry a number this element computed
|
|
34
|
-
* and CSS cannot, which is what lets a stylesheet on this tier draw the thing
|
|
35
|
-
* without measuring anything itself.
|
|
36
|
-
*
|
|
37
35
|
* @since 0.1.0
|
|
38
36
|
* @status stable
|
|
39
37
|
* @category feedback
|
|
@@ -45,13 +43,9 @@ import { type PropertyValues, type TemplateResult } from 'lit';
|
|
|
45
43
|
* @csspart track - The full length the work is measured against.
|
|
46
44
|
* @csspart value - The reading beside the bar, under `show-value`.
|
|
47
45
|
*
|
|
48
|
-
* @cssproperty --progress-fraction - The value as a fraction of the range, 0 to 1.
|
|
46
|
+
* @cssproperty --progress-fraction - The value as a fraction of the range, 0 to 1. Pinned to 1 while indeterminate.
|
|
49
47
|
*/
|
|
50
48
|
export declare class HelixHeadlessProgress extends HelixElement {
|
|
51
|
-
/**
|
|
52
|
-
* Accessible name for what is in progress.
|
|
53
|
-
*/
|
|
54
|
-
label: string;
|
|
55
49
|
/**
|
|
56
50
|
* Whether the work has a knowable end.
|
|
57
51
|
*
|
|
@@ -66,6 +60,10 @@ export declare class HelixHeadlessProgress extends HelixElement {
|
|
|
66
60
|
* place in the layout when the answer arrives and it becomes determinate.
|
|
67
61
|
*/
|
|
68
62
|
indeterminate: boolean;
|
|
63
|
+
/**
|
|
64
|
+
* Accessible name for what is in progress.
|
|
65
|
+
*/
|
|
66
|
+
label: string;
|
|
69
67
|
/**
|
|
70
68
|
* The total the work is measured against.
|
|
71
69
|
*/
|
|
@@ -21,10 +21,13 @@ import { property } from 'lit/decorators.js';
|
|
|
21
21
|
* says work is happening and claims no proportion at all. `aria-valuenow` is
|
|
22
22
|
* omitted with it, which is the platform's own signal for the same thing.
|
|
23
23
|
*
|
|
24
|
-
* **The fill is a
|
|
25
|
-
* is derived from `value` and `max` rather than measured,
|
|
26
|
-
* server with no layout and needs nothing after upgrade. That
|
|
27
|
-
* out of the class of geometry this library writes only on the
|
|
24
|
+
* **The fill is a fraction of the track, written as a custom property.**
|
|
25
|
+
* `--progress-fraction` is derived from `value` and `max` rather than measured,
|
|
26
|
+
* so it renders on a server with no layout and needs nothing after upgrade. That
|
|
27
|
+
* is what keeps it out of the class of geometry this library writes only on the
|
|
28
|
+
* client. A consumer never sets it: it carries a number this element computed
|
|
29
|
+
* and CSS cannot, which is what lets a stylesheet draw the thing without
|
|
30
|
+
* measuring anything itself.
|
|
28
31
|
*
|
|
29
32
|
* **`value` is clamped, and out-of-range input is not an error.** A count that
|
|
30
33
|
* runs past its own total is ordinary in real applications, and a bar that
|
|
@@ -36,11 +39,6 @@ import { property } from 'lit/decorators.js';
|
|
|
36
39
|
* anonymous to anything walking the light DOM, and a `role` written onto the
|
|
37
40
|
* host as an attribute is one a server's markup never had.
|
|
38
41
|
*
|
|
39
|
-
* The properties below are written by this component and read by whoever draws
|
|
40
|
-
* it. A consumer sets none of them: they carry a number this element computed
|
|
41
|
-
* and CSS cannot, which is what lets a stylesheet on this tier draw the thing
|
|
42
|
-
* without measuring anything itself.
|
|
43
|
-
*
|
|
44
42
|
* @since 0.1.0
|
|
45
43
|
* @status stable
|
|
46
44
|
* @category feedback
|
|
@@ -52,15 +50,11 @@ import { property } from 'lit/decorators.js';
|
|
|
52
50
|
* @csspart track - The full length the work is measured against.
|
|
53
51
|
* @csspart value - The reading beside the bar, under `show-value`.
|
|
54
52
|
*
|
|
55
|
-
* @cssproperty --progress-fraction - The value as a fraction of the range, 0 to 1.
|
|
53
|
+
* @cssproperty --progress-fraction - The value as a fraction of the range, 0 to 1. Pinned to 1 while indeterminate.
|
|
56
54
|
*/
|
|
57
55
|
let HelixHeadlessProgress = class HelixHeadlessProgress extends HelixElement {
|
|
58
56
|
constructor() {
|
|
59
57
|
super(...arguments);
|
|
60
|
-
/**
|
|
61
|
-
* Accessible name for what is in progress.
|
|
62
|
-
*/
|
|
63
|
-
this.label = 'Progress';
|
|
64
58
|
/**
|
|
65
59
|
* Whether the work has a knowable end.
|
|
66
60
|
*
|
|
@@ -75,6 +69,10 @@ let HelixHeadlessProgress = class HelixHeadlessProgress extends HelixElement {
|
|
|
75
69
|
* place in the layout when the answer arrives and it becomes determinate.
|
|
76
70
|
*/
|
|
77
71
|
this.indeterminate = false;
|
|
72
|
+
/**
|
|
73
|
+
* Accessible name for what is in progress.
|
|
74
|
+
*/
|
|
75
|
+
this.label = 'Progress';
|
|
78
76
|
/**
|
|
79
77
|
* The total the work is measured against.
|
|
80
78
|
*/
|
|
@@ -131,18 +129,17 @@ let HelixHeadlessProgress = class HelixHeadlessProgress extends HelixElement {
|
|
|
131
129
|
type were checked. */
|
|
132
130
|
this.internals.ariaValueMin = '0';
|
|
133
131
|
this.internals.ariaValueMax = String(this.max > 0 ? this.max : 100);
|
|
134
|
-
/* Absent, not zero. An omitted `aria-valuenow` is the
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
/* The clamped value itself, not the fraction multiplied back up.
|
|
132
|
+
/* Absent while indeterminate, not zero. An omitted `aria-valuenow` is the
|
|
133
|
+
* platform's own signal for indeterminate, and it is the only one:
|
|
134
|
+
* `aria-busy` says the element is being updated, which is a different claim.
|
|
135
|
+
* Reporting 0 would announce "0 percent" for work that is running, which is
|
|
136
|
+
* worse than saying nothing because it is wrong rather than unknown.
|
|
140
137
|
*
|
|
138
|
+
* Otherwise the clamped value itself, never the fraction multiplied back up.
|
|
141
139
|
* Dividing by `max` and then multiplying by it is a round trip through a
|
|
142
140
|
* float, and for roughly one integer pair in sixteen it does not come back:
|
|
143
141
|
* `1/3*3` is `0.9999999999999998`, which is what the accessibility tree
|
|
144
|
-
* carried and what a screen reader read out.
|
|
145
|
-
* says the same thing without the detour. */
|
|
142
|
+
* carried and what a screen reader read out. */
|
|
146
143
|
const ceiling = this.max > 0 ? this.max : 100;
|
|
147
144
|
this.internals.ariaValueNow = this.indeterminate
|
|
148
145
|
? null
|
|
@@ -185,12 +182,12 @@ let HelixHeadlessProgress = class HelixHeadlessProgress extends HelixElement {
|
|
|
185
182
|
: ''}`;
|
|
186
183
|
}
|
|
187
184
|
};
|
|
188
|
-
__decorate([
|
|
189
|
-
property()
|
|
190
|
-
], HelixHeadlessProgress.prototype, "label", void 0);
|
|
191
185
|
__decorate([
|
|
192
186
|
property({ reflect: true, type: Boolean })
|
|
193
187
|
], HelixHeadlessProgress.prototype, "indeterminate", void 0);
|
|
188
|
+
__decorate([
|
|
189
|
+
property()
|
|
190
|
+
], HelixHeadlessProgress.prototype, "label", void 0);
|
|
194
191
|
__decorate([
|
|
195
192
|
property({ type: Number })
|
|
196
193
|
], HelixHeadlessProgress.prototype, "max", void 0);
|
|
@@ -45,9 +45,15 @@ export type QrStyle = 'dots' | 'rounded' | 'square';
|
|
|
45
45
|
*/
|
|
46
46
|
export declare class HelixHeadlessQrCode extends HelixElement {
|
|
47
47
|
/**
|
|
48
|
-
*
|
|
48
|
+
* How much of the code can be lost and still read.
|
|
49
|
+
*
|
|
50
|
+
* `M` by default, which is the level almost every code in the world uses and
|
|
51
|
+
* costs about fifteen percent redundancy. `H` where a mark covers the center,
|
|
52
|
+
* chosen automatically when the slot is filled: it is the level that makes
|
|
53
|
+
* covering safe, and a consumer who fills the slot has said what they want
|
|
54
|
+
* without having to know that.
|
|
49
55
|
*/
|
|
50
|
-
|
|
56
|
+
correction?: QrCorrection;
|
|
51
57
|
/**
|
|
52
58
|
* What the image is called.
|
|
53
59
|
*
|
|
@@ -65,20 +71,14 @@ export declare class HelixHeadlessQrCode extends HelixElement {
|
|
|
65
71
|
* middle. That cost is paid only by a code that asks for them.
|
|
66
72
|
*
|
|
67
73
|
* A scanner reads contrast between cells, not their shape, so all three
|
|
68
|
-
* scan. `dots` sits a little under half a module so
|
|
74
|
+
* scan. `dots` sits a little under half a module so neighbors do not touch,
|
|
69
75
|
* which is what makes it read as dots rather than as a softened square code.
|
|
70
76
|
*/
|
|
71
77
|
shape: QrStyle;
|
|
72
78
|
/**
|
|
73
|
-
*
|
|
74
|
-
*
|
|
75
|
-
* `M` by default, which is the level almost every code in the world uses and
|
|
76
|
-
* costs about fifteen percent redundancy. `H` where a mark covers the center,
|
|
77
|
-
* chosen automatically when the slot is filled: it is the level that makes
|
|
78
|
-
* covering safe, and a consumer who fills the slot has said what they want
|
|
79
|
-
* without having to know that.
|
|
79
|
+
* What the code encodes, which is usually a URL.
|
|
80
80
|
*/
|
|
81
|
-
|
|
81
|
+
value: string;
|
|
82
82
|
/** Whether anything is slotted into the middle. */
|
|
83
83
|
private logo;
|
|
84
84
|
/** The level actually used, which the slot can raise. */
|