@vaadin/date-picker 25.0.0-alpha1 → 25.0.0-alpha11

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 (38) 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 +107 -0
  6. package/src/styles/vaadin-date-picker-year-base-styles.js +26 -0
  7. package/src/styles/vaadin-month-calendar-base-styles.js +140 -0
  8. package/src/vaadin-date-picker-helper.d.ts +5 -0
  9. package/src/vaadin-date-picker-mixin.js +45 -31
  10. package/src/vaadin-date-picker-month-scroller.js +2 -6
  11. package/src/vaadin-date-picker-overlay-content-mixin.js +5 -132
  12. package/src/vaadin-date-picker-overlay-content.js +13 -17
  13. package/src/vaadin-date-picker-overlay.js +17 -3
  14. package/src/vaadin-date-picker-year-scroller.js +3 -4
  15. package/src/vaadin-date-picker-year.js +32 -9
  16. package/src/vaadin-date-picker.d.ts +11 -16
  17. package/src/vaadin-date-picker.js +23 -20
  18. package/src/vaadin-infinite-scroller.js +1 -19
  19. package/src/vaadin-month-calendar.js +3 -2
  20. package/vaadin-date-picker.js +1 -1
  21. package/web-types.json +2 -2
  22. package/web-types.lit.json +2 -2
  23. package/src/vaadin-date-picker-overlay-content-styles.js +0 -68
  24. package/src/vaadin-date-picker-overlay-styles.js +0 -23
  25. package/src/vaadin-date-picker-year-mixin.js +0 -35
  26. package/src/vaadin-month-calendar-styles.js +0 -64
  27. package/theme/lumo/vaadin-date-picker-overlay-content-styles.d.ts +0 -7
  28. package/theme/lumo/vaadin-date-picker-overlay-content-styles.js +0 -164
  29. package/theme/lumo/vaadin-date-picker-overlay-styles.d.ts +0 -2
  30. package/theme/lumo/vaadin-date-picker-overlay-styles.js +0 -55
  31. package/theme/lumo/vaadin-date-picker-styles.d.ts +0 -2
  32. package/theme/lumo/vaadin-date-picker-styles.js +0 -30
  33. package/theme/lumo/vaadin-date-picker-year-styles.d.ts +0 -1
  34. package/theme/lumo/vaadin-date-picker-year-styles.js +0 -32
  35. package/theme/lumo/vaadin-date-picker.d.ts +0 -5
  36. package/theme/lumo/vaadin-date-picker.js +0 -5
  37. package/theme/lumo/vaadin-month-calendar-styles.d.ts +0 -5
  38. package/theme/lumo/vaadin-month-calendar-styles.js +0 -158
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-alpha1",
4
+ "version": "25.0.0-alpha11",
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-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\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-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/25.0.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",
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-alpha11/#/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`backdrop` | Backdrop of the overlay\n`overlay` | The overlay container\n`content` | The overlay content\n\nIn addition to `<vaadin-text-field>` state attributes, the following state attributes are available for theming:\n\nAttribute | Description\n---------------|----------------------------------------------\n`opened` | Set when the date selector 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",
@@ -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-alpha1",
4
+ "version": "25.0.0-alpha11",
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-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\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-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/25.0.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",
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-alpha11/#/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`backdrop` | Backdrop of the overlay\n`overlay` | The overlay container\n`content` | The overlay content\n\nIn addition to `<vaadin-text-field>` state attributes, the following state attributes are available for theming:\n\nAttribute | Description\n---------------|----------------------------------------------\n`opened` | Set when the date selector 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
  {
@@ -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
- });
@@ -1,2 +0,0 @@
1
- import '@vaadin/input-container/theme/lumo/vaadin-input-container-styles.js';
2
- import '@vaadin/vaadin-lumo-styles/font-icons.js';
@@ -1,30 +0,0 @@
1
- import '@vaadin/input-container/theme/lumo/vaadin-input-container-styles.js';
2
- import '@vaadin/vaadin-lumo-styles/font-icons.js';
3
- import { inputFieldShared } from '@vaadin/vaadin-lumo-styles/mixins/input-field-shared.js';
4
- import { css, registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
5
-
6
- const datePicker = css`
7
- [part='toggle-button']::before {
8
- content: var(--lumo-icons-calendar);
9
- }
10
-
11
- [part='clear-button']::before {
12
- content: var(--lumo-icons-cross);
13
- }
14
-
15
- @media (max-width: 450px), (max-height: 450px) {
16
- [part='overlay-content'] {
17
- height: 70vh;
18
- }
19
- }
20
-
21
- :host([dir='rtl']) [part='input-field'] ::slotted(input) {
22
- --_lumo-text-field-overflow-mask-image: linear-gradient(to left, transparent, #000 1.25em);
23
- }
24
-
25
- :host([dir='rtl']) [part='input-field'] ::slotted(input:placeholder-shown) {
26
- --_lumo-text-field-overflow-mask-image: none;
27
- }
28
- `;
29
-
30
- registerStyles('vaadin-date-picker', [inputFieldShared, datePicker], { moduleId: 'lumo-date-picker' });
@@ -1 +0,0 @@
1
- import '@vaadin/vaadin-lumo-styles/color.js';
@@ -1,32 +0,0 @@
1
- import '@vaadin/vaadin-lumo-styles/color.js';
2
- import { css, registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
3
-
4
- registerStyles(
5
- 'vaadin-date-picker-year',
6
- css`
7
- :host([current]) [part='year-number'] {
8
- color: var(--lumo-primary-text-color);
9
- }
10
-
11
- :host(:not([current])) [part='year-number'],
12
- [part='year-separator'] {
13
- opacity: var(--_lumo-date-picker-year-opacity, 0.7);
14
- transition: 0.2s opacity;
15
- }
16
-
17
- [part='year-number'],
18
- [part='year-separator'] {
19
- display: flex;
20
- align-items: center;
21
- justify-content: center;
22
- height: 50%;
23
- transform: translateY(-50%);
24
- }
25
-
26
- [part='year-separator']::after {
27
- color: var(--lumo-disabled-text-color);
28
- content: '\\2022';
29
- }
30
- `,
31
- { moduleId: 'lumo-date-picker-year' },
32
- );
@@ -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-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-date-picker.js';
@@ -1,5 +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';