@firestitch/content 12.2.7 → 12.2.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (89) hide show
  1. package/app/consts/index.d.ts +1 -1
  2. package/app/consts/page-types.const.d.ts +5 -5
  3. package/app/enums/editor-type.d.ts +6 -6
  4. package/app/enums/index.d.ts +2 -2
  5. package/app/enums/page-type.enum.d.ts +6 -6
  6. package/app/injectors/content-config.injector.d.ts +2 -2
  7. package/app/injectors/index.d.ts +1 -1
  8. package/app/interfaces/content-config.d.ts +21 -21
  9. package/app/interfaces/content-layout.d.ts +10 -10
  10. package/app/interfaces/content-page.d.ts +14 -14
  11. package/app/interfaces/content-style.d.ts +4 -4
  12. package/app/interfaces/index.d.ts +4 -4
  13. package/app/modules/content/components/content/content.component.d.ts +25 -25
  14. package/app/modules/content/components/content/index.d.ts +1 -1
  15. package/app/modules/content/components/content-renderer/content-renderer.component.d.ts +24 -24
  16. package/app/modules/content/components/content-renderer/index.d.ts +1 -1
  17. package/app/modules/content/fs-content.module.d.ts +10 -10
  18. package/app/modules/content-layouts/components/content-layout/content-layout.component.d.ts +27 -27
  19. package/app/modules/content-layouts/components/content-layout/index.d.ts +1 -1
  20. package/app/modules/content-layouts/components/content-layout-editor/content-layout-editor.component.d.ts +50 -49
  21. package/app/modules/content-layouts/components/content-layout-editor/index.d.ts +1 -1
  22. package/app/modules/content-layouts/components/content-layouts/content-layouts.component.d.ts +21 -21
  23. package/app/modules/content-layouts/components/content-layouts/index.d.ts +1 -1
  24. package/app/modules/content-layouts/components/index.d.ts +3 -3
  25. package/app/modules/content-layouts/fs-content-layouts.module.d.ts +28 -28
  26. package/app/modules/content-pages/components/content-page/content-page.component.d.ts +32 -32
  27. package/app/modules/content-pages/components/content-page/index.d.ts +1 -1
  28. package/app/modules/content-pages/components/content-page-editor/content-page-editor.component.d.ts +51 -50
  29. package/app/modules/content-pages/components/content-page-editor/index.d.ts +1 -1
  30. package/app/modules/content-pages/components/content-pages/content-pages.component.d.ts +24 -24
  31. package/app/modules/content-pages/components/content-pages/index.d.ts +1 -1
  32. package/app/modules/content-pages/components/index.d.ts +3 -3
  33. package/app/modules/content-pages/fs-content-pages.module.d.ts +31 -31
  34. package/app/modules/content-style/components/content-style/content-style.component.d.ts +27 -27
  35. package/app/modules/content-style/components/content-style/index.d.ts +1 -1
  36. package/app/modules/content-style/fs-content-style.module.d.ts +14 -14
  37. package/app/modules/editor/components/editor/editor.component.d.ts +47 -47
  38. package/app/modules/editor/components/editor/index.d.ts +1 -1
  39. package/app/modules/editor/fs-content-editor.module.d.ts +23 -23
  40. package/app/modules/editor/index.d.ts +1 -1
  41. package/bundles/firestitch-content.umd.js +1330 -1308
  42. package/bundles/firestitch-content.umd.js.map +1 -1
  43. package/esm2015/app/consts/index.js +1 -1
  44. package/esm2015/app/consts/page-types.const.js +7 -7
  45. package/esm2015/app/enums/editor-type.js +7 -7
  46. package/esm2015/app/enums/index.js +3 -3
  47. package/esm2015/app/enums/page-type.enum.js +7 -7
  48. package/esm2015/app/injectors/content-config.injector.js +2 -2
  49. package/esm2015/app/injectors/index.js +1 -1
  50. package/esm2015/app/interfaces/content-config.js +1 -1
  51. package/esm2015/app/interfaces/content-layout.js +1 -1
  52. package/esm2015/app/interfaces/content-page.js +1 -1
  53. package/esm2015/app/interfaces/content-style.js +1 -1
  54. package/esm2015/app/interfaces/index.js +5 -5
  55. package/esm2015/app/modules/content/components/content/content.component.js +84 -84
  56. package/esm2015/app/modules/content/components/content/index.js +1 -1
  57. package/esm2015/app/modules/content/components/content-renderer/content-renderer.component.js +76 -76
  58. package/esm2015/app/modules/content/components/content-renderer/index.js +1 -1
  59. package/esm2015/app/modules/content/fs-content.module.js +32 -32
  60. package/esm2015/app/modules/content-layouts/components/content-layout/content-layout.component.js +72 -72
  61. package/esm2015/app/modules/content-layouts/components/content-layout/index.js +1 -1
  62. package/esm2015/app/modules/content-layouts/components/content-layout-editor/content-layout-editor.component.js +160 -150
  63. package/esm2015/app/modules/content-layouts/components/content-layout-editor/index.js +1 -1
  64. package/esm2015/app/modules/content-layouts/components/content-layouts/content-layouts.component.js +120 -120
  65. package/esm2015/app/modules/content-layouts/components/content-layouts/index.js +1 -1
  66. package/esm2015/app/modules/content-layouts/components/index.js +4 -4
  67. package/esm2015/app/modules/content-layouts/fs-content-layouts.module.js +103 -103
  68. package/esm2015/app/modules/content-pages/components/content-page/content-page.component.js +83 -83
  69. package/esm2015/app/modules/content-pages/components/content-page/index.js +1 -1
  70. package/esm2015/app/modules/content-pages/components/content-page-editor/content-page-editor.component.js +163 -153
  71. package/esm2015/app/modules/content-pages/components/content-page-editor/index.js +1 -1
  72. package/esm2015/app/modules/content-pages/components/content-pages/content-pages.component.js +129 -129
  73. package/esm2015/app/modules/content-pages/components/content-pages/index.js +1 -1
  74. package/esm2015/app/modules/content-pages/components/index.js +4 -4
  75. package/esm2015/app/modules/content-pages/fs-content-pages.module.js +112 -112
  76. package/esm2015/app/modules/content-style/components/content-style/content-style.component.js +70 -70
  77. package/esm2015/app/modules/content-style/components/content-style/index.js +1 -1
  78. package/esm2015/app/modules/content-style/fs-content-style.module.js +49 -49
  79. package/esm2015/app/modules/editor/components/editor/editor.component.js +144 -144
  80. package/esm2015/app/modules/editor/components/editor/index.js +1 -1
  81. package/esm2015/app/modules/editor/fs-content-editor.module.js +85 -85
  82. package/esm2015/app/modules/editor/index.js +1 -1
  83. package/esm2015/firestitch-content.js +4 -4
  84. package/esm2015/public_api.js +10 -10
  85. package/fesm2015/firestitch-content.js +1242 -1222
  86. package/fesm2015/firestitch-content.js.map +1 -1
  87. package/firestitch-content.d.ts +5 -5
  88. package/package.json +1 -1
  89. package/public_api.d.ts +10 -10
@@ -39,7 +39,7 @@ import { FsCommonModule, index } from '@firestitch/common';
39
39
  import * as i2$1 from 'angular-split';
40
40
  import { AngularSplitModule } from 'angular-split';
41
41
  import * as i2 from '@firestitch/message';
42
- import { Subject, of, throwError } from 'rxjs';
42
+ import { Subject, of, throwError, fromEvent } from 'rxjs';
43
43
  import { tap, switchMap, takeUntil, filter, map } from 'rxjs/operators';
44
44
  import * as i3$2 from '@firestitch/prompt';
45
45
  import { ItemType } from '@firestitch/filter';
@@ -49,1265 +49,1285 @@ import * as i2$3 from '@angular/router';
49
49
  import { NavigationEnd } from '@angular/router';
50
50
  import * as i3$4 from '@firestitch/body';
51
51
 
52
- var EditorType;
53
- (function (EditorType) {
54
- EditorType["Js"] = "js";
55
- EditorType["Html"] = "html";
56
- EditorType["Scss"] = "scss";
57
- EditorType["GlobalScss"] = "globalScss";
52
+ var EditorType;
53
+ (function (EditorType) {
54
+ EditorType["Js"] = "js";
55
+ EditorType["Html"] = "html";
56
+ EditorType["Scss"] = "scss";
57
+ EditorType["GlobalScss"] = "globalScss";
58
58
  })(EditorType || (EditorType = {}));
59
59
 
60
- var PageType;
61
- (function (PageType) {
62
- PageType["StandardPage"] = "standardPage";
63
- PageType["BlogPost"] = "blogPost";
64
- PageType["HomePage"] = "homePage";
65
- PageType["NotFoundPage"] = "notFoundPage";
60
+ var PageType;
61
+ (function (PageType) {
62
+ PageType["StandardPage"] = "standardPage";
63
+ PageType["BlogPost"] = "blogPost";
64
+ PageType["HomePage"] = "homePage";
65
+ PageType["NotFoundPage"] = "notFoundPage";
66
66
  })(PageType || (PageType = {}));
67
67
 
68
- class EditorComponent {
69
- constructor(_cdRef, _message) {
70
- this._cdRef = _cdRef;
71
- this._message = _message;
72
- this.showHtml = false;
73
- this.showScss = false;
74
- this.showJs = false;
75
- this.showGlobalScss = false;
76
- this.changed = new EventEmitter();
77
- this.focused = new EventEmitter();
78
- this.blured = new EventEmitter();
79
- this.changes = {};
80
- this.EditorType = EditorType;
81
- this.resizing = false;
82
- this._destroy$ = new Subject();
83
- }
84
- ngOnInit() {
85
- this.initTextEditors();
86
- this.initGlobalContentStyle();
87
- }
88
- ngOnDestroy() {
89
- this._destroy$.next();
90
- this._destroy$.complete();
91
- }
92
- change(type, value) {
93
- this.changed.emit({ type, value });
94
- this.changes[type] = value;
95
- }
96
- get hasChanges() {
97
- return Object.keys(this.changes)
98
- .filter((name) => !!this.changes[name])
99
- .length !== 0;
100
- }
101
- clearChange(type) {
102
- this.changes[type] = null;
103
- this._cdRef.markForCheck();
104
- }
105
- initTextEditors() {
106
- this.scssConfig = {
107
- tabSize: 2,
108
- language: 'scss',
109
- height: '100%',
110
- focus: () => {
111
- this.focused.emit(EditorType.Scss);
112
- },
113
- blur: () => {
114
- this.blured.emit(EditorType.Scss);
115
- },
116
- };
117
- this.jsConfig = {
118
- tabSize: 2,
119
- language: 'js',
120
- height: '100%',
121
- focus: () => {
122
- this.focused.emit(EditorType.Js);
123
- },
124
- blur: () => {
125
- this.blured.emit(EditorType.Js);
126
- },
127
- };
128
- this.htmlConfig = {
129
- tabSize: 2,
130
- language: 'html',
131
- height: '100%',
132
- focus: () => {
133
- this.focused.emit(EditorType.Html);
134
- },
135
- blur: () => {
136
- this.blured.emit(EditorType.Html);
137
- },
138
- };
139
- this.globalScssConfig = {
140
- tabSize: 2,
141
- language: 'scss',
142
- height: '100%',
143
- focus: () => {
144
- this.focused.emit(EditorType.GlobalScss);
145
- },
146
- blur: () => {
147
- this.blured.emit(EditorType.GlobalScss);
148
- },
149
- };
150
- }
151
- initGlobalContentStyle() {
152
- this.contentConfig.loadContentStyle()
153
- .subscribe((contentStyle) => {
154
- this.contentStyle = contentStyle || {};
155
- this._cdRef.markForCheck();
156
- });
157
- }
158
- saveGlobalScss() {
159
- return this.contentConfig.saveContentStyle(this.contentStyle)
160
- .pipe(tap(() => {
161
- this._message.success('Saved Changes');
162
- }));
163
- }
164
- }
165
- EditorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: EditorComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i2.FsMessage }], target: i0.ɵɵFactoryTarget.Component });
166
- EditorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: EditorComponent, selector: "app-editor", inputs: { showHtml: "showHtml", showScss: "showScss", showJs: "showJs", showGlobalScss: "showGlobalScss", html: "html", scss: "scss", js: "js", contentConfig: "contentConfig" }, outputs: { changed: "changed", focused: "focused", blured: "blured" }, ngImport: i0, template: "<as-split [unit]=\"'percent'\" [gutterSize]=\"25\"> \n <as-split-area [size]=\"70\" [visible]=\"showHtml\" [order]=\"1\">\n <div class=\"editor-container\">\n <fs-label>HTML {{changes.html ? '*' : ''}}</fs-label>\n <fs-text-editor \n [(ngModel)]=\"html\" \n name=\"html\"\n [fsModelChangeOptions]=\"{ debounce: 0 }\"\n (fsModelChange)=\"change(EditorType.Html, $event)\"\n [config]=\"htmlConfig\">\n </fs-text-editor> \n </div>\n </as-split-area>\n <as-split-area [size]=\"30\" [visible]=\"showScss\" [order]=\"2\">\n <div class=\"editor-container\">\n <fs-label>SCSS {{changes.scss ? '*' : ''}}</fs-label>\n <fs-text-editor \n [(ngModel)]=\"scss\" \n name=\"scss\"\n [fsModelChangeOptions]=\"{ debounce: 0 }\"\n (fsModelChange)=\"change(EditorType.Scss, $event)\"\n [config]=\"scssConfig\">\n </fs-text-editor> \n </div>\n </as-split-area>\n <as-split-area [size]=\"30\" [visible]=\"showJs\" [order]=\"3\">\n <div class=\"editor-container\">\n <fs-label>JS {{changes.js ? '*' : ''}}</fs-label>\n <fs-text-editor \n [(ngModel)]=\"js\" \n name=\"js\"\n [fsModelChangeOptions]=\"{ debounce: 0 }\"\n (fsModelChange)=\"change(EditorType.Js, $event)\"\n [config]=\"jsConfig\">\n </fs-text-editor> \n </div>\n </as-split-area>\n <as-split-area [size]=\"30\" [visible]=\"showGlobalScss\" [order]=\"4\">\n <div class=\"editor-container\">\n <fs-label>Global SCSS {{changes.globalScss ? '*' : ''}}</fs-label>\n <ng-container *fsSkeleton=\"contentStyle\">\n <fs-text-editor \n [(ngModel)]=\"contentStyle.scss\" \n name=\"globalScss\"\n [fsModelChangeOptions]=\"{ debounce: 300 }\"\n (fsModelChange)=\"change(EditorType.GlobalScss, $event)\"\n [config]=\"globalScssConfig\">\n </fs-text-editor> \n </ng-container> \n </div>\n </as-split-area>\n</as-split>\n", styles: [":host ::ng-deep .as-split-gutter{background-color:unset!important}.editor-container{height:100%;border-radius:5px;display:flex;flex-direction:column}.editor-container fs-text-editor{flex:1}\n"], components: [{ type: i2$1.SplitComponent, selector: "as-split", inputs: ["direction", "unit", "gutterSize", "gutterStep", "restrictMove", "useTransition", "disabled", "dir", "gutterDblClickDuration", "gutterClickDeltaPx", "gutterAriaLabel"], outputs: ["transitionEnd", "dragStart", "dragEnd", "gutterClick", "gutterDblClick"], exportAs: ["asSplit"] }, { type: i3.FsLabelComponent, selector: "fs-label" }, { type: i4.FsTextEditorComponent, selector: "fs-text-editor", inputs: ["config", "scrollable"], outputs: ["ready", "blur"] }], directives: [{ type: i2$1.SplitAreaDirective, selector: "as-split-area, [as-split-area]", inputs: ["order", "size", "minSize", "maxSize", "lockSize", "visible"], exportAs: ["asSplitArea"] }, { type: i9.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i9.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i5.FsFormNoFsValidatorsDirective, selector: "[ngModel]:not([required]):not([fsFormRequired]):not([fsFormCompare]):not([fsFormDateRange]):not([fsFormEmail]):not([fsFormEmails]):not([fsFormFunction]):not([fsFormGreater]):not([fsFormInteger]):not([fsFormLesser]):not([fsFormMax]):not([fsFormMaxLength]):not([fsFormMin]):not([fsFormMinLength]):not([fsFormNumeric]):not([fsFormPattern]):not([fsFormPhone]):not([fsFormUrl]):not([validate])" }, { type: i7.FsModelChangeDirective, selector: "[fsModelChange]", inputs: ["fsModelChangeOptions"], outputs: ["fsModelChange"] }, { type: i8.FsSkeletonContentDirective, selector: "[fsSkeleton]", inputs: ["fsSkeleton", "fsSkeletonPattern"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
167
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: EditorComponent, decorators: [{
168
- type: Component,
169
- args: [{
170
- selector: 'app-editor',
171
- templateUrl: './editor.component.html',
172
- styleUrls: ['./editor.component.scss'],
173
- changeDetection: ChangeDetectionStrategy.OnPush,
174
- }]
175
- }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }, { type: i2.FsMessage }]; }, propDecorators: { showHtml: [{
176
- type: Input
177
- }], showScss: [{
178
- type: Input
179
- }], showJs: [{
180
- type: Input
181
- }], showGlobalScss: [{
182
- type: Input
183
- }], html: [{
184
- type: Input
185
- }], scss: [{
186
- type: Input
187
- }], js: [{
188
- type: Input
189
- }], contentConfig: [{
190
- type: Input
191
- }], changed: [{
192
- type: Output
193
- }], focused: [{
194
- type: Output
195
- }], blured: [{
196
- type: Output
68
+ class EditorComponent {
69
+ constructor(_cdRef, _message) {
70
+ this._cdRef = _cdRef;
71
+ this._message = _message;
72
+ this.showHtml = false;
73
+ this.showScss = false;
74
+ this.showJs = false;
75
+ this.showGlobalScss = false;
76
+ this.changed = new EventEmitter();
77
+ this.focused = new EventEmitter();
78
+ this.blured = new EventEmitter();
79
+ this.changes = {};
80
+ this.EditorType = EditorType;
81
+ this.resizing = false;
82
+ this._destroy$ = new Subject();
83
+ }
84
+ ngOnInit() {
85
+ this.initTextEditors();
86
+ this.initGlobalContentStyle();
87
+ }
88
+ ngOnDestroy() {
89
+ this._destroy$.next();
90
+ this._destroy$.complete();
91
+ }
92
+ change(type, value) {
93
+ this.changed.emit({ type, value });
94
+ this.changes[type] = value;
95
+ }
96
+ get hasChanges() {
97
+ return Object.keys(this.changes)
98
+ .filter((name) => !!this.changes[name])
99
+ .length !== 0;
100
+ }
101
+ clearChange(type) {
102
+ this.changes[type] = null;
103
+ this._cdRef.markForCheck();
104
+ }
105
+ initTextEditors() {
106
+ this.scssConfig = {
107
+ tabSize: 2,
108
+ language: 'scss',
109
+ height: '100%',
110
+ focus: () => {
111
+ this.focused.emit(EditorType.Scss);
112
+ },
113
+ blur: () => {
114
+ this.blured.emit(EditorType.Scss);
115
+ },
116
+ };
117
+ this.jsConfig = {
118
+ tabSize: 2,
119
+ language: 'js',
120
+ height: '100%',
121
+ focus: () => {
122
+ this.focused.emit(EditorType.Js);
123
+ },
124
+ blur: () => {
125
+ this.blured.emit(EditorType.Js);
126
+ },
127
+ };
128
+ this.htmlConfig = {
129
+ tabSize: 2,
130
+ language: 'html',
131
+ height: '100%',
132
+ focus: () => {
133
+ this.focused.emit(EditorType.Html);
134
+ },
135
+ blur: () => {
136
+ this.blured.emit(EditorType.Html);
137
+ },
138
+ };
139
+ this.globalScssConfig = {
140
+ tabSize: 2,
141
+ language: 'scss',
142
+ height: '100%',
143
+ focus: () => {
144
+ this.focused.emit(EditorType.GlobalScss);
145
+ },
146
+ blur: () => {
147
+ this.blured.emit(EditorType.GlobalScss);
148
+ },
149
+ };
150
+ }
151
+ initGlobalContentStyle() {
152
+ this.contentConfig.loadContentStyle()
153
+ .subscribe((contentStyle) => {
154
+ this.contentStyle = contentStyle || {};
155
+ this._cdRef.markForCheck();
156
+ });
157
+ }
158
+ saveGlobalScss() {
159
+ return this.contentConfig.saveContentStyle(this.contentStyle)
160
+ .pipe(tap(() => {
161
+ this._message.success('Saved Changes');
162
+ }));
163
+ }
164
+ }
165
+ EditorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: EditorComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i2.FsMessage }], target: i0.ɵɵFactoryTarget.Component });
166
+ EditorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: EditorComponent, selector: "app-editor", inputs: { showHtml: "showHtml", showScss: "showScss", showJs: "showJs", showGlobalScss: "showGlobalScss", html: "html", scss: "scss", js: "js", contentConfig: "contentConfig" }, outputs: { changed: "changed", focused: "focused", blured: "blured" }, ngImport: i0, template: "<as-split [unit]=\"'percent'\" [gutterSize]=\"25\"> \n <as-split-area [size]=\"70\" [visible]=\"showHtml\" [order]=\"1\">\n <div class=\"editor-container\">\n <fs-label>HTML {{changes.html ? '*' : ''}}</fs-label>\n <fs-text-editor \n [(ngModel)]=\"html\" \n name=\"html\"\n [fsModelChangeOptions]=\"{ debounce: 0 }\"\n (fsModelChange)=\"change(EditorType.Html, $event)\"\n [config]=\"htmlConfig\">\n </fs-text-editor> \n </div>\n </as-split-area>\n <as-split-area [size]=\"30\" [visible]=\"showScss\" [order]=\"2\">\n <div class=\"editor-container\">\n <fs-label>SCSS {{changes.scss ? '*' : ''}}</fs-label>\n <fs-text-editor \n [(ngModel)]=\"scss\" \n name=\"scss\"\n [fsModelChangeOptions]=\"{ debounce: 0 }\"\n (fsModelChange)=\"change(EditorType.Scss, $event)\"\n [config]=\"scssConfig\">\n </fs-text-editor> \n </div>\n </as-split-area>\n <as-split-area [size]=\"30\" [visible]=\"showJs\" [order]=\"3\">\n <div class=\"editor-container\">\n <fs-label>JS {{changes.js ? '*' : ''}}</fs-label>\n <fs-text-editor \n [(ngModel)]=\"js\" \n name=\"js\"\n [fsModelChangeOptions]=\"{ debounce: 0 }\"\n (fsModelChange)=\"change(EditorType.Js, $event)\"\n [config]=\"jsConfig\">\n </fs-text-editor> \n </div>\n </as-split-area>\n <as-split-area [size]=\"30\" [visible]=\"showGlobalScss\" [order]=\"4\">\n <div class=\"editor-container\">\n <fs-label>Global SCSS {{changes.globalScss ? '*' : ''}}</fs-label>\n <ng-container *fsSkeleton=\"contentStyle\">\n <fs-text-editor \n [(ngModel)]=\"contentStyle.scss\" \n name=\"globalScss\"\n [fsModelChangeOptions]=\"{ debounce: 300 }\"\n (fsModelChange)=\"change(EditorType.GlobalScss, $event)\"\n [config]=\"globalScssConfig\">\n </fs-text-editor> \n </ng-container> \n </div>\n </as-split-area>\n</as-split>\n", styles: [":host ::ng-deep .as-split-gutter{background-color:unset!important}.editor-container{height:100%;border-radius:5px;display:flex;flex-direction:column}.editor-container fs-text-editor{flex:1}\n"], components: [{ type: i2$1.SplitComponent, selector: "as-split", inputs: ["direction", "unit", "gutterSize", "gutterStep", "restrictMove", "useTransition", "disabled", "dir", "gutterDblClickDuration", "gutterClickDeltaPx", "gutterAriaLabel"], outputs: ["transitionEnd", "dragStart", "dragEnd", "gutterClick", "gutterDblClick"], exportAs: ["asSplit"] }, { type: i3.FsLabelComponent, selector: "fs-label" }, { type: i4.FsTextEditorComponent, selector: "fs-text-editor", inputs: ["config", "scrollable"], outputs: ["ready", "blur"] }], directives: [{ type: i2$1.SplitAreaDirective, selector: "as-split-area, [as-split-area]", inputs: ["order", "size", "minSize", "maxSize", "lockSize", "visible"], exportAs: ["asSplitArea"] }, { type: i9.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i9.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i5.FsFormNoFsValidatorsDirective, selector: "[ngModel]:not([required]):not([fsFormRequired]):not([fsFormCompare]):not([fsFormDateRange]):not([fsFormEmail]):not([fsFormEmails]):not([fsFormFunction]):not([fsFormGreater]):not([fsFormInteger]):not([fsFormLesser]):not([fsFormMax]):not([fsFormMaxLength]):not([fsFormMin]):not([fsFormMinLength]):not([fsFormNumeric]):not([fsFormPattern]):not([fsFormPhone]):not([fsFormUrl]):not([validate])" }, { type: i7.FsModelChangeDirective, selector: "[fsModelChange]", inputs: ["fsModelChangeOptions"], outputs: ["fsModelChange"] }, { type: i8.FsSkeletonContentDirective, selector: "[fsSkeleton]", inputs: ["fsSkeleton", "fsSkeletonPattern"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
167
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: EditorComponent, decorators: [{
168
+ type: Component,
169
+ args: [{
170
+ selector: 'app-editor',
171
+ templateUrl: './editor.component.html',
172
+ styleUrls: ['./editor.component.scss'],
173
+ changeDetection: ChangeDetectionStrategy.OnPush,
174
+ }]
175
+ }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }, { type: i2.FsMessage }]; }, propDecorators: { showHtml: [{
176
+ type: Input
177
+ }], showScss: [{
178
+ type: Input
179
+ }], showJs: [{
180
+ type: Input
181
+ }], showGlobalScss: [{
182
+ type: Input
183
+ }], html: [{
184
+ type: Input
185
+ }], scss: [{
186
+ type: Input
187
+ }], js: [{
188
+ type: Input
189
+ }], contentConfig: [{
190
+ type: Input
191
+ }], changed: [{
192
+ type: Output
193
+ }], focused: [{
194
+ type: Output
195
+ }], blured: [{
196
+ type: Output
197
197
  }] } });
198
198
 
199
- class FsContentEditorModule {
200
- }
201
- FsContentEditorModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsContentEditorModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
202
- FsContentEditorModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsContentEditorModule, declarations: [EditorComponent], imports: [CommonModule,
203
- FormsModule,
204
- MatDialogModule,
205
- MatButtonModule,
206
- MatTabsModule,
207
- MatIconModule,
208
- MatButtonToggleModule,
209
- FsListModule,
210
- FsFormModule,
211
- FsSkeletonModule,
212
- FsLabelModule,
213
- FsHtmlEditorModule,
214
- FsCommonModule,
215
- FsDialogModule,
216
- FsTextEditorModule,
217
- AngularSplitModule], exports: [EditorComponent] });
218
- FsContentEditorModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsContentEditorModule, imports: [[
219
- CommonModule,
220
- FormsModule,
221
- MatDialogModule,
222
- MatButtonModule,
223
- MatTabsModule,
224
- MatIconModule,
225
- MatButtonToggleModule,
226
- FsListModule,
227
- FsFormModule,
228
- FsSkeletonModule,
229
- FsLabelModule,
230
- FsHtmlEditorModule,
231
- FsCommonModule,
232
- FsDialogModule,
233
- FsTextEditorModule,
234
- AngularSplitModule,
235
- ]] });
236
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsContentEditorModule, decorators: [{
237
- type: NgModule,
238
- args: [{
239
- imports: [
240
- CommonModule,
241
- FormsModule,
242
- MatDialogModule,
243
- MatButtonModule,
244
- MatTabsModule,
245
- MatIconModule,
246
- MatButtonToggleModule,
247
- FsListModule,
248
- FsFormModule,
249
- FsSkeletonModule,
250
- FsLabelModule,
251
- FsHtmlEditorModule,
252
- FsCommonModule,
253
- FsDialogModule,
254
- FsTextEditorModule,
255
- AngularSplitModule,
256
- ],
257
- exports: [
258
- EditorComponent,
259
- ],
260
- declarations: [
261
- EditorComponent,
262
- ],
263
- }]
199
+ class FsContentEditorModule {
200
+ }
201
+ FsContentEditorModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsContentEditorModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
202
+ FsContentEditorModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsContentEditorModule, declarations: [EditorComponent], imports: [CommonModule,
203
+ FormsModule,
204
+ MatDialogModule,
205
+ MatButtonModule,
206
+ MatTabsModule,
207
+ MatIconModule,
208
+ MatButtonToggleModule,
209
+ FsListModule,
210
+ FsFormModule,
211
+ FsSkeletonModule,
212
+ FsLabelModule,
213
+ FsHtmlEditorModule,
214
+ FsCommonModule,
215
+ FsDialogModule,
216
+ FsTextEditorModule,
217
+ AngularSplitModule], exports: [EditorComponent] });
218
+ FsContentEditorModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsContentEditorModule, imports: [[
219
+ CommonModule,
220
+ FormsModule,
221
+ MatDialogModule,
222
+ MatButtonModule,
223
+ MatTabsModule,
224
+ MatIconModule,
225
+ MatButtonToggleModule,
226
+ FsListModule,
227
+ FsFormModule,
228
+ FsSkeletonModule,
229
+ FsLabelModule,
230
+ FsHtmlEditorModule,
231
+ FsCommonModule,
232
+ FsDialogModule,
233
+ FsTextEditorModule,
234
+ AngularSplitModule,
235
+ ]] });
236
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsContentEditorModule, decorators: [{
237
+ type: NgModule,
238
+ args: [{
239
+ imports: [
240
+ CommonModule,
241
+ FormsModule,
242
+ MatDialogModule,
243
+ MatButtonModule,
244
+ MatTabsModule,
245
+ MatIconModule,
246
+ MatButtonToggleModule,
247
+ FsListModule,
248
+ FsFormModule,
249
+ FsSkeletonModule,
250
+ FsLabelModule,
251
+ FsHtmlEditorModule,
252
+ FsCommonModule,
253
+ FsDialogModule,
254
+ FsTextEditorModule,
255
+ AngularSplitModule,
256
+ ],
257
+ exports: [
258
+ EditorComponent,
259
+ ],
260
+ declarations: [
261
+ EditorComponent,
262
+ ],
263
+ }]
264
264
  }] });
265
265
 
266
266
  const FS_CONTENT_CONFIG = new InjectionToken('fs-content-config');
267
267
 
268
- class ContentLayoutComponent {
269
- constructor(_config, _data, _dialogRef, _message, _cdRef) {
270
- this._config = _config;
271
- this._data = _data;
272
- this._dialogRef = _dialogRef;
273
- this._message = _message;
274
- this._cdRef = _cdRef;
275
- this.contentLayout = null;
276
- this.editors = { content: true, styles: true };
277
- this._destroy$ = new Subject();
278
- this.save = () => {
279
- return this._config.saveContentLayout(this.contentLayout)
280
- .pipe(tap((contentLayout) => {
281
- this._message.success('Saved Changes');
282
- this._dialogRef.close(contentLayout);
283
- }));
284
- };
285
- }
286
- ngOnInit() {
287
- this._fetchData();
288
- }
289
- ngOnDestroy() {
290
- this._destroy$.next();
291
- this._destroy$.complete();
292
- }
293
- _fetchData() {
294
- of(this._data.contentLayout)
295
- .pipe(switchMap((contentLayout) => {
296
- return of(contentLayout);
297
- }), takeUntil(this._destroy$))
298
- .subscribe((contentLayout) => {
299
- this.contentLayout = Object.assign({}, contentLayout);
300
- this._cdRef.markForCheck();
301
- });
302
- }
303
- }
304
- ContentLayoutComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ContentLayoutComponent, deps: [{ token: FS_CONTENT_CONFIG }, { token: MAT_DIALOG_DATA }, { token: i1.MatDialogRef }, { token: i2.FsMessage }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
305
- ContentLayoutComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: ContentLayoutComponent, selector: "ng-component", viewQueries: [{ propertyName: "textEditors", predicate: FsTextEditorComponent, descendants: true }], ngImport: i0, template: "<form fsForm [submit]=\"save\" *fsSkeletonForm=\"contentLayout\">\n <fs-dialog>\n <h1 mat-dialog-title>{{contentLayout.id ? 'Layout' : 'Layout Page'}}</h1>\n <div mat-dialog-content>\n <div class=\"fs-column\">\n <mat-form-field>\n <input\n matInput\n [(ngModel)]=\"contentLayout.name\"\n name=\"name\"\n required\n placeholder=\"Name\">\n </mat-form-field>\n <mat-form-field>\n <input\n matInput\n [(ngModel)]=\"contentLayout.tag\"\n name=\"tag\"\n placeholder=\"Tag\">\n </mat-form-field>\n </div>\n </div>\n\n <div mat-dialog-actions>\n <fs-form-dialog-actions>\n </fs-form-dialog-actions>\n </div>\n </fs-dialog>\n</form>\n", styles: [""], components: [{ type: i3$1.FsDialogComponent, selector: "fs-dialog", inputs: ["mobileMode", "mobileActionPlacement", "mobileWidth", "mode"] }, { type: i4$1.MatFormField, selector: "mat-form-field", inputs: ["color", "floatLabel", "appearance", "hideRequiredMarker", "hintLabel"], exportAs: ["matFormField"] }, { type: i5.FsFormDialogActionsComponent, selector: "fs-form-dialog-actions", inputs: ["save", "create", "close", "done", "closeData", "name"] }], directives: [{ type: i8.FsSkeletonFormDirective, selector: "[fsSkeletonForm]", inputs: ["fsSkeletonForm", "fsSkeletonFormLines"] }, { type: i9.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i9.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i9.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i5.FsFormDirective, selector: "[fsForm]", inputs: ["wrapperSelector", "messageSelector", "hintSelector", "labelSelector", "autocomplete", "shortcuts", "confirm", "confirmDialog", "confirmDrawer", "confirmBrowser", "confirmTabs", "dirtySubmitButton", "submit", "successDelay", "errorDelay", "tabGroup", "deactivationGuard"], outputs: ["fsForm", "invalid", "valid", "submitted", "reseted", "cleared"], exportAs: ["fsForm"] }, { type: i1.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { type: i1.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { type: i8$1.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["id", "disabled", "required", "type", "value", "readonly", "placeholder", "errorStateMatcher", "aria-describedby"], exportAs: ["matInput"] }, { type: i9.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i9.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { type: i9.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i9.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i5.FsFormRequiredDirective, selector: "[fsFormRequired],[ngModel][required]", inputs: ["fsFormRequired", "required", "fsFormRequiredMessage"] }, { type: i5.FsFormNoFsValidatorsDirective, selector: "[ngModel]:not([required]):not([fsFormRequired]):not([fsFormCompare]):not([fsFormDateRange]):not([fsFormEmail]):not([fsFormEmails]):not([fsFormFunction]):not([fsFormGreater]):not([fsFormInteger]):not([fsFormLesser]):not([fsFormMax]):not([fsFormMaxLength]):not([fsFormMin]):not([fsFormMinLength]):not([fsFormNumeric]):not([fsFormPattern]):not([fsFormPhone]):not([fsFormUrl]):not([validate])" }, { type: i1.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
306
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ContentLayoutComponent, decorators: [{
307
- type: Component,
308
- args: [{
309
- templateUrl: './content-layout.component.html',
310
- styleUrls: ['./content-layout.component.scss'],
311
- changeDetection: ChangeDetectionStrategy.OnPush,
312
- }]
313
- }], ctorParameters: function () { return [{ type: undefined, decorators: [{
314
- type: Inject,
315
- args: [FS_CONTENT_CONFIG]
316
- }] }, { type: undefined, decorators: [{
317
- type: Inject,
318
- args: [MAT_DIALOG_DATA]
319
- }] }, { type: i1.MatDialogRef }, { type: i2.FsMessage }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { textEditors: [{
320
- type: ViewChildren,
321
- args: [FsTextEditorComponent]
268
+ class ContentLayoutComponent {
269
+ constructor(_config, _data, _dialogRef, _message, _cdRef) {
270
+ this._config = _config;
271
+ this._data = _data;
272
+ this._dialogRef = _dialogRef;
273
+ this._message = _message;
274
+ this._cdRef = _cdRef;
275
+ this.contentLayout = null;
276
+ this.editors = { content: true, styles: true };
277
+ this._destroy$ = new Subject();
278
+ this.save = () => {
279
+ return this._config.saveContentLayout(this.contentLayout)
280
+ .pipe(tap((contentLayout) => {
281
+ this._message.success('Saved Changes');
282
+ this._dialogRef.close(contentLayout);
283
+ }));
284
+ };
285
+ }
286
+ ngOnInit() {
287
+ this._fetchData();
288
+ }
289
+ ngOnDestroy() {
290
+ this._destroy$.next();
291
+ this._destroy$.complete();
292
+ }
293
+ _fetchData() {
294
+ of(this._data.contentLayout)
295
+ .pipe(switchMap((contentLayout) => {
296
+ return of(contentLayout);
297
+ }), takeUntil(this._destroy$))
298
+ .subscribe((contentLayout) => {
299
+ this.contentLayout = Object.assign({}, contentLayout);
300
+ this._cdRef.markForCheck();
301
+ });
302
+ }
303
+ }
304
+ ContentLayoutComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ContentLayoutComponent, deps: [{ token: FS_CONTENT_CONFIG }, { token: MAT_DIALOG_DATA }, { token: i1.MatDialogRef }, { token: i2.FsMessage }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
305
+ ContentLayoutComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: ContentLayoutComponent, selector: "ng-component", viewQueries: [{ propertyName: "textEditors", predicate: FsTextEditorComponent, descendants: true }], ngImport: i0, template: "<form fsForm [submit]=\"save\" *fsSkeletonForm=\"contentLayout\">\n <fs-dialog>\n <h1 mat-dialog-title>{{contentLayout.id ? 'Layout' : 'Layout Page'}}</h1>\n <div mat-dialog-content>\n <div class=\"fs-column\">\n <mat-form-field>\n <mat-label>Name</mat-label>\n <input\n matInput\n [(ngModel)]=\"contentLayout.name\"\n name=\"name\"\n required>\n </mat-form-field>\n <mat-form-field>\n <mat-label>Tag</mat-label>\n <input\n matInput\n [(ngModel)]=\"contentLayout.tag\"\n name=\"tag\">\n </mat-form-field>\n </div>\n </div>\n\n <div mat-dialog-actions>\n <fs-form-dialog-actions>\n </fs-form-dialog-actions>\n </div>\n </fs-dialog>\n</form>\n", styles: [""], components: [{ type: i3$1.FsDialogComponent, selector: "fs-dialog", inputs: ["mobileMode", "mobileActionPlacement", "mobileWidth", "mode"] }, { type: i4$1.MatFormField, selector: "mat-form-field", inputs: ["color", "floatLabel", "appearance", "hideRequiredMarker", "hintLabel"], exportAs: ["matFormField"] }, { type: i5.FsFormDialogActionsComponent, selector: "fs-form-dialog-actions", inputs: ["save", "create", "close", "done", "closeData", "name"] }], directives: [{ type: i8.FsSkeletonFormDirective, selector: "[fsSkeletonForm]", inputs: ["fsSkeletonForm", "fsSkeletonFormLines"] }, { type: i9.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i9.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i9.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i5.FsFormDirective, selector: "[fsForm]", inputs: ["wrapperSelector", "messageSelector", "hintSelector", "labelSelector", "autocomplete", "shortcuts", "confirm", "confirmDialog", "confirmDrawer", "confirmBrowser", "confirmTabs", "dirtySubmitButton", "submit", "successDelay", "errorDelay", "tabGroup", "deactivationGuard"], outputs: ["fsForm", "invalid", "valid", "submitted", "reseted", "cleared"], exportAs: ["fsForm"] }, { type: i1.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { type: i1.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { type: i4$1.MatLabel, selector: "mat-label" }, { type: i8$1.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["id", "disabled", "required", "type", "value", "readonly", "placeholder", "errorStateMatcher", "aria-describedby"], exportAs: ["matInput"] }, { type: i9.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i9.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { type: i9.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i9.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i5.FsFormRequiredDirective, selector: "[fsFormRequired],[ngModel][required]", inputs: ["fsFormRequired", "required", "fsFormRequiredMessage"] }, { type: i5.FsFormNoFsValidatorsDirective, selector: "[ngModel]:not([required]):not([fsFormRequired]):not([fsFormCompare]):not([fsFormDateRange]):not([fsFormEmail]):not([fsFormEmails]):not([fsFormFunction]):not([fsFormGreater]):not([fsFormInteger]):not([fsFormLesser]):not([fsFormMax]):not([fsFormMaxLength]):not([fsFormMin]):not([fsFormMinLength]):not([fsFormNumeric]):not([fsFormPattern]):not([fsFormPhone]):not([fsFormUrl]):not([validate])" }, { type: i1.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
306
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ContentLayoutComponent, decorators: [{
307
+ type: Component,
308
+ args: [{
309
+ templateUrl: './content-layout.component.html',
310
+ styleUrls: ['./content-layout.component.scss'],
311
+ changeDetection: ChangeDetectionStrategy.OnPush,
312
+ }]
313
+ }], ctorParameters: function () { return [{ type: undefined, decorators: [{
314
+ type: Inject,
315
+ args: [FS_CONTENT_CONFIG]
316
+ }] }, { type: undefined, decorators: [{
317
+ type: Inject,
318
+ args: [MAT_DIALOG_DATA]
319
+ }] }, { type: i1.MatDialogRef }, { type: i2.FsMessage }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { textEditors: [{
320
+ type: ViewChildren,
321
+ args: [FsTextEditorComponent]
322
322
  }] } });
323
323
 
324
- class ContentLayoutEditorComponent {
325
- constructor(_data, _dialogRef, _message, _dialog, _cdRef, _prompt) {
326
- this._data = _data;
327
- this._dialogRef = _dialogRef;
328
- this._message = _message;
329
- this._dialog = _dialog;
330
- this._cdRef = _cdRef;
331
- this._prompt = _prompt;
332
- this.EditorType = EditorType;
333
- this.focused = null;
334
- this.editors = {
335
- [EditorType.Html]: true,
336
- [EditorType.Scss]: true,
337
- [EditorType.GlobalScss]: false,
338
- };
339
- this._destroy$ = new Subject();
340
- this.save = () => {
341
- return of(null)
342
- .pipe(filter(() => this.focused), switchMap(() => {
343
- switch (this.focused) {
344
- case EditorType.Html:
345
- case EditorType.Scss:
346
- return this.saveContentPage();
347
- case EditorType.GlobalScss:
348
- return this.editor.saveGlobalScss();
349
- }
350
- return throwError('Invalid focus');
351
- }), tap(() => {
352
- this.editor.clearChange(this.focused);
353
- this._cdRef.markForCheck();
354
- }));
355
- };
356
- }
357
- ngOnInit() {
358
- this._dialogRef.addPanelClass('fs-content-editor-overlay-pane');
359
- this._dialogRef.disableClose = true;
360
- this.config = this._data.contentConfig;
361
- this._initContentLayout(this._data.contentLayout);
362
- }
363
- editorToggleChange(event) {
364
- this.editors[event.value] = !this.editors[event.value];
365
- }
366
- ngOnDestroy() {
367
- this._destroy$.next();
368
- this._destroy$.complete();
369
- }
370
- _initContentLayout(contentLayout) {
371
- this.config.loadContentLayout(contentLayout.id)
372
- .subscribe((data) => {
373
- this.contentLayout = data;
374
- this._cdRef.markForCheck();
375
- });
376
- }
377
- editorFocused(type) {
378
- this.focused = type;
379
- }
380
- saveContentPage() {
381
- const names = {
382
- [EditorType.Scss]: 'styles',
383
- [EditorType.Html]: 'content',
384
- };
385
- const data = {
386
- id: this.contentLayout.id,
387
- [names[this.focused]]: this.editor.changes[this.focused],
388
- };
389
- return this.config.saveContentLayout(Object.assign({ id: this.contentLayout.id }, data))
390
- .pipe(tap(() => {
391
- this._message.success('Saved Changes');
392
- }));
393
- }
394
- cancel() {
395
- if (!this.editor.hasChanges) {
396
- return this._dialogRef.close();
397
- }
398
- this._prompt.confirm({
399
- dialogConfig: {
400
- width: null,
401
- },
402
- title: 'You have unsaved changes',
403
- template: 'What would you like to do with your changes?',
404
- buttons: [
405
- {
406
- label: 'Review Changes',
407
- value: 'review',
408
- },
409
- {
410
- label: 'Discard Changes',
411
- value: 'discard',
412
- },
413
- ],
414
- })
415
- .pipe(takeUntil(this._destroy$))
416
- .subscribe((value) => {
417
- if (value === 'discard') {
418
- this._dialogRef.close();
419
- }
420
- });
421
- }
422
- openSettings() {
423
- this._dialog.open(ContentLayoutComponent, {
424
- data: {
425
- contentLayout: this.contentLayout,
426
- },
427
- })
428
- .afterClosed()
429
- .pipe(takeUntil(this._destroy$))
430
- .subscribe((contentLayout) => {
431
- this.contentLayout = Object.assign(Object.assign({}, this.contentLayout), contentLayout);
432
- this._cdRef.markForCheck();
433
- });
434
- }
435
- }
436
- ContentLayoutEditorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ContentLayoutEditorComponent, deps: [{ token: MAT_DIALOG_DATA }, { token: i1.MatDialogRef }, { token: i2.FsMessage }, { token: i1.MatDialog }, { token: i0.ChangeDetectorRef }, { token: i3$2.FsPrompt }], target: i0.ɵɵFactoryTarget.Component });
437
- ContentLayoutEditorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: ContentLayoutEditorComponent, selector: "ng-component", viewQueries: [{ propertyName: "editor", first: true, predicate: EditorComponent, descendants: true }], ngImport: i0, template: "<form fsForm [submit]=\"save\" [dirtySubmitButton]=\"false\" [confirm]=\"false\">\n <fs-dialog *fsSkeletonForm=\"contentLayout\">\n <h1 mat-dialog-title>\n <div class=\"title-container\">\n <div class=\"title\">\n Layout Editor\n <div class=\"small\">{{contentLayout.name}}</div> \n </div>\n <a\n (click)=\"openSettings()\"\n mat-icon-button>\n <mat-icon>settings</mat-icon>\n </a> \n </div>\n </h1>\n <div mat-dialog-content>\n <app-editor\n [contentConfig]=\"config\"\n [showHtml]=\"editors.html\"\n [showScss]=\"editors.scss\"\n [showGlobalScss]=\"editors.globalScss\"\n [html]=\"contentLayout.content\"\n [scss]=\"contentLayout.styles\"\n (focused)=\"editorFocused($event)\">\n </app-editor>\n </div>\n\n <div mat-dialog-actions>\n <button \n mat-button\n color=\"primary\"\n (click)=\"cancel()\"\n type=\"button\"> \n Done \n </button>\n <div class=\"toggles\">\n <mat-button-toggle-group multiple>\n <mat-button-toggle value=\"html\" [checked]=\"editors.html\" (change)=\"editorToggleChange($event)\">HTML</mat-button-toggle>\n <mat-button-toggle value=\"scss\" [checked]=\"editors.scss\" (change)=\"editorToggleChange($event)\">SCSS</mat-button-toggle>\n <mat-button-toggle value=\"globalScss\" [checked]=\"editors.globalScss\" (change)=\"editorToggleChange($event)\">Global SCSS</mat-button-toggle>\n </mat-button-toggle-group> \n </div>\n </div>\n </fs-dialog>\n</form>", styles: ["::ng-deep .fs-content-editor-overlay-pane .mat-dialog-container{border-radius:0}form{height:100%}fs-dialog{display:flex;height:100%;flex-direction:column}fs-dialog ::ng-deep .mat-dialog-content{max-height:none;flex:1;overflow:hidden}.mat-dialog-actions .toggles{display:flex;justify-content:flex-end;justify-self:baseline;flex:1}.title-container{display:flex;align-items:center}.title-container .title{flex:1}.title-container .title .small{line-height:normal}\n"], components: [{ type: i3$1.FsDialogComponent, selector: "fs-dialog", inputs: ["mobileMode", "mobileActionPlacement", "mobileWidth", "mode"] }, { type: i5$1.MatAnchor, selector: "a[mat-button], a[mat-raised-button], a[mat-icon-button], a[mat-fab], a[mat-mini-fab], a[mat-stroked-button], a[mat-flat-button]", inputs: ["disabled", "disableRipple", "color", "tabIndex"], exportAs: ["matButton", "matAnchor"] }, { type: i6.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { type: EditorComponent, selector: "app-editor", inputs: ["showHtml", "showScss", "showJs", "showGlobalScss", "html", "scss", "js", "contentConfig"], outputs: ["changed", "focused", "blured"] }, { type: i5$1.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { type: i8$2.MatButtonToggle, selector: "mat-button-toggle", inputs: ["disableRipple", "aria-labelledby", "tabIndex", "appearance", "checked", "disabled", "id", "name", "aria-label", "value"], outputs: ["change"], exportAs: ["matButtonToggle"] }], directives: [{ type: i9.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i9.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i9.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i5.FsFormDirective, selector: "[fsForm]", inputs: ["wrapperSelector", "messageSelector", "hintSelector", "labelSelector", "autocomplete", "shortcuts", "confirm", "confirmDialog", "confirmDrawer", "confirmBrowser", "confirmTabs", "dirtySubmitButton", "submit", "successDelay", "errorDelay", "tabGroup", "deactivationGuard"], outputs: ["fsForm", "invalid", "valid", "submitted", "reseted", "cleared"], exportAs: ["fsForm"] }, { type: i8.FsSkeletonFormDirective, selector: "[fsSkeletonForm]", inputs: ["fsSkeletonForm", "fsSkeletonFormLines"] }, { type: i1.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { type: i1.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { type: i1.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]" }, { type: i5.FsButtonDirective, selector: "[mat-raised-button],[mat-button],[mat-flat-button],[mat-stroked-button]", inputs: ["name", "dirtySubmit", "form"] }, { type: i8$2.MatButtonToggleGroup, selector: "mat-button-toggle-group", inputs: ["appearance", "name", "vertical", "value", "multiple", "disabled"], outputs: ["valueChange", "change"], exportAs: ["matButtonToggleGroup"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
438
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ContentLayoutEditorComponent, decorators: [{
439
- type: Component,
440
- args: [{
441
- templateUrl: './content-layout-editor.component.html',
442
- styleUrls: ['./content-layout-editor.component.scss'],
443
- changeDetection: ChangeDetectionStrategy.OnPush,
444
- }]
445
- }], ctorParameters: function () { return [{ type: undefined, decorators: [{
446
- type: Inject,
447
- args: [MAT_DIALOG_DATA]
448
- }] }, { type: i1.MatDialogRef }, { type: i2.FsMessage }, { type: i1.MatDialog }, { type: i0.ChangeDetectorRef }, { type: i3$2.FsPrompt }]; }, propDecorators: { editor: [{
449
- type: ViewChild,
450
- args: [EditorComponent]
324
+ class ContentLayoutEditorComponent {
325
+ constructor(_data, _dialogRef, _message, _dialog, _cdRef, _prompt) {
326
+ this._data = _data;
327
+ this._dialogRef = _dialogRef;
328
+ this._message = _message;
329
+ this._dialog = _dialog;
330
+ this._cdRef = _cdRef;
331
+ this._prompt = _prompt;
332
+ this.EditorType = EditorType;
333
+ this.focused = null;
334
+ this.editors = {
335
+ [EditorType.Html]: true,
336
+ [EditorType.Scss]: true,
337
+ [EditorType.GlobalScss]: false,
338
+ };
339
+ this._destroy$ = new Subject();
340
+ this.save = () => {
341
+ return of(null)
342
+ .pipe(filter(() => this.focused), switchMap(() => {
343
+ switch (this.focused) {
344
+ case EditorType.Html:
345
+ case EditorType.Scss:
346
+ return this.saveContentPage();
347
+ case EditorType.GlobalScss:
348
+ return this.editor.saveGlobalScss();
349
+ }
350
+ return throwError('Invalid focus');
351
+ }), tap(() => {
352
+ this.editor.clearChange(this.focused);
353
+ this._cdRef.markForCheck();
354
+ }));
355
+ };
356
+ }
357
+ ngOnInit() {
358
+ this._dialogRef.addPanelClass('fs-content-editor-overlay-pane');
359
+ this._dialogRef.disableClose = true;
360
+ this.config = this._data.contentConfig;
361
+ this._initContentLayout(this._data.contentLayout);
362
+ this._initEscape();
363
+ }
364
+ editorToggleChange(event) {
365
+ this.editors[event.value] = !this.editors[event.value];
366
+ }
367
+ ngOnDestroy() {
368
+ this._destroy$.next();
369
+ this._destroy$.complete();
370
+ }
371
+ _initContentLayout(contentLayout) {
372
+ this.config.loadContentLayout(contentLayout.id)
373
+ .subscribe((data) => {
374
+ this.contentLayout = data;
375
+ this._cdRef.markForCheck();
376
+ });
377
+ }
378
+ editorFocused(type) {
379
+ this.focused = type;
380
+ }
381
+ saveContentPage() {
382
+ const names = {
383
+ [EditorType.Scss]: 'styles',
384
+ [EditorType.Html]: 'content',
385
+ };
386
+ const data = {
387
+ id: this.contentLayout.id,
388
+ [names[this.focused]]: this.editor.changes[this.focused],
389
+ };
390
+ return this.config.saveContentLayout(Object.assign({ id: this.contentLayout.id }, data))
391
+ .pipe(tap(() => {
392
+ this._message.success('Saved Changes');
393
+ }));
394
+ }
395
+ close() {
396
+ if (!this.editor.hasChanges) {
397
+ return this._dialogRef.close();
398
+ }
399
+ this._prompt.confirm({
400
+ dialogConfig: {
401
+ width: null,
402
+ },
403
+ title: 'You have unsaved changes',
404
+ template: 'What would you like to do with your changes?',
405
+ buttons: [
406
+ {
407
+ label: 'Review Changes',
408
+ value: 'review',
409
+ },
410
+ {
411
+ label: 'Discard Changes',
412
+ value: 'discard',
413
+ },
414
+ ],
415
+ })
416
+ .pipe(takeUntil(this._destroy$))
417
+ .subscribe((value) => {
418
+ if (value === 'discard') {
419
+ this._dialogRef.close();
420
+ }
421
+ });
422
+ }
423
+ openSettings() {
424
+ this._dialog.open(ContentLayoutComponent, {
425
+ data: {
426
+ contentLayout: this.contentLayout,
427
+ },
428
+ })
429
+ .afterClosed()
430
+ .pipe(takeUntil(this._destroy$))
431
+ .subscribe((contentLayout) => {
432
+ this.contentLayout = Object.assign(Object.assign({}, this.contentLayout), contentLayout);
433
+ this._cdRef.markForCheck();
434
+ });
435
+ }
436
+ _initEscape() {
437
+ fromEvent(document, 'keydown')
438
+ .pipe(filter((event) => event.code === 'Escape'), takeUntil(this._destroy$)).subscribe(() => {
439
+ const dialogRef = this._dialog.openDialogs.reverse()[0];
440
+ if ((dialogRef === null || dialogRef === void 0 ? void 0 : dialogRef.componentInstance) === this) {
441
+ this.close();
442
+ }
443
+ });
444
+ }
445
+ }
446
+ ContentLayoutEditorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ContentLayoutEditorComponent, deps: [{ token: MAT_DIALOG_DATA }, { token: i1.MatDialogRef }, { token: i2.FsMessage }, { token: i1.MatDialog }, { token: i0.ChangeDetectorRef }, { token: i3$2.FsPrompt }], target: i0.ɵɵFactoryTarget.Component });
447
+ ContentLayoutEditorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: ContentLayoutEditorComponent, selector: "ng-component", viewQueries: [{ propertyName: "editor", first: true, predicate: EditorComponent, descendants: true }], ngImport: i0, template: "<form fsForm [submit]=\"save\" [dirtySubmitButton]=\"false\" [confirm]=\"false\">\n <fs-dialog *fsSkeletonForm=\"contentLayout\">\n <h1 mat-dialog-title>\n <div class=\"title-container\">\n <div class=\"title\">\n Layout Editor\n <div class=\"small\">{{contentLayout.name}}</div> \n </div>\n <a\n (click)=\"openSettings()\"\n mat-icon-button>\n <mat-icon>settings</mat-icon>\n </a> \n </div>\n </h1>\n <div mat-dialog-content>\n <app-editor\n [contentConfig]=\"config\"\n [showHtml]=\"editors.html\"\n [showScss]=\"editors.scss\"\n [showGlobalScss]=\"editors.globalScss\"\n [html]=\"contentLayout.content\"\n [scss]=\"contentLayout.styles\"\n (focused)=\"editorFocused($event)\">\n </app-editor>\n </div>\n\n <div mat-dialog-actions>\n <button \n mat-button\n color=\"primary\"\n (click)=\"close()\"\n type=\"button\"> \n Done \n </button>\n <div class=\"toggles\">\n <mat-button-toggle-group multiple>\n <mat-button-toggle value=\"html\" [checked]=\"editors.html\" (change)=\"editorToggleChange($event)\">HTML</mat-button-toggle>\n <mat-button-toggle value=\"scss\" [checked]=\"editors.scss\" (change)=\"editorToggleChange($event)\">SCSS</mat-button-toggle>\n <mat-button-toggle value=\"globalScss\" [checked]=\"editors.globalScss\" (change)=\"editorToggleChange($event)\">Global SCSS</mat-button-toggle>\n </mat-button-toggle-group> \n </div>\n </div>\n </fs-dialog>\n</form>", styles: ["::ng-deep .fs-content-editor-overlay-pane .mat-dialog-container{border-radius:0}form{height:100%}fs-dialog{display:flex;height:100%;flex-direction:column}fs-dialog ::ng-deep .mat-dialog-content{max-height:none;flex:1;overflow:hidden}.mat-dialog-actions .toggles{display:flex;justify-content:flex-end;justify-self:baseline;flex:1}.title-container{display:flex;align-items:center}.title-container .title{flex:1}.title-container .title .small{line-height:normal}\n"], components: [{ type: i3$1.FsDialogComponent, selector: "fs-dialog", inputs: ["mobileMode", "mobileActionPlacement", "mobileWidth", "mode"] }, { type: i5$1.MatAnchor, selector: "a[mat-button], a[mat-raised-button], a[mat-icon-button], a[mat-fab], a[mat-mini-fab], a[mat-stroked-button], a[mat-flat-button]", inputs: ["disabled", "disableRipple", "color", "tabIndex"], exportAs: ["matButton", "matAnchor"] }, { type: i6.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { type: EditorComponent, selector: "app-editor", inputs: ["showHtml", "showScss", "showJs", "showGlobalScss", "html", "scss", "js", "contentConfig"], outputs: ["changed", "focused", "blured"] }, { type: i5$1.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { type: i8$2.MatButtonToggle, selector: "mat-button-toggle", inputs: ["disableRipple", "aria-labelledby", "tabIndex", "appearance", "checked", "disabled", "id", "name", "aria-label", "value"], outputs: ["change"], exportAs: ["matButtonToggle"] }], directives: [{ type: i9.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i9.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i9.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i5.FsFormDirective, selector: "[fsForm]", inputs: ["wrapperSelector", "messageSelector", "hintSelector", "labelSelector", "autocomplete", "shortcuts", "confirm", "confirmDialog", "confirmDrawer", "confirmBrowser", "confirmTabs", "dirtySubmitButton", "submit", "successDelay", "errorDelay", "tabGroup", "deactivationGuard"], outputs: ["fsForm", "invalid", "valid", "submitted", "reseted", "cleared"], exportAs: ["fsForm"] }, { type: i8.FsSkeletonFormDirective, selector: "[fsSkeletonForm]", inputs: ["fsSkeletonForm", "fsSkeletonFormLines"] }, { type: i1.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { type: i1.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { type: i1.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]" }, { type: i5.FsButtonDirective, selector: "[mat-raised-button],[mat-button],[mat-flat-button],[mat-stroked-button]", inputs: ["name", "dirtySubmit", "form"] }, { type: i8$2.MatButtonToggleGroup, selector: "mat-button-toggle-group", inputs: ["appearance", "name", "vertical", "value", "multiple", "disabled"], outputs: ["valueChange", "change"], exportAs: ["matButtonToggleGroup"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
448
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ContentLayoutEditorComponent, decorators: [{
449
+ type: Component,
450
+ args: [{
451
+ templateUrl: './content-layout-editor.component.html',
452
+ styleUrls: ['./content-layout-editor.component.scss'],
453
+ changeDetection: ChangeDetectionStrategy.OnPush,
454
+ }]
455
+ }], ctorParameters: function () { return [{ type: undefined, decorators: [{
456
+ type: Inject,
457
+ args: [MAT_DIALOG_DATA]
458
+ }] }, { type: i1.MatDialogRef }, { type: i2.FsMessage }, { type: i1.MatDialog }, { type: i0.ChangeDetectorRef }, { type: i3$2.FsPrompt }]; }, propDecorators: { editor: [{
459
+ type: ViewChild,
460
+ args: [EditorComponent]
451
461
  }] } });
452
462
 
453
- class FsContentLayoutsComponent {
454
- constructor(_config, _dialog) {
455
- this._config = _config;
456
- this._dialog = _dialog;
457
- this._destroy$ = new Subject();
458
- }
459
- ngOnInit() {
460
- this._initListConfig();
461
- }
462
- openEditor(contentLayout) {
463
- this._dialog.open(ContentLayoutEditorComponent, {
464
- maxWidth: '100vw',
465
- width: '100%',
466
- height: '100%',
467
- data: {
468
- contentLayout,
469
- contentConfig: this._config,
470
- },
471
- })
472
- .afterClosed()
473
- .pipe(takeUntil(this._destroy$))
474
- .subscribe(() => {
475
- this.listComponent.reload();
476
- });
477
- }
478
- openLayout(contentLayout) {
479
- return this._dialog.open(ContentLayoutComponent, {
480
- data: {
481
- contentLayout,
482
- },
483
- })
484
- .afterClosed()
485
- .pipe(filter((_contentLayout) => !!_contentLayout), takeUntil(this._destroy$));
486
- }
487
- ngOnDestroy() {
488
- this._destroy$.next();
489
- this._destroy$.complete();
490
- }
491
- _initListConfig() {
492
- this.listConfig = {
493
- paging: false,
494
- filters: [
495
- {
496
- name: 'keyword',
497
- type: ItemType.Keyword,
498
- label: 'Search',
499
- },
500
- ],
501
- actions: [
502
- {
503
- label: 'Create',
504
- click: () => {
505
- this.openLayout({})
506
- .subscribe(() => {
507
- this.listComponent.reload();
508
- });
509
- },
510
- },
511
- ],
512
- rowActions: [
513
- {
514
- click: (data) => {
515
- return this._config.deleteContentLayout(data);
516
- },
517
- remove: {
518
- title: 'Confirm',
519
- template: 'Are you sure you would like to delete this record?',
520
- },
521
- menu: true,
522
- label: 'Delete',
523
- },
524
- ],
525
- fetch: (query) => {
526
- return this._config.loadContentLayouts(query)
527
- .pipe(map((contentLayouts) => {
528
- return { data: contentLayouts };
529
- }));
530
- },
531
- restore: {
532
- query: { state: 'deleted' },
533
- filterLabel: 'Show Deleted',
534
- menuLabel: 'Restore',
535
- reload: true,
536
- click: (row) => {
537
- return this._config.saveContentLayout({ id: row.id, state: 'active' });
538
- },
539
- },
540
- };
541
- }
542
- }
543
- FsContentLayoutsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsContentLayoutsComponent, deps: [{ token: FS_CONTENT_CONFIG }, { token: i1.MatDialog }], target: i0.ɵɵFactoryTarget.Component });
544
- FsContentLayoutsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FsContentLayoutsComponent, selector: "fs-content-layouts", viewQueries: [{ propertyName: "listComponent", first: true, predicate: FsListComponent, descendants: true }], ngImport: i0, template: "<fs-list [config]=\"listConfig\">\n <fs-list-column name=\"name\" title=\"Name\" [sortable]=\"true\">\n <ng-template fs-list-cell let-row=\"row\">\n <a (click)=\"openEditor(row)\">{{row.name}}</a>\n </ng-template>\n </fs-list-column>\n <fs-list-column name=\"modify_date\" title=\"Modified\" [sortable]=\"true\">\n <ng-template fs-list-cell let-row=\"row\">\n {{row.modifyDate | fsDate: 'date-time-yearless'}}\n </ng-template>\n </fs-list-column>\n</fs-list>\n", styles: [""], components: [{ type: i2$2.FsListComponent, selector: "fs-list", inputs: ["config", "loaderLines"], outputs: ["filtersReady"] }], directives: [{ type: i2$2.FsListColumnDirective, selector: "fs-list-column", inputs: ["show", "title", "name", "customize", "sortable", "sortableDefault", "direction", "align", "width", "class"] }, { type: i2$2.FsListCellDirective, selector: "[fs-list-cell]", inputs: ["colspan", "align", "class"] }], pipes: { "fsDate": i3$3.FsDatePipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
545
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsContentLayoutsComponent, decorators: [{
546
- type: Component,
547
- args: [{
548
- selector: 'fs-content-layouts',
549
- templateUrl: './content-layouts.component.html',
550
- styleUrls: ['./content-layouts.component.scss'],
551
- changeDetection: ChangeDetectionStrategy.OnPush,
552
- }]
553
- }], ctorParameters: function () { return [{ type: undefined, decorators: [{
554
- type: Inject,
555
- args: [FS_CONTENT_CONFIG]
556
- }] }, { type: i1.MatDialog }]; }, propDecorators: { listComponent: [{
557
- type: ViewChild,
558
- args: [FsListComponent]
463
+ class FsContentLayoutsComponent {
464
+ constructor(_config, _dialog) {
465
+ this._config = _config;
466
+ this._dialog = _dialog;
467
+ this._destroy$ = new Subject();
468
+ }
469
+ ngOnInit() {
470
+ this._initListConfig();
471
+ }
472
+ openEditor(contentLayout) {
473
+ this._dialog.open(ContentLayoutEditorComponent, {
474
+ maxWidth: '100vw',
475
+ width: '100%',
476
+ height: '100%',
477
+ data: {
478
+ contentLayout,
479
+ contentConfig: this._config,
480
+ },
481
+ })
482
+ .afterClosed()
483
+ .pipe(takeUntil(this._destroy$))
484
+ .subscribe(() => {
485
+ this.listComponent.reload();
486
+ });
487
+ }
488
+ openLayout(contentLayout) {
489
+ return this._dialog.open(ContentLayoutComponent, {
490
+ data: {
491
+ contentLayout,
492
+ },
493
+ })
494
+ .afterClosed()
495
+ .pipe(filter((_contentLayout) => !!_contentLayout), takeUntil(this._destroy$));
496
+ }
497
+ ngOnDestroy() {
498
+ this._destroy$.next();
499
+ this._destroy$.complete();
500
+ }
501
+ _initListConfig() {
502
+ this.listConfig = {
503
+ paging: false,
504
+ filters: [
505
+ {
506
+ name: 'keyword',
507
+ type: ItemType.Keyword,
508
+ label: 'Search',
509
+ },
510
+ ],
511
+ actions: [
512
+ {
513
+ label: 'Create',
514
+ click: () => {
515
+ this.openLayout({})
516
+ .subscribe(() => {
517
+ this.listComponent.reload();
518
+ });
519
+ },
520
+ },
521
+ ],
522
+ rowActions: [
523
+ {
524
+ click: (data) => {
525
+ return this._config.deleteContentLayout(data);
526
+ },
527
+ remove: {
528
+ title: 'Confirm',
529
+ template: 'Are you sure you would like to delete this record?',
530
+ },
531
+ menu: true,
532
+ label: 'Delete',
533
+ },
534
+ ],
535
+ fetch: (query) => {
536
+ return this._config.loadContentLayouts(query)
537
+ .pipe(map((contentLayouts) => {
538
+ return { data: contentLayouts };
539
+ }));
540
+ },
541
+ restore: {
542
+ query: { state: 'deleted' },
543
+ filterLabel: 'Show Deleted',
544
+ menuLabel: 'Restore',
545
+ reload: true,
546
+ click: (row) => {
547
+ return this._config.saveContentLayout({ id: row.id, state: 'active' });
548
+ },
549
+ },
550
+ };
551
+ }
552
+ }
553
+ FsContentLayoutsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsContentLayoutsComponent, deps: [{ token: FS_CONTENT_CONFIG }, { token: i1.MatDialog }], target: i0.ɵɵFactoryTarget.Component });
554
+ FsContentLayoutsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FsContentLayoutsComponent, selector: "fs-content-layouts", viewQueries: [{ propertyName: "listComponent", first: true, predicate: FsListComponent, descendants: true }], ngImport: i0, template: "<fs-list [config]=\"listConfig\">\n <fs-list-column name=\"name\" title=\"Name\" [sortable]=\"true\">\n <ng-template fs-list-cell let-row=\"row\">\n <a (click)=\"openEditor(row)\">{{row.name}}</a>\n </ng-template>\n </fs-list-column>\n <fs-list-column name=\"modify_date\" title=\"Modified\" [sortable]=\"true\">\n <ng-template fs-list-cell let-row=\"row\">\n {{row.modifyDate | fsDate: 'date-time-yearless'}}\n </ng-template>\n </fs-list-column>\n</fs-list>\n", styles: [""], components: [{ type: i2$2.FsListComponent, selector: "fs-list", inputs: ["config", "loaderLines"], outputs: ["filtersReady"] }], directives: [{ type: i2$2.FsListColumnDirective, selector: "fs-list-column", inputs: ["show", "title", "name", "customize", "sortable", "sortableDefault", "direction", "align", "width", "class"] }, { type: i2$2.FsListCellDirective, selector: "[fs-list-cell]", inputs: ["colspan", "align", "class"] }], pipes: { "fsDate": i3$3.FsDatePipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
555
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsContentLayoutsComponent, decorators: [{
556
+ type: Component,
557
+ args: [{
558
+ selector: 'fs-content-layouts',
559
+ templateUrl: './content-layouts.component.html',
560
+ styleUrls: ['./content-layouts.component.scss'],
561
+ changeDetection: ChangeDetectionStrategy.OnPush,
562
+ }]
563
+ }], ctorParameters: function () { return [{ type: undefined, decorators: [{
564
+ type: Inject,
565
+ args: [FS_CONTENT_CONFIG]
566
+ }] }, { type: i1.MatDialog }]; }, propDecorators: { listComponent: [{
567
+ type: ViewChild,
568
+ args: [FsListComponent]
559
569
  }] } });
560
570
 
561
- class FsContentLayoutsModule {
562
- }
563
- FsContentLayoutsModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsContentLayoutsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
564
- FsContentLayoutsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsContentLayoutsModule, declarations: [ContentLayoutComponent,
565
- FsContentLayoutsComponent,
566
- ContentLayoutEditorComponent], imports: [CommonModule,
567
- FormsModule,
568
- MatDialogModule,
569
- MatInputModule,
570
- MatFormFieldModule,
571
- MatButtonModule,
572
- MatTabsModule,
573
- MatIconModule,
574
- MatSelectModule,
575
- MatButtonToggleModule,
576
- FsListModule,
577
- FsDateModule,
578
- FsFormModule,
579
- FsLabelModule,
580
- FsSkeletonModule,
581
- FsHtmlEditorModule,
582
- FsDialogModule,
583
- FsTextEditorModule,
584
- FsContentEditorModule], exports: [FsContentLayoutsComponent] });
585
- FsContentLayoutsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsContentLayoutsModule, imports: [[
586
- CommonModule,
587
- FormsModule,
588
- MatDialogModule,
589
- MatInputModule,
590
- MatFormFieldModule,
591
- MatButtonModule,
592
- MatTabsModule,
593
- MatIconModule,
594
- MatSelectModule,
595
- MatButtonToggleModule,
596
- FsListModule,
597
- FsDateModule,
598
- FsFormModule,
599
- FsLabelModule,
600
- FsSkeletonModule,
601
- FsHtmlEditorModule,
602
- FsDialogModule,
603
- FsTextEditorModule,
604
- FsContentEditorModule,
605
- ]] });
606
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsContentLayoutsModule, decorators: [{
607
- type: NgModule,
608
- args: [{
609
- imports: [
610
- CommonModule,
611
- FormsModule,
612
- MatDialogModule,
613
- MatInputModule,
614
- MatFormFieldModule,
615
- MatButtonModule,
616
- MatTabsModule,
617
- MatIconModule,
618
- MatSelectModule,
619
- MatButtonToggleModule,
620
- FsListModule,
621
- FsDateModule,
622
- FsFormModule,
623
- FsLabelModule,
624
- FsSkeletonModule,
625
- FsHtmlEditorModule,
626
- FsDialogModule,
627
- FsTextEditorModule,
628
- FsContentEditorModule,
629
- ],
630
- exports: [
631
- FsContentLayoutsComponent,
632
- ],
633
- declarations: [
634
- ContentLayoutComponent,
635
- FsContentLayoutsComponent,
636
- ContentLayoutEditorComponent,
637
- ],
638
- }]
571
+ class FsContentLayoutsModule {
572
+ }
573
+ FsContentLayoutsModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsContentLayoutsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
574
+ FsContentLayoutsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsContentLayoutsModule, declarations: [ContentLayoutComponent,
575
+ FsContentLayoutsComponent,
576
+ ContentLayoutEditorComponent], imports: [CommonModule,
577
+ FormsModule,
578
+ MatDialogModule,
579
+ MatInputModule,
580
+ MatFormFieldModule,
581
+ MatButtonModule,
582
+ MatTabsModule,
583
+ MatIconModule,
584
+ MatSelectModule,
585
+ MatButtonToggleModule,
586
+ FsListModule,
587
+ FsDateModule,
588
+ FsFormModule,
589
+ FsLabelModule,
590
+ FsSkeletonModule,
591
+ FsHtmlEditorModule,
592
+ FsDialogModule,
593
+ FsTextEditorModule,
594
+ FsContentEditorModule], exports: [FsContentLayoutsComponent] });
595
+ FsContentLayoutsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsContentLayoutsModule, imports: [[
596
+ CommonModule,
597
+ FormsModule,
598
+ MatDialogModule,
599
+ MatInputModule,
600
+ MatFormFieldModule,
601
+ MatButtonModule,
602
+ MatTabsModule,
603
+ MatIconModule,
604
+ MatSelectModule,
605
+ MatButtonToggleModule,
606
+ FsListModule,
607
+ FsDateModule,
608
+ FsFormModule,
609
+ FsLabelModule,
610
+ FsSkeletonModule,
611
+ FsHtmlEditorModule,
612
+ FsDialogModule,
613
+ FsTextEditorModule,
614
+ FsContentEditorModule,
615
+ ]] });
616
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsContentLayoutsModule, decorators: [{
617
+ type: NgModule,
618
+ args: [{
619
+ imports: [
620
+ CommonModule,
621
+ FormsModule,
622
+ MatDialogModule,
623
+ MatInputModule,
624
+ MatFormFieldModule,
625
+ MatButtonModule,
626
+ MatTabsModule,
627
+ MatIconModule,
628
+ MatSelectModule,
629
+ MatButtonToggleModule,
630
+ FsListModule,
631
+ FsDateModule,
632
+ FsFormModule,
633
+ FsLabelModule,
634
+ FsSkeletonModule,
635
+ FsHtmlEditorModule,
636
+ FsDialogModule,
637
+ FsTextEditorModule,
638
+ FsContentEditorModule,
639
+ ],
640
+ exports: [
641
+ FsContentLayoutsComponent,
642
+ ],
643
+ declarations: [
644
+ ContentLayoutComponent,
645
+ FsContentLayoutsComponent,
646
+ ContentLayoutEditorComponent,
647
+ ],
648
+ }]
639
649
  }] });
640
650
 
641
- const PageTypes = [
642
- { name: 'Standard Page', value: PageType.StandardPage },
643
- { name: 'Home Page', value: PageType.HomePage },
644
- { name: 'Not Found Page', value: PageType.NotFoundPage },
645
- { name: 'Blog Post', value: PageType.BlogPost },
651
+ const PageTypes = [
652
+ { name: 'Standard Page', value: PageType.StandardPage },
653
+ { name: 'Home Page', value: PageType.HomePage },
654
+ { name: 'Not Found Page', value: PageType.NotFoundPage },
655
+ { name: 'Blog Post', value: PageType.BlogPost },
646
656
  ];
647
657
 
648
- class ContentPageComponent {
649
- constructor(_config, _data, _dialogRef, _message, _cdRef) {
650
- this._config = _config;
651
- this._data = _data;
652
- this._dialogRef = _dialogRef;
653
- this._message = _message;
654
- this._cdRef = _cdRef;
655
- this.contentPage = null;
656
- this.PageTypes = PageTypes;
657
- this.editors = { content: true, styles: true };
658
- this._destroy$ = new Subject();
659
- this.save = () => {
660
- return this._config.saveContentPage(this.contentPage)
661
- .pipe(tap((contentPage) => {
662
- this._message.success('Saved Changes');
663
- this._dialogRef.close(contentPage);
664
- }));
665
- };
666
- }
667
- ngOnInit() {
668
- this._dialogRef.updateSize('600px');
669
- this._fetchData();
670
- }
671
- ngOnDestroy() {
672
- this._destroy$.next();
673
- this._destroy$.complete();
674
- }
675
- _fetchData() {
676
- this._config.loadContentLayouts()
677
- .subscribe((contentLayouts) => {
678
- this.contentLayouts = contentLayouts;
679
- this._cdRef.markForCheck();
680
- });
681
- of(this._data.contentPage)
682
- .pipe(switchMap((contentPage) => {
683
- return of(contentPage);
684
- }), takeUntil(this._destroy$))
685
- .subscribe((contentPage) => {
686
- this.contentPage = Object.assign({}, contentPage);
687
- this._cdRef.markForCheck();
688
- });
689
- }
690
- }
691
- ContentPageComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ContentPageComponent, deps: [{ token: FS_CONTENT_CONFIG }, { token: MAT_DIALOG_DATA }, { token: i1.MatDialogRef }, { token: i2.FsMessage }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
692
- ContentPageComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: ContentPageComponent, selector: "ng-component", viewQueries: [{ propertyName: "textEditors", predicate: FsTextEditorComponent, descendants: true }], ngImport: i0, template: "<form fsForm [submit]=\"save\" *fsSkeletonForm=\"contentPage\">\n <fs-dialog>\n <h1 mat-dialog-title>{{contentPage.id ? 'Page' : 'Create Page'}}</h1>\n <div mat-dialog-content>\n <div class=\"fs-column\">\n <mat-form-field>\n <mat-select\n [(ngModel)]=\"contentPage.type\"\n name=\"type\"\n required\n placeholder=\"Type\">\n <mat-option\n *ngFor=\"let item of PageTypes\"\n [value]=\"item.value\">\n {{ item.name }}\n </mat-option>\n </mat-select>\n </mat-form-field>\n <mat-form-field *ngIf=\"contentLayouts\">\n <mat-select\n [(ngModel)]=\"contentPage.contentLayoutId\"\n required\n name=\"contentLayoutId\"\n placeholder=\"Layout\">\n <mat-option\n *ngFor=\"let item of contentLayouts\"\n [value]=\"item.id\">\n {{ item.name }}\n </mat-option>\n </mat-select>\n </mat-form-field>\n <mat-form-field>\n <input\n matInput\n [(ngModel)]=\"contentPage.name\"\n name=\"name\"\n required\n placeholder=\"Name\">\n </mat-form-field>\n <mat-form-field>\n <input\n matInput\n [(ngModel)]=\"contentPage.path\"\n name=\"path\"\n required\n placeholder=\"Path\">\n </mat-form-field>\n <mat-form-field>\n <input\n matInput\n [(ngModel)]=\"contentPage.title\"\n name=\"title\"\n placeholder=\"Title\">\n </mat-form-field>\n </div>\n </div>\n\n <div mat-dialog-actions>\n <fs-form-dialog-actions>\n </fs-form-dialog-actions>\n </div>\n </fs-dialog>\n</form>\n", styles: [""], components: [{ type: i3$1.FsDialogComponent, selector: "fs-dialog", inputs: ["mobileMode", "mobileActionPlacement", "mobileWidth", "mode"] }, { type: i4$1.MatFormField, selector: "mat-form-field", inputs: ["color", "floatLabel", "appearance", "hideRequiredMarker", "hintLabel"], exportAs: ["matFormField"] }, { type: i5$2.MatSelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex"], exportAs: ["matSelect"] }, { type: i6$1.MatOption, selector: "mat-option", exportAs: ["matOption"] }, { type: i5.FsFormDialogActionsComponent, selector: "fs-form-dialog-actions", inputs: ["save", "create", "close", "done", "closeData", "name"] }], directives: [{ type: i8.FsSkeletonFormDirective, selector: "[fsSkeletonForm]", inputs: ["fsSkeletonForm", "fsSkeletonFormLines"] }, { type: i9.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i9.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i9.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i5.FsFormDirective, selector: "[fsForm]", inputs: ["wrapperSelector", "messageSelector", "hintSelector", "labelSelector", "autocomplete", "shortcuts", "confirm", "confirmDialog", "confirmDrawer", "confirmBrowser", "confirmTabs", "dirtySubmitButton", "submit", "successDelay", "errorDelay", "tabGroup", "deactivationGuard"], outputs: ["fsForm", "invalid", "valid", "submitted", "reseted", "cleared"], exportAs: ["fsForm"] }, { type: i1.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { type: i1.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { type: i9.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { type: i9.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i9.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i5.FsFormRequiredDirective, selector: "[fsFormRequired],[ngModel][required]", inputs: ["fsFormRequired", "required", "fsFormRequiredMessage"] }, { type: i10.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i10.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i8$1.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["id", "disabled", "required", "type", "value", "readonly", "placeholder", "errorStateMatcher", "aria-describedby"], exportAs: ["matInput"] }, { type: i9.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i5.FsFormNoFsValidatorsDirective, selector: "[ngModel]:not([required]):not([fsFormRequired]):not([fsFormCompare]):not([fsFormDateRange]):not([fsFormEmail]):not([fsFormEmails]):not([fsFormFunction]):not([fsFormGreater]):not([fsFormInteger]):not([fsFormLesser]):not([fsFormMax]):not([fsFormMaxLength]):not([fsFormMin]):not([fsFormMinLength]):not([fsFormNumeric]):not([fsFormPattern]):not([fsFormPhone]):not([fsFormUrl]):not([validate])" }, { type: i1.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
693
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ContentPageComponent, decorators: [{
694
- type: Component,
695
- args: [{
696
- templateUrl: './content-page.component.html',
697
- styleUrls: ['./content-page.component.scss'],
698
- changeDetection: ChangeDetectionStrategy.OnPush,
699
- }]
700
- }], ctorParameters: function () { return [{ type: undefined, decorators: [{
701
- type: Inject,
702
- args: [FS_CONTENT_CONFIG]
703
- }] }, { type: undefined, decorators: [{
704
- type: Inject,
705
- args: [MAT_DIALOG_DATA]
706
- }] }, { type: i1.MatDialogRef }, { type: i2.FsMessage }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { textEditors: [{
707
- type: ViewChildren,
708
- args: [FsTextEditorComponent]
658
+ class ContentPageComponent {
659
+ constructor(_config, _data, _dialogRef, _message, _cdRef) {
660
+ this._config = _config;
661
+ this._data = _data;
662
+ this._dialogRef = _dialogRef;
663
+ this._message = _message;
664
+ this._cdRef = _cdRef;
665
+ this.contentPage = null;
666
+ this.PageTypes = PageTypes;
667
+ this.editors = { content: true, styles: true };
668
+ this._destroy$ = new Subject();
669
+ this.save = () => {
670
+ return this._config.saveContentPage(this.contentPage)
671
+ .pipe(tap((contentPage) => {
672
+ this._message.success('Saved Changes');
673
+ this._dialogRef.close(contentPage);
674
+ }));
675
+ };
676
+ }
677
+ ngOnInit() {
678
+ this._dialogRef.updateSize('600px');
679
+ this._fetchData();
680
+ }
681
+ ngOnDestroy() {
682
+ this._destroy$.next();
683
+ this._destroy$.complete();
684
+ }
685
+ _fetchData() {
686
+ this._config.loadContentLayouts()
687
+ .subscribe((contentLayouts) => {
688
+ this.contentLayouts = contentLayouts;
689
+ this._cdRef.markForCheck();
690
+ });
691
+ of(this._data.contentPage)
692
+ .pipe(switchMap((contentPage) => {
693
+ return of(contentPage);
694
+ }), takeUntil(this._destroy$))
695
+ .subscribe((contentPage) => {
696
+ this.contentPage = Object.assign({}, contentPage);
697
+ this._cdRef.markForCheck();
698
+ });
699
+ }
700
+ }
701
+ ContentPageComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ContentPageComponent, deps: [{ token: FS_CONTENT_CONFIG }, { token: MAT_DIALOG_DATA }, { token: i1.MatDialogRef }, { token: i2.FsMessage }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
702
+ ContentPageComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: ContentPageComponent, selector: "ng-component", viewQueries: [{ propertyName: "textEditors", predicate: FsTextEditorComponent, descendants: true }], ngImport: i0, template: "<form fsForm [submit]=\"save\" *fsSkeletonForm=\"contentPage\">\n <fs-dialog>\n <h1 mat-dialog-title>{{contentPage.id ? 'Page' : 'Create Page'}}</h1>\n <div mat-dialog-content>\n <div class=\"fs-column\">\n <mat-form-field>\n <mat-label>Type</mat-label>\n <mat-select\n [(ngModel)]=\"contentPage.type\"\n name=\"type\"\n required>\n <mat-option\n *ngFor=\"let item of PageTypes\"\n [value]=\"item.value\">\n {{ item.name }}\n </mat-option>\n </mat-select>\n </mat-form-field>\n <mat-form-field *ngIf=\"contentLayouts\">\n <mat-label>Layout</mat-label>\n <mat-select\n [(ngModel)]=\"contentPage.contentLayoutId\"\n required\n name=\"contentLayoutId\">\n <mat-option\n *ngFor=\"let item of contentLayouts\"\n [value]=\"item.id\">\n {{ item.name }}\n </mat-option>\n </mat-select>\n </mat-form-field>\n <mat-form-field>\n <mat-label>Name</mat-label>\n <input\n matInput\n [(ngModel)]=\"contentPage.name\"\n name=\"name\"\n required>\n </mat-form-field>\n <mat-form-field>\n <mat-label>Path</mat-label>\n <input\n matInput\n [(ngModel)]=\"contentPage.path\"\n name=\"path\"\n required>\n </mat-form-field>\n <mat-form-field>\n <mat-label>Title</mat-label>\n <input\n matInput\n [(ngModel)]=\"contentPage.title\"\n name=\"title\">\n </mat-form-field>\n </div>\n </div>\n\n <div mat-dialog-actions>\n <fs-form-dialog-actions>\n </fs-form-dialog-actions>\n </div>\n </fs-dialog>\n</form>\n", styles: [""], components: [{ type: i3$1.FsDialogComponent, selector: "fs-dialog", inputs: ["mobileMode", "mobileActionPlacement", "mobileWidth", "mode"] }, { type: i4$1.MatFormField, selector: "mat-form-field", inputs: ["color", "floatLabel", "appearance", "hideRequiredMarker", "hintLabel"], exportAs: ["matFormField"] }, { type: i5$2.MatSelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex"], exportAs: ["matSelect"] }, { type: i6$1.MatOption, selector: "mat-option", exportAs: ["matOption"] }, { type: i5.FsFormDialogActionsComponent, selector: "fs-form-dialog-actions", inputs: ["save", "create", "close", "done", "closeData", "name"] }], directives: [{ type: i8.FsSkeletonFormDirective, selector: "[fsSkeletonForm]", inputs: ["fsSkeletonForm", "fsSkeletonFormLines"] }, { type: i9.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i9.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i9.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i5.FsFormDirective, selector: "[fsForm]", inputs: ["wrapperSelector", "messageSelector", "hintSelector", "labelSelector", "autocomplete", "shortcuts", "confirm", "confirmDialog", "confirmDrawer", "confirmBrowser", "confirmTabs", "dirtySubmitButton", "submit", "successDelay", "errorDelay", "tabGroup", "deactivationGuard"], outputs: ["fsForm", "invalid", "valid", "submitted", "reseted", "cleared"], exportAs: ["fsForm"] }, { type: i1.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { type: i1.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { type: i4$1.MatLabel, selector: "mat-label" }, { type: i9.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { type: i9.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i9.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i5.FsFormRequiredDirective, selector: "[fsFormRequired],[ngModel][required]", inputs: ["fsFormRequired", "required", "fsFormRequiredMessage"] }, { type: i10.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i10.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i8$1.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["id", "disabled", "required", "type", "value", "readonly", "placeholder", "errorStateMatcher", "aria-describedby"], exportAs: ["matInput"] }, { type: i9.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i5.FsFormNoFsValidatorsDirective, selector: "[ngModel]:not([required]):not([fsFormRequired]):not([fsFormCompare]):not([fsFormDateRange]):not([fsFormEmail]):not([fsFormEmails]):not([fsFormFunction]):not([fsFormGreater]):not([fsFormInteger]):not([fsFormLesser]):not([fsFormMax]):not([fsFormMaxLength]):not([fsFormMin]):not([fsFormMinLength]):not([fsFormNumeric]):not([fsFormPattern]):not([fsFormPhone]):not([fsFormUrl]):not([validate])" }, { type: i1.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
703
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ContentPageComponent, decorators: [{
704
+ type: Component,
705
+ args: [{
706
+ templateUrl: './content-page.component.html',
707
+ styleUrls: ['./content-page.component.scss'],
708
+ changeDetection: ChangeDetectionStrategy.OnPush,
709
+ }]
710
+ }], ctorParameters: function () { return [{ type: undefined, decorators: [{
711
+ type: Inject,
712
+ args: [FS_CONTENT_CONFIG]
713
+ }] }, { type: undefined, decorators: [{
714
+ type: Inject,
715
+ args: [MAT_DIALOG_DATA]
716
+ }] }, { type: i1.MatDialogRef }, { type: i2.FsMessage }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { textEditors: [{
717
+ type: ViewChildren,
718
+ args: [FsTextEditorComponent]
709
719
  }] } });
710
720
 
711
- class ContentPageEditorComponent {
712
- constructor(_data, _dialogRef, _message, _dialog, _cdRef, _prompt) {
713
- this._data = _data;
714
- this._dialogRef = _dialogRef;
715
- this._message = _message;
716
- this._dialog = _dialog;
717
- this._cdRef = _cdRef;
718
- this._prompt = _prompt;
719
- this.focused = null;
720
- this.resizing = false;
721
- this.editors = {
722
- [EditorType.Html]: true,
723
- [EditorType.Scss]: true,
724
- [EditorType.Js]: false,
725
- [EditorType.GlobalScss]: false,
726
- };
727
- this._destroy$ = new Subject();
728
- this.save = () => {
729
- return of(null)
730
- .pipe(filter(() => this.focused), switchMap(() => {
731
- switch (this.focused) {
732
- case EditorType.Js:
733
- case EditorType.Html:
734
- case EditorType.Scss:
735
- return this.saveContentPage();
736
- case EditorType.GlobalScss:
737
- return this.editor.saveGlobalScss();
738
- }
739
- return throwError('Invalid focus');
740
- }), tap(() => {
741
- this.editor.clearChange(this.focused);
742
- this._cdRef.markForCheck();
743
- }));
744
- };
745
- }
746
- ngOnInit() {
747
- this._dialogRef.addPanelClass('fs-content-editor-overlay-pane');
748
- this._dialogRef.disableClose = true;
749
- this.config = this._data.contentConfig;
750
- this._initContentPage(this._data.contentPage);
751
- }
752
- editorToggleChange(event) {
753
- this.editors[event.value] = !this.editors[event.value];
754
- }
755
- ngOnDestroy() {
756
- this._destroy$.next();
757
- this._destroy$.complete();
758
- }
759
- _initContentPage(contentPage) {
760
- this.config.loadContentPage(contentPage.id)
761
- .subscribe((data) => {
762
- this.contentPage = data;
763
- this._cdRef.markForCheck();
764
- });
765
- }
766
- editorFocused(type) {
767
- this.focused = type;
768
- }
769
- saveContentPage() {
770
- const names = {
771
- [EditorType.Js]: 'js',
772
- [EditorType.Scss]: 'styles',
773
- [EditorType.Html]: 'content',
774
- };
775
- const data = {
776
- id: this.contentPage.id,
777
- [names[this.focused]]: this.editor.changes[this.focused],
778
- };
779
- return this.config.saveContentPage(Object.assign({ id: this.contentPage.id }, data))
780
- .pipe(tap(() => {
781
- this._message.success('Saved Changes');
782
- }));
783
- }
784
- cancel() {
785
- if (!this.editor.hasChanges) {
786
- return this._dialogRef.close();
787
- }
788
- this._prompt.confirm({
789
- dialogConfig: {
790
- width: null,
791
- },
792
- title: 'You have unsaved changes',
793
- template: 'What would you like to do with your changes?',
794
- buttons: [
795
- {
796
- label: 'Review Changes',
797
- value: 'review',
798
- },
799
- {
800
- label: 'Discard Changes',
801
- value: 'discard',
802
- },
803
- ],
804
- })
805
- .pipe(takeUntil(this._destroy$))
806
- .subscribe((value) => {
807
- if (value === 'discard') {
808
- this._dialogRef.close();
809
- }
810
- });
811
- }
812
- openSettings() {
813
- this._dialog.open(ContentPageComponent, {
814
- data: {
815
- contentPage: this.contentPage,
816
- },
817
- })
818
- .afterClosed()
819
- .pipe(takeUntil(this._destroy$))
820
- .subscribe((contentPage) => {
821
- this.contentPage = Object.assign(Object.assign({}, this.contentPage), contentPage);
822
- this._cdRef.markForCheck();
823
- });
824
- }
825
- }
826
- ContentPageEditorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ContentPageEditorComponent, deps: [{ token: MAT_DIALOG_DATA }, { token: i1.MatDialogRef }, { token: i2.FsMessage }, { token: i1.MatDialog }, { token: i0.ChangeDetectorRef }, { token: i3$2.FsPrompt }], target: i0.ɵɵFactoryTarget.Component });
827
- ContentPageEditorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: ContentPageEditorComponent, selector: "ng-component", viewQueries: [{ propertyName: "editor", first: true, predicate: EditorComponent, descendants: true }], ngImport: i0, template: "<form fsForm [submit]=\"save\" [dirtySubmitButton]=\"false\" [confirm]=\"false\">\n <fs-dialog *fsSkeletonForm=\"contentPage\">\n <h1 mat-dialog-title>\n <div class=\"title-container\">\n <div class=\"title\">\n Page Editor\n <div class=\"small\">{{contentPage.name}}</div> \n </div>\n <a\n (click)=\"openSettings()\"\n mat-icon-button>\n <mat-icon>settings</mat-icon>\n </a> \n </div>\n </h1>\n <div mat-dialog-content>\n <app-editor\n [contentConfig]=\"config\"\n [showHtml]=\"editors.html\"\n [showJs]=\"editors.js\"\n [showScss]=\"editors.scss\"\n [showGlobalScss]=\"editors.globalScss\"\n [html]=\"contentPage.content\"\n [scss]=\"contentPage.styles\"\n [js]=\"contentPage.js\"\n (focused)=\"editorFocused($event)\">\n </app-editor>\n </div>\n\n <div mat-dialog-actions>\n <button \n mat-button\n color=\"primary\"\n (click)=\"cancel()\"\n type=\"button\"> \n Done \n </button>\n \n <div class=\"toggles\">\n <mat-button-toggle-group multiple>\n <mat-button-toggle value=\"html\" [checked]=\"editors.html\" (change)=\"editorToggleChange($event)\">HTML</mat-button-toggle>\n <mat-button-toggle value=\"scss\" [checked]=\"editors.scss\" (change)=\"editorToggleChange($event)\">SCSS</mat-button-toggle>\n <mat-button-toggle value=\"js\" [checked]=\"editors.js\" (change)=\"editorToggleChange($event)\">JS</mat-button-toggle>\n <mat-button-toggle value=\"globalScss\" [checked]=\"editors.globalScss\" (change)=\"editorToggleChange($event)\">Global SCSS</mat-button-toggle>\n </mat-button-toggle-group> \n </div>\n </div>\n</fs-dialog>\n</form>", styles: ["::ng-deep .fs-content-editor-overlay-pane .mat-dialog-container{border-radius:0}form{height:100%}fs-dialog{display:flex;height:100%;flex-direction:column}fs-dialog ::ng-deep .mat-dialog-content{max-height:none;flex:1;overflow:hidden}.mat-dialog-actions fs-form-dialog-actions{width:auto}.mat-dialog-actions .toggles{display:flex;justify-content:flex-end;justify-self:baseline;flex:1}.title-container{display:flex;align-items:center}.title-container .title{flex:1}.title-container .title .small{line-height:normal}\n"], components: [{ type: i3$1.FsDialogComponent, selector: "fs-dialog", inputs: ["mobileMode", "mobileActionPlacement", "mobileWidth", "mode"] }, { type: i5$1.MatAnchor, selector: "a[mat-button], a[mat-raised-button], a[mat-icon-button], a[mat-fab], a[mat-mini-fab], a[mat-stroked-button], a[mat-flat-button]", inputs: ["disabled", "disableRipple", "color", "tabIndex"], exportAs: ["matButton", "matAnchor"] }, { type: i6.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { type: EditorComponent, selector: "app-editor", inputs: ["showHtml", "showScss", "showJs", "showGlobalScss", "html", "scss", "js", "contentConfig"], outputs: ["changed", "focused", "blured"] }, { type: i5$1.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { type: i8$2.MatButtonToggle, selector: "mat-button-toggle", inputs: ["disableRipple", "aria-labelledby", "tabIndex", "appearance", "checked", "disabled", "id", "name", "aria-label", "value"], outputs: ["change"], exportAs: ["matButtonToggle"] }], directives: [{ type: i9.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i9.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i9.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i5.FsFormDirective, selector: "[fsForm]", inputs: ["wrapperSelector", "messageSelector", "hintSelector", "labelSelector", "autocomplete", "shortcuts", "confirm", "confirmDialog", "confirmDrawer", "confirmBrowser", "confirmTabs", "dirtySubmitButton", "submit", "successDelay", "errorDelay", "tabGroup", "deactivationGuard"], outputs: ["fsForm", "invalid", "valid", "submitted", "reseted", "cleared"], exportAs: ["fsForm"] }, { type: i8.FsSkeletonFormDirective, selector: "[fsSkeletonForm]", inputs: ["fsSkeletonForm", "fsSkeletonFormLines"] }, { type: i1.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { type: i1.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { type: i1.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]" }, { type: i5.FsButtonDirective, selector: "[mat-raised-button],[mat-button],[mat-flat-button],[mat-stroked-button]", inputs: ["name", "dirtySubmit", "form"] }, { type: i8$2.MatButtonToggleGroup, selector: "mat-button-toggle-group", inputs: ["appearance", "name", "vertical", "value", "multiple", "disabled"], outputs: ["valueChange", "change"], exportAs: ["matButtonToggleGroup"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
828
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ContentPageEditorComponent, decorators: [{
829
- type: Component,
830
- args: [{
831
- templateUrl: './content-page-editor.component.html',
832
- styleUrls: ['./content-page-editor.component.scss'],
833
- changeDetection: ChangeDetectionStrategy.OnPush,
834
- }]
835
- }], ctorParameters: function () { return [{ type: undefined, decorators: [{
836
- type: Inject,
837
- args: [MAT_DIALOG_DATA]
838
- }] }, { type: i1.MatDialogRef }, { type: i2.FsMessage }, { type: i1.MatDialog }, { type: i0.ChangeDetectorRef }, { type: i3$2.FsPrompt }]; }, propDecorators: { editor: [{
839
- type: ViewChild,
840
- args: [EditorComponent]
721
+ class ContentPageEditorComponent {
722
+ constructor(_data, _dialogRef, _message, _dialog, _cdRef, _prompt) {
723
+ this._data = _data;
724
+ this._dialogRef = _dialogRef;
725
+ this._message = _message;
726
+ this._dialog = _dialog;
727
+ this._cdRef = _cdRef;
728
+ this._prompt = _prompt;
729
+ this.focused = null;
730
+ this.resizing = false;
731
+ this.editors = {
732
+ [EditorType.Html]: true,
733
+ [EditorType.Scss]: true,
734
+ [EditorType.Js]: false,
735
+ [EditorType.GlobalScss]: false,
736
+ };
737
+ this._destroy$ = new Subject();
738
+ this.save = () => {
739
+ return of(null)
740
+ .pipe(filter(() => this.focused), switchMap(() => {
741
+ switch (this.focused) {
742
+ case EditorType.Js:
743
+ case EditorType.Html:
744
+ case EditorType.Scss:
745
+ return this.saveContentPage();
746
+ case EditorType.GlobalScss:
747
+ return this.editor.saveGlobalScss();
748
+ }
749
+ return throwError('Invalid focus');
750
+ }), tap(() => {
751
+ this.editor.clearChange(this.focused);
752
+ this._cdRef.markForCheck();
753
+ }));
754
+ };
755
+ }
756
+ ngOnInit() {
757
+ this._dialogRef.addPanelClass('fs-content-editor-overlay-pane');
758
+ this._dialogRef.disableClose = true;
759
+ this.config = this._data.contentConfig;
760
+ this._initContentPage(this._data.contentPage);
761
+ this._initEscape();
762
+ }
763
+ editorToggleChange(event) {
764
+ this.editors[event.value] = !this.editors[event.value];
765
+ }
766
+ ngOnDestroy() {
767
+ this._destroy$.next();
768
+ this._destroy$.complete();
769
+ }
770
+ _initContentPage(contentPage) {
771
+ this.config.loadContentPage(contentPage.id)
772
+ .subscribe((data) => {
773
+ this.contentPage = data;
774
+ this._cdRef.markForCheck();
775
+ });
776
+ }
777
+ editorFocused(type) {
778
+ this.focused = type;
779
+ }
780
+ saveContentPage() {
781
+ const names = {
782
+ [EditorType.Js]: 'js',
783
+ [EditorType.Scss]: 'styles',
784
+ [EditorType.Html]: 'content',
785
+ };
786
+ const data = {
787
+ id: this.contentPage.id,
788
+ [names[this.focused]]: this.editor.changes[this.focused],
789
+ };
790
+ return this.config.saveContentPage(Object.assign({ id: this.contentPage.id }, data))
791
+ .pipe(tap(() => {
792
+ this._message.success('Saved Changes');
793
+ }));
794
+ }
795
+ close() {
796
+ if (!this.editor.hasChanges) {
797
+ return this._dialogRef.close();
798
+ }
799
+ this._prompt.confirm({
800
+ dialogConfig: {
801
+ width: null,
802
+ },
803
+ title: 'You have unsaved changes',
804
+ template: 'What would you like to do with your changes?',
805
+ buttons: [
806
+ {
807
+ label: 'Review Changes',
808
+ value: 'review',
809
+ },
810
+ {
811
+ label: 'Discard Changes',
812
+ value: 'discard',
813
+ },
814
+ ],
815
+ })
816
+ .pipe(takeUntil(this._destroy$))
817
+ .subscribe((value) => {
818
+ if (value === 'discard') {
819
+ this._dialogRef.close();
820
+ }
821
+ });
822
+ }
823
+ openSettings() {
824
+ this._dialog.open(ContentPageComponent, {
825
+ data: {
826
+ contentPage: this.contentPage,
827
+ },
828
+ })
829
+ .afterClosed()
830
+ .pipe(takeUntil(this._destroy$))
831
+ .subscribe((contentPage) => {
832
+ this.contentPage = Object.assign(Object.assign({}, this.contentPage), contentPage);
833
+ this._cdRef.markForCheck();
834
+ });
835
+ }
836
+ _initEscape() {
837
+ fromEvent(document, 'keydown')
838
+ .pipe(filter((event) => event.code === 'Escape'), takeUntil(this._destroy$)).subscribe(() => {
839
+ const dialogRef = this._dialog.openDialogs.reverse()[0];
840
+ if ((dialogRef === null || dialogRef === void 0 ? void 0 : dialogRef.componentInstance) === this) {
841
+ this.close();
842
+ }
843
+ });
844
+ }
845
+ }
846
+ ContentPageEditorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ContentPageEditorComponent, deps: [{ token: MAT_DIALOG_DATA }, { token: i1.MatDialogRef }, { token: i2.FsMessage }, { token: i1.MatDialog }, { token: i0.ChangeDetectorRef }, { token: i3$2.FsPrompt }], target: i0.ɵɵFactoryTarget.Component });
847
+ ContentPageEditorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: ContentPageEditorComponent, selector: "ng-component", viewQueries: [{ propertyName: "editor", first: true, predicate: EditorComponent, descendants: true }], ngImport: i0, template: "<form fsForm [submit]=\"save\" [dirtySubmitButton]=\"false\" [confirm]=\"false\">\n <fs-dialog *fsSkeletonForm=\"contentPage\">\n <h1 mat-dialog-title>\n <div class=\"title-container\">\n <div class=\"title\">\n Page Editor\n <div class=\"small\">{{contentPage.name}}</div> \n </div>\n <a\n (click)=\"openSettings()\"\n mat-icon-button>\n <mat-icon>settings</mat-icon>\n </a> \n </div>\n </h1>\n <div mat-dialog-content>\n <app-editor\n [contentConfig]=\"config\"\n [showHtml]=\"editors.html\"\n [showJs]=\"editors.js\"\n [showScss]=\"editors.scss\"\n [showGlobalScss]=\"editors.globalScss\"\n [html]=\"contentPage.content\"\n [scss]=\"contentPage.styles\"\n [js]=\"contentPage.js\"\n (focused)=\"editorFocused($event)\">\n </app-editor>\n </div>\n\n <div mat-dialog-actions>\n <button \n mat-button\n color=\"primary\"\n (click)=\"close()\"\n type=\"button\"> \n Done \n </button>\n \n <div class=\"toggles\">\n <mat-button-toggle-group multiple>\n <mat-button-toggle value=\"html\" [checked]=\"editors.html\" (change)=\"editorToggleChange($event)\">HTML</mat-button-toggle>\n <mat-button-toggle value=\"scss\" [checked]=\"editors.scss\" (change)=\"editorToggleChange($event)\">SCSS</mat-button-toggle>\n <mat-button-toggle value=\"js\" [checked]=\"editors.js\" (change)=\"editorToggleChange($event)\">JS</mat-button-toggle>\n <mat-button-toggle value=\"globalScss\" [checked]=\"editors.globalScss\" (change)=\"editorToggleChange($event)\">Global SCSS</mat-button-toggle>\n </mat-button-toggle-group> \n </div>\n </div>\n</fs-dialog>\n</form>", styles: ["::ng-deep .fs-content-editor-overlay-pane .mat-dialog-container{border-radius:0}form{height:100%}fs-dialog{display:flex;height:100%;flex-direction:column}fs-dialog ::ng-deep .mat-dialog-content{max-height:none;flex:1;overflow:hidden}.mat-dialog-actions fs-form-dialog-actions{width:auto}.mat-dialog-actions .toggles{display:flex;justify-content:flex-end;justify-self:baseline;flex:1}.title-container{display:flex;align-items:center}.title-container .title{flex:1}.title-container .title .small{line-height:normal}\n"], components: [{ type: i3$1.FsDialogComponent, selector: "fs-dialog", inputs: ["mobileMode", "mobileActionPlacement", "mobileWidth", "mode"] }, { type: i5$1.MatAnchor, selector: "a[mat-button], a[mat-raised-button], a[mat-icon-button], a[mat-fab], a[mat-mini-fab], a[mat-stroked-button], a[mat-flat-button]", inputs: ["disabled", "disableRipple", "color", "tabIndex"], exportAs: ["matButton", "matAnchor"] }, { type: i6.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { type: EditorComponent, selector: "app-editor", inputs: ["showHtml", "showScss", "showJs", "showGlobalScss", "html", "scss", "js", "contentConfig"], outputs: ["changed", "focused", "blured"] }, { type: i5$1.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { type: i8$2.MatButtonToggle, selector: "mat-button-toggle", inputs: ["disableRipple", "aria-labelledby", "tabIndex", "appearance", "checked", "disabled", "id", "name", "aria-label", "value"], outputs: ["change"], exportAs: ["matButtonToggle"] }], directives: [{ type: i9.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i9.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i9.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i5.FsFormDirective, selector: "[fsForm]", inputs: ["wrapperSelector", "messageSelector", "hintSelector", "labelSelector", "autocomplete", "shortcuts", "confirm", "confirmDialog", "confirmDrawer", "confirmBrowser", "confirmTabs", "dirtySubmitButton", "submit", "successDelay", "errorDelay", "tabGroup", "deactivationGuard"], outputs: ["fsForm", "invalid", "valid", "submitted", "reseted", "cleared"], exportAs: ["fsForm"] }, { type: i8.FsSkeletonFormDirective, selector: "[fsSkeletonForm]", inputs: ["fsSkeletonForm", "fsSkeletonFormLines"] }, { type: i1.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { type: i1.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { type: i1.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]" }, { type: i5.FsButtonDirective, selector: "[mat-raised-button],[mat-button],[mat-flat-button],[mat-stroked-button]", inputs: ["name", "dirtySubmit", "form"] }, { type: i8$2.MatButtonToggleGroup, selector: "mat-button-toggle-group", inputs: ["appearance", "name", "vertical", "value", "multiple", "disabled"], outputs: ["valueChange", "change"], exportAs: ["matButtonToggleGroup"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
848
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ContentPageEditorComponent, decorators: [{
849
+ type: Component,
850
+ args: [{
851
+ templateUrl: './content-page-editor.component.html',
852
+ styleUrls: ['./content-page-editor.component.scss'],
853
+ changeDetection: ChangeDetectionStrategy.OnPush,
854
+ }]
855
+ }], ctorParameters: function () { return [{ type: undefined, decorators: [{
856
+ type: Inject,
857
+ args: [MAT_DIALOG_DATA]
858
+ }] }, { type: i1.MatDialogRef }, { type: i2.FsMessage }, { type: i1.MatDialog }, { type: i0.ChangeDetectorRef }, { type: i3$2.FsPrompt }]; }, propDecorators: { editor: [{
859
+ type: ViewChild,
860
+ args: [EditorComponent]
841
861
  }] } });
842
862
 
843
- class FsContentPagesComponent {
844
- constructor(_config, _dialog) {
845
- this._config = _config;
846
- this._dialog = _dialog;
847
- this.pageTypes = index(PageTypes, 'value', 'name');
848
- this._destroy$ = new Subject();
849
- }
850
- ngOnInit() {
851
- this._initListConfig();
852
- }
853
- openEditor(contentPage) {
854
- this._dialog.open(ContentPageEditorComponent, {
855
- data: {
856
- contentPage,
857
- config: this._config,
858
- contentConfig: this._config,
859
- },
860
- maxWidth: '100vw',
861
- width: '100%',
862
- height: '100%',
863
- autoFocus: false,
864
- })
865
- .afterClosed()
866
- .pipe(takeUntil(this._destroy$))
867
- .subscribe(() => {
868
- this.listComponent.reload();
869
- });
870
- }
871
- ngOnDestroy() {
872
- this._destroy$.next();
873
- this._destroy$.complete();
874
- }
875
- openContentPage(contentPage) {
876
- return this._dialog.open(ContentPageComponent, {
877
- data: { contentPage },
878
- })
879
- .afterClosed()
880
- .pipe(takeUntil(this._destroy$));
881
- }
882
- _initListConfig() {
883
- this.listConfig = {
884
- filters: [
885
- {
886
- name: 'keyword',
887
- type: ItemType.Keyword,
888
- label: 'Search',
889
- },
890
- ],
891
- actions: [
892
- {
893
- label: 'Create',
894
- click: () => {
895
- this.openContentPage({
896
- type: PageType.StandardPage,
897
- })
898
- .pipe(filter((contentPage) => !!contentPage))
899
- .subscribe((contentPage) => {
900
- this.openEditor(contentPage);
901
- this.listComponent.reload();
902
- });
903
- },
904
- },
905
- ],
906
- rowActions: [
907
- {
908
- click: (data) => {
909
- return this._config.deleteContentPage(data);
910
- },
911
- remove: {
912
- title: 'Confirm',
913
- template: 'Are you sure you would like to delete this record?',
914
- },
915
- menu: true,
916
- label: 'Delete',
917
- },
918
- ],
919
- fetch: (query) => {
920
- return this._config.loadContentPages(query)
921
- .pipe(map((response) => {
922
- return { data: response.contentPages, paging: response.paging };
923
- }));
924
- },
925
- restore: {
926
- query: { state: 'deleted' },
927
- filterLabel: 'Show Deleted',
928
- menuLabel: 'Restore',
929
- reload: true,
930
- click: (row) => {
931
- return this._config.saveContentPage({ id: row.id, state: 'active' });
932
- },
933
- },
934
- };
935
- }
936
- }
937
- FsContentPagesComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsContentPagesComponent, deps: [{ token: FS_CONTENT_CONFIG }, { token: i1.MatDialog }], target: i0.ɵɵFactoryTarget.Component });
938
- FsContentPagesComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FsContentPagesComponent, selector: "fs-content-pages", inputs: { htmlEditorConfig: "htmlEditorConfig" }, viewQueries: [{ propertyName: "listComponent", first: true, predicate: FsListComponent, descendants: true }], ngImport: i0, template: "<fs-list [config]=\"listConfig\">\n <fs-list-column name=\"name\" title=\"Name\" [sortable]=\"true\">\n <ng-template fs-list-cell let-row=\"row\">\n <a (click)=\"openEditor(row)\">{{row.name}}</a>\n </ng-template>\n </fs-list-column>\n <fs-list-column name=\"path\" title=\"Path\" [sortable]=\"true\">\n <ng-template fs-list-cell let-row=\"row\">\n <a [href]=\"'/' + row.path\" target=\"_black\">/{{row.path}}</a>\n </ng-template>\n </fs-list-column>\n <fs-list-column name=\"type\" title=\"Type\" [sortable]=\"true\">\n <ng-template fs-list-cell let-row=\"row\">\n {{pageTypes[row.type]}}\n </ng-template>\n </fs-list-column>\n <fs-list-column name=\"modify_date\" title=\"Modified\" [sortable]=\"true\">\n <ng-template fs-list-cell let-row=\"row\">\n {{row.modifyDate | fsDate: 'date-time-yearless'}}\n </ng-template>\n </fs-list-column>\n</fs-list>\n", styles: [":host ::ng-deep .modified,:host ::ng-deep .name{width:1%;white-space:nowrap}:host ::ng-deep .preview-content img{display:none}.preview-content{position:relative;max-height:100px;max-width:100%;overflow:hidden;-webkit-mask-image:-webkit-gradient(linear,left 60%,left bottom,from(black),to(rgba(0,0,0,0)))}\n"], components: [{ type: i2$2.FsListComponent, selector: "fs-list", inputs: ["config", "loaderLines"], outputs: ["filtersReady"] }], directives: [{ type: i2$2.FsListColumnDirective, selector: "fs-list-column", inputs: ["show", "title", "name", "customize", "sortable", "sortableDefault", "direction", "align", "width", "class"] }, { type: i2$2.FsListCellDirective, selector: "[fs-list-cell]", inputs: ["colspan", "align", "class"] }], pipes: { "fsDate": i3$3.FsDatePipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
939
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsContentPagesComponent, decorators: [{
940
- type: Component,
941
- args: [{
942
- selector: 'fs-content-pages',
943
- templateUrl: './content-pages.component.html',
944
- styleUrls: ['./content-pages.component.scss'],
945
- changeDetection: ChangeDetectionStrategy.OnPush,
946
- }]
947
- }], ctorParameters: function () { return [{ type: undefined, decorators: [{
948
- type: Inject,
949
- args: [FS_CONTENT_CONFIG]
950
- }] }, { type: i1.MatDialog }]; }, propDecorators: { htmlEditorConfig: [{
951
- type: Input
952
- }], listComponent: [{
953
- type: ViewChild,
954
- args: [FsListComponent]
863
+ class FsContentPagesComponent {
864
+ constructor(_config, _dialog) {
865
+ this._config = _config;
866
+ this._dialog = _dialog;
867
+ this.pageTypes = index(PageTypes, 'value', 'name');
868
+ this._destroy$ = new Subject();
869
+ }
870
+ ngOnInit() {
871
+ this._initListConfig();
872
+ }
873
+ openEditor(contentPage) {
874
+ this._dialog.open(ContentPageEditorComponent, {
875
+ data: {
876
+ contentPage,
877
+ config: this._config,
878
+ contentConfig: this._config,
879
+ },
880
+ maxWidth: '100vw',
881
+ width: '100%',
882
+ height: '100%',
883
+ autoFocus: false,
884
+ })
885
+ .afterClosed()
886
+ .pipe(takeUntil(this._destroy$))
887
+ .subscribe(() => {
888
+ this.listComponent.reload();
889
+ });
890
+ }
891
+ ngOnDestroy() {
892
+ this._destroy$.next();
893
+ this._destroy$.complete();
894
+ }
895
+ openContentPage(contentPage) {
896
+ return this._dialog.open(ContentPageComponent, {
897
+ data: { contentPage },
898
+ })
899
+ .afterClosed()
900
+ .pipe(takeUntil(this._destroy$));
901
+ }
902
+ _initListConfig() {
903
+ this.listConfig = {
904
+ filters: [
905
+ {
906
+ name: 'keyword',
907
+ type: ItemType.Keyword,
908
+ label: 'Search',
909
+ },
910
+ ],
911
+ actions: [
912
+ {
913
+ label: 'Create',
914
+ click: () => {
915
+ this.openContentPage({
916
+ type: PageType.StandardPage,
917
+ })
918
+ .pipe(filter((contentPage) => !!contentPage))
919
+ .subscribe((contentPage) => {
920
+ this.openEditor(contentPage);
921
+ this.listComponent.reload();
922
+ });
923
+ },
924
+ },
925
+ ],
926
+ rowActions: [
927
+ {
928
+ click: (data) => {
929
+ return this._config.deleteContentPage(data);
930
+ },
931
+ remove: {
932
+ title: 'Confirm',
933
+ template: 'Are you sure you would like to delete this record?',
934
+ },
935
+ menu: true,
936
+ label: 'Delete',
937
+ },
938
+ ],
939
+ fetch: (query) => {
940
+ return this._config.loadContentPages(query)
941
+ .pipe(map((response) => {
942
+ return { data: response.contentPages, paging: response.paging };
943
+ }));
944
+ },
945
+ restore: {
946
+ query: { state: 'deleted' },
947
+ filterLabel: 'Show Deleted',
948
+ menuLabel: 'Restore',
949
+ reload: true,
950
+ click: (row) => {
951
+ return this._config.saveContentPage({ id: row.id, state: 'active' });
952
+ },
953
+ },
954
+ };
955
+ }
956
+ }
957
+ FsContentPagesComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsContentPagesComponent, deps: [{ token: FS_CONTENT_CONFIG }, { token: i1.MatDialog }], target: i0.ɵɵFactoryTarget.Component });
958
+ FsContentPagesComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FsContentPagesComponent, selector: "fs-content-pages", inputs: { htmlEditorConfig: "htmlEditorConfig" }, viewQueries: [{ propertyName: "listComponent", first: true, predicate: FsListComponent, descendants: true }], ngImport: i0, template: "<fs-list [config]=\"listConfig\">\n <fs-list-column name=\"name\" title=\"Name\" [sortable]=\"true\">\n <ng-template fs-list-cell let-row=\"row\">\n <a (click)=\"openEditor(row)\">{{row.name}}</a>\n </ng-template>\n </fs-list-column>\n <fs-list-column name=\"path\" title=\"Path\" [sortable]=\"true\">\n <ng-template fs-list-cell let-row=\"row\">\n <a [href]=\"'/' + row.path\" target=\"_black\">/{{row.path}}</a>\n </ng-template>\n </fs-list-column>\n <fs-list-column name=\"type\" title=\"Type\" [sortable]=\"true\">\n <ng-template fs-list-cell let-row=\"row\">\n {{pageTypes[row.type]}}\n </ng-template>\n </fs-list-column>\n <fs-list-column name=\"modify_date\" title=\"Modified\" [sortable]=\"true\">\n <ng-template fs-list-cell let-row=\"row\">\n {{row.modifyDate | fsDate: 'date-time-yearless'}}\n </ng-template>\n </fs-list-column>\n</fs-list>\n", styles: [":host ::ng-deep .modified,:host ::ng-deep .name{width:1%;white-space:nowrap}:host ::ng-deep .preview-content img{display:none}.preview-content{position:relative;max-height:100px;max-width:100%;overflow:hidden;-webkit-mask-image:-webkit-gradient(linear,left 60%,left bottom,from(black),to(rgba(0,0,0,0)))}\n"], components: [{ type: i2$2.FsListComponent, selector: "fs-list", inputs: ["config", "loaderLines"], outputs: ["filtersReady"] }], directives: [{ type: i2$2.FsListColumnDirective, selector: "fs-list-column", inputs: ["show", "title", "name", "customize", "sortable", "sortableDefault", "direction", "align", "width", "class"] }, { type: i2$2.FsListCellDirective, selector: "[fs-list-cell]", inputs: ["colspan", "align", "class"] }], pipes: { "fsDate": i3$3.FsDatePipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
959
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsContentPagesComponent, decorators: [{
960
+ type: Component,
961
+ args: [{
962
+ selector: 'fs-content-pages',
963
+ templateUrl: './content-pages.component.html',
964
+ styleUrls: ['./content-pages.component.scss'],
965
+ changeDetection: ChangeDetectionStrategy.OnPush,
966
+ }]
967
+ }], ctorParameters: function () { return [{ type: undefined, decorators: [{
968
+ type: Inject,
969
+ args: [FS_CONTENT_CONFIG]
970
+ }] }, { type: i1.MatDialog }]; }, propDecorators: { htmlEditorConfig: [{
971
+ type: Input
972
+ }], listComponent: [{
973
+ type: ViewChild,
974
+ args: [FsListComponent]
955
975
  }] } });
956
976
 
957
- class FsContentPagesModule {
958
- static forRoot() {
959
- return {
960
- ngModule: FsContentPagesModule,
961
- };
962
- }
963
- }
964
- FsContentPagesModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsContentPagesModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
965
- FsContentPagesModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsContentPagesModule, declarations: [FsContentPagesComponent,
966
- ContentPageComponent,
967
- ContentPageEditorComponent], imports: [CommonModule,
968
- FormsModule,
969
- MatDialogModule,
970
- MatInputModule,
971
- MatFormFieldModule,
972
- MatButtonModule,
973
- MatTabsModule,
974
- MatIconModule,
975
- MatSelectModule,
976
- MatButtonToggleModule,
977
- FsListModule,
978
- FsDateModule,
979
- FsCommonModule,
980
- FsFormModule,
981
- FsLabelModule,
982
- FsSkeletonModule,
983
- FsHtmlEditorModule,
984
- FsDialogModule,
985
- FsTextEditorModule,
986
- FsContentEditorModule], exports: [FsContentPagesComponent] });
987
- FsContentPagesModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsContentPagesModule, imports: [[
988
- CommonModule,
989
- FormsModule,
990
- MatDialogModule,
991
- MatInputModule,
992
- MatFormFieldModule,
993
- MatButtonModule,
994
- MatTabsModule,
995
- MatIconModule,
996
- MatSelectModule,
997
- MatButtonToggleModule,
998
- FsListModule,
999
- FsDateModule,
1000
- FsCommonModule,
1001
- FsFormModule,
1002
- FsLabelModule,
1003
- FsSkeletonModule,
1004
- FsHtmlEditorModule,
1005
- FsDialogModule,
1006
- FsTextEditorModule,
1007
- FsContentEditorModule,
1008
- ]] });
1009
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsContentPagesModule, decorators: [{
1010
- type: NgModule,
1011
- args: [{
1012
- imports: [
1013
- CommonModule,
1014
- FormsModule,
1015
- MatDialogModule,
1016
- MatInputModule,
1017
- MatFormFieldModule,
1018
- MatButtonModule,
1019
- MatTabsModule,
1020
- MatIconModule,
1021
- MatSelectModule,
1022
- MatButtonToggleModule,
1023
- FsListModule,
1024
- FsDateModule,
1025
- FsCommonModule,
1026
- FsFormModule,
1027
- FsLabelModule,
1028
- FsSkeletonModule,
1029
- FsHtmlEditorModule,
1030
- FsDialogModule,
1031
- FsTextEditorModule,
1032
- FsContentEditorModule,
1033
- ],
1034
- exports: [
1035
- FsContentPagesComponent,
1036
- ],
1037
- declarations: [
1038
- FsContentPagesComponent,
1039
- ContentPageComponent,
1040
- ContentPageEditorComponent,
1041
- ],
1042
- }]
977
+ class FsContentPagesModule {
978
+ static forRoot() {
979
+ return {
980
+ ngModule: FsContentPagesModule,
981
+ };
982
+ }
983
+ }
984
+ FsContentPagesModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsContentPagesModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
985
+ FsContentPagesModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsContentPagesModule, declarations: [FsContentPagesComponent,
986
+ ContentPageComponent,
987
+ ContentPageEditorComponent], imports: [CommonModule,
988
+ FormsModule,
989
+ MatDialogModule,
990
+ MatInputModule,
991
+ MatFormFieldModule,
992
+ MatButtonModule,
993
+ MatTabsModule,
994
+ MatIconModule,
995
+ MatSelectModule,
996
+ MatButtonToggleModule,
997
+ FsListModule,
998
+ FsDateModule,
999
+ FsCommonModule,
1000
+ FsFormModule,
1001
+ FsLabelModule,
1002
+ FsSkeletonModule,
1003
+ FsHtmlEditorModule,
1004
+ FsDialogModule,
1005
+ FsTextEditorModule,
1006
+ FsContentEditorModule], exports: [FsContentPagesComponent] });
1007
+ FsContentPagesModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsContentPagesModule, imports: [[
1008
+ CommonModule,
1009
+ FormsModule,
1010
+ MatDialogModule,
1011
+ MatInputModule,
1012
+ MatFormFieldModule,
1013
+ MatButtonModule,
1014
+ MatTabsModule,
1015
+ MatIconModule,
1016
+ MatSelectModule,
1017
+ MatButtonToggleModule,
1018
+ FsListModule,
1019
+ FsDateModule,
1020
+ FsCommonModule,
1021
+ FsFormModule,
1022
+ FsLabelModule,
1023
+ FsSkeletonModule,
1024
+ FsHtmlEditorModule,
1025
+ FsDialogModule,
1026
+ FsTextEditorModule,
1027
+ FsContentEditorModule,
1028
+ ]] });
1029
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsContentPagesModule, decorators: [{
1030
+ type: NgModule,
1031
+ args: [{
1032
+ imports: [
1033
+ CommonModule,
1034
+ FormsModule,
1035
+ MatDialogModule,
1036
+ MatInputModule,
1037
+ MatFormFieldModule,
1038
+ MatButtonModule,
1039
+ MatTabsModule,
1040
+ MatIconModule,
1041
+ MatSelectModule,
1042
+ MatButtonToggleModule,
1043
+ FsListModule,
1044
+ FsDateModule,
1045
+ FsCommonModule,
1046
+ FsFormModule,
1047
+ FsLabelModule,
1048
+ FsSkeletonModule,
1049
+ FsHtmlEditorModule,
1050
+ FsDialogModule,
1051
+ FsTextEditorModule,
1052
+ FsContentEditorModule,
1053
+ ],
1054
+ exports: [
1055
+ FsContentPagesComponent,
1056
+ ],
1057
+ declarations: [
1058
+ FsContentPagesComponent,
1059
+ ContentPageComponent,
1060
+ ContentPageEditorComponent,
1061
+ ],
1062
+ }]
1043
1063
  }] });
1044
1064
 
1045
- class ContentStyleComponent {
1046
- constructor(_config, _message, _cdRef) {
1047
- this._config = _config;
1048
- this._message = _message;
1049
- this._cdRef = _cdRef;
1050
- this.height = '100%';
1051
- this.contentStyle = null;
1052
- this.styleConfig = {
1053
- tabSize: 2,
1054
- language: 'scss',
1055
- height: '100%',
1056
- };
1057
- this._destroy$ = new Subject();
1058
- }
1059
- ngOnInit() {
1060
- this.styleConfig.height = this.height;
1061
- this._config.loadContentStyle()
1062
- .subscribe((contentStyle) => {
1063
- this.contentStyle = contentStyle;
1064
- this._cdRef.markForCheck();
1065
- });
1066
- }
1067
- ngOnDestroy() {
1068
- this._destroy$.next();
1069
- this._destroy$.complete();
1070
- }
1071
- save() {
1072
- this._config.saveContentStyle(this.contentStyle)
1073
- .pipe(tap((contentStyle) => {
1074
- this.contentStyle = Object.assign(Object.assign({}, this.contentStyle), contentStyle);
1075
- this._cdRef.markForCheck();
1076
- this._message.success('Saved Changes');
1077
- })).subscribe();
1078
- }
1079
- }
1080
- ContentStyleComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ContentStyleComponent, deps: [{ token: FS_CONTENT_CONFIG }, { token: i2.FsMessage }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
1081
- ContentStyleComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: ContentStyleComponent, selector: "fs-content-style", inputs: { height: "height" }, viewQueries: [{ propertyName: "textEditors", first: true, predicate: FsTextEditorComponent, descendants: true }, { propertyName: "form", first: true, predicate: FsFormDirective, descendants: true }], ngImport: i0, template: "<ng-container *fsSkeletonForm=\"contentStyle\">\n <fs-text-editor \n [(ngModel)]=\"contentStyle.scss\" \n name=\"contentStyle\"\n [fsModelChangeOptions]=\"{ debounce: 300 }\"\n (fsModelChange)=\"save()\"\n [config]=\"styleConfig\">\n </fs-text-editor> \n</ng-container>\n", styles: [""], components: [{ type: i4.FsTextEditorComponent, selector: "fs-text-editor", inputs: ["config", "scrollable"], outputs: ["ready", "blur"] }], directives: [{ type: i8.FsSkeletonFormDirective, selector: "[fsSkeletonForm]", inputs: ["fsSkeletonForm", "fsSkeletonFormLines"] }, { type: i9.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i9.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i7.FsModelChangeDirective, selector: "[fsModelChange]", inputs: ["fsModelChangeOptions"], outputs: ["fsModelChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1082
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ContentStyleComponent, decorators: [{
1083
- type: Component,
1084
- args: [{
1085
- selector: 'fs-content-style',
1086
- templateUrl: './content-style.component.html',
1087
- styleUrls: ['./content-style.component.scss'],
1088
- changeDetection: ChangeDetectionStrategy.OnPush,
1089
- }]
1090
- }], ctorParameters: function () { return [{ type: undefined, decorators: [{
1091
- type: Inject,
1092
- args: [FS_CONTENT_CONFIG]
1093
- }] }, { type: i2.FsMessage }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { textEditors: [{
1094
- type: ViewChild,
1095
- args: [FsTextEditorComponent]
1096
- }], form: [{
1097
- type: ViewChild,
1098
- args: [FsFormDirective]
1099
- }], height: [{
1100
- type: Input
1065
+ class ContentStyleComponent {
1066
+ constructor(_config, _message, _cdRef) {
1067
+ this._config = _config;
1068
+ this._message = _message;
1069
+ this._cdRef = _cdRef;
1070
+ this.height = '100%';
1071
+ this.contentStyle = null;
1072
+ this.styleConfig = {
1073
+ tabSize: 2,
1074
+ language: 'scss',
1075
+ height: '100%',
1076
+ };
1077
+ this._destroy$ = new Subject();
1078
+ }
1079
+ ngOnInit() {
1080
+ this.styleConfig.height = this.height;
1081
+ this._config.loadContentStyle()
1082
+ .subscribe((contentStyle) => {
1083
+ this.contentStyle = contentStyle;
1084
+ this._cdRef.markForCheck();
1085
+ });
1086
+ }
1087
+ ngOnDestroy() {
1088
+ this._destroy$.next();
1089
+ this._destroy$.complete();
1090
+ }
1091
+ save() {
1092
+ this._config.saveContentStyle(this.contentStyle)
1093
+ .pipe(tap((contentStyle) => {
1094
+ this.contentStyle = Object.assign(Object.assign({}, this.contentStyle), contentStyle);
1095
+ this._cdRef.markForCheck();
1096
+ this._message.success('Saved Changes');
1097
+ })).subscribe();
1098
+ }
1099
+ }
1100
+ ContentStyleComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ContentStyleComponent, deps: [{ token: FS_CONTENT_CONFIG }, { token: i2.FsMessage }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
1101
+ ContentStyleComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: ContentStyleComponent, selector: "fs-content-style", inputs: { height: "height" }, viewQueries: [{ propertyName: "textEditors", first: true, predicate: FsTextEditorComponent, descendants: true }, { propertyName: "form", first: true, predicate: FsFormDirective, descendants: true }], ngImport: i0, template: "<ng-container *fsSkeletonForm=\"contentStyle\">\n <fs-text-editor \n [(ngModel)]=\"contentStyle.scss\" \n name=\"contentStyle\"\n [fsModelChangeOptions]=\"{ debounce: 300 }\"\n (fsModelChange)=\"save()\"\n [config]=\"styleConfig\">\n </fs-text-editor> \n</ng-container>\n", styles: [""], components: [{ type: i4.FsTextEditorComponent, selector: "fs-text-editor", inputs: ["config", "scrollable"], outputs: ["ready", "blur"] }], directives: [{ type: i8.FsSkeletonFormDirective, selector: "[fsSkeletonForm]", inputs: ["fsSkeletonForm", "fsSkeletonFormLines"] }, { type: i9.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i9.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i7.FsModelChangeDirective, selector: "[fsModelChange]", inputs: ["fsModelChangeOptions"], outputs: ["fsModelChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1102
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ContentStyleComponent, decorators: [{
1103
+ type: Component,
1104
+ args: [{
1105
+ selector: 'fs-content-style',
1106
+ templateUrl: './content-style.component.html',
1107
+ styleUrls: ['./content-style.component.scss'],
1108
+ changeDetection: ChangeDetectionStrategy.OnPush,
1109
+ }]
1110
+ }], ctorParameters: function () { return [{ type: undefined, decorators: [{
1111
+ type: Inject,
1112
+ args: [FS_CONTENT_CONFIG]
1113
+ }] }, { type: i2.FsMessage }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { textEditors: [{
1114
+ type: ViewChild,
1115
+ args: [FsTextEditorComponent]
1116
+ }], form: [{
1117
+ type: ViewChild,
1118
+ args: [FsFormDirective]
1119
+ }], height: [{
1120
+ type: Input
1101
1121
  }] } });
1102
1122
 
1103
- class FsContentStyleModule {
1104
- }
1105
- FsContentStyleModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsContentStyleModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1106
- FsContentStyleModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsContentStyleModule, declarations: [ContentStyleComponent], imports: [CommonModule,
1107
- FormsModule,
1108
- MatButtonModule,
1109
- FsTextEditorModule,
1110
- FsSkeletonModule,
1111
- FsCommonModule,
1112
- FsContentEditorModule], exports: [ContentStyleComponent] });
1113
- FsContentStyleModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsContentStyleModule, imports: [[
1114
- CommonModule,
1115
- FormsModule,
1116
- MatButtonModule,
1117
- FsTextEditorModule,
1118
- FsSkeletonModule,
1119
- FsCommonModule,
1120
- FsContentEditorModule,
1121
- ]] });
1122
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsContentStyleModule, decorators: [{
1123
- type: NgModule,
1124
- args: [{
1125
- imports: [
1126
- CommonModule,
1127
- FormsModule,
1128
- MatButtonModule,
1129
- FsTextEditorModule,
1130
- FsSkeletonModule,
1131
- FsCommonModule,
1132
- FsContentEditorModule,
1133
- ],
1134
- exports: [
1135
- ContentStyleComponent,
1136
- ],
1137
- declarations: [
1138
- ContentStyleComponent,
1139
- ],
1140
- }]
1123
+ class FsContentStyleModule {
1124
+ }
1125
+ FsContentStyleModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsContentStyleModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1126
+ FsContentStyleModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsContentStyleModule, declarations: [ContentStyleComponent], imports: [CommonModule,
1127
+ FormsModule,
1128
+ MatButtonModule,
1129
+ FsTextEditorModule,
1130
+ FsSkeletonModule,
1131
+ FsCommonModule,
1132
+ FsContentEditorModule], exports: [ContentStyleComponent] });
1133
+ FsContentStyleModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsContentStyleModule, imports: [[
1134
+ CommonModule,
1135
+ FormsModule,
1136
+ MatButtonModule,
1137
+ FsTextEditorModule,
1138
+ FsSkeletonModule,
1139
+ FsCommonModule,
1140
+ FsContentEditorModule,
1141
+ ]] });
1142
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsContentStyleModule, decorators: [{
1143
+ type: NgModule,
1144
+ args: [{
1145
+ imports: [
1146
+ CommonModule,
1147
+ FormsModule,
1148
+ MatButtonModule,
1149
+ FsTextEditorModule,
1150
+ FsSkeletonModule,
1151
+ FsCommonModule,
1152
+ FsContentEditorModule,
1153
+ ],
1154
+ exports: [
1155
+ ContentStyleComponent,
1156
+ ],
1157
+ declarations: [
1158
+ ContentStyleComponent,
1159
+ ],
1160
+ }]
1141
1161
  }] });
1142
1162
 
1143
- class ContentRendererComponent {
1144
- constructor(_sanitizer, _router, _el, _htmlRenderer) {
1145
- this._sanitizer = _sanitizer;
1146
- this._router = _router;
1147
- this._el = _el;
1148
- this._htmlRenderer = _htmlRenderer;
1149
- this._destroy$ = new Subject();
1150
- }
1151
- ngOnInit() {
1152
- this._htmlRenderer.addStyle(this.contentPage.styles, { id: 'contentPageStyles' });
1153
- this.content = this._sanitizer.bypassSecurityTrustHtml(this.contentPage.content);
1154
- }
1155
- ngAfterViewChecked() {
1156
- this.registerHrefs();
1157
- if (this.contentPage.js) {
1158
- const script = document.createElement('script');
1159
- script.text = this.contentPage.js;
1160
- this.script.nativeElement.after(script);
1161
- }
1162
- }
1163
- registerHrefs() {
1164
- Array.from(this.el.querySelectorAll('a[href]'))
1165
- .filter((el) => {
1166
- return el.getAttribute('href').match(/^\//);
1167
- })
1168
- .forEach((el) => {
1169
- el.addEventListener('click', (event) => {
1170
- if (!event.shiftKey && !event.ctrlKey) {
1171
- event.preventDefault();
1172
- const href = el.getAttribute('href');
1173
- this._router.navigateByUrl(href);
1174
- }
1175
- });
1176
- });
1177
- }
1178
- get el() {
1179
- return this._el.nativeElement;
1180
- }
1181
- ngOnDestroy() {
1182
- this.removeStyles();
1183
- this._destroy$.next();
1184
- this._destroy$.complete();
1185
- }
1186
- removeStyles() {
1187
- const el = document.querySelector('#contentPageStyles');
1188
- if (el) {
1189
- el.remove();
1190
- }
1191
- }
1192
- }
1193
- ContentRendererComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ContentRendererComponent, deps: [{ token: i1$1.DomSanitizer }, { token: i2$3.Router }, { token: i0.ElementRef }, { token: i3$4.HtmlRenderer }], target: i0.ɵɵFactoryTarget.Component });
1194
- ContentRendererComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: ContentRendererComponent, selector: "fs-content-renderer", inputs: { contentPage: "contentPage" }, viewQueries: [{ propertyName: "script", first: true, predicate: ["script"], descendants: true, read: ElementRef }], ngImport: i0, template: "<div *ngIf=\"content\" [innerHTML]=\"content\"></div>\n<span #script></span>", styles: [""], directives: [{ type: i10.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1195
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ContentRendererComponent, decorators: [{
1196
- type: Component,
1197
- args: [{
1198
- selector: 'fs-content-renderer',
1199
- templateUrl: './content-renderer.component.html',
1200
- styleUrls: ['./content-renderer.component.scss'],
1201
- changeDetection: ChangeDetectionStrategy.OnPush,
1202
- }]
1203
- }], ctorParameters: function () { return [{ type: i1$1.DomSanitizer }, { type: i2$3.Router }, { type: i0.ElementRef }, { type: i3$4.HtmlRenderer }]; }, propDecorators: { script: [{
1204
- type: ViewChild,
1205
- args: ['script', { read: ElementRef }]
1206
- }], contentPage: [{
1207
- type: Input
1163
+ class ContentRendererComponent {
1164
+ constructor(_sanitizer, _router, _el, _htmlRenderer) {
1165
+ this._sanitizer = _sanitizer;
1166
+ this._router = _router;
1167
+ this._el = _el;
1168
+ this._htmlRenderer = _htmlRenderer;
1169
+ this._destroy$ = new Subject();
1170
+ }
1171
+ ngOnInit() {
1172
+ this._htmlRenderer.addStyle(this.contentPage.styles, { id: 'contentPageStyles' });
1173
+ this.content = this._sanitizer.bypassSecurityTrustHtml(this.contentPage.content);
1174
+ }
1175
+ ngAfterViewChecked() {
1176
+ this.registerHrefs();
1177
+ if (this.contentPage.js) {
1178
+ const script = document.createElement('script');
1179
+ script.text = this.contentPage.js;
1180
+ this.script.nativeElement.after(script);
1181
+ }
1182
+ }
1183
+ registerHrefs() {
1184
+ Array.from(this.el.querySelectorAll('a[href]'))
1185
+ .filter((el) => {
1186
+ return el.getAttribute('href').match(/^\//);
1187
+ })
1188
+ .forEach((el) => {
1189
+ el.addEventListener('click', (event) => {
1190
+ if (!event.shiftKey && !event.ctrlKey) {
1191
+ event.preventDefault();
1192
+ const href = el.getAttribute('href');
1193
+ this._router.navigateByUrl(href);
1194
+ }
1195
+ });
1196
+ });
1197
+ }
1198
+ get el() {
1199
+ return this._el.nativeElement;
1200
+ }
1201
+ ngOnDestroy() {
1202
+ this.removeStyles();
1203
+ this._destroy$.next();
1204
+ this._destroy$.complete();
1205
+ }
1206
+ removeStyles() {
1207
+ const el = document.querySelector('#contentPageStyles');
1208
+ if (el) {
1209
+ el.remove();
1210
+ }
1211
+ }
1212
+ }
1213
+ ContentRendererComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ContentRendererComponent, deps: [{ token: i1$1.DomSanitizer }, { token: i2$3.Router }, { token: i0.ElementRef }, { token: i3$4.HtmlRenderer }], target: i0.ɵɵFactoryTarget.Component });
1214
+ ContentRendererComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: ContentRendererComponent, selector: "fs-content-renderer", inputs: { contentPage: "contentPage" }, viewQueries: [{ propertyName: "script", first: true, predicate: ["script"], descendants: true, read: ElementRef }], ngImport: i0, template: "<div *ngIf=\"content\" [innerHTML]=\"content\"></div>\n<span #script></span>", styles: [""], directives: [{ type: i10.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1215
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ContentRendererComponent, decorators: [{
1216
+ type: Component,
1217
+ args: [{
1218
+ selector: 'fs-content-renderer',
1219
+ templateUrl: './content-renderer.component.html',
1220
+ styleUrls: ['./content-renderer.component.scss'],
1221
+ changeDetection: ChangeDetectionStrategy.OnPush,
1222
+ }]
1223
+ }], ctorParameters: function () { return [{ type: i1$1.DomSanitizer }, { type: i2$3.Router }, { type: i0.ElementRef }, { type: i3$4.HtmlRenderer }]; }, propDecorators: { script: [{
1224
+ type: ViewChild,
1225
+ args: ['script', { read: ElementRef }]
1226
+ }], contentPage: [{
1227
+ type: Input
1208
1228
  }] } });
1209
1229
 
1210
- class FsContentComponent {
1211
- constructor(_config, _title, _cdRef, _router, _el, _htmlRenderer) {
1212
- this._config = _config;
1213
- this._title = _title;
1214
- this._cdRef = _cdRef;
1215
- this._router = _router;
1216
- this._el = _el;
1217
- this._htmlRenderer = _htmlRenderer;
1218
- this._destroy$ = new Subject();
1219
- }
1220
- ngOnInit() {
1221
- this._initContent();
1222
- this._initStyles();
1223
- }
1224
- get el() {
1225
- return this._el.nativeElement;
1226
- }
1227
- ngOnDestroy() {
1228
- this._destroy$.next();
1229
- this._destroy$.complete();
1230
- this._title.setTitle('');
1231
- }
1232
- _initStyles() {
1233
- if (this._config.loadContentStyleCss) {
1234
- this._config.loadContentStyleCss()
1235
- .subscribe((styles) => {
1236
- this._htmlRenderer.addStyle(styles, { id: 'content-sytle' });
1237
- });
1238
- }
1239
- }
1240
- _initContent() {
1241
- this._loadContent();
1242
- this._router.events
1243
- .pipe(filter((e) => e instanceof NavigationEnd), takeUntil(this._destroy$))
1244
- .subscribe((e) => {
1245
- this._loadContent();
1246
- });
1247
- }
1248
- _loadContent() {
1249
- const path = window.location.pathname;
1250
- this._config.loadContent(path)
1251
- .subscribe((contentPage) => {
1252
- if (contentPage.title) {
1253
- this._title.setTitle(contentPage.title);
1254
- let ogTitleEl = document.querySelector('head meta[property="og:title"]');
1255
- if (!ogTitleEl) {
1256
- ogTitleEl = document.createElement('meta');
1257
- ogTitleEl.setAttribute('property', 'og:title');
1258
- document.getElementsByTagName('head')[0].appendChild(ogTitleEl);
1259
- }
1260
- ogTitleEl.setAttribute('content', contentPage.title);
1261
- }
1262
- this.contentPage = contentPage;
1263
- this._cdRef.markForCheck();
1264
- });
1265
- }
1266
- }
1267
- FsContentComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsContentComponent, deps: [{ token: FS_CONTENT_CONFIG }, { token: i1$1.Title }, { token: i0.ChangeDetectorRef }, { token: i2$3.Router }, { token: i0.ElementRef }, { token: i3$4.HtmlRenderer }], target: i0.ɵɵFactoryTarget.Component });
1268
- FsContentComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FsContentComponent, selector: "fs-content", ngImport: i0, template: "<ng-container *ngIf=\"contentPage\">\n <fs-content-renderer [contentPage]=\"contentPage\"></fs-content-renderer>\n</ng-container>", styles: [""], components: [{ type: ContentRendererComponent, selector: "fs-content-renderer", inputs: ["contentPage"] }], directives: [{ type: i10.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1269
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsContentComponent, decorators: [{
1270
- type: Component,
1271
- args: [{
1272
- selector: 'fs-content',
1273
- templateUrl: './content.component.html',
1274
- styleUrls: ['./content.component.scss'],
1275
- changeDetection: ChangeDetectionStrategy.OnPush,
1276
- }]
1277
- }], ctorParameters: function () { return [{ type: undefined, decorators: [{
1278
- type: Inject,
1279
- args: [FS_CONTENT_CONFIG]
1230
+ class FsContentComponent {
1231
+ constructor(_config, _title, _cdRef, _router, _el, _htmlRenderer) {
1232
+ this._config = _config;
1233
+ this._title = _title;
1234
+ this._cdRef = _cdRef;
1235
+ this._router = _router;
1236
+ this._el = _el;
1237
+ this._htmlRenderer = _htmlRenderer;
1238
+ this._destroy$ = new Subject();
1239
+ }
1240
+ ngOnInit() {
1241
+ this._initContent();
1242
+ this._initStyles();
1243
+ }
1244
+ get el() {
1245
+ return this._el.nativeElement;
1246
+ }
1247
+ ngOnDestroy() {
1248
+ this._destroy$.next();
1249
+ this._destroy$.complete();
1250
+ this._title.setTitle('');
1251
+ }
1252
+ _initStyles() {
1253
+ if (this._config.loadContentStyleCss) {
1254
+ this._config.loadContentStyleCss()
1255
+ .subscribe((styles) => {
1256
+ this._htmlRenderer.addStyle(styles, { id: 'content-sytle' });
1257
+ });
1258
+ }
1259
+ }
1260
+ _initContent() {
1261
+ this._loadContent();
1262
+ this._router.events
1263
+ .pipe(filter((e) => e instanceof NavigationEnd), takeUntil(this._destroy$))
1264
+ .subscribe((e) => {
1265
+ this._loadContent();
1266
+ });
1267
+ }
1268
+ _loadContent() {
1269
+ const path = window.location.pathname;
1270
+ this._config.loadContent(path)
1271
+ .subscribe((contentPage) => {
1272
+ if (contentPage.title) {
1273
+ this._title.setTitle(contentPage.title);
1274
+ let ogTitleEl = document.querySelector('head meta[property="og:title"]');
1275
+ if (!ogTitleEl) {
1276
+ ogTitleEl = document.createElement('meta');
1277
+ ogTitleEl.setAttribute('property', 'og:title');
1278
+ document.getElementsByTagName('head')[0].appendChild(ogTitleEl);
1279
+ }
1280
+ ogTitleEl.setAttribute('content', contentPage.title);
1281
+ }
1282
+ this.contentPage = contentPage;
1283
+ this._cdRef.markForCheck();
1284
+ });
1285
+ }
1286
+ }
1287
+ FsContentComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsContentComponent, deps: [{ token: FS_CONTENT_CONFIG }, { token: i1$1.Title }, { token: i0.ChangeDetectorRef }, { token: i2$3.Router }, { token: i0.ElementRef }, { token: i3$4.HtmlRenderer }], target: i0.ɵɵFactoryTarget.Component });
1288
+ FsContentComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FsContentComponent, selector: "fs-content", ngImport: i0, template: "<ng-container *ngIf=\"contentPage\">\n <fs-content-renderer [contentPage]=\"contentPage\"></fs-content-renderer>\n</ng-container>", styles: [""], components: [{ type: ContentRendererComponent, selector: "fs-content-renderer", inputs: ["contentPage"] }], directives: [{ type: i10.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1289
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsContentComponent, decorators: [{
1290
+ type: Component,
1291
+ args: [{
1292
+ selector: 'fs-content',
1293
+ templateUrl: './content.component.html',
1294
+ styleUrls: ['./content.component.scss'],
1295
+ changeDetection: ChangeDetectionStrategy.OnPush,
1296
+ }]
1297
+ }], ctorParameters: function () { return [{ type: undefined, decorators: [{
1298
+ type: Inject,
1299
+ args: [FS_CONTENT_CONFIG]
1280
1300
  }] }, { type: i1$1.Title }, { type: i0.ChangeDetectorRef }, { type: i2$3.Router }, { type: i0.ElementRef }, { type: i3$4.HtmlRenderer }]; } });
1281
1301
 
1282
- class FsContentModule {
1283
- }
1284
- FsContentModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsContentModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1285
- FsContentModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsContentModule, declarations: [FsContentComponent,
1286
- ContentRendererComponent], imports: [CommonModule,
1287
- FsHtmlEditorModule], exports: [FsContentComponent] });
1288
- FsContentModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsContentModule, imports: [[
1289
- CommonModule,
1290
- FsHtmlEditorModule,
1291
- ]] });
1292
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsContentModule, decorators: [{
1293
- type: NgModule,
1294
- args: [{
1295
- imports: [
1296
- CommonModule,
1297
- FsHtmlEditorModule,
1298
- ],
1299
- exports: [
1300
- FsContentComponent,
1301
- ],
1302
- declarations: [
1303
- FsContentComponent,
1304
- ContentRendererComponent,
1305
- ],
1306
- }]
1302
+ class FsContentModule {
1303
+ }
1304
+ FsContentModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsContentModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1305
+ FsContentModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsContentModule, declarations: [FsContentComponent,
1306
+ ContentRendererComponent], imports: [CommonModule,
1307
+ FsHtmlEditorModule], exports: [FsContentComponent] });
1308
+ FsContentModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsContentModule, imports: [[
1309
+ CommonModule,
1310
+ FsHtmlEditorModule,
1311
+ ]] });
1312
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsContentModule, decorators: [{
1313
+ type: NgModule,
1314
+ args: [{
1315
+ imports: [
1316
+ CommonModule,
1317
+ FsHtmlEditorModule,
1318
+ ],
1319
+ exports: [
1320
+ FsContentComponent,
1321
+ ],
1322
+ declarations: [
1323
+ FsContentComponent,
1324
+ ContentRendererComponent,
1325
+ ],
1326
+ }]
1307
1327
  }] });
1308
1328
 
1309
- /**
1310
- * Generated bundle index. Do not edit.
1329
+ /**
1330
+ * Generated bundle index. Do not edit.
1311
1331
  */
1312
1332
 
1313
1333
  export { ContentStyleComponent, FS_CONTENT_CONFIG, FsContentComponent, FsContentLayoutsComponent, FsContentLayoutsModule, FsContentModule, FsContentPagesComponent, FsContentPagesModule, FsContentStyleModule };