@vaadin/time-picker 23.1.2 → 23.2.0-alpha3

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": "23.1.2",
3
+ "version": "23.2.0-alpha3",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -34,18 +34,18 @@
34
34
  ],
35
35
  "dependencies": {
36
36
  "@polymer/polymer": "^3.0.0",
37
- "@vaadin/combo-box": "^23.1.2",
38
- "@vaadin/component-base": "^23.1.2",
39
- "@vaadin/field-base": "^23.1.2",
40
- "@vaadin/input-container": "^23.1.2",
41
- "@vaadin/vaadin-lumo-styles": "^23.1.2",
42
- "@vaadin/vaadin-material-styles": "^23.1.2",
43
- "@vaadin/vaadin-themable-mixin": "^23.1.2"
37
+ "@vaadin/combo-box": "23.2.0-alpha3",
38
+ "@vaadin/component-base": "23.2.0-alpha3",
39
+ "@vaadin/field-base": "23.2.0-alpha3",
40
+ "@vaadin/input-container": "23.2.0-alpha3",
41
+ "@vaadin/vaadin-lumo-styles": "23.2.0-alpha3",
42
+ "@vaadin/vaadin-material-styles": "23.2.0-alpha3",
43
+ "@vaadin/vaadin-themable-mixin": "23.2.0-alpha3"
44
44
  },
45
45
  "devDependencies": {
46
46
  "@esm-bundle/chai": "^4.3.4",
47
47
  "@vaadin/testing-helpers": "^0.3.2",
48
48
  "sinon": "^13.0.2"
49
49
  },
50
- "gitHead": "6fb205c6e9a761feadfb779dd5d7af96d3102e56"
50
+ "gitHead": "06e5875be93ca50da2846dafc65a8531010c0576"
51
51
  }
@@ -3,7 +3,9 @@
3
3
  * Copyright (c) 2018 - 2022 Vaadin Ltd.
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
- import './vaadin-time-picker-dropdown.js';
6
+ import './vaadin-time-picker-item.js';
7
+ import './vaadin-time-picker-scroller.js';
8
+ import './vaadin-time-picker-overlay.js';
7
9
  import { html, PolymerElement } from '@polymer/polymer/polymer-element.js';
8
10
  import { ComboBoxMixin } from '@vaadin/combo-box/src/vaadin-combo-box-mixin.js';
9
11
  import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
@@ -31,17 +33,16 @@ class TimePickerComboBox extends ComboBoxMixin(ThemableMixin(PolymerElement)) {
31
33
 
32
34
  <slot></slot>
33
35
 
34
- <vaadin-time-picker-dropdown
35
- id="dropdown"
36
- opened="[[opened]]"
36
+ <vaadin-time-picker-overlay
37
+ id="overlay"
38
+ hidden$="[[_isOverlayHidden(filteredItems, loading)]]"
39
+ opened="[[_overlayOpened]]"
40
+ loading$="[[loading]]"
41
+ theme$="[[_theme]]"
37
42
  position-target="[[positionTarget]]"
38
- renderer="[[renderer]]"
39
- _focused-index="[[_focusedIndex]]"
40
- _item-id-path="[[itemIdPath]]"
41
- _item-label-path="[[itemLabelPath]]"
42
- loading="[[loading]]"
43
- theme="[[_theme]]"
44
- ></vaadin-time-picker-dropdown>
43
+ no-vertical-overlap
44
+ restore-focus-node="[[inputElement]]"
45
+ ></vaadin-time-picker-overlay>
45
46
  `;
46
47
  }
47
48
 
@@ -54,20 +55,21 @@ class TimePickerComboBox extends ComboBoxMixin(ThemableMixin(PolymerElement)) {
54
55
  }
55
56
 
56
57
  /**
57
- * Reference to the clear button element.
58
+ * Tag name prefix used by scroller and items.
58
59
  * @protected
59
- * @return {!HTMLElement}
60
+ * @return {string}
60
61
  */
61
- get clearElement() {
62
- return this.querySelector('[part="clear-button"]');
62
+ get _tagNamePrefix() {
63
+ return 'vaadin-time-picker';
63
64
  }
64
65
 
65
66
  /**
67
+ * Reference to the clear button element.
66
68
  * @protected
67
- * @override
69
+ * @return {!HTMLElement}
68
70
  */
69
- _getItemElements() {
70
- return Array.from(this.$.dropdown._scroller.querySelectorAll('vaadin-time-picker-item'));
71
+ get clearElement() {
72
+ return this.querySelector('[part="clear-button"]');
71
73
  }
72
74
 
73
75
  /** @protected */
@@ -39,10 +39,17 @@ export type TimePickerInvalidChangedEvent = CustomEvent<{ value: boolean }>;
39
39
  */
40
40
  export type TimePickerValueChangedEvent = CustomEvent<{ value: string }>;
41
41
 
42
+ /**
43
+ * Fired whenever the field is validated.
44
+ */
45
+ export type TimePickerValidatedEvent = CustomEvent<{ valid: boolean }>;
46
+
42
47
  export interface TimePickerCustomEventMap {
43
48
  'invalid-changed': TimePickerInvalidChangedEvent;
44
49
 
45
50
  'value-changed': TimePickerValueChangedEvent;
51
+
52
+ validated: TimePickerValidatedEvent;
46
53
  }
47
54
 
48
55
  export interface TimePickerEventMap extends HTMLElementEventMap, TimePickerCustomEventMap {
@@ -97,6 +104,7 @@ export interface TimePickerEventMap extends HTMLElementEventMap, TimePickerCusto
97
104
  * @fires {Event} change - Fired when the user commits a value change.
98
105
  * @fires {CustomEvent} invalid-changed - Fired when the `invalid` property changes.
99
106
  * @fires {CustomEvent} value-changed - Fired when the `value` property changes.
107
+ * @fires {CustomEvent} validated - Fired whenever the field is validated.
100
108
  */
101
109
  declare class TimePicker extends PatternMixin(InputControlMixin(ThemableMixin(ElementMixin(HTMLElement)))) {
102
110
  /**
@@ -64,6 +64,7 @@ registerStyles('vaadin-time-picker', inputFieldShared, { moduleId: 'vaadin-time-
64
64
  * @fires {Event} change - Fired when the user commits a value change.
65
65
  * @fires {CustomEvent} invalid-changed - Fired when the `invalid` property changes.
66
66
  * @fires {CustomEvent} value-changed - Fired when the `value` property changes.
67
+ * @fires {CustomEvent} validated - Fired whenever the field is validated.
67
68
  *
68
69
  * @extends HTMLElement
69
70
  * @mixes ElementMixin
@@ -1,38 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright (c) 2018 - 2022 Vaadin Ltd.
4
- * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
- */
6
- import './vaadin-time-picker-item.js';
7
- import './vaadin-time-picker-overlay.js';
8
- import './vaadin-time-picker-scroller.js';
9
- import { html } from '@polymer/polymer/lib/utils/html-tag.js';
10
- import { ComboBoxDropdown } from '@vaadin/combo-box/src/vaadin-combo-box-dropdown.js';
11
-
12
- /**
13
- * An element used internally by `<vaadin-time-picker>`. Not intended to be used separately.
14
- *
15
- * @extends ComboBoxDropdown
16
- * @private
17
- */
18
- class TimePickerDropdown extends ComboBoxDropdown {
19
- static get is() {
20
- return 'vaadin-time-picker-dropdown';
21
- }
22
-
23
- static get template() {
24
- return html`
25
- <vaadin-time-picker-overlay
26
- id="overlay"
27
- hidden$="[[_isOverlayHidden(_items.*, loading)]]"
28
- loading$="[[loading]]"
29
- opened="{{_overlayOpened}}"
30
- theme$="[[_theme]]"
31
- position-target="[[positionTarget]]"
32
- no-vertical-overlap
33
- ></vaadin-time-picker-overlay>
34
- `;
35
- }
36
- }
37
-
38
- customElements.define(TimePickerDropdown.is, TimePickerDropdown);