@pepperi-addons/ngx-composite-lib 0.4.2-beta.194 → 0.4.2-beta.197

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 (79) hide show
  1. package/esm2020/color-settings/color-settings.component.mjs +1 -1
  2. package/esm2020/icon-picker/icon-picker.component.mjs +1 -1
  3. package/esm2020/layout-builder/main-editor/main-editor.component.mjs +1 -1
  4. package/esm2020/layout-builder/section-editor/section-editor.component.mjs +1 -1
  5. package/esm2020/layout-builder2/hide-in/hide-in.component.mjs +54 -0
  6. package/esm2020/layout-builder2/hide-in/hide-in.module.mjs +81 -0
  7. package/esm2020/layout-builder2/layout/layout.component.mjs +266 -0
  8. package/esm2020/layout-builder2/layout/layout.module.mjs +55 -0
  9. package/esm2020/layout-builder2/layout-builder-editor/layout-builder-editor.component.mjs +25 -0
  10. package/esm2020/layout-builder2/layout-builder-editor/layout-builder-editor.module.mjs +45 -0
  11. package/esm2020/layout-builder2/layout-builder-internal.service.mjs +639 -0
  12. package/esm2020/layout-builder2/layout-builder.component.mjs +357 -0
  13. package/esm2020/layout-builder2/layout-builder.model.mjs +2 -0
  14. package/esm2020/layout-builder2/layout-builder.module.mjs +145 -0
  15. package/esm2020/layout-builder2/layout-builder.service.mjs +49 -0
  16. package/esm2020/layout-builder2/layout-content.directive.mjs +13 -0
  17. package/esm2020/layout-builder2/main-editor/main-editor.component.mjs +170 -0
  18. package/esm2020/layout-builder2/main-editor/main-editor.module.mjs +99 -0
  19. package/esm2020/layout-builder2/pepperi-addons-ngx-composite-lib-layout-builder2.mjs +5 -0
  20. package/esm2020/layout-builder2/public-api.mjs +13 -0
  21. package/esm2020/layout-builder2/section/section.component.mjs +382 -0
  22. package/esm2020/layout-builder2/section/section.module.mjs +44 -0
  23. package/esm2020/layout-builder2/section-block/section-block.component.mjs +172 -0
  24. package/esm2020/layout-builder2/section-block/section-block.module.mjs +34 -0
  25. package/esm2020/layout-builder2/section-editor/section-editor.component.mjs +204 -0
  26. package/esm2020/layout-builder2/section-editor/section-editor.module.mjs +48 -0
  27. package/esm2020/padding-settings/padding-settings.component.mjs +1 -1
  28. package/esm2020/shadow-settings/shadow-settings.component.mjs +1 -1
  29. package/fesm2015/pepperi-addons-ngx-composite-lib-color-settings.mjs +1 -1
  30. package/fesm2015/pepperi-addons-ngx-composite-lib-color-settings.mjs.map +1 -1
  31. package/fesm2015/pepperi-addons-ngx-composite-lib-icon-picker.mjs +1 -1
  32. package/fesm2015/pepperi-addons-ngx-composite-lib-icon-picker.mjs.map +1 -1
  33. package/fesm2015/pepperi-addons-ngx-composite-lib-layout-builder.mjs +2 -2
  34. package/fesm2015/pepperi-addons-ngx-composite-lib-layout-builder.mjs.map +1 -1
  35. package/fesm2015/pepperi-addons-ngx-composite-lib-layout-builder2.mjs +2755 -0
  36. package/fesm2015/pepperi-addons-ngx-composite-lib-layout-builder2.mjs.map +1 -0
  37. package/fesm2015/pepperi-addons-ngx-composite-lib-padding-settings.mjs +1 -1
  38. package/fesm2015/pepperi-addons-ngx-composite-lib-padding-settings.mjs.map +1 -1
  39. package/fesm2015/pepperi-addons-ngx-composite-lib-shadow-settings.mjs +1 -1
  40. package/fesm2015/pepperi-addons-ngx-composite-lib-shadow-settings.mjs.map +1 -1
  41. package/fesm2020/pepperi-addons-ngx-composite-lib-color-settings.mjs +1 -1
  42. package/fesm2020/pepperi-addons-ngx-composite-lib-color-settings.mjs.map +1 -1
  43. package/fesm2020/pepperi-addons-ngx-composite-lib-icon-picker.mjs +1 -1
  44. package/fesm2020/pepperi-addons-ngx-composite-lib-icon-picker.mjs.map +1 -1
  45. package/fesm2020/pepperi-addons-ngx-composite-lib-layout-builder.mjs +2 -2
  46. package/fesm2020/pepperi-addons-ngx-composite-lib-layout-builder.mjs.map +1 -1
  47. package/fesm2020/pepperi-addons-ngx-composite-lib-layout-builder2.mjs +2717 -0
  48. package/fesm2020/pepperi-addons-ngx-composite-lib-layout-builder2.mjs.map +1 -0
  49. package/fesm2020/pepperi-addons-ngx-composite-lib-padding-settings.mjs +1 -1
  50. package/fesm2020/pepperi-addons-ngx-composite-lib-padding-settings.mjs.map +1 -1
  51. package/fesm2020/pepperi-addons-ngx-composite-lib-shadow-settings.mjs +1 -1
  52. package/fesm2020/pepperi-addons-ngx-composite-lib-shadow-settings.mjs.map +1 -1
  53. package/layout-builder2/hide-in/hide-in.component.d.ts +25 -0
  54. package/layout-builder2/hide-in/hide-in.component.theme.scss +9 -0
  55. package/layout-builder2/hide-in/hide-in.module.d.ts +20 -0
  56. package/layout-builder2/index.d.ts +5 -0
  57. package/layout-builder2/layout/layout.component.d.ts +58 -0
  58. package/layout-builder2/layout/layout.module.d.ts +16 -0
  59. package/layout-builder2/layout-builder-editor/layout-builder-editor.component.d.ts +12 -0
  60. package/layout-builder2/layout-builder-editor/layout-builder-editor.module.d.ts +14 -0
  61. package/layout-builder2/layout-builder-internal.service.d.ts +118 -0
  62. package/layout-builder2/layout-builder.component.d.ts +87 -0
  63. package/layout-builder2/layout-builder.component.theme.scss +57 -0
  64. package/layout-builder2/layout-builder.model.d.ts +43 -0
  65. package/layout-builder2/layout-builder.module.d.ts +33 -0
  66. package/layout-builder2/layout-builder.service.d.ts +24 -0
  67. package/layout-builder2/layout-content.directive.d.ts +5 -0
  68. package/layout-builder2/main-editor/main-editor.component.d.ts +52 -0
  69. package/layout-builder2/main-editor/main-editor.module.d.ts +27 -0
  70. package/layout-builder2/public-api.d.ts +9 -0
  71. package/layout-builder2/section/section.component.d.ts +86 -0
  72. package/layout-builder2/section/section.component.theme.scss +115 -0
  73. package/layout-builder2/section/section.module.d.ts +14 -0
  74. package/layout-builder2/section-block/section-block.component.d.ts +48 -0
  75. package/layout-builder2/section-block/section-block.component.theme.scss +13 -0
  76. package/layout-builder2/section-block/section-block.module.d.ts +11 -0
  77. package/layout-builder2/section-editor/section-editor.component.d.ts +56 -0
  78. package/layout-builder2/section-editor/section-editor.module.d.ts +15 -0
  79. package/package.json +10 -2
@@ -0,0 +1,2755 @@
1
+ import * as i0 from '@angular/core';
2
+ import { EventEmitter, Component, Input, Output, NgModule, Injectable, ViewChild, ViewChildren, HostBinding, Optional, SkipSelf, ElementRef, HostListener, Directive } from '@angular/core';
3
+ import * as i2 from '@angular/common';
4
+ import { CommonModule } from '@angular/common';
5
+ import * as i3$2 from '@angular/cdk/drag-drop';
6
+ import { moveItemInArray, DragDropModule } from '@angular/cdk/drag-drop';
7
+ import { MatCommonModule } from '@angular/material/core';
8
+ import * as i2$2 from '@angular/material/tabs';
9
+ import { MatTabsModule } from '@angular/material/tabs';
10
+ import * as i3$1 from '@pepperi-addons/ngx-lib';
11
+ import { PepScreenSizeType, PepGuid, BaseDestroyerDirective, PepLayoutService, PepNgxLibModule } from '@pepperi-addons/ngx-lib';
12
+ import * as i4$2 from '@pepperi-addons/ngx-lib/size-detector';
13
+ import { PepSizeDetectorModule } from '@pepperi-addons/ngx-lib/size-detector';
14
+ import * as i4$1 from '@pepperi-addons/ngx-lib/button';
15
+ import { PepButtonModule } from '@pepperi-addons/ngx-lib/button';
16
+ import * as i2$1 from '@pepperi-addons/ngx-lib/dialog';
17
+ import { PepDialogData, PepDialogService, PepDialogModule, PepDialogActionButton } from '@pepperi-addons/ngx-lib/dialog';
18
+ import * as i8 from '@pepperi-addons/ngx-lib/group-buttons';
19
+ import { PepGroupButtonsModule } from '@pepperi-addons/ngx-lib/group-buttons';
20
+ import * as i5$3 from '@pepperi-addons/ngx-lib/page-layout';
21
+ import { PepPageLayoutModule } from '@pepperi-addons/ngx-lib/page-layout';
22
+ import * as i6 from '@pepperi-addons/ngx-lib/side-bar';
23
+ import { PepSideBarComponent, PepSideBarModule } from '@pepperi-addons/ngx-lib/side-bar';
24
+ import * as i5$1 from '@pepperi-addons/ngx-lib/draggable-items';
25
+ import { PepDraggableItemsModule } from '@pepperi-addons/ngx-lib/draggable-items';
26
+ import * as i4$3 from '@pepperi-addons/ngx-lib/checkbox';
27
+ import { PepCheckboxModule } from '@pepperi-addons/ngx-lib/checkbox';
28
+ import * as i4$4 from '@pepperi-addons/ngx-lib/select';
29
+ import { PepSelectModule } from '@pepperi-addons/ngx-lib/select';
30
+ import * as i2$3 from '@pepperi-addons/ngx-lib/textbox';
31
+ import { PepTextboxModule } from '@pepperi-addons/ngx-lib/textbox';
32
+ import * as i5$2 from '@pepperi-addons/ngx-composite-lib/group-buttons-settings';
33
+ import { PepGroupButtonsSettingsModule } from '@pepperi-addons/ngx-composite-lib/group-buttons-settings';
34
+ import { __awaiter } from 'tslib';
35
+ import * as i1 from '@ngx-translate/core';
36
+ import { TranslateModule, TranslateService } from '@ngx-translate/core';
37
+ import * as i3 from '@angular/material/menu';
38
+ import { MatMenuModule } from '@angular/material/menu';
39
+ import * as i4 from '@angular/material/badge';
40
+ import { MatBadgeModule } from '@angular/material/badge';
41
+ import * as i5 from '@angular/material/checkbox';
42
+ import { MatCheckboxModule } from '@angular/material/checkbox';
43
+ import { MatButtonModule } from '@angular/material/button';
44
+ import { MatIconModule } from '@angular/material/icon';
45
+ import * as i1$1 from '@pepperi-addons/ngx-lib/icon';
46
+ import { pepIconSystemView, PepIconModule, pepIconDeviceDesktop, pepIconDeviceTablet, pepIconDeviceMobile } from '@pepperi-addons/ngx-lib/icon';
47
+ import { HttpClientModule } from '@angular/common/http';
48
+ import * as i3$3 from '@pepperi-addons/ngx-lib/skeleton-loader';
49
+ import { PepSkeletonLoaderModule } from '@pepperi-addons/ngx-lib/skeleton-loader';
50
+ import * as i7 from '@pepperi-addons/ngx-composite-lib/padding-settings';
51
+ import { PepPaddingSettings, PepPaddingSettingsModule } from '@pepperi-addons/ngx-composite-lib/padding-settings';
52
+ import { coerceNumberProperty } from '@angular/cdk/coercion';
53
+ import { BehaviorSubject } from 'rxjs';
54
+ import { distinctUntilChanged, filter } from 'rxjs/operators';
55
+ import { OverlayModule } from '@angular/cdk/overlay';
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 HideInComponent {
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
+ HideInComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: HideInComponent, deps: [{ token: i1.TranslateService }], target: i0.ɵɵFactoryTarget.Component });
95
+ HideInComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.2", type: HideInComponent, 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>{{('LAYOUT_BUILDER.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: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "component", type: i3.MatMenu, selector: "mat-menu", exportAs: ["matMenu"] }, { kind: "component", type: i3.MatMenuItem, selector: "[mat-menu-item]", inputs: ["disabled", "disableRipple", "role"], exportAs: ["matMenuItem"] }, { kind: "directive", type: i3.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: i4$1.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: HideInComponent, 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>{{('LAYOUT_BUILDER.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 HideInModule {
110
+ constructor(pepIconRegistry) {
111
+ this.pepIconRegistry = pepIconRegistry;
112
+ this.pepIconRegistry.registerIcons([
113
+ pepIconSystemView,
114
+ ]);
115
+ }
116
+ }
117
+ HideInModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: HideInModule, deps: [{ token: i1$1.PepIconRegistry }], target: i0.ɵɵFactoryTarget.NgModule });
118
+ HideInModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.0.2", ngImport: i0, type: HideInModule, declarations: [HideInComponent], imports: [CommonModule,
119
+ MatButtonModule,
120
+ MatMenuModule,
121
+ MatIconModule,
122
+ MatBadgeModule,
123
+ MatCheckboxModule,
124
+ PepButtonModule,
125
+ PepCheckboxModule,
126
+ PepIconModule, i1.TranslateModule], exports: [HideInComponent] });
127
+ HideInModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: HideInModule, 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: HideInModule, decorators: [{
147
+ type: NgModule,
148
+ args: [{
149
+ declarations: [HideInComponent],
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: [HideInComponent]
171
+ }]
172
+ }], ctorParameters: function () { return [{ type: i1$1.PepIconRegistry }]; } });
173
+
174
+ class LayoutBuilderInternalService {
175
+ // // This subject is for skeleton.
176
+ // private _showSkeletonSubject: BehaviorSubject<boolean> = new BehaviorSubject<boolean>(true);
177
+ // get showSkeletonChange$(): Observable<boolean> {
178
+ // return this._showSkeletonSubject.asObservable().pipe(distinctUntilChanged());
179
+ // }
180
+ constructor(translate, dialogService, layoutService) {
181
+ this.translate = translate;
182
+ this.dialogService = dialogService;
183
+ this.layoutService = layoutService;
184
+ this._manageGlobalCursor = true;
185
+ this._defaultSectionTitle = '';
186
+ // This configuration is for blocks behavior.
187
+ this._blocksLimitNumber = 0;
188
+ this._navigateToEditorAfterBlockAdded = false;
189
+ this._getBlockTitle = (blockKey) => { return blockKey; };
190
+ this._editorsBreadCrumb = Array();
191
+ this._editorMode = false;
192
+ this._editableState = false;
193
+ // This subject is for the screen size change events.
194
+ this._screenSizeSubject = new BehaviorSubject(undefined);
195
+ // This subject is for demostrate the container size (Usage only in edit mode).
196
+ this._screenWidthSubject = new BehaviorSubject('100%');
197
+ // This subject is for load the current editor (Usage only in edit mode).
198
+ this._editorSubject = new BehaviorSubject(null);
199
+ // This is the sections columns drop list subject.
200
+ this._sectionsColumnsDropListSubject = new BehaviorSubject([]);
201
+ // This is the sections subject (a pare from the layout view object)
202
+ this._sectionsViewSubject = new BehaviorSubject([]);
203
+ // This subject is for layout view change.
204
+ this._layoutViewSubject = new BehaviorSubject(null);
205
+ // This subject is for edit mode when block is dragging now or not.
206
+ this._draggingBlockKey = new BehaviorSubject('');
207
+ // This subject is for edit mode when section is dragging now or not.
208
+ this._draggingSectionKey = new BehaviorSubject('');
209
+ // // This subject is for lock or unlock the screen (Usage only in edit mode).
210
+ // private _lockScreenSubject: BehaviorSubject<boolean> = new BehaviorSubject<boolean>(false);
211
+ // get lockScreenChange$(): Observable<boolean> {
212
+ // return this._lockScreenSubject.asObservable().pipe(distinctUntilChanged());
213
+ // }
214
+ // This is for control the preview mode (for load the blocks with the CPI events)
215
+ this._previewModeSubject = new BehaviorSubject(false);
216
+ // This is for editor mode for block added.
217
+ this._blockAddedEventSubject = new BehaviorSubject(null);
218
+ // This is for editor mode for blocks removed.
219
+ this._blocksRemovedEventSubject = new BehaviorSubject([]);
220
+ //
221
+ this.translate.get('LAYOUT_BUILDER.SECTION').subscribe((res) => {
222
+ // Set the default section name.
223
+ this._defaultSectionTitle = res;
224
+ });
225
+ this.layoutService.onResize$.subscribe((size) => {
226
+ this.notifyScreenSizeChange(size);
227
+ });
228
+ }
229
+ setBlocksConfig(value) {
230
+ var _a;
231
+ this._blocksLimitNumber = value.blocksLimitNumber || 0;
232
+ this._navigateToEditorAfterBlockAdded = (_a = value.navigateToEditorAfterBlockAdded) !== null && _a !== void 0 ? _a : false;
233
+ this._getBlockTitle = value.getBlockTitle ? value.getBlockTitle : (blockKey) => { return blockKey; };
234
+ }
235
+ get editorMode() {
236
+ return this._editorMode;
237
+ }
238
+ setEditorMode(value) {
239
+ this._editorMode = value;
240
+ this.setEditableState();
241
+ }
242
+ get editableState() {
243
+ return this._editableState;
244
+ }
245
+ get screenSizeChange$() {
246
+ return this._screenSizeSubject.asObservable().pipe(distinctUntilChanged());
247
+ }
248
+ get screenWidthChange$() {
249
+ return this._screenWidthSubject.asObservable().pipe(distinctUntilChanged());
250
+ }
251
+ get editorChange$() {
252
+ return this._editorSubject.asObservable().pipe(distinctUntilChanged());
253
+ }
254
+ get sectionsColumnsDropListChange$() {
255
+ return this._sectionsColumnsDropListSubject.asObservable();
256
+ }
257
+ get sectionsChange$() {
258
+ return this._sectionsViewSubject.asObservable();
259
+ // (prevSections, nextSections) => JSON.stringify(prevSections) === JSON.stringify(nextSections)));
260
+ }
261
+ get layoutViewChange$() {
262
+ return this._layoutViewSubject.asObservable().pipe(filter(layout => !!layout));
263
+ }
264
+ get draggingBlockKey() {
265
+ return this._draggingBlockKey.asObservable().pipe(distinctUntilChanged());
266
+ }
267
+ get draggingSectionKey() {
268
+ return this._draggingSectionKey.asObservable().pipe(distinctUntilChanged());
269
+ }
270
+ get previewModeChange$() {
271
+ return this._previewModeSubject.asObservable().pipe(distinctUntilChanged());
272
+ }
273
+ get blockAddedEventSubject$() {
274
+ return this._blockAddedEventSubject.asObservable();
275
+ }
276
+ get blocksRemovedEventSubject$() {
277
+ return this._blocksRemovedEventSubject.asObservable();
278
+ }
279
+ setEditableState() {
280
+ this._editableState = this.editorMode && !this._previewModeSubject.getValue();
281
+ }
282
+ notifyLayoutViewChange(layoutViewToUpdate) {
283
+ if (layoutViewToUpdate) {
284
+ if (this.editorMode) {
285
+ this.updateLayoutEditorProperties(layoutViewToUpdate);
286
+ }
287
+ // Update the layout for the view.
288
+ this._layoutViewSubject.next(layoutViewToUpdate);
289
+ // Update the sections for the view.
290
+ this._sectionsViewSubject.next((layoutViewToUpdate === null || layoutViewToUpdate === void 0 ? void 0 : layoutViewToUpdate.Layout.Sections) || []);
291
+ }
292
+ }
293
+ notifyBlockAdded(blockAddedEventData) {
294
+ // Notify that the block is added (to raise the event for the client).
295
+ this._blockAddedEventSubject.next(blockAddedEventData);
296
+ }
297
+ notifyBlocksRemoved(keys) {
298
+ if (keys) {
299
+ // Notify that the blocks are removed (to raise the event for the client).
300
+ this._blocksRemovedEventSubject.next(keys);
301
+ }
302
+ }
303
+ notifyEditorChange(editor) {
304
+ this._editorSubject.next(editor);
305
+ }
306
+ notifyPreviewModeChange(value) {
307
+ this._previewModeSubject.next(value);
308
+ this.setEditableState();
309
+ }
310
+ // private notifyLockScreen(value: boolean) {
311
+ // this._lockScreenSubject.next(value);
312
+ // }
313
+ notifySectionsColumnsDropListChange(sectionsColumnsDropList) {
314
+ this._sectionsColumnsDropListSubject.next(sectionsColumnsDropList);
315
+ }
316
+ notifyScreenSizeChange(size) {
317
+ this._screenSizeSubject.next(size);
318
+ }
319
+ updateLayoutEditorProperties(layoutView) {
320
+ if (this._editorsBreadCrumb[0]) {
321
+ const layoutEditor = {
322
+ maxWidth: (layoutView === null || layoutView === void 0 ? void 0 : layoutView.Layout.MaxWidth) || 0,
323
+ verticalSpacing: layoutView === null || layoutView === void 0 ? void 0 : layoutView.Layout.VerticalSpacing,
324
+ horizontalSpacing: layoutView === null || layoutView === void 0 ? void 0 : layoutView.Layout.HorizontalSpacing,
325
+ sectionsGap: layoutView === null || layoutView === void 0 ? void 0 : layoutView.Layout.SectionsGap,
326
+ columnsGap: layoutView === null || layoutView === void 0 ? void 0 : layoutView.Layout.ColumnsGap,
327
+ // roundedCorners: layoutView?.Layout.RoundedCorners
328
+ };
329
+ this._editorsBreadCrumb[0].hostObject = layoutEditor;
330
+ }
331
+ }
332
+ loadDefaultEditor(layoutView) {
333
+ this._editorsBreadCrumb = new Array();
334
+ if (layoutView) {
335
+ this.translate.get('LAYOUT_BUILDER.DEFAULT_TITLE').subscribe((title) => {
336
+ this._editorsBreadCrumb.push({
337
+ id: LayoutBuilderInternalService.MAIN_EDITOR_ID,
338
+ type: 'layout-builder',
339
+ title: title,
340
+ // hostObject: {} // Updates in updateLayoutEditorProperties function above.
341
+ });
342
+ this.updateLayoutEditorProperties(layoutView);
343
+ this.notifyEditorChange(this._editorsBreadCrumb[0]);
344
+ });
345
+ }
346
+ else {
347
+ this.notifyEditorChange(null);
348
+ }
349
+ }
350
+ changeCurrentEditor() {
351
+ if (this._editorsBreadCrumb.length > 0) {
352
+ this.notifyEditorChange(this._editorsBreadCrumb[this._editorsBreadCrumb.length - 1]);
353
+ }
354
+ }
355
+ getEditorByType(editorType, id, title = '') {
356
+ // Build editor object.
357
+ let editor = null;
358
+ if (editorType === 'section') {
359
+ editor = this.getSectionEditor(id, title);
360
+ }
361
+ else if (editorType === 'block') {
362
+ editor = this.getBlockEditor(id, title);
363
+ }
364
+ return editor;
365
+ }
366
+ getBlockEditor(blockKey, title) {
367
+ // Get block editor title.
368
+ const blockTitle = title || this.getBlockTitle(blockKey);
369
+ return {
370
+ id: blockKey,
371
+ type: 'block',
372
+ title: blockTitle
373
+ };
374
+ }
375
+ getSectionEditorTitle(section, sectionIndex) {
376
+ return section.Name || `${this._defaultSectionTitle} ${sectionIndex + 1}`;
377
+ }
378
+ getSectionEditor(sectionId, title) {
379
+ var _a, _b;
380
+ const layoutView = this._layoutViewSubject.getValue();
381
+ const sections = (layoutView === null || layoutView === void 0 ? void 0 : layoutView.Layout.Sections) || [];
382
+ const sectionIndex = sections.findIndex(section => section.Key === sectionId);
383
+ if (sectionIndex >= 0) {
384
+ const section = sections[sectionIndex];
385
+ const sectionEditor = {
386
+ id: section.Key,
387
+ sectionName: section.Name || '',
388
+ split: section.Split || undefined,
389
+ height: section.Height || 0,
390
+ collapseOnTablet: (_a = section.CollapseOnTablet) !== null && _a !== void 0 ? _a : false,
391
+ fillHeight: (_b = section.FillHeight) !== null && _b !== void 0 ? _b : false,
392
+ padding: section.Padding || new PepPaddingSettings(true, '0')
393
+ };
394
+ return {
395
+ id: sectionId,
396
+ type: 'section',
397
+ title: title || this.getSectionEditorTitle(section, sectionIndex),
398
+ hostObject: sectionEditor
399
+ };
400
+ }
401
+ else {
402
+ return null;
403
+ }
404
+ }
405
+ getSectionColumnByIdForEditor(sectionColumnId) {
406
+ let currentColumn = null;
407
+ // Get the section and column array by the pattern of the section column key.
408
+ const sectionColumnPatternSeparator = this.getSectionColumnKey();
409
+ const sectionColumnArr = sectionColumnId.split(sectionColumnPatternSeparator);
410
+ if (sectionColumnArr.length === 2) {
411
+ const layoutView = this._layoutViewSubject.getValue();
412
+ const sections = (layoutView === null || layoutView === void 0 ? void 0 : layoutView.Layout.Sections) || [];
413
+ // Get the section id to get the section index.
414
+ const sectionId = sectionColumnArr[0];
415
+ const sectionIndex = sections.findIndex(section => section.Key === sectionId);
416
+ // Get the column index.
417
+ const columnIndex = coerceNumberProperty(sectionColumnArr[1], -1);
418
+ if (sectionIndex >= 0 && columnIndex >= 0) {
419
+ currentColumn = sections[sectionIndex].Columns[columnIndex];
420
+ }
421
+ }
422
+ return currentColumn;
423
+ }
424
+ getCssScreenWidh(screenType) {
425
+ let widthToSet = '100%';
426
+ if (screenType === 'Tablet') {
427
+ widthToSet = '720';
428
+ }
429
+ else if (screenType === 'Phablet') {
430
+ widthToSet = '360';
431
+ }
432
+ return widthToSet;
433
+ }
434
+ getBlocksNumber() {
435
+ var _a, _b;
436
+ let blocksNumber = 0;
437
+ const sections = ((_a = this._layoutViewSubject.getValue()) === null || _a === void 0 ? void 0 : _a.Layout.Sections) || [];
438
+ for (let index = 0; index < sections.length; index++) {
439
+ const section = sections[index];
440
+ for (let columnIndex = 0; columnIndex < section.Columns.length; columnIndex++) {
441
+ const column = section.Columns[columnIndex];
442
+ if (column.BlockContainer && ((_b = column.BlockContainer.BlockKey) === null || _b === void 0 ? void 0 : _b.length) > 0) {
443
+ blocksNumber++;
444
+ }
445
+ }
446
+ }
447
+ return blocksNumber;
448
+ }
449
+ changeCursorOnDragStart() {
450
+ if (this._manageGlobalCursor) {
451
+ document.body.classList.add('inheritCursors');
452
+ document.body.style.cursor = 'grabbing';
453
+ }
454
+ }
455
+ changeCursorOnDragEnd() {
456
+ if (this._manageGlobalCursor) {
457
+ document.body.classList.remove('inheritCursors');
458
+ document.body.style.cursor = 'unset';
459
+ }
460
+ }
461
+ /***********************************************************************************************/
462
+ /* Public functions
463
+ /***********************************************************************************************/
464
+ getCurrentLayoutView() {
465
+ return this._layoutViewSubject.getValue();
466
+ }
467
+ getBlockTitle(blockKey) {
468
+ return this._getBlockTitle(blockKey) || blockKey;
469
+ }
470
+ setManageGlobalCursor(value) {
471
+ this._manageGlobalCursor = value;
472
+ }
473
+ setSectionsColumnsDropListChange(sectionsColumnsDropList) {
474
+ this.notifySectionsColumnsDropListChange(sectionsColumnsDropList);
475
+ }
476
+ changePreviewMode(value) {
477
+ this.notifyPreviewModeChange(value);
478
+ }
479
+ getCurrentScreenType() {
480
+ var _a;
481
+ return this.getScreenType(((_a = this._screenSizeSubject) === null || _a === void 0 ? void 0 : _a.getValue()) || PepScreenSizeType.LG);
482
+ }
483
+ getScreenType(size) {
484
+ const screenType = size < PepScreenSizeType.MD ? 'Landscape' :
485
+ (size === PepScreenSizeType.MD || size === PepScreenSizeType.SM ? 'Tablet' : 'Phablet');
486
+ return screenType;
487
+ }
488
+ getSectionColumnKey(sectionKey = '', index = '') {
489
+ return `${sectionKey}_column_${index}`;
490
+ }
491
+ getIsHidden(hideIn, currentScreenType) {
492
+ return (hideIn && (hideIn === null || hideIn === void 0 ? void 0 : hideIn.length) > 0) ? hideIn.some(hi => hi === currentScreenType) : false;
493
+ }
494
+ navigateToEditor(editorType, id, title = '') {
495
+ let success = false;
496
+ // Cannot navigate into 'layout-builder' because this is first and const in the editorsBreadCrumbs.
497
+ if (editorType !== 'layout-builder' && (id === null || id === void 0 ? void 0 : id.length) > 0) {
498
+ // Check which editor we have now
499
+ const currentEditor = this._editorsBreadCrumb[this._editorsBreadCrumb.length - 1];
500
+ // Only if it's another editor.
501
+ if (currentEditor.id !== id) {
502
+ if (currentEditor.type !== 'layout-builder') {
503
+ // Always pop the last and insert the current.
504
+ this._editorsBreadCrumb.pop();
505
+ }
506
+ const editor = this.getEditorByType(editorType, id, title);
507
+ if (editor) {
508
+ this._editorsBreadCrumb.push(editor);
509
+ this.changeCurrentEditor();
510
+ success = true;
511
+ }
512
+ else {
513
+ success = false;
514
+ }
515
+ }
516
+ }
517
+ return success;
518
+ }
519
+ navigateBackFromEditor() {
520
+ // Keep the layout builder editor.
521
+ if (this._editorsBreadCrumb.length > 1) {
522
+ // Maybe we want to compare the last editor for validation ?
523
+ const lastEditor = this._editorsBreadCrumb.pop();
524
+ this.changeCurrentEditor();
525
+ }
526
+ }
527
+ updateLayoutFromEditor(editorData) {
528
+ const layoutView = this._layoutViewSubject.getValue();
529
+ if (layoutView) {
530
+ layoutView.Layout.MaxWidth = editorData.maxWidth;
531
+ layoutView.Layout.HorizontalSpacing = editorData.horizontalSpacing;
532
+ layoutView.Layout.VerticalSpacing = editorData.verticalSpacing;
533
+ layoutView.Layout.SectionsGap = editorData.sectionsGap;
534
+ layoutView.Layout.ColumnsGap = editorData.columnsGap;
535
+ // layoutView.Layout.RoundedCorners = editorData.roundedCorners;
536
+ this.notifyLayoutViewChange(layoutView);
537
+ }
538
+ }
539
+ updateSectionFromEditor(sectionData) {
540
+ var _a;
541
+ const layoutView = this._layoutViewSubject.getValue();
542
+ const sections = (layoutView === null || layoutView === void 0 ? void 0 : layoutView.Layout.Sections) || [];
543
+ const sectionIndex = sections.findIndex(section => section.Key === sectionData.id);
544
+ // Update section details.
545
+ if (sectionIndex >= 0) {
546
+ const blocksIdsToRemove = [];
547
+ const currentSection = sections[sectionIndex];
548
+ currentSection.Name = sectionData.sectionName;
549
+ currentSection.Split = sectionData.split;
550
+ currentSection.Height = sectionData.height;
551
+ currentSection.CollapseOnTablet = sectionData.collapseOnTablet;
552
+ currentSection.FillHeight = sectionData.fillHeight;
553
+ currentSection.Padding = sectionData.padding;
554
+ // Get the new columns number from currentSection.Split, if its undefined put a default 1.
555
+ const newColumnsLength = ((_a = currentSection.Split) === null || _a === void 0 ? void 0 : _a.split(' ').length) || 1;
556
+ if (newColumnsLength > currentSection.Columns.length) {
557
+ while (newColumnsLength > currentSection.Columns.length) {
558
+ currentSection.Columns.push({});
559
+ }
560
+ }
561
+ else if (newColumnsLength < currentSection.Columns.length) {
562
+ while (newColumnsLength < currentSection.Columns.length) {
563
+ const colunm = currentSection.Columns.pop();
564
+ // If there is block in this column delete it.
565
+ if (colunm && colunm.BlockContainer) {
566
+ blocksIdsToRemove.push(colunm.BlockContainer.BlockKey);
567
+ }
568
+ }
569
+ }
570
+ // Update editor title
571
+ const currentEditor = this._editorSubject.getValue();
572
+ if (currentEditor && currentEditor.type === 'section' && currentEditor.id === currentSection.Key) {
573
+ const title = this.getSectionEditorTitle(currentSection, sectionIndex);
574
+ currentEditor.title = title;
575
+ this.notifyEditorChange(currentEditor);
576
+ }
577
+ // Update sections change.
578
+ this.notifyLayoutViewChange(layoutView);
579
+ // If there are blocks to remove, notify the blocks removed.
580
+ if (blocksIdsToRemove.length > 0) {
581
+ this.notifyBlocksRemoved(blocksIdsToRemove);
582
+ }
583
+ }
584
+ }
585
+ addSection(section = null) {
586
+ // Create new section
587
+ if (!section) {
588
+ section = {
589
+ Key: PepGuid.newGuid(),
590
+ Columns: [{}],
591
+ Hide: []
592
+ };
593
+ }
594
+ // Add the new section to layout view.
595
+ const layoutView = this._layoutViewSubject.getValue();
596
+ const sections = (layoutView === null || layoutView === void 0 ? void 0 : layoutView.Layout.Sections) || [];
597
+ sections.push(section);
598
+ this.notifyLayoutViewChange(layoutView);
599
+ }
600
+ removeSection(sectionId) {
601
+ const layoutView = this._layoutViewSubject.getValue();
602
+ const sections = (layoutView === null || layoutView === void 0 ? void 0 : layoutView.Layout.Sections) || [];
603
+ const index = sections.findIndex(section => section.Key === sectionId);
604
+ if (index > -1) {
605
+ // Get the blocks id's to remove.
606
+ 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; });
607
+ // Remove section.
608
+ sections.splice(index, 1);
609
+ this.notifyLayoutViewChange(layoutView);
610
+ // If there are blocks to remove, notify the blocks removed.
611
+ if (blocksIdsToRemove.length > 0) {
612
+ this.notifyBlocksRemoved(blocksIdsToRemove);
613
+ }
614
+ }
615
+ }
616
+ hideSection(sectionId, hideIn) {
617
+ const layoutView = this._layoutViewSubject.getValue();
618
+ const sections = (layoutView === null || layoutView === void 0 ? void 0 : layoutView.Layout.Sections) || [];
619
+ const index = sections.findIndex(section => section.Key === sectionId);
620
+ if (index > -1) {
621
+ sections[index].Hide = hideIn;
622
+ this.notifyLayoutViewChange(layoutView);
623
+ }
624
+ }
625
+ onSectionDropped(event) {
626
+ const layoutView = this._layoutViewSubject.getValue();
627
+ const sections = (layoutView === null || layoutView === void 0 ? void 0 : layoutView.Layout.Sections) || [];
628
+ moveItemInArray(sections, event.previousIndex, event.currentIndex);
629
+ this.notifyLayoutViewChange(layoutView);
630
+ }
631
+ onSectionDragStart(event) {
632
+ this.changeCursorOnDragStart();
633
+ this._draggingSectionKey.next(event.source.data);
634
+ }
635
+ onSectionDragEnd(event) {
636
+ this.changeCursorOnDragEnd();
637
+ this._draggingSectionKey.next('');
638
+ }
639
+ removeBlockFromSection(blockId) {
640
+ let blockRemoved = false;
641
+ // Remove the block from section column.
642
+ const layoutView = this._layoutViewSubject.getValue();
643
+ const sections = (layoutView === null || layoutView === void 0 ? void 0 : layoutView.Layout.Sections) || [];
644
+ for (let sectionIndex = 0; sectionIndex < sections.length; sectionIndex++) {
645
+ const section = sections[sectionIndex];
646
+ // Remove the block container.
647
+ const columnIndex = section.Columns.findIndex(column => { var _a; return ((_a = column.BlockContainer) === null || _a === void 0 ? void 0 : _a.BlockKey) === blockId; });
648
+ if (columnIndex > -1) {
649
+ delete section.Columns[columnIndex].BlockContainer;
650
+ this.notifyLayoutViewChange(layoutView);
651
+ blockRemoved = true;
652
+ break;
653
+ }
654
+ }
655
+ // If the block was removed, notify the block removed.
656
+ if (blockRemoved) {
657
+ this.notifyBlocksRemoved([blockId]);
658
+ }
659
+ }
660
+ hideBlock(sectionId, blockId, hideIn) {
661
+ const layoutView = this._layoutViewSubject.getValue();
662
+ const sections = (layoutView === null || layoutView === void 0 ? void 0 : layoutView.Layout.Sections) || [];
663
+ const index = sections.findIndex(section => section.Key === sectionId);
664
+ if (index > -1) {
665
+ const columnIndex = sections[index].Columns.findIndex(column => { var _a; return ((_a = column.BlockContainer) === null || _a === void 0 ? void 0 : _a.BlockKey) === blockId; });
666
+ if (columnIndex > -1) {
667
+ const blockContainer = sections[index].Columns[columnIndex].BlockContainer;
668
+ if (blockContainer) {
669
+ blockContainer.Hide = hideIn;
670
+ this.notifyLayoutViewChange(layoutView);
671
+ }
672
+ }
673
+ }
674
+ }
675
+ onBlockDropped(event, sectionId) {
676
+ const layoutView = this._layoutViewSubject.getValue();
677
+ if (event.previousContainer.id === LayoutBuilderInternalService.AVAILABLE_BLOCKS_CONTAINER_ID) {
678
+ // Validate if blocks number allow.
679
+ if (this._blocksLimitNumber > 0 && this.getBlocksNumber() >= this._blocksLimitNumber) {
680
+ const data = new PepDialogData({
681
+ title: this.translate.instant('MESSAGES.DIALOG_NOTICE_TITLE'),
682
+ content: this.translate.instant('LAYOUT_BUILDER.BLOCKS_COUNT_LIMIT_MESSAGE'),
683
+ });
684
+ this.dialogService.openDefaultDialog(data);
685
+ }
686
+ else {
687
+ // Get the block relation (previousContainer.data is IPepDraggableItem and inside we have AvailableBlock object).
688
+ const draggableItem = event.previousContainer.data[event.previousIndex];
689
+ if (draggableItem) {
690
+ // lock the screen untill the editor will be loaded.
691
+ // this._lockScreenSubject.next(true);
692
+ // Get the column.
693
+ const currentColumn = this.getSectionColumnByIdForEditor(event.container.id);
694
+ // Set the block key in the section block only if there is a blank column.
695
+ if (currentColumn && !currentColumn.BlockContainer) {
696
+ // Generate the block uuid.
697
+ const blockKey = PepGuid.newGuid();
698
+ currentColumn.BlockContainer = {
699
+ BlockKey: blockKey,
700
+ };
701
+ // Here we update the layout view cause the layout is updated.
702
+ this.notifyLayoutViewChange(layoutView);
703
+ // Raise block added event.
704
+ const blockAddedEventData = {
705
+ BlockKey: blockKey,
706
+ DraggableItem: draggableItem,
707
+ };
708
+ this.notifyBlockAdded(blockAddedEventData);
709
+ if (this._navigateToEditorAfterBlockAdded) {
710
+ // Navigate to the block editor.
711
+ this.navigateToEditor('block', blockKey);
712
+ }
713
+ }
714
+ }
715
+ else {
716
+ console.log("draggableItem is not a IPepDraggableItem type");
717
+ }
718
+ }
719
+ }
720
+ else {
721
+ // If the block moved between columns in the same section or between different sections but not in the same column.
722
+ if (event.container.id !== event.previousContainer.id) {
723
+ // Get the column.
724
+ const currentColumn = this.getSectionColumnByIdForEditor(event.container.id);
725
+ // Get the previous column.
726
+ const previuosColumn = this.getSectionColumnByIdForEditor(event.previousContainer.id);
727
+ if (currentColumn && previuosColumn) {
728
+ currentColumn.BlockContainer = previuosColumn.BlockContainer;
729
+ delete previuosColumn.BlockContainer;
730
+ this.notifyLayoutViewChange(layoutView);
731
+ }
732
+ }
733
+ }
734
+ }
735
+ onBlockDragStart(event) {
736
+ var _a, _b;
737
+ this.changeCursorOnDragStart();
738
+ // Take the block key if exist, else take the available block key (relation key).
739
+ 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);
740
+ this._draggingBlockKey.next(blockKey);
741
+ }
742
+ onBlockDragEnd(event) {
743
+ this.changeCursorOnDragEnd();
744
+ this._draggingBlockKey.next('');
745
+ }
746
+ doesColumnContainBlock(sectionId, columnIndex) {
747
+ let res = false;
748
+ const layoutView = this._layoutViewSubject.getValue();
749
+ const section = layoutView === null || layoutView === void 0 ? void 0 : layoutView.Layout.Sections.find(section => section.Key === sectionId);
750
+ if (section && columnIndex >= 0 && section.Columns.length > columnIndex) {
751
+ res = !!section.Columns[columnIndex].BlockContainer;
752
+ }
753
+ return res;
754
+ }
755
+ setScreenWidth(screenType) {
756
+ const value = this.getCssScreenWidh(screenType);
757
+ const width = coerceNumberProperty(value, 0);
758
+ if (width === 0) {
759
+ this._screenWidthSubject.next('100%');
760
+ this.notifyScreenSizeChange(PepScreenSizeType.XL);
761
+ }
762
+ else {
763
+ this._screenWidthSubject.next(`${width}px`);
764
+ // Change the size according the width.
765
+ if (width >= 1920) {
766
+ this.notifyScreenSizeChange(PepScreenSizeType.XL);
767
+ }
768
+ else if (width >= 1280 && width < 1920) {
769
+ this.notifyScreenSizeChange(PepScreenSizeType.LG);
770
+ }
771
+ else if (width >= 960 && width < 1280) {
772
+ this.notifyScreenSizeChange(PepScreenSizeType.MD);
773
+ }
774
+ else if (width >= 600 && width < 960) {
775
+ this.notifyScreenSizeChange(PepScreenSizeType.SM);
776
+ }
777
+ else if (width < 600) {
778
+ this.notifyScreenSizeChange(PepScreenSizeType.XS);
779
+ }
780
+ }
781
+ }
782
+ // showSkeleton(show: boolean): void {
783
+ // this._showSkeletonSubject.next(show);
784
+ // }
785
+ // lockScreen(value: boolean): void {
786
+ // this.notifyLockScreen(value);
787
+ // }
788
+ loadLayoutBuilder(layoutView) {
789
+ if (this.editorMode) {
790
+ if (this._editorsBreadCrumb.length === 0) {
791
+ // Load the layout editor.
792
+ this.loadDefaultEditor(layoutView);
793
+ }
794
+ }
795
+ // Load only the layout view.
796
+ this.notifyLayoutViewChange(layoutView);
797
+ }
798
+ }
799
+ LayoutBuilderInternalService.AVAILABLE_BLOCKS_CONTAINER_ID = 'availableBlocks';
800
+ LayoutBuilderInternalService.MAIN_EDITOR_ID = 'main';
801
+ LayoutBuilderInternalService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: LayoutBuilderInternalService, deps: [{ token: i1.TranslateService }, { token: i2$1.PepDialogService }, { token: i3$1.PepLayoutService }], target: i0.ɵɵFactoryTarget.Injectable });
802
+ LayoutBuilderInternalService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: LayoutBuilderInternalService });
803
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: LayoutBuilderInternalService, decorators: [{
804
+ type: Injectable
805
+ }], ctorParameters: function () { return [{ type: i1.TranslateService }, { type: i2$1.PepDialogService }, { type: i3$1.PepLayoutService }]; } });
806
+
807
+ class SectionBlockComponent extends BaseDestroyerDirective {
808
+ constructor(layoutBuilderInternalService) {
809
+ super();
810
+ this.layoutBuilderInternalService = layoutBuilderInternalService;
811
+ this.blockTemplateRenderer = null;
812
+ this.blockTemplateUnmount = null;
813
+ this.sectionKey = '';
814
+ this.sectionHeight = '';
815
+ this.isMainEditorState = false;
816
+ this.editable = false;
817
+ this.active = false;
818
+ this.viewInitialized = false;
819
+ this.dragExited = new EventEmitter();
820
+ this.dragEntered = new EventEmitter();
821
+ this.hideForCurrentScreenType = false;
822
+ // protected remoteLoaderOptions: PepRemoteLoaderOptions;
823
+ // protected availableBlock: IPepDraggableItem | undefined;
824
+ this.blockTitle = '';
825
+ this.lastRenderedBlockKey = '';
826
+ }
827
+ set blockContainer(value) {
828
+ this._blockContainer = value;
829
+ // if (this._blockContainer) {
830
+ // this.availableBlock = this.layoutBuilderInternalService.availableBlocksForDragMap?.get(this._blockContainer?.DraggableItemKey);
831
+ // }
832
+ this.setIfHideForCurrentScreenType();
833
+ if (this.viewInitialized) {
834
+ this.renderExternalTemplateIfNeeded();
835
+ }
836
+ }
837
+ ngOnChanges(changes) {
838
+ if (changes['blockContainer'] || changes['blockTemplateRenderer'] || changes['blockTemplateUnmount']) {
839
+ this.renderExternalTemplateIfNeeded();
840
+ }
841
+ }
842
+ ngAfterViewInit() {
843
+ this.viewInitialized = true;
844
+ this.renderExternalTemplateIfNeeded();
845
+ }
846
+ ngOnDestroy() {
847
+ this.viewInitialized = false;
848
+ this.unmountExternalTemplate();
849
+ super.ngOnDestroy();
850
+ }
851
+ renderExternalTemplateIfNeeded() {
852
+ var _a, _b, _c;
853
+ if (this.blockTemplate) {
854
+ // Angular template handles rendering.
855
+ return;
856
+ }
857
+ const host = (_a = this.blockTemplateHost) === null || _a === void 0 ? void 0 : _a.nativeElement;
858
+ const blockKey = (_c = (_b = this.blockContainer) === null || _b === void 0 ? void 0 : _b.BlockKey) !== null && _c !== void 0 ? _c : '';
859
+ if (!host || !blockKey || !this.blockTemplateRenderer) {
860
+ this.unmountExternalTemplate();
861
+ return;
862
+ }
863
+ if (this.lastRenderedBlockKey && this.lastRenderedBlockKey !== blockKey) {
864
+ this.unmountExternalTemplate();
865
+ }
866
+ this.lastRenderedBlockKey = blockKey;
867
+ this.blockTemplateRenderer(host, blockKey);
868
+ }
869
+ unmountExternalTemplate() {
870
+ var _a;
871
+ const host = (_a = this.blockTemplateHost) === null || _a === void 0 ? void 0 : _a.nativeElement;
872
+ if (!host) {
873
+ this.lastRenderedBlockKey = '';
874
+ return;
875
+ }
876
+ if (this.blockTemplateUnmount) {
877
+ this.blockTemplateUnmount(host);
878
+ }
879
+ else {
880
+ host.replaceChildren();
881
+ }
882
+ this.lastRenderedBlockKey = '';
883
+ }
884
+ get blockContainer() {
885
+ return this._blockContainer;
886
+ }
887
+ set screenType(value) {
888
+ this._screenType = value;
889
+ this.setIfHideForCurrentScreenType();
890
+ }
891
+ get screenType() {
892
+ return this._screenType;
893
+ }
894
+ setIfHideForCurrentScreenType() {
895
+ this.hideForCurrentScreenType = this.blockContainer ?
896
+ this.layoutBuilderInternalService.getIsHidden(this.blockContainer.Hide, this.screenType) : false;
897
+ }
898
+ ngOnInit() {
899
+ var _a;
900
+ this.blockTitle = this.layoutBuilderInternalService.getBlockTitle(((_a = this.blockContainer) === null || _a === void 0 ? void 0 : _a.BlockKey) || '');
901
+ //
902
+ // this.layoutBuilderInternalService.availableBlocksForDragMapChange$.pipe(this.getDestroyer()).subscribe((availableBlocksForDragMap) => {
903
+ // if (availableBlocksForDragMap && this.blockContainer) {
904
+ // this.availableBlock = (availableBlocksForDragMap as ReadonlyMap<string, IPepDraggableItem>).get(this.blockContainer.DraggableItemKey);
905
+ // }
906
+ // });
907
+ }
908
+ onEditBlockClick() {
909
+ var _a;
910
+ if ((_a = this.blockContainer) === null || _a === void 0 ? void 0 : _a.BlockKey) {
911
+ this.layoutBuilderInternalService.navigateToEditor('block', this.blockContainer.BlockKey, this.blockTitle);
912
+ }
913
+ }
914
+ onRemoveBlockClick() {
915
+ var _a;
916
+ if ((_a = this.blockContainer) === null || _a === void 0 ? void 0 : _a.BlockKey) {
917
+ this.layoutBuilderInternalService.removeBlockFromSection(this.blockContainer.BlockKey);
918
+ }
919
+ }
920
+ onHideBlockChange(hideIn) {
921
+ var _a;
922
+ if ((_a = this.blockContainer) === null || _a === void 0 ? void 0 : _a.BlockKey) {
923
+ this.layoutBuilderInternalService.hideBlock(this.sectionKey, this.blockContainer.BlockKey, hideIn);
924
+ this.setIfHideForCurrentScreenType();
925
+ }
926
+ }
927
+ // onBlockLoad(event: any) {
928
+ // this.layoutBuilderService.updateBlockLoaded(this.blockContainer.BlockKey);
929
+ // }
930
+ onDragStart(event) {
931
+ this.layoutBuilderInternalService.onBlockDragStart(event);
932
+ }
933
+ onDragEnd(event) {
934
+ this.layoutBuilderInternalService.onBlockDragEnd(event);
935
+ }
936
+ onDragExited(event) {
937
+ this.dragExited.emit(event);
938
+ }
939
+ onDragEntered(event) {
940
+ this.dragEntered.emit(event);
941
+ }
942
+ }
943
+ SectionBlockComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: SectionBlockComponent, deps: [{ token: LayoutBuilderInternalService }], target: i0.ɵɵFactoryTarget.Component });
944
+ SectionBlockComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.2", type: SectionBlockComponent, selector: "section-block", inputs: { blockTemplate: "blockTemplate", blockTemplateRenderer: "blockTemplateRenderer", blockTemplateUnmount: "blockTemplateUnmount", sectionKey: "sectionKey", sectionHeight: "sectionHeight", isMainEditorState: "isMainEditorState", editable: "editable", active: "active", blockContainer: "blockContainer", screenType: "screenType" }, outputs: { dragExited: "dragExited", dragEntered: "dragEntered" }, viewQueries: [{ propertyName: "blockTemplateHost", first: true, predicate: ["blockTemplateHost"], descendants: true }], usesInheritance: true, usesOnChanges: 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]=\"blockTitle\" >\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>\n </pep-draggable-item>\n <div class=\"block-template-wrapper\" [ngStyle]=\"{ 'overflow': (sectionHeight === 'unset' ? 'unset' : 'auto') }\">\n <div *ngIf=\"blockTemplate || blockTemplateRenderer\" class=\"block-template\">\n <ng-container *ngIf=\"blockTemplate; else externalBlockTemplate\">\n <ng-container *ngTemplateOutlet=\"blockTemplate; context: { blockKey: blockContainer?.BlockKey }\">\n </ng-container>\n </ng-container>\n <ng-template #externalBlockTemplate>\n <div #blockTemplateHost></div>\n </ng-template>\n </div>\n </div>\n</div>\n", styles: [".section-block-container{height:100%;width:100%}.section-block-container.editable-state:not(.active-block) .block-template-wrapper .block-template{pointer-events:none;opacity:.5}.section-block-container.editable-state.cdk-drag-preview .block-template-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 .block-template-wrapper{height:100%;position:relative}.section-block-container .block-template-wrapper .block-template{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: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i2.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i3$2.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: i3$2.CdkDragHandle, selector: "[cdkDragHandle]", inputs: ["cdkDragHandleDisabled"] }, { kind: "component", type: i4$1.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"] }] });
945
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: SectionBlockComponent, decorators: [{
946
+ type: Component,
947
+ 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]=\"blockTitle\" >\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>\n </pep-draggable-item>\n <div class=\"block-template-wrapper\" [ngStyle]=\"{ 'overflow': (sectionHeight === 'unset' ? 'unset' : 'auto') }\">\n <div *ngIf=\"blockTemplate || blockTemplateRenderer\" class=\"block-template\">\n <ng-container *ngIf=\"blockTemplate; else externalBlockTemplate\">\n <ng-container *ngTemplateOutlet=\"blockTemplate; context: { blockKey: blockContainer?.BlockKey }\">\n </ng-container>\n </ng-container>\n <ng-template #externalBlockTemplate>\n <div #blockTemplateHost></div>\n </ng-template>\n </div>\n </div>\n</div>\n", styles: [".section-block-container{height:100%;width:100%}.section-block-container.editable-state:not(.active-block) .block-template-wrapper .block-template{pointer-events:none;opacity:.5}.section-block-container.editable-state.cdk-drag-preview .block-template-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 .block-template-wrapper{height:100%;position:relative}.section-block-container .block-template-wrapper .block-template{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"] }]
948
+ }], ctorParameters: function () { return [{ type: LayoutBuilderInternalService }]; }, propDecorators: { blockTemplate: [{
949
+ type: Input
950
+ }], blockTemplateRenderer: [{
951
+ type: Input
952
+ }], blockTemplateUnmount: [{
953
+ type: Input
954
+ }], sectionKey: [{
955
+ type: Input
956
+ }], sectionHeight: [{
957
+ type: Input
958
+ }], isMainEditorState: [{
959
+ type: Input
960
+ }], editable: [{
961
+ type: Input
962
+ }], active: [{
963
+ type: Input
964
+ }], blockTemplateHost: [{
965
+ type: ViewChild,
966
+ args: ['blockTemplateHost', { static: false }]
967
+ }], blockContainer: [{
968
+ type: Input
969
+ }], screenType: [{
970
+ type: Input
971
+ }], dragExited: [{
972
+ type: Output
973
+ }], dragEntered: [{
974
+ type: Output
975
+ }] } });
976
+
977
+ class SectionComponent extends BaseDestroyerDirective {
978
+ constructor(renderer, layoutBuilderInternalService) {
979
+ super();
980
+ this.renderer = renderer;
981
+ this.layoutBuilderInternalService = layoutBuilderInternalService;
982
+ this.blockTemplateRenderer = null;
983
+ this.blockTemplateUnmount = null;
984
+ this.key = '';
985
+ this.name = '';
986
+ this._split = undefined;
987
+ this._height = undefined;
988
+ this._collapseOnTablet = false;
989
+ this._padding = new PepPaddingSettings(true, '0');
990
+ this._columns = [];
991
+ this._hideIn = [];
992
+ this.styleMaxHeight = 'unset';
993
+ this.styleHeight = 'unset';
994
+ this.sectionsColumnsDropList = [];
995
+ // PepScreenSizeType = PepScreenSizeType;
996
+ this.sectionColumnKeyPrefix = '';
997
+ this.isMainEditorState = false;
998
+ this.isEditing = false;
999
+ this.selectedSectionKey = '';
1000
+ this.selectedBlockKey = '';
1001
+ this.containsBlocks = false;
1002
+ this.shouldSetDefaultHeight = false;
1003
+ this.pepScreenSizeToFlipToVertical = PepScreenSizeType.SM;
1004
+ this.hideForCurrentScreenType = false;
1005
+ this.draggingBlockKey = '';
1006
+ this.draggingSectionKey = '';
1007
+ this.hoverState = false;
1008
+ this.isHorizontalView = false;
1009
+ }
1010
+ set split(value) {
1011
+ this._split = value;
1012
+ this.refreshSplit();
1013
+ }
1014
+ get split() {
1015
+ return this._split;
1016
+ }
1017
+ set height(value) {
1018
+ this._height = value;
1019
+ this.setStyleHeight();
1020
+ }
1021
+ get height() {
1022
+ return this._height;
1023
+ }
1024
+ set collapseOnTablet(value) {
1025
+ this._collapseOnTablet = value;
1026
+ this.pepScreenSizeToFlipToVertical = value ? PepScreenSizeType.MD : PepScreenSizeType.XS;
1027
+ this.refreshSplit();
1028
+ }
1029
+ get collapseOnTablet() {
1030
+ return this._collapseOnTablet;
1031
+ }
1032
+ set padding(value) {
1033
+ this._padding = value || new PepPaddingSettings(true, '0');
1034
+ }
1035
+ get padding() {
1036
+ return this._padding;
1037
+ }
1038
+ set columns(value) {
1039
+ this._columns = value || [];
1040
+ }
1041
+ get columns() {
1042
+ return this._columns;
1043
+ }
1044
+ set hideIn(value) {
1045
+ this._hideIn = value;
1046
+ this.setIfHideForCurrentScreenType();
1047
+ }
1048
+ get hideIn() {
1049
+ return this._hideIn;
1050
+ }
1051
+ // private _editable = false;
1052
+ // protected set editable(value: boolean) {
1053
+ // this._editable = value;
1054
+ // this.refreshSplit();
1055
+ // }
1056
+ get editable() {
1057
+ return this.layoutBuilderInternalService.editableState;
1058
+ }
1059
+ set screenSize(value) {
1060
+ this._screenSize = value;
1061
+ this.refreshSplit();
1062
+ this.setScreenType();
1063
+ }
1064
+ get screenSize() {
1065
+ return this._screenSize;
1066
+ }
1067
+ calculateIfSectionContainsBlocks() {
1068
+ this.containsBlocks = this.columns.some(column => column.BlockContainer);
1069
+ if (this.editable) {
1070
+ this.shouldSetDefaultHeight = !this.containsBlocks;
1071
+ }
1072
+ }
1073
+ setScreenType() {
1074
+ this.screenType = this.layoutBuilderInternalService.getScreenType(this.screenSize);
1075
+ this.setIfHideForCurrentScreenType();
1076
+ this.setStyleHeight();
1077
+ }
1078
+ setIfHideForCurrentScreenType() {
1079
+ this.hideForCurrentScreenType = this.layoutBuilderInternalService.getIsHidden(this.hideIn, this.screenType);
1080
+ }
1081
+ // private getCssSplitString() {
1082
+ // switch (this.split) {
1083
+ // case '1/2 1/2':
1084
+ // return '1fr 1fr';
1085
+ // case '1/2 1/4 1/4':
1086
+ // return '2fr 1fr 1fr';
1087
+ // case '1/3 1/3 1/3':
1088
+ // return '1fr 1fr 1fr';
1089
+ // case '1/3 2/3':
1090
+ // return '1fr 2fr';
1091
+ // case '1/4 1/2 1/4':
1092
+ // return '1fr 2fr 1fr';
1093
+ // case '1/4 1/4 1/2':
1094
+ // return '1fr 1fr 2fr';
1095
+ // case '1/4 1/4 1/4 1/4':
1096
+ // return '1fr 1fr 1fr 1fr';
1097
+ // case '1/4 3/4':
1098
+ // return '1fr 3fr';
1099
+ // case '2/3 1/3':
1100
+ // return '2fr 1fr';
1101
+ // case '3/4 1/4':
1102
+ // return '3fr 1fr';
1103
+ // default: // For one column.
1104
+ // return '1fr';
1105
+ // }
1106
+ // }
1107
+ getCssGridColumn(columnIndex) {
1108
+ let res = '1/13';
1109
+ let gridColumnValueArr = ['1/13'];
1110
+ switch (this.split) {
1111
+ case '1/2 1/2':
1112
+ gridColumnValueArr = ['1/7', '7/13'];
1113
+ break;
1114
+ case '1/2 1/4 1/4':
1115
+ gridColumnValueArr = ['1/7', '7/10', '10/13'];
1116
+ break;
1117
+ case '1/3 1/3 1/3':
1118
+ gridColumnValueArr = ['1/5', '5/9', '9/13'];
1119
+ break;
1120
+ case '1/3 2/3':
1121
+ gridColumnValueArr = ['1/5', '5/13'];
1122
+ break;
1123
+ case '1/4 1/2 1/4':
1124
+ gridColumnValueArr = ['1/4', '4/10', '10/13'];
1125
+ break;
1126
+ case '1/4 1/4 1/2':
1127
+ gridColumnValueArr = ['1/4', '4/7', '7/13'];
1128
+ break;
1129
+ case '1/4 1/4 1/4 1/4':
1130
+ gridColumnValueArr = ['1/4', '4/7', '7/10', '10/13'];
1131
+ break;
1132
+ case '1/4 3/4':
1133
+ gridColumnValueArr = ['1/4', '4/13'];
1134
+ break;
1135
+ case '2/3 1/3':
1136
+ gridColumnValueArr = ['1/9', '9/13'];
1137
+ break;
1138
+ case '3/4 1/4':
1139
+ gridColumnValueArr = ['1/10', '10/13'];
1140
+ break;
1141
+ }
1142
+ if (gridColumnValueArr.length > columnIndex) {
1143
+ res = gridColumnValueArr[columnIndex];
1144
+ }
1145
+ return res;
1146
+ }
1147
+ setSectionColumnStyle(sectionColumnElement, columnIndex) {
1148
+ if (this.isHorizontalView) {
1149
+ const gridColumnValue = this.getCssGridColumn(columnIndex);
1150
+ this.renderer.setStyle(sectionColumnElement, 'grid-column', gridColumnValue);
1151
+ }
1152
+ else {
1153
+ this.renderer.setStyle(sectionColumnElement, 'grid-column', 'unset');
1154
+ }
1155
+ }
1156
+ refreshSplit() {
1157
+ // Horizontal (true) for large screens, false for small screens.
1158
+ this.isHorizontalView = this.screenSize < this.pepScreenSizeToFlipToVertical;
1159
+ setTimeout(() => {
1160
+ if (this.sectionContainerRef) {
1161
+ // const cssSplitString = this.getCssSplitString();
1162
+ // Go for all the columns in the columnsWrapper
1163
+ this.columnsElementRef.toArray().map((section, sectionIndex) => {
1164
+ if (this.isHorizontalView) {
1165
+ this.renderer.setStyle(section.nativeElement, 'grid-auto-flow', 'column');
1166
+ this.renderer.setStyle(section.nativeElement, 'grid-template-rows', 'unset');
1167
+ // this.renderer.setStyle(section.nativeElement, 'grid-template-columns', cssSplitString);
1168
+ this.renderer.setStyle(section.nativeElement, 'grid-template-columns', 'repeat(12, 1fr)');
1169
+ }
1170
+ else {
1171
+ this.renderer.setStyle(section.nativeElement, 'grid-auto-flow', 'row');
1172
+ this.renderer.setStyle(section.nativeElement, 'grid-template-columns', 'unset');
1173
+ this.renderer.setStyle(section.nativeElement, 'grid-template-rows', 'unset');
1174
+ // In runtime (or preview mode).
1175
+ if (!this.editable) {
1176
+ // const cssSplitArray = cssSplitString.split(' ');
1177
+ // // If there are some hidden columns change the column width to 0 (for cut the spacing in the grid-template-rows).
1178
+ // this.columns.forEach((column, index) => {
1179
+ // if (!column.BlockContainer) {
1180
+ // cssSplitArray[index] = '0';
1181
+ // }
1182
+ // });
1183
+ //this.renderer.setStyle(section.nativeElement, 'grid-template-rows', cssSplitArray.join(' '));
1184
+ this.renderer.setStyle(section.nativeElement, 'grid-template-rows', 'auto');
1185
+ }
1186
+ }
1187
+ // Go for all the columns in the section and set there style.
1188
+ const sectionColumns = section.nativeElement.querySelectorAll('.section-column');
1189
+ for (let columnIndex = 0; columnIndex < sectionColumns.length; columnIndex++) {
1190
+ this.setSectionColumnStyle(sectionColumns[columnIndex], columnIndex);
1191
+ }
1192
+ });
1193
+ }
1194
+ }, 0);
1195
+ }
1196
+ setStyleHeight() {
1197
+ if (this.height && this.height > 0 && this.screenType !== 'Phablet') {
1198
+ this.styleHeight = this.styleMaxHeight = `${this.height}px`;
1199
+ }
1200
+ else {
1201
+ this.styleHeight = this.styleMaxHeight = 'unset';
1202
+ }
1203
+ }
1204
+ getIsDragging() {
1205
+ return this.draggingBlockKey.length > 0 && this.draggingSectionKey.length > 0;
1206
+ }
1207
+ getIsHidden(hideIn, currentScreenType) {
1208
+ return this.layoutBuilderInternalService.getIsHidden(hideIn, currentScreenType);
1209
+ }
1210
+ ngOnInit() {
1211
+ this.layoutBuilderInternalService.previewModeChange$.pipe(this.getDestroyer()).subscribe(previewMode => {
1212
+ this.refreshSplit();
1213
+ });
1214
+ // Just to calculate if sections contains blocks
1215
+ this.layoutBuilderInternalService.sectionsChange$.pipe(this.getDestroyer()).subscribe(res => {
1216
+ this.calculateIfSectionContainsBlocks();
1217
+ });
1218
+ // this.layoutService.onResize$.pipe(this.getDestroyer()).subscribe((size: any) => {
1219
+ // this.screenSize = size;
1220
+ // });
1221
+ this.layoutBuilderInternalService.screenSizeChange$.pipe(this.getDestroyer()).subscribe((size) => {
1222
+ this.screenSize = size;
1223
+ });
1224
+ if (this.editable) {
1225
+ this.layoutBuilderInternalService.sectionsColumnsDropListChange$.pipe(this.getDestroyer()).subscribe((sectionsColumnsDropList) => {
1226
+ this.sectionsColumnsDropList = sectionsColumnsDropList;
1227
+ });
1228
+ this.layoutBuilderInternalService.editorChange$.pipe(this.getDestroyer()).subscribe((editor) => {
1229
+ this.isMainEditorState = editor && editor.type === 'layout-builder';
1230
+ this.isEditing = editor && editor.type === 'section' && editor.id === this.key;
1231
+ this.selectedSectionKey = editor && editor.type === 'section' ? editor.id : '';
1232
+ this.selectedBlockKey = editor && editor.type === 'block' ? editor.id : '';
1233
+ });
1234
+ this.layoutBuilderInternalService.draggingBlockKey.pipe(this.getDestroyer()).subscribe((draggingBlockKey) => {
1235
+ this.draggingBlockKey = draggingBlockKey;
1236
+ if (draggingBlockKey === '') {
1237
+ this.calculateIfSectionContainsBlocks();
1238
+ }
1239
+ else {
1240
+ // If there is only one block in the section and now it's this block that the user is dragging.
1241
+ const blocksLength = this.columns.filter(column => column.BlockContainer).length;
1242
+ if (blocksLength === 1 && this.columns.find(c => { var _a; return ((_a = c.BlockContainer) === null || _a === void 0 ? void 0 : _a.BlockKey) === this.draggingBlockKey; })) {
1243
+ this.shouldSetDefaultHeight = true;
1244
+ }
1245
+ }
1246
+ });
1247
+ this.layoutBuilderInternalService.draggingSectionKey.pipe(this.getDestroyer()).subscribe((draggingSectionKey) => {
1248
+ this.draggingSectionKey = draggingSectionKey;
1249
+ });
1250
+ }
1251
+ this.sectionColumnKeyPrefix = this.layoutBuilderInternalService.getSectionColumnKey(this.key);
1252
+ }
1253
+ onEditSectionClick() {
1254
+ this.layoutBuilderInternalService.navigateToEditor('section', this.key);
1255
+ }
1256
+ onRemoveSectionClick() {
1257
+ this.layoutBuilderInternalService.removeSection(this.key);
1258
+ }
1259
+ onHideSectionChange(hideIn) {
1260
+ this.layoutBuilderInternalService.hideSection(this.key, hideIn);
1261
+ }
1262
+ onHideInMenuOpened() {
1263
+ this.hoverState = true;
1264
+ }
1265
+ onHideInMenuClosed() {
1266
+ this.hoverState = false;
1267
+ }
1268
+ onBlockDropped(event) {
1269
+ this.layoutBuilderInternalService.onBlockDropped(event, this.key);
1270
+ }
1271
+ canDropPredicate(columnIndex) {
1272
+ return (drag, drop) => {
1273
+ const res = !this.layoutBuilderInternalService.doesColumnContainBlock(this.key, columnIndex);
1274
+ return res;
1275
+ };
1276
+ }
1277
+ onDragStart(event) {
1278
+ this.layoutBuilderInternalService.onSectionDragStart(event);
1279
+ }
1280
+ onDragEnd(event) {
1281
+ this.layoutBuilderInternalService.onSectionDragEnd(event);
1282
+ }
1283
+ onSectionBlockDragExited(event) {
1284
+ //
1285
+ }
1286
+ onSectionBlockDragEntered(event) {
1287
+ //
1288
+ }
1289
+ getPadding() {
1290
+ // calc buttons bar padding
1291
+ let padding = '0rem';
1292
+ const paddingObj = this._padding || new PepPaddingSettings();
1293
+ if (paddingObj === null || paddingObj === void 0 ? void 0 : paddingObj.IsUniform) {
1294
+ padding = paddingObj.PaddingValue + 'rem';
1295
+ }
1296
+ else {
1297
+ const num = paddingObj.PaddingValue.split(',');
1298
+ padding = num[0] + 'rem ' + num[1] + 'rem ' + num[2] + 'rem ' + num[3] + 'rem';
1299
+ }
1300
+ return {
1301
+ 'padding': padding
1302
+ };
1303
+ }
1304
+ }
1305
+ SectionComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: SectionComponent, deps: [{ token: i0.Renderer2 }, { token: LayoutBuilderInternalService }], target: i0.ɵɵFactoryTarget.Component });
1306
+ SectionComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.2", type: SectionComponent, selector: "section", inputs: { blockTemplate: "blockTemplate", blockTemplateRenderer: "blockTemplateRenderer", blockTemplateUnmount: "blockTemplateUnmount", key: "key", name: "name", split: "split", height: "height", collapseOnTablet: "collapseOnTablet", padding: "padding", 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 [ngStyle]=\"getPadding()\"\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 <ng-container *ngFor=\"let column of columns; let i=index;\">\n \n <!-- This is moved to the section-block component cause when we change to work with 'grid-column' style we have to draw the columns.\n *ngIf=\"editable || (column.BlockContainer && column.BlockContainer.BlockKey && column.BlockContainer.BlockKey.length > 0 && !getIsHidden(column?.BlockContainer?.Hide, screenType))\" \n -->\n <div *ngIf=\"editable || isHorizontalView || (column.BlockContainer && column.BlockContainer.BlockKey && column.BlockContainer.BlockKey.length > 0)\"\n [id]=\"sectionColumnKeyPrefix + i\" \n class=\"section-column {{isHorizontalView ? '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]=\"isHorizontalView ? 'horizontal' : 'vertical'\" \n [cdkDropListConnectedTo]=\"sectionsColumnsDropList\"\n (cdkDropListDropped)=\"onBlockDropped($event)\"\n [cdkDropListEnterPredicate]=\"canDropPredicate(i)\"\n >\n <section-block *ngIf=\"column.BlockContainer?.BlockKey\" \n class=\"section-block\" [sectionKey]=\"key\" [blockTemplate]=\"blockTemplate\"\n [blockTemplateRenderer]=\"blockTemplateRenderer\" [blockTemplateUnmount]=\"blockTemplateUnmount\"\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 </ng-container>\n </div>\n</div>\n", styles: [".section-container{position:relative;display:grid;height:100%;max-height:inherit}.section-container.editable-state{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 .block-template-wrapper .block-template{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: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i3$2.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: i3$2.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: i3$2.CdkDragHandle, selector: "[cdkDragHandle]", inputs: ["cdkDragHandleDisabled"] }, { kind: "component", type: i4$1.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", "blockTemplateRenderer", "blockTemplateUnmount", "sectionKey", "sectionHeight", "isMainEditorState", "editable", "active", "blockContainer", "screenType"], outputs: ["dragExited", "dragEntered"] }, { kind: "component", type: HideInComponent, 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"] }] });
1307
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: SectionComponent, decorators: [{
1308
+ type: Component,
1309
+ args: [{ selector: 'section', template: "<div #sectionContainer *ngIf=\"editable || (containsBlocks && !hideForCurrentScreenType)\" class=\"section-container \"\n [ngStyle]=\"getPadding()\"\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 <ng-container *ngFor=\"let column of columns; let i=index;\">\n \n <!-- This is moved to the section-block component cause when we change to work with 'grid-column' style we have to draw the columns.\n *ngIf=\"editable || (column.BlockContainer && column.BlockContainer.BlockKey && column.BlockContainer.BlockKey.length > 0 && !getIsHidden(column?.BlockContainer?.Hide, screenType))\" \n -->\n <div *ngIf=\"editable || isHorizontalView || (column.BlockContainer && column.BlockContainer.BlockKey && column.BlockContainer.BlockKey.length > 0)\"\n [id]=\"sectionColumnKeyPrefix + i\" \n class=\"section-column {{isHorizontalView ? '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]=\"isHorizontalView ? 'horizontal' : 'vertical'\" \n [cdkDropListConnectedTo]=\"sectionsColumnsDropList\"\n (cdkDropListDropped)=\"onBlockDropped($event)\"\n [cdkDropListEnterPredicate]=\"canDropPredicate(i)\"\n >\n <section-block *ngIf=\"column.BlockContainer?.BlockKey\" \n class=\"section-block\" [sectionKey]=\"key\" [blockTemplate]=\"blockTemplate\"\n [blockTemplateRenderer]=\"blockTemplateRenderer\" [blockTemplateUnmount]=\"blockTemplateUnmount\"\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 </ng-container>\n </div>\n</div>\n", styles: [".section-container{position:relative;display:grid;height:100%;max-height:inherit}.section-container.editable-state{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 .block-template-wrapper .block-template{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"] }]
1310
+ }], ctorParameters: function () { return [{ type: i0.Renderer2 }, { type: LayoutBuilderInternalService }]; }, propDecorators: { sectionContainerRef: [{
1311
+ type: ViewChild,
1312
+ args: ['sectionContainer']
1313
+ }], columnsElementRef: [{
1314
+ type: ViewChildren,
1315
+ args: ['columnsWrapper']
1316
+ }], blockTemplate: [{
1317
+ type: Input
1318
+ }], blockTemplateRenderer: [{
1319
+ type: Input
1320
+ }], blockTemplateUnmount: [{
1321
+ type: Input
1322
+ }], key: [{
1323
+ type: Input
1324
+ }], name: [{
1325
+ type: Input
1326
+ }], split: [{
1327
+ type: Input
1328
+ }], height: [{
1329
+ type: Input
1330
+ }], collapseOnTablet: [{
1331
+ type: Input
1332
+ }], padding: [{
1333
+ type: Input
1334
+ }], columns: [{
1335
+ type: Input
1336
+ }], hideIn: [{
1337
+ type: Input
1338
+ }], columnsGap: [{
1339
+ type: Input
1340
+ }], styleMaxHeight: [{
1341
+ type: HostBinding,
1342
+ args: ['style.max-height']
1343
+ }], styleHeight: [{
1344
+ type: HostBinding,
1345
+ args: ['style.height']
1346
+ }] } });
1347
+
1348
+ class SectionBlockModule {
1349
+ }
1350
+ SectionBlockModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: SectionBlockModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1351
+ SectionBlockModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.0.2", ngImport: i0, type: SectionBlockModule, declarations: [SectionBlockComponent], imports: [CommonModule,
1352
+ DragDropModule,
1353
+ PepButtonModule,
1354
+ PepDraggableItemsModule], exports: [SectionBlockComponent] });
1355
+ SectionBlockModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: SectionBlockModule, imports: [CommonModule,
1356
+ DragDropModule,
1357
+ PepButtonModule,
1358
+ PepDraggableItemsModule] });
1359
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: SectionBlockModule, decorators: [{
1360
+ type: NgModule,
1361
+ args: [{
1362
+ declarations: [
1363
+ SectionBlockComponent,
1364
+ ],
1365
+ imports: [
1366
+ CommonModule,
1367
+ DragDropModule,
1368
+ PepButtonModule,
1369
+ PepDraggableItemsModule,
1370
+ ],
1371
+ exports: [SectionBlockComponent]
1372
+ }]
1373
+ }] });
1374
+
1375
+ class SectionModule {
1376
+ }
1377
+ SectionModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: SectionModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1378
+ SectionModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.0.2", ngImport: i0, type: SectionModule, declarations: [SectionComponent], imports: [CommonModule,
1379
+ DragDropModule,
1380
+ PepButtonModule,
1381
+ SectionBlockModule,
1382
+ HideInModule,
1383
+ PepDraggableItemsModule, i1.TranslateModule], exports: [SectionComponent] });
1384
+ SectionModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: SectionModule, imports: [CommonModule,
1385
+ DragDropModule,
1386
+ PepButtonModule,
1387
+ SectionBlockModule,
1388
+ HideInModule,
1389
+ PepDraggableItemsModule,
1390
+ TranslateModule.forChild()] });
1391
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: SectionModule, decorators: [{
1392
+ type: NgModule,
1393
+ args: [{
1394
+ declarations: [SectionComponent],
1395
+ imports: [
1396
+ CommonModule,
1397
+ DragDropModule,
1398
+ PepButtonModule,
1399
+ SectionBlockModule,
1400
+ HideInModule,
1401
+ PepDraggableItemsModule,
1402
+ TranslateModule.forChild()
1403
+ ],
1404
+ exports: [SectionComponent]
1405
+ }]
1406
+ }] });
1407
+
1408
+ class PepLayoutComponent extends BaseDestroyerDirective {
1409
+ constructor(layoutBuilderInternalService, hostElement, renderer) {
1410
+ super();
1411
+ this.layoutBuilderInternalService = layoutBuilderInternalService;
1412
+ this.hostElement = hostElement;
1413
+ this.renderer = renderer;
1414
+ this._editorMode = false;
1415
+ this.blockTemplate = undefined;
1416
+ this.blockTemplateRenderer = null;
1417
+ this.blockTemplateUnmount = null;
1418
+ this._renderSkeleton = true;
1419
+ this._showSkeleton = false;
1420
+ // // For show & hide skeleton
1421
+ // private _showSkeleton = false;
1422
+ this.layoutViewChange = new EventEmitter();
1423
+ this.screenTypeChange = new EventEmitter();
1424
+ this._horizontalSpacing = 'md';
1425
+ this._verticalSpacing = 'md';
1426
+ this.paddingInline = '1rem';
1427
+ this.previewMode = false;
1428
+ this._sectionsSubject = new BehaviorSubject([]);
1429
+ this.renderer.addClass(this.hostElement.nativeElement, 'pep-layout');
1430
+ }
1431
+ set editorMode(value) {
1432
+ this._editorMode = value;
1433
+ this.layoutBuilderInternalService.setEditorMode(value);
1434
+ }
1435
+ get editorMode() {
1436
+ return this._editorMode;
1437
+ }
1438
+ set layoutView(value) {
1439
+ this._layoutView = value;
1440
+ if (this.layoutView) {
1441
+ // Load the layout builder
1442
+ this.layoutBuilderInternalService.loadLayoutBuilder(value);
1443
+ }
1444
+ }
1445
+ get layoutView() {
1446
+ return this._layoutView;
1447
+ }
1448
+ set renderSkeleton(value) {
1449
+ var _a, _b;
1450
+ this._renderSkeleton = value;
1451
+ if (!this._renderSkeleton) {
1452
+ this.renderer.addClass((_a = this.skeletonContainer) === null || _a === void 0 ? void 0 : _a.nativeElement, 'no-height');
1453
+ }
1454
+ else {
1455
+ this.renderer.removeClass((_b = this.skeletonContainer) === null || _b === void 0 ? void 0 : _b.nativeElement, 'no-height');
1456
+ }
1457
+ }
1458
+ get renderSkeleton() {
1459
+ return this._renderSkeleton;
1460
+ }
1461
+ set showSkeleton(value) {
1462
+ this._showSkeleton = value;
1463
+ this.animateSkeleton();
1464
+ }
1465
+ get showSkeleton() {
1466
+ return this._showSkeleton;
1467
+ }
1468
+ set horizontalSpacing(value) {
1469
+ this._horizontalSpacing = value;
1470
+ this.paddingInline = this.convertLayoutSizeType(value || 'md');
1471
+ }
1472
+ get horizontalSpacing() {
1473
+ return this._horizontalSpacing;
1474
+ }
1475
+ set verticalSpacing(value) {
1476
+ this._verticalSpacing = value;
1477
+ }
1478
+ get verticalSpacing() {
1479
+ return this._verticalSpacing;
1480
+ }
1481
+ get sections$() {
1482
+ return this._sectionsSubject.asObservable();
1483
+ }
1484
+ convertLayoutSizeType(size) {
1485
+ let res;
1486
+ if (size === 'lg') {
1487
+ res = '2rem';
1488
+ }
1489
+ else if (size === 'md') {
1490
+ res = '1rem';
1491
+ }
1492
+ else if (size === 'sm') {
1493
+ res = '0.5rem';
1494
+ }
1495
+ else {
1496
+ res = '0';
1497
+ }
1498
+ return res;
1499
+ }
1500
+ animateSkeleton() {
1501
+ var _a, _b, _c, _d, _e, _f, _g, _h;
1502
+ if (this._showSkeleton) {
1503
+ // this.sectionsContainer?.nativeElement?.classList.add('out');
1504
+ (_b = (_a = this.sectionsContainer) === null || _a === void 0 ? void 0 : _a.nativeElement) === null || _b === void 0 ? void 0 : _b.classList.remove('in');
1505
+ (_d = (_c = this.skeletonContainer) === null || _c === void 0 ? void 0 : _c.nativeElement) === null || _d === void 0 ? void 0 : _d.classList.add('in');
1506
+ // this.skeletonContainer?.nativeElement?.classList.remove('out');
1507
+ }
1508
+ else {
1509
+ (_f = (_e = this.sectionsContainer) === null || _e === void 0 ? void 0 : _e.nativeElement) === null || _f === void 0 ? void 0 : _f.classList.add('in');
1510
+ // this.sectionsContainer?.nativeElement?.classList.remove('out');
1511
+ // this.skeletonContainer?.nativeElement?.classList.add('out');
1512
+ (_h = (_g = this.skeletonContainer) === null || _g === void 0 ? void 0 : _g.nativeElement) === null || _h === void 0 ? void 0 : _h.classList.remove('in');
1513
+ }
1514
+ }
1515
+ setLayoutDataProperties() {
1516
+ var _a;
1517
+ const layoutView = this._layoutView;
1518
+ if (layoutView) {
1519
+ if ((_a = this.sectionsContainer) === null || _a === void 0 ? void 0 : _a.nativeElement) {
1520
+ const maxWidth = coerceNumberProperty(layoutView.Layout.MaxWidth, 0);
1521
+ const maxWidthToSet = maxWidth === 0 ? 'unset' : `${maxWidth}px`;
1522
+ this.renderer.setStyle(this.sectionsContainer.nativeElement, 'max-width', maxWidthToSet);
1523
+ }
1524
+ this.sectionsGap = layoutView.Layout.SectionsGap || 'md';
1525
+ this.columnsGap = layoutView.Layout.ColumnsGap || 'md';
1526
+ this.horizontalSpacing = layoutView.Layout.HorizontalSpacing;
1527
+ this.verticalSpacing = layoutView.Layout.VerticalSpacing;
1528
+ }
1529
+ }
1530
+ setScreentType(screenSize) {
1531
+ const screenType = this.layoutBuilderInternalService.getScreenType(screenSize);
1532
+ this.selectedScreenType = screenType;
1533
+ this.screenTypeChange.emit(screenType);
1534
+ }
1535
+ ngOnInit() {
1536
+ /***********************************************************************************************/
1537
+ /* Internal Events - for code usage
1538
+ /***********************************************************************************************/
1539
+ if (this.editorMode) {
1540
+ this.layoutBuilderInternalService.previewModeChange$.pipe(this.getDestroyer()).subscribe((previewMode) => {
1541
+ this.previewMode = previewMode;
1542
+ });
1543
+ }
1544
+ this.layoutBuilderInternalService.sectionsChange$.pipe(this.getDestroyer()).subscribe((sections) => {
1545
+ this._sectionsSubject.next(sections);
1546
+ });
1547
+ this.layoutBuilderInternalService.screenSizeChange$.pipe(this.getDestroyer()).subscribe((size) => {
1548
+ this.setScreentType(size);
1549
+ });
1550
+ /***********************************************************************************************/
1551
+ /* External Events - for raise to the client
1552
+ /***********************************************************************************************/
1553
+ this.layoutBuilderInternalService.layoutViewChange$.pipe(this.getDestroyer()).subscribe((layoutView) => {
1554
+ this._layoutView = layoutView;
1555
+ this.setLayoutDataProperties();
1556
+ this.layoutViewChange.emit(this._layoutView);
1557
+ });
1558
+ // Ensure we don't stay invisible (sections-container opacity: 0) on initial render.
1559
+ // If showSkeleton is false (default), this will apply the 'in' class to sections container.
1560
+ this.animateSkeleton();
1561
+ }
1562
+ ngOnDestroy() {
1563
+ this.layoutBuilderInternalService.setEditorMode(false);
1564
+ super.ngOnDestroy();
1565
+ // this.layoutBuilderService.removeInternalService(this.layoutView?.Key);
1566
+ }
1567
+ getSectionsTemplateRows() {
1568
+ let gridAutoRows = '';
1569
+ // let fillHeightCount = 0;
1570
+ this.sections$.pipe(this.getDestroyer()).subscribe((sections) => {
1571
+ if (sections === null || sections === void 0 ? void 0 : sections.length) {
1572
+ sections.forEach((sec) => {
1573
+ if (sec.FillHeight === true) {
1574
+ // fillHeightCount++;
1575
+ gridAutoRows += ' auto';
1576
+ }
1577
+ else {
1578
+ gridAutoRows += ' min-content';
1579
+ }
1580
+ });
1581
+ //if all are fill height should return 1fr for all
1582
+ //if not should return auto for fill height and min content for none
1583
+ return gridAutoRows;
1584
+ }
1585
+ else {
1586
+ return '';
1587
+ }
1588
+ });
1589
+ return gridAutoRows;
1590
+ }
1591
+ onSectionDropped(event) {
1592
+ this.layoutBuilderInternalService.onSectionDropped(event);
1593
+ }
1594
+ onDragStart(event) {
1595
+ this.layoutBuilderInternalService.onSectionDragStart(event);
1596
+ }
1597
+ onDragEnd(event) {
1598
+ this.layoutBuilderInternalService.onSectionDragEnd(event);
1599
+ }
1600
+ }
1601
+ PepLayoutComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepLayoutComponent, deps: [{ token: LayoutBuilderInternalService }, { token: i0.ElementRef }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Component });
1602
+ PepLayoutComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.2", type: PepLayoutComponent, selector: "pep-layout2", inputs: { editorMode: "editorMode", layoutView: "layoutView", blockTemplate: "blockTemplate", blockTemplateRenderer: "blockTemplateRenderer", blockTemplateUnmount: "blockTemplateUnmount", renderSkeleton: "renderSkeleton", showSkeleton: "showSkeleton" }, outputs: { layoutViewChange: "layoutViewChange", screenTypeChange: "screenTypeChange" }, host: { properties: { "style.padding-inline": "this.paddingInline" } }, providers: [
1603
+ {
1604
+ provide: LayoutBuilderInternalService,
1605
+ useFactory: (parentLayoutBuilderInternalService, translate, dialogService, layoutService) => {
1606
+ return parentLayoutBuilderInternalService || new LayoutBuilderInternalService(translate, dialogService, layoutService);
1607
+ },
1608
+ deps: [
1609
+ [new Optional(), new SkipSelf(), LayoutBuilderInternalService],
1610
+ TranslateService,
1611
+ PepDialogService,
1612
+ PepLayoutService,
1613
+ ]
1614
+ }
1615
+ ], 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 [blockTemplateRenderer]=\"blockTemplateRenderer\" [blockTemplateUnmount]=\"blockTemplateUnmount\"\n [key]=\"section.Key\" [name]=\"section.Name || ('LAYOUT_BUILDER.SECTION' | translate) + ' ' + (i+1)\" [split]=\"section.Split\" [height]=\"section.Height\"\n [columns]=\"section.Columns\" [padding]=\"section.Padding\" [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}.skeleton-container.no-height{height:0;overflow:hidden}.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: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "component", type: i3$3.PepSkeletonLoaderComponent, selector: "pep-skeleton-loader", inputs: ["rowHeightType", "rowsNumber", "lastRowOffset"] }, { kind: "component", type: i4$2.PepSizeDetectorComponent, selector: "pep-size-detector", inputs: ["showScreenSize", "useAsWebComponent"], outputs: ["sizeChange"] }, { kind: "directive", type: i3$2.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: i3$2.CdkDropListGroup, selector: "[cdkDropListGroup]", inputs: ["cdkDropListGroupDisabled"], exportAs: ["cdkDropListGroup"] }, { kind: "component", type: SectionComponent, selector: "section", inputs: ["blockTemplate", "blockTemplateRenderer", "blockTemplateUnmount", "key", "name", "split", "height", "collapseOnTablet", "padding", "columns", "hideIn", "columnsGap"] }, { kind: "pipe", type: i2.AsyncPipe, name: "async" }, { kind: "pipe", type: i1.TranslatePipe, name: "translate" }] });
1616
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepLayoutComponent, decorators: [{
1617
+ type: Component,
1618
+ args: [{ selector: 'pep-layout2', providers: [
1619
+ {
1620
+ provide: LayoutBuilderInternalService,
1621
+ useFactory: (parentLayoutBuilderInternalService, translate, dialogService, layoutService) => {
1622
+ return parentLayoutBuilderInternalService || new LayoutBuilderInternalService(translate, dialogService, layoutService);
1623
+ },
1624
+ deps: [
1625
+ [new Optional(), new SkipSelf(), LayoutBuilderInternalService],
1626
+ TranslateService,
1627
+ PepDialogService,
1628
+ PepLayoutService,
1629
+ ]
1630
+ }
1631
+ ], 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 [blockTemplateRenderer]=\"blockTemplateRenderer\" [blockTemplateUnmount]=\"blockTemplateUnmount\"\n [key]=\"section.Key\" [name]=\"section.Name || ('LAYOUT_BUILDER.SECTION' | translate) + ' ' + (i+1)\" [split]=\"section.Split\" [height]=\"section.Height\"\n [columns]=\"section.Columns\" [padding]=\"section.Padding\" [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}.skeleton-container.no-height{height:0;overflow:hidden}.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"] }]
1632
+ }], ctorParameters: function () { return [{ type: LayoutBuilderInternalService }, { type: i0.ElementRef }, { type: i0.Renderer2 }]; }, propDecorators: { skeletonContainer: [{
1633
+ type: ViewChild,
1634
+ args: ['skeletonCont', { static: true }]
1635
+ }], sectionsContainer: [{
1636
+ type: ViewChild,
1637
+ args: ['sectionsCont', { static: true }]
1638
+ }], editorMode: [{
1639
+ type: Input
1640
+ }], layoutView: [{
1641
+ type: Input
1642
+ }], blockTemplate: [{
1643
+ type: Input
1644
+ }], blockTemplateRenderer: [{
1645
+ type: Input
1646
+ }], blockTemplateUnmount: [{
1647
+ type: Input
1648
+ }], renderSkeleton: [{
1649
+ type: Input
1650
+ }], showSkeleton: [{
1651
+ type: Input
1652
+ }], layoutViewChange: [{
1653
+ type: Output
1654
+ }], screenTypeChange: [{
1655
+ type: Output
1656
+ }], paddingInline: [{
1657
+ type: HostBinding,
1658
+ args: ['style.padding-inline']
1659
+ }] } });
1660
+
1661
+ class PepLayout2Module {
1662
+ }
1663
+ PepLayout2Module.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepLayout2Module, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1664
+ PepLayout2Module.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.0.2", ngImport: i0, type: PepLayout2Module, declarations: [PepLayoutComponent], imports: [CommonModule,
1665
+ HttpClientModule,
1666
+ PepNgxLibModule,
1667
+ PepSkeletonLoaderModule,
1668
+ PepSizeDetectorModule,
1669
+ PepDialogModule,
1670
+ DragDropModule,
1671
+ SectionModule, i1.TranslateModule], exports: [PepLayoutComponent] });
1672
+ PepLayout2Module.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepLayout2Module, imports: [CommonModule,
1673
+ HttpClientModule,
1674
+ PepNgxLibModule,
1675
+ PepSkeletonLoaderModule,
1676
+ PepSizeDetectorModule,
1677
+ PepDialogModule,
1678
+ DragDropModule,
1679
+ SectionModule,
1680
+ TranslateModule.forChild()] });
1681
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepLayout2Module, decorators: [{
1682
+ type: NgModule,
1683
+ args: [{
1684
+ declarations: [
1685
+ PepLayoutComponent,
1686
+ ],
1687
+ imports: [
1688
+ CommonModule,
1689
+ HttpClientModule,
1690
+ PepNgxLibModule,
1691
+ PepSkeletonLoaderModule,
1692
+ PepSizeDetectorModule,
1693
+ PepDialogModule,
1694
+ DragDropModule,
1695
+ SectionModule,
1696
+ TranslateModule.forChild()
1697
+ ],
1698
+ exports: [PepLayoutComponent],
1699
+ providers: []
1700
+ }]
1701
+ }] });
1702
+
1703
+ class PepLayoutBuilderEditorComponent extends BaseDestroyerDirective {
1704
+ constructor(hostElement, renderer) {
1705
+ super();
1706
+ this.hostElement = hostElement;
1707
+ this.renderer = renderer;
1708
+ this.editorTabs = [];
1709
+ this.renderer.addClass(this.hostElement.nativeElement, 'pep-layout-builder-editor');
1710
+ }
1711
+ }
1712
+ PepLayoutBuilderEditorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepLayoutBuilderEditorComponent, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Component });
1713
+ PepLayoutBuilderEditorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.2", type: PepLayoutBuilderEditorComponent, selector: "pep-layout-builder-editor", inputs: { editorTabs: "editorTabs" }, usesInheritance: true, ngImport: i0, template: "<ng-container *ngIf=\"editorTabs && editorTabs.length > 0 then tabsTemplate else regularTemplate\">\n</ng-container>\n<ng-template #tabsTemplate>\n <mat-tab-group #tabGroup class=\"layout-builder-editor-tabs\" animationDuration=\"0ms\">\n <mat-tab *ngFor=\"let tab of editorTabs\" label=\"{{tab.title | translate}}\">\n <div class=\"layout-builder-editor-tab\">\n <ng-container *ngIf=\"tab.templateRef\">\n <ng-container *ngTemplateOutlet=\"tab.templateRef; context: { tabKey: tab.key }\">\n </ng-container>\n </ng-container>\n <ng-container *ngIf=\"!tab.templateRef\">\n <ng-content></ng-content>\n </ng-container>\n </div>\n </mat-tab>\n </mat-tab-group>\n\n</ng-template>\n<ng-template #regularTemplate>\n <div class=\"layout-builder-editor-container\">\n <ng-content></ng-content>\n </div>\n</ng-template>", styles: [""], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: i2$2.MatTabGroup, selector: "mat-tab-group", inputs: ["color", "disableRipple"], exportAs: ["matTabGroup"] }, { kind: "component", type: i2$2.MatTab, selector: "mat-tab", inputs: ["disabled", "label", "aria-label", "aria-labelledby", "labelClass", "bodyClass"], exportAs: ["matTab"] }, { kind: "pipe", type: i1.TranslatePipe, name: "translate" }] });
1714
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepLayoutBuilderEditorComponent, decorators: [{
1715
+ type: Component,
1716
+ args: [{ selector: 'pep-layout-builder-editor', template: "<ng-container *ngIf=\"editorTabs && editorTabs.length > 0 then tabsTemplate else regularTemplate\">\n</ng-container>\n<ng-template #tabsTemplate>\n <mat-tab-group #tabGroup class=\"layout-builder-editor-tabs\" animationDuration=\"0ms\">\n <mat-tab *ngFor=\"let tab of editorTabs\" label=\"{{tab.title | translate}}\">\n <div class=\"layout-builder-editor-tab\">\n <ng-container *ngIf=\"tab.templateRef\">\n <ng-container *ngTemplateOutlet=\"tab.templateRef; context: { tabKey: tab.key }\">\n </ng-container>\n </ng-container>\n <ng-container *ngIf=\"!tab.templateRef\">\n <ng-content></ng-content>\n </ng-container>\n </div>\n </mat-tab>\n </mat-tab-group>\n\n</ng-template>\n<ng-template #regularTemplate>\n <div class=\"layout-builder-editor-container\">\n <ng-content></ng-content>\n </div>\n</ng-template>" }]
1717
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.Renderer2 }]; }, propDecorators: { editorTabs: [{
1718
+ type: Input
1719
+ }] } });
1720
+
1721
+ class MainEditorComponent extends BaseDestroyerDirective {
1722
+ // protected showBottomContent = false;
1723
+ // onLoadFlowHostObject;
1724
+ // onChangeFlowHostObject;
1725
+ constructor(hostElement, renderer) {
1726
+ super();
1727
+ this.hostElement = hostElement;
1728
+ this.renderer = renderer;
1729
+ this.availableBlocksForDrag = [];
1730
+ this.sectionsColumnsDropList = [];
1731
+ this._layoutEditorTopElement = null;
1732
+ this.hostObjectChange = new EventEmitter();
1733
+ this.addSectionClick = new EventEmitter();
1734
+ this.onBlockDragStart = new EventEmitter();
1735
+ this.onBlockDragEnd = new EventEmitter();
1736
+ this.horizontalSpacing = 'md';
1737
+ this.verticalSpacing = 'md';
1738
+ this.sectionsGap = 'md';
1739
+ this.columnsGap = 'md';
1740
+ this.roundedCorners = 'none';
1741
+ // protected sizesGroupButtons = Array<ISpacingOption>();
1742
+ this.availableBlocksContainerId = LayoutBuilderInternalService.AVAILABLE_BLOCKS_CONTAINER_ID;
1743
+ this.showTopContent = false;
1744
+ this.renderer.addClass(this.hostElement.nativeElement, 'pep-layout-main-editor');
1745
+ }
1746
+ set layoutEditorTopElement(value) {
1747
+ this._layoutEditorTopElement = value;
1748
+ this.mountLayoutEditorTopElement();
1749
+ }
1750
+ get layoutEditorTopElement() {
1751
+ return this._layoutEditorTopElement;
1752
+ }
1753
+ set hostObject(value) {
1754
+ if (!value) {
1755
+ return;
1756
+ }
1757
+ this._hostObject = value;
1758
+ this.isFullWidth = !value.maxWidth || value.maxWidth === 0;
1759
+ this.maxWidth = value.maxWidth;
1760
+ this.horizontalSpacing = this._hostObject.horizontalSpacing || 'md';
1761
+ this.verticalSpacing = this._hostObject.verticalSpacing || 'md';
1762
+ this.sectionsGap = this._hostObject.sectionsGap || 'md';
1763
+ this.columnsGap = this._hostObject.columnsGap || 'md';
1764
+ this.roundedCorners = this._hostObject.roundedCorners || 'none';
1765
+ }
1766
+ get hostObject() {
1767
+ return this._hostObject;
1768
+ }
1769
+ mountLayoutEditorTopElement() {
1770
+ var _a;
1771
+ if (!((_a = this.layoutEditorTopHost) === null || _a === void 0 ? void 0 : _a.nativeElement)) {
1772
+ return;
1773
+ }
1774
+ const host = this.layoutEditorTopHost.nativeElement;
1775
+ if (!this._layoutEditorTopElement) {
1776
+ if (host.childElementCount > 0) {
1777
+ host.replaceChildren();
1778
+ }
1779
+ this.showTopContent = false;
1780
+ return;
1781
+ }
1782
+ if (host.childElementCount === 1 && host.firstElementChild === this._layoutEditorTopElement) {
1783
+ this.showTopContent = true;
1784
+ return;
1785
+ }
1786
+ host.replaceChildren();
1787
+ host.appendChild(this._layoutEditorTopElement);
1788
+ this.showTopContent = true;
1789
+ }
1790
+ updateHostObject() {
1791
+ this._hostObject.maxWidth = this.isFullWidth ? 0 : this.maxWidth;
1792
+ this._hostObject.horizontalSpacing = this.horizontalSpacing;
1793
+ this._hostObject.verticalSpacing = this.verticalSpacing;
1794
+ this._hostObject.sectionsGap = this.sectionsGap;
1795
+ this._hostObject.columnsGap = this.columnsGap;
1796
+ this._hostObject.roundedCorners = this.roundedCorners === 'none' ? undefined : this.roundedCorners;
1797
+ this.hostObjectChange.emit(this.hostObject);
1798
+ }
1799
+ ngOnInit() {
1800
+ this.mountLayoutEditorTopElement();
1801
+ // this.layoutBuilderInternalService.sectionsColumnsDropListChange$.subscribe((sectionsColumnsDropList: any) => {
1802
+ // this.sectionsColumnsDropList = sectionsColumnsDropList;
1803
+ // });
1804
+ }
1805
+ ngAfterViewChecked() {
1806
+ this.mountLayoutEditorTopElement();
1807
+ }
1808
+ onAddSectionClick(event) {
1809
+ this.addSectionClick.emit();
1810
+ }
1811
+ isFullWidthChange(isChecked) {
1812
+ this.isFullWidth = isChecked;
1813
+ this.maxWidth = isChecked ? 0 : 960;
1814
+ this.updateHostObject();
1815
+ }
1816
+ onMaxWidthChange(maxWidth) {
1817
+ this.maxWidth = coerceNumberProperty(maxWidth, this.maxWidth);
1818
+ this.updateHostObject();
1819
+ }
1820
+ setColumnsHorizntalGap(key) {
1821
+ this.horizontalSpacing = key;
1822
+ this.updateHostObject();
1823
+ }
1824
+ setColumnsVerticalGap(key) {
1825
+ this.verticalSpacing = key;
1826
+ this.updateHostObject();
1827
+ }
1828
+ setSectionGap(key) {
1829
+ this.sectionsGap = key;
1830
+ this.updateHostObject();
1831
+ }
1832
+ setColumnsGap(key) {
1833
+ this.columnsGap = key;
1834
+ this.updateHostObject();
1835
+ }
1836
+ setRoundedCorners(key) {
1837
+ this.roundedCorners = key;
1838
+ this.updateHostObject();
1839
+ }
1840
+ onDragStart(event) {
1841
+ this.onBlockDragStart.emit(event);
1842
+ // this.layoutBuilderInternalService.onBlockDragStart(event);
1843
+ }
1844
+ onDragEnd(event) {
1845
+ this.onBlockDragEnd.emit(event);
1846
+ // this.layoutBuilderInternalService.onBlockDragEnd(event);
1847
+ }
1848
+ }
1849
+ MainEditorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: MainEditorComponent, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Component });
1850
+ MainEditorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.2", type: MainEditorComponent, selector: "main-editor", inputs: { availableBlocksForDrag: "availableBlocksForDrag", sectionsColumnsDropList: "sectionsColumnsDropList", layoutEditorTopElement: "layoutEditorTopElement", hostObject: "hostObject" }, outputs: { hostObjectChange: "hostObjectChange", addSectionClick: "addSectionClick", onBlockDragStart: "onBlockDragStart", onBlockDragEnd: "onBlockDragEnd" }, viewQueries: [{ propertyName: "layoutEditorTopHost", first: true, predicate: ["layoutEditorTopHost"], descendants: true }, { propertyName: "availableBlocksContainer", first: true, predicate: ["availableBlocksContainer"], descendants: true, read: ElementRef }], usesInheritance: true, ngImport: i0, template: "<pep-layout-builder-editor [editorTabs]=\"[\n {key: '1', title: 'LAYOUT_BUILDER.GENERAL', templateRef: firstTabTemplate}, \n {key: '2', title: 'LAYOUT_BUILDER.DESIGN', templateRef: secondTabTemplate}]\">\n</pep-layout-builder-editor>\n\n<ng-template #firstTabTemplate let-tabKey=\"tabKey\">\n <div class=\"layout-builder-editor-group\">\n <div #layoutEditorTopHost data-layout-editor-top-host=\"true\"></div>\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</ng-template>\n\n<ng-template #secondTabTemplate let-tabKey=\"tabKey\">\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 ? maxWidth.toString() : '0'\" (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</ng-template>\n", styles: [":host pep-draggable-items ::ng-deep .draggable-items-overflow{padding-bottom:0!important}\n"], dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i2$3.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", "validationChange"] }, { kind: "component", type: i4$1.PepButtonComponent, selector: "pep-button", inputs: ["key", "value", "styleType", "styleStateType", "sizeType", "classNames", "disabled", "iconName", "iconPosition", "visible"], outputs: ["buttonClick"] }, { kind: "component", type: i4$3.PepCheckboxComponent, selector: "pep-checkbox", inputs: ["key", "value", "label", "id", "type", "mandatory", "disabled", "readonly", "xAlignment", "rowSpan", "additionalValue", "form", "isActive", "showTitle", "renderTitle", "layoutType", "visible"], outputs: ["valueChange", "validationChange"] }, { kind: "component", type: i5$2.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: "component", type: PepLayoutBuilderEditorComponent, selector: "pep-layout-builder-editor", inputs: ["editorTabs"] }, { kind: "pipe", type: i1.TranslatePipe, name: "translate" }] });
1851
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: MainEditorComponent, decorators: [{
1852
+ type: Component,
1853
+ args: [{ selector: 'main-editor', template: "<pep-layout-builder-editor [editorTabs]=\"[\n {key: '1', title: 'LAYOUT_BUILDER.GENERAL', templateRef: firstTabTemplate}, \n {key: '2', title: 'LAYOUT_BUILDER.DESIGN', templateRef: secondTabTemplate}]\">\n</pep-layout-builder-editor>\n\n<ng-template #firstTabTemplate let-tabKey=\"tabKey\">\n <div class=\"layout-builder-editor-group\">\n <div #layoutEditorTopHost data-layout-editor-top-host=\"true\"></div>\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</ng-template>\n\n<ng-template #secondTabTemplate let-tabKey=\"tabKey\">\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 ? maxWidth.toString() : '0'\" (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</ng-template>\n", styles: [":host pep-draggable-items ::ng-deep .draggable-items-overflow{padding-bottom:0!important}\n"] }]
1854
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.Renderer2 }]; }, propDecorators: { layoutEditorTopHost: [{
1855
+ type: ViewChild,
1856
+ args: ['layoutEditorTopHost', { static: false }]
1857
+ }], availableBlocksContainer: [{
1858
+ type: ViewChild,
1859
+ args: ['availableBlocksContainer', { read: ElementRef }]
1860
+ }], availableBlocksForDrag: [{
1861
+ type: Input
1862
+ }], sectionsColumnsDropList: [{
1863
+ type: Input
1864
+ }], layoutEditorTopElement: [{
1865
+ type: Input
1866
+ }], hostObject: [{
1867
+ type: Input
1868
+ }], hostObjectChange: [{
1869
+ type: Output
1870
+ }], addSectionClick: [{
1871
+ type: Output
1872
+ }], onBlockDragStart: [{
1873
+ type: Output
1874
+ }], onBlockDragEnd: [{
1875
+ type: Output
1876
+ }] } });
1877
+
1878
+ class PepLayoutBuilderEditorModule {
1879
+ constructor() {
1880
+ //
1881
+ }
1882
+ }
1883
+ PepLayoutBuilderEditorModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepLayoutBuilderEditorModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1884
+ PepLayoutBuilderEditorModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.0.2", ngImport: i0, type: PepLayoutBuilderEditorModule, declarations: [PepLayoutBuilderEditorComponent], imports: [CommonModule,
1885
+ HttpClientModule,
1886
+ OverlayModule,
1887
+ MatTabsModule,
1888
+ PepNgxLibModule, i1.TranslateModule], exports: [PepLayoutBuilderEditorComponent] });
1889
+ PepLayoutBuilderEditorModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepLayoutBuilderEditorModule, imports: [CommonModule,
1890
+ HttpClientModule,
1891
+ OverlayModule,
1892
+ MatTabsModule,
1893
+ PepNgxLibModule,
1894
+ TranslateModule.forChild()] });
1895
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepLayoutBuilderEditorModule, decorators: [{
1896
+ type: NgModule,
1897
+ args: [{
1898
+ declarations: [
1899
+ PepLayoutBuilderEditorComponent
1900
+ ],
1901
+ imports: [
1902
+ CommonModule,
1903
+ HttpClientModule,
1904
+ OverlayModule,
1905
+ MatTabsModule,
1906
+ PepNgxLibModule,
1907
+ TranslateModule.forChild()
1908
+ ],
1909
+ exports: [PepLayoutBuilderEditorComponent]
1910
+ }]
1911
+ }], ctorParameters: function () { return []; } });
1912
+
1913
+ class MainEditorModule {
1914
+ constructor() {
1915
+ // this.pepIconRegistry.registerIcons(pepIcons);
1916
+ }
1917
+ }
1918
+ MainEditorModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: MainEditorModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1919
+ MainEditorModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.0.2", ngImport: i0, type: MainEditorModule, declarations: [MainEditorComponent], imports: [CommonModule,
1920
+ HttpClientModule,
1921
+ DragDropModule,
1922
+ OverlayModule,
1923
+ MatTabsModule,
1924
+ MatSliderModule,
1925
+ PepNgxLibModule,
1926
+ PepSelectModule,
1927
+ PepTextboxModule,
1928
+ PepButtonModule,
1929
+ PepCheckboxModule,
1930
+ PepGroupButtonsModule,
1931
+ PepColorModule,
1932
+ PepImageModule,
1933
+ PepGroupButtonsSettingsModule,
1934
+ PepDraggableItemsModule,
1935
+ PepDialogModule,
1936
+ PepLayoutBuilderEditorModule, i1.TranslateModule], exports: [MainEditorComponent] });
1937
+ MainEditorModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: MainEditorModule, imports: [CommonModule,
1938
+ HttpClientModule,
1939
+ DragDropModule,
1940
+ OverlayModule,
1941
+ MatTabsModule,
1942
+ MatSliderModule,
1943
+ PepNgxLibModule,
1944
+ PepSelectModule,
1945
+ PepTextboxModule,
1946
+ PepButtonModule,
1947
+ PepCheckboxModule,
1948
+ PepGroupButtonsModule,
1949
+ PepColorModule,
1950
+ PepImageModule,
1951
+ PepGroupButtonsSettingsModule,
1952
+ PepDraggableItemsModule,
1953
+ PepDialogModule,
1954
+ PepLayoutBuilderEditorModule,
1955
+ TranslateModule.forChild()] });
1956
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: MainEditorModule, decorators: [{
1957
+ type: NgModule,
1958
+ args: [{
1959
+ declarations: [
1960
+ MainEditorComponent
1961
+ ],
1962
+ imports: [
1963
+ CommonModule,
1964
+ HttpClientModule,
1965
+ DragDropModule,
1966
+ OverlayModule,
1967
+ MatTabsModule,
1968
+ MatSliderModule,
1969
+ PepNgxLibModule,
1970
+ PepSelectModule,
1971
+ PepTextboxModule,
1972
+ PepButtonModule,
1973
+ PepCheckboxModule,
1974
+ PepGroupButtonsModule,
1975
+ PepColorModule,
1976
+ PepImageModule,
1977
+ PepGroupButtonsSettingsModule,
1978
+ PepDraggableItemsModule,
1979
+ PepDialogModule,
1980
+ PepLayoutBuilderEditorModule,
1981
+ TranslateModule.forChild()
1982
+ ],
1983
+ exports: [MainEditorComponent]
1984
+ }]
1985
+ }], ctorParameters: function () { return []; } });
1986
+
1987
+ class SectionEditorComponent {
1988
+ constructor(translate, dialog) {
1989
+ this.translate = translate;
1990
+ this.dialog = dialog;
1991
+ this.MIN_HEIGHT = 40;
1992
+ this.sectionName = '';
1993
+ this.isAutoHeight = true;
1994
+ this.height = this.MIN_HEIGHT;
1995
+ this.hostObjectChange = new EventEmitter();
1996
+ this.collapseOnTablet = false;
1997
+ this.fillHeight = false;
1998
+ this.subSections = false;
1999
+ this.partsNumber = "2";
2000
+ this.partsNumberOptions = Array();
2001
+ this.splitOptions = Array();
2002
+ this.allSplitOptions = Array();
2003
+ this.padding = new PepPaddingSettings(true, '0');
2004
+ this.initData();
2005
+ }
2006
+ set hostObject(value) {
2007
+ var _a, _b, _c;
2008
+ if (!value) {
2009
+ return;
2010
+ }
2011
+ this._hostObject = value;
2012
+ this.sectionName = value.sectionName;
2013
+ this.split = value.split;
2014
+ this.isAutoHeight = !value.height || value.height === 0;
2015
+ this.height = this.isAutoHeight ? this.MIN_HEIGHT : value.height;
2016
+ this.collapseOnTablet = (_a = value.collapseOnTablet) !== null && _a !== void 0 ? _a : false;
2017
+ this.fillHeight = (_b = value.fillHeight) !== null && _b !== void 0 ? _b : false;
2018
+ this.padding = (_c = value.padding) !== null && _c !== void 0 ? _c : new PepPaddingSettings(true, '0');
2019
+ }
2020
+ get hostObject() {
2021
+ return this._hostObject;
2022
+ }
2023
+ set split(value) {
2024
+ this._split = value;
2025
+ this.subSections = (this._split && this._split.length > 0) ? true : false;
2026
+ // Check how many parts we have.
2027
+ const arr = value === null || value === void 0 ? void 0 : value.split(' ');
2028
+ if (arr && arr.length > 1 && arr.length <= 4) {
2029
+ this.partsNumber = arr.length.toString();
2030
+ }
2031
+ else {
2032
+ this.partsNumber = "2";
2033
+ }
2034
+ this.loadSplitOptions();
2035
+ }
2036
+ get split() {
2037
+ return this._split;
2038
+ }
2039
+ initData() {
2040
+ this.partsNumberOptions = [
2041
+ { 'key': '2', 'value': '2 Parts' },
2042
+ { 'key': '3', 'value': '3 Parts' },
2043
+ { 'key': '4', 'value': '4 Parts' }
2044
+ ];
2045
+ this.allSplitOptions = [
2046
+ { 'key': '2', 'value': [
2047
+ { 'key': '1/4 3/4', 'value': '1/4-3/4' },
2048
+ { 'key': '1/3 2/3', 'value': '1/3-2/3' },
2049
+ { 'key': '1/2 1/2', 'value': '1/2-1/2' },
2050
+ { 'key': '2/3 1/3', 'value': '2/3-1/3' },
2051
+ { 'key': '3/4 1/4', 'value': '3/4-1/4' },
2052
+ ] },
2053
+ { 'key': '3', 'value': [
2054
+ { 'key': '1/3 1/3 1/3', 'value': '1/3-1/3-1/3' },
2055
+ { 'key': '1/2 1/4 1/4', 'value': '1/2-1/4-1/4' },
2056
+ { 'key': '1/4 1/2 1/4', 'value': '1/4-1/2-1/4' },
2057
+ { 'key': '1/4 1/4 1/2', 'value': '1/4-1/4-1/2' },
2058
+ ] },
2059
+ { 'key': '4', 'value': [
2060
+ { 'key': '1/4 1/4 1/4 1/4', 'value': '1/4-1/4-1/4-1/4' },
2061
+ ] }
2062
+ ];
2063
+ }
2064
+ loadSplitOptions() {
2065
+ const splitOptions = this.allSplitOptions.find((option) => option.key === this.partsNumber);
2066
+ if (splitOptions) {
2067
+ this.splitOptions = splitOptions.value;
2068
+ }
2069
+ else {
2070
+ this.splitOptions = this.allSplitOptions[0].value;
2071
+ }
2072
+ if (!this._split) {
2073
+ this._split = this.splitOptions[0].key;
2074
+ }
2075
+ }
2076
+ updateHostObject() {
2077
+ this._hostObject.sectionName = this.sectionName;
2078
+ this._hostObject.split = this.subSections ? this.split : undefined;
2079
+ this._hostObject.height = this.isAutoHeight ? 0 : this.height;
2080
+ this._hostObject.collapseOnTablet = this.collapseOnTablet;
2081
+ this._hostObject.fillHeight = this.fillHeight;
2082
+ this._hostObject.padding = this.padding;
2083
+ this.hostObjectChange.emit(this.hostObject);
2084
+ }
2085
+ ngOnInit() {
2086
+ this.loadSplitOptions();
2087
+ }
2088
+ isAutoHeightChange(isChecked) {
2089
+ this.isAutoHeight = isChecked;
2090
+ this.updateHostObject();
2091
+ }
2092
+ onHeightChange(height) {
2093
+ if (height >= this.MIN_HEIGHT) {
2094
+ this.height = coerceNumberProperty(height, this.height);
2095
+ this.updateHostObject();
2096
+ }
2097
+ }
2098
+ onSectionNameChange(value) {
2099
+ this.sectionName = value;
2100
+ this.updateHostObject();
2101
+ }
2102
+ onCollapseOnTabletChange(value) {
2103
+ this.collapseOnTablet = value;
2104
+ this.updateHostObject();
2105
+ }
2106
+ onFillHeightChange(value) {
2107
+ this.fillHeight = value;
2108
+ this.updateHostObject();
2109
+ }
2110
+ onPaddingChange(value) {
2111
+ this.padding = value;
2112
+ this.updateHostObject();
2113
+ }
2114
+ onSubSectionsChange(value) {
2115
+ const oldValue = this.subSections;
2116
+ // Check if cancel the sub sections ( change from any -> 1 section ), if true need to show confirm message
2117
+ if (value === false) {
2118
+ this.subSections = value;
2119
+ this.showDeleteSectionMsg(() => {
2120
+ this.updateHostObject();
2121
+ }, () => {
2122
+ this.subSections = oldValue;
2123
+ });
2124
+ }
2125
+ else {
2126
+ this.subSections = value;
2127
+ this.updateHostObject();
2128
+ }
2129
+ }
2130
+ onPartsNumberChange(key) {
2131
+ const oldKey = this.partsNumber;
2132
+ // Check if decrease on sub sections number, if true need to show confirm message
2133
+ if (key && parseInt(key) < parseInt(this.partsNumber)) {
2134
+ this.partsNumber = key;
2135
+ this.showDeleteSectionMsg(() => {
2136
+ this.loadSplitOptions();
2137
+ this._split = this.splitOptions[0].key;
2138
+ this.updateHostObject();
2139
+ }, () => {
2140
+ this.partsNumber = oldKey;
2141
+ });
2142
+ }
2143
+ else {
2144
+ this.partsNumber = key;
2145
+ this.loadSplitOptions();
2146
+ this._split = this.splitOptions[0].key;
2147
+ this.updateHostObject();
2148
+ }
2149
+ }
2150
+ showDeleteSectionMsg(continueCB, cancelCB) {
2151
+ const actionButtons = [
2152
+ new PepDialogActionButton(this.translate.instant('ACTIONS.CANCEL'), '', () => {
2153
+ cancelCB();
2154
+ }),
2155
+ new PepDialogActionButton(this.translate.instant('ACTIONS.CONTINUE'), 'strong caution', () => {
2156
+ continueCB();
2157
+ })
2158
+ ];
2159
+ const content = this.translate.instant('LAYOUT_BUILDER.DELETE_SECTION_MSG');
2160
+ const title = this.translate.instant('LAYOUT_BUILDER.DELETE_SECTION_TITLE');
2161
+ const dataMsg = new PepDialogData({ title, actionsType: 'custom', content, actionButtons });
2162
+ this.dialog.openDefaultDialog(dataMsg);
2163
+ }
2164
+ onSplitChange(key) {
2165
+ this._split = key;
2166
+ this.updateHostObject();
2167
+ }
2168
+ }
2169
+ SectionEditorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: SectionEditorComponent, deps: [{ token: i1.TranslateService }, { token: i2$1.PepDialogService }], target: i0.ɵɵFactoryTarget.Component });
2170
+ 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: "<pep-layout-builder-editor class=\"section-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 <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 <label class=\"editor-title\">{{'LAYOUT_BUILDER.LAYOUT' | translate}}</label>\n <pep-checkbox class=\"checkbox-as-sub-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>\n <pep-checkbox class=\"checkbox-as-sub-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>\n <pep-checkbox class=\"checkbox-as-sub-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 class=\"editor-separator\"></div>\n <pep-padding-settings \n [padding]=\"padding\" (paddingChange)=\"onPaddingChange($event)\">\n</pep-padding-settings>\n</pep-layout-builder-editor>\n\n<!-- <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 <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: i2$3.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", "validationChange"] }, { kind: "component", type: i4$4.PepSelectComponent, selector: "pep-select", inputs: ["key", "value", "label", "type", "mandatory", "disabled", "readonly", "xAlignment", "rowSpan", "placeholder", "placeholderWhenDisabled", "autoSortOptions", "options", "visible", "emptyOption", "form", "layoutType", "parentFieldKey", "isActive", "showTitle", "renderTitle", "typeaheadDebounceInterval", "addValueToOptionsIfNotExist"], outputs: ["valueChange", "validationChange"] }, { kind: "component", type: i4$3.PepCheckboxComponent, selector: "pep-checkbox", inputs: ["key", "value", "label", "id", "type", "mandatory", "disabled", "readonly", "xAlignment", "rowSpan", "additionalValue", "form", "isActive", "showTitle", "renderTitle", "layoutType", "visible"], outputs: ["valueChange", "validationChange"] }, { kind: "component", type: PepLayoutBuilderEditorComponent, selector: "pep-layout-builder-editor", inputs: ["editorTabs"] }, { kind: "component", type: i7.PaddingSettingsComponent, selector: "pep-padding-settings", inputs: ["padding"], outputs: ["paddingChange"] }, { kind: "pipe", type: i1.TranslatePipe, name: "translate" }] });
2171
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: SectionEditorComponent, decorators: [{
2172
+ type: Component,
2173
+ args: [{ selector: 'section-editor', template: "<pep-layout-builder-editor class=\"section-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 <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 <label class=\"editor-title\">{{'LAYOUT_BUILDER.LAYOUT' | translate}}</label>\n <pep-checkbox class=\"checkbox-as-sub-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>\n <pep-checkbox class=\"checkbox-as-sub-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>\n <pep-checkbox class=\"checkbox-as-sub-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 class=\"editor-separator\"></div>\n <pep-padding-settings \n [padding]=\"padding\" (paddingChange)=\"onPaddingChange($event)\">\n</pep-padding-settings>\n</pep-layout-builder-editor>\n\n<!-- <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 <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"] }]
2174
+ }], ctorParameters: function () { return [{ type: i1.TranslateService }, { type: i2$1.PepDialogService }]; }, propDecorators: { hostObject: [{
2175
+ type: Input
2176
+ }], hostObjectChange: [{
2177
+ type: Output
2178
+ }] } });
2179
+
2180
+ class SectionEditorModule {
2181
+ }
2182
+ SectionEditorModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: SectionEditorModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
2183
+ SectionEditorModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.0.2", ngImport: i0, type: SectionEditorModule, declarations: [SectionEditorComponent], imports: [CommonModule,
2184
+ PepButtonModule,
2185
+ PepTextboxModule,
2186
+ PepSelectModule,
2187
+ PepCheckboxModule,
2188
+ PepLayoutBuilderEditorModule,
2189
+ PepPaddingSettingsModule, i1.TranslateModule], exports: [SectionEditorComponent] });
2190
+ SectionEditorModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: SectionEditorModule, imports: [CommonModule,
2191
+ PepButtonModule,
2192
+ PepTextboxModule,
2193
+ PepSelectModule,
2194
+ PepCheckboxModule,
2195
+ PepLayoutBuilderEditorModule,
2196
+ PepPaddingSettingsModule,
2197
+ TranslateModule.forChild()] });
2198
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: SectionEditorModule, decorators: [{
2199
+ type: NgModule,
2200
+ args: [{
2201
+ declarations: [SectionEditorComponent],
2202
+ imports: [
2203
+ CommonModule,
2204
+ PepButtonModule,
2205
+ PepTextboxModule,
2206
+ PepSelectModule,
2207
+ PepCheckboxModule,
2208
+ PepLayoutBuilderEditorModule,
2209
+ PepPaddingSettingsModule,
2210
+ TranslateModule.forChild()
2211
+ ],
2212
+ exports: [SectionEditorComponent]
2213
+ }]
2214
+ }] });
2215
+
2216
+ // import { PepLayoutBuilderService } from './layout-builder.service';
2217
+ class PepLayoutBuilder2Component extends BaseDestroyerDirective {
2218
+ constructor(renderer, hostElement, translate,
2219
+ // private layoutBuilderService: PepLayoutBuilderService,
2220
+ // private layoutBuilderInternalService: LayoutBuilderInternalService,
2221
+ layoutBuilderInternalService, pepAddonService) {
2222
+ super();
2223
+ this.renderer = renderer;
2224
+ this.hostElement = hostElement;
2225
+ this.translate = translate;
2226
+ this.pepAddonService = pepAddonService;
2227
+ this._availableBlocksForDrag = [];
2228
+ this._blocksLayoutConfig = {};
2229
+ this._layoutEditorTitle = '';
2230
+ this.lockScreen = false;
2231
+ this.showSkeleton = false;
2232
+ this.updateShellRouterData = true;
2233
+ this.manageGlobalCursor = true;
2234
+ this._layoutEditorTopElement = null;
2235
+ this._headerEndElement = null;
2236
+ this._blockEditorElement = null;
2237
+ this._layoutContentElement = null;
2238
+ this.blockTemplateRenderer = null;
2239
+ this.blockTemplateUnmount = null;
2240
+ this.layoutView = null;
2241
+ this.backClick = new EventEmitter();
2242
+ this.editorChange = new EventEmitter();
2243
+ this.blockAdded = new EventEmitter();
2244
+ this.blocksRemoved = new EventEmitter();
2245
+ this.editableStateChange = new EventEmitter();
2246
+ this.layoutViewChange = new EventEmitter();
2247
+ this.screenTypeChange = new EventEmitter();
2248
+ this.previewMode = false;
2249
+ this.currentEditor = null;
2250
+ this.viewportWidth = 0;
2251
+ this.sectionsColumnsDropList = [];
2252
+ this.layoutBuilderInternalService = layoutBuilderInternalService;
2253
+ this.renderer.addClass(this.hostElement.nativeElement, 'pep-layout-builder');
2254
+ }
2255
+ set availableBlocksForDrag(value) {
2256
+ this._availableBlocksForDrag = value;
2257
+ }
2258
+ get availableBlocksForDrag() {
2259
+ return this._availableBlocksForDrag;
2260
+ }
2261
+ set blocksLayoutConfig(value) {
2262
+ this._blocksLayoutConfig = value;
2263
+ this.setBlocksConfig();
2264
+ }
2265
+ set layoutEditorTitle(value) {
2266
+ this._layoutEditorTitle = value;
2267
+ }
2268
+ get layoutEditorTitle() {
2269
+ return this._layoutEditorTitle;
2270
+ }
2271
+ set layoutEditorTopElement(value) {
2272
+ this._layoutEditorTopElement = value;
2273
+ }
2274
+ get layoutEditorTopElement() {
2275
+ return this._layoutEditorTopElement;
2276
+ }
2277
+ set headerEndElement(value) {
2278
+ this._headerEndElement = value;
2279
+ this.mountHeaderEndElement();
2280
+ }
2281
+ get headerEndElement() {
2282
+ return this._headerEndElement;
2283
+ }
2284
+ set blockEditorElement(value) {
2285
+ this._blockEditorElement = value;
2286
+ this.mountBlockEditorElement();
2287
+ }
2288
+ get blockEditorElement() {
2289
+ return this._blockEditorElement;
2290
+ }
2291
+ set layoutContentElement(value) {
2292
+ this._layoutContentElement = value;
2293
+ this.mountLayoutContentElement();
2294
+ }
2295
+ get layoutContentElement() {
2296
+ return this._layoutContentElement;
2297
+ }
2298
+ mountElement(hostRef, element) {
2299
+ const host = hostRef === null || hostRef === void 0 ? void 0 : hostRef.nativeElement;
2300
+ if (!host) {
2301
+ return;
2302
+ }
2303
+ host.replaceChildren();
2304
+ if (element) {
2305
+ host.appendChild(element);
2306
+ }
2307
+ }
2308
+ mountHeaderEndElement() {
2309
+ this.mountElement(this.headerEndHost, this._headerEndElement);
2310
+ }
2311
+ mountBlockEditorElement() {
2312
+ this.mountElement(this.blockEditorHost, this._blockEditorElement);
2313
+ }
2314
+ mountLayoutContentElement() {
2315
+ this.mountElement(this.layoutContentHost, this._layoutContentElement);
2316
+ }
2317
+ setScreenWidth(screenType) {
2318
+ var _a;
2319
+ (_a = this.layoutBuilderInternalService) === null || _a === void 0 ? void 0 : _a.setScreenWidth(screenType);
2320
+ }
2321
+ updateViewportWidth() {
2322
+ var _a;
2323
+ if ((_a = this.layoutBuilderWrapper) === null || _a === void 0 ? void 0 : _a.nativeElement) {
2324
+ setTimeout(() => {
2325
+ this.viewportWidth = this.layoutBuilderWrapper.nativeElement.clientWidth;
2326
+ });
2327
+ }
2328
+ }
2329
+ subscribeEvents(layoutBuilderInternalService) {
2330
+ if (layoutBuilderInternalService) {
2331
+ /***********************************************************************************************/
2332
+ /* Internal Events - for code usage
2333
+ /***********************************************************************************************/
2334
+ layoutBuilderInternalService.sectionsColumnsDropListChange$.pipe(this.getDestroyer()).subscribe((sectionsColumnsDropList) => {
2335
+ this.sectionsColumnsDropList = sectionsColumnsDropList;
2336
+ });
2337
+ layoutBuilderInternalService.previewModeChange$.pipe(this.getDestroyer()).subscribe((previewMode) => {
2338
+ this.previewMode = previewMode;
2339
+ this.editableStateChange.emit(!this.previewMode);
2340
+ });
2341
+ // layoutBuilderInternalService.lockScreenChange$.pipe(this.getDestroyer()).subscribe((lockScreen: any) => {
2342
+ // this.lockScreen = lockScreen;
2343
+ // });
2344
+ layoutBuilderInternalService.screenSizeChange$.pipe(this.getDestroyer()).subscribe((size) => {
2345
+ const screenType = layoutBuilderInternalService.getScreenType(size);
2346
+ this.selectedScreenType = screenType;
2347
+ this.screenTypeChange.emit(screenType);
2348
+ });
2349
+ // For update the layout data
2350
+ layoutBuilderInternalService.layoutViewChange$.pipe(this.getDestroyer()).subscribe((layoutView) => {
2351
+ var _a;
2352
+ if (layoutView) {
2353
+ if ((_a = this.layoutBuilderWrapper) === null || _a === void 0 ? void 0 : _a.nativeElement) {
2354
+ const maxWidth = coerceNumberProperty(layoutView.Layout.MaxWidth, 0);
2355
+ const maxWidthToSet = maxWidth === 0 ? '100%' : `${maxWidth}px`;
2356
+ this.renderer.setStyle(this.layoutBuilderWrapper.nativeElement, 'max-width', maxWidthToSet);
2357
+ this.updateViewportWidth();
2358
+ }
2359
+ this.layoutViewChange.emit(layoutView);
2360
+ }
2361
+ });
2362
+ layoutBuilderInternalService.screenWidthChange$.pipe(this.getDestroyer()).subscribe((width) => {
2363
+ var _a;
2364
+ if ((_a = this.layoutBuilderWrapper) === null || _a === void 0 ? void 0 : _a.nativeElement) {
2365
+ this.renderer.setStyle(this.layoutBuilderWrapper.nativeElement, 'width', width);
2366
+ this.updateViewportWidth();
2367
+ }
2368
+ });
2369
+ // Get the sections id's into sectionsColumnsDropList for the drag & drop.
2370
+ layoutBuilderInternalService.sectionsChange$.pipe(this.getDestroyer()).subscribe((sections) => {
2371
+ // Concat all results into one array.
2372
+ const sectionsColumnsDropList = [].concat(...sections.map((section) => {
2373
+ return section.Columns.map((column, index) => layoutBuilderInternalService.getSectionColumnKey(section.Key, index.toString()));
2374
+ }));
2375
+ layoutBuilderInternalService.setSectionsColumnsDropListChange(sectionsColumnsDropList);
2376
+ });
2377
+ /***********************************************************************************************/
2378
+ /* External Events - for raise to the client
2379
+ /***********************************************************************************************/
2380
+ // For update editor.
2381
+ layoutBuilderInternalService.editorChange$.pipe(this.getDestroyer()).subscribe((editor) => {
2382
+ if (editor) {
2383
+ // Init the side bar scroll top to 0.
2384
+ if (this.sideBarComponent) {
2385
+ const sideLayout = this.sideBarComponent.nativeElement.querySelector('.side-layout');
2386
+ sideLayout === null || sideLayout === void 0 ? void 0 : sideLayout.scrollTo(0, 0);
2387
+ }
2388
+ this.currentEditor = editor;
2389
+ // Raise event to let the user set the block editor in the UI.
2390
+ this.editorChange.emit(editor);
2391
+ }
2392
+ });
2393
+ layoutBuilderInternalService.blockAddedEventSubject$.pipe(this.getDestroyer()).subscribe((event) => {
2394
+ if (event) {
2395
+ this.blockAdded.emit(event);
2396
+ }
2397
+ });
2398
+ layoutBuilderInternalService.blocksRemovedEventSubject$.pipe(this.getDestroyer()).subscribe((event) => {
2399
+ if ((event === null || event === void 0 ? void 0 : event.length) > 0) {
2400
+ this.blocksRemoved.emit(event);
2401
+ }
2402
+ });
2403
+ }
2404
+ }
2405
+ setBlocksConfig() {
2406
+ if (this.layoutBuilderInternalService) {
2407
+ this.layoutBuilderInternalService.setBlocksConfig(this._blocksLayoutConfig);
2408
+ }
2409
+ }
2410
+ ngAfterViewInit() {
2411
+ this.mountHeaderEndElement();
2412
+ this.mountBlockEditorElement();
2413
+ this.mountLayoutContentElement();
2414
+ }
2415
+ ngOnChanges(changes) {
2416
+ var _a, _b, _c;
2417
+ if (changes['manageGlobalCursor']) {
2418
+ (_a = this.layoutBuilderInternalService) === null || _a === void 0 ? void 0 : _a.setManageGlobalCursor(this.manageGlobalCursor);
2419
+ }
2420
+ if (changes['layoutView']) {
2421
+ const layoutView = changes['layoutView'].currentValue;
2422
+ if (layoutView) {
2423
+ (_b = this.layoutBuilderInternalService) === null || _b === void 0 ? void 0 : _b.loadLayoutBuilder(layoutView);
2424
+ }
2425
+ }
2426
+ if (changes['updateShellRouterData']) {
2427
+ if (this.updateShellRouterData) {
2428
+ (_c = this.pepAddonService) === null || _c === void 0 ? void 0 : _c.setShellRouterData({ showSidebar: false, addPadding: false });
2429
+ }
2430
+ }
2431
+ }
2432
+ ngOnInit() {
2433
+ var _a, _b, _c, _d;
2434
+ if (this.updateShellRouterData) {
2435
+ (_a = this.pepAddonService) === null || _a === void 0 ? void 0 : _a.setShellRouterData({ showSidebar: false, addPadding: false });
2436
+ }
2437
+ (_b = this.layoutBuilderInternalService) === null || _b === void 0 ? void 0 : _b.setManageGlobalCursor(this.manageGlobalCursor);
2438
+ (_c = this.layoutBuilderInternalService) === null || _c === void 0 ? void 0 : _c.setEditorMode(true);
2439
+ this.setBlocksConfig();
2440
+ if (this.layoutView) {
2441
+ (_d = this.layoutBuilderInternalService) === null || _d === void 0 ? void 0 : _d.loadLayoutBuilder(this.layoutView);
2442
+ }
2443
+ // Get the first translation for load all translations.
2444
+ this.translate.get('LAYOUT_BUILDER.DESKTOP').subscribe((res) => {
2445
+ this.screenTypes = [
2446
+ { key: 'Landscape', value: this.translate.instant('LAYOUT_BUILDER.DESKTOP'), callback: () => this.setScreenWidth('Landscape'), iconName: pepIconDeviceDesktop.name, iconPosition: 'end' },
2447
+ { key: 'Tablet', value: this.translate.instant('LAYOUT_BUILDER.TABLET'), callback: () => this.setScreenWidth('Tablet'), iconName: pepIconDeviceTablet.name, iconPosition: 'end' },
2448
+ { key: 'Phablet', value: this.translate.instant('LAYOUT_BUILDER.MOBILE'), callback: () => this.setScreenWidth('Phablet'), iconName: pepIconDeviceMobile.name, iconPosition: 'end' }
2449
+ ];
2450
+ });
2451
+ this.subscribeEvents(this.layoutBuilderInternalService);
2452
+ }
2453
+ ngOnDestroy() {
2454
+ var _a;
2455
+ super.ngOnDestroy();
2456
+ (_a = this.layoutBuilderInternalService) === null || _a === void 0 ? void 0 : _a.setEditorMode(false);
2457
+ // this.layoutBuilderService.removeInternalService(this._layoutKey);
2458
+ }
2459
+ onResize(event) {
2460
+ this.updateViewportWidth();
2461
+ }
2462
+ togglePreviewMode() {
2463
+ var _a;
2464
+ (_a = this.layoutBuilderInternalService) === null || _a === void 0 ? void 0 : _a.changePreviewMode(!this.previewMode);
2465
+ this.updateViewportWidth();
2466
+ }
2467
+ onSidebarStateChange(event) {
2468
+ this.updateViewportWidth();
2469
+ }
2470
+ onLayoutEditorObjectChange(pageEditor) {
2471
+ var _a;
2472
+ (_a = this.layoutBuilderInternalService) === null || _a === void 0 ? void 0 : _a.updateLayoutFromEditor(pageEditor);
2473
+ }
2474
+ onSectionEditorObjectChange(sectionEditor) {
2475
+ var _a;
2476
+ (_a = this.layoutBuilderInternalService) === null || _a === void 0 ? void 0 : _a.updateSectionFromEditor(sectionEditor);
2477
+ }
2478
+ onAddSectionClick(event) {
2479
+ var _a;
2480
+ (_a = this.layoutBuilderInternalService) === null || _a === void 0 ? void 0 : _a.addSection();
2481
+ }
2482
+ onBlockDragStart(event) {
2483
+ var _a;
2484
+ (_a = this.layoutBuilderInternalService) === null || _a === void 0 ? void 0 : _a.onBlockDragStart(event);
2485
+ }
2486
+ onBlockDragEnd(event) {
2487
+ var _a;
2488
+ (_a = this.layoutBuilderInternalService) === null || _a === void 0 ? void 0 : _a.onBlockDragEnd(event);
2489
+ }
2490
+ onNavigateBackFromEditor() {
2491
+ var _a, _b;
2492
+ if (!this.currentEditor || ((_a = this.currentEditor) === null || _a === void 0 ? void 0 : _a.type) === 'layout-builder') {
2493
+ this.backClick.emit();
2494
+ }
2495
+ else {
2496
+ (_b = this.layoutBuilderInternalService) === null || _b === void 0 ? void 0 : _b.navigateBackFromEditor();
2497
+ }
2498
+ }
2499
+ }
2500
+ PepLayoutBuilder2Component.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepLayoutBuilder2Component, deps: [{ token: i0.Renderer2 }, { token: i0.ElementRef }, { token: i1.TranslateService }, { token: LayoutBuilderInternalService }, { token: i3$1.PepAddonService, optional: true }], target: i0.ɵɵFactoryTarget.Component });
2501
+ PepLayoutBuilder2Component.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.2", type: PepLayoutBuilder2Component, selector: "pep-layout-builder2", inputs: { availableBlocksForDrag: "availableBlocksForDrag", blocksLayoutConfig: "blocksLayoutConfig", layoutEditorTitle: "layoutEditorTitle", lockScreen: "lockScreen", showSkeleton: "showSkeleton", updateShellRouterData: "updateShellRouterData", manageGlobalCursor: "manageGlobalCursor", layoutEditorTopElement: "layoutEditorTopElement", headerEndElement: "headerEndElement", blockEditorElement: "blockEditorElement", layoutContentElement: "layoutContentElement", blockTemplateRenderer: "blockTemplateRenderer", blockTemplateUnmount: "blockTemplateUnmount", layoutView: "layoutView" }, outputs: { backClick: "backClick", editorChange: "editorChange", blockAdded: "blockAdded", blocksRemoved: "blocksRemoved", editableStateChange: "editableStateChange", layoutViewChange: "layoutViewChange", screenTypeChange: "screenTypeChange" }, host: { listeners: { "window:resize": "onResize($event)" } }, providers: [LayoutBuilderInternalService], viewQueries: [{ propertyName: "layoutBuilderWrapper", first: true, predicate: ["layoutBuilderWrapper"], descendants: true, static: true }, { propertyName: "sideBarComponent", first: true, predicate: PepSideBarComponent, descendants: true, read: ElementRef }, { propertyName: "headerEndHost", first: true, predicate: ["headerEndHost"], descendants: true, static: true }, { propertyName: "blockEditorHost", first: true, predicate: ["blockEditorHost"], descendants: true, static: true }, { propertyName: "layoutContentHost", first: true, predicate: ["layoutContentHost"], descendants: true, static: true }], usesInheritance: true, usesOnChanges: 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 [hidden]=\"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 #editorTitle class=\"title title-lg ellipsis\" \n [title]=\"currentEditor?.type === 'layout-builder' ? (layoutEditorTitle || currentEditor?.title) : (currentEditor?.title || '')\">\n <span class=\"ellipsis\">{{ editorTitle.title }}</span>\n </div>\n </div>\n <div class=\"layout-builder-editor-wrapper\">\n <main-editor [hidden]=\"currentEditor?.type !== 'layout-builder'\" [sectionsColumnsDropList]=\"sectionsColumnsDropList\" [availableBlocksForDrag]=\"availableBlocksForDrag\"\n [hostObject]=\"currentEditor?.hostObject\" [layoutEditorTopElement]=\"layoutEditorTopElement\" (hostObjectChange)=\"onLayoutEditorObjectChange($event)\" \n (addSectionClick)=\"onAddSectionClick($event)\" (onBlockDragStart)=\"onBlockDragStart($event)\" (onBlockDragEnd)=\"onBlockDragEnd($event)\">\n </main-editor>\n \n <section-editor [hidden]=\"currentEditor?.type !== 'section'\" \n [hostObject]=\"currentEditor?.hostObject\" (hostObjectChange)=\"onSectionEditorObjectChange($event)\"></section-editor>\n \n <div [hidden]=\"currentEditor?.type !== 'block'\">\n <div #blockEditorHost></div>\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 <div class=\"header-end\" [style.display]=\"previewMode ? 'none' : null\">\n <pep-button key='Preview' [value]=\"'ACTIONS.PREVIEW' | translate\" sizeType=\"sm\" (buttonClick)=\"togglePreviewMode()\"></pep-button>\n <div #headerEndHost style=\"display: contents;\"></div>\n </div>\n <a class=\"color-link body-sm\" [style.display]=\"previewMode ? null : 'none'\" (click)=\"togglePreviewMode()\" href=\"javascript:void(0)\">{{('LAYOUT_BUILDER.PREVIEW_CLICK_HERE' | translate)}}</a>\n </div>\n <div #layoutBuilderWrapper class=\"layout-builder-wrapper\" [ngClass]=\"{'limit-min-width': selectedScreenType === 'Landscape' }\">\n <div #layoutContentHost [hidden]=\"!layoutContentElement\"></div>\n <ng-container *ngIf=\"!layoutContentElement\">\n <pep-layout2\n *ngIf=\"layoutView && !blockTemplateRenderer\"\n [editorMode]=\"true\"\n [showSkeleton]=\"showSkeleton\"\n [layoutView]=\"layoutView\"\n [blockTemplate]=\"defaultBlockTemplate\">\n </pep-layout2>\n\n <pep-layout2\n *ngIf=\"layoutView && blockTemplateRenderer\"\n [editorMode]=\"true\"\n [showSkeleton]=\"showSkeleton\"\n [layoutView]=\"layoutView\"\n [blockTemplateRenderer]=\"blockTemplateRenderer\"\n [blockTemplateUnmount]=\"blockTemplateUnmount\">\n </pep-layout2>\n </ng-container>\n <ng-template #defaultBlockTemplate let-blockKey=\"blockKey\">\n <div>{{ layoutBuilderInternalService.getBlockTitle(blockKey) }}</div>\n </ng-template>\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: [":host{display:block;height:100%}pep-page-layout{height:100%}.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:grid;align-items:center}.layout-builder-editor-wrapper ::ng-deep .page-builder-editor-tabs,.layout-builder-editor-wrapper ::ng-deep .layout-builder-editor-tabs{height:100%}.layout-builder-editor-wrapper ::ng-deep .page-builder-editor-tabs .mat-tab-header,.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 .page-builder-editor-tabs .mat-tab-header-pagination,.layout-builder-editor-wrapper ::ng-deep .layout-builder-editor-tabs .mat-tab-header-pagination{display:none}.layout-builder-editor-wrapper ::ng-deep .page-builder-editor-tabs .mat-tab-labels,.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 .page-builder-editor-tabs .mat-tab-labels .mat-tab-label,.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 .page-builder-editor-tabs .mat-tab-body-wrapper,.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 .page-builder-editor-tabs .mat-tab-body-wrapper .mat-tab-body.mat-tab-body-active,.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 .page-builder-editor-tabs .mat-tab-body-wrapper .mat-tab-body.mat-tab-body-active .mat-tab-body-content,.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 .page-builder-editor-tabs .page-builder-editor-tab,.layout-builder-editor-wrapper ::ng-deep .page-builder-editor-tabs .layout-builder-editor-tab,.layout-builder-editor-wrapper ::ng-deep .layout-builder-editor-tabs .page-builder-editor-tab,.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 .page-builder-editor-tabs .page-builder-editor-tab .group-buttons-container .toggle-buttons,.layout-builder-editor-wrapper ::ng-deep .page-builder-editor-tabs .layout-builder-editor-tab .group-buttons-container .toggle-buttons,.layout-builder-editor-wrapper ::ng-deep .layout-builder-editor-tabs .page-builder-editor-tab .group-buttons-container .toggle-buttons,.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 .page-builder-editor-tabs .page-builder-editor-tab pep-checkbox,.layout-builder-editor-wrapper ::ng-deep .page-builder-editor-tabs .page-builder-editor-tab pep-color,.layout-builder-editor-wrapper ::ng-deep .page-builder-editor-tabs .page-builder-editor-tab pep-date,.layout-builder-editor-wrapper ::ng-deep .page-builder-editor-tabs .page-builder-editor-tab pep-select,.layout-builder-editor-wrapper ::ng-deep .page-builder-editor-tabs .page-builder-editor-tab pep-textarea,.layout-builder-editor-wrapper ::ng-deep .page-builder-editor-tabs .page-builder-editor-tab pep-textbox,.layout-builder-editor-wrapper ::ng-deep .page-builder-editor-tabs .page-builder-editor-tab .no-margin-bottom,.layout-builder-editor-wrapper ::ng-deep .page-builder-editor-tabs .layout-builder-editor-tab pep-checkbox,.layout-builder-editor-wrapper ::ng-deep .page-builder-editor-tabs .layout-builder-editor-tab pep-color,.layout-builder-editor-wrapper ::ng-deep .page-builder-editor-tabs .layout-builder-editor-tab pep-date,.layout-builder-editor-wrapper ::ng-deep .page-builder-editor-tabs .layout-builder-editor-tab pep-select,.layout-builder-editor-wrapper ::ng-deep .page-builder-editor-tabs .layout-builder-editor-tab pep-textarea,.layout-builder-editor-wrapper ::ng-deep .page-builder-editor-tabs .layout-builder-editor-tab pep-textbox,.layout-builder-editor-wrapper ::ng-deep .page-builder-editor-tabs .layout-builder-editor-tab .no-margin-bottom,.layout-builder-editor-wrapper ::ng-deep .layout-builder-editor-tabs .page-builder-editor-tab pep-checkbox,.layout-builder-editor-wrapper ::ng-deep .layout-builder-editor-tabs .page-builder-editor-tab pep-color,.layout-builder-editor-wrapper ::ng-deep .layout-builder-editor-tabs .page-builder-editor-tab pep-date,.layout-builder-editor-wrapper ::ng-deep .layout-builder-editor-tabs .page-builder-editor-tab pep-select,.layout-builder-editor-wrapper ::ng-deep .layout-builder-editor-tabs .page-builder-editor-tab pep-textarea,.layout-builder-editor-wrapper ::ng-deep .layout-builder-editor-tabs .page-builder-editor-tab pep-textbox,.layout-builder-editor-wrapper ::ng-deep .layout-builder-editor-tabs .page-builder-editor-tab .no-margin-bottom,.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-date,.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,.layout-builder-editor-wrapper ::ng-deep .layout-builder-editor-tabs .layout-builder-editor-tab .no-margin-bottom{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-date,.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-container .no-margin-bottom,.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-date,.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,.layout-builder-editor-wrapper ::ng-deep .layout-builder-editor-group .no-margin-bottom{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{height:100%;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;height:100%;display:inline-table;min-height:0}.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 .page-builder-editor-tabs .mat-tab-header,.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%),.08)}.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: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i5$3.PepPageLayoutComponent, selector: "pep-page-layout", inputs: ["addPadding", "showShadow"] }, { kind: "component", type: i6.PepSideBarComponent, selector: "pep-side-bar", inputs: ["position", "ignoreResize", "showHeader", "showFooter", "showToggle", "stateType", "useAsWebComponent"], outputs: ["stateChange"] }, { kind: "component", type: i4$1.PepButtonComponent, selector: "pep-button", inputs: ["key", "value", "styleType", "styleStateType", "sizeType", "classNames", "disabled", "iconName", "iconPosition", "visible"], outputs: ["buttonClick"] }, { kind: "component", type: i8.PepGroupButtonsComponent, selector: "pep-group-buttons", inputs: ["viewType", "styleType", "sizeType", "buttons", "buttonsDisabled", "supportUnselect", "selectedButtonKey", "stretch"], outputs: ["buttonClick"] }, { kind: "component", type: PepLayoutComponent, selector: "pep-layout2", inputs: ["editorMode", "layoutView", "blockTemplate", "blockTemplateRenderer", "blockTemplateUnmount", "renderSkeleton", "showSkeleton"], outputs: ["layoutViewChange", "screenTypeChange"] }, { kind: "component", type: MainEditorComponent, selector: "main-editor", inputs: ["availableBlocksForDrag", "sectionsColumnsDropList", "layoutEditorTopElement", "hostObject"], outputs: ["hostObjectChange", "addSectionClick", "onBlockDragStart", "onBlockDragEnd"] }, { kind: "component", type: SectionEditorComponent, selector: "section-editor", inputs: ["hostObject"], outputs: ["hostObjectChange"] }, { kind: "pipe", type: i1.TranslatePipe, name: "translate" }] });
2502
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepLayoutBuilder2Component, decorators: [{
2503
+ type: Component,
2504
+ args: [{ selector: 'pep-layout-builder2', providers: [LayoutBuilderInternalService], 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 [hidden]=\"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 #editorTitle class=\"title title-lg ellipsis\" \n [title]=\"currentEditor?.type === 'layout-builder' ? (layoutEditorTitle || currentEditor?.title) : (currentEditor?.title || '')\">\n <span class=\"ellipsis\">{{ editorTitle.title }}</span>\n </div>\n </div>\n <div class=\"layout-builder-editor-wrapper\">\n <main-editor [hidden]=\"currentEditor?.type !== 'layout-builder'\" [sectionsColumnsDropList]=\"sectionsColumnsDropList\" [availableBlocksForDrag]=\"availableBlocksForDrag\"\n [hostObject]=\"currentEditor?.hostObject\" [layoutEditorTopElement]=\"layoutEditorTopElement\" (hostObjectChange)=\"onLayoutEditorObjectChange($event)\" \n (addSectionClick)=\"onAddSectionClick($event)\" (onBlockDragStart)=\"onBlockDragStart($event)\" (onBlockDragEnd)=\"onBlockDragEnd($event)\">\n </main-editor>\n \n <section-editor [hidden]=\"currentEditor?.type !== 'section'\" \n [hostObject]=\"currentEditor?.hostObject\" (hostObjectChange)=\"onSectionEditorObjectChange($event)\"></section-editor>\n \n <div [hidden]=\"currentEditor?.type !== 'block'\">\n <div #blockEditorHost></div>\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 <div class=\"header-end\" [style.display]=\"previewMode ? 'none' : null\">\n <pep-button key='Preview' [value]=\"'ACTIONS.PREVIEW' | translate\" sizeType=\"sm\" (buttonClick)=\"togglePreviewMode()\"></pep-button>\n <div #headerEndHost style=\"display: contents;\"></div>\n </div>\n <a class=\"color-link body-sm\" [style.display]=\"previewMode ? null : 'none'\" (click)=\"togglePreviewMode()\" href=\"javascript:void(0)\">{{('LAYOUT_BUILDER.PREVIEW_CLICK_HERE' | translate)}}</a>\n </div>\n <div #layoutBuilderWrapper class=\"layout-builder-wrapper\" [ngClass]=\"{'limit-min-width': selectedScreenType === 'Landscape' }\">\n <div #layoutContentHost [hidden]=\"!layoutContentElement\"></div>\n <ng-container *ngIf=\"!layoutContentElement\">\n <pep-layout2\n *ngIf=\"layoutView && !blockTemplateRenderer\"\n [editorMode]=\"true\"\n [showSkeleton]=\"showSkeleton\"\n [layoutView]=\"layoutView\"\n [blockTemplate]=\"defaultBlockTemplate\">\n </pep-layout2>\n\n <pep-layout2\n *ngIf=\"layoutView && blockTemplateRenderer\"\n [editorMode]=\"true\"\n [showSkeleton]=\"showSkeleton\"\n [layoutView]=\"layoutView\"\n [blockTemplateRenderer]=\"blockTemplateRenderer\"\n [blockTemplateUnmount]=\"blockTemplateUnmount\">\n </pep-layout2>\n </ng-container>\n <ng-template #defaultBlockTemplate let-blockKey=\"blockKey\">\n <div>{{ layoutBuilderInternalService.getBlockTitle(blockKey) }}</div>\n </ng-template>\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: [":host{display:block;height:100%}pep-page-layout{height:100%}.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:grid;align-items:center}.layout-builder-editor-wrapper ::ng-deep .page-builder-editor-tabs,.layout-builder-editor-wrapper ::ng-deep .layout-builder-editor-tabs{height:100%}.layout-builder-editor-wrapper ::ng-deep .page-builder-editor-tabs .mat-tab-header,.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 .page-builder-editor-tabs .mat-tab-header-pagination,.layout-builder-editor-wrapper ::ng-deep .layout-builder-editor-tabs .mat-tab-header-pagination{display:none}.layout-builder-editor-wrapper ::ng-deep .page-builder-editor-tabs .mat-tab-labels,.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 .page-builder-editor-tabs .mat-tab-labels .mat-tab-label,.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 .page-builder-editor-tabs .mat-tab-body-wrapper,.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 .page-builder-editor-tabs .mat-tab-body-wrapper .mat-tab-body.mat-tab-body-active,.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 .page-builder-editor-tabs .mat-tab-body-wrapper .mat-tab-body.mat-tab-body-active .mat-tab-body-content,.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 .page-builder-editor-tabs .page-builder-editor-tab,.layout-builder-editor-wrapper ::ng-deep .page-builder-editor-tabs .layout-builder-editor-tab,.layout-builder-editor-wrapper ::ng-deep .layout-builder-editor-tabs .page-builder-editor-tab,.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 .page-builder-editor-tabs .page-builder-editor-tab .group-buttons-container .toggle-buttons,.layout-builder-editor-wrapper ::ng-deep .page-builder-editor-tabs .layout-builder-editor-tab .group-buttons-container .toggle-buttons,.layout-builder-editor-wrapper ::ng-deep .layout-builder-editor-tabs .page-builder-editor-tab .group-buttons-container .toggle-buttons,.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 .page-builder-editor-tabs .page-builder-editor-tab pep-checkbox,.layout-builder-editor-wrapper ::ng-deep .page-builder-editor-tabs .page-builder-editor-tab pep-color,.layout-builder-editor-wrapper ::ng-deep .page-builder-editor-tabs .page-builder-editor-tab pep-date,.layout-builder-editor-wrapper ::ng-deep .page-builder-editor-tabs .page-builder-editor-tab pep-select,.layout-builder-editor-wrapper ::ng-deep .page-builder-editor-tabs .page-builder-editor-tab pep-textarea,.layout-builder-editor-wrapper ::ng-deep .page-builder-editor-tabs .page-builder-editor-tab pep-textbox,.layout-builder-editor-wrapper ::ng-deep .page-builder-editor-tabs .page-builder-editor-tab .no-margin-bottom,.layout-builder-editor-wrapper ::ng-deep .page-builder-editor-tabs .layout-builder-editor-tab pep-checkbox,.layout-builder-editor-wrapper ::ng-deep .page-builder-editor-tabs .layout-builder-editor-tab pep-color,.layout-builder-editor-wrapper ::ng-deep .page-builder-editor-tabs .layout-builder-editor-tab pep-date,.layout-builder-editor-wrapper ::ng-deep .page-builder-editor-tabs .layout-builder-editor-tab pep-select,.layout-builder-editor-wrapper ::ng-deep .page-builder-editor-tabs .layout-builder-editor-tab pep-textarea,.layout-builder-editor-wrapper ::ng-deep .page-builder-editor-tabs .layout-builder-editor-tab pep-textbox,.layout-builder-editor-wrapper ::ng-deep .page-builder-editor-tabs .layout-builder-editor-tab .no-margin-bottom,.layout-builder-editor-wrapper ::ng-deep .layout-builder-editor-tabs .page-builder-editor-tab pep-checkbox,.layout-builder-editor-wrapper ::ng-deep .layout-builder-editor-tabs .page-builder-editor-tab pep-color,.layout-builder-editor-wrapper ::ng-deep .layout-builder-editor-tabs .page-builder-editor-tab pep-date,.layout-builder-editor-wrapper ::ng-deep .layout-builder-editor-tabs .page-builder-editor-tab pep-select,.layout-builder-editor-wrapper ::ng-deep .layout-builder-editor-tabs .page-builder-editor-tab pep-textarea,.layout-builder-editor-wrapper ::ng-deep .layout-builder-editor-tabs .page-builder-editor-tab pep-textbox,.layout-builder-editor-wrapper ::ng-deep .layout-builder-editor-tabs .page-builder-editor-tab .no-margin-bottom,.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-date,.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,.layout-builder-editor-wrapper ::ng-deep .layout-builder-editor-tabs .layout-builder-editor-tab .no-margin-bottom{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-date,.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-container .no-margin-bottom,.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-date,.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,.layout-builder-editor-wrapper ::ng-deep .layout-builder-editor-group .no-margin-bottom{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{height:100%;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;height:100%;display:inline-table;min-height:0}.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 .page-builder-editor-tabs .mat-tab-header,.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%),.08)}.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"] }]
2505
+ }], ctorParameters: function () {
2506
+ return [{ type: i0.Renderer2 }, { type: i0.ElementRef }, { type: i1.TranslateService }, { type: LayoutBuilderInternalService }, { type: i3$1.PepAddonService, decorators: [{
2507
+ type: Optional
2508
+ }] }];
2509
+ }, propDecorators: { layoutBuilderWrapper: [{
2510
+ type: ViewChild,
2511
+ args: ['layoutBuilderWrapper', { static: true }]
2512
+ }], sideBarComponent: [{
2513
+ type: ViewChild,
2514
+ args: [PepSideBarComponent, { read: ElementRef }]
2515
+ }], headerEndHost: [{
2516
+ type: ViewChild,
2517
+ args: ['headerEndHost', { static: true }]
2518
+ }], blockEditorHost: [{
2519
+ type: ViewChild,
2520
+ args: ['blockEditorHost', { static: true }]
2521
+ }], layoutContentHost: [{
2522
+ type: ViewChild,
2523
+ args: ['layoutContentHost', { static: true }]
2524
+ }], availableBlocksForDrag: [{
2525
+ type: Input
2526
+ }], blocksLayoutConfig: [{
2527
+ type: Input
2528
+ }], layoutEditorTitle: [{
2529
+ type: Input
2530
+ }], lockScreen: [{
2531
+ type: Input
2532
+ }], showSkeleton: [{
2533
+ type: Input
2534
+ }], updateShellRouterData: [{
2535
+ type: Input
2536
+ }], manageGlobalCursor: [{
2537
+ type: Input
2538
+ }], layoutEditorTopElement: [{
2539
+ type: Input
2540
+ }], headerEndElement: [{
2541
+ type: Input
2542
+ }], blockEditorElement: [{
2543
+ type: Input
2544
+ }], layoutContentElement: [{
2545
+ type: Input
2546
+ }], blockTemplateRenderer: [{
2547
+ type: Input
2548
+ }], blockTemplateUnmount: [{
2549
+ type: Input
2550
+ }], layoutView: [{
2551
+ type: Input
2552
+ }], backClick: [{
2553
+ type: Output
2554
+ }], editorChange: [{
2555
+ type: Output
2556
+ }], blockAdded: [{
2557
+ type: Output
2558
+ }], blocksRemoved: [{
2559
+ type: Output
2560
+ }], editableStateChange: [{
2561
+ type: Output
2562
+ }], layoutViewChange: [{
2563
+ type: Output
2564
+ }], screenTypeChange: [{
2565
+ type: Output
2566
+ }], onResize: [{
2567
+ type: HostListener,
2568
+ args: ['window:resize', ['$event']]
2569
+ }] } });
2570
+
2571
+ class PepLayoutContentDirective {
2572
+ }
2573
+ PepLayoutContentDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepLayoutContentDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
2574
+ PepLayoutContentDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.2", type: PepLayoutContentDirective, selector: "[layout-content]", ngImport: i0 });
2575
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepLayoutContentDirective, decorators: [{
2576
+ type: Directive,
2577
+ args: [{
2578
+ selector: '[layout-content]',
2579
+ }]
2580
+ }] });
2581
+
2582
+ class PepLayoutBuilderService {
2583
+ constructor() {
2584
+ //
2585
+ }
2586
+ getIsHidden(hideIn, currentScreenType) {
2587
+ return (hideIn && (hideIn === null || hideIn === void 0 ? void 0 : hideIn.length) > 0) ? hideIn.some(hi => hi === currentScreenType) : false;
2588
+ }
2589
+ /**
2590
+ * Deprecated
2591
+ */
2592
+ getCurrentScreenType() {
2593
+ return 'Landscape';
2594
+ // const layoutBuilderInternalService = this._layoutInternalServicesMap.get(layoutKey);
2595
+ // return layoutBuilderInternalService?.getCurrentScreenType() || 'Landscape';
2596
+ }
2597
+ /**
2598
+ * Deprecated
2599
+ */
2600
+ getEditableState() {
2601
+ return false;
2602
+ // const layoutBuilderInternalService = this._layoutInternalServicesMap.get(layoutKey);
2603
+ // return layoutBuilderInternalService?.editableState || false;
2604
+ }
2605
+ /**
2606
+ * Deprecated
2607
+ */
2608
+ showSkeleton(show) {
2609
+ // const layoutBuilderInternalService = this._layoutInternalServicesMap.get(layoutKey);
2610
+ // layoutBuilderInternalService?.showSkeleton(show);
2611
+ }
2612
+ /**
2613
+ * Deprecated
2614
+ */
2615
+ lockScreen(lock) {
2616
+ // const layoutBuilderInternalService = this._layoutInternalServicesMap.get(layoutKey);
2617
+ // layoutBuilderInternalService?.lockScreen(lock);
2618
+ }
2619
+ }
2620
+ PepLayoutBuilderService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepLayoutBuilderService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
2621
+ PepLayoutBuilderService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepLayoutBuilderService, providedIn: 'root' });
2622
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepLayoutBuilderService, decorators: [{
2623
+ type: Injectable,
2624
+ args: [{
2625
+ providedIn: 'root',
2626
+ }]
2627
+ }], ctorParameters: function () { return []; } });
2628
+
2629
+ class PepLayoutBuilderModule2 {
2630
+ constructor(pepIconRegistry) {
2631
+ this.pepIconRegistry = pepIconRegistry;
2632
+ this.pepIconRegistry.registerIcons([
2633
+ pepIconDeviceDesktop,
2634
+ pepIconDeviceTablet,
2635
+ pepIconDeviceMobile,
2636
+ ]);
2637
+ }
2638
+ }
2639
+ PepLayoutBuilderModule2.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepLayoutBuilderModule2, deps: [{ token: i1$1.PepIconRegistry }], target: i0.ɵɵFactoryTarget.NgModule });
2640
+ PepLayoutBuilderModule2.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.0.2", ngImport: i0, type: PepLayoutBuilderModule2, declarations: [PepLayoutBuilder2Component,
2641
+ PepLayoutContentDirective], imports: [CommonModule,
2642
+ DragDropModule,
2643
+ // Material modules,
2644
+ MatCommonModule,
2645
+ MatTabsModule,
2646
+ // ngx-lib modules
2647
+ PepNgxLibModule,
2648
+ PepDialogModule,
2649
+ PepIconModule,
2650
+ PepPageLayoutModule,
2651
+ PepSideBarModule,
2652
+ PepButtonModule,
2653
+ PepCheckboxModule,
2654
+ PepTextboxModule,
2655
+ PepSelectModule,
2656
+ PepSizeDetectorModule,
2657
+ PepGroupButtonsModule,
2658
+ PepDraggableItemsModule,
2659
+ PepGroupButtonsSettingsModule,
2660
+ HideInModule,
2661
+ PepLayout2Module,
2662
+ MainEditorModule,
2663
+ SectionEditorModule,
2664
+ PepLayoutBuilderEditorModule
2665
+ // SectionBlockModule
2666
+ ], exports: [PepLayoutBuilder2Component,
2667
+ PepLayoutContentDirective,
2668
+ PepLayout2Module,
2669
+ PepLayoutBuilderEditorModule] });
2670
+ PepLayoutBuilderModule2.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepLayoutBuilderModule2, providers: [
2671
+ PepLayoutBuilderService
2672
+ ], imports: [CommonModule,
2673
+ DragDropModule,
2674
+ // Material modules,
2675
+ MatCommonModule,
2676
+ MatTabsModule,
2677
+ // ngx-lib modules
2678
+ PepNgxLibModule,
2679
+ PepDialogModule,
2680
+ PepIconModule,
2681
+ PepPageLayoutModule,
2682
+ PepSideBarModule,
2683
+ PepButtonModule,
2684
+ PepCheckboxModule,
2685
+ PepTextboxModule,
2686
+ PepSelectModule,
2687
+ PepSizeDetectorModule,
2688
+ PepGroupButtonsModule,
2689
+ PepDraggableItemsModule,
2690
+ PepGroupButtonsSettingsModule,
2691
+ HideInModule,
2692
+ PepLayout2Module,
2693
+ MainEditorModule,
2694
+ SectionEditorModule,
2695
+ PepLayoutBuilderEditorModule
2696
+ // SectionBlockModule
2697
+ ,
2698
+ PepLayout2Module,
2699
+ PepLayoutBuilderEditorModule] });
2700
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepLayoutBuilderModule2, decorators: [{
2701
+ type: NgModule,
2702
+ args: [{
2703
+ declarations: [
2704
+ PepLayoutBuilder2Component,
2705
+ PepLayoutContentDirective,
2706
+ ],
2707
+ imports: [
2708
+ CommonModule,
2709
+ DragDropModule,
2710
+ // Material modules,
2711
+ MatCommonModule,
2712
+ MatTabsModule,
2713
+ // ngx-lib modules
2714
+ PepNgxLibModule,
2715
+ PepDialogModule,
2716
+ PepIconModule,
2717
+ PepPageLayoutModule,
2718
+ PepSideBarModule,
2719
+ PepButtonModule,
2720
+ PepCheckboxModule,
2721
+ PepTextboxModule,
2722
+ PepSelectModule,
2723
+ PepSizeDetectorModule,
2724
+ PepGroupButtonsModule,
2725
+ PepDraggableItemsModule,
2726
+ PepGroupButtonsSettingsModule,
2727
+ HideInModule,
2728
+ PepLayout2Module,
2729
+ MainEditorModule,
2730
+ SectionEditorModule,
2731
+ PepLayoutBuilderEditorModule
2732
+ // SectionBlockModule
2733
+ ],
2734
+ exports: [
2735
+ PepLayoutBuilder2Component,
2736
+ PepLayoutContentDirective,
2737
+ PepLayout2Module,
2738
+ PepLayoutBuilderEditorModule
2739
+ ],
2740
+ providers: [
2741
+ PepLayoutBuilderService
2742
+ ]
2743
+ }]
2744
+ }], ctorParameters: function () { return [{ type: i1$1.PepIconRegistry }]; } });
2745
+
2746
+ /*
2747
+ * Public API Surface of ngx-composite-lib/layout-builder
2748
+ */
2749
+
2750
+ /**
2751
+ * Generated bundle index. Do not edit.
2752
+ */
2753
+
2754
+ export { PepLayout2Module, PepLayoutBuilder2Component, PepLayoutBuilderEditorComponent, PepLayoutBuilderEditorModule, PepLayoutBuilderModule2, PepLayoutBuilderService, PepLayoutComponent, PepLayoutContentDirective };
2755
+ //# sourceMappingURL=pepperi-addons-ngx-composite-lib-layout-builder2.mjs.map