@fusion.dev/helix-headless 0.148.0 → 0.149.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/custom-elements.json +6966 -1798
- package/dist/announcement/root/announcement-root.d.ts +5 -0
- package/dist/announcement/root/announcement-root.js +5 -2
- package/dist/area-chart/root/area-chart-root.d.ts +11 -0
- package/dist/area-chart/root/area-chart-root.js +20 -7
- package/dist/avatar/group/avatar-group.d.ts +10 -2
- package/dist/avatar/group/avatar-group.js +10 -5
- package/dist/badge/count.d.ts +6 -1
- package/dist/badge/count.js +3 -3
- package/dist/badge/root/badge-root.d.ts +6 -2
- package/dist/badge/root/badge-root.js +3 -3
- package/dist/bar-chart/root/bar-chart-root.d.ts +13 -1
- package/dist/bar-chart/root/bar-chart-root.js +17 -4
- package/dist/breadcrumbs/root/breadcrumbs-root.d.ts +8 -1
- package/dist/breadcrumbs/root/breadcrumbs-root.js +5 -2
- package/dist/button/root/button-root.d.ts +10 -1
- package/dist/button/root/button-root.js +3 -2
- package/dist/button-group/root/button-group-root.d.ts +3 -0
- package/dist/button-group/root/button-group-root.js +2 -2
- package/dist/callout/root/callout-root.d.ts +16 -2
- package/dist/callout/root/callout-root.js +16 -4
- package/dist/canvas/describe.d.ts +10 -0
- package/dist/canvas/describe.js +9 -0
- package/dist/canvas/neighbor.d.ts +17 -0
- package/dist/canvas/neighbor.js +1 -0
- package/dist/canvas/node/canvas-node.js +3 -2
- package/dist/canvas/root/canvas-root.d.ts +65 -8
- package/dist/canvas/root/canvas-root.js +115 -49
- package/dist/carousel/root/carousel-root.d.ts +5 -0
- package/dist/carousel/root/carousel-root.js +16 -5
- package/dist/chat/composer/chat-composer.d.ts +5 -0
- package/dist/chat/composer/chat-composer.js +4 -1
- package/dist/chat/message/chat-message.d.ts +9 -5
- package/dist/chat/message/chat-message.js +8 -4
- package/dist/chat/naming.js +2 -2
- package/dist/chat/root/chat-root.d.ts +27 -1
- package/dist/chat/root/chat-root.js +37 -9
- package/dist/checkbox/root/checkbox-root.d.ts +11 -0
- package/dist/checkbox/root/checkbox-root.js +8 -2
- package/dist/checkbox-group/root/checkbox-group-root.d.ts +11 -0
- package/dist/checkbox-group/root/checkbox-group-root.js +11 -3
- package/dist/code-block/root/code-block-root.d.ts +12 -2
- package/dist/code-block/root/code-block-root.js +12 -2
- package/dist/color-input/root/color-input-root.d.ts +13 -0
- package/dist/color-input/root/color-input-root.js +18 -5
- package/dist/color-picker/root/color-picker-root.d.ts +19 -3
- package/dist/color-picker/root/color-picker-root.js +47 -13
- package/dist/combobox/root/combobox-root.d.ts +36 -7
- package/dist/combobox/root/combobox-root.js +37 -12
- package/dist/command/root/command-root.d.ts +15 -6
- package/dist/command/root/command-root.js +9 -4
- package/dist/copy-button/root/copy-button-root.d.ts +5 -0
- package/dist/copy-button/root/copy-button-root.js +7 -2
- package/dist/data-table/root/data-table-root.d.ts +171 -29
- package/dist/data-table/root/data-table-root.js +268 -118
- package/dist/date-input/root/date-input-root.d.ts +32 -9
- package/dist/date-input/root/date-input-root.js +66 -44
- package/dist/date-picker/root/date-picker-root.d.ts +38 -15
- package/dist/date-picker/root/date-picker-root.js +52 -33
- package/dist/dialog/root/dialog-root.d.ts +12 -1
- package/dist/dialog/root/dialog-root.js +11 -4
- package/dist/donut-chart/root/donut-chart-root.d.ts +5 -0
- package/dist/donut-chart/root/donut-chart-root.js +8 -5
- package/dist/drawer/root/drawer-root.d.ts +12 -1
- package/dist/drawer/root/drawer-root.js +9 -2
- package/dist/drilldown/root/drilldown-root.d.ts +5 -0
- package/dist/drilldown/root/drilldown-root.js +4 -1
- package/dist/element-events.generated.js +25 -3
- package/dist/file-input/root/file-input-root.d.ts +18 -3
- package/dist/file-input/root/file-input-root.js +34 -17
- package/dist/filter-input/chip/filter-chip.d.ts +13 -0
- package/dist/filter-input/chip/filter-chip.js +6 -1
- package/dist/filter-input/menu/filter-menu.d.ts +5 -0
- package/dist/filter-input/menu/filter-menu.js +3 -1
- package/dist/filter-input/root/filter-input-root.d.ts +20 -3
- package/dist/filter-input/root/filter-input-root.js +8 -4
- package/dist/format-date/root/format-date-root.d.ts +20 -2
- package/dist/format-date/root/format-date-root.js +5 -2
- package/dist/graph/root/graph-model.d.ts +11 -0
- package/dist/graph/root/graph-model.js +4 -0
- package/dist/graph/root/graph-root.d.ts +78 -9
- package/dist/graph/root/graph-root.js +124 -27
- package/dist/heatmap/root/heatmap-root.d.ts +25 -4
- package/dist/heatmap/root/heatmap-root.js +27 -7
- package/dist/icon-button/root/icon-button-root.d.ts +5 -0
- package/dist/icon-button/root/icon-button-root.js +1 -0
- package/dist/input/root/input-root.d.ts +5 -0
- package/dist/input/root/input-root.js +4 -1
- package/dist/lightbox/root/lightbox-root.d.ts +14 -4
- package/dist/lightbox/root/lightbox-root.js +25 -7
- package/dist/line-chart/root/line-chart-root.d.ts +5 -0
- package/dist/line-chart/root/line-chart-root.js +4 -2
- package/dist/list/item/list-item.d.ts +32 -0
- package/dist/list/item/list-item.js +34 -7
- package/dist/list/root/list-root.d.ts +87 -0
- package/dist/list/root/list-root.js +112 -2
- package/dist/listbox/reorder/index.d.ts +1 -0
- package/dist/listbox/reorder/index.js +4 -0
- package/dist/listbox/reorder/listbox-reorder.d.ts +83 -0
- package/dist/listbox/reorder/listbox-reorder.js +151 -0
- package/dist/listbox/root/listbox-root.d.ts +68 -11
- package/dist/listbox/root/listbox-root.js +41 -9
- package/dist/loader/root/loader-root.d.ts +5 -0
- package/dist/loader/root/loader-root.js +3 -1
- package/dist/map/area/map-area.d.ts +5 -0
- package/dist/map/area/map-area.js +3 -1
- package/dist/map/buildings/map-buildings.d.ts +5 -0
- package/dist/map/buildings/map-buildings.js +3 -1
- package/dist/map/contours/map-contours.d.ts +5 -0
- package/dist/map/contours/map-contours.js +3 -1
- package/dist/map/landcover/map-landcover.d.ts +5 -0
- package/dist/map/landcover/map-landcover.js +3 -1
- package/dist/map/marker/map-marker.d.ts +16 -1
- package/dist/map/marker/map-marker.js +13 -5
- package/dist/map/points/map-points.d.ts +5 -0
- package/dist/map/points/map-points.js +6 -4
- package/dist/map/position/map-position.d.ts +5 -0
- package/dist/map/position/map-position.js +3 -1
- package/dist/map/raster/map-raster.d.ts +5 -0
- package/dist/map/raster/map-raster.js +3 -1
- package/dist/map/root/map-root.d.ts +33 -14
- package/dist/map/root/map-root.js +59 -22
- package/dist/map/route/map-route.d.ts +5 -0
- package/dist/map/route/map-route.js +3 -1
- package/dist/map/terrain/map-terrain.d.ts +5 -0
- package/dist/map/terrain/map-terrain.js +3 -1
- package/dist/menu/root/menu-root.d.ts +5 -0
- package/dist/menu/root/menu-root.js +3 -1
- package/dist/meter/root/meter-root.d.ts +16 -3
- package/dist/meter/root/meter-root.js +12 -5
- package/dist/navigation/root/navigation-root.d.ts +5 -0
- package/dist/navigation/root/navigation-root.js +3 -1
- package/dist/notifications/notification/notification.d.ts +5 -0
- package/dist/notifications/notification/notification.js +3 -1
- package/dist/notifications/root/notifications-root.d.ts +8 -0
- package/dist/notifications/root/notifications-root.js +10 -2
- package/dist/number-input/root/number-input-root.d.ts +21 -8
- package/dist/number-input/root/number-input-root.js +26 -11
- package/dist/object-inspector/root/object-inspector-root.d.ts +51 -12
- package/dist/object-inspector/root/object-inspector-root.js +21 -20
- package/dist/outline/root/outline-root.d.ts +5 -0
- package/dist/outline/root/outline-root.js +3 -1
- package/dist/pagination/root/pagination-root.d.ts +7 -1
- package/dist/pagination/root/pagination-root.js +16 -7
- package/dist/pagination/size/pagination-size.d.ts +7 -3
- package/dist/pagination/size/pagination-size.js +4 -2
- package/dist/pagination/summary/pagination-summary.d.ts +8 -6
- package/dist/pagination/summary/pagination-summary.js +4 -9
- package/dist/pin-input/code.d.ts +6 -6
- package/dist/pin-input/code.js +1 -5
- package/dist/pin-input/root/pin-input-root.d.ts +9 -3
- package/dist/pin-input/root/pin-input-root.js +6 -2
- package/dist/popover/root/popover-root.d.ts +12 -2
- package/dist/popover/root/popover-root.js +10 -4
- package/dist/progress/root/progress-root.d.ts +7 -2
- package/dist/progress/root/progress-root.js +5 -2
- package/dist/qr-code/name.d.ts +3 -2
- package/dist/qr-code/name.js +2 -2
- package/dist/qr-code/root/qr-code-root.d.ts +12 -2
- package/dist/qr-code/root/qr-code-root.js +9 -2
- package/dist/radio/group/radio-group.d.ts +11 -0
- package/dist/radio/group/radio-group.js +8 -2
- package/dist/rating/root/rating-root.d.ts +12 -1
- package/dist/rating/root/rating-root.js +10 -3
- package/dist/scatter-chart/root/scatter-chart-root.d.ts +20 -2
- package/dist/scatter-chart/root/scatter-chart-root.js +20 -5
- package/dist/select/root/select-root.d.ts +11 -0
- package/dist/select/root/select-root.js +13 -3
- package/dist/skip-link/root/skip-link-root.d.ts +5 -0
- package/dist/skip-link/root/skip-link-root.js +3 -1
- package/dist/slider/root/slider-root.d.ts +7 -2
- package/dist/slider/root/slider-root.js +11 -5
- package/dist/sparkline/readings.d.ts +15 -5
- package/dist/sparkline/readings.js +3 -3
- package/dist/sparkline/root/sparkline-root.d.ts +9 -4
- package/dist/sparkline/root/sparkline-root.js +9 -3
- package/dist/speed-dial/root/speed-dial-root.d.ts +5 -0
- package/dist/speed-dial/root/speed-dial-root.js +4 -1
- package/dist/splitter/root/splitter-root.d.ts +6 -1
- package/dist/splitter/root/splitter-root.js +9 -4
- package/dist/steps/root/steps-root.d.ts +9 -2
- package/dist/steps/root/steps-root.js +6 -3
- package/dist/steps/step/step.d.ts +12 -0
- package/dist/steps/step/step.js +11 -2
- package/dist/switch/root/switch-root.d.ts +11 -0
- package/dist/switch/root/switch-root.js +8 -2
- package/dist/table/column/table-column.d.ts +11 -4
- package/dist/table/column/table-column.js +15 -10
- package/dist/table/grid-controller.d.ts +8 -3
- package/dist/table/grid-controller.js +17 -11
- package/dist/table/root/table-root.d.ts +107 -5
- package/dist/table/root/table-root.js +122 -20
- package/dist/table/row/table-row.d.ts +42 -0
- package/dist/table/row/table-row.js +40 -1
- package/dist/tabs/root/tabs-root.d.ts +5 -0
- package/dist/tabs/root/tabs-root.js +3 -1
- package/dist/tag/group/tag-group.d.ts +5 -0
- package/dist/tag/group/tag-group.js +3 -1
- package/dist/tag/root/tag-root.d.ts +14 -1
- package/dist/tag/root/tag-root.js +11 -8
- package/dist/textarea/root/textarea-root.d.ts +5 -0
- package/dist/textarea/root/textarea-root.js +3 -1
- package/dist/time-input/root/time-input-root.d.ts +14 -7
- package/dist/time-input/root/time-input-root.js +43 -32
- package/dist/time-picker/root/time-picker-root.d.ts +15 -7
- package/dist/time-picker/root/time-picker-root.js +25 -12
- package/dist/toast/item/toast-item.d.ts +7 -0
- package/dist/toast/item/toast-item.js +1 -0
- package/dist/toast/root/toast-root.d.ts +9 -1
- package/dist/toast/root/toast-root.js +5 -4
- package/dist/toolbar/root/toolbar-root.d.ts +5 -0
- package/dist/toolbar/root/toolbar-root.js +5 -2
- package/dist/tooltip/root/tooltip-root.d.ts +27 -17
- package/dist/tour/root/tour-root.d.ts +8 -2
- package/dist/tour/root/tour-root.js +4 -2
- package/dist/tour/stop/tour-stop.d.ts +5 -0
- package/dist/tour/stop/tour-stop.js +6 -1
- package/dist/tree/grip.d.ts +5 -0
- package/dist/tree/grip.js +1 -0
- package/dist/tree/item/tree-item.d.ts +24 -0
- package/dist/tree/item/tree-item.js +27 -5
- package/dist/tree/root/tree-root.d.ts +66 -1
- package/dist/tree/root/tree-root.js +77 -5
- package/dist/trend/root/trend-root.d.ts +20 -4
- package/dist/trend/root/trend-root.js +20 -5
- package/dist/video/root/video-root.d.ts +12 -3
- package/dist/video/root/video-root.js +41 -14
- package/dist/video-playlist/menu/video-playlist-menu.d.ts +5 -0
- package/dist/video-playlist/menu/video-playlist-menu.js +3 -1
- package/dist/video-playlist/root/video-playlist-root.d.ts +5 -0
- package/dist/video-playlist/root/video-playlist-root.js +3 -1
- package/dist/virtual-list/root/virtual-list-root.d.ts +19 -3
- package/dist/virtual-list/root/virtual-list-root.js +5 -2
- package/lint.json +1 -1
- package/package.json +7 -6
- package/types/jsx.d.ts +4014 -1862
- package/types/vue.d.ts +1266 -624
- package/types/words.d.ts +3280 -0
- package/dist/toast/hotkey.d.ts +0 -22
- package/dist/toast/hotkey.js +0 -23
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AriaForwardController, HelixFormElement } from '@fusion.dev/helix-core';
|
|
1
|
+
import { AriaForwardController, type DateCalendar, HelixFormElement } from '@fusion.dev/helix-core';
|
|
2
2
|
import { type PropertyValues, type TemplateResult } from 'lit';
|
|
3
3
|
import '../../date-picker/index.js';
|
|
4
4
|
import '../../tag/index.js';
|
|
@@ -103,6 +103,11 @@ declare const HelixHeadlessDateInput_base: (new (...args: any[]) => import("@fus
|
|
|
103
103
|
* @cssstate open - The calendar is open.
|
|
104
104
|
*/
|
|
105
105
|
export declare class HelixHeadlessDateInput extends HelixHeadlessDateInput_base {
|
|
106
|
+
/**
|
|
107
|
+
* The key this family's words are registered under, its styled tag:
|
|
108
|
+
* `registerWords('de', { 'helix-date-input': { triggerLabel: 'Datum auswählen' } })`.
|
|
109
|
+
*/
|
|
110
|
+
static words: string;
|
|
106
111
|
protected readonly aria: AriaForwardController;
|
|
107
112
|
/**
|
|
108
113
|
* What the browser may autofill here, as one of the platform's own tokens.
|
|
@@ -112,6 +117,17 @@ export declare class HelixHeadlessDateInput extends HelixHeadlessDateInput_base
|
|
|
112
117
|
* postal code can never be filled in for a reader.
|
|
113
118
|
*/
|
|
114
119
|
autocomplete: string;
|
|
120
|
+
/**
|
|
121
|
+
* The calendar the written date and the calendar's days are in: `gregory`,
|
|
122
|
+
* `buddhist`, `japanese`, `roc`, or `iso8601`.
|
|
123
|
+
*
|
|
124
|
+
* Absent is the locale's own where it is one of the five, and `gregory` for
|
|
125
|
+
* every other, as Date Picker's `calendar` is. The value is `YYYY-MM-DD` in
|
|
126
|
+
* every calendar, and a focused field is ISO in every calendar. In
|
|
127
|
+
* `segmented`, the segments are the Gregorian day, month, and year, in the
|
|
128
|
+
* order the locale writes them, or ISO order for `iso8601`.
|
|
129
|
+
*/
|
|
130
|
+
calendar?: DateCalendar;
|
|
115
131
|
/**
|
|
116
132
|
* The name of the calendar's grid of days, read by screen readers.
|
|
117
133
|
*/
|
|
@@ -181,7 +197,7 @@ export declare class HelixHeadlessDateInput extends HelixHeadlessDateInput_base
|
|
|
181
197
|
* Shoelace and Web Awesome read it, then the runtime's own.
|
|
182
198
|
*/
|
|
183
199
|
locale: string;
|
|
184
|
-
/** The locale the words are written in: `locale`, or the page's `lang`. */
|
|
200
|
+
/** The locale the words and dates are written in: `locale`, or the page's `lang`. */
|
|
185
201
|
private get language();
|
|
186
202
|
/**
|
|
187
203
|
* The latest date that can be chosen, as `YYYY-MM-DD`.
|
|
@@ -282,20 +298,20 @@ export declare class HelixHeadlessDateInput extends HelixHeadlessDateInput_base
|
|
|
282
298
|
* The message shown when a range holds more than two dates.
|
|
283
299
|
*
|
|
284
300
|
* **Every sentence a control raises in the browser's bubble is a property**,
|
|
285
|
-
* so a form in another language speaks it.
|
|
286
|
-
*
|
|
301
|
+
* so a form in another language speaks it. Unset is the sentence registered
|
|
302
|
+
* for the page's language, then the English.
|
|
287
303
|
*/
|
|
288
|
-
rangeLengthMessage
|
|
304
|
+
rangeLengthMessage: string;
|
|
289
305
|
/**
|
|
290
306
|
* The message shown when a date is after `max`. `{max}` is replaced with
|
|
291
307
|
* `max`, written the way the field writes dates.
|
|
292
308
|
*/
|
|
293
|
-
rangeOverflowMessage
|
|
309
|
+
rangeOverflowMessage: string;
|
|
294
310
|
/**
|
|
295
311
|
* The message shown when a date is before `min`. `{min}` is replaced with
|
|
296
312
|
* `min`, written the way the field writes dates.
|
|
297
313
|
*/
|
|
298
|
-
rangeUnderflowMessage
|
|
314
|
+
rangeUnderflowMessage: string;
|
|
299
315
|
/**
|
|
300
316
|
* The name of the button that removes one date. `{name}` is replaced with
|
|
301
317
|
* the date.
|
|
@@ -316,7 +332,7 @@ export declare class HelixHeadlessDateInput extends HelixHeadlessDateInput_base
|
|
|
316
332
|
/**
|
|
317
333
|
* The message shown when a date is not on `step`.
|
|
318
334
|
*/
|
|
319
|
-
stepMismatchMessage
|
|
335
|
+
stepMismatchMessage: string;
|
|
320
336
|
/**
|
|
321
337
|
* The name of the button that opens the calendar, read by screen readers.
|
|
322
338
|
*/
|
|
@@ -336,6 +352,11 @@ export declare class HelixHeadlessDateInput extends HelixHeadlessDateInput_base
|
|
|
336
352
|
*/
|
|
337
353
|
protected get segmentable(): boolean;
|
|
338
354
|
protected get segmentedKind(): 'date';
|
|
355
|
+
/**
|
|
356
|
+
* The segments are the Gregorian day, month and year, which is what they
|
|
357
|
+
* hold, in ISO order where the calendar is `iso8601`. A year shown as 2569
|
|
358
|
+
* or Reiwa 8 would be a year the segment does not hold.
|
|
359
|
+
*/
|
|
339
360
|
protected get segmentLocale(): string;
|
|
340
361
|
/** One date, written the way `dateStyle` asks for. */
|
|
341
362
|
private written;
|
|
@@ -368,7 +389,7 @@ export declare class HelixHeadlessDateInput extends HelixHeadlessDateInput_base
|
|
|
368
389
|
/**
|
|
369
390
|
* The message shown when `disable-dates` or `disable-days` bars a date.
|
|
370
391
|
*/
|
|
371
|
-
unavailableMessage
|
|
392
|
+
unavailableMessage: string;
|
|
372
393
|
/**
|
|
373
394
|
* The name of the calendar's heading where it shows a page of years, with
|
|
374
395
|
* `{heading}` filled in.
|
|
@@ -423,6 +444,8 @@ export declare class HelixHeadlessDateInput extends HelixHeadlessDateInput_base
|
|
|
423
444
|
* and no mark whatsoever.
|
|
424
445
|
*/
|
|
425
446
|
protected renderTrigger(): TemplateResult;
|
|
447
|
+
/** The line of text the dates are typed into, where the field shows no segments. */
|
|
448
|
+
private renderControl;
|
|
426
449
|
protected render(): TemplateResult;
|
|
427
450
|
/**
|
|
428
451
|
* The value as a `Date`, at midnight UTC, or `null` while there is no date.
|
|
@@ -4,7 +4,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
4
4
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
|
-
import { AriaForwardController, valueAsDate as asDate, barredBy, customElement,
|
|
7
|
+
import { AriaForwardController, valueAsDate as asDate, barredBy, calendarLocale, customElement, formatWords, dateAsValue as fromDate, HelixFormElement, handedLocale, isDateValue, MixinControllerOpen, MixinControllerValue, MixinField, MixinPickerEditing, MixinPickerField, MixinSegmentedField, MixinTokens, words, wordsLocale, } from '@fusion.dev/helix-core';
|
|
8
8
|
import { calendarBlank } from '@fusion.dev/helix-icons';
|
|
9
9
|
import { nothing } from 'lit';
|
|
10
10
|
import { property, state } from 'lit/decorators.js';
|
|
@@ -43,8 +43,12 @@ let HelixHeadlessDateInput = class HelixHeadlessDateInput extends MixinSegmented
|
|
|
43
43
|
this.previousLabel = 'Previous month';
|
|
44
44
|
this.previousYearLabel = 'Previous year';
|
|
45
45
|
this.previousYearsLabel = 'Earlier years';
|
|
46
|
+
this.rangeLengthMessage = 'A range is two dates.';
|
|
47
|
+
this.rangeOverflowMessage = 'Choose a date on or before {max}.';
|
|
48
|
+
this.rangeUnderflowMessage = 'Choose a date on or after {min}.';
|
|
46
49
|
this.removeLabel = 'Remove {name}';
|
|
47
50
|
this.step = 1;
|
|
51
|
+
this.stepMismatchMessage = 'Choose one of the dates the calendar offers.';
|
|
48
52
|
this.triggerLabel = 'Choose a date';
|
|
49
53
|
this.draft = '';
|
|
50
54
|
this.handleInput = (event) => {
|
|
@@ -95,13 +99,15 @@ let HelixHeadlessDateInput = class HelixHeadlessDateInput extends MixinSegmented
|
|
|
95
99
|
this.updateComplete.then(() => this.returnFocus());
|
|
96
100
|
}
|
|
97
101
|
};
|
|
102
|
+
this.unavailableMessage = 'Choose a date that is available.';
|
|
98
103
|
this.yearViewLabel = '{heading}. Choose a year';
|
|
99
104
|
this.handleIconChange = () => {
|
|
100
105
|
this.requestUpdate();
|
|
101
106
|
};
|
|
102
107
|
}
|
|
108
|
+
static { this.words = 'helix-date-input'; }
|
|
103
109
|
get language() {
|
|
104
|
-
return
|
|
110
|
+
return wordsLocale(this);
|
|
105
111
|
}
|
|
106
112
|
placed(room) {
|
|
107
113
|
const all = Math.max(1, Math.floor(this.months) || 1);
|
|
@@ -119,7 +125,7 @@ let HelixHeadlessDateInput = class HelixHeadlessDateInput extends MixinSegmented
|
|
|
119
125
|
}
|
|
120
126
|
willUpdate(changed) {
|
|
121
127
|
super.willUpdate(changed);
|
|
122
|
-
if (changed.has('months') || changed.has('locale')) {
|
|
128
|
+
if (changed.has('months') || changed.has('locale') || changed.has('calendar')) {
|
|
123
129
|
this.fitted = undefined;
|
|
124
130
|
this.wide = undefined;
|
|
125
131
|
}
|
|
@@ -135,7 +141,8 @@ let HelixHeadlessDateInput = class HelixHeadlessDateInput extends MixinSegmented
|
|
|
135
141
|
return 'date';
|
|
136
142
|
}
|
|
137
143
|
get segmentLocale() {
|
|
138
|
-
|
|
144
|
+
const tag = calendarLocale(this.language, this.calendar);
|
|
145
|
+
return tag.includes('-ca-iso8601') ? tag : calendarLocale(tag, 'gregory');
|
|
139
146
|
}
|
|
140
147
|
written(date) {
|
|
141
148
|
if (this.dateStyle === 'iso' || !isDateValue(date)) {
|
|
@@ -144,7 +151,7 @@ let HelixHeadlessDateInput = class HelixHeadlessDateInput extends MixinSegmented
|
|
|
144
151
|
const at = new Date(`${date}T00:00:00Z`);
|
|
145
152
|
return Number.isNaN(at.getTime())
|
|
146
153
|
? date
|
|
147
|
-
: new Intl.DateTimeFormat(this.language || undefined, {
|
|
154
|
+
: new Intl.DateTimeFormat(calendarLocale(this.language, this.calendar) || undefined, {
|
|
148
155
|
dateStyle: this.dateStyle,
|
|
149
156
|
timeZone: 'UTC',
|
|
150
157
|
}).format(at);
|
|
@@ -181,17 +188,13 @@ let HelixHeadlessDateInput = class HelixHeadlessDateInput extends MixinSegmented
|
|
|
181
188
|
if (this.min !== '' && held.some((one) => one < this.min)) {
|
|
182
189
|
return [
|
|
183
190
|
'rangeUnderflow',
|
|
184
|
-
|
|
185
|
-
min: this.written(this.min),
|
|
186
|
-
}),
|
|
191
|
+
formatWords(this, 'rangeUnderflowMessage', { min: this.written(this.min) }),
|
|
187
192
|
];
|
|
188
193
|
}
|
|
189
194
|
if (this.max !== '' && held.some((one) => one > this.max)) {
|
|
190
195
|
return [
|
|
191
196
|
'rangeOverflow',
|
|
192
|
-
|
|
193
|
-
max: this.written(this.max),
|
|
194
|
-
}),
|
|
197
|
+
formatWords(this, 'rangeOverflowMessage', { max: this.written(this.max) }),
|
|
195
198
|
];
|
|
196
199
|
}
|
|
197
200
|
const why = held.map((one) => {
|
|
@@ -199,16 +202,13 @@ let HelixHeadlessDateInput = class HelixHeadlessDateInput extends MixinSegmented
|
|
|
199
202
|
return date ? barredBy(date, this) : null;
|
|
200
203
|
});
|
|
201
204
|
if (why.includes('listed')) {
|
|
202
|
-
return this.unavailableMessage
|
|
205
|
+
return this.unavailableMessage;
|
|
203
206
|
}
|
|
204
207
|
if (why.includes('step')) {
|
|
205
|
-
return [
|
|
206
|
-
'stepMismatch',
|
|
207
|
-
this.stepMismatchMessage || 'Choose one of the dates the calendar offers.',
|
|
208
|
-
];
|
|
208
|
+
return ['stepMismatch', this.stepMismatchMessage];
|
|
209
209
|
}
|
|
210
210
|
if (this.mode === 'range' && held.length > 2) {
|
|
211
|
-
return this.rangeLengthMessage
|
|
211
|
+
return this.rangeLengthMessage;
|
|
212
212
|
}
|
|
213
213
|
return '';
|
|
214
214
|
}
|
|
@@ -230,11 +230,12 @@ let HelixHeadlessDateInput = class HelixHeadlessDateInput extends MixinSegmented
|
|
|
230
230
|
mode=${this.mode ?? nothing}
|
|
231
231
|
months=${this.fitted ?? this.months}
|
|
232
232
|
.value=${this.picked}
|
|
233
|
+
calendar=${this.calendar ?? nothing}
|
|
233
234
|
disable-dates=${this.disableDates || nothing}
|
|
234
235
|
disable-days=${this.disableDays || nothing}
|
|
235
236
|
first-day-of-week=${this.firstDayOfWeek ?? nothing}
|
|
236
237
|
label=${this.calendarLabel}
|
|
237
|
-
locale=${this
|
|
238
|
+
locale=${handedLocale(this) || nothing}
|
|
238
239
|
max=${this.max || nothing}
|
|
239
240
|
max-view=${this.maxView ?? nothing}
|
|
240
241
|
min=${this.min || nothing}
|
|
@@ -270,7 +271,7 @@ let HelixHeadlessDateInput = class HelixHeadlessDateInput extends MixinSegmented
|
|
|
270
271
|
part="date"
|
|
271
272
|
exportparts="cell: date-cell, dismiss: date-dismiss, dismiss-mark: date-dismiss-mark, label: date-label, link: date-link, start: date-start"
|
|
272
273
|
dismissible
|
|
273
|
-
dismiss-label=${
|
|
274
|
+
dismiss-label=${formatWords(this, 'removeLabel', { name: this.written(date) })}
|
|
274
275
|
?disabled=${this.isDisabled}
|
|
275
276
|
@helix-dismiss=${(event) => {
|
|
276
277
|
event.stopPropagation();
|
|
@@ -284,37 +285,38 @@ let HelixHeadlessDateInput = class HelixHeadlessDateInput extends MixinSegmented
|
|
|
284
285
|
${unsafeSVG(calendarBlank.content)}
|
|
285
286
|
</svg></slot>`;
|
|
286
287
|
}
|
|
288
|
+
renderControl() {
|
|
289
|
+
return html `<input
|
|
290
|
+
part="control"
|
|
291
|
+
id=${this.controlId}
|
|
292
|
+
type="text"
|
|
293
|
+
.value=${this.display}
|
|
294
|
+
name=${this.name || nothing}
|
|
295
|
+
placeholder=${this.mode === 'multiple' && dates(this.value).length > 0
|
|
296
|
+
? nothing
|
|
297
|
+
: this.placeholder || nothing}
|
|
298
|
+
autocomplete=${this.autocomplete || nothing}
|
|
299
|
+
inputmode="numeric"
|
|
300
|
+
aria-describedby=${this.describedBy ?? nothing}
|
|
301
|
+
aria-invalid=${this.invalidity ?? nothing}
|
|
302
|
+
?disabled=${this.isDisabled}
|
|
303
|
+
?readonly=${this.readOnly}
|
|
304
|
+
?required=${this.required}
|
|
305
|
+
@blur=${this.handleBlur}
|
|
306
|
+
@change=${this.handleCommit}
|
|
307
|
+
@focus=${this.handleFocus}
|
|
308
|
+
@input=${this.handleInput}
|
|
309
|
+
@keydown=${this.handleDraftKey}
|
|
310
|
+
@keypress=${this.handleKeypress}
|
|
311
|
+
/>`;
|
|
312
|
+
}
|
|
287
313
|
render() {
|
|
288
314
|
return html `${this.renderLabel()}
|
|
289
315
|
<div part="field" @keydown=${this.handleKeydown}>
|
|
290
316
|
${this.mode === 'multiple'
|
|
291
317
|
? this.renderTokenRow(this.shownDates.map((date) => this.renderTag(date)), this.restCount)
|
|
292
318
|
: nothing}
|
|
293
|
-
${this.segmentsShown
|
|
294
|
-
? this.renderSegments()
|
|
295
|
-
: html `<input
|
|
296
|
-
part="control"
|
|
297
|
-
id=${this.controlId}
|
|
298
|
-
type="text"
|
|
299
|
-
.value=${this.display}
|
|
300
|
-
name=${this.name || nothing}
|
|
301
|
-
placeholder=${this.mode === 'multiple' && dates(this.value).length > 0
|
|
302
|
-
? nothing
|
|
303
|
-
: this.placeholder || nothing}
|
|
304
|
-
autocomplete=${this.autocomplete || nothing}
|
|
305
|
-
inputmode="numeric"
|
|
306
|
-
aria-describedby=${this.describedBy ?? nothing}
|
|
307
|
-
aria-invalid=${this.invalidity ?? nothing}
|
|
308
|
-
?disabled=${this.isDisabled}
|
|
309
|
-
?readonly=${this.readOnly}
|
|
310
|
-
?required=${this.required}
|
|
311
|
-
@blur=${this.handleBlur}
|
|
312
|
-
@change=${this.handleCommit}
|
|
313
|
-
@focus=${this.handleFocus}
|
|
314
|
-
@input=${this.handleInput}
|
|
315
|
-
@keydown=${this.handleDraftKey}
|
|
316
|
-
@keypress=${this.handleKeypress}
|
|
317
|
-
/>`}
|
|
319
|
+
${this.segmentsShown ? this.renderSegments() : this.renderControl()}
|
|
318
320
|
<button
|
|
319
321
|
part="trigger"
|
|
320
322
|
type="button"
|
|
@@ -362,6 +364,10 @@ __decorate([
|
|
|
362
364
|
property()
|
|
363
365
|
], HelixHeadlessDateInput.prototype, "autocomplete", void 0);
|
|
364
366
|
__decorate([
|
|
367
|
+
property()
|
|
368
|
+
], HelixHeadlessDateInput.prototype, "calendar", void 0);
|
|
369
|
+
__decorate([
|
|
370
|
+
words,
|
|
365
371
|
property({ attribute: 'calendar-label' })
|
|
366
372
|
], HelixHeadlessDateInput.prototype, "calendarLabel", void 0);
|
|
367
373
|
__decorate([
|
|
@@ -404,57 +410,73 @@ __decorate([
|
|
|
404
410
|
state()
|
|
405
411
|
], HelixHeadlessDateInput.prototype, "fitted", void 0);
|
|
406
412
|
__decorate([
|
|
413
|
+
words,
|
|
407
414
|
property({ attribute: 'month-view-label' })
|
|
408
415
|
], HelixHeadlessDateInput.prototype, "monthViewLabel", void 0);
|
|
409
416
|
__decorate([
|
|
417
|
+
words,
|
|
410
418
|
property({ attribute: 'next-label' })
|
|
411
419
|
], HelixHeadlessDateInput.prototype, "nextLabel", void 0);
|
|
412
420
|
__decorate([
|
|
421
|
+
words,
|
|
413
422
|
property({ attribute: 'next-year-label' })
|
|
414
423
|
], HelixHeadlessDateInput.prototype, "nextYearLabel", void 0);
|
|
415
424
|
__decorate([
|
|
425
|
+
words,
|
|
416
426
|
property({ attribute: 'next-years-label' })
|
|
417
427
|
], HelixHeadlessDateInput.prototype, "nextYearsLabel", void 0);
|
|
418
428
|
__decorate([
|
|
429
|
+
words,
|
|
419
430
|
property()
|
|
420
431
|
], HelixHeadlessDateInput.prototype, "placeholder", void 0);
|
|
421
432
|
__decorate([
|
|
433
|
+
words,
|
|
422
434
|
property({ attribute: 'previous-label' })
|
|
423
435
|
], HelixHeadlessDateInput.prototype, "previousLabel", void 0);
|
|
424
436
|
__decorate([
|
|
437
|
+
words,
|
|
425
438
|
property({ attribute: 'previous-year-label' })
|
|
426
439
|
], HelixHeadlessDateInput.prototype, "previousYearLabel", void 0);
|
|
427
440
|
__decorate([
|
|
441
|
+
words,
|
|
428
442
|
property({ attribute: 'previous-years-label' })
|
|
429
443
|
], HelixHeadlessDateInput.prototype, "previousYearsLabel", void 0);
|
|
430
444
|
__decorate([
|
|
445
|
+
words,
|
|
431
446
|
property({ attribute: 'range-length-message' })
|
|
432
447
|
], HelixHeadlessDateInput.prototype, "rangeLengthMessage", void 0);
|
|
433
448
|
__decorate([
|
|
449
|
+
words,
|
|
434
450
|
property({ attribute: 'range-overflow-message' })
|
|
435
451
|
], HelixHeadlessDateInput.prototype, "rangeOverflowMessage", void 0);
|
|
436
452
|
__decorate([
|
|
453
|
+
words,
|
|
437
454
|
property({ attribute: 'range-underflow-message' })
|
|
438
455
|
], HelixHeadlessDateInput.prototype, "rangeUnderflowMessage", void 0);
|
|
439
456
|
__decorate([
|
|
457
|
+
words,
|
|
440
458
|
property({ attribute: 'remove-label' })
|
|
441
459
|
], HelixHeadlessDateInput.prototype, "removeLabel", void 0);
|
|
442
460
|
__decorate([
|
|
443
461
|
property({ type: Number })
|
|
444
462
|
], HelixHeadlessDateInput.prototype, "step", void 0);
|
|
445
463
|
__decorate([
|
|
464
|
+
words,
|
|
446
465
|
property({ attribute: 'step-mismatch-message' })
|
|
447
466
|
], HelixHeadlessDateInput.prototype, "stepMismatchMessage", void 0);
|
|
448
467
|
__decorate([
|
|
468
|
+
words,
|
|
449
469
|
property({ attribute: 'trigger-label' })
|
|
450
470
|
], HelixHeadlessDateInput.prototype, "triggerLabel", void 0);
|
|
451
471
|
__decorate([
|
|
452
472
|
state()
|
|
453
473
|
], HelixHeadlessDateInput.prototype, "draft", void 0);
|
|
454
474
|
__decorate([
|
|
475
|
+
words,
|
|
455
476
|
property({ attribute: 'unavailable-message' })
|
|
456
477
|
], HelixHeadlessDateInput.prototype, "unavailableMessage", void 0);
|
|
457
478
|
__decorate([
|
|
479
|
+
words,
|
|
458
480
|
property({ attribute: 'year-view-label' })
|
|
459
481
|
], HelixHeadlessDateInput.prototype, "yearViewLabel", void 0);
|
|
460
482
|
HelixHeadlessDateInput = __decorate([
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type CalendarView, HelixFormElement } from '@fusion.dev/helix-core';
|
|
1
|
+
import { type CalendarView, type DateCalendar, HelixFormElement } from '@fusion.dev/helix-core';
|
|
2
2
|
import { type PropertyValues, type TemplateResult } from 'lit';
|
|
3
3
|
declare const HelixHeadlessDatePicker_base: (new (...args: any[]) => import("@fusion.dev/helix-core").MixinPickerFeedbackInterface) & (new (...args: any[]) => import("@fusion.dev/helix-core").MixinControllerValueInterface) & typeof HelixFormElement;
|
|
4
4
|
/**
|
|
@@ -15,6 +15,10 @@ declare const HelixHeadlessDatePicker_base: (new (...args: any[]) => import("@fu
|
|
|
15
15
|
* **Dates are `YYYY-MM-DD` strings, and every calculation is in UTC**, because
|
|
16
16
|
* a local-time `Date` shifts across a time zone or daylight-saving boundary.
|
|
17
17
|
*
|
|
18
|
+
* **The days are the Gregorian calendar's**, written in `calendar`: the
|
|
19
|
+
* locale's own where its months are the Gregorian months, as `th-TH` writes
|
|
20
|
+
* 2569 for 2026, and `gregory` where they are not, as for `fa-IR`.
|
|
21
|
+
*
|
|
18
22
|
* `month` sets which month the grid shows, separately from `value`, so paging
|
|
19
23
|
* selects nothing and you can control the view. When unset, it follows the
|
|
20
24
|
* first selected date, then the current month.
|
|
@@ -85,14 +89,33 @@ declare const HelixHeadlessDatePicker_base: (new (...args: any[]) => import("@fu
|
|
|
85
89
|
* @cssstate invalid - While `invalid` is set or `feedback` says what is wrong.
|
|
86
90
|
*/
|
|
87
91
|
export declare class HelixHeadlessDatePicker extends HelixHeadlessDatePicker_base {
|
|
92
|
+
/**
|
|
93
|
+
* The key this family's words are registered under, its styled tag:
|
|
94
|
+
* `registerWords('de', { 'helix-date-picker': { nextLabel: 'Nächster Monat' } })`.
|
|
95
|
+
*/
|
|
96
|
+
static words: string;
|
|
88
97
|
/**
|
|
89
98
|
* The validation message for a value that is not a date.
|
|
90
99
|
*
|
|
91
100
|
* **Every sentence a control raises in the browser's bubble is a property**,
|
|
92
101
|
* named for the validity flag it reports, so a form in another language
|
|
93
|
-
* speaks it.
|
|
102
|
+
* speaks it. Unset is the sentence registered for the page's language, then
|
|
103
|
+
* the English. `{mode}` is `single`, `range` or `multiple`, so each can have
|
|
104
|
+
* its own sentence.
|
|
105
|
+
*/
|
|
106
|
+
badInputMessage: string;
|
|
107
|
+
/**
|
|
108
|
+
* The calendar the heading, the days, and the months are written in:
|
|
109
|
+
* `gregory`, `buddhist`, `japanese`, `roc`, or `iso8601`, the five whose
|
|
110
|
+
* months are the Gregorian months.
|
|
111
|
+
*
|
|
112
|
+
* Absent is the locale's own where it is one of the five, such as
|
|
113
|
+
* `buddhist` for `th-TH` or `japanese` for `ja-JP-u-ca-japanese`, and
|
|
114
|
+
* `gregory` for every other, such as `persian` for `fa-IR`, so the heading
|
|
115
|
+
* names the Gregorian month the grid shows. The value is `YYYY-MM-DD` in
|
|
116
|
+
* every calendar.
|
|
94
117
|
*/
|
|
95
|
-
|
|
118
|
+
calendar?: DateCalendar;
|
|
96
119
|
/**
|
|
97
120
|
* What each day shows, in place of its number: a function given the date as
|
|
98
121
|
* `YYYY-MM-DD` that returns text, an element or a Lit template.
|
|
@@ -147,7 +170,7 @@ export declare class HelixHeadlessDatePicker extends HelixHeadlessDatePicker_bas
|
|
|
147
170
|
* Shoelace and Web Awesome read it, then the runtime's own.
|
|
148
171
|
*/
|
|
149
172
|
locale: string;
|
|
150
|
-
/** The locale the words are written in: `locale`, or the page's `lang`. */
|
|
173
|
+
/** The locale the words and dates are written in: `locale`, or the page's `lang`. */
|
|
151
174
|
private get language();
|
|
152
175
|
/**
|
|
153
176
|
* Latest selectable date, as `YYYY-MM-DD`.
|
|
@@ -226,7 +249,7 @@ export declare class HelixHeadlessDatePicker extends HelixHeadlessDatePicker_bas
|
|
|
226
249
|
* The validation message for a date after `max`. `{max}` is replaced with
|
|
227
250
|
* `max`, written as a date in `locale`.
|
|
228
251
|
*/
|
|
229
|
-
rangeOverflowMessage
|
|
252
|
+
rangeOverflowMessage: string;
|
|
230
253
|
/**
|
|
231
254
|
* The date the grid's tab stop is on.
|
|
232
255
|
*
|
|
@@ -370,7 +393,7 @@ export declare class HelixHeadlessDatePicker extends HelixHeadlessDatePicker_bas
|
|
|
370
393
|
* The validation message for a date before `min`. `{min}` is replaced with
|
|
371
394
|
* `min`, written as a date in `locale`.
|
|
372
395
|
*/
|
|
373
|
-
rangeUnderflowMessage
|
|
396
|
+
rangeUnderflowMessage: string;
|
|
374
397
|
/** Refuses every change while read-only. See `readOnly`. */
|
|
375
398
|
requestValue(next: string): boolean;
|
|
376
399
|
/**
|
|
@@ -408,16 +431,16 @@ export declare class HelixHeadlessDatePicker extends HelixHeadlessDatePicker_bas
|
|
|
408
431
|
/**
|
|
409
432
|
* The validation message for a date that `step` skips.
|
|
410
433
|
*/
|
|
411
|
-
stepMismatchMessage
|
|
434
|
+
stepMismatchMessage: string;
|
|
412
435
|
/**
|
|
413
436
|
* The validation message for a date that `disable-dates` or `disable-days`
|
|
414
437
|
* bars.
|
|
415
438
|
*/
|
|
416
|
-
unavailableMessage
|
|
439
|
+
unavailableMessage: string;
|
|
417
440
|
/**
|
|
418
441
|
* The validation message for a required date picker with no date chosen.
|
|
419
442
|
*/
|
|
420
|
-
valueMissingMessage
|
|
443
|
+
valueMissingMessage: string;
|
|
421
444
|
/**
|
|
422
445
|
* What the calendar shows: the days of a month, the months of a year, or a
|
|
423
446
|
* page of years. `day` unless `max-view` lets a reader step back.
|
|
@@ -493,13 +516,13 @@ export declare class HelixHeadlessDatePicker extends HelixHeadlessDatePicker_bas
|
|
|
493
516
|
* The three date formatters, built once per locale rather than per render.
|
|
494
517
|
*
|
|
495
518
|
* `Intl.DateTimeFormat` costs about a quarter of a millisecond to construct
|
|
496
|
-
* and these depend on nothing but `locale`, so building them
|
|
497
|
-
* per-month render is three constructions for every month on
|
|
498
|
-
* update: a two-month calendar rebuilds six each time an
|
|
499
|
-
* anchor.
|
|
519
|
+
* and these depend on nothing but `locale` and `calendar`, so building them
|
|
520
|
+
* inside the per-month render is three constructions for every month on
|
|
521
|
+
* show, on every update: a two-month calendar rebuilds six each time an
|
|
522
|
+
* arrow key moves the anchor.
|
|
500
523
|
*
|
|
501
|
-
* Keyed on the locale so a change to
|
|
502
|
-
* field would not do.
|
|
524
|
+
* Keyed on the locale with its calendar, so a change to either is picked
|
|
525
|
+
* up, which a plain lazy field would not do.
|
|
503
526
|
*/
|
|
504
527
|
private cachedFormats;
|
|
505
528
|
private get formats();
|