tnx-shared 5.3.271 → 5.3.272
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/tnx-shared.umd.js +47 -28
- package/bundles/tnx-shared.umd.js.map +1 -1
- package/bundles/tnx-shared.umd.min.js +1 -1
- package/bundles/tnx-shared.umd.min.js.map +1 -1
- package/components/crud/crud-form/crud-form.component.d.ts +1 -0
- package/components/crud/crud-form/crud-form.component.d.ts.map +1 -1
- package/esm2015/components/crud/crud-form/crud-form.component.js +9 -1
- package/fesm2015/tnx-shared.js +8 -0
- package/fesm2015/tnx-shared.js.map +1 -1
- package/package.json +2 -2
- package/tnx-shared.metadata.json +1 -1
|
@@ -16286,8 +16286,11 @@
|
|
|
16286
16286
|
}, 100);
|
|
16287
16287
|
return [2 /*return*/, false];
|
|
16288
16288
|
}
|
|
16289
|
-
|
|
16290
|
-
case 2:
|
|
16289
|
+
return [3 /*break*/, 3];
|
|
16290
|
+
case 2:
|
|
16291
|
+
this.removeAllError();
|
|
16292
|
+
_e.label = 3;
|
|
16293
|
+
case 3: return [2 /*return*/, true];
|
|
16291
16294
|
}
|
|
16292
16295
|
});
|
|
16293
16296
|
});
|
|
@@ -16739,8 +16742,24 @@
|
|
|
16739
16742
|
this._removeError(field);
|
|
16740
16743
|
}
|
|
16741
16744
|
};
|
|
16745
|
+
CrudFormComponent.prototype.removeAllError = function () {
|
|
16746
|
+
var e_30, _e;
|
|
16747
|
+
try {
|
|
16748
|
+
for (var _f = __values(this._rootNode.childNodes), _g = _f.next(); !_g.done; _g = _f.next()) {
|
|
16749
|
+
var childNode = _g.value;
|
|
16750
|
+
this.removeAllErrorByNodes(childNode);
|
|
16751
|
+
}
|
|
16752
|
+
}
|
|
16753
|
+
catch (e_30_1) { e_30 = { error: e_30_1 }; }
|
|
16754
|
+
finally {
|
|
16755
|
+
try {
|
|
16756
|
+
if (_g && !_g.done && (_e = _f.return)) _e.call(_f);
|
|
16757
|
+
}
|
|
16758
|
+
finally { if (e_30) throw e_30.error; }
|
|
16759
|
+
}
|
|
16760
|
+
};
|
|
16742
16761
|
CrudFormComponent.prototype.removeAllErrorByNodes = function (currentNode) {
|
|
16743
|
-
var
|
|
16762
|
+
var e_31, _e, e_32, _f;
|
|
16744
16763
|
var _a, _b;
|
|
16745
16764
|
currentNode.parentNode.model._errors[currentNode.field] = [];
|
|
16746
16765
|
if (!((_a = currentNode.childNodes) === null || _a === void 0 ? void 0 : _a.length)) {
|
|
@@ -16754,26 +16773,26 @@
|
|
|
16754
16773
|
continue;
|
|
16755
16774
|
}
|
|
16756
16775
|
try {
|
|
16757
|
-
for (var _j = (
|
|
16776
|
+
for (var _j = (e_32 = void 0, __values(childNode.childNodes)), _k = _j.next(); !_k.done; _k = _j.next()) {
|
|
16758
16777
|
var node = _k.value;
|
|
16759
16778
|
this.removeAllErrorByNodes(node);
|
|
16760
16779
|
}
|
|
16761
16780
|
}
|
|
16762
|
-
catch (
|
|
16781
|
+
catch (e_32_1) { e_32 = { error: e_32_1 }; }
|
|
16763
16782
|
finally {
|
|
16764
16783
|
try {
|
|
16765
16784
|
if (_k && !_k.done && (_f = _j.return)) _f.call(_j);
|
|
16766
16785
|
}
|
|
16767
|
-
finally { if (
|
|
16786
|
+
finally { if (e_32) throw e_32.error; }
|
|
16768
16787
|
}
|
|
16769
16788
|
}
|
|
16770
16789
|
}
|
|
16771
|
-
catch (
|
|
16790
|
+
catch (e_31_1) { e_31 = { error: e_31_1 }; }
|
|
16772
16791
|
finally {
|
|
16773
16792
|
try {
|
|
16774
16793
|
if (_h && !_h.done && (_e = _g.return)) _e.call(_g);
|
|
16775
16794
|
}
|
|
16776
|
-
finally { if (
|
|
16795
|
+
finally { if (e_31) throw e_31.error; }
|
|
16777
16796
|
}
|
|
16778
16797
|
};
|
|
16779
16798
|
CrudFormComponent.prototype.cacheControlValue = function (control, value, parentPath) {
|
|
@@ -16855,7 +16874,7 @@
|
|
|
16855
16874
|
* @param options
|
|
16856
16875
|
*/
|
|
16857
16876
|
CrudFormComponent.prototype.focusFirstControl = function () {
|
|
16858
|
-
var
|
|
16877
|
+
var e_33, _e;
|
|
16859
16878
|
var formElement = this.formElement.nativeElement;
|
|
16860
16879
|
var divs = formElement.querySelectorAll('div.crud-form-control');
|
|
16861
16880
|
if (divs) {
|
|
@@ -16890,12 +16909,12 @@
|
|
|
16890
16909
|
}
|
|
16891
16910
|
}
|
|
16892
16911
|
}
|
|
16893
|
-
catch (
|
|
16912
|
+
catch (e_33_1) { e_33 = { error: e_33_1 }; }
|
|
16894
16913
|
finally {
|
|
16895
16914
|
try {
|
|
16896
16915
|
if (divs_1_1 && !divs_1_1.done && (_e = divs_1.return)) _e.call(divs_1);
|
|
16897
16916
|
}
|
|
16898
|
-
finally { if (
|
|
16917
|
+
finally { if (e_33) throw e_33.error; }
|
|
16899
16918
|
}
|
|
16900
16919
|
}
|
|
16901
16920
|
};
|
|
@@ -17059,7 +17078,7 @@
|
|
|
17059
17078
|
if (fireEventFinish === void 0) { fireEventFinish = true; }
|
|
17060
17079
|
return __awaiter(this, void 0, void 0, function () {
|
|
17061
17080
|
var tableNode, index, parentPath, data, _e, _f, subControl, toAdd, newRowNode, _b_3, _c_3, _d_1;
|
|
17062
|
-
var
|
|
17081
|
+
var e_34, _g;
|
|
17063
17082
|
return __generator(this, function (_h) {
|
|
17064
17083
|
switch (_h.label) {
|
|
17065
17084
|
case 0:
|
|
@@ -17091,12 +17110,12 @@
|
|
|
17091
17110
|
this.initControlDefaultValue(data, subControl, parentPath);
|
|
17092
17111
|
}
|
|
17093
17112
|
}
|
|
17094
|
-
catch (
|
|
17113
|
+
catch (e_34_1) { e_34 = { error: e_34_1 }; }
|
|
17095
17114
|
finally {
|
|
17096
17115
|
try {
|
|
17097
17116
|
if (_f && !_f.done && (_g = _e.return)) _g.call(_e);
|
|
17098
17117
|
}
|
|
17099
|
-
finally { if (
|
|
17118
|
+
finally { if (e_34) throw e_34.error; }
|
|
17100
17119
|
}
|
|
17101
17120
|
toAdd = true;
|
|
17102
17121
|
if (control.onAdding) {
|
|
@@ -17182,7 +17201,7 @@
|
|
|
17182
17201
|
CrudFormComponent.prototype.handleSavedTableRow = function (data) {
|
|
17183
17202
|
return __awaiter(this, void 0, void 0, function () {
|
|
17184
17203
|
var control, tablePath, eventType, tableNode, index, parentPath, _e, _f, subControl, toAdd, newRowNode, _b_4, _c_4, _d_2;
|
|
17185
|
-
var
|
|
17204
|
+
var e_35, _g;
|
|
17186
17205
|
return __generator(this, function (_h) {
|
|
17187
17206
|
switch (_h.label) {
|
|
17188
17207
|
case 0:
|
|
@@ -17204,12 +17223,12 @@
|
|
|
17204
17223
|
this.initControlModel(data, subControl, parentPath);
|
|
17205
17224
|
}
|
|
17206
17225
|
}
|
|
17207
|
-
catch (
|
|
17226
|
+
catch (e_35_1) { e_35 = { error: e_35_1 }; }
|
|
17208
17227
|
finally {
|
|
17209
17228
|
try {
|
|
17210
17229
|
if (_f && !_f.done && (_g = _e.return)) _g.call(_e);
|
|
17211
17230
|
}
|
|
17212
|
-
finally { if (
|
|
17231
|
+
finally { if (e_35) throw e_35.error; }
|
|
17213
17232
|
}
|
|
17214
17233
|
toAdd = true;
|
|
17215
17234
|
if (control.onAdding) {
|
|
@@ -17644,7 +17663,7 @@
|
|
|
17644
17663
|
}
|
|
17645
17664
|
};
|
|
17646
17665
|
ControlTreeNode.prototype.initChildNodes = function (model, schemas, keysPlus) {
|
|
17647
|
-
var
|
|
17666
|
+
var e_36, _e, e_37, _f;
|
|
17648
17667
|
if (isLiteralObject(model)) {
|
|
17649
17668
|
var allKey = new Set(__spreadArray(__spreadArray([], __read(keysPlus)), __read(Object.keys(model))));
|
|
17650
17669
|
try {
|
|
@@ -17657,12 +17676,12 @@
|
|
|
17657
17676
|
}
|
|
17658
17677
|
}
|
|
17659
17678
|
}
|
|
17660
|
-
catch (
|
|
17679
|
+
catch (e_36_1) { e_36 = { error: e_36_1 }; }
|
|
17661
17680
|
finally {
|
|
17662
17681
|
try {
|
|
17663
17682
|
if (allKey_1_1 && !allKey_1_1.done && (_e = allKey_1.return)) _e.call(allKey_1);
|
|
17664
17683
|
}
|
|
17665
|
-
finally { if (
|
|
17684
|
+
finally { if (e_36) throw e_36.error; }
|
|
17666
17685
|
}
|
|
17667
17686
|
// Sau khi đã init xong node cho row thì fire event cho các control trong row
|
|
17668
17687
|
// Thường dùng với mục đích cần disabled, hidden các control của row khi có nhu cầu
|
|
@@ -17694,12 +17713,12 @@
|
|
|
17694
17713
|
i++;
|
|
17695
17714
|
}
|
|
17696
17715
|
}
|
|
17697
|
-
catch (
|
|
17716
|
+
catch (e_37_1) { e_37 = { error: e_37_1 }; }
|
|
17698
17717
|
finally {
|
|
17699
17718
|
try {
|
|
17700
17719
|
if (model_3_1 && !model_3_1.done && (_f = model_3.return)) _f.call(model_3);
|
|
17701
17720
|
}
|
|
17702
|
-
finally { if (
|
|
17721
|
+
finally { if (e_37) throw e_37.error; }
|
|
17703
17722
|
}
|
|
17704
17723
|
}
|
|
17705
17724
|
}
|
|
@@ -17845,7 +17864,7 @@
|
|
|
17845
17864
|
return this.findSchemaInTree(this.rootNode, schemaPath.toLowerCase());
|
|
17846
17865
|
};
|
|
17847
17866
|
ControlTreeNode.prototype.findInTree = function (node, modelPath) {
|
|
17848
|
-
var
|
|
17867
|
+
var e_38, _e;
|
|
17849
17868
|
if (node.modelPath != null && node.modelPath.toLowerCase() == modelPath.toLowerCase()) {
|
|
17850
17869
|
return node;
|
|
17851
17870
|
}
|
|
@@ -17860,18 +17879,18 @@
|
|
|
17860
17879
|
}
|
|
17861
17880
|
}
|
|
17862
17881
|
}
|
|
17863
|
-
catch (
|
|
17882
|
+
catch (e_38_1) { e_38 = { error: e_38_1 }; }
|
|
17864
17883
|
finally {
|
|
17865
17884
|
try {
|
|
17866
17885
|
if (_g && !_g.done && (_e = _f.return)) _e.call(_f);
|
|
17867
17886
|
}
|
|
17868
|
-
finally { if (
|
|
17887
|
+
finally { if (e_38) throw e_38.error; }
|
|
17869
17888
|
}
|
|
17870
17889
|
}
|
|
17871
17890
|
return null;
|
|
17872
17891
|
};
|
|
17873
17892
|
ControlTreeNode.prototype.findSchemaInTree = function (node, schemaPath) {
|
|
17874
|
-
var
|
|
17893
|
+
var e_39, _e;
|
|
17875
17894
|
if (node.schemaPath != null && node.schemaPath.toLowerCase() == schemaPath.toLowerCase()) {
|
|
17876
17895
|
return node;
|
|
17877
17896
|
}
|
|
@@ -17886,12 +17905,12 @@
|
|
|
17886
17905
|
}
|
|
17887
17906
|
}
|
|
17888
17907
|
}
|
|
17889
|
-
catch (
|
|
17908
|
+
catch (e_39_1) { e_39 = { error: e_39_1 }; }
|
|
17890
17909
|
finally {
|
|
17891
17910
|
try {
|
|
17892
17911
|
if (_g && !_g.done && (_e = _f.return)) _e.call(_f);
|
|
17893
17912
|
}
|
|
17894
|
-
finally { if (
|
|
17913
|
+
finally { if (e_39) throw e_39.error; }
|
|
17895
17914
|
}
|
|
17896
17915
|
}
|
|
17897
17916
|
return null;
|