@vaadin/time-picker 25.1.10 → 25.1.11

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.
@@ -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"
@@ -260,7 +260,7 @@
260
260
  "type": {
261
261
  "text": "Object"
262
262
  },
263
- "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.",
263
+ "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.",
264
264
  "attribute": "i18n",
265
265
  "inheritedFrom": {
266
266
  "name": "I18nMixin",
@@ -780,7 +780,7 @@
780
780
  "type": {
781
781
  "text": "Object"
782
782
  },
783
- "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.",
783
+ "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.",
784
784
  "attribute": "i18n",
785
785
  "inheritedFrom": {
786
786
  "name": "I18nMixin",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vaadin/time-picker",
3
- "version": "25.1.10",
3
+ "version": "25.1.11",
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.1.10",
39
- "@vaadin/combo-box": "~25.1.10",
40
- "@vaadin/component-base": "~25.1.10",
41
- "@vaadin/field-base": "~25.1.10",
42
- "@vaadin/input-container": "~25.1.10",
43
- "@vaadin/item": "~25.1.10",
44
- "@vaadin/overlay": "~25.1.10",
45
- "@vaadin/vaadin-themable-mixin": "~25.1.10",
38
+ "@vaadin/a11y-base": "~25.1.11",
39
+ "@vaadin/combo-box": "~25.1.11",
40
+ "@vaadin/component-base": "~25.1.11",
41
+ "@vaadin/field-base": "~25.1.11",
42
+ "@vaadin/input-container": "~25.1.11",
43
+ "@vaadin/item": "~25.1.11",
44
+ "@vaadin/overlay": "~25.1.11",
45
+ "@vaadin/vaadin-themable-mixin": "~25.1.11",
46
46
  "lit": "^3.0.0"
47
47
  },
48
48
  "devDependencies": {
49
- "@vaadin/aura": "~25.1.10",
50
- "@vaadin/chai-plugins": "~25.1.10",
51
- "@vaadin/test-runner-commands": "~25.1.10",
49
+ "@vaadin/aura": "~25.1.11",
50
+ "@vaadin/chai-plugins": "~25.1.11",
51
+ "@vaadin/test-runner-commands": "~25.1.11",
52
52
  "@vaadin/testing-helpers": "^2.0.0",
53
- "@vaadin/vaadin-lumo-styles": "~25.1.10",
53
+ "@vaadin/vaadin-lumo-styles": "~25.1.11",
54
54
  "sinon": "^21.0.2"
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": "941297a1015ae11bb75d90c0b3c52302e741a528"
61
+ "gitHead": "96aa0ee7f6cfa81a59155963fc71cd259be854c2"
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
- const stepSegment = getStepSegment(step);
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
- return timeObject;
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
  }
@@ -117,7 +117,7 @@ export const TimePickerMixin = (superClass) =>
117
117
  static get observers() {
118
118
  return [
119
119
  '_openedOrItemsChanged(opened, _dropdownItems)',
120
- '_updateScroller(opened, _dropdownItems, _focusedIndex, _theme)',
120
+ '_updateScroller(opened, _dropdownItems, _focusedIndex, _theme, _comboBoxValue)',
121
121
  '__updateAriaAttributes(_dropdownItems, opened, inputElement)',
122
122
  '__updateDropdownItems(__effectiveI18n, min, max, step)',
123
123
  ];
@@ -174,6 +174,11 @@ export const TimePickerMixin = (superClass) =>
174
174
  * NOTE: `formatTime` and `parseTime` must be implemented in a
175
175
  * compatible manner to ensure the component works properly.
176
176
  *
177
+ * NOTE: these functions only apply to the text shown in the input field and
178
+ * in the dropdown. The `value`, `min` and `max` properties always use the
179
+ * ISO 8601 format, and are never passed to `parseTime`, so implementations
180
+ * do not need to accept ISO 8601 input.
181
+ *
177
182
  * @type {!TimePickerI18n}
178
183
  */
179
184
  get i18n() {
@@ -230,16 +235,6 @@ export const TimePickerMixin = (superClass) =>
230
235
  this.addController(this._tooltipController);
231
236
  }
232
237
 
233
- /** @protected */
234
- updated(props) {
235
- super.updated(props);
236
-
237
- // Update selected item in the scroller
238
- if (props.has('_comboBoxValue') && this._dropdownItems) {
239
- this._scroller.selectedItem = this._dropdownItems.find((item) => item.value === this._comboBoxValue);
240
- }
241
- }
242
-
243
238
  /**
244
239
  * Returns true if the current input value satisfies all constraints (if any).
245
240
  * You can override this method for custom validations.
@@ -249,7 +244,7 @@ export const TimePickerMixin = (superClass) =>
249
244
  checkValidity() {
250
245
  return !!(
251
246
  this.inputElement.checkValidity() &&
252
- (!this.value || this._timeAllowed(this.__effectiveI18n.parseTime(this.value))) &&
247
+ (!this.value || this._timeAllowed(parseISOTime(this.value))) &&
253
248
  (!this._comboBoxValue || this.__effectiveI18n.parseTime(this._comboBoxValue))
254
249
  );
255
250
  }
@@ -264,7 +259,7 @@ export const TimePickerMixin = (superClass) =>
264
259
  }
265
260
 
266
261
  /** @private */
267
- _updateScroller(opened, items, focusedIndex, theme) {
262
+ _updateScroller(opened, items, focusedIndex, theme, comboBoxValue) {
268
263
  if (opened) {
269
264
  this._scroller.style.maxHeight =
270
265
  getComputedStyle(this).getPropertyValue(`--${this._tagNamePrefix}-overlay-max-height`) || '65vh';
@@ -275,6 +270,7 @@ export const TimePickerMixin = (superClass) =>
275
270
  opened,
276
271
  focusedIndex,
277
272
  theme,
273
+ selectedItem: items && items.find((item) => item.value === comboBoxValue),
278
274
  });
279
275
  }
280
276
 
@@ -521,14 +517,15 @@ export const TimePickerMixin = (superClass) =>
521
517
 
522
518
  this._dropdownItems = this.__generateDropdownList(minSec, maxSec, step);
523
519
 
520
+ const parsedValue = validateTime(parseISOTime(this.value), step);
521
+
524
522
  if (step !== this.__oldStep) {
525
523
  this.__oldStep = step;
526
- const parsedObj = validateTime(parseISOTime(this.value), step);
527
- this.__updateValue(parsedObj);
524
+ this.__updateValue(parsedValue);
528
525
  }
529
526
 
530
527
  if (this.value) {
531
- this._comboBoxValue = effectiveI18n.formatTime(effectiveI18n.parseTime(this.value));
528
+ this._comboBoxValue = effectiveI18n.formatTime(parsedValue);
532
529
  }
533
530
  }
534
531
 
@@ -610,7 +607,11 @@ export const TimePickerMixin = (superClass) =>
610
607
  return;
611
608
  }
612
609
 
613
- const parsedObj = this.__useMemo ? this.__memoValue : this.__effectiveI18n.parseTime(value);
610
+ const parsed = this.__useMemo ? this.__memoValue : this.__effectiveI18n.parseTime(value);
611
+
612
+ // Strip parsed time to the resolution defined by the step before formatting
613
+ // it back, so that the result matches the text shown in the input field.
614
+ const parsedObj = validateTime(parsed, this.step);
614
615
  const newValue = this.__effectiveI18n.formatTime(parsedObj) || '';
615
616
 
616
617
  if (parsedObj) {
@@ -661,12 +662,12 @@ export const TimePickerMixin = (superClass) =>
661
662
  * @protected
662
663
  */
663
664
  _timeAllowed(time) {
664
- const parsedMin = this.__effectiveI18n.parseTime(this.min || MIN_ALLOWED_TIME);
665
- const parsedMax = this.__effectiveI18n.parseTime(this.max || MAX_ALLOWED_TIME);
665
+ const parsedMin = parseISOTime(this.min || MIN_ALLOWED_TIME);
666
+ const parsedMax = parseISOTime(this.max || MAX_ALLOWED_TIME);
666
667
 
667
668
  return (
668
- (!this.__getMsec(parsedMin) || this.__getMsec(time) >= this.__getMsec(parsedMin)) &&
669
- (!this.__getMsec(parsedMax) || this.__getMsec(time) <= this.__getMsec(parsedMax))
669
+ (!parsedMin || this.__getMsec(time) >= this.__getMsec(parsedMin)) &&
670
+ (!parsedMax || this.__getMsec(time) <= this.__getMsec(parsedMax))
670
671
  );
671
672
  }
672
673
 
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.1.10",
4
+ "version": "25.1.11",
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.1.10/#/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",
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.1.11/#/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",
@@ -411,7 +411,7 @@
411
411
  },
412
412
  {
413
413
  "name": "i18n",
414
- "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.",
414
+ "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.",
415
415
  "value": {
416
416
  "type": [
417
417
  "?"
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/web-types",
3
3
  "name": "@vaadin/time-picker",
4
- "version": "25.1.10",
4
+ "version": "25.1.11",
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.1.10/#/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",
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.1.11/#/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
  {
@@ -126,7 +126,7 @@
126
126
  },
127
127
  {
128
128
  "name": ".i18n",
129
- "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.",
129
+ "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.",
130
130
  "value": {
131
131
  "kind": "expression"
132
132
  }