@vaadin/date-picker 23.3.3 → 24.0.0-alpha10
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 +16 -2
- package/src/vaadin-date-picker-light.d.ts +1 -7
- package/src/vaadin-date-picker-light.js +12 -50
- package/src/vaadin-date-picker-mixin.d.ts +4 -18
- package/src/vaadin-date-picker-mixin.js +121 -83
- package/src/vaadin-date-picker-month-scroller.js +74 -0
- package/src/vaadin-date-picker-overlay-content.js +268 -208
- package/src/vaadin-date-picker-overlay.js +19 -8
- 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 +24 -12
- package/src/vaadin-date-picker.js +43 -39
- package/src/vaadin-infinite-scroller.js +98 -101
- package/src/vaadin-month-calendar.js +37 -14
- 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 +145 -5
- package/web-types.lit.json +61 -5
- package/src/vaadin-date-picker-styles.js +0 -28
|
@@ -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,15 +1,37 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/web-types",
|
|
3
3
|
"name": "@vaadin/date-picker",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "24.0.0-alpha10",
|
|
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
|
+
{
|
|
14
|
+
"name": "disabled",
|
|
15
|
+
"description": "If true, the user cannot interact with this element.",
|
|
16
|
+
"value": {
|
|
17
|
+
"type": [
|
|
18
|
+
"boolean",
|
|
19
|
+
"null",
|
|
20
|
+
"undefined"
|
|
21
|
+
]
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"name": "autofocus",
|
|
26
|
+
"description": "Specify that this control should have input focus when the page loads.",
|
|
27
|
+
"value": {
|
|
28
|
+
"type": [
|
|
29
|
+
"boolean",
|
|
30
|
+
"null",
|
|
31
|
+
"undefined"
|
|
32
|
+
]
|
|
33
|
+
}
|
|
34
|
+
},
|
|
13
35
|
{
|
|
14
36
|
"name": "value",
|
|
15
37
|
"description": "Selected date.\n\nSupported date formats:\n- ISO 8601 `\"YYYY-MM-DD\"` (default)\n- 6-digit extended ISO 8601 `\"+YYYYYY-MM-DD\"`, `\"-YYYYYY-MM-DD\"`",
|
|
@@ -19,6 +41,39 @@
|
|
|
19
41
|
]
|
|
20
42
|
}
|
|
21
43
|
},
|
|
44
|
+
{
|
|
45
|
+
"name": "invalid",
|
|
46
|
+
"description": "Set to true when the field is invalid.",
|
|
47
|
+
"value": {
|
|
48
|
+
"type": [
|
|
49
|
+
"boolean",
|
|
50
|
+
"null",
|
|
51
|
+
"undefined"
|
|
52
|
+
]
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
"name": "required",
|
|
57
|
+
"description": "Specifies that the user must fill in a value.",
|
|
58
|
+
"value": {
|
|
59
|
+
"type": [
|
|
60
|
+
"boolean",
|
|
61
|
+
"null",
|
|
62
|
+
"undefined"
|
|
63
|
+
]
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
"name": "overlay-class",
|
|
68
|
+
"description": "A space-delimited list of CSS class names to set on the overlay element.\nThis property does not affect other CSS class names set manually via JS.\n\nNote, if the CSS class name was set with this property, clearing it will\nremove it from the overlay, even if the same class name was also added\nmanually, e.g. by using `classList.add()` in the `renderer` function.",
|
|
69
|
+
"value": {
|
|
70
|
+
"type": [
|
|
71
|
+
"string",
|
|
72
|
+
"null",
|
|
73
|
+
"undefined"
|
|
74
|
+
]
|
|
75
|
+
}
|
|
76
|
+
},
|
|
22
77
|
{
|
|
23
78
|
"name": "initial-position",
|
|
24
79
|
"description": "Date which should be visible when there is no value selected.\n\nThe same date formats as for the `value` property are supported.",
|
|
@@ -106,6 +161,28 @@
|
|
|
106
161
|
],
|
|
107
162
|
"js": {
|
|
108
163
|
"properties": [
|
|
164
|
+
{
|
|
165
|
+
"name": "disabled",
|
|
166
|
+
"description": "If true, the user cannot interact with this element.",
|
|
167
|
+
"value": {
|
|
168
|
+
"type": [
|
|
169
|
+
"boolean",
|
|
170
|
+
"null",
|
|
171
|
+
"undefined"
|
|
172
|
+
]
|
|
173
|
+
}
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
"name": "autofocus",
|
|
177
|
+
"description": "Specify that this control should have input focus when the page loads.",
|
|
178
|
+
"value": {
|
|
179
|
+
"type": [
|
|
180
|
+
"boolean",
|
|
181
|
+
"null",
|
|
182
|
+
"undefined"
|
|
183
|
+
]
|
|
184
|
+
}
|
|
185
|
+
},
|
|
109
186
|
{
|
|
110
187
|
"name": "value",
|
|
111
188
|
"description": "Selected date.\n\nSupported date formats:\n- ISO 8601 `\"YYYY-MM-DD\"` (default)\n- 6-digit extended ISO 8601 `\"+YYYYYY-MM-DD\"`, `\"-YYYYYY-MM-DD\"`",
|
|
@@ -115,6 +192,39 @@
|
|
|
115
192
|
]
|
|
116
193
|
}
|
|
117
194
|
},
|
|
195
|
+
{
|
|
196
|
+
"name": "invalid",
|
|
197
|
+
"description": "Set to true when the field is invalid.",
|
|
198
|
+
"value": {
|
|
199
|
+
"type": [
|
|
200
|
+
"boolean",
|
|
201
|
+
"null",
|
|
202
|
+
"undefined"
|
|
203
|
+
]
|
|
204
|
+
}
|
|
205
|
+
},
|
|
206
|
+
{
|
|
207
|
+
"name": "required",
|
|
208
|
+
"description": "Specifies that the user must fill in a value.",
|
|
209
|
+
"value": {
|
|
210
|
+
"type": [
|
|
211
|
+
"boolean",
|
|
212
|
+
"null",
|
|
213
|
+
"undefined"
|
|
214
|
+
]
|
|
215
|
+
}
|
|
216
|
+
},
|
|
217
|
+
{
|
|
218
|
+
"name": "overlayClass",
|
|
219
|
+
"description": "A space-delimited list of CSS class names to set on the overlay element.\nThis property does not affect other CSS class names set manually via JS.\n\nNote, if the CSS class name was set with this property, clearing it will\nremove it from the overlay, even if the same class name was also added\nmanually, e.g. by using `classList.add()` in the `renderer` function.",
|
|
220
|
+
"value": {
|
|
221
|
+
"type": [
|
|
222
|
+
"string",
|
|
223
|
+
"null",
|
|
224
|
+
"undefined"
|
|
225
|
+
]
|
|
226
|
+
}
|
|
227
|
+
},
|
|
118
228
|
{
|
|
119
229
|
"name": "initialPosition",
|
|
120
230
|
"description": "Date which should be visible when there is no value selected.\n\nThe same date formats as for the `value` property are supported.",
|
|
@@ -161,7 +271,7 @@
|
|
|
161
271
|
},
|
|
162
272
|
{
|
|
163
273
|
"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 //
|
|
274
|
+
"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
275
|
"value": {
|
|
166
276
|
"type": [
|
|
167
277
|
"DatePickerI18n"
|
|
@@ -199,6 +309,10 @@
|
|
|
199
309
|
}
|
|
200
310
|
],
|
|
201
311
|
"events": [
|
|
312
|
+
{
|
|
313
|
+
"name": "validated",
|
|
314
|
+
"description": "Fired whenever the field is validated."
|
|
315
|
+
},
|
|
202
316
|
{
|
|
203
317
|
"name": "change",
|
|
204
318
|
"description": "Fired when the user commits a value change."
|
|
@@ -210,13 +324,17 @@
|
|
|
210
324
|
{
|
|
211
325
|
"name": "value-changed",
|
|
212
326
|
"description": "Fired when `value` property value changes."
|
|
327
|
+
},
|
|
328
|
+
{
|
|
329
|
+
"name": "invalid-changed",
|
|
330
|
+
"description": "Fired when the `invalid` property changes."
|
|
213
331
|
}
|
|
214
332
|
]
|
|
215
333
|
}
|
|
216
334
|
},
|
|
217
335
|
{
|
|
218
336
|
"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/
|
|
337
|
+
"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-alpha10/#/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-alpha10/#/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-alpha10/#/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-alpha10/#/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
338
|
"attributes": [
|
|
221
339
|
{
|
|
222
340
|
"name": "disabled",
|
|
@@ -381,6 +499,17 @@
|
|
|
381
499
|
]
|
|
382
500
|
}
|
|
383
501
|
},
|
|
502
|
+
{
|
|
503
|
+
"name": "overlay-class",
|
|
504
|
+
"description": "A space-delimited list of CSS class names to set on the overlay element.\nThis property does not affect other CSS class names set manually via JS.\n\nNote, if the CSS class name was set with this property, clearing it will\nremove it from the overlay, even if the same class name was also added\nmanually, e.g. by using `classList.add()` in the `renderer` function.",
|
|
505
|
+
"value": {
|
|
506
|
+
"type": [
|
|
507
|
+
"string",
|
|
508
|
+
"null",
|
|
509
|
+
"undefined"
|
|
510
|
+
]
|
|
511
|
+
}
|
|
512
|
+
},
|
|
384
513
|
{
|
|
385
514
|
"name": "initial-position",
|
|
386
515
|
"description": "Date which should be visible when there is no value selected.\n\nThe same date formats as for the `value` property are supported.",
|
|
@@ -622,6 +751,17 @@
|
|
|
622
751
|
]
|
|
623
752
|
}
|
|
624
753
|
},
|
|
754
|
+
{
|
|
755
|
+
"name": "overlayClass",
|
|
756
|
+
"description": "A space-delimited list of CSS class names to set on the overlay element.\nThis property does not affect other CSS class names set manually via JS.\n\nNote, if the CSS class name was set with this property, clearing it will\nremove it from the overlay, even if the same class name was also added\nmanually, e.g. by using `classList.add()` in the `renderer` function.",
|
|
757
|
+
"value": {
|
|
758
|
+
"type": [
|
|
759
|
+
"string",
|
|
760
|
+
"null",
|
|
761
|
+
"undefined"
|
|
762
|
+
]
|
|
763
|
+
}
|
|
764
|
+
},
|
|
625
765
|
{
|
|
626
766
|
"name": "initialPosition",
|
|
627
767
|
"description": "Date which should be visible when there is no value selected.\n\nThe same date formats as for the `value` property are supported.",
|
|
@@ -668,7 +808,7 @@
|
|
|
668
808
|
},
|
|
669
809
|
{
|
|
670
810
|
"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 //
|
|
811
|
+
"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
812
|
"value": {
|
|
673
813
|
"type": [
|
|
674
814
|
"DatePickerI18n"
|