@pepperi-addons/ngx-lib 0.2.53 → 0.2.57-beta.1

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.
Files changed (39) hide show
  1. package/bundles/pepperi-addons-ngx-lib-date.umd.js +1 -1
  2. package/bundles/pepperi-addons-ngx-lib-form.umd.js +2 -0
  3. package/bundles/pepperi-addons-ngx-lib-form.umd.js.map +1 -1
  4. package/bundles/pepperi-addons-ngx-lib-image.umd.js.map +1 -1
  5. package/bundles/pepperi-addons-ngx-lib-list.umd.js +5 -3
  6. package/bundles/pepperi-addons-ngx-lib-list.umd.js.map +1 -1
  7. package/bundles/pepperi-addons-ngx-lib-slider.umd.js +1 -1
  8. package/bundles/pepperi-addons-ngx-lib-slider.umd.js.map +1 -1
  9. package/bundles/pepperi-addons-ngx-lib-top-bar.umd.js +1 -1
  10. package/bundles/pepperi-addons-ngx-lib.umd.js +301 -254
  11. package/bundles/pepperi-addons-ngx-lib.umd.js.map +1 -1
  12. package/core/common/services/addon.service.d.ts +8 -3
  13. package/core/common/services/public-api.d.ts +1 -0
  14. package/core/common/services/translate.service.d.ts +9 -0
  15. package/esm2015/core/common/services/addon.service.js +36 -34
  16. package/esm2015/core/common/services/public-api.js +2 -1
  17. package/esm2015/core/common/services/translate.service.js +48 -0
  18. package/esm2015/form/form.component.js +2 -1
  19. package/esm2015/form/internal-carusel.component.js +2 -1
  20. package/esm2015/image/image.service.js +1 -1
  21. package/esm2015/list/list-total.component.js +5 -3
  22. package/esm2015/slider/slider.component.js +2 -2
  23. package/esm2015/top-bar/top-bar.component.js +1 -1
  24. package/fesm2015/pepperi-addons-ngx-lib-form.js +2 -0
  25. package/fesm2015/pepperi-addons-ngx-lib-form.js.map +1 -1
  26. package/fesm2015/pepperi-addons-ngx-lib-image.js.map +1 -1
  27. package/fesm2015/pepperi-addons-ngx-lib-list.js +4 -2
  28. package/fesm2015/pepperi-addons-ngx-lib-list.js.map +1 -1
  29. package/fesm2015/pepperi-addons-ngx-lib-slider.js +1 -1
  30. package/fesm2015/pepperi-addons-ngx-lib-slider.js.map +1 -1
  31. package/fesm2015/pepperi-addons-ngx-lib-top-bar.js +1 -1
  32. package/fesm2015/pepperi-addons-ngx-lib.js +285 -243
  33. package/fesm2015/pepperi-addons-ngx-lib.js.map +1 -1
  34. package/list/list-total.component.d.ts +2 -0
  35. package/list/pepperi-addons-ngx-lib-list.metadata.json +1 -1
  36. package/package.json +4 -4
  37. package/pepperi-addons-ngx-lib.metadata.json +1 -1
  38. package/slider/slider.component.d.ts +4 -4
  39. package/top-bar/pepperi-addons-ngx-lib-top-bar.metadata.json +1 -1
@@ -25,7 +25,7 @@ class PepSliderComponent {
25
25
  this.step = 1;
26
26
  this.minValue = NaN;
27
27
  this.maxValue = NaN;
28
- this._value = null;
28
+ this._value = NaN;
29
29
  this.valueChange = new EventEmitter();
30
30
  this.inputChange = new EventEmitter();
31
31
  this.xAlignment = DEFAULT_HORIZONTAL_ALIGNMENT;
@@ -1 +1 @@
1
- {"version":3,"file":"pepperi-addons-ngx-lib-slider.js","sources":["../../../projects/ngx-lib/slider/slider.component.ts","../../../projects/ngx-lib/slider/slider.module.ts","../../../projects/ngx-lib/slider/public-api.ts","../../../projects/ngx-lib/slider/pepperi-addons-ngx-lib-slider.ts"],"sourcesContent":["import {\n Component,\n OnDestroy,\n Input,\n Output,\n EventEmitter,\n Renderer2,\n ElementRef,\n OnInit,\n ViewChild,\n} from '@angular/core';\nimport { PepLayoutService, DEFAULT_HORIZONTAL_ALIGNMENT, PepHorizontalAlignment } from '@pepperi-addons/ngx-lib';\n\n/**\n * This is a slider component that support pepperi theme\n * style & state & sizes\n *\n * @export\n * @class PepSliderComponent\n * @implements {OnDestroy}\n */\n@Component({\n selector: 'pep-slider',\n templateUrl: './slider.component.html',\n styleUrls: ['./slider.component.scss'],\n})\nexport class PepSliderComponent implements OnInit {\n @Input() label = '';\n @Input() disabled = false;\n @Input() hint = '';\n\n private _background = '';\n @Input()\n set background(background: string) {\n if (!background) {\n background = '';\n }\n\n this._background = background;\n this.setBackground();\n }\n get background(): string {\n return this._background;\n }\n\n @Input() step = 1;\n @Input() minValue = NaN;\n @Input() maxValue = NaN;\n\n private _value: number | null = null;\n @Input()\n set value(value: number | null) {\n this._value = value;\n }\n get value(): number | null {\n return this._value;\n }\n\n @Output()\n valueChange: EventEmitter<number | null> = new EventEmitter<number | null>();\n\n @Output()\n inputChange: EventEmitter<number | null> = new EventEmitter<number | null>();\n\n xAlignment: PepHorizontalAlignment = DEFAULT_HORIZONTAL_ALIGNMENT;\n sliderWrapper: any = null;\n\n constructor(private renderer: Renderer2, private element: ElementRef, private pepLayoutService: PepLayoutService) { }\n\n private setBackground(): void {\n // Get the wrapper for set the background.\n if (!this.sliderWrapper) {\n this.sliderWrapper = this.element.nativeElement.querySelector('.mat-slider-wrapper');\n }\n\n if (this.sliderWrapper) {\n this.renderer.setStyle(this.sliderWrapper, 'background', this.background?.length > 0 ? this.background : '');\n\n if (this.background?.length > 0) {\n this.renderer.removeClass(this.sliderWrapper, 'background-color-dimmed');\n } else {\n this.renderer.addClass(this.sliderWrapper, 'background-color-dimmed');\n }\n }\n }\n\n ngOnInit(): void {\n this.xAlignment = this.pepLayoutService.isRtl() ? 'right' : 'left';\n this.setBackground();\n }\n\n onValueChange(event) {\n this.valueChange.emit(event.value);\n }\n\n onInputChange(event) {\n this.inputChange.emit(event.value);\n }\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\n\nimport { MatCommonModule } from '@angular/material/core';\nimport { MatSliderModule } from '@angular/material/slider';\nimport { PepFieldTitleModule } from '@pepperi-addons/ngx-lib/field-title';\nimport { PepNgxLibModule } from '@pepperi-addons/ngx-lib';\n\nimport { PepSliderComponent } from './slider.component';\n\n@NgModule({\n imports: [\n CommonModule,\n // Material modules\n MatCommonModule,\n MatSliderModule,\n // ngx-lib modules\n PepNgxLibModule,\n PepFieldTitleModule,\n ],\n exports: [PepSliderComponent],\n declarations: [PepSliderComponent],\n})\nexport class PepSliderModule { }\n","/*\n * Public API Surface of ngx-lib/slider\n */\nexport * from './slider.module';\nexport * from './slider.component';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":"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"}
1
+ {"version":3,"file":"pepperi-addons-ngx-lib-slider.js","sources":["../../../projects/ngx-lib/slider/slider.component.ts","../../../projects/ngx-lib/slider/slider.module.ts","../../../projects/ngx-lib/slider/public-api.ts","../../../projects/ngx-lib/slider/pepperi-addons-ngx-lib-slider.ts"],"sourcesContent":["import {\n Component,\n OnDestroy,\n Input,\n Output,\n EventEmitter,\n Renderer2,\n ElementRef,\n OnInit,\n ViewChild,\n} from '@angular/core';\nimport { PepLayoutService, DEFAULT_HORIZONTAL_ALIGNMENT, PepHorizontalAlignment } from '@pepperi-addons/ngx-lib';\n\n/**\n * This is a slider component that support pepperi theme\n * style & state & sizes\n *\n * @export\n * @class PepSliderComponent\n * @implements {OnDestroy}\n */\n@Component({\n selector: 'pep-slider',\n templateUrl: './slider.component.html',\n styleUrls: ['./slider.component.scss'],\n})\nexport class PepSliderComponent implements OnInit {\n @Input() label = '';\n @Input() disabled = false;\n @Input() hint = '';\n\n private _background = '';\n @Input()\n set background(background: string) {\n if (!background) {\n background = '';\n }\n\n this._background = background;\n this.setBackground();\n }\n get background(): string {\n return this._background;\n }\n\n @Input() step = 1;\n @Input() minValue = NaN;\n @Input() maxValue = NaN;\n\n private _value = NaN;\n @Input()\n set value(value: number) {\n this._value = value;\n }\n get value(): number {\n return this._value;\n }\n\n @Output()\n valueChange: EventEmitter<number> = new EventEmitter<number>();\n\n @Output()\n inputChange: EventEmitter<number> = new EventEmitter<number>();\n\n xAlignment: PepHorizontalAlignment = DEFAULT_HORIZONTAL_ALIGNMENT;\n sliderWrapper: any = null;\n\n constructor(private renderer: Renderer2, private element: ElementRef, private pepLayoutService: PepLayoutService) { }\n\n private setBackground(): void {\n // Get the wrapper for set the background.\n if (!this.sliderWrapper) {\n this.sliderWrapper = this.element.nativeElement.querySelector('.mat-slider-wrapper');\n }\n\n if (this.sliderWrapper) {\n this.renderer.setStyle(this.sliderWrapper, 'background', this.background?.length > 0 ? this.background : '');\n\n if (this.background?.length > 0) {\n this.renderer.removeClass(this.sliderWrapper, 'background-color-dimmed');\n } else {\n this.renderer.addClass(this.sliderWrapper, 'background-color-dimmed');\n }\n }\n }\n\n ngOnInit(): void {\n this.xAlignment = this.pepLayoutService.isRtl() ? 'right' : 'left';\n this.setBackground();\n }\n\n onValueChange(event) {\n this.valueChange.emit(event.value);\n }\n\n onInputChange(event) {\n this.inputChange.emit(event.value);\n }\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\n\nimport { MatCommonModule } from '@angular/material/core';\nimport { MatSliderModule } from '@angular/material/slider';\nimport { PepFieldTitleModule } from '@pepperi-addons/ngx-lib/field-title';\nimport { PepNgxLibModule } from '@pepperi-addons/ngx-lib';\n\nimport { PepSliderComponent } from './slider.component';\n\n@NgModule({\n imports: [\n CommonModule,\n // Material modules\n MatCommonModule,\n MatSliderModule,\n // ngx-lib modules\n PepNgxLibModule,\n PepFieldTitleModule,\n ],\n exports: [PepSliderComponent],\n declarations: [PepSliderComponent],\n})\nexport class PepSliderModule { }\n","/*\n * Public API Surface of ngx-lib/slider\n */\nexport * from './slider.module';\nexport * from './slider.component';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":"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"}
@@ -81,7 +81,7 @@ PepTopBarComponent.decorators = [
81
81
  { type: Component, args: [{
82
82
  selector: 'pep-top-bar',
83
83
  template: "<div pepRtlDirection [hidden]=\"isHidden\" class=\"pep-top-bar-container\" [ngClass]=\"{ inline: inline }\">\n <div class=\"header-content\">\n <div class=\"main-layout\">\n <div class=\"content pep-border-bottom\">\n <div class=\"left-container pep-spacing-element-negative\">\n <ng-container *ngTemplateOutlet=\"listActionsTemplate\"></ng-container>\n <ng-container *ngTemplateOutlet=\"titleTemplate\"></ng-container>\n <ng-container *ngTemplateOutlet=\"listChooserTemplate\"></ng-container>\n <ng-container *ngTemplateOutlet=\"leftContentTemplate\"></ng-container>\n <ng-container *ngTemplateOutlet=\"listTotalTemplate\"></ng-container>\n </div>\n <div class=\"pep-spacing-element\"></div>\n <div class=\"right-container pep-spacing-element-negative\">\n <ng-container *ngTemplateOutlet=\"searchTemplate\"></ng-container>\n <ng-container *ngTemplateOutlet=\"sortingTemplate\"></ng-container>\n <ng-container *ngTemplateOutlet=\"viewsTemplate\"></ng-container>\n <ng-container *ngTemplateOutlet=\"rightContentTemplate\"></ng-container>\n </div>\n </div>\n </div>\n </div>\n\n <!-- hasFooterContent === null is for the first load to see if there is data in the (footer-start-content || footer-end-content). -->\n <div *ngIf=\"hasFooterContent === null || (hasFooterContent && footerState === 'visible')\" class=\"footer\"\n [style.height.rem]=\"customizationService.footerHeight\">\n <div class=\"content pep-border-top\">\n <div #footerStartContent class=\"left-container pep-spacing-element-negative flex-wrapper\">\n <ng-content select=\"[footer-start-content]\"></ng-content>\n </div>\n <div #footerEndContent class=\"right-container pep-spacing-element-negative flex-wrapper\">\n <ng-content select=\"[footer-end-content]\"></ng-content>\n </div>\n </div>\n <!-- <ng-container *ngIf=\"showFooter && screenSize >= PepScreenSizeType.MD; then footerBlock; else noFooterBlock\">\n </ng-container>\n <ng-template #footerBlock>\n {{ customizationService.showFooter() }}\n </ng-template>\n <ng-template #noFooterBlock>\n {{ customizationService.hideFooter() }}\n </ng-template> -->\n </div>\n\n</div>\n\n<!-- Left side templates -->\n<ng-template #listActionsTemplate>\n <div class=\"list-actions-wrapper\">\n <ng-content *ngIf=\"!searchIsOpenAndSmallDevice\" select=\"pep-list-actions\"></ng-content>\n </div>\n</ng-template>\n\n<ng-template #titleTemplate>\n <div *ngIf=\"title?.length > 0\" class=\"pep-spacing-element title {{ inline ? 'title-md' : 'title-lg' }}\">\n <span [title]=\"title\">{{ title }}</span>\n </div>\n</ng-template>\n\n<ng-template #listChooserTemplate>\n <div *ngIf=\"!searchIsOpenAndSmallDevice\" [ngClass]=\"{ 'pep-spacing-element': listChooserComp }\">\n <ng-content select=\"pep-list-chooser\"></ng-content>\n </div>\n</ng-template>\n\n<ng-template #leftContentTemplate>\n <div *ngIf=\"!searchIsOpenAndSmallDevice\" class=\"flex-wrapper\">\n <ng-content select=\"[header-start-content]\"></ng-content>\n </div>\n</ng-template>\n\n<ng-template #listTotalTemplate>\n <div *ngIf=\"!searchIsOpenAndSmallDevice\" [ngClass]=\"{ 'pep-spacing-element': listTotalComp }\">\n <ng-content select=\"pep-list-total\"></ng-content>\n </div>\n</ng-template>\n\n<!-- Right side templates -->\n<ng-template #searchTemplate>\n <div [ngClass]=\"{ 'pep-spacing-element': searchComp }\">\n <ng-content select=\"pep-search\"></ng-content>\n </div>\n</ng-template>\n\n<ng-template #sortingTemplate>\n <div *ngIf=\"!searchIsOpenAndSmallDevice\" [ngClass]=\"{ 'pep-spacing-element': listSortingComp }\">\n <ng-content select=\"pep-list-sorting\"></ng-content>\n </div>\n</ng-template>\n\n<ng-template #viewsTemplate>\n <div *ngIf=\"!searchIsOpenAndSmallDevice\" [ngClass]=\"{ 'pep-spacing-element': listViewsComp }\" class=\"flex-wrapper\">\n <ng-content select=\"pep-list-views\"></ng-content>\n </div>\n</ng-template>\n\n<ng-template #rightContentTemplate>\n <div *ngIf=\"!searchIsOpenAndSmallDevice\" class=\"flex-wrapper\">\n <ng-content select=\"[header-end-content]\"></ng-content>\n </div>\n</ng-template>",
84
- styles: [".pep-top-bar-container{display:grid;height:calc(1.5rem + .5rem + 2.5rem);height:calc(var(--pep-top-bar-spacing-top, 1.5rem) + var(--pep-top-bar-spacing-bottom, .5rem) + var(--pep-top-bar-field-height, 2.5rem));z-index:101}.pep-top-bar-container .title{display:inline-flex!important;align-items:center;justify-content:center}.pep-top-bar-container .header-content{height:calc(.5rem + 2.5rem);height:calc(var(--pep-top-bar-spacing-bottom, .5rem) + var(--pep-top-bar-field-height, 2.5rem));margin-top:1.5rem;margin-top:var(--pep-top-bar-spacing-top,1.5rem)}.pep-top-bar-container .header-content .main-layout{width:inherit;height:inherit;padding:0}.pep-top-bar-container .header-content .main-layout .content{display:flex;justify-content:space-between;height:inherit}.pep-top-bar-container .header-content .main-layout .content .left-container,.pep-top-bar-container .header-content .main-layout .content .right-container{height:inherit}.pep-top-bar-container .footer{position:fixed;bottom:0;left:0;right:0;height:4.5rem;height:var(--pep-footer-bar-height,4.5rem)}.pep-top-bar-container .footer .content{display:flex;justify-content:space-between;margin-inline:calc(1rem * 2);margin-inline:calc(var(--pep-spacing-lg, 1rem) * 2);padding-top:.75rem;padding-top:var(--pep-footer-bar-spacing-top,.75rem)}@media (max-width:599px){.pep-top-bar-container .footer .content{margin-inline:1rem;margin-inline:var(--pep-spacing-lg,1rem)}}.pep-top-bar-container .left-container{display:flex}.pep-top-bar-container .right-container{display:flex;justify-content:flex-end}.pep-top-bar-container .flex-wrapper ::ng-deep>*{display:flex}.pep-top-bar-container .list-actions-wrapper ::ng-deep.pep-button{margin-right:.25rem;margin-right:var(--pep-spacing-xs,.25rem);margin-left:.25rem;margin-left:var(--pep-spacing-xs,.25rem)}.pep-top-bar-container:not(.inline) .pep-button,.pep-top-bar-container:not(.inline) .pepperi-button,.pep-top-bar-container:not(.inline) ::ng-deep .pep-button,.pep-top-bar-container:not(.inline) ::ng-deep .pepperi-button{height:2.5rem;height:var(--pep-top-bar-field-height,2.5rem);line-height:2.5rem;line-height:var(--pep-top-bar-field-height,2.5rem)}.pep-top-bar-container.inline{position:inherit;height:calc(.5rem + 2.5rem);height:calc(var(--pep-top-bar-spacing-bottom, .5rem) + var(--pep-top-bar-field-height, 2.5rem));width:100%}.pep-top-bar-container.inline .header-content{margin-top:0;height:2.5rem;height:var(--pep-top-bar-field-height,2.5rem);padding:0;position:inherit;width:inherit}.pep-top-bar-container.inline .header-content .main-layout{width:inherit;height:inherit;padding:0}.pep-top-bar-container.inline .header-content .main-layout .content{height:inherit;margin:0}"]
84
+ styles: [".pep-top-bar-container{display:grid;height:calc(1.5rem + .5rem + 2.5rem);height:calc(var(--pep-top-bar-spacing-top, 1.5rem) + var(--pep-top-bar-spacing-bottom, .5rem) + var(--pep-top-bar-field-height, 2.5rem));z-index:101}.pep-top-bar-container .title{display:inline-flex!important;align-items:center;justify-content:center}.pep-top-bar-container .header-content{height:calc(.5rem + 2.5rem);height:calc(var(--pep-top-bar-spacing-bottom, .5rem) + var(--pep-top-bar-field-height, 2.5rem));margin-top:1.5rem;margin-top:var(--pep-top-bar-spacing-top,1.5rem)}.pep-top-bar-container .header-content .main-layout{width:inherit;height:inherit;padding:0}.pep-top-bar-container .header-content .main-layout .content{display:flex;justify-content:space-between;height:inherit}.pep-top-bar-container .header-content .main-layout .content .left-container,.pep-top-bar-container .header-content .main-layout .content .right-container{height:inherit}.pep-top-bar-container .footer{position:fixed;bottom:0;left:0;right:0;height:4.5rem;height:var(--pep-footer-bar-height,4.5rem)}.pep-top-bar-container .footer .content{display:flex;justify-content:space-between;margin-inline:calc(1rem * 2);margin-inline:calc(var(--pep-spacing-lg, 1rem) * 2);padding-top:.75rem;padding-top:var(--pep-footer-bar-spacing-top,.75rem)}@media (max-width:599px){.pep-top-bar-container .footer .content{margin-inline:1rem;margin-inline:var(--pep-spacing-lg,1rem)}}.pep-top-bar-container .left-container{display:flex;align-items:center}.pep-top-bar-container .right-container{display:flex;justify-content:flex-end;align-items:center}.pep-top-bar-container .flex-wrapper ::ng-deep>*{display:flex}.pep-top-bar-container .list-actions-wrapper ::ng-deep.pep-button{margin-right:.25rem;margin-right:var(--pep-spacing-xs,.25rem);margin-left:.25rem;margin-left:var(--pep-spacing-xs,.25rem)}.pep-top-bar-container:not(.inline) .pep-button,.pep-top-bar-container:not(.inline) .pepperi-button,.pep-top-bar-container:not(.inline) ::ng-deep .pep-button,.pep-top-bar-container:not(.inline) ::ng-deep .pepperi-button{height:2.5rem;height:var(--pep-top-bar-field-height,2.5rem);line-height:2.5rem;line-height:var(--pep-top-bar-field-height,2.5rem)}.pep-top-bar-container.inline{position:inherit;height:calc(.5rem + 2.5rem);height:calc(var(--pep-top-bar-spacing-bottom, .5rem) + var(--pep-top-bar-field-height, 2.5rem));width:100%}.pep-top-bar-container.inline .header-content{margin-top:0;height:2.5rem;height:var(--pep-top-bar-field-height,2.5rem);padding:0;position:inherit;width:inherit}.pep-top-bar-container.inline .header-content .main-layout{width:inherit;height:inherit;padding:0}.pep-top-bar-container.inline .header-content .main-layout .content{height:inherit;margin:0}"]
85
85
  },] }
86
86
  ];
87
87
  PepTopBarComponent.ctorParameters = () => [
@@ -1593,6 +1593,216 @@ PepSessionService.ctorParameters = () => [
1593
1593
  { type: PepJwtHelperService }
1594
1594
  ];
1595
1595
 
1596
+ class PepFileService {
1597
+ constructor() {
1598
+ this.scripts = new Map();
1599
+ this.styles = new Map();
1600
+ }
1601
+ loadFiles(files) {
1602
+ const promises = [];
1603
+ files.forEach((file) => {
1604
+ if (file.type === 'style') {
1605
+ promises.push(this.loadStyle(file.path));
1606
+ }
1607
+ else if (file.type === 'script') {
1608
+ promises.push(this.loadScript(file.path));
1609
+ }
1610
+ });
1611
+ return Promise.all(promises);
1612
+ }
1613
+ removeFiles(files) {
1614
+ for (let index = 0; index < files.length &&
1615
+ files[index].path &&
1616
+ files[index].path.trim() !== ''; index++) {
1617
+ const name = this.getFileName(files[index].path, true);
1618
+ const element = document.getElementById(name);
1619
+ element.parentNode.removeChild(element);
1620
+ if (files[index].type === 'script' && this.scripts.has(name)) {
1621
+ this.scripts.delete(name);
1622
+ }
1623
+ else if (files[index].type === 'style' && this.styles.has(name)) {
1624
+ this.styles.delete(name);
1625
+ }
1626
+ }
1627
+ }
1628
+ loadScript(path) {
1629
+ return new Promise((resolve, reject) => {
1630
+ const name = this.getFileName(path, true);
1631
+ // If the script isn't exist add it.
1632
+ if (!this.scripts.has(name)) {
1633
+ this.scripts.set(name, { loaded: false, src: path });
1634
+ }
1635
+ const scriptItem = this.scripts.get(name);
1636
+ // Resolve if already loaded
1637
+ if (scriptItem.loaded) {
1638
+ resolve({
1639
+ script: name,
1640
+ loaded: true,
1641
+ status: 'Already Loaded',
1642
+ });
1643
+ }
1644
+ else {
1645
+ // Load script
1646
+ const script = document.createElement('script');
1647
+ script.type = 'text/javascript';
1648
+ script.src = scriptItem.src;
1649
+ script.setAttribute('id', name);
1650
+ script.async = false;
1651
+ if (script.readyState) {
1652
+ // IE
1653
+ script.onreadystatechange = () => {
1654
+ if (script.readyState === 'loaded' ||
1655
+ script.readyState === 'complete') {
1656
+ script.onreadystatechange = null;
1657
+ scriptItem.loaded = true;
1658
+ resolve({
1659
+ path,
1660
+ type: 'script',
1661
+ loaded: true,
1662
+ status: 'Loaded',
1663
+ });
1664
+ }
1665
+ };
1666
+ }
1667
+ else {
1668
+ // Others
1669
+ script.onload = () => {
1670
+ scriptItem.loaded = true;
1671
+ resolve({
1672
+ path,
1673
+ type: 'script',
1674
+ loaded: true,
1675
+ status: 'Loaded',
1676
+ });
1677
+ };
1678
+ }
1679
+ script.onerror = (error) => resolve({
1680
+ path,
1681
+ type: 'script',
1682
+ loaded: false,
1683
+ status: 'Loaded',
1684
+ });
1685
+ document.getElementsByTagName('head')[0].appendChild(script);
1686
+ }
1687
+ });
1688
+ }
1689
+ loadStyle(path) {
1690
+ return new Promise((resolve, reject) => {
1691
+ const name = this.getFileName(path, true);
1692
+ // If the style isn't exist add it.
1693
+ if (!this.styles.has(name)) {
1694
+ this.styles.set(name, { loaded: false, src: path });
1695
+ }
1696
+ const styleItem = this.styles.get(name);
1697
+ // Resolve if already loaded
1698
+ if (styleItem.loaded) {
1699
+ resolve({
1700
+ path,
1701
+ type: 'style',
1702
+ loaded: true,
1703
+ status: 'Already Loaded',
1704
+ });
1705
+ }
1706
+ else {
1707
+ // Load style
1708
+ const style = document.createElement('link');
1709
+ style.type = 'text/css';
1710
+ style.rel = 'stylesheet';
1711
+ style.href = styleItem.src;
1712
+ style.media = 'all';
1713
+ style.setAttribute('id', name);
1714
+ styleItem.loaded = true;
1715
+ resolve({
1716
+ path,
1717
+ type: 'style',
1718
+ loaded: true,
1719
+ status: 'Loaded',
1720
+ });
1721
+ document.getElementsByTagName('head')[0].appendChild(style);
1722
+ }
1723
+ });
1724
+ }
1725
+ loadFontStyle(styleId, href) {
1726
+ const head = document.getElementsByTagName('head')[0];
1727
+ const styleElement = document.getElementById(styleId);
1728
+ if (styleElement) {
1729
+ styleElement.href = href;
1730
+ }
1731
+ else {
1732
+ const style = document.createElement('link');
1733
+ style.id = styleId;
1734
+ style.rel = 'stylesheet';
1735
+ style.href = `${href}`;
1736
+ head.appendChild(style);
1737
+ }
1738
+ }
1739
+ getFileName(filePath, withExtenstion = false) {
1740
+ const lastIndex = withExtenstion
1741
+ ? filePath.length - 1
1742
+ : filePath.lastIndexOf('.');
1743
+ return filePath.substr(filePath.lastIndexOf('/') + 1, lastIndex);
1744
+ }
1745
+ getFileExtension(filePath) {
1746
+ const fileSplit = filePath.split('.');
1747
+ let fileExt = '';
1748
+ if (fileSplit.length > 1) {
1749
+ fileExt = fileSplit[fileSplit.length - 2];
1750
+ }
1751
+ return fileExt;
1752
+ }
1753
+ /* Returns true if url is valid */
1754
+ isValidUrl(url) {
1755
+ /* Try creating a valid URL */
1756
+ try {
1757
+ const tmp = new URL(url);
1758
+ return true;
1759
+ }
1760
+ catch (e) {
1761
+ return false;
1762
+ }
1763
+ }
1764
+ convertFromb64toBlob(b64Data, contentType = '', sliceSize = 512) {
1765
+ const byteCharacters = atob(b64Data);
1766
+ const byteArrays = [];
1767
+ for (let offset = 0; offset < byteCharacters.length; offset += sliceSize) {
1768
+ const slice = byteCharacters.slice(offset, offset + sliceSize);
1769
+ const byteNumbers = new Array(slice.length);
1770
+ for (let i = 0; i < slice.length; i++) {
1771
+ byteNumbers[i] = slice.charCodeAt(i);
1772
+ }
1773
+ const byteArray = new Uint8Array(byteNumbers);
1774
+ byteArrays.push(byteArray);
1775
+ }
1776
+ const blob = new Blob(byteArrays, { type: contentType });
1777
+ return blob;
1778
+ }
1779
+ getAssetsPath(assetsDomain = '') {
1780
+ const concatChar = assetsDomain === '' || assetsDomain.endsWith('/') ? '' : '/';
1781
+ return `${assetsDomain}${concatChar}assets/ngx-lib/`;
1782
+ }
1783
+ getAssetsTranslationsSuffix() {
1784
+ return '.ngx-lib.json';
1785
+ }
1786
+ getAssetsTranslationsPath(assetsDomain = '') {
1787
+ return `${this.getAssetsPath(assetsDomain)}i18n/`;
1788
+ }
1789
+ getAssetsImagesPath(assetsDomain = '', image = '') {
1790
+ return `${this.getAssetsPath(assetsDomain)}images/${image}`;
1791
+ }
1792
+ getSvgAsImageSrc(svg) {
1793
+ const blob = new Blob([svg], { type: 'image/svg+xml' });
1794
+ const url = URL.createObjectURL(blob);
1795
+ return url;
1796
+ }
1797
+ }
1798
+ PepFileService.ɵprov = i0.ɵɵdefineInjectable({ factory: function PepFileService_Factory() { return new PepFileService(); }, token: PepFileService, providedIn: "root" });
1799
+ PepFileService.decorators = [
1800
+ { type: Injectable, args: [{
1801
+ providedIn: 'root',
1802
+ },] }
1803
+ ];
1804
+ PepFileService.ctorParameters = () => [];
1805
+
1596
1806
  class PepCookieService {
1597
1807
  constructor(document, platformId) {
1598
1808
  this.document = document;
@@ -1888,14 +2098,59 @@ PepHttpService.ctorParameters = () => [
1888
2098
  { type: HttpClient }
1889
2099
  ];
1890
2100
 
2101
+ /*
2102
+ This service is the webapp api for addon usege.
2103
+ */
2104
+ class PepTranslateService {
2105
+ constructor(http
2106
+ // private sessionService: PepSessionService,
2107
+ // private httpService: PepHttpService,
2108
+ // private loaderService: PepLoaderService
2109
+ ) {
2110
+ this.http = http;
2111
+ //
2112
+ }
2113
+ createMultiTranslateLoader(resources) {
2114
+ return new MultiTranslateHttpLoader(this.http, resources);
2115
+ }
2116
+ setDefaultTranslateLang(translate, urlLangParam = 'userLang') {
2117
+ let userLang = 'en';
2118
+ translate.setDefaultLang(userLang);
2119
+ userLang = translate.getBrowserLang().split('-')[0]; // use navigator lang if available
2120
+ if (urlLangParam.length > 0) {
2121
+ const index = location.href.indexOf(urlLangParam);
2122
+ if (index > -1) {
2123
+ // urlLangParam=XX
2124
+ const startIndex = index + urlLangParam.length + '='.length;
2125
+ userLang = location.href.substring(startIndex, startIndex + 2);
2126
+ }
2127
+ }
2128
+ // the lang to use, if the lang isn't available, it will use the current loader to get them
2129
+ translate.use(userLang).subscribe((res) => {
2130
+ // In here you can put the code you want. At this point the lang will be loaded
2131
+ });
2132
+ }
2133
+ }
2134
+ PepTranslateService.ɵprov = i0.ɵɵdefineInjectable({ factory: function PepTranslateService_Factory() { return new PepTranslateService(i0.ɵɵinject(i3.HttpClient)); }, token: PepTranslateService, providedIn: "root" });
2135
+ PepTranslateService.decorators = [
2136
+ { type: Injectable, args: [{
2137
+ providedIn: 'root',
2138
+ },] }
2139
+ ];
2140
+ PepTranslateService.ctorParameters = () => [
2141
+ { type: HttpClient }
2142
+ ];
2143
+
1891
2144
  /*
1892
2145
  This service is the webapp api for addon usege.
1893
2146
  */
1894
2147
  class PepAddonService {
1895
- constructor(sessionService, httpService, loaderService) {
2148
+ constructor(sessionService, httpService, loaderService, translateService, fileService) {
1896
2149
  this.sessionService = sessionService;
1897
2150
  this.httpService = httpService;
1898
2151
  this.loaderService = loaderService;
2152
+ this.translateService = translateService;
2153
+ this.fileService = fileService;
1899
2154
  this.ADDON_ASSETS_PATH_KEY = 'AddonAssetsPath';
1900
2155
  this.ADDONS_DICTIONARY_ASSETS_PATH_KEY = 'AddonsDictionaryAssetsPath';
1901
2156
  this.ADDON_API_RELATIVE_PATH = '/addons/api';
@@ -1940,41 +2195,36 @@ class PepAddonService {
1940
2195
  this.loaderService.hide();
1941
2196
  });
1942
2197
  }
1943
- static createDefaultMultiTranslateLoader(http, fileService, addonService, subAddonUUID = '') {
1944
- const addonStaticFolder = addonService.getAddonStaticFolder(subAddonUUID);
1945
- const translationsPath = fileService.getAssetsTranslationsPath(addonStaticFolder);
1946
- const translationsSuffix = fileService.getAssetsTranslationsSuffix();
2198
+ getNgxLibTranslationResource(subAddonUUID = '') {
2199
+ const addonStaticFolder = this.getAddonStaticFolder(subAddonUUID);
2200
+ const translationsPath = this.fileService.getAssetsTranslationsPath(addonStaticFolder);
2201
+ const translationsSuffix = this.fileService.getAssetsTranslationsSuffix();
2202
+ return {
2203
+ prefix: translationsPath,
2204
+ suffix: translationsSuffix,
2205
+ };
2206
+ }
2207
+ getAddonTranslationResource(subAddonUUID = '') {
2208
+ const addonStaticFolder = this.getAddonStaticFolder(subAddonUUID);
1947
2209
  const defaultSubFolder = 'assets/i18n/';
1948
- return new MultiTranslateHttpLoader(http, [
1949
- {
1950
- prefix: translationsPath,
1951
- suffix: translationsSuffix,
1952
- },
1953
- {
1954
- prefix: addonStaticFolder.length > 0 ? `${addonStaticFolder}${defaultSubFolder}` : `/${defaultSubFolder}`,
1955
- suffix: '.json',
1956
- },
1957
- ]);
2210
+ return {
2211
+ prefix: addonStaticFolder.length > 0 ? `${addonStaticFolder}${defaultSubFolder}` : `/${defaultSubFolder}`,
2212
+ suffix: '.json',
2213
+ };
1958
2214
  }
1959
2215
  setDefaultTranslateLang(translate, urlLangParam = 'userLang') {
1960
- let userLang = 'en';
1961
- translate.setDefaultLang(userLang);
1962
- userLang = translate.getBrowserLang().split('-')[0]; // use navigator lang if available
1963
- if (urlLangParam.length > 0) {
1964
- const index = location.href.indexOf(urlLangParam);
1965
- if (index > -1) {
1966
- // urlLangParam=XX
1967
- const startIndex = index + urlLangParam.length + '='.length;
1968
- userLang = location.href.substring(startIndex, startIndex + 2);
1969
- }
1970
- }
1971
- // the lang to use, if the lang isn't available, it will use the current loader to get them
1972
- translate.use(userLang).subscribe((res) => {
1973
- // In here you can put the code you want. At this point the lang will be loaded
1974
- });
2216
+ this.translateService.setDefaultTranslateLang(translate, urlLangParam);
2217
+ }
2218
+ static createDefaultMultiTranslateLoader(http, fileService, addonService, subAddonUUID = '') {
2219
+ const ngxLibTranslationResource = addonService.getNgxLibTranslationResource(subAddonUUID);
2220
+ const addonTranslationResource = addonService.getAddonTranslationResource(subAddonUUID);
2221
+ return addonService.translateService.createMultiTranslateLoader([
2222
+ ngxLibTranslationResource,
2223
+ addonTranslationResource
2224
+ ]);
1975
2225
  }
1976
2226
  }
1977
- PepAddonService.ɵprov = i0.ɵɵdefineInjectable({ factory: function PepAddonService_Factory() { return new PepAddonService(i0.ɵɵinject(PepSessionService), i0.ɵɵinject(PepHttpService), i0.ɵɵinject(PepLoaderService)); }, token: PepAddonService, providedIn: "root" });
2227
+ PepAddonService.ɵprov = i0.ɵɵdefineInjectable({ factory: function PepAddonService_Factory() { return new PepAddonService(i0.ɵɵinject(PepSessionService), i0.ɵɵinject(PepHttpService), i0.ɵɵinject(PepLoaderService), i0.ɵɵinject(PepTranslateService), i0.ɵɵinject(PepFileService)); }, token: PepAddonService, providedIn: "root" });
1978
2228
  PepAddonService.decorators = [
1979
2229
  { type: Injectable, args: [{
1980
2230
  providedIn: 'root',
@@ -1983,7 +2233,9 @@ PepAddonService.decorators = [
1983
2233
  PepAddonService.ctorParameters = () => [
1984
2234
  { type: PepSessionService },
1985
2235
  { type: PepHttpService },
1986
- { type: PepLoaderService }
2236
+ { type: PepLoaderService },
2237
+ { type: PepTranslateService },
2238
+ { type: PepFileService }
1987
2239
  ];
1988
2240
 
1989
2241
  class PepColorService {
@@ -2431,216 +2683,6 @@ PepDataConvertorService.decorators = [
2431
2683
  },] }
2432
2684
  ];
2433
2685
 
2434
- class PepFileService {
2435
- constructor() {
2436
- this.scripts = new Map();
2437
- this.styles = new Map();
2438
- }
2439
- loadFiles(files) {
2440
- const promises = [];
2441
- files.forEach((file) => {
2442
- if (file.type === 'style') {
2443
- promises.push(this.loadStyle(file.path));
2444
- }
2445
- else if (file.type === 'script') {
2446
- promises.push(this.loadScript(file.path));
2447
- }
2448
- });
2449
- return Promise.all(promises);
2450
- }
2451
- removeFiles(files) {
2452
- for (let index = 0; index < files.length &&
2453
- files[index].path &&
2454
- files[index].path.trim() !== ''; index++) {
2455
- const name = this.getFileName(files[index].path, true);
2456
- const element = document.getElementById(name);
2457
- element.parentNode.removeChild(element);
2458
- if (files[index].type === 'script' && this.scripts.has(name)) {
2459
- this.scripts.delete(name);
2460
- }
2461
- else if (files[index].type === 'style' && this.styles.has(name)) {
2462
- this.styles.delete(name);
2463
- }
2464
- }
2465
- }
2466
- loadScript(path) {
2467
- return new Promise((resolve, reject) => {
2468
- const name = this.getFileName(path, true);
2469
- // If the script isn't exist add it.
2470
- if (!this.scripts.has(name)) {
2471
- this.scripts.set(name, { loaded: false, src: path });
2472
- }
2473
- const scriptItem = this.scripts.get(name);
2474
- // Resolve if already loaded
2475
- if (scriptItem.loaded) {
2476
- resolve({
2477
- script: name,
2478
- loaded: true,
2479
- status: 'Already Loaded',
2480
- });
2481
- }
2482
- else {
2483
- // Load script
2484
- const script = document.createElement('script');
2485
- script.type = 'text/javascript';
2486
- script.src = scriptItem.src;
2487
- script.setAttribute('id', name);
2488
- script.async = false;
2489
- if (script.readyState) {
2490
- // IE
2491
- script.onreadystatechange = () => {
2492
- if (script.readyState === 'loaded' ||
2493
- script.readyState === 'complete') {
2494
- script.onreadystatechange = null;
2495
- scriptItem.loaded = true;
2496
- resolve({
2497
- path,
2498
- type: 'script',
2499
- loaded: true,
2500
- status: 'Loaded',
2501
- });
2502
- }
2503
- };
2504
- }
2505
- else {
2506
- // Others
2507
- script.onload = () => {
2508
- scriptItem.loaded = true;
2509
- resolve({
2510
- path,
2511
- type: 'script',
2512
- loaded: true,
2513
- status: 'Loaded',
2514
- });
2515
- };
2516
- }
2517
- script.onerror = (error) => resolve({
2518
- path,
2519
- type: 'script',
2520
- loaded: false,
2521
- status: 'Loaded',
2522
- });
2523
- document.getElementsByTagName('head')[0].appendChild(script);
2524
- }
2525
- });
2526
- }
2527
- loadStyle(path) {
2528
- return new Promise((resolve, reject) => {
2529
- const name = this.getFileName(path, true);
2530
- // If the style isn't exist add it.
2531
- if (!this.styles.has(name)) {
2532
- this.styles.set(name, { loaded: false, src: path });
2533
- }
2534
- const styleItem = this.styles.get(name);
2535
- // Resolve if already loaded
2536
- if (styleItem.loaded) {
2537
- resolve({
2538
- path,
2539
- type: 'style',
2540
- loaded: true,
2541
- status: 'Already Loaded',
2542
- });
2543
- }
2544
- else {
2545
- // Load style
2546
- const style = document.createElement('link');
2547
- style.type = 'text/css';
2548
- style.rel = 'stylesheet';
2549
- style.href = styleItem.src;
2550
- style.media = 'all';
2551
- style.setAttribute('id', name);
2552
- styleItem.loaded = true;
2553
- resolve({
2554
- path,
2555
- type: 'style',
2556
- loaded: true,
2557
- status: 'Loaded',
2558
- });
2559
- document.getElementsByTagName('head')[0].appendChild(style);
2560
- }
2561
- });
2562
- }
2563
- loadFontStyle(styleId, href) {
2564
- const head = document.getElementsByTagName('head')[0];
2565
- const styleElement = document.getElementById(styleId);
2566
- if (styleElement) {
2567
- styleElement.href = href;
2568
- }
2569
- else {
2570
- const style = document.createElement('link');
2571
- style.id = styleId;
2572
- style.rel = 'stylesheet';
2573
- style.href = `${href}`;
2574
- head.appendChild(style);
2575
- }
2576
- }
2577
- getFileName(filePath, withExtenstion = false) {
2578
- const lastIndex = withExtenstion
2579
- ? filePath.length - 1
2580
- : filePath.lastIndexOf('.');
2581
- return filePath.substr(filePath.lastIndexOf('/') + 1, lastIndex);
2582
- }
2583
- getFileExtension(filePath) {
2584
- const fileSplit = filePath.split('.');
2585
- let fileExt = '';
2586
- if (fileSplit.length > 1) {
2587
- fileExt = fileSplit[fileSplit.length - 2];
2588
- }
2589
- return fileExt;
2590
- }
2591
- /* Returns true if url is valid */
2592
- isValidUrl(url) {
2593
- /* Try creating a valid URL */
2594
- try {
2595
- const tmp = new URL(url);
2596
- return true;
2597
- }
2598
- catch (e) {
2599
- return false;
2600
- }
2601
- }
2602
- convertFromb64toBlob(b64Data, contentType = '', sliceSize = 512) {
2603
- const byteCharacters = atob(b64Data);
2604
- const byteArrays = [];
2605
- for (let offset = 0; offset < byteCharacters.length; offset += sliceSize) {
2606
- const slice = byteCharacters.slice(offset, offset + sliceSize);
2607
- const byteNumbers = new Array(slice.length);
2608
- for (let i = 0; i < slice.length; i++) {
2609
- byteNumbers[i] = slice.charCodeAt(i);
2610
- }
2611
- const byteArray = new Uint8Array(byteNumbers);
2612
- byteArrays.push(byteArray);
2613
- }
2614
- const blob = new Blob(byteArrays, { type: contentType });
2615
- return blob;
2616
- }
2617
- getAssetsPath(assetsDomain = '') {
2618
- const concatChar = assetsDomain === '' || assetsDomain.endsWith('/') ? '' : '/';
2619
- return `${assetsDomain}${concatChar}assets/ngx-lib/`;
2620
- }
2621
- getAssetsTranslationsSuffix() {
2622
- return '.ngx-lib.json';
2623
- }
2624
- getAssetsTranslationsPath(assetsDomain = '') {
2625
- return `${this.getAssetsPath(assetsDomain)}i18n/`;
2626
- }
2627
- getAssetsImagesPath(assetsDomain = '', image = '') {
2628
- return `${this.getAssetsPath(assetsDomain)}images/${image}`;
2629
- }
2630
- getSvgAsImageSrc(svg) {
2631
- const blob = new Blob([svg], { type: 'image/svg+xml' });
2632
- const url = URL.createObjectURL(blob);
2633
- return url;
2634
- }
2635
- }
2636
- PepFileService.ɵprov = i0.ɵɵdefineInjectable({ factory: function PepFileService_Factory() { return new PepFileService(); }, token: PepFileService, providedIn: "root" });
2637
- PepFileService.decorators = [
2638
- { type: Injectable, args: [{
2639
- providedIn: 'root',
2640
- },] }
2641
- ];
2642
- PepFileService.ctorParameters = () => [];
2643
-
2644
2686
  class PepValidatorService {
2645
2687
  constructor(translate = null) {
2646
2688
  var _a;
@@ -4185,5 +4227,5 @@ PepNgxLibModule.decorators = [
4185
4227
  * Generated bundle index. Do not edit.
4186
4228
  */
4187
4229
 
4188
- export { DEFAULT_HORIZONTAL_ALIGNMENT, DEFAULT_VERTICAL_ALIGNMENT, FIELD_TYPE, FieldLayout, KeyValuePair, ObjectSingleData, ObjectsData, ObjectsDataRow, ObjectsDataRowCell, PepAddonService, PepAddressField, PepAttachDirective, PepAttachmentField, PepButtonBlurDirective, PepButtonLoaderDirective, PepCapitalizePipe, PepCheckboxField, PepClipboardDirective, PepClipboardService, PepColorService, PepCookieService, PepCustomizationService, PepDataConvertorService, PepDataQaDirective, PepDateField, PepDateFormatterPipe, PepDateStringFormatterPipe, PepEncodePipe, PepEscapePipe, PepFieldBase, PepFieldData, PepFileService, PepGuid, PepHttpService, PepImageField, PepImagesField, PepIndicatorsField, PepInputAutoWidthDirective, PepInternalButtonField, PepInternalCaruselField, PepInternalMenuField, PepInternalPageField, PepJwtHelperService, PepLayoutService, PepLoaderService, PepMenuBlurDirective, PepNgxLibModule, PepPlaceholderField, PepPortalService, PepPreventMultiClickDirective, PepPrintDirective, PepQuantitySelectorField, PepReplaceLineBreaksPipe, PepRichHtmlTextareaField, PepRowData, PepRtlClassDirective, PepRtlDirectionDirective, PepSafeHtmlPipe, PepSafePipe, PepScreenSizeType, PepScrollToService, PepSelectField, PepSeparatorField, PepSessionService, PepSignatureField, PepSplitUppercasePipe, PepTargetDirective, PepTextareaField, PepTextboxField, PepToNumberPipe, PepUtilitiesService, PepValidatorService, PepWindowScrollingService, SmartSearchResponse, SmartSearchValues, Test, UIControl, UIControlField, X_ALIGNMENT_TYPE, Y_ALIGNMENT_TYPE, httpInterceptorProviders as ɵa, PepErrorInterceptor as ɵb, PepLoaderInterceptor as ɵc, PepProfilerInterceptor as ɵd };
4230
+ export { DEFAULT_HORIZONTAL_ALIGNMENT, DEFAULT_VERTICAL_ALIGNMENT, FIELD_TYPE, FieldLayout, KeyValuePair, ObjectSingleData, ObjectsData, ObjectsDataRow, ObjectsDataRowCell, PepAddonService, PepAddressField, PepAttachDirective, PepAttachmentField, PepButtonBlurDirective, PepButtonLoaderDirective, PepCapitalizePipe, PepCheckboxField, PepClipboardDirective, PepClipboardService, PepColorService, PepCookieService, PepCustomizationService, PepDataConvertorService, PepDataQaDirective, PepDateField, PepDateFormatterPipe, PepDateStringFormatterPipe, PepEncodePipe, PepEscapePipe, PepFieldBase, PepFieldData, PepFileService, PepGuid, PepHttpService, PepImageField, PepImagesField, PepIndicatorsField, PepInputAutoWidthDirective, PepInternalButtonField, PepInternalCaruselField, PepInternalMenuField, PepInternalPageField, PepJwtHelperService, PepLayoutService, PepLoaderService, PepMenuBlurDirective, PepNgxLibModule, PepPlaceholderField, PepPortalService, PepPreventMultiClickDirective, PepPrintDirective, PepQuantitySelectorField, PepReplaceLineBreaksPipe, PepRichHtmlTextareaField, PepRowData, PepRtlClassDirective, PepRtlDirectionDirective, PepSafeHtmlPipe, PepSafePipe, PepScreenSizeType, PepScrollToService, PepSelectField, PepSeparatorField, PepSessionService, PepSignatureField, PepSplitUppercasePipe, PepTargetDirective, PepTextareaField, PepTextboxField, PepToNumberPipe, PepTranslateService, PepUtilitiesService, PepValidatorService, PepWindowScrollingService, SmartSearchResponse, SmartSearchValues, Test, UIControl, UIControlField, X_ALIGNMENT_TYPE, Y_ALIGNMENT_TYPE, httpInterceptorProviders as ɵa, PepErrorInterceptor as ɵb, PepLoaderInterceptor as ɵc, PepProfilerInterceptor as ɵd };
4189
4231
  //# sourceMappingURL=pepperi-addons-ngx-lib.js.map