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