tuain-ng-forms-lib 15.1.14 → 15.1.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2020/lib/classes/forms/field.mjs +11 -1
- package/esm2020/lib/classes/forms/table/table.mjs +1 -6
- package/esm2020/lib/components/elements/tables/table.component.mjs +2 -2
- package/esm2020/lib/components/forms/basic-form.mjs +2 -21
- package/fesm2015/tuain-ng-forms-lib.mjs +12 -26
- package/fesm2015/tuain-ng-forms-lib.mjs.map +1 -1
- package/fesm2020/tuain-ng-forms-lib.mjs +12 -26
- package/fesm2020/tuain-ng-forms-lib.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -474,7 +474,7 @@ class LibTableComponent extends ElementComponent {
|
|
|
474
474
|
tableGlobalAction(actionCode) { var _a; (_a = this.table) === null || _a === void 0 ? void 0 : _a.notifyGlobalAction(actionCode); }
|
|
475
475
|
tableSelectionAction(actionCode) { var _a; (_a = this.table) === null || _a === void 0 ? void 0 : _a.notifySelectionAction(actionCode); }
|
|
476
476
|
tableActionSelected(actionEvent) { var _a; (_a = this.table) === null || _a === void 0 ? void 0 : _a.notifyInlineAction(actionEvent); }
|
|
477
|
-
tableSelectionToggle(recordId) { var _a;
|
|
477
|
+
tableSelectionToggle(recordId) { var _a; (_a = this.table) === null || _a === void 0 ? void 0 : _a.notifyRecordSelection(recordId); }
|
|
478
478
|
toggleSelectAll() { var _a, _b, _c; return ((_a = this.table) === null || _a === void 0 ? void 0 : _a.allSelected) ? (_b = this.table) === null || _b === void 0 ? void 0 : _b.unSelectAll() : (_c = this.table) === null || _c === void 0 ? void 0 : _c.selectAll(); }
|
|
479
479
|
globalFilterCompleted() { this.changePage(1); }
|
|
480
480
|
changePage(requestedPage) { var _a; (_a = this.table) === null || _a === void 0 ? void 0 : _a.changePage(requestedPage); }
|
|
@@ -935,6 +935,16 @@ class FieldDescriptor extends FormElement {
|
|
|
935
935
|
return true;
|
|
936
936
|
}
|
|
937
937
|
;
|
|
938
|
+
if (this._fieldType === this._formConfig.fieldTypes.daterange) {
|
|
939
|
+
if (!Array.isArray(fieldCurrentValue)) {
|
|
940
|
+
return true;
|
|
941
|
+
}
|
|
942
|
+
if (fieldCurrentValue.length !== 2 || !fieldCurrentValue[0] || !fieldCurrentValue[1]) {
|
|
943
|
+
return true;
|
|
944
|
+
}
|
|
945
|
+
return false;
|
|
946
|
+
}
|
|
947
|
+
;
|
|
938
948
|
if (this._fieldType === this._formConfig.fieldTypes.phone) {
|
|
939
949
|
if (!Array.isArray(fieldCurrentValue)) {
|
|
940
950
|
return true;
|
|
@@ -1610,15 +1620,11 @@ class RecordTable extends FormElement {
|
|
|
1610
1620
|
}
|
|
1611
1621
|
notifyRecordSelection(recordId) {
|
|
1612
1622
|
var _a;
|
|
1613
|
-
console.log('notifyRecordSelection 1');
|
|
1614
1623
|
const record = this.getTableRecord(recordId);
|
|
1615
|
-
console.log('notifyRecordSelection 2');
|
|
1616
1624
|
if (!record) {
|
|
1617
1625
|
return;
|
|
1618
1626
|
}
|
|
1619
|
-
console.log('notifyRecordSelection 3');
|
|
1620
1627
|
record.toggleSelect();
|
|
1621
|
-
console.log('notifyRecordSelection 4');
|
|
1622
1628
|
this.requestedPage = (_a = this.currentPage) !== null && _a !== void 0 ? _a : 1;
|
|
1623
1629
|
const tableEvent = {
|
|
1624
1630
|
tableCode: this.tableCode,
|
|
@@ -1628,7 +1634,6 @@ class RecordTable extends FormElement {
|
|
|
1628
1634
|
recordData: record.recordData
|
|
1629
1635
|
}
|
|
1630
1636
|
};
|
|
1631
|
-
console.log(`notifyRecordSelection 5 ${JSON.stringify(tableEvent, null, 2)}`);
|
|
1632
1637
|
this.recordSelectionTrigger.next(tableEvent);
|
|
1633
1638
|
}
|
|
1634
1639
|
notifySelectionAction(actionCode) {
|
|
@@ -3064,10 +3069,7 @@ class BasicFormComponent extends FormStructureAndData {
|
|
|
3064
3069
|
formTables.forEach(table => {
|
|
3065
3070
|
table.inlineActionTrigger.subscribe(event => this.startTableAction(event));
|
|
3066
3071
|
table.globalActionTrigger.subscribe(event => this.startTableGlobalAction(event));
|
|
3067
|
-
table.recordSelectionTrigger.subscribe(event =>
|
|
3068
|
-
console.log(`recordSelectionTrigger subscribe ${JSON.stringify(event, null, 2)}`);
|
|
3069
|
-
this.startTableRecordSelection(event);
|
|
3070
|
-
});
|
|
3072
|
+
table.recordSelectionTrigger.subscribe(event => this.startTableRecordSelection(event));
|
|
3071
3073
|
table.selectionActionTrigger.subscribe(event => this.startTableSelectionAction(event));
|
|
3072
3074
|
table.getDataTrigger.subscribe(event => this.startTableGetData(event));
|
|
3073
3075
|
// Adicionalmente se le pide a la tabla se subscriba al cambio de estado del formulario
|
|
@@ -3818,16 +3820,12 @@ class BasicFormComponent extends FormStructureAndData {
|
|
|
3818
3820
|
}
|
|
3819
3821
|
startTableRecordSelection(tableActionEvent) {
|
|
3820
3822
|
return __awaiter(this, void 0, void 0, function* () {
|
|
3821
|
-
console.log(`startTableRecordSelection ${JSON.stringify(tableActionEvent, null, 2)}`);
|
|
3822
3823
|
this.notifyFormActivity();
|
|
3823
|
-
console.log(`startTableRecordSelection 2`);
|
|
3824
3824
|
const { tableCode, actionDetail } = tableActionEvent;
|
|
3825
3825
|
const tableObject = this.getTable(tableCode);
|
|
3826
|
-
console.log(`startTableRecordSelection 3`);
|
|
3827
3826
|
if (!tableObject) {
|
|
3828
3827
|
return;
|
|
3829
3828
|
}
|
|
3830
|
-
console.log(`startTableRecordSelection 4`);
|
|
3831
3829
|
this.resetError();
|
|
3832
3830
|
const { recordId, recordData } = actionDetail;
|
|
3833
3831
|
const tableSelectionDetail = {
|
|
@@ -3836,34 +3834,26 @@ class BasicFormComponent extends FormStructureAndData {
|
|
|
3836
3834
|
recordId,
|
|
3837
3835
|
recordData
|
|
3838
3836
|
};
|
|
3839
|
-
console.log(`startTableRecordSelection 5`);
|
|
3840
3837
|
const tableEventHandlers = this._tableSelectionsStart[tableCode];
|
|
3841
|
-
console.log(`startTableRecordSelection 6 ${tableEventHandlers === null || tableEventHandlers === void 0 ? void 0 : tableEventHandlers.length}`);
|
|
3842
3838
|
if (tableEventHandlers) {
|
|
3843
3839
|
const clientActionPromises = [];
|
|
3844
3840
|
for (const tableSelectionMethod of tableEventHandlers) {
|
|
3845
3841
|
const { callback, properties } = tableSelectionMethod;
|
|
3846
|
-
console.log(`startTableRecordSelection 7`);
|
|
3847
|
-
console.log(callback);
|
|
3848
3842
|
const clientActionPromise = callback(tableSelectionDetail);
|
|
3849
3843
|
clientActionPromises.push(clientActionPromise);
|
|
3850
3844
|
}
|
|
3851
3845
|
const clientActionResults = yield Promise.all(clientActionPromises);
|
|
3852
3846
|
const continueAction = clientActionResults.reduce((total, curr) => (total && (curr !== false)), true);
|
|
3853
|
-
console.log(`startTableRecordSelection 8 ${continueAction}`);
|
|
3854
3847
|
if (!continueAction) {
|
|
3855
3848
|
return;
|
|
3856
3849
|
}
|
|
3857
3850
|
}
|
|
3858
|
-
console.log(`startTableRecordSelection 9`);
|
|
3859
3851
|
this.startTableServerRecordSelection(tableSelectionDetail);
|
|
3860
3852
|
});
|
|
3861
3853
|
}
|
|
3862
3854
|
startTableServerRecordSelection(tableSelectionDetail) {
|
|
3863
3855
|
var _a;
|
|
3864
3856
|
return __awaiter(this, void 0, void 0, function* () {
|
|
3865
|
-
console.log(`startTableServerRecordSelection 1`);
|
|
3866
|
-
console.log(tableSelectionDetail);
|
|
3867
3857
|
const { tableObject, tableCode, recordId, recordData } = tableSelectionDetail;
|
|
3868
3858
|
if (!tableObject) {
|
|
3869
3859
|
return;
|
|
@@ -3879,17 +3869,14 @@ class BasicFormComponent extends FormStructureAndData {
|
|
|
3879
3869
|
tableRecordId: recordId,
|
|
3880
3870
|
tableRecordData: recordData
|
|
3881
3871
|
};
|
|
3882
|
-
console.log(`startTableServerRecordSelection 2 ${JSON.stringify(actionSubject, null, 2)}`);
|
|
3883
3872
|
actionResult = yield this
|
|
3884
3873
|
.requestFormAction(formActions.tableAction, actionSubject);
|
|
3885
3874
|
serverError = !!this.errorOccured();
|
|
3886
3875
|
}
|
|
3887
|
-
console.log(`startTableServerRecordSelection 3`);
|
|
3888
3876
|
yield this.finishTableRecordSelection(tableSelectionDetail, actionResult, serverError);
|
|
3889
3877
|
if (serverError) {
|
|
3890
3878
|
this.displayTableServerError();
|
|
3891
3879
|
}
|
|
3892
|
-
console.log(`startTableServerRecordSelection 4`);
|
|
3893
3880
|
tableObject.freeWaiting();
|
|
3894
3881
|
});
|
|
3895
3882
|
}
|
|
@@ -4124,7 +4111,6 @@ class BasicFormComponent extends FormStructureAndData {
|
|
|
4124
4111
|
}
|
|
4125
4112
|
notifyFormActivity() {
|
|
4126
4113
|
if (this._notifyFormActivity) {
|
|
4127
|
-
console.log(`notifyFormActivity ${this.name}`);
|
|
4128
4114
|
this._eventEmiter.next('formActivity', { code: this.formCode });
|
|
4129
4115
|
}
|
|
4130
4116
|
}
|