import { CSSResultGroup, PropertyValues, TemplateResult } from 'lit'; import { SbbElement } from '../../core/base-elements.ts'; import { FormRestoreReason, FormRestoreState } from '../../core/mixins.ts'; export declare class SbbChipInputTokenEndEvent extends CustomEvent> { /** The element that triggered the chip creation */ origin: 'input' | 'autocomplete'; /** * The value of the new chip. Either the input or the option value depending on the origin. * Either the value from the input which is always `string` or the value from the selected option * from an autocomplete, which can be either a string or any other type. */ value: T | string; label?: string; /** * @deprecated Use event properties directly. */ get detail(): SbbChipInputTokenEndEventDetails; constructor(options: Pick); /** Set a new value for the chip that will be created */ setValue(value: T): void; /** Set a label for the chip that will be created */ setLabel(label: string): void; } /** * @deprecated Use `SbbChipInputTokenEndEvent` instead. */ export interface SbbChipInputTokenEndEventDetails { /** The element that triggered the chip creation */ origin: 'input' | 'autocomplete'; /** * The value of the new chip. Either the input or the option value depending on the origin. * Either the value from the input which is always `string` or the value from the selected option * from an autocomplete, which can be either a string or any other type. */ value: T | string; label?: string; /** Set a new value for the chip that will be created */ setValue(value: T): void; /** Set a label for the chip that will be created */ setLabel(value: string): void; } declare const SbbChipGroupElement_base: import('../../core/mixins.ts').AbstractConstructor & import('../../core/mixins.ts').AbstractConstructor & import('../../core/mixins.ts').AbstractConstructor & import('../../core/mixins.ts').AbstractConstructor & typeof SbbElement; /** * The `sbb-chip-group` component is used as a container for one or multiple `sbb-chip`. * * @slot - Use the unnamed slot to add `sbb-chip` elements. * @event {SbbChipInputTokenEndEvent} chipinputtokenend - Notifies that a chip is about to be created. Can be prevented. * @overrideType value - (T = string[]) | null */ export declare class SbbChipGroupElement extends SbbChipGroupElement_base { static readonly elementName: string; static readonly role = "listbox"; static styles: CSSResultGroup; static readonly events: { readonly input: "input"; readonly change: "change"; readonly chipinputtokenend: "chipinputtokenend"; }; /** Value of the form element. */ set value(value: (T | null)[] | null); get value(): (T | null)[]; /** Function that maps a chip's value to its display value. */ accessor displayWith: ((value: T) => string) | null; /** The array of keys that will trigger a `chipinputtokenend` event. Default `['Enter']` */ accessor separatorKeys: string[]; /** Whether to automatically add a chip when the input loses focus if there's a value. */ accessor addOnBlur: boolean; /** * Listens to the changes on `readonly` and `disabled` attributes of ``. */ private _inputAttributeObserver; private _inputElement; private _inputAbortController; private _language; private _previousSize?; constructor(); private _updateLabelState; connectedCallback(): void; protected willUpdate(changedProperties: PropertyValues): void; /** @internal */ formResetCallback(): void; /** @internal */ formStateRestoreCallback(state: FormRestoreState | null, _reason: FormRestoreReason): void; private _readFormData; protected shouldValidate(name: PropertyKey | undefined): boolean; protected validate(): void; /** Return the list of chip elements **/ private _chipElements; /** Return the list of enabled chip elements **/ private _enabledChipElements; private _setupComponent; /** * Listen for keyboard events on the chip elements **/ private _onChipKeyDown; /** * Listen for keyboard events on the input **/ private _onInputKeyDown; /** * Handle blur event on the input **/ private _onInputBlur; /** * If the input is not empty, create a chip with its value */ private _createChipFromInput; private _deleteChip; /** * Focus an enabled chip. If none are present, focus the input * @param index The index of the enabled chip. If null, focus the last one. */ private _focusChip; private _emitInputEvents; private _createChipElement; private _reactToInputChanges; private _proxyStateToChips; private _updateSize; private _updateInputDescription; protected render(): TemplateResult; } declare global { interface HTMLElementTagNameMap { 'sbb-chip-group': SbbChipGroupElement; } interface HTMLElementEventMap { chipinputtokenend: SbbChipInputTokenEndEvent; } } export {}; //# sourceMappingURL=chip-group.component.d.ts.map