@churchillliving/se-ui-toolkit 6.53.198 → 6.53.199

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.
@@ -1016,12 +1016,19 @@
1016
1016
  * Modify this.value directly to receive effect
1017
1017
  */
1018
1018
  var formstate = new rxjs.Subject();
1019
+ var formState1 = new rxjs.Subject();
1019
1020
  function changeDynamicFormState(id, data) {
1020
1021
  formstate.next({ id: id, data: data });
1021
1022
  }
1022
1023
  function onDynamicFormStateChange() {
1023
1024
  return formstate.asObservable();
1024
1025
  }
1026
+ function onDynamicFormStateChange1() {
1027
+ return formState1.asObservable();
1028
+ }
1029
+ function changeDynamicFormState1(data) {
1030
+ formState1.next({ data: data });
1031
+ }
1025
1032
  function closeIFrame() {
1026
1033
  var close = window.parent.document.querySelector('.p-dialog-header-icon');
1027
1034
  if (close) {
@@ -6656,8 +6663,39 @@
6656
6663
  _this.setnumericvalues();
6657
6664
  _this.onDynamicFormStateChange();
6658
6665
  _this.loadDynamicComponents();
6666
+ _this.setCardResponseId();
6659
6667
  }, 500);
6660
6668
  };
6669
+ FormComponent.prototype.setCardResponseId = function () {
6670
+ var _this = this;
6671
+ onDynamicFormStateChange1().subscribe(function (res) {
6672
+ _this.setCardIds(res);
6673
+ });
6674
+ };
6675
+ FormComponent.prototype.setCardIds = function (res) {
6676
+ var _a, _b, _c, _d;
6677
+ (_a = res.records) === null || _a === void 0 ? void 0 : _a.forEach(function (record, recordIndex) {
6678
+ var _a, _b;
6679
+ var matchCard = (_a = res.cardsInfo) === null || _a === void 0 ? void 0 : _a.find(function (info, cardIndex) { return recordIndex === cardIndex && record[res.fieldName]; });
6680
+ if (matchCard && ((_b = Object.keys(matchCard)) === null || _b === void 0 ? void 0 : _b.length) > 0) {
6681
+ matchCard[res.fieldName] = record[res.fieldName];
6682
+ }
6683
+ });
6684
+ if (((_c = (_b = this.form) === null || _b === void 0 ? void 0 : _b.formSections) === null || _c === void 0 ? void 0 : _c.length) > 0) {
6685
+ (_d = this.form) === null || _d === void 0 ? void 0 : _d.formSections.forEach(function (formSection) {
6686
+ var _a, _b, _c;
6687
+ var formField = (_a = formSection.fields) === null || _a === void 0 ? void 0 : _a.find(function (field) { return field.control === exports.EFormControl.CARD; });
6688
+ if (formField) {
6689
+ if (((_b = res.cardsInfo) === null || _b === void 0 ? void 0 : _b.length) > 0) {
6690
+ (_c = res.cardsInfo) === null || _c === void 0 ? void 0 : _c.forEach(function (cardId) {
6691
+ cardId.id = null;
6692
+ });
6693
+ }
6694
+ formField.card.data = res.cardsInfo;
6695
+ }
6696
+ });
6697
+ }
6698
+ };
6661
6699
  FormComponent.prototype.removeWhiteSpaces = function () {
6662
6700
  var _a, _b;
6663
6701
  (_b = (_a = this.form) === null || _a === void 0 ? void 0 : _a.formSections) === null || _b === void 0 ? void 0 : _b.forEach(function (section) {
@@ -9659,28 +9697,26 @@
9659
9697
  return arr;
9660
9698
  };
9661
9699
  CardService.prototype.setResponseId = function (response, cardsInfo, fieldName, dynamicForm) {
9662
- var _a, _b;
9663
- (_a = response.records) === null || _a === void 0 ? void 0 : _a.forEach(function (record, recordIndex) {
9664
- var _a;
9665
- var matchCard = cardsInfo === null || cardsInfo === void 0 ? void 0 : cardsInfo.find(function (info, cardIndex) { return recordIndex === cardIndex && record.Id; });
9666
- if (matchCard && ((_a = Object.keys(matchCard)) === null || _a === void 0 ? void 0 : _a.length) > 0) {
9667
- matchCard[fieldName] = record.Id;
9668
- }
9669
- });
9670
- if (dynamicForm && ((_b = Object.keys(dynamicForm)) === null || _b === void 0 ? void 0 : _b.length)) {
9671
- dynamicForm.formSections.forEach(function (section) {
9672
- var formField = section.fields.find(function (field) { return field.control === exports.EFormControl.CARD; });
9673
- if (formField) {
9674
- if ((cardsInfo === null || cardsInfo === void 0 ? void 0 : cardsInfo.length) > 0) {
9675
- cardsInfo === null || cardsInfo === void 0 ? void 0 : cardsInfo.forEach(function (cardId) {
9676
- cardId.id = null;
9677
- });
9678
- }
9679
- formField.card.data = cardsInfo;
9680
- }
9681
- ;
9682
- });
9683
- }
9700
+ changeDynamicFormState1({ records: response.records, cardsInfo: cardsInfo, fieldName: fieldName });
9701
+ // response.records?.forEach((record: any, recordIndex: any) => {
9702
+ // const matchCard = cardsInfo?.find((info, cardIndex)=> recordIndex === cardIndex && record[fieldName]);
9703
+ // if(matchCard && Object.keys(matchCard)?.length > 0){
9704
+ // matchCard[fieldName] = record[fieldName];
9705
+ // }
9706
+ // });
9707
+ // if(dynamicForm && Object.keys(dynamicForm)?.length){
9708
+ // dynamicForm.formSections.forEach((section)=>{
9709
+ // const formField = section.fields.find((field)=> field.control === EFormControl.CARD);
9710
+ // if(formField){
9711
+ // if(cardsInfo?.length > 0){
9712
+ // cardsInfo?.forEach((cardId)=>{
9713
+ // cardId.id = null;
9714
+ // })
9715
+ // }
9716
+ // formField.card.data = cardsInfo;
9717
+ // };
9718
+ // });
9719
+ // }
9684
9720
  };
9685
9721
  return CardService;
9686
9722
  }());
@@ -9739,6 +9775,7 @@
9739
9775
  exports.autoSetLookupData = autoSetLookupData;
9740
9776
  exports.calenderMinMaxValue = calenderMinMaxValue;
9741
9777
  exports.changeDynamicFormState = changeDynamicFormState;
9778
+ exports.changeDynamicFormState1 = changeDynamicFormState1;
9742
9779
  exports.clickSectionHighlight = clickSectionHighlight;
9743
9780
  exports.closeIFrame = closeIFrame;
9744
9781
  exports.currentUrl = currentUrl;
@@ -9763,6 +9800,7 @@
9763
9800
  exports.highlightLeftSidebar = highlightLeftSidebar;
9764
9801
  exports.objConvertToLower = objConvertToLower;
9765
9802
  exports.onDynamicFormStateChange = onDynamicFormStateChange;
9803
+ exports.onDynamicFormStateChange1 = onDynamicFormStateChange1;
9766
9804
  exports.removeActiveIconClass = removeActiveIconClass;
9767
9805
  exports.setAllFormFieldsValues = setAllFormFieldsValues;
9768
9806
  exports.setAndFilter = setAndFilter;