@fusion.dev/helix-headless 0.229.0 → 0.230.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/api.json +1 -1
- package/custom-elements.json +1 -1
- package/dist/canvas/edge/canvas-edge.d.ts +9 -9
- package/dist/canvas/edge/canvas-edge.js +3 -3
- package/dist/canvas/root/canvas-root.js +1 -1
- package/dist/code-block/root/code-block-root.d.ts +9 -9
- package/dist/code-block/root/code-block-root.js +4 -4
- package/dist/color-input/root/color-input-root.d.ts +7 -7
- package/dist/color-input/root/color-input-root.js +9 -9
- package/dist/megamenu/root/megamenu-root.d.ts +24 -24
- package/dist/megamenu/root/megamenu-root.js +4 -4
- package/dist/navigation/root/navigation-root.d.ts +7 -7
- package/dist/navigation/root/navigation-root.js +2 -2
- package/dist/outline/root/outline-root.d.ts +21 -21
- package/dist/outline/root/outline-root.js +6 -6
- package/dist/radio/root/radio-root.d.ts +1 -1
- package/dist/spatial-bar-chart/root/spatial-bar-chart-root.d.ts +33 -33
- package/dist/spatial-bar-chart/root/spatial-bar-chart-root.js +5 -5
- package/dist/steps/root/steps-root.d.ts +17 -17
- package/dist/steps/root/steps-root.js +3 -3
- package/dist/table/column/table-column.d.ts +7 -0
- package/dist/table/column/table-column.js +4 -1
- package/dist/tabs/root/tabs-root.d.ts +13 -13
- package/dist/tabs/root/tabs-root.js +3 -3
- package/dist/time-input/root/time-input-root.d.ts +26 -26
- package/dist/time-input/root/time-input-root.js +10 -10
- package/dist/time-picker/root/time-picker-root.d.ts +40 -40
- package/dist/time-picker/root/time-picker-root.js +10 -10
- package/examples.json +1 -1
- package/lint.json +1 -1
- package/package.json +5 -5
- package/types/jsx.d.ts +203 -196
- package/types/vue.d.ts +159 -155
- package/types/words.d.ts +1 -1
|
@@ -118,6 +118,19 @@ export declare class HelixHeadlessSteps extends HelixHeadlessSteps_base {
|
|
|
118
118
|
* before going on to the next.
|
|
119
119
|
*/
|
|
120
120
|
linear: boolean;
|
|
121
|
+
/**
|
|
122
|
+
* What each step is marked with.
|
|
123
|
+
*
|
|
124
|
+
* Absent is the state itself: a check where a stage is done, a target where
|
|
125
|
+
* the reader is, an empty ring ahead of them. Three marks that need no
|
|
126
|
+
* legend, which a number does: "3" says where a stage sits in the order and
|
|
127
|
+
* nothing about whether it is finished.
|
|
128
|
+
*
|
|
129
|
+
* `numeric` is the older convention and is still the right one where the
|
|
130
|
+
* order is the point, a form that says "step 3 of 5" beside it, or a sequence
|
|
131
|
+
* a reader is told to come back to by number.
|
|
132
|
+
*/
|
|
133
|
+
marker?: 'numeric';
|
|
121
134
|
/**
|
|
122
135
|
* Which way the steps run.
|
|
123
136
|
*
|
|
@@ -139,30 +152,17 @@ export declare class HelixHeadlessSteps extends HelixHeadlessSteps_base {
|
|
|
139
152
|
* number, for a sentence that places the sign itself.
|
|
140
153
|
*/
|
|
141
154
|
progressLabel: string;
|
|
142
|
-
/**
|
|
143
|
-
* A function that answers whether a stage is valid, asked about the stage a
|
|
144
|
-
* reader is on before they move forward from it. Return `false` to keep them
|
|
145
|
-
* there. Not asked of an `optional` stage, nor for a move back.
|
|
146
|
-
*/
|
|
147
|
-
validate?: (step: HelixHeadlessStep) => boolean;
|
|
148
155
|
/**
|
|
149
156
|
* How far through the sequence is, from 0 to 100: the share of its stages
|
|
150
157
|
* that are `complete`, rounded to a whole number.
|
|
151
158
|
*/
|
|
152
159
|
get progress(): number;
|
|
153
160
|
/**
|
|
154
|
-
*
|
|
155
|
-
*
|
|
156
|
-
*
|
|
157
|
-
* the reader is, an empty ring ahead of them. Three marks that need no
|
|
158
|
-
* legend, which a number does: "3" says where a stage sits in the order and
|
|
159
|
-
* nothing about whether it is finished.
|
|
160
|
-
*
|
|
161
|
-
* `numeric` is the older convention and is still the right one where the
|
|
162
|
-
* order is the point, a form that says "step 3 of 5" beside it, or a sequence
|
|
163
|
-
* a reader is told to come back to by number.
|
|
161
|
+
* A function that answers whether a stage is valid, asked about the stage a
|
|
162
|
+
* reader is on before they move forward from it. Return `false` to keep them
|
|
163
|
+
* there. Not asked of an `optional` stage, nor for a move back.
|
|
164
164
|
*/
|
|
165
|
-
|
|
165
|
+
validate?: (step: HelixHeadlessStep) => boolean;
|
|
166
166
|
protected readonly keys: KeyboardNavigationController;
|
|
167
167
|
protected readonly commands: CommandController;
|
|
168
168
|
/** The steps, in the order the consumer wrote them. */
|
|
@@ -272,6 +272,9 @@ __decorate([
|
|
|
272
272
|
__decorate([
|
|
273
273
|
property({ reflect: true, type: Boolean })
|
|
274
274
|
], HelixHeadlessSteps.prototype, "linear", void 0);
|
|
275
|
+
__decorate([
|
|
276
|
+
property({ reflect: true })
|
|
277
|
+
], HelixHeadlessSteps.prototype, "marker", void 0);
|
|
275
278
|
__decorate([
|
|
276
279
|
property({ reflect: true })
|
|
277
280
|
], HelixHeadlessSteps.prototype, "orientation", void 0);
|
|
@@ -282,9 +285,6 @@ __decorate([
|
|
|
282
285
|
__decorate([
|
|
283
286
|
property({ attribute: false })
|
|
284
287
|
], HelixHeadlessSteps.prototype, "validate", void 0);
|
|
285
|
-
__decorate([
|
|
286
|
-
property({ reflect: true })
|
|
287
|
-
], HelixHeadlessSteps.prototype, "variant", void 0);
|
|
288
288
|
HelixHeadlessSteps = __decorate([
|
|
289
289
|
customElement('helix-headless-steps')
|
|
290
290
|
], HelixHeadlessSteps);
|
|
@@ -57,6 +57,10 @@ export { edgeOf } from '../edge.js';
|
|
|
57
57
|
* `separator` on its end edge, moved by dragging or with the arrow keys. In a
|
|
58
58
|
* table with reorderable columns, each column has a grip that the table moves.
|
|
59
59
|
*
|
|
60
|
+
* A sortable heading draws two chevrons after its words. The chevron for the
|
|
61
|
+
* current direction takes the heading's ink, so you can see which columns sort
|
|
62
|
+
* and which way the table is sorted.
|
|
63
|
+
*
|
|
60
64
|
* @since 0.1.0
|
|
61
65
|
* @status stable
|
|
62
66
|
* @aliases Column header, Th
|
|
@@ -72,6 +76,9 @@ export { edgeOf } from '../edge.js';
|
|
|
72
76
|
* @csspart grip-mark - The icon on the grip.
|
|
73
77
|
* @csspart resizer - The edge that is dragged to change the width, when the column is resizable.
|
|
74
78
|
* @csspart sort - The button that a sortable heading renders as.
|
|
79
|
+
* @csspart sort-down - The lower chevron of `sort-mark`, which shows a descending sort.
|
|
80
|
+
* @csspart sort-mark - The two chevrons on a sortable heading. To remove them, set `display: none` on this part.
|
|
81
|
+
* @csspart sort-up - The upper chevron of `sort-mark`, which shows an ascending sort.
|
|
75
82
|
*
|
|
76
83
|
* @cssstate sorted-ascending - While the table is sorted by this column, smallest first.
|
|
77
84
|
* @cssstate sorted-descending - While the table is sorted by this column, largest first.
|
|
@@ -182,7 +182,10 @@ let HelixHeadlessTableColumn = class HelixHeadlessTableColumn extends HelixEleme
|
|
|
182
182
|
</svg>
|
|
183
183
|
</button>`
|
|
184
184
|
: nothing}${this.canSort
|
|
185
|
-
? html `<button part="sort" type="button" tabindex=${control} aria-description=${this.sortWords || nothing}><slot></slot
|
|
185
|
+
? html `<button part="sort" type="button" tabindex=${control} aria-description=${this.sortWords || nothing}><slot></slot><svg aria-hidden="true" fill="none" part="sort-mark" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.9" viewBox="0 0 18 18">
|
|
186
|
+
<path d="M5.5 7.2 9 3.7l3.5 3.5" part="sort-up" />
|
|
187
|
+
<path d="M5.5 10.8 9 14.3l3.5-3.5" part="sort-down" />
|
|
188
|
+
</svg></button>`
|
|
186
189
|
: html `<slot></slot>`}${this.resizable
|
|
187
190
|
? html `<span
|
|
188
191
|
part="resizer"
|
|
@@ -126,18 +126,6 @@ export declare class HelixHeadlessTabs extends HelixHeadlessTabs_base {
|
|
|
126
126
|
* panels on the way.
|
|
127
127
|
*/
|
|
128
128
|
manual: boolean;
|
|
129
|
-
/**
|
|
130
|
-
* The direction the tabs run. `vertical` sets them in a column beside the
|
|
131
|
-
* panels and tells a screen reader the list is vertical.
|
|
132
|
-
*
|
|
133
|
-
* Optional, so the resting row writes no attribute onto the host.
|
|
134
|
-
*/
|
|
135
|
-
orientation?: 'horizontal' | 'vertical';
|
|
136
|
-
/**
|
|
137
|
-
* Whether a strip with more tabs than fit shows a button at each end it can
|
|
138
|
-
* scroll toward.
|
|
139
|
-
*/
|
|
140
|
-
scrollControls: boolean;
|
|
141
129
|
/**
|
|
142
130
|
* How the row of tabs is drawn.
|
|
143
131
|
*
|
|
@@ -162,7 +150,19 @@ export declare class HelixHeadlessTabs extends HelixHeadlessTabs_base {
|
|
|
162
150
|
* Reflected and left unset by default, so the host carries nothing a
|
|
163
151
|
* consumer's server markup does not already have.
|
|
164
152
|
*/
|
|
165
|
-
|
|
153
|
+
marker?: 'segmented' | 'underlined';
|
|
154
|
+
/**
|
|
155
|
+
* The direction the tabs run. `vertical` sets them in a column beside the
|
|
156
|
+
* panels and tells a screen reader the list is vertical.
|
|
157
|
+
*
|
|
158
|
+
* Optional, so the resting row writes no attribute onto the host.
|
|
159
|
+
*/
|
|
160
|
+
orientation?: 'horizontal' | 'vertical';
|
|
161
|
+
/**
|
|
162
|
+
* Whether a strip with more tabs than fit shows a button at each end it can
|
|
163
|
+
* scroll toward.
|
|
164
|
+
*/
|
|
165
|
+
scrollControls: boolean;
|
|
166
166
|
private get tabs();
|
|
167
167
|
/** Whether any tab is a link, so arriving on one chooses nothing. */
|
|
168
168
|
private get linked();
|
|
@@ -248,15 +248,15 @@ __decorate([
|
|
|
248
248
|
__decorate([
|
|
249
249
|
property({ reflect: true, type: Boolean })
|
|
250
250
|
], HelixHeadlessTabs.prototype, "manual", void 0);
|
|
251
|
+
__decorate([
|
|
252
|
+
property({ reflect: true })
|
|
253
|
+
], HelixHeadlessTabs.prototype, "marker", void 0);
|
|
251
254
|
__decorate([
|
|
252
255
|
property({ reflect: true })
|
|
253
256
|
], HelixHeadlessTabs.prototype, "orientation", void 0);
|
|
254
257
|
__decorate([
|
|
255
258
|
property({ attribute: 'scroll-controls', reflect: true, type: Boolean })
|
|
256
259
|
], HelixHeadlessTabs.prototype, "scrollControls", void 0);
|
|
257
|
-
__decorate([
|
|
258
|
-
property({ reflect: true })
|
|
259
|
-
], HelixHeadlessTabs.prototype, "variant", void 0);
|
|
260
260
|
__decorate([
|
|
261
261
|
state()
|
|
262
262
|
], HelixHeadlessTabs.prototype, "more", void 0);
|
|
@@ -30,7 +30,7 @@ declare const HelixHeadlessTimeInput_base: (new (...args: any[]) => import("@fus
|
|
|
30
30
|
* with `aria-haspopup="dialog"`, `aria-expanded`, and `aria-controls`, since
|
|
31
31
|
* Down opens the list from it. In the list, the arrow keys, typed digits and PageUp and PageDown
|
|
32
32
|
* move through the times, and Enter, Space or a click chooses one and closes
|
|
33
|
-
* the panel. With `
|
|
33
|
+
* the panel. With `picker="wheels"` each wheel moves the time as you turn it,
|
|
34
34
|
* the panel stays open, and Enter or Escape closes it.
|
|
35
35
|
*
|
|
36
36
|
* With `segmented`, the field is a row of segments in place of the text: an
|
|
@@ -232,6 +232,23 @@ export declare class HelixHeadlessTimeInput extends HelixHeadlessTimeInput_base
|
|
|
232
232
|
* `show-now`.
|
|
233
233
|
*/
|
|
234
234
|
nowLabel: string;
|
|
235
|
+
/**
|
|
236
|
+
* Whether the panel shows one list of times or a column for each part of the
|
|
237
|
+
* time.
|
|
238
|
+
*
|
|
239
|
+
* `list` offers whole times, which is what a product with slots or opening
|
|
240
|
+
* hours has. `wheels` splits them into an hour, a minute and a meridiem where
|
|
241
|
+
* the locale uses one, which is the only way to reach `23:45` without
|
|
242
|
+
* scrolling most of a day. `TimePicker` carries the longer note on the trade.
|
|
243
|
+
*
|
|
244
|
+
* **Optional rather than defaulted, which is not a style preference.** A
|
|
245
|
+
* reflecting property with a default writes its attribute onto every host the
|
|
246
|
+
* moment the element upgrades, including the ones a consumer rendered and did
|
|
247
|
+
* not touch, and React reads that as a hydration mismatch. The absent
|
|
248
|
+
* attribute *is* the list, which the stylesheet reads as the base rule, so
|
|
249
|
+
* only the departure has to be named.
|
|
250
|
+
*/
|
|
251
|
+
picker?: 'list' | 'wheels';
|
|
235
252
|
/**
|
|
236
253
|
* Placeholder text shown before a time is entered.
|
|
237
254
|
*/
|
|
@@ -296,17 +313,6 @@ export declare class HelixHeadlessTimeInput extends HelixHeadlessTimeInput_base
|
|
|
296
313
|
* The message shown when `disable-times` bars a time.
|
|
297
314
|
*/
|
|
298
315
|
unavailableMessage: string;
|
|
299
|
-
/**
|
|
300
|
-
* The message for text that is no time, where `bad-input-message` is not
|
|
301
|
-
* set. `{mode}` is `single`, `range`, or `multiple`, `{example}` is a time
|
|
302
|
-
* written as the field writes one, `2:30 PM` in `en-US` and `14:30` in
|
|
303
|
-
* `de-DE`, and `{shape}` is `HH:mm`, or `HH:mm:ss` with `seconds`.
|
|
304
|
-
*
|
|
305
|
-
* **The default names a time the field reads back.** It said "Enter a time
|
|
306
|
-
* as HH:mm." to a reader whose field showed `2:30 PM`, and a pattern token
|
|
307
|
-
* is words for a developer.
|
|
308
|
-
*/
|
|
309
|
-
unreadableMessage: string;
|
|
310
316
|
/** Every time in the value, which may hold more than one. */
|
|
311
317
|
private get held();
|
|
312
318
|
/**
|
|
@@ -385,22 +391,16 @@ export declare class HelixHeadlessTimeInput extends HelixHeadlessTimeInput_base
|
|
|
385
391
|
/** What is wrong with the times, which the text input cannot say. */
|
|
386
392
|
protected validate(): string | readonly [keyof ValidityStateFlags, string];
|
|
387
393
|
/**
|
|
388
|
-
*
|
|
389
|
-
* time
|
|
390
|
-
*
|
|
391
|
-
* `
|
|
392
|
-
* hours has. `wheels` splits them into an hour, a minute and a meridiem where
|
|
393
|
-
* the locale uses one, which is the only way to reach `23:45` without
|
|
394
|
-
* scrolling most of a day. `TimePicker` carries the longer note on the trade.
|
|
394
|
+
* The message for text that is no time, where `bad-input-message` is not
|
|
395
|
+
* set. `{mode}` is `single`, `range`, or `multiple`, `{example}` is a time
|
|
396
|
+
* written as the field writes one, `2:30 PM` in `en-US` and `14:30` in
|
|
397
|
+
* `de-DE`, and `{shape}` is `HH:mm`, or `HH:mm:ss` with `seconds`.
|
|
395
398
|
*
|
|
396
|
-
* **
|
|
397
|
-
*
|
|
398
|
-
*
|
|
399
|
-
* not touch, and React reads that as a hydration mismatch. The absent
|
|
400
|
-
* attribute *is* the list, which the stylesheet reads as the base rule, so
|
|
401
|
-
* only the departure has to be named.
|
|
399
|
+
* **The default names a time the field reads back.** It said "Enter a time
|
|
400
|
+
* as HH:mm." to a reader whose field showed `2:30 PM`, and a pattern token
|
|
401
|
+
* is words for a developer.
|
|
402
402
|
*/
|
|
403
|
-
|
|
403
|
+
unreadableMessage: string;
|
|
404
404
|
protected updated(changed: PropertyValues): void;
|
|
405
405
|
/**
|
|
406
406
|
* The clock the field opens, behind a seam the styled tier can move.
|
|
@@ -33,7 +33,6 @@ let HelixHeadlessTimeInput = class HelixHeadlessTimeInput extends MixinSegmented
|
|
|
33
33
|
this.timeStyle = 'local';
|
|
34
34
|
this.triggerLabel = 'Choose a time';
|
|
35
35
|
this.unavailableMessage = 'Choose a time that is available.';
|
|
36
|
-
this.unreadableMessage = '{mode, select, single {Enter a time such as {example}.} other {Enter times such as {example}, separated by commas.}}';
|
|
37
36
|
this.draft = '';
|
|
38
37
|
this.handleTextCommit = (event) => {
|
|
39
38
|
if (this.mode !== 'multiple') {
|
|
@@ -90,18 +89,19 @@ let HelixHeadlessTimeInput = class HelixHeadlessTimeInput extends MixinSegmented
|
|
|
90
89
|
return;
|
|
91
90
|
}
|
|
92
91
|
this.restore();
|
|
93
|
-
if (this.mode === undefined && this.
|
|
92
|
+
if (this.mode === undefined && this.picker !== 'wheels') {
|
|
94
93
|
this.requestOpen(false);
|
|
95
94
|
this.updateComplete.then(() => this.returnFocus());
|
|
96
95
|
}
|
|
97
96
|
};
|
|
98
97
|
this.handleWheelEnter = (event) => {
|
|
99
|
-
if (event.key === 'Enter' && this.
|
|
98
|
+
if (event.key === 'Enter' && this.picker === 'wheels' && this.open) {
|
|
100
99
|
event.preventDefault();
|
|
101
100
|
this.requestOpen(false);
|
|
102
101
|
this.returnFocus();
|
|
103
102
|
}
|
|
104
103
|
};
|
|
104
|
+
this.unreadableMessage = '{mode, select, single {Enter a time such as {example}.} other {Enter times such as {example}, separated by commas.}}';
|
|
105
105
|
this.handleClear = () => {
|
|
106
106
|
if (this.value !== '' && this.requestValue('')) {
|
|
107
107
|
this.announceChange();
|
|
@@ -242,7 +242,7 @@ let HelixHeadlessTimeInput = class HelixHeadlessTimeInput extends MixinSegmented
|
|
|
242
242
|
option-label: picker-option-label, option-text: picker-option-text"
|
|
243
243
|
?invalid=${this.resolvedFeedback !== ''}
|
|
244
244
|
mode=${this.mode ?? nothing}
|
|
245
|
-
|
|
245
|
+
picker=${this.picker ?? nothing}
|
|
246
246
|
disable-times=${this.disableTimes || nothing}
|
|
247
247
|
manual
|
|
248
248
|
label=${hostWords(this, slottedWords(this, ['label']) || this.label) || 'Time'}
|
|
@@ -410,6 +410,9 @@ __decorate([
|
|
|
410
410
|
words,
|
|
411
411
|
property({ attribute: 'now-label' })
|
|
412
412
|
], HelixHeadlessTimeInput.prototype, "nowLabel", void 0);
|
|
413
|
+
__decorate([
|
|
414
|
+
property({ reflect: true })
|
|
415
|
+
], HelixHeadlessTimeInput.prototype, "picker", void 0);
|
|
413
416
|
__decorate([
|
|
414
417
|
words,
|
|
415
418
|
property()
|
|
@@ -450,16 +453,13 @@ __decorate([
|
|
|
450
453
|
words,
|
|
451
454
|
property({ attribute: 'unavailable-message' })
|
|
452
455
|
], HelixHeadlessTimeInput.prototype, "unavailableMessage", void 0);
|
|
453
|
-
__decorate([
|
|
454
|
-
words,
|
|
455
|
-
property({ attribute: 'unreadable-message' })
|
|
456
|
-
], HelixHeadlessTimeInput.prototype, "unreadableMessage", void 0);
|
|
457
456
|
__decorate([
|
|
458
457
|
state()
|
|
459
458
|
], HelixHeadlessTimeInput.prototype, "draft", void 0);
|
|
460
459
|
__decorate([
|
|
461
|
-
|
|
462
|
-
|
|
460
|
+
words,
|
|
461
|
+
property({ attribute: 'unreadable-message' })
|
|
462
|
+
], HelixHeadlessTimeInput.prototype, "unreadableMessage", void 0);
|
|
463
463
|
HelixHeadlessTimeInput = __decorate([
|
|
464
464
|
customElement('helix-headless-time-input')
|
|
465
465
|
], HelixHeadlessTimeInput);
|
|
@@ -9,7 +9,7 @@ declare const HelixHeadlessTimePicker_base: (new (...args: any[]) => import("@fu
|
|
|
9
9
|
* @description
|
|
10
10
|
* Shows the times at each `step` as a `Listbox`, which provides the keyboard
|
|
11
11
|
* behavior, typeahead, scrolling into view, and announcements for a set of
|
|
12
|
-
* options. `
|
|
12
|
+
* options. `picker="wheels"` shows a column each for the hour, the minute, and
|
|
13
13
|
* the meridiem, and one for the second with `seconds`. Left and Right move
|
|
14
14
|
* between the wheels, and Tab does too.
|
|
15
15
|
*
|
|
@@ -257,7 +257,7 @@ export declare class HelixHeadlessTimePicker extends HelixHeadlessTimePicker_bas
|
|
|
257
257
|
* separate "from" and "to" control, is two answers to what a product asks as
|
|
258
258
|
* one, and it makes the between part impossible to show.
|
|
259
259
|
*
|
|
260
|
-
* **Neither works on wheels and the
|
|
260
|
+
* **Neither works on wheels and the picker falls back.** A range on
|
|
261
261
|
* wheels is two sets of wheels, which is two controls; a multiple is a set,
|
|
262
262
|
* and a wheel has exactly one value by construction. Rather than draw
|
|
263
263
|
* something that cannot say what it holds, `wheels` renders as a list
|
|
@@ -269,16 +269,39 @@ export declare class HelixHeadlessTimePicker extends HelixHeadlessTimePicker_bas
|
|
|
269
269
|
* `show-now`.
|
|
270
270
|
*/
|
|
271
271
|
nowLabel: string;
|
|
272
|
+
/**
|
|
273
|
+
* Shows the times as one `list`, or as `wheels` with a column for each part
|
|
274
|
+
* of the time.
|
|
275
|
+
*
|
|
276
|
+
* `list` is the default and offers whole times, which is what a product with
|
|
277
|
+
* opening hours or slots actually has. `wheels` splits them into an hour, a
|
|
278
|
+
* minute and, where the locale uses one, a meridiem: three short columns
|
|
279
|
+
* instead of ninety-six rows, and the only way to reach `23:45` without
|
|
280
|
+
* scrolling most of a day.
|
|
281
|
+
*
|
|
282
|
+
* The trade is that a wheel cannot say which *combinations* are on offer. A
|
|
283
|
+
* list of half hours from nine to five is seventeen rows and every one of them
|
|
284
|
+
* is a time the product has; the same thing as columns is an hour column and a
|
|
285
|
+
* minute column, and nothing in either says the two are only valid together.
|
|
286
|
+
* The bounds are still enforced, so a reader can be refused after the fact,
|
|
287
|
+
* which is worse than not being offered it.
|
|
288
|
+
*
|
|
289
|
+
* So: `list` where the set is the point, `wheels` where any time is allowed
|
|
290
|
+
* and the range is a whole day.
|
|
291
|
+
*
|
|
292
|
+
* **Optional rather than defaulted, which is not a style preference.** A
|
|
293
|
+
* reflecting property with a default writes its attribute onto every host the
|
|
294
|
+
* moment the element upgrades, including the ones a consumer rendered and did
|
|
295
|
+
* not touch, and React reads that as a hydration mismatch. The absent
|
|
296
|
+
* attribute *is* the list, which the stylesheet reads as the base rule, so
|
|
297
|
+
* only the departure has to be named.
|
|
298
|
+
*/
|
|
299
|
+
picker?: 'list' | 'wheels';
|
|
272
300
|
/**
|
|
273
301
|
* The validation message for a time after `max`. `{max}` is replaced with
|
|
274
302
|
* `max`, written in `locale`.
|
|
275
303
|
*/
|
|
276
304
|
rangeOverflowMessage: string;
|
|
277
|
-
/**
|
|
278
|
-
* The validation message for a time before `min`. `{min}` is replaced with
|
|
279
|
-
* `min`, written in `locale`.
|
|
280
|
-
*/
|
|
281
|
-
rangeUnderflowMessage: string;
|
|
282
305
|
/**
|
|
283
306
|
* Every time on offer, as seconds since midnight.
|
|
284
307
|
*
|
|
@@ -428,6 +451,13 @@ export declare class HelixHeadlessTimePicker extends HelixHeadlessTimePicker_bas
|
|
|
428
451
|
* rather than wrong, which is why it can be left in.
|
|
429
452
|
*/
|
|
430
453
|
reveal(): void;
|
|
454
|
+
/**
|
|
455
|
+
* The validation message for a time before `min`. `{min}` is replaced with
|
|
456
|
+
* `min`, written in `locale`.
|
|
457
|
+
*/
|
|
458
|
+
rangeUnderflowMessage: string;
|
|
459
|
+
/** Refuses every change while read-only. See `readOnly`. */
|
|
460
|
+
requestValue(next: string): boolean;
|
|
431
461
|
/**
|
|
432
462
|
* Blocks changes to the time. The value is still submitted with the form.
|
|
433
463
|
*
|
|
@@ -442,8 +472,6 @@ export declare class HelixHeadlessTimePicker extends HelixHeadlessTimePicker_bas
|
|
|
442
472
|
* else set needs.
|
|
443
473
|
*/
|
|
444
474
|
readOnly: boolean;
|
|
445
|
-
/** Refuses every change while read-only. See `readOnly`. */
|
|
446
|
-
requestValue(next: string): boolean;
|
|
447
475
|
/**
|
|
448
476
|
* Stops the form from submitting while no time is chosen.
|
|
449
477
|
*/
|
|
@@ -506,10 +534,6 @@ export declare class HelixHeadlessTimePicker extends HelixHeadlessTimePicker_bas
|
|
|
506
534
|
* The validation message for a time that `disable-times` bars.
|
|
507
535
|
*/
|
|
508
536
|
unavailableMessage: string;
|
|
509
|
-
/**
|
|
510
|
-
* The validation message for a required time picker with no time chosen.
|
|
511
|
-
*/
|
|
512
|
-
valueMissingMessage: string;
|
|
513
537
|
/**
|
|
514
538
|
* What is wrong with a time the picker can read, as a validity flag and a
|
|
515
539
|
* message, or nothing.
|
|
@@ -520,33 +544,9 @@ export declare class HelixHeadlessTimePicker extends HelixHeadlessTimePicker_bas
|
|
|
520
544
|
*/
|
|
521
545
|
private fault;
|
|
522
546
|
/**
|
|
523
|
-
*
|
|
524
|
-
* of the time.
|
|
525
|
-
*
|
|
526
|
-
* `list` is the default and offers whole times, which is what a product with
|
|
527
|
-
* opening hours or slots actually has. `wheels` splits them into an hour, a
|
|
528
|
-
* minute and, where the locale uses one, a meridiem: three short columns
|
|
529
|
-
* instead of ninety-six rows, and the only way to reach `23:45` without
|
|
530
|
-
* scrolling most of a day.
|
|
531
|
-
*
|
|
532
|
-
* The trade is that a wheel cannot say which *combinations* are on offer. A
|
|
533
|
-
* list of half hours from nine to five is seventeen rows and every one of them
|
|
534
|
-
* is a time the product has; the same thing as columns is an hour column and a
|
|
535
|
-
* minute column, and nothing in either says the two are only valid together.
|
|
536
|
-
* The bounds are still enforced, so a reader can be refused after the fact,
|
|
537
|
-
* which is worse than not being offered it.
|
|
538
|
-
*
|
|
539
|
-
* So: `list` where the set is the point, `wheels` where any time is allowed
|
|
540
|
-
* and the range is a whole day.
|
|
541
|
-
*
|
|
542
|
-
* **Optional rather than defaulted, which is not a style preference.** A
|
|
543
|
-
* reflecting property with a default writes its attribute onto every host the
|
|
544
|
-
* moment the element upgrades, including the ones a consumer rendered and did
|
|
545
|
-
* not touch, and React reads that as a hydration mismatch. The absent
|
|
546
|
-
* attribute *is* the list, which the stylesheet reads as the base rule, so
|
|
547
|
-
* only the departure has to be named.
|
|
547
|
+
* The validation message for a required time picker with no time chosen.
|
|
548
548
|
*/
|
|
549
|
-
|
|
549
|
+
valueMissingMessage: string;
|
|
550
550
|
/**
|
|
551
551
|
* Reports "required and empty", or clears it.
|
|
552
552
|
*
|
|
@@ -679,7 +679,7 @@ export declare class HelixHeadlessTimePicker extends HelixHeadlessTimePicker_bas
|
|
|
679
679
|
private readonly handleColumnsKeydown;
|
|
680
680
|
private renderSpinner;
|
|
681
681
|
/**
|
|
682
|
-
* The flat list of times, for the
|
|
682
|
+
* The flat list of times, for the picker that is not wheels, behind a seam the styled tier can move.
|
|
683
683
|
*
|
|
684
684
|
* A method rather than a fragment inline, so a tier above can render its own,
|
|
685
685
|
* wrap this one, pass it a property the base does not know about, or leave it
|
|
@@ -21,7 +21,6 @@ let HelixHeadlessTimePicker = class HelixHeadlessTimePicker extends MixinPickerF
|
|
|
21
21
|
this.min = '00:00';
|
|
22
22
|
this.nowLabel = 'Now';
|
|
23
23
|
this.rangeOverflowMessage = 'Choose a time at or before {max}.';
|
|
24
|
-
this.rangeUnderflowMessage = 'Choose a time at or after {min}.';
|
|
25
24
|
this.handleListInput = (event) => {
|
|
26
25
|
event.stopPropagation();
|
|
27
26
|
};
|
|
@@ -75,6 +74,7 @@ let HelixHeadlessTimePicker = class HelixHeadlessTimePicker extends MixinPickerF
|
|
|
75
74
|
}
|
|
76
75
|
this.requestValue(this.valueFor(nearest));
|
|
77
76
|
};
|
|
77
|
+
this.rangeUnderflowMessage = 'Choose a time at or after {min}.';
|
|
78
78
|
this.readOnly = false;
|
|
79
79
|
this.required = false;
|
|
80
80
|
this.seconds = false;
|
|
@@ -235,7 +235,7 @@ let HelixHeadlessTimePicker = class HelixHeadlessTimePicker extends MixinPickerF
|
|
|
235
235
|
if (this.mode !== undefined) {
|
|
236
236
|
return;
|
|
237
237
|
}
|
|
238
|
-
if (this.
|
|
238
|
+
if (this.picker !== 'wheels') {
|
|
239
239
|
this.highlightNearest();
|
|
240
240
|
this.partNamed('list')?.reveal?.();
|
|
241
241
|
return;
|
|
@@ -385,7 +385,7 @@ let HelixHeadlessTimePicker = class HelixHeadlessTimePicker extends MixinPickerF
|
|
|
385
385
|
updated(changed) {
|
|
386
386
|
super.updated(changed);
|
|
387
387
|
this.reportRequired();
|
|
388
|
-
if (this.
|
|
388
|
+
if (this.picker === 'wheels') {
|
|
389
389
|
this.reveal();
|
|
390
390
|
void this.revealWhenSettled();
|
|
391
391
|
}
|
|
@@ -499,7 +499,7 @@ let HelixHeadlessTimePicker = class HelixHeadlessTimePicker extends MixinPickerF
|
|
|
499
499
|
</${this.tag('listbox')}>`;
|
|
500
500
|
}
|
|
501
501
|
render() {
|
|
502
|
-
if (this.
|
|
502
|
+
if (this.picker === 'wheels' && this.mode === undefined) {
|
|
503
503
|
return html `${this.renderSlottedLabel()}${this.renderSpinner()}${this.renderNow()}${this.renderHint()}${this.renderPickerFeedback()}`;
|
|
504
504
|
}
|
|
505
505
|
return html `${this.renderSlottedLabel()}${this.renderList()}${this.renderNow()}${this.renderHint()}${this.renderPickerFeedback()}`;
|
|
@@ -573,17 +573,20 @@ __decorate([
|
|
|
573
573
|
words,
|
|
574
574
|
property({ attribute: 'now-label' })
|
|
575
575
|
], HelixHeadlessTimePicker.prototype, "nowLabel", void 0);
|
|
576
|
+
__decorate([
|
|
577
|
+
property({ reflect: true })
|
|
578
|
+
], HelixHeadlessTimePicker.prototype, "picker", void 0);
|
|
576
579
|
__decorate([
|
|
577
580
|
words,
|
|
578
581
|
property({ attribute: 'range-overflow-message' })
|
|
579
582
|
], HelixHeadlessTimePicker.prototype, "rangeOverflowMessage", void 0);
|
|
583
|
+
__decorate([
|
|
584
|
+
state()
|
|
585
|
+
], HelixHeadlessTimePicker.prototype, "previewed", void 0);
|
|
580
586
|
__decorate([
|
|
581
587
|
words,
|
|
582
588
|
property({ attribute: 'range-underflow-message' })
|
|
583
589
|
], HelixHeadlessTimePicker.prototype, "rangeUnderflowMessage", void 0);
|
|
584
|
-
__decorate([
|
|
585
|
-
state()
|
|
586
|
-
], HelixHeadlessTimePicker.prototype, "previewed", void 0);
|
|
587
590
|
__decorate([
|
|
588
591
|
property({ attribute: 'readonly', reflect: true, type: Boolean })
|
|
589
592
|
], HelixHeadlessTimePicker.prototype, "readOnly", void 0);
|
|
@@ -617,9 +620,6 @@ __decorate([
|
|
|
617
620
|
words,
|
|
618
621
|
property({ attribute: 'value-missing-message' })
|
|
619
622
|
], HelixHeadlessTimePicker.prototype, "valueMissingMessage", void 0);
|
|
620
|
-
__decorate([
|
|
621
|
-
property({ reflect: true })
|
|
622
|
-
], HelixHeadlessTimePicker.prototype, "variant", void 0);
|
|
623
623
|
__decorate([
|
|
624
624
|
state()
|
|
625
625
|
], HelixHeadlessTimePicker.prototype, "hintSlotted", void 0);
|