import * as lit from 'lit'; import { LitElement, TemplateResult } from 'lit'; import { F as FormSubmitController } from '../form-controller-BR0gZhrG.js'; import KemetOption from './option.js'; import { a as TypeRoundedSizes, K as KemetField } from '../constants-CcB9aXsT.js'; import 'lit-html'; /** * @since 1.0.0 * @status stable * * @tagname kemet-select * @summary An enhanced select element. * * @prop {string} slug - A string the uniquely identifies the select * @prop {string} name - The name of the select * @prop {string} value - The value of the select * @prop {array} options - The options the select contains * @prop {string} status - The status of the select * @prop {boolean} required - Determines whether the field is required * @prop {boolean} disabled - Determines whether the field is disabled * @prop {boolean} multiple - Support of multiple choice selections * @prop {string} icon - The dropdown icon * @prop {number} iconSize - The dropdown icon size * @prop {boolean} filled - Displays a filled select * @prop {TypeRoundedSizes} rounded - Displays rounded corners * * @csspart select * * @cssproperty --kemet-select-padding - The padding on the textarea. * @cssproperty --kemet-select-border - The border of the textarea. * @cssproperty --kemet-select-border-color-error - The border of the error state. * @cssproperty --kemet-select-border-color-success - The border of the success state. * @cssproperty --kemet-select-border-color-warning - The border of the warning state. * @cssproperty --kemet-select-border-radius-rounded - The border radius on rounded. * @cssproperty --kemet-select-border-filled - The border on filled. * @cssproperty --kemet-select-color-filled - The color on filled. * @cssproperty --kemet-select-background-color-filled - The background-color on filled. * @cssproperty --kemet-select-background-color-error - The error state background color. * @cssproperty --kemet-select-background-color-success - The success state background color. * @cssproperty --kemet-select-background-color-warning - The warning state background color. * @cssproperty --kemet-select-icon-right - The space on the right of the icon. * * @event kemet-focus - Fires when the input receives focus * @event kemet-blur - Fires when the input loses focus * @event kemet-status-change - Fires when there's a change in status * @event kemet-change - Fires when the select input changes * */ interface IOptions { label: string; value: string; disabled: boolean; selected: boolean; } declare class KemetSelect extends LitElement { formSubmitController: FormSubmitController; static styles: lit.CSSResult[]; slug: string; name: string; value: string; options: IOptions[]; status: string; required: boolean; disabled: boolean; multiple: boolean; icon: string; iconSize: number; filled: boolean; rounded: TypeRoundedSizes; invalid: boolean; control: KemetField; select: HTMLSelectElement; selectedOption: HTMLOptionElement; optionElements: NodeListOf; hasFocus: boolean; constructor(); firstUpdated(): void; render(): TemplateResult<1>; /** * Generates the option elements * @private * @returns {TemplateResult} An option element */ makeOptions(): TemplateResult<1>[]; /** * Generates a dropdown icon * @private */ makeIcon(): TemplateResult<1>; /** * Handles when the input receives focus * @private */ handleFocus(): void; /** * Handles when the input loses focus * @private */ handleBlur(): void; /** * Handles when the input changes value * @private */ handleChange(event: Event): void; /** * Handles when the input has an error * @private */ handleInvalid(): void; /** * Checks the validity of the standard select * @public * @returns {boolean} */ checkValidity(): boolean; } declare global { interface HTMLElementTagNameMap { 'kemet-select': KemetSelect; } } export { KemetSelect as default };