@engie-group/fluid-design-system-angular
Version:
Fluid Design System Angular
99 lines (98 loc) • 3.51 kB
TypeScript
import { AfterViewInit, ChangeDetectorRef, ElementRef, EventEmitter } from '@angular/core';
import { ControlValueAccessor } from '@angular/forms';
import { ToggleProperties, ToggleScale, ToggleVariant } from '@engie-group/fluid-types';
import * as i0 from "@angular/core";
export declare class ToggleComponent implements ToggleProperties, ControlValueAccessor, AfterViewInit {
private cdr;
private toggleClassName;
private _checked?;
/**
* Input id
*/
inputId?: string;
/**
* Input name
*/
name?: string;
/**
* Toggle scale
*
*/
scale?: ToggleScale;
/**
* Toggle color variant
*
* @default `brand`
*/
variant?: ToggleVariant;
/**
* Whether input is required or not
*/
required?: boolean;
/**
* Whether the toggle is checked or not
*/
set isChecked(value: boolean);
get isChecked(): boolean;
/**
* Whether the toggle is disabled or not
*/
disabled?: boolean;
/**
* Whether the toggle color is inherited from parent
*/
isColorInherited?: boolean;
/**
* Text alternative for assistive technologies
* @see https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-label
*
*/
ariaLabel?: string;
/**
* Text alternative for assistive technologies based on visible text
* @see https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-labelledby
*
*/
ariaLabelledby?: string;
handleIcon?: string;
/**
* Output that emits checked value on change only
*/
valueChange: EventEmitter<boolean>;
private _inputElement?;
iconWrapper?: ElementRef<HTMLElement>;
/**
* Whether toggle has an icon
*/
protected hasIcon?: boolean;
constructor(cdr: ChangeDetectorRef);
ngAfterViewInit(): void;
private _onChange;
private _onTouched;
protected _onChangeEvent(event: Event): void;
protected _onInputClick(event: Event): void;
/**
* Implemented as part of ControlValueAccessor.
* @ignore
*/
writeValue(value: any): void;
/**
* Implemented as part of ControlValueAccessor.
* @ignore
*/
registerOnChange(fn: any): void;
/**
* Implemented as part of ControlValueAccessor.
* @ignore
*/
registerOnTouched(fn: any): void;
/**
* Implemented as part of ControlValueAccessor.
* @ignore
*/
setDisabledState(isDisabled: boolean): void;
protected get classes(): string[];
static ɵfac: i0.ɵɵFactoryDeclaration<ToggleComponent, never>;
static ɵcmp: i0.ɵɵComponentDeclaration<ToggleComponent, "nj-toggle", never, { "inputId": { "alias": "inputId"; "required": false; }; "name": { "alias": "name"; "required": false; }; "scale": { "alias": "scale"; "required": false; }; "variant": { "alias": "variant"; "required": false; }; "required": { "alias": "required"; "required": false; }; "isChecked": { "alias": "isChecked"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "isColorInherited": { "alias": "isColorInherited"; "required": false; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; }; "ariaLabelledby": { "alias": "ariaLabelledby"; "required": false; }; "handleIcon": { "alias": "handleIcon"; "required": false; }; }, { "valueChange": "valueChange"; }, never, ["[njToggleIcon]", "*"], true, never>;
static ngAcceptInputType_disabled: unknown;
}