@churchillliving/se-ui-toolkit 6.53.97 → 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.
- package/bundles/churchillliving-se-ui-toolkit.umd.js +102 -103
- package/bundles/churchillliving-se-ui-toolkit.umd.js.map +1 -1
- package/churchillliving-se-ui-toolkit.metadata.json +1 -1
- package/esm2015/lib/components/base/report/report-Filter/report-filter/report-filter.component.js +2 -2
- package/esm2015/lib/services/form.service.js +18 -1
- package/esm2015/lib/services/grid.service.js +8 -8
- package/esm2015/lib/services/hyperlink.service.js +48 -1
- package/esm2015/lib/services/sidebar.service.js +18 -1
- package/esm2015/lib/services/utilities.service.js +3 -82
- package/fesm2015/churchillliving-se-ui-toolkit.js +90 -89
- package/fesm2015/churchillliving-se-ui-toolkit.js.map +1 -1
- package/lib/services/form.service.d.ts +2 -1
- package/lib/services/hyperlink.service.d.ts +2 -0
- package/lib/services/sidebar.service.d.ts +3 -0
- package/lib/services/utilities.service.d.ts +2 -5
- package/package.json +1 -1
|
@@ -746,8 +746,8 @@
|
|
|
746
746
|
else {
|
|
747
747
|
return resolve('');
|
|
748
748
|
}
|
|
749
|
-
}, function (
|
|
750
|
-
var 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 (
|
|
765
|
-
var 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 (
|
|
790
|
-
switch (
|
|
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*/,
|
|
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*/,
|
|
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
|
|
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) {
|
|
@@ -2500,8 +2466,13 @@
|
|
|
2500
2466
|
columnInfo.optionLabel = columnInfo.optionLabel ? columnInfo.optionLabel : 'label';
|
|
2501
2467
|
columnInfo.optionValue = columnInfo.optionValue ? columnInfo.optionValue : 'value';
|
|
2502
2468
|
}
|
|
2503
|
-
else if (columnInfo.type === exports.EGridColumnType.DIALOG
|
|
2504
|
-
columnInfo.filtering
|
|
2469
|
+
else if (columnInfo.type === exports.EGridColumnType.DIALOG) {
|
|
2470
|
+
if (!columnInfo.filtering && !columnInfo.filter) {
|
|
2471
|
+
columnInfo.filtering = false;
|
|
2472
|
+
}
|
|
2473
|
+
if (columnInfo.params && !columnInfo.data) {
|
|
2474
|
+
columnInfo.data = columnInfo.params;
|
|
2475
|
+
}
|
|
2505
2476
|
}
|
|
2506
2477
|
var column = {
|
|
2507
2478
|
allowSearch: columnInfo.allowSearch,
|
|
@@ -2808,11 +2779,6 @@
|
|
|
2808
2779
|
};
|
|
2809
2780
|
GridService.prototype.setHyperlinks = function (fetchResponse, columns) {
|
|
2810
2781
|
var _this = this;
|
|
2811
|
-
columns.forEach(function (column) {
|
|
2812
|
-
if (column.type === exports.EGridColumnType.DIALOG && !column.data) {
|
|
2813
|
-
_this.alertService.error("\"Data\" property is missing for \"" + column.header + "\" column");
|
|
2814
|
-
}
|
|
2815
|
-
});
|
|
2816
2782
|
var records = [];
|
|
2817
2783
|
var data = fetchResponse && fetchResponse.records.length > 0 ? this.setDataFields(fetchResponse.records) : [];
|
|
2818
2784
|
var newRow;
|
|
@@ -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
|
-
|
|
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;
|