@pepperi-addons/ngx-composite-lib 0.4.2-beta.62 → 0.4.2-beta.64

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 (52) hide show
  1. package/esm2020/group-buttons-settings/group-buttons-settings.component.mjs +3 -3
  2. package/esm2020/layout-builder/hide-in/hide-in.component.mjs +54 -0
  3. package/esm2020/layout-builder/hide-in/hide-in.module.mjs +81 -0
  4. package/esm2020/layout-builder/layout/layout.component.mjs +204 -0
  5. package/esm2020/layout-builder/layout/layout.module.mjs +58 -0
  6. package/esm2020/layout-builder/layout-builder.component.mjs +185 -0
  7. package/esm2020/layout-builder/layout-builder.model.mjs +6 -0
  8. package/esm2020/layout-builder/layout-builder.module.mjs +129 -0
  9. package/esm2020/layout-builder/layout-builder.service.mjs +605 -0
  10. package/esm2020/layout-builder/layout-editor/layout-editor.component.mjs +156 -0
  11. package/esm2020/layout-builder/layout-editor/layout-editor.module.mjs +109 -0
  12. package/esm2020/layout-builder/pepperi-addons-ngx-composite-lib-layout-builder.mjs +5 -0
  13. package/esm2020/layout-builder/public-api.mjs +10 -0
  14. package/esm2020/layout-builder/section/section.component.mjs +312 -0
  15. package/esm2020/layout-builder/section/section.module.mjs +45 -0
  16. package/esm2020/layout-builder/section-block/section-block.component.mjs +109 -0
  17. package/esm2020/layout-builder/section-block/section-block.module.mjs +48 -0
  18. package/esm2020/layout-builder/section-editor/section-editor.component.mjs +191 -0
  19. package/esm2020/layout-builder/section-editor/section-editor.module.mjs +40 -0
  20. package/fesm2015/pepperi-addons-ngx-composite-lib-group-buttons-settings.mjs +2 -2
  21. package/fesm2015/pepperi-addons-ngx-composite-lib-group-buttons-settings.mjs.map +1 -1
  22. package/fesm2015/pepperi-addons-ngx-composite-lib-layout-builder.mjs +2216 -0
  23. package/fesm2015/pepperi-addons-ngx-composite-lib-layout-builder.mjs.map +1 -0
  24. package/fesm2020/pepperi-addons-ngx-composite-lib-group-buttons-settings.mjs +2 -2
  25. package/fesm2020/pepperi-addons-ngx-composite-lib-group-buttons-settings.mjs.map +1 -1
  26. package/fesm2020/pepperi-addons-ngx-composite-lib-layout-builder.mjs +2196 -0
  27. package/fesm2020/pepperi-addons-ngx-composite-lib-layout-builder.mjs.map +1 -0
  28. package/group-buttons-settings/group-buttons-settings.component.d.ts +1 -1
  29. package/layout-builder/hide-in/hide-in.component.d.ts +25 -0
  30. package/layout-builder/hide-in/hide-in.component.theme.scss +9 -0
  31. package/layout-builder/hide-in/hide-in.module.d.ts +20 -0
  32. package/layout-builder/index.d.ts +5 -0
  33. package/layout-builder/layout/layout.component.d.ts +51 -0
  34. package/layout-builder/layout/layout.module.d.ts +17 -0
  35. package/layout-builder/layout-builder.component.d.ts +45 -0
  36. package/layout-builder/layout-builder.component.theme.scss +56 -0
  37. package/layout-builder/layout-builder.model.d.ts +51 -0
  38. package/layout-builder/layout-builder.module.d.ts +32 -0
  39. package/layout-builder/layout-builder.service.d.ts +96 -0
  40. package/layout-builder/layout-editor/layout-editor.component.d.ts +49 -0
  41. package/layout-builder/layout-editor/layout-editor.module.d.ts +28 -0
  42. package/layout-builder/public-api.d.ts +6 -0
  43. package/layout-builder/section/section.component.d.ts +78 -0
  44. package/layout-builder/section/section.component.theme.scss +115 -0
  45. package/layout-builder/section/section.module.d.ts +14 -0
  46. package/layout-builder/section-block/section-block.component.d.ts +39 -0
  47. package/layout-builder/section-block/section-block.component.theme.scss +13 -0
  48. package/layout-builder/section-block/section-block.module.d.ts +13 -0
  49. package/layout-builder/section-editor/section-editor.component.d.ts +53 -0
  50. package/layout-builder/section-editor/section-editor.module.d.ts +13 -0
  51. package/package.json +9 -1
  52. package/src/assets/i18n/en.ngx-composite-lib.json +40 -2
@@ -0,0 +1,2196 @@
1
+ import * as i0 from '@angular/core';
2
+ import { EventEmitter, Component, Input, Output, NgModule, Injectable, ViewChild, ViewChildren, HostBinding, ElementRef, HostListener } from '@angular/core';
3
+ import * as i3 from '@angular/common';
4
+ import { CommonModule } from '@angular/common';
5
+ import * as i4$1 from '@angular/cdk/drag-drop';
6
+ import { moveItemInArray, DragDropModule } from '@angular/cdk/drag-drop';
7
+ import { MatCommonModule } from '@angular/material/core';
8
+ import * as i5$4 from '@angular/material/tabs';
9
+ import { MatTabsModule } from '@angular/material/tabs';
10
+ import * as i1$2 from '@pepperi-addons/ngx-lib';
11
+ import { PepScreenSizeType, PepGuid, BaseDestroyerDirective, PepNgxLibModule } from '@pepperi-addons/ngx-lib';
12
+ import * as i5$2 from '@pepperi-addons/ngx-lib/size-detector';
13
+ import { PepSizeDetectorModule } from '@pepperi-addons/ngx-lib/size-detector';
14
+ import * as i4$2 from '@pepperi-addons/ngx-lib/skeleton-loader';
15
+ import { PepSkeletonLoaderModule } from '@pepperi-addons/ngx-lib/skeleton-loader';
16
+ import * as i6 from '@pepperi-addons/ngx-lib/button';
17
+ import { PepButtonModule } from '@pepperi-addons/ngx-lib/button';
18
+ import * as i2 from '@pepperi-addons/ngx-lib/dialog';
19
+ import { PepDialogModule, PepDialogActionButton, PepDialogData } from '@pepperi-addons/ngx-lib/dialog';
20
+ import * as i8$1 from '@pepperi-addons/ngx-lib/group-buttons';
21
+ import { PepGroupButtonsModule } from '@pepperi-addons/ngx-lib/group-buttons';
22
+ import * as i5$5 from '@pepperi-addons/ngx-lib/page-layout';
23
+ import { PepPageLayoutModule } from '@pepperi-addons/ngx-lib/page-layout';
24
+ import * as i6$1 from '@pepperi-addons/ngx-lib/side-bar';
25
+ import { PepSideBarComponent, PepSideBarModule } from '@pepperi-addons/ngx-lib/side-bar';
26
+ import * as i5$1 from '@pepperi-addons/ngx-lib/draggable-items';
27
+ import { PepDraggableItemsModule } from '@pepperi-addons/ngx-lib/draggable-items';
28
+ import * as i5$3 from '@pepperi-addons/ngx-lib/checkbox';
29
+ import { PepCheckboxModule } from '@pepperi-addons/ngx-lib/checkbox';
30
+ import * as i4$3 from '@pepperi-addons/ngx-lib/select';
31
+ import { PepSelectModule } from '@pepperi-addons/ngx-lib/select';
32
+ import * as i3$2 from '@pepperi-addons/ngx-lib/textbox';
33
+ import { PepTextboxModule } from '@pepperi-addons/ngx-lib/textbox';
34
+ import * as i8 from '@pepperi-addons/ngx-composite-lib/group-buttons-settings';
35
+ import { PepGroupButtonsSettingsModule } from '@pepperi-addons/ngx-composite-lib/group-buttons-settings';
36
+ import * as i1 from '@ngx-translate/core';
37
+ import { TranslateModule } from '@ngx-translate/core';
38
+ import * as i3$1 from '@angular/material/menu';
39
+ import { MatMenuModule } from '@angular/material/menu';
40
+ import * as i4 from '@angular/material/badge';
41
+ import { MatBadgeModule } from '@angular/material/badge';
42
+ import * as i5 from '@angular/material/checkbox';
43
+ import { MatCheckboxModule } from '@angular/material/checkbox';
44
+ import { MatButtonModule } from '@angular/material/button';
45
+ import { MatIconModule } from '@angular/material/icon';
46
+ import * as i1$1 from '@pepperi-addons/ngx-lib/icon';
47
+ import { pepIconSystemView, PepIconModule, pepIconDeviceDesktop, pepIconDeviceTablet, pepIconDeviceMobile } from '@pepperi-addons/ngx-lib/icon';
48
+ import { HttpClientModule } from '@angular/common/http';
49
+ import { PepRemoteLoaderModule } from '@pepperi-addons/ngx-lib/remote-loader';
50
+ import { coerceNumberProperty } from '@angular/cdk/coercion';
51
+ import { BehaviorSubject } from 'rxjs';
52
+ import { distinctUntilChanged, filter } from 'rxjs/operators';
53
+ import { OverlayModule } from '@angular/cdk/overlay';
54
+ import { PepTextareaModule } from '@pepperi-addons/ngx-lib/textarea';
55
+ import { PepColorModule } from '@pepperi-addons/ngx-lib/color';
56
+ import { PepImageModule } from '@pepperi-addons/ngx-lib/image';
57
+ import { MatSliderModule } from '@angular/material/slider';
58
+
59
+ class PepHideInComponent {
60
+ constructor(translate) {
61
+ this.translate = translate;
62
+ this.hideIn = [];
63
+ this.hideInChange = new EventEmitter();
64
+ this.menuOpened = new EventEmitter();
65
+ this.menuClosed = new EventEmitter();
66
+ }
67
+ async ngOnInit() {
68
+ // Get the first translation for load all translations.
69
+ const desktopTitle = await this.translate.get('LAYOUT_BUILDER.DESKTOP').toPromise();
70
+ this.menuItems = [
71
+ { key: 'Landscape', text: desktopTitle, selected: this.hideIn?.some(hideIn => hideIn === 'Landscape') },
72
+ { key: 'Tablet', text: this.translate.instant('LAYOUT_BUILDER.TABLET'), selected: this.hideIn?.some(hideIn => hideIn === 'Tablet') },
73
+ { key: 'Phablet', text: this.translate.instant('LAYOUT_BUILDER.MOBILE'), selected: this.hideIn?.some(hideIn => hideIn === 'Phablet') }
74
+ ];
75
+ }
76
+ onItemClick(event, menuItem) {
77
+ menuItem.selected = !menuItem.selected;
78
+ const hideIn = this.menuItems.filter(item => item.selected).map(item => item.key);
79
+ this.hideInChange.emit(hideIn);
80
+ event.stopPropagation();
81
+ return false;
82
+ }
83
+ onMenuOpened() {
84
+ this.menuOpened.emit();
85
+ }
86
+ onMenuClosed() {
87
+ this.menuClosed.emit();
88
+ }
89
+ }
90
+ PepHideInComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepHideInComponent, deps: [{ token: i1.TranslateService }], target: i0.ɵɵFactoryTarget.Component });
91
+ PepHideInComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.2", type: PepHideInComponent, selector: "hide-in", inputs: { hideIn: "hideIn" }, outputs: { hideInChange: "hideInChange", menuOpened: "menuOpened", menuClosed: "menuClosed" }, ngImport: i0, template: "\n<pep-button sizeType=\"xs\" iconName=\"system_view\" [matMenuTriggerFor]=\"menu\" (menuClosed)=\"onMenuClosed()\" (menuOpened)=\"onMenuOpened()\"\n class=\"badge-button\" [ngClass]=\"{ 'none': !hideIn || hideIn.length === 0}\"\n matBadge=\"{{ hideIn?.length }}\" matBadgePosition=\"after\" matBadgeSize=\"small\" \n></pep-button>\n\n<mat-menu #menu=\"matMenu\" class=\"hide-in-menu\">\n <div mat-menu-item class=\"title\" disabled>\n <span>{{('HIDE_IN.HIDE_IN_TITLE' | translate)}}</span>\n </div>\n <div mat-menu-item class=\"splitter\"></div>\n <ng-container *ngFor=\"let menuItem of menuItems\">\n <button mat-menu-item (click)=\"onItemClick($event, menuItem)\" title=\"{{ menuItem.text }}\">\n <mat-checkbox type=\"checkbox\" title=\"{{ menuItem.text }}\" class=\"md\"\n (change)=\"onItemClick($event, menuItem)\" [checked]=\"menuItem.selected\">\n <span class=\"pull-left flip title ellipsis\">{{ menuItem.text }}</span>\n </mat-checkbox>\n </button>\n </ng-container>\n</mat-menu>\n", styles: [".hide-in-menu .mat-menu-item.splitter{margin-inline:var(--pep-spacing-sm, .5rem)}.mat-menu-item ::ng-deep .mat-checkbox-layout .mat-checkbox-inner-container{margin-inline-end:var(--pep-spacing-xs, .25rem)!important}.badge-button .mat-badge-content{font-weight:var(--pep-font-weight-bold, 600);background:hsl(var(--pep-color-strong-h, 78),var(--pep-color-strong-s, 87%),var(--pep-color-strong-l, 27%));box-shadow:var(--pep-shadow-sm-offset, 0 .25rem .5rem 0) hsla(var(--pep-color-system-primary-h, 0),var(--pep-color-system-primary-s, 0%),var(--pep-color-system-primary-l, 10%),.08);color:hsl(var(--pep-color-system-primary-invert-h, 255),var(--pep-color-system-primary-invert-s, 100%),var(--pep-color-system-primary-invert-l, 100%));background-color:hsl(var(--pep-color-system-primary-h, 0),var(--pep-color-system-primary-s, 0%),var(--pep-color-system-primary-l, 10%))!important;box-shadow:var(--pep-shadow-sm-offset, 0 .25rem .5rem 0) hsla(var(--pep-color-system-primary-h, 0),var(--pep-color-system-primary-s, 0%),var(--pep-color-system-primary-l, 10%),.32)}.badge-button .mat-badge-content .svg-icon{fill:hsl(var(--pep-color-system-primary-invert-h, 255),var(--pep-color-system-primary-invert-s, 100%),var(--pep-color-system-primary-invert-l, 100%))}.badge-button .mat-badge-content .svg-icon.stroke{fill:unset;stroke:hsl(var(--pep-color-system-primary-invert-h, 255),var(--pep-color-system-primary-invert-s, 100%),var(--pep-color-system-primary-invert-l, 100%))}.badge-button.none ::ng-deep .mat-badge-content{display:none}.badge-button ::ng-deep .mat-badge-content{z-index:1;right:-4px!important}\n", ".hide-in-menu .mat-menu-item.title{color:hsla(var(--pep-color-system-primary-h, 0),var(--pep-color-system-primary-s, 0%),var(--pep-color-system-primary-l, 10%),.7)}\n"], dependencies: [{ kind: "directive", type: i3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "component", type: i3$1.MatMenu, selector: "mat-menu", exportAs: ["matMenu"] }, { kind: "component", type: i3$1.MatMenuItem, selector: "[mat-menu-item]", inputs: ["disabled", "disableRipple", "role"], exportAs: ["matMenuItem"] }, { kind: "directive", type: i3$1.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", exportAs: ["matMenuTrigger"] }, { kind: "directive", type: i4.MatBadge, selector: "[matBadge]", inputs: ["matBadgeDisabled", "matBadgeColor", "matBadgeOverlap", "matBadgePosition", "matBadge", "matBadgeDescription", "matBadgeSize", "matBadgeHidden"] }, { kind: "component", type: i5.MatCheckbox, selector: "mat-checkbox", inputs: ["disableRipple", "color", "tabIndex"], exportAs: ["matCheckbox"] }, { kind: "component", type: i6.PepButtonComponent, selector: "pep-button", inputs: ["key", "value", "styleType", "styleStateType", "sizeType", "classNames", "disabled", "iconName", "iconPosition", "visible"], outputs: ["buttonClick"] }, { kind: "pipe", type: i1.TranslatePipe, name: "translate" }] });
92
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepHideInComponent, decorators: [{
93
+ type: Component,
94
+ args: [{ selector: 'hide-in', template: "\n<pep-button sizeType=\"xs\" iconName=\"system_view\" [matMenuTriggerFor]=\"menu\" (menuClosed)=\"onMenuClosed()\" (menuOpened)=\"onMenuOpened()\"\n class=\"badge-button\" [ngClass]=\"{ 'none': !hideIn || hideIn.length === 0}\"\n matBadge=\"{{ hideIn?.length }}\" matBadgePosition=\"after\" matBadgeSize=\"small\" \n></pep-button>\n\n<mat-menu #menu=\"matMenu\" class=\"hide-in-menu\">\n <div mat-menu-item class=\"title\" disabled>\n <span>{{('HIDE_IN.HIDE_IN_TITLE' | translate)}}</span>\n </div>\n <div mat-menu-item class=\"splitter\"></div>\n <ng-container *ngFor=\"let menuItem of menuItems\">\n <button mat-menu-item (click)=\"onItemClick($event, menuItem)\" title=\"{{ menuItem.text }}\">\n <mat-checkbox type=\"checkbox\" title=\"{{ menuItem.text }}\" class=\"md\"\n (change)=\"onItemClick($event, menuItem)\" [checked]=\"menuItem.selected\">\n <span class=\"pull-left flip title ellipsis\">{{ menuItem.text }}</span>\n </mat-checkbox>\n </button>\n </ng-container>\n</mat-menu>\n", styles: [".hide-in-menu .mat-menu-item.splitter{margin-inline:var(--pep-spacing-sm, .5rem)}.mat-menu-item ::ng-deep .mat-checkbox-layout .mat-checkbox-inner-container{margin-inline-end:var(--pep-spacing-xs, .25rem)!important}.badge-button .mat-badge-content{font-weight:var(--pep-font-weight-bold, 600);background:hsl(var(--pep-color-strong-h, 78),var(--pep-color-strong-s, 87%),var(--pep-color-strong-l, 27%));box-shadow:var(--pep-shadow-sm-offset, 0 .25rem .5rem 0) hsla(var(--pep-color-system-primary-h, 0),var(--pep-color-system-primary-s, 0%),var(--pep-color-system-primary-l, 10%),.08);color:hsl(var(--pep-color-system-primary-invert-h, 255),var(--pep-color-system-primary-invert-s, 100%),var(--pep-color-system-primary-invert-l, 100%));background-color:hsl(var(--pep-color-system-primary-h, 0),var(--pep-color-system-primary-s, 0%),var(--pep-color-system-primary-l, 10%))!important;box-shadow:var(--pep-shadow-sm-offset, 0 .25rem .5rem 0) hsla(var(--pep-color-system-primary-h, 0),var(--pep-color-system-primary-s, 0%),var(--pep-color-system-primary-l, 10%),.32)}.badge-button .mat-badge-content .svg-icon{fill:hsl(var(--pep-color-system-primary-invert-h, 255),var(--pep-color-system-primary-invert-s, 100%),var(--pep-color-system-primary-invert-l, 100%))}.badge-button .mat-badge-content .svg-icon.stroke{fill:unset;stroke:hsl(var(--pep-color-system-primary-invert-h, 255),var(--pep-color-system-primary-invert-s, 100%),var(--pep-color-system-primary-invert-l, 100%))}.badge-button.none ::ng-deep .mat-badge-content{display:none}.badge-button ::ng-deep .mat-badge-content{z-index:1;right:-4px!important}\n", ".hide-in-menu .mat-menu-item.title{color:hsla(var(--pep-color-system-primary-h, 0),var(--pep-color-system-primary-s, 0%),var(--pep-color-system-primary-l, 10%),.7)}\n"] }]
95
+ }], ctorParameters: function () { return [{ type: i1.TranslateService }]; }, propDecorators: { hideIn: [{
96
+ type: Input
97
+ }], hideInChange: [{
98
+ type: Output
99
+ }], menuOpened: [{
100
+ type: Output
101
+ }], menuClosed: [{
102
+ type: Output
103
+ }] } });
104
+
105
+ class PepHideInModule {
106
+ constructor(pepIconRegistry) {
107
+ this.pepIconRegistry = pepIconRegistry;
108
+ this.pepIconRegistry.registerIcons([
109
+ pepIconSystemView,
110
+ ]);
111
+ }
112
+ }
113
+ PepHideInModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepHideInModule, deps: [{ token: i1$1.PepIconRegistry }], target: i0.ɵɵFactoryTarget.NgModule });
114
+ PepHideInModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.0.2", ngImport: i0, type: PepHideInModule, declarations: [PepHideInComponent], imports: [CommonModule,
115
+ MatButtonModule,
116
+ MatMenuModule,
117
+ MatIconModule,
118
+ MatBadgeModule,
119
+ MatCheckboxModule,
120
+ PepButtonModule,
121
+ PepCheckboxModule,
122
+ PepIconModule, i1.TranslateModule], exports: [PepHideInComponent] });
123
+ PepHideInModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepHideInModule, imports: [CommonModule,
124
+ MatButtonModule,
125
+ MatMenuModule,
126
+ MatIconModule,
127
+ MatBadgeModule,
128
+ MatCheckboxModule,
129
+ PepButtonModule,
130
+ PepCheckboxModule,
131
+ PepIconModule,
132
+ TranslateModule.forChild()
133
+ // ({
134
+ // loader: {
135
+ // provide: TranslateLoader,
136
+ // useFactory: (addonService: PepAddonService) =>
137
+ // PepAddonService.createMultiTranslateLoader(addonService, ['ngx-lib', 'ngx-composite-lib']),
138
+ // deps: [PepAddonService]
139
+ // }, isolate: false
140
+ // }),
141
+ ] });
142
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepHideInModule, decorators: [{
143
+ type: NgModule,
144
+ args: [{
145
+ declarations: [PepHideInComponent],
146
+ imports: [
147
+ CommonModule,
148
+ MatButtonModule,
149
+ MatMenuModule,
150
+ MatIconModule,
151
+ MatBadgeModule,
152
+ MatCheckboxModule,
153
+ PepButtonModule,
154
+ PepCheckboxModule,
155
+ PepIconModule,
156
+ TranslateModule.forChild()
157
+ // ({
158
+ // loader: {
159
+ // provide: TranslateLoader,
160
+ // useFactory: (addonService: PepAddonService) =>
161
+ // PepAddonService.createMultiTranslateLoader(addonService, ['ngx-lib', 'ngx-composite-lib']),
162
+ // deps: [PepAddonService]
163
+ // }, isolate: false
164
+ // }),
165
+ ],
166
+ exports: [PepHideInComponent]
167
+ }]
168
+ }], ctorParameters: function () { return [{ type: i1$1.PepIconRegistry }]; } });
169
+
170
+ class PepLayoutBuilderService {
171
+ constructor(translate) {
172
+ this.translate = translate;
173
+ this._defaultSectionTitle = '';
174
+ this._editorsBreadCrumb = Array();
175
+ this.isEditMode = false;
176
+ // This subject is for the screen size change events.
177
+ this._screenSizeSubject = new BehaviorSubject(PepScreenSizeType.XL);
178
+ // This subject is for demostrate the container size (Usage only in edit mode).
179
+ this._screenWidthSubject = new BehaviorSubject('100%');
180
+ // This subject is for load the current editor (Usage only in edit mode).
181
+ this._editorSubject = new BehaviorSubject(null);
182
+ // This is the sections columns drop list subject.
183
+ this._sectionsColumnsDropListSubject = new BehaviorSubject([]);
184
+ // This is the sections subject (a pare from the layout view object)
185
+ this._sectionsViewSubject = new BehaviorSubject([]);
186
+ // This subject is for layout view change.
187
+ this._layoutViewSubject = new BehaviorSubject(null);
188
+ // This subject is for edit mode when block is dragging now or not.
189
+ this._draggingBlockKey = new BehaviorSubject('');
190
+ // This subject is for edit mode when section is dragging now or not.
191
+ this._draggingSectionKey = new BehaviorSubject('');
192
+ // This subject is for lock or unlock the screen (Usage only in edit mode).
193
+ this._lockScreenSubject = new BehaviorSubject(false);
194
+ // This is for control the preview mode (for load the blocks with the CPI events)
195
+ this._previewModeSubject = new BehaviorSubject(false);
196
+ // This is for editor mode for block added.
197
+ this._blockAddedEventSubject = new BehaviorSubject(null);
198
+ // This is for editor mode for blocks removed.
199
+ this._blocksRemovedEventSubject = new BehaviorSubject([]);
200
+ // This subject is for skeleton.
201
+ this._showSkeletonSubject = new BehaviorSubject(true);
202
+ // This subjects is for load the available blocks to drag into map for better performance.
203
+ this._availableBlocksForDragMap = new Map();
204
+ this._availableBlocksForDragMapSubject = new BehaviorSubject(this.availableBlocksForDragMap);
205
+ // Indicates if the pages should run on offline mode.
206
+ this.isOffline = false;
207
+ //
208
+ }
209
+ set defaultSectionTitle(value) {
210
+ if (this._defaultSectionTitle === '') {
211
+ this._defaultSectionTitle = value;
212
+ }
213
+ }
214
+ get screenSizeChange$() {
215
+ return this._screenSizeSubject.asObservable().pipe(distinctUntilChanged());
216
+ }
217
+ get screenWidthChange$() {
218
+ return this._screenWidthSubject.asObservable().pipe(distinctUntilChanged());
219
+ }
220
+ get editorChange$() {
221
+ return this._editorSubject.asObservable().pipe(distinctUntilChanged());
222
+ }
223
+ get sectionsColumnsDropListChange$() {
224
+ return this._sectionsColumnsDropListSubject.asObservable();
225
+ }
226
+ get sectionsChange$() {
227
+ return this._sectionsViewSubject.asObservable();
228
+ // (prevSections, nextSections) => JSON.stringify(prevSections) === JSON.stringify(nextSections)));
229
+ }
230
+ get layoutViewChange$() {
231
+ return this._layoutViewSubject.asObservable().pipe(filter(layout => !!layout));
232
+ }
233
+ get draggingBlockKey() {
234
+ return this._draggingBlockKey.asObservable().pipe(distinctUntilChanged());
235
+ }
236
+ get draggingSectionKey() {
237
+ return this._draggingSectionKey.asObservable().pipe(distinctUntilChanged());
238
+ }
239
+ get lockScreenChange$() {
240
+ return this._lockScreenSubject.asObservable().pipe(distinctUntilChanged());
241
+ }
242
+ get previewModeChange$() {
243
+ return this._previewModeSubject.asObservable().pipe(distinctUntilChanged());
244
+ }
245
+ get blockAddedEventSubject$() {
246
+ return this._blockAddedEventSubject.asObservable();
247
+ }
248
+ get blocksRemovedEventSubject$() {
249
+ return this._blocksRemovedEventSubject.asObservable();
250
+ }
251
+ get showSkeletonChange$() {
252
+ return this._showSkeletonSubject.asObservable().pipe(distinctUntilChanged());
253
+ }
254
+ get availableBlocksForDragMap() {
255
+ return this._availableBlocksForDragMap;
256
+ }
257
+ get availableBlocksForDragMapChange$() {
258
+ return this._availableBlocksForDragMapSubject.asObservable();
259
+ }
260
+ notifyLayoutViewChange(layoutViewToUpdate) {
261
+ if (layoutViewToUpdate) {
262
+ if (this.isEditMode) {
263
+ this.updateLayoutEditorProperties(layoutViewToUpdate);
264
+ }
265
+ // Update the layout for the view.
266
+ this._layoutViewSubject.next(layoutViewToUpdate);
267
+ // Update the sections for the view.
268
+ this._sectionsViewSubject.next(layoutViewToUpdate?.Layout.Sections || []);
269
+ }
270
+ }
271
+ notifyBlockAdded(blockAddedEventData) {
272
+ // Notify that the block is added (to raise the event for the client).
273
+ this._blockAddedEventSubject.next(blockAddedEventData);
274
+ }
275
+ notifyBlocksRemoved(keys) {
276
+ if (keys) {
277
+ // Notify that the blocks are removed (to raise the event for the client).
278
+ this._blocksRemovedEventSubject.next(keys);
279
+ }
280
+ }
281
+ notifyEditorChange(editor) {
282
+ this._editorSubject.next(editor);
283
+ }
284
+ notifyAvailableBlocksForDragMapChange() {
285
+ this._availableBlocksForDragMapSubject.next(this.availableBlocksForDragMap);
286
+ }
287
+ updateLayoutEditorProperties(layoutView) {
288
+ if (this._editorsBreadCrumb[0]) {
289
+ const layoutEditor = {
290
+ // pageName: page?.Name,
291
+ // pageDescription: page?.Description,
292
+ // parameters: page.Parameters,
293
+ // onLoadFlow: page.OnLoadFlow,
294
+ // onChangeFlow: page.OnChangeFlow,
295
+ maxWidth: layoutView?.Layout.MaxWidth || 0,
296
+ verticalSpacing: layoutView?.Layout.VerticalSpacing,
297
+ horizontalSpacing: layoutView?.Layout.HorizontalSpacing,
298
+ sectionsGap: layoutView?.Layout.SectionsGap,
299
+ columnsGap: layoutView?.Layout.ColumnsGap,
300
+ // roundedCorners: layoutView?.layout.
301
+ };
302
+ this._editorsBreadCrumb[0].hostObject = layoutEditor;
303
+ }
304
+ }
305
+ loadDefaultEditor(layoutView) {
306
+ this._editorsBreadCrumb = new Array();
307
+ if (layoutView) {
308
+ this._editorsBreadCrumb.push({
309
+ id: PepLayoutBuilderService.MAIN_EDITOR_ID,
310
+ type: 'layout-builder',
311
+ title: layoutView.Title || this.translate.instant('LAYOUT_BUILDER.DEFAULT_TITLE'),
312
+ // hostObject: {} // Updates in updateLayoutEditorProperties function above.
313
+ });
314
+ this.updateLayoutEditorProperties(layoutView);
315
+ this.notifyEditorChange(this._editorsBreadCrumb[0]);
316
+ }
317
+ else {
318
+ this.notifyEditorChange(null);
319
+ }
320
+ }
321
+ changeCurrentEditor() {
322
+ if (this._editorsBreadCrumb.length > 0) {
323
+ this.notifyEditorChange(this._editorsBreadCrumb[this._editorsBreadCrumb.length - 1]);
324
+ }
325
+ }
326
+ getEditor(editorType, id) {
327
+ // Build editor object.
328
+ let editor = null;
329
+ if (editorType === 'section') {
330
+ editor = this.getSectionEditor(id);
331
+ }
332
+ else if (editorType === 'block') {
333
+ editor = this.getBlockEditor(id);
334
+ }
335
+ return editor;
336
+ }
337
+ getSectionEditorTitle(section, sectionIndex) {
338
+ return section.Name || `${this._defaultSectionTitle} ${sectionIndex + 1}`;
339
+ }
340
+ getSectionEditor(sectionId) {
341
+ const layoutView = this._layoutViewSubject.getValue();
342
+ const sections = layoutView?.Layout.Sections || [];
343
+ const sectionIndex = sections.findIndex(section => section.Key === sectionId);
344
+ if (sectionIndex >= 0) {
345
+ let section = sections[sectionIndex];
346
+ const sectionEditor = {
347
+ id: section.Key,
348
+ sectionName: section.Name || '',
349
+ split: section.Split || undefined,
350
+ height: section.Height || 0,
351
+ collapseOnTablet: section.CollapseOnTablet ?? false,
352
+ fillHeight: section.FillHeight ?? false
353
+ };
354
+ return {
355
+ id: sectionId,
356
+ type: 'section',
357
+ title: this.getSectionEditorTitle(section, sectionIndex),
358
+ hostObject: sectionEditor
359
+ };
360
+ }
361
+ else {
362
+ return null;
363
+ }
364
+ }
365
+ getSectionColumnByIdForEditor(sectionColumnId) {
366
+ let currentColumn = null;
367
+ // Get the section and column array by the pattern of the section column key.
368
+ const sectionColumnPatternSeparator = this.getSectionColumnKey();
369
+ const sectionColumnArr = sectionColumnId.split(sectionColumnPatternSeparator);
370
+ if (sectionColumnArr.length === 2) {
371
+ const layoutView = this._layoutViewSubject.getValue();
372
+ const sections = layoutView?.Layout.Sections || [];
373
+ // Get the section id to get the section index.
374
+ const sectionId = sectionColumnArr[0];
375
+ const sectionIndex = sections.findIndex(section => section.Key === sectionId);
376
+ // Get the column index.
377
+ const columnIndex = coerceNumberProperty(sectionColumnArr[1], -1);
378
+ if (sectionIndex >= 0 && columnIndex >= 0) {
379
+ currentColumn = sections[sectionIndex].Columns[columnIndex];
380
+ }
381
+ }
382
+ return currentColumn;
383
+ }
384
+ setSectionsColumnsGap(layoutView) {
385
+ if (layoutView?.Layout?.Sections) {
386
+ for (let index = 0; index < layoutView.Layout.Sections.length; index++) {
387
+ const section = layoutView.Layout.Sections[index];
388
+ section.ColumnsGap = layoutView.Layout.ColumnsGap;
389
+ }
390
+ }
391
+ }
392
+ getCssScreenWidh(screenType) {
393
+ let widthToSet = '100%';
394
+ if (screenType === 'Tablet') {
395
+ widthToSet = '720';
396
+ }
397
+ else if (screenType === 'Phablet') {
398
+ widthToSet = '360';
399
+ }
400
+ return widthToSet;
401
+ }
402
+ getBlockContainerByBlockKey(blockKey) {
403
+ let blockContainerToFind = undefined;
404
+ const layoutView = this._layoutViewSubject.getValue();
405
+ const sections = layoutView?.Layout.Sections || [];
406
+ for (let sectionIndex = 0; sectionIndex < sections.length; sectionIndex++) {
407
+ const section = sections[sectionIndex];
408
+ // Get the block container.
409
+ const columnIndex = section.Columns.findIndex(column => column.BlockContainer?.BlockKey === blockKey);
410
+ if (columnIndex > -1) {
411
+ blockContainerToFind = section.Columns[columnIndex].BlockContainer;
412
+ break;
413
+ }
414
+ }
415
+ return blockContainerToFind;
416
+ }
417
+ changeCursorOnDragStart() {
418
+ document.body.classList.add('inheritCursors');
419
+ document.body.style.cursor = 'grabbing';
420
+ }
421
+ changeCursorOnDragEnd() {
422
+ document.body.classList.remove('inheritCursors');
423
+ document.body.style.cursor = 'unset';
424
+ }
425
+ /***********************************************************************************************/
426
+ /* Public functions
427
+ /***********************************************************************************************/
428
+ notifySectionsColumnsDropListChange(sectionsColumnsDropList) {
429
+ this._sectionsColumnsDropListSubject.next(sectionsColumnsDropList);
430
+ }
431
+ notifyPreviewModeChange(value) {
432
+ this._previewModeSubject.next(value);
433
+ }
434
+ notifyLockScreen(value) {
435
+ this._lockScreenSubject.next(value);
436
+ }
437
+ setAvailableBlocksToDrag(availableBlocksForDrag) {
438
+ this._availableBlocksForDragMap.clear();
439
+ availableBlocksForDrag.forEach(block => {
440
+ this._availableBlocksForDragMap.set(block.data.key, block);
441
+ });
442
+ this.notifyAvailableBlocksForDragMapChange();
443
+ }
444
+ getBlockEditor(blockKey) {
445
+ const blockContainer = this.getBlockContainerByBlockKey(blockKey);
446
+ const defaultTitle = this.translate.instant('LAYOUT_BUILDER.NO_TITLE');
447
+ let blockTitle = defaultTitle;
448
+ if (blockContainer) {
449
+ blockTitle = this.availableBlocksForDragMap?.get(blockContainer?.DraggableItemKey)?.title || defaultTitle;
450
+ }
451
+ return {
452
+ id: blockKey,
453
+ type: 'block',
454
+ title: blockTitle,
455
+ // remoteModuleOptions: remoteLoaderOptions,
456
+ hostObject: {} // JSON.parse(JSON.stringify(hostObject))
457
+ };
458
+ }
459
+ getScreenType(size) {
460
+ const screenType = size < PepScreenSizeType.MD ? 'Landscape' :
461
+ (size === PepScreenSizeType.MD || size === PepScreenSizeType.SM ? 'Tablet' : 'Phablet');
462
+ return screenType;
463
+ }
464
+ getSectionColumnKey(sectionKey = '', index = '') {
465
+ return `${sectionKey}_column_${index}`;
466
+ }
467
+ getIsHidden(hideIn, currentScreenType) {
468
+ return (hideIn && hideIn?.length > 0) ? hideIn.some(hi => hi === currentScreenType) : false;
469
+ }
470
+ navigateToEditor(editorType, id) {
471
+ let success = false;
472
+ // Cannot navigate into 'layout-builder' because this is first and const in the editorsBreadCrumbs.
473
+ if (editorType !== 'layout-builder' && id?.length > 0) {
474
+ // Check which editor we have now
475
+ const currentEditor = this._editorsBreadCrumb[this._editorsBreadCrumb.length - 1];
476
+ // Only if it's another editor.
477
+ if (currentEditor.id !== id) {
478
+ if (currentEditor.type !== 'layout-builder') {
479
+ // Always pop the last and insert the current.
480
+ this._editorsBreadCrumb.pop();
481
+ }
482
+ let editor = this.getEditor(editorType, id);
483
+ if (editor) {
484
+ this._editorsBreadCrumb.push(editor);
485
+ this.changeCurrentEditor();
486
+ success = true;
487
+ }
488
+ else {
489
+ success = false;
490
+ }
491
+ }
492
+ }
493
+ return success;
494
+ }
495
+ navigateBackFromEditor() {
496
+ // Keep the layout builder editor.
497
+ if (this._editorsBreadCrumb.length > 1) {
498
+ // Maybe we want to compare the last editor for validation ?
499
+ const lastEditor = this._editorsBreadCrumb.pop();
500
+ this.changeCurrentEditor();
501
+ }
502
+ }
503
+ updateLayoutFromEditor(editorData) {
504
+ const layoutView = this._layoutViewSubject.getValue();
505
+ if (layoutView) {
506
+ layoutView.Layout.MaxWidth = editorData.maxWidth;
507
+ layoutView.Layout.HorizontalSpacing = editorData.horizontalSpacing;
508
+ layoutView.Layout.VerticalSpacing = editorData.verticalSpacing;
509
+ layoutView.Layout.SectionsGap = editorData.sectionsGap;
510
+ layoutView.Layout.ColumnsGap = editorData.columnsGap;
511
+ // layoutView.layout.RoundedCorners = editorData.roundedCorners;
512
+ this.setSectionsColumnsGap(layoutView);
513
+ this.notifyLayoutViewChange(layoutView);
514
+ }
515
+ }
516
+ updateSectionFromEditor(sectionData) {
517
+ const layoutView = this._layoutViewSubject.getValue();
518
+ const sections = layoutView?.Layout.Sections || [];
519
+ const sectionIndex = sections.findIndex(section => section.Key === sectionData.id);
520
+ // Update section details.
521
+ if (sectionIndex >= 0) {
522
+ const blocksIdsToRemove = [];
523
+ const currentSection = sections[sectionIndex];
524
+ currentSection.Name = sectionData.sectionName;
525
+ currentSection.Split = sectionData.split;
526
+ currentSection.Height = sectionData.height;
527
+ currentSection.CollapseOnTablet = sectionData.collapseOnTablet;
528
+ currentSection.FillHeight = sectionData.fillHeight;
529
+ // Get the new columns number from currentSection.Split, if its undefined put a default 1.
530
+ const newColumnsLength = currentSection.Split?.split(' ').length || 1;
531
+ if (newColumnsLength > currentSection.Columns.length) {
532
+ while (newColumnsLength > currentSection.Columns.length) {
533
+ currentSection.Columns.push({});
534
+ }
535
+ }
536
+ else if (newColumnsLength < currentSection.Columns.length) {
537
+ while (newColumnsLength < currentSection.Columns.length) {
538
+ const colunm = currentSection.Columns.pop();
539
+ // If there is block in this column delete it.
540
+ if (colunm && colunm.BlockContainer) {
541
+ blocksIdsToRemove.push(colunm.BlockContainer.BlockKey);
542
+ }
543
+ }
544
+ }
545
+ // Update editor title
546
+ const currentEditor = this._editorSubject.getValue();
547
+ if (currentEditor && currentEditor.type === 'section' && currentEditor.id === currentSection.Key) {
548
+ currentEditor.title = this.getSectionEditorTitle(currentSection, sectionIndex);
549
+ this.notifyEditorChange(currentEditor);
550
+ }
551
+ // Update sections change.
552
+ this.notifyLayoutViewChange(layoutView);
553
+ // If there are blocks to remove, notify the blocks removed.
554
+ if (blocksIdsToRemove.length > 0) {
555
+ this.notifyBlocksRemoved(blocksIdsToRemove);
556
+ }
557
+ }
558
+ }
559
+ addSection(section = null) {
560
+ // Create new section
561
+ if (!section) {
562
+ section = {
563
+ Key: PepGuid.newGuid(),
564
+ Columns: [{}],
565
+ Hide: []
566
+ };
567
+ }
568
+ // Add the new section to layout view.
569
+ const layoutView = this._layoutViewSubject.getValue();
570
+ const sections = layoutView?.Layout.Sections || [];
571
+ sections.push(section);
572
+ this.notifyLayoutViewChange(layoutView);
573
+ }
574
+ removeSection(sectionId) {
575
+ const layoutView = this._layoutViewSubject.getValue();
576
+ const sections = layoutView?.Layout.Sections || [];
577
+ const index = sections.findIndex(section => section.Key === sectionId);
578
+ if (index > -1) {
579
+ // Get the blocks id's to remove.
580
+ const blocksIdsToRemove = sections[index].Columns.map(column => column?.BlockContainer?.BlockKey);
581
+ // Remove section.
582
+ sections.splice(index, 1);
583
+ this.notifyLayoutViewChange(layoutView);
584
+ // If there are blocks to remove, notify the blocks removed.
585
+ if (blocksIdsToRemove.length > 0) {
586
+ this.notifyBlocksRemoved(blocksIdsToRemove);
587
+ }
588
+ }
589
+ }
590
+ hideSection(sectionId, hideIn) {
591
+ const layoutView = this._layoutViewSubject.getValue();
592
+ const sections = layoutView?.Layout.Sections || [];
593
+ const index = sections.findIndex(section => section.Key === sectionId);
594
+ if (index > -1) {
595
+ sections[index].Hide = hideIn;
596
+ this.notifyLayoutViewChange(layoutView);
597
+ }
598
+ }
599
+ onSectionDropped(event) {
600
+ const layoutView = this._layoutViewSubject.getValue();
601
+ const sections = layoutView?.Layout.Sections || [];
602
+ moveItemInArray(sections, event.previousIndex, event.currentIndex);
603
+ this.notifyLayoutViewChange(layoutView);
604
+ }
605
+ onSectionDragStart(event) {
606
+ this.changeCursorOnDragStart();
607
+ this._draggingSectionKey.next(event.source.data);
608
+ }
609
+ onSectionDragEnd(event) {
610
+ this.changeCursorOnDragEnd();
611
+ this._draggingSectionKey.next('');
612
+ }
613
+ removeBlockFromSection(blockId) {
614
+ let blockRemoved = false;
615
+ // Remove the block from section column.
616
+ const layoutView = this._layoutViewSubject.getValue();
617
+ const sections = layoutView?.Layout.Sections || [];
618
+ for (let sectionIndex = 0; sectionIndex < sections.length; sectionIndex++) {
619
+ const section = sections[sectionIndex];
620
+ // Remove the block container.
621
+ const columnIndex = section.Columns.findIndex(column => column.BlockContainer?.BlockKey === blockId);
622
+ if (columnIndex > -1) {
623
+ delete section.Columns[columnIndex].BlockContainer;
624
+ this.notifyLayoutViewChange(layoutView);
625
+ blockRemoved = true;
626
+ break;
627
+ }
628
+ }
629
+ // If the block was removed, notify the block removed.
630
+ if (blockRemoved) {
631
+ this.notifyBlocksRemoved([blockId]);
632
+ }
633
+ }
634
+ hideBlock(sectionId, blockId, hideIn) {
635
+ const layoutView = this._layoutViewSubject.getValue();
636
+ const sections = layoutView?.Layout.Sections || [];
637
+ const index = sections.findIndex(section => section.Key === sectionId);
638
+ if (index > -1) {
639
+ const columnIndex = sections[index].Columns.findIndex(column => column.BlockContainer?.BlockKey === blockId);
640
+ if (columnIndex > -1) {
641
+ const blockContainer = sections[index].Columns[columnIndex].BlockContainer;
642
+ if (blockContainer) {
643
+ blockContainer.Hide = hideIn;
644
+ this.notifyLayoutViewChange(layoutView);
645
+ }
646
+ }
647
+ }
648
+ }
649
+ onBlockDropped(event, sectionId) {
650
+ const layoutView = this._layoutViewSubject.getValue();
651
+ if (event.previousContainer.id === PepLayoutBuilderService.AVAILABLE_BLOCKS_CONTAINER_ID) {
652
+ // Get the block relation (previousContainer.data is IPepDraggableItem and inside we have AvailableBlock object).
653
+ const draggableItem = event.previousContainer.data[event.previousIndex];
654
+ if (draggableItem) {
655
+ // lock the screen untill the editor will be loaded.
656
+ // this._lockScreenSubject.next(true);
657
+ // Get the column.
658
+ const currentColumn = this.getSectionColumnByIdForEditor(event.container.id);
659
+ // Set the block key in the section block only if there is a blank column.
660
+ if (currentColumn && !currentColumn.BlockContainer) {
661
+ // Generate the block uuid.
662
+ const blockKey = PepGuid.newGuid();
663
+ currentColumn.BlockContainer = {
664
+ BlockKey: blockKey,
665
+ DraggableItemKey: draggableItem.data.key,
666
+ };
667
+ // Here we update the layout view cause the layout is updated.
668
+ this.notifyLayoutViewChange(layoutView);
669
+ // Raise block added event.
670
+ const blockAddedEventData = {
671
+ BlockKey: blockKey,
672
+ DraggableItem: draggableItem,
673
+ };
674
+ this.notifyBlockAdded(blockAddedEventData);
675
+ }
676
+ }
677
+ else {
678
+ console.log("draggableItem is not a IPepDraggableItem type");
679
+ }
680
+ }
681
+ else {
682
+ // If the block moved between columns in the same section or between different sections but not in the same column.
683
+ if (event.container.id !== event.previousContainer.id) {
684
+ // Get the column.
685
+ const currentColumn = this.getSectionColumnByIdForEditor(event.container.id);
686
+ // Get the previous column.
687
+ const previuosColumn = this.getSectionColumnByIdForEditor(event.previousContainer.id);
688
+ if (currentColumn && previuosColumn) {
689
+ currentColumn.BlockContainer = previuosColumn.BlockContainer;
690
+ delete previuosColumn.BlockContainer;
691
+ this.notifyLayoutViewChange(layoutView);
692
+ }
693
+ }
694
+ }
695
+ }
696
+ onBlockDragStart(event) {
697
+ this.changeCursorOnDragStart();
698
+ // Take the block key if exist, else take the available block key (relation key).
699
+ const blockKey = event.source.data?.BlockKey || event.source.data?.Key;
700
+ this._draggingBlockKey.next(blockKey);
701
+ }
702
+ onBlockDragEnd(event) {
703
+ this.changeCursorOnDragEnd();
704
+ this._draggingBlockKey.next('');
705
+ }
706
+ doesColumnContainBlock(sectionId, columnIndex) {
707
+ let res = false;
708
+ const layoutView = this._layoutViewSubject.getValue();
709
+ const section = layoutView?.Layout.Sections.find(section => section.Key === sectionId);
710
+ if (section && columnIndex >= 0 && section.Columns.length > columnIndex) {
711
+ res = !!section.Columns[columnIndex].BlockContainer;
712
+ }
713
+ return res;
714
+ }
715
+ setScreenWidth(screenType) {
716
+ const value = this.getCssScreenWidh(screenType);
717
+ let width = coerceNumberProperty(value, 0);
718
+ if (width === 0) {
719
+ this._screenWidthSubject.next('100%');
720
+ this._screenSizeSubject.next(PepScreenSizeType.XL);
721
+ }
722
+ else {
723
+ this._screenWidthSubject.next(`${width}px`);
724
+ // Change the size according the width.
725
+ if (width >= 1920) {
726
+ this._screenSizeSubject.next(PepScreenSizeType.XL);
727
+ }
728
+ else if (width >= 1280 && width < 1920) {
729
+ this._screenSizeSubject.next(PepScreenSizeType.LG);
730
+ }
731
+ else if (width >= 960 && width < 1280) {
732
+ this._screenSizeSubject.next(PepScreenSizeType.MD);
733
+ }
734
+ else if (width >= 600 && width < 960) {
735
+ this._screenSizeSubject.next(PepScreenSizeType.SM);
736
+ }
737
+ else if (width < 600) {
738
+ this._screenSizeSubject.next(PepScreenSizeType.XS);
739
+ }
740
+ }
741
+ }
742
+ showSkeleton(show) {
743
+ this._showSkeletonSubject.next(show);
744
+ }
745
+ loadLayoutBuilder(layoutView) {
746
+ if (this.isEditMode) {
747
+ // Load the layout editor.
748
+ this.loadDefaultEditor(layoutView);
749
+ // Set the columns gap of the sections.
750
+ this.setSectionsColumnsGap(layoutView);
751
+ }
752
+ // Load only the layout view.
753
+ this.notifyLayoutViewChange(layoutView);
754
+ }
755
+ }
756
+ PepLayoutBuilderService.AVAILABLE_BLOCKS_CONTAINER_ID = 'availableBlocks';
757
+ PepLayoutBuilderService.MAIN_EDITOR_ID = 'main';
758
+ PepLayoutBuilderService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepLayoutBuilderService, deps: [{ token: i1.TranslateService }], target: i0.ɵɵFactoryTarget.Injectable });
759
+ PepLayoutBuilderService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepLayoutBuilderService, providedIn: 'root' });
760
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepLayoutBuilderService, decorators: [{
761
+ type: Injectable,
762
+ args: [{
763
+ providedIn: 'root',
764
+ }]
765
+ }], ctorParameters: function () { return [{ type: i1.TranslateService }]; } });
766
+
767
+ class SectionBlockComponent extends BaseDestroyerDirective {
768
+ constructor(layoutBuilderService) {
769
+ super();
770
+ this.layoutBuilderService = layoutBuilderService;
771
+ this.sectionKey = '';
772
+ this.sectionHeight = '';
773
+ this.isMainEditorState = false;
774
+ this.editable = false;
775
+ this.active = false;
776
+ this.dragExited = new EventEmitter();
777
+ this.dragEntered = new EventEmitter();
778
+ this.hideForCurrentScreenType = false;
779
+ }
780
+ set blockContainer(value) {
781
+ this._blockContainer = value;
782
+ if (this._blockContainer) {
783
+ this.availableBlock = this.layoutBuilderService.availableBlocksForDragMap?.get(this._blockContainer?.DraggableItemKey);
784
+ }
785
+ this.setIfHideForCurrentScreenType();
786
+ }
787
+ get blockContainer() {
788
+ return this._blockContainer;
789
+ }
790
+ set screenType(value) {
791
+ this._screenType = value;
792
+ this.setIfHideForCurrentScreenType();
793
+ }
794
+ get screenType() {
795
+ return this._screenType;
796
+ }
797
+ setIfHideForCurrentScreenType() {
798
+ this.hideForCurrentScreenType = this.blockContainer ?
799
+ this.layoutBuilderService.getIsHidden(this.blockContainer.Hide, this.screenType) : false;
800
+ }
801
+ ngOnInit() {
802
+ //
803
+ this.layoutBuilderService.availableBlocksForDragMapChange$.pipe(this.getDestroyer()).subscribe((availableBlocksForDragMap) => {
804
+ if (availableBlocksForDragMap && this.blockContainer) {
805
+ this.availableBlock = availableBlocksForDragMap.get(this.blockContainer.DraggableItemKey);
806
+ }
807
+ });
808
+ }
809
+ onEditBlockClick() {
810
+ if (this.blockContainer?.BlockKey) {
811
+ this.layoutBuilderService.navigateToEditor('block', this.blockContainer.BlockKey);
812
+ }
813
+ }
814
+ onRemoveBlockClick() {
815
+ if (this.blockContainer?.BlockKey) {
816
+ this.layoutBuilderService.removeBlockFromSection(this.blockContainer.BlockKey);
817
+ }
818
+ }
819
+ onHideBlockChange(hideIn) {
820
+ if (this.blockContainer?.BlockKey) {
821
+ this.layoutBuilderService.hideBlock(this.sectionKey, this.blockContainer.BlockKey, hideIn);
822
+ this.setIfHideForCurrentScreenType();
823
+ }
824
+ }
825
+ // onBlockLoad(event: any) {
826
+ // this.layoutBuilderService.updateBlockLoaded(this.blockContainer.BlockKey);
827
+ // }
828
+ onDragStart(event) {
829
+ this.layoutBuilderService.onBlockDragStart(event);
830
+ }
831
+ onDragEnd(event) {
832
+ this.layoutBuilderService.onBlockDragEnd(event);
833
+ }
834
+ onDragExited(event) {
835
+ this.dragExited.emit(event);
836
+ }
837
+ onDragEntered(event) {
838
+ this.dragEntered.emit(event);
839
+ }
840
+ }
841
+ SectionBlockComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: SectionBlockComponent, deps: [{ token: PepLayoutBuilderService }], target: i0.ɵɵFactoryTarget.Component });
842
+ SectionBlockComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.2", type: SectionBlockComponent, selector: "section-block", inputs: { blockTemplate: "blockTemplate", sectionKey: "sectionKey", sectionHeight: "sectionHeight", isMainEditorState: "isMainEditorState", editable: "editable", active: "active", blockContainer: "blockContainer", screenType: "screenType" }, outputs: { dragExited: "dragExited", dragEntered: "dragEntered" }, usesInheritance: true, ngImport: i0, template: "<div *ngIf=\"blockContainer?.BlockKey && (editable || !hideForCurrentScreenType)\" \n class=\"section-block-container\"\n [ngClass]=\"{ 'editable-state': editable, 'block-hidden-state': hideForCurrentScreenType, 'active-block': active }\"\n cdkDrag [cdkDragData]=\"blockContainer\" [cdkDragDisabled]=\"!editable || !isMainEditorState\" \n (cdkDragStarted)=\"onDragStart($event)\" (cdkDragEnded)=\"onDragEnd($event)\"\n (cdkDragExited)=\"onDragExited($event)\" (cdkDragEntered)=\"onDragEntered($event)\">\n \n <pep-draggable-item *ngIf=\"editable && isMainEditorState\" cdkDragHandle style=\"cursor: grab;\"\n class=\"block-toolbar\" [title]=\"availableBlock?.title || blockContainer?.BlockKey || ''\" >\n <ng-container pep-actions>\n <pep-button classNames=\"caution\" sizeType=\"xs\" iconName=\"system_bin\" (buttonClick)=\"onRemoveBlockClick();\"></pep-button>\n <!-- <hide-in [hideIn]=\"blockContainer.Hide\" (hideInChange)=\"onHideBlockChange($event)\"></hide-in> -->\n <pep-button sizeType=\"xs\" iconName=\"system_edit\" (buttonClick)=\"onEditBlockClick();\"></pep-button>\n </ng-container>f\n </pep-draggable-item>\n <div class=\"remote-loader-wrapper\" [ngStyle]=\"{ 'overflow': (sectionHeight === 'unset' ? 'unset' : 'auto') }\">\n <div *ngIf=\"blockTemplate\" class=\"remote-loader\">\n <ng-container *ngTemplateOutlet=\"blockTemplate; context: { blockKey: blockContainer?.BlockKey, draggableItemKey: blockContainer?.DraggableItemKey }\">\n </ng-container>\n </div>\n <!-- <pep-remote-loader-element *ngIf=\"remoteLoaderOptions\" class=\"remote-loader\"\n [options]=\"remoteLoaderOptions\"\n [props]=\"{ hostObject: hostObject }\"\n [events]=\"{ hostEvents: onBlockHostEventsCallback }\"\n (load)=\"onBlockLoad($event)\">\n </pep-remote-loader-element> -->\n </div>\n</div>\n", styles: [".section-block-container{height:100%;width:100%}.section-block-container.editable-state:not(.active-block) .remote-loader-wrapper .remote-loader{pointer-events:none;opacity:.5}.section-block-container.editable-state.cdk-drag-preview .remote-loader-wrapper,.section-block-container.editable-state.cdk-drag-placeholder .block-toolbar{opacity:0}.section-block-container.editable-state .block-toolbar{position:absolute;top:50%;left:50%;width:95%;max-width:240px;transform:translate(-50%,-50%);z-index:3}.section-block-container.editable-state .block-toolbar:hover{z-index:12!important}.section-block-container .remote-loader-wrapper{height:100%;position:relative}.section-block-container .remote-loader-wrapper .remote-loader{display:block;height:100%;width:100%}\n", ".section-block-container.editable-state.block-hidden-state:not(.active-block){background:repeating-linear-gradient(45deg,hsla(var(--pep-color-system-caution-h, 360),var(--pep-color-system-caution-s, 100%),var(--pep-color-system-caution-l, 45%),0),hsla(var(--pep-color-system-caution-h, 360),var(--pep-color-system-caution-s, 100%),var(--pep-color-system-caution-l, 45%),0) .65rem,hsla(var(--pep-color-system-caution-h, 360),var(--pep-color-system-caution-s, 100%),var(--pep-color-system-caution-l, 45%),.32) .65rem,hsla(var(--pep-color-system-caution-h, 360),var(--pep-color-system-caution-s, 100%),var(--pep-color-system-caution-l, 45%),.32) .8rem),repeating-linear-gradient(-45deg,hsla(var(--pep-color-system-caution-h, 360),var(--pep-color-system-caution-s, 100%),var(--pep-color-system-caution-l, 45%),0),hsla(var(--pep-color-system-caution-h, 360),var(--pep-color-system-caution-s, 100%),var(--pep-color-system-caution-l, 45%),0) .65rem,hsla(var(--pep-color-system-caution-h, 360),var(--pep-color-system-caution-s, 100%),var(--pep-color-system-caution-l, 45%),.32) .65rem,hsla(var(--pep-color-system-caution-h, 360),var(--pep-color-system-caution-s, 100%),var(--pep-color-system-caution-l, 45%),.32) .8rem)}\n"], dependencies: [{ kind: "directive", type: i3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i3.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i4$1.CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragData", "cdkDragLockAxis", "cdkDragRootElement", "cdkDragBoundary", "cdkDragStartDelay", "cdkDragFreeDragPosition", "cdkDragDisabled", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragPreviewContainer"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { kind: "directive", type: i4$1.CdkDragHandle, selector: "[cdkDragHandle]", inputs: ["cdkDragHandleDisabled"] }, { kind: "component", type: i6.PepButtonComponent, selector: "pep-button", inputs: ["key", "value", "styleType", "styleStateType", "sizeType", "classNames", "disabled", "iconName", "iconPosition", "visible"], outputs: ["buttonClick"] }, { kind: "component", type: i5$1.DraggableItemComponent, selector: "pep-draggable-item", inputs: ["title", "titlePrefix", "titleClassNames", "data", "disabled", "shadow", "styleType", "toggleContent", "isToggleContentOpen", "actionsMenu", "menuStyleType"], outputs: ["contentToggle", "actionsMenuItemClick"] }] });
843
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: SectionBlockComponent, decorators: [{
844
+ type: Component,
845
+ args: [{ selector: 'section-block', template: "<div *ngIf=\"blockContainer?.BlockKey && (editable || !hideForCurrentScreenType)\" \n class=\"section-block-container\"\n [ngClass]=\"{ 'editable-state': editable, 'block-hidden-state': hideForCurrentScreenType, 'active-block': active }\"\n cdkDrag [cdkDragData]=\"blockContainer\" [cdkDragDisabled]=\"!editable || !isMainEditorState\" \n (cdkDragStarted)=\"onDragStart($event)\" (cdkDragEnded)=\"onDragEnd($event)\"\n (cdkDragExited)=\"onDragExited($event)\" (cdkDragEntered)=\"onDragEntered($event)\">\n \n <pep-draggable-item *ngIf=\"editable && isMainEditorState\" cdkDragHandle style=\"cursor: grab;\"\n class=\"block-toolbar\" [title]=\"availableBlock?.title || blockContainer?.BlockKey || ''\" >\n <ng-container pep-actions>\n <pep-button classNames=\"caution\" sizeType=\"xs\" iconName=\"system_bin\" (buttonClick)=\"onRemoveBlockClick();\"></pep-button>\n <!-- <hide-in [hideIn]=\"blockContainer.Hide\" (hideInChange)=\"onHideBlockChange($event)\"></hide-in> -->\n <pep-button sizeType=\"xs\" iconName=\"system_edit\" (buttonClick)=\"onEditBlockClick();\"></pep-button>\n </ng-container>f\n </pep-draggable-item>\n <div class=\"remote-loader-wrapper\" [ngStyle]=\"{ 'overflow': (sectionHeight === 'unset' ? 'unset' : 'auto') }\">\n <div *ngIf=\"blockTemplate\" class=\"remote-loader\">\n <ng-container *ngTemplateOutlet=\"blockTemplate; context: { blockKey: blockContainer?.BlockKey, draggableItemKey: blockContainer?.DraggableItemKey }\">\n </ng-container>\n </div>\n <!-- <pep-remote-loader-element *ngIf=\"remoteLoaderOptions\" class=\"remote-loader\"\n [options]=\"remoteLoaderOptions\"\n [props]=\"{ hostObject: hostObject }\"\n [events]=\"{ hostEvents: onBlockHostEventsCallback }\"\n (load)=\"onBlockLoad($event)\">\n </pep-remote-loader-element> -->\n </div>\n</div>\n", styles: [".section-block-container{height:100%;width:100%}.section-block-container.editable-state:not(.active-block) .remote-loader-wrapper .remote-loader{pointer-events:none;opacity:.5}.section-block-container.editable-state.cdk-drag-preview .remote-loader-wrapper,.section-block-container.editable-state.cdk-drag-placeholder .block-toolbar{opacity:0}.section-block-container.editable-state .block-toolbar{position:absolute;top:50%;left:50%;width:95%;max-width:240px;transform:translate(-50%,-50%);z-index:3}.section-block-container.editable-state .block-toolbar:hover{z-index:12!important}.section-block-container .remote-loader-wrapper{height:100%;position:relative}.section-block-container .remote-loader-wrapper .remote-loader{display:block;height:100%;width:100%}\n", ".section-block-container.editable-state.block-hidden-state:not(.active-block){background:repeating-linear-gradient(45deg,hsla(var(--pep-color-system-caution-h, 360),var(--pep-color-system-caution-s, 100%),var(--pep-color-system-caution-l, 45%),0),hsla(var(--pep-color-system-caution-h, 360),var(--pep-color-system-caution-s, 100%),var(--pep-color-system-caution-l, 45%),0) .65rem,hsla(var(--pep-color-system-caution-h, 360),var(--pep-color-system-caution-s, 100%),var(--pep-color-system-caution-l, 45%),.32) .65rem,hsla(var(--pep-color-system-caution-h, 360),var(--pep-color-system-caution-s, 100%),var(--pep-color-system-caution-l, 45%),.32) .8rem),repeating-linear-gradient(-45deg,hsla(var(--pep-color-system-caution-h, 360),var(--pep-color-system-caution-s, 100%),var(--pep-color-system-caution-l, 45%),0),hsla(var(--pep-color-system-caution-h, 360),var(--pep-color-system-caution-s, 100%),var(--pep-color-system-caution-l, 45%),0) .65rem,hsla(var(--pep-color-system-caution-h, 360),var(--pep-color-system-caution-s, 100%),var(--pep-color-system-caution-l, 45%),.32) .65rem,hsla(var(--pep-color-system-caution-h, 360),var(--pep-color-system-caution-s, 100%),var(--pep-color-system-caution-l, 45%),.32) .8rem)}\n"] }]
846
+ }], ctorParameters: function () { return [{ type: PepLayoutBuilderService }]; }, propDecorators: { blockTemplate: [{
847
+ type: Input
848
+ }], sectionKey: [{
849
+ type: Input
850
+ }], sectionHeight: [{
851
+ type: Input
852
+ }], isMainEditorState: [{
853
+ type: Input
854
+ }], editable: [{
855
+ type: Input
856
+ }], active: [{
857
+ type: Input
858
+ }], blockContainer: [{
859
+ type: Input
860
+ }], screenType: [{
861
+ type: Input
862
+ }], dragExited: [{
863
+ type: Output
864
+ }], dragEntered: [{
865
+ type: Output
866
+ }] } });
867
+
868
+ class SectionComponent extends BaseDestroyerDirective {
869
+ constructor(renderer, layoutBuilderService, layoutService) {
870
+ super();
871
+ this.renderer = renderer;
872
+ this.layoutBuilderService = layoutBuilderService;
873
+ this.layoutService = layoutService;
874
+ this.key = '';
875
+ this.name = '';
876
+ this._split = undefined;
877
+ this._height = undefined;
878
+ this._collapseOnTablet = false;
879
+ this._columns = [];
880
+ this._hideIn = [];
881
+ this.styleMaxHeight = 'unset';
882
+ this.styleHeight = 'unset';
883
+ this.sectionsColumnsDropList = [];
884
+ this._editable = false;
885
+ // PepScreenSizeType = PepScreenSizeType;
886
+ this.sectionColumnKeyPrefix = '';
887
+ this.isMainEditorState = false;
888
+ this.isEditing = false;
889
+ this.selectedSectionKey = '';
890
+ this.selectedBlockKey = '';
891
+ this.containsBlocks = false;
892
+ this.shouldSetDefaultHeight = false;
893
+ this.pepScreenSizeToFlipToVertical = PepScreenSizeType.SM;
894
+ this.hideForCurrentScreenType = false;
895
+ this.draggingBlockKey = '';
896
+ this.draggingSectionKey = '';
897
+ this.hoverState = false;
898
+ }
899
+ set split(value) {
900
+ this._split = value;
901
+ this.refreshSplit();
902
+ }
903
+ get split() {
904
+ return this._split;
905
+ }
906
+ set height(value) {
907
+ this._height = value;
908
+ this.setStyleHeight();
909
+ }
910
+ get height() {
911
+ return this._height;
912
+ }
913
+ set collapseOnTablet(value) {
914
+ this._collapseOnTablet = value;
915
+ this.pepScreenSizeToFlipToVertical = value ? PepScreenSizeType.MD : PepScreenSizeType.SM;
916
+ this.refreshSplit();
917
+ }
918
+ get collapseOnTablet() {
919
+ return this._collapseOnTablet;
920
+ }
921
+ set columns(value) {
922
+ this._columns = value || [];
923
+ }
924
+ get columns() {
925
+ return this._columns;
926
+ }
927
+ set hideIn(value) {
928
+ this._hideIn = value;
929
+ this.setIfHideForCurrentScreenType();
930
+ }
931
+ get hideIn() {
932
+ return this._hideIn;
933
+ }
934
+ set editable(value) {
935
+ this._editable = value;
936
+ this.refreshSplit();
937
+ }
938
+ get editable() {
939
+ return this._editable;
940
+ }
941
+ set screenSize(value) {
942
+ this._screenSize = value;
943
+ this.refreshSplit();
944
+ this.setScreenType();
945
+ }
946
+ get screenSize() {
947
+ return this._screenSize;
948
+ }
949
+ calculateIfSectionContainsBlocks() {
950
+ this.containsBlocks = this.columns.some(column => column.BlockContainer);
951
+ if (this.editable) {
952
+ this.shouldSetDefaultHeight = !this.containsBlocks;
953
+ }
954
+ }
955
+ setScreenType() {
956
+ this.screenType = this.layoutBuilderService.getScreenType(this.screenSize);
957
+ this.setIfHideForCurrentScreenType();
958
+ this.setStyleHeight();
959
+ }
960
+ setIfHideForCurrentScreenType() {
961
+ this.hideForCurrentScreenType = this.layoutBuilderService.getIsHidden(this.hideIn, this.screenType);
962
+ }
963
+ getCssSplitString() {
964
+ switch (this.split) {
965
+ case '1/2 1/2':
966
+ return '1fr 1fr';
967
+ case '1/2 1/4 1/4':
968
+ return '2fr 1fr 1fr';
969
+ case '1/3 1/3 1/3':
970
+ return '1fr 1fr 1fr';
971
+ case '1/3 2/3':
972
+ return '1fr 2fr';
973
+ case '1/4 1/2 1/4':
974
+ return '1fr 2fr 1fr';
975
+ case '1/4 1/4 1/2':
976
+ return '1fr 1fr 2fr';
977
+ case '1/4 1/4 1/4 1/4':
978
+ return '1fr 1fr 1fr 1fr';
979
+ case '1/4 3/4':
980
+ return '1fr 3fr';
981
+ case '2/3 1/3':
982
+ return '2fr 1fr';
983
+ case '3/4 1/4':
984
+ return '3fr 1fr';
985
+ default: // For one column.
986
+ return '1fr';
987
+ }
988
+ }
989
+ refreshSplit() {
990
+ setTimeout(() => {
991
+ if (this.sectionContainerRef) {
992
+ let cssSplitString = this.getCssSplitString();
993
+ // Go for all the columns in the columnsWrapper
994
+ this.columnsElementRef.toArray().map((section, sectionIndex) => {
995
+ // Horizontal (true) for large screens, false for small screens.
996
+ const isHorizontalView = this.screenSize <= this.pepScreenSizeToFlipToVertical;
997
+ if (isHorizontalView) {
998
+ this.renderer.setStyle(section.nativeElement, 'grid-auto-flow', 'column');
999
+ this.renderer.setStyle(section.nativeElement, 'grid-template-rows', 'unset');
1000
+ this.renderer.setStyle(section.nativeElement, 'grid-template-columns', cssSplitString);
1001
+ }
1002
+ else {
1003
+ this.renderer.setStyle(section.nativeElement, 'grid-auto-flow', 'row');
1004
+ this.renderer.setStyle(section.nativeElement, 'grid-template-columns', 'unset');
1005
+ this.renderer.setStyle(section.nativeElement, 'grid-template-rows', cssSplitString);
1006
+ // In runtime (or preview mode).
1007
+ if (!this.editable) {
1008
+ const cssSplitArray = cssSplitString.split(' ');
1009
+ // If there are some hidden columns change the column width to 0 (for cut the spacing in the grid-template-rows).
1010
+ this.columns.forEach((column, index) => {
1011
+ if (!column.BlockContainer) {
1012
+ cssSplitArray[index] = '0';
1013
+ }
1014
+ });
1015
+ this.renderer.setStyle(section.nativeElement, 'grid-template-rows', 'auto');
1016
+ //this.renderer.setStyle(section.nativeElement, 'grid-template-rows', cssSplitArray.join(' '));
1017
+ }
1018
+ }
1019
+ });
1020
+ }
1021
+ }, 0);
1022
+ }
1023
+ setStyleHeight() {
1024
+ if (this.height && this.height > 0 && this.screenType !== 'Phablet') {
1025
+ this.styleHeight = this.styleMaxHeight = `${this.height}px`;
1026
+ }
1027
+ else {
1028
+ this.styleHeight = this.styleMaxHeight = 'unset';
1029
+ }
1030
+ }
1031
+ getIsDragging() {
1032
+ return this.draggingBlockKey.length > 0 && this.draggingSectionKey.length > 0;
1033
+ }
1034
+ getIsHidden(hideIn, currentScreenType) {
1035
+ return this.layoutBuilderService.getIsHidden(hideIn, currentScreenType);
1036
+ }
1037
+ ngOnInit() {
1038
+ this.editable = this.layoutBuilderService.isEditMode;
1039
+ this.layoutBuilderService.previewModeChange$.pipe(this.getDestroyer()).subscribe(previewMode => {
1040
+ this.editable = this.layoutBuilderService.isEditMode && !previewMode;
1041
+ });
1042
+ // Just to calculate if sections contains blocks
1043
+ this.layoutBuilderService.sectionsChange$.pipe(this.getDestroyer()).subscribe(res => {
1044
+ this.calculateIfSectionContainsBlocks();
1045
+ });
1046
+ this.layoutService.onResize$.pipe(this.getDestroyer()).subscribe((size) => {
1047
+ this.screenSize = size;
1048
+ });
1049
+ this.layoutBuilderService.screenSizeChange$.pipe(this.getDestroyer()).subscribe((size) => {
1050
+ this.screenSize = size;
1051
+ });
1052
+ if (this.editable) {
1053
+ this.layoutBuilderService.sectionsColumnsDropListChange$.pipe(this.getDestroyer()).subscribe((sectionsColumnsDropList) => {
1054
+ this.sectionsColumnsDropList = sectionsColumnsDropList;
1055
+ });
1056
+ this.layoutBuilderService.editorChange$.pipe(this.getDestroyer()).subscribe((editor) => {
1057
+ this.isMainEditorState = editor && editor.type === 'layout-builder';
1058
+ this.isEditing = editor && editor.type === 'section' && editor.id === this.key;
1059
+ this.selectedSectionKey = editor && editor.type === 'section' ? editor.id : '';
1060
+ this.selectedBlockKey = editor && editor.type === 'block' ? editor.id : '';
1061
+ });
1062
+ this.layoutBuilderService.draggingBlockKey.pipe(this.getDestroyer()).subscribe((draggingBlockKey) => {
1063
+ this.draggingBlockKey = draggingBlockKey;
1064
+ if (draggingBlockKey === '') {
1065
+ this.calculateIfSectionContainsBlocks();
1066
+ }
1067
+ else {
1068
+ // If there is only one block in the section and now it's this block that the user is dragging.
1069
+ const blocksLength = this.columns.filter(column => column.BlockContainer).length;
1070
+ if (blocksLength === 1 && this.columns.find(c => c.BlockContainer?.BlockKey === this.draggingBlockKey)) {
1071
+ this.shouldSetDefaultHeight = true;
1072
+ }
1073
+ }
1074
+ });
1075
+ this.layoutBuilderService.draggingSectionKey.pipe(this.getDestroyer()).subscribe((draggingSectionKey) => {
1076
+ this.draggingSectionKey = draggingSectionKey;
1077
+ });
1078
+ }
1079
+ this.sectionColumnKeyPrefix = this.layoutBuilderService.getSectionColumnKey(this.key);
1080
+ }
1081
+ onEditSectionClick() {
1082
+ this.layoutBuilderService.navigateToEditor('section', this.key);
1083
+ }
1084
+ onRemoveSectionClick() {
1085
+ this.layoutBuilderService.removeSection(this.key);
1086
+ }
1087
+ onHideSectionChange(hideIn) {
1088
+ this.layoutBuilderService.hideSection(this.key, hideIn);
1089
+ }
1090
+ onHideInMenuOpened() {
1091
+ this.hoverState = true;
1092
+ }
1093
+ onHideInMenuClosed() {
1094
+ this.hoverState = false;
1095
+ }
1096
+ onBlockDropped(event) {
1097
+ this.layoutBuilderService.onBlockDropped(event, this.key);
1098
+ }
1099
+ canDropPredicate(columnIndex) {
1100
+ return (drag, drop) => {
1101
+ const res = !this.layoutBuilderService.doesColumnContainBlock(this.key, columnIndex);
1102
+ return res;
1103
+ };
1104
+ }
1105
+ onDragStart(event) {
1106
+ this.layoutBuilderService.onSectionDragStart(event);
1107
+ }
1108
+ onDragEnd(event) {
1109
+ this.layoutBuilderService.onSectionDragEnd(event);
1110
+ }
1111
+ onSectionBlockDragExited(event) {
1112
+ // TODO: Remove this.
1113
+ // // If the block is exit from his container and it's the only block in this section.
1114
+ // if (this.containsBlocks) {
1115
+ // const blocksLength = this.columns.filter(column => column.BlockContainer).length;
1116
+ // if (blocksLength === 1) {
1117
+ // this.containsBlocks = false;
1118
+ // this.shouldSetDefaultHeight = true;
1119
+ // }
1120
+ // }
1121
+ }
1122
+ onSectionBlockDragEntered(event) {
1123
+ // TODO: Remove this.
1124
+ // // Only in case that the block entered back to his container and it's the only block in this section.
1125
+ // if (event.container.id === event.item.dropContainer.id) {
1126
+ // if (!this.containsBlocks) {
1127
+ // this.containsBlocks = true;
1128
+ // }
1129
+ // }
1130
+ }
1131
+ }
1132
+ SectionComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: SectionComponent, deps: [{ token: i0.Renderer2 }, { token: PepLayoutBuilderService }, { token: i1$2.PepLayoutService }], target: i0.ɵɵFactoryTarget.Component });
1133
+ SectionComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.2", type: SectionComponent, selector: "section", inputs: { blockTemplate: "blockTemplate", key: "key", name: "name", split: "split", height: "height", collapseOnTablet: "collapseOnTablet", columns: "columns", hideIn: "hideIn", columnsGap: "columnsGap" }, host: { properties: { "style.max-height": "this.styleMaxHeight", "style.height": "this.styleHeight" } }, viewQueries: [{ propertyName: "sectionContainerRef", first: true, predicate: ["sectionContainer"], descendants: true }, { propertyName: "columnsElementRef", predicate: ["columnsWrapper"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<div #sectionContainer *ngIf=\"editable || (containsBlocks && !hideForCurrentScreenType)\" class=\"section-container \"\n [ngClass]=\"{ \n 'mobile': screenType === 'Phablet',\n 'editable-state': editable, 'main-editor-state': isMainEditorState, 'default-height': shouldSetDefaultHeight, 'active-section': isEditing,\n 'section-hidden-state': hideForCurrentScreenType, 'section-is-dragging': draggingSectionKey !== '', 'show-hover-state': hoverState }\" \n cdkDragBoundary=\".layout-builder-wrapper\" cdkDrag [cdkDragData]=\"key\" [cdkDragDisabled]=\"!editable || selectedSectionKey.length > 0 || selectedBlockKey.length > 0\" (cdkDragStarted)=\"onDragStart($event)\" (cdkDragEnded)=\"onDragEnd($event)\" \n >\n <pep-draggable-item *ngIf=\"editable && isMainEditorState && draggingSectionKey === ''\" cdkDragHandle style=\"cursor: grab;\"\n class=\"section-toolbar\" [ngClass]=\"{ 'hide-toolbar': !hoverState }\" [title]=\"name\">\n <ng-container pep-actions>\n <pep-button classNames=\"caution\" sizeType=\"xs\" iconName=\"system_bin\" (buttonClick)=\"onRemoveSectionClick();\"></pep-button>\n <hide-in [hideIn]=\"hideIn\" (hideInChange)=\"onHideSectionChange($event)\" (menuClosed)=\"onHideInMenuClosed()\" (menuOpened)=\"onHideInMenuOpened()\"></hide-in>\n <pep-button sizeType=\"xs\" iconName=\"system_edit\" (buttonClick)=\"onEditSectionClick();\"></pep-button>\n </ng-container>\n </pep-draggable-item>\n\n <div *ngIf=\"editable\" class=\"section-background\">\n <div class=\"back-template\" *ngFor=\"let number of [0,1,2,3,4,5,6,7,8,9,10,11]\"></div>\n </div>\n <div #columnsWrapper class=\"columns-wrapper gap-{{ columnsGap }}\" \n [ngClass]=\"{ 'mobile': screenType === 'Phablet', 'is-dragging': editable && getIsDragging }\">\n <div [id]=\"sectionColumnKeyPrefix + i\" \n *ngFor=\"let column of columns; let i=index;\"\n class=\"section-column {{screenSize <= pepScreenSizeToFlipToVertical ? 'horizontal' : 'vertical'}}\"\n [ngClass]=\"{ 'active-column': selectedBlockKey === column.BlockContainer?.BlockKey, \n 'is-hidden': getIsHidden(column?.BlockContainer?.Hide, screenType),\n 'already-contains-block': editable && column.BlockContainer && column.BlockContainer.BlockKey && column.BlockContainer.BlockKey.length > 0 && \n draggingBlockKey && draggingBlockKey.length > 0 && column.BlockContainer.BlockKey !== draggingBlockKey }\"\n cdkDropList\n [cdkDropListData]=\"column\"\n [cdkDropListOrientation]=\"screenSize <= pepScreenSizeToFlipToVertical ? 'horizontal' : 'vertical'\" \n [cdkDropListConnectedTo]=\"sectionsColumnsDropList\"\n (cdkDropListDropped)=\"onBlockDropped($event)\"\n [cdkDropListEnterPredicate]=\"canDropPredicate(i)\"\n >\n <section-block *ngIf=\"column.BlockContainer?.BlockKey\" class=\"section-block\" [sectionKey]=\"key\" [blockTemplate]=\"blockTemplate\"\n [blockContainer]=\"column.BlockContainer\" [editable]=\"editable\" [isMainEditorState]=\"isMainEditorState\" [sectionHeight]=\"styleHeight\"\n [active]=\"selectedBlockKey === column.BlockContainer?.BlockKey\" [screenType]=\"screenType\"\n (dragExited)=\"onSectionBlockDragExited($event)\" (dragEntered)=\"onSectionBlockDragEntered($event)\"></section-block>\n </div>\n </div>\n</div>\n", styles: [".section-container{position:relative;display:grid;height:100%;max-height:inherit;min-height:2.5rem}.section-container.editable-state.default-height{min-height:16rem}.section-container.editable-state.active-section{z-index:11}.section-container.editable-state.active-section .columns-wrapper{z-index:1}.section-container.editable-state.active-section ::ng-deep .remote-loader-wrapper .remote-loader{pointer-events:unset!important;opacity:unset!important}.section-container.editable-state.cdk-drag-placeholder{opacity:.5}.section-container.editable-state:not(.cdk-drag-placeholder):hover .section-toolbar,.section-container.editable-state:not(.cdk-drag-placeholder).show-hover-state .section-toolbar{display:block!important}.section-container.editable-state:not(.cdk-drag-preview) .hide-toolbar{display:none}.section-container.editable-state.main-editor-state .mobile .is-hidden{display:none}.section-container.editable-state .mobile .is-hidden{display:block}.section-container.editable-state .section-toolbar{position:absolute;top:0;height:2.625rem;z-index:11}.section-container.editable-state .section-toolbar ::ng-deep .pep-draggable-item-container{border-radius:0 0 var(--pep-border-radius-md, .25rem) 0}.section-container.editable-state .section-background{position:absolute;width:100%;height:100%;z-index:0;display:grid;grid-template-columns:repeat(12,1fr)}.section-container.editable-state .section-background .back-template{opacity:.1}.section-container.editable-state .section-background .back-template:last-of-type{border-right:0 none}.section-container .columns-wrapper{display:grid;grid-auto-flow:column;height:inherit;max-height:inherit;overflow:inherit}.section-container .columns-wrapper.is-dragging{overflow:unset}.section-container .columns-wrapper.gap-none{gap:0}.section-container .columns-wrapper.gap-sm{gap:var(--pep-spacing-sm, .5rem)}.section-container .columns-wrapper.gap-md{gap:var(--pep-spacing-lg, 1rem)}.section-container .columns-wrapper.gap-lg{gap:var(--pep-spacing-2xl, 2rem)}.section-container .columns-wrapper .section-column{position:relative;height:inherit;max-height:inherit;overflow:inherit}.section-container .columns-wrapper .section-column .section-block{height:inherit;max-height:inherit}\n", ".section-container{background:transparent}.section-container.editable-state.active-section{background:hsl(var(--pep-color-system-primary-invert-h, 255),var(--pep-color-system-primary-invert-s, 100%),var(--pep-color-system-primary-invert-l, 100%));box-shadow:0 0 0 var(--pep-spacing-xs, .25rem) hsla(var(--pep-color-text-link-h, 207),var(--pep-color-text-link-s, 76%),var(--pep-color-text-link-l, 37%),.5)}.section-container.editable-state.active-section .columns-wrapper{background:hsl(var(--pep-color-system-primary-invert-h, 255),var(--pep-color-system-primary-invert-s, 100%),var(--pep-color-system-primary-invert-l, 100%))}.section-container.editable-state.section-hidden-state:not(.active-section){background:repeating-linear-gradient(45deg,hsla(var(--pep-color-system-caution-h, 360),var(--pep-color-system-caution-s, 100%),var(--pep-color-system-caution-l, 45%),0),hsla(var(--pep-color-system-caution-h, 360),var(--pep-color-system-caution-s, 100%),var(--pep-color-system-caution-l, 45%),0) .65rem,hsla(var(--pep-color-system-caution-h, 360),var(--pep-color-system-caution-s, 100%),var(--pep-color-system-caution-l, 45%),.32) .65rem,hsla(var(--pep-color-system-caution-h, 360),var(--pep-color-system-caution-s, 100%),var(--pep-color-system-caution-l, 45%),.32) .8rem),repeating-linear-gradient(-45deg,hsla(var(--pep-color-system-caution-h, 360),var(--pep-color-system-caution-s, 100%),var(--pep-color-system-caution-l, 45%),0),hsla(var(--pep-color-system-caution-h, 360),var(--pep-color-system-caution-s, 100%),var(--pep-color-system-caution-l, 45%),0) .65rem,hsla(var(--pep-color-system-caution-h, 360),var(--pep-color-system-caution-s, 100%),var(--pep-color-system-caution-l, 45%),.32) .65rem,hsla(var(--pep-color-system-caution-h, 360),var(--pep-color-system-caution-s, 100%),var(--pep-color-system-caution-l, 45%),.32) .8rem)}.section-container.editable-state.main-editor-state.cdk-drag-preview{box-shadow:0 0 0 .125rem hsl(var(--pep-color-system-caution-h, 360),var(--pep-color-system-caution-s, 100%),var(--pep-color-system-caution-l, 45%))}.section-container.editable-state.main-editor-state.cdk-drag-placeholder{box-shadow:0 0 0 var(--pep-spacing-xs, .25rem) hsla(var(--pep-color-text-link-h, 207),var(--pep-color-text-link-s, 76%),var(--pep-color-text-link-l, 37%),.5)}.section-container.editable-state.main-editor-state.cdk-drag-placeholder:hover,.section-container.editable-state.main-editor-state.cdk-drag-placeholder.show-hover-state{box-shadow:0 0 0 var(--pep-spacing-xs, .25rem) hsla(var(--pep-color-text-link-h, 207),var(--pep-color-text-link-s, 76%),var(--pep-color-text-link-l, 37%),.5)!important}.section-container.editable-state.main-editor-state:hover:not(.section-is-dragging),.section-container.editable-state.main-editor-state.show-hover-state:not(.section-is-dragging){box-shadow:0 0 0 .125rem hsl(var(--pep-color-system-caution-h, 360),var(--pep-color-system-caution-s, 100%),var(--pep-color-system-caution-l, 45%))}.section-container.editable-state.main-editor-state .section-toolbar ::ng-deep .pep-draggable-item-container{box-shadow:0 0 0 .125rem hsl(var(--pep-color-system-caution-h, 360),var(--pep-color-system-caution-s, 100%),var(--pep-color-system-caution-l, 45%))}.section-container.editable-state .section-background .back-template{background-color:#bec3e5;border-right:.125rem dashed hsl(var(--pep-color-system-primary-h, 0),var(--pep-color-system-primary-s, 0%),var(--pep-color-system-primary-l, 10%))}.section-container.editable-state .columns-wrapper .section-column{border:.125rem dashed hsl(var(--pep-color-system-primary-h, 0),var(--pep-color-system-primary-s, 0%),var(--pep-color-system-primary-l, 10%))}.section-container.editable-state .columns-wrapper .section-column.active-column{background:hsl(var(--pep-color-system-primary-invert-h, 255),var(--pep-color-system-primary-invert-s, 100%),var(--pep-color-system-primary-invert-l, 100%))}.section-container.editable-state .columns-wrapper .section-column.cdk-drop-list-dragging{box-shadow:0 0 0 var(--pep-spacing-xs, .25rem) hsla(var(--pep-color-text-link-h, 207),var(--pep-color-text-link-s, 76%),var(--pep-color-text-link-l, 37%),.5)}.section-container.editable-state .columns-wrapper .section-column.already-contains-block:hover{box-shadow:0 0 0 var(--pep-spacing-xs, .25rem) hsl(var(--pep-color-system-caution-h, 360),var(--pep-color-system-caution-s, 100%),var(--pep-color-system-caution-l, 45%))}.section-container.editable-state .columns-wrapper.gap-none .section-column:not(.section-container.editable-state .columns-wrapper.gap-none .section-column:first-of-type).horizontal{border-left:unset}.section-container.editable-state .columns-wrapper.gap-none .section-column:not(.section-container.editable-state .columns-wrapper.gap-none .section-column:first-of-type).horizontal.cdk-drop-list-dragging{border-left:.125rem dashed hsl(var(--pep-color-system-primary-h, 0),var(--pep-color-system-primary-s, 0%),var(--pep-color-system-primary-l, 10%))}.section-container.editable-state .columns-wrapper.gap-none .section-column:not(.section-container.editable-state .columns-wrapper.gap-none .section-column:first-of-type).vertical{border-top:unset}.section-container.editable-state .columns-wrapper.gap-none .section-column:not(.section-container.editable-state .columns-wrapper.gap-none .section-column:first-of-type).vertical.cdk-drop-list-dragging{border-top:.125rem dashed hsl(var(--pep-color-system-primary-h, 0),var(--pep-color-system-primary-s, 0%),var(--pep-color-system-primary-l, 10%))}\n"], dependencies: [{ kind: "directive", type: i3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i4$1.CdkDropList, selector: "[cdkDropList], cdk-drop-list", inputs: ["cdkDropListConnectedTo", "cdkDropListData", "cdkDropListOrientation", "id", "cdkDropListLockAxis", "cdkDropListDisabled", "cdkDropListSortingDisabled", "cdkDropListEnterPredicate", "cdkDropListSortPredicate", "cdkDropListAutoScrollDisabled", "cdkDropListAutoScrollStep"], outputs: ["cdkDropListDropped", "cdkDropListEntered", "cdkDropListExited", "cdkDropListSorted"], exportAs: ["cdkDropList"] }, { kind: "directive", type: i4$1.CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragData", "cdkDragLockAxis", "cdkDragRootElement", "cdkDragBoundary", "cdkDragStartDelay", "cdkDragFreeDragPosition", "cdkDragDisabled", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragPreviewContainer"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { kind: "directive", type: i4$1.CdkDragHandle, selector: "[cdkDragHandle]", inputs: ["cdkDragHandleDisabled"] }, { kind: "component", type: i6.PepButtonComponent, selector: "pep-button", inputs: ["key", "value", "styleType", "styleStateType", "sizeType", "classNames", "disabled", "iconName", "iconPosition", "visible"], outputs: ["buttonClick"] }, { kind: "component", type: SectionBlockComponent, selector: "section-block", inputs: ["blockTemplate", "sectionKey", "sectionHeight", "isMainEditorState", "editable", "active", "blockContainer", "screenType"], outputs: ["dragExited", "dragEntered"] }, { kind: "component", type: PepHideInComponent, selector: "hide-in", inputs: ["hideIn"], outputs: ["hideInChange", "menuOpened", "menuClosed"] }, { kind: "component", type: i5$1.DraggableItemComponent, selector: "pep-draggable-item", inputs: ["title", "titlePrefix", "titleClassNames", "data", "disabled", "shadow", "styleType", "toggleContent", "isToggleContentOpen", "actionsMenu", "menuStyleType"], outputs: ["contentToggle", "actionsMenuItemClick"] }] });
1134
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: SectionComponent, decorators: [{
1135
+ type: Component,
1136
+ args: [{ selector: 'section', template: "<div #sectionContainer *ngIf=\"editable || (containsBlocks && !hideForCurrentScreenType)\" class=\"section-container \"\n [ngClass]=\"{ \n 'mobile': screenType === 'Phablet',\n 'editable-state': editable, 'main-editor-state': isMainEditorState, 'default-height': shouldSetDefaultHeight, 'active-section': isEditing,\n 'section-hidden-state': hideForCurrentScreenType, 'section-is-dragging': draggingSectionKey !== '', 'show-hover-state': hoverState }\" \n cdkDragBoundary=\".layout-builder-wrapper\" cdkDrag [cdkDragData]=\"key\" [cdkDragDisabled]=\"!editable || selectedSectionKey.length > 0 || selectedBlockKey.length > 0\" (cdkDragStarted)=\"onDragStart($event)\" (cdkDragEnded)=\"onDragEnd($event)\" \n >\n <pep-draggable-item *ngIf=\"editable && isMainEditorState && draggingSectionKey === ''\" cdkDragHandle style=\"cursor: grab;\"\n class=\"section-toolbar\" [ngClass]=\"{ 'hide-toolbar': !hoverState }\" [title]=\"name\">\n <ng-container pep-actions>\n <pep-button classNames=\"caution\" sizeType=\"xs\" iconName=\"system_bin\" (buttonClick)=\"onRemoveSectionClick();\"></pep-button>\n <hide-in [hideIn]=\"hideIn\" (hideInChange)=\"onHideSectionChange($event)\" (menuClosed)=\"onHideInMenuClosed()\" (menuOpened)=\"onHideInMenuOpened()\"></hide-in>\n <pep-button sizeType=\"xs\" iconName=\"system_edit\" (buttonClick)=\"onEditSectionClick();\"></pep-button>\n </ng-container>\n </pep-draggable-item>\n\n <div *ngIf=\"editable\" class=\"section-background\">\n <div class=\"back-template\" *ngFor=\"let number of [0,1,2,3,4,5,6,7,8,9,10,11]\"></div>\n </div>\n <div #columnsWrapper class=\"columns-wrapper gap-{{ columnsGap }}\" \n [ngClass]=\"{ 'mobile': screenType === 'Phablet', 'is-dragging': editable && getIsDragging }\">\n <div [id]=\"sectionColumnKeyPrefix + i\" \n *ngFor=\"let column of columns; let i=index;\"\n class=\"section-column {{screenSize <= pepScreenSizeToFlipToVertical ? 'horizontal' : 'vertical'}}\"\n [ngClass]=\"{ 'active-column': selectedBlockKey === column.BlockContainer?.BlockKey, \n 'is-hidden': getIsHidden(column?.BlockContainer?.Hide, screenType),\n 'already-contains-block': editable && column.BlockContainer && column.BlockContainer.BlockKey && column.BlockContainer.BlockKey.length > 0 && \n draggingBlockKey && draggingBlockKey.length > 0 && column.BlockContainer.BlockKey !== draggingBlockKey }\"\n cdkDropList\n [cdkDropListData]=\"column\"\n [cdkDropListOrientation]=\"screenSize <= pepScreenSizeToFlipToVertical ? 'horizontal' : 'vertical'\" \n [cdkDropListConnectedTo]=\"sectionsColumnsDropList\"\n (cdkDropListDropped)=\"onBlockDropped($event)\"\n [cdkDropListEnterPredicate]=\"canDropPredicate(i)\"\n >\n <section-block *ngIf=\"column.BlockContainer?.BlockKey\" class=\"section-block\" [sectionKey]=\"key\" [blockTemplate]=\"blockTemplate\"\n [blockContainer]=\"column.BlockContainer\" [editable]=\"editable\" [isMainEditorState]=\"isMainEditorState\" [sectionHeight]=\"styleHeight\"\n [active]=\"selectedBlockKey === column.BlockContainer?.BlockKey\" [screenType]=\"screenType\"\n (dragExited)=\"onSectionBlockDragExited($event)\" (dragEntered)=\"onSectionBlockDragEntered($event)\"></section-block>\n </div>\n </div>\n</div>\n", styles: [".section-container{position:relative;display:grid;height:100%;max-height:inherit;min-height:2.5rem}.section-container.editable-state.default-height{min-height:16rem}.section-container.editable-state.active-section{z-index:11}.section-container.editable-state.active-section .columns-wrapper{z-index:1}.section-container.editable-state.active-section ::ng-deep .remote-loader-wrapper .remote-loader{pointer-events:unset!important;opacity:unset!important}.section-container.editable-state.cdk-drag-placeholder{opacity:.5}.section-container.editable-state:not(.cdk-drag-placeholder):hover .section-toolbar,.section-container.editable-state:not(.cdk-drag-placeholder).show-hover-state .section-toolbar{display:block!important}.section-container.editable-state:not(.cdk-drag-preview) .hide-toolbar{display:none}.section-container.editable-state.main-editor-state .mobile .is-hidden{display:none}.section-container.editable-state .mobile .is-hidden{display:block}.section-container.editable-state .section-toolbar{position:absolute;top:0;height:2.625rem;z-index:11}.section-container.editable-state .section-toolbar ::ng-deep .pep-draggable-item-container{border-radius:0 0 var(--pep-border-radius-md, .25rem) 0}.section-container.editable-state .section-background{position:absolute;width:100%;height:100%;z-index:0;display:grid;grid-template-columns:repeat(12,1fr)}.section-container.editable-state .section-background .back-template{opacity:.1}.section-container.editable-state .section-background .back-template:last-of-type{border-right:0 none}.section-container .columns-wrapper{display:grid;grid-auto-flow:column;height:inherit;max-height:inherit;overflow:inherit}.section-container .columns-wrapper.is-dragging{overflow:unset}.section-container .columns-wrapper.gap-none{gap:0}.section-container .columns-wrapper.gap-sm{gap:var(--pep-spacing-sm, .5rem)}.section-container .columns-wrapper.gap-md{gap:var(--pep-spacing-lg, 1rem)}.section-container .columns-wrapper.gap-lg{gap:var(--pep-spacing-2xl, 2rem)}.section-container .columns-wrapper .section-column{position:relative;height:inherit;max-height:inherit;overflow:inherit}.section-container .columns-wrapper .section-column .section-block{height:inherit;max-height:inherit}\n", ".section-container{background:transparent}.section-container.editable-state.active-section{background:hsl(var(--pep-color-system-primary-invert-h, 255),var(--pep-color-system-primary-invert-s, 100%),var(--pep-color-system-primary-invert-l, 100%));box-shadow:0 0 0 var(--pep-spacing-xs, .25rem) hsla(var(--pep-color-text-link-h, 207),var(--pep-color-text-link-s, 76%),var(--pep-color-text-link-l, 37%),.5)}.section-container.editable-state.active-section .columns-wrapper{background:hsl(var(--pep-color-system-primary-invert-h, 255),var(--pep-color-system-primary-invert-s, 100%),var(--pep-color-system-primary-invert-l, 100%))}.section-container.editable-state.section-hidden-state:not(.active-section){background:repeating-linear-gradient(45deg,hsla(var(--pep-color-system-caution-h, 360),var(--pep-color-system-caution-s, 100%),var(--pep-color-system-caution-l, 45%),0),hsla(var(--pep-color-system-caution-h, 360),var(--pep-color-system-caution-s, 100%),var(--pep-color-system-caution-l, 45%),0) .65rem,hsla(var(--pep-color-system-caution-h, 360),var(--pep-color-system-caution-s, 100%),var(--pep-color-system-caution-l, 45%),.32) .65rem,hsla(var(--pep-color-system-caution-h, 360),var(--pep-color-system-caution-s, 100%),var(--pep-color-system-caution-l, 45%),.32) .8rem),repeating-linear-gradient(-45deg,hsla(var(--pep-color-system-caution-h, 360),var(--pep-color-system-caution-s, 100%),var(--pep-color-system-caution-l, 45%),0),hsla(var(--pep-color-system-caution-h, 360),var(--pep-color-system-caution-s, 100%),var(--pep-color-system-caution-l, 45%),0) .65rem,hsla(var(--pep-color-system-caution-h, 360),var(--pep-color-system-caution-s, 100%),var(--pep-color-system-caution-l, 45%),.32) .65rem,hsla(var(--pep-color-system-caution-h, 360),var(--pep-color-system-caution-s, 100%),var(--pep-color-system-caution-l, 45%),.32) .8rem)}.section-container.editable-state.main-editor-state.cdk-drag-preview{box-shadow:0 0 0 .125rem hsl(var(--pep-color-system-caution-h, 360),var(--pep-color-system-caution-s, 100%),var(--pep-color-system-caution-l, 45%))}.section-container.editable-state.main-editor-state.cdk-drag-placeholder{box-shadow:0 0 0 var(--pep-spacing-xs, .25rem) hsla(var(--pep-color-text-link-h, 207),var(--pep-color-text-link-s, 76%),var(--pep-color-text-link-l, 37%),.5)}.section-container.editable-state.main-editor-state.cdk-drag-placeholder:hover,.section-container.editable-state.main-editor-state.cdk-drag-placeholder.show-hover-state{box-shadow:0 0 0 var(--pep-spacing-xs, .25rem) hsla(var(--pep-color-text-link-h, 207),var(--pep-color-text-link-s, 76%),var(--pep-color-text-link-l, 37%),.5)!important}.section-container.editable-state.main-editor-state:hover:not(.section-is-dragging),.section-container.editable-state.main-editor-state.show-hover-state:not(.section-is-dragging){box-shadow:0 0 0 .125rem hsl(var(--pep-color-system-caution-h, 360),var(--pep-color-system-caution-s, 100%),var(--pep-color-system-caution-l, 45%))}.section-container.editable-state.main-editor-state .section-toolbar ::ng-deep .pep-draggable-item-container{box-shadow:0 0 0 .125rem hsl(var(--pep-color-system-caution-h, 360),var(--pep-color-system-caution-s, 100%),var(--pep-color-system-caution-l, 45%))}.section-container.editable-state .section-background .back-template{background-color:#bec3e5;border-right:.125rem dashed hsl(var(--pep-color-system-primary-h, 0),var(--pep-color-system-primary-s, 0%),var(--pep-color-system-primary-l, 10%))}.section-container.editable-state .columns-wrapper .section-column{border:.125rem dashed hsl(var(--pep-color-system-primary-h, 0),var(--pep-color-system-primary-s, 0%),var(--pep-color-system-primary-l, 10%))}.section-container.editable-state .columns-wrapper .section-column.active-column{background:hsl(var(--pep-color-system-primary-invert-h, 255),var(--pep-color-system-primary-invert-s, 100%),var(--pep-color-system-primary-invert-l, 100%))}.section-container.editable-state .columns-wrapper .section-column.cdk-drop-list-dragging{box-shadow:0 0 0 var(--pep-spacing-xs, .25rem) hsla(var(--pep-color-text-link-h, 207),var(--pep-color-text-link-s, 76%),var(--pep-color-text-link-l, 37%),.5)}.section-container.editable-state .columns-wrapper .section-column.already-contains-block:hover{box-shadow:0 0 0 var(--pep-spacing-xs, .25rem) hsl(var(--pep-color-system-caution-h, 360),var(--pep-color-system-caution-s, 100%),var(--pep-color-system-caution-l, 45%))}.section-container.editable-state .columns-wrapper.gap-none .section-column:not(.section-container.editable-state .columns-wrapper.gap-none .section-column:first-of-type).horizontal{border-left:unset}.section-container.editable-state .columns-wrapper.gap-none .section-column:not(.section-container.editable-state .columns-wrapper.gap-none .section-column:first-of-type).horizontal.cdk-drop-list-dragging{border-left:.125rem dashed hsl(var(--pep-color-system-primary-h, 0),var(--pep-color-system-primary-s, 0%),var(--pep-color-system-primary-l, 10%))}.section-container.editable-state .columns-wrapper.gap-none .section-column:not(.section-container.editable-state .columns-wrapper.gap-none .section-column:first-of-type).vertical{border-top:unset}.section-container.editable-state .columns-wrapper.gap-none .section-column:not(.section-container.editable-state .columns-wrapper.gap-none .section-column:first-of-type).vertical.cdk-drop-list-dragging{border-top:.125rem dashed hsl(var(--pep-color-system-primary-h, 0),var(--pep-color-system-primary-s, 0%),var(--pep-color-system-primary-l, 10%))}\n"] }]
1137
+ }], ctorParameters: function () { return [{ type: i0.Renderer2 }, { type: PepLayoutBuilderService }, { type: i1$2.PepLayoutService }]; }, propDecorators: { sectionContainerRef: [{
1138
+ type: ViewChild,
1139
+ args: ['sectionContainer']
1140
+ }], columnsElementRef: [{
1141
+ type: ViewChildren,
1142
+ args: ['columnsWrapper']
1143
+ }], blockTemplate: [{
1144
+ type: Input
1145
+ }], key: [{
1146
+ type: Input
1147
+ }], name: [{
1148
+ type: Input
1149
+ }], split: [{
1150
+ type: Input
1151
+ }], height: [{
1152
+ type: Input
1153
+ }], collapseOnTablet: [{
1154
+ type: Input
1155
+ }], columns: [{
1156
+ type: Input
1157
+ }], hideIn: [{
1158
+ type: Input
1159
+ }], columnsGap: [{
1160
+ type: Input
1161
+ }], styleMaxHeight: [{
1162
+ type: HostBinding,
1163
+ args: ['style.max-height']
1164
+ }], styleHeight: [{
1165
+ type: HostBinding,
1166
+ args: ['style.height']
1167
+ }] } });
1168
+
1169
+ class SectionBlockModule {
1170
+ }
1171
+ SectionBlockModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: SectionBlockModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1172
+ SectionBlockModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.0.2", ngImport: i0, type: SectionBlockModule, declarations: [SectionBlockComponent], imports: [CommonModule,
1173
+ DragDropModule,
1174
+ PepButtonModule,
1175
+ PepSkeletonLoaderModule,
1176
+ PepRemoteLoaderModule,
1177
+ // PepHideInModule,
1178
+ PepDraggableItemsModule], exports: [SectionBlockComponent] });
1179
+ SectionBlockModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: SectionBlockModule, imports: [CommonModule,
1180
+ DragDropModule,
1181
+ PepButtonModule,
1182
+ PepSkeletonLoaderModule,
1183
+ PepRemoteLoaderModule,
1184
+ // PepHideInModule,
1185
+ PepDraggableItemsModule] });
1186
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: SectionBlockModule, decorators: [{
1187
+ type: NgModule,
1188
+ args: [{
1189
+ declarations: [
1190
+ SectionBlockComponent,
1191
+ ],
1192
+ imports: [
1193
+ CommonModule,
1194
+ DragDropModule,
1195
+ PepButtonModule,
1196
+ PepSkeletonLoaderModule,
1197
+ PepRemoteLoaderModule,
1198
+ // PepHideInModule,
1199
+ PepDraggableItemsModule,
1200
+ // TranslateModule.forChild()
1201
+ ],
1202
+ exports: [SectionBlockComponent]
1203
+ }]
1204
+ }] });
1205
+
1206
+ class SectionModule {
1207
+ }
1208
+ SectionModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: SectionModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1209
+ SectionModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.0.2", ngImport: i0, type: SectionModule, declarations: [SectionComponent], imports: [CommonModule,
1210
+ DragDropModule,
1211
+ PepButtonModule,
1212
+ PepRemoteLoaderModule,
1213
+ SectionBlockModule,
1214
+ PepHideInModule,
1215
+ PepDraggableItemsModule], exports: [SectionComponent] });
1216
+ SectionModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: SectionModule, imports: [CommonModule,
1217
+ DragDropModule,
1218
+ PepButtonModule,
1219
+ PepRemoteLoaderModule,
1220
+ SectionBlockModule,
1221
+ PepHideInModule,
1222
+ PepDraggableItemsModule] });
1223
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: SectionModule, decorators: [{
1224
+ type: NgModule,
1225
+ args: [{
1226
+ declarations: [SectionComponent],
1227
+ imports: [
1228
+ CommonModule,
1229
+ DragDropModule,
1230
+ PepButtonModule,
1231
+ PepRemoteLoaderModule,
1232
+ SectionBlockModule,
1233
+ PepHideInModule,
1234
+ PepDraggableItemsModule,
1235
+ // TranslateModule.forChild()
1236
+ ],
1237
+ exports: [SectionComponent]
1238
+ }]
1239
+ }] });
1240
+
1241
+ class PepLayoutComponent extends BaseDestroyerDirective {
1242
+ constructor(customizationService, layoutService, layoutBuilderService, hostElement, renderer) {
1243
+ super();
1244
+ this.customizationService = customizationService;
1245
+ this.layoutService = layoutService;
1246
+ this.layoutBuilderService = layoutBuilderService;
1247
+ this.hostElement = hostElement;
1248
+ this.renderer = renderer;
1249
+ this.blockTemplate = undefined;
1250
+ this._showSkeleton = false;
1251
+ this.layoutViewChange = new EventEmitter();
1252
+ this.screenTypeChange = new EventEmitter();
1253
+ this._horizontalSpacing = 'md';
1254
+ this._verticalSpacing = 'md';
1255
+ this.paddingInline = '1rem';
1256
+ this.previewMode = false;
1257
+ this._sectionsSubject = new BehaviorSubject([]);
1258
+ this.renderer.addClass(this.hostElement.nativeElement, 'pep-layout');
1259
+ }
1260
+ set layoutView(value) {
1261
+ this._layoutView = value;
1262
+ this.layoutBuilderService.loadLayoutBuilder(value);
1263
+ }
1264
+ get layoutView() {
1265
+ return this._layoutView;
1266
+ }
1267
+ set showSkeleton(value) {
1268
+ this._showSkeleton = value;
1269
+ this.layoutBuilderService.showSkeleton(value);
1270
+ }
1271
+ get showSkeleton() {
1272
+ return this._showSkeleton;
1273
+ }
1274
+ set horizontalSpacing(value) {
1275
+ this._horizontalSpacing = value;
1276
+ this.paddingInline = this.convertLayoutSizeType(value || 'md');
1277
+ }
1278
+ get horizontalSpacing() {
1279
+ return this._horizontalSpacing;
1280
+ }
1281
+ set verticalSpacing(value) {
1282
+ this._verticalSpacing = value;
1283
+ }
1284
+ get verticalSpacing() {
1285
+ return this._verticalSpacing;
1286
+ }
1287
+ get sections$() {
1288
+ return this._sectionsSubject.asObservable();
1289
+ }
1290
+ convertLayoutSizeType(size) {
1291
+ let res;
1292
+ if (size === 'lg') {
1293
+ res = '2rem';
1294
+ }
1295
+ else if (size === 'md') {
1296
+ res = '1rem';
1297
+ }
1298
+ else if (size === 'sm') {
1299
+ res = '0.5rem';
1300
+ }
1301
+ else {
1302
+ res = '0';
1303
+ }
1304
+ return res;
1305
+ }
1306
+ animateSkeleton() {
1307
+ if (this._showSkeleton) {
1308
+ // this.sectionsContainer?.nativeElement?.classList.add('out');
1309
+ this.sectionsContainer?.nativeElement?.classList.remove('in');
1310
+ this.skeletonContainer?.nativeElement?.classList.add('in');
1311
+ // this.skeletonContainer?.nativeElement?.classList.remove('out');
1312
+ }
1313
+ else {
1314
+ this.sectionsContainer?.nativeElement?.classList.add('in');
1315
+ // this.sectionsContainer?.nativeElement?.classList.remove('out');
1316
+ // this.skeletonContainer?.nativeElement?.classList.add('out');
1317
+ this.skeletonContainer?.nativeElement?.classList.remove('in');
1318
+ }
1319
+ }
1320
+ setLayoutDataProperties() {
1321
+ const layoutView = this._layoutView;
1322
+ if (layoutView) {
1323
+ if (this.sectionsContainer?.nativeElement) {
1324
+ let maxWidth = coerceNumberProperty(layoutView.Layout.MaxWidth, 0);
1325
+ const maxWidthToSet = maxWidth === 0 ? 'unset' : `${maxWidth}px`;
1326
+ this.renderer.setStyle(this.sectionsContainer.nativeElement, 'max-width', maxWidthToSet);
1327
+ }
1328
+ this.sectionsGap = layoutView.Layout.SectionsGap || 'md';
1329
+ this.columnsGap = layoutView.Layout.ColumnsGap || 'md';
1330
+ this.horizontalSpacing = layoutView.Layout.HorizontalSpacing;
1331
+ this.verticalSpacing = layoutView.Layout.VerticalSpacing;
1332
+ }
1333
+ }
1334
+ setScreentType(screenSize) {
1335
+ const screenType = this.layoutBuilderService.getScreenType(screenSize);
1336
+ this.selectedScreenType = screenType;
1337
+ this.screenTypeChange.emit(screenType);
1338
+ }
1339
+ ngOnInit() {
1340
+ /***********************************************************************************************/
1341
+ /* Internal Events - for code usage
1342
+ /***********************************************************************************************/
1343
+ if (this.layoutBuilderService.isEditMode) {
1344
+ this.layoutBuilderService.previewModeChange$.pipe(this.getDestroyer()).subscribe((previewMode) => {
1345
+ this.previewMode = previewMode;
1346
+ });
1347
+ }
1348
+ this.layoutBuilderService.sectionsChange$.pipe(this.getDestroyer()).subscribe((sections) => {
1349
+ this._sectionsSubject.next(sections);
1350
+ });
1351
+ this.layoutBuilderService.showSkeletonChange$.pipe(this.getDestroyer()).subscribe((showSkeleton) => {
1352
+ if (showSkeleton !== undefined) {
1353
+ this._showSkeleton = showSkeleton;
1354
+ this.animateSkeleton();
1355
+ }
1356
+ });
1357
+ this.layoutService.onResize$.pipe(this.getDestroyer()).subscribe((size) => {
1358
+ this.setScreentType(size);
1359
+ });
1360
+ this.layoutBuilderService.screenSizeChange$.pipe(this.getDestroyer()).subscribe((size) => {
1361
+ this.setScreentType(size);
1362
+ });
1363
+ /***********************************************************************************************/
1364
+ /* External Events - for raise to the client
1365
+ /***********************************************************************************************/
1366
+ this.layoutBuilderService.layoutViewChange$.pipe(this.getDestroyer()).subscribe((layoutView) => {
1367
+ this._layoutView = layoutView;
1368
+ this.setLayoutDataProperties();
1369
+ this.layoutViewChange.emit(this._layoutView);
1370
+ });
1371
+ }
1372
+ getSectionsTemplateRows() {
1373
+ let gridAutoRows = '';
1374
+ // let fillHeightCount = 0;
1375
+ this.sections$.pipe(this.getDestroyer()).subscribe((sections) => {
1376
+ if (sections?.length) {
1377
+ sections.forEach((sec) => {
1378
+ if (sec.FillHeight === true) {
1379
+ // fillHeightCount++;
1380
+ gridAutoRows += ' auto';
1381
+ }
1382
+ else {
1383
+ gridAutoRows += ' min-content';
1384
+ }
1385
+ });
1386
+ //if all are fill height should return 1fr for all
1387
+ //if not should return auto for fill height and min content for none
1388
+ return gridAutoRows;
1389
+ }
1390
+ else {
1391
+ return '';
1392
+ }
1393
+ });
1394
+ return gridAutoRows;
1395
+ }
1396
+ onSectionDropped(event) {
1397
+ this.layoutBuilderService.onSectionDropped(event);
1398
+ }
1399
+ onDragStart(event) {
1400
+ this.layoutBuilderService.onSectionDragStart(event);
1401
+ }
1402
+ onDragEnd(event) {
1403
+ this.layoutBuilderService.onSectionDragEnd(event);
1404
+ }
1405
+ }
1406
+ PepLayoutComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepLayoutComponent, deps: [{ token: i1$2.PepCustomizationService }, { token: i1$2.PepLayoutService }, { token: PepLayoutBuilderService }, { token: i0.ElementRef }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Component });
1407
+ PepLayoutComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.2", type: PepLayoutComponent, selector: "pep-layout", inputs: { layoutView: "layoutView", blockTemplate: "blockTemplate", showSkeleton: "showSkeleton" }, outputs: { layoutViewChange: "layoutViewChange", screenTypeChange: "screenTypeChange" }, host: { properties: { "style.padding-inline": "this.paddingInline" } }, viewQueries: [{ propertyName: "skeletonContainer", first: true, predicate: ["skeletonCont"], descendants: true, static: true }, { propertyName: "sectionsContainer", first: true, predicate: ["sectionsCont"], descendants: true, static: true }], usesInheritance: true, ngImport: i0, template: "<!-- For the top spacing -->\n<div class=\"top-spacing spacing-{{verticalSpacing}}\" ></div>\n<div #sectionsCont cdkDropListGroup class=\"sections-container gap-{{ sectionsGap }}\" [ngClass]=\"{'preview-state': previewMode }\" \n cdkDropList (cdkDropListDropped)=\"onSectionDropped($event)\" [ngStyle]=\"{'grid-auto-rows': getSectionsTemplateRows()}\"\n >\n <section *ngFor=\"let section of sections$ | async; let i=index;\" \n class=\"draggable-section \" [ngClass]=\"selectedScreenType === 'Phablet' ? 'margin-'+sectionsGap : ''\" [blockTemplate]=\"blockTemplate\"\n [key]=\"section.Key\" [name]=\"section.Name || ('LAYOUT_BUILDER.SECTION' | translate) + ' ' + (i+1)\" [split]=\"section.Split\" [height]=\"section.Height\"\n [columns]=\"section.Columns\" [collapseOnTablet]=\"section.CollapseOnTablet || false\" [hideIn]=\"section.Hide || []\" [columnsGap]=\"columnsGap\"\n >\n </section>\n</div>\n<div #skeletonCont class=\"skeleton-container \">\n <pep-skeleton-loader [rowsNumber]=\"1\" [lastRowOffset]=\"false\" rowHeightType=\"xl\" ></pep-skeleton-loader>\n <div class=\"split-skeleton-container\">\n <pep-skeleton-loader [rowsNumber]=\"1\" [lastRowOffset]=\"false\" rowHeightType=\"max\" ></pep-skeleton-loader>\n <pep-skeleton-loader [rowsNumber]=\"1\" [lastRowOffset]=\"false\" rowHeightType=\"max\" ></pep-skeleton-loader>\n </div>\n <pep-skeleton-loader [rowsNumber]=\"1\" [lastRowOffset]=\"false\" rowHeightType=\"xl\" ></pep-skeleton-loader>\n\n <pep-skeleton-loader [rowsNumber]=\"1\" [lastRowOffset]=\"false\" rowHeightType=\"max\" ></pep-skeleton-loader>\n</div>\n<!-- For the bottom spacing -->\n<div class=\"bottom-spacing spacing-{{verticalSpacing}}\"></div>\n<pep-size-detector></pep-size-detector>", styles: [":host{display:grid;grid-template-areas:\"top-spacing\" \"content\" \"bottom-spacing\";grid-template-rows:auto 1fr auto;height:100%}.top-spacing{grid-area:top-spacing}.top-spacing.spacing-none{height:0}.top-spacing.spacing-sm{height:var(--pep-spacing-sm, .5rem)}.top-spacing.spacing-md{height:var(--pep-spacing-lg, 1rem)}.top-spacing.spacing-lg{height:var(--pep-spacing-2xl, 2rem)}.bottom-spacing{grid-area:bottom-spacing}.bottom-spacing.spacing-none{height:0}.bottom-spacing.spacing-sm{height:var(--pep-spacing-sm, .5rem)}.bottom-spacing.spacing-md{height:var(--pep-spacing-lg, 1rem)}.bottom-spacing.spacing-lg{height:var(--pep-spacing-2xl, 2rem)}.skeleton-container{display:grid;grid-area:content;height:100%;gap:var(--pep-spacing-lg, 1rem);grid-template-rows:auto auto auto 1fr;opacity:0}.skeleton-container .split-skeleton-container{display:grid;height:10rem;gap:var(--pep-spacing-lg, 1rem);grid-auto-flow:column}.sections-container{z-index:11;grid-area:content;width:100%;max-width:inherit;overflow-x:unset;margin:0 auto;position:relative;display:grid;grid-row:1px;height:inherit;opacity:0}.sections-container.gap-none{gap:0}.sections-container.gap-sm{gap:var(--pep-spacing-sm, .5rem)}.sections-container.gap-md{gap:var(--pep-spacing-lg, 1rem)}.sections-container.gap-lg{gap:var(--pep-spacing-2xl, 2rem)}.sections-container .draggable-section{display:block}.sections-container.preview-state section{display:contents}@keyframes in{0%{opacity:0;transform:translateY(-80);filter:blur(20px)}to{transform:translateY(0);opacity:1;filter:blur(0)}}.in{animation-name:in;animation-direction:normal;animation-duration:1.2s;animation-fill-mode:forwards}\n"], dependencies: [{ kind: "directive", type: i3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "component", type: i4$2.PepSkeletonLoaderComponent, selector: "pep-skeleton-loader", inputs: ["rowHeightType", "rowsNumber", "lastRowOffset"] }, { kind: "component", type: i5$2.PepSizeDetectorComponent, selector: "pep-size-detector", inputs: ["showScreenSize", "useAsWebComponent"], outputs: ["sizeChange"] }, { kind: "directive", type: i4$1.CdkDropList, selector: "[cdkDropList], cdk-drop-list", inputs: ["cdkDropListConnectedTo", "cdkDropListData", "cdkDropListOrientation", "id", "cdkDropListLockAxis", "cdkDropListDisabled", "cdkDropListSortingDisabled", "cdkDropListEnterPredicate", "cdkDropListSortPredicate", "cdkDropListAutoScrollDisabled", "cdkDropListAutoScrollStep"], outputs: ["cdkDropListDropped", "cdkDropListEntered", "cdkDropListExited", "cdkDropListSorted"], exportAs: ["cdkDropList"] }, { kind: "directive", type: i4$1.CdkDropListGroup, selector: "[cdkDropListGroup]", inputs: ["cdkDropListGroupDisabled"], exportAs: ["cdkDropListGroup"] }, { kind: "component", type: SectionComponent, selector: "section", inputs: ["blockTemplate", "key", "name", "split", "height", "collapseOnTablet", "columns", "hideIn", "columnsGap"] }, { kind: "pipe", type: i3.AsyncPipe, name: "async" }, { kind: "pipe", type: i1.TranslatePipe, name: "translate" }] });
1408
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepLayoutComponent, decorators: [{
1409
+ type: Component,
1410
+ args: [{ selector: 'pep-layout', template: "<!-- For the top spacing -->\n<div class=\"top-spacing spacing-{{verticalSpacing}}\" ></div>\n<div #sectionsCont cdkDropListGroup class=\"sections-container gap-{{ sectionsGap }}\" [ngClass]=\"{'preview-state': previewMode }\" \n cdkDropList (cdkDropListDropped)=\"onSectionDropped($event)\" [ngStyle]=\"{'grid-auto-rows': getSectionsTemplateRows()}\"\n >\n <section *ngFor=\"let section of sections$ | async; let i=index;\" \n class=\"draggable-section \" [ngClass]=\"selectedScreenType === 'Phablet' ? 'margin-'+sectionsGap : ''\" [blockTemplate]=\"blockTemplate\"\n [key]=\"section.Key\" [name]=\"section.Name || ('LAYOUT_BUILDER.SECTION' | translate) + ' ' + (i+1)\" [split]=\"section.Split\" [height]=\"section.Height\"\n [columns]=\"section.Columns\" [collapseOnTablet]=\"section.CollapseOnTablet || false\" [hideIn]=\"section.Hide || []\" [columnsGap]=\"columnsGap\"\n >\n </section>\n</div>\n<div #skeletonCont class=\"skeleton-container \">\n <pep-skeleton-loader [rowsNumber]=\"1\" [lastRowOffset]=\"false\" rowHeightType=\"xl\" ></pep-skeleton-loader>\n <div class=\"split-skeleton-container\">\n <pep-skeleton-loader [rowsNumber]=\"1\" [lastRowOffset]=\"false\" rowHeightType=\"max\" ></pep-skeleton-loader>\n <pep-skeleton-loader [rowsNumber]=\"1\" [lastRowOffset]=\"false\" rowHeightType=\"max\" ></pep-skeleton-loader>\n </div>\n <pep-skeleton-loader [rowsNumber]=\"1\" [lastRowOffset]=\"false\" rowHeightType=\"xl\" ></pep-skeleton-loader>\n\n <pep-skeleton-loader [rowsNumber]=\"1\" [lastRowOffset]=\"false\" rowHeightType=\"max\" ></pep-skeleton-loader>\n</div>\n<!-- For the bottom spacing -->\n<div class=\"bottom-spacing spacing-{{verticalSpacing}}\"></div>\n<pep-size-detector></pep-size-detector>", styles: [":host{display:grid;grid-template-areas:\"top-spacing\" \"content\" \"bottom-spacing\";grid-template-rows:auto 1fr auto;height:100%}.top-spacing{grid-area:top-spacing}.top-spacing.spacing-none{height:0}.top-spacing.spacing-sm{height:var(--pep-spacing-sm, .5rem)}.top-spacing.spacing-md{height:var(--pep-spacing-lg, 1rem)}.top-spacing.spacing-lg{height:var(--pep-spacing-2xl, 2rem)}.bottom-spacing{grid-area:bottom-spacing}.bottom-spacing.spacing-none{height:0}.bottom-spacing.spacing-sm{height:var(--pep-spacing-sm, .5rem)}.bottom-spacing.spacing-md{height:var(--pep-spacing-lg, 1rem)}.bottom-spacing.spacing-lg{height:var(--pep-spacing-2xl, 2rem)}.skeleton-container{display:grid;grid-area:content;height:100%;gap:var(--pep-spacing-lg, 1rem);grid-template-rows:auto auto auto 1fr;opacity:0}.skeleton-container .split-skeleton-container{display:grid;height:10rem;gap:var(--pep-spacing-lg, 1rem);grid-auto-flow:column}.sections-container{z-index:11;grid-area:content;width:100%;max-width:inherit;overflow-x:unset;margin:0 auto;position:relative;display:grid;grid-row:1px;height:inherit;opacity:0}.sections-container.gap-none{gap:0}.sections-container.gap-sm{gap:var(--pep-spacing-sm, .5rem)}.sections-container.gap-md{gap:var(--pep-spacing-lg, 1rem)}.sections-container.gap-lg{gap:var(--pep-spacing-2xl, 2rem)}.sections-container .draggable-section{display:block}.sections-container.preview-state section{display:contents}@keyframes in{0%{opacity:0;transform:translateY(-80);filter:blur(20px)}to{transform:translateY(0);opacity:1;filter:blur(0)}}.in{animation-name:in;animation-direction:normal;animation-duration:1.2s;animation-fill-mode:forwards}\n"] }]
1411
+ }], ctorParameters: function () { return [{ type: i1$2.PepCustomizationService }, { type: i1$2.PepLayoutService }, { type: PepLayoutBuilderService }, { type: i0.ElementRef }, { type: i0.Renderer2 }]; }, propDecorators: { skeletonContainer: [{
1412
+ type: ViewChild,
1413
+ args: ['skeletonCont', { static: true }]
1414
+ }], sectionsContainer: [{
1415
+ type: ViewChild,
1416
+ args: ['sectionsCont', { static: true }]
1417
+ }], layoutView: [{
1418
+ type: Input
1419
+ }], blockTemplate: [{
1420
+ type: Input
1421
+ }], showSkeleton: [{
1422
+ type: Input
1423
+ }], layoutViewChange: [{
1424
+ type: Output
1425
+ }], screenTypeChange: [{
1426
+ type: Output
1427
+ }], paddingInline: [{
1428
+ type: HostBinding,
1429
+ args: ['style.padding-inline']
1430
+ }] } });
1431
+
1432
+ class PepLayoutModule {
1433
+ }
1434
+ PepLayoutModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepLayoutModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1435
+ PepLayoutModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.0.2", ngImport: i0, type: PepLayoutModule, declarations: [PepLayoutComponent], imports: [CommonModule,
1436
+ HttpClientModule,
1437
+ PepNgxLibModule,
1438
+ PepSkeletonLoaderModule,
1439
+ PepRemoteLoaderModule,
1440
+ PepSizeDetectorModule,
1441
+ PepDialogModule,
1442
+ DragDropModule,
1443
+ SectionModule, i1.TranslateModule], exports: [PepLayoutComponent] });
1444
+ PepLayoutModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepLayoutModule, imports: [CommonModule,
1445
+ HttpClientModule,
1446
+ PepNgxLibModule,
1447
+ PepSkeletonLoaderModule,
1448
+ PepRemoteLoaderModule,
1449
+ PepSizeDetectorModule,
1450
+ PepDialogModule,
1451
+ DragDropModule,
1452
+ SectionModule,
1453
+ TranslateModule.forChild()] });
1454
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepLayoutModule, decorators: [{
1455
+ type: NgModule,
1456
+ args: [{
1457
+ declarations: [
1458
+ PepLayoutComponent,
1459
+ ],
1460
+ imports: [
1461
+ CommonModule,
1462
+ HttpClientModule,
1463
+ PepNgxLibModule,
1464
+ PepSkeletonLoaderModule,
1465
+ PepRemoteLoaderModule,
1466
+ PepSizeDetectorModule,
1467
+ PepDialogModule,
1468
+ DragDropModule,
1469
+ SectionModule,
1470
+ TranslateModule.forChild()
1471
+ ],
1472
+ exports: [PepLayoutComponent],
1473
+ }]
1474
+ }] });
1475
+
1476
+ class SectionEditorComponent {
1477
+ constructor(translate, dialog) {
1478
+ this.translate = translate;
1479
+ this.dialog = dialog;
1480
+ this.MIN_HEIGHT = 40;
1481
+ this.sectionName = '';
1482
+ this.isAutoHeight = true;
1483
+ this.height = this.MIN_HEIGHT;
1484
+ this.hostObjectChange = new EventEmitter();
1485
+ this.collapseOnTablet = false;
1486
+ this.fillHeight = false;
1487
+ this.subSections = false;
1488
+ this.partsNumber = "2";
1489
+ this.partsNumberOptions = Array();
1490
+ this.splitOptions = Array();
1491
+ this.allSplitOptions = Array();
1492
+ this.initData();
1493
+ }
1494
+ set hostObject(value) {
1495
+ this._hostObject = value;
1496
+ this.sectionName = value.sectionName;
1497
+ this.split = value.split;
1498
+ this.isAutoHeight = !value.height || value.height === 0;
1499
+ this.height = this.isAutoHeight ? this.MIN_HEIGHT : value.height;
1500
+ this.collapseOnTablet = value.collapseOnTablet ?? false;
1501
+ this.fillHeight = value.fillHeight ?? false;
1502
+ }
1503
+ get hostObject() {
1504
+ return this._hostObject;
1505
+ }
1506
+ set split(value) {
1507
+ this._split = value;
1508
+ this.subSections = (this._split && this._split.length > 0) ? true : false;
1509
+ // Check how many parts we have.
1510
+ const arr = value?.split(' ');
1511
+ if (arr && arr.length > 1 && arr.length <= 4) {
1512
+ this.partsNumber = arr.length.toString();
1513
+ }
1514
+ else {
1515
+ this.partsNumber = "2";
1516
+ }
1517
+ this.loadSplitOptions();
1518
+ }
1519
+ get split() {
1520
+ return this._split;
1521
+ }
1522
+ initData() {
1523
+ this.partsNumberOptions = [
1524
+ { 'key': '2', 'value': '2 Parts' },
1525
+ { 'key': '3', 'value': '3 Parts' },
1526
+ { 'key': '4', 'value': '4 Parts' }
1527
+ ];
1528
+ this.allSplitOptions = [
1529
+ { 'key': '2', 'value': [
1530
+ { 'key': '1/4 3/4', 'value': '1/4-3/4' },
1531
+ { 'key': '1/3 2/3', 'value': '1/3-2/3' },
1532
+ { 'key': '1/2 1/2', 'value': '1/2-1/2' },
1533
+ { 'key': '2/3 1/3', 'value': '2/3-1/3' },
1534
+ { 'key': '3/4 1/4', 'value': '3/4-1/4' },
1535
+ ] },
1536
+ { 'key': '3', 'value': [
1537
+ { 'key': '1/3 1/3 1/3', 'value': '1/3-1/3-1/3' },
1538
+ { 'key': '1/2 1/4 1/4', 'value': '1/2-1/4-1/4' },
1539
+ { 'key': '1/4 1/2 1/4', 'value': '1/4-1/2-1/4' },
1540
+ { 'key': '1/4 1/4 1/2', 'value': '1/4-1/4-1/2' },
1541
+ ] },
1542
+ { 'key': '4', 'value': [
1543
+ { 'key': '1/4 1/4 1/4 1/4', 'value': '1/4-1/4-1/4-1/4' },
1544
+ ] }
1545
+ ];
1546
+ }
1547
+ loadSplitOptions() {
1548
+ const splitOptions = this.allSplitOptions.find((option) => option.key === this.partsNumber);
1549
+ if (splitOptions) {
1550
+ this.splitOptions = splitOptions.value;
1551
+ }
1552
+ else {
1553
+ this.splitOptions = this.allSplitOptions[0].value;
1554
+ }
1555
+ if (!this._split) {
1556
+ this._split = this.splitOptions[0].key;
1557
+ }
1558
+ }
1559
+ updateHostObject() {
1560
+ this._hostObject.sectionName = this.sectionName;
1561
+ this._hostObject.split = this.subSections ? this.split : undefined;
1562
+ this._hostObject.height = this.isAutoHeight ? 0 : this.height;
1563
+ this._hostObject.collapseOnTablet = this.collapseOnTablet;
1564
+ this._hostObject.fillHeight = this.fillHeight;
1565
+ this.hostObjectChange.emit(this.hostObject);
1566
+ }
1567
+ ngOnInit() {
1568
+ this.loadSplitOptions();
1569
+ }
1570
+ isAutoHeightChange(isChecked) {
1571
+ this.isAutoHeight = isChecked;
1572
+ this.updateHostObject();
1573
+ }
1574
+ onHeightChange(height) {
1575
+ if (height >= this.MIN_HEIGHT) {
1576
+ this.height = coerceNumberProperty(height, this.height);
1577
+ this.updateHostObject();
1578
+ }
1579
+ }
1580
+ onSectionNameChange(value) {
1581
+ this.sectionName = value;
1582
+ this.updateHostObject();
1583
+ }
1584
+ onCollapseOnTabletChange(value) {
1585
+ this.collapseOnTablet = value;
1586
+ this.updateHostObject();
1587
+ }
1588
+ onFillHeightChange(value) {
1589
+ this.fillHeight = value;
1590
+ this.updateHostObject();
1591
+ }
1592
+ onSubSectionsChange(value) {
1593
+ const oldValue = this.subSections;
1594
+ // Check if cancel the sub sections ( change from any -> 1 section ), if true need to show confirm message
1595
+ if (value === false) {
1596
+ this.subSections = value;
1597
+ this.showDeleteSectionMsg(() => {
1598
+ this.updateHostObject();
1599
+ }, () => {
1600
+ this.subSections = oldValue;
1601
+ });
1602
+ }
1603
+ else {
1604
+ this.subSections = value;
1605
+ this.updateHostObject();
1606
+ }
1607
+ }
1608
+ onPartsNumberChange(key) {
1609
+ const oldKey = this.partsNumber;
1610
+ // Check if decrease on sub sections number, if true need to show confirm message
1611
+ if (key && parseInt(key) < parseInt(this.partsNumber)) {
1612
+ this.partsNumber = key;
1613
+ this.showDeleteSectionMsg(() => {
1614
+ this.loadSplitOptions();
1615
+ this._split = this.splitOptions[0].key;
1616
+ this.updateHostObject();
1617
+ }, () => {
1618
+ this.partsNumber = oldKey;
1619
+ });
1620
+ }
1621
+ else {
1622
+ this.partsNumber = key;
1623
+ this.loadSplitOptions();
1624
+ this._split = this.splitOptions[0].key;
1625
+ this.updateHostObject();
1626
+ }
1627
+ }
1628
+ showDeleteSectionMsg(continueCB, cancelCB) {
1629
+ const actionButtons = [
1630
+ new PepDialogActionButton(this.translate.instant('ACTIONS.CANCEL'), '', () => {
1631
+ cancelCB();
1632
+ }),
1633
+ new PepDialogActionButton(this.translate.instant('ACTIONS.CONTINUE'), 'strong caution', () => {
1634
+ continueCB();
1635
+ })
1636
+ ];
1637
+ const content = this.translate.instant('LAYOUT_BUILDER.DELETE_SECTION_MSG');
1638
+ const title = this.translate.instant('LAYOUT_BUILDER.DELETE_SECTION_TITLE');
1639
+ const dataMsg = new PepDialogData({ title, actionsType: 'custom', content, actionButtons });
1640
+ this.dialog.openDefaultDialog(dataMsg);
1641
+ }
1642
+ onSplitChange(key) {
1643
+ this._split = key;
1644
+ this.updateHostObject();
1645
+ }
1646
+ }
1647
+ SectionEditorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: SectionEditorComponent, deps: [{ token: i1.TranslateService }, { token: i2.PepDialogService }], target: i0.ɵɵFactoryTarget.Component });
1648
+ SectionEditorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.2", type: SectionEditorComponent, selector: "section-editor", inputs: { hostObject: "hostObject" }, outputs: { hostObjectChange: "hostObjectChange" }, ngImport: i0, template: "<div class=\"section-editor-container layout-builder-editor-container\">\n <div>\n <pep-textbox [value]=\"sectionName\" [label]=\"'LAYOUT_BUILDER.SECTION_NAME_TITLE' | translate\" (valueChange)=\"onSectionNameChange($event)\"></pep-textbox>\n </div>\n\n <!-- \n <div>\n <pep-checkbox class=\"checkbox-as-title\" [value]=\"isAutoHeight\" [label]=\"'LAYOUT_BUILDER.AUTO_HEIGHT_TITLE' | translate\" [renderTitle]=\"false\" (valueChange)=\"isAutoHeightChange($event)\"></pep-checkbox>\n <pep-textbox [label]=\"'LAYOUT_BUILDER.HEIGHT_TITLE' | translate\" type=\"int\" [minValue]=\"MIN_HEIGHT\" [disabled]=\"isAutoHeight\" [value]=\"height\" (valueChange)=\"onHeightChange($event)\"></pep-textbox> \n </div>\n -->\n <div class=\"editor-separator\"></div>\n <div>\n <pep-checkbox class=\"checkbox-as-title\" [value]=\"subSections\" [label]=\"'LAYOUT_BUILDER.SUB_SECTION_TITLE' | translate\" [renderTitle]=\"false\" (valueChange)=\"onSubSectionsChange($event)\"></pep-checkbox>\n <div class=\"split-area\">\n <pep-select [label]=\"'LAYOUT_BUILDER.SECTIONS_TITLE' | translate\" [value]=\"partsNumber\" [options]=\"partsNumberOptions\" \n (valueChange)=\"onPartsNumberChange($event)\" [emptyOption]=\"false\" [disabled]=\"!subSections\"></pep-select>\n <pep-select [label]=\"'LAYOUT_BUILDER.SPLIT_TITLE' | translate\" [value]=\"split || ''\" [options]=\"splitOptions\"\n (valueChange)=\"onSplitChange($event)\" [emptyOption]=\"false\" [disabled]=\"!subSections\"></pep-select>\n </div>\n </div>\n <div class=\"editor-separator\"></div>\n <div>\n <pep-checkbox class=\"checkbox-as-title\" [value]=\"collapseOnTablet\" [label]=\"'LAYOUT_BUILDER.COLLAPSE_ON_TABLET_TITLE' | translate\" [renderTitle]=\"false\" (valueChange)=\"onCollapseOnTabletChange($event)\"></pep-checkbox>\n <span class=\"header-title body-xs\">{{('LAYOUT_BUILDER.COLLAPSE_ON_TABLET_DESCRIPTION' | translate)}}</span>\n </div>\n <div class=\"editor-separator\"></div>\n <div>\n <pep-checkbox class=\"checkbox-as-title\" [value]=\"fillHeight\" [label]=\"'LAYOUT_BUILDER.FILL_HEIGHT_SECTION_TITLE' | translate\" [renderTitle]=\"false\" (valueChange)=\"onFillHeightChange($event)\"></pep-checkbox>\n <span class=\"header-title body-xs\">{{('LAYOUT_BUILDER.FILL_HEIGHT_SECTION_DESCRIPTION' | translate)}}</span>\n </div>\n</div>\n", styles: [".section-editor-container .split-area{display:grid;grid-template-columns:1fr 1fr;gap:var(--pep-spacing-lg, 1rem)}\n"], dependencies: [{ kind: "component", type: i3$2.PepTextboxComponent, selector: "pep-textbox", inputs: ["key", "value", "minFractionDigits", "maxFractionDigits", "accessory", "label", "placeholder", "type", "mandatory", "disabled", "readonly", "maxFieldCharacters", "hint", "textColor", "xAlignment", "rowSpan", "minValue", "maxValue", "visible", "form", "isActive", "showTitle", "renderTitle", "renderError", "renderSymbol", "layoutType", "parentFieldKey", "regex", "regexError", "isInFocus"], outputs: ["valueChange", "keyup"] }, { kind: "component", type: i4$3.PepSelectComponent, selector: "pep-select", inputs: ["key", "value", "label", "type", "mandatory", "disabled", "readonly", "xAlignment", "rowSpan", "placeholder", "placeholderWhenDisabled", "options", "visible", "emptyOption", "form", "layoutType", "parentFieldKey", "isActive", "showTitle", "renderTitle", "typeaheadDebounceInterval", "addValueToOptionsIfNotExist"], outputs: ["valueChange"] }, { kind: "component", type: i5$3.PepCheckboxComponent, selector: "pep-checkbox", inputs: ["key", "value", "label", "type", "mandatory", "disabled", "readonly", "xAlignment", "rowSpan", "additionalValue", "form", "isActive", "showTitle", "renderTitle", "layoutType", "visible"], outputs: ["valueChange"] }, { kind: "pipe", type: i1.TranslatePipe, name: "translate" }] });
1649
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: SectionEditorComponent, decorators: [{
1650
+ type: Component,
1651
+ args: [{ selector: 'section-editor', template: "<div class=\"section-editor-container layout-builder-editor-container\">\n <div>\n <pep-textbox [value]=\"sectionName\" [label]=\"'LAYOUT_BUILDER.SECTION_NAME_TITLE' | translate\" (valueChange)=\"onSectionNameChange($event)\"></pep-textbox>\n </div>\n\n <!-- \n <div>\n <pep-checkbox class=\"checkbox-as-title\" [value]=\"isAutoHeight\" [label]=\"'LAYOUT_BUILDER.AUTO_HEIGHT_TITLE' | translate\" [renderTitle]=\"false\" (valueChange)=\"isAutoHeightChange($event)\"></pep-checkbox>\n <pep-textbox [label]=\"'LAYOUT_BUILDER.HEIGHT_TITLE' | translate\" type=\"int\" [minValue]=\"MIN_HEIGHT\" [disabled]=\"isAutoHeight\" [value]=\"height\" (valueChange)=\"onHeightChange($event)\"></pep-textbox> \n </div>\n -->\n <div class=\"editor-separator\"></div>\n <div>\n <pep-checkbox class=\"checkbox-as-title\" [value]=\"subSections\" [label]=\"'LAYOUT_BUILDER.SUB_SECTION_TITLE' | translate\" [renderTitle]=\"false\" (valueChange)=\"onSubSectionsChange($event)\"></pep-checkbox>\n <div class=\"split-area\">\n <pep-select [label]=\"'LAYOUT_BUILDER.SECTIONS_TITLE' | translate\" [value]=\"partsNumber\" [options]=\"partsNumberOptions\" \n (valueChange)=\"onPartsNumberChange($event)\" [emptyOption]=\"false\" [disabled]=\"!subSections\"></pep-select>\n <pep-select [label]=\"'LAYOUT_BUILDER.SPLIT_TITLE' | translate\" [value]=\"split || ''\" [options]=\"splitOptions\"\n (valueChange)=\"onSplitChange($event)\" [emptyOption]=\"false\" [disabled]=\"!subSections\"></pep-select>\n </div>\n </div>\n <div class=\"editor-separator\"></div>\n <div>\n <pep-checkbox class=\"checkbox-as-title\" [value]=\"collapseOnTablet\" [label]=\"'LAYOUT_BUILDER.COLLAPSE_ON_TABLET_TITLE' | translate\" [renderTitle]=\"false\" (valueChange)=\"onCollapseOnTabletChange($event)\"></pep-checkbox>\n <span class=\"header-title body-xs\">{{('LAYOUT_BUILDER.COLLAPSE_ON_TABLET_DESCRIPTION' | translate)}}</span>\n </div>\n <div class=\"editor-separator\"></div>\n <div>\n <pep-checkbox class=\"checkbox-as-title\" [value]=\"fillHeight\" [label]=\"'LAYOUT_BUILDER.FILL_HEIGHT_SECTION_TITLE' | translate\" [renderTitle]=\"false\" (valueChange)=\"onFillHeightChange($event)\"></pep-checkbox>\n <span class=\"header-title body-xs\">{{('LAYOUT_BUILDER.FILL_HEIGHT_SECTION_DESCRIPTION' | translate)}}</span>\n </div>\n</div>\n", styles: [".section-editor-container .split-area{display:grid;grid-template-columns:1fr 1fr;gap:var(--pep-spacing-lg, 1rem)}\n"] }]
1652
+ }], ctorParameters: function () { return [{ type: i1.TranslateService }, { type: i2.PepDialogService }]; }, propDecorators: { hostObject: [{
1653
+ type: Input
1654
+ }], hostObjectChange: [{
1655
+ type: Output
1656
+ }] } });
1657
+
1658
+ class SectionEditorModule {
1659
+ }
1660
+ SectionEditorModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: SectionEditorModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1661
+ SectionEditorModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.0.2", ngImport: i0, type: SectionEditorModule, declarations: [SectionEditorComponent], imports: [CommonModule,
1662
+ PepButtonModule,
1663
+ PepTextboxModule,
1664
+ PepSelectModule,
1665
+ PepCheckboxModule, i1.TranslateModule], exports: [SectionEditorComponent] });
1666
+ SectionEditorModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: SectionEditorModule, imports: [CommonModule,
1667
+ PepButtonModule,
1668
+ PepTextboxModule,
1669
+ PepSelectModule,
1670
+ PepCheckboxModule,
1671
+ TranslateModule.forChild()] });
1672
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: SectionEditorModule, decorators: [{
1673
+ type: NgModule,
1674
+ args: [{
1675
+ declarations: [SectionEditorComponent],
1676
+ imports: [
1677
+ CommonModule,
1678
+ PepButtonModule,
1679
+ PepTextboxModule,
1680
+ PepSelectModule,
1681
+ PepCheckboxModule,
1682
+ TranslateModule.forChild()
1683
+ ],
1684
+ exports: [SectionEditorComponent]
1685
+ }]
1686
+ }] });
1687
+
1688
+ class PepLayoutEditorComponent extends BaseDestroyerDirective {
1689
+ // onLoadFlowHostObject;
1690
+ // onChangeFlowHostObject;
1691
+ constructor(customizationService, layoutBuilderService, hostElement, renderer) {
1692
+ super();
1693
+ this.customizationService = customizationService;
1694
+ this.layoutBuilderService = layoutBuilderService;
1695
+ this.hostElement = hostElement;
1696
+ this.renderer = renderer;
1697
+ // @ViewChild('parametersDialogTemplate', { static: true, read: TemplateRef }) parametersDialogTemplate!: TemplateRef<any>;
1698
+ this.availableBlocksForDrag = [];
1699
+ this.hostObjectChange = new EventEmitter();
1700
+ this.horizontalSpacing = 'md';
1701
+ this.verticalSpacing = 'md';
1702
+ this.sectionsGap = 'md';
1703
+ this.columnsGap = 'md';
1704
+ this.roundedCorners = 'none';
1705
+ // protected sizesGroupButtons = Array<ISpacingOption>();
1706
+ this.availableBlocksContainerId = PepLayoutBuilderService.AVAILABLE_BLOCKS_CONTAINER_ID;
1707
+ this.sectionsColumnsDropList = [];
1708
+ this.showTopContent = false;
1709
+ this.showBottomContent = false;
1710
+ this.renderer.addClass(this.hostElement.nativeElement, 'pep-layout-editor');
1711
+ }
1712
+ set hostObject(value) {
1713
+ this._hostObject = value;
1714
+ // this.onLoadFlow = value.onLoadFlow;
1715
+ // this.onChangeFlow = value.onChangeFlow;
1716
+ this.isFullWidth = !value.maxWidth || value.maxWidth === 0;
1717
+ this.maxWidth = value.maxWidth;
1718
+ this.horizontalSpacing = this._hostObject.horizontalSpacing || 'md';
1719
+ this.verticalSpacing = this._hostObject.verticalSpacing || 'md';
1720
+ this.sectionsGap = this._hostObject.sectionsGap || 'md';
1721
+ this.columnsGap = this._hostObject.columnsGap || 'md';
1722
+ this.roundedCorners = this._hostObject.roundedCorners || 'none';
1723
+ // this.prepareFlowHostObject('load');
1724
+ // this.prepareFlowHostObject('change');
1725
+ }
1726
+ get hostObject() {
1727
+ return this._hostObject;
1728
+ }
1729
+ // private prepareFlowHostObject(pageFlowType: 'load' | 'change') {
1730
+ // const fields = {};
1731
+ // if (pageFlowType === 'load') {
1732
+ // this.onLoadFlowHostObject = {};
1733
+ // this.onLoadFlowHostObject['runFlowData'] = this.onLoadFlow;
1734
+ // this.onLoadFlowHostObject['fields'] = fields;
1735
+ // } else if (pageFlowType === 'change') {
1736
+ // this.onChangeFlowHostObject = {};
1737
+ // this.onChangeFlowHostObject['runFlowData'] = this.onChangeFlow;
1738
+ // this.onChangeFlowHostObject['fields'] = fields;
1739
+ // }
1740
+ // }
1741
+ updateHostObject() {
1742
+ // this._hostObject.onLoadFlow = this.onLoadFlow;
1743
+ // this._hostObject.onChangeFlow = this.onChangeFlow;
1744
+ this._hostObject.maxWidth = this.isFullWidth ? 0 : this.maxWidth;
1745
+ this._hostObject.horizontalSpacing = this.horizontalSpacing;
1746
+ this._hostObject.verticalSpacing = this.verticalSpacing;
1747
+ this._hostObject.sectionsGap = this.sectionsGap;
1748
+ this._hostObject.columnsGap = this.columnsGap;
1749
+ this._hostObject.roundedCorners = this.roundedCorners === 'none' ? undefined : this.roundedCorners;
1750
+ // this.prepareFlowHostObject('load');
1751
+ // this.prepareFlowHostObject('change');
1752
+ this.hostObjectChange.emit(this.hostObject);
1753
+ }
1754
+ ngOnInit() {
1755
+ this.layoutBuilderService.sectionsColumnsDropListChange$.subscribe((sectionsColumnsDropList) => {
1756
+ this.sectionsColumnsDropList = sectionsColumnsDropList;
1757
+ });
1758
+ }
1759
+ ngAfterViewInit() {
1760
+ if (this._topContentRef.nativeElement.children.length > 0) {
1761
+ this.showTopContent = true;
1762
+ }
1763
+ if (this._bottomContentRef.nativeElement.children.length > 0) {
1764
+ this.showBottomContent = true;
1765
+ }
1766
+ }
1767
+ onAddSectionClick(event) {
1768
+ this.layoutBuilderService.addSection();
1769
+ }
1770
+ isFullWidthChange(isChecked) {
1771
+ this.isFullWidth = isChecked;
1772
+ this.maxWidth = isChecked ? 0 : 960;
1773
+ this.updateHostObject();
1774
+ }
1775
+ onMaxWidthChange(maxWidth) {
1776
+ this.maxWidth = coerceNumberProperty(maxWidth, this.maxWidth);
1777
+ this.updateHostObject();
1778
+ }
1779
+ setColumnsHorizntalGap(key) {
1780
+ this.horizontalSpacing = key;
1781
+ this.updateHostObject();
1782
+ }
1783
+ setColumnsVerticalGap(key) {
1784
+ this.verticalSpacing = key;
1785
+ this.updateHostObject();
1786
+ }
1787
+ setSectionGap(key) {
1788
+ this.sectionsGap = key;
1789
+ this.updateHostObject();
1790
+ }
1791
+ setColumnsGap(key) {
1792
+ this.columnsGap = key;
1793
+ this.updateHostObject();
1794
+ }
1795
+ setRoundedCorners(key) {
1796
+ this.roundedCorners = key;
1797
+ this.updateHostObject();
1798
+ }
1799
+ onDragStart(event) {
1800
+ this.layoutBuilderService.onBlockDragStart(event);
1801
+ }
1802
+ onDragEnd(event) {
1803
+ this.layoutBuilderService.onBlockDragEnd(event);
1804
+ }
1805
+ }
1806
+ PepLayoutEditorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepLayoutEditorComponent, deps: [{ token: i1$2.PepCustomizationService }, { token: PepLayoutBuilderService }, { token: i0.ElementRef }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Component });
1807
+ PepLayoutEditorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.2", type: PepLayoutEditorComponent, selector: "pep-layout-editor", inputs: { availableBlocksForDrag: "availableBlocksForDrag", hostObject: "hostObject" }, outputs: { hostObjectChange: "hostObjectChange" }, viewQueries: [{ propertyName: "_topContentRef", first: true, predicate: ["topContentRef"], descendants: true, static: true }, { propertyName: "_bottomContentRef", first: true, predicate: ["bottomContentRef"], descendants: true, static: true }, { propertyName: "availableBlocksContainer", first: true, predicate: ["availableBlocksContainer"], descendants: true, read: ElementRef }], usesInheritance: true, ngImport: i0, template: "<mat-tab-group #tabGroup class=\"layout-builder-editor-tabs\" animationDuration=\"0ms\">\n <mat-tab label=\"{{'LAYOUT_BUILDER.GENERAL' | translate}}\">\n <div class=\"layout-builder-editor-tab\">\n <div #topContentRef class=\"layout-builder-editor-group\">\n <ng-content select=\"[layout-editor-top-content]\"></ng-content>\n <div *ngIf=\"showTopContent\" class=\"editor-separator\"></div>\n </div>\n <div>\n <label class=\"editor-title\">{{'LAYOUT_BUILDER.SECTIONS_TITLE' | translate}}</label>\n <pep-button class=\"add-section-button\" value=\"{{'LAYOUT_BUILDER.ADD_SECTION' | translate}}\" styleType=\"regular\" iconName=\"number_plus\" iconPosition=\"end\"\n (buttonClick)=\"onAddSectionClick($event)\"></pep-button>\n </div>\n <div class=\"editor-separator\"></div>\n <pep-draggable-items class=\"available-blocks\" [containerId]=\"availableBlocksContainerId\" [items]=\"availableBlocksForDrag\" [title]=\"'LAYOUT_BUILDER.BLOCKS_TITLE' | translate\"\n titleSizeType=\"xl\" titleType=\"with-bottom-border\" [showSearch]=\"true\" [dropAreaIds]=\"sectionsColumnsDropList\" (itemDragStarted)=\"onDragStart($event)\" (itemDragEnded)=\"onDragEnd($event)\">\n </pep-draggable-items>\n <div #bottomContentRef class=\"layout-builder-editor-group\">\n <div *ngIf=\"showBottomContent\" class=\"editor-separator\"></div>\n <ng-content select=\"[layout-editor-bottom-content]\"></ng-content>\n </div>\n </div>\n </mat-tab>\n <mat-tab label=\"{{'LAYOUT_BUILDER.DESIGN' | translate}}\">\n <div class=\"layout-builder-editor-tab\">\n <div>\n <pep-checkbox class=\"checkbox-as-title\" [value]=\"isFullWidth\" [label]=\"'LAYOUT_BUILDER.FULL_WIDTH_TITLE' | translate\" [renderTitle]=\"false\" (valueChange)=\"isFullWidthChange($event)\"></pep-checkbox>\n <pep-textbox [label]=\"'LAYOUT_BUILDER.MAX_WIDTH_TITLE' | translate\" type=\"int\" [disabled]=\"isFullWidth\" [value]=\"maxWidth.toString()\" (valueChange)=\"onMaxWidthChange($event)\"></pep-textbox>\n </div>\n <div class=\"editor-separator\"></div>\n <!-- Spacing -->\n <pep-group-buttons-settings [groupType]=\"'sizes'\" \n [header]=\"'LAYOUT_BUILDER.SPACING_TITLE' | translate\" [subHeader]=\"'LAYOUT_BUILDER.SPACING_HORIZONTAL_TITLE' | translate\"\n [btnKey]=\"horizontalSpacing.toLowerCase()\" [excludeKeys]=\"['xs','xl','2xl']\" [useNone]=\"true\"\n (btnkeyChange)=\"setColumnsHorizntalGap($event)\">\n </pep-group-buttons-settings>\n <pep-group-buttons-settings [groupType]=\"'sizes'\" \n [subHeader]=\"'LAYOUT_BUILDER.SPACING_VERTICAL_TITLE' | translate\"\n [btnKey]=\"verticalSpacing.toLowerCase()\" [excludeKeys]=\"['xs','xl','2xl']\" [useNone]=\"true\"\n (btnkeyChange)=\"setColumnsVerticalGap($event)\">\n </pep-group-buttons-settings>\n <div class=\"editor-separator\"></div>\n <!-- Gaps -->\n <pep-group-buttons-settings [groupType]=\"'sizes'\" \n [header]=\"'LAYOUT_BUILDER.GAPS_TITLE' | translate\" [subHeader]=\"'LAYOUT_BUILDER.SECTIONS_GAP_TITLE' | translate\"\n [btnKey]=\"sectionsGap?.toLowerCase()\" [excludeKeys]=\"['xs','xl','2xl']\" [useNone]=\"true\"\n (btnkeyChange)=\"setSectionGap($event)\">\n </pep-group-buttons-settings>\n <pep-group-buttons-settings [groupType]=\"'sizes'\" \n [subHeader]=\"'LAYOUT_BUILDER.COLUMNS_GAP_TITLE' | translate\"\n [btnKey]=\"columnsGap.toLowerCase()\" [excludeKeys]=\"['xs','xl','2xl']\" [useNone]=\"true\"\n (btnkeyChange)=\"setColumnsGap($event)\">\n </pep-group-buttons-settings>\n <!-- Rounded Corners -->\n <!--\n <div class=\"editor-separator\"></div>\n <label class=\"editor-title\">{{'LAYOUT_BUILDER.ROUNDED_CORNERS_TITLE' | translate}}</label><br>\n <label class=\"body-xs ellipsis\">{{'LAYOUT_BUILDER.BORDER_RADIUS_TITLE' | translate}}</label>\n <pep-group-buttons [buttons]=\"sizesGroupButtons\" [selectedButtonKey]=\"roundedCorners\" buttonsClass=\"ms regular\" viewType=\"toggle\"\n (buttonClick)=\"setRoundedCorners($event)\"></pep-group-buttons> -->\n </div>\n </mat-tab>\n</mat-tab-group>\n\n\n\n", styles: [":host pep-draggable-items ::ng-deep .draggable-items-overflow{padding-bottom:0!important}\n"], dependencies: [{ kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i3$2.PepTextboxComponent, selector: "pep-textbox", inputs: ["key", "value", "minFractionDigits", "maxFractionDigits", "accessory", "label", "placeholder", "type", "mandatory", "disabled", "readonly", "maxFieldCharacters", "hint", "textColor", "xAlignment", "rowSpan", "minValue", "maxValue", "visible", "form", "isActive", "showTitle", "renderTitle", "renderError", "renderSymbol", "layoutType", "parentFieldKey", "regex", "regexError", "isInFocus"], outputs: ["valueChange", "keyup"] }, { kind: "component", type: i5$4.MatTabGroup, selector: "mat-tab-group", inputs: ["color", "disableRipple"], exportAs: ["matTabGroup"] }, { kind: "component", type: i5$4.MatTab, selector: "mat-tab", inputs: ["disabled", "label", "aria-label", "aria-labelledby", "labelClass", "bodyClass"], exportAs: ["matTab"] }, { kind: "component", type: i6.PepButtonComponent, selector: "pep-button", inputs: ["key", "value", "styleType", "styleStateType", "sizeType", "classNames", "disabled", "iconName", "iconPosition", "visible"], outputs: ["buttonClick"] }, { kind: "component", type: i5$3.PepCheckboxComponent, selector: "pep-checkbox", inputs: ["key", "value", "label", "type", "mandatory", "disabled", "readonly", "xAlignment", "rowSpan", "additionalValue", "form", "isActive", "showTitle", "renderTitle", "layoutType", "visible"], outputs: ["valueChange"] }, { kind: "component", type: i8.GroupButtonsSettingsComponent, selector: "pep-group-buttons-settings", inputs: ["header", "subHeader", "groupType", "btnsArray", "excludeKeys", "useNone", "disabled", "dir", "titleSize", "bold", "btnKey"], outputs: ["btnkeyChange"] }, { kind: "component", type: i5$1.PepDraggableItemsComponent, selector: "pep-draggable-items", inputs: ["containerId", "showSearch", "title", "titleType", "titleSizeType", "itemPlaceholderType", "dropAreaIds", "items"], outputs: ["itemDragStarted", "itemDragEnded"] }, { kind: "pipe", type: i1.TranslatePipe, name: "translate" }] });
1808
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepLayoutEditorComponent, decorators: [{
1809
+ type: Component,
1810
+ args: [{ selector: 'pep-layout-editor', template: "<mat-tab-group #tabGroup class=\"layout-builder-editor-tabs\" animationDuration=\"0ms\">\n <mat-tab label=\"{{'LAYOUT_BUILDER.GENERAL' | translate}}\">\n <div class=\"layout-builder-editor-tab\">\n <div #topContentRef class=\"layout-builder-editor-group\">\n <ng-content select=\"[layout-editor-top-content]\"></ng-content>\n <div *ngIf=\"showTopContent\" class=\"editor-separator\"></div>\n </div>\n <div>\n <label class=\"editor-title\">{{'LAYOUT_BUILDER.SECTIONS_TITLE' | translate}}</label>\n <pep-button class=\"add-section-button\" value=\"{{'LAYOUT_BUILDER.ADD_SECTION' | translate}}\" styleType=\"regular\" iconName=\"number_plus\" iconPosition=\"end\"\n (buttonClick)=\"onAddSectionClick($event)\"></pep-button>\n </div>\n <div class=\"editor-separator\"></div>\n <pep-draggable-items class=\"available-blocks\" [containerId]=\"availableBlocksContainerId\" [items]=\"availableBlocksForDrag\" [title]=\"'LAYOUT_BUILDER.BLOCKS_TITLE' | translate\"\n titleSizeType=\"xl\" titleType=\"with-bottom-border\" [showSearch]=\"true\" [dropAreaIds]=\"sectionsColumnsDropList\" (itemDragStarted)=\"onDragStart($event)\" (itemDragEnded)=\"onDragEnd($event)\">\n </pep-draggable-items>\n <div #bottomContentRef class=\"layout-builder-editor-group\">\n <div *ngIf=\"showBottomContent\" class=\"editor-separator\"></div>\n <ng-content select=\"[layout-editor-bottom-content]\"></ng-content>\n </div>\n </div>\n </mat-tab>\n <mat-tab label=\"{{'LAYOUT_BUILDER.DESIGN' | translate}}\">\n <div class=\"layout-builder-editor-tab\">\n <div>\n <pep-checkbox class=\"checkbox-as-title\" [value]=\"isFullWidth\" [label]=\"'LAYOUT_BUILDER.FULL_WIDTH_TITLE' | translate\" [renderTitle]=\"false\" (valueChange)=\"isFullWidthChange($event)\"></pep-checkbox>\n <pep-textbox [label]=\"'LAYOUT_BUILDER.MAX_WIDTH_TITLE' | translate\" type=\"int\" [disabled]=\"isFullWidth\" [value]=\"maxWidth.toString()\" (valueChange)=\"onMaxWidthChange($event)\"></pep-textbox>\n </div>\n <div class=\"editor-separator\"></div>\n <!-- Spacing -->\n <pep-group-buttons-settings [groupType]=\"'sizes'\" \n [header]=\"'LAYOUT_BUILDER.SPACING_TITLE' | translate\" [subHeader]=\"'LAYOUT_BUILDER.SPACING_HORIZONTAL_TITLE' | translate\"\n [btnKey]=\"horizontalSpacing.toLowerCase()\" [excludeKeys]=\"['xs','xl','2xl']\" [useNone]=\"true\"\n (btnkeyChange)=\"setColumnsHorizntalGap($event)\">\n </pep-group-buttons-settings>\n <pep-group-buttons-settings [groupType]=\"'sizes'\" \n [subHeader]=\"'LAYOUT_BUILDER.SPACING_VERTICAL_TITLE' | translate\"\n [btnKey]=\"verticalSpacing.toLowerCase()\" [excludeKeys]=\"['xs','xl','2xl']\" [useNone]=\"true\"\n (btnkeyChange)=\"setColumnsVerticalGap($event)\">\n </pep-group-buttons-settings>\n <div class=\"editor-separator\"></div>\n <!-- Gaps -->\n <pep-group-buttons-settings [groupType]=\"'sizes'\" \n [header]=\"'LAYOUT_BUILDER.GAPS_TITLE' | translate\" [subHeader]=\"'LAYOUT_BUILDER.SECTIONS_GAP_TITLE' | translate\"\n [btnKey]=\"sectionsGap?.toLowerCase()\" [excludeKeys]=\"['xs','xl','2xl']\" [useNone]=\"true\"\n (btnkeyChange)=\"setSectionGap($event)\">\n </pep-group-buttons-settings>\n <pep-group-buttons-settings [groupType]=\"'sizes'\" \n [subHeader]=\"'LAYOUT_BUILDER.COLUMNS_GAP_TITLE' | translate\"\n [btnKey]=\"columnsGap.toLowerCase()\" [excludeKeys]=\"['xs','xl','2xl']\" [useNone]=\"true\"\n (btnkeyChange)=\"setColumnsGap($event)\">\n </pep-group-buttons-settings>\n <!-- Rounded Corners -->\n <!--\n <div class=\"editor-separator\"></div>\n <label class=\"editor-title\">{{'LAYOUT_BUILDER.ROUNDED_CORNERS_TITLE' | translate}}</label><br>\n <label class=\"body-xs ellipsis\">{{'LAYOUT_BUILDER.BORDER_RADIUS_TITLE' | translate}}</label>\n <pep-group-buttons [buttons]=\"sizesGroupButtons\" [selectedButtonKey]=\"roundedCorners\" buttonsClass=\"ms regular\" viewType=\"toggle\"\n (buttonClick)=\"setRoundedCorners($event)\"></pep-group-buttons> -->\n </div>\n </mat-tab>\n</mat-tab-group>\n\n\n\n", styles: [":host pep-draggable-items ::ng-deep .draggable-items-overflow{padding-bottom:0!important}\n"] }]
1811
+ }], ctorParameters: function () { return [{ type: i1$2.PepCustomizationService }, { type: PepLayoutBuilderService }, { type: i0.ElementRef }, { type: i0.Renderer2 }]; }, propDecorators: { _topContentRef: [{
1812
+ type: ViewChild,
1813
+ args: ['topContentRef', { static: true }]
1814
+ }], _bottomContentRef: [{
1815
+ type: ViewChild,
1816
+ args: ['bottomContentRef', { static: true }]
1817
+ }], availableBlocksContainer: [{
1818
+ type: ViewChild,
1819
+ args: ['availableBlocksContainer', { read: ElementRef }]
1820
+ }], availableBlocksForDrag: [{
1821
+ type: Input
1822
+ }], hostObject: [{
1823
+ type: Input
1824
+ }], hostObjectChange: [{
1825
+ type: Output
1826
+ }] } });
1827
+
1828
+ class PepLayoutEditorModule {
1829
+ constructor() {
1830
+ // this.pepIconRegistry.registerIcons(pepIcons);
1831
+ }
1832
+ }
1833
+ PepLayoutEditorModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepLayoutEditorModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1834
+ PepLayoutEditorModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.0.2", ngImport: i0, type: PepLayoutEditorModule, declarations: [PepLayoutEditorComponent], imports: [CommonModule,
1835
+ HttpClientModule,
1836
+ PepNgxLibModule,
1837
+ PepRemoteLoaderModule,
1838
+ PepSelectModule,
1839
+ PepTextboxModule,
1840
+ DragDropModule,
1841
+ OverlayModule,
1842
+ MatTabsModule,
1843
+ PepButtonModule,
1844
+ PepCheckboxModule,
1845
+ PepGroupButtonsModule,
1846
+ PepColorModule,
1847
+ PepImageModule,
1848
+ PepGroupButtonsSettingsModule,
1849
+ PepDraggableItemsModule,
1850
+ PepDialogModule,
1851
+ MatSliderModule,
1852
+ PepTextareaModule,
1853
+ // PepManageParametersModule,
1854
+ // PepFlowPickerButtonModule,
1855
+ SectionEditorModule], exports: [PepLayoutEditorComponent] });
1856
+ PepLayoutEditorModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepLayoutEditorModule, imports: [CommonModule,
1857
+ HttpClientModule,
1858
+ PepNgxLibModule,
1859
+ PepRemoteLoaderModule,
1860
+ PepSelectModule,
1861
+ PepTextboxModule,
1862
+ DragDropModule,
1863
+ OverlayModule,
1864
+ MatTabsModule,
1865
+ PepButtonModule,
1866
+ PepCheckboxModule,
1867
+ PepGroupButtonsModule,
1868
+ PepColorModule,
1869
+ PepImageModule,
1870
+ PepGroupButtonsSettingsModule,
1871
+ PepDraggableItemsModule,
1872
+ PepDialogModule,
1873
+ MatSliderModule,
1874
+ PepTextareaModule,
1875
+ // PepManageParametersModule,
1876
+ // PepFlowPickerButtonModule,
1877
+ SectionEditorModule] });
1878
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepLayoutEditorModule, decorators: [{
1879
+ type: NgModule,
1880
+ args: [{
1881
+ declarations: [
1882
+ PepLayoutEditorComponent
1883
+ ],
1884
+ imports: [
1885
+ CommonModule,
1886
+ HttpClientModule,
1887
+ PepNgxLibModule,
1888
+ PepRemoteLoaderModule,
1889
+ PepSelectModule,
1890
+ PepTextboxModule,
1891
+ DragDropModule,
1892
+ OverlayModule,
1893
+ MatTabsModule,
1894
+ PepButtonModule,
1895
+ PepCheckboxModule,
1896
+ PepGroupButtonsModule,
1897
+ PepColorModule,
1898
+ PepImageModule,
1899
+ PepGroupButtonsSettingsModule,
1900
+ PepDraggableItemsModule,
1901
+ PepDialogModule,
1902
+ MatSliderModule,
1903
+ PepTextareaModule,
1904
+ // PepManageParametersModule,
1905
+ // PepFlowPickerButtonModule,
1906
+ SectionEditorModule,
1907
+ ],
1908
+ exports: [PepLayoutEditorComponent]
1909
+ }]
1910
+ }], ctorParameters: function () { return []; } });
1911
+
1912
+ class PepLayoutBuilderComponent extends BaseDestroyerDirective {
1913
+ constructor(renderer, hostElement, translate, layoutBuilderService, pepAddonService) {
1914
+ super();
1915
+ this.renderer = renderer;
1916
+ this.hostElement = hostElement;
1917
+ this.translate = translate;
1918
+ this.layoutBuilderService = layoutBuilderService;
1919
+ this.pepAddonService = pepAddonService;
1920
+ this._availableBlocksForDrag = [];
1921
+ this.backClick = new EventEmitter();
1922
+ this.blockEditorChange = new EventEmitter(); // blockKey
1923
+ this.blockAdded = new EventEmitter();
1924
+ this.blocksRemoved = new EventEmitter();
1925
+ this.lockScreen = false;
1926
+ this.previewMode = false;
1927
+ this.currentEditor = null;
1928
+ this.viewportWidth = 0;
1929
+ this.renderer.addClass(this.hostElement.nativeElement, 'pep-layout-builder');
1930
+ this.layoutBuilderService.isEditMode = true;
1931
+ this.pepAddonService.setShellRouterData({ showSidebar: false, addPadding: false });
1932
+ }
1933
+ set availableBlocksForDrag(value) {
1934
+ this._availableBlocksForDrag = value;
1935
+ this.layoutBuilderService.setAvailableBlocksToDrag(value);
1936
+ }
1937
+ get availableBlocksForDrag() {
1938
+ return this._availableBlocksForDrag;
1939
+ }
1940
+ setScreenWidth(screenType) {
1941
+ this.layoutBuilderService.setScreenWidth(screenType);
1942
+ }
1943
+ updateViewportWidth() {
1944
+ if (this.layoutBuilderWrapper?.nativeElement) {
1945
+ setTimeout(() => {
1946
+ this.viewportWidth = this.layoutBuilderWrapper.nativeElement.clientWidth;
1947
+ });
1948
+ }
1949
+ }
1950
+ subscribeEvents() {
1951
+ /***********************************************************************************************/
1952
+ /* Internal Events - for code usage
1953
+ /***********************************************************************************************/
1954
+ this.layoutBuilderService.previewModeChange$.pipe(this.getDestroyer()).subscribe((previewMode) => {
1955
+ this.previewMode = previewMode;
1956
+ });
1957
+ this.layoutBuilderService.lockScreenChange$.pipe(this.getDestroyer()).subscribe((lockScreen) => {
1958
+ this.lockScreen = lockScreen;
1959
+ });
1960
+ this.layoutBuilderService.screenSizeChange$.pipe(this.getDestroyer()).subscribe((size) => {
1961
+ const screenType = this.layoutBuilderService.getScreenType(size);
1962
+ this.selectedScreenType = screenType;
1963
+ });
1964
+ // For update the layout data
1965
+ this.layoutBuilderService.layoutViewChange$.pipe(this.getDestroyer()).subscribe((layoutView) => {
1966
+ if (layoutView) {
1967
+ if (this.layoutBuilderWrapper?.nativeElement) {
1968
+ let maxWidth = coerceNumberProperty(layoutView.Layout.MaxWidth, 0);
1969
+ const maxWidthToSet = maxWidth === 0 ? '100%' : `${maxWidth}px`;
1970
+ this.renderer.setStyle(this.layoutBuilderWrapper.nativeElement, 'max-width', maxWidthToSet);
1971
+ this.updateViewportWidth();
1972
+ }
1973
+ }
1974
+ });
1975
+ this.layoutBuilderService.screenWidthChange$.pipe(this.getDestroyer()).subscribe((width) => {
1976
+ if (this.layoutBuilderWrapper?.nativeElement) {
1977
+ this.renderer.setStyle(this.layoutBuilderWrapper.nativeElement, 'width', width);
1978
+ this.updateViewportWidth();
1979
+ }
1980
+ });
1981
+ // Get the sections id's into sectionsColumnsDropList for the drag & drop.
1982
+ this.layoutBuilderService.sectionsChange$.pipe(this.getDestroyer()).subscribe((sections) => {
1983
+ // Concat all results into one array.
1984
+ const sectionsColumnsDropList = [].concat(...sections.map((section) => {
1985
+ return section.Columns.map((column, index) => this.layoutBuilderService.getSectionColumnKey(section.Key, index.toString()));
1986
+ }));
1987
+ this.layoutBuilderService.notifySectionsColumnsDropListChange(sectionsColumnsDropList);
1988
+ });
1989
+ /***********************************************************************************************/
1990
+ /* External Events - for raise to the client
1991
+ /***********************************************************************************************/
1992
+ // For update editor.
1993
+ this.layoutBuilderService.editorChange$.pipe(this.getDestroyer()).subscribe((editor) => {
1994
+ if (editor) {
1995
+ // Init the side bar scroll top to 0.
1996
+ if (this.sideBarComponent) {
1997
+ const sideLayout = this.sideBarComponent.nativeElement.querySelector('.side-layout');
1998
+ sideLayout?.scrollTo(0, 0);
1999
+ }
2000
+ this.currentEditor = editor;
2001
+ // Raise event to let the user set the block editor in the UI.
2002
+ if (editor.type === 'block') {
2003
+ this.blockEditorChange.emit(editor.id);
2004
+ }
2005
+ }
2006
+ });
2007
+ this.layoutBuilderService.blockAddedEventSubject$.pipe(this.getDestroyer()).subscribe((event) => {
2008
+ if (event) {
2009
+ this.blockAdded.emit(event);
2010
+ }
2011
+ });
2012
+ this.layoutBuilderService.blocksRemovedEventSubject$.pipe(this.getDestroyer()).subscribe((event) => {
2013
+ if (event?.length > 0) {
2014
+ this.blocksRemoved.emit(event);
2015
+ }
2016
+ });
2017
+ }
2018
+ ngOnInit() {
2019
+ // Get the first translation for load all translations.
2020
+ this.translate.get('LAYOUT_BUILDER.DESKTOP').subscribe((res) => {
2021
+ this.layoutBuilderService.defaultSectionTitle = this.translate.instant('LAYOUT_BUILDER.SECTION');
2022
+ this.screenTypes = [
2023
+ { key: 'Landscape', value: this.translate.instant('LAYOUT_BUILDER.DESKTOP'), callback: () => this.setScreenWidth('Landscape'), iconName: pepIconDeviceDesktop.name, iconPosition: 'end' },
2024
+ { key: 'Tablet', value: this.translate.instant('LAYOUT_BUILDER.TABLET'), callback: () => this.setScreenWidth('Tablet'), iconName: pepIconDeviceTablet.name, iconPosition: 'end' },
2025
+ { key: 'Phablet', value: this.translate.instant('LAYOUT_BUILDER.MOBILE'), callback: () => this.setScreenWidth('Phablet'), iconName: pepIconDeviceMobile.name, iconPosition: 'end' }
2026
+ ];
2027
+ });
2028
+ this.subscribeEvents();
2029
+ }
2030
+ onResize(event) {
2031
+ this.updateViewportWidth();
2032
+ }
2033
+ togglePreviewMode() {
2034
+ this.layoutBuilderService.notifyPreviewModeChange(!this.previewMode);
2035
+ this.updateViewportWidth();
2036
+ }
2037
+ onSidebarStateChange(event) {
2038
+ this.updateViewportWidth();
2039
+ }
2040
+ onLayoutEditorObjectChange(pageEditor) {
2041
+ this.layoutBuilderService.updateLayoutFromEditor(pageEditor);
2042
+ }
2043
+ onSectionEditorObjectChange(sectionEditor) {
2044
+ this.layoutBuilderService.updateSectionFromEditor(sectionEditor);
2045
+ }
2046
+ onNavigateBackFromEditor() {
2047
+ if (!this.currentEditor || this.currentEditor?.type === 'layout-builder') {
2048
+ this.backClick.emit();
2049
+ }
2050
+ else {
2051
+ this.layoutBuilderService.navigateBackFromEditor();
2052
+ }
2053
+ }
2054
+ }
2055
+ PepLayoutBuilderComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepLayoutBuilderComponent, deps: [{ token: i0.Renderer2 }, { token: i0.ElementRef }, { token: i1.TranslateService }, { token: PepLayoutBuilderService }, { token: i1$2.PepAddonService }], target: i0.ɵɵFactoryTarget.Component });
2056
+ PepLayoutBuilderComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.2", type: PepLayoutBuilderComponent, selector: "pep-layout-builder", inputs: { availableBlocksForDrag: "availableBlocksForDrag" }, outputs: { backClick: "backClick", blockEditorChange: "blockEditorChange", blockAdded: "blockAdded", blocksRemoved: "blocksRemoved" }, host: { listeners: { "window:resize": "onResize($event)" } }, viewQueries: [{ propertyName: "layoutBuilderWrapper", first: true, predicate: ["layoutBuilderWrapper"], descendants: true, static: true }, { propertyName: "sideBarComponent", first: true, predicate: PepSideBarComponent, descendants: true, read: ElementRef }], usesInheritance: true, ngImport: i0, template: "<div *ngIf=\"lockScreen\" class=\"cdk-overlay-backdrop cdk-overlay-dark-backdrop cdk-overlay-backdrop-showing\"></div>\n\n<pep-page-layout [showShadow]=\"!previewMode && currentEditor !== null\" >\n <div pep-side-area *ngIf=\"!previewMode && currentEditor\" style=\"height: inherit;\">\n <pep-side-bar #sideBar [ignoreResize]=\"true\" (stateChange)=\"onSidebarStateChange($event)\">\n <div header-content class=\"side-bar-title\">\n <pep-button class=\"back-button\" sizeType=\"sm\" iconName=\"arrow_left_alt\" (buttonClick)=\"onNavigateBackFromEditor();\"></pep-button>\n <div class=\"title title-lg ellipsis\" [title]=\"currentEditor?.title\">\n <span>{{ currentEditor?.title }}</span>\n </div>\n </div>\n <div class=\"layout-builder-editor-wrapper\">\n <pep-layout-editor *ngIf=\"currentEditor?.type === 'layout-builder'\" [availableBlocksForDrag]=\"availableBlocksForDrag\"\n [hostObject]=\"currentEditor?.hostObject\" (hostObjectChange)=\"onLayoutEditorObjectChange($event)\"\n >\n <ng-container layout-editor-top-content>\n <ng-content select=\"[layout-editor-top-content]\"></ng-content>\n </ng-container>\n <ng-container layout-editor-bottom-content>\n <ng-content select=\"[layout-editor-bottom-content]\"></ng-content>\n </ng-container>\n </pep-layout-editor>\n \n <section-editor *ngIf=\"currentEditor?.type === 'section'\" \n [hostObject]=\"currentEditor?.hostObject\" (hostObjectChange)=\"onSectionEditorObjectChange($event)\"></section-editor>\n \n <div *ngIf=\"currentEditor?.type === 'block'\" class=\"layout-builder-editor-container\">\n <ng-content select=\"[block-editor-content]\"></ng-content>\n </div>\n </div>\n </pep-side-bar>\n </div>\n <ng-container pep-main-area>\n <div class=\"main-area-container\" [ngClass]=\"{'preview-mode': previewMode }\">\n <div class=\"header-container\" >\n <ng-container *ngIf=\"!previewMode; then editorTitleTemplate; else previewTitleTemplate\"></ng-container>\n <ng-template #editorTitleTemplate>\n <div>\n <span class=\"header-title body-xs\">{{('LAYOUT_BUILDER.VIEWPORT_WIDTH' | translate)}}:&nbsp;</span>\n <span class=\"body-xs\"><b>{{viewportWidth}}</b></span>\n </div>\n </ng-template>\n <ng-template #previewTitleTemplate>\n <div class=\"preview-title body-sm\">\n <span>{{('LAYOUT_BUILDER.PREVIEW_TITLE' | translate)}}</span>\n </div>\n </ng-template>\n\n <div class=\"header-group-btn\">\n <pep-group-buttons [buttons]=\"screenTypes\" [selectedButtonKey]=\"selectedScreenType\" sizeType=\"sm\" viewType=\"toggle\" >\n </pep-group-buttons>\n </div>\n\n <ng-container *ngIf=\"!previewMode; then editorButtonsTemplate; else previewButtonsTemplate\"></ng-container>\n <ng-template #editorButtonsTemplate>\n <div class=\"header-end\">\n <pep-button key='Preview' [value]=\"'ACTIONS.PREVIEW' | translate\" sizeType=\"sm\" classNames=\"pep-spacing-element\" (buttonClick)=\"togglePreviewMode()\"></pep-button>\n <ng-content select=\"[header-end-content]\"></ng-content>\n </div>\n </ng-template>\n <ng-template #previewButtonsTemplate>\n <a class=\"color-link body-sm\" (click)=\"togglePreviewMode()\" href=\"javascript:void(0)\">{{('LAYOUT_BUILDER.PREVIEW_CLICK_HERE' | translate)}}</a> \n </ng-template>\n </div>\n <div #layoutBuilderWrapper class=\"layout-builder-wrapper\" [ngClass]=\"{'limit-min-width': selectedScreenType === 'Landscape' }\">\n <ng-content select=\"pep-layout\"></ng-content>\n \n <div *ngIf=\"!previewMode\" class=\"backdrop\" [ngClass]=\"{'show-backdrop': currentEditor?.type === 'section' || currentEditor?.type === 'block'}\"></div>\n </div>\n </div>\n </ng-container>\n</pep-page-layout>", styles: [".side-bar-title{display:flex;padding-top:var(--pep-spacing-sm, .5rem)}.side-bar-title .back-button{margin-inline-end:var(--pep-spacing-sm, .5rem)}.side-bar-title .title{display:flex;align-items:center}.layout-builder-editor-wrapper ::ng-deep .layout-builder-editor-tabs{height:100%}.layout-builder-editor-wrapper ::ng-deep .layout-builder-editor-tabs .mat-tab-header{position:sticky;top: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:2}.layout-builder-editor-wrapper ::ng-deep .layout-builder-editor-tabs .mat-tab-header-pagination{display:none}.layout-builder-editor-wrapper ::ng-deep .layout-builder-editor-tabs .mat-tab-labels{display:grid;grid-template-columns:1fr 1fr}.layout-builder-editor-wrapper ::ng-deep .layout-builder-editor-tabs .mat-tab-labels .mat-tab-label{padding:0 var(--pep-spacing-md, .75rem)!important}.layout-builder-editor-wrapper ::ng-deep .layout-builder-editor-tabs .mat-tab-body-wrapper{overflow:unset;margin:0;display:block}.layout-builder-editor-wrapper ::ng-deep .layout-builder-editor-tabs .mat-tab-body-wrapper .mat-tab-body.mat-tab-body-active{overflow:unset}.layout-builder-editor-wrapper ::ng-deep .layout-builder-editor-tabs .mat-tab-body-wrapper .mat-tab-body.mat-tab-body-active .mat-tab-body-content{overflow:unset;display:flex;flex-direction:column;padding-inline:0!important}.layout-builder-editor-wrapper ::ng-deep .layout-builder-editor-tabs .layout-builder-editor-tab{overflow:inherit;display:inherit;flex-direction:inherit;gap:var(--pep-spacing-lg, 1rem)}.layout-builder-editor-wrapper ::ng-deep .layout-builder-editor-tabs .layout-builder-editor-tab .group-buttons-container .toggle-buttons{width:100%}.layout-builder-editor-wrapper ::ng-deep .layout-builder-editor-tabs .layout-builder-editor-tab pep-checkbox,.layout-builder-editor-wrapper ::ng-deep .layout-builder-editor-tabs .layout-builder-editor-tab pep-color,.layout-builder-editor-wrapper ::ng-deep .layout-builder-editor-tabs .layout-builder-editor-tab pep-select,.layout-builder-editor-wrapper ::ng-deep .layout-builder-editor-tabs .layout-builder-editor-tab pep-textarea,.layout-builder-editor-wrapper ::ng-deep .layout-builder-editor-tabs .layout-builder-editor-tab pep-textbox{margin-bottom:0!important}.layout-builder-editor-wrapper ::ng-deep .layout-builder-editor-container{padding-top:var(--pep-spacing-lg, 1rem);padding-bottom:var(--pep-spacing-lg, 1rem)}.layout-builder-editor-wrapper ::ng-deep .layout-builder-editor-container,.layout-builder-editor-wrapper ::ng-deep .layout-builder-editor-group{overflow:inherit;display:inherit;flex-direction:inherit;gap:var(--pep-spacing-lg, 1rem);display:flex;flex-direction:column}.layout-builder-editor-wrapper ::ng-deep .layout-builder-editor-container .group-buttons-container .toggle-buttons,.layout-builder-editor-wrapper ::ng-deep .layout-builder-editor-group .group-buttons-container .toggle-buttons{width:100%}.layout-builder-editor-wrapper ::ng-deep .layout-builder-editor-container pep-checkbox,.layout-builder-editor-wrapper ::ng-deep .layout-builder-editor-container pep-color,.layout-builder-editor-wrapper ::ng-deep .layout-builder-editor-container pep-select,.layout-builder-editor-wrapper ::ng-deep .layout-builder-editor-container pep-textarea,.layout-builder-editor-wrapper ::ng-deep .layout-builder-editor-container pep-textbox,.layout-builder-editor-wrapper ::ng-deep .layout-builder-editor-group pep-checkbox,.layout-builder-editor-wrapper ::ng-deep .layout-builder-editor-group pep-color,.layout-builder-editor-wrapper ::ng-deep .layout-builder-editor-group pep-select,.layout-builder-editor-wrapper ::ng-deep .layout-builder-editor-group pep-textarea,.layout-builder-editor-wrapper ::ng-deep .layout-builder-editor-group pep-textbox{margin-bottom:0!important}.layout-builder-editor-wrapper ::ng-deep .editor-title{display:block;font-family:var(--pep-font-family-body, Inter),-apple-system,BlinkMacSystemFont,\"Segoe UI\",Roboto,Oxygen-Sans,Ubuntu,Cantarell,\"Helvetica Neue\",sans-serif!important;font-weight:var(--pep-font-weight-bold, 600)!important;font-size:var(--pep-font-size-xl, 1.25rem)!important;line-height:var(--pep-line-height-xl, 1.5625rem)!important;text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.layout-builder-editor-wrapper ::ng-deep .editor-sub-title{display:block;font-family:var(--pep-font-family-body, Inter),-apple-system,BlinkMacSystemFont,\"Segoe UI\",Roboto,Oxygen-Sans,Ubuntu,Cantarell,\"Helvetica Neue\",sans-serif!important;font-weight:var(--pep-font-weight-normal, 400)!important;font-size:var(--pep-font-size-md, 1rem)!important;line-height:var(--pep-line-height-md, 1.25rem)!important;text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.layout-builder-editor-wrapper ::ng-deep .editor-separator{margin-top:var(--pep-spacing-lg, 1rem);border-bottom:1px solid hsla(var(--pep-color-system-primary-h, 0),var(--pep-color-system-primary-s, 0%),var(--pep-color-system-primary-l, 10%),.24)}.layout-builder-editor-wrapper ::ng-deep .checkbox-as-sub-title,.layout-builder-editor-wrapper ::ng-deep .checkbox-as-title{margin-bottom:.5rem!important;min-height:unset!important}.layout-builder-editor-wrapper ::ng-deep .checkbox-as-sub-title .pep-checkbox-container,.layout-builder-editor-wrapper ::ng-deep .checkbox-as-title .pep-checkbox-container{background:unset!important;padding-left:unset!important;padding-right:unset!important}.layout-builder-editor-wrapper ::ng-deep .checkbox-as-sub-title .pep-checkbox-container .mat-checkbox-inner-container,.layout-builder-editor-wrapper ::ng-deep .checkbox-as-title .pep-checkbox-container .mat-checkbox-inner-container{margin-left:0!important;margin-right:0!important}.layout-builder-editor-wrapper ::ng-deep .checkbox-as-sub-title .pep-checkbox-container .mat-checkbox-layout,.layout-builder-editor-wrapper ::ng-deep .checkbox-as-title .pep-checkbox-container .mat-checkbox-layout{font-family:var(--pep-font-family-body, Inter),-apple-system,BlinkMacSystemFont,\"Segoe UI\",Roboto,Oxygen-Sans,Ubuntu,Cantarell,\"Helvetica Neue\",sans-serif!important;font-weight:var(--pep-font-weight-normal, 400);font-size:var(--pep-font-size-lg, 1.125rem)!important;line-height:var(--pep-line-height-lg, 1.40625rem)!important;font-weight:var(--pep-font-weight-bold, 600)!important}.layout-builder-editor-wrapper ::ng-deep .checkbox-as-sub-title .pep-checkbox-container .mat-checkbox-layout .mat-checkbox-label span,.layout-builder-editor-wrapper ::ng-deep .checkbox-as-title .pep-checkbox-container .mat-checkbox-layout .mat-checkbox-label span{margin:0 .5rem}.layout-builder-editor-wrapper ::ng-deep .checkbox-as-sub-title .pep-checkbox-container .mat-checkbox-layout{font-family:var(--pep-font-family-body, Inter),-apple-system,BlinkMacSystemFont,\"Segoe UI\",Roboto,Oxygen-Sans,Ubuntu,Cantarell,\"Helvetica Neue\",sans-serif!important;font-weight:var(--pep-font-weight-normal, 400);font-size:var(--pep-font-size-md, 1rem)!important;line-height:var(--pep-line-height-md, 1.25rem)!important;font-weight:var(--pep-font-weight-normal, 400)!important}.main-area-container{min-height:100%;display:grid;grid-template-rows:auto 1fr}.main-area-container .header-container{display:flex;position:sticky;top:0;z-index:100;height:3rem;align-items:center;justify-content:space-between;padding:0 var(--pep-spacing-sm, .5rem)}.main-area-container .header-container .header-group-btn{display:flex;justify-content:space-around;align-items:center}.main-area-container .header-container .header-end{display:flex;justify-content:flex-end;gap:var(--pep-spacing-sm, .5rem)}.main-area-container .header-container ::ng-deep .group-buttons-container .toggle-buttons{width:16rem}.main-area-container .layout-builder-wrapper{width:100%;margin:0 auto;position:relative}.main-area-container .layout-builder-wrapper.limit-min-width{min-width:800px}.main-area-container .layout-builder-wrapper .backdrop{position:absolute;width:100%;height:100%;top:0;z-index:10;display:none}.main-area-container .layout-builder-wrapper .backdrop.show-backdrop{display:block}\n", ".layout-builder-editor-wrapper ::ng-deep .layout-builder-editor-tabs .mat-tab-header{background:hsl(var(--pep-color-system-primary-invert-h, 255),var(--pep-color-system-primary-invert-s, 100%),var(--pep-color-system-primary-invert-l, 100%))}.main-area-container{background:hsla(var(--pep-color-system-primary-h, 0),var(--pep-color-system-primary-s, 0%),var(--pep-color-system-primary-l, 10%),.04)}.main-area-container .header-container{background:hsl(var(--pep-color-system-primary-invert-h, 255),var(--pep-color-system-primary-invert-s, 100%),var(--pep-color-system-primary-invert-l, 100%));box-shadow:var(--pep-shadow-sm-offset, 0 .25rem .5rem 0) hsla(var(--pep-color-system-primary-h, 0),var(--pep-color-system-primary-s, 0%),var(--pep-color-system-primary-l, 10%),.16)}.main-area-container .header-container .header-title{color:hsla(var(--pep-color-system-primary-h, 0),var(--pep-color-system-primary-s, 0%),var(--pep-color-system-primary-l, 10%),.7)}.main-area-container .header-container .size-limit-container{background:hsla(var(--pep-color-weak-h, 0),var(--pep-color-weak-s, 0%),var(--pep-color-weak-l, 10%),.12)}.main-area-container.preview-mode .header-container{background:unset;background-color:hsl(var(--pep-color-system-caution-h, 360),var(--pep-color-system-caution-s, 100%),var(--pep-color-system-caution-l, 45%))}.main-area-container.preview-mode .header-container .preview-title,.main-area-container.preview-mode .header-container .color-link{color:hsl(var(--pep-color-system-primary-invert-h, 255),var(--pep-color-system-primary-invert-s, 100%),var(--pep-color-system-primary-invert-l, 100%))}.main-area-container.preview-mode .layout-builder-wrapper{overflow:auto}.main-area-container .layout-builder-wrapper{background:hsl(var(--pep-color-system-primary-invert-h, 255),var(--pep-color-system-primary-invert-s, 100%),var(--pep-color-system-primary-invert-l, 100%));box-shadow:var(--pep-shadow-md-offset, 0 .5rem 1rem 0) hsla(var(--pep-color-system-primary-h, 0),var(--pep-color-system-primary-s, 0%),var(--pep-color-system-primary-l, 10%),.16)}.main-area-container .layout-builder-wrapper .backdrop{background:hsla(var(--pep-color-system-primary-h, 0),var(--pep-color-system-primary-s, 0%),var(--pep-color-system-primary-l, 10%),.5)}\n"], dependencies: [{ kind: "directive", type: i3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i5$5.PepPageLayoutComponent, selector: "pep-page-layout", inputs: ["addPadding", "showShadow"] }, { kind: "component", type: i6$1.PepSideBarComponent, selector: "pep-side-bar", inputs: ["position", "ignoreResize", "showHeader", "showFooter", "showToggle", "useAsWebComponent"], outputs: ["stateChange"] }, { kind: "component", type: i6.PepButtonComponent, selector: "pep-button", inputs: ["key", "value", "styleType", "styleStateType", "sizeType", "classNames", "disabled", "iconName", "iconPosition", "visible"], outputs: ["buttonClick"] }, { kind: "component", type: i8$1.PepGroupButtonsComponent, selector: "pep-group-buttons", inputs: ["viewType", "styleType", "sizeType", "buttons", "buttonsDisabled", "supportUnselect", "selectedButtonKey", "stretch"], outputs: ["buttonClick"] }, { kind: "component", type: PepLayoutEditorComponent, selector: "pep-layout-editor", inputs: ["availableBlocksForDrag", "hostObject"], outputs: ["hostObjectChange"] }, { kind: "component", type: SectionEditorComponent, selector: "section-editor", inputs: ["hostObject"], outputs: ["hostObjectChange"] }, { kind: "pipe", type: i1.TranslatePipe, name: "translate" }] });
2057
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepLayoutBuilderComponent, decorators: [{
2058
+ type: Component,
2059
+ args: [{ selector: 'pep-layout-builder', template: "<div *ngIf=\"lockScreen\" class=\"cdk-overlay-backdrop cdk-overlay-dark-backdrop cdk-overlay-backdrop-showing\"></div>\n\n<pep-page-layout [showShadow]=\"!previewMode && currentEditor !== null\" >\n <div pep-side-area *ngIf=\"!previewMode && currentEditor\" style=\"height: inherit;\">\n <pep-side-bar #sideBar [ignoreResize]=\"true\" (stateChange)=\"onSidebarStateChange($event)\">\n <div header-content class=\"side-bar-title\">\n <pep-button class=\"back-button\" sizeType=\"sm\" iconName=\"arrow_left_alt\" (buttonClick)=\"onNavigateBackFromEditor();\"></pep-button>\n <div class=\"title title-lg ellipsis\" [title]=\"currentEditor?.title\">\n <span>{{ currentEditor?.title }}</span>\n </div>\n </div>\n <div class=\"layout-builder-editor-wrapper\">\n <pep-layout-editor *ngIf=\"currentEditor?.type === 'layout-builder'\" [availableBlocksForDrag]=\"availableBlocksForDrag\"\n [hostObject]=\"currentEditor?.hostObject\" (hostObjectChange)=\"onLayoutEditorObjectChange($event)\"\n >\n <ng-container layout-editor-top-content>\n <ng-content select=\"[layout-editor-top-content]\"></ng-content>\n </ng-container>\n <ng-container layout-editor-bottom-content>\n <ng-content select=\"[layout-editor-bottom-content]\"></ng-content>\n </ng-container>\n </pep-layout-editor>\n \n <section-editor *ngIf=\"currentEditor?.type === 'section'\" \n [hostObject]=\"currentEditor?.hostObject\" (hostObjectChange)=\"onSectionEditorObjectChange($event)\"></section-editor>\n \n <div *ngIf=\"currentEditor?.type === 'block'\" class=\"layout-builder-editor-container\">\n <ng-content select=\"[block-editor-content]\"></ng-content>\n </div>\n </div>\n </pep-side-bar>\n </div>\n <ng-container pep-main-area>\n <div class=\"main-area-container\" [ngClass]=\"{'preview-mode': previewMode }\">\n <div class=\"header-container\" >\n <ng-container *ngIf=\"!previewMode; then editorTitleTemplate; else previewTitleTemplate\"></ng-container>\n <ng-template #editorTitleTemplate>\n <div>\n <span class=\"header-title body-xs\">{{('LAYOUT_BUILDER.VIEWPORT_WIDTH' | translate)}}:&nbsp;</span>\n <span class=\"body-xs\"><b>{{viewportWidth}}</b></span>\n </div>\n </ng-template>\n <ng-template #previewTitleTemplate>\n <div class=\"preview-title body-sm\">\n <span>{{('LAYOUT_BUILDER.PREVIEW_TITLE' | translate)}}</span>\n </div>\n </ng-template>\n\n <div class=\"header-group-btn\">\n <pep-group-buttons [buttons]=\"screenTypes\" [selectedButtonKey]=\"selectedScreenType\" sizeType=\"sm\" viewType=\"toggle\" >\n </pep-group-buttons>\n </div>\n\n <ng-container *ngIf=\"!previewMode; then editorButtonsTemplate; else previewButtonsTemplate\"></ng-container>\n <ng-template #editorButtonsTemplate>\n <div class=\"header-end\">\n <pep-button key='Preview' [value]=\"'ACTIONS.PREVIEW' | translate\" sizeType=\"sm\" classNames=\"pep-spacing-element\" (buttonClick)=\"togglePreviewMode()\"></pep-button>\n <ng-content select=\"[header-end-content]\"></ng-content>\n </div>\n </ng-template>\n <ng-template #previewButtonsTemplate>\n <a class=\"color-link body-sm\" (click)=\"togglePreviewMode()\" href=\"javascript:void(0)\">{{('LAYOUT_BUILDER.PREVIEW_CLICK_HERE' | translate)}}</a> \n </ng-template>\n </div>\n <div #layoutBuilderWrapper class=\"layout-builder-wrapper\" [ngClass]=\"{'limit-min-width': selectedScreenType === 'Landscape' }\">\n <ng-content select=\"pep-layout\"></ng-content>\n \n <div *ngIf=\"!previewMode\" class=\"backdrop\" [ngClass]=\"{'show-backdrop': currentEditor?.type === 'section' || currentEditor?.type === 'block'}\"></div>\n </div>\n </div>\n </ng-container>\n</pep-page-layout>", styles: [".side-bar-title{display:flex;padding-top:var(--pep-spacing-sm, .5rem)}.side-bar-title .back-button{margin-inline-end:var(--pep-spacing-sm, .5rem)}.side-bar-title .title{display:flex;align-items:center}.layout-builder-editor-wrapper ::ng-deep .layout-builder-editor-tabs{height:100%}.layout-builder-editor-wrapper ::ng-deep .layout-builder-editor-tabs .mat-tab-header{position:sticky;top: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:2}.layout-builder-editor-wrapper ::ng-deep .layout-builder-editor-tabs .mat-tab-header-pagination{display:none}.layout-builder-editor-wrapper ::ng-deep .layout-builder-editor-tabs .mat-tab-labels{display:grid;grid-template-columns:1fr 1fr}.layout-builder-editor-wrapper ::ng-deep .layout-builder-editor-tabs .mat-tab-labels .mat-tab-label{padding:0 var(--pep-spacing-md, .75rem)!important}.layout-builder-editor-wrapper ::ng-deep .layout-builder-editor-tabs .mat-tab-body-wrapper{overflow:unset;margin:0;display:block}.layout-builder-editor-wrapper ::ng-deep .layout-builder-editor-tabs .mat-tab-body-wrapper .mat-tab-body.mat-tab-body-active{overflow:unset}.layout-builder-editor-wrapper ::ng-deep .layout-builder-editor-tabs .mat-tab-body-wrapper .mat-tab-body.mat-tab-body-active .mat-tab-body-content{overflow:unset;display:flex;flex-direction:column;padding-inline:0!important}.layout-builder-editor-wrapper ::ng-deep .layout-builder-editor-tabs .layout-builder-editor-tab{overflow:inherit;display:inherit;flex-direction:inherit;gap:var(--pep-spacing-lg, 1rem)}.layout-builder-editor-wrapper ::ng-deep .layout-builder-editor-tabs .layout-builder-editor-tab .group-buttons-container .toggle-buttons{width:100%}.layout-builder-editor-wrapper ::ng-deep .layout-builder-editor-tabs .layout-builder-editor-tab pep-checkbox,.layout-builder-editor-wrapper ::ng-deep .layout-builder-editor-tabs .layout-builder-editor-tab pep-color,.layout-builder-editor-wrapper ::ng-deep .layout-builder-editor-tabs .layout-builder-editor-tab pep-select,.layout-builder-editor-wrapper ::ng-deep .layout-builder-editor-tabs .layout-builder-editor-tab pep-textarea,.layout-builder-editor-wrapper ::ng-deep .layout-builder-editor-tabs .layout-builder-editor-tab pep-textbox{margin-bottom:0!important}.layout-builder-editor-wrapper ::ng-deep .layout-builder-editor-container{padding-top:var(--pep-spacing-lg, 1rem);padding-bottom:var(--pep-spacing-lg, 1rem)}.layout-builder-editor-wrapper ::ng-deep .layout-builder-editor-container,.layout-builder-editor-wrapper ::ng-deep .layout-builder-editor-group{overflow:inherit;display:inherit;flex-direction:inherit;gap:var(--pep-spacing-lg, 1rem);display:flex;flex-direction:column}.layout-builder-editor-wrapper ::ng-deep .layout-builder-editor-container .group-buttons-container .toggle-buttons,.layout-builder-editor-wrapper ::ng-deep .layout-builder-editor-group .group-buttons-container .toggle-buttons{width:100%}.layout-builder-editor-wrapper ::ng-deep .layout-builder-editor-container pep-checkbox,.layout-builder-editor-wrapper ::ng-deep .layout-builder-editor-container pep-color,.layout-builder-editor-wrapper ::ng-deep .layout-builder-editor-container pep-select,.layout-builder-editor-wrapper ::ng-deep .layout-builder-editor-container pep-textarea,.layout-builder-editor-wrapper ::ng-deep .layout-builder-editor-container pep-textbox,.layout-builder-editor-wrapper ::ng-deep .layout-builder-editor-group pep-checkbox,.layout-builder-editor-wrapper ::ng-deep .layout-builder-editor-group pep-color,.layout-builder-editor-wrapper ::ng-deep .layout-builder-editor-group pep-select,.layout-builder-editor-wrapper ::ng-deep .layout-builder-editor-group pep-textarea,.layout-builder-editor-wrapper ::ng-deep .layout-builder-editor-group pep-textbox{margin-bottom:0!important}.layout-builder-editor-wrapper ::ng-deep .editor-title{display:block;font-family:var(--pep-font-family-body, Inter),-apple-system,BlinkMacSystemFont,\"Segoe UI\",Roboto,Oxygen-Sans,Ubuntu,Cantarell,\"Helvetica Neue\",sans-serif!important;font-weight:var(--pep-font-weight-bold, 600)!important;font-size:var(--pep-font-size-xl, 1.25rem)!important;line-height:var(--pep-line-height-xl, 1.5625rem)!important;text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.layout-builder-editor-wrapper ::ng-deep .editor-sub-title{display:block;font-family:var(--pep-font-family-body, Inter),-apple-system,BlinkMacSystemFont,\"Segoe UI\",Roboto,Oxygen-Sans,Ubuntu,Cantarell,\"Helvetica Neue\",sans-serif!important;font-weight:var(--pep-font-weight-normal, 400)!important;font-size:var(--pep-font-size-md, 1rem)!important;line-height:var(--pep-line-height-md, 1.25rem)!important;text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.layout-builder-editor-wrapper ::ng-deep .editor-separator{margin-top:var(--pep-spacing-lg, 1rem);border-bottom:1px solid hsla(var(--pep-color-system-primary-h, 0),var(--pep-color-system-primary-s, 0%),var(--pep-color-system-primary-l, 10%),.24)}.layout-builder-editor-wrapper ::ng-deep .checkbox-as-sub-title,.layout-builder-editor-wrapper ::ng-deep .checkbox-as-title{margin-bottom:.5rem!important;min-height:unset!important}.layout-builder-editor-wrapper ::ng-deep .checkbox-as-sub-title .pep-checkbox-container,.layout-builder-editor-wrapper ::ng-deep .checkbox-as-title .pep-checkbox-container{background:unset!important;padding-left:unset!important;padding-right:unset!important}.layout-builder-editor-wrapper ::ng-deep .checkbox-as-sub-title .pep-checkbox-container .mat-checkbox-inner-container,.layout-builder-editor-wrapper ::ng-deep .checkbox-as-title .pep-checkbox-container .mat-checkbox-inner-container{margin-left:0!important;margin-right:0!important}.layout-builder-editor-wrapper ::ng-deep .checkbox-as-sub-title .pep-checkbox-container .mat-checkbox-layout,.layout-builder-editor-wrapper ::ng-deep .checkbox-as-title .pep-checkbox-container .mat-checkbox-layout{font-family:var(--pep-font-family-body, Inter),-apple-system,BlinkMacSystemFont,\"Segoe UI\",Roboto,Oxygen-Sans,Ubuntu,Cantarell,\"Helvetica Neue\",sans-serif!important;font-weight:var(--pep-font-weight-normal, 400);font-size:var(--pep-font-size-lg, 1.125rem)!important;line-height:var(--pep-line-height-lg, 1.40625rem)!important;font-weight:var(--pep-font-weight-bold, 600)!important}.layout-builder-editor-wrapper ::ng-deep .checkbox-as-sub-title .pep-checkbox-container .mat-checkbox-layout .mat-checkbox-label span,.layout-builder-editor-wrapper ::ng-deep .checkbox-as-title .pep-checkbox-container .mat-checkbox-layout .mat-checkbox-label span{margin:0 .5rem}.layout-builder-editor-wrapper ::ng-deep .checkbox-as-sub-title .pep-checkbox-container .mat-checkbox-layout{font-family:var(--pep-font-family-body, Inter),-apple-system,BlinkMacSystemFont,\"Segoe UI\",Roboto,Oxygen-Sans,Ubuntu,Cantarell,\"Helvetica Neue\",sans-serif!important;font-weight:var(--pep-font-weight-normal, 400);font-size:var(--pep-font-size-md, 1rem)!important;line-height:var(--pep-line-height-md, 1.25rem)!important;font-weight:var(--pep-font-weight-normal, 400)!important}.main-area-container{min-height:100%;display:grid;grid-template-rows:auto 1fr}.main-area-container .header-container{display:flex;position:sticky;top:0;z-index:100;height:3rem;align-items:center;justify-content:space-between;padding:0 var(--pep-spacing-sm, .5rem)}.main-area-container .header-container .header-group-btn{display:flex;justify-content:space-around;align-items:center}.main-area-container .header-container .header-end{display:flex;justify-content:flex-end;gap:var(--pep-spacing-sm, .5rem)}.main-area-container .header-container ::ng-deep .group-buttons-container .toggle-buttons{width:16rem}.main-area-container .layout-builder-wrapper{width:100%;margin:0 auto;position:relative}.main-area-container .layout-builder-wrapper.limit-min-width{min-width:800px}.main-area-container .layout-builder-wrapper .backdrop{position:absolute;width:100%;height:100%;top:0;z-index:10;display:none}.main-area-container .layout-builder-wrapper .backdrop.show-backdrop{display:block}\n", ".layout-builder-editor-wrapper ::ng-deep .layout-builder-editor-tabs .mat-tab-header{background:hsl(var(--pep-color-system-primary-invert-h, 255),var(--pep-color-system-primary-invert-s, 100%),var(--pep-color-system-primary-invert-l, 100%))}.main-area-container{background:hsla(var(--pep-color-system-primary-h, 0),var(--pep-color-system-primary-s, 0%),var(--pep-color-system-primary-l, 10%),.04)}.main-area-container .header-container{background:hsl(var(--pep-color-system-primary-invert-h, 255),var(--pep-color-system-primary-invert-s, 100%),var(--pep-color-system-primary-invert-l, 100%));box-shadow:var(--pep-shadow-sm-offset, 0 .25rem .5rem 0) hsla(var(--pep-color-system-primary-h, 0),var(--pep-color-system-primary-s, 0%),var(--pep-color-system-primary-l, 10%),.16)}.main-area-container .header-container .header-title{color:hsla(var(--pep-color-system-primary-h, 0),var(--pep-color-system-primary-s, 0%),var(--pep-color-system-primary-l, 10%),.7)}.main-area-container .header-container .size-limit-container{background:hsla(var(--pep-color-weak-h, 0),var(--pep-color-weak-s, 0%),var(--pep-color-weak-l, 10%),.12)}.main-area-container.preview-mode .header-container{background:unset;background-color:hsl(var(--pep-color-system-caution-h, 360),var(--pep-color-system-caution-s, 100%),var(--pep-color-system-caution-l, 45%))}.main-area-container.preview-mode .header-container .preview-title,.main-area-container.preview-mode .header-container .color-link{color:hsl(var(--pep-color-system-primary-invert-h, 255),var(--pep-color-system-primary-invert-s, 100%),var(--pep-color-system-primary-invert-l, 100%))}.main-area-container.preview-mode .layout-builder-wrapper{overflow:auto}.main-area-container .layout-builder-wrapper{background:hsl(var(--pep-color-system-primary-invert-h, 255),var(--pep-color-system-primary-invert-s, 100%),var(--pep-color-system-primary-invert-l, 100%));box-shadow:var(--pep-shadow-md-offset, 0 .5rem 1rem 0) hsla(var(--pep-color-system-primary-h, 0),var(--pep-color-system-primary-s, 0%),var(--pep-color-system-primary-l, 10%),.16)}.main-area-container .layout-builder-wrapper .backdrop{background:hsla(var(--pep-color-system-primary-h, 0),var(--pep-color-system-primary-s, 0%),var(--pep-color-system-primary-l, 10%),.5)}\n"] }]
2060
+ }], ctorParameters: function () { return [{ type: i0.Renderer2 }, { type: i0.ElementRef }, { type: i1.TranslateService }, { type: PepLayoutBuilderService }, { type: i1$2.PepAddonService }]; }, propDecorators: { layoutBuilderWrapper: [{
2061
+ type: ViewChild,
2062
+ args: ['layoutBuilderWrapper', { static: true }]
2063
+ }], sideBarComponent: [{
2064
+ type: ViewChild,
2065
+ args: [PepSideBarComponent, { read: ElementRef }]
2066
+ }], availableBlocksForDrag: [{
2067
+ type: Input
2068
+ }], backClick: [{
2069
+ type: Output
2070
+ }], blockEditorChange: [{
2071
+ type: Output
2072
+ }], blockAdded: [{
2073
+ type: Output
2074
+ }], blocksRemoved: [{
2075
+ type: Output
2076
+ }], onResize: [{
2077
+ type: HostListener,
2078
+ args: ['window:resize', ['$event']]
2079
+ }] } });
2080
+
2081
+ class PepLayoutBuilderModule {
2082
+ constructor(pepIconRegistry) {
2083
+ this.pepIconRegistry = pepIconRegistry;
2084
+ this.pepIconRegistry.registerIcons([
2085
+ pepIconDeviceDesktop,
2086
+ pepIconDeviceTablet,
2087
+ pepIconDeviceMobile,
2088
+ ]);
2089
+ }
2090
+ }
2091
+ PepLayoutBuilderModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepLayoutBuilderModule, deps: [{ token: i1$1.PepIconRegistry }], target: i0.ɵɵFactoryTarget.NgModule });
2092
+ PepLayoutBuilderModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.0.2", ngImport: i0, type: PepLayoutBuilderModule, declarations: [PepLayoutBuilderComponent], imports: [CommonModule,
2093
+ DragDropModule,
2094
+ // Material modules,
2095
+ MatCommonModule,
2096
+ MatTabsModule,
2097
+ // ngx-lib modules
2098
+ PepNgxLibModule,
2099
+ PepDialogModule,
2100
+ PepIconModule,
2101
+ PepPageLayoutModule,
2102
+ PepSideBarModule,
2103
+ PepButtonModule,
2104
+ PepCheckboxModule,
2105
+ PepTextboxModule,
2106
+ PepSelectModule,
2107
+ PepSizeDetectorModule,
2108
+ PepGroupButtonsModule,
2109
+ PepSkeletonLoaderModule,
2110
+ PepDraggableItemsModule,
2111
+ PepGroupButtonsSettingsModule,
2112
+ PepHideInModule,
2113
+ PepLayoutModule,
2114
+ PepLayoutEditorModule,
2115
+ SectionEditorModule], exports: [PepLayoutBuilderComponent,
2116
+ PepLayoutModule] });
2117
+ PepLayoutBuilderModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepLayoutBuilderModule, providers: [PepLayoutBuilderService], imports: [CommonModule,
2118
+ DragDropModule,
2119
+ // Material modules,
2120
+ MatCommonModule,
2121
+ MatTabsModule,
2122
+ // ngx-lib modules
2123
+ PepNgxLibModule,
2124
+ PepDialogModule,
2125
+ PepIconModule,
2126
+ PepPageLayoutModule,
2127
+ PepSideBarModule,
2128
+ PepButtonModule,
2129
+ PepCheckboxModule,
2130
+ PepTextboxModule,
2131
+ PepSelectModule,
2132
+ PepSizeDetectorModule,
2133
+ PepGroupButtonsModule,
2134
+ PepSkeletonLoaderModule,
2135
+ PepDraggableItemsModule,
2136
+ PepGroupButtonsSettingsModule,
2137
+ PepHideInModule,
2138
+ PepLayoutModule,
2139
+ PepLayoutEditorModule,
2140
+ SectionEditorModule, PepLayoutModule] });
2141
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepLayoutBuilderModule, decorators: [{
2142
+ type: NgModule,
2143
+ args: [{
2144
+ declarations: [
2145
+ PepLayoutBuilderComponent,
2146
+ ],
2147
+ imports: [
2148
+ CommonModule,
2149
+ DragDropModule,
2150
+ // Material modules,
2151
+ MatCommonModule,
2152
+ MatTabsModule,
2153
+ // ngx-lib modules
2154
+ PepNgxLibModule,
2155
+ PepDialogModule,
2156
+ PepIconModule,
2157
+ PepPageLayoutModule,
2158
+ PepSideBarModule,
2159
+ PepButtonModule,
2160
+ PepCheckboxModule,
2161
+ PepTextboxModule,
2162
+ PepSelectModule,
2163
+ PepSizeDetectorModule,
2164
+ PepGroupButtonsModule,
2165
+ PepSkeletonLoaderModule,
2166
+ PepDraggableItemsModule,
2167
+ PepGroupButtonsSettingsModule,
2168
+ PepHideInModule,
2169
+ PepLayoutModule,
2170
+ PepLayoutEditorModule,
2171
+ SectionEditorModule,
2172
+ // SectionBlockModule
2173
+ ],
2174
+ exports: [
2175
+ PepLayoutBuilderComponent,
2176
+ PepLayoutModule,
2177
+ ],
2178
+ providers: [PepLayoutBuilderService]
2179
+ }]
2180
+ }], ctorParameters: function () { return [{ type: i1$1.PepIconRegistry }]; } });
2181
+
2182
+ // export interface IBlockEditor {
2183
+ // id: string,
2184
+ // [key: string]: any
2185
+ // }
2186
+
2187
+ /*
2188
+ * Public API Surface of ngx-composite-lib/layout-builder
2189
+ */
2190
+
2191
+ /**
2192
+ * Generated bundle index. Do not edit.
2193
+ */
2194
+
2195
+ export { PepLayoutBuilderComponent, PepLayoutBuilderModule, PepLayoutBuilderService, PepLayoutComponent, PepLayoutModule };
2196
+ //# sourceMappingURL=pepperi-addons-ngx-composite-lib-layout-builder.mjs.map