@sandlada/mdc
Version:
@sandlada/mdc is an open source component library that follows the Material Design 3 design specifications.
66 lines • 2.54 kB
TypeScript
/**
* @license
* Copyright 2025 Kai-Orion & Sandlada
* SPDX-License-Identifier: MIT
*/
import { LitElement, type PropertyValues } from 'lit';
import { createValidator, getValidityAnchor } from '../../utils/behaviors/constraint-validation';
import { CheckboxValidator } from '../../utils/behaviors/validators/checkbox-validator';
import { getFormState, getFormValue } from '../../utils/form/form-associated';
import type { ISwitch } from './switch.interface';
declare global {
interface HTMLElementTagNameMap {
"mdc-switch": MDCSwitch;
}
}
declare const MDCSwitch_base: Omit<typeof LitElement, "prototype"> & (new () => LitElement & import("../../utils/behaviors/constraint-validation").ConstraintValidation & import("../../utils/form/form-associated").FormAssociated & import("../../utils/behaviors/element-internals").WithElementInternals & import("../ripple/ripple-options.mixin").IMixinRippleOptions & import("../ripple/ripple-options.mixin").IMixinRippleAttributes & import("../focus-ring/focus-ring-options.mixin").IMixinFocusRingOption);
/**
*
*
*
* @version "Material Design 3"
*
* @link
* https://m3.material.io/components/switch/overview
*/
export declare class MDCSwitch extends MDCSwitch_base implements ISwitch {
static styles: import("lit").CSSResult;
static shadowRootOptions: ShadowRootInit;
disabled: boolean;
name: string;
selected: boolean;
required: boolean;
value: string;
hideSelectedIcon: boolean;
showUnselectedIcon: boolean;
private readonly inputElement;
get focusRingControl(): HTMLElement | null;
focus(): void;
blur(): void;
constructor();
connectedCallback(): void;
protected render(): unknown;
protected renderInput(): import("lit-html").TemplateResult<1>;
private renderSelectedIcon;
private renderUnselectedIcon;
private handlePointerEnter;
private handlePointerLeave;
private handleFocusIn;
private handleFocusOut;
private handleVisualKeyDown;
private shouldShowKeyboardVisuals;
private queueKeyboardVisualSync;
private clearKeyboardVisuals;
protected updated(changedProperties: PropertyValues): void;
private handleInput;
private handleChange;
private handleClick;
[getFormValue](): string | null;
[getFormState](): string;
formResetCallback(): void;
formStateRestoreCallback(state: string): void;
[createValidator](): CheckboxValidator;
[getValidityAnchor](): HTMLInputElement;
}
export {};
//# sourceMappingURL=switch.d.ts.map