import { TemplateRef } from '@angular/core'; import { PassThroughOption, PassThrough, TreeNode } from 'primeng/api'; import { ChipPassThrough } from 'primeng/types/chip'; import { OverlayPassThrough } from 'primeng/types/overlay'; import { TreePassThrough } from 'primeng/types/tree'; /** * Custom pass-through(pt) options. * @template I Type of instance. * * @see {@link TreeSelect.pt} * @group Interface */ interface TreeSelectPassThroughOptions { /** * Used to pass attributes to the host's DOM element. */ host?: PassThroughOption; /** * Used to pass attributes to the root's DOM element. */ root?: PassThroughOption; /** * Used to pass attributes to the hidden input container's DOM element. */ hiddenInputContainer?: PassThroughOption; /** * Used to pass attributes to the hidden input's DOM element. */ hiddenInput?: 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 chip item's DOM element. */ chipItem?: PassThroughOption; /** * Used to pass attributes to the Chip component. */ pcChip?: ChipPassThrough; /** * Used to pass attributes to the clear icon's DOM element. */ clearIcon?: PassThroughOption; /** * Used to pass attributes to the dropdown's DOM element. */ dropdown?: PassThroughOption; /** * Used to pass attributes to the dropdown icon's DOM element. */ dropdownIcon?: PassThroughOption; /** * Used to pass attributes to the panel's DOM element. */ panel?: PassThroughOption; /** * Used to pass attributes to the first hidden focusable element's DOM element. */ hiddenFirstFocusableEl?: PassThroughOption; /** * Used to pass attributes to the tree container's DOM element. */ treeContainer?: PassThroughOption; /** * Used to pass attributes to the Tree component. */ pcTree?: TreePassThrough; /** * Used to pass attributes to the last hidden focusable element's DOM element. */ hiddenLastFocusableEl?: PassThroughOption; /** * Used to pass attributes to the Overlay component. */ pcOverlay?: OverlayPassThrough; } /** * Custom passthrough attributes for each DOM elements * @group Interface */ type TreeSelectPassThrough = PassThrough>; /** * Defines valid properties in TreeSelectNodeCollapseEvent. * @group Interface */ interface TreeSelectNodeCollapseEvent { /** * Browser event. */ originalEvent: Event; /** * Collapsed node instance. */ node: TreeNode; } /** * Custom node collapse event. * @see {@link TreeSelect.onNodeCollapse} * @group Events */ interface TreeSelectNodeCollapseEvent { /** * Browser event. */ originalEvent: Event; /** * Node instance. */ node: TreeNode; } /** * Defines valid properties in TreeSelectNodeExpandEvent. * @group Interface */ interface TreeSelectNodeExpandEvent { /** * Browser event. */ originalEvent: Event; /** * Expanded node instance. */ node: TreeNode; } /** * Custom node expand event. * @see {@link TreeSelect.onNodeExpand} * @group Events */ interface TreeSelectNodeExpandEvent extends TreeSelectNodeCollapseEvent { } /** * Custom value template context. * @group Interface */ interface TreeSelectValueTemplateContext { /** * Value of the component. */ $implicit: any; /** * Placeholder of the component. */ placeholder: string | undefined; } /** * Custom header/footer template context. * @group Interface */ interface TreeSelectHeaderTemplateContext { /** * Value of the component. */ $implicit: any; /** * Options of the component. */ options: TreeNode[] | undefined; } /** * Custom item toggler icon template context. * @group Interface */ interface TreeSelectItemTogglerIconTemplateContext { /** * Expanded state of the node. */ $implicit: boolean; } /** * Custom item checkbox icon template context. * @group Interface */ interface TreeSelectItemCheckboxIconTemplateContext { /** * Selected state of the node. */ $implicit: boolean; /** * Partial selection state of the node. */ partialSelected: boolean; } /** * Defines valid templates in TreeSelect. * @group Templates */ interface TreeSelectTemplates { /** * Custom value template. * @param {TreeSelectValueTemplateContext} context - value context. */ value(context: TreeSelectValueTemplateContext): TemplateRef; /** * Custom header template. * @param {TreeSelectHeaderTemplateContext} context - header context. */ header(context: TreeSelectHeaderTemplateContext): TemplateRef; /** * Custom footer template. * @param {TreeSelectHeaderTemplateContext} context - footer context. */ footer(context: TreeSelectHeaderTemplateContext): TemplateRef; /** * Custom empty template. */ empty(): TemplateRef; /** * Custom clear icon template. */ clearicon(): TemplateRef; /** * Custom dropdown trigger icon template. */ triggericon(): TemplateRef; /** * Custom dropdown icon template. */ dropdownicon(): TemplateRef; /** * Custom filter icon template. */ filtericon(): TemplateRef; /** * Custom close icon template. */ closeicon(): TemplateRef; /** * Custom item toggler icon template. * @param {TreeSelectItemTogglerIconTemplateContext} context - toggler icon context. */ itemtogglericon(context: TreeSelectItemTogglerIconTemplateContext): TemplateRef; /** * Custom item checkbox icon template. * @param {TreeSelectItemCheckboxIconTemplateContext} context - checkbox icon context. */ itemcheckboxicon(context: TreeSelectItemCheckboxIconTemplateContext): TemplateRef; /** * Custom item loading icon template. */ itemloadingicon(): TemplateRef; } export type { TreeSelectHeaderTemplateContext, TreeSelectItemCheckboxIconTemplateContext, TreeSelectItemTogglerIconTemplateContext, TreeSelectNodeCollapseEvent, TreeSelectNodeExpandEvent, TreeSelectPassThrough, TreeSelectPassThroughOptions, TreeSelectTemplates, TreeSelectValueTemplateContext };