@vaadin/date-time-picker 25.3.0-alpha10 → 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 +58 -0
- package/package.json +12 -12
- package/src/vaadin-date-time-picker-mixin.d.ts +46 -1
- package/src/vaadin-date-time-picker-mixin.js +61 -0
- package/web-types.json +14 -3
- package/web-types.lit.json +10 -3
package/custom-elements.json
CHANGED
|
@@ -102,6 +102,21 @@
|
|
|
102
102
|
"package": "@vaadin/field-base/src/validate-mixin.js"
|
|
103
103
|
}
|
|
104
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
|
+
},
|
|
105
120
|
{
|
|
106
121
|
"kind": "field",
|
|
107
122
|
"name": "datePlaceholder",
|
|
@@ -406,6 +421,14 @@
|
|
|
406
421
|
"description": "Specify that this control should have input focus when the page loads.",
|
|
407
422
|
"fieldName": "autofocus"
|
|
408
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
|
+
},
|
|
409
432
|
{
|
|
410
433
|
"name": "date-placeholder",
|
|
411
434
|
"type": {
|
|
@@ -712,6 +735,29 @@
|
|
|
712
735
|
"module": "src/vaadin-date-time-picker-mixin.js"
|
|
713
736
|
}
|
|
714
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
|
+
},
|
|
715
761
|
{
|
|
716
762
|
"kind": "field",
|
|
717
763
|
"name": "datePlaceholder",
|
|
@@ -1085,6 +1131,18 @@
|
|
|
1085
1131
|
"module": "src/vaadin-date-time-picker-mixin.js"
|
|
1086
1132
|
}
|
|
1087
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
|
+
},
|
|
1088
1146
|
{
|
|
1089
1147
|
"name": "date-placeholder",
|
|
1090
1148
|
"type": {
|
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
|
}
|
|
@@ -181,6 +181,51 @@ export const DateTimePickerMixin = (superClass) =>
|
|
|
181
181
|
sync: true,
|
|
182
182
|
},
|
|
183
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
|
+
|
|
184
229
|
/**
|
|
185
230
|
* Set to true to prevent the overlays from opening automatically.
|
|
186
231
|
* @attr {boolean} auto-open-disabled
|
|
@@ -246,6 +291,7 @@ export const DateTimePickerMixin = (superClass) =>
|
|
|
246
291
|
'__stepChanged(step, __timePicker)',
|
|
247
292
|
'__initialPositionChanged(initialPosition, __datePicker)',
|
|
248
293
|
'__showWeekNumbersChanged(showWeekNumbers, __datePicker)',
|
|
294
|
+
'__dateMetadataProviderChanged(dateMetadataProvider, __datePicker)',
|
|
249
295
|
'__requiredChanged(required, __datePicker, __timePicker)',
|
|
250
296
|
'__invalidChanged(invalid, __datePicker, __timePicker)',
|
|
251
297
|
'__disabledChanged(disabled, __datePicker, __timePicker)',
|
|
@@ -545,6 +591,7 @@ export const DateTimePickerMixin = (superClass) =>
|
|
|
545
591
|
this.datePlaceholder = newDatePicker.placeholder;
|
|
546
592
|
this.initialPosition = newDatePicker.initialPosition;
|
|
547
593
|
this.showWeekNumbers = newDatePicker.showWeekNumbers;
|
|
594
|
+
this.dateMetadataProvider = newDatePicker.dateMetadataProvider;
|
|
548
595
|
}
|
|
549
596
|
|
|
550
597
|
// Min and max are always synchronized from date time picker (host) to inner fields because time picker
|
|
@@ -663,6 +710,13 @@ export const DateTimePickerMixin = (superClass) =>
|
|
|
663
710
|
}
|
|
664
711
|
}
|
|
665
712
|
|
|
713
|
+
/** @private */
|
|
714
|
+
__dateMetadataProviderChanged(dateMetadataProvider, datePicker) {
|
|
715
|
+
if (datePicker) {
|
|
716
|
+
datePicker.dateMetadataProvider = dateMetadataProvider;
|
|
717
|
+
}
|
|
718
|
+
}
|
|
719
|
+
|
|
666
720
|
/** @private */
|
|
667
721
|
__invalidChanged(invalid, datePicker, timePicker) {
|
|
668
722
|
if (datePicker) {
|
|
@@ -801,6 +855,13 @@ export const DateTimePickerMixin = (superClass) =>
|
|
|
801
855
|
);
|
|
802
856
|
}
|
|
803
857
|
|
|
858
|
+
/**
|
|
859
|
+
* Clears the `dateMetadataProvider` cache and reloads the date metadata.
|
|
860
|
+
*/
|
|
861
|
+
clearCache() {
|
|
862
|
+
this.__datePicker?.clearCache();
|
|
863
|
+
}
|
|
864
|
+
|
|
804
865
|
/**
|
|
805
866
|
* Returns true if the current input value satisfies all constraints (if any)
|
|
806
867
|
*
|
package/web-types.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
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
13
|
{
|
|
14
14
|
"name": "accessible-description-ref",
|
|
@@ -265,6 +265,17 @@
|
|
|
265
265
|
]
|
|
266
266
|
}
|
|
267
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
|
+
},
|
|
268
279
|
{
|
|
269
280
|
"name": "datePlaceholder",
|
|
270
281
|
"description": "A placeholder string for the date field.",
|
|
@@ -303,7 +314,7 @@
|
|
|
303
314
|
},
|
|
304
315
|
{
|
|
305
316
|
"name": "i18n",
|
|
306
|
-
"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.",
|
|
307
318
|
"value": {
|
|
308
319
|
"type": [
|
|
309
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,7 +16,7 @@
|
|
|
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
22
|
{
|
|
@@ -54,6 +54,13 @@
|
|
|
54
54
|
"kind": "expression"
|
|
55
55
|
}
|
|
56
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
|
+
},
|
|
57
64
|
{
|
|
58
65
|
"name": ".datePlaceholder",
|
|
59
66
|
"description": "A placeholder string for the date field.",
|
|
@@ -84,7 +91,7 @@
|
|
|
84
91
|
},
|
|
85
92
|
{
|
|
86
93
|
"name": ".i18n",
|
|
87
|
-
"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.",
|
|
88
95
|
"value": {
|
|
89
96
|
"kind": "expression"
|
|
90
97
|
}
|