@tangential/input-widgets
Version:
Input Widgets with persistable, dynamic configuration.
54 lines (53 loc) • 2.22 kB
TypeScript
import { ChangeDetectorRef, EventEmitter, OnChanges, OnInit, SimpleChanges } 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_SLIDE_TOGGLE_WIDGET_VIEW_CONTROL_VALUE_ACCESSOR: any;
export declare class SlideToggleWidgetChange {
source: SlideToggleWidgetComponent;
value: boolean;
constructor(source: SlideToggleWidgetComponent, value: boolean);
}
export declare class SlideToggleWidgetComponent implements ControlValueAccessor, OnChanges, OnInit {
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;
ngOnChanges(changes: SimpleChanges): 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<SlideToggleWidgetComponent, never>;
static ɵcmp: i0.ɵɵComponentDeclaration<SlideToggleWidgetComponent, "tanj-slide-toggle-widget", never, { "value": "value"; "labelPosition": "labelPosition"; "disabled": "disabled"; "hideLabel": "hideLabel"; "onlyLabel": "onlyLabel"; "label": "label"; "defaultValue": "defaultValue"; }, { "valueChange": "valueChange"; "change": "change"; }, never, never, false>;
}