@fusion.dev/helix-headless 0.177.1 → 0.177.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 +115 -45
- package/dist/color-input/root/color-input-root.d.ts +0 -13
- package/dist/color-input/root/color-input-root.js +1 -19
- package/dist/date-input/root/date-input-root.d.ts +7 -1
- package/dist/date-input/root/date-input-root.js +6 -2
- package/dist/date-picker/root/date-picker-root.d.ts +6 -2
- package/dist/date-picker/root/date-picker-root.js +6 -2
- package/dist/time-picker/root/time-picker-root.d.ts +8 -3
- package/dist/time-picker/root/time-picker-root.js +2 -1
- package/lint.json +1 -1
- package/package.json +5 -5
- package/types/jsx.d.ts +126 -36
- package/types/vue.d.ts +42 -12
- package/types/words.d.ts +6 -4
package/custom-elements.json
CHANGED
|
@@ -34499,38 +34499,6 @@
|
|
|
34499
34499
|
"module": "src/mixins/mixin-picker-field/mixin-picker-field.ts"
|
|
34500
34500
|
}
|
|
34501
34501
|
},
|
|
34502
|
-
{
|
|
34503
|
-
"kind": "field",
|
|
34504
|
-
"name": "pressedOpen",
|
|
34505
|
-
"type": {
|
|
34506
|
-
"text": "boolean"
|
|
34507
|
-
},
|
|
34508
|
-
"privacy": "private",
|
|
34509
|
-
"default": "false",
|
|
34510
|
-
"description": "Whether the trigger's press opened the panel that is open now."
|
|
34511
|
-
},
|
|
34512
|
-
{
|
|
34513
|
-
"kind": "field",
|
|
34514
|
-
"name": "handlePress",
|
|
34515
|
-
"privacy": "private",
|
|
34516
|
-
"readonly": true,
|
|
34517
|
-
"description": "The trigger's press, which notes that it opened the panel, so Escape hands\nfocus back to the trigger."
|
|
34518
|
-
},
|
|
34519
|
-
{
|
|
34520
|
-
"kind": "method",
|
|
34521
|
-
"name": "returnFocus",
|
|
34522
|
-
"privacy": "protected",
|
|
34523
|
-
"return": {
|
|
34524
|
-
"type": {
|
|
34525
|
-
"text": "void"
|
|
34526
|
-
}
|
|
34527
|
-
},
|
|
34528
|
-
"description": "Hands focus back to the control that opened the panel: the trigger after\nits press, which is the APG date picker dialog's rule, and the text after\nArrowDown from it.",
|
|
34529
|
-
"inheritedFrom": {
|
|
34530
|
-
"name": "MixinPickerField",
|
|
34531
|
-
"module": "src/mixins/mixin-picker-field/mixin-picker-field.ts"
|
|
34532
|
-
}
|
|
34533
|
-
},
|
|
34534
34502
|
{
|
|
34535
34503
|
"kind": "method",
|
|
34536
34504
|
"name": "renderPicker",
|
|
@@ -34684,6 +34652,21 @@
|
|
|
34684
34652
|
"module": "src/mixins/mixin-picker-field/mixin-picker-field.ts"
|
|
34685
34653
|
}
|
|
34686
34654
|
},
|
|
34655
|
+
{
|
|
34656
|
+
"kind": "method",
|
|
34657
|
+
"name": "dismiss",
|
|
34658
|
+
"privacy": "private",
|
|
34659
|
+
"return": {
|
|
34660
|
+
"type": {
|
|
34661
|
+
"text": "void"
|
|
34662
|
+
}
|
|
34663
|
+
},
|
|
34664
|
+
"description": "Escape's close, which hands focus back to the control that opened the\npanel: the trigger after its press, which is the APG date picker\ndialog's rule, and the field otherwise.\n\n**Here rather than in each family.** Color Input had the rule alone, and\nDate Input and Time Input, on the same code, put focus in the text after\nthe trigger's press: one control before where the reader had been.",
|
|
34665
|
+
"inheritedFrom": {
|
|
34666
|
+
"name": "MixinPickerField",
|
|
34667
|
+
"module": "src/mixins/mixin-picker-field/mixin-picker-field.ts"
|
|
34668
|
+
}
|
|
34669
|
+
},
|
|
34687
34670
|
{
|
|
34688
34671
|
"kind": "field",
|
|
34689
34672
|
"name": "handleFocusOut",
|
|
@@ -34720,6 +34703,20 @@
|
|
|
34720
34703
|
"module": "src/mixins/mixin-picker-field/mixin-picker-field.ts"
|
|
34721
34704
|
}
|
|
34722
34705
|
},
|
|
34706
|
+
{
|
|
34707
|
+
"kind": "field",
|
|
34708
|
+
"name": "pressedOpen",
|
|
34709
|
+
"type": {
|
|
34710
|
+
"text": "boolean"
|
|
34711
|
+
},
|
|
34712
|
+
"privacy": "private",
|
|
34713
|
+
"default": "false",
|
|
34714
|
+
"description": "Whether the trigger's press opened the panel that is open now, so Escape returns there.",
|
|
34715
|
+
"inheritedFrom": {
|
|
34716
|
+
"name": "MixinPickerField",
|
|
34717
|
+
"module": "src/mixins/mixin-picker-field/mixin-picker-field.ts"
|
|
34718
|
+
}
|
|
34719
|
+
},
|
|
34723
34720
|
{
|
|
34724
34721
|
"kind": "field",
|
|
34725
34722
|
"name": "handleKeypress",
|
|
@@ -34779,6 +34776,21 @@
|
|
|
34779
34776
|
"module": "src/mixins/mixin-picker-field/mixin-picker-field.ts"
|
|
34780
34777
|
}
|
|
34781
34778
|
},
|
|
34779
|
+
{
|
|
34780
|
+
"kind": "method",
|
|
34781
|
+
"name": "returnFocus",
|
|
34782
|
+
"privacy": "protected",
|
|
34783
|
+
"return": {
|
|
34784
|
+
"type": {
|
|
34785
|
+
"text": "void"
|
|
34786
|
+
}
|
|
34787
|
+
},
|
|
34788
|
+
"description": "Puts the caret back in the field without the field reopening the panel.\n\nThe anchor rather than the text, which is the trigger where there is no\ntext: Color Input's swatch dropped focus to the body on Escape.",
|
|
34789
|
+
"inheritedFrom": {
|
|
34790
|
+
"name": "MixinPickerField",
|
|
34791
|
+
"module": "src/mixins/mixin-picker-field/mixin-picker-field.ts"
|
|
34792
|
+
}
|
|
34793
|
+
},
|
|
34782
34794
|
{
|
|
34783
34795
|
"kind": "method",
|
|
34784
34796
|
"name": "focus",
|
|
@@ -51472,8 +51484,8 @@
|
|
|
51472
51484
|
"type": {
|
|
51473
51485
|
"text": "string"
|
|
51474
51486
|
},
|
|
51475
|
-
"default": "'{mode, select, single {Enter a date as
|
|
51476
|
-
"description": "The message for text that is no date, where `bad-input-message` is not\nset. `{mode}` is `single`, `range`, or `multiple
|
|
51487
|
+
"default": "'{mode, select, single {Enter a date such as {example}.} other {Enter dates such as {example}, separated by commas.}}'",
|
|
51488
|
+
"description": "The message for text that is no date, where `bad-input-message` is not\nset. `{mode}` is `single`, `range`, or `multiple`, and `{example}` is a\ndate written as the field writes one, `August 24, 2026` in `en-US` and\n`24. August 2026` in `de-DE` at the default `date-style`.\n\n**The default names a date the field reads back.** It said \"Enter a date\nas YYYY-MM-DD.\" to a reader whose field showed `August 4, 2026`, and a\npattern token is words for a developer. Time Input says the same.",
|
|
51477
51489
|
"attribute": "unreadable-message",
|
|
51478
51490
|
"helix": {
|
|
51479
51491
|
"words": true
|
|
@@ -52425,6 +52437,21 @@
|
|
|
52425
52437
|
"module": "src/mixins/mixin-picker-field/mixin-picker-field.ts"
|
|
52426
52438
|
}
|
|
52427
52439
|
},
|
|
52440
|
+
{
|
|
52441
|
+
"kind": "method",
|
|
52442
|
+
"name": "dismiss",
|
|
52443
|
+
"privacy": "private",
|
|
52444
|
+
"return": {
|
|
52445
|
+
"type": {
|
|
52446
|
+
"text": "void"
|
|
52447
|
+
}
|
|
52448
|
+
},
|
|
52449
|
+
"description": "Escape's close, which hands focus back to the control that opened the\npanel: the trigger after its press, which is the APG date picker\ndialog's rule, and the field otherwise.\n\n**Here rather than in each family.** Color Input had the rule alone, and\nDate Input and Time Input, on the same code, put focus in the text after\nthe trigger's press: one control before where the reader had been.",
|
|
52450
|
+
"inheritedFrom": {
|
|
52451
|
+
"name": "MixinPickerField",
|
|
52452
|
+
"module": "src/mixins/mixin-picker-field/mixin-picker-field.ts"
|
|
52453
|
+
}
|
|
52454
|
+
},
|
|
52428
52455
|
{
|
|
52429
52456
|
"kind": "field",
|
|
52430
52457
|
"name": "handleFocusOut",
|
|
@@ -52461,6 +52488,20 @@
|
|
|
52461
52488
|
"module": "src/mixins/mixin-picker-field/mixin-picker-field.ts"
|
|
52462
52489
|
}
|
|
52463
52490
|
},
|
|
52491
|
+
{
|
|
52492
|
+
"kind": "field",
|
|
52493
|
+
"name": "pressedOpen",
|
|
52494
|
+
"type": {
|
|
52495
|
+
"text": "boolean"
|
|
52496
|
+
},
|
|
52497
|
+
"privacy": "private",
|
|
52498
|
+
"default": "false",
|
|
52499
|
+
"description": "Whether the trigger's press opened the panel that is open now, so Escape returns there.",
|
|
52500
|
+
"inheritedFrom": {
|
|
52501
|
+
"name": "MixinPickerField",
|
|
52502
|
+
"module": "src/mixins/mixin-picker-field/mixin-picker-field.ts"
|
|
52503
|
+
}
|
|
52504
|
+
},
|
|
52464
52505
|
{
|
|
52465
52506
|
"kind": "field",
|
|
52466
52507
|
"name": "handleKeypress",
|
|
@@ -54574,8 +54615,8 @@
|
|
|
54574
54615
|
"type": {
|
|
54575
54616
|
"text": "string"
|
|
54576
54617
|
},
|
|
54577
|
-
"default": "'{mode, select, single {Enter a date as
|
|
54578
|
-
"description": "The message for text that is no date, where `bad-input-message` is not\nset. `{mode}` is `single`, `range`, or `multiple
|
|
54618
|
+
"default": "'{mode, select, single {Enter a date such as {example}.} other {Enter dates such as {example}, separated by commas.}}'",
|
|
54619
|
+
"description": "The message for text that is no date, where `bad-input-message` is not\nset. `{mode}` is `single`, `range`, or `multiple`, and `{example}` is a\ndate written as the field writes one, `August 24, 2026` in `en-US` and\n`24. August 2026` in `de-DE` at the default `date-style`.\n\n**The default names a date the field reads back.** It said \"Enter a date\nas YYYY-MM-DD.\" to a reader whose field showed `August 4, 2026`, and a\npattern token is words for a developer. Time Input says the same.",
|
|
54579
54620
|
"fieldName": "unreadableMessage"
|
|
54580
54621
|
},
|
|
54581
54622
|
{
|
|
@@ -55202,8 +55243,8 @@
|
|
|
55202
55243
|
"type": {
|
|
55203
55244
|
"text": "string"
|
|
55204
55245
|
},
|
|
55205
|
-
"default": "'{mode, select, single {Enter a date as
|
|
55206
|
-
"description": "The validation message for a value that is not a date.\n\n**Every sentence a control raises in the browser's bubble is a property**,\nnamed for the validity flag it reports, so a form in another language\nspeaks it. Unset is the sentence registered for the page's language, then\nthe English. `{
|
|
55246
|
+
"default": "'{mode, select, single {Enter a date such as {example}.} other {Enter dates such as {example}, separated by commas.}}'",
|
|
55247
|
+
"description": "The validation message for a value that is not a date.\n\n**Every sentence a control raises in the browser's bubble is a property**,\nnamed for the validity flag it reports, so a form in another language\nspeaks it. Unset is the sentence registered for the page's language, then\nthe English. `{example}` is a date written as the calendar names one,\n`August 24, 2026` in `en-US` and `24. August 2026` in `de-DE`, and `{mode}`\nis `single`, `range` or `multiple`, so each can have its own sentence.\n\n**The default names a date in words.** It said \"Enter a date as\nYYYY-MM-DD.\", and a pattern token is words for a developer.",
|
|
55207
55248
|
"attribute": "bad-input-message",
|
|
55208
55249
|
"helix": {
|
|
55209
55250
|
"words": true
|
|
@@ -57467,8 +57508,8 @@
|
|
|
57467
57508
|
"type": {
|
|
57468
57509
|
"text": "string"
|
|
57469
57510
|
},
|
|
57470
|
-
"default": "'{mode, select, single {Enter a date as
|
|
57471
|
-
"description": "The validation message for a value that is not a date.\n\n**Every sentence a control raises in the browser's bubble is a property**,\nnamed for the validity flag it reports, so a form in another language\nspeaks it. Unset is the sentence registered for the page's language, then\nthe English. `{
|
|
57511
|
+
"default": "'{mode, select, single {Enter a date such as {example}.} other {Enter dates such as {example}, separated by commas.}}'",
|
|
57512
|
+
"description": "The validation message for a value that is not a date.\n\n**Every sentence a control raises in the browser's bubble is a property**,\nnamed for the validity flag it reports, so a form in another language\nspeaks it. Unset is the sentence registered for the page's language, then\nthe English. `{example}` is a date written as the calendar names one,\n`August 24, 2026` in `en-US` and `24. August 2026` in `de-DE`, and `{mode}`\nis `single`, `range` or `multiple`, so each can have its own sentence.\n\n**The default names a date in words.** It said \"Enter a date as\nYYYY-MM-DD.\", and a pattern token is words for a developer.",
|
|
57472
57513
|
"fieldName": "badInputMessage"
|
|
57473
57514
|
},
|
|
57474
57515
|
{
|
|
@@ -171191,6 +171232,21 @@
|
|
|
171191
171232
|
"module": "src/mixins/mixin-picker-field/mixin-picker-field.ts"
|
|
171192
171233
|
}
|
|
171193
171234
|
},
|
|
171235
|
+
{
|
|
171236
|
+
"kind": "method",
|
|
171237
|
+
"name": "dismiss",
|
|
171238
|
+
"privacy": "private",
|
|
171239
|
+
"return": {
|
|
171240
|
+
"type": {
|
|
171241
|
+
"text": "void"
|
|
171242
|
+
}
|
|
171243
|
+
},
|
|
171244
|
+
"description": "Escape's close, which hands focus back to the control that opened the\npanel: the trigger after its press, which is the APG date picker\ndialog's rule, and the field otherwise.\n\n**Here rather than in each family.** Color Input had the rule alone, and\nDate Input and Time Input, on the same code, put focus in the text after\nthe trigger's press: one control before where the reader had been.",
|
|
171245
|
+
"inheritedFrom": {
|
|
171246
|
+
"name": "MixinPickerField",
|
|
171247
|
+
"module": "src/mixins/mixin-picker-field/mixin-picker-field.ts"
|
|
171248
|
+
}
|
|
171249
|
+
},
|
|
171194
171250
|
{
|
|
171195
171251
|
"kind": "field",
|
|
171196
171252
|
"name": "handleFocusOut",
|
|
@@ -171227,6 +171283,20 @@
|
|
|
171227
171283
|
"module": "src/mixins/mixin-picker-field/mixin-picker-field.ts"
|
|
171228
171284
|
}
|
|
171229
171285
|
},
|
|
171286
|
+
{
|
|
171287
|
+
"kind": "field",
|
|
171288
|
+
"name": "pressedOpen",
|
|
171289
|
+
"type": {
|
|
171290
|
+
"text": "boolean"
|
|
171291
|
+
},
|
|
171292
|
+
"privacy": "private",
|
|
171293
|
+
"default": "false",
|
|
171294
|
+
"description": "Whether the trigger's press opened the panel that is open now, so Escape returns there.",
|
|
171295
|
+
"inheritedFrom": {
|
|
171296
|
+
"name": "MixinPickerField",
|
|
171297
|
+
"module": "src/mixins/mixin-picker-field/mixin-picker-field.ts"
|
|
171298
|
+
}
|
|
171299
|
+
},
|
|
171230
171300
|
{
|
|
171231
171301
|
"kind": "field",
|
|
171232
171302
|
"name": "handleKeypress",
|
|
@@ -173868,8 +173938,8 @@
|
|
|
173868
173938
|
"type": {
|
|
173869
173939
|
"text": "string"
|
|
173870
173940
|
},
|
|
173871
|
-
"default": "'{mode, select, single {Enter a time as {
|
|
173872
|
-
"description": "The validation message for a value that is not a time.\n\n**Every sentence a control raises in the browser's bubble is a property**,\nnamed for the validity flag it reports, so a form in another language\nspeaks it. Unset is the sentence registered for the page's language, then\nthe English. `{
|
|
173941
|
+
"default": "'{mode, select, single {Enter a time such as {example}.} other {Enter times such as {example}, separated by commas.}}'",
|
|
173942
|
+
"description": "The validation message for a value that is not a time.\n\n**Every sentence a control raises in the browser's bubble is a property**,\nnamed for the validity flag it reports, so a form in another language\nspeaks it. Unset is the sentence registered for the page's language, then\nthe English. `{example}` is a time written as the picker writes one,\n`2:30 PM` in `en-US` and `14:30` in `de-DE`, `{shape}` is `HH:mm` or\n`HH:mm:ss`, and `{mode}` is `single`, `range` or `multiple`, so each can\nhave its own sentence.\n\n**The default names a time as the picker shows one.** It said \"Enter a\ntime as HH:mm.\" to a reader whose list showed `2:30 PM`, and a pattern\ntoken is words for a developer. Time Input says the same.",
|
|
173873
173943
|
"attribute": "bad-input-message",
|
|
173874
173944
|
"helix": {
|
|
173875
173945
|
"words": true
|
|
@@ -175886,8 +175956,8 @@
|
|
|
175886
175956
|
"type": {
|
|
175887
175957
|
"text": "string"
|
|
175888
175958
|
},
|
|
175889
|
-
"default": "'{mode, select, single {Enter a time as {
|
|
175890
|
-
"description": "The validation message for a value that is not a time.\n\n**Every sentence a control raises in the browser's bubble is a property**,\nnamed for the validity flag it reports, so a form in another language\nspeaks it. Unset is the sentence registered for the page's language, then\nthe English. `{
|
|
175959
|
+
"default": "'{mode, select, single {Enter a time such as {example}.} other {Enter times such as {example}, separated by commas.}}'",
|
|
175960
|
+
"description": "The validation message for a value that is not a time.\n\n**Every sentence a control raises in the browser's bubble is a property**,\nnamed for the validity flag it reports, so a form in another language\nspeaks it. Unset is the sentence registered for the page's language, then\nthe English. `{example}` is a time written as the picker writes one,\n`2:30 PM` in `en-US` and `14:30` in `de-DE`, `{shape}` is `HH:mm` or\n`HH:mm:ss`, and `{mode}` is `single`, `range` or `multiple`, so each can\nhave its own sentence.\n\n**The default names a time as the picker shows one.** It said \"Enter a\ntime as HH:mm.\" to a reader whose list showed `2:30 PM`, and a pattern\ntoken is words for a developer. Time Input says the same.",
|
|
175891
175961
|
"fieldName": "badInputMessage"
|
|
175892
175962
|
},
|
|
175893
175963
|
{
|
|
@@ -198932,6 +199002,6 @@
|
|
|
198932
199002
|
],
|
|
198933
199003
|
"helix": {
|
|
198934
199004
|
"package": "@fusion.dev/helix-headless",
|
|
198935
|
-
"version": "0.177.
|
|
199005
|
+
"version": "0.177.2"
|
|
198936
199006
|
}
|
|
198937
199007
|
}
|
|
@@ -306,19 +306,6 @@ export declare class HelixHeadlessColorInput extends HelixHeadlessColorInput_bas
|
|
|
306
306
|
*/
|
|
307
307
|
protected sync(): void;
|
|
308
308
|
protected updated(changed: PropertyValues): void;
|
|
309
|
-
/** Whether the trigger's press opened the panel that is open now. */
|
|
310
|
-
private pressedOpen;
|
|
311
|
-
/**
|
|
312
|
-
* The trigger's press, which notes that it opened the panel, so Escape hands
|
|
313
|
-
* focus back to the trigger.
|
|
314
|
-
*/
|
|
315
|
-
private readonly handlePress;
|
|
316
|
-
/**
|
|
317
|
-
* Hands focus back to the control that opened the panel: the trigger after
|
|
318
|
-
* its press, which is the APG date picker dialog's rule, and the text after
|
|
319
|
-
* ArrowDown from it.
|
|
320
|
-
*/
|
|
321
|
-
protected returnFocus(): void;
|
|
322
309
|
/**
|
|
323
310
|
* The picker the field opens, behind a seam the styled tier can move.
|
|
324
311
|
*
|
|
@@ -55,12 +55,6 @@ let HelixHeadlessColorInput = class HelixHeadlessColorInput extends MixinPickerF
|
|
|
55
55
|
this.handleSampleEnd = () => {
|
|
56
56
|
this.requestOpen(true);
|
|
57
57
|
};
|
|
58
|
-
this.pressedOpen = false;
|
|
59
|
-
this.handlePress = () => {
|
|
60
|
-
const opening = !this.open;
|
|
61
|
-
this.handleTriggerClick();
|
|
62
|
-
this.pressedOpen = opening && this.open;
|
|
63
|
-
};
|
|
64
58
|
}
|
|
65
59
|
static { this.words = 'helix-color-input'; }
|
|
66
60
|
requestValue(next) {
|
|
@@ -123,18 +117,6 @@ let HelixHeadlessColorInput = class HelixHeadlessColorInput extends MixinPickerF
|
|
|
123
117
|
if (changed.has('value') && parseColor(this.value)) {
|
|
124
118
|
this.settled = this.value;
|
|
125
119
|
}
|
|
126
|
-
if (changed.has('open') && !this.open) {
|
|
127
|
-
this.pressedOpen = false;
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
returnFocus() {
|
|
131
|
-
const trigger = this.pressedOpen ? this.partNamed('trigger') : null;
|
|
132
|
-
this.pressedOpen = false;
|
|
133
|
-
if (trigger) {
|
|
134
|
-
trigger.focus();
|
|
135
|
-
return;
|
|
136
|
-
}
|
|
137
|
-
super.returnFocus();
|
|
138
120
|
}
|
|
139
121
|
renderPicker() {
|
|
140
122
|
return html `<${this.tag('color-picker')}
|
|
@@ -222,7 +204,7 @@ let HelixHeadlessColorInput = class HelixHeadlessColorInput extends MixinPickerF
|
|
|
222
204
|
: 'swatch-value'
|
|
223
205
|
: nothing}
|
|
224
206
|
?disabled=${this.isDisabled}
|
|
225
|
-
@click=${this.
|
|
207
|
+
@click=${this.handleTriggerClick}
|
|
226
208
|
>
|
|
227
209
|
<span
|
|
228
210
|
part="preview"
|
|
@@ -486,7 +486,13 @@ export declare class HelixHeadlessDateInput extends HelixHeadlessDateInput_base
|
|
|
486
486
|
unavailableMessage: string;
|
|
487
487
|
/**
|
|
488
488
|
* The message for text that is no date, where `bad-input-message` is not
|
|
489
|
-
* set. `{mode}` is `single`, `range`, or `multiple
|
|
489
|
+
* set. `{mode}` is `single`, `range`, or `multiple`, and `{example}` is a
|
|
490
|
+
* date written as the field writes one, `August 24, 2026` in `en-US` and
|
|
491
|
+
* `24. August 2026` in `de-DE` at the default `date-style`.
|
|
492
|
+
*
|
|
493
|
+
* **The default names a date the field reads back.** It said "Enter a date
|
|
494
|
+
* as YYYY-MM-DD." to a reader whose field showed `August 4, 2026`, and a
|
|
495
|
+
* pattern token is words for a developer. Time Input says the same.
|
|
490
496
|
*/
|
|
491
497
|
unreadableMessage: string;
|
|
492
498
|
/**
|
|
@@ -12,6 +12,7 @@ import { unsafeSVG } from 'lit/directives/unsafe-svg.js';
|
|
|
12
12
|
import { html } from 'lit/static-html.js';
|
|
13
13
|
import '../../date-picker/index.js';
|
|
14
14
|
import '../../tag/root/index.js';
|
|
15
|
+
const EXAMPLE = '2026-08-24';
|
|
15
16
|
const dates = (value) => value
|
|
16
17
|
.replace(/\s+[–-]\s+/g, ',')
|
|
17
18
|
.split(',')
|
|
@@ -119,7 +120,7 @@ let HelixHeadlessDateInput = class HelixHeadlessDateInput extends MixinSegmented
|
|
|
119
120
|
}
|
|
120
121
|
};
|
|
121
122
|
this.unavailableMessage = 'Choose a date that is available.';
|
|
122
|
-
this.unreadableMessage = '{mode, select, single {Enter a date as
|
|
123
|
+
this.unreadableMessage = '{mode, select, single {Enter a date such as {example}.} other {Enter dates such as {example}, separated by commas.}}';
|
|
123
124
|
this.yearViewLabel = '{heading}. Choose a year';
|
|
124
125
|
this.handleIconChange = () => {
|
|
125
126
|
this.requestUpdate();
|
|
@@ -232,7 +233,10 @@ let HelixHeadlessDateInput = class HelixHeadlessDateInput extends MixinSegmented
|
|
|
232
233
|
const held = dates(this.value);
|
|
233
234
|
if (held.length > 0 && !held.every(isDateValue)) {
|
|
234
235
|
return (this.badInputMessage ||
|
|
235
|
-
formatWords(this, 'unreadableMessage', {
|
|
236
|
+
formatWords(this, 'unreadableMessage', {
|
|
237
|
+
example: this.written(EXAMPLE),
|
|
238
|
+
mode: this.mode ?? 'single',
|
|
239
|
+
}));
|
|
236
240
|
}
|
|
237
241
|
if (this.min !== '' && held.some((one) => one < this.min)) {
|
|
238
242
|
return [
|
|
@@ -117,8 +117,12 @@ export declare class HelixHeadlessDatePicker extends HelixHeadlessDatePicker_bas
|
|
|
117
117
|
* **Every sentence a control raises in the browser's bubble is a property**,
|
|
118
118
|
* named for the validity flag it reports, so a form in another language
|
|
119
119
|
* speaks it. Unset is the sentence registered for the page's language, then
|
|
120
|
-
* the English. `{
|
|
121
|
-
*
|
|
120
|
+
* the English. `{example}` is a date written as the calendar names one,
|
|
121
|
+
* `August 24, 2026` in `en-US` and `24. August 2026` in `de-DE`, and `{mode}`
|
|
122
|
+
* is `single`, `range` or `multiple`, so each can have its own sentence.
|
|
123
|
+
*
|
|
124
|
+
* **The default names a date in words.** It said "Enter a date as
|
|
125
|
+
* YYYY-MM-DD.", and a pattern token is words for a developer.
|
|
122
126
|
*/
|
|
123
127
|
badInputMessage: string;
|
|
124
128
|
/**
|
|
@@ -9,6 +9,7 @@ import { caretLeft, caretRight } from '@fusion.dev/helix-icons';
|
|
|
9
9
|
import { html, nothing } from 'lit';
|
|
10
10
|
import { property, state } from 'lit/decorators.js';
|
|
11
11
|
import { unsafeSVG } from 'lit/directives/unsafe-svg.js';
|
|
12
|
+
const EXAMPLE = '2026-08-24';
|
|
12
13
|
const KEYS = new Set([
|
|
13
14
|
'ArrowDown',
|
|
14
15
|
'ArrowLeft',
|
|
@@ -25,7 +26,7 @@ const firstOf = (year, month) => addMonths(asDate('2000-01-01'), (year - 2000) *
|
|
|
25
26
|
let HelixHeadlessDatePicker = class HelixHeadlessDatePicker extends MixinPickerFeedback(MixinControllerValue(HelixFormElement)) {
|
|
26
27
|
constructor() {
|
|
27
28
|
super(...arguments);
|
|
28
|
-
this.badInputMessage = '{mode, select, single {Enter a date as
|
|
29
|
+
this.badInputMessage = '{mode, select, single {Enter a date such as {example}.} other {Enter dates such as {example}, separated by commas.}}';
|
|
29
30
|
this.defaultMonth = '';
|
|
30
31
|
this.disableDates = '';
|
|
31
32
|
this.disableDays = '';
|
|
@@ -491,7 +492,10 @@ let HelixHeadlessDatePicker = class HelixHeadlessDatePicker extends MixinPickerF
|
|
|
491
492
|
if (held.length > 0 && held.some((one) => asDate(one) === null)) {
|
|
492
493
|
return [
|
|
493
494
|
{ badInput: true },
|
|
494
|
-
formatWords(this, 'badInputMessage', {
|
|
495
|
+
formatWords(this, 'badInputMessage', {
|
|
496
|
+
example: this.spoken(EXAMPLE),
|
|
497
|
+
mode: this.mode ?? 'single',
|
|
498
|
+
}),
|
|
495
499
|
];
|
|
496
500
|
}
|
|
497
501
|
for (const one of held) {
|
|
@@ -131,9 +131,14 @@ export declare class HelixHeadlessTimePicker extends HelixHeadlessTimePicker_bas
|
|
|
131
131
|
* **Every sentence a control raises in the browser's bubble is a property**,
|
|
132
132
|
* named for the validity flag it reports, so a form in another language
|
|
133
133
|
* speaks it. Unset is the sentence registered for the page's language, then
|
|
134
|
-
* the English. `{
|
|
135
|
-
* `
|
|
136
|
-
*
|
|
134
|
+
* the English. `{example}` is a time written as the picker writes one,
|
|
135
|
+
* `2:30 PM` in `en-US` and `14:30` in `de-DE`, `{shape}` is `HH:mm` or
|
|
136
|
+
* `HH:mm:ss`, and `{mode}` is `single`, `range` or `multiple`, so each can
|
|
137
|
+
* have its own sentence.
|
|
138
|
+
*
|
|
139
|
+
* **The default names a time as the picker shows one.** It said "Enter a
|
|
140
|
+
* time as HH:mm." to a reader whose list showed `2:30 PM`, and a pattern
|
|
141
|
+
* token is words for a developer. Time Input says the same.
|
|
137
142
|
*/
|
|
138
143
|
badInputMessage: string;
|
|
139
144
|
/**
|
|
@@ -14,7 +14,7 @@ import '../../option/root/index.js';
|
|
|
14
14
|
let HelixHeadlessTimePicker = class HelixHeadlessTimePicker extends MixinPickerFeedback(MixinControllerValue(HelixFormElement)) {
|
|
15
15
|
constructor() {
|
|
16
16
|
super(...arguments);
|
|
17
|
-
this.badInputMessage = '{mode, select, single {Enter a time as {
|
|
17
|
+
this.badInputMessage = '{mode, select, single {Enter a time such as {example}.} other {Enter times such as {example}, separated by commas.}}';
|
|
18
18
|
this.disableTimes = '';
|
|
19
19
|
this.emptyText = 'No times to choose from';
|
|
20
20
|
this.hint = '';
|
|
@@ -300,6 +300,7 @@ let HelixHeadlessTimePicker = class HelixHeadlessTimePicker extends MixinPickerF
|
|
|
300
300
|
return [
|
|
301
301
|
{ badInput: true },
|
|
302
302
|
formatWords(this, 'badInputMessage', {
|
|
303
|
+
example: writeClock(this.seconds ? '14:30:15' : '14:30', this.clock, this.seconds),
|
|
303
304
|
mode: this.mode ?? 'single',
|
|
304
305
|
shape: this.seconds ? 'HH:mm:ss' : 'HH:mm',
|
|
305
306
|
}),
|