tnx-shared 5.3.195 → 5.3.197

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.
@@ -18472,6 +18472,7 @@ class ListComponentBase extends ComponentBase {
18472
18472
  this.FileUploadMode = FileUploadMode;
18473
18473
  this.Operator = Operator;
18474
18474
  this.showSaveReorder = false;
18475
+ this.settingDefault = new CrudListSetting();
18475
18476
  this._unSubscribeAll = new Subject();
18476
18477
  this.handleSelectRow = (evt, data) => {
18477
18478
  if (this.setting.hasCustomHandleClickRow) {
@@ -18757,6 +18758,7 @@ class ListComponentBase extends ComponentBase {
18757
18758
  this._rawDataSource = dataSource;
18758
18759
  }
18759
18760
  ngOnInit() {
18761
+ this.settingDefault = Object.assign({}, this.setting);
18760
18762
  this.subscribe(ComCtxConstants.COMMON.ENTITY_METADATA_RELOADED, service => {
18761
18763
  this.entityMetadataService = service;
18762
18764
  });
@@ -18944,18 +18946,28 @@ class ListComponentBase extends ComponentBase {
18944
18946
  }
18945
18947
  temp.push(element);
18946
18948
  const config = this.setting.columnSetting.details.find(p => p.columnCode == element.field);
18949
+ const col = this.setting.cols.find(p => p.field == element.field);
18947
18950
  if (config && config.visible !== undefined && config.visible !== null) {
18948
18951
  element.visible = config.visible;
18949
18952
  }
18953
+ else if (col) {
18954
+ // element.visible = col.visible;
18955
+ }
18950
18956
  if (element.label) {
18951
18957
  element.label = this._translateService.instant(element.label);
18952
18958
  }
18953
18959
  if (config && config.textAlign !== undefined && config.textAlign !== null) {
18954
18960
  element.textAlign = config.textAlign;
18955
18961
  }
18962
+ else if (col) {
18963
+ // element.textAlign = col.textAlign;
18964
+ }
18956
18965
  if (config && config.width !== undefined && config.width !== null) {
18957
18966
  element.width = config.width;
18958
18967
  }
18968
+ else if (col) {
18969
+ // element.width = col.width;
18970
+ }
18959
18971
  if (element.dataType == null || element.dataType == undefined || element.dataType == '') {
18960
18972
  element.dataType = DataType.string;
18961
18973
  }
@@ -19054,12 +19066,13 @@ class ListComponentBase extends ComponentBase {
19054
19066
  getColumnSetting(colGroup) {
19055
19067
  this.setting.groupColumn = colGroup;
19056
19068
  const dataSetting = localStorage.getItem(ComCtxConstants.LOCALSTORAGE_KEY.COLUMN_SETTING);
19057
- if (dataSetting) {
19069
+ const jsonData = this.tryParseJson(dataSetting);
19070
+ if (dataSetting && jsonData.valid && jsonData.value.length > 0) {
19058
19071
  let pathName = location.pathname;
19059
19072
  if (this.setting.settingKey) {
19060
19073
  pathName += '/' + this.setting.settingKey;
19061
19074
  }
19062
- const settings = JSON.parse(dataSetting);
19075
+ const settings = jsonData.value;
19063
19076
  for (const element of settings) {
19064
19077
  // const element = settings[i];
19065
19078
  if (element.pathname === pathName) {
@@ -19129,6 +19142,7 @@ class ListComponentBase extends ComponentBase {
19129
19142
  if (index > -1)
19130
19143
  columnSetting.splice(index, 1);
19131
19144
  }
19145
+ // this.setting.columnSetting.details = [];
19132
19146
  localStorage.setItem(ComCtxConstants.LOCALSTORAGE_KEY.COLUMN_SETTING, JSON.stringify(columnSetting));
19133
19147
  }
19134
19148
  getColorSetting() {
@@ -19949,8 +19963,10 @@ class ListComponentBase extends ComponentBase {
19949
19963
  this._showSettings = false;
19950
19964
  }
19951
19965
  onDeleteSettings() {
19966
+ var _a, _b;
19952
19967
  this._showSettings = false;
19953
- this.setting.columnSetting = new ColumnSetting();
19968
+ // this.setting.columnSetting = new ColumnSetting();
19969
+ this.setting.columnSetting = (_b = (_a = this.settingDefault) === null || _a === void 0 ? void 0 : _a.columnSetting) !== null && _b !== void 0 ? _b : new ColumnSetting();
19954
19970
  this.deleteColumnSetting();
19955
19971
  this.extendColumns(this.setting.cols);
19956
19972
  this.formatColumns(this.setting.cols);
@@ -20866,7 +20882,9 @@ class ListComponentBase extends ComponentBase {
20866
20882
  this.startWorkflowModel.showEditForm = true;
20867
20883
  rowData.__startingWorkflow = false;
20868
20884
  const compRef = yield this._federationService.loadRemoteNewComponent('commonapp', 'StartWorkflowComponent', this.startWorkflowViewContainer);
20869
- dialog.buttonTemplateInput = compRef.instance.buttonTemplate;
20885
+ if (dialog) {
20886
+ dialog.buttonTemplateInput = compRef.instance.buttonTemplate;
20887
+ }
20870
20888
  compRef.workflows = workflowSetting.workflows;
20871
20889
  compRef.defaultWorkflow = workflowSetting.workflowCode;
20872
20890
  compRef.instance.onSaved.subscribe(event => this.handleStartWorkflowFromDialog(event));