@messaia/cdk-cms 15.0.0-rc67 → 15.0.0-rc69

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.
@@ -1,7 +1,9 @@
1
1
  import { ContentFormComponent } from './comnponents/content-form/content-form.component';
2
2
  import { DocumentDialogComponent } from './comnponents/document-dialog/document-dialog.component';
3
+ import { DocumentFormBaseComponent } from './comnponents/document-form-base/document-form-base.component';
3
4
  import { TemplateFormComponent } from './comnponents/template-form/template-form.component';
4
5
  import { TemplatePreviewDialogComponent } from './comnponents/template-preview-dialog/template-preview-dialog.component';
6
+ import DocumentFormTemplate from './templates/document-form.template';
5
7
  import * as i0 from "@angular/core";
6
8
  import * as i1 from "@angular/material/card";
7
9
  import * as i2 from "@angular/material/expansion";
@@ -10,33 +12,34 @@ import * as i4 from "@angular/material/icon";
10
12
  import * as i5 from "@angular/material/chips";
11
13
  import * as i6 from "@angular/material/autocomplete";
12
14
  import * as i7 from "@angular/material/checkbox";
13
- import * as i8 from "@angular/material/input";
14
- import * as i9 from "@angular/material/select";
15
- import * as i10 from "@angular/material/progress-bar";
16
- import * as i11 from "@messaia/cdk";
17
- import * as i12 from "./comnponents/content-form/content-form.component";
18
- import * as i13 from "./comnponents/template-form/template-form.component";
19
- import * as i14 from "./comnponents/template-preview-dialog/template-preview-dialog.component";
20
- import * as i15 from "./comnponents/document-dialog/document-dialog.component";
21
- import * as i16 from "@angular/common";
22
- import * as i17 from "@ctrl/ngx-codemirror";
23
- import * as i18 from "@messaia/cdk-base";
24
- import * as i19 from "./cms-routing.module";
25
- import * as i20 from "@tinymce/tinymce-angular";
26
- import * as i21 from "ng2-pdf-viewer";
27
- export { ContentFormComponent, DocumentDialogComponent, TemplateFormComponent, TemplatePreviewDialogComponent };
15
+ import * as i8 from "@angular/material/dialog";
16
+ import * as i9 from "@angular/material/input";
17
+ import * as i10 from "@angular/material/select";
18
+ import * as i11 from "@angular/material/progress-bar";
19
+ import * as i12 from "@messaia/cdk";
20
+ import * as i13 from "./comnponents/content-form/content-form.component";
21
+ import * as i14 from "./comnponents/template-form/template-form.component";
22
+ import * as i15 from "./comnponents/template-preview-dialog/template-preview-dialog.component";
23
+ import * as i16 from "./comnponents/document-dialog/document-dialog.component";
24
+ import * as i17 from "@angular/common";
25
+ import * as i18 from "@ctrl/ngx-codemirror";
26
+ import * as i19 from "@messaia/cdk-base";
27
+ import * as i20 from "./cms-routing.module";
28
+ import * as i21 from "@tinymce/tinymce-angular";
29
+ import * as i22 from "ng2-pdf-viewer";
30
+ export { ContentFormComponent, DocumentDialogComponent, DocumentFormBaseComponent, TemplateFormComponent, TemplatePreviewDialogComponent, DocumentFormTemplate };
28
31
  export declare class MaterialModule {
29
32
  static ɵfac: i0.ɵɵFactoryDeclaration<MaterialModule, never>;
30
- static ɵmod: i0.ɵɵNgModuleDeclaration<MaterialModule, never, never, [typeof i1.MatCardModule, typeof i2.MatExpansionModule, typeof i3.MatButtonModule, typeof i4.MatIconModule, typeof i5.MatChipsModule, typeof i6.MatAutocompleteModule, typeof i7.MatCheckboxModule, typeof i8.MatInputModule, typeof i9.MatSelectModule, typeof i10.MatProgressBarModule]>;
33
+ static ɵmod: i0.ɵɵNgModuleDeclaration<MaterialModule, never, never, [typeof i1.MatCardModule, typeof i2.MatExpansionModule, typeof i3.MatButtonModule, typeof i4.MatIconModule, typeof i5.MatChipsModule, typeof i6.MatAutocompleteModule, typeof i7.MatCheckboxModule, typeof i8.MatDialogModule, typeof i9.MatInputModule, typeof i10.MatSelectModule, typeof i11.MatProgressBarModule]>;
31
34
  static ɵinj: i0.ɵɵInjectorDeclaration<MaterialModule>;
32
35
  }
33
36
  export declare class VdModule {
34
37
  static ɵfac: i0.ɵɵFactoryDeclaration<VdModule, never>;
35
- static ɵmod: i0.ɵɵNgModuleDeclaration<VdModule, never, never, [typeof i11.VdCommonModule, typeof i11.VdLayoutModule, typeof i11.VdMediaModule, typeof i11.VdFormsModule, typeof i11.VdSelectModule, typeof i11.VdChipsModule]>;
38
+ static ɵmod: i0.ɵɵNgModuleDeclaration<VdModule, never, never, [typeof i12.VdCommonModule, typeof i12.VdLayoutModule, typeof i12.VdMediaModule, typeof i12.VdFormsModule, typeof i12.VdSelectModule, typeof i12.VdChipsModule, typeof i12.VdFileModule]>;
36
39
  static ɵinj: i0.ɵɵInjectorDeclaration<VdModule>;
37
40
  }
38
41
  export declare class VdCmsModule {
39
42
  static ɵfac: i0.ɵɵFactoryDeclaration<VdCmsModule, never>;
40
- static ɵmod: i0.ɵɵNgModuleDeclaration<VdCmsModule, [typeof i12.ContentFormComponent, typeof i13.TemplateFormComponent, typeof i14.TemplatePreviewDialogComponent, typeof i15.DocumentDialogComponent], [typeof i16.CommonModule, typeof i17.CodemirrorModule, typeof i18.VdCdkBaseModule, typeof VdModule, typeof MaterialModule, typeof i19.VdCmsRoutingModule, typeof i20.EditorModule, typeof i21.PdfViewerModule], [typeof VdModule, typeof MaterialModule, typeof i20.EditorModule, typeof i21.PdfViewerModule, typeof i12.ContentFormComponent, typeof i13.TemplateFormComponent, typeof i14.TemplatePreviewDialogComponent, typeof i15.DocumentDialogComponent]>;
43
+ static ɵmod: i0.ɵɵNgModuleDeclaration<VdCmsModule, [typeof i13.ContentFormComponent, typeof i14.TemplateFormComponent, typeof i15.TemplatePreviewDialogComponent, typeof i16.DocumentDialogComponent], [typeof i17.CommonModule, typeof i18.CodemirrorModule, typeof i19.VdCdkBaseModule, typeof VdModule, typeof MaterialModule, typeof i20.VdCmsRoutingModule, typeof i21.EditorModule, typeof i22.PdfViewerModule], [typeof VdModule, typeof MaterialModule, typeof i21.EditorModule, typeof i22.PdfViewerModule, typeof i13.ContentFormComponent, typeof i14.TemplateFormComponent, typeof i15.TemplatePreviewDialogComponent, typeof i16.DocumentDialogComponent]>;
41
44
  static ɵinj: i0.ɵɵInjectorDeclaration<VdCmsModule>;
42
45
  }
@@ -1,52 +1,26 @@
1
1
  import { ChangeDetectorRef } from '@angular/core';
2
2
  import { MatDialogRef } from '@angular/material/dialog';
3
3
  import { ActivatedRoute } from '@angular/router';
4
- import { FileService, GenericReactiveFormComponent, SaveAction } from '@messaia/cdk';
5
- import { CmsSettings } from '../../models/cms-settings';
4
+ import { FileService } from '@messaia/cdk';
6
5
  import { Document } from '../../models/document';
7
6
  import { DocumentService } from '../../services/document.service`';
7
+ import { DocumentFormBaseComponent } from '../document-form-base/document-form-base.component';
8
8
  import * as i0 from "@angular/core";
9
- export declare class DocumentDialogComponent extends GenericReactiveFormComponent<Document, DocumentService> {
9
+ export declare class DocumentDialogComponent extends DocumentFormBaseComponent<Document, DocumentService> {
10
10
  protected documentService: DocumentService;
11
11
  protected fileService: FileService;
12
12
  protected route: ActivatedRoute;
13
13
  protected changeDetectorRef: ChangeDetectorRef;
14
14
  dialogRef: MatDialogRef<DocumentDialogComponent>;
15
15
  data: Document;
16
- /**
17
- * Upload status
18
- */
19
- isUploading: boolean;
20
- /**
21
- * Upload progress
22
- */
23
- uploadProgress: number;
24
- /**
25
- * Used to disable some properties for client manager
26
- */
27
- isClientManager: boolean;
28
- /**
29
- * settings: CmsSettings
30
- */
31
- settings: CmsSettings;
32
16
  /**
33
17
  * Constructor
34
18
  */
35
19
  constructor(documentService: DocumentService, fileService: FileService, route: ActivatedRoute, changeDetectorRef: ChangeDetectorRef, dialogRef: MatDialogRef<DocumentDialogComponent>, data?: Document);
36
20
  /**
37
- * Uploads a new document
38
- */
39
- upload(file: File | FileList): void;
40
- /**
41
- * Event emitted after data submition
42
- * @param action
43
- * @param response
44
- */
45
- protected onAfterSubmit(action?: SaveAction, response?: any): void;
46
- /**
47
- * Closes the dialog
21
+ * Event emitted before the form has built.
48
22
  */
49
- cancel(): void;
23
+ protected onBeforeFormBuild(): void;
50
24
  static ɵfac: i0.ɵɵFactoryDeclaration<DocumentDialogComponent, never>;
51
25
  static ɵcmp: i0.ɵɵComponentDeclaration<DocumentDialogComponent, "document-dialog", never, {}, {}, never, never, false, never>;
52
26
  }
@@ -0,0 +1,53 @@
1
+ import { ChangeDetectorRef, Type } from '@angular/core';
2
+ import { MatDialogRef } from '@angular/material/dialog';
3
+ import { ActivatedRoute } from '@angular/router';
4
+ import { FileService, GenericReactiveFormComponent, SaveAction } from '@messaia/cdk';
5
+ import { DocumentBase } from "@messaia/cdk-base";
6
+ import { CmsSettings } from '../../models/cms-settings';
7
+ import { DocumentGenericService } from '../../services/document.generic-service';
8
+ import * as i0 from "@angular/core";
9
+ export declare abstract class DocumentFormBaseComponent<TDocument extends DocumentBase, TDocumentService extends DocumentGenericService<TDocument>> extends GenericReactiveFormComponent<TDocument, TDocumentService> {
10
+ protected entityType: Type<TDocument>;
11
+ protected documentService: TDocumentService;
12
+ protected fileService: FileService;
13
+ protected dialogRef: MatDialogRef<DocumentFormBaseComponent<TDocument, TDocumentService>>;
14
+ protected route: ActivatedRoute;
15
+ protected changeDetectorRef: ChangeDetectorRef;
16
+ protected data: TDocument;
17
+ /**
18
+ * Upload status
19
+ */
20
+ isUploading: boolean;
21
+ /**
22
+ * Upload progress
23
+ */
24
+ uploadProgress: number;
25
+ /**
26
+ * settings: CmsSettings
27
+ */
28
+ settings: CmsSettings;
29
+ /**
30
+ * Constructor
31
+ */
32
+ constructor(entityType: Type<TDocument>, documentService: TDocumentService, fileService: FileService, dialogRef: MatDialogRef<DocumentFormBaseComponent<TDocument, TDocumentService>>, route: ActivatedRoute, changeDetectorRef: ChangeDetectorRef, data: TDocument);
33
+ /**
34
+ * Uploads a new document
35
+ */
36
+ upload(file: File | FileList): void;
37
+ /**
38
+ * Event emitted after data submition
39
+ * @param action
40
+ * @param response
41
+ */
42
+ protected onAfterSubmit(_1?: SaveAction, _2?: any): void;
43
+ /**
44
+ * Closes the dialog
45
+ */
46
+ cancel(): void;
47
+ /**
48
+ * Creates a new instance of the TEntity
49
+ */
50
+ protected newInstance(): TDocument;
51
+ static ɵfac: i0.ɵɵFactoryDeclaration<DocumentFormBaseComponent<any, any>, never>;
52
+ static ɵdir: i0.ɵɵDirectiveDeclaration<DocumentFormBaseComponent<any, any>, never, never, {}, {}, never, never, false, never>;
53
+ }
@@ -1,9 +1,5 @@
1
- import { Attachment, DocumentBase } from "@messaia/cdk-base";
1
+ import { DocumentBase } from "@messaia/cdk-base";
2
2
  export declare class Document extends DocumentBase {
3
- /**
4
- * @property
5
- */
6
- customerId: number;
7
3
  /**
8
4
  * @property
9
5
  */
@@ -11,11 +7,11 @@ export declare class Document extends DocumentBase {
11
7
  /**
12
8
  * @property
13
9
  */
14
- path: string;
10
+ departmentId: number;
15
11
  /**
16
12
  * @property
17
13
  */
18
- attachments: Attachment[];
14
+ path: string;
19
15
  /**
20
16
  * constructor
21
17
  * @param init
@@ -0,0 +1,21 @@
1
+ import { Resolve } from "@angular/router";
2
+ import { OidcSecurityService } from "angular-auth-oidc-client";
3
+ import { Observable } from "rxjs";
4
+ import * as i0 from "@angular/core";
5
+ /**
6
+ * Includes resolve service
7
+ */
8
+ export declare class DocumentListProjectionResolve implements Resolve<string[]> {
9
+ private oidcSecurityService;
10
+ /**
11
+ * Constructor
12
+ * @param oidcSecurityService
13
+ */
14
+ constructor(oidcSecurityService: OidcSecurityService);
15
+ /**
16
+ * Resolves includes
17
+ */
18
+ resolve(): Observable<string[]>;
19
+ static ɵfac: i0.ɵɵFactoryDeclaration<DocumentListProjectionResolve, never>;
20
+ static ɵprov: i0.ɵɵInjectableDeclaration<DocumentListProjectionResolve>;
21
+ }
@@ -0,0 +1,2 @@
1
+ declare const DocumentFormTemplate = "\n <div mat-dialog-title class=\"mat-headline-6\" i18n=\"@@newDocument\">New document</div>\n <form *ngIf=\"form\" [formGroup]=\"form\" (ngSubmit)=\"save()\">\n <vd-generic-form [formGroup]=\"form\" [fieldGroups]=\"fieldGroups\" [context]=\"this\">\n <ng-template vd-file let-field=\"field\" let-formGroup=\"formGroup\">\n <mat-form-field [attr.flex]=\"field.flex||0\" layout-margin appearance=\"outline\">\n <mat-label>{{field.header}}</mat-label>\n <div vd-file-input [formControlName]=\"field.name\" (select)=\"upload($event)\" [accept]=\"field.fileExtensions\"></div>\n </mat-form-field>\n </ng-template>\n </vd-generic-form>\n <div mat-dialog-actions class=\"pad-top\">\n <button type=\"submit\" mat-flat-button [disabled]=\"isSaving\" color=\"primary\" i18n=\"@@save\">Save</button>\n <button type=\"button\" mat-button (click)=\"cancel()\" i18n=\"@@cancel\">Cancel</button>\n </div>\n </form>";
2
+ export default DocumentFormTemplate;
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@messaia/cdk-cms",
3
- "version": "15.0.0-rc67",
3
+ "version": "15.0.0-rc69",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^15.1.0",
6
6
  "@angular/core": "^15.1.0",
7
- "@messaia/cdk": "^15.0.0-rc67"
7
+ "@messaia/cdk": "^15.0.0-rc69"
8
8
  },
9
9
  "dependencies": {
10
10
  "tslib": "^2.4.1"