@vaadin/date-picker 24.8.0-alpha9 → 25.0.0-alpha2

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.
Files changed (44) hide show
  1. package/README.md +0 -23
  2. package/package.json +13 -15
  3. package/src/vaadin-date-picker-mixin.js +6 -28
  4. package/src/vaadin-date-picker-overlay-content-mixin.js +4 -6
  5. package/src/vaadin-date-picker-overlay-content.js +22 -21
  6. package/src/vaadin-date-picker-overlay.js +11 -9
  7. package/src/vaadin-date-picker-year.js +15 -10
  8. package/src/vaadin-date-picker.d.ts +0 -3
  9. package/src/vaadin-date-picker.js +53 -41
  10. package/src/vaadin-infinite-scroller.js +0 -13
  11. package/src/vaadin-month-calendar.js +67 -46
  12. package/web-types.json +2 -369
  13. package/web-types.lit.json +2 -156
  14. package/src/vaadin-date-picker-light.d.ts +0 -112
  15. package/src/vaadin-date-picker-light.js +0 -133
  16. package/src/vaadin-lit-date-picker-overlay-content.js +0 -70
  17. package/src/vaadin-lit-date-picker-overlay.js +0 -46
  18. package/src/vaadin-lit-date-picker-year.js +0 -41
  19. package/src/vaadin-lit-date-picker.js +0 -172
  20. package/src/vaadin-lit-month-calendar.js +0 -98
  21. package/theme/lumo/vaadin-date-picker-light.d.ts +0 -4
  22. package/theme/lumo/vaadin-date-picker-light.js +0 -4
  23. package/theme/lumo/vaadin-lit-date-picker.d.ts +0 -5
  24. package/theme/lumo/vaadin-lit-date-picker.js +0 -5
  25. package/theme/material/vaadin-date-picker-light.d.ts +0 -4
  26. package/theme/material/vaadin-date-picker-light.js +0 -4
  27. package/theme/material/vaadin-date-picker-overlay-content-styles.d.ts +0 -6
  28. package/theme/material/vaadin-date-picker-overlay-content-styles.js +0 -132
  29. package/theme/material/vaadin-date-picker-overlay-styles.d.ts +0 -1
  30. package/theme/material/vaadin-date-picker-overlay-styles.js +0 -47
  31. package/theme/material/vaadin-date-picker-styles.d.ts +0 -3
  32. package/theme/material/vaadin-date-picker-styles.js +0 -22
  33. package/theme/material/vaadin-date-picker-year-styles.d.ts +0 -1
  34. package/theme/material/vaadin-date-picker-year-styles.js +0 -28
  35. package/theme/material/vaadin-date-picker.d.ts +0 -5
  36. package/theme/material/vaadin-date-picker.js +0 -5
  37. package/theme/material/vaadin-lit-date-picker.d.ts +0 -5
  38. package/theme/material/vaadin-lit-date-picker.js +0 -5
  39. package/theme/material/vaadin-month-calendar-styles.d.ts +0 -2
  40. package/theme/material/vaadin-month-calendar-styles.js +0 -120
  41. package/vaadin-date-picker-light.d.ts +0 -1
  42. package/vaadin-date-picker-light.js +0 -2
  43. package/vaadin-lit-date-picker.d.ts +0 -1
  44. package/vaadin-lit-date-picker.js +0 -2
package/README.md CHANGED
@@ -26,29 +26,6 @@ Once installed, import the component in your application:
26
26
  import '@vaadin/date-picker';
27
27
  ```
28
28
 
29
- ## Themes
30
-
31
- Vaadin components come with two built-in [themes](https://vaadin.com/docs/latest/styling), Lumo and Material.
32
- The [main entrypoint](https://github.com/vaadin/web-components/blob/main/packages/date-picker/vaadin-date-picker.js) of the package uses the Lumo theme.
33
-
34
- To use the Material theme, import the component from the `theme/material` folder:
35
-
36
- ```js
37
- import '@vaadin/date-picker/theme/material/vaadin-date-picker.js';
38
- ```
39
-
40
- You can also import the Lumo version of the component explicitly:
41
-
42
- ```js
43
- import '@vaadin/date-picker/theme/lumo/vaadin-date-picker.js';
44
- ```
45
-
46
- Finally, you can import the un-themed component from the `src` folder to get a minimal starting point:
47
-
48
- ```js
49
- import '@vaadin/date-picker/src/vaadin-date-picker.js';
50
- ```
51
-
52
29
  ## Contributing
53
30
 
54
31
  Read the [contributing guide](https://vaadin.com/docs/latest/contributing) to learn about our development process, how to propose bugfixes and improvements, and how to test your changes to Vaadin components.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vaadin/date-picker",
3
- "version": "24.8.0-alpha9",
3
+ "version": "25.0.0-alpha2",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -35,27 +35,25 @@
35
35
  ],
36
36
  "dependencies": {
37
37
  "@open-wc/dedupe-mixin": "^1.3.0",
38
- "@polymer/polymer": "^3.2.0",
39
- "@vaadin/a11y-base": "24.8.0-alpha9",
40
- "@vaadin/button": "24.8.0-alpha9",
41
- "@vaadin/component-base": "24.8.0-alpha9",
42
- "@vaadin/field-base": "24.8.0-alpha9",
43
- "@vaadin/input-container": "24.8.0-alpha9",
44
- "@vaadin/overlay": "24.8.0-alpha9",
45
- "@vaadin/vaadin-lumo-styles": "24.8.0-alpha9",
46
- "@vaadin/vaadin-material-styles": "24.8.0-alpha9",
47
- "@vaadin/vaadin-themable-mixin": "24.8.0-alpha9",
38
+ "@vaadin/a11y-base": "25.0.0-alpha2",
39
+ "@vaadin/button": "25.0.0-alpha2",
40
+ "@vaadin/component-base": "25.0.0-alpha2",
41
+ "@vaadin/field-base": "25.0.0-alpha2",
42
+ "@vaadin/input-container": "25.0.0-alpha2",
43
+ "@vaadin/overlay": "25.0.0-alpha2",
44
+ "@vaadin/vaadin-lumo-styles": "25.0.0-alpha2",
45
+ "@vaadin/vaadin-themable-mixin": "25.0.0-alpha2",
48
46
  "lit": "^3.0.0"
49
47
  },
50
48
  "devDependencies": {
51
- "@vaadin/chai-plugins": "24.8.0-alpha9",
52
- "@vaadin/test-runner-commands": "24.8.0-alpha9",
53
- "@vaadin/testing-helpers": "^1.1.0",
49
+ "@vaadin/chai-plugins": "25.0.0-alpha2",
50
+ "@vaadin/test-runner-commands": "25.0.0-alpha2",
51
+ "@vaadin/testing-helpers": "^2.0.0",
54
52
  "sinon": "^18.0.0"
55
53
  },
56
54
  "web-types": [
57
55
  "web-types.json",
58
56
  "web-types.lit.json"
59
57
  ],
60
- "gitHead": "4de3809275ddfd733b0d13fd02af8faf73eb6770"
58
+ "gitHead": "67ffcd5355cf21ce1b5039c598525109fc4c164b"
61
59
  }
@@ -8,7 +8,6 @@ import { DelegateFocusMixin } from '@vaadin/a11y-base/src/delegate-focus-mixin.j
8
8
  import { isKeyboardActive } from '@vaadin/a11y-base/src/focus-utils.js';
9
9
  import { KeyboardMixin } from '@vaadin/a11y-base/src/keyboard-mixin.js';
10
10
  import { isIOS } from '@vaadin/component-base/src/browser-utils.js';
11
- import { ControllerMixin } from '@vaadin/component-base/src/controller-mixin.js';
12
11
  import { I18nMixin } from '@vaadin/component-base/src/i18n-mixin.js';
13
12
  import { MediaQueryController } from '@vaadin/component-base/src/media-query-controller.js';
14
13
  import { OverlayClassMixin } from '@vaadin/component-base/src/overlay-class-mixin.js';
@@ -82,7 +81,6 @@ export const datePickerI18nDefaults = Object.freeze({
82
81
 
83
82
  /**
84
83
  * @polymerMixin
85
- * @mixes ControllerMixin
86
84
  * @mixes DelegateFocusMixin
87
85
  * @mixes I18nMixin
88
86
  * @mixes InputConstraintsMixin
@@ -93,7 +91,7 @@ export const datePickerI18nDefaults = Object.freeze({
93
91
  export const DatePickerMixin = (subclass) =>
94
92
  class DatePickerMixinClass extends I18nMixin(
95
93
  datePickerI18nDefaults,
96
- OverlayClassMixin(ControllerMixin(DelegateFocusMixin(InputConstraintsMixin(KeyboardMixin(subclass))))),
94
+ OverlayClassMixin(DelegateFocusMixin(InputConstraintsMixin(KeyboardMixin(subclass)))),
97
95
  ) {
98
96
  static get properties() {
99
97
  return {
@@ -397,26 +395,6 @@ export const DatePickerMixin = (subclass) =>
397
395
  this.__setEnteredDate(parsedDate);
398
396
  }
399
397
 
400
- /**
401
- * Override a getter from `InputControlMixin` to make it optional
402
- * and to prevent warning when a clear button is missing,
403
- * for example when using <vaadin-date-picker-light>.
404
- * @protected
405
- * @return {Element | null | undefined}
406
- */
407
- get clearElement() {
408
- return null;
409
- }
410
-
411
- /** @private */
412
- get _nativeInput() {
413
- if (this.inputElement) {
414
- // TODO: support focusElement for backwards compatibility
415
- return this.inputElement.focusElement || this.inputElement;
416
- }
417
- return null;
418
- }
419
-
420
398
  /**
421
399
  * The input element's value when it cannot be parsed as a date, and an empty string otherwise.
422
400
  *
@@ -916,7 +894,7 @@ export const DatePickerMixin = (subclass) =>
916
894
  this._focus();
917
895
  }
918
896
 
919
- const input = this._nativeInput;
897
+ const input = this.inputElement;
920
898
  if (this._noInput && input) {
921
899
  input.blur();
922
900
  this._overlayContent.focusDateElement();
@@ -982,8 +960,8 @@ export const DatePickerMixin = (subclass) =>
982
960
  }
983
961
  this.__commitParsedOrFocusedDate();
984
962
 
985
- if (this._nativeInput && this._nativeInput.selectionStart) {
986
- this._nativeInput.selectionStart = this._nativeInput.selectionEnd;
963
+ if (this.inputElement && this.inputElement.selectionStart) {
964
+ this.inputElement.selectionStart = this.inputElement.selectionEnd;
987
965
  }
988
966
  // No need to revalidate the value after `_selectedDateChanged`
989
967
  // Needed in case the value was not changed: open and close dropdown,
@@ -1020,8 +998,8 @@ export const DatePickerMixin = (subclass) =>
1020
998
 
1021
999
  /** @private */
1022
1000
  _setSelectionRange(a, b) {
1023
- if (this._nativeInput && this._nativeInput.setSelectionRange) {
1024
- this._nativeInput.setSelectionRange(a, b);
1001
+ if (this.inputElement) {
1002
+ this.inputElement.setSelectionRange(a, b);
1025
1003
  }
1026
1004
  }
1027
1005
 
@@ -3,8 +3,6 @@
3
3
  * Copyright (c) 2016 - 2025 Vaadin Ltd.
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
- import { flush } from '@polymer/polymer/lib/utils/flush.js';
7
- import { afterNextRender } from '@polymer/polymer/lib/utils/render-status.js';
8
6
  import { timeOut } from '@vaadin/component-base/src/async.js';
9
7
  import { Debouncer } from '@vaadin/component-base/src/debounce.js';
10
8
  import { addListener, setTouchAction } from '@vaadin/component-base/src/gestures.js';
@@ -936,10 +934,10 @@ export const DatePickerOverlayContentMixin = (superClass) =>
936
934
  // Wait for `vaadin-month-calendar` elements to be rendered
937
935
  if (!this.calendars.length) {
938
936
  await new Promise((resolve) => {
939
- afterNextRender(this, () => {
940
- // Force dom-repeat elements to render
941
- flush();
942
- resolve();
937
+ requestAnimationFrame(() => {
938
+ setTimeout(() => {
939
+ resolve();
940
+ });
943
941
  });
944
942
  });
945
943
  }
@@ -8,35 +8,40 @@ import './vaadin-date-picker-month-scroller.js';
8
8
  import './vaadin-date-picker-year-scroller.js';
9
9
  import './vaadin-date-picker-year.js';
10
10
  import './vaadin-month-calendar.js';
11
- import { html, PolymerElement } from '@polymer/polymer/polymer-element.js';
12
- import { ControllerMixin } from '@vaadin/component-base/src/controller-mixin.js';
11
+ import { html, LitElement } from 'lit';
13
12
  import { defineCustomElement } from '@vaadin/component-base/src/define.js';
14
13
  import { DirMixin } from '@vaadin/component-base/src/dir-mixin.js';
15
- import { registerStyles, ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
14
+ import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
15
+ import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
16
16
  import { DatePickerOverlayContentMixin } from './vaadin-date-picker-overlay-content-mixin.js';
17
17
  import { overlayContentStyles } from './vaadin-date-picker-overlay-content-styles.js';
18
18
 
19
- registerStyles('vaadin-date-picker-overlay-content', overlayContentStyles, {
20
- moduleId: 'vaadin-date-picker-overlay-content-styles',
21
- });
22
-
23
19
  /**
24
20
  * @customElement
25
21
  * @extends HTMLElement
26
22
  * @private
27
23
  */
28
24
  class DatePickerOverlayContent extends DatePickerOverlayContentMixin(
29
- ControllerMixin(ThemableMixin(DirMixin(PolymerElement))),
25
+ ThemableMixin(DirMixin(PolylitMixin(LitElement))),
30
26
  ) {
31
- static get template() {
27
+ static get is() {
28
+ return 'vaadin-date-picker-overlay-content';
29
+ }
30
+
31
+ static get styles() {
32
+ return overlayContentStyles;
33
+ }
34
+
35
+ /** @protected */
36
+ render() {
32
37
  return html`
33
- <div part="overlay-header" on-touchend="_preventDefault" aria-hidden="true">
34
- <div part="label">[[_formatDisplayed(selectedDate, i18n, label)]]</div>
35
- <div part="clear-button" hidden$="[[!selectedDate]]"></div>
38
+ <div part="overlay-header" @touchend="${this._preventDefault}" aria-hidden="true">
39
+ <div part="label">${this._formatDisplayed(this.selectedDate, this.i18n, this.label)}</div>
40
+ <div part="clear-button" ?hidden="${!this.selectedDate}"></div>
36
41
  <div part="toggle-button"></div>
37
42
 
38
- <div part="years-toggle-button" hidden$="[[_desktopMode]]" aria-hidden="true">
39
- [[_yearAfterXMonths(_visibleMonthIndex)]]
43
+ <div part="years-toggle-button" ?hidden="${this._desktopMode}" aria-hidden="true">
44
+ ${this._yearAfterXMonths(this._visibleMonthIndex)}
40
45
  </div>
41
46
  </div>
42
47
 
@@ -45,20 +50,16 @@ class DatePickerOverlayContent extends DatePickerOverlayContentMixin(
45
50
  <slot name="years"></slot>
46
51
  </div>
47
52
 
48
- <div on-touchend="_preventDefault" role="toolbar" part="toolbar">
53
+ <div @touchend="${this._preventDefault}" role="toolbar" part="toolbar">
49
54
  <slot name="today-button"></slot>
50
55
  <slot name="cancel-button"></slot>
51
56
  </div>
52
57
  `;
53
58
  }
54
59
 
55
- static get is() {
56
- return 'vaadin-date-picker-overlay-content';
57
- }
58
-
59
60
  /** @protected */
60
- ready() {
61
- super.ready();
61
+ firstUpdated() {
62
+ super.firstUpdated();
62
63
 
63
64
  this.setAttribute('role', 'dialog');
64
65
 
@@ -3,18 +3,15 @@
3
3
  * Copyright (c) 2016 - 2025 Vaadin Ltd.
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
- import { html, PolymerElement } from '@polymer/polymer/polymer-element.js';
6
+ import { html, LitElement } from 'lit';
7
7
  import { defineCustomElement } from '@vaadin/component-base/src/define.js';
8
8
  import { DirMixin } from '@vaadin/component-base/src/dir-mixin.js';
9
+ import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
9
10
  import { overlayStyles } from '@vaadin/overlay/src/vaadin-overlay-styles.js';
10
- import { registerStyles, ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
11
+ import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
11
12
  import { DatePickerOverlayMixin } from './vaadin-date-picker-overlay-mixin.js';
12
13
  import { datePickerOverlayStyles } from './vaadin-date-picker-overlay-styles.js';
13
14
 
14
- registerStyles('vaadin-date-picker-overlay', [overlayStyles, datePickerOverlayStyles], {
15
- moduleId: 'vaadin-date-picker-overlay-styles',
16
- });
17
-
18
15
  /**
19
16
  * An element used internally by `<vaadin-date-picker>`. Not intended to be used separately.
20
17
  *
@@ -25,14 +22,19 @@ registerStyles('vaadin-date-picker-overlay', [overlayStyles, datePickerOverlaySt
25
22
  * @mixes ThemableMixin
26
23
  * @private
27
24
  */
28
- class DatePickerOverlay extends DatePickerOverlayMixin(DirMixin(ThemableMixin(PolymerElement))) {
25
+ class DatePickerOverlay extends DatePickerOverlayMixin(DirMixin(ThemableMixin(PolylitMixin(LitElement)))) {
29
26
  static get is() {
30
27
  return 'vaadin-date-picker-overlay';
31
28
  }
32
29
 
33
- static get template() {
30
+ static get styles() {
31
+ return [overlayStyles, datePickerOverlayStyles];
32
+ }
33
+
34
+ /** @protected */
35
+ render() {
34
36
  return html`
35
- <div id="backdrop" part="backdrop" hidden$="[[!withBackdrop]]"></div>
37
+ <div id="backdrop" part="backdrop" ?hidden="${!this.withBackdrop}"></div>
36
38
  <div part="overlay" id="overlay">
37
39
  <div part="content" id="content">
38
40
  <slot></slot>
@@ -3,8 +3,9 @@
3
3
  * Copyright (c) 2016 - 2025 Vaadin Ltd.
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
- import { html, PolymerElement } from '@polymer/polymer/polymer-element.js';
6
+ import { css, html, LitElement } from 'lit';
7
7
  import { defineCustomElement } from '@vaadin/component-base/src/define.js';
8
+ import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
8
9
  import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
9
10
  import { DatePickerYearMixin } from './vaadin-date-picker-year-mixin.js';
10
11
 
@@ -17,20 +18,24 @@ import { DatePickerYearMixin } from './vaadin-date-picker-year-mixin.js';
17
18
  * @mixes DatePickerYearMixin
18
19
  * @private
19
20
  */
20
- export class DatePickerYear extends ThemableMixin(DatePickerYearMixin(PolymerElement)) {
21
+ export class DatePickerYear extends ThemableMixin(DatePickerYearMixin(PolylitMixin(LitElement))) {
21
22
  static get is() {
22
23
  return 'vaadin-date-picker-year';
23
24
  }
24
25
 
25
- static get template() {
26
+ static get styles() {
27
+ return css`
28
+ :host {
29
+ display: block;
30
+ height: 100%;
31
+ }
32
+ `;
33
+ }
34
+
35
+ /** @protected */
36
+ render() {
26
37
  return html`
27
- <style>
28
- :host {
29
- display: block;
30
- height: 100%;
31
- }
32
- </style>
33
- <div part="year-number">[[year]]</div>
38
+ <div part="year-number">${this.year}</div>
34
39
  <div part="year-separator" aria-hidden="true"></div>
35
40
  `;
36
41
  }
@@ -93,9 +93,6 @@ export interface DatePickerEventMap extends HTMLElementEventMap, DatePickerCusto
93
93
  * -----------|--------------------------------------------------|-----------
94
94
  * `opened` | Set when the date selector overlay is opened | :host
95
95
  *
96
- * If you want to replace the default `<input>` and its container with a custom implementation to get full control
97
- * over the input field, consider using the [`<vaadin-date-picker-light>`](#/elements/vaadin-date-picker-light) element.
98
- *
99
96
  * ### Internal components
100
97
  *
101
98
  * In addition to `<vaadin-date-picker>` itself, the following internal
@@ -6,20 +6,20 @@
6
6
  import '@vaadin/input-container/src/vaadin-input-container.js';
7
7
  import './vaadin-date-picker-overlay.js';
8
8
  import './vaadin-date-picker-overlay-content.js';
9
- import { html, PolymerElement } from '@polymer/polymer/polymer-element.js';
9
+ import { html, LitElement } from 'lit';
10
+ import { ifDefined } from 'lit/directives/if-defined.js';
10
11
  import { defineCustomElement } from '@vaadin/component-base/src/define.js';
11
12
  import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
13
+ import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
12
14
  import { TooltipController } from '@vaadin/component-base/src/tooltip-controller.js';
13
15
  import { InputControlMixin } from '@vaadin/field-base/src/input-control-mixin.js';
14
16
  import { InputController } from '@vaadin/field-base/src/input-controller.js';
15
17
  import { LabelledInputController } from '@vaadin/field-base/src/labelled-input-controller.js';
16
18
  import { inputFieldShared } from '@vaadin/field-base/src/styles/input-field-shared-styles.js';
17
- import { registerStyles, ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
19
+ import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
18
20
  import { DatePickerMixin } from './vaadin-date-picker-mixin.js';
19
21
  import { datePickerStyles } from './vaadin-date-picker-styles.js';
20
22
 
21
- registerStyles('vaadin-date-picker', [inputFieldShared, datePickerStyles], { moduleId: 'vaadin-date-picker-styles' });
22
-
23
23
  /**
24
24
  * `<vaadin-date-picker>` is an input field that allows to enter a date by typing or by selecting from a calendar overlay.
25
25
  *
@@ -56,9 +56,6 @@ registerStyles('vaadin-date-picker', [inputFieldShared, datePickerStyles], { mod
56
56
  * -----------|--------------------------------------------------|-----------
57
57
  * `opened` | Set when the date selector overlay is opened | :host
58
58
  *
59
- * If you want to replace the default `<input>` and its container with a custom implementation to get full control
60
- * over the input field, consider using the [`<vaadin-date-picker-light>`](#/elements/vaadin-date-picker-light) element.
61
- *
62
59
  * ### Internal components
63
60
  *
64
61
  * In addition to `<vaadin-date-picker>` itself, the following internal
@@ -150,30 +147,54 @@ registerStyles('vaadin-date-picker', [inputFieldShared, datePickerStyles], { mod
150
147
  * @mixes InputControlMixin
151
148
  * @mixes DatePickerMixin
152
149
  */
153
- class DatePicker extends DatePickerMixin(InputControlMixin(ThemableMixin(ElementMixin(PolymerElement)))) {
150
+ class DatePicker extends DatePickerMixin(InputControlMixin(ThemableMixin(ElementMixin(PolylitMixin(LitElement))))) {
154
151
  static get is() {
155
152
  return 'vaadin-date-picker';
156
153
  }
157
154
 
158
- static get template() {
155
+ static get styles() {
156
+ return [inputFieldShared, datePickerStyles];
157
+ }
158
+
159
+ static get properties() {
160
+ return {
161
+ /** @private */
162
+ _positionTarget: {
163
+ type: Object,
164
+ sync: true,
165
+ },
166
+ };
167
+ }
168
+
169
+ /**
170
+ * Used by `InputControlMixin` as a reference to the clear button element.
171
+ * @protected
172
+ * @return {!HTMLElement}
173
+ */
174
+ get clearElement() {
175
+ return this.$.clearButton;
176
+ }
177
+
178
+ /** @protected */
179
+ render() {
159
180
  return html`
160
181
  <div class="vaadin-date-picker-container">
161
182
  <div part="label">
162
183
  <slot name="label"></slot>
163
- <span part="required-indicator" aria-hidden="true" on-click="focus"></span>
184
+ <span part="required-indicator" aria-hidden="true" @click="${this.focus}"></span>
164
185
  </div>
165
186
 
166
187
  <vaadin-input-container
167
188
  part="input-field"
168
- readonly="[[readonly]]"
169
- disabled="[[disabled]]"
170
- invalid="[[invalid]]"
171
- theme$="[[_theme]]"
189
+ .readonly="${this.readonly}"
190
+ .disabled="${this.disabled}"
191
+ .invalid="${this.invalid}"
192
+ theme="${ifDefined(this._theme)}"
172
193
  >
173
194
  <slot name="prefix" slot="prefix"></slot>
174
195
  <slot name="input"></slot>
175
196
  <div id="clearButton" part="clear-button" slot="suffix" aria-hidden="true"></div>
176
- <div part="toggle-button" slot="suffix" aria-hidden="true" on-click="_toggle"></div>
197
+ <div part="toggle-button" slot="suffix" aria-hidden="true" @click="${this._toggle}"></div>
177
198
  </vaadin-input-container>
178
199
 
179
200
  <div part="helper-text">
@@ -187,29 +208,24 @@ class DatePicker extends DatePickerMixin(InputControlMixin(ThemableMixin(Element
187
208
 
188
209
  <vaadin-date-picker-overlay
189
210
  id="overlay"
190
- fullscreen$="[[_fullscreen]]"
191
- theme$="[[_theme]]"
192
- opened="{{opened}}"
193
- on-vaadin-overlay-escape-press="_onOverlayEscapePress"
194
- on-vaadin-overlay-open="_onOverlayOpened"
195
- on-vaadin-overlay-closing="_onOverlayClosed"
211
+ ?fullscreen="${this._fullscreen}"
212
+ theme="${ifDefined(this._theme)}"
213
+ .opened="${this.opened}"
214
+ @opened-changed="${this._onOpenedChanged}"
215
+ @vaadin-overlay-escape-press="${this._onOverlayEscapePress}"
216
+ @vaadin-overlay-open="${this._onOverlayOpened}"
217
+ @vaadin-overlay-close="${this._onVaadinOverlayClose}"
218
+ @vaadin-overlay-closing="${this._onOverlayClosed}"
196
219
  restore-focus-on-close
197
- restore-focus-node="[[inputElement]]"
220
+ no-vertical-overlap
221
+ .restoreFocusNode="${this.inputElement}"
222
+ .positionTarget="${this._positionTarget}"
198
223
  ></vaadin-date-picker-overlay>
199
224
 
200
225
  <slot name="tooltip"></slot>
201
226
  `;
202
227
  }
203
228
 
204
- /**
205
- * Used by `InputControlMixin` as a reference to the clear button element.
206
- * @protected
207
- * @return {!HTMLElement}
208
- */
209
- get clearElement() {
210
- return this.$.clearButton;
211
- }
212
-
213
229
  /** @protected */
214
230
  ready() {
215
231
  super.ready();
@@ -239,10 +255,15 @@ class DatePicker extends DatePickerMixin(InputControlMixin(ThemableMixin(Element
239
255
  this._tooltipController.setAriaTarget(this.inputElement);
240
256
  this._tooltipController.setShouldShow((target) => !target.opened);
241
257
 
258
+ this._positionTarget = this.shadowRoot.querySelector('[part="input-field"]');
259
+
242
260
  const toggleButton = this.shadowRoot.querySelector('[part="toggle-button"]');
243
261
  toggleButton.addEventListener('mousedown', (e) => e.preventDefault());
262
+ }
244
263
 
245
- this.$.overlay.addEventListener('vaadin-overlay-close', this._onVaadinOverlayClose.bind(this));
264
+ /** @private */
265
+ _onOpenedChanged(event) {
266
+ this.opened = event.detail.value;
246
267
  }
247
268
 
248
269
  /** @private */
@@ -262,15 +283,6 @@ class DatePicker extends DatePickerMixin(InputControlMixin(ThemableMixin(Element
262
283
  this.open();
263
284
  }
264
285
  }
265
-
266
- // Workaround https://github.com/vaadin/web-components/issues/2855
267
- /** @protected */
268
- _openedChanged(opened) {
269
- super._openedChanged(opened);
270
-
271
- this.$.overlay.positionTarget = this.shadowRoot.querySelector('[part="input-field"]');
272
- this.$.overlay.noVerticalOverlap = true;
273
- }
274
286
  }
275
287
 
276
288
  defineCustomElement(DatePicker);
@@ -3,7 +3,6 @@
3
3
  * Copyright (c) 2016 - 2025 Vaadin Ltd.
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
- import { flush } from '@polymer/polymer/lib/utils/flush.js';
7
6
  import { timeOut } from '@vaadin/component-base/src/async.js';
8
7
  import { Debouncer } from '@vaadin/component-base/src/debounce.js';
9
8
  import { generateUniqueId } from '@vaadin/component-base/src/unique-id-utils.js';
@@ -41,16 +40,6 @@ template.innerHTML = `
41
40
  box-sizing: border-box;
42
41
  padding-right: 40px;
43
42
  top: var(--vaadin-infinite-scroller-buffer-offset, 0);
44
- animation: fadein 0.2s;
45
- }
46
-
47
- @keyframes fadein {
48
- from {
49
- opacity: 0;
50
- }
51
- to {
52
- opacity: 1;
53
- }
54
43
  }
55
44
  </style>
56
45
 
@@ -230,8 +219,6 @@ export class InfiniteScroller extends HTMLElement {
230
219
  this._updateClones();
231
220
  this._debouncerUpdateClones.cancel();
232
221
  }
233
-
234
- flush();
235
222
  }
236
223
 
237
224
  /**