@vaadin/time-picker 24.6.0-alpha3 → 24.6.0-alpha5
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 +14 -12
- package/src/vaadin-lit-time-picker-combo-box.js +113 -0
- package/src/vaadin-lit-time-picker-item.js +50 -0
- package/src/vaadin-lit-time-picker-overlay.js +76 -0
- package/src/vaadin-lit-time-picker-scroller.js +59 -0
- package/src/vaadin-lit-time-picker.js +161 -0
- package/src/vaadin-time-picker-helper.d.ts +32 -0
- package/src/vaadin-time-picker-helper.js +91 -0
- package/src/vaadin-time-picker-mixin.d.ts +159 -0
- package/src/vaadin-time-picker-mixin.js +605 -0
- package/src/vaadin-time-picker.d.ts +4 -121
- package/src/vaadin-time-picker.js +3 -655
- package/theme/lumo/vaadin-lit-time-picker.d.ts +7 -0
- package/theme/lumo/vaadin-lit-time-picker.js +7 -0
- package/theme/material/vaadin-lit-time-picker.d.ts +7 -0
- package/theme/material/vaadin-lit-time-picker.js +7 -0
- package/vaadin-lit-time-picker.d.ts +1 -0
- package/vaadin-lit-time-picker.js +2 -0
- package/web-types.json +6 -6
- package/web-types.lit.json +8 -8
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright (c) 2018 - 2024 Vaadin Ltd.
|
|
4
|
+
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
|
+
*/
|
|
6
|
+
import type { Constructor } from '@open-wc/dedupe-mixin';
|
|
7
|
+
import type { DelegateFocusMixinClass } from '@vaadin/a11y-base/src/delegate-focus-mixin.js';
|
|
8
|
+
import type { DisabledMixinClass } from '@vaadin/a11y-base/src/disabled-mixin.js';
|
|
9
|
+
import type { FocusMixinClass } from '@vaadin/a11y-base/src/focus-mixin.js';
|
|
10
|
+
import type { KeyboardMixinClass } from '@vaadin/a11y-base/src/keyboard-mixin.js';
|
|
11
|
+
import type { ControllerMixinClass } from '@vaadin/component-base/src/controller-mixin.js';
|
|
12
|
+
import type { DelegateStateMixinClass } from '@vaadin/component-base/src/delegate-state-mixin.js';
|
|
13
|
+
import type { SlotStylesMixinClass } from '@vaadin/component-base/src/slot-styles-mixin.js';
|
|
14
|
+
import type { ClearButtonMixinClass } from '@vaadin/field-base/src/clear-button-mixin.js';
|
|
15
|
+
import type { FieldMixinClass } from '@vaadin/field-base/src/field-mixin.js';
|
|
16
|
+
import type { InputConstraintsMixinClass } from '@vaadin/field-base/src/input-constraints-mixin.js';
|
|
17
|
+
import type { InputControlMixinClass } from '@vaadin/field-base/src/input-control-mixin.js';
|
|
18
|
+
import type { InputMixinClass } from '@vaadin/field-base/src/input-mixin.js';
|
|
19
|
+
import type { LabelMixinClass } from '@vaadin/field-base/src/label-mixin.js';
|
|
20
|
+
import type { PatternMixinClass } from '@vaadin/field-base/src/pattern-mixin.js';
|
|
21
|
+
import type { ValidateMixinClass } from '@vaadin/field-base/src/validate-mixin.js';
|
|
22
|
+
import type { TimePickerTime } from './vaadin-time-picker-helper.js';
|
|
23
|
+
|
|
24
|
+
export interface TimePickerI18n {
|
|
25
|
+
parseTime(time: string): TimePickerTime | undefined;
|
|
26
|
+
formatTime(time: TimePickerTime | undefined): string;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* A mixin providing common time-picker functionality.
|
|
31
|
+
*/
|
|
32
|
+
export declare function TimePickerMixin<T extends Constructor<HTMLElement>>(
|
|
33
|
+
base: T,
|
|
34
|
+
): Constructor<ClearButtonMixinClass> &
|
|
35
|
+
Constructor<ControllerMixinClass> &
|
|
36
|
+
Constructor<DelegateFocusMixinClass> &
|
|
37
|
+
Constructor<DelegateStateMixinClass> &
|
|
38
|
+
Constructor<DisabledMixinClass> &
|
|
39
|
+
Constructor<FieldMixinClass> &
|
|
40
|
+
Constructor<FocusMixinClass> &
|
|
41
|
+
Constructor<InputConstraintsMixinClass> &
|
|
42
|
+
Constructor<InputControlMixinClass> &
|
|
43
|
+
Constructor<InputMixinClass> &
|
|
44
|
+
Constructor<KeyboardMixinClass> &
|
|
45
|
+
Constructor<LabelMixinClass> &
|
|
46
|
+
Constructor<PatternMixinClass> &
|
|
47
|
+
Constructor<SlotStylesMixinClass> &
|
|
48
|
+
Constructor<TimePickerMixinClass> &
|
|
49
|
+
Constructor<ValidateMixinClass> &
|
|
50
|
+
T;
|
|
51
|
+
|
|
52
|
+
export declare class TimePickerMixinClass {
|
|
53
|
+
/**
|
|
54
|
+
* The time value for this element.
|
|
55
|
+
*
|
|
56
|
+
* Supported time formats are in ISO 8601:
|
|
57
|
+
* - `hh:mm` (default)
|
|
58
|
+
* - `hh:mm:ss`
|
|
59
|
+
* - `hh:mm:ss.fff`
|
|
60
|
+
*/
|
|
61
|
+
value: string;
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* True if the dropdown is open, false otherwise.
|
|
65
|
+
*/
|
|
66
|
+
opened: boolean;
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Minimum time allowed.
|
|
70
|
+
*
|
|
71
|
+
* Supported time formats are in ISO 8601:
|
|
72
|
+
* - `hh:mm`
|
|
73
|
+
* - `hh:mm:ss`
|
|
74
|
+
* - `hh:mm:ss.fff`
|
|
75
|
+
*/
|
|
76
|
+
min: string;
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Maximum time allowed.
|
|
80
|
+
*
|
|
81
|
+
* Supported time formats are in ISO 8601:
|
|
82
|
+
* - `hh:mm`
|
|
83
|
+
* - `hh:mm:ss`
|
|
84
|
+
* - `hh:mm:ss.fff`
|
|
85
|
+
*/
|
|
86
|
+
max: string;
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Specifies the number of valid intervals in a day used for
|
|
90
|
+
* configuring the items displayed in the selection box.
|
|
91
|
+
*
|
|
92
|
+
* It also configures the precision of the value string. By default
|
|
93
|
+
* the component formats values as `hh:mm` but setting a step value
|
|
94
|
+
* lower than one minute or one second, format resolution changes to
|
|
95
|
+
* `hh:mm:ss` and `hh:mm:ss.fff` respectively.
|
|
96
|
+
*
|
|
97
|
+
* Unit must be set in seconds, and for correctly configuring intervals
|
|
98
|
+
* in the dropdown, it need to evenly divide a day.
|
|
99
|
+
*
|
|
100
|
+
* Note: it is possible to define step that is dividing an hour in inexact
|
|
101
|
+
* fragments (i.e. 5760 seconds which equals 1 hour 36 minutes), but it is
|
|
102
|
+
* not recommended to use it for better UX experience.
|
|
103
|
+
*/
|
|
104
|
+
step: number | null | undefined;
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Set true to prevent the overlay from opening automatically.
|
|
108
|
+
* @attr {boolean} auto-open-disabled
|
|
109
|
+
*/
|
|
110
|
+
autoOpenDisabled: boolean | null | undefined;
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* A space-delimited list of CSS class names to set on the overlay element.
|
|
114
|
+
*
|
|
115
|
+
* @attr {string} overlay-class
|
|
116
|
+
*/
|
|
117
|
+
overlayClass: string;
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* The object used to localize this component.
|
|
121
|
+
* To change the default localization, replace the entire
|
|
122
|
+
* _i18n_ object or just the property you want to modify.
|
|
123
|
+
*
|
|
124
|
+
* The object has the following JSON structure:
|
|
125
|
+
*
|
|
126
|
+
* ```
|
|
127
|
+
* {
|
|
128
|
+
* // A function to format given `Object` as
|
|
129
|
+
* // time string. Object is in the format `{ hours: ..., minutes: ..., seconds: ..., milliseconds: ... }`
|
|
130
|
+
* formatTime: (time) => {
|
|
131
|
+
* // returns a string representation of the given
|
|
132
|
+
* // object in `hh` / 'hh:mm' / 'hh:mm:ss' / 'hh:mm:ss.fff' - formats
|
|
133
|
+
* },
|
|
134
|
+
*
|
|
135
|
+
* // A function to parse the given text to an `Object` in the format
|
|
136
|
+
* // `{ hours: ..., minutes: ..., seconds: ..., milliseconds: ... }`.
|
|
137
|
+
* // Must properly parse (at least) text
|
|
138
|
+
* // formatted by `formatTime`.
|
|
139
|
+
* parseTime: text => {
|
|
140
|
+
* // Parses a string in object/string that can be formatted by`formatTime`.
|
|
141
|
+
* }
|
|
142
|
+
* }
|
|
143
|
+
* ```
|
|
144
|
+
*
|
|
145
|
+
* Both `formatTime` and `parseTime` need to be implemented
|
|
146
|
+
* to ensure the component works properly.
|
|
147
|
+
*/
|
|
148
|
+
i18n: TimePickerI18n;
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* Opens the dropdown list.
|
|
152
|
+
*/
|
|
153
|
+
open(): void;
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* Closes the dropdown list.
|
|
157
|
+
*/
|
|
158
|
+
close(): void;
|
|
159
|
+
}
|