@fusion.dev/helix-headless 0.0.0-dev → 0.0.2
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
|
@@ -44,11 +44,9 @@ const toIso = (date) => date.toISOString().slice(0, 10);
|
|
|
44
44
|
*
|
|
45
45
|
* **`toISOString` converts to UTC first, which makes "today" a different day
|
|
46
46
|
* for most of the planet.** Anywhere west of UTC, from late afternoon onward,
|
|
47
|
-
* `toIso(new Date())` names tomorrow
|
|
48
|
-
*
|
|
49
|
-
*
|
|
50
|
-
* which is the only way to get a calendar date out of a `Date` without a
|
|
51
|
-
* conversion happening on the way.
|
|
47
|
+
* `toIso(new Date())` names tomorrow. The parts are read locally instead and
|
|
48
|
+
* pasted together, which is the only way to get a calendar date out of a `Date`
|
|
49
|
+
* without a conversion happening on the way.
|
|
52
50
|
*/
|
|
53
51
|
const localToday = () => {
|
|
54
52
|
const now = new Date();
|
|
@@ -101,8 +99,7 @@ const addMonths = (date, months) => {
|
|
|
101
99
|
* Left unset, month and day names come from the runtime's own locale, and a
|
|
102
100
|
* server and a browser need not agree on what that is.
|
|
103
101
|
*
|
|
104
|
-
* `helix-before-change
|
|
105
|
-
* form control. A control whose value changes dispatches `helix-before-change` here:
|
|
102
|
+
* A control whose value changes dispatches `helix-before-change`:
|
|
106
103
|
* `Input`, `Select`, `Listbox`, `Radio.Group` and `Toggle.Group` all do, and a
|
|
107
104
|
* calendar submitting a date is the same kind of thing. `helix-select` stays
|
|
108
105
|
* what it is elsewhere, which is a row or an item being chosen in something
|
|
@@ -150,15 +147,9 @@ let HelixHeadlessDatePicker = class HelixHeadlessDatePicker extends MixinControl
|
|
|
150
147
|
constructor() {
|
|
151
148
|
super(...arguments);
|
|
152
149
|
/**
|
|
153
|
-
*
|
|
154
|
-
*/
|
|
155
|
-
this.months = 1;
|
|
156
|
-
/**
|
|
157
|
-
* Locale for month and day names.
|
|
158
|
-
*
|
|
159
|
-
* Absent uses the runtime's own.
|
|
150
|
+
* Month to open on, where nothing declared one.
|
|
160
151
|
*/
|
|
161
|
-
this.
|
|
152
|
+
this.defaultMonth = '';
|
|
162
153
|
/**
|
|
163
154
|
* Dates that cannot be chosen, comma separated, as `YYYY-MM-DD`.
|
|
164
155
|
*/
|
|
@@ -167,60 +158,65 @@ let HelixHeadlessDatePicker = class HelixHeadlessDatePicker extends MixinControl
|
|
|
167
158
|
* Days of the week that cannot be chosen, comma separated, `0` to `6`.
|
|
168
159
|
*/
|
|
169
160
|
this.disableDays = '';
|
|
161
|
+
/**
|
|
162
|
+
* First column of the week, `0` for Sunday through `6` for Saturday.
|
|
163
|
+
*/
|
|
164
|
+
this.firstDayOfWeek = 0;
|
|
170
165
|
/**
|
|
171
166
|
* Whether the current selection fails validation.
|
|
172
167
|
*/
|
|
173
168
|
this.invalid = false;
|
|
174
169
|
/**
|
|
175
|
-
* Accessible name for the
|
|
176
|
-
*
|
|
177
|
-
* A property because this is the one component in the library that takes a
|
|
178
|
-
* `locale`, and it carried two hardcoded English names with no way to change
|
|
179
|
-
* them: a calendar rendering its own month names in Japanese still announced
|
|
180
|
-
* its controls in English. `attribute:` spelled out, since Lit lowercases a
|
|
181
|
-
* camelCase name rather than dash-casing it.
|
|
170
|
+
* Accessible name for the grid.
|
|
182
171
|
*/
|
|
183
|
-
this.
|
|
172
|
+
this.label = 'Date Picker';
|
|
184
173
|
/**
|
|
185
|
-
*
|
|
174
|
+
* Locale for month and day names.
|
|
175
|
+
*
|
|
176
|
+
* Absent uses the runtime's own.
|
|
186
177
|
*/
|
|
187
|
-
this.
|
|
178
|
+
this.locale = '';
|
|
188
179
|
/**
|
|
189
|
-
*
|
|
180
|
+
* Latest selectable date, as `YYYY-MM-DD`.
|
|
190
181
|
*/
|
|
191
|
-
this.
|
|
192
|
-
/** The month on show, whoever set it, and `undefined` until somebody has. */
|
|
193
|
-
this.monthState = undefined;
|
|
182
|
+
this.max = '';
|
|
194
183
|
/**
|
|
195
184
|
* Earliest selectable date, as `YYYY-MM-DD`.
|
|
196
185
|
*/
|
|
197
186
|
this.min = '';
|
|
187
|
+
/** The month on show, whoever set it, and `undefined` until somebody has. */
|
|
188
|
+
this.monthState = undefined;
|
|
198
189
|
/**
|
|
199
|
-
* How
|
|
200
|
-
*
|
|
201
|
-
* `<input type="date" step>`'s own unit, counted from `min` where there is
|
|
202
|
-
* one and from 1 January 1970 where there is not, which is the platform's own
|
|
203
|
-
* base. A booking calendar that only takes Mondays is `step="7"` with a `min`
|
|
204
|
-
* on a Monday, and there was no way to say that: `disable-dates` takes a list
|
|
205
|
-
* and a year of Mondays is not a list anybody writes.
|
|
206
|
-
*
|
|
207
|
-
* One is every date and needs no rule, which is why anything below one is
|
|
208
|
-
* treated as one rather than as an error: a step of zero would block every
|
|
209
|
-
* date including the one already chosen.
|
|
190
|
+
* How many months to show, side by side.
|
|
210
191
|
*/
|
|
211
|
-
this.
|
|
192
|
+
this.months = 1;
|
|
212
193
|
/**
|
|
213
|
-
*
|
|
194
|
+
* Accessible name for the control that pages forward.
|
|
214
195
|
*/
|
|
215
|
-
this.
|
|
196
|
+
this.nextLabel = 'Next month';
|
|
216
197
|
/**
|
|
217
|
-
* Accessible name for the
|
|
198
|
+
* Accessible name for the control that pages back.
|
|
199
|
+
*
|
|
200
|
+
* A property because a calendar rendering its own month names from `locale`
|
|
201
|
+
* would otherwise still announce its controls in English. `attribute:`
|
|
202
|
+
* spelled out, since Lit lowercases a camelCase name rather than dash-casing
|
|
203
|
+
* it.
|
|
218
204
|
*/
|
|
219
|
-
this.
|
|
205
|
+
this.previousLabel = 'Previous month';
|
|
220
206
|
/**
|
|
221
|
-
*
|
|
207
|
+
* Whether the control refuses changes while still submitting its value.
|
|
208
|
+
*
|
|
209
|
+
* **Enforced by refusing every request in one place**, which is the seam this
|
|
210
|
+
* component already has: `requestValue` is what every path here comes through,
|
|
211
|
+
* and gating it once is what stops the next call site from being written
|
|
212
|
+
* without the check.
|
|
213
|
+
*
|
|
214
|
+
* Not `disabled`, which is the confusion worth naming: a disabled control
|
|
215
|
+
* submits nothing and leaves the tab order, and a read-only one submits its
|
|
216
|
+
* value and stays reachable, which is what a form showing a value somebody
|
|
217
|
+
* else set needs.
|
|
222
218
|
*/
|
|
223
|
-
this.
|
|
219
|
+
this.readOnly = false;
|
|
224
220
|
/**
|
|
225
221
|
* The date the grid's tab stop is on.
|
|
226
222
|
*
|
|
@@ -233,11 +229,10 @@ let HelixHeadlessDatePicker = class HelixHeadlessDatePicker extends MixinControl
|
|
|
233
229
|
}
|
|
234
230
|
/* Grid keys, from the grid.
|
|
235
231
|
*
|
|
236
|
-
* The listener is on the host
|
|
237
|
-
*
|
|
238
|
-
* "choose the focused day" and then `preventDefault()`ed: the
|
|
239
|
-
* activation
|
|
240
|
-
* from them too. */
|
|
232
|
+
* The listener is on the host, which holds the previous and next buttons as
|
|
233
|
+
* well, so without this check Enter and Space pressed on one of those read
|
|
234
|
+
* as "choose the focused day" and are then `preventDefault()`ed: the
|
|
235
|
+
* button's own activation is canceled and the month never moves. */
|
|
241
236
|
const path = event.composedPath();
|
|
242
237
|
const grid = this.renderRoot?.querySelector('[part="grid"]');
|
|
243
238
|
if (!grid || !path.includes(grid)) {
|
|
@@ -272,44 +267,39 @@ let HelixHeadlessDatePicker = class HelixHeadlessDatePicker extends MixinControl
|
|
|
272
267
|
}
|
|
273
268
|
event.preventDefault();
|
|
274
269
|
};
|
|
275
|
-
/**
|
|
276
|
-
* Whether the control refuses changes while still submitting its value.
|
|
277
|
-
*
|
|
278
|
-
* **Enforced by refusing every request in one place**, which is the seam this
|
|
279
|
-
* component already has: `requestValue` is what every path here comes through,
|
|
280
|
-
* and gating it once is what stops the next call site from being written
|
|
281
|
-
* without the check.
|
|
282
|
-
*
|
|
283
|
-
* Not `disabled`, which is the confusion worth naming: a disabled control
|
|
284
|
-
* submits nothing and leaves the tab order, and a read-only one submits its
|
|
285
|
-
* value and stays reachable, which is what a form showing a value somebody
|
|
286
|
-
* else set needs.
|
|
287
|
-
*/
|
|
288
|
-
this.readOnly = false;
|
|
289
270
|
/**
|
|
290
271
|
* Whether the form refuses to submit while nothing is chosen.
|
|
291
272
|
*/
|
|
292
273
|
this.required = false;
|
|
274
|
+
/**
|
|
275
|
+
* How far apart the selectable dates are, in days.
|
|
276
|
+
*
|
|
277
|
+
* `<input type="date" step>`'s own unit, counted from `min` where there is
|
|
278
|
+
* one and from 1 January 1970 where there is not, which is the platform's own
|
|
279
|
+
* base. A booking calendar that only takes Mondays is `step="7"` with a `min`
|
|
280
|
+
* on a Monday, which `disable-dates` cannot express: it takes a list, and a
|
|
281
|
+
* year of Mondays is not a list anybody writes.
|
|
282
|
+
*
|
|
283
|
+
* One is every date and needs no rule, which is why anything below one is
|
|
284
|
+
* treated as one rather than as an error: a step of zero would block every
|
|
285
|
+
* date including the one already chosen.
|
|
286
|
+
*/
|
|
287
|
+
this.step = 1;
|
|
293
288
|
}
|
|
294
289
|
/**
|
|
295
290
|
* The month on show, as `YYYY-MM`. Follows `value`, then the current month.
|
|
296
291
|
*
|
|
297
292
|
* Separate from `value` on purpose, so paging selects nothing and a consumer
|
|
298
|
-
* can drive the view.
|
|
299
|
-
*
|
|
300
|
-
* never told. Reading gives the month on show; writing declares it theirs,
|
|
301
|
-
* and `default-month` seeds one the calendar owns.
|
|
302
|
-
*
|
|
303
|
-
*
|
|
293
|
+
* can drive the view. Reading gives the month on show; writing sets it, and
|
|
294
|
+
* `default-month` seeds one the calendar keeps until somebody does.
|
|
304
295
|
*/
|
|
305
296
|
get month() {
|
|
306
297
|
/* What is on show, which is what the tag says it gives.
|
|
307
298
|
*
|
|
308
|
-
*
|
|
309
|
-
*
|
|
310
|
-
*
|
|
311
|
-
*
|
|
312
|
-
* showed the month the reader had last paged to instead. */
|
|
299
|
+
* `show()` compares the requested month against this before moving, so a
|
|
300
|
+
* getter returning `''` while a month is on display leaves that guard dead:
|
|
301
|
+
* the first arrow key writes `monthState` and from then on the grid stops
|
|
302
|
+
* following `value`. */
|
|
313
303
|
return this.monthState ?? (this.defaultMonth || toIso(this.derivedMonth).slice(0, 7));
|
|
314
304
|
}
|
|
315
305
|
set month(next) {
|
|
@@ -350,7 +340,7 @@ let HelixHeadlessDatePicker = class HelixHeadlessDatePicker extends MixinControl
|
|
|
350
340
|
*
|
|
351
341
|
* Split out from `shown` so `month` can report what is on display without the
|
|
352
342
|
* two calling each other: `month` reading `shown` and `shown` reading `month`
|
|
353
|
-
* is a stack overflow
|
|
343
|
+
* is a stack overflow.
|
|
354
344
|
*/
|
|
355
345
|
get derivedMonth() {
|
|
356
346
|
const from = toUtc(this.selected[0] ?? '') ?? new Date();
|
|
@@ -387,11 +377,10 @@ let HelixHeadlessDatePicker = class HelixHeadlessDatePicker extends MixinControl
|
|
|
387
377
|
/**
|
|
388
378
|
* Whether a date is barred, by bound, by weekday, or by name.
|
|
389
379
|
*
|
|
390
|
-
* `barred`, not `disabled`:
|
|
391
|
-
*
|
|
392
|
-
*
|
|
393
|
-
*
|
|
394
|
-
* the library.
|
|
380
|
+
* `barred`, not `disabled`: `HelixFormElement.disabled` is a boolean about the
|
|
381
|
+
* whole control, and a method and a flag cannot share a name. "Disabled" on a
|
|
382
|
+
* control means one thing everywhere else in the library, so the method is the
|
|
383
|
+
* one that moves.
|
|
395
384
|
*/
|
|
396
385
|
barred(date) {
|
|
397
386
|
const iso = toIso(date);
|
|
@@ -422,8 +411,8 @@ let HelixHeadlessDatePicker = class HelixHeadlessDatePicker extends MixinControl
|
|
|
422
411
|
*
|
|
423
412
|
* `helix-navigate` and not `helix-change`: paging chooses nothing, and a
|
|
424
413
|
* consumer driving the view has to hear that it moved without being told the
|
|
425
|
-
* answer did.
|
|
426
|
-
*
|
|
414
|
+
* answer did. Refusing the event is how they take the decision, and nothing
|
|
415
|
+
* moves.
|
|
427
416
|
*/
|
|
428
417
|
show(date) {
|
|
429
418
|
if (this.disabled) {
|
|
@@ -459,10 +448,8 @@ let HelixHeadlessDatePicker = class HelixHeadlessDatePicker extends MixinControl
|
|
|
459
448
|
* clicking a chosen date takes it out.
|
|
460
449
|
*/
|
|
461
450
|
select(date) {
|
|
462
|
-
/*
|
|
463
|
-
|
|
464
|
-
nothing said the control was off. Refused at the source rather than at
|
|
465
|
-
each cell, so every path in is covered by one check. */
|
|
451
|
+
/* Refused at the source rather than at each cell, so every path in is
|
|
452
|
+
covered by one check. */
|
|
466
453
|
if (this.disabled) {
|
|
467
454
|
return;
|
|
468
455
|
}
|
|
@@ -485,11 +472,9 @@ let HelixHeadlessDatePicker = class HelixHeadlessDatePicker extends MixinControl
|
|
|
485
472
|
roving tab stop is about where they are rather than about what is
|
|
486
473
|
chosen. The selection is the part that can be refused. */
|
|
487
474
|
this.focused = iso;
|
|
488
|
-
/* Announced before it is written,
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
audited path its own documentation claims for every stateful change in
|
|
492
|
-
the system, and this was not on it. */
|
|
475
|
+
/* Announced before it is written, so a listener calling `preventDefault()`
|
|
476
|
+
refuses a date that has not been chosen yet. `requestChange` is the one
|
|
477
|
+
path every stateful change in the library goes through. */
|
|
493
478
|
this.requestValue(next.join(','));
|
|
494
479
|
}
|
|
495
480
|
connectedCallback() {
|
|
@@ -523,12 +508,9 @@ let HelixHeadlessDatePicker = class HelixHeadlessDatePicker extends MixinControl
|
|
|
523
508
|
this.internals.setValidity({ valueMissing: true }, 'Choose a date.', anchor);
|
|
524
509
|
return;
|
|
525
510
|
}
|
|
526
|
-
/* **A value the calendar cannot read is bad input
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
to the form: measured, a form carrying `dp=not-a-date` that submitted
|
|
530
|
-
without complaint. `DateInput` had this right all along, because it
|
|
531
|
-
relays the validity of an inner control it can ask.
|
|
511
|
+
/* **A value the calendar cannot read is bad input.** The grid draws only
|
|
512
|
+
what it can parse, so `value="not-a-date"` would otherwise select
|
|
513
|
+
nothing, report `:valid` and hand the string to the form.
|
|
532
514
|
|
|
533
515
|
`asDate` rather than the shape alone, which is the half `DateInput`'s own
|
|
534
516
|
regex still misses: `2026-02-30` matches `YYYY-MM-DD` and is not a day,
|
|
@@ -600,10 +582,10 @@ let HelixHeadlessDatePicker = class HelixHeadlessDatePicker extends MixinControl
|
|
|
600
582
|
/**
|
|
601
583
|
* How many months are shown, clamped once.
|
|
602
584
|
*
|
|
603
|
-
*
|
|
604
|
-
* identified
|
|
605
|
-
* and
|
|
606
|
-
* true for `NaN`.
|
|
585
|
+
* One getter for both readers. Clamping at the call site while the last month
|
|
586
|
+
* is identified from the raw `months` renders nothing for a zero, a negative
|
|
587
|
+
* or a non-numeric value, and takes the forward control with it, since
|
|
588
|
+
* `index === this.months - 1` is never true for `NaN`.
|
|
607
589
|
*/
|
|
608
590
|
get monthCount() {
|
|
609
591
|
return Math.max(1, Math.floor(this.months) || 1);
|
|
@@ -653,10 +635,9 @@ let HelixHeadlessDatePicker = class HelixHeadlessDatePicker extends MixinControl
|
|
|
653
635
|
const { full, heading, weekday } = this.formats;
|
|
654
636
|
const weeks = this.weeksOf(month);
|
|
655
637
|
const anchor = toIso(this.anchor);
|
|
656
|
-
/* Today,
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
than per cell. */
|
|
638
|
+
/* Today, marked with `aria-current="date"` in the accessibility tree and on
|
|
639
|
+
the cell, so a consumer can add a mark from CSS. Computed once per month
|
|
640
|
+
rather than per cell. */
|
|
660
641
|
const today = localToday();
|
|
661
642
|
const range = this.range;
|
|
662
643
|
// One set of controls across the whole run: back on the first month,
|
|
@@ -702,17 +683,13 @@ let HelixHeadlessDatePicker = class HelixHeadlessDatePicker extends MixinControl
|
|
|
702
683
|
const iso = toIso(date);
|
|
703
684
|
const disabled = this.barred(date);
|
|
704
685
|
const selected = this.isSelected(iso);
|
|
705
|
-
/* A day from a
|
|
686
|
+
/* A day from a neighboring month is filler, so the grid is a
|
|
706
687
|
rectangle, and nothing else. It takes no click and shows no
|
|
707
|
-
selection
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
through August's last row and then again through September's
|
|
713
|
-
first. Two cells cannot be the answer to one question. The band
|
|
714
|
-
now stops at the last day the grid owns and picks up in the
|
|
715
|
-
next, which is where those dates actually are. */
|
|
688
|
+
selection: at `months="2"` the same date is a trailing cell in
|
|
689
|
+
one grid and a real cell in the next, so marking both puts one
|
|
690
|
+
answer on the page twice and runs the range band through two
|
|
691
|
+
rows. The band stops at the last day the grid owns and picks up
|
|
692
|
+
in the next, which is where those dates actually are. */
|
|
716
693
|
const outside = !sameMonth(date, month);
|
|
717
694
|
// The cell is the column track and the day is the shape centered
|
|
718
695
|
// in it. A range paints the track, so it runs continuously
|
|
@@ -778,59 +755,59 @@ let HelixHeadlessDatePicker = class HelixHeadlessDatePicker extends MixinControl
|
|
|
778
755
|
}
|
|
779
756
|
};
|
|
780
757
|
__decorate([
|
|
781
|
-
property({
|
|
782
|
-
], HelixHeadlessDatePicker.prototype, "
|
|
783
|
-
__decorate([
|
|
784
|
-
property({ type: Number })
|
|
785
|
-
], HelixHeadlessDatePicker.prototype, "months", void 0);
|
|
786
|
-
__decorate([
|
|
787
|
-
property()
|
|
788
|
-
], HelixHeadlessDatePicker.prototype, "locale", void 0);
|
|
758
|
+
property({ attribute: 'default-month' })
|
|
759
|
+
], HelixHeadlessDatePicker.prototype, "defaultMonth", void 0);
|
|
789
760
|
__decorate([
|
|
790
761
|
property({ attribute: 'disable-dates' })
|
|
791
762
|
], HelixHeadlessDatePicker.prototype, "disableDates", void 0);
|
|
792
763
|
__decorate([
|
|
793
764
|
property({ attribute: 'disable-days' })
|
|
794
765
|
], HelixHeadlessDatePicker.prototype, "disableDays", void 0);
|
|
766
|
+
__decorate([
|
|
767
|
+
property({ attribute: 'first-day-of-week', type: Number })
|
|
768
|
+
], HelixHeadlessDatePicker.prototype, "firstDayOfWeek", void 0);
|
|
795
769
|
__decorate([
|
|
796
770
|
property({ reflect: true, type: Boolean })
|
|
797
771
|
], HelixHeadlessDatePicker.prototype, "invalid", void 0);
|
|
798
772
|
__decorate([
|
|
799
773
|
property()
|
|
800
|
-
], HelixHeadlessDatePicker.prototype, "
|
|
774
|
+
], HelixHeadlessDatePicker.prototype, "label", void 0);
|
|
801
775
|
__decorate([
|
|
802
|
-
property(
|
|
803
|
-
], HelixHeadlessDatePicker.prototype, "
|
|
776
|
+
property()
|
|
777
|
+
], HelixHeadlessDatePicker.prototype, "month", null);
|
|
804
778
|
__decorate([
|
|
805
|
-
property(
|
|
806
|
-
], HelixHeadlessDatePicker.prototype, "
|
|
779
|
+
property()
|
|
780
|
+
], HelixHeadlessDatePicker.prototype, "locale", void 0);
|
|
807
781
|
__decorate([
|
|
808
|
-
property(
|
|
809
|
-
], HelixHeadlessDatePicker.prototype, "
|
|
782
|
+
property()
|
|
783
|
+
], HelixHeadlessDatePicker.prototype, "max", void 0);
|
|
810
784
|
__decorate([
|
|
811
785
|
property()
|
|
812
786
|
], HelixHeadlessDatePicker.prototype, "min", void 0);
|
|
787
|
+
__decorate([
|
|
788
|
+
property({ reflect: true })
|
|
789
|
+
], HelixHeadlessDatePicker.prototype, "mode", void 0);
|
|
813
790
|
__decorate([
|
|
814
791
|
property({ type: Number })
|
|
815
|
-
], HelixHeadlessDatePicker.prototype, "
|
|
792
|
+
], HelixHeadlessDatePicker.prototype, "months", void 0);
|
|
816
793
|
__decorate([
|
|
817
|
-
property()
|
|
818
|
-
], HelixHeadlessDatePicker.prototype, "
|
|
794
|
+
property({ attribute: 'next-label' })
|
|
795
|
+
], HelixHeadlessDatePicker.prototype, "nextLabel", void 0);
|
|
819
796
|
__decorate([
|
|
820
|
-
property()
|
|
821
|
-
], HelixHeadlessDatePicker.prototype, "
|
|
797
|
+
property({ attribute: 'previous-label' })
|
|
798
|
+
], HelixHeadlessDatePicker.prototype, "previousLabel", void 0);
|
|
822
799
|
__decorate([
|
|
823
|
-
property({ attribute: '
|
|
824
|
-
], HelixHeadlessDatePicker.prototype, "
|
|
800
|
+
property({ attribute: 'readonly', reflect: true, type: Boolean })
|
|
801
|
+
], HelixHeadlessDatePicker.prototype, "readOnly", void 0);
|
|
825
802
|
__decorate([
|
|
826
803
|
state()
|
|
827
804
|
], HelixHeadlessDatePicker.prototype, "focused", void 0);
|
|
828
|
-
__decorate([
|
|
829
|
-
property({ attribute: 'readonly', reflect: true, type: Boolean })
|
|
830
|
-
], HelixHeadlessDatePicker.prototype, "readOnly", void 0);
|
|
831
805
|
__decorate([
|
|
832
806
|
property({ reflect: true, type: Boolean })
|
|
833
807
|
], HelixHeadlessDatePicker.prototype, "required", void 0);
|
|
808
|
+
__decorate([
|
|
809
|
+
property({ type: Number })
|
|
810
|
+
], HelixHeadlessDatePicker.prototype, "step", void 0);
|
|
834
811
|
HelixHeadlessDatePicker = __decorate([
|
|
835
812
|
customElement('helix-headless-date-picker')
|
|
836
813
|
], HelixHeadlessDatePicker);
|
|
@@ -58,50 +58,44 @@ declare const HelixHeadlessDialog_base: (new (...args: any[]) => import("@fusion
|
|
|
58
58
|
* @csspart dialog - The native dialog element.
|
|
59
59
|
*/
|
|
60
60
|
export declare class HelixHeadlessDialog extends HelixHeadlessDialog_base {
|
|
61
|
+
/**
|
|
62
|
+
* Which close requests the browser answers on its own.
|
|
63
|
+
*
|
|
64
|
+
* `<dialog closedby>`, forwarded, and safe to forward because every path it
|
|
65
|
+
* opens still comes back through this element: a close request fires `cancel`
|
|
66
|
+
* first, `handleCancel` prevents it, and `requestOpen` decides. So
|
|
67
|
+
* `closedby="any"` gains light dismiss without giving up the refusal, which is
|
|
68
|
+
* the property this component exists to keep.
|
|
69
|
+
*
|
|
70
|
+
* Absent by default, which is the platform's `auto` and this library's rule
|
|
71
|
+
* that a resting value is an attribute's absence.
|
|
72
|
+
*/
|
|
73
|
+
closedBy?: 'any' | 'closerequest' | 'none';
|
|
61
74
|
/**
|
|
62
75
|
* Accessible name for the dialog.
|
|
63
76
|
*/
|
|
64
77
|
label: string;
|
|
78
|
+
protected readonly commands: CommandController;
|
|
65
79
|
/**
|
|
66
|
-
* Whether Escape can close it.
|
|
80
|
+
* Whether Escape or a press on the backdrop can close it.
|
|
67
81
|
*
|
|
68
82
|
* Off for a dialog that must be answered. It does not disable the close
|
|
69
83
|
* control a consumer slots in: refusing to be dismissed is not the same as
|
|
70
84
|
* refusing to be closed, and a dialog with no way out at all is a trap.
|
|
71
85
|
*
|
|
72
|
-
* Escape *and* a press on the backdrop, which it now genuinely means. The
|
|
73
|
-
* sentence said both for a long time while nothing listened for a backdrop
|
|
74
|
-
* press, so it promised a behavior a consumer would have written their
|
|
75
|
-
* markup around; the fix then was to narrow the sentence, and the fix now is
|
|
76
|
-
* to build the half that was missing.
|
|
77
|
-
*
|
|
78
86
|
* A persistent dialog does not ignore that press. It answers it: see
|
|
79
87
|
* `refuse`, which is the only way a dialog that will not be dismissed can say
|
|
80
88
|
* so at the moment a reader asks.
|
|
81
89
|
*/
|
|
82
90
|
persistent: boolean;
|
|
83
|
-
protected readonly commands: CommandController;
|
|
84
|
-
/**
|
|
85
|
-
* Which close requests the browser answers on its own.
|
|
86
|
-
*
|
|
87
|
-
* `<dialog closedby>`, forwarded, and safe to forward because every path it
|
|
88
|
-
* opens still comes back through this element: a close request fires `cancel`
|
|
89
|
-
* first, `handleCancel` prevents it, and `requestOpen` decides. So
|
|
90
|
-
* `closedby="any"` gains light dismiss without giving up the refusal, which is
|
|
91
|
-
* the property this component exists to keep.
|
|
92
|
-
*
|
|
93
|
-
* Absent by default, which is the platform's `auto` and this library's rule
|
|
94
|
-
* that a resting value is an attribute's absence.
|
|
95
|
-
*/
|
|
96
|
-
closedBy?: 'any' | 'closerequest' | 'none';
|
|
97
91
|
/**
|
|
98
92
|
* What the dialog closed with, the way `<dialog>` reports it.
|
|
99
93
|
*
|
|
100
94
|
* **The whole point of a `<dialog>` returning a value is lost behind a shadow
|
|
101
95
|
* boundary**, which is where this one is: the platform's contract is
|
|
102
|
-
* `close(value)` then read `returnValue`, and
|
|
103
|
-
*
|
|
104
|
-
*
|
|
96
|
+
* `close(value)` then read `returnValue`, and `querySelector` does not reach
|
|
97
|
+
* the element to do either. A confirmation asking which button was pressed is
|
|
98
|
+
* the ordinary case.
|
|
105
99
|
*
|
|
106
100
|
* Held here as well as on the element, so a value set before the first render
|
|
107
101
|
* survives to it and a consumer reading one back gets what they wrote.
|
|
@@ -173,8 +167,31 @@ export declare class HelixHeadlessDialog extends HelixHeadlessDialog_base {
|
|
|
173
167
|
* this decides only when it happens. Removed first so a second press
|
|
174
168
|
* restarts it: without that, pressing twice does nothing the second time,
|
|
175
169
|
* which is the impression the whole thing exists to avoid.
|
|
170
|
+
*
|
|
171
|
+
* **`once: true` is not a release when the event cannot arrive.** Under
|
|
172
|
+
* `prefers-reduced-motion: reduce` the styled tier sets `animation: none`, so
|
|
173
|
+
* no animation runs, `animationend` never fires, and every refused press left
|
|
174
|
+
* a listener that could not be removed and an attribute that stayed on. The
|
|
175
|
+
* controller bounds it to one listener, aborted before the next is added.
|
|
176
|
+
*
|
|
177
|
+
* **And the attribute is cleared at once when no animation is running**, asked
|
|
178
|
+
* of the platform rather than of a media query: this tier does not know what
|
|
179
|
+
* refusing looks like, and the same silence arrives from a consumer's
|
|
180
|
+
* stylesheet, from reduced motion, and from no styled tier being loaded at
|
|
181
|
+
* all.
|
|
182
|
+
*
|
|
183
|
+
* **`CSSAnimation` specifically, because `getAnimations` returns transitions
|
|
184
|
+
* too.** A panel that is still running its entrance transition answers the
|
|
185
|
+
* bare `length` check with a truthy number while no animation exists to end,
|
|
186
|
+
* so a refusal landing inside that window took the listener branch and waited
|
|
187
|
+
* for an `animationend` that was never coming: the attribute stayed on until
|
|
188
|
+
* the next refused press. That is the same bug this method exists to close,
|
|
189
|
+
* one window narrower. `getAnimations` flushes pending style itself, so no
|
|
190
|
+
* reflow is forced for it.
|
|
176
191
|
*/
|
|
177
192
|
private refuse;
|
|
193
|
+
/** Bounds the refusal listener to one, whether or not it ever fires. */
|
|
194
|
+
private refusal;
|
|
178
195
|
protected render(): TemplateResult;
|
|
179
196
|
}
|
|
180
197
|
declare global {
|