@vaadin/date-picker 24.8.5 → 24.9.0-alpha1

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.8.5",
3
+ "version": "24.9.0-alpha1",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -36,20 +36,20 @@
36
36
  "dependencies": {
37
37
  "@open-wc/dedupe-mixin": "^1.3.0",
38
38
  "@polymer/polymer": "^3.2.0",
39
- "@vaadin/a11y-base": "~24.8.5",
40
- "@vaadin/button": "~24.8.5",
41
- "@vaadin/component-base": "~24.8.5",
42
- "@vaadin/field-base": "~24.8.5",
43
- "@vaadin/input-container": "~24.8.5",
44
- "@vaadin/overlay": "~24.8.5",
45
- "@vaadin/vaadin-lumo-styles": "~24.8.5",
46
- "@vaadin/vaadin-material-styles": "~24.8.5",
47
- "@vaadin/vaadin-themable-mixin": "~24.8.5",
39
+ "@vaadin/a11y-base": "24.9.0-alpha1",
40
+ "@vaadin/button": "24.9.0-alpha1",
41
+ "@vaadin/component-base": "24.9.0-alpha1",
42
+ "@vaadin/field-base": "24.9.0-alpha1",
43
+ "@vaadin/input-container": "24.9.0-alpha1",
44
+ "@vaadin/overlay": "24.9.0-alpha1",
45
+ "@vaadin/vaadin-lumo-styles": "24.9.0-alpha1",
46
+ "@vaadin/vaadin-material-styles": "24.9.0-alpha1",
47
+ "@vaadin/vaadin-themable-mixin": "24.9.0-alpha1",
48
48
  "lit": "^3.0.0"
49
49
  },
50
50
  "devDependencies": {
51
- "@vaadin/chai-plugins": "~24.8.5",
52
- "@vaadin/test-runner-commands": "~24.8.5",
51
+ "@vaadin/chai-plugins": "24.9.0-alpha1",
52
+ "@vaadin/test-runner-commands": "24.9.0-alpha1",
53
53
  "@vaadin/testing-helpers": "^1.1.0",
54
54
  "sinon": "^18.0.0"
55
55
  },
@@ -57,5 +57,5 @@
57
57
  "web-types.json",
58
58
  "web-types.lit.json"
59
59
  ],
60
- "gitHead": "a519b0d2b1d09d1ddaa4ff6829819f8a2be30ad8"
60
+ "gitHead": "cc13d59f0e3cd1a3b0c19c1a900a5308446fe7ac"
61
61
  }
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.8.5",
4
+ "version": "24.9.0-alpha1",
5
5
  "description-markup": "markdown",
6
6
  "contributions": {
7
7
  "html": {
@@ -375,7 +375,7 @@
375
375
  },
376
376
  {
377
377
  "name": "vaadin-date-picker",
378
- "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.8.5/#/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.8.5/#/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.8.5/#/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.8.5/#/elements/vaadin-input-container) - an internal element wrapping the input.\n\nIn order to style the overlay content, use `<vaadin-date-picker-overlay-content>` shadow DOM parts:\n\nPart name | Description\n----------------------|--------------------\n`overlay-header` | Fullscreen mode header\n`label` | Fullscreen mode value/label\n`clear-button` | Fullscreen mode clear button\n`toggle-button` | Fullscreen mode toggle button\n`years-toggle-button` | Fullscreen mode years scroller toggle\n`toolbar` | Footer bar with slotted buttons\n\nThe following state attributes are available on the `<vaadin-date-picker-overlay-content>` element:\n\nAttribute | Description\n----------------|-------------------------------------------------\n`desktop` | Set when the overlay content is in desktop mode\n`fullscreen` | Set when the overlay content is in fullscreen mode\n`years-visible` | Set when the year scroller is visible in fullscreen mode\n\nIn order to style the month calendar, use `<vaadin-month-calendar>` shadow DOM parts:\n\nPart name | Description\n----------------------|--------------------\n`month-header` | Month title\n`weekdays` | Weekday container\n`weekday` | Weekday element\n`week-numbers` | Week numbers container\n`week-number` | Week number element\n`date` | Date element\n`disabled` | Disabled date element\n`focused` | Focused date element\n`selected` | Selected date element\n`today` | Date element corresponding to the current day\n`past` | Date element corresponding to the date in the past\n`future` | Date element corresponding to the date in the future\n\nIn order to style year scroller elements, use `<vaadin-date-picker-year>` shadow DOM parts:\n\nPart name | Description\n----------------------|--------------------\n`year-number` | Year number\n`year-separator` | Year separator\n\nNote: the `theme` attribute value set on `<vaadin-date-picker>` is\npropagated to the internal components listed above.\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.\n\n### Change events\n\nDepending on the nature of the value change that the user attempts to commit e.g. by pressing Enter,\nthe component can fire either a `change` event or an `unparsable-change` event:\n\nValue change | Event\n:------------------------|:------------------\nempty => parsable | change\nempty => unparsable | unparsable-change\nparsable => empty | change\nparsable => parsable | change\nparsable => unparsable | change\nunparsable => empty | unparsable-change\nunparsable => parsable | change\nunparsable => unparsable | unparsable-change",
378
+ "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.9.0-alpha1/#/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.9.0-alpha1/#/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.9.0-alpha1/#/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.9.0-alpha1/#/elements/vaadin-input-container) - an internal element wrapping the input.\n\nIn order to style the overlay content, use `<vaadin-date-picker-overlay-content>` shadow DOM parts:\n\nPart name | Description\n----------------------|--------------------\n`overlay-header` | Fullscreen mode header\n`label` | Fullscreen mode value/label\n`clear-button` | Fullscreen mode clear button\n`toggle-button` | Fullscreen mode toggle button\n`years-toggle-button` | Fullscreen mode years scroller toggle\n`toolbar` | Footer bar with slotted buttons\n\nThe following state attributes are available on the `<vaadin-date-picker-overlay-content>` element:\n\nAttribute | Description\n----------------|-------------------------------------------------\n`desktop` | Set when the overlay content is in desktop mode\n`fullscreen` | Set when the overlay content is in fullscreen mode\n`years-visible` | Set when the year scroller is visible in fullscreen mode\n\nIn order to style the month calendar, use `<vaadin-month-calendar>` shadow DOM parts:\n\nPart name | Description\n----------------------|--------------------\n`month-header` | Month title\n`weekdays` | Weekday container\n`weekday` | Weekday element\n`week-numbers` | Week numbers container\n`week-number` | Week number element\n`date` | Date element\n`disabled` | Disabled date element\n`focused` | Focused date element\n`selected` | Selected date element\n`today` | Date element corresponding to the current day\n`past` | Date element corresponding to the date in the past\n`future` | Date element corresponding to the date in the future\n\nIn order to style year scroller elements, use `<vaadin-date-picker-year>` shadow DOM parts:\n\nPart name | Description\n----------------------|--------------------\n`year-number` | Year number\n`year-separator` | Year separator\n\nNote: the `theme` attribute value set on `<vaadin-date-picker>` is\npropagated to the internal components listed above.\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.\n\n### Change events\n\nDepending on the nature of the value change that the user attempts to commit e.g. by pressing Enter,\nthe component can fire either a `change` event or an `unparsable-change` event:\n\nValue change | Event\n:------------------------|:------------------\nempty => parsable | change\nempty => unparsable | unparsable-change\nparsable => empty | change\nparsable => parsable | change\nparsable => unparsable | change\nunparsable => empty | unparsable-change\nunparsable => parsable | change\nunparsable => unparsable | unparsable-change",
379
379
  "attributes": [
380
380
  {
381
381
  "name": "disabled",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/web-types",
3
3
  "name": "@vaadin/date-picker",
4
- "version": "24.8.5",
4
+ "version": "24.9.0-alpha1",
5
5
  "description-markup": "markdown",
6
6
  "framework": "lit",
7
7
  "framework-config": {
@@ -170,7 +170,7 @@
170
170
  },
171
171
  {
172
172
  "name": "vaadin-date-picker",
173
- "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.8.5/#/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.8.5/#/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.8.5/#/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.8.5/#/elements/vaadin-input-container) - an internal element wrapping the input.\n\nIn order to style the overlay content, use `<vaadin-date-picker-overlay-content>` shadow DOM parts:\n\nPart name | Description\n----------------------|--------------------\n`overlay-header` | Fullscreen mode header\n`label` | Fullscreen mode value/label\n`clear-button` | Fullscreen mode clear button\n`toggle-button` | Fullscreen mode toggle button\n`years-toggle-button` | Fullscreen mode years scroller toggle\n`toolbar` | Footer bar with slotted buttons\n\nThe following state attributes are available on the `<vaadin-date-picker-overlay-content>` element:\n\nAttribute | Description\n----------------|-------------------------------------------------\n`desktop` | Set when the overlay content is in desktop mode\n`fullscreen` | Set when the overlay content is in fullscreen mode\n`years-visible` | Set when the year scroller is visible in fullscreen mode\n\nIn order to style the month calendar, use `<vaadin-month-calendar>` shadow DOM parts:\n\nPart name | Description\n----------------------|--------------------\n`month-header` | Month title\n`weekdays` | Weekday container\n`weekday` | Weekday element\n`week-numbers` | Week numbers container\n`week-number` | Week number element\n`date` | Date element\n`disabled` | Disabled date element\n`focused` | Focused date element\n`selected` | Selected date element\n`today` | Date element corresponding to the current day\n`past` | Date element corresponding to the date in the past\n`future` | Date element corresponding to the date in the future\n\nIn order to style year scroller elements, use `<vaadin-date-picker-year>` shadow DOM parts:\n\nPart name | Description\n----------------------|--------------------\n`year-number` | Year number\n`year-separator` | Year separator\n\nNote: the `theme` attribute value set on `<vaadin-date-picker>` is\npropagated to the internal components listed above.\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.\n\n### Change events\n\nDepending on the nature of the value change that the user attempts to commit e.g. by pressing Enter,\nthe component can fire either a `change` event or an `unparsable-change` event:\n\nValue change | Event\n:------------------------|:------------------\nempty => parsable | change\nempty => unparsable | unparsable-change\nparsable => empty | change\nparsable => parsable | change\nparsable => unparsable | change\nunparsable => empty | unparsable-change\nunparsable => parsable | change\nunparsable => unparsable | unparsable-change",
173
+ "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.9.0-alpha1/#/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.9.0-alpha1/#/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.9.0-alpha1/#/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.9.0-alpha1/#/elements/vaadin-input-container) - an internal element wrapping the input.\n\nIn order to style the overlay content, use `<vaadin-date-picker-overlay-content>` shadow DOM parts:\n\nPart name | Description\n----------------------|--------------------\n`overlay-header` | Fullscreen mode header\n`label` | Fullscreen mode value/label\n`clear-button` | Fullscreen mode clear button\n`toggle-button` | Fullscreen mode toggle button\n`years-toggle-button` | Fullscreen mode years scroller toggle\n`toolbar` | Footer bar with slotted buttons\n\nThe following state attributes are available on the `<vaadin-date-picker-overlay-content>` element:\n\nAttribute | Description\n----------------|-------------------------------------------------\n`desktop` | Set when the overlay content is in desktop mode\n`fullscreen` | Set when the overlay content is in fullscreen mode\n`years-visible` | Set when the year scroller is visible in fullscreen mode\n\nIn order to style the month calendar, use `<vaadin-month-calendar>` shadow DOM parts:\n\nPart name | Description\n----------------------|--------------------\n`month-header` | Month title\n`weekdays` | Weekday container\n`weekday` | Weekday element\n`week-numbers` | Week numbers container\n`week-number` | Week number element\n`date` | Date element\n`disabled` | Disabled date element\n`focused` | Focused date element\n`selected` | Selected date element\n`today` | Date element corresponding to the current day\n`past` | Date element corresponding to the date in the past\n`future` | Date element corresponding to the date in the future\n\nIn order to style year scroller elements, use `<vaadin-date-picker-year>` shadow DOM parts:\n\nPart name | Description\n----------------------|--------------------\n`year-number` | Year number\n`year-separator` | Year separator\n\nNote: the `theme` attribute value set on `<vaadin-date-picker>` is\npropagated to the internal components listed above.\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.\n\n### Change events\n\nDepending on the nature of the value change that the user attempts to commit e.g. by pressing Enter,\nthe component can fire either a `change` event or an `unparsable-change` event:\n\nValue change | Event\n:------------------------|:------------------\nempty => parsable | change\nempty => unparsable | unparsable-change\nparsable => empty | change\nparsable => parsable | change\nparsable => unparsable | change\nunparsable => empty | unparsable-change\nunparsable => parsable | change\nunparsable => unparsable | unparsable-change",
174
174
  "extension": true,
175
175
  "attributes": [
176
176
  {
@@ -1,70 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright (c) 2016 - 2025 Vaadin Ltd.
4
- * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
- */
6
- import '@vaadin/button/src/vaadin-lit-button.js';
7
- import './vaadin-date-picker-month-scroller.js';
8
- import './vaadin-date-picker-year-scroller.js';
9
- import './vaadin-lit-date-picker-year.js';
10
- import './vaadin-lit-month-calendar.js';
11
- import { html, LitElement } from 'lit';
12
- import { defineCustomElement } from '@vaadin/component-base/src/define.js';
13
- import { DirMixin } from '@vaadin/component-base/src/dir-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
- import { DatePickerOverlayContentMixin } from './vaadin-date-picker-overlay-content-mixin.js';
17
- import { overlayContentStyles } from './vaadin-date-picker-overlay-content-styles.js';
18
-
19
- /**
20
- * @extends HTMLElement
21
- * @private
22
- */
23
- class DatePickerOverlayContent extends DatePickerOverlayContentMixin(
24
- ThemableMixin(DirMixin(PolylitMixin(LitElement))),
25
- ) {
26
- static get is() {
27
- return 'vaadin-date-picker-overlay-content';
28
- }
29
-
30
- static get styles() {
31
- return overlayContentStyles;
32
- }
33
-
34
- /** @protected */
35
- render() {
36
- return html`
37
- <div part="overlay-header" @touchend="${this._preventDefault}" aria-hidden="true">
38
- <div part="label">${this._formatDisplayed(this.selectedDate, this.i18n, this.label)}</div>
39
- <div part="clear-button" ?hidden="${!this.selectedDate}"></div>
40
- <div part="toggle-button"></div>
41
-
42
- <div part="years-toggle-button" ?hidden="${this._desktopMode}" aria-hidden="true">
43
- ${this._yearAfterXMonths(this._visibleMonthIndex)}
44
- </div>
45
- </div>
46
-
47
- <div id="scrollers">
48
- <slot name="months"></slot>
49
- <slot name="years"></slot>
50
- </div>
51
-
52
- <div @touchend="${this._preventDefault}" role="toolbar" part="toolbar">
53
- <slot name="today-button"></slot>
54
- <slot name="cancel-button"></slot>
55
- </div>
56
- `;
57
- }
58
-
59
- /** @protected */
60
- firstUpdated() {
61
- super.firstUpdated();
62
-
63
- this.setAttribute('role', 'dialog');
64
-
65
- this._addListeners();
66
- this._initControllers();
67
- }
68
- }
69
-
70
- defineCustomElement(DatePickerOverlayContent);
@@ -1,46 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright (c) 2016 - 2025 Vaadin Ltd.
4
- * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
- */
6
- import { html, LitElement } from 'lit';
7
- import { defineCustomElement } from '@vaadin/component-base/src/define.js';
8
- import { DirMixin } from '@vaadin/component-base/src/dir-mixin.js';
9
- import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
10
- import { overlayStyles } from '@vaadin/overlay/src/vaadin-overlay-styles.js';
11
- import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
12
- import { DatePickerOverlayMixin } from './vaadin-date-picker-overlay-mixin.js';
13
- import { datePickerOverlayStyles } from './vaadin-date-picker-overlay-styles.js';
14
-
15
- /**
16
- * An element used internally by `<vaadin-date-picker>`. Not intended to be used separately.
17
- *
18
- * @extends HTMLElement
19
- * @mixes DatePickerOverlayMixin
20
- * @mixes DirMixin
21
- * @mixes ThemableMixin
22
- * @private
23
- */
24
- class DatePickerOverlay extends DatePickerOverlayMixin(DirMixin(ThemableMixin(PolylitMixin(LitElement)))) {
25
- static get is() {
26
- return 'vaadin-date-picker-overlay';
27
- }
28
-
29
- static get styles() {
30
- return [overlayStyles, datePickerOverlayStyles];
31
- }
32
-
33
- /** @protected */
34
- render() {
35
- return html`
36
- <div id="backdrop" part="backdrop" ?hidden="${!this.withBackdrop}"></div>
37
- <div part="overlay" id="overlay">
38
- <div part="content" id="content">
39
- <slot></slot>
40
- </div>
41
- </div>
42
- `;
43
- }
44
- }
45
-
46
- defineCustomElement(DatePickerOverlay);
@@ -1,41 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright (c) 2016 - 2025 Vaadin Ltd.
4
- * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
- */
6
- import { css, html, LitElement } from 'lit';
7
- import { defineCustomElement } from '@vaadin/component-base/src/define.js';
8
- import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
9
- import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
10
- import { DatePickerYearMixin } from './vaadin-date-picker-year-mixin.js';
11
-
12
- /**
13
- * @extends HTMLElement
14
- * @mixes ThemableMixin
15
- * @mixes DatePickerYearMixin
16
- * @private
17
- */
18
- export class DatePickerYear extends ThemableMixin(DatePickerYearMixin(PolylitMixin(LitElement))) {
19
- static get is() {
20
- return 'vaadin-date-picker-year';
21
- }
22
-
23
- static get styles() {
24
- return css`
25
- :host {
26
- display: block;
27
- height: 100%;
28
- }
29
- `;
30
- }
31
-
32
- /** @protected */
33
- render() {
34
- return html`
35
- <div part="year-number">${this.year}</div>
36
- <div part="year-separator" aria-hidden="true"></div>
37
- `;
38
- }
39
- }
40
-
41
- defineCustomElement(DatePickerYear);
@@ -1,172 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright (c) 2016 - 2025 Vaadin Ltd.
4
- * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
- */
6
- import '@vaadin/input-container/src/vaadin-lit-input-container.js';
7
- import './vaadin-lit-date-picker-overlay.js';
8
- import './vaadin-lit-date-picker-overlay-content.js';
9
- import { html, LitElement } from 'lit';
10
- import { ifDefined } from 'lit/directives/if-defined.js';
11
- import { defineCustomElement } from '@vaadin/component-base/src/define.js';
12
- import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
13
- import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
14
- import { TooltipController } from '@vaadin/component-base/src/tooltip-controller.js';
15
- import { InputControlMixin } from '@vaadin/field-base/src/input-control-mixin.js';
16
- import { InputController } from '@vaadin/field-base/src/input-controller.js';
17
- import { LabelledInputController } from '@vaadin/field-base/src/labelled-input-controller.js';
18
- import { inputFieldShared } from '@vaadin/field-base/src/styles/input-field-shared-styles.js';
19
- import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
20
- import { DatePickerMixin } from './vaadin-date-picker-mixin.js';
21
- import { datePickerStyles } from './vaadin-date-picker-styles.js';
22
-
23
- /**
24
- * LitElement based version of `<vaadin-date-picker>` web component.
25
- *
26
- * ## Disclaimer
27
- *
28
- * This component is an experiment and not yet a part of Vaadin platform.
29
- * There is no ETA regarding specific Vaadin version where it'll land.
30
- * Feel free to try this code in your apps as per Apache 2.0 license.
31
- */
32
- class DatePicker extends DatePickerMixin(InputControlMixin(ThemableMixin(ElementMixin(PolylitMixin(LitElement))))) {
33
- static get is() {
34
- return 'vaadin-date-picker';
35
- }
36
-
37
- static get styles() {
38
- return [inputFieldShared, datePickerStyles];
39
- }
40
-
41
- static get properties() {
42
- return {
43
- /** @private */
44
- _positionTarget: {
45
- type: Object,
46
- sync: true,
47
- },
48
- };
49
- }
50
-
51
- /**
52
- * Used by `InputControlMixin` as a reference to the clear button element.
53
- * @protected
54
- * @return {!HTMLElement}
55
- */
56
- get clearElement() {
57
- return this.$.clearButton;
58
- }
59
-
60
- /** @protected */
61
- render() {
62
- return html`
63
- <div class="vaadin-date-picker-container">
64
- <div part="label">
65
- <slot name="label"></slot>
66
- <span part="required-indicator" aria-hidden="true" @click="${this.focus}"></span>
67
- </div>
68
-
69
- <vaadin-input-container
70
- part="input-field"
71
- .readonly="${this.readonly}"
72
- .disabled="${this.disabled}"
73
- .invalid="${this.invalid}"
74
- theme="${ifDefined(this._theme)}"
75
- >
76
- <slot name="prefix" slot="prefix"></slot>
77
- <slot name="input"></slot>
78
- <div id="clearButton" part="clear-button" slot="suffix" aria-hidden="true"></div>
79
- <div part="toggle-button" slot="suffix" aria-hidden="true" @click="${this._toggle}"></div>
80
- </vaadin-input-container>
81
-
82
- <div part="helper-text">
83
- <slot name="helper"></slot>
84
- </div>
85
-
86
- <div part="error-message">
87
- <slot name="error-message"></slot>
88
- </div>
89
- </div>
90
-
91
- <vaadin-date-picker-overlay
92
- id="overlay"
93
- ?fullscreen="${this._fullscreen}"
94
- theme="${ifDefined(this._theme)}"
95
- .opened="${this.opened}"
96
- @opened-changed="${this._onOpenedChanged}"
97
- @vaadin-overlay-escape-press="${this._onOverlayEscapePress}"
98
- @vaadin-overlay-open="${this._onOverlayOpened}"
99
- @vaadin-overlay-close="${this._onVaadinOverlayClose}"
100
- @vaadin-overlay-closing="${this._onOverlayClosed}"
101
- restore-focus-on-close
102
- no-vertical-overlap
103
- .restoreFocusNode="${this.inputElement}"
104
- .positionTarget="${this._positionTarget}"
105
- ></vaadin-date-picker-overlay>
106
-
107
- <slot name="tooltip"></slot>
108
- `;
109
- }
110
-
111
- /** @protected */
112
- ready() {
113
- super.ready();
114
-
115
- this.addController(
116
- new InputController(
117
- this,
118
- (input) => {
119
- this._setInputElement(input);
120
- this._setFocusElement(input);
121
- this.stateTarget = input;
122
- this.ariaTarget = input;
123
- },
124
- {
125
- // The "search" word is a trick to prevent Safari from enabling AutoFill,
126
- // which is causing click issues:
127
- // https://github.com/vaadin/web-components/issues/6817#issuecomment-2268229567
128
- uniqueIdPrefix: 'search-input',
129
- },
130
- ),
131
- );
132
- this.addController(new LabelledInputController(this.inputElement, this._labelController));
133
-
134
- this._tooltipController = new TooltipController(this);
135
- this.addController(this._tooltipController);
136
- this._tooltipController.setPosition('top');
137
- this._tooltipController.setAriaTarget(this.inputElement);
138
- this._tooltipController.setShouldShow((target) => !target.opened);
139
-
140
- this._positionTarget = this.shadowRoot.querySelector('[part="input-field"]');
141
-
142
- const toggleButton = this.shadowRoot.querySelector('[part="toggle-button"]');
143
- toggleButton.addEventListener('mousedown', (e) => e.preventDefault());
144
- }
145
-
146
- /** @private */
147
- _onOpenedChanged(event) {
148
- this.opened = event.detail.value;
149
- }
150
-
151
- /** @private */
152
- _onVaadinOverlayClose(e) {
153
- // Prevent closing the overlay on label element click
154
- if (e.detail.sourceEvent && e.detail.sourceEvent.composedPath().includes(this)) {
155
- e.preventDefault();
156
- }
157
- }
158
-
159
- /** @private */
160
- _toggle(e) {
161
- e.stopPropagation();
162
- if (this.$.overlay.opened) {
163
- this.close();
164
- } else {
165
- this.open();
166
- }
167
- }
168
- }
169
-
170
- defineCustomElement(DatePicker);
171
-
172
- export { DatePicker };
@@ -1,98 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright (c) 2016 - 2025 Vaadin Ltd.
4
- * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
- */
6
- import { html, LitElement } from 'lit';
7
- import { defineCustomElement } from '@vaadin/component-base/src/define.js';
8
- import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
9
- import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
10
- import { MonthCalendarMixin } from './vaadin-month-calendar-mixin.js';
11
- import { monthCalendarStyles } from './vaadin-month-calendar-styles.js';
12
-
13
- /**
14
- * @extends HTMLElement
15
- * @private
16
- */
17
- class MonthCalendar extends MonthCalendarMixin(ThemableMixin(PolylitMixin(LitElement))) {
18
- static get is() {
19
- return 'vaadin-month-calendar';
20
- }
21
-
22
- static get styles() {
23
- return monthCalendarStyles;
24
- }
25
-
26
- /** @protected */
27
- render() {
28
- const weekDayNames = this.__computeWeekDayNames(this.i18n, this.showWeekNumbers);
29
- const weeks = this._weeks;
30
- const hideWeekSeparator = !this.__computeShowWeekSeparator(this.showWeekNumbers, this.i18n);
31
-
32
- return html`
33
- <div part="month-header" id="month-header" aria-hidden="true">${this._getTitle(this.month, this.i18n)}</div>
34
- <table
35
- id="monthGrid"
36
- role="grid"
37
- aria-labelledby="month-header"
38
- @touchend="${this._preventDefault}"
39
- @touchstart="${this._onMonthGridTouchStart}"
40
- >
41
- <thead id="weekdays-container">
42
- <tr role="row" part="weekdays">
43
- <th part="weekday" aria-hidden="true" ?hidden="${hideWeekSeparator}"></th>
44
- ${weekDayNames.map(
45
- (item) => html`
46
- <th role="columnheader" part="weekday" scope="col" abbr="${item.weekDay}" aria-hidden="true">
47
- ${item.weekDayShort}
48
- </th>
49
- `,
50
- )}
51
- </tr>
52
- </thead>
53
- <tbody id="days-container">
54
- ${weeks.map(
55
- (week) => html`
56
- <tr role="row">
57
- <td part="week-number" aria-hidden="true" ?hidden="${hideWeekSeparator}">
58
- ${this.__computeWeekNumber(week)}
59
- </td>
60
- ${week.map((date) => {
61
- return html`
62
- <td
63
- role="gridcell"
64
- part="${this.__computeDatePart(
65
- date,
66
- this.focusedDate,
67
- this.selectedDate,
68
- this.minDate,
69
- this.maxDate,
70
- this.isDateDisabled,
71
- this.enteredDate,
72
- this.__hasFocus,
73
- )}"
74
- .date="${date}"
75
- ?disabled="${this.__isDayDisabled(date, this.minDate, this.maxDate, this.isDateDisabled)}"
76
- tabindex="${this.__computeDayTabIndex(date, this.focusedDate)}"
77
- aria-selected="${this.__computeDayAriaSelected(date, this.selectedDate)}"
78
- aria-disabled="${this.__computeDayAriaDisabled(
79
- date,
80
- this.minDate,
81
- this.maxDate,
82
- this.isDateDisabled,
83
- )}"
84
- aria-label="${this.__computeDayAriaLabel(date)}"
85
- >${this._getDate(date)}</td
86
- >
87
- `;
88
- })}
89
- </tr>
90
- `,
91
- )}
92
- </tbody>
93
- </table>
94
- `;
95
- }
96
- }
97
-
98
- defineCustomElement(MonthCalendar);
@@ -1,5 +0,0 @@
1
- import './vaadin-date-picker-overlay-styles.js';
2
- import './vaadin-date-picker-overlay-content-styles.js';
3
- import './vaadin-month-calendar-styles.js';
4
- import './vaadin-date-picker-styles.js';
5
- import '../../src/vaadin-lit-date-picker.js';
@@ -1,5 +0,0 @@
1
- import './vaadin-date-picker-overlay-styles.js';
2
- import './vaadin-date-picker-overlay-content-styles.js';
3
- import './vaadin-month-calendar-styles.js';
4
- import './vaadin-date-picker-styles.js';
5
- import '../../src/vaadin-lit-date-picker.js';
@@ -1,5 +0,0 @@
1
- import './vaadin-date-picker-overlay-styles.js';
2
- import './vaadin-date-picker-overlay-content-styles.js';
3
- import './vaadin-month-calendar-styles.js';
4
- import './vaadin-date-picker-styles.js';
5
- import '../../src/vaadin-lit-date-picker.js';
@@ -1,5 +0,0 @@
1
- import './vaadin-date-picker-overlay-styles.js';
2
- import './vaadin-date-picker-overlay-content-styles.js';
3
- import './vaadin-month-calendar-styles.js';
4
- import './vaadin-date-picker-styles.js';
5
- import '../../src/vaadin-lit-date-picker.js';
@@ -1 +0,0 @@
1
- export * from './src/vaadin-date-picker.js';
@@ -1,2 +0,0 @@
1
- import './theme/lumo/vaadin-lit-date-picker.js';
2
- export * from './src/vaadin-lit-date-picker.js';