igniteui-webcomponents 4.1.1 → 4.2.0
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/CHANGELOG.md +13 -1
- package/animations/easings.d.ts +31 -0
- package/animations/easings.js +35 -0
- package/animations/easings.js.map +1 -0
- package/animations/index.d.ts +3 -0
- package/animations/index.js +4 -0
- package/animations/index.js.map +1 -0
- package/animations/player.d.ts +9 -0
- package/animations/player.js +47 -0
- package/animations/player.js.map +1 -0
- package/animations/presets/grow/index.d.ts +3 -0
- package/animations/presets/grow/index.js +18 -0
- package/animations/presets/grow/index.js.map +1 -0
- package/animations/presets/index.d.ts +1 -0
- package/animations/presets/index.js +2 -0
- package/animations/presets/index.js.map +1 -0
- package/animations/types.d.ts +5 -0
- package/animations/types.js +7 -0
- package/animations/types.js.map +1 -0
- package/components/accordion/accordion.js +4 -4
- package/components/accordion/accordion.js.map +1 -1
- package/components/accordion/themes/accordion.base.css.js +10 -0
- package/components/accordion/themes/accordion.base.css.js.map +1 -1
- package/components/badge/themes/light/badge.base.css.js +15 -11
- package/components/badge/themes/light/badge.base.css.js.map +1 -1
- package/components/badge/themes/light/badge.bootstrap.css.js +4 -5
- package/components/badge/themes/light/badge.bootstrap.css.js.map +1 -1
- package/components/combo/combo-item.d.ts +2 -0
- package/components/combo/combo-item.js +16 -9
- package/components/combo/combo-item.js.map +1 -1
- package/components/combo/combo.d.ts +56 -8
- package/components/combo/combo.js +99 -17
- package/components/combo/combo.js.map +1 -1
- package/components/combo/controllers/navigation.d.ts +7 -4
- package/components/combo/controllers/navigation.js +37 -5
- package/components/combo/controllers/navigation.js.map +1 -1
- package/components/combo/controllers/selection.d.ts +4 -3
- package/components/combo/controllers/selection.js +21 -10
- package/components/combo/controllers/selection.js.map +1 -1
- package/components/combo/themes/light/combo.base.css.js +23 -16
- package/components/combo/themes/light/combo.base.css.js.map +1 -1
- package/components/combo/themes/light/combo.bootstrap.css.js +32 -0
- package/components/combo/themes/light/combo.bootstrap.css.js.map +1 -1
- package/components/combo/themes/light/combo.fluent.css.js +35 -2
- package/components/combo/themes/light/combo.fluent.css.js.map +1 -1
- package/components/combo/themes/light/combo.indigo.css.js +22 -12
- package/components/combo/themes/light/combo.indigo.css.js.map +1 -1
- package/components/combo/themes/light/combo.material.css.js +47 -3
- package/components/combo/themes/light/combo.material.css.js.map +1 -1
- package/components/combo/types.d.ts +1 -0
- package/components/combo/types.js.map +1 -1
- package/components/expansion-panel/expansion-panel.d.ts +4 -0
- package/components/expansion-panel/expansion-panel.js +32 -6
- package/components/expansion-panel/expansion-panel.js.map +1 -1
- package/components/expansion-panel/themes/light/expansion-panel.base.css.js +49 -2
- package/components/expansion-panel/themes/light/expansion-panel.base.css.js.map +1 -1
- package/components/input/themes/light/input.bootstrap.css.js +20 -3
- package/components/input/themes/light/input.bootstrap.css.js.map +1 -1
- package/components/input/themes/light/input.fluent.css.js +19 -5
- package/components/input/themes/light/input.fluent.css.js.map +1 -1
- package/components/input/themes/light/input.indigo.css.js +31 -7
- package/components/input/themes/light/input.indigo.css.js.map +1 -1
- package/components/input/themes/light/input.material.css.js +5 -7
- package/components/input/themes/light/input.material.css.js.map +1 -1
- package/components/nav-drawer/themes/light/fluent/nav-drawer-item.fluent.css.js +1 -1
- package/components/nav-drawer/themes/light/fluent/nav-drawer-item.fluent.css.js.map +1 -1
- package/components/nav-drawer/themes/light/indigo/nav-drawer-item.indigo.css.js +1 -1
- package/components/nav-drawer/themes/light/indigo/nav-drawer-item.indigo.css.js.map +1 -1
- package/components/nav-drawer/themes/light/nav-drawer-item.base.css.js +11 -11
- package/components/nav-drawer/themes/light/nav-drawer-item.base.css.js.map +1 -1
- package/components/radio/themes/dark/radio.material.css.d.ts +1 -0
- package/components/radio/themes/dark/radio.material.css.js +3 -0
- package/components/radio/themes/dark/radio.material.css.js.map +1 -0
- package/components/radio/themes/light/radio.base.css.js +0 -3
- package/components/radio/themes/light/radio.base.css.js.map +1 -1
- package/components/radio/themes/light/radio.fluent.css.js +10 -9
- package/components/radio/themes/light/radio.fluent.css.js.map +1 -1
- package/components/radio/themes/light/radio.material.css.js +17 -3
- package/components/radio/themes/light/radio.material.css.js.map +1 -1
- package/components/radio-group/radio-group.base.css.js +2 -8
- package/components/radio-group/radio-group.base.css.js.map +1 -1
- package/components/radio-group/radio-group.fluent.css.d.ts +1 -0
- package/components/radio-group/radio-group.fluent.css.js +6 -0
- package/components/radio-group/radio-group.fluent.css.js.map +1 -0
- package/components/radio-group/radio-group.js +9 -2
- package/components/radio-group/radio-group.js.map +1 -1
- package/components/radio-group/radio-group.material.css.d.ts +1 -0
- package/components/radio-group/radio-group.material.css.js +10 -0
- package/components/radio-group/radio-group.material.css.js.map +1 -0
- package/components/select/themes/light/select.base.css.js +16 -15
- package/components/select/themes/light/select.base.css.js.map +1 -1
- package/components/select/themes/light/select.bootstrap.css.js +7 -0
- package/components/select/themes/light/select.bootstrap.css.js.map +1 -1
- package/components/select/themes/light/select.fluent.css.js +11 -0
- package/components/select/themes/light/select.fluent.css.js.map +1 -1
- package/components/select/themes/light/select.indigo.css.js +10 -1
- package/components/select/themes/light/select.indigo.css.js.map +1 -1
- package/components/select/themes/light/select.material.css.js +14 -0
- package/components/select/themes/light/select.material.css.js.map +1 -1
- package/components/toggle/toggle.controller.js.map +1 -1
- package/components/toggle/toggle.directive.js.map +1 -1
- package/custom-elements.json +24 -0
- package/package.json +2 -2
- package/themes/dark/bootstrap.css +3 -1
- package/themes/dark/fluent.css +4 -3
- package/themes/dark/indigo.css +3 -1
- package/themes/dark/material.css +12 -1
- package/vscode-html-custom-data.json +13 -3
|
@@ -5,7 +5,7 @@ import { SelectionController } from './controllers/selection.js';
|
|
|
5
5
|
import { IgcToggleController } from '../toggle/toggle.controller.js';
|
|
6
6
|
import { DataController } from './controllers/data.js';
|
|
7
7
|
import { IgcToggleComponent } from '../toggle/types.js';
|
|
8
|
-
import { Keys,
|
|
8
|
+
import { Keys, ComboRecord, GroupingDirection, FilteringOptions, IgcComboEventMap, ComboItemTemplate, Item } from './types.js';
|
|
9
9
|
import { Constructor } from '../common/mixins/constructor.js';
|
|
10
10
|
import type { ThemeController, Theme } from '../../theming/types.js';
|
|
11
11
|
declare const IgcComboComponent_base: import("../common/mixins/constructor.js").AbstractConstructor<import("../common/mixins/event-emitter.js").EventEmitterInterface<IgcComboEventMap>> & Constructor<LitElement>;
|
|
@@ -54,6 +54,7 @@ declare const IgcComboComponent_base: import("../common/mixins/constructor.js").
|
|
|
54
54
|
export default class IgcComboComponent<T extends object> extends IgcComboComponent_base implements Partial<IgcToggleComponent> {
|
|
55
55
|
static readonly tagName = "igc-combo";
|
|
56
56
|
static styles: import("lit").CSSResult;
|
|
57
|
+
private _value;
|
|
57
58
|
protected navigationController: NavigationController<T>;
|
|
58
59
|
protected selectionController: SelectionController<T>;
|
|
59
60
|
protected dataController: DataController<T>;
|
|
@@ -93,6 +94,11 @@ export default class IgcComboComponent<T extends object> extends IgcComboCompone
|
|
|
93
94
|
* @attr outlined
|
|
94
95
|
*/
|
|
95
96
|
outlined: boolean;
|
|
97
|
+
/**
|
|
98
|
+
* Enables single selection mode and moves item filtering to the main input.
|
|
99
|
+
* @attr single-select
|
|
100
|
+
*/
|
|
101
|
+
singleSelect: boolean;
|
|
96
102
|
/**
|
|
97
103
|
* The autofocus attribute of the control.
|
|
98
104
|
* @attr autofocus
|
|
@@ -189,11 +195,14 @@ export default class IgcComboComponent<T extends object> extends IgcComboCompone
|
|
|
189
195
|
protected themeAdopted(controller: ThemeController): void;
|
|
190
196
|
protected willUpdate(): void;
|
|
191
197
|
protected getUpdateComplete(): Promise<boolean>;
|
|
198
|
+
protected resetSearchTerm(): void;
|
|
199
|
+
protected resetState(): Promise<void>;
|
|
192
200
|
/**
|
|
193
201
|
* Returns the current selection as a list of commma separated values,
|
|
194
202
|
* represented by the display key, when provided.
|
|
195
203
|
*/
|
|
196
204
|
get value(): string;
|
|
205
|
+
protected updateValue(): Promise<void>;
|
|
197
206
|
protected validate(): void;
|
|
198
207
|
/** Checks the validity of the control. */
|
|
199
208
|
reportValidity(): boolean;
|
|
@@ -203,18 +212,54 @@ export default class IgcComboComponent<T extends object> extends IgcComboCompone
|
|
|
203
212
|
focus(options?: FocusOptions): void;
|
|
204
213
|
/** Removes focus from the component. */
|
|
205
214
|
blur(): void;
|
|
215
|
+
protected normalizeSelection(items?: Item<T> | Item<T>[]): Item<T>[];
|
|
206
216
|
/**
|
|
207
|
-
* Selects
|
|
217
|
+
* Selects option(s) in the list by either reference or valueKey.
|
|
208
218
|
* If not argument is provided all items will be selected.
|
|
209
|
-
* @param { T
|
|
219
|
+
* @param { Item<T> | Items<T> } items - One or more items to be selected. Multiple items should be passed as an array.
|
|
220
|
+
* When valueKey is specified, the corresponding value should be used in place of the item reference.
|
|
221
|
+
* @example
|
|
222
|
+
* ```typescript
|
|
223
|
+
* const combo<IgcComboComponent<T>> = document.querySelector('igc-combo');
|
|
224
|
+
*
|
|
225
|
+
* // Select one item at a time by reference when valueKey is not specified.
|
|
226
|
+
* combo.select(combo.data[0]);
|
|
227
|
+
*
|
|
228
|
+
* // Select multiple items at a time by reference when valueKey is not specified.
|
|
229
|
+
* combo.select([combo.data[0], combo.data[1]]);
|
|
230
|
+
*
|
|
231
|
+
* // Select one item at a time when valueKey is specified.
|
|
232
|
+
* combo.select('BG01');
|
|
233
|
+
*
|
|
234
|
+
* // Select multiple items at a time when valueKey is specified.
|
|
235
|
+
* combo.select(['BG01', 'BG02']);
|
|
236
|
+
* ```
|
|
210
237
|
*/
|
|
211
|
-
select(items?: T
|
|
238
|
+
select(items?: Item<T> | Item<T>[]): void;
|
|
212
239
|
/**
|
|
213
|
-
* Deselects
|
|
240
|
+
* Deselects option(s) in the list by either reference or valueKey.
|
|
214
241
|
* If not argument is provided all items will be deselected.
|
|
215
|
-
* @param { T
|
|
242
|
+
* @param { Item<T> | Items<T> } items - One or more items to be deselected. Multiple items should be passed as an array.
|
|
243
|
+
* When valueKey is specified, the corresponding value should be used in place of the item reference.
|
|
244
|
+
* @example
|
|
245
|
+
* ```typescript
|
|
246
|
+
* const combo<IgcComboComponent<T>> = document.querySelector('igc-combo');
|
|
247
|
+
*
|
|
248
|
+
* // Deselect one item at a time by reference when valueKey is not specified.
|
|
249
|
+
* combo.deselect(combo.data[0]);
|
|
250
|
+
*
|
|
251
|
+
* // Deselect multiple items at a time by reference when valueKey is not specified.
|
|
252
|
+
* combo.deselect([combo.data[0], combo.data[1]]);
|
|
253
|
+
*
|
|
254
|
+
* // Deselect one item at a time when valueKey is specified.
|
|
255
|
+
* combo.deselect('BG01');
|
|
256
|
+
*
|
|
257
|
+
* // Deselect multiple items at a time when valueKey is specified.
|
|
258
|
+
* combo.deselect(['BG01', 'BG02']);
|
|
259
|
+
* ```
|
|
216
260
|
*/
|
|
217
|
-
deselect(items?: T
|
|
261
|
+
deselect(items?: Item<T> | Item<T>[]): void;
|
|
262
|
+
protected handleMainInput(e: CustomEvent): Promise<void>;
|
|
218
263
|
protected handleSearchInput(e: CustomEvent): void;
|
|
219
264
|
protected handleOpening(): boolean;
|
|
220
265
|
protected handleClosing(): boolean;
|
|
@@ -233,13 +278,16 @@ export default class IgcComboComponent<T extends object> extends IgcComboCompone
|
|
|
233
278
|
protected itemClickHandler(event: MouseEvent): void;
|
|
234
279
|
protected toggleSelect(index: number): void;
|
|
235
280
|
protected navigateTo(item: T): void;
|
|
281
|
+
protected clearSingleSelection(): void;
|
|
236
282
|
protected handleClearIconClick(e: MouseEvent): void;
|
|
283
|
+
protected handleMainInputKeydown(e: KeyboardEvent): void;
|
|
284
|
+
protected handleSearchInputKeydown(e: KeyboardEvent): void;
|
|
237
285
|
protected toggleCaseSensitivity(): void;
|
|
238
286
|
protected get hasPrefixes(): boolean;
|
|
239
287
|
protected get hasSuffixes(): boolean;
|
|
240
288
|
private renderToggleIcon;
|
|
241
289
|
private renderClearIcon;
|
|
242
|
-
private
|
|
290
|
+
private renderMainInput;
|
|
243
291
|
private renderSearchInput;
|
|
244
292
|
private renderEmptyTemplate;
|
|
245
293
|
private renderList;
|
|
@@ -47,7 +47,6 @@ let IgcComboComponent = class IgcComboComponent extends EventEmitterMixin(LitEle
|
|
|
47
47
|
}
|
|
48
48
|
async pipeline() {
|
|
49
49
|
this.dataState = await this.dataController.apply([...this.data]);
|
|
50
|
-
this.navigationController.active = -1;
|
|
51
50
|
}
|
|
52
51
|
toggleDirectiveChange() {
|
|
53
52
|
if (!this.target)
|
|
@@ -57,6 +56,7 @@ let IgcComboComponent = class IgcComboComponent extends EventEmitterMixin(LitEle
|
|
|
57
56
|
}
|
|
58
57
|
constructor() {
|
|
59
58
|
super();
|
|
59
|
+
this._value = '';
|
|
60
60
|
this.navigationController = new NavigationController(this);
|
|
61
61
|
this.selectionController = new SelectionController(this);
|
|
62
62
|
this.dataController = new DataController(this);
|
|
@@ -65,6 +65,7 @@ let IgcComboComponent = class IgcComboComponent extends EventEmitterMixin(LitEle
|
|
|
65
65
|
this.required = false;
|
|
66
66
|
this.invalid = false;
|
|
67
67
|
this.outlined = false;
|
|
68
|
+
this.singleSelect = false;
|
|
68
69
|
this.autofocusList = false;
|
|
69
70
|
this.placeholderSearch = 'Search';
|
|
70
71
|
this.dir = 'auto';
|
|
@@ -111,6 +112,7 @@ let IgcComboComponent = class IgcComboComponent extends EventEmitterMixin(LitEle
|
|
|
111
112
|
.index=${index}
|
|
112
113
|
.active=${active}
|
|
113
114
|
.selected=${selected}
|
|
115
|
+
?hide-checkbox=${this.singleSelect}
|
|
114
116
|
>${this.itemTemplate({ item: record })}</igc-combo-item
|
|
115
117
|
>`;
|
|
116
118
|
return html `${this.groupKey && record.header
|
|
@@ -131,6 +133,11 @@ let IgcComboComponent = class IgcComboComponent extends EventEmitterMixin(LitEle
|
|
|
131
133
|
this.emitEvent('igcFocus');
|
|
132
134
|
});
|
|
133
135
|
this.addEventListener('blur', () => {
|
|
136
|
+
const { selected } = this.selectionController;
|
|
137
|
+
if (selected.size === 0) {
|
|
138
|
+
this.target.value = '';
|
|
139
|
+
this.resetSearchTerm();
|
|
140
|
+
}
|
|
134
141
|
this.emitEvent('igcBlur');
|
|
135
142
|
});
|
|
136
143
|
this.addEventListener('keydown', this.navigationController.navigateHost.bind(this.navigationController));
|
|
@@ -146,8 +153,23 @@ let IgcComboComponent = class IgcComboComponent extends EventEmitterMixin(LitEle
|
|
|
146
153
|
await this.toggleController.rendered;
|
|
147
154
|
return result;
|
|
148
155
|
}
|
|
156
|
+
resetSearchTerm() {
|
|
157
|
+
this.dataController.searchTerm = '';
|
|
158
|
+
}
|
|
159
|
+
async resetState() {
|
|
160
|
+
await this.updateComplete;
|
|
161
|
+
this.selectionController.selected.clear();
|
|
162
|
+
this.updateValue();
|
|
163
|
+
this.resetSearchTerm();
|
|
164
|
+
this.navigationController.active = -1;
|
|
165
|
+
}
|
|
149
166
|
get value() {
|
|
150
|
-
return this.
|
|
167
|
+
return this._value;
|
|
168
|
+
}
|
|
169
|
+
async updateValue() {
|
|
170
|
+
this._value = this.selectionController.getValue(Array.from(this.selectionController.selected));
|
|
171
|
+
await this.updateComplete;
|
|
172
|
+
this.target.value = this._value;
|
|
151
173
|
}
|
|
152
174
|
validate() {
|
|
153
175
|
this.updateComplete.then(() => this.reportValidity());
|
|
@@ -165,13 +187,29 @@ let IgcComboComponent = class IgcComboComponent extends EventEmitterMixin(LitEle
|
|
|
165
187
|
blur() {
|
|
166
188
|
this.target.blur();
|
|
167
189
|
}
|
|
190
|
+
normalizeSelection(items = []) {
|
|
191
|
+
return Array.isArray(items) ? items : [items];
|
|
192
|
+
}
|
|
168
193
|
select(items) {
|
|
169
|
-
this.
|
|
194
|
+
const _items = this.normalizeSelection(items);
|
|
195
|
+
this.selectionController.select(_items, false);
|
|
170
196
|
this.list.requestUpdate();
|
|
197
|
+
this.updateValue();
|
|
171
198
|
}
|
|
172
199
|
deselect(items) {
|
|
173
|
-
this.
|
|
200
|
+
const _items = this.normalizeSelection(items);
|
|
201
|
+
this.selectionController.deselect(_items, false);
|
|
174
202
|
this.list.requestUpdate();
|
|
203
|
+
this.updateValue();
|
|
204
|
+
}
|
|
205
|
+
async handleMainInput(e) {
|
|
206
|
+
this._show();
|
|
207
|
+
this.dataController.searchTerm = e.detail;
|
|
208
|
+
await this.updateComplete;
|
|
209
|
+
const match = e.detail.length > 0 && this.dataState.length > 0;
|
|
210
|
+
this.navigationController.active = match ? 1 : -1;
|
|
211
|
+
this.list.requestUpdate();
|
|
212
|
+
this.clearSingleSelection();
|
|
175
213
|
}
|
|
176
214
|
handleSearchInput(e) {
|
|
177
215
|
this.dataController.searchTerm = e.detail;
|
|
@@ -192,7 +230,9 @@ let IgcComboComponent = class IgcComboComponent extends EventEmitterMixin(LitEle
|
|
|
192
230
|
this.open = true;
|
|
193
231
|
await this.updateComplete;
|
|
194
232
|
emit && this.emitEvent('igcOpened');
|
|
195
|
-
this.
|
|
233
|
+
if (!this.singleSelect) {
|
|
234
|
+
this.list.focus();
|
|
235
|
+
}
|
|
196
236
|
if (!this.autofocusList) {
|
|
197
237
|
this.input.focus();
|
|
198
238
|
}
|
|
@@ -208,7 +248,7 @@ let IgcComboComponent = class IgcComboComponent extends EventEmitterMixin(LitEle
|
|
|
208
248
|
this.open = false;
|
|
209
249
|
await this.updateComplete;
|
|
210
250
|
emit && this.emitEvent('igcClosed');
|
|
211
|
-
this.
|
|
251
|
+
this.navigationController.active = -1;
|
|
212
252
|
}
|
|
213
253
|
hide() {
|
|
214
254
|
this._hide(false);
|
|
@@ -228,24 +268,51 @@ let IgcComboComponent = class IgcComboComponent extends EventEmitterMixin(LitEle
|
|
|
228
268
|
}
|
|
229
269
|
}
|
|
230
270
|
itemClickHandler(event) {
|
|
271
|
+
const input = this.singleSelect ? this.target : this.input;
|
|
231
272
|
const target = event
|
|
232
273
|
.composedPath()
|
|
233
274
|
.find((el) => el instanceof IgcComboItemComponent);
|
|
234
275
|
this.toggleSelect(target.index);
|
|
235
|
-
|
|
276
|
+
input.focus();
|
|
277
|
+
if (this.singleSelect) {
|
|
278
|
+
this._hide();
|
|
279
|
+
}
|
|
236
280
|
}
|
|
237
281
|
toggleSelect(index) {
|
|
238
282
|
this.selectionController.changeSelection(index);
|
|
239
283
|
this.navigationController.active = index;
|
|
284
|
+
this.updateValue();
|
|
240
285
|
this.list.requestUpdate();
|
|
241
286
|
}
|
|
242
287
|
navigateTo(item) {
|
|
243
288
|
this.navigationController.navigateTo(item, this.list);
|
|
244
289
|
}
|
|
290
|
+
clearSingleSelection() {
|
|
291
|
+
const { selected } = this.selectionController;
|
|
292
|
+
const selection = selected.values().next().value;
|
|
293
|
+
if (selection) {
|
|
294
|
+
const item = this.valueKey ? selection[this.valueKey] : selection;
|
|
295
|
+
this.selectionController.deselect([item], selected.size > 0);
|
|
296
|
+
}
|
|
297
|
+
}
|
|
245
298
|
handleClearIconClick(e) {
|
|
246
299
|
e.stopPropagation();
|
|
247
|
-
this.
|
|
300
|
+
if (this.singleSelect) {
|
|
301
|
+
this.resetSearchTerm();
|
|
302
|
+
this.clearSingleSelection();
|
|
303
|
+
}
|
|
304
|
+
else {
|
|
305
|
+
this.selectionController.deselect([], true);
|
|
306
|
+
}
|
|
307
|
+
this.updateValue();
|
|
248
308
|
this.navigationController.active = -1;
|
|
309
|
+
this.list.requestUpdate();
|
|
310
|
+
}
|
|
311
|
+
handleMainInputKeydown(e) {
|
|
312
|
+
this.navigationController.navigateMainInput(e, this.list);
|
|
313
|
+
}
|
|
314
|
+
handleSearchInputKeydown(e) {
|
|
315
|
+
this.navigationController.navigateSearchInput(e, this.list);
|
|
249
316
|
}
|
|
250
317
|
toggleCaseSensitivity() {
|
|
251
318
|
this.filteringOptions.caseSensitive = !this.filteringOptions.caseSensitive;
|
|
@@ -290,7 +357,7 @@ let IgcComboComponent = class IgcComboComponent extends EventEmitterMixin(LitEle
|
|
|
290
357
|
</slot>
|
|
291
358
|
</span>`;
|
|
292
359
|
}
|
|
293
|
-
|
|
360
|
+
renderMainInput() {
|
|
294
361
|
return html `<igc-input
|
|
295
362
|
id="target"
|
|
296
363
|
role="combobox"
|
|
@@ -302,19 +369,25 @@ let IgcComboComponent = class IgcComboComponent extends EventEmitterMixin(LitEle
|
|
|
302
369
|
e.preventDefault();
|
|
303
370
|
this._toggle(true);
|
|
304
371
|
}}
|
|
305
|
-
value=${ifDefined(this.value)}
|
|
306
372
|
placeholder=${ifDefined(this.placeholder)}
|
|
307
373
|
label=${ifDefined(this.label)}
|
|
308
374
|
dir=${this.dir}
|
|
309
|
-
@
|
|
375
|
+
@igcChange=${(e) => e.stopPropagation()}
|
|
376
|
+
@igcFocus=${(e) => {
|
|
377
|
+
e.stopPropagation();
|
|
378
|
+
requestAnimationFrame(() => {
|
|
379
|
+
this.target.select();
|
|
380
|
+
});
|
|
381
|
+
}}
|
|
310
382
|
@igcBlur=${(e) => e.stopPropagation()}
|
|
311
|
-
@
|
|
312
|
-
|
|
383
|
+
@igcInput=${this.handleMainInput}
|
|
384
|
+
@keydown=${this.handleMainInputKeydown}
|
|
385
|
+
.disabled=${this.disabled}
|
|
313
386
|
.required=${this.required}
|
|
314
387
|
.invalid=${this.invalid}
|
|
315
388
|
.outlined=${this.outlined}
|
|
316
389
|
.autofocus=${this.autofocus}
|
|
317
|
-
readonly
|
|
390
|
+
?readonly=${!this.singleSelect}
|
|
318
391
|
>
|
|
319
392
|
<span slot=${this.hasPrefixes && 'prefix'}>
|
|
320
393
|
<slot name="prefix"></slot>
|
|
@@ -328,7 +401,10 @@ let IgcComboComponent = class IgcComboComponent extends EventEmitterMixin(LitEle
|
|
|
328
401
|
}
|
|
329
402
|
renderSearchInput() {
|
|
330
403
|
var _a;
|
|
331
|
-
return html `<div
|
|
404
|
+
return html `<div
|
|
405
|
+
part="filter-input"
|
|
406
|
+
?hidden=${this.disableFiltering || this.singleSelect}
|
|
407
|
+
>
|
|
332
408
|
<igc-input
|
|
333
409
|
part="search-input"
|
|
334
410
|
placeholder=${this.placeholderSearch}
|
|
@@ -336,7 +412,7 @@ let IgcComboComponent = class IgcComboComponent extends EventEmitterMixin(LitEle
|
|
|
336
412
|
@igcFocus=${(e) => e.stopPropagation()}
|
|
337
413
|
@igcBlur=${(e) => e.stopPropagation()}
|
|
338
414
|
@igcInput=${this.handleSearchInput}
|
|
339
|
-
@keydown=${
|
|
415
|
+
@keydown=${this.handleSearchInputKeydown}
|
|
340
416
|
dir=${this.dir}
|
|
341
417
|
>
|
|
342
418
|
<igc-icon
|
|
@@ -393,7 +469,7 @@ let IgcComboComponent = class IgcComboComponent extends EventEmitterMixin(LitEle
|
|
|
393
469
|
}
|
|
394
470
|
render() {
|
|
395
471
|
return html `
|
|
396
|
-
${this.
|
|
472
|
+
${this.renderMainInput()}${this.renderList()}${this.renderHelperText()}
|
|
397
473
|
`;
|
|
398
474
|
}
|
|
399
475
|
};
|
|
@@ -435,6 +511,9 @@ __decorate([
|
|
|
435
511
|
__decorate([
|
|
436
512
|
property({ reflect: true, type: Boolean })
|
|
437
513
|
], IgcComboComponent.prototype, "outlined", void 0);
|
|
514
|
+
__decorate([
|
|
515
|
+
property({ attribute: 'single-select', reflect: true, type: Boolean })
|
|
516
|
+
], IgcComboComponent.prototype, "singleSelect", void 0);
|
|
438
517
|
__decorate([
|
|
439
518
|
property({ type: Boolean })
|
|
440
519
|
], IgcComboComponent.prototype, "autofocus", void 0);
|
|
@@ -510,6 +589,9 @@ __decorate([
|
|
|
510
589
|
__decorate([
|
|
511
590
|
watch('open')
|
|
512
591
|
], IgcComboComponent.prototype, "toggleDirectiveChange", null);
|
|
592
|
+
__decorate([
|
|
593
|
+
watch('singleSelect', { waitUntilFirstUpdate: true })
|
|
594
|
+
], IgcComboComponent.prototype, "resetState", null);
|
|
513
595
|
__decorate([
|
|
514
596
|
watch('value')
|
|
515
597
|
], IgcComboComponent.prototype, "validate", null);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"combo.js","sourceRoot":"","sources":["../../../src/components/combo/combo.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,IAAI,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IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,mBAAmB,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;2DAC5C;AAOhC;IADC,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;uDAW7B;AAOF;IADC,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;8DAG7B;AAGF;IADC,KAAK,EAAE;oDACwC;AAGhD;IADC,KAAK,CAAC,MAAM,CAAC;oDAOb;AAGD;IADC,KAAK,CAAC,UAAU,CAAC;yDAGjB;AAGD;IADC,KAAK,CAAC,YAAY,CAAC;wDAInB;AAKe;IAHf,KAAK,CAAC,UAAU,CAAC;IACjB,KAAK,CAAC,cAAc,CAAC;IACrB,KAAK,CAAC,UAAU,CAAC;iDAIjB;AAGD;IADC,KAAK,CAAC,MAAM,CAAC;8DAKb;AAuDD;IADC,KAAK,CAAC,OAAO,CAAC;iDAGd;AAjTkB,iBAAiB;IAJrC,MAAM,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;IAC/C,4BAA4B,CAC3B,4GAA4G,CAC7G;GACoB,iBAAiB,CAgoBrC;eAhoBoB,iBAAiB","sourcesContent":["import { html, LitElement, TemplateResult } from 'lit';\nimport { themes } from '../../theming/theming-decorator.js';\nimport { styles } from './themes/light/combo.base.css.js';\nimport { styles as bootstrap } from './themes/light/combo.bootstrap.css.js';\nimport { styles as material } from './themes/light/combo.material.css.js';\nimport { styles as fluent } from './themes/light/combo.fluent.css.js';\nimport { styles as indigo } from './themes/light/combo.indigo.css.js';\nimport {\n property,\n query,\n queryAssignedElements,\n state,\n} from 'lit/decorators.js';\nimport { watch } from '../common/decorators/watch.js';\nimport { defineComponents } from '../common/definitions/defineComponents.js';\nimport IgcComboListComponent from './combo-list.js';\nimport IgcComboItemComponent from './combo-item.js';\nimport IgcComboHeaderComponent from './combo-header.js';\nimport IgcInputComponent from '../input/input.js';\nimport IgcIconComponent from '../icon/icon.js';\nimport { NavigationController } from './controllers/navigation.js';\nimport { SelectionController } from './controllers/selection.js';\nimport { IgcToggleController } from '../toggle/toggle.controller.js';\nimport { DataController } from './controllers/data.js';\nimport { IgcToggleComponent } from '../toggle/types.js';\nimport {\n Keys,\n Values,\n ComboRecord,\n GroupingDirection,\n FilteringOptions,\n IgcComboEventMap,\n ComboItemTemplate,\n} from './types.js';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { partNameMap } from '../common/util.js';\nimport { filteringOptionsConverter } from './utils/converters.js';\nimport { EventEmitterMixin } from '../common/mixins/event-emitter.js';\nimport { Constructor } from '../common/mixins/constructor.js';\nimport type { ThemeController, Theme } from '../../theming/types.js';\nimport { blazorAdditionalDependencies } from '../common/decorators/blazorAdditionalDependencies.js';\n\ndefineComponents(\n IgcIconComponent,\n IgcComboListComponent,\n IgcComboItemComponent,\n IgcComboHeaderComponent,\n IgcInputComponent\n);\n\n/**\n * @element igc-combo\n *\n * @slot prefix - Renders content before the input.\n * @slot suffix - Renders content after input.\n * @slot header - Renders a container before the list of options.\n * @slot footer - Renders a container after the list of options.\n * @slot helper-text - Renders content below the input.\n * @slot toggle-icon - Renders content inside the suffix container.\n * @slot clear-icon - Renders content inside the suffix container.\n *\n * @fires igcFocus - Emitted when the select gains focus.\n * @fires igcBlur - Emitted when the select loses focus.\n * @fires igcChange - Emitted when the control's selection has changed.\n * @fires igcOpening - Emitted just before the list of options is opened.\n * @fires igcOpened - Emitted after the list of options is opened.\n * @fires igcClosing - Emitter just before the list of options is closed.\n * @fires igcClosed - Emitted after the list of options is closed.\n *\n * @csspart label - The encapsulated text label.\n * @csspart input - The main input field.\n * @csspart native-input - The native input of the main input field.\n * @csspart prefix - The prefix wrapper.\n * @csspart suffix - The suffix wrapper.\n * @csspart toggle-icon - The toggle icon wrapper.\n * @csspart clear-icon - The clear icon wrapper.\n * @csspart case-icon - The case icon wrapper.\n * @csspart helper-text - The helper text wrapper.\n * @csspart search-input - The search input field.\n * @csspart list-wrapper - The list of options wrapper.\n * @csspart list - The list of options box.\n * @csspart item - Represents each item in the list of options.\n * @csspart group-header - Represents each header in the list of options.\n * @csspart active - Appended to the item parts list when the item is active.\n * @csspart selected - Appended to the item parts list when the item is selected.\n * @csspart checkbox - Represents each checkbox of each list item.\n * @csspart checkbox-indicator - Represents the checkbox indicator of each list item.\n * @csspart checked - Appended to checkbox parts list when checkbox is checked.\n * @csspart header - The container holding the header content.\n * @csspart footer - The container holding the footer content.\n * @csspart empty - The container holding the empty content.\n */\n@themes({ material, bootstrap, fluent, indigo })\n@blazorAdditionalDependencies(\n 'IgcIconComponent, IgcComboListComponent, IgcComboItemComponent, IgcComboHeaderComponent, IgcInputComponent'\n)\nexport default class IgcComboComponent<T extends object>\n extends EventEmitterMixin<IgcComboEventMap, Constructor<LitElement>>(\n LitElement\n )\n implements Partial<IgcToggleComponent>\n{\n public static readonly tagName = 'igc-combo';\n public static styles = styles;\n\n protected navigationController = new NavigationController<T>(this);\n protected selectionController = new SelectionController<T>(this);\n protected dataController = new DataController<T>(this);\n protected toggleController!: IgcToggleController;\n protected themeController!: ThemeController;\n protected theme!: Theme;\n\n @queryAssignedElements({ slot: 'helper-text' })\n protected helperText!: Array<HTMLElement>;\n\n @queryAssignedElements({ slot: 'suffix' })\n protected inputSuffix!: Array<HTMLElement>;\n\n @queryAssignedElements({ slot: 'prefix' })\n protected inputPrefix!: Array<HTMLElement>;\n\n @query('[part=\"search-input\"]')\n protected input!: IgcInputComponent;\n\n @query('igc-input#target')\n private target!: IgcInputComponent;\n\n @query('igc-combo-list')\n private list!: IgcComboListComponent;\n\n /** The data source used to generate the list of options. */\n @property({ attribute: false })\n public data: Array<T> = [];\n\n /**\n * The name attribute of the control.\n * @attr name\n */\n @property()\n public name!: string;\n\n /**\n * The disabled attribute of the control.\n * @attr disabled\n */\n @property({ reflect: true, type: Boolean })\n public disabled = false;\n\n /**\n * The required attribute of the control.\n * @attr required\n */\n @property({ reflect: true, type: Boolean })\n public required = false;\n\n /**\n * The invalid attribute of the control.\n * @attr invalid\n */\n @property({ reflect: true, type: Boolean })\n public invalid = false;\n\n /**\n * The outlined attribute of the control.\n * @attr outlined\n */\n @property({ reflect: true, type: Boolean })\n public outlined = false;\n\n /**\n * The autofocus attribute of the control.\n * @attr autofocus\n */\n @property({ type: Boolean })\n public override autofocus!: boolean;\n\n /**\n * Focuses the list of options when the menu opens.\n * @attr autofocus-list\n */\n @property({ attribute: 'autofocus-list', type: Boolean })\n public autofocusList = false;\n\n /**\n * The label attribute of the control.\n * @attr label\n */\n @property({ type: String })\n public label!: string;\n\n /**\n * The placeholder attribute of the control.\n * @attr placeholder\n */\n @property({ type: String })\n public placeholder!: string;\n\n /**\n * The placeholder attribute of the search input.\n * @attr placeholder-search\n */\n @property({ attribute: 'placeholder-search', type: String })\n public placeholderSearch = 'Search';\n\n /**\n * The direction attribute of the control.\n * @attr dir\n */\n @property({ reflect: true })\n public override dir: 'ltr' | 'rtl' | 'auto' = 'auto';\n\n /**\n * Sets the open state of the component.\n * @attr open\n */\n @property({ type: Boolean })\n public open = false;\n\n /** @hidden @internal */\n @property({ type: Boolean })\n public flip = true;\n\n /**\n * The key in the data source used when selecting items.\n * @attr value-key\n */\n @property({ attribute: 'value-key', reflect: false })\n public valueKey?: Keys<T>;\n\n /**\n * The key in the data source used to display items in the list.\n * @attr display-key\n */\n @property({ attribute: 'display-key', reflect: false })\n public displayKey?: Keys<T> = this.valueKey;\n\n /**\n * The key in the data source used to group items in the list.\n * @attr group-key\n */\n @property({ attribute: 'group-key', reflect: false })\n public groupKey?: Keys<T> = this.displayKey;\n\n /**\n * Sorts the items in each group by ascending or descending order.\n * @attr group-sorting\n * @type {\"asc\" | \"desc\"}\n */\n @property({ attribute: 'group-sorting', reflect: false })\n public groupSorting: GroupingDirection = 'asc';\n\n /**\n * An object that configures the filtering of the combo.\n * @attr filtering-options\n * @type {FilteringOptions<T>}\n * @param filterKey - The key in the data source used when filtering the list of options.\n * @param caseSensitive - Determines whether the filtering operation should be case sensitive.\n */\n @property({\n attribute: 'filtering-options',\n reflect: false,\n converter: filteringOptionsConverter,\n })\n public filteringOptions: FilteringOptions<T> = {\n filterKey: this.displayKey,\n caseSensitive: false,\n };\n\n /**\n * Enables the case sensitive search icon in the filtering input.\n * @attr case-sensitive-icon\n */\n @property({ type: Boolean, attribute: 'case-sensitive-icon', reflect: false })\n public caseSensitiveIcon = false;\n\n /**\n * Disables the filtering of the list of options.\n * @attr disable-filtering\n */\n @property({ type: Boolean, attribute: 'disable-filtering', reflect: false })\n public disableFiltering = false;\n\n /**\n * The template used for the content of each combo item.\n * @type {ComboItemTemplate<T>}\n */\n @property({ attribute: false })\n public itemTemplate: ComboItemTemplate<T> = ({ item }) => {\n if (typeof item !== 'object' || item === null) {\n return String(item) as any;\n }\n\n if (this.displayKey) {\n return html`${item[this.displayKey]}`;\n }\n\n return html`${String(item)}`;\n };\n\n /**\n * The template used for the content of each combo group header.\n * @type {ComboItemTemplate<T>}\n */\n @property({ attribute: false })\n public groupHeaderTemplate: ComboItemTemplate<T> = ({ item }) => {\n return html`${this.groupKey && item[this.groupKey]}`;\n };\n\n @state()\n protected dataState: Array<ComboRecord<T>> = [];\n\n @watch('data')\n protected dataChanged() {\n this.dataState = structuredClone(this.data) as ComboRecord<T>[];\n\n if (this.hasUpdated) {\n this.pipeline();\n }\n }\n\n @watch('valueKey')\n protected updateDisplayKey() {\n this.displayKey = this.displayKey ?? this.valueKey;\n }\n\n @watch('displayKey')\n protected updateFilterKey() {\n this.filteringOptions.filterKey =\n this.filteringOptions.filterKey ?? this.displayKey;\n }\n\n @watch('groupKey')\n @watch('groupSorting')\n @watch('pipeline')\n protected async pipeline() {\n this.dataState = await this.dataController.apply([...this.data]);\n this.navigationController.active = -1;\n }\n\n @watch('open')\n protected toggleDirectiveChange() {\n if (!this.target) return;\n this.toggleController.target = this.target;\n this.target.setAttribute('aria-expanded', this.open ? 'true' : 'false');\n }\n\n constructor() {\n super();\n\n this.toggleController = new IgcToggleController(this, {\n target: this.target,\n closeCallback: async () => {\n if (!this.handleClosing()) return;\n this.open = false;\n\n await this.updateComplete;\n this.emitEvent('igcClosed');\n },\n });\n\n this.addEventListener('focus', () => {\n this.emitEvent('igcFocus');\n });\n\n this.addEventListener('blur', () => {\n this.emitEvent('igcBlur');\n });\n\n this.addEventListener(\n 'keydown',\n this.navigationController.navigateHost.bind(this.navigationController)\n );\n }\n\n protected themeAdopted(controller: ThemeController) {\n this.themeController = controller;\n }\n\n protected override willUpdate() {\n this.theme = this.themeController.theme;\n }\n\n protected override async getUpdateComplete() {\n const result = await super.getUpdateComplete();\n await this.toggleController.rendered;\n return result;\n }\n\n /**\n * Returns the current selection as a list of commma separated values,\n * represented by the display key, when provided.\n */\n public get value() {\n return this.selectionController.getValue(\n Array.from(this.selectionController.selected)\n );\n }\n\n @watch('value')\n protected validate() {\n this.updateComplete.then(() => this.reportValidity());\n }\n\n /** Checks the validity of the control. */\n public reportValidity() {\n this.invalid = this.required && !this.value;\n return !this.invalid;\n }\n\n /** A wrapper around the reportValidity method to comply with the native input API. */\n public checkValidity() {\n return this.reportValidity();\n }\n\n /** Sets focus on the component. */\n public override focus(options?: FocusOptions) {\n this.target.focus(options);\n }\n\n /** Removes focus from the component. */\n public override blur() {\n this.target.blur();\n }\n\n /**\n * Selects the options in the list by either value or key value.\n * If not argument is provided all items will be selected.\n * @param { T[] | Values<T>[] } items - A list of values or values as set by the valueKey.\n */\n public select(items?: T[] | Values<T>[]) {\n this.selectionController.select(items, false);\n this.list.requestUpdate();\n }\n\n /**\n * Deselects the options in the list by either value or key value.\n * If not argument is provided all items will be deselected.\n * @param { T[] | Values<T>[] } items - A list of values or values as set by the valueKey.\n */\n public deselect(items?: T[] | Values<T>[]) {\n this.selectionController.deselect(items, false);\n this.list.requestUpdate();\n }\n\n protected handleSearchInput(e: CustomEvent) {\n this.dataController.searchTerm = e.detail;\n }\n\n protected handleOpening() {\n const args = { cancelable: true };\n return this.emitEvent('igcOpening', args);\n }\n\n protected handleClosing(): boolean {\n const args = { cancelable: true };\n return this.emitEvent('igcClosing', args);\n }\n\n protected async _show(emit = true) {\n if (this.open) return;\n if (emit && !this.handleOpening()) return;\n this.open = true;\n\n await this.updateComplete;\n emit && this.emitEvent('igcOpened');\n\n this.list.focus();\n\n if (!this.autofocusList) {\n this.input.focus();\n }\n }\n\n /** Shows the list of options. */\n public show() {\n this._show(false);\n }\n\n protected async _hide(emit = true) {\n if (!this.open) return;\n if (emit && !this.handleClosing()) return;\n this.open = false;\n\n await this.updateComplete;\n emit && this.emitEvent('igcClosed');\n this.target.focus();\n }\n\n /** Hides the list of options. */\n public hide() {\n this._hide(false);\n }\n\n /** @hidden @internal */\n public _toggle(emit = true) {\n this.open ? this._hide(emit) : this._show(emit);\n }\n\n /** Toggles the list of options. */\n public toggle() {\n this._toggle(false);\n }\n\n protected itemRenderer = (item: T, index: number): TemplateResult => {\n const record = item as ComboRecord<T>;\n const active = this.navigationController.active === index;\n const selected = this.selectionController.selected.has(item);\n const headerTemplate = html`<igc-combo-header part=\"group-header\"\n >${this.groupHeaderTemplate({ item: record })}</igc-combo-header\n >`;\n\n const itemParts = partNameMap({\n item: true,\n selected,\n active,\n });\n\n const itemTemplate = html`<igc-combo-item\n part=\"${itemParts}\"\n exportparts=\"checkbox, checkbox-indicator, checked\"\n @click=${this.itemClickHandler.bind(this)}\n .index=${index}\n .active=${active}\n .selected=${selected}\n >${this.itemTemplate({ item: record })}</igc-combo-item\n >`;\n\n return html`${this.groupKey && record.header\n ? headerTemplate\n : itemTemplate}`;\n };\n\n protected listKeydownHandler(event: KeyboardEvent) {\n const target = event\n .composedPath()\n .find(\n (el) => el instanceof IgcComboListComponent\n ) as IgcComboListComponent;\n\n if (target) {\n this.navigationController.navigateList(event, target);\n }\n }\n\n protected itemClickHandler(event: MouseEvent) {\n const target = event\n .composedPath()\n .find(\n (el) => el instanceof IgcComboItemComponent\n ) as IgcComboItemComponent;\n\n this.toggleSelect(target.index);\n this.input.focus();\n }\n\n protected toggleSelect(index: number) {\n this.selectionController.changeSelection(index);\n this.navigationController.active = index;\n this.list.requestUpdate();\n }\n\n protected navigateTo(item: T) {\n this.navigationController.navigateTo(item, this.list);\n }\n\n protected handleClearIconClick(e: MouseEvent) {\n e.stopPropagation();\n this.selectionController.deselect([], true);\n this.navigationController.active = -1;\n }\n\n protected toggleCaseSensitivity() {\n this.filteringOptions.caseSensitive = !this.filteringOptions.caseSensitive;\n this.requestUpdate('pipeline');\n }\n\n protected get hasPrefixes() {\n return this.inputPrefix.length > 0;\n }\n\n protected get hasSuffixes() {\n return this.inputSuffix.length > 0;\n }\n\n private renderToggleIcon() {\n const openIcon =\n this.theme === 'material' ? 'keyboard_arrow_up' : 'arrow_drop_up';\n const closeIcon =\n this.theme === 'material' ? 'keyboard_arrow_down' : 'arrow_drop_down';\n\n return html`\n <span slot=\"suffix\" part=\"toggle-icon\">\n <slot name=\"toggle-icon\">\n <igc-icon\n name=${this.open ? openIcon : closeIcon}\n collection=\"internal\"\n aria-hidden=\"true\"\n ></igc-icon>\n </slot>\n </span>\n `;\n }\n\n private renderClearIcon() {\n const { selected } = this.selectionController;\n const icon = this.theme === 'material' ? 'chip_cancel' : 'clear';\n\n return html`<span\n slot=\"suffix\"\n part=\"clear-icon\"\n @click=${this.handleClearIconClick}\n ?hidden=${selected.size === 0}\n >\n <slot name=\"clear-icon\">\n <igc-icon\n name=\"${icon}\"\n collection=\"internal\"\n aria-hidden=\"true\"\n ></igc-icon>\n </slot>\n </span>`;\n }\n\n private renderInput() {\n return html`<igc-input\n id=\"target\"\n role=\"combobox\"\n aria-owns=\"dropdown\"\n aria-describedby=\"helper-text\"\n aria-disabled=${this.disabled}\n exportparts=\"container: input, input: native-input, label, prefix, suffix\"\n @click=${(e: MouseEvent) => {\n e.preventDefault();\n this._toggle(true);\n }}\n value=${ifDefined(this.value)}\n placeholder=${ifDefined(this.placeholder)}\n label=${ifDefined(this.label)}\n dir=${this.dir}\n @igcFocus=${(e: Event) => e.stopPropagation()}\n @igcBlur=${(e: Event) => e.stopPropagation()}\n @keydown=${this.navigationController.navigateHost.bind(\n this.navigationController\n )}\n .disabled=\"${this.disabled}\"\n .required=${this.required}\n .invalid=${this.invalid}\n .outlined=${this.outlined}\n .autofocus=${this.autofocus}\n readonly\n >\n <span slot=${this.hasPrefixes && 'prefix'}>\n <slot name=\"prefix\"></slot>\n </span>\n ${this.renderClearIcon()}\n <span slot=${this.hasSuffixes && 'suffix'}>\n <slot name=\"suffix\"></slot>\n </span>\n ${this.renderToggleIcon()}\n </igc-input>`;\n }\n\n private renderSearchInput() {\n return html`<div part=\"filter-input\" ?hidden=${this.disableFiltering}>\n <igc-input\n part=\"search-input\"\n placeholder=${this.placeholderSearch}\n exportparts=\"input: search-input\"\n @igcFocus=${(e: Event) => e.stopPropagation()}\n @igcBlur=${(e: Event) => e.stopPropagation()}\n @igcInput=${this.handleSearchInput}\n @keydown=${(e: KeyboardEvent) =>\n this.navigationController.navigateInput(e, this.list)}\n dir=${this.dir}\n >\n <igc-icon\n slot=${this.caseSensitiveIcon && 'suffix'}\n name=\"case_sensitive\"\n collection=\"internal\"\n part=${partNameMap({\n 'case-icon': true,\n active: this.filteringOptions.caseSensitive ?? false,\n })}\n @click=${this.toggleCaseSensitivity}\n ></igc-icon>\n </igc-input>\n </div>`;\n }\n\n private renderEmptyTemplate() {\n return html`<div part=\"empty\" ?hidden=${this.dataState.length > 0}>\n <slot name=\"empty\">The list is empty</slot>\n </div>`;\n }\n\n private renderList() {\n return html`<div\n @keydown=${this.listKeydownHandler}\n part=\"list-wrapper\"\n ${this.toggleController.toggleDirective}\n >\n ${this.renderSearchInput()}\n <div part=\"header\">\n <slot name=\"header\"></slot>\n </div>\n <igc-combo-list\n id=\"dropdown\"\n part=\"list\"\n aria-label=\"${this.label}\"\n .items=${this.dataState}\n .renderItem=${this.itemRenderer}\n ?hidden=${this.dataState.length === 0}\n >\n </igc-combo-list>\n ${this.renderEmptyTemplate()}\n <div part=\"footer\">\n <slot name=\"footer\"></slot>\n </div>\n </div>`;\n }\n\n private renderHelperText() {\n return html`<div\n id=\"helper-text\"\n part=\"helper-text\"\n ?hidden=\"${this.helperText.length === 0}\"\n >\n <slot name=\"helper-text\"></slot>\n </div>`;\n }\n\n protected override render() {\n return html`\n ${this.renderInput()}${this.renderList()}${this.renderHelperText()}\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'igc-combo': IgcComboComponent<object>;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"combo.js","sourceRoot":"","sources":["../../../src/components/combo/combo.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,IAAI,EAAE,UAAU,EAAkB,MAAM,KAAK,CAAC;AACvD,OAAO,EAAE,MAAM,EAAE,MAAM,oCAAoC,CAAC;AAC5D,OAAO,EAAE,MAAM,EAAE,MAAM,kCAAkC,CAAC;AAC1D,OAAO,EAAE,MAAM,IAAI,SAAS,EAAE,MAAM,uCAAuC,CAAC;AAC5E,OAAO,EAAE,MAAM,IAAI,QAAQ,EAAE,MAAM,sCAAsC,CAAC;AAC1E,OAAO,EAAE,MAAM,IAAI,MAAM,EAAE,MAAM,oCAAoC,CAAC;AACtE,OAAO,EAAE,MAAM,IAAI,MAAM,EAAE,MAAM,oCAAoC,CAAC;AACtE,OAAO,EACL,QAAQ,EACR,KAAK,EACL,qBAAqB,EACrB,KAAK,GACN,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,KAAK,EAAE,MAAM,+BAA+B,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,2CAA2C,CAAC;AAC7E,OAAO,qBAAqB,MAAM,iBAAiB,CAAC;AACpD,OAAO,qBAAqB,MAAM,iBAAiB,CAAC;AACpD,OAAO,uBAAuB,MAAM,mBAAmB,CAAC;AACxD,OAAO,iBAAiB,MAAM,mBAAmB,CAAC;AAClD,OAAO,gBAAgB,MAAM,iBAAiB,CAAC;AA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W7B;AAOF;IADC,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;8DAG7B;AAGF;IADC,KAAK,EAAE;oDACwC;AAGhD;IADC,KAAK,CAAC,MAAM,CAAC;oDAOb;AAGD;IADC,KAAK,CAAC,UAAU,CAAC;yDAGjB;AAGD;IADC,KAAK,CAAC,YAAY,CAAC;wDAInB;AAKe;IAHf,KAAK,CAAC,UAAU,CAAC;IACjB,KAAK,CAAC,cAAc,CAAC;IACrB,KAAK,CAAC,UAAU,CAAC;iDAGjB;AAGD;IADC,KAAK,CAAC,MAAM,CAAC;8DAKb;AAwDe;IADf,KAAK,CAAC,cAAc,EAAE,EAAE,oBAAoB,EAAE,IAAI,EAAE,CAAC;mDAQrD;AAoBD;IADC,KAAK,CAAC,OAAO,CAAC;iDAGd;AApVkB,iBAAiB;IALrC,MAAM,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;IAC/C,4BAA4B,CAC3B,4GAA4G,CAC7G;GAEoB,iBAAiB,CA0wBrC;eA1wBoB,iBAAiB","sourcesContent":["import { html, LitElement, TemplateResult } from 'lit';\nimport { themes } from '../../theming/theming-decorator.js';\nimport { styles } from './themes/light/combo.base.css.js';\nimport { styles as bootstrap } from './themes/light/combo.bootstrap.css.js';\nimport { styles as material } from './themes/light/combo.material.css.js';\nimport { styles as fluent } from './themes/light/combo.fluent.css.js';\nimport { styles as indigo } from './themes/light/combo.indigo.css.js';\nimport {\n property,\n query,\n queryAssignedElements,\n state,\n} from 'lit/decorators.js';\nimport { watch } from '../common/decorators/watch.js';\nimport { defineComponents } from '../common/definitions/defineComponents.js';\nimport IgcComboListComponent from './combo-list.js';\nimport IgcComboItemComponent from './combo-item.js';\nimport IgcComboHeaderComponent from './combo-header.js';\nimport IgcInputComponent from '../input/input.js';\nimport IgcIconComponent from '../icon/icon.js';\nimport { NavigationController } from './controllers/navigation.js';\nimport { SelectionController } from './controllers/selection.js';\nimport { IgcToggleController } from '../toggle/toggle.controller.js';\nimport { DataController } from './controllers/data.js';\nimport { IgcToggleComponent } from '../toggle/types.js';\nimport {\n Keys,\n ComboRecord,\n GroupingDirection,\n FilteringOptions,\n IgcComboEventMap,\n ComboItemTemplate,\n Item,\n} from './types.js';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { partNameMap } from '../common/util.js';\nimport { filteringOptionsConverter } from './utils/converters.js';\nimport { EventEmitterMixin } from '../common/mixins/event-emitter.js';\nimport { Constructor } from '../common/mixins/constructor.js';\nimport type { ThemeController, Theme } from '../../theming/types.js';\nimport { blazorAdditionalDependencies } from '../common/decorators/blazorAdditionalDependencies.js';\n\ndefineComponents(\n IgcIconComponent,\n IgcComboListComponent,\n IgcComboItemComponent,\n IgcComboHeaderComponent,\n IgcInputComponent\n);\n\n/**\n * @element igc-combo\n *\n * @slot prefix - Renders content before the input.\n * @slot suffix - Renders content after input.\n * @slot header - Renders a container before the list of options.\n * @slot footer - Renders a container after the list of options.\n * @slot helper-text - Renders content below the input.\n * @slot toggle-icon - Renders content inside the suffix container.\n * @slot clear-icon - Renders content inside the suffix container.\n *\n * @fires igcFocus - Emitted when the select gains focus.\n * @fires igcBlur - Emitted when the select loses focus.\n * @fires igcChange - Emitted when the control's selection has changed.\n * @fires igcOpening - Emitted just before the list of options is opened.\n * @fires igcOpened - Emitted after the list of options is opened.\n * @fires igcClosing - Emitter just before the list of options is closed.\n * @fires igcClosed - Emitted after the list of options is closed.\n *\n * @csspart label - The encapsulated text label.\n * @csspart input - The main input field.\n * @csspart native-input - The native input of the main input field.\n * @csspart prefix - The prefix wrapper.\n * @csspart suffix - The suffix wrapper.\n * @csspart toggle-icon - The toggle icon wrapper.\n * @csspart clear-icon - The clear icon wrapper.\n * @csspart case-icon - The case icon wrapper.\n * @csspart helper-text - The helper text wrapper.\n * @csspart search-input - The search input field.\n * @csspart list-wrapper - The list of options wrapper.\n * @csspart list - The list of options box.\n * @csspart item - Represents each item in the list of options.\n * @csspart group-header - Represents each header in the list of options.\n * @csspart active - Appended to the item parts list when the item is active.\n * @csspart selected - Appended to the item parts list when the item is selected.\n * @csspart checkbox - Represents each checkbox of each list item.\n * @csspart checkbox-indicator - Represents the checkbox indicator of each list item.\n * @csspart checked - Appended to checkbox parts list when checkbox is checked.\n * @csspart header - The container holding the header content.\n * @csspart footer - The container holding the footer content.\n * @csspart empty - The container holding the empty content.\n */\n@themes({ material, bootstrap, fluent, indigo })\n@blazorAdditionalDependencies(\n 'IgcIconComponent, IgcComboListComponent, IgcComboItemComponent, IgcComboHeaderComponent, IgcInputComponent'\n)\n// TODO: pressing arrow down should scroll to the selected item\nexport default class IgcComboComponent<T extends object>\n extends EventEmitterMixin<IgcComboEventMap, Constructor<LitElement>>(\n LitElement\n )\n implements Partial<IgcToggleComponent>\n{\n public static readonly tagName = 'igc-combo';\n public static styles = styles;\n private _value = '';\n\n protected navigationController = new NavigationController<T>(this);\n protected selectionController = new SelectionController<T>(this);\n protected dataController = new DataController<T>(this);\n protected toggleController!: IgcToggleController;\n protected themeController!: ThemeController;\n protected theme!: Theme;\n\n @queryAssignedElements({ slot: 'helper-text' })\n protected helperText!: Array<HTMLElement>;\n\n @queryAssignedElements({ slot: 'suffix' })\n protected inputSuffix!: Array<HTMLElement>;\n\n @queryAssignedElements({ slot: 'prefix' })\n protected inputPrefix!: Array<HTMLElement>;\n\n @query('[part=\"search-input\"]')\n protected input!: IgcInputComponent;\n\n @query('igc-input#target')\n private target!: IgcInputComponent;\n\n @query('igc-combo-list')\n private list!: IgcComboListComponent;\n\n /** The data source used to generate the list of options. */\n @property({ attribute: false })\n public data: Array<T> = [];\n\n /**\n * The name attribute of the control.\n * @attr name\n */\n @property()\n public name!: string;\n\n /**\n * The disabled attribute of the control.\n * @attr disabled\n */\n @property({ reflect: true, type: Boolean })\n public disabled = false;\n\n /**\n * The required attribute of the control.\n * @attr required\n */\n @property({ reflect: true, type: Boolean })\n public required = false;\n\n /**\n * The invalid attribute of the control.\n * @attr invalid\n */\n @property({ reflect: true, type: Boolean })\n public invalid = false;\n\n /**\n * The outlined attribute of the control.\n * @attr outlined\n */\n @property({ reflect: true, type: Boolean })\n public outlined = false;\n\n /**\n * Enables single selection mode and moves item filtering to the main input.\n * @attr single-select\n */\n @property({ attribute: 'single-select', reflect: true, type: Boolean })\n public singleSelect = false;\n\n /**\n * The autofocus attribute of the control.\n * @attr autofocus\n */\n @property({ type: Boolean })\n public override autofocus!: boolean;\n\n /**\n * Focuses the list of options when the menu opens.\n * @attr autofocus-list\n */\n @property({ attribute: 'autofocus-list', type: Boolean })\n public autofocusList = false;\n\n /**\n * The label attribute of the control.\n * @attr label\n */\n @property({ type: String })\n public label!: string;\n\n /**\n * The placeholder attribute of the control.\n * @attr placeholder\n */\n @property({ type: String })\n public placeholder!: string;\n\n /**\n * The placeholder attribute of the search input.\n * @attr placeholder-search\n */\n @property({ attribute: 'placeholder-search', type: String })\n public placeholderSearch = 'Search';\n\n /**\n * The direction attribute of the control.\n * @attr dir\n */\n @property({ reflect: true })\n public override dir: 'ltr' | 'rtl' | 'auto' = 'auto';\n\n /**\n * Sets the open state of the component.\n * @attr open\n */\n @property({ type: Boolean })\n public open = false;\n\n /** @hidden @internal */\n @property({ type: Boolean })\n public flip = true;\n\n /**\n * The key in the data source used when selecting items.\n * @attr value-key\n */\n @property({ attribute: 'value-key', reflect: false })\n public valueKey?: Keys<T>;\n\n /**\n * The key in the data source used to display items in the list.\n * @attr display-key\n */\n @property({ attribute: 'display-key', reflect: false })\n public displayKey?: Keys<T> = this.valueKey;\n\n /**\n * The key in the data source used to group items in the list.\n * @attr group-key\n */\n @property({ attribute: 'group-key', reflect: false })\n public groupKey?: Keys<T> = this.displayKey;\n\n /**\n * Sorts the items in each group by ascending or descending order.\n * @attr group-sorting\n * @type {\"asc\" | \"desc\"}\n */\n @property({ attribute: 'group-sorting', reflect: false })\n public groupSorting: GroupingDirection = 'asc';\n\n /**\n * An object that configures the filtering of the combo.\n * @attr filtering-options\n * @type {FilteringOptions<T>}\n * @param filterKey - The key in the data source used when filtering the list of options.\n * @param caseSensitive - Determines whether the filtering operation should be case sensitive.\n */\n @property({\n attribute: 'filtering-options',\n reflect: false,\n converter: filteringOptionsConverter,\n })\n public filteringOptions: FilteringOptions<T> = {\n filterKey: this.displayKey,\n caseSensitive: false,\n };\n\n /**\n * Enables the case sensitive search icon in the filtering input.\n * @attr case-sensitive-icon\n */\n @property({ type: Boolean, attribute: 'case-sensitive-icon', reflect: false })\n public caseSensitiveIcon = false;\n\n /**\n * Disables the filtering of the list of options.\n * @attr disable-filtering\n */\n @property({ type: Boolean, attribute: 'disable-filtering', reflect: false })\n public disableFiltering = false;\n\n /**\n * The template used for the content of each combo item.\n * @type {ComboItemTemplate<T>}\n */\n @property({ attribute: false })\n public itemTemplate: ComboItemTemplate<T> = ({ item }) => {\n if (typeof item !== 'object' || item === null) {\n return String(item) as any;\n }\n\n if (this.displayKey) {\n return html`${item[this.displayKey]}`;\n }\n\n return html`${String(item)}`;\n };\n\n /**\n * The template used for the content of each combo group header.\n * @type {ComboItemTemplate<T>}\n */\n @property({ attribute: false })\n public groupHeaderTemplate: ComboItemTemplate<T> = ({ item }) => {\n return html`${this.groupKey && item[this.groupKey]}`;\n };\n\n @state()\n protected dataState: Array<ComboRecord<T>> = [];\n\n @watch('data')\n protected dataChanged() {\n this.dataState = structuredClone(this.data) as ComboRecord<T>[];\n\n if (this.hasUpdated) {\n this.pipeline();\n }\n }\n\n @watch('valueKey')\n protected updateDisplayKey() {\n this.displayKey = this.displayKey ?? this.valueKey;\n }\n\n @watch('displayKey')\n protected updateFilterKey() {\n this.filteringOptions.filterKey =\n this.filteringOptions.filterKey ?? this.displayKey;\n }\n\n @watch('groupKey')\n @watch('groupSorting')\n @watch('pipeline')\n protected async pipeline() {\n this.dataState = await this.dataController.apply([...this.data]);\n }\n\n @watch('open')\n protected toggleDirectiveChange() {\n if (!this.target) return;\n this.toggleController.target = this.target;\n this.target.setAttribute('aria-expanded', this.open ? 'true' : 'false');\n }\n\n constructor() {\n super();\n\n this.toggleController = new IgcToggleController(this, {\n target: this.target,\n closeCallback: async () => {\n if (!this.handleClosing()) return;\n this.open = false;\n\n await this.updateComplete;\n this.emitEvent('igcClosed');\n },\n });\n\n this.addEventListener('focus', () => {\n this.emitEvent('igcFocus');\n });\n\n this.addEventListener('blur', () => {\n const { selected } = this.selectionController;\n\n if (selected.size === 0) {\n this.target.value = '';\n this.resetSearchTerm();\n }\n\n this.emitEvent('igcBlur');\n });\n\n this.addEventListener(\n 'keydown',\n this.navigationController.navigateHost.bind(this.navigationController)\n );\n }\n\n protected themeAdopted(controller: ThemeController) {\n this.themeController = controller;\n }\n\n protected override willUpdate() {\n this.theme = this.themeController.theme;\n }\n\n protected override async getUpdateComplete() {\n const result = await super.getUpdateComplete();\n await this.toggleController.rendered;\n return result;\n }\n\n protected resetSearchTerm() {\n this.dataController.searchTerm = '';\n }\n\n @watch('singleSelect', { waitUntilFirstUpdate: true })\n protected async resetState() {\n await this.updateComplete;\n\n this.selectionController.selected.clear();\n this.updateValue();\n this.resetSearchTerm();\n this.navigationController.active = -1;\n }\n\n /**\n * Returns the current selection as a list of commma separated values,\n * represented by the display key, when provided.\n */\n public get value() {\n return this._value;\n }\n\n protected async updateValue() {\n this._value = this.selectionController.getValue(\n Array.from(this.selectionController.selected)\n );\n\n await this.updateComplete;\n this.target.value = this._value;\n }\n\n @watch('value')\n protected validate() {\n this.updateComplete.then(() => this.reportValidity());\n }\n\n /** Checks the validity of the control. */\n public reportValidity() {\n this.invalid = this.required && !this.value;\n return !this.invalid;\n }\n\n /** A wrapper around the reportValidity method to comply with the native input API. */\n public checkValidity() {\n return this.reportValidity();\n }\n\n /** Sets focus on the component. */\n public override focus(options?: FocusOptions) {\n this.target.focus(options);\n }\n\n /** Removes focus from the component. */\n public override blur() {\n this.target.blur();\n }\n\n protected normalizeSelection(items: Item<T> | Item<T>[] = []): Item<T>[] {\n return Array.isArray(items) ? items : [items];\n }\n\n /**\n * Selects option(s) in the list by either reference or valueKey.\n * If not argument is provided all items will be selected.\n * @param { Item<T> | Items<T> } items - One or more items to be selected. Multiple items should be passed as an array.\n * When valueKey is specified, the corresponding value should be used in place of the item reference.\n * @example\n * ```typescript\n * const combo<IgcComboComponent<T>> = document.querySelector('igc-combo');\n *\n * // Select one item at a time by reference when valueKey is not specified.\n * combo.select(combo.data[0]);\n *\n * // Select multiple items at a time by reference when valueKey is not specified.\n * combo.select([combo.data[0], combo.data[1]]);\n *\n * // Select one item at a time when valueKey is specified.\n * combo.select('BG01');\n *\n * // Select multiple items at a time when valueKey is specified.\n * combo.select(['BG01', 'BG02']);\n * ```\n */\n public select(items?: Item<T> | Item<T>[]) {\n const _items = this.normalizeSelection(items);\n this.selectionController.select(_items, false);\n this.list.requestUpdate();\n this.updateValue();\n }\n\n /**\n * Deselects option(s) in the list by either reference or valueKey.\n * If not argument is provided all items will be deselected.\n * @param { Item<T> | Items<T> } items - One or more items to be deselected. Multiple items should be passed as an array.\n * When valueKey is specified, the corresponding value should be used in place of the item reference.\n * @example\n * ```typescript\n * const combo<IgcComboComponent<T>> = document.querySelector('igc-combo');\n *\n * // Deselect one item at a time by reference when valueKey is not specified.\n * combo.deselect(combo.data[0]);\n *\n * // Deselect multiple items at a time by reference when valueKey is not specified.\n * combo.deselect([combo.data[0], combo.data[1]]);\n *\n * // Deselect one item at a time when valueKey is specified.\n * combo.deselect('BG01');\n *\n * // Deselect multiple items at a time when valueKey is specified.\n * combo.deselect(['BG01', 'BG02']);\n * ```\n */\n public deselect(items?: Item<T> | Item<T>[]) {\n const _items = this.normalizeSelection(items);\n this.selectionController.deselect(_items, false);\n this.list.requestUpdate();\n this.updateValue();\n }\n\n protected async handleMainInput(e: CustomEvent) {\n this._show();\n this.dataController.searchTerm = e.detail;\n\n // wait for the dataState to update after filtering\n await this.updateComplete;\n\n const match = e.detail.length > 0 && this.dataState.length > 0;\n this.navigationController.active = match ? 1 : -1;\n\n // update the list after changing the active item\n this.list.requestUpdate();\n\n // clear the selection upon typing\n this.clearSingleSelection();\n }\n\n protected handleSearchInput(e: CustomEvent) {\n this.dataController.searchTerm = e.detail;\n }\n\n protected handleOpening() {\n const args = { cancelable: true };\n return this.emitEvent('igcOpening', args);\n }\n\n protected handleClosing(): boolean {\n const args = { cancelable: true };\n return this.emitEvent('igcClosing', args);\n }\n\n protected async _show(emit = true) {\n if (this.open) return;\n if (emit && !this.handleOpening()) return;\n this.open = true;\n\n await this.updateComplete;\n emit && this.emitEvent('igcOpened');\n\n if (!this.singleSelect) {\n this.list.focus();\n }\n\n if (!this.autofocusList) {\n this.input.focus();\n }\n }\n\n /** Shows the list of options. */\n public show() {\n this._show(false);\n }\n\n protected async _hide(emit = true) {\n if (!this.open) return;\n if (emit && !this.handleClosing()) return;\n this.open = false;\n\n await this.updateComplete;\n emit && this.emitEvent('igcClosed');\n this.navigationController.active = -1;\n }\n\n /** Hides the list of options. */\n public hide() {\n this._hide(false);\n }\n\n /** @hidden @internal */\n public _toggle(emit = true) {\n this.open ? this._hide(emit) : this._show(emit);\n }\n\n /** Toggles the list of options. */\n public toggle() {\n this._toggle(false);\n }\n\n protected itemRenderer = (item: T, index: number): TemplateResult => {\n const record = item as ComboRecord<T>;\n const active = this.navigationController.active === index;\n const selected = this.selectionController.selected.has(item);\n const headerTemplate = html`<igc-combo-header part=\"group-header\"\n >${this.groupHeaderTemplate({ item: record })}</igc-combo-header\n >`;\n\n const itemParts = partNameMap({\n item: true,\n selected,\n active,\n });\n\n const itemTemplate = html`<igc-combo-item\n part=\"${itemParts}\"\n exportparts=\"checkbox, checkbox-indicator, checked\"\n @click=${this.itemClickHandler.bind(this)}\n .index=${index}\n .active=${active}\n .selected=${selected}\n ?hide-checkbox=${this.singleSelect}\n >${this.itemTemplate({ item: record })}</igc-combo-item\n >`;\n\n return html`${this.groupKey && record.header\n ? headerTemplate\n : itemTemplate}`;\n };\n\n protected listKeydownHandler(event: KeyboardEvent) {\n const target = event\n .composedPath()\n .find(\n (el) => el instanceof IgcComboListComponent\n ) as IgcComboListComponent;\n\n if (target) {\n this.navigationController.navigateList(event, target);\n }\n }\n\n protected itemClickHandler(event: MouseEvent) {\n const input = this.singleSelect ? this.target : this.input;\n\n const target = event\n .composedPath()\n .find(\n (el) => el instanceof IgcComboItemComponent\n ) as IgcComboItemComponent;\n\n this.toggleSelect(target.index);\n input.focus();\n\n if (this.singleSelect) {\n this._hide();\n }\n }\n\n protected toggleSelect(index: number) {\n this.selectionController.changeSelection(index);\n this.navigationController.active = index;\n this.updateValue();\n this.list.requestUpdate();\n }\n\n protected navigateTo(item: T) {\n this.navigationController.navigateTo(item, this.list);\n }\n\n protected clearSingleSelection() {\n const { selected } = this.selectionController;\n const selection = selected.values().next().value;\n\n if (selection) {\n const item = this.valueKey ? selection[this.valueKey] : selection;\n this.selectionController.deselect([item], selected.size > 0);\n }\n }\n\n protected handleClearIconClick(e: MouseEvent) {\n e.stopPropagation();\n\n if (this.singleSelect) {\n this.resetSearchTerm();\n this.clearSingleSelection();\n } else {\n this.selectionController.deselect([], true);\n }\n\n this.updateValue();\n this.navigationController.active = -1;\n this.list.requestUpdate();\n }\n\n protected handleMainInputKeydown(e: KeyboardEvent) {\n this.navigationController.navigateMainInput(e, this.list);\n }\n\n protected handleSearchInputKeydown(e: KeyboardEvent) {\n this.navigationController.navigateSearchInput(e, this.list);\n }\n\n protected toggleCaseSensitivity() {\n this.filteringOptions.caseSensitive = !this.filteringOptions.caseSensitive;\n this.requestUpdate('pipeline');\n }\n\n protected get hasPrefixes() {\n return this.inputPrefix.length > 0;\n }\n\n protected get hasSuffixes() {\n return this.inputSuffix.length > 0;\n }\n\n private renderToggleIcon() {\n const openIcon =\n this.theme === 'material' ? 'keyboard_arrow_up' : 'arrow_drop_up';\n const closeIcon =\n this.theme === 'material' ? 'keyboard_arrow_down' : 'arrow_drop_down';\n\n return html`\n <span slot=\"suffix\" part=\"toggle-icon\">\n <slot name=\"toggle-icon\">\n <igc-icon\n name=${this.open ? openIcon : closeIcon}\n collection=\"internal\"\n aria-hidden=\"true\"\n ></igc-icon>\n </slot>\n </span>\n `;\n }\n\n private renderClearIcon() {\n const { selected } = this.selectionController;\n const icon = this.theme === 'material' ? 'chip_cancel' : 'clear';\n\n return html`<span\n slot=\"suffix\"\n part=\"clear-icon\"\n @click=${this.handleClearIconClick}\n ?hidden=${selected.size === 0}\n >\n <slot name=\"clear-icon\">\n <igc-icon\n name=\"${icon}\"\n collection=\"internal\"\n aria-hidden=\"true\"\n ></igc-icon>\n </slot>\n </span>`;\n }\n\n private renderMainInput() {\n return html`<igc-input\n id=\"target\"\n role=\"combobox\"\n aria-owns=\"dropdown\"\n aria-describedby=\"helper-text\"\n aria-disabled=${this.disabled}\n exportparts=\"container: input, input: native-input, label, prefix, suffix\"\n @click=${(e: MouseEvent) => {\n e.preventDefault();\n this._toggle(true);\n }}\n placeholder=${ifDefined(this.placeholder)}\n label=${ifDefined(this.label)}\n dir=${this.dir}\n @igcChange=${(e: Event) => e.stopPropagation()}\n @igcFocus=${(e: Event) => {\n e.stopPropagation();\n\n requestAnimationFrame(() => {\n this.target.select();\n });\n }}\n @igcBlur=${(e: Event) => e.stopPropagation()}\n @igcInput=${this.handleMainInput}\n @keydown=${this.handleMainInputKeydown}\n .disabled=${this.disabled}\n .required=${this.required}\n .invalid=${this.invalid}\n .outlined=${this.outlined}\n .autofocus=${this.autofocus}\n ?readonly=${!this.singleSelect}\n >\n <span slot=${this.hasPrefixes && 'prefix'}>\n <slot name=\"prefix\"></slot>\n </span>\n ${this.renderClearIcon()}\n <span slot=${this.hasSuffixes && 'suffix'}>\n <slot name=\"suffix\"></slot>\n </span>\n ${this.renderToggleIcon()}\n </igc-input>`;\n }\n\n private renderSearchInput() {\n return html`<div\n part=\"filter-input\"\n ?hidden=${this.disableFiltering || this.singleSelect}\n >\n <igc-input\n part=\"search-input\"\n placeholder=${this.placeholderSearch}\n exportparts=\"input: search-input\"\n @igcFocus=${(e: Event) => e.stopPropagation()}\n @igcBlur=${(e: Event) => e.stopPropagation()}\n @igcInput=${this.handleSearchInput}\n @keydown=${this.handleSearchInputKeydown}\n dir=${this.dir}\n >\n <igc-icon\n slot=${this.caseSensitiveIcon && 'suffix'}\n name=\"case_sensitive\"\n collection=\"internal\"\n part=${partNameMap({\n 'case-icon': true,\n active: this.filteringOptions.caseSensitive ?? false,\n })}\n @click=${this.toggleCaseSensitivity}\n ></igc-icon>\n </igc-input>\n </div>`;\n }\n\n private renderEmptyTemplate() {\n return html`<div part=\"empty\" ?hidden=${this.dataState.length > 0}>\n <slot name=\"empty\">The list is empty</slot>\n </div>`;\n }\n\n private renderList() {\n return html`<div\n @keydown=${this.listKeydownHandler}\n part=\"list-wrapper\"\n ${this.toggleController.toggleDirective}\n >\n ${this.renderSearchInput()}\n <div part=\"header\">\n <slot name=\"header\"></slot>\n </div>\n <igc-combo-list\n id=\"dropdown\"\n part=\"list\"\n aria-label=\"${this.label}\"\n .items=${this.dataState}\n .renderItem=${this.itemRenderer}\n ?hidden=${this.dataState.length === 0}\n >\n </igc-combo-list>\n ${this.renderEmptyTemplate()}\n <div part=\"footer\">\n <slot name=\"footer\"></slot>\n </div>\n </div>`;\n }\n\n private renderHelperText() {\n return html`<div\n id=\"helper-text\"\n part=\"helper-text\"\n ?hidden=\"${this.helperText.length === 0}\"\n >\n <slot name=\"helper-text\"></slot>\n </div>`;\n }\n\n protected override render() {\n return html`\n ${this.renderMainInput()}${this.renderList()}${this.renderHelperText()}\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'igc-combo': IgcComboComponent<object>;\n }\n}\n"]}
|
|
@@ -7,9 +7,10 @@ declare enum DIRECTION {
|
|
|
7
7
|
}
|
|
8
8
|
export declare class NavigationController<T extends object> implements ReactiveController {
|
|
9
9
|
protected host: ComboHost<T>;
|
|
10
|
-
protected hostHandlers: Map<string, (
|
|
10
|
+
protected hostHandlers: Map<string, () => void>;
|
|
11
|
+
protected mainInputHandlers: Map<string, (() => void) | (() => void) | ((container: IgcComboListComponent) => Promise<void>) | (() => void) | (() => void)>;
|
|
11
12
|
protected searchInputHandlers: Map<string, (() => void) | ((container: IgcComboListComponent) => void)>;
|
|
12
|
-
protected listHandlers: Map<string, (() => void) | ((
|
|
13
|
+
protected listHandlers: Map<string, (() => void) | (() => void) | (() => void) | ((container: IgcComboListComponent) => void) | ((container: IgcComboListComponent) => void) | (() => void) | ((container: IgcComboListComponent) => void) | ((container: IgcComboListComponent) => void)>;
|
|
13
14
|
protected _active: number;
|
|
14
15
|
get input(): import("../../input/input.js").default;
|
|
15
16
|
get dataState(): ComboRecord<T>[];
|
|
@@ -29,7 +30,8 @@ export declare class NavigationController<T extends object> implements ReactiveC
|
|
|
29
30
|
protected escape(): void;
|
|
30
31
|
protected enter(): void;
|
|
31
32
|
protected inputArrowDown(container: IgcComboListComponent): void;
|
|
32
|
-
protected
|
|
33
|
+
protected mainInputArrowDown(container: IgcComboListComponent): Promise<void>;
|
|
34
|
+
protected tab(): void;
|
|
33
35
|
protected arrowDown(container: IgcComboListComponent): void;
|
|
34
36
|
protected arrowUp(container: IgcComboListComponent): void;
|
|
35
37
|
protected getNextItem(direction: DIRECTION): void;
|
|
@@ -38,7 +40,8 @@ export declare class NavigationController<T extends object> implements ReactiveC
|
|
|
38
40
|
hostDisconnected(): void;
|
|
39
41
|
navigateTo(item: T, container: IgcComboListComponent): void;
|
|
40
42
|
navigateHost(event: KeyboardEvent): void;
|
|
41
|
-
|
|
43
|
+
navigateMainInput(event: KeyboardEvent, container: IgcComboListComponent): void;
|
|
44
|
+
navigateSearchInput(event: KeyboardEvent, container: IgcComboListComponent): void;
|
|
42
45
|
navigateList(event: KeyboardEvent, container: IgcComboListComponent): void;
|
|
43
46
|
}
|
|
44
47
|
export {};
|