igniteui-webcomponents 4.3.0-beta.0 → 4.3.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 +37 -9
- package/components/combo/combo.d.ts +7 -7
- package/components/combo/combo.js +5 -2
- package/components/combo/combo.js.map +1 -1
- package/components/combo/controllers/selection.d.ts +2 -3
- package/components/combo/controllers/selection.js +4 -27
- package/components/combo/controllers/selection.js.map +1 -1
- package/components/combo/types.d.ts +4 -3
- package/components/combo/types.js.map +1 -1
- package/components/date-time-input/date-util.js +3 -3
- package/components/date-time-input/date-util.js.map +1 -1
- package/components/dropdown/dropdown.d.ts +1 -1
- package/components/dropdown/dropdown.js.map +1 -1
- package/components/expansion-panel/expansion-panel.d.ts +1 -1
- package/components/expansion-panel/expansion-panel.js.map +1 -1
- package/components/select/select.d.ts +11 -2
- package/components/select/select.js +4 -0
- package/components/select/select.js.map +1 -1
- package/components/snackbar/snackbar.d.ts +1 -1
- package/components/snackbar/snackbar.js.map +1 -1
- package/components/stepper/step.d.ts +1 -0
- package/components/stepper/step.js.map +1 -1
- package/components/toast/toast.d.ts +1 -1
- package/components/toast/toast.js.map +1 -1
- package/custom-elements.json +2 -57
- package/package.json +1 -1
- package/vscode-html-custom-data.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,21 +1,48 @@
|
|
|
1
1
|
# Ignite UI Web Components Changelog
|
|
2
|
-
|
|
3
2
|
All notable changes to this project will be documented in this file.
|
|
4
3
|
|
|
5
4
|
The format is based on [Keep a Changelog](http://keepachangelog.com/)
|
|
6
5
|
and this project adheres to [Semantic Versioning](http://semver.org/).
|
|
7
6
|
|
|
8
|
-
## [
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
## [4.3.0] - 2023-06-28
|
|
8
|
+
### Added
|
|
9
|
+
- Combo: Added `matchDiacritics` to the filtering options property. Defaults to `false`.
|
|
10
|
+
If set to `true` the filter distinguishes between accented letters and
|
|
11
|
+
their base letters. Otherwise strings are normalized and then matched.
|
|
12
|
+
- Combo: Added `selection` property which returns the current selection as an array of data objects.
|
|
13
|
+
- Card: Support explicit height
|
|
14
|
+
- Dialog: Added animations
|
|
15
|
+
- Snackbar: Added animations
|
|
16
|
+
- Toast: Added animations
|
|
11
17
|
|
|
12
|
-
|
|
18
|
+
### Changed
|
|
19
|
+
- Combo: `value` is no longer readonly and can be explicitly set. The value attribute also supports declarative binding,
|
|
20
|
+
accepting a valid JSON stringified array.
|
|
21
|
+
- Combo: `value` type changed from `string[]` to `ComboValue<T>[]` where
|
|
22
|
+
```ts
|
|
23
|
+
ComboValue<T> = T | T[keyof T]
|
|
24
|
+
```
|
|
25
|
+
- Combo: `igcChange` event object properties are also changed to reflect tee new `value` type:
|
|
26
|
+
```typescript
|
|
27
|
+
interface IgcComboChangeEventArgs<T> {
|
|
28
|
+
newValue: ComboValue<T>[];
|
|
29
|
+
items: T[];
|
|
30
|
+
type: ComboChangeType;
|
|
31
|
+
}
|
|
32
|
+
```
|
|
13
33
|
|
|
14
|
-
###
|
|
34
|
+
### Deprecated
|
|
35
|
+
- Select: Deprecated `sameWidth`, `positionStrategy` and `flip`. They will be removed in the next major release.
|
|
15
36
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
37
|
+
### Fixed
|
|
38
|
+
- Select: prefix/suffix/helper-text slots not being rendered [#722](https://github.com/IgniteUI/igniteui-webcomponents/issues/722)
|
|
39
|
+
- Tabs: Nested tabs selection [#713](https://github.com/IgniteUI/igniteui-webcomponents/issues/713)
|
|
40
|
+
- Dialog: Backdrop doesn't overlay elements [#727](https://github.com/IgniteUI/igniteui-webcomponents/issues/727)
|
|
41
|
+
- Dropdown: Listbox position on initial open state [#723](https://github.com/IgniteUI/igniteui-webcomponents/issues/723)
|
|
42
|
+
- Stepper: Stretch vertically in parent container [#738](https://github.com/IgniteUI/igniteui-webcomponents/issues/738)
|
|
43
|
+
- Navbar: Wrong colors in fluent theme [#719](https://github.com/IgniteUI/igniteui-webcomponents/issues/719)
|
|
44
|
+
- Animation player throws errors when height is unspecified [#793](https://github.com/IgniteUI/igniteui-webcomponents/issues/793)
|
|
45
|
+
- DateTimeInput: Intl.DateTimeFormat issues in Chromium based browsers [#803](https://github.com/IgniteUI/igniteui-webcomponents/issues/803)
|
|
19
46
|
|
|
20
47
|
## [4.2.3] - 2023-04-03
|
|
21
48
|
### Deprecated
|
|
@@ -244,6 +271,7 @@ Initial release of Ignite UI Web Components
|
|
|
244
271
|
- Ripple component
|
|
245
272
|
- Switch component
|
|
246
273
|
|
|
274
|
+
[4.3.0]: https://github.com/IgniteUI/igniteui-webcomponents/compare/4.2.3...4.3.0
|
|
247
275
|
[4.2.3]: https://github.com/IgniteUI/igniteui-webcomponents/compare/4.2.2...4.2.3
|
|
248
276
|
[4.2.2]: https://github.com/IgniteUI/igniteui-webcomponents/compare/4.2.1...4.2.2
|
|
249
277
|
[4.2.1]: https://github.com/IgniteUI/igniteui-webcomponents/compare/4.2.0...4.2.1
|
|
@@ -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, ComboRecord, GroupingDirection, FilteringOptions, IgcComboEventMap, ComboItemTemplate, ComboRenderFunction, Item } from './types.js';
|
|
8
|
+
import type { Keys, ComboRecord, GroupingDirection, FilteringOptions, IgcComboEventMap, ComboItemTemplate, ComboRenderFunction, Item, ComboValue } 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>;
|
|
@@ -51,7 +51,7 @@ declare const IgcComboComponent_base: import("../common/mixins/constructor.js").
|
|
|
51
51
|
* @csspart footer - The container holding the footer content.
|
|
52
52
|
* @csspart empty - The container holding the empty content.
|
|
53
53
|
*/
|
|
54
|
-
export default class IgcComboComponent<T extends object> extends IgcComboComponent_base implements Partial<IgcToggleComponent> {
|
|
54
|
+
export default class IgcComboComponent<T extends object = any> extends IgcComboComponent_base implements Partial<IgcToggleComponent> {
|
|
55
55
|
static readonly tagName = "igc-combo";
|
|
56
56
|
static styles: import("lit").CSSResult;
|
|
57
57
|
private _value;
|
|
@@ -191,12 +191,12 @@ export default class IgcComboComponent<T extends object> extends IgcComboCompone
|
|
|
191
191
|
groupHeaderTemplate: ComboItemTemplate<T>;
|
|
192
192
|
/**
|
|
193
193
|
* Sets the component's positioning strategy.
|
|
194
|
-
* @hidden @internal
|
|
194
|
+
* @hidden @internal @private
|
|
195
195
|
*/
|
|
196
196
|
positionStrategy: 'absolute' | 'fixed';
|
|
197
197
|
/**
|
|
198
198
|
* Whether the dropdown's width should be the same as the target's one.
|
|
199
|
-
* @hidden @internal
|
|
199
|
+
* @hidden @internal @private
|
|
200
200
|
*/
|
|
201
201
|
sameWidth: boolean;
|
|
202
202
|
protected dataState: Array<ComboRecord<T>>;
|
|
@@ -238,12 +238,12 @@ export default class IgcComboComponent<T extends object> extends IgcComboCompone
|
|
|
238
238
|
* </igc-combo>
|
|
239
239
|
* ```
|
|
240
240
|
*/
|
|
241
|
-
set value(items:
|
|
241
|
+
set value(items: ComboValue<T>[]);
|
|
242
242
|
/**
|
|
243
243
|
* Returns the current selection as a list of commma separated values,
|
|
244
244
|
* represented by the value key, when provided.
|
|
245
245
|
*/
|
|
246
|
-
get value():
|
|
246
|
+
get value(): ComboValue<T>[];
|
|
247
247
|
protected updateValue(): Promise<void>;
|
|
248
248
|
protected validate(): void;
|
|
249
249
|
/** Checks the validity of the control. */
|
|
@@ -258,7 +258,7 @@ export default class IgcComboComponent<T extends object> extends IgcComboCompone
|
|
|
258
258
|
/**
|
|
259
259
|
* Returns the current selection as an array of objects as provided in the `data` source.
|
|
260
260
|
*/
|
|
261
|
-
get selection(): T
|
|
261
|
+
get selection(): Array<T>;
|
|
262
262
|
/**
|
|
263
263
|
* Selects option(s) in the list by either reference or valueKey.
|
|
264
264
|
* If not argument is provided all items will be selected.
|
|
@@ -195,8 +195,11 @@ let IgcComboComponent = class IgcComboComponent extends EventEmitterMixin(LitEle
|
|
|
195
195
|
return this._value;
|
|
196
196
|
}
|
|
197
197
|
async updateValue() {
|
|
198
|
-
|
|
199
|
-
this.
|
|
198
|
+
const selected = Array.from(this.selectionController.selected);
|
|
199
|
+
this._value = this.selectionController.getValue(selected, this.valueKey);
|
|
200
|
+
this._displayValue = this.selectionController
|
|
201
|
+
.getValue(selected, this.displayKey)
|
|
202
|
+
.join(', ');
|
|
200
203
|
await this.updateComplete;
|
|
201
204
|
this.target.value = this._displayValue;
|
|
202
205
|
this.list.requestUpdate();
|
|
@@ -1 +1 @@
|
|
|
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,QAAQ,EAAE,MAAM,6BAA6B,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,C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AE,MAAM,EAAE,CAAC;IAC/C,4BAA4B,CAAC,qCAAqC,CAAC;IACnE,oBAAoB;GAEA,iBAAiB,CAi2BrC;eAj2BoB,iBAAiB","sourcesContent":["import { html, LitElement, TemplateResult } from 'lit';\nimport { styleMap } from 'lit/directives/style-map.js';\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 ComboRenderFunction,\n Item,\n} from './types.js';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { partNameMap } from '../common/util.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';\nimport { blazorIndirectRender } from '../common/decorators/blazorIndirectRender.js';\n\ndefineComponents(\n IgcIconComponent,\n IgcComboListComponent,\n IgcComboItemComponent,\n IgcComboHeaderComponent,\n IgcInputComponent\n);\n\n/* blazorSupportsVisualChildren */\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('IgcIconComponent, IgcInputComponent')\n@blazorIndirectRender\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: string[] = [];\n private _displayValue = '';\n private _filteringOptions: FilteringOptions<T> = {\n filterKey: this.displayKey,\n caseSensitive: false,\n matchDiacritics: false,\n };\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 /* treatAsRef */\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 * @param matchDiacritics -If true, the filter distinguishes between accented letters and their base letters.\n */\n @property({ attribute: 'filtering-options', type: Object })\n public get filteringOptions(): FilteringOptions<T> {\n return this._filteringOptions;\n }\n\n public set filteringOptions(value: Partial<FilteringOptions<T>>) {\n this._filteringOptions = { ...this._filteringOptions, ...value };\n this.requestUpdate('pipeline');\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 /* blazorSuppress */\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 /* blazorSuppress */\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 /**\n * Sets the component's positioning strategy.\n * @hidden @internal\n */\n public positionStrategy: 'absolute' | 'fixed' = 'fixed';\n\n /**\n * Whether the dropdown's width should be the same as the target's one.\n * @hidden @internal\n */\n public sameWidth = true;\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 if (!this.filteringOptions.filterKey) {\n this.filteringOptions = { filterKey: this.displayKey };\n }\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 @watch('value')\n protected selectItems() {\n if (!this._value || this.value.length === 0) {\n this.selectionController.deselect([]);\n } else {\n this.selectionController.deselect([]);\n this.selectionController.select(this._value as Item<T>[]);\n }\n\n this.updateValue();\n }\n\n /**\n * Sets the value (selected items). The passed value must be a valid JSON array.\n * If the data source is an array of complex objects, the `valueKey` attribute must be set.\n * Note that when `displayKey` is not explicitly set, it will fall back to the value of `valueKey`.\n *\n * @attr value\n *\n * @example\n * ```tsx\n * <igc-combo\n * .data=${[\n * {\n * id: 'BG01',\n * name: 'Sofia'\n * },\n * {\n * id: 'BG02',\n * name: 'Plovdiv'\n * }\n * ]}\n * display-key='name'\n * value-key='id'\n * value='[\"BG01\", \"BG02\"]'>\n * </igc-combo>\n * ```\n */\n public set value(items: string[]) {\n const oldValue = this._value;\n this._value = items;\n this.requestUpdate('value', oldValue);\n }\n\n /**\n * Returns the current selection as a list of commma separated values,\n * represented by the value key, when provided.\n */\n @property({ attribute: true, type: Array })\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 this._displayValue = this.selectionController.getDisplayValue(\n Array.from(this.selectionController.selected)\n );\n\n await this.updateComplete;\n this.target.value = this._displayValue;\n this.list.requestUpdate();\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.length === 0;\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 /* alternateName: focusComponent */\n /** Sets focus on the component. */\n public override focus(options?: FocusOptions) {\n this.target.focus(options);\n }\n\n /* alternateName: blurComponent */\n /** Removes focus from the component. */\n public override blur() {\n this.target.blur();\n super.blur();\n }\n\n protected normalizeSelection(items: Item<T> | Item<T>[] = []): Item<T>[] {\n return Array.isArray(items) ? items : [items];\n }\n\n /**\n * Returns the current selection as an array of objects as provided in the `data` source.\n */\n public get selection() {\n return Array.from(this.selectionController.selected.values());\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.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.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 matchIndex = this.dataState.findIndex((i) => !i.header);\n this.navigationController.active = e.detail.length > 0 ? matchIndex : -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: ComboRenderFunction<T> = (\n item: ComboRecord<T>,\n index: number\n ): TemplateResult => {\n const record = item;\n const dataItem = this.data.at(record.dataIndex);\n const active = this.navigationController.active === index;\n const selected = this.selectionController.selected.has(dataItem!);\n const headerTemplate = html`<igc-combo-header part=\"group-header\"\n >${this.groupHeaderTemplate({ item: record.value })}</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.value })}</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 const { dataIndex } = this.dataState.at(index)!;\n\n this.selectionController.changeSelection(dataIndex);\n this.navigationController.active = index;\n this.updateValue();\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 }\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 = {\n caseSensitive: !this.filteringOptions.caseSensitive,\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 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-controls=\"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 style=${styleMap({ position: this.positionStrategy })}\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"]}
|
|
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,QAAQ,EAAE,MAAM,6BAA6B,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,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BoB,iBAAiB","sourcesContent":["import { html, LitElement, TemplateResult } from 'lit';\nimport { styleMap } from 'lit/directives/style-map.js';\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 type {\n Keys,\n ComboRecord,\n GroupingDirection,\n FilteringOptions,\n IgcComboEventMap,\n ComboItemTemplate,\n ComboRenderFunction,\n Item,\n ComboValue,\n} from './types.js';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { partNameMap } from '../common/util.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';\nimport { blazorIndirectRender } from '../common/decorators/blazorIndirectRender.js';\n\ndefineComponents(\n IgcIconComponent,\n IgcComboListComponent,\n IgcComboItemComponent,\n IgcComboHeaderComponent,\n IgcInputComponent\n);\n\n/* blazorSupportsVisualChildren */\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('IgcIconComponent, IgcInputComponent')\n@blazorIndirectRender\n// TODO: pressing arrow down should scroll to the selected item\nexport default class IgcComboComponent<T extends object = any>\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: ComboValue<T>[] = [];\n private _displayValue = '';\n private _filteringOptions: FilteringOptions<T> = {\n filterKey: this.displayKey,\n caseSensitive: false,\n matchDiacritics: false,\n };\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 /* treatAsRef */\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 * @param matchDiacritics -If true, the filter distinguishes between accented letters and their base letters.\n */\n @property({ attribute: 'filtering-options', type: Object })\n public get filteringOptions(): FilteringOptions<T> {\n return this._filteringOptions;\n }\n\n public set filteringOptions(value: Partial<FilteringOptions<T>>) {\n this._filteringOptions = { ...this._filteringOptions, ...value };\n this.requestUpdate('pipeline');\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 /* blazorSuppress */\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 /* blazorSuppress */\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 /**\n * Sets the component's positioning strategy.\n * @hidden @internal @private\n */\n public positionStrategy: 'absolute' | 'fixed' = 'fixed';\n\n /**\n * Whether the dropdown's width should be the same as the target's one.\n * @hidden @internal @private\n */\n public sameWidth = true;\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 if (!this.filteringOptions.filterKey) {\n this.filteringOptions = { filterKey: this.displayKey };\n }\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 @watch('value')\n protected selectItems() {\n if (!this._value || this.value.length === 0) {\n this.selectionController.deselect([]);\n } else {\n this.selectionController.deselect([]);\n this.selectionController.select(this._value as Item<T>[]);\n }\n\n this.updateValue();\n }\n\n /**\n * Sets the value (selected items). The passed value must be a valid JSON array.\n * If the data source is an array of complex objects, the `valueKey` attribute must be set.\n * Note that when `displayKey` is not explicitly set, it will fall back to the value of `valueKey`.\n *\n * @attr value\n *\n * @example\n * ```tsx\n * <igc-combo\n * .data=${[\n * {\n * id: 'BG01',\n * name: 'Sofia'\n * },\n * {\n * id: 'BG02',\n * name: 'Plovdiv'\n * }\n * ]}\n * display-key='name'\n * value-key='id'\n * value='[\"BG01\", \"BG02\"]'>\n * </igc-combo>\n * ```\n */\n public set value(items: ComboValue<T>[]) {\n const oldValue = this._value;\n this._value = items;\n this.requestUpdate('value', oldValue);\n }\n\n /**\n * Returns the current selection as a list of commma separated values,\n * represented by the value key, when provided.\n */\n @property({ attribute: true, type: Array })\n public get value() {\n return this._value;\n }\n\n protected async updateValue() {\n const selected = Array.from(this.selectionController.selected);\n\n this._value = this.selectionController.getValue(selected, this.valueKey!);\n this._displayValue = this.selectionController\n .getValue(selected, this.displayKey!)\n .join(', ');\n\n await this.updateComplete;\n this.target.value = this._displayValue;\n this.list.requestUpdate();\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.length === 0;\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 /* alternateName: focusComponent */\n /** Sets focus on the component. */\n public override focus(options?: FocusOptions) {\n this.target.focus(options);\n }\n\n /* alternateName: blurComponent */\n /** Removes focus from the component. */\n public override blur() {\n this.target.blur();\n super.blur();\n }\n\n protected normalizeSelection(items: Item<T> | Item<T>[] = []): Item<T>[] {\n return Array.isArray(items) ? items : [items];\n }\n\n /**\n * Returns the current selection as an array of objects as provided in the `data` source.\n */\n public get selection(): Array<T> {\n return Array.from(this.selectionController.selected.values());\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.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.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 matchIndex = this.dataState.findIndex((i) => !i.header);\n this.navigationController.active = e.detail.length > 0 ? matchIndex : -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: ComboRenderFunction<T> = (\n item: ComboRecord<T>,\n index: number\n ): TemplateResult => {\n const record = item;\n const dataItem = this.data.at(record.dataIndex);\n const active = this.navigationController.active === index;\n const selected = this.selectionController.selected.has(dataItem!);\n const headerTemplate = html`<igc-combo-header part=\"group-header\"\n >${this.groupHeaderTemplate({ item: record.value })}</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.value })}</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 const { dataIndex } = this.dataState.at(index)!;\n\n this.selectionController.changeSelection(dataIndex);\n this.navigationController.active = index;\n this.updateValue();\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 }\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 = {\n caseSensitive: !this.filteringOptions.caseSensitive,\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 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-controls=\"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 style=${styleMap({ position: this.positionStrategy })}\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"]}
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { ReactiveController } from 'lit';
|
|
2
|
-
import { ComboHost, Item } from '../types.js';
|
|
2
|
+
import type { ComboHost, ComboValue, Item, Keys } from '../types.js';
|
|
3
3
|
export declare class SelectionController<T extends object> implements ReactiveController {
|
|
4
4
|
protected host: ComboHost<T>;
|
|
5
5
|
private _selected;
|
|
6
6
|
get data(): T[];
|
|
7
7
|
resetSearchTerm(): void;
|
|
8
|
-
getValue(items: T[]):
|
|
9
|
-
getDisplayValue(items: T[]): string;
|
|
8
|
+
getValue(items: T[], key: Keys<T>): ComboValue<T>[];
|
|
10
9
|
private handleChange;
|
|
11
10
|
private getItemsByValueKey;
|
|
12
11
|
private selectValueKeys;
|
|
@@ -5,31 +5,8 @@ export class SelectionController {
|
|
|
5
5
|
resetSearchTerm() {
|
|
6
6
|
this.host.resetSearchTerm();
|
|
7
7
|
}
|
|
8
|
-
getValue(items) {
|
|
9
|
-
return items.map((
|
|
10
|
-
var _a;
|
|
11
|
-
if (typeof value === 'object' && value !== null) {
|
|
12
|
-
const key = (_a = this.host.valueKey) !== null && _a !== void 0 ? _a : this.host.displayKey;
|
|
13
|
-
return key ? String(value[key]) : String(value);
|
|
14
|
-
}
|
|
15
|
-
else {
|
|
16
|
-
return String(value);
|
|
17
|
-
}
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
getDisplayValue(items) {
|
|
21
|
-
return items
|
|
22
|
-
.map((value) => {
|
|
23
|
-
if (typeof value === 'object' && value !== null) {
|
|
24
|
-
return this.host.displayKey
|
|
25
|
-
? String(value[this.host.displayKey])
|
|
26
|
-
: String(value);
|
|
27
|
-
}
|
|
28
|
-
else {
|
|
29
|
-
return String(value);
|
|
30
|
-
}
|
|
31
|
-
})
|
|
32
|
-
.join(', ');
|
|
8
|
+
getValue(items, key) {
|
|
9
|
+
return items.map((item) => { var _a; return (_a = item[key]) !== null && _a !== void 0 ? _a : item; });
|
|
33
10
|
}
|
|
34
11
|
handleChange(detail) {
|
|
35
12
|
this.host.requestUpdate('value');
|
|
@@ -100,7 +77,7 @@ export class SelectionController {
|
|
|
100
77
|
const payload = [...values, ...selected];
|
|
101
78
|
if (emit &&
|
|
102
79
|
!this.handleChange({
|
|
103
|
-
newValue: this.getValue(payload),
|
|
80
|
+
newValue: this.getValue(payload, this.host.valueKey),
|
|
104
81
|
items: values,
|
|
105
82
|
type: 'selection',
|
|
106
83
|
})) {
|
|
@@ -136,7 +113,7 @@ export class SelectionController {
|
|
|
136
113
|
const payload = selected.filter((item) => item !== values[0]);
|
|
137
114
|
if (emit &&
|
|
138
115
|
!this.handleChange({
|
|
139
|
-
newValue: this.getValue(payload),
|
|
116
|
+
newValue: this.getValue(payload, this.host.valueKey),
|
|
140
117
|
items: values,
|
|
141
118
|
type: 'deselection',
|
|
142
119
|
})) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"selection.js","sourceRoot":"","sources":["../../../../src/components/combo/controllers/selection.ts"],"names":[],"mappings":"AAGA,MAAM,OAAO,mBAAmB;IAK9B,IAAW,IAAI;QACb,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC;IACxB,CAAC;IAEM,eAAe;QAEpB,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE,CAAC;IAC9B,CAAC;IAEM,QAAQ,CAAC,KAAU;QACxB,OAAO,KAAK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AAG,CAAC,IAAI,CAAC;gBACtB,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC;gBAC3B,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,CAAC;SACjC;IACH,CAAC;IAED,YAAsB,IAAkB;QAAlB,SAAI,GAAJ,IAAI,CAAc;QA1MhC,cAAS,GAAW,IAAI,GAAG,EAAE,CAAC;QA2MpC,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;IAChC,CAAC;IAEM,aAAa,KAAI,CAAC;IAElB,gBAAgB,KAAI,CAAC;CAC7B","sourcesContent":["import { ReactiveController } from 'lit';\nimport { ComboHost, Values, IgcComboChangeEventArgs, Item } from '../types.js';\n\nexport class SelectionController<T extends object>\n implements ReactiveController\n{\n private _selected: Set<T> = new Set();\n\n public get data() {\n return this.host.data;\n }\n\n public resetSearchTerm() {\n // @ts-expect-error protected access\n this.host.resetSearchTerm();\n }\n\n public getValue(items: T[]) {\n return items.map((value) => {\n if (typeof value === 'object' && value !== null) {\n const key = this.host.valueKey ?? this.host.displayKey;\n return key ? String(value[key]) : String(value);\n } else {\n return String(value);\n }\n });\n }\n\n public getDisplayValue(items: T[]) {\n return items\n .map((value) => {\n if (typeof value === 'object' && value !== null) {\n return this.host.displayKey\n ? String(value[this.host.displayKey])\n : String(value);\n } else {\n return String(value);\n }\n })\n .join(', ');\n }\n\n private handleChange(detail: IgcComboChangeEventArgs) {\n this.host.requestUpdate('value');\n return this.host.emitEvent('igcChange', { cancelable: true, detail });\n }\n\n private getItemsByValueKey(keys: Values<T>[]) {\n return keys.map((key) =>\n this.data.find((i) => i[this.host.valueKey!] === key)\n );\n }\n\n private selectValueKeys(keys: Values<T>[]) {\n if (keys.length === 0) return;\n\n this.getItemsByValueKey(keys).forEach((item) => {\n return item && this._selected.add(item);\n });\n }\n\n private deselectValueKeys(keys: Values<T>[]) {\n if (keys.length === 0) return;\n\n this.getItemsByValueKey(keys).forEach((item) => {\n return item && this._selected.delete(item);\n });\n }\n\n private selectObjects(items: T[]) {\n if (items.length === 0) return;\n\n items.forEach((item) => {\n const i = this.data.includes(item);\n if (i) {\n this._selected.add(item);\n }\n });\n }\n\n private deselectObjects(items: T[]) {\n if (items.length === 0) return;\n\n items.forEach((item) => {\n const i = this.data.includes(item);\n if (i) {\n this._selected.delete(item);\n }\n });\n }\n\n private selectAll() {\n this.data.forEach((item) => {\n this._selected.add(item);\n });\n this.host.requestUpdate();\n }\n\n private deselectAll() {\n this._selected.clear();\n this.host.requestUpdate();\n }\n\n public async select(items?: Item<T>[], emit = false) {\n const { singleSelect } = this.host;\n\n if (singleSelect) {\n this._selected.clear();\n this.resetSearchTerm();\n }\n\n if (!items || items.length === 0) {\n !singleSelect && this.selectAll();\n return;\n }\n\n const _items = singleSelect ? items.slice(0, 1) : items;\n\n const values = this.host.valueKey\n ? this.getItemsByValueKey(_items as Values<T>[])\n : _items;\n const selected = Array.from(this._selected.values());\n const payload = [...values, ...selected] as T[];\n\n if (\n emit &&\n !this.handleChange({\n newValue: this.getValue(payload),\n items: values as T[],\n type: 'selection',\n })\n ) {\n return;\n }\n\n if (this.host.valueKey) {\n this.selectValueKeys(_items as Values<T>[]);\n } else {\n this.selectObjects(_items as T[]);\n }\n\n this.host.requestUpdate();\n }\n\n public async deselect(items?: Item<T>[], emit = false) {\n const { singleSelect } = this.host;\n\n if (!items || items.length === 0) {\n if (\n emit &&\n !this.handleChange({\n newValue: [],\n items: Array.from(this.selected),\n type: 'deselection',\n })\n ) {\n return;\n }\n\n !singleSelect && this.deselectAll();\n return;\n }\n\n const _items = this.host.singleSelect ? items.slice(0, 1) : items;\n const values = this.host.valueKey\n ? this.getItemsByValueKey(_items as Values<T>[])\n : _items;\n const selected = Array.from(this._selected.values());\n const payload = selected.filter((item) => item !== values[0]);\n\n if (\n emit &&\n !this.handleChange({\n newValue: this.getValue(payload),\n items: values as T[],\n type: 'deselection',\n })\n ) {\n return;\n }\n\n if (this.host.valueKey) {\n this.deselectValueKeys(_items as Values<T>[]);\n } else {\n this.deselectObjects(_items as T[]);\n }\n\n this.host.requestUpdate();\n }\n\n public get selected(): Set<T> {\n return this._selected;\n }\n\n public changeSelection(index: number) {\n const item = this.data[index];\n\n if (this.host.valueKey) {\n !this.selected.has(item)\n ? this.select([item[this.host.valueKey]], true)\n : this.deselect([item[this.host.valueKey]], true);\n } else {\n !this.selected.has(item)\n ? this.select([item], true)\n : this.deselect([item], true);\n }\n }\n\n constructor(protected host: ComboHost<T>) {\n this.host.addController(this);\n }\n\n public hostConnected() {}\n\n public hostDisconnected() {}\n}\n"]}
|
|
1
|
+
{"version":3,"file":"selection.js","sourceRoot":"","sources":["../../../../src/components/combo/controllers/selection.ts"],"names":[],"mappings":"AAUA,MAAM,OAAO,mBAAmB;IAK9B,IAAW,IAAI;QACb,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC;IACxB,CAAC;IAEM,eAAe;QAEpB,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE,CAAC;IAC9B,CAAC;IAEM,QAAQ,CAAC,KAAU,EAAE,GAAY;QACtC,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,WAAC,OAAA,MAAA,IAAI,CAAC,GAAG,CAAC,mCAAI,IAAI,CAAA,EAAA,CAAC,CAAC;IAChD,CAAC;IAEO,YAAY,CAAC,MAA+B;QAClD,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;QACjC,OAAO,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,WAAW,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC;IACxE,CAAC;IAEO,kBAAkB,CAAC,IAAiB;QAC1C,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CACtB,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CA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,CAAC,CAAC;SACrD;aAAM;YACL,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC;gBACtB,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC;gBAC3B,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,CAAC;SACjC;IACH,CAAC;IAED,YAAsB,IAAkB;QAAlB,SAAI,GAAJ,IAAI,CAAc;QArLhC,cAAS,GAAW,IAAI,GAAG,EAAE,CAAC;QAsLpC,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;IAChC,CAAC;IAEM,aAAa,KAAI,CAAC;IAElB,gBAAgB,KAAI,CAAC;CAC7B","sourcesContent":["import { ReactiveController } from 'lit';\nimport type {\n ComboHost,\n ComboValue,\n IgcComboChangeEventArgs,\n Item,\n Keys,\n Values,\n} from '../types.js';\n\nexport class SelectionController<T extends object>\n implements ReactiveController\n{\n private _selected: Set<T> = new Set();\n\n public get data() {\n return this.host.data;\n }\n\n public resetSearchTerm() {\n // @ts-expect-error protected access\n this.host.resetSearchTerm();\n }\n\n public getValue(items: T[], key: Keys<T>): ComboValue<T>[] {\n return items.map((item) => item[key] ?? item);\n }\n\n private handleChange(detail: IgcComboChangeEventArgs) {\n this.host.requestUpdate('value');\n return this.host.emitEvent('igcChange', { cancelable: true, detail });\n }\n\n private getItemsByValueKey(keys: Values<T>[]) {\n return keys.map((key) =>\n this.data.find((i) => i[this.host.valueKey!] === key)\n );\n }\n\n private selectValueKeys(keys: Values<T>[]) {\n if (keys.length === 0) return;\n\n this.getItemsByValueKey(keys).forEach((item) => {\n return item && this._selected.add(item);\n });\n }\n\n private deselectValueKeys(keys: Values<T>[]) {\n if (keys.length === 0) return;\n\n this.getItemsByValueKey(keys).forEach((item) => {\n return item && this._selected.delete(item);\n });\n }\n\n private selectObjects(items: T[]) {\n if (items.length === 0) return;\n\n items.forEach((item) => {\n const i = this.data.includes(item);\n if (i) {\n this._selected.add(item);\n }\n });\n }\n\n private deselectObjects(items: T[]) {\n if (items.length === 0) return;\n\n items.forEach((item) => {\n const i = this.data.includes(item);\n if (i) {\n this._selected.delete(item);\n }\n });\n }\n\n private selectAll() {\n this.data.forEach((item) => {\n this._selected.add(item);\n });\n this.host.requestUpdate();\n }\n\n private deselectAll() {\n this._selected.clear();\n this.host.requestUpdate();\n }\n\n public async select(items?: Item<T>[], emit = false) {\n const { singleSelect } = this.host;\n\n if (singleSelect) {\n this._selected.clear();\n this.resetSearchTerm();\n }\n\n if (!items || items.length === 0) {\n !singleSelect && this.selectAll();\n return;\n }\n\n const _items = singleSelect ? items.slice(0, 1) : items;\n\n const values = this.host.valueKey\n ? this.getItemsByValueKey(_items as Values<T>[])\n : _items;\n const selected = Array.from(this._selected.values());\n const payload = [...values, ...selected] as T[];\n\n if (\n emit &&\n !this.handleChange({\n newValue: this.getValue(payload, this.host.valueKey!),\n items: values as T[],\n type: 'selection',\n })\n ) {\n return;\n }\n\n if (this.host.valueKey) {\n this.selectValueKeys(_items as Values<T>[]);\n } else {\n this.selectObjects(_items as T[]);\n }\n\n this.host.requestUpdate();\n }\n\n public async deselect(items?: Item<T>[], emit = false) {\n const { singleSelect } = this.host;\n\n if (!items || items.length === 0) {\n if (\n emit &&\n !this.handleChange({\n newValue: [],\n items: Array.from(this.selected),\n type: 'deselection',\n })\n ) {\n return;\n }\n\n !singleSelect && this.deselectAll();\n return;\n }\n\n const _items = this.host.singleSelect ? items.slice(0, 1) : items;\n const values = this.host.valueKey\n ? this.getItemsByValueKey(_items as Values<T>[])\n : _items;\n const selected = Array.from(this._selected.values());\n const payload = selected.filter((item) => item !== values[0]);\n\n if (\n emit &&\n !this.handleChange({\n newValue: this.getValue(payload, this.host.valueKey!),\n items: values as T[],\n type: 'deselection',\n })\n ) {\n return;\n }\n\n if (this.host.valueKey) {\n this.deselectValueKeys(_items as Values<T>[]);\n } else {\n this.deselectObjects(_items as T[]);\n }\n\n this.host.requestUpdate();\n }\n\n public get selected(): Set<T> {\n return this._selected;\n }\n\n public changeSelection(index: number) {\n const item = this.data[index];\n\n if (this.host.valueKey) {\n !this.selected.has(item)\n ? this.select([item[this.host.valueKey]], true)\n : this.deselect([item[this.host.valueKey]], true);\n } else {\n !this.selected.has(item)\n ? this.select([item], true)\n : this.deselect([item], true);\n }\n }\n\n constructor(protected host: ComboHost<T>) {\n this.host.addController(this);\n }\n\n public hostConnected() {}\n\n public hostDisconnected() {}\n}\n"]}
|
|
@@ -13,6 +13,7 @@ export type ComboHost<T extends object> = ReactiveControllerHost & IgcComboCompo
|
|
|
13
13
|
export type GroupingDirection = 'asc' | 'desc';
|
|
14
14
|
export type ComboChangeType = 'selection' | 'deselection' | 'addition';
|
|
15
15
|
export type ComboRenderFunction<T extends object> = RenderItemFunction<ComboRecord<T>>;
|
|
16
|
+
export type ComboValue<T> = T | Values<T>;
|
|
16
17
|
export interface FilteringOptions<T extends object> {
|
|
17
18
|
filterKey: Keys<T> | undefined;
|
|
18
19
|
caseSensitive?: boolean;
|
|
@@ -24,9 +25,9 @@ export interface GroupingOptions<T extends object> {
|
|
|
24
25
|
displayKey?: Keys<T>;
|
|
25
26
|
direction: GroupingDirection;
|
|
26
27
|
}
|
|
27
|
-
export interface IgcComboChangeEventArgs {
|
|
28
|
-
newValue:
|
|
29
|
-
items:
|
|
28
|
+
export interface IgcComboChangeEventArgs<T extends object = any> {
|
|
29
|
+
newValue: ComboValue<T>[];
|
|
30
|
+
items: T[];
|
|
30
31
|
type: ComboChangeType;
|
|
31
32
|
}
|
|
32
33
|
export interface IgcComboEventMap {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/components/combo/types.ts"],"names":[],"mappings":"","sourcesContent":["import { ReactiveControllerHost, TemplateResult } from 'lit';\nimport IgcComboComponent from './combo.js';\nimport type { RenderItemFunction } from '@lit-labs/virtualizer/virtualize.js';\n\nexport type Keys<T> = keyof T;\nexport type Values<T> = T[keyof T];\nexport type Item<T extends object> = T | Values<T>;\n\nexport type ComboRecord<T extends object> = {\n value: T;\n header: boolean;\n dataIndex: number;\n};\n\nexport type ComboHost<T extends object> = ReactiveControllerHost &\n IgcComboComponent<T>;\n\nexport type GroupingDirection = 'asc' | 'desc';\nexport type ComboChangeType = 'selection' | 'deselection' | 'addition';\nexport type ComboRenderFunction<T extends object> = RenderItemFunction<\n ComboRecord<T>\n>;\n\nexport interface FilteringOptions<T extends object> {\n filterKey: Keys<T> | undefined;\n caseSensitive?: boolean;\n matchDiacritics?: boolean;\n}\n\nexport interface GroupingOptions<T extends object> {\n groupKey?: Keys<T>;\n valueKey?: Keys<T>;\n displayKey?: Keys<T>;\n direction: GroupingDirection;\n}\n\n/* marshalByValue */\nexport interface IgcComboChangeEventArgs {\n newValue:
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/components/combo/types.ts"],"names":[],"mappings":"","sourcesContent":["import { ReactiveControllerHost, TemplateResult } from 'lit';\nimport IgcComboComponent from './combo.js';\nimport type { RenderItemFunction } from '@lit-labs/virtualizer/virtualize.js';\n\nexport type Keys<T> = keyof T;\nexport type Values<T> = T[keyof T];\nexport type Item<T extends object> = T | Values<T>;\n\nexport type ComboRecord<T extends object> = {\n value: T;\n header: boolean;\n dataIndex: number;\n};\n\nexport type ComboHost<T extends object> = ReactiveControllerHost &\n IgcComboComponent<T>;\n\nexport type GroupingDirection = 'asc' | 'desc';\nexport type ComboChangeType = 'selection' | 'deselection' | 'addition';\nexport type ComboRenderFunction<T extends object> = RenderItemFunction<\n ComboRecord<T>\n>;\nexport type ComboValue<T> = T | Values<T>;\n\nexport interface FilteringOptions<T extends object> {\n filterKey: Keys<T> | undefined;\n caseSensitive?: boolean;\n matchDiacritics?: boolean;\n}\n\nexport interface GroupingOptions<T extends object> {\n groupKey?: Keys<T>;\n valueKey?: Keys<T>;\n displayKey?: Keys<T>;\n direction: GroupingDirection;\n}\n\n/* marshalByValue */\nexport interface IgcComboChangeEventArgs<T extends object = any> {\n newValue: ComboValue<T>[];\n /* primitiveValue */\n items: T[];\n /* blazorAlternateName: changeType */\n type: ComboChangeType;\n}\n\nexport interface IgcComboEventMap {\n igcChange: CustomEvent<IgcComboChangeEventArgs>;\n igcFocus: CustomEvent<void>;\n igcBlur: CustomEvent<void>;\n igcOpening: CustomEvent<void>;\n igcOpened: CustomEvent<void>;\n igcClosing: CustomEvent<void>;\n igcClosed: CustomEvent<void>;\n}\n\nexport type ComboItemTemplate<T extends object> = (\n props: ComboTemplateProps<T>\n) => TemplateResult;\nexport interface ComboTemplateProps<T extends object> {\n item: T;\n}\n"]}
|
|
@@ -389,13 +389,13 @@ class DateTimeUtil {
|
|
|
389
389
|
options[option] = format;
|
|
390
390
|
if (part.type === DateParts.Hours) {
|
|
391
391
|
part.format.charAt(0) === 'h'
|
|
392
|
-
? (options['
|
|
393
|
-
: (options['
|
|
392
|
+
? (options['hourCycle'] = 'h12')
|
|
393
|
+
: (options['hourCycle'] = 'h23');
|
|
394
394
|
}
|
|
395
395
|
}
|
|
396
396
|
if (part.type === DateParts.AmPm && part.format.length <= 2) {
|
|
397
397
|
options['hour'] = '2-digit';
|
|
398
|
-
options['
|
|
398
|
+
options['hourCycle'] = 'h12';
|
|
399
399
|
}
|
|
400
400
|
}
|
|
401
401
|
}
|