tuain-ng-forms-lib
Version:
Componentes y Clases Angular para la gestión de formularios TUAIN
233 lines (232 loc) • 9.26 kB
TypeScript
import { FormAction } from './action';
import { FieldDescriptor, FieldOption } from './field';
import { RecordTable } from './table/table';
import { RecordFormSection } from './section';
import { RecordFormSubSection } from './subsection';
import { TableRecordData } from './table/row-data';
interface Transition {
name: string;
source: string;
destination: string;
}
interface StateFlow {
defaultState: string;
states: string[];
stateDescriptions: string[];
transitions: Transition[];
}
export interface FieldPayload {
fieldCode: string;
fieldValue: any;
editable: boolean;
visible: boolean;
required: boolean;
fieldOptions: string;
}
export interface TablePayload {
tableCode: string;
visible: boolean;
currentPage: number;
requestedPage: number;
recordsPerPage: number;
currentFilter: any;
sortingColumn: string;
sortingDirection: string;
}
export declare class FormStructureAndData {
private readonly _stateChange;
private _immutableData;
private _extraInfo;
private _exclusiveSectionsByAttr;
protected loadInitialData: boolean;
protected subject: string | null;
protected stateFlow: StateFlow;
protected fields: {};
protected actions: {};
protected tables: {};
protected sections: {};
protected fieldArray: FieldDescriptor[];
protected actionArray: FormAction[];
protected tableArray: RecordTable[];
protected sectionArray: RecordFormSection[];
customAttributes: any;
formConfig: any;
state: string;
name: string;
title: string;
constructor();
setConfig(formConfig: any): void;
cleanForm(): void;
loadDefinition(definitionReceived: any): void;
get defaultState(): string;
get states(): any[];
get stateDescriptions(): any[];
supportState(state?: string): boolean;
getNextStates(): string[];
changeState(newState: string): boolean;
get stateChange(): import("rxjs").Observable<any>;
setStateFlow(states?: any, transitions?: any, defaultState?: string, stateDescriptions?: any[]): void;
getImmutableElement(name: string): any;
set immutableData(immutableData: any);
get immutableData(): any;
getExtraInfo(name: string): any;
set extraInfo(extraInfo: any);
get extraInfo(): any;
getCustomAttribute(name: string): any;
setCustomAttribute(name: string, value: any): void;
setCustomAttributes(attributes: any): FormStructureAndData;
get fieldNames(): string[];
getFields(): FieldDescriptor[];
getFieldNames(): string[];
getField(code: string): FieldDescriptor;
enableField(code: string): void;
disableField(code: string): void;
getFieldValue(code: string): any;
getFieldOptionText(code: string): any;
getFieldOptions(code: string): FieldOption[] | null;
setFieldValue(code: string, value: any): any;
setFieldError(code: string, errorCode: string, message: string, type?: string): any;
setFieldIntrinsicErrorMessage(code: string, message: string): any;
setFieldRequired(inputCodes: string[] | string | null, required: boolean): any;
setFieldErrorMessage(code: string, message: string): any;
setFieldOptions(code: string, optionsArray: any[], idAttribute: string, valueAttribute: string | string[], saparator?: string): any;
getFieldSet(filter: any, inputCodes: string[] | string | null, secCode?: string | null, subCode?: string | null): string[];
applyOnFields(processFunc: any, inputCodes?: string[] | string | null, secCode?: string, subCode?: string): number;
applyProcessToAllFields(processFunc: any): number;
enableFields(codes?: string[] | string | null, secCode?: string, subCode?: string): number;
showFields(codes?: string[] | string | null, secCode?: string, subCode?: string): number;
hideFields(codes?: string[] | string | null, secCode?: string, subCode?: string): number;
showLabelFields(codes?: string[] | string | null, secCode?: string, subCode?: string): number;
hideLabelFields(codes?: string[] | string | null, secCode?: string, subCode?: string): number;
disableFields(codes?: string[] | string | null, secCode?: string, subCode?: string): number;
cleanFields(codes?: string[] | string | null, secCode?: string, subCode?: string): number;
tagFieldsWithError(message: string, codes?: string[] | string | null, secCode?: string, subCode?: string): number;
cleanErrorFields(codes?: string[] | string | null, secCode?: string, subCode?: string): number;
tagEmptyRequiredFields(message: string, codes?: any, secCode?: string, subCode?: string): boolean;
getRequiredFields(codes?: string[] | string | null, secCode?: string, subCode?: string): string[];
getRequiredEmptyFields(codes?: string[] | string | null, secCode?: string, subCode?: string, onlyVisible?: boolean): string[];
getChangedFields(codes?: string[] | string | null, secCode?: string, subCode?: string): string[];
getFieldsWithValidationIssues(codes?: string[] | string | null, secCode?: string, subCode?: string, onlyVisible?: boolean): string[];
getFieldsValues(inputCodes?: string[] | string | null, secCode?: string, subCode?: string): any;
getActions(): FormAction[];
getAction(code: string): FormAction;
showActions(codes: string[] | string): void;
hideActions(codes: string[] | string): void;
enableActions(codes: string[] | string): void;
disableActions(codes: string[] | string): void;
enableAction(code: string): void;
disableAction(code: string): void;
showAction(code: string): void;
hideAction(code: string): void;
getHeaderActions(): FormAction[];
getActionsByAttribute(name: string, value: any): FormAction[];
execOnActions(codes: string[] | string | null, functionName: string): void;
getTables(): RecordTable[];
getTable(code: string): RecordTable;
getTableRecord(code: string, id: string): TableRecordData;
enableTables(codes: string[] | string): void;
disableTables(codes: string[] | string): void;
showTables(codes: string[] | string): void;
hideTables(codes: string[] | string): void;
cleanTables(codes: string[] | string): void;
showTable(code: string): void;
hideTable(code: string): void;
cleanTable(code: string): void;
execOnTables(codes: string[] | string | null, functionName: string): void;
getSections(): RecordFormSection[];
getSectionsTitles(): string[];
numSections(): number;
getSectionsByAttribute(name: any, value: any): RecordFormSection[];
get sectionTitles(): string[];
get visibleSections(): RecordFormSection[];
getSection(code: string): RecordFormSection;
showSections(codes: string[] | string): void;
hideSections(codes: string[] | string): void;
showSection(code: string): void;
hideSection(code: string): void;
activeSection(): string;
getSubSection(code: string, subCode: any): RecordFormSubSection;
showSubSections(code: string, subCodes: string[] | string): void;
showSubSection(code: string, subCode: string): void;
hideSubSection(code: string, subCode: string): void;
hideSubSections(code: string, subCodes: string[] | string): void;
getSectionActions(code: any): FormAction[];
getSectionActionNames(code: any): string[];
activateSection(code: string): void;
execOnSections(codes: string[] | string | null, functionName: string): void;
execOnSubSections(code: string, subNames: string[] | string | null, functionName: string): void;
/**
* Métodos propios de gestión del formulario
*/
cleanData(): void;
getPayload(): any;
/**
* @deprecated Use subject
*/
get formSubject(): string;
/**
* @deprecated Use subject
*/
set formSubject(subject: string);
/**
* @deprecated Use states
*/
getStates(): any[];
/**
* @deprecated Use state
*/
getCurrentState(): string;
/**
* @deprecated Use title
*/
getTitle(): string;
/**
* @deprecated Use title
*/
setTitle(title: string): void;
/**
* @deprecated Use supportState
*/
supportMode(state: string): boolean;
/**
* @deprecated Use enableFields
*/
enableEditFields(codes?: string[] | string | null, secCode?: string, subCode?: string): number;
/**
* @deprecated Use disableFields
*/
disableEditFields(codes?: string[] | string | null, secCode?: string, subCode?: string): number;
/**
* @deprecated Use getField
*/
getFieldObject(code: string): FieldDescriptor | null;
/**
* @deprecated Use getAction
*/
getActionObject(code: string): FormAction | null;
/**
* @deprecated Use getTable
*/
getTableObject(code: string): RecordTable | null;
/**
* @deprecated Use getSection
*/
getSectionObject(code: string): RecordFormSection | null;
/**
* @deprecated Use changeState
*/
changeFormMode(state: string): boolean;
/**
* @deprecated Use subject
*/
getFormSubject(): string;
/**
* @deprecated Use subject
*/
getSubject(): string;
/**
* @deprecated Use subject
*/
getformSubject(): string;
}
export {};