igniteui-webcomponents 3.3.1 → 3.4.0-beta.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 +7 -0
- package/README.md +5 -1
- package/components/button/themes/button/light/button.base.css.js +1 -1
- package/components/button/themes/button/light/button.base.css.js.map +1 -1
- package/components/button/themes/button/light/button.material.css.js +1 -1
- package/components/button/themes/button/light/button.material.css.js.map +1 -1
- package/components/calendar/days-view/days-view.d.ts +2 -0
- package/components/calendar/days-view/days-view.js +17 -5
- package/components/calendar/days-view/days-view.js.map +1 -1
- package/components/chip/chip.d.ts +1 -0
- package/components/chip/chip.js +9 -0
- package/components/chip/chip.js.map +1 -1
- package/components/common/util.d.ts +1 -0
- package/components/common/util.js +3 -0
- package/components/common/util.js.map +1 -1
- package/components/dialog/dialog.d.ts +69 -0
- package/components/dialog/dialog.js +168 -0
- package/components/dialog/dialog.js.map +1 -0
- package/components/dialog/themes/light/dialog.base.css.d.ts +1 -0
- package/components/dialog/themes/light/dialog.base.css.js +3 -0
- package/components/dialog/themes/light/dialog.base.css.js.map +1 -0
- package/components/dialog/themes/light/dialog.bootstrap.css.d.ts +1 -0
- package/components/dialog/themes/light/dialog.bootstrap.css.js +3 -0
- package/components/dialog/themes/light/dialog.bootstrap.css.js.map +1 -0
- package/components/dialog/themes/light/dialog.fluent.css.d.ts +1 -0
- package/components/dialog/themes/light/dialog.fluent.css.js +3 -0
- package/components/dialog/themes/light/dialog.fluent.css.js.map +1 -0
- package/components/dialog/themes/light/dialog.indigo.css.d.ts +1 -0
- package/components/dialog/themes/light/dialog.indigo.css.js +3 -0
- package/components/dialog/themes/light/dialog.indigo.css.js.map +1 -0
- package/components/dialog/themes/light/dialog.material.css.d.ts +1 -0
- package/components/dialog/themes/light/dialog.material.css.js +3 -0
- package/components/dialog/themes/light/dialog.material.css.js.map +1 -0
- package/components/dropdown/dropdown-group.d.ts +2 -2
- package/components/dropdown/dropdown-group.js +1 -1
- package/components/dropdown/dropdown-group.js.map +1 -1
- package/components/dropdown/dropdown-header.d.ts +1 -1
- package/components/dropdown/dropdown-header.js.map +1 -1
- package/components/dropdown/dropdown-item.d.ts +1 -1
- package/components/dropdown/dropdown-item.js.map +1 -1
- package/components/dropdown/dropdown.d.ts +10 -8
- package/components/dropdown/dropdown.js +15 -10
- package/components/dropdown/dropdown.js.map +1 -1
- package/components/dropdown/themes/light/dropdown-group.base.css.js +1 -1
- package/components/dropdown/themes/light/dropdown-group.base.css.js.map +1 -1
- package/components/dropdown/themes/light/dropdown-group.fluent.css.js +1 -1
- package/components/dropdown/themes/light/dropdown-group.fluent.css.js.map +1 -1
- package/components/dropdown/themes/light/dropdown-item.base.css.js +1 -1
- package/components/dropdown/themes/light/dropdown-item.base.css.js.map +1 -1
- package/components/dropdown/themes/light/dropdown.base.css.js +1 -1
- package/components/dropdown/themes/light/dropdown.base.css.js.map +1 -1
- package/components/dropdown/themes/light/dropdown.fluent.css.js +1 -1
- package/components/dropdown/themes/light/dropdown.fluent.css.js.map +1 -1
- package/components/form/form.js +4 -3
- package/components/form/form.js.map +1 -1
- package/components/icon/icon.js +3 -1
- package/components/icon/icon.js.map +1 -1
- package/components/input/input.d.ts +1 -0
- package/components/input/input.js +5 -0
- package/components/input/input.js.map +1 -1
- package/components/input/themes/light/input.base.css.js +1 -1
- package/components/input/themes/light/input.base.css.js.map +1 -1
- package/components/input/themes/light/input.bootstrap.css.js +1 -1
- package/components/input/themes/light/input.bootstrap.css.js.map +1 -1
- package/components/input/themes/light/input.fluent.css.js +1 -1
- package/components/input/themes/light/input.fluent.css.js.map +1 -1
- package/components/input/themes/light/input.indigo.css.js +1 -1
- package/components/input/themes/light/input.indigo.css.js.map +1 -1
- package/components/radio-group/radio-group.d.ts +0 -1
- package/components/radio-group/radio-group.js +4 -6
- package/components/radio-group/radio-group.js.map +1 -1
- package/components/rating/rating.d.ts +21 -9
- package/components/rating/rating.js +50 -33
- package/components/rating/rating.js.map +1 -1
- package/components/select/select-group.d.ts +31 -0
- package/components/select/select-group.js +69 -0
- package/components/select/select-group.js.map +1 -0
- package/components/select/select-header.d.ts +15 -0
- package/components/select/select-header.js +5 -0
- package/components/select/select-header.js.map +1 -0
- package/components/select/select-item.d.ts +30 -0
- package/components/select/select-item.js +39 -0
- package/components/select/select-item.js.map +1 -0
- package/components/select/select.d.ts +112 -0
- package/components/select/select.js +343 -0
- package/components/select/select.js.map +1 -0
- package/components/select/themes/dark/select.bootstrap.css.d.ts +1 -0
- package/components/select/themes/dark/select.bootstrap.css.js +3 -0
- package/components/select/themes/dark/select.bootstrap.css.js.map +1 -0
- package/components/select/themes/dark/select.fluent.css.d.ts +1 -0
- package/components/select/themes/dark/select.fluent.css.js +3 -0
- package/components/select/themes/dark/select.fluent.css.js.map +1 -0
- package/components/select/themes/dark/select.indigo.css.d.ts +1 -0
- package/components/select/themes/dark/select.indigo.css.js +3 -0
- package/components/select/themes/dark/select.indigo.css.js.map +1 -0
- package/components/select/themes/dark/select.material.css.d.ts +1 -0
- package/components/select/themes/dark/select.material.css.js +3 -0
- package/components/select/themes/dark/select.material.css.js.map +1 -0
- package/components/select/themes/light/select.base.css.d.ts +1 -0
- package/components/select/themes/light/select.base.css.js +3 -0
- package/components/select/themes/light/select.base.css.js.map +1 -0
- package/components/select/themes/light/select.bootstrap.css.d.ts +1 -0
- package/components/select/themes/light/select.bootstrap.css.js +3 -0
- package/components/select/themes/light/select.bootstrap.css.js.map +1 -0
- package/components/select/themes/light/select.fluent.css.d.ts +1 -0
- package/components/select/themes/light/select.fluent.css.js +3 -0
- package/components/select/themes/light/select.fluent.css.js.map +1 -0
- package/components/select/themes/light/select.indigo.css.d.ts +1 -0
- package/components/select/themes/light/select.indigo.css.js +3 -0
- package/components/select/themes/light/select.indigo.css.js.map +1 -0
- package/components/select/themes/light/select.material.css.d.ts +1 -0
- package/components/select/themes/light/select.material.css.js +3 -0
- package/components/select/themes/light/select.material.css.js.map +1 -0
- package/components/slider/slider-base.d.ts +0 -1
- package/components/slider/slider-base.js +5 -7
- package/components/slider/slider-base.js.map +1 -1
- package/components/tabs/tabs.d.ts +0 -1
- package/components/tabs/tabs.js +7 -9
- package/components/tabs/tabs.js.map +1 -1
- package/components/toast/toast.d.ts +1 -0
- package/components/toast/toast.js +9 -0
- package/components/toast/toast.js.map +1 -1
- package/custom-elements.json +613 -14
- package/index.d.ts +5 -0
- package/index.js +5 -0
- package/index.js.map +1 -1
- package/package.json +3 -3
- package/themes/dark/bootstrap.css +1 -1
- package/themes/dark/fluent.css +1 -1
- package/themes/dark/indigo.css +1 -1
- package/themes/dark/material.css +1 -1
- package/vscode-html-custom-data.json +282 -14
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"select-header.js","sourceRoot":"","sources":["../../../src/components/select/select-header.ts"],"names":[],"mappings":"AAAA,OAAO,0BAA0B,MAAM,gCAAgC,CAAC;AAOxE,MAAM,CAAC,OAAO,OAAO,wBAAyB,SAAQ,0BAA0B;;AAE9C,gCAAO,GAAG,mBAAmB,CAAC","sourcesContent":["import IgcDropdownHeaderComponent from '../dropdown/dropdown-header.js';\n\n/**\n * @element igc-select-header - Represents a header item in a select component.\n *\n * @slot - Renders the header.\n */\nexport default class IgcSelectHeaderComponent extends IgcDropdownHeaderComponent {\n /** @private */\n public static override readonly tagName = 'igc-select-header';\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'igc-select-header': IgcSelectHeaderComponent;\n }\n}\n"]}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import IgcDropdownItemComponent from '../dropdown/dropdown-item.js';
|
|
2
|
+
/**
|
|
3
|
+
* Represents an item in a select list.
|
|
4
|
+
*
|
|
5
|
+
* @element igc-select-item
|
|
6
|
+
*
|
|
7
|
+
* @slot - Renders the all content bar the prefix and suffix.
|
|
8
|
+
* @slot prefix - Renders content before the main content area.
|
|
9
|
+
* @slot suffix - Renders content after the main content area.
|
|
10
|
+
*
|
|
11
|
+
* @csspart prefix - The prefix wrapper.
|
|
12
|
+
* @csspart content - The main content wrapper.
|
|
13
|
+
* @csspart suffix - The suffix wrapper.
|
|
14
|
+
*/
|
|
15
|
+
export default class IgcSelectItemComponent extends IgcDropdownItemComponent {
|
|
16
|
+
private content;
|
|
17
|
+
/** @private */
|
|
18
|
+
static readonly tagName = "igc-select-item";
|
|
19
|
+
constructor();
|
|
20
|
+
protected activeChange(): void;
|
|
21
|
+
/** Returns the text of the item without the prefix and suffix content. */
|
|
22
|
+
get textContent(): string;
|
|
23
|
+
/** Sets the textContent of the item without touching the prefix and suffix content. */
|
|
24
|
+
set textContent(value: string);
|
|
25
|
+
}
|
|
26
|
+
declare global {
|
|
27
|
+
interface HTMLElementTagNameMap {
|
|
28
|
+
'igc-select-item': IgcSelectItemComponent;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { queryAssignedNodes } from 'lit/decorators.js';
|
|
8
|
+
import { watch } from '../common/decorators/watch.js';
|
|
9
|
+
import IgcDropdownItemComponent from '../dropdown/dropdown-item.js';
|
|
10
|
+
export default class IgcSelectItemComponent extends IgcDropdownItemComponent {
|
|
11
|
+
constructor() {
|
|
12
|
+
super();
|
|
13
|
+
}
|
|
14
|
+
activeChange() {
|
|
15
|
+
this.tabIndex = this.active ? 0 : -1;
|
|
16
|
+
if (this.active) {
|
|
17
|
+
this.focus();
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
get textContent() {
|
|
21
|
+
return this.content
|
|
22
|
+
.map((t) => { var _a; return (_a = t.textContent) === null || _a === void 0 ? void 0 : _a.trim(); })
|
|
23
|
+
.filter((t) => t !== '')
|
|
24
|
+
.join(' ');
|
|
25
|
+
}
|
|
26
|
+
set textContent(value) {
|
|
27
|
+
const text = new Text(value);
|
|
28
|
+
this.content.forEach((n) => n.remove());
|
|
29
|
+
this.appendChild(text);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
IgcSelectItemComponent.tagName = 'igc-select-item';
|
|
33
|
+
__decorate([
|
|
34
|
+
queryAssignedNodes({ flatten: true })
|
|
35
|
+
], IgcSelectItemComponent.prototype, "content", void 0);
|
|
36
|
+
__decorate([
|
|
37
|
+
watch('active')
|
|
38
|
+
], IgcSelectItemComponent.prototype, "activeChange", null);
|
|
39
|
+
//# sourceMappingURL=select-item.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"select-item.js","sourceRoot":"","sources":["../../../src/components/select/select-item.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EAAE,KAAK,EAAE,MAAM,+BAA+B,CAAC;AACtD,OAAO,wBAAwB,MAAM,8BAA8B,CAAC;AAepE,MAAM,CAAC,OAAO,OAAO,sBAAuB,SAAQ,wBAAwB;IAO1E;QACE,KAAK,EAAE,CAAC;IACV,CAAC;IAGS,YAAY;QACpB,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAErC,IAAI,IAAI,CAAC,MAAM,EAAE;YACf,IAAI,CAAC,KAAK,EAAE,CAAC;SACd;IACH,CAAC;IAGD,IAAoB,WAAW;QAC7B,OAAO,IAAI,CAAC,OAAO;aAChB,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,WAAC,OAAA,MAAA,CAAC,CAAC,WAAW,0CAAE,IAAI,EAAE,CAAA,EAAA,CAAC;aACjC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,EAAE,CAAC;aACvB,IAAI,CAAC,GAAG,CAAC,CAAC;IACf,CAAC;IAGD,IAAoB,WAAW,CAAC,KAAa;QAC3C,MAAM,IAAI,GAAG,IAAI,IAAI,CAAC,KAAK,CAAC,CAAC;QAC7B,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC;QACxC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;IACzB,CAAC;;AA5B+B,8BAAO,GAAG,iBAAiB,CAAC;AAH5D;IADC,kBAAkB,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;uDACL;AAUjC;IADC,KAAK,CAAC,QAAQ,CAAC;0DAOf","sourcesContent":["import { queryAssignedNodes } from 'lit/decorators.js';\nimport { watch } from '../common/decorators/watch.js';\nimport IgcDropdownItemComponent from '../dropdown/dropdown-item.js';\n\n/**\n * Represents an item in a select list.\n *\n * @element igc-select-item\n *\n * @slot - Renders the all content bar the prefix and suffix.\n * @slot prefix - Renders content before the main content area.\n * @slot suffix - Renders content after the main content area.\n *\n * @csspart prefix - The prefix wrapper.\n * @csspart content - The main content wrapper.\n * @csspart suffix - The suffix wrapper.\n */\nexport default class IgcSelectItemComponent extends IgcDropdownItemComponent {\n @queryAssignedNodes({ flatten: true })\n private content!: Array<Element>;\n\n /** @private */\n public static override readonly tagName = 'igc-select-item';\n\n constructor() {\n super();\n }\n\n @watch('active')\n protected activeChange() {\n this.tabIndex = this.active ? 0 : -1;\n\n if (this.active) {\n this.focus();\n }\n }\n\n /** Returns the text of the item without the prefix and suffix content. */\n public override get textContent() {\n return this.content\n .map((t) => t.textContent?.trim())\n .filter((t) => t !== '')\n .join(' ');\n }\n\n /** Sets the textContent of the item without touching the prefix and suffix content. */\n public override set textContent(value: string) {\n const text = new Text(value);\n this.content.forEach((n) => n.remove());\n this.appendChild(text);\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'igc-select-item': IgcSelectItemComponent;\n }\n}\n"]}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { Constructor } from '../common/mixins/constructor.js';
|
|
2
|
+
import IgcDropdownComponent, { IgcDropdownEventMap } from '../dropdown/dropdown.js';
|
|
3
|
+
import IgcInputComponent from '../input/input.js';
|
|
4
|
+
import IgcSelectGroupComponent from './select-group.js';
|
|
5
|
+
import IgcSelectItemComponent from './select-item.js';
|
|
6
|
+
export interface IgcSelectEventMap extends IgcDropdownEventMap {
|
|
7
|
+
igcFocus: CustomEvent<void>;
|
|
8
|
+
igcBlur: CustomEvent<void>;
|
|
9
|
+
}
|
|
10
|
+
declare const IgcSelectComponent_base: import("../common/mixins/constructor.js").AbstractConstructor<import("../common/mixins/event-emitter.js").EventEmitterInterface<IgcSelectEventMap>> & Constructor<IgcDropdownComponent>;
|
|
11
|
+
/**
|
|
12
|
+
* @element igc-select
|
|
13
|
+
*
|
|
14
|
+
* @slot - Renders the list of select items.
|
|
15
|
+
* @slot prefix - Renders content before the input.
|
|
16
|
+
* @slot suffix - Renders content after input.
|
|
17
|
+
* @slot header - Renders a container before the list of options.
|
|
18
|
+
* @slot footer - Renders a container after the list of options.
|
|
19
|
+
* @slot helper-text - Renders content below the input.
|
|
20
|
+
* @slot toggle-icon - Renders content inside the suffix container.
|
|
21
|
+
*
|
|
22
|
+
* @fires igcFocus - Emitted when the select gains focus.
|
|
23
|
+
* @fires igcBlur - Emitted when the select loses focus.
|
|
24
|
+
* @fires igcChange - Emitted when the control's checked state changes.
|
|
25
|
+
* @fires igcOpening - Emitted just before the list of options is opened.
|
|
26
|
+
* @fires igcOpened - Emitted after the list of options is opened.
|
|
27
|
+
* @fires igcClosing - Emitter just before the list of options is closed.
|
|
28
|
+
* @fires igcClosed - Emitted after the list of options is closed.
|
|
29
|
+
*
|
|
30
|
+
* @csspart list - The list of options wrapper.
|
|
31
|
+
* @csspart input - The encapsulated igc-input.
|
|
32
|
+
* @csspart label - The encapsulated text label.
|
|
33
|
+
* @csspart prefix - The prefix wrapper.
|
|
34
|
+
* @csspart suffix - The suffix wrapper.
|
|
35
|
+
* @csspart toggle-icon - The toggle icon wrapper.
|
|
36
|
+
* @csspart helper-text - The helper text wrapper.
|
|
37
|
+
*/
|
|
38
|
+
export default class IgcSelectComponent extends IgcSelectComponent_base {
|
|
39
|
+
/** @private */
|
|
40
|
+
static readonly tagName = "igc-select";
|
|
41
|
+
static styles: import("lit").CSSResult;
|
|
42
|
+
private searchTerm;
|
|
43
|
+
private lastKeyTime;
|
|
44
|
+
private readonly targetKeyHandlers;
|
|
45
|
+
protected items: Array<IgcSelectItemComponent>;
|
|
46
|
+
protected groups: Array<IgcSelectGroupComponent>;
|
|
47
|
+
protected helperText: Array<HTMLElement>;
|
|
48
|
+
protected inputSuffix: Array<HTMLElement>;
|
|
49
|
+
protected inputPrefix: Array<HTMLElement>;
|
|
50
|
+
protected selectedItem: IgcSelectItemComponent | null;
|
|
51
|
+
protected target: IgcInputComponent;
|
|
52
|
+
/** The value attribute of the control. */
|
|
53
|
+
value?: string | undefined;
|
|
54
|
+
/** The name attribute of the control. */
|
|
55
|
+
name: string;
|
|
56
|
+
/** The disabled attribute of the control. */
|
|
57
|
+
disabled: boolean;
|
|
58
|
+
/** The required attribute of the control. */
|
|
59
|
+
required: boolean;
|
|
60
|
+
/** The invalid attribute of the control. */
|
|
61
|
+
invalid: boolean;
|
|
62
|
+
/** The outlined attribute of the control. */
|
|
63
|
+
outlined: boolean;
|
|
64
|
+
/** The autofocus attribute of the control. */
|
|
65
|
+
autofocus: boolean;
|
|
66
|
+
/** The label attribute of the control. */
|
|
67
|
+
label: string;
|
|
68
|
+
/** The placeholder attribute of the control. */
|
|
69
|
+
placeholder: string;
|
|
70
|
+
/** Whether the dropdown's width should be the same as the target's one. */
|
|
71
|
+
sameWidth: boolean;
|
|
72
|
+
/** The direction attribute of the control. */
|
|
73
|
+
dir: 'ltr' | 'rtl' | 'auto';
|
|
74
|
+
constructor();
|
|
75
|
+
/** Override the dropdown target focusout behavior to prevent the focus from
|
|
76
|
+
* being returned to the target element when the select loses focus. */
|
|
77
|
+
protected handleFocusout(): void;
|
|
78
|
+
/** Sets focus on the component. */
|
|
79
|
+
focus(options?: FocusOptions): void;
|
|
80
|
+
/** Removes focus from the component. */
|
|
81
|
+
blur(): void;
|
|
82
|
+
/** Checks the validity of the control. */
|
|
83
|
+
reportValidity(): boolean;
|
|
84
|
+
firstUpdated(): Promise<void>;
|
|
85
|
+
protected updateValue(): void;
|
|
86
|
+
protected updateSelected(): void;
|
|
87
|
+
protected validate(): void;
|
|
88
|
+
protected selectNext(): void;
|
|
89
|
+
protected selectPrev(): void;
|
|
90
|
+
protected selectInteractiveItem(index: number): void;
|
|
91
|
+
protected searchItem(event: KeyboardEvent): void;
|
|
92
|
+
protected handleFocus(): void;
|
|
93
|
+
protected handleBlur(): void;
|
|
94
|
+
protected onTargetTabKey(): void;
|
|
95
|
+
protected onTargetEnterKey(): void;
|
|
96
|
+
protected onTargetArrowLeftKeyDown(): void;
|
|
97
|
+
protected onTargetArrowRightKeyDown(): void;
|
|
98
|
+
protected onTargetArrowUpKeyDown(event: KeyboardEvent): void;
|
|
99
|
+
protected onTargetArrowDownKeyDown(event: KeyboardEvent): void;
|
|
100
|
+
protected onTargetHomeKey(): void;
|
|
101
|
+
protected onTargetEndKey(): void;
|
|
102
|
+
protected handleTargetKeyDown(event: KeyboardEvent): void;
|
|
103
|
+
protected get hasPrefixes(): boolean;
|
|
104
|
+
protected get hasSuffixes(): boolean;
|
|
105
|
+
protected render(): import("lit-html").TemplateResult<1>;
|
|
106
|
+
}
|
|
107
|
+
declare global {
|
|
108
|
+
interface HTMLElementTagNameMap {
|
|
109
|
+
'igc-select': IgcSelectComponent;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
export {};
|
|
@@ -0,0 +1,343 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { html } from 'lit';
|
|
8
|
+
import { property, query, queryAssignedElements, state, } from 'lit/decorators.js';
|
|
9
|
+
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
10
|
+
import { styleMap } from 'lit/directives/style-map.js';
|
|
11
|
+
import { themes } from '../../theming/index.js';
|
|
12
|
+
import { blazorAdditionalDependencies } from '../common/decorators/blazorAdditionalDependencies.js';
|
|
13
|
+
import { watch } from '../common/decorators/watch.js';
|
|
14
|
+
import { defineComponents } from '../common/definitions/defineComponents.js';
|
|
15
|
+
import { EventEmitterMixin } from '../common/mixins/event-emitter.js';
|
|
16
|
+
import IgcDropdownComponent from '../dropdown/dropdown.js';
|
|
17
|
+
import IgcIconComponent from '../icon/icon.js';
|
|
18
|
+
import IgcInputComponent from '../input/input.js';
|
|
19
|
+
import IgcSelectGroupComponent from './select-group.js';
|
|
20
|
+
import IgcSelectHeaderComponent from './select-header.js';
|
|
21
|
+
import IgcSelectItemComponent from './select-item.js';
|
|
22
|
+
import { styles } from './themes/light/select.base.css';
|
|
23
|
+
import { styles as bootstrap } from './themes/light/select.bootstrap.css';
|
|
24
|
+
import { styles as fluent } from './themes/light/select.fluent.css';
|
|
25
|
+
import { styles as indigo } from './themes/light/select.indigo.css';
|
|
26
|
+
import { styles as material } from './themes/light/select.material.css';
|
|
27
|
+
defineComponents(IgcIconComponent, IgcInputComponent, IgcSelectGroupComponent, IgcSelectHeaderComponent, IgcSelectItemComponent);
|
|
28
|
+
let IgcSelectComponent = class IgcSelectComponent extends EventEmitterMixin(IgcDropdownComponent) {
|
|
29
|
+
constructor() {
|
|
30
|
+
super();
|
|
31
|
+
this.searchTerm = '';
|
|
32
|
+
this.lastKeyTime = Date.now();
|
|
33
|
+
this.targetKeyHandlers = new Map(Object.entries({
|
|
34
|
+
' ': this.onTargetEnterKey,
|
|
35
|
+
Tab: this.onTargetTabKey,
|
|
36
|
+
Escape: this.onEscapeKey,
|
|
37
|
+
Enter: this.onTargetEnterKey,
|
|
38
|
+
ArrowLeft: this.onTargetArrowLeftKeyDown,
|
|
39
|
+
ArrowRight: this.onTargetArrowRightKeyDown,
|
|
40
|
+
ArrowUp: this.onTargetArrowUpKeyDown,
|
|
41
|
+
ArrowDown: this.onTargetArrowDownKeyDown,
|
|
42
|
+
Home: this.onTargetHomeKey,
|
|
43
|
+
End: this.onTargetEndKey,
|
|
44
|
+
}));
|
|
45
|
+
this.disabled = false;
|
|
46
|
+
this.required = false;
|
|
47
|
+
this.invalid = false;
|
|
48
|
+
this.outlined = false;
|
|
49
|
+
this.sameWidth = true;
|
|
50
|
+
this.dir = 'auto';
|
|
51
|
+
this.size = 'medium';
|
|
52
|
+
this.addEventListener('igcClosing', () => this.target.focus());
|
|
53
|
+
}
|
|
54
|
+
handleFocusout() { }
|
|
55
|
+
focus(options) {
|
|
56
|
+
this.target.focus(options);
|
|
57
|
+
}
|
|
58
|
+
blur() {
|
|
59
|
+
this.target.blur();
|
|
60
|
+
}
|
|
61
|
+
reportValidity() {
|
|
62
|
+
this.invalid = this.required && !this.value;
|
|
63
|
+
if (this.invalid)
|
|
64
|
+
this.target.focus();
|
|
65
|
+
return !this.invalid;
|
|
66
|
+
}
|
|
67
|
+
async firstUpdated() {
|
|
68
|
+
super.firstUpdated();
|
|
69
|
+
await this.updateComplete;
|
|
70
|
+
if (!this.selectedItem && this.value) {
|
|
71
|
+
this.updateSelected();
|
|
72
|
+
}
|
|
73
|
+
if (this.autofocus) {
|
|
74
|
+
this.target.focus();
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
updateValue() {
|
|
78
|
+
var _a;
|
|
79
|
+
this.value = (_a = this.selectedItem) === null || _a === void 0 ? void 0 : _a.value;
|
|
80
|
+
}
|
|
81
|
+
updateSelected() {
|
|
82
|
+
var _a;
|
|
83
|
+
if (this.allItems.length === 0)
|
|
84
|
+
return;
|
|
85
|
+
if (((_a = this.selectedItem) === null || _a === void 0 ? void 0 : _a.value) !== this.value) {
|
|
86
|
+
const matches = this.allItems.filter((i) => i.value === this.value);
|
|
87
|
+
const index = this.allItems.indexOf(matches.at(-1));
|
|
88
|
+
if (index === -1) {
|
|
89
|
+
this.value = undefined;
|
|
90
|
+
this.clearSelection();
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
this.select(index);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
validate() {
|
|
97
|
+
this.updateComplete.then(() => this.reportValidity());
|
|
98
|
+
}
|
|
99
|
+
selectNext() {
|
|
100
|
+
var _a;
|
|
101
|
+
const activeItemIndex = [...this.allItems].indexOf((_a = this.selectedItem) !== null && _a !== void 0 ? _a : this.activeItem);
|
|
102
|
+
const next = this.getNearestSiblingFocusableItemIndex(activeItemIndex !== null && activeItemIndex !== void 0 ? activeItemIndex : -1, 1);
|
|
103
|
+
this.selectItem(this.allItems[next], true);
|
|
104
|
+
}
|
|
105
|
+
selectPrev() {
|
|
106
|
+
var _a;
|
|
107
|
+
const activeItemIndex = [...this.allItems].indexOf((_a = this.selectedItem) !== null && _a !== void 0 ? _a : this.activeItem);
|
|
108
|
+
const prev = this.getNearestSiblingFocusableItemIndex(activeItemIndex !== null && activeItemIndex !== void 0 ? activeItemIndex : -1, -1);
|
|
109
|
+
this.selectItem(this.allItems[prev], true);
|
|
110
|
+
}
|
|
111
|
+
selectInteractiveItem(index) {
|
|
112
|
+
const item = this.allItems
|
|
113
|
+
.filter((i) => !i.disabled)
|
|
114
|
+
.at(index);
|
|
115
|
+
if (item.value !== this.value) {
|
|
116
|
+
this.selectItem(item, true);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
searchItem(event) {
|
|
120
|
+
if (!/^.$/u.test(event.key)) {
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
const currentTime = Date.now();
|
|
124
|
+
if (currentTime - this.lastKeyTime > 500) {
|
|
125
|
+
this.searchTerm = '';
|
|
126
|
+
}
|
|
127
|
+
this.searchTerm += event.key;
|
|
128
|
+
this.lastKeyTime = currentTime;
|
|
129
|
+
const item = this.allItems
|
|
130
|
+
.filter((i) => !i.disabled)
|
|
131
|
+
.find((i) => {
|
|
132
|
+
var _a;
|
|
133
|
+
return (_a = i.textContent) === null || _a === void 0 ? void 0 : _a.trim().toLowerCase().startsWith(this.searchTerm.toLowerCase());
|
|
134
|
+
});
|
|
135
|
+
if (item && this.value !== item.value) {
|
|
136
|
+
this.open ? this.activateItem(item) : this.selectItem(item);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
handleFocus() {
|
|
140
|
+
if (this.open)
|
|
141
|
+
return;
|
|
142
|
+
this.emitEvent('igcFocus');
|
|
143
|
+
}
|
|
144
|
+
handleBlur() {
|
|
145
|
+
if (this.open)
|
|
146
|
+
return;
|
|
147
|
+
this.emitEvent('igcBlur');
|
|
148
|
+
}
|
|
149
|
+
onTargetTabKey() {
|
|
150
|
+
this.target.blur();
|
|
151
|
+
if (this.open)
|
|
152
|
+
this.hide();
|
|
153
|
+
}
|
|
154
|
+
onTargetEnterKey() {
|
|
155
|
+
!this.open ? this.target.click() : this.onEnterKey();
|
|
156
|
+
}
|
|
157
|
+
onTargetArrowLeftKeyDown() {
|
|
158
|
+
!this.open ? this.selectPrev() : this.onArrowUpKeyDown();
|
|
159
|
+
}
|
|
160
|
+
onTargetArrowRightKeyDown() {
|
|
161
|
+
!this.open ? this.selectNext() : this.onArrowDownKeyDown();
|
|
162
|
+
}
|
|
163
|
+
onTargetArrowUpKeyDown(event) {
|
|
164
|
+
if (event.altKey) {
|
|
165
|
+
this.toggle();
|
|
166
|
+
}
|
|
167
|
+
else {
|
|
168
|
+
!this.open ? this.selectPrev() : this.onArrowUpKeyDown();
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
onTargetArrowDownKeyDown(event) {
|
|
172
|
+
if (event.altKey) {
|
|
173
|
+
this.toggle();
|
|
174
|
+
}
|
|
175
|
+
else {
|
|
176
|
+
!this.open ? this.selectNext() : this.onArrowDownKeyDown();
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
onTargetHomeKey() {
|
|
180
|
+
!this.open ? this.selectInteractiveItem(0) : this.onHomeKey();
|
|
181
|
+
}
|
|
182
|
+
onTargetEndKey() {
|
|
183
|
+
!this.open ? this.selectInteractiveItem(-1) : this.onEndKey();
|
|
184
|
+
}
|
|
185
|
+
handleTargetKeyDown(event) {
|
|
186
|
+
var _a;
|
|
187
|
+
event.stopPropagation();
|
|
188
|
+
if (this.targetKeyHandlers.has(event.key)) {
|
|
189
|
+
event.preventDefault();
|
|
190
|
+
(_a = this.targetKeyHandlers.get(event.key)) === null || _a === void 0 ? void 0 : _a.call(this, event);
|
|
191
|
+
}
|
|
192
|
+
else {
|
|
193
|
+
this.searchItem(event);
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
get hasPrefixes() {
|
|
197
|
+
return this.inputPrefix.length > 0;
|
|
198
|
+
}
|
|
199
|
+
get hasSuffixes() {
|
|
200
|
+
return this.inputSuffix.length > 0;
|
|
201
|
+
}
|
|
202
|
+
render() {
|
|
203
|
+
var _a, _b;
|
|
204
|
+
return html `
|
|
205
|
+
<div
|
|
206
|
+
role="combobox"
|
|
207
|
+
tabindex=${this.disabled ? -1 : 0}
|
|
208
|
+
aria-owns="dropdown"
|
|
209
|
+
aria-describedby="helper-text"
|
|
210
|
+
aria-disabled=${this.disabled}
|
|
211
|
+
@focusin=${this.handleFocus}
|
|
212
|
+
@focusout=${this.handleBlur}
|
|
213
|
+
@keydown=${this.handleTargetKeyDown}
|
|
214
|
+
@click=${this.handleTargetClick}
|
|
215
|
+
>
|
|
216
|
+
<igc-input
|
|
217
|
+
id="input"
|
|
218
|
+
readonly
|
|
219
|
+
exportparts="container: input, input: native-input, label, prefix, suffix"
|
|
220
|
+
value=${ifDefined((_b = (_a = this.selectedItem) === null || _a === void 0 ? void 0 : _a.textContent) === null || _b === void 0 ? void 0 : _b.trim())}
|
|
221
|
+
placeholder=${ifDefined(this.placeholder)}
|
|
222
|
+
label=${ifDefined(this.label)}
|
|
223
|
+
size=${this.size}
|
|
224
|
+
dir=${this.dir}
|
|
225
|
+
tabindex="-1"
|
|
226
|
+
.disabled="${this.disabled}"
|
|
227
|
+
.required=${this.required}
|
|
228
|
+
.invalid=${this.invalid}
|
|
229
|
+
.outlined=${this.outlined}
|
|
230
|
+
@igcBlur=${(e) => e.stopPropagation()}
|
|
231
|
+
@igcFocus=${(e) => e.stopPropagation()}
|
|
232
|
+
>
|
|
233
|
+
<span slot=${this.hasPrefixes ? 'prefix' : ''}>
|
|
234
|
+
<slot name="prefix"></slot>
|
|
235
|
+
</span>
|
|
236
|
+
<span slot=${this.hasSuffixes ? 'suffix' : ''}>
|
|
237
|
+
<slot name="suffix"></slot>
|
|
238
|
+
</span>
|
|
239
|
+
<span slot="suffix" part="toggle-icon" style="display: flex">
|
|
240
|
+
<slot name="toggle-icon">
|
|
241
|
+
<igc-icon
|
|
242
|
+
size=${this.size}
|
|
243
|
+
name=${this.open ? 'keyboard_arrow_up' : 'keyboard_arrow_down'}
|
|
244
|
+
collection="internal"
|
|
245
|
+
aria-hidden="true"
|
|
246
|
+
></igc-icon>
|
|
247
|
+
</slot>
|
|
248
|
+
</span>
|
|
249
|
+
</igc-input>
|
|
250
|
+
</div>
|
|
251
|
+
<div
|
|
252
|
+
id="helper-text"
|
|
253
|
+
part="helper-text"
|
|
254
|
+
?hidden="${this.helperText.length === 0}"
|
|
255
|
+
>
|
|
256
|
+
<slot name="helper-text"></slot>
|
|
257
|
+
</div>
|
|
258
|
+
<div
|
|
259
|
+
part="base"
|
|
260
|
+
style=${styleMap({ position: this.positionStrategy })}
|
|
261
|
+
@click=${this.handleClick}
|
|
262
|
+
${this.toggleController.toggleDirective}
|
|
263
|
+
>
|
|
264
|
+
<div id="dropdown" role="listbox" part="list" aria-labelledby="input">
|
|
265
|
+
<slot name="header"></slot>
|
|
266
|
+
<slot></slot>
|
|
267
|
+
<slot name="footer"></slot>
|
|
268
|
+
</div>
|
|
269
|
+
</div>
|
|
270
|
+
`;
|
|
271
|
+
}
|
|
272
|
+
};
|
|
273
|
+
IgcSelectComponent.tagName = 'igc-select';
|
|
274
|
+
IgcSelectComponent.styles = styles;
|
|
275
|
+
__decorate([
|
|
276
|
+
queryAssignedElements({ flatten: true, selector: 'igc-select-item' })
|
|
277
|
+
], IgcSelectComponent.prototype, "items", void 0);
|
|
278
|
+
__decorate([
|
|
279
|
+
queryAssignedElements({ flatten: true, selector: 'igc-select-group' })
|
|
280
|
+
], IgcSelectComponent.prototype, "groups", void 0);
|
|
281
|
+
__decorate([
|
|
282
|
+
queryAssignedElements({ slot: 'helper-text' })
|
|
283
|
+
], IgcSelectComponent.prototype, "helperText", void 0);
|
|
284
|
+
__decorate([
|
|
285
|
+
queryAssignedElements({ slot: 'suffix' })
|
|
286
|
+
], IgcSelectComponent.prototype, "inputSuffix", void 0);
|
|
287
|
+
__decorate([
|
|
288
|
+
queryAssignedElements({ slot: 'prefix' })
|
|
289
|
+
], IgcSelectComponent.prototype, "inputPrefix", void 0);
|
|
290
|
+
__decorate([
|
|
291
|
+
state()
|
|
292
|
+
], IgcSelectComponent.prototype, "selectedItem", void 0);
|
|
293
|
+
__decorate([
|
|
294
|
+
query('div[role="combobox"]')
|
|
295
|
+
], IgcSelectComponent.prototype, "target", void 0);
|
|
296
|
+
__decorate([
|
|
297
|
+
property({ reflect: false, type: String })
|
|
298
|
+
], IgcSelectComponent.prototype, "value", void 0);
|
|
299
|
+
__decorate([
|
|
300
|
+
property()
|
|
301
|
+
], IgcSelectComponent.prototype, "name", void 0);
|
|
302
|
+
__decorate([
|
|
303
|
+
property({ reflect: true, type: Boolean })
|
|
304
|
+
], IgcSelectComponent.prototype, "disabled", void 0);
|
|
305
|
+
__decorate([
|
|
306
|
+
property({ reflect: true, type: Boolean })
|
|
307
|
+
], IgcSelectComponent.prototype, "required", void 0);
|
|
308
|
+
__decorate([
|
|
309
|
+
property({ reflect: true, type: Boolean })
|
|
310
|
+
], IgcSelectComponent.prototype, "invalid", void 0);
|
|
311
|
+
__decorate([
|
|
312
|
+
property({ reflect: true, type: Boolean })
|
|
313
|
+
], IgcSelectComponent.prototype, "outlined", void 0);
|
|
314
|
+
__decorate([
|
|
315
|
+
property({ type: Boolean })
|
|
316
|
+
], IgcSelectComponent.prototype, "autofocus", void 0);
|
|
317
|
+
__decorate([
|
|
318
|
+
property({ type: String })
|
|
319
|
+
], IgcSelectComponent.prototype, "label", void 0);
|
|
320
|
+
__decorate([
|
|
321
|
+
property({ type: String })
|
|
322
|
+
], IgcSelectComponent.prototype, "placeholder", void 0);
|
|
323
|
+
__decorate([
|
|
324
|
+
property({ type: Boolean, attribute: 'same-width' })
|
|
325
|
+
], IgcSelectComponent.prototype, "sameWidth", void 0);
|
|
326
|
+
__decorate([
|
|
327
|
+
property({ reflect: true })
|
|
328
|
+
], IgcSelectComponent.prototype, "dir", void 0);
|
|
329
|
+
__decorate([
|
|
330
|
+
watch('selectedItem')
|
|
331
|
+
], IgcSelectComponent.prototype, "updateValue", null);
|
|
332
|
+
__decorate([
|
|
333
|
+
watch('value')
|
|
334
|
+
], IgcSelectComponent.prototype, "updateSelected", null);
|
|
335
|
+
__decorate([
|
|
336
|
+
watch('value')
|
|
337
|
+
], IgcSelectComponent.prototype, "validate", null);
|
|
338
|
+
IgcSelectComponent = __decorate([
|
|
339
|
+
themes({ bootstrap, material, fluent, indigo }),
|
|
340
|
+
blazorAdditionalDependencies('IgcIconComponent, IgcInputComponent, IgcSelectGroupComponent, IgcSelectHeaderComponent, IgcSelectItemComponent')
|
|
341
|
+
], IgcSelectComponent);
|
|
342
|
+
export default IgcSelectComponent;
|
|
343
|
+
//# sourceMappingURL=select.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"select.js","sourceRoot":"","sources":["../../../src/components/select/select.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAC3B,OAAO,EACL,QAAQ,EACR,KAAK,EACL,qBAAqB,EACrB,KAAK,GACN,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACvD,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAChD,OAAO,EAAE,4BAA4B,EAAE,MAAM,sDAAsD,CAAC;AACpG,OAAO,EAAE,KAAK,EAAE,MAAM,+BAA+B,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,2CAA2C,CAAC;AAE7E,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AAEtE,OAAO,oBAEN,MAAM,yBAAyB,CAAC;AACjC,OAAO,gBAAgB,MAAM,iBAAiB,CAAC;AAC/C,OAAO,iBAAiB,MAAM,mBAAmB,CAAC;AAClD,OAAO,uBAAuB,MAAM,mBAAmB,CAAC;AACxD,OAAO,wBAAwB,MAAM,oBAAoB,CAAC;AAC1D,OAAO,sBAAsB,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAAE,MAAM,EAAE,MAAM,gCAAgC,CAAC;AACxD,OAAO,EAAE,MAAM,IAAI,SAAS,EAAE,MAAM,qCAAqC,CAAC;AAC1E,OAAO,EAAE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kB,kBAAkB;IA/BtC,MAAM,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;IAC/C,4BAA4B,CAC3B,gHAAgH,CACjH;GA4BoB,kBAAkB,CA2WtC;eA3WoB,kBAAkB","sourcesContent":["import { html } from 'lit';\nimport {\n property,\n query,\n queryAssignedElements,\n state,\n} from 'lit/decorators.js';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { styleMap } from 'lit/directives/style-map.js';\nimport { themes } from '../../theming/index.js';\nimport { blazorAdditionalDependencies } from '../common/decorators/blazorAdditionalDependencies.js';\nimport { watch } from '../common/decorators/watch.js';\nimport { defineComponents } from '../common/definitions/defineComponents.js';\nimport { Constructor } from '../common/mixins/constructor.js';\nimport { EventEmitterMixin } from '../common/mixins/event-emitter.js';\nimport IgcDropdownItemComponent from '../dropdown/dropdown-item.js';\nimport IgcDropdownComponent, {\n IgcDropdownEventMap,\n} from '../dropdown/dropdown.js';\nimport IgcIconComponent from '../icon/icon.js';\nimport IgcInputComponent from '../input/input.js';\nimport IgcSelectGroupComponent from './select-group.js';\nimport IgcSelectHeaderComponent from './select-header.js';\nimport IgcSelectItemComponent from './select-item.js';\nimport { styles } from './themes/light/select.base.css';\nimport { styles as bootstrap } from './themes/light/select.bootstrap.css';\nimport { styles as fluent } from './themes/light/select.fluent.css';\nimport { styles as indigo } from './themes/light/select.indigo.css';\nimport { styles as material } from './themes/light/select.material.css';\n\ndefineComponents(\n IgcIconComponent,\n IgcInputComponent,\n IgcSelectGroupComponent,\n IgcSelectHeaderComponent,\n IgcSelectItemComponent\n);\n\nexport interface IgcSelectEventMap extends IgcDropdownEventMap {\n igcFocus: CustomEvent<void>;\n igcBlur: CustomEvent<void>;\n}\n\n@themes({ bootstrap, material, fluent, indigo })\n@blazorAdditionalDependencies(\n 'IgcIconComponent, IgcInputComponent, IgcSelectGroupComponent, IgcSelectHeaderComponent, IgcSelectItemComponent'\n)\n/**\n * @element igc-select\n *\n * @slot - Renders the list of select items.\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 *\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 checked state changes.\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 list - The list of options wrapper.\n * @csspart input - The encapsulated igc-input.\n * @csspart label - The encapsulated text label.\n * @csspart prefix - The prefix wrapper.\n * @csspart suffix - The suffix wrapper.\n * @csspart toggle-icon - The toggle icon wrapper.\n * @csspart helper-text - The helper text wrapper.\n */\nexport default class IgcSelectComponent extends EventEmitterMixin<\n IgcSelectEventMap,\n Constructor<IgcDropdownComponent>\n>(IgcDropdownComponent) {\n /** @private */\n public static readonly tagName = 'igc-select';\n public static styles = styles;\n private searchTerm = '';\n private lastKeyTime = Date.now();\n\n private readonly targetKeyHandlers: Map<string, Function> = new Map(\n Object.entries({\n ' ': this.onTargetEnterKey,\n Tab: this.onTargetTabKey,\n Escape: this.onEscapeKey,\n Enter: this.onTargetEnterKey,\n ArrowLeft: this.onTargetArrowLeftKeyDown,\n ArrowRight: this.onTargetArrowRightKeyDown,\n ArrowUp: this.onTargetArrowUpKeyDown,\n ArrowDown: this.onTargetArrowDownKeyDown,\n Home: this.onTargetHomeKey,\n End: this.onTargetEndKey,\n })\n );\n\n @queryAssignedElements({ flatten: true, selector: 'igc-select-item' })\n protected override items!: Array<IgcSelectItemComponent>;\n\n @queryAssignedElements({ flatten: true, selector: 'igc-select-group' })\n protected override groups!: Array<IgcSelectGroupComponent>;\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 @state()\n protected override selectedItem!: IgcSelectItemComponent | null;\n\n @query('div[role=\"combobox\"]')\n protected override target!: IgcInputComponent;\n\n /** The value attribute of the control. */\n @property({ reflect: false, type: String })\n public value?: string | undefined;\n\n /** The name attribute of the control. */\n @property()\n public name!: string;\n\n /** The disabled attribute of the control. */\n @property({ reflect: true, type: Boolean })\n public disabled = false;\n\n /** The required attribute of the control. */\n @property({ reflect: true, type: Boolean })\n public required = false;\n\n /** The invalid attribute of the control. */\n @property({ reflect: true, type: Boolean })\n public invalid = false;\n\n /** The outlined attribute of the control. */\n @property({ reflect: true, type: Boolean })\n public outlined = false;\n\n /** The autofocus attribute of the control. */\n @property({ type: Boolean })\n public override autofocus!: boolean;\n\n /** The label attribute of the control. */\n @property({ type: String })\n public label!: string;\n\n /** The placeholder attribute of the control. */\n @property({ type: String })\n public placeholder!: string;\n\n /** Whether the dropdown's width should be the same as the target's one. */\n @property({ type: Boolean, attribute: 'same-width' })\n public override sameWidth = true;\n\n /** The direction attribute of the control. */\n @property({ reflect: true })\n public override dir: 'ltr' | 'rtl' | 'auto' = 'auto';\n\n constructor() {\n super();\n this.size = 'medium';\n\n /** Return the focus to the target element when closing the list of options. */\n this.addEventListener('igcClosing', () => this.target.focus());\n }\n\n /** Override the dropdown target focusout behavior to prevent the focus from\n * being returned to the target element when the select loses focus. */\n protected override handleFocusout() {}\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 /** Checks the validity of the control. */\n public reportValidity() {\n this.invalid = this.required && !this.value;\n if (this.invalid) this.target.focus();\n return !this.invalid;\n }\n\n public override async firstUpdated() {\n super.firstUpdated();\n await this.updateComplete;\n\n if (!this.selectedItem && this.value) {\n this.updateSelected();\n }\n\n if (this.autofocus) {\n this.target.focus();\n }\n }\n\n @watch('selectedItem')\n protected updateValue() {\n this.value = this.selectedItem?.value;\n }\n\n @watch('value')\n protected updateSelected() {\n if (this.allItems.length === 0) return;\n\n if (this.selectedItem?.value !== this.value) {\n const matches = this.allItems.filter((i) => i.value === this.value);\n const index = this.allItems.indexOf(\n matches.at(-1) as IgcSelectItemComponent\n );\n\n if (index === -1) {\n this.value = undefined;\n this.clearSelection();\n return;\n }\n\n this.select(index);\n }\n }\n\n @watch('value')\n protected validate() {\n this.updateComplete.then(() => this.reportValidity());\n }\n\n protected selectNext() {\n const activeItemIndex = [...this.allItems].indexOf(\n this.selectedItem ?? this.activeItem\n );\n\n const next = this.getNearestSiblingFocusableItemIndex(\n activeItemIndex ?? -1,\n 1\n );\n this.selectItem(this.allItems[next], true);\n }\n\n protected selectPrev() {\n const activeItemIndex = [...this.allItems].indexOf(\n this.selectedItem ?? this.activeItem\n );\n const prev = this.getNearestSiblingFocusableItemIndex(\n activeItemIndex ?? -1,\n -1\n );\n this.selectItem(this.allItems[prev], true);\n }\n\n protected selectInteractiveItem(index: number) {\n const item = this.allItems\n .filter((i) => !i.disabled)\n .at(index) as IgcDropdownItemComponent;\n\n if (item.value !== this.value) {\n this.selectItem(item, true);\n }\n }\n\n protected searchItem(event: KeyboardEvent): void {\n // ignore longer keys ('Alt', 'ArrowDown', etc)\n if (!/^.$/u.test(event.key)) {\n return;\n }\n\n const currentTime = Date.now();\n\n if (currentTime - this.lastKeyTime > 500) {\n this.searchTerm = '';\n }\n\n this.searchTerm += event.key;\n this.lastKeyTime = currentTime;\n\n const item = this.allItems\n .filter((i) => !i.disabled)\n .find((i) =>\n i.textContent\n ?.trim()\n .toLowerCase()\n .startsWith(this.searchTerm.toLowerCase())\n );\n\n if (item && this.value !== item.value) {\n this.open ? this.activateItem(item) : this.selectItem(item);\n }\n }\n\n protected handleFocus() {\n if (this.open) return;\n this.emitEvent('igcFocus');\n }\n\n protected handleBlur() {\n if (this.open) return;\n this.emitEvent('igcBlur');\n }\n\n protected onTargetTabKey() {\n this.target.blur();\n if (this.open) this.hide();\n }\n\n protected onTargetEnterKey() {\n !this.open ? this.target.click() : this.onEnterKey();\n }\n\n protected onTargetArrowLeftKeyDown() {\n !this.open ? this.selectPrev() : this.onArrowUpKeyDown();\n }\n\n protected onTargetArrowRightKeyDown() {\n !this.open ? this.selectNext() : this.onArrowDownKeyDown();\n }\n\n protected onTargetArrowUpKeyDown(event: KeyboardEvent) {\n if (event.altKey) {\n this.toggle();\n } else {\n !this.open ? this.selectPrev() : this.onArrowUpKeyDown();\n }\n }\n\n protected onTargetArrowDownKeyDown(event: KeyboardEvent) {\n if (event.altKey) {\n this.toggle();\n } else {\n !this.open ? this.selectNext() : this.onArrowDownKeyDown();\n }\n }\n\n protected onTargetHomeKey() {\n !this.open ? this.selectInteractiveItem(0) : this.onHomeKey();\n }\n\n protected onTargetEndKey() {\n !this.open ? this.selectInteractiveItem(-1) : this.onEndKey();\n }\n\n protected handleTargetKeyDown(event: KeyboardEvent) {\n event.stopPropagation();\n\n if (this.targetKeyHandlers.has(event.key)) {\n event.preventDefault();\n this.targetKeyHandlers.get(event.key)?.call(this, event);\n } else {\n this.searchItem(event);\n }\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 protected override render() {\n return html`\n <div\n role=\"combobox\"\n tabindex=${this.disabled ? -1 : 0}\n aria-owns=\"dropdown\"\n aria-describedby=\"helper-text\"\n aria-disabled=${this.disabled}\n @focusin=${this.handleFocus}\n @focusout=${this.handleBlur}\n @keydown=${this.handleTargetKeyDown}\n @click=${this.handleTargetClick}\n >\n <igc-input\n id=\"input\"\n readonly\n exportparts=\"container: input, input: native-input, label, prefix, suffix\"\n value=${ifDefined(this.selectedItem?.textContent?.trim())}\n placeholder=${ifDefined(this.placeholder)}\n label=${ifDefined(this.label)}\n size=${this.size}\n dir=${this.dir}\n tabindex=\"-1\"\n .disabled=\"${this.disabled}\"\n .required=${this.required}\n .invalid=${this.invalid}\n .outlined=${this.outlined}\n @igcBlur=${(e: Event) => e.stopPropagation()}\n @igcFocus=${(e: Event) => e.stopPropagation()}\n >\n <span slot=${this.hasPrefixes ? 'prefix' : ''}>\n <slot name=\"prefix\"></slot>\n </span>\n <span slot=${this.hasSuffixes ? 'suffix' : ''}>\n <slot name=\"suffix\"></slot>\n </span>\n <span slot=\"suffix\" part=\"toggle-icon\" style=\"display: flex\">\n <slot name=\"toggle-icon\">\n <igc-icon\n size=${this.size}\n name=${this.open ? 'keyboard_arrow_up' : 'keyboard_arrow_down'}\n collection=\"internal\"\n aria-hidden=\"true\"\n ></igc-icon>\n </slot>\n </span>\n </igc-input>\n </div>\n <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 <div\n part=\"base\"\n style=${styleMap({ position: this.positionStrategy })}\n @click=${this.handleClick}\n ${this.toggleController.toggleDirective}\n >\n <div id=\"dropdown\" role=\"listbox\" part=\"list\" aria-labelledby=\"input\">\n <slot name=\"header\"></slot>\n <slot></slot>\n <slot name=\"footer\"></slot>\n </div>\n </div>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'igc-select': IgcSelectComponent;\n }\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const styles: import("lit").CSSResult;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"select.bootstrap.css.js","sourceRoot":"","sources":["../../../../../src/components/select/themes/dark/select.bootstrap.css.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA,EAAE,CAAC","sourcesContent":["import { css } from 'lit';\n\nexport const styles = css``;\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const styles: import("lit").CSSResult;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"select.fluent.css.js","sourceRoot":"","sources":["../../../../../src/components/select/themes/dark/select.fluent.css.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA,EAAE,CAAC","sourcesContent":["import { css } from 'lit';\n\nexport const styles = css``;\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const styles: import("lit").CSSResult;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"select.indigo.css.js","sourceRoot":"","sources":["../../../../../src/components/select/themes/dark/select.indigo.css.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA,EAAE,CAAC","sourcesContent":["import { css } from 'lit';\n\nexport const styles = css``;\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const styles: import("lit").CSSResult;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"select.material.css.js","sourceRoot":"","sources":["../../../../../src/components/select/themes/dark/select.material.css.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA,EAAE,CAAC","sourcesContent":["import { css } from 'lit';\n\nexport const styles = css``;\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const styles: import("lit").CSSResult;
|