@vaadin/combo-box 23.2.0-alpha1 → 23.2.0-alpha4

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.
@@ -3,24 +3,24 @@
3
3
  * Copyright (c) 2015 - 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 { ControllerMixinClass } from '@vaadin/component-base/src/controller-mixin.js';
7
- import { DisabledMixinClass } from '@vaadin/component-base/src/disabled-mixin.js';
8
- import { ElementMixinClass } from '@vaadin/component-base/src/element-mixin.js';
9
- import { FocusMixinClass } from '@vaadin/component-base/src/focus-mixin.js';
10
- import { KeyboardMixinClass } from '@vaadin/component-base/src/keyboard-mixin.js';
11
- import { DelegateFocusMixinClass } from '@vaadin/field-base/src/delegate-focus-mixin.js';
12
- import { DelegateStateMixinClass } from '@vaadin/field-base/src/delegate-state-mixin.js';
13
- import { FieldMixinClass } from '@vaadin/field-base/src/field-mixin.js';
14
- import { InputConstraintsMixinClass } from '@vaadin/field-base/src/input-constraints-mixin.js';
15
- import { InputControlMixinClass } from '@vaadin/field-base/src/input-control-mixin.js';
16
- import { InputMixinClass } from '@vaadin/field-base/src/input-mixin.js';
17
- import { LabelMixinClass } from '@vaadin/field-base/src/label-mixin.js';
18
- import { PatternMixinClass } from '@vaadin/field-base/src/pattern-mixin.js';
19
- import { ValidateMixinClass } from '@vaadin/field-base/src/validate-mixin.js';
20
- import { ThemableMixinClass } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
21
- import { ComboBoxDataProviderMixinClass } from './vaadin-combo-box-data-provider-mixin.js';
22
- import { ComboBoxMixinClass } from './vaadin-combo-box-mixin.js';
23
- import { ComboBoxDefaultItem } from './vaadin-combo-box-mixin.js';
6
+ import type { ControllerMixinClass } from '@vaadin/component-base/src/controller-mixin.js';
7
+ import type { DisabledMixinClass } from '@vaadin/component-base/src/disabled-mixin.js';
8
+ import type { ElementMixinClass } from '@vaadin/component-base/src/element-mixin.js';
9
+ import type { FocusMixinClass } from '@vaadin/component-base/src/focus-mixin.js';
10
+ import type { KeyboardMixinClass } from '@vaadin/component-base/src/keyboard-mixin.js';
11
+ import type { DelegateFocusMixinClass } from '@vaadin/field-base/src/delegate-focus-mixin.js';
12
+ import type { DelegateStateMixinClass } from '@vaadin/field-base/src/delegate-state-mixin.js';
13
+ import type { FieldMixinClass } from '@vaadin/field-base/src/field-mixin.js';
14
+ import type { InputConstraintsMixinClass } from '@vaadin/field-base/src/input-constraints-mixin.js';
15
+ import type { InputControlMixinClass } from '@vaadin/field-base/src/input-control-mixin.js';
16
+ import type { InputMixinClass } from '@vaadin/field-base/src/input-mixin.js';
17
+ import type { LabelMixinClass } from '@vaadin/field-base/src/label-mixin.js';
18
+ import type { PatternMixinClass } from '@vaadin/field-base/src/pattern-mixin.js';
19
+ import type { ValidateMixinClass } from '@vaadin/field-base/src/validate-mixin.js';
20
+ import type { ThemableMixinClass } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
21
+ import type { ComboBoxDataProviderMixinClass } from './vaadin-combo-box-data-provider-mixin.js';
22
+ import type { ComboBoxMixinClass } from './vaadin-combo-box-mixin.js';
23
+ import type { ComboBoxDefaultItem } from './vaadin-combo-box-mixin.js';
24
24
  export {
25
25
  ComboBoxDataProvider,
26
26
  ComboBoxDataProviderCallback,
@@ -65,6 +65,11 @@ export type ComboBoxFilterChangedEvent = CustomEvent<{ value: string }>;
65
65
  */
66
66
  export type ComboBoxSelectedItemChangedEvent<TItem> = CustomEvent<{ value: TItem | null | undefined }>;
67
67
 
68
+ /**
69
+ * Fired whenever the field is validated.
70
+ */
71
+ export type ComboBoxValidatedEvent = CustomEvent<{ valid: boolean }>;
72
+
68
73
  export interface ComboBoxEventMap<TItem> extends HTMLElementEventMap {
69
74
  change: ComboBoxChangeEvent<TItem>;
70
75
 
@@ -79,6 +84,8 @@ export interface ComboBoxEventMap<TItem> extends HTMLElementEventMap {
79
84
  'value-changed': ComboBoxValueChangedEvent;
80
85
 
81
86
  'selected-item-changed': ComboBoxSelectedItemChangedEvent<TItem>;
87
+
88
+ validated: ComboBoxValidatedEvent;
82
89
  }
83
90
 
84
91
  /**
@@ -165,6 +172,7 @@ export interface ComboBoxEventMap<TItem> extends HTMLElementEventMap {
165
172
  * Custom property | Description | Default
166
173
  * ----------------------------------------|----------------------------|---------
167
174
  * `--vaadin-field-default-width` | Default width of the field | `12em`
175
+ * `--vaadin-combo-box-overlay-width` | Width of the overlay | `auto`
168
176
  * `--vaadin-combo-box-overlay-max-height` | Max height of the overlay | `65vh`
169
177
  *
170
178
  * `<vaadin-combo-box>` provides the same set of shadow DOM parts and state attributes as `<vaadin-text-field>`.
@@ -207,18 +215,19 @@ export interface ComboBoxEventMap<TItem> extends HTMLElementEventMap {
207
215
  * @fires {CustomEvent} opened-changed - Fired when the `opened` property changes.
208
216
  * @fires {CustomEvent} selected-item-changed - Fired when the `selectedItem` property changes.
209
217
  * @fires {CustomEvent} value-changed - Fired when the `value` property changes.
218
+ * @fires {CustomEvent} validated - Fired whenever the field is validated.
210
219
  */
211
220
  declare class ComboBox<TItem = ComboBoxDefaultItem> extends HTMLElement {
212
221
  addEventListener<K extends keyof ComboBoxEventMap<TItem>>(
213
222
  type: K,
214
223
  listener: (this: ComboBox<TItem>, ev: ComboBoxEventMap<TItem>[K]) => void,
215
- options?: boolean | AddEventListenerOptions,
224
+ options?: AddEventListenerOptions | boolean,
216
225
  ): void;
217
226
 
218
227
  removeEventListener<K extends keyof ComboBoxEventMap<TItem>>(
219
228
  type: K,
220
229
  listener: (this: ComboBox<TItem>, ev: ComboBoxEventMap<TItem>[K]) => void,
221
- options?: boolean | EventListenerOptions,
230
+ options?: EventListenerOptions | boolean,
222
231
  ): void;
223
232
  }
224
233
 
@@ -104,6 +104,7 @@ registerStyles('vaadin-combo-box', inputFieldShared, { moduleId: 'vaadin-combo-b
104
104
  * Custom property | Description | Default
105
105
  * ----------------------------------------|----------------------------|---------
106
106
  * `--vaadin-field-default-width` | Default width of the field | `12em`
107
+ * `--vaadin-combo-box-overlay-width` | Width of the overlay | `auto`
107
108
  * `--vaadin-combo-box-overlay-max-height` | Max height of the overlay | `65vh`
108
109
  *
109
110
  * `<vaadin-combo-box>` provides the same set of shadow DOM parts and state attributes as `<vaadin-text-field>`.
@@ -146,6 +147,7 @@ registerStyles('vaadin-combo-box', inputFieldShared, { moduleId: 'vaadin-combo-b
146
147
  * @fires {CustomEvent} opened-changed - Fired when the `opened` property changes.
147
148
  * @fires {CustomEvent} selected-item-changed - Fired when the `selectedItem` property changes.
148
149
  * @fires {CustomEvent} value-changed - Fired when the `value` property changes.
150
+ * @fires {CustomEvent} validated - Fired whenever the field is validated.
149
151
  *
150
152
  * @extends HTMLElement
151
153
  * @mixes ElementMixin