igniteui-webcomponents 7.2.3 → 7.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (104) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/animations/player.d.ts +4 -11
  3. package/animations/player.js +3 -9
  4. package/animations/player.js.map +1 -1
  5. package/animations/view-transition.d.ts +44 -0
  6. package/animations/view-transition.js +81 -0
  7. package/animations/view-transition.js.map +1 -0
  8. package/components/avatar/avatar.js +7 -7
  9. package/components/avatar/avatar.js.map +1 -1
  10. package/components/button/button-base.d.ts +1 -1
  11. package/components/button/button-base.js +7 -5
  12. package/components/button/button-base.js.map +1 -1
  13. package/components/button/icon-button.js +9 -9
  14. package/components/button/icon-button.js.map +1 -1
  15. package/components/calendar/calendar.js.map +1 -1
  16. package/components/calendar/days-view/days-view.js.map +1 -1
  17. package/components/carousel/carousel.js +1 -2
  18. package/components/carousel/carousel.js.map +1 -1
  19. package/components/chat/chat-input.js +4 -4
  20. package/components/chat/chat-input.js.map +1 -1
  21. package/components/chat/chat.js +6 -6
  22. package/components/chat/chat.js.map +1 -1
  23. package/components/chat/message-attachments.js.map +1 -1
  24. package/components/checkbox/checkbox.js.map +1 -1
  25. package/components/combo/combo.d.ts +1 -0
  26. package/components/combo/combo.js +9 -1
  27. package/components/combo/combo.js.map +1 -1
  28. package/components/common/controllers/gestures.js.map +1 -1
  29. package/components/common/controllers/internals.d.ts +9 -0
  30. package/components/common/controllers/internals.js +4 -0
  31. package/components/common/controllers/internals.js.map +1 -1
  32. package/components/common/controllers/mutation-observer.d.ts +2 -2
  33. package/components/common/controllers/mutation-observer.js +10 -7
  34. package/components/common/controllers/mutation-observer.js.map +1 -1
  35. package/components/common/controllers/slot.d.ts +1 -1
  36. package/components/common/controllers/slot.js +4 -1
  37. package/components/common/controllers/slot.js.map +1 -1
  38. package/components/common/i18n/utils.js.map +1 -1
  39. package/components/common/mixins/forms/associated.d.ts +1 -1
  40. package/components/common/mixins/forms/associated.js +21 -13
  41. package/components/common/mixins/forms/associated.js.map +1 -1
  42. package/components/common/mixins/forms/types.d.ts +2 -1
  43. package/components/common/mixins/forms/types.js.map +1 -1
  44. package/components/common/templates/masked-input.d.ts +2 -0
  45. package/components/common/templates/masked-input.js +2 -1
  46. package/components/common/templates/masked-input.js.map +1 -1
  47. package/components/date-picker/date-picker.d.ts +2 -1
  48. package/components/date-picker/date-picker.js +6 -0
  49. package/components/date-picker/date-picker.js.map +1 -1
  50. package/components/date-range-picker/date-range-mask-parser.js.map +1 -1
  51. package/components/date-range-picker/date-range-picker.d.ts +2 -1
  52. package/components/date-range-picker/date-range-picker.js +10 -8
  53. package/components/date-range-picker/date-range-picker.js.map +1 -1
  54. package/components/date-range-picker/predefined-ranges-area.js.map +1 -1
  55. package/components/date-time-input/date-time-input.base.d.ts +15 -0
  56. package/components/date-time-input/date-time-input.base.js +9 -1
  57. package/components/date-time-input/date-time-input.base.js.map +1 -1
  58. package/components/dialog/dialog.js +4 -4
  59. package/components/dialog/dialog.js.map +1 -1
  60. package/components/file-input/file-input.js.map +1 -1
  61. package/components/icon/icon-state.broadcast.js.map +1 -1
  62. package/components/icon/icon.d.ts +3 -2
  63. package/components/icon/icon.js +7 -2
  64. package/components/icon/icon.js.map +1 -1
  65. package/components/input/input-base.d.ts +15 -0
  66. package/components/input/input-base.js +8 -1
  67. package/components/input/input-base.js.map +1 -1
  68. package/components/input/input.js +1 -0
  69. package/components/input/input.js.map +1 -1
  70. package/components/mask-input/mask-input.js +1 -0
  71. package/components/mask-input/mask-input.js.map +1 -1
  72. package/components/select/select.d.ts +7 -1
  73. package/components/select/select.js +12 -1
  74. package/components/select/select.js.map +1 -1
  75. package/components/slider/range-slider.js +5 -5
  76. package/components/slider/range-slider.js.map +1 -1
  77. package/components/slider/slider-base.js +9 -9
  78. package/components/slider/slider-base.js.map +1 -1
  79. package/components/snackbar/snackbar.js +4 -4
  80. package/components/snackbar/snackbar.js.map +1 -1
  81. package/components/splitter/splitter.js.map +1 -1
  82. package/components/stepper/common/animations.js.map +1 -1
  83. package/components/stepper/step.js.map +1 -1
  84. package/components/tabs/tabs.js +29 -10
  85. package/components/tabs/tabs.js.map +1 -1
  86. package/components/textarea/textarea.js +1 -0
  87. package/components/textarea/textarea.js.map +1 -1
  88. package/components/tile-manager/tile.js +14 -13
  89. package/components/tile-manager/tile.js.map +1 -1
  90. package/components/tooltip/tooltip.js +8 -8
  91. package/components/tooltip/tooltip.js.map +1 -1
  92. package/components/tree/tree-item.js +31 -31
  93. package/components/tree/tree-item.js.map +1 -1
  94. package/components/types.js.map +1 -1
  95. package/components/validation-container/validation-container.d.ts +32 -5
  96. package/components/validation-container/validation-container.js +74 -64
  97. package/components/validation-container/validation-container.js.map +1 -1
  98. package/custom-elements.json +780 -137
  99. package/igniteui-webcomponents.html-data.json +1 -1
  100. package/index.d.ts +3 -3
  101. package/index.js.map +1 -1
  102. package/package.json +1 -1
  103. package/skills/igniteui-wc-generate-from-image-design/references/gotchas.md +15 -1
  104. package/web-types.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"combo.js","sourceRoot":"","sources":["../../../src/components/combo/combo.ts"],"names":[],"mappings":";;;;;;;AAAA,OAAO,EACL,sBAAsB,GAEvB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,IAAI,EAAE,OAAO,EAA4C,MAAM,KAAK,CAAC;AAC9E,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAC;AAEvD,OAAO,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;AAC3E,OAAO,EAAE,sBAAsB,EAAE,MAAM,qCAAqC,CAAC;AAC7E,OAAO,EAAE,iBAAiB,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAC5E,OAAO,EAA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from 'igniteui-i18n-core';\nimport { html, nothing, type PropertyValues, type TemplateResult } from 'lit';\nimport { property, state } from 'lit/decorators.js';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { createRef, ref } from 'lit/directives/ref.js';\n\nimport { addThemingController } from '../../theming/theming-controller.js';\nimport { addRootClickController } from '../common/controllers/root-click.js';\nimport { addSlotController, setSlots } from '../common/controllers/slot.js';\nimport { blazorAdditionalDependencies } from '../common/decorators/blazorAdditionalDependencies.js';\nimport { blazorIndirectRender } from '../common/decorators/blazorIndirectRender.js';\nimport { registerComponent } from '../common/definitions/register.js';\nimport { addI18nController } from '../common/i18n/i18n-controller.js';\nimport { IgcBaseComboBoxComponent } from '../common/mixins/combo-box.js';\nimport type { AbstractConstructor } from '../common/mixins/constructor.js';\nimport { EventEmitterMixin } from '../common/mixins/event-emitter.js';\nimport { FormAssociatedRequiredMixin } from '../common/mixins/forms/associated-required.js';\nimport { createFormValueState } from '../common/mixins/forms/form-value.js';\nimport { partMap } from '../common/part-map.js';\nimport {\n addSafeEventListener,\n asArray,\n bindIf,\n first,\n getElementFromPath,\n isDefined,\n isEmpty,\n stopPropagation,\n} from '../common/util.js';\nimport type { Validator } from '../common/validators.js';\nimport IgcIconComponent from '../icon/icon.js';\nimport IgcInputComponent from '../input/input.js';\nimport IgcPopoverComponent from '../popover/popover.js';\nimport IgcValidationContainerComponent from '../validation-container/validation-container.js';\nimport IgcComboHeaderComponent from './combo-header.js';\nimport IgcComboItemComponent from './combo-item.js';\nimport IgcComboListComponent from './combo-list.js';\nimport { DataState } from './controllers/data.js';\nimport { ComboNavigationController } from './controllers/navigation.js';\nimport { styles } from './themes/combo.base.css.js';\nimport { styles as shared } from './themes/shared/combo.common.css.js';\nimport { all } from './themes/themes.js';\nimport type {\n ComboItemTemplate,\n ComboRecord,\n ComboRenderFunction,\n ComboValue,\n FilteringOptions,\n GroupingDirection,\n IgcComboChangeEventArgs,\n IgcComboComponentEventMap,\n Item,\n Keys,\n Values,\n} from './types.js';\nimport { comboValidators } from './validators.js';\n\nconst SLOTS = setSlots(\n 'prefix',\n 'suffix',\n 'header',\n 'footer',\n 'empty',\n 'helper-text',\n 'toggle-icon',\n 'clear-icon',\n 'value-missing',\n 'custom-error',\n 'invalid'\n);\n\n/* blazorSupportsVisualChildren */\n/**\n * The Combo component is similar to the Select component in that it provides a list of options from which the user can make a selection.\n * In contrast to the Select component, the Combo component displays all options in a virtualized list of items,\n * meaning the combo box can simultaneously show thousands of options, where one or more options can be selected.\n * Additionally, users can create custom item templates, allowing for robust data visualization.\n * The Combo component features case-sensitive filtering, grouping, complex data binding, dynamic addition of values and more.\n *\n * @element igc-combo\n *\n * @slot prefix - Renders content before the input of the combo.\n * @slot suffix - Renders content after the input of the combo.\n * @slot header - Renders a container before the list of options of the combo.\n * @slot footer - Renders a container after the list of options of the combo.\n * @slot empty - Renders content when the combo dropdown list has no items/data.\n * @slot helper-text - Renders content below the input of the combo.\n * @slot toggle-icon - Renders content inside the suffix container of the combo.\n * @slot clear-icon - Renders content inside the suffix container of the combo.\n * @slot value-missing - Renders content when the required validation fails.\n * @slot custom-error - Renders content when setCustomValidity(message) is set.\n * @slot invalid - Renders content when the component is in invalid state (validity.valid = false).\n *\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 of the combo.\n * @csspart input - The main input field of the combo.\n * @csspart native-input - The native input of the main input field of the combo.\n * @csspart prefix - The prefix wrapper of the combo.\n * @csspart suffix - The suffix wrapper of the combo.\n * @csspart toggle-icon - The toggle icon wrapper of the combo.\n * @csspart clear-icon - The clear icon wrapper of the combo.\n * @csspart case-icon - The case icon wrapper of the combo.\n * @csspart helper-text - The helper text wrapper of the combo.\n * @csspart search-input - The search input field of the combo.\n * @csspart list-wrapper - The list of options wrapper of the combo.\n * @csspart list - The list of options box of the combo.\n * @csspart item - Represents each item in the list of options of the combo.\n * @csspart group-header - Represents each header in the list of options of the combo.\n * @csspart active - Appended to the item parts list when the item is active of the combo.\n * @csspart selected - Appended to the item parts list when the item is selected of the combo.\n * @csspart checkbox - Represents each checkbox of each list item of the combo.\n * @csspart checkbox-indicator - Represents the checkbox indicator of each list item of the combo.\n * @csspart checked - Appended to checkbox parts list when checkbox is checked in the combo.\n * @csspart header - The container holding the header content of the combo.\n * @csspart footer - The container holding the footer content of the combo.\n * @csspart empty - The container holding the empty content of the combo.\n */\n@blazorAdditionalDependencies('IgcIconComponent, IgcInputComponent')\n@blazorIndirectRender\nexport default class IgcComboComponent<\n T extends object = any,\n> extends FormAssociatedRequiredMixin(\n EventEmitterMixin<\n IgcComboComponentEventMap,\n AbstractConstructor<IgcBaseComboBoxComponent>\n >(IgcBaseComboBoxComponent)\n) {\n public static readonly tagName = 'igc-combo';\n public static styles = [styles, shared];\n\n /* blazorSuppress */\n public static register(): void {\n registerComponent(\n IgcComboComponent,\n IgcIconComponent,\n IgcComboListComponent,\n IgcComboItemComponent,\n IgcComboHeaderComponent,\n IgcInputComponent,\n IgcPopoverComponent,\n IgcValidationContainerComponent\n );\n }\n\n // #region Internal state and controllers\n\n protected override get __validators(): Validator<IgcComboComponent<T>>[] {\n return comboValidators;\n }\n\n private readonly _slots = addSlotController(this, { slots: SLOTS });\n\n protected override readonly _rootClickController = addRootClickController(\n this,\n {\n onHide: this._handleClosing,\n }\n );\n\n protected readonly _i18nController = addI18nController<IComboResourceStrings>(\n this,\n {\n defaultEN: ComboResourceStringsEN,\n }\n );\n\n protected override readonly _formValue = createFormValueState<\n ComboValue<T>[]\n >(this, {\n initialValue: [],\n transformers: {\n setValue: asArray,\n setDefaultValue: asArray,\n setFormValue: (value) => {\n if (isEmpty(value) || !this.name) {\n return null;\n }\n\n if (this.singleSelect) {\n return String(first(value));\n }\n\n const formData = new FormData();\n\n for (const item of value) {\n formData.append(this.name, String(item));\n }\n\n return formData;\n },\n },\n });\n\n /** The primary input of the combo component. */\n private readonly _inputRef = createRef<IgcInputComponent>();\n\n /** The search input of the combo component. */\n private readonly _searchRef = createRef<IgcInputComponent>();\n\n /** The combo virtualized dropdown list. */\n private readonly _listRef = createRef<IgcComboListComponent>();\n\n private readonly _state = new DataState<T>(this);\n private readonly _navigation = new ComboNavigationController(\n this,\n this._state,\n {\n input: this._inputRef,\n search: this._searchRef,\n list: this._listRef,\n interactions: {\n show: () => this._show(true),\n hide: () => this._hide(true),\n toggleSelection: (index: number) => this._toggleSelection(index),\n select: (index: number) => this._selectByIndex(index),\n clearSelection: () => this._clearSelection(),\n },\n }\n );\n\n private _data: T[] = [];\n private _valueKey?: Keys<T>;\n private _displayKey?: Keys<T>;\n private _placeholderSearch?: string;\n private _disableFiltering = false;\n private _singleSelect = false;\n private _selected: Set<T> = new Set();\n private _filteringOptions: FilteringOptions<T> = {\n filterKey: this.displayKey,\n caseSensitive: false,\n matchDiacritics: false,\n };\n\n @state()\n private set _activeIndex(index: number) {\n this._navigation.active = index;\n }\n\n private get _activeIndex(): number {\n return this._navigation.active;\n }\n\n @state()\n private set _searchTerm(value: string) {\n this._state.searchTerm = value;\n }\n\n private get _searchTerm(): string {\n return this._state.searchTerm;\n }\n\n @state()\n private _activeDescendant?: string;\n\n @state()\n private _displayValue = '';\n\n private get _mainAriaLabel(): string {\n return isEmpty(this._selected)\n ? this.resourceStrings.combo_aria_label_no_options!\n : this.resourceStrings.combo_aria_label_options!;\n }\n\n // #endregion\n\n //#region Public attributes and properties\n\n /** The data source used to generate the list of options. */\n /* treatAsRef */\n @property({ attribute: false })\n public set data(value: T[]) {\n if (this._data !== value) {\n this._data = asArray(value);\n }\n }\n\n public get data(): T[] {\n return this._data;\n }\n\n /**\n * The outlined attribute of the control.\n * @attr outlined\n * @default false\n */\n @property({ type: Boolean, reflect: true })\n public outlined = false;\n\n /**\n * Enables single selection mode and moves item filtering to the main input.\n * @attr single-select\n * @default false\n */\n @property({ type: Boolean, reflect: true, attribute: 'single-select' })\n public set singleSelect(value: boolean) {\n this._singleSelect = Boolean(value);\n this._syncSelectionFromValue();\n\n if (this.hasUpdated) {\n const pristine = this._pristine;\n this._activeIndex = -1;\n this._searchTerm = '';\n this._formValue.setValueAndFormState(this.value);\n this._pristine = pristine;\n }\n }\n\n public get singleSelect(): boolean {\n return this._singleSelect;\n }\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 * @default false\n */\n @property({ type: Boolean, attribute: 'autofocus-list' })\n public autofocusList = false;\n\n /**\n * Gets/Sets the locale used for getting language, affecting resource strings.\n * @attr locale\n */\n @property()\n public set locale(value: string) {\n this._i18nController.locale = value;\n this._state.updateLocale(value);\n }\n\n public get locale(): string {\n return this._i18nController.locale;\n }\n\n /**\n * The label attribute of the control.\n * @attr label\n */\n @property()\n public label?: string;\n\n /**\n * The placeholder attribute of the control.\n * @attr placeholder\n */\n @property()\n public placeholder?: string;\n\n /**\n * The placeholder attribute of the search input.\n * @attr placeholder-search\n */\n @property({ attribute: 'placeholder-search' })\n public set placeholderSearch(value: string | undefined) {\n this._placeholderSearch = value;\n }\n\n public get placeholderSearch(): string {\n return (\n this._placeholderSearch ??\n this.resourceStrings.combo_filter_search_placeholder ??\n 'Search'\n );\n }\n\n /**\n * The resource strings for localization.\n */\n @property({ attribute: false })\n public set resourceStrings(value: IComboResourceStrings) {\n this._i18nController.resourceStrings = value;\n }\n\n public get resourceStrings(): IComboResourceStrings {\n return this._i18nController.resourceStrings;\n }\n\n /**\n * The key in the data source used when selecting items.\n * @attr value-key\n */\n @property({ attribute: 'value-key' })\n public set valueKey(value: Keys<T> | undefined) {\n this._valueKey = value;\n this._displayKey = this._displayKey ?? this._valueKey;\n }\n\n public get valueKey() {\n return this._valueKey;\n }\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' })\n public set displayKey(value: Keys<T> | undefined) {\n this._displayKey = value;\n if (!this.filteringOptions.filterKey) {\n this.filteringOptions = { filterKey: this.displayKey };\n }\n }\n\n public get displayKey() {\n return this._displayKey ?? this._valueKey;\n }\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' })\n public groupKey?: Keys<T> | string;\n\n /**\n * Sorts the items in each group by ascending or descending order.\n * @attr group-sorting\n * @default \"asc\"\n * @type {\"asc\" | \"desc\" | \"none\"}\n */\n @property({ attribute: 'group-sorting' })\n public groupSorting: GroupingDirection = 'asc';\n\n /**\n * An object that configures the filtering of the combo.\n * @attr filtering-options\n */\n @property({ type: Object, attribute: 'filtering-options' })\n public set filteringOptions(value: Partial<FilteringOptions<T>>) {\n this._filteringOptions = { ...this._filteringOptions, ...value };\n }\n\n public get filteringOptions(): FilteringOptions<T> {\n return this._filteringOptions;\n }\n\n /**\n * Enables the case sensitive search icon in the filtering input.\n * @attr case-sensitive-icon\n * @default false\n */\n @property({ type: Boolean, attribute: 'case-sensitive-icon' })\n public caseSensitiveIcon = false;\n\n /**\n * Disables the filtering of the list of options.\n * @attr disable-filtering\n * @default false\n */\n @property({ type: Boolean, attribute: 'disable-filtering' })\n public set disableFiltering(value: boolean) {\n this._disableFiltering = value;\n this._searchTerm = '';\n }\n\n public get disableFiltering(): boolean {\n return this._disableFiltering;\n }\n\n /**\n * Hides the clear button.\n * @attr disable-clear\n * @default false\n */\n @property({ type: Boolean, attribute: 'disable-clear' })\n public disableClear = 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 html`${this.displayKey ? item[this.displayKey] : item}`;\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 html`${this.groupKey && item[this.groupKey as Keys<T>]}`;\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 /* blazorPrimitiveValue */\n /* blazorByValueArray */\n /* blazorGenericType */\n /* @tsTwoWayProperty (true, \"Change\", \"Detail.NewValue\", false) */\n @property({ type: Array })\n public set value(items: ComboValue<T>[]) {\n this._formValue.setValueAndFormState(items);\n this._syncSelectionFromValue();\n\n if (this.hasUpdated) {\n this._validate();\n }\n }\n\n /**\n * Returns the current selection as a list of comma separated values,\n * represented by the value key, when provided.\n */\n public get value(): ComboValue<T>[] {\n return this._formValue.value;\n }\n\n /**\n * Returns the current selection as an array of objects as provided in the `data` source.\n */\n public get selection(): T[] {\n return Array.from(this._selected);\n }\n\n //#endregion\n\n //#region Life-cycle\n\n constructor() {\n super();\n\n addThemingController(this, all);\n addSafeEventListener(this, 'blur', this._handleBlur);\n addSafeEventListener(this, 'focusin', this._handleFocusIn);\n }\n\n protected override willUpdate(props: PropertyValues<this>): void {\n if (props.has('open')) {\n this._rootClickController.update();\n }\n\n if (\n props.has('groupKey') ||\n props.has('groupSorting') ||\n props.has('filteringOptions') ||\n props.has('data')\n ) {\n this._state.invalidate();\n }\n\n // When data changes, re-sync selection and form\n // This handles the delayed data scenario where value was set before data\n if (props.has('data') && !isEmpty(this.data) && !isEmpty(this.value)) {\n const pristine = this._pristine;\n this._syncSelectionFromValue();\n this._formValue.setValueAndFormState(this.value);\n this._pristine = pristine;\n }\n }\n\n //#endregion\n\n // #region Form Associated overrides\n\n protected override _restoreDefaultValue(): void {\n super._restoreDefaultValue();\n this._syncSelectionFromValue();\n }\n\n protected override _setDefaultValue(current: string | null): void {\n try {\n this.defaultValue = JSON.parse(current || '[]');\n } catch {}\n }\n\n // #endregion\n\n //#region Overrides for combo box behavior\n\n protected override async _show(emitEvent = false): Promise<boolean> {\n const [canOpen, _] = await Promise.all([\n super._show(emitEvent),\n this.updateComplete,\n ]);\n\n if (canOpen) {\n if (!this.singleSelect) {\n this._listRef.value?.focus();\n }\n\n if (!this.autofocusList) {\n this._searchRef.value?.focus();\n }\n }\n\n return canOpen;\n }\n\n protected override async _hide(emitEvent = false): Promise<boolean> {\n const [canClose, _] = await Promise.all([\n super._hide(emitEvent),\n this.updateComplete,\n ]);\n\n if (canClose) {\n this._activeIndex = -1;\n }\n\n return canClose;\n }\n\n private _setSingleSelectionDisplayValue(value: string): void {\n if (this.singleSelect && this._inputRef.value) {\n this._inputRef.value.value = value;\n }\n }\n\n //#endregion\n\n // #region Selection helpers\n\n /**\n * Resolves user-provided items (value keys or object references)\n * to actual objects from the data source in a single pass.\n */\n private _resolveItems(items: Item<T>[]): T[] {\n if (this.valueKey) {\n const keys = new Set(items as Values<T>[]);\n return this.data.filter((item) => keys.has(item[this.valueKey!]));\n }\n\n const dataSet = new Set(this.data);\n return (items as T[]).filter((item) => dataSet.has(item));\n }\n\n /**\n * Gets the value representation of a data record\n * (its value-key property, or the record itself).\n */\n private _resolveItemValue(record: T): Item<T> {\n return this.valueKey ? record[this.valueKey] : record;\n }\n\n /**\n * Maps data items to their value representations using the given key.\n * When key is undefined, returns the items themselves.\n */\n private _getValues(items: Iterable<T>, key?: Keys<T>): ComboValue<T>[] {\n return Iterator.from(items)\n .map((item) => (key ? item[key] : undefined) ?? item)\n .toArray();\n }\n\n private _emitSelectionChange(detail: IgcComboChangeEventArgs): boolean {\n return this.emitEvent('igcChange', { cancelable: true, detail });\n }\n\n private _selectItems(items?: Item<T> | Item<T>[], emit = false): void {\n let collection = asArray(items);\n\n if (this.singleSelect) {\n this._selected.clear();\n this._searchTerm = '';\n }\n\n if (isEmpty(collection)) {\n if (!this.singleSelect) {\n this._selected = new Set(this.data);\n this.requestUpdate();\n }\n return;\n }\n\n if (this.singleSelect) {\n collection = collection.slice(0, 1);\n }\n\n const resolved = this._resolveItems(collection);\n\n if (\n emit &&\n !this._emitSelectionChange({\n newValue: this._getValues(\n [...resolved, ...this._selected],\n this.valueKey\n ),\n items: resolved,\n type: 'selection',\n })\n ) {\n return;\n }\n\n for (const item of resolved) {\n this._selected.add(item);\n }\n\n this.requestUpdate();\n }\n\n private _deselectItems(items?: Item<T> | Item<T>[], emit = false): void {\n let collection = asArray(items);\n\n if (isEmpty(collection)) {\n if (\n emit &&\n !this._emitSelectionChange({\n newValue: [],\n items: Array.from(this._selected),\n type: 'deselection',\n })\n ) {\n return;\n }\n\n this._selected.clear();\n this.requestUpdate();\n return;\n }\n\n if (this.singleSelect) {\n collection = collection.slice(0, 1);\n }\n\n const resolved = this._resolveItems(collection);\n const resolvedSet = new Set(resolved);\n const remaining = Array.from(this._selected).filter(\n (item) => !resolvedSet.has(item)\n );\n\n if (\n emit &&\n !this._emitSelectionChange({\n newValue: this._getValues(remaining, this.valueKey),\n items: resolved,\n type: 'deselection',\n })\n ) {\n return;\n }\n\n for (const item of resolved) {\n this._selected.delete(item);\n }\n\n this.requestUpdate();\n }\n\n /**\n * Syncs the internal `_selected` set from the current `_formValue`.\n * This is a one-way sync: source of truth (_formValue) → view (_selected).\n */\n private _syncSelectionFromValue(): void {\n this._selected.clear();\n\n if (!isEmpty(this._formValue.value)) {\n const values = this.singleSelect\n ? asArray(first(this._formValue.value))\n : this._formValue.value;\n\n if (this.singleSelect && values.length !== this._formValue.value.length) {\n this._formValue.setValueAndFormState(values);\n }\n\n const items = Iterator.from(values)\n .map((val) => this._findItemByValue(val, this.valueKey))\n .filter(isDefined);\n\n for (const item of items) {\n this._selected.add(item);\n }\n }\n\n this._displayValue = this._getValues(this._selected, this.displayKey).join(\n ', '\n );\n }\n\n /**\n * Finds an item in the data array by its value (or value key).\n * Returns undefined if the item is not found.\n */\n private _findItemByValue(value: ComboValue<T>, key?: Keys<T>): T | undefined {\n return this.data.find((item) => (key ? item[key] : item) === value);\n }\n\n protected _syncValueFromSelection(initial = false): void {\n const values = this._getValues(this._selected, this.valueKey);\n this._displayValue = this._getValues(this._selected, this.displayKey).join(\n ', '\n );\n this._formValue.setValueAndFormState(values);\n\n if (!initial) {\n this._setSingleSelectionDisplayValue(this._displayValue);\n this._validate();\n this._listRef.value?.requestUpdate();\n }\n }\n\n private _toggleSelection(index: number): void {\n const record = this.data[this._state.dataState[index].dataIndex];\n\n this._selected.has(record)\n ? this._deselectItems(this._resolveItemValue(record), true)\n : this._selectItems(this._resolveItemValue(record), true);\n\n this._activeIndex = index;\n this._syncValueFromSelection();\n }\n\n private _selectByIndex(index: number): void {\n this._selectItems(\n this._resolveItemValue(this.data[this._state.dataState[index].dataIndex]),\n true\n );\n this._activeIndex = index;\n this._syncValueFromSelection();\n }\n\n private _clearSelection(): void {\n if (this.singleSelect) {\n this._searchTerm = '';\n this._clearSingleSelection();\n } else {\n this._deselectItems([], true);\n }\n this._syncValueFromSelection();\n }\n\n private _clearSingleSelection(): void {\n const [selection] = this._selected;\n\n if (selection) {\n this._deselectItems(this._resolveItemValue(selection), true);\n this._formValue.setValueAndFormState([]);\n }\n }\n\n // #endregion\n\n //#region Event handlers\n\n protected async _handleMainInput({\n detail,\n }: CustomEvent<string>): Promise<void> {\n this._setTouchedState();\n this._show(true);\n this._searchTerm = detail;\n\n // wait for the dataState to update after filtering\n await this.updateComplete;\n\n this._activeIndex = this._state.dataState.findIndex((i) => !i.header);\n // clear the selection upon typing\n this._clearSingleSelection();\n }\n\n protected _handleFocusIn(): void {\n this._setTouchedState();\n }\n\n protected override _handleBlur(): void {\n if (isEmpty(this._selected)) {\n this._searchTerm = '';\n this._setSingleSelectionDisplayValue('');\n }\n super._handleBlur();\n }\n\n protected _handleSearchInput({ detail }: CustomEvent<string>): void {\n this._searchTerm = detail;\n }\n\n private _handleClosing(): void {\n this._hide(true);\n }\n\n private async _itemClickHandler(event: PointerEvent): Promise<void> {\n const target = getElementFromPath(IgcComboItemComponent.tagName, event);\n\n if (!target) {\n return;\n }\n\n this._setTouchedState();\n this._toggleSelection(target.index);\n\n if (this.singleSelect) {\n this._inputRef.value?.focus();\n await this._hide(true);\n } else {\n this._searchRef.value?.focus();\n }\n }\n\n private _handleClearIconClick(event: PointerEvent): void {\n event.stopPropagation();\n this._clearSelection();\n this._activeIndex = -1;\n }\n\n private _handleCaseSensitivity(): void {\n this.filteringOptions = {\n caseSensitive: !this.filteringOptions.caseSensitive,\n };\n }\n\n //#endregion\n\n //#region Public methods\n\n /* alternateName: focusComponent */\n /** Sets focus on the component. */\n public override focus(options?: FocusOptions): void {\n this._inputRef.value?.focus(options);\n }\n\n /* alternateName: blurComponent */\n /** Removes focus from the component. */\n public override blur(): void {\n this._inputRef.value?.blur();\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> | Item<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 *\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>[]): void {\n this._selectItems(items);\n this._syncValueFromSelection();\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> | Item<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 *\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>[]): void {\n this._deselectItems(items);\n this._syncValueFromSelection();\n }\n\n //#endregion\n\n protected _itemRenderer: ComboRenderFunction<T> = (\n item: ComboRecord<T>,\n index: number\n ) => {\n if (!item) {\n return nothing as unknown as TemplateResult;\n }\n\n if (this.groupKey && item.header) {\n return html`\n <igc-combo-header part=\"group-header\">\n ${this.groupHeaderTemplate({ item: item.value })}\n </igc-combo-header>\n `;\n }\n\n const position = index + 1;\n const id = this.id ? `${this.id}-item-${position}` : `item-${position}`;\n const active = this._activeIndex === index;\n const selected = this._selected.has(this.data[item.dataIndex]);\n\n if (active) {\n this._activeDescendant = id;\n }\n\n return html`\n <igc-combo-item\n id=${id}\n part=${partMap({ item: true, selected, active })}\n aria-setsize=${this._state.dataState.length}\n aria-posinset=${position}\n exportparts=\"checkbox, checkbox-indicator, checked\"\n .index=${index}\n ?active=${active}\n ?selected=${selected}\n ?hide-checkbox=${this.singleSelect}\n >\n ${this.itemTemplate({ item: item.value })}\n </igc-combo-item>\n `;\n };\n\n private _renderToggleIcon() {\n return html`\n <span\n slot=\"suffix\"\n part=${partMap({\n 'toggle-icon': true,\n filled: !isEmpty(this.value),\n })}\n >\n <slot name=\"toggle-icon\">\n <igc-icon\n name=${this.open ? 'input_collapse' : 'input_expand'}\n collection=\"default\"\n aria-hidden=\"true\"\n ></igc-icon>\n </slot>\n </span>\n `;\n }\n\n private _renderClearIcon() {\n return html`\n <span\n slot=\"suffix\"\n part=\"clear-icon\"\n @click=${this._handleClearIconClick}\n ?hidden=${this.disableClear || isEmpty(this._selected)}\n aria-label=${ifDefined(\n this.resourceStrings.combo_clearItems_placeholder\n )}\n >\n <slot name=\"clear-icon\">\n <igc-icon\n name=\"input_clear\"\n collection=\"default\"\n aria-hidden=\"true\"\n ></igc-icon>\n </slot>\n </span>\n `;\n }\n\n private _renderMainInput() {\n const hasPrefix = this._slots.hasAssignedElements('prefix');\n const hasSuffix = this._slots.hasAssignedElements('suffix');\n\n return html`\n <igc-input\n ${ref(this._inputRef)}\n id=\"target\"\n slot=\"anchor\"\n role=\"combobox\"\n aria-controls=\"dropdown\"\n aria-owns=\"dropdown\"\n aria-expanded=${this.open}\n aria-describedby=\"combo-helper-text\"\n aria-disabled=${this.disabled}\n aria-label=${this._mainAriaLabel}\n exportparts=\"container: input, input: native-input, label, prefix, suffix\"\n @click=${this._handleAnchorClick}\n placeholder=${ifDefined(this.placeholder)}\n label=${ifDefined(this.label)}\n @igcChange=${stopPropagation}\n @igcInput=${this._handleMainInput}\n .value=${this._displayValue}\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=${bindIf(hasPrefix, 'prefix')}>\n <slot name=\"prefix\"></slot>\n </span>\n ${this._renderClearIcon()}\n <span slot=${bindIf(hasSuffix, 'suffix')}>\n <slot name=\"suffix\"></slot>\n </span>\n ${this._renderToggleIcon()}\n </igc-input>\n `;\n }\n\n private _renderSearchInput() {\n return html`\n <div\n part=\"filter-input\"\n ?hidden=${this.disableFiltering || this.singleSelect}\n >\n <igc-input\n ${ref(this._searchRef)}\n .value=${this._searchTerm}\n part=\"search-input\"\n placeholder=${this.placeholderSearch}\n exportparts=\"input: search-input\"\n @igcInput=${this._handleSearchInput}\n >\n <igc-icon\n slot=${bindIf(this.caseSensitiveIcon, 'suffix')}\n name=\"case_sensitive\"\n collection=\"default\"\n part=${partMap({\n 'case-icon': true,\n active: this.filteringOptions.caseSensitive,\n })}\n @click=${this._handleCaseSensitivity}\n ></igc-icon>\n </igc-input>\n </div>\n `;\n }\n\n private _renderEmptyTemplate() {\n return html`\n <div part=\"empty\" ?hidden=${!isEmpty(this._state.dataState)}>\n <slot name=\"empty\">${this.resourceStrings.combo_empty_message}</slot>\n </div>\n `;\n }\n\n private _renderList() {\n return html`\n <div .inert=${!this.open} part=\"list-wrapper\">\n ${this._renderSearchInput()}\n <div part=\"header\">\n <slot name=\"header\"></slot>\n </div>\n <igc-combo-list\n ${ref(this._listRef)}\n aria-multiselectable=${!this.singleSelect}\n id=\"dropdown\"\n part=\"list\"\n role=\"listbox\"\n tabindex=\"0\"\n aria-labelledby=\"target\"\n aria-activedescendant=${ifDefined(this._activeDescendant)}\n .items=${this._state.dataState}\n .renderItem=${this._itemRenderer}\n ?hidden=${isEmpty(this._state.dataState)}\n @click=${this._itemClickHandler}\n >\n </igc-combo-list>\n ${this._renderEmptyTemplate()}\n <div part=\"footer\">\n <slot name=\"footer\"></slot>\n </div>\n </div>\n `;\n }\n\n private _renderHelperText(): TemplateResult {\n return IgcValidationContainerComponent.create(this, {\n id: 'combo-helper-text',\n hasHelperText: true,\n });\n }\n\n protected override render() {\n return html`\n <igc-popover ?open=${this.open} flip shift same-width>\n ${this._renderMainInput()} ${this._renderList()}\n </igc-popover>\n ${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,EACL,sBAAsB,GAEvB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,IAAI,EAAE,OAAO,EAA4C,MAAM,KAAK,CAAC;AAC9E,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,SAA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,EAAE,CAAC;4DAC7B;AAQjC;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,mBAAmB,EAAE,CAAC;yDAI3D;AAYM;IADN,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,CAAC;uDAC5B;AAQrB;IADN,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;uDAE2B;AAQnD;IADN,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;8DAE4B;AAiC3D;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;8CAQzB;AA1ZkB,iBAAiB;IAHrC,4BAA4B,CAAC,qCAAqC,CAAC;IACnE,oBAAoB;IACpB,aAAa,CAAC,EAAE,cAAc,EAAE,IAAI,EAAE,CAAC;GACnB,iBAAiB,CA4kCrC;eA5kCoB,iBAAiB","sourcesContent":["import {\n ComboResourceStringsEN,\n type IComboResourceStrings,\n} from 'igniteui-i18n-core';\nimport { html, nothing, type PropertyValues, type TemplateResult } from 'lit';\nimport { property, state } from 'lit/decorators.js';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { createRef, ref } from 'lit/directives/ref.js';\n\nimport { addThemingController } from '../../theming/theming-controller.js';\nimport { addRootClickController } from '../common/controllers/root-click.js';\nimport { addSlotController, setSlots } from '../common/controllers/slot.js';\nimport { blazorAdditionalDependencies } from '../common/decorators/blazorAdditionalDependencies.js';\nimport { blazorIndirectRender } from '../common/decorators/blazorIndirectRender.js';\nimport { shadowOptions } from '../common/decorators/shadow-options.js';\nimport { registerComponent } from '../common/definitions/register.js';\nimport { addI18nController } from '../common/i18n/i18n-controller.js';\nimport { IgcBaseComboBoxComponent } from '../common/mixins/combo-box.js';\nimport type { AbstractConstructor } from '../common/mixins/constructor.js';\nimport { EventEmitterMixin } from '../common/mixins/event-emitter.js';\nimport { FormAssociatedRequiredMixin } from '../common/mixins/forms/associated-required.js';\nimport { createFormValueState } from '../common/mixins/forms/form-value.js';\nimport { partMap } from '../common/part-map.js';\nimport {\n addSafeEventListener,\n asArray,\n bindIf,\n first,\n getElementFromPath,\n isDefined,\n isEmpty,\n stopPropagation,\n} from '../common/util.js';\nimport type { Validator } from '../common/validators.js';\nimport IgcIconComponent from '../icon/icon.js';\nimport IgcInputComponent from '../input/input.js';\nimport IgcPopoverComponent from '../popover/popover.js';\nimport IgcValidationContainerComponent from '../validation-container/validation-container.js';\nimport IgcComboHeaderComponent from './combo-header.js';\nimport IgcComboItemComponent from './combo-item.js';\nimport IgcComboListComponent from './combo-list.js';\nimport { DataState } from './controllers/data.js';\nimport { ComboNavigationController } from './controllers/navigation.js';\nimport { styles } from './themes/combo.base.css.js';\nimport { styles as shared } from './themes/shared/combo.common.css.js';\nimport { all } from './themes/themes.js';\nimport type {\n ComboItemTemplate,\n ComboRecord,\n ComboRenderFunction,\n ComboValue,\n FilteringOptions,\n GroupingDirection,\n IgcComboChangeEventArgs,\n IgcComboComponentEventMap,\n Item,\n Keys,\n Values,\n} from './types.js';\nimport { comboValidators } from './validators.js';\n\nconst SLOTS = setSlots(\n 'prefix',\n 'suffix',\n 'header',\n 'footer',\n 'empty',\n 'helper-text',\n 'toggle-icon',\n 'clear-icon',\n 'value-missing',\n 'custom-error',\n 'invalid'\n);\n\n/* blazorSupportsVisualChildren */\n/**\n * The Combo component is similar to the Select component in that it provides a list of options from which the user can make a selection.\n * In contrast to the Select component, the Combo component displays all options in a virtualized list of items,\n * meaning the combo box can simultaneously show thousands of options, where one or more options can be selected.\n * Additionally, users can create custom item templates, allowing for robust data visualization.\n * The Combo component features case-sensitive filtering, grouping, complex data binding, dynamic addition of values and more.\n *\n * @element igc-combo\n *\n * @slot prefix - Renders content before the input of the combo.\n * @slot suffix - Renders content after the input of the combo.\n * @slot header - Renders a container before the list of options of the combo.\n * @slot footer - Renders a container after the list of options of the combo.\n * @slot empty - Renders content when the combo dropdown list has no items/data.\n * @slot helper-text - Renders content below the input of the combo.\n * @slot toggle-icon - Renders content inside the suffix container of the combo.\n * @slot clear-icon - Renders content inside the suffix container of the combo.\n * @slot value-missing - Renders content when the required validation fails.\n * @slot custom-error - Renders content when setCustomValidity(message) is set.\n * @slot invalid - Renders content when the component is in invalid state (validity.valid = false).\n *\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 of the combo.\n * @csspart input - The main input field of the combo.\n * @csspart native-input - The native input of the main input field of the combo.\n * @csspart prefix - The prefix wrapper of the combo.\n * @csspart suffix - The suffix wrapper of the combo.\n * @csspart toggle-icon - The toggle icon wrapper of the combo.\n * @csspart clear-icon - The clear icon wrapper of the combo.\n * @csspart case-icon - The case icon wrapper of the combo.\n * @csspart helper-text - The helper text wrapper of the combo.\n * @csspart search-input - The search input field of the combo.\n * @csspart list-wrapper - The list of options wrapper of the combo.\n * @csspart list - The list of options box of the combo.\n * @csspart item - Represents each item in the list of options of the combo.\n * @csspart group-header - Represents each header in the list of options of the combo.\n * @csspart active - Appended to the item parts list when the item is active of the combo.\n * @csspart selected - Appended to the item parts list when the item is selected of the combo.\n * @csspart checkbox - Represents each checkbox of each list item of the combo.\n * @csspart checkbox-indicator - Represents the checkbox indicator of each list item of the combo.\n * @csspart checked - Appended to checkbox parts list when checkbox is checked in the combo.\n * @csspart header - The container holding the header content of the combo.\n * @csspart footer - The container holding the footer content of the combo.\n * @csspart empty - The container holding the empty content of the combo.\n */\n@blazorAdditionalDependencies('IgcIconComponent, IgcInputComponent')\n@blazorIndirectRender\n@shadowOptions({ delegatesFocus: true })\nexport default class IgcComboComponent<\n T extends object = any,\n> extends FormAssociatedRequiredMixin(\n EventEmitterMixin<\n IgcComboComponentEventMap,\n AbstractConstructor<IgcBaseComboBoxComponent>\n >(IgcBaseComboBoxComponent)\n) {\n public static readonly tagName = 'igc-combo';\n public static styles = [styles, shared];\n\n /* blazorSuppress */\n public static register(): void {\n registerComponent(\n IgcComboComponent,\n IgcIconComponent,\n IgcComboListComponent,\n IgcComboItemComponent,\n IgcComboHeaderComponent,\n IgcInputComponent,\n IgcPopoverComponent,\n IgcValidationContainerComponent\n );\n }\n\n // #region Internal state and controllers\n\n protected override get __validators(): Validator<IgcComboComponent<T>>[] {\n return comboValidators;\n }\n\n private readonly _slots = addSlotController(this, { slots: SLOTS });\n\n protected override readonly _rootClickController = addRootClickController(\n this,\n {\n onHide: this._handleClosing,\n }\n );\n\n protected readonly _i18nController = addI18nController<IComboResourceStrings>(\n this,\n {\n defaultEN: ComboResourceStringsEN,\n }\n );\n\n protected override readonly _formValue = createFormValueState<\n ComboValue<T>[]\n >(this, {\n initialValue: [],\n transformers: {\n setValue: asArray,\n setDefaultValue: asArray,\n setFormValue: (value) => {\n if (isEmpty(value) || !this.name) {\n return null;\n }\n\n if (this.singleSelect) {\n return String(first(value));\n }\n\n const formData = new FormData();\n\n for (const item of value) {\n formData.append(this.name, String(item));\n }\n\n return formData;\n },\n },\n });\n\n /** The primary input of the combo component. */\n private readonly _inputRef = createRef<IgcInputComponent>();\n\n /** The search input of the combo component. */\n private readonly _searchRef = createRef<IgcInputComponent>();\n\n /** The combo virtualized dropdown list. */\n private readonly _listRef = createRef<IgcComboListComponent>();\n\n private readonly _state = new DataState<T>(this);\n private readonly _navigation = new ComboNavigationController(\n this,\n this._state,\n {\n input: this._inputRef,\n search: this._searchRef,\n list: this._listRef,\n interactions: {\n show: () => this._show(true),\n hide: () => this._hide(true),\n toggleSelection: (index: number) => this._toggleSelection(index),\n select: (index: number) => this._selectByIndex(index),\n clearSelection: () => this._clearSelection(),\n },\n }\n );\n\n private _data: T[] = [];\n private _valueKey?: Keys<T>;\n private _displayKey?: Keys<T>;\n private _placeholderSearch?: string;\n private _disableFiltering = false;\n private _singleSelect = false;\n private _selected: Set<T> = new Set();\n private _filteringOptions: FilteringOptions<T> = {\n filterKey: this.displayKey,\n caseSensitive: false,\n matchDiacritics: false,\n };\n\n @state()\n private set _activeIndex(index: number) {\n this._navigation.active = index;\n }\n\n private get _activeIndex(): number {\n return this._navigation.active;\n }\n\n @state()\n private set _searchTerm(value: string) {\n this._state.searchTerm = value;\n }\n\n private get _searchTerm(): string {\n return this._state.searchTerm;\n }\n\n @state()\n private _activeDescendant?: string;\n\n @state()\n private _displayValue = '';\n\n private get _mainAriaLabel(): string {\n return isEmpty(this._selected)\n ? this.resourceStrings.combo_aria_label_no_options!\n : this.resourceStrings.combo_aria_label_options!;\n }\n\n // #endregion\n\n //#region Public attributes and properties\n\n /** The data source used to generate the list of options. */\n /* treatAsRef */\n @property({ attribute: false })\n public set data(value: T[]) {\n if (this._data !== value) {\n this._data = asArray(value);\n }\n }\n\n public get data(): T[] {\n return this._data;\n }\n\n /**\n * The outlined attribute of the control.\n * @attr outlined\n * @default false\n */\n @property({ type: Boolean, reflect: true })\n public outlined = false;\n\n /**\n * Enables single selection mode and moves item filtering to the main input.\n * @attr single-select\n * @default false\n */\n @property({ type: Boolean, reflect: true, attribute: 'single-select' })\n public set singleSelect(value: boolean) {\n this._singleSelect = Boolean(value);\n this._syncSelectionFromValue();\n\n if (this.hasUpdated) {\n const pristine = this._pristine;\n this._activeIndex = -1;\n this._searchTerm = '';\n this._formValue.setValueAndFormState(this.value);\n this._pristine = pristine;\n }\n }\n\n public get singleSelect(): boolean {\n return this._singleSelect;\n }\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 * @default false\n */\n @property({ type: Boolean, attribute: 'autofocus-list' })\n public autofocusList = false;\n\n /**\n * Gets/Sets the locale used for getting language, affecting resource strings.\n * @attr locale\n */\n @property()\n public set locale(value: string) {\n this._i18nController.locale = value;\n this._state.updateLocale(value);\n }\n\n public get locale(): string {\n return this._i18nController.locale;\n }\n\n /**\n * The label attribute of the control.\n * @attr label\n */\n @property()\n public label?: string;\n\n /**\n * The placeholder attribute of the control.\n * @attr placeholder\n */\n @property()\n public placeholder?: string;\n\n /**\n * The placeholder attribute of the search input.\n * @attr placeholder-search\n */\n @property({ attribute: 'placeholder-search' })\n public set placeholderSearch(value: string | undefined) {\n this._placeholderSearch = value;\n }\n\n public get placeholderSearch(): string {\n return (\n this._placeholderSearch ??\n this.resourceStrings.combo_filter_search_placeholder ??\n 'Search'\n );\n }\n\n /**\n * The resource strings for localization.\n */\n @property({ attribute: false })\n public set resourceStrings(value: IComboResourceStrings) {\n this._i18nController.resourceStrings = value;\n }\n\n public get resourceStrings(): IComboResourceStrings {\n return this._i18nController.resourceStrings;\n }\n\n /**\n * The key in the data source used when selecting items.\n * @attr value-key\n */\n @property({ attribute: 'value-key' })\n public set valueKey(value: Keys<T> | undefined) {\n this._valueKey = value;\n this._displayKey = this._displayKey ?? this._valueKey;\n }\n\n public get valueKey() {\n return this._valueKey;\n }\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' })\n public set displayKey(value: Keys<T> | undefined) {\n this._displayKey = value;\n if (!this.filteringOptions.filterKey) {\n this.filteringOptions = { filterKey: this.displayKey };\n }\n }\n\n public get displayKey() {\n return this._displayKey ?? this._valueKey;\n }\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' })\n public groupKey?: Keys<T> | string;\n\n /**\n * Sorts the items in each group by ascending or descending order.\n * @attr group-sorting\n * @default \"asc\"\n * @type {\"asc\" | \"desc\" | \"none\"}\n */\n @property({ attribute: 'group-sorting' })\n public groupSorting: GroupingDirection = 'asc';\n\n /**\n * An object that configures the filtering of the combo.\n * @attr filtering-options\n */\n @property({ type: Object, attribute: 'filtering-options' })\n public set filteringOptions(value: Partial<FilteringOptions<T>>) {\n this._filteringOptions = { ...this._filteringOptions, ...value };\n }\n\n public get filteringOptions(): FilteringOptions<T> {\n return this._filteringOptions;\n }\n\n /**\n * Enables the case sensitive search icon in the filtering input.\n * @attr case-sensitive-icon\n * @default false\n */\n @property({ type: Boolean, attribute: 'case-sensitive-icon' })\n public caseSensitiveIcon = false;\n\n /**\n * Disables the filtering of the list of options.\n * @attr disable-filtering\n * @default false\n */\n @property({ type: Boolean, attribute: 'disable-filtering' })\n public set disableFiltering(value: boolean) {\n this._disableFiltering = value;\n this._searchTerm = '';\n }\n\n public get disableFiltering(): boolean {\n return this._disableFiltering;\n }\n\n /**\n * Hides the clear button.\n * @attr disable-clear\n * @default false\n */\n @property({ type: Boolean, attribute: 'disable-clear' })\n public disableClear = 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 html`${this.displayKey ? item[this.displayKey] : item}`;\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 html`${this.groupKey && item[this.groupKey as Keys<T>]}`;\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 /* blazorPrimitiveValue */\n /* blazorByValueArray */\n /* blazorGenericType */\n /* @tsTwoWayProperty (true, \"Change\", \"Detail.NewValue\", false) */\n @property({ type: Array })\n public set value(items: ComboValue<T>[]) {\n this._formValue.setValueAndFormState(items);\n this._syncSelectionFromValue();\n\n if (this.hasUpdated) {\n this._validate();\n }\n }\n\n /**\n * Returns the current selection as a list of comma separated values,\n * represented by the value key, when provided.\n */\n public get value(): ComboValue<T>[] {\n return this._formValue.value;\n }\n\n /**\n * Returns the current selection as an array of objects as provided in the `data` source.\n */\n public get selection(): T[] {\n return Array.from(this._selected);\n }\n\n //#endregion\n\n //#region Life-cycle\n\n constructor() {\n super();\n\n addThemingController(this, all);\n addSafeEventListener(this, 'blur', this._handleBlur);\n addSafeEventListener(this, 'focusin', this._handleFocusIn);\n }\n\n protected override willUpdate(props: PropertyValues<this>): void {\n if (props.has('open')) {\n this._rootClickController.update();\n }\n\n if (\n props.has('groupKey') ||\n props.has('groupSorting') ||\n props.has('filteringOptions') ||\n props.has('data')\n ) {\n this._state.invalidate();\n }\n\n // When data changes, re-sync selection and form\n // This handles the delayed data scenario where value was set before data\n if (props.has('data') && !isEmpty(this.data) && !isEmpty(this.value)) {\n const pristine = this._pristine;\n this._syncSelectionFromValue();\n this._formValue.setValueAndFormState(this.value);\n this._pristine = pristine;\n }\n }\n\n protected override updated(props: PropertyValues<this>): void {\n super.updated(props);\n if (this._inputRef.value) {\n this._inputRef.value._labelElements = this._internals.labels;\n }\n }\n\n //#endregion\n\n // #region Form Associated overrides\n\n protected override _restoreDefaultValue(): void {\n super._restoreDefaultValue();\n this._syncSelectionFromValue();\n }\n\n protected override _setDefaultValue(current: string | null): void {\n try {\n this.defaultValue = JSON.parse(current || '[]');\n } catch {}\n }\n\n // #endregion\n\n //#region Overrides for combo box behavior\n\n protected override async _show(emitEvent = false): Promise<boolean> {\n const [canOpen, _] = await Promise.all([\n super._show(emitEvent),\n this.updateComplete,\n ]);\n\n if (canOpen) {\n if (!this.singleSelect) {\n this._listRef.value?.focus();\n }\n\n if (!this.autofocusList) {\n this._searchRef.value?.focus();\n }\n }\n\n return canOpen;\n }\n\n protected override async _hide(emitEvent = false): Promise<boolean> {\n const [canClose, _] = await Promise.all([\n super._hide(emitEvent),\n this.updateComplete,\n ]);\n\n if (canClose) {\n this._activeIndex = -1;\n }\n\n return canClose;\n }\n\n private _setSingleSelectionDisplayValue(value: string): void {\n if (this.singleSelect && this._inputRef.value) {\n this._inputRef.value.value = value;\n }\n }\n\n //#endregion\n\n // #region Selection helpers\n\n /**\n * Resolves user-provided items (value keys or object references)\n * to actual objects from the data source in a single pass.\n */\n private _resolveItems(items: Item<T>[]): T[] {\n if (this.valueKey) {\n const keys = new Set(items as Values<T>[]);\n return this.data.filter((item) => keys.has(item[this.valueKey!]));\n }\n\n const dataSet = new Set(this.data);\n return (items as T[]).filter((item) => dataSet.has(item));\n }\n\n /**\n * Gets the value representation of a data record\n * (its value-key property, or the record itself).\n */\n private _resolveItemValue(record: T): Item<T> {\n return this.valueKey ? record[this.valueKey] : record;\n }\n\n /**\n * Maps data items to their value representations using the given key.\n * When key is undefined, returns the items themselves.\n */\n private _getValues(items: Iterable<T>, key?: Keys<T>): ComboValue<T>[] {\n return Iterator.from(items)\n .map((item) => (key ? item[key] : undefined) ?? item)\n .toArray();\n }\n\n private _emitSelectionChange(detail: IgcComboChangeEventArgs): boolean {\n return this.emitEvent('igcChange', { cancelable: true, detail });\n }\n\n private _selectItems(items?: Item<T> | Item<T>[], emit = false): void {\n let collection = asArray(items);\n\n if (this.singleSelect) {\n this._selected.clear();\n this._searchTerm = '';\n }\n\n if (isEmpty(collection)) {\n if (!this.singleSelect) {\n this._selected = new Set(this.data);\n this.requestUpdate();\n }\n return;\n }\n\n if (this.singleSelect) {\n collection = collection.slice(0, 1);\n }\n\n const resolved = this._resolveItems(collection);\n\n if (\n emit &&\n !this._emitSelectionChange({\n newValue: this._getValues(\n [...resolved, ...this._selected],\n this.valueKey\n ),\n items: resolved,\n type: 'selection',\n })\n ) {\n return;\n }\n\n for (const item of resolved) {\n this._selected.add(item);\n }\n\n this.requestUpdate();\n }\n\n private _deselectItems(items?: Item<T> | Item<T>[], emit = false): void {\n let collection = asArray(items);\n\n if (isEmpty(collection)) {\n if (\n emit &&\n !this._emitSelectionChange({\n newValue: [],\n items: Array.from(this._selected),\n type: 'deselection',\n })\n ) {\n return;\n }\n\n this._selected.clear();\n this.requestUpdate();\n return;\n }\n\n if (this.singleSelect) {\n collection = collection.slice(0, 1);\n }\n\n const resolved = this._resolveItems(collection);\n const resolvedSet = new Set(resolved);\n const remaining = Array.from(this._selected).filter(\n (item) => !resolvedSet.has(item)\n );\n\n if (\n emit &&\n !this._emitSelectionChange({\n newValue: this._getValues(remaining, this.valueKey),\n items: resolved,\n type: 'deselection',\n })\n ) {\n return;\n }\n\n for (const item of resolved) {\n this._selected.delete(item);\n }\n\n this.requestUpdate();\n }\n\n /**\n * Syncs the internal `_selected` set from the current `_formValue`.\n * This is a one-way sync: source of truth (_formValue) → view (_selected).\n */\n private _syncSelectionFromValue(): void {\n this._selected.clear();\n\n if (!isEmpty(this._formValue.value)) {\n const values = this.singleSelect\n ? asArray(first(this._formValue.value))\n : this._formValue.value;\n\n if (this.singleSelect && values.length !== this._formValue.value.length) {\n this._formValue.setValueAndFormState(values);\n }\n\n const items = Iterator.from(values)\n .map((val) => this._findItemByValue(val, this.valueKey))\n .filter(isDefined);\n\n for (const item of items) {\n this._selected.add(item);\n }\n }\n\n this._displayValue = this._getValues(this._selected, this.displayKey).join(\n ', '\n );\n }\n\n /**\n * Finds an item in the data array by its value (or value key).\n * Returns undefined if the item is not found.\n */\n private _findItemByValue(value: ComboValue<T>, key?: Keys<T>): T | undefined {\n return this.data.find((item) => (key ? item[key] : item) === value);\n }\n\n protected _syncValueFromSelection(initial = false): void {\n const values = this._getValues(this._selected, this.valueKey);\n this._displayValue = this._getValues(this._selected, this.displayKey).join(\n ', '\n );\n this._formValue.setValueAndFormState(values);\n\n if (!initial) {\n this._setSingleSelectionDisplayValue(this._displayValue);\n this._validate();\n this._listRef.value?.requestUpdate();\n }\n }\n\n private _toggleSelection(index: number): void {\n const record = this.data[this._state.dataState[index].dataIndex];\n\n this._selected.has(record)\n ? this._deselectItems(this._resolveItemValue(record), true)\n : this._selectItems(this._resolveItemValue(record), true);\n\n this._activeIndex = index;\n this._syncValueFromSelection();\n }\n\n private _selectByIndex(index: number): void {\n this._selectItems(\n this._resolveItemValue(this.data[this._state.dataState[index].dataIndex]),\n true\n );\n this._activeIndex = index;\n this._syncValueFromSelection();\n }\n\n private _clearSelection(): void {\n if (this.singleSelect) {\n this._searchTerm = '';\n this._clearSingleSelection();\n } else {\n this._deselectItems([], true);\n }\n this._syncValueFromSelection();\n }\n\n private _clearSingleSelection(): void {\n const [selection] = this._selected;\n\n if (selection) {\n this._deselectItems(this._resolveItemValue(selection), true);\n this._formValue.setValueAndFormState([]);\n }\n }\n\n // #endregion\n\n //#region Event handlers\n\n protected async _handleMainInput({\n detail,\n }: CustomEvent<string>): Promise<void> {\n this._setTouchedState();\n this._show(true);\n this._searchTerm = detail;\n\n // wait for the dataState to update after filtering\n await this.updateComplete;\n\n this._activeIndex = this._state.dataState.findIndex((i) => !i.header);\n // clear the selection upon typing\n this._clearSingleSelection();\n }\n\n protected _handleFocusIn(): void {\n this._setTouchedState();\n }\n\n protected override _handleBlur(): void {\n if (isEmpty(this._selected)) {\n this._searchTerm = '';\n this._setSingleSelectionDisplayValue('');\n }\n super._handleBlur();\n }\n\n protected _handleSearchInput({ detail }: CustomEvent<string>): void {\n this._searchTerm = detail;\n }\n\n private _handleClosing(): void {\n this._hide(true);\n }\n\n private async _itemClickHandler(event: PointerEvent): Promise<void> {\n const target = getElementFromPath(IgcComboItemComponent.tagName, event);\n\n if (!target) {\n return;\n }\n\n this._setTouchedState();\n this._toggleSelection(target.index);\n\n if (this.singleSelect) {\n this._inputRef.value?.focus();\n await this._hide(true);\n } else {\n this._searchRef.value?.focus();\n }\n }\n\n private _handleClearIconClick(event: PointerEvent): void {\n event.stopPropagation();\n this._clearSelection();\n this._activeIndex = -1;\n }\n\n private _handleCaseSensitivity(): void {\n this.filteringOptions = {\n caseSensitive: !this.filteringOptions.caseSensitive,\n };\n }\n\n //#endregion\n\n //#region Public methods\n\n /* alternateName: focusComponent */\n /** Sets focus on the component. */\n public override focus(options?: FocusOptions): void {\n this._inputRef.value?.focus(options);\n }\n\n /* alternateName: blurComponent */\n /** Removes focus from the component. */\n public override blur(): void {\n this._inputRef.value?.blur();\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> | Item<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 *\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>[]): void {\n this._selectItems(items);\n this._syncValueFromSelection();\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> | Item<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 *\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>[]): void {\n this._deselectItems(items);\n this._syncValueFromSelection();\n }\n\n //#endregion\n\n protected _itemRenderer: ComboRenderFunction<T> = (\n item: ComboRecord<T>,\n index: number\n ) => {\n if (!item) {\n return nothing as unknown as TemplateResult;\n }\n\n if (this.groupKey && item.header) {\n return html`\n <igc-combo-header part=\"group-header\">\n ${this.groupHeaderTemplate({ item: item.value })}\n </igc-combo-header>\n `;\n }\n\n const position = index + 1;\n const id = this.id ? `${this.id}-item-${position}` : `item-${position}`;\n const active = this._activeIndex === index;\n const selected = this._selected.has(this.data[item.dataIndex]);\n\n if (active) {\n this._activeDescendant = id;\n }\n\n return html`\n <igc-combo-item\n id=${id}\n part=${partMap({ item: true, selected, active })}\n aria-setsize=${this._state.dataState.length}\n aria-posinset=${position}\n exportparts=\"checkbox, checkbox-indicator, checked\"\n .index=${index}\n ?active=${active}\n ?selected=${selected}\n ?hide-checkbox=${this.singleSelect}\n >\n ${this.itemTemplate({ item: item.value })}\n </igc-combo-item>\n `;\n };\n\n private _renderToggleIcon() {\n return html`\n <span\n slot=\"suffix\"\n part=${partMap({\n 'toggle-icon': true,\n filled: !isEmpty(this.value),\n })}\n >\n <slot name=\"toggle-icon\">\n <igc-icon\n name=${this.open ? 'input_collapse' : 'input_expand'}\n collection=\"default\"\n aria-hidden=\"true\"\n ></igc-icon>\n </slot>\n </span>\n `;\n }\n\n private _renderClearIcon() {\n return html`\n <span\n slot=\"suffix\"\n part=\"clear-icon\"\n @click=${this._handleClearIconClick}\n ?hidden=${this.disableClear || isEmpty(this._selected)}\n aria-label=${ifDefined(\n this.resourceStrings.combo_clearItems_placeholder\n )}\n >\n <slot name=\"clear-icon\">\n <igc-icon\n name=\"input_clear\"\n collection=\"default\"\n aria-hidden=\"true\"\n ></igc-icon>\n </slot>\n </span>\n `;\n }\n\n private _renderMainInput() {\n const hasPrefix = this._slots.hasAssignedElements('prefix');\n const hasSuffix = this._slots.hasAssignedElements('suffix');\n\n return html`\n <igc-input\n ${ref(this._inputRef)}\n id=\"target\"\n slot=\"anchor\"\n role=\"combobox\"\n aria-controls=\"dropdown\"\n aria-owns=\"dropdown\"\n aria-expanded=${this.open}\n aria-describedby=\"combo-helper-text\"\n aria-disabled=${this.disabled}\n aria-label=${this._mainAriaLabel}\n exportparts=\"container: input, input: native-input, label, prefix, suffix\"\n @click=${this._handleAnchorClick}\n placeholder=${ifDefined(this.placeholder)}\n label=${ifDefined(this.label)}\n @igcChange=${stopPropagation}\n @igcInput=${this._handleMainInput}\n .value=${this._displayValue}\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=${bindIf(hasPrefix, 'prefix')}>\n <slot name=\"prefix\"></slot>\n </span>\n ${this._renderClearIcon()}\n <span slot=${bindIf(hasSuffix, 'suffix')}>\n <slot name=\"suffix\"></slot>\n </span>\n ${this._renderToggleIcon()}\n </igc-input>\n `;\n }\n\n private _renderSearchInput() {\n return html`\n <div\n part=\"filter-input\"\n ?hidden=${this.disableFiltering || this.singleSelect}\n >\n <igc-input\n ${ref(this._searchRef)}\n .value=${this._searchTerm}\n part=\"search-input\"\n placeholder=${this.placeholderSearch}\n exportparts=\"input: search-input\"\n @igcInput=${this._handleSearchInput}\n >\n <igc-icon\n slot=${bindIf(this.caseSensitiveIcon, 'suffix')}\n name=\"case_sensitive\"\n collection=\"default\"\n part=${partMap({\n 'case-icon': true,\n active: this.filteringOptions.caseSensitive,\n })}\n @click=${this._handleCaseSensitivity}\n ></igc-icon>\n </igc-input>\n </div>\n `;\n }\n\n private _renderEmptyTemplate() {\n return html`\n <div part=\"empty\" ?hidden=${!isEmpty(this._state.dataState)}>\n <slot name=\"empty\">${this.resourceStrings.combo_empty_message}</slot>\n </div>\n `;\n }\n\n private _renderList() {\n return html`\n <div .inert=${!this.open} part=\"list-wrapper\">\n ${this._renderSearchInput()}\n <div part=\"header\">\n <slot name=\"header\"></slot>\n </div>\n <igc-combo-list\n ${ref(this._listRef)}\n aria-multiselectable=${!this.singleSelect}\n id=\"dropdown\"\n part=\"list\"\n role=\"listbox\"\n tabindex=\"0\"\n aria-labelledby=\"target\"\n aria-activedescendant=${ifDefined(this._activeDescendant)}\n .items=${this._state.dataState}\n .renderItem=${this._itemRenderer}\n ?hidden=${isEmpty(this._state.dataState)}\n @click=${this._itemClickHandler}\n >\n </igc-combo-list>\n ${this._renderEmptyTemplate()}\n <div part=\"footer\">\n <slot name=\"footer\"></slot>\n </div>\n </div>\n `;\n }\n\n private _renderHelperText(): TemplateResult {\n return IgcValidationContainerComponent.create(this, {\n id: 'combo-helper-text',\n hasHelperText: true,\n });\n }\n\n protected override render() {\n return html`\n <igc-popover ?open=${this.open} flip shift same-width>\n ${this._renderMainInput()} ${this._renderList()}\n </igc-popover>\n ${this._renderHelperText()}\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'igc-combo': IgcComboComponent<object>;\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"gestures.js","sourceRoot":"","sources":["../../../../src/components/common/controllers/gestures.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAExD,MAAM,MAAM,GAAG;IACb,aAAa;IACb,aAAa;IACb,oBAAoB;IACpB,eAAe;CACP,CAAC;AACX,MAAM,YAAY,GAAiB,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC;AAoD1E,MAAM,OAAO,UAAW,SAAQ,KAAK;IAInC,YAAY,IAAY,EAAE,IAAiB,EAAE,WAAuB;QAClE,KAAK,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;QACzB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;CACF;AAED,MAAM,kBAAmB,SAAQ,WAAW;IAiB1C,IAAc,QAAQ;QACpB,OAAO,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,K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AAI,CAAC,gBAAgB,EAAE,EAAE;gBAC/D,IAAI,EAAE,KAAK,CAAC,WAAW;gBACvB,SAAS,EAAE,KAAK;aACjB,CAAC,CAAC;YAEH,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;YAC1B,IAAI,CAAC,KAAK,CAAC,SAAS,KAAK,EAAE,EAAE,IAAI,CAAC,CAAC;QACrC,CAAC;QAED,IAAI,CAAC,WAAW,EAAE,CAAC;QACnB,IAAI,CAAC,oBAAoB,CAAC,KAAK,CAAC,CAAC;IACnC,CAAC;CACF;AAMD,MAAM,UAAU,qBAAqB,CACnC,IAA0C,EAC1C,OAAyB;IAEzB,OAAO,IAAI,kBAAkB,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;AAC/C,CAAC","sourcesContent":["import type { ReactiveController, ReactiveControllerHost } from 'lit';\nimport type { Ref } from 'lit/directives/ref.js';\nimport { createAbortHandle } from '../abort-handler.js';\n\nconst Events = [\n 'pointerdown',\n 'pointermove',\n 'lostpointercapture',\n 'pointercancel',\n] as const;\nconst defaultState: GestureState = Object.freeze({ x: 0, y: 0, time: 0 });\n\n/**\n * Configuration object for a {@link GesturesController} instance.\n * @ignore\n */\nexport interface GesturesOptions {\n /**\n * By default, the controller listens for pointer/touch events in the context of the host element.\n * If you pass a `ref`, you can limit the observation to a certain DOM part of the host scope.\n */\n ref?: Ref<HTMLElement>;\n /**\n * The maximum amount of milliseconds between the start and end of a gesture combination\n * before it is recognized as such.\n */\n thresholdTime?: number;\n /**\n * The minimum amount a \"pointer\" should travel in pixels, before being recognized as a\n * gesture.\n */\n thresholdDistance?: number;\n /**\n * When enabled, the controller will skip events generated by a mouse device.\n */\n touchOnly?: boolean;\n}\n\ntype GestureState = {\n x: number;\n y: number;\n time: number;\n};\n\ntype GestureDirection = 'left' | 'up' | 'right' | 'down';\ntype SwipeEvents =\n | 'swipe'\n | 'swipe-left'\n | 'swipe-up'\n | 'swipe-right'\n | 'swipe-down';\n\nexport type GestureData = {\n direction: GestureDirection;\n type: string;\n xStart: number;\n xEnd: number;\n yStart: number;\n yEnd: number;\n};\n\n/* blazorSuppress */\nexport class SwipeEvent extends Event {\n public readonly data: GestureData;\n public readonly name: string;\n\n constructor(name: string, data: GestureData, initOptions?: EventInit) {\n super(name, initOptions);\n this.name = name;\n this.data = data;\n }\n}\n\nclass GesturesController extends EventTarget implements ReactiveController {\n private readonly _host: ReactiveControllerHost & HTMLElement;\n private readonly _ref?: Ref<HTMLElement>;\n private readonly _abortHandle = createAbortHandle();\n\n private _options: GesturesOptions = {\n thresholdDistance: 100,\n thresholdTime: 500,\n touchOnly: false,\n };\n\n private _pointerState = {\n captured: false,\n start: defaultState,\n current: defaultState,\n };\n\n protected get _element() {\n return this._ref ? this._ref.value! : this._host;\n }\n\n /** Get the current configuration object */\n public get options(): GesturesOptions {\n return this._options;\n }\n\n constructor(\n host: ReactiveControllerHost & HTMLElement,\n options?: GesturesOptions\n ) {\n super();\n\n Object.assign(this._options, options);\n this._ref = this._options.ref;\n\n this._host = host;\n this._host.addController(this);\n }\n\n /**\n * Add an event listener for a given swipe event.\n */\n public set(\n type: SwipeEvents,\n callback: (event: SwipeEvent) => void,\n options?: AddEventListenerOptions\n ): this {\n const bound = callback.bind(this._host) as EventListener;\n\n this.addEventListener(type, bound, options);\n return this;\n }\n\n /** @internal */\n public handleEvent(event: PointerEvent): void {\n if (this._options.touchOnly && event.pointerType === 'mouse') {\n return;\n }\n\n switch (event.type) {\n case 'pointerdown':\n this._handlePointerDown(event);\n break;\n case 'pointermove':\n this._handlePointerMove(event);\n break;\n case 'lostpointercapture':\n case 'pointercancel':\n this._handleLostPointerCapture(event);\n }\n }\n\n /** @internal */\n public hostConnected(): void {\n const { signal } = this._abortHandle;\n\n this._host.updateComplete.then(() => {\n for (const event of Events) {\n this._element.addEventListener(event, this, { passive: true, signal });\n }\n });\n }\n\n /** @internal */\n public hostDisconnected(): void {\n this._abortHandle.abort();\n }\n\n /** Updates the configuration of the controller */\n public updateOptions(options: Omit<GesturesOptions, 'ref'>): void {\n Object.assign(this._options, options);\n }\n\n private _getGestureState({\n clientX: x,\n clientY: y,\n }: PointerEvent): GestureState {\n return { x, y, time: Date.now() };\n }\n\n private _setTouchActionState(disabled: boolean) {\n Object.assign(this._element.style, {\n touchAction: disabled ? 'none' : undefined,\n });\n }\n\n private _resetState() {\n this._pointerState.start = defaultState;\n this._pointerState.current = defaultState;\n }\n\n private _setPointerCaptureState(event: PointerEvent, state: boolean) {\n this._pointerState.captured = state;\n state\n ? this._element.setPointerCapture(event.pointerId)\n : this._element.releasePointerCapture(event.pointerId);\n }\n\n private _handlePointerDown(event: PointerEvent) {\n this._setTouchActionState(true);\n this._pointerState.start = this._getGestureState(event);\n this._setPointerCaptureState(event, true);\n }\n\n private _handlePointerMove(event: PointerEvent) {\n if (this._pointerState.captured) {\n this._pointerState.current = this._getGestureState(event);\n }\n }\n\n private _emit(name: SwipeEvents, data: GestureData) {\n return this.dispatchEvent(new SwipeEvent(name, data));\n }\n\n private _createEventArgs() {\n const { start, current } = this._pointerState;\n\n return {\n xStart: start.x,\n xEnd: current.x,\n yStart: start.y,\n yEnd: current.y,\n };\n }\n\n protected _recognize(): GestureDirection | false {\n const { start, current } = this._pointerState;\n\n const dt = current.time - start.time;\n const dx = current.x - start.x;\n const dy = current.y - start.y;\n\n const time = this._options.thresholdTime ?? 500;\n const distance = this._options.thresholdDistance ?? 100;\n\n if (dt > time) {\n return false;\n }\n\n if (dx > distance && Math.abs(dy) < distance) {\n return 'right';\n }\n\n if (-dx > distance && Math.abs(dy) < distance) {\n return 'left';\n }\n\n if (dy > distance && Math.abs(dx) < distance) {\n return 'down';\n }\n\n if (-dy > distance && Math.abs(dx) < distance) {\n return 'up';\n }\n\n return false;\n }\n\n private _handleLostPointerCapture(event: PointerEvent) {\n this._setPointerCaptureState(event, false);\n const state = this._recognize();\n\n if (state) {\n const args: GestureData = Object.assign(this._createEventArgs(), {\n type: event.pointerType,\n direction: state,\n });\n\n this._emit('swipe', args);\n this._emit(`swipe-${state}`, args);\n }\n\n this._resetState();\n this._setTouchActionState(false);\n }\n}\n\n/**\n * Adds a {@link GesturesController} responsible for managing gesture behaviors\n * for the given host element.\n */\nexport function addGesturesController(\n host: ReactiveControllerHost & HTMLElement,\n options?: GesturesOptions\n) {\n return new GesturesController(host, options);\n}\n"]}
1
+ {"version":3,"file":"gestures.js","sourceRoot":"","sources":["../../../../src/components/common/controllers/gestures.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAExD,MAAM,MAAM,GAAG;IACb,aAAa;IACb,aAAa;IACb,oBAAoB;IACpB,eAAe;CACP,CAAC;AACX,MAAM,YAAY,GAAiB,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC;AAgD1E,MAAM,OAAO,UAAW,SAAQ,KAAK;IAInC,YAAY,IAAY,EAAE,IAAiB,EAAE,WAAuB;QAClE,KAAK,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;QACzB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;CACF;AAED,MAAM,kBAAmB,SAAQ,WAAW;IAiB1C,IAAc,QAAQ;QACpB,OAAO,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,KAAM,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC;IACnD,CAAC;IAGD,IAAW,OAAO;QAChB,OAAO,IAAI,CAAC,QAAQ,CAAC;IACvB,CAAC;IAED,YACE,IAA0C,EAC1C,OAAyB;QAEzB,KAAK,EAAE,CAAC;QA3BO,iBAAY,GAAG,iBAAiB,EAAE,CAAC;QAE5C,aAAQ,GAAoB;YAClC,iBAAiB,EAAE,GAAG;YACtB,aAAa,EAAE,G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C;QACnB,IAAI,CAAC,oBAAoB,CAAC,KAAK,CAAC,CAAC;IACnC,CAAC;CACF;AAMD,MAAM,UAAU,qBAAqB,CACnC,IAA0C,EAC1C,OAAyB;IAEzB,OAAO,IAAI,kBAAkB,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;AAC/C,CAAC","sourcesContent":["import type { ReactiveController, ReactiveControllerHost } from 'lit';\nimport type { Ref } from 'lit/directives/ref.js';\nimport { createAbortHandle } from '../abort-handler.js';\n\nconst Events = [\n 'pointerdown',\n 'pointermove',\n 'lostpointercapture',\n 'pointercancel',\n] as const;\nconst defaultState: GestureState = Object.freeze({ x: 0, y: 0, time: 0 });\n\n/**\n * Configuration object for a {@link GesturesController} instance.\n * @ignore\n */\nexport interface GesturesOptions {\n /**\n * By default, the controller listens for pointer/touch events in the context of the host element.\n * If you pass a `ref`, you can limit the observation to a certain DOM part of the host scope.\n */\n ref?: Ref<HTMLElement>;\n /**\n * The maximum amount of milliseconds between the start and end of a gesture combination\n * before it is recognized as such.\n */\n thresholdTime?: number;\n /**\n * The minimum amount a \"pointer\" should travel in pixels, before being recognized as a\n * gesture.\n */\n thresholdDistance?: number;\n /**\n * When enabled, the controller will skip events generated by a mouse device.\n */\n touchOnly?: boolean;\n}\n\ntype GestureState = {\n x: number;\n y: number;\n time: number;\n};\n\ntype GestureDirection = 'left' | 'up' | 'right' | 'down';\ntype SwipeEvents =\n 'swipe' | 'swipe-left' | 'swipe-up' | 'swipe-right' | 'swipe-down';\n\nexport type GestureData = {\n direction: GestureDirection;\n type: string;\n xStart: number;\n xEnd: number;\n yStart: number;\n yEnd: number;\n};\n\n/* blazorSuppress */\nexport class SwipeEvent extends Event {\n public readonly data: GestureData;\n public readonly name: string;\n\n constructor(name: string, data: GestureData, initOptions?: EventInit) {\n super(name, initOptions);\n this.name = name;\n this.data = data;\n }\n}\n\nclass GesturesController extends EventTarget implements ReactiveController {\n private readonly _host: ReactiveControllerHost & HTMLElement;\n private readonly _ref?: Ref<HTMLElement>;\n private readonly _abortHandle = createAbortHandle();\n\n private _options: GesturesOptions = {\n thresholdDistance: 100,\n thresholdTime: 500,\n touchOnly: false,\n };\n\n private _pointerState = {\n captured: false,\n start: defaultState,\n current: defaultState,\n };\n\n protected get _element() {\n return this._ref ? this._ref.value! : this._host;\n }\n\n /** Get the current configuration object */\n public get options(): GesturesOptions {\n return this._options;\n }\n\n constructor(\n host: ReactiveControllerHost & HTMLElement,\n options?: GesturesOptions\n ) {\n super();\n\n Object.assign(this._options, options);\n this._ref = this._options.ref;\n\n this._host = host;\n this._host.addController(this);\n }\n\n /**\n * Add an event listener for a given swipe event.\n */\n public set(\n type: SwipeEvents,\n callback: (event: SwipeEvent) => void,\n options?: AddEventListenerOptions\n ): this {\n const bound = callback.bind(this._host) as EventListener;\n\n this.addEventListener(type, bound, options);\n return this;\n }\n\n /** @internal */\n public handleEvent(event: PointerEvent): void {\n if (this._options.touchOnly && event.pointerType === 'mouse') {\n return;\n }\n\n switch (event.type) {\n case 'pointerdown':\n this._handlePointerDown(event);\n break;\n case 'pointermove':\n this._handlePointerMove(event);\n break;\n case 'lostpointercapture':\n case 'pointercancel':\n this._handleLostPointerCapture(event);\n }\n }\n\n /** @internal */\n public hostConnected(): void {\n const { signal } = this._abortHandle;\n\n this._host.updateComplete.then(() => {\n for (const event of Events) {\n this._element.addEventListener(event, this, { passive: true, signal });\n }\n });\n }\n\n /** @internal */\n public hostDisconnected(): void {\n this._abortHandle.abort();\n }\n\n /** Updates the configuration of the controller */\n public updateOptions(options: Omit<GesturesOptions, 'ref'>): void {\n Object.assign(this._options, options);\n }\n\n private _getGestureState({\n clientX: x,\n clientY: y,\n }: PointerEvent): GestureState {\n return { x, y, time: Date.now() };\n }\n\n private _setTouchActionState(disabled: boolean) {\n Object.assign(this._element.style, {\n touchAction: disabled ? 'none' : undefined,\n });\n }\n\n private _resetState() {\n this._pointerState.start = defaultState;\n this._pointerState.current = defaultState;\n }\n\n private _setPointerCaptureState(event: PointerEvent, state: boolean) {\n this._pointerState.captured = state;\n state\n ? this._element.setPointerCapture(event.pointerId)\n : this._element.releasePointerCapture(event.pointerId);\n }\n\n private _handlePointerDown(event: PointerEvent) {\n this._setTouchActionState(true);\n this._pointerState.start = this._getGestureState(event);\n this._setPointerCaptureState(event, true);\n }\n\n private _handlePointerMove(event: PointerEvent) {\n if (this._pointerState.captured) {\n this._pointerState.current = this._getGestureState(event);\n }\n }\n\n private _emit(name: SwipeEvents, data: GestureData) {\n return this.dispatchEvent(new SwipeEvent(name, data));\n }\n\n private _createEventArgs() {\n const { start, current } = this._pointerState;\n\n return {\n xStart: start.x,\n xEnd: current.x,\n yStart: start.y,\n yEnd: current.y,\n };\n }\n\n protected _recognize(): GestureDirection | false {\n const { start, current } = this._pointerState;\n\n const dt = current.time - start.time;\n const dx = current.x - start.x;\n const dy = current.y - start.y;\n\n const time = this._options.thresholdTime ?? 500;\n const distance = this._options.thresholdDistance ?? 100;\n\n if (dt > time) {\n return false;\n }\n\n if (dx > distance && Math.abs(dy) < distance) {\n return 'right';\n }\n\n if (-dx > distance && Math.abs(dy) < distance) {\n return 'left';\n }\n\n if (dy > distance && Math.abs(dx) < distance) {\n return 'down';\n }\n\n if (-dy > distance && Math.abs(dx) < distance) {\n return 'up';\n }\n\n return false;\n }\n\n private _handleLostPointerCapture(event: PointerEvent) {\n this._setPointerCaptureState(event, false);\n const state = this._recognize();\n\n if (state) {\n const args: GestureData = Object.assign(this._createEventArgs(), {\n type: event.pointerType,\n direction: state,\n });\n\n this._emit('swipe', args);\n this._emit(`swipe-${state}`, args);\n }\n\n this._resetState();\n this._setTouchActionState(false);\n }\n}\n\n/**\n * Adds a {@link GesturesController} responsible for managing gesture behaviors\n * for the given host element.\n */\nexport function addGesturesController(\n host: ReactiveControllerHost & HTMLElement,\n options?: GesturesOptions\n) {\n return new GesturesController(host, options);\n}\n"]}
@@ -46,6 +46,15 @@ declare class ElementInternalsController {
46
46
  * `static formAssociated = true`.
47
47
  */
48
48
  get willValidate(): boolean;
49
+ /**
50
+ * Returns a read-only array of the `<label>` elements associated with the host element, or `null` if there are no associated labels.
51
+ * The association is determined by the `for` attribute of `<label>` elements or by nesting the host element inside a `<label>`.
52
+ *
53
+ * @remarks
54
+ * The host element must be form associated, that is, it should have
55
+ * `static formAssociated = true` in order to return associated labels.
56
+ */
57
+ get labels(): ReadonlyArray<Element> | null;
49
58
  constructor(host: ReactiveControllerHost & LitElement, config?: ElementInternalsConfig);
50
59
  /** Sets ARIA attributes on the element's internals. */
51
60
  setARIA<T extends keyof ARIAMixin = keyof ARIAMixin>(state: Partial<Record<T, ARIAMixin[T]>>): void;
@@ -11,6 +11,10 @@ class ElementInternalsController {
11
11
  get willValidate() {
12
12
  return this._internals.willValidate;
13
13
  }
14
+ get labels() {
15
+ const labels = this._internals.labels;
16
+ return labels && labels.length > 0 ? Array.from(labels) : null;
17
+ }
14
18
  constructor(host, config) {
15
19
  this._host = host;
16
20
  this._internals = this._host.attachInternals();
@@ -1 +1 @@
1
- {"version":3,"file":"internals.js","sourceRoot":"","sources":["../../../../src/components/common/controllers/internals.ts"],"names":[],"mappings":"AAiBA,MAAM,0BAA0B;IAW9B,IAAW,IAAI;QACb,OAAO,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC;IAC9B,CAAC;IAUD,IAAW,QAAQ;QACjB,OAAO,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC;IAClC,CAAC;IASD,IAAW,iBAAiB;QAC1B,OAAO,IAAI,CAAC,UAAU,CAAC,iBAAiB,CAAC;IAC3C,CAAC;IAUD,IAAW,YAAY;QACrB,OAAO,IAAI,CAAC,UAAU,CAAC,YAAY,CAAC;IACtC,CAAC;IAED,YACE,IAAyC,EACzC,MAA+B;QAE/B,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;QAClB,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,KAAK,CAAC,eAAe,EAAE,CAAC;QAE/C,IAAI,MAAM,EAAE,WAAW,EAAE,CAAC;YACxB,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;QACnC,CAAC;QAED,IAAI,CAAC,aAAa,CAAC,IAA0B,CAAC,CAAC;IACjD,CAAC;IAGM,OAAO,CACZ,KAAuC;QAEvC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,UAAU,EAAE,KAAK,CAAC,CAAC;IACxC,CAAC;IAMM,QAAQ,CAAC,KAAa,EAAE,KAAc;QAC3C,KAAK;YACH,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC;YACnC,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IAC3C,CAAC;IAWM,YAAY,CAAC,KAAoB,EAAE,KAAqB;QAC7D,IAAI,CAAC,UAAU,CAAC,YAAY,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;IAC7C,CAAC;IAUM,WAAW,CAAC,KAA0B,EAAE,OAAgB;QAC7D,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;IAC9C,CAAC;IAUM,aAAa;QAClB,OAAO,IAAI,CAAC,UAAU,CAAC,aAAa,EAAE,CAAC;IACzC,CAAC;IAUM,cAAc;QACnB,OAAO,IAAI,CAAC,UAAU,CAAC,cAAc,EAAE,CAAC;IAC1C,CAAC;CACF;AAGD,MAAM,UAAU,sBAAsB,CACpC,IAAyC,EACzC,MAA+B;IAE/B,OAAO,IAAI,0BAA0B,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;AACtD,CAAC","sourcesContent":["import type {\n LitElement,\n ReactiveController,\n ReactiveControllerHost,\n} from 'lit';\nimport type { FormValueType } from '../mixins/forms/types.js';\n\n/** Configuration for the ElementInternalsController. */\ntype ElementInternalsConfig<T extends keyof ARIAMixin = keyof ARIAMixin> = {\n /** Initial ARIA attributes to set on the element internals. */\n initialARIA: Partial<Record<T, ARIAMixin[T]>>;\n};\n\n/**\n * A Lit ReactiveController to manage `ElementInternals` for a host element.\n * Provides methods to interact with custom element states and ARIA attributes..\n */\nclass ElementInternalsController {\n private readonly _host: ReactiveControllerHost & LitElement;\n private readonly _internals: ElementInternals;\n\n /**\n * Gets the closest ancestor `<form>` element or `null`.\n *\n * @remarks\n * The host element must be form associated, that is, it should have\n * `static formAssociated = true` in order to return the parent form.\n */\n public get form(): HTMLFormElement | null {\n return this._internals.form;\n }\n\n /**\n * Returns a `ValidityState` object which represents the different validity states\n * the element can be in, with respect to constraint validation.\n *\n * @remarks\n * The host element must be form associated, that is, it should have\n * `static formAssociated = true`.\n */\n public get validity(): ValidityState {\n return this._internals.validity;\n }\n\n /**\n * Returns a string containing the validation message of this element.\n *\n * @remarks\n * The host element must be form associated, that is, it should have\n * `static formAssociated = true`.\n */\n public get validationMessage(): string {\n return this._internals.validationMessage;\n }\n\n /**\n * Returns a boolean value which returns true if the element is a submittable element\n * which is a candidate for constraint validation.\n *\n * @remarks\n * The host element must be form associated, that is, it should have\n * `static formAssociated = true`.\n */\n public get willValidate(): boolean {\n return this._internals.willValidate;\n }\n\n constructor(\n host: ReactiveControllerHost & LitElement,\n config?: ElementInternalsConfig\n ) {\n this._host = host;\n this._internals = this._host.attachInternals();\n\n if (config?.initialARIA) {\n this.setARIA(config.initialARIA);\n }\n\n host.addController(this as ReactiveController);\n }\n\n /** Sets ARIA attributes on the element's internals. */\n public setARIA<T extends keyof ARIAMixin = keyof ARIAMixin>(\n state: Partial<Record<T, ARIAMixin[T]>>\n ): void {\n Object.assign(this._internals, state);\n }\n\n /**\n * Adds or removes a custom state from the element's internals.\n * Custom states can be styled via `:state()` selector in CSS.\n */\n public setState(state: string, value: boolean): void {\n value\n ? this._internals.states.add(state)\n : this._internals.states.delete(state);\n }\n\n /**\n * Sets both the state and submission value of internals's target element to value.\n *\n * If value is null, the element won't participate in form submission.\n *\n * @remarks\n * The host element must be form associated, that is, it should have\n * `static formAssociated = true`.\n */\n public setFormValue(value: FormValueType, state?: FormValueType): void {\n this._internals.setFormValue(value, state);\n }\n\n /**\n * Sets the internal validity state of the host element as well as the validation\n * message.\n *\n * @remarks\n * The host element must be form associated, that is, it should have\n * `static formAssociated = true`.\n */\n public setValidity(flags?: ValidityStateFlags, message?: string): void {\n this._internals.setValidity(flags, message);\n }\n\n /**\n * Checks the internal validity of the host element and fires an `invalid` event if\n * the host element fails validation constraints.\n *\n * @remarks\n * The host element must be form associated, that is, it should have\n * `static formAssociated = true`.\n */\n public checkValidity(): boolean {\n return this._internals.checkValidity();\n }\n\n /**\n * Checks the internal validity of the host element and fires an `invalid` event if\n * the host element fails validation constraints.\n *\n * @remarks\n * The host element must be form associated, that is, it should have\n * `static formAssociated = true`.\n */\n public reportValidity(): boolean {\n return this._internals.reportValidity();\n }\n}\n\n/** Creates and adds a {@link ElementInternalsController} to a LitElement host. */\nexport function addInternalsController(\n host: ReactiveControllerHost & LitElement,\n config?: ElementInternalsConfig\n): ElementInternalsController {\n return new ElementInternalsController(host, config);\n}\n\nexport type { ElementInternalsController };\n"]}
1
+ {"version":3,"file":"internals.js","sourceRoot":"","sources":["../../../../src/components/common/controllers/internals.ts"],"names":[],"mappings":"AAiBA,MAAM,0BAA0B;IAW9B,IAAW,IAAI;QACb,OAAO,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC;IAC9B,CAAC;IAUD,IAAW,QAAQ;QACjB,OAAO,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC;IAClC,CAAC;IASD,IAAW,iBAAiB;QAC1B,OAAO,IAAI,CAAC,UAAU,CAAC,iBAAiB,CAAC;IAC3C,CAAC;IAUD,IAAW,YAAY;QACrB,OAAO,IAAI,CAAC,UAAU,CAAC,YAAY,CAAC;IACtC,CAAC;IAUD,IAAW,MAAM;QACf,MAAM,MAAM,GAAG,IAAI,CAAC,UAAU,CAAC,MAAoC,CAAC;QACpE,OAAO,MAAM,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CA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CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;AACtD,CAAC","sourcesContent":["import type {\n LitElement,\n ReactiveController,\n ReactiveControllerHost,\n} from 'lit';\nimport type { FormValueType } from '../mixins/forms/types.js';\n\n/** Configuration for the ElementInternalsController. */\ntype ElementInternalsConfig<T extends keyof ARIAMixin = keyof ARIAMixin> = {\n /** Initial ARIA attributes to set on the element internals. */\n initialARIA: Partial<Record<T, ARIAMixin[T]>>;\n};\n\n/**\n * A Lit ReactiveController to manage `ElementInternals` for a host element.\n * Provides methods to interact with custom element states and ARIA attributes..\n */\nclass ElementInternalsController {\n private readonly _host: ReactiveControllerHost & LitElement;\n private readonly _internals: ElementInternals;\n\n /**\n * Gets the closest ancestor `<form>` element or `null`.\n *\n * @remarks\n * The host element must be form associated, that is, it should have\n * `static formAssociated = true` in order to return the parent form.\n */\n public get form(): HTMLFormElement | null {\n return this._internals.form;\n }\n\n /**\n * Returns a `ValidityState` object which represents the different validity states\n * the element can be in, with respect to constraint validation.\n *\n * @remarks\n * The host element must be form associated, that is, it should have\n * `static formAssociated = true`.\n */\n public get validity(): ValidityState {\n return this._internals.validity;\n }\n\n /**\n * Returns a string containing the validation message of this element.\n *\n * @remarks\n * The host element must be form associated, that is, it should have\n * `static formAssociated = true`.\n */\n public get validationMessage(): string {\n return this._internals.validationMessage;\n }\n\n /**\n * Returns a boolean value which returns true if the element is a submittable element\n * which is a candidate for constraint validation.\n *\n * @remarks\n * The host element must be form associated, that is, it should have\n * `static formAssociated = true`.\n */\n public get willValidate(): boolean {\n return this._internals.willValidate;\n }\n\n /**\n * Returns a read-only array of the `<label>` elements associated with the host element, or `null` if there are no associated labels.\n * The association is determined by the `for` attribute of `<label>` elements or by nesting the host element inside a `<label>`.\n *\n * @remarks\n * The host element must be form associated, that is, it should have\n * `static formAssociated = true` in order to return associated labels.\n */\n public get labels(): ReadonlyArray<Element> | null {\n const labels = this._internals.labels as NodeListOf<Element> | null;\n return labels && labels.length > 0 ? Array.from(labels) : null;\n }\n\n constructor(\n host: ReactiveControllerHost & LitElement,\n config?: ElementInternalsConfig\n ) {\n this._host = host;\n this._internals = this._host.attachInternals();\n\n if (config?.initialARIA) {\n this.setARIA(config.initialARIA);\n }\n\n host.addController(this as ReactiveController);\n }\n\n /** Sets ARIA attributes on the element's internals. */\n public setARIA<T extends keyof ARIAMixin = keyof ARIAMixin>(\n state: Partial<Record<T, ARIAMixin[T]>>\n ): void {\n Object.assign(this._internals, state);\n }\n\n /**\n * Adds or removes a custom state from the element's internals.\n * Custom states can be styled via `:state()` selector in CSS.\n */\n public setState(state: string, value: boolean): void {\n value\n ? this._internals.states.add(state)\n : this._internals.states.delete(state);\n }\n\n /**\n * Sets both the state and submission value of internals's target element to value.\n *\n * If value is null, the element won't participate in form submission.\n *\n * @remarks\n * The host element must be form associated, that is, it should have\n * `static formAssociated = true`.\n */\n public setFormValue(value: FormValueType, state?: FormValueType): void {\n this._internals.setFormValue(value, state);\n }\n\n /**\n * Sets the internal validity state of the host element as well as the validation\n * message.\n *\n * @remarks\n * The host element must be form associated, that is, it should have\n * `static formAssociated = true`.\n */\n public setValidity(flags?: ValidityStateFlags, message?: string): void {\n this._internals.setValidity(flags, message);\n }\n\n /**\n * Checks the internal validity of the host element and fires an `invalid` event if\n * the host element fails validation constraints.\n *\n * @remarks\n * The host element must be form associated, that is, it should have\n * `static formAssociated = true`.\n */\n public checkValidity(): boolean {\n return this._internals.checkValidity();\n }\n\n /**\n * Checks the internal validity of the host element and fires an `invalid` event if\n * the host element fails validation constraints.\n *\n * @remarks\n * The host element must be form associated, that is, it should have\n * `static formAssociated = true`.\n */\n public reportValidity(): boolean {\n return this._internals.reportValidity();\n }\n}\n\n/** Creates and adds a {@link ElementInternalsController} to a LitElement host. */\nexport function addInternalsController(\n host: ReactiveControllerHost & LitElement,\n config?: ElementInternalsConfig\n): ElementInternalsController {\n return new ElementInternalsController(host, config);\n}\n\nexport type { ElementInternalsController };\n"]}
@@ -1,4 +1,4 @@
1
- import type { ReactiveController, ReactiveControllerHost } from 'lit';
1
+ import { type ReactiveController, type ReactiveControllerHost } from 'lit';
2
2
  /** @ignore */
3
3
  export interface MutationControllerConfig<T extends Node = Node> {
4
4
  /** The callback function to run when a mutation occurs. */
@@ -52,11 +52,11 @@ export type MutationControllerParams<T extends Node = Node> = {
52
52
  };
53
53
  declare class MutationController<T extends Node = Node> implements ReactiveController {
54
54
  private readonly _host;
55
- private readonly _observer;
56
55
  private readonly _target;
57
56
  private readonly _config;
58
57
  private readonly _callback;
59
58
  private readonly _filter?;
59
+ private _observer?;
60
60
  constructor(host: ReactiveControllerHost & Element, options: MutationControllerConfig<T>);
61
61
  /** @internal */
62
62
  hostConnected(): void;
@@ -1,3 +1,4 @@
1
+ import { isServer, } from 'lit';
1
2
  import { isElement } from '../util.js';
2
3
  function applyNodeFilter(nodes, predicate) {
3
4
  if (!predicate) {
@@ -15,11 +16,13 @@ class MutationController {
15
16
  this._config = options.config;
16
17
  this._target = options.target ?? this._host;
17
18
  this._filter = options.filter;
18
- this._observer = new MutationObserver((records) => {
19
- this.disconnect();
20
- this._callback.call(this._host, this._process(records));
21
- this.observe();
22
- });
19
+ if (!isServer) {
20
+ this._observer = new MutationObserver((records) => {
21
+ this.disconnect();
22
+ this._callback.call(this._host, this._process(records));
23
+ this.observe();
24
+ });
25
+ }
23
26
  host.addController(this);
24
27
  }
25
28
  hostConnected() {
@@ -57,10 +60,10 @@ class MutationController {
57
60
  return { records, changes, observer: this };
58
61
  }
59
62
  observe() {
60
- this._observer.observe(this._target, this._config);
63
+ this._observer?.observe(this._target, this._config);
61
64
  }
62
65
  disconnect() {
63
- this._observer.disconnect();
66
+ this._observer?.disconnect();
64
67
  }
65
68
  }
66
69
  export function createMutationController(host, config) {
@@ -1 +1 @@
1
- {"version":3,"file":"mutation-observer.js","sourceRoot":"","sources":["../../../../src/components/common/controllers/mutation-observer.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAgE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AI,CAAC,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;IACrD,CAAC;IAGM,UAAU;QACf,IAAI,CAAC,SAAS,CAAC,UAAU,EAAE,CAAC;IAC9B,CAAC;CACF;AAWD,MAAM,UAAU,wBAAwB,CACtC,IAAsC,EACtC,MAAmC;IAEnC,OAAO,IAAI,kBAAkB,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;AAC9C,CAAC","sourcesContent":["import type { ReactiveController, ReactiveControllerHost } from 'lit';\nimport { isElement } from '../util.js';\n\n/** @ignore */\nexport interface MutationControllerConfig<T extends Node = Node> {\n /** The callback function to run when a mutation occurs. */\n callback: MutationControllerCallback<T>;\n /** The underlying mutation observer configuration parameters. */\n config: MutationObserverInit;\n /**\n * The element to observe.\n * If left out, the observer will listen on the host component itself.\n */\n target?: Element;\n /**\n * A filter configuration.\n * See {@link MutationControllerFilter|this} for additional information.\n */\n filter?: MutationControllerFilter<T>;\n}\n\ntype MutationControllerCallback<T extends Node = Node> = (\n params: MutationControllerParams<T>\n) => unknown;\n\n/**\n * Filter configuration to return elements that either match\n * an array of selector strings or a predicate function.\n */\ntype MutationControllerFilter<T extends Node = Node> =\n | string[]\n | ((node: T) => boolean);\n\ntype MutationDOMChange<T extends Node = Node> = {\n /** The parent of the added/removed element. */\n target: Element;\n /** The added/removed element. */\n node: T;\n};\n\ntype MutationAttributeChange<T extends Node = Node> = {\n /** The host element of the changed attribute. */\n node: T;\n /** The changed attribute name. */\n attributeName: string | null;\n};\n\ntype MutationChange<T extends Node = Node> = {\n /** Elements that have attribute(s) changes. */\n attributes: MutationAttributeChange<T>[];\n /** Elements that have been added. */\n added: MutationDOMChange<T>[];\n /** Elements that have been removed. */\n removed: MutationDOMChange<T>[];\n};\n\nexport type MutationControllerParams<T extends Node = Node> = {\n /** The original mutation records from the underlying observer. */\n records: MutationRecord[];\n /** The aggregated changes. */\n changes: MutationChange<T>;\n /** The observer controller instance. */\n observer: MutationController<T>;\n};\n\nfunction applyNodeFilter<T extends Node = Node>(\n nodes: T[],\n predicate?: MutationControllerFilter<T>\n): T[] {\n if (!predicate) {\n return nodes;\n }\n\n return Array.isArray(predicate)\n ? nodes.filter(\n (node) =>\n isElement(node) &&\n predicate.some((selector) => node.matches(selector))\n )\n : nodes.filter(predicate);\n}\n\nclass MutationController<T extends Node = Node> implements ReactiveController {\n private readonly _host: ReactiveControllerHost & Element;\n private readonly _observer: MutationObserver;\n private readonly _target: Element;\n private readonly _config: MutationObserverInit;\n private readonly _callback: MutationControllerCallback<T>;\n private readonly _filter?: MutationControllerFilter<T>;\n\n constructor(\n host: ReactiveControllerHost & Element,\n options: MutationControllerConfig<T>\n ) {\n this._host = host;\n this._callback = options.callback;\n this._config = options.config;\n this._target = options.target ?? this._host;\n this._filter = options.filter;\n\n this._observer = new MutationObserver((records) => {\n this.disconnect();\n this._callback.call(this._host, this._process(records));\n this.observe();\n });\n\n host.addController(this);\n }\n\n /** @internal */\n public hostConnected(): void {\n this.observe();\n }\n\n /** @internal */\n public hostDisconnected(): void {\n this.disconnect();\n }\n\n private _process(records: MutationRecord[]): MutationControllerParams<T> {\n const predicate = this._filter;\n const changes: MutationChange<T> = {\n attributes: [],\n added: [],\n removed: [],\n };\n\n for (const record of records) {\n const { type, target, attributeName, addedNodes, removedNodes } = record;\n\n if (type === 'attributes') {\n changes.attributes.push(\n ...applyNodeFilter([target as T], predicate).map((node) => ({\n node,\n attributeName,\n }))\n );\n } else if (type === 'childList') {\n changes.added.push(\n ...applyNodeFilter([...addedNodes] as T[], predicate).map((node) => ({\n target: target as Element,\n node,\n }))\n );\n changes.removed.push(\n ...applyNodeFilter([...removedNodes] as T[], predicate).map(\n (node) => ({\n target: target as Element,\n node,\n })\n )\n );\n }\n }\n\n return { records, changes, observer: this };\n }\n\n /**\n * Begin receiving notifications of changes to the DOM based\n * on the configured {@link MutationControllerConfig.target|target} and observer {@link MutationControllerConfig.config|options}.\n */\n public observe(): void {\n this._observer.observe(this._target, this._config);\n }\n\n /** Stop watching for mutations. */\n public disconnect(): void {\n this._observer.disconnect();\n }\n}\n\n/**\n * Creates and attaches a mutation controller with `config` to the passed in `host`.\n *\n * Automatically starts/stops observing for mutation changes\n * in the respective component connect/disconnect callbacks.\n *\n * The mutation observer is disconnected before invoking the passed in callback and re-attached\n * after that in order to not loop itself in endless stream of changes.\n */\nexport function createMutationController<T extends Node = Node>(\n host: ReactiveControllerHost & Element,\n config: MutationControllerConfig<T>\n): MutationController<T> {\n return new MutationController(host, config);\n}\n"]}
1
+ {"version":3,"file":"mutation-observer.js","sourceRoot":"","sources":["../../../../src/components/common/controllers/mutation-observer.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,GAGT,MAAM,KAAK,CAAC;AACb,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AA+DvC,SAAS,eAAe,CACtB,KAAU,EACV,SAAuC;IAEvC,IAAI,CAAC,SAAS,EAAE,CAAC;QACf,OAAO,KAAK,CAAC;IACf,CAAC;IAED,OAAO,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC;QAC7B,CAAC,CAAC,KAAK,CAAC,MAAM,CACV,CAAC,IAAI,EAAE,EAAE,CACP,SAAS,CAAC,IAAI,CAAC;YACf,SAAS,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CACvD;QACH,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;AAC9B,CAAC;AAED,MAAM,kBAAkB;IAStB,YACE,IAAsC,EACtC,OAAoC;QAEpC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;QAClB,IAAI,CAAC,SAAS,GAAG,OAAO,CAAC,QAAQ,CAAC;QAClC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC;QAC9B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,MAAM,IA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AE,CAAC;gBAChC,OAAO,CAAC,KAAK,CAAC,IAAI,CAChB,GAAG,eAAe,CAAC,CAAC,GAAG,UAAU,CAAQ,EAAE,SAAS,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;oBACnE,MAAM,EAAE,MAAiB;oBACzB,IAAI;iBACL,CAAC,CAAC,CACJ,CAAC;gBACF,OAAO,CAAC,OAAO,CAAC,IAAI,CAClB,GAAG,eAAe,CAAC,CAAC,GAAG,YAAY,CAAQ,EAAE,SAAS,CAAC,CAAC,GAAG,CACzD,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;oBACT,MAAM,EAAE,MAAiB;oBACzB,IAAI;iBACL,CAAC,CACH,CACF,CAAC;YACJ,CAAC;QACH,CAAC;QAED,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAC9C,CAAC;IAMM,OAAO;QACZ,IAAI,CAAC,SAAS,EAAE,OAAO,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;IACtD,CAAC;IAGM,UAAU;QACf,IAAI,CAAC,SAAS,EAAE,UAAU,EAAE,CAAC;IAC/B,CAAC;CACF;AAWD,MAAM,UAAU,wBAAwB,CACtC,IAAsC,EACtC,MAAmC;IAEnC,OAAO,IAAI,kBAAkB,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;AAC9C,CAAC","sourcesContent":["import {\n isServer,\n type ReactiveController,\n type ReactiveControllerHost,\n} from 'lit';\nimport { isElement } from '../util.js';\n\n/** @ignore */\nexport interface MutationControllerConfig<T extends Node = Node> {\n /** The callback function to run when a mutation occurs. */\n callback: MutationControllerCallback<T>;\n /** The underlying mutation observer configuration parameters. */\n config: MutationObserverInit;\n /**\n * The element to observe.\n * If left out, the observer will listen on the host component itself.\n */\n target?: Element;\n /**\n * A filter configuration.\n * See {@link MutationControllerFilter|this} for additional information.\n */\n filter?: MutationControllerFilter<T>;\n}\n\ntype MutationControllerCallback<T extends Node = Node> = (\n params: MutationControllerParams<T>\n) => unknown;\n\n/**\n * Filter configuration to return elements that either match\n * an array of selector strings or a predicate function.\n */\ntype MutationControllerFilter<T extends Node = Node> =\n string[] | ((node: T) => boolean);\n\ntype MutationDOMChange<T extends Node = Node> = {\n /** The parent of the added/removed element. */\n target: Element;\n /** The added/removed element. */\n node: T;\n};\n\ntype MutationAttributeChange<T extends Node = Node> = {\n /** The host element of the changed attribute. */\n node: T;\n /** The changed attribute name. */\n attributeName: string | null;\n};\n\ntype MutationChange<T extends Node = Node> = {\n /** Elements that have attribute(s) changes. */\n attributes: MutationAttributeChange<T>[];\n /** Elements that have been added. */\n added: MutationDOMChange<T>[];\n /** Elements that have been removed. */\n removed: MutationDOMChange<T>[];\n};\n\nexport type MutationControllerParams<T extends Node = Node> = {\n /** The original mutation records from the underlying observer. */\n records: MutationRecord[];\n /** The aggregated changes. */\n changes: MutationChange<T>;\n /** The observer controller instance. */\n observer: MutationController<T>;\n};\n\nfunction applyNodeFilter<T extends Node = Node>(\n nodes: T[],\n predicate?: MutationControllerFilter<T>\n): T[] {\n if (!predicate) {\n return nodes;\n }\n\n return Array.isArray(predicate)\n ? nodes.filter(\n (node) =>\n isElement(node) &&\n predicate.some((selector) => node.matches(selector))\n )\n : nodes.filter(predicate);\n}\n\nclass MutationController<T extends Node = Node> implements ReactiveController {\n private readonly _host: ReactiveControllerHost & Element;\n private readonly _target: Element;\n private readonly _config: MutationObserverInit;\n private readonly _callback: MutationControllerCallback<T>;\n private readonly _filter?: MutationControllerFilter<T>;\n\n private _observer?: MutationObserver;\n\n constructor(\n host: ReactiveControllerHost & Element,\n options: MutationControllerConfig<T>\n ) {\n this._host = host;\n this._callback = options.callback;\n this._config = options.config;\n this._target = options.target ?? this._host;\n this._filter = options.filter;\n\n if (!isServer) {\n this._observer = new MutationObserver((records) => {\n this.disconnect();\n this._callback.call(this._host, this._process(records));\n this.observe();\n });\n }\n\n host.addController(this);\n }\n\n /** @internal */\n public hostConnected(): void {\n this.observe();\n }\n\n /** @internal */\n public hostDisconnected(): void {\n this.disconnect();\n }\n\n private _process(records: MutationRecord[]): MutationControllerParams<T> {\n const predicate = this._filter;\n const changes: MutationChange<T> = {\n attributes: [],\n added: [],\n removed: [],\n };\n\n for (const record of records) {\n const { type, target, attributeName, addedNodes, removedNodes } = record;\n\n if (type === 'attributes') {\n changes.attributes.push(\n ...applyNodeFilter([target as T], predicate).map((node) => ({\n node,\n attributeName,\n }))\n );\n } else if (type === 'childList') {\n changes.added.push(\n ...applyNodeFilter([...addedNodes] as T[], predicate).map((node) => ({\n target: target as Element,\n node,\n }))\n );\n changes.removed.push(\n ...applyNodeFilter([...removedNodes] as T[], predicate).map(\n (node) => ({\n target: target as Element,\n node,\n })\n )\n );\n }\n }\n\n return { records, changes, observer: this };\n }\n\n /**\n * Begin receiving notifications of changes to the DOM based\n * on the configured {@link MutationControllerConfig.target|target} and observer {@link MutationControllerConfig.config|options}.\n */\n public observe(): void {\n this._observer?.observe(this._target, this._config);\n }\n\n /** Stop watching for mutations. */\n public disconnect(): void {\n this._observer?.disconnect();\n }\n}\n\n/**\n * Creates and attaches a mutation controller with `config` to the passed in `host`.\n *\n * Automatically starts/stops observing for mutation changes\n * in the respective component connect/disconnect callbacks.\n *\n * The mutation observer is disconnected before invoking the passed in callback and re-attached\n * after that in order to not loop itself in endless stream of changes.\n */\nexport function createMutationController<T extends Node = Node>(\n host: ReactiveControllerHost & Element,\n config: MutationControllerConfig<T>\n): MutationController<T> {\n return new MutationController(host, config);\n}\n"]}
@@ -1,4 +1,4 @@
1
- import type { LitElement, ReactiveController, ReactiveControllerHost } from 'lit';
1
+ import { type LitElement, type ReactiveController, type ReactiveControllerHost } from 'lit';
2
2
  type InferSlotNames<T> = T extends readonly (infer U)[] ? U : never;
3
3
  /**
4
4
  * Additional query options for the slot controller methods.
@@ -1,3 +1,4 @@
1
+ import { isServer, } from 'lit';
1
2
  import { isEmpty } from '../util.js';
2
3
  const DefaultSlot = '[default]';
3
4
  class SlotController {
@@ -9,10 +10,12 @@ class SlotController {
9
10
  this._slots = options?.slots ? new Set(options.slots) : undefined;
10
11
  }
11
12
  _getSlot(slotName) {
13
+ if (isServer)
14
+ return null;
12
15
  if (slotName === DefaultSlot) {
13
16
  return this._host.renderRoot.querySelector('slot:not([name])');
14
17
  }
15
- return this._host.renderRoot.querySelector(`slot[name=${slotName}]`);
18
+ return this._host.renderRoot.querySelector(`slot[name="${slotName}"]`);
16
19
  }
17
20
  getAssignedNodes(slot, flatten = false) {
18
21
  return this._getSlot(slot)?.assignedNodes({ flatten }) ?? [];
@@ -1 +1 @@
1
- {"version":3,"file":"slot.js","sourceRoot":"","sources":["../../../../src/components/common/controllers/slot.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AA4CrC,MAAM,WAAW,GAAG,WAAW,CAAC;AAEhC,MAAM,cAAc;IAMlB,YACE,IAAyC,EACzC,OAAkC;QAJ5B,iBAAY,GAAG,KAAK,CAAC;QAM3B,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;QAClB,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;QAE/B,IAAI,CAAC,QAAQ,GAAG,EAAE,GAAG,OAAO,EAAE,CAAC;QAC/B,IAAI,CAAC,MAAM,GAAG,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IACpE,CAAC;IAEO,QAAQ,CAAC,QAAY;QAC3B,IAAI,QAAQ,KAAK,WAAW,EAAE,CAAC;YAC7B,OAAO,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,aAAa,CACxC,kBAAkB,CACnB,CAAC;QACJ,CAAC;QAED,OAAO,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,aAAa,CACxC,aAAa,QAAQ,GAAG,CACzB,CAAC;IACJ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Q,CAAC,QAAQ,EAAE,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE;gBACvC,IAAI,EAAE,IAAI;gBACV,SAAS;gBACT,SAAS,EAAE,KAAK;aACjB,CAAC,CAAC;YACH,IAAI,CAAC,KAAK,CAAC,aAAa,EAAE,CAAC;QAC7B,CAAC;IACH,CAAC;IAGM,aAAa;QAClB,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,gBAAgB,CAAC,YAAY,EAAE,IAAI,CAAC,CAAC;IAC7D,CAAC;IAGM,gBAAgB;QACrB,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,mBAAmB,CAAC,YAAY,EAAE,IAAI,CAAC,CAAC;IAChE,CAAC;IAGM,WAAW;QAChB,IAAI,CAAC,IAAI,CAAC,YAAY,IAAI,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC;YAChD,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC;YACzB,IAAI,CAAC,QAAQ,CAAC,QAAQ,EAAE,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE;gBACvC,IAAI,EAAE,WAAgB;gBACtB,SAAS,EAAE,KAAK;gBAChB,SAAS,EAAE,IAAI;aAChB,CAAC,CAAC;QACL,CAAC;IACH,CAAC;CACF;AAED,SAAS,iBAAiB,CACxB,IAA4B,EAC5B,OAEC;IAED,OAAO,IAAI,cAAc,CAAC,IAA2C,EAAE;QACrE,GAAG,OAAO;QACV,KAAK,EAAE,OAAO,EAAE,KAAoC;KACrD,CAAC,CAAC;AACL,CAAC;AAED,SAAS,QAAQ,CAAoC,GAAG,KAAQ;IAC9D,OAAO,CAAC,WAAW,EAAE,GAAG,KAAK,CAAU,CAAC;AAC1C,CAAC;AAUD,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,QAAQ,EAAE,CAAC","sourcesContent":["import type {\n LitElement,\n ReactiveController,\n ReactiveControllerHost,\n} from 'lit';\nimport { isEmpty } from '../util.js';\n\ntype InferSlotNames<T> = T extends readonly (infer U)[] ? U : never;\n\n/**\n * Additional query options for the slot controller methods.\n */\ntype SlotQueryOptions = {\n /**\n * If set to `true`, it returns a sequence of both the elements assigned to the queried slot,\n * as well as elements assigned to any other slots that are descendants of this slot. If no\n * assigned elements are found, it returns the slot's fallback content.\n *\n * Defaults to `false`.\n */\n flatten?: boolean;\n /**\n * CSS selector used to filter the elements returned.\n */\n selector?: string;\n};\n\ntype SlotChangeCallback<T> = (\n parameters: SlotChangeCallbackParameters<T>\n) => void;\n\ntype SlotChangeCallbackParameters<T> = {\n /** The slot name that has its assigned nodes changed. */\n slot: T;\n /** `true` if the slot is the default slot. */\n isDefault: boolean;\n /** `true` if the callback handler is called for the initial host update. */\n isInitial: boolean;\n};\n\ntype SlotControllerOptions<T> = {\n /** An iterable collection of slot names to observe. */\n slots?: Iterable<T>;\n /** Callback function which is invoked a slot's assigned nodes change. */\n onChange?: SlotChangeCallback<T>;\n /** If set to `true`, the `onChange` callback is invoked once after the host is updated for the first time. */\n initial?: boolean;\n};\n\nconst DefaultSlot = '[default]';\n\nclass SlotController<T> implements ReactiveController {\n private readonly _host: ReactiveControllerHost & LitElement;\n private readonly _options: SlotControllerOptions<T>;\n private readonly _slots?: Set<T>;\n private _initialized = false;\n\n constructor(\n host: ReactiveControllerHost & LitElement,\n options?: SlotControllerOptions<T>\n ) {\n this._host = host;\n this._host.addController(this);\n\n this._options = { ...options };\n this._slots = options?.slots ? new Set(options.slots) : undefined;\n }\n\n private _getSlot(slotName?: T): HTMLSlotElement | null {\n if (slotName === DefaultSlot) {\n return this._host.renderRoot.querySelector<HTMLSlotElement>(\n 'slot:not([name])'\n );\n }\n\n return this._host.renderRoot.querySelector<HTMLSlotElement>(\n `slot[name=${slotName}]`\n );\n }\n\n /**\n * Returns an array of the assigned nodes for `slot`.\n *\n * If `flatten` is set to `true`, it returns a sequence of both the nodes assigned to the queried slot,\n * as well as nodes assigned to any other slots that are descendants of this slot. If no\n * assigned nodes are found, it returns the slot's fallback content.\n */\n public getAssignedNodes(slot: T, flatten = false): Node[] {\n return this._getSlot(slot)?.assignedNodes({ flatten }) ?? [];\n }\n\n /**\n * Returns an array of the assigned elements for `slot` with additional `options`.\n *\n * See {@link SlotQueryOptions.flatten} and {@link SlotQueryOptions.selector} for more information.\n */\n public getAssignedElements<U extends Element>(\n slot: T,\n options?: SlotQueryOptions\n ): U[] {\n const elements =\n (this._getSlot(slot)?.assignedElements({\n flatten: options?.flatten,\n }) as U[]) ?? [];\n\n return options?.selector\n ? elements.filter((e) => e.matches(options.selector!))\n : elements;\n }\n\n /**\n * Return whether `slot` has assigned nodes.\n *\n * If `flatten` is set to `true`, it returns a sequence of both the nodes assigned to the queried slot,\n * as well as nodes assigned to any other slots that are descendants of this slot. If no\n * assigned nodes are found, it returns the slot's fallback content.\n */\n public hasAssignedNodes(slot: T, flatten = false): boolean {\n return !isEmpty(this.getAssignedNodes(slot, flatten));\n }\n\n /**\n * Return whether `slot` has assigned elements accepting additional `options`.\n *\n * See {@link SlotQueryOptions.flatten} and {@link SlotQueryOptions.selector} for more information.\n */\n public hasAssignedElements(slot: T, options?: SlotQueryOptions): boolean {\n return !isEmpty(this.getAssignedElements(slot, options));\n }\n\n /** @internal */\n public handleEvent(event: Event): void {\n const slot = event.target as HTMLSlotElement;\n const name = slot.name as T;\n const isDefault = name === '';\n\n if (\n !this._slots ||\n this._slots.has(isDefault ? (DefaultSlot as T) : (slot.name as T))\n ) {\n this._options.onChange?.call(this._host, {\n slot: name,\n isDefault,\n isInitial: false,\n });\n this._host.requestUpdate();\n }\n }\n\n /** @internal */\n public hostConnected(): void {\n this._host.renderRoot.addEventListener('slotchange', this);\n }\n\n /** @internal */\n public hostDisconnected(): void {\n this._host.renderRoot.removeEventListener('slotchange', this);\n }\n\n /** @internal */\n public hostUpdated(): void {\n if (!this._initialized && this._options.initial) {\n this._initialized = true;\n this._options.onChange?.call(this._host, {\n slot: '<initial>' as T,\n isDefault: false,\n isInitial: true,\n });\n }\n }\n}\n\nfunction addSlotController<K extends readonly string[]>(\n host: ReactiveControllerHost,\n options?: SlotControllerOptions<InferSlotNames<K>> & {\n slots?: K;\n }\n): SlotController<InferSlotNames<K>> {\n return new SlotController(host as ReactiveControllerHost & LitElement, {\n ...options,\n slots: options?.slots as Iterable<InferSlotNames<K>>,\n });\n}\n\nfunction setSlots<const T extends readonly string[]>(...slots: T) {\n return [DefaultSlot, ...slots] as const;\n}\n\nexport type {\n InferSlotNames,\n SlotChangeCallback,\n SlotChangeCallbackParameters,\n SlotController,\n SlotControllerOptions,\n SlotQueryOptions,\n};\nexport { addSlotController, DefaultSlot, setSlots };\n"]}
1
+ {"version":3,"file":"slot.js","sourceRoot":"","sources":["../../../../src/components/common/controllers/slot.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,GAIT,MAAM,KAAK,CAAC;AACb,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AA4CrC,MAAM,WAAW,GAAG,WAAW,CAAC;AAEhC,MAAM,cAAc;IAMlB,YACE,IAAyC,EACzC,OAAkC;QAJ5B,iBAAY,GAAG,KAAK,CAAC;QAM3B,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;QAClB,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;QAE/B,IAAI,CAAC,QAAQ,GAAG,EAAE,GAAG,OAAO,EAAE,CAAC;QAC/B,IAAI,CAAC,MAAM,GAAG,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IACpE,CAAC;IAEO,QAAQ,CAAC,QAAY;QAC3B,IAAI,QAAQ;YAAE,OAAO,IAAI,CAAC;QAC1B,IAAI,QAAQ,KAAK,WAAW,EAAE,CAAC;YAC7B,OAAO,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,aAAa,CACxC,kBAAkB,CACnB,CAAC;QACJ,CAAC;QAED,OAAO,IAAI,CAAC,KAAK,CA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ControllerHost,\n} from 'lit';\nimport { isEmpty } from '../util.js';\n\ntype InferSlotNames<T> = T extends readonly (infer U)[] ? U : never;\n\n/**\n * Additional query options for the slot controller methods.\n */\ntype SlotQueryOptions = {\n /**\n * If set to `true`, it returns a sequence of both the elements assigned to the queried slot,\n * as well as elements assigned to any other slots that are descendants of this slot. If no\n * assigned elements are found, it returns the slot's fallback content.\n *\n * Defaults to `false`.\n */\n flatten?: boolean;\n /**\n * CSS selector used to filter the elements returned.\n */\n selector?: string;\n};\n\ntype SlotChangeCallback<T> = (\n parameters: SlotChangeCallbackParameters<T>\n) => void;\n\ntype SlotChangeCallbackParameters<T> = {\n /** The slot name that has its assigned nodes changed. */\n slot: T;\n /** `true` if the slot is the default slot. */\n isDefault: boolean;\n /** `true` if the callback handler is called for the initial host update. */\n isInitial: boolean;\n};\n\ntype SlotControllerOptions<T> = {\n /** An iterable collection of slot names to observe. */\n slots?: Iterable<T>;\n /** Callback function which is invoked a slot's assigned nodes change. */\n onChange?: SlotChangeCallback<T>;\n /** If set to `true`, the `onChange` callback is invoked once after the host is updated for the first time. */\n initial?: boolean;\n};\n\nconst DefaultSlot = '[default]';\n\nclass SlotController<T> implements ReactiveController {\n private readonly _host: ReactiveControllerHost & LitElement;\n private readonly _options: SlotControllerOptions<T>;\n private readonly _slots?: Set<T>;\n private _initialized = false;\n\n constructor(\n host: ReactiveControllerHost & LitElement,\n options?: SlotControllerOptions<T>\n ) {\n this._host = host;\n this._host.addController(this);\n\n this._options = { ...options };\n this._slots = options?.slots ? new Set(options.slots) : undefined;\n }\n\n private _getSlot(slotName?: T): HTMLSlotElement | null {\n if (isServer) return null;\n if (slotName === DefaultSlot) {\n return this._host.renderRoot.querySelector<HTMLSlotElement>(\n 'slot:not([name])'\n );\n }\n\n return this._host.renderRoot.querySelector<HTMLSlotElement>(\n `slot[name=\"${slotName}\"]`\n );\n }\n\n /**\n * Returns an array of the assigned nodes for `slot`.\n *\n * If `flatten` is set to `true`, it returns a sequence of both the nodes assigned to the queried slot,\n * as well as nodes assigned to any other slots that are descendants of this slot. If no\n * assigned nodes are found, it returns the slot's fallback content.\n */\n public getAssignedNodes(slot: T, flatten = false): Node[] {\n return this._getSlot(slot)?.assignedNodes({ flatten }) ?? [];\n }\n\n /**\n * Returns an array of the assigned elements for `slot` with additional `options`.\n *\n * See {@link SlotQueryOptions.flatten} and {@link SlotQueryOptions.selector} for more information.\n */\n public getAssignedElements<U extends Element>(\n slot: T,\n options?: SlotQueryOptions\n ): U[] {\n const elements =\n (this._getSlot(slot)?.assignedElements({\n flatten: options?.flatten,\n }) as U[]) ?? [];\n\n return options?.selector\n ? elements.filter((e) => e.matches(options.selector!))\n : elements;\n }\n\n /**\n * Return whether `slot` has assigned nodes.\n *\n * If `flatten` is set to `true`, it returns a sequence of both the nodes assigned to the queried slot,\n * as well as nodes assigned to any other slots that are descendants of this slot. If no\n * assigned nodes are found, it returns the slot's fallback content.\n */\n public hasAssignedNodes(slot: T, flatten = false): boolean {\n return !isEmpty(this.getAssignedNodes(slot, flatten));\n }\n\n /**\n * Return whether `slot` has assigned elements accepting additional `options`.\n *\n * See {@link SlotQueryOptions.flatten} and {@link SlotQueryOptions.selector} for more information.\n */\n public hasAssignedElements(slot: T, options?: SlotQueryOptions): boolean {\n return !isEmpty(this.getAssignedElements(slot, options));\n }\n\n /** @internal */\n public handleEvent(event: Event): void {\n const slot = event.target as HTMLSlotElement;\n const name = slot.name as T;\n const isDefault = name === '';\n\n if (\n !this._slots ||\n this._slots.has(isDefault ? (DefaultSlot as T) : (slot.name as T))\n ) {\n this._options.onChange?.call(this._host, {\n slot: name,\n isDefault,\n isInitial: false,\n });\n this._host.requestUpdate();\n }\n }\n\n /** @internal */\n public hostConnected(): void {\n this._host.renderRoot.addEventListener('slotchange', this);\n }\n\n /** @internal */\n public hostDisconnected(): void {\n this._host.renderRoot.removeEventListener('slotchange', this);\n }\n\n /** @internal */\n public hostUpdated(): void {\n if (!this._initialized && this._options.initial) {\n this._initialized = true;\n this._options.onChange?.call(this._host, {\n slot: '<initial>' as T,\n isDefault: false,\n isInitial: true,\n });\n }\n }\n}\n\nfunction addSlotController<K extends readonly string[]>(\n host: ReactiveControllerHost,\n options?: SlotControllerOptions<InferSlotNames<K>> & {\n slots?: K;\n }\n): SlotController<InferSlotNames<K>> {\n return new SlotController(host as ReactiveControllerHost & LitElement, {\n ...options,\n slots: options?.slots as Iterable<InferSlotNames<K>>,\n });\n}\n\nfunction setSlots<const T extends readonly string[]>(...slots: T) {\n return [DefaultSlot, ...slots] as const;\n}\n\nexport type {\n InferSlotNames,\n SlotChangeCallback,\n SlotChangeCallbackParameters,\n SlotController,\n SlotControllerOptions,\n SlotQueryOptions,\n};\nexport { addSlotController, DefaultSlot, setSlots };\n"]}