@vaadin/date-picker 25.0.0-alpha2 → 25.0.0-alpha20

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 (40) hide show
  1. package/package.json +13 -14
  2. package/src/styles/vaadin-date-picker-base-styles.d.ts +8 -0
  3. package/src/{vaadin-date-picker-styles.js → styles/vaadin-date-picker-base-styles.js} +9 -0
  4. package/src/styles/vaadin-date-picker-overlay-base-styles.js +48 -0
  5. package/src/styles/vaadin-date-picker-overlay-content-base-styles.js +108 -0
  6. package/src/styles/vaadin-date-picker-year-base-styles.js +27 -0
  7. package/src/styles/vaadin-month-calendar-base-styles.js +143 -0
  8. package/src/vaadin-date-picker-helper.d.ts +5 -0
  9. package/src/vaadin-date-picker-helper.js +1 -1
  10. package/src/vaadin-date-picker-mixin.d.ts +1 -3
  11. package/src/vaadin-date-picker-mixin.js +45 -23
  12. package/src/vaadin-date-picker-month-scroller.js +2 -6
  13. package/src/vaadin-date-picker-overlay-content-mixin.js +5 -132
  14. package/src/vaadin-date-picker-overlay-content.js +19 -17
  15. package/src/vaadin-date-picker-overlay.js +17 -3
  16. package/src/vaadin-date-picker-year-scroller.js +3 -4
  17. package/src/vaadin-date-picker-year.js +32 -10
  18. package/src/vaadin-date-picker.d.ts +33 -24
  19. package/src/vaadin-date-picker.js +45 -28
  20. package/src/vaadin-infinite-scroller.js +1 -19
  21. package/src/vaadin-month-calendar.js +3 -2
  22. package/vaadin-date-picker.js +1 -1
  23. package/web-types.json +3 -25
  24. package/web-types.lit.json +3 -10
  25. package/src/vaadin-date-picker-overlay-content-styles.js +0 -68
  26. package/src/vaadin-date-picker-overlay-styles.js +0 -23
  27. package/src/vaadin-date-picker-year-mixin.js +0 -35
  28. package/src/vaadin-month-calendar-styles.js +0 -64
  29. package/theme/lumo/vaadin-date-picker-overlay-content-styles.d.ts +0 -7
  30. package/theme/lumo/vaadin-date-picker-overlay-content-styles.js +0 -164
  31. package/theme/lumo/vaadin-date-picker-overlay-styles.d.ts +0 -2
  32. package/theme/lumo/vaadin-date-picker-overlay-styles.js +0 -55
  33. package/theme/lumo/vaadin-date-picker-styles.d.ts +0 -2
  34. package/theme/lumo/vaadin-date-picker-styles.js +0 -30
  35. package/theme/lumo/vaadin-date-picker-year-styles.d.ts +0 -1
  36. package/theme/lumo/vaadin-date-picker-year-styles.js +0 -32
  37. package/theme/lumo/vaadin-date-picker.d.ts +0 -5
  38. package/theme/lumo/vaadin-date-picker.js +0 -5
  39. package/theme/lumo/vaadin-month-calendar-styles.d.ts +0 -5
  40. package/theme/lumo/vaadin-month-calendar-styles.js +0 -158
@@ -21,13 +21,8 @@ template.innerHTML = `
21
21
  height: 100%;
22
22
  overflow: auto;
23
23
  outline: none;
24
- margin-right: -40px;
25
- -webkit-overflow-scrolling: touch;
26
24
  overflow-x: hidden;
27
- }
28
-
29
- #scroller.notouchscroll {
30
- -webkit-overflow-scrolling: auto;
25
+ scrollbar-width: none;
31
26
  }
32
27
 
33
28
  #scroller::-webkit-scrollbar {
@@ -38,7 +33,6 @@ template.innerHTML = `
38
33
  position: absolute;
39
34
  width: var(--vaadin-infinite-scroller-buffer-width, 100%);
40
35
  box-sizing: border-box;
41
- padding-right: 40px;
42
36
  top: var(--vaadin-infinite-scroller-buffer-offset, 0);
43
37
  }
44
38
  </style>
@@ -158,17 +152,6 @@ export class InfiniteScroller extends HTMLElement {
158
152
  this.$.scroller.scrollTop += (index % 1) * this.itemHeight;
159
153
  this._scrollDisabled = false;
160
154
  }
161
-
162
- if (this._mayHaveMomentum) {
163
- // Stop the possible iOS Safari momentum with -webkit-overflow-scrolling: auto;
164
- this.$.scroller.classList.add('notouchscroll');
165
- this._mayHaveMomentum = false;
166
-
167
- setTimeout(() => {
168
- // Restore -webkit-overflow-scrolling: touch; after a small delay.
169
- this.$.scroller.classList.remove('notouchscroll');
170
- }, 10);
171
- }
172
155
  }
173
156
 
174
157
  /** @protected */
@@ -292,7 +275,6 @@ export class InfiniteScroller extends HTMLElement {
292
275
 
293
276
  if (!this._preventScrollEvent) {
294
277
  this.dispatchEvent(new CustomEvent('custom-scroll', { bubbles: false, composed: true }));
295
- this._mayHaveMomentum = true;
296
278
  }
297
279
  this._preventScrollEvent = false;
298
280
 
@@ -6,16 +6,17 @@
6
6
  import { html, LitElement } from 'lit';
7
7
  import { defineCustomElement } from '@vaadin/component-base/src/define.js';
8
8
  import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
9
+ import { LumoInjectionMixin } from '@vaadin/vaadin-themable-mixin/lumo-injection-mixin.js';
9
10
  import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
11
+ import { monthCalendarStyles } from './styles/vaadin-month-calendar-base-styles.js';
10
12
  import { MonthCalendarMixin } from './vaadin-month-calendar-mixin.js';
11
- import { monthCalendarStyles } from './vaadin-month-calendar-styles.js';
12
13
 
13
14
  /**
14
15
  * @customElement
15
16
  * @extends HTMLElement
16
17
  * @private
17
18
  */
18
- class MonthCalendar extends MonthCalendarMixin(ThemableMixin(PolylitMixin(LitElement))) {
19
+ class MonthCalendar extends MonthCalendarMixin(ThemableMixin(PolylitMixin(LumoInjectionMixin(LitElement)))) {
19
20
  static get is() {
20
21
  return 'vaadin-month-calendar';
21
22
  }
@@ -1,2 +1,2 @@
1
- import './theme/lumo/vaadin-date-picker.js';
1
+ import './src/vaadin-date-picker.js';
2
2
  export * from './src/vaadin-date-picker.js';
package/web-types.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/web-types",
3
3
  "name": "@vaadin/date-picker",
4
- "version": "25.0.0-alpha2",
4
+ "version": "25.0.0-alpha20",
5
5
  "description-markup": "markdown",
6
6
  "contributions": {
7
7
  "html": {
8
8
  "elements": [
9
9
  {
10
10
  "name": "vaadin-date-picker",
11
- "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/25.0.0-alpha2/#/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\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/25.0.0-alpha2/#/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/25.0.0-alpha2/#/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",
11
+ "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\nThe following shadow DOM parts are available for styling:\n\nPart name | Description\n---------------------|----------------\n`label` | The label element\n`input-field` | The element that wraps prefix, value and buttons\n`field-button` | Set on both clear and toggle buttons\n`clear-button` | The clear button\n`error-message` | The error message element\n`helper-text` | The helper text element wrapper\n`required-indicator` | The `required` state indicator element\n`toggle-button` | The toggle button\n`backdrop` | Backdrop of the overlay\n`overlay` | The overlay container\n`content` | The overlay content\n\nThe following state attributes are available for styling:\n\nAttribute | Description\n---------------------|---------------------------------\n`disabled` | Set when the element is disabled\n`has-value` | Set when the element has a value\n`has-label` | Set when the element has a label\n`has-helper` | Set when the element has helper text or slot\n`has-error-message` | Set when the element has an error message\n`has-tooltip` | Set when the element has a slotted tooltip\n`invalid` | Set when the element is invalid\n`focused` | Set when the element is focused\n`focus-ring` | Set when the element is keyboard focused\n`readonly` | Set when the element is readonly\n`opened` | Set when the overlay is opened\n`week-numbers` | Set when week numbers are shown in the calendar\n\n### Internal components\n\nIn addition to `<vaadin-date-picker>` itself, the following internal\ncomponents are themable:\n\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\nIn order to style the overlay content, use `<vaadin-date-picker-overlay-content>` shadow DOM parts:\n\nPart name | Description\n----------------------|--------------------\n`years-toggle-button` | Fullscreen mode years scroller toggle\n`toolbar` | Toolbar 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\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",
12
12
  "attributes": [
13
13
  {
14
14
  "name": "disabled",
@@ -215,17 +215,6 @@
215
215
  ]
216
216
  }
217
217
  },
218
- {
219
- "name": "overlay-class",
220
- "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.",
221
- "value": {
222
- "type": [
223
- "string",
224
- "null",
225
- "undefined"
226
- ]
227
- }
228
- },
229
218
  {
230
219
  "name": "initial-position",
231
220
  "description": "Date which should be visible when there is no value selected.\n\nThe same date formats as for the `value` property are supported.",
@@ -502,24 +491,13 @@
502
491
  },
503
492
  {
504
493
  "name": "i18n",
505
- "description": "The object used to localize this component. To change the default\nlocalization, replace this with an object that provides all properties, or\njust the individual properties you want to change.\n\nThe object has the following JSON structure and default values:\n\n```\n{\n // An array with the full names of months starting\n // with January.\n monthNames: [\n 'January', 'February', 'March', 'April', 'May',\n 'June', 'July', 'August', 'September',\n 'October', 'November', 'December'\n ],\n\n // An array of weekday names starting with Sunday. Used\n // in screen reader announcements.\n weekdays: [\n 'Sunday', 'Monday', 'Tuesday', 'Wednesday',\n 'Thursday', 'Friday', 'Saturday'\n ],\n\n // An array of short weekday names starting with Sunday.\n // Displayed in the calendar.\n weekdaysShort: [\n 'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'\n ],\n\n // An integer indicating the first day of the week\n // (0 = Sunday, 1 = Monday, etc.).\n firstDayOfWeek: 0,\n\n // Translation of the Today shortcut button text.\n today: 'Today',\n\n // Translation of the Cancel button text.\n cancel: 'Cancel',\n\n // Used for adjusting the year value when parsing dates with short years.\n // The year values between 0 and 99 are evaluated and adjusted.\n // Example: for a referenceDate of 1970-10-30;\n // dateToBeParsed: 40-10-30, result: 1940-10-30\n // dateToBeParsed: 80-10-30, result: 1980-10-30\n // dateToBeParsed: 10-10-30, result: 2010-10-30\n // Supported date format: ISO 8601 `\"YYYY-MM-DD\"` (default)\n // The default value is the current date.\n referenceDate: '',\n\n // A function to format given `Object` as\n // date string. Object is in the format `{ day: ..., month: ..., year: ... }`\n // Note: The argument month is 0-based. This means that January = 0 and December = 11.\n formatDate: d => {\n // returns a string representation of the given\n // object in 'MM/DD/YYYY' -format\n },\n\n // A function to parse the given text to an `Object` in the format `{ day: ..., month: ..., year: ... }`.\n // Must properly parse (at least) text formatted by `formatDate`.\n // Setting the property to null will disable keyboard input feature.\n // Note: The argument month is 0-based. This means that January = 0 and December = 11.\n parseDate: text => {\n // Parses a string in 'MM/DD/YY', 'MM/DD' or 'DD' -format to\n // an `Object` in the format `{ day: ..., month: ..., year: ... }`.\n }\n\n // A function to format given `monthName` and\n // `fullYear` integer as calendar title string.\n formatTitle: (monthName, fullYear) => {\n return monthName + ' ' + fullYear;\n }\n}\n```",
494
+ "description": "The object used to localize this component. To change the default\nlocalization, replace this with an object that provides all properties, or\njust the individual properties you want to change.\n\nThe object has the following JSON structure and default values:\n\n```js\n{\n // An array with the full names of months starting\n // with January.\n monthNames: [\n 'January', 'February', 'March', 'April', 'May',\n 'June', 'July', 'August', 'September',\n 'October', 'November', 'December'\n ],\n\n // An array of weekday names starting with Sunday. Used\n // in screen reader announcements.\n weekdays: [\n 'Sunday', 'Monday', 'Tuesday', 'Wednesday',\n 'Thursday', 'Friday', 'Saturday'\n ],\n\n // An array of short weekday names starting with Sunday.\n // Displayed in the calendar.\n weekdaysShort: [\n 'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'\n ],\n\n // An integer indicating the first day of the week\n // (0 = Sunday, 1 = Monday, etc.).\n firstDayOfWeek: 0,\n\n // Translation of the Today shortcut button text.\n today: 'Today',\n\n // Translation of the Cancel button text.\n cancel: 'Cancel',\n\n // Used for adjusting the year value when parsing dates with short years.\n // The year values between 0 and 99 are evaluated and adjusted.\n // Example: for a referenceDate of 1970-10-30;\n // dateToBeParsed: 40-10-30, result: 1940-10-30\n // dateToBeParsed: 80-10-30, result: 1980-10-30\n // dateToBeParsed: 10-10-30, result: 2010-10-30\n // Supported date format: ISO 8601 `\"YYYY-MM-DD\"` (default)\n // The default value is the current date.\n referenceDate: '',\n\n // A function to format given `Object` as\n // date string. Object is in the format `{ day: ..., month: ..., year: ... }`\n // Note: The argument month is 0-based. This means that January = 0 and December = 11.\n formatDate: d => {\n // returns a string representation of the given\n // object in 'MM/DD/YYYY' -format\n },\n\n // A function to parse the given text to an `Object` in the format `{ day: ..., month: ..., year: ... }`.\n // Must properly parse (at least) text formatted by `formatDate`.\n // Setting the property to null will disable keyboard input feature.\n // Note: The argument month is 0-based. This means that January = 0 and December = 11.\n parseDate: text => {\n // Parses a string in 'MM/DD/YY', 'MM/DD' or 'DD' -format to\n // an `Object` in the format `{ day: ..., month: ..., year: ... }`.\n }\n\n // A function to format given `monthName` and\n // `fullYear` integer as calendar title string.\n formatTitle: (monthName, fullYear) => {\n return monthName + ' ' + fullYear;\n }\n}\n```",
506
495
  "value": {
507
496
  "type": [
508
497
  "DatePickerI18n"
509
498
  ]
510
499
  }
511
500
  },
512
- {
513
- "name": "overlayClass",
514
- "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.",
515
- "value": {
516
- "type": [
517
- "string",
518
- "null",
519
- "undefined"
520
- ]
521
- }
522
- },
523
501
  {
524
502
  "name": "initialPosition",
525
503
  "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": "25.0.0-alpha2",
4
+ "version": "25.0.0-alpha20",
5
5
  "description-markup": "markdown",
6
6
  "framework": "lit",
7
7
  "framework-config": {
@@ -16,7 +16,7 @@
16
16
  "elements": [
17
17
  {
18
18
  "name": "vaadin-date-picker",
19
- "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/25.0.0-alpha2/#/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\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/25.0.0-alpha2/#/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/25.0.0-alpha2/#/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",
19
+ "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\nThe following shadow DOM parts are available for styling:\n\nPart name | Description\n---------------------|----------------\n`label` | The label element\n`input-field` | The element that wraps prefix, value and buttons\n`field-button` | Set on both clear and toggle buttons\n`clear-button` | The clear button\n`error-message` | The error message element\n`helper-text` | The helper text element wrapper\n`required-indicator` | The `required` state indicator element\n`toggle-button` | The toggle button\n`backdrop` | Backdrop of the overlay\n`overlay` | The overlay container\n`content` | The overlay content\n\nThe following state attributes are available for styling:\n\nAttribute | Description\n---------------------|---------------------------------\n`disabled` | Set when the element is disabled\n`has-value` | Set when the element has a value\n`has-label` | Set when the element has a label\n`has-helper` | Set when the element has helper text or slot\n`has-error-message` | Set when the element has an error message\n`has-tooltip` | Set when the element has a slotted tooltip\n`invalid` | Set when the element is invalid\n`focused` | Set when the element is focused\n`focus-ring` | Set when the element is keyboard focused\n`readonly` | Set when the element is readonly\n`opened` | Set when the overlay is opened\n`week-numbers` | Set when week numbers are shown in the calendar\n\n### Internal components\n\nIn addition to `<vaadin-date-picker>` itself, the following internal\ncomponents are themable:\n\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\nIn order to style the overlay content, use `<vaadin-date-picker-overlay-content>` shadow DOM parts:\n\nPart name | Description\n----------------------|--------------------\n`years-toggle-button` | Fullscreen mode years scroller toggle\n`toolbar` | Toolbar 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\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",
20
20
  "extension": true,
21
21
  "attributes": [
22
22
  {
@@ -175,14 +175,7 @@
175
175
  },
176
176
  {
177
177
  "name": ".i18n",
178
- "description": "The object used to localize this component. To change the default\nlocalization, replace this with an object that provides all properties, or\njust the individual properties you want to change.\n\nThe object has the following JSON structure and default values:\n\n```\n{\n // An array with the full names of months starting\n // with January.\n monthNames: [\n 'January', 'February', 'March', 'April', 'May',\n 'June', 'July', 'August', 'September',\n 'October', 'November', 'December'\n ],\n\n // An array of weekday names starting with Sunday. Used\n // in screen reader announcements.\n weekdays: [\n 'Sunday', 'Monday', 'Tuesday', 'Wednesday',\n 'Thursday', 'Friday', 'Saturday'\n ],\n\n // An array of short weekday names starting with Sunday.\n // Displayed in the calendar.\n weekdaysShort: [\n 'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'\n ],\n\n // An integer indicating the first day of the week\n // (0 = Sunday, 1 = Monday, etc.).\n firstDayOfWeek: 0,\n\n // Translation of the Today shortcut button text.\n today: 'Today',\n\n // Translation of the Cancel button text.\n cancel: 'Cancel',\n\n // Used for adjusting the year value when parsing dates with short years.\n // The year values between 0 and 99 are evaluated and adjusted.\n // Example: for a referenceDate of 1970-10-30;\n // dateToBeParsed: 40-10-30, result: 1940-10-30\n // dateToBeParsed: 80-10-30, result: 1980-10-30\n // dateToBeParsed: 10-10-30, result: 2010-10-30\n // Supported date format: ISO 8601 `\"YYYY-MM-DD\"` (default)\n // The default value is the current date.\n referenceDate: '',\n\n // A function to format given `Object` as\n // date string. Object is in the format `{ day: ..., month: ..., year: ... }`\n // Note: The argument month is 0-based. This means that January = 0 and December = 11.\n formatDate: d => {\n // returns a string representation of the given\n // object in 'MM/DD/YYYY' -format\n },\n\n // A function to parse the given text to an `Object` in the format `{ day: ..., month: ..., year: ... }`.\n // Must properly parse (at least) text formatted by `formatDate`.\n // Setting the property to null will disable keyboard input feature.\n // Note: The argument month is 0-based. This means that January = 0 and December = 11.\n parseDate: text => {\n // Parses a string in 'MM/DD/YY', 'MM/DD' or 'DD' -format to\n // an `Object` in the format `{ day: ..., month: ..., year: ... }`.\n }\n\n // A function to format given `monthName` and\n // `fullYear` integer as calendar title string.\n formatTitle: (monthName, fullYear) => {\n return monthName + ' ' + fullYear;\n }\n}\n```",
179
- "value": {
180
- "kind": "expression"
181
- }
182
- },
183
- {
184
- "name": ".overlayClass",
185
- "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.",
178
+ "description": "The object used to localize this component. To change the default\nlocalization, replace this with an object that provides all properties, or\njust the individual properties you want to change.\n\nThe object has the following JSON structure and default values:\n\n```js\n{\n // An array with the full names of months starting\n // with January.\n monthNames: [\n 'January', 'February', 'March', 'April', 'May',\n 'June', 'July', 'August', 'September',\n 'October', 'November', 'December'\n ],\n\n // An array of weekday names starting with Sunday. Used\n // in screen reader announcements.\n weekdays: [\n 'Sunday', 'Monday', 'Tuesday', 'Wednesday',\n 'Thursday', 'Friday', 'Saturday'\n ],\n\n // An array of short weekday names starting with Sunday.\n // Displayed in the calendar.\n weekdaysShort: [\n 'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'\n ],\n\n // An integer indicating the first day of the week\n // (0 = Sunday, 1 = Monday, etc.).\n firstDayOfWeek: 0,\n\n // Translation of the Today shortcut button text.\n today: 'Today',\n\n // Translation of the Cancel button text.\n cancel: 'Cancel',\n\n // Used for adjusting the year value when parsing dates with short years.\n // The year values between 0 and 99 are evaluated and adjusted.\n // Example: for a referenceDate of 1970-10-30;\n // dateToBeParsed: 40-10-30, result: 1940-10-30\n // dateToBeParsed: 80-10-30, result: 1980-10-30\n // dateToBeParsed: 10-10-30, result: 2010-10-30\n // Supported date format: ISO 8601 `\"YYYY-MM-DD\"` (default)\n // The default value is the current date.\n referenceDate: '',\n\n // A function to format given `Object` as\n // date string. Object is in the format `{ day: ..., month: ..., year: ... }`\n // Note: The argument month is 0-based. This means that January = 0 and December = 11.\n formatDate: d => {\n // returns a string representation of the given\n // object in 'MM/DD/YYYY' -format\n },\n\n // A function to parse the given text to an `Object` in the format `{ day: ..., month: ..., year: ... }`.\n // Must properly parse (at least) text formatted by `formatDate`.\n // Setting the property to null will disable keyboard input feature.\n // Note: The argument month is 0-based. This means that January = 0 and December = 11.\n parseDate: text => {\n // Parses a string in 'MM/DD/YY', 'MM/DD' or 'DD' -format to\n // an `Object` in the format `{ day: ..., month: ..., year: ... }`.\n }\n\n // A function to format given `monthName` and\n // `fullYear` integer as calendar title string.\n formatTitle: (monthName, fullYear) => {\n return monthName + ' ' + fullYear;\n }\n}\n```",
186
179
  "value": {
187
180
  "kind": "expression"
188
181
  }
@@ -1,68 +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 } from 'lit';
7
-
8
- export const overlayContentStyles = css`
9
- :host {
10
- display: flex;
11
- flex-direction: column;
12
- height: 100%;
13
- width: 100%;
14
- outline: none;
15
- }
16
-
17
- [part='overlay-header'] {
18
- display: flex;
19
- flex-shrink: 0;
20
- flex-wrap: nowrap;
21
- align-items: center;
22
- }
23
-
24
- :host(:not([fullscreen])) [part='overlay-header'] {
25
- display: none;
26
- }
27
-
28
- [part='label'] {
29
- flex-grow: 1;
30
- }
31
-
32
- [hidden] {
33
- display: none !important;
34
- }
35
-
36
- [part='years-toggle-button'] {
37
- display: flex;
38
- }
39
-
40
- #scrollers {
41
- display: flex;
42
- height: 100%;
43
- width: 100%;
44
- position: relative;
45
- overflow: hidden;
46
- }
47
-
48
- :host([desktop]) ::slotted([slot='months']) {
49
- right: 50px;
50
- transform: none !important;
51
- }
52
-
53
- :host([desktop]) ::slotted([slot='years']) {
54
- transform: none !important;
55
- }
56
-
57
- :host(.animate) ::slotted([slot='months']),
58
- :host(.animate) ::slotted([slot='years']) {
59
- transition: all 200ms;
60
- }
61
-
62
- [part='toolbar'] {
63
- display: flex;
64
- justify-content: space-between;
65
- z-index: 2;
66
- flex-shrink: 0;
67
- }
68
- `;
@@ -1,23 +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 } from 'lit';
7
-
8
- export const datePickerOverlayStyles = css`
9
- [part='overlay'] {
10
- display: flex;
11
- flex: auto;
12
- }
13
-
14
- [part~='content'] {
15
- flex: auto;
16
- }
17
-
18
- @media (forced-colors: active) {
19
- [part='overlay'] {
20
- outline: 3px solid;
21
- }
22
- }
23
- `;
@@ -1,35 +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
-
7
- /**
8
- * @polymerMixin
9
- */
10
- export const DatePickerYearMixin = (superClass) =>
11
- class DatePickerYearMixin extends superClass {
12
- static get properties() {
13
- return {
14
- year: {
15
- type: String,
16
- sync: true,
17
- },
18
-
19
- selectedDate: {
20
- type: Object,
21
- sync: true,
22
- },
23
- };
24
- }
25
-
26
- static get observers() {
27
- return ['__updateSelected(year, selectedDate)'];
28
- }
29
-
30
- /** @private */
31
- __updateSelected(year, selectedDate) {
32
- this.toggleAttribute('selected', selectedDate && selectedDate.getFullYear() === year);
33
- this.toggleAttribute('current', year === new Date().getFullYear());
34
- }
35
- };
@@ -1,64 +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 } from 'lit';
7
-
8
- export const monthCalendarStyles = css`
9
- :host {
10
- display: block;
11
- }
12
-
13
- #monthGrid {
14
- width: 100%;
15
- border-collapse: collapse;
16
- }
17
-
18
- #days-container tr,
19
- #weekdays-container tr {
20
- display: flex;
21
- }
22
-
23
- [part~='date'] {
24
- outline: none;
25
- }
26
-
27
- [part~='disabled'] {
28
- pointer-events: none;
29
- }
30
-
31
- [part='week-number'][hidden],
32
- [part='weekday'][hidden] {
33
- display: none;
34
- }
35
-
36
- [part='weekday'],
37
- [part~='date'] {
38
- width: calc(100% / 7);
39
- padding: 0;
40
- font-weight: normal;
41
- }
42
-
43
- [part='weekday']:empty,
44
- [part='week-number'] {
45
- width: 12.5%;
46
- flex-shrink: 0;
47
- padding: 0;
48
- }
49
-
50
- :host([week-numbers]) [part='weekday']:not(:empty),
51
- :host([week-numbers]) [part~='date'] {
52
- width: 12.5%;
53
- }
54
-
55
- @media (forced-colors: active) {
56
- [part~='date'][part~='focused'] {
57
- outline: 1px solid;
58
- }
59
-
60
- [part~='date'][part~='selected'] {
61
- outline: 3px solid;
62
- }
63
- }
64
- `;
@@ -1,7 +0,0 @@
1
- import '@vaadin/vaadin-lumo-styles/color.js';
2
- import '@vaadin/vaadin-lumo-styles/sizing.js';
3
- import '@vaadin/vaadin-lumo-styles/spacing.js';
4
- import '@vaadin/vaadin-lumo-styles/style.js';
5
- import '@vaadin/vaadin-lumo-styles/typography.js';
6
- import '@vaadin/button/theme/lumo/vaadin-button-styles.js';
7
- import './vaadin-date-picker-year-styles.js';
@@ -1,164 +0,0 @@
1
- import '@vaadin/vaadin-lumo-styles/color.js';
2
- import '@vaadin/vaadin-lumo-styles/sizing.js';
3
- import '@vaadin/vaadin-lumo-styles/spacing.js';
4
- import '@vaadin/vaadin-lumo-styles/style.js';
5
- import '@vaadin/vaadin-lumo-styles/typography.js';
6
- import '@vaadin/button/theme/lumo/vaadin-button-styles.js';
7
- import './vaadin-date-picker-year-styles.js';
8
- import { css, registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
9
-
10
- registerStyles(
11
- 'vaadin-date-picker-overlay-content',
12
- css`
13
- :host {
14
- position: relative;
15
- /* Background for the year scroller, placed here as we are using a mask image on the actual years part */
16
- background-image: linear-gradient(var(--lumo-shade-5pct), var(--lumo-shade-5pct));
17
- background-size: 57px 100%;
18
- background-position: top right;
19
- background-repeat: no-repeat;
20
- cursor: default;
21
- }
22
-
23
- ::slotted([slot='months']) {
24
- /* Month calendar height:
25
- header height + margin-bottom
26
- + weekdays height + margin-bottom
27
- + date cell heights
28
- + small margin between month calendars
29
- */
30
- /* prettier-ignore */
31
- --vaadin-infinite-scroller-item-height:
32
- calc(
33
- var(--lumo-font-size-l) + var(--lumo-space-m)
34
- + var(--lumo-font-size-xs) + var(--lumo-space-s)
35
- + var(--lumo-size-m) * 6
36
- + var(--lumo-space-s)
37
- );
38
- --vaadin-infinite-scroller-buffer-offset: 10%;
39
- -webkit-mask-image: linear-gradient(transparent, #000 10%, #000 85%, transparent);
40
- mask-image: linear-gradient(transparent, #000 10%, #000 85%, transparent);
41
- position: relative;
42
- margin-right: 57px;
43
- }
44
-
45
- ::slotted([slot='years']) {
46
- /* TODO get rid of fixed magic number */
47
- --vaadin-infinite-scroller-buffer-width: 97px;
48
- width: 57px;
49
- height: auto;
50
- top: 0;
51
- bottom: 0;
52
- font-size: var(--lumo-font-size-s);
53
- box-shadow: inset 2px 0 4px 0 var(--lumo-shade-5pct);
54
- -webkit-mask-image: linear-gradient(transparent, #000 35%, #000 65%, transparent);
55
- mask-image: linear-gradient(transparent, #000 35%, #000 65%, transparent);
56
- cursor: var(--lumo-clickable-cursor);
57
- }
58
-
59
- ::slotted([slot='years']:hover) {
60
- --_lumo-date-picker-year-opacity: 1;
61
- }
62
-
63
- /* TODO unsupported selector */
64
- #scrollers {
65
- position: static;
66
- display: block;
67
- }
68
-
69
- /* TODO fix this in vaadin-date-picker that it adapts to the width of the year scroller */
70
- :host([desktop]) ::slotted([slot='months']) {
71
- right: auto;
72
- }
73
-
74
- /* Year scroller position indicator */
75
- ::slotted([slot='years'])::before {
76
- border: none;
77
- width: 1em;
78
- height: 1em;
79
- background-color: var(--lumo-base-color);
80
- background-image: linear-gradient(var(--lumo-tint-5pct), var(--lumo-tint-5pct));
81
- transform: translate(-75%, -50%) rotate(45deg);
82
- border-top-right-radius: var(--lumo-border-radius-s);
83
- box-shadow: 2px -2px 6px 0 var(--lumo-shade-5pct);
84
- z-index: 1;
85
- }
86
-
87
- [part='toolbar'] {
88
- padding: var(--lumo-space-s);
89
- border-bottom-left-radius: var(--lumo-border-radius-l);
90
- margin-right: 57px;
91
- }
92
-
93
- [part='toolbar'] ::slotted(vaadin-button) {
94
- margin: 0;
95
- }
96
-
97
- /* Narrow viewport mode (fullscreen) */
98
-
99
- :host([fullscreen]) [part='toolbar'] {
100
- order: -1;
101
- background-color: var(--lumo-base-color);
102
- }
103
-
104
- :host([fullscreen]) [part='overlay-header'] {
105
- order: -2;
106
- height: var(--lumo-size-m);
107
- padding: var(--lumo-space-s);
108
- position: absolute;
109
- left: 0;
110
- right: 0;
111
- justify-content: center;
112
- }
113
-
114
- :host([fullscreen]) [part='toggle-button'],
115
- :host([fullscreen]) [part='clear-button'],
116
- [part='overlay-header'] [part='label'] {
117
- display: none;
118
- }
119
-
120
- /* Very narrow screen (year scroller initially hidden) */
121
-
122
- [part='years-toggle-button'] {
123
- display: flex;
124
- align-items: center;
125
- height: var(--lumo-size-s);
126
- padding: 0 0.5em;
127
- border-radius: var(--lumo-border-radius-m);
128
- z-index: 3;
129
- color: var(--lumo-primary-text-color);
130
- font-weight: 500;
131
- -webkit-font-smoothing: antialiased;
132
- -moz-osx-font-smoothing: grayscale;
133
- }
134
-
135
- :host([years-visible]) [part='years-toggle-button'] {
136
- background-color: var(--lumo-primary-color);
137
- color: var(--lumo-primary-contrast-color);
138
- }
139
-
140
- /* TODO magic number (same as used for media-query in vaadin-date-picker-overlay-content) */
141
- @media screen and (max-width: 374px) {
142
- :host {
143
- background-image: none;
144
- }
145
-
146
- [part='toolbar'],
147
- ::slotted([slot='months']) {
148
- margin-right: 0;
149
- }
150
-
151
- /* TODO make date-picker adapt to the width of the years part */
152
- ::slotted([slot='years']) {
153
- --vaadin-infinite-scroller-buffer-width: 90px;
154
- width: 50px;
155
- background-color: var(--lumo-shade-5pct);
156
- }
157
-
158
- :host([years-visible]) ::slotted([slot='months']) {
159
- padding-left: 50px;
160
- }
161
- }
162
- `,
163
- { moduleId: 'lumo-date-picker-overlay-content' },
164
- );
@@ -1,2 +0,0 @@
1
- import '@vaadin/vaadin-lumo-styles/sizing.js';
2
- import '@vaadin/vaadin-lumo-styles/spacing.js';
@@ -1,55 +0,0 @@
1
- import '@vaadin/vaadin-lumo-styles/sizing.js';
2
- import '@vaadin/vaadin-lumo-styles/spacing.js';
3
- import { menuOverlay } from '@vaadin/vaadin-lumo-styles/mixins/menu-overlay.js';
4
- import { css, registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
5
-
6
- const datePickerOverlay = css`
7
- [part='overlay'] {
8
- /*
9
- Width:
10
- date cell widths
11
- + month calendar side padding
12
- + year scroller width
13
- */
14
- /* prettier-ignore */
15
- width:
16
- calc(
17
- var(--lumo-size-m) * 7
18
- + var(--lumo-space-xs) * 2
19
- + 57px
20
- );
21
- height: 100%;
22
- max-height: calc(var(--lumo-size-m) * 14);
23
- overflow: hidden;
24
- -webkit-tap-highlight-color: transparent;
25
- flex-direction: column;
26
- }
27
-
28
- [part='content'] {
29
- padding: 0;
30
- height: 100%;
31
- overflow: hidden;
32
- -webkit-mask-image: none;
33
- mask-image: none;
34
- }
35
-
36
- :host([top-aligned]) [part~='overlay'] {
37
- margin-top: var(--lumo-space-xs);
38
- }
39
-
40
- :host([bottom-aligned]) [part~='overlay'] {
41
- margin-bottom: var(--lumo-space-xs);
42
- }
43
-
44
- @media (max-width: 450px), (max-height: 450px) {
45
- [part='overlay'] {
46
- width: 100vw;
47
- height: 70vh;
48
- max-height: 70vh;
49
- }
50
- }
51
- `;
52
-
53
- registerStyles('vaadin-date-picker-overlay', [menuOverlay, datePickerOverlay], {
54
- moduleId: 'lumo-date-picker-overlay',
55
- });