@pepperi-addons/ngx-lib 0.2.58-tomer.1 → 0.2.59-beta.2
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/pepperi-addons-ngx-lib.umd.js +62 -23
- package/bundles/pepperi-addons-ngx-lib.umd.js.map +1 -1
- package/core/common/services/addon.service.d.ts +2 -1
- package/core/common/services/file.service.d.ts +4 -4
- package/esm2015/core/common/services/addon.service.js +19 -4
- package/esm2015/core/common/services/file.service.js +9 -9
- package/esm2015/core/common/services/utilities.service.js +31 -13
- package/fesm2015/pepperi-addons-ngx-lib.js +56 -23
- package/fesm2015/pepperi-addons-ngx-lib.js.map +1 -1
- package/package.json +1 -1
- package/src/core/style/abstracts/mixins.scss +3 -3
|
@@ -727,24 +727,42 @@
|
|
|
727
727
|
.toLocaleString(this.culture)
|
|
728
728
|
.substring(1, 2);
|
|
729
729
|
};
|
|
730
|
+
// parseDate(dateStr: string, showTime = false): Date {
|
|
731
|
+
// let retVal: Date = null;
|
|
732
|
+
// if (dateStr !== '') {
|
|
733
|
+
// retVal = new Date(dateStr);
|
|
734
|
+
// // Convert to date with no offset.
|
|
735
|
+
// if (!showTime) {
|
|
736
|
+
// const index = dateStr.indexOf('T');
|
|
737
|
+
// if (index > 0) {
|
|
738
|
+
// dateStr = dateStr.substring(0, index);
|
|
739
|
+
// }
|
|
740
|
+
// const dateText = dateStr.split('-');
|
|
741
|
+
// if (dateText.length === 3) {
|
|
742
|
+
// const year = Number(dateText[0]);
|
|
743
|
+
// const month = Number(dateText[1]) - 1;
|
|
744
|
+
// const day = Number(dateText[2]);
|
|
745
|
+
// retVal = new Date(year, month, day, 0, retVal.getTimezoneOffset() * -1);
|
|
746
|
+
// }
|
|
747
|
+
// }
|
|
748
|
+
// }
|
|
749
|
+
// if (retVal && isNaN(retVal.getTime())) {
|
|
750
|
+
// retVal = null;
|
|
751
|
+
// }
|
|
752
|
+
// return retVal;
|
|
753
|
+
// }
|
|
730
754
|
PepUtilitiesService.prototype.parseDate = function (dateStr, showTime) {
|
|
731
755
|
if (showTime === void 0) { showTime = false; }
|
|
732
756
|
var retVal = null;
|
|
733
757
|
if (dateStr !== '') {
|
|
734
758
|
retVal = new Date(dateStr);
|
|
735
759
|
// Convert to date with no offset.
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
if (dateText.length === 3) {
|
|
743
|
-
var year = Number(dateText[0]);
|
|
744
|
-
var month = Number(dateText[1]) - 1;
|
|
745
|
-
var day = Number(dateText[2]);
|
|
746
|
-
retVal = new Date(year, month, day, 0, retVal.getTimezoneOffset() * -1);
|
|
747
|
-
}
|
|
760
|
+
var dateText = dateStr.split('-');
|
|
761
|
+
if (dateText.length === 3 && !showTime) {
|
|
762
|
+
var year = Number(dateText[0]);
|
|
763
|
+
var month = Number(dateText[1]) - 1;
|
|
764
|
+
var day = Number(dateText[2]);
|
|
765
|
+
retVal = new Date(year, month, day);
|
|
748
766
|
}
|
|
749
767
|
}
|
|
750
768
|
if (retVal && isNaN(retVal.getTime())) {
|
|
@@ -2229,22 +2247,26 @@
|
|
|
2229
2247
|
var blob = new Blob(byteArrays, { type: contentType });
|
|
2230
2248
|
return blob;
|
|
2231
2249
|
};
|
|
2232
|
-
PepFileService.prototype.getAssetsPath = function (assetsDomain) {
|
|
2250
|
+
PepFileService.prototype.getAssetsPath = function (assetsDomain, libName) {
|
|
2233
2251
|
if (assetsDomain === void 0) { assetsDomain = ''; }
|
|
2252
|
+
if (libName === void 0) { libName = 'ngx-lib'; }
|
|
2234
2253
|
var concatChar = assetsDomain === '' || assetsDomain.endsWith('/') ? '' : '/';
|
|
2235
|
-
return "" + assetsDomain + concatChar + "assets/
|
|
2254
|
+
return "" + assetsDomain + concatChar + "assets/" + libName + "/";
|
|
2236
2255
|
};
|
|
2237
|
-
PepFileService.prototype.getAssetsTranslationsSuffix = function () {
|
|
2238
|
-
|
|
2256
|
+
PepFileService.prototype.getAssetsTranslationsSuffix = function (libName) {
|
|
2257
|
+
if (libName === void 0) { libName = 'ngx-lib'; }
|
|
2258
|
+
return "." + libName + ".json";
|
|
2239
2259
|
};
|
|
2240
|
-
PepFileService.prototype.getAssetsTranslationsPath = function (assetsDomain) {
|
|
2260
|
+
PepFileService.prototype.getAssetsTranslationsPath = function (assetsDomain, libName) {
|
|
2241
2261
|
if (assetsDomain === void 0) { assetsDomain = ''; }
|
|
2242
|
-
|
|
2262
|
+
if (libName === void 0) { libName = 'ngx-lib'; }
|
|
2263
|
+
return this.getAssetsPath(assetsDomain, libName) + "i18n/";
|
|
2243
2264
|
};
|
|
2244
|
-
PepFileService.prototype.getAssetsImagesPath = function (assetsDomain, image) {
|
|
2265
|
+
PepFileService.prototype.getAssetsImagesPath = function (assetsDomain, image, libName) {
|
|
2245
2266
|
if (assetsDomain === void 0) { assetsDomain = ''; }
|
|
2246
2267
|
if (image === void 0) { image = ''; }
|
|
2247
|
-
|
|
2268
|
+
if (libName === void 0) { libName = 'ngx-lib'; }
|
|
2269
|
+
return this.getAssetsPath(assetsDomain, libName) + "images/" + image;
|
|
2248
2270
|
};
|
|
2249
2271
|
PepFileService.prototype.getSvgAsImageSrc = function (svg) {
|
|
2250
2272
|
var blob = new Blob([svg], { type: 'image/svg+xml' });
|
|
@@ -2678,11 +2700,12 @@
|
|
|
2678
2700
|
_this.loaderService.hide();
|
|
2679
2701
|
});
|
|
2680
2702
|
};
|
|
2681
|
-
PepAddonService.prototype.getNgxLibTranslationResource = function (subAddonUUID) {
|
|
2703
|
+
PepAddonService.prototype.getNgxLibTranslationResource = function (subAddonUUID, libName) {
|
|
2682
2704
|
if (subAddonUUID === void 0) { subAddonUUID = ''; }
|
|
2705
|
+
if (libName === void 0) { libName = 'ngx-lib'; }
|
|
2683
2706
|
var addonStaticFolder = this.getAddonStaticFolder(subAddonUUID);
|
|
2684
|
-
var translationsPath = this.fileService.getAssetsTranslationsPath(addonStaticFolder);
|
|
2685
|
-
var translationsSuffix = this.fileService.getAssetsTranslationsSuffix();
|
|
2707
|
+
var translationsPath = this.fileService.getAssetsTranslationsPath(addonStaticFolder, libName);
|
|
2708
|
+
var translationsSuffix = this.fileService.getAssetsTranslationsSuffix(libName);
|
|
2686
2709
|
return {
|
|
2687
2710
|
prefix: translationsPath,
|
|
2688
2711
|
suffix: translationsSuffix,
|
|
@@ -2701,6 +2724,7 @@
|
|
|
2701
2724
|
if (urlLangParam === void 0) { urlLangParam = 'userLang'; }
|
|
2702
2725
|
this.translateService.setDefaultTranslateLang(translate, urlLangParam);
|
|
2703
2726
|
};
|
|
2727
|
+
// Deprecated need to delete in next major.
|
|
2704
2728
|
PepAddonService.createDefaultMultiTranslateLoader = function (http, fileService, addonService, subAddonUUID) {
|
|
2705
2729
|
if (subAddonUUID === void 0) { subAddonUUID = ''; }
|
|
2706
2730
|
var ngxLibTranslationResource = addonService.getNgxLibTranslationResource(subAddonUUID);
|
|
@@ -2710,6 +2734,21 @@
|
|
|
2710
2734
|
addonTranslationResource
|
|
2711
2735
|
]);
|
|
2712
2736
|
};
|
|
2737
|
+
PepAddonService.createMultiTranslateLoader = function (addonService, libsName, subAddonUUID) {
|
|
2738
|
+
if (libsName === void 0) { libsName = ['ngx-lib']; }
|
|
2739
|
+
if (subAddonUUID === void 0) { subAddonUUID = ''; }
|
|
2740
|
+
var ngxLibTranslationResources = [];
|
|
2741
|
+
if ((libsName === null || libsName === void 0 ? void 0 : libsName.length) > 0) {
|
|
2742
|
+
for (var index = 0; index < libsName.length; index++) {
|
|
2743
|
+
var libName = libsName[index];
|
|
2744
|
+
ngxLibTranslationResources.push(addonService.getNgxLibTranslationResource(subAddonUUID, libName));
|
|
2745
|
+
}
|
|
2746
|
+
}
|
|
2747
|
+
var addonTranslationResource = addonService.getAddonTranslationResource(subAddonUUID);
|
|
2748
|
+
return addonService.translateService.createMultiTranslateLoader(__spreadArray(__spreadArray([], __read(ngxLibTranslationResources)), [
|
|
2749
|
+
addonTranslationResource
|
|
2750
|
+
]));
|
|
2751
|
+
};
|
|
2713
2752
|
return PepAddonService;
|
|
2714
2753
|
}());
|
|
2715
2754
|
PepAddonService.ɵprov = i0__namespace.ɵɵdefineInjectable({ factory: function PepAddonService_Factory() { return new PepAddonService(i0__namespace.ɵɵinject(PepSessionService), i0__namespace.ɵɵinject(PepHttpService), i0__namespace.ɵɵinject(PepLoaderService), i0__namespace.ɵɵinject(PepTranslateService), i0__namespace.ɵɵinject(PepFileService)); }, token: PepAddonService, providedIn: "root" });
|