@vaadin/time-picker 25.2.0-alpha8 → 25.2.0-beta1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/custom-elements.json +342 -10
- package/package.json +14 -14
- package/src/vaadin-time-picker-item.js +0 -3
- package/src/vaadin-time-picker-mixin.js +15 -26
- package/src/vaadin-time-picker-overlay.js +0 -4
- package/src/vaadin-time-picker-scroller.js +0 -1
- package/src/vaadin-time-picker.js +0 -3
- package/web-types.json +55 -162
- package/web-types.lit.json +52 -52
|
@@ -22,18 +22,9 @@ const MAX_ALLOWED_TIME = '23:59:59.999';
|
|
|
22
22
|
|
|
23
23
|
/**
|
|
24
24
|
* A mixin providing common time-picker functionality.
|
|
25
|
-
*
|
|
26
|
-
* @polymerMixin
|
|
27
|
-
* @mixes ComboBoxBaseMixin
|
|
28
|
-
* @mixes I18nMixin
|
|
29
|
-
* @mixes InputControlMixin
|
|
30
|
-
* @mixes PatternMixin
|
|
31
25
|
*/
|
|
32
26
|
export const TimePickerMixin = (superClass) =>
|
|
33
|
-
class TimePickerMixinClass extends I18nMixin(
|
|
34
|
-
timePickerI18nDefaults,
|
|
35
|
-
PatternMixin(ComboBoxBaseMixin(InputControlMixin(superClass))),
|
|
36
|
-
) {
|
|
27
|
+
class TimePickerMixinClass extends I18nMixin(PatternMixin(ComboBoxBaseMixin(InputControlMixin(superClass)))) {
|
|
37
28
|
static get properties() {
|
|
38
29
|
return {
|
|
39
30
|
/**
|
|
@@ -123,6 +114,10 @@ export const TimePickerMixin = (superClass) =>
|
|
|
123
114
|
];
|
|
124
115
|
}
|
|
125
116
|
|
|
117
|
+
static get defaultI18n() {
|
|
118
|
+
return timePickerI18nDefaults;
|
|
119
|
+
}
|
|
120
|
+
|
|
126
121
|
static get constraints() {
|
|
127
122
|
return [...super.constraints, 'min', 'max'];
|
|
128
123
|
}
|
|
@@ -281,7 +276,7 @@ export const TimePickerMixin = (superClass) =>
|
|
|
281
276
|
/** @private */
|
|
282
277
|
_openedOrItemsChanged(opened, items) {
|
|
283
278
|
// Close the overlay if there are no items to display.
|
|
284
|
-
this._overlayOpened = opened && !!
|
|
279
|
+
this._overlayOpened = opened && !!items?.length;
|
|
285
280
|
}
|
|
286
281
|
|
|
287
282
|
/**
|
|
@@ -458,10 +453,10 @@ export const TimePickerMixin = (superClass) =>
|
|
|
458
453
|
* @private
|
|
459
454
|
*/
|
|
460
455
|
__getMsec(obj) {
|
|
461
|
-
let result = (
|
|
462
|
-
result += (
|
|
463
|
-
result += (
|
|
464
|
-
result +=
|
|
456
|
+
let result = (obj?.hours || 0) * 60 * 60 * 1000;
|
|
457
|
+
result += (obj?.minutes || 0) * 60 * 1000;
|
|
458
|
+
result += (obj?.seconds || 0) * 1000;
|
|
459
|
+
result += parseInt(obj?.milliseconds) || 0;
|
|
465
460
|
|
|
466
461
|
return result;
|
|
467
462
|
}
|
|
@@ -471,10 +466,10 @@ export const TimePickerMixin = (superClass) =>
|
|
|
471
466
|
* @private
|
|
472
467
|
*/
|
|
473
468
|
__getSec(obj) {
|
|
474
|
-
let result = (
|
|
475
|
-
result += (
|
|
476
|
-
result +=
|
|
477
|
-
result += (obj
|
|
469
|
+
let result = (obj?.hours || 0) * 60 * 60;
|
|
470
|
+
result += (obj?.minutes || 0) * 60;
|
|
471
|
+
result += obj?.seconds || 0;
|
|
472
|
+
result += (obj?.milliseconds || 0) / 1000;
|
|
478
473
|
|
|
479
474
|
return result;
|
|
480
475
|
}
|
|
@@ -589,7 +584,7 @@ export const TimePickerMixin = (superClass) =>
|
|
|
589
584
|
|
|
590
585
|
if (value !== '' && value !== null && !parsedObj) {
|
|
591
586
|
// Value can not be parsed, reset to the old one.
|
|
592
|
-
this.value = oldValue
|
|
587
|
+
this.value = oldValue ?? '';
|
|
593
588
|
} else if (value !== newValue) {
|
|
594
589
|
// Value can be parsed (e.g. 12 -> 12:00), adjust.
|
|
595
590
|
this.value = newValue;
|
|
@@ -709,10 +704,4 @@ export const TimePickerMixin = (superClass) =>
|
|
|
709
704
|
// We use `__commitValueChange` to fire a custom event.
|
|
710
705
|
event.stopPropagation();
|
|
711
706
|
}
|
|
712
|
-
|
|
713
|
-
/**
|
|
714
|
-
* Fired when the user commits a value change.
|
|
715
|
-
*
|
|
716
|
-
* @event change
|
|
717
|
-
*/
|
|
718
707
|
};
|
|
@@ -18,10 +18,6 @@ import { timePickerOverlayStyles } from './styles/vaadin-time-picker-overlay-bas
|
|
|
18
18
|
* An element used internally by `<vaadin-time-picker>`. Not intended to be used separately.
|
|
19
19
|
*
|
|
20
20
|
* @extends HTMLElement
|
|
21
|
-
* @mixes ComboBoxOverlayMixin
|
|
22
|
-
* @mixes DirMixin
|
|
23
|
-
* @mixes OverlayMixin
|
|
24
|
-
* @mixes ThemableMixin
|
|
25
21
|
* @private
|
|
26
22
|
*/
|
|
27
23
|
export class TimePickerOverlay extends ComboBoxOverlayMixin(
|
|
@@ -14,7 +14,6 @@ import { timePickerScrollerStyles } from './styles/vaadin-time-picker-scroller-b
|
|
|
14
14
|
*
|
|
15
15
|
* @customElement vaadin-time-picker-scroller
|
|
16
16
|
* @extends HTMLElement
|
|
17
|
-
* @mixes ComboBoxScrollerMixin
|
|
18
17
|
* @private
|
|
19
18
|
*/
|
|
20
19
|
export class TimePickerScroller extends ComboBoxScrollerMixin(PolylitMixin(LitElement)) {
|
|
@@ -105,9 +105,6 @@ import { TimePickerMixin } from './vaadin-time-picker-mixin.js';
|
|
|
105
105
|
*
|
|
106
106
|
* @customElement vaadin-time-picker
|
|
107
107
|
* @extends HTMLElement
|
|
108
|
-
* @mixes ElementMixin
|
|
109
|
-
* @mixes ThemableMixin
|
|
110
|
-
* @mixes TimePickerMixin
|
|
111
108
|
*/
|
|
112
109
|
class TimePicker extends TimePickerMixin(ThemableMixin(ElementMixin(PolylitMixin(LumoInjectionMixin(LitElement))))) {
|
|
113
110
|
static get is() {
|