@doku-dev/doku-fragment
Version:
A new Angular UI library that moving away from Bootstrap and built from scratch.
50 lines (49 loc) • 1.79 kB
TypeScript
import { NgClass } from '@angular/common';
import { EventEmitter } from '@angular/core';
import { ControlValueAccessor, NgControl } from '@angular/forms';
import * as i0 from "@angular/core";
export declare class DokuToggle implements ControlValueAccessor {
private ngControl;
/**
* Unique id of the toggle.
* Default value is auto-generated.
*
* @default 'd-toggle-[nextId]'
*/
id: string;
/**
* Whether the toggle is checked.
*
* If using reactive forms or template-driven forms, the value will be replaced.
*
* @default false
*/
checked: boolean;
/**
* Whether the toggle is disabled.
*
* If using reactive forms, the value will be replaced.
* Use form control's method to disable the toggle.
*
* @default false;
*/
disabled: boolean;
/**
* Vertical alignment of the toggle.
*
* @default 'center'
*/
verticalAlignment: 'top' | 'center' | 'bottom';
checkedChange: EventEmitter<boolean>;
constructor(ngControl: NgControl);
protected get classes(): NgClass['ngClass'];
onChange?: (_: any) => void;
onTouched?: () => void;
writeValue(value: boolean): void;
registerOnTouched(fn: () => void): void;
registerOnChange(fn: (_: any) => unknown): void;
setDisabledState(isDisabled: boolean): void;
protected onToggleChange(ev: Event): void;
static ɵfac: i0.ɵɵFactoryDeclaration<DokuToggle, [{ optional: true; self: true; }]>;
static ɵcmp: i0.ɵɵComponentDeclaration<DokuToggle, "doku-toggle", ["dokuToggle"], { "id": "id"; "checked": "checked"; "disabled": "disabled"; "verticalAlignment": "verticalAlignment"; }, { "checkedChange": "checkedChange"; }, never, ["*", "doku-toggle-description"], true>;
}