@firestitch/content 12.0.0
Sign up to get free protection for your applications and to get access to all the features.
- package/app/consts/index.d.ts +1 -0
- package/app/consts/page-types.const.d.ts +5 -0
- package/app/enums/index.d.ts +1 -0
- package/app/enums/page-type.enum.d.ts +6 -0
- package/app/injectors/content-config.injector.d.ts +2 -0
- package/app/injectors/index.d.ts +1 -0
- package/app/interfaces/content-config.d.ts +19 -0
- package/app/interfaces/content-layout.d.ts +10 -0
- package/app/interfaces/content-page.d.ts +13 -0
- package/app/interfaces/index.d.ts +3 -0
- package/app/modules/content/components/content/content.component.d.ts +21 -0
- package/app/modules/content/components/content/index.d.ts +1 -0
- package/app/modules/content/components/content- renderer/content-renderer.component.d.ts +22 -0
- package/app/modules/content/components/content- renderer/index.d.ts +1 -0
- package/app/modules/content/fs-content.module.d.ts +10 -0
- package/app/modules/content-layouts/components/content-layout/content-layout.component.d.ts +27 -0
- package/app/modules/content-layouts/components/content-layout/index.d.ts +1 -0
- package/app/modules/content-layouts/components/content-layouts/content-layouts.component.d.ts +20 -0
- package/app/modules/content-layouts/components/content-layouts/index.d.ts +1 -0
- package/app/modules/content-layouts/fs-content-layouts.module.d.ts +28 -0
- package/app/modules/content-pages/components/content-page/content-page.component.d.ts +32 -0
- package/app/modules/content-pages/components/content-page/index.d.ts +1 -0
- package/app/modules/content-pages/components/content-pages/content-pages.component.d.ts +23 -0
- package/app/modules/content-pages/components/content-pages/index.d.ts +1 -0
- package/app/modules/content-pages/fs-content-pages.module.d.ts +29 -0
- package/app/modules/editor/components/editor/editor.component.d.ts +26 -0
- package/app/modules/editor/components/editor/index.d.ts +1 -0
- package/app/modules/editor/fs-content-editor.module.d.ts +20 -0
- package/app/modules/editor/index.d.ts +1 -0
- package/bundles/firestitch-content.umd.js +894 -0
- package/bundles/firestitch-content.umd.js.map +1 -0
- package/esm2015/app/consts/index.js +2 -0
- package/esm2015/app/consts/page-types.const.js +8 -0
- package/esm2015/app/enums/index.js +2 -0
- package/esm2015/app/enums/page-type.enum.js +8 -0
- package/esm2015/app/injectors/content-config.injector.js +3 -0
- package/esm2015/app/injectors/index.js +2 -0
- package/esm2015/app/interfaces/content-config.js +2 -0
- package/esm2015/app/interfaces/content-layout.js +2 -0
- package/esm2015/app/interfaces/content-page.js +2 -0
- package/esm2015/app/interfaces/index.js +4 -0
- package/esm2015/app/modules/content/components/content/content.component.js +61 -0
- package/esm2015/app/modules/content/components/content/index.js +2 -0
- package/esm2015/app/modules/content/components/content- renderer/content-renderer.component.js +75 -0
- package/esm2015/app/modules/content/components/content- renderer/index.js +2 -0
- package/esm2015/app/modules/content/fs-content.module.js +33 -0
- package/esm2015/app/modules/content-layouts/components/content-layout/content-layout.component.js +73 -0
- package/esm2015/app/modules/content-layouts/components/content-layout/index.js +2 -0
- package/esm2015/app/modules/content-layouts/components/content-layouts/content-layouts.component.js +124 -0
- package/esm2015/app/modules/content-layouts/components/content-layouts/index.js +2 -0
- package/esm2015/app/modules/content-layouts/fs-content-layouts.module.js +105 -0
- package/esm2015/app/modules/content-pages/components/content-page/content-page.component.js +82 -0
- package/esm2015/app/modules/content-pages/components/content-page/index.js +2 -0
- package/esm2015/app/modules/content-pages/components/content-pages/content-pages.component.js +128 -0
- package/esm2015/app/modules/content-pages/components/content-pages/index.js +2 -0
- package/esm2015/app/modules/content-pages/fs-content-pages.module.js +106 -0
- package/esm2015/app/modules/editor/components/editor/editor.component.js +67 -0
- package/esm2015/app/modules/editor/components/editor/index.js +2 -0
- package/esm2015/app/modules/editor/fs-content-editor.module.js +74 -0
- package/esm2015/app/modules/editor/index.js +2 -0
- package/esm2015/firestitch-content.js +5 -0
- package/esm2015/public_api.js +8 -0
- package/fesm2015/firestitch-content.js +827 -0
- package/fesm2015/firestitch-content.js.map +1 -0
- package/firestitch-content.d.ts +5 -0
- package/package.json +27 -0
- package/public_api.d.ts +9 -0
- package/styles.scss +0 -0
@@ -0,0 +1,827 @@
|
|
1
|
+
import * as i0 from '@angular/core';
|
2
|
+
import { InjectionToken, Component, ChangeDetectionStrategy, Inject, ViewChildren, Input, ViewChild, NgModule } from '@angular/core';
|
3
|
+
import * as i10 from '@angular/common';
|
4
|
+
import { CommonModule } from '@angular/common';
|
5
|
+
import { MatButtonModule } from '@angular/material/button';
|
6
|
+
import { MatTabsModule } from '@angular/material/tabs';
|
7
|
+
import * as i1 from '@angular/material/dialog';
|
8
|
+
import { MAT_DIALOG_DATA, MatDialogModule } from '@angular/material/dialog';
|
9
|
+
import * as i9 from '@angular/forms';
|
10
|
+
import { FormsModule } from '@angular/forms';
|
11
|
+
import * as i11 from '@angular/material/input';
|
12
|
+
import { MatInputModule } from '@angular/material/input';
|
13
|
+
import * as i4 from '@angular/material/form-field';
|
14
|
+
import { MatFormFieldModule } from '@angular/material/form-field';
|
15
|
+
import * as i3$1 from '@angular/material/icon';
|
16
|
+
import { MatIconModule } from '@angular/material/icon';
|
17
|
+
import * as i5 from '@angular/material/select';
|
18
|
+
import { MatSelectModule } from '@angular/material/select';
|
19
|
+
import * as i2$1 from '@firestitch/list';
|
20
|
+
import { FsListComponent, FsListModule } from '@firestitch/list';
|
21
|
+
import * as i4$2 from '@firestitch/date';
|
22
|
+
import { FsDateModule } from '@firestitch/date';
|
23
|
+
import * as i3 from '@firestitch/dialog';
|
24
|
+
import { FsDialogModule } from '@firestitch/dialog';
|
25
|
+
import * as i7 from '@firestitch/form';
|
26
|
+
import { FsFormModule } from '@firestitch/form';
|
27
|
+
import { FsHtmlEditorModule } from '@firestitch/html-editor';
|
28
|
+
import * as i6$1 from '@firestitch/text-editor';
|
29
|
+
import { FsTextEditorComponent, FsTextEditorModule } from '@firestitch/text-editor';
|
30
|
+
import * as i5$1 from '@firestitch/label';
|
31
|
+
import { FsLabelModule } from '@firestitch/label';
|
32
|
+
import * as i8 from '@firestitch/skeleton';
|
33
|
+
import { FsSkeletonModule } from '@firestitch/skeleton';
|
34
|
+
import * as i2 from '@firestitch/message';
|
35
|
+
import { Subject, of } from 'rxjs';
|
36
|
+
import { tap, switchMap, takeUntil, filter, map } from 'rxjs/operators';
|
37
|
+
import * as i6 from '@angular/material/core';
|
38
|
+
import { ItemType } from '@firestitch/filter';
|
39
|
+
import { index } from '@firestitch/common';
|
40
|
+
import * as i4$1 from '@angular/material/button-toggle';
|
41
|
+
import { MatButtonToggleModule } from '@angular/material/button-toggle';
|
42
|
+
import * as i8$1 from '@angular/flex-layout/flex';
|
43
|
+
import { FlexLayoutModule } from '@angular/flex-layout';
|
44
|
+
import * as i1$1 from '@angular/platform-browser';
|
45
|
+
import * as i2$2 from '@angular/router';
|
46
|
+
import { NavigationEnd } from '@angular/router';
|
47
|
+
|
48
|
+
var PageType;
|
49
|
+
(function (PageType) {
|
50
|
+
PageType["StandardPage"] = "standardPage";
|
51
|
+
PageType["BlogPost"] = "blogPost";
|
52
|
+
PageType["HomePage"] = "homePage";
|
53
|
+
PageType["NotFoundPage"] = "notFoundPage";
|
54
|
+
})(PageType || (PageType = {}));
|
55
|
+
|
56
|
+
const PageTypes = [
|
57
|
+
{ name: 'Standard Page', value: PageType.StandardPage },
|
58
|
+
{ name: 'Home Page', value: PageType.HomePage },
|
59
|
+
{ name: 'Not Found Page', value: PageType.NotFoundPage },
|
60
|
+
{ name: 'Blog Post', value: PageType.BlogPost },
|
61
|
+
];
|
62
|
+
|
63
|
+
const FS_CONTENT_CONFIG = new InjectionToken('fs-content-config');
|
64
|
+
|
65
|
+
class ContentPageComponent {
|
66
|
+
constructor(_config, _data, _dialogRef, _message, _cdRef) {
|
67
|
+
this._config = _config;
|
68
|
+
this._data = _data;
|
69
|
+
this._dialogRef = _dialogRef;
|
70
|
+
this._message = _message;
|
71
|
+
this._cdRef = _cdRef;
|
72
|
+
this.contentPage = null;
|
73
|
+
this.PageTypes = PageTypes;
|
74
|
+
this.editors = { content: true, styles: true };
|
75
|
+
this._destroy$ = new Subject();
|
76
|
+
this.save = () => {
|
77
|
+
return this._config.saveContentPage(this.contentPage)
|
78
|
+
.pipe(tap((contentPage) => {
|
79
|
+
this._message.success('Saved Changes');
|
80
|
+
this._dialogRef.close(contentPage);
|
81
|
+
}));
|
82
|
+
};
|
83
|
+
}
|
84
|
+
ngOnInit() {
|
85
|
+
this._fetchData();
|
86
|
+
}
|
87
|
+
ngOnDestroy() {
|
88
|
+
this._destroy$.next();
|
89
|
+
this._destroy$.complete();
|
90
|
+
}
|
91
|
+
_fetchData() {
|
92
|
+
this._config.loadContentLayouts()
|
93
|
+
.subscribe((contentLayouts) => {
|
94
|
+
this.contentLayouts = contentLayouts;
|
95
|
+
this._cdRef.markForCheck();
|
96
|
+
});
|
97
|
+
of(this._data.contentPage)
|
98
|
+
.pipe(switchMap((contentPage) => {
|
99
|
+
return of(contentPage);
|
100
|
+
}), takeUntil(this._destroy$))
|
101
|
+
.subscribe((contentPage) => {
|
102
|
+
this.contentPage = Object.assign({}, contentPage);
|
103
|
+
this._cdRef.markForCheck();
|
104
|
+
});
|
105
|
+
}
|
106
|
+
}
|
107
|
+
ContentPageComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ContentPageComponent, deps: [{ token: FS_CONTENT_CONFIG }, { token: MAT_DIALOG_DATA }, { token: i1.MatDialogRef }, { token: i2.FsMessage }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
108
|
+
ContentPageComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: ContentPageComponent, selector: "ng-component", viewQueries: [{ propertyName: "textEditors", predicate: FsTextEditorComponent, descendants: true }], ngImport: i0, template: "<form fsForm [submit]=\"save\" *fsSkeletonForm=\"contentPage\">\n <fs-dialog>\n <h1 mat-dialog-title>{{contentPage.id ? 'Page' : 'Create Page'}}</h1>\n <div mat-dialog-content>\n <div fxLayout=\"column\">\n <mat-form-field>\n <mat-select\n [(ngModel)]=\"contentPage.type\"\n name=\"type\"\n required\n placeholder=\"Type\">\n <mat-option\n *ngFor=\"let item of PageTypes\"\n [value]=\"item.value\">\n {{ item.name }}\n </mat-option>\n </mat-select>\n </mat-form-field>\n <mat-form-field>\n <input\n matInput\n [(ngModel)]=\"contentPage.name\"\n name=\"name\"\n required\n placeholder=\"Name\">\n </mat-form-field>\n <mat-form-field>\n <input\n matInput\n [(ngModel)]=\"contentPage.path\"\n name=\"path\"\n placeholder=\"Path\">\n </mat-form-field>\n <mat-form-field>\n <input\n matInput\n [(ngModel)]=\"contentPage.title\"\n name=\"title\"\n placeholder=\"Title\">\n </mat-form-field>\n <mat-form-field *ngIf=\"contentLayouts\">\n <mat-select\n [(ngModel)]=\"contentPage.contentLayoutId\"\n required\n name=\"contentLayoutId\"\n placeholder=\"Layout\">\n <mat-option\n *ngFor=\"let item of contentLayouts\"\n [value]=\"item.id\">\n {{ item.name }}\n </mat-option>\n </mat-select>\n </mat-form-field>\n </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"] }, { type: i4.MatFormField, selector: "mat-form-field", inputs: ["color", "floatLabel", "appearance", "hideRequiredMarker", "hintLabel"], exportAs: ["matFormField"] }, { type: i5.MatSelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex"], exportAs: ["matSelect"] }, { type: i6.MatOption, selector: "mat-option", exportAs: ["matOption"] }, { type: i7.FsFormDialogActionsComponent, selector: "fs-form-dialog-actions", inputs: ["save", "create", "close", "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: i7.FsFormDirective, selector: "[fsForm]", inputs: ["wrapperSelector", "messageSelector", "hintSelector", "labelSelector", "autocomplete", "shortcuts", "confirm", "confirmDialog", "confirmDrawer", "confirmBrowser", "confirmTabs", "dirtySubmitButton", "submit", "successDelay", "errorDelay", "tabGroup"], outputs: ["fsForm", "invalid", "valid", "submitted", "reseted", "cleared"] }, { type: i1.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { type: i1.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { type: i9.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { type: i9.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i9.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i7.FsFormRequiredDirective, selector: "[fsFormRequired],[ngModel][required]", inputs: ["fsFormRequired", "required", "fsFormRequiredMessage"] }, { type: i10.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i11.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["id", "disabled", "required", "type", "value", "readonly", "placeholder", "errorStateMatcher", "aria-describedby"], exportAs: ["matInput"] }, { type: i9.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i10.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
109
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ContentPageComponent, decorators: [{
|
110
|
+
type: Component,
|
111
|
+
args: [{
|
112
|
+
templateUrl: './content-page.component.html',
|
113
|
+
styleUrls: ['./content-page.component.scss'],
|
114
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
115
|
+
}]
|
116
|
+
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
117
|
+
type: Inject,
|
118
|
+
args: [FS_CONTENT_CONFIG]
|
119
|
+
}] }, { type: undefined, decorators: [{
|
120
|
+
type: Inject,
|
121
|
+
args: [MAT_DIALOG_DATA]
|
122
|
+
}] }, { type: i1.MatDialogRef }, { type: i2.FsMessage }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { textEditors: [{
|
123
|
+
type: ViewChildren,
|
124
|
+
args: [FsTextEditorComponent]
|
125
|
+
}] } });
|
126
|
+
|
127
|
+
class EditorComponent {
|
128
|
+
constructor(_data, _dialogRef, _message) {
|
129
|
+
this._data = _data;
|
130
|
+
this._dialogRef = _dialogRef;
|
131
|
+
this._message = _message;
|
132
|
+
this.styles = null;
|
133
|
+
this.content = null;
|
134
|
+
this.editors = { content: true, styles: true };
|
135
|
+
this._destroy$ = new Subject();
|
136
|
+
this.save = () => {
|
137
|
+
return this._data.save({ content: this.content, styles: this.styles })
|
138
|
+
.pipe(tap(() => {
|
139
|
+
this._message.success('Saved Changes');
|
140
|
+
}));
|
141
|
+
};
|
142
|
+
}
|
143
|
+
ngOnInit() {
|
144
|
+
this._dialogRef.updateSize('100%', '100%');
|
145
|
+
this.content = this._data.content;
|
146
|
+
this.styles = this._data.styles;
|
147
|
+
}
|
148
|
+
editorToggleChange(event) {
|
149
|
+
this.editors[event.value] = !this.editors[event.value];
|
150
|
+
setTimeout(() => {
|
151
|
+
this.textEditors.forEach((textEditor) => {
|
152
|
+
textEditor.updateLayout();
|
153
|
+
});
|
154
|
+
}, 100);
|
155
|
+
}
|
156
|
+
ngOnDestroy() {
|
157
|
+
this._destroy$.next();
|
158
|
+
this._destroy$.complete();
|
159
|
+
}
|
160
|
+
}
|
161
|
+
EditorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: EditorComponent, deps: [{ token: MAT_DIALOG_DATA }, { token: i1.MatDialogRef }, { token: i2.FsMessage }], target: i0.ɵɵFactoryTarget.Component });
|
162
|
+
EditorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: EditorComponent, selector: "ng-component", viewQueries: [{ propertyName: "textEditors", predicate: FsTextEditorComponent, descendants: true }], ngImport: i0, template: "<form fsForm [submit]=\"save\">\n <fs-dialog>\n <h1 mat-dialog-title>Design</h1>\n <div mat-dialog-content>\n <div class=\"container\">\n <div class=\"toggles\">\n <mat-button-toggle-group multiple>\n <mat-button-toggle value=\"content\" [checked]=\"editors.content\" (change)=\"editorToggleChange($event)\">Content</mat-button-toggle>\n <mat-button-toggle value=\"styles\" [checked]=\"editors.styles\" (change)=\"editorToggleChange($event)\">Styles</mat-button-toggle>\n </mat-button-toggle-group> \n </div>\n <div class=\"editors\">\n <div class=\"editor\" *ngIf=\"editors.content\">\n <fs-label>Content</fs-label>\n <div class=\"editor-container\">\n <fs-text-editor \n [(ngModel)]=\"content\" \n name=\"content\"\n [config]=\"{ tabSize: 2, language: 'html' }\">\n </fs-text-editor> \n </div>\n </div>\n <div class=\"editor\" *ngIf=\"editors.styles\">\n <fs-label>Styles</fs-label>\n <div class=\"editor-container\">\n <fs-text-editor \n [(ngModel)]=\"styles\" \n name=\"styles\"\n [config]=\"{ tabSize: 2, language: 'scss' }\">\n </fs-text-editor> \n </div>\n </div> \n </div>\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: ["form{display:block;height:100%}form fs-dialog{display:flex;flex-direction:column;height:100%}form ::ng-deep .mat-dialog-content{max-height:none;flex:1}.toggles{display:flex;align-self:end;z-index:1;position:relative;margin-bottom:-12px}.container{height:100%;display:flex;flex-direction:column}.editors{width:5000px;max-width:100%;height:100%;display:flex;min-height:0}.editors .editor{height:100%;display:flex;min-width:0;width:100%;flex-direction:column}.editors .editor .editor-container{height:100%;overflow:auto;background:#1E1E1E}.editors .editor .editor-container fs-text-editor{display:block}.editors .editor+.editor{margin-left:20px}.editors .editor fs-label{background-color:#fff;padding-bottom:5px}\n"], components: [{ type: i3.FsDialogComponent, selector: "fs-dialog", inputs: ["mobileMode"] }, { type: i4$1.MatButtonToggle, selector: "mat-button-toggle", inputs: ["disableRipple", "aria-labelledby", "tabIndex", "appearance", "checked", "disabled", "id", "name", "aria-label", "value"], outputs: ["change"], exportAs: ["matButtonToggle"] }, { type: i5$1.FsLabelComponent, selector: "fs-label" }, { type: i6$1.FsTextEditorComponent, selector: "fs-text-editor", inputs: ["config", "scrollable"], outputs: ["init", "blur"] }, { type: i7.FsFormDialogActionsComponent, selector: "fs-form-dialog-actions", inputs: ["save", "create", "close", "closeData", "name"] }], 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: i7.FsFormDirective, selector: "[fsForm]", inputs: ["wrapperSelector", "messageSelector", "hintSelector", "labelSelector", "autocomplete", "shortcuts", "confirm", "confirmDialog", "confirmDrawer", "confirmBrowser", "confirmTabs", "dirtySubmitButton", "submit", "successDelay", "errorDelay", "tabGroup"], outputs: ["fsForm", "invalid", "valid", "submitted", "reseted", "cleared"] }, { type: i1.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { type: i1.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { type: i4$1.MatButtonToggleGroup, selector: "mat-button-toggle-group", inputs: ["appearance", "name", "vertical", "value", "multiple", "disabled"], outputs: ["valueChange", "change"], exportAs: ["matButtonToggleGroup"] }, { type: i10.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { 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: i1.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
163
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: EditorComponent, decorators: [{
|
164
|
+
type: Component,
|
165
|
+
args: [{
|
166
|
+
templateUrl: './editor.component.html',
|
167
|
+
styleUrls: ['./editor.component.scss'],
|
168
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
169
|
+
}]
|
170
|
+
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
171
|
+
type: Inject,
|
172
|
+
args: [MAT_DIALOG_DATA]
|
173
|
+
}] }, { type: i1.MatDialogRef }, { type: i2.FsMessage }]; }, propDecorators: { textEditors: [{
|
174
|
+
type: ViewChildren,
|
175
|
+
args: [FsTextEditorComponent]
|
176
|
+
}] } });
|
177
|
+
|
178
|
+
class FsContentPagesComponent {
|
179
|
+
constructor(_config, _dialog) {
|
180
|
+
this._config = _config;
|
181
|
+
this._dialog = _dialog;
|
182
|
+
this.pageTypes = index(PageTypes, 'value', 'name');
|
183
|
+
this._destroy$ = new Subject();
|
184
|
+
}
|
185
|
+
ngOnInit() {
|
186
|
+
this._initListConfig();
|
187
|
+
}
|
188
|
+
openEditor(contentPage) {
|
189
|
+
this._dialog.open(EditorComponent, {
|
190
|
+
maxWidth: null,
|
191
|
+
maxHeight: null,
|
192
|
+
data: {
|
193
|
+
styles: contentPage.styles,
|
194
|
+
content: contentPage.content,
|
195
|
+
save: (data) => {
|
196
|
+
return this._config.saveContentPage(Object.assign({ id: contentPage.id }, data));
|
197
|
+
},
|
198
|
+
},
|
199
|
+
})
|
200
|
+
.afterClosed()
|
201
|
+
.pipe(takeUntil(this._destroy$))
|
202
|
+
.subscribe(() => {
|
203
|
+
this.listComponent.reload();
|
204
|
+
});
|
205
|
+
}
|
206
|
+
openPage(contentPage) {
|
207
|
+
this._dialog.open(ContentPageComponent, {
|
208
|
+
data: {
|
209
|
+
contentPage,
|
210
|
+
},
|
211
|
+
})
|
212
|
+
.afterClosed()
|
213
|
+
.pipe(filter((_contentPage) => !!_contentPage), takeUntil(this._destroy$))
|
214
|
+
.subscribe(() => {
|
215
|
+
this.listComponent.reload();
|
216
|
+
});
|
217
|
+
}
|
218
|
+
ngOnDestroy() {
|
219
|
+
this._destroy$.next();
|
220
|
+
this._destroy$.complete();
|
221
|
+
}
|
222
|
+
_initListConfig() {
|
223
|
+
this.listConfig = {
|
224
|
+
filters: [
|
225
|
+
{
|
226
|
+
name: 'keyword',
|
227
|
+
type: ItemType.Keyword,
|
228
|
+
label: 'Search',
|
229
|
+
},
|
230
|
+
],
|
231
|
+
actions: [
|
232
|
+
{
|
233
|
+
label: 'Create',
|
234
|
+
click: () => {
|
235
|
+
this.openPage({});
|
236
|
+
},
|
237
|
+
},
|
238
|
+
],
|
239
|
+
rowActions: [
|
240
|
+
{
|
241
|
+
click: (data) => {
|
242
|
+
return this._config.deleteContentPage(data);
|
243
|
+
},
|
244
|
+
remove: {
|
245
|
+
title: 'Confirm',
|
246
|
+
template: 'Are you sure you would like to delete this record?',
|
247
|
+
},
|
248
|
+
menu: true,
|
249
|
+
label: 'Delete',
|
250
|
+
},
|
251
|
+
],
|
252
|
+
fetch: (query) => {
|
253
|
+
return this._config.loadContentPages(query)
|
254
|
+
.pipe(map((response) => {
|
255
|
+
return { data: response.contentPages, paging: response.paging };
|
256
|
+
}));
|
257
|
+
},
|
258
|
+
restore: {
|
259
|
+
query: { state: 'deleted' },
|
260
|
+
filterLabel: 'Show Deleted',
|
261
|
+
menuLabel: 'Restore',
|
262
|
+
reload: true,
|
263
|
+
click: (row) => {
|
264
|
+
return this._config.saveContentPage({ id: row.id, state: 'active' });
|
265
|
+
},
|
266
|
+
},
|
267
|
+
};
|
268
|
+
}
|
269
|
+
}
|
270
|
+
FsContentPagesComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsContentPagesComponent, deps: [{ token: FS_CONTENT_CONFIG }, { token: i1.MatDialog }], target: i0.ɵɵFactoryTarget.Component });
|
271
|
+
FsContentPagesComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FsContentPagesComponent, selector: "fs-content-pages", inputs: { htmlEditorConfig: "htmlEditorConfig" }, viewQueries: [{ propertyName: "listComponent", first: true, predicate: FsListComponent, descendants: true }], ngImport: i0, template: "<fs-list [config]=\"listConfig\">\n <fs-list-column name=\"design\" width=\"1%\">\n <ng-template fs-list-cell let-row=\"row\">\n <a (click)=\"openEditor(row)\"><mat-icon>design_services</mat-icon></a>\n </ng-template>\n </fs-list-column>\n <fs-list-column name=\"name\" title=\"Name\" [sortable]=\"true\">\n <ng-template fs-list-cell let-row=\"row\">\n <a (click)=\"openPage(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 /{{row.path}}\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$1.FsListComponent, selector: "fs-list", inputs: ["config", "loaderLines"], outputs: ["filtersReady"] }, { type: i3$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }], directives: [{ type: i2$1.FsListColumnDirective, selector: "fs-list-column", inputs: ["show", "title", "name", "customize", "sortable", "sortableDefault", "direction", "align", "width", "class"] }, { type: i2$1.FsListCellDirective, selector: "[fs-list-cell]", inputs: ["colspan", "align", "class"] }], pipes: { "fsDate": i4$2.FsDatePipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
272
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsContentPagesComponent, decorators: [{
|
273
|
+
type: Component,
|
274
|
+
args: [{
|
275
|
+
selector: 'fs-content-pages',
|
276
|
+
templateUrl: './content-pages.component.html',
|
277
|
+
styleUrls: ['./content-pages.component.scss'],
|
278
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
279
|
+
}]
|
280
|
+
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
281
|
+
type: Inject,
|
282
|
+
args: [FS_CONTENT_CONFIG]
|
283
|
+
}] }, { type: i1.MatDialog }]; }, propDecorators: { htmlEditorConfig: [{
|
284
|
+
type: Input
|
285
|
+
}], listComponent: [{
|
286
|
+
type: ViewChild,
|
287
|
+
args: [FsListComponent]
|
288
|
+
}] } });
|
289
|
+
|
290
|
+
class FsContentEditorModule {
|
291
|
+
}
|
292
|
+
FsContentEditorModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsContentEditorModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
293
|
+
FsContentEditorModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsContentEditorModule, declarations: [EditorComponent], imports: [CommonModule,
|
294
|
+
FormsModule,
|
295
|
+
MatDialogModule,
|
296
|
+
MatButtonModule,
|
297
|
+
MatTabsModule,
|
298
|
+
MatIconModule,
|
299
|
+
MatButtonToggleModule,
|
300
|
+
FsListModule,
|
301
|
+
FsFormModule,
|
302
|
+
FsLabelModule,
|
303
|
+
FsHtmlEditorModule,
|
304
|
+
FsDialogModule,
|
305
|
+
FsTextEditorModule], exports: [EditorComponent] });
|
306
|
+
FsContentEditorModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsContentEditorModule, imports: [[
|
307
|
+
CommonModule,
|
308
|
+
FormsModule,
|
309
|
+
MatDialogModule,
|
310
|
+
MatButtonModule,
|
311
|
+
MatTabsModule,
|
312
|
+
MatIconModule,
|
313
|
+
MatButtonToggleModule,
|
314
|
+
FsListModule,
|
315
|
+
FsFormModule,
|
316
|
+
FsLabelModule,
|
317
|
+
FsHtmlEditorModule,
|
318
|
+
FsDialogModule,
|
319
|
+
FsTextEditorModule,
|
320
|
+
]] });
|
321
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsContentEditorModule, decorators: [{
|
322
|
+
type: NgModule,
|
323
|
+
args: [{
|
324
|
+
imports: [
|
325
|
+
CommonModule,
|
326
|
+
FormsModule,
|
327
|
+
MatDialogModule,
|
328
|
+
MatButtonModule,
|
329
|
+
MatTabsModule,
|
330
|
+
MatIconModule,
|
331
|
+
MatButtonToggleModule,
|
332
|
+
FsListModule,
|
333
|
+
FsFormModule,
|
334
|
+
FsLabelModule,
|
335
|
+
FsHtmlEditorModule,
|
336
|
+
FsDialogModule,
|
337
|
+
FsTextEditorModule,
|
338
|
+
],
|
339
|
+
exports: [
|
340
|
+
EditorComponent,
|
341
|
+
],
|
342
|
+
declarations: [
|
343
|
+
EditorComponent,
|
344
|
+
],
|
345
|
+
}]
|
346
|
+
}] });
|
347
|
+
|
348
|
+
class FsContentPagesModule {
|
349
|
+
static forRoot() {
|
350
|
+
return {
|
351
|
+
ngModule: FsContentPagesModule,
|
352
|
+
};
|
353
|
+
}
|
354
|
+
}
|
355
|
+
FsContentPagesModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsContentPagesModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
356
|
+
FsContentPagesModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsContentPagesModule, declarations: [FsContentPagesComponent,
|
357
|
+
ContentPageComponent], imports: [CommonModule,
|
358
|
+
FormsModule,
|
359
|
+
MatDialogModule,
|
360
|
+
MatInputModule,
|
361
|
+
MatFormFieldModule,
|
362
|
+
MatButtonModule,
|
363
|
+
MatTabsModule,
|
364
|
+
MatIconModule,
|
365
|
+
MatSelectModule,
|
366
|
+
MatButtonToggleModule,
|
367
|
+
FsListModule,
|
368
|
+
FsDateModule,
|
369
|
+
FsFormModule,
|
370
|
+
FsLabelModule,
|
371
|
+
FsSkeletonModule,
|
372
|
+
FsHtmlEditorModule,
|
373
|
+
FsDialogModule,
|
374
|
+
FsTextEditorModule,
|
375
|
+
FsContentEditorModule], exports: [FsContentPagesComponent] });
|
376
|
+
FsContentPagesModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsContentPagesModule, imports: [[
|
377
|
+
CommonModule,
|
378
|
+
FormsModule,
|
379
|
+
MatDialogModule,
|
380
|
+
MatInputModule,
|
381
|
+
MatFormFieldModule,
|
382
|
+
MatButtonModule,
|
383
|
+
MatTabsModule,
|
384
|
+
MatIconModule,
|
385
|
+
MatSelectModule,
|
386
|
+
MatButtonToggleModule,
|
387
|
+
FsListModule,
|
388
|
+
FsDateModule,
|
389
|
+
FsFormModule,
|
390
|
+
FsLabelModule,
|
391
|
+
FsSkeletonModule,
|
392
|
+
FsHtmlEditorModule,
|
393
|
+
FsDialogModule,
|
394
|
+
FsTextEditorModule,
|
395
|
+
FsContentEditorModule,
|
396
|
+
]] });
|
397
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsContentPagesModule, decorators: [{
|
398
|
+
type: NgModule,
|
399
|
+
args: [{
|
400
|
+
imports: [
|
401
|
+
CommonModule,
|
402
|
+
FormsModule,
|
403
|
+
MatDialogModule,
|
404
|
+
MatInputModule,
|
405
|
+
MatFormFieldModule,
|
406
|
+
MatButtonModule,
|
407
|
+
MatTabsModule,
|
408
|
+
MatIconModule,
|
409
|
+
MatSelectModule,
|
410
|
+
MatButtonToggleModule,
|
411
|
+
FsListModule,
|
412
|
+
FsDateModule,
|
413
|
+
FsFormModule,
|
414
|
+
FsLabelModule,
|
415
|
+
FsSkeletonModule,
|
416
|
+
FsHtmlEditorModule,
|
417
|
+
FsDialogModule,
|
418
|
+
FsTextEditorModule,
|
419
|
+
FsContentEditorModule,
|
420
|
+
],
|
421
|
+
exports: [
|
422
|
+
FsContentPagesComponent,
|
423
|
+
],
|
424
|
+
declarations: [
|
425
|
+
FsContentPagesComponent,
|
426
|
+
ContentPageComponent,
|
427
|
+
],
|
428
|
+
}]
|
429
|
+
}] });
|
430
|
+
|
431
|
+
class ContentLayoutComponent {
|
432
|
+
constructor(_config, _data, _dialogRef, _message, _cdRef) {
|
433
|
+
this._config = _config;
|
434
|
+
this._data = _data;
|
435
|
+
this._dialogRef = _dialogRef;
|
436
|
+
this._message = _message;
|
437
|
+
this._cdRef = _cdRef;
|
438
|
+
this.contentLayout = null;
|
439
|
+
this.editors = { content: true, styles: true };
|
440
|
+
this._destroy$ = new Subject();
|
441
|
+
this.save = () => {
|
442
|
+
return this._config.saveContentLayout(this.contentLayout)
|
443
|
+
.pipe(tap((contentLayout) => {
|
444
|
+
this._message.success('Saved Changes');
|
445
|
+
this._dialogRef.close(contentLayout);
|
446
|
+
}));
|
447
|
+
};
|
448
|
+
}
|
449
|
+
ngOnInit() {
|
450
|
+
this._fetchData();
|
451
|
+
}
|
452
|
+
ngOnDestroy() {
|
453
|
+
this._destroy$.next();
|
454
|
+
this._destroy$.complete();
|
455
|
+
}
|
456
|
+
_fetchData() {
|
457
|
+
of(this._data.contentLayout)
|
458
|
+
.pipe(switchMap((contentLayout) => {
|
459
|
+
return of(contentLayout);
|
460
|
+
}), takeUntil(this._destroy$))
|
461
|
+
.subscribe((contentLayout) => {
|
462
|
+
this.contentLayout = Object.assign({}, contentLayout);
|
463
|
+
this._cdRef.markForCheck();
|
464
|
+
});
|
465
|
+
}
|
466
|
+
}
|
467
|
+
ContentLayoutComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ContentLayoutComponent, deps: [{ token: FS_CONTENT_CONFIG }, { token: MAT_DIALOG_DATA }, { token: i1.MatDialogRef }, { token: i2.FsMessage }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
468
|
+
ContentLayoutComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: ContentLayoutComponent, selector: "ng-component", viewQueries: [{ propertyName: "textEditors", predicate: FsTextEditorComponent, descendants: true }], ngImport: i0, template: "<form fsForm [submit]=\"save\" *fsSkeletonForm=\"contentLayout\">\n <fs-dialog>\n <h1 mat-dialog-title>{{contentLayout.id ? 'Layout' : 'Layout Page'}}</h1>\n <div mat-dialog-content>\n <div fxLayout=\"column\">\n <mat-form-field>\n <input\n matInput\n [(ngModel)]=\"contentLayout.name\"\n name=\"name\"\n required\n placeholder=\"Name\">\n </mat-form-field>\n <mat-form-field>\n <input\n matInput\n [(ngModel)]=\"contentLayout.tag\"\n name=\"tag\"\n placeholder=\"Tag\">\n </mat-form-field>\n </div>\n </div>\n\n <div mat-dialog-actions>\n <fs-form-dialog-actions>\n </fs-form-dialog-actions>\n </div>\n </fs-dialog>\n</form>\n", styles: [""], components: [{ type: i3.FsDialogComponent, selector: "fs-dialog", inputs: ["mobileMode"] }, { type: i4.MatFormField, selector: "mat-form-field", inputs: ["color", "floatLabel", "appearance", "hideRequiredMarker", "hintLabel"], exportAs: ["matFormField"] }, { type: i7.FsFormDialogActionsComponent, selector: "fs-form-dialog-actions", inputs: ["save", "create", "close", "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: i7.FsFormDirective, selector: "[fsForm]", inputs: ["wrapperSelector", "messageSelector", "hintSelector", "labelSelector", "autocomplete", "shortcuts", "confirm", "confirmDialog", "confirmDrawer", "confirmBrowser", "confirmTabs", "dirtySubmitButton", "submit", "successDelay", "errorDelay", "tabGroup"], outputs: ["fsForm", "invalid", "valid", "submitted", "reseted", "cleared"] }, { type: i1.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { type: i1.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { type: i8$1.DefaultLayoutDirective, selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg]", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }, { type: i11.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["id", "disabled", "required", "type", "value", "readonly", "placeholder", "errorStateMatcher", "aria-describedby"], exportAs: ["matInput"] }, { type: i9.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i9.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { type: i9.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i9.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i7.FsFormRequiredDirective, selector: "[fsFormRequired],[ngModel][required]", inputs: ["fsFormRequired", "required", "fsFormRequiredMessage"] }, { type: i1.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
469
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ContentLayoutComponent, decorators: [{
|
470
|
+
type: Component,
|
471
|
+
args: [{
|
472
|
+
templateUrl: './content-layout.component.html',
|
473
|
+
styleUrls: ['./content-layout.component.scss'],
|
474
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
475
|
+
}]
|
476
|
+
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
477
|
+
type: Inject,
|
478
|
+
args: [FS_CONTENT_CONFIG]
|
479
|
+
}] }, { type: undefined, decorators: [{
|
480
|
+
type: Inject,
|
481
|
+
args: [MAT_DIALOG_DATA]
|
482
|
+
}] }, { type: i1.MatDialogRef }, { type: i2.FsMessage }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { textEditors: [{
|
483
|
+
type: ViewChildren,
|
484
|
+
args: [FsTextEditorComponent]
|
485
|
+
}] } });
|
486
|
+
|
487
|
+
class FsContentLayoutsComponent {
|
488
|
+
constructor(_config, _dialog) {
|
489
|
+
this._config = _config;
|
490
|
+
this._dialog = _dialog;
|
491
|
+
this._destroy$ = new Subject();
|
492
|
+
}
|
493
|
+
ngOnInit() {
|
494
|
+
this._initListConfig();
|
495
|
+
}
|
496
|
+
openEditor(contentLayout) {
|
497
|
+
this._dialog.open(EditorComponent, {
|
498
|
+
maxWidth: null,
|
499
|
+
maxHeight: null,
|
500
|
+
data: {
|
501
|
+
styles: contentLayout.styles,
|
502
|
+
content: contentLayout.content,
|
503
|
+
save: (data) => {
|
504
|
+
return this._config.saveContentPage(Object.assign({ id: contentLayout.id }, data));
|
505
|
+
},
|
506
|
+
},
|
507
|
+
})
|
508
|
+
.afterClosed()
|
509
|
+
.pipe(takeUntil(this._destroy$))
|
510
|
+
.subscribe(() => {
|
511
|
+
this.listComponent.reload();
|
512
|
+
});
|
513
|
+
}
|
514
|
+
openLayout(contentLayout) {
|
515
|
+
this._dialog.open(ContentLayoutComponent, {
|
516
|
+
data: {
|
517
|
+
contentLayout,
|
518
|
+
},
|
519
|
+
})
|
520
|
+
.afterClosed()
|
521
|
+
.pipe(filter((_contentLayout) => !!_contentLayout), takeUntil(this._destroy$))
|
522
|
+
.subscribe(() => {
|
523
|
+
this.listComponent.reload();
|
524
|
+
});
|
525
|
+
}
|
526
|
+
ngOnDestroy() {
|
527
|
+
this._destroy$.next();
|
528
|
+
this._destroy$.complete();
|
529
|
+
}
|
530
|
+
_initListConfig() {
|
531
|
+
this.listConfig = {
|
532
|
+
paging: false,
|
533
|
+
filters: [
|
534
|
+
{
|
535
|
+
name: 'keyword',
|
536
|
+
type: ItemType.Keyword,
|
537
|
+
label: 'Search',
|
538
|
+
},
|
539
|
+
],
|
540
|
+
actions: [
|
541
|
+
{
|
542
|
+
label: 'Create',
|
543
|
+
click: () => {
|
544
|
+
this.openLayout({});
|
545
|
+
},
|
546
|
+
},
|
547
|
+
],
|
548
|
+
rowActions: [
|
549
|
+
{
|
550
|
+
click: (data) => {
|
551
|
+
return this._config.deleteContentLayout(data);
|
552
|
+
},
|
553
|
+
remove: {
|
554
|
+
title: 'Confirm',
|
555
|
+
template: 'Are you sure you would like to delete this record?',
|
556
|
+
},
|
557
|
+
menu: true,
|
558
|
+
label: 'Delete',
|
559
|
+
},
|
560
|
+
],
|
561
|
+
fetch: (query) => {
|
562
|
+
return this._config.loadContentLayouts(query)
|
563
|
+
.pipe(map((contentLayouts) => {
|
564
|
+
return { data: contentLayouts };
|
565
|
+
}));
|
566
|
+
},
|
567
|
+
restore: {
|
568
|
+
query: { state: 'deleted' },
|
569
|
+
filterLabel: 'Show Deleted',
|
570
|
+
menuLabel: 'Restore',
|
571
|
+
reload: true,
|
572
|
+
click: (row) => {
|
573
|
+
return this._config.saveContentLayout({ id: row.id, state: 'active' });
|
574
|
+
},
|
575
|
+
},
|
576
|
+
};
|
577
|
+
}
|
578
|
+
}
|
579
|
+
FsContentLayoutsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsContentLayoutsComponent, deps: [{ token: FS_CONTENT_CONFIG }, { token: i1.MatDialog }], target: i0.ɵɵFactoryTarget.Component });
|
580
|
+
FsContentLayoutsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FsContentLayoutsComponent, selector: "fs-content-layouts", viewQueries: [{ propertyName: "listComponent", first: true, predicate: FsListComponent, descendants: true }], ngImport: i0, template: "<fs-list [config]=\"listConfig\">\n <fs-list-column name=\"design\" width=\"1%\">\n <ng-template fs-list-cell let-row=\"row\">\n <a (click)=\"openEditor(row)\"><mat-icon>design_services</mat-icon></a>\n </ng-template>\n </fs-list-column>\n <fs-list-column name=\"name\" title=\"Name\" [sortable]=\"true\">\n <ng-template fs-list-cell let-row=\"row\">\n <a (click)=\"openLayout(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$1.FsListComponent, selector: "fs-list", inputs: ["config", "loaderLines"], outputs: ["filtersReady"] }, { type: i3$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }], directives: [{ type: i2$1.FsListColumnDirective, selector: "fs-list-column", inputs: ["show", "title", "name", "customize", "sortable", "sortableDefault", "direction", "align", "width", "class"] }, { type: i2$1.FsListCellDirective, selector: "[fs-list-cell]", inputs: ["colspan", "align", "class"] }], pipes: { "fsDate": i4$2.FsDatePipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
581
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsContentLayoutsComponent, decorators: [{
|
582
|
+
type: Component,
|
583
|
+
args: [{
|
584
|
+
selector: 'fs-content-layouts',
|
585
|
+
templateUrl: './content-layouts.component.html',
|
586
|
+
styleUrls: ['./content-layouts.component.scss'],
|
587
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
588
|
+
}]
|
589
|
+
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
590
|
+
type: Inject,
|
591
|
+
args: [FS_CONTENT_CONFIG]
|
592
|
+
}] }, { type: i1.MatDialog }]; }, propDecorators: { listComponent: [{
|
593
|
+
type: ViewChild,
|
594
|
+
args: [FsListComponent]
|
595
|
+
}] } });
|
596
|
+
|
597
|
+
class FsContentLayoutsModule {
|
598
|
+
}
|
599
|
+
FsContentLayoutsModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsContentLayoutsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
600
|
+
FsContentLayoutsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsContentLayoutsModule, declarations: [ContentLayoutComponent,
|
601
|
+
FsContentLayoutsComponent], imports: [CommonModule,
|
602
|
+
FormsModule,
|
603
|
+
FlexLayoutModule,
|
604
|
+
MatDialogModule,
|
605
|
+
MatInputModule,
|
606
|
+
MatFormFieldModule,
|
607
|
+
MatButtonModule,
|
608
|
+
MatTabsModule,
|
609
|
+
MatIconModule,
|
610
|
+
MatSelectModule,
|
611
|
+
MatButtonToggleModule,
|
612
|
+
FsListModule,
|
613
|
+
FsDateModule,
|
614
|
+
FsFormModule,
|
615
|
+
FsLabelModule,
|
616
|
+
FsSkeletonModule,
|
617
|
+
FsHtmlEditorModule,
|
618
|
+
FsDialogModule,
|
619
|
+
FsTextEditorModule,
|
620
|
+
FsContentEditorModule], exports: [FsContentLayoutsComponent] });
|
621
|
+
FsContentLayoutsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsContentLayoutsModule, imports: [[
|
622
|
+
CommonModule,
|
623
|
+
FormsModule,
|
624
|
+
FlexLayoutModule,
|
625
|
+
MatDialogModule,
|
626
|
+
MatInputModule,
|
627
|
+
MatFormFieldModule,
|
628
|
+
MatButtonModule,
|
629
|
+
MatTabsModule,
|
630
|
+
MatIconModule,
|
631
|
+
MatSelectModule,
|
632
|
+
MatButtonToggleModule,
|
633
|
+
FsListModule,
|
634
|
+
FsDateModule,
|
635
|
+
FsFormModule,
|
636
|
+
FsLabelModule,
|
637
|
+
FsSkeletonModule,
|
638
|
+
FsHtmlEditorModule,
|
639
|
+
FsDialogModule,
|
640
|
+
FsTextEditorModule,
|
641
|
+
FsContentEditorModule,
|
642
|
+
]] });
|
643
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsContentLayoutsModule, decorators: [{
|
644
|
+
type: NgModule,
|
645
|
+
args: [{
|
646
|
+
imports: [
|
647
|
+
CommonModule,
|
648
|
+
FormsModule,
|
649
|
+
FlexLayoutModule,
|
650
|
+
MatDialogModule,
|
651
|
+
MatInputModule,
|
652
|
+
MatFormFieldModule,
|
653
|
+
MatButtonModule,
|
654
|
+
MatTabsModule,
|
655
|
+
MatIconModule,
|
656
|
+
MatSelectModule,
|
657
|
+
MatButtonToggleModule,
|
658
|
+
FsListModule,
|
659
|
+
FsDateModule,
|
660
|
+
FsFormModule,
|
661
|
+
FsLabelModule,
|
662
|
+
FsSkeletonModule,
|
663
|
+
FsHtmlEditorModule,
|
664
|
+
FsDialogModule,
|
665
|
+
FsTextEditorModule,
|
666
|
+
FsContentEditorModule,
|
667
|
+
],
|
668
|
+
exports: [
|
669
|
+
FsContentLayoutsComponent,
|
670
|
+
],
|
671
|
+
declarations: [
|
672
|
+
ContentLayoutComponent,
|
673
|
+
FsContentLayoutsComponent,
|
674
|
+
],
|
675
|
+
}]
|
676
|
+
}] });
|
677
|
+
|
678
|
+
class ContentRendererComponent {
|
679
|
+
constructor(_sanitizer, _router, _el) {
|
680
|
+
this._sanitizer = _sanitizer;
|
681
|
+
this._router = _router;
|
682
|
+
this._el = _el;
|
683
|
+
this._destroy$ = new Subject();
|
684
|
+
}
|
685
|
+
set contentPage(contentPage) {
|
686
|
+
if (contentPage) {
|
687
|
+
this.content = this._sanitizer.bypassSecurityTrustHtml(contentPage.content);
|
688
|
+
this.styles = contentPage.styles;
|
689
|
+
}
|
690
|
+
}
|
691
|
+
ngAfterViewChecked() {
|
692
|
+
let el = document.querySelector('#contentPageStyles');
|
693
|
+
if (!el) {
|
694
|
+
el = document.createElement('style');
|
695
|
+
el.setAttribute('id', 'contentPageStyles');
|
696
|
+
document.getElementsByTagName('head')[0].appendChild(el);
|
697
|
+
}
|
698
|
+
el.innerHTML = this.styles;
|
699
|
+
this.registerHrefs();
|
700
|
+
}
|
701
|
+
registerHrefs() {
|
702
|
+
Array.from(this.el.querySelectorAll('a[href]'))
|
703
|
+
.filter((el) => {
|
704
|
+
return el.getAttribute('href').match(/^\//);
|
705
|
+
})
|
706
|
+
.forEach((el) => {
|
707
|
+
el.addEventListener('click', (event) => {
|
708
|
+
if (!event.shiftKey && !event.ctrlKey) {
|
709
|
+
event.preventDefault();
|
710
|
+
const href = el.getAttribute('href');
|
711
|
+
this._router.navigateByUrl(href);
|
712
|
+
}
|
713
|
+
});
|
714
|
+
});
|
715
|
+
}
|
716
|
+
get el() {
|
717
|
+
return this._el.nativeElement;
|
718
|
+
}
|
719
|
+
ngOnDestroy() {
|
720
|
+
this.removeStyles();
|
721
|
+
this._destroy$.next();
|
722
|
+
this._destroy$.complete();
|
723
|
+
}
|
724
|
+
removeStyles() {
|
725
|
+
const el = document.querySelector('#contentPageStyles');
|
726
|
+
if (el) {
|
727
|
+
el.remove();
|
728
|
+
}
|
729
|
+
}
|
730
|
+
}
|
731
|
+
ContentRendererComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ContentRendererComponent, deps: [{ token: i1$1.DomSanitizer }, { token: i2$2.Router }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
|
732
|
+
ContentRendererComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: ContentRendererComponent, selector: "fs-content-renderer", inputs: { contentPage: "contentPage" }, ngImport: i0, template: "<div *ngIf=\"content\" [innerHTML]=\"content\"></div>\n", styles: [""], directives: [{ type: i10.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
733
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ContentRendererComponent, decorators: [{
|
734
|
+
type: Component,
|
735
|
+
args: [{
|
736
|
+
selector: 'fs-content-renderer',
|
737
|
+
templateUrl: './content-renderer.component.html',
|
738
|
+
styleUrls: ['./content-renderer.component.scss'],
|
739
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
740
|
+
}]
|
741
|
+
}], ctorParameters: function () { return [{ type: i1$1.DomSanitizer }, { type: i2$2.Router }, { type: i0.ElementRef }]; }, propDecorators: { contentPage: [{
|
742
|
+
type: Input
|
743
|
+
}] } });
|
744
|
+
|
745
|
+
class FsContentComponent {
|
746
|
+
constructor(_config, _title, _cdRef, _router, _el) {
|
747
|
+
this._config = _config;
|
748
|
+
this._title = _title;
|
749
|
+
this._cdRef = _cdRef;
|
750
|
+
this._router = _router;
|
751
|
+
this._el = _el;
|
752
|
+
this._destroy$ = new Subject();
|
753
|
+
}
|
754
|
+
ngOnInit() {
|
755
|
+
this.load();
|
756
|
+
this._router.events
|
757
|
+
.pipe(filter((e) => e instanceof NavigationEnd), takeUntil(this._destroy$))
|
758
|
+
.subscribe(() => {
|
759
|
+
this.load();
|
760
|
+
});
|
761
|
+
}
|
762
|
+
load() {
|
763
|
+
const path = window.location.pathname;
|
764
|
+
this._config.loadContent(path)
|
765
|
+
.subscribe((contentPage) => {
|
766
|
+
this._title.setTitle(contentPage.title);
|
767
|
+
this.contentPage = contentPage;
|
768
|
+
this._cdRef.markForCheck();
|
769
|
+
});
|
770
|
+
}
|
771
|
+
get el() {
|
772
|
+
return this._el.nativeElement;
|
773
|
+
}
|
774
|
+
ngOnDestroy() {
|
775
|
+
this._destroy$.next();
|
776
|
+
this._destroy$.complete();
|
777
|
+
this._title.setTitle('');
|
778
|
+
}
|
779
|
+
}
|
780
|
+
FsContentComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsContentComponent, deps: [{ token: FS_CONTENT_CONFIG }, { token: i1$1.Title }, { token: i0.ChangeDetectorRef }, { token: i2$2.Router }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
|
781
|
+
FsContentComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FsContentComponent, selector: "fs-content", ngImport: i0, template: "<fs-content-renderer *ngIf=\"contentPage\" [contentPage]=\"contentPage\"></fs-content-renderer>", styles: [""], components: [{ type: ContentRendererComponent, selector: "fs-content-renderer", inputs: ["contentPage"] }], directives: [{ type: i10.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
782
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsContentComponent, decorators: [{
|
783
|
+
type: Component,
|
784
|
+
args: [{
|
785
|
+
selector: 'fs-content',
|
786
|
+
templateUrl: './content.component.html',
|
787
|
+
styleUrls: ['./content.component.scss'],
|
788
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
789
|
+
}]
|
790
|
+
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
791
|
+
type: Inject,
|
792
|
+
args: [FS_CONTENT_CONFIG]
|
793
|
+
}] }, { type: i1$1.Title }, { type: i0.ChangeDetectorRef }, { type: i2$2.Router }, { type: i0.ElementRef }]; } });
|
794
|
+
|
795
|
+
class FsContentModule {
|
796
|
+
}
|
797
|
+
FsContentModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsContentModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
798
|
+
FsContentModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsContentModule, declarations: [FsContentComponent,
|
799
|
+
ContentRendererComponent], imports: [CommonModule,
|
800
|
+
FsHtmlEditorModule], exports: [FsContentComponent] });
|
801
|
+
FsContentModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsContentModule, imports: [[
|
802
|
+
CommonModule,
|
803
|
+
FsHtmlEditorModule,
|
804
|
+
]] });
|
805
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FsContentModule, decorators: [{
|
806
|
+
type: NgModule,
|
807
|
+
args: [{
|
808
|
+
imports: [
|
809
|
+
CommonModule,
|
810
|
+
FsHtmlEditorModule,
|
811
|
+
],
|
812
|
+
exports: [
|
813
|
+
FsContentComponent,
|
814
|
+
],
|
815
|
+
declarations: [
|
816
|
+
FsContentComponent,
|
817
|
+
ContentRendererComponent,
|
818
|
+
],
|
819
|
+
}]
|
820
|
+
}] });
|
821
|
+
|
822
|
+
/**
|
823
|
+
* Generated bundle index. Do not edit.
|
824
|
+
*/
|
825
|
+
|
826
|
+
export { FS_CONTENT_CONFIG, FsContentComponent, FsContentLayoutsComponent, FsContentLayoutsModule, FsContentModule, FsContentPagesComponent, FsContentPagesModule };
|
827
|
+
//# sourceMappingURL=firestitch-content.js.map
|