import { EventEmitter } from "../../stencil-public-runtime"; import { DuetLanguage, DuetMargin, DuetTextFontWeight, DuetTheme, DuetTooltipDirection } from "../../common-types"; import { ThemeableComponent } from "../../common/themeable-component"; export type DuetMultiselectItem = { label: string; value: string; disabled?: boolean; }; export type DuetMultiselectItemGroup = { label: string; items: DuetMultiselectItem[]; }; export type DuetMultiselectEvent = { originalEvent?: Event; component: "duet-multiselect"; value: DuetMultiselectItem[]; }; /** * @slot tooltip - Use to place a tooltip alongside the label. */ export declare class DuetMultiselect implements ThemeableComponent { /** * Own Properties */ private errorId; private labelId; private topCaptionId; private isCaptionVisible; private selectedLangObject; private selectAllLabel; private clearAllLabel; private placeholderLabel; /** * Reference to host HTML element. */ element: HTMLElement; private multiselectElement; /** * State() variables * Inlined decorator, alphabetical order. */ processedItems: DuetMultiselectItem[]; processedGroups: DuetMultiselectItemGroup[]; checkboxesVisible: boolean; activeDescendant: string; language: DuetLanguage; /** * Controls the margin of the component. */ margin: DuetMargin; /** * Display the select in error state along with an error message. */ error: string; /** * The aria-live attribute for the error message. When the input is validated on blur, use "off", as using "polite" or "assertive" * makes the screen reader read the error message twice. When the input is validated on submit, use "polite", as "off" would leave * the messages unread by screen readers. Use "assertive" only in those rare cases when "polite" would leave the error message * unread by screen readers. */ accessibleLiveError: "off" | "polite" | "assertive"; /** * Expands the input to fill 100% of the container width. */ expand: boolean; /** * Value of multiselect */ value: DuetMultiselectItem[]; /** * Theme of the select. */ theme: DuetTheme; /** * Visually hide the label, but still show it to screen readers. */ labelHidden: boolean; /** * Adds a unique identifier for the select. */ identifier: string; /** * If set, the multiselect will display buttons to select or deselect all items. * This should be used when there are many items, consider when the number of items is more than 5. */ allControls: boolean; /** * Hint text to display. */ placeholder: string; /** * Caption (underneath label) that can be set as a way of adding extra information */ caption: string; /** * An array of items to choose from */ items: string | DuetMultiselectItem[] | DuetMultiselectItemGroup[]; /** * Makes the select component disabled. This prevents users from being able * to interact with the select, and conveys its inactive state to assistive * technologies. */ disabled: boolean; /** * Label for the select. */ label: string; /** * Color of the label. */ labelColor: string; /** * Font weight of the label. */ labelWeight: DuetTextFontWeight; /** * Indicates the id of a component that describes the input. */ accessibleDescribedBy: string; /** * Tooltip to display next to the label of the input. */ tooltip: string; /** * With direction setting you can force the tooltip to always open towards left * or right instead of automatically determining the direction. */ tooltipDirection: DuetTooltipDirection; /** * Callback for when the value changed. */ duetChange: EventEmitter; /** * Emitted when the select has focus. */ duetFocus: EventEmitter; /** * Emitted when the select loses focus. */ duetBlur: EventEmitter; handleFocus(e: any): void; /** * Component lifecycle events. */ componentWillLoad(): void; connectedCallback(): void; disconnectedCallback(): void; /** * Component event handling. */ private onChange; private onBlur; private onFocus; private onMultiselectKeyDown; private onMultiselectInputKeyDown; private onCheckboxKeyDown; private toggleCheckboxes; private toggleCheckbox; private handleSelectAllClick; private handleClearAllClick; /** * Sets focus on the specified `duet-multiselect`. Use this method instead of the global * `multiselect.focus()`. */ setFocus(options?: FocusOptions): Promise; /** * Sets the value of the multiselect to contain the items matching the given array. Does not clear the previous value. * If multiple items share the same value that is included in the array, they all get selected. */ selectWithValues(values: string[]): Promise; /** * Local methods. */ private refresh; private getOptionIdentifier; private getDescribedBy; /** * render() function * Always the last one in the class. */ render(): any; }