@vaadin/date-picker 24.8.0-alpha9 → 25.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/README.md +0 -23
- package/package.json +13 -15
- package/src/vaadin-date-picker-mixin.js +6 -28
- package/src/vaadin-date-picker-overlay-content-mixin.js +4 -6
- package/src/vaadin-date-picker-overlay-content.js +22 -21
- package/src/vaadin-date-picker-overlay.js +11 -9
- package/src/vaadin-date-picker-year.js +15 -10
- package/src/vaadin-date-picker.d.ts +0 -3
- package/src/vaadin-date-picker.js +53 -41
- package/src/vaadin-infinite-scroller.js +0 -13
- package/src/vaadin-month-calendar.js +67 -46
- package/web-types.json +2 -369
- package/web-types.lit.json +2 -156
- package/src/vaadin-date-picker-light.d.ts +0 -112
- package/src/vaadin-date-picker-light.js +0 -133
- package/src/vaadin-lit-date-picker-overlay-content.js +0 -70
- package/src/vaadin-lit-date-picker-overlay.js +0 -46
- package/src/vaadin-lit-date-picker-year.js +0 -41
- package/src/vaadin-lit-date-picker.js +0 -172
- package/src/vaadin-lit-month-calendar.js +0 -98
- package/theme/lumo/vaadin-date-picker-light.d.ts +0 -4
- package/theme/lumo/vaadin-date-picker-light.js +0 -4
- package/theme/lumo/vaadin-lit-date-picker.d.ts +0 -5
- package/theme/lumo/vaadin-lit-date-picker.js +0 -5
- package/theme/material/vaadin-date-picker-light.d.ts +0 -4
- package/theme/material/vaadin-date-picker-light.js +0 -4
- package/theme/material/vaadin-date-picker-overlay-content-styles.d.ts +0 -6
- package/theme/material/vaadin-date-picker-overlay-content-styles.js +0 -132
- package/theme/material/vaadin-date-picker-overlay-styles.d.ts +0 -1
- package/theme/material/vaadin-date-picker-overlay-styles.js +0 -47
- package/theme/material/vaadin-date-picker-styles.d.ts +0 -3
- package/theme/material/vaadin-date-picker-styles.js +0 -22
- package/theme/material/vaadin-date-picker-year-styles.d.ts +0 -1
- package/theme/material/vaadin-date-picker-year-styles.js +0 -28
- package/theme/material/vaadin-date-picker.d.ts +0 -5
- package/theme/material/vaadin-date-picker.js +0 -5
- package/theme/material/vaadin-lit-date-picker.d.ts +0 -5
- package/theme/material/vaadin-lit-date-picker.js +0 -5
- package/theme/material/vaadin-month-calendar-styles.d.ts +0 -2
- package/theme/material/vaadin-month-calendar-styles.js +0 -120
- package/vaadin-date-picker-light.d.ts +0 -1
- package/vaadin-date-picker-light.js +0 -2
- package/vaadin-lit-date-picker.d.ts +0 -1
- package/vaadin-lit-date-picker.js +0 -2
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": "
|
|
4
|
+
"version": "25.0.0-alpha2",
|
|
5
5
|
"description-markup": "markdown",
|
|
6
6
|
"framework": "lit",
|
|
7
7
|
"framework-config": {
|
|
@@ -14,163 +14,9 @@
|
|
|
14
14
|
"contributions": {
|
|
15
15
|
"html": {
|
|
16
16
|
"elements": [
|
|
17
|
-
{
|
|
18
|
-
"name": "vaadin-date-picker-light",
|
|
19
|
-
"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/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.",
|
|
20
|
-
"extension": true,
|
|
21
|
-
"attributes": [
|
|
22
|
-
{
|
|
23
|
-
"name": "?disabled",
|
|
24
|
-
"description": "If true, the user cannot interact with this element.",
|
|
25
|
-
"value": {
|
|
26
|
-
"kind": "expression"
|
|
27
|
-
}
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
"name": "?autofocus",
|
|
31
|
-
"description": "Specify that this control should have input focus when the page loads.",
|
|
32
|
-
"value": {
|
|
33
|
-
"kind": "expression"
|
|
34
|
-
}
|
|
35
|
-
},
|
|
36
|
-
{
|
|
37
|
-
"name": "?invalid",
|
|
38
|
-
"description": "Set to true when the field is invalid.",
|
|
39
|
-
"value": {
|
|
40
|
-
"kind": "expression"
|
|
41
|
-
}
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
"name": "?manualValidation",
|
|
45
|
-
"description": "Set to true to enable manual validation mode. This mode disables automatic\nconstraint validation, allowing you to control the validation process yourself.\nYou can still trigger constraint validation manually with the `validate()` method\nor use `checkValidity()` to assess the component's validity without affecting\nthe invalid state. In manual validation mode, you can also manipulate\nthe `invalid` property directly through your application logic without conflicts\nwith the component's internal validation.",
|
|
46
|
-
"value": {
|
|
47
|
-
"kind": "expression"
|
|
48
|
-
}
|
|
49
|
-
},
|
|
50
|
-
{
|
|
51
|
-
"name": "?required",
|
|
52
|
-
"description": "Specifies that the user must fill in a value.",
|
|
53
|
-
"value": {
|
|
54
|
-
"kind": "expression"
|
|
55
|
-
}
|
|
56
|
-
},
|
|
57
|
-
{
|
|
58
|
-
"name": "?opened",
|
|
59
|
-
"description": "Set true to open the date selector overlay.",
|
|
60
|
-
"value": {
|
|
61
|
-
"kind": "expression"
|
|
62
|
-
}
|
|
63
|
-
},
|
|
64
|
-
{
|
|
65
|
-
"name": "?autoOpenDisabled",
|
|
66
|
-
"description": "Set true to prevent the overlay from opening automatically.",
|
|
67
|
-
"value": {
|
|
68
|
-
"kind": "expression"
|
|
69
|
-
}
|
|
70
|
-
},
|
|
71
|
-
{
|
|
72
|
-
"name": "?showWeekNumbers",
|
|
73
|
-
"description": "Set true to display ISO-8601 week numbers in the calendar. Notice that\ndisplaying week numbers is only supported when `i18n.firstDayOfWeek`\nis 1 (Monday).",
|
|
74
|
-
"value": {
|
|
75
|
-
"kind": "expression"
|
|
76
|
-
}
|
|
77
|
-
},
|
|
78
|
-
{
|
|
79
|
-
"name": "?isDateDisabled",
|
|
80
|
-
"description": "A function to be used to determine whether the user can select a given date.\nReceives a `DatePickerDate` object of the date to be selected and should return a\nboolean.",
|
|
81
|
-
"value": {
|
|
82
|
-
"kind": "expression"
|
|
83
|
-
}
|
|
84
|
-
},
|
|
85
|
-
{
|
|
86
|
-
"name": ".i18n",
|
|
87
|
-
"description": "The object used to localize this component. To change the default\nlocalization, replace this with an object that provides all properties, or\njust the individual properties you want to change.\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```",
|
|
88
|
-
"value": {
|
|
89
|
-
"kind": "expression"
|
|
90
|
-
}
|
|
91
|
-
},
|
|
92
|
-
{
|
|
93
|
-
"name": ".value",
|
|
94
|
-
"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\"`",
|
|
95
|
-
"value": {
|
|
96
|
-
"kind": "expression"
|
|
97
|
-
}
|
|
98
|
-
},
|
|
99
|
-
{
|
|
100
|
-
"name": ".overlayClass",
|
|
101
|
-
"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.",
|
|
102
|
-
"value": {
|
|
103
|
-
"kind": "expression"
|
|
104
|
-
}
|
|
105
|
-
},
|
|
106
|
-
{
|
|
107
|
-
"name": ".initialPosition",
|
|
108
|
-
"description": "Date which should be visible when there is no value selected.\n\nThe same date formats as for the `value` property are supported.",
|
|
109
|
-
"value": {
|
|
110
|
-
"kind": "expression"
|
|
111
|
-
}
|
|
112
|
-
},
|
|
113
|
-
{
|
|
114
|
-
"name": ".min",
|
|
115
|
-
"description": "The earliest date that can be selected. All earlier dates will be disabled.\n\nSupported date formats:\n- ISO 8601 `\"YYYY-MM-DD\"` (default)\n- 6-digit extended ISO 8601 `\"+YYYYYY-MM-DD\"`, `\"-YYYYYY-MM-DD\"`",
|
|
116
|
-
"value": {
|
|
117
|
-
"kind": "expression"
|
|
118
|
-
}
|
|
119
|
-
},
|
|
120
|
-
{
|
|
121
|
-
"name": ".max",
|
|
122
|
-
"description": "The latest date that can be selected. All later dates will be disabled.\n\nSupported date formats:\n- ISO 8601 `\"YYYY-MM-DD\"` (default)\n- 6-digit extended ISO 8601 `\"+YYYYYY-MM-DD\"`, `\"-YYYYYY-MM-DD\"`",
|
|
123
|
-
"value": {
|
|
124
|
-
"kind": "expression"
|
|
125
|
-
}
|
|
126
|
-
},
|
|
127
|
-
{
|
|
128
|
-
"name": ".attrForValue",
|
|
129
|
-
"description": "Name of the two-way data-bindable property representing the\nvalue of the custom input field.",
|
|
130
|
-
"value": {
|
|
131
|
-
"kind": "expression"
|
|
132
|
-
}
|
|
133
|
-
},
|
|
134
|
-
{
|
|
135
|
-
"name": "@validated",
|
|
136
|
-
"description": "Fired whenever the field is validated.",
|
|
137
|
-
"value": {
|
|
138
|
-
"kind": "expression"
|
|
139
|
-
}
|
|
140
|
-
},
|
|
141
|
-
{
|
|
142
|
-
"name": "@change",
|
|
143
|
-
"description": "Fired when the user commits a value change.",
|
|
144
|
-
"value": {
|
|
145
|
-
"kind": "expression"
|
|
146
|
-
}
|
|
147
|
-
},
|
|
148
|
-
{
|
|
149
|
-
"name": "@opened-changed",
|
|
150
|
-
"description": "Fired when `opened` property value changes.",
|
|
151
|
-
"value": {
|
|
152
|
-
"kind": "expression"
|
|
153
|
-
}
|
|
154
|
-
},
|
|
155
|
-
{
|
|
156
|
-
"name": "@value-changed",
|
|
157
|
-
"description": "Fired when `value` property value changes.",
|
|
158
|
-
"value": {
|
|
159
|
-
"kind": "expression"
|
|
160
|
-
}
|
|
161
|
-
},
|
|
162
|
-
{
|
|
163
|
-
"name": "@invalid-changed",
|
|
164
|
-
"description": "Fired when the `invalid` property changes.",
|
|
165
|
-
"value": {
|
|
166
|
-
"kind": "expression"
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
]
|
|
170
|
-
},
|
|
171
17
|
{
|
|
172
18
|
"name": "vaadin-date-picker",
|
|
173
|
-
"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/
|
|
19
|
+
"description": "`<vaadin-date-picker>` is an input field that allows to enter a date by typing or by selecting from a calendar overlay.\n\n```html\n<vaadin-date-picker label=\"Birthday\"></vaadin-date-picker>\n```\n```js\ndatePicker.value = '2016-03-02';\n```\n\nWhen the selected `value` is changed, a `value-changed` event is triggered.\n\n### Styling\n\nThe following custom properties are available for styling:\n\nCustom property | Description | Default\n-------------------------------|----------------------------|---------\n`--vaadin-field-default-width` | Default width of the field | `12em`\n\n`<vaadin-date-picker>` provides the same set of shadow DOM parts and state attributes as `<vaadin-text-field>`.\nSee [`<vaadin-text-field>`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-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\n### Internal components\n\nIn addition to `<vaadin-date-picker>` itself, the following internal\ncomponents are themable:\n\n- `<vaadin-date-picker-overlay>` - has the same API as [`<vaadin-overlay>`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-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/25.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`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",
|
|
174
20
|
"extension": true,
|
|
175
21
|
"attributes": [
|
|
176
22
|
{
|
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright (c) 2016 - 2025 Vaadin Ltd.
|
|
4
|
-
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
|
-
*/
|
|
6
|
-
import { ValidateMixin } from '@vaadin/field-base/src/validate-mixin.js';
|
|
7
|
-
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
8
|
-
import { DatePickerMixin } from './vaadin-date-picker-mixin.js';
|
|
9
|
-
export { DatePickerDate, DatePickerI18n } from './vaadin-date-picker-mixin.js';
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Fired when the user commits a value change.
|
|
13
|
-
*/
|
|
14
|
-
export type DatePickerLightChangeEvent = Event & {
|
|
15
|
-
target: DatePickerLight;
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Fired when the `opened` property changes.
|
|
20
|
-
*/
|
|
21
|
-
export type DatePickerLightOpenedChangedEvent = CustomEvent<{ value: boolean }>;
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* Fired when the `invalid` property changes.
|
|
25
|
-
*/
|
|
26
|
-
export type DatePickerLightInvalidChangedEvent = CustomEvent<{ value: boolean }>;
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* Fired when the `value` property changes.
|
|
30
|
-
*/
|
|
31
|
-
export type DatePickerLightValueChangedEvent = CustomEvent<{ value: string }>;
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* Fired whenever the field is validated.
|
|
35
|
-
*/
|
|
36
|
-
export type DatePickerLightValidatedEvent = CustomEvent<{ valid: boolean }>;
|
|
37
|
-
|
|
38
|
-
export interface DatePickerLightCustomEventMap {
|
|
39
|
-
'opened-changed': DatePickerLightOpenedChangedEvent;
|
|
40
|
-
|
|
41
|
-
'invalid-changed': DatePickerLightInvalidChangedEvent;
|
|
42
|
-
|
|
43
|
-
'value-changed': DatePickerLightValueChangedEvent;
|
|
44
|
-
|
|
45
|
-
validated: DatePickerLightValidatedEvent;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
export interface DatePickerLightEventMap extends HTMLElementEventMap, DatePickerLightCustomEventMap {
|
|
49
|
-
change: DatePickerLightChangeEvent;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
/**
|
|
53
|
-
* `<vaadin-date-picker-light>` is a customizable version of the `<vaadin-date-picker>` providing
|
|
54
|
-
* only the scrollable month calendar view and leaving the input field definition to the user.
|
|
55
|
-
*
|
|
56
|
-
* To create a custom input field, you need to add a child element which has a two-way
|
|
57
|
-
* data-bindable property representing the input value. The property name is expected
|
|
58
|
-
* to be `bindValue` by default. See the example below for a simplest possible example
|
|
59
|
-
* using an `<input>` element.
|
|
60
|
-
*
|
|
61
|
-
* ```html
|
|
62
|
-
* <vaadin-date-picker-light attr-for-value="value">
|
|
63
|
-
* <input class="input">
|
|
64
|
-
* </vaadin-date-picker-light>
|
|
65
|
-
* ```
|
|
66
|
-
*
|
|
67
|
-
* ### Styling
|
|
68
|
-
*
|
|
69
|
-
* See [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.
|
|
70
|
-
*
|
|
71
|
-
* In addition to `<vaadin-date-picker-light>` itself, the following
|
|
72
|
-
* internal components are themable:
|
|
73
|
-
*
|
|
74
|
-
* - `<vaadin-date-picker-overlay>`
|
|
75
|
-
* - `<vaadin-date-picker-overlay-content>`
|
|
76
|
-
* - `<vaadin-month-calendar>`
|
|
77
|
-
*
|
|
78
|
-
* Note: the `theme` attribute value set on `<vaadin-date-picker-light>`
|
|
79
|
-
* is propagated to the internal themable components listed above.
|
|
80
|
-
*
|
|
81
|
-
* @fires {Event} change - Fired when the user commits a value change.
|
|
82
|
-
* @fires {CustomEvent} opened-changed - Fired when the `opened` property changes.
|
|
83
|
-
* @fires {CustomEvent} value-changed - Fired when the `value` property changes.
|
|
84
|
-
* @fires {CustomEvent} validated - Fired whenever the field is validated.
|
|
85
|
-
*/
|
|
86
|
-
declare class DatePickerLight extends ThemableMixin(DatePickerMixin(ValidateMixin(HTMLElement))) {
|
|
87
|
-
/**
|
|
88
|
-
* Name of the two-way data-bindable property representing the
|
|
89
|
-
* value of the custom input field.
|
|
90
|
-
*/
|
|
91
|
-
attrForValue: string;
|
|
92
|
-
|
|
93
|
-
addEventListener<K extends keyof DatePickerLightEventMap>(
|
|
94
|
-
type: K,
|
|
95
|
-
listener: (this: DatePickerLight, ev: DatePickerLightEventMap[K]) => void,
|
|
96
|
-
options?: AddEventListenerOptions | boolean,
|
|
97
|
-
): void;
|
|
98
|
-
|
|
99
|
-
removeEventListener<K extends keyof DatePickerLightEventMap>(
|
|
100
|
-
type: K,
|
|
101
|
-
listener: (this: DatePickerLight, ev: DatePickerLightEventMap[K]) => void,
|
|
102
|
-
options?: EventListenerOptions | boolean,
|
|
103
|
-
): void;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
declare global {
|
|
107
|
-
interface HTMLElementTagNameMap {
|
|
108
|
-
'vaadin-date-picker-light': DatePickerLight;
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
export { DatePickerLight };
|
|
@@ -1,133 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright (c) 2016 - 2025 Vaadin Ltd.
|
|
4
|
-
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
|
-
*/
|
|
6
|
-
import './vaadin-date-picker-overlay-content.js';
|
|
7
|
-
import './vaadin-date-picker-overlay.js';
|
|
8
|
-
import { dashToCamelCase } from '@polymer/polymer/lib/utils/case-map.js';
|
|
9
|
-
import { html, PolymerElement } from '@polymer/polymer/polymer-element.js';
|
|
10
|
-
import { defineCustomElement } from '@vaadin/component-base/src/define.js';
|
|
11
|
-
import { ValidateMixin } from '@vaadin/field-base/src/validate-mixin.js';
|
|
12
|
-
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
13
|
-
import { DatePickerMixin } from './vaadin-date-picker-mixin.js';
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* `<vaadin-date-picker-light>` is a customizable version of the `<vaadin-date-picker>` providing
|
|
17
|
-
* only the scrollable month calendar view and leaving the input field definition to the user.
|
|
18
|
-
*
|
|
19
|
-
* To create a custom input field, you need to add a child element which has a two-way
|
|
20
|
-
* data-bindable property representing the input value. The property name is expected
|
|
21
|
-
* to be `bindValue` by default. See the example below for a simplest possible example
|
|
22
|
-
* using an `<input>` element.
|
|
23
|
-
*
|
|
24
|
-
* ```html
|
|
25
|
-
* <vaadin-date-picker-light attr-for-value="value">
|
|
26
|
-
* <input class="input">
|
|
27
|
-
* </vaadin-date-picker-light>
|
|
28
|
-
* ```
|
|
29
|
-
*
|
|
30
|
-
* ### Styling
|
|
31
|
-
*
|
|
32
|
-
* See [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.
|
|
33
|
-
*
|
|
34
|
-
* In addition to `<vaadin-date-picker-light>` itself, the following
|
|
35
|
-
* internal components are themable:
|
|
36
|
-
*
|
|
37
|
-
* - `<vaadin-date-picker-overlay>`
|
|
38
|
-
* - `<vaadin-date-picker-overlay-content>`
|
|
39
|
-
* - `<vaadin-month-calendar>`
|
|
40
|
-
*
|
|
41
|
-
* Note: the `theme` attribute value set on `<vaadin-date-picker-light>`
|
|
42
|
-
* is propagated to the internal themable components listed above.
|
|
43
|
-
*
|
|
44
|
-
* @fires {Event} change - Fired when the user commits a value change.
|
|
45
|
-
* @fires {CustomEvent} opened-changed - Fired when the `opened` property changes.
|
|
46
|
-
* @fires {CustomEvent} value-changed - Fired when the `value` property changes.
|
|
47
|
-
* @fires {CustomEvent} validated - Fired whenever the field is validated.
|
|
48
|
-
*
|
|
49
|
-
* @customElement
|
|
50
|
-
* @extends HTMLElement
|
|
51
|
-
* @mixes ThemableMixin
|
|
52
|
-
* @mixes DatePickerMixin
|
|
53
|
-
*/
|
|
54
|
-
class DatePickerLight extends ThemableMixin(DatePickerMixin(ValidateMixin(PolymerElement))) {
|
|
55
|
-
static get template() {
|
|
56
|
-
return html`
|
|
57
|
-
<style>
|
|
58
|
-
:host {
|
|
59
|
-
display: inline-block;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
:host([opened]) {
|
|
63
|
-
pointer-events: auto;
|
|
64
|
-
}
|
|
65
|
-
</style>
|
|
66
|
-
<slot></slot>
|
|
67
|
-
|
|
68
|
-
<vaadin-date-picker-overlay
|
|
69
|
-
id="overlay"
|
|
70
|
-
fullscreen$="[[_fullscreen]]"
|
|
71
|
-
opened="{{opened}}"
|
|
72
|
-
on-vaadin-overlay-escape-press="_onOverlayEscapePress"
|
|
73
|
-
on-vaadin-overlay-open="_onOverlayOpened"
|
|
74
|
-
on-vaadin-overlay-closing="_onOverlayClosed"
|
|
75
|
-
restore-focus-on-close
|
|
76
|
-
restore-focus-node="[[inputElement]]"
|
|
77
|
-
theme$="[[_theme]]"
|
|
78
|
-
></vaadin-date-picker-overlay>
|
|
79
|
-
`;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
static get is() {
|
|
83
|
-
return 'vaadin-date-picker-light';
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
static get properties() {
|
|
87
|
-
return {
|
|
88
|
-
/**
|
|
89
|
-
* Name of the two-way data-bindable property representing the
|
|
90
|
-
* value of the custom input field.
|
|
91
|
-
* @attr {string} attr-for-value
|
|
92
|
-
* @type {string}
|
|
93
|
-
*/
|
|
94
|
-
attrForValue: {
|
|
95
|
-
type: String,
|
|
96
|
-
value: 'value',
|
|
97
|
-
},
|
|
98
|
-
};
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
/**
|
|
102
|
-
* This method from InputMixin is overridden to make
|
|
103
|
-
* the input element value property customizable.
|
|
104
|
-
*
|
|
105
|
-
* @protected
|
|
106
|
-
* @override
|
|
107
|
-
* @return {string}
|
|
108
|
-
*/
|
|
109
|
-
get _inputElementValueProperty() {
|
|
110
|
-
return dashToCamelCase(this.attrForValue);
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
/** @protected */
|
|
114
|
-
connectedCallback() {
|
|
115
|
-
super.connectedCallback();
|
|
116
|
-
const cssSelector = 'vaadin-text-field,.input';
|
|
117
|
-
this._setInputElement(this.querySelector(cssSelector));
|
|
118
|
-
this._setFocusElement(this.inputElement);
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
// Workaround https://github.com/vaadin/web-components/issues/2855
|
|
122
|
-
/** @protected */
|
|
123
|
-
_openedChanged(opened) {
|
|
124
|
-
super._openedChanged(opened);
|
|
125
|
-
|
|
126
|
-
this.$.overlay.positionTarget = this.inputElement;
|
|
127
|
-
this.$.overlay.noVerticalOverlap = true;
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
defineCustomElement(DatePickerLight);
|
|
132
|
-
|
|
133
|
-
export { DatePickerLight };
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright (c) 2016 - 2025 Vaadin Ltd.
|
|
4
|
-
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
|
-
*/
|
|
6
|
-
import '@vaadin/button/src/vaadin-lit-button.js';
|
|
7
|
-
import './vaadin-date-picker-month-scroller.js';
|
|
8
|
-
import './vaadin-date-picker-year-scroller.js';
|
|
9
|
-
import './vaadin-lit-date-picker-year.js';
|
|
10
|
-
import './vaadin-lit-month-calendar.js';
|
|
11
|
-
import { html, LitElement } from 'lit';
|
|
12
|
-
import { defineCustomElement } from '@vaadin/component-base/src/define.js';
|
|
13
|
-
import { DirMixin } from '@vaadin/component-base/src/dir-mixin.js';
|
|
14
|
-
import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
|
|
15
|
-
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
16
|
-
import { DatePickerOverlayContentMixin } from './vaadin-date-picker-overlay-content-mixin.js';
|
|
17
|
-
import { overlayContentStyles } from './vaadin-date-picker-overlay-content-styles.js';
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* @extends HTMLElement
|
|
21
|
-
* @private
|
|
22
|
-
*/
|
|
23
|
-
class DatePickerOverlayContent extends DatePickerOverlayContentMixin(
|
|
24
|
-
ThemableMixin(DirMixin(PolylitMixin(LitElement))),
|
|
25
|
-
) {
|
|
26
|
-
static get is() {
|
|
27
|
-
return 'vaadin-date-picker-overlay-content';
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
static get styles() {
|
|
31
|
-
return overlayContentStyles;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
/** @protected */
|
|
35
|
-
render() {
|
|
36
|
-
return html`
|
|
37
|
-
<div part="overlay-header" @touchend="${this._preventDefault}" aria-hidden="true">
|
|
38
|
-
<div part="label">${this._formatDisplayed(this.selectedDate, this.i18n, this.label)}</div>
|
|
39
|
-
<div part="clear-button" ?hidden="${!this.selectedDate}"></div>
|
|
40
|
-
<div part="toggle-button"></div>
|
|
41
|
-
|
|
42
|
-
<div part="years-toggle-button" ?hidden="${this._desktopMode}" aria-hidden="true">
|
|
43
|
-
${this._yearAfterXMonths(this._visibleMonthIndex)}
|
|
44
|
-
</div>
|
|
45
|
-
</div>
|
|
46
|
-
|
|
47
|
-
<div id="scrollers">
|
|
48
|
-
<slot name="months"></slot>
|
|
49
|
-
<slot name="years"></slot>
|
|
50
|
-
</div>
|
|
51
|
-
|
|
52
|
-
<div @touchend="${this._preventDefault}" role="toolbar" part="toolbar">
|
|
53
|
-
<slot name="today-button"></slot>
|
|
54
|
-
<slot name="cancel-button"></slot>
|
|
55
|
-
</div>
|
|
56
|
-
`;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
/** @protected */
|
|
60
|
-
firstUpdated() {
|
|
61
|
-
super.firstUpdated();
|
|
62
|
-
|
|
63
|
-
this.setAttribute('role', 'dialog');
|
|
64
|
-
|
|
65
|
-
this._addListeners();
|
|
66
|
-
this._initControllers();
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
defineCustomElement(DatePickerOverlayContent);
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright (c) 2016 - 2025 Vaadin Ltd.
|
|
4
|
-
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
|
-
*/
|
|
6
|
-
import { html, LitElement } from 'lit';
|
|
7
|
-
import { defineCustomElement } from '@vaadin/component-base/src/define.js';
|
|
8
|
-
import { DirMixin } from '@vaadin/component-base/src/dir-mixin.js';
|
|
9
|
-
import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
|
|
10
|
-
import { overlayStyles } from '@vaadin/overlay/src/vaadin-overlay-styles.js';
|
|
11
|
-
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
12
|
-
import { DatePickerOverlayMixin } from './vaadin-date-picker-overlay-mixin.js';
|
|
13
|
-
import { datePickerOverlayStyles } from './vaadin-date-picker-overlay-styles.js';
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* An element used internally by `<vaadin-date-picker>`. Not intended to be used separately.
|
|
17
|
-
*
|
|
18
|
-
* @extends HTMLElement
|
|
19
|
-
* @mixes DatePickerOverlayMixin
|
|
20
|
-
* @mixes DirMixin
|
|
21
|
-
* @mixes ThemableMixin
|
|
22
|
-
* @private
|
|
23
|
-
*/
|
|
24
|
-
class DatePickerOverlay extends DatePickerOverlayMixin(DirMixin(ThemableMixin(PolylitMixin(LitElement)))) {
|
|
25
|
-
static get is() {
|
|
26
|
-
return 'vaadin-date-picker-overlay';
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
static get styles() {
|
|
30
|
-
return [overlayStyles, datePickerOverlayStyles];
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
/** @protected */
|
|
34
|
-
render() {
|
|
35
|
-
return html`
|
|
36
|
-
<div id="backdrop" part="backdrop" ?hidden="${!this.withBackdrop}"></div>
|
|
37
|
-
<div part="overlay" id="overlay">
|
|
38
|
-
<div part="content" id="content">
|
|
39
|
-
<slot></slot>
|
|
40
|
-
</div>
|
|
41
|
-
</div>
|
|
42
|
-
`;
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
defineCustomElement(DatePickerOverlay);
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright (c) 2016 - 2025 Vaadin Ltd.
|
|
4
|
-
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
|
-
*/
|
|
6
|
-
import { css, html, LitElement } from 'lit';
|
|
7
|
-
import { defineCustomElement } from '@vaadin/component-base/src/define.js';
|
|
8
|
-
import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
|
|
9
|
-
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
10
|
-
import { DatePickerYearMixin } from './vaadin-date-picker-year-mixin.js';
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* @extends HTMLElement
|
|
14
|
-
* @mixes ThemableMixin
|
|
15
|
-
* @mixes DatePickerYearMixin
|
|
16
|
-
* @private
|
|
17
|
-
*/
|
|
18
|
-
export class DatePickerYear extends ThemableMixin(DatePickerYearMixin(PolylitMixin(LitElement))) {
|
|
19
|
-
static get is() {
|
|
20
|
-
return 'vaadin-date-picker-year';
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
static get styles() {
|
|
24
|
-
return css`
|
|
25
|
-
:host {
|
|
26
|
-
display: block;
|
|
27
|
-
height: 100%;
|
|
28
|
-
}
|
|
29
|
-
`;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
/** @protected */
|
|
33
|
-
render() {
|
|
34
|
-
return html`
|
|
35
|
-
<div part="year-number">${this.year}</div>
|
|
36
|
-
<div part="year-separator" aria-hidden="true"></div>
|
|
37
|
-
`;
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
defineCustomElement(DatePickerYear);
|