@ni/nimble-components 24.1.5 → 24.1.7

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 (42) hide show
  1. package/dist/all-components-bundle.js +612 -134
  2. package/dist/all-components-bundle.js.map +1 -1
  3. package/dist/all-components-bundle.min.js +3514 -3489
  4. package/dist/all-components-bundle.min.js.map +1 -1
  5. package/dist/esm/combobox/index.d.ts +172 -20
  6. package/dist/esm/combobox/index.js +453 -44
  7. package/dist/esm/combobox/index.js.map +1 -1
  8. package/dist/esm/combobox/models/combobox-form-associated.d.ts +16 -0
  9. package/dist/esm/combobox/models/combobox-form-associated.js +19 -0
  10. package/dist/esm/combobox/models/combobox-form-associated.js.map +1 -0
  11. package/dist/esm/src/combobox/index.d.ts +172 -20
  12. package/dist/esm/src/combobox/models/combobox-form-associated.d.ts +16 -0
  13. package/dist/esm/src/wafer-map/index.d.ts +8 -17
  14. package/dist/esm/src/wafer-map/modules/experimental/computations.d.ts +1 -2
  15. package/dist/esm/src/wafer-map/modules/experimental/data-manager.d.ts +4 -10
  16. package/dist/esm/src/wafer-map/modules/experimental/hover-handler.d.ts +1 -5
  17. package/dist/esm/src/wafer-map/modules/experimental/prerendering.d.ts +18 -0
  18. package/dist/esm/src/wafer-map/modules/experimental/worker-renderer.d.ts +0 -1
  19. package/dist/esm/src/wafer-map/types.d.ts +6 -0
  20. package/dist/esm/wafer-map/index.d.ts +8 -17
  21. package/dist/esm/wafer-map/index.js +35 -24
  22. package/dist/esm/wafer-map/index.js.map +1 -1
  23. package/dist/esm/wafer-map/modules/experimental/computations.d.ts +1 -2
  24. package/dist/esm/wafer-map/modules/experimental/computations.js +1 -4
  25. package/dist/esm/wafer-map/modules/experimental/computations.js.map +1 -1
  26. package/dist/esm/wafer-map/modules/experimental/data-manager.d.ts +4 -10
  27. package/dist/esm/wafer-map/modules/experimental/data-manager.js +8 -26
  28. package/dist/esm/wafer-map/modules/experimental/data-manager.js.map +1 -1
  29. package/dist/esm/wafer-map/modules/experimental/hover-handler.d.ts +1 -5
  30. package/dist/esm/wafer-map/modules/experimental/hover-handler.js +6 -10
  31. package/dist/esm/wafer-map/modules/experimental/hover-handler.js.map +1 -1
  32. package/dist/esm/wafer-map/modules/experimental/prerendering.d.ts +18 -0
  33. package/dist/esm/wafer-map/modules/experimental/prerendering.js +63 -0
  34. package/dist/esm/wafer-map/modules/experimental/prerendering.js.map +1 -0
  35. package/dist/esm/wafer-map/modules/experimental/worker-renderer.d.ts +0 -1
  36. package/dist/esm/wafer-map/modules/experimental/worker-renderer.js +6 -10
  37. package/dist/esm/wafer-map/modules/experimental/worker-renderer.js.map +1 -1
  38. package/dist/esm/wafer-map/modules/hover-handler.js +2 -4
  39. package/dist/esm/wafer-map/modules/hover-handler.js.map +1 -1
  40. package/dist/esm/wafer-map/types.d.ts +6 -0
  41. package/dist/esm/wafer-map/types.js.map +1 -1
  42. package/package.json +1 -1
@@ -1,9 +1,10 @@
1
- import { Combobox as FoundationCombobox } from '@microsoft/fast-foundation';
1
+ import { ComboboxAutocomplete, SelectPosition, ListboxOption, DelegatesARIACombobox, StartEnd } from '@microsoft/fast-foundation';
2
2
  import { ToggleButton } from '../toggle-button';
3
3
  import type { ErrorPattern } from '../patterns/error/types';
4
4
  import type { DropdownPattern } from '../patterns/dropdown/types';
5
5
  import { DropdownAppearance } from '../patterns/dropdown/types';
6
6
  import type { AnchoredRegion } from '../anchored-region';
7
+ import { FormAssociatedCombobox } from './models/combobox-form-associated';
7
8
  declare global {
8
9
  interface HTMLElementTagNameMap {
9
10
  'nimble-combobox': Combobox;
@@ -12,23 +13,38 @@ declare global {
12
13
  /**
13
14
  * A nimble-styed HTML combobox
14
15
  */
15
- export declare class Combobox extends FoundationCombobox implements DropdownPattern, ErrorPattern {
16
+ export declare class Combobox extends FormAssociatedCombobox implements DropdownPattern, ErrorPattern {
16
17
  appearance: DropdownAppearance;
17
18
  /**
18
- * The ref to the internal dropdown button element.
19
- *
20
- * @internal
19
+ * A message explaining why the value is invalid.
21
20
  */
22
- readonly dropdownButton?: ToggleButton;
21
+ errorText?: string;
22
+ errorVisible: boolean;
23
23
  /**
24
- * A message explaining why the value is invalid.
24
+ * The autocomplete attribute.
25
+ */
26
+ autocomplete?: ComboboxAutocomplete;
27
+ /**
28
+ * The placement for the listbox when the combobox is open.
29
+ */
30
+ positionAttribute?: SelectPosition;
31
+ /**
32
+ * The open attribute.
33
+ */
34
+ open: boolean;
35
+ /**
36
+ * Sets the placeholder value of the element, generally used to provide a hint to the user.
37
+ * @remarks Using a non-null assertion to mimic FAST's original improper typing of an
38
+ * uninitialized property:
39
+ * https://github.com/microsoft/fast/blob/0c27d027ff6e8616ad4fddc17f4432aa7f6cbad0/packages/web-components/fast-foundation/src/combobox/combobox.ts#L199
40
+ */
41
+ placeholder: string;
42
+ /**
43
+ * The current state of the calculated position of the listbox.
25
44
  *
26
45
  * @public
27
- * @remarks
28
- * HTML Attribute: error-text
29
46
  */
30
- errorText?: string;
31
- errorVisible: boolean;
47
+ position?: SelectPosition;
32
48
  /**
33
49
  * @internal
34
50
  */
@@ -36,35 +52,169 @@ export declare class Combobox extends FoundationCombobox implements DropdownPatt
36
52
  /**
37
53
  * @internal
38
54
  */
39
- controlWrapper?: HTMLElement;
55
+ controlWrapper: HTMLElement;
56
+ /**
57
+ * @internal
58
+ */
59
+ control: HTMLInputElement;
60
+ /**
61
+ * @internal
62
+ */
63
+ listbox: HTMLDivElement;
64
+ /**
65
+ * @internal
66
+ */
67
+ readonly dropdownButton?: ToggleButton;
68
+ /**
69
+ * The collection of currently filtered options.
70
+ */
71
+ filteredOptions: ListboxOption[];
40
72
  /** @internal */
41
73
  hasOverflow: boolean;
42
74
  get value(): string;
43
75
  set value(next: string);
76
+ /**
77
+ * The list of options.
78
+ *
79
+ * Overrides `Listbox.options`.
80
+ */
81
+ get options(): ListboxOption[];
82
+ set options(value: ListboxOption[]);
83
+ /**
84
+ * The unique id for the internal listbox element.
85
+ *
86
+ * @internal
87
+ */
88
+ listboxId: string;
89
+ /**
90
+ * The max height for the listbox when opened.
91
+ *
92
+ * @internal
93
+ */
94
+ maxHeight: number;
44
95
  private valueUpdatedByInput;
45
96
  private valueBeforeTextUpdate?;
46
- setPositioning(): void;
97
+ private _value;
98
+ private filter;
99
+ /**
100
+ * The initial state of the position attribute.
101
+ */
102
+ private forcedPosition;
103
+ private get isAutocompleteInline();
104
+ private get isAutocompleteList();
105
+ private get isAutocompleteBoth();
47
106
  slottedOptionsChanged(prev: HTMLElement[], next: HTMLElement[]): void;
48
107
  connectedCallback(): void;
108
+ /**
109
+ * @internal
110
+ */
111
+ clickHandler(e: MouseEvent): boolean;
112
+ /**
113
+ * @internal
114
+ */
49
115
  toggleButtonClickHandler(e: Event): void;
116
+ /**
117
+ * @internal
118
+ */
50
119
  toggleButtonChangeHandler(e: Event): void;
120
+ /**
121
+ * @internal
122
+ */
51
123
  toggleButtonKeyDownHandler(e: KeyboardEvent): boolean;
124
+ /**
125
+ * @internal
126
+ */
52
127
  filterOptions(): void;
53
128
  /**
54
- * This is a workaround for the issue described here: https://github.com/microsoft/fast/issues/6267
55
- * For now, we will update the value ourselves while a user types in text. Note that there is other
56
- * implementation related to this (like the 'keydownEventHandler') needed to create the complete set
57
- * of desired behavior described in the issue noted above.
129
+ * @internal
130
+ */
131
+ inputHandler(e: InputEvent): boolean;
132
+ keydownHandler(e: KeyboardEvent): boolean;
133
+ /**
134
+ * @internal
135
+ */
136
+ keyupHandler(e: KeyboardEvent): boolean;
137
+ /**
138
+ * @internal
139
+ */
140
+ focusoutHandler(e: FocusEvent): boolean;
141
+ /**
142
+ * Reset the element to its first selectable option when its parent form is reset.
143
+ *
144
+ * @internal
145
+ */
146
+ formResetCallback(): void;
147
+ /** {@inheritDoc (FormAssociated:interface).validate} */
148
+ validate(): void;
149
+ /**
150
+ * Set the default selected options at initialization or reset.
151
+ *
152
+ * @internal
153
+ * @remarks
154
+ * Overrides `Listbox.setDefaultSelectedOption`
155
+ */
156
+ setDefaultSelectedOption(): void;
157
+ /**
158
+ * @internal
159
+ */
160
+ selectedIndexChanged(prev: number | undefined, next: number): void;
161
+ /**
162
+ * Synchronize the `aria-disabled` property when the `disabled` property changes.
163
+ *
164
+ * @internal
165
+ */
166
+ disabledChanged(prev: boolean, next: boolean): void;
167
+ /**
168
+ * Move focus to the previous selectable option.
169
+ *
170
+ * @internal
171
+ * @remarks
172
+ * Overrides `Listbox.selectPreviousOption`
173
+ */
174
+ selectPreviousOption(): void;
175
+ /**
176
+ * @internal
177
+ */
178
+ setPositioning(): void;
179
+ /**
180
+ * Focus the control and scroll the first selected option into view.
181
+ *
182
+ * @internal
183
+ * @remarks
184
+ * Overrides: `Listbox.focusAndScrollOptionIntoView`
58
185
  */
59
- inputHandler(e: InputEvent): boolean | void;
60
- keydownHandler(e: KeyboardEvent): boolean | void;
61
- focusoutHandler(e: FocusEvent): boolean | void;
62
186
  protected focusAndScrollOptionIntoView(): void;
63
187
  protected openChanged(): void;
188
+ protected placeholderChanged(): void;
189
+ /**
190
+ * Ensure that the entire list of options is used when setting the selected property.
191
+ * @internal
192
+ * @remarks
193
+ * Overrides: `Listbox.selectedOptionsChanged`
194
+ */
195
+ protected selectedOptionsChanged(_: ListboxOption[] | undefined, next: ListboxOption[]): void;
196
+ protected positionChanged(_: SelectPosition | undefined, next: SelectPosition | undefined): void;
64
197
  private regionChanged;
65
198
  private controlWrapperChanged;
66
199
  private ariaLabelChanged;
67
200
  private maxHeightChanged;
201
+ /**
202
+ * Sets the value and to match the first selected option.
203
+ */
204
+ private updateValue;
205
+ /**
206
+ * Focus and set the content of the control based on the first selected option.
207
+ */
208
+ private setInputToSelection;
209
+ /**
210
+ * Focus, set and select the content of the control based on the first selected option.
211
+ */
212
+ private setInlineSelection;
213
+ private clearSelectionRange;
214
+ /**
215
+ * Determines if a value update should involve emitting a change event, then updates the value.
216
+ */
217
+ private syncValue;
68
218
  private updateListboxMaxHeightCssVariable;
69
219
  private updateInputAriaLabel;
70
220
  /**
@@ -79,4 +229,6 @@ export declare class Combobox extends FoundationCombobox implements DropdownPatt
79
229
  */
80
230
  private emitChangeIfValueUpdated;
81
231
  }
232
+ export interface Combobox extends StartEnd, DelegatesARIACombobox {
233
+ }
82
234
  export declare const comboboxTag = "nimble-combobox";