import { TemplateRef } from '@angular/core'; import { PassThroughOption, PassThrough, ScrollerOptions } from 'primeng/api'; import { CheckboxPassThrough } from 'primeng/types/checkbox'; import { ChipPassThrough } from 'primeng/types/chip'; import { IconFieldPassThrough } from 'primeng/types/iconfield'; import { InputIconPassThrough } from 'primeng/types/inputicon'; import { InputTextPassThrough } from 'primeng/types/inputtext'; /** * Custom pass-through(pt) options. * @template I Type of instance. * @see {@link MultiSelect.pt} * @group Interface */ interface MultiSelectPassThroughOptions { /** * Used to pass attributes to the root's DOM element. */ root?: PassThroughOption; /** * Used to pass attributes to the label container's DOM element. */ labelContainer?: PassThroughOption; /** * Used to pass attributes to the label's DOM element. */ label?: PassThroughOption; /** * Used to pass attributes to the clear icon's DOM element. */ clearIcon?: PassThroughOption; /** * Used to pass attributes to the chip item's DOM element. */ chipItem?: PassThroughOption; /** * Used to pass attributes to the Chip component. * @see {@link ChipPassThrough} */ pcChip?: ChipPassThrough; /** * Used to pass attributes to the dropdown's DOM element. */ dropdown?: PassThroughOption; /** * Used to pass attributes to the loading icon's DOM element. */ loadingIcon?: PassThroughOption; /** * Used to pass attributes to the dropdown icon's DOM element. */ dropdownIcon?: PassThroughOption; /** * Used to pass attributes to the overlay's DOM element. */ overlay?: PassThroughOption; /** * Used to pass attributes to the header's DOM element. */ header?: PassThroughOption; /** * Used to pass attributes to the header checkbox component. * @see {@link CheckboxPassThrough} */ pcHeaderCheckbox?: CheckboxPassThrough; /** * Used to pass attributes to the IconField component. * @see {@link IconFieldPassThrough} */ pcFilterContainer?: IconFieldPassThrough; /** * Used to pass attributes to the InputText component. * @see {@link InputTextPassThrough} */ pcFilter?: InputTextPassThrough; /** * Used to pass attributes to the InputIcon component. * @see {@link InputIconPassThrough} */ pcFilterIconContainer?: InputIconPassThrough; /** * Used to pass attributes to the filter icon's DOM element. */ filterIcon?: PassThroughOption; /** * Used to pass attributes to the list container's DOM element. */ listContainer?: PassThroughOption; /** * Used to pass attributes to the list's DOM element. */ list?: PassThroughOption; /** * Used to pass attributes to the option group's DOM element. */ optionGroup?: PassThroughOption; /** * Used to pass attributes to the option's DOM element. */ option?: PassThroughOption; /** * Used to pass attributes to the option checkbox component. * @see {@link CheckboxPassThrough} */ pcOptionCheckbox?: CheckboxPassThrough; /** * Used to pass attributes to the empty message's DOM element. */ emptyMessage?: PassThroughOption; } /** * Defines valid pass-through options in MultiSelect. * @see {@link MultiSelectPassThroughOptions} * @template I Type of instance. */ type MultiSelectPassThrough = PassThrough>; /** * Callbacks to invoke on filter or reset. * @group Interface */ interface MultiSelectFilterOptions { filter?: (value?: any) => void; reset?: () => void; } /** * Custom change event. * @see {@link MultiSelect.onChange} * @group Events */ interface MultiSelectChangeEvent { /** * Browser event. */ originalEvent: Event; /** * Current selected values. */ value: any; /** * Toggled item value. */ itemValue?: any; } /** * Custom change event. * @see {@link MultiSelect.onSelectAllChange} * @group Events */ interface MultiSelectSelectAllChangeEvent { /** * Browser event. */ originalEvent: Event; /** * Boolean value indicates whether all data is selected. */ checked: boolean; } /** * Custom filter event. * @see {@link MultiSelect.onFilter} * @group Events */ interface MultiSelectFilterEvent { /** * Browser event. */ originalEvent: Event; /** * Filter value. */ filter: any; } /** * Custom focus event. * @see {@link MultiSelect.onFocus} * @group Events */ interface MultiSelectFocusEvent { /** * Browser event. */ originalEvent: Event; } /** * Custom blur event. * @see {@link MultiSelect.onBlur} * @extends {MultiSelectFocusEvent} * @group Events */ interface MultiSelectBlurEvent extends MultiSelectFocusEvent { } /** * Custom lazy load event. * @see {@link MultiSelect.onLazyLoad} * @group Events */ interface MultiSelectLazyLoadEvent { /** * Index of the first element in viewport. */ first: number; /** * Index of the last element in viewport. */ last: number; } /** * Custom remove event. * @see {@link MultiSelect.onRemove} * @group Events */ interface MultiSelectRemoveEvent { /** * Value after the item removed. */ newValue: object; /** * Removed value. */ removed: unknown; } /** * Custom item template context. * @group Interface */ interface MultiSelectItemTemplateContext { /** * Data of the option. */ $implicit: T; } /** * Custom selected items template context. * @group Interface */ interface MultiSelectSelectedItemsTemplateContext { /** * Selected options value. */ $implicit: T[]; /** * Function to remove a chip. */ removeChip: (chip: T, event: MouseEvent) => void; } /** * Custom group template context. * @group Interface */ interface MultiSelectGroupTemplateContext { /** * Group option. */ $implicit: T; } /** * Custom filter template context. * @group Interface */ interface MultiSelectFilterTemplateContext { /** * Filter options. */ options: MultiSelectFilterOptions; } /** * Custom loader template context. * @group Interface */ interface MultiSelectLoaderTemplateContext { /** * Virtual scroller options. */ options: ScrollerOptions; } /** * Custom dropdown icon template context. * @group Interface */ interface MultiSelectDropdownIconTemplateContext { /** * DataP attributes. */ dataP: string; } /** * Custom chip icon template context. * @group Interface */ interface MultiSelectChipIconTemplateContext { /** * Style class of the icon. */ class: string; } /** * Custom header checkbox icon template context. * @group Interface */ interface MultiSelectHeaderCheckboxIconTemplateContext { /** * Defines if all items are selected. */ checked: boolean; /** * Defines if items are partially selected. */ partialSelected: boolean; /** * Style class of the icon. */ class: string; } /** * Custom item checkbox icon template context. * @group Interface */ interface MultiSelectItemCheckboxIconTemplateContext { /** * Selection status of the item. */ checked: boolean; /** * Style class of the icon. */ class: string; } /** * Defines valid templates in MultiSelect. * @group Templates */ interface MultiSelectTemplates { /** * Custom item template. * @param {Object} context - item data. */ item(context: MultiSelectItemTemplateContext): TemplateRef>; /** * Custom selected items template. * @param {Object} context - selected items data. */ selecteditems(context: MultiSelectSelectedItemsTemplateContext): TemplateRef>; /** * Custom header template. */ header(): TemplateRef; /** * Custom filter template. * @param {MultiSelectFilterOptions} options - filter options. */ filter(context: MultiSelectFilterTemplateContext): TemplateRef; /** * Custom footer template. */ footer(): TemplateRef; /** * Custom empty filter template. */ emptyfilter(): TemplateRef; /** * Custom empty template. */ empty(): TemplateRef; /** * Custom group template. */ group(context: MultiSelectGroupTemplateContext): TemplateRef>; /** * Custom loader template. This template can be used with virtualScroll. * @param {ScrollerOptions} options - virtual scroller options. */ loader(context: MultiSelectLoaderTemplateContext): TemplateRef; /** * Custom dropdown trigger icon template. * @param {Object} context - icon context. */ dropdownicon(context: MultiSelectDropdownIconTemplateContext): TemplateRef; /** * Custom clear icon template. */ clearicon(): TemplateRef; /** * Custom filter icon template. */ filtericon(): TemplateRef; /** * Custom loading icon template. */ loadingicon(): TemplateRef; /** * Custom check icon template for the header checkbox. * @param {Object} context - checkbox icon context. */ headercheckboxicon(context: MultiSelectHeaderCheckboxIconTemplateContext): TemplateRef; /** * Custom check icon template for the item checkbox. * @param {Object} context - checkbox icon context. */ itemcheckboxicon(context: MultiSelectItemCheckboxIconTemplateContext): TemplateRef; /** * Custom chip icon template. * @param {Object} context - icon context. */ chipicon(context: MultiSelectChipIconTemplateContext): TemplateRef; /** * Custom remove token icon template. * @deprecated Use chipicon instead. * @param {Object} context - icon context. */ removetokenicon(context: MultiSelectChipIconTemplateContext): TemplateRef; } export type { MultiSelectBlurEvent, MultiSelectChangeEvent, MultiSelectChipIconTemplateContext, MultiSelectDropdownIconTemplateContext, MultiSelectFilterEvent, MultiSelectFilterOptions, MultiSelectFilterTemplateContext, MultiSelectFocusEvent, MultiSelectGroupTemplateContext, MultiSelectHeaderCheckboxIconTemplateContext, MultiSelectItemCheckboxIconTemplateContext, MultiSelectItemTemplateContext, MultiSelectLazyLoadEvent, MultiSelectLoaderTemplateContext, MultiSelectPassThrough, MultiSelectPassThroughOptions, MultiSelectRemoveEvent, MultiSelectSelectAllChangeEvent, MultiSelectSelectedItemsTemplateContext, MultiSelectTemplates };