tuain-ng-forms-lib 12.0.23 → 12.0.24

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.
@@ -648,7 +648,7 @@
648
648
 
649
649
  var FormElement = /** @class */ (function () {
650
650
  function FormElement(elementDefinition, formConfig) {
651
- var _a, _b;
651
+ var _a, _b, _c;
652
652
  this._formConfig = formConfig;
653
653
  this._isForced = false;
654
654
  this.setVisibleStates(elementDefinition.visibleStates);
@@ -657,7 +657,11 @@
657
657
  this.disabled = (_a = elementDefinition === null || elementDefinition === void 0 ? void 0 : elementDefinition.disabled) !== null && _a !== void 0 ? _a : false;
658
658
  this.setVisibility((_b = elementDefinition === null || elementDefinition === void 0 ? void 0 : elementDefinition.visible) !== null && _b !== void 0 ? _b : true);
659
659
  this.widget = null;
660
+ this.customAttributes = (_c = elementDefinition === null || elementDefinition === void 0 ? void 0 : elementDefinition.customAttributes) !== null && _c !== void 0 ? _c : null;
660
661
  }
662
+ FormElement.prototype.getCustomAttribute = function (name) { var _a, _b; return (_b = (_a = this.customAttributes) === null || _a === void 0 ? void 0 : _a[name]) !== null && _b !== void 0 ? _b : null; };
663
+ FormElement.prototype.setCustomAttribute = function (name, value) { return name && (this.customAttributes[name] = value); };
664
+ FormElement.prototype.matchAttribute = function (name, value) { var _a; return ((_a = this.customAttributes) === null || _a === void 0 ? void 0 : _a[name]) === value; };
661
665
  FormElement.prototype.isField = function () { return this.elementType === elementTypes.field; };
662
666
  FormElement.prototype.isAction = function () { return this.elementType === elementTypes.action; };
663
667
  FormElement.prototype.isTable = function () { return this.elementType === elementTypes.table; };
@@ -675,7 +679,13 @@
675
679
  };
676
680
  FormElement.prototype.viewOnState = function (state) { return (this.visibleStates && state) ? this.visibleStates.includes(state) : false; };
677
681
  FormElement.prototype.enabledOnState = function (state) { return (this.enabledStates && state) ? this.enabledStates.includes(state) : false; };
682
+ /**
683
+ * @deprecated Utilizar viewOnState
684
+ */
678
685
  FormElement.prototype.supportState = function (state) { return this.viewOnState(state); };
686
+ /**
687
+ * @deprecated Utilizar viewOnState
688
+ */
679
689
  FormElement.prototype.supportMode = function (state) { return this.viewOnState(state); };
680
690
  Object.defineProperty(FormElement.prototype, "visible", {
681
691
  get: function () { return (this._isForced) ? this._visibleForced : this._visible; },
@@ -768,62 +778,6 @@
768
778
  return TableAction;
769
779
  }());
770
780
 
771
- function formatCurrency(inputValue) {
772
- if (!inputValue) {
773
- return null;
774
- }
775
- var numeralDecimalMark = '.';
776
- var numeralPositiveOnly = false;
777
- var stripLeadingZeroes = true;
778
- var numeralIntegerScale = 12;
779
- var numeralDecimalScale = 2;
780
- var delimiter = ',';
781
- var parts;
782
- var partInteger;
783
- var partDecimal = '';
784
- // Se eliminan los caracteres alfabéticos
785
- var outputValue = inputValue.toString();
786
- if (!outputValue) {
787
- return;
788
- }
789
- /**
790
- * Se remplaza el primer caracter de marca decimal con el marcador reservado
791
- * Se eliminan los caractertes no numéricos excepto el signo menos y 'M'
792
- * utilizado como separador decimal en este punto, eliminando los prefijos
793
- * Se remplaza el caracter menos por un marcador resertvado
794
- * Se eliminan todos los demás caracteres menos en caso de estar presentes
795
- * Se remplaza el marcador de caracter menos (si está presente)
796
- * Se remplaza el marcador de separación decimal
797
- */
798
- var value = outputValue.replace(/[A-Za-z]/g, '')
799
- .replace(numeralDecimalMark, 'M')
800
- .replace(/[^\dM-]/g, '')
801
- .replace(/^\-/, 'N')
802
- .replace(/\-/g, '')
803
- .replace('N', numeralPositiveOnly ? '' : '-')
804
- .replace('M', numeralDecimalMark);
805
- // Se eliminan los ceros a la izquierda
806
- if (stripLeadingZeroes) {
807
- value = value.replace(/^(-)?0+(?=\d)/, '$1');
808
- }
809
- // Se separa la parte entera de la parte decimal
810
- partInteger = value;
811
- if (value.indexOf(numeralDecimalMark) >= 0) {
812
- parts = value.split(numeralDecimalMark);
813
- partInteger = parts[0];
814
- partDecimal = numeralDecimalMark + parts[1].slice(0, numeralDecimalScale);
815
- }
816
- if (numeralIntegerScale > 0) {
817
- partInteger = partInteger.slice(0, numeralIntegerScale + (value.slice(0, 1) === '-' ? 1 : 0));
818
- }
819
- // Se separan los digitos de acuerdo a la configuraciñon de agrupación
820
- partInteger = partInteger.replace(/(\d)(?=(\d{3})+$)/g, '$1' + delimiter);
821
- outputValue = partInteger.toString() + (numeralDecimalScale > 0 ? partDecimal.toString() : '');
822
- return outputValue;
823
- }
824
-
825
- var DATE_TYPE = 'DATE';
826
- var CURRENCY_TYPE = 'CURRENCY';
827
781
  var TableRecordData = /** @class */ (function () {
828
782
  function TableRecordData(recordReceived, recordDefinition, selectionFieldName) {
829
783
  var _this = this;
@@ -842,8 +796,7 @@
842
796
  rawRecordData.forEach(function (fieldData) {
843
797
  var fieldCode = fieldData.fieldCode, fieldValue = fieldData.fieldValue;
844
798
  var fieldDef = recordDefinition.find(function (column) { return column.fieldCode === fieldCode; });
845
- var formattedFieldValue = _this.formatFieldValue(fieldDef.fieldType, fieldValue);
846
- _this.recordData[fieldCode] = formattedFieldValue;
799
+ _this.recordData[fieldCode] = fieldValue !== null && fieldValue !== void 0 ? fieldValue : '';
847
800
  if (fieldCode === selectionFieldName) {
848
801
  _this.selected = fieldValue;
849
802
  }
@@ -854,29 +807,13 @@
854
807
  fields.forEach(function (fieldCode) {
855
808
  var fieldValue = recordData[fieldCode];
856
809
  var fieldDef = recordDefinition.find(function (column) { return column.fieldCode === fieldCode; });
857
- var formattedFieldValue = _this.formatFieldValue(fieldDef.fieldType, fieldValue);
858
- _this.recordData[fieldCode] = formattedFieldValue;
810
+ _this.recordData[fieldCode] = fieldValue !== null && fieldValue !== void 0 ? fieldValue : '';
859
811
  });
860
812
  }
861
813
  }
862
- TableRecordData.prototype.formatFieldValue = function (fieldType, fieldValue) {
863
- if (fieldType === CURRENCY_TYPE) {
864
- return formatCurrency(fieldValue);
865
- }
866
- else if (fieldType === DATE_TYPE && fieldValue) {
867
- return new Date(fieldValue).toISOString().split('T')[0];
868
- }
869
- return fieldValue || '';
870
- };
871
- TableRecordData.prototype.toggleSelect = function () {
872
- this.selected = !this.selected;
873
- };
874
- TableRecordData.prototype.select = function () {
875
- this.selected = true;
876
- };
877
- TableRecordData.prototype.unselect = function () {
878
- this.selected = false;
879
- };
814
+ TableRecordData.prototype.toggleSelect = function () { this.selected = !this.selected; };
815
+ TableRecordData.prototype.select = function () { this.selected = true; };
816
+ TableRecordData.prototype.unselect = function () { this.selected = false; };
880
817
  Object.defineProperty(TableRecordData.prototype, "recordIdKey", {
881
818
  get: function () {
882
819
  return (typeof this.recordId === 'object')
@@ -985,9 +922,9 @@
985
922
  var RecordTable = /** @class */ (function (_super) {
986
923
  __extends(RecordTable, _super);
987
924
  function RecordTable(tableReceived, formConfig) {
988
- var e_1, _h, e_2, _j, e_3, _k;
925
+ var e_1, _g, e_2, _h, e_3, _j;
989
926
  var _this = this;
990
- var _a, _b, _c, _d, _e, _f, _g;
927
+ var _a, _b, _c, _d, _e, _f;
991
928
  _this = _super.call(this, tableReceived, formConfig) || this;
992
929
  _this._inlineActionTrigger = new rxjs.Subject();
993
930
  _this._globalActionTrigger = new rxjs.Subject();
@@ -1020,15 +957,14 @@
1020
957
  _this._appendPages = (_c = tableReceived === null || tableReceived === void 0 ? void 0 : tableReceived.append) !== null && _c !== void 0 ? _c : false;
1021
958
  _this.selectable = (_d = tableReceived === null || tableReceived === void 0 ? void 0 : tableReceived.selectable) !== null && _d !== void 0 ? _d : false;
1022
959
  _this.setAttr('selectionBackend', (_e = tableReceived === null || tableReceived === void 0 ? void 0 : tableReceived.selectionBackend) !== null && _e !== void 0 ? _e : false);
1023
- _this.customAttributes = (_f = tableReceived === null || tableReceived === void 0 ? void 0 : tableReceived.customAttributes) !== null && _f !== void 0 ? _f : {};
1024
- _this.setAttr('sortable', (_g = tableReceived === null || tableReceived === void 0 ? void 0 : tableReceived.sortable) !== null && _g !== void 0 ? _g : false);
960
+ _this.setAttr('sortable', (_f = tableReceived === null || tableReceived === void 0 ? void 0 : tableReceived.sortable) !== null && _f !== void 0 ? _f : false);
1025
961
  _this.setAttr('sorting', { columnName: '', direction: '' });
1026
962
  _this.setAttr('recordsPerPage', formConfig.defaultRecordsPerPage);
1027
963
  if (tableReceived.fields) {
1028
964
  var columns = [];
1029
965
  try {
1030
- for (var _l = __values(tableReceived.fields), _m = _l.next(); !_m.done; _m = _l.next()) {
1031
- var columnReceived = _m.value;
966
+ for (var _k = __values(tableReceived.fields), _l = _k.next(); !_l.done; _l = _k.next()) {
967
+ var columnReceived = _l.value;
1032
968
  var columnDefinition = new RecordTableColumn(columnReceived, _this._formConfig);
1033
969
  columns.push(columnDefinition);
1034
970
  _this._tableColumnObj[columnDefinition.fieldCode] = columnDefinition;
@@ -1037,7 +973,7 @@
1037
973
  catch (e_1_1) { e_1 = { error: e_1_1 }; }
1038
974
  finally {
1039
975
  try {
1040
- if (_m && !_m.done && (_h = _l.return)) _h.call(_l);
976
+ if (_l && !_l.done && (_g = _k.return)) _g.call(_k);
1041
977
  }
1042
978
  finally { if (e_1) throw e_1.error; }
1043
979
  }
@@ -1068,7 +1004,7 @@
1068
1004
  catch (e_2_1) { e_2 = { error: e_2_1 }; }
1069
1005
  finally {
1070
1006
  try {
1071
- if (tableActions_1_1 && !tableActions_1_1.done && (_j = tableActions_1.return)) _j.call(tableActions_1);
1007
+ if (tableActions_1_1 && !tableActions_1_1.done && (_h = tableActions_1.return)) _h.call(tableActions_1);
1072
1008
  }
1073
1009
  finally { if (e_2) throw e_2.error; }
1074
1010
  }
@@ -1077,8 +1013,8 @@
1077
1013
  _this.setAttr('complexFilter', true);
1078
1014
  var filterConfig = _this.filterConfig;
1079
1015
  try {
1080
- for (var _o = __values(tableReceived.filters), _p = _o.next(); !_p.done; _p = _o.next()) {
1081
- var filterReceived = _p.value;
1016
+ for (var _m = __values(tableReceived.filters), _o = _m.next(); !_o.done; _o = _m.next()) {
1017
+ var filterReceived = _o.value;
1082
1018
  var filterItem = new FieldSearch(filterReceived);
1083
1019
  filterConfig.push(filterItem);
1084
1020
  }
@@ -1086,7 +1022,7 @@
1086
1022
  catch (e_3_1) { e_3 = { error: e_3_1 }; }
1087
1023
  finally {
1088
1024
  try {
1089
- if (_p && !_p.done && (_k = _o.return)) _k.call(_o);
1025
+ if (_o && !_o.done && (_j = _m.return)) _j.call(_m);
1090
1026
  }
1091
1027
  finally { if (e_3) throw e_3.error; }
1092
1028
  }
@@ -1238,7 +1174,7 @@
1238
1174
  this.tableRecords.forEach(function (record) { return record.unselect(); });
1239
1175
  };
1240
1176
  RecordTable.prototype.setTableRecords = function (tableRecords, append) {
1241
- var e_4, _h;
1177
+ var e_4, _g;
1242
1178
  var _a;
1243
1179
  if (!append) {
1244
1180
  this.clean();
@@ -1257,7 +1193,7 @@
1257
1193
  catch (e_4_1) { e_4 = { error: e_4_1 }; }
1258
1194
  finally {
1259
1195
  try {
1260
- if (tableRecords_1_1 && !tableRecords_1_1.done && (_h = tableRecords_1.return)) _h.call(tableRecords_1);
1196
+ if (tableRecords_1_1 && !tableRecords_1_1.done && (_g = tableRecords_1.return)) _g.call(tableRecords_1);
1261
1197
  }
1262
1198
  finally { if (e_4) throw e_4.error; }
1263
1199
  }
@@ -1783,8 +1719,9 @@
1783
1719
 
1784
1720
  var RecordFormSection = /** @class */ (function () {
1785
1721
  function RecordFormSection(sectionReceived, formObject) {
1786
- var e_1, _a;
1722
+ var e_1, _c;
1787
1723
  var _this = this;
1724
+ var _a;
1788
1725
  this._activation = new rxjs.Subject();
1789
1726
  this._inactivation = new rxjs.Subject();
1790
1727
  this.active = false;
@@ -1828,12 +1765,21 @@
1828
1765
  catch (e_1_1) { e_1 = { error: e_1_1 }; }
1829
1766
  finally {
1830
1767
  try {
1831
- if (subsections_1_1 && !subsections_1_1.done && (_a = subsections_1.return)) _a.call(subsections_1);
1768
+ if (subsections_1_1 && !subsections_1_1.done && (_c = subsections_1.return)) _c.call(subsections_1);
1832
1769
  }
1833
1770
  finally { if (e_1) throw e_1.error; }
1834
1771
  }
1835
1772
  }
1773
+ this.customAttributes = (_a = sectionReceived === null || sectionReceived === void 0 ? void 0 : sectionReceived.customAttributes) !== null && _a !== void 0 ? _a : null;
1836
1774
  }
1775
+ RecordFormSection.prototype.getCustomAttribute = function (name) { var _a, _b; return (_b = (_a = this.customAttributes) === null || _a === void 0 ? void 0 : _a[name]) !== null && _b !== void 0 ? _b : null; };
1776
+ RecordFormSection.prototype.setCustomAttribute = function (name, value) { return name && (this.customAttributes[name] = value); };
1777
+ RecordFormSection.prototype.matchAttribute = function (name, value) { var _a; return ((_a = this.customAttributes) === null || _a === void 0 ? void 0 : _a[name]) === value; };
1778
+ Object.defineProperty(RecordFormSection.prototype, "code", {
1779
+ get: function () { return this.sectionCode; },
1780
+ enumerable: false,
1781
+ configurable: true
1782
+ });
1837
1783
  Object.defineProperty(RecordFormSection.prototype, "activation", {
1838
1784
  get: function () { return this._activation; },
1839
1785
  enumerable: false,
@@ -1874,19 +1820,19 @@
1874
1820
  ? this.subSectionsObj[subSectionCode] : null;
1875
1821
  };
1876
1822
  RecordFormSection.prototype.getFields = function () {
1877
- var e_2, _a;
1823
+ var e_2, _c;
1878
1824
  var fieldsArray = [];
1879
1825
  if (this.subSections && this.subSections.length > 0) {
1880
1826
  try {
1881
- for (var _b = __values(this.subSections), _c = _b.next(); !_c.done; _c = _b.next()) {
1882
- var subSection = _c.value;
1827
+ for (var _d = __values(this.subSections), _e = _d.next(); !_e.done; _e = _d.next()) {
1828
+ var subSection = _e.value;
1883
1829
  fieldsArray = fieldsArray.concat(subSection.getFields());
1884
1830
  }
1885
1831
  }
1886
1832
  catch (e_2_1) { e_2 = { error: e_2_1 }; }
1887
1833
  finally {
1888
1834
  try {
1889
- if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
1835
+ if (_e && !_e.done && (_c = _d.return)) _c.call(_d);
1890
1836
  }
1891
1837
  finally { if (e_2) throw e_2.error; }
1892
1838
  }
@@ -1894,19 +1840,19 @@
1894
1840
  return fieldsArray;
1895
1841
  };
1896
1842
  RecordFormSection.prototype.getFieldNames = function () {
1897
- var e_3, _a;
1843
+ var e_3, _c;
1898
1844
  var fieldsArray = [];
1899
1845
  if (this.subSections && this.subSections.length > 0) {
1900
1846
  try {
1901
- for (var _b = __values(this.subSections), _c = _b.next(); !_c.done; _c = _b.next()) {
1902
- var subSection = _c.value;
1847
+ for (var _d = __values(this.subSections), _e = _d.next(); !_e.done; _e = _d.next()) {
1848
+ var subSection = _e.value;
1903
1849
  fieldsArray = fieldsArray.concat(subSection.getFieldNames());
1904
1850
  }
1905
1851
  }
1906
1852
  catch (e_3_1) { e_3 = { error: e_3_1 }; }
1907
1853
  finally {
1908
1854
  try {
1909
- if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
1855
+ if (_e && !_e.done && (_c = _d.return)) _c.call(_d);
1910
1856
  }
1911
1857
  finally { if (e_3) throw e_3.error; }
1912
1858
  }
@@ -1914,12 +1860,12 @@
1914
1860
  return fieldsArray;
1915
1861
  };
1916
1862
  RecordFormSection.prototype.getField = function (name) {
1917
- var e_4, _a;
1863
+ var e_4, _c;
1918
1864
  var field = null;
1919
1865
  if (this.subSections && this.subSections.length > 0) {
1920
1866
  try {
1921
- for (var _b = __values(this.subSections), _c = _b.next(); !_c.done; _c = _b.next()) {
1922
- var subSection = _c.value;
1867
+ for (var _d = __values(this.subSections), _e = _d.next(); !_e.done; _e = _d.next()) {
1868
+ var subSection = _e.value;
1923
1869
  field = subSection.getField(name);
1924
1870
  if (field) {
1925
1871
  return field;
@@ -1929,7 +1875,7 @@
1929
1875
  catch (e_4_1) { e_4 = { error: e_4_1 }; }
1930
1876
  finally {
1931
1877
  try {
1932
- if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
1878
+ if (_e && !_e.done && (_c = _d.return)) _c.call(_d);
1933
1879
  }
1934
1880
  finally { if (e_4) throw e_4.error; }
1935
1881
  }
@@ -1947,7 +1893,7 @@
1947
1893
  __extends(FormAction, _super);
1948
1894
  function FormAction(actionDefinition, formConfig) {
1949
1895
  var _this = this;
1950
- var _a, _b;
1896
+ var _a;
1951
1897
  _this = _super.call(this, actionDefinition, formConfig) || this;
1952
1898
  _this._actionActivated = new rxjs.Subject();
1953
1899
  _this.inProgress = false;
@@ -1955,10 +1901,9 @@
1955
1901
  _this.actionCode = actionDefinition.actionCode ? actionDefinition.actionCode.toString() : '';
1956
1902
  _this.actionName = actionDefinition.actionTitle;
1957
1903
  _this.iconName = actionDefinition.iconName || _this.actionCode;
1958
- _this.location = actionDefinition.position || HEADER;
1904
+ _this.setCustomAttribute('location', actionDefinition.position || HEADER);
1959
1905
  _this.backend = (_a = actionDefinition === null || actionDefinition === void 0 ? void 0 : actionDefinition.serverAction) !== null && _a !== void 0 ? _a : false;
1960
1906
  _this.newState = actionDefinition === null || actionDefinition === void 0 ? void 0 : actionDefinition.newState;
1961
- _this.customAttributes = (_b = actionDefinition === null || actionDefinition === void 0 ? void 0 : actionDefinition.customAttributes) !== null && _b !== void 0 ? _b : null;
1962
1907
  _this.restrictedOnField = actionDefinition.fieldRestrictedCode ? actionDefinition.fieldRestrictedCode.toString() : '';
1963
1908
  _this.restrictedOnOperator = actionDefinition.operatorRestricted || '';
1964
1909
  _this.restrictedOnValue = actionDefinition.valueRestricted || '';
@@ -2002,7 +1947,6 @@
2002
1947
  info: 'fieldInfo',
2003
1948
  defaultValue: 'defaultValue',
2004
1949
  defaultEditable: 'defaultEditable',
2005
- customAttributes: 'customAttributes',
2006
1950
  visibleLabel: 'visibleLabel',
2007
1951
  required: 'fieldRequired',
2008
1952
  hasChanged: 'hasChanged',
@@ -2023,7 +1967,7 @@
2023
1967
  __extends(FieldDescriptor, _super);
2024
1968
  function FieldDescriptor(inputFieldReceived, formConfig) {
2025
1969
  var _this = this;
2026
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
1970
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
2027
1971
  _this = _super.call(this, inputFieldReceived, formConfig) || this;
2028
1972
  _this._editionFinish = new rxjs.Subject();
2029
1973
  _this._editionPartial = new rxjs.Subject();
@@ -2049,18 +1993,17 @@
2049
1993
  }
2050
1994
  _this.setAttr(fldAttr.format, fieldFormat);
2051
1995
  _this.setAttr(fldAttr.validateOnServer, (_d = fld.serverAction) !== null && _d !== void 0 ? _d : false);
2052
- _this.setAttr(fldAttr.customAttributes, (_e = fld.customAttributes) !== null && _e !== void 0 ? _e : {});
2053
1996
  _this.setAttr(fldAttr.tooltipText, fld.tooltip || '');
2054
1997
  _this.setAttr(fldAttr.defaultEditable, _this.enabled);
2055
- _this.setAttr(fldAttr.required, (_f = fld.required) !== null && _f !== void 0 ? _f : false);
2056
- _this.setError(fld.errorCode, fld.errorMessage, (_g = fld.errorType) !== null && _g !== void 0 ? _g : DEFAULT_ERROR_TYPE);
2057
- _this.setAttr(fldAttr.outputOnly, (_h = fld.outputOnly) !== null && _h !== void 0 ? _h : false);
2058
- var maxLength = (_j = fld.maxLength) !== null && _j !== void 0 ? _j : (_this.captureType === 'TEXTAREA' ? BIG_MAX_LENGTH : STD_MAX_LENGTH);
1998
+ _this.setAttr(fldAttr.required, (_e = fld.required) !== null && _e !== void 0 ? _e : false);
1999
+ _this.setError(fld.errorCode, fld.errorMessage, (_f = fld.errorType) !== null && _f !== void 0 ? _f : DEFAULT_ERROR_TYPE);
2000
+ _this.setAttr(fldAttr.outputOnly, (_g = fld.outputOnly) !== null && _g !== void 0 ? _g : false);
2001
+ var maxLength = (_h = fld.maxLength) !== null && _h !== void 0 ? _h : (_this.captureType === 'TEXTAREA' ? BIG_MAX_LENGTH : STD_MAX_LENGTH);
2059
2002
  _this.setAttr(fldAttr.maxLength, maxLength);
2060
- _this.setAttr(fldAttr.intrinsicErrorMessage, (_k = _this._formConfig.fieldTypeErrMsg[_this.fieldType]) !== null && _k !== void 0 ? _k : _this._formConfig.fieldTypeErrMsg.DEFAULT);
2003
+ _this.setAttr(fldAttr.intrinsicErrorMessage, (_j = _this._formConfig.fieldTypeErrMsg[_this.fieldType]) !== null && _j !== void 0 ? _j : _this._formConfig.fieldTypeErrMsg.DEFAULT);
2061
2004
  _this.setFieldType(fld.fieldTypeCode);
2062
- _this.setEditable((_l = fld.editable) !== null && _l !== void 0 ? _l : true);
2063
- _this.setVisibleLabel((_m = fld.visibleLabel) !== null && _m !== void 0 ? _m : true);
2005
+ _this.setEditable((_k = fld.editable) !== null && _k !== void 0 ? _k : true);
2006
+ _this.setVisibleLabel((_l = fld.visibleLabel) !== null && _l !== void 0 ? _l : true);
2064
2007
  _this.setVisibility(fld.visible);
2065
2008
  _this.setFieldOptions(fld.fieldOptions);
2066
2009
  _this.setValue(fld.fieldValue || _this.defaultValue || '');
@@ -2160,7 +2103,6 @@
2160
2103
  FieldDescriptor.prototype.notifyEditionDetailRequest = function () {
2161
2104
  this._detailRequest.next(this.fieldCode);
2162
2105
  };
2163
- FieldDescriptor.prototype.getCustomAttribute = function (name) { var _a, _b; return (_b = (_a = this.customAttributes) === null || _a === void 0 ? void 0 : _a[name]) !== null && _b !== void 0 ? _b : null; };
2164
2106
  FieldDescriptor.prototype.setVisibleLabel = function (visibleLabel) { this.setAttr(fldAttr.visibleLabel, visibleLabel); };
2165
2107
  FieldDescriptor.prototype.showLabel = function () { this.setVisibleLabel(true); };
2166
2108
  FieldDescriptor.prototype.hideLabel = function () { this.setVisibleLabel(false); };
@@ -2252,11 +2194,6 @@
2252
2194
  FieldDescriptor.prototype.setFieldType = function (inputFieldType) {
2253
2195
  this.setAttr(fldAttr.type, inputFieldType);
2254
2196
  };
2255
- FieldDescriptor.prototype.format = function () {
2256
- if (this.fieldType === this._formConfig.fieldTypes.currency) {
2257
- this.setAttr(fldAttr.value, formatCurrency(this._fieldValue));
2258
- }
2259
- };
2260
2197
  FieldDescriptor.prototype.setMinValue = function (minValue) {
2261
2198
  var _a, _b, _c;
2262
2199
  if (this.fieldType === this._formConfig.fieldTypes.date
@@ -2368,9 +2305,6 @@
2368
2305
  (_a = this.widget) === null || _a === void 0 ? void 0 : _a.setLocation(latitude, longitude);
2369
2306
  }
2370
2307
  break;
2371
- case this._formConfig.fieldTypes.currency:
2372
- newFinalValue = formatCurrency(newValue);
2373
- break;
2374
2308
  default:
2375
2309
  newFinalValue = newValue;
2376
2310
  break;
@@ -2384,22 +2318,29 @@
2384
2318
  return FieldDescriptor;
2385
2319
  }(FormElement));
2386
2320
 
2321
+ var ACTIVE = 'active';
2322
+ var SHOW = 'show';
2323
+ var HIDE = 'hide';
2324
+ var ENABLE = 'enable';
2325
+ var DISABLE = 'disable';
2326
+ var CLEAN = 'clean';
2387
2327
  var FormStructureAndData = /** @class */ (function () {
2388
2328
  function FormStructureAndData(definitionReceived, formConfig) {
2389
2329
  var e_1, _d, e_2, _e, e_3, _f, e_4, _g;
2390
2330
  var _this = this;
2391
- this._fieldsObj = {};
2392
- this._actionsObj = {};
2393
- this._tableObj = {};
2394
- this._sectionsObj = {};
2331
+ this._fields = {};
2332
+ this._actions = {};
2333
+ this._tables = {};
2334
+ this._sections = {};
2395
2335
  this._immutableData = {};
2396
2336
  this._extraInfo = {};
2337
+ this._exclusiveSectionsByAttr = {};
2397
2338
  this._formConfig = formConfig;
2398
2339
  this.state = '';
2399
- this._actions = [];
2400
- this._fields = [];
2401
- this._tables = [];
2402
- this._sections = [];
2340
+ this._actionArray = [];
2341
+ this._fieldArray = [];
2342
+ this._tableArray = [];
2343
+ this._sectionArray = [];
2403
2344
  this._stateFlow = {
2404
2345
  defaultState: '',
2405
2346
  states: [],
@@ -2433,8 +2374,8 @@
2433
2374
  var globalAction = new FormAction(actionReceived, this._formConfig);
2434
2375
  var globalActionCode = globalAction.actionCode;
2435
2376
  if (globalActionCode) {
2436
- this._actions.push(globalAction);
2437
- this._actionsObj[globalActionCode] = globalAction;
2377
+ this._actionArray.push(globalAction);
2378
+ this._actions[globalActionCode] = globalAction;
2438
2379
  }
2439
2380
  }
2440
2381
  }
@@ -2464,8 +2405,8 @@
2464
2405
  var fieldToAdd = new FieldDescriptor(fieldReceived, this._formConfig);
2465
2406
  var fieldCode = fieldToAdd.fieldCode;
2466
2407
  if (fieldCode) {
2467
- this._fields.push(fieldToAdd);
2468
- this._fieldsObj[fieldCode] = fieldToAdd;
2408
+ this._fieldArray.push(fieldToAdd);
2409
+ this._fields[fieldCode] = fieldToAdd;
2469
2410
  }
2470
2411
  }
2471
2412
  }
@@ -2498,8 +2439,8 @@
2498
2439
  var tableToAdd = new RecordTable(tableReceived, this._formConfig);
2499
2440
  var tableCode = tableToAdd.tableCode;
2500
2441
  if (tableCode) {
2501
- this._tables.push(tableToAdd);
2502
- this._tableObj[tableCode] = tableToAdd;
2442
+ this._tableArray.push(tableToAdd);
2443
+ this._tables[tableCode] = tableToAdd;
2503
2444
  }
2504
2445
  }
2505
2446
  }
@@ -2527,8 +2468,8 @@
2527
2468
  var sectionToAdd = new RecordFormSection(sectionReceived, this);
2528
2469
  var sectionCode = sectionToAdd.sectionCode;
2529
2470
  if (sectionCode) {
2530
- this._sections.push(sectionToAdd);
2531
- this._sectionsObj[sectionCode] = sectionToAdd;
2471
+ this._sectionArray.push(sectionToAdd);
2472
+ this._sections[sectionCode] = sectionToAdd;
2532
2473
  }
2533
2474
  }
2534
2475
  }
@@ -2541,51 +2482,28 @@
2541
2482
  }
2542
2483
  }
2543
2484
  }
2544
- Object.defineProperty(FormStructureAndData.prototype, "immutableData", {
2545
- get: function () {
2546
- var data = {};
2547
- var objectNames = Object.keys(this._immutableData);
2548
- for (var index = 0; index < objectNames.length; index++) {
2549
- var name = objectNames[index];
2550
- data[name] = this.getImmutableElement(name);
2551
- }
2552
- return data;
2553
- },
2554
- set: function (immutableData) { Object.assign(this._immutableData, immutableData); },
2555
- enumerable: false,
2556
- configurable: true
2557
- });
2558
- Object.defineProperty(FormStructureAndData.prototype, "extraInfo", {
2559
- get: function () {
2560
- var data = {};
2561
- var objectNames = Object.keys(this._extraInfo);
2562
- for (var index = 0; index < objectNames.length; index++) {
2563
- var name = objectNames[index];
2564
- data[name] = this.getExtraInfo(name);
2565
- }
2566
- return data;
2567
- },
2568
- set: function (extraInfo) { Object.assign(this._extraInfo, extraInfo); },
2485
+ FormStructureAndData.prototype.getTitle = function () { return this._title; };
2486
+ FormStructureAndData.prototype.setTitle = function (title) { this._title = title; };
2487
+ Object.defineProperty(FormStructureAndData.prototype, "name", {
2488
+ get: function () { return this._name; },
2489
+ set: function (name) { this._name = name; },
2569
2490
  enumerable: false,
2570
2491
  configurable: true
2571
2492
  });
2572
2493
  Object.defineProperty(FormStructureAndData.prototype, "defaultState", {
2494
+ // Estados
2573
2495
  get: function () { return this._stateFlow.defaultState; },
2574
2496
  enumerable: false,
2575
2497
  configurable: true
2576
2498
  });
2577
- Object.defineProperty(FormStructureAndData.prototype, "title", {
2578
- get: function () { return this._title; },
2579
- set: function (title) { this._title = title; },
2580
- enumerable: false,
2581
- configurable: true
2582
- });
2583
- Object.defineProperty(FormStructureAndData.prototype, "name", {
2584
- get: function () { return this._name; },
2585
- set: function (name) { this._name = name; },
2499
+ FormStructureAndData.prototype.supportState = function (state) { var _a; return (_a = this._stateFlow.states) === null || _a === void 0 ? void 0 : _a.includes(state); };
2500
+ FormStructureAndData.prototype.supportMode = function (state) { return this.supportState(state); };
2501
+ Object.defineProperty(FormStructureAndData.prototype, "states", {
2502
+ get: function () { return this._stateFlow.states; },
2586
2503
  enumerable: false,
2587
2504
  configurable: true
2588
2505
  });
2506
+ FormStructureAndData.prototype.getCurrentState = function () { return this.state; };
2589
2507
  FormStructureAndData.prototype.changeState = function (newState) {
2590
2508
  var _this = this;
2591
2509
  if (!newState || !this.supportState(newState)) {
@@ -2617,244 +2535,41 @@
2617
2535
  return { name: name, source: source, destination: destination };
2618
2536
  }).filter(function (item) { return item.name && item.source && item.destination; });
2619
2537
  };
2620
- FormStructureAndData.prototype.supportState = function (state) { var _a; return (_a = this._stateFlow.states) === null || _a === void 0 ? void 0 : _a.includes(state); };
2621
- FormStructureAndData.prototype.supportMode = function (state) { return this.supportState(state); };
2538
+ // immutable Data
2622
2539
  FormStructureAndData.prototype.getImmutableElement = function (name) { var _a, _b, _c; return (_c = (_b = (_a = this._immutableData) === null || _a === void 0 ? void 0 : _a[name]) === null || _b === void 0 ? void 0 : _b.value) !== null && _c !== void 0 ? _c : null; };
2623
- FormStructureAndData.prototype.getExtraInfo = function (name) { var _a, _b, _c; return (_c = (_b = (_a = this._extraInfo) === null || _a === void 0 ? void 0 : _a[name]) === null || _b === void 0 ? void 0 : _b.value) !== null && _c !== void 0 ? _c : null; };
2624
- FormStructureAndData.prototype.getFields = function () { return this._fields; };
2625
- FormStructureAndData.prototype.getStates = function () {
2626
- return this._stateFlow.states;
2627
- };
2628
- FormStructureAndData.prototype.getFieldNames = function () {
2629
- return this._fields.map(function (field) { return field.fieldCode; });
2630
- };
2631
- FormStructureAndData.prototype.getActions = function () {
2632
- return this._actions;
2633
- };
2634
- FormStructureAndData.prototype.getHeaderActions = function () {
2635
- return this._actions.filter(function (actionItem) { return actionItem.location === HEADER$1; });
2636
- };
2637
- FormStructureAndData.prototype.getFieldObject = function (elementId) {
2638
- return (this._fieldsObj && elementId && this._fieldsObj[elementId])
2639
- ? this._fieldsObj[elementId] : null;
2640
- };
2641
- FormStructureAndData.prototype.getTableObject = function (elementId) {
2642
- return (this._tableObj && elementId && this._tableObj[elementId])
2643
- ? this._tableObj[elementId] : null;
2644
- };
2645
- FormStructureAndData.prototype.getActionObject = function (elementId) {
2646
- return (this._actionsObj && elementId && this._actionsObj[elementId])
2647
- ? this._actionsObj[elementId] : null;
2648
- };
2649
- FormStructureAndData.prototype.getSubSection = function (sectionCode, subsectionCode) {
2650
- var section = (this._sectionsObj && this._sectionsObj[sectionCode])
2651
- ? this._sectionsObj[sectionCode] : null;
2652
- return (section) ? section.getSubsection(subsectionCode) : null;
2653
- };
2654
- Object.defineProperty(FormStructureAndData.prototype, "actions", {
2655
- get: function () { return this._actionsObj; },
2540
+ Object.defineProperty(FormStructureAndData.prototype, "immutableData", {
2541
+ get: function () { return JSON.parse(JSON.stringify(this._immutableData)); },
2542
+ set: function (immutableData) { Object.assign(this._immutableData, immutableData); },
2656
2543
  enumerable: false,
2657
2544
  configurable: true
2658
2545
  });
2659
- FormStructureAndData.prototype.getSection = function (sectionCode) {
2660
- return (this._sectionsObj && this._sectionsObj[sectionCode])
2661
- ? this._sectionsObj[sectionCode] : null;
2662
- };
2663
- FormStructureAndData.prototype.sections = function () { return this.getSections(); };
2664
- FormStructureAndData.prototype.sectionTitles = function () { return this.getSectionsTitles(); };
2665
- FormStructureAndData.prototype.getSections = function () {
2666
- return this._sections;
2667
- };
2668
- Object.defineProperty(FormStructureAndData.prototype, "visibleSections", {
2669
- get: function () {
2670
- return this._sections.filter(function (sec) { return sec.visible; });
2671
- },
2546
+ // extra Info
2547
+ FormStructureAndData.prototype.getExtraInfo = function (name) { var _a, _b, _c; return (_c = (_b = (_a = this._extraInfo) === null || _a === void 0 ? void 0 : _a[name]) === null || _b === void 0 ? void 0 : _b.value) !== null && _c !== void 0 ? _c : null; };
2548
+ Object.defineProperty(FormStructureAndData.prototype, "extraInfo", {
2549
+ get: function () { return JSON.parse(JSON.stringify(this._extraInfo)); },
2550
+ set: function (extraInfo) { Object.assign(this._extraInfo, extraInfo); },
2672
2551
  enumerable: false,
2673
2552
  configurable: true
2674
2553
  });
2675
- FormStructureAndData.prototype.numSections = function () {
2676
- return this._sections.length;
2677
- };
2678
- FormStructureAndData.prototype.getSectionsTitles = function () {
2679
- return this._sections.map(function (formSection) { return formSection.sectionTitle; });
2680
- };
2681
- FormStructureAndData.prototype.getSectionObject = function (elementId) {
2682
- return (this._sectionsObj && elementId && this._sectionsObj[elementId])
2683
- ? this._sectionsObj[elementId] : null;
2684
- };
2685
- FormStructureAndData.prototype.tables = function () { return this.getTables(); };
2686
- FormStructureAndData.prototype.getTables = function () {
2687
- return this._tables;
2688
- };
2689
- FormStructureAndData.prototype.cleanData = function () {
2690
- var e_5, _d, e_6, _e;
2691
- if (this._fields) {
2692
- try {
2693
- for (var _f = __values(this._fields), _g = _f.next(); !_g.done; _g = _f.next()) {
2694
- var recordField = _g.value;
2695
- recordField.setValue(recordField.defaultValue);
2696
- }
2697
- }
2698
- catch (e_5_1) { e_5 = { error: e_5_1 }; }
2699
- finally {
2700
- try {
2701
- if (_g && !_g.done && (_d = _f.return)) _d.call(_f);
2702
- }
2703
- finally { if (e_5) throw e_5.error; }
2704
- }
2705
- }
2706
- if (this._tables) {
2707
- try {
2708
- for (var _h = __values(this._tables), _j = _h.next(); !_j.done; _j = _h.next()) {
2709
- var formTable = _j.value;
2710
- formTable.clean();
2711
- }
2712
- }
2713
- catch (e_6_1) { e_6 = { error: e_6_1 }; }
2714
- finally {
2715
- try {
2716
- if (_j && !_j.done && (_e = _h.return)) _e.call(_h);
2717
- }
2718
- finally { if (e_6) throw e_6.error; }
2719
- }
2720
- }
2721
- };
2722
- FormStructureAndData.prototype.showSection = function (sectionCode) {
2723
- var sectionObject = this.getSectionObject(sectionCode);
2724
- return (sectionObject) ? sectionObject.show() : null;
2725
- };
2726
- FormStructureAndData.prototype.hideSection = function (sectionCode) {
2727
- var sectionObject = this.getSectionObject(sectionCode);
2728
- return (sectionObject) ? sectionObject.hide() : null;
2729
- };
2730
- FormStructureAndData.prototype.activeSection = function () {
2731
- var activeSection = this._sections.find(function (sectionObj) { return sectionObj.active; });
2732
- return activeSection.sectionCode;
2733
- };
2734
- FormStructureAndData.prototype.activateSection = function (sectionCode) {
2735
- this._sections.forEach(function (sectionObj) {
2736
- if (sectionObj) {
2737
- sectionObj.inactivate();
2738
- }
2739
- });
2740
- var sectionObject = this.getSectionObject(sectionCode);
2741
- return (sectionObject) ? sectionObject.activate() : null;
2742
- };
2743
- FormStructureAndData.prototype.showSections = function (sectionArray) {
2744
- var _this = this;
2745
- var sectionNames = (Array.isArray(sectionArray)) ? sectionArray : [sectionArray];
2746
- sectionNames.forEach(function (sectionCode) { return _this.showSection(sectionCode); });
2747
- };
2748
- FormStructureAndData.prototype.hideSections = function (sectionArray) {
2749
- var _this = this;
2750
- var sectionNames = (Array.isArray(sectionArray)) ? sectionArray : [sectionArray];
2751
- sectionNames.forEach(function (sectionCode) { return _this.hideSection(sectionCode); });
2752
- };
2753
- FormStructureAndData.prototype.showSubSection = function (sectionCode, subSectionCode) {
2754
- var sectionObject = this.getSectionObject(sectionCode);
2755
- var subSectionObject = (sectionObject) ? sectionObject.getSubsection(subSectionCode) : null;
2756
- return (subSectionObject) ? subSectionObject.show() : null;
2757
- };
2758
- FormStructureAndData.prototype.hideSubSection = function (sectionCode, subSectionCode) {
2759
- var sectionObject = this.getSectionObject(sectionCode);
2760
- var subSectionObject = (sectionObject) ? sectionObject.getSubsection(subSectionCode) : null;
2761
- return (subSectionObject) ? subSectionObject.hide() : null;
2762
- };
2763
- FormStructureAndData.prototype.showSubSections = function (sectionCode, subSectionArray) {
2764
- var e_7, _d;
2765
- if (subSectionArray && subSectionArray.length > 0) {
2766
- var sectionObject = this.getSectionObject(sectionCode);
2767
- try {
2768
- for (var subSectionArray_1 = __values(subSectionArray), subSectionArray_1_1 = subSectionArray_1.next(); !subSectionArray_1_1.done; subSectionArray_1_1 = subSectionArray_1.next()) {
2769
- var subSectionCode = subSectionArray_1_1.value;
2770
- var subSectionObject = (sectionObject) ? sectionObject.getSubsection(subSectionCode) : null;
2771
- if (subSectionObject) {
2772
- subSectionObject.show();
2773
- }
2774
- }
2775
- }
2776
- catch (e_7_1) { e_7 = { error: e_7_1 }; }
2777
- finally {
2778
- try {
2779
- if (subSectionArray_1_1 && !subSectionArray_1_1.done && (_d = subSectionArray_1.return)) _d.call(subSectionArray_1);
2780
- }
2781
- finally { if (e_7) throw e_7.error; }
2782
- }
2783
- }
2784
- };
2785
- FormStructureAndData.prototype.hideSubSections = function (sectionCode, subSectionArray) {
2786
- var e_8, _d;
2787
- if (subSectionArray && subSectionArray.length > 0) {
2788
- var sectionObject = this.getSectionObject(sectionCode);
2789
- try {
2790
- for (var subSectionArray_2 = __values(subSectionArray), subSectionArray_2_1 = subSectionArray_2.next(); !subSectionArray_2_1.done; subSectionArray_2_1 = subSectionArray_2.next()) {
2791
- var subSectionCode = subSectionArray_2_1.value;
2792
- var subSectionObject = (sectionObject) ? sectionObject.getSubsection(subSectionCode) : null;
2793
- if (subSectionObject) {
2794
- subSectionObject.hide();
2795
- }
2796
- }
2797
- }
2798
- catch (e_8_1) { e_8 = { error: e_8_1 }; }
2799
- finally {
2800
- try {
2801
- if (subSectionArray_2_1 && !subSectionArray_2_1.done && (_d = subSectionArray_2.return)) _d.call(subSectionArray_2);
2802
- }
2803
- finally { if (e_8) throw e_8.error; }
2804
- }
2805
- }
2806
- };
2807
- FormStructureAndData.prototype.showAction = function (actionCode) {
2808
- var actionObject = this.getActionObject(actionCode);
2809
- return (actionObject) ? actionObject.show() : null;
2810
- };
2811
- FormStructureAndData.prototype.hideAction = function (actionCode) {
2812
- var actionObject = this.getActionObject(actionCode);
2813
- return (actionObject) ? actionObject.hide() : null;
2814
- };
2815
- FormStructureAndData.prototype.showActions = function (actionArray) {
2816
- var _this = this;
2817
- var actionNames = (Array.isArray(actionArray)) ? actionArray : [actionArray];
2818
- actionNames.forEach(function (actionCode) { return _this.showAction(actionCode); });
2819
- };
2820
- FormStructureAndData.prototype.hideActions = function (actionArray) {
2821
- var _this = this;
2822
- var actionNames = (Array.isArray(actionArray)) ? actionArray : [actionArray];
2823
- actionNames.forEach(function (actionCode) { return _this.hideAction(actionCode); });
2824
- };
2825
- FormStructureAndData.prototype.enableAction = function (actionCode) {
2826
- var actionObject = this.getActionObject(actionCode);
2827
- return (actionObject) ? actionObject.enable() : null;
2828
- };
2829
- FormStructureAndData.prototype.disableAction = function (actionCode) {
2830
- var actionObject = this.getActionObject(actionCode);
2831
- return (actionObject) ? actionObject.disable() : null;
2832
- };
2833
- FormStructureAndData.prototype.enableActions = function (actionArray) {
2834
- var _this = this;
2835
- var actionNames = (Array.isArray(actionArray)) ? actionArray : [actionArray];
2836
- actionNames.forEach(function (actionCode) { return _this.enableAction(actionCode); });
2837
- };
2838
- FormStructureAndData.prototype.disableActions = function (actionArray) {
2839
- var _this = this;
2840
- var actionNames = (Array.isArray(actionArray)) ? actionArray : [actionArray];
2841
- actionNames.forEach(function (actionCode) { return _this.disableAction(actionCode); });
2842
- };
2554
+ // Fields
2555
+ FormStructureAndData.prototype.getFields = function () { return this._fieldArray; };
2556
+ FormStructureAndData.prototype.getFieldNames = function () { return this._fieldArray.map(function (field) { return field.fieldCode; }); };
2557
+ FormStructureAndData.prototype.getField = function (elementId) { var _a; return (elementId && ((_a = this._fields) === null || _a === void 0 ? void 0 : _a[elementId])) ? this._fields[elementId] : null; };
2843
2558
  Object.defineProperty(FormStructureAndData.prototype, "fields", {
2844
- get: function () { return this._fieldsObj; },
2559
+ get: function () { return this._fields; },
2845
2560
  enumerable: false,
2846
2561
  configurable: true
2847
2562
  });
2848
2563
  FormStructureAndData.prototype.enableField = function (fieldCode) {
2849
- var fieldObject = this.getFieldObject(fieldCode);
2564
+ var fieldObject = this.getField(fieldCode);
2850
2565
  return (fieldObject) ? fieldObject.enable() : null;
2851
2566
  };
2852
2567
  FormStructureAndData.prototype.disableField = function (fieldCode) {
2853
- var fieldObject = this.getFieldObject(fieldCode);
2568
+ var fieldObject = this.getField(fieldCode);
2854
2569
  return (fieldObject) ? fieldObject.disable() : null;
2855
2570
  };
2856
2571
  FormStructureAndData.prototype.getFieldValue = function (fieldCode) {
2857
- var fieldObject = this.getFieldObject(fieldCode);
2572
+ var fieldObject = this.getField(fieldCode);
2858
2573
  return (fieldObject) ? fieldObject.getValue() : null;
2859
2574
  };
2860
2575
  FormStructureAndData.prototype.getFieldsValues = function (fieldCodesArray) {
@@ -2866,39 +2581,39 @@
2866
2581
  for (var index = 0; index < fieldCodesArray.length; index++) {
2867
2582
  var fieldCode = fieldCodesArray[index];
2868
2583
  if (fieldCode) {
2869
- resultObject[fieldCode] = (_c = (_b = (_a = this._fieldsObj) === null || _a === void 0 ? void 0 : _a[fieldCode]) === null || _b === void 0 ? void 0 : _b.getValue()) !== null && _c !== void 0 ? _c : null;
2584
+ resultObject[fieldCode] = (_c = (_b = (_a = this._fields) === null || _a === void 0 ? void 0 : _a[fieldCode]) === null || _b === void 0 ? void 0 : _b.getValue()) !== null && _c !== void 0 ? _c : null;
2870
2585
  }
2871
2586
  }
2872
2587
  return resultObject;
2873
2588
  };
2874
2589
  FormStructureAndData.prototype.getFieldOptions = function (fieldCode) {
2875
- var fieldObject = this.getFieldObject(fieldCode);
2590
+ var fieldObject = this.getField(fieldCode);
2876
2591
  return (fieldObject) ? fieldObject.getFieldOptions() : null;
2877
2592
  };
2878
2593
  FormStructureAndData.prototype.setFieldValue = function (fieldCode, fieldValue) {
2879
- var fieldObject = this.getFieldObject(fieldCode);
2594
+ var fieldObject = this.getField(fieldCode);
2880
2595
  return (fieldObject) ? fieldObject.setValue(fieldValue) : null;
2881
2596
  };
2882
2597
  FormStructureAndData.prototype.setFieldError = function (code, message, type) {
2883
2598
  if (type === void 0) { type = 'error'; }
2884
- var fieldObject = this.getFieldObject(code);
2599
+ var fieldObject = this.getField(code);
2885
2600
  return (fieldObject) ? fieldObject.setError(code, message, type) : null;
2886
2601
  };
2887
2602
  FormStructureAndData.prototype.setFieldIntrinsicErrorMessage = function (code, message) {
2888
- var fieldObject = this.getFieldObject(code);
2603
+ var fieldObject = this.getField(code);
2889
2604
  return (fieldObject) ? fieldObject.setIntrinsicErrorMessage(message) : null;
2890
2605
  };
2891
2606
  FormStructureAndData.prototype.setFieldRequired = function (fieldCode, required) {
2892
- var fieldObject = this.getFieldObject(fieldCode);
2607
+ var fieldObject = this.getField(fieldCode);
2893
2608
  return (fieldObject) ? fieldObject.required = required : null;
2894
2609
  };
2895
2610
  FormStructureAndData.prototype.setFieldErrorMessage = function (fieldCode, errorMessage) {
2896
- var fieldObject = this.getFieldObject(fieldCode);
2611
+ var fieldObject = this.getField(fieldCode);
2897
2612
  return (fieldObject) ? fieldObject.setErrorMessage(errorMessage) : null;
2898
2613
  };
2899
2614
  FormStructureAndData.prototype.setFieldOptions = function (fieldCode, optionsArray, idAttribute, nameAttribute) {
2900
- var e_9, _d;
2901
- var fieldObject = this.getFieldObject(fieldCode);
2615
+ var e_5, _d;
2616
+ var fieldObject = this.getField(fieldCode);
2902
2617
  if (fieldObject && optionsArray && optionsArray.length > 0) {
2903
2618
  var fieldOptions = [];
2904
2619
  try {
@@ -2911,12 +2626,12 @@
2911
2626
  fieldOptions.push(fieldOption);
2912
2627
  }
2913
2628
  }
2914
- catch (e_9_1) { e_9 = { error: e_9_1 }; }
2629
+ catch (e_5_1) { e_5 = { error: e_5_1 }; }
2915
2630
  finally {
2916
2631
  try {
2917
2632
  if (optionsArray_1_1 && !optionsArray_1_1.done && (_d = optionsArray_1.return)) _d.call(optionsArray_1);
2918
2633
  }
2919
- finally { if (e_9) throw e_9.error; }
2634
+ finally { if (e_5) throw e_5.error; }
2920
2635
  }
2921
2636
  fieldObject.setFieldOptions(fieldOptions);
2922
2637
  }
@@ -2931,7 +2646,7 @@
2931
2646
  fieldUniverse = fieldArray;
2932
2647
  }
2933
2648
  else if (sectionCode && !subSectionCode) {
2934
- var sectionObject = this.getSectionObject(sectionCode);
2649
+ var sectionObject = this.getSection(sectionCode);
2935
2650
  fieldUniverse = sectionObject === null || sectionObject === void 0 ? void 0 : sectionObject.getFieldNames();
2936
2651
  }
2937
2652
  else if (sectionCode && subSectionCode) {
@@ -2945,12 +2660,12 @@
2945
2660
  return fieldUniverse;
2946
2661
  }
2947
2662
  return fieldUniverse.filter(function (fld) {
2948
- var fieldObject = _this.getFieldObject(fld);
2663
+ var fieldObject = _this.getField(fld);
2949
2664
  return (fieldObject && filterFunc(fieldObject));
2950
2665
  });
2951
2666
  };
2952
2667
  FormStructureAndData.prototype.applyProcessToFieldSet = function (processFunc, fieldArray, sectionCode, subSectionCode) {
2953
- var e_10, _d;
2668
+ var e_6, _d;
2954
2669
  if (fieldArray === void 0) { fieldArray = null; }
2955
2670
  if (sectionCode === void 0) { sectionCode = null; }
2956
2671
  if (subSectionCode === void 0) { subSectionCode = null; }
@@ -2960,7 +2675,7 @@
2960
2675
  try {
2961
2676
  for (var fieldUniverse_1 = __values(fieldUniverse), fieldUniverse_1_1 = fieldUniverse_1.next(); !fieldUniverse_1_1.done; fieldUniverse_1_1 = fieldUniverse_1.next()) {
2962
2677
  var fieldCode = fieldUniverse_1_1.value;
2963
- var fieldObject = this.getFieldObject(fieldCode);
2678
+ var fieldObject = this.getField(fieldCode);
2964
2679
  if (fieldObject) {
2965
2680
  try {
2966
2681
  processFunc(fieldObject);
@@ -2972,12 +2687,12 @@
2972
2687
  }
2973
2688
  }
2974
2689
  }
2975
- catch (e_10_1) { e_10 = { error: e_10_1 }; }
2690
+ catch (e_6_1) { e_6 = { error: e_6_1 }; }
2976
2691
  finally {
2977
2692
  try {
2978
2693
  if (fieldUniverse_1_1 && !fieldUniverse_1_1.done && (_d = fieldUniverse_1.return)) _d.call(fieldUniverse_1);
2979
2694
  }
2980
- finally { if (e_10) throw e_10.error; }
2695
+ finally { if (e_6) throw e_6.error; }
2981
2696
  }
2982
2697
  }
2983
2698
  return fieldSetSize;
@@ -3087,35 +2802,163 @@
3087
2802
  }
3088
2803
  return false;
3089
2804
  };
3090
- FormStructureAndData.prototype.cleanTable = function (tableCode) {
3091
- var tableObject = this.getTableObject(tableCode);
3092
- return (tableObject) ? tableObject.clean() : null;
2805
+ Object.defineProperty(FormStructureAndData.prototype, "actions", {
2806
+ // Acciones
2807
+ get: function () { return this._actions; },
2808
+ enumerable: false,
2809
+ configurable: true
2810
+ });
2811
+ FormStructureAndData.prototype.getActionsByAttribute = function (name, value) { return this._actionArray.filter(function (actionItem) { return actionItem.matchAttribute(name, value); }); };
2812
+ FormStructureAndData.prototype.getActions = function () { return this._actionArray; };
2813
+ FormStructureAndData.prototype.getAction = function (code) { var _a; return (code && ((_a = this._actions) === null || _a === void 0 ? void 0 : _a[code])) ? this._actions[code] : null; };
2814
+ FormStructureAndData.prototype.showActions = function (codes) { return this.execOnActions(codes, SHOW); };
2815
+ FormStructureAndData.prototype.hideActions = function (codes) { return this.execOnActions(codes, HIDE); };
2816
+ FormStructureAndData.prototype.enableActions = function (codes) { return this.execOnActions(codes, ENABLE); };
2817
+ FormStructureAndData.prototype.disableActions = function (codes) { return this.execOnActions(codes, DISABLE); };
2818
+ FormStructureAndData.prototype.execOnActions = function (codes, functionName) {
2819
+ var _this = this;
2820
+ var actionCodes = (Array.isArray(codes)) ? codes : (codes ? [codes] : []);
2821
+ if (!functionName || actionCodes.length === 0) {
2822
+ return;
2823
+ }
2824
+ actionCodes.forEach(function (code) {
2825
+ var _a;
2826
+ var action = _this.getAction(code);
2827
+ (_a = action === null || action === void 0 ? void 0 : action[functionName]) === null || _a === void 0 ? void 0 : _a.call(action);
2828
+ });
2829
+ };
2830
+ // Tablas
2831
+ FormStructureAndData.prototype.tables = function () { return this.getTables(); };
2832
+ FormStructureAndData.prototype.getTables = function () { return this._tableArray; };
2833
+ FormStructureAndData.prototype.getTable = function (code) { var _a; return (code && ((_a = this._tables) === null || _a === void 0 ? void 0 : _a[code])) ? this._tables[code] : null; };
2834
+ FormStructureAndData.prototype.enableTables = function (codes) { return this.execOnTables(codes, ENABLE); };
2835
+ FormStructureAndData.prototype.disableTables = function (codes) { return this.execOnTables(codes, DISABLE); };
2836
+ FormStructureAndData.prototype.showTables = function (codes) { return this.execOnTables(codes, SHOW); };
2837
+ FormStructureAndData.prototype.hideTables = function (codes) { return this.execOnTables(codes, HIDE); };
2838
+ FormStructureAndData.prototype.cleanTables = function (codes) { return this.execOnTables(codes, CLEAN); };
2839
+ FormStructureAndData.prototype.execOnTables = function (codes, functionName) {
2840
+ var _this = this;
2841
+ var tableCodes = (Array.isArray(codes)) ? codes : (codes ? [codes] : []);
2842
+ if (!functionName || tableCodes.length === 0) {
2843
+ return;
2844
+ }
2845
+ tableCodes.forEach(function (code) {
2846
+ var _a;
2847
+ var table = _this.getTable(code);
2848
+ (_a = table === null || table === void 0 ? void 0 : table[functionName]) === null || _a === void 0 ? void 0 : _a.call(table);
2849
+ });
3093
2850
  };
3094
2851
  FormStructureAndData.prototype.getTableRecord = function (tableCode, recordId) {
3095
- var tableObject = this.getTableObject(tableCode);
2852
+ var tableObject = this.getTable(tableCode);
3096
2853
  return (tableObject) ? tableObject.getTableRecord(recordId) : null;
3097
2854
  };
3098
- FormStructureAndData.prototype.hideTable = function (tableCode) {
3099
- var tableObject = this.getTableObject(tableCode);
3100
- return (tableObject) ? tableObject.hide() : null;
3101
- };
3102
- FormStructureAndData.prototype.showTable = function (tableCode) {
3103
- var tableObject = this.getTableObject(tableCode);
3104
- return (tableObject) ? tableObject.show() : null;
2855
+ Object.defineProperty(FormStructureAndData.prototype, "sections", {
2856
+ // Secciones
2857
+ get: function () { return this._sectionArray; },
2858
+ enumerable: false,
2859
+ configurable: true
2860
+ });
2861
+ FormStructureAndData.prototype.getSectionsByAttribute = function (name, value) { return this._sectionArray.filter(function (item) { return item.matchAttribute(name, value); }); };
2862
+ Object.defineProperty(FormStructureAndData.prototype, "sectionTitles", {
2863
+ get: function () { return this._sectionArray.map(function (formSection) { return formSection.sectionTitle; }); },
2864
+ enumerable: false,
2865
+ configurable: true
2866
+ });
2867
+ Object.defineProperty(FormStructureAndData.prototype, "visibleSections", {
2868
+ get: function () { return this._sectionArray.filter(function (sec) { return sec.visible; }); },
2869
+ enumerable: false,
2870
+ configurable: true
2871
+ });
2872
+ FormStructureAndData.prototype.getSection = function (code) { var _a; return (code && ((_a = this._sections) === null || _a === void 0 ? void 0 : _a[code])) ? this._sections[code] : null; };
2873
+ FormStructureAndData.prototype.showSections = function (names) { this.execOnSections(names, SHOW); };
2874
+ FormStructureAndData.prototype.hideSections = function (names) { this.execOnSections(names, HIDE); };
2875
+ FormStructureAndData.prototype.activeSection = function () { return this._exclusiveSectionsByAttr[ACTIVE]; };
2876
+ FormStructureAndData.prototype.getSubSection = function (code, subCode) { var _a, _b; return (_b = (_a = this.getSection(code)) === null || _a === void 0 ? void 0 : _a.getSubsection(subCode)) !== null && _b !== void 0 ? _b : null; };
2877
+ FormStructureAndData.prototype.showSubSections = function (code, subCodes) { return this.execOnSubSections(code, subCodes, SHOW); };
2878
+ FormStructureAndData.prototype.hideSubSections = function (code, subCodes) { return this.execOnSubSections(code, subCodes, HIDE); };
2879
+ FormStructureAndData.prototype.activateSection = function (code) {
2880
+ var _a, _b;
2881
+ if (code === this._exclusiveSectionsByAttr[ACTIVE]) {
2882
+ return;
2883
+ }
2884
+ (_a = this.getSection(this.activeSection())) === null || _a === void 0 ? void 0 : _a.inactivate();
2885
+ (_b = this.getSection(code)) === null || _b === void 0 ? void 0 : _b.activate();
2886
+ this._exclusiveSectionsByAttr[ACTIVE] = code;
3105
2887
  };
3106
- FormStructureAndData.prototype.showTables = function (tableArray) {
2888
+ FormStructureAndData.prototype.execOnSections = function (codes, functionName) {
3107
2889
  var _this = this;
3108
- var tableNames = (Array.isArray(tableArray)) ? tableArray : [tableArray];
3109
- tableNames.forEach(function (tableCode) { return _this.showTable(tableCode); });
2890
+ var sectionCodes = (Array.isArray(codes)) ? codes : (codes ? [codes] : []);
2891
+ if (!functionName || sectionCodes.length === 0) {
2892
+ return;
2893
+ }
2894
+ sectionCodes.forEach(function (code) {
2895
+ var _a;
2896
+ var section = _this.getSection(code);
2897
+ (_a = section === null || section === void 0 ? void 0 : section[functionName]) === null || _a === void 0 ? void 0 : _a.call(section);
2898
+ });
3110
2899
  };
3111
- FormStructureAndData.prototype.hideTables = function (tableArray) {
3112
- var _this = this;
3113
- var tableNames = (Array.isArray(tableArray)) ? tableArray : [tableArray];
3114
- tableNames.forEach(function (tableCode) { return _this.hideTable(tableCode); });
2900
+ FormStructureAndData.prototype.execOnSubSections = function (code, subNames, functionName) {
2901
+ var e_7, _d;
2902
+ var _a;
2903
+ var subCodes = (Array.isArray(subNames)) ? subNames : (subNames ? [subNames] : []);
2904
+ var section = this.getSection(code);
2905
+ if (!functionName || !section || subCodes.length === 0) {
2906
+ return;
2907
+ }
2908
+ try {
2909
+ for (var subCodes_1 = __values(subCodes), subCodes_1_1 = subCodes_1.next(); !subCodes_1_1.done; subCodes_1_1 = subCodes_1.next()) {
2910
+ var subCode = subCodes_1_1.value;
2911
+ var subSection = this.getSubSection(code, subCode);
2912
+ (_a = subSection === null || subSection === void 0 ? void 0 : subSection[functionName]) === null || _a === void 0 ? void 0 : _a.call(subSection);
2913
+ }
2914
+ }
2915
+ catch (e_7_1) { e_7 = { error: e_7_1 }; }
2916
+ finally {
2917
+ try {
2918
+ if (subCodes_1_1 && !subCodes_1_1.done && (_d = subCodes_1.return)) _d.call(subCodes_1);
2919
+ }
2920
+ finally { if (e_7) throw e_7.error; }
2921
+ }
2922
+ };
2923
+ /**
2924
+ * Métodos propios de gestión del formulario
2925
+ */
2926
+ FormStructureAndData.prototype.cleanData = function () {
2927
+ var e_8, _d, e_9, _e;
2928
+ if (this._fieldArray) {
2929
+ try {
2930
+ for (var _f = __values(this._fieldArray), _g = _f.next(); !_g.done; _g = _f.next()) {
2931
+ var recordField = _g.value;
2932
+ recordField.setValue(recordField.defaultValue);
2933
+ }
2934
+ }
2935
+ catch (e_8_1) { e_8 = { error: e_8_1 }; }
2936
+ finally {
2937
+ try {
2938
+ if (_g && !_g.done && (_d = _f.return)) _d.call(_f);
2939
+ }
2940
+ finally { if (e_8) throw e_8.error; }
2941
+ }
2942
+ }
2943
+ if (this._tableArray) {
2944
+ try {
2945
+ for (var _h = __values(this._tableArray), _j = _h.next(); !_j.done; _j = _h.next()) {
2946
+ var formTable = _j.value;
2947
+ formTable.clean();
2948
+ }
2949
+ }
2950
+ catch (e_9_1) { e_9 = { error: e_9_1 }; }
2951
+ finally {
2952
+ try {
2953
+ if (_j && !_j.done && (_e = _h.return)) _e.call(_h);
2954
+ }
2955
+ finally { if (e_9) throw e_9.error; }
2956
+ }
2957
+ }
3115
2958
  };
3116
2959
  /** payload para servicios Tuain */
3117
2960
  FormStructureAndData.prototype.getPayload = function () {
3118
- var e_11, _d, e_12, _e;
2961
+ var e_10, _d, e_11, _e;
3119
2962
  var formData = {
3120
2963
  fields: [],
3121
2964
  tables: [],
@@ -3138,12 +2981,12 @@
3138
2981
  }
3139
2982
  }
3140
2983
  }
3141
- catch (e_11_1) { e_11 = { error: e_11_1 }; }
2984
+ catch (e_10_1) { e_10 = { error: e_10_1 }; }
3142
2985
  finally {
3143
2986
  try {
3144
2987
  if (formFields_2_1 && !formFields_2_1.done && (_d = formFields_2.return)) _d.call(formFields_2);
3145
2988
  }
3146
- finally { if (e_11) throw e_11.error; }
2989
+ finally { if (e_10) throw e_10.error; }
3147
2990
  }
3148
2991
  }
3149
2992
  var tables = this.getTables();
@@ -3164,12 +3007,12 @@
3164
3007
  formData.tables.push(formTable);
3165
3008
  }
3166
3009
  }
3167
- catch (e_12_1) { e_12 = { error: e_12_1 }; }
3010
+ catch (e_11_1) { e_11 = { error: e_11_1 }; }
3168
3011
  finally {
3169
3012
  try {
3170
3013
  if (tables_2_1 && !tables_2_1.done && (_e = tables_2.return)) _e.call(tables_2);
3171
3014
  }
3172
- finally { if (e_12) throw e_12.error; }
3015
+ finally { if (e_11) throw e_11.error; }
3173
3016
  }
3174
3017
  }
3175
3018
  return formData;
@@ -3325,11 +3168,87 @@
3325
3168
  this.cleanStart();
3326
3169
  this.customPreProcessing();
3327
3170
  }
3328
- Object.defineProperty(BasicFormComponent.prototype, "inServerProcess", {
3329
- get: function () { return this.busy; },
3330
- enumerable: false,
3331
- configurable: true
3332
- });
3171
+ BasicFormComponent.prototype.assignFunctions = function () {
3172
+ var _a;
3173
+ var functionsMapped = [
3174
+ ['getCurrentState', 'getCurrentState'],
3175
+ ['getCurrentMode', 'getCurrentState'],
3176
+ ['getTitle', 'getTitle'],
3177
+ ['setTitle', 'setTitle'],
3178
+ ['getAction', 'getAction'],
3179
+ ['supportState', 'supportState'],
3180
+ ['getImmutableElement', 'getImmutableElement'],
3181
+ ['getExtraInfo', 'getExtraInfo'],
3182
+ ['cleanData', 'cleanData'],
3183
+ ['getFields', 'getFields'],
3184
+ ['getFieldNames', 'getFieldNames'],
3185
+ ['getField', 'getField'],
3186
+ ['enableField', 'enableField'],
3187
+ ['disableField', 'disableField'],
3188
+ ['getFieldValue', 'getFieldValue'],
3189
+ ['getFieldsValues', 'getFieldsValues'],
3190
+ ['getFieldOptions', 'getFieldOptions'],
3191
+ ['setFieldValue', 'setFieldValue'],
3192
+ ['setFieldRequired', 'setFieldRequired'],
3193
+ ['setFieldErrorMessage', 'setFieldErrorMessage'],
3194
+ ['setFieldError', 'setFieldError'],
3195
+ ['setFieldIntrinsicErrorMessage', 'setFieldIntrinsicErrorMessage'],
3196
+ ['setFieldOptions', 'setFieldOptions'],
3197
+ ['getFieldSet', 'getFieldSet'],
3198
+ ['applyProcessToFieldSet', 'applyProcessToFieldSet'],
3199
+ ['applyProcessToAllFields', 'applyProcessToFieldSet'],
3200
+ ['cleanFields', 'cleanFields'],
3201
+ ['getRequiredFields', 'getRequiredFields'],
3202
+ ['getRequiredEmptyFields', 'getRequiredEmptyFields'],
3203
+ ['getChangedFields', 'getChangedFields'],
3204
+ ['getFieldsWithValidationIssues', 'getFieldsWithValidationIssues'],
3205
+ ['tagFieldsWithError', 'tagFieldsWithError'],
3206
+ ['cleanErrorFields', 'cleanErrorFields'],
3207
+ ['showLabelFields', 'showLabelFields'],
3208
+ ['hideLabelFields', 'hideLabelFields'],
3209
+ ['enableFields', 'enableFields'],
3210
+ ['disableFields', 'disableFields'],
3211
+ ['enableEditFields', 'enableEditFields'],
3212
+ ['disableEditFields', 'disableEditFields'],
3213
+ ['showFields', 'showFields'],
3214
+ ['hideFields', 'hideFields'],
3215
+ ['getActionsByAttribute', 'getActionsByAttribute'],
3216
+ ['getAction', 'getAction'],
3217
+ ['showActions', 'showActions'],
3218
+ ['hideActions', 'hideActions'],
3219
+ ['enableActions', 'enableActions'],
3220
+ ['disableActions', 'disableActions'],
3221
+ ['showAction', 'showActions'],
3222
+ ['hideAction', 'hideActions'],
3223
+ ['enableAction', 'enableActions'],
3224
+ ['disableAction', 'disableActions'],
3225
+ ['activateSection', 'activateSection'],
3226
+ ['getSubSection', 'getSubSection'],
3227
+ ['getSection', 'getSection'],
3228
+ ['showSection', 'showSections'],
3229
+ ['hideSection', 'hideSections'],
3230
+ ['showSections', 'showSections'],
3231
+ ['hideSections', 'hideSections'],
3232
+ ['showSubSection', 'showSubSections'],
3233
+ ['hideSubSection', 'hideSubSections'],
3234
+ ['showSubSections', 'showSubSections'],
3235
+ ['hideSubSections', 'hideSubSections'],
3236
+ ['getTables', 'getTables'],
3237
+ ['getTable', 'getTable'],
3238
+ ['showTables', 'showTables'],
3239
+ ['hideTables', 'hideTables'],
3240
+ ['showTable', 'showTables'],
3241
+ ['hideTable', 'hideTables'],
3242
+ ['cleanTables', 'cleanTables'],
3243
+ ['cleanTable', 'cleanTables'],
3244
+ ['getTableRecord', 'getTableRecord'],
3245
+ ['changeState', 'changeState'],
3246
+ ];
3247
+ for (var index = 0; index < functionsMapped.length; index++) {
3248
+ var _j = __read(functionsMapped[index], 2), name = _j[0], structureName = _j[1];
3249
+ this[name] = (_a = this.formStructure) === null || _a === void 0 ? void 0 : _a[structureName];
3250
+ }
3251
+ };
3333
3252
  BasicFormComponent.prototype.setConfig = function (formConfig) {
3334
3253
  this.formConfig = formConfig;
3335
3254
  };
@@ -3361,11 +3280,32 @@
3361
3280
  this.tableGetDataStart = {};
3362
3281
  this.tableGetDataFinish = {};
3363
3282
  };
3283
+ Object.defineProperty(BasicFormComponent.prototype, "formManager", {
3284
+ get: function () { return this; },
3285
+ enumerable: false,
3286
+ configurable: true
3287
+ });
3288
+ Object.defineProperty(BasicFormComponent.prototype, "formCode", {
3289
+ get: function () { return this.name; },
3290
+ set: function (name) { this.name = name; },
3291
+ enumerable: false,
3292
+ configurable: true
3293
+ });
3294
+ Object.defineProperty(BasicFormComponent.prototype, "inServerProcess", {
3295
+ get: function () { return this.busy; },
3296
+ enumerable: false,
3297
+ configurable: true
3298
+ });
3364
3299
  Object.defineProperty(BasicFormComponent.prototype, "form", {
3365
3300
  get: function () { return this.formStructure; },
3366
3301
  enumerable: false,
3367
3302
  configurable: true
3368
3303
  });
3304
+ Object.defineProperty(BasicFormComponent.prototype, "visibleSections", {
3305
+ get: function () { return this.formStructure.visibleSections; },
3306
+ enumerable: false,
3307
+ configurable: true
3308
+ });
3369
3309
  Object.defineProperty(BasicFormComponent.prototype, "currentState", {
3370
3310
  get: function () { return this.formStructure.state; },
3371
3311
  set: function (state) { this.formStructure.changeState(state); },
@@ -3387,128 +3327,23 @@
3387
3327
  enumerable: false,
3388
3328
  configurable: true
3389
3329
  });
3390
- // Métodos Pass-through hacia el contenido y estructura del formulario
3391
- BasicFormComponent.prototype.supportState = function (state) { return this.formStructure.supportState(state); };
3392
- BasicFormComponent.prototype.supportMode = function (state) { return this.supportState(state); };
3393
- BasicFormComponent.prototype.getTitle = function () { return this.formStructure.title; };
3394
- BasicFormComponent.prototype.setTitle = function (title) { this.formStructure.title = title; };
3395
- BasicFormComponent.prototype.getImmutableElement = function (name) { return this.formStructure.getImmutableElement(name); };
3396
- BasicFormComponent.prototype.getExtraInfo = function (name) { return this.formStructure.getExtraInfo(name); };
3397
- BasicFormComponent.prototype.cleanData = function () { return this.formStructure.cleanData(); };
3398
- BasicFormComponent.prototype.getFields = function () { return this.formStructure.getFields(); };
3399
- BasicFormComponent.prototype.getFieldNames = function () { return this.formStructure.getFieldNames(); };
3400
- BasicFormComponent.prototype.getFieldObject = function (elementId) { return this.formStructure.getFieldObject(elementId); };
3401
- BasicFormComponent.prototype.getField = function (fieldCode) { return this.getFieldObject(fieldCode); };
3402
- BasicFormComponent.prototype.enableField = function (fieldCode) { return this.formStructure.enableField(fieldCode); };
3403
- BasicFormComponent.prototype.disableField = function (fieldCode) { return this.formStructure.disableField(fieldCode); };
3404
- BasicFormComponent.prototype.getFieldValue = function (fieldCode) { return this.formStructure.getFieldValue(fieldCode); };
3405
- BasicFormComponent.prototype.getFieldsValues = function (fieldCodesArray) { return this.formStructure.getFieldsValues(fieldCodesArray); };
3406
- BasicFormComponent.prototype.getFieldOptions = function (fieldCode) { return this.formStructure.getFieldOptions(fieldCode); };
3407
- BasicFormComponent.prototype.setFieldValue = function (fieldCode, fieldValue) { return this.formStructure.setFieldValue(fieldCode, fieldValue); };
3408
- BasicFormComponent.prototype.setFieldRequired = function (fieldCode, required) { return this.formStructure.setFieldRequired(fieldCode, required); };
3409
- BasicFormComponent.prototype.setFieldErrorMessage = function (fieldCode, errorMessage) { return this.formStructure.setFieldErrorMessage(fieldCode, errorMessage); };
3410
- BasicFormComponent.prototype.setFieldError = function (code, message, type) {
3411
- if (type === void 0) { type = 'error'; }
3412
- return this.formStructure.setFieldError(code, message, type);
3413
- };
3414
- BasicFormComponent.prototype.setFieldIntrinsicErrorMessage = function (code, message) { return this.formStructure.setFieldIntrinsicErrorMessage(code, message); };
3415
- BasicFormComponent.prototype.setFieldOptions = function (fieldCode, optionsArray, idAttribute, nameAttribute) {
3416
- return this.formStructure.setFieldOptions(fieldCode, optionsArray, idAttribute, nameAttribute);
3417
- };
3418
- BasicFormComponent.prototype.getFieldSet = function (filterFunc, fieldArray, sectionCode, subSectionCode) {
3419
- return this.formStructure.getFieldSet(filterFunc, fieldArray, sectionCode, subSectionCode);
3420
- };
3421
- BasicFormComponent.prototype.applyProcessToFieldSet = function (processFunc, fieldArray, sectionCode, subSectionCode) {
3422
- return this.formStructure.applyProcessToFieldSet(processFunc, fieldArray, sectionCode, subSectionCode);
3423
- };
3424
- BasicFormComponent.prototype.applyProcessToAllFields = function (processFunc) { return this.formStructure.applyProcessToFieldSet(processFunc); };
3425
- BasicFormComponent.prototype.cleanFields = function (fieldArray, sectionCode, subSectionCode) {
3426
- return this.formStructure.cleanFields(fieldArray, sectionCode, subSectionCode);
3427
- };
3428
- BasicFormComponent.prototype.getRequiredFields = function (fieldArray, sectionCode, subSectionCode) {
3429
- return this.formStructure.getRequiredFields(fieldArray, sectionCode, subSectionCode);
3430
- };
3431
- BasicFormComponent.prototype.getRequiredEmptyFields = function (fieldArray, sectionCode, subSectionCode) {
3432
- return this.formStructure.getRequiredEmptyFields(fieldArray, sectionCode, subSectionCode);
3433
- };
3434
- BasicFormComponent.prototype.getChangedFields = function (fieldArray, sectionCode, subSectionCode) {
3435
- return this.formStructure.getChangedFields(fieldArray, sectionCode, subSectionCode);
3436
- };
3437
- BasicFormComponent.prototype.getFieldsWithValidationIssues = function (fieldArray, sectionCode, subSectionCode) {
3438
- return this.formStructure.getFieldsWithValidationIssues(fieldArray, sectionCode, subSectionCode);
3439
- };
3440
- BasicFormComponent.prototype.tagFieldsWithError = function (errorMessage, fieldArray, sectionCode, subSectionCode) {
3441
- return this.formStructure.tagFieldsWithError(errorMessage, fieldArray, sectionCode, subSectionCode);
3442
- };
3443
- BasicFormComponent.prototype.cleanErrorFields = function (fieldArray, sectionCode, subSectionCode) {
3444
- return this.formStructure.cleanErrorFields(fieldArray, sectionCode, subSectionCode);
3445
- };
3446
- BasicFormComponent.prototype.showLabelFields = function (fieldArray, sectionCode, subSectionCode) {
3447
- return this.formStructure.showLabelFields(fieldArray, sectionCode, subSectionCode);
3448
- };
3449
- BasicFormComponent.prototype.hideLabelFields = function (fieldArray, sectionCode, subSectionCode) {
3450
- return this.formStructure.hideLabelFields(fieldArray, sectionCode, subSectionCode);
3451
- };
3452
- BasicFormComponent.prototype.enableFields = function (fieldArray, sectionCode, subSectionCode) {
3453
- return this.formStructure.enableFields(fieldArray, sectionCode, subSectionCode);
3454
- };
3455
- BasicFormComponent.prototype.disableFields = function (fieldArray, sectionCode, subSectionCode) {
3456
- return this.formStructure.disableFields(fieldArray, sectionCode, subSectionCode);
3457
- };
3458
- BasicFormComponent.prototype.enableEditFields = function (fieldArray, sectionCode, subSectionCode) {
3459
- return this.formStructure.enableEditFields(fieldArray, sectionCode, subSectionCode);
3460
- };
3461
- BasicFormComponent.prototype.disableEditFields = function (fieldArray, sectionCode, subSectionCode) {
3462
- return this.formStructure.disableEditFields(fieldArray, sectionCode, subSectionCode);
3463
- };
3464
- BasicFormComponent.prototype.showFields = function (fieldArray, sectionCode, subSectionCode) {
3465
- return this.formStructure.showFields(fieldArray, sectionCode, subSectionCode);
3466
- };
3467
- BasicFormComponent.prototype.hideFields = function (fieldArray, sectionCode, subSectionCode) {
3468
- return this.formStructure.hideFields(fieldArray, sectionCode, subSectionCode);
3469
- };
3470
- BasicFormComponent.prototype.getHeaderActions = function () { return this.formStructure.getHeaderActions(); };
3471
- BasicFormComponent.prototype.getActionObject = function (elementId) { return this.formStructure.getActionObject(elementId); };
3472
- BasicFormComponent.prototype.getAction = function (actionCode) { return this.getActionObject(actionCode); };
3473
- BasicFormComponent.prototype.getActionDefinition = function (actionCode) { return this.getActionObject(actionCode); };
3474
- BasicFormComponent.prototype.showAction = function (actionCode) { return this.formStructure.showAction(actionCode); };
3475
- BasicFormComponent.prototype.hideAction = function (actionCode) { return this.formStructure.hideAction(actionCode); };
3476
- BasicFormComponent.prototype.showActions = function (actionArray) { return this.formStructure.showActions(actionArray); };
3477
- BasicFormComponent.prototype.hideActions = function (actionArray) { return this.formStructure.hideActions(actionArray); };
3478
- BasicFormComponent.prototype.enableAction = function (actionCode) { return this.formStructure.enableAction(actionCode); };
3479
- BasicFormComponent.prototype.disableAction = function (actionCode) { return this.formStructure.disableAction(actionCode); };
3480
- BasicFormComponent.prototype.enableActions = function (actionArray) { return this.formStructure.enableActions(actionArray); };
3481
- BasicFormComponent.prototype.disableActions = function (actionArray) { return this.formStructure.disableActions(actionArray); };
3482
- BasicFormComponent.prototype.getStates = function () { return this.formStructure.getStates(); };
3483
- BasicFormComponent.prototype.getSections = function () { return this.formStructure.getSections(); };
3484
- Object.defineProperty(BasicFormComponent.prototype, "visibleSections", {
3485
- get: function () { return this.formStructure.visibleSections; },
3330
+ Object.defineProperty(BasicFormComponent.prototype, "state", {
3331
+ get: function () { return this.getCurrentState(); },
3486
3332
  enumerable: false,
3487
3333
  configurable: true
3488
3334
  });
3489
- BasicFormComponent.prototype.getSection = function (sectionCode) { return this.formStructure.getSection(sectionCode); };
3490
- BasicFormComponent.prototype.activateSection = function (sectionCode) { return this.formStructure.activateSection(sectionCode); };
3491
- BasicFormComponent.prototype.getSubSection = function (sectionCode, subsectionCode) { return this.formStructure.getSubSection(sectionCode, subsectionCode); };
3492
- BasicFormComponent.prototype.numSections = function () { return this.formStructure.numSections(); };
3493
- BasicFormComponent.prototype.getSectionsTitles = function () { return this.formStructure.getSectionsTitles(); };
3494
- BasicFormComponent.prototype.getSectionObject = function (elementId) { return this.formStructure.getSectionObject(elementId); };
3495
- BasicFormComponent.prototype.showSection = function (sectionCode) { return this.formStructure.showSection(sectionCode); };
3496
- BasicFormComponent.prototype.hideSection = function (sectionCode) { return this.formStructure.hideSection(sectionCode); };
3497
- BasicFormComponent.prototype.showSections = function (sectionArray) { return this.formStructure.showSections(sectionArray); };
3498
- BasicFormComponent.prototype.hideSections = function (sectionArray) { return this.formStructure.hideSections(sectionArray); };
3499
- BasicFormComponent.prototype.showSubSection = function (sectionCode, subSectionCode) { return this.formStructure.showSubSection(sectionCode, subSectionCode); };
3500
- BasicFormComponent.prototype.hideSubSection = function (sectionCode, subSectionCode) { return this.formStructure.hideSubSection(sectionCode, subSectionCode); };
3501
- BasicFormComponent.prototype.showSubSections = function (sectionCode, subSectionArray) { return this.formStructure.showSubSections(sectionCode, subSectionArray); };
3502
- BasicFormComponent.prototype.hideSubSections = function (sectionCode, subSectionArray) { return this.formStructure.hideSubSections(sectionCode, subSectionArray); };
3503
- BasicFormComponent.prototype.getTables = function () { return this.formStructure.getTables(); };
3504
- BasicFormComponent.prototype.getTableObject = function (elementId) { return this.formStructure.getTableObject(elementId); };
3505
- BasicFormComponent.prototype.getTable = function (tableName) { return this.getTableObject(tableName); };
3506
- BasicFormComponent.prototype.showTable = function (tableName) { return this.formStructure.showTable(tableName); };
3507
- BasicFormComponent.prototype.hideTable = function (tableName) { return this.formStructure.hideTable(tableName); };
3508
- BasicFormComponent.prototype.showTables = function (tableArray) { return this.formStructure.showTables(tableArray); };
3509
- BasicFormComponent.prototype.hideTables = function (tableArray) { return this.formStructure.hideTables(tableArray); };
3510
- BasicFormComponent.prototype.cleanTable = function (tableName) { return this.formStructure.cleanTable(tableName); };
3511
- BasicFormComponent.prototype.getTableRecord = function (tableName, recordId) { return this.formStructure.getTableRecord(tableName, recordId); };
3335
+ Object.defineProperty(BasicFormComponent.prototype, "formRoute", {
3336
+ get: function () { return this._formRoute; },
3337
+ set: function (route) { this._formRoute = route; },
3338
+ enumerable: false,
3339
+ configurable: true
3340
+ });
3341
+ Object.defineProperty(BasicFormComponent.prototype, "subject", {
3342
+ get: function () { return this.formSubject; },
3343
+ enumerable: false,
3344
+ configurable: true
3345
+ });
3346
+ // Métodos virtuales
3512
3347
  BasicFormComponent.prototype.customPreProcessing = function () { };
3513
3348
  BasicFormComponent.prototype.customFormStart = function () { };
3514
3349
  BasicFormComponent.prototype.displayActionServerError = function () { };
@@ -3517,6 +3352,43 @@
3517
3352
  BasicFormComponent.prototype.showFieldInfo = function (fieldCode) { };
3518
3353
  BasicFormComponent.prototype.showModalDialog = function (title, body, options, callback, params) { };
3519
3354
  BasicFormComponent.prototype.openUploadDialog = function (title, body, options, callback, params) { };
3355
+ /**
3356
+ * @deprecated Use supportState
3357
+ */
3358
+ BasicFormComponent.prototype.supportMode = function (state) { return this.supportState(state); };
3359
+ /**
3360
+ * @deprecated Use getField
3361
+ */
3362
+ BasicFormComponent.prototype.getFieldObject = function (code) { return this.getField(code); };
3363
+ /**
3364
+ * @deprecated Use getAction
3365
+ */
3366
+ BasicFormComponent.prototype.getActionObject = function (code) { return this.getAction(code); };
3367
+ /**
3368
+ * @deprecated Use getTable
3369
+ */
3370
+ BasicFormComponent.prototype.getTableObject = function (code) { return this.getTable(code); };
3371
+ /**
3372
+ * @deprecated Use getSection
3373
+ */
3374
+ BasicFormComponent.prototype.getSectionObject = function (code) { return this.getSection(code); };
3375
+ /**
3376
+ * @deprecated Use changeState
3377
+ */
3378
+ BasicFormComponent.prototype.changeFormMode = function (state) { return this.changeState(state); };
3379
+ /**
3380
+ * @deprecated Use subject
3381
+ */
3382
+ BasicFormComponent.prototype.getFormSubject = function () { return this.subject; };
3383
+ /**
3384
+ * @deprecated Use subject
3385
+ */
3386
+ BasicFormComponent.prototype.getSubject = function () { return this.formSubject; };
3387
+ /**
3388
+ * @deprecated Use subject
3389
+ */
3390
+ BasicFormComponent.prototype.getformSubject = function () { return this.getSubject(); };
3391
+ BasicFormComponent.prototype.numSections = function () { return this.formStructure.sections.length; };
3520
3392
  BasicFormComponent.prototype.subscribeAppEvent = function (eventName, callback) {
3521
3393
  this._eventEmiter.subscribe(eventName, callback);
3522
3394
  };
@@ -3549,37 +3421,15 @@
3549
3421
  this.errorMessage = errorMessage || '';
3550
3422
  this.errorDetail = errorDetail || '';
3551
3423
  };
3552
- Object.defineProperty(BasicFormComponent.prototype, "formManager", {
3553
- get: function () { return this; },
3554
- enumerable: false,
3555
- configurable: true
3556
- });
3557
3424
  BasicFormComponent.prototype.resetError = function () { this.setError(null, null, null); };
3558
3425
  BasicFormComponent.prototype.getErrorType = function () { return this._errorType; };
3559
3426
  BasicFormComponent.prototype.getErrorMessage = function () { return this.errorMessage; };
3560
3427
  BasicFormComponent.prototype.getErrorDetail = function () { return this.errorDetail; };
3561
3428
  BasicFormComponent.prototype.getErrorCode = function () { return this._errorType; };
3562
- Object.defineProperty(BasicFormComponent.prototype, "formRoute", {
3563
- get: function () { return this._formRoute; },
3564
- set: function (route) { this._formRoute = route; },
3565
- enumerable: false,
3566
- configurable: true
3567
- });
3568
- BasicFormComponent.prototype.defineFormCode = function (name) { this.name = name; };
3569
- BasicFormComponent.prototype.getCurrentState = function () { return this.formStructure.state; };
3570
- BasicFormComponent.prototype.getCurrentMode = function () { return this.formStructure.state; };
3571
- Object.defineProperty(BasicFormComponent.prototype, "formCode", {
3572
- get: function () { return this.name; },
3573
- set: function (name) { this.name = name; },
3574
- enumerable: false,
3575
- configurable: true
3576
- });
3577
3429
  BasicFormComponent.prototype.getFormParameter = function (name) {
3578
3430
  var _a, _b;
3579
3431
  return (name) ? ((_b = (_a = this.extraData) === null || _a === void 0 ? void 0 : _a[name]) !== null && _b !== void 0 ? _b : null) : null;
3580
3432
  };
3581
- BasicFormComponent.prototype.getSubject = function () { return this.formSubject; };
3582
- BasicFormComponent.prototype.getformSubject = function () { return this.getSubject(); };
3583
3433
  BasicFormComponent.prototype.preocessInputParams = function (params) {
3584
3434
  var _a, _b, _c;
3585
3435
  this.controlToken = (_a = params === null || params === void 0 ? void 0 : params[TOKEN]) !== null && _a !== void 0 ? _a : null;
@@ -3595,7 +3445,7 @@
3595
3445
  };
3596
3446
  BasicFormComponent.prototype.subscribeSectionActivation = function () {
3597
3447
  var _this = this;
3598
- var formSections = this.formStructure.getSections();
3448
+ var formSections = this.formStructure.sections;
3599
3449
  if (Array.isArray(formSections)) {
3600
3450
  formSections.forEach(function (section) {
3601
3451
  section.activation.subscribe(function (code) { return _this.launchSectionActivation(code); });
@@ -3704,8 +3554,9 @@
3704
3554
  BasicFormComponent.prototype.errorOccured = function () {
3705
3555
  return (this.errorCode !== NO_ERROR);
3706
3556
  };
3707
- BasicFormComponent.prototype.changeState = function (state) { return this.formStructure.changeState(state); };
3708
- BasicFormComponent.prototype.changeFormMode = function (state) { return this.changeState(state); };
3557
+ /**
3558
+ * Soporte manejo de eventos de formulario
3559
+ */
3709
3560
  BasicFormComponent.prototype.requestFormAction = function (actionCode, actionSubject) {
3710
3561
  if (actionSubject === void 0) { actionSubject = {}; }
3711
3562
  return __awaiter(this, void 0, void 0, function () {
@@ -3758,7 +3609,7 @@
3758
3609
  try {
3759
3610
  for (var actions_1 = __values(actions), actions_1_1 = actions_1.next(); !actions_1_1.done; actions_1_1 = actions_1.next()) {
3760
3611
  var changedAction = actions_1_1.value;
3761
- var actionObject = this.getActionObject(changedAction.actionCode);
3612
+ var actionObject = this.getAction(changedAction.actionCode);
3762
3613
  if (actionObject) {
3763
3614
  actionObject.updateFromServer(changedAction);
3764
3615
  }
@@ -3776,7 +3627,7 @@
3776
3627
  try {
3777
3628
  for (var fields_1 = __values(fields), fields_1_1 = fields_1.next(); !fields_1_1.done; fields_1_1 = fields_1.next()) {
3778
3629
  var changedField = fields_1_1.value;
3779
- var fieldObject = this.getFieldObject(changedField.fieldCode);
3630
+ var fieldObject = this.getField(changedField.fieldCode);
3780
3631
  if (fieldObject) {
3781
3632
  fieldObject.updateFromServer(changedField);
3782
3633
  }
@@ -3794,7 +3645,7 @@
3794
3645
  try {
3795
3646
  for (var recordTables_1 = __values(recordTables), recordTables_1_1 = recordTables_1.next(); !recordTables_1_1.done; recordTables_1_1 = recordTables_1.next()) {
3796
3647
  var changedTable = recordTables_1_1.value;
3797
- var tableObject = this.getTableObject(changedTable.tableCode);
3648
+ var tableObject = this.getTable(changedTable.tableCode);
3798
3649
  if (tableObject) {
3799
3650
  tableObject.updateFromServer(changedTable);
3800
3651
  }
@@ -3862,7 +3713,7 @@
3862
3713
  var sectionObject, clientSectionMethods, clientSectionMethods_1, clientSectionMethods_1_1, clientSectionMethod;
3863
3714
  var e_4, _j;
3864
3715
  return __generator(this, function (_k) {
3865
- sectionObject = this.formStructure.getSectionObject(sectionCode);
3716
+ sectionObject = this.formStructure.getSection(sectionCode);
3866
3717
  if (!sectionObject) {
3867
3718
  return [2 /*return*/];
3868
3719
  }
@@ -3891,7 +3742,7 @@
3891
3742
  var sectionObject, clientSectionMethods, clientSectionMethods_2, clientSectionMethods_2_1, clientSectionMethod;
3892
3743
  var e_5, _j;
3893
3744
  return __generator(this, function (_k) {
3894
- sectionObject = this.formStructure.getSectionObject(sectionCode);
3745
+ sectionObject = this.formStructure.getSection(sectionCode);
3895
3746
  if (!sectionObject) {
3896
3747
  return [2 /*return*/];
3897
3748
  }
@@ -4070,7 +3921,7 @@
4070
3921
  return __generator(this, function (_k) {
4071
3922
  switch (_k.label) {
4072
3923
  case 0:
4073
- fieldToValidate = this.getFieldObject(fieldCode);
3924
+ fieldToValidate = this.getField(fieldCode);
4074
3925
  if (!fieldToValidate) {
4075
3926
  return [2 /*return*/, false];
4076
3927
  }
@@ -4229,7 +4080,7 @@
4229
4080
  if (!tableObject) {
4230
4081
  return;
4231
4082
  }
4232
- var inlineActionObject = tableObject.getActionObject(actionCode);
4083
+ var inlineActionObject = tableObject.getAction(actionCode);
4233
4084
  if (!inlineActionObject) {
4234
4085
  return;
4235
4086
  }
@@ -4251,7 +4102,7 @@
4251
4102
  if (!tableObject) {
4252
4103
  return;
4253
4104
  }
4254
- var inlineActionObject = tableObject.getActionObject(actionCode);
4105
+ var inlineActionObject = tableObject.getAction(actionCode);
4255
4106
  if (!inlineActionObject) {
4256
4107
  return;
4257
4108
  }