@pepperi-addons/ngx-composite-lib 0.4.2-beta.7 → 0.4.2-beta.71

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