@churchillliving/se-ui-toolkit 6.53.473 → 6.53.475

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.
@@ -3525,13 +3525,20 @@
3525
3525
  if (columns === void 0) { columns = []; }
3526
3526
  props === null || props === void 0 ? void 0 : props.forEach(function (prop) {
3527
3527
  var _g, _h, _j, _k;
3528
- var _a, _b, _c, _d;
3528
+ var _a, _b, _c, _d, _e, _f;
3529
3529
  if (prop.propName && (prop.propValue || prop.propValue === false || prop.propValue === '')) {
3530
3530
  if (prop.field) {
3531
3531
  var fieldName = (_a = Object.keys(row)) === null || _a === void 0 ? void 0 : _a.find(function (key) { var _a; return (key === null || key === void 0 ? void 0 : key.toLowerCase()) === ((_a = prop === null || prop === void 0 ? void 0 : prop.field) === null || _a === void 0 ? void 0 : _a.toLowerCase()); });
3532
- var fieldNameObj = (fieldName === null || fieldName === void 0 ? void 0 : fieldName.toLowerCase()) + '_obj';
3532
+ var fieldNameObj = (fieldName === null || fieldName === void 0 ? void 0 : fieldName.includes('_obj')) ? fieldName === null || fieldName === void 0 ? void 0 : fieldName.toLowerCase() : (fieldName === null || fieldName === void 0 ? void 0 : fieldName.toLowerCase()) + '_obj';
3533
+ if (!fieldName) {
3534
+ var rowObj_1 = ((_b = prop === null || prop === void 0 ? void 0 : prop.field) === null || _b === void 0 ? void 0 : _b.toLowerCase()) + '_obj';
3535
+ fieldNameObj = (_c = Object.keys(row)) === null || _c === void 0 ? void 0 : _c.find(function (key) { var _a, _b, _c; return ((key === null || key === void 0 ? void 0 : key.toLowerCase()) === rowObj_1) && (((_a = row[rowObj_1]) === null || _a === void 0 ? void 0 : _a.type) === exports.EGridColumnType.DIALOG || ((_b = row[rowObj_1]) === null || _b === void 0 ? void 0 : _b.type) === exports.EGridColumnType.IFRAME || ((_c = row[rowObj_1]) === null || _c === void 0 ? void 0 : _c.type) === exports.EGridColumnType.LINK); });
3536
+ if (fieldNameObj) {
3537
+ fieldName = fieldNameObj;
3538
+ }
3539
+ }
3533
3540
  if (fieldName) {
3534
- if ((_b = Object.keys(row)) === null || _b === void 0 ? void 0 : _b.includes(fieldNameObj)) {
3541
+ if ((_d = Object.keys(row)) === null || _d === void 0 ? void 0 : _d.includes(fieldNameObj)) {
3535
3542
  row[fieldNameObj] = Object.assign(Object.assign({}, row[fieldNameObj]), (_g = { text: row[fieldName] }, _g[prop.propName] = prop.propValue, _g));
3536
3543
  }
3537
3544
  else {
@@ -3539,9 +3546,9 @@
3539
3546
  }
3540
3547
  }
3541
3548
  else if (columns === null || columns === void 0 ? void 0 : columns.some(function (column) { var _a, _b; return ((_a = column.field) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === ((_b = prop === null || prop === void 0 ? void 0 : prop.field) === null || _b === void 0 ? void 0 : _b.toLowerCase()); })) {
3542
- var propField = (_c = prop.field) === null || _c === void 0 ? void 0 : _c.toLowerCase();
3549
+ var propField = (_e = prop.field) === null || _e === void 0 ? void 0 : _e.toLowerCase();
3543
3550
  var propFieldObj = propField + '_obj';
3544
- if ((_d = Object.keys(row)) === null || _d === void 0 ? void 0 : _d.includes(fieldNameObj)) {
3551
+ if ((_f = Object.keys(row)) === null || _f === void 0 ? void 0 : _f.includes(fieldNameObj)) {
3545
3552
  row[propFieldObj] = Object.assign(Object.assign({}, row[propFieldObj]), (_j = { text: row[prop.field] }, _j[prop.propName] = prop.propValue, _j));
3546
3553
  }
3547
3554
  else {
@@ -5160,6 +5167,7 @@
5160
5167
  this.browserCloseEvent(false);
5161
5168
  if (row.isNew || row.isnew) {
5162
5169
  var isNew = row.isNew, isnew = row.isnew, newRowObj = __rest(row, ["isNew", "isnew"]);
5170
+ newRowObj = this.removeExtraNewRowObj(newRowObj);
5163
5171
  if (!this.addDataKeyValue) {
5164
5172
  delete newRowObj[this.dataKey];
5165
5173
  }
@@ -5239,6 +5247,20 @@
5239
5247
  }
5240
5248
  this.isCheckBoxChangeEventCalled = false;
5241
5249
  };
5250
+ GridComponent.prototype.removeExtraNewRowObj = function (row) {
5251
+ var _this = this;
5252
+ var _a;
5253
+ var keys = Object.keys(row);
5254
+ if (((_a = this.columns) === null || _a === void 0 ? void 0 : _a.length) > 0 && (keys === null || keys === void 0 ? void 0 : keys.length) > 0) {
5255
+ keys.forEach(function (key) {
5256
+ 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()); });
5257
+ if (!matchKey) {
5258
+ delete row[key];
5259
+ }
5260
+ });
5261
+ }
5262
+ return row;
5263
+ };
5242
5264
  // check the validation of the field
5243
5265
  GridComponent.prototype.gridValidation = function (columns, row) {
5244
5266
  if (!this.gridService.checkValidity(columns, row)) {