UNPKG

@covalent/dynamic-forms

Version:

Teradata UI Platform Dynamic Forms Module

103 lines (102 loc) 4.98 kB
import { OnInit, SimpleChanges, OnChanges, TemplateRef, ChangeDetectorRef, Type, Injector } from '@angular/core'; import { ViewContainerRef } from '@angular/core'; import { AbstractControl } from '@angular/forms'; import { CdkPortal } from '@angular/cdk/portal'; import { IControlValueAccessor } from '@covalent/core/common'; import { TdDynamicElement, TdDynamicType, TdDynamicFormsService, ITdDynamicElementCustomConfig } from './services/dynamic-forms.service'; import * as i0 from "@angular/core"; export declare class TdDynamicElementBase { _changeDetectorRef: ChangeDetectorRef; constructor(_changeDetectorRef: ChangeDetectorRef); } export declare const _TdDynamicElementMixinBase: (new (...args: any[]) => IControlValueAccessor) & typeof TdDynamicElementBase; export declare class TdDynamicFormsErrorTemplateDirective extends CdkPortal { templateRef: TemplateRef<any>; tdDynamicFormsError?: string; constructor(templateRef: TemplateRef<any>, viewContainerRef: ViewContainerRef); static ɵfac: i0.ɵɵFactoryDeclaration<TdDynamicFormsErrorTemplateDirective, never>; static ɵdir: i0.ɵɵDirectiveDeclaration<TdDynamicFormsErrorTemplateDirective, "[tdDynamicFormsError]ng-template", never, { "tdDynamicFormsError": { "alias": "tdDynamicFormsError"; "required": false; }; }, {}, never, never, true, never>; } export declare class TdDynamicElementDirective { viewContainer: ViewContainerRef; constructor(viewContainer: ViewContainerRef); static ɵfac: i0.ɵɵFactoryDeclaration<TdDynamicElementDirective, never>; static ɵdir: i0.ɵɵDirectiveDeclaration<TdDynamicElementDirective, "[tdDynamicContainer]", never, {}, {}, never, never, true, never>; } export declare class TdDynamicElementComponent extends _TdDynamicElementMixinBase implements IControlValueAccessor, OnInit, OnChanges { private _injector; private _dynamicFormsService; private _instance; /** * Sets form control of the element. */ dynamicControl: AbstractControl; /** * Sets label to be displayed. */ label: string; /** * Sets hint to be displayed. */ hint?: string | undefined; /** * Sets name to be displayed as attribute. */ name: string; /** * Sets type or element of element to be rendered. * Throws error if does not exist or no supported. */ type?: TdDynamicElement | TdDynamicType | Type<any>; /** * Sets required validation checkup (if supported by element). */ required?: boolean | string | undefined; /** * Sets min validation checkup (if supported by element). */ min?: number; /** * Sets max validation checkup (if supported by element). */ max?: number; /** * Sets minLength validation checkup (if supported by element). */ minLength?: number; /** * Sets maxLength validation checkup (if supported by element). */ maxLength?: number; /** * Sets selections for array elements (if supported by element). */ selections?: any[]; /** * Sets multiple property for array elements (if supported by element). */ multiple?: boolean; /** * Sets any additional properties on custom component. */ customConfig?: ITdDynamicElementCustomConfig; /** * Sets error message template so it can be injected into dynamic components. */ errorMessageTemplate: TemplateRef<any> | undefined; /** * Sets the placeholder message */ placeholder?: string | undefined; childElement: TdDynamicElementDirective; get maxAttr(): any; get minAttr(): any; constructor(_injector: Injector, _dynamicFormsService: TdDynamicFormsService, _changeDetectorRef: ChangeDetectorRef); ngOnInit(): void; /** * Reassign any inputs that have changed */ ngOnChanges(changes: SimpleChanges): void; static ɵfac: i0.ɵɵFactoryDeclaration<TdDynamicElementComponent, never>; static ɵcmp: i0.ɵɵComponentDeclaration<TdDynamicElementComponent, "td-dynamic-element", never, { "dynamicControl": { "alias": "dynamicControl"; "required": false; }; "label": { "alias": "label"; "required": false; }; "hint": { "alias": "hint"; "required": false; }; "name": { "alias": "name"; "required": false; }; "type": { "alias": "type"; "required": false; }; "required": { "alias": "required"; "required": false; }; "min": { "alias": "min"; "required": false; }; "max": { "alias": "max"; "required": false; }; "minLength": { "alias": "minLength"; "required": false; }; "maxLength": { "alias": "maxLength"; "required": false; }; "selections": { "alias": "selections"; "required": false; }; "multiple": { "alias": "multiple"; "required": false; }; "customConfig": { "alias": "customConfig"; "required": false; }; "errorMessageTemplate": { "alias": "errorMessageTemplate"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; }, {}, never, never, true, never>; }