@vaadin/time-picker 25.2.6 → 25.2.8

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"
@@ -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.6",
3
+ "version": "25.2.8",
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.6",
39
- "@vaadin/combo-box": "~25.2.6",
40
- "@vaadin/component-base": "~25.2.6",
41
- "@vaadin/field-base": "~25.2.6",
42
- "@vaadin/input-container": "~25.2.6",
43
- "@vaadin/item": "~25.2.6",
44
- "@vaadin/overlay": "~25.2.6",
45
- "@vaadin/vaadin-themable-mixin": "~25.2.6",
38
+ "@vaadin/a11y-base": "~25.2.8",
39
+ "@vaadin/combo-box": "~25.2.8",
40
+ "@vaadin/component-base": "~25.2.8",
41
+ "@vaadin/field-base": "~25.2.8",
42
+ "@vaadin/input-container": "~25.2.8",
43
+ "@vaadin/item": "~25.2.8",
44
+ "@vaadin/overlay": "~25.2.8",
45
+ "@vaadin/vaadin-themable-mixin": "~25.2.8",
46
46
  "lit": "^3.0.0"
47
47
  },
48
48
  "devDependencies": {
49
- "@vaadin/aura": "~25.2.6",
50
- "@vaadin/chai-plugins": "~25.2.6",
51
- "@vaadin/test-runner-commands": "~25.2.6",
49
+ "@vaadin/aura": "~25.2.8",
50
+ "@vaadin/chai-plugins": "~25.2.8",
51
+ "@vaadin/test-runner-commands": "~25.2.8",
52
52
  "@vaadin/testing-helpers": "^2.0.0",
53
- "@vaadin/vaadin-lumo-styles": "~25.2.6",
53
+ "@vaadin/vaadin-lumo-styles": "~25.2.8",
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": "c352225ff025e6163c5e290d6028a42003696441"
61
+ "gitHead": "46ec4be23967061d203ca4dad6e7b8291d4edd9c"
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
  }
@@ -108,7 +108,7 @@ 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
113
  '__updateDropdownItems(__effectiveI18n, min, max, step)',
114
114
  ];
@@ -169,6 +169,11 @@ export const TimePickerMixin = (superClass) =>
169
169
  * NOTE: `formatTime` and `parseTime` must be implemented in a
170
170
  * compatible manner to ensure the component works properly.
171
171
  *
172
+ * NOTE: these functions only apply to the text shown in the input field and
173
+ * in the dropdown. The `value`, `min` and `max` properties always use the
174
+ * ISO 8601 format, and are never passed to `parseTime`, so implementations
175
+ * do not need to accept ISO 8601 input.
176
+ *
172
177
  * @type {!TimePickerI18n}
173
178
  */
174
179
  get i18n() {
@@ -225,16 +230,6 @@ export const TimePickerMixin = (superClass) =>
225
230
  this.addController(this._tooltipController);
226
231
  }
227
232
 
228
- /** @protected */
229
- updated(props) {
230
- super.updated(props);
231
-
232
- // Update selected item in the scroller
233
- if (props.has('_comboBoxValue') && this._dropdownItems) {
234
- this._scroller.selectedItem = this._dropdownItems.find((item) => item.value === this._comboBoxValue);
235
- }
236
- }
237
-
238
233
  /**
239
234
  * Returns true if the current input value satisfies all constraints (if any).
240
235
  * You can override this method for custom validations.
@@ -244,7 +239,7 @@ export const TimePickerMixin = (superClass) =>
244
239
  checkValidity() {
245
240
  return !!(
246
241
  this.inputElement.checkValidity() &&
247
- (!this.value || this._timeAllowed(this.__effectiveI18n.parseTime(this.value))) &&
242
+ (!this.value || this._timeAllowed(parseISOTime(this.value))) &&
248
243
  (!this._comboBoxValue || this.__effectiveI18n.parseTime(this._comboBoxValue))
249
244
  );
250
245
  }
@@ -259,7 +254,7 @@ export const TimePickerMixin = (superClass) =>
259
254
  }
260
255
 
261
256
  /** @private */
262
- _updateScroller(opened, items, focusedIndex, theme) {
257
+ _updateScroller(opened, items, focusedIndex, theme, comboBoxValue) {
263
258
  if (opened) {
264
259
  this._scroller.style.maxHeight =
265
260
  getComputedStyle(this).getPropertyValue(`--${this._tagNamePrefix}-overlay-max-height`) || '65vh';
@@ -270,6 +265,7 @@ export const TimePickerMixin = (superClass) =>
270
265
  opened,
271
266
  focusedIndex,
272
267
  theme,
268
+ selectedItem: items?.find((item) => item.value === comboBoxValue),
273
269
  });
274
270
  }
275
271
 
@@ -365,7 +361,7 @@ export const TimePickerMixin = (superClass) =>
365
361
  _setFocused(focused) {
366
362
  super._setFocused(focused);
367
363
 
368
- if (!focused) {
364
+ if (!focused && !this._closeOnBlurIsPrevented) {
369
365
  // Do not validate when focusout is caused by document
370
366
  // losing focus, which happens on browser tab switch.
371
367
  if (document.hasFocus()) {
@@ -516,14 +512,15 @@ export const TimePickerMixin = (superClass) =>
516
512
 
517
513
  this._dropdownItems = this.__generateDropdownList(minSec, maxSec, step);
518
514
 
515
+ const parsedValue = validateTime(parseISOTime(this.value), step);
516
+
519
517
  if (step !== this.__oldStep) {
520
518
  this.__oldStep = step;
521
- const parsedObj = validateTime(parseISOTime(this.value), step);
522
- this.__updateValue(parsedObj);
519
+ this.__updateValue(parsedValue);
523
520
  }
524
521
 
525
522
  if (this.value) {
526
- this._comboBoxValue = effectiveI18n.formatTime(effectiveI18n.parseTime(this.value));
523
+ this._comboBoxValue = effectiveI18n.formatTime(parsedValue);
527
524
  }
528
525
  }
529
526
 
@@ -605,7 +602,11 @@ export const TimePickerMixin = (superClass) =>
605
602
  return;
606
603
  }
607
604
 
608
- const parsedObj = this.__useMemo ? this.__memoValue : this.__effectiveI18n.parseTime(value);
605
+ const parsed = this.__useMemo ? this.__memoValue : this.__effectiveI18n.parseTime(value);
606
+
607
+ // Strip parsed time to the resolution defined by the step before formatting
608
+ // it back, so that the result matches the text shown in the input field.
609
+ const parsedObj = validateTime(parsed, this.step);
609
610
  const newValue = this.__effectiveI18n.formatTime(parsedObj) || '';
610
611
 
611
612
  if (parsedObj) {
@@ -656,12 +657,12 @@ export const TimePickerMixin = (superClass) =>
656
657
  * @protected
657
658
  */
658
659
  _timeAllowed(time) {
659
- const parsedMin = this.__effectiveI18n.parseTime(this.min || MIN_ALLOWED_TIME);
660
- const parsedMax = this.__effectiveI18n.parseTime(this.max || MAX_ALLOWED_TIME);
660
+ const parsedMin = parseISOTime(this.min || MIN_ALLOWED_TIME);
661
+ const parsedMax = parseISOTime(this.max || MAX_ALLOWED_TIME);
661
662
 
662
663
  return (
663
- (!this.__getMsec(parsedMin) || this.__getMsec(time) >= this.__getMsec(parsedMin)) &&
664
- (!this.__getMsec(parsedMax) || this.__getMsec(time) <= this.__getMsec(parsedMax))
664
+ (!parsedMin || this.__getMsec(time) >= this.__getMsec(parsedMin)) &&
665
+ (!parsedMax || this.__getMsec(time) <= this.__getMsec(parsedMax))
665
666
  );
666
667
  }
667
668
 
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.6",
4
+ "version": "25.2.8",
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.6/#/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.2.8/#/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"
@@ -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.6",
4
+ "version": "25.2.8",
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.6/#/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.2.8/#/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
  }