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