@vaadin/date-picker 24.5.0-alpha9 → 24.5.0-rc1
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 +12 -12
- package/src/vaadin-date-picker-helper.js +13 -5
- package/src/vaadin-date-picker-overlay-mixin.js +43 -0
- package/src/vaadin-date-picker-overlay.js +3 -5
- package/src/vaadin-date-picker.d.ts +2 -0
- package/src/vaadin-date-picker.js +2 -0
- package/src/vaadin-lit-date-picker-overlay.js +3 -5
- package/src/vaadin-lit-month-calendar.js +5 -1
- package/src/vaadin-month-calendar.js +11 -1
- package/theme/lumo/vaadin-date-picker-styles.js +0 -4
- package/theme/lumo/vaadin-month-calendar-styles.js +2 -17
- package/web-types.json +2 -2
- package/web-types.lit.json +2 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vaadin/date-picker",
|
|
3
|
-
"version": "24.5.0-
|
|
3
|
+
"version": "24.5.0-rc1",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -36,19 +36,19 @@
|
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"@open-wc/dedupe-mixin": "^1.3.0",
|
|
38
38
|
"@polymer/polymer": "^3.2.0",
|
|
39
|
-
"@vaadin/a11y-base": "24.5.0-
|
|
40
|
-
"@vaadin/button": "24.5.0-
|
|
41
|
-
"@vaadin/component-base": "24.5.0-
|
|
42
|
-
"@vaadin/field-base": "24.5.0-
|
|
43
|
-
"@vaadin/input-container": "24.5.0-
|
|
44
|
-
"@vaadin/overlay": "24.5.0-
|
|
45
|
-
"@vaadin/vaadin-lumo-styles": "24.5.0-
|
|
46
|
-
"@vaadin/vaadin-material-styles": "24.5.0-
|
|
47
|
-
"@vaadin/vaadin-themable-mixin": "24.5.0-
|
|
39
|
+
"@vaadin/a11y-base": "24.5.0-rc1",
|
|
40
|
+
"@vaadin/button": "24.5.0-rc1",
|
|
41
|
+
"@vaadin/component-base": "24.5.0-rc1",
|
|
42
|
+
"@vaadin/field-base": "24.5.0-rc1",
|
|
43
|
+
"@vaadin/input-container": "24.5.0-rc1",
|
|
44
|
+
"@vaadin/overlay": "24.5.0-rc1",
|
|
45
|
+
"@vaadin/vaadin-lumo-styles": "24.5.0-rc1",
|
|
46
|
+
"@vaadin/vaadin-material-styles": "24.5.0-rc1",
|
|
47
|
+
"@vaadin/vaadin-themable-mixin": "24.5.0-rc1",
|
|
48
48
|
"lit": "^3.0.0"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
|
-
"@vaadin/chai-plugins": "24.5.0-
|
|
51
|
+
"@vaadin/chai-plugins": "24.5.0-rc1",
|
|
52
52
|
"@vaadin/testing-helpers": "^1.0.0",
|
|
53
53
|
"sinon": "^18.0.0"
|
|
54
54
|
},
|
|
@@ -56,5 +56,5 @@
|
|
|
56
56
|
"web-types.json",
|
|
57
57
|
"web-types.lit.json"
|
|
58
58
|
],
|
|
59
|
-
"gitHead": "
|
|
59
|
+
"gitHead": "a8ae853ab69d7938cf507843784f1551a2eeb972"
|
|
60
60
|
}
|
|
@@ -36,6 +36,18 @@ export function getISOWeekNumber(date) {
|
|
|
36
36
|
return Math.floor(daysSinceFirstOfJanuary / 7 + 1);
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
+
/**
|
|
40
|
+
* Creates a new object with the same date, but sets the hours, minutes, seconds and milliseconds to 0.
|
|
41
|
+
*
|
|
42
|
+
* @param {Date} date
|
|
43
|
+
* @return {Date} The same date time elements set to 0.
|
|
44
|
+
*/
|
|
45
|
+
export function normalizeDate(date) {
|
|
46
|
+
const normalizedDate = new Date(date);
|
|
47
|
+
normalizedDate.setHours(0, 0, 0, 0);
|
|
48
|
+
return normalizedDate;
|
|
49
|
+
}
|
|
50
|
+
|
|
39
51
|
/**
|
|
40
52
|
* Check if two dates are equal.
|
|
41
53
|
*
|
|
@@ -45,11 +57,7 @@ export function getISOWeekNumber(date) {
|
|
|
45
57
|
*/
|
|
46
58
|
export function dateEquals(date1, date2) {
|
|
47
59
|
return (
|
|
48
|
-
date1 instanceof Date &&
|
|
49
|
-
date2 instanceof Date &&
|
|
50
|
-
date1.getFullYear() === date2.getFullYear() &&
|
|
51
|
-
date1.getMonth() === date2.getMonth() &&
|
|
52
|
-
date1.getDate() === date2.getDate()
|
|
60
|
+
date1 instanceof Date && date2 instanceof Date && normalizeDate(date1).getTime() === normalizeDate(date2).getTime()
|
|
53
61
|
);
|
|
54
62
|
}
|
|
55
63
|
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright (c) 2015 - 2024 Vaadin Ltd.
|
|
4
|
+
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
|
+
*/
|
|
6
|
+
import { isElementFocusable } from '@vaadin/a11y-base/src/focus-utils.js';
|
|
7
|
+
import { OverlayMixin } from '@vaadin/overlay/src/vaadin-overlay-mixin.js';
|
|
8
|
+
import { PositionMixin } from '@vaadin/overlay/src/vaadin-overlay-position-mixin.js';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* @polymerMixin
|
|
12
|
+
* @mixes OverlayMixin
|
|
13
|
+
* @mixes PositionMixin
|
|
14
|
+
*/
|
|
15
|
+
export const DatePickerOverlayMixin = (superClass) =>
|
|
16
|
+
class DatePickerOverlayMixin extends PositionMixin(OverlayMixin(superClass)) {
|
|
17
|
+
/**
|
|
18
|
+
* Override method inherited from `OverlayMixin` to not close on input click.
|
|
19
|
+
* Needed to ignore date-picker's own input in the mousedown listener below.
|
|
20
|
+
*
|
|
21
|
+
* @param {Event} event
|
|
22
|
+
* @return {boolean}
|
|
23
|
+
* @protected
|
|
24
|
+
*/
|
|
25
|
+
_shouldCloseOnOutsideClick(event) {
|
|
26
|
+
const eventPath = event.composedPath();
|
|
27
|
+
return !eventPath.includes(this.positionTarget);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* @protected
|
|
32
|
+
* @override
|
|
33
|
+
*/
|
|
34
|
+
_mouseDownListener(event) {
|
|
35
|
+
super._mouseDownListener(event);
|
|
36
|
+
|
|
37
|
+
// Prevent global mousedown event to avoid losing focus on outside click,
|
|
38
|
+
// unless the clicked element is also focusable (e.g. in date-time-picker).
|
|
39
|
+
if (this._shouldCloseOnOutsideClick(event) && !isElementFocusable(event.composedPath()[0])) {
|
|
40
|
+
event.preventDefault();
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
};
|
|
@@ -6,10 +6,9 @@
|
|
|
6
6
|
import { html, PolymerElement } from '@polymer/polymer/polymer-element.js';
|
|
7
7
|
import { defineCustomElement } from '@vaadin/component-base/src/define.js';
|
|
8
8
|
import { DirMixin } from '@vaadin/component-base/src/dir-mixin.js';
|
|
9
|
-
import { OverlayMixin } from '@vaadin/overlay/src/vaadin-overlay-mixin.js';
|
|
10
|
-
import { PositionMixin } from '@vaadin/overlay/src/vaadin-overlay-position-mixin.js';
|
|
11
9
|
import { overlayStyles } from '@vaadin/overlay/src/vaadin-overlay-styles.js';
|
|
12
10
|
import { registerStyles, ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
11
|
+
import { DatePickerOverlayMixin } from './vaadin-date-picker-overlay-mixin.js';
|
|
13
12
|
import { datePickerOverlayStyles } from './vaadin-date-picker-overlay-styles.js';
|
|
14
13
|
|
|
15
14
|
registerStyles('vaadin-date-picker-overlay', [overlayStyles, datePickerOverlayStyles], {
|
|
@@ -21,13 +20,12 @@ registerStyles('vaadin-date-picker-overlay', [overlayStyles, datePickerOverlaySt
|
|
|
21
20
|
*
|
|
22
21
|
* @customElement
|
|
23
22
|
* @extends HTMLElement
|
|
24
|
-
* @mixes
|
|
25
|
-
* @mixes OverlayMixin
|
|
23
|
+
* @mixes DatePickerOverlayMixin
|
|
26
24
|
* @mixes DirMixin
|
|
27
25
|
* @mixes ThemableMixin
|
|
28
26
|
* @private
|
|
29
27
|
*/
|
|
30
|
-
class DatePickerOverlay extends
|
|
28
|
+
class DatePickerOverlay extends DatePickerOverlayMixin(DirMixin(ThemableMixin(PolymerElement))) {
|
|
31
29
|
static get is() {
|
|
32
30
|
return 'vaadin-date-picker-overlay';
|
|
33
31
|
}
|
|
@@ -142,6 +142,8 @@ export interface DatePickerEventMap extends HTMLElementEventMap, DatePickerCusto
|
|
|
142
142
|
* `focused` | Focused date element
|
|
143
143
|
* `selected` | Selected date element
|
|
144
144
|
* `today` | Date element corresponding to the current day
|
|
145
|
+
* `past` | Date element corresponding to the date in the past
|
|
146
|
+
* `future` | Date element corresponding to the date in the future
|
|
145
147
|
*
|
|
146
148
|
* In order to style year scroller elements, use `<vaadin-date-picker-year>` shadow DOM parts:
|
|
147
149
|
*
|
|
@@ -105,6 +105,8 @@ registerStyles('vaadin-date-picker', [inputFieldShared, datePickerStyles], { mod
|
|
|
105
105
|
* `focused` | Focused date element
|
|
106
106
|
* `selected` | Selected date element
|
|
107
107
|
* `today` | Date element corresponding to the current day
|
|
108
|
+
* `past` | Date element corresponding to the date in the past
|
|
109
|
+
* `future` | Date element corresponding to the date in the future
|
|
108
110
|
*
|
|
109
111
|
* In order to style year scroller elements, use `<vaadin-date-picker-year>` shadow DOM parts:
|
|
110
112
|
*
|
|
@@ -7,23 +7,21 @@ 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 { OverlayMixin } from '@vaadin/overlay/src/vaadin-overlay-mixin.js';
|
|
11
|
-
import { PositionMixin } from '@vaadin/overlay/src/vaadin-overlay-position-mixin.js';
|
|
12
10
|
import { overlayStyles } from '@vaadin/overlay/src/vaadin-overlay-styles.js';
|
|
13
11
|
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
12
|
+
import { DatePickerOverlayMixin } from './vaadin-date-picker-overlay-mixin.js';
|
|
14
13
|
import { datePickerOverlayStyles } from './vaadin-date-picker-overlay-styles.js';
|
|
15
14
|
|
|
16
15
|
/**
|
|
17
16
|
* An element used internally by `<vaadin-date-picker>`. Not intended to be used separately.
|
|
18
17
|
*
|
|
19
18
|
* @extends HTMLElement
|
|
20
|
-
* @mixes
|
|
21
|
-
* @mixes OverlayMixin
|
|
19
|
+
* @mixes DatePickerOverlayMixin
|
|
22
20
|
* @mixes DirMixin
|
|
23
21
|
* @mixes ThemableMixin
|
|
24
22
|
* @private
|
|
25
23
|
*/
|
|
26
|
-
class DatePickerOverlay extends
|
|
24
|
+
class DatePickerOverlay extends DatePickerOverlayMixin(DirMixin(ThemableMixin(PolylitMixin(LitElement)))) {
|
|
27
25
|
static get is() {
|
|
28
26
|
return 'vaadin-date-picker-overlay';
|
|
29
27
|
}
|
|
@@ -7,7 +7,7 @@ import { html, LitElement } from 'lit';
|
|
|
7
7
|
import { defineCustomElement } from '@vaadin/component-base/src/define.js';
|
|
8
8
|
import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
|
|
9
9
|
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
10
|
-
import { dateAllowed, dateEquals } from './vaadin-date-picker-helper.js';
|
|
10
|
+
import { dateAllowed, dateEquals, normalizeDate } from './vaadin-date-picker-helper.js';
|
|
11
11
|
import { MonthCalendarMixin } from './vaadin-month-calendar-mixin.js';
|
|
12
12
|
import { monthCalendarStyles } from './vaadin-month-calendar-styles.js';
|
|
13
13
|
|
|
@@ -62,6 +62,8 @@ class MonthCalendar extends MonthCalendarMixin(ThemableMixin(PolylitMixin(LitEle
|
|
|
62
62
|
const isFocused = dateEquals(date, this.focusedDate);
|
|
63
63
|
const isSelected = dateEquals(date, this.selectedDate);
|
|
64
64
|
const isDisabled = !dateAllowed(date, this.minDate, this.maxDate, this.isDateDisabled);
|
|
65
|
+
const greaterThanToday = date > normalizeDate(new Date());
|
|
66
|
+
const lessThanToday = date < normalizeDate(new Date());
|
|
65
67
|
|
|
66
68
|
const parts = [
|
|
67
69
|
'date',
|
|
@@ -69,6 +71,8 @@ class MonthCalendar extends MonthCalendarMixin(ThemableMixin(PolylitMixin(LitEle
|
|
|
69
71
|
isFocused && 'focused',
|
|
70
72
|
isSelected && 'selected',
|
|
71
73
|
this._isToday(date) && 'today',
|
|
74
|
+
greaterThanToday && 'future',
|
|
75
|
+
lessThanToday && 'past',
|
|
72
76
|
].filter(Boolean);
|
|
73
77
|
|
|
74
78
|
return html`
|
|
@@ -7,7 +7,7 @@ import '@polymer/polymer/lib/elements/dom-repeat.js';
|
|
|
7
7
|
import { html, PolymerElement } from '@polymer/polymer/polymer-element.js';
|
|
8
8
|
import { defineCustomElement } from '@vaadin/component-base/src/define.js';
|
|
9
9
|
import { registerStyles, ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
10
|
-
import { dateAllowed, dateEquals } from './vaadin-date-picker-helper.js';
|
|
10
|
+
import { dateAllowed, dateEquals, normalizeDate } from './vaadin-date-picker-helper.js';
|
|
11
11
|
import { MonthCalendarMixin } from './vaadin-month-calendar-mixin.js';
|
|
12
12
|
import { monthCalendarStyles } from './vaadin-month-calendar-styles.js';
|
|
13
13
|
|
|
@@ -110,6 +110,8 @@ class MonthCalendar extends MonthCalendarMixin(ThemableMixin(PolymerElement)) {
|
|
|
110
110
|
// eslint-disable-next-line @typescript-eslint/max-params
|
|
111
111
|
__getDatePart(date, focusedDate, selectedDate, minDate, maxDate, isDateDisabled) {
|
|
112
112
|
const result = ['date'];
|
|
113
|
+
const greaterThanToday = date > normalizeDate(new Date());
|
|
114
|
+
const lessThanToday = date < normalizeDate(new Date());
|
|
113
115
|
|
|
114
116
|
if (this.__isDayDisabled(date, minDate, maxDate, isDateDisabled)) {
|
|
115
117
|
result.push('disabled');
|
|
@@ -127,6 +129,14 @@ class MonthCalendar extends MonthCalendarMixin(ThemableMixin(PolymerElement)) {
|
|
|
127
129
|
result.push('today');
|
|
128
130
|
}
|
|
129
131
|
|
|
132
|
+
if (lessThanToday) {
|
|
133
|
+
result.push('past');
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
if (greaterThanToday) {
|
|
137
|
+
result.push('future');
|
|
138
|
+
}
|
|
139
|
+
|
|
130
140
|
return result.join(' ');
|
|
131
141
|
}
|
|
132
142
|
|
|
@@ -4,10 +4,6 @@ import { inputFieldShared } from '@vaadin/vaadin-lumo-styles/mixins/input-field-
|
|
|
4
4
|
import { css, registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
5
5
|
|
|
6
6
|
const datePicker = css`
|
|
7
|
-
:host {
|
|
8
|
-
outline: none;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
7
|
[part='toggle-button']::before {
|
|
12
8
|
content: var(--lumo-icons-calendar);
|
|
13
9
|
}
|
|
@@ -137,7 +137,7 @@ registerStyles(
|
|
|
137
137
|
|
|
138
138
|
@media (pointer: coarse) {
|
|
139
139
|
[part~='date']:hover:not([part~='selected'])::before,
|
|
140
|
-
[part~='focused']:not([part~='selected'])::before {
|
|
140
|
+
:host(:not([focus-ring])) [part~='focused']:not([part~='selected'])::before {
|
|
141
141
|
display: none;
|
|
142
142
|
}
|
|
143
143
|
|
|
@@ -145,11 +145,10 @@ registerStyles(
|
|
|
145
145
|
display: block;
|
|
146
146
|
}
|
|
147
147
|
|
|
148
|
-
[part~='date'][part~='selected']::before {
|
|
148
|
+
:host(:not([focus-ring])) [part~='date'][part~='selected']::before {
|
|
149
149
|
box-shadow: none;
|
|
150
150
|
}
|
|
151
151
|
}
|
|
152
|
-
|
|
153
152
|
/* Disabled */
|
|
154
153
|
|
|
155
154
|
:host([disabled]) * {
|
|
@@ -158,17 +157,3 @@ registerStyles(
|
|
|
158
157
|
`,
|
|
159
158
|
{ moduleId: 'lumo-month-calendar' },
|
|
160
159
|
);
|
|
161
|
-
|
|
162
|
-
const template = document.createElement('template');
|
|
163
|
-
|
|
164
|
-
template.innerHTML = `
|
|
165
|
-
<style>
|
|
166
|
-
@keyframes vaadin-date-picker-month-calendar-focus-date {
|
|
167
|
-
50% {
|
|
168
|
-
box-shadow: 0 0 0 var(--_focus-ring-width) transparent;
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
</style>
|
|
172
|
-
`;
|
|
173
|
-
|
|
174
|
-
document.head.appendChild(template.content);
|
package/web-types.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/web-types",
|
|
3
3
|
"name": "@vaadin/date-picker",
|
|
4
|
-
"version": "24.5.0-
|
|
4
|
+
"version": "24.5.0-rc1",
|
|
5
5
|
"description-markup": "markdown",
|
|
6
6
|
"contributions": {
|
|
7
7
|
"html": {
|
|
@@ -344,7 +344,7 @@
|
|
|
344
344
|
},
|
|
345
345
|
{
|
|
346
346
|
"name": "vaadin-date-picker",
|
|
347
|
-
"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.5.0-
|
|
347
|
+
"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.5.0-rc1/#/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.5.0-rc1/#/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.5.0-rc1/#/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.5.0-rc1/#/elements/vaadin-input-container) - an internal element wrapping the input.\n\nIn order to style the overlay content, use `<vaadin-date-picker-overlay-content>` shadow DOM parts:\n\nPart name | Description\n----------------------|--------------------\n`overlay-header` | Fullscreen mode header\n`label` | Fullscreen mode value/label\n`clear-button` | Fullscreen mode clear button\n`toggle-button` | Fullscreen mode toggle button\n`years-toggle-button` | Fullscreen mode years scroller toggle\n`toolbar` | Footer bar with slotted buttons\n\nThe following state attributes are available on the `<vaadin-date-picker-overlay-content>` element:\n\nAttribute | Description\n----------------|-------------------------------------------------\n`desktop` | Set when the overlay content is in desktop mode\n`fullscreen` | Set when the overlay content is in fullscreen mode\n`years-visible` | Set when the year scroller is visible in fullscreen mode\n\nIn order to style the month calendar, use `<vaadin-month-calendar>` shadow DOM parts:\n\nPart name | Description\n----------------------|--------------------\n`month-header` | Month title\n`weekdays` | Weekday container\n`weekday` | Weekday element\n`week-numbers` | Week numbers container\n`week-number` | Week number element\n`date` | Date element\n`disabled` | Disabled date element\n`focused` | Focused date element\n`selected` | Selected date element\n`today` | Date element corresponding to the current day\n`past` | Date element corresponding to the date in the past\n`future` | Date element corresponding to the date in the future\n\nIn order to style year scroller elements, use `<vaadin-date-picker-year>` shadow DOM parts:\n\nPart name | Description\n----------------------|--------------------\n`year-number` | Year number\n`year-separator` | Year separator\n\nNote: the `theme` attribute value set on `<vaadin-date-picker>` is\npropagated to the internal components listed above.\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.\n\n### Change events\n\nDepending on the nature of the value change that the user attempts to commit e.g. by pressing Enter,\nthe component can fire either a `change` event or an `unparsable-change` event:\n\nValue change | Event\n:------------------------|:------------------\nempty => parsable | change\nempty => unparsable | unparsable-change\nparsable => empty | change\nparsable => parsable | change\nparsable => unparsable | change\nunparsable => empty | unparsable-change\nunparsable => parsable | change\nunparsable => unparsable | unparsable-change",
|
|
348
348
|
"attributes": [
|
|
349
349
|
{
|
|
350
350
|
"name": "disabled",
|
package/web-types.lit.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/web-types",
|
|
3
3
|
"name": "@vaadin/date-picker",
|
|
4
|
-
"version": "24.5.0-
|
|
4
|
+
"version": "24.5.0-rc1",
|
|
5
5
|
"description-markup": "markdown",
|
|
6
6
|
"framework": "lit",
|
|
7
7
|
"framework-config": {
|
|
@@ -163,7 +163,7 @@
|
|
|
163
163
|
},
|
|
164
164
|
{
|
|
165
165
|
"name": "vaadin-date-picker",
|
|
166
|
-
"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.5.0-
|
|
166
|
+
"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.5.0-rc1/#/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.5.0-rc1/#/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.5.0-rc1/#/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.5.0-rc1/#/elements/vaadin-input-container) - an internal element wrapping the input.\n\nIn order to style the overlay content, use `<vaadin-date-picker-overlay-content>` shadow DOM parts:\n\nPart name | Description\n----------------------|--------------------\n`overlay-header` | Fullscreen mode header\n`label` | Fullscreen mode value/label\n`clear-button` | Fullscreen mode clear button\n`toggle-button` | Fullscreen mode toggle button\n`years-toggle-button` | Fullscreen mode years scroller toggle\n`toolbar` | Footer bar with slotted buttons\n\nThe following state attributes are available on the `<vaadin-date-picker-overlay-content>` element:\n\nAttribute | Description\n----------------|-------------------------------------------------\n`desktop` | Set when the overlay content is in desktop mode\n`fullscreen` | Set when the overlay content is in fullscreen mode\n`years-visible` | Set when the year scroller is visible in fullscreen mode\n\nIn order to style the month calendar, use `<vaadin-month-calendar>` shadow DOM parts:\n\nPart name | Description\n----------------------|--------------------\n`month-header` | Month title\n`weekdays` | Weekday container\n`weekday` | Weekday element\n`week-numbers` | Week numbers container\n`week-number` | Week number element\n`date` | Date element\n`disabled` | Disabled date element\n`focused` | Focused date element\n`selected` | Selected date element\n`today` | Date element corresponding to the current day\n`past` | Date element corresponding to the date in the past\n`future` | Date element corresponding to the date in the future\n\nIn order to style year scroller elements, use `<vaadin-date-picker-year>` shadow DOM parts:\n\nPart name | Description\n----------------------|--------------------\n`year-number` | Year number\n`year-separator` | Year separator\n\nNote: the `theme` attribute value set on `<vaadin-date-picker>` is\npropagated to the internal components listed above.\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.\n\n### Change events\n\nDepending on the nature of the value change that the user attempts to commit e.g. by pressing Enter,\nthe component can fire either a `change` event or an `unparsable-change` event:\n\nValue change | Event\n:------------------------|:------------------\nempty => parsable | change\nempty => unparsable | unparsable-change\nparsable => empty | change\nparsable => parsable | change\nparsable => unparsable | change\nunparsable => empty | unparsable-change\nunparsable => parsable | change\nunparsable => unparsable | unparsable-change",
|
|
167
167
|
"extension": true,
|
|
168
168
|
"attributes": [
|
|
169
169
|
{
|