import { EaFormAssociatedBase } from '../../core/EaFormAssociatedBase'; export type SwitchSize = "large" | "default" | "small"; /** * @summary 开关组件,表示两种相互对立的状态间的切换,多用于触发开/关,支持自定义值、尺寸和禁用状态。 * @status stable * @since 3.0 * * @slot active - 打开状态时的内容。 * @slot inactive - 关闭状态时的内容。 * * @event change - 状态发生变化时触发,detail: `{ value: unknown }`。 * * @csspart wrapper - 外层 label 容器。 * @csspart label - 表单标签。 * @csspart form-label - 表单标签(与 label 相同)。 * @csspart container - 开关内容容器。 * @csspart original - 原生 checkbox 控件。 * @csspart label-left - 左侧文字(关闭状态)。 * @csspart switch - 伪开关控件。 * @csspart label-right - 右侧文字(打开状态)。 * * @cssproperty --ea-switch-active-bg-color - 打开时的背景色。 * @cssproperty --ea-switch-inactive-bg-color - 关闭时的背景色。 * @cssproperty --ea-switch-active-text-color - 打开时的文字颜色。 * @cssproperty --ea-switch-inactive-text-color - 关闭时的文字颜色。 * @cssproperty --ea-switch-disabled-bg-color - 禁用时的背景色。 * @cssproperty --ea-switch-disabled-text-color - 禁用时的文字颜色。 * @cssproperty --ea-switch-disabled-checked-bg-color - 禁用且选中时的背景色。 * @cssproperty --ea-switch-disabled-checked-text-color - 禁用且选中时的文字颜色。 */ export declare class EaSwitch extends EaFormAssociatedBase { private _container; private _originalInput; private _labelLeftSlot; private _labelRightSlot; private _label; private _parsedActiveValue; private _parsedInactiveValue; label: string; name: string; value: any; activeValue: any; inactiveValue: any; size: SwitchSize; inactiveText: string; inactiveColor: string; activeText: string; activeColor: string; disabled: boolean; required: boolean; beforeChange: (() => Promise) | null; /** 解析属性值为实际类型 */ private _parseValue; /** 处理 value 属性变化,同步原生 input 状态和表单值 */ private _handleValueChange; updateContainerClasslist(): string; html(): string; /** 处理原生 input 的 change 事件 */ private _handleChangeEvent; /** 处理点击事件,支持 beforeChange 拦截 */ private _handleClickEvent; /** 处理键盘交互,Space/Enter 切换开关状态 */ private _handleKeydown; formResetCallback(): void; $mount(): void; /** 同步 aria-checked 状态 */ private _syncAriaChecked; $updated(): void; get validationTarget(): HTMLElement; /** 更新表单验证状态,required 时必须选中 */ updateValidity(): void; checkValidity(): boolean; reportValidity(): boolean; } //# sourceMappingURL=index.d.ts.map