@firestitch/content 12.2.8 → 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 -50
  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 -51
  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 -1330
  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 +159 -159
  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 +162 -162
  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 +1241 -1241
  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
@@ -49,1285 +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
- 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]
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]
461
461
  }] } });
462
462
 
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]
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]
569
569
  }] } });
570
570
 
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
- }]
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
+ }]
649
649
  }] });
650
650
 
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 },
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 },
656
656
  ];
657
657
 
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-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 });
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]
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]
719
719
  }] } });
720
720
 
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]
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]
861
861
  }] } });
862
862
 
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]
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]
975
975
  }] } });
976
976
 
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
- }]
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
+ }]
1063
1063
  }] });
1064
1064
 
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
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
1121
1121
  }] } });
1122
1122
 
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
- }]
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
+ }]
1161
1161
  }] });
1162
1162
 
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
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
1228
1228
  }] } });
1229
1229
 
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]
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]
1300
1300
  }] }, { type: i1$1.Title }, { type: i0.ChangeDetectorRef }, { type: i2$3.Router }, { type: i0.ElementRef }, { type: i3$4.HtmlRenderer }]; } });
1301
1301
 
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
- }]
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
+ }]
1327
1327
  }] });
1328
1328
 
1329
- /**
1330
- * Generated bundle index. Do not edit.
1329
+ /**
1330
+ * Generated bundle index. Do not edit.
1331
1331
  */
1332
1332
 
1333
1333
  export { ContentStyleComponent, FS_CONTENT_CONFIG, FsContentComponent, FsContentLayoutsComponent, FsContentLayoutsModule, FsContentModule, FsContentPagesComponent, FsContentPagesModule, FsContentStyleModule };