tnx-shared 5.3.379 → 5.3.381

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.
@@ -621,6 +621,7 @@ class CrudListSetting {
621
621
  this.entityKey = 'id';
622
622
  this.modelSchemas = [];
623
623
  this.cols = [];
624
+ this.rawCols = [];
624
625
  this.commonSchemas = [];
625
626
  this.columnSetting = new ColumnSetting();
626
627
  this.pageSetting = new PageSetting();
@@ -4132,6 +4133,17 @@ class CommonService {
4132
4133
  const temp = s.normalize('NFD');
4133
4134
  return temp.replace(regex, '').replace('\u0111', 'd').replace('\u0110', 'D');
4134
4135
  }
4136
+ extractInnerText(htmlString) {
4137
+ if (!htmlString)
4138
+ return '';
4139
+ const withoutComments = htmlString.replace(/<!--[\s\S]*?-->/g, '');
4140
+ // Tạo một DOM element từ chuỗi HTML đã loại bỏ comment
4141
+ const parser = new DOMParser();
4142
+ let doc = parser.parseFromString(withoutComments, 'text/html');
4143
+ const result = doc.body.innerText.trim();
4144
+ doc = null; // Dọn dẹp tham chiếu (không cần thiết nếu scope kết thúc)
4145
+ return result;
4146
+ }
4135
4147
  }
4136
4148
  CommonService.ɵprov = i0.ɵɵdefineInjectable({ factory: function CommonService_Factory() { return new CommonService(i0.ɵɵinject(ModuleConfigService)); }, token: CommonService, providedIn: "root" });
4137
4149
  CommonService.decorators = [
@@ -22667,7 +22679,7 @@ class CommonSearchFormComponent extends DataFormBase {
22667
22679
  this.mdWidth = this.parentSetting.mdWidthCommonSearch;
22668
22680
  this.setting.baseService = this.parentSetting.baseService;
22669
22681
  this.isCustomGenerateSearch = this.parentSetting.commonSchemas.length > 0;
22670
- const columnFilters = this.parentSetting.cols.filter(p => p.allowFilter && !p.field.startsWith('str')).sort((a, b) => {
22682
+ const columnFilters = this.parentSetting.rawCols.filter(p => p.allowFilter && !p.field.startsWith('str')).sort((a, b) => {
22671
22683
  if (a.order < b.order) {
22672
22684
  return -1;
22673
22685
  }
@@ -22894,7 +22906,7 @@ class CommonSearchFormComponent extends DataFormBase {
22894
22906
  var _a;
22895
22907
  if (!data.hasOwnProperty(item) || (!data[item] || data[item].length < 1))
22896
22908
  return;
22897
- const valueField = ((_a = this.parentSetting.cols.find(p => p.field === item)) === null || _a === void 0 ? void 0 : _a.valueField) || 'id';
22909
+ const valueField = ((_a = this.parentSetting.rawCols.find(p => p.field === item)) === null || _a === void 0 ? void 0 : _a.valueField) || 'id';
22898
22910
  if (data[item].length) {
22899
22911
  data[item] = data[item].map(p => p[valueField]);
22900
22912
  }
@@ -23508,6 +23520,7 @@ class ListBase extends ComponentBaseWithButton {
23508
23520
  this.model.baseReady = false;
23509
23521
  if (this.setting.cols) {
23510
23522
  this.setting.cols = this.setting.cols.filter(q => !q.removeOnInit);
23523
+ Object.assign(this.setting.rawCols, this.setting.cols);
23511
23524
  }
23512
23525
  this.setting.customGetData = this.customGetData;
23513
23526
  this.mergeInfoToColumnSchema();