@vaadin/date-picker 24.6.0-alpha3 → 24.6.0-alpha5

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vaadin/date-picker",
3
- "version": "24.6.0-alpha3",
3
+ "version": "24.6.0-alpha5",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -36,19 +36,19 @@
36
36
  "dependencies": {
37
37
  "@open-wc/dedupe-mixin": "^1.3.0",
38
38
  "@polymer/polymer": "^3.2.0",
39
- "@vaadin/a11y-base": "24.6.0-alpha3",
40
- "@vaadin/button": "24.6.0-alpha3",
41
- "@vaadin/component-base": "24.6.0-alpha3",
42
- "@vaadin/field-base": "24.6.0-alpha3",
43
- "@vaadin/input-container": "24.6.0-alpha3",
44
- "@vaadin/overlay": "24.6.0-alpha3",
45
- "@vaadin/vaadin-lumo-styles": "24.6.0-alpha3",
46
- "@vaadin/vaadin-material-styles": "24.6.0-alpha3",
47
- "@vaadin/vaadin-themable-mixin": "24.6.0-alpha3",
39
+ "@vaadin/a11y-base": "24.6.0-alpha5",
40
+ "@vaadin/button": "24.6.0-alpha5",
41
+ "@vaadin/component-base": "24.6.0-alpha5",
42
+ "@vaadin/field-base": "24.6.0-alpha5",
43
+ "@vaadin/input-container": "24.6.0-alpha5",
44
+ "@vaadin/overlay": "24.6.0-alpha5",
45
+ "@vaadin/vaadin-lumo-styles": "24.6.0-alpha5",
46
+ "@vaadin/vaadin-material-styles": "24.6.0-alpha5",
47
+ "@vaadin/vaadin-themable-mixin": "24.6.0-alpha5",
48
48
  "lit": "^3.0.0"
49
49
  },
50
50
  "devDependencies": {
51
- "@vaadin/chai-plugins": "24.6.0-alpha3",
51
+ "@vaadin/chai-plugins": "24.6.0-alpha5",
52
52
  "@vaadin/testing-helpers": "^1.0.0",
53
53
  "sinon": "^18.0.0"
54
54
  },
@@ -56,5 +56,5 @@
56
56
  "web-types.json",
57
57
  "web-types.lit.json"
58
58
  ],
59
- "gitHead": "f917e587caaf86b3d55598233811409b0f34ff69"
59
+ "gitHead": "cbfa46fe276f254dcaa99a622710d56df7f0a539"
60
60
  }
@@ -1,3 +1,5 @@
1
+ import type { DatePickerDate } from './vaadin-date-picker-mixin.js';
2
+
1
3
  /**
2
4
  * Get ISO 8601 week number for the given date.
3
5
  *
@@ -21,7 +23,7 @@ declare function dateAllowed(
21
23
  date: Date,
22
24
  min: Date | null,
23
25
  max: Date | null,
24
- isDateDisabled: (DatePickerDate) => boolean | null,
26
+ isDateDisabled: (date: DatePickerDate) => boolean | null,
25
27
  ): boolean;
26
28
 
27
29
  /**
@@ -39,8 +39,8 @@ export function getISOWeekNumber(date) {
39
39
  /**
40
40
  * Creates a new object with the same date, but sets the hours, minutes, seconds and milliseconds to 0.
41
41
  *
42
- * @param {Date} date
43
- * @return {Date} The same date time elements set to 0.
42
+ * @param {Date} date in system timezone
43
+ * @return {Date} The same date with time elements set to 0, in UTC timezone.
44
44
  */
45
45
  export function normalizeDate(date) {
46
46
  const normalizedDate = new Date(date);
@@ -48,17 +48,29 @@ export function normalizeDate(date) {
48
48
  return normalizedDate;
49
49
  }
50
50
 
51
+ /**
52
+ * Creates a new object with the same date, but sets the hours, minutes, seconds and milliseconds to 0.
53
+ *
54
+ * Uses UTC date components to allow handling date instances independently of
55
+ * the system time-zone.
56
+ *
57
+ * @param {Date} date in UTC timezone
58
+ * @return {Date} The same date with time elements set to 0, in UTC timezone.
59
+ */
60
+ export function normalizeUTCDate(date) {
61
+ return new Date(Date.UTC(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate(), 0, 0, 0, 0));
62
+ }
63
+
51
64
  /**
52
65
  * Check if two dates are equal.
53
66
  *
54
67
  * @param {Date} date1
55
68
  * @param {Date} date2
69
+ * @param {function(Date): Date} normalizer
56
70
  * @return {boolean} True if the given date objects refer to the same date
57
71
  */
58
- export function dateEquals(date1, date2) {
59
- return (
60
- date1 instanceof Date && date2 instanceof Date && normalizeDate(date1).getTime() === normalizeDate(date2).getTime()
61
- );
72
+ export function dateEquals(date1, date2, normalizer = normalizeDate) {
73
+ return date1 instanceof Date && date2 instanceof Date && normalizer(date1).getTime() === normalizer(date2).getTime();
62
74
  }
63
75
 
64
76
  /**
@@ -164,7 +176,7 @@ export function getAdjustedYear(referenceDate, year, month = 0, day = 1) {
164
176
  * - ISO 8601 `"YYYY-MM-DD"`
165
177
  * - 6-digit extended ISO 8601 `"+YYYYYY-MM-DD"`, `"-YYYYYY-MM-DD"`
166
178
  * @param {!string} str Date string to parse
167
- * @return {Date} Parsed date
179
+ * @return {Date} Parsed date in system timezone
168
180
  */
169
181
  export function parseDate(str) {
170
182
  // Parsing with RegExp to ensure correct format
@@ -179,3 +191,90 @@ export function parseDate(str) {
179
191
  date.setDate(parseInt(parts[3], 10));
180
192
  return date;
181
193
  }
194
+
195
+ /**
196
+ * Parse date string of one of the following date formats:
197
+ * - ISO 8601 `"YYYY-MM-DD"`
198
+ * - 6-digit extended ISO 8601 `"+YYYYYY-MM-DD"`, `"-YYYYYY-MM-DD"`
199
+ *
200
+ * Uses UTC date components to allow handling date instances independently of
201
+ * the system time-zone.
202
+ *
203
+ * @param {!string} str Date string to parse
204
+ * @return {Date} Parsed date in UTC timezone
205
+ */
206
+ export function parseUTCDate(str) {
207
+ // Parsing with RegExp to ensure correct format
208
+ const parts = /^([-+]\d{1}|\d{2,4}|[-+]\d{6})-(\d{1,2})-(\d{1,2})$/u.exec(str);
209
+ if (!parts) {
210
+ return undefined;
211
+ }
212
+
213
+ const date = new Date(Date.UTC(0, 0)); // Wrong date (1900-01-01), but with midnight in UTC
214
+ date.setUTCFullYear(parseInt(parts[1], 10));
215
+ date.setUTCMonth(parseInt(parts[2], 10) - 1);
216
+ date.setUTCDate(parseInt(parts[3], 10));
217
+
218
+ return date;
219
+ }
220
+
221
+ function formatISODateBase(dateParts) {
222
+ const pad = (num, fmt = '00') => (fmt + num).substr((fmt + num).length - fmt.length);
223
+
224
+ let yearSign = '';
225
+ let yearFmt = '0000';
226
+ let yearAbs = dateParts.year;
227
+ if (yearAbs < 0) {
228
+ yearAbs = -yearAbs;
229
+ yearSign = '-';
230
+ yearFmt = '000000';
231
+ } else if (dateParts.year >= 10000) {
232
+ yearSign = '+';
233
+ yearFmt = '000000';
234
+ }
235
+
236
+ const year = yearSign + pad(yearAbs, yearFmt);
237
+ const month = pad(dateParts.month + 1);
238
+ const day = pad(dateParts.day);
239
+ return [year, month, day].join('-');
240
+ }
241
+
242
+ /**
243
+ * Format a date instance in ISO 8601 (`"YYYY-MM-DD"`) or 6-digit extended ISO
244
+ * 8601 (`"+YYYYYY-MM-DD"`, `"-YYYYYY-MM-DD"`) format.
245
+ * @param {Date} date in system timezone
246
+ * @returns {string}
247
+ */
248
+ export function formatISODate(date) {
249
+ if (!(date instanceof Date)) {
250
+ return '';
251
+ }
252
+
253
+ return formatISODateBase({
254
+ year: date.getFullYear(),
255
+ month: date.getMonth(),
256
+ day: date.getDate(),
257
+ });
258
+ }
259
+
260
+ /**
261
+ * Format a date instance in ISO 8601 (`"YYYY-MM-DD"`) or 6-digit extended ISO
262
+ * 8601 (`"+YYYYYY-MM-DD"`, `"-YYYYYY-MM-DD"`) format.
263
+ *
264
+ * Uses UTC date components to allow handling date instances independently of
265
+ * the system time-zone.
266
+ *
267
+ * @param {Date} date in UTC timezone
268
+ * @returns {string}
269
+ */
270
+ export function formatUTCISODate(date) {
271
+ if (!(date instanceof Date)) {
272
+ return '';
273
+ }
274
+
275
+ return formatISODateBase({
276
+ year: date.getUTCFullYear(),
277
+ month: date.getUTCMonth(),
278
+ day: date.getUTCDate(),
279
+ });
280
+ }
@@ -17,6 +17,7 @@ import {
17
17
  dateAllowed,
18
18
  dateEquals,
19
19
  extractDateParts,
20
+ formatISODate,
20
21
  getAdjustedYear,
21
22
  getClosestDate,
22
23
  parseDate,
@@ -772,28 +773,7 @@ export const DatePickerMixin = (subclass) =>
772
773
 
773
774
  /** @private */
774
775
  _formatISO(date) {
775
- if (!(date instanceof Date)) {
776
- return '';
777
- }
778
-
779
- const pad = (num, fmt = '00') => (fmt + num).substr((fmt + num).length - fmt.length);
780
-
781
- let yearSign = '';
782
- let yearFmt = '0000';
783
- let yearAbs = date.getFullYear();
784
- if (yearAbs < 0) {
785
- yearAbs = -yearAbs;
786
- yearSign = '-';
787
- yearFmt = '000000';
788
- } else if (date.getFullYear() >= 10000) {
789
- yearSign = '+';
790
- yearFmt = '000000';
791
- }
792
-
793
- const year = yearSign + pad(yearAbs, yearFmt);
794
- const month = pad(date.getMonth() + 1);
795
- const day = pad(date.getDate());
796
- return [year, month, day].join('-');
776
+ return formatISODate(date);
797
777
  }
798
778
 
799
779
  /** @protected */
package/web-types.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/web-types",
3
3
  "name": "@vaadin/date-picker",
4
- "version": "24.6.0-alpha3",
4
+ "version": "24.6.0-alpha5",
5
5
  "description-markup": "markdown",
6
6
  "contributions": {
7
7
  "html": {
@@ -344,7 +344,7 @@
344
344
  },
345
345
  {
346
346
  "name": "vaadin-date-picker",
347
- "description": "`<vaadin-date-picker>` is an input field that allows to enter a date by typing or by selecting from a calendar overlay.\n\n```html\n<vaadin-date-picker label=\"Birthday\"></vaadin-date-picker>\n```\n```js\ndatePicker.value = '2016-03-02';\n```\n\nWhen the selected `value` is changed, a `value-changed` event is triggered.\n\n### Styling\n\nThe following custom properties are available for styling:\n\nCustom property | Description | Default\n-------------------------------|----------------------------|---------\n`--vaadin-field-default-width` | Default width of the field | `12em`\n\n`<vaadin-date-picker>` provides the same set of shadow DOM parts and state attributes as `<vaadin-text-field>`.\nSee [`<vaadin-text-field>`](https://cdn.vaadin.com/vaadin-web-components/24.6.0-alpha3/#/elements/vaadin-text-field) for the styling documentation.\n\nIn addition to `<vaadin-text-field>` parts, the following parts are available for theming:\n\nPart name | Description\n----------------------|--------------------\n`toggle-button` | Toggle button\n\nIn addition to `<vaadin-text-field>` state attributes, the following state attributes are available for theming:\n\nAttribute | Description | Part name\n-----------|--------------------------------------------------|-----------\n`opened` | Set when the date selector overlay is opened | :host\n\nIf you want to replace the default `<input>` and its container with a custom implementation to get full control\nover the input field, consider using the [`<vaadin-date-picker-light>`](https://cdn.vaadin.com/vaadin-web-components/24.6.0-alpha3/#/elements/vaadin-date-picker-light) element.\n\n### Internal components\n\nIn addition to `<vaadin-date-picker>` itself, the following internal\ncomponents are themable:\n\n- `<vaadin-date-picker-overlay>` - has the same API as [`<vaadin-overlay>`](https://cdn.vaadin.com/vaadin-web-components/24.6.0-alpha3/#/elements/vaadin-overlay).\n- `<vaadin-date-picker-overlay-content>`\n- `<vaadin-date-picker-month-scroller>`\n- `<vaadin-date-picker-year-scroller>`\n- `<vaadin-date-picker-year>`\n- `<vaadin-month-calendar>`\n- [`<vaadin-input-container>`](https://cdn.vaadin.com/vaadin-web-components/24.6.0-alpha3/#/elements/vaadin-input-container) - an internal element wrapping the input.\n\nIn order to style the overlay content, use `<vaadin-date-picker-overlay-content>` shadow DOM parts:\n\nPart name | Description\n----------------------|--------------------\n`overlay-header` | Fullscreen mode header\n`label` | Fullscreen mode value/label\n`clear-button` | Fullscreen mode clear button\n`toggle-button` | Fullscreen mode toggle button\n`years-toggle-button` | Fullscreen mode years scroller toggle\n`toolbar` | Footer bar with slotted buttons\n\nThe following state attributes are available on the `<vaadin-date-picker-overlay-content>` element:\n\nAttribute | Description\n----------------|-------------------------------------------------\n`desktop` | Set when the overlay content is in desktop mode\n`fullscreen` | Set when the overlay content is in fullscreen mode\n`years-visible` | Set when the year scroller is visible in fullscreen mode\n\nIn order to style the month calendar, use `<vaadin-month-calendar>` shadow DOM parts:\n\nPart name | Description\n----------------------|--------------------\n`month-header` | Month title\n`weekdays` | Weekday container\n`weekday` | Weekday element\n`week-numbers` | Week numbers container\n`week-number` | Week number element\n`date` | Date element\n`disabled` | Disabled date element\n`focused` | Focused date element\n`selected` | Selected date element\n`today` | Date element corresponding to the current day\n`past` | Date element corresponding to the date in the past\n`future` | Date element corresponding to the date in the future\n\nIn order to style year scroller elements, use `<vaadin-date-picker-year>` shadow DOM parts:\n\nPart name | Description\n----------------------|--------------------\n`year-number` | Year number\n`year-separator` | Year separator\n\nNote: the `theme` attribute value set on `<vaadin-date-picker>` is\npropagated to the internal components listed above.\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",
347
+ "description": "`<vaadin-date-picker>` is an input field that allows to enter a date by typing or by selecting from a calendar overlay.\n\n```html\n<vaadin-date-picker label=\"Birthday\"></vaadin-date-picker>\n```\n```js\ndatePicker.value = '2016-03-02';\n```\n\nWhen the selected `value` is changed, a `value-changed` event is triggered.\n\n### Styling\n\nThe following custom properties are available for styling:\n\nCustom property | Description | Default\n-------------------------------|----------------------------|---------\n`--vaadin-field-default-width` | Default width of the field | `12em`\n\n`<vaadin-date-picker>` provides the same set of shadow DOM parts and state attributes as `<vaadin-text-field>`.\nSee [`<vaadin-text-field>`](https://cdn.vaadin.com/vaadin-web-components/24.6.0-alpha5/#/elements/vaadin-text-field) for the styling documentation.\n\nIn addition to `<vaadin-text-field>` parts, the following parts are available for theming:\n\nPart name | Description\n----------------------|--------------------\n`toggle-button` | Toggle button\n\nIn addition to `<vaadin-text-field>` state attributes, the following state attributes are available for theming:\n\nAttribute | Description | Part name\n-----------|--------------------------------------------------|-----------\n`opened` | Set when the date selector overlay is opened | :host\n\nIf you want to replace the default `<input>` and its container with a custom implementation to get full control\nover the input field, consider using the [`<vaadin-date-picker-light>`](https://cdn.vaadin.com/vaadin-web-components/24.6.0-alpha5/#/elements/vaadin-date-picker-light) element.\n\n### Internal components\n\nIn addition to `<vaadin-date-picker>` itself, the following internal\ncomponents are themable:\n\n- `<vaadin-date-picker-overlay>` - has the same API as [`<vaadin-overlay>`](https://cdn.vaadin.com/vaadin-web-components/24.6.0-alpha5/#/elements/vaadin-overlay).\n- `<vaadin-date-picker-overlay-content>`\n- `<vaadin-date-picker-month-scroller>`\n- `<vaadin-date-picker-year-scroller>`\n- `<vaadin-date-picker-year>`\n- `<vaadin-month-calendar>`\n- [`<vaadin-input-container>`](https://cdn.vaadin.com/vaadin-web-components/24.6.0-alpha5/#/elements/vaadin-input-container) - an internal element wrapping the input.\n\nIn order to style the overlay content, use `<vaadin-date-picker-overlay-content>` shadow DOM parts:\n\nPart name | Description\n----------------------|--------------------\n`overlay-header` | Fullscreen mode header\n`label` | Fullscreen mode value/label\n`clear-button` | Fullscreen mode clear button\n`toggle-button` | Fullscreen mode toggle button\n`years-toggle-button` | Fullscreen mode years scroller toggle\n`toolbar` | Footer bar with slotted buttons\n\nThe following state attributes are available on the `<vaadin-date-picker-overlay-content>` element:\n\nAttribute | Description\n----------------|-------------------------------------------------\n`desktop` | Set when the overlay content is in desktop mode\n`fullscreen` | Set when the overlay content is in fullscreen mode\n`years-visible` | Set when the year scroller is visible in fullscreen mode\n\nIn order to style the month calendar, use `<vaadin-month-calendar>` shadow DOM parts:\n\nPart name | Description\n----------------------|--------------------\n`month-header` | Month title\n`weekdays` | Weekday container\n`weekday` | Weekday element\n`week-numbers` | Week numbers container\n`week-number` | Week number element\n`date` | Date element\n`disabled` | Disabled date element\n`focused` | Focused date element\n`selected` | Selected date element\n`today` | Date element corresponding to the current day\n`past` | Date element corresponding to the date in the past\n`future` | Date element corresponding to the date in the future\n\nIn order to style year scroller elements, use `<vaadin-date-picker-year>` shadow DOM parts:\n\nPart name | Description\n----------------------|--------------------\n`year-number` | Year number\n`year-separator` | Year separator\n\nNote: the `theme` attribute value set on `<vaadin-date-picker>` is\npropagated to the internal components listed above.\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",
348
348
  "attributes": [
349
349
  {
350
350
  "name": "disabled",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/web-types",
3
3
  "name": "@vaadin/date-picker",
4
- "version": "24.6.0-alpha3",
4
+ "version": "24.6.0-alpha5",
5
5
  "description-markup": "markdown",
6
6
  "framework": "lit",
7
7
  "framework-config": {
@@ -163,7 +163,7 @@
163
163
  },
164
164
  {
165
165
  "name": "vaadin-date-picker",
166
- "description": "`<vaadin-date-picker>` is an input field that allows to enter a date by typing or by selecting from a calendar overlay.\n\n```html\n<vaadin-date-picker label=\"Birthday\"></vaadin-date-picker>\n```\n```js\ndatePicker.value = '2016-03-02';\n```\n\nWhen the selected `value` is changed, a `value-changed` event is triggered.\n\n### Styling\n\nThe following custom properties are available for styling:\n\nCustom property | Description | Default\n-------------------------------|----------------------------|---------\n`--vaadin-field-default-width` | Default width of the field | `12em`\n\n`<vaadin-date-picker>` provides the same set of shadow DOM parts and state attributes as `<vaadin-text-field>`.\nSee [`<vaadin-text-field>`](https://cdn.vaadin.com/vaadin-web-components/24.6.0-alpha3/#/elements/vaadin-text-field) for the styling documentation.\n\nIn addition to `<vaadin-text-field>` parts, the following parts are available for theming:\n\nPart name | Description\n----------------------|--------------------\n`toggle-button` | Toggle button\n\nIn addition to `<vaadin-text-field>` state attributes, the following state attributes are available for theming:\n\nAttribute | Description | Part name\n-----------|--------------------------------------------------|-----------\n`opened` | Set when the date selector overlay is opened | :host\n\nIf you want to replace the default `<input>` and its container with a custom implementation to get full control\nover the input field, consider using the [`<vaadin-date-picker-light>`](https://cdn.vaadin.com/vaadin-web-components/24.6.0-alpha3/#/elements/vaadin-date-picker-light) element.\n\n### Internal components\n\nIn addition to `<vaadin-date-picker>` itself, the following internal\ncomponents are themable:\n\n- `<vaadin-date-picker-overlay>` - has the same API as [`<vaadin-overlay>`](https://cdn.vaadin.com/vaadin-web-components/24.6.0-alpha3/#/elements/vaadin-overlay).\n- `<vaadin-date-picker-overlay-content>`\n- `<vaadin-date-picker-month-scroller>`\n- `<vaadin-date-picker-year-scroller>`\n- `<vaadin-date-picker-year>`\n- `<vaadin-month-calendar>`\n- [`<vaadin-input-container>`](https://cdn.vaadin.com/vaadin-web-components/24.6.0-alpha3/#/elements/vaadin-input-container) - an internal element wrapping the input.\n\nIn order to style the overlay content, use `<vaadin-date-picker-overlay-content>` shadow DOM parts:\n\nPart name | Description\n----------------------|--------------------\n`overlay-header` | Fullscreen mode header\n`label` | Fullscreen mode value/label\n`clear-button` | Fullscreen mode clear button\n`toggle-button` | Fullscreen mode toggle button\n`years-toggle-button` | Fullscreen mode years scroller toggle\n`toolbar` | Footer bar with slotted buttons\n\nThe following state attributes are available on the `<vaadin-date-picker-overlay-content>` element:\n\nAttribute | Description\n----------------|-------------------------------------------------\n`desktop` | Set when the overlay content is in desktop mode\n`fullscreen` | Set when the overlay content is in fullscreen mode\n`years-visible` | Set when the year scroller is visible in fullscreen mode\n\nIn order to style the month calendar, use `<vaadin-month-calendar>` shadow DOM parts:\n\nPart name | Description\n----------------------|--------------------\n`month-header` | Month title\n`weekdays` | Weekday container\n`weekday` | Weekday element\n`week-numbers` | Week numbers container\n`week-number` | Week number element\n`date` | Date element\n`disabled` | Disabled date element\n`focused` | Focused date element\n`selected` | Selected date element\n`today` | Date element corresponding to the current day\n`past` | Date element corresponding to the date in the past\n`future` | Date element corresponding to the date in the future\n\nIn order to style year scroller elements, use `<vaadin-date-picker-year>` shadow DOM parts:\n\nPart name | Description\n----------------------|--------------------\n`year-number` | Year number\n`year-separator` | Year separator\n\nNote: the `theme` attribute value set on `<vaadin-date-picker>` is\npropagated to the internal components listed above.\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",
166
+ "description": "`<vaadin-date-picker>` is an input field that allows to enter a date by typing or by selecting from a calendar overlay.\n\n```html\n<vaadin-date-picker label=\"Birthday\"></vaadin-date-picker>\n```\n```js\ndatePicker.value = '2016-03-02';\n```\n\nWhen the selected `value` is changed, a `value-changed` event is triggered.\n\n### Styling\n\nThe following custom properties are available for styling:\n\nCustom property | Description | Default\n-------------------------------|----------------------------|---------\n`--vaadin-field-default-width` | Default width of the field | `12em`\n\n`<vaadin-date-picker>` provides the same set of shadow DOM parts and state attributes as `<vaadin-text-field>`.\nSee [`<vaadin-text-field>`](https://cdn.vaadin.com/vaadin-web-components/24.6.0-alpha5/#/elements/vaadin-text-field) for the styling documentation.\n\nIn addition to `<vaadin-text-field>` parts, the following parts are available for theming:\n\nPart name | Description\n----------------------|--------------------\n`toggle-button` | Toggle button\n\nIn addition to `<vaadin-text-field>` state attributes, the following state attributes are available for theming:\n\nAttribute | Description | Part name\n-----------|--------------------------------------------------|-----------\n`opened` | Set when the date selector overlay is opened | :host\n\nIf you want to replace the default `<input>` and its container with a custom implementation to get full control\nover the input field, consider using the [`<vaadin-date-picker-light>`](https://cdn.vaadin.com/vaadin-web-components/24.6.0-alpha5/#/elements/vaadin-date-picker-light) element.\n\n### Internal components\n\nIn addition to `<vaadin-date-picker>` itself, the following internal\ncomponents are themable:\n\n- `<vaadin-date-picker-overlay>` - has the same API as [`<vaadin-overlay>`](https://cdn.vaadin.com/vaadin-web-components/24.6.0-alpha5/#/elements/vaadin-overlay).\n- `<vaadin-date-picker-overlay-content>`\n- `<vaadin-date-picker-month-scroller>`\n- `<vaadin-date-picker-year-scroller>`\n- `<vaadin-date-picker-year>`\n- `<vaadin-month-calendar>`\n- [`<vaadin-input-container>`](https://cdn.vaadin.com/vaadin-web-components/24.6.0-alpha5/#/elements/vaadin-input-container) - an internal element wrapping the input.\n\nIn order to style the overlay content, use `<vaadin-date-picker-overlay-content>` shadow DOM parts:\n\nPart name | Description\n----------------------|--------------------\n`overlay-header` | Fullscreen mode header\n`label` | Fullscreen mode value/label\n`clear-button` | Fullscreen mode clear button\n`toggle-button` | Fullscreen mode toggle button\n`years-toggle-button` | Fullscreen mode years scroller toggle\n`toolbar` | Footer bar with slotted buttons\n\nThe following state attributes are available on the `<vaadin-date-picker-overlay-content>` element:\n\nAttribute | Description\n----------------|-------------------------------------------------\n`desktop` | Set when the overlay content is in desktop mode\n`fullscreen` | Set when the overlay content is in fullscreen mode\n`years-visible` | Set when the year scroller is visible in fullscreen mode\n\nIn order to style the month calendar, use `<vaadin-month-calendar>` shadow DOM parts:\n\nPart name | Description\n----------------------|--------------------\n`month-header` | Month title\n`weekdays` | Weekday container\n`weekday` | Weekday element\n`week-numbers` | Week numbers container\n`week-number` | Week number element\n`date` | Date element\n`disabled` | Disabled date element\n`focused` | Focused date element\n`selected` | Selected date element\n`today` | Date element corresponding to the current day\n`past` | Date element corresponding to the date in the past\n`future` | Date element corresponding to the date in the future\n\nIn order to style year scroller elements, use `<vaadin-date-picker-year>` shadow DOM parts:\n\nPart name | Description\n----------------------|--------------------\n`year-number` | Year number\n`year-separator` | Year separator\n\nNote: the `theme` attribute value set on `<vaadin-date-picker>` is\npropagated to the internal components listed above.\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",
167
167
  "extension": true,
168
168
  "attributes": [
169
169
  {