@vaadin/date-time-picker 25.3.0-alpha1 → 25.3.0-alpha11
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 +153 -36
- package/package.json +12 -12
- package/src/vaadin-date-time-picker-mixin.d.ts +46 -1
- package/src/vaadin-date-time-picker-mixin.js +63 -7
- package/src/vaadin-date-time-picker.js +1 -0
- package/web-types.json +37 -10
- package/web-types.lit.json +19 -5
package/custom-elements.json
CHANGED
|
@@ -26,6 +26,20 @@
|
|
|
26
26
|
"description": "A mixin providing common date-time-picker functionality.",
|
|
27
27
|
"name": "DateTimePickerMixin",
|
|
28
28
|
"members": [
|
|
29
|
+
{
|
|
30
|
+
"kind": "field",
|
|
31
|
+
"name": "accessibleDescriptionRef",
|
|
32
|
+
"privacy": "public",
|
|
33
|
+
"type": {
|
|
34
|
+
"text": "string"
|
|
35
|
+
},
|
|
36
|
+
"description": "A space-separated list of IDs referencing the elements that\ndescribe the component for screen reader users. The referenced\nelements are announced in addition to the helper text and\nthe error message.",
|
|
37
|
+
"attribute": "accessible-description-ref",
|
|
38
|
+
"inheritedFrom": {
|
|
39
|
+
"name": "FieldMixin",
|
|
40
|
+
"package": "@vaadin/field-base/src/field-mixin.js"
|
|
41
|
+
}
|
|
42
|
+
},
|
|
29
43
|
{
|
|
30
44
|
"kind": "field",
|
|
31
45
|
"name": "accessibleName",
|
|
@@ -33,7 +47,7 @@
|
|
|
33
47
|
"type": {
|
|
34
48
|
"text": "string"
|
|
35
49
|
},
|
|
36
|
-
"description": "String used to label the component
|
|
50
|
+
"description": "String used to label the component for screen reader users.",
|
|
37
51
|
"attribute": "accessible-name",
|
|
38
52
|
"inheritedFrom": {
|
|
39
53
|
"name": "FieldMixin",
|
|
@@ -47,7 +61,7 @@
|
|
|
47
61
|
"type": {
|
|
48
62
|
"text": "string"
|
|
49
63
|
},
|
|
50
|
-
"description": "
|
|
64
|
+
"description": "A space-separated list of IDs referencing the elements that\nlabel the component for screen reader users.",
|
|
51
65
|
"attribute": "accessible-name-ref",
|
|
52
66
|
"inheritedFrom": {
|
|
53
67
|
"name": "FieldMixin",
|
|
@@ -88,6 +102,21 @@
|
|
|
88
102
|
"package": "@vaadin/field-base/src/validate-mixin.js"
|
|
89
103
|
}
|
|
90
104
|
},
|
|
105
|
+
{
|
|
106
|
+
"kind": "method",
|
|
107
|
+
"name": "clearCache",
|
|
108
|
+
"description": "Clears the `dateMetadataProvider` cache and reloads the date metadata."
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
"kind": "field",
|
|
112
|
+
"name": "dateMetadataProvider",
|
|
113
|
+
"privacy": "public",
|
|
114
|
+
"type": {
|
|
115
|
+
"text": "DatePickerDateMetadataProvider | null | undefined"
|
|
116
|
+
},
|
|
117
|
+
"description": "A function that provides metadata for the dates the calendar is about to render: whether they\nare disabled, and CSS `part` names for styling from outside using the `::part()` selector.\nThe provider is called for a range of dates at a time, and again as the calendar renders\nfurther dates.\n\nIt receives a `DatePickerDateRange` and returns an array of `DatePickerDateMetadata` objects\nfor the dates in that range that have metadata. It can return a `Promise` to load the metadata\nasynchronously, and `null` or `undefined` when no date in the range has metadata.\n\nThe returned array has the following structure:\n\n```js\n[\n // The date is an ISO 8601 string.\n { date: '2026-01-01', disabled: true },\n\n // Adds a custom part name to the date.\n { date: '2026-01-02', part: 'busy' },\n]\n```\n\nA date is disabled if its metadata marks it disabled, or it is outside `min` and `max`.\nDisabled dates are not selectable, and a value on a disabled date makes the field invalid.\nThe provider does not affect which date is focused when opening the overlay. Use\n`initialPosition` property to provide a selectable date.\n\nWhile a returned `Promise` is pending, the dates it covers are not disabled yet and render with\nthe `loading` part. If the function throws or rejects, corresponding dates are requested again\nthe next time the user navigates.\n\nThe provider is used for validation also when the overlay is closed. Date is considered valid\nwhile the provider is pending. Unlike `<vaadin-date-picker>`, the value is not re-validated\nwhen the metadata is loaded, but checked against it at the next validation instead.\n\nKeep a stable reference to the function: assigning a new one clears the cache and re-fetches\nvisible range. Call `clearCache()` to re-fetch when the data behind the same function changed.",
|
|
118
|
+
"attribute": "date-metadata-provider"
|
|
119
|
+
},
|
|
91
120
|
{
|
|
92
121
|
"kind": "field",
|
|
93
122
|
"name": "datePlaceholder",
|
|
@@ -340,12 +369,24 @@
|
|
|
340
369
|
}
|
|
341
370
|
],
|
|
342
371
|
"attributes": [
|
|
372
|
+
{
|
|
373
|
+
"name": "accessible-description-ref",
|
|
374
|
+
"type": {
|
|
375
|
+
"text": "string"
|
|
376
|
+
},
|
|
377
|
+
"description": "A space-separated list of IDs referencing the elements that\ndescribe the component for screen reader users. The referenced\nelements are announced in addition to the helper text and\nthe error message.",
|
|
378
|
+
"fieldName": "accessibleDescriptionRef",
|
|
379
|
+
"inheritedFrom": {
|
|
380
|
+
"name": "FieldMixin",
|
|
381
|
+
"package": "@vaadin/field-base/src/field-mixin.js"
|
|
382
|
+
}
|
|
383
|
+
},
|
|
343
384
|
{
|
|
344
385
|
"name": "accessible-name",
|
|
345
386
|
"type": {
|
|
346
387
|
"text": "string"
|
|
347
388
|
},
|
|
348
|
-
"description": "String used to label the component
|
|
389
|
+
"description": "String used to label the component for screen reader users.",
|
|
349
390
|
"fieldName": "accessibleName",
|
|
350
391
|
"inheritedFrom": {
|
|
351
392
|
"name": "FieldMixin",
|
|
@@ -357,7 +398,7 @@
|
|
|
357
398
|
"type": {
|
|
358
399
|
"text": "string"
|
|
359
400
|
},
|
|
360
|
-
"description": "
|
|
401
|
+
"description": "A space-separated list of IDs referencing the elements that\nlabel the component for screen reader users.",
|
|
361
402
|
"fieldName": "accessibleNameRef",
|
|
362
403
|
"inheritedFrom": {
|
|
363
404
|
"name": "FieldMixin",
|
|
@@ -380,6 +421,14 @@
|
|
|
380
421
|
"description": "Specify that this control should have input focus when the page loads.",
|
|
381
422
|
"fieldName": "autofocus"
|
|
382
423
|
},
|
|
424
|
+
{
|
|
425
|
+
"name": "date-metadata-provider",
|
|
426
|
+
"type": {
|
|
427
|
+
"text": "DatePickerDateMetadataProvider | null | undefined"
|
|
428
|
+
},
|
|
429
|
+
"description": "A function that provides metadata for the dates the calendar is about to render: whether they\nare disabled, and CSS `part` names for styling from outside using the `::part()` selector.\nThe provider is called for a range of dates at a time, and again as the calendar renders\nfurther dates.\n\nIt receives a `DatePickerDateRange` and returns an array of `DatePickerDateMetadata` objects\nfor the dates in that range that have metadata. It can return a `Promise` to load the metadata\nasynchronously, and `null` or `undefined` when no date in the range has metadata.\n\nThe returned array has the following structure:\n\n```js\n[\n // The date is an ISO 8601 string.\n { date: '2026-01-01', disabled: true },\n\n // Adds a custom part name to the date.\n { date: '2026-01-02', part: 'busy' },\n]\n```\n\nA date is disabled if its metadata marks it disabled, or it is outside `min` and `max`.\nDisabled dates are not selectable, and a value on a disabled date makes the field invalid.\nThe provider does not affect which date is focused when opening the overlay. Use\n`initialPosition` property to provide a selectable date.\n\nWhile a returned `Promise` is pending, the dates it covers are not disabled yet and render with\nthe `loading` part. If the function throws or rejects, corresponding dates are requested again\nthe next time the user navigates.\n\nThe provider is used for validation also when the overlay is closed. Date is considered valid\nwhile the provider is pending. Unlike `<vaadin-date-picker>`, the value is not re-validated\nwhen the metadata is loaded, but checked against it at the next validation instead.\n\nKeep a stable reference to the function: assigning a new one clears the cache and re-fetches\nvisible range. Call `clearCache()` to re-fetch when the data behind the same function changed.",
|
|
430
|
+
"fieldName": "dateMetadataProvider"
|
|
431
|
+
},
|
|
383
432
|
{
|
|
384
433
|
"name": "date-placeholder",
|
|
385
434
|
"type": {
|
|
@@ -602,6 +651,20 @@
|
|
|
602
651
|
"description": "`<vaadin-date-time-picker>` is a Web Component providing a date time selection field.\n\n```html\n<vaadin-date-time-picker value=\"2019-09-16T15:00\"></vaadin-date-time-picker>\n```\n\n```js\ndateTimePicker.value = '2019-09-16T15:00';\n```\n\nWhen the selected `value` is changed, a `value-changed` event is triggered.\n\n### Styling\n\nThe following shadow DOM parts are available for styling:\n\nPart name | Description\n---------------------|----------------\n`label` | The slotted label element wrapper\n`input-fields` | The date and time pickers wrapper\n`helper-text` | The slotted helper text element wrapper\n`error-message` | The slotted error message element wrapper\n`required-indicator` | The `required` state indicator element\n\nThe following state attributes are available for styling:\n\nAttribute | Description\n--------------------|---------------------------------\n`disabled` | Set when the element is disabled\n`focused` | Set when the element is focused\n`focus-ring` | Set when the element is keyboard focused\n`readonly` | Set when the element is readonly\n`invalid` | Set when the element is invalid\n`has-label` | Set when the element has a label\n`has-value` | Set when the element has a value\n`has-helper` | Set when the element has helper text\n`has-error-message` | Set when the element has an error message\n`has-tooltip` | Set when the element has a slotted tooltip\n\nThe following custom CSS properties are available for styling:\n\nCustom CSS property |\n:--------------------------------------------------|\n| `--vaadin-date-time-picker-gap` |\n| `--vaadin-input-field-error-color` |\n| `--vaadin-input-field-error-font-size` |\n| `--vaadin-input-field-error-font-weight` |\n| `--vaadin-input-field-error-line-height` |\n| `--vaadin-input-field-label-color` |\n| `--vaadin-input-field-label-font-size` |\n| `--vaadin-input-field-label-font-weight` |\n| `--vaadin-input-field-label-line-height` |\n| `--vaadin-input-field-helper-color` |\n| `--vaadin-input-field-helper-font-size` |\n| `--vaadin-input-field-helper-font-weight` |\n| `--vaadin-input-field-helper-line-height` |\n| `--vaadin-input-field-required-indicator-color` |\n| `--vaadin-input-field-required-indicator` |\n\n### Internal components\n\nThe following components are created by `<vaadin-date-time-picker>` and placed in light DOM:\n\n- [`<vaadin-date-picker>`](#/elements/vaadin-date-picker).\n- [`<vaadin-time-picker>`](#/elements/vaadin-time-picker).\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.\n\n### Change events\n\nDepending on the nature of the value change that the user attempts to commit e.g. by pressing Enter,\nthe component can fire either a `change` event or an `unparsable-change` event:\n\nValue change | Event\n:------------------------|:------------------\nempty => parsable | change\nempty => unparsable | unparsable-change\nparsable => empty | change\nparsable => parsable | change\nparsable => unparsable | change\nunparsable => empty | unparsable-change\nunparsable => parsable | change\nunparsable => unparsable | unparsable-change\nincomplete => empty | unparsable-change\nincomplete => parsable | change\nincomplete => unparsable | unparsable-change\nempty => incomplete | unparsable-change\nparsable => incomplete | change\nunparsable => incomplete | unparsable-change",
|
|
603
652
|
"name": "DateTimePicker",
|
|
604
653
|
"members": [
|
|
654
|
+
{
|
|
655
|
+
"kind": "field",
|
|
656
|
+
"name": "accessibleDescriptionRef",
|
|
657
|
+
"privacy": "public",
|
|
658
|
+
"type": {
|
|
659
|
+
"text": "string"
|
|
660
|
+
},
|
|
661
|
+
"description": "A space-separated list of IDs referencing the elements that\ndescribe the component for screen reader users. The referenced\nelements are announced in addition to the helper text and\nthe error message.",
|
|
662
|
+
"attribute": "accessible-description-ref",
|
|
663
|
+
"inheritedFrom": {
|
|
664
|
+
"name": "FieldMixin",
|
|
665
|
+
"package": "@vaadin/field-base/src/field-mixin.js"
|
|
666
|
+
}
|
|
667
|
+
},
|
|
605
668
|
{
|
|
606
669
|
"kind": "field",
|
|
607
670
|
"name": "accessibleName",
|
|
@@ -609,7 +672,7 @@
|
|
|
609
672
|
"type": {
|
|
610
673
|
"text": "string"
|
|
611
674
|
},
|
|
612
|
-
"description": "String used to label the component
|
|
675
|
+
"description": "String used to label the component for screen reader users.",
|
|
613
676
|
"attribute": "accessible-name",
|
|
614
677
|
"inheritedFrom": {
|
|
615
678
|
"name": "FieldMixin",
|
|
@@ -623,7 +686,7 @@
|
|
|
623
686
|
"type": {
|
|
624
687
|
"text": "string"
|
|
625
688
|
},
|
|
626
|
-
"description": "
|
|
689
|
+
"description": "A space-separated list of IDs referencing the elements that\nlabel the component for screen reader users.",
|
|
627
690
|
"attribute": "accessible-name-ref",
|
|
628
691
|
"inheritedFrom": {
|
|
629
692
|
"name": "FieldMixin",
|
|
@@ -672,6 +735,29 @@
|
|
|
672
735
|
"module": "src/vaadin-date-time-picker-mixin.js"
|
|
673
736
|
}
|
|
674
737
|
},
|
|
738
|
+
{
|
|
739
|
+
"kind": "method",
|
|
740
|
+
"name": "clearCache",
|
|
741
|
+
"description": "Clears the `dateMetadataProvider` cache and reloads the date metadata.",
|
|
742
|
+
"inheritedFrom": {
|
|
743
|
+
"name": "DateTimePickerMixin",
|
|
744
|
+
"module": "src/vaadin-date-time-picker-mixin.js"
|
|
745
|
+
}
|
|
746
|
+
},
|
|
747
|
+
{
|
|
748
|
+
"kind": "field",
|
|
749
|
+
"name": "dateMetadataProvider",
|
|
750
|
+
"privacy": "public",
|
|
751
|
+
"type": {
|
|
752
|
+
"text": "DatePickerDateMetadataProvider | null | undefined"
|
|
753
|
+
},
|
|
754
|
+
"description": "A function that provides metadata for the dates the calendar is about to render: whether they\nare disabled, and CSS `part` names for styling from outside using the `::part()` selector.\nThe provider is called for a range of dates at a time, and again as the calendar renders\nfurther dates.\n\nIt receives a `DatePickerDateRange` and returns an array of `DatePickerDateMetadata` objects\nfor the dates in that range that have metadata. It can return a `Promise` to load the metadata\nasynchronously, and `null` or `undefined` when no date in the range has metadata.\n\nThe returned array has the following structure:\n\n```js\n[\n // The date is an ISO 8601 string.\n { date: '2026-01-01', disabled: true },\n\n // Adds a custom part name to the date.\n { date: '2026-01-02', part: 'busy' },\n]\n```\n\nA date is disabled if its metadata marks it disabled, or it is outside `min` and `max`.\nDisabled dates are not selectable, and a value on a disabled date makes the field invalid.\nThe provider does not affect which date is focused when opening the overlay. Use\n`initialPosition` property to provide a selectable date.\n\nWhile a returned `Promise` is pending, the dates it covers are not disabled yet and render with\nthe `loading` part. If the function throws or rejects, corresponding dates are requested again\nthe next time the user navigates.\n\nThe provider is used for validation also when the overlay is closed. Date is considered valid\nwhile the provider is pending. Unlike `<vaadin-date-picker>`, the value is not re-validated\nwhen the metadata is loaded, but checked against it at the next validation instead.\n\nKeep a stable reference to the function: assigning a new one clears the cache and re-fetches\nvisible range. Call `clearCache()` to re-fetch when the data behind the same function changed.",
|
|
755
|
+
"attribute": "date-metadata-provider",
|
|
756
|
+
"inheritedFrom": {
|
|
757
|
+
"name": "DateTimePickerMixin",
|
|
758
|
+
"module": "src/vaadin-date-time-picker-mixin.js"
|
|
759
|
+
}
|
|
760
|
+
},
|
|
675
761
|
{
|
|
676
762
|
"kind": "field",
|
|
677
763
|
"name": "datePlaceholder",
|
|
@@ -984,41 +1070,25 @@
|
|
|
984
1070
|
"name": "value-changed"
|
|
985
1071
|
}
|
|
986
1072
|
],
|
|
987
|
-
"
|
|
988
|
-
{
|
|
989
|
-
"name": "DateTimePickerMixin",
|
|
990
|
-
"module": "src/vaadin-date-time-picker-mixin.js"
|
|
991
|
-
},
|
|
992
|
-
{
|
|
993
|
-
"name": "ThemableMixin",
|
|
994
|
-
"package": "@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js"
|
|
995
|
-
},
|
|
996
|
-
{
|
|
997
|
-
"name": "ElementMixin",
|
|
998
|
-
"package": "@vaadin/component-base/src/element-mixin.js"
|
|
999
|
-
},
|
|
1073
|
+
"attributes": [
|
|
1000
1074
|
{
|
|
1001
|
-
"name": "
|
|
1002
|
-
"
|
|
1075
|
+
"name": "accessible-description-ref",
|
|
1076
|
+
"type": {
|
|
1077
|
+
"text": "string"
|
|
1078
|
+
},
|
|
1079
|
+
"description": "A space-separated list of IDs referencing the elements that\ndescribe the component for screen reader users. The referenced\nelements are announced in addition to the helper text and\nthe error message.",
|
|
1080
|
+
"fieldName": "accessibleDescriptionRef",
|
|
1081
|
+
"inheritedFrom": {
|
|
1082
|
+
"name": "FieldMixin",
|
|
1083
|
+
"package": "@vaadin/field-base/src/field-mixin.js"
|
|
1084
|
+
}
|
|
1003
1085
|
},
|
|
1004
|
-
{
|
|
1005
|
-
"name": "LumoInjectionMixin",
|
|
1006
|
-
"package": "@vaadin/vaadin-themable-mixin/lumo-injection-mixin.js"
|
|
1007
|
-
}
|
|
1008
|
-
],
|
|
1009
|
-
"superclass": {
|
|
1010
|
-
"name": "LitElement",
|
|
1011
|
-
"package": "lit"
|
|
1012
|
-
},
|
|
1013
|
-
"tagName": "vaadin-date-time-picker",
|
|
1014
|
-
"customElement": true,
|
|
1015
|
-
"attributes": [
|
|
1016
1086
|
{
|
|
1017
1087
|
"name": "accessible-name",
|
|
1018
1088
|
"type": {
|
|
1019
1089
|
"text": "string"
|
|
1020
1090
|
},
|
|
1021
|
-
"description": "String used to label the component
|
|
1091
|
+
"description": "String used to label the component for screen reader users.",
|
|
1022
1092
|
"fieldName": "accessibleName",
|
|
1023
1093
|
"inheritedFrom": {
|
|
1024
1094
|
"name": "FieldMixin",
|
|
@@ -1030,7 +1100,7 @@
|
|
|
1030
1100
|
"type": {
|
|
1031
1101
|
"text": "string"
|
|
1032
1102
|
},
|
|
1033
|
-
"description": "
|
|
1103
|
+
"description": "A space-separated list of IDs referencing the elements that\nlabel the component for screen reader users.",
|
|
1034
1104
|
"fieldName": "accessibleNameRef",
|
|
1035
1105
|
"inheritedFrom": {
|
|
1036
1106
|
"name": "FieldMixin",
|
|
@@ -1061,6 +1131,18 @@
|
|
|
1061
1131
|
"module": "src/vaadin-date-time-picker-mixin.js"
|
|
1062
1132
|
}
|
|
1063
1133
|
},
|
|
1134
|
+
{
|
|
1135
|
+
"name": "date-metadata-provider",
|
|
1136
|
+
"type": {
|
|
1137
|
+
"text": "DatePickerDateMetadataProvider | null | undefined"
|
|
1138
|
+
},
|
|
1139
|
+
"description": "A function that provides metadata for the dates the calendar is about to render: whether they\nare disabled, and CSS `part` names for styling from outside using the `::part()` selector.\nThe provider is called for a range of dates at a time, and again as the calendar renders\nfurther dates.\n\nIt receives a `DatePickerDateRange` and returns an array of `DatePickerDateMetadata` objects\nfor the dates in that range that have metadata. It can return a `Promise` to load the metadata\nasynchronously, and `null` or `undefined` when no date in the range has metadata.\n\nThe returned array has the following structure:\n\n```js\n[\n // The date is an ISO 8601 string.\n { date: '2026-01-01', disabled: true },\n\n // Adds a custom part name to the date.\n { date: '2026-01-02', part: 'busy' },\n]\n```\n\nA date is disabled if its metadata marks it disabled, or it is outside `min` and `max`.\nDisabled dates are not selectable, and a value on a disabled date makes the field invalid.\nThe provider does not affect which date is focused when opening the overlay. Use\n`initialPosition` property to provide a selectable date.\n\nWhile a returned `Promise` is pending, the dates it covers are not disabled yet and render with\nthe `loading` part. If the function throws or rejects, corresponding dates are requested again\nthe next time the user navigates.\n\nThe provider is used for validation also when the overlay is closed. Date is considered valid\nwhile the provider is pending. Unlike `<vaadin-date-picker>`, the value is not re-validated\nwhen the metadata is loaded, but checked against it at the next validation instead.\n\nKeep a stable reference to the function: assigning a new one clears the cache and re-fetches\nvisible range. Call `clearCache()` to re-fetch when the data behind the same function changed.",
|
|
1140
|
+
"fieldName": "dateMetadataProvider",
|
|
1141
|
+
"inheritedFrom": {
|
|
1142
|
+
"name": "DateTimePickerMixin",
|
|
1143
|
+
"module": "src/vaadin-date-time-picker-mixin.js"
|
|
1144
|
+
}
|
|
1145
|
+
},
|
|
1064
1146
|
{
|
|
1065
1147
|
"name": "date-placeholder",
|
|
1066
1148
|
"type": {
|
|
@@ -1253,6 +1335,13 @@
|
|
|
1253
1335
|
"module": "src/vaadin-date-time-picker-mixin.js"
|
|
1254
1336
|
}
|
|
1255
1337
|
},
|
|
1338
|
+
{
|
|
1339
|
+
"type": {
|
|
1340
|
+
"text": "string"
|
|
1341
|
+
},
|
|
1342
|
+
"description": "The theme variants to apply to the component.",
|
|
1343
|
+
"name": "theme"
|
|
1344
|
+
},
|
|
1256
1345
|
{
|
|
1257
1346
|
"name": "time-placeholder",
|
|
1258
1347
|
"type": {
|
|
@@ -1277,7 +1366,35 @@
|
|
|
1277
1366
|
"module": "src/vaadin-date-time-picker-mixin.js"
|
|
1278
1367
|
}
|
|
1279
1368
|
}
|
|
1280
|
-
]
|
|
1369
|
+
],
|
|
1370
|
+
"mixins": [
|
|
1371
|
+
{
|
|
1372
|
+
"name": "DateTimePickerMixin",
|
|
1373
|
+
"module": "src/vaadin-date-time-picker-mixin.js"
|
|
1374
|
+
},
|
|
1375
|
+
{
|
|
1376
|
+
"name": "ThemableMixin",
|
|
1377
|
+
"package": "@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js"
|
|
1378
|
+
},
|
|
1379
|
+
{
|
|
1380
|
+
"name": "ElementMixin",
|
|
1381
|
+
"package": "@vaadin/component-base/src/element-mixin.js"
|
|
1382
|
+
},
|
|
1383
|
+
{
|
|
1384
|
+
"name": "PolylitMixin",
|
|
1385
|
+
"package": "@vaadin/component-base/src/polylit-mixin.js"
|
|
1386
|
+
},
|
|
1387
|
+
{
|
|
1388
|
+
"name": "LumoInjectionMixin",
|
|
1389
|
+
"package": "@vaadin/vaadin-themable-mixin/lumo-injection-mixin.js"
|
|
1390
|
+
}
|
|
1391
|
+
],
|
|
1392
|
+
"superclass": {
|
|
1393
|
+
"name": "LitElement",
|
|
1394
|
+
"package": "lit"
|
|
1395
|
+
},
|
|
1396
|
+
"tagName": "vaadin-date-time-picker",
|
|
1397
|
+
"customElement": true
|
|
1281
1398
|
}
|
|
1282
1399
|
],
|
|
1283
1400
|
"exports": [
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vaadin/date-time-picker",
|
|
3
|
-
"version": "25.3.0-
|
|
3
|
+
"version": "25.3.0-alpha11",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -35,20 +35,20 @@
|
|
|
35
35
|
],
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"@open-wc/dedupe-mixin": "^1.3.0",
|
|
38
|
-
"@vaadin/a11y-base": "25.3.0-
|
|
39
|
-
"@vaadin/component-base": "25.3.0-
|
|
40
|
-
"@vaadin/date-picker": "25.3.0-
|
|
41
|
-
"@vaadin/field-base": "25.3.0-
|
|
42
|
-
"@vaadin/time-picker": "25.3.0-
|
|
43
|
-
"@vaadin/vaadin-themable-mixin": "25.3.0-
|
|
38
|
+
"@vaadin/a11y-base": "25.3.0-alpha11",
|
|
39
|
+
"@vaadin/component-base": "25.3.0-alpha11",
|
|
40
|
+
"@vaadin/date-picker": "25.3.0-alpha11",
|
|
41
|
+
"@vaadin/field-base": "25.3.0-alpha11",
|
|
42
|
+
"@vaadin/time-picker": "25.3.0-alpha11",
|
|
43
|
+
"@vaadin/vaadin-themable-mixin": "25.3.0-alpha11",
|
|
44
44
|
"lit": "^3.0.0"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
|
-
"@vaadin/aura": "25.3.0-
|
|
48
|
-
"@vaadin/chai-plugins": "25.3.0-
|
|
49
|
-
"@vaadin/test-runner-commands": "25.3.0-
|
|
47
|
+
"@vaadin/aura": "25.3.0-alpha11",
|
|
48
|
+
"@vaadin/chai-plugins": "25.3.0-alpha11",
|
|
49
|
+
"@vaadin/test-runner-commands": "25.3.0-alpha11",
|
|
50
50
|
"@vaadin/testing-helpers": "^2.0.0",
|
|
51
|
-
"@vaadin/vaadin-lumo-styles": "25.3.0-
|
|
51
|
+
"@vaadin/vaadin-lumo-styles": "25.3.0-alpha11",
|
|
52
52
|
"sinon": "^22.0.0"
|
|
53
53
|
},
|
|
54
54
|
"customElements": "custom-elements.json",
|
|
@@ -56,5 +56,5 @@
|
|
|
56
56
|
"web-types.json",
|
|
57
57
|
"web-types.lit.json"
|
|
58
58
|
],
|
|
59
|
-
"gitHead": "
|
|
59
|
+
"gitHead": "7e0c61a37e68d8971def9cdf28ad0548a0f530a9"
|
|
60
60
|
}
|
|
@@ -7,7 +7,7 @@ import type { Constructor } from '@open-wc/dedupe-mixin';
|
|
|
7
7
|
import type { DisabledMixinClass } from '@vaadin/a11y-base/src/disabled-mixin.js';
|
|
8
8
|
import type { FocusMixinClass } from '@vaadin/a11y-base/src/focus-mixin.js';
|
|
9
9
|
import type { I18nMixinClass } from '@vaadin/component-base/src/i18n-mixin.js';
|
|
10
|
-
import type { DatePickerI18n } from '@vaadin/date-picker/src/vaadin-date-picker.js';
|
|
10
|
+
import type { DatePickerDateMetadataProvider, DatePickerI18n } from '@vaadin/date-picker/src/vaadin-date-picker.js';
|
|
11
11
|
import type { FieldMixinClass } from '@vaadin/field-base/src/field-mixin.js';
|
|
12
12
|
import type { LabelMixinClass } from '@vaadin/field-base/src/label-mixin.js';
|
|
13
13
|
import type { ValidateMixinClass } from '@vaadin/field-base/src/validate-mixin.js';
|
|
@@ -127,6 +127,46 @@ export declare class DateTimePickerMixinClass {
|
|
|
127
127
|
*/
|
|
128
128
|
showWeekNumbers: boolean | null | undefined;
|
|
129
129
|
|
|
130
|
+
/**
|
|
131
|
+
* A function that provides metadata for the dates the calendar is about to render: whether they
|
|
132
|
+
* are disabled, and CSS `part` names for styling from outside using the `::part()` selector.
|
|
133
|
+
* The provider is called for a range of dates at a time, and again as the calendar renders
|
|
134
|
+
* further dates.
|
|
135
|
+
*
|
|
136
|
+
* It receives a `DatePickerDateRange` and returns an array of `DatePickerDateMetadata` objects
|
|
137
|
+
* for the dates in that range that have metadata. It can return a `Promise` to load the metadata
|
|
138
|
+
* asynchronously, and `null` or `undefined` when no date in the range has metadata.
|
|
139
|
+
*
|
|
140
|
+
* The returned array has the following structure:
|
|
141
|
+
*
|
|
142
|
+
* ```js
|
|
143
|
+
* [
|
|
144
|
+
* // The date is an ISO 8601 string.
|
|
145
|
+
* { date: '2026-01-01', disabled: true },
|
|
146
|
+
*
|
|
147
|
+
* // Adds a custom part name to the date.
|
|
148
|
+
* { date: '2026-01-02', part: 'busy' },
|
|
149
|
+
* ]
|
|
150
|
+
* ```
|
|
151
|
+
*
|
|
152
|
+
* A date is disabled if its metadata marks it disabled, or it is outside `min` and `max`.
|
|
153
|
+
* Disabled dates are not selectable, and a value on a disabled date makes the field invalid.
|
|
154
|
+
* The provider does not affect which date is focused when opening the overlay. Use
|
|
155
|
+
* `initialPosition` property to provide a selectable date.
|
|
156
|
+
*
|
|
157
|
+
* While a returned `Promise` is pending, the dates it covers are not disabled yet and render with
|
|
158
|
+
* the `loading` part. If the function throws or rejects, corresponding dates are requested again
|
|
159
|
+
* the next time the user navigates.
|
|
160
|
+
*
|
|
161
|
+
* The provider is used for validation also when the overlay is closed. Date is considered valid
|
|
162
|
+
* while the provider is pending. Unlike `<vaadin-date-picker>`, the value is not re-validated
|
|
163
|
+
* when the metadata is loaded, but checked against it at the next validation instead.
|
|
164
|
+
*
|
|
165
|
+
* Keep a stable reference to the function: assigning a new one clears the cache and re-fetches
|
|
166
|
+
* visible range. Call `clearCache()` to re-fetch when the data behind the same function changed.
|
|
167
|
+
*/
|
|
168
|
+
dateMetadataProvider: DatePickerDateMetadataProvider | null | undefined;
|
|
169
|
+
|
|
130
170
|
/**
|
|
131
171
|
* Set to true to prevent the overlays from opening automatically.
|
|
132
172
|
* @attr {boolean} auto-open-disabled
|
|
@@ -171,4 +211,9 @@ export declare class DateTimePickerMixinClass {
|
|
|
171
211
|
* [`<vaadin-time-picker>`](#/elements/vaadin-time-picker) are supported.
|
|
172
212
|
*/
|
|
173
213
|
i18n: DateTimePickerI18n;
|
|
214
|
+
|
|
215
|
+
/**
|
|
216
|
+
* Clears the `dateMetadataProvider` cache and reloads the date metadata.
|
|
217
|
+
*/
|
|
218
|
+
clearCache(): void;
|
|
174
219
|
}
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import { DisabledMixin } from '@vaadin/a11y-base/src/disabled-mixin.js';
|
|
7
7
|
import { FocusMixin } from '@vaadin/a11y-base/src/focus-mixin.js';
|
|
8
|
+
import { setOrRemoveAttribute } from '@vaadin/component-base/src/dom-utils.js';
|
|
8
9
|
import { I18nMixin } from '@vaadin/component-base/src/i18n-mixin.js';
|
|
9
10
|
import { SlotController } from '@vaadin/component-base/src/slot-controller.js';
|
|
10
11
|
import { TooltipController } from '@vaadin/component-base/src/tooltip-controller.js';
|
|
@@ -180,6 +181,51 @@ export const DateTimePickerMixin = (superClass) =>
|
|
|
180
181
|
sync: true,
|
|
181
182
|
},
|
|
182
183
|
|
|
184
|
+
/**
|
|
185
|
+
* A function that provides metadata for the dates the calendar is about to render: whether they
|
|
186
|
+
* are disabled, and CSS `part` names for styling from outside using the `::part()` selector.
|
|
187
|
+
* The provider is called for a range of dates at a time, and again as the calendar renders
|
|
188
|
+
* further dates.
|
|
189
|
+
*
|
|
190
|
+
* It receives a `DatePickerDateRange` and returns an array of `DatePickerDateMetadata` objects
|
|
191
|
+
* for the dates in that range that have metadata. It can return a `Promise` to load the metadata
|
|
192
|
+
* asynchronously, and `null` or `undefined` when no date in the range has metadata.
|
|
193
|
+
*
|
|
194
|
+
* The returned array has the following structure:
|
|
195
|
+
*
|
|
196
|
+
* ```js
|
|
197
|
+
* [
|
|
198
|
+
* // The date is an ISO 8601 string.
|
|
199
|
+
* { date: '2026-01-01', disabled: true },
|
|
200
|
+
*
|
|
201
|
+
* // Adds a custom part name to the date.
|
|
202
|
+
* { date: '2026-01-02', part: 'busy' },
|
|
203
|
+
* ]
|
|
204
|
+
* ```
|
|
205
|
+
*
|
|
206
|
+
* A date is disabled if its metadata marks it disabled, or it is outside `min` and `max`.
|
|
207
|
+
* Disabled dates are not selectable, and a value on a disabled date makes the field invalid.
|
|
208
|
+
* The provider does not affect which date is focused when opening the overlay. Use
|
|
209
|
+
* `initialPosition` property to provide a selectable date.
|
|
210
|
+
*
|
|
211
|
+
* While a returned `Promise` is pending, the dates it covers are not disabled yet and render with
|
|
212
|
+
* the `loading` part. If the function throws or rejects, corresponding dates are requested again
|
|
213
|
+
* the next time the user navigates.
|
|
214
|
+
*
|
|
215
|
+
* The provider is used for validation also when the overlay is closed. Date is considered valid
|
|
216
|
+
* while the provider is pending. Unlike `<vaadin-date-picker>`, the value is not re-validated
|
|
217
|
+
* when the metadata is loaded, but checked against it at the next validation instead.
|
|
218
|
+
*
|
|
219
|
+
* Keep a stable reference to the function: assigning a new one clears the cache and re-fetches
|
|
220
|
+
* visible range. Call `clearCache()` to re-fetch when the data behind the same function changed.
|
|
221
|
+
*
|
|
222
|
+
* @type {DatePickerDateMetadataProvider | null | undefined}
|
|
223
|
+
*/
|
|
224
|
+
dateMetadataProvider: {
|
|
225
|
+
type: Function,
|
|
226
|
+
sync: true,
|
|
227
|
+
},
|
|
228
|
+
|
|
183
229
|
/**
|
|
184
230
|
* Set to true to prevent the overlays from opening automatically.
|
|
185
231
|
* @attr {boolean} auto-open-disabled
|
|
@@ -245,6 +291,7 @@ export const DateTimePickerMixin = (superClass) =>
|
|
|
245
291
|
'__stepChanged(step, __timePicker)',
|
|
246
292
|
'__initialPositionChanged(initialPosition, __datePicker)',
|
|
247
293
|
'__showWeekNumbersChanged(showWeekNumbers, __datePicker)',
|
|
294
|
+
'__dateMetadataProviderChanged(dateMetadataProvider, __datePicker)',
|
|
248
295
|
'__requiredChanged(required, __datePicker, __timePicker)',
|
|
249
296
|
'__invalidChanged(invalid, __datePicker, __timePicker)',
|
|
250
297
|
'__disabledChanged(disabled, __datePicker, __timePicker)',
|
|
@@ -544,6 +591,7 @@ export const DateTimePickerMixin = (superClass) =>
|
|
|
544
591
|
this.datePlaceholder = newDatePicker.placeholder;
|
|
545
592
|
this.initialPosition = newDatePicker.initialPosition;
|
|
546
593
|
this.showWeekNumbers = newDatePicker.showWeekNumbers;
|
|
594
|
+
this.dateMetadataProvider = newDatePicker.dateMetadataProvider;
|
|
547
595
|
}
|
|
548
596
|
|
|
549
597
|
// Min and max are always synchronized from date time picker (host) to inner fields because time picker
|
|
@@ -662,6 +710,13 @@ export const DateTimePickerMixin = (superClass) =>
|
|
|
662
710
|
}
|
|
663
711
|
}
|
|
664
712
|
|
|
713
|
+
/** @private */
|
|
714
|
+
__dateMetadataProviderChanged(dateMetadataProvider, datePicker) {
|
|
715
|
+
if (datePicker) {
|
|
716
|
+
datePicker.dateMetadataProvider = dateMetadataProvider;
|
|
717
|
+
}
|
|
718
|
+
}
|
|
719
|
+
|
|
665
720
|
/** @private */
|
|
666
721
|
__invalidChanged(invalid, datePicker, timePicker) {
|
|
667
722
|
if (datePicker) {
|
|
@@ -800,6 +855,13 @@ export const DateTimePickerMixin = (superClass) =>
|
|
|
800
855
|
);
|
|
801
856
|
}
|
|
802
857
|
|
|
858
|
+
/**
|
|
859
|
+
* Clears the `dateMetadataProvider` cache and reloads the date metadata.
|
|
860
|
+
*/
|
|
861
|
+
clearCache() {
|
|
862
|
+
this.__datePicker?.clearCache();
|
|
863
|
+
}
|
|
864
|
+
|
|
803
865
|
/**
|
|
804
866
|
* Returns true if the current input value satisfies all constraints (if any)
|
|
805
867
|
*
|
|
@@ -969,13 +1031,7 @@ export const DateTimePickerMixin = (superClass) =>
|
|
|
969
1031
|
return;
|
|
970
1032
|
}
|
|
971
1033
|
|
|
972
|
-
[datePicker, timePicker].forEach((picker) =>
|
|
973
|
-
if (theme) {
|
|
974
|
-
picker.setAttribute('theme', theme);
|
|
975
|
-
} else {
|
|
976
|
-
picker.removeAttribute('theme');
|
|
977
|
-
}
|
|
978
|
-
});
|
|
1034
|
+
[datePicker, timePicker].forEach((picker) => setOrRemoveAttribute(picker, 'theme', theme));
|
|
979
1035
|
}
|
|
980
1036
|
|
|
981
1037
|
/** @private */
|
|
@@ -112,6 +112,7 @@ import { DateTimePickerMixin } from './vaadin-date-time-picker-mixin.js';
|
|
|
112
112
|
* @fires {CustomEvent} value-changed - Fired when the `value` property changes.
|
|
113
113
|
* @fires {CustomEvent} validated - Fired whenever the field is validated.
|
|
114
114
|
*
|
|
115
|
+
* @attr {string} theme - The theme variants to apply to the component.
|
|
115
116
|
* @customElement vaadin-date-time-picker
|
|
116
117
|
* @extends HTMLElement
|
|
117
118
|
*/
|
package/web-types.json
CHANGED
|
@@ -1,18 +1,27 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/web-types",
|
|
3
3
|
"name": "@vaadin/date-time-picker",
|
|
4
|
-
"version": "25.3.0-
|
|
4
|
+
"version": "25.3.0-alpha11",
|
|
5
5
|
"description-markup": "markdown",
|
|
6
6
|
"contributions": {
|
|
7
7
|
"html": {
|
|
8
8
|
"elements": [
|
|
9
9
|
{
|
|
10
10
|
"name": "vaadin-date-time-picker",
|
|
11
|
-
"description": "`<vaadin-date-time-picker>` is a Web Component providing a date time selection field.\n\n```html\n<vaadin-date-time-picker value=\"2019-09-16T15:00\"></vaadin-date-time-picker>\n```\n```js\ndateTimePicker.value = '2019-09-16T15:00';\n```\n\nWhen the selected `value` is changed, a `value-changed` event is triggered.\n\n### Styling\n\nThe following shadow DOM parts are available for styling:\n\nPart name | Description\n---------------------|----------------\n`label` | The slotted label element wrapper\n`input-fields` | The date and time pickers wrapper\n`helper-text` | The slotted helper text element wrapper\n`error-message` | The slotted error message element wrapper\n`required-indicator` | The `required` state indicator element\n\nThe following state attributes are available for styling:\n\nAttribute | Description\n--------------------|---------------------------------\n`disabled` | Set when the element is disabled\n`focused` | Set when the element is focused\n`focus-ring` | Set when the element is keyboard focused\n`readonly` | Set when the element is readonly\n`invalid` | Set when the element is invalid\n`has-label` | Set when the element has a label\n`has-value` | Set when the element has a value\n`has-helper` | Set when the element has helper text\n`has-error-message` | Set when the element has an error message\n`has-tooltip` | Set when the element has a slotted tooltip\n\nThe following custom CSS properties are available for styling:\n\nCustom CSS property |\n:--------------------------------------------------|\n| `--vaadin-date-time-picker-gap` |\n| `--vaadin-input-field-error-color` |\n| `--vaadin-input-field-error-font-size` |\n| `--vaadin-input-field-error-font-weight` |\n| `--vaadin-input-field-error-line-height` |\n| `--vaadin-input-field-label-color` |\n| `--vaadin-input-field-label-font-size` |\n| `--vaadin-input-field-label-font-weight` |\n| `--vaadin-input-field-label-line-height` |\n| `--vaadin-input-field-helper-color` |\n| `--vaadin-input-field-helper-font-size` |\n| `--vaadin-input-field-helper-font-weight` |\n| `--vaadin-input-field-helper-line-height` |\n| `--vaadin-input-field-required-indicator-color` |\n| `--vaadin-input-field-required-indicator` |\n\n### Internal components\n\nThe following components are created by `<vaadin-date-time-picker>` and placed in light DOM:\n\n- [`<vaadin-date-picker>`](https://cdn.vaadin.com/vaadin-web-components/25.3.0-
|
|
11
|
+
"description": "`<vaadin-date-time-picker>` is a Web Component providing a date time selection field.\n\n```html\n<vaadin-date-time-picker value=\"2019-09-16T15:00\"></vaadin-date-time-picker>\n```\n```js\ndateTimePicker.value = '2019-09-16T15:00';\n```\n\nWhen the selected `value` is changed, a `value-changed` event is triggered.\n\n### Styling\n\nThe following shadow DOM parts are available for styling:\n\nPart name | Description\n---------------------|----------------\n`label` | The slotted label element wrapper\n`input-fields` | The date and time pickers wrapper\n`helper-text` | The slotted helper text element wrapper\n`error-message` | The slotted error message element wrapper\n`required-indicator` | The `required` state indicator element\n\nThe following state attributes are available for styling:\n\nAttribute | Description\n--------------------|---------------------------------\n`disabled` | Set when the element is disabled\n`focused` | Set when the element is focused\n`focus-ring` | Set when the element is keyboard focused\n`readonly` | Set when the element is readonly\n`invalid` | Set when the element is invalid\n`has-label` | Set when the element has a label\n`has-value` | Set when the element has a value\n`has-helper` | Set when the element has helper text\n`has-error-message` | Set when the element has an error message\n`has-tooltip` | Set when the element has a slotted tooltip\n\nThe following custom CSS properties are available for styling:\n\nCustom CSS property |\n:--------------------------------------------------|\n| `--vaadin-date-time-picker-gap` |\n| `--vaadin-input-field-error-color` |\n| `--vaadin-input-field-error-font-size` |\n| `--vaadin-input-field-error-font-weight` |\n| `--vaadin-input-field-error-line-height` |\n| `--vaadin-input-field-label-color` |\n| `--vaadin-input-field-label-font-size` |\n| `--vaadin-input-field-label-font-weight` |\n| `--vaadin-input-field-label-line-height` |\n| `--vaadin-input-field-helper-color` |\n| `--vaadin-input-field-helper-font-size` |\n| `--vaadin-input-field-helper-font-weight` |\n| `--vaadin-input-field-helper-line-height` |\n| `--vaadin-input-field-required-indicator-color` |\n| `--vaadin-input-field-required-indicator` |\n\n### Internal components\n\nThe following components are created by `<vaadin-date-time-picker>` and placed in light DOM:\n\n- [`<vaadin-date-picker>`](https://cdn.vaadin.com/vaadin-web-components/25.3.0-alpha11/#/elements/vaadin-date-picker).\n- [`<vaadin-time-picker>`](https://cdn.vaadin.com/vaadin-web-components/25.3.0-alpha11/#/elements/vaadin-time-picker).\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.\n\n### Change events\n\nDepending on the nature of the value change that the user attempts to commit e.g. by pressing Enter,\nthe component can fire either a `change` event or an `unparsable-change` event:\n\nValue change | Event\n:------------------------|:------------------\nempty => parsable | change\nempty => unparsable | unparsable-change\nparsable => empty | change\nparsable => parsable | change\nparsable => unparsable | change\nunparsable => empty | unparsable-change\nunparsable => parsable | change\nunparsable => unparsable | unparsable-change\nincomplete => empty | unparsable-change\nincomplete => parsable | change\nincomplete => unparsable | unparsable-change\nempty => incomplete | unparsable-change\nparsable => incomplete | change\nunparsable => incomplete | unparsable-change",
|
|
12
12
|
"attributes": [
|
|
13
|
+
{
|
|
14
|
+
"name": "accessible-description-ref",
|
|
15
|
+
"description": "A space-separated list of IDs referencing the elements that\ndescribe the component for screen reader users. The referenced\nelements are announced in addition to the helper text and\nthe error message.",
|
|
16
|
+
"value": {
|
|
17
|
+
"type": [
|
|
18
|
+
"string"
|
|
19
|
+
]
|
|
20
|
+
}
|
|
21
|
+
},
|
|
13
22
|
{
|
|
14
23
|
"name": "accessible-name",
|
|
15
|
-
"description": "String used to label the component
|
|
24
|
+
"description": "String used to label the component for screen reader users.",
|
|
16
25
|
"value": {
|
|
17
26
|
"type": [
|
|
18
27
|
"string"
|
|
@@ -21,7 +30,7 @@
|
|
|
21
30
|
},
|
|
22
31
|
{
|
|
23
32
|
"name": "accessible-name-ref",
|
|
24
|
-
"description": "
|
|
33
|
+
"description": "A space-separated list of IDs referencing the elements that\nlabel the component for screen reader users.",
|
|
25
34
|
"value": {
|
|
26
35
|
"type": [
|
|
27
36
|
"string"
|
|
@@ -186,9 +195,7 @@
|
|
|
186
195
|
"description": "The theme variants to apply to the component.",
|
|
187
196
|
"value": {
|
|
188
197
|
"type": [
|
|
189
|
-
"string"
|
|
190
|
-
"null",
|
|
191
|
-
"undefined"
|
|
198
|
+
"string"
|
|
192
199
|
]
|
|
193
200
|
}
|
|
194
201
|
},
|
|
@@ -213,9 +220,18 @@
|
|
|
213
220
|
],
|
|
214
221
|
"js": {
|
|
215
222
|
"properties": [
|
|
223
|
+
{
|
|
224
|
+
"name": "accessibleDescriptionRef",
|
|
225
|
+
"description": "A space-separated list of IDs referencing the elements that\ndescribe the component for screen reader users. The referenced\nelements are announced in addition to the helper text and\nthe error message.",
|
|
226
|
+
"value": {
|
|
227
|
+
"type": [
|
|
228
|
+
"string"
|
|
229
|
+
]
|
|
230
|
+
}
|
|
231
|
+
},
|
|
216
232
|
{
|
|
217
233
|
"name": "accessibleName",
|
|
218
|
-
"description": "String used to label the component
|
|
234
|
+
"description": "String used to label the component for screen reader users.",
|
|
219
235
|
"value": {
|
|
220
236
|
"type": [
|
|
221
237
|
"string"
|
|
@@ -224,7 +240,7 @@
|
|
|
224
240
|
},
|
|
225
241
|
{
|
|
226
242
|
"name": "accessibleNameRef",
|
|
227
|
-
"description": "
|
|
243
|
+
"description": "A space-separated list of IDs referencing the elements that\nlabel the component for screen reader users.",
|
|
228
244
|
"value": {
|
|
229
245
|
"type": [
|
|
230
246
|
"string"
|
|
@@ -249,6 +265,17 @@
|
|
|
249
265
|
]
|
|
250
266
|
}
|
|
251
267
|
},
|
|
268
|
+
{
|
|
269
|
+
"name": "dateMetadataProvider",
|
|
270
|
+
"description": "A function that provides metadata for the dates the calendar is about to render: whether they\nare disabled, and CSS `part` names for styling from outside using the `::part()` selector.\nThe provider is called for a range of dates at a time, and again as the calendar renders\nfurther dates.\n\nIt receives a `DatePickerDateRange` and returns an array of `DatePickerDateMetadata` objects\nfor the dates in that range that have metadata. It can return a `Promise` to load the metadata\nasynchronously, and `null` or `undefined` when no date in the range has metadata.\n\nThe returned array has the following structure:\n\n```js\n[\n // The date is an ISO 8601 string.\n { date: '2026-01-01', disabled: true },\n\n // Adds a custom part name to the date.\n { date: '2026-01-02', part: 'busy' },\n]\n```\n\nA date is disabled if its metadata marks it disabled, or it is outside `min` and `max`.\nDisabled dates are not selectable, and a value on a disabled date makes the field invalid.\nThe provider does not affect which date is focused when opening the overlay. Use\n`initialPosition` property to provide a selectable date.\n\nWhile a returned `Promise` is pending, the dates it covers are not disabled yet and render with\nthe `loading` part. If the function throws or rejects, corresponding dates are requested again\nthe next time the user navigates.\n\nThe provider is used for validation also when the overlay is closed. Date is considered valid\nwhile the provider is pending. Unlike `<vaadin-date-picker>`, the value is not re-validated\nwhen the metadata is loaded, but checked against it at the next validation instead.\n\nKeep a stable reference to the function: assigning a new one clears the cache and re-fetches\nvisible range. Call `clearCache()` to re-fetch when the data behind the same function changed.",
|
|
271
|
+
"value": {
|
|
272
|
+
"type": [
|
|
273
|
+
"DatePickerDateMetadataProvider",
|
|
274
|
+
"null",
|
|
275
|
+
"undefined"
|
|
276
|
+
]
|
|
277
|
+
}
|
|
278
|
+
},
|
|
252
279
|
{
|
|
253
280
|
"name": "datePlaceholder",
|
|
254
281
|
"description": "A placeholder string for the date field.",
|
|
@@ -287,7 +314,7 @@
|
|
|
287
314
|
},
|
|
288
315
|
{
|
|
289
316
|
"name": "i18n",
|
|
290
|
-
"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 structure and default values:\n\n```js\n{\n // Accessible label to the date picker.\n // The property works in conjunction with label and accessibleName defined on the field.\n // If both properties are defined, then accessibleName takes precedence.\n // Then, the dateLabel value is concatenated with it.\n dateLabel: undefined;\n\n // Accessible label to the time picker.\n // The property works in conjunction with label and accessibleName defined on the field.\n // If both properties are defined, then accessibleName takes precedence.\n // Then, the dateLabel value is concatenated with it.\n timeLabel: undefined;\n}\n```\n\nAdditionally, all i18n properties from\n[`<vaadin-date-picker>`](https://cdn.vaadin.com/vaadin-web-components/25.3.0-
|
|
317
|
+
"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 structure and default values:\n\n```js\n{\n // Accessible label to the date picker.\n // The property works in conjunction with label and accessibleName defined on the field.\n // If both properties are defined, then accessibleName takes precedence.\n // Then, the dateLabel value is concatenated with it.\n dateLabel: undefined;\n\n // Accessible label to the time picker.\n // The property works in conjunction with label and accessibleName defined on the field.\n // If both properties are defined, then accessibleName takes precedence.\n // Then, the dateLabel value is concatenated with it.\n timeLabel: undefined;\n}\n```\n\nAdditionally, all i18n properties from\n[`<vaadin-date-picker>`](https://cdn.vaadin.com/vaadin-web-components/25.3.0-alpha11/#/elements/vaadin-date-picker) and\n[`<vaadin-time-picker>`](https://cdn.vaadin.com/vaadin-web-components/25.3.0-alpha11/#/elements/vaadin-time-picker) are supported.",
|
|
291
318
|
"value": {
|
|
292
319
|
"type": [
|
|
293
320
|
"Object"
|
package/web-types.lit.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/web-types",
|
|
3
3
|
"name": "@vaadin/date-time-picker",
|
|
4
|
-
"version": "25.3.0-
|
|
4
|
+
"version": "25.3.0-alpha11",
|
|
5
5
|
"description-markup": "markdown",
|
|
6
6
|
"framework": "lit",
|
|
7
7
|
"framework-config": {
|
|
@@ -16,19 +16,26 @@
|
|
|
16
16
|
"elements": [
|
|
17
17
|
{
|
|
18
18
|
"name": "vaadin-date-time-picker",
|
|
19
|
-
"description": "`<vaadin-date-time-picker>` is a Web Component providing a date time selection field.\n\n```html\n<vaadin-date-time-picker value=\"2019-09-16T15:00\"></vaadin-date-time-picker>\n```\n```js\ndateTimePicker.value = '2019-09-16T15:00';\n```\n\nWhen the selected `value` is changed, a `value-changed` event is triggered.\n\n### Styling\n\nThe following shadow DOM parts are available for styling:\n\nPart name | Description\n---------------------|----------------\n`label` | The slotted label element wrapper\n`input-fields` | The date and time pickers wrapper\n`helper-text` | The slotted helper text element wrapper\n`error-message` | The slotted error message element wrapper\n`required-indicator` | The `required` state indicator element\n\nThe following state attributes are available for styling:\n\nAttribute | Description\n--------------------|---------------------------------\n`disabled` | Set when the element is disabled\n`focused` | Set when the element is focused\n`focus-ring` | Set when the element is keyboard focused\n`readonly` | Set when the element is readonly\n`invalid` | Set when the element is invalid\n`has-label` | Set when the element has a label\n`has-value` | Set when the element has a value\n`has-helper` | Set when the element has helper text\n`has-error-message` | Set when the element has an error message\n`has-tooltip` | Set when the element has a slotted tooltip\n\nThe following custom CSS properties are available for styling:\n\nCustom CSS property |\n:--------------------------------------------------|\n| `--vaadin-date-time-picker-gap` |\n| `--vaadin-input-field-error-color` |\n| `--vaadin-input-field-error-font-size` |\n| `--vaadin-input-field-error-font-weight` |\n| `--vaadin-input-field-error-line-height` |\n| `--vaadin-input-field-label-color` |\n| `--vaadin-input-field-label-font-size` |\n| `--vaadin-input-field-label-font-weight` |\n| `--vaadin-input-field-label-line-height` |\n| `--vaadin-input-field-helper-color` |\n| `--vaadin-input-field-helper-font-size` |\n| `--vaadin-input-field-helper-font-weight` |\n| `--vaadin-input-field-helper-line-height` |\n| `--vaadin-input-field-required-indicator-color` |\n| `--vaadin-input-field-required-indicator` |\n\n### Internal components\n\nThe following components are created by `<vaadin-date-time-picker>` and placed in light DOM:\n\n- [`<vaadin-date-picker>`](https://cdn.vaadin.com/vaadin-web-components/25.3.0-
|
|
19
|
+
"description": "`<vaadin-date-time-picker>` is a Web Component providing a date time selection field.\n\n```html\n<vaadin-date-time-picker value=\"2019-09-16T15:00\"></vaadin-date-time-picker>\n```\n```js\ndateTimePicker.value = '2019-09-16T15:00';\n```\n\nWhen the selected `value` is changed, a `value-changed` event is triggered.\n\n### Styling\n\nThe following shadow DOM parts are available for styling:\n\nPart name | Description\n---------------------|----------------\n`label` | The slotted label element wrapper\n`input-fields` | The date and time pickers wrapper\n`helper-text` | The slotted helper text element wrapper\n`error-message` | The slotted error message element wrapper\n`required-indicator` | The `required` state indicator element\n\nThe following state attributes are available for styling:\n\nAttribute | Description\n--------------------|---------------------------------\n`disabled` | Set when the element is disabled\n`focused` | Set when the element is focused\n`focus-ring` | Set when the element is keyboard focused\n`readonly` | Set when the element is readonly\n`invalid` | Set when the element is invalid\n`has-label` | Set when the element has a label\n`has-value` | Set when the element has a value\n`has-helper` | Set when the element has helper text\n`has-error-message` | Set when the element has an error message\n`has-tooltip` | Set when the element has a slotted tooltip\n\nThe following custom CSS properties are available for styling:\n\nCustom CSS property |\n:--------------------------------------------------|\n| `--vaadin-date-time-picker-gap` |\n| `--vaadin-input-field-error-color` |\n| `--vaadin-input-field-error-font-size` |\n| `--vaadin-input-field-error-font-weight` |\n| `--vaadin-input-field-error-line-height` |\n| `--vaadin-input-field-label-color` |\n| `--vaadin-input-field-label-font-size` |\n| `--vaadin-input-field-label-font-weight` |\n| `--vaadin-input-field-label-line-height` |\n| `--vaadin-input-field-helper-color` |\n| `--vaadin-input-field-helper-font-size` |\n| `--vaadin-input-field-helper-font-weight` |\n| `--vaadin-input-field-helper-line-height` |\n| `--vaadin-input-field-required-indicator-color` |\n| `--vaadin-input-field-required-indicator` |\n\n### Internal components\n\nThe following components are created by `<vaadin-date-time-picker>` and placed in light DOM:\n\n- [`<vaadin-date-picker>`](https://cdn.vaadin.com/vaadin-web-components/25.3.0-alpha11/#/elements/vaadin-date-picker).\n- [`<vaadin-time-picker>`](https://cdn.vaadin.com/vaadin-web-components/25.3.0-alpha11/#/elements/vaadin-time-picker).\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.\n\n### Change events\n\nDepending on the nature of the value change that the user attempts to commit e.g. by pressing Enter,\nthe component can fire either a `change` event or an `unparsable-change` event:\n\nValue change | Event\n:------------------------|:------------------\nempty => parsable | change\nempty => unparsable | unparsable-change\nparsable => empty | change\nparsable => parsable | change\nparsable => unparsable | change\nunparsable => empty | unparsable-change\nunparsable => parsable | change\nunparsable => unparsable | unparsable-change\nincomplete => empty | unparsable-change\nincomplete => parsable | change\nincomplete => unparsable | unparsable-change\nempty => incomplete | unparsable-change\nparsable => incomplete | change\nunparsable => incomplete | unparsable-change",
|
|
20
20
|
"extension": true,
|
|
21
21
|
"attributes": [
|
|
22
|
+
{
|
|
23
|
+
"name": ".accessibleDescriptionRef",
|
|
24
|
+
"description": "A space-separated list of IDs referencing the elements that\ndescribe the component for screen reader users. The referenced\nelements are announced in addition to the helper text and\nthe error message.",
|
|
25
|
+
"value": {
|
|
26
|
+
"kind": "expression"
|
|
27
|
+
}
|
|
28
|
+
},
|
|
22
29
|
{
|
|
23
30
|
"name": ".accessibleName",
|
|
24
|
-
"description": "String used to label the component
|
|
31
|
+
"description": "String used to label the component for screen reader users.",
|
|
25
32
|
"value": {
|
|
26
33
|
"kind": "expression"
|
|
27
34
|
}
|
|
28
35
|
},
|
|
29
36
|
{
|
|
30
37
|
"name": ".accessibleNameRef",
|
|
31
|
-
"description": "
|
|
38
|
+
"description": "A space-separated list of IDs referencing the elements that\nlabel the component for screen reader users.",
|
|
32
39
|
"value": {
|
|
33
40
|
"kind": "expression"
|
|
34
41
|
}
|
|
@@ -47,6 +54,13 @@
|
|
|
47
54
|
"kind": "expression"
|
|
48
55
|
}
|
|
49
56
|
},
|
|
57
|
+
{
|
|
58
|
+
"name": ".dateMetadataProvider",
|
|
59
|
+
"description": "A function that provides metadata for the dates the calendar is about to render: whether they\nare disabled, and CSS `part` names for styling from outside using the `::part()` selector.\nThe provider is called for a range of dates at a time, and again as the calendar renders\nfurther dates.\n\nIt receives a `DatePickerDateRange` and returns an array of `DatePickerDateMetadata` objects\nfor the dates in that range that have metadata. It can return a `Promise` to load the metadata\nasynchronously, and `null` or `undefined` when no date in the range has metadata.\n\nThe returned array has the following structure:\n\n```js\n[\n // The date is an ISO 8601 string.\n { date: '2026-01-01', disabled: true },\n\n // Adds a custom part name to the date.\n { date: '2026-01-02', part: 'busy' },\n]\n```\n\nA date is disabled if its metadata marks it disabled, or it is outside `min` and `max`.\nDisabled dates are not selectable, and a value on a disabled date makes the field invalid.\nThe provider does not affect which date is focused when opening the overlay. Use\n`initialPosition` property to provide a selectable date.\n\nWhile a returned `Promise` is pending, the dates it covers are not disabled yet and render with\nthe `loading` part. If the function throws or rejects, corresponding dates are requested again\nthe next time the user navigates.\n\nThe provider is used for validation also when the overlay is closed. Date is considered valid\nwhile the provider is pending. Unlike `<vaadin-date-picker>`, the value is not re-validated\nwhen the metadata is loaded, but checked against it at the next validation instead.\n\nKeep a stable reference to the function: assigning a new one clears the cache and re-fetches\nvisible range. Call `clearCache()` to re-fetch when the data behind the same function changed.",
|
|
60
|
+
"value": {
|
|
61
|
+
"kind": "expression"
|
|
62
|
+
}
|
|
63
|
+
},
|
|
50
64
|
{
|
|
51
65
|
"name": ".datePlaceholder",
|
|
52
66
|
"description": "A placeholder string for the date field.",
|
|
@@ -77,7 +91,7 @@
|
|
|
77
91
|
},
|
|
78
92
|
{
|
|
79
93
|
"name": ".i18n",
|
|
80
|
-
"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 structure and default values:\n\n```js\n{\n // Accessible label to the date picker.\n // The property works in conjunction with label and accessibleName defined on the field.\n // If both properties are defined, then accessibleName takes precedence.\n // Then, the dateLabel value is concatenated with it.\n dateLabel: undefined;\n\n // Accessible label to the time picker.\n // The property works in conjunction with label and accessibleName defined on the field.\n // If both properties are defined, then accessibleName takes precedence.\n // Then, the dateLabel value is concatenated with it.\n timeLabel: undefined;\n}\n```\n\nAdditionally, all i18n properties from\n[`<vaadin-date-picker>`](https://cdn.vaadin.com/vaadin-web-components/25.3.0-
|
|
94
|
+
"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 structure and default values:\n\n```js\n{\n // Accessible label to the date picker.\n // The property works in conjunction with label and accessibleName defined on the field.\n // If both properties are defined, then accessibleName takes precedence.\n // Then, the dateLabel value is concatenated with it.\n dateLabel: undefined;\n\n // Accessible label to the time picker.\n // The property works in conjunction with label and accessibleName defined on the field.\n // If both properties are defined, then accessibleName takes precedence.\n // Then, the dateLabel value is concatenated with it.\n timeLabel: undefined;\n}\n```\n\nAdditionally, all i18n properties from\n[`<vaadin-date-picker>`](https://cdn.vaadin.com/vaadin-web-components/25.3.0-alpha11/#/elements/vaadin-date-picker) and\n[`<vaadin-time-picker>`](https://cdn.vaadin.com/vaadin-web-components/25.3.0-alpha11/#/elements/vaadin-time-picker) are supported.",
|
|
81
95
|
"value": {
|
|
82
96
|
"kind": "expression"
|
|
83
97
|
}
|