@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
|
@@ -122,62 +122,10 @@ let HelixHeadlessDateInput = class HelixHeadlessDateInput extends MixinControlle
|
|
|
122
122
|
* What the browser may autofill here, as one of the platform's own tokens.
|
|
123
123
|
*
|
|
124
124
|
* Empty leaves the attribute off, which is the browser's default and is what
|
|
125
|
-
* lets autofill work at all
|
|
126
|
-
*
|
|
127
|
-
* consumer had no way to ask for it. See 295.
|
|
125
|
+
* lets autofill work at all: hardcoding `off` here means a birthday or a
|
|
126
|
+
* postal code can never be filled in for a reader.
|
|
128
127
|
*/
|
|
129
128
|
this.autocomplete = '';
|
|
130
|
-
/**
|
|
131
|
-
* How many months the calendar shows, side by side.
|
|
132
|
-
*
|
|
133
|
-
* Worth more than one mainly for a range, where picking a start in March and
|
|
134
|
-
* an end in April otherwise means paging between them and losing sight of the
|
|
135
|
-
* first. The panel is sized by its content, so this widens it.
|
|
136
|
-
*/
|
|
137
|
-
this.months = 1;
|
|
138
|
-
/**
|
|
139
|
-
* How many dates are shown as tags before the rest are counted, in `multiple`.
|
|
140
|
-
*
|
|
141
|
-
* `0` is all of them, and is the default: a cap that guesses is worse than no
|
|
142
|
-
* cap, because the number that fits depends on the width of the field and the
|
|
143
|
-
* length of what is in it, neither of which this element knows. What a cap is
|
|
144
|
-
* genuinely for is a field in a row or a table cell, where a set of twelve
|
|
145
|
-
* dates would push everything below it down a line at a time.
|
|
146
|
-
*
|
|
147
|
-
* The remainder is counted rather than hidden. "3 more" is a fact a reader can
|
|
148
|
-
* act on, where a row that silently stops is a field that appears to have lost
|
|
149
|
-
* what was put in it, and the count is what tells them there is more to see.
|
|
150
|
-
*/
|
|
151
|
-
this.maxTags = 0;
|
|
152
|
-
/**
|
|
153
|
-
* Earliest date that can be chosen, as `YYYY-MM-DD`.
|
|
154
|
-
*/
|
|
155
|
-
this.min = '';
|
|
156
|
-
/**
|
|
157
|
-
* How far apart the selectable dates are, in days.
|
|
158
|
-
*
|
|
159
|
-
* `<input type="date" step>`'s own unit, handed to the calendar this renders
|
|
160
|
-
* so the field and the grid agree about which dates exist. Counted from `min`
|
|
161
|
-
* where there is one and from 1 January 1970 where there is not, which is the
|
|
162
|
-
* platform's base.
|
|
163
|
-
*/
|
|
164
|
-
this.step = 1;
|
|
165
|
-
/**
|
|
166
|
-
* Latest date that can be chosen, as `YYYY-MM-DD`.
|
|
167
|
-
*/
|
|
168
|
-
this.max = '';
|
|
169
|
-
/**
|
|
170
|
-
* Dates that cannot be chosen, as a comma-separated `YYYY-MM-DD` list.
|
|
171
|
-
*/
|
|
172
|
-
this.disableDates = '';
|
|
173
|
-
/**
|
|
174
|
-
* Days of the week that cannot be chosen, `0` for Sunday through `6`.
|
|
175
|
-
*/
|
|
176
|
-
this.disableDays = '';
|
|
177
|
-
/**
|
|
178
|
-
* First column of the week in the calendar, `0` for Sunday through `6`.
|
|
179
|
-
*/
|
|
180
|
-
this.firstDayOfWeek = 0;
|
|
181
129
|
/**
|
|
182
130
|
* How a date is written in the field: `short` through `full`, or ISO.
|
|
183
131
|
*
|
|
@@ -203,18 +151,79 @@ let HelixHeadlessDateInput = class HelixHeadlessDateInput extends MixinControlle
|
|
|
203
151
|
* submits and what `min` and `max` compare against.
|
|
204
152
|
*/
|
|
205
153
|
this.dateStyle = 'long';
|
|
154
|
+
/**
|
|
155
|
+
* Dates that cannot be chosen, as a comma-separated `YYYY-MM-DD` list.
|
|
156
|
+
*/
|
|
157
|
+
this.disableDates = '';
|
|
158
|
+
/**
|
|
159
|
+
* Days of the week that cannot be chosen, `0` for Sunday through `6`.
|
|
160
|
+
*/
|
|
161
|
+
this.disableDays = '';
|
|
162
|
+
/**
|
|
163
|
+
* First column of the week in the calendar, `0` for Sunday through `6`.
|
|
164
|
+
*/
|
|
165
|
+
this.firstDayOfWeek = 0;
|
|
206
166
|
/**
|
|
207
167
|
* Language tag the calendar names its months and days in.
|
|
208
168
|
*/
|
|
209
169
|
this.locale = '';
|
|
170
|
+
/**
|
|
171
|
+
* Latest date that can be chosen, as `YYYY-MM-DD`.
|
|
172
|
+
*/
|
|
173
|
+
this.max = '';
|
|
174
|
+
/**
|
|
175
|
+
* How many dates are shown as tags before the rest are counted, in `multiple`.
|
|
176
|
+
*
|
|
177
|
+
* `0` is all of them, and is the default: a cap that guesses is worse than no
|
|
178
|
+
* cap, because the number that fits depends on the width of the field and the
|
|
179
|
+
* length of what is in it, neither of which this element knows. What a cap is
|
|
180
|
+
* genuinely for is a field in a row or a table cell, where a set of twelve
|
|
181
|
+
* dates would push everything below it down a line at a time.
|
|
182
|
+
*
|
|
183
|
+
* The remainder is counted rather than hidden. `+3` is a fact a reader can
|
|
184
|
+
* act on, where a row that silently stops is a field that appears to have lost
|
|
185
|
+
* what was put in it, and the count is what tells them there is more to see.
|
|
186
|
+
*/
|
|
187
|
+
this.maxTags = 0;
|
|
188
|
+
/**
|
|
189
|
+
* Earliest date that can be chosen, as `YYYY-MM-DD`.
|
|
190
|
+
*/
|
|
191
|
+
this.min = '';
|
|
192
|
+
/**
|
|
193
|
+
* How many months the calendar shows, side by side.
|
|
194
|
+
*
|
|
195
|
+
* Worth more than one mainly for a range, where picking a start in March and
|
|
196
|
+
* an end in April otherwise means paging between them and losing sight of the
|
|
197
|
+
* first. The panel is sized by its content, so this widens it.
|
|
198
|
+
*/
|
|
199
|
+
this.months = 1;
|
|
210
200
|
/**
|
|
211
201
|
* What the field says before a date is in it.
|
|
212
202
|
*/
|
|
213
203
|
this.placeholder = 'YYYY-MM-DD';
|
|
214
204
|
/**
|
|
215
|
-
*
|
|
205
|
+
* Whether the control refuses changes while still submitting its value.
|
|
206
|
+
*
|
|
207
|
+
* **Enforced by refusing every request in one place**, which is the seam this
|
|
208
|
+
* component already has: `requestValue` is what every path here comes through,
|
|
209
|
+
* and gating it once is what stops the next call site from being written
|
|
210
|
+
* without the check.
|
|
211
|
+
*
|
|
212
|
+
* Not `disabled`, which is the confusion worth naming: a disabled control
|
|
213
|
+
* submits nothing and leaves the tab order, and a read-only one submits its
|
|
214
|
+
* value and stays reachable, which is what a form showing a value somebody
|
|
215
|
+
* else set needs.
|
|
216
216
|
*/
|
|
217
|
-
this.
|
|
217
|
+
this.readOnly = false;
|
|
218
|
+
/**
|
|
219
|
+
* How far apart the selectable dates are, in days.
|
|
220
|
+
*
|
|
221
|
+
* `<input type="date" step>`'s own unit, handed to the calendar this renders
|
|
222
|
+
* so the field and the grid agree about which dates exist. Counted from `min`
|
|
223
|
+
* where there is one and from 1 January 1970 where there is not, which is the
|
|
224
|
+
* platform's base.
|
|
225
|
+
*/
|
|
226
|
+
this.step = 1;
|
|
218
227
|
/**
|
|
219
228
|
* The overlay, placed against the field rather than the trigger.
|
|
220
229
|
*
|
|
@@ -229,15 +238,10 @@ let HelixHeadlessDateInput = class HelixHeadlessDateInput extends MixinControlle
|
|
|
229
238
|
*
|
|
230
239
|
* A control is not always one element: the button that opens this panel is
|
|
231
240
|
* part of it, and a press on it is not a press outside. Scoped to the
|
|
232
|
-
* surface alone, `pointerdown` on the trigger
|
|
233
|
-
* trigger's own `toggleOpen`
|
|
234
|
-
*
|
|
235
|
-
*
|
|
236
|
-
* already named their invoker; this one and its three siblings did not, and
|
|
237
|
-
* all four stayed open on a second press where Menu closed.
|
|
238
|
-
*
|
|
239
|
-
* `DismissController` documents this exact failure and takes a list for it.
|
|
240
|
-
* The list was the fix; using it was the part that did not happen here. */
|
|
241
|
+
* surface alone, `pointerdown` on the trigger closes the panel and the
|
|
242
|
+
* trigger's own `toggleOpen` reopens it on the `click` that follows, so the
|
|
243
|
+
* panel can never be closed by the button that opened it.
|
|
244
|
+
* `DismissController` documents this failure and takes a list for it. */
|
|
241
245
|
boundary: () => [
|
|
242
246
|
this.renderRoot?.querySelector('[part="surface"]'),
|
|
243
247
|
this.renderRoot?.querySelector('[part="trigger"]'),
|
|
@@ -336,40 +340,9 @@ let HelixHeadlessDateInput = class HelixHeadlessDateInput extends MixinControlle
|
|
|
336
340
|
}
|
|
337
341
|
};
|
|
338
342
|
/**
|
|
339
|
-
*
|
|
340
|
-
*
|
|
341
|
-
* **Enforced by refusing every request in one place**, which is the seam this
|
|
342
|
-
* component already has: `requestValue` is what every path here comes through,
|
|
343
|
-
* and gating it once is what stops the next call site from being written
|
|
344
|
-
* without the check.
|
|
345
|
-
*
|
|
346
|
-
* Not `disabled`, which is the confusion worth naming: a disabled control
|
|
347
|
-
* submits nothing and leaves the tab order, and a read-only one submits its
|
|
348
|
-
* value and stays reachable, which is what a form showing a value somebody
|
|
349
|
-
* else set needs.
|
|
350
|
-
*/
|
|
351
|
-
this.readOnly = false;
|
|
352
|
-
/*
|
|
353
|
-
* Focusing the field opens the calendar.
|
|
354
|
-
*
|
|
355
|
-
* A reader who reaches this control is choosing a date, and making them find
|
|
356
|
-
* the trigger afterwards is a second action for something they have already
|
|
357
|
-
* asked for. Typing still works with it up, because the calendar follows the
|
|
358
|
-
* field rather than the other way round.
|
|
359
|
-
*
|
|
360
|
-
* **Only where focus arrived from outside this element**, which is the whole
|
|
361
|
-
* of the difficulty. Picking a date shuts the panel and puts the caret back in
|
|
362
|
-
* the field, and the first version of this reopened it on the way: the reader
|
|
363
|
-
* chose a date and the calendar came straight back, which the existing spec
|
|
364
|
-
* caught. `relatedTarget` is where focus came from, so a hand-off from the
|
|
365
|
-
* calendar or the trigger is left alone and only a genuine arrival opens
|
|
366
|
-
* anything.
|
|
367
|
-
*
|
|
368
|
-
* On the input rather than on the field, too. Focus does not bubble, so a
|
|
369
|
-
* listener here covers the text and not the trigger, which is what keeps
|
|
370
|
-
* pressing the trigger from opening the panel on focus and then shutting it
|
|
371
|
-
* again on the click.
|
|
343
|
+
* Accessible name for the control that opens the calendar.
|
|
372
344
|
*/
|
|
345
|
+
this.triggerLabel = 'Choose a date';
|
|
373
346
|
/**
|
|
374
347
|
* Puts the caret back in the field without the field reopening the calendar.
|
|
375
348
|
*
|
|
@@ -386,9 +359,8 @@ let HelixHeadlessDateInput = class HelixHeadlessDateInput extends MixinControlle
|
|
|
386
359
|
* outside this element and reads as an arrival. Every step is ordinary browser
|
|
387
360
|
* behavior and none of it can be exercised here: `focus()` dispatches no
|
|
388
361
|
* event in an unfocused document, which is what both the test runtime and the
|
|
389
|
-
* available browser pane are. A spec
|
|
390
|
-
*
|
|
391
|
-
* left to look like proof.
|
|
362
|
+
* available browser pane are. A spec for this passes with the guard removed,
|
|
363
|
+
* so there is no spec: it would cover nothing while looking like proof.
|
|
392
364
|
*
|
|
393
365
|
* A flag rather than a better guess, because this element is the one moving
|
|
394
366
|
* the focus and is the only thing that can know so. Cleared synchronously,
|
|
@@ -398,13 +370,33 @@ let HelixHeadlessDateInput = class HelixHeadlessDateInput extends MixinControlle
|
|
|
398
370
|
this.handleBlur = () => {
|
|
399
371
|
this.editing = false;
|
|
400
372
|
};
|
|
373
|
+
/*
|
|
374
|
+
* Focusing the field opens the calendar.
|
|
375
|
+
*
|
|
376
|
+
* A reader who reaches this control is choosing a date, and making them find
|
|
377
|
+
* the trigger afterwards is a second action for something they have already
|
|
378
|
+
* asked for. Typing still works with it up, because the calendar follows the
|
|
379
|
+
* field rather than the other way round.
|
|
380
|
+
*
|
|
381
|
+
* **Only where focus arrived from outside this element**, which is the whole
|
|
382
|
+
* of the difficulty: picking a date shuts the panel and puts the caret back in
|
|
383
|
+
* the field, so an unguarded version reopens the calendar the reader just
|
|
384
|
+
* answered. `relatedTarget` is where focus came from, so a hand-off from the
|
|
385
|
+
* calendar or the trigger is left alone and only a genuine arrival opens
|
|
386
|
+
* anything.
|
|
387
|
+
*
|
|
388
|
+
* On the input rather than on the field, too. Focus does not bubble, so a
|
|
389
|
+
* listener here covers the text and not the trigger, which is what keeps
|
|
390
|
+
* pressing the trigger from opening the panel on focus and then shutting it
|
|
391
|
+
* again on the click.
|
|
392
|
+
*/
|
|
401
393
|
this.handleFocus = (event) => {
|
|
402
|
-
/* Not while the caret is being handed back. Picking a date returns focus
|
|
403
|
-
|
|
404
|
-
takes for typing: a reader
|
|
405
|
-
|
|
406
|
-
except the one moment this element moved the focus itself, and
|
|
407
|
-
knows when that is. */
|
|
394
|
+
/* Not while the caret is being handed back. Picking a date returns focus to
|
|
395
|
+
the field, and treating that as editing puts the field into the shape it
|
|
396
|
+
takes for typing: a reader picks 4 August 2026 from the calendar and the
|
|
397
|
+
field answers `2026-08-04`. Focus is a good enough signal for editing
|
|
398
|
+
everywhere except the one moment this element moved the focus itself, and
|
|
399
|
+
it already knows when that is. */
|
|
408
400
|
this.editing = !this.returning;
|
|
409
401
|
const from = event.relatedTarget;
|
|
410
402
|
if (this.open || this.isDisabled || this.returning) {
|
|
@@ -434,18 +426,6 @@ let HelixHeadlessDateInput = class HelixHeadlessDateInput extends MixinControlle
|
|
|
434
426
|
const held = dates(this.value);
|
|
435
427
|
return held.length > 0 && held.every(isIso) ? held.join(',') : '';
|
|
436
428
|
}
|
|
437
|
-
/*
|
|
438
|
-
* What the field shows, which is the value in every mode but one.
|
|
439
|
-
*
|
|
440
|
-
* A range reads `2026-08-04 – 2026-08-11`, because two dates separated by a
|
|
441
|
-
* comma is a list and a range is a span: the comma says "and these", the dash
|
|
442
|
-
* says "through". It is the one place this component shows something other
|
|
443
|
-
* than the value it holds, and it is safe because the dash reads back: `dates`
|
|
444
|
-
* takes a spaced dash as a separator, so what is shown is what can be typed.
|
|
445
|
-
*
|
|
446
|
-
* `multiple` shows nothing here at all. Its dates are tags beside the input
|
|
447
|
-
* and the input is a draft, which is the next thing down.
|
|
448
|
-
*/
|
|
449
429
|
/** One date, written the way `dateStyle` asks for. */
|
|
450
430
|
written(date) {
|
|
451
431
|
if (this.dateStyle === 'iso' || !isIso(date)) {
|
|
@@ -462,6 +442,18 @@ let HelixHeadlessDateInput = class HelixHeadlessDateInput extends MixinControlle
|
|
|
462
442
|
timeZone: 'UTC',
|
|
463
443
|
}).format(at);
|
|
464
444
|
}
|
|
445
|
+
/*
|
|
446
|
+
* What the field shows, which is the value in every mode but one.
|
|
447
|
+
*
|
|
448
|
+
* A range reads `2026-08-04 – 2026-08-11`, because two dates separated by a
|
|
449
|
+
* comma is a list and a range is a span: the comma says "and these", the dash
|
|
450
|
+
* says "through". It is the one place this component shows something other
|
|
451
|
+
* than the value it holds, and it is safe because the dash reads back: `dates`
|
|
452
|
+
* takes a spaced dash as a separator, so what is shown is what can be typed.
|
|
453
|
+
*
|
|
454
|
+
* `multiple` shows nothing here at all. Its dates are tags beside the input
|
|
455
|
+
* and the input is a draft.
|
|
456
|
+
*/
|
|
465
457
|
get display() {
|
|
466
458
|
if (this.mode === 'multiple') {
|
|
467
459
|
return this.draft;
|
|
@@ -556,7 +548,7 @@ let HelixHeadlessDateInput = class HelixHeadlessDateInput extends MixinControlle
|
|
|
556
548
|
updated(changed) {
|
|
557
549
|
super.updated(changed);
|
|
558
550
|
// Every update, not only the ones that name `value`: see the note on
|
|
559
|
-
// `ColorInput.updated
|
|
551
|
+
// `ColorInput.updated`.
|
|
560
552
|
this.sync();
|
|
561
553
|
/* Driven from here rather than from the toggle, because `open` is a property
|
|
562
554
|
a consumer may set directly and the panel has to follow either way. The
|
|
@@ -588,12 +580,11 @@ let HelixHeadlessDateInput = class HelixHeadlessDateInput extends MixinControlle
|
|
|
588
580
|
/**
|
|
589
581
|
* The calendar the field opens, behind a seam the styled tier can move.
|
|
590
582
|
*
|
|
591
|
-
* A method rather than a fragment inline, so a tier above can
|
|
592
|
-
*
|
|
593
|
-
* out, without reimplementing the whole template to do any of them. The tag is
|
|
583
|
+
* A method rather than a fragment inline, so a tier above can replace, wrap
|
|
584
|
+
* or omit it without reimplementing the whole template. The tag is
|
|
594
585
|
* interpolated rather than written, so `tier` resolves it: this renders the
|
|
595
|
-
* headless element, and a styled subclass that sets `tier` renders the styled
|
|
596
|
-
* from the same template.
|
|
586
|
+
* headless element, and a styled subclass that sets `tier` renders the styled
|
|
587
|
+
* one from the same template.
|
|
597
588
|
*/
|
|
598
589
|
renderPicker() {
|
|
599
590
|
return html `<${this.tag('date-picker')}
|
|
@@ -621,12 +612,11 @@ let HelixHeadlessDateInput = class HelixHeadlessDateInput extends MixinControlle
|
|
|
621
612
|
/**
|
|
622
613
|
* One chosen date, as a tag, behind a seam the styled tier can move.
|
|
623
614
|
*
|
|
624
|
-
* A method rather than a fragment inline, so a tier above can
|
|
625
|
-
*
|
|
626
|
-
* out, without reimplementing the whole template to do any of them. The tag is
|
|
615
|
+
* A method rather than a fragment inline, so a tier above can replace, wrap
|
|
616
|
+
* or omit it without reimplementing the whole template. The tag is
|
|
627
617
|
* interpolated rather than written, so `tier` resolves it: this renders the
|
|
628
|
-
* headless element, and a styled subclass that sets `tier` renders the styled
|
|
629
|
-
* from the same template.
|
|
618
|
+
* headless element, and a styled subclass that sets `tier` renders the styled
|
|
619
|
+
* one from the same template.
|
|
630
620
|
*/
|
|
631
621
|
renderTag(date) {
|
|
632
622
|
return html `<${this.tag('tag')}
|
|
@@ -648,15 +638,14 @@ let HelixHeadlessDateInput = class HelixHeadlessDateInput extends MixinControlle
|
|
|
648
638
|
* Slot fallback, so a consumer replaces it by slotting; and a method, so the
|
|
649
639
|
* tier above replaces it by overriding.
|
|
650
640
|
*
|
|
651
|
-
* **A named import rather than `<helix-icon
|
|
652
|
-
* element looked like the tidier of the two and loses on three counts.
|
|
641
|
+
* **A named import rather than `<helix-icon>`**, which loses on three counts.
|
|
653
642
|
* `helix-icon` indexes the whole icon map at runtime, `icons[this.name]`, and
|
|
654
643
|
* no bundler can shake a runtime lookup, so every consumer of any component
|
|
655
644
|
* that renders one ships all 50kB of path data; a named import ships one
|
|
656
645
|
* path. The import is checked when the package compiles, where a `name`
|
|
657
|
-
* string is checked only
|
|
646
|
+
* string is checked only by a later name lookup. And `helix-icon` is not
|
|
658
647
|
* registered on the headless tier at all, which registers `helix-headless-icon`,
|
|
659
|
-
* so a headless consumer
|
|
648
|
+
* so a headless consumer gets an inert unknown element and no mark whatsoever.
|
|
660
649
|
*/
|
|
661
650
|
renderTrigger() {
|
|
662
651
|
return html `<slot name="trigger"><svg aria-hidden="true" fill="currentColor" part="trigger-icon" viewBox=${calendarBlank.viewBox}>
|
|
@@ -738,23 +727,8 @@ __decorate([
|
|
|
738
727
|
property()
|
|
739
728
|
], HelixHeadlessDateInput.prototype, "autocomplete", void 0);
|
|
740
729
|
__decorate([
|
|
741
|
-
property({
|
|
742
|
-
], HelixHeadlessDateInput.prototype, "
|
|
743
|
-
__decorate([
|
|
744
|
-
property({ type: Number })
|
|
745
|
-
], HelixHeadlessDateInput.prototype, "months", void 0);
|
|
746
|
-
__decorate([
|
|
747
|
-
property({ attribute: 'max-tags', type: Number })
|
|
748
|
-
], HelixHeadlessDateInput.prototype, "maxTags", void 0);
|
|
749
|
-
__decorate([
|
|
750
|
-
property()
|
|
751
|
-
], HelixHeadlessDateInput.prototype, "min", void 0);
|
|
752
|
-
__decorate([
|
|
753
|
-
property({ type: Number })
|
|
754
|
-
], HelixHeadlessDateInput.prototype, "step", void 0);
|
|
755
|
-
__decorate([
|
|
756
|
-
property()
|
|
757
|
-
], HelixHeadlessDateInput.prototype, "max", void 0);
|
|
730
|
+
property({ attribute: 'date-style' })
|
|
731
|
+
], HelixHeadlessDateInput.prototype, "dateStyle", void 0);
|
|
758
732
|
__decorate([
|
|
759
733
|
property({ attribute: 'disable-dates' })
|
|
760
734
|
], HelixHeadlessDateInput.prototype, "disableDates", void 0);
|
|
@@ -764,18 +738,33 @@ __decorate([
|
|
|
764
738
|
__decorate([
|
|
765
739
|
property({ attribute: 'first-day-of-week', type: Number })
|
|
766
740
|
], HelixHeadlessDateInput.prototype, "firstDayOfWeek", void 0);
|
|
767
|
-
__decorate([
|
|
768
|
-
property({ attribute: 'date-style' })
|
|
769
|
-
], HelixHeadlessDateInput.prototype, "dateStyle", void 0);
|
|
770
741
|
__decorate([
|
|
771
742
|
property()
|
|
772
743
|
], HelixHeadlessDateInput.prototype, "locale", void 0);
|
|
744
|
+
__decorate([
|
|
745
|
+
property()
|
|
746
|
+
], HelixHeadlessDateInput.prototype, "max", void 0);
|
|
747
|
+
__decorate([
|
|
748
|
+
property({ attribute: 'max-tags', type: Number })
|
|
749
|
+
], HelixHeadlessDateInput.prototype, "maxTags", void 0);
|
|
750
|
+
__decorate([
|
|
751
|
+
property()
|
|
752
|
+
], HelixHeadlessDateInput.prototype, "min", void 0);
|
|
753
|
+
__decorate([
|
|
754
|
+
property({ reflect: true })
|
|
755
|
+
], HelixHeadlessDateInput.prototype, "mode", void 0);
|
|
756
|
+
__decorate([
|
|
757
|
+
property({ type: Number })
|
|
758
|
+
], HelixHeadlessDateInput.prototype, "months", void 0);
|
|
773
759
|
__decorate([
|
|
774
760
|
property()
|
|
775
761
|
], HelixHeadlessDateInput.prototype, "placeholder", void 0);
|
|
776
762
|
__decorate([
|
|
777
|
-
property({ attribute: '
|
|
778
|
-
], HelixHeadlessDateInput.prototype, "
|
|
763
|
+
property({ attribute: 'readonly', reflect: true, type: Boolean })
|
|
764
|
+
], HelixHeadlessDateInput.prototype, "readOnly", void 0);
|
|
765
|
+
__decorate([
|
|
766
|
+
property({ type: Number })
|
|
767
|
+
], HelixHeadlessDateInput.prototype, "step", void 0);
|
|
779
768
|
__decorate([
|
|
780
769
|
state()
|
|
781
770
|
], HelixHeadlessDateInput.prototype, "editing", void 0);
|
|
@@ -783,8 +772,8 @@ __decorate([
|
|
|
783
772
|
state()
|
|
784
773
|
], HelixHeadlessDateInput.prototype, "draft", void 0);
|
|
785
774
|
__decorate([
|
|
786
|
-
property({ attribute: '
|
|
787
|
-
], HelixHeadlessDateInput.prototype, "
|
|
775
|
+
property({ attribute: 'trigger-label' })
|
|
776
|
+
], HelixHeadlessDateInput.prototype, "triggerLabel", void 0);
|
|
788
777
|
HelixHeadlessDateInput = __decorate([
|
|
789
778
|
customElement('helix-headless-date-input')
|
|
790
779
|
], HelixHeadlessDateInput);
|