@churchillliving/se-ui-toolkit 6.53.484 → 6.53.486

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.
@@ -2673,7 +2673,7 @@
2673
2673
  var _a;
2674
2674
  var field = (_a = column === null || column === void 0 ? void 0 : column.field) === null || _a === void 0 ? void 0 : _a.toLowerCase();
2675
2675
  rowsData.forEach(function (row) {
2676
- row = _this.removeRowObj(row, field);
2676
+ row = _this.removeRowObj(row, field, columns);
2677
2677
  });
2678
2678
  if (column.allowSave === false) {
2679
2679
  rowsData.forEach(function (row) {
@@ -2730,7 +2730,7 @@
2730
2730
  columns.forEach(function (column) {
2731
2731
  var _a;
2732
2732
  var field = (_a = column === null || column === void 0 ? void 0 : column.field) === null || _a === void 0 ? void 0 : _a.toLowerCase();
2733
- row = _this.removeRowObj(row, field);
2733
+ row = _this.removeRowObj(row, field, columns);
2734
2734
  if (column.allowSave == false) {
2735
2735
  var keys = Object.keys(row);
2736
2736
  keys.forEach(function (x) {
@@ -2771,7 +2771,7 @@
2771
2771
  return row;
2772
2772
  };
2773
2773
  // remove obj, data and secondtype data from row
2774
- GridService.prototype.removeRowObj = function (row, field) {
2774
+ GridService.prototype.removeRowObj = function (row, field, columns) {
2775
2775
  var keys = Object.keys(row);
2776
2776
  if ((keys === null || keys === void 0 ? void 0 : keys.length) > 0) {
2777
2777
  keys.forEach(function (key) {
@@ -2780,6 +2780,19 @@
2780
2780
  }
2781
2781
  });
2782
2782
  }
2783
+ row = this.removeExtraNewRowObj(row, columns);
2784
+ return row;
2785
+ };
2786
+ GridService.prototype.removeExtraNewRowObj = function (row, columns) {
2787
+ var keys = Object.keys(row);
2788
+ if ((columns === null || columns === void 0 ? void 0 : columns.length) > 0 && (keys === null || keys === void 0 ? void 0 : keys.length) > 0) {
2789
+ keys.forEach(function (key) {
2790
+ var matchKey = columns.some(function (column) { var _a; return ((_a = column.field) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === (key === null || key === void 0 ? void 0 : key.toLowerCase()); });
2791
+ if (!matchKey) {
2792
+ delete row[key];
2793
+ }
2794
+ });
2795
+ }
2783
2796
  return row;
2784
2797
  };
2785
2798
  // add simple grid column without
@@ -5183,7 +5196,7 @@
5183
5196
  this.browserCloseEvent(false);
5184
5197
  if (row.isNew || row.isnew) {
5185
5198
  var isNew = row.isNew, isnew = row.isnew, newRowObj = __rest(row, ["isNew", "isnew"]);
5186
- newRowObj = this.removeExtraNewRowObj(newRowObj);
5199
+ newRowObj = this.gridService.removeExtraNewRowObj(newRowObj, this.columns);
5187
5200
  if (!this.addDataKeyValue) {
5188
5201
  delete newRowObj[this.dataKey];
5189
5202
  }
@@ -5263,20 +5276,6 @@
5263
5276
  }
5264
5277
  this.isCheckBoxChangeEventCalled = false;
5265
5278
  };
5266
- GridComponent.prototype.removeExtraNewRowObj = function (row) {
5267
- var _this = this;
5268
- var _a;
5269
- var keys = Object.keys(row);
5270
- if (((_a = this.columns) === null || _a === void 0 ? void 0 : _a.length) > 0 && (keys === null || keys === void 0 ? void 0 : keys.length) > 0) {
5271
- keys.forEach(function (key) {
5272
- var matchKey = _this.columns.some(function (column) { var _a; return ((_a = column.field) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === (key === null || key === void 0 ? void 0 : key.toLowerCase()); });
5273
- if (!matchKey) {
5274
- delete row[key];
5275
- }
5276
- });
5277
- }
5278
- return row;
5279
- };
5280
5279
  // check the validation of the field
5281
5280
  GridComponent.prototype.gridValidation = function (columns, row) {
5282
5281
  if (!this.gridService.checkValidity(columns, row)) {
@@ -8963,7 +8962,7 @@
8963
8962
  FileUploadComponent.prototype.ngOnInit = function () { };
8964
8963
  FileUploadComponent.prototype.uploadFile = function (files) {
8965
8964
  var _this = this;
8966
- var _a, _b, _c, _d, _e, _f;
8965
+ var _a, _b, _c;
8967
8966
  var fileData = new FormData();
8968
8967
  var chooseFile = false;
8969
8968
  for (var i = 0; i < files.length; i++) {
@@ -8976,8 +8975,8 @@
8976
8975
  if (this.fields && ((_a = this.fields.uniqueKey) === null || _a === void 0 ? void 0 : _a.length) > 0) {
8977
8976
  fileData.append('uniqueKey', (_b = this.fields) === null || _b === void 0 ? void 0 : _b.uniqueKey);
8978
8977
  }
8979
- else if (this.fields && (((_c = this.fields.azureContainer) === null || _c === void 0 ? void 0 : _c.length) > 0 || ((_d = this.fields.pathSystemConfig) === null || _d === void 0 ? void 0 : _d.length) > 0)) {
8980
- fileData.append('azureContainer', ((_e = this.fields) === null || _e === void 0 ? void 0 : _e.SetfileTypes) === exports.ESelectFileType.MRT ? (_f = this.fields) === null || _f === void 0 ? void 0 : _f.azureContainer : this.fields.pathSystemConfig);
8978
+ else if (this.fields && ((_c = this.fields.pathSystemConfig) === null || _c === void 0 ? void 0 : _c.length) > 0) {
8979
+ fileData.append('azureContainer', this.fields.pathSystemConfig);
8981
8980
  }
8982
8981
  this.requestService.get('/Upload', fileData).subscribe(function (data) {
8983
8982
  var _a;
@@ -8989,8 +8988,8 @@
8989
8988
  }
8990
8989
  _this.fileUrl.emit(data.results);
8991
8990
  }
8992
- }, function (_g) {
8993
- var error = _g.error;
8991
+ }, function (_d) {
8992
+ var error = _d.error;
8994
8993
  _this.alertService.apiError(error);
8995
8994
  if (_this.fields.onReturn) {
8996
8995
  _this.fields.onReturn(error);