@vaadin/time-picker 25.2.7 → 25.2.9
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/custom-elements.json +3 -3
- package/package.json +14 -14
- package/src/vaadin-time-picker-helper.d.ts +3 -0
- package/src/vaadin-time-picker-helper.js +15 -7
- package/src/vaadin-time-picker-mixin.d.ts +5 -0
- package/src/vaadin-time-picker-mixin.js +43 -30
- package/web-types.json +3 -3
- package/web-types.lit.json +3 -3
package/custom-elements.json
CHANGED
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
}
|
|
75
75
|
}
|
|
76
76
|
],
|
|
77
|
-
"description": "A function to validate the time object based on the given step.",
|
|
77
|
+
"description": "A function to validate the time object based on the given step.\n\nReturns a new object, so that a time object owned by the caller, such as one\nreturned by the `i18n.parseTime` function, is left as it is.",
|
|
78
78
|
"return": {
|
|
79
79
|
"type": {
|
|
80
80
|
"text": "object | undefined"
|
|
@@ -301,7 +301,7 @@
|
|
|
301
301
|
"type": {
|
|
302
302
|
"text": "Object"
|
|
303
303
|
},
|
|
304
|
-
"description": "The object used to localize this component. To change the default\nlocalization, replace this with an object that provides both the\ntime parsing and formatting functions.\n\nThe object has the following JSON structure:\n\n```js\n{\n // A function to format given `Object` as\n // time string. Object is in the format `{ hours: ..., minutes: ..., seconds: ..., milliseconds: ... }`\n formatTime: (time) => {\n // returns a string representation of the given\n // object in `hh` / 'hh:mm' / 'hh:mm:ss' / 'hh:mm:ss.fff' - formats\n },\n\n // A function to parse the given text to an `Object` in the format\n // `{ hours: ..., minutes: ..., seconds: ..., milliseconds: ... }`.\n // Must properly parse (at least) text\n // formatted by `formatTime`.\n parseTime: text => {\n // Parses a string in object/string that can be formatted by`formatTime`.\n }\n}\n```\n\nNOTE: `formatTime` and `parseTime` must be implemented in a\ncompatible manner to ensure the component works properly.",
|
|
304
|
+
"description": "The object used to localize this component. To change the default\nlocalization, replace this with an object that provides both the\ntime parsing and formatting functions.\n\nThe object has the following JSON structure:\n\n```js\n{\n // A function to format given `Object` as\n // time string. Object is in the format `{ hours: ..., minutes: ..., seconds: ..., milliseconds: ... }`\n formatTime: (time) => {\n // returns a string representation of the given\n // object in `hh` / 'hh:mm' / 'hh:mm:ss' / 'hh:mm:ss.fff' - formats\n },\n\n // A function to parse the given text to an `Object` in the format\n // `{ hours: ..., minutes: ..., seconds: ..., milliseconds: ... }`.\n // Must properly parse (at least) text\n // formatted by `formatTime`.\n parseTime: text => {\n // Parses a string in object/string that can be formatted by`formatTime`.\n }\n}\n```\n\nNOTE: `formatTime` and `parseTime` must be implemented in a\ncompatible manner to ensure the component works properly.\n\nNOTE: these functions only apply to the text shown in the input field and\nin the dropdown. The `value`, `min` and `max` properties always use the\nISO 8601 format, and are never passed to `parseTime`, so implementations\ndo not need to accept ISO 8601 input.",
|
|
305
305
|
"attribute": "i18n",
|
|
306
306
|
"inheritedFrom": {
|
|
307
307
|
"name": "I18nMixin",
|
|
@@ -1066,7 +1066,7 @@
|
|
|
1066
1066
|
"type": {
|
|
1067
1067
|
"text": "Object"
|
|
1068
1068
|
},
|
|
1069
|
-
"description": "The object used to localize this component. To change the default\nlocalization, replace this with an object that provides both the\ntime parsing and formatting functions.\n\nThe object has the following JSON structure:\n\n```js\n{\n // A function to format given `Object` as\n // time string. Object is in the format `{ hours: ..., minutes: ..., seconds: ..., milliseconds: ... }`\n formatTime: (time) => {\n // returns a string representation of the given\n // object in `hh` / 'hh:mm' / 'hh:mm:ss' / 'hh:mm:ss.fff' - formats\n },\n\n // A function to parse the given text to an `Object` in the format\n // `{ hours: ..., minutes: ..., seconds: ..., milliseconds: ... }`.\n // Must properly parse (at least) text\n // formatted by `formatTime`.\n parseTime: text => {\n // Parses a string in object/string that can be formatted by`formatTime`.\n }\n}\n```\n\nNOTE: `formatTime` and `parseTime` must be implemented in a\ncompatible manner to ensure the component works properly.",
|
|
1069
|
+
"description": "The object used to localize this component. To change the default\nlocalization, replace this with an object that provides both the\ntime parsing and formatting functions.\n\nThe object has the following JSON structure:\n\n```js\n{\n // A function to format given `Object` as\n // time string. Object is in the format `{ hours: ..., minutes: ..., seconds: ..., milliseconds: ... }`\n formatTime: (time) => {\n // returns a string representation of the given\n // object in `hh` / 'hh:mm' / 'hh:mm:ss' / 'hh:mm:ss.fff' - formats\n },\n\n // A function to parse the given text to an `Object` in the format\n // `{ hours: ..., minutes: ..., seconds: ..., milliseconds: ... }`.\n // Must properly parse (at least) text\n // formatted by `formatTime`.\n parseTime: text => {\n // Parses a string in object/string that can be formatted by`formatTime`.\n }\n}\n```\n\nNOTE: `formatTime` and `parseTime` must be implemented in a\ncompatible manner to ensure the component works properly.\n\nNOTE: these functions only apply to the text shown in the input field and\nin the dropdown. The `value`, `min` and `max` properties always use the\nISO 8601 format, and are never passed to `parseTime`, so implementations\ndo not need to accept ISO 8601 input.",
|
|
1070
1070
|
"attribute": "i18n",
|
|
1071
1071
|
"inheritedFrom": {
|
|
1072
1072
|
"name": "I18nMixin",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vaadin/time-picker",
|
|
3
|
-
"version": "25.2.
|
|
3
|
+
"version": "25.2.9",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -35,22 +35,22 @@
|
|
|
35
35
|
],
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"@open-wc/dedupe-mixin": "^1.3.0",
|
|
38
|
-
"@vaadin/a11y-base": "~25.2.
|
|
39
|
-
"@vaadin/combo-box": "~25.2.
|
|
40
|
-
"@vaadin/component-base": "~25.2.
|
|
41
|
-
"@vaadin/field-base": "~25.2.
|
|
42
|
-
"@vaadin/input-container": "~25.2.
|
|
43
|
-
"@vaadin/item": "~25.2.
|
|
44
|
-
"@vaadin/overlay": "~25.2.
|
|
45
|
-
"@vaadin/vaadin-themable-mixin": "~25.2.
|
|
38
|
+
"@vaadin/a11y-base": "~25.2.9",
|
|
39
|
+
"@vaadin/combo-box": "~25.2.9",
|
|
40
|
+
"@vaadin/component-base": "~25.2.9",
|
|
41
|
+
"@vaadin/field-base": "~25.2.9",
|
|
42
|
+
"@vaadin/input-container": "~25.2.9",
|
|
43
|
+
"@vaadin/item": "~25.2.9",
|
|
44
|
+
"@vaadin/overlay": "~25.2.9",
|
|
45
|
+
"@vaadin/vaadin-themable-mixin": "~25.2.9",
|
|
46
46
|
"lit": "^3.0.0"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
|
-
"@vaadin/aura": "~25.2.
|
|
50
|
-
"@vaadin/chai-plugins": "~25.2.
|
|
51
|
-
"@vaadin/test-runner-commands": "~25.2.
|
|
49
|
+
"@vaadin/aura": "~25.2.9",
|
|
50
|
+
"@vaadin/chai-plugins": "~25.2.9",
|
|
51
|
+
"@vaadin/test-runner-commands": "~25.2.9",
|
|
52
52
|
"@vaadin/testing-helpers": "^2.0.0",
|
|
53
|
-
"@vaadin/vaadin-lumo-styles": "~25.2.
|
|
53
|
+
"@vaadin/vaadin-lumo-styles": "~25.2.9",
|
|
54
54
|
"sinon": "^22.0.0"
|
|
55
55
|
},
|
|
56
56
|
"customElements": "custom-elements.json",
|
|
@@ -58,5 +58,5 @@
|
|
|
58
58
|
"web-types.json",
|
|
59
59
|
"web-types.lit.json"
|
|
60
60
|
],
|
|
61
|
-
"gitHead": "
|
|
61
|
+
"gitHead": "233d7875d586aca82b9cd43f19616bd6a4e81631"
|
|
62
62
|
}
|
|
@@ -25,6 +25,9 @@ export function parseISOTime(timeString: string): TimePickerTime | undefined;
|
|
|
25
25
|
|
|
26
26
|
/**
|
|
27
27
|
* A function to validate the time object based on the given step.
|
|
28
|
+
*
|
|
29
|
+
* Returns a new object, so that a time object owned by the caller, such as one
|
|
30
|
+
* returned by the `i18n.parseTime` function, is left as it is.
|
|
28
31
|
*/
|
|
29
32
|
export function validateTime(
|
|
30
33
|
timeObject: TimePickerTime | undefined,
|
|
@@ -75,17 +75,25 @@ function getStepSegment(stepValue) {
|
|
|
75
75
|
/**
|
|
76
76
|
* A function to validate the time object based on the given step.
|
|
77
77
|
*
|
|
78
|
+
* Returns a new object, so that a time object owned by the caller, such as one
|
|
79
|
+
* returned by the `i18n.parseTime` function, is left as it is.
|
|
80
|
+
*
|
|
78
81
|
* @param {object} timeObject
|
|
79
82
|
* @param {number} step
|
|
80
83
|
* @return {object | undefined}
|
|
81
84
|
*/
|
|
82
85
|
export function validateTime(timeObject, step) {
|
|
83
|
-
if (timeObject) {
|
|
84
|
-
|
|
85
|
-
timeObject.hours = parseInt(timeObject.hours);
|
|
86
|
-
timeObject.minutes = parseInt(timeObject.minutes || 0);
|
|
87
|
-
timeObject.seconds = stepSegment < 3 ? undefined : parseInt(timeObject.seconds || 0);
|
|
88
|
-
timeObject.milliseconds = stepSegment < 4 ? undefined : parseInt(timeObject.milliseconds || 0);
|
|
86
|
+
if (!timeObject) {
|
|
87
|
+
return timeObject;
|
|
89
88
|
}
|
|
90
|
-
|
|
89
|
+
|
|
90
|
+
const stepSegment = getStepSegment(step);
|
|
91
|
+
|
|
92
|
+
return {
|
|
93
|
+
...timeObject,
|
|
94
|
+
hours: parseInt(timeObject.hours),
|
|
95
|
+
minutes: parseInt(timeObject.minutes || 0),
|
|
96
|
+
seconds: stepSegment < 3 ? undefined : parseInt(timeObject.seconds || 0),
|
|
97
|
+
milliseconds: stepSegment < 4 ? undefined : parseInt(timeObject.milliseconds || 0),
|
|
98
|
+
};
|
|
91
99
|
}
|
|
@@ -129,6 +129,11 @@ export declare class TimePickerMixinClass {
|
|
|
129
129
|
*
|
|
130
130
|
* NOTE: `formatTime` and `parseTime` must be implemented in a
|
|
131
131
|
* compatible manner to ensure the component works properly.
|
|
132
|
+
*
|
|
133
|
+
* NOTE: these functions only apply to the text shown in the input field and
|
|
134
|
+
* in the dropdown. The `value`, `min` and `max` properties always use the
|
|
135
|
+
* ISO 8601 format, and are never passed to `parseTime`, so implementations
|
|
136
|
+
* do not need to accept ISO 8601 input.
|
|
132
137
|
*/
|
|
133
138
|
i18n: TimePickerI18n;
|
|
134
139
|
}
|
|
@@ -108,9 +108,8 @@ export const TimePickerMixin = (superClass) =>
|
|
|
108
108
|
static get observers() {
|
|
109
109
|
return [
|
|
110
110
|
'_openedOrItemsChanged(opened, _dropdownItems)',
|
|
111
|
-
'_updateScroller(opened, _dropdownItems, _focusedIndex, _theme)',
|
|
111
|
+
'_updateScroller(opened, _dropdownItems, _focusedIndex, _theme, _comboBoxValue)',
|
|
112
112
|
'__updateAriaAttributes(_dropdownItems, opened, inputElement)',
|
|
113
|
-
'__updateDropdownItems(__effectiveI18n, min, max, step)',
|
|
114
113
|
];
|
|
115
114
|
}
|
|
116
115
|
|
|
@@ -169,6 +168,11 @@ export const TimePickerMixin = (superClass) =>
|
|
|
169
168
|
* NOTE: `formatTime` and `parseTime` must be implemented in a
|
|
170
169
|
* compatible manner to ensure the component works properly.
|
|
171
170
|
*
|
|
171
|
+
* NOTE: these functions only apply to the text shown in the input field and
|
|
172
|
+
* in the dropdown. The `value`, `min` and `max` properties always use the
|
|
173
|
+
* ISO 8601 format, and are never passed to `parseTime`, so implementations
|
|
174
|
+
* do not need to accept ISO 8601 input.
|
|
175
|
+
*
|
|
172
176
|
* @type {!TimePickerI18n}
|
|
173
177
|
*/
|
|
174
178
|
get i18n() {
|
|
@@ -229,9 +233,16 @@ export const TimePickerMixin = (superClass) =>
|
|
|
229
233
|
updated(props) {
|
|
230
234
|
super.updated(props);
|
|
231
235
|
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
236
|
+
if (['__effectiveI18n', 'min', 'max', 'step'].some((prop) => props.has(prop))) {
|
|
237
|
+
this.__updateDropdownItems();
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
if (props.has('step')) {
|
|
241
|
+
this.__updateValue(this.__getTimeObject(this.value));
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
if (props.has('__effectiveI18n') && this.value) {
|
|
245
|
+
this.__updateInputValue(this.__getTimeObject(this.value));
|
|
235
246
|
}
|
|
236
247
|
}
|
|
237
248
|
|
|
@@ -244,7 +255,7 @@ export const TimePickerMixin = (superClass) =>
|
|
|
244
255
|
checkValidity() {
|
|
245
256
|
return !!(
|
|
246
257
|
this.inputElement.checkValidity() &&
|
|
247
|
-
(!this.value || this._timeAllowed(
|
|
258
|
+
(!this.value || this._timeAllowed(parseISOTime(this.value))) &&
|
|
248
259
|
(!this._comboBoxValue || this.__effectiveI18n.parseTime(this._comboBoxValue))
|
|
249
260
|
);
|
|
250
261
|
}
|
|
@@ -259,7 +270,7 @@ export const TimePickerMixin = (superClass) =>
|
|
|
259
270
|
}
|
|
260
271
|
|
|
261
272
|
/** @private */
|
|
262
|
-
_updateScroller(opened, items, focusedIndex, theme) {
|
|
273
|
+
_updateScroller(opened, items, focusedIndex, theme, comboBoxValue) {
|
|
263
274
|
if (opened) {
|
|
264
275
|
this._scroller.style.maxHeight =
|
|
265
276
|
getComputedStyle(this).getPropertyValue(`--${this._tagNamePrefix}-overlay-max-height`) || '65vh';
|
|
@@ -270,6 +281,7 @@ export const TimePickerMixin = (superClass) =>
|
|
|
270
281
|
opened,
|
|
271
282
|
focusedIndex,
|
|
272
283
|
theme,
|
|
284
|
+
selectedItem: items?.find((item) => item.value === comboBoxValue),
|
|
273
285
|
});
|
|
274
286
|
}
|
|
275
287
|
|
|
@@ -461,6 +473,15 @@ export const TimePickerMixin = (superClass) =>
|
|
|
461
473
|
return result;
|
|
462
474
|
}
|
|
463
475
|
|
|
476
|
+
/**
|
|
477
|
+
* Returning Object in the format `{ hours: ..., minutes: ..., seconds: ..., milliseconds: ... }`
|
|
478
|
+
* from an ISO 8601 time, stripped to the resolution defined by the step.
|
|
479
|
+
* @private
|
|
480
|
+
*/
|
|
481
|
+
__getTimeObject(timeString) {
|
|
482
|
+
return validateTime(parseISOTime(timeString), this.step);
|
|
483
|
+
}
|
|
484
|
+
|
|
464
485
|
/**
|
|
465
486
|
* Returning seconds from Object in the format `{ hours: ..., minutes: ..., seconds: ..., milliseconds: ... }`
|
|
466
487
|
* @private
|
|
@@ -507,24 +528,11 @@ export const TimePickerMixin = (superClass) =>
|
|
|
507
528
|
}
|
|
508
529
|
|
|
509
530
|
/** @private */
|
|
510
|
-
__updateDropdownItems(
|
|
511
|
-
const
|
|
512
|
-
const
|
|
513
|
-
|
|
514
|
-
const maxTimeObj = validateTime(parseISOTime(max || MAX_ALLOWED_TIME), step);
|
|
515
|
-
const maxSec = this.__getSec(maxTimeObj);
|
|
516
|
-
|
|
517
|
-
this._dropdownItems = this.__generateDropdownList(minSec, maxSec, step);
|
|
531
|
+
__updateDropdownItems() {
|
|
532
|
+
const minSec = this.__getSec(this.__getTimeObject(this.min || MIN_ALLOWED_TIME));
|
|
533
|
+
const maxSec = this.__getSec(this.__getTimeObject(this.max || MAX_ALLOWED_TIME));
|
|
518
534
|
|
|
519
|
-
|
|
520
|
-
this.__oldStep = step;
|
|
521
|
-
const parsedObj = validateTime(parseISOTime(this.value), step);
|
|
522
|
-
this.__updateValue(parsedObj);
|
|
523
|
-
}
|
|
524
|
-
|
|
525
|
-
if (this.value) {
|
|
526
|
-
this._comboBoxValue = effectiveI18n.formatTime(effectiveI18n.parseTime(this.value));
|
|
527
|
-
}
|
|
535
|
+
this._dropdownItems = this.__generateDropdownList(minSec, maxSec, this.step);
|
|
528
536
|
}
|
|
529
537
|
|
|
530
538
|
/** @private */
|
|
@@ -572,7 +580,8 @@ export const TimePickerMixin = (superClass) =>
|
|
|
572
580
|
* @override
|
|
573
581
|
*/
|
|
574
582
|
_valueChanged(value, oldValue) {
|
|
575
|
-
|
|
583
|
+
// Strip value to the step resolution before marking as committed.
|
|
584
|
+
const parsedObj = (this.__memoValue = this.__getTimeObject(value));
|
|
576
585
|
const newValue = formatISOTime(parsedObj) || '';
|
|
577
586
|
|
|
578
587
|
// Mark value set programmatically by the user
|
|
@@ -605,7 +614,11 @@ export const TimePickerMixin = (superClass) =>
|
|
|
605
614
|
return;
|
|
606
615
|
}
|
|
607
616
|
|
|
608
|
-
const
|
|
617
|
+
const parsed = this.__useMemo ? this.__memoValue : this.__effectiveI18n.parseTime(value);
|
|
618
|
+
|
|
619
|
+
// Strip parsed time to the resolution defined by the step before formatting
|
|
620
|
+
// it back, so that the result matches the text shown in the input field.
|
|
621
|
+
const parsedObj = validateTime(parsed, this.step);
|
|
609
622
|
const newValue = this.__effectiveI18n.formatTime(parsedObj) || '';
|
|
610
623
|
|
|
611
624
|
if (parsedObj) {
|
|
@@ -656,12 +669,12 @@ export const TimePickerMixin = (superClass) =>
|
|
|
656
669
|
* @protected
|
|
657
670
|
*/
|
|
658
671
|
_timeAllowed(time) {
|
|
659
|
-
const parsedMin =
|
|
660
|
-
const parsedMax =
|
|
672
|
+
const parsedMin = parseISOTime(this.min || MIN_ALLOWED_TIME);
|
|
673
|
+
const parsedMax = parseISOTime(this.max || MAX_ALLOWED_TIME);
|
|
661
674
|
|
|
662
675
|
return (
|
|
663
|
-
(!
|
|
664
|
-
(!
|
|
676
|
+
(!parsedMin || this.__getMsec(time) >= this.__getMsec(parsedMin)) &&
|
|
677
|
+
(!parsedMax || this.__getMsec(time) <= this.__getMsec(parsedMax))
|
|
665
678
|
);
|
|
666
679
|
}
|
|
667
680
|
|
package/web-types.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/web-types",
|
|
3
3
|
"name": "@vaadin/time-picker",
|
|
4
|
-
"version": "25.2.
|
|
4
|
+
"version": "25.2.9",
|
|
5
5
|
"description-markup": "markdown",
|
|
6
6
|
"contributions": {
|
|
7
7
|
"html": {
|
|
8
8
|
"elements": [
|
|
9
9
|
{
|
|
10
10
|
"name": "vaadin-time-picker",
|
|
11
|
-
"description": "`<vaadin-time-picker>` is a Web Component providing a time-selection field.\n\n```html\n<vaadin-time-picker></vaadin-time-picker>\n```\n```js\ntimePicker.value = '14:30';\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`--vaadin-time-picker-overlay-width` | Width of the overlay | `auto`\n`--vaadin-time-picker-overlay-max-height`| Max height of the overlay | `65vh`\n\nThe following shadow DOM parts are available for styling:\n\nPart name | Description\n---------------------|----------------\n`label` | The label element\n`input-field` | The element that wraps prefix, value and buttons\n`field-button` | Set on both clear and toggle buttons\n`clear-button` | The clear button\n`error-message` | The error message element\n`helper-text` | The helper text element wrapper\n`required-indicator` | The `required` state indicator element\n`toggle-button` | The toggle button\n`overlay` | The overlay container\n`content` | The overlay content\n\nThe following state attributes are available for styling:\n\nAttribute | Description\n---------------------|---------------------------------\n`disabled` | Set when the element is disabled\n`has-value` | Set when the element has a value\n`has-label` | Set when the element has a label\n`has-helper` | Set when the element has helper text or slot\n`has-error-message` | Set when the element has an error message\n`has-tooltip` | Set when the element has a slotted tooltip\n`invalid` | Set when the element is invalid\n`focused` | Set when the element is focused\n`focus-ring` | Set when the element is keyboard focused\n`readonly` | Set when the element is readonly\n`opened` | Set when the overlay is opened\n\n### Internal components\n\nIn addition to `<vaadin-time-picker>` itself, the following internal\ncomponents are themable:\n\n- `<vaadin-time-picker-item>` - has the same API as [`<vaadin-item>`](https://cdn.vaadin.com/vaadin-web-components/25.2.
|
|
11
|
+
"description": "`<vaadin-time-picker>` is a Web Component providing a time-selection field.\n\n```html\n<vaadin-time-picker></vaadin-time-picker>\n```\n```js\ntimePicker.value = '14:30';\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`--vaadin-time-picker-overlay-width` | Width of the overlay | `auto`\n`--vaadin-time-picker-overlay-max-height`| Max height of the overlay | `65vh`\n\nThe following shadow DOM parts are available for styling:\n\nPart name | Description\n---------------------|----------------\n`label` | The label element\n`input-field` | The element that wraps prefix, value and buttons\n`field-button` | Set on both clear and toggle buttons\n`clear-button` | The clear button\n`error-message` | The error message element\n`helper-text` | The helper text element wrapper\n`required-indicator` | The `required` state indicator element\n`toggle-button` | The toggle button\n`overlay` | The overlay container\n`content` | The overlay content\n\nThe following state attributes are available for styling:\n\nAttribute | Description\n---------------------|---------------------------------\n`disabled` | Set when the element is disabled\n`has-value` | Set when the element has a value\n`has-label` | Set when the element has a label\n`has-helper` | Set when the element has helper text or slot\n`has-error-message` | Set when the element has an error message\n`has-tooltip` | Set when the element has a slotted tooltip\n`invalid` | Set when the element is invalid\n`focused` | Set when the element is focused\n`focus-ring` | Set when the element is keyboard focused\n`readonly` | Set when the element is readonly\n`opened` | Set when the overlay is opened\n\n### Internal components\n\nIn addition to `<vaadin-time-picker>` itself, the following internal\ncomponents are themable:\n\n- `<vaadin-time-picker-item>` - has the same API as [`<vaadin-item>`](https://cdn.vaadin.com/vaadin-web-components/25.2.9/#/elements/vaadin-item).\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",
|
|
12
12
|
"attributes": [
|
|
13
13
|
{
|
|
14
14
|
"name": "accessible-name",
|
|
@@ -332,7 +332,7 @@
|
|
|
332
332
|
},
|
|
333
333
|
{
|
|
334
334
|
"name": "i18n",
|
|
335
|
-
"description": "The object used to localize this component. To change the default\nlocalization, replace this with an object that provides both the\ntime parsing and formatting functions.\n\nThe object has the following JSON structure:\n\n```js\n{\n // A function to format given `Object` as\n // time string. Object is in the format `{ hours: ..., minutes: ..., seconds: ..., milliseconds: ... }`\n formatTime: (time) => {\n // returns a string representation of the given\n // object in `hh` / 'hh:mm' / 'hh:mm:ss' / 'hh:mm:ss.fff' - formats\n },\n\n // A function to parse the given text to an `Object` in the format\n // `{ hours: ..., minutes: ..., seconds: ..., milliseconds: ... }`.\n // Must properly parse (at least) text\n // formatted by `formatTime`.\n parseTime: text => {\n // Parses a string in object/string that can be formatted by`formatTime`.\n }\n}\n```\n\nNOTE: `formatTime` and `parseTime` must be implemented in a\ncompatible manner to ensure the component works properly.",
|
|
335
|
+
"description": "The object used to localize this component. To change the default\nlocalization, replace this with an object that provides both the\ntime parsing and formatting functions.\n\nThe object has the following JSON structure:\n\n```js\n{\n // A function to format given `Object` as\n // time string. Object is in the format `{ hours: ..., minutes: ..., seconds: ..., milliseconds: ... }`\n formatTime: (time) => {\n // returns a string representation of the given\n // object in `hh` / 'hh:mm' / 'hh:mm:ss' / 'hh:mm:ss.fff' - formats\n },\n\n // A function to parse the given text to an `Object` in the format\n // `{ hours: ..., minutes: ..., seconds: ..., milliseconds: ... }`.\n // Must properly parse (at least) text\n // formatted by `formatTime`.\n parseTime: text => {\n // Parses a string in object/string that can be formatted by`formatTime`.\n }\n}\n```\n\nNOTE: `formatTime` and `parseTime` must be implemented in a\ncompatible manner to ensure the component works properly.\n\nNOTE: these functions only apply to the text shown in the input field and\nin the dropdown. The `value`, `min` and `max` properties always use the\nISO 8601 format, and are never passed to `parseTime`, so implementations\ndo not need to accept ISO 8601 input.",
|
|
336
336
|
"value": {
|
|
337
337
|
"type": [
|
|
338
338
|
"Object"
|
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/time-picker",
|
|
4
|
-
"version": "25.2.
|
|
4
|
+
"version": "25.2.9",
|
|
5
5
|
"description-markup": "markdown",
|
|
6
6
|
"framework": "lit",
|
|
7
7
|
"framework-config": {
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"elements": [
|
|
17
17
|
{
|
|
18
18
|
"name": "vaadin-time-picker",
|
|
19
|
-
"description": "`<vaadin-time-picker>` is a Web Component providing a time-selection field.\n\n```html\n<vaadin-time-picker></vaadin-time-picker>\n```\n```js\ntimePicker.value = '14:30';\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`--vaadin-time-picker-overlay-width` | Width of the overlay | `auto`\n`--vaadin-time-picker-overlay-max-height`| Max height of the overlay | `65vh`\n\nThe following shadow DOM parts are available for styling:\n\nPart name | Description\n---------------------|----------------\n`label` | The label element\n`input-field` | The element that wraps prefix, value and buttons\n`field-button` | Set on both clear and toggle buttons\n`clear-button` | The clear button\n`error-message` | The error message element\n`helper-text` | The helper text element wrapper\n`required-indicator` | The `required` state indicator element\n`toggle-button` | The toggle button\n`overlay` | The overlay container\n`content` | The overlay content\n\nThe following state attributes are available for styling:\n\nAttribute | Description\n---------------------|---------------------------------\n`disabled` | Set when the element is disabled\n`has-value` | Set when the element has a value\n`has-label` | Set when the element has a label\n`has-helper` | Set when the element has helper text or slot\n`has-error-message` | Set when the element has an error message\n`has-tooltip` | Set when the element has a slotted tooltip\n`invalid` | Set when the element is invalid\n`focused` | Set when the element is focused\n`focus-ring` | Set when the element is keyboard focused\n`readonly` | Set when the element is readonly\n`opened` | Set when the overlay is opened\n\n### Internal components\n\nIn addition to `<vaadin-time-picker>` itself, the following internal\ncomponents are themable:\n\n- `<vaadin-time-picker-item>` - has the same API as [`<vaadin-item>`](https://cdn.vaadin.com/vaadin-web-components/25.2.
|
|
19
|
+
"description": "`<vaadin-time-picker>` is a Web Component providing a time-selection field.\n\n```html\n<vaadin-time-picker></vaadin-time-picker>\n```\n```js\ntimePicker.value = '14:30';\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`--vaadin-time-picker-overlay-width` | Width of the overlay | `auto`\n`--vaadin-time-picker-overlay-max-height`| Max height of the overlay | `65vh`\n\nThe following shadow DOM parts are available for styling:\n\nPart name | Description\n---------------------|----------------\n`label` | The label element\n`input-field` | The element that wraps prefix, value and buttons\n`field-button` | Set on both clear and toggle buttons\n`clear-button` | The clear button\n`error-message` | The error message element\n`helper-text` | The helper text element wrapper\n`required-indicator` | The `required` state indicator element\n`toggle-button` | The toggle button\n`overlay` | The overlay container\n`content` | The overlay content\n\nThe following state attributes are available for styling:\n\nAttribute | Description\n---------------------|---------------------------------\n`disabled` | Set when the element is disabled\n`has-value` | Set when the element has a value\n`has-label` | Set when the element has a label\n`has-helper` | Set when the element has helper text or slot\n`has-error-message` | Set when the element has an error message\n`has-tooltip` | Set when the element has a slotted tooltip\n`invalid` | Set when the element is invalid\n`focused` | Set when the element is focused\n`focus-ring` | Set when the element is keyboard focused\n`readonly` | Set when the element is readonly\n`opened` | Set when the overlay is opened\n\n### Internal components\n\nIn addition to `<vaadin-time-picker>` itself, the following internal\ncomponents are themable:\n\n- `<vaadin-time-picker-item>` - has the same API as [`<vaadin-item>`](https://cdn.vaadin.com/vaadin-web-components/25.2.9/#/elements/vaadin-item).\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",
|
|
20
20
|
"extension": true,
|
|
21
21
|
"attributes": [
|
|
22
22
|
{
|
|
@@ -91,7 +91,7 @@
|
|
|
91
91
|
},
|
|
92
92
|
{
|
|
93
93
|
"name": ".i18n",
|
|
94
|
-
"description": "The object used to localize this component. To change the default\nlocalization, replace this with an object that provides both the\ntime parsing and formatting functions.\n\nThe object has the following JSON structure:\n\n```js\n{\n // A function to format given `Object` as\n // time string. Object is in the format `{ hours: ..., minutes: ..., seconds: ..., milliseconds: ... }`\n formatTime: (time) => {\n // returns a string representation of the given\n // object in `hh` / 'hh:mm' / 'hh:mm:ss' / 'hh:mm:ss.fff' - formats\n },\n\n // A function to parse the given text to an `Object` in the format\n // `{ hours: ..., minutes: ..., seconds: ..., milliseconds: ... }`.\n // Must properly parse (at least) text\n // formatted by `formatTime`.\n parseTime: text => {\n // Parses a string in object/string that can be formatted by`formatTime`.\n }\n}\n```\n\nNOTE: `formatTime` and `parseTime` must be implemented in a\ncompatible manner to ensure the component works properly.",
|
|
94
|
+
"description": "The object used to localize this component. To change the default\nlocalization, replace this with an object that provides both the\ntime parsing and formatting functions.\n\nThe object has the following JSON structure:\n\n```js\n{\n // A function to format given `Object` as\n // time string. Object is in the format `{ hours: ..., minutes: ..., seconds: ..., milliseconds: ... }`\n formatTime: (time) => {\n // returns a string representation of the given\n // object in `hh` / 'hh:mm' / 'hh:mm:ss' / 'hh:mm:ss.fff' - formats\n },\n\n // A function to parse the given text to an `Object` in the format\n // `{ hours: ..., minutes: ..., seconds: ..., milliseconds: ... }`.\n // Must properly parse (at least) text\n // formatted by `formatTime`.\n parseTime: text => {\n // Parses a string in object/string that can be formatted by`formatTime`.\n }\n}\n```\n\nNOTE: `formatTime` and `parseTime` must be implemented in a\ncompatible manner to ensure the component works properly.\n\nNOTE: these functions only apply to the text shown in the input field and\nin the dropdown. The `value`, `min` and `max` properties always use the\nISO 8601 format, and are never passed to `parseTime`, so implementations\ndo not need to accept ISO 8601 input.",
|
|
95
95
|
"value": {
|
|
96
96
|
"kind": "expression"
|
|
97
97
|
}
|