@vaadin/date-picker 23.3.0-alpha5 → 24.0.0-alpha2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +10 -10
- package/src/vaadin-date-picker-helper.d.ts +7 -0
- package/src/vaadin-date-picker-helper.js +14 -0
- package/src/vaadin-date-picker-light.d.ts +0 -6
- package/src/vaadin-date-picker-light.js +4 -42
- package/src/vaadin-date-picker-mixin.d.ts +0 -9
- package/src/vaadin-date-picker-mixin.js +72 -51
- package/src/vaadin-date-picker-month-scroller.js +74 -0
- package/src/vaadin-date-picker-overlay-content.js +238 -166
- package/src/vaadin-date-picker-overlay.js +18 -7
- package/src/vaadin-date-picker-year-scroller.js +104 -0
- package/src/vaadin-date-picker-year.js +57 -0
- package/src/vaadin-date-picker.d.ts +23 -11
- package/src/vaadin-date-picker.js +42 -38
- package/src/vaadin-infinite-scroller.js +30 -33
- package/src/vaadin-month-calendar.js +31 -8
- package/theme/lumo/vaadin-date-picker-overlay-content-styles.js +13 -50
- package/theme/lumo/vaadin-date-picker-year-styles.js +32 -0
- package/theme/lumo/vaadin-month-calendar-styles.js +16 -16
- package/theme/material/vaadin-date-picker-overlay-content-styles.js +10 -31
- package/theme/material/vaadin-date-picker-year-styles.js +28 -0
- package/theme/material/vaadin-month-calendar-styles.js +14 -14
- package/web-types.json +5 -5
- package/web-types.lit.json +5 -5
- package/src/vaadin-date-picker-styles.js +0 -28
|
@@ -4,6 +4,7 @@ import '@vaadin/vaadin-lumo-styles/spacing.js';
|
|
|
4
4
|
import '@vaadin/vaadin-lumo-styles/style.js';
|
|
5
5
|
import '@vaadin/vaadin-lumo-styles/typography.js';
|
|
6
6
|
import '@vaadin/button/theme/lumo/vaadin-button.js';
|
|
7
|
+
import './vaadin-date-picker-year-styles.js';
|
|
7
8
|
import { css, registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
8
9
|
|
|
9
10
|
registerStyles(
|
|
@@ -19,9 +20,7 @@ registerStyles(
|
|
|
19
20
|
cursor: default;
|
|
20
21
|
}
|
|
21
22
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
[part='months'] {
|
|
23
|
+
::slotted([slot='months']) {
|
|
25
24
|
/* Month calendar height:
|
|
26
25
|
header height + margin-bottom
|
|
27
26
|
+ weekdays height + margin-bottom
|
|
@@ -43,8 +42,7 @@ registerStyles(
|
|
|
43
42
|
margin-right: 57px;
|
|
44
43
|
}
|
|
45
44
|
|
|
46
|
-
|
|
47
|
-
[part='years'] {
|
|
45
|
+
::slotted([slot='years']) {
|
|
48
46
|
/* TODO get rid of fixed magic number */
|
|
49
47
|
--vaadin-infinite-scroller-buffer-width: 97px;
|
|
50
48
|
width: 57px;
|
|
@@ -58,15 +56,8 @@ registerStyles(
|
|
|
58
56
|
cursor: var(--lumo-clickable-cursor);
|
|
59
57
|
}
|
|
60
58
|
|
|
61
|
-
[
|
|
62
|
-
|
|
63
|
-
opacity: 0.7;
|
|
64
|
-
transition: 0.2s opacity;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
[part='years']:hover [part='year-number'],
|
|
68
|
-
[part='years']:hover [part='year-separator'] {
|
|
69
|
-
opacity: 1;
|
|
59
|
+
::slotted([slot='years']:hover) {
|
|
60
|
+
--_lumo-date-picker-year-opacity: 1;
|
|
70
61
|
}
|
|
71
62
|
|
|
72
63
|
/* TODO unsupported selector */
|
|
@@ -75,14 +66,13 @@ registerStyles(
|
|
|
75
66
|
display: block;
|
|
76
67
|
}
|
|
77
68
|
|
|
78
|
-
/* TODO
|
|
79
|
-
|
|
80
|
-
#scrollers[desktop] [part='months'] {
|
|
69
|
+
/* TODO fix this in vaadin-date-picker that it adapts to the width of the year scroller */
|
|
70
|
+
:host([desktop]) ::slotted([slot='months']) {
|
|
81
71
|
right: auto;
|
|
82
72
|
}
|
|
83
73
|
|
|
84
74
|
/* Year scroller position indicator */
|
|
85
|
-
[
|
|
75
|
+
::slotted([slot='years'])::before {
|
|
86
76
|
border: none;
|
|
87
77
|
width: 1em;
|
|
88
78
|
height: 1em;
|
|
@@ -94,37 +84,13 @@ registerStyles(
|
|
|
94
84
|
z-index: 1;
|
|
95
85
|
}
|
|
96
86
|
|
|
97
|
-
[part='year-number'],
|
|
98
|
-
[part='year-separator'] {
|
|
99
|
-
display: flex;
|
|
100
|
-
align-items: center;
|
|
101
|
-
justify-content: center;
|
|
102
|
-
height: 50%;
|
|
103
|
-
transform: translateY(-50%);
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
[part='years'] [part='year-separator']::after {
|
|
107
|
-
color: var(--lumo-disabled-text-color);
|
|
108
|
-
content: '•';
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
/* Current year */
|
|
112
|
-
|
|
113
|
-
[part='years'] [part='year-number'][current] {
|
|
114
|
-
color: var(--lumo-primary-text-color);
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
/* Toolbar (footer) */
|
|
118
|
-
|
|
119
87
|
[part='toolbar'] {
|
|
120
88
|
padding: var(--lumo-space-s);
|
|
121
89
|
border-bottom-left-radius: var(--lumo-border-radius-l);
|
|
122
90
|
margin-right: 57px;
|
|
123
91
|
}
|
|
124
92
|
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
[part='toolbar'] [part\$='button'] {
|
|
93
|
+
[part='toolbar'] ::slotted(vaadin-button) {
|
|
128
94
|
margin: 0;
|
|
129
95
|
}
|
|
130
96
|
|
|
@@ -177,22 +143,19 @@ registerStyles(
|
|
|
177
143
|
background-image: none;
|
|
178
144
|
}
|
|
179
145
|
|
|
180
|
-
[part='years'] {
|
|
181
|
-
background-color: var(--lumo-shade-5pct);
|
|
182
|
-
}
|
|
183
|
-
|
|
184
146
|
[part='toolbar'],
|
|
185
|
-
[
|
|
147
|
+
::slotted([slot='months']) {
|
|
186
148
|
margin-right: 0;
|
|
187
149
|
}
|
|
188
150
|
|
|
189
151
|
/* TODO make date-picker adapt to the width of the years part */
|
|
190
|
-
[
|
|
152
|
+
::slotted([slot='years']) {
|
|
191
153
|
--vaadin-infinite-scroller-buffer-width: 90px;
|
|
192
154
|
width: 50px;
|
|
155
|
+
background-color: var(--lumo-shade-5pct);
|
|
193
156
|
}
|
|
194
157
|
|
|
195
|
-
:host([years-visible]) [
|
|
158
|
+
:host([years-visible]) ::slotted([slot='months']) {
|
|
196
159
|
padding-left: 50px;
|
|
197
160
|
}
|
|
198
161
|
}
|
|
@@ -0,0 +1,32 @@
|
|
|
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: '•';
|
|
29
|
+
}
|
|
30
|
+
`,
|
|
31
|
+
{ moduleId: 'lumo-date-picker-year' },
|
|
32
|
+
);
|
|
@@ -50,7 +50,7 @@ registerStyles(
|
|
|
50
50
|
|
|
51
51
|
/* Date and week number cells */
|
|
52
52
|
|
|
53
|
-
[part
|
|
53
|
+
[part~='date'],
|
|
54
54
|
[part='week-number'] {
|
|
55
55
|
box-sizing: border-box;
|
|
56
56
|
display: inline-flex;
|
|
@@ -60,28 +60,28 @@ registerStyles(
|
|
|
60
60
|
position: relative;
|
|
61
61
|
}
|
|
62
62
|
|
|
63
|
-
[part
|
|
63
|
+
[part~='date'] {
|
|
64
64
|
transition: color 0.1s;
|
|
65
65
|
}
|
|
66
66
|
|
|
67
|
-
[part
|
|
67
|
+
[part~='date']:not(:empty) {
|
|
68
68
|
cursor: var(--lumo-clickable-cursor);
|
|
69
69
|
}
|
|
70
70
|
|
|
71
71
|
:host([week-numbers]) [part='weekday']:not(:empty),
|
|
72
|
-
:host([week-numbers]) [part
|
|
72
|
+
:host([week-numbers]) [part~='date'] {
|
|
73
73
|
width: calc((100% - var(--lumo-size-xs)) / 7);
|
|
74
74
|
}
|
|
75
75
|
|
|
76
76
|
/* Today date */
|
|
77
77
|
|
|
78
|
-
[part
|
|
78
|
+
[part~='date'][part~='today'] {
|
|
79
79
|
color: var(--lumo-primary-text-color);
|
|
80
80
|
}
|
|
81
81
|
|
|
82
82
|
/* Focused date */
|
|
83
83
|
|
|
84
|
-
[part
|
|
84
|
+
[part~='date']::before {
|
|
85
85
|
content: '';
|
|
86
86
|
position: absolute;
|
|
87
87
|
z-index: -1;
|
|
@@ -97,11 +97,11 @@ registerStyles(
|
|
|
97
97
|
border-radius: var(--lumo-border-radius-m);
|
|
98
98
|
}
|
|
99
99
|
|
|
100
|
-
[part
|
|
100
|
+
[part~='date'][part~='focused']::before {
|
|
101
101
|
box-shadow: 0 0 0 1px var(--lumo-base-color), 0 0 0 3px var(--lumo-primary-color-50pct);
|
|
102
102
|
}
|
|
103
103
|
|
|
104
|
-
:host(:not([focused])) [part
|
|
104
|
+
:host(:not([focused])) [part~='date'][part~='focused']::before {
|
|
105
105
|
animation: vaadin-date-picker-month-calendar-focus-date 1.4s infinite;
|
|
106
106
|
}
|
|
107
107
|
|
|
@@ -111,33 +111,33 @@ registerStyles(
|
|
|
111
111
|
}
|
|
112
112
|
}
|
|
113
113
|
|
|
114
|
-
[part
|
|
114
|
+
[part~='date']:not(:empty):not([part~='disabled']):not([part~='selected']):hover::before {
|
|
115
115
|
background-color: var(--lumo-primary-color-10pct);
|
|
116
116
|
}
|
|
117
117
|
|
|
118
|
-
[part
|
|
118
|
+
[part~='date'][part~='selected'] {
|
|
119
119
|
color: var(--lumo-primary-contrast-color);
|
|
120
120
|
}
|
|
121
121
|
|
|
122
|
-
[part
|
|
122
|
+
[part~='date'][part~='selected']::before {
|
|
123
123
|
background-color: var(--lumo-primary-color);
|
|
124
124
|
}
|
|
125
125
|
|
|
126
|
-
[part
|
|
126
|
+
[part~='date'][part~='disabled'] {
|
|
127
127
|
color: var(--lumo-disabled-text-color);
|
|
128
128
|
}
|
|
129
129
|
|
|
130
130
|
@media (pointer: coarse) {
|
|
131
|
-
[part
|
|
132
|
-
[part
|
|
131
|
+
[part~='date']:hover:not([part~='selected'])::before,
|
|
132
|
+
[part~='focused']:not([part~='selected'])::before {
|
|
133
133
|
display: none;
|
|
134
134
|
}
|
|
135
135
|
|
|
136
|
-
[part
|
|
136
|
+
[part~='date']:not(:empty):not([part~='disabled']):active::before {
|
|
137
137
|
display: block;
|
|
138
138
|
}
|
|
139
139
|
|
|
140
|
-
[part
|
|
140
|
+
[part~='date'][part~='selected']::before {
|
|
141
141
|
box-shadow: none;
|
|
142
142
|
}
|
|
143
143
|
}
|
|
@@ -3,6 +3,7 @@ import '@vaadin/vaadin-material-styles/font-icons.js';
|
|
|
3
3
|
import '@vaadin/vaadin-material-styles/typography.js';
|
|
4
4
|
import '@vaadin/vaadin-material-styles/shadow.js';
|
|
5
5
|
import '@vaadin/button/theme/material/vaadin-button.js';
|
|
6
|
+
import './vaadin-date-picker-year-styles.js';
|
|
6
7
|
import { css, registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
7
8
|
|
|
8
9
|
registerStyles(
|
|
@@ -20,13 +21,10 @@ registerStyles(
|
|
|
20
21
|
position: absolute;
|
|
21
22
|
}
|
|
22
23
|
|
|
23
|
-
/* Fullscreen Toolbar */
|
|
24
|
-
|
|
25
24
|
[part='overlay-header'] {
|
|
26
25
|
display: flex;
|
|
27
26
|
align-items: baseline;
|
|
28
27
|
position: relative;
|
|
29
|
-
z-index: 2;
|
|
30
28
|
color: var(--material-body-text-color);
|
|
31
29
|
background: var(--material-secondary-background-color);
|
|
32
30
|
border-bottom: 2px solid var(--material-primary-color);
|
|
@@ -89,24 +87,21 @@ registerStyles(
|
|
|
89
87
|
transform: rotate(90deg);
|
|
90
88
|
}
|
|
91
89
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
[part='months'] {
|
|
90
|
+
::slotted([slot='months']) {
|
|
95
91
|
--vaadin-infinite-scroller-item-height: 328px;
|
|
96
92
|
text-align: center;
|
|
97
93
|
}
|
|
98
94
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
[part='years'] {
|
|
102
|
-
z-index: 1;
|
|
95
|
+
::slotted([slot='years']) {
|
|
103
96
|
background: var(--material-secondary-text-color);
|
|
104
97
|
color: var(--material-background-color);
|
|
98
|
+
font-size: var(--material-body-font-size);
|
|
99
|
+
font-weight: 400;
|
|
100
|
+
line-height: 1.4;
|
|
105
101
|
text-align: center;
|
|
106
102
|
}
|
|
107
103
|
|
|
108
|
-
[
|
|
109
|
-
z-index: 2;
|
|
104
|
+
::slotted([slot='years'])::before {
|
|
110
105
|
border: 0;
|
|
111
106
|
width: 8px;
|
|
112
107
|
height: 8px;
|
|
@@ -114,21 +109,6 @@ registerStyles(
|
|
|
114
109
|
background: var(--material-background-color);
|
|
115
110
|
}
|
|
116
111
|
|
|
117
|
-
[part='year-number'] {
|
|
118
|
-
font-size: var(--material-small-font-size);
|
|
119
|
-
line-height: 10px; /* NOTE(platosha): chosen to align years to months */
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
[part='year-separator'] {
|
|
123
|
-
background-color: currentColor;
|
|
124
|
-
width: 4px;
|
|
125
|
-
height: 4px;
|
|
126
|
-
border-radius: 50%;
|
|
127
|
-
margin: calc(0.5 * var(--vaadin-infinite-scroller-item-height, 80px) - 0.5 * 10px - 0.5 * 4px) auto;
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
/* Bottom Bar */
|
|
131
|
-
|
|
132
112
|
[part='toolbar'] {
|
|
133
113
|
display: flex;
|
|
134
114
|
justify-content: flex-end;
|
|
@@ -136,16 +116,15 @@ registerStyles(
|
|
|
136
116
|
border-top: 1px solid var(--material-divider-color);
|
|
137
117
|
}
|
|
138
118
|
|
|
139
|
-
[
|
|
119
|
+
::slotted([slot='cancel-button']) {
|
|
140
120
|
order: 1;
|
|
141
121
|
}
|
|
142
122
|
|
|
143
|
-
[
|
|
123
|
+
::slotted([slot='today-button']) {
|
|
144
124
|
order: 2;
|
|
145
125
|
}
|
|
146
126
|
|
|
147
|
-
|
|
148
|
-
[part='cancel-button'] {
|
|
127
|
+
::slotted(vaadin-button) {
|
|
149
128
|
margin: 0 4px;
|
|
150
129
|
}
|
|
151
130
|
`,
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import '@vaadin/vaadin-material-styles/typography.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
|
+
[part='year-number'] {
|
|
8
|
+
font-size: var(--material-small-font-size);
|
|
9
|
+
line-height: 10px; /* NOTE(platosha): chosen to align years to months */
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
[part='year-separator'] {
|
|
13
|
+
display: flex;
|
|
14
|
+
align-items: center;
|
|
15
|
+
justify-content: center;
|
|
16
|
+
height: calc(100% - 10px);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
[part='year-separator']::before {
|
|
20
|
+
content: '';
|
|
21
|
+
background-color: currentColor;
|
|
22
|
+
width: 4px;
|
|
23
|
+
height: 4px;
|
|
24
|
+
border-radius: 50%;
|
|
25
|
+
}
|
|
26
|
+
`,
|
|
27
|
+
{ moduleId: 'material-date-picker-year' },
|
|
28
|
+
);
|
|
@@ -35,7 +35,7 @@ registerStyles(
|
|
|
35
35
|
color: var(--material-disabled-text-color);
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
-
[part
|
|
38
|
+
[part~='date'] {
|
|
39
39
|
position: relative;
|
|
40
40
|
font-size: var(--material-body-font-size);
|
|
41
41
|
line-height: 42px;
|
|
@@ -43,7 +43,7 @@ registerStyles(
|
|
|
43
43
|
cursor: default;
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
-
[part
|
|
46
|
+
[part~='date']::after {
|
|
47
47
|
content: '';
|
|
48
48
|
position: absolute;
|
|
49
49
|
z-index: -4;
|
|
@@ -59,13 +59,13 @@ registerStyles(
|
|
|
59
59
|
|
|
60
60
|
/* Today */
|
|
61
61
|
|
|
62
|
-
[part
|
|
62
|
+
[part~='date'][part~='today'] {
|
|
63
63
|
color: var(--material-primary-text-color);
|
|
64
64
|
}
|
|
65
65
|
|
|
66
66
|
/* Hover */
|
|
67
67
|
|
|
68
|
-
[part
|
|
68
|
+
[part~='date']:not([part~='disabled']):hover::after {
|
|
69
69
|
background-color: var(--material-secondary-background-color);
|
|
70
70
|
border-color: var(--material-secondary-background-color);
|
|
71
71
|
z-index: -3;
|
|
@@ -73,7 +73,7 @@ registerStyles(
|
|
|
73
73
|
|
|
74
74
|
/* Hide for touch devices */
|
|
75
75
|
@media (hover: none) {
|
|
76
|
-
[part
|
|
76
|
+
[part~='date']:not([part~='disabled']):hover::after {
|
|
77
77
|
background-color: transparent;
|
|
78
78
|
border-color: transparent;
|
|
79
79
|
z-index: -4;
|
|
@@ -82,12 +82,12 @@ registerStyles(
|
|
|
82
82
|
|
|
83
83
|
/* Selected */
|
|
84
84
|
|
|
85
|
-
[part
|
|
85
|
+
[part~='date'][part~='selected'] {
|
|
86
86
|
font-weight: 500;
|
|
87
87
|
}
|
|
88
88
|
|
|
89
|
-
[part
|
|
90
|
-
[part
|
|
89
|
+
[part~='date']:not([part~='disabled'])[part~='selected']::after,
|
|
90
|
+
[part~='date'][part~='selected']::after {
|
|
91
91
|
background-color: transparent;
|
|
92
92
|
border-color: currentColor;
|
|
93
93
|
z-index: -2;
|
|
@@ -95,24 +95,24 @@ registerStyles(
|
|
|
95
95
|
|
|
96
96
|
/* Focused */
|
|
97
97
|
|
|
98
|
-
[part
|
|
99
|
-
[part
|
|
98
|
+
[part~='date']:not([part~='disabled'])[part~='focused'],
|
|
99
|
+
[part~='date']:not([part~='disabled']):active {
|
|
100
100
|
color: var(--material-primary-contrast-color);
|
|
101
101
|
}
|
|
102
102
|
|
|
103
|
-
[part
|
|
104
|
-
[part
|
|
103
|
+
[part~='date']:not([part~='disabled'])[part~='focused']::after,
|
|
104
|
+
[part~='date']:not([part~='disabled']):active::after {
|
|
105
105
|
opacity: 0.7;
|
|
106
106
|
background-color: var(--material-primary-color);
|
|
107
107
|
border-color: var(--material-primary-color);
|
|
108
108
|
z-index: -1;
|
|
109
109
|
}
|
|
110
110
|
|
|
111
|
-
[part
|
|
111
|
+
[part~='date'][part~='disabled'] {
|
|
112
112
|
color: var(--material-disabled-text-color);
|
|
113
113
|
}
|
|
114
114
|
|
|
115
|
-
:host([focused]) [part
|
|
115
|
+
:host([focused]) [part~='date']:not([part~='disabled'])[part~='focused']::after {
|
|
116
116
|
opacity: 1;
|
|
117
117
|
}
|
|
118
118
|
`,
|
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": "
|
|
4
|
+
"version": "24.0.0-alpha2",
|
|
5
5
|
"description-markup": "markdown",
|
|
6
6
|
"contributions": {
|
|
7
7
|
"html": {
|
|
8
8
|
"elements": [
|
|
9
9
|
{
|
|
10
10
|
"name": "vaadin-date-picker-light",
|
|
11
|
-
"description": "`<vaadin-date-picker-light>` is a customizable version of the `<vaadin-date-picker>` providing\nonly the scrollable month calendar view and leaving the input field definition to the user.\n\nTo create a custom input field, you need to add a child element which has a two-way\ndata-bindable property representing the input value. The property name is expected\nto be `bindValue` by default. See the example below for a simplest possible example\nusing an `<input>` element.\n\n```html\n<vaadin-date-picker-light attr-for-value=\"value\">\n <input class=\"input\">\n</vaadin-date-picker-light>\n```\n\n### Styling\n\
|
|
11
|
+
"description": "`<vaadin-date-picker-light>` is a customizable version of the `<vaadin-date-picker>` providing\nonly the scrollable month calendar view and leaving the input field definition to the user.\n\nTo create a custom input field, you need to add a child element which has a two-way\ndata-bindable property representing the input value. The property name is expected\nto be `bindValue` by default. See the example below for a simplest possible example\nusing an `<input>` element.\n\n```html\n<vaadin-date-picker-light attr-for-value=\"value\">\n <input class=\"input\">\n</vaadin-date-picker-light>\n```\n\n### Styling\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/custom-theme/styling-components) documentation.\n\nIn addition to `<vaadin-date-picker-light>` itself, the following\ninternal components are themable:\n\n- `<vaadin-date-picker-overlay>`\n- `<vaadin-date-picker-overlay-content>`\n- `<vaadin-month-calendar>`\n\nNote: the `theme` attribute value set on `<vaadin-date-picker-light>`\nis propagated to the internal themable components listed above.",
|
|
12
12
|
"attributes": [
|
|
13
13
|
{
|
|
14
14
|
"name": "value",
|
|
@@ -161,7 +161,7 @@
|
|
|
161
161
|
},
|
|
162
162
|
{
|
|
163
163
|
"name": "i18n",
|
|
164
|
-
"description": "The object used to localize this component.\nTo change the default localization, replace the entire\n`i18n` object with a custom one.\n\nTo update individual properties, extend the existing i18n object like so:\n```\ndatePicker.i18n = { ...datePicker.i18n, {\n formatDate: date => { ... },\n parseDate: value => { ... },\n}};\n```\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 //
|
|
164
|
+
"description": "The object used to localize this component.\nTo change the default localization, replace the entire\n`i18n` object with a custom one.\n\nTo update individual properties, extend the existing i18n object like so:\n```\ndatePicker.i18n = { ...datePicker.i18n, {\n formatDate: date => { ... },\n parseDate: value => { ... },\n}};\n```\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```",
|
|
165
165
|
"value": {
|
|
166
166
|
"type": [
|
|
167
167
|
"DatePickerI18n"
|
|
@@ -216,7 +216,7 @@
|
|
|
216
216
|
},
|
|
217
217
|
{
|
|
218
218
|
"name": "vaadin-date-picker",
|
|
219
|
-
"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/
|
|
219
|
+
"description": "`<vaadin-date-picker>` is an input field that allows to enter a date by typing or by selecting from a calendar overlay.\n\n```html\n<vaadin-date-picker label=\"Birthday\"></vaadin-date-picker>\n```\n```js\ndatePicker.value = '2016-03-02';\n```\n\nWhen the selected `value` is changed, a `value-changed` event is triggered.\n\n### Styling\n\nThe following custom properties are available for styling:\n\nCustom property | Description | Default\n-------------------------------|----------------------------|---------\n`--vaadin-field-default-width` | Default width of the field | `12em`\n\n`<vaadin-date-picker>` provides the same set of shadow DOM parts and state attributes as `<vaadin-text-field>`.\nSee [`<vaadin-text-field>`](https://cdn.vaadin.com/vaadin-web-components/24.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\nIf you want to replace the default `<input>` and its container with a custom implementation to get full control\nover the input field, consider using the [`<vaadin-date-picker-light>`](https://cdn.vaadin.com/vaadin-web-components/24.0.0-alpha2/#/elements/vaadin-date-picker-light) element.\n\n### Internal components\n\nIn addition to `<vaadin-date-picker>` itself, the following internal\ncomponents are themable:\n\n- `<vaadin-date-picker-overlay>` - has the same API as [`<vaadin-overlay>`](https://cdn.vaadin.com/vaadin-web-components/24.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/24.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\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/custom-theme/styling-components) documentation.",
|
|
220
220
|
"attributes": [
|
|
221
221
|
{
|
|
222
222
|
"name": "disabled",
|
|
@@ -668,7 +668,7 @@
|
|
|
668
668
|
},
|
|
669
669
|
{
|
|
670
670
|
"name": "i18n",
|
|
671
|
-
"description": "The object used to localize this component.\nTo change the default localization, replace the entire\n`i18n` object with a custom one.\n\nTo update individual properties, extend the existing i18n object like so:\n```\ndatePicker.i18n = { ...datePicker.i18n, {\n formatDate: date => { ... },\n parseDate: value => { ... },\n}};\n```\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 //
|
|
671
|
+
"description": "The object used to localize this component.\nTo change the default localization, replace the entire\n`i18n` object with a custom one.\n\nTo update individual properties, extend the existing i18n object like so:\n```\ndatePicker.i18n = { ...datePicker.i18n, {\n formatDate: date => { ... },\n parseDate: value => { ... },\n}};\n```\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```",
|
|
672
672
|
"value": {
|
|
673
673
|
"type": [
|
|
674
674
|
"DatePickerI18n"
|