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

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