import { FormBase } from '@internal/components/formBase.js'; import type { FormFieldBaseProps } from '@internal/types/formField.js'; import { type CSSResultGroup } from 'lit'; import '../../internal/components/hint/hint'; import type { SelectOptionEvent, SkfSelectOption } from '../select-option/select-option.component.js'; import '../tag/tag'; import { DeveloperFeedbackController, GlobalClickController, KeyboardNavigationController, ResizeController, ScrollController } from './select.controllers.js'; /** * TODO: abstract the popover logic to a separate component/helper/partial, and use it in both select and in input[datalist], combobox etc * * TODO: Fix the popover positioning, it should be relative to the button, not the window (low priority since we have solution and is it possible at all on something in #toplayer) */ /** * The `` is a component that displays a list of actions or options. A click in the options list toggle the selected state of the option. Use it together with the ´skf-select-option` tag. * * @documentation See [InVision DSM](https://skf.invisionapp.com/dsm/ab-skf/4-web-applications/nav/5fa7caf78c01200018354495/asset/6229d63d9fe16020a60657e5) for design principles * * @attribute {Boolean} [disabled] - If true, the select is disabled `default: false` * * @slot - The select's placeholder content * @slot icon - The select's slot for custom meta information * * @event change - Fired when the selected option(s) changes * @event invalid - Fired when the select is invalid * @event reset - Fired when the form is reset * @event skf-select:dropdown - {detail: {expanded: boolean}} Fired when the select dropdown is toggled * @event skf-select-option:select - {detail: {value: string | null, option: SkfSelectOption}} Fired when the select dropdown is toggled * * @tagname skf-select */ export declare class SkfSelect extends FormBase { static styles: CSSResultGroup; /** @internal */ selectDelay: number; /** @internal */ _optionsList: SkfSelectOption[]; /** Sets the first visible text on the component */ buttonLabel: string; /** If defined, forces component to invalid state until removed */ customInvalid?: string; /** If true, hides the label visually */ hideLabel?: boolean; /** If true and mulltiple is true, no tags are displayed under the select */ hideTags?: boolean; /** If defined, sets the hint text under the select component in the form */ hint?: string; /** A readonly property that returns the selected value(s) in a array */ get getSelectedValues(): string[]; /** A readonly property that returns the selected slot(s) text content in a array */ get getSelectedOptionsText(): (string | null)[]; /** Sets the visible label of the select in the form */ label: string; /** If defined, limits the number of selectable options */ max?: number; /** If defined, sets the minimum number of required options */ min?: number; /** If provided, allows for multiple options to be selected */ multiple?: boolean; /** If provided, set name of the component */ name?: string; /** If defined, renders an alternative A11y text for the asterisk */ requiredLabel?: string; /** If defined, displays provided severity state */ severity?: FormFieldBaseProps['severity']; /** If provided, displays valid state after interaction */ showValid?: boolean; /** Size of the Select */ size: 'sm' | 'md'; /** Read only, returns the selected value. (if multiple: in a comma separated string) */ get value(): string; /** @internal */ /** Stores the selected SkfSelectOption tag(s) in a array. Is the source of truth for the internal state. */ private _selectedOptions; /** @internal */ /** The selected options in an array. Treat it as a read only property. See selectedValues, slectedSlots for computed value arrays. */ set selectedOptions(option: SkfSelectOption[]); /** @internal */ get selectedOptions(): SkfSelectOption[]; /** @internal */ _expanded: boolean; /** @internal */ /** True if the internal state is invalid */ private _invalid; /** @internal */ private $selectBtn?; /** @internal */ private $selectedValue?; /** @internal */ private $dropdown?; /** @internal */ protected scrollController: ScrollController; /** @internal */ protected resizeController: ResizeController; /** @internal */ protected globalClickController: GlobalClickController; /** @internal */ protected keyboardNavController: KeyboardNavigationController; /** @internal */ protected developerFeedbackController: DeveloperFeedbackController; constructor(); willUpdate(changedProperties: Map): void; firstUpdated(): void; updated(changedProperties: Map): void; attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void; disconnectedCallback(): void; /** @internal */ _handleOptionSelected: EventListener; /** @internal */ _updateState(event: CustomEvent): void; /** @internal */ _handleReset: () => void; /** @internal */ onUpdateComplete(): Promise; /** @internal */ /** Filter out elements other than skf-select-option and store in this._optionsList */ _collectSlotOptionTags(): void; /** @internal */ _updateWidth: () => void; /** @internal */ /** this runs only from the 'updated' lifecycle, by setting source-of-truth _expanded=false */ private _managePopover; /** @internal */ _handleDropdownToggle: (e: Event) => void; /** @internal * Sets the value of the select component based on the selected options. * Also closes the dropdown if not multiple. */ _setValue: () => Promise; /** @internal */ _resetSelectedOptions: (target?: SkfSelectOption) => void; /** @internal */ _handleSlotChange: () => void; /** @internal */ _computeVisibleValue: () => string; /** @internal */ private _validateInput; render(): import("lit").TemplateResult<1>; }