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