@pepperi-addons/ngx-lib 0.4.0-angular14.21 → 0.4.0-angular14.24

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.
@@ -2357,7 +2357,7 @@ class PepAddonService {
2357
2357
  this.fileService = fileService;
2358
2358
  this.route = route;
2359
2359
  this.PAGES_ADDON_UUID = '50062e0c-9967-4ed4-9102-f2bc50602d41';
2360
- this.ADDON_ASSETS_PATH_KEY = 'AddonAssetsPath';
2360
+ // private readonly ADDON_ASSETS_PATH_KEY = 'AddonAssetsPath';
2361
2361
  this.ADDONS_DICTIONARY_ASSETS_PATH_KEY = 'AddonsDictionaryAssetsPath';
2362
2362
  this.ADDON_API_RELATIVE_PATH = '/addons/api';
2363
2363
  this.ADDON_API_ASYNC_RELATIVE_PATH = `${this.ADDON_API_RELATIVE_PATH}/async`;
@@ -2371,24 +2371,22 @@ class PepAddonService {
2371
2371
  ? this.ADDON_API_ASYNC_RELATIVE_PATH
2372
2372
  : this.ADDON_API_RELATIVE_PATH;
2373
2373
  }
2374
- getAddonStaticFolder(subAddonUUID = '') {
2375
- if (subAddonUUID.length > 0) {
2376
- const addonsDictionary = this.sessionService.getObject(this.ADDONS_DICTIONARY_ASSETS_PATH_KEY);
2377
- return addonsDictionary && addonsDictionary[subAddonUUID] ? addonsDictionary[subAddonUUID] : '';
2378
- }
2379
- else {
2380
- return this.sessionService.getObject(this.ADDON_ASSETS_PATH_KEY) || '';
2381
- }
2382
- }
2383
- setAddonStaticFolder(path, subAddonUUID = '') {
2384
- if (subAddonUUID.length > 0) {
2385
- const addonsDictionary = this.sessionService.getObject(this.ADDONS_DICTIONARY_ASSETS_PATH_KEY) ?? {};
2386
- addonsDictionary[subAddonUUID] = path;
2387
- this.sessionService.setObject(this.ADDONS_DICTIONARY_ASSETS_PATH_KEY, addonsDictionary);
2388
- }
2389
- else {
2390
- return this.sessionService.setObject(this.ADDON_ASSETS_PATH_KEY, path);
2391
- }
2374
+ getAddonStaticFolder(addonUUID) {
2375
+ // if (addonUUID.length > 0) {
2376
+ const addonsDictionary = this.sessionService.getObject(this.ADDONS_DICTIONARY_ASSETS_PATH_KEY);
2377
+ return addonsDictionary && addonsDictionary[addonUUID] ? addonsDictionary[addonUUID] : '';
2378
+ // } else {
2379
+ // return this.sessionService.getObject(this.ADDON_ASSETS_PATH_KEY) || '';
2380
+ // }
2381
+ }
2382
+ setAddonStaticFolder(path, addonUUID) {
2383
+ // if (addonUUID.length > 0) {
2384
+ const addonsDictionary = this.sessionService.getObject(this.ADDONS_DICTIONARY_ASSETS_PATH_KEY) ?? {};
2385
+ addonsDictionary[addonUUID] = path;
2386
+ this.sessionService.setObject(this.ADDONS_DICTIONARY_ASSETS_PATH_KEY, addonsDictionary);
2387
+ // } else {
2388
+ // return this.sessionService.setObject(this.ADDON_ASSETS_PATH_KEY, path);
2389
+ // }
2392
2390
  }
2393
2391
  getServerBaseUrl(addonUUID, fileName = '', isAsync = false, localhostPort = 4500) {
2394
2392
  const fileToAdd = fileName.length > 0 ? `/${fileName}` : '';
@@ -2429,8 +2427,8 @@ class PepAddonService {
2429
2427
  this.loaderService.hide();
2430
2428
  });
2431
2429
  }
2432
- getNgxLibTranslationResource(subAddonUUID = '', libName = 'ngx-lib') {
2433
- const addonStaticFolder = this.getAddonStaticFolder(subAddonUUID);
2430
+ getNgxLibTranslationResource(addonUUID, libName = 'ngx-lib') {
2431
+ const addonStaticFolder = this.getAddonStaticFolder(addonUUID);
2434
2432
  const translationsPath = this.fileService.getAssetsTranslationsPath(addonStaticFolder, libName);
2435
2433
  const translationsSuffix = this.fileService.getAssetsTranslationsSuffix(libName);
2436
2434
  return {
@@ -2438,8 +2436,8 @@ class PepAddonService {
2438
2436
  suffix: translationsSuffix,
2439
2437
  };
2440
2438
  }
2441
- getAddonTranslationResource(subAddonUUID = '') {
2442
- const addonStaticFolder = this.getAddonStaticFolder(subAddonUUID);
2439
+ getAddonTranslationResource(addonUUID) {
2440
+ const addonStaticFolder = this.getAddonStaticFolder(addonUUID);
2443
2441
  const defaultSubFolder = 'assets/i18n/';
2444
2442
  return {
2445
2443
  prefix: addonStaticFolder.length > 0 ? `${addonStaticFolder}${defaultSubFolder}` : `/${defaultSubFolder}`,
@@ -2452,24 +2450,29 @@ class PepAddonService {
2452
2450
  getPagesAddonUUID() {
2453
2451
  return this.PAGES_ADDON_UUID;
2454
2452
  }
2455
- // Deprecated need to delete in next major.
2456
- static createDefaultMultiTranslateLoader(http, fileService, addonService, subAddonUUID = '') {
2457
- const ngxLibTranslationResource = addonService.getNgxLibTranslationResource(subAddonUUID);
2458
- const addonTranslationResource = addonService.getAddonTranslationResource(subAddonUUID);
2459
- return addonService.translateService.createMultiTranslateLoader([
2460
- ngxLibTranslationResource,
2461
- addonTranslationResource
2462
- ]);
2463
- }
2464
- static createMultiTranslateLoader(addonService, libsName = ['ngx-lib'], subAddonUUID = '') {
2453
+ // // Deprecated need to delete in next major.
2454
+ // public static createDefaultMultiTranslateLoader(
2455
+ // http: HttpClient,
2456
+ // fileService: PepFileService,
2457
+ // addonService: PepAddonService,
2458
+ // addonUUID = ''
2459
+ // ) {
2460
+ // const ngxLibTranslationResource = addonService.getNgxLibTranslationResource(addonUUID);
2461
+ // const addonTranslationResource = addonService.getAddonTranslationResource(addonUUID);
2462
+ // return addonService.translateService.createMultiTranslateLoader([
2463
+ // ngxLibTranslationResource,
2464
+ // addonTranslationResource
2465
+ // ]);
2466
+ // }
2467
+ static createMultiTranslateLoader(addonUUID, addonService, libsName = ['ngx-lib']) {
2465
2468
  const ngxLibTranslationResources = [];
2466
2469
  if (libsName?.length > 0) {
2467
2470
  for (let index = 0; index < libsName.length; index++) {
2468
2471
  const libName = libsName[index];
2469
- ngxLibTranslationResources.push(addonService.getNgxLibTranslationResource(subAddonUUID, libName));
2472
+ ngxLibTranslationResources.push(addonService.getNgxLibTranslationResource(addonUUID, libName));
2470
2473
  }
2471
2474
  }
2472
- const addonTranslationResource = addonService.getAddonTranslationResource(subAddonUUID);
2475
+ const addonTranslationResource = addonService.getAddonTranslationResource(addonUUID);
2473
2476
  return addonService.translateService.createMultiTranslateLoader([
2474
2477
  ...ngxLibTranslationResources,
2475
2478
  addonTranslationResource