cat-documents-ng 0.0.21 → 0.0.23

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.
@@ -0,0 +1,67 @@
1
+ import { DocumentService } from '../state/document.service';
2
+ import { DocumentStore } from '../state/document.store';
3
+ import { MessageService } from 'primeng/api';
4
+ import * as i0 from "@angular/core";
5
+ /**
6
+ * Service for handling document uploads.
7
+ * @class DocumentUploadService
8
+ * @typedef {DocumentUploadService}
9
+ */
10
+ export declare class DocumentUploadService {
11
+ documentService: DocumentService;
12
+ documentUploadStore: DocumentStore;
13
+ messageService: MessageService;
14
+ /**
15
+ * The file to upload.
16
+ * @type {*}
17
+ */
18
+ uploadedFile: any;
19
+ /**
20
+ * Represent contextId
21
+ * @type {string}
22
+ */
23
+ contextId: string;
24
+ /**
25
+ * Represent document name
26
+ * @type {string}
27
+ */
28
+ docName: string;
29
+ /**
30
+ * Represent document id
31
+ * @type {string}
32
+ */
33
+ docTypeId: string;
34
+ /**
35
+ * Creates an instance of DocumentUploadService.
36
+ * @param {DocumentService} documentService - Service for handling document uploads.
37
+ * @param {DocumentStore} documentUploadStore - Store for managing uploaded documents.
38
+ * @param {MessageService} messageService - Service for displaying messages.
39
+ * @returns {void}
40
+ */
41
+ constructor(documentService: DocumentService, documentUploadStore: DocumentStore, messageService: MessageService);
42
+ /**
43
+ * Prepares the files for upload by creating a FormData object.
44
+ * This method appends each file to the FormData for submission.
45
+ * @returns {void}
46
+ */
47
+ handleTemplatedUpload(): void;
48
+ /**
49
+ * Get the file and contextId
50
+ * @param file - The file to upload.
51
+ * @param contextId - The contextId to upload.
52
+ */
53
+ getUploadFileData(file: File, contextId: string): void;
54
+ /**
55
+ * Get the document name and document type id
56
+ * @param documentName - The document name to upload.
57
+ * @param documentTypeId - The document type id to upload.
58
+ */
59
+ getDocumentNameAndType(documentName: string, documentTypeId: string): void;
60
+ /**
61
+ * Handle the creation of formdata.
62
+ * @returns {*} - The formdata object.
63
+ */
64
+ handleCreateFormData(): FormData | null;
65
+ static ɵfac: i0.ɵɵFactoryDeclaration<DocumentUploadService, never>;
66
+ static ɵprov: i0.ɵɵInjectableDeclaration<DocumentUploadService>;
67
+ }
@@ -0,0 +1,28 @@
1
+ import { QueryEntity } from '@datorama/akita';
2
+ import { DocumentStore } from './document.store';
3
+ import { DocumentState } from './document.state';
4
+ import { Observable } from 'rxjs';
5
+ import * as i0 from "@angular/core";
6
+ /**
7
+ * Query service for managing document state.
8
+ * This class extends Akita's `QueryEntity` to provide additional functionality for querying document data.
9
+ * @class DocumentQuery
10
+ * @typedef {DocumentQuery}
11
+ * @extends {QueryEntity<DocumentState>}
12
+ */
13
+ export declare class DocumentQuery extends QueryEntity<DocumentState> {
14
+ protected store: DocumentStore;
15
+ constructor(store: DocumentStore);
16
+ /**
17
+ * Selects the currently selected folder ID from the document state.
18
+ * @returns {Observable<string | null>} Observable that emits the currently selected folder ID.
19
+ */
20
+ getParentDocumentTypeId(): string | null;
21
+ /**
22
+ * Selects the currently selected folder ID from the document state.
23
+ * @returns {Observable<string | null>} Observable that emits the currently selected folder ID.
24
+ */
25
+ selectParentDocumentTypeId(): Observable<string | null>;
26
+ static ɵfac: i0.ɵɵFactoryDeclaration<DocumentQuery, never>;
27
+ static ɵprov: i0.ɵɵInjectableDeclaration<DocumentQuery>;
28
+ }
@@ -1,13 +1,13 @@
1
1
  import { EntityState } from '@datorama/akita';
2
2
  import { DocumentModel } from '../models/document.model';
3
+ import { DocumentTypeModel } from '../models/document-type.model';
4
+ import { DocumentAlertModel } from '../models/document-alert.model';
5
+ import { FolderBlockModel } from '../models/folder.model';
3
6
  /**
4
7
  * Represents the state of the documents in the application.
5
- *
6
8
  * This interface extends Akita's `EntityState` to include additional properties
7
9
  * for managing document-specific data, such as `records`, `filteredRecords` and `folderId`.
8
- *
9
- * @extends EntityState<DocumentModel, string>
10
- *
10
+ * @interface DocumentState
11
11
  * @property {any[]} records - A collection of records related to documents.
12
12
  * @property {any[]} filteredRecords - A collection of filteredRecords related to documents.
13
13
  * @property {string | null} folderId - The ID of the currently selected folder, or `null` if no folder is selected.
@@ -18,13 +18,16 @@ export interface DocumentState extends EntityState<DocumentModel, string> {
18
18
  folderId: string | null;
19
19
  isDialogOpen: boolean;
20
20
  filteredRecords: DocumentModel[];
21
+ dropdownOptions: DocumentTypeModel[];
22
+ uploadedDocumentFiles: DocumentModel[];
23
+ parentDocumentTypeId: string | null;
24
+ documentAlert: DocumentAlertModel;
25
+ folders: FolderBlockModel[];
21
26
  }
22
27
  /**
23
28
  * Creates the initial state for the `DocumentState` store.
24
- *
25
29
  * This function provides default values for all properties in the `DocumentState` interface,
26
30
  * ensuring the store starts with a consistent initial structure.
27
- *
28
31
  * @returns {DocumentState} The initial state of the document store.
29
32
  */
30
33
  export declare function createInitialState(): DocumentState;
@@ -3,18 +3,21 @@ import { DocumentState } from './document.state';
3
3
  import * as i0 from "@angular/core";
4
4
  /**
5
5
  * Store that manages the state of documents in the application.
6
- *
7
6
  * The `DocumentStore` class extends Akita's `EntityStore` to manage the entity state for documents.
8
7
  * It uses the `createInitialState` function to initialize the store with default values and
9
8
  * is configured with the name `'documents'`.
10
- *
11
- * @extends EntityStore<DocumentState>
9
+ * @augments EntityStore<DocumentState>
12
10
  */
13
11
  export declare class DocumentStore extends EntityStore<DocumentState> {
14
12
  /**
15
13
  * Creates an instance of `DocumentStore` with the initial state of the documents.
16
14
  */
17
15
  constructor();
16
+ setUploadedDocumentFiles(files: any[]): void;
17
+ setFolders(folders: any): void;
18
+ setDocumentTypes(documentType: any): void;
19
+ setDocumentAlert(documentAlert: any): void;
20
+ setParentDocumentTypeId(parentDocumentTypeId: string): void;
18
21
  static ɵfac: i0.ɵɵFactoryDeclaration<DocumentStore, never>;
19
22
  static ɵprov: i0.ɵɵInjectableDeclaration<DocumentStore>;
20
23
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cat-documents-ng",
3
- "version": "0.0.21",
3
+ "version": "0.0.23",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^19.0.0",
6
6
  "@angular/core": "^19.0.0"