UNPKG

@tangential/input-widgets

Version:

Input Widgets with persistable, dynamic configuration.

64 lines (63 loc) 2.7 kB
import { ChangeDetectorRef, EventEmitter, OnChanges, OnInit, SimpleChange } 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_TEXT_WIDGET_CONFIG_CONTROL_VALUE_ACCESSOR: any; export declare class TextWidgetConfigureChange { source: TextWidgetConfigureComponent; value: string; constructor(source: TextWidgetConfigureComponent, value: string); } export declare class TextWidgetConfigureComponent implements OnInit, OnChanges, ControlValueAccessor { private changeDetectorRef; flex: string; flexLayout: string; flexLayoutAlign: string; value: string; valueChange: EventEmitter<string>; labelPosition: 'before' | 'after' | 'below'; disabled: boolean; /** * Configuration Fields */ label: string; defaultValue: string; maxLength: number; minLength: number; labelChange: EventEmitter<string>; defaultValueChange: EventEmitter<string>; maxLengthChange: EventEmitter<number>; minLengthChange: EventEmitter<number>; change: EventEmitter<any>; /** * Called when the spinner is blurred. Needed to properly implement ControlValueAccessor. * @docs-private */ onTouched: () => any; private controlValueAccessorChangeFn; constructor(changeDetectorRef: ChangeDetectorRef); ngOnInit(): void; ngOnChanges(changes: { config: SimpleChange; ival: SimpleChange; }): void; emitChangeEvent(value: boolean, label: boolean): void; /** * Boilerplate / required for Angular * */ writeValue(value: string): 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<TextWidgetConfigureComponent, never>; static ɵcmp: i0.ɵɵComponentDeclaration<TextWidgetConfigureComponent, "tanj-text-configure", never, { "value": "value"; "labelPosition": "labelPosition"; "disabled": "disabled"; "label": "label"; "defaultValue": "defaultValue"; "maxLength": "maxLength"; "minLength": "minLength"; }, { "valueChange": "valueChange"; "labelChange": "labelChange"; "defaultValueChange": "defaultValueChange"; "maxLengthChange": "maxLengthChange"; "minLengthChange": "minLengthChange"; "change": "change"; }, never, never, false>; }