tuain-ng-forms-lib 12.0.3 → 12.0.7
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/bundles/tuain-ng-forms-lib.umd.js +114 -101
- package/bundles/tuain-ng-forms-lib.umd.js.map +1 -1
- package/esm2015/lib/classes/forms/field.js +17 -16
- package/esm2015/lib/classes/forms/table/table.js +46 -31
- package/esm2015/lib/components/elements/tables/table.component.js +39 -19
- package/esm2015/lib/components/forms/basic-form.js +3 -36
- package/esm2015/lib/services/form-manager.service.js +1 -3
- package/fesm2015/tuain-ng-forms-lib.js +101 -100
- package/fesm2015/tuain-ng-forms-lib.js.map +1 -1
- package/lib/classes/forms/table/table.d.ts +3 -0
- package/lib/components/elements/tables/table.component.d.ts +18 -6
- package/lib/components/forms/basic-form.d.ts +0 -12
- package/lib/services/form-manager.service.d.ts +0 -2
- package/package.json +1 -1
- package/tuain-ng-forms-lib.metadata.json +1 -1
|
@@ -5,8 +5,6 @@ export class LibFormManagerService {
|
|
|
5
5
|
}
|
|
6
6
|
// Métodos virtuales para las aplicaciones
|
|
7
7
|
getFormDefinition(formCode) { }
|
|
8
|
-
getFormRoute(formCode) { }
|
|
9
|
-
getRouteForm(path) { }
|
|
10
8
|
execServerAction(actionDetail) { }
|
|
11
9
|
goToForm(formCode, token, subject) { }
|
|
12
10
|
loadStack() { }
|
|
@@ -76,4 +74,4 @@ export class LibFormManagerService {
|
|
|
76
74
|
formInfo && formInfo.name && this.goToForm(formInfo.name, formInfo.token, formInfo.subject);
|
|
77
75
|
}
|
|
78
76
|
}
|
|
79
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
77
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZm9ybS1tYW5hZ2VyLnNlcnZpY2UuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy90dWFpbi1uZy1m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tlbiwgZm9ybUluZm8uc3ViamVjdCk7XG4gIH1cbn1cbiJdfQ==
|
|
@@ -536,13 +536,13 @@ class RecordTable extends FormElement {
|
|
|
536
536
|
this._recordSelectionTrigger = new Subject();
|
|
537
537
|
this._selectionActionTrigger = new Subject();
|
|
538
538
|
this._getDataTrigger = new Subject();
|
|
539
|
+
this._attributeChange = new Subject();
|
|
539
540
|
this.tableRecordObj = {};
|
|
540
541
|
this._tableColumnObj = {};
|
|
541
542
|
this._actionsObj = {};
|
|
542
543
|
this.allSelected = false;
|
|
543
544
|
this.elementType = elementTypes.table;
|
|
544
545
|
this.waiting = false;
|
|
545
|
-
this.complexFilter = false;
|
|
546
546
|
this.currentPage = 1;
|
|
547
547
|
this.totalPages = 1;
|
|
548
548
|
this.requestedPage = 1;
|
|
@@ -550,26 +550,30 @@ class RecordTable extends FormElement {
|
|
|
550
550
|
this._tableColumnObj = {};
|
|
551
551
|
this._actions = [];
|
|
552
552
|
this._actionsObj = {};
|
|
553
|
-
this.filterConfig = [];
|
|
554
|
-
this.filterObject = new Filter();
|
|
555
553
|
this.tableRecords = [];
|
|
556
|
-
this.
|
|
554
|
+
this.setAttr('allSelected', false);
|
|
555
|
+
this.setAttr('filterObject', new Filter());
|
|
556
|
+
this.setAttr('filterConfig', []);
|
|
557
|
+
this.setAttr('tableCode', tableReceived.tableCode);
|
|
557
558
|
this.tableTitle = tableReceived.tableTitle;
|
|
558
|
-
this.clientPaging
|
|
559
|
-
this.simpleFilter
|
|
559
|
+
this.setAttr('clientPaging', (_a = tableReceived === null || tableReceived === void 0 ? void 0 : tableReceived.clientPaging) !== null && _a !== void 0 ? _a : true);
|
|
560
|
+
this.setAttr('simpleFilter', (_b = tableReceived === null || tableReceived === void 0 ? void 0 : tableReceived.simpleFilter) !== null && _b !== void 0 ? _b : false);
|
|
561
|
+
this.setAttr('complexFilter', false);
|
|
560
562
|
this._appendPages = (_c = tableReceived === null || tableReceived === void 0 ? void 0 : tableReceived.append) !== null && _c !== void 0 ? _c : false;
|
|
561
563
|
this.selectable = (_d = tableReceived === null || tableReceived === void 0 ? void 0 : tableReceived.selectable) !== null && _d !== void 0 ? _d : false;
|
|
562
|
-
this.selectionBackend
|
|
564
|
+
this.setAttr('selectionBackend', (_e = tableReceived === null || tableReceived === void 0 ? void 0 : tableReceived.selectionBackend) !== null && _e !== void 0 ? _e : false);
|
|
563
565
|
this.customAttributes = (_f = tableReceived === null || tableReceived === void 0 ? void 0 : tableReceived.customAttributes) !== null && _f !== void 0 ? _f : {};
|
|
564
|
-
this.sortable
|
|
565
|
-
this.sorting
|
|
566
|
-
this.recordsPerPage
|
|
566
|
+
this.setAttr('sortable', (_g = tableReceived === null || tableReceived === void 0 ? void 0 : tableReceived.sortable) !== null && _g !== void 0 ? _g : false);
|
|
567
|
+
this.setAttr('sorting', { columnName: '', direction: '' });
|
|
568
|
+
this.setAttr('recordsPerPage', formConfig.defaultRecordsPerPage);
|
|
567
569
|
if (tableReceived.fields) {
|
|
570
|
+
const columns = [];
|
|
568
571
|
for (const columnReceived of tableReceived.fields) {
|
|
569
572
|
const columnDefinition = new RecordTableColumn(columnReceived, this._formConfig);
|
|
570
|
-
|
|
573
|
+
columns.push(columnDefinition);
|
|
571
574
|
this._tableColumnObj[columnDefinition.fieldCode] = columnDefinition;
|
|
572
575
|
}
|
|
576
|
+
this.setAttr('columns', columns);
|
|
573
577
|
}
|
|
574
578
|
if (tableReceived.actions) {
|
|
575
579
|
const tableActions = tableReceived.actions.map(objDef => {
|
|
@@ -592,11 +596,13 @@ class RecordTable extends FormElement {
|
|
|
592
596
|
}
|
|
593
597
|
}
|
|
594
598
|
if (tableReceived.filters && tableReceived.filters.length > 0) {
|
|
595
|
-
this.complexFilter
|
|
599
|
+
this.setAttr('complexFilter', true);
|
|
600
|
+
const filterConfig = this.filterConfig;
|
|
596
601
|
for (const filterReceived of tableReceived.filters) {
|
|
597
602
|
const filterItem = new FieldSearch(filterReceived);
|
|
598
|
-
|
|
603
|
+
filterConfig.push(filterItem);
|
|
599
604
|
}
|
|
605
|
+
this.setAttr('filterConfig', filterConfig);
|
|
600
606
|
}
|
|
601
607
|
if (this.selectable) {
|
|
602
608
|
this.selectionField = this.columns
|
|
@@ -608,6 +614,7 @@ class RecordTable extends FormElement {
|
|
|
608
614
|
get selectionActionTrigger() { return this._selectionActionTrigger; }
|
|
609
615
|
get recordSelectionTrigger() { return this._recordSelectionTrigger; }
|
|
610
616
|
get getDataTrigger() { return this._getDataTrigger; }
|
|
617
|
+
get attributeChange() { return this._attributeChange; }
|
|
611
618
|
get hasActions() { return (this._actions.length > 0); }
|
|
612
619
|
get selectionFieldName() { var _a, _b; return (_b = (_a = this.selectionField) === null || _a === void 0 ? void 0 : _a.fieldCode) !== null && _b !== void 0 ? _b : null; }
|
|
613
620
|
get columnNames() { return Object.keys(this._tableColumnObj); }
|
|
@@ -617,6 +624,12 @@ class RecordTable extends FormElement {
|
|
|
617
624
|
return this.tableRecords.filter(rec => rec.selected)
|
|
618
625
|
.map(rec => rec.recordId);
|
|
619
626
|
}
|
|
627
|
+
setAttr(name, value) {
|
|
628
|
+
this[name] = value;
|
|
629
|
+
if (this._formConfig.monitoredTableAttributes.includes(name)) {
|
|
630
|
+
this._attributeChange.next({ name, value });
|
|
631
|
+
}
|
|
632
|
+
}
|
|
620
633
|
appendRecords(records) { this.setTableRecords(records, true); }
|
|
621
634
|
replaceRecords(records) { this.setTableRecords(records, false); }
|
|
622
635
|
columnDefinition(fieldCode) { return this._tableColumnObj[fieldCode]; }
|
|
@@ -683,11 +696,11 @@ class RecordTable extends FormElement {
|
|
|
683
696
|
this.tableRecordObj = {};
|
|
684
697
|
}
|
|
685
698
|
selectAll() {
|
|
686
|
-
this.allSelected
|
|
699
|
+
this.setAttr('allSelected', true);
|
|
687
700
|
this.tableRecords.forEach(record => record.select());
|
|
688
701
|
}
|
|
689
702
|
unSelectAll() {
|
|
690
|
-
this.allSelected
|
|
703
|
+
this.setAttr('allSelected', false);
|
|
691
704
|
this.tableRecords.forEach(record => record.unselect());
|
|
692
705
|
}
|
|
693
706
|
setTableRecords(tableRecords, append) {
|
|
@@ -709,21 +722,24 @@ class RecordTable extends FormElement {
|
|
|
709
722
|
}
|
|
710
723
|
updateVisibleRecords() {
|
|
711
724
|
if (!this.clientPaging || !this.tableRecords || this.tableRecords.length === 0) {
|
|
712
|
-
this.visibleRecords
|
|
725
|
+
this.setAttr('visibleRecords', this.tableRecords);
|
|
713
726
|
}
|
|
714
|
-
|
|
727
|
+
const recordsVisible = (this.filterObject.filterModeSimple)
|
|
715
728
|
? this.tableRecords.filter(record => record.hasPattern(this.filterObject.simpleFilterWords))
|
|
716
729
|
: this.tableRecords.filter(record => record.hasCondition(this.filterObject.advancedFilter));
|
|
730
|
+
this.setAttr('visibleRecords', recordsVisible);
|
|
717
731
|
}
|
|
718
732
|
updateFromServer(tableReceived) {
|
|
719
733
|
this.visible = (tableReceived === null || tableReceived === void 0 ? void 0 : tableReceived.visible) || true;
|
|
720
|
-
this.currentPage
|
|
734
|
+
this.setAttr('currentPage', parseInt(tableReceived.currentPage, 10) || 1);
|
|
721
735
|
this.totalPages = tableReceived.totalPages || 1;
|
|
722
|
-
this.recordsPerPage
|
|
736
|
+
this.setAttr('recordsPerPage', tableReceived.recordsPerPage);
|
|
723
737
|
this.recordsNumber = tableReceived.recordsNumber;
|
|
724
|
-
this.totalRecordsNumber
|
|
725
|
-
this.sorting
|
|
726
|
-
|
|
738
|
+
this.setAttr('totalRecordsNumber', tableReceived.totalRecordsNumber);
|
|
739
|
+
this.setAttr('sorting', {
|
|
740
|
+
columnName: tableReceived.sortingColumn || '',
|
|
741
|
+
direction: tableReceived.sortingDirection || ''
|
|
742
|
+
});
|
|
727
743
|
this.requestedPage = 1;
|
|
728
744
|
this.waiting = false;
|
|
729
745
|
this.clean();
|
|
@@ -803,16 +819,15 @@ class RecordTable extends FormElement {
|
|
|
803
819
|
// Ordenamiento
|
|
804
820
|
setRequiredOrder(columnField) {
|
|
805
821
|
if (columnField !== this.sorting.columnName) {
|
|
806
|
-
this.sorting
|
|
807
|
-
|
|
822
|
+
this.setAttr('sorting', {
|
|
823
|
+
columnName: columnField,
|
|
824
|
+
direction: TABLE_SORT_ASCENDING
|
|
825
|
+
});
|
|
808
826
|
}
|
|
809
827
|
else {
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
else {
|
|
814
|
-
this.sorting.direction = TABLE_SORT_ASCENDING;
|
|
815
|
-
}
|
|
828
|
+
const tableSort = this.sorting;
|
|
829
|
+
tableSort.direction = (tableSort.direction === TABLE_SORT_ASCENDING) ? TABLE_SORT_DESCENDING : TABLE_SORT_ASCENDING;
|
|
830
|
+
this.setAttr('sorting', tableSort);
|
|
816
831
|
}
|
|
817
832
|
}
|
|
818
833
|
localSortData() {
|
|
@@ -988,15 +1003,29 @@ class LibTableComponent {
|
|
|
988
1003
|
this.hasActions = false;
|
|
989
1004
|
}
|
|
990
1005
|
ngOnInit() {
|
|
991
|
-
var _a;
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1006
|
+
var _a, _b;
|
|
1007
|
+
if (this.tableObject) {
|
|
1008
|
+
this.formConfig = (_a = this.tableObject) === null || _a === void 0 ? void 0 : _a._formConfig;
|
|
1009
|
+
this.tableFieldStyles = this.formConfig.tableFieldStyles;
|
|
1010
|
+
this.selectable = this.tableObject.selectable;
|
|
1011
|
+
this.hasActions = this.tableObject.hasActions;
|
|
1012
|
+
this.tableObject.widget = this;
|
|
1013
|
+
this.inlineActions = this.tableObject.getActions(this.formConfig.tableActions.inline);
|
|
1014
|
+
this.globalActions = this.tableObject.getActions(this.formConfig.tableActions.global);
|
|
1015
|
+
this.selectionActions = this.tableObject.getActions(this.formConfig.tableActions.selection);
|
|
1016
|
+
// Inicialización de campos mapeados del objeto
|
|
1017
|
+
const mapping = Object.entries(this.formConfig.componentTableAttrMap);
|
|
1018
|
+
for (let index = 0; index < mapping.length; index++) {
|
|
1019
|
+
const [tableAttr, compAttr] = mapping[index];
|
|
1020
|
+
this[compAttr.toString()] = (_b = this.tableObject) === null || _b === void 0 ? void 0 : _b[tableAttr.toString()];
|
|
1021
|
+
}
|
|
1022
|
+
// Subscripción a cambios en atributos
|
|
1023
|
+
this.tableObject.attributeChange.subscribe(event => {
|
|
1024
|
+
const { name: tableAttr, value } = event;
|
|
1025
|
+
const compAttr = this.formConfig.componentTableAttrMap[tableAttr];
|
|
1026
|
+
this.hasOwnProperty(compAttr) && (this[compAttr] = value);
|
|
1027
|
+
});
|
|
1028
|
+
}
|
|
1000
1029
|
this.start();
|
|
1001
1030
|
}
|
|
1002
1031
|
start() { }
|
|
@@ -1011,22 +1040,22 @@ class LibTableComponent {
|
|
|
1011
1040
|
}
|
|
1012
1041
|
tableColumnSort(columnFieldCode) {
|
|
1013
1042
|
this.tableObject.setRequiredOrder(columnFieldCode);
|
|
1014
|
-
if (this.
|
|
1043
|
+
if (this.clientPaging) {
|
|
1015
1044
|
return this.tableObject.localSortData();
|
|
1016
1045
|
}
|
|
1017
1046
|
this.tableObject.notifyGetDataAction();
|
|
1018
1047
|
}
|
|
1019
1048
|
changePage(requestedPage) {
|
|
1020
|
-
if (!this.
|
|
1049
|
+
if (!this.clientPaging) {
|
|
1021
1050
|
this.tableObject.notifyGetDataAction(requestedPage);
|
|
1022
1051
|
}
|
|
1023
1052
|
}
|
|
1024
1053
|
get records() {
|
|
1025
|
-
const currentPageRecords = this.
|
|
1026
|
-
if (this.
|
|
1027
|
-
this.
|
|
1054
|
+
const currentPageRecords = this.visibleRecords;
|
|
1055
|
+
if (this.clientPaging && currentPageRecords && currentPageRecords.length > 0) {
|
|
1056
|
+
this.totalRecordsNumber = currentPageRecords.length;
|
|
1028
1057
|
return currentPageRecords.map((record, i) => (Object.assign({ id: i + 1 }, record)))
|
|
1029
|
-
.slice((this.
|
|
1058
|
+
.slice((this.currentPage - 1) * this.recordsPerPage, (this.currentPage - 1) * this.recordsPerPage + this.recordsPerPage);
|
|
1030
1059
|
}
|
|
1031
1060
|
return currentPageRecords;
|
|
1032
1061
|
}
|
|
@@ -1035,8 +1064,8 @@ class LibTableComponent {
|
|
|
1035
1064
|
let triggerDataUpdate = false;
|
|
1036
1065
|
if (eventType === TABLE_FILTER_TYPES.simpleFilterChange || eventType === TABLE_FILTER_TYPES.simpleFilterFinish) {
|
|
1037
1066
|
this.tableObject.simpleFilterText = tableFilterEvent.simpleFilterString.trim();
|
|
1038
|
-
if (this.
|
|
1039
|
-
this.tableObject.currentPage
|
|
1067
|
+
if (this.clientPaging) {
|
|
1068
|
+
this.tableObject.setAttr('currentPage', 1);
|
|
1040
1069
|
this.tableObject.updateVisibleRecords();
|
|
1041
1070
|
}
|
|
1042
1071
|
else if (eventType === TABLE_FILTER_TYPES.simpleFilterFinish) {
|
|
@@ -1061,13 +1090,19 @@ class LibTableComponent {
|
|
|
1061
1090
|
this.tableObject.notifyRecordSelection(recordId);
|
|
1062
1091
|
}
|
|
1063
1092
|
toggleSelectAll() {
|
|
1064
|
-
if (this.
|
|
1093
|
+
if (this.allSelected) {
|
|
1065
1094
|
this.tableObject.unSelectAll();
|
|
1066
1095
|
}
|
|
1067
1096
|
else {
|
|
1068
1097
|
this.tableObject.selectAll();
|
|
1069
1098
|
}
|
|
1070
1099
|
}
|
|
1100
|
+
get availableFilters() {
|
|
1101
|
+
return this.tableObject.availableFilters;
|
|
1102
|
+
}
|
|
1103
|
+
get selectedRecords() {
|
|
1104
|
+
return this.tableObject.selectedRecords;
|
|
1105
|
+
}
|
|
1071
1106
|
}
|
|
1072
1107
|
LibTableComponent.decorators = [
|
|
1073
1108
|
{ type: Component, args: [{
|
|
@@ -1460,7 +1495,8 @@ class FieldDescriptor extends FormElement {
|
|
|
1460
1495
|
return (_b = this._fieldValue) !== null && _b !== void 0 ? _b : false;
|
|
1461
1496
|
break;
|
|
1462
1497
|
case this._formConfig.fieldTypes.currency:
|
|
1463
|
-
return this._fieldValue
|
|
1498
|
+
return (typeof this._fieldValue === 'string')
|
|
1499
|
+
? this._fieldValue.replace(',', '') : this._fieldValue;
|
|
1464
1500
|
break;
|
|
1465
1501
|
default:
|
|
1466
1502
|
return this._fieldValue;
|
|
@@ -1473,20 +1509,20 @@ class FieldDescriptor extends FormElement {
|
|
|
1473
1509
|
for (let index = 0; index < fieldKeys.length; index++) {
|
|
1474
1510
|
const attrName = fieldKeys[index];
|
|
1475
1511
|
const attrValue = fld[attrName];
|
|
1476
|
-
(attrName === this._formConfig.
|
|
1477
|
-
(attrName === this._formConfig.
|
|
1478
|
-
(attrName === this._formConfig.
|
|
1479
|
-
(attrName === this._formConfig.
|
|
1480
|
-
(attrName === this._formConfig.
|
|
1481
|
-
(attrName === this._formConfig.
|
|
1482
|
-
(attrName === this._formConfig.
|
|
1483
|
-
(attrName === this._formConfig.
|
|
1484
|
-
(attrName === this._formConfig.
|
|
1485
|
-
(attrName === this._formConfig.
|
|
1486
|
-
(attrName === this._formConfig.
|
|
1487
|
-
(attrName === this._formConfig.
|
|
1488
|
-
(attrName === this._formConfig.
|
|
1489
|
-
(attrName === this._formConfig.
|
|
1512
|
+
(attrName === this._formConfig.apiFieldAttrs.visible) && this.setVisibility(attrValue);
|
|
1513
|
+
(attrName === this._formConfig.apiFieldAttrs.labelVisible) && this.setVisibleLabel(fld.visibleLabel);
|
|
1514
|
+
(attrName === this._formConfig.apiFieldAttrs.required) && this.setAttr(fldAttr.required, (_a = fld.required) !== null && _a !== void 0 ? _a : false);
|
|
1515
|
+
(attrName === this._formConfig.apiFieldAttrs.errorCode) && this.setAttr(fldAttr.errorCode, fld.errorCode);
|
|
1516
|
+
(attrName === this._formConfig.apiFieldAttrs.errorMessage) && this.setAttr(fldAttr.errorMessage, fld.errorMessage);
|
|
1517
|
+
(attrName === this._formConfig.apiFieldAttrs.tooltip) && this.setAttr(fldAttr.tooltipText, fld.tooltip);
|
|
1518
|
+
(attrName === this._formConfig.apiFieldAttrs.info) && this.setAttr(fldAttr.info, fld.info);
|
|
1519
|
+
(attrName === this._formConfig.apiFieldAttrs.editable) && this.setEditable(fld.editable);
|
|
1520
|
+
(attrName === this._formConfig.apiFieldAttrs.title) && this.setLabel(fld.fieldTitle.toString());
|
|
1521
|
+
(attrName === this._formConfig.apiFieldAttrs.value) && (this.setValue(fld.fieldValue) && this.setChanged(false));
|
|
1522
|
+
(attrName === this._formConfig.apiFieldAttrs.options) && this.setFieldOptions(fld.fieldOptions);
|
|
1523
|
+
(attrName === this._formConfig.apiFieldAttrs.captureType) && this.setAttr(fldAttr.captureType, fld.captureType || 'INPUT');
|
|
1524
|
+
(attrName === this._formConfig.apiFieldAttrs.type) && this.setFieldType(fld.fieldTypeCode);
|
|
1525
|
+
(attrName === this._formConfig.apiFieldAttrs.maxLength) && this.setAttr(fldAttr.maxLength, fld.maxLength);
|
|
1490
1526
|
}
|
|
1491
1527
|
}
|
|
1492
1528
|
setFieldType(inputFieldType) {
|
|
@@ -2191,8 +2227,6 @@ class LibFormManagerService {
|
|
|
2191
2227
|
}
|
|
2192
2228
|
// Métodos virtuales para las aplicaciones
|
|
2193
2229
|
getFormDefinition(formCode) { }
|
|
2194
|
-
getFormRoute(formCode) { }
|
|
2195
|
-
getRouteForm(path) { }
|
|
2196
2230
|
execServerAction(actionDetail) { }
|
|
2197
2231
|
goToForm(formCode, token, subject) { }
|
|
2198
2232
|
loadStack() { }
|
|
@@ -2501,40 +2535,6 @@ class BasicFormComponent {
|
|
|
2501
2535
|
target.extra = (_h = target === null || target === void 0 ? void 0 : target.extra) !== null && _h !== void 0 ? _h : {};
|
|
2502
2536
|
this.formManagerService.openForm(origin, target);
|
|
2503
2537
|
}
|
|
2504
|
-
/**
|
|
2505
|
-
* @deprecated Este método ya no debería ser utilizado. Use openForm con el nombre del formulario
|
|
2506
|
-
*/
|
|
2507
|
-
goToPage(navigationArray, predefinedFields, options = null) {
|
|
2508
|
-
var _a;
|
|
2509
|
-
let origin = null;
|
|
2510
|
-
const cleanStack = (_a = options === null || options === void 0 ? void 0 : options.cleanStack) !== null && _a !== void 0 ? _a : false;
|
|
2511
|
-
if (!cleanStack) {
|
|
2512
|
-
origin = {
|
|
2513
|
-
name: this.name,
|
|
2514
|
-
url: this._formRoute,
|
|
2515
|
-
token: this.controlToken,
|
|
2516
|
-
fields: this.inputDataFields,
|
|
2517
|
-
extra: this.extraData
|
|
2518
|
-
};
|
|
2519
|
-
}
|
|
2520
|
-
const target = {
|
|
2521
|
-
name: this.formManagerService.getRouteForm(navigationArray === null || navigationArray === void 0 ? void 0 : navigationArray[0]),
|
|
2522
|
-
url: navigationArray === null || navigationArray === void 0 ? void 0 : navigationArray[0],
|
|
2523
|
-
state: navigationArray === null || navigationArray === void 0 ? void 0 : navigationArray[1],
|
|
2524
|
-
subject: navigationArray === null || navigationArray === void 0 ? void 0 : navigationArray[2],
|
|
2525
|
-
fields: predefinedFields,
|
|
2526
|
-
extra: null,
|
|
2527
|
-
};
|
|
2528
|
-
this.formManagerService.openForm(origin, target);
|
|
2529
|
-
}
|
|
2530
|
-
/**
|
|
2531
|
-
* @deprecated Este método ya no debería ser utilizado. Use openForm con el nombre del formulario
|
|
2532
|
-
*/
|
|
2533
|
-
goToNewPage(nav, flds) { return this.goToPage(nav, flds, { cleanStack: true }); }
|
|
2534
|
-
/**
|
|
2535
|
-
* @deprecated Este método ya no debería ser utilizado. Use openForm con el nombre del formulario
|
|
2536
|
-
*/
|
|
2537
|
-
goToSubPage(nav, flds) { return this.goToPage(nav, flds, { cleanStack: false }); }
|
|
2538
2538
|
canGoBack() { return this.originToken !== null; }
|
|
2539
2539
|
goBack() { return this.formManagerService.backTo(); }
|
|
2540
2540
|
goBackForm() { return this.goBack(); }
|
|
@@ -2568,7 +2568,8 @@ class BasicFormComponent {
|
|
|
2568
2568
|
this.controlToken = (_a = params === null || params === void 0 ? void 0 : params[TOKEN]) !== null && _a !== void 0 ? _a : null;
|
|
2569
2569
|
const { token, subject, state, fields, extra, originToken } = this.formManagerService.getFormInfo(this.controlToken);
|
|
2570
2570
|
if (!this.controlToken || this.controlToken !== token) {
|
|
2571
|
-
console.log(`No se obtuvo un token válido para abrir el formulario ${this.controlToken}->${token}`);
|
|
2571
|
+
console.log(`No se obtuvo un token válido para abrir el formulario ${this.name}:${this.controlToken}->${token}`);
|
|
2572
|
+
return;
|
|
2572
2573
|
}
|
|
2573
2574
|
this.formSubject = (_c = (_b = params === null || params === void 0 ? void 0 : params[SUBJECT]) !== null && _b !== void 0 ? _b : subject) !== null && _c !== void 0 ? _c : null;
|
|
2574
2575
|
this.inputDataFields = fields;
|