cat-documents-ng 0.1.13 → 0.1.14

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.
@@ -4,6 +4,7 @@ import { DocumentModel } from '../../models/document.model';
4
4
  import { FolderBlockModel } from '../../models/folder.model';
5
5
  import { DocumentHttpService } from '../../services/document-http.service';
6
6
  import { DocumentQuery } from '../../state/document.query';
7
+ import { DocumentStore } from '../../state/document.store';
7
8
  import * as i0 from "@angular/core";
8
9
  /**
9
10
  *This component is responsible for managing and displaying a list of documents.
@@ -11,16 +12,18 @@ import * as i0 from "@angular/core";
11
12
  * @typedef {DocumentContainerComponent}
12
13
  */
13
14
  export declare class DocumentContainerComponent implements OnInit {
15
+ documentStore: DocumentStore;
14
16
  documentService: DocumentService;
15
17
  documentQuery: DocumentQuery;
16
18
  documentHttpService: DocumentHttpService;
17
19
  /**
18
20
  * Creates an instance of DocumentContainerComponent.
21
+ * @param {DocumentStore} documentStore - Query Store service to manage store document-related state.
19
22
  * @param {DocumentService} documentService - Service to manage document-related operations.
20
23
  * @param {DocumentQuery} documentQuery - Query service to manage document-related state.
21
24
  * @param {DocumentHttpService} documentHttpService - Service to make HTTP requests related to documents.
22
25
  */
23
- constructor(documentService: DocumentService, documentQuery: DocumentQuery, documentHttpService: DocumentHttpService);
26
+ constructor(documentStore: DocumentStore, documentService: DocumentService, documentQuery: DocumentQuery, documentHttpService: DocumentHttpService);
24
27
  /**
25
28
  * Get contextId in input.
26
29
  * @type {string}
@@ -62,9 +65,9 @@ export declare class DocumentContainerComponent implements OnInit {
62
65
  * @returns {void}
63
66
  */
64
67
  /**
65
- * Fetches the folder data from the API.
66
- * @returns {void}
67
- */
68
+ * Fetches the folder data from the API.
69
+ * @returns {void}
70
+ */
68
71
  fetchFolder(): void;
69
72
  /**
70
73
  * Fetches the document data from the API.
@@ -80,16 +80,7 @@ export declare class DocumentListComponent implements OnInit {
80
80
  * @memberof DocumentListComponent
81
81
  */
82
82
  selectedOption: string | null;
83
- /**
84
- * The set of permissions available for this component.
85
- */
86
83
  PERMISSION: typeof PERMISSIONS;
87
- /**
88
- * The file name associated with the document.
89
- * It may be undefined until a file is selected or loaded.
90
- * @type {string | undefined}
91
- */
92
- fileName: string | undefined;
93
84
  /**
94
85
  * Creates an instance of DocumentListComponent.
95
86
  * @class
@@ -117,19 +108,11 @@ export declare class DocumentListComponent implements OnInit {
117
108
  * @memberof DocumentListComponent
118
109
  */
119
110
  handleClickForDocument(document: DocumentModel): void;
120
- /**
121
- * Handles the save click event to update the document's file name.
122
- * This method creates a payload with the updated file name and calls the
123
- * updateDocumentName() method from the documentHttpService. On a successful update,
124
- * it logs a message with the document's ID.
125
- * @returns {void}
126
- */
127
- handleSaveClick(): void;
128
111
  /**
129
112
  * Closes the dialog and resets the selected document.
130
113
  * @memberof DocumentListComponent
131
114
  */
132
- handleCloseModal(): void;
115
+ handleCloseModel(): void;
133
116
  /**
134
117
  * Handles the upload action for a document.
135
118
  * Validates if a document type is selected and logs the result.
@@ -17,6 +17,11 @@ export declare class DocumentViewerComponent implements OnChanges, OnDestroy {
17
17
  * @type {*}
18
18
  */
19
19
  selectedDocument?: DocumentModel;
20
+ /**
21
+ * Get the selected document by user.
22
+ * @type {*}
23
+ */
24
+ documentList?: DocumentModel[];
20
25
  /**
21
26
  * Indicates whether a checkbox is selected.
22
27
  * @type {boolean}
@@ -45,6 +50,8 @@ export declare class DocumentViewerComponent implements OnChanges, OnDestroy {
45
50
  private subscription;
46
51
  /**
47
52
  * Initializes a new instance of the DocumentViewerComponent.
53
+ * @param {DocumentHttpService} documentHttpService - Handle the http service.
54
+ * @param {DocumentService} documentService - Handle the states.
48
55
  */
49
56
  constructor(documentHttpService: DocumentHttpService, documentService: DocumentService);
50
57
  /**
@@ -52,6 +59,7 @@ export declare class DocumentViewerComponent implements OnChanges, OnDestroy {
52
59
  * @returns {void}
53
60
  */
54
61
  ngOnChanges(): void;
62
+ handleSelectedDocument(document: DocumentModel): void;
55
63
  /**
56
64
  * Determines if the given content type is an image.
57
65
  * @param {string | undefined} contentType - The MIME type of the content.
@@ -60,5 +68,5 @@ export declare class DocumentViewerComponent implements OnChanges, OnDestroy {
60
68
  isImage(contentType?: string): boolean;
61
69
  ngOnDestroy(): void;
62
70
  static ɵfac: i0.ɵɵFactoryDeclaration<DocumentViewerComponent, never>;
63
- static ɵcmp: i0.ɵɵComponentDeclaration<DocumentViewerComponent, "document-viewer", never, { "selectedDocument": { "alias": "selectedDocument"; "required": false; }; }, {}, never, ["*"], false, never>;
71
+ static ɵcmp: i0.ɵɵComponentDeclaration<DocumentViewerComponent, "document-viewer", never, { "selectedDocument": { "alias": "selectedDocument"; "required": false; }; "documentList": { "alias": "documentList"; "required": false; }; }, {}, never, ["*"], false, never>;
64
72
  }
@@ -0,0 +1,38 @@
1
+ import { EventEmitter } from '@angular/core';
2
+ import { DocumentModel } from '../../models/document.model';
3
+ import * as i0 from "@angular/core";
4
+ /**
5
+ * Description placeholder
6
+ * @class LinkedDocumentComponent
7
+ * @typedef {LinkedDocumentComponent}
8
+ * @implements {OnChanges}
9
+ */
10
+ export declare class LinkedDocumentComponent {
11
+ /**
12
+ * Selected document for view.
13
+ * @type {?DocumentModel}
14
+ */
15
+ selectedDocument?: DocumentModel;
16
+ /**
17
+ * Whole document list.
18
+ * @type {?DocumentModel[]}
19
+ */
20
+ documentList?: DocumentModel[];
21
+ /**
22
+ * Changed selected document.
23
+ * @type {*}
24
+ */
25
+ selectedDocumentChange: EventEmitter<DocumentModel>;
26
+ /**
27
+ * Filtered documents.
28
+ * @type {DocumentModel[]}
29
+ */
30
+ filteredDocuments: DocumentModel[];
31
+ /**
32
+ * Handle the click on the document.
33
+ * @param {DocumentModel} document - Clicked document.
34
+ */
35
+ handleDocumentClick(document: DocumentModel): void;
36
+ static ɵfac: i0.ɵɵFactoryDeclaration<LinkedDocumentComponent, never>;
37
+ static ɵcmp: i0.ɵɵComponentDeclaration<LinkedDocumentComponent, "app-linked-document", never, { "selectedDocument": { "alias": "selectedDocument"; "required": false; }; "documentList": { "alias": "documentList"; "required": false; }; }, { "selectedDocumentChange": "selectedDocumentChange"; }, never, never, false, never>;
38
+ }
@@ -8,23 +8,24 @@ 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
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";
11
+ import * as i10 from "./components/linked-document/linked-document.component";
12
+ import * as i11 from "@angular/common";
13
+ import * as i12 from "primeng/accordion";
14
+ import * as i13 from "@angular/common/http";
15
+ import * as i14 from "primeng/button";
16
+ import * as i15 from "primeng/sidebar";
17
+ import * as i16 from "primeng/fileupload";
18
+ import * as i17 from "primeng/progressbar";
19
+ import * as i18 from "primeng/badge";
20
+ import * as i19 from "primeng/listbox";
21
+ import * as i20 from "primeng/checkbox";
22
+ import * as i21 from "primeng/timeline";
23
+ import * as i22 from "primeng/inputtextarea";
24
+ import * as i23 from "@angular/forms";
25
+ import * as i24 from "ng2-pdf-viewer";
26
+ import * as i25 from "primeng/dialog";
27
+ import * as i26 from "primeng/dropdown";
28
+ import * as i27 from "primeng/inputtext";
28
29
  /**
29
30
  * @module DocumentModule
30
31
  *
@@ -34,6 +35,6 @@ import * as i26 from "primeng/inputtext";
34
35
  */
35
36
  export declare class DocumentModule {
36
37
  static ɵfac: i0.ɵɵFactoryDeclaration<DocumentModule, never>;
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]>;
38
+ 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.LinkedDocumentComponent], [typeof i11.CommonModule, typeof i12.AccordionModule, typeof i13.HttpClientModule, typeof i14.ButtonModule, typeof i15.SidebarModule, typeof i16.FileUploadModule, typeof i17.ProgressBarModule, typeof i18.BadgeModule, typeof i19.ListboxModule, typeof i20.CheckboxModule, typeof i21.TimelineModule, typeof i22.InputTextareaModule, typeof i23.FormsModule, typeof i24.PdfViewerModule, typeof i25.DialogModule, typeof i26.DropdownModule, typeof i27.InputTextModule], [typeof i9.HasPermissionDirective, typeof i1.DocumentContainerComponent, typeof i7.DocumentViewerComponent, typeof i4.DocumentListComponent, typeof i8.DocumentDirective]>;
38
39
  static ɵinj: i0.ɵɵInjectorDeclaration<DocumentModule>;
39
40
  }
@@ -40,5 +40,4 @@ export declare class DocumentModel {
40
40
  * @type {?string}
41
41
  */
42
42
  contentType?: string;
43
- documentName?: string;
44
43
  }
@@ -35,7 +35,7 @@ export declare class DocumentHttpService {
35
35
  * @param {string} contextId - The context ID to fetch the document.
36
36
  * @returns {Observable<any>} Observable that emits the transformed data for dropdown options.
37
37
  */
38
- getFoldersData(contextId: string | undefined): Observable<FolderBlockModel[]>;
38
+ getFoldersData(contextId: string): Observable<FolderBlockModel[]>;
39
39
  /**
40
40
  * Fetches a document by its path name and transforms the response for dropdown options.
41
41
  * Includes error handling for failed API requests.
@@ -55,15 +55,6 @@ export declare class DocumentHttpService {
55
55
  * @returns {Observable<any>} Observable that emits the transformed data for dropdown options.
56
56
  */
57
57
  getDocumentByFolderID(folderId: string, contextId: string): Observable<DocumentModel[]>;
58
- /**
59
- * Updates the name of a document.
60
- * This method sends an HTTP PUT request to update the document's file name using the provided document ID and payload.
61
- * In case of an error, it will return an observable that throws an Error.
62
- * @param {string} documentId - The unique identifier of the document to update.
63
- * @param {any} payload - The payload containing the updated document data (e.g., fileName).
64
- * @returns {Observable<DocumentModel>} An observable that emits the updated DocumentModel.
65
- */
66
- updateDocumentName(documentId: string, payload: any): Observable<DocumentModel>;
67
58
  static ɵfac: i0.ɵɵFactoryDeclaration<DocumentHttpService, never>;
68
59
  static ɵprov: i0.ɵɵInjectableDeclaration<DocumentHttpService>;
69
60
  }
@@ -3,13 +3,14 @@ import { DocumentStore } from './document.store';
3
3
  import { DocumentState } from './document.state';
4
4
  import { Observable } from 'rxjs';
5
5
  import { Message } from 'primeng/api';
6
+ import { DocumentModel } from '../models/document.model';
6
7
  import * as i0 from "@angular/core";
7
8
  /**
8
9
  * Query service for managing document state.
9
10
  * This class extends Akita's `QueryEntity` to provide additional functionality for querying document data.
10
11
  * @class DocumentQuery
11
12
  * @typedef {DocumentQuery}
12
- * @extends {QueryEntity<DocumentState>}
13
+ * @augments {QueryEntity<DocumentState>}
13
14
  */
14
15
  export declare class DocumentQuery extends QueryEntity<DocumentState> {
15
16
  protected store: DocumentStore;
@@ -29,6 +30,11 @@ export declare class DocumentQuery extends QueryEntity<DocumentState> {
29
30
  * @returns {Observable<Message>} Observable that emits the current Message.
30
31
  */
31
32
  selectMessages(): Observable<Message[]>;
33
+ /**
34
+ * Selects the set documents.
35
+ * @returns {Observable<DocumentModel[]>} Observable that emits the documets.
36
+ */
37
+ selectDocumets(): Observable<DocumentModel[]>;
32
38
  static ɵfac: i0.ɵɵFactoryDeclaration<DocumentQuery, never>;
33
39
  static ɵprov: i0.ɵɵInjectableDeclaration<DocumentQuery>;
34
40
  }
@@ -25,6 +25,7 @@ export interface DocumentState extends EntityState<DocumentModel, string> {
25
25
  documentAlert: DocumentAlertModel;
26
26
  folders: FolderBlockModel[];
27
27
  messages: Message[];
28
+ documentList: DocumentModel[];
28
29
  }
29
30
  /**
30
31
  * Creates the initial state for the `DocumentState` store.
@@ -1,6 +1,7 @@
1
1
  import { EntityStore } from '@datorama/akita';
2
2
  import { DocumentState } from './document.state';
3
3
  import { Message } from 'primeng/api';
4
+ import { DocumentModel } from '../models/document.model';
4
5
  import * as i0 from "@angular/core";
5
6
  /**
6
7
  * Store that manages the state of documents in the application.
@@ -20,6 +21,7 @@ export declare class DocumentStore extends EntityStore<DocumentState> {
20
21
  setDocumentAlert(documentAlert: any): void;
21
22
  setParentDocumentTypeId(parentDocumentTypeId: string): void;
22
23
  setMessage(message: Message[]): void;
24
+ setDocumentList(documents: DocumentModel[]): void;
23
25
  static ɵfac: i0.ɵɵFactoryDeclaration<DocumentStore, never>;
24
26
  static ɵprov: i0.ɵɵInjectableDeclaration<DocumentStore>;
25
27
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cat-documents-ng",
3
- "version": "0.1.13",
3
+ "version": "0.1.14",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^19.0.0",
6
6
  "@angular/core": "^19.0.0"