@messaia/cdk-cms 0.0.1-rc01

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (70) hide show
  1. package/README.md +24 -0
  2. package/esm2020/lib/cms-routing.module.mjs +52 -0
  3. package/esm2020/lib/cms.module.mjs +134 -0
  4. package/esm2020/lib/comnponents/content-form/content-form.component.mjs +237 -0
  5. package/esm2020/lib/comnponents/document-dialog/document-dialog.component.mjs +91 -0
  6. package/esm2020/lib/comnponents/template-form/template-form.component.mjs +177 -0
  7. package/esm2020/lib/comnponents/template-preview-dialog/template-preview-dialog.component.mjs +126 -0
  8. package/esm2020/lib/enums/content-type.mjs +6 -0
  9. package/esm2020/lib/enums/document-type.mjs +8 -0
  10. package/esm2020/lib/enums/faq-scope.mjs +6 -0
  11. package/esm2020/lib/enums/template-type.mjs +6 -0
  12. package/esm2020/lib/enums/wrap-tag.mjs +9 -0
  13. package/esm2020/lib/models/cms-settings.mjs +12 -0
  14. package/esm2020/lib/models/content-variable.mjs +48 -0
  15. package/esm2020/lib/models/content.mjs +89 -0
  16. package/esm2020/lib/models/document.mjs +102 -0
  17. package/esm2020/lib/models/faq.mjs +71 -0
  18. package/esm2020/lib/models/template-preview.mjs +10 -0
  19. package/esm2020/lib/models/template.mjs +80 -0
  20. package/esm2020/lib/public-api.mjs +25 -0
  21. package/esm2020/lib/resolvers/excluded-columns.resolve.mjs +22 -0
  22. package/esm2020/lib/resolvers/excluded-fields.resolve.mjs +22 -0
  23. package/esm2020/lib/resolvers/includes.resolve.mjs +22 -0
  24. package/esm2020/lib/resolvers/settings.resolve.mjs +26 -0
  25. package/esm2020/lib/services/content-variable.service.mjs +27 -0
  26. package/esm2020/lib/services/content.service.mjs +34 -0
  27. package/esm2020/lib/services/document.generic-service.mjs +11 -0
  28. package/esm2020/lib/services/document.service`.mjs +25 -0
  29. package/esm2020/lib/services/faq.service.mjs +18 -0
  30. package/esm2020/lib/services/template-preview.service.mjs +18 -0
  31. package/esm2020/lib/services/template.service.mjs +18 -0
  32. package/esm2020/messaia-cdk-cms.mjs +5 -0
  33. package/esm2020/public_api.mjs +5 -0
  34. package/fesm2015/messaia-cdk-cms.mjs +1380 -0
  35. package/fesm2015/messaia-cdk-cms.mjs.map +1 -0
  36. package/fesm2020/messaia-cdk-cms.mjs +1367 -0
  37. package/fesm2020/messaia-cdk-cms.mjs.map +1 -0
  38. package/lib/cms-routing.module.d.ts +7 -0
  39. package/lib/cms.module.d.ts +40 -0
  40. package/lib/comnponents/content-form/content-form.component.d.ts +109 -0
  41. package/lib/comnponents/document-dialog/document-dialog.component.d.ts +47 -0
  42. package/lib/comnponents/template-form/template-form.component.d.ts +74 -0
  43. package/lib/comnponents/template-preview-dialog/template-preview-dialog.component.d.ts +68 -0
  44. package/lib/enums/content-type.d.ts +4 -0
  45. package/lib/enums/document-type.d.ts +6 -0
  46. package/lib/enums/faq-scope.d.ts +4 -0
  47. package/lib/enums/template-type.d.ts +4 -0
  48. package/lib/enums/wrap-tag.d.ts +7 -0
  49. package/lib/models/cms-settings.d.ts +10 -0
  50. package/lib/models/content-variable.d.ts +9 -0
  51. package/lib/models/content.d.ts +19 -0
  52. package/lib/models/document.d.ts +26 -0
  53. package/lib/models/faq.d.ts +14 -0
  54. package/lib/models/template-preview.d.ts +17 -0
  55. package/lib/models/template.d.ts +16 -0
  56. package/lib/public-api.d.ts +21 -0
  57. package/lib/resolvers/excluded-columns.resolve.d.ts +14 -0
  58. package/lib/resolvers/excluded-fields.resolve.d.ts +14 -0
  59. package/lib/resolvers/includes.resolve.d.ts +14 -0
  60. package/lib/resolvers/settings.resolve.d.ts +15 -0
  61. package/lib/services/content-variable.service.d.ts +17 -0
  62. package/lib/services/content.service.d.ts +23 -0
  63. package/lib/services/document.generic-service.d.ts +9 -0
  64. package/lib/services/document.service`.d.ts +17 -0
  65. package/lib/services/faq.service.d.ts +11 -0
  66. package/lib/services/template-preview.service.d.ts +11 -0
  67. package/lib/services/template.service.d.ts +11 -0
  68. package/messaia-cdk-cms.d.ts +5 -0
  69. package/package.json +33 -0
  70. package/public_api.d.ts +1 -0
@@ -0,0 +1,1380 @@
1
+ import * as i9$1 from '@angular/common';
2
+ import { CommonModule } from '@angular/common';
3
+ import * as i0 from '@angular/core';
4
+ import { Injectable, Component, ViewChild, Inject, ViewEncapsulation, NgModule } from '@angular/core';
5
+ import * as i9 from '@angular/material/autocomplete';
6
+ import { MatAutocompleteModule } from '@angular/material/autocomplete';
7
+ import * as i4 from '@angular/material/button';
8
+ import { MatButtonModule } from '@angular/material/button';
9
+ import * as i8$1 from '@angular/material/card';
10
+ import { MatCardModule } from '@angular/material/card';
11
+ import * as i12 from '@angular/material/checkbox';
12
+ import { MatCheckboxModule } from '@angular/material/checkbox';
13
+ import * as i7 from '@angular/material/chips';
14
+ import { MatChipsModule } from '@angular/material/chips';
15
+ import * as i5 from '@angular/material/expansion';
16
+ import { MatExpansionModule } from '@angular/material/expansion';
17
+ import * as i8 from '@angular/material/icon';
18
+ import { MatIconModule } from '@angular/material/icon';
19
+ import * as i17 from '@angular/material/input';
20
+ import { MatInputModule } from '@angular/material/input';
21
+ import * as i7$1 from '@angular/material/progress-bar';
22
+ import { MatProgressBarModule } from '@angular/material/progress-bar';
23
+ import * as i11$1 from '@ctrl/ngx-codemirror';
24
+ import { CodemirrorModule } from '@ctrl/ngx-codemirror';
25
+ import * as i2 from '@messaia/cdk';
26
+ import { AuditEntity, prop, Column, Display, required, Table, GenericService, GenericReactiveFormComponent, AuthHelper, EnumService, ServiceLocator, SaveAction, BaseComponent, FormField, FormFieldType, Api, VdCommonModule, VdLayoutModule, VdMediaModule, VdFormsModule, VdSelectModule } from '@messaia/cdk';
27
+ import * as i14 from '@messaia/cdk-base';
28
+ import { VdDynamicListComponent, VdDynamicFormComponent, VdCdkBaseModule } from '@messaia/cdk-base';
29
+ import * as i11 from '@tinymce/tinymce-angular';
30
+ import { EditorModule } from '@tinymce/tinymce-angular';
31
+ import * as i3$1 from '@angular/router';
32
+ import { RouterModule } from '@angular/router';
33
+ import { ENTER, COMMA } from '@angular/cdk/keycodes';
34
+ import * as i3 from '@angular/common/http';
35
+ import { HttpEventType, HttpResponse } from '@angular/common/http';
36
+ import { __decorate, __metadata } from 'tslib';
37
+ import { map } from 'rxjs/operators';
38
+ import * as i6 from '@angular/material/form-field';
39
+ import * as i10 from '@angular/material/core';
40
+ import * as i10$1 from '@angular/forms';
41
+ import * as i4$1 from '@angular/material/dialog';
42
+ import { MAT_DIALOG_DATA } from '@angular/material/dialog';
43
+ import 'codemirror/addon/edit/closetag';
44
+ import 'codemirror/addon/edit/matchbrackets';
45
+ import 'codemirror/addon/selection/active-line';
46
+ import 'codemirror/mode/htmlmixed/htmlmixed';
47
+ import 'codemirror/mode/javascript/javascript';
48
+ import { saveAs } from 'file-saver';
49
+ import { of } from 'rxjs';
50
+
51
+ var ContentType;
52
+ (function (ContentType) {
53
+ ContentType[ContentType["Page"] = 1] = "Page";
54
+ ContentType[ContentType["Block"] = 2] = "Block";
55
+ })(ContentType || (ContentType = {}));
56
+
57
+ var WrapTag;
58
+ (function (WrapTag) {
59
+ WrapTag["None"] = "";
60
+ WrapTag["Section"] = "section";
61
+ WrapTag["Div"] = "div";
62
+ WrapTag["Address"] = "address";
63
+ WrapTag["Article"] = "article";
64
+ })(WrapTag || (WrapTag = {}));
65
+
66
+ class CmsSettings {
67
+ /**
68
+ * constructor
69
+ * @param init
70
+ */
71
+ constructor(init) {
72
+ this.multitenantable = false;
73
+ this.editorHeight = '700px';
74
+ Object.assign(this, init);
75
+ }
76
+ }
77
+
78
+ let Content = class Content extends AuditEntity {
79
+ constructor() {
80
+ super(...arguments);
81
+ this.wrapTag = WrapTag.Section;
82
+ this.showTitle = true;
83
+ this.default = false;
84
+ this.enabled = true;
85
+ }
86
+ };
87
+ __decorate([
88
+ prop(),
89
+ __metadata("design:type", Number)
90
+ ], Content.prototype, "type", void 0);
91
+ __decorate([
92
+ prop(),
93
+ __metadata("design:type", Number)
94
+ ], Content.prototype, "sectionId", void 0);
95
+ __decorate([
96
+ Column(),
97
+ Display($localize `:@@title:Title`),
98
+ required(),
99
+ __metadata("design:type", String)
100
+ ], Content.prototype, "title", void 0);
101
+ __decorate([
102
+ Column({ maxWidth: 190, showGtMd: true }),
103
+ Display($localize `:@@name:Name`),
104
+ required(),
105
+ __metadata("design:type", String)
106
+ ], Content.prototype, "name", void 0);
107
+ __decorate([
108
+ prop(),
109
+ __metadata("design:type", String)
110
+ ], Content.prototype, "aliases", void 0);
111
+ __decorate([
112
+ prop(),
113
+ __metadata("design:type", String)
114
+ ], Content.prototype, "body", void 0);
115
+ __decorate([
116
+ prop(),
117
+ __metadata("design:type", String)
118
+ ], Content.prototype, "wrapTag", void 0);
119
+ __decorate([
120
+ prop(),
121
+ __metadata("design:type", String)
122
+ ], Content.prototype, "layout", void 0);
123
+ __decorate([
124
+ prop(),
125
+ __metadata("design:type", Boolean)
126
+ ], Content.prototype, "showTitle", void 0);
127
+ __decorate([
128
+ Column({
129
+ name: 'client.displayName',
130
+ endpoint: 'client?enabled=true&projection=id,name',
131
+ maxWidth: 190,
132
+ showGtLg: true
133
+ }),
134
+ Display($localize `:@@client:Client`),
135
+ prop(),
136
+ __metadata("design:type", Number)
137
+ ], Content.prototype, "clientId", void 0);
138
+ __decorate([
139
+ prop(),
140
+ __metadata("design:type", Boolean)
141
+ ], Content.prototype, "default", void 0);
142
+ __decorate([
143
+ Column({ header: $localize `:@@enabled:Enabled`, event: 'toggle' }),
144
+ prop(),
145
+ __metadata("design:type", Boolean)
146
+ ], Content.prototype, "enabled", void 0);
147
+ __decorate([
148
+ prop(),
149
+ __metadata("design:type", String)
150
+ ], Content.prototype, "script", void 0);
151
+ __decorate([
152
+ prop(),
153
+ __metadata("design:type", String)
154
+ ], Content.prototype, "style", void 0);
155
+ Content = __decorate([
156
+ Table({
157
+ endpoint: 'content',
158
+ duplicable: true
159
+ })
160
+ ], Content);
161
+
162
+ class ContentService extends GenericService {
163
+ /**
164
+ * Constructor
165
+ */
166
+ constructor() {
167
+ super('content');
168
+ }
169
+ /**
170
+ * Checks if the specified alias is available.
171
+ * @param id
172
+ * @param alias
173
+ */
174
+ isAliasAvailable(item) {
175
+ return this.create(item, '/isAliasAvailable').pipe(map((x) => x.value));
176
+ }
177
+ /**
178
+ * Duplicates a tariff
179
+ * @param id
180
+ */
181
+ duplicate(id) {
182
+ return this.create(null, `/duplicate/${id}`);
183
+ }
184
+ }
185
+ ContentService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: ContentService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
186
+ ContentService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: ContentService, providedIn: 'root' });
187
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: ContentService, decorators: [{
188
+ type: Injectable,
189
+ args: [{ providedIn: 'root' }]
190
+ }], ctorParameters: function () { return []; } });
191
+
192
+ class ContentFormComponent extends GenericReactiveFormComponent {
193
+ /**
194
+ * Constructor
195
+ */
196
+ constructor(service, fileService, httpClient, route, changeDetectorRef) {
197
+ super(Content, service, route, changeDetectorRef);
198
+ this.service = service;
199
+ this.fileService = fileService;
200
+ this.httpClient = httpClient;
201
+ this.route = route;
202
+ this.changeDetectorRef = changeDetectorRef;
203
+ /**
204
+ * Used to disable some properties for client manager
205
+ */
206
+ this.isClientAdmin = AuthHelper.hasRole('ClientAdministrator') || AuthHelper.hasRole('ClientManager');
207
+ /**
208
+ * Content status
209
+ */
210
+ this.ContentType = ContentType;
211
+ /**
212
+ * Wrap tag enum
213
+ */
214
+ this.wrapTags = EnumService.toArray(WrapTag);
215
+ /**
216
+ * Separator keys codes
217
+ */
218
+ this.separatorKeysCodes = [ENTER, COMMA];
219
+ this.settings = ServiceLocator.getService(CmsSettings);
220
+ }
221
+ /**
222
+ * Gets the aliases control
223
+ */
224
+ get aliasesControl() { return this.form.controls.aliases; }
225
+ /**
226
+ * Lifecycle hook that is called after data-bound properties
227
+ * of a directive are initialized.
228
+ */
229
+ ngOnInit() {
230
+ /* Filter by status, if any */
231
+ this.routeSubscription = this.route.params.subscribe((params) => {
232
+ this.type = EnumService.parse(ContentType, params.type);
233
+ });
234
+ super.ngOnInit();
235
+ }
236
+ /**
237
+ * Checks if the specified alias is available.
238
+ */
239
+ isAliasAvailable() {
240
+ this.service.isAliasAvailable(this.item).subscribe((x) => {
241
+ this.formElement.form.controls['alias'].setErrors(x ? null : { 'inUse': true });
242
+ });
243
+ }
244
+ /**
245
+ * Set client
246
+ */
247
+ setClient() {
248
+ var _a, _b;
249
+ this.isEditorInitialzed = false;
250
+ this.configEditor();
251
+ (_b = (_a = this.editorComponent) === null || _a === void 0 ? void 0 : _a.editor) === null || _b === void 0 ? void 0 : _b.setContent(this.item.body);
252
+ }
253
+ /**
254
+ * Add a aliases to the current field
255
+ * @param event
256
+ */
257
+ addAliases(event) {
258
+ /* Add our aliass */
259
+ if ((event.value || '').trim()) {
260
+ this.aliasesControl.setValue([...this.aliasesControl.value, event.value.trim()]);
261
+ this.aliasesControl.updateValueAndValidity();
262
+ this.aliasesControl.markAsDirty();
263
+ }
264
+ /* Reset the input value */
265
+ if (event.input) {
266
+ event.input.value = '';
267
+ }
268
+ }
269
+ /**
270
+ * Removes a aliases
271
+ * @param aliass
272
+ */
273
+ removeAliases(aliass) {
274
+ const index = this.aliasesControl.value.indexOf(aliass);
275
+ if (index >= 0) {
276
+ this.aliasesControl.value.splice(index, 1);
277
+ this.aliasesControl.updateValueAndValidity();
278
+ this.aliasesControl.markAsDirty();
279
+ }
280
+ }
281
+ /**
282
+ * Creates a new instance of the Template
283
+ */
284
+ newInstance() {
285
+ let item = Object.assign(new Content(), {
286
+ type: this.type,
287
+ wrapTag: this.type == ContentType.Block ? '' : WrapTag.Section,
288
+ showTitle: this.type == ContentType.Block ? false : true
289
+ });
290
+ /* Get clientId */
291
+ if (!this.isEditMode && this.isClientAdmin) {
292
+ item.clientId = this.currentUser.clientId;
293
+ }
294
+ /* Init the tinymce editor */
295
+ this.isEditorInitialzed = false;
296
+ return item;
297
+ }
298
+ /**
299
+ * Event emitted when the form has built.
300
+ */
301
+ onAfterFormBuild() {
302
+ super.onAfterFormBuild();
303
+ this.configEditor();
304
+ }
305
+ /**
306
+ * Configures the tinymce editor
307
+ */
308
+ configEditor() {
309
+ var _a, _b, _c;
310
+ if (((_a = this.settings) === null || _a === void 0 ? void 0 : _a.multitenantable) && ((_b = this.formValue) === null || _b === void 0 ? void 0 : _b.clientId) && ((_c = this.settings) === null || _c === void 0 ? void 0 : _c.styleUrlEndpoint)) {
311
+ this.httpClient.get(this.settings.styleUrlEndpoint(this.formValue.clientId)).subscribe((x) => {
312
+ super.initEditor(Object.assign(this.getEditorConfig(), { content_css: x.value }));
313
+ });
314
+ }
315
+ else {
316
+ super.initEditor(this.getEditorConfig());
317
+ }
318
+ }
319
+ /**
320
+ * Creates config for the editor
321
+ * @returns
322
+ */
323
+ getEditorConfig() {
324
+ var _a;
325
+ return {
326
+ toolbar: `${this.editorToolbar} snippetsButton`,
327
+ force_p_newlines: false,
328
+ forced_root_block: '',
329
+ height: ((_a = this.settings) === null || _a === void 0 ? void 0 : _a.editorHeight) || '700px',
330
+ file_picker_types: 'file image media',
331
+ image_advtab: true,
332
+ images_upload_base_path: `${this.appSetting.apiUrl}file/`,
333
+ images_upload_url: 'backend/api/files',
334
+ allow_html_in_named_anchor: true,
335
+ valid_children: '+a[div|span|img|h1|h2|h3|h4|h5|h6|br|hr|video],+span[i]',
336
+ valid_elements: '*[*]',
337
+ images_upload_handler: (blobInfo, success, failure) => {
338
+ var _a, _b;
339
+ this.fileService.upload(blobInfo.blob(), `upload`, {
340
+ clientId: (_b = (_a = this.form) === null || _a === void 0 ? void 0 : _a.value) === null || _b === void 0 ? void 0 : _b.clientId,
341
+ path: 'images',
342
+ isPublic: true
343
+ }).subscribe(event => {
344
+ if (event.type === HttpEventType.UploadProgress) {
345
+ /* Calculate the progress percentage */
346
+ const percentDone = Math.round(100 * event.loaded / event.total);
347
+ /* Pass the percentage into the progress-stream */
348
+ console.info(percentDone);
349
+ }
350
+ else if (event instanceof HttpResponse) {
351
+ success(event.body.publicLink);
352
+ }
353
+ });
354
+ },
355
+ setup: function (editor) {
356
+ /* Add snippets button to the toolbar */
357
+ editor.ui.registry.addMenuButton('snippetsButton', {
358
+ text: 'Snippets',
359
+ fetch: function (callback) {
360
+ callback([
361
+ {
362
+ type: 'menuitem',
363
+ text: 'Variable',
364
+ onAction: () => editor.insertContent('{{var name}}')
365
+ },
366
+ {
367
+ type: 'menuitem',
368
+ text: 'Block',
369
+ onAction: () => editor.insertContent('{{block name="..."}}')
370
+ },
371
+ {
372
+ type: 'menuitem',
373
+ text: 'View Component',
374
+ onAction: () => editor.insertContent('{{vc name="..."}}')
375
+ },
376
+ ]);
377
+ }
378
+ });
379
+ }
380
+ };
381
+ }
382
+ /**
383
+ * Cleanup subscriptions when this component is destroyed.
384
+ */
385
+ ngOnDestroy() {
386
+ if (this.routeSubscription) {
387
+ this.routeSubscription.unsubscribe();
388
+ }
389
+ }
390
+ }
391
+ ContentFormComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: ContentFormComponent, deps: [{ token: ContentService }, { token: i2.FileService }, { token: i3.HttpClient }, { token: i3$1.ActivatedRoute }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
392
+ ContentFormComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.0", type: ContentFormComponent, selector: "app-content-form", viewQueries: [{ propertyName: "formElement", first: true, predicate: ["form"], descendants: true }, { propertyName: "editorComponent", first: true, predicate: ["editor"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<vd-layout-nav color=\"primary\" [backNavigationRoute]=\"listRoute\" toolbarTitle=\"Content\" i18n-toolbarTitle [editMode]=\"isEditMode\" [menuItems]=\"toolbarMenuItems\" (reload)=\"reloadPage()\">\r\n\t<form *ngIf=\"form\" [formGroup]=\"form\" novalidate (ngSubmit)=\"save()\">\r\n\t\t<vd-layout-card-over class=\"accordion\" cardWidth=\"70\" color=\"primary\" flex>\r\n\t\t\t<mat-accordion [multi]=\"!isEditMode\">\r\n\t\t\t\t<!-- #region Details -->\r\n\t\t\t\t<mat-expansion-panel expanded=\"true\" id=\"details\">\r\n\t\t\t\t\t<mat-expansion-panel-header>\r\n\t\t\t\t\t\t<mat-panel-title i18n>Details</mat-panel-title>\r\n\t\t\t\t\t</mat-expansion-panel-header>\r\n\r\n\t\t\t\t\t<!-- #region Client-->\r\n\t\t\t\t\t<div layout-gt-sm=\"row\" layout=\"column\" *ngIf=\"settings?.multitenantable && !isClientAdmin\">\r\n\t\t\t\t\t\t<mat-form-field flex layout-margin appearance=\"outline\">\r\n\t\t\t\t\t\t\t<mat-label i18n>Client</mat-label>\r\n\t\t\t\t\t\t\t<vd-select formControlName=\"clientId\" endpoint=\"client?enabled=true\" layout=\"column\" (change)=\"setClient()\" [required]=\"!item.default\" flex></vd-select>\r\n\t\t\t\t\t\t\t<mat-error *ngFor=\"let errorMessage of form.controls.clientId['errorMessages']\">{{errorMessage}}</mat-error>\r\n\t\t\t\t\t\t</mat-form-field>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t\t<!-- #endregion -->\r\n\r\n\t\t\t\t\t<!-- #region Title -->\r\n\t\t\t\t\t<div layout=\"row\" flex>\r\n\t\t\t\t\t\t<mat-form-field flex layout-margin appearance=\"outline\">\r\n\t\t\t\t\t\t\t<mat-label i18n>Title</mat-label>\r\n\t\t\t\t\t\t\t<input matInput formControlName=\"title\">\r\n\t\t\t\t\t\t\t<mat-error *ngFor=\"let errorMessage of form.controls.title['errorMessages']\">{{errorMessage}}</mat-error>\r\n\t\t\t\t\t\t</mat-form-field>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t\t<!-- #endregion -->\r\n\r\n\t\t\t\t\t<!-- #region Name & Alias -->\r\n\t\t\t\t\t<div layout=\"row\" flex>\r\n\t\t\t\t\t\t<mat-form-field flex layout-margin appearance=\"outline\">\r\n\t\t\t\t\t\t\t<mat-label i18n>Name</mat-label>\r\n\t\t\t\t\t\t\t<input matInput formControlName=\"name\">\r\n\t\t\t\t\t\t\t<mat-error *ngFor=\"let errorMessage of form.controls.name['errorMessages']\">{{errorMessage}}</mat-error>\r\n\t\t\t\t\t\t</mat-form-field>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t\t<!-- #endregion -->\r\n\r\n\t\t\t\t\t<!-- #region Aliases -->\r\n\t\t\t\t\t<div layout=\"row\" flex>\r\n\t\t\t\t\t\t<mat-form-field flex layout-margin appearance=\"outline\">\r\n\t\t\t\t\t\t\t<mat-label>Aliases</mat-label>\r\n\t\t\t\t\t\t\t<mat-chip-list #chipList formControlName=\"aliases\">\r\n\t\t\t\t\t\t\t\t<mat-chip *ngFor=\"let alias of form.controls.aliases.value\" (removed)=\"removeAliases(alias)\">\r\n\t\t\t\t\t\t\t\t\t<span>{{alias}}</span>\r\n\t\t\t\t\t\t\t\t\t<mat-icon matChipRemove>cancel</mat-icon>\r\n\t\t\t\t\t\t\t\t</mat-chip>\r\n\t\t\t\t\t\t\t\t<input type=\"text\" [matChipInputFor]=\"chipList\" [matChipInputSeparatorKeyCodes]=\"separatorKeysCodes\" matChipInputAddOnBlur=\"true\" (matChipInputTokenEnd)=\"addAliases($event)\">\r\n\t\t\t\t\t\t\t</mat-chip-list>\r\n\t\t\t\t\t\t</mat-form-field>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t\t<!-- #endregion -->\r\n\r\n\t\t\t\t\t<!-- #region wrap tag and layout -->\r\n\t\t\t\t\t<div layout=\"row\" flex>\r\n\t\t\t\t\t\t<mat-form-field flex layout-margin appearance=\"outline\" *ngIf=\"type != ContentType.Block\">\r\n\t\t\t\t\t\t\t<mat-label i18n>Wrap</mat-label>\r\n\t\t\t\t\t\t\t<input matInput formControlName=\"wrapTag\">\r\n\t\t\t\t\t\t\t<mat-autocomplete #wrapTagsAutocomplete=\"matAutocomplete\">\r\n\t\t\t\t\t\t\t\t<mat-option *ngFor=\"let option of wrapTags\" [value]=\"option.name\">{{option.name}}</mat-option>\r\n\t\t\t\t\t\t\t</mat-autocomplete>\r\n\t\t\t\t\t\t\t<mat-error *ngFor=\"let errorMessage of form.controls.wrapTag['errorMessages']\">{{errorMessage}}</mat-error>\r\n\t\t\t\t\t\t</mat-form-field>\r\n\r\n\t\t\t\t\t\t<mat-form-field flex layout-margin appearance=\"outline\">\r\n\t\t\t\t\t\t\t<mat-label>Layout</mat-label>\r\n\t\t\t\t\t\t\t<input matInput formControlName=\"layout\">\r\n\t\t\t\t\t\t\t<mat-error *ngFor=\"let errorMessage of form.controls.layout['errorMessages']\">{{errorMessage}}</mat-error>\r\n\t\t\t\t\t\t</mat-form-field>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t\t<!-- #endregion -->\r\n\t\t\t\t\t<!-- *ngIf=\"item.clientId && isEditorInitialzed\" -->\r\n\t\t\t\t\t<!-- #region Body -->\r\n\t\t\t\t\t<div layout-gt-sm=\"row\" layout=\"column\" *ngIf=\"isEditorInitialzed\">\r\n\t\t\t\t\t\t<mat-form-field flex layout-margin>\r\n\t\t\t\t\t\t\t<mat-label i18n>Content</mat-label>\r\n\t\t\t\t\t\t\t<editor #editor formControlName=\"body\" tinyMatFormControl [(init)]=\"editorConfig\" required></editor>\r\n\t\t\t\t\t\t\t<mat-error *ngFor=\"let errorMessage of form.controls.body['errorMessages']\">{{errorMessage}}</mat-error>\r\n\t\t\t\t\t\t</mat-form-field>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t\t<!-- #endregion -->\r\n\r\n\t\t\t\t\t<!-- #region Script -->\r\n\t\t\t\t\t<div layout=\"row\" flex>\r\n\t\t\t\t\t\t<mat-form-field flex layout-margin appearance=\"outline\">\r\n\t\t\t\t\t\t\t<mat-label>Script</mat-label>\r\n\t\t\t\t\t\t\t<textarea matInput autocomplete=\"off\" formControlName=\"script\"></textarea>\r\n\t\t\t\t\t\t\t<mat-error *ngFor=\"let errorMessage of form.controls.script['errorMessages']\">{{errorMessage}}</mat-error>\r\n\t\t\t\t\t\t</mat-form-field>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t\t<!-- #endregion -->\r\n\r\n\t\t\t\t\t<!-- #region Style -->\r\n\t\t\t\t\t<div layout=\"row\" flex>\r\n\t\t\t\t\t\t<mat-form-field flex layout-margin appearance=\"outline\">\r\n\t\t\t\t\t\t\t<mat-label>Style</mat-label>\r\n\t\t\t\t\t\t\t<textarea matInput autocomplete=\"off\" formControlName=\"style\"></textarea>\r\n\t\t\t\t\t\t\t<mat-error *ngFor=\"let errorMessage of form.controls.style['errorMessages']\">{{errorMessage}}</mat-error>\r\n\t\t\t\t\t\t</mat-form-field>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t\t<!-- #endregion -->\r\n\r\n\t\t\t\t\t<!-- #region Show title -->\r\n\t\t\t\t\t<div layout-gt-sm=\"row\" layout=\"column\">\r\n\t\t\t\t\t\t<div layout-margin appearance=\"outline\" class=\"push-top\">\r\n\t\t\t\t\t\t\t<mat-checkbox formControlName=\"showTitle\" i18n>Show title</mat-checkbox>\r\n\t\t\t\t\t\t</div>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t\t<!-- #endregion -->\r\n\r\n\t\t\t\t\t<!-- #region Default -->\r\n\t\t\t\t\t<div layout-gt-sm=\"row\" layout=\"column\" *ngIf=\"!isClientAdmin\">\r\n\t\t\t\t\t\t<div layout-margin appearance=\"outline\">\r\n\t\t\t\t\t\t\t<mat-checkbox name=\"default\" formControlName=\"default\" (change)=\"item.clientId = item.default ? null : item.clientId\">Default</mat-checkbox>\r\n\t\t\t\t\t\t</div>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t\t<!-- #endregion -->\r\n\r\n\t\t\t\t\t<!-- #region Enabled -->\r\n\t\t\t\t\t<div layout-gt-sm=\"row\" layout=\"column\">\r\n\t\t\t\t\t\t<div layout-margin appearance=\"outline\" class=\"push-bottom\">\r\n\t\t\t\t\t\t\t<mat-checkbox name=\"enabled\" formControlName=\"enabled\" i18n>Active</mat-checkbox>\r\n\t\t\t\t\t\t</div>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t\t<!-- #endregion -->\r\n\r\n\t\t\t\t\t<mat-action-row>\r\n\t\t\t\t\t\t<button type=\"submit\" mat-flat-button color=\"primary\" [disabled]=\"isSaving\" i18n>Save</button>\r\n\t\t\t\t\t\t<button type=\"button\" mat-button *ngIf=\"isEditMode\" (click)=\"apply()\" [disabled]=\"isSaving\" i18n>Apply</button>\r\n\t\t\t\t\t\t<button type=\"button\" mat-button (click)=\"back()\" i18n>Cancel</button>\r\n\t\t\t\t\t\t<span flex></span>\r\n\t\t\t\t\t</mat-action-row>\r\n\t\t\t\t</mat-expansion-panel>\r\n\t\t\t\t<!-- #endregion -->\r\n\r\n\t\t\t\t<!-- #region Audit -->\r\n\t\t\t\t<mat-expansion-panel id=\"audit\" *ngIf=\"isEditMode\">\r\n\t\t\t\t\t<mat-expansion-panel-header>\r\n\t\t\t\t\t\t<mat-panel-title>\r\n\t\t\t\t\t\t\t<span i18n>Audit</span>\r\n\t\t\t\t\t\t</mat-panel-title>\r\n\t\t\t\t\t</mat-expansion-panel-header>\r\n\t\t\t\t\t<vd-audit [item]=\"item\"> </vd-audit>\r\n\t\t\t\t\t<mat-action-row>\r\n\t\t\t\t\t\t<button type=\"button\" mat-flat-button color=\"accent\" (click)=\"back()\" i18n>Close</button>\r\n\t\t\t\t\t\t<span flex></span>\r\n\t\t\t\t\t</mat-action-row>\r\n\t\t\t\t</mat-expansion-panel>\r\n\t\t\t\t<!-- #endregion -->\r\n\t\t\t</mat-accordion>\r\n\t\t</vd-layout-card-over>\r\n\t</form>\r\n</vd-layout-nav>", components: [{ type: i2.VdLayoutNavComponent, selector: "vd-layout-nav", inputs: ["toolbarTitle", "editMode", "menuItems", "icon", "logo", "color", "hideToggle", "backNavigationRoute", "navigationRoute"], outputs: ["reload"] }, { type: i2.VdLayoutCardOverComponent, selector: "vd-layout-card-over", inputs: ["cardTitle", "cardSubtitle", "cardWidth", "color"] }, { type: i5.MatExpansionPanel, selector: "mat-expansion-panel", inputs: ["disabled", "expanded", "hideToggle", "togglePosition"], outputs: ["opened", "closed", "expandedChange", "afterExpand", "afterCollapse"], exportAs: ["matExpansionPanel"] }, { type: i5.MatExpansionPanelHeader, selector: "mat-expansion-panel-header", inputs: ["tabIndex", "expandedHeight", "collapsedHeight"] }, { type: i6.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { type: i2.VdSelectComponent, selector: "vd-select", inputs: ["multiple", "disabled", "sorted", "textPrefix", "endpoint", "params", "projection", "enum", "key", "text", "prefix", "options", "filteredOptions", "filterable", "cache", "sortBy", "searchField"], outputs: ["change", "itemChange", "selected", "itemSelected", "launch"] }, { type: i7.MatChipList, selector: "mat-chip-list", inputs: ["errorStateMatcher", "multiple", "compareWith", "value", "required", "placeholder", "disabled", "aria-orientation", "selectable", "tabIndex"], outputs: ["change", "valueChange"], exportAs: ["matChipList"] }, { type: i8.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { type: i9.MatAutocomplete, selector: "mat-autocomplete", inputs: ["disableRipple"], exportAs: ["matAutocomplete"] }, { type: i10.MatOption, selector: "mat-option", exportAs: ["matOption"] }, { type: i11.EditorComponent, selector: "editor", inputs: ["cloudChannel", "apiKey", "id", "modelEvents", "disabled", "initialValue", "init", "inline", "outputFormat", "tagName", "plugins", "toolbar", "allowedEvents", "ignoreEvents"] }, { type: i12.MatCheckbox, selector: "mat-checkbox", inputs: ["disableRipple", "color", "tabIndex", "aria-label", "aria-labelledby", "aria-describedby", "id", "required", "labelPosition", "name", "value", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }, { type: i4.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { type: i14.VdAuditComponent, selector: "vd-audit", inputs: ["item"] }], directives: [{ type: i9$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i10$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i10$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i10$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i2.RxwebFormDirective, selector: "[formGroup],[rxwebForm]", inputs: ["formGroup", "rxwebForm"] }, { type: i5.MatAccordion, selector: "mat-accordion", inputs: ["multi", "hideToggle", "displayMode", "togglePosition"], exportAs: ["matAccordion"] }, { type: i5.MatExpansionPanelTitle, selector: "mat-panel-title" }, { type: i2.MatFormFieldReadonlyDirective, selector: "mat-form-field" }, { type: i6.MatLabel, selector: "mat-label" }, { type: i10$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i10$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { type: i2.AsyncValidationDirective, selector: "[ngModel],[formControlName],[formControl]", inputs: ["async"] }, { type: i2.RxFormControlDirective, selector: "[ngModel],[formControlName],[formControl]", inputs: ["rxalpha", "rxalphaNumeric", "rxascii", "rxcompare", "rxcompose", "rxcontains", "rxcreditCard", "rxdataUri", "rxdifferent", "rxdigit", "rxemail", "rxendsWith", "rxeven", "rxextension", "rxfactor", "rxfileSize", "rxgreaterThanEqualTo", "rxgreaterThan", "rxhexColor", "rxjson", "rxlatitude", "rxlatLong", "rxleapYear", "rxlessThan", "rxlessThanEqualTo", "rxlongitude", "rxlowerCase", "rxmac", "rxmaxDate", "rxmaxLength", "rxmaxNumber", "rxminDate", "rxminLength", "rxminNumber", "rxnumeric", "rxodd", "rxpassword", "rxport", "rxprimeNumber", "rxrequired", "rxrange", "rxrule", "rxstartsWith", "rxtime", "rxupperCase", "rxurl", "rxunique", "rxnotEmpty", "rxcusip", "rxgrid", "rxdate"] }, { type: i10$1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { type: i9$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i6.MatError, selector: "mat-error", inputs: ["id"] }, { type: i17.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { type: i10$1.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: i7.MatChip, selector: "mat-basic-chip, [mat-basic-chip], mat-chip, [mat-chip]", inputs: ["color", "disableRipple", "tabIndex", "selected", "value", "selectable", "disabled", "removable"], outputs: ["selectionChange", "destroyed", "removed"], exportAs: ["matChip"] }, { type: i7.MatChipRemove, selector: "[matChipRemove]" }, { type: i7.MatChipInput, selector: "input[matChipInputFor]", inputs: ["matChipInputFor", "matChipInputAddOnBlur", "matChipInputSeparatorKeyCodes", "placeholder", "id", "disabled"], outputs: ["matChipInputTokenEnd"], exportAs: ["matChipInput", "matChipInputFor"] }, { type: i2.MatFormFieldEditorDirective, selector: "[tinyMatFormControl]", inputs: ["disabled", "id", "placeholder", "required", "value", "errorStateMatcher"], outputs: ["editorChange"] }, { type: i5.MatExpansionPanelActionRow, selector: "mat-action-row" }] });
393
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: ContentFormComponent, decorators: [{
394
+ type: Component,
395
+ args: [{ selector: 'app-content-form', template: "<vd-layout-nav color=\"primary\" [backNavigationRoute]=\"listRoute\" toolbarTitle=\"Content\" i18n-toolbarTitle [editMode]=\"isEditMode\" [menuItems]=\"toolbarMenuItems\" (reload)=\"reloadPage()\">\r\n\t<form *ngIf=\"form\" [formGroup]=\"form\" novalidate (ngSubmit)=\"save()\">\r\n\t\t<vd-layout-card-over class=\"accordion\" cardWidth=\"70\" color=\"primary\" flex>\r\n\t\t\t<mat-accordion [multi]=\"!isEditMode\">\r\n\t\t\t\t<!-- #region Details -->\r\n\t\t\t\t<mat-expansion-panel expanded=\"true\" id=\"details\">\r\n\t\t\t\t\t<mat-expansion-panel-header>\r\n\t\t\t\t\t\t<mat-panel-title i18n>Details</mat-panel-title>\r\n\t\t\t\t\t</mat-expansion-panel-header>\r\n\r\n\t\t\t\t\t<!-- #region Client-->\r\n\t\t\t\t\t<div layout-gt-sm=\"row\" layout=\"column\" *ngIf=\"settings?.multitenantable && !isClientAdmin\">\r\n\t\t\t\t\t\t<mat-form-field flex layout-margin appearance=\"outline\">\r\n\t\t\t\t\t\t\t<mat-label i18n>Client</mat-label>\r\n\t\t\t\t\t\t\t<vd-select formControlName=\"clientId\" endpoint=\"client?enabled=true\" layout=\"column\" (change)=\"setClient()\" [required]=\"!item.default\" flex></vd-select>\r\n\t\t\t\t\t\t\t<mat-error *ngFor=\"let errorMessage of form.controls.clientId['errorMessages']\">{{errorMessage}}</mat-error>\r\n\t\t\t\t\t\t</mat-form-field>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t\t<!-- #endregion -->\r\n\r\n\t\t\t\t\t<!-- #region Title -->\r\n\t\t\t\t\t<div layout=\"row\" flex>\r\n\t\t\t\t\t\t<mat-form-field flex layout-margin appearance=\"outline\">\r\n\t\t\t\t\t\t\t<mat-label i18n>Title</mat-label>\r\n\t\t\t\t\t\t\t<input matInput formControlName=\"title\">\r\n\t\t\t\t\t\t\t<mat-error *ngFor=\"let errorMessage of form.controls.title['errorMessages']\">{{errorMessage}}</mat-error>\r\n\t\t\t\t\t\t</mat-form-field>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t\t<!-- #endregion -->\r\n\r\n\t\t\t\t\t<!-- #region Name & Alias -->\r\n\t\t\t\t\t<div layout=\"row\" flex>\r\n\t\t\t\t\t\t<mat-form-field flex layout-margin appearance=\"outline\">\r\n\t\t\t\t\t\t\t<mat-label i18n>Name</mat-label>\r\n\t\t\t\t\t\t\t<input matInput formControlName=\"name\">\r\n\t\t\t\t\t\t\t<mat-error *ngFor=\"let errorMessage of form.controls.name['errorMessages']\">{{errorMessage}}</mat-error>\r\n\t\t\t\t\t\t</mat-form-field>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t\t<!-- #endregion -->\r\n\r\n\t\t\t\t\t<!-- #region Aliases -->\r\n\t\t\t\t\t<div layout=\"row\" flex>\r\n\t\t\t\t\t\t<mat-form-field flex layout-margin appearance=\"outline\">\r\n\t\t\t\t\t\t\t<mat-label>Aliases</mat-label>\r\n\t\t\t\t\t\t\t<mat-chip-list #chipList formControlName=\"aliases\">\r\n\t\t\t\t\t\t\t\t<mat-chip *ngFor=\"let alias of form.controls.aliases.value\" (removed)=\"removeAliases(alias)\">\r\n\t\t\t\t\t\t\t\t\t<span>{{alias}}</span>\r\n\t\t\t\t\t\t\t\t\t<mat-icon matChipRemove>cancel</mat-icon>\r\n\t\t\t\t\t\t\t\t</mat-chip>\r\n\t\t\t\t\t\t\t\t<input type=\"text\" [matChipInputFor]=\"chipList\" [matChipInputSeparatorKeyCodes]=\"separatorKeysCodes\" matChipInputAddOnBlur=\"true\" (matChipInputTokenEnd)=\"addAliases($event)\">\r\n\t\t\t\t\t\t\t</mat-chip-list>\r\n\t\t\t\t\t\t</mat-form-field>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t\t<!-- #endregion -->\r\n\r\n\t\t\t\t\t<!-- #region wrap tag and layout -->\r\n\t\t\t\t\t<div layout=\"row\" flex>\r\n\t\t\t\t\t\t<mat-form-field flex layout-margin appearance=\"outline\" *ngIf=\"type != ContentType.Block\">\r\n\t\t\t\t\t\t\t<mat-label i18n>Wrap</mat-label>\r\n\t\t\t\t\t\t\t<input matInput formControlName=\"wrapTag\">\r\n\t\t\t\t\t\t\t<mat-autocomplete #wrapTagsAutocomplete=\"matAutocomplete\">\r\n\t\t\t\t\t\t\t\t<mat-option *ngFor=\"let option of wrapTags\" [value]=\"option.name\">{{option.name}}</mat-option>\r\n\t\t\t\t\t\t\t</mat-autocomplete>\r\n\t\t\t\t\t\t\t<mat-error *ngFor=\"let errorMessage of form.controls.wrapTag['errorMessages']\">{{errorMessage}}</mat-error>\r\n\t\t\t\t\t\t</mat-form-field>\r\n\r\n\t\t\t\t\t\t<mat-form-field flex layout-margin appearance=\"outline\">\r\n\t\t\t\t\t\t\t<mat-label>Layout</mat-label>\r\n\t\t\t\t\t\t\t<input matInput formControlName=\"layout\">\r\n\t\t\t\t\t\t\t<mat-error *ngFor=\"let errorMessage of form.controls.layout['errorMessages']\">{{errorMessage}}</mat-error>\r\n\t\t\t\t\t\t</mat-form-field>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t\t<!-- #endregion -->\r\n\t\t\t\t\t<!-- *ngIf=\"item.clientId && isEditorInitialzed\" -->\r\n\t\t\t\t\t<!-- #region Body -->\r\n\t\t\t\t\t<div layout-gt-sm=\"row\" layout=\"column\" *ngIf=\"isEditorInitialzed\">\r\n\t\t\t\t\t\t<mat-form-field flex layout-margin>\r\n\t\t\t\t\t\t\t<mat-label i18n>Content</mat-label>\r\n\t\t\t\t\t\t\t<editor #editor formControlName=\"body\" tinyMatFormControl [(init)]=\"editorConfig\" required></editor>\r\n\t\t\t\t\t\t\t<mat-error *ngFor=\"let errorMessage of form.controls.body['errorMessages']\">{{errorMessage}}</mat-error>\r\n\t\t\t\t\t\t</mat-form-field>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t\t<!-- #endregion -->\r\n\r\n\t\t\t\t\t<!-- #region Script -->\r\n\t\t\t\t\t<div layout=\"row\" flex>\r\n\t\t\t\t\t\t<mat-form-field flex layout-margin appearance=\"outline\">\r\n\t\t\t\t\t\t\t<mat-label>Script</mat-label>\r\n\t\t\t\t\t\t\t<textarea matInput autocomplete=\"off\" formControlName=\"script\"></textarea>\r\n\t\t\t\t\t\t\t<mat-error *ngFor=\"let errorMessage of form.controls.script['errorMessages']\">{{errorMessage}}</mat-error>\r\n\t\t\t\t\t\t</mat-form-field>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t\t<!-- #endregion -->\r\n\r\n\t\t\t\t\t<!-- #region Style -->\r\n\t\t\t\t\t<div layout=\"row\" flex>\r\n\t\t\t\t\t\t<mat-form-field flex layout-margin appearance=\"outline\">\r\n\t\t\t\t\t\t\t<mat-label>Style</mat-label>\r\n\t\t\t\t\t\t\t<textarea matInput autocomplete=\"off\" formControlName=\"style\"></textarea>\r\n\t\t\t\t\t\t\t<mat-error *ngFor=\"let errorMessage of form.controls.style['errorMessages']\">{{errorMessage}}</mat-error>\r\n\t\t\t\t\t\t</mat-form-field>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t\t<!-- #endregion -->\r\n\r\n\t\t\t\t\t<!-- #region Show title -->\r\n\t\t\t\t\t<div layout-gt-sm=\"row\" layout=\"column\">\r\n\t\t\t\t\t\t<div layout-margin appearance=\"outline\" class=\"push-top\">\r\n\t\t\t\t\t\t\t<mat-checkbox formControlName=\"showTitle\" i18n>Show title</mat-checkbox>\r\n\t\t\t\t\t\t</div>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t\t<!-- #endregion -->\r\n\r\n\t\t\t\t\t<!-- #region Default -->\r\n\t\t\t\t\t<div layout-gt-sm=\"row\" layout=\"column\" *ngIf=\"!isClientAdmin\">\r\n\t\t\t\t\t\t<div layout-margin appearance=\"outline\">\r\n\t\t\t\t\t\t\t<mat-checkbox name=\"default\" formControlName=\"default\" (change)=\"item.clientId = item.default ? null : item.clientId\">Default</mat-checkbox>\r\n\t\t\t\t\t\t</div>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t\t<!-- #endregion -->\r\n\r\n\t\t\t\t\t<!-- #region Enabled -->\r\n\t\t\t\t\t<div layout-gt-sm=\"row\" layout=\"column\">\r\n\t\t\t\t\t\t<div layout-margin appearance=\"outline\" class=\"push-bottom\">\r\n\t\t\t\t\t\t\t<mat-checkbox name=\"enabled\" formControlName=\"enabled\" i18n>Active</mat-checkbox>\r\n\t\t\t\t\t\t</div>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t\t<!-- #endregion -->\r\n\r\n\t\t\t\t\t<mat-action-row>\r\n\t\t\t\t\t\t<button type=\"submit\" mat-flat-button color=\"primary\" [disabled]=\"isSaving\" i18n>Save</button>\r\n\t\t\t\t\t\t<button type=\"button\" mat-button *ngIf=\"isEditMode\" (click)=\"apply()\" [disabled]=\"isSaving\" i18n>Apply</button>\r\n\t\t\t\t\t\t<button type=\"button\" mat-button (click)=\"back()\" i18n>Cancel</button>\r\n\t\t\t\t\t\t<span flex></span>\r\n\t\t\t\t\t</mat-action-row>\r\n\t\t\t\t</mat-expansion-panel>\r\n\t\t\t\t<!-- #endregion -->\r\n\r\n\t\t\t\t<!-- #region Audit -->\r\n\t\t\t\t<mat-expansion-panel id=\"audit\" *ngIf=\"isEditMode\">\r\n\t\t\t\t\t<mat-expansion-panel-header>\r\n\t\t\t\t\t\t<mat-panel-title>\r\n\t\t\t\t\t\t\t<span i18n>Audit</span>\r\n\t\t\t\t\t\t</mat-panel-title>\r\n\t\t\t\t\t</mat-expansion-panel-header>\r\n\t\t\t\t\t<vd-audit [item]=\"item\"> </vd-audit>\r\n\t\t\t\t\t<mat-action-row>\r\n\t\t\t\t\t\t<button type=\"button\" mat-flat-button color=\"accent\" (click)=\"back()\" i18n>Close</button>\r\n\t\t\t\t\t\t<span flex></span>\r\n\t\t\t\t\t</mat-action-row>\r\n\t\t\t\t</mat-expansion-panel>\r\n\t\t\t\t<!-- #endregion -->\r\n\t\t\t</mat-accordion>\r\n\t\t</vd-layout-card-over>\r\n\t</form>\r\n</vd-layout-nav>" }]
396
+ }], ctorParameters: function () { return [{ type: ContentService }, { type: i2.FileService }, { type: i3.HttpClient }, { type: i3$1.ActivatedRoute }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { formElement: [{
397
+ type: ViewChild,
398
+ args: ['form', { static: false }]
399
+ }], editorComponent: [{
400
+ type: ViewChild,
401
+ args: ['editor', { static: false }]
402
+ }] } });
403
+
404
+ let Document = class Document extends AuditEntity {
405
+ /**
406
+ * constructor
407
+ * @param init
408
+ */
409
+ constructor(init) {
410
+ super(init);
411
+ this.path = 'docs';
412
+ this.attachments = [];
413
+ Object.assign(this, init);
414
+ }
415
+ };
416
+ __decorate([
417
+ prop(),
418
+ __metadata("design:type", Number)
419
+ ], Document.prototype, "type", void 0);
420
+ __decorate([
421
+ Column({}),
422
+ Display($localize `:@@name:Name`),
423
+ required(),
424
+ __metadata("design:type", String)
425
+ ], Document.prototype, "name", void 0);
426
+ __decorate([
427
+ required(),
428
+ __metadata("design:type", String)
429
+ ], Document.prototype, "path", void 0);
430
+ __decorate([
431
+ prop(),
432
+ __metadata("design:type", String)
433
+ ], Document.prototype, "originalName", void 0);
434
+ __decorate([
435
+ prop(),
436
+ __metadata("design:type", String)
437
+ ], Document.prototype, "relativePath", void 0);
438
+ __decorate([
439
+ prop(),
440
+ __metadata("design:type", String)
441
+ ], Document.prototype, "fullPath", void 0);
442
+ __decorate([
443
+ prop(),
444
+ __metadata("design:type", Boolean)
445
+ ], Document.prototype, "isPublic", void 0);
446
+ __decorate([
447
+ Column({ maxWidth: 100, showGtLg: true }),
448
+ Display($localize `:@@type:Type`),
449
+ prop(),
450
+ __metadata("design:type", String)
451
+ ], Document.prototype, "extension", void 0);
452
+ __decorate([
453
+ Column({ maxWidth: 250, showGtLg: true }),
454
+ Display($localize `:@@link:Link`),
455
+ prop(),
456
+ __metadata("design:type", String)
457
+ ], Document.prototype, "publicLink", void 0);
458
+ __decorate([
459
+ prop(),
460
+ __metadata("design:type", Number)
461
+ ], Document.prototype, "size", void 0);
462
+ __decorate([
463
+ Column({
464
+ name: 'client.displayName',
465
+ header: $localize `:@@client:Client`,
466
+ endpoint: 'client?enabled=true&projection=id,name',
467
+ maxWidth: 250,
468
+ showGtXl: true
469
+ }),
470
+ required(),
471
+ __metadata("design:type", Number)
472
+ ], Document.prototype, "clientId", void 0);
473
+ __decorate([
474
+ prop(),
475
+ __metadata("design:type", Boolean)
476
+ ], Document.prototype, "preserveOriginalName", void 0);
477
+ __decorate([
478
+ prop(),
479
+ __metadata("design:type", Number)
480
+ ], Document.prototype, "customerId", void 0);
481
+ __decorate([
482
+ prop(),
483
+ __metadata("design:type", String)
484
+ ], Document.prototype, "subject", void 0);
485
+ __decorate([
486
+ prop(),
487
+ __metadata("design:type", String)
488
+ ], Document.prototype, "content", void 0);
489
+ __decorate([
490
+ prop(),
491
+ __metadata("design:type", Array)
492
+ ], Document.prototype, "attachments", void 0);
493
+ Document = __decorate([
494
+ Table({
495
+ endpoint: 'document',
496
+ editable: false,
497
+ downloadable: true
498
+ }),
499
+ __metadata("design:paramtypes", [Object])
500
+ ], Document);
501
+
502
+ class DocumentGenericService extends GenericService {
503
+ /**
504
+ * Constructor
505
+ * @param serviceName
506
+ */
507
+ constructor(serviceName) {
508
+ super(serviceName);
509
+ }
510
+ }
511
+
512
+ class DocumentService extends DocumentGenericService {
513
+ /**
514
+ * Constructor
515
+ */
516
+ constructor() {
517
+ super('document');
518
+ }
519
+ /**
520
+ * Sends an email to the customer
521
+ * @param id The ID of the document
522
+ */
523
+ sendMail(id) {
524
+ return this.update(`sendMail/${id}`, null);
525
+ }
526
+ }
527
+ DocumentService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DocumentService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
528
+ DocumentService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DocumentService, providedIn: 'root' });
529
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DocumentService, decorators: [{
530
+ type: Injectable,
531
+ args: [{ providedIn: 'root' }]
532
+ }], ctorParameters: function () { return []; } });
533
+
534
+ class DocumentDialogComponent extends GenericReactiveFormComponent {
535
+ /**
536
+ * Constructor
537
+ */
538
+ constructor(documentService, fileService, route, changeDetectorRef, dialogRef, item = new Document()) {
539
+ super(Document, documentService, route, changeDetectorRef);
540
+ this.documentService = documentService;
541
+ this.fileService = fileService;
542
+ this.route = route;
543
+ this.changeDetectorRef = changeDetectorRef;
544
+ this.dialogRef = dialogRef;
545
+ this.item = item;
546
+ /**
547
+ * Upload progress
548
+ */
549
+ this.uploadProgress = 0;
550
+ /**
551
+ * Used to disable some properties for client manager
552
+ */
553
+ this.isClientManager = AuthHelper.hasRole('ClientManager');
554
+ }
555
+ /**
556
+ * Uploads a new document
557
+ */
558
+ upload(file) {
559
+ var _a, _b, _c, _d, _e, _f;
560
+ if (file != null && this.item && this.item.clientId) {
561
+ this.isUploading = true;
562
+ this.fileService.upload(file, `upload`, {
563
+ clientId: (_b = (_a = this.form) === null || _a === void 0 ? void 0 : _a.value) === null || _b === void 0 ? void 0 : _b.clientId,
564
+ path: (_d = (_c = this.form) === null || _c === void 0 ? void 0 : _c.value) === null || _d === void 0 ? void 0 : _d.path,
565
+ isPublic: true,
566
+ preserveOriginalName: (_f = (_e = this.form) === null || _e === void 0 ? void 0 : _e.value) === null || _f === void 0 ? void 0 : _f.preserveOriginalName
567
+ }).subscribe(event => {
568
+ if (event.type === HttpEventType.UploadProgress) {
569
+ /* Calculate the progress percentage */
570
+ const percentDone = Math.round(100 * event.loaded / event.total);
571
+ /* Pass the percentage into the progress-stream */
572
+ this.uploadProgress = percentDone;
573
+ }
574
+ else if (event instanceof HttpResponse) {
575
+ this.form.patchValue(event.body);
576
+ this.isUploading = false;
577
+ }
578
+ }, _ => this.isUploading = true);
579
+ }
580
+ }
581
+ /**
582
+ * Event emitted after data submition
583
+ * @param action
584
+ * @param response
585
+ */
586
+ onAfterSubmit(action = SaveAction.SaveAndClose, response = null) {
587
+ this.isSaving = false;
588
+ this.cancel();
589
+ }
590
+ /**
591
+ * Closes the dialog
592
+ */
593
+ cancel() {
594
+ this.dialogRef.close();
595
+ }
596
+ }
597
+ DocumentDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DocumentDialogComponent, deps: [{ token: DocumentService }, { token: i2.FileService }, { token: i3$1.ActivatedRoute }, { token: i0.ChangeDetectorRef }, { token: i4$1.MatDialogRef }, { token: MAT_DIALOG_DATA }], target: i0.ɵɵFactoryTarget.Component });
598
+ DocumentDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.0", type: DocumentDialogComponent, selector: "document-dialog", usesInheritance: true, ngImport: i0, template: "<div mat-dialog-title class=\"mat-title\" i18n>New document</div>\r\n<form *ngIf=\"form\" [formGroup]=\"form\" (ngSubmit)=\"save()\">\r\n\t<div>\r\n\t\t<!-- #region Client-->\r\n\t\t<div layout-gt-sm=\"row\" layout=\"column\" *ngIf=\"!isClientAdmin\">\r\n\t\t\t<mat-form-field flex layout-margin appearance=\"outline\">\r\n\t\t\t\t<mat-label i18n>Client</mat-label>\r\n\t\t\t\t<vd-select formControlName=\"clientId\" endpoint=\"client?enabled=true\" projection=\"id,displayName\" text=\"displayName\" layout=\"column\" flex></vd-select>\r\n\t\t\t\t<mat-error *ngFor=\"let errorMessage of form.controls.clientId['errorMessages']\">{{errorMessage}}</mat-error>\r\n\t\t\t</mat-form-field>\r\n\t\t</div>\r\n\t\t<!-- #endregion -->\r\n\r\n\t\t<!-- #region Path -->\r\n\t\t<div layout-gt-sm=\"row\" layout=\"column\">\r\n\t\t\t<mat-form-field flex layout-margin appearance=\"outline\">\r\n\t\t\t\t<mat-label i18n>Type</mat-label>\r\n\t\t\t\t<mat-select formControlName=\"path\">\r\n\t\t\t\t\t<mat-option value=\"docs\"><span i18n>Document</span></mat-option>\r\n\t\t\t\t\t<mat-option value=\"images\"><span i18n>Image</span></mat-option>\r\n\t\t\t\t\t<mat-option value=\"videos\"><span>Video</span></mat-option>\r\n\t\t\t\t</mat-select>\r\n\t\t\t\t<mat-error *ngFor=\"let errorMessage of form.controls.path['errorMessages']\">{{errorMessage}}</mat-error>\r\n\t\t\t</mat-form-field>\r\n\t\t</div>\r\n\t\t<!-- #endregion-->\r\n\r\n\t\t<!-- #region PreserveOriginalName -->\r\n\t\t<div layout-gt-sm=\"row\" layout=\"column\" *ngIf=\"!isClientAdmin\">\r\n\t\t\t<div layout-margin appearance=\"outline\">\r\n\t\t\t\t<mat-checkbox name=\"preserveOriginalName\" formControlName=\"preserveOriginalName\" (change)=\"item.name = ''\" i18n>Preserve original name</mat-checkbox>\r\n\t\t\t\t<br />\r\n\t\t\t\t<mat-hint *ngIf=\"form?.value?.preserveOriginalName\" class=\"tc-red-500\" i18n>Warning: old files will be overridden</mat-hint>\r\n\t\t\t</div>\r\n\t\t</div>\r\n\t\t<!-- #endregion -->\r\n\r\n\t\t<!-- #region File -->\r\n\t\t<div layout-gt-sm=\"row\" layout=\"column\">\r\n\t\t\t<mat-form-field flex layout-margin appearance=\"outline\">\r\n\t\t\t\t<mat-label i18n>File</mat-label>\r\n\t\t\t\t<div vd-file-input formControlName=\"name\" (select)=\"upload($event)\" required></div>\r\n\t\t\t</mat-form-field>\r\n\t\t</div>\r\n\t\t<!-- #endregion -->\r\n\t</div>\r\n\t<div mat-dialog-actions class=\"pad-top\">\r\n\t\t<button type=\"submit\" mat-flat-button [disabled]=\"form. isSaving\" color=\"primary\" i18n>Save</button>\r\n\t\t<button type=\"button\" mat-button (click)=\"cancel()\" i18n>Cancel</button>\r\n\t</div>\r\n</form>", components: [{ type: i6.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { type: i2.VdSelectComponent, selector: "vd-select", inputs: ["multiple", "disabled", "sorted", "textPrefix", "endpoint", "params", "projection", "enum", "key", "text", "prefix", "options", "filteredOptions", "filterable", "cache", "sortBy", "searchField"], outputs: ["change", "itemChange", "selected", "itemSelected", "launch"] }, { type: i10.MatOption, selector: "mat-option", exportAs: ["matOption"] }, { type: i12.MatCheckbox, selector: "mat-checkbox", inputs: ["disableRipple", "color", "tabIndex", "aria-label", "aria-labelledby", "aria-describedby", "id", "required", "labelPosition", "name", "value", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }, { type: i2.VdFileInputComponent, selector: "[vd-file-input]", inputs: ["accept", "placeholder", "required", "multiple", "disabled", "errorState"], outputs: ["select", "clear"] }, { type: i4.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }], directives: [{ type: i9$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i10$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i10$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i10$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i2.RxwebFormDirective, selector: "[formGroup],[rxwebForm]", inputs: ["formGroup", "rxwebForm"] }, { type: i2.MatFormFieldReadonlyDirective, selector: "mat-form-field" }, { type: i6.MatLabel, selector: "mat-label" }, { type: i10$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i10$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { type: i2.AsyncValidationDirective, selector: "[ngModel],[formControlName],[formControl]", inputs: ["async"] }, { type: i2.RxFormControlDirective, selector: "[ngModel],[formControlName],[formControl]", inputs: ["rxalpha", "rxalphaNumeric", "rxascii", "rxcompare", "rxcompose", "rxcontains", "rxcreditCard", "rxdataUri", "rxdifferent", "rxdigit", "rxemail", "rxendsWith", "rxeven", "rxextension", "rxfactor", "rxfileSize", "rxgreaterThanEqualTo", "rxgreaterThan", "rxhexColor", "rxjson", "rxlatitude", "rxlatLong", "rxleapYear", "rxlessThan", "rxlessThanEqualTo", "rxlongitude", "rxlowerCase", "rxmac", "rxmaxDate", "rxmaxLength", "rxmaxNumber", "rxminDate", "rxminLength", "rxminNumber", "rxnumeric", "rxodd", "rxpassword", "rxport", "rxprimeNumber", "rxrequired", "rxrange", "rxrule", "rxstartsWith", "rxtime", "rxupperCase", "rxurl", "rxunique", "rxnotEmpty", "rxcusip", "rxgrid", "rxdate"] }, { type: i9$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i6.MatError, selector: "mat-error", inputs: ["id"] }, { type: i6.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { type: i10$1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }] });
599
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DocumentDialogComponent, decorators: [{
600
+ type: Component,
601
+ args: [{ selector: 'document-dialog', template: "<div mat-dialog-title class=\"mat-title\" i18n>New document</div>\r\n<form *ngIf=\"form\" [formGroup]=\"form\" (ngSubmit)=\"save()\">\r\n\t<div>\r\n\t\t<!-- #region Client-->\r\n\t\t<div layout-gt-sm=\"row\" layout=\"column\" *ngIf=\"!isClientAdmin\">\r\n\t\t\t<mat-form-field flex layout-margin appearance=\"outline\">\r\n\t\t\t\t<mat-label i18n>Client</mat-label>\r\n\t\t\t\t<vd-select formControlName=\"clientId\" endpoint=\"client?enabled=true\" projection=\"id,displayName\" text=\"displayName\" layout=\"column\" flex></vd-select>\r\n\t\t\t\t<mat-error *ngFor=\"let errorMessage of form.controls.clientId['errorMessages']\">{{errorMessage}}</mat-error>\r\n\t\t\t</mat-form-field>\r\n\t\t</div>\r\n\t\t<!-- #endregion -->\r\n\r\n\t\t<!-- #region Path -->\r\n\t\t<div layout-gt-sm=\"row\" layout=\"column\">\r\n\t\t\t<mat-form-field flex layout-margin appearance=\"outline\">\r\n\t\t\t\t<mat-label i18n>Type</mat-label>\r\n\t\t\t\t<mat-select formControlName=\"path\">\r\n\t\t\t\t\t<mat-option value=\"docs\"><span i18n>Document</span></mat-option>\r\n\t\t\t\t\t<mat-option value=\"images\"><span i18n>Image</span></mat-option>\r\n\t\t\t\t\t<mat-option value=\"videos\"><span>Video</span></mat-option>\r\n\t\t\t\t</mat-select>\r\n\t\t\t\t<mat-error *ngFor=\"let errorMessage of form.controls.path['errorMessages']\">{{errorMessage}}</mat-error>\r\n\t\t\t</mat-form-field>\r\n\t\t</div>\r\n\t\t<!-- #endregion-->\r\n\r\n\t\t<!-- #region PreserveOriginalName -->\r\n\t\t<div layout-gt-sm=\"row\" layout=\"column\" *ngIf=\"!isClientAdmin\">\r\n\t\t\t<div layout-margin appearance=\"outline\">\r\n\t\t\t\t<mat-checkbox name=\"preserveOriginalName\" formControlName=\"preserveOriginalName\" (change)=\"item.name = ''\" i18n>Preserve original name</mat-checkbox>\r\n\t\t\t\t<br />\r\n\t\t\t\t<mat-hint *ngIf=\"form?.value?.preserveOriginalName\" class=\"tc-red-500\" i18n>Warning: old files will be overridden</mat-hint>\r\n\t\t\t</div>\r\n\t\t</div>\r\n\t\t<!-- #endregion -->\r\n\r\n\t\t<!-- #region File -->\r\n\t\t<div layout-gt-sm=\"row\" layout=\"column\">\r\n\t\t\t<mat-form-field flex layout-margin appearance=\"outline\">\r\n\t\t\t\t<mat-label i18n>File</mat-label>\r\n\t\t\t\t<div vd-file-input formControlName=\"name\" (select)=\"upload($event)\" required></div>\r\n\t\t\t</mat-form-field>\r\n\t\t</div>\r\n\t\t<!-- #endregion -->\r\n\t</div>\r\n\t<div mat-dialog-actions class=\"pad-top\">\r\n\t\t<button type=\"submit\" mat-flat-button [disabled]=\"form. isSaving\" color=\"primary\" i18n>Save</button>\r\n\t\t<button type=\"button\" mat-button (click)=\"cancel()\" i18n>Cancel</button>\r\n\t</div>\r\n</form>" }]
602
+ }], ctorParameters: function () {
603
+ return [{ type: DocumentService }, { type: i2.FileService }, { type: i3$1.ActivatedRoute }, { type: i0.ChangeDetectorRef }, { type: i4$1.MatDialogRef }, { type: Document, decorators: [{
604
+ type: Inject,
605
+ args: [MAT_DIALOG_DATA]
606
+ }] }];
607
+ } });
608
+
609
+ var TemplateType;
610
+ (function (TemplateType) {
611
+ TemplateType[TemplateType["Email"] = 0] = "Email";
612
+ TemplateType[TemplateType["Pdf"] = 1] = "Pdf";
613
+ })(TemplateType || (TemplateType = {}));
614
+
615
+ let Template = class Template extends AuditEntity {
616
+ constructor() {
617
+ super(...arguments);
618
+ this.type = TemplateType.Email;
619
+ this.attachments = [];
620
+ }
621
+ };
622
+ __decorate([
623
+ Display($localize `:@@type:Type`),
624
+ required(),
625
+ __metadata("design:type", Number)
626
+ ], Template.prototype, "type", void 0);
627
+ __decorate([
628
+ Column(),
629
+ Display($localize `:@@name:Name`),
630
+ required(),
631
+ __metadata("design:type", String)
632
+ ], Template.prototype, "name", void 0);
633
+ __decorate([
634
+ Column({ maxWidth: 250, showGtLg: true }),
635
+ Display($localize `:@@subject:Subject`),
636
+ prop(),
637
+ __metadata("design:type", String)
638
+ ], Template.prototype, "subject", void 0);
639
+ __decorate([
640
+ Column({ maxWidth: 150, showGtLg: true }),
641
+ required(),
642
+ Display('Key'),
643
+ __metadata("design:type", String)
644
+ ], Template.prototype, "key", void 0);
645
+ __decorate([
646
+ Display($localize `:@@notice:Notice`),
647
+ prop(),
648
+ __metadata("design:type", String)
649
+ ], Template.prototype, "notice", void 0);
650
+ __decorate([
651
+ Display($localize `:@@email:Email`),
652
+ prop(),
653
+ __metadata("design:type", String)
654
+ ], Template.prototype, "email", void 0);
655
+ __decorate([
656
+ required(),
657
+ __metadata("design:type", String)
658
+ ], Template.prototype, "content", void 0);
659
+ __decorate([
660
+ prop(),
661
+ __metadata("design:type", String)
662
+ ], Template.prototype, "dummyData", void 0);
663
+ __decorate([
664
+ Column({
665
+ name: 'client.displayName',
666
+ endpoint: 'client?enabled=true&projection=id,name',
667
+ maxWidth: 250,
668
+ showGtXl: true
669
+ }),
670
+ Display($localize `:@@client:Client`),
671
+ prop(),
672
+ __metadata("design:type", Number)
673
+ ], Template.prototype, "clientId", void 0);
674
+ __decorate([
675
+ Column({ event: 'toggle' }),
676
+ Display($localize `:@@enabled:Enabled`),
677
+ prop(),
678
+ __metadata("design:type", Boolean)
679
+ ], Template.prototype, "enabled", void 0);
680
+ __decorate([
681
+ prop(),
682
+ __metadata("design:type", Array)
683
+ ], Template.prototype, "attachments", void 0);
684
+ Template = __decorate([
685
+ Table({
686
+ endpoint: 'template',
687
+ duplicable: true
688
+ })
689
+ ], Template);
690
+
691
+ class TemplatePreview {
692
+ /**
693
+ * constructor
694
+ * @param init
695
+ */
696
+ constructor(init) {
697
+ Object.assign(this, init);
698
+ }
699
+ }
700
+
701
+ class TemplatePreviewService extends GenericService {
702
+ /**
703
+ * Constructor
704
+ */
705
+ constructor() {
706
+ super('templatePreview');
707
+ }
708
+ }
709
+ TemplatePreviewService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: TemplatePreviewService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
710
+ TemplatePreviewService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: TemplatePreviewService, providedIn: 'root' });
711
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: TemplatePreviewService, decorators: [{
712
+ type: Injectable,
713
+ args: [{ providedIn: 'root' }]
714
+ }], ctorParameters: function () { return []; } });
715
+
716
+ class TemplatePreviewDialogComponent extends BaseComponent {
717
+ /**
718
+ * Constructor
719
+ * @param dialogRef
720
+ * @param data
721
+ */
722
+ constructor(service, dialogRef, data, route, changeDetectorRef) {
723
+ var _a;
724
+ super(route, changeDetectorRef);
725
+ this.service = service;
726
+ this.dialogRef = dialogRef;
727
+ this.data = data;
728
+ this.route = route;
729
+ this.changeDetectorRef = changeDetectorRef;
730
+ /**
731
+ * TemplateType
732
+ */
733
+ this.TemplateType = TemplateType;
734
+ /**
735
+ * Pdf zoom
736
+ */
737
+ this.zoom = 0.98;
738
+ /**
739
+ * Pdf zoom scale
740
+ */
741
+ this.zoomScale = 'page-width';
742
+ this.data.email = (_a = localStorage.getItem('templatePreviewEmail')) !== null && _a !== void 0 ? _a : '';
743
+ }
744
+ /**
745
+ * Lifecycle hook that is called after data-bound properties
746
+ * of a directive are initialized.
747
+ */
748
+ ngOnInit() {
749
+ this.isLoading = true;
750
+ if (this.data.type == TemplateType.Pdf) {
751
+ this.service.create(this.data, null, { responseType: 'arraybuffer' }).subscribe({
752
+ next: (x) => {
753
+ this.isLoading = false;
754
+ this.pdfBlob = new Blob([x], { type: 'application/pdf' });
755
+ this.pdfSrc = URL.createObjectURL(this.pdfBlob);
756
+ },
757
+ error: () => this.isLoading = false
758
+ });
759
+ }
760
+ else {
761
+ this.service.create(this.data).subscribe({
762
+ next: (x) => {
763
+ this.isLoading = false;
764
+ Object.assign(this.data, x);
765
+ },
766
+ error: () => this.isLoading = false
767
+ });
768
+ }
769
+ }
770
+ /**
771
+ * Sends a mail
772
+ */
773
+ sendMail() {
774
+ this.service.create(this.data, '/sendMail').subscribe({
775
+ next: (x) => {
776
+ this.isLoading = false;
777
+ localStorage.setItem('templatePreviewEmail', this.data.email);
778
+ this.snackBarService.open($localize `:@@snackbar.send.success:Data sent successfully.`, null, {
779
+ duration: 3000,
780
+ panelClass: ['primary']
781
+ });
782
+ },
783
+ error: () => this.isLoading = false
784
+ });
785
+ }
786
+ /**
787
+ * Downloads the pdf
788
+ */
789
+ download() {
790
+ saveAs(this.pdfBlob, "Pdf.pdf");
791
+ }
792
+ /**
793
+ * Zooms in the pdf
794
+ */
795
+ zoomIn() {
796
+ this.zoom += 0.1;
797
+ }
798
+ /**
799
+ * Zooms out the pdf
800
+ */
801
+ zoomOut() {
802
+ this.zoom += -0.1;
803
+ }
804
+ /**
805
+ * Closes the dialog
806
+ */
807
+ cancel() {
808
+ this.dialogRef.close();
809
+ }
810
+ }
811
+ TemplatePreviewDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: TemplatePreviewDialogComponent, deps: [{ token: TemplatePreviewService }, { token: i4$1.MatDialogRef }, { token: MAT_DIALOG_DATA }, { token: i3$1.ActivatedRoute }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
812
+ TemplatePreviewDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.0", type: TemplatePreviewDialogComponent, selector: "app-template-preview", usesInheritance: true, ngImport: i0, template: "<div mat-dialog-title class=\"mat-title\">\r\n <div layout=\"row\" flex>\r\n <span i18n=\"@@templatePreview\">Template preview</span>\r\n <span flex></span>\r\n <div *ngIf=\"data.type == TemplateType.Pdf && pdfSrc\">\r\n <a mat-icon-button (click)=\"download()\">\r\n <mat-icon>download</mat-icon>\r\n </a>\r\n <a mat-icon-button (click)=\"zoomIn()\">\r\n <mat-icon>zoom_in</mat-icon>\r\n </a>\r\n <a mat-icon-button (click)=\"zoomOut()\">\r\n <mat-icon>zoom_out</mat-icon>\r\n </a>\r\n </div>\r\n </div>\r\n</div>\r\n<form #form=\"ngForm\" novalidate>\r\n <!-- #region Entity -->\r\n <div layout=\"row\" flex *ngIf=\"data.endpoint\">\r\n <mat-form-field flex layout-margin>\r\n <mat-label>{{data.entityName}}</mat-label>\r\n <vd-chips [(ngModel)]=\"data.entityId\" [endpoint]=\"data.endpoint\" [params]=\"{sortBy: 'id'}\" text=\"displayName\" name=\"entityId\" #entityId=\"ngModel\" (selected)=\"compile($event)\" (initSelect)=\"compile($event)\" [placeholder]=\"data.entityName\" required flex>\r\n <ng-template vd-chip let-entity=\"chip\">\r\n <span>{{entity[data.displayName]}}</span>\r\n </ng-template>\r\n <ng-template vd-autocomplete-option let-entity=\"option\">\r\n <span>{{entity[data.displayName]}}</span>\r\n </ng-template>\r\n </vd-chips>\r\n <mat-error *ngIf=\"entityId.errors?.required\"><span>{{data.entityName}}</span><span i18n> is required</span></mat-error>\r\n </mat-form-field>\r\n </div>\r\n <!-- #endregion -->\r\n\r\n <div layout=\"column\" layout-gt-sm=\"row\" class=\"push-bottom\" flex *ngIf=\"isLoading\">\r\n <div flex layout-margin>\r\n <div class=\"push-bottom-sm\" i18n=\"@@pleaseWait\">Please Wait...</div>\r\n <mat-progress-bar mode=\"indeterminate\"></mat-progress-bar>\r\n </div>\r\n </div>\r\n\r\n <!-- #region PDF Content -->\r\n <mat-card>\r\n <pdf-viewer [src]=\"pdfSrc\" *ngIf=\"data.type == TemplateType.Pdf && pdfSrc\" [render-text]=\"true\" [zoom]=\"zoom\" [zoom-scale]=\"zoomScale\" [show-borders]=\"true\" [original-size]=\"false\" [autoresize]=\"true\"></pdf-viewer>\r\n </mat-card>\r\n <!-- #region Content -->\r\n\r\n <div *ngIf=\"data.type != TemplateType.Pdf\">\r\n <!-- #region Content -->\r\n <div layout=\"row\" layout-margin flex class=\"content\">\r\n <div *ngIf=\"data.content\" [innerHtml]=\"data.content\"></div>\r\n </div>\r\n <!-- #endregion -->\r\n\r\n <!-- #region Email-->\r\n <div layout-gt-sm=\"row\" layout=\"column\" class=\"push-top pad-top\">\r\n <mat-form-field flex layout-margin>\r\n <mat-label i18n>Email</mat-label>\r\n <input matInput type=\"email\" name=\"email\" [(ngModel)]=\"data.email\" #email=\"ngModel\" required email placeholder=\"Email\" i18n-placeholder>\r\n <button mat-icon-button matSuffix (click)=\"sendMail()\" [disabled]=\"!email.valid\">\r\n <mat-icon>send</mat-icon>\r\n </button>\r\n <mat-error *ngIf=\"email.errors?.required\"><span i18n>Email</span><span i18n> is required</span></mat-error>\r\n <mat-error *ngIf=\"!email.errors?.required && email.errors?.email\"><span i18n>Email</span><span i18n> is invalid</span></mat-error>\r\n <mat-error *ngIf=\"email.errors?.notUnique\"><span i18n>Email</span><span i18n> already in use</span></mat-error>\r\n </mat-form-field>\r\n </div>\r\n <!-- #endregion -->\r\n </div>\r\n\r\n <div mat-dialog-actions class=\"pad-top\">\r\n <button type=\"button\" mat-flat-button color=\"primary\" (click)=\"cancel()\" i18n>Close</button>\r\n </div>\r\n</form>", styles: [".content{overflow:scroll;min-height:200px;max-height:500px;border:1px solid #e5e5e5;border-radius:4px;padding:8px}pdf-viewer{display:block;margin-left:-16px;width:calc(100% + 32px);height:calc(100vh - 170px);background:#dbdbdb}\n"], components: [{ type: i4.MatAnchor, selector: "a[mat-button], a[mat-raised-button], a[mat-icon-button], a[mat-fab], a[mat-mini-fab], a[mat-stroked-button], a[mat-flat-button]", inputs: ["disabled", "disableRipple", "color", "tabIndex"], exportAs: ["matButton", "matAnchor"] }, { type: i8.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { type: i6.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { type: i7$1.MatProgressBar, selector: "mat-progress-bar", inputs: ["color", "value", "bufferValue", "mode"], outputs: ["animationEnd"], exportAs: ["matProgressBar"] }, { type: i8$1.MatCard, selector: "mat-card", exportAs: ["matCard"] }, { type: i4.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }], directives: [{ type: i9$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i10$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i10$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i10$1.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i2.MatFormFieldReadonlyDirective, selector: "mat-form-field" }, { type: i6.MatLabel, selector: "mat-label" }, { type: i10$1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { type: i10$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i10$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i2.AsyncValidationDirective, selector: "[ngModel],[formControlName],[formControl]", inputs: ["async"] }, { type: i2.RxFormControlDirective, selector: "[ngModel],[formControlName],[formControl]", inputs: ["rxalpha", "rxalphaNumeric", "rxascii", "rxcompare", "rxcompose", "rxcontains", "rxcreditCard", "rxdataUri", "rxdifferent", "rxdigit", "rxemail", "rxendsWith", "rxeven", "rxextension", "rxfactor", "rxfileSize", "rxgreaterThanEqualTo", "rxgreaterThan", "rxhexColor", "rxjson", "rxlatitude", "rxlatLong", "rxleapYear", "rxlessThan", "rxlessThanEqualTo", "rxlongitude", "rxlowerCase", "rxmac", "rxmaxDate", "rxmaxLength", "rxmaxNumber", "rxminDate", "rxminLength", "rxminNumber", "rxnumeric", "rxodd", "rxpassword", "rxport", "rxprimeNumber", "rxrequired", "rxrange", "rxrule", "rxstartsWith", "rxtime", "rxupperCase", "rxurl", "rxunique", "rxnotEmpty", "rxcusip", "rxgrid", "rxdate"] }, { type: i2.NativeElementInjectorDirective, selector: "[ngModel]" }, { type: i6.MatError, selector: "mat-error", inputs: ["id"] }, { type: i17.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { type: i10$1.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$1.EmailValidator, selector: "[email][formControlName],[email][formControl],[email][ngModel]", inputs: ["email"] }, { type: i6.MatSuffix, selector: "[matSuffix]" }] });
813
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: TemplatePreviewDialogComponent, decorators: [{
814
+ type: Component,
815
+ args: [{ selector: 'app-template-preview', template: "<div mat-dialog-title class=\"mat-title\">\r\n <div layout=\"row\" flex>\r\n <span i18n=\"@@templatePreview\">Template preview</span>\r\n <span flex></span>\r\n <div *ngIf=\"data.type == TemplateType.Pdf && pdfSrc\">\r\n <a mat-icon-button (click)=\"download()\">\r\n <mat-icon>download</mat-icon>\r\n </a>\r\n <a mat-icon-button (click)=\"zoomIn()\">\r\n <mat-icon>zoom_in</mat-icon>\r\n </a>\r\n <a mat-icon-button (click)=\"zoomOut()\">\r\n <mat-icon>zoom_out</mat-icon>\r\n </a>\r\n </div>\r\n </div>\r\n</div>\r\n<form #form=\"ngForm\" novalidate>\r\n <!-- #region Entity -->\r\n <div layout=\"row\" flex *ngIf=\"data.endpoint\">\r\n <mat-form-field flex layout-margin>\r\n <mat-label>{{data.entityName}}</mat-label>\r\n <vd-chips [(ngModel)]=\"data.entityId\" [endpoint]=\"data.endpoint\" [params]=\"{sortBy: 'id'}\" text=\"displayName\" name=\"entityId\" #entityId=\"ngModel\" (selected)=\"compile($event)\" (initSelect)=\"compile($event)\" [placeholder]=\"data.entityName\" required flex>\r\n <ng-template vd-chip let-entity=\"chip\">\r\n <span>{{entity[data.displayName]}}</span>\r\n </ng-template>\r\n <ng-template vd-autocomplete-option let-entity=\"option\">\r\n <span>{{entity[data.displayName]}}</span>\r\n </ng-template>\r\n </vd-chips>\r\n <mat-error *ngIf=\"entityId.errors?.required\"><span>{{data.entityName}}</span><span i18n> is required</span></mat-error>\r\n </mat-form-field>\r\n </div>\r\n <!-- #endregion -->\r\n\r\n <div layout=\"column\" layout-gt-sm=\"row\" class=\"push-bottom\" flex *ngIf=\"isLoading\">\r\n <div flex layout-margin>\r\n <div class=\"push-bottom-sm\" i18n=\"@@pleaseWait\">Please Wait...</div>\r\n <mat-progress-bar mode=\"indeterminate\"></mat-progress-bar>\r\n </div>\r\n </div>\r\n\r\n <!-- #region PDF Content -->\r\n <mat-card>\r\n <pdf-viewer [src]=\"pdfSrc\" *ngIf=\"data.type == TemplateType.Pdf && pdfSrc\" [render-text]=\"true\" [zoom]=\"zoom\" [zoom-scale]=\"zoomScale\" [show-borders]=\"true\" [original-size]=\"false\" [autoresize]=\"true\"></pdf-viewer>\r\n </mat-card>\r\n <!-- #region Content -->\r\n\r\n <div *ngIf=\"data.type != TemplateType.Pdf\">\r\n <!-- #region Content -->\r\n <div layout=\"row\" layout-margin flex class=\"content\">\r\n <div *ngIf=\"data.content\" [innerHtml]=\"data.content\"></div>\r\n </div>\r\n <!-- #endregion -->\r\n\r\n <!-- #region Email-->\r\n <div layout-gt-sm=\"row\" layout=\"column\" class=\"push-top pad-top\">\r\n <mat-form-field flex layout-margin>\r\n <mat-label i18n>Email</mat-label>\r\n <input matInput type=\"email\" name=\"email\" [(ngModel)]=\"data.email\" #email=\"ngModel\" required email placeholder=\"Email\" i18n-placeholder>\r\n <button mat-icon-button matSuffix (click)=\"sendMail()\" [disabled]=\"!email.valid\">\r\n <mat-icon>send</mat-icon>\r\n </button>\r\n <mat-error *ngIf=\"email.errors?.required\"><span i18n>Email</span><span i18n> is required</span></mat-error>\r\n <mat-error *ngIf=\"!email.errors?.required && email.errors?.email\"><span i18n>Email</span><span i18n> is invalid</span></mat-error>\r\n <mat-error *ngIf=\"email.errors?.notUnique\"><span i18n>Email</span><span i18n> already in use</span></mat-error>\r\n </mat-form-field>\r\n </div>\r\n <!-- #endregion -->\r\n </div>\r\n\r\n <div mat-dialog-actions class=\"pad-top\">\r\n <button type=\"button\" mat-flat-button color=\"primary\" (click)=\"cancel()\" i18n>Close</button>\r\n </div>\r\n</form>", styles: [".content{overflow:scroll;min-height:200px;max-height:500px;border:1px solid #e5e5e5;border-radius:4px;padding:8px}pdf-viewer{display:block;margin-left:-16px;width:calc(100% + 32px);height:calc(100vh - 170px);background:#dbdbdb}\n"] }]
816
+ }], ctorParameters: function () {
817
+ return [{ type: TemplatePreviewService }, { type: i4$1.MatDialogRef }, { type: TemplatePreview, decorators: [{
818
+ type: Inject,
819
+ args: [MAT_DIALOG_DATA]
820
+ }] }, { type: i3$1.ActivatedRoute }, { type: i0.ChangeDetectorRef }];
821
+ } });
822
+
823
+ class TemplateService extends GenericService {
824
+ /**
825
+ * Constructor
826
+ */
827
+ constructor() {
828
+ super('template');
829
+ }
830
+ }
831
+ TemplateService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: TemplateService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
832
+ TemplateService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: TemplateService, providedIn: 'root' });
833
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: TemplateService, decorators: [{
834
+ type: Injectable,
835
+ args: [{ providedIn: 'root' }]
836
+ }], ctorParameters: function () { return []; } });
837
+
838
+ class TemplateFormComponent extends GenericReactiveFormComponent {
839
+ /**
840
+ * Constructor
841
+ */
842
+ constructor(service, fileService, dialog, route, changeDetectorRef) {
843
+ super(Template, service, route, changeDetectorRef);
844
+ this.service = service;
845
+ this.fileService = fileService;
846
+ this.dialog = dialog;
847
+ this.route = route;
848
+ this.changeDetectorRef = changeDetectorRef;
849
+ /**
850
+ * Template type
851
+ */
852
+ this.TemplateType = TemplateType;
853
+ /**
854
+ * Used to disable some properties for client manager
855
+ */
856
+ this.isClientAdmin = AuthHelper.hasRole('ClientAdministrator') || AuthHelper.hasRole('ClientManager');
857
+ /**
858
+ * Used to disable some properties for client manager
859
+ */
860
+ this.isClientManager = AuthHelper.hasRole('ClientManager');
861
+ /**
862
+ * Editor options
863
+ */
864
+ this.editorOptions = {
865
+ lineNumbers: true,
866
+ theme: 'material',
867
+ autoCloseTags: true,
868
+ styleActiveLine: true,
869
+ mode: 'text/html',
870
+ profile: 'xhtml'
871
+ };
872
+ /**
873
+ * Editor options
874
+ */
875
+ this.jsonEditorOptions = {
876
+ lineNumbers: true,
877
+ theme: 'material',
878
+ autoCloseTags: true,
879
+ styleActiveLine: true,
880
+ mode: {
881
+ name: "javascript",
882
+ json: true,
883
+ statementIndent: 2
884
+ },
885
+ profile: 'xhtml',
886
+ lineWrapping: true,
887
+ indentWithTabs: false,
888
+ tabSize: 2
889
+ };
890
+ }
891
+ /**
892
+ * Gets the attachments control
893
+ */
894
+ get attachmentsControl() { return this.form.controls.attachments; }
895
+ /**
896
+ * Removes a attachment
897
+ * @param attachment
898
+ */
899
+ removeAttachment(attachment) {
900
+ if (Array.isArray(this.item.attachments)) {
901
+ var index = this.attachmentsControl.value.indexOf(attachment, 0);
902
+ if (index > -1) {
903
+ this.dialogService.openConfirm({
904
+ message: 'Möchten Sie diesen Anhang wirklich löschen?',
905
+ title: 'Löschen bestätigen',
906
+ cancelButton: $localize `:@@cancel:Cancel`,
907
+ acceptButton: $localize `:@@yes:Yes`,
908
+ }).afterClosed().subscribe((accept) => {
909
+ if (accept) {
910
+ this.attachmentsControl.value.splice(index, 1);
911
+ this.attachmentsControl.updateValueAndValidity();
912
+ this.attachmentsControl.markAsDirty();
913
+ }
914
+ });
915
+ }
916
+ }
917
+ }
918
+ /**
919
+ * Uploads a attachment file
920
+ * @param file
921
+ */
922
+ uploadAttachment(file) {
923
+ if (file != null) {
924
+ this.fileService.upload(file, `upload`, { clientId: this.item.clientId, path: `${this.item.clientId ? '' : 'common/'}docs` }).subscribe(event => {
925
+ if (event.type === HttpEventType.UploadProgress) {
926
+ /* Calculate the progress percentage */
927
+ const percentDone = Math.round(100 * event.loaded / event.total);
928
+ /* Pass the percentage into the progress-stream */
929
+ console.info(percentDone);
930
+ }
931
+ else if (event instanceof HttpResponse) {
932
+ /* Add our attachments */
933
+ this.attachmentsControl.setValue([...this.attachmentsControl.value, event.body]);
934
+ this.attachmentsControl.updateValueAndValidity();
935
+ this.attachmentsControl.markAsDirty();
936
+ }
937
+ });
938
+ }
939
+ }
940
+ /**
941
+ * Downloads a attachment
942
+ * @param attachment
943
+ */
944
+ downloadAttachment(attachment) {
945
+ if (attachment.id) {
946
+ this.service.download(`downloadAttachment/${attachment.id}`).subscribe(x => {
947
+ saveAs(new Blob([x.data], { type: '' }), x.filename);
948
+ });
949
+ }
950
+ }
951
+ /**
952
+ * Shows template preview
953
+ */
954
+ showPreview() {
955
+ this.dialog.open(TemplatePreviewDialogComponent, {
956
+ width: this.item.type == TemplateType.Pdf ? '1020px' : '920px',
957
+ data: new TemplatePreview({
958
+ templateId: this.item.id,
959
+ type: this.item.type
960
+ }),
961
+ panelClass: ['dialog-full-screen']
962
+ }).afterClosed().subscribe();
963
+ }
964
+ /**
965
+ * Creates a new instance of the Template
966
+ */
967
+ newInstance() {
968
+ let item = new Template();
969
+ /* Get clientId */
970
+ if (!this.isEditMode && this.isClientManager) {
971
+ // this.clientManagerService.getClientId().subscribe(x => item.clientId = x);
972
+ }
973
+ return item;
974
+ }
975
+ }
976
+ TemplateFormComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: TemplateFormComponent, deps: [{ token: TemplateService }, { token: i2.FileService }, { token: i4$1.MatDialog }, { token: i3$1.ActivatedRoute }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
977
+ TemplateFormComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.0", type: TemplateFormComponent, selector: "app-template-form", usesInheritance: true, ngImport: i0, template: "<vd-layout-nav color=\"primary\" [backNavigationRoute]=\"listRoute\" toolbarTitle=\"Template\" i18n-toolbarTitle [editMode]=\"isEditMode\" [menuItems]=\"toolbarMenuItems\" (reload)=\"reloadPage()\">\r\n\t<form *ngIf=\"form\" [formGroup]=\"form\" novalidate (ngSubmit)=\"save()\">\r\n\t\t<vd-layout-card-over class=\"accordion\" cardWidth=\"70\" color=\"primary\" flex>\r\n\t\t\t<mat-accordion [multi]=\"!isEditMode\">\r\n\t\t\t\t<!-- #region Details -->\r\n\t\t\t\t<mat-expansion-panel expanded=\"true\" id=\"details\">\r\n\t\t\t\t\t<mat-expansion-panel-header>\r\n\t\t\t\t\t\t<mat-panel-title i18n>Details</mat-panel-title>\r\n\t\t\t\t\t</mat-expansion-panel-header>\r\n\r\n\t\t\t\t\t<!-- #region Client-->\r\n\t\t\t\t\t<div layout-gt-sm=\"row\" layout=\"column\" *ngIf=\"settings?.multitenantable && !isClientAdmin\">\r\n\t\t\t\t\t\t<mat-form-field flex layout-margin appearance=\"outline\">\r\n\t\t\t\t\t\t\t<mat-label i18n>Client</mat-label>\r\n\t\t\t\t\t\t\t<vd-select formControlName=\"clientId\" endpoint=\"client?enabled=true\" layout=\"column\" flex></vd-select>\r\n\t\t\t\t\t\t\t<mat-error *ngFor=\"let errorMessage of form.controls.clientId['errorMessages']\">{{errorMessage}}</mat-error>\r\n\t\t\t\t\t\t\t<mat-hint i18n>If empty this template will be used for all projects</mat-hint>\r\n\t\t\t\t\t\t</mat-form-field>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t\t<!-- #endregion -->\r\n\r\n\t\t\t\t\t<!-- #region Type-->\r\n\t\t\t\t\t<div layout-gt-sm=\"row\" layout=\"column\">\r\n\t\t\t\t\t\t<mat-form-field flex layout-margin appearance=\"outline\">\r\n\t\t\t\t\t\t\t<mat-label i18n>Type</mat-label>\r\n\t\t\t\t\t\t\t<vd-select formControlName=\"type\" [enum]=\"TemplateType\" layout=\"column\" flex></vd-select>\r\n\t\t\t\t\t\t\t<mat-error *ngFor=\"let errorMessage of form.controls.type['errorMessages']\">{{errorMessage}}</mat-error>\r\n\t\t\t\t\t\t</mat-form-field>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t\t<!-- #endregion -->\r\n\r\n\t\t\t\t\t<!-- #region Name & Subject -->\r\n\t\t\t\t\t<div layout=\"row\" flex>\r\n\t\t\t\t\t\t<!-- #region Name -->\r\n\t\t\t\t\t\t<mat-form-field flex layout-margin appearance=\"outline\">\r\n\t\t\t\t\t\t\t<mat-label i18n>Name</mat-label>\r\n\t\t\t\t\t\t\t<input matInput formControlName=\"name\">\r\n\t\t\t\t\t\t\t<mat-error *ngFor=\"let errorMessage of form.controls.name['errorMessages']\">{{errorMessage}}</mat-error>\r\n\t\t\t\t\t\t</mat-form-field>\r\n\t\t\t\t\t\t<!-- #endregion -->\r\n\r\n\t\t\t\t\t\t<!-- #region Key -->\r\n\t\t\t\t\t\t<mat-form-field flex layout-margin appearance=\"outline\">\r\n\t\t\t\t\t\t\t<mat-label i18n>Key</mat-label>\r\n\t\t\t\t\t\t\t<input matInput formControlName=\"key\">\r\n\t\t\t\t\t\t\t<mat-error *ngFor=\"let errorMessage of form.controls.key['errorMessages']\">{{errorMessage}}</mat-error>\r\n\t\t\t\t\t\t</mat-form-field>\r\n\t\t\t\t\t\t<!-- #endregion -->\r\n\t\t\t\t\t</div>\r\n\t\t\t\t\t<!-- #endregion -->\r\n\r\n\t\t\t\t\t<!-- #region Subject -->\r\n\t\t\t\t\t<div layout=\"row\" flex>\r\n\t\t\t\t\t\t<mat-form-field flex layout-margin appearance=\"outline\">\r\n\t\t\t\t\t\t\t<mat-label i18n>Subject</mat-label>\r\n\t\t\t\t\t\t\t<input matInput formControlName=\"subject\">\r\n\t\t\t\t\t\t\t<mat-error *ngFor=\"let errorMessage of form.controls.subject['errorMessages']\">{{errorMessage}}</mat-error>\r\n\t\t\t\t\t\t</mat-form-field>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t\t<!-- #endregion -->\r\n\r\n\t\t\t\t\t<!-- #region Attachments -->\r\n\t\t\t\t\t<div layout=\"row\" flex>\r\n\t\t\t\t\t\t<mat-form-field flex layout-margin>\r\n\t\t\t\t\t\t\t<mat-label i18n>Attachments</mat-label>\r\n\t\t\t\t\t\t\t<mat-chip-list #chipList formControlName=\"attachments\">\r\n\t\t\t\t\t\t\t\t<mat-chip *ngFor=\"let attachment of form.controls.attachments.value\" [selectable]=\"true\" color=\"primary\" removable=\"true\" (removed)=\"removeAttachment(attachment)\" (click)=\"downloadAttachment(attachment)\" selected>\r\n\t\t\t\t\t\t\t\t\t{{attachment.originalName}}\r\n\t\t\t\t\t\t\t\t\t<mat-icon matChipRemove>cancel</mat-icon>\r\n\t\t\t\t\t\t\t\t</mat-chip>\r\n\t\t\t\t\t\t\t\t<input placeholder=\"Attachments\" i18n-placeholder [matChipInputFor]=\"chipList\" [matChipInputAddOnBlur]=\"false\" (click)=\"fileInput.click()\" readonly>\r\n\t\t\t\t\t\t\t\t<mat-icon matSuffix (click)=\"fileInput.click()\">publish</mat-icon>\r\n\t\t\t\t\t\t\t\t<input hidden type=\"file\" accept=\"{{allowedExtensions}}\" #fileInput (change)=\"uploadAttachment($event.target.files[0])\" />\r\n\t\t\t\t\t\t\t</mat-chip-list>\r\n\t\t\t\t\t\t</mat-form-field>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t\t<!-- #endregion -->\r\n\r\n\t\t\t\t\t<!-- #region Notice -->\r\n\t\t\t\t\t<div layout=\"row\" flex>\r\n\t\t\t\t\t\t<mat-form-field flex layout-margin appearance=\"outline\">\r\n\t\t\t\t\t\t\t<mat-label i18n>Notice</mat-label>\r\n\t\t\t\t\t\t\t<textarea matInput autocomplete=\"off\" formControlName=\"notice\"></textarea>\r\n\t\t\t\t\t\t\t<mat-error *ngFor=\"let errorMessage of form.controls.notice['errorMessages']\">{{errorMessage}}</mat-error>\r\n\t\t\t\t\t\t</mat-form-field>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t\t<!-- #endregion -->\r\n\r\n\t\t\t\t\t<!-- #region Enabled-->\r\n\t\t\t\t\t<div layout-gt-sm=\"row\" layout=\"column\">\r\n\t\t\t\t\t\t<div layout-margin appearance=\"outline\" class=\"push-top push-bottom\">\r\n\t\t\t\t\t\t\t<mat-checkbox formControlName=\"enabled\" i18n>Activ</mat-checkbox>\r\n\t\t\t\t\t\t</div>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t\t<!-- #endregion -->\r\n\r\n\t\t\t\t\t<mat-action-row>\r\n\t\t\t\t\t\t<button type=\"submit\" mat-flat-button color=\"primary\" [disabled]=\"isSaving\" i18n>Save</button>\r\n\t\t\t\t\t\t<button type=\"button\" mat-button (click)=\"apply()\" *ngIf=\"isEditMode\" [disabled]=\"isSaving\" i18n>Apply</button>\r\n\t\t\t\t\t\t<button type=\"button\" mat-button (click)=\"back()\" i18n>Cancel</button>\r\n\t\t\t\t\t\t<span flex></span>\r\n\t\t\t\t\t</mat-action-row>\r\n\t\t\t\t</mat-expansion-panel>\r\n\t\t\t\t<!-- #endregion -->\r\n\r\n\t\t\t\t<!-- #region Content -->\r\n\t\t\t\t<mat-expansion-panel id=\"content\">\r\n\t\t\t\t\t<mat-expansion-panel-header>\r\n\t\t\t\t\t\t<mat-panel-title>\r\n\t\t\t\t\t\t\t<span i18n>Content</span>\r\n\t\t\t\t\t\t</mat-panel-title>\r\n\t\t\t\t\t</mat-expansion-panel-header>\r\n\t\t\t\t\t<div layout-margin>\r\n\t\t\t\t\t\t<ngx-codemirror formControlName=\"content\" rows=\"160\" [options]=\"editorOptions\"></ngx-codemirror>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t\t<mat-action-row>\r\n\t\t\t\t\t\t<button type=\"submit\" mat-flat-button color=\"primary\" [disabled]=\"isSaving\" i18n>Save</button>\r\n\t\t\t\t\t\t<button type=\"button\" mat-button (click)=\"apply()\" *ngIf=\"isEditMode\" [disabled]=\"isSaving\" i18n>Apply</button>\r\n\t\t\t\t\t\t<button type=\"button\" mat-button (click)=\"showPreview()\" *ngIf=\"isEditMode\" [disabled]=\"isSaving || !form.pristine\" i18n=\"@@preview\">Preview</button>\r\n\t\t\t\t\t\t<button type=\"button\" mat-button (click)=\"back()\" i18n>Cancel</button>\r\n\t\t\t\t\t\t<span flex></span>\r\n\t\t\t\t\t</mat-action-row>\r\n\t\t\t\t</mat-expansion-panel>\r\n\t\t\t\t<!-- #endregion -->\r\n\r\n\t\t\t\t<!-- #region Content -->\r\n\t\t\t\t<mat-expansion-panel id=\"testData\">\r\n\t\t\t\t\t<mat-expansion-panel-header>\r\n\t\t\t\t\t\t<mat-panel-title>\r\n\t\t\t\t\t\t\t<span i18n=\"@@testData\">Test Data</span>\r\n\t\t\t\t\t\t</mat-panel-title>\r\n\t\t\t\t\t</mat-expansion-panel-header>\r\n\t\t\t\t\t<div layout-margin>\r\n\t\t\t\t\t\t<ngx-codemirror formControlName=\"dummyData\" rows=\"120\" [options]=\"jsonEditorOptions\"></ngx-codemirror>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t\t<mat-action-row>\r\n\t\t\t\t\t\t<button type=\"submit\" mat-flat-button color=\"primary\" [disabled]=\"isSaving\" i18n>Save</button>\r\n\t\t\t\t\t\t<button type=\"button\" mat-button (click)=\"apply()\" *ngIf=\"isEditMode\" [disabled]=\"isSaving\" i18n>Apply</button>\r\n\t\t\t\t\t\t<button type=\"button\" mat-button (click)=\"showPreview()\" *ngIf=\"isEditMode\" [disabled]=\"isSaving || !form.pristine\" i18n=\"@@preview\">Preview</button>\r\n\t\t\t\t\t\t<button type=\"button\" mat-button (click)=\"back()\" i18n>Cancel</button>\r\n\t\t\t\t\t\t<span flex></span>\r\n\t\t\t\t\t</mat-action-row>\r\n\t\t\t\t</mat-expansion-panel>\r\n\t\t\t\t<!-- #endregion -->\r\n\r\n\t\t\t\t<!-- #region Audit -->\r\n\t\t\t\t<mat-expansion-panel id=\"audit\" *ngIf=\"isEditMode\">\r\n\t\t\t\t\t<mat-expansion-panel-header>\r\n\t\t\t\t\t\t<mat-panel-title>\r\n\t\t\t\t\t\t\t<span i18n>Audit</span>\r\n\t\t\t\t\t\t</mat-panel-title>\r\n\t\t\t\t\t</mat-expansion-panel-header>\r\n\t\t\t\t\t<vd-audit [item]=\"item\"> </vd-audit>\r\n\t\t\t\t\t<mat-action-row>\r\n\t\t\t\t\t\t<button type=\"button\" mat-flat-button color=\"accent\" (click)=\"back()\" i18n>Close</button>\r\n\t\t\t\t\t\t<span flex></span>\r\n\t\t\t\t\t</mat-action-row>\r\n\t\t\t\t</mat-expansion-panel>\r\n\t\t\t\t<!-- #endregion -->\r\n\t\t\t</mat-accordion>\r\n\t\t</vd-layout-card-over>\r\n\t</form>\r\n</vd-layout-nav>", styles: ["@import\"~codemirror/lib/codemirror.css\";@import\"~codemirror/theme/material.css\";codemirror{width:100%}.CodeMirror{height:500px}\n"], components: [{ type: i2.VdLayoutNavComponent, selector: "vd-layout-nav", inputs: ["toolbarTitle", "editMode", "menuItems", "icon", "logo", "color", "hideToggle", "backNavigationRoute", "navigationRoute"], outputs: ["reload"] }, { type: i2.VdLayoutCardOverComponent, selector: "vd-layout-card-over", inputs: ["cardTitle", "cardSubtitle", "cardWidth", "color"] }, { type: i5.MatExpansionPanel, selector: "mat-expansion-panel", inputs: ["disabled", "expanded", "hideToggle", "togglePosition"], outputs: ["opened", "closed", "expandedChange", "afterExpand", "afterCollapse"], exportAs: ["matExpansionPanel"] }, { type: i5.MatExpansionPanelHeader, selector: "mat-expansion-panel-header", inputs: ["tabIndex", "expandedHeight", "collapsedHeight"] }, { type: i6.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { type: i2.VdSelectComponent, selector: "vd-select", inputs: ["multiple", "disabled", "sorted", "textPrefix", "endpoint", "params", "projection", "enum", "key", "text", "prefix", "options", "filteredOptions", "filterable", "cache", "sortBy", "searchField"], outputs: ["change", "itemChange", "selected", "itemSelected", "launch"] }, { type: i7.MatChipList, selector: "mat-chip-list", inputs: ["errorStateMatcher", "multiple", "compareWith", "value", "required", "placeholder", "disabled", "aria-orientation", "selectable", "tabIndex"], outputs: ["change", "valueChange"], exportAs: ["matChipList"] }, { type: i8.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { type: i12.MatCheckbox, selector: "mat-checkbox", inputs: ["disableRipple", "color", "tabIndex", "aria-label", "aria-labelledby", "aria-describedby", "id", "required", "labelPosition", "name", "value", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }, { type: i4.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { type: i11$1.CodemirrorComponent, selector: "ngx-codemirror", inputs: ["className", "name", "autoFocus", "options", "preserveScrollPosition"], outputs: ["cursorActivity", "focusChange", "scroll", "drop"] }, { type: i14.VdAuditComponent, selector: "vd-audit", inputs: ["item"] }], directives: [{ type: i9$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i10$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i10$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i10$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i2.RxwebFormDirective, selector: "[formGroup],[rxwebForm]", inputs: ["formGroup", "rxwebForm"] }, { type: i5.MatAccordion, selector: "mat-accordion", inputs: ["multi", "hideToggle", "displayMode", "togglePosition"], exportAs: ["matAccordion"] }, { type: i5.MatExpansionPanelTitle, selector: "mat-panel-title" }, { type: i2.MatFormFieldReadonlyDirective, selector: "mat-form-field" }, { type: i6.MatLabel, selector: "mat-label" }, { type: i10$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i10$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { type: i2.AsyncValidationDirective, selector: "[ngModel],[formControlName],[formControl]", inputs: ["async"] }, { type: i2.RxFormControlDirective, selector: "[ngModel],[formControlName],[formControl]", inputs: ["rxalpha", "rxalphaNumeric", "rxascii", "rxcompare", "rxcompose", "rxcontains", "rxcreditCard", "rxdataUri", "rxdifferent", "rxdigit", "rxemail", "rxendsWith", "rxeven", "rxextension", "rxfactor", "rxfileSize", "rxgreaterThanEqualTo", "rxgreaterThan", "rxhexColor", "rxjson", "rxlatitude", "rxlatLong", "rxleapYear", "rxlessThan", "rxlessThanEqualTo", "rxlongitude", "rxlowerCase", "rxmac", "rxmaxDate", "rxmaxLength", "rxmaxNumber", "rxminDate", "rxminLength", "rxminNumber", "rxnumeric", "rxodd", "rxpassword", "rxport", "rxprimeNumber", "rxrequired", "rxrange", "rxrule", "rxstartsWith", "rxtime", "rxupperCase", "rxurl", "rxunique", "rxnotEmpty", "rxcusip", "rxgrid", "rxdate"] }, { type: i9$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i6.MatError, selector: "mat-error", inputs: ["id"] }, { type: i6.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { type: i17.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { type: i10$1.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: i7.MatChip, selector: "mat-basic-chip, [mat-basic-chip], mat-chip, [mat-chip]", inputs: ["color", "disableRipple", "tabIndex", "selected", "value", "selectable", "disabled", "removable"], outputs: ["selectionChange", "destroyed", "removed"], exportAs: ["matChip"] }, { type: i7.MatChipRemove, selector: "[matChipRemove]" }, { type: i7.MatChipInput, selector: "input[matChipInputFor]", inputs: ["matChipInputFor", "matChipInputAddOnBlur", "matChipInputSeparatorKeyCodes", "placeholder", "id", "disabled"], outputs: ["matChipInputTokenEnd"], exportAs: ["matChipInput", "matChipInputFor"] }, { type: i6.MatSuffix, selector: "[matSuffix]" }, { type: i2.FileControlDirective, selector: "input[type=file]", inputs: ["writeFile", "extension", "fileSize", "file"] }, { type: i2.ImageFileControlDirective, selector: "input[type=file]", inputs: ["image"] }, { type: i5.MatExpansionPanelActionRow, selector: "mat-action-row" }], encapsulation: i0.ViewEncapsulation.None });
978
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: TemplateFormComponent, decorators: [{
979
+ type: Component,
980
+ args: [{ selector: 'app-template-form', encapsulation: ViewEncapsulation.None, template: "<vd-layout-nav color=\"primary\" [backNavigationRoute]=\"listRoute\" toolbarTitle=\"Template\" i18n-toolbarTitle [editMode]=\"isEditMode\" [menuItems]=\"toolbarMenuItems\" (reload)=\"reloadPage()\">\r\n\t<form *ngIf=\"form\" [formGroup]=\"form\" novalidate (ngSubmit)=\"save()\">\r\n\t\t<vd-layout-card-over class=\"accordion\" cardWidth=\"70\" color=\"primary\" flex>\r\n\t\t\t<mat-accordion [multi]=\"!isEditMode\">\r\n\t\t\t\t<!-- #region Details -->\r\n\t\t\t\t<mat-expansion-panel expanded=\"true\" id=\"details\">\r\n\t\t\t\t\t<mat-expansion-panel-header>\r\n\t\t\t\t\t\t<mat-panel-title i18n>Details</mat-panel-title>\r\n\t\t\t\t\t</mat-expansion-panel-header>\r\n\r\n\t\t\t\t\t<!-- #region Client-->\r\n\t\t\t\t\t<div layout-gt-sm=\"row\" layout=\"column\" *ngIf=\"settings?.multitenantable && !isClientAdmin\">\r\n\t\t\t\t\t\t<mat-form-field flex layout-margin appearance=\"outline\">\r\n\t\t\t\t\t\t\t<mat-label i18n>Client</mat-label>\r\n\t\t\t\t\t\t\t<vd-select formControlName=\"clientId\" endpoint=\"client?enabled=true\" layout=\"column\" flex></vd-select>\r\n\t\t\t\t\t\t\t<mat-error *ngFor=\"let errorMessage of form.controls.clientId['errorMessages']\">{{errorMessage}}</mat-error>\r\n\t\t\t\t\t\t\t<mat-hint i18n>If empty this template will be used for all projects</mat-hint>\r\n\t\t\t\t\t\t</mat-form-field>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t\t<!-- #endregion -->\r\n\r\n\t\t\t\t\t<!-- #region Type-->\r\n\t\t\t\t\t<div layout-gt-sm=\"row\" layout=\"column\">\r\n\t\t\t\t\t\t<mat-form-field flex layout-margin appearance=\"outline\">\r\n\t\t\t\t\t\t\t<mat-label i18n>Type</mat-label>\r\n\t\t\t\t\t\t\t<vd-select formControlName=\"type\" [enum]=\"TemplateType\" layout=\"column\" flex></vd-select>\r\n\t\t\t\t\t\t\t<mat-error *ngFor=\"let errorMessage of form.controls.type['errorMessages']\">{{errorMessage}}</mat-error>\r\n\t\t\t\t\t\t</mat-form-field>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t\t<!-- #endregion -->\r\n\r\n\t\t\t\t\t<!-- #region Name & Subject -->\r\n\t\t\t\t\t<div layout=\"row\" flex>\r\n\t\t\t\t\t\t<!-- #region Name -->\r\n\t\t\t\t\t\t<mat-form-field flex layout-margin appearance=\"outline\">\r\n\t\t\t\t\t\t\t<mat-label i18n>Name</mat-label>\r\n\t\t\t\t\t\t\t<input matInput formControlName=\"name\">\r\n\t\t\t\t\t\t\t<mat-error *ngFor=\"let errorMessage of form.controls.name['errorMessages']\">{{errorMessage}}</mat-error>\r\n\t\t\t\t\t\t</mat-form-field>\r\n\t\t\t\t\t\t<!-- #endregion -->\r\n\r\n\t\t\t\t\t\t<!-- #region Key -->\r\n\t\t\t\t\t\t<mat-form-field flex layout-margin appearance=\"outline\">\r\n\t\t\t\t\t\t\t<mat-label i18n>Key</mat-label>\r\n\t\t\t\t\t\t\t<input matInput formControlName=\"key\">\r\n\t\t\t\t\t\t\t<mat-error *ngFor=\"let errorMessage of form.controls.key['errorMessages']\">{{errorMessage}}</mat-error>\r\n\t\t\t\t\t\t</mat-form-field>\r\n\t\t\t\t\t\t<!-- #endregion -->\r\n\t\t\t\t\t</div>\r\n\t\t\t\t\t<!-- #endregion -->\r\n\r\n\t\t\t\t\t<!-- #region Subject -->\r\n\t\t\t\t\t<div layout=\"row\" flex>\r\n\t\t\t\t\t\t<mat-form-field flex layout-margin appearance=\"outline\">\r\n\t\t\t\t\t\t\t<mat-label i18n>Subject</mat-label>\r\n\t\t\t\t\t\t\t<input matInput formControlName=\"subject\">\r\n\t\t\t\t\t\t\t<mat-error *ngFor=\"let errorMessage of form.controls.subject['errorMessages']\">{{errorMessage}}</mat-error>\r\n\t\t\t\t\t\t</mat-form-field>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t\t<!-- #endregion -->\r\n\r\n\t\t\t\t\t<!-- #region Attachments -->\r\n\t\t\t\t\t<div layout=\"row\" flex>\r\n\t\t\t\t\t\t<mat-form-field flex layout-margin>\r\n\t\t\t\t\t\t\t<mat-label i18n>Attachments</mat-label>\r\n\t\t\t\t\t\t\t<mat-chip-list #chipList formControlName=\"attachments\">\r\n\t\t\t\t\t\t\t\t<mat-chip *ngFor=\"let attachment of form.controls.attachments.value\" [selectable]=\"true\" color=\"primary\" removable=\"true\" (removed)=\"removeAttachment(attachment)\" (click)=\"downloadAttachment(attachment)\" selected>\r\n\t\t\t\t\t\t\t\t\t{{attachment.originalName}}\r\n\t\t\t\t\t\t\t\t\t<mat-icon matChipRemove>cancel</mat-icon>\r\n\t\t\t\t\t\t\t\t</mat-chip>\r\n\t\t\t\t\t\t\t\t<input placeholder=\"Attachments\" i18n-placeholder [matChipInputFor]=\"chipList\" [matChipInputAddOnBlur]=\"false\" (click)=\"fileInput.click()\" readonly>\r\n\t\t\t\t\t\t\t\t<mat-icon matSuffix (click)=\"fileInput.click()\">publish</mat-icon>\r\n\t\t\t\t\t\t\t\t<input hidden type=\"file\" accept=\"{{allowedExtensions}}\" #fileInput (change)=\"uploadAttachment($event.target.files[0])\" />\r\n\t\t\t\t\t\t\t</mat-chip-list>\r\n\t\t\t\t\t\t</mat-form-field>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t\t<!-- #endregion -->\r\n\r\n\t\t\t\t\t<!-- #region Notice -->\r\n\t\t\t\t\t<div layout=\"row\" flex>\r\n\t\t\t\t\t\t<mat-form-field flex layout-margin appearance=\"outline\">\r\n\t\t\t\t\t\t\t<mat-label i18n>Notice</mat-label>\r\n\t\t\t\t\t\t\t<textarea matInput autocomplete=\"off\" formControlName=\"notice\"></textarea>\r\n\t\t\t\t\t\t\t<mat-error *ngFor=\"let errorMessage of form.controls.notice['errorMessages']\">{{errorMessage}}</mat-error>\r\n\t\t\t\t\t\t</mat-form-field>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t\t<!-- #endregion -->\r\n\r\n\t\t\t\t\t<!-- #region Enabled-->\r\n\t\t\t\t\t<div layout-gt-sm=\"row\" layout=\"column\">\r\n\t\t\t\t\t\t<div layout-margin appearance=\"outline\" class=\"push-top push-bottom\">\r\n\t\t\t\t\t\t\t<mat-checkbox formControlName=\"enabled\" i18n>Activ</mat-checkbox>\r\n\t\t\t\t\t\t</div>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t\t<!-- #endregion -->\r\n\r\n\t\t\t\t\t<mat-action-row>\r\n\t\t\t\t\t\t<button type=\"submit\" mat-flat-button color=\"primary\" [disabled]=\"isSaving\" i18n>Save</button>\r\n\t\t\t\t\t\t<button type=\"button\" mat-button (click)=\"apply()\" *ngIf=\"isEditMode\" [disabled]=\"isSaving\" i18n>Apply</button>\r\n\t\t\t\t\t\t<button type=\"button\" mat-button (click)=\"back()\" i18n>Cancel</button>\r\n\t\t\t\t\t\t<span flex></span>\r\n\t\t\t\t\t</mat-action-row>\r\n\t\t\t\t</mat-expansion-panel>\r\n\t\t\t\t<!-- #endregion -->\r\n\r\n\t\t\t\t<!-- #region Content -->\r\n\t\t\t\t<mat-expansion-panel id=\"content\">\r\n\t\t\t\t\t<mat-expansion-panel-header>\r\n\t\t\t\t\t\t<mat-panel-title>\r\n\t\t\t\t\t\t\t<span i18n>Content</span>\r\n\t\t\t\t\t\t</mat-panel-title>\r\n\t\t\t\t\t</mat-expansion-panel-header>\r\n\t\t\t\t\t<div layout-margin>\r\n\t\t\t\t\t\t<ngx-codemirror formControlName=\"content\" rows=\"160\" [options]=\"editorOptions\"></ngx-codemirror>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t\t<mat-action-row>\r\n\t\t\t\t\t\t<button type=\"submit\" mat-flat-button color=\"primary\" [disabled]=\"isSaving\" i18n>Save</button>\r\n\t\t\t\t\t\t<button type=\"button\" mat-button (click)=\"apply()\" *ngIf=\"isEditMode\" [disabled]=\"isSaving\" i18n>Apply</button>\r\n\t\t\t\t\t\t<button type=\"button\" mat-button (click)=\"showPreview()\" *ngIf=\"isEditMode\" [disabled]=\"isSaving || !form.pristine\" i18n=\"@@preview\">Preview</button>\r\n\t\t\t\t\t\t<button type=\"button\" mat-button (click)=\"back()\" i18n>Cancel</button>\r\n\t\t\t\t\t\t<span flex></span>\r\n\t\t\t\t\t</mat-action-row>\r\n\t\t\t\t</mat-expansion-panel>\r\n\t\t\t\t<!-- #endregion -->\r\n\r\n\t\t\t\t<!-- #region Content -->\r\n\t\t\t\t<mat-expansion-panel id=\"testData\">\r\n\t\t\t\t\t<mat-expansion-panel-header>\r\n\t\t\t\t\t\t<mat-panel-title>\r\n\t\t\t\t\t\t\t<span i18n=\"@@testData\">Test Data</span>\r\n\t\t\t\t\t\t</mat-panel-title>\r\n\t\t\t\t\t</mat-expansion-panel-header>\r\n\t\t\t\t\t<div layout-margin>\r\n\t\t\t\t\t\t<ngx-codemirror formControlName=\"dummyData\" rows=\"120\" [options]=\"jsonEditorOptions\"></ngx-codemirror>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t\t<mat-action-row>\r\n\t\t\t\t\t\t<button type=\"submit\" mat-flat-button color=\"primary\" [disabled]=\"isSaving\" i18n>Save</button>\r\n\t\t\t\t\t\t<button type=\"button\" mat-button (click)=\"apply()\" *ngIf=\"isEditMode\" [disabled]=\"isSaving\" i18n>Apply</button>\r\n\t\t\t\t\t\t<button type=\"button\" mat-button (click)=\"showPreview()\" *ngIf=\"isEditMode\" [disabled]=\"isSaving || !form.pristine\" i18n=\"@@preview\">Preview</button>\r\n\t\t\t\t\t\t<button type=\"button\" mat-button (click)=\"back()\" i18n>Cancel</button>\r\n\t\t\t\t\t\t<span flex></span>\r\n\t\t\t\t\t</mat-action-row>\r\n\t\t\t\t</mat-expansion-panel>\r\n\t\t\t\t<!-- #endregion -->\r\n\r\n\t\t\t\t<!-- #region Audit -->\r\n\t\t\t\t<mat-expansion-panel id=\"audit\" *ngIf=\"isEditMode\">\r\n\t\t\t\t\t<mat-expansion-panel-header>\r\n\t\t\t\t\t\t<mat-panel-title>\r\n\t\t\t\t\t\t\t<span i18n>Audit</span>\r\n\t\t\t\t\t\t</mat-panel-title>\r\n\t\t\t\t\t</mat-expansion-panel-header>\r\n\t\t\t\t\t<vd-audit [item]=\"item\"> </vd-audit>\r\n\t\t\t\t\t<mat-action-row>\r\n\t\t\t\t\t\t<button type=\"button\" mat-flat-button color=\"accent\" (click)=\"back()\" i18n>Close</button>\r\n\t\t\t\t\t\t<span flex></span>\r\n\t\t\t\t\t</mat-action-row>\r\n\t\t\t\t</mat-expansion-panel>\r\n\t\t\t\t<!-- #endregion -->\r\n\t\t\t</mat-accordion>\r\n\t\t</vd-layout-card-over>\r\n\t</form>\r\n</vd-layout-nav>", styles: ["@import\"~codemirror/lib/codemirror.css\";@import\"~codemirror/theme/material.css\";codemirror{width:100%}.CodeMirror{height:500px}\n"] }]
981
+ }], ctorParameters: function () { return [{ type: TemplateService }, { type: i2.FileService }, { type: i4$1.MatDialog }, { type: i3$1.ActivatedRoute }, { type: i0.ChangeDetectorRef }]; } });
982
+
983
+ var DocumentType;
984
+ (function (DocumentType) {
985
+ DocumentType[DocumentType["Document"] = 0] = "Document";
986
+ DocumentType[DocumentType["Activity"] = 1] = "Activity";
987
+ DocumentType[DocumentType["Issue"] = 2] = "Issue";
988
+ DocumentType[DocumentType["Email"] = 3] = "Email";
989
+ })(DocumentType || (DocumentType = {}));
990
+
991
+ let ContentVariable = class ContentVariable extends AuditEntity {
992
+ };
993
+ __decorate([
994
+ prop(),
995
+ __metadata("design:type", String)
996
+ ], ContentVariable.prototype, "title", void 0);
997
+ __decorate([
998
+ required(),
999
+ FormField({ row: 2 }),
1000
+ Column({}),
1001
+ Display($localize `:@@name:Name`),
1002
+ __metadata("design:type", String)
1003
+ ], ContentVariable.prototype, "name", void 0);
1004
+ __decorate([
1005
+ required(),
1006
+ FormField({ row: 3 }),
1007
+ Column({ showGtSm: true }),
1008
+ Display($localize `:@@value:Value`),
1009
+ __metadata("design:type", String)
1010
+ ], ContentVariable.prototype, "value", void 0);
1011
+ __decorate([
1012
+ prop(),
1013
+ FormField({ row: 1, endpoint: 'client?enabled=true&projection=id,name' }),
1014
+ Column({ name: 'client.displayName', endpoint: 'client?enabled=true&projection=id,name', maxWidth: 190, showGtLg: true }),
1015
+ Display($localize `:@@client:Client`),
1016
+ __metadata("design:type", Number)
1017
+ ], ContentVariable.prototype, "clientId", void 0);
1018
+ __decorate([
1019
+ prop(),
1020
+ FormField({ row: 4 }),
1021
+ Column({}),
1022
+ Display($localize `:@@default:Default`),
1023
+ __metadata("design:type", Boolean)
1024
+ ], ContentVariable.prototype, "default", void 0);
1025
+ __decorate([
1026
+ prop(),
1027
+ FormField({ row: 5 }),
1028
+ Column({ event: 'toggle' }),
1029
+ Display($localize `:@@enabled:Enabled`),
1030
+ __metadata("design:type", Boolean)
1031
+ ], ContentVariable.prototype, "enabled", void 0);
1032
+ ContentVariable = __decorate([
1033
+ Table({ endpoint: 'contentvariable' })
1034
+ ], ContentVariable);
1035
+
1036
+ let Faq = class Faq extends AuditEntity {
1037
+ /**
1038
+ * constructor
1039
+ * @param init
1040
+ */
1041
+ constructor(init) {
1042
+ super(init);
1043
+ Object.assign(this, init);
1044
+ }
1045
+ };
1046
+ __decorate([
1047
+ required(),
1048
+ FormField({ row: 2 }),
1049
+ Column({ content: (x) => x === null || x === void 0 ? void 0 : x.question }),
1050
+ Display($localize `:@@question:Question`),
1051
+ __metadata("design:type", String)
1052
+ ], Faq.prototype, "question", void 0);
1053
+ __decorate([
1054
+ required(),
1055
+ FormField({
1056
+ row: 3, type: FormFieldType.Autocomplete, options: [
1057
+ { id: 'Bills', name: 'Bills' },
1058
+ { id: 'Contracts', name: 'Contracts' },
1059
+ { id: 'Orders', name: 'Orders' },
1060
+ { id: 'Profile', name: 'Profile' },
1061
+ ]
1062
+ }),
1063
+ Column({ maxWidth: 190, showGtLg: true }),
1064
+ Display($localize `:@@group:Group`),
1065
+ __metadata("design:type", String)
1066
+ ], Faq.prototype, "group", void 0);
1067
+ __decorate([
1068
+ FormField({ row: 1, endpoint: 'client?enabled=true&projection=id,name' }),
1069
+ Column({
1070
+ name: 'client.displayName',
1071
+ endpoint: 'client?enabled=true&projection=id,name',
1072
+ maxWidth: 250,
1073
+ showGtXl: true
1074
+ }),
1075
+ Display($localize `:@@client:Client`),
1076
+ prop(),
1077
+ __metadata("design:type", Number)
1078
+ ], Faq.prototype, "clientId", void 0);
1079
+ __decorate([
1080
+ prop(),
1081
+ FormField({ row: 3 }),
1082
+ Display($localize `:@@ordering:Ordering`),
1083
+ __metadata("design:type", Number)
1084
+ ], Faq.prototype, "ordering", void 0);
1085
+ __decorate([
1086
+ required(),
1087
+ FormField({ row: 4, type: FormFieldType.Editor }),
1088
+ Display($localize `:@@answer:Answer`),
1089
+ __metadata("design:type", String)
1090
+ ], Faq.prototype, "answer", void 0);
1091
+ __decorate([
1092
+ prop(),
1093
+ FormField({ row: 5 }),
1094
+ Column({ event: 'toggle' }),
1095
+ Display($localize `:@@enabled:Enabled`),
1096
+ __metadata("design:type", Boolean)
1097
+ ], Faq.prototype, "enabled", void 0);
1098
+ Faq = __decorate([
1099
+ Api('faq'),
1100
+ Table(),
1101
+ __metadata("design:paramtypes", [Object])
1102
+ ], Faq);
1103
+
1104
+ /**
1105
+ * Excluded columns resolve service
1106
+ */
1107
+ class ExcludedColumnsResolve {
1108
+ /**
1109
+ * Resolves excluded columns
1110
+ */
1111
+ resolve() {
1112
+ var _a;
1113
+ return of(((_a = ServiceLocator.getService(CmsSettings)) === null || _a === void 0 ? void 0 : _a.multitenantable) ? [] : ['client.displayName']);
1114
+ }
1115
+ }
1116
+ ExcludedColumnsResolve.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: ExcludedColumnsResolve, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1117
+ ExcludedColumnsResolve.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: ExcludedColumnsResolve });
1118
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: ExcludedColumnsResolve, decorators: [{
1119
+ type: Injectable
1120
+ }] });
1121
+
1122
+ /**
1123
+ * Excluded fields resolve service
1124
+ */
1125
+ class ExcludedFieldsResolve {
1126
+ /**
1127
+ * Resolves excluded fields
1128
+ */
1129
+ resolve() {
1130
+ var _a;
1131
+ return of(((_a = ServiceLocator.getService(CmsSettings)) === null || _a === void 0 ? void 0 : _a.multitenantable) ? [] : ['clientId']);
1132
+ }
1133
+ }
1134
+ ExcludedFieldsResolve.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: ExcludedFieldsResolve, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1135
+ ExcludedFieldsResolve.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: ExcludedFieldsResolve });
1136
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: ExcludedFieldsResolve, decorators: [{
1137
+ type: Injectable
1138
+ }] });
1139
+
1140
+ /**
1141
+ * Includes resolve service
1142
+ */
1143
+ class IncludesResolve {
1144
+ /**
1145
+ * Resolves includes
1146
+ */
1147
+ resolve() {
1148
+ var _a;
1149
+ return of(((_a = ServiceLocator.getService(CmsSettings)) === null || _a === void 0 ? void 0 : _a.multitenantable) ? ['Client'] : []);
1150
+ }
1151
+ }
1152
+ IncludesResolve.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: IncludesResolve, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1153
+ IncludesResolve.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: IncludesResolve });
1154
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: IncludesResolve, decorators: [{
1155
+ type: Injectable
1156
+ }] });
1157
+
1158
+ /**
1159
+ * Settings resolve service
1160
+ */
1161
+ class SettingsResolve {
1162
+ /**
1163
+ * Resolves settings
1164
+ */
1165
+ resolve(route) {
1166
+ ServiceLocator.create([{
1167
+ provide: CmsSettings,
1168
+ useValue: route.parent.data.settings
1169
+ }]);
1170
+ return of(null);
1171
+ }
1172
+ }
1173
+ SettingsResolve.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: SettingsResolve, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1174
+ SettingsResolve.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: SettingsResolve });
1175
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: SettingsResolve, decorators: [{
1176
+ type: Injectable
1177
+ }] });
1178
+
1179
+ const routes = [
1180
+ { path: '', redirectTo: '/cms/contents/page', pathMatch: 'full' },
1181
+ { path: 'contents/page', component: VdDynamicListComponent, data: { classType: Content, query: { type: ContentType.Page } }, resolve: { settings: SettingsResolve, includes: IncludesResolve, excludedColumns: ExcludedColumnsResolve } },
1182
+ { path: 'contents/block', component: VdDynamicListComponent, data: { classType: Content, query: { type: ContentType.Block } }, resolve: { settings: SettingsResolve, includes: IncludesResolve, excludedColumns: ExcludedColumnsResolve } },
1183
+ { path: 'contents/:type/add', component: ContentFormComponent, resolve: { settings: SettingsResolve, excludedFields: ExcludedFieldsResolve } },
1184
+ { path: 'contents/:type/edit/:id', component: ContentFormComponent, resolve: { settings: SettingsResolve, excludedFields: ExcludedFieldsResolve } },
1185
+ //
1186
+ { path: 'variables', component: VdDynamicListComponent, data: { classType: ContentVariable }, resolve: { settings: SettingsResolve, includes: IncludesResolve, excludedColumns: ExcludedColumnsResolve } },
1187
+ { path: 'variables/edit/:id', component: VdDynamicFormComponent, data: { classType: ContentVariable, subtitle: $localize `:@@variables:Variables` }, resolve: { settings: SettingsResolve, excludedFields: ExcludedFieldsResolve } },
1188
+ { path: 'variables/add', component: VdDynamicFormComponent, data: { classType: ContentVariable, subtitle: $localize `:@@variables:Variables` }, resolve: { settings: SettingsResolve, excludedFields: ExcludedFieldsResolve } },
1189
+ { path: 'templates', component: VdDynamicListComponent, data: { classType: Template, includes: 'Client' }, resolve: { settings: SettingsResolve, includes: IncludesResolve, excludedColumns: ExcludedColumnsResolve } },
1190
+ { path: 'templates/edit/:id', component: TemplateFormComponent, resolve: { settings: SettingsResolve, excludedFields: ExcludedFieldsResolve } },
1191
+ { path: 'templates/add', component: TemplateFormComponent, resolve: { settings: SettingsResolve, excludedFields: ExcludedFieldsResolve } },
1192
+ { path: 'faqs', component: VdDynamicListComponent, data: { classType: Faq }, resolve: { settings: SettingsResolve, includes: IncludesResolve, excludedColumns: ExcludedColumnsResolve } },
1193
+ { path: 'faqs/edit/:id', component: VdDynamicFormComponent, data: { classType: Faq, subtitle: $localize `:@@faq:FAQ` }, resolve: { settings: SettingsResolve, excludedFields: ExcludedFieldsResolve } },
1194
+ { path: 'faqs/add', component: VdDynamicFormComponent, data: { classType: Faq, query: { clientId: AuthHelper.user.clientId }, subtitle: $localize `:@@faq:FAQ` }, resolve: { settings: SettingsResolve, excludedFields: ExcludedFieldsResolve } },
1195
+ { path: 'documents', component: VdDynamicListComponent, data: { classType: Document, addDialogType: DocumentDialogComponent, query: { type: DocumentType.Document } }, resolve: { settings: SettingsResolve, includes: IncludesResolve, excludedColumns: ExcludedColumnsResolve } },
1196
+ ];
1197
+ class VdCmsRoutingModule {
1198
+ }
1199
+ VdCmsRoutingModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: VdCmsRoutingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1200
+ VdCmsRoutingModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: VdCmsRoutingModule, imports: [i3$1.RouterModule], exports: [RouterModule] });
1201
+ VdCmsRoutingModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: VdCmsRoutingModule, providers: [SettingsResolve, IncludesResolve, ExcludedColumnsResolve, ExcludedFieldsResolve], imports: [[RouterModule.forChild(routes)], RouterModule] });
1202
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: VdCmsRoutingModule, decorators: [{
1203
+ type: NgModule,
1204
+ args: [{
1205
+ imports: [RouterModule.forChild(routes)],
1206
+ exports: [RouterModule],
1207
+ providers: [SettingsResolve, IncludesResolve, ExcludedColumnsResolve, ExcludedFieldsResolve]
1208
+ }]
1209
+ }] });
1210
+
1211
+ class MaterialModule {
1212
+ }
1213
+ MaterialModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: MaterialModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1214
+ MaterialModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: MaterialModule, exports: [MatCardModule,
1215
+ MatExpansionModule,
1216
+ MatButtonModule,
1217
+ MatIconModule,
1218
+ MatChipsModule,
1219
+ MatAutocompleteModule,
1220
+ MatCheckboxModule,
1221
+ MatInputModule,
1222
+ MatProgressBarModule] });
1223
+ MaterialModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: MaterialModule, imports: [MatCardModule,
1224
+ MatExpansionModule,
1225
+ MatButtonModule,
1226
+ MatIconModule,
1227
+ MatChipsModule,
1228
+ MatAutocompleteModule,
1229
+ MatCheckboxModule,
1230
+ MatInputModule,
1231
+ MatProgressBarModule] });
1232
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: MaterialModule, decorators: [{
1233
+ type: NgModule,
1234
+ args: [{
1235
+ exports: [
1236
+ MatCardModule,
1237
+ MatExpansionModule,
1238
+ MatButtonModule,
1239
+ MatIconModule,
1240
+ MatChipsModule,
1241
+ MatAutocompleteModule,
1242
+ MatCheckboxModule,
1243
+ MatInputModule,
1244
+ MatProgressBarModule
1245
+ ]
1246
+ }]
1247
+ }] });
1248
+ class VdModule {
1249
+ }
1250
+ VdModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: VdModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1251
+ VdModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: VdModule, exports: [VdCommonModule,
1252
+ VdLayoutModule,
1253
+ VdMediaModule,
1254
+ VdFormsModule,
1255
+ VdSelectModule] });
1256
+ VdModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: VdModule, imports: [VdCommonModule,
1257
+ VdLayoutModule,
1258
+ VdMediaModule,
1259
+ VdFormsModule,
1260
+ VdSelectModule] });
1261
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: VdModule, decorators: [{
1262
+ type: NgModule,
1263
+ args: [{
1264
+ exports: [
1265
+ VdCommonModule,
1266
+ VdLayoutModule,
1267
+ VdMediaModule,
1268
+ VdFormsModule,
1269
+ VdSelectModule
1270
+ ]
1271
+ }]
1272
+ }] });
1273
+ const DECLARATION = [
1274
+ ContentFormComponent,
1275
+ TemplateFormComponent,
1276
+ TemplatePreviewDialogComponent,
1277
+ DocumentDialogComponent
1278
+ ];
1279
+ class VdCmsModule {
1280
+ }
1281
+ VdCmsModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: VdCmsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1282
+ VdCmsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: VdCmsModule, declarations: [ContentFormComponent,
1283
+ TemplateFormComponent,
1284
+ TemplatePreviewDialogComponent,
1285
+ DocumentDialogComponent], imports: [CommonModule,
1286
+ CodemirrorModule,
1287
+ VdCdkBaseModule, VdModule, MaterialModule, VdCmsRoutingModule,
1288
+ EditorModule], exports: [VdModule, MaterialModule, EditorModule, ContentFormComponent,
1289
+ TemplateFormComponent,
1290
+ TemplatePreviewDialogComponent,
1291
+ DocumentDialogComponent] });
1292
+ VdCmsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: VdCmsModule, imports: [[
1293
+ CommonModule,
1294
+ CodemirrorModule,
1295
+ VdCdkBaseModule,
1296
+ VdModule,
1297
+ MaterialModule,
1298
+ VdCmsRoutingModule,
1299
+ EditorModule,
1300
+ ], VdModule, MaterialModule, EditorModule] });
1301
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: VdCmsModule, decorators: [{
1302
+ type: NgModule,
1303
+ args: [{
1304
+ imports: [
1305
+ CommonModule,
1306
+ CodemirrorModule,
1307
+ VdCdkBaseModule,
1308
+ VdModule,
1309
+ MaterialModule,
1310
+ VdCmsRoutingModule,
1311
+ EditorModule,
1312
+ ],
1313
+ declarations: [DECLARATION],
1314
+ exports: [
1315
+ VdModule,
1316
+ MaterialModule,
1317
+ EditorModule,
1318
+ DECLARATION
1319
+ ]
1320
+ }]
1321
+ }] });
1322
+
1323
+ var FaqScope;
1324
+ (function (FaqScope) {
1325
+ FaqScope[FaqScope["CustomerPortal"] = 0] = "CustomerPortal";
1326
+ FaqScope[FaqScope["Admin"] = 1] = "Admin";
1327
+ })(FaqScope || (FaqScope = {}));
1328
+
1329
+ class ContentVariableService extends GenericService {
1330
+ /**
1331
+ * Constructor
1332
+ */
1333
+ constructor() {
1334
+ super('contentVariable');
1335
+ }
1336
+ /**
1337
+ * Checks if the specified alias is available.
1338
+ * @param id
1339
+ * @param alias
1340
+ */
1341
+ isNameAvailable(item) {
1342
+ return this.create(item, '/isNameAvailable').pipe(map((x) => x.value));
1343
+ }
1344
+ }
1345
+ ContentVariableService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: ContentVariableService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1346
+ ContentVariableService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: ContentVariableService, providedIn: 'root' });
1347
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: ContentVariableService, decorators: [{
1348
+ type: Injectable,
1349
+ args: [{ providedIn: 'root' }]
1350
+ }], ctorParameters: function () { return []; } });
1351
+
1352
+ class FaqService extends GenericService {
1353
+ /**
1354
+ * Constructor
1355
+ */
1356
+ constructor() {
1357
+ super('faq');
1358
+ }
1359
+ }
1360
+ FaqService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: FaqService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1361
+ FaqService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: FaqService, providedIn: 'root' });
1362
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: FaqService, decorators: [{
1363
+ type: Injectable,
1364
+ args: [{ providedIn: 'root' }]
1365
+ }], ctorParameters: function () { return []; } });
1366
+
1367
+ /*
1368
+ * Public API Surface of cdk-base
1369
+ */
1370
+
1371
+ /*
1372
+ * Public API Surface of cdk-cms
1373
+ */
1374
+
1375
+ /**
1376
+ * Generated bundle index. Do not edit.
1377
+ */
1378
+
1379
+ export { CmsSettings, Content, ContentFormComponent, ContentService, ContentType, ContentVariable, ContentVariableService, Document, DocumentDialogComponent, DocumentGenericService, DocumentService, DocumentType, Faq, FaqScope, FaqService, IncludesResolve, MaterialModule, Template, TemplateFormComponent, TemplatePreview, TemplatePreviewDialogComponent, TemplatePreviewService, TemplateService, TemplateType, VdCmsModule, VdModule, WrapTag };
1380
+ //# sourceMappingURL=messaia-cdk-cms.mjs.map