@vaadin/time-picker 25.4.0-dev.55bb86e155 → 25.4.0-dev.c9532cd333

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vaadin/time-picker",
3
- "version": "25.4.0-dev.55bb86e155",
3
+ "version": "25.4.0-dev.c9532cd333",
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.4.0-dev.55bb86e155",
39
- "@vaadin/combo-box": "25.4.0-dev.55bb86e155",
40
- "@vaadin/component-base": "25.4.0-dev.55bb86e155",
41
- "@vaadin/field-base": "25.4.0-dev.55bb86e155",
42
- "@vaadin/input-container": "25.4.0-dev.55bb86e155",
43
- "@vaadin/item": "25.4.0-dev.55bb86e155",
44
- "@vaadin/overlay": "25.4.0-dev.55bb86e155",
45
- "@vaadin/vaadin-themable-mixin": "25.4.0-dev.55bb86e155",
38
+ "@vaadin/a11y-base": "25.4.0-dev.c9532cd333",
39
+ "@vaadin/combo-box": "25.4.0-dev.c9532cd333",
40
+ "@vaadin/component-base": "25.4.0-dev.c9532cd333",
41
+ "@vaadin/field-base": "25.4.0-dev.c9532cd333",
42
+ "@vaadin/input-container": "25.4.0-dev.c9532cd333",
43
+ "@vaadin/item": "25.4.0-dev.c9532cd333",
44
+ "@vaadin/overlay": "25.4.0-dev.c9532cd333",
45
+ "@vaadin/vaadin-themable-mixin": "25.4.0-dev.c9532cd333",
46
46
  "lit": "^3.0.0"
47
47
  },
48
48
  "devDependencies": {
49
- "@vaadin/aura": "25.4.0-dev.55bb86e155",
50
- "@vaadin/chai-plugins": "25.4.0-dev.55bb86e155",
51
- "@vaadin/test-runner-commands": "25.4.0-dev.55bb86e155",
49
+ "@vaadin/aura": "25.4.0-dev.c9532cd333",
50
+ "@vaadin/chai-plugins": "25.4.0-dev.c9532cd333",
51
+ "@vaadin/test-runner-commands": "25.4.0-dev.c9532cd333",
52
52
  "@vaadin/testing-helpers": "^2.0.0",
53
- "@vaadin/vaadin-lumo-styles": "25.4.0-dev.55bb86e155",
53
+ "@vaadin/vaadin-lumo-styles": "25.4.0-dev.c9532cd333",
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": "5db8e58fb088121b067290b0ed90d12d7d4084f2"
61
+ "gitHead": "1fbf460cf3602f011721b6ed7d98961d1c1bf85e"
62
62
  }
@@ -12,6 +12,10 @@ import { LabelledInputController } from '@vaadin/field-base/src/labelled-input-c
12
12
  import { PatternMixin } from '@vaadin/field-base/src/pattern-mixin.js';
13
13
  import { formatISOTime, parseISOTime, validateTime } from './vaadin-time-picker-helper.js';
14
14
 
15
+ /**
16
+ * @typedef {import('./vaadin-time-picker-helper.js').TimePickerTime} TimePickerTime
17
+ */
18
+
15
19
  export const timePickerI18nDefaults = Object.freeze({
16
20
  formatTime: formatISOTime,
17
21
  parseTime: parseISOTime,
@@ -382,7 +386,7 @@ export const TimePickerMixin = (superClass) =>
382
386
 
383
387
  /** @private */
384
388
  __onArrowPressWithStep(step) {
385
- const objWithStep = this.__addStep(this.__getMsec(this.__memoValue), step, true);
389
+ const objWithStep = this.__addStep(this.__getMsec(this.__memoValue), step);
386
390
  this.__memoValue = objWithStep;
387
391
 
388
392
  // Only commit when the formatted text changes, so that a step finer than
@@ -428,7 +432,8 @@ export const TimePickerMixin = (superClass) =>
428
432
  }
429
433
 
430
434
  /**
431
- * Returning milliseconds from Object in the format `{ hours: ..., minutes: ..., seconds: ..., milliseconds: ... }`
435
+ * @param {TimePickerTime | undefined} obj Time object
436
+ * @return {number} milliseconds
432
437
  * @private
433
438
  */
434
439
  __getMsec(obj) {
@@ -441,34 +446,46 @@ export const TimePickerMixin = (superClass) =>
441
446
  }
442
447
 
443
448
  /**
444
- * Returning Object in the format `{ hours: ..., minutes: ..., seconds: ..., milliseconds: ... }`
445
- * from an ISO 8601 time, stripped to the resolution defined by the step.
449
+ * @param {TimePickerTime | undefined} time Time object
450
+ * @return {TimePickerTime | undefined} time object truncated to the step resolution
451
+ * @private
452
+ */
453
+ __truncateTime(time) {
454
+ return validateTime(time, this.step);
455
+ }
456
+
457
+ /**
458
+ * @param {string} timeString ISO 8601 time string
459
+ * @return {TimePickerTime | undefined} time object truncated to the step resolution
446
460
  * @private
447
461
  */
448
462
  __getTimeObject(timeString) {
449
- return validateTime(parseISOTime(timeString), this.step);
463
+ return this.__truncateTime(parseISOTime(timeString));
450
464
  }
451
465
 
452
466
  /**
453
- * Returning seconds from Object in the format `{ hours: ..., minutes: ..., seconds: ..., milliseconds: ... }`
467
+ * @param {number} msec Milliseconds since midnight, `24:00` becomes `00:00`
468
+ * @return {!TimePickerTime} time object
454
469
  * @private
455
470
  */
456
- __getSec(obj) {
457
- let result = (obj?.hours || 0) * 60 * 60;
458
- result += (obj?.minutes || 0) * 60;
459
- result += obj?.seconds || 0;
460
- result += (obj?.milliseconds || 0) / 1000;
471
+ __getTimeFromMsec(msec) {
472
+ const hh = Math.floor(msec / 1000 / 60 / 60);
473
+ msec -= hh * 1000 * 60 * 60;
474
+ const mm = Math.floor(msec / 1000 / 60);
475
+ msec -= mm * 1000 * 60;
476
+ const ss = Math.floor(msec / 1000);
477
+ msec -= ss * 1000;
461
478
 
462
- return result;
479
+ return { hours: hh < 24 ? hh : 0, minutes: mm, seconds: ss, milliseconds: msec };
463
480
  }
464
481
 
465
482
  /**
466
- * Returning Object in the format `{ hours: ..., minutes: ..., seconds: ..., milliseconds: ... }`
467
- * from the result of adding step value in milliseconds to the milliseconds amount.
468
- * With `precision` parameter rounding the value to the closest step valid interval.
483
+ * @param {number} msec Milliseconds since midnight
484
+ * @param {number} step Step in seconds, negative to subtract
485
+ * @return {!TimePickerTime} time object moved to the next step interval
469
486
  * @private
470
487
  */
471
- __addStep(msec, step, precision) {
488
+ __addStep(msec, step) {
472
489
  // If the time is `00:00` and step changes value downwards, it should be considered as `24:00`
473
490
  if (msec === 0 && step < 0) {
474
491
  msec = 24 * 60 * 60 * 1000;
@@ -476,30 +493,23 @@ export const TimePickerMixin = (superClass) =>
476
493
 
477
494
  const stepMsec = step * 1000;
478
495
  const diffToNext = msec % stepMsec;
479
- if (stepMsec < 0 && diffToNext && precision) {
496
+ if (stepMsec < 0 && diffToNext) {
480
497
  msec -= diffToNext;
481
- } else if (stepMsec > 0 && diffToNext && precision) {
498
+ } else if (stepMsec > 0 && diffToNext) {
482
499
  msec -= diffToNext - stepMsec;
483
500
  } else {
484
501
  msec += stepMsec;
485
502
  }
486
503
 
487
- const hh = Math.floor(msec / 1000 / 60 / 60);
488
- msec -= hh * 1000 * 60 * 60;
489
- const mm = Math.floor(msec / 1000 / 60);
490
- msec -= mm * 1000 * 60;
491
- const ss = Math.floor(msec / 1000);
492
- msec -= ss * 1000;
493
-
494
- return { hours: hh < 24 ? hh : 0, minutes: mm, seconds: ss, milliseconds: msec };
504
+ return this.__getTimeFromMsec(msec);
495
505
  }
496
506
 
497
507
  /** @private */
498
508
  __updateDropdownItems() {
499
- const minSec = this.__getSec(this.__getTimeObject(this.min || MIN_ALLOWED_TIME));
500
- const maxSec = this.__getSec(this.__getTimeObject(this.max || MAX_ALLOWED_TIME));
509
+ const minMsec = this.__getMsec(this.__getTimeObject(this.min || MIN_ALLOWED_TIME));
510
+ const maxMsec = this.__getMsec(this.__getTimeObject(this.max || MAX_ALLOWED_TIME));
501
511
 
502
- this._dropdownItems = this.__generateDropdownList(minSec, maxSec, this.step);
512
+ this._dropdownItems = this.__generateDropdownList(minMsec, maxMsec, this.step);
503
513
  }
504
514
 
505
515
  /** @private */
@@ -518,22 +528,18 @@ export const TimePickerMixin = (superClass) =>
518
528
  }
519
529
 
520
530
  /** @private */
521
- __generateDropdownList(minSec, maxSec, step) {
531
+ __generateDropdownList(minMsec, maxMsec, step) {
522
532
  if (step < 15 * 60 || !this.__validDayDivisor(step)) {
523
533
  return [];
524
534
  }
525
535
 
526
- const generatedList = [];
527
-
528
536
  // Default step in overlay items is 1 hour
529
- if (!step) {
530
- step = 3600;
531
- }
537
+ const stepMsec = (step || 3600) * 1000;
538
+
539
+ const generatedList = [];
532
540
 
533
- let time = -step + minSec;
534
- while (time + step >= minSec && time + step <= maxSec) {
535
- const timeObj = validateTime(this.__addStep(time * 1000, step), step);
536
- time += step;
541
+ for (let msec = minMsec; msec <= maxMsec; msec += stepMsec) {
542
+ const timeObj = validateTime(this.__getTimeFromMsec(msec), step);
537
543
  const formatted = this.__effectiveI18n.formatTime(timeObj);
538
544
  generatedList.push({ label: formatted, value: formatISOTime(timeObj) });
539
545
  }
@@ -547,7 +553,7 @@ export const TimePickerMixin = (superClass) =>
547
553
  * @override
548
554
  */
549
555
  _valueChanged(value, oldValue) {
550
- // Strip value to the step resolution before marking as committed.
556
+ // Truncate value to the step resolution before marking as committed.
551
557
  const parsedObj = (this.__memoValue = this.__getTimeObject(value));
552
558
  const newValue = formatISOTime(parsedObj);
553
559
 
@@ -587,15 +593,15 @@ export const TimePickerMixin = (superClass) =>
587
593
 
588
594
  /**
589
595
  * Sets the value and the input text from the given time,
590
- * stripped to the resolution defined by the step.
596
+ * truncated to the resolution defined by the step.
591
597
  *
592
598
  * @param {!TimePickerTime} time
593
599
  * @private
594
600
  */
595
601
  __setValueFromTime(time) {
596
- const stripped = validateTime(time, this.step);
597
- this.__setUncommittedValue(formatISOTime(stripped));
598
- this.__updateInputValue(stripped);
602
+ const truncated = this.__truncateTime(time);
603
+ this.__setUncommittedValue(formatISOTime(truncated));
604
+ this.__updateInputValue(truncated);
599
605
  }
600
606
 
601
607
  /**
@@ -620,7 +626,10 @@ export const TimePickerMixin = (superClass) =>
620
626
  this._comboBoxValue = text;
621
627
  }
622
628
 
623
- /** @private */
629
+ /**
630
+ * @param {TimePickerTime | undefined} obj Time object
631
+ * @private
632
+ */
624
633
  __updateInputValue(obj) {
625
634
  const text = this.__effectiveI18n.formatTime(obj) || '';
626
635
  this._inputElementValue = text;
@@ -628,8 +637,6 @@ export const TimePickerMixin = (superClass) =>
628
637
  }
629
638
 
630
639
  /**
631
- * Returns true if `time` satisfies the `min` and `max` constraints (if any).
632
- *
633
640
  * @param {!TimePickerTime} time Value to check against constraints
634
641
  * @return {boolean} True if `time` satisfies the constraints
635
642
  * @protected
@@ -660,13 +667,14 @@ export const TimePickerMixin = (superClass) =>
660
667
  }
661
668
 
662
669
  /**
670
+ * Override method inherited from `ComboBoxBaseMixin` to only
671
+ * open overlay when clicking on label or the input container.
663
672
  * @param {Event} event
664
673
  * @protected
665
674
  */
666
675
  _onHostClick(event) {
667
676
  const path = event.composedPath();
668
677
 
669
- // Open dropdown only when clicking on the label or input field
670
678
  if (path.includes(this._labelNode) || path.includes(this._inputContainer)) {
671
679
  super._onHostClick(event);
672
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.4.0-dev.55bb86e155",
4
+ "version": "25.4.0-dev.c9532cd333",
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 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\nThe following custom CSS properties are available for styling:\n\nCustom CSS property |\n:--------------------------------------------------|\n| `--vaadin-field-default-width` |\n| `--vaadin-input-field-background` |\n| `--vaadin-input-field-border-color` |\n| `--vaadin-input-field-border-radius` |\n| `--vaadin-input-field-border-width` |\n| `--vaadin-input-field-bottom-end-radius` |\n| `--vaadin-input-field-bottom-start-radius` |\n| `--vaadin-input-field-button-text-color` |\n| `--vaadin-input-field-container-gap` |\n| `--vaadin-input-field-disabled-background` |\n| `--vaadin-input-field-disabled-text-color` |\n| `--vaadin-input-field-error-color` |\n| `--vaadin-input-field-error-font-size` |\n| `--vaadin-input-field-error-font-weight` |\n| `--vaadin-input-field-error-line-height` |\n| `--vaadin-input-field-gap` |\n| `--vaadin-input-field-helper-color` |\n| `--vaadin-input-field-helper-font-size` |\n| `--vaadin-input-field-helper-font-weight` |\n| `--vaadin-input-field-helper-line-height` |\n| `--vaadin-input-field-label-aside-gap` |\n| `--vaadin-input-field-label-aside-text-align` |\n| `--vaadin-input-field-label-aside-width` |\n| `--vaadin-input-field-label-color` |\n| `--vaadin-input-field-label-font-size` |\n| `--vaadin-input-field-label-font-weight` |\n| `--vaadin-input-field-label-line-height` |\n| `--vaadin-input-field-padding` |\n| `--vaadin-input-field-placeholder-color` |\n| `--vaadin-input-field-required-indicator` |\n| `--vaadin-input-field-required-indicator-color` |\n| `--vaadin-input-field-top-end-radius` |\n| `--vaadin-input-field-top-start-radius` |\n| `--vaadin-input-field-value-color` |\n| `--vaadin-input-field-value-font-size` |\n| `--vaadin-input-field-value-font-weight` |\n| `--vaadin-input-field-value-line-height` |\n| `--vaadin-item-overlay-padding` |\n| `--vaadin-time-picker-overlay-max-height` |\n| `--vaadin-time-picker-overlay-width` |\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.4.0-dev.55bb86e155/#/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 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\nThe following custom CSS properties are available for styling:\n\nCustom CSS property |\n:--------------------------------------------------|\n| `--vaadin-field-default-width` |\n| `--vaadin-input-field-background` |\n| `--vaadin-input-field-border-color` |\n| `--vaadin-input-field-border-radius` |\n| `--vaadin-input-field-border-width` |\n| `--vaadin-input-field-bottom-end-radius` |\n| `--vaadin-input-field-bottom-start-radius` |\n| `--vaadin-input-field-button-text-color` |\n| `--vaadin-input-field-container-gap` |\n| `--vaadin-input-field-disabled-background` |\n| `--vaadin-input-field-disabled-text-color` |\n| `--vaadin-input-field-error-color` |\n| `--vaadin-input-field-error-font-size` |\n| `--vaadin-input-field-error-font-weight` |\n| `--vaadin-input-field-error-line-height` |\n| `--vaadin-input-field-gap` |\n| `--vaadin-input-field-helper-color` |\n| `--vaadin-input-field-helper-font-size` |\n| `--vaadin-input-field-helper-font-weight` |\n| `--vaadin-input-field-helper-line-height` |\n| `--vaadin-input-field-label-aside-gap` |\n| `--vaadin-input-field-label-aside-text-align` |\n| `--vaadin-input-field-label-aside-width` |\n| `--vaadin-input-field-label-color` |\n| `--vaadin-input-field-label-font-size` |\n| `--vaadin-input-field-label-font-weight` |\n| `--vaadin-input-field-label-line-height` |\n| `--vaadin-input-field-padding` |\n| `--vaadin-input-field-placeholder-color` |\n| `--vaadin-input-field-required-indicator` |\n| `--vaadin-input-field-required-indicator-color` |\n| `--vaadin-input-field-top-end-radius` |\n| `--vaadin-input-field-top-start-radius` |\n| `--vaadin-input-field-value-color` |\n| `--vaadin-input-field-value-font-size` |\n| `--vaadin-input-field-value-font-weight` |\n| `--vaadin-input-field-value-line-height` |\n| `--vaadin-item-overlay-padding` |\n| `--vaadin-time-picker-overlay-max-height` |\n| `--vaadin-time-picker-overlay-width` |\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.4.0-dev.c9532cd333/#/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-description-ref",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/web-types",
3
3
  "name": "@vaadin/time-picker",
4
- "version": "25.4.0-dev.55bb86e155",
4
+ "version": "25.4.0-dev.c9532cd333",
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 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\nThe following custom CSS properties are available for styling:\n\nCustom CSS property |\n:--------------------------------------------------|\n| `--vaadin-field-default-width` |\n| `--vaadin-input-field-background` |\n| `--vaadin-input-field-border-color` |\n| `--vaadin-input-field-border-radius` |\n| `--vaadin-input-field-border-width` |\n| `--vaadin-input-field-bottom-end-radius` |\n| `--vaadin-input-field-bottom-start-radius` |\n| `--vaadin-input-field-button-text-color` |\n| `--vaadin-input-field-container-gap` |\n| `--vaadin-input-field-disabled-background` |\n| `--vaadin-input-field-disabled-text-color` |\n| `--vaadin-input-field-error-color` |\n| `--vaadin-input-field-error-font-size` |\n| `--vaadin-input-field-error-font-weight` |\n| `--vaadin-input-field-error-line-height` |\n| `--vaadin-input-field-gap` |\n| `--vaadin-input-field-helper-color` |\n| `--vaadin-input-field-helper-font-size` |\n| `--vaadin-input-field-helper-font-weight` |\n| `--vaadin-input-field-helper-line-height` |\n| `--vaadin-input-field-label-aside-gap` |\n| `--vaadin-input-field-label-aside-text-align` |\n| `--vaadin-input-field-label-aside-width` |\n| `--vaadin-input-field-label-color` |\n| `--vaadin-input-field-label-font-size` |\n| `--vaadin-input-field-label-font-weight` |\n| `--vaadin-input-field-label-line-height` |\n| `--vaadin-input-field-padding` |\n| `--vaadin-input-field-placeholder-color` |\n| `--vaadin-input-field-required-indicator` |\n| `--vaadin-input-field-required-indicator-color` |\n| `--vaadin-input-field-top-end-radius` |\n| `--vaadin-input-field-top-start-radius` |\n| `--vaadin-input-field-value-color` |\n| `--vaadin-input-field-value-font-size` |\n| `--vaadin-input-field-value-font-weight` |\n| `--vaadin-input-field-value-line-height` |\n| `--vaadin-item-overlay-padding` |\n| `--vaadin-time-picker-overlay-max-height` |\n| `--vaadin-time-picker-overlay-width` |\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.4.0-dev.55bb86e155/#/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 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\nThe following custom CSS properties are available for styling:\n\nCustom CSS property |\n:--------------------------------------------------|\n| `--vaadin-field-default-width` |\n| `--vaadin-input-field-background` |\n| `--vaadin-input-field-border-color` |\n| `--vaadin-input-field-border-radius` |\n| `--vaadin-input-field-border-width` |\n| `--vaadin-input-field-bottom-end-radius` |\n| `--vaadin-input-field-bottom-start-radius` |\n| `--vaadin-input-field-button-text-color` |\n| `--vaadin-input-field-container-gap` |\n| `--vaadin-input-field-disabled-background` |\n| `--vaadin-input-field-disabled-text-color` |\n| `--vaadin-input-field-error-color` |\n| `--vaadin-input-field-error-font-size` |\n| `--vaadin-input-field-error-font-weight` |\n| `--vaadin-input-field-error-line-height` |\n| `--vaadin-input-field-gap` |\n| `--vaadin-input-field-helper-color` |\n| `--vaadin-input-field-helper-font-size` |\n| `--vaadin-input-field-helper-font-weight` |\n| `--vaadin-input-field-helper-line-height` |\n| `--vaadin-input-field-label-aside-gap` |\n| `--vaadin-input-field-label-aside-text-align` |\n| `--vaadin-input-field-label-aside-width` |\n| `--vaadin-input-field-label-color` |\n| `--vaadin-input-field-label-font-size` |\n| `--vaadin-input-field-label-font-weight` |\n| `--vaadin-input-field-label-line-height` |\n| `--vaadin-input-field-padding` |\n| `--vaadin-input-field-placeholder-color` |\n| `--vaadin-input-field-required-indicator` |\n| `--vaadin-input-field-required-indicator-color` |\n| `--vaadin-input-field-top-end-radius` |\n| `--vaadin-input-field-top-start-radius` |\n| `--vaadin-input-field-value-color` |\n| `--vaadin-input-field-value-font-size` |\n| `--vaadin-input-field-value-font-weight` |\n| `--vaadin-input-field-value-line-height` |\n| `--vaadin-item-overlay-padding` |\n| `--vaadin-time-picker-overlay-max-height` |\n| `--vaadin-time-picker-overlay-width` |\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.4.0-dev.c9532cd333/#/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
  {