@vaadin/date-picker 24.0.0-alpha7 → 24.0.0-alpha8

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.0.0-alpha7",
3
+ "version": "24.0.0-alpha8",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -36,14 +36,14 @@
36
36
  "dependencies": {
37
37
  "@open-wc/dedupe-mixin": "^1.3.0",
38
38
  "@polymer/polymer": "^3.2.0",
39
- "@vaadin/button": "24.0.0-alpha7",
40
- "@vaadin/component-base": "24.0.0-alpha7",
41
- "@vaadin/field-base": "24.0.0-alpha7",
42
- "@vaadin/input-container": "24.0.0-alpha7",
43
- "@vaadin/overlay": "24.0.0-alpha7",
44
- "@vaadin/vaadin-lumo-styles": "24.0.0-alpha7",
45
- "@vaadin/vaadin-material-styles": "24.0.0-alpha7",
46
- "@vaadin/vaadin-themable-mixin": "24.0.0-alpha7"
39
+ "@vaadin/button": "24.0.0-alpha8",
40
+ "@vaadin/component-base": "24.0.0-alpha8",
41
+ "@vaadin/field-base": "24.0.0-alpha8",
42
+ "@vaadin/input-container": "24.0.0-alpha8",
43
+ "@vaadin/overlay": "24.0.0-alpha8",
44
+ "@vaadin/vaadin-lumo-styles": "24.0.0-alpha8",
45
+ "@vaadin/vaadin-material-styles": "24.0.0-alpha8",
46
+ "@vaadin/vaadin-themable-mixin": "24.0.0-alpha8"
47
47
  },
48
48
  "devDependencies": {
49
49
  "@esm-bundle/chai": "^4.3.4",
@@ -54,5 +54,5 @@
54
54
  "web-types.json",
55
55
  "web-types.lit.json"
56
56
  ],
57
- "gitHead": "aeb4535336813636736759e0a5de148b26bfc3b6"
57
+ "gitHead": "476752249bb12295c500980d98a3256ad3b22b73"
58
58
  }
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright (c) 2016 - 2022 Vaadin Ltd.
3
+ * Copyright (c) 2016 - 2023 Vaadin Ltd.
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
6
 
@@ -153,7 +153,7 @@ export function getAdjustedYear(referenceDate, year, month = 0, day = 1) {
153
153
  */
154
154
  export function parseDate(str) {
155
155
  // Parsing with RegExp to ensure correct format
156
- const parts = /^([-+]\d{1}|\d{2,4}|[-+]\d{6})-(\d{1,2})-(\d{1,2})$/.exec(str);
156
+ const parts = /^([-+]\d{1}|\d{2,4}|[-+]\d{6})-(\d{1,2})-(\d{1,2})$/u.exec(str);
157
157
  if (!parts) {
158
158
  return undefined;
159
159
  }
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright (c) 2016 - 2022 Vaadin Ltd.
3
+ * Copyright (c) 2016 - 2023 Vaadin Ltd.
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
6
  import { ValidateMixin } from '@vaadin/field-base/src/validate-mixin.js';
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright (c) 2016 - 2022 Vaadin Ltd.
3
+ * Copyright (c) 2016 - 2023 Vaadin Ltd.
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
6
  import './vaadin-date-picker-overlay.js';
@@ -1,13 +1,13 @@
1
1
  /**
2
2
  * @license
3
- * Copyright (c) 2016 - 2022 Vaadin Ltd.
3
+ * Copyright (c) 2016 - 2023 Vaadin Ltd.
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
6
  import type { Constructor } from '@open-wc/dedupe-mixin';
7
+ import type { DelegateFocusMixinClass } from '@vaadin/component-base/src/delegate-focus-mixin.js';
7
8
  import type { DisabledMixinClass } from '@vaadin/component-base/src/disabled-mixin.js';
8
9
  import type { FocusMixinClass } from '@vaadin/component-base/src/focus-mixin.js';
9
10
  import type { KeyboardMixinClass } from '@vaadin/component-base/src/keyboard-mixin.js';
10
- import type { DelegateFocusMixinClass } from '@vaadin/field-base/src/delegate-focus-mixin.js';
11
11
  import type { InputConstraintsMixinClass } from '@vaadin/field-base/src/input-constraints-mixin.js';
12
12
  import type { InputMixinClass } from '@vaadin/field-base/src/input-mixin.js';
13
13
 
@@ -1,13 +1,13 @@
1
1
  /**
2
2
  * @license
3
- * Copyright (c) 2016 - 2022 Vaadin Ltd.
3
+ * Copyright (c) 2016 - 2023 Vaadin Ltd.
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
6
  import { isIOS } from '@vaadin/component-base/src/browser-utils.js';
7
7
  import { ControllerMixin } from '@vaadin/component-base/src/controller-mixin.js';
8
+ import { DelegateFocusMixin } from '@vaadin/component-base/src/delegate-focus-mixin.js';
8
9
  import { KeyboardMixin } from '@vaadin/component-base/src/keyboard-mixin.js';
9
10
  import { MediaQueryController } from '@vaadin/component-base/src/media-query-controller.js';
10
- import { DelegateFocusMixin } from '@vaadin/field-base/src/delegate-focus-mixin.js';
11
11
  import { InputConstraintsMixin } from '@vaadin/field-base/src/input-constraints-mixin.js';
12
12
  import { VirtualKeyboardController } from '@vaadin/field-base/src/virtual-keyboard-controller.js';
13
13
  import {
@@ -222,7 +222,7 @@ export const DatePickerMixin = (subclass) =>
222
222
  cancel: 'Cancel',
223
223
  referenceDate: '',
224
224
  formatDate(d) {
225
- const yearStr = String(d.year).replace(/\d+/, (y) => '0000'.substr(y.length) + y);
225
+ const yearStr = String(d.year).replace(/\d+/u, (y) => '0000'.substr(y.length) + y);
226
226
  return [d.month + 1, d.day, yearStr].join('/');
227
227
  },
228
228
  parseDate(text) {
@@ -791,21 +791,17 @@ export const DatePickerMixin = (subclass) =>
791
791
 
792
792
  /** @protected */
793
793
  _onOverlayOpened() {
794
- const parsedInitialPosition = parseDate(this.initialPosition);
794
+ // Detect which date to show
795
+ const initialPosition = this._getInitialPosition();
796
+ this._overlayContent.initialPosition = initialPosition;
795
797
 
796
- const initialPosition =
797
- this._selectedDate || this._overlayContent.initialPosition || parsedInitialPosition || new Date();
798
+ // Scroll the date into view
799
+ const scrollFocusDate = this._overlayContent.focusedDate || initialPosition;
800
+ this._overlayContent.scrollToDate(scrollFocusDate);
798
801
 
799
- if (parsedInitialPosition || dateAllowed(initialPosition, this._minDate, this._maxDate)) {
800
- this._overlayContent.initialPosition = initialPosition;
801
- } else {
802
- this._overlayContent.initialPosition = getClosestDate(initialPosition, [this._minDate, this._maxDate]);
803
- }
804
-
805
- this._overlayContent.scrollToDate(this._overlayContent.focusedDate || this._overlayContent.initialPosition);
806
- // Have a default focused date
802
+ // Ensure the date is focused
807
803
  this._ignoreFocusedDateChange = true;
808
- this._overlayContent.focusedDate ||= this._overlayContent.initialPosition;
804
+ this._overlayContent.focusedDate = scrollFocusDate;
809
805
  this._ignoreFocusedDateChange = false;
810
806
 
811
807
  window.addEventListener('scroll', this._boundOnScroll, true);
@@ -823,6 +819,18 @@ export const DatePickerMixin = (subclass) =>
823
819
  }
824
820
  }
825
821
 
822
+ /** @private */
823
+ _getInitialPosition() {
824
+ const parsedInitialPosition = parseDate(this.initialPosition);
825
+
826
+ const initialPosition =
827
+ this._selectedDate || this._overlayContent.initialPosition || parsedInitialPosition || new Date();
828
+
829
+ return parsedInitialPosition || dateAllowed(initialPosition, this._minDate, this._maxDate)
830
+ ? initialPosition
831
+ : getClosestDate(initialPosition, [this._minDate, this._maxDate]);
832
+ }
833
+
826
834
  /** @private */
827
835
  _selectParsedOrFocusedDate() {
828
836
  // Select the parsed input or focused date
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright (c) 2016 - 2022 Vaadin Ltd.
3
+ * Copyright (c) 2016 - 2023 Vaadin Ltd.
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
6
  import { html } from '@polymer/polymer/lib/utils/html-tag.js';
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright (c) 2016 - 2022 Vaadin Ltd.
3
+ * Copyright (c) 2016 - 2023 Vaadin Ltd.
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
6
  import '@vaadin/button/src/vaadin-button.js';
@@ -644,7 +644,10 @@ class DatePickerOverlayContent extends ControllerMixin(ThemableMixin(DirMixin(Po
644
644
  const initialPosition = this._monthScroller.position;
645
645
 
646
646
  const smoothScroll = (timestamp) => {
647
- start ||= timestamp;
647
+ if (!start) {
648
+ start = timestamp;
649
+ }
650
+
648
651
  const currentTime = timestamp - start;
649
652
 
650
653
  if (currentTime < this.scrollDuration) {
@@ -972,58 +975,55 @@ class DatePickerOverlayContent extends ControllerMixin(ThemableMixin(DirMixin(Po
972
975
  this.focusDate(getClosestDate(focus, [this.minDate, this.maxDate]));
973
976
  }
974
977
 
975
- _moveFocusByDays(days) {
976
- const focus = this.focusedDate;
977
- const dateToFocus = new Date(0, 0);
978
- dateToFocus.setFullYear(focus.getFullYear());
979
- dateToFocus.setMonth(focus.getMonth());
980
- dateToFocus.setDate(focus.getDate() + days);
981
-
982
- if (this._dateAllowed(dateToFocus, this.minDate, this.maxDate)) {
983
- this.focusDate(dateToFocus);
984
- } else if (this._dateAllowed(focus, this.minDate, this.maxDate)) {
978
+ _focusAllowedDate(dateToFocus, diff, keepMonth) {
979
+ if (this._dateAllowed(dateToFocus)) {
980
+ this.focusDate(dateToFocus, keepMonth);
981
+ } else if (this._dateAllowed(this.focusedDate)) {
985
982
  // Move to min or max date
986
- if (days > 0) {
987
- // Down or right
983
+ if (diff > 0) {
984
+ // Down, Right or Page Down key
988
985
  this.focusDate(this.maxDate);
989
986
  } else {
990
- // Up or left
987
+ // Up, Left or Page Up key
991
988
  this.focusDate(this.minDate);
992
989
  }
993
990
  } else {
994
991
  // Move to closest allowed date
995
- this._focusClosestDate(focus);
992
+ this._focusClosestDate(this.focusedDate);
996
993
  }
997
994
  }
998
995
 
999
- _moveFocusByMonths(months) {
1000
- const focus = this.focusedDate;
1001
- const dateToFocus = new Date(0, 0);
1002
- dateToFocus.setFullYear(focus.getFullYear());
1003
- dateToFocus.setMonth(focus.getMonth() + months);
996
+ _getDateDiff(months, days) {
997
+ const date = new Date(0, 0);
998
+ date.setFullYear(this.focusedDate.getFullYear());
999
+ date.setMonth(this.focusedDate.getMonth() + months);
1000
+ if (days) {
1001
+ date.setDate(this.focusedDate.getDate() + days);
1002
+ }
1003
+ return date;
1004
+ }
1005
+
1006
+ _moveFocusByDays(days) {
1007
+ const dateToFocus = this._getDateDiff(0, days);
1008
+
1009
+ this._focusAllowedDate(dateToFocus, days, false);
1010
+ }
1004
1011
 
1012
+ _moveFocusByMonths(months) {
1013
+ const dateToFocus = this._getDateDiff(months);
1005
1014
  const targetMonth = dateToFocus.getMonth();
1006
1015
 
1007
- dateToFocus.setDate((this._focusedMonthDate ||= focus.getDate()));
1016
+ if (!this._focusedMonthDate) {
1017
+ this._focusedMonthDate = this.focusedDate.getDate();
1018
+ }
1019
+
1020
+ dateToFocus.setDate(this._focusedMonthDate);
1021
+
1008
1022
  if (dateToFocus.getMonth() !== targetMonth) {
1009
1023
  dateToFocus.setDate(0);
1010
1024
  }
1011
1025
 
1012
- if (this._dateAllowed(dateToFocus, this.minDate, this.maxDate)) {
1013
- this.focusDate(dateToFocus, true);
1014
- } else if (this._dateAllowed(focus, this.minDate, this.maxDate)) {
1015
- // Move to min or max date
1016
- if (months > 0) {
1017
- // Pagedown
1018
- this.focusDate(this.maxDate);
1019
- } else {
1020
- // Pageup
1021
- this.focusDate(this.minDate);
1022
- }
1023
- } else {
1024
- // Move to closest allowed date
1025
- this._focusClosestDate(focus);
1026
- }
1026
+ this._focusAllowedDate(dateToFocus, months, true);
1027
1027
  }
1028
1028
 
1029
1029
  _moveFocusInsideMonth(focusedDate, property) {
@@ -1038,9 +1038,9 @@ class DatePickerOverlayContent extends ControllerMixin(ThemableMixin(DirMixin(Po
1038
1038
  dateToFocus.setDate(0);
1039
1039
  }
1040
1040
 
1041
- if (this._dateAllowed(dateToFocus, this.minDate, this.maxDate)) {
1041
+ if (this._dateAllowed(dateToFocus)) {
1042
1042
  this.focusDate(dateToFocus);
1043
- } else if (this._dateAllowed(focusedDate, this.minDate, this.maxDate)) {
1043
+ } else if (this._dateAllowed(focusedDate)) {
1044
1044
  // Move to minDate or maxDate
1045
1045
  this.focusDate(this[property]);
1046
1046
  } else {
@@ -1049,7 +1049,7 @@ class DatePickerOverlayContent extends ControllerMixin(ThemableMixin(DirMixin(Po
1049
1049
  }
1050
1050
  }
1051
1051
 
1052
- _dateAllowed(date, min, max) {
1052
+ _dateAllowed(date, min = this.minDate, max = this.maxDate) {
1053
1053
  return (!min || date >= min) && (!max || date <= max);
1054
1054
  }
1055
1055
 
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright (c) 2016 - 2022 Vaadin Ltd.
3
+ * Copyright (c) 2016 - 2023 Vaadin Ltd.
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
6
  import { Overlay } from '@vaadin/overlay/src/vaadin-overlay.js';
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright (c) 2016 - 2022 Vaadin Ltd.
3
+ * Copyright (c) 2016 - 2023 Vaadin Ltd.
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
6
  import { html } from '@polymer/polymer/lib/utils/html-tag.js';
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright (c) 2016 - 2022 Vaadin Ltd.
3
+ * Copyright (c) 2016 - 2023 Vaadin Ltd.
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
6
  import { html, PolymerElement } from '@polymer/polymer/polymer-element.js';
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright (c) 2016 - 2022 Vaadin Ltd.
3
+ * Copyright (c) 2016 - 2023 Vaadin Ltd.
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
6
  import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright (c) 2016 - 2022 Vaadin Ltd.
3
+ * Copyright (c) 2016 - 2023 Vaadin Ltd.
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
6
  import '@vaadin/input-container/src/vaadin-input-container.js';
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright (c) 2016 - 2022 Vaadin Ltd.
3
+ * Copyright (c) 2016 - 2023 Vaadin Ltd.
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
6
  import { afterNextRender } from '@polymer/polymer/lib/utils/render-status.js';
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright (c) 2016 - 2022 Vaadin Ltd.
3
+ * Copyright (c) 2016 - 2023 Vaadin Ltd.
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
6
  import '@polymer/polymer/lib/elements/dom-repeat.js';
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.0.0-alpha7",
4
+ "version": "24.0.0-alpha8",
5
5
  "description-markup": "markdown",
6
6
  "contributions": {
7
7
  "html": {
@@ -10,6 +10,79 @@
10
10
  "name": "vaadin-date-picker-light",
11
11
  "description": "`<vaadin-date-picker-light>` is a customizable version of the `<vaadin-date-picker>` providing\nonly the scrollable month calendar view and leaving the input field definition to the user.\n\nTo create a custom input field, you need to add a child element which has a two-way\ndata-bindable property representing the input value. The property name is expected\nto be `bindValue` by default. See the example below for a simplest possible example\nusing an `<input>` element.\n\n```html\n<vaadin-date-picker-light attr-for-value=\"value\">\n <input class=\"input\">\n</vaadin-date-picker-light>\n```\n\n### Styling\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/custom-theme/styling-components) documentation.\n\nIn addition to `<vaadin-date-picker-light>` itself, the following\ninternal components are themable:\n\n- `<vaadin-date-picker-overlay>`\n- `<vaadin-date-picker-overlay-content>`\n- `<vaadin-month-calendar>`\n\nNote: the `theme` attribute value set on `<vaadin-date-picker-light>`\nis propagated to the internal themable components listed above.",
12
12
  "attributes": [
13
+ {
14
+ "name": "value",
15
+ "description": "Selected date.\n\nSupported date formats:\n- ISO 8601 `\"YYYY-MM-DD\"` (default)\n- 6-digit extended ISO 8601 `\"+YYYYYY-MM-DD\"`, `\"-YYYYYY-MM-DD\"`",
16
+ "value": {
17
+ "type": [
18
+ "string"
19
+ ]
20
+ }
21
+ },
22
+ {
23
+ "name": "initial-position",
24
+ "description": "Date which should be visible when there is no value selected.\n\nThe same date formats as for the `value` property are supported.",
25
+ "value": {
26
+ "type": [
27
+ "string",
28
+ "null",
29
+ "undefined"
30
+ ]
31
+ }
32
+ },
33
+ {
34
+ "name": "opened",
35
+ "description": "Set true to open the date selector overlay.",
36
+ "value": {
37
+ "type": [
38
+ "boolean",
39
+ "null",
40
+ "undefined"
41
+ ]
42
+ }
43
+ },
44
+ {
45
+ "name": "auto-open-disabled",
46
+ "description": "Set true to prevent the overlay from opening automatically.",
47
+ "value": {
48
+ "type": [
49
+ "boolean",
50
+ "null",
51
+ "undefined"
52
+ ]
53
+ }
54
+ },
55
+ {
56
+ "name": "show-week-numbers",
57
+ "description": "Set true to display ISO-8601 week numbers in the calendar. Notice that\ndisplaying week numbers is only supported when `i18n.firstDayOfWeek`\nis 1 (Monday).",
58
+ "value": {
59
+ "type": [
60
+ "boolean",
61
+ "null",
62
+ "undefined"
63
+ ]
64
+ }
65
+ },
66
+ {
67
+ "name": "min",
68
+ "description": "The earliest date that can be selected. All earlier dates will be disabled.\n\nSupported date formats:\n- ISO 8601 `\"YYYY-MM-DD\"` (default)\n- 6-digit extended ISO 8601 `\"+YYYYYY-MM-DD\"`, `\"-YYYYYY-MM-DD\"`",
69
+ "value": {
70
+ "type": [
71
+ "string",
72
+ "undefined"
73
+ ]
74
+ }
75
+ },
76
+ {
77
+ "name": "max",
78
+ "description": "The latest date that can be selected. All later dates will be disabled.\n\nSupported date formats:\n- ISO 8601 `\"YYYY-MM-DD\"` (default)\n- 6-digit extended ISO 8601 `\"+YYYYYY-MM-DD\"`, `\"-YYYYYY-MM-DD\"`",
79
+ "value": {
80
+ "type": [
81
+ "string",
82
+ "undefined"
83
+ ]
84
+ }
85
+ },
13
86
  {
14
87
  "name": "attr-for-value",
15
88
  "description": "Name of the two-way data-bindable property representing the\nvalue of the custom input field.",
@@ -33,6 +106,88 @@
33
106
  ],
34
107
  "js": {
35
108
  "properties": [
109
+ {
110
+ "name": "value",
111
+ "description": "Selected date.\n\nSupported date formats:\n- ISO 8601 `\"YYYY-MM-DD\"` (default)\n- 6-digit extended ISO 8601 `\"+YYYYYY-MM-DD\"`, `\"-YYYYYY-MM-DD\"`",
112
+ "value": {
113
+ "type": [
114
+ "string"
115
+ ]
116
+ }
117
+ },
118
+ {
119
+ "name": "initialPosition",
120
+ "description": "Date which should be visible when there is no value selected.\n\nThe same date formats as for the `value` property are supported.",
121
+ "value": {
122
+ "type": [
123
+ "string",
124
+ "null",
125
+ "undefined"
126
+ ]
127
+ }
128
+ },
129
+ {
130
+ "name": "opened",
131
+ "description": "Set true to open the date selector overlay.",
132
+ "value": {
133
+ "type": [
134
+ "boolean",
135
+ "null",
136
+ "undefined"
137
+ ]
138
+ }
139
+ },
140
+ {
141
+ "name": "autoOpenDisabled",
142
+ "description": "Set true to prevent the overlay from opening automatically.",
143
+ "value": {
144
+ "type": [
145
+ "boolean",
146
+ "null",
147
+ "undefined"
148
+ ]
149
+ }
150
+ },
151
+ {
152
+ "name": "showWeekNumbers",
153
+ "description": "Set true to display ISO-8601 week numbers in the calendar. Notice that\ndisplaying week numbers is only supported when `i18n.firstDayOfWeek`\nis 1 (Monday).",
154
+ "value": {
155
+ "type": [
156
+ "boolean",
157
+ "null",
158
+ "undefined"
159
+ ]
160
+ }
161
+ },
162
+ {
163
+ "name": "i18n",
164
+ "description": "The object used to localize this component.\nTo change the default localization, replace the entire\n`i18n` object with a custom one.\n\nTo update individual properties, extend the existing i18n object like so:\n```\ndatePicker.i18n = { ...datePicker.i18n, {\n formatDate: date => { ... },\n parseDate: value => { ... },\n}};\n```\n\nThe object has the following JSON structure and default values:\n\n```\n{\n // An array with the full names of months starting\n // with January.\n monthNames: [\n 'January', 'February', 'March', 'April', 'May',\n 'June', 'July', 'August', 'September',\n 'October', 'November', 'December'\n ],\n\n // An array of weekday names starting with Sunday. Used\n // in screen reader announcements.\n weekdays: [\n 'Sunday', 'Monday', 'Tuesday', 'Wednesday',\n 'Thursday', 'Friday', 'Saturday'\n ],\n\n // An array of short weekday names starting with Sunday.\n // Displayed in the calendar.\n weekdaysShort: [\n 'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'\n ],\n\n // An integer indicating the first day of the week\n // (0 = Sunday, 1 = Monday, etc.).\n firstDayOfWeek: 0,\n\n // Translation of the Today shortcut button text.\n today: 'Today',\n\n // Translation of the Cancel button text.\n cancel: 'Cancel',\n\n // Used for adjusting the year value when parsing dates with short years.\n // The year values between 0 and 99 are evaluated and adjusted.\n // Example: for a referenceDate of 1970-10-30;\n // dateToBeParsed: 40-10-30, result: 1940-10-30\n // dateToBeParsed: 80-10-30, result: 1980-10-30\n // dateToBeParsed: 10-10-30, result: 2010-10-30\n // Supported date format: ISO 8601 `\"YYYY-MM-DD\"` (default)\n // The default value is the current date.\n referenceDate: '',\n\n // A function to format given `Object` as\n // date string. Object is in the format `{ day: ..., month: ..., year: ... }`\n // Note: The argument month is 0-based. This means that January = 0 and December = 11.\n formatDate: d => {\n // returns a string representation of the given\n // object in 'MM/DD/YYYY' -format\n },\n\n // A function to parse the given text to an `Object` in the format `{ day: ..., month: ..., year: ... }`.\n // Must properly parse (at least) text formatted by `formatDate`.\n // Setting the property to null will disable keyboard input feature.\n // Note: The argument month is 0-based. This means that January = 0 and December = 11.\n parseDate: text => {\n // Parses a string in 'MM/DD/YY', 'MM/DD' or 'DD' -format to\n // an `Object` in the format `{ day: ..., month: ..., year: ... }`.\n }\n\n // A function to format given `monthName` and\n // `fullYear` integer as calendar title string.\n formatTitle: (monthName, fullYear) => {\n return monthName + ' ' + fullYear;\n }\n}\n```",
165
+ "value": {
166
+ "type": [
167
+ "DatePickerI18n"
168
+ ]
169
+ }
170
+ },
171
+ {
172
+ "name": "min",
173
+ "description": "The earliest date that can be selected. All earlier dates will be disabled.\n\nSupported date formats:\n- ISO 8601 `\"YYYY-MM-DD\"` (default)\n- 6-digit extended ISO 8601 `\"+YYYYYY-MM-DD\"`, `\"-YYYYYY-MM-DD\"`",
174
+ "value": {
175
+ "type": [
176
+ "string",
177
+ "undefined"
178
+ ]
179
+ }
180
+ },
181
+ {
182
+ "name": "max",
183
+ "description": "The latest date that can be selected. All later dates will be disabled.\n\nSupported date formats:\n- ISO 8601 `\"YYYY-MM-DD\"` (default)\n- 6-digit extended ISO 8601 `\"+YYYYYY-MM-DD\"`, `\"-YYYYYY-MM-DD\"`",
184
+ "value": {
185
+ "type": [
186
+ "string",
187
+ "undefined"
188
+ ]
189
+ }
190
+ },
36
191
  {
37
192
  "name": "attrForValue",
38
193
  "description": "Name of the two-way data-bindable property representing the\nvalue of the custom input field.",
@@ -43,12 +198,25 @@
43
198
  }
44
199
  }
45
200
  ],
46
- "events": []
201
+ "events": [
202
+ {
203
+ "name": "change",
204
+ "description": "Fired when the user commits a value change."
205
+ },
206
+ {
207
+ "name": "opened-changed",
208
+ "description": "Fired when `opened` property value changes."
209
+ },
210
+ {
211
+ "name": "value-changed",
212
+ "description": "Fired when `value` property value changes."
213
+ }
214
+ ]
47
215
  }
48
216
  },
49
217
  {
50
218
  "name": "vaadin-date-picker",
51
- "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.0.0-alpha7/#/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.0.0-alpha7/#/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.0.0-alpha7/#/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.0.0-alpha7/#/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\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/custom-theme/styling-components) documentation.",
219
+ "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.0.0-alpha8/#/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.0.0-alpha8/#/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.0.0-alpha8/#/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.0.0-alpha8/#/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\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/custom-theme/styling-components) documentation.",
52
220
  "attributes": [
53
221
  {
54
222
  "name": "disabled",
@@ -129,12 +297,10 @@
129
297
  },
130
298
  {
131
299
  "name": "value",
132
- "description": "The value of the field.",
300
+ "description": "Selected date.\n\nSupported date formats:\n- ISO 8601 `\"YYYY-MM-DD\"` (default)\n- 6-digit extended ISO 8601 `\"+YYYYYY-MM-DD\"`, `\"-YYYYYY-MM-DD\"`",
133
301
  "value": {
134
302
  "type": [
135
- "string",
136
- "null",
137
- "undefined"
303
+ "string"
138
304
  ]
139
305
  }
140
306
  },
@@ -215,6 +381,70 @@
215
381
  ]
216
382
  }
217
383
  },
384
+ {
385
+ "name": "initial-position",
386
+ "description": "Date which should be visible when there is no value selected.\n\nThe same date formats as for the `value` property are supported.",
387
+ "value": {
388
+ "type": [
389
+ "string",
390
+ "null",
391
+ "undefined"
392
+ ]
393
+ }
394
+ },
395
+ {
396
+ "name": "opened",
397
+ "description": "Set true to open the date selector overlay.",
398
+ "value": {
399
+ "type": [
400
+ "boolean",
401
+ "null",
402
+ "undefined"
403
+ ]
404
+ }
405
+ },
406
+ {
407
+ "name": "auto-open-disabled",
408
+ "description": "Set true to prevent the overlay from opening automatically.",
409
+ "value": {
410
+ "type": [
411
+ "boolean",
412
+ "null",
413
+ "undefined"
414
+ ]
415
+ }
416
+ },
417
+ {
418
+ "name": "show-week-numbers",
419
+ "description": "Set true to display ISO-8601 week numbers in the calendar. Notice that\ndisplaying week numbers is only supported when `i18n.firstDayOfWeek`\nis 1 (Monday).",
420
+ "value": {
421
+ "type": [
422
+ "boolean",
423
+ "null",
424
+ "undefined"
425
+ ]
426
+ }
427
+ },
428
+ {
429
+ "name": "min",
430
+ "description": "The earliest date that can be selected. All earlier dates will be disabled.\n\nSupported date formats:\n- ISO 8601 `\"YYYY-MM-DD\"` (default)\n- 6-digit extended ISO 8601 `\"+YYYYYY-MM-DD\"`, `\"-YYYYYY-MM-DD\"`",
431
+ "value": {
432
+ "type": [
433
+ "string",
434
+ "undefined"
435
+ ]
436
+ }
437
+ },
438
+ {
439
+ "name": "max",
440
+ "description": "The latest date that can be selected. All later dates will be disabled.\n\nSupported date formats:\n- ISO 8601 `\"YYYY-MM-DD\"` (default)\n- 6-digit extended ISO 8601 `\"+YYYYYY-MM-DD\"`, `\"-YYYYYY-MM-DD\"`",
441
+ "value": {
442
+ "type": [
443
+ "string",
444
+ "undefined"
445
+ ]
446
+ }
447
+ },
218
448
  {
219
449
  "name": "theme",
220
450
  "description": "The theme variants to apply to the component.",
@@ -229,44 +459,6 @@
229
459
  ],
230
460
  "js": {
231
461
  "properties": [
232
- {
233
- "name": "rootPath",
234
- "description": "",
235
- "value": {
236
- "type": [
237
- "string"
238
- ]
239
- }
240
- },
241
- {
242
- "name": "importPath",
243
- "description": "",
244
- "value": {
245
- "type": [
246
- "string"
247
- ]
248
- }
249
- },
250
- {
251
- "name": "root",
252
- "description": "",
253
- "value": {
254
- "type": [
255
- "StampedTemplate",
256
- "HTMLElement",
257
- "ShadowRoot"
258
- ]
259
- }
260
- },
261
- {
262
- "name": "$",
263
- "description": "",
264
- "value": {
265
- "type": [
266
- "Object.<string, Element>"
267
- ]
268
- }
269
- },
270
462
  {
271
463
  "name": "disabled",
272
464
  "description": "If true, the user cannot interact with this element.",
@@ -346,12 +538,10 @@
346
538
  },
347
539
  {
348
540
  "name": "value",
349
- "description": "The value of the field.",
541
+ "description": "Selected date.\n\nSupported date formats:\n- ISO 8601 `\"YYYY-MM-DD\"` (default)\n- 6-digit extended ISO 8601 `\"+YYYYYY-MM-DD\"`, `\"-YYYYYY-MM-DD\"`",
350
542
  "value": {
351
543
  "type": [
352
- "string",
353
- "null",
354
- "undefined"
544
+ "string"
355
545
  ]
356
546
  }
357
547
  },
@@ -431,6 +621,79 @@
431
621
  "undefined"
432
622
  ]
433
623
  }
624
+ },
625
+ {
626
+ "name": "initialPosition",
627
+ "description": "Date which should be visible when there is no value selected.\n\nThe same date formats as for the `value` property are supported.",
628
+ "value": {
629
+ "type": [
630
+ "string",
631
+ "null",
632
+ "undefined"
633
+ ]
634
+ }
635
+ },
636
+ {
637
+ "name": "opened",
638
+ "description": "Set true to open the date selector overlay.",
639
+ "value": {
640
+ "type": [
641
+ "boolean",
642
+ "null",
643
+ "undefined"
644
+ ]
645
+ }
646
+ },
647
+ {
648
+ "name": "autoOpenDisabled",
649
+ "description": "Set true to prevent the overlay from opening automatically.",
650
+ "value": {
651
+ "type": [
652
+ "boolean",
653
+ "null",
654
+ "undefined"
655
+ ]
656
+ }
657
+ },
658
+ {
659
+ "name": "showWeekNumbers",
660
+ "description": "Set true to display ISO-8601 week numbers in the calendar. Notice that\ndisplaying week numbers is only supported when `i18n.firstDayOfWeek`\nis 1 (Monday).",
661
+ "value": {
662
+ "type": [
663
+ "boolean",
664
+ "null",
665
+ "undefined"
666
+ ]
667
+ }
668
+ },
669
+ {
670
+ "name": "i18n",
671
+ "description": "The object used to localize this component.\nTo change the default localization, replace the entire\n`i18n` object with a custom one.\n\nTo update individual properties, extend the existing i18n object like so:\n```\ndatePicker.i18n = { ...datePicker.i18n, {\n formatDate: date => { ... },\n parseDate: value => { ... },\n}};\n```\n\nThe object has the following JSON structure and default values:\n\n```\n{\n // An array with the full names of months starting\n // with January.\n monthNames: [\n 'January', 'February', 'March', 'April', 'May',\n 'June', 'July', 'August', 'September',\n 'October', 'November', 'December'\n ],\n\n // An array of weekday names starting with Sunday. Used\n // in screen reader announcements.\n weekdays: [\n 'Sunday', 'Monday', 'Tuesday', 'Wednesday',\n 'Thursday', 'Friday', 'Saturday'\n ],\n\n // An array of short weekday names starting with Sunday.\n // Displayed in the calendar.\n weekdaysShort: [\n 'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'\n ],\n\n // An integer indicating the first day of the week\n // (0 = Sunday, 1 = Monday, etc.).\n firstDayOfWeek: 0,\n\n // Translation of the Today shortcut button text.\n today: 'Today',\n\n // Translation of the Cancel button text.\n cancel: 'Cancel',\n\n // Used for adjusting the year value when parsing dates with short years.\n // The year values between 0 and 99 are evaluated and adjusted.\n // Example: for a referenceDate of 1970-10-30;\n // dateToBeParsed: 40-10-30, result: 1940-10-30\n // dateToBeParsed: 80-10-30, result: 1980-10-30\n // dateToBeParsed: 10-10-30, result: 2010-10-30\n // Supported date format: ISO 8601 `\"YYYY-MM-DD\"` (default)\n // The default value is the current date.\n referenceDate: '',\n\n // A function to format given `Object` as\n // date string. Object is in the format `{ day: ..., month: ..., year: ... }`\n // Note: The argument month is 0-based. This means that January = 0 and December = 11.\n formatDate: d => {\n // returns a string representation of the given\n // object in 'MM/DD/YYYY' -format\n },\n\n // A function to parse the given text to an `Object` in the format `{ day: ..., month: ..., year: ... }`.\n // Must properly parse (at least) text formatted by `formatDate`.\n // Setting the property to null will disable keyboard input feature.\n // Note: The argument month is 0-based. This means that January = 0 and December = 11.\n parseDate: text => {\n // Parses a string in 'MM/DD/YY', 'MM/DD' or 'DD' -format to\n // an `Object` in the format `{ day: ..., month: ..., year: ... }`.\n }\n\n // A function to format given `monthName` and\n // `fullYear` integer as calendar title string.\n formatTitle: (monthName, fullYear) => {\n return monthName + ' ' + fullYear;\n }\n}\n```",
672
+ "value": {
673
+ "type": [
674
+ "DatePickerI18n"
675
+ ]
676
+ }
677
+ },
678
+ {
679
+ "name": "min",
680
+ "description": "The earliest date that can be selected. All earlier dates will be disabled.\n\nSupported date formats:\n- ISO 8601 `\"YYYY-MM-DD\"` (default)\n- 6-digit extended ISO 8601 `\"+YYYYYY-MM-DD\"`, `\"-YYYYYY-MM-DD\"`",
681
+ "value": {
682
+ "type": [
683
+ "string",
684
+ "undefined"
685
+ ]
686
+ }
687
+ },
688
+ {
689
+ "name": "max",
690
+ "description": "The latest date that can be selected. All later dates will be disabled.\n\nSupported date formats:\n- ISO 8601 `\"YYYY-MM-DD\"` (default)\n- 6-digit extended ISO 8601 `\"+YYYYYY-MM-DD\"`, `\"-YYYYYY-MM-DD\"`",
691
+ "value": {
692
+ "type": [
693
+ "string",
694
+ "undefined"
695
+ ]
696
+ }
434
697
  }
435
698
  ],
436
699
  "events": [
@@ -447,12 +710,16 @@
447
710
  "description": "Fired when the value is changed by the user: on every typing keystroke,\nand the value is cleared using the clear button."
448
711
  },
449
712
  {
450
- "name": "invalid-changed",
451
- "description": "Fired when the `invalid` property changes."
713
+ "name": "opened-changed",
714
+ "description": "Fired when `opened` property value changes."
452
715
  },
453
716
  {
454
717
  "name": "value-changed",
455
- "description": "Fired when the `value` property changes."
718
+ "description": "Fired when `value` property value changes."
719
+ },
720
+ {
721
+ "name": "invalid-changed",
722
+ "description": "Fired when the `invalid` property changes."
456
723
  }
457
724
  ]
458
725
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/web-types",
3
3
  "name": "@vaadin/date-picker",
4
- "version": "24.0.0-alpha7",
4
+ "version": "24.0.0-alpha8",
5
5
  "description-markup": "markdown",
6
6
  "framework": "lit",
7
7
  "framework-config": {
@@ -19,18 +19,95 @@
19
19
  "description": "`<vaadin-date-picker-light>` is a customizable version of the `<vaadin-date-picker>` providing\nonly the scrollable month calendar view and leaving the input field definition to the user.\n\nTo create a custom input field, you need to add a child element which has a two-way\ndata-bindable property representing the input value. The property name is expected\nto be `bindValue` by default. See the example below for a simplest possible example\nusing an `<input>` element.\n\n```html\n<vaadin-date-picker-light attr-for-value=\"value\">\n <input class=\"input\">\n</vaadin-date-picker-light>\n```\n\n### Styling\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/custom-theme/styling-components) documentation.\n\nIn addition to `<vaadin-date-picker-light>` itself, the following\ninternal components are themable:\n\n- `<vaadin-date-picker-overlay>`\n- `<vaadin-date-picker-overlay-content>`\n- `<vaadin-month-calendar>`\n\nNote: the `theme` attribute value set on `<vaadin-date-picker-light>`\nis propagated to the internal themable components listed above.",
20
20
  "extension": true,
21
21
  "attributes": [
22
+ {
23
+ "name": "?opened",
24
+ "description": "Set true to open the date selector overlay.",
25
+ "value": {
26
+ "kind": "expression"
27
+ }
28
+ },
29
+ {
30
+ "name": "?autoOpenDisabled",
31
+ "description": "Set true to prevent the overlay from opening automatically.",
32
+ "value": {
33
+ "kind": "expression"
34
+ }
35
+ },
36
+ {
37
+ "name": "?showWeekNumbers",
38
+ "description": "Set true to display ISO-8601 week numbers in the calendar. Notice that\ndisplaying week numbers is only supported when `i18n.firstDayOfWeek`\nis 1 (Monday).",
39
+ "value": {
40
+ "kind": "expression"
41
+ }
42
+ },
43
+ {
44
+ "name": ".value",
45
+ "description": "Selected date.\n\nSupported date formats:\n- ISO 8601 `\"YYYY-MM-DD\"` (default)\n- 6-digit extended ISO 8601 `\"+YYYYYY-MM-DD\"`, `\"-YYYYYY-MM-DD\"`",
46
+ "value": {
47
+ "kind": "expression"
48
+ }
49
+ },
50
+ {
51
+ "name": ".initialPosition",
52
+ "description": "Date which should be visible when there is no value selected.\n\nThe same date formats as for the `value` property are supported.",
53
+ "value": {
54
+ "kind": "expression"
55
+ }
56
+ },
57
+ {
58
+ "name": ".i18n",
59
+ "description": "The object used to localize this component.\nTo change the default localization, replace the entire\n`i18n` object with a custom one.\n\nTo update individual properties, extend the existing i18n object like so:\n```\ndatePicker.i18n = { ...datePicker.i18n, {\n formatDate: date => { ... },\n parseDate: value => { ... },\n}};\n```\n\nThe object has the following JSON structure and default values:\n\n```\n{\n // An array with the full names of months starting\n // with January.\n monthNames: [\n 'January', 'February', 'March', 'April', 'May',\n 'June', 'July', 'August', 'September',\n 'October', 'November', 'December'\n ],\n\n // An array of weekday names starting with Sunday. Used\n // in screen reader announcements.\n weekdays: [\n 'Sunday', 'Monday', 'Tuesday', 'Wednesday',\n 'Thursday', 'Friday', 'Saturday'\n ],\n\n // An array of short weekday names starting with Sunday.\n // Displayed in the calendar.\n weekdaysShort: [\n 'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'\n ],\n\n // An integer indicating the first day of the week\n // (0 = Sunday, 1 = Monday, etc.).\n firstDayOfWeek: 0,\n\n // Translation of the Today shortcut button text.\n today: 'Today',\n\n // Translation of the Cancel button text.\n cancel: 'Cancel',\n\n // Used for adjusting the year value when parsing dates with short years.\n // The year values between 0 and 99 are evaluated and adjusted.\n // Example: for a referenceDate of 1970-10-30;\n // dateToBeParsed: 40-10-30, result: 1940-10-30\n // dateToBeParsed: 80-10-30, result: 1980-10-30\n // dateToBeParsed: 10-10-30, result: 2010-10-30\n // Supported date format: ISO 8601 `\"YYYY-MM-DD\"` (default)\n // The default value is the current date.\n referenceDate: '',\n\n // A function to format given `Object` as\n // date string. Object is in the format `{ day: ..., month: ..., year: ... }`\n // Note: The argument month is 0-based. This means that January = 0 and December = 11.\n formatDate: d => {\n // returns a string representation of the given\n // object in 'MM/DD/YYYY' -format\n },\n\n // A function to parse the given text to an `Object` in the format `{ day: ..., month: ..., year: ... }`.\n // Must properly parse (at least) text formatted by `formatDate`.\n // Setting the property to null will disable keyboard input feature.\n // Note: The argument month is 0-based. This means that January = 0 and December = 11.\n parseDate: text => {\n // Parses a string in 'MM/DD/YY', 'MM/DD' or 'DD' -format to\n // an `Object` in the format `{ day: ..., month: ..., year: ... }`.\n }\n\n // A function to format given `monthName` and\n // `fullYear` integer as calendar title string.\n formatTitle: (monthName, fullYear) => {\n return monthName + ' ' + fullYear;\n }\n}\n```",
60
+ "value": {
61
+ "kind": "expression"
62
+ }
63
+ },
64
+ {
65
+ "name": ".min",
66
+ "description": "The earliest date that can be selected. All earlier dates will be disabled.\n\nSupported date formats:\n- ISO 8601 `\"YYYY-MM-DD\"` (default)\n- 6-digit extended ISO 8601 `\"+YYYYYY-MM-DD\"`, `\"-YYYYYY-MM-DD\"`",
67
+ "value": {
68
+ "kind": "expression"
69
+ }
70
+ },
71
+ {
72
+ "name": ".max",
73
+ "description": "The latest date that can be selected. All later dates will be disabled.\n\nSupported date formats:\n- ISO 8601 `\"YYYY-MM-DD\"` (default)\n- 6-digit extended ISO 8601 `\"+YYYYYY-MM-DD\"`, `\"-YYYYYY-MM-DD\"`",
74
+ "value": {
75
+ "kind": "expression"
76
+ }
77
+ },
22
78
  {
23
79
  "name": ".attrForValue",
24
80
  "description": "Name of the two-way data-bindable property representing the\nvalue of the custom input field.",
25
81
  "value": {
26
82
  "kind": "expression"
27
83
  }
84
+ },
85
+ {
86
+ "name": "@change",
87
+ "description": "Fired when the user commits a value change.",
88
+ "value": {
89
+ "kind": "expression"
90
+ }
91
+ },
92
+ {
93
+ "name": "@opened-changed",
94
+ "description": "Fired when `opened` property value changes.",
95
+ "value": {
96
+ "kind": "expression"
97
+ }
98
+ },
99
+ {
100
+ "name": "@value-changed",
101
+ "description": "Fired when `value` property value changes.",
102
+ "value": {
103
+ "kind": "expression"
104
+ }
28
105
  }
29
106
  ]
30
107
  },
31
108
  {
32
109
  "name": "vaadin-date-picker",
33
- "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.0.0-alpha7/#/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.0.0-alpha7/#/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.0.0-alpha7/#/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.0.0-alpha7/#/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\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/custom-theme/styling-components) documentation.",
110
+ "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.0.0-alpha8/#/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.0.0-alpha8/#/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.0.0-alpha8/#/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.0.0-alpha8/#/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\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/custom-theme/styling-components) documentation.",
34
111
  "extension": true,
35
112
  "attributes": [
36
113
  {
@@ -83,29 +160,22 @@
83
160
  }
84
161
  },
85
162
  {
86
- "name": ".rootPath",
87
- "description": "",
163
+ "name": "?opened",
164
+ "description": "Set true to open the date selector overlay.",
88
165
  "value": {
89
166
  "kind": "expression"
90
167
  }
91
168
  },
92
169
  {
93
- "name": ".importPath",
94
- "description": "",
170
+ "name": "?autoOpenDisabled",
171
+ "description": "Set true to prevent the overlay from opening automatically.",
95
172
  "value": {
96
173
  "kind": "expression"
97
174
  }
98
175
  },
99
176
  {
100
- "name": ".root",
101
- "description": "",
102
- "value": {
103
- "kind": "expression"
104
- }
105
- },
106
- {
107
- "name": ".$",
108
- "description": "",
177
+ "name": "?showWeekNumbers",
178
+ "description": "Set true to display ISO-8601 week numbers in the calendar. Notice that\ndisplaying week numbers is only supported when `i18n.firstDayOfWeek`\nis 1 (Monday).",
109
179
  "value": {
110
180
  "kind": "expression"
111
181
  }
@@ -133,7 +203,7 @@
133
203
  },
134
204
  {
135
205
  "name": ".value",
136
- "description": "The value of the field.",
206
+ "description": "Selected date.\n\nSupported date formats:\n- ISO 8601 `\"YYYY-MM-DD\"` (default)\n- 6-digit extended ISO 8601 `\"+YYYYYY-MM-DD\"`, `\"-YYYYYY-MM-DD\"`",
137
207
  "value": {
138
208
  "kind": "expression"
139
209
  }
@@ -166,6 +236,34 @@
166
236
  "kind": "expression"
167
237
  }
168
238
  },
239
+ {
240
+ "name": ".initialPosition",
241
+ "description": "Date which should be visible when there is no value selected.\n\nThe same date formats as for the `value` property are supported.",
242
+ "value": {
243
+ "kind": "expression"
244
+ }
245
+ },
246
+ {
247
+ "name": ".i18n",
248
+ "description": "The object used to localize this component.\nTo change the default localization, replace the entire\n`i18n` object with a custom one.\n\nTo update individual properties, extend the existing i18n object like so:\n```\ndatePicker.i18n = { ...datePicker.i18n, {\n formatDate: date => { ... },\n parseDate: value => { ... },\n}};\n```\n\nThe object has the following JSON structure and default values:\n\n```\n{\n // An array with the full names of months starting\n // with January.\n monthNames: [\n 'January', 'February', 'March', 'April', 'May',\n 'June', 'July', 'August', 'September',\n 'October', 'November', 'December'\n ],\n\n // An array of weekday names starting with Sunday. Used\n // in screen reader announcements.\n weekdays: [\n 'Sunday', 'Monday', 'Tuesday', 'Wednesday',\n 'Thursday', 'Friday', 'Saturday'\n ],\n\n // An array of short weekday names starting with Sunday.\n // Displayed in the calendar.\n weekdaysShort: [\n 'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'\n ],\n\n // An integer indicating the first day of the week\n // (0 = Sunday, 1 = Monday, etc.).\n firstDayOfWeek: 0,\n\n // Translation of the Today shortcut button text.\n today: 'Today',\n\n // Translation of the Cancel button text.\n cancel: 'Cancel',\n\n // Used for adjusting the year value when parsing dates with short years.\n // The year values between 0 and 99 are evaluated and adjusted.\n // Example: for a referenceDate of 1970-10-30;\n // dateToBeParsed: 40-10-30, result: 1940-10-30\n // dateToBeParsed: 80-10-30, result: 1980-10-30\n // dateToBeParsed: 10-10-30, result: 2010-10-30\n // Supported date format: ISO 8601 `\"YYYY-MM-DD\"` (default)\n // The default value is the current date.\n referenceDate: '',\n\n // A function to format given `Object` as\n // date string. Object is in the format `{ day: ..., month: ..., year: ... }`\n // Note: The argument month is 0-based. This means that January = 0 and December = 11.\n formatDate: d => {\n // returns a string representation of the given\n // object in 'MM/DD/YYYY' -format\n },\n\n // A function to parse the given text to an `Object` in the format `{ day: ..., month: ..., year: ... }`.\n // Must properly parse (at least) text formatted by `formatDate`.\n // Setting the property to null will disable keyboard input feature.\n // Note: The argument month is 0-based. This means that January = 0 and December = 11.\n parseDate: text => {\n // Parses a string in 'MM/DD/YY', 'MM/DD' or 'DD' -format to\n // an `Object` in the format `{ day: ..., month: ..., year: ... }`.\n }\n\n // A function to format given `monthName` and\n // `fullYear` integer as calendar title string.\n formatTitle: (monthName, fullYear) => {\n return monthName + ' ' + fullYear;\n }\n}\n```",
249
+ "value": {
250
+ "kind": "expression"
251
+ }
252
+ },
253
+ {
254
+ "name": ".min",
255
+ "description": "The earliest date that can be selected. All earlier dates will be disabled.\n\nSupported date formats:\n- ISO 8601 `\"YYYY-MM-DD\"` (default)\n- 6-digit extended ISO 8601 `\"+YYYYYY-MM-DD\"`, `\"-YYYYYY-MM-DD\"`",
256
+ "value": {
257
+ "kind": "expression"
258
+ }
259
+ },
260
+ {
261
+ "name": ".max",
262
+ "description": "The latest date that can be selected. All later dates will be disabled.\n\nSupported date formats:\n- ISO 8601 `\"YYYY-MM-DD\"` (default)\n- 6-digit extended ISO 8601 `\"+YYYYYY-MM-DD\"`, `\"-YYYYYY-MM-DD\"`",
263
+ "value": {
264
+ "kind": "expression"
265
+ }
266
+ },
169
267
  {
170
268
  "name": "@validated",
171
269
  "description": "Fired whenever the field is validated.",
@@ -188,15 +286,22 @@
188
286
  }
189
287
  },
190
288
  {
191
- "name": "@invalid-changed",
192
- "description": "Fired when the `invalid` property changes.",
289
+ "name": "@opened-changed",
290
+ "description": "Fired when `opened` property value changes.",
193
291
  "value": {
194
292
  "kind": "expression"
195
293
  }
196
294
  },
197
295
  {
198
296
  "name": "@value-changed",
199
- "description": "Fired when the `value` property changes.",
297
+ "description": "Fired when `value` property value changes.",
298
+ "value": {
299
+ "kind": "expression"
300
+ }
301
+ },
302
+ {
303
+ "name": "@invalid-changed",
304
+ "description": "Fired when the `invalid` property changes.",
200
305
  "value": {
201
306
  "kind": "expression"
202
307
  }