@firestitch/content 12.0.0

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