@pepperi-addons/ngx-composite-lib 0.4.2-beta.8 → 0.4.2-beta.80

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