UNPKG

@ctodev/cclibrary-typings

Version:

Library typings for use with CLARC INFINITY

341 lines (340 loc) 17.6 kB
import { AfterViewInit, ElementRef, EventEmitter, QueryList, TemplateRef } from '@angular/core'; import { AbstractControl, UntypedFormBuilder, UntypedFormGroup } from '@angular/forms'; import { MatPaginator } from '@angular/material/paginator'; import { TccInputMask as _TccInputMask } from '../../models/inputMask.model'; import { TccTranslation, TccKeyValuePair } from '../../../odata/models/shared.model'; import { TccChooseInputElementComponent } from './tcc-choose-input-element/tcc-choose-input-element.component'; import { PageEvent } from '@angular/material/paginator'; import { MatTabChangeEvent } from '@angular/material/tabs'; import { TccODataService } from '../../../odata'; import { TccClarcDatePipe } from '../../pipes/tcc-clarc-date/tcc-clarc-date.pipe'; import { displayElement } from './tcc-abstract-display-element'; import { TccInputElementComponent } from './tcc-display-elements/tcc-input-element/tcc-input-element.component'; import { TccSelectElementComponent } from './tcc-display-elements/tcc-select-element/tcc-select-element.component'; import { TccAutocompleteInputElementComponent } from './tcc-display-elements/tcc-autocomplete-input-element/tcc-autocomplete-input-element.component'; import { TccBooleanElementComponent } from './tcc-display-elements/tcc-boolean-element/tcc-boolean-element.component'; import { TccButtonElementComponent } from './tcc-display-elements/tcc-button-element/tcc-button-element.component'; import { TccRadioButtonElementComponent } from './tcc-display-elements/tcc-radio-button-element/tcc-radio-button-element.component'; import { TccSearchListDialogElementComponent } from './tcc-display-elements/tcc-search-list-dialog-element/tcc-search-list-dialog-element.component'; import { TccCreateListDialogElementComponent } from './tcc-display-elements/tcc-create-list-dialog-element/tcc-create-list-dialog-element.component'; import { TccCreateSimpleListDialogElementComponent } from './tcc-display-elements/tcc-create-simple-list-dialog-element/tcc-create-simple-list-dialog-element.component'; import { Observable } from 'rxjs'; import { TccTagInputDisplayElementComponent } from './tcc-display-elements/tcc-tag-input-display-element/tcc-tag-input-display-element.component'; import { TccExpansionPanelIconControllerDirective } from '../../directives/tcc-expansion-panel-icon-controller/tcc-expansion-panel-icon-controller.directive'; import { TccBankersRoundingPipe } from '../../pipes/tcc-bankers-rounding/tcc-bankers-rounding.pipe'; import { rowButtonPipeOptions } from './pipes/get-row-buttons.pipe'; import { TccSearchListDialogServiceNamespace } from '../../services/tcc-search-list-dialog/tcc-search-list-dialog.service'; import { InputMaskHTMLElement } from './directives/input-mask-htmlelement'; export declare class TccInputMaskComponent implements AfterViewInit { private fb; private datePipe; private bankersRoundingPipe; private dataCyInputElements; private dataCyAutocompleteElements; private dataCyTagInputElements; private dataCySelectElements; private dataCyBooleanElements; private dataCyRadioButtonElements; private dataCyTranslationElements; private dataCyDatepickerElements; private dataCySearchListElements; private dataCySearchListDialogElements; private dataCyCreateListDialogElements; private dataCyCreateSimpleListDialogElements; private dataCyButtonElements; tccChooseInputElements: QueryList<TccChooseInputElementComponent>; chipContainer: QueryList<ElementRef<HTMLDivElement>>; paginators: QueryList<MatPaginator>; expPanelDir: QueryList<TccExpansionPanelIconControllerDirective>; htmlElementsList: QueryList<InputMaskHTMLElement>; set inputElements(elements: _TccInputMask.SectionElements); set entity(entity: Object); permissionLevel: number; set options(options: _TccInputMask.options); inputsLoaded: EventEmitter<string[]>; submit: EventEmitter<void>; changeTab: EventEmitter<{ id: string; value: MatTabChangeEvent; }>; changeChip: EventEmitter<{ id: string; index: number; }>; changePage: EventEmitter<{ id: string; value: PageEvent; }>; search: EventEmitter<_TccInputMask.eventOutput<_TccInputMask.ValueUnion>>; searchEnter: EventEmitter<_TccInputMask.eventOutput<_TccInputMask.ValueUnion>>; valueChange: EventEmitter<_TccInputMask.eventOutput<_TccInputMask.ValueUnion>>; valueChangeExtended: EventEmitter<_TccInputMask.eventOutput<_TccInputMask.ValueUnion>>; focusEvent: EventEmitter<_TccInputMask.eventTrigger>; blurEvent: EventEmitter<_TccInputMask.eventTrigger>; inputButtonClick: EventEmitter<_TccInputMask.eventTrigger>; rowButtonClick: EventEmitter<_TccInputMask.eventTrigger>; buttonClick: EventEmitter<_TccInputMask.eventTrigger>; selectOpen: EventEmitter<_TccInputMask.eventTrigger>; searchListChange: EventEmitter<{ id: string; value: Array<string>; }>; searchListChangePage: EventEmitter<{ id: string; pagenumber: number; searchactive: boolean; }>; searchListSearch: EventEmitter<{ id: string; searchstring: string; selection?: string; }>; searchListDialogClose: EventEmitter<_TccInputMask.searchListDialogEvent>; createListDialogClose: EventEmitter<_TccInputMask.createListDialogEvent>; createSimpleListDialogClose: EventEmitter<_TccInputMask.eventOutput<_TccInputMask.ValueUnion>>; fieldMouseEnter: EventEmitter<_TccInputMask.eventTrigger>; fieldMouseLeave: EventEmitter<_TccInputMask.eventTrigger>; openAccordion: EventEmitter<string>; entityValuesSet: EventEmitter<void>; _form: UntypedFormGroup; _inputElements: _TccInputMask.SectionElements; _inputMaskId: string; private elements; private rows; private elementKeys; private structureElements; _densityClass: string; _markLastFocused: boolean; _sidePadding: _TccInputMask.sidePaddingOptions; _rowWidth: number; private initLoadInputs; lastFocusedElement: _TccInputMask.eventTrigger; _entity: Object; _options: _TccInputMask.options; rowButtonFound: boolean; sectionType: typeof _TccInputMask.sectionType; toggleComplexRows: { [complexSectionId: string]: boolean; }; htmlElementTemplates: Array<TemplateRef<any>>; private htmlElements; private confidences; _inputmaskelementtypes: typeof _TccInputMask.elementtype; private _refreshObservable; get changed(): boolean; set changed(changed: boolean); get refreshObservable(): Observable<void>; constructor(fb: UntypedFormBuilder, datePipe: TccClarcDatePipe, bankersRoundingPipe: TccBankersRoundingPipe); ngAfterViewInit(): void; refresh(elements: _TccInputMask.SectionElements): Observable<void>; initHTMLElements(): void; private setInputMaskId; private generateCombinedComplexChildrenControl; private getCombinedComplexChildrenValidatorErrorMessage; private buildControl; private setNewControls; private addSectionInformation; private addSectionInformationForSectionContent; private addSectionInformationForDisplayElement; private addSectionInformationForRow; private getValidatorArray; private buildGroupValidator; private setDisplayElementTypeForCypress; private getElementFromSectionContent; private getTranslation; onSubmit(): void; _onChangeChip(chipContainer: HTMLDivElement, id: string, i: number): void; _onChangeTab(event: MatTabChangeEvent, id: string): void; _onChangePage(event: PageEvent, id: string): void; _onSearch(event: { value: string; selected: string; }, id: string): void; _specialElementSearch(event: _TccInputMask.eventOutput): void; _specialElementSearchEnter(event: _TccInputMask.eventOutput): void; _onSelectOpen(event: _TccInputMask.eventTrigger): void; _changeEvent(event: _TccInputMask.eventOutput): void; _changeEventExtended(event: _TccInputMask.eventOutput): void; _focusEvent(event: _TccInputMask.eventTrigger): void; _blurEvent(event: _TccInputMask.eventTrigger): void; _fieldMouseEnter(event: _TccInputMask.eventTrigger): void; _fieldMouseLeave(event: _TccInputMask.eventTrigger): void; _openAccordion(id: string): void; _inputButtonClickEvent(event: _TccInputMask.eventTrigger): void; _searchListChangePageEvent(event: { id: string; pagenumber: number; searchactive: boolean; }): void; _searchListChangeEvent(event: { id: string; value: Array<string>; }, GroupingElementId: string): void; _searchListSearchEvent(event: { id: string; searchstring: string; selection?: string; }): void; _onButtonClick(event: _TccInputMask.eventTrigger): void; _searchListDialogClose(event: _TccInputMask.searchListDialogEvent): void; _createListDialogClose(event: _TccInputMask.createListDialogEvent): void; _createSimpleListDialogClose(event: _TccInputMask.eventOutput): void; _setConfidence(event: _TccInputMask.eventOutput<number>): void; private buildStructureElementsObj; getStructureElement(id: string): _TccInputMask.SectionElement | _TccInputMask.RowElement; getDisplayElement(id: string): displayElement; getDisplayElement(id: string, type: _TccInputMask.elementtype.input): TccInputElementComponent; getDisplayElement(id: string, type: _TccInputMask.elementtype.autocomplete): TccAutocompleteInputElementComponent; getDisplayElement(id: string, type: _TccInputMask.elementtype.textfield): TccInputElementComponent; getDisplayElement(id: string, type: _TccInputMask.elementtype.datepicker): TccInputElementComponent; getDisplayElement(id: string, type: _TccInputMask.elementtype.text): TccInputElementComponent; getDisplayElement(id: string, type: _TccInputMask.elementtype.translation): TccInputElementComponent; getDisplayElement(id: string, type: _TccInputMask.elementtype.select): TccSelectElementComponent; getDisplayElement(id: string, type: _TccInputMask.elementtype.checkbox): TccBooleanElementComponent; getDisplayElement(id: string, type: _TccInputMask.elementtype.switch): TccBooleanElementComponent; getDisplayElement(id: string, type: _TccInputMask.elementtype.button): TccButtonElementComponent; getDisplayElement(id: string, type: _TccInputMask.elementtype.radiobutton): TccRadioButtonElementComponent; getDisplayElement(id: string, type: _TccInputMask.elementtype.searchlistDialog): TccSearchListDialogElementComponent; getDisplayElement(id: string, type: _TccInputMask.elementtype.createListDialog): TccCreateListDialogElementComponent; getDisplayElement(id: string, type: _TccInputMask.elementtype.createSimpleListDialog): TccCreateSimpleListDialogElementComponent; getDisplayElement(id: string, type: _TccInputMask.elementtype.tagInput): TccTagInputDisplayElementComponent; private getInnerFormElement; getFormElement(id: string): AbstractControl; private complexRowElementChanged; /** * sets an error in an element * */ setCustomError(id: string, errorMessage: string): void; /** * removes an error in an element * */ removeCustomError(id: string): void; setHintMessage(id: string, message: string, type?: _TccInputMask.notificationType): void; /** * sets success message. Will Only be shown, if no error is shown * * @param {string} message */ removeHintMessage(id: string): void; /** * sets the value of an element (if the element is a collection element, setValue sets only the value of this element) * * @returns element.value */ setValue(id: string, value: _TccInputMask.ValueUnion | _TccInputMask.ValueUnion[], options?: _TccInputMask.setValueOptions): void; /** * sets all values using the entity and the provided path from TccInputMask.DisplayPathElement */ private setValuesByEntity; /** * sets the value using the entity and the provided path from TccInputMask.DisplayPathElement */ private setValueByEntity; private getEntityValueByPath; /** * checks an object, if the inputMask would be valid with the given data. Does NOT affect the inputMask in any way. * * @param entity object to check */ checkEntity(entity: Object): boolean; /** * resets the Value of the Element with the given id * * @param id id of the element */ resetValue(id: string): void; setSelections(id: string, selections: Array<string> | Array<TccKeyValuePair>): void; addToSelection(id: string, value: string | TccKeyValuePair, allowDuplicates?: boolean): void; removeFromSelection(id: string, value: string | TccKeyValuePair): void; refreshSelectionList(id: string): void; setAutocomplete(id: string, list: Array<string | TccKeyValuePair>): void; setReadonly(id: string, readonly: boolean): void; setPaginatorCount(id: string, count: number): void; resetPaginator(id?: string): void; setActiveChip(id: string, chipId: string): void; startLoadOptions(id: string): void; endLoadOptions(id: string): void; /** * resets the fromGroup. Will not reset elements, that have more complex data that isnt saved in the form. For complete resets use reset/resetChanges/resetValue */ clearValues(): void; hideElements(ids: Array<string>): void; hideElement(id: string): void; showElements(ids: Array<string>): void; showElement(id: string): void; hideSectionElement(id: string): void; showSectionElement(id: string): void; private getSectionById; getFirstVisibleElementOfSection(sectionId: string): string; private getSectionByCaption; verify(): boolean; focus(id: string): void; focusNextElement(): void; getFocusedElement(): displayElement; getNextErrorElement(): displayElement; getFirstErrorElement(): displayElement; private _getNextErrorElement; private getFirstElement; clearValueChanges(): void; get valueChanges(): _TccInputMask.valueChanges; get values(): _TccInputMask.valueChanges; private getValueObject; private setValueObjectForRow; private setValueObjectForDisplayElement; getValue(id: string): _TccInputMask.ValueUnion; getValue(id: string, type: _TccInputMask.elementtype.datepicker): string; getValue(id: string, type: _TccInputMask.elementtype.translation): TccTranslation; getValue(id: string, type: _TccInputMask.elementtype.text): string; getValue(id: string, type: _TccInputMask.elementtype.button): string; getValue(id: string, type: _TccInputMask.elementtype.switch): boolean; getValue(id: string, type: _TccInputMask.elementtype.checkbox): boolean; getValue(id: string, type: _TccInputMask.elementtype.select): string | number; getValue(id: string, type: _TccInputMask.elementtype.textfield): string | number; getValue(id: string, type: _TccInputMask.elementtype.input): string | number; getValue(id: string, type: _TccInputMask.elementtype.createListDialog): Array<TccKeyValuePair>; /** * Resets all Values in valueChanges to its init value and clears valueChanges */ resetChanges(): void; /** * resets everything to its init state */ reset(): void; setDefaults(keepSetDefaults?: boolean): void; setDefault(id: string, keepSetDefaults?: boolean): void; _rowButtonClick(section: _TccInputMask.SectionElement, row: _TccInputMask.RowElement, rowButton: rowButtonPipeOptions): void; private addRowToCollection; private deleteRowFromCollection; /** * clone a row for collection rows (clone all children, if row has collection = true, clone only collection elements, if row has clone = false) * @param {_TccInputMask.RowElement} row row to clone * @returns {_TccInputMask.RowElement} new row */ private cloneRow; private _cloneRow; private removeValidators; private removeValidatorsForDisplayElement; closeComplexRow(complexSection: _TccInputMask.SectionElement): void; setSearchListDialogService<T>(elementId: string, chipId: string, service: TccODataService<T>): void; setSearchListDialogActiveItems(elementId: string, chipId: string, activeItems: Array<TccSearchListDialogServiceNamespace.item>): void; setSearchListDialogPermanentItems(elementId: string, chipId: string, permanentItems: TccSearchListDialogServiceNamespace.item[]): void; initSearchListDialogElement(): void; setCreateListDialogActiveItems(elementId: string, chipId: string, activeItems: _TccInputMask.createListDialogActiveItem[]): void; setCreateSimpleListDialogActiveItems(elementId: string, activeItems: string[]): void; initCreateListDialogElement(): void; initCreateSimpleListDialogElement(): void; private getLastEntityObjectByPath; setEntityValueChanges(entity?: Object, valueChanges?: _TccInputMask.valueChanges): void; disableInputmask(disable: boolean): void; /** * registers the element in this.elements and if this._entity is set, sets the value using the path property of the element * @param element the displayElement * @param sectionId * @param rowId */ registerElement(element: displayElement, sectionId: string, rowId: string): void; togglePanelIcon(state: boolean, index: number): void; highlightElement(elementId: string): void; }