cat-documents-ng 0.0.5 → 0.0.7

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 (75) hide show
  1. package/.github/PULL_REQUEST_TEMPLATE.md +32 -0
  2. package/.github/workflows/pr-validation.yml +87 -0
  3. package/.husky/pre-commit +4 -0
  4. package/README.md +59 -63
  5. package/angular.json +119 -0
  6. package/eslint.config.cjs +148 -0
  7. package/package.json +66 -19
  8. package/projects/cat-document-lib/README.md +63 -0
  9. package/{jest.config.mjs → projects/cat-document-lib/jest.config.mjs} +18 -18
  10. package/{ng-package.json → projects/cat-document-lib/ng-package.json} +10 -10
  11. package/projects/cat-document-lib/package-lock.json +599 -0
  12. package/projects/cat-document-lib/package.json +19 -0
  13. package/{setup-jest.ts → projects/cat-document-lib/setup-jest.ts} +9 -9
  14. package/{src/shared → projects/cat-document-lib/src/Shared}/constant/SHARED.ts +231 -231
  15. package/{src/shared → projects/cat-document-lib/src/Shared}/constant/URLS.ts +31 -31
  16. package/{src/shared → projects/cat-document-lib/src/Shared}/services/app-config.service.spec.ts +16 -16
  17. package/{src/shared → projects/cat-document-lib/src/Shared}/services/app-config.service.ts +73 -73
  18. package/{src/shared → projects/cat-document-lib/src/Shared}/services/global-error.handler.ts +29 -29
  19. package/{src → projects/cat-document-lib/src}/lib/document/components/document-container/document-container.component.html +5 -5
  20. package/{src → projects/cat-document-lib/src}/lib/document/components/document-container/document-container.component.ts +82 -82
  21. package/{src → projects/cat-document-lib/src}/lib/document/components/document-list/document-list.component.html +34 -34
  22. package/{src → projects/cat-document-lib/src}/lib/document/components/document-list/document-list.component.scss +11 -11
  23. package/{src → projects/cat-document-lib/src}/lib/document/components/document-list/document-list.component.ts +73 -73
  24. package/{src → projects/cat-document-lib/src}/lib/document/components/document-list-item/document-list-item.component.html +32 -32
  25. package/{src → projects/cat-document-lib/src}/lib/document/components/document-list-item/document-list-item.component.scss +21 -21
  26. package/{src → projects/cat-document-lib/src}/lib/document/components/document-list-item/document-list-item.component.spec.ts +23 -23
  27. package/{src → projects/cat-document-lib/src}/lib/document/components/document-list-item/document-list-item.component.ts +40 -40
  28. package/{src → projects/cat-document-lib/src}/lib/document/components/document-upload/document-upload.component.html +55 -55
  29. package/{src → projects/cat-document-lib/src}/lib/document/components/document-upload/document-upload.component.scss +26 -26
  30. package/{src → projects/cat-document-lib/src}/lib/document/components/document-upload/document-upload.component.spec.ts +24 -24
  31. package/{src → projects/cat-document-lib/src}/lib/document/components/document-upload/document-upload.component.ts +184 -184
  32. package/{src → projects/cat-document-lib/src}/lib/document/components/document-viewer/document-viewer.component.html +244 -244
  33. package/{src → projects/cat-document-lib/src}/lib/document/components/document-viewer/document-viewer.component.scss +35 -35
  34. package/{src → projects/cat-document-lib/src}/lib/document/components/document-viewer/document-viewer.component.spec.ts +21 -21
  35. package/{src → projects/cat-document-lib/src}/lib/document/components/document-viewer/document-viewer.component.ts +125 -125
  36. package/{src → projects/cat-document-lib/src}/lib/document/components/folder-block/folder-block.component.html +46 -46
  37. package/{src → projects/cat-document-lib/src}/lib/document/components/folder-block/folder-block.component.ts +51 -51
  38. package/{src → projects/cat-document-lib/src}/lib/document/components/folder-container/folder-container.component.html +1 -1
  39. package/{src → projects/cat-document-lib/src}/lib/document/components/folder-container/folder-container.component.ts +29 -29
  40. package/{src → projects/cat-document-lib/src}/lib/document/document.module.ts +191 -191
  41. package/{src → projects/cat-document-lib/src}/lib/document/models/document.model.ts +39 -39
  42. package/{src → projects/cat-document-lib/src}/lib/document/models/folder.model.ts +35 -35
  43. package/{src → projects/cat-document-lib/src}/lib/document/services/file-format.service.spec.ts +16 -16
  44. package/{src → projects/cat-document-lib/src}/lib/document/services/file-format.service.ts +41 -41
  45. package/{src → projects/cat-document-lib/src}/lib/document/state/document.query.ts +23 -23
  46. package/{src → projects/cat-document-lib/src}/lib/document/state/document.service.ts +95 -95
  47. package/{src → projects/cat-document-lib/src}/lib/document/state/document.state.ts +39 -39
  48. package/{src → projects/cat-document-lib/src}/lib/document/state/document.store.ts +23 -23
  49. package/{src → projects/cat-document-lib/src}/public-api.ts +8 -8
  50. package/{tsconfig.lib.json → projects/cat-document-lib/tsconfig.lib.json} +15 -15
  51. package/{tsconfig.lib.prod.json → projects/cat-document-lib/tsconfig.lib.prod.json} +11 -11
  52. package/{tsconfig.spec.json → projects/cat-document-lib/tsconfig.spec.json} +15 -15
  53. package/public/favicon.ico +0 -0
  54. package/src/app/app.component.html +1 -0
  55. package/src/app/app.component.scss +0 -0
  56. package/src/app/app.component.spec.ts +29 -0
  57. package/src/app/app.component.ts +15 -0
  58. package/src/app/app.module.ts +60 -0
  59. package/src/app/app.routing.module.ts +19 -0
  60. package/src/index.html +13 -0
  61. package/src/main.ts +5 -0
  62. package/src/styles.scss +39 -0
  63. package/tsconfig.app.json +15 -0
  64. package/tsconfig.json +32 -0
  65. package/src/assets/config/app.config.json +0 -4
  66. /package/{src → projects/cat-document-lib/src}/assets/images/FolderImg.png +0 -0
  67. /package/{src → projects/cat-document-lib/src}/assets/images/Frame.png +0 -0
  68. /package/{src → projects/cat-document-lib/src}/assets/images/document.png +0 -0
  69. /package/{src → projects/cat-document-lib/src}/lib/document/components/document-container/document-container.component.scss +0 -0
  70. /package/{src → projects/cat-document-lib/src}/lib/document/components/document-container/document-container.component.spec.ts +0 -0
  71. /package/{src → projects/cat-document-lib/src}/lib/document/components/document-list/document-list.component.spec.ts +0 -0
  72. /package/{src → projects/cat-document-lib/src}/lib/document/components/folder-block/folder-block.component.scss +0 -0
  73. /package/{src → projects/cat-document-lib/src}/lib/document/components/folder-block/folder-block.component.spec.ts +0 -0
  74. /package/{src → projects/cat-document-lib/src}/lib/document/components/folder-container/folder-container.component.scss +0 -0
  75. /package/{src → projects/cat-document-lib/src}/lib/document/components/folder-container/folder-container.component.spec.ts +0 -0
@@ -1,125 +1,125 @@
1
- import {
2
- Component,
3
- Input,
4
- OnInit,
5
- ViewEncapsulation,
6
- } from '@angular/core';
7
- import { DynamicDialogRef } from 'primeng/dynamicdialog';
8
- import { COUNTRIES, DUMMYSUMMARY, SUPPORTED_IMAGE_TYPES } from '../../../../Shared/constant/SHARED';
9
- /**
10
- * For list box data.
11
- * @interface Country
12
- * @typedef {Country}
13
- */
14
- interface Country {
15
- /**
16
- * For the name of the property.
17
- * @type {string}
18
- */
19
- name: string;
20
- /**
21
- * For the unique code of country.
22
- * @type {string}
23
- */
24
- code: string;
25
- /**
26
- * Mark check or unchecked.
27
- * @type {?boolean}
28
- */
29
- checked?: boolean;
30
- }
31
-
32
- /**
33
- * Component for viewing and managing document details.
34
- * @class DocumentViewerComponent
35
- * @typedef {DocumentViewerComponent}
36
- * @implements {OnInit}
37
- */
38
- @Component({
39
- selector: 'document-viewer',
40
- templateUrl: './document-viewer.component.html',
41
- standalone : false,
42
- styleUrl: './document-viewer.component.scss',
43
- encapsulation: ViewEncapsulation.None,
44
- })
45
- export class DocumentViewerComponent implements OnInit {
46
- /**
47
- * Get the selected document by user.
48
- * @type {*}
49
- */
50
- @Input() selectedDocument: any;
51
- /**
52
- * Handle notes data.
53
- * @type {!string}
54
- */
55
- notes!: string;
56
- /**
57
- * Country data according to Country model.
58
- * @type {!Country[]}
59
- */
60
- countries!: Country[];
61
- /**
62
- * Indicates whether a checkbox is selected.
63
- * @type {boolean}
64
- */
65
- checked: boolean = false;
66
-
67
- /**
68
- * The currently selected country.
69
- * @type {Country}
70
- */
71
- selectedCountry!: Country;
72
-
73
- /**
74
- * Reference to the dynamic dialog used for displaying additional details.
75
- * @type {(DynamicDialogRef | undefined)}
76
- */
77
- ref: DynamicDialogRef | undefined;
78
-
79
- /**
80
- * Indicates whether the document has been verified.
81
- * @type {boolean}
82
- */
83
- isVerified: boolean = false;
84
-
85
- /**
86
- * Additional property details related to the document.
87
- * @type {any}
88
- */
89
- propertyDetails: any;
90
-
91
- /**
92
- * List of predefined events used for summaries or alerts.
93
- * @type {*}
94
- */
95
- events = DUMMYSUMMARY;
96
-
97
- /**
98
- * Data used for displaying alert messages.
99
- * @type {any}
100
- */
101
- alertData!: any;
102
-
103
- /**
104
- * Initializes a new instance of the DocumentViewerComponent.
105
- */
106
- constructor() {}
107
-
108
- /**
109
- * Lifecycle hook that is called after data-bound properties are initialized.
110
- * Initializes the list of countries.
111
- */
112
- ngOnInit() {
113
- this.countries = COUNTRIES;
114
- }
115
-
116
-
117
- /**
118
- * Determines if the given content type is an image.
119
- * @param {string} contentType - The MIME type of the content.
120
- * @returns {boolean} `true` if the content type is an image; otherwise, `false`.
121
- */
122
- isImage(contentType: string): boolean {
123
- return SUPPORTED_IMAGE_TYPES.includes(contentType);
124
- }
125
- }
1
+ import {
2
+ Component,
3
+ Input,
4
+ OnInit,
5
+ ViewEncapsulation,
6
+ } from '@angular/core';
7
+ import { DynamicDialogRef } from 'primeng/dynamicdialog';
8
+ import { COUNTRIES, DUMMYSUMMARY, SUPPORTED_IMAGE_TYPES } from '../../../../Shared/constant/SHARED';
9
+ /**
10
+ * For list box data.
11
+ * @interface Country
12
+ * @typedef {Country}
13
+ */
14
+ interface Country {
15
+ /**
16
+ * For the name of the property.
17
+ * @type {string}
18
+ */
19
+ name: string;
20
+ /**
21
+ * For the unique code of country.
22
+ * @type {string}
23
+ */
24
+ code: string;
25
+ /**
26
+ * Mark check or unchecked.
27
+ * @type {?boolean}
28
+ */
29
+ checked?: boolean;
30
+ }
31
+
32
+ /**
33
+ * Component for viewing and managing document details.
34
+ * @class DocumentViewerComponent
35
+ * @typedef {DocumentViewerComponent}
36
+ * @implements {OnInit}
37
+ */
38
+ @Component({
39
+ selector: 'document-viewer',
40
+ templateUrl: './document-viewer.component.html',
41
+ standalone : false,
42
+ styleUrl: './document-viewer.component.scss',
43
+ encapsulation: ViewEncapsulation.None,
44
+ })
45
+ export class DocumentViewerComponent implements OnInit {
46
+ /**
47
+ * Get the selected document by user.
48
+ * @type {*}
49
+ */
50
+ @Input() selectedDocument: any;
51
+ /**
52
+ * Handle notes data.
53
+ * @type {!string}
54
+ */
55
+ notes!: string;
56
+ /**
57
+ * Country data according to Country model.
58
+ * @type {!Country[]}
59
+ */
60
+ countries!: Country[];
61
+ /**
62
+ * Indicates whether a checkbox is selected.
63
+ * @type {boolean}
64
+ */
65
+ checked: boolean = false;
66
+
67
+ /**
68
+ * The currently selected country.
69
+ * @type {Country}
70
+ */
71
+ selectedCountry!: Country;
72
+
73
+ /**
74
+ * Reference to the dynamic dialog used for displaying additional details.
75
+ * @type {(DynamicDialogRef | undefined)}
76
+ */
77
+ ref: DynamicDialogRef | undefined;
78
+
79
+ /**
80
+ * Indicates whether the document has been verified.
81
+ * @type {boolean}
82
+ */
83
+ isVerified: boolean = false;
84
+
85
+ /**
86
+ * Additional property details related to the document.
87
+ * @type {any}
88
+ */
89
+ propertyDetails: any;
90
+
91
+ /**
92
+ * List of predefined events used for summaries or alerts.
93
+ * @type {*}
94
+ */
95
+ events = DUMMYSUMMARY;
96
+
97
+ /**
98
+ * Data used for displaying alert messages.
99
+ * @type {any}
100
+ */
101
+ alertData!: any;
102
+
103
+ /**
104
+ * Initializes a new instance of the DocumentViewerComponent.
105
+ */
106
+ constructor() {}
107
+
108
+ /**
109
+ * Lifecycle hook that is called after data-bound properties are initialized.
110
+ * Initializes the list of countries.
111
+ */
112
+ ngOnInit() {
113
+ this.countries = COUNTRIES;
114
+ }
115
+
116
+
117
+ /**
118
+ * Determines if the given content type is an image.
119
+ * @param {string} contentType - The MIME type of the content.
120
+ * @returns {boolean} `true` if the content type is an image; otherwise, `false`.
121
+ */
122
+ isImage(contentType: string): boolean {
123
+ return SUPPORTED_IMAGE_TYPES.includes(contentType);
124
+ }
125
+ }
@@ -1,46 +1,46 @@
1
- <div class="card folder-info my-4">
2
- <div class="text-900 text-xl font-semibold mb-3">Folders</div>
3
- <div class="grid">
4
- <div *ngFor="let folder of folderBlocks" class="col-12 md:col-6 xl:col-4">
5
- <div
6
- class="p-3 border-1 h-full surface-border flex flex-column justify-content-between surface-100 hover:surface-100 cursor-pointer border-round"
7
- (click)="handleClickForFilter(folder._id)"
8
- >
9
- <div class="icon">
10
- <img src="../../../../assets/images/FolderImg.png" alt="" />
11
- </div>
12
- <div class="flex flex-column">
13
- <span class="text-600 mt-2"> {{ folder.fileCount }} Files </span>
14
- <span class="text-900 text-lg mt-2 mb-2 font-semibold font-medium">
15
- {{ folder.text }}
16
- </span>
17
- </div>
18
- <hr />
19
- <div class="flex justify-content-between">
20
- <div class="flex flex-column">
21
- <span>Missing</span>
22
- <span
23
- [ngClass]="{
24
- 'text-pink-500': missingFileCount > 0,
25
- 'text-green-500': missingFileCount === 0
26
- }"
27
- >
28
- {{ missingFileCount }}
29
- </span>
30
- </div>
31
- <div class="flex flex-column">
32
- <span>Pending</span>
33
- <span
34
- [ngClass]="{
35
- 'text-yellow-500': pendingFileCount > 0,
36
- 'text-green-500': pendingFileCount === 0
37
- }"
38
- >
39
- {{ pendingFileCount }}
40
- </span>
41
- </div>
42
- </div>
43
- </div>
44
- </div>
45
- </div>
46
- </div>
1
+ <div class="card folder-info my-4">
2
+ <div class="text-900 text-xl font-semibold mb-3">Folders</div>
3
+ <div class="grid">
4
+ <div *ngFor="let folder of folderBlocks" class="col-12 md:col-6 xl:col-4">
5
+ <div
6
+ class="p-3 border-1 h-full surface-border flex flex-column justify-content-between surface-100 hover:surface-100 cursor-pointer border-round"
7
+ (click)="handleClickForFilter(folder._id)"
8
+ >
9
+ <div class="icon">
10
+ <img src="../../../../assets/images/FolderImg.png" alt="" />
11
+ </div>
12
+ <div class="flex flex-column">
13
+ <span class="text-600 mt-2"> {{ folder.fileCount }} Files </span>
14
+ <span class="text-900 text-lg mt-2 mb-2 font-semibold font-medium">
15
+ {{ folder.text }}
16
+ </span>
17
+ </div>
18
+ <hr />
19
+ <div class="flex justify-content-between">
20
+ <div class="flex flex-column">
21
+ <span>Missing</span>
22
+ <span
23
+ [ngClass]="{
24
+ 'text-pink-500': missingFileCount > 0,
25
+ 'text-green-500': missingFileCount === 0
26
+ }"
27
+ >
28
+ {{ missingFileCount }}
29
+ </span>
30
+ </div>
31
+ <div class="flex flex-column">
32
+ <span>Pending</span>
33
+ <span
34
+ [ngClass]="{
35
+ 'text-yellow-500': pendingFileCount > 0,
36
+ 'text-green-500': pendingFileCount === 0
37
+ }"
38
+ >
39
+ {{ pendingFileCount }}
40
+ </span>
41
+ </div>
42
+ </div>
43
+ </div>
44
+ </div>
45
+ </div>
46
+ </div>
@@ -1,51 +1,51 @@
1
- import { Component, Input } from '@angular/core';
2
- import { DocumentStore } from '../../state/document.store';
3
- import { FolderBlockModel } from '../../models/folder.model';
4
- import { SHARED } from '../../../../Shared/constant/SHARED';
5
-
6
- /**
7
- * The `FolderBlockComponent` is responsible for displaying a block of folders and
8
- * providing filtering functionality based on folder IDs.
9
- *
10
- * It uses data from the `DocumentStore` and constants from the `SHARED` configuration
11
- * to display missing and pending file counts.
12
- */
13
- @Component({
14
- selector: 'lib-folder-block',
15
- standalone: false,
16
- templateUrl: './folder-block.component.html',
17
- styleUrl: './folder-block.component.scss'
18
- })
19
- export class FolderBlockComponent {
20
- /**
21
- * Array of folder blocks data to display.
22
- * Each folder is represented as a `FolderBlockModel`.
23
- */
24
- @Input() folderBlocks: FolderBlockModel[] = [];
25
-
26
- /** Number of missing files, sourced from the `SHARED` constants. */
27
- missingFileCount = SHARED.MISSINGCOUNT;
28
-
29
- /** Number of pending files, sourced from the `SHARED` constants. */
30
- pendingFileCount = SHARED.PENDINGCOUNT;
31
-
32
- /**
33
- * Injects the `DocumentStore` service to manage and access document-related state.
34
- * @param {DocumentStore} documentStore - The state management store for documents.
35
- */
36
- constructor(public documentStore: DocumentStore) {}
37
-
38
- /**
39
- * Handles the click event for filtering based on the provided folder ID.
40
- * This method validates the folder ID and returns it for further processing.
41
- * If the folder ID is not provided, an empty string is returned.
42
- * @param {string} folderBlockId - The unique identifier of the folder to filter by.
43
- * @returns {string} The validated folder ID, or an empty string if the input is invalid.
44
- */
45
- handleClickForFilter(folderBlockId: string): string {
46
- if (!folderBlockId) {
47
- return SHARED.EMPTY;
48
- }
49
- return folderBlockId;
50
- }
51
- }
1
+ import { Component, Input } from '@angular/core';
2
+ import { DocumentStore } from '../../state/document.store';
3
+ import { FolderBlockModel } from '../../models/folder.model';
4
+ import { SHARED } from '../../../../Shared/constant/SHARED';
5
+
6
+ /**
7
+ * The `FolderBlockComponent` is responsible for displaying a block of folders and
8
+ * providing filtering functionality based on folder IDs.
9
+ *
10
+ * It uses data from the `DocumentStore` and constants from the `SHARED` configuration
11
+ * to display missing and pending file counts.
12
+ */
13
+ @Component({
14
+ selector: 'lib-folder-block',
15
+ standalone: false,
16
+ templateUrl: './folder-block.component.html',
17
+ styleUrl: './folder-block.component.scss'
18
+ })
19
+ export class FolderBlockComponent {
20
+ /**
21
+ * Array of folder blocks data to display.
22
+ * Each folder is represented as a `FolderBlockModel`.
23
+ */
24
+ @Input() folderBlocks: FolderBlockModel[] = [];
25
+
26
+ /** Number of missing files, sourced from the `SHARED` constants. */
27
+ missingFileCount = SHARED.MISSINGCOUNT;
28
+
29
+ /** Number of pending files, sourced from the `SHARED` constants. */
30
+ pendingFileCount = SHARED.PENDINGCOUNT;
31
+
32
+ /**
33
+ * Injects the `DocumentStore` service to manage and access document-related state.
34
+ * @param {DocumentStore} documentStore - The state management store for documents.
35
+ */
36
+ constructor(public documentStore: DocumentStore) {}
37
+
38
+ /**
39
+ * Handles the click event for filtering based on the provided folder ID.
40
+ * This method validates the folder ID and returns it for further processing.
41
+ * If the folder ID is not provided, an empty string is returned.
42
+ * @param {string} folderBlockId - The unique identifier of the folder to filter by.
43
+ * @returns {string} The validated folder ID, or an empty string if the input is invalid.
44
+ */
45
+ handleClickForFilter(folderBlockId: string): string {
46
+ if (!folderBlockId) {
47
+ return SHARED.EMPTY;
48
+ }
49
+ return folderBlockId;
50
+ }
51
+ }
@@ -1,2 +1,2 @@
1
-
1
+
2
2
  <lib-folder-block [folderBlocks]="folderBlocks"></lib-folder-block>
@@ -1,29 +1,29 @@
1
- import { Component, Input } from '@angular/core';
2
- import { FOLDERPANEL } from '../../../../Shared/constant/SHARED';
3
- import { DocumentModel } from '../../models/document.model';
4
-
5
- /**
6
- * The `FolderContainerComponent` is responsible for rendering a container
7
- * that displays a list of documents and associated folder panel data.
8
- *
9
- * This component utilizes the `FOLDERPANEL` constant for folder panel data
10
- * and accepts a document list input of type `DocumentModel`.
11
- */
12
- @Component({
13
- selector: 'lib-folder-container',
14
- standalone: false,
15
- templateUrl: './folder-container.component.html',
16
- styleUrl: './folder-container.component.scss'
17
- })
18
- export class FolderContainerComponent {
19
- /**
20
- * A list of documents passed as input to the component.
21
- * Represents the document data to be displayed in the folder container.
22
- */
23
- @Input() documentList?: DocumentModel[];
24
-
25
- /**
26
- * Folder blocks data, sourced from the `SHARED` constants.
27
- */
28
- folderBlocks = FOLDERPANEL;
29
- }
1
+ import { Component, Input } from '@angular/core';
2
+ import { FOLDERPANEL } from '../../../../Shared/constant/SHARED';
3
+ import { DocumentModel } from '../../models/document.model';
4
+
5
+ /**
6
+ * The `FolderContainerComponent` is responsible for rendering a container
7
+ * that displays a list of documents and associated folder panel data.
8
+ *
9
+ * This component utilizes the `FOLDERPANEL` constant for folder panel data
10
+ * and accepts a document list input of type `DocumentModel`.
11
+ */
12
+ @Component({
13
+ selector: 'lib-folder-container',
14
+ standalone: false,
15
+ templateUrl: './folder-container.component.html',
16
+ styleUrl: './folder-container.component.scss'
17
+ })
18
+ export class FolderContainerComponent {
19
+ /**
20
+ * A list of documents passed as input to the component.
21
+ * Represents the document data to be displayed in the folder container.
22
+ */
23
+ @Input() documentList?: DocumentModel[];
24
+
25
+ /**
26
+ * Folder blocks data, sourced from the `SHARED` constants.
27
+ */
28
+ folderBlocks = FOLDERPANEL;
29
+ }