UNPKG

tuain-ng-forms-lib

Version:

Componentes y Clases Angular para la gestión de formularios TUAIN

269 lines (268 loc) 14.5 kB
import { OnInit } from '@angular/core'; import { FormStructureAndData } from '../../classes/forms/form'; import { LibFormManagerService } from '../../services/form-manager.service'; import { LibEventManagerService } from '../../services/event-manager.service'; import { LibFileManagementService } from '../../services/file-manager.service'; import { FieldDescriptor } from '../../classes/forms/field'; import { RecordFormSection } from '../../classes/forms/section'; import * as i0 from "@angular/core"; export declare abstract class BasicFormComponent extends FormStructureAndData implements OnInit { protected formManagerService: LibFormManagerService; protected _eventManager: LibEventManagerService; protected fileMgmtServices: LibFileManagementService; private destroyRef; private _controlToken; private _originToken; private _formRoute; private _definitionObtained; private _notifyFormActivity; private _formChangeState; private _formSectionsCanDeactivate; private _formSectionsActivate; private _formSectionsInactivate; private _formActionsStart; private _formActionsFinish; private _fieldCustomEvent; private _fieldInputValidation; private _fieldValidationsStart; private _fieldValidationsFinish; private _tableSelectionsStart; private _tableSelectionsFinish; private _tableActionsStart; private _tableActionsFinish; private _tableGetDataStart; private _tableGetDataFinish; private _actionServerError; private _fieldServerError; private _tableServerError; private _actionsInProgress; private _serverActionsInProgress; protected inputDataFields: Record<string, any>; protected extraData: Record<string, any>; protected _eventEmiter: LibEventManagerService; protected enabledSections: RecordFormSection[]; _errorType: string; errorCode: string; errorFullCode: string; errorName: string; errorMessage: string; errorDetail: string; visible: boolean; busy: import("@angular/core").WritableSignal<boolean>; constructor(formManagerService: LibFormManagerService, _eventManager: LibEventManagerService, fileMgmtServices: LibFileManagementService); cleanStart(): void; get formVisible(): boolean; get form(): this; ngOnInit(): void; preStart(): void; start(): void; /** * @deprecated Since v17. Use preStart instead. Will be removed in v19. */ customPreProcessing(): void; /** * @deprecated Since v17. Overload start instead. Will be removed in v19. */ customFormStart(): void; displayActionServerError(): void; displayValidationServerError(): void; displayTableServerError(): void; showFieldInfo(code?: string, detail?: any): void; showModalDialog(title: any, body: any, options: any, callback?: any, params?: any): void; openUploadDialog(title: any, body: any, options: any, callback?: any, params?: any): void; subscribeAppEvent(eventName: string, callback: (...args: any[]) => any): void; openForm(name: string, data?: any, backData?: any, cleanStack?: boolean): void; enableActivityNotification(): void; disableActivityNotification(): void; canGoBack(): boolean; goBack(): void; goBackForm(): void; getOriginDetail(): any; setError(errorType: string | null, errorMessage: string | null, errorDetail: string | null): void; resetError(): void; getErrorType(): string; getErrorMessage(): string; getErrorDetail(): string; getErrorName(): string; getErrorFullCode(): string; getErrorCode(): string; getFormParameter(name: string): string; processInputParams(params: any): string | null; subscribeSectionActivation(): void; subscribeFieldsSubjects(): void; subscribeActionSubjects(): void; subscribeTableSubjects(): void; formInit(params: any, forceReload?: boolean): Promise<void>; changeState(state: string | undefined): boolean; checkErrorRecordReceived(recordResponse: any): boolean; errorOccured(): boolean; private registerEventHandler; private removeEventHandler; private executeHandlers; /** * Soporte manejo de eventos de formulario */ requestFormAction(actionCode: string, actionSubject?: any): Promise<any>; updateFormWithServerData(formContent: any): void; /** * Manejo de event handlers para errores Server del formulario */ cleanActionServerError(): void; cleanFieldServerError(): void; cleanTableServerError(): void; onActionServerError(callback: (...args: any[]) => any, properties?: Record<string, any> | null): void; onValidationServerError(callback: (...args: any[]) => any, properties?: Record<string, any> | null): void; onTableServerError(callback: (...args: any[]) => any, properties?: Record<string, any> | null): void; /** * Manejo de event handlers para acciones sobre el formulario */ onFormChange(callback: (state: string) => void): void; onSectionCanDeactivate(codes: string[] | string | null, callback: (...args: any[]) => any, properties?: Record<string, any> | null): void; onSectionActivation(codes: string[] | string | null, callback: (...args: any[]) => any, properties?: Record<string, any> | null): void; onSectionInactivation(codes: string[] | string | null, callback: (...args: any[]) => any, properties?: Record<string, any> | null): void; onActionStart(codes: string[] | string | null, callback: (...args: any[]) => any, properties?: Record<string, any> | null): void; onActionFinish(codes: string[] | string | null, callback: (...args: any[]) => any, properties?: Record<string, any> | null): void; verifySectionActivation(code: string): Promise<boolean>; launchSectionActivation(code: string): Promise<void>; launchSectionInactivation(code: string): Promise<void>; startAction(code: string): Promise<void>; startServerAction(actionInput: any): Promise<void>; finishAction(action: any, actionResult: any, serverError?: boolean): Promise<void>; completeGlobalAction(action: any): Promise<void>; /** * Manejadores de eventos para validaciones sobre campos */ removeFieldValidationInput(codes: string[] | string | null): void; onFieldInput(codes: string[] | string | null, callback: (...args: any[]) => any, properties?: Record<string, any> | null): void; removeFieldCustomEvent(codes: string[] | string | null): void; onFieldCustomEvent(codes: string[] | string | null, callback: (...args: any[]) => any, properties?: Record<string, any> | null): void; removeFieldValidationStart(codes: string[] | string | null): void; onFieldValidationStart(codes: string[] | string | null, callback: (...args: any[]) => any, properties?: Record<string, any> | null): void; removeFieldValidationFinish(codes: string[] | string | null): void; onFieldValidationFinish(codes: string[] | string | null, callback: (...args: any[]) => any, properties?: Record<string, any> | null): void; removeFieldAllEventCallbacks(codes: string[] | string | null): void; startFieldInputValidation(code: string, intrinsicValidation?: boolean): Promise<boolean>; startFieldCustomEvent(code: string, eventName: string, eventData: any): Promise<void>; startFieldValidation(code: string, intrinsicValidation?: boolean): Promise<void>; startServerFieldValidation(inputField: string | FieldDescriptor): Promise<void>; finishFieldValidation(fieldObject: any, validationResult: boolean, serverError?: boolean): Promise<void>; continueFieldValidation(code: string): Promise<void>; /** * Manejadores de eventos para acciones sobre Tablas */ onTableActionStart(code: string, actionCode: string, callback: (...args: any[]) => any, properties?: Record<string, any> | null): void; onTableActionFinish(code: string, actionCode: string, callback: (...args: any[]) => any, properties?: Record<string, any> | null): void; onTableSelectionStart(code: string, callback: (...args: any[]) => any, properties?: Record<string, any> | null): void; onTableSelectionFinish(code: string, callback: (...args: any[]) => any, properties?: Record<string, any> | null): void; onTableGetDataStart(code: string, callback: (...args: any[]) => any, properties?: Record<string, any> | null): void; onTableGetDataFinish(code: string, callback: (...args: any[]) => any, properties?: Record<string, any> | null): void; startTableGlobalAction(tableActionEvent: any): Promise<void>; startTableServerGlobalAction(tableActionDetail: any): Promise<void>; finishTableGlobalAction(tableActionDetail: any, actionResult: any, serverError?: boolean): Promise<void>; startTableAction(tableActionEvent: any): Promise<void>; startTableServerAction(tableActionDetail: any): Promise<void>; completeInlineAction(tableAction: any): Promise<void>; finishTableAction(tableActionDetail: any, actionResult: any, serverError?: boolean): Promise<void>; startTableRecordSelection(tableActionEvent: any): Promise<void>; startTableServerRecordSelection(tableSelectionDetail: any): Promise<void>; finishTableRecordSelection(tableSelectionDetail: any, actionResult: any, serverError?: boolean): Promise<void>; startTableSelectionAction(tableActionEvent: any): Promise<void>; startTableServerSelectionAction(tableActionDetail: any): Promise<void>; finishTableSelectionAction(tableActionDetail: any, actionResult: any, serverError?: boolean): Promise<void>; startTableGetData(tableActionEvent: any): Promise<void>; startTableServerGetData(tableActionDetail: any): Promise<void>; finishTableGetData(tableActionDetail: any, actionResult: any, serverError?: boolean): Promise<void>; checkSectionRequiredFields(sectionCode: string, reqFieldMessage?: string): boolean; validateSectionConsistency(sectionCode: string, reqFieldMessage?: string): boolean; copyTableRecordToFields(tableObj: any, mappingTable?: any): boolean; notifyFormActivity(): void; /** * Métodos Legacy de compatibilidad hacia atrás */ /** * @deprecated Since v17. Use name instead. Will be removed in v19. */ get formCode(): string; /** * @deprecated Since v17. Use name instead. Will be removed in v19. */ set formCode(name: string); /** * @deprecated Since v17. Use busy signal instead. Will be removed in v19. */ get inServerProcess(): boolean; /** * @deprecated Since v17. Use state instead. Will be removed in v19. */ get currentState(): string; /** * @deprecated Since v17. Use changeState instead. Will be removed in v19. */ set currentState(state: string); /** * @deprecated Since v17. Use onSectionActivation instead. Will be removed in v19. */ get formRoute(): string; /** * @deprecated Since v17. Use onSectionActivation instead. Will be removed in v19. */ set formRoute(route: string); /** * @deprecated Since v17. Use onSectionActivation instead. Will be removed in v19. */ addSectionActivation(codes: string[] | string | null, callback: (...args: any[]) => any, properties?: Record<string, any> | null): void; /** * @deprecated Since v17. Use onSectionInactivation instead. Will be removed in v19. */ addSectionInactivation(codes: string[] | string | null, callback: (...args: any[]) => any, properties?: Record<string, any> | null): void; /** * @deprecated Since v17. Use onActionStart instead. Will be removed in v19. */ addActionMethodStart(codes: string[] | string | null, callback: (...args: any[]) => any, properties?: Record<string, any> | null): void; /** * @deprecated Since v17. Use onActionFinish instead. Will be removed in v19. */ addActionMethodFinish(codes: string[] | string | null, callback: (...args: any[]) => any, properties?: Record<string, any> | null): void; /** * @deprecated Since v17. Use onFieldInput instead. Will be removed in v19. */ addFieldInputValidation(codes: string[] | string | null, callback: (...args: any[]) => any, properties?: Record<string, any> | null): void; /** * @deprecated Since v17. Use onFieldValidationStart instead. Will be removed in v19. */ addFieldValidationStart(codes: string[] | string | null, callback: (...args: any[]) => any, properties?: Record<string, any> | null): void; /** * @deprecated Since v17. Use onFieldValidationFinish instead. Will be removed in v19. */ addFieldValidationFinish(codes: string[] | string | null, callback: (...args: any[]) => any, properties?: Record<string, any> | null): void; /** * @deprecated Since v17. Use onTableActionStart instead. Will be removed in v19. */ addTableActionStart(code: string, actionCode: string, callback: (...args: any[]) => any, properties?: Record<string, any> | null): void; /** * @deprecated Since v17. Use onTableActionFinish instead. Will be removed in v19. */ addTableActionFinish(code: string, actionCode: string, callback: (...args: any[]) => any, properties?: Record<string, any> | null): void; /** * @deprecated Since v17. Use onTableSelectionStart instead. Will be removed in v19. */ addTableSelectionStart(code: string, callback: (...args: any[]) => any, properties?: Record<string, any> | null): void; /** * @deprecated Since v17. Use onTableSelectionFinish instead. Will be removed in v19. */ addTableSelectionFinish(code: string, callback: (...args: any[]) => any, properties?: Record<string, any> | null): void; /** * @deprecated Since v17. Use onTableGetDataStart instead. Will be removed in v19. */ addTableGetDataStart(code: string, callback: (...args: any[]) => any, properties?: Record<string, any> | null): void; /** * @deprecated Since v17. Use onTableGetDataFinish instead. Will be removed in v19. */ addTableGetDataFinish(code: string, callback: (...args: any[]) => any, properties?: Record<string, any> | null): void; /** * @deprecated Since v17. Use processInputParams instead. Will be removed in v19. */ preocessInputParams(params: any): string | null; static ɵfac: i0.ɵɵFactoryDeclaration<BasicFormComponent, never>; static ɵcmp: i0.ɵɵComponentDeclaration<BasicFormComponent, "ng-component", never, {}, {}, never, ["*"], true, never>; }