@breadstone/mosaik-elements-foundation 0.0.151 → 0.0.152

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.
Files changed (27) hide show
  1. package/Controls/Behaviors/AutoCompleteable.d.ts +45 -7
  2. package/Controls/Behaviors/AutoCompleteable.d.ts.map +1 -1
  3. package/Controls/Behaviors/AutoCompleteable.js +230 -21
  4. package/Controls/Behaviors/AutoCompleteable.js.map +1 -1
  5. package/Controls/Components/Inputs/AutoCompleteBox/AutoCompleteBoxElement.d.ts +236 -3
  6. package/Controls/Components/Inputs/AutoCompleteBox/AutoCompleteBoxElement.d.ts.map +1 -1
  7. package/Controls/Components/Inputs/AutoCompleteBox/AutoCompleteBoxElement.js +647 -9
  8. package/Controls/Components/Inputs/AutoCompleteBox/AutoCompleteBoxElement.js.map +1 -1
  9. package/Controls/Components/Inputs/AutoCompleteBox/AutoCompleteBoxElementIntl.d.ts +31 -0
  10. package/Controls/Components/Inputs/AutoCompleteBox/AutoCompleteBoxElementIntl.d.ts.map +1 -0
  11. package/Controls/Components/Inputs/AutoCompleteBox/AutoCompleteBoxElementIntl.js +50 -0
  12. package/Controls/Components/Inputs/AutoCompleteBox/AutoCompleteBoxElementIntl.js.map +1 -0
  13. package/Controls/Components/Inputs/AutoCompleteBox/AutoCompleteBoxElementTemplate.d.ts.map +1 -1
  14. package/Controls/Components/Inputs/AutoCompleteBox/AutoCompleteBoxElementTemplate.js +64 -10
  15. package/Controls/Components/Inputs/AutoCompleteBox/AutoCompleteBoxElementTemplate.js.map +1 -1
  16. package/Controls/Components/Inputs/AutoCompleteBox/IAutoCompleteBoxElementProps.d.ts +15 -1
  17. package/Controls/Components/Inputs/AutoCompleteBox/IAutoCompleteBoxElementProps.d.ts.map +1 -1
  18. package/Controls/Controllers/AutoCompleteController.d.ts +1 -0
  19. package/Controls/Controllers/AutoCompleteController.d.ts.map +1 -1
  20. package/Controls/Controllers/AutoCompleteController.js +22 -5
  21. package/Controls/Controllers/AutoCompleteController.js.map +1 -1
  22. package/Index.d.ts +1 -1
  23. package/Index.d.ts.map +1 -1
  24. package/Index.js.map +1 -1
  25. package/Routing/PathToRegexp.d.ts +1 -1
  26. package/custom-elements.json +707 -28
  27. package/package.json +3 -3
@@ -1,6 +1,13 @@
1
+ import { CssLength } from '@breadstone/mosaik-themes';
2
+ import { type TemplateResult } from '../../../../Dom/Html';
1
3
  import { CustomElement } from '../../Abstracts/CustomElement';
2
4
  import type { IAutoCompleteBoxElementProps } from './IAutoCompleteBoxElementProps';
3
- declare const AutoCompleteBoxElement_base: (abstract new (...args: Array<any>) => import("../../../Behaviors/Themeable").IThemeableProps) & (abstract new (...args: Array<any>) => import("../../../Behaviors/AutoCompleteable").IAutoCompleteableProps & import("../../../Behaviors/AutoCompleteable").IAutoCompletableEvents & import("../../../Behaviors/AutoCompleteable").IAutoCompletable) & typeof CustomElement & import("../../../Behaviors/Themeable").IThemeableCtor;
5
+ import { Placement } from '../../../Types/Placement';
6
+ import { Strategy } from '../../../Types/Strategy';
7
+ import { FloatingSync } from '../../../Types/FloatingSync';
8
+ import { type IDropDownable } from '../../../Behaviors/DropDownable';
9
+ import { AutoCompleteBoxElementIntl } from './AutoCompleteBoxElementIntl';
10
+ declare const AutoCompleteBoxElement_base: (abstract new (...args: Array<any>) => import("../../../Behaviors/Themeable").IThemeableProps) & (abstract new (...args: Array<any>) => import("../../../Behaviors/DropDownable").IDropDownableProps & IDropDownable) & (abstract new (...args: Array<any>) => import("../../../Behaviors/Focusable").IFocusableProps) & (abstract new (...args: Array<any>) => import("../../../Behaviors/Disableable").IDisableableProps) & (abstract new (...args: Array<any>) => import("../../../Behaviors/AutoCompleteable").IAutoCompleteableProps & import("../../../Behaviors/AutoCompleteable").IAutoCompletableEvents & import("../../../Behaviors/AutoCompleteable").IAutoCompletable) & typeof CustomElement & import("../../../Behaviors/Themeable").IThemeableCtor;
4
11
  /**
5
12
  * Auto Complete Box - An input field with auto-completion functionality for enhanced user experience.
6
13
  *
@@ -17,6 +24,8 @@ declare const AutoCompleteBoxElement_base: (abstract new (...args: Array<any>) =
17
24
  * @csspart input - the input field.
18
25
  * @csspart list - the suggestions list.
19
26
  * @csspart item - individual suggestion items.
27
+ * @csspart portal - the floating portal container for the suggestions.
28
+ * @csspart popup - the floating popup container for the suggestions.
20
29
  *
21
30
  * @cssprop {String} --auto-complete-box-background-color - The background color.
22
31
  * @cssprop {String} --auto-complete-box-border-color - The border color.
@@ -33,6 +42,9 @@ declare const AutoCompleteBoxElement_base: (abstract new (...args: Array<any>) =
33
42
  * @cssprop {String} --auto-complete-box-shadow - The shadow.
34
43
  * @cssprop {String} --auto-complete-box-width - The width.
35
44
  *
45
+ * @dependency mosaik-portal - Provides a portal host for rendering the suggestion popup.
46
+ * @dependency mosaik-floating - Positions the suggestion popup relative to the host element.
47
+ *
36
48
  * @example
37
49
  * ```html
38
50
  * <mosaik-autocompletebox
@@ -43,8 +55,18 @@ declare const AutoCompleteBoxElement_base: (abstract new (...args: Array<any>) =
43
55
  *
44
56
  * @public
45
57
  */
46
- export declare class AutoCompleteBoxElement extends AutoCompleteBoxElement_base implements IAutoCompleteBoxElementProps {
58
+ export declare class AutoCompleteBoxElement extends AutoCompleteBoxElement_base implements IAutoCompleteBoxElementProps, IDropDownable {
59
+ private static _idCounter;
60
+ private static readonly _floatingFlipFallbackPlacements;
47
61
  private _text;
62
+ private _shouldSyncSearchFromText;
63
+ private _highlightedIndex;
64
+ private _lastFilterText;
65
+ private readonly _inputId;
66
+ private readonly _listboxId;
67
+ private readonly _intlController;
68
+ private _closeTimeoutHandle;
69
+ private _suggestionSync;
48
70
  /**
49
71
  * @public
50
72
  */
@@ -66,8 +88,219 @@ export declare class AutoCompleteBoxElement extends AutoCompleteBoxElement_base
66
88
  */
67
89
  get text(): string;
68
90
  set text(value: string);
69
- onInput(e: Event): void;
91
+ /**
92
+ * Gets the identifier of the input element.
93
+ *
94
+ * @public
95
+ * @readonly
96
+ */
97
+ get inputId(): string;
98
+ /**
99
+ * Gets the identifier of the suggestion list element.
100
+ *
101
+ * @public
102
+ * @readonly
103
+ */
104
+ get listboxId(): string;
105
+ /**
106
+ * Gets the index of the highlighted suggestion.
107
+ *
108
+ * @public
109
+ * @readonly
110
+ */
111
+ get highlightedIndex(): number;
112
+ /**
113
+ * Gets a value indicating whether the suggestion list should be rendered.
114
+ *
115
+ * @public
116
+ * @readonly
117
+ */
118
+ get shouldRenderSuggestions(): boolean;
119
+ /**
120
+ * Gets a value indicating whether suggestions are available.
121
+ *
122
+ * @public
123
+ * @readonly
124
+ */
125
+ get hasSuggestions(): boolean;
126
+ /**
127
+ * Gets the active descendant identifier for accessibility.
128
+ *
129
+ * @public
130
+ * @readonly
131
+ */
132
+ get activeDescendantId(): string | null;
133
+ /**
134
+ * Gets a value indicating whether the no-results message should be displayed.
135
+ *
136
+ * @public
137
+ * @readonly
138
+ */
139
+ get shouldShowNoResultsMessage(): boolean;
140
+ /**
141
+ * Gets a value indicating whether the loading state should be displayed.
142
+ *
143
+ * @public
144
+ * @readonly
145
+ */
146
+ get shouldShowLoadingState(): boolean;
147
+ /**
148
+ * Gets or sets the preferred placement for the suggestion popup.
149
+ *
150
+ * @public
151
+ * @attr
152
+ */
153
+ get suggestionPlacement(): Placement;
154
+ set suggestionPlacement(value: Placement);
155
+ /**
156
+ * Gets or sets the positioning strategy for the suggestion popup.
157
+ *
158
+ * @public
159
+ * @attr
160
+ */
161
+ get suggestionStrategy(): Strategy;
162
+ set suggestionStrategy(value: Strategy);
163
+ /**
164
+ * Gets or sets the distance in pixels between the host and the suggestion popup.
165
+ *
166
+ * @public
167
+ * @attr
168
+ */
169
+ get suggestionDistance(): number;
170
+ set suggestionDistance(value: number);
171
+ /**
172
+ * Gets or sets the horizontal skidding offset for the suggestion popup.
173
+ *
174
+ * @public
175
+ * @attr
176
+ */
177
+ get suggestionSkidding(): number;
178
+ set suggestionSkidding(value: number);
179
+ /**
180
+ * Gets or sets the size synchronization mode for the suggestion popup.
181
+ *
182
+ * @public
183
+ * @attr
184
+ */
185
+ get suggestionSync(): FloatingSync;
186
+ set suggestionSync(value: FloatingSync);
187
+ /**
188
+ * Gets or sets the maximum height for the suggestion popup.
189
+ *
190
+ * @public
191
+ * @attr
192
+ */
193
+ get maxSuggestionHeight(): CssLength;
194
+ set maxSuggestionHeight(value: CssLength);
195
+ /**
196
+ * Gets the fallback placements used when positioning the suggestion popup.
197
+ *
198
+ * @public
199
+ * @readonly
200
+ */
201
+ get suggestionFlipFallbackPlacements(): Array<Placement>;
202
+ /**
203
+ * Returns the `intl` property.
204
+ *
205
+ * @public
206
+ * @readonly
207
+ */
208
+ get intl(): AutoCompleteBoxElementIntl;
209
+ /**
210
+ * Synchronizes the suggestion visibility with the floating popup state.
211
+ *
212
+ * @public
213
+ * @param isActive - Indicates whether the floating popup is active.
214
+ */
215
+ onFloatingActiveChanged(isActive: boolean): void;
216
+ /**
217
+ * @public
218
+ * @override
219
+ */
70
220
  onSelectCallback(item: unknown): void;
221
+ /**
222
+ * @public
223
+ * @override
224
+ */
225
+ disconnectedCallback(): void;
226
+ /**
227
+ * Handles input events raised by the native text box.
228
+ *
229
+ * @public
230
+ * @param event - The event that triggered the handler.
231
+ */
232
+ onInput(event: Event): void;
233
+ /**
234
+ * Handles focus events raised by the native input element.
235
+ *
236
+ * @public
237
+ */
238
+ onFocus(_event: FocusEvent): void;
239
+ /**
240
+ * Handles blur events raised by the native input element.
241
+ *
242
+ * @public
243
+ */
244
+ onBlur(_event: FocusEvent): void;
245
+ /**
246
+ * Handles keyboard interactions for navigating the suggestion list.
247
+ *
248
+ * @public
249
+ * @param event - The keyboard event that triggered the handler.
250
+ */
251
+ onKeyDown(event: KeyboardEvent): void;
252
+ /**
253
+ * Handles pointer events to keep the suggestion list open while interacting with it.
254
+ *
255
+ * @public
256
+ * @param event - The mouse event that triggered the handler.
257
+ */
258
+ onSuggestionMouseDown(event: MouseEvent): void;
259
+ /**
260
+ * Handles click events on suggestion items.
261
+ *
262
+ * @public
263
+ * @param index - The index of the clicked suggestion.
264
+ */
265
+ onSuggestionClick(index: number): void;
266
+ /**
267
+ * Renders a suggestion with highlighted text.
268
+ *
269
+ * @public
270
+ * @param item - The item to render.
271
+ */
272
+ renderHighlightedItem(item: unknown): TemplateResult;
273
+ /**
274
+ * Gets the identifier for the suggestion option at the specified index.
275
+ *
276
+ * @public
277
+ * @param index - The index of the option.
278
+ */
279
+ getOptionId(index: number): string;
280
+ /**
281
+ * Synchronizes internal state when the dropdown open state changes.
282
+ *
283
+ * @protected
284
+ */
285
+ protected onDropDownOpenChanged(_previous?: boolean, next?: boolean): void;
286
+ /**
287
+ * @protected
288
+ */
289
+ protected onDisabledChanged(_previous: boolean, next: boolean): void;
290
+ private static generateId;
291
+ private getInputElement;
292
+ private executeWithoutSearchSync;
293
+ private openSuggestions;
294
+ private closeSuggestions;
295
+ private scheduleCloseSuggestions;
296
+ private cancelCloseSuggestions;
297
+ private clearCloseTimeout;
298
+ private commitSelection;
299
+ private applyTextCompletion;
300
+ private moveHighlight;
301
+ private setHighlightedIndex;
302
+ private scrollHighlightedOptionIntoView;
303
+ private scrollOptionIntoView;
71
304
  }
72
305
  /**
73
306
  * @public
@@ -1 +1 @@
1
- {"version":3,"file":"AutoCompleteBoxElement.d.ts","sourceRoot":"","sources":["../../../../../src/Controls/Components/Inputs/AutoCompleteBox/AutoCompleteBoxElement.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAE9D,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAC;;AAQnF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AACH,qBAca,sBACT,SAAQ,2BACR,YAAW,4BAA4B;IAIvC,OAAO,CAAC,KAAK,CAAc;IAM3B;;OAEG;;IASH;;;;;;;OAOG;IACH,WAAkB,EAAE,IAAI,MAAM,CAE7B;IAED;;;;;OAKG;IACH,IACW,IAAI,IAAI,MAAM,CAExB;IAED,IAAW,IAAI,CAAC,KAAK,EAAE,MAAM,EAK5B;IAMM,OAAO,CAAC,CAAC,EAAE,KAAK,GAAG,IAAI;IAMd,gBAAgB,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI;CAMxD;AAED;;GAEG;AACH,yBAAiB,sBAAsB,CAAC;IACpC,KAAY,KAAK,GAAG,4BAA4B,CAAC;CACpD;AAED;;GAEG;AACH,OAAO,CAAC,MAAM,CAAC;IAEX,UAAU,qBAAqB;QAE3B,wBAAwB,EAAE,sBAAsB,CAAC;KACpD;CACJ"}
1
+ {"version":3,"file":"AutoCompleteBoxElement.d.ts","sourceRoot":"","sources":["../../../../../src/Controls/Components/Inputs/AutoCompleteBox/AutoCompleteBoxElement.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACtD,OAAO,EAAQ,KAAK,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAIjE,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAE9D,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAC;AAKnF,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AACrD,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAG3D,OAAO,EAAgB,KAAK,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAKnF,OAAO,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAC;;AAI1E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AACH,qBAiBa,sBACT,SAAQ,2BACR,YAAW,4BAA4B,EAAE,aAAa;IAItD,OAAO,CAAC,MAAM,CAAC,UAAU,CAAa;IACtC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,+BAA+B,CAGpD;IACH,OAAO,CAAC,KA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