@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,1367 @@
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
+ this.isEditorInitialzed = false;
249
+ this.configEditor();
250
+ this.editorComponent?.editor?.setContent(this.item.body);
251
+ }
252
+ /**
253
+ * Add a aliases to the current field
254
+ * @param event
255
+ */
256
+ addAliases(event) {
257
+ /* Add our aliass */
258
+ if ((event.value || '').trim()) {
259
+ this.aliasesControl.setValue([...this.aliasesControl.value, event.value.trim()]);
260
+ this.aliasesControl.updateValueAndValidity();
261
+ this.aliasesControl.markAsDirty();
262
+ }
263
+ /* Reset the input value */
264
+ if (event.input) {
265
+ event.input.value = '';
266
+ }
267
+ }
268
+ /**
269
+ * Removes a aliases
270
+ * @param aliass
271
+ */
272
+ removeAliases(aliass) {
273
+ const index = this.aliasesControl.value.indexOf(aliass);
274
+ if (index >= 0) {
275
+ this.aliasesControl.value.splice(index, 1);
276
+ this.aliasesControl.updateValueAndValidity();
277
+ this.aliasesControl.markAsDirty();
278
+ }
279
+ }
280
+ /**
281
+ * Creates a new instance of the Template
282
+ */
283
+ newInstance() {
284
+ let item = Object.assign(new Content(), {
285
+ type: this.type,
286
+ wrapTag: this.type == ContentType.Block ? '' : WrapTag.Section,
287
+ showTitle: this.type == ContentType.Block ? false : true
288
+ });
289
+ /* Get clientId */
290
+ if (!this.isEditMode && this.isClientAdmin) {
291
+ item.clientId = this.currentUser.clientId;
292
+ }
293
+ /* Init the tinymce editor */
294
+ this.isEditorInitialzed = false;
295
+ return item;
296
+ }
297
+ /**
298
+ * Event emitted when the form has built.
299
+ */
300
+ onAfterFormBuild() {
301
+ super.onAfterFormBuild();
302
+ this.configEditor();
303
+ }
304
+ /**
305
+ * Configures the tinymce editor
306
+ */
307
+ configEditor() {
308
+ if (this.settings?.multitenantable && this.formValue?.clientId && this.settings?.styleUrlEndpoint) {
309
+ this.httpClient.get(this.settings.styleUrlEndpoint(this.formValue.clientId)).subscribe((x) => {
310
+ super.initEditor(Object.assign(this.getEditorConfig(), { content_css: x.value }));
311
+ });
312
+ }
313
+ else {
314
+ super.initEditor(this.getEditorConfig());
315
+ }
316
+ }
317
+ /**
318
+ * Creates config for the editor
319
+ * @returns
320
+ */
321
+ getEditorConfig() {
322
+ return {
323
+ toolbar: `${this.editorToolbar} snippetsButton`,
324
+ force_p_newlines: false,
325
+ forced_root_block: '',
326
+ height: this.settings?.editorHeight || '700px',
327
+ file_picker_types: 'file image media',
328
+ image_advtab: true,
329
+ images_upload_base_path: `${this.appSetting.apiUrl}file/`,
330
+ images_upload_url: 'backend/api/files',
331
+ allow_html_in_named_anchor: true,
332
+ valid_children: '+a[div|span|img|h1|h2|h3|h4|h5|h6|br|hr|video],+span[i]',
333
+ valid_elements: '*[*]',
334
+ images_upload_handler: (blobInfo, success, failure) => {
335
+ this.fileService.upload(blobInfo.blob(), `upload`, {
336
+ clientId: this.form?.value?.clientId,
337
+ path: 'images',
338
+ isPublic: true
339
+ }).subscribe(event => {
340
+ if (event.type === HttpEventType.UploadProgress) {
341
+ /* Calculate the progress percentage */
342
+ const percentDone = Math.round(100 * event.loaded / event.total);
343
+ /* Pass the percentage into the progress-stream */
344
+ console.info(percentDone);
345
+ }
346
+ else if (event instanceof HttpResponse) {
347
+ success(event.body.publicLink);
348
+ }
349
+ });
350
+ },
351
+ setup: function (editor) {
352
+ /* Add snippets button to the toolbar */
353
+ editor.ui.registry.addMenuButton('snippetsButton', {
354
+ text: 'Snippets',
355
+ fetch: function (callback) {
356
+ callback([
357
+ {
358
+ type: 'menuitem',
359
+ text: 'Variable',
360
+ onAction: () => editor.insertContent('{{var name}}')
361
+ },
362
+ {
363
+ type: 'menuitem',
364
+ text: 'Block',
365
+ onAction: () => editor.insertContent('{{block name="..."}}')
366
+ },
367
+ {
368
+ type: 'menuitem',
369
+ text: 'View Component',
370
+ onAction: () => editor.insertContent('{{vc name="..."}}')
371
+ },
372
+ ]);
373
+ }
374
+ });
375
+ }
376
+ };
377
+ }
378
+ /**
379
+ * Cleanup subscriptions when this component is destroyed.
380
+ */
381
+ ngOnDestroy() {
382
+ if (this.routeSubscription) {
383
+ this.routeSubscription.unsubscribe();
384
+ }
385
+ }
386
+ }
387
+ 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 });
388
+ 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" }] });
389
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: ContentFormComponent, decorators: [{
390
+ type: Component,
391
+ 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>" }]
392
+ }], ctorParameters: function () { return [{ type: ContentService }, { type: i2.FileService }, { type: i3.HttpClient }, { type: i3$1.ActivatedRoute }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { formElement: [{
393
+ type: ViewChild,
394
+ args: ['form', { static: false }]
395
+ }], editorComponent: [{
396
+ type: ViewChild,
397
+ args: ['editor', { static: false }]
398
+ }] } });
399
+
400
+ var DocumentType;
401
+ (function (DocumentType) {
402
+ DocumentType[DocumentType["Document"] = 0] = "Document";
403
+ DocumentType[DocumentType["Activity"] = 1] = "Activity";
404
+ DocumentType[DocumentType["Issue"] = 2] = "Issue";
405
+ DocumentType[DocumentType["Email"] = 3] = "Email";
406
+ })(DocumentType || (DocumentType = {}));
407
+
408
+ let Document = class Document extends AuditEntity {
409
+ /**
410
+ * constructor
411
+ * @param init
412
+ */
413
+ constructor(init) {
414
+ super(init);
415
+ this.path = 'docs';
416
+ this.attachments = [];
417
+ Object.assign(this, init);
418
+ }
419
+ };
420
+ __decorate([
421
+ prop(),
422
+ __metadata("design:type", Number)
423
+ ], Document.prototype, "type", void 0);
424
+ __decorate([
425
+ Column({}),
426
+ Display($localize `:@@name:Name`),
427
+ required(),
428
+ __metadata("design:type", String)
429
+ ], Document.prototype, "name", void 0);
430
+ __decorate([
431
+ required(),
432
+ __metadata("design:type", String)
433
+ ], Document.prototype, "path", void 0);
434
+ __decorate([
435
+ prop(),
436
+ __metadata("design:type", String)
437
+ ], Document.prototype, "originalName", void 0);
438
+ __decorate([
439
+ prop(),
440
+ __metadata("design:type", String)
441
+ ], Document.prototype, "relativePath", void 0);
442
+ __decorate([
443
+ prop(),
444
+ __metadata("design:type", String)
445
+ ], Document.prototype, "fullPath", void 0);
446
+ __decorate([
447
+ prop(),
448
+ __metadata("design:type", Boolean)
449
+ ], Document.prototype, "isPublic", void 0);
450
+ __decorate([
451
+ Column({ maxWidth: 100, showGtLg: true }),
452
+ Display($localize `:@@type:Type`),
453
+ prop(),
454
+ __metadata("design:type", String)
455
+ ], Document.prototype, "extension", void 0);
456
+ __decorate([
457
+ Column({ maxWidth: 250, showGtLg: true }),
458
+ Display($localize `:@@link:Link`),
459
+ prop(),
460
+ __metadata("design:type", String)
461
+ ], Document.prototype, "publicLink", void 0);
462
+ __decorate([
463
+ prop(),
464
+ __metadata("design:type", Number)
465
+ ], Document.prototype, "size", void 0);
466
+ __decorate([
467
+ Column({
468
+ name: 'client.displayName',
469
+ header: $localize `:@@client:Client`,
470
+ endpoint: 'client?enabled=true&projection=id,name',
471
+ maxWidth: 250,
472
+ showGtXl: true
473
+ }),
474
+ required(),
475
+ __metadata("design:type", Number)
476
+ ], Document.prototype, "clientId", void 0);
477
+ __decorate([
478
+ prop(),
479
+ __metadata("design:type", Boolean)
480
+ ], Document.prototype, "preserveOriginalName", void 0);
481
+ __decorate([
482
+ prop(),
483
+ __metadata("design:type", Number)
484
+ ], Document.prototype, "customerId", void 0);
485
+ __decorate([
486
+ prop(),
487
+ __metadata("design:type", String)
488
+ ], Document.prototype, "subject", void 0);
489
+ __decorate([
490
+ prop(),
491
+ __metadata("design:type", String)
492
+ ], Document.prototype, "content", void 0);
493
+ __decorate([
494
+ prop(),
495
+ __metadata("design:type", Array)
496
+ ], Document.prototype, "attachments", void 0);
497
+ Document = __decorate([
498
+ Table({
499
+ endpoint: 'document',
500
+ editable: false,
501
+ downloadable: true
502
+ }),
503
+ __metadata("design:paramtypes", [Object])
504
+ ], Document);
505
+
506
+ class DocumentGenericService extends GenericService {
507
+ /**
508
+ * Constructor
509
+ * @param serviceName
510
+ */
511
+ constructor(serviceName) {
512
+ super(serviceName);
513
+ }
514
+ }
515
+
516
+ class DocumentService extends DocumentGenericService {
517
+ /**
518
+ * Constructor
519
+ */
520
+ constructor() {
521
+ super('document');
522
+ }
523
+ /**
524
+ * Sends an email to the customer
525
+ * @param id The ID of the document
526
+ */
527
+ sendMail(id) {
528
+ return this.update(`sendMail/${id}`, null);
529
+ }
530
+ }
531
+ DocumentService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DocumentService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
532
+ DocumentService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DocumentService, providedIn: 'root' });
533
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DocumentService, decorators: [{
534
+ type: Injectable,
535
+ args: [{ providedIn: 'root' }]
536
+ }], ctorParameters: function () { return []; } });
537
+
538
+ class DocumentDialogComponent extends GenericReactiveFormComponent {
539
+ /**
540
+ * Constructor
541
+ */
542
+ constructor(documentService, fileService, route, changeDetectorRef, dialogRef, item = new Document()) {
543
+ super(Document, documentService, route, changeDetectorRef);
544
+ this.documentService = documentService;
545
+ this.fileService = fileService;
546
+ this.route = route;
547
+ this.changeDetectorRef = changeDetectorRef;
548
+ this.dialogRef = dialogRef;
549
+ this.item = item;
550
+ /**
551
+ * Upload progress
552
+ */
553
+ this.uploadProgress = 0;
554
+ /**
555
+ * Used to disable some properties for client manager
556
+ */
557
+ this.isClientManager = AuthHelper.hasRole('ClientManager');
558
+ }
559
+ /**
560
+ * Uploads a new document
561
+ */
562
+ upload(file) {
563
+ if (file != null && this.item && this.item.clientId) {
564
+ this.isUploading = true;
565
+ this.fileService.upload(file, `upload`, {
566
+ clientId: this.form?.value?.clientId,
567
+ path: this.form?.value?.path,
568
+ isPublic: true,
569
+ preserveOriginalName: this.form?.value?.preserveOriginalName
570
+ }).subscribe(event => {
571
+ if (event.type === HttpEventType.UploadProgress) {
572
+ /* Calculate the progress percentage */
573
+ const percentDone = Math.round(100 * event.loaded / event.total);
574
+ /* Pass the percentage into the progress-stream */
575
+ this.uploadProgress = percentDone;
576
+ }
577
+ else if (event instanceof HttpResponse) {
578
+ this.form.patchValue(event.body);
579
+ this.isUploading = false;
580
+ }
581
+ }, _ => this.isUploading = true);
582
+ }
583
+ }
584
+ /**
585
+ * Event emitted after data submition
586
+ * @param action
587
+ * @param response
588
+ */
589
+ onAfterSubmit(action = SaveAction.SaveAndClose, response = null) {
590
+ this.isSaving = false;
591
+ this.cancel();
592
+ }
593
+ /**
594
+ * Closes the dialog
595
+ */
596
+ cancel() {
597
+ this.dialogRef.close();
598
+ }
599
+ }
600
+ 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 });
601
+ 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"] }] });
602
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DocumentDialogComponent, decorators: [{
603
+ type: Component,
604
+ 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>" }]
605
+ }], ctorParameters: function () { return [{ type: DocumentService }, { type: i2.FileService }, { type: i3$1.ActivatedRoute }, { type: i0.ChangeDetectorRef }, { type: i4$1.MatDialogRef }, { type: Document, decorators: [{
606
+ type: Inject,
607
+ args: [MAT_DIALOG_DATA]
608
+ }] }]; } });
609
+
610
+ var TemplateType;
611
+ (function (TemplateType) {
612
+ TemplateType[TemplateType["Email"] = 0] = "Email";
613
+ TemplateType[TemplateType["Pdf"] = 1] = "Pdf";
614
+ })(TemplateType || (TemplateType = {}));
615
+
616
+ let Template = class Template extends AuditEntity {
617
+ constructor() {
618
+ super(...arguments);
619
+ this.type = TemplateType.Email;
620
+ this.attachments = [];
621
+ }
622
+ };
623
+ __decorate([
624
+ Display($localize `:@@type:Type`),
625
+ required(),
626
+ __metadata("design:type", Number)
627
+ ], Template.prototype, "type", void 0);
628
+ __decorate([
629
+ Column(),
630
+ Display($localize `:@@name:Name`),
631
+ required(),
632
+ __metadata("design:type", String)
633
+ ], Template.prototype, "name", void 0);
634
+ __decorate([
635
+ Column({ maxWidth: 250, showGtLg: true }),
636
+ Display($localize `:@@subject:Subject`),
637
+ prop(),
638
+ __metadata("design:type", String)
639
+ ], Template.prototype, "subject", void 0);
640
+ __decorate([
641
+ Column({ maxWidth: 150, showGtLg: true }),
642
+ required(),
643
+ Display('Key'),
644
+ __metadata("design:type", String)
645
+ ], Template.prototype, "key", void 0);
646
+ __decorate([
647
+ Display($localize `:@@notice:Notice`),
648
+ prop(),
649
+ __metadata("design:type", String)
650
+ ], Template.prototype, "notice", void 0);
651
+ __decorate([
652
+ Display($localize `:@@email:Email`),
653
+ prop(),
654
+ __metadata("design:type", String)
655
+ ], Template.prototype, "email", void 0);
656
+ __decorate([
657
+ required(),
658
+ __metadata("design:type", String)
659
+ ], Template.prototype, "content", void 0);
660
+ __decorate([
661
+ prop(),
662
+ __metadata("design:type", String)
663
+ ], Template.prototype, "dummyData", void 0);
664
+ __decorate([
665
+ Column({
666
+ name: 'client.displayName',
667
+ endpoint: 'client?enabled=true&projection=id,name',
668
+ maxWidth: 250,
669
+ showGtXl: true
670
+ }),
671
+ Display($localize `:@@client:Client`),
672
+ prop(),
673
+ __metadata("design:type", Number)
674
+ ], Template.prototype, "clientId", void 0);
675
+ __decorate([
676
+ Column({ event: 'toggle' }),
677
+ Display($localize `:@@enabled:Enabled`),
678
+ prop(),
679
+ __metadata("design:type", Boolean)
680
+ ], Template.prototype, "enabled", void 0);
681
+ __decorate([
682
+ prop(),
683
+ __metadata("design:type", Array)
684
+ ], Template.prototype, "attachments", void 0);
685
+ Template = __decorate([
686
+ Table({
687
+ endpoint: 'template',
688
+ duplicable: true
689
+ })
690
+ ], Template);
691
+
692
+ class TemplatePreview {
693
+ /**
694
+ * constructor
695
+ * @param init
696
+ */
697
+ constructor(init) {
698
+ Object.assign(this, init);
699
+ }
700
+ }
701
+
702
+ class TemplateService extends GenericService {
703
+ /**
704
+ * Constructor
705
+ */
706
+ constructor() {
707
+ super('template');
708
+ }
709
+ }
710
+ TemplateService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: TemplateService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
711
+ TemplateService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: TemplateService, providedIn: 'root' });
712
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: TemplateService, decorators: [{
713
+ type: Injectable,
714
+ args: [{ providedIn: 'root' }]
715
+ }], ctorParameters: function () { return []; } });
716
+
717
+ class TemplatePreviewService extends GenericService {
718
+ /**
719
+ * Constructor
720
+ */
721
+ constructor() {
722
+ super('templatePreview');
723
+ }
724
+ }
725
+ TemplatePreviewService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: TemplatePreviewService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
726
+ TemplatePreviewService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: TemplatePreviewService, providedIn: 'root' });
727
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: TemplatePreviewService, decorators: [{
728
+ type: Injectable,
729
+ args: [{ providedIn: 'root' }]
730
+ }], ctorParameters: function () { return []; } });
731
+
732
+ class TemplatePreviewDialogComponent extends BaseComponent {
733
+ /**
734
+ * Constructor
735
+ * @param dialogRef
736
+ * @param data
737
+ */
738
+ constructor(service, dialogRef, data, route, changeDetectorRef) {
739
+ super(route, changeDetectorRef);
740
+ this.service = service;
741
+ this.dialogRef = dialogRef;
742
+ this.data = data;
743
+ this.route = route;
744
+ this.changeDetectorRef = changeDetectorRef;
745
+ /**
746
+ * TemplateType
747
+ */
748
+ this.TemplateType = TemplateType;
749
+ /**
750
+ * Pdf zoom
751
+ */
752
+ this.zoom = 0.98;
753
+ /**
754
+ * Pdf zoom scale
755
+ */
756
+ this.zoomScale = 'page-width';
757
+ this.data.email = localStorage.getItem('templatePreviewEmail') ?? '';
758
+ }
759
+ /**
760
+ * Lifecycle hook that is called after data-bound properties
761
+ * of a directive are initialized.
762
+ */
763
+ ngOnInit() {
764
+ this.isLoading = true;
765
+ if (this.data.type == TemplateType.Pdf) {
766
+ this.service.create(this.data, null, { responseType: 'arraybuffer' }).subscribe({
767
+ next: (x) => {
768
+ this.isLoading = false;
769
+ this.pdfBlob = new Blob([x], { type: 'application/pdf' });
770
+ this.pdfSrc = URL.createObjectURL(this.pdfBlob);
771
+ },
772
+ error: () => this.isLoading = false
773
+ });
774
+ }
775
+ else {
776
+ this.service.create(this.data).subscribe({
777
+ next: (x) => {
778
+ this.isLoading = false;
779
+ Object.assign(this.data, x);
780
+ },
781
+ error: () => this.isLoading = false
782
+ });
783
+ }
784
+ }
785
+ /**
786
+ * Sends a mail
787
+ */
788
+ sendMail() {
789
+ this.service.create(this.data, '/sendMail').subscribe({
790
+ next: (x) => {
791
+ this.isLoading = false;
792
+ localStorage.setItem('templatePreviewEmail', this.data.email);
793
+ this.snackBarService.open($localize `:@@snackbar.send.success:Data sent successfully.`, null, {
794
+ duration: 3000,
795
+ panelClass: ['primary']
796
+ });
797
+ },
798
+ error: () => this.isLoading = false
799
+ });
800
+ }
801
+ /**
802
+ * Downloads the pdf
803
+ */
804
+ download() {
805
+ saveAs(this.pdfBlob, "Pdf.pdf");
806
+ }
807
+ /**
808
+ * Zooms in the pdf
809
+ */
810
+ zoomIn() {
811
+ this.zoom += 0.1;
812
+ }
813
+ /**
814
+ * Zooms out the pdf
815
+ */
816
+ zoomOut() {
817
+ this.zoom += -0.1;
818
+ }
819
+ /**
820
+ * Closes the dialog
821
+ */
822
+ cancel() {
823
+ this.dialogRef.close();
824
+ }
825
+ }
826
+ 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 });
827
+ 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]" }] });
828
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: TemplatePreviewDialogComponent, decorators: [{
829
+ type: Component,
830
+ 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"] }]
831
+ }], ctorParameters: function () { return [{ type: TemplatePreviewService }, { type: i4$1.MatDialogRef }, { type: TemplatePreview, decorators: [{
832
+ type: Inject,
833
+ args: [MAT_DIALOG_DATA]
834
+ }] }, { type: i3$1.ActivatedRoute }, { type: i0.ChangeDetectorRef }]; } });
835
+
836
+ class TemplateFormComponent extends GenericReactiveFormComponent {
837
+ /**
838
+ * Constructor
839
+ */
840
+ constructor(service, fileService, dialog, route, changeDetectorRef) {
841
+ super(Template, service, route, changeDetectorRef);
842
+ this.service = service;
843
+ this.fileService = fileService;
844
+ this.dialog = dialog;
845
+ this.route = route;
846
+ this.changeDetectorRef = changeDetectorRef;
847
+ /**
848
+ * Template type
849
+ */
850
+ this.TemplateType = TemplateType;
851
+ /**
852
+ * Used to disable some properties for client manager
853
+ */
854
+ this.isClientAdmin = AuthHelper.hasRole('ClientAdministrator') || AuthHelper.hasRole('ClientManager');
855
+ /**
856
+ * Used to disable some properties for client manager
857
+ */
858
+ this.isClientManager = AuthHelper.hasRole('ClientManager');
859
+ /**
860
+ * Editor options
861
+ */
862
+ this.editorOptions = {
863
+ lineNumbers: true,
864
+ theme: 'material',
865
+ autoCloseTags: true,
866
+ styleActiveLine: true,
867
+ mode: 'text/html',
868
+ profile: 'xhtml'
869
+ };
870
+ /**
871
+ * Editor options
872
+ */
873
+ this.jsonEditorOptions = {
874
+ lineNumbers: true,
875
+ theme: 'material',
876
+ autoCloseTags: true,
877
+ styleActiveLine: true,
878
+ mode: {
879
+ name: "javascript",
880
+ json: true,
881
+ statementIndent: 2
882
+ },
883
+ profile: 'xhtml',
884
+ lineWrapping: true,
885
+ indentWithTabs: false,
886
+ tabSize: 2
887
+ };
888
+ }
889
+ /**
890
+ * Gets the attachments control
891
+ */
892
+ get attachmentsControl() { return this.form.controls.attachments; }
893
+ /**
894
+ * Removes a attachment
895
+ * @param attachment
896
+ */
897
+ removeAttachment(attachment) {
898
+ if (Array.isArray(this.item.attachments)) {
899
+ var index = this.attachmentsControl.value.indexOf(attachment, 0);
900
+ if (index > -1) {
901
+ this.dialogService.openConfirm({
902
+ message: 'Möchten Sie diesen Anhang wirklich löschen?',
903
+ title: 'Löschen bestätigen',
904
+ cancelButton: $localize `:@@cancel:Cancel`,
905
+ acceptButton: $localize `:@@yes:Yes`,
906
+ }).afterClosed().subscribe((accept) => {
907
+ if (accept) {
908
+ this.attachmentsControl.value.splice(index, 1);
909
+ this.attachmentsControl.updateValueAndValidity();
910
+ this.attachmentsControl.markAsDirty();
911
+ }
912
+ });
913
+ }
914
+ }
915
+ }
916
+ /**
917
+ * Uploads a attachment file
918
+ * @param file
919
+ */
920
+ uploadAttachment(file) {
921
+ if (file != null) {
922
+ this.fileService.upload(file, `upload`, { clientId: this.item.clientId, path: `${this.item.clientId ? '' : 'common/'}docs` }).subscribe(event => {
923
+ if (event.type === HttpEventType.UploadProgress) {
924
+ /* Calculate the progress percentage */
925
+ const percentDone = Math.round(100 * event.loaded / event.total);
926
+ /* Pass the percentage into the progress-stream */
927
+ console.info(percentDone);
928
+ }
929
+ else if (event instanceof HttpResponse) {
930
+ /* Add our attachments */
931
+ this.attachmentsControl.setValue([...this.attachmentsControl.value, event.body]);
932
+ this.attachmentsControl.updateValueAndValidity();
933
+ this.attachmentsControl.markAsDirty();
934
+ }
935
+ });
936
+ }
937
+ }
938
+ /**
939
+ * Downloads a attachment
940
+ * @param attachment
941
+ */
942
+ downloadAttachment(attachment) {
943
+ if (attachment.id) {
944
+ this.service.download(`downloadAttachment/${attachment.id}`).subscribe(x => {
945
+ saveAs(new Blob([x.data], { type: '' }), x.filename);
946
+ });
947
+ }
948
+ }
949
+ /**
950
+ * Shows template preview
951
+ */
952
+ showPreview() {
953
+ this.dialog.open(TemplatePreviewDialogComponent, {
954
+ width: this.item.type == TemplateType.Pdf ? '1020px' : '920px',
955
+ data: new TemplatePreview({
956
+ templateId: this.item.id,
957
+ type: this.item.type
958
+ }),
959
+ panelClass: ['dialog-full-screen']
960
+ }).afterClosed().subscribe();
961
+ }
962
+ /**
963
+ * Creates a new instance of the Template
964
+ */
965
+ newInstance() {
966
+ let item = new Template();
967
+ /* Get clientId */
968
+ if (!this.isEditMode && this.isClientManager) {
969
+ // this.clientManagerService.getClientId().subscribe(x => item.clientId = x);
970
+ }
971
+ return item;
972
+ }
973
+ }
974
+ 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 });
975
+ 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 });
976
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: TemplateFormComponent, decorators: [{
977
+ type: Component,
978
+ 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"] }]
979
+ }], ctorParameters: function () { return [{ type: TemplateService }, { type: i2.FileService }, { type: i4$1.MatDialog }, { type: i3$1.ActivatedRoute }, { type: i0.ChangeDetectorRef }]; } });
980
+
981
+ let ContentVariable = class ContentVariable extends AuditEntity {
982
+ };
983
+ __decorate([
984
+ prop(),
985
+ __metadata("design:type", String)
986
+ ], ContentVariable.prototype, "title", void 0);
987
+ __decorate([
988
+ required(),
989
+ FormField({ row: 2 }),
990
+ Column({}),
991
+ Display($localize `:@@name:Name`),
992
+ __metadata("design:type", String)
993
+ ], ContentVariable.prototype, "name", void 0);
994
+ __decorate([
995
+ required(),
996
+ FormField({ row: 3 }),
997
+ Column({ showGtSm: true }),
998
+ Display($localize `:@@value:Value`),
999
+ __metadata("design:type", String)
1000
+ ], ContentVariable.prototype, "value", void 0);
1001
+ __decorate([
1002
+ prop(),
1003
+ FormField({ row: 1, endpoint: 'client?enabled=true&projection=id,name' }),
1004
+ Column({ name: 'client.displayName', endpoint: 'client?enabled=true&projection=id,name', maxWidth: 190, showGtLg: true }),
1005
+ Display($localize `:@@client:Client`),
1006
+ __metadata("design:type", Number)
1007
+ ], ContentVariable.prototype, "clientId", void 0);
1008
+ __decorate([
1009
+ prop(),
1010
+ FormField({ row: 4 }),
1011
+ Column({}),
1012
+ Display($localize `:@@default:Default`),
1013
+ __metadata("design:type", Boolean)
1014
+ ], ContentVariable.prototype, "default", void 0);
1015
+ __decorate([
1016
+ prop(),
1017
+ FormField({ row: 5 }),
1018
+ Column({ event: 'toggle' }),
1019
+ Display($localize `:@@enabled:Enabled`),
1020
+ __metadata("design:type", Boolean)
1021
+ ], ContentVariable.prototype, "enabled", void 0);
1022
+ ContentVariable = __decorate([
1023
+ Table({ endpoint: 'contentvariable' })
1024
+ ], ContentVariable);
1025
+
1026
+ let Faq = class Faq extends AuditEntity {
1027
+ /**
1028
+ * constructor
1029
+ * @param init
1030
+ */
1031
+ constructor(init) {
1032
+ super(init);
1033
+ Object.assign(this, init);
1034
+ }
1035
+ };
1036
+ __decorate([
1037
+ required(),
1038
+ FormField({ row: 2 }),
1039
+ Column({ content: (x) => x?.question }),
1040
+ Display($localize `:@@question:Question`),
1041
+ __metadata("design:type", String)
1042
+ ], Faq.prototype, "question", void 0);
1043
+ __decorate([
1044
+ required(),
1045
+ FormField({
1046
+ row: 3, type: FormFieldType.Autocomplete, options: [
1047
+ { id: 'Bills', name: 'Bills' },
1048
+ { id: 'Contracts', name: 'Contracts' },
1049
+ { id: 'Orders', name: 'Orders' },
1050
+ { id: 'Profile', name: 'Profile' },
1051
+ ]
1052
+ }),
1053
+ Column({ maxWidth: 190, showGtLg: true }),
1054
+ Display($localize `:@@group:Group`),
1055
+ __metadata("design:type", String)
1056
+ ], Faq.prototype, "group", void 0);
1057
+ __decorate([
1058
+ FormField({ row: 1, endpoint: 'client?enabled=true&projection=id,name' }),
1059
+ Column({
1060
+ name: 'client.displayName',
1061
+ endpoint: 'client?enabled=true&projection=id,name',
1062
+ maxWidth: 250,
1063
+ showGtXl: true
1064
+ }),
1065
+ Display($localize `:@@client:Client`),
1066
+ prop(),
1067
+ __metadata("design:type", Number)
1068
+ ], Faq.prototype, "clientId", void 0);
1069
+ __decorate([
1070
+ prop(),
1071
+ FormField({ row: 3 }),
1072
+ Display($localize `:@@ordering:Ordering`),
1073
+ __metadata("design:type", Number)
1074
+ ], Faq.prototype, "ordering", void 0);
1075
+ __decorate([
1076
+ required(),
1077
+ FormField({ row: 4, type: FormFieldType.Editor }),
1078
+ Display($localize `:@@answer:Answer`),
1079
+ __metadata("design:type", String)
1080
+ ], Faq.prototype, "answer", void 0);
1081
+ __decorate([
1082
+ prop(),
1083
+ FormField({ row: 5 }),
1084
+ Column({ event: 'toggle' }),
1085
+ Display($localize `:@@enabled:Enabled`),
1086
+ __metadata("design:type", Boolean)
1087
+ ], Faq.prototype, "enabled", void 0);
1088
+ Faq = __decorate([
1089
+ Api('faq'),
1090
+ Table(),
1091
+ __metadata("design:paramtypes", [Object])
1092
+ ], Faq);
1093
+
1094
+ /**
1095
+ * Excluded columns resolve service
1096
+ */
1097
+ class ExcludedColumnsResolve {
1098
+ /**
1099
+ * Resolves excluded columns
1100
+ */
1101
+ resolve() {
1102
+ return of(ServiceLocator.getService(CmsSettings)?.multitenantable ? [] : ['client.displayName']);
1103
+ }
1104
+ }
1105
+ ExcludedColumnsResolve.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: ExcludedColumnsResolve, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1106
+ ExcludedColumnsResolve.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: ExcludedColumnsResolve });
1107
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: ExcludedColumnsResolve, decorators: [{
1108
+ type: Injectable
1109
+ }] });
1110
+
1111
+ /**
1112
+ * Excluded fields resolve service
1113
+ */
1114
+ class ExcludedFieldsResolve {
1115
+ /**
1116
+ * Resolves excluded fields
1117
+ */
1118
+ resolve() {
1119
+ return of(ServiceLocator.getService(CmsSettings)?.multitenantable ? [] : ['clientId']);
1120
+ }
1121
+ }
1122
+ ExcludedFieldsResolve.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: ExcludedFieldsResolve, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1123
+ ExcludedFieldsResolve.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: ExcludedFieldsResolve });
1124
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: ExcludedFieldsResolve, decorators: [{
1125
+ type: Injectable
1126
+ }] });
1127
+
1128
+ /**
1129
+ * Includes resolve service
1130
+ */
1131
+ class IncludesResolve {
1132
+ /**
1133
+ * Resolves includes
1134
+ */
1135
+ resolve() {
1136
+ return of(ServiceLocator.getService(CmsSettings)?.multitenantable ? ['Client'] : []);
1137
+ }
1138
+ }
1139
+ IncludesResolve.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: IncludesResolve, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1140
+ IncludesResolve.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: IncludesResolve });
1141
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: IncludesResolve, decorators: [{
1142
+ type: Injectable
1143
+ }] });
1144
+
1145
+ /**
1146
+ * Settings resolve service
1147
+ */
1148
+ class SettingsResolve {
1149
+ /**
1150
+ * Resolves settings
1151
+ */
1152
+ resolve(route) {
1153
+ ServiceLocator.create([{
1154
+ provide: CmsSettings,
1155
+ useValue: route.parent.data.settings
1156
+ }]);
1157
+ return of(null);
1158
+ }
1159
+ }
1160
+ SettingsResolve.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: SettingsResolve, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1161
+ SettingsResolve.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: SettingsResolve });
1162
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: SettingsResolve, decorators: [{
1163
+ type: Injectable
1164
+ }] });
1165
+
1166
+ const routes = [
1167
+ { path: '', redirectTo: '/cms/contents/page', pathMatch: 'full' },
1168
+ { path: 'contents/page', component: VdDynamicListComponent, data: { classType: Content, query: { type: ContentType.Page } }, resolve: { settings: SettingsResolve, includes: IncludesResolve, excludedColumns: ExcludedColumnsResolve } },
1169
+ { path: 'contents/block', component: VdDynamicListComponent, data: { classType: Content, query: { type: ContentType.Block } }, resolve: { settings: SettingsResolve, includes: IncludesResolve, excludedColumns: ExcludedColumnsResolve } },
1170
+ { path: 'contents/:type/add', component: ContentFormComponent, resolve: { settings: SettingsResolve, excludedFields: ExcludedFieldsResolve } },
1171
+ { path: 'contents/:type/edit/:id', component: ContentFormComponent, resolve: { settings: SettingsResolve, excludedFields: ExcludedFieldsResolve } },
1172
+ //
1173
+ { path: 'variables', component: VdDynamicListComponent, data: { classType: ContentVariable }, resolve: { settings: SettingsResolve, includes: IncludesResolve, excludedColumns: ExcludedColumnsResolve } },
1174
+ { path: 'variables/edit/:id', component: VdDynamicFormComponent, data: { classType: ContentVariable, subtitle: $localize `:@@variables:Variables` }, resolve: { settings: SettingsResolve, excludedFields: ExcludedFieldsResolve } },
1175
+ { path: 'variables/add', component: VdDynamicFormComponent, data: { classType: ContentVariable, subtitle: $localize `:@@variables:Variables` }, resolve: { settings: SettingsResolve, excludedFields: ExcludedFieldsResolve } },
1176
+ { path: 'templates', component: VdDynamicListComponent, data: { classType: Template, includes: 'Client' }, resolve: { settings: SettingsResolve, includes: IncludesResolve, excludedColumns: ExcludedColumnsResolve } },
1177
+ { path: 'templates/edit/:id', component: TemplateFormComponent, resolve: { settings: SettingsResolve, excludedFields: ExcludedFieldsResolve } },
1178
+ { path: 'templates/add', component: TemplateFormComponent, resolve: { settings: SettingsResolve, excludedFields: ExcludedFieldsResolve } },
1179
+ { path: 'faqs', component: VdDynamicListComponent, data: { classType: Faq }, resolve: { settings: SettingsResolve, includes: IncludesResolve, excludedColumns: ExcludedColumnsResolve } },
1180
+ { path: 'faqs/edit/:id', component: VdDynamicFormComponent, data: { classType: Faq, subtitle: $localize `:@@faq:FAQ` }, resolve: { settings: SettingsResolve, excludedFields: ExcludedFieldsResolve } },
1181
+ { path: 'faqs/add', component: VdDynamicFormComponent, data: { classType: Faq, query: { clientId: AuthHelper.user.clientId }, subtitle: $localize `:@@faq:FAQ` }, resolve: { settings: SettingsResolve, excludedFields: ExcludedFieldsResolve } },
1182
+ { path: 'documents', component: VdDynamicListComponent, data: { classType: Document, addDialogType: DocumentDialogComponent, query: { type: DocumentType.Document } }, resolve: { settings: SettingsResolve, includes: IncludesResolve, excludedColumns: ExcludedColumnsResolve } },
1183
+ ];
1184
+ class VdCmsRoutingModule {
1185
+ }
1186
+ VdCmsRoutingModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: VdCmsRoutingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1187
+ VdCmsRoutingModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: VdCmsRoutingModule, imports: [i3$1.RouterModule], exports: [RouterModule] });
1188
+ 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] });
1189
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: VdCmsRoutingModule, decorators: [{
1190
+ type: NgModule,
1191
+ args: [{
1192
+ imports: [RouterModule.forChild(routes)],
1193
+ exports: [RouterModule],
1194
+ providers: [SettingsResolve, IncludesResolve, ExcludedColumnsResolve, ExcludedFieldsResolve]
1195
+ }]
1196
+ }] });
1197
+
1198
+ class MaterialModule {
1199
+ }
1200
+ MaterialModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: MaterialModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1201
+ MaterialModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: MaterialModule, exports: [MatCardModule,
1202
+ MatExpansionModule,
1203
+ MatButtonModule,
1204
+ MatIconModule,
1205
+ MatChipsModule,
1206
+ MatAutocompleteModule,
1207
+ MatCheckboxModule,
1208
+ MatInputModule,
1209
+ MatProgressBarModule] });
1210
+ MaterialModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: MaterialModule, imports: [MatCardModule,
1211
+ MatExpansionModule,
1212
+ MatButtonModule,
1213
+ MatIconModule,
1214
+ MatChipsModule,
1215
+ MatAutocompleteModule,
1216
+ MatCheckboxModule,
1217
+ MatInputModule,
1218
+ MatProgressBarModule] });
1219
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: MaterialModule, decorators: [{
1220
+ type: NgModule,
1221
+ args: [{
1222
+ exports: [
1223
+ MatCardModule,
1224
+ MatExpansionModule,
1225
+ MatButtonModule,
1226
+ MatIconModule,
1227
+ MatChipsModule,
1228
+ MatAutocompleteModule,
1229
+ MatCheckboxModule,
1230
+ MatInputModule,
1231
+ MatProgressBarModule
1232
+ ]
1233
+ }]
1234
+ }] });
1235
+ class VdModule {
1236
+ }
1237
+ VdModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: VdModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1238
+ VdModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: VdModule, exports: [VdCommonModule,
1239
+ VdLayoutModule,
1240
+ VdMediaModule,
1241
+ VdFormsModule,
1242
+ VdSelectModule] });
1243
+ VdModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: VdModule, imports: [VdCommonModule,
1244
+ VdLayoutModule,
1245
+ VdMediaModule,
1246
+ VdFormsModule,
1247
+ VdSelectModule] });
1248
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: VdModule, decorators: [{
1249
+ type: NgModule,
1250
+ args: [{
1251
+ exports: [
1252
+ VdCommonModule,
1253
+ VdLayoutModule,
1254
+ VdMediaModule,
1255
+ VdFormsModule,
1256
+ VdSelectModule
1257
+ ]
1258
+ }]
1259
+ }] });
1260
+ const DECLARATION = [
1261
+ ContentFormComponent,
1262
+ TemplateFormComponent,
1263
+ TemplatePreviewDialogComponent,
1264
+ DocumentDialogComponent
1265
+ ];
1266
+ class VdCmsModule {
1267
+ }
1268
+ VdCmsModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: VdCmsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1269
+ VdCmsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: VdCmsModule, declarations: [ContentFormComponent,
1270
+ TemplateFormComponent,
1271
+ TemplatePreviewDialogComponent,
1272
+ DocumentDialogComponent], imports: [CommonModule,
1273
+ CodemirrorModule,
1274
+ VdCdkBaseModule, VdModule, MaterialModule, VdCmsRoutingModule,
1275
+ EditorModule], exports: [VdModule, MaterialModule, EditorModule, ContentFormComponent,
1276
+ TemplateFormComponent,
1277
+ TemplatePreviewDialogComponent,
1278
+ DocumentDialogComponent] });
1279
+ VdCmsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: VdCmsModule, imports: [[
1280
+ CommonModule,
1281
+ CodemirrorModule,
1282
+ VdCdkBaseModule,
1283
+ VdModule,
1284
+ MaterialModule,
1285
+ VdCmsRoutingModule,
1286
+ EditorModule,
1287
+ ], VdModule, MaterialModule, EditorModule] });
1288
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: VdCmsModule, decorators: [{
1289
+ type: NgModule,
1290
+ args: [{
1291
+ imports: [
1292
+ CommonModule,
1293
+ CodemirrorModule,
1294
+ VdCdkBaseModule,
1295
+ VdModule,
1296
+ MaterialModule,
1297
+ VdCmsRoutingModule,
1298
+ EditorModule,
1299
+ ],
1300
+ declarations: [DECLARATION],
1301
+ exports: [
1302
+ VdModule,
1303
+ MaterialModule,
1304
+ EditorModule,
1305
+ DECLARATION
1306
+ ]
1307
+ }]
1308
+ }] });
1309
+
1310
+ var FaqScope;
1311
+ (function (FaqScope) {
1312
+ FaqScope[FaqScope["CustomerPortal"] = 0] = "CustomerPortal";
1313
+ FaqScope[FaqScope["Admin"] = 1] = "Admin";
1314
+ })(FaqScope || (FaqScope = {}));
1315
+
1316
+ class ContentVariableService extends GenericService {
1317
+ /**
1318
+ * Constructor
1319
+ */
1320
+ constructor() {
1321
+ super('contentVariable');
1322
+ }
1323
+ /**
1324
+ * Checks if the specified alias is available.
1325
+ * @param id
1326
+ * @param alias
1327
+ */
1328
+ isNameAvailable(item) {
1329
+ return this.create(item, '/isNameAvailable').pipe(map((x) => x.value));
1330
+ }
1331
+ }
1332
+ ContentVariableService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: ContentVariableService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1333
+ ContentVariableService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: ContentVariableService, providedIn: 'root' });
1334
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: ContentVariableService, decorators: [{
1335
+ type: Injectable,
1336
+ args: [{ providedIn: 'root' }]
1337
+ }], ctorParameters: function () { return []; } });
1338
+
1339
+ class FaqService extends GenericService {
1340
+ /**
1341
+ * Constructor
1342
+ */
1343
+ constructor() {
1344
+ super('faq');
1345
+ }
1346
+ }
1347
+ FaqService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: FaqService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1348
+ FaqService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: FaqService, providedIn: 'root' });
1349
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: FaqService, decorators: [{
1350
+ type: Injectable,
1351
+ args: [{ providedIn: 'root' }]
1352
+ }], ctorParameters: function () { return []; } });
1353
+
1354
+ /*
1355
+ * Public API Surface of cdk-base
1356
+ */
1357
+
1358
+ /*
1359
+ * Public API Surface of cdk-cms
1360
+ */
1361
+
1362
+ /**
1363
+ * Generated bundle index. Do not edit.
1364
+ */
1365
+
1366
+ 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 };
1367
+ //# sourceMappingURL=messaia-cdk-cms.mjs.map