UNPKG

ngx-iso-form

Version:

Angular component design Reactive Form using specific JSON. The primary use of this UI library is to design ISO 20022 forms dynamically.

299 lines (272 loc) 13.3 kB
import * as i0 from '@angular/core'; import { OnChanges, ChangeDetectorRef, SimpleChanges, Type, OnInit, ViewContainerRef, ElementRef, EventEmitter, PipeTransform, ComponentRef } from '@angular/core'; import * as i18 from '@angular/forms'; import { FormBuilder, FormGroup, FormArray, FormControl, AbstractControl, ControlValueAccessor } from '@angular/forms'; import * as i22 from '@angular/material/core'; import { NativeDateAdapter } from '@angular/material/core'; import { Overlay } from '@angular/cdk/overlay'; import { TranslateService } from '@ngx-translate/core'; import * as i17 from '@angular/common'; import * as i19 from '@angular/material/expansion'; import * as i20 from '@angular/material/form-field'; import * as i21 from '@angular/material/input'; import * as i23 from '@angular/material/datepicker'; import * as i24 from '@angular/material/button'; import * as i25 from '@angular/material/select'; import * as i26 from '@angular/material/icon'; interface SchemaElement { id: string; name: string; dataType: string; minOccurs: string; maxOccurs: string; minLength: string; maxLength: string; pattern: string; fractionDigits: string; totalDigits: string; minInclusive: string; maxInclusive: string; values: string[]; isCurrency: boolean; xpath: string; elements: SchemaModel[]; expanded: boolean; isUETR: boolean; defaultValue?: string; } interface SchemaModel extends SchemaElement { uniqueId?: string; hidden?: boolean; value?: string; multi?: string; isFormControls?: boolean; children?: SchemaModel[]; choiceKey?: string; } declare class CustomDateAdapter extends NativeDateAdapter { format(date: Date, displayFormat: Object): string; private _to2digit; static ɵfac: i0.ɵɵFactoryDeclaration<CustomDateAdapter, never>; static ɵprov: i0.ɵɵInjectableDeclaration<CustomDateAdapter>; } declare class NgxIsoService { private fb; private dateService; _formModel: any[]; excludes: string[]; constructor(fb: FormBuilder, dateService: CustomDateAdapter); maxOccurs(maxOccurs: string): boolean; initFormModel(model: any, form: FormGroup | FormArray, prev_key: string, choiceKey?: boolean, index?: number): void; getFormGroupControls(json: SchemaModel[], keys: any, index?: number, choiceEle?: boolean, prev_key?: string): FormGroup; getFormControl(values: any): FormControl; sanitize: (obj: any) => any; private getFormModel; private getAmountCurrency; static ɵfac: i0.ɵɵFactoryDeclaration<NgxIsoService, never>; static ɵprov: i0.ɵɵInjectableDeclaration<NgxIsoService>; } declare class IsoForm { private _model; private _namespace; constructor(model: any, xmlMessage?: string); get isoFormModel(): any; /** * @deprecated This method is deprecated use `#isoForm.getFormModel` instead */ getFormModel: () => any; private parseXML; } declare class NgxIsoFormComponent implements OnChanges { private service; private changeDetection; form: IsoForm; schema: SchemaModel; excludes: string[]; protected _form: FormGroup; private _isFormInitiate; private _ngModel; constructor(service: NgxIsoService, changeDetection: ChangeDetectorRef); ngOnChanges(changes: SimpleChanges): void; get model(): any; protected get getFormModel(): any[]; get invalid(): boolean; private initiateForm; private structuredClone; private initiateFormModel; protected onChoiceSelectionChange(id: string, formElement: any, node: SchemaModel): void; protected maxOccurs(maxOccurs: string): boolean; protected expand(minOccurs: string): boolean; protected addSection($event: Event, node: SchemaModel, parentNode: SchemaModel, parentFormEle: FormGroup): void; protected removeSection($event: Event, parentNode: SchemaModel, parentFormEle: FormGroup, index: number): void; protected addNewControl($event: Event, node: SchemaModel, parentNode: SchemaModel, parentFormEle: FormGroup): void; protected removeNewControl($event: Event, parentNode: SchemaModel, parentFormEle: FormGroup, index: number): void; protected isArray(myKey: Object | Array<any>): boolean; protected isEmpty(formElement: FormGroup): boolean; protected getElement(formElement: FormGroup, element: any): AbstractControl<any, any> | undefined; protected getFormGroupByIndex(formArray: FormArray, _index: number): FormGroup; protected getFormControl(node: SchemaModel): FormControl; protected getChoiceFormControl(choiceKey: string): FormControl<any>; static ɵfac: i0.ɵɵFactoryDeclaration<NgxIsoFormComponent, never>; static ɵcmp: i0.ɵɵComponentDeclaration<NgxIsoFormComponent, "ngx-iso-form", never, { "form": { "alias": "form"; "required": true; }; "schema": { "alias": "schema"; "required": true; }; "excludes": { "alias": "excludes"; "required": false; }; }, {}, never, never, false, never>; } declare class ComponentModel { component: Type<any>; prop: any; constructor(component: Type<any>, prop: any); } declare class ControlService { getComponentByType(controlModel: SchemaElement, formControl: FormControl): ComponentModel; static ɵfac: i0.ɵɵFactoryDeclaration<ControlService, never>; static ɵprov: i0.ɵɵInjectableDeclaration<ControlService>; } declare class NgxIsoControlComponent implements OnInit, ControlValueAccessor { private controlService; formControl: FormControl; control: SchemaElement; component: ComponentModel; constructor(controlService: ControlService); ngOnInit(): void; writeValue(obj: any): void; registerOnChange(fn: any): void; registerOnTouched(fn: any): void; setDisabledState?(isDisabled: boolean): void; private addValidator; static ɵfac: i0.ɵɵFactoryDeclaration<NgxIsoControlComponent, never>; static ɵcmp: i0.ɵɵComponentDeclaration<NgxIsoControlComponent, "ngx-iso-control", never, { "formControl": { "alias": "formControl"; "required": false; }; "control": { "alias": "control"; "required": false; }; }, {}, never, never, false, never>; } declare class ComponentDirective { viewContainerRef: ViewContainerRef; constructor(viewContainerRef: ViewContainerRef); static ɵfac: i0.ɵɵFactoryDeclaration<ComponentDirective, never>; static ɵdir: i0.ɵɵDirectiveDeclaration<ComponentDirective, "[componentContent]", never, {}, {}, never, never, false, never>; } declare class NgxDynamicComponent implements OnInit { componentModel: ComponentModel; componentContent: ComponentDirective; constructor(); ngOnInit(): void; loadComponent(): void; static ɵfac: i0.ɵɵFactoryDeclaration<NgxDynamicComponent, never>; static ɵcmp: i0.ɵɵComponentDeclaration<NgxDynamicComponent, "ngx-dynamic", never, { "componentModel": { "alias": "componentModel"; "required": false; }; }, {}, never, never, false, never>; } interface IControlModel { id: string; name: string; dataType: string; minOccurs: string; maxOccurs: string; minLength: string; maxLength: string; pattern: string; fractionDigits: string; totalDigits: string; minInclusive: string; maxInclusive: string; values: string[]; isCurrency: boolean; xpath: string; value: string; isUETR: boolean; component: ComponentModel; defaultValue?: string; } declare class IsoBaseControlComponent implements OnInit { ngOnInit(): void; control: IControlModel; formControl: FormControl; getKeys(errors: any): string[]; static ɵfac: i0.ɵɵFactoryDeclaration<IsoBaseControlComponent, never>; static ɵcmp: i0.ɵɵComponentDeclaration<IsoBaseControlComponent, "iso-base", never, { "control": { "alias": "control"; "required": false; }; "formControl": { "alias": "formControl"; "required": false; }; }, {}, never, never, false, never>; } declare class IsoDateTime implements ControlValueAccessor { private overlay; private vcr; trigger: ElementRef; panel: any; name: string; formControl: FormControl; datetimeChange: EventEmitter<string>; date: Date | null; hour: string; minute: string; hours: string[]; minutes: string[]; private overlayRef?; private onChange; private onTouched; constructor(overlay: Overlay, vcr: ViewContainerRef); writeValue(value: string | null): void; registerOnChange(fn: any): void; registerOnTouched(fn: any): void; setDisabledState(isDisabled: boolean): void; ngOnInit(): void; open(): void; close(): void; apply(): void; static ɵfac: i0.ɵɵFactoryDeclaration<IsoDateTime, never>; static ɵcmp: i0.ɵɵComponentDeclaration<IsoDateTime, "iso-datetime", never, { "name": { "alias": "name"; "required": false; }; "formControl": { "alias": "formControl"; "required": false; }; }, { "datetimeChange": "datetimeChange"; }, never, never, false, never>; } declare class IsoMatInput extends IsoBaseControlComponent { clickEvent(event: Event): void; private generateUETR; static ɵfac: i0.ɵɵFactoryDeclaration<IsoMatInput, never>; static ɵcmp: i0.ɵɵComponentDeclaration<IsoMatInput, "iso-mat-input", never, {}, {}, never, never, false, never>; } declare class IsoMatTextarea extends IsoBaseControlComponent { static ɵfac: i0.ɵɵFactoryDeclaration<IsoMatTextarea, never>; static ɵcmp: i0.ɵɵComponentDeclaration<IsoMatTextarea, "iso-mat-textarea", never, {}, {}, never, never, false, never>; } declare class IsoMatDate extends IsoBaseControlComponent { static ɵfac: i0.ɵɵFactoryDeclaration<IsoMatDate, never>; static ɵcmp: i0.ɵɵComponentDeclaration<IsoMatDate, "iso-mat-date", never, {}, {}, never, never, false, never>; } declare class IsoMatDateTime extends IsoBaseControlComponent { static ɵfac: i0.ɵɵFactoryDeclaration<IsoMatDateTime, never>; static ɵcmp: i0.ɵɵComponentDeclaration<IsoMatDateTime, "iso-mat-datetime", never, {}, {}, never, never, false, never>; } declare class IsoMatSelect extends IsoBaseControlComponent { static ɵfac: i0.ɵɵFactoryDeclaration<IsoMatSelect, never>; static ɵcmp: i0.ɵɵComponentDeclaration<IsoMatSelect, "iso-mat-select", never, {}, {}, never, never, false, never>; } declare class IsoMatCheckbox extends IsoBaseControlComponent { static ɵfac: i0.ɵɵFactoryDeclaration<IsoMatCheckbox, never>; static ɵcmp: i0.ɵɵComponentDeclaration<IsoMatCheckbox, "iso-mat-checkbox", never, {}, {}, never, never, false, never>; } declare class IsoMatCurrency extends IsoBaseControlComponent { static ɵfac: i0.ɵɵFactoryDeclaration<IsoMatCurrency, never>; static ɵcmp: i0.ɵɵComponentDeclaration<IsoMatCurrency, "iso-mat-currency", never, {}, {}, never, never, false, never>; } declare class IsoTranslatePipe implements PipeTransform { private translateService; constructor(translateService: TranslateService); transform(value: string, id: string, defaultValue: string): string; static ɵfac: i0.ɵɵFactoryDeclaration<IsoTranslatePipe, never>; static ɵpipe: i0.ɵɵPipeDeclaration<IsoTranslatePipe, "trans", false>; } declare class IsoErrorPipe implements PipeTransform { private translateService; constructor(translateService: TranslateService); transform(value: string, id: string, errorKey: string, defaultValue: string): string; static ɵfac: i0.ɵɵFactoryDeclaration<IsoErrorPipe, never>; static ɵpipe: i0.ɵɵPipeDeclaration<IsoErrorPipe, "error", false>; } declare class IsoGeneralPipe implements PipeTransform { private translateService; constructor(translateService: TranslateService); transform(value: string, id: string, generalKey: string, defaultValue: string): string; static ɵfac: i0.ɵɵFactoryDeclaration<IsoGeneralPipe, never>; static ɵpipe: i0.ɵɵPipeDeclaration<IsoGeneralPipe, "general", false>; } declare class NgxIsoFormModule { static ɵfac: i0.ɵɵFactoryDeclaration<NgxIsoFormModule, never>; static ɵmod: i0.ɵɵNgModuleDeclaration<NgxIsoFormModule, [typeof NgxIsoFormComponent, typeof NgxIsoControlComponent, typeof NgxDynamicComponent, typeof IsoBaseControlComponent, typeof IsoDateTime, typeof IsoMatInput, typeof IsoMatTextarea, typeof IsoMatDate, typeof IsoMatDateTime, typeof IsoMatSelect, typeof IsoMatCheckbox, typeof IsoMatCurrency, typeof ComponentDirective, typeof IsoTranslatePipe, typeof IsoErrorPipe, typeof IsoGeneralPipe], [typeof i17.CommonModule, typeof i18.FormsModule, typeof i18.ReactiveFormsModule, typeof i19.MatExpansionModule, typeof i20.MatFormFieldModule, typeof i21.MatInputModule, typeof i22.MatNativeDateModule, typeof i23.MatDatepickerModule, typeof i24.MatButtonModule, typeof i25.MatSelectModule, typeof i26.MatIconModule], [typeof NgxIsoFormComponent]>; static ɵinj: i0.ɵɵInjectorDeclaration<NgxIsoFormModule>; } declare class ComponentService { getComponent<T>(viewContainerRef: ViewContainerRef, dynamicModel: ComponentModel): ComponentRef<T>; static ɵfac: i0.ɵɵFactoryDeclaration<ComponentService, never>; static ɵprov: i0.ɵɵInjectableDeclaration<ComponentService>; } export { ComponentService, ControlService, IsoForm, NgxIsoFormComponent, NgxIsoFormModule }; export type { IControlModel, SchemaElement };