@churchillliving/se-ui-toolkit 6.53.432 → 6.53.433

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.
@@ -1114,7 +1114,7 @@
1114
1114
  function onDynamicCardStateChange() {
1115
1115
  return cardState.asObservable();
1116
1116
  }
1117
- function changeDynamicFormState1(data) {
1117
+ function changeDynamicCardState(data) {
1118
1118
  cardState.next({ data: data });
1119
1119
  }
1120
1120
  function closeIFrame() {
@@ -7173,8 +7173,31 @@
7173
7173
  FormComponent.prototype.setCardResponseId = function () {
7174
7174
  var _this = this;
7175
7175
  onDynamicCardStateChange().subscribe(function (res) {
7176
- _this.setCardIds(res.data);
7176
+ var _a;
7177
+ if ((_a = res.data) === null || _a === void 0 ? void 0 : _a.isSave) {
7178
+ console.log('res.data: ', res.data);
7179
+ _this.setCardIds(res.data);
7180
+ }
7181
+ else {
7182
+ console.log('else: ');
7183
+ _this.setDeleteCardId(res.data);
7184
+ }
7185
+ });
7186
+ };
7187
+ FormComponent.prototype.setDeleteCardId = function (deletedItem) {
7188
+ var _a, _b;
7189
+ console.log('deletedItem: ', deletedItem);
7190
+ (_b = (_a = this.form) === null || _a === void 0 ? void 0 : _a.formSections) === null || _b === void 0 ? void 0 : _b.forEach(function (section) {
7191
+ var cardControl = section.fields.find(function (field) { return field.control === exports.EFormControl.CARD; });
7192
+ console.log('cardControl: ', cardControl);
7193
+ if (cardControl) {
7194
+ var index = cardControl.card.data.findIndex(function (card) { return card.id == deletedItem.id; });
7195
+ console.log('index: ', index);
7196
+ cardControl.card.data.splice(index, 1);
7197
+ }
7198
+ ;
7177
7199
  });
7200
+ console.log('this.form: 00', this.form);
7178
7201
  };
7179
7202
  FormComponent.prototype.setCardIds = function (res) {
7180
7203
  var _a, _b, _c, _d;
@@ -10425,7 +10448,7 @@
10425
10448
  this.requestService.get('/Upload/Delete', imageToDelete).subscribe(function (response) {
10426
10449
  _this.deleteFile(imageInfo, dynamicForm, cardId);
10427
10450
  if (imageInfo.tables) {
10428
- _this.deleteImageFromTables(imageInfo.tables, uniqueKey);
10451
+ _this.deleteImageFromTables(imageInfo.tables, uniqueKey, imageInfo);
10429
10452
  }
10430
10453
  else {
10431
10454
  _this.alertService.success('Image deleted successfully.');
@@ -10435,7 +10458,7 @@
10435
10458
  _this.alertService.apiError(error);
10436
10459
  });
10437
10460
  };
10438
- CardService.prototype.deleteImageFromTables = function (tables, uniqueKey) {
10461
+ CardService.prototype.deleteImageFromTables = function (tables, uniqueKey, imageInfo) {
10439
10462
  var _this = this;
10440
10463
  this.requestService
10441
10464
  .get('/Data/BulkDelete', {
@@ -10443,6 +10466,7 @@
10443
10466
  tables: tables,
10444
10467
  })
10445
10468
  .subscribe(function (response) {
10469
+ changeDynamicCardState({ records: imageInfo });
10446
10470
  _this.alertService.success('Image deleted successfully.');
10447
10471
  }, function (_c) {
10448
10472
  var error = _c.error;
@@ -10499,7 +10523,7 @@
10499
10523
  return arr;
10500
10524
  };
10501
10525
  CardService.prototype.setResponseId = function (response, cardsInfo, fieldName, dynamicForm) {
10502
- changeDynamicFormState1({ records: response.records, cardsInfo: cardsInfo, fieldName: fieldName });
10526
+ changeDynamicCardState({ records: response.records, cardsInfo: cardsInfo, fieldName: fieldName, isSave: true });
10503
10527
  // response.records?.forEach((record: any, recordIndex: any) => {
10504
10528
  // const matchCard = cardsInfo?.find((info, cardIndex)=> recordIndex === cardIndex && record[fieldName]);
10505
10529
  // if(matchCard && Object.keys(matchCard)?.length > 0){
@@ -10576,8 +10600,8 @@
10576
10600
  exports.addNewFieldInForm = addNewFieldInForm;
10577
10601
  exports.autoSetLookupData = autoSetLookupData;
10578
10602
  exports.calenderMinMaxValue = calenderMinMaxValue;
10603
+ exports.changeDynamicCardState = changeDynamicCardState;
10579
10604
  exports.changeDynamicFormState = changeDynamicFormState;
10580
- exports.changeDynamicFormState1 = changeDynamicFormState1;
10581
10605
  exports.clickSectionHighlight = clickSectionHighlight;
10582
10606
  exports.closeIFrame = closeIFrame;
10583
10607
  exports.currentUrl = currentUrl;