igniteui-webcomponents 7.1.0 → 7.1.2
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 +26 -0
- package/README.md +13 -11
- package/animations/easings.d.ts +1 -1
- package/animations/easings.js +1 -1
- package/animations/easings.js.map +1 -1
- package/components/badge/themes/dark/badge.indigo.css.js +1 -1
- package/components/badge/themes/dark/badge.indigo.css.js.map +1 -1
- package/components/button/themes/button/light/button.indigo.css.js +1 -1
- package/components/button/themes/button/light/button.indigo.css.js.map +1 -1
- package/components/button/themes/icon-button/dark/icon-button.indigo.css.js +1 -1
- package/components/button/themes/icon-button/dark/icon-button.indigo.css.js.map +1 -1
- package/components/button-group/button-group.js +2 -2
- package/components/button-group/button-group.js.map +1 -1
- package/components/button-group/themes/dark/button-group.bootstrap.css.js +1 -1
- package/components/button-group/themes/dark/button-group.bootstrap.css.js.map +1 -1
- package/components/button-group/themes/dark/button-group.fluent.css.js +1 -1
- package/components/button-group/themes/dark/button-group.fluent.css.js.map +1 -1
- package/components/button-group/themes/dark/button-group.indigo.css.js +1 -1
- package/components/button-group/themes/dark/button-group.indigo.css.js.map +1 -1
- package/components/button-group/themes/dark/button-group.material.css.js +1 -1
- package/components/button-group/themes/dark/button-group.material.css.js.map +1 -1
- package/components/button-group/themes/dark/button-group.shared.css.js +1 -1
- package/components/button-group/themes/dark/button-group.shared.css.js.map +1 -1
- package/components/button-group/themes/light/button-group.bootstrap.css.js +1 -1
- package/components/button-group/themes/light/button-group.bootstrap.css.js.map +1 -1
- package/components/button-group/themes/light/button-group.fluent.css.js +1 -1
- package/components/button-group/themes/light/button-group.fluent.css.js.map +1 -1
- package/components/button-group/themes/light/button-group.indigo.css.js +1 -1
- package/components/button-group/themes/light/button-group.indigo.css.js.map +1 -1
- package/components/button-group/themes/light/button-group.material.css.js +1 -1
- package/components/button-group/themes/light/button-group.material.css.js.map +1 -1
- package/components/button-group/themes/light/button-group.shared.css.js +1 -1
- package/components/button-group/themes/light/button-group.shared.css.js.map +1 -1
- package/components/button-group/themes/shared/button/button.bootstrap.css.js +1 -1
- package/components/button-group/themes/shared/button/button.bootstrap.css.js.map +1 -1
- package/components/button-group/themes/shared/button/button.common.css.js +1 -1
- package/components/button-group/themes/shared/button/button.common.css.js.map +1 -1
- package/components/button-group/themes/shared/button/button.fluent.css.js +1 -1
- package/components/button-group/themes/shared/button/button.fluent.css.js.map +1 -1
- package/components/button-group/themes/shared/button/button.indigo.css.js +1 -1
- package/components/button-group/themes/shared/button/button.indigo.css.js.map +1 -1
- package/components/button-group/themes/shared/button/button.material.css.js +1 -1
- package/components/button-group/themes/shared/button/button.material.css.js.map +1 -1
- package/components/calendar/calendar.js +3 -3
- package/components/calendar/calendar.js.map +1 -1
- package/components/calendar/days-view/days-view.js +13 -11
- package/components/calendar/days-view/days-view.js.map +1 -1
- package/components/calendar/helpers.js +2 -2
- package/components/calendar/helpers.js.map +1 -1
- package/components/calendar/themes/dark/calendar.indigo.css.js +1 -1
- package/components/calendar/themes/dark/calendar.indigo.css.js.map +1 -1
- package/components/card/themes/dark/card.indigo.css.js +1 -1
- package/components/card/themes/dark/card.indigo.css.js.map +1 -1
- package/components/carousel/carousel.js +2 -2
- package/components/carousel/carousel.js.map +1 -1
- package/components/chat/chat-message.js +1 -0
- package/components/chat/chat-message.js.map +1 -1
- package/components/chat/themes/dark/chat.bootstrap.css.js +1 -1
- package/components/chat/themes/dark/chat.bootstrap.css.js.map +1 -1
- package/components/chat/themes/dark/chat.fluent.css.js +1 -1
- package/components/chat/themes/dark/chat.fluent.css.js.map +1 -1
- package/components/chat/themes/dark/chat.indigo.css.js +1 -1
- package/components/chat/themes/dark/chat.indigo.css.js.map +1 -1
- package/components/chat/themes/dark/chat.material.css.js +1 -1
- package/components/chat/themes/dark/chat.material.css.js.map +1 -1
- package/components/chat/themes/light/chat.bootstrap.css.js +1 -1
- package/components/chat/themes/light/chat.bootstrap.css.js.map +1 -1
- package/components/chat/themes/light/chat.fluent.css.js +1 -1
- package/components/chat/themes/light/chat.fluent.css.js.map +1 -1
- package/components/chat/themes/light/chat.indigo.css.js +1 -1
- package/components/chat/themes/light/chat.indigo.css.js.map +1 -1
- package/components/chat/themes/light/chat.material.css.js +1 -1
- package/components/chat/themes/light/chat.material.css.js.map +1 -1
- package/components/chat/themes/light/chat.shared.css.js +1 -1
- package/components/chat/themes/light/chat.shared.css.js.map +1 -1
- package/components/chat/themes/message.base.css.js +1 -1
- package/components/chat/themes/message.base.css.js.map +1 -1
- package/components/chat/themes/message.js +0 -14
- package/components/chat/themes/message.js.map +1 -1
- package/components/chat/themes/shared/chat-message/chat-message.common.css.js +1 -1
- package/components/chat/themes/shared/chat-message/chat-message.common.css.js.map +1 -1
- package/components/chat/themes/shared/chat-message/chat-message.indigo.css.js +1 -1
- package/components/chat/themes/shared/chat-message/chat-message.indigo.css.js.map +1 -1
- package/components/checkbox/themes/dark/checkbox/checkbox.bootstrap.css.js +1 -1
- package/components/checkbox/themes/dark/checkbox/checkbox.bootstrap.css.js.map +1 -1
- package/components/checkbox/themes/dark/checkbox/checkbox.fluent.css.js +1 -1
- package/components/checkbox/themes/dark/checkbox/checkbox.fluent.css.js.map +1 -1
- package/components/checkbox/themes/dark/checkbox/checkbox.indigo.css.js +1 -1
- package/components/checkbox/themes/dark/checkbox/checkbox.indigo.css.js.map +1 -1
- package/components/checkbox/themes/dark/checkbox/checkbox.material.css.js +1 -1
- package/components/checkbox/themes/dark/checkbox/checkbox.material.css.js.map +1 -1
- package/components/checkbox/themes/light/checkbox/checkbox.bootstrap.css.js +1 -1
- package/components/checkbox/themes/light/checkbox/checkbox.bootstrap.css.js.map +1 -1
- package/components/checkbox/themes/light/checkbox/checkbox.fluent.css.js +1 -1
- package/components/checkbox/themes/light/checkbox/checkbox.fluent.css.js.map +1 -1
- package/components/checkbox/themes/light/checkbox/checkbox.indigo.css.js +1 -1
- package/components/checkbox/themes/light/checkbox/checkbox.indigo.css.js.map +1 -1
- package/components/checkbox/themes/light/checkbox/checkbox.material.css.js +1 -1
- package/components/checkbox/themes/light/checkbox/checkbox.material.css.js.map +1 -1
- package/components/checkbox/themes/light/checkbox/checkbox.shared.css.js +1 -1
- package/components/checkbox/themes/light/checkbox/checkbox.shared.css.js.map +1 -1
- package/components/checkbox/themes/shared/checkbox/checkbox.bootstrap.css.js +1 -1
- package/components/checkbox/themes/shared/checkbox/checkbox.bootstrap.css.js.map +1 -1
- package/components/checkbox/themes/shared/checkbox/checkbox.common.css.js +1 -1
- package/components/checkbox/themes/shared/checkbox/checkbox.common.css.js.map +1 -1
- package/components/checkbox/themes/shared/checkbox/checkbox.fluent.css.js +1 -1
- package/components/checkbox/themes/shared/checkbox/checkbox.fluent.css.js.map +1 -1
- package/components/checkbox/themes/shared/checkbox/checkbox.indigo.css.js +1 -1
- package/components/checkbox/themes/shared/checkbox/checkbox.indigo.css.js.map +1 -1
- package/components/checkbox/themes/shared/checkbox/checkbox.material.css.js +1 -1
- package/components/checkbox/themes/shared/checkbox/checkbox.material.css.js.map +1 -1
- package/components/chip/chip.d.ts +1 -0
- package/components/chip/chip.js +3 -1
- package/components/chip/chip.js.map +1 -1
- package/components/chip/themes/chip.base.css.js +1 -1
- package/components/chip/themes/chip.base.css.js.map +1 -1
- package/components/chip/themes/dark/chip.indigo.css.js +1 -1
- package/components/chip/themes/dark/chip.indigo.css.js.map +1 -1
- package/components/chip/themes/shared/chip.common.css.js +1 -1
- package/components/chip/themes/shared/chip.common.css.js.map +1 -1
- package/components/combo/combo-header.js.map +1 -1
- package/components/combo/combo-item.d.ts +7 -3
- package/components/combo/combo-item.js +5 -4
- package/components/combo/combo-item.js.map +1 -1
- package/components/combo/combo-list.js.map +1 -1
- package/components/combo/combo.d.ts +92 -81
- package/components/combo/combo.js +327 -281
- package/components/combo/combo.js.map +1 -1
- package/components/combo/controllers/data.d.ts +50 -13
- package/components/combo/controllers/data.js +49 -28
- package/components/combo/controllers/data.js.map +1 -1
- package/components/combo/controllers/navigation.d.ts +19 -18
- package/components/combo/controllers/navigation.js +73 -90
- package/components/combo/controllers/navigation.js.map +1 -1
- package/components/combo/operations/filter.d.ts +2 -2
- package/components/combo/operations/filter.js.map +1 -1
- package/components/combo/operations/group.d.ts +2 -2
- package/components/combo/operations/group.js.map +1 -1
- package/components/combo/themes/dark/combo.indigo.css.js +1 -1
- package/components/combo/themes/dark/combo.indigo.css.js.map +1 -1
- package/components/common/context.d.ts +1 -1
- package/components/common/context.js +1 -1
- package/components/common/context.js.map +1 -1
- package/components/common/controllers/drag.js +2 -2
- package/components/common/controllers/drag.js.map +1 -1
- package/components/common/controllers/key-bindings.d.ts +100 -18
- package/components/common/controllers/key-bindings.js +54 -47
- package/components/common/controllers/key-bindings.js.map +1 -1
- package/components/common/controllers/root-click.js +3 -3
- package/components/common/controllers/root-click.js.map +1 -1
- package/components/common/controllers/slot.d.ts +1 -1
- package/components/common/controllers/slot.js.map +1 -1
- package/components/common/mixins/combo-box.d.ts +24 -19
- package/components/common/mixins/combo-box.js +26 -23
- package/components/common/mixins/combo-box.js.map +1 -1
- package/components/common/util.d.ts +45 -18
- package/components/common/util.js +13 -27
- package/components/common/util.js.map +1 -1
- package/components/date-picker/date-picker.d.ts +3 -3
- package/components/date-picker/date-picker.js +10 -10
- package/components/date-picker/date-picker.js.map +1 -1
- package/components/date-picker/themes/dark/date-picker.indigo.css.js +1 -1
- package/components/date-picker/themes/dark/date-picker.indigo.css.js.map +1 -1
- package/components/date-range-picker/date-range-picker.d.ts +3 -4
- package/components/date-range-picker/date-range-picker.js +11 -11
- package/components/date-range-picker/date-range-picker.js.map +1 -1
- package/components/date-range-picker/themes/dark/date-range-picker.indigo.css.js +1 -1
- package/components/date-range-picker/themes/dark/date-range-picker.indigo.css.js.map +1 -1
- package/components/date-time-input/date-time-input.js +1 -1
- package/components/date-time-input/date-time-input.js.map +1 -1
- package/components/date-time-input/datetime-mask-parser.d.ts +1 -2
- package/components/date-time-input/datetime-mask-parser.js +1 -2
- package/components/date-time-input/datetime-mask-parser.js.map +1 -1
- package/components/dialog/themes/dark/dialog.indigo.css.js +1 -1
- package/components/dialog/themes/dark/dialog.indigo.css.js.map +1 -1
- package/components/dropdown/dropdown.d.ts +2 -2
- package/components/dropdown/dropdown.js +6 -6
- package/components/dropdown/dropdown.js.map +1 -1
- package/components/dropdown/themes/dark/dropdown.indigo.css.js +1 -1
- package/components/dropdown/themes/dark/dropdown.indigo.css.js.map +1 -1
- package/components/dropdown/themes/shared/item/dropdown-item.common.css.js +1 -1
- package/components/dropdown/themes/shared/item/dropdown-item.common.css.js.map +1 -1
- package/components/dropdown/themes/shared/item/dropdown-item.indigo.css.js +1 -1
- package/components/dropdown/themes/shared/item/dropdown-item.indigo.css.js.map +1 -1
- package/components/highlight/service.js +1 -1
- package/components/highlight/service.js.map +1 -1
- package/components/input/themes/shared/input.material.css.js +1 -1
- package/components/input/themes/shared/input.material.css.js.map +1 -1
- package/components/list/themes/dark/container/list.bootstrap.css.js +1 -1
- package/components/list/themes/dark/container/list.bootstrap.css.js.map +1 -1
- package/components/nav-drawer/themes/container.base.css.js +1 -1
- package/components/nav-drawer/themes/container.base.css.js.map +1 -1
- package/components/navbar/themes/dark/navbar.indigo.css.js +1 -1
- package/components/navbar/themes/dark/navbar.indigo.css.js.map +1 -1
- package/components/progress/themes/circular/dark/circular.progress.indigo.css.js +1 -1
- package/components/progress/themes/circular/dark/circular.progress.indigo.css.js.map +1 -1
- package/components/progress/themes/circular/dark/circular.progress.shared.css.js +1 -1
- package/components/progress/themes/circular/dark/circular.progress.shared.css.js.map +1 -1
- package/components/progress/themes/circular/light/circular.progress.indigo.css.js +1 -1
- package/components/progress/themes/circular/light/circular.progress.indigo.css.js.map +1 -1
- package/components/progress/themes/circular/light/circular.progress.shared.css.js +1 -1
- package/components/progress/themes/circular/light/circular.progress.shared.css.js.map +1 -1
- package/components/progress/themes/circular/shared/circular.progress.common.css.js +1 -1
- package/components/progress/themes/circular/shared/circular.progress.common.css.js.map +1 -1
- package/components/progress/themes/linear/dark/linear.progress.indigo.css.js +1 -1
- package/components/progress/themes/linear/dark/linear.progress.indigo.css.js.map +1 -1
- package/components/progress/themes/linear/linear.progress.base.css.js +1 -1
- package/components/progress/themes/linear/linear.progress.base.css.js.map +1 -1
- package/components/radio/radio.js +1 -1
- package/components/radio/radio.js.map +1 -1
- package/components/rating/rating.d.ts +57 -28
- package/components/rating/rating.js +123 -120
- package/components/rating/rating.js.map +1 -1
- package/components/resize-container/resize-controller.js +2 -2
- package/components/resize-container/resize-controller.js.map +1 -1
- package/components/select/select.d.ts +3 -3
- package/components/select/select.js +10 -10
- package/components/select/select.js.map +1 -1
- package/components/select/themes/dark/select.indigo.css.js +1 -1
- package/components/select/themes/dark/select.indigo.css.js.map +1 -1
- package/components/snackbar/themes/dark/snackbar.indigo.css.js +1 -1
- package/components/snackbar/themes/dark/snackbar.indigo.css.js.map +1 -1
- package/components/splitter/splitter.d.ts +2 -2
- package/components/splitter/splitter.js.map +1 -1
- package/components/splitter/types.d.ts +11 -5
- package/components/splitter/types.js.map +1 -1
- package/components/stepper/common/state.d.ts +1 -1
- package/components/stepper/common/state.js.map +1 -1
- package/components/stepper/stepper.js +3 -3
- package/components/stepper/stepper.js.map +1 -1
- package/components/stepper/themes/step/dark/step.bootstrap.css.js +1 -1
- package/components/stepper/themes/step/dark/step.bootstrap.css.js.map +1 -1
- package/components/stepper/themes/step/dark/step.indigo.css.js +1 -1
- package/components/stepper/themes/step/dark/step.indigo.css.js.map +1 -1
- package/components/stepper/themes/step/dark/step.material.css.js +1 -1
- package/components/stepper/themes/step/dark/step.material.css.js.map +1 -1
- package/components/tabs/tab.d.ts +0 -1
- package/components/tabs/tab.js +2 -3
- package/components/tabs/tab.js.map +1 -1
- package/components/tabs/tabs.js +3 -3
- package/components/tabs/tabs.js.map +1 -1
- package/components/tile-manager/themes/dark/tile-manager.indigo.css.js +1 -1
- package/components/tile-manager/themes/dark/tile-manager.indigo.css.js.map +1 -1
- package/components/tile-manager/tile.js +2 -2
- package/components/tile-manager/tile.js.map +1 -1
- package/components/toast/themes/dark/toast.indigo.css.js +1 -1
- package/components/toast/themes/dark/toast.indigo.css.js.map +1 -1
- package/components/tree/themes/dark/container.bootstrap.css.js +1 -1
- package/components/tree/themes/dark/container.bootstrap.css.js.map +1 -1
- package/components/tree/themes/dark/container.indigo.css.js +1 -1
- package/components/tree/themes/dark/container.indigo.css.js.map +1 -1
- package/components/tree/themes/shared/item.indigo.css.js +1 -1
- package/components/tree/themes/shared/item.indigo.css.js.map +1 -1
- package/components/tree/tree-item.js +2 -3
- package/components/tree/tree-item.js.map +1 -1
- package/custom-elements.json +1726 -983
- package/igniteui-webcomponents.css-data.json +1 -1
- package/igniteui-webcomponents.html-data.json +1 -1
- package/index.d.ts +1 -1
- package/index.js.map +1 -1
- package/package.json +1 -1
- package/skills/README.md +3 -0
- package/skills/igniteui-wc-choose-components/SKILL.md +53 -0
- package/skills/igniteui-wc-generate-from-image-design/SKILL.md +228 -0
- package/skills/igniteui-wc-generate-from-image-design/references/component-mapping.md +130 -0
- package/skills/igniteui-wc-generate-from-image-design/references/gotchas.md +147 -0
- package/skills/igniteui-wc-integrate-with-framework/SKILL.md +22 -1
- package/skills/igniteui-wc-integrate-with-framework/references/angular.md +2 -0
- package/skills/igniteui-wc-integrate-with-framework/references/react.md +2 -0
- package/skills/igniteui-wc-integrate-with-framework/references/vanilla-js.md +2 -0
- package/skills/igniteui-wc-integrate-with-framework/references/vue.md +2 -0
- package/web-types.json +2 -2
- package/components/chat/themes/shared/chat-message/chat-message.bootstrap.css.d.ts +0 -1
- package/components/chat/themes/shared/chat-message/chat-message.bootstrap.css.js +0 -3
- package/components/chat/themes/shared/chat-message/chat-message.bootstrap.css.js.map +0 -1
- package/components/chat/themes/shared/chat-message/chat-message.fluent.css.d.ts +0 -1
- package/components/chat/themes/shared/chat-message/chat-message.fluent.css.js +0 -3
- package/components/chat/themes/shared/chat-message/chat-message.fluent.css.js.map +0 -1
- package/components/combo/controllers/selection.d.ts +0 -33
- package/components/combo/controllers/selection.js +0 -169
- package/components/combo/controllers/selection.js.map +0 -1
|
@@ -6,22 +6,23 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
6
6
|
};
|
|
7
7
|
var IgcComboComponent_1;
|
|
8
8
|
import { ComboResourceStringsEN, } from 'igniteui-i18n-core';
|
|
9
|
-
import { html,
|
|
10
|
-
import { property,
|
|
9
|
+
import { html, nothing } from 'lit';
|
|
10
|
+
import { property, state } from 'lit/decorators.js';
|
|
11
11
|
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
12
12
|
import { createRef, ref } from 'lit/directives/ref.js';
|
|
13
13
|
import { addThemingController } from '../../theming/theming-controller.js';
|
|
14
14
|
import { addRootClickController } from '../common/controllers/root-click.js';
|
|
15
|
+
import { addSlotController, setSlots } from '../common/controllers/slot.js';
|
|
15
16
|
import { blazorAdditionalDependencies } from '../common/decorators/blazorAdditionalDependencies.js';
|
|
16
17
|
import { blazorIndirectRender } from '../common/decorators/blazorIndirectRender.js';
|
|
17
|
-
import { watch } from '../common/decorators/watch.js';
|
|
18
18
|
import { registerComponent } from '../common/definitions/register.js';
|
|
19
19
|
import { addI18nController } from '../common/i18n/i18n-controller.js';
|
|
20
|
+
import { IgcBaseComboBoxComponent } from '../common/mixins/combo-box.js';
|
|
20
21
|
import { EventEmitterMixin } from '../common/mixins/event-emitter.js';
|
|
21
22
|
import { FormAssociatedRequiredMixin } from '../common/mixins/forms/associated-required.js';
|
|
22
23
|
import { createFormValueState } from '../common/mixins/forms/form-value.js';
|
|
23
24
|
import { partMap } from '../common/part-map.js';
|
|
24
|
-
import { addSafeEventListener, asArray,
|
|
25
|
+
import { addSafeEventListener, asArray, bindIf, first, getElementFromPath, isDefined, isEmpty, stopPropagation, } from '../common/util.js';
|
|
25
26
|
import IgcIconComponent from '../icon/icon.js';
|
|
26
27
|
import IgcInputComponent from '../input/input.js';
|
|
27
28
|
import IgcPopoverComponent from '../popover/popover.js';
|
|
@@ -29,14 +30,14 @@ import IgcValidationContainerComponent from '../validation-container/validation-
|
|
|
29
30
|
import IgcComboHeaderComponent from './combo-header.js';
|
|
30
31
|
import IgcComboItemComponent from './combo-item.js';
|
|
31
32
|
import IgcComboListComponent from './combo-list.js';
|
|
32
|
-
import {
|
|
33
|
+
import { DataState } from './controllers/data.js';
|
|
33
34
|
import { ComboNavigationController } from './controllers/navigation.js';
|
|
34
|
-
import { SelectionController } from './controllers/selection.js';
|
|
35
35
|
import { styles } from './themes/combo.base.css.js';
|
|
36
36
|
import { styles as shared } from './themes/shared/combo.common.css.js';
|
|
37
37
|
import { all } from './themes/themes.js';
|
|
38
38
|
import { comboValidators } from './validators.js';
|
|
39
|
-
|
|
39
|
+
const SLOTS = setSlots('prefix', 'suffix', 'header', 'footer', 'empty', 'helper-text', 'toggle-icon', 'clear-icon', 'value-missing', 'custom-error', 'invalid');
|
|
40
|
+
let IgcComboComponent = class IgcComboComponent extends FormAssociatedRequiredMixin(EventEmitterMixin(IgcBaseComboBoxComponent)) {
|
|
40
41
|
static { IgcComboComponent_1 = this; }
|
|
41
42
|
static { this.tagName = 'igc-combo'; }
|
|
42
43
|
static { this.styles = [styles, shared]; }
|
|
@@ -46,29 +47,40 @@ let IgcComboComponent = class IgcComboComponent extends FormAssociatedRequiredMi
|
|
|
46
47
|
get __validators() {
|
|
47
48
|
return comboValidators;
|
|
48
49
|
}
|
|
50
|
+
set _activeIndex(index) {
|
|
51
|
+
this._navigation.active = index;
|
|
52
|
+
}
|
|
53
|
+
get _activeIndex() {
|
|
54
|
+
return this._navigation.active;
|
|
55
|
+
}
|
|
56
|
+
set _searchTerm(value) {
|
|
57
|
+
this._state.searchTerm = value;
|
|
58
|
+
}
|
|
59
|
+
get _searchTerm() {
|
|
60
|
+
return this._state.searchTerm;
|
|
61
|
+
}
|
|
62
|
+
get _mainAriaLabel() {
|
|
63
|
+
return isEmpty(this._selected)
|
|
64
|
+
? this.resourceStrings.combo_aria_label_no_options
|
|
65
|
+
: this.resourceStrings.combo_aria_label_options;
|
|
66
|
+
}
|
|
49
67
|
set data(value) {
|
|
50
|
-
if (this._data
|
|
51
|
-
|
|
68
|
+
if (this._data !== value) {
|
|
69
|
+
this._data = asArray(value);
|
|
52
70
|
}
|
|
53
|
-
this._data = asArray(value);
|
|
54
|
-
const pristine = this._pristine;
|
|
55
|
-
this.value = asArray(this.value);
|
|
56
|
-
this._pristine = pristine;
|
|
57
|
-
this._state.runPipeline();
|
|
58
71
|
}
|
|
59
72
|
get data() {
|
|
60
73
|
return this._data;
|
|
61
74
|
}
|
|
62
75
|
set singleSelect(value) {
|
|
63
|
-
if (this._singleSelect === Boolean(value)) {
|
|
64
|
-
return;
|
|
65
|
-
}
|
|
66
76
|
this._singleSelect = Boolean(value);
|
|
67
|
-
this.
|
|
77
|
+
this._syncSelectionFromValue();
|
|
68
78
|
if (this.hasUpdated) {
|
|
69
|
-
this.
|
|
70
|
-
this.
|
|
71
|
-
this.
|
|
79
|
+
const pristine = this._pristine;
|
|
80
|
+
this._activeIndex = -1;
|
|
81
|
+
this._searchTerm = '';
|
|
82
|
+
this._formValue.setValueAndFormState(this.value);
|
|
83
|
+
this._pristine = pristine;
|
|
72
84
|
}
|
|
73
85
|
}
|
|
74
86
|
get singleSelect() {
|
|
@@ -76,6 +88,7 @@ let IgcComboComponent = class IgcComboComponent extends FormAssociatedRequiredMi
|
|
|
76
88
|
}
|
|
77
89
|
set locale(value) {
|
|
78
90
|
this._i18nController.locale = value;
|
|
91
|
+
this._state.updateLocale(value);
|
|
79
92
|
}
|
|
80
93
|
get locale() {
|
|
81
94
|
return this._i18nController.locale;
|
|
@@ -110,74 +123,37 @@ let IgcComboComponent = class IgcComboComponent extends FormAssociatedRequiredMi
|
|
|
110
123
|
get displayKey() {
|
|
111
124
|
return this._displayKey ?? this._valueKey;
|
|
112
125
|
}
|
|
113
|
-
set groupKey(value) {
|
|
114
|
-
if (this._groupKey !== value) {
|
|
115
|
-
this._groupKey = value;
|
|
116
|
-
this._state.runPipeline();
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
get groupKey() {
|
|
120
|
-
return this._groupKey;
|
|
121
|
-
}
|
|
122
|
-
set groupSorting(value) {
|
|
123
|
-
if (this._groupSorting !== value) {
|
|
124
|
-
this._groupSorting = value;
|
|
125
|
-
this._state.runPipeline();
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
get groupSorting() {
|
|
129
|
-
return this._groupSorting;
|
|
130
|
-
}
|
|
131
126
|
set filteringOptions(value) {
|
|
132
|
-
|
|
133
|
-
if (!equal(options, this._filteringOptions)) {
|
|
134
|
-
this._filteringOptions = options;
|
|
135
|
-
this._state.runPipeline();
|
|
136
|
-
}
|
|
127
|
+
this._filteringOptions = { ...this._filteringOptions, ...value };
|
|
137
128
|
}
|
|
138
129
|
get filteringOptions() {
|
|
139
130
|
return this._filteringOptions;
|
|
140
131
|
}
|
|
141
132
|
set disableFiltering(value) {
|
|
142
133
|
this._disableFiltering = value;
|
|
143
|
-
this.
|
|
134
|
+
this._searchTerm = '';
|
|
144
135
|
}
|
|
145
136
|
get disableFiltering() {
|
|
146
137
|
return this._disableFiltering;
|
|
147
138
|
}
|
|
148
139
|
set value(items) {
|
|
149
|
-
this._formValue.
|
|
140
|
+
this._formValue.setValueAndFormState(items);
|
|
141
|
+
this._syncSelectionFromValue();
|
|
150
142
|
if (this.hasUpdated) {
|
|
151
|
-
this.
|
|
152
|
-
this.updateValue();
|
|
143
|
+
this._validate();
|
|
153
144
|
}
|
|
154
145
|
}
|
|
155
146
|
get value() {
|
|
156
147
|
return this._formValue.value;
|
|
157
148
|
}
|
|
158
|
-
|
|
159
|
-
this.
|
|
160
|
-
if (!isEmpty(this.value)) {
|
|
161
|
-
this._selection.select(this.value);
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
toggleDirectiveChange() {
|
|
165
|
-
this._rootClickController.update();
|
|
149
|
+
get selection() {
|
|
150
|
+
return Array.from(this._selected);
|
|
166
151
|
}
|
|
167
152
|
constructor() {
|
|
168
153
|
super();
|
|
169
|
-
this.
|
|
170
|
-
this._searchRef = createRef();
|
|
171
|
-
this._listRef = createRef();
|
|
154
|
+
this._slots = addSlotController(this, { slots: SLOTS });
|
|
172
155
|
this._rootClickController = addRootClickController(this, {
|
|
173
|
-
onHide:
|
|
174
|
-
if (!this.handleClosing()) {
|
|
175
|
-
return;
|
|
176
|
-
}
|
|
177
|
-
this.open = false;
|
|
178
|
-
await this.updateComplete;
|
|
179
|
-
this.emitEvent('igcClosed');
|
|
180
|
-
},
|
|
156
|
+
onHide: this._handleClosing,
|
|
181
157
|
});
|
|
182
158
|
this._i18nController = addI18nController(this, {
|
|
183
159
|
defaultEN: ComboResourceStringsEN,
|
|
@@ -187,35 +163,57 @@ let IgcComboComponent = class IgcComboComponent extends FormAssociatedRequiredMi
|
|
|
187
163
|
transformers: {
|
|
188
164
|
setValue: asArray,
|
|
189
165
|
setDefaultValue: asArray,
|
|
166
|
+
setFormValue: (value) => {
|
|
167
|
+
if (isEmpty(value) || !this.name) {
|
|
168
|
+
return null;
|
|
169
|
+
}
|
|
170
|
+
if (this.singleSelect) {
|
|
171
|
+
return String(first(value));
|
|
172
|
+
}
|
|
173
|
+
const formData = new FormData();
|
|
174
|
+
for (const item of value) {
|
|
175
|
+
formData.append(this.name, String(item));
|
|
176
|
+
}
|
|
177
|
+
return formData;
|
|
178
|
+
},
|
|
179
|
+
},
|
|
180
|
+
});
|
|
181
|
+
this._inputRef = createRef();
|
|
182
|
+
this._searchRef = createRef();
|
|
183
|
+
this._listRef = createRef();
|
|
184
|
+
this._state = new DataState(this);
|
|
185
|
+
this._navigation = new ComboNavigationController(this, this._state, {
|
|
186
|
+
input: this._inputRef,
|
|
187
|
+
search: this._searchRef,
|
|
188
|
+
list: this._listRef,
|
|
189
|
+
interactions: {
|
|
190
|
+
show: () => this._show(true),
|
|
191
|
+
hide: () => this._hide(true),
|
|
192
|
+
toggleSelection: (index) => this._toggleSelection(index),
|
|
193
|
+
select: (index) => this._selectByIndex(index),
|
|
194
|
+
clearSelection: () => this._clearSelection(),
|
|
190
195
|
},
|
|
191
196
|
});
|
|
192
197
|
this._data = [];
|
|
193
198
|
this._disableFiltering = false;
|
|
194
199
|
this._singleSelect = false;
|
|
195
|
-
this.
|
|
200
|
+
this._selected = new Set();
|
|
196
201
|
this._filteringOptions = {
|
|
197
202
|
filterKey: this.displayKey,
|
|
198
203
|
caseSensitive: false,
|
|
199
204
|
matchDiacritics: false,
|
|
200
205
|
};
|
|
201
206
|
this._displayValue = '';
|
|
202
|
-
this._state = new DataController(this);
|
|
203
|
-
this._selection = new SelectionController(this, this._state);
|
|
204
|
-
this._navigation = new ComboNavigationController(this, this._state, {
|
|
205
|
-
input: this._inputRef,
|
|
206
|
-
search: this._searchRef,
|
|
207
|
-
list: this._listRef,
|
|
208
|
-
});
|
|
209
207
|
this.outlined = false;
|
|
210
208
|
this.autofocusList = false;
|
|
211
|
-
this.
|
|
209
|
+
this.groupSorting = 'asc';
|
|
212
210
|
this.caseSensitiveIcon = false;
|
|
213
211
|
this.disableClear = false;
|
|
214
212
|
this.itemTemplate = ({ item }) => html `${this.displayKey ? item[this.displayKey] : item}`;
|
|
215
213
|
this.groupHeaderTemplate = ({ item }) => html `${this.groupKey && item[this.groupKey]}`;
|
|
216
|
-
this.
|
|
214
|
+
this._itemRenderer = (item, index) => {
|
|
217
215
|
if (!item) {
|
|
218
|
-
return
|
|
216
|
+
return nothing;
|
|
219
217
|
}
|
|
220
218
|
if (this.groupKey && item.header) {
|
|
221
219
|
return html `
|
|
@@ -224,9 +222,10 @@ let IgcComboComponent = class IgcComboComponent extends FormAssociatedRequiredMi
|
|
|
224
222
|
</igc-combo-header>
|
|
225
223
|
`;
|
|
226
224
|
}
|
|
227
|
-
const
|
|
228
|
-
const
|
|
229
|
-
const
|
|
225
|
+
const position = index + 1;
|
|
226
|
+
const id = this.id ? `${this.id}-item-${position}` : `item-${position}`;
|
|
227
|
+
const active = this._activeIndex === index;
|
|
228
|
+
const selected = this._selected.has(this.data[item.dataIndex]);
|
|
230
229
|
if (active) {
|
|
231
230
|
this._activeDescendant = id;
|
|
232
231
|
}
|
|
@@ -250,213 +249,264 @@ let IgcComboComponent = class IgcComboComponent extends FormAssociatedRequiredMi
|
|
|
250
249
|
addSafeEventListener(this, 'blur', this._handleBlur);
|
|
251
250
|
addSafeEventListener(this, 'focusin', this._handleFocusIn);
|
|
252
251
|
}
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
252
|
+
willUpdate(props) {
|
|
253
|
+
if (props.has('open')) {
|
|
254
|
+
this._rootClickController.update();
|
|
255
|
+
}
|
|
256
|
+
if (props.has('groupKey') ||
|
|
257
|
+
props.has('groupSorting') ||
|
|
258
|
+
props.has('filteringOptions') ||
|
|
259
|
+
props.has('data')) {
|
|
260
|
+
this._state.invalidate();
|
|
261
|
+
}
|
|
262
|
+
if (props.has('data') && !isEmpty(this.data) && !isEmpty(this.value)) {
|
|
263
|
+
const pristine = this._pristine;
|
|
264
|
+
this._syncSelectionFromValue();
|
|
265
|
+
this._formValue.setValueAndFormState(this.value);
|
|
266
|
+
this._pristine = pristine;
|
|
267
|
+
}
|
|
259
268
|
}
|
|
260
269
|
_restoreDefaultValue() {
|
|
261
|
-
|
|
262
|
-
this.
|
|
263
|
-
this.updateValue(true);
|
|
264
|
-
this._validate();
|
|
270
|
+
super._restoreDefaultValue();
|
|
271
|
+
this._syncSelectionFromValue();
|
|
265
272
|
}
|
|
266
273
|
_setDefaultValue(current) {
|
|
267
|
-
|
|
274
|
+
try {
|
|
275
|
+
this.defaultValue = JSON.parse(current || '[]');
|
|
276
|
+
}
|
|
277
|
+
catch { }
|
|
278
|
+
}
|
|
279
|
+
async _show(emitEvent = false) {
|
|
280
|
+
const [canOpen, _] = await Promise.all([
|
|
281
|
+
super._show(emitEvent),
|
|
282
|
+
this.updateComplete,
|
|
283
|
+
]);
|
|
284
|
+
if (canOpen) {
|
|
285
|
+
if (!this.singleSelect) {
|
|
286
|
+
this._listRef.value?.focus();
|
|
287
|
+
}
|
|
288
|
+
if (!this.autofocusList) {
|
|
289
|
+
this._searchRef.value?.focus();
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
return canOpen;
|
|
293
|
+
}
|
|
294
|
+
async _hide(emitEvent = false) {
|
|
295
|
+
const [canClose, _] = await Promise.all([
|
|
296
|
+
super._hide(emitEvent),
|
|
297
|
+
this.updateComplete,
|
|
298
|
+
]);
|
|
299
|
+
if (canClose) {
|
|
300
|
+
this._activeIndex = -1;
|
|
301
|
+
}
|
|
302
|
+
return canClose;
|
|
268
303
|
}
|
|
269
|
-
|
|
270
|
-
if (
|
|
271
|
-
|
|
304
|
+
_resolveItems(items) {
|
|
305
|
+
if (this.valueKey) {
|
|
306
|
+
const keys = new Set(items);
|
|
307
|
+
return this.data.filter((item) => keys.has(item[this.valueKey]));
|
|
308
|
+
}
|
|
309
|
+
const dataSet = new Set(this.data);
|
|
310
|
+
return items.filter((item) => dataSet.has(item));
|
|
311
|
+
}
|
|
312
|
+
_resolveItemValue(record) {
|
|
313
|
+
return this.valueKey ? record[this.valueKey] : record;
|
|
314
|
+
}
|
|
315
|
+
_getValues(items, key) {
|
|
316
|
+
return Iterator.from(items)
|
|
317
|
+
.map((item) => (key ? item[key] : undefined) ?? item)
|
|
318
|
+
.toArray();
|
|
319
|
+
}
|
|
320
|
+
_emitSelectionChange(detail) {
|
|
321
|
+
return this.emitEvent('igcChange', { cancelable: true, detail });
|
|
322
|
+
}
|
|
323
|
+
_selectItems(items, emit = false) {
|
|
324
|
+
let collection = asArray(items);
|
|
325
|
+
if (this.singleSelect) {
|
|
326
|
+
this._selected.clear();
|
|
327
|
+
this._searchTerm = '';
|
|
328
|
+
}
|
|
329
|
+
if (isEmpty(collection)) {
|
|
330
|
+
if (!this.singleSelect) {
|
|
331
|
+
this._selected = new Set(this.data);
|
|
332
|
+
this.requestUpdate();
|
|
333
|
+
}
|
|
272
334
|
return;
|
|
273
335
|
}
|
|
274
336
|
if (this.singleSelect) {
|
|
275
|
-
|
|
337
|
+
collection = collection.slice(0, 1);
|
|
338
|
+
}
|
|
339
|
+
const resolved = this._resolveItems(collection);
|
|
340
|
+
if (emit &&
|
|
341
|
+
!this._emitSelectionChange({
|
|
342
|
+
newValue: this._getValues([...resolved, ...this._selected], this.valueKey),
|
|
343
|
+
items: resolved,
|
|
344
|
+
type: 'selection',
|
|
345
|
+
})) {
|
|
276
346
|
return;
|
|
277
347
|
}
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
348
|
+
for (const item of resolved) {
|
|
349
|
+
this._selected.add(item);
|
|
350
|
+
}
|
|
351
|
+
this.requestUpdate();
|
|
352
|
+
}
|
|
353
|
+
_deselectItems(items, emit = false) {
|
|
354
|
+
let collection = asArray(items);
|
|
355
|
+
if (isEmpty(collection)) {
|
|
356
|
+
if (emit &&
|
|
357
|
+
!this._emitSelectionChange({
|
|
358
|
+
newValue: [],
|
|
359
|
+
items: Array.from(this._selected),
|
|
360
|
+
type: 'deselection',
|
|
361
|
+
})) {
|
|
362
|
+
return;
|
|
282
363
|
}
|
|
283
|
-
|
|
364
|
+
this._selected.clear();
|
|
365
|
+
this.requestUpdate();
|
|
366
|
+
return;
|
|
284
367
|
}
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
368
|
+
if (this.singleSelect) {
|
|
369
|
+
collection = collection.slice(0, 1);
|
|
370
|
+
}
|
|
371
|
+
const resolved = this._resolveItems(collection);
|
|
372
|
+
const resolvedSet = new Set(resolved);
|
|
373
|
+
const remaining = Array.from(this._selected).filter((item) => !resolvedSet.has(item));
|
|
374
|
+
if (emit &&
|
|
375
|
+
!this._emitSelectionChange({
|
|
376
|
+
newValue: this._getValues(remaining, this.valueKey),
|
|
377
|
+
items: resolved,
|
|
378
|
+
type: 'deselection',
|
|
379
|
+
})) {
|
|
291
380
|
return;
|
|
292
381
|
}
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
382
|
+
for (const item of resolved) {
|
|
383
|
+
this._selected.delete(item);
|
|
384
|
+
}
|
|
385
|
+
this.requestUpdate();
|
|
386
|
+
}
|
|
387
|
+
_syncSelectionFromValue() {
|
|
388
|
+
this._selected.clear();
|
|
389
|
+
if (!isEmpty(this._formValue.value)) {
|
|
390
|
+
const values = this.singleSelect
|
|
391
|
+
? asArray(first(this._formValue.value))
|
|
392
|
+
: this._formValue.value;
|
|
393
|
+
if (this.singleSelect && values.length !== this._formValue.value.length) {
|
|
394
|
+
this._formValue.setValueAndFormState(values);
|
|
395
|
+
}
|
|
396
|
+
const items = Iterator.from(values)
|
|
397
|
+
.map((val) => this._findItemByValue(val, this.valueKey))
|
|
398
|
+
.filter(isDefined);
|
|
399
|
+
for (const item of items) {
|
|
400
|
+
this._selected.add(item);
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
this._displayValue = this._getValues(this._selected, this.displayKey).join(', ');
|
|
404
|
+
}
|
|
405
|
+
_findItemByValue(value, key) {
|
|
406
|
+
return this.data.find((item) => (key ? item[key] : item) === value);
|
|
407
|
+
}
|
|
408
|
+
_syncValueFromSelection(initial = false) {
|
|
409
|
+
const values = this._getValues(this._selected, this.valueKey);
|
|
410
|
+
this._displayValue = this._getValues(this._selected, this.displayKey).join(', ');
|
|
411
|
+
this._formValue.setValueAndFormState(values);
|
|
298
412
|
if (!initial) {
|
|
299
413
|
this._validate();
|
|
300
|
-
this._listRef.value
|
|
414
|
+
this._listRef.value?.requestUpdate();
|
|
301
415
|
}
|
|
302
416
|
}
|
|
303
|
-
|
|
304
|
-
this.
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
417
|
+
_toggleSelection(index) {
|
|
418
|
+
const record = this.data[this._state.dataState[index].dataIndex];
|
|
419
|
+
this._selected.has(record)
|
|
420
|
+
? this._deselectItems(this._resolveItemValue(record), true)
|
|
421
|
+
: this._selectItems(this._resolveItemValue(record), true);
|
|
422
|
+
this._activeIndex = index;
|
|
423
|
+
this._syncValueFromSelection();
|
|
308
424
|
}
|
|
309
|
-
|
|
310
|
-
|
|
425
|
+
_selectByIndex(index) {
|
|
426
|
+
this._selectItems(this._resolveItemValue(this.data[this._state.dataState[index].dataIndex]), true);
|
|
427
|
+
this._activeIndex = index;
|
|
428
|
+
this._syncValueFromSelection();
|
|
311
429
|
}
|
|
312
|
-
|
|
313
|
-
this.
|
|
314
|
-
|
|
430
|
+
_clearSelection() {
|
|
431
|
+
if (this.singleSelect) {
|
|
432
|
+
this._searchTerm = '';
|
|
433
|
+
this._clearSingleSelection();
|
|
434
|
+
}
|
|
435
|
+
else {
|
|
436
|
+
this._deselectItems([], true);
|
|
437
|
+
}
|
|
438
|
+
this._syncValueFromSelection();
|
|
315
439
|
}
|
|
316
|
-
|
|
317
|
-
this.
|
|
318
|
-
|
|
440
|
+
_clearSingleSelection() {
|
|
441
|
+
const [selection] = this._selected;
|
|
442
|
+
if (selection) {
|
|
443
|
+
this._deselectItems(this._resolveItemValue(selection), true);
|
|
444
|
+
this._formValue.setValueAndFormState([]);
|
|
445
|
+
}
|
|
319
446
|
}
|
|
320
|
-
async
|
|
447
|
+
async _handleMainInput({ detail, }) {
|
|
321
448
|
this._setTouchedState();
|
|
322
|
-
this._show();
|
|
323
|
-
this.
|
|
449
|
+
this._show(true);
|
|
450
|
+
this._searchTerm = detail;
|
|
324
451
|
await this.updateComplete;
|
|
325
|
-
|
|
326
|
-
this.
|
|
327
|
-
this._listRef.value.requestUpdate();
|
|
328
|
-
this.clearSingleSelection();
|
|
452
|
+
this._activeIndex = this._state.dataState.findIndex((i) => !i.header);
|
|
453
|
+
this._clearSingleSelection();
|
|
329
454
|
}
|
|
330
455
|
_handleFocusIn() {
|
|
331
456
|
this._setTouchedState();
|
|
332
457
|
}
|
|
333
458
|
_handleBlur() {
|
|
334
|
-
if (this.
|
|
335
|
-
this.
|
|
336
|
-
this.resetSearchTerm();
|
|
459
|
+
if (isEmpty(this._selected)) {
|
|
460
|
+
this._searchTerm = '';
|
|
337
461
|
}
|
|
338
462
|
super._handleBlur();
|
|
339
463
|
}
|
|
340
|
-
|
|
341
|
-
this.
|
|
342
|
-
}
|
|
343
|
-
handleOpening() {
|
|
344
|
-
return this.emitEvent('igcOpening', { cancelable: true });
|
|
345
|
-
}
|
|
346
|
-
handleClosing() {
|
|
347
|
-
return this.emitEvent('igcClosing', { cancelable: true });
|
|
348
|
-
}
|
|
349
|
-
async _show(emitEvent = true) {
|
|
350
|
-
if (this.open || (emitEvent && !this.handleOpening())) {
|
|
351
|
-
return false;
|
|
352
|
-
}
|
|
353
|
-
this.open = true;
|
|
354
|
-
await this.updateComplete;
|
|
355
|
-
if (emitEvent) {
|
|
356
|
-
this.emitEvent('igcOpened');
|
|
357
|
-
}
|
|
358
|
-
if (!this.singleSelect) {
|
|
359
|
-
this._listRef.value.focus();
|
|
360
|
-
}
|
|
361
|
-
if (!this.autofocusList) {
|
|
362
|
-
this._searchRef.value.focus();
|
|
363
|
-
}
|
|
364
|
-
return true;
|
|
365
|
-
}
|
|
366
|
-
async show() {
|
|
367
|
-
return await this._show(false);
|
|
368
|
-
}
|
|
369
|
-
async _hide(emitEvent = true) {
|
|
370
|
-
if (!this.open || (emitEvent && !this.handleClosing())) {
|
|
371
|
-
return false;
|
|
372
|
-
}
|
|
373
|
-
this.open = false;
|
|
374
|
-
await this.updateComplete;
|
|
375
|
-
if (emitEvent) {
|
|
376
|
-
this.emitEvent('igcClosed');
|
|
377
|
-
}
|
|
378
|
-
this._navigation.active = -1;
|
|
379
|
-
return true;
|
|
380
|
-
}
|
|
381
|
-
async hide() {
|
|
382
|
-
return await this._hide(false);
|
|
383
|
-
}
|
|
384
|
-
_toggle(emit = true) {
|
|
385
|
-
return this.open ? this._hide(emit) : this._show(emit);
|
|
464
|
+
_handleSearchInput({ detail }) {
|
|
465
|
+
this._searchTerm = detail;
|
|
386
466
|
}
|
|
387
|
-
|
|
388
|
-
|
|
467
|
+
_handleClosing() {
|
|
468
|
+
this._hide(true);
|
|
389
469
|
}
|
|
390
|
-
|
|
391
|
-
const
|
|
392
|
-
const id = this.id ? `${this.id}-item-${position}` : `item-${position}`;
|
|
393
|
-
return { id, position };
|
|
394
|
-
}
|
|
395
|
-
itemClickHandler(event) {
|
|
396
|
-
this._setTouchedState();
|
|
397
|
-
const target = findElementFromEventPath(IgcComboItemComponent.tagName, event);
|
|
470
|
+
async _itemClickHandler(event) {
|
|
471
|
+
const target = getElementFromPath(IgcComboItemComponent.tagName, event);
|
|
398
472
|
if (!target) {
|
|
399
473
|
return;
|
|
400
474
|
}
|
|
401
|
-
this.
|
|
402
|
-
|
|
403
|
-
this._inputRef.value.focus();
|
|
404
|
-
this._hide();
|
|
405
|
-
}
|
|
406
|
-
else {
|
|
407
|
-
this._searchRef.value.focus();
|
|
408
|
-
}
|
|
409
|
-
}
|
|
410
|
-
toggleSelect(index) {
|
|
411
|
-
const { dataIndex } = this._state.dataState.at(index);
|
|
412
|
-
this._selection.changeSelection(dataIndex);
|
|
413
|
-
this._navigation.active = index;
|
|
414
|
-
this.updateValue();
|
|
415
|
-
}
|
|
416
|
-
selectByIndex(index) {
|
|
417
|
-
const { dataIndex } = this._state.dataState.at(index);
|
|
418
|
-
this._selection.selectByIndex(dataIndex);
|
|
419
|
-
this._navigation.active = index;
|
|
420
|
-
this.updateValue();
|
|
421
|
-
}
|
|
422
|
-
clearSelection() {
|
|
475
|
+
this._setTouchedState();
|
|
476
|
+
this._toggleSelection(target.index);
|
|
423
477
|
if (this.singleSelect) {
|
|
424
|
-
this.
|
|
425
|
-
this.
|
|
478
|
+
this._inputRef.value?.focus();
|
|
479
|
+
await this._hide(true);
|
|
426
480
|
}
|
|
427
481
|
else {
|
|
428
|
-
this.
|
|
482
|
+
this._searchRef.value?.focus();
|
|
429
483
|
}
|
|
430
|
-
this.updateValue();
|
|
431
484
|
}
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
const item = this.valueKey ? selection[this.valueKey] : selection;
|
|
437
|
-
this._selection.deselect(item, !isEmpty(_selection));
|
|
438
|
-
this._formValue.value = [];
|
|
439
|
-
}
|
|
485
|
+
_handleClearIconClick(event) {
|
|
486
|
+
event.stopPropagation();
|
|
487
|
+
this._clearSelection();
|
|
488
|
+
this._activeIndex = -1;
|
|
440
489
|
}
|
|
441
|
-
|
|
442
|
-
e.stopPropagation();
|
|
443
|
-
this.clearSelection();
|
|
444
|
-
this._navigation.active = -1;
|
|
445
|
-
}
|
|
446
|
-
toggleCaseSensitivity() {
|
|
490
|
+
_handleCaseSensitivity() {
|
|
447
491
|
this.filteringOptions = {
|
|
448
492
|
caseSensitive: !this.filteringOptions.caseSensitive,
|
|
449
493
|
};
|
|
450
494
|
}
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
495
|
+
focus(options) {
|
|
496
|
+
this._inputRef.value?.focus(options);
|
|
497
|
+
}
|
|
498
|
+
blur() {
|
|
499
|
+
this._inputRef.value?.blur();
|
|
455
500
|
}
|
|
456
|
-
|
|
457
|
-
|
|
501
|
+
select(items) {
|
|
502
|
+
this._selectItems(items);
|
|
503
|
+
this._syncValueFromSelection();
|
|
504
|
+
}
|
|
505
|
+
deselect(items) {
|
|
506
|
+
this._deselectItems(items);
|
|
507
|
+
this._syncValueFromSelection();
|
|
458
508
|
}
|
|
459
|
-
|
|
509
|
+
_renderToggleIcon() {
|
|
460
510
|
return html `
|
|
461
511
|
<span
|
|
462
512
|
slot="suffix"
|
|
@@ -475,14 +525,14 @@ let IgcComboComponent = class IgcComboComponent extends FormAssociatedRequiredMi
|
|
|
475
525
|
</span>
|
|
476
526
|
`;
|
|
477
527
|
}
|
|
478
|
-
|
|
528
|
+
_renderClearIcon() {
|
|
479
529
|
return html `
|
|
480
530
|
<span
|
|
481
531
|
slot="suffix"
|
|
482
532
|
part="clear-icon"
|
|
483
|
-
@click=${this.
|
|
484
|
-
?hidden=${this.disableClear || this.
|
|
485
|
-
aria-label=${this.resourceStrings.combo_clearItems_placeholder}
|
|
533
|
+
@click=${this._handleClearIconClick}
|
|
534
|
+
?hidden=${this.disableClear || isEmpty(this._selected)}
|
|
535
|
+
aria-label=${ifDefined(this.resourceStrings.combo_clearItems_placeholder)}
|
|
486
536
|
>
|
|
487
537
|
<slot name="clear-icon">
|
|
488
538
|
<igc-icon
|
|
@@ -494,7 +544,9 @@ let IgcComboComponent = class IgcComboComponent extends FormAssociatedRequiredMi
|
|
|
494
544
|
</span>
|
|
495
545
|
`;
|
|
496
546
|
}
|
|
497
|
-
|
|
547
|
+
_renderMainInput() {
|
|
548
|
+
const hasPrefix = this._slots.hasAssignedElements('prefix');
|
|
549
|
+
const hasSuffix = this._slots.hasAssignedElements('suffix');
|
|
498
550
|
return html `
|
|
499
551
|
<igc-input
|
|
500
552
|
${ref(this._inputRef)}
|
|
@@ -506,13 +558,13 @@ let IgcComboComponent = class IgcComboComponent extends FormAssociatedRequiredMi
|
|
|
506
558
|
aria-expanded=${this.open}
|
|
507
559
|
aria-describedby="combo-helper-text"
|
|
508
560
|
aria-disabled=${this.disabled}
|
|
509
|
-
aria-label=${this.
|
|
561
|
+
aria-label=${this._mainAriaLabel}
|
|
510
562
|
exportparts="container: input, input: native-input, label, prefix, suffix"
|
|
511
|
-
@click=${this.
|
|
563
|
+
@click=${this._handleAnchorClick}
|
|
512
564
|
placeholder=${ifDefined(this.placeholder)}
|
|
513
565
|
label=${ifDefined(this.label)}
|
|
514
|
-
@igcChange=${
|
|
515
|
-
@igcInput=${this.
|
|
566
|
+
@igcChange=${stopPropagation}
|
|
567
|
+
@igcInput=${this._handleMainInput}
|
|
516
568
|
.value=${this._displayValue}
|
|
517
569
|
.disabled=${this.disabled}
|
|
518
570
|
.required=${this.required}
|
|
@@ -521,18 +573,18 @@ let IgcComboComponent = class IgcComboComponent extends FormAssociatedRequiredMi
|
|
|
521
573
|
.autofocus=${this.autofocus}
|
|
522
574
|
?readonly=${!this.singleSelect}
|
|
523
575
|
>
|
|
524
|
-
<span slot=${
|
|
576
|
+
<span slot=${bindIf(hasPrefix, 'prefix')}>
|
|
525
577
|
<slot name="prefix"></slot>
|
|
526
578
|
</span>
|
|
527
|
-
${this.
|
|
528
|
-
<span slot=${
|
|
579
|
+
${this._renderClearIcon()}
|
|
580
|
+
<span slot=${bindIf(hasSuffix, 'suffix')}>
|
|
529
581
|
<slot name="suffix"></slot>
|
|
530
582
|
</span>
|
|
531
|
-
${this.
|
|
583
|
+
${this._renderToggleIcon()}
|
|
532
584
|
</igc-input>
|
|
533
585
|
`;
|
|
534
586
|
}
|
|
535
|
-
|
|
587
|
+
_renderSearchInput() {
|
|
536
588
|
return html `
|
|
537
589
|
<div
|
|
538
590
|
part="filter-input"
|
|
@@ -540,37 +592,37 @@ let IgcComboComponent = class IgcComboComponent extends FormAssociatedRequiredMi
|
|
|
540
592
|
>
|
|
541
593
|
<igc-input
|
|
542
594
|
${ref(this._searchRef)}
|
|
543
|
-
.value=${this.
|
|
595
|
+
.value=${this._searchTerm}
|
|
544
596
|
part="search-input"
|
|
545
597
|
placeholder=${this.placeholderSearch}
|
|
546
598
|
exportparts="input: search-input"
|
|
547
|
-
@igcInput=${this.
|
|
599
|
+
@igcInput=${this._handleSearchInput}
|
|
548
600
|
>
|
|
549
601
|
<igc-icon
|
|
550
|
-
slot=${this.caseSensitiveIcon
|
|
602
|
+
slot=${bindIf(this.caseSensitiveIcon, 'suffix')}
|
|
551
603
|
name="case_sensitive"
|
|
552
604
|
collection="default"
|
|
553
605
|
part=${partMap({
|
|
554
606
|
'case-icon': true,
|
|
555
|
-
active: this.filteringOptions.caseSensitive
|
|
607
|
+
active: this.filteringOptions.caseSensitive,
|
|
556
608
|
})}
|
|
557
|
-
@click=${this.
|
|
609
|
+
@click=${this._handleCaseSensitivity}
|
|
558
610
|
></igc-icon>
|
|
559
611
|
</igc-input>
|
|
560
612
|
</div>
|
|
561
613
|
`;
|
|
562
614
|
}
|
|
563
|
-
|
|
615
|
+
_renderEmptyTemplate() {
|
|
564
616
|
return html `
|
|
565
617
|
<div part="empty" ?hidden=${!isEmpty(this._state.dataState)}>
|
|
566
618
|
<slot name="empty">${this.resourceStrings.combo_empty_message}</slot>
|
|
567
619
|
</div>
|
|
568
620
|
`;
|
|
569
621
|
}
|
|
570
|
-
|
|
622
|
+
_renderList() {
|
|
571
623
|
return html `
|
|
572
624
|
<div .inert=${!this.open} part="list-wrapper">
|
|
573
|
-
${this.
|
|
625
|
+
${this._renderSearchInput()}
|
|
574
626
|
<div part="header">
|
|
575
627
|
<slot name="header"></slot>
|
|
576
628
|
</div>
|
|
@@ -584,19 +636,19 @@ let IgcComboComponent = class IgcComboComponent extends FormAssociatedRequiredMi
|
|
|
584
636
|
aria-labelledby="target"
|
|
585
637
|
aria-activedescendant=${ifDefined(this._activeDescendant)}
|
|
586
638
|
.items=${this._state.dataState}
|
|
587
|
-
.renderItem=${this.
|
|
639
|
+
.renderItem=${this._itemRenderer}
|
|
588
640
|
?hidden=${isEmpty(this._state.dataState)}
|
|
589
|
-
@click=${this.
|
|
641
|
+
@click=${this._itemClickHandler}
|
|
590
642
|
>
|
|
591
643
|
</igc-combo-list>
|
|
592
|
-
${this.
|
|
644
|
+
${this._renderEmptyTemplate()}
|
|
593
645
|
<div part="footer">
|
|
594
646
|
<slot name="footer"></slot>
|
|
595
647
|
</div>
|
|
596
648
|
</div>
|
|
597
649
|
`;
|
|
598
650
|
}
|
|
599
|
-
|
|
651
|
+
_renderHelperText() {
|
|
600
652
|
return IgcValidationContainerComponent.create(this, {
|
|
601
653
|
id: 'combo-helper-text',
|
|
602
654
|
hasHelperText: true,
|
|
@@ -605,24 +657,24 @@ let IgcComboComponent = class IgcComboComponent extends FormAssociatedRequiredMi
|
|
|
605
657
|
render() {
|
|
606
658
|
return html `
|
|
607
659
|
<igc-popover ?open=${this.open} flip shift same-width>
|
|
608
|
-
${this.
|
|
660
|
+
${this._renderMainInput()} ${this._renderList()}
|
|
609
661
|
</igc-popover>
|
|
610
|
-
${this.
|
|
662
|
+
${this._renderHelperText()}
|
|
611
663
|
`;
|
|
612
664
|
}
|
|
613
665
|
};
|
|
614
666
|
__decorate([
|
|
615
667
|
state()
|
|
616
|
-
], IgcComboComponent.prototype, "
|
|
668
|
+
], IgcComboComponent.prototype, "_activeIndex", null);
|
|
617
669
|
__decorate([
|
|
618
670
|
state()
|
|
619
|
-
], IgcComboComponent.prototype, "
|
|
671
|
+
], IgcComboComponent.prototype, "_searchTerm", null);
|
|
620
672
|
__decorate([
|
|
621
|
-
|
|
622
|
-
], IgcComboComponent.prototype, "
|
|
673
|
+
state()
|
|
674
|
+
], IgcComboComponent.prototype, "_activeDescendant", void 0);
|
|
623
675
|
__decorate([
|
|
624
|
-
|
|
625
|
-
], IgcComboComponent.prototype, "
|
|
676
|
+
state()
|
|
677
|
+
], IgcComboComponent.prototype, "_displayValue", void 0);
|
|
626
678
|
__decorate([
|
|
627
679
|
property({ attribute: false })
|
|
628
680
|
], IgcComboComponent.prototype, "data", null);
|
|
@@ -650,9 +702,6 @@ __decorate([
|
|
|
650
702
|
__decorate([
|
|
651
703
|
property({ attribute: 'placeholder-search' })
|
|
652
704
|
], IgcComboComponent.prototype, "placeholderSearch", null);
|
|
653
|
-
__decorate([
|
|
654
|
-
property({ type: Boolean, reflect: true })
|
|
655
|
-
], IgcComboComponent.prototype, "open", void 0);
|
|
656
705
|
__decorate([
|
|
657
706
|
property({ attribute: false })
|
|
658
707
|
], IgcComboComponent.prototype, "resourceStrings", null);
|
|
@@ -664,10 +713,10 @@ __decorate([
|
|
|
664
713
|
], IgcComboComponent.prototype, "displayKey", null);
|
|
665
714
|
__decorate([
|
|
666
715
|
property({ attribute: 'group-key' })
|
|
667
|
-
], IgcComboComponent.prototype, "groupKey",
|
|
716
|
+
], IgcComboComponent.prototype, "groupKey", void 0);
|
|
668
717
|
__decorate([
|
|
669
718
|
property({ attribute: 'group-sorting' })
|
|
670
|
-
], IgcComboComponent.prototype, "groupSorting",
|
|
719
|
+
], IgcComboComponent.prototype, "groupSorting", void 0);
|
|
671
720
|
__decorate([
|
|
672
721
|
property({ type: Object, attribute: 'filtering-options' })
|
|
673
722
|
], IgcComboComponent.prototype, "filteringOptions", null);
|
|
@@ -689,9 +738,6 @@ __decorate([
|
|
|
689
738
|
__decorate([
|
|
690
739
|
property({ type: Array })
|
|
691
740
|
], IgcComboComponent.prototype, "value", null);
|
|
692
|
-
__decorate([
|
|
693
|
-
watch('open')
|
|
694
|
-
], IgcComboComponent.prototype, "toggleDirectiveChange", null);
|
|
695
741
|
IgcComboComponent = IgcComboComponent_1 = __decorate([
|
|
696
742
|
blazorAdditionalDependencies('IgcIconComponent, IgcInputComponent'),
|
|
697
743
|
blazorIndirectRender
|