UNPKG

igniteui-angular

Version:

Ignite UI for Angular is a dependency-free Angular toolkit for building modern web apps

87 lines (86 loc) 2.48 kB
import { AfterViewInit } from '@angular/core'; import { ControlValueAccessor } from '@angular/forms'; import { EditorProvider } from '../core/edit-provider'; import { CheckboxBaseDirective } from '../checkbox/checkbox-base.directive'; import * as i0 from "@angular/core"; /** * * The Switch component is a binary choice selection component. * * @igxModule IgxSwitchModule * * @igxTheme igx-switch-theme, igx-tooltip-theme * * @igxKeywords switch, states, tooltip * * @igxGroup Data Entry & Display * @remarks * * The Ignite UI Switch lets the user toggle between on/off or true/false states. * * @example * ```html * <igx-switch [checked]="true"> * Simple switch * </igx-switch> * ``` */ export declare class IgxSwitchComponent extends CheckboxBaseDirective implements ControlValueAccessor, EditorProvider, AfterViewInit { /** * Returns the class of the switch component. * * @example * ```typescript * let switchClass = this.switch.cssClass; * ``` */ cssClass: string; /** * Sets/gets whether the switch is on or off. * Default value is 'false'. * * @example * ```html * <igx-switch [checked]="true"></igx-switch> * ``` */ set checked(value: boolean); get checked(): boolean; /** * Sets/gets the `disabled` attribute. * Default value is `false`. * * @example * ```html * <igx-switch disabled><igx-switch> * ``` */ disabled: boolean; /** * Sets/gets whether the switch component is invalid. * Default value is `false`. * * @example * ```html * <igx-switch invalid></igx-switch> * ``` * ```typescript * let isInvalid = this.switch.invalid; * ``` */ invalid: boolean; /** * Sets/gets whether the switch component is on focus. * Default value is `false`. * * @example * ```typescript * this.switch.focused = true; * ``` */ focused: boolean; static ɵfac: i0.ɵɵFactoryDeclaration<IgxSwitchComponent, never>; static ɵcmp: i0.ɵɵComponentDeclaration<IgxSwitchComponent, "igx-switch", never, { "checked": { "alias": "checked"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "invalid": { "alias": "invalid"; "required": false; }; }, {}, never, ["*"], true, never>; static ngAcceptInputType_disabled: unknown; static ngAcceptInputType_invalid: unknown; }