@churchillliving/se-ui-toolkit 6.53.201 → 6.53.202

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.
@@ -2513,14 +2513,45 @@
2513
2513
  GridService.prototype.getFormattedDate = function (value) {
2514
2514
  return new Date(value + " Z").toISOString().slice(0, 10);
2515
2515
  };
2516
+ // change row key and value when using setGridRowPropValue function
2517
+ GridService.prototype.setRowValue = function (rowData) {
2518
+ var _a;
2519
+ (_a = Object.keys(rowData)) === null || _a === void 0 ? void 0 : _a.forEach(function (row) {
2520
+ var _a, _b, _c, _d;
2521
+ if (row === exports.EGridRowAction.DELETEBTN || row === exports.EGridRowAction.EDITBTN) {
2522
+ delete rowData[row];
2523
+ }
2524
+ else if (rowData[row] &&
2525
+ typeof (rowData[row]) === 'object' &&
2526
+ ((_b = (_a = rowData[row]) === null || _a === void 0 ? void 0 : _a.action) === null || _b === void 0 ? void 0 : _b.field)) {
2527
+ if ((_c = rowData[row]) === null || _c === void 0 ? void 0 : _c.extraField) {
2528
+ delete rowData[row];
2529
+ }
2530
+ else {
2531
+ rowData[row] = (_d = rowData[row]) === null || _d === void 0 ? void 0 : _d.text;
2532
+ }
2533
+ }
2534
+ });
2535
+ return rowData;
2536
+ };
2516
2537
  // get allowSave true row list
2517
2538
  GridService.prototype.getAllowSaveRowlist = function (rowsData, columns) {
2539
+ var _this = this;
2518
2540
  if (rowsData === void 0) { rowsData = []; }
2519
2541
  columns.forEach(function (column) {
2520
2542
  if (column.allowSave === false) {
2521
2543
  rowsData.forEach(function (row) {
2522
2544
  var _a;
2545
+ var obj = Object.keys(row);
2546
+ if ((obj === null || obj === void 0 ? void 0 : obj.length) > 0) {
2547
+ obj.forEach(function (x) {
2548
+ if (x.includes('_obj') && typeof row[x] === 'object') {
2549
+ delete row[x];
2550
+ }
2551
+ });
2552
+ }
2523
2553
  delete row[(_a = column.field) === null || _a === void 0 ? void 0 : _a.toLowerCase()];
2554
+ row = _this.setRowValue(row);
2524
2555
  });
2525
2556
  }
2526
2557
  });
@@ -2528,16 +2559,25 @@
2528
2559
  };
2529
2560
  // get allowSave true || undefine row
2530
2561
  GridService.prototype.getAllowSaveRow = function (rowInfo, columns) {
2562
+ var _this = this;
2531
2563
  if (rowInfo === void 0) { rowInfo = {}; }
2532
2564
  var row = Object.assign({}, rowInfo);
2533
2565
  columns.forEach(function (column) {
2534
2566
  if (column.allowSave == false) {
2535
- var key = Object.keys(row).find(function (x) { var _a; return x.toLowerCase() === ((_a = column.field) === null || _a === void 0 ? void 0 : _a.toLowerCase()); });
2567
+ row = _this.setRowValue(row);
2568
+ var keys = Object.keys(row);
2569
+ keys.forEach(function (x) {
2570
+ if (x.includes('_obj') && typeof row[x] === 'object') {
2571
+ delete row[x];
2572
+ }
2573
+ });
2574
+ var key = keys.find(function (x) { var _a; return x.toLowerCase() === ((_a = column.field) === null || _a === void 0 ? void 0 : _a.toLowerCase()); });
2536
2575
  if (key) {
2537
2576
  delete row[key];
2538
2577
  }
2539
2578
  }
2540
2579
  });
2580
+ row = this.setRowValue(row);
2541
2581
  return row;
2542
2582
  };
2543
2583
  // add simple grid column without
@@ -4094,27 +4134,6 @@
4094
4134
  }
4095
4135
  });
4096
4136
  };
4097
- // change row key and value when using setGridRowPropValue function
4098
- GridComponent.prototype.setRowValue = function (rowData) {
4099
- var _this = this;
4100
- var _a;
4101
- (_a = Object.keys(rowData)) === null || _a === void 0 ? void 0 : _a.forEach(function (row) {
4102
- var _a, _b, _c, _d;
4103
- if (row === exports.EGridRowAction.DELETEBTN || row === exports.EGridRowAction.EDITBTN) {
4104
- delete rowData[row];
4105
- }
4106
- else if (rowData[row] &&
4107
- _this.typeOf(rowData[row]) === 'object' &&
4108
- ((_b = (_a = rowData[row]) === null || _a === void 0 ? void 0 : _a.action) === null || _b === void 0 ? void 0 : _b.field)) {
4109
- if ((_c = rowData[row]) === null || _c === void 0 ? void 0 : _c.extraField) {
4110
- delete rowData[row];
4111
- }
4112
- else {
4113
- rowData[row] = (_d = rowData[row]) === null || _d === void 0 ? void 0 : _d.text;
4114
- }
4115
- }
4116
- });
4117
- };
4118
4137
  GridComponent.prototype.setNumericMinMxFraction = function (column) {
4119
4138
  var _a, _b, _c, _d, _e, _f;
4120
4139
  var digitInfo = '2';
@@ -4793,7 +4812,7 @@
4793
4812
  /**
4794
4813
  * just emit those fields who exist in the tabel
4795
4814
  */
4796
- this.setRowValue(row);
4815
+ row = this.gridService.setRowValue(row);
4797
4816
  var obj = {};
4798
4817
  this.columns.forEach(function (column) {
4799
4818
  var _a, _b, _c, _d, _e;