tnx-shared 5.3.271 → 5.3.273

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.
@@ -1653,6 +1653,7 @@
1653
1653
  _this.rowButtonTemplate = null;
1654
1654
  _this.rowButtonBeforeTemplate = null;
1655
1655
  _this.hiddenPageSetting = false;
1656
+ _this.showEditLink = true;
1656
1657
  for (var key in init) {
1657
1658
  _this[key] = init[key];
1658
1659
  }
@@ -16286,8 +16287,11 @@
16286
16287
  }, 100);
16287
16288
  return [2 /*return*/, false];
16288
16289
  }
16289
- _e.label = 2;
16290
- case 2: return [2 /*return*/, true];
16290
+ return [3 /*break*/, 3];
16291
+ case 2:
16292
+ this.removeAllError();
16293
+ _e.label = 3;
16294
+ case 3: return [2 /*return*/, true];
16291
16295
  }
16292
16296
  });
16293
16297
  });
@@ -16739,8 +16743,24 @@
16739
16743
  this._removeError(field);
16740
16744
  }
16741
16745
  };
16746
+ CrudFormComponent.prototype.removeAllError = function () {
16747
+ var e_30, _e;
16748
+ try {
16749
+ for (var _f = __values(this._rootNode.childNodes), _g = _f.next(); !_g.done; _g = _f.next()) {
16750
+ var childNode = _g.value;
16751
+ this.removeAllErrorByNodes(childNode);
16752
+ }
16753
+ }
16754
+ catch (e_30_1) { e_30 = { error: e_30_1 }; }
16755
+ finally {
16756
+ try {
16757
+ if (_g && !_g.done && (_e = _f.return)) _e.call(_f);
16758
+ }
16759
+ finally { if (e_30) throw e_30.error; }
16760
+ }
16761
+ };
16742
16762
  CrudFormComponent.prototype.removeAllErrorByNodes = function (currentNode) {
16743
- var e_30, _e, e_31, _f;
16763
+ var e_31, _e, e_32, _f;
16744
16764
  var _a, _b;
16745
16765
  currentNode.parentNode.model._errors[currentNode.field] = [];
16746
16766
  if (!((_a = currentNode.childNodes) === null || _a === void 0 ? void 0 : _a.length)) {
@@ -16754,26 +16774,26 @@
16754
16774
  continue;
16755
16775
  }
16756
16776
  try {
16757
- for (var _j = (e_31 = void 0, __values(childNode.childNodes)), _k = _j.next(); !_k.done; _k = _j.next()) {
16777
+ for (var _j = (e_32 = void 0, __values(childNode.childNodes)), _k = _j.next(); !_k.done; _k = _j.next()) {
16758
16778
  var node = _k.value;
16759
16779
  this.removeAllErrorByNodes(node);
16760
16780
  }
16761
16781
  }
16762
- catch (e_31_1) { e_31 = { error: e_31_1 }; }
16782
+ catch (e_32_1) { e_32 = { error: e_32_1 }; }
16763
16783
  finally {
16764
16784
  try {
16765
16785
  if (_k && !_k.done && (_f = _j.return)) _f.call(_j);
16766
16786
  }
16767
- finally { if (e_31) throw e_31.error; }
16787
+ finally { if (e_32) throw e_32.error; }
16768
16788
  }
16769
16789
  }
16770
16790
  }
16771
- catch (e_30_1) { e_30 = { error: e_30_1 }; }
16791
+ catch (e_31_1) { e_31 = { error: e_31_1 }; }
16772
16792
  finally {
16773
16793
  try {
16774
16794
  if (_h && !_h.done && (_e = _g.return)) _e.call(_g);
16775
16795
  }
16776
- finally { if (e_30) throw e_30.error; }
16796
+ finally { if (e_31) throw e_31.error; }
16777
16797
  }
16778
16798
  };
16779
16799
  CrudFormComponent.prototype.cacheControlValue = function (control, value, parentPath) {
@@ -16855,7 +16875,7 @@
16855
16875
  * @param options
16856
16876
  */
16857
16877
  CrudFormComponent.prototype.focusFirstControl = function () {
16858
- var e_32, _e;
16878
+ var e_33, _e;
16859
16879
  var formElement = this.formElement.nativeElement;
16860
16880
  var divs = formElement.querySelectorAll('div.crud-form-control');
16861
16881
  if (divs) {
@@ -16890,12 +16910,12 @@
16890
16910
  }
16891
16911
  }
16892
16912
  }
16893
- catch (e_32_1) { e_32 = { error: e_32_1 }; }
16913
+ catch (e_33_1) { e_33 = { error: e_33_1 }; }
16894
16914
  finally {
16895
16915
  try {
16896
16916
  if (divs_1_1 && !divs_1_1.done && (_e = divs_1.return)) _e.call(divs_1);
16897
16917
  }
16898
- finally { if (e_32) throw e_32.error; }
16918
+ finally { if (e_33) throw e_33.error; }
16899
16919
  }
16900
16920
  }
16901
16921
  };
@@ -17059,7 +17079,7 @@
17059
17079
  if (fireEventFinish === void 0) { fireEventFinish = true; }
17060
17080
  return __awaiter(this, void 0, void 0, function () {
17061
17081
  var tableNode, index, parentPath, data, _e, _f, subControl, toAdd, newRowNode, _b_3, _c_3, _d_1;
17062
- var e_33, _g;
17082
+ var e_34, _g;
17063
17083
  return __generator(this, function (_h) {
17064
17084
  switch (_h.label) {
17065
17085
  case 0:
@@ -17091,12 +17111,12 @@
17091
17111
  this.initControlDefaultValue(data, subControl, parentPath);
17092
17112
  }
17093
17113
  }
17094
- catch (e_33_1) { e_33 = { error: e_33_1 }; }
17114
+ catch (e_34_1) { e_34 = { error: e_34_1 }; }
17095
17115
  finally {
17096
17116
  try {
17097
17117
  if (_f && !_f.done && (_g = _e.return)) _g.call(_e);
17098
17118
  }
17099
- finally { if (e_33) throw e_33.error; }
17119
+ finally { if (e_34) throw e_34.error; }
17100
17120
  }
17101
17121
  toAdd = true;
17102
17122
  if (control.onAdding) {
@@ -17182,7 +17202,7 @@
17182
17202
  CrudFormComponent.prototype.handleSavedTableRow = function (data) {
17183
17203
  return __awaiter(this, void 0, void 0, function () {
17184
17204
  var control, tablePath, eventType, tableNode, index, parentPath, _e, _f, subControl, toAdd, newRowNode, _b_4, _c_4, _d_2;
17185
- var e_34, _g;
17205
+ var e_35, _g;
17186
17206
  return __generator(this, function (_h) {
17187
17207
  switch (_h.label) {
17188
17208
  case 0:
@@ -17204,12 +17224,12 @@
17204
17224
  this.initControlModel(data, subControl, parentPath);
17205
17225
  }
17206
17226
  }
17207
- catch (e_34_1) { e_34 = { error: e_34_1 }; }
17227
+ catch (e_35_1) { e_35 = { error: e_35_1 }; }
17208
17228
  finally {
17209
17229
  try {
17210
17230
  if (_f && !_f.done && (_g = _e.return)) _g.call(_e);
17211
17231
  }
17212
- finally { if (e_34) throw e_34.error; }
17232
+ finally { if (e_35) throw e_35.error; }
17213
17233
  }
17214
17234
  toAdd = true;
17215
17235
  if (control.onAdding) {
@@ -17644,7 +17664,7 @@
17644
17664
  }
17645
17665
  };
17646
17666
  ControlTreeNode.prototype.initChildNodes = function (model, schemas, keysPlus) {
17647
- var e_35, _e, e_36, _f;
17667
+ var e_36, _e, e_37, _f;
17648
17668
  if (isLiteralObject(model)) {
17649
17669
  var allKey = new Set(__spreadArray(__spreadArray([], __read(keysPlus)), __read(Object.keys(model))));
17650
17670
  try {
@@ -17657,12 +17677,12 @@
17657
17677
  }
17658
17678
  }
17659
17679
  }
17660
- catch (e_35_1) { e_35 = { error: e_35_1 }; }
17680
+ catch (e_36_1) { e_36 = { error: e_36_1 }; }
17661
17681
  finally {
17662
17682
  try {
17663
17683
  if (allKey_1_1 && !allKey_1_1.done && (_e = allKey_1.return)) _e.call(allKey_1);
17664
17684
  }
17665
- finally { if (e_35) throw e_35.error; }
17685
+ finally { if (e_36) throw e_36.error; }
17666
17686
  }
17667
17687
  // Sau khi đã init xong node cho row thì fire event cho các control trong row
17668
17688
  // 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 +17714,12 @@
17694
17714
  i++;
17695
17715
  }
17696
17716
  }
17697
- catch (e_36_1) { e_36 = { error: e_36_1 }; }
17717
+ catch (e_37_1) { e_37 = { error: e_37_1 }; }
17698
17718
  finally {
17699
17719
  try {
17700
17720
  if (model_3_1 && !model_3_1.done && (_f = model_3.return)) _f.call(model_3);
17701
17721
  }
17702
- finally { if (e_36) throw e_36.error; }
17722
+ finally { if (e_37) throw e_37.error; }
17703
17723
  }
17704
17724
  }
17705
17725
  }
@@ -17845,7 +17865,7 @@
17845
17865
  return this.findSchemaInTree(this.rootNode, schemaPath.toLowerCase());
17846
17866
  };
17847
17867
  ControlTreeNode.prototype.findInTree = function (node, modelPath) {
17848
- var e_37, _e;
17868
+ var e_38, _e;
17849
17869
  if (node.modelPath != null && node.modelPath.toLowerCase() == modelPath.toLowerCase()) {
17850
17870
  return node;
17851
17871
  }
@@ -17860,18 +17880,18 @@
17860
17880
  }
17861
17881
  }
17862
17882
  }
17863
- catch (e_37_1) { e_37 = { error: e_37_1 }; }
17883
+ catch (e_38_1) { e_38 = { error: e_38_1 }; }
17864
17884
  finally {
17865
17885
  try {
17866
17886
  if (_g && !_g.done && (_e = _f.return)) _e.call(_f);
17867
17887
  }
17868
- finally { if (e_37) throw e_37.error; }
17888
+ finally { if (e_38) throw e_38.error; }
17869
17889
  }
17870
17890
  }
17871
17891
  return null;
17872
17892
  };
17873
17893
  ControlTreeNode.prototype.findSchemaInTree = function (node, schemaPath) {
17874
- var e_38, _e;
17894
+ var e_39, _e;
17875
17895
  if (node.schemaPath != null && node.schemaPath.toLowerCase() == schemaPath.toLowerCase()) {
17876
17896
  return node;
17877
17897
  }
@@ -17886,12 +17906,12 @@
17886
17906
  }
17887
17907
  }
17888
17908
  }
17889
- catch (e_38_1) { e_38 = { error: e_38_1 }; }
17909
+ catch (e_39_1) { e_39 = { error: e_39_1 }; }
17890
17910
  finally {
17891
17911
  try {
17892
17912
  if (_g && !_g.done && (_e = _f.return)) _e.call(_f);
17893
17913
  }
17894
- finally { if (e_38) throw e_38.error; }
17914
+ finally { if (e_39) throw e_39.error; }
17895
17915
  }
17896
17916
  }
17897
17917
  return null;
@@ -47030,7 +47050,7 @@
47030
47050
  this.setting.hiddenSettingPermission = true;
47031
47051
  this.setting.hiddenAdvanceSearch = this.control.hiddenAdvanceSearch;
47032
47052
  this.setting.fieldSearchText = this.control.fieldSearchText;
47033
- this.setting.showEditLink = !this.readOnly;
47053
+ this.setting.showEditLink = !this.readOnly && this.control.showEditLink;
47034
47054
  this.setting.hiddenPageSetting = this.control.hiddenPageSetting;
47035
47055
  this.plusUrl = this.control.plusUrl;
47036
47056
  // Todo: HieuND
@@ -47061,7 +47081,8 @@
47061
47081
  dataSource: column.dataSource,
47062
47082
  groupCode: column.groupCode,
47063
47083
  order: column.order,
47064
- sort: column.sort
47084
+ sort: column.sort,
47085
+ showEditLink: column.showEditLink
47065
47086
  });
47066
47087
  if (column.dataType == 'custom') {
47067
47088
  newCol.dataType = column.code;