UNPKG

@tangential/input-widgets

Version:

Input Widgets with persistable, dynamic configuration.

53 lines (52 loc) 2.11 kB
import { ChangeDetectorRef, EventEmitter, OnInit } from '@angular/core'; import { ControlValueAccessor } from '@angular/forms'; import * as i0 from "@angular/core"; /** * Provider Expression that allows this widget to register as a ControlValueAccessor. * This allows it to support [(ngModel)]. * @docs-private */ export declare const TANJ_CHECKBOX_WIDGET_VIEW_CONTROL_VALUE_ACCESSOR: any; export declare class CheckboxWidgetChange { source: CheckboxWidgetComponent; value: boolean; constructor(source: CheckboxWidgetComponent, value: boolean); } export declare class CheckboxWidgetComponent implements OnInit, ControlValueAccessor { private changeDetectorRef; flex: string; flexLayout: string; flexLayoutAlign: string; value: boolean; valueChange: EventEmitter<boolean>; labelPosition: 'before' | 'after' | 'below'; disabled: boolean; hideLabel: boolean; onlyLabel: boolean; /** * Configuration Fields */ label: string; defaultValue: boolean; change: EventEmitter<any>; onTouched: () => any; private controlValueAccessorChangeFn; constructor(changeDetectorRef: ChangeDetectorRef); ngOnInit(): void; handleValueChange(value: boolean): void; /** * Boilerplate / required for Angular * */ private emitChangeEvent; writeValue(value: boolean): void; registerOnChange(fn: any): void; registerOnTouched(fn: any): void; /** * Sets the input's disabled state. Implemented as a part of ControlValueAccessor. * @param isDisabled Whether the input should be disabled. */ setDisabledState(isDisabled: boolean): void; static ɵfac: i0.ɵɵFactoryDeclaration<CheckboxWidgetComponent, never>; static ɵcmp: i0.ɵɵComponentDeclaration<CheckboxWidgetComponent, "tanj-checkbox-widget", never, { "value": "value"; "labelPosition": "labelPosition"; "disabled": "disabled"; "hideLabel": "hideLabel"; "onlyLabel": "onlyLabel"; "label": "label"; "defaultValue": "defaultValue"; }, { "valueChange": "valueChange"; "change": "change"; }, never, never, false>; }