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

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-alpha8",
3
+ "version": "24.0.0-beta1",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -36,23 +36,23 @@
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-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"
39
+ "@vaadin/button": "24.0.0-beta1",
40
+ "@vaadin/component-base": "24.0.0-beta1",
41
+ "@vaadin/field-base": "24.0.0-beta1",
42
+ "@vaadin/input-container": "24.0.0-beta1",
43
+ "@vaadin/overlay": "24.0.0-beta1",
44
+ "@vaadin/vaadin-lumo-styles": "24.0.0-beta1",
45
+ "@vaadin/vaadin-material-styles": "24.0.0-beta1",
46
+ "@vaadin/vaadin-themable-mixin": "24.0.0-beta1"
47
47
  },
48
48
  "devDependencies": {
49
49
  "@esm-bundle/chai": "^4.3.4",
50
- "@vaadin/testing-helpers": "^0.3.2",
50
+ "@vaadin/testing-helpers": "^0.4.0",
51
51
  "sinon": "^13.0.2"
52
52
  },
53
53
  "web-types": [
54
54
  "web-types.json",
55
55
  "web-types.lit.json"
56
56
  ],
57
- "gitHead": "476752249bb12295c500980d98a3256ad3b22b73"
57
+ "gitHead": "c5b48921a62482746df8e46994b37e1490fec27e"
58
58
  }
@@ -1,5 +1,3 @@
1
- export { getISOWeekNumber };
2
-
3
1
  /**
4
2
  * Get ISO 8601 week number for the given date.
5
3
  *
@@ -7,8 +5,6 @@ export { getISOWeekNumber };
7
5
  */
8
6
  declare function getISOWeekNumber(Date: Date): number;
9
7
 
10
- export { dateEquals };
11
-
12
8
  /**
13
9
  * Check if two dates are equal.
14
10
  *
@@ -16,8 +12,6 @@ export { dateEquals };
16
12
  */
17
13
  declare function dateEquals(date1: Date | null, date2: Date | null): boolean;
18
14
 
19
- export { dateAllowed };
20
-
21
15
  /**
22
16
  * Check if the given date is in the range of allowed dates.
23
17
  *
@@ -25,8 +19,6 @@ export { dateAllowed };
25
19
  */
26
20
  declare function dateAllowed(date: Date, min: Date | null, max: Date | null): boolean;
27
21
 
28
- export { getClosestDate };
29
-
30
22
  /**
31
23
  * Get closest date from array of dates.
32
24
  *
@@ -34,8 +26,6 @@ export { getClosestDate };
34
26
  */
35
27
  declare function getClosestDate(date: Date, dates: Date[]): Date;
36
28
 
37
- export { extractDateParts };
38
-
39
29
  /**
40
30
  * Extracts the basic component parts of a date (day, month and year)
41
31
  * to the expected format.
@@ -47,16 +37,12 @@ declare function extractDateParts(date: Date): { day: number; month: number; yea
47
37
  */
48
38
  declare function dateAfterXMonths(months: number): number;
49
39
 
50
- export { dateAfterXMonths };
51
-
52
40
  /**
53
41
  * Calculate the year of the date based on the provided reference date
54
42
  * Gets a two-digit year and returns a full year.
55
43
  */
56
44
  declare function getAdjustedYear(referenceDate: Date, year: number, month?: number, day?: number): Date;
57
45
 
58
- export { getAdjustedYear };
59
-
60
46
  /**
61
47
  * Parse date string of one of the following date formats:
62
48
  * - ISO 8601 `"YYYY-MM-DD"`
@@ -64,4 +50,13 @@ export { getAdjustedYear };
64
50
  */
65
51
  declare function parseDate(str: string): Date;
66
52
 
67
- export { parseDate };
53
+ export {
54
+ getISOWeekNumber,
55
+ dateEquals,
56
+ dateAllowed,
57
+ getClosestDate,
58
+ extractDateParts,
59
+ dateAfterXMonths,
60
+ getAdjustedYear,
61
+ parseDate,
62
+ };
@@ -96,14 +96,6 @@ class DatePickerLight extends ThemableMixin(DatePickerMixin(ValidateMixin(Polyme
96
96
  };
97
97
  }
98
98
 
99
- /** @protected */
100
- connectedCallback() {
101
- super.connectedCallback();
102
- const cssSelector = 'vaadin-text-field,.input';
103
- this._setInputElement(this.querySelector(cssSelector));
104
- this._setFocusElement(this.inputElement);
105
- }
106
-
107
99
  /** @return {string | undefined} */
108
100
  get _inputValue() {
109
101
  return this.inputElement && this.inputElement[dashToCamelCase(this.attrForValue)];
@@ -115,6 +107,14 @@ class DatePickerLight extends ThemableMixin(DatePickerMixin(ValidateMixin(Polyme
115
107
  }
116
108
  }
117
109
 
110
+ /** @protected */
111
+ connectedCallback() {
112
+ super.connectedCallback();
113
+ const cssSelector = 'vaadin-text-field,.input';
114
+ this._setInputElement(this.querySelector(cssSelector));
115
+ this._setFocusElement(this.inputElement);
116
+ }
117
+
118
118
  // Workaround https://github.com/vaadin/web-components/issues/2855
119
119
  /** @protected */
120
120
  _openedChanged(opened) {
@@ -8,6 +8,7 @@ import type { DelegateFocusMixinClass } from '@vaadin/component-base/src/delegat
8
8
  import type { DisabledMixinClass } from '@vaadin/component-base/src/disabled-mixin.js';
9
9
  import type { FocusMixinClass } from '@vaadin/component-base/src/focus-mixin.js';
10
10
  import type { KeyboardMixinClass } from '@vaadin/component-base/src/keyboard-mixin.js';
11
+ import type { OverlayClassMixinClass } from '@vaadin/component-base/src/overlay-class-mixin.js';
11
12
  import type { InputConstraintsMixinClass } from '@vaadin/field-base/src/input-constraints-mixin.js';
12
13
  import type { InputMixinClass } from '@vaadin/field-base/src/input-mixin.js';
13
14
 
@@ -93,6 +94,7 @@ export declare function DatePickerMixin<T extends Constructor<HTMLElement>>(
93
94
  Constructor<InputConstraintsMixinClass> &
94
95
  Constructor<InputMixinClass> &
95
96
  Constructor<KeyboardMixinClass> &
97
+ Constructor<OverlayClassMixinClass> &
96
98
  T;
97
99
 
98
100
  export declare class DatePickerMixinClass {
@@ -8,6 +8,7 @@ import { ControllerMixin } from '@vaadin/component-base/src/controller-mixin.js'
8
8
  import { DelegateFocusMixin } from '@vaadin/component-base/src/delegate-focus-mixin.js';
9
9
  import { KeyboardMixin } from '@vaadin/component-base/src/keyboard-mixin.js';
10
10
  import { MediaQueryController } from '@vaadin/component-base/src/media-query-controller.js';
11
+ import { OverlayClassMixin } from '@vaadin/component-base/src/overlay-class-mixin.js';
11
12
  import { InputConstraintsMixin } from '@vaadin/field-base/src/input-constraints-mixin.js';
12
13
  import { VirtualKeyboardController } from '@vaadin/field-base/src/virtual-keyboard-controller.js';
13
14
  import {
@@ -21,11 +22,16 @@ import {
21
22
 
22
23
  /**
23
24
  * @polymerMixin
25
+ * @mixes ControllerMixin
26
+ * @mixes DelegateFocusMixin
27
+ * @mixes InputConstraintsMixin
28
+ * @mixes KeyboardMixin
29
+ * @mixes OverlayClassMixin
24
30
  * @param {function(new:HTMLElement)} subclass
25
31
  */
26
32
  export const DatePickerMixin = (subclass) =>
27
- class VaadinDatePickerMixin extends ControllerMixin(
28
- DelegateFocusMixin(InputConstraintsMixin(KeyboardMixin(subclass))),
33
+ class DatePickerMixinClass extends OverlayClassMixin(
34
+ ControllerMixin(DelegateFocusMixin(InputConstraintsMixin(KeyboardMixin(subclass)))),
29
35
  ) {
30
36
  static get properties() {
31
37
  return {
@@ -338,6 +344,14 @@ export const DatePickerMixin = (subclass) =>
338
344
  return [...super.constraints, 'min', 'max'];
339
345
  }
340
346
 
347
+ constructor() {
348
+ super();
349
+
350
+ this._boundOnClick = this._onClick.bind(this);
351
+ this._boundOnScroll = this._onScroll.bind(this);
352
+ this._boundOverlayRenderer = this._overlayRenderer.bind(this);
353
+ }
354
+
341
355
  /**
342
356
  * Override a getter from `InputControlMixin` to make it optional
343
357
  * and to prevent warning when a clear button is missing,
@@ -349,18 +363,6 @@ export const DatePickerMixin = (subclass) =>
349
363
  return null;
350
364
  }
351
365
 
352
- /** @protected */
353
- get _inputValue() {
354
- return this.inputElement ? this.inputElement.value : undefined;
355
- }
356
-
357
- /** @protected */
358
- set _inputValue(value) {
359
- if (this.inputElement) {
360
- this.inputElement.value = value;
361
- }
362
- }
363
-
364
366
  /** @private */
365
367
  get _nativeInput() {
366
368
  if (this.inputElement) {
@@ -370,12 +372,16 @@ export const DatePickerMixin = (subclass) =>
370
372
  return null;
371
373
  }
372
374
 
373
- constructor() {
374
- super();
375
+ /** @protected */
376
+ get _inputValue() {
377
+ return this.inputElement ? this.inputElement.value : undefined;
378
+ }
375
379
 
376
- this._boundOnClick = this._onClick.bind(this);
377
- this._boundOnScroll = this._onScroll.bind(this);
378
- this._boundOverlayRenderer = this._overlayRenderer.bind(this);
380
+ /** @protected */
381
+ set _inputValue(value) {
382
+ if (this.inputElement) {
383
+ this.inputElement.value = value;
384
+ }
379
385
  }
380
386
 
381
387
  /**
@@ -424,7 +430,10 @@ export const DatePickerMixin = (subclass) =>
424
430
 
425
431
  this.addController(new VirtualKeyboardController(this));
426
432
 
427
- this.$.overlay.renderer = this._boundOverlayRenderer;
433
+ const overlay = this.$.overlay;
434
+ this._overlayElement = overlay;
435
+
436
+ overlay.renderer = this._boundOverlayRenderer;
428
437
 
429
438
  this.addEventListener('mousedown', () => this.__bringToFront());
430
439
  this.addEventListener('touchstart', () => this.__bringToFront());
@@ -8,6 +8,7 @@ import { html, PolymerElement } from '@polymer/polymer/polymer-element.js';
8
8
  import { timeOut } from '@vaadin/component-base/src/async.js';
9
9
  import { isFirefox } from '@vaadin/component-base/src/browser-utils.js';
10
10
  import { Debouncer } from '@vaadin/component-base/src/debounce.js';
11
+ import { generateUniqueId } from '@vaadin/component-base/src/unique-id-utils.js';
11
12
 
12
13
  /**
13
14
  * @extends HTMLElement
@@ -117,6 +118,71 @@ export class InfiniteScroller extends PolymerElement {
117
118
  };
118
119
  }
119
120
 
121
+ /**
122
+ * @return {number}
123
+ */
124
+ get bufferOffset() {
125
+ return this._buffers[0].offsetTop;
126
+ }
127
+
128
+ /**
129
+ * @return {number}
130
+ */
131
+ get itemHeight() {
132
+ if (!this._itemHeightVal) {
133
+ const itemHeight = getComputedStyle(this).getPropertyValue('--vaadin-infinite-scroller-item-height');
134
+ // Use background-position temp inline style for unit conversion
135
+ const tmpStyleProp = 'background-position';
136
+ this.$.fullHeight.style.setProperty(tmpStyleProp, itemHeight);
137
+ const itemHeightPx = getComputedStyle(this.$.fullHeight).getPropertyValue(tmpStyleProp);
138
+ this.$.fullHeight.style.removeProperty(tmpStyleProp);
139
+ this._itemHeightVal = parseFloat(itemHeightPx);
140
+ }
141
+
142
+ return this._itemHeightVal;
143
+ }
144
+
145
+ /** @private */
146
+ get _bufferHeight() {
147
+ return this.itemHeight * this.bufferSize;
148
+ }
149
+
150
+ /**
151
+ * @return {number}
152
+ */
153
+ get position() {
154
+ return (this.$.scroller.scrollTop - this._buffers[0].translateY) / this.itemHeight + this._firstIndex;
155
+ }
156
+
157
+ /**
158
+ * Current scroller position as index. Can be a fractional number.
159
+ *
160
+ * @type {number}
161
+ */
162
+ set position(index) {
163
+ this._preventScrollEvent = true;
164
+ if (index > this._firstIndex && index < this._firstIndex + this.bufferSize * 2) {
165
+ this.$.scroller.scrollTop = this.itemHeight * (index - this._firstIndex) + this._buffers[0].translateY;
166
+ } else {
167
+ this._initialIndex = ~~index;
168
+ this._reset();
169
+ this._scrollDisabled = true;
170
+ this.$.scroller.scrollTop += (index % 1) * this.itemHeight;
171
+ this._scrollDisabled = false;
172
+ }
173
+
174
+ if (this._mayHaveMomentum) {
175
+ // Stop the possible iOS Safari momentum with -webkit-overflow-scrolling: auto;
176
+ this.$.scroller.classList.add('notouchscroll');
177
+ this._mayHaveMomentum = false;
178
+
179
+ setTimeout(() => {
180
+ // Restore -webkit-overflow-scrolling: touch; after a small delay.
181
+ this.$.scroller.classList.remove('notouchscroll');
182
+ }, 10);
183
+ }
184
+ }
185
+
120
186
  /** @protected */
121
187
  ready() {
122
188
  super.ready();
@@ -235,71 +301,6 @@ export class InfiniteScroller extends PolymerElement {
235
301
  });
236
302
  }
237
303
 
238
- /**
239
- * @return {number}
240
- */
241
- get bufferOffset() {
242
- return this._buffers[0].offsetTop;
243
- }
244
-
245
- /**
246
- * @return {number}
247
- */
248
- get position() {
249
- return (this.$.scroller.scrollTop - this._buffers[0].translateY) / this.itemHeight + this._firstIndex;
250
- }
251
-
252
- /**
253
- * Current scroller position as index. Can be a fractional number.
254
- *
255
- * @type {number}
256
- */
257
- set position(index) {
258
- this._preventScrollEvent = true;
259
- if (index > this._firstIndex && index < this._firstIndex + this.bufferSize * 2) {
260
- this.$.scroller.scrollTop = this.itemHeight * (index - this._firstIndex) + this._buffers[0].translateY;
261
- } else {
262
- this._initialIndex = ~~index;
263
- this._reset();
264
- this._scrollDisabled = true;
265
- this.$.scroller.scrollTop += (index % 1) * this.itemHeight;
266
- this._scrollDisabled = false;
267
- }
268
-
269
- if (this._mayHaveMomentum) {
270
- // Stop the possible iOS Safari momentum with -webkit-overflow-scrolling: auto;
271
- this.$.scroller.classList.add('notouchscroll');
272
- this._mayHaveMomentum = false;
273
-
274
- setTimeout(() => {
275
- // Restore -webkit-overflow-scrolling: touch; after a small delay.
276
- this.$.scroller.classList.remove('notouchscroll');
277
- }, 10);
278
- }
279
- }
280
-
281
- /**
282
- * @return {number}
283
- */
284
- get itemHeight() {
285
- if (!this._itemHeightVal) {
286
- const itemHeight = getComputedStyle(this).getPropertyValue('--vaadin-infinite-scroller-item-height');
287
- // Use background-position temp inline style for unit conversion
288
- const tmpStyleProp = 'background-position';
289
- this.$.fullHeight.style.setProperty(tmpStyleProp, itemHeight);
290
- const itemHeightPx = getComputedStyle(this.$.fullHeight).getPropertyValue(tmpStyleProp);
291
- this.$.fullHeight.style.removeProperty(tmpStyleProp);
292
- this._itemHeightVal = parseFloat(itemHeightPx);
293
- }
294
-
295
- return this._itemHeightVal;
296
- }
297
-
298
- /** @private */
299
- get _bufferHeight() {
300
- return this.itemHeight * this.bufferSize;
301
- }
302
-
303
304
  /** @private */
304
305
  _reset() {
305
306
  this._scrollDisabled = true;
@@ -329,8 +330,7 @@ export class InfiniteScroller extends PolymerElement {
329
330
  itemWrapper.style.height = `${this.itemHeight}px`;
330
331
  itemWrapper.instance = {};
331
332
 
332
- const contentId = (InfiniteScroller._contentIndex = InfiniteScroller._contentIndex + 1 || 0);
333
- const slotName = `vaadin-infinite-scroller-item-content-${contentId}`;
333
+ const slotName = `vaadin-infinite-scroller-item-content-${generateUniqueId()}`;
334
334
 
335
335
  const slot = document.createElement('slot');
336
336
  slot.setAttribute('name', slotName);
@@ -205,18 +205,18 @@ class MonthCalendar extends FocusMixin(ThemableMixin(PolymerElement)) {
205
205
  ];
206
206
  }
207
207
 
208
- /** @protected */
209
- ready() {
210
- super.ready();
211
- addListener(this.$.monthGrid, 'tap', this._handleTap.bind(this));
212
- }
213
-
214
208
  get focusableDateElement() {
215
209
  return [...this.shadowRoot.querySelectorAll('[part~=date]')].find((datePart) => {
216
210
  return dateEquals(datePart.date, this.focusedDate);
217
211
  });
218
212
  }
219
213
 
214
+ /** @protected */
215
+ ready() {
216
+ super.ready();
217
+ addListener(this.$.monthGrid, 'tap', this._handleTap.bind(this));
218
+ }
219
+
220
220
  /* Returns true if all the dates in the month are out of the allowed range */
221
221
  _isDisabled(month, minDate, maxDate) {
222
222
  // First day of the month
@@ -25,7 +25,7 @@ registerStyles(
25
25
 
26
26
  [part='year-separator']::after {
27
27
  color: var(--lumo-disabled-text-color);
28
- content: '';
28
+ content: '\\2022';
29
29
  }
30
30
  `,
31
31
  { moduleId: 'lumo-date-picker-year' },
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-alpha8",
4
+ "version": "24.0.0-alpha12",
5
5
  "description-markup": "markdown",
6
6
  "contributions": {
7
7
  "html": {
@@ -10,6 +10,28 @@
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": "disabled",
15
+ "description": "If true, the user cannot interact with this element.",
16
+ "value": {
17
+ "type": [
18
+ "boolean",
19
+ "null",
20
+ "undefined"
21
+ ]
22
+ }
23
+ },
24
+ {
25
+ "name": "autofocus",
26
+ "description": "Specify that this control should have input focus when the page loads.",
27
+ "value": {
28
+ "type": [
29
+ "boolean",
30
+ "null",
31
+ "undefined"
32
+ ]
33
+ }
34
+ },
13
35
  {
14
36
  "name": "value",
15
37
  "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\"`",
@@ -19,6 +41,39 @@
19
41
  ]
20
42
  }
21
43
  },
44
+ {
45
+ "name": "invalid",
46
+ "description": "Set to true when the field is invalid.",
47
+ "value": {
48
+ "type": [
49
+ "boolean",
50
+ "null",
51
+ "undefined"
52
+ ]
53
+ }
54
+ },
55
+ {
56
+ "name": "required",
57
+ "description": "Specifies that the user must fill in a value.",
58
+ "value": {
59
+ "type": [
60
+ "boolean",
61
+ "null",
62
+ "undefined"
63
+ ]
64
+ }
65
+ },
66
+ {
67
+ "name": "overlay-class",
68
+ "description": "A space-delimited list of CSS class names to set on the overlay element.\nThis property does not affect other CSS class names set manually via JS.\n\nNote, if the CSS class name was set with this property, clearing it will\nremove it from the overlay, even if the same class name was also added\nmanually, e.g. by using `classList.add()` in the `renderer` function.",
69
+ "value": {
70
+ "type": [
71
+ "string",
72
+ "null",
73
+ "undefined"
74
+ ]
75
+ }
76
+ },
22
77
  {
23
78
  "name": "initial-position",
24
79
  "description": "Date which should be visible when there is no value selected.\n\nThe same date formats as for the `value` property are supported.",
@@ -106,6 +161,28 @@
106
161
  ],
107
162
  "js": {
108
163
  "properties": [
164
+ {
165
+ "name": "disabled",
166
+ "description": "If true, the user cannot interact with this element.",
167
+ "value": {
168
+ "type": [
169
+ "boolean",
170
+ "null",
171
+ "undefined"
172
+ ]
173
+ }
174
+ },
175
+ {
176
+ "name": "autofocus",
177
+ "description": "Specify that this control should have input focus when the page loads.",
178
+ "value": {
179
+ "type": [
180
+ "boolean",
181
+ "null",
182
+ "undefined"
183
+ ]
184
+ }
185
+ },
109
186
  {
110
187
  "name": "value",
111
188
  "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\"`",
@@ -115,6 +192,39 @@
115
192
  ]
116
193
  }
117
194
  },
195
+ {
196
+ "name": "invalid",
197
+ "description": "Set to true when the field is invalid.",
198
+ "value": {
199
+ "type": [
200
+ "boolean",
201
+ "null",
202
+ "undefined"
203
+ ]
204
+ }
205
+ },
206
+ {
207
+ "name": "required",
208
+ "description": "Specifies that the user must fill in a value.",
209
+ "value": {
210
+ "type": [
211
+ "boolean",
212
+ "null",
213
+ "undefined"
214
+ ]
215
+ }
216
+ },
217
+ {
218
+ "name": "overlayClass",
219
+ "description": "A space-delimited list of CSS class names to set on the overlay element.\nThis property does not affect other CSS class names set manually via JS.\n\nNote, if the CSS class name was set with this property, clearing it will\nremove it from the overlay, even if the same class name was also added\nmanually, e.g. by using `classList.add()` in the `renderer` function.",
220
+ "value": {
221
+ "type": [
222
+ "string",
223
+ "null",
224
+ "undefined"
225
+ ]
226
+ }
227
+ },
118
228
  {
119
229
  "name": "initialPosition",
120
230
  "description": "Date which should be visible when there is no value selected.\n\nThe same date formats as for the `value` property are supported.",
@@ -199,6 +309,10 @@
199
309
  }
200
310
  ],
201
311
  "events": [
312
+ {
313
+ "name": "validated",
314
+ "description": "Fired whenever the field is validated."
315
+ },
202
316
  {
203
317
  "name": "change",
204
318
  "description": "Fired when the user commits a value change."
@@ -210,13 +324,17 @@
210
324
  {
211
325
  "name": "value-changed",
212
326
  "description": "Fired when `value` property value changes."
327
+ },
328
+ {
329
+ "name": "invalid-changed",
330
+ "description": "Fired when the `invalid` property changes."
213
331
  }
214
332
  ]
215
333
  }
216
334
  },
217
335
  {
218
336
  "name": "vaadin-date-picker",
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.",
337
+ "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-alpha12/#/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-alpha12/#/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-alpha12/#/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-alpha12/#/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.",
220
338
  "attributes": [
221
339
  {
222
340
  "name": "disabled",
@@ -381,6 +499,17 @@
381
499
  ]
382
500
  }
383
501
  },
502
+ {
503
+ "name": "overlay-class",
504
+ "description": "A space-delimited list of CSS class names to set on the overlay element.\nThis property does not affect other CSS class names set manually via JS.\n\nNote, if the CSS class name was set with this property, clearing it will\nremove it from the overlay, even if the same class name was also added\nmanually, e.g. by using `classList.add()` in the `renderer` function.",
505
+ "value": {
506
+ "type": [
507
+ "string",
508
+ "null",
509
+ "undefined"
510
+ ]
511
+ }
512
+ },
384
513
  {
385
514
  "name": "initial-position",
386
515
  "description": "Date which should be visible when there is no value selected.\n\nThe same date formats as for the `value` property are supported.",
@@ -622,6 +751,17 @@
622
751
  ]
623
752
  }
624
753
  },
754
+ {
755
+ "name": "overlayClass",
756
+ "description": "A space-delimited list of CSS class names to set on the overlay element.\nThis property does not affect other CSS class names set manually via JS.\n\nNote, if the CSS class name was set with this property, clearing it will\nremove it from the overlay, even if the same class name was also added\nmanually, e.g. by using `classList.add()` in the `renderer` function.",
757
+ "value": {
758
+ "type": [
759
+ "string",
760
+ "null",
761
+ "undefined"
762
+ ]
763
+ }
764
+ },
625
765
  {
626
766
  "name": "initialPosition",
627
767
  "description": "Date which should be visible when there is no value selected.\n\nThe same date formats as for the `value` property are supported.",
@@ -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-alpha8",
4
+ "version": "24.0.0-alpha12",
5
5
  "description-markup": "markdown",
6
6
  "framework": "lit",
7
7
  "framework-config": {
@@ -19,6 +19,34 @@
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": "?disabled",
24
+ "description": "If true, the user cannot interact with this element.",
25
+ "value": {
26
+ "kind": "expression"
27
+ }
28
+ },
29
+ {
30
+ "name": "?autofocus",
31
+ "description": "Specify that this control should have input focus when the page loads.",
32
+ "value": {
33
+ "kind": "expression"
34
+ }
35
+ },
36
+ {
37
+ "name": "?invalid",
38
+ "description": "Set to true when the field is invalid.",
39
+ "value": {
40
+ "kind": "expression"
41
+ }
42
+ },
43
+ {
44
+ "name": "?required",
45
+ "description": "Specifies that the user must fill in a value.",
46
+ "value": {
47
+ "kind": "expression"
48
+ }
49
+ },
22
50
  {
23
51
  "name": "?opened",
24
52
  "description": "Set true to open the date selector overlay.",
@@ -47,6 +75,13 @@
47
75
  "kind": "expression"
48
76
  }
49
77
  },
78
+ {
79
+ "name": ".overlayClass",
80
+ "description": "A space-delimited list of CSS class names to set on the overlay element.\nThis property does not affect other CSS class names set manually via JS.\n\nNote, if the CSS class name was set with this property, clearing it will\nremove it from the overlay, even if the same class name was also added\nmanually, e.g. by using `classList.add()` in the `renderer` function.",
81
+ "value": {
82
+ "kind": "expression"
83
+ }
84
+ },
50
85
  {
51
86
  "name": ".initialPosition",
52
87
  "description": "Date which should be visible when there is no value selected.\n\nThe same date formats as for the `value` property are supported.",
@@ -82,6 +117,13 @@
82
117
  "kind": "expression"
83
118
  }
84
119
  },
120
+ {
121
+ "name": "@validated",
122
+ "description": "Fired whenever the field is validated.",
123
+ "value": {
124
+ "kind": "expression"
125
+ }
126
+ },
85
127
  {
86
128
  "name": "@change",
87
129
  "description": "Fired when the user commits a value change.",
@@ -102,12 +144,19 @@
102
144
  "value": {
103
145
  "kind": "expression"
104
146
  }
147
+ },
148
+ {
149
+ "name": "@invalid-changed",
150
+ "description": "Fired when the `invalid` property changes.",
151
+ "value": {
152
+ "kind": "expression"
153
+ }
105
154
  }
106
155
  ]
107
156
  },
108
157
  {
109
158
  "name": "vaadin-date-picker",
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.",
159
+ "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-alpha12/#/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-alpha12/#/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-alpha12/#/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-alpha12/#/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.",
111
160
  "extension": true,
112
161
  "attributes": [
113
162
  {
@@ -236,6 +285,13 @@
236
285
  "kind": "expression"
237
286
  }
238
287
  },
288
+ {
289
+ "name": ".overlayClass",
290
+ "description": "A space-delimited list of CSS class names to set on the overlay element.\nThis property does not affect other CSS class names set manually via JS.\n\nNote, if the CSS class name was set with this property, clearing it will\nremove it from the overlay, even if the same class name was also added\nmanually, e.g. by using `classList.add()` in the `renderer` function.",
291
+ "value": {
292
+ "kind": "expression"
293
+ }
294
+ },
239
295
  {
240
296
  "name": ".initialPosition",
241
297
  "description": "Date which should be visible when there is no value selected.\n\nThe same date formats as for the `value` property are supported.",