@linid-dm/directory-manager-client-core
Version:
Core package by providing a set of angular components for the Directory Manager app.
133 lines (132 loc) • 6.61 kB
TypeScript
import { HttpErrorResponse } from '@angular/common/http';
import { AfterViewInit, EventEmitter, OnDestroy, OnInit, QueryList, TemplateRef } from '@angular/core';
import { FormGroup } from '@angular/forms';
import { MatAutocompleteSelectedEvent, MatAutocompleteTrigger } from '@angular/material/autocomplete';
import { MatChipGrid, MatChipInputEvent } from '@angular/material/chips';
import { Router } from '@angular/router';
import { Store } from '@ngxs/store';
import { FileInputComponent } from 'ngx-material-file-input';
import { BehaviorSubject, Observable } from 'rxjs';
import { DataService, EComponentName, EnvService, ErrorsHandlerService, FormService, IAutocompleteOption, IFormAccessibility, IFormData, IFormFieldControl, ILabelValues, IScimProperties, InteractionsService } from '../../shared';
import * as i0 from "@angular/core";
export declare class GenericFormComponent implements OnInit, OnDestroy, AfterViewInit {
private _document;
private _store$;
private _dataService;
private _interactionsService;
private _errorsHandlerService;
private _envService;
private _router;
private _formService;
formAccessibility$: Observable<IFormAccessibility>;
private _onDestroy$;
private _userId;
private _userDisplayName;
private _formDataMap;
private _requiredUndisplayedFields;
private _selectedEntryExternalId;
private _enableCheckoutForm;
userId$: Observable<string>;
autocompleteOff: boolean;
isDisplayingDefaultFormBtns: boolean;
crudAction: string;
endpoint: string;
entryId: string;
formData: IFormData[];
scimProperties: IScimProperties;
authorizeDisableOnRequest: boolean;
isInModal: boolean;
set enableCheckoutForm(isEnable: boolean);
get enableCheckoutForm(): boolean;
clickOnCancelBtn: EventEmitter<boolean>;
clickOnSubmitBtn: EventEmitter<boolean>;
addSucceeded: EventEmitter<any>;
addFailed: EventEmitter<Error | HttpErrorResponse>;
updateSucceeded: EventEmitter<any>;
updateFailed: EventEmitter<void>;
submitForm: EventEmitter<void>;
chipLists: QueryList<MatChipGrid>;
formFieldsList: TemplateRef<any>;
buttonsActions: TemplateRef<any>;
templateFormFields: IFormData[];
formPreviousState: {
[key: string]: IFormFieldControl;
};
separatorKeysCodes: number[];
processingRequest$: Observable<boolean>;
checkoutForm: FormGroup;
formInitialState: {
[key: string]: IFormFieldControl;
};
nbFormFields: number;
limit: {
[modelRef: string]: number;
};
offset: {
[modelRef: string]: number;
};
options: {
[modelRef: string]: BehaviorSubject<IAutocompleteOption[]>;
};
options$: {
[modelRef: string]: Observable<IAutocompleteOption[]>;
};
autoCompleteOptions: {
[modelRef: string]: IAutocompleteOption[];
};
filteredOptions: {
[modelRef: string]: IAutocompleteOption[];
};
autocompleteOptionsLoaded: {
[modelRef: string]: boolean;
};
imageBase64: {
[modelRef: string]: string;
};
imgAspectRatio: {
[modelRef: string]: number;
};
datepickerPlaceholder: string;
formErrors: {
[modelRef: string]: string;
};
componentNameType: typeof EComponentName;
areAutocompletesPanelsOpened: {
[modelRef: string]: boolean;
};
customFormContentTemplate: TemplateRef<any>;
constructor(_document: Document, _store$: Store, _dataService: DataService, _interactionsService: InteractionsService, _errorsHandlerService: ErrorsHandlerService, _envService: EnvService, _router: Router, _formService: FormService<any, any>);
/**
* ngOnInit generate FormControl for every attribute in the form
*/
ngOnInit(): void;
ngOnDestroy(): void;
ngAfterViewInit(): void;
private initCheckoutForm;
private onAutocompleteInputValueChange;
private getCurrentEditedField;
private setDisableSubmitBtn;
onBlur(event: any, trigger: MatAutocompleteTrigger): void;
onDatepickerInputValueChange(event: any, modelRef: string): void;
add(event: MatChipInputEvent, modelRef: string): void;
remove(value: IAutocompleteOption, modelRef: string): void;
selected(modelRef: string, input: HTMLInputElement, event: MatAutocompleteSelectedEvent): void;
onCloseAutocompletePanel(modelRef: string, value: string, componentType: string): void;
onClickFocusAutocompleteInput(modelRef: string, value: string, autocompleteTrigger: MatAutocompleteTrigger): void;
onSubmit(newData: any): void;
closeSubmitFormDialog(): void;
getLabel(labels: ILabelValues): string;
getNextBatch(modelRef: string, inputValue: string | IAutocompleteOption): void;
initAutocompleteProperties(allAutocompleteFields: IFormData[]): void;
setAutocompleteOptions(autocompleteField: IFormData, dataResources: any[], resourceTypeId: string): void;
updateFormPreviousState(changes: any, editedField: IFormData): void;
resetOffset(modelRef: string): void;
displayOption(option: IAutocompleteOption): string;
convertImgToBase64(event: any, modelRef: string, label: any): any;
setImgAspectRatio(imgDataValue: any, modelRef: string): void;
getFxFlex(componentName: string, screenSize?: string): string;
removeImg(modelRef: string, inputFile: FileInputComponent, event: MouseEvent, label: any): void;
getAutocomplete(data: IFormData): string;
static ɵfac: i0.ɵɵFactoryDeclaration<GenericFormComponent, never>;
static ɵcmp: i0.ɵɵComponentDeclaration<GenericFormComponent, "dm-generic-form", never, { "autocompleteOff": { "alias": "autocompleteOff"; "required": false; }; "isDisplayingDefaultFormBtns": { "alias": "isDisplayingDefaultFormBtns"; "required": false; }; "crudAction": { "alias": "crudAction"; "required": false; }; "endpoint": { "alias": "endpoint"; "required": false; }; "entryId": { "alias": "entryId"; "required": false; }; "formData": { "alias": "formData"; "required": false; }; "scimProperties": { "alias": "scimProperties"; "required": false; }; "authorizeDisableOnRequest": { "alias": "authorizeDisableOnRequest"; "required": false; }; "isInModal": { "alias": "isInModal"; "required": false; }; "enableCheckoutForm": { "alias": "enableCheckoutForm"; "required": false; }; }, { "clickOnCancelBtn": "clickOnCancelBtn"; "clickOnSubmitBtn": "clickOnSubmitBtn"; "addSucceeded": "addSucceeded"; "addFailed": "addFailed"; "updateSucceeded": "updateSucceeded"; "updateFailed": "updateFailed"; "submitForm": "submitForm"; }, never, never, false, never>;
}