import * as i0 from '@angular/core'; import { TemplateRef, Signal, InputSignal, ModelSignal, OutputEmitterRef, WritableSignal, OnInit } from '@angular/core'; import { ControlValueAccessor, NgControl } from '@angular/forms'; import { FormFieldControl, ErrorStateMatcher, FormFieldAppearance } from 'ngx-com/components/form-field'; import { VariantProps } from 'class-variance-authority'; import { CdkVirtualScrollViewport } from '@angular/cdk/scrolling'; /** * Context provided to the custom option template. * @template T The type of the option value. */ interface ComDropdownOptionContext { /** The option value (available as implicit $implicit). */ $implicit: T; /** The index of this option in the filtered list. */ index: number; /** Whether this option is currently selected. */ selected: boolean; /** Whether this option is currently active (focused via keyboard). */ active: boolean; /** Whether this option is disabled. */ disabled: boolean; } /** * Context provided to the custom selected value template. * @template T The type of the option value. */ interface ComDropdownSelectedContext { /** The selected value(s) (available as implicit $implicit). */ $implicit: T | T[] | null; /** The placeholder text when no value is selected. */ placeholder: string; /** Whether multiple selection is enabled. */ multiple: boolean; } /** * Context provided to the custom empty state template. */ interface ComDropdownEmptyContext { /** The current search query (available as implicit $implicit). */ $implicit: string; } /** * Context provided to the custom group header template. */ interface ComDropdownGroupContext { /** The group key/label (available as implicit $implicit). */ $implicit: string; /** Whether the group is expanded. */ expanded: boolean; /** The number of options in this group. */ count: number; } /** * Context provided to the custom tag template (multi-select mode). * @template T The type of the option value. */ interface ComDropdownTagContext { /** The tag value (available as implicit $implicit). */ $implicit: T; /** The index of this tag. */ index: number; /** Function to remove this tag. */ remove: () => void; } /** * Represents a grouped collection of options. * @template T The type of the option value. */ interface ComDropdownGroup$1 { /** The group key/label. */ key: string; /** The options belonging to this group. */ options: T[]; /** Whether the group is expanded (for collapsible groups). */ expanded: boolean; } /** * Internal representation of a processed option. * @template T The type of the option value. */ interface ComDropdownProcessedOption { /** The original option value. */ value: T; /** The display text for this option. */ displayText: string; /** Whether this option is disabled. */ disabled: boolean; /** The group this option belongs to (if grouped). */ group?: string; /** Unique identifier for tracking. */ id: string; } /** * Configuration for dropdown positioning. */ interface ComDropdownPosition { /** The origin X position. */ originX: 'start' | 'center' | 'end'; /** The origin Y position. */ originY: 'top' | 'center' | 'bottom'; /** The overlay X position. */ overlayX: 'start' | 'center' | 'end'; /** The overlay Y position. */ overlayY: 'top' | 'center' | 'bottom'; /** Offset along the X axis. */ offsetX?: number; /** Offset along the Y axis. */ offsetY?: number; } /** * Panel width configuration. */ type ComDropdownPanelWidth = 'trigger' | 'auto' | string; /** * Default compare function for primitive values. * @param a First value. * @param b Second value. * @returns Whether the values are equal. */ declare function defaultCompareWith(a: T, b: T): boolean; /** * Default display function for converting values to strings. * @param value The value to display. * @returns The string representation. */ declare function defaultDisplayWith(value: T): string; /** * Default filter function for search. * @param option The option to test. * @param query The search query. * @param displayWith The display function to get the searchable text. * @returns Whether the option matches the query. */ declare function defaultFilterWith(option: T, query: string, displayWith: (value: T) => string): boolean; /** * Generates a unique ID for dropdown options. * @param prefix Optional prefix for the ID. * @returns A unique ID string. */ declare function generateDropdownId(prefix?: string): string; /** * Directive to mark a template as the custom option template. * * @tokens none * * @example * ```html * * *
* {{ user.name }} * @if (selected) { * * } *
*
*
* ``` */ declare class ComDropdownOptionTpl { /** Reference to the template. */ readonly templateRef: TemplateRef>; /** * Static type guard for template type checking. * Enables type-safe access to context properties in templates. */ static ngTemplateContextGuard(_dir: ComDropdownOptionTpl, ctx: unknown): ctx is ComDropdownOptionContext; static ɵfac: i0.ɵɵFactoryDeclaration, never>; static ɵdir: i0.ɵɵDirectiveDeclaration, "ng-template[comDropdownOption]", never, {}, {}, never, never, true, never>; } /** * Directive to mark a template as the custom selected value template. * * @tokens none * * @example * ```html * * * @if (user) { *
* * {{ user.name }} *
* } @else { * Select user... * } *
*
* ``` */ declare class ComDropdownSelectedTpl { /** Reference to the template. */ readonly templateRef: TemplateRef>; /** * Static type guard for template type checking. * Enables type-safe access to context properties in templates. */ static ngTemplateContextGuard(_dir: ComDropdownSelectedTpl, ctx: unknown): ctx is ComDropdownSelectedContext; static ɵfac: i0.ɵɵFactoryDeclaration, never>; static ɵdir: i0.ɵɵDirectiveDeclaration, "ng-template[comDropdownSelected]", never, {}, {}, never, never, true, never>; } /** * Directive to mark a template as the custom empty state template. * * @tokens none * * @example * ```html * * *
* * No results for "{{ query }}" *
*
*
* ``` */ declare class ComDropdownEmptyTpl { /** Reference to the template. */ readonly templateRef: TemplateRef; /** * Static type guard for template type checking. * Enables type-safe access to context properties in templates. */ static ngTemplateContextGuard(_dir: ComDropdownEmptyTpl, ctx: unknown): ctx is ComDropdownEmptyContext; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; } /** * Directive to mark a template as the custom group header template. * * @tokens none * * @example * ```html * * *
* {{ group }} * ({{ count }}) *
*
*
* ``` */ declare class ComDropdownGroupTpl { /** Reference to the template. */ readonly templateRef: TemplateRef; /** * Static type guard for template type checking. * Enables type-safe access to context properties in templates. */ static ngTemplateContextGuard(_dir: ComDropdownGroupTpl, ctx: unknown): ctx is ComDropdownGroupContext; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; } /** * Directive to mark a template as the custom tag template (multi-select mode). * * @tokens none * * @example * ```html * * *
* * {{ user.name }} * *
*
*
* ``` */ declare class ComDropdownTagTpl { /** Reference to the template. */ readonly templateRef: TemplateRef>; /** * Static type guard for template type checking. * Enables type-safe access to context properties in templates. */ static ngTemplateContextGuard(_dir: ComDropdownTagTpl, ctx: unknown): ctx is ComDropdownTagContext; static ɵfac: i0.ɵɵFactoryDeclaration, never>; static ɵdir: i0.ɵɵDirectiveDeclaration, "ng-template[comDropdownTag]", never, {}, {}, never, never, true, never>; } /** * Directive to mark a template as the custom loading indicator template. * * @tokens none * * @example * ```html * * *
* * Fetching more results... *
*
*
* ``` */ declare class ComDropdownLoadingTpl { /** Reference to the template. */ readonly templateRef: TemplateRef; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; } /** * Variant type for dropdown trigger appearance. */ type DropdownVariant = 'default' | 'outline' | 'ghost' | 'filled' | 'naked'; /** * Size type for dropdown components. */ type DropdownSize = 'sm' | 'default' | 'lg'; /** * State type for validation states. */ type DropdownState = 'default' | 'error' | 'success'; /** * Option state for styling. */ type OptionState = 'default' | 'active' | 'selected' | 'selected-active' | 'disabled'; /** * Tag variant type. */ type TagVariant = 'default' | 'primary'; /** * CVA variants for the dropdown trigger button. * Uses semantic theme tokens for consistent cross-theme styling. * * @tokens `--color-input-background`, `--color-input-foreground`, `--color-input-border`, * `--color-input-placeholder`, `--color-ring`, `--color-muted`, `--color-muted-hover`, * `--color-warn`, `--color-success`, `--color-primary`, `--color-border`, `--radius-input` */ declare const dropdownTriggerVariants: (props?: { variant?: DropdownVariant; size?: DropdownSize; state?: DropdownState; open?: boolean; }) => string; type DropdownTriggerVariants = VariantProps; /** * CVA variants for the dropdown panel (overlay). * * @tokens `--color-popover`, `--color-popover-foreground`, `--color-border-subtle`, `--shadow-overlay`, `--radius-overlay` */ declare const dropdownPanelVariants: (props?: { size?: DropdownSize; }) => string; type DropdownPanelVariants = VariantProps; /** * CVA variants for individual dropdown options. * * @tokens `--color-popover-foreground`, `--color-muted`, `--color-primary-subtle`, * `--color-primary-subtle-foreground`, `--color-disabled-foreground` */ declare const dropdownOptionVariants: (props?: { size?: DropdownSize; state?: OptionState; }) => string; type DropdownOptionVariants = VariantProps; /** * CVA variants for the search input. * * @tokens `--color-border-subtle`, `--color-input-placeholder`, `--color-disabled-foreground` */ declare const dropdownSearchVariants: (props?: { size?: DropdownSize; }) => string; type DropdownSearchVariants = VariantProps; /** * CVA variants for multi-select tags. * * @tokens `--color-muted`, `--color-muted-foreground`, `--color-muted-hover`, * `--color-primary-subtle`, `--color-primary-subtle-foreground`, `--radius-tag` */ declare const dropdownTagVariants: (props?: { size?: DropdownSize; variant?: TagVariant; }) => string; type DropdownTagVariants = VariantProps; /** * CVA variants for the tag remove button. * * @tokens `--color-ring`, `--radius-interactive-sm`, `--color-muted-foreground`, `--color-foreground` */ declare const dropdownTagRemoveVariants: (props?: { size?: DropdownSize; }) => string; type DropdownTagRemoveVariants = VariantProps; /** * CVA variants for the overflow badge (+N indicator). * * @tokens `--color-muted`, `--color-muted-foreground`, `--radius-tag` */ declare const dropdownOverflowBadgeVariants: (props?: { size?: DropdownSize; }) => string; type DropdownOverflowBadgeVariants = VariantProps; /** * CVA variants for group headers. * * @tokens `--color-muted-foreground` */ declare const dropdownGroupVariants: (props?: { size?: DropdownSize; }) => string; type DropdownGroupVariants = VariantProps; /** * CVA variants for the empty state. * * @tokens `--color-muted-foreground` */ declare const dropdownEmptyVariants: (props?: { size?: DropdownSize; }) => string; type DropdownEmptyVariants = VariantProps; /** * CVA variants for the clear button. * * @tokens `--color-ring`, `--radius-interactive-sm`, `--color-muted-foreground`, `--color-foreground` */ declare const dropdownClearVariants: (props?: { size?: DropdownSize; }) => string; type DropdownClearVariants = VariantProps; /** * CVA variants for the chevron icon. * * @tokens `--color-muted-foreground` */ declare const dropdownChevronVariants: (props?: { size?: DropdownSize; open?: boolean; disabled?: boolean; }) => string; type DropdownChevronVariants = VariantProps; /** * CVA variants for the loading indicator container. * * @tokens `--color-muted-foreground` */ declare const dropdownLoadingVariants: (props?: { size?: DropdownSize; }) => string; type DropdownLoadingVariants = VariantProps; /** * Reusable dropdown/select component with full accessibility support. * Implements ControlValueAccessor for Reactive Forms integration. * * @tokens `--color-input-background`, `--color-input-foreground`, `--color-input-border`, * `--color-input-placeholder`, `--color-ring`, `--color-muted`, `--color-muted-foreground`, * `--color-popover`, `--color-popover-foreground`, `--color-border-subtle`, * `--color-primary`, `--color-primary-subtle`, `--color-primary-subtle-foreground`, * `--color-warn`, `--color-success`, `--color-disabled`, `--color-disabled-foreground`, * `--color-placeholder` * * @example * ```html * * * {{ user.name }} * * * ``` */ declare class ComDropdown implements ControlValueAccessor, FormFieldControl { private readonly elementRef; private readonly destroyRef; private readonly injector; private readonly overlay; private readonly viewContainerRef; private readonly liveAnnouncer; private readonly defaultErrorStateMatcher; private readonly parentForm; private readonly parentFormGroup; /** NgControl bound to this dropdown (if using reactive forms). */ readonly ngControl: NgControl | null; /** Reference to the trigger button element. */ private readonly triggerRef; /** Reference to the panel template. */ private readonly panelTemplateRef; /** Reference to the virtual scroll viewport (when enabled). */ private readonly virtualViewport; /** Content query for custom option template. */ protected readonly optionTemplate: Signal | undefined>; /** Content query for custom selected template. */ protected readonly selectedTemplate: Signal | undefined>; /** Content query for custom empty template. */ protected readonly emptyTemplate: Signal; /** Content query for custom group template. */ protected readonly groupTemplate: Signal; /** Content query for custom tag template. */ protected readonly tagTemplate: Signal | undefined>; /** Content query for custom loading template. */ protected readonly loadingTemplate: Signal; /** Overlay reference. */ private overlayRef; /** Unique ID for the dropdown. */ private readonly dropdownId; /** Array of options to display. */ readonly options: InputSignal; /** Current value (single or array for multiple). */ readonly value: ModelSignal; /** Placeholder text when no value is selected. */ readonly placeholder: InputSignal; /** Enable multi-select mode. */ readonly multiple: InputSignal; /** Enable search/filter input. */ readonly searchable: InputSignal; /** Search input placeholder. */ readonly searchPlaceholder: InputSignal; /** Disable the dropdown. */ readonly disabled: ModelSignal; /** Mark as required. */ readonly required: InputSignal; /** Show clear button. */ readonly clearable: InputSignal; /** Custom equality function for comparing values. */ readonly compareWith: InputSignal<(a: T, b: T) => boolean>; /** Function to get display text from a value. */ readonly displayWith: InputSignal<(value: T) => string>; /** Custom filter function for search. */ readonly filterWith: InputSignal<((option: T, query: string) => boolean) | null>; /** Function to group options by a key. */ readonly groupBy: InputSignal<((option: T) => string) | null>; /** CVA variant for trigger styling. */ readonly variant: InputSignal; /** Size variant. */ readonly size: InputSignal; /** Validation state. */ readonly state: InputSignal; /** Additional CSS classes for the trigger. */ readonly userClass: InputSignal; /** Additional CSS classes for the panel. */ readonly panelClass: InputSignal; /** Maximum height of the panel. */ readonly maxHeight: InputSignal; /** Panel width strategy. */ readonly panelWidth: InputSignal; /** Debounce time for search (ms). */ readonly searchDebounceMs: InputSignal; /** Virtual scroll threshold. */ readonly virtualScrollThreshold: InputSignal; /** Item size in pixels for virtual scrolling. When not set, auto-calculated from the size variant. */ readonly virtualScrollItemSize: InputSignal; /** Effective item size for virtual scroll, computed from size variant when not explicitly set. */ protected readonly effectiveItemSize: Signal; /** Maximum number of tags to display in multi-select mode. Set to null for no limit. */ readonly maxVisibleTags: InputSignal; /** Custom error state matcher for determining when to show errors. */ readonly errorStateMatcher: InputSignal; /** Whether the dropdown is currently loading data. */ readonly loading: InputSignal; readonly touched: ModelSignal; readonly invalid: InputSignal; readonly sfErrors: InputSignal; /** Emitted when search query changes. */ readonly searchChange: OutputEmitterRef; /** Emitted when panel opens. */ readonly opened: OutputEmitterRef; /** Emitted when panel closes. */ readonly closed: OutputEmitterRef; /** Emitted when user scrolls near the bottom of the option list. */ readonly loadMore: OutputEmitterRef; /** Whether the panel is open. */ readonly isOpen: WritableSignal; /** Whether the trigger button is focused. */ private readonly _triggerFocused; /** Current search query. */ readonly searchQuery: WritableSignal; /** Currently active (keyboard focused) option ID. */ readonly activeOptionId: WritableSignal; /** Internal value state (managed by CVA or input). */ readonly internalValue: WritableSignal; /** Live announcements for screen readers. */ readonly liveAnnouncement: WritableSignal; /** Flag to prevent duplicate loadMore emissions per scroll-to-bottom. */ private loadMoreEmitted; /** Subscription for virtual scroll elementScrolled. */ private scrollSubscription; /** Throttled handler for standard scroll events. */ private throttledScrollHandler; /** Cleanup functions for ancestor scroll listeners. */ private ancestorScrollCleanups; /** IDs for aria-describedby (set by form-field). */ private readonly _describedByIds; /** Form field appearance (set by form-field). */ private readonly _appearance; /** Trigger element ID. */ readonly triggerId: Signal; /** Panel element ID. */ readonly panelId: Signal; /** Currently active descendant ID (for ARIA). */ readonly activeDescendant: Signal; /** Whether the dropdown has a value. */ readonly hasValue: Signal; /** Whether the dropdown is focused (trigger focused or panel open). Implements FormFieldControl. */ readonly focused: Signal; /** Whether the label should float. Label floats when focused or has a value. */ readonly shouldLabelFloat: Signal; /** Whether the control is in an error state. Implements FormFieldControl. */ readonly errorState: Signal; /** Structured validation errors from Signal Forms, exposed for the parent form field. */ readonly errors: Signal; /** Unique ID for the control. Implements FormFieldControl. */ readonly id: Signal; /** * Effective state combining manual state with automatic error detection. * Manual state takes precedence over auto-detected error state. */ readonly effectiveState: Signal; /** Combined aria-describedby from form-field. */ readonly ariaDescribedBy: Signal; /** Selected value (single mode). */ readonly selectedValue: Signal; /** Selected values (multiple mode). */ readonly selectedValues: Signal; /** Tags visible in the trigger (limited by maxVisibleTags). */ readonly visibleTags: Signal; /** Count of hidden tags (for +N badge). */ readonly hiddenTagsCount: Signal; /** Processed options with display text and IDs. */ readonly processedOptions: Signal[]>; /** Filtered options based on search query. */ readonly filteredOptions: Signal[]>; /** Grouped options (when groupBy is provided). */ readonly groupedOptions: Signal>[]>; /** Whether virtual scrolling should be enabled. */ readonly virtualScrollEnabled: Signal; /** Context for selected template. */ readonly selectedContext: Signal>; /** Context for empty template. */ readonly emptyContext: Signal; /** Computed trigger classes. */ readonly triggerClasses: Signal; /** Computed panel classes. */ readonly panelClasses: Signal; /** Computed chevron classes. */ readonly chevronClasses: Signal; /** Computed clear button classes. */ readonly clearClasses: Signal; /** Computed overflow badge classes. */ readonly overflowBadgeClasses: Signal; /** Computed loading container classes. */ readonly loadingContainerClasses: Signal; private onChange; private onTouched; constructor(); writeValue(value: T | T[] | null): void; registerOnChange(fn: (value: T | T[] | null) => void): void; registerOnTouched(fn: () => void): void; setDisabledState(isDisabled: boolean): void; /** * Called when the form field container is clicked. * Implements FormFieldControl. */ onContainerClick(event: MouseEvent): void; /** * Sets the describedBy IDs from the form field. * Called by the parent form field component. */ setDescribedByIds(ids: string): void; /** * Sets the appearance for styling. * Called by the parent form field component. */ setAppearance(appearance: FormFieldAppearance): void; /** Opens the dropdown panel. */ open(): void; /** Closes the dropdown panel. */ close(): void; /** Toggles the dropdown panel. */ toggle(): void; /** Clears the selection. */ clear(event?: Event): void; /** Checks if a value is selected. */ isSelected(value: T): boolean; /** Checks if an option ID is the active one. */ isActive(optionId: string): boolean; protected onTriggerKeydown(event: KeyboardEvent): void; protected onPanelKeydown(event: KeyboardEvent): void; protected onSearchChange(query: string): void; protected onSearchKeyNav(event: KeyboardEvent): void; protected onTriggerFocus(): void; protected onTriggerBlur(): void; protected onOptionHover(optionId: string): void; protected selectOption(value: T): void; protected removeValue(value: T): void; protected trackByValue(item: T, _index: number): unknown; /** Track function for virtual scroll options. */ protected trackByOption(_index: number, option: ComDropdownProcessedOption): string; protected getGlobalIndex(groupKey: string, localIndex: number): number; private createOverlay; /** Re-positions the overlay after the trigger height changes (e.g. tags added/removed). */ private repositionOverlay; private destroyOverlay; /** * Returns overlay width configuration based on panelWidth setting. * - 'trigger': min-width equals host, can grow wider * - 'auto': no width constraint * - specific value: exact width */ private getPanelWidthConfig; private updateValue; private toggleMultipleValue; private navigateOptions; private navigateToFirst; private navigateToLast; /** Scrolls the active option into view, using virtual viewport or native scroll. */ private scrollActiveOptionIntoView; private selectActiveOption; private flattenGroupedOptions; private typeAhead; private announce; /** * Listens for scroll events on ancestor elements of the trigger. * Closes the dropdown when the page scrolls, since CDK's reposition strategy * only detects window scroll and registered cdkScrollable elements — not * arbitrary scrollable containers (common in SPAs). * SSR-safe: only called from user interaction handlers. */ private setupAncestorScrollListeners; /** Removes ancestor scroll listeners. */ private cleanupAncestorScrollListeners; /** Sets up scroll detection for the loadMore output. SSR-safe: only called from user interaction. */ private setupScrollDetection; /** Cleans up scroll detection listeners. */ private cleanupScrollDetection; static ɵfac: i0.ɵɵFactoryDeclaration, never>; static ɵcmp: i0.ɵɵComponentDeclaration, "com-dropdown", ["comDropdown"], { "options": { "alias": "options"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "multiple": { "alias": "multiple"; "required": false; "isSignal": true; }; "searchable": { "alias": "searchable"; "required": false; "isSignal": true; }; "searchPlaceholder": { "alias": "searchPlaceholder"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "required": { "alias": "required"; "required": false; "isSignal": true; }; "clearable": { "alias": "clearable"; "required": false; "isSignal": true; }; "compareWith": { "alias": "compareWith"; "required": false; "isSignal": true; }; "displayWith": { "alias": "displayWith"; "required": false; "isSignal": true; }; "filterWith": { "alias": "filterWith"; "required": false; "isSignal": true; }; "groupBy": { "alias": "groupBy"; "required": false; "isSignal": true; }; "variant": { "alias": "variant"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "state": { "alias": "state"; "required": false; "isSignal": true; }; "userClass": { "alias": "class"; "required": false; "isSignal": true; }; "panelClass": { "alias": "panelClass"; "required": false; "isSignal": true; }; "maxHeight": { "alias": "maxHeight"; "required": false; "isSignal": true; }; "panelWidth": { "alias": "panelWidth"; "required": false; "isSignal": true; }; "searchDebounceMs": { "alias": "searchDebounceMs"; "required": false; "isSignal": true; }; "virtualScrollThreshold": { "alias": "virtualScrollThreshold"; "required": false; "isSignal": true; }; "virtualScrollItemSize": { "alias": "virtualScrollItemSize"; "required": false; "isSignal": true; }; "maxVisibleTags": { "alias": "maxVisibleTags"; "required": false; "isSignal": true; }; "errorStateMatcher": { "alias": "errorStateMatcher"; "required": false; "isSignal": true; }; "loading": { "alias": "loading"; "required": false; "isSignal": true; }; "touched": { "alias": "touched"; "required": false; "isSignal": true; }; "invalid": { "alias": "invalid"; "required": false; "isSignal": true; }; "sfErrors": { "alias": "errors"; "required": false; "isSignal": true; }; }, { "value": "valueChange"; "disabled": "disabledChange"; "touched": "touchedChange"; "searchChange": "searchChange"; "opened": "opened"; "closed": "closed"; "loadMore": "loadMore"; }, ["optionTemplate", "selectedTemplate", "emptyTemplate", "groupTemplate", "tagTemplate", "loadingTemplate"], never, true, never>; } /** * A single option in the dropdown list. * Implements CDK's Highlightable interface for keyboard navigation. * * @example * ```html * * ``` * * @tokens `--color-popover-foreground`, `--color-muted`, `--color-primary-subtle`, * `--color-primary-subtle-foreground`, `--color-disabled-foreground` */ declare class ComDropdownOption { /** Reference to the option element for focus management. */ private readonly optionRef; /** The value this option represents. */ readonly value: InputSignal; /** Display text for this option (when no template is provided). */ readonly displayText: InputSignal; /** Unique identifier for this option. */ readonly id: InputSignal; /** Index of this option in the list. */ readonly index: InputSignal; /** Whether this option is currently selected. */ readonly selected: InputSignal; /** Whether this option is currently active (keyboard focused). */ readonly active: InputSignal; /** Whether this option is disabled. */ readonly disabled: InputSignal; /** Size variant for styling. */ readonly size: InputSignal; /** Custom template for rendering the option content. */ readonly optionTemplate: InputSignal> | null>; /** Additional CSS classes to apply. */ readonly userClass: InputSignal; /** Emitted when the option is selected. */ readonly select: OutputEmitterRef; /** Emitted when the mouse enters the option. */ readonly hover: OutputEmitterRef; /** Computed option state for CVA styling. */ protected readonly optionState: Signal<'default' | 'active' | 'selected' | 'selected-active' | 'disabled'>; /** Computed CSS classes for the option. */ protected readonly optionClasses: Signal; /** Template context for custom option templates. */ protected readonly templateContext: Signal>; protected onOptionClick(event: Event): void; protected onMouseEnter(): void; /** Scrolls this option into view. */ scrollIntoView(): void; /** Focuses this option element. */ focus(): void; static ɵfac: i0.ɵɵFactoryDeclaration, never>; static ɵcmp: i0.ɵɵComponentDeclaration, "com-dropdown-option", ["comDropdownOption"], { "value": { "alias": "value"; "required": true; "isSignal": true; }; "displayText": { "alias": "displayText"; "required": false; "isSignal": true; }; "id": { "alias": "id"; "required": true; "isSignal": true; }; "index": { "alias": "index"; "required": false; "isSignal": true; }; "selected": { "alias": "selected"; "required": false; "isSignal": true; }; "active": { "alias": "active"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "optionTemplate": { "alias": "optionTemplate"; "required": false; "isSignal": true; }; "userClass": { "alias": "class"; "required": false; "isSignal": true; }; }, { "select": "select"; "hover": "hover"; }, never, never, true, never>; } /** * The overlay panel containing the dropdown options. * Supports virtual scrolling for large lists. * * @example * ```html * * * * ``` * * @tokens `--color-popover`, `--color-popover-foreground`, `--color-border-subtle`, * `--color-muted-foreground`, `--radius-overlay` */ declare class ComDropdownPanel { /** Reference to the panel element. */ private readonly panelRef; /** Reference to the virtual scroll viewport (when enabled). */ readonly viewport: Signal; /** Unique identifier for the panel. */ readonly panelId: InputSignal; /** The processed options to display. */ readonly options: InputSignal[]>; /** Maximum height of the panel. */ readonly maxHeight: InputSignal; /** Whether multiple selection is enabled. */ readonly multiselectable: InputSignal; /** Size variant for styling. */ readonly size: InputSignal; /** Additional CSS classes to apply to the panel. */ readonly panelClass: InputSignal; /** Whether virtual scrolling is enabled. */ readonly virtualScrollEnabled: InputSignal; /** Item size for virtual scrolling (in pixels). */ readonly itemSize: InputSignal; /** The current search query (for empty state context). */ readonly searchQuery: InputSignal; /** Custom empty state text. */ readonly emptyText: InputSignal; /** Template for rendering each option. */ readonly optionTemplate: InputSignal; index: number; }>>; /** Custom template for the empty state. */ readonly emptyTemplate: InputSignal | null>; /** Emitted when the panel is scrolled. */ readonly scrolled: OutputEmitterRef; /** Whether to show the empty state. */ protected readonly showEmpty: Signal; /** Computed CSS classes for the panel. */ protected readonly panelClasses: Signal; /** Computed CSS classes for the empty state. */ protected readonly emptyClasses: Signal; /** Template context for the empty state. */ protected readonly emptyContext: Signal; /** Track function for options. */ protected trackByFn(_index: number, option: ComDropdownProcessedOption): string; /** Scrolls to a specific index. */ scrollToIndex(index: number): void; /** Scrolls an option into view. */ scrollOptionIntoView(optionElement: HTMLElement): void; static ɵfac: i0.ɵɵFactoryDeclaration, never>; static ɵcmp: i0.ɵɵComponentDeclaration, "com-dropdown-panel", ["comDropdownPanel"], { "panelId": { "alias": "panelId"; "required": false; "isSignal": true; }; "options": { "alias": "options"; "required": false; "isSignal": true; }; "maxHeight": { "alias": "maxHeight"; "required": false; "isSignal": true; }; "multiselectable": { "alias": "multiselectable"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "panelClass": { "alias": "panelClass"; "required": false; "isSignal": true; }; "virtualScrollEnabled": { "alias": "virtualScrollEnabled"; "required": false; "isSignal": true; }; "itemSize": { "alias": "itemSize"; "required": false; "isSignal": true; }; "searchQuery": { "alias": "searchQuery"; "required": false; "isSignal": true; }; "emptyText": { "alias": "emptyText"; "required": false; "isSignal": true; }; "optionTemplate": { "alias": "optionTemplate"; "required": true; "isSignal": true; }; "emptyTemplate": { "alias": "emptyTemplate"; "required": false; "isSignal": true; }; }, { "scrolled": "scrolled"; }, never, ["[comDropdownSearch]"], true, never>; } /** * Search input component for filtering dropdown options. * Includes debouncing for better performance. * * @example * ```html * * ``` * * @tokens `--color-border-subtle`, `--color-input-placeholder`, `--color-disabled-foreground`, * `--color-ring`, `--radius-interactive-sm` */ declare class ComDropdownSearch implements OnInit { private readonly destroyRef; /** Reference to the input element. */ private readonly inputRef; /** Subject for debounced search. */ private readonly searchSubject; /** Current internal search value. */ protected readonly internalValue: WritableSignal; /** Placeholder text for the search input. */ readonly placeholder: InputSignal; /** Aria label for accessibility. */ readonly ariaLabel: InputSignal; /** Whether the search input is disabled. */ readonly disabled: InputSignal; /** Debounce time in milliseconds. */ readonly debounceMs: InputSignal; /** Size variant for styling. */ readonly size: InputSignal; /** Additional CSS classes to apply. */ readonly userClass: InputSignal; /** Emitted when the search value changes (after debounce). */ readonly searchChange: OutputEmitterRef; /** Emitted when a navigation key is pressed (for focus management). */ readonly keyNav: OutputEmitterRef; /** Whether to show the clear button. */ protected readonly showClear: Signal; /** Computed CSS classes for the search input. */ protected readonly searchClasses: Signal; ngOnInit(): void; protected onInput(event: Event): void; protected onKeydown(event: KeyboardEvent): void; protected clearSearch(): void; /** Focuses the search input. */ focus(): void; /** Gets the current search value. */ getValue(): string; /** Sets the search value programmatically. */ setValue(value: string): void; /** Clears the search input. */ clear(): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } /** * Tag component for displaying selected items in multi-select mode. * Includes a remove button for deselection. * * @example * ```html * * ``` * * @tokens `--color-muted`, `--color-muted-foreground`, `--color-muted-hover`, * `--color-primary-subtle`, `--color-primary-subtle-foreground`, * `--color-ring`, `--radius-tag`, `--radius-interactive-sm` */ declare class ComDropdownTag { /** The value this tag represents. */ readonly value: InputSignal; /** Display text for this tag. */ readonly displayText: InputSignal; /** Index of this tag in the list. */ readonly index: InputSignal; /** Whether the tag (and its remove button) is disabled. */ readonly disabled: InputSignal; /** Size variant for styling. */ readonly size: InputSignal; /** Tag variant for styling. */ readonly variant: InputSignal<'default' | 'primary'>; /** Additional CSS classes for the tag. */ readonly userClass: InputSignal; /** Custom template for rendering the tag. */ readonly tagTemplate: InputSignal> | null>; /** Emitted when the remove button is clicked. */ readonly remove: OutputEmitterRef; /** Computed CSS classes for the tag. */ protected readonly tagClasses: Signal; /** Computed CSS classes for the remove button. */ protected readonly removeClasses: Signal; /** Template context for custom tag templates. */ protected readonly templateContext: Signal>; protected onRemove(event: Event): void; private emitRemove; static ɵfac: i0.ɵɵFactoryDeclaration, never>; static ɵcmp: i0.ɵɵComponentDeclaration, "com-dropdown-tag", ["comDropdownTag"], { "value": { "alias": "value"; "required": true; "isSignal": true; }; "displayText": { "alias": "displayText"; "required": false; "isSignal": true; }; "index": { "alias": "index"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "variant": { "alias": "variant"; "required": false; "isSignal": true; }; "userClass": { "alias": "class"; "required": false; "isSignal": true; }; "tagTemplate": { "alias": "tagTemplate"; "required": false; "isSignal": true; }; }, { "remove": "remove"; }, never, never, true, never>; } /** * Group header component for categorized dropdown options. * * @example * ```html * * ``` * * @tokens `--color-muted-foreground` */ declare class ComDropdownGroup { /** The group label/key. */ readonly label: InputSignal; /** The number of options in this group. */ readonly count: InputSignal; /** Whether the group is expanded (for collapsible groups). */ readonly expanded: InputSignal; /** Whether to show the count badge. */ readonly showCount: InputSignal; /** Size variant for styling. */ readonly size: InputSignal; /** Additional CSS classes for the group header. */ readonly userClass: InputSignal; /** Custom template for rendering the group header. */ readonly groupTemplate: InputSignal | null>; /** Computed CSS classes for the group header. */ protected readonly groupClasses: Signal; /** Template context for custom group templates. */ protected readonly templateContext: Signal; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } export { ComDropdown, ComDropdownEmptyTpl, ComDropdownGroup, ComDropdownGroupTpl, ComDropdownLoadingTpl, ComDropdownOption, ComDropdownOptionTpl, ComDropdownPanel, ComDropdownSearch, ComDropdownSelectedTpl, ComDropdownTag, ComDropdownTagTpl, defaultCompareWith, defaultDisplayWith, defaultFilterWith, dropdownChevronVariants, dropdownClearVariants, dropdownEmptyVariants, dropdownGroupVariants, dropdownLoadingVariants, dropdownOptionVariants, dropdownOverflowBadgeVariants, dropdownPanelVariants, dropdownSearchVariants, dropdownTagRemoveVariants, dropdownTagVariants, dropdownTriggerVariants, generateDropdownId }; export type { ComDropdownEmptyContext, ComDropdownGroupContext, ComDropdownGroup$1 as ComDropdownGroupData, ComDropdownOptionContext, ComDropdownPanelWidth, ComDropdownPosition, ComDropdownProcessedOption, ComDropdownSelectedContext, ComDropdownTagContext, DropdownChevronVariants, DropdownClearVariants, DropdownEmptyVariants, DropdownGroupVariants, DropdownLoadingVariants, DropdownOptionVariants, DropdownOverflowBadgeVariants, DropdownPanelVariants, DropdownSearchVariants, DropdownSize, DropdownState, DropdownTagRemoveVariants, DropdownTagVariants, DropdownTriggerVariants, DropdownVariant };