tuain-ng-forms-lib 15.0.28 → 15.0.30
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.
- package/esm2020/lib/classes/forms/form.mjs +7 -3
- package/fesm2015/tuain-ng-forms-lib.mjs +6 -2
- package/fesm2015/tuain-ng-forms-lib.mjs.map +1 -1
- package/fesm2020/tuain-ng-forms-lib.mjs +6 -2
- package/fesm2020/tuain-ng-forms-lib.mjs.map +1 -1
- package/lib/classes/forms/form.d.ts +3 -1
- package/package.json +1 -1
|
@@ -2119,6 +2119,7 @@ class FormStructureAndData {
|
|
|
2119
2119
|
this.stateFlow = {
|
|
2120
2120
|
defaultState: '',
|
|
2121
2121
|
states: [],
|
|
2122
|
+
stateDescriptions: [],
|
|
2122
2123
|
transitions: [],
|
|
2123
2124
|
};
|
|
2124
2125
|
}
|
|
@@ -2133,6 +2134,7 @@ class FormStructureAndData {
|
|
|
2133
2134
|
this.stateFlow = {
|
|
2134
2135
|
defaultState: '',
|
|
2135
2136
|
states: [],
|
|
2137
|
+
stateDescriptions: [],
|
|
2136
2138
|
transitions: [],
|
|
2137
2139
|
};
|
|
2138
2140
|
}
|
|
@@ -2145,7 +2147,7 @@ class FormStructureAndData {
|
|
|
2145
2147
|
this.name = this.name ?? definitionReceived?.form?.formCode;
|
|
2146
2148
|
this.title = (definitionReceived.form && definitionReceived.form.formTitle)
|
|
2147
2149
|
? definitionReceived.form.formTitle : '';
|
|
2148
|
-
this.setStateFlow(definitionReceived?.states, definitionReceived?.transitions, definitionReceived?.defaultState);
|
|
2150
|
+
this.setStateFlow(definitionReceived?.states, definitionReceived?.transitions, definitionReceived?.defaultState, definitionReceived?.stateDescriptions);
|
|
2149
2151
|
this.immutableData = definitionReceived.immutableData;
|
|
2150
2152
|
this.extraInfo = definitionReceived.extraInfo;
|
|
2151
2153
|
this.customAttributes = {};
|
|
@@ -2238,6 +2240,7 @@ class FormStructureAndData {
|
|
|
2238
2240
|
// Estados
|
|
2239
2241
|
get defaultState() { return this.stateFlow.defaultState; }
|
|
2240
2242
|
get states() { return this.stateFlow.states; }
|
|
2243
|
+
get stateDescriptions() { return this.stateFlow.stateDescriptions; }
|
|
2241
2244
|
supportState(state = '') { return (!!state && this.stateFlow.states?.includes(state)); }
|
|
2242
2245
|
changeState(newState) {
|
|
2243
2246
|
const currentState = this.state;
|
|
@@ -2257,8 +2260,9 @@ class FormStructureAndData {
|
|
|
2257
2260
|
return (this.state === newState);
|
|
2258
2261
|
}
|
|
2259
2262
|
get stateChange() { return this._stateChange; }
|
|
2260
|
-
setStateFlow(states, transitions, defaultState) {
|
|
2263
|
+
setStateFlow(states, transitions, defaultState, stateDescriptions = []) {
|
|
2261
2264
|
this.stateFlow.states = states;
|
|
2265
|
+
this.stateFlow.stateDescriptions = stateDescriptions;
|
|
2262
2266
|
this.stateFlow.defaultState = defaultState || this.stateFlow.states[0];
|
|
2263
2267
|
this.stateFlow.transitions = transitions.map(transition => {
|
|
2264
2268
|
const name = transition.name;
|