@churchillliving/se-ui-toolkit 6.53.437 → 6.53.439

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.
@@ -7191,31 +7191,27 @@
7191
7191
  onDynamicCardStateChange().subscribe(function (res) {
7192
7192
  var _a, _b;
7193
7193
  if ((_a = res.data) === null || _a === void 0 ? void 0 : _a.isSave) {
7194
- console.log('res.data: ', res.data);
7195
7194
  _this.setCardIds(res.data);
7196
7195
  }
7197
7196
  else {
7198
7197
  console.log('else: ');
7199
- _this.setDeleteCardId((_b = res.data) === null || _b === void 0 ? void 0 : _b.imageInfo);
7198
+ _this.setDeleteCardId((_b = res.data) === null || _b === void 0 ? void 0 : _b.cardData);
7200
7199
  }
7201
7200
  });
7202
7201
  };
7203
- FormComponent.prototype.setDeleteCardId = function (deletedItem) {
7202
+ FormComponent.prototype.setDeleteCardId = function (updatedCardData) {
7203
+ var _this = this;
7204
7204
  var _a, _b;
7205
- console.log('deletedItem: ', deletedItem);
7205
+ console.log('updatedCardData: ', updatedCardData);
7206
7206
  (_b = (_a = this.form) === null || _a === void 0 ? void 0 : _a.formSections) === null || _b === void 0 ? void 0 : _b.forEach(function (section) {
7207
7207
  var cardControl = section.fields.find(function (field) { return field.control === exports.EFormControl.CARD; });
7208
7208
  console.log('cardControl: ', cardControl);
7209
7209
  if (cardControl) {
7210
- var index = cardControl.card.data.findIndex(function (card) { return card.id == deletedItem.id; });
7211
- console.log('index: ', index);
7212
- if (index > -1) {
7213
- cardControl.card.data.splice(index, 1);
7214
- }
7210
+ cardControl.card.data = updatedCardData;
7215
7211
  }
7216
7212
  ;
7213
+ console.log('this.form: 00', _this.form);
7217
7214
  });
7218
- console.log('this.form: 00', this.form);
7219
7215
  };
7220
7216
  FormComponent.prototype.setCardIds = function (res) {
7221
7217
  var _a, _b, _c, _d;
@@ -10466,10 +10462,9 @@
10466
10462
  this.requestService.get('/Upload/Delete', imageToDelete).subscribe(function (response) {
10467
10463
  _this.deleteFile(imageInfo, dynamicForm, cardId);
10468
10464
  if (imageInfo.tables) {
10469
- _this.deleteImageFromTables(imageInfo.tables, uniqueKey, imageInfo);
10465
+ _this.deleteImageFromTables(imageInfo.tables, uniqueKey);
10470
10466
  }
10471
10467
  else {
10472
- changeDynamicCardState({ imageInfo: imageInfo });
10473
10468
  _this.alertService.success('Image deleted successfully.');
10474
10469
  }
10475
10470
  }, function (_c) {
@@ -10477,7 +10472,7 @@
10477
10472
  _this.alertService.apiError(error);
10478
10473
  });
10479
10474
  };
10480
- CardService.prototype.deleteImageFromTables = function (tables, uniqueKey, imageInfo) {
10475
+ CardService.prototype.deleteImageFromTables = function (tables, uniqueKey) {
10481
10476
  var _this = this;
10482
10477
  this.requestService
10483
10478
  .get('/Data/BulkDelete', {
@@ -10485,7 +10480,6 @@
10485
10480
  tables: tables,
10486
10481
  })
10487
10482
  .subscribe(function (response) {
10488
- changeDynamicCardState({ imageInfo: imageInfo });
10489
10483
  _this.alertService.success('Image deleted successfully.');
10490
10484
  }, function (_c) {
10491
10485
  var error = _c.error;
@@ -10519,16 +10513,16 @@
10519
10513
  }
10520
10514
  };
10521
10515
  CardService.prototype.deleteFile = function (cardInfo, dynamicForm, id) {
10522
- var _a;
10523
10516
  var fieldInfo = this.getCardData(dynamicForm.formSections, id);
10524
10517
  var cardData = fieldInfo.data;
10525
10518
  cardData = __spreadArray([], __read(this.deleteFromArray(cardData, cardInfo, fieldInfo === null || fieldInfo === void 0 ? void 0 : fieldInfo.url)));
10526
- (_a = dynamicForm.formSections) === null || _a === void 0 ? void 0 : _a.forEach(function (section) {
10527
- var card = section.fields.find(function (x) { return x.control === exports.EFormControl.CARD && x.id === id; });
10528
- if (card && card.card) {
10529
- card.card.data = cardData;
10530
- }
10531
- });
10519
+ changeDynamicCardState({ cardData: cardData });
10520
+ // dynamicForm.formSections?.forEach((section) => {
10521
+ // let card = section.fields.find((x) => x.control === EFormControl.CARD && x.id === id);
10522
+ // if (card && card.card) {
10523
+ // card.card.data = cardData;
10524
+ // }
10525
+ // });
10532
10526
  };
10533
10527
  CardService.prototype.deleteFromArray = function (arr, cardInfo, deleteMatchKey) {
10534
10528
  if (arr === void 0) { arr = []; }