import { ElementRef, TemplateRef } from '@angular/core'; import { PassThroughOption, PassThrough } from 'primeng/api'; /** * Custom pass-through(pt) options. * @template I Type of instance. * * @see {@link CascadeSelect.pt} * @group Interface */ interface CascadeSelectPassThroughOptions { /** * Used to pass attributes to the root's DOM element. */ root?: PassThroughOption; /** * Used to pass attributes to the hidden input wrapper's DOM element. */ hiddenInputWrapper?: PassThroughOption; /** * Used to pass attributes to the hidden input's DOM element. */ hiddenInput?: PassThroughOption; /** * Used to pass attributes to the label's DOM element. */ label?: PassThroughOption; /** * 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 clear icon's DOM element. */ clearIcon?: PassThroughOption; /** * Used to pass attributes to the overlay's DOM element. */ overlay?: 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 list's DOM element. */ optionList?: PassThroughOption; /** * Used to pass attributes to the option's DOM element. */ option?: PassThroughOption; /** * Used to pass attributes to the option content's DOM element. */ optionContent?: PassThroughOption; /** * Used to pass attributes to the option text's DOM element. */ optionText?: PassThroughOption; /** * Used to pass attributes to the group icon's DOM element. */ groupIcon?: PassThroughOption; } /** * Defines valid pass-through options in CascadeSelect. * @see {@link CascadeSelectPassThroughOptions} * * @template I Type of instance. */ type CascadeSelectPassThrough = PassThrough>; /** * Custom panel show event. * @see {@link CascadeSelect.onShow} * @group Events */ interface CascadeSelectShowEvent { /** * Overlay element. */ overlay?: ElementRef | TemplateRef | HTMLElement | null | undefined; /** * Target element. */ target?: ElementRef | TemplateRef | HTMLElement | null | undefined; /** * Overlay mode. */ overlayMode?: 'modal' | 'overlay' | string; } /** * Custom panel hide event. * @see {@link CascadeSelect.onHide} * @extends {CascadeSelectShowEvent} * @group Events */ interface CascadeSelectHideEvent extends CascadeSelectShowEvent { } /** * Custom panel show event emits right before the panel is shown. * @see {@link CascadeSelect.onBeforeShow} * @extends {CascadeSelectShowEvent} * @group Events */ interface CascadeSelectBeforeShowEvent extends CascadeSelectShowEvent { } /** * Custom panel hide event emits right before the panel is hidden. * @see {@link CascadeSelect.onBeforeHide} * @extends {CascadeSelectShowEvent} * @group Events */ interface CascadeSelectBeforeHideEvent extends CascadeSelectShowEvent { } /** * Custom panel change event emits when selection changed. * @see {@link CascadeSelect.onChange} * @group Events */ interface CascadeSelectChangeEvent { /** * Browser event. */ originalEvent?: Event; /** * Selected value. */ value?: any; /** * Focus state. */ isFocus?: boolean; } /** * Custom value template context. * @group Interface */ interface CascadeSelectValueTemplateContext { /** * Selected value. */ $implicit: T; /** * Placeholder text. */ placeholder: string; } /** * Custom option template context. * @group Interface */ interface CascadeSelectOptionTemplateContext { /** * Option instance. */ $implicit: T; /** * Level of the option in the hierarchy. */ level: number; } /** * Defines valid templates in CascadeSelect. * @group Templates */ interface CascadeSelectTemplates { /** * Custom value template. * @param {Object} context - value data. */ value(context: CascadeSelectValueTemplateContext): TemplateRef>; /** * Custom option template. * @param {Object} context - option data. */ option(context: CascadeSelectOptionTemplateContext): TemplateRef>; /** * Custom header template. */ header(): TemplateRef; /** * Custom footer template. */ footer(): TemplateRef; /** * Custom dropdown trigger icon template. */ triggericon(): TemplateRef; /** * Custom clear icon template. */ clearicon(): TemplateRef; /** * Custom option group icon template. */ optiongroupicon(): TemplateRef; /** * Custom loading icon template. */ loadingicon(): TemplateRef; } export type { CascadeSelectBeforeHideEvent, CascadeSelectBeforeShowEvent, CascadeSelectChangeEvent, CascadeSelectHideEvent, CascadeSelectOptionTemplateContext, CascadeSelectPassThrough, CascadeSelectPassThroughOptions, CascadeSelectShowEvent, CascadeSelectTemplates, CascadeSelectValueTemplateContext };