arco-support-request 0.0.55 → 0.0.58

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.
@@ -6,7 +6,28 @@
6
6
 
7
7
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
8
8
 
9
+ function _interopNamespace(e) {
10
+ if (e && e.__esModule) return e;
11
+ var n = Object.create(null);
12
+ if (e) {
13
+ Object.keys(e).forEach(function (k) {
14
+ if (k !== 'default') {
15
+ var d = Object.getOwnPropertyDescriptor(e, k);
16
+ Object.defineProperty(n, k, d.get ? d : {
17
+ enumerable: true,
18
+ get: function () {
19
+ return e[k];
20
+ }
21
+ });
22
+ }
23
+ });
24
+ }
25
+ n['default'] = e;
26
+ return Object.freeze(n);
27
+ }
28
+
9
29
  var Swal__default = /*#__PURE__*/_interopDefaultLegacy(Swal);
30
+ var handlebars__namespace = /*#__PURE__*/_interopNamespace(handlebars);
10
31
 
11
32
  var ArcoSupportRequestService = /** @class */ (function () {
12
33
  function ArcoSupportRequestService() {
@@ -2823,6 +2844,7 @@
2823
2844
  var params = this.setparameter(restData.QueryStrings, FormValues, SearchText, isHavecriteria);
2824
2845
  var parameter = this.getArraycolumn(params);
2825
2846
  var _url = restData.URL + parameter;
2847
+ // searchCriteria = this.setCriteriaField(restData.QueryStrings,FormValues,searchCriteria)
2826
2848
  switch (restData.Method) {
2827
2849
  case 'GET': {
2828
2850
  return this.http.get(_url, {
@@ -2855,6 +2877,7 @@
2855
2877
  Name: element.Name,
2856
2878
  Value: FormValues[element.Value],
2857
2879
  };
2880
+ // if(!element.IsCriteriaField)
2858
2881
  params.push(temp);
2859
2882
  }
2860
2883
  else if (element.Type == 'SearchValue') {
@@ -2898,6 +2921,49 @@
2898
2921
  var url = EntityTypeSetUp.getAllEntityTypeSetup();
2899
2922
  return this.http.get(url);
2900
2923
  };
2924
+ EntityTypeSetupService.prototype.setCriteriaField = function (parameters, FormValues, searchCriteria) {
2925
+ var criteria = null;
2926
+ parameters.forEach(function (element) {
2927
+ if (element.IsCriteriaField && element.Type != 'SearchValue') {
2928
+ debugger;
2929
+ if (searchCriteria && searchCriteria.Where) {
2930
+ var filterobj = {
2931
+ Field: element.Name,
2932
+ Operator: 'Contains',
2933
+ TableAlias: '',
2934
+ Value: FormValues[element.Value],
2935
+ };
2936
+ if (filterobj.Value)
2937
+ searchCriteria.Where.push(filterobj);
2938
+ criteria = searchCriteria;
2939
+ }
2940
+ else {
2941
+ if (!searchCriteria) {
2942
+ var SortingField = { field: null, direction: null };
2943
+ searchCriteria = {
2944
+ Pagging: {
2945
+ PageNo: 1,
2946
+ PageSize: 100,
2947
+ },
2948
+ Where: [],
2949
+ SortOrder: SortingField,
2950
+ };
2951
+ }
2952
+ searchCriteria.Where = [];
2953
+ var filterobj = {
2954
+ Field: element.Name,
2955
+ Operator: 'Contains',
2956
+ TableAlias: '',
2957
+ Value: FormValues[element.Value],
2958
+ };
2959
+ if (filterobj.Value)
2960
+ searchCriteria.Where.push(filterobj);
2961
+ criteria = searchCriteria;
2962
+ }
2963
+ }
2964
+ });
2965
+ return criteria;
2966
+ };
2901
2967
  // ------------------ Favorites --------------
2902
2968
  EntityTypeSetupService.prototype.favoriteAndRecent = function () {
2903
2969
  var url = Favorites.favoriteandrecent();
@@ -6640,6 +6706,190 @@
6640
6706
  return true;
6641
6707
  }
6642
6708
 
6709
+ function registerHandlebarHelperMethods(handlebars) {
6710
+ handlebars.registerHelper('isNotNullAndNotUndefined', function (value) {
6711
+ if (value == null || value == undefined)
6712
+ return false;
6713
+ else
6714
+ return true;
6715
+ });
6716
+ handlebars.registerHelper('MoneyPipe', function (value, prefix, count) {
6717
+ if (prefix === void 0) { prefix = '$'; }
6718
+ if (count === void 0) { count = 2; }
6719
+ if (isNaN(parseFloat(value))) {
6720
+ return null;
6721
+ }
6722
+ else
6723
+ return "" + prefix + parseFloat(value).toFixed(count); // $2312.00
6724
+ });
6725
+ handlebars.registerHelper('BoolPile', function (value) {
6726
+ return value == true ? "YES" : "NO";
6727
+ });
6728
+ handlebars.registerHelper('NillPipe', function (value, cond) {
6729
+ if (value) {
6730
+ return value;
6731
+ }
6732
+ else {
6733
+ if (cond == "0") {
6734
+ return "0";
6735
+ }
6736
+ else
6737
+ return "NIL";
6738
+ }
6739
+ });
6740
+ /* #region Date */
6741
+ handlebars.registerHelper('TodayDatePipe', function (formate) {
6742
+ var date = new Date();
6743
+ switch (formate) {
6744
+ case "DATE":
6745
+ return new Date(date).toLocaleDateString(); // "11/3/2020"
6746
+ case "DATE_TIME":
6747
+ return new Date(date).toLocaleString(); // "11/3/2020, 11:09:23 AM"
6748
+ case "DATE_TIME_FULL":
6749
+ return new Date(date).toString(); // "Tue Nov 03 2020 11:09:10 GMT+0530 (India Standard Time)"
6750
+ case "TIME":
6751
+ return new Date(date).toLocaleTimeString(); // "11:15:39 AM"
6752
+ case "TIME_FULL":
6753
+ return new Date(date).toTimeString(); // "11:15:26 GMT+0530 (India Standard Time)"
6754
+ default:
6755
+ return new Date(date).toLocaleDateString(); // "11/3/2020"
6756
+ }
6757
+ });
6758
+ handlebars.registerHelper('DatePipe', function (date, formate) {
6759
+ if (date) {
6760
+ switch (formate) {
6761
+ case "DATE":
6762
+ return new Date(date).toLocaleDateString(); // "11/3/2020"
6763
+ case "DATE_TIME":
6764
+ return new Date(date).toLocaleString(); // "11/3/2020, 11:09:23 AM"
6765
+ case "DATE_TIME_FULL":
6766
+ return new Date(date).toString(); // "Tue Nov 03 2020 11:09:10 GMT+0530 (India Standard Time)"
6767
+ case "TIME":
6768
+ return new Date(date).toLocaleTimeString(); // "11:15:39 AM"
6769
+ case "TIME_FULL":
6770
+ return new Date(date).toTimeString(); // "11:15:26 GMT+0530 (India Standard Time)"
6771
+ default:
6772
+ return new Date(date).toLocaleDateString(); // "11/3/2020"
6773
+ }
6774
+ }
6775
+ else {
6776
+ return date;
6777
+ }
6778
+ });
6779
+ handlebars.registerHelper('AddtionalDatePipe', function (curdate, day, formate) {
6780
+ if (curdate && day) {
6781
+ var date = new Date(curdate);
6782
+ date.setDate(date.getDate() + parseInt(day));
6783
+ if (formate) {
6784
+ switch (formate) {
6785
+ case "DATE":
6786
+ return new Date(date).toLocaleDateString(); // "11/3/2020"
6787
+ case "DATE_TIME":
6788
+ return new Date(date).toLocaleString(); // "11/3/2020, 11:09:23 AM"
6789
+ case "DATE_TIME_FULL":
6790
+ return new Date(date).toString(); // "Tue Nov 03 2020 11:09:10 GMT+0530 (India Standard Time)"
6791
+ case "TIME":
6792
+ return new Date(date).toLocaleTimeString(); // "11:15:39 AM"
6793
+ case "TIME_FULL":
6794
+ return new Date(date).toTimeString(); // "11:15:26 GMT+0530 (India Standard Time)"
6795
+ default:
6796
+ return new Date(date).toLocaleDateString(); // "11/3/2020"
6797
+ }
6798
+ }
6799
+ else {
6800
+ return date;
6801
+ }
6802
+ }
6803
+ else {
6804
+ return date;
6805
+ }
6806
+ });
6807
+ handlebars.registerHelper('SubDatePipe', function (curdate, day, formate) {
6808
+ if (curdate && day) {
6809
+ var date = new Date(curdate);
6810
+ date.setDate(date.getDate() - parseInt(day));
6811
+ if (formate) {
6812
+ switch (formate) {
6813
+ case "DATE":
6814
+ return new Date(date).toLocaleDateString(); // "11/3/2020"
6815
+ case "DATE_TIME":
6816
+ return new Date(date).toLocaleString(); // "11/3/2020, 11:09:23 AM"
6817
+ case "DATE_TIME_FULL":
6818
+ return new Date(date).toString(); // "Tue Nov 03 2020 11:09:10 GMT+0530 (India Standard Time)"
6819
+ case "TIME":
6820
+ return new Date(date).toLocaleTimeString(); // "11:15:39 AM"
6821
+ case "TIME_FULL":
6822
+ return new Date(date).toTimeString(); // "11:15:26 GMT+0530 (India Standard Time)"
6823
+ default:
6824
+ return new Date(date).toLocaleDateString(); // "11/3/2020"
6825
+ }
6826
+ }
6827
+ else {
6828
+ return date;
6829
+ }
6830
+ }
6831
+ else {
6832
+ return date;
6833
+ }
6834
+ });
6835
+ /* #endregion */
6836
+ /* #region Arithmetic */
6837
+ handlebars.registerHelper('Addition', function (value, value2) {
6838
+ var val = value + value2;
6839
+ return val;
6840
+ });
6841
+ handlebars.registerHelper('Subtraction', function (value, value2) {
6842
+ var val = value - value2;
6843
+ return val;
6844
+ });
6845
+ handlebars.registerHelper('Multiplication', function (value, value2) {
6846
+ if (isNaN(value) && isNaN(value2)) {
6847
+ var val = value * value2;
6848
+ return val;
6849
+ }
6850
+ else {
6851
+ return "";
6852
+ }
6853
+ });
6854
+ handlebars.registerHelper('Division', function (value, value2) {
6855
+ if (isNaN(value) && isNaN(value2)) {
6856
+ var val = value / value2;
6857
+ return val;
6858
+ }
6859
+ else {
6860
+ return "";
6861
+ }
6862
+ });
6863
+ handlebars.registerHelper('Remainder', function (value, value2) {
6864
+ if (isNaN(value) && isNaN(value2)) {
6865
+ var val = value % value2;
6866
+ return val;
6867
+ }
6868
+ else {
6869
+ return "";
6870
+ }
6871
+ });
6872
+ handlebars.registerHelper('lengthGreaterThen0', function (value) {
6873
+ if (value && Array.isArray(value) && value.length > 0)
6874
+ return true;
6875
+ else
6876
+ return false;
6877
+ });
6878
+ handlebars.registerHelper('isNullOrUndefined', function (value) {
6879
+ if (value == null || value == undefined)
6880
+ return true;
6881
+ else
6882
+ return false;
6883
+ });
6884
+ handlebars.registerHelper('isEqual', function (value, value2) {
6885
+ return value == value2 ? true : false;
6886
+ });
6887
+ /* #endregion */
6888
+ handlebars.registerHelper('SetFieldByLang', function (Lang, value, value2) {
6889
+ return Lang == "Ar" ? value2 : value;
6890
+ });
6891
+ }
6892
+
6643
6893
  var EntityDynamicViewComponent = /** @class */ (function () {
6644
6894
  function EntityDynamicViewComponent(entityTypeSetup, router, fb, route, globalService) {
6645
6895
  this.entityTypeSetup = entityTypeSetup;
@@ -6673,7 +6923,8 @@
6673
6923
  this.translatePipe = new TranslatePipe(this.globalService);
6674
6924
  }
6675
6925
  EntityDynamicViewComponent.prototype.ngOnInit = function () {
6676
- registerHandlebarHelperMethodsNew();
6926
+ this._handlebars = handlebars__namespace;
6927
+ registerHandlebarHelperMethods(this._handlebars);
6677
6928
  this.getEntityForm();
6678
6929
  };
6679
6930
  EntityDynamicViewComponent.prototype.closePopup = function () {
@@ -7459,16 +7710,15 @@
7459
7710
  PageGroupValues: [{ type: i0.Input }],
7460
7711
  ParameterData: [{ type: i0.Input }]
7461
7712
  };
7462
- function registerHandlebarHelperMethodsNew() {
7463
- debugger;
7713
+ function registerHandlebarHelperMethodsNew(handlebarObj) {
7464
7714
  console.log("registerHandlebarHelperMethodsNew");
7465
- handlebars.registerHelper('isNotNullAndNotUndefined', function (value) {
7715
+ handlebarObj.registerHelper('isNotNullAndNotUndefined', function (value) {
7466
7716
  if (value == null || value == undefined)
7467
7717
  return false;
7468
7718
  else
7469
7719
  return true;
7470
7720
  });
7471
- handlebars.registerHelper('MoneyPipe', function (value, prefix, count) {
7721
+ handlebarObj.registerHelper('MoneyPipe', function (value, prefix, count) {
7472
7722
  if (prefix === void 0) { prefix = '$'; }
7473
7723
  if (count === void 0) { count = 2; }
7474
7724
  if (isNaN(parseFloat(value))) {
@@ -7477,10 +7727,10 @@
7477
7727
  else
7478
7728
  return "" + prefix + parseFloat(value).toFixed(count); // $2312.00
7479
7729
  });
7480
- handlebars.registerHelper('BoolPile', function (value) {
7730
+ handlebarObj.registerHelper('BoolPile', function (value) {
7481
7731
  return value == true ? "YES" : "NO";
7482
7732
  });
7483
- handlebars.registerHelper('NillPipe', function (value, cond) {
7733
+ handlebarObj.registerHelper('NillPipe', function (value, cond) {
7484
7734
  if (value) {
7485
7735
  return value;
7486
7736
  }
@@ -7493,7 +7743,7 @@
7493
7743
  }
7494
7744
  });
7495
7745
  /* #region Date */
7496
- handlebars.registerHelper('TodayDatePipe', function (formate) {
7746
+ handlebarObj.registerHelper('TodayDatePipe', function (formate) {
7497
7747
  var date = new Date();
7498
7748
  console.log('TodayDatePipe', date);
7499
7749
  switch (formate) {
@@ -7511,8 +7761,7 @@
7511
7761
  return new Date(date).toLocaleDateString(); // "11/3/2020"
7512
7762
  }
7513
7763
  });
7514
- handlebars.registerHelper('AddtionalDatePipe', function (curdate, day, formate) {
7515
- debugger;
7764
+ handlebarObj.registerHelper('AddtionalDatePipe', function (curdate, day, formate) {
7516
7765
  if (curdate && day) {
7517
7766
  var date = new Date(curdate);
7518
7767
  date.setDate(date.getDate() + parseInt(day));
@@ -7540,7 +7789,7 @@
7540
7789
  return date;
7541
7790
  }
7542
7791
  });
7543
- handlebars.registerHelper('SubDatePipe', function (curdate, day, formate) {
7792
+ handlebarObj.registerHelper('SubDatePipe', function (curdate, day, formate) {
7544
7793
  if (curdate && day) {
7545
7794
  var date = new Date(curdate);
7546
7795
  date.setDate(date.getDate() - parseInt(day));
@@ -7570,16 +7819,15 @@
7570
7819
  });
7571
7820
  /* #endregion */
7572
7821
  /* #region Arithmetic */
7573
- handlebars.registerHelper('Addition', function (value, value2) {
7574
- debugger;
7822
+ handlebarObj.registerHelper('Addition', function (value, value2) {
7575
7823
  var val = value + value2;
7576
7824
  return val;
7577
7825
  });
7578
- handlebars.registerHelper('Subtraction', function (value, value2) {
7826
+ handlebarObj.registerHelper('Subtraction', function (value, value2) {
7579
7827
  var val = value - value2;
7580
7828
  return val;
7581
7829
  });
7582
- handlebars.registerHelper('Multiplication', function (value, value2) {
7830
+ handlebarObj.registerHelper('Multiplication', function (value, value2) {
7583
7831
  if (isNaN(value) && isNaN(value2)) {
7584
7832
  var val = value * value2;
7585
7833
  return val;
@@ -7588,7 +7836,7 @@
7588
7836
  return "";
7589
7837
  }
7590
7838
  });
7591
- handlebars.registerHelper('Division', function (value, value2) {
7839
+ handlebarObj.registerHelper('Division', function (value, value2) {
7592
7840
  if (isNaN(value) && isNaN(value2)) {
7593
7841
  var val = value / value2;
7594
7842
  return val;
@@ -7597,7 +7845,7 @@
7597
7845
  return "";
7598
7846
  }
7599
7847
  });
7600
- handlebars.registerHelper('Remainder', function (value, value2) {
7848
+ handlebarObj.registerHelper('Remainder', function (value, value2) {
7601
7849
  if (isNaN(value) && isNaN(value2)) {
7602
7850
  var val = value % value2;
7603
7851
  return val;
@@ -7606,25 +7854,23 @@
7606
7854
  return "";
7607
7855
  }
7608
7856
  });
7609
- handlebars.registerHelper('lengthGreaterThen0', function (value) {
7857
+ handlebarObj.registerHelper('lengthGreaterThen0', function (value) {
7610
7858
  if (value && Array.isArray(value) && value.length > 0)
7611
7859
  return true;
7612
7860
  else
7613
7861
  return false;
7614
7862
  });
7615
- handlebars.registerHelper('isNullOrUndefined', function (value) {
7863
+ handlebarObj.registerHelper('isNullOrUndefined', function (value) {
7616
7864
  if (value == null || value == undefined)
7617
7865
  return true;
7618
7866
  else
7619
7867
  return false;
7620
7868
  });
7621
- handlebars.registerHelper('isEqual', function (value, value2) {
7622
- debugger;
7869
+ handlebarObj.registerHelper('isEqual', function (value, value2) {
7623
7870
  return value == value2 ? true : false;
7624
7871
  });
7625
7872
  /* #endregion */
7626
- handlebars.registerHelper('SetFieldByLang', function (Lang, value, value2) {
7627
- debugger;
7873
+ handlebarObj.registerHelper('SetFieldByLang', function (Lang, value, value2) {
7628
7874
  return Lang == "Ar" ? value2 : value;
7629
7875
  });
7630
7876
  }
@@ -7804,7 +8050,7 @@
7804
8050
  }
7805
8051
  };
7806
8052
  EntityDynamicFieldComponent.prototype.generateDropDownFields = function () {
7807
- var e_1, _a;
8053
+ var e_1, _b;
7808
8054
  var _this = this;
7809
8055
  var _loop_1 = function (iterator) {
7810
8056
  if (iterator.DataType == E_DataType.dropdown) {
@@ -7814,11 +8060,16 @@
7814
8060
  if (jsonItem.isDynamic && jsonItem.api && jsonItem.api.url) {
7815
8061
  var url = jsonItem.api.url;
7816
8062
  _this.entityTypeSetup.getDyamicUrl(url).subscribe(function (ress) {
8063
+ var _a;
7817
8064
  var res = ress;
7818
- if (ress.entities)
8065
+ if (ress && (ress === null || ress === void 0 ? void 0 : ress.entities))
7819
8066
  res = ress.entities;
7820
- if (ress.Data)
8067
+ if (ress && (ress === null || ress === void 0 ? void 0 : ress.Data))
7821
8068
  res = ress.Data;
8069
+ if (ress && (ress === null || ress === void 0 ? void 0 : ress.templates))
8070
+ res = ress.templates;
8071
+ if (ress && (ress === null || ress === void 0 ? void 0 : ress.Data) && ((_a = ress === null || ress === void 0 ? void 0 : ress.Data) === null || _a === void 0 ? void 0 : _a.Data))
8072
+ res = ress.Data.Data;
7822
8073
  if (res && Array.isArray(res) && res.length > 0) {
7823
8074
  obx.next(res.map(function (x) { return Object.assign({
7824
8075
  Id: x[jsonItem.api.valueField],
@@ -7854,15 +8105,15 @@
7854
8105
  };
7855
8106
  var this_1 = this;
7856
8107
  try {
7857
- for (var _b = __values(this.fieldsList), _c = _b.next(); !_c.done; _c = _b.next()) {
7858
- var iterator = _c.value;
8108
+ for (var _c = __values(this.fieldsList), _d = _c.next(); !_d.done; _d = _c.next()) {
8109
+ var iterator = _d.value;
7859
8110
  _loop_1(iterator);
7860
8111
  }
7861
8112
  }
7862
8113
  catch (e_1_1) { e_1 = { error: e_1_1 }; }
7863
8114
  finally {
7864
8115
  try {
7865
- if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
8116
+ if (_d && !_d.done && (_b = _c.return)) _b.call(_c);
7866
8117
  }
7867
8118
  finally { if (e_1) throw e_1.error; }
7868
8119
  }
@@ -7980,7 +8231,7 @@
7980
8231
  /* #endregion */
7981
8232
  restData_1.QueryStrings.forEach(function (query) {
7982
8233
  if (query.Type == 'FieldValue') {
7983
- if (!_formvalue_1[query.Value]) {
8234
+ if (!_formvalue_1[query.Value] && query.IsNullable != true) {
7984
8235
  // Swal.fire('please fill ' + query.Value, 'warning');
7985
8236
  Swal__default['default'].fire({
7986
8237
  title: _this.translatePipe.transform('please fill ' + query.Value),
@@ -7995,13 +8246,16 @@
7995
8246
  }
7996
8247
  _this.entityTypeSetup.dynamicAPi(jsonItem.rest, _formvalue_1, searchCriteria, SearchText, restData_1.Havecriteria)
7997
8248
  .subscribe(function (ress) {
8249
+ var _a;
7998
8250
  var res = ress;
7999
- if (ress.entities)
8251
+ if (ress && (ress === null || ress === void 0 ? void 0 : ress.entities))
8000
8252
  res = ress.entities;
8001
- if (ress.Data)
8253
+ if (ress && (ress === null || ress === void 0 ? void 0 : ress.Data))
8002
8254
  res = ress.Data;
8003
- if (ress.templates)
8255
+ if (ress && (ress === null || ress === void 0 ? void 0 : ress.templates))
8004
8256
  res = ress.templates;
8257
+ if (ress && (ress === null || ress === void 0 ? void 0 : ress.Data) && ((_a = ress === null || ress === void 0 ? void 0 : ress.Data) === null || _a === void 0 ? void 0 : _a.Data))
8258
+ res = ress.Data.Data;
8005
8259
  if (RequestorField) {
8006
8260
  var _Sitem = res.filter(function (x) { return x[restData_1.valueField] == _this.RequestorFieldValue; });
8007
8261
  _this.fieldsList.map(function (x) {
@@ -8026,11 +8280,16 @@
8026
8280
  else if (jsonItem.isDynamic && jsonItem.api && jsonItem.api.url) {
8027
8281
  var url = jsonItem.api.url;
8028
8282
  _this.entityTypeSetup.getDyamicUrl(url).subscribe(function (ress) {
8283
+ var _a;
8029
8284
  var res = ress;
8030
- if (ress.entities)
8285
+ if (ress && (ress === null || ress === void 0 ? void 0 : ress.entities))
8031
8286
  res = ress.entities;
8032
- if (ress.Data)
8287
+ if (ress && (ress === null || ress === void 0 ? void 0 : ress.Data))
8033
8288
  res = ress.Data;
8289
+ if (ress && (ress === null || ress === void 0 ? void 0 : ress.templates))
8290
+ res = ress.templates;
8291
+ if (ress && (ress === null || ress === void 0 ? void 0 : ress.Data) && ((_a = ress === null || ress === void 0 ? void 0 : ress.Data) === null || _a === void 0 ? void 0 : _a.Data))
8292
+ res = ress.Data.Data;
8034
8293
  if (res && Array.isArray(res) && res.length > 0) {
8035
8294
  obx.next(res.map(function (x) { return Object.assign({
8036
8295
  Id: x[jsonItem.api.valueField],
@@ -8295,11 +8554,16 @@
8295
8554
  _this.entityTypeSetup
8296
8555
  .dynamicAPi(jsonItem.rest, _formvalue_2)
8297
8556
  .subscribe(function (ress) {
8557
+ var _a;
8298
8558
  var res = ress;
8299
- if (ress.entities)
8559
+ if (ress && (ress === null || ress === void 0 ? void 0 : ress.entities))
8300
8560
  res = ress.entities;
8301
- if (ress.Data)
8561
+ if (ress && (ress === null || ress === void 0 ? void 0 : ress.Data))
8302
8562
  res = ress.Data;
8563
+ if (ress && (ress === null || ress === void 0 ? void 0 : ress.templates))
8564
+ res = ress.templates;
8565
+ if (ress && (ress === null || ress === void 0 ? void 0 : ress.Data) && ((_a = ress === null || ress === void 0 ? void 0 : ress.Data) === null || _a === void 0 ? void 0 : _a.Data))
8566
+ res = ress.Data.Data;
8303
8567
  if (res && Array.isArray(res) && res.length > 0) {
8304
8568
  obx.next(res.map(function (x) { return Object.assign({
8305
8569
  Id: x[jsonItem.rest.valueField],
@@ -8320,11 +8584,16 @@
8320
8584
  else if (jsonItem.isDynamic && jsonItem.api && jsonItem.api.url) {
8321
8585
  var url = jsonItem.api.url;
8322
8586
  _this.entityTypeSetup.getDyamicUrl(url).subscribe(function (ress) {
8587
+ var _a;
8323
8588
  var res = ress;
8324
- if (ress.entities)
8589
+ if (ress && (ress === null || ress === void 0 ? void 0 : ress.entities))
8325
8590
  res = ress.entities;
8326
- if (ress.Data)
8591
+ if (ress && (ress === null || ress === void 0 ? void 0 : ress.Data))
8327
8592
  res = ress.Data;
8593
+ if (ress && (ress === null || ress === void 0 ? void 0 : ress.templates))
8594
+ res = ress.templates;
8595
+ if (ress && (ress === null || ress === void 0 ? void 0 : ress.Data) && ((_a = ress === null || ress === void 0 ? void 0 : ress.Data) === null || _a === void 0 ? void 0 : _a.Data))
8596
+ res = ress.Data.Data;
8328
8597
  if (res && Array.isArray(res) && res.length > 0) {
8329
8598
  obx.next(res.map(function (x) { return Object.assign({
8330
8599
  Id: x[jsonItem.api.valueField],
@@ -8415,10 +8684,10 @@
8415
8684
  this.getShortCodeCannedResponse(item);
8416
8685
  };
8417
8686
  EntityDynamicFieldComponent.prototype.getListFieldData = function () {
8418
- var e_2, _a;
8687
+ var e_2, _b;
8419
8688
  try {
8420
- for (var _b = __values(this.fieldsList), _c = _b.next(); !_c.done; _c = _b.next()) {
8421
- var field = _c.value;
8689
+ for (var _c = __values(this.fieldsList), _d = _c.next(); !_d.done; _d = _c.next()) {
8690
+ var field = _d.value;
8422
8691
  if (field.DataType == E_DataType.List) {
8423
8692
  this.FiedlListData$[field.Description] = [];
8424
8693
  var fieldVal = this.pageForm.form && this.pageForm.form.get(field.Description).value;
@@ -8434,7 +8703,7 @@
8434
8703
  catch (e_2_1) { e_2 = { error: e_2_1 }; }
8435
8704
  finally {
8436
8705
  try {
8437
- if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
8706
+ if (_d && !_d.done && (_b = _c.return)) _b.call(_c);
8438
8707
  }
8439
8708
  finally { if (e_2) throw e_2.error; }
8440
8709
  }