@vaadin/date-picker 25.0.0-alpha9 → 25.0.0-beta1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +13 -16
- package/src/styles/vaadin-date-picker-base-styles.js +2 -2
- package/src/styles/vaadin-date-picker-overlay-content-base-styles.js +10 -9
- package/src/styles/vaadin-date-picker-year-base-styles.js +3 -2
- package/src/styles/vaadin-month-calendar-base-styles.js +12 -9
- package/src/vaadin-date-picker-helper.js +1 -1
- package/src/vaadin-date-picker-mixin.d.ts +1 -3
- package/src/vaadin-date-picker-mixin.js +6 -7
- package/src/vaadin-date-picker-overlay-content.js +7 -1
- package/src/vaadin-date-picker-overlay.js +2 -2
- package/src/vaadin-date-picker-year.js +1 -2
- package/src/vaadin-date-picker.d.ts +32 -23
- package/src/vaadin-date-picker.js +35 -25
- package/src/vaadin-month-calendar.js +1 -1
- package/vaadin-date-picker.js +1 -1
- package/web-types.json +3 -25
- package/web-types.lit.json +3 -10
- package/src/styles/vaadin-date-picker-core-styles.d.ts +0 -8
- package/src/styles/vaadin-date-picker-core-styles.js +0 -21
- package/src/styles/vaadin-date-picker-overlay-content-core-styles.js +0 -54
- package/src/styles/vaadin-date-picker-overlay-core-styles.js +0 -23
- package/src/styles/vaadin-date-picker-year-core-styles.js +0 -13
- package/src/styles/vaadin-month-calendar-core-styles.js +0 -64
- package/theme/lumo/vaadin-date-picker-overlay-content-styles.d.ts +0 -7
- package/theme/lumo/vaadin-date-picker-overlay-content-styles.js +0 -137
- package/theme/lumo/vaadin-date-picker-overlay-styles.d.ts +0 -2
- package/theme/lumo/vaadin-date-picker-overlay-styles.js +0 -54
- package/theme/lumo/vaadin-date-picker-styles.d.ts +0 -2
- package/theme/lumo/vaadin-date-picker-styles.js +0 -30
- package/theme/lumo/vaadin-date-picker-year-styles.d.ts +0 -1
- package/theme/lumo/vaadin-date-picker-year-styles.js +0 -32
- package/theme/lumo/vaadin-date-picker.d.ts +0 -5
- package/theme/lumo/vaadin-date-picker.js +0 -5
- package/theme/lumo/vaadin-month-calendar-styles.d.ts +0 -5
- package/theme/lumo/vaadin-month-calendar-styles.js +0 -158
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vaadin/date-picker",
|
|
3
|
-
"version": "25.0.0-
|
|
3
|
+
"version": "25.0.0-beta1",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -21,9 +21,6 @@
|
|
|
21
21
|
"type": "module",
|
|
22
22
|
"files": [
|
|
23
23
|
"src",
|
|
24
|
-
"!src/styles/*-base-styles.d.ts",
|
|
25
|
-
"!src/styles/*-base-styles.js",
|
|
26
|
-
"theme",
|
|
27
24
|
"vaadin-*.d.ts",
|
|
28
25
|
"vaadin-*.js",
|
|
29
26
|
"web-types.json",
|
|
@@ -37,25 +34,25 @@
|
|
|
37
34
|
],
|
|
38
35
|
"dependencies": {
|
|
39
36
|
"@open-wc/dedupe-mixin": "^1.3.0",
|
|
40
|
-
"@vaadin/a11y-base": "25.0.0-
|
|
41
|
-
"@vaadin/button": "25.0.0-
|
|
42
|
-
"@vaadin/component-base": "25.0.0-
|
|
43
|
-
"@vaadin/field-base": "25.0.0-
|
|
44
|
-
"@vaadin/input-container": "25.0.0-
|
|
45
|
-
"@vaadin/overlay": "25.0.0-
|
|
46
|
-
"@vaadin/vaadin-
|
|
47
|
-
"@vaadin/vaadin-themable-mixin": "25.0.0-alpha9",
|
|
37
|
+
"@vaadin/a11y-base": "25.0.0-beta1",
|
|
38
|
+
"@vaadin/button": "25.0.0-beta1",
|
|
39
|
+
"@vaadin/component-base": "25.0.0-beta1",
|
|
40
|
+
"@vaadin/field-base": "25.0.0-beta1",
|
|
41
|
+
"@vaadin/input-container": "25.0.0-beta1",
|
|
42
|
+
"@vaadin/overlay": "25.0.0-beta1",
|
|
43
|
+
"@vaadin/vaadin-themable-mixin": "25.0.0-beta1",
|
|
48
44
|
"lit": "^3.0.0"
|
|
49
45
|
},
|
|
50
46
|
"devDependencies": {
|
|
51
|
-
"@vaadin/chai-plugins": "25.0.0-
|
|
52
|
-
"@vaadin/test-runner-commands": "25.0.0-
|
|
47
|
+
"@vaadin/chai-plugins": "25.0.0-beta1",
|
|
48
|
+
"@vaadin/test-runner-commands": "25.0.0-beta1",
|
|
53
49
|
"@vaadin/testing-helpers": "^2.0.0",
|
|
54
|
-
"
|
|
50
|
+
"@vaadin/vaadin-lumo-styles": "25.0.0-beta1",
|
|
51
|
+
"sinon": "^21.0.0"
|
|
55
52
|
},
|
|
56
53
|
"web-types": [
|
|
57
54
|
"web-types.json",
|
|
58
55
|
"web-types.lit.json"
|
|
59
56
|
],
|
|
60
|
-
"gitHead": "
|
|
57
|
+
"gitHead": "1d20cf54e582d1f2e209126d4586f8b4c01c50e0"
|
|
61
58
|
}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Copyright (c) 2016 - 2025 Vaadin Ltd.
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
|
-
import '@vaadin/component-base/src/style-props.js';
|
|
6
|
+
import '@vaadin/component-base/src/styles/style-props.js';
|
|
7
7
|
import { css } from 'lit';
|
|
8
8
|
|
|
9
9
|
export const datePickerStyles = css`
|
|
@@ -24,7 +24,7 @@ export const datePickerStyles = css`
|
|
|
24
24
|
text-align: left;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
[part
|
|
27
|
+
[part~='toggle-button']::before {
|
|
28
28
|
mask-image: var(--_vaadin-icon-calendar);
|
|
29
29
|
}
|
|
30
30
|
`;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Copyright (c) 2016 - 2025 Vaadin Ltd.
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
|
-
import '@vaadin/component-base/src/style-props.js';
|
|
6
|
+
import '@vaadin/component-base/src/styles/style-props.js';
|
|
7
7
|
import { css } from 'lit';
|
|
8
8
|
|
|
9
9
|
export const overlayContentStyles = css`
|
|
@@ -29,9 +29,9 @@ export const overlayContentStyles = css`
|
|
|
29
29
|
|
|
30
30
|
[part='years-toggle-button'] {
|
|
31
31
|
display: inline-flex;
|
|
32
|
-
|
|
32
|
+
align-items: center;
|
|
33
33
|
border-radius: var(--vaadin-button-border-radius, var(--vaadin-radius-m));
|
|
34
|
-
color: var(--vaadin-
|
|
34
|
+
color: var(--vaadin-text-color);
|
|
35
35
|
font-size: var(--vaadin-button-font-size, inherit);
|
|
36
36
|
font-weight: var(--vaadin-button-font-weight, 500);
|
|
37
37
|
height: var(--vaadin-button-height, auto);
|
|
@@ -41,7 +41,7 @@ export const overlayContentStyles = css`
|
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
:host([years-visible]) [part='years-toggle-button'] {
|
|
44
|
-
background: var(--vaadin-color);
|
|
44
|
+
background: var(--vaadin-text-color);
|
|
45
45
|
color: var(--vaadin-background-color);
|
|
46
46
|
}
|
|
47
47
|
|
|
@@ -57,7 +57,7 @@ export const overlayContentStyles = css`
|
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
:host([desktop]) ::slotted([slot='months']) {
|
|
60
|
-
border-bottom: 1px solid var(--vaadin-border-color);
|
|
60
|
+
border-bottom: 1px solid var(--vaadin-border-color-secondary);
|
|
61
61
|
}
|
|
62
62
|
|
|
63
63
|
::slotted([slot='years']) {
|
|
@@ -65,7 +65,8 @@ export const overlayContentStyles = css`
|
|
|
65
65
|
background: var(--vaadin-date-picker-year-scroller-background, var(--vaadin-background-container));
|
|
66
66
|
width: var(--vaadin-date-picker-year-scroller-width, 3rem);
|
|
67
67
|
box-sizing: border-box;
|
|
68
|
-
border-inline-start: 1px solid
|
|
68
|
+
border-inline-start: 1px solid
|
|
69
|
+
var(--vaadin-date-picker-year-scroller-border-color, var(--vaadin-border-color-secondary));
|
|
69
70
|
overflow: visible;
|
|
70
71
|
min-height: 0;
|
|
71
72
|
clip-path: inset(0);
|
|
@@ -73,7 +74,7 @@ export const overlayContentStyles = css`
|
|
|
73
74
|
|
|
74
75
|
::slotted([slot='years'])::before {
|
|
75
76
|
background: var(--vaadin-overlay-background, var(--vaadin-background-color));
|
|
76
|
-
border: 1px solid var(--vaadin-date-picker-year-scroller-border-color, var(--vaadin-border-color));
|
|
77
|
+
border: 1px solid var(--vaadin-date-picker-year-scroller-border-color, var(--vaadin-border-color-secondary));
|
|
77
78
|
width: 16px;
|
|
78
79
|
height: 16px;
|
|
79
80
|
position: absolute;
|
|
@@ -97,11 +98,11 @@ export const overlayContentStyles = css`
|
|
|
97
98
|
display: flex;
|
|
98
99
|
grid-area: toolbar;
|
|
99
100
|
justify-content: space-between;
|
|
100
|
-
padding: var(--vaadin-date-picker-toolbar-padding, var(--vaadin-padding));
|
|
101
|
+
padding: var(--vaadin-date-picker-toolbar-padding, var(--vaadin-padding-s));
|
|
101
102
|
}
|
|
102
103
|
|
|
103
104
|
:host([fullscreen]) [part='toolbar'] {
|
|
104
105
|
grid-area: header;
|
|
105
|
-
border-bottom: 1px solid var(--vaadin-border-color);
|
|
106
|
+
border-bottom: 1px solid var(--vaadin-border-color-secondary);
|
|
106
107
|
}
|
|
107
108
|
`;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Copyright (c) 2016 - 2025 Vaadin Ltd.
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
|
-
import '@vaadin/component-base/src/style-props.js';
|
|
6
|
+
import '@vaadin/component-base/src/styles/style-props.js';
|
|
7
7
|
import { css } from 'lit';
|
|
8
8
|
|
|
9
9
|
export const datePickerYearStyles = css`
|
|
@@ -18,9 +18,10 @@ export const datePickerYearStyles = css`
|
|
|
18
18
|
height: 50%;
|
|
19
19
|
justify-content: center;
|
|
20
20
|
transform: translateY(-50%);
|
|
21
|
+
color: var(--vaadin-text-color-secondary);
|
|
21
22
|
}
|
|
22
23
|
|
|
23
24
|
:host([current]) [part='year-number'] {
|
|
24
|
-
color: var(--vaadin-date-picker-year-scroller-current-year-color, var(--vaadin-color));
|
|
25
|
+
color: var(--vaadin-date-picker-year-scroller-current-year-color, var(--vaadin-text-color));
|
|
25
26
|
}
|
|
26
27
|
`;
|
|
@@ -3,17 +3,17 @@
|
|
|
3
3
|
* Copyright (c) 2016 - 2025 Vaadin Ltd.
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
|
-
import '@vaadin/component-base/src/style-props.js';
|
|
6
|
+
import '@vaadin/component-base/src/styles/style-props.js';
|
|
7
7
|
import { css } from 'lit';
|
|
8
8
|
|
|
9
9
|
export const monthCalendarStyles = css`
|
|
10
10
|
:host {
|
|
11
11
|
display: block;
|
|
12
|
-
padding: var(--vaadin-date-picker-month-padding, var(--vaadin-padding));
|
|
12
|
+
padding: var(--vaadin-date-picker-month-padding, var(--vaadin-padding-s));
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
[part='month-header'] {
|
|
16
|
-
color: var(--vaadin-date-picker-month-header-color, var(--vaadin-color));
|
|
16
|
+
color: var(--vaadin-date-picker-month-header-color, var(--vaadin-text-color));
|
|
17
17
|
font-size: var(--vaadin-date-picker-month-header-font-size, 0.9375rem);
|
|
18
18
|
font-weight: var(--vaadin-date-picker-month-header-font-weight, 500);
|
|
19
19
|
line-height: inherit;
|
|
@@ -33,7 +33,7 @@ export const monthCalendarStyles = css`
|
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
[part~='weekday'] {
|
|
36
|
-
color: var(--vaadin-date-picker-weekday-color,
|
|
36
|
+
color: var(--vaadin-date-picker-weekday-color, var(--vaadin-text-color-secondary));
|
|
37
37
|
font-size: var(--vaadin-date-picker-weekday-font-size, 0.75rem);
|
|
38
38
|
font-weight: var(--vaadin-date-picker-weekday-font-weight, 500);
|
|
39
39
|
margin-bottom: 0.375rem;
|
|
@@ -46,7 +46,7 @@ export const monthCalendarStyles = css`
|
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
[part~='week-number'] {
|
|
49
|
-
color: var(--vaadin-date-picker-week-number-color,
|
|
49
|
+
color: var(--vaadin-date-picker-week-number-color, var(--vaadin-text-color-secondary));
|
|
50
50
|
font-size: var(--vaadin-date-picker-week-number-font-size, 0.7rem);
|
|
51
51
|
line-height: 1;
|
|
52
52
|
width: 100%;
|
|
@@ -59,7 +59,10 @@ export const monthCalendarStyles = css`
|
|
|
59
59
|
content: '';
|
|
60
60
|
height: 1px;
|
|
61
61
|
flex: 1;
|
|
62
|
-
background: var(
|
|
62
|
+
background: var(
|
|
63
|
+
--vaadin-date-picker-week-divider-color,
|
|
64
|
+
var(--vaadin-divider-color, var(--vaadin-border-color-secondary))
|
|
65
|
+
);
|
|
63
66
|
}
|
|
64
67
|
|
|
65
68
|
[part~='weekday'],
|
|
@@ -95,7 +98,7 @@ export const monthCalendarStyles = css`
|
|
|
95
98
|
}
|
|
96
99
|
|
|
97
100
|
[part~='today'] {
|
|
98
|
-
color: var(--vaadin-date-picker-date-today-color, var(--vaadin-color));
|
|
101
|
+
color: var(--vaadin-date-picker-date-today-color, var(--vaadin-text-color));
|
|
99
102
|
}
|
|
100
103
|
|
|
101
104
|
[part~='selected'] {
|
|
@@ -103,13 +106,13 @@ export const monthCalendarStyles = css`
|
|
|
103
106
|
}
|
|
104
107
|
|
|
105
108
|
[part~='selected']::after {
|
|
106
|
-
background: var(--vaadin-date-picker-date-selected-background, var(--vaadin-color));
|
|
109
|
+
background: var(--vaadin-date-picker-date-selected-background, var(--vaadin-text-color));
|
|
107
110
|
outline-offset: 1px;
|
|
108
111
|
}
|
|
109
112
|
|
|
110
113
|
[disabled] {
|
|
111
114
|
cursor: var(--vaadin-disabled-cursor);
|
|
112
|
-
color: var(--vaadin-date-picker-date-disabled-color, var(--vaadin-color-disabled));
|
|
115
|
+
color: var(--vaadin-date-picker-date-disabled-color, var(--vaadin-text-color-disabled));
|
|
113
116
|
opacity: 0.7;
|
|
114
117
|
}
|
|
115
118
|
|
|
@@ -9,7 +9,6 @@ import type { DisabledMixinClass } from '@vaadin/a11y-base/src/disabled-mixin.js
|
|
|
9
9
|
import type { FocusMixinClass } from '@vaadin/a11y-base/src/focus-mixin.js';
|
|
10
10
|
import type { KeyboardMixinClass } from '@vaadin/a11y-base/src/keyboard-mixin.js';
|
|
11
11
|
import type { I18nMixinClass } from '@vaadin/component-base/src/i18n-mixin.js';
|
|
12
|
-
import type { OverlayClassMixinClass } from '@vaadin/component-base/src/overlay-class-mixin.js';
|
|
13
12
|
import type { InputConstraintsMixinClass } from '@vaadin/field-base/src/input-constraints-mixin.js';
|
|
14
13
|
import type { InputMixinClass } from '@vaadin/field-base/src/input-mixin.js';
|
|
15
14
|
|
|
@@ -96,7 +95,6 @@ export declare function DatePickerMixin<T extends Constructor<HTMLElement>>(
|
|
|
96
95
|
Constructor<InputConstraintsMixinClass> &
|
|
97
96
|
Constructor<InputMixinClass> &
|
|
98
97
|
Constructor<KeyboardMixinClass> &
|
|
99
|
-
Constructor<OverlayClassMixinClass> &
|
|
100
98
|
T;
|
|
101
99
|
|
|
102
100
|
export declare class DatePickerMixinClass {
|
|
@@ -143,7 +141,7 @@ export declare class DatePickerMixinClass {
|
|
|
143
141
|
*
|
|
144
142
|
* The object has the following JSON structure and default values:
|
|
145
143
|
*
|
|
146
|
-
* ```
|
|
144
|
+
* ```js
|
|
147
145
|
* {
|
|
148
146
|
* // An array with the full names of months starting
|
|
149
147
|
* // with January.
|
|
@@ -10,7 +10,6 @@ import { KeyboardMixin } from '@vaadin/a11y-base/src/keyboard-mixin.js';
|
|
|
10
10
|
import { isIOS } from '@vaadin/component-base/src/browser-utils.js';
|
|
11
11
|
import { I18nMixin } from '@vaadin/component-base/src/i18n-mixin.js';
|
|
12
12
|
import { MediaQueryController } from '@vaadin/component-base/src/media-query-controller.js';
|
|
13
|
-
import { OverlayClassMixin } from '@vaadin/component-base/src/overlay-class-mixin.js';
|
|
14
13
|
import { InputConstraintsMixin } from '@vaadin/field-base/src/input-constraints-mixin.js';
|
|
15
14
|
import { VirtualKeyboardController } from '@vaadin/field-base/src/virtual-keyboard-controller.js';
|
|
16
15
|
import {
|
|
@@ -85,13 +84,12 @@ export const datePickerI18nDefaults = Object.freeze({
|
|
|
85
84
|
* @mixes I18nMixin
|
|
86
85
|
* @mixes InputConstraintsMixin
|
|
87
86
|
* @mixes KeyboardMixin
|
|
88
|
-
* @mixes OverlayClassMixin
|
|
89
87
|
* @param {function(new:HTMLElement)} subclass
|
|
90
88
|
*/
|
|
91
89
|
export const DatePickerMixin = (subclass) =>
|
|
92
90
|
class DatePickerMixinClass extends I18nMixin(
|
|
93
91
|
datePickerI18nDefaults,
|
|
94
|
-
|
|
92
|
+
DelegateFocusMixin(InputConstraintsMixin(KeyboardMixin(subclass))),
|
|
95
93
|
) {
|
|
96
94
|
static get properties() {
|
|
97
95
|
return {
|
|
@@ -304,7 +302,7 @@ export const DatePickerMixin = (subclass) =>
|
|
|
304
302
|
*
|
|
305
303
|
* The object has the following JSON structure and default values:
|
|
306
304
|
*
|
|
307
|
-
* ```
|
|
305
|
+
* ```js
|
|
308
306
|
* {
|
|
309
307
|
* // An array with the full names of months starting
|
|
310
308
|
* // with January.
|
|
@@ -473,6 +471,7 @@ export const DatePickerMixin = (subclass) =>
|
|
|
473
471
|
}
|
|
474
472
|
|
|
475
473
|
/**
|
|
474
|
+
* @param {FocusOptions=} options
|
|
476
475
|
* @protected
|
|
477
476
|
* @override
|
|
478
477
|
*/
|
|
@@ -913,7 +912,7 @@ export const DatePickerMixin = (subclass) =>
|
|
|
913
912
|
this._overlayContent.focusDateElement();
|
|
914
913
|
}
|
|
915
914
|
|
|
916
|
-
const focusables = this._noInput ? content :
|
|
915
|
+
const focusables = this._noInput ? content : this;
|
|
917
916
|
this.__showOthers = hideOthers(focusables);
|
|
918
917
|
}
|
|
919
918
|
|
|
@@ -1033,7 +1032,7 @@ export const DatePickerMixin = (subclass) =>
|
|
|
1033
1032
|
*/
|
|
1034
1033
|
_onClick(event) {
|
|
1035
1034
|
// Ignore click events bubbling from the overlay
|
|
1036
|
-
if (event.composedPath().includes(this.
|
|
1035
|
+
if (event.composedPath().includes(this._overlayElement)) {
|
|
1037
1036
|
return;
|
|
1038
1037
|
}
|
|
1039
1038
|
|
|
@@ -1121,7 +1120,7 @@ export const DatePickerMixin = (subclass) =>
|
|
|
1121
1120
|
/**
|
|
1122
1121
|
* Override an event listener from `KeyboardMixin`.
|
|
1123
1122
|
*
|
|
1124
|
-
* @param {!KeyboardEvent}
|
|
1123
|
+
* @param {!KeyboardEvent} event
|
|
1125
1124
|
* @protected
|
|
1126
1125
|
* @override
|
|
1127
1126
|
*/
|
|
@@ -14,7 +14,7 @@ import { DirMixin } from '@vaadin/component-base/src/dir-mixin.js';
|
|
|
14
14
|
import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
|
|
15
15
|
import { LumoInjectionMixin } from '@vaadin/vaadin-themable-mixin/lumo-injection-mixin.js';
|
|
16
16
|
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
17
|
-
import { overlayContentStyles } from './styles/vaadin-date-picker-overlay-content-
|
|
17
|
+
import { overlayContentStyles } from './styles/vaadin-date-picker-overlay-content-base-styles.js';
|
|
18
18
|
import { DatePickerOverlayContentMixin } from './vaadin-date-picker-overlay-content-mixin.js';
|
|
19
19
|
|
|
20
20
|
/**
|
|
@@ -33,6 +33,12 @@ class DatePickerOverlayContent extends DatePickerOverlayContentMixin(
|
|
|
33
33
|
return overlayContentStyles;
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
+
static get lumoInjector() {
|
|
37
|
+
return {
|
|
38
|
+
includeBaseStyles: true,
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
|
|
36
42
|
/** @protected */
|
|
37
43
|
render() {
|
|
38
44
|
return html`
|
|
@@ -7,10 +7,10 @@ import { html, LitElement } from 'lit';
|
|
|
7
7
|
import { defineCustomElement } from '@vaadin/component-base/src/define.js';
|
|
8
8
|
import { DirMixin } from '@vaadin/component-base/src/dir-mixin.js';
|
|
9
9
|
import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
|
|
10
|
-
import { overlayStyles } from '@vaadin/overlay/src/styles/vaadin-overlay-
|
|
10
|
+
import { overlayStyles } from '@vaadin/overlay/src/styles/vaadin-overlay-base-styles.js';
|
|
11
11
|
import { LumoInjectionMixin } from '@vaadin/vaadin-themable-mixin/lumo-injection-mixin.js';
|
|
12
12
|
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
13
|
-
import { datePickerOverlayStyles } from './styles/vaadin-date-picker-overlay-
|
|
13
|
+
import { datePickerOverlayStyles } from './styles/vaadin-date-picker-overlay-base-styles.js';
|
|
14
14
|
import { DatePickerOverlayMixin } from './vaadin-date-picker-overlay-mixin.js';
|
|
15
15
|
|
|
16
16
|
/**
|
|
@@ -8,7 +8,7 @@ import { defineCustomElement } from '@vaadin/component-base/src/define.js';
|
|
|
8
8
|
import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
|
|
9
9
|
import { LumoInjectionMixin } from '@vaadin/vaadin-themable-mixin/lumo-injection-mixin.js';
|
|
10
10
|
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
11
|
-
import { datePickerYearStyles } from './styles/vaadin-date-picker-year-
|
|
11
|
+
import { datePickerYearStyles } from './styles/vaadin-date-picker-year-base-styles.js';
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* An element used internally by `<vaadin-date-picker>`. Not intended to be used separately.
|
|
@@ -16,7 +16,6 @@ import { datePickerYearStyles } from './styles/vaadin-date-picker-year-core-styl
|
|
|
16
16
|
* @customElement
|
|
17
17
|
* @extends HTMLElement
|
|
18
18
|
* @mixes ThemableMixin
|
|
19
|
-
* @mixes DatePickerYearMixin
|
|
20
19
|
* @private
|
|
21
20
|
*/
|
|
22
21
|
export class DatePickerYear extends ThemableMixin(PolylitMixin(LumoInjectionMixin(LitElement))) {
|
|
@@ -78,37 +78,49 @@ export interface DatePickerEventMap extends HTMLElementEventMap, DatePickerCusto
|
|
|
78
78
|
* -------------------------------|----------------------------|---------
|
|
79
79
|
* `--vaadin-field-default-width` | Default width of the field | `12em`
|
|
80
80
|
*
|
|
81
|
-
*
|
|
82
|
-
*
|
|
83
|
-
*
|
|
84
|
-
*
|
|
85
|
-
*
|
|
86
|
-
*
|
|
87
|
-
*
|
|
88
|
-
* `
|
|
89
|
-
* `
|
|
90
|
-
* `
|
|
91
|
-
* `
|
|
92
|
-
*
|
|
93
|
-
*
|
|
94
|
-
*
|
|
95
|
-
*
|
|
96
|
-
*
|
|
97
|
-
*
|
|
98
|
-
*
|
|
81
|
+
* The following shadow DOM parts are available for styling:
|
|
82
|
+
*
|
|
83
|
+
* Part name | Description
|
|
84
|
+
* ---------------------|----------------
|
|
85
|
+
* `label` | The label element
|
|
86
|
+
* `input-field` | The element that wraps prefix, value and buttons
|
|
87
|
+
* `field-button` | Set on both clear and toggle buttons
|
|
88
|
+
* `clear-button` | The clear button
|
|
89
|
+
* `error-message` | The error message element
|
|
90
|
+
* `helper-text` | The helper text element wrapper
|
|
91
|
+
* `required-indicator` | The `required` state indicator element
|
|
92
|
+
* `toggle-button` | The toggle button
|
|
93
|
+
* `backdrop` | Backdrop of the overlay
|
|
94
|
+
* `overlay` | The overlay container
|
|
95
|
+
* `content` | The overlay content
|
|
96
|
+
*
|
|
97
|
+
* The following state attributes are available for styling:
|
|
98
|
+
*
|
|
99
|
+
* Attribute | Description
|
|
100
|
+
* ---------------------|---------------------------------
|
|
101
|
+
* `disabled` | Set when the element is disabled
|
|
102
|
+
* `has-value` | Set when the element has a value
|
|
103
|
+
* `has-label` | Set when the element has a label
|
|
104
|
+
* `has-helper` | Set when the element has helper text or slot
|
|
105
|
+
* `has-error-message` | Set when the element has an error message
|
|
106
|
+
* `has-tooltip` | Set when the element has a slotted tooltip
|
|
107
|
+
* `invalid` | Set when the element is invalid
|
|
108
|
+
* `focused` | Set when the element is focused
|
|
109
|
+
* `focus-ring` | Set when the element is keyboard focused
|
|
110
|
+
* `readonly` | Set when the element is readonly
|
|
111
|
+
* `opened` | Set when the overlay is opened
|
|
112
|
+
* `week-numbers` | Set when week numbers are shown in the calendar
|
|
99
113
|
*
|
|
100
114
|
* ### Internal components
|
|
101
115
|
*
|
|
102
116
|
* In addition to `<vaadin-date-picker>` itself, the following internal
|
|
103
117
|
* components are themable:
|
|
104
118
|
*
|
|
105
|
-
* - `<vaadin-date-picker-overlay>` - has the same API as [`<vaadin-overlay>`](#/elements/vaadin-overlay).
|
|
106
119
|
* - `<vaadin-date-picker-overlay-content>`
|
|
107
120
|
* - `<vaadin-date-picker-month-scroller>`
|
|
108
121
|
* - `<vaadin-date-picker-year-scroller>`
|
|
109
122
|
* - `<vaadin-date-picker-year>`
|
|
110
123
|
* - `<vaadin-month-calendar>`
|
|
111
|
-
* - [`<vaadin-input-container>`](#/elements/vaadin-input-container) - an internal element wrapping the input.
|
|
112
124
|
*
|
|
113
125
|
* In order to style the overlay content, use `<vaadin-date-picker-overlay-content>` shadow DOM parts:
|
|
114
126
|
*
|
|
@@ -149,9 +161,6 @@ export interface DatePickerEventMap extends HTMLElementEventMap, DatePickerCusto
|
|
|
149
161
|
* `year-number` | Year number
|
|
150
162
|
* `year-separator` | Year separator
|
|
151
163
|
*
|
|
152
|
-
* Note: the `theme` attribute value set on `<vaadin-date-picker>` is
|
|
153
|
-
* propagated to the internal components listed above.
|
|
154
|
-
*
|
|
155
164
|
* See [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.
|
|
156
165
|
*
|
|
157
166
|
* ### Change events
|
|
@@ -18,7 +18,7 @@ import { LabelledInputController } from '@vaadin/field-base/src/labelled-input-c
|
|
|
18
18
|
import { inputFieldShared } from '@vaadin/field-base/src/styles/input-field-shared-styles.js';
|
|
19
19
|
import { LumoInjectionMixin } from '@vaadin/vaadin-themable-mixin/lumo-injection-mixin.js';
|
|
20
20
|
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
21
|
-
import { datePickerStyles } from './styles/vaadin-date-picker-
|
|
21
|
+
import { datePickerStyles } from './styles/vaadin-date-picker-base-styles.js';
|
|
22
22
|
import { DatePickerMixin } from './vaadin-date-picker-mixin.js';
|
|
23
23
|
|
|
24
24
|
/**
|
|
@@ -42,37 +42,49 @@ import { DatePickerMixin } from './vaadin-date-picker-mixin.js';
|
|
|
42
42
|
* -------------------------------|----------------------------|---------
|
|
43
43
|
* `--vaadin-field-default-width` | Default width of the field | `12em`
|
|
44
44
|
*
|
|
45
|
-
*
|
|
46
|
-
* See [`<vaadin-text-field>`](#/elements/vaadin-text-field) for the styling documentation.
|
|
45
|
+
* The following shadow DOM parts are available for styling:
|
|
47
46
|
*
|
|
48
|
-
*
|
|
47
|
+
* Part name | Description
|
|
48
|
+
* ---------------------|----------------
|
|
49
|
+
* `label` | The label element
|
|
50
|
+
* `input-field` | The element that wraps prefix, value and buttons
|
|
51
|
+
* `field-button` | Set on both clear and toggle buttons
|
|
52
|
+
* `clear-button` | The clear button
|
|
53
|
+
* `error-message` | The error message element
|
|
54
|
+
* `helper-text` | The helper text element wrapper
|
|
55
|
+
* `required-indicator` | The `required` state indicator element
|
|
56
|
+
* `toggle-button` | The toggle button
|
|
57
|
+
* `backdrop` | Backdrop of the overlay
|
|
58
|
+
* `overlay` | The overlay container
|
|
59
|
+
* `content` | The overlay content
|
|
49
60
|
*
|
|
50
|
-
*
|
|
51
|
-
* -----------------|--------------------
|
|
52
|
-
* `toggle-button` | Toggle button
|
|
53
|
-
* `backdrop` | Backdrop of the overlay
|
|
54
|
-
* `overlay` | The overlay container
|
|
55
|
-
* `content` | The overlay content
|
|
61
|
+
* The following state attributes are available for styling:
|
|
56
62
|
*
|
|
57
|
-
*
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
*
|
|
61
|
-
* `
|
|
62
|
-
* `
|
|
63
|
+
* Attribute | Description
|
|
64
|
+
* ---------------------|---------------------------------
|
|
65
|
+
* `disabled` | Set when the element is disabled
|
|
66
|
+
* `has-value` | Set when the element has a value
|
|
67
|
+
* `has-label` | Set when the element has a label
|
|
68
|
+
* `has-helper` | Set when the element has helper text or slot
|
|
69
|
+
* `has-error-message` | Set when the element has an error message
|
|
70
|
+
* `has-tooltip` | Set when the element has a slotted tooltip
|
|
71
|
+
* `invalid` | Set when the element is invalid
|
|
72
|
+
* `focused` | Set when the element is focused
|
|
73
|
+
* `focus-ring` | Set when the element is keyboard focused
|
|
74
|
+
* `readonly` | Set when the element is readonly
|
|
75
|
+
* `opened` | Set when the overlay is opened
|
|
76
|
+
* `week-numbers` | Set when week numbers are shown in the calendar
|
|
63
77
|
*
|
|
64
78
|
* ### Internal components
|
|
65
79
|
*
|
|
66
80
|
* In addition to `<vaadin-date-picker>` itself, the following internal
|
|
67
81
|
* components are themable:
|
|
68
82
|
*
|
|
69
|
-
* - `<vaadin-date-picker-overlay>` - has the same API as [`<vaadin-overlay>`](#/elements/vaadin-overlay).
|
|
70
83
|
* - `<vaadin-date-picker-overlay-content>`
|
|
71
84
|
* - `<vaadin-date-picker-month-scroller>`
|
|
72
85
|
* - `<vaadin-date-picker-year-scroller>`
|
|
73
86
|
* - `<vaadin-date-picker-year>`
|
|
74
87
|
* - `<vaadin-month-calendar>`
|
|
75
|
-
* - [`<vaadin-input-container>`](#/elements/vaadin-input-container) - an internal element wrapping the input.
|
|
76
88
|
*
|
|
77
89
|
* In order to style the overlay content, use `<vaadin-date-picker-overlay-content>` shadow DOM parts:
|
|
78
90
|
*
|
|
@@ -113,9 +125,6 @@ import { DatePickerMixin } from './vaadin-date-picker-mixin.js';
|
|
|
113
125
|
* `year-number` | Year number
|
|
114
126
|
* `year-separator` | Year separator
|
|
115
127
|
*
|
|
116
|
-
* Note: the `theme` attribute value set on `<vaadin-date-picker>` is
|
|
117
|
-
* propagated to the internal components listed above.
|
|
118
|
-
*
|
|
119
128
|
* See [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.
|
|
120
129
|
*
|
|
121
130
|
* ### Change events
|
|
@@ -196,8 +205,8 @@ class DatePicker extends DatePickerMixin(
|
|
|
196
205
|
>
|
|
197
206
|
<slot name="prefix" slot="prefix"></slot>
|
|
198
207
|
<slot name="input"></slot>
|
|
199
|
-
<div id="clearButton" part="clear-button" slot="suffix" aria-hidden="true"></div>
|
|
200
|
-
<div part="toggle-button" slot="suffix" aria-hidden="true" @click="${this._toggle}"></div>
|
|
208
|
+
<div id="clearButton" part="field-button clear-button" slot="suffix" aria-hidden="true"></div>
|
|
209
|
+
<div part="field-button toggle-button" slot="suffix" aria-hidden="true" @click="${this._toggle}"></div>
|
|
201
210
|
</vaadin-input-container>
|
|
202
211
|
|
|
203
212
|
<div part="helper-text">
|
|
@@ -264,7 +273,7 @@ class DatePicker extends DatePickerMixin(
|
|
|
264
273
|
|
|
265
274
|
this._positionTarget = this.shadowRoot.querySelector('[part="input-field"]');
|
|
266
275
|
|
|
267
|
-
const toggleButton = this.shadowRoot.querySelector('[part="toggle-button"]');
|
|
276
|
+
const toggleButton = this.shadowRoot.querySelector('[part="field-button toggle-button"]');
|
|
268
277
|
toggleButton.addEventListener('mousedown', (e) => e.preventDefault());
|
|
269
278
|
}
|
|
270
279
|
|
|
@@ -276,7 +285,8 @@ class DatePicker extends DatePickerMixin(
|
|
|
276
285
|
/** @private */
|
|
277
286
|
_onVaadinOverlayClose(e) {
|
|
278
287
|
// Prevent closing the overlay on label element click
|
|
279
|
-
|
|
288
|
+
const event = e.detail.sourceEvent;
|
|
289
|
+
if (event && event.composedPath().includes(this) && !event.composedPath().includes(this._overlayElement)) {
|
|
280
290
|
e.preventDefault();
|
|
281
291
|
}
|
|
282
292
|
}
|
|
@@ -8,7 +8,7 @@ import { defineCustomElement } from '@vaadin/component-base/src/define.js';
|
|
|
8
8
|
import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
|
|
9
9
|
import { LumoInjectionMixin } from '@vaadin/vaadin-themable-mixin/lumo-injection-mixin.js';
|
|
10
10
|
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
11
|
-
import { monthCalendarStyles } from './styles/vaadin-month-calendar-
|
|
11
|
+
import { monthCalendarStyles } from './styles/vaadin-month-calendar-base-styles.js';
|
|
12
12
|
import { MonthCalendarMixin } from './vaadin-month-calendar-mixin.js';
|
|
13
13
|
|
|
14
14
|
/**
|
package/vaadin-date-picker.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import './
|
|
1
|
+
import './src/vaadin-date-picker.js';
|
|
2
2
|
export * from './src/vaadin-date-picker.js';
|