@pepperi-addons/ngx-composite-lib 0.4.2-beta.9 → 0.4.2-beta.90

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