@vaadin/time-picker 24.6.0-alpha4 → 24.6.0-alpha6

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.
@@ -4,21 +4,11 @@
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
6
  import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
7
- import { InputControlMixin } from '@vaadin/field-base/src/input-control-mixin.js';
8
- import { PatternMixin } from '@vaadin/field-base/src/pattern-mixin.js';
9
7
  import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
8
+ import { TimePickerMixin } from './vaadin-time-picker-mixin.js';
10
9
 
11
- export interface TimePickerTime {
12
- hours: number | string;
13
- minutes: number | string;
14
- seconds?: number | string;
15
- milliseconds?: number | string;
16
- }
17
-
18
- export interface TimePickerI18n {
19
- parseTime(time: string): TimePickerTime | undefined;
20
- formatTime(time: TimePickerTime | undefined): string;
21
- }
10
+ export type { TimePickerTime } from './vaadin-time-picker-helper.js';
11
+ export type { TimePickerI18n } from './vaadin-time-picker-mixin.js';
22
12
 
23
13
  /**
24
14
  * Fired when the user commits a value change.
@@ -135,114 +125,7 @@ export interface TimePickerEventMap extends HTMLElementEventMap, TimePickerCusto
135
125
  * @fires {CustomEvent} value-changed - Fired when the `value` property changes.
136
126
  * @fires {CustomEvent} validated - Fired whenever the field is validated.
137
127
  */
138
- declare class TimePicker extends PatternMixin(InputControlMixin(ThemableMixin(ElementMixin(HTMLElement)))) {
139
- /**
140
- * The time value for this element.
141
- *
142
- * Supported time formats are in ISO 8601:
143
- * - `hh:mm` (default)
144
- * - `hh:mm:ss`
145
- * - `hh:mm:ss.fff`
146
- */
147
- value: string;
148
-
149
- /**
150
- * True if the dropdown is open, false otherwise.
151
- */
152
- opened: boolean;
153
-
154
- /**
155
- * Minimum time allowed.
156
- *
157
- * Supported time formats are in ISO 8601:
158
- * - `hh:mm`
159
- * - `hh:mm:ss`
160
- * - `hh:mm:ss.fff`
161
- */
162
- min: string;
163
-
164
- /**
165
- * Maximum time allowed.
166
- *
167
- * Supported time formats are in ISO 8601:
168
- * - `hh:mm`
169
- * - `hh:mm:ss`
170
- * - `hh:mm:ss.fff`
171
- */
172
- max: string;
173
-
174
- /**
175
- * Specifies the number of valid intervals in a day used for
176
- * configuring the items displayed in the selection box.
177
- *
178
- * It also configures the precision of the value string. By default
179
- * the component formats values as `hh:mm` but setting a step value
180
- * lower than one minute or one second, format resolution changes to
181
- * `hh:mm:ss` and `hh:mm:ss.fff` respectively.
182
- *
183
- * Unit must be set in seconds, and for correctly configuring intervals
184
- * in the dropdown, it need to evenly divide a day.
185
- *
186
- * Note: it is possible to define step that is dividing an hour in inexact
187
- * fragments (i.e. 5760 seconds which equals 1 hour 36 minutes), but it is
188
- * not recommended to use it for better UX experience.
189
- */
190
- step: number | null | undefined;
191
-
192
- /**
193
- * Set true to prevent the overlay from opening automatically.
194
- * @attr {boolean} auto-open-disabled
195
- */
196
- autoOpenDisabled: boolean | null | undefined;
197
-
198
- /**
199
- * A space-delimited list of CSS class names to set on the overlay element.
200
- *
201
- * @attr {string} overlay-class
202
- */
203
- overlayClass: string;
204
-
205
- /**
206
- * The object used to localize this component.
207
- * To change the default localization, replace the entire
208
- * _i18n_ object or just the property you want to modify.
209
- *
210
- * The object has the following JSON structure:
211
- *
212
- * ```
213
- * {
214
- * // A function to format given `Object` as
215
- * // time string. Object is in the format `{ hours: ..., minutes: ..., seconds: ..., milliseconds: ... }`
216
- * formatTime: (time) => {
217
- * // returns a string representation of the given
218
- * // object in `hh` / 'hh:mm' / 'hh:mm:ss' / 'hh:mm:ss.fff' - formats
219
- * },
220
- *
221
- * // A function to parse the given text to an `Object` in the format
222
- * // `{ hours: ..., minutes: ..., seconds: ..., milliseconds: ... }`.
223
- * // Must properly parse (at least) text
224
- * // formatted by `formatTime`.
225
- * parseTime: text => {
226
- * // Parses a string in object/string that can be formatted by`formatTime`.
227
- * }
228
- * }
229
- * ```
230
- *
231
- * Both `formatTime` and `parseTime` need to be implemented
232
- * to ensure the component works properly.
233
- */
234
- i18n: TimePickerI18n;
235
-
236
- /**
237
- * Opens the dropdown list.
238
- */
239
- open(): void;
240
-
241
- /**
242
- * Closes the dropdown list.
243
- */
244
- close(): void;
245
-
128
+ declare class TimePicker extends TimePickerMixin(ThemableMixin(ElementMixin(HTMLElement))) {
246
129
  addEventListener<K extends keyof TimePickerEventMap>(
247
130
  type: K,
248
131
  listener: (this: TimePicker, ev: TimePickerEventMap[K]) => void,