/********** Angular **********/ import { OnInit, ChangeDetectorRef } from "@angular/core"; import { FormGroup } from "@angular/forms"; /********** Component & Service **********/ import { ZComponent, ZField, FieldService, ToastService, ZGroup, ZComponentProperties, ComponentErrorHandlerService, ResourceApiService, WebApiService } from 'mmhglobal-zcore'; import { ContainerFieldBase } from "../components/containerfieldbase.component"; import { ZComponentService } from "../services/zcomponent.service"; import * as i0 from "@angular/core"; export declare class ZudfComponent extends ContainerFieldBase implements ZComponent, OnInit { componentService: ZComponentService; private fieldService; private toastService; private webApiService; private componentErrorHandlerService; private resourceApiService; private cdr; componentProperties: ZComponentProperties; initialDataValue: any; componentPrefix: string; componentScopeName: string; displayElementModel: any; multiValueGroupGridValue: string[]; loadedFieldsSequence: any; private subscription; readonly prefixValueOption = "_zudfmvgOptions"; readonly prefixDataSourceName = "_zudfmvgDataSource"; readonly prefixColumnFieldsName = "_zudfmvgColumnFields"; readonly prefixCustomAddButtonOnClick = "_CustomAddButtonOnClick"; readonly prefixCustomResetButtonOnClick = "_CustomResetButtonOnClick"; readonly prefixCustomRemoveButtonOnClick = "_CustomRemoveButtonOnClick"; constructor(componentService: ZComponentService, fieldService: FieldService, toastService: ToastService, webApiService: WebApiService, componentErrorHandlerService: ComponentErrorHandlerService, resourceApiService: ResourceApiService, cdr: ChangeDetectorRef); ngOnInit(): void; ngOnDestroy(): void; /** * Renders the field element and sets up the form. */ private loadForm; setFormControlValidation(formControlName: string, validator: any): void; /** * Renders field elements based on a JSON string. * @param group The ZGroup object to which the field elements will be added. * @param jsonString The JSON string representing the field elements. */ renderFieldElementByJsonString(group: ZGroup, jsonString: string, fieldElementName?: string): void; /** * Sets the display model for a zudf (zero-utility data field) element. * * @param {any} value - The value to use for the display model. */ setDisplayModel(value: any): void; /** * Updates a value in the display element model at the specified flat index. * @param {*} value - The new value to be set. * @param {string} flatIndex - The flat index indicating the location in the display element model where the value should be updated. */ updateDisplayModel(value: any, flatIndex: string): void; /** * Appends a value to the display element model at the specified flat index. * @param {*} value - The value to be appended. * @param {string} flatIndex - The flat index indicating the location in the display element model where the value should be appended. */ appendToDisplayModel(value: any, flatIndex: string): void; /** * Returns a deep copy of the display element model. * @returns {any} A deep copy of the display element model. */ getDisplayModel(): any; /** * Removes all elements from the display element model and clears the form control. */ removeAllDisplayModel(): void; /** * Removes an element from the display element model at the specified flat index and updates the form field. * @param {string} flatIndex - The flat index indicating the location in the display element model where the element should be removed. */ removeElementFromDisplayModel(flatIndex: string): void; /** * Appends a form control to the form and the display element model. * @param {ZField} fieldData - The data for the form control to be appended. */ appendFormControl(fieldData: any): void; /** * Renders field elements as form controls in a new form group. * @param {any} fieldElements - The field elements to be rendered. */ renderFieldElement(fieldElements: any, fieldElementName?: string): void; private generateFormControls; /** * Removes the form controls from the form group and resets the component's data and display element model. * * @returns {void} */ clearFormControl(): void; /** * Returns the form fields for the component. * * @returns {object[]} - An array of form field objects. */ getFormControl(): any; /** * Sets the zModel values of a form group based on the provided model data. * * @param {ZGroup} [group=this.group] - The form group to update. * @param {object} modelData - The model data to apply to the form group. * @returns {void} */ setFormFieldzModel(group: ZGroup, modelData: any): void; /** * Add the component prefix to property names in an object. * * @param {*} modelData - The object to update. * @param {*} [containerPrefix] - Optional parameter indicating the prefix to use for properties in nested objects. * @returns {*} The updated object. */ private addZModelPropertyPrefix; getZModelAsString(): string; ComponentIsVisible(field: ZField): any; setEnable: (status: boolean) => void; setVisible: (status: boolean) => void; setRequire: (status: boolean) => void; getForm(): FormGroup; /** * Generates the name of a form control based on its type, name, and container name. * @param {string} controlName - The name of the form control. * @param {string} containerName - The name of the container that the form control is in. * @returns {string} The generated name of the form control. */ generateFormControlName(controlName: string, containerName?: string): string; /** * Appends a prefix to the names and values of fields recursively. * @param {ZField[]} fields - The fields to be prefixed. * @param {any} prefix - The prefix to be added. */ private appendPrefix; /** * Updates the form fields with the display element model. */ private updateFormField; /** * Get the value of a container model in the form. * @param {string} containerName - The name of the container to retrieve the value from. * @returns {Object} - An object containing the container model values. */ getContainerModelValue(containerName: string): Object; /** * Clears the value of all field elements inside a container. * @param {string} containerName - The name of the container whose fields will be cleared. */ clearContainerFieldElementValue(containerName: string): void; /** * Sets up a multi-value group, which is a grid of fields that can have multiple rows. * @param data - The configuration data for the multi-value group. * @param dataIndex - The index of the data in the displayModel. Optional, used when updating existing data. */ setMultiValueGroup(data: any, dataIndex?: any): void; private captureContainerFieldValueToModel; private clearContainerRelatedFieldValue; private removeGridRow; private isDropdownType; /** * Validates the form and shows an error message if it is invalid. * Returns true if the form is valid, otherwise false. */ validateAndShowErrorMessage(): boolean; /** * Resets the errors of a container field in a FormGroup. * * @param fg The FormGroup object containing the field. * @param key The name of the field in the FormGroup. */ private setContainerFieldErrorAsNull; /** * Validates a form and returns its ZModel if it is valid. * @param skipRemoveMvgFieldValue Whether to skip removing the values of mvg fields from the zModel object. * @returns The form's ZModel if it is valid, or undefined otherwise. */ getValidatedFormZModel(skipRemovePrefix?: boolean, skipRemoveMvgFieldValue?: boolean): any; /** * Retrieves a modified version of the zModel object, with mvg (multi value group) fields removed and property prefixes removed. * @param skipRemovePrefix Whether to skip removing the default property prefix. * @param skipRemoveMvgFieldValue Whether to skip removing the values of mvg fields from the zModel object. * @returns The modified zModel object. */ getZModel(skipRemovePrefix?: boolean, skipRemoveMvgFieldValue?: boolean): any; /** * Set the value of a model in the form group. * * @param {string} modelName The name of the model to set. * @param {*} modelValue The value to set for the model. * @param {boolean} [skipPrefix] Optional parameter indicating whether to skip the component prefix. * @returns {void} */ setModelValue(modelName: string, modelValue: any, skipPrefix?: boolean): void; /** * Remove the component prefix from property names in the zModel object. * * @param {*} zModel The zModel object. * @param {boolean} [getOnlyFieldName] Optional parameter indicating whether to only return the field name without the prefix. * @returns {*} The updated zModel object. */ private removeZModelPropertyPrefix; /** * Clears the zModel property of the group in the component scope and resets the multiValueGroupGridValue array. * * @returns {void} */ clearZModel(): void; setMultiValueGroupButtonsEnabled(containerName: string, isEnabled: boolean): void; private getFieldElement_FormPage; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; }