cat-documents-ng 0.0.70 → 0.1.0

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.
@@ -61,6 +61,10 @@ export declare class DocumentContainerComponent implements OnInit {
61
61
  * Fetches the folder data from the API.
62
62
  * @returns {void}
63
63
  */
64
+ /**
65
+ * Fetches the folder data from the API.
66
+ * @returns {void}
67
+ */
64
68
  fetchFolder(): void;
65
69
  /**
66
70
  * Fetches the document data from the API.
@@ -5,6 +5,7 @@ import { DocumentUploadService } from '../../services/document-upload.service';
5
5
  import { Message } from 'primeng/api';
6
6
  import { DocumentQuery } from '../../state/document.query';
7
7
  import { DocumentStore } from '../../state/document.store';
8
+ import { PERMISSIONS } from '../../../../Shared/constant/PERMISSIONS';
8
9
  import * as i0 from "@angular/core";
9
10
  /**
10
11
  * This component is responsible for displaying and managing a list of documents.
@@ -79,12 +80,14 @@ export declare class DocumentListComponent implements OnInit {
79
80
  * @memberof DocumentListComponent
80
81
  */
81
82
  selectedOption: string | null;
83
+ PERMISSION: typeof PERMISSIONS;
82
84
  /**
83
85
  * Creates an instance of DocumentListComponent.
84
86
  * @class
85
87
  * @param {DocumentUploadService} documentUploadService - The service responsible for uploading documents.
86
88
  * @param {DocumentHttpService} documentHttpService - The service responsible for fetching documents from the server.
87
- * @param {DocumentQuery} documentQuery - The service responsible for storing documents.
89
+ * @param {DocumentQuery} documentQuery - The service responsible for geting stored documents.
90
+ * @param {DocumentStore} documentStore - The service responsible for storing documents.
88
91
  */
89
92
  constructor(documentUploadService: DocumentUploadService, documentHttpService: DocumentHttpService, documentQuery: DocumentQuery, documentStore: DocumentStore);
90
93
  /**
@@ -0,0 +1,38 @@
1
+ import { ElementRef, Renderer2, SimpleChanges, OnChanges } from '@angular/core';
2
+ import { SessionService } from '../../../Shared/services/session.service';
3
+ import * as i0 from "@angular/core";
4
+ /**
5
+ * Directive to conditionally show or hide elements based on user permissions.
6
+ * @class HasPermissionDirective
7
+ * @typedef {HasPermissionDirective}
8
+ */
9
+ export declare class HasPermissionDirective implements OnChanges {
10
+ private el;
11
+ private renderer;
12
+ sessionService: SessionService;
13
+ /**
14
+ * The required permission(s) to display the element.
15
+ * Accepts a single string or an array of strings.
16
+ * @type {string | string[]}
17
+ */
18
+ permission?: string | string[];
19
+ /**
20
+ * Creates an instance of HasPermissionDirective.
21
+ * @param {ElementRef} el - Reference to the host element.
22
+ * @param {Renderer2} renderer - Angular Renderer for DOM manipulation.
23
+ * @param {SessionService} sessionService - Service to retrieve user permissions.
24
+ */
25
+ constructor(el: ElementRef, renderer: Renderer2, sessionService: SessionService);
26
+ /**
27
+ * Lifecycle hook that is called when input properties change.
28
+ * @param {SimpleChanges} changes - The changes in input properties.
29
+ */
30
+ ngOnChanges(changes: SimpleChanges): void;
31
+ /**
32
+ * Checks if the user has the required permission(s).
33
+ * Hides the element if the permission is not found.
34
+ */
35
+ private checkPermission;
36
+ static ɵfac: i0.ɵɵFactoryDeclaration<HasPermissionDirective, never>;
37
+ static ɵdir: i0.ɵɵDirectiveDeclaration<HasPermissionDirective, "[permission]", never, { "permission": { "alias": "permission"; "required": false; }; }, {}, never, never, false, never>;
38
+ }
@@ -7,22 +7,24 @@ import * as i5 from "./components/document-list-item/document-list-item.componen
7
7
  import * as i6 from "./components/document-upload/document-upload.component";
8
8
  import * as i7 from "./components/document-viewer/document-viewer.component";
9
9
  import * as i8 from "./directives/document.directive";
10
- import * as i9 from "@angular/common";
11
- import * as i10 from "primeng/accordion";
12
- import * as i11 from "@angular/common/http";
13
- import * as i12 from "primeng/button";
14
- import * as i13 from "primeng/sidebar";
15
- import * as i14 from "primeng/fileupload";
16
- import * as i15 from "primeng/progressbar";
17
- import * as i16 from "primeng/badge";
18
- import * as i17 from "primeng/listbox";
19
- import * as i18 from "primeng/checkbox";
20
- import * as i19 from "primeng/timeline";
21
- import * as i20 from "@angular/forms";
22
- import * as i21 from "ng2-pdf-viewer";
23
- import * as i22 from "primeng/dialog";
24
- import * as i23 from "primeng/dropdown";
25
- import * as i24 from "primeng/inputtext";
10
+ import * as i9 from "./directives/permission.directive";
11
+ import * as i10 from "@angular/common";
12
+ import * as i11 from "primeng/accordion";
13
+ import * as i12 from "@angular/common/http";
14
+ import * as i13 from "primeng/button";
15
+ import * as i14 from "primeng/sidebar";
16
+ import * as i15 from "primeng/fileupload";
17
+ import * as i16 from "primeng/progressbar";
18
+ import * as i17 from "primeng/badge";
19
+ import * as i18 from "primeng/listbox";
20
+ import * as i19 from "primeng/checkbox";
21
+ import * as i20 from "primeng/timeline";
22
+ import * as i21 from "primeng/inputtextarea";
23
+ import * as i22 from "@angular/forms";
24
+ import * as i23 from "ng2-pdf-viewer";
25
+ import * as i24 from "primeng/dialog";
26
+ import * as i25 from "primeng/dropdown";
27
+ import * as i26 from "primeng/inputtext";
26
28
  /**
27
29
  * @module DocumentModule
28
30
  *
@@ -32,6 +34,6 @@ import * as i24 from "primeng/inputtext";
32
34
  */
33
35
  export declare class DocumentModule {
34
36
  static ɵfac: i0.ɵɵFactoryDeclaration<DocumentModule, never>;
35
- static ɵmod: i0.ɵɵNgModuleDeclaration<DocumentModule, [typeof i1.DocumentContainerComponent, typeof i2.FolderContainerComponent, typeof i3.FolderBlockComponent, typeof i4.DocumentListComponent, typeof i5.DocumentListItemComponent, typeof i6.DocumentUploadComponent, typeof i7.DocumentViewerComponent, typeof i8.DocumentDirective], [typeof i9.CommonModule, typeof i10.AccordionModule, typeof i11.HttpClientModule, typeof i12.ButtonModule, typeof i13.SidebarModule, typeof i14.FileUploadModule, typeof i15.ProgressBarModule, typeof i16.BadgeModule, typeof i17.ListboxModule, typeof i18.CheckboxModule, typeof i19.TimelineModule, typeof i20.FormsModule, typeof i21.PdfViewerModule, typeof i22.DialogModule, typeof i23.DropdownModule, typeof i24.InputTextModule], [typeof i1.DocumentContainerComponent, typeof i7.DocumentViewerComponent, typeof i4.DocumentListComponent, typeof i8.DocumentDirective]>;
37
+ static ɵmod: i0.ɵɵNgModuleDeclaration<DocumentModule, [typeof i1.DocumentContainerComponent, typeof i2.FolderContainerComponent, typeof i3.FolderBlockComponent, typeof i4.DocumentListComponent, typeof i5.DocumentListItemComponent, typeof i6.DocumentUploadComponent, typeof i7.DocumentViewerComponent, typeof i8.DocumentDirective, typeof i9.HasPermissionDirective], [typeof i10.CommonModule, typeof i11.AccordionModule, typeof i12.HttpClientModule, typeof i13.ButtonModule, typeof i14.SidebarModule, typeof i15.FileUploadModule, typeof i16.ProgressBarModule, typeof i17.BadgeModule, typeof i18.ListboxModule, typeof i19.CheckboxModule, typeof i20.TimelineModule, typeof i21.InputTextareaModule, typeof i22.FormsModule, typeof i23.PdfViewerModule, typeof i24.DialogModule, typeof i25.DropdownModule, typeof i26.InputTextModule], [typeof i9.HasPermissionDirective, typeof i1.DocumentContainerComponent, typeof i7.DocumentViewerComponent, typeof i4.DocumentListComponent, typeof i8.DocumentDirective]>;
36
38
  static ɵinj: i0.ɵɵInjectorDeclaration<DocumentModule>;
37
39
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cat-documents-ng",
3
- "version": "0.0.70",
3
+ "version": "0.1.0",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^19.0.0",
6
6
  "@angular/core": "^19.0.0"
package/public-api.d.ts CHANGED
@@ -3,3 +3,4 @@ export * from './lib/document/components/document-container/document-container.c
3
3
  export * from './lib/document/components/document-viewer/document-viewer.component';
4
4
  export * from './lib/document/components/document-list/document-list.component';
5
5
  export * from './lib/document/directives/document.directive';
6
+ export * from './lib/document/directives/permission.directive';