@tangential/input-widgets
Version:
Input Widgets with persistable, dynamic configuration.
61 lines (60 loc) • 2.45 kB
TypeScript
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_DATE_TIME_WIDGET_VIEW_CONTROL_VALUE_ACCESSOR: any;
export declare class DateTimeWidgetChange {
source: DateTimeWidgetComponent;
value: number;
constructor(source: DateTimeWidgetComponent, value: number);
}
export declare class DateTimeWidgetComponent implements ControlValueAccessor, OnChanges, OnInit {
private changeDetectorRef;
flex: string;
flexLayout: string;
flexLayoutAlign: string;
value: number;
valueChange: EventEmitter<number>;
labelPosition: 'before' | 'after' | 'below';
disabled: boolean;
hideLabel: boolean;
onlyLabel: boolean;
/**
* Configuration Fields
*/
label: string;
defaultToNow: boolean;
defaultValue: number;
maxLength: number;
minLength: number;
change: EventEmitter<any>;
onTouched: () => any;
constructor(changeDetectorRef: ChangeDetectorRef);
private controlValueAccessorChangeFn;
ngOnInit(): void;
get dateInputValue(): string;
set dateInputValue(dateString: string);
ngOnChanges(changes: {
defaultToNow: SimpleChange;
}): void;
handleValueChange(value: number): void;
/**
* Boilerplate / required for Angular
*
*/
private emitChangeEvent;
writeValue(value: number): 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<DateTimeWidgetComponent, never>;
static ɵcmp: i0.ɵɵComponentDeclaration<DateTimeWidgetComponent, "tanj-date-time-widget", never, { "value": "value"; "labelPosition": "labelPosition"; "disabled": "disabled"; "hideLabel": "hideLabel"; "onlyLabel": "onlyLabel"; "label": "label"; "defaultToNow": "defaultToNow"; "defaultValue": "defaultValue"; "maxLength": "maxLength"; "minLength": "minLength"; }, { "valueChange": "valueChange"; "change": "change"; }, never, never, false>;
}