@loadsmart/miranda-wc
Version:
Miranda Web Components component library
66 lines (65 loc) • 2.06 kB
TypeScript
import type { PropertyValues } from 'lit';
import { FormComponent } from '../component';
import type { FormComponentProps } from '../component';
import '../icon';
export interface CheckboxProps extends FormComponentProps {
checked?: boolean;
initialChecked?: boolean;
indeterminate?: boolean;
value?: string;
onchange?: GlobalEventHandlers['onchange'];
}
export declare class Checkbox extends FormComponent implements CheckboxProps {
#private;
static shadowRootOptions: {
delegatesFocus: boolean;
mode: ShadowRootMode;
serializable?: boolean;
slotAssignment?: SlotAssignmentMode;
};
static styles: import("lit").CSSResult[];
static get properties(): {
checked: {
type: BooleanConstructor;
reflect: boolean;
};
initialChecked: {
type: BooleanConstructor;
attribute: string;
};
indeterminate: {
type: BooleanConstructor;
reflect: boolean;
};
value: {
type: StringConstructor;
};
};
/**
* Value the checkbox should report to the form it is in.
*/
value: CheckboxProps['value'];
/**
* Should the checkbox be checked initialluy or when the form it is in is reset.
*/
initialChecked: CheckboxProps['initialChecked'];
static define(): void;
createRenderRoot(): DocumentFragment | HTMLElement;
connectedCallback(): Promise<void>;
disconnectedCallback(): void;
updated(changedProperties: PropertyValues<this>): void;
render(): import("lit-html").TemplateResult<1>;
get input(): HTMLInputElement | null;
set checked(checked: boolean);
get checked(): boolean;
set indeterminate(indeterminate: boolean);
get indeterminate(): boolean;
formResetCallback(): void;
formStateRestoreCallback(state: unknown): void;
formDisabledCallback(disabled: boolean): void;
}
declare global {
interface HTMLElementTagNameMap {
'm-checkbox': Checkbox;
}
}