@churchillliving/se-ui-toolkit 6.53.98 → 6.53.99

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.
@@ -746,8 +746,8 @@
746
746
  else {
747
747
  return resolve('');
748
748
  }
749
- }, function (_a) {
750
- var error = _a.error;
749
+ }, function (_h) {
750
+ var error = _h.error;
751
751
  reject(error);
752
752
  });
753
753
  }
@@ -761,8 +761,8 @@
761
761
  else {
762
762
  return resolve('');
763
763
  }
764
- }, function (_a) {
765
- var error = _a.error;
764
+ }, function (_h) {
765
+ var error = _h.error;
766
766
  reject(error);
767
767
  });
768
768
  }
@@ -786,8 +786,8 @@
786
786
  HyperlinkService.prototype.addHyperlinks = function (columns) {
787
787
  return __awaiter(this, void 0, void 0, function () {
788
788
  var linkIds, params;
789
- return __generator(this, function (_a) {
790
- switch (_a.label) {
789
+ return __generator(this, function (_h) {
790
+ switch (_h.label) {
791
791
  case 0:
792
792
  linkIds = [];
793
793
  if (!(columns && Array.isArray(columns))) return [3 /*break*/, 2];
@@ -804,7 +804,7 @@
804
804
  return [4 /*yield*/, this.buildUrl(linkIds, params).then(function (res) {
805
805
  return res;
806
806
  })];
807
- case 1: return [2 /*return*/, _a.sent()];
807
+ case 1: return [2 /*return*/, _h.sent()];
808
808
  case 2:
809
809
  if (!columns.linkId) return [3 /*break*/, 4];
810
810
  linkIds.push(columns.linkId);
@@ -812,12 +812,60 @@
812
812
  return [4 /*yield*/, this.buildUrl(linkIds, params).then(function (res) {
813
813
  return res;
814
814
  })];
815
- case 3: return [2 /*return*/, _a.sent()];
815
+ case 3: return [2 /*return*/, _h.sent()];
816
816
  case 4: return [2 /*return*/];
817
817
  }
818
818
  });
819
819
  });
820
820
  };
821
+ HyperlinkService.prototype.setLinkParamValues = function (_h, field, params) {
822
+ var formSections = _h.formSections;
823
+ return formSections === null || formSections === void 0 ? void 0 : formSections.map(function (section) {
824
+ return section.fields.map(function (formField) {
825
+ var _a, _b, _c, _d, _e, _f, _g;
826
+ var isLabelLink = formField.label && typeof formField.label === 'object';
827
+ if (((_a = formField.field) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === (field === null || field === void 0 ? void 0 : field.toLowerCase()) ||
828
+ (isLabelLink &&
829
+ ((_c = (_b = formField.label) === null || _b === void 0 ? void 0 : _b.name) === null || _c === void 0 ? void 0 : _c.toLowerCase()) === (field === null || field === void 0 ? void 0 : field.toLowerCase())) ||
830
+ (formField.label &&
831
+ typeof formField.label === 'string' &&
832
+ ((_d = formField.label) === null || _d === void 0 ? void 0 : _d.toLowerCase()) === (field === null || field === void 0 ? void 0 : field.toLowerCase()))) {
833
+ var newLink_1 = isLabelLink
834
+ ? (_f = (_e = formField.label) === null || _e === void 0 ? void 0 : _e.labelControl) === null || _f === void 0 ? void 0 : _f.orignalLink
835
+ : (_g = formField.hyperlink) === null || _g === void 0 ? void 0 : _g.link;
836
+ if (newLink_1 && newLink_1.length > 0) {
837
+ return params.map(function (paramObj) {
838
+ var _a, _b, _c, _d;
839
+ if ((typeof paramObj.value === 'object' && paramObj.value) ||
840
+ (typeof paramObj.value === 'string' && ((_a = paramObj.value) === null || _a === void 0 ? void 0 : _a.length) > 0)) {
841
+ // removing https:// or http:// from hyperlink param value
842
+ if ((((_b = paramObj.value) === null || _b === void 0 ? void 0 : _b.toString().includes('https://')) || ((_c = paramObj.value) === null || _c === void 0 ? void 0 : _c.toString().includes('http://'))) &&
843
+ (newLink_1.includes('https://') || newLink_1.includes('http://'))) {
844
+ paramObj.value = paramObj.value.replace('https://', '').replace('http://', '');
845
+ }
846
+ var paramName = paramObj.name.toLowerCase();
847
+ var paramFormat = !paramObj.value
848
+ ? '{{' + paramName + '}}'
849
+ : paramName;
850
+ if (newLink_1.localeCompare(paramFormat)) {
851
+ var setLink = paramFormat !== '{{' + paramFormat + '}}'
852
+ ? '{{' + paramFormat + '}}'
853
+ : paramFormat;
854
+ newLink_1 = newLink_1.replace(new RegExp(setLink, 'ig'), (_d = (paramObj.value)) === null || _d === void 0 ? void 0 : _d.toTrim());
855
+ if (newLink_1 && !newLink_1.startsWith('http')) {
856
+ newLink_1 = "http://" + newLink_1;
857
+ }
858
+ }
859
+ return isLabelLink
860
+ ? (formField.label.labelControl.hyperlink.link = newLink_1)
861
+ : (formField.hyperlink.link = newLink_1);
862
+ }
863
+ });
864
+ }
865
+ }
866
+ });
867
+ });
868
+ };
821
869
  HyperlinkService.prototype.setSidebarLink = function (response, sidebar) {
822
870
  response.forEach(function (res) {
823
871
  sidebar.forEach(function (item) {
@@ -971,24 +1019,6 @@
971
1019
  close.click();
972
1020
  }
973
1021
  }
974
- function setAddComponentData(_k, id, value) {
975
- var formSections = _k.formSections;
976
- formSections === null || formSections === void 0 ? void 0 : formSections.forEach(function (section) {
977
- section.fields.forEach(function (field) {
978
- var _a;
979
- if (field.control === exports.EFormControl.COMPONENT && field.componentControl && ((_a = field.componentControl) === null || _a === void 0 ? void 0 : _a.id) === id) {
980
- var keys = Object.keys(value);
981
- keys.forEach(function (key) {
982
- var _k;
983
- var _a;
984
- field.componentControl.data = Object.assign(Object.assign({}, (_a = field.componentControl) === null || _a === void 0 ? void 0 : _a.data), (_k = {}, _k[key] = value[key], _k));
985
- });
986
- changeDynamicFormState(id, field.componentControl.data);
987
- }
988
- ;
989
- });
990
- });
991
- }
992
1022
  function toDecimal(value) {
993
1023
  if (value) {
994
1024
  return parseFloat(value.toString()).toFixed(2);
@@ -1142,54 +1172,6 @@
1142
1172
  });
1143
1173
  return formSections;
1144
1174
  }
1145
- function setLinkParamValues(_k, field, params) {
1146
- var formSections = _k.formSections;
1147
- return formSections === null || formSections === void 0 ? void 0 : formSections.map(function (section) {
1148
- return section.fields.map(function (formField) {
1149
- var _a, _b, _c, _d, _e, _f, _g;
1150
- var isLabelLink = formField.label && typeof formField.label === 'object';
1151
- if (((_a = formField.field) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === (field === null || field === void 0 ? void 0 : field.toLowerCase()) ||
1152
- (isLabelLink &&
1153
- ((_c = (_b = formField.label) === null || _b === void 0 ? void 0 : _b.name) === null || _c === void 0 ? void 0 : _c.toLowerCase()) === (field === null || field === void 0 ? void 0 : field.toLowerCase())) ||
1154
- (formField.label &&
1155
- typeof formField.label === 'string' &&
1156
- ((_d = formField.label) === null || _d === void 0 ? void 0 : _d.toLowerCase()) === (field === null || field === void 0 ? void 0 : field.toLowerCase()))) {
1157
- var newLink_1 = isLabelLink
1158
- ? (_f = (_e = formField.label) === null || _e === void 0 ? void 0 : _e.labelControl) === null || _f === void 0 ? void 0 : _f.orignalLink
1159
- : (_g = formField.hyperlink) === null || _g === void 0 ? void 0 : _g.link;
1160
- if (newLink_1 && newLink_1.length > 0) {
1161
- return params.map(function (paramObj) {
1162
- var _a, _b, _c;
1163
- if ((typeof paramObj.value === 'object' && paramObj.value) ||
1164
- (typeof paramObj.value === 'string' && ((_a = paramObj.value) === null || _a === void 0 ? void 0 : _a.length) > 0)) {
1165
- // removing https:// or http:// from hyperlink param value
1166
- if ((((_b = paramObj.value) === null || _b === void 0 ? void 0 : _b.toString().includes('https://')) || ((_c = paramObj.value) === null || _c === void 0 ? void 0 : _c.toString().includes('http://'))) &&
1167
- (newLink_1.includes('https://') || newLink_1.includes('http://'))) {
1168
- paramObj.value = paramObj.value.replace('https://', '').replace('http://', '');
1169
- }
1170
- var paramName = paramObj.name.toLowerCase();
1171
- var paramFormat = !paramObj.value
1172
- ? '{{' + paramName + '}}'
1173
- : paramName;
1174
- if (newLink_1.localeCompare(paramFormat)) {
1175
- var setLink = paramFormat !== '{{' + paramFormat + '}}'
1176
- ? '{{' + paramFormat + '}}'
1177
- : paramFormat;
1178
- newLink_1 = newLink_1.replace(new RegExp(setLink, 'ig'), toTrim(paramObj.value));
1179
- if (newLink_1 && !newLink_1.startsWith('http')) {
1180
- newLink_1 = "http://" + newLink_1;
1181
- }
1182
- }
1183
- return isLabelLink
1184
- ? (formField.label.labelControl.hyperlink.link = newLink_1)
1185
- : (formField.hyperlink.link = newLink_1);
1186
- }
1187
- });
1188
- }
1189
- }
1190
- });
1191
- });
1192
- }
1193
1175
  function setSidebarLinkParamValues(link, params) {
1194
1176
  var newLink = link;
1195
1177
  if (params && params.length > 0) {
@@ -1202,7 +1184,7 @@
1202
1184
  }
1203
1185
  return newLink;
1204
1186
  }
1205
- function setFormPropValues(_k, field, props) {
1187
+ function setFormFieldProp(_k, field, props) {
1206
1188
  var formSections = _k.formSections;
1207
1189
  return formSections === null || formSections === void 0 ? void 0 : formSections.map(function (section) {
1208
1190
  return section.fields.map(function (formField) {
@@ -1447,22 +1429,6 @@
1447
1429
  return '';
1448
1430
  }
1449
1431
  }
1450
- function setSidebarPropValues(sidebar, section, props) {
1451
- sidebar.map(function (sidebarItem) {
1452
- var _a;
1453
- if (((_a = sidebarItem.section) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === section.toLowerCase()) {
1454
- props.map(function (prop) {
1455
- var _a, _b;
1456
- if (((_a = prop.name) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === 'data' && ((_b = sidebarItem.data) === null || _b === void 0 ? void 0 : _b.data)) {
1457
- sidebarItem.data.data = prop.value;
1458
- }
1459
- else {
1460
- return setPropValue(sidebarItem, prop);
1461
- }
1462
- });
1463
- }
1464
- });
1465
- }
1466
1432
  function setSectionPropValues(_k, sectionName, props) {
1467
1433
  var formSections = _k.formSections;
1468
1434
  formSections === null || formSections === void 0 ? void 0 : formSections.map(function (section) {
@@ -5942,6 +5908,25 @@
5942
5908
  return _this.addFormField(fieldInfo);
5943
5909
  });
5944
5910
  };
5911
+ // load component on form
5912
+ FormService.prototype.setAddComponentData = function (_e, id, value) {
5913
+ var formSections = _e.formSections;
5914
+ formSections === null || formSections === void 0 ? void 0 : formSections.forEach(function (section) {
5915
+ section.fields.forEach(function (field) {
5916
+ var _a;
5917
+ if (field.control === exports.EFormControl.COMPONENT && field.componentControl && ((_a = field.componentControl) === null || _a === void 0 ? void 0 : _a.id) === id) {
5918
+ var keys = Object.keys(value);
5919
+ keys.forEach(function (key) {
5920
+ var _e;
5921
+ var _a;
5922
+ field.componentControl.data = Object.assign(Object.assign({}, (_a = field.componentControl) === null || _a === void 0 ? void 0 : _a.data), (_e = {}, _e[key] = value[key], _e));
5923
+ });
5924
+ changeDynamicFormState(id, field.componentControl.data);
5925
+ }
5926
+ ;
5927
+ });
5928
+ });
5929
+ };
5945
5930
  FormService.prototype.getCardList = function (uniqueKey, filters, sorts) {
5946
5931
  var _this = this;
5947
5932
  if (filters === void 0) { filters = []; }
@@ -8191,7 +8176,7 @@
8191
8176
  uniqueKey: record.isuniquekey,
8192
8177
  filters: []
8193
8178
  }).subscribe(function (response) {
8194
- setFormPropValues(_this.dynamicForm, record.paramname, [
8179
+ setFormFieldProp(_this.dynamicForm, record.paramname, [
8195
8180
  { name: 'data', value: response.records },
8196
8181
  ]);
8197
8182
  }, function (error) {
@@ -9048,6 +9033,22 @@
9048
9033
  }
9049
9034
  return false;
9050
9035
  };
9036
+ SideBarService.prototype.setSidebarPropValues = function (sidebar, section, props) {
9037
+ sidebar.map(function (sidebarItem) {
9038
+ var _a;
9039
+ if (((_a = sidebarItem.section) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === section.toLowerCase()) {
9040
+ props.map(function (prop) {
9041
+ var _a, _b;
9042
+ if (((_a = prop.name) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === 'data' && ((_b = sidebarItem.data) === null || _b === void 0 ? void 0 : _b.data)) {
9043
+ sidebarItem.data.data = prop.value;
9044
+ }
9045
+ else {
9046
+ return setPropValue(sidebarItem, prop);
9047
+ }
9048
+ });
9049
+ }
9050
+ });
9051
+ };
9051
9052
  return SideBarService;
9052
9053
  }());
9053
9054
  /** @nocollapse */ SideBarService.ɵprov = i0__namespace.ɵɵdefineInjectable({ factory: function SideBarService_Factory() { return new SideBarService(); }, token: SideBarService, providedIn: "root" });
@@ -9310,7 +9311,6 @@
9310
9311
  exports.objConvertToLower = objConvertToLower;
9311
9312
  exports.onDynamicFormStateChange = onDynamicFormStateChange;
9312
9313
  exports.removeActiveIconClass = removeActiveIconClass;
9313
- exports.setAddComponentData = setAddComponentData;
9314
9314
  exports.setAllFormFieldsValues = setAllFormFieldsValues;
9315
9315
  exports.setAndFilter = setAndFilter;
9316
9316
  exports.setAutoCompleteData = setAutoCompleteData;
@@ -9321,22 +9321,21 @@
9321
9321
  exports.setEditFormFields = setEditFormFields;
9322
9322
  exports.setFilter = setFilter;
9323
9323
  exports.setFormField = setFormField;
9324
+ exports.setFormFieldProp = setFormFieldProp;
9324
9325
  exports.setFormFieldValue = setFormFieldValue;
9325
9326
  exports.setFormFields = setFormFields;
9326
- exports.setFormPropValues = setFormPropValues;
9327
9327
  exports.setGlobalFilterPropValues = setGlobalFilterPropValues;
9328
9328
  exports.setGridLookupData = setGridLookupData;
9329
9329
  exports.setHyperlink = setHyperlink;
9330
9330
  exports.setHyperlinkComponentData = setHyperlinkComponentData;
9331
9331
  exports.setHyperlinkParamValue = setHyperlinkParamValue;
9332
- exports.setLinkParamValues = setLinkParamValues;
9333
9332
  exports.setLookupData = setLookupData;
9334
9333
  exports.setMinutesInterval = setMinutesInterval;
9334
+ exports.setPropValue = setPropValue;
9335
9335
  exports.setSaveCardValues = setSaveCardValues;
9336
9336
  exports.setSaveFormValues = setSaveFormValues;
9337
9337
  exports.setSectionPropValues = setSectionPropValues;
9338
9338
  exports.setSidebarLinkParamValues = setSidebarLinkParamValues;
9339
- exports.setSidebarPropValues = setSidebarPropValues;
9340
9339
  exports.setTimeInDate = setTimeInDate;
9341
9340
  exports.setUpdatedRecord = setUpdatedRecord;
9342
9341
  exports.toBoolean = toBoolean;