import { LitElement } from 'lit'; import '../InputText/InputText'; import '../Icon/Icon'; import '../Chip/Chip'; import '../Tooltip/Tooltip'; import '../Checkbox/Checkbox'; export type DropdownPrimitiveValue = string | number | boolean; export interface DropdownOption { label: string; value: V; description?: string; disabled?: boolean; } /** * DropdownInput component for the CTT Design System */ declare global { interface HTMLElementTagNameMap { 'ctt-dropdown-input': CttDropdownInput; } } declare const CttDropdownInput_base: (new (...args: any[]) => import("../../utils/form-associated-mixin").FormAssociatedBase) & typeof LitElement; export declare class CttDropdownInput = DropdownOption> extends CttDropdownInput_base { static styles: import("lit").CSSResult; /** * The label text for the dropdown field */ label: string; /** * The name attribute for form integration */ name: string; /** * Supporting hint text to display below the input */ hint: string; /** * Placeholder text */ placeholder: string; /** * Array of options to display */ options: T[]; /** * The current selected value(s) */ get value(): V | V[] | null; set value(newValue: V | V[] | null); private _value; private _getCheckboxSize; /** * Whether multiple selections are allowed */ multiple: boolean; /** * Whether to show checkboxes for options in multiple select mode */ checkbox: boolean; /** * Maximum number of visible tags before collapsing into +N */ maxVisibleTags: number; private _visibleCount; private _isFocused; /** * Whether the dropdown is disabled */ disabled: boolean; /** * Whether the dropdown is required */ required: boolean; /** * Size variant */ size: 'small' | 'medium' | 'large'; /** * Whether to show descriptions for options that have them */ hasDescription: boolean; /** * Property name to use for the option label (for custom option objects) */ labelKey?: keyof T; /** * Property name to use for the option value (for custom option objects) */ valueKey?: keyof T; /** * Property name to use for the option description (for custom option objects) */ descriptionKey?: keyof T; /** * Property name to use for the option disabled state (for custom option objects) */ disabledKey?: keyof T; /** * Controls the overflow rendering behavior. * - 'escape' (default): appends the portal to `document.body` with `position: fixed`. * - 'clip': appends the portal inside the nearest scrolling/overflow ancestor, or `portalContainer`, using `position: absolute`. */ overflowStrategy: 'escape' | 'clip'; /** * Explicit container element to append the portal to in 'clip' mode. * Overrides auto-detection of the scroll ancestor. */ portalContainer?: HTMLElement; /** * Whether the dropdown supports search functionality */ searchable: boolean; /** * Internal state for dropdown open/closed */ private _isOpen; /** * Flag to prevent outside click during option selection */ private _isOptionClicking; /** * Current search term for filtering options */ private _searchTerm; /** * Unique ID for the dropdown */ private _dropdownId; /** * Whether to use portal for rendering (when inside overflow container) */ private _usePortal; /** * Portal reference for dropdown when inside overflow container */ private _portalRef; /** * Cached reference to the portal DOM element (avoids document.getElementById) */ private _portalElement; private _portalController; constructor(); private get labelId(); private _handleResize; connectedCallback(): void; firstUpdated(_changedProperties?: Map): void; disconnectedCallback(): void; private _getOptionLabel; private _getOptionValue; private _getOptionDescription; private _getOptionDisabled; /** * Filter options based on search term */ private _getFilteredOptions; /** * Get the value for the hidden input (for form submission) */ private _getHiddenInputValue; protected _isValid(): boolean; protected _getValidationMessage(): string; protected _getNativeInput(): HTMLInputElement | undefined; protected _updateValidationState(): void; reportValidity(focus?: boolean): boolean; private _hasValue; private _getDisplayText; private _isOptionSelected; private _getPortalTarget; private _closeDropdown; /** * Setup portal dropdown when inside overflow container */ private _setupPortalDropdown; /** * Update portal content with current dropdown items */ private _updatePortalContent; private _resolvePortalAlignElement; /** * Create a portal option element */ private _createPortalOptionElement; updated(changedProperties: Map): void; private _calculateOverflow; private _handleChipRemove; private _handleClearAll; private _focusSearchInput; private _handleSearchFocus; private _handleSearchBlur; private _handleSearchKeydown; private _handleTriggerClick; private _handleTriggerKeydown; private _handleSearchInput; private _handleOptionClick; private _handleOptionKeydown; private _handleOutsideClick; render(): import("lit-html").TemplateResult; } export {};