@vaadin/date-picker 25.1.2 → 25.2.0-alpha10

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.
@@ -285,7 +285,7 @@ class DatePicker extends DatePickerMixin(
285
285
  _onVaadinOverlayClose(e) {
286
286
  // Prevent closing the overlay on label element click
287
287
  const event = e.detail.sourceEvent;
288
- if (event && event.composedPath().includes(this) && !event.composedPath().includes(this._overlayElement)) {
288
+ if (event?.composedPath().includes(this) && !event.composedPath().includes(this._overlayElement)) {
289
289
  e.preventDefault();
290
290
  }
291
291
  }
@@ -244,7 +244,7 @@ export const MonthCalendarMixin = (superClass) =>
244
244
  /** @protected */
245
245
  __computeShowWeekSeparator(showWeekNumbers, i18n) {
246
246
  // Currently only supported for locales that start the week on Monday.
247
- return showWeekNumbers && i18n && i18n.firstDayOfWeek === 1;
247
+ return showWeekNumbers && i18n?.firstDayOfWeek === 1;
248
248
  }
249
249
 
250
250
  /** @protected */
package/web-types.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/web-types",
3
3
  "name": "@vaadin/date-picker",
4
- "version": "25.1.2",
4
+ "version": "25.2.0-alpha10",
5
5
  "description-markup": "markdown",
6
6
  "contributions": {
7
7
  "html": {
@@ -15,9 +15,7 @@
15
15
  "description": "String used to label the component to screen reader users.",
16
16
  "value": {
17
17
  "type": [
18
- "string",
19
- "null",
20
- "undefined"
18
+ "string"
21
19
  ]
22
20
  }
23
21
  },
@@ -26,9 +24,7 @@
26
24
  "description": "Id of the element used as label of the component to screen reader users.",
27
25
  "value": {
28
26
  "type": [
29
- "string",
30
- "null",
31
- "undefined"
27
+ "string"
32
28
  ]
33
29
  }
34
30
  },
@@ -37,9 +33,7 @@
37
33
  "description": "A pattern matched against individual characters the user inputs.\n\nWhen set, the field will prevent:\n- `keydown` events if the entered key doesn't match `/^allowedCharPattern$/`\n- `paste` events if the pasted text doesn't match `/^allowedCharPattern*$/`\n- `drop` events if the dropped text doesn't match `/^allowedCharPattern*$/`\n\nFor example, to allow entering only numbers and minus signs, use:\n`allowedCharPattern = \"[\\\\d-]\"`",
38
34
  "value": {
39
35
  "type": [
40
- "string",
41
- "null",
42
- "undefined"
36
+ "string"
43
37
  ]
44
38
  }
45
39
  },
@@ -48,9 +42,7 @@
48
42
  "description": "Set true to prevent the overlay from opening automatically.",
49
43
  "value": {
50
44
  "type": [
51
- "boolean",
52
- "null",
53
- "undefined"
45
+ "boolean"
54
46
  ]
55
47
  }
56
48
  },
@@ -59,9 +51,7 @@
59
51
  "description": "Specify that this control should have input focus when the page loads.",
60
52
  "value": {
61
53
  "type": [
62
- "boolean",
63
- "null",
64
- "undefined"
54
+ "boolean"
65
55
  ]
66
56
  }
67
57
  },
@@ -70,9 +60,7 @@
70
60
  "description": "If true, the input text gets fully selected when the field is focused using click or touch / tap.",
71
61
  "value": {
72
62
  "type": [
73
- "boolean",
74
- "null",
75
- "undefined"
63
+ "boolean"
76
64
  ]
77
65
  }
78
66
  },
@@ -81,9 +69,7 @@
81
69
  "description": "Set to true to display the clear icon which clears the input.\n\nIt is up to the component to choose where to place the clear icon:\nin the Shadow DOM or in the light DOM. In any way, a reference to\nthe clear icon element should be provided via the `clearElement` getter.",
82
70
  "value": {
83
71
  "type": [
84
- "boolean",
85
- "null",
86
- "undefined"
72
+ "boolean"
87
73
  ]
88
74
  }
89
75
  },
@@ -92,9 +78,7 @@
92
78
  "description": "If true, the user cannot interact with this element.",
93
79
  "value": {
94
80
  "type": [
95
- "boolean",
96
- "null",
97
- "undefined"
81
+ "boolean"
98
82
  ]
99
83
  }
100
84
  },
@@ -103,9 +87,7 @@
103
87
  "description": "Error to show when the field is invalid.",
104
88
  "value": {
105
89
  "type": [
106
- "string",
107
- "null",
108
- "undefined"
90
+ "string"
109
91
  ]
110
92
  }
111
93
  },
@@ -114,20 +96,7 @@
114
96
  "description": "String used for the helper text.",
115
97
  "value": {
116
98
  "type": [
117
- "string",
118
- "null",
119
- "undefined"
120
- ]
121
- }
122
- },
123
- {
124
- "name": "i18n",
125
- "description": "The object used to localize this component. To change the default\nlocalization, replace this with an object that provides all properties, or\njust the individual properties you want to change.\n\nShould be overridden by subclasses to provide a custom JSDoc with the\ndefault I18N properties.",
126
- "value": {
127
- "type": [
128
- "Object",
129
- "null",
130
- "undefined"
99
+ "string"
131
100
  ]
132
101
  }
133
102
  },
@@ -136,9 +105,7 @@
136
105
  "description": "Date which should be visible when there is no value selected.\n\nThe same date formats as for the `value` property are supported.",
137
106
  "value": {
138
107
  "type": [
139
- "string",
140
- "null",
141
- "undefined"
108
+ "string"
142
109
  ]
143
110
  }
144
111
  },
@@ -147,9 +114,7 @@
147
114
  "description": "Set to true when the field is invalid.",
148
115
  "value": {
149
116
  "type": [
150
- "boolean",
151
- "null",
152
- "undefined"
117
+ "boolean"
153
118
  ]
154
119
  }
155
120
  },
@@ -158,9 +123,7 @@
158
123
  "description": "The label text for the input node.\nWhen no light dom defined via [slot=label], this value will be used.",
159
124
  "value": {
160
125
  "type": [
161
- "string",
162
- "null",
163
- "undefined"
126
+ "string"
164
127
  ]
165
128
  }
166
129
  },
@@ -169,9 +132,7 @@
169
132
  "description": "Set to true to enable manual validation mode. This mode disables automatic\nconstraint validation, allowing you to control the validation process yourself.\nYou can still trigger constraint validation manually with the `validate()` method\nor use `checkValidity()` to assess the component's validity without affecting\nthe invalid state. In manual validation mode, you can also manipulate\nthe `invalid` property directly through your application logic without conflicts\nwith the component's internal validation.",
170
133
  "value": {
171
134
  "type": [
172
- "boolean",
173
- "null",
174
- "undefined"
135
+ "boolean"
175
136
  ]
176
137
  }
177
138
  },
@@ -180,9 +141,7 @@
180
141
  "description": "The latest date that can be selected. All later dates will be disabled.\n\nSupported date formats:\n- ISO 8601 `\"YYYY-MM-DD\"` (default)\n- 6-digit extended ISO 8601 `\"+YYYYYY-MM-DD\"`, `\"-YYYYYY-MM-DD\"`",
181
142
  "value": {
182
143
  "type": [
183
- "string",
184
- "null",
185
- "undefined"
144
+ "string"
186
145
  ]
187
146
  }
188
147
  },
@@ -191,9 +150,7 @@
191
150
  "description": "The earliest date that can be selected. All earlier dates will be disabled.\n\nSupported date formats:\n- ISO 8601 `\"YYYY-MM-DD\"` (default)\n- 6-digit extended ISO 8601 `\"+YYYYYY-MM-DD\"`, `\"-YYYYYY-MM-DD\"`",
192
151
  "value": {
193
152
  "type": [
194
- "string",
195
- "null",
196
- "undefined"
153
+ "string"
197
154
  ]
198
155
  }
199
156
  },
@@ -202,9 +159,7 @@
202
159
  "description": "The name of this field.",
203
160
  "value": {
204
161
  "type": [
205
- "string",
206
- "null",
207
- "undefined"
162
+ "string"
208
163
  ]
209
164
  }
210
165
  },
@@ -213,9 +168,7 @@
213
168
  "description": "Set true to open the date selector overlay.",
214
169
  "value": {
215
170
  "type": [
216
- "boolean",
217
- "null",
218
- "undefined"
171
+ "boolean"
219
172
  ]
220
173
  }
221
174
  },
@@ -224,9 +177,7 @@
224
177
  "description": "A hint to the user of what can be entered in the field.",
225
178
  "value": {
226
179
  "type": [
227
- "string",
228
- "null",
229
- "undefined"
180
+ "string"
230
181
  ]
231
182
  }
232
183
  },
@@ -235,9 +186,7 @@
235
186
  "description": "When present, it specifies that the field is read-only.",
236
187
  "value": {
237
188
  "type": [
238
- "boolean",
239
- "null",
240
- "undefined"
189
+ "boolean"
241
190
  ]
242
191
  }
243
192
  },
@@ -246,9 +195,7 @@
246
195
  "description": "Specifies that the user must fill in a value.",
247
196
  "value": {
248
197
  "type": [
249
- "boolean",
250
- "null",
251
- "undefined"
198
+ "boolean"
252
199
  ]
253
200
  }
254
201
  },
@@ -257,9 +204,7 @@
257
204
  "description": "Set true to display ISO-8601 week numbers in the calendar. Notice that\ndisplaying week numbers is only supported when `i18n.firstDayOfWeek`\nis 1 (Monday).",
258
205
  "value": {
259
206
  "type": [
260
- "boolean",
261
- "null",
262
- "undefined"
207
+ "boolean"
263
208
  ]
264
209
  }
265
210
  },
@@ -279,9 +224,7 @@
279
224
  "description": "The text usually displayed in a tooltip popup when the mouse is over the field.",
280
225
  "value": {
281
226
  "type": [
282
- "string",
283
- "null",
284
- "undefined"
227
+ "string"
285
228
  ]
286
229
  }
287
230
  },
@@ -290,9 +233,7 @@
290
233
  "description": "Selected date.\n\nSupported date formats:\n- ISO 8601 `\"YYYY-MM-DD\"` (default)\n- 6-digit extended ISO 8601 `\"+YYYYYY-MM-DD\"`, `\"-YYYYYY-MM-DD\"`",
291
234
  "value": {
292
235
  "type": [
293
- "string",
294
- "null",
295
- "undefined"
236
+ "string"
296
237
  ]
297
238
  }
298
239
  }
@@ -304,9 +245,7 @@
304
245
  "description": "String used to label the component to screen reader users.",
305
246
  "value": {
306
247
  "type": [
307
- "string",
308
- "null",
309
- "undefined"
248
+ "string"
310
249
  ]
311
250
  }
312
251
  },
@@ -315,9 +254,7 @@
315
254
  "description": "Id of the element used as label of the component to screen reader users.",
316
255
  "value": {
317
256
  "type": [
318
- "string",
319
- "null",
320
- "undefined"
257
+ "string"
321
258
  ]
322
259
  }
323
260
  },
@@ -326,9 +263,7 @@
326
263
  "description": "A pattern matched against individual characters the user inputs.\n\nWhen set, the field will prevent:\n- `keydown` events if the entered key doesn't match `/^allowedCharPattern$/`\n- `paste` events if the pasted text doesn't match `/^allowedCharPattern*$/`\n- `drop` events if the dropped text doesn't match `/^allowedCharPattern*$/`\n\nFor example, to allow entering only numbers and minus signs, use:\n`allowedCharPattern = \"[\\\\d-]\"`",
327
264
  "value": {
328
265
  "type": [
329
- "string",
330
- "null",
331
- "undefined"
266
+ "string"
332
267
  ]
333
268
  }
334
269
  },
@@ -337,9 +272,7 @@
337
272
  "description": "Specify that this control should have input focus when the page loads.",
338
273
  "value": {
339
274
  "type": [
340
- "boolean",
341
- "null",
342
- "undefined"
275
+ "boolean"
343
276
  ]
344
277
  }
345
278
  },
@@ -348,9 +281,7 @@
348
281
  "description": "Set true to prevent the overlay from opening automatically.",
349
282
  "value": {
350
283
  "type": [
351
- "boolean",
352
- "null",
353
- "undefined"
284
+ "boolean"
354
285
  ]
355
286
  }
356
287
  },
@@ -359,9 +290,7 @@
359
290
  "description": "If true, the input text gets fully selected when the field is focused using click or touch / tap.",
360
291
  "value": {
361
292
  "type": [
362
- "boolean",
363
- "null",
364
- "undefined"
293
+ "boolean"
365
294
  ]
366
295
  }
367
296
  },
@@ -370,9 +299,7 @@
370
299
  "description": "Set to true to display the clear icon which clears the input.\n\nIt is up to the component to choose where to place the clear icon:\nin the Shadow DOM or in the light DOM. In any way, a reference to\nthe clear icon element should be provided via the `clearElement` getter.",
371
300
  "value": {
372
301
  "type": [
373
- "boolean",
374
- "null",
375
- "undefined"
302
+ "boolean"
376
303
  ]
377
304
  }
378
305
  },
@@ -381,9 +308,7 @@
381
308
  "description": "If true, the user cannot interact with this element.",
382
309
  "value": {
383
310
  "type": [
384
- "boolean",
385
- "null",
386
- "undefined"
311
+ "boolean"
387
312
  ]
388
313
  }
389
314
  },
@@ -392,9 +317,7 @@
392
317
  "description": "Error to show when the field is invalid.",
393
318
  "value": {
394
319
  "type": [
395
- "string",
396
- "null",
397
- "undefined"
320
+ "string"
398
321
  ]
399
322
  }
400
323
  },
@@ -403,9 +326,7 @@
403
326
  "description": "String used for the helper text.",
404
327
  "value": {
405
328
  "type": [
406
- "string",
407
- "null",
408
- "undefined"
329
+ "string"
409
330
  ]
410
331
  }
411
332
  },
@@ -414,7 +335,7 @@
414
335
  "description": "The object used to localize this component. To change the default\nlocalization, replace this with an object that provides all properties, or\njust the individual properties you want to change.\n\nThe object has the following JSON structure and default values:\n\n```js\n{\n // An array with the full names of months starting\n // with January.\n monthNames: [\n 'January', 'February', 'March', 'April', 'May',\n 'June', 'July', 'August', 'September',\n 'October', 'November', 'December'\n ],\n\n // An array of weekday names starting with Sunday. Used\n // in screen reader announcements.\n weekdays: [\n 'Sunday', 'Monday', 'Tuesday', 'Wednesday',\n 'Thursday', 'Friday', 'Saturday'\n ],\n\n // An array of short weekday names starting with Sunday.\n // Displayed in the calendar.\n weekdaysShort: [\n 'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'\n ],\n\n // An integer indicating the first day of the week\n // (0 = Sunday, 1 = Monday, etc.).\n firstDayOfWeek: 0,\n\n // Translation of the Today shortcut button text.\n today: 'Today',\n\n // Translation of the Cancel button text.\n cancel: 'Cancel',\n\n // Used for adjusting the year value when parsing dates with short years.\n // The year values between 0 and 99 are evaluated and adjusted.\n // Example: for a referenceDate of 1970-10-30;\n // dateToBeParsed: 40-10-30, result: 1940-10-30\n // dateToBeParsed: 80-10-30, result: 1980-10-30\n // dateToBeParsed: 10-10-30, result: 2010-10-30\n // Supported date format: ISO 8601 `\"YYYY-MM-DD\"` (default)\n // The default value is the current date.\n referenceDate: '',\n\n // A function to format given `Object` as\n // date string. Object is in the format `{ day: ..., month: ..., year: ... }`\n // Note: The argument month is 0-based. This means that January = 0 and December = 11.\n formatDate: d => {\n // returns a string representation of the given\n // object in 'MM/DD/YYYY' -format\n },\n\n // A function to parse the given text to an `Object` in the format `{ day: ..., month: ..., year: ... }`.\n // Must properly parse (at least) text formatted by `formatDate`.\n // Setting the property to null will disable keyboard input feature.\n // Note: The argument month is 0-based. This means that January = 0 and December = 11.\n parseDate: text => {\n // Parses a string in 'MM/DD/YY', 'MM/DD' or 'DD' -format to\n // an `Object` in the format `{ day: ..., month: ..., year: ... }`.\n }\n\n // A function to format given `monthName` and\n // `fullYear` integer as calendar title string.\n formatTitle: (monthName, fullYear) => {\n return monthName + ' ' + fullYear;\n }\n}\n```",
415
336
  "value": {
416
337
  "type": [
417
- "?"
338
+ "Object"
418
339
  ]
419
340
  }
420
341
  },
@@ -423,9 +344,7 @@
423
344
  "description": "Date which should be visible when there is no value selected.\n\nThe same date formats as for the `value` property are supported.",
424
345
  "value": {
425
346
  "type": [
426
- "string",
427
- "null",
428
- "undefined"
347
+ "string"
429
348
  ]
430
349
  }
431
350
  },
@@ -434,9 +353,7 @@
434
353
  "description": "Set to true when the field is invalid.",
435
354
  "value": {
436
355
  "type": [
437
- "boolean",
438
- "null",
439
- "undefined"
356
+ "boolean"
440
357
  ]
441
358
  }
442
359
  },
@@ -455,9 +372,7 @@
455
372
  "description": "The label text for the input node.\nWhen no light dom defined via [slot=label], this value will be used.",
456
373
  "value": {
457
374
  "type": [
458
- "string",
459
- "null",
460
- "undefined"
375
+ "string"
461
376
  ]
462
377
  }
463
378
  },
@@ -466,9 +381,7 @@
466
381
  "description": "Set to true to enable manual validation mode. This mode disables automatic\nconstraint validation, allowing you to control the validation process yourself.\nYou can still trigger constraint validation manually with the `validate()` method\nor use `checkValidity()` to assess the component's validity without affecting\nthe invalid state. In manual validation mode, you can also manipulate\nthe `invalid` property directly through your application logic without conflicts\nwith the component's internal validation.",
467
382
  "value": {
468
383
  "type": [
469
- "boolean",
470
- "null",
471
- "undefined"
384
+ "boolean"
472
385
  ]
473
386
  }
474
387
  },
@@ -477,9 +390,7 @@
477
390
  "description": "The latest date that can be selected. All later dates will be disabled.\n\nSupported date formats:\n- ISO 8601 `\"YYYY-MM-DD\"` (default)\n- 6-digit extended ISO 8601 `\"+YYYYYY-MM-DD\"`, `\"-YYYYYY-MM-DD\"`",
478
391
  "value": {
479
392
  "type": [
480
- "string",
481
- "null",
482
- "undefined"
393
+ "string"
483
394
  ]
484
395
  }
485
396
  },
@@ -488,9 +399,7 @@
488
399
  "description": "The earliest date that can be selected. All earlier dates will be disabled.\n\nSupported date formats:\n- ISO 8601 `\"YYYY-MM-DD\"` (default)\n- 6-digit extended ISO 8601 `\"+YYYYYY-MM-DD\"`, `\"-YYYYYY-MM-DD\"`",
489
400
  "value": {
490
401
  "type": [
491
- "string",
492
- "null",
493
- "undefined"
402
+ "string"
494
403
  ]
495
404
  }
496
405
  },
@@ -499,9 +408,7 @@
499
408
  "description": "The name of this field.",
500
409
  "value": {
501
410
  "type": [
502
- "string",
503
- "null",
504
- "undefined"
411
+ "string"
505
412
  ]
506
413
  }
507
414
  },
@@ -510,9 +417,7 @@
510
417
  "description": "Set true to open the date selector overlay.",
511
418
  "value": {
512
419
  "type": [
513
- "boolean",
514
- "null",
515
- "undefined"
420
+ "boolean"
516
421
  ]
517
422
  }
518
423
  },
@@ -521,9 +426,7 @@
521
426
  "description": "A hint to the user of what can be entered in the field.",
522
427
  "value": {
523
428
  "type": [
524
- "string",
525
- "null",
526
- "undefined"
429
+ "string"
527
430
  ]
528
431
  }
529
432
  },
@@ -532,9 +435,7 @@
532
435
  "description": "When present, it specifies that the field is read-only.",
533
436
  "value": {
534
437
  "type": [
535
- "boolean",
536
- "null",
537
- "undefined"
438
+ "boolean"
538
439
  ]
539
440
  }
540
441
  },
@@ -543,9 +444,7 @@
543
444
  "description": "Specifies that the user must fill in a value.",
544
445
  "value": {
545
446
  "type": [
546
- "boolean",
547
- "null",
548
- "undefined"
447
+ "boolean"
549
448
  ]
550
449
  }
551
450
  },
@@ -554,9 +453,7 @@
554
453
  "description": "Set true to display ISO-8601 week numbers in the calendar. Notice that\ndisplaying week numbers is only supported when `i18n.firstDayOfWeek`\nis 1 (Monday).",
555
454
  "value": {
556
455
  "type": [
557
- "boolean",
558
- "null",
559
- "undefined"
456
+ "boolean"
560
457
  ]
561
458
  }
562
459
  },
@@ -565,9 +462,7 @@
565
462
  "description": "The text usually displayed in a tooltip popup when the mouse is over the field.",
566
463
  "value": {
567
464
  "type": [
568
- "string",
569
- "null",
570
- "undefined"
465
+ "string"
571
466
  ]
572
467
  }
573
468
  },
@@ -576,9 +471,7 @@
576
471
  "description": "Selected date.\n\nSupported date formats:\n- ISO 8601 `\"YYYY-MM-DD\"` (default)\n- 6-digit extended ISO 8601 `\"+YYYYYY-MM-DD\"`, `\"-YYYYYY-MM-DD\"`",
577
472
  "value": {
578
473
  "type": [
579
- "string",
580
- "null",
581
- "undefined"
474
+ "string"
582
475
  ]
583
476
  }
584
477
  }
@@ -588,17 +481,17 @@
588
481
  "name": "change",
589
482
  "description": "Fired when the user commits a value change."
590
483
  },
591
- {
592
- "name": "input",
593
- "description": "Fired when the value is changed by the user: on every typing keystroke,\nand the value is cleared using the clear button."
594
- },
595
484
  {
596
485
  "name": "invalid-changed",
597
486
  "description": "Fired when the `invalid` property changes."
598
487
  },
599
488
  {
600
489
  "name": "opened-changed",
601
- "description": "Fired when `opened` property value changes."
490
+ "description": "Fired when the `opened` property changes."
491
+ },
492
+ {
493
+ "name": "unparsable-change",
494
+ "description": "Fired when the user commits an unparsable value change and there is no change event."
602
495
  },
603
496
  {
604
497
  "name": "validated",
@@ -606,7 +499,7 @@
606
499
  },
607
500
  {
608
501
  "name": "value-changed",
609
- "description": "Fired when `value` property value changes."
502
+ "description": "Fired when the `value` property changes."
610
503
  }
611
504
  ]
612
505
  }