tnx-shared 5.3.331 → 5.3.332

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.
@@ -18983,6 +18983,7 @@ class ListComponentBase extends ComponentBase {
18983
18983
  this.isSuperUser = false;
18984
18984
  this.showFormWorkflow = false;
18985
18985
  this.headerWorkflow = '';
18986
+ this.componentKey = '';
18986
18987
  this.lstBtnAuthorizeMenu = [];
18987
18988
  this.popupSizeWorkflow = new PopupSize({ width: 950, height: 540 });
18988
18989
  this.showHistoryWorkflow = false;
@@ -19434,6 +19435,7 @@ class ListComponentBase extends ComponentBase {
19434
19435
  }
19435
19436
  }
19436
19437
  initColumnSchema(cols) {
19438
+ var _a, _b, _c, _d;
19437
19439
  if (!cols || !cols.length)
19438
19440
  return;
19439
19441
  let colFunction = null, colGroup = null, colHasToggleIcon = null;
@@ -19456,6 +19458,7 @@ class ListComponentBase extends ComponentBase {
19456
19458
  colHasToggleIcon = this.setting.cols[0];
19457
19459
  }
19458
19460
  colHasToggleIcon.colHasToggleIcon = true;
19461
+ this.componentKey = `${location.pathname}/${((_d = (_c = (_b = (_a = this.container) === null || _a === void 0 ? void 0 : _a.nativeElement) === null || _b === void 0 ? void 0 : _b.closest('crud-list').parentNode) === null || _c === void 0 ? void 0 : _c.tagName) === null || _d === void 0 ? void 0 : _d.toLowerCase()) || ''}${this.setting.settingKey ? '/' + this.setting.settingKey : ''}`;
19459
19462
  this.getColorSetting();
19460
19463
  this.getColumnSetting(colGroup);
19461
19464
  this.getPageSetting();
@@ -19643,14 +19646,10 @@ class ListComponentBase extends ComponentBase {
19643
19646
  const dataSetting = localStorage.getItem(ComCtxConstants.LOCALSTORAGE_KEY.COLUMN_SETTING);
19644
19647
  const jsonData = this.tryParseJson(dataSetting);
19645
19648
  if (dataSetting && jsonData.valid && jsonData.value.length > 0) {
19646
- let pathName = location.pathname;
19647
- if (this.setting.settingKey) {
19648
- pathName += '/' + this.setting.settingKey;
19649
- }
19650
19649
  const settings = jsonData.value;
19651
19650
  for (const element of settings) {
19652
19651
  // const element = settings[i];
19653
- if (element.pathname === pathName) {
19652
+ if (element.pathname === this.componentKey) {
19654
19653
  this.setting.columnSetting.sortField = element.setting.sortField;
19655
19654
  this.setting.columnSetting.sortDir = element.setting.sortDir ? element.setting.sortDir : 0;
19656
19655
  if (this.setting.columnSetting.sortDir == 0) {
@@ -19680,16 +19679,12 @@ class ListComponentBase extends ComponentBase {
19680
19679
  }
19681
19680
  }
19682
19681
  saveColumnSetting() {
19683
- let pathName = location.pathname;
19684
- if (this.setting.settingKey) {
19685
- pathName += '/' + this.setting.settingKey;
19686
- }
19687
19682
  let columnSetting = [];
19688
19683
  let checkExist = false;
19689
19684
  const dataSetting = localStorage.getItem(ComCtxConstants.LOCALSTORAGE_KEY.COLUMN_SETTING);
19690
19685
  if (dataSetting) {
19691
19686
  columnSetting = JSON.parse(dataSetting);
19692
- const itemSetting = columnSetting.find(q => q.pathname == pathName);
19687
+ const itemSetting = columnSetting.find(q => q.pathname == this.componentKey);
19693
19688
  if (itemSetting) {
19694
19689
  itemSetting.setting.sortField = this.setting.columnSetting.sortField;
19695
19690
  itemSetting.setting.sortDir = this.setting.columnSetting.sortDir;
@@ -19700,20 +19695,16 @@ class ListComponentBase extends ComponentBase {
19700
19695
  }
19701
19696
  }
19702
19697
  if (!checkExist) {
19703
- columnSetting.push({ pathname: pathName, setting: this.setting.columnSetting });
19698
+ columnSetting.push({ pathname: this.componentKey, setting: this.setting.columnSetting });
19704
19699
  }
19705
19700
  localStorage.setItem(ComCtxConstants.LOCALSTORAGE_KEY.COLUMN_SETTING, JSON.stringify(columnSetting));
19706
19701
  }
19707
19702
  deleteColumnSetting() {
19708
- let pathName = location.pathname;
19709
- if (this.setting.settingKey) {
19710
- pathName += '/' + this.setting.settingKey;
19711
- }
19712
19703
  let columnSetting = [];
19713
19704
  const dataSetting = localStorage.getItem(ComCtxConstants.LOCALSTORAGE_KEY.COLUMN_SETTING);
19714
19705
  if (dataSetting) {
19715
19706
  columnSetting = JSON.parse(dataSetting);
19716
- const index = columnSetting.findIndex(q => q.pathname == pathName);
19707
+ const index = columnSetting.findIndex(q => q.pathname == this.componentKey);
19717
19708
  if (index > -1)
19718
19709
  columnSetting.splice(index, 1);
19719
19710
  }
@@ -19723,14 +19714,10 @@ class ListComponentBase extends ComponentBase {
19723
19714
  getColorSetting() {
19724
19715
  const dataPageSetting = localStorage.getItem(ComCtxConstants.LOCALSTORAGE_KEY.COLOR_SETTING);
19725
19716
  if (dataPageSetting) {
19726
- let pathName = location.pathname;
19727
- if (this.setting.settingKey) {
19728
- pathName += '/' + this.setting.settingKey;
19729
- }
19730
19717
  const settings = JSON.parse(dataPageSetting);
19731
19718
  for (let i = 0; i < settings.length; i++) {
19732
19719
  const element = settings[i];
19733
- if (element.pathname === pathName) {
19720
+ if (element.pathname === this.componentKey) {
19734
19721
  this.setting.colorFilterField = element.colorFilterField;
19735
19722
  this.setting.colorFilterTable = element.colorFilterTable;
19736
19723
  break;
@@ -19754,17 +19741,13 @@ class ListComponentBase extends ComponentBase {
19754
19741
  }
19755
19742
  }
19756
19743
  setColorSetting() {
19757
- let pathName = location.pathname;
19758
- if (this.setting.settingKey) {
19759
- pathName += '/' + this.setting.settingKey;
19760
- }
19761
19744
  let colorSetting = [];
19762
19745
  let checkExist = false;
19763
19746
  const dataColorSetting = localStorage.getItem(ComCtxConstants.LOCALSTORAGE_KEY.COLOR_SETTING);
19764
19747
  if (dataColorSetting) {
19765
19748
  colorSetting = JSON.parse(dataColorSetting);
19766
19749
  colorSetting.forEach(element => {
19767
- if (element.pathname === pathName) {
19750
+ if (element.pathname === this.componentKey) {
19768
19751
  element.colorFilterField = this.setting.colorFilterField;
19769
19752
  element.colorFilterTable = this.setting.colorFilterTable;
19770
19753
  checkExist = true;
@@ -19773,7 +19756,7 @@ class ListComponentBase extends ComponentBase {
19773
19756
  }
19774
19757
  if (!checkExist) {
19775
19758
  colorSetting.push({
19776
- pathname: pathName,
19759
+ pathname: this.componentKey,
19777
19760
  colorFilterField: this.setting.colorFilterField,
19778
19761
  colorFilterTable: this.setting.colorFilterTable
19779
19762
  });
@@ -19783,14 +19766,10 @@ class ListComponentBase extends ComponentBase {
19783
19766
  getPageSetting() {
19784
19767
  const dataPageSetting = localStorage.getItem(ComCtxConstants.LOCALSTORAGE_KEY.PAGE_SETTING);
19785
19768
  if (dataPageSetting) {
19786
- let pathName = location.pathname;
19787
- if (this.setting.settingKey) {
19788
- pathName += '/' + this.setting.settingKey;
19789
- }
19790
19769
  const pageSettings = JSON.parse(dataPageSetting);
19791
19770
  for (let i = 0; i < pageSettings.length; i++) {
19792
19771
  const element = pageSettings[i];
19793
- if (element.pathname === pathName) {
19772
+ if (element.pathname === this.componentKey) {
19794
19773
  this.setting.pageSetting.pageSize = element.pageSize;
19795
19774
  break;
19796
19775
  }
@@ -19798,24 +19777,20 @@ class ListComponentBase extends ComponentBase {
19798
19777
  }
19799
19778
  }
19800
19779
  savePageSetting() {
19801
- let pathName = location.pathname;
19802
- if (this.setting.settingKey) {
19803
- pathName += '/' + this.setting.settingKey;
19804
- }
19805
19780
  let pageSetting = [];
19806
19781
  let checkExist = false;
19807
19782
  const dataPageSetting = localStorage.getItem(ComCtxConstants.LOCALSTORAGE_KEY.PAGE_SETTING);
19808
19783
  if (dataPageSetting) {
19809
19784
  pageSetting = JSON.parse(dataPageSetting);
19810
19785
  pageSetting.forEach(element => {
19811
- if (element.pathname === pathName) {
19786
+ if (element.pathname === this.componentKey) {
19812
19787
  element.pageSize = this.setting.pageSetting.pageSize;
19813
19788
  checkExist = true;
19814
19789
  }
19815
19790
  });
19816
19791
  }
19817
19792
  if (!checkExist) {
19818
- pageSetting.push({ pathname: pathName, pageSize: this.setting.pageSetting.pageSize });
19793
+ pageSetting.push({ pathname: this.componentKey, pageSize: this.setting.pageSetting.pageSize });
19819
19794
  }
19820
19795
  localStorage.setItem(ComCtxConstants.LOCALSTORAGE_KEY.PAGE_SETTING, JSON.stringify(pageSetting));
19821
19796
  }
@@ -20057,7 +20032,7 @@ class ListComponentBase extends ComponentBase {
20057
20032
  }
20058
20033
  }
20059
20034
  }
20060
- return transformed.map(row => row.map(cell => cell || ""));
20035
+ return transformed.map(row => row.map(cell => cell || ''));
20061
20036
  }
20062
20037
  getValueRow(rowData, index, value) {
20063
20038
  if (rowData[index] != null) {