tuain-ng-forms-lib 14.5.37 → 15.0.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5,6 +5,16 @@ import { RecordTable } from './table/table';
5
5
  import { RecordFormSection } from './section';
6
6
  import { RecordFormSubSection } from './subsection';
7
7
  import { TableRecordData } from './table/row-data';
8
+ interface Transition {
9
+ name: string;
10
+ source: string;
11
+ destination: string;
12
+ }
13
+ interface StateFlow {
14
+ defaultState: string;
15
+ states: string[];
16
+ transitions: Transition[];
17
+ }
8
18
  export interface FieldPayload {
9
19
  fieldCode: string;
10
20
  fieldValue: any;
@@ -25,32 +35,30 @@ export interface TablePayload {
25
35
  }
26
36
  export declare class FormStructureAndData {
27
37
  private readonly _stateChange;
38
+ formConfig: any;
28
39
  state: string;
29
- _name: string;
30
- _formConfig: any;
31
- private _title;
32
- private _stateFlow;
33
- private _fieldArray;
34
- private _fields;
35
- private _actionArray;
36
- private _actions;
37
- private _tableArray;
38
- private _tables;
39
- private _sectionArray;
40
- private _sections;
40
+ name: string;
41
+ title: string;
42
+ protected subject: string | null;
43
+ protected stateFlow: StateFlow;
44
+ protected fields: {};
45
+ protected actions: {};
46
+ protected tables: {};
47
+ protected sections: {};
48
+ protected fieldArray: FieldDescriptor[];
49
+ protected actionArray: FormAction[];
50
+ protected tableArray: RecordTable[];
51
+ protected sectionArray: RecordFormSection[];
41
52
  private _immutableData;
42
53
  private _extraInfo;
43
54
  private _exclusiveSectionsByAttr;
44
- constructor(definitionReceived: any, formConfig: any);
45
- getTitle(): string;
46
- setTitle(title: string): void;
47
- get name(): string;
48
- set name(name: string);
55
+ constructor();
56
+ setConfig(formConfig: any): void;
57
+ cleanForm(): void;
58
+ loadDefinition(definitionReceived: any): void;
49
59
  get defaultState(): string;
50
- supportState(state: string): boolean;
51
- supportMode(state: string): boolean;
52
60
  get states(): any[];
53
- getCurrentState(): string;
61
+ supportState(state?: string): boolean;
54
62
  changeState(newState: string): boolean;
55
63
  get stateChange(): Subject<any>;
56
64
  setStateFlow(states?: any, transitions?: any, defaultState?: string): void;
@@ -60,7 +68,6 @@ export declare class FormStructureAndData {
60
68
  getExtraInfo(name: string): any;
61
69
  set extraInfo(extraInfo: any);
62
70
  get extraInfo(): any;
63
- get fields(): any;
64
71
  get fieldNames(): string[];
65
72
  getFields(): FieldDescriptor[];
66
73
  getFieldNames(): string[];
@@ -78,6 +85,7 @@ export declare class FormStructureAndData {
78
85
  setFieldOptions(code: string, optionsArray: any[], idAttribute: string, nameAttribute: string): any;
79
86
  getFieldSet(filter: any, inputCodes: string[] | string | null, secCode?: string | null, subCode?: string | null): string[];
80
87
  applyOnFields(processFunc: any, inputCodes?: string[] | string | null, secCode?: string, subCode?: string): number;
88
+ applyProcessToAllFields(processFunc: any): number;
81
89
  enableFields(codes?: string[] | string | null, secCode?: string, subCode?: string): number;
82
90
  showFields(codes?: string[] | string | null, secCode?: string, subCode?: string): number;
83
91
  hideFields(codes?: string[] | string | null, secCode?: string, subCode?: string): number;
@@ -93,16 +101,19 @@ export declare class FormStructureAndData {
93
101
  getChangedFields(codes?: string[] | string | null, secCode?: string, subCode?: string): string[];
94
102
  getFieldsWithValidationIssues(codes?: string[] | string | null, secCode?: string, subCode?: string, onlyVisible?: boolean): string[];
95
103
  getFieldsValues(inputCodes?: string[] | string | null, secCode?: string, subCode?: string): any;
96
- get actions(): {};
97
- getActionsByAttribute(name: string, value: any): FormAction[];
98
104
  getActions(): FormAction[];
99
105
  getAction(code: string): FormAction;
100
106
  showActions(codes: string[] | string): void;
101
107
  hideActions(codes: string[] | string): void;
102
108
  enableActions(codes: string[] | string): void;
103
109
  disableActions(codes: string[] | string): void;
110
+ enableAction(code: string): void;
111
+ disableAction(code: string): void;
112
+ showAction(code: string): void;
113
+ hideAction(code: string): void;
114
+ getHeaderActions(): FormAction[];
115
+ getActionsByAttribute(name: string, value: any): FormAction[];
104
116
  execOnActions(codes: string[] | string | null, functionName: string): void;
105
- get tables(): any;
106
117
  getTables(): RecordTable[];
107
118
  getTable(code: string): RecordTable;
108
119
  getTableRecord(code: string, id: string): TableRecordData;
@@ -111,18 +122,26 @@ export declare class FormStructureAndData {
111
122
  showTables(codes: string[] | string): void;
112
123
  hideTables(codes: string[] | string): void;
113
124
  cleanTables(codes: string[] | string): void;
125
+ showTable(code: string): void;
126
+ hideTable(code: string): void;
127
+ cleanTable(code: string): void;
114
128
  execOnTables(codes: string[] | string | null, functionName: string): void;
115
- get sections(): any;
116
129
  getSections(): RecordFormSection[];
130
+ getSectionsTitles(): string[];
131
+ numSections(): number;
117
132
  getSectionsByAttribute(name: any, value: any): RecordFormSection[];
118
133
  get sectionTitles(): string[];
119
134
  get visibleSections(): RecordFormSection[];
120
135
  getSection(code: string): RecordFormSection;
121
136
  showSections(codes: string[] | string): void;
122
137
  hideSections(codes: string[] | string): void;
138
+ showSection(code: string): void;
139
+ hideSection(code: string): void;
123
140
  activeSection(): string;
124
141
  getSubSection(code: string, subCode: any): RecordFormSubSection;
125
142
  showSubSections(code: string, subCodes: string[] | string): void;
143
+ showSubSection(code: string, subCode: string): void;
144
+ hideSubSection(code: string, subCode: string): void;
126
145
  hideSubSections(code: string, subCodes: string[] | string): void;
127
146
  getSectionActions(code: any): FormAction[];
128
147
  getSectionActionNames(code: any): string[];
@@ -134,4 +153,73 @@ export declare class FormStructureAndData {
134
153
  */
135
154
  cleanData(): void;
136
155
  getPayload(): any;
156
+ /**
157
+ * @deprecated Use subject
158
+ */
159
+ get formSubject(): string;
160
+ /**
161
+ * @deprecated Use subject
162
+ */
163
+ set formSubject(subject: string);
164
+ /**
165
+ * @deprecated Use states
166
+ */
167
+ getStates(): any[];
168
+ /**
169
+ * @deprecated Use state
170
+ */
171
+ getCurrentState(): string;
172
+ /**
173
+ * @deprecated Use title
174
+ */
175
+ getTitle(): string;
176
+ /**
177
+ * @deprecated Use title
178
+ */
179
+ setTitle(title: string): void;
180
+ /**
181
+ * @deprecated Use supportState
182
+ */
183
+ supportMode(state: string): boolean;
184
+ /**
185
+ * @deprecated Use enableFields
186
+ */
187
+ enableEditFields(codes?: string[] | string | null, secCode?: string, subCode?: string): number;
188
+ /**
189
+ * @deprecated Use disableFields
190
+ */
191
+ disableEditFields(codes?: string[] | string | null, secCode?: string, subCode?: string): number;
192
+ /**
193
+ * @deprecated Use getField
194
+ */
195
+ getFieldObject(code: string): FieldDescriptor | null;
196
+ /**
197
+ * @deprecated Use getAction
198
+ */
199
+ getActionObject(code: string): FormAction | null;
200
+ /**
201
+ * @deprecated Use getTable
202
+ */
203
+ getTableObject(code: string): RecordTable | null;
204
+ /**
205
+ * @deprecated Use getSection
206
+ */
207
+ getSectionObject(code: string): RecordFormSection | null;
208
+ /**
209
+ * @deprecated Use changeState
210
+ */
211
+ changeFormMode(state: string): boolean;
212
+ /**
213
+ * @deprecated Use subject
214
+ */
215
+ getFormSubject(): string;
216
+ /**
217
+ * @deprecated Use subject
218
+ */
219
+ getSubject(): string;
220
+ /**
221
+ * @deprecated Use subject
222
+ */
223
+ getformSubject(): string;
137
224
  }
225
+ export {};
@@ -12,4 +12,5 @@ export declare class TableAction extends FormPiece {
12
12
  restrictedOnValue: string | null;
13
13
  restrictedOnOperator: string | null;
14
14
  constructor(actionDefinition: any, formConfig: any);
15
+ formStateChange(state: any): void;
15
16
  }
@@ -2,17 +2,13 @@ import { FormStructureAndData } from '../../classes/forms/form';
2
2
  import { LibFormManagerService } from '../../services/form-manager.service';
3
3
  import { LibEventManagerService } from '../../services/event-manager.service';
4
4
  import { LibFileManagementService } from '../../services/file-manager.service';
5
- import { FormAction } from '../../classes/forms/action';
6
- import { FieldDescriptor, FieldOption } from '../../classes/forms/field';
7
- import { RecordTable } from '../../classes/forms/table/table';
5
+ import { FieldDescriptor } from '../../classes/forms/field';
8
6
  import { RecordFormSection } from '../../classes/forms/section';
9
- import { RecordFormSubSection } from '../../classes/forms/subsection';
10
7
  import * as i0 from "@angular/core";
11
- export declare class BasicFormComponent {
8
+ export declare class BasicFormComponent extends FormStructureAndData {
12
9
  protected formManagerService: LibFormManagerService;
13
10
  protected _eventManager: LibEventManagerService;
14
11
  protected fileMgmtServices: LibFileManagementService;
15
- private _formStructure;
16
12
  private _controlToken;
17
13
  private _originToken;
18
14
  private _formRoute;
@@ -39,9 +35,6 @@ export declare class BasicFormComponent {
39
35
  protected extraData: any;
40
36
  protected _eventEmiter: LibEventManagerService;
41
37
  protected enabledSections: RecordFormSection[];
42
- formConfig: any;
43
- name: string | null;
44
- formSubject: string | null;
45
38
  _errorType: string;
46
39
  errorCode: string;
47
40
  errorFullCode: string;
@@ -49,115 +42,11 @@ export declare class BasicFormComponent {
49
42
  errorMessage: string;
50
43
  errorDetail: string;
51
44
  visible: boolean;
52
- fields: any;
53
- actions: any;
54
- sections: any;
55
- fieldsArray: any;
56
- actionsArray: any;
57
- sectionsArray: any;
58
45
  busy: boolean;
59
- get title(): string;
60
- set title(title: string);
61
- getTitle(): string;
62
- setTitle(title: string): void;
63
- cleanData(): void;
64
- getCurrentState(): string;
65
- supportState(state: string | null): boolean;
66
- getStates(): any[];
67
- getImmutableElement(name: string): any;
68
- getExtraInfo(name: string): any;
69
- getFields(): FieldDescriptor[];
70
- getFieldNames(): string[];
71
- getField(code: string): FieldDescriptor;
72
- enableField(code: string): void;
73
- disableField(code: string): void;
74
- getFieldValue(code: string): any;
75
- getFieldOptionText(code: string): any;
76
- getFieldsValues(codes: string[]): any;
77
- getFieldOptions(code: string): FieldOption[] | null;
78
- setFieldValue(code: string, value: any): any;
79
- setFieldRequired(inputCodes: string[] | string | null, required: boolean): any;
80
- setFieldErrorMessage(code: string, errorMessage: string): any;
81
- setFieldError(code: string, errorCode: string, message: string, type?: string): any;
82
- setFieldIntrinsicErrorMessage(code: string, message: string): any;
83
- setFieldOptions(code: any, optionsArray: any, idAttribute: any, nameAttribute: any): any;
84
- getFieldSet(filterFunc?: any, codes?: string[] | string | null, secCode?: string | null, subCode?: string | null): string[];
85
- applyOnFields(processFunc: any, codes?: string[] | string | null, secCode?: string, subCode?: string): number;
86
- applyProcessToAllFields(processFunc: any): number;
87
- cleanFields(codes?: string[] | string | null, secCode?: string, subCode?: string): number;
88
- getRequiredFields(codes?: string[] | string | null, secCode?: string, subCode?: string): string[];
89
- getRequiredEmptyFields(codes?: string[] | string | null, secCode?: string, subCode?: string, onlyVisible?: boolean): string[];
90
- getChangedFields(codes?: string[] | string | null, secCode?: string, subCode?: string): string[];
91
- getFieldsWithValidationIssues(codes?: string[] | string | null, secCode?: string, subCode?: string, onlyVisible?: boolean): string[];
92
- tagFieldsWithError(errorMessage: string, codes?: string[] | string | null, secCode?: string, subCode?: string): number;
93
- cleanErrorFields(codes?: string[] | string | null, secCode?: string, subCode?: string): number;
94
- showLabelFields(codes?: string[] | string | null, secCode?: string, subCode?: string): number;
95
- hideLabelFields(codes?: string[] | string | null, secCode?: string, subCode?: string): number;
96
- enableFields(codes?: string[] | string | null, secCode?: string, subCode?: string): number;
97
- disableFields(codes?: string[] | string | null, secCode?: string, subCode?: string): number;
98
- /**
99
- * @deprecated Use enableFields
100
- */
101
- enableEditFields(codes?: string[] | string | null, secCode?: string, subCode?: string): number;
102
- /**
103
- * @deprecated Use disableFields
104
- */
105
- disableEditFields(codes?: string[] | string | null, secCode?: string, subCode?: string): number;
106
- showFields(codes?: string[] | string | null, secCode?: string, subCode?: string): number;
107
- hideFields(codes?: string[] | string | null, secCode?: string, subCode?: string): number;
108
- getActionsByAttribute(name: string, value: any): FormAction[];
109
- getHeaderActions(): FormAction[];
110
- getAction(actionCode: string): FormAction | null;
111
- showActions(actionArray: any): void;
112
- hideActions(actionArray: any): void;
113
- enableActions(actionArray: any): void;
114
- disableActions(actionArray: any): void;
115
- showAction(code: string): void;
116
- hideAction(code: string): void;
117
- enableAction(code: string): void;
118
- disableAction(code: string): void;
119
- getSections(): RecordFormSection[] | null;
120
- activateSection(code: any): void;
121
- getSectionsTitles(): string[] | null;
122
- getSection(code: string): RecordFormSection | null;
123
- showSection(code: string): void;
124
- hideSection(code: string): void;
125
- showSections(codes: string[] | string): void;
126
- hideSections(codes: string[] | string): void;
127
- getSubSection(code: string, subCode: string): RecordFormSubSection | null;
128
- showSubSection(code: string, subCode: string): void;
129
- hideSubSection(code: string, subCode: string): void;
130
- showSubSections(code: string, subCodes: string[] | string): void;
131
- hideSubSections(code: string, subCodes: string[] | string): void;
132
- getSectionActions(code: string): FormAction[] | null;
133
- getSectionActionNames(code: string): string[] | null;
134
- getTables(): RecordTable[];
135
- showTables(codes: string[] | string): void;
136
- hideTables(codes: string[] | string): void;
137
- cleanTables(codes: string[] | string): void;
138
- getTable(code: string): RecordTable;
139
- showTable(code: string): void;
140
- hideTable(code: string): void;
141
- cleanTable(code: string): void;
142
- getTableRecord(code: string, recordId: any): import("../../classes/forms/table/row-data").TableRecordData;
143
46
  constructor(formManagerService: LibFormManagerService, _eventManager: LibEventManagerService, fileMgmtServices: LibFileManagementService);
144
- setConfig(formConfig: any): void;
145
47
  cleanStart(): void;
146
48
  get formVisible(): boolean;
147
49
  get form(): this;
148
- get formCode(): string;
149
- set formCode(name: string);
150
- get inServerProcess(): boolean;
151
- get formStructure(): FormStructureAndData | null;
152
- get state(): string | null;
153
- get currentState(): string;
154
- set currentState(state: string);
155
- get immutableData(): any;
156
- get extraInfo(): any;
157
- get visibleSections(): RecordFormSection[] | null;
158
- get formRoute(): string;
159
- set formRoute(route: string);
160
- get subject(): string;
161
50
  customPreProcessing(): void;
162
51
  start(): void;
163
52
  customFormStart(): void;
@@ -167,43 +56,6 @@ export declare class BasicFormComponent {
167
56
  showFieldInfo(code?: string, detail?: any): void;
168
57
  showModalDialog(title: any, body: any, options: any, callback?: any, params?: any): void;
169
58
  openUploadDialog(title: any, body: any, options: any, callback?: any, params?: any): void;
170
- /**
171
- * @deprecated Use supportState
172
- */
173
- supportMode(state: string): boolean;
174
- /**
175
- * @deprecated Use getField
176
- */
177
- getFieldObject(code: string): FieldDescriptor | null;
178
- /**
179
- * @deprecated Use getAction
180
- */
181
- getActionObject(code: string): FormAction | null;
182
- /**
183
- * @deprecated Use getTable
184
- */
185
- getTableObject(code: string): RecordTable | null;
186
- /**
187
- * @deprecated Use getSection
188
- */
189
- getSectionObject(code: string): RecordFormSection | null;
190
- /**
191
- * @deprecated Use changeState
192
- */
193
- changeFormMode(state: string): boolean;
194
- /**
195
- * @deprecated Use subject
196
- */
197
- getFormSubject(): string;
198
- /**
199
- * @deprecated Use subject
200
- */
201
- getSubject(): string;
202
- /**
203
- * @deprecated Use subject
204
- */
205
- getformSubject(): string;
206
- numSections(): number;
207
59
  subscribeAppEvent(eventName: string, callback: any): void;
208
60
  openForm(name: string, data?: any, backData?: any, cleanStack?: boolean): void;
209
61
  canGoBack(): boolean;
@@ -302,8 +154,36 @@ export declare class BasicFormComponent {
302
154
  * Métodos Legacy de compatibilidad hacia atrás
303
155
  */
304
156
  /**
305
- * @deprecated Use onSectionActivation
306
- */
157
+ * @deprecated Use name
158
+ */
159
+ get formCode(): string;
160
+ /**
161
+ * @deprecated Use name
162
+ */
163
+ set formCode(name: string);
164
+ /**
165
+ * @deprecated Use busy
166
+ */
167
+ get inServerProcess(): boolean;
168
+ /**
169
+ * @deprecated Use state
170
+ */
171
+ get currentState(): string;
172
+ /**
173
+ * @deprecated Use changeState
174
+ */
175
+ set currentState(state: string);
176
+ /**
177
+ * @deprecated Use onSectionActivation
178
+ */
179
+ get formRoute(): string;
180
+ /**
181
+ * @deprecated Use onSectionActivation
182
+ */
183
+ set formRoute(route: string);
184
+ /**
185
+ * @deprecated Use onSectionActivation
186
+ */
307
187
  addSectionActivation(codes: string[] | string | null, callback: any, properties?: any): void;
308
188
  /**
309
189
  * @deprecated Use onSectionInactivation
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tuain-ng-forms-lib",
3
- "version": "14.5.37",
3
+ "version": "15.0.10",
4
4
  "description": "Componentes y Clases Angular para la gestión de formularios TUAIN",
5
5
  "author": "Mauricio Méndez, Imix Consulting",
6
6
  "license": "MIT",