cat-documents-ng 1.0.6 → 1.0.8

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 (211) hide show
  1. package/README.md +322 -322
  2. package/Shared/components/confirmation-dialog/confirmation-dialog.component.d.ts +44 -0
  3. package/Shared/components/table-primary/table-primary.component.d.ts +31 -0
  4. package/Shared/components/table-primary/table-primary.model.d.ts +19 -0
  5. package/Shared/constant/ERROR.d.ts +52 -0
  6. package/Shared/constant/SHARED.d.ts +546 -0
  7. package/{src/Shared/constant/URLS.ts → Shared/constant/URLS.d.ts} +25 -31
  8. package/Shared/services/app-config.service.d.ts +51 -0
  9. package/{src/Shared/services/global-error.handler.ts → Shared/services/global-error.handler.d.ts} +9 -11
  10. package/Shared/services/session.service.d.ts +46 -0
  11. package/Shared/shared.module.d.ts +14 -0
  12. package/fesm2022/cat-documents-ng.mjs +11405 -0
  13. package/fesm2022/cat-documents-ng.mjs.map +1 -0
  14. package/index.d.ts +5 -0
  15. package/lib/document/components/document-actions/document-actions.component.d.ts +78 -0
  16. package/lib/document/components/document-container/document-container.component.d.ts +162 -0
  17. package/lib/document/components/document-content-viewer/document-content-viewer.component.d.ts +291 -0
  18. package/lib/document/components/document-history/document-history.component.d.ts +160 -0
  19. package/lib/document/components/document-list/document-list.component.d.ts +299 -0
  20. package/lib/document/components/document-list-item/document-list-item.component.d.ts +28 -0
  21. package/lib/document/components/document-search/document-search.component.d.ts +77 -0
  22. package/lib/document/components/document-status/document-status.component.d.ts +24 -0
  23. package/lib/document/components/document-upload/document-upload.component.d.ts +321 -0
  24. package/lib/document/components/document-viewer/document-viewer.component.d.ts +137 -0
  25. package/lib/document/components/document-zoom-controls/document-zoom-controls.component.d.ts +33 -0
  26. package/lib/document/components/documents-menu/documents-menu.component.d.ts +110 -0
  27. package/{src/lib/document/components/folder-block/folder-block.component.ts → lib/document/components/folder-block/folder-block.component.d.ts} +12 -28
  28. package/lib/document/components/folder-container/folder-container.component.d.ts +162 -0
  29. package/lib/document/components/linked-document/linked-document.component.d.ts +39 -0
  30. package/lib/document/components/request-document/request-document.component.d.ts +69 -0
  31. package/lib/document/components/sidebar/sidebar.component.d.ts +109 -0
  32. package/lib/document/components/user-list/user-list.component.d.ts +34 -0
  33. package/lib/document/constant/DOCUMENT_HISTORY.d.ts +41 -0
  34. package/lib/document/directives/document.directive.d.ts +20 -0
  35. package/lib/document/directives/permission.directive.d.ts +38 -0
  36. package/lib/document/document.module.d.ts +60 -0
  37. package/{src/lib/document/models/document-alert.model.ts → lib/document/models/document-alert.model.d.ts} +4 -11
  38. package/lib/document/models/document-category.model.d.ts +24 -0
  39. package/lib/document/models/document-history.model.d.ts +94 -0
  40. package/lib/document/models/document-list-response.model.d.ts +33 -0
  41. package/lib/document/models/document-type.model.d.ts +37 -0
  42. package/lib/document/models/document.model.d.ts +44 -0
  43. package/{src/lib/document/models/folder.model.ts → lib/document/models/folder.model.d.ts} +4 -10
  44. package/lib/document/models/status-data.model.d.ts +27 -0
  45. package/lib/document/models/uploaded-file-response.model.d.ts +7 -0
  46. package/lib/document/models/user-list.model.d.ts +8 -0
  47. package/lib/document/services/csv-parser.service.d.ts +88 -0
  48. package/lib/document/services/document-actions.service.d.ts +48 -0
  49. package/lib/document/services/document-content-type.service.d.ts +85 -0
  50. package/lib/document/services/document-history-style.service.d.ts +34 -0
  51. package/lib/document/services/document-history.service.d.ts +42 -0
  52. package/lib/document/services/document-http.service.d.ts +179 -0
  53. package/lib/document/services/document-list.service.d.ts +74 -0
  54. package/lib/document/services/document-menu.service.d.ts +122 -0
  55. package/lib/document/services/document-scroll.service.d.ts +55 -0
  56. package/lib/document/services/document-table-builder.service.d.ts +38 -0
  57. package/lib/document/services/document-upload-business.service.d.ts +107 -0
  58. package/lib/document/services/document-upload-data.service.d.ts +40 -0
  59. package/lib/document/services/document-upload-form.service.d.ts +41 -0
  60. package/lib/document/services/document-upload.service.d.ts +99 -0
  61. package/lib/document/services/document-viewer.service.d.ts +97 -0
  62. package/lib/document/services/document-zoom.service.d.ts +81 -0
  63. package/lib/document/services/document.service.d.ts +161 -0
  64. package/lib/document/services/eml-parser.service.d.ts +116 -0
  65. package/lib/document/services/excel-parser.service.d.ts +169 -0
  66. package/lib/document/services/file-format.service.d.ts +34 -0
  67. package/lib/document/services/status-calculator.service.d.ts +20 -0
  68. package/lib/document/services/user-list.service.d.ts +29 -0
  69. package/lib/document/state/document.query.d.ts +243 -0
  70. package/{src/lib/document/state/document.service.ts → lib/document/state/document.service.d.ts} +15 -46
  71. package/lib/document/state/document.state.d.ts +61 -0
  72. package/lib/document/state/document.store.d.ts +56 -0
  73. package/package.json +11 -5
  74. package/{src/public-api.ts → public-api.d.ts} +0 -4
  75. package/ng-package.json +0 -10
  76. package/src/Shared/components/confirmation-dialog/confirmation-dialog.component.html +0 -3
  77. package/src/Shared/components/confirmation-dialog/confirmation-dialog.component.scss +0 -13
  78. package/src/Shared/components/confirmation-dialog/confirmation-dialog.component.spec.ts +0 -70
  79. package/src/Shared/components/confirmation-dialog/confirmation-dialog.component.ts +0 -133
  80. package/src/Shared/components/table-primary/table-primary.component.html +0 -66
  81. package/src/Shared/components/table-primary/table-primary.component.scss +0 -227
  82. package/src/Shared/components/table-primary/table-primary.component.spec.ts +0 -23
  83. package/src/Shared/components/table-primary/table-primary.component.ts +0 -143
  84. package/src/Shared/components/table-primary/table-primary.model.ts +0 -21
  85. package/src/Shared/constant/ERROR.ts +0 -55
  86. package/src/Shared/constant/PERMISSIONS.ts +0 -17
  87. package/src/Shared/constant/SHARED.ts +0 -936
  88. package/src/Shared/services/app-config.service.spec.ts +0 -19
  89. package/src/Shared/services/app-config.service.ts +0 -73
  90. package/src/Shared/services/session.service.spec.ts +0 -16
  91. package/src/Shared/services/session.service.ts +0 -76
  92. package/src/Shared/shared.module.ts +0 -25
  93. package/src/lib/document/components/csv-viewer/csv-viewer.component.ts +0 -1
  94. package/src/lib/document/components/document-actions/document-actions.component.html +0 -59
  95. package/src/lib/document/components/document-actions/document-actions.component.scss +0 -362
  96. package/src/lib/document/components/document-actions/document-actions.component.spec.ts +0 -297
  97. package/src/lib/document/components/document-actions/document-actions.component.ts +0 -163
  98. package/src/lib/document/components/document-container/document-container.component.html +0 -36
  99. package/src/lib/document/components/document-container/document-container.component.scss +0 -144
  100. package/src/lib/document/components/document-container/document-container.component.spec.ts +0 -110
  101. package/src/lib/document/components/document-container/document-container.component.ts +0 -363
  102. package/src/lib/document/components/document-content-viewer/document-content-viewer.component.html +0 -332
  103. package/src/lib/document/components/document-content-viewer/document-content-viewer.component.scss +0 -1877
  104. package/src/lib/document/components/document-content-viewer/document-content-viewer.component.spec.ts +0 -258
  105. package/src/lib/document/components/document-content-viewer/document-content-viewer.component.ts +0 -664
  106. package/src/lib/document/components/document-history/document-history.component.html +0 -96
  107. package/src/lib/document/components/document-history/document-history.component.scss +0 -392
  108. package/src/lib/document/components/document-history/document-history.component.spec.ts +0 -93
  109. package/src/lib/document/components/document-history/document-history.component.ts +0 -373
  110. package/src/lib/document/components/document-list/document-list.component.html +0 -46
  111. package/src/lib/document/components/document-list/document-list.component.scss +0 -513
  112. package/src/lib/document/components/document-list/document-list.component.spec.ts +0 -486
  113. package/src/lib/document/components/document-list/document-list.component.ts +0 -682
  114. package/src/lib/document/components/document-list-item/document-list-item.component.html +0 -36
  115. package/src/lib/document/components/document-list-item/document-list-item.component.scss +0 -34
  116. package/src/lib/document/components/document-list-item/document-list-item.component.spec.ts +0 -75
  117. package/src/lib/document/components/document-list-item/document-list-item.component.ts +0 -40
  118. package/src/lib/document/components/document-search/document-search.component.html +0 -64
  119. package/src/lib/document/components/document-search/document-search.component.scss +0 -206
  120. package/src/lib/document/components/document-search/document-search.component.spec.ts +0 -82
  121. package/src/lib/document/components/document-search/document-search.component.ts +0 -163
  122. package/src/lib/document/components/document-status/document-status.component.html +0 -31
  123. package/src/lib/document/components/document-status/document-status.component.scss +0 -192
  124. package/src/lib/document/components/document-status/document-status.component.spec.ts +0 -23
  125. package/src/lib/document/components/document-status/document-status.component.ts +0 -87
  126. package/src/lib/document/components/document-upload/document-upload.component.html +0 -160
  127. package/src/lib/document/components/document-upload/document-upload.component.scss +0 -235
  128. package/src/lib/document/components/document-upload/document-upload.component.spec.ts +0 -95
  129. package/src/lib/document/components/document-upload/document-upload.component.ts +0 -668
  130. package/src/lib/document/components/document-viewer/document-viewer.component.html +0 -50
  131. package/src/lib/document/components/document-viewer/document-viewer.component.scss +0 -187
  132. package/src/lib/document/components/document-viewer/document-viewer.component.spec.ts +0 -79
  133. package/src/lib/document/components/document-viewer/document-viewer.component.ts +0 -261
  134. package/src/lib/document/components/document-zoom-controls/document-zoom-controls.component.html +0 -48
  135. package/src/lib/document/components/document-zoom-controls/document-zoom-controls.component.scss +0 -320
  136. package/src/lib/document/components/document-zoom-controls/document-zoom-controls.component.spec.ts +0 -59
  137. package/src/lib/document/components/document-zoom-controls/document-zoom-controls.component.ts +0 -150
  138. package/src/lib/document/components/documents-menu/documents-menu.component.html +0 -44
  139. package/src/lib/document/components/documents-menu/documents-menu.component.scss +0 -363
  140. package/src/lib/document/components/documents-menu/documents-menu.component.spec.ts +0 -23
  141. package/src/lib/document/components/documents-menu/documents-menu.component.ts +0 -316
  142. package/src/lib/document/components/folder-block/folder-block.component.html +0 -46
  143. package/src/lib/document/components/folder-block/folder-block.component.scss +0 -9
  144. package/src/lib/document/components/folder-block/folder-block.component.spec.ts +0 -70
  145. package/src/lib/document/components/folder-container/folder-container.component.html +0 -56
  146. package/src/lib/document/components/folder-container/folder-container.component.scss +0 -20
  147. package/src/lib/document/components/folder-container/folder-container.component.spec.ts +0 -27
  148. package/src/lib/document/components/folder-container/folder-container.component.ts +0 -328
  149. package/src/lib/document/components/linked-document/linked-document.component.html +0 -23
  150. package/src/lib/document/components/linked-document/linked-document.component.scss +0 -10
  151. package/src/lib/document/components/linked-document/linked-document.component.spec.ts +0 -61
  152. package/src/lib/document/components/linked-document/linked-document.component.ts +0 -49
  153. package/src/lib/document/components/request-document/request-document.component.html +0 -86
  154. package/src/lib/document/components/request-document/request-document.component.scss +0 -16
  155. package/src/lib/document/components/request-document/request-document.component.ts +0 -278
  156. package/src/lib/document/components/sidebar/sidebar.component.html +0 -75
  157. package/src/lib/document/components/sidebar/sidebar.component.scss +0 -157
  158. package/src/lib/document/components/sidebar/sidebar.component.spec.ts +0 -114
  159. package/src/lib/document/components/sidebar/sidebar.component.ts +0 -223
  160. package/src/lib/document/components/user-list/user-list.component.html +0 -33
  161. package/src/lib/document/components/user-list/user-list.component.scss +0 -118
  162. package/src/lib/document/components/user-list/user-list.component.spec.ts +0 -23
  163. package/src/lib/document/components/user-list/user-list.component.ts +0 -181
  164. package/src/lib/document/constant/DOCUMENT_HISTORY.ts +0 -52
  165. package/src/lib/document/directives/document.directive.ts +0 -32
  166. package/src/lib/document/directives/permission.directive.spec.ts +0 -0
  167. package/src/lib/document/directives/permission.directive.ts +0 -72
  168. package/src/lib/document/document.module.ts +0 -351
  169. package/src/lib/document/models/document-category.model.ts +0 -30
  170. package/src/lib/document/models/document-history.model.ts +0 -109
  171. package/src/lib/document/models/document-list-response.model.ts +0 -37
  172. package/src/lib/document/models/document-type.model.ts +0 -44
  173. package/src/lib/document/models/document.model.ts +0 -53
  174. package/src/lib/document/models/status-data.model.ts +0 -31
  175. package/src/lib/document/models/uploaded-file-response.model.ts +0 -7
  176. package/src/lib/document/models/user-list.model.ts +0 -10
  177. package/src/lib/document/services/csv-parser.service.spec.ts +0 -97
  178. package/src/lib/document/services/csv-parser.service.ts +0 -303
  179. package/src/lib/document/services/document-actions.service.ts +0 -125
  180. package/src/lib/document/services/document-content-type.service.ts +0 -193
  181. package/src/lib/document/services/document-history-style.service.ts +0 -138
  182. package/src/lib/document/services/document-history.service.ts +0 -129
  183. package/src/lib/document/services/document-http.service.spec.ts +0 -119
  184. package/src/lib/document/services/document-http.service.ts +0 -497
  185. package/src/lib/document/services/document-list.service.ts +0 -195
  186. package/src/lib/document/services/document-menu.service.ts +0 -277
  187. package/src/lib/document/services/document-scroll.service.ts +0 -138
  188. package/src/lib/document/services/document-severity.service.ts +0 -98
  189. package/src/lib/document/services/document-table-builder.service.ts +0 -82
  190. package/src/lib/document/services/document-upload-business.service.ts +0 -326
  191. package/src/lib/document/services/document-upload-data.service.ts +0 -82
  192. package/src/lib/document/services/document-upload-form.service.ts +0 -149
  193. package/src/lib/document/services/document-upload.service.spec.ts +0 -99
  194. package/src/lib/document/services/document-upload.service.ts +0 -209
  195. package/src/lib/document/services/document-viewer.service.ts +0 -279
  196. package/src/lib/document/services/document-zoom.service.spec.ts +0 -56
  197. package/src/lib/document/services/document-zoom.service.ts +0 -164
  198. package/src/lib/document/services/document.service.ts +0 -356
  199. package/src/lib/document/services/eml-parser.service.ts +0 -444
  200. package/src/lib/document/services/excel-parser.service.spec.ts +0 -66
  201. package/src/lib/document/services/excel-parser.service.ts +0 -483
  202. package/src/lib/document/services/file-format.service.spec.ts +0 -16
  203. package/src/lib/document/services/file-format.service.ts +0 -63
  204. package/src/lib/document/services/status-calculator.service.ts +0 -44
  205. package/src/lib/document/services/user-list.service.ts +0 -77
  206. package/src/lib/document/state/document.query.ts +0 -378
  207. package/src/lib/document/state/document.state.ts +0 -100
  208. package/src/lib/document/state/document.store.ts +0 -200
  209. package/tsconfig.lib.json +0 -15
  210. package/tsconfig.lib.prod.json +0 -11
  211. package/tsconfig.spec.json +0 -15
@@ -1,52 +0,0 @@
1
- /**
2
- * Constants for Document History labels and styling
3
- */
4
- export const DOCUMENT_HISTORY = {
5
- // Document History Labels
6
- LABELS: {
7
- DOCUMENT_REQUESTED: 'Document Requested',
8
- DOCUMENT_UPLOADED: 'Document Uploaded',
9
- DOCUMENT_REJECTED: 'Document Rejected',
10
- DOCUMENT_ACCEPTED: 'Document Accepted'
11
- },
12
-
13
- // Icon classes for different actions
14
- ICONS: {
15
- DOCUMENT_REQUESTED: 'pi pi-file',
16
- DOCUMENT_UPLOADED: 'pi pi-cloud-upload',
17
- DOCUMENT_REJECTED: 'pi pi-times',
18
- DOCUMENT_ACCEPTED: 'pi pi-check'
19
- },
20
-
21
- // Text color classes - matching the design in the image
22
- TEXT_COLORS: {
23
- DOCUMENT_REQUESTED: 'text-gray-700', // Dark gray for better readability
24
- DOCUMENT_UPLOADED: 'text-green-700', // Dark green for uploaded
25
- DOCUMENT_REJECTED: 'text-red-700', // Dark red for rejected
26
- DOCUMENT_ACCEPTED: 'text-green-700' // Dark green for accepted
27
- },
28
-
29
- // Background color classes - matching the light gray design from image
30
- BG_COLORS: {
31
- DOCUMENT_REQUESTED: 'bg-gray-100', // Light gray like in the image
32
- DOCUMENT_UPLOADED: 'bg-green-50', // Very light green
33
- DOCUMENT_REJECTED: 'bg-red-50', // Very light red
34
- DOCUMENT_ACCEPTED: 'bg-green-50' // Very light green
35
- },
36
-
37
- // Border color classes - subtle borders
38
- BORDER_COLORS: {
39
- DOCUMENT_REQUESTED: 'border-gray-300', // Medium gray border
40
- DOCUMENT_UPLOADED: 'border-green-300', // Light green border
41
- DOCUMENT_REJECTED: 'border-red-300', // Light red border
42
- DOCUMENT_ACCEPTED: 'border-green-300' // Light green border
43
- },
44
-
45
- // Icon background color classes - matching the circular icon design
46
- ICON_BG_COLORS: {
47
- DOCUMENT_REQUESTED: 'icon-bg-blue', // Blue for requested (as shown in image)
48
- DOCUMENT_UPLOADED: 'icon-bg-green', // Green for uploaded
49
- DOCUMENT_REJECTED: 'icon-bg-red', // Red for rejected
50
- DOCUMENT_ACCEPTED: 'icon-bg-green' // Green for accepted
51
- }
52
- };
@@ -1,32 +0,0 @@
1
- import { Directive, TemplateRef, ViewContainerRef } from "@angular/core";
2
- import { DocumentModel } from "../models/document.model";
3
- import { DocumentHelperService } from "../services/document.service";
4
-
5
- /**
6
- * Directive to display the document data
7
- */
8
- @Directive({
9
- selector: '[doc]',
10
- standalone: false
11
- })
12
- export class DocumentDirective {
13
-
14
- /**
15
- * Creates an instance of DocumentDirective.
16
- * @param documentService Service to get the document data.
17
- * @param templateRef Reference to the template.
18
- * @param vcr View container reference to manage the view.
19
- */
20
- constructor(
21
- private documentService: DocumentHelperService,
22
- private templateRef: TemplateRef<any>,
23
- private vcr: ViewContainerRef
24
- ) {
25
- this.documentService.get().subscribe((document: DocumentModel | null) => {
26
- this.vcr.clear();
27
- if (document) {
28
- this.vcr.createEmbeddedView(this.templateRef, { $implicit: document });
29
- }
30
- });
31
- }
32
- }
@@ -1,72 +0,0 @@
1
- import { Directive, Input, ElementRef, Renderer2, SimpleChanges, OnChanges } from '@angular/core';
2
- import { SessionService } from '../../../Shared/services/session.service';
3
-
4
- /**
5
- * Directive to conditionally show or hide elements based on user permissions.
6
- * @class HasPermissionDirective
7
- * @typedef {HasPermissionDirective}
8
- */
9
- @Directive({
10
- selector: '[permission]',
11
- standalone: false
12
- })
13
- export class HasPermissionDirective implements OnChanges {
14
-
15
- /**
16
- * The required permission(s) to display the element.
17
- * Accepts a single string or an array of strings.
18
- * @type {string | string[]}
19
- */
20
- @Input() permission?: string | string[];
21
-
22
- /**
23
- * Creates an instance of HasPermissionDirective.
24
- * @param {ElementRef} el - Reference to the host element.
25
- * @param {Renderer2} renderer - Angular Renderer for DOM manipulation.
26
- * @param {SessionService} sessionService - Service to retrieve user permissions.
27
- */
28
- constructor(
29
- private el: ElementRef,
30
- private renderer: Renderer2,
31
- public sessionService: SessionService
32
- ) {}
33
-
34
- /**
35
- * Lifecycle hook that is called when input properties change.
36
- * @param {SimpleChanges} changes - The changes in input properties.
37
- */
38
- ngOnChanges(changes: SimpleChanges) {
39
- if (changes['permission']) {
40
- this.checkPermission();
41
- }
42
- }
43
-
44
- /**
45
- * Checks if the user has the required permission(s).
46
- * Hides the element if the permission is not found.
47
- */
48
- private checkPermission() {
49
- // If no permission is required (empty string, null, or undefined), show the element
50
- if (!this.permission || this.permission === '' || (Array.isArray(this.permission) && this.permission.length === 0)) {
51
- this.renderer.removeStyle(this.el.nativeElement, 'display');
52
- return;
53
- }
54
-
55
- const userPermissionsObjects = this.sessionService.getUserPermissions();
56
- const userPermissionNames = userPermissionsObjects?.map((perm: any) => perm.name) || [];
57
-
58
- const requiredPermissions = Array.isArray(this.permission)
59
- ? this.permission
60
- : [this.permission];
61
-
62
- const hasPermission = requiredPermissions.some(permission =>
63
- userPermissionNames.includes(permission)
64
- );
65
-
66
- if (!hasPermission) {
67
- this.renderer.setStyle(this.el.nativeElement, 'display', 'none');
68
- } else {
69
- this.renderer.removeStyle(this.el.nativeElement, 'display');
70
- }
71
- }
72
- }
@@ -1,351 +0,0 @@
1
- import { APP_INITIALIZER, CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core';
2
- import { CommonModule } from '@angular/common';
3
- import { DocumentContainerComponent } from './components/document-container/document-container.component';
4
- import { FolderContainerComponent } from './components/folder-container/folder-container.component';
5
- import { FolderBlockComponent } from './components/folder-block/folder-block.component';
6
- import { DocumentListComponent } from './components/document-list/document-list.component';
7
- import { AccordionModule } from 'primeng/accordion';
8
- import { DocumentListItemComponent } from './components/document-list-item/document-list-item.component';
9
- import { ButtonModule } from 'primeng/button';
10
- import { SidebarModule } from 'primeng/sidebar';
11
- import { FileUploadModule } from 'primeng/fileupload';
12
- import { DocumentUploadComponent } from './components/document-upload/document-upload.component';
13
- import { MessageService } from 'primeng/api';
14
- import { ConfirmationService } from 'primeng/api';
15
- import { HTTP_INTERCEPTORS, HttpClientModule } from '@angular/common/http';
16
- import { ProgressBarModule } from 'primeng/progressbar';
17
- import { BadgeModule } from 'primeng/badge';
18
- import { ListboxModule } from 'primeng/listbox';
19
- import { TimelineModule } from 'primeng/timeline';
20
- import { CheckboxModule } from 'primeng/checkbox';
21
- import { InputTextareaModule } from 'primeng/inputtextarea';
22
- import { FormsModule } from '@angular/forms';
23
- import { DocumentViewerComponent } from './components/document-viewer/document-viewer.component';
24
- import { DocumentHistoryComponent } from './components/document-history/document-history.component';
25
- import { DocumentContentViewerComponent } from './components/document-content-viewer/document-content-viewer.component';
26
- import { DocumentZoomControlsComponent } from './components/document-zoom-controls/document-zoom-controls.component';
27
- import { PdfViewerModule } from 'ng2-pdf-viewer';
28
- import { NgxDocViewerModule } from 'ngx-doc-viewer';
29
- import { DialogModule } from 'primeng/dialog';
30
- import { AppConfigService } from '../../Shared/services/app-config.service';
31
- import { GlobalErrorHandler } from '../../Shared/services/global-error.handler';
32
- import { DropdownModule } from 'primeng/dropdown';
33
- import { InputTextModule } from 'primeng/inputtext';
34
- import { DocumentDirective } from './directives/document.directive';
35
- import { LinkedDocumentComponent } from './components/linked-document/linked-document.component';
36
- import { DocumentsMenuComponent } from './components/documents-menu/documents-menu.component';
37
- import { MenuModule } from 'primeng/menu';
38
- import { PanelMenuModule } from 'primeng/panelmenu';
39
- import { CardModule } from 'primeng/card';
40
- import { TableModule } from 'primeng/table';
41
- import { UserListComponent } from './components/user-list/user-list.component';
42
- import { DocumentStatusComponent } from './components/document-status/document-status.component';
43
- import { DocumentActionsComponent } from './components/document-actions/document-actions.component';
44
- import { DocumentSearchComponent } from './components/document-search/document-search.component';
45
- import { SharedModule } from '../../Shared/shared.module';
46
- import { DocumentActionsService } from './services/document-actions.service';
47
- import { DocumentContentTypeService } from './services/document-content-type.service';
48
- import { SidebarComponent } from './components/sidebar/sidebar.component';
49
- import { RequestDocumentComponent } from './components/request-document/request-document.component';
50
- import { RadioButtonModule } from 'primeng/radiobutton';
51
- import { ToastModule } from 'primeng/toast';
52
- import { TooltipModule } from 'primeng/tooltip';
53
- import { MessagesModule } from 'primeng/messages';
54
- import { MessageModule } from 'primeng/message';
55
-
56
- /**
57
- * @module DocumentModule
58
- *
59
- * The `DocumentModule` handles the organization and display of document and folder components
60
- * in the application. This module is designed to support features like folder containers,
61
- * document lists, and individual document items.
62
- */
63
- @NgModule({
64
- declarations: [
65
- /**
66
- * The main container for managing documents.
67
- * DocumentContainerComponent
68
- */
69
- DocumentContainerComponent,
70
-
71
- /**
72
- * A container component to manage folders.
73
- * FolderContainerComponent
74
- */
75
- FolderContainerComponent,
76
-
77
- /**
78
- * A block component that represents an individual folder.
79
- * FolderBlockComponent
80
- */
81
- FolderBlockComponent,
82
-
83
- /**
84
- * A component to display a list of documents.
85
- * DocumentListComponent
86
- */
87
- DocumentListComponent,
88
-
89
- /**
90
- * A component representing an individual item in the document list.
91
- * DocumentListItemComponent
92
- */
93
- DocumentListItemComponent,
94
-
95
- /**
96
- * A component representing to upload a file.
97
- */
98
- DocumentUploadComponent,
99
-
100
- /**
101
- * A component representing and allow you to view the document.
102
- */
103
- DocumentViewerComponent,
104
-
105
- /**
106
- * A component representing document history timeline.
107
- */
108
- DocumentHistoryComponent,
109
-
110
- /**
111
- * A reusable component for viewing different types of document content.
112
- */
113
- DocumentContentViewerComponent,
114
-
115
- /**
116
- * A component providing zoom controls for document viewing.
117
- */
118
- DocumentZoomControlsComponent,
119
-
120
- /**
121
- * A directive to show the document.
122
- */
123
- DocumentDirective,
124
-
125
- /**
126
- * A component which have linked documents.
127
- */
128
- LinkedDocumentComponent,
129
- DocumentsMenuComponent,
130
- UserListComponent,
131
- DocumentStatusComponent,
132
- DocumentActionsComponent,
133
- DocumentSearchComponent,
134
- /**
135
- * A sidebar component for content projection.
136
- */
137
- SidebarComponent,
138
- /**
139
- * A component to request a document (without upload), with description.
140
- */
141
- RequestDocumentComponent,
142
-
143
- ],
144
- imports: [
145
- /**
146
- * Angular's CommonModule is imported to access common directives like `ngIf` and `ngFor`.
147
- */
148
- CommonModule,
149
-
150
- /**
151
- * PrimeNG AccordionModule is used for creating collapsible sections in the UI.
152
- */
153
- AccordionModule,
154
-
155
- /**
156
- * HttpClientModule for the http calls
157
- */
158
- HttpClientModule,
159
-
160
- /**
161
- * PrimeNG ButtonModule is used for creating buttons in the UI.
162
- */
163
- ButtonModule,
164
-
165
- /**
166
- * PrimeNG SidebarModule is used for creating sidebars.
167
- */
168
- SidebarModule,
169
-
170
- /**
171
- * PrimeNG FileUploadModule is used for uploading file.
172
- */
173
- FileUploadModule,
174
-
175
- /**
176
- * PrimeNG ProgressBarModule is used for showing progress.
177
- */
178
- ProgressBarModule,
179
-
180
- /**
181
- * PrimeNG BadgeModule is used for showing badge value.
182
- */
183
- BadgeModule,
184
-
185
- /**
186
- * PrimeNG ListboxModule is used for showing listbox value.
187
- */
188
- ListboxModule,
189
-
190
- /**
191
- * PrimeNG CheckboxModule is used for showing checkbox value.
192
- */
193
- CheckboxModule,
194
-
195
- /**
196
- * PrimeNG RadioButtonModule is used for showing radio button values.
197
- */
198
- RadioButtonModule,
199
-
200
- /**
201
- * PrimeNG TimelineModule is used for showing timeline value.
202
- */
203
- TimelineModule,
204
- /**
205
- * PrimeNG InputTextareaModule is used for showing textarea value.
206
- */
207
- InputTextareaModule,
208
- /**
209
- * FormsModule to handle the forms.
210
- */
211
- FormsModule,
212
- /**
213
- * PdfViewerModule to handle and make visible the pdf.
214
- */
215
- PdfViewerModule,
216
- /**
217
- * NgxDocViewerModule to handle and make visible Office documents.
218
- */
219
- NgxDocViewerModule,
220
- /**
221
- * PrimeNG DialogModule is used for showing dialog.
222
- */
223
- DialogModule,
224
- /**
225
- * PrimeNG DropdownModule is used for creating dropdown menus, allowing users to select options from a list.
226
- */
227
- DropdownModule,
228
- /**
229
- * PrimeNG InputTextModule is used for creating InputTextFeilds, allowing users to enter name for a document.
230
- */
231
- InputTextModule,
232
-
233
- MenuModule,
234
- PanelMenuModule,
235
- CardModule,
236
- TableModule,
237
- SharedModule,
238
- InputTextareaModule,
239
- ToastModule,
240
- TooltipModule,
241
- MessagesModule,
242
- MessageModule
243
-
244
- ],
245
- exports: [
246
- /**
247
- * Exports the `DocumentContainerComponent` to be used in other modules.
248
- */
249
- DocumentContainerComponent,
250
- /**
251
- * Exports the `DocumentViewerComponent` to be used in other modules.
252
- */
253
- DocumentViewerComponent,
254
-
255
- /**
256
- * Exports the `DocumentContentViewerComponent` to be used in other modules.
257
- */
258
- DocumentContentViewerComponent,
259
-
260
- /**
261
- * Exports the `DocumentZoomControlsComponent` to be used in other modules.
262
- */
263
- DocumentZoomControlsComponent,
264
- /**
265
- * Exports the `DocumentActionsComponent` to be used in other modules.
266
- */
267
- DocumentActionsComponent,
268
- /**
269
- * A component to display a list of documents.
270
- * DocumentListComponent
271
- */
272
- DocumentListComponent,
273
-
274
- /**
275
- * A component for uploading documents.
276
- * DocumentUploadComponent
277
- */
278
- DocumentUploadComponent,
279
-
280
- /**
281
- * A directive to show the document.
282
- */
283
- DocumentDirective,
284
-
285
- /**
286
- * A component for searching documents.
287
- */
288
- DocumentSearchComponent,
289
-
290
- /**
291
- * A sidebar component for content projection.
292
- */
293
- SidebarComponent,
294
- RequestDocumentComponent,
295
-
296
-
297
- ],
298
- providers: [
299
- /**
300
- * Provide the messageservice to be used in other components.
301
- */
302
- MessageService,
303
-
304
- /**
305
- * Provide the DocumentActionsService to be used in other components.
306
- */
307
- DocumentActionsService,
308
-
309
- /**
310
- * Provide the DocumentContentTypeService to be used in other components.
311
- */
312
- DocumentContentTypeService,
313
-
314
- /**
315
- * Provide the ConfirmationService to be used in other components.
316
- */
317
- ConfirmationService,
318
-
319
- /**
320
- * Provide the messageservice to be used in other components.
321
- */
322
- { provide: GlobalErrorHandler, useClass: GlobalErrorHandler },
323
- /**
324
- * Initializes the application configuration by loading it from the AppConfigService
325
- * before the application starts.
326
- * This ensures that the configuration is available for the rest of the app when needed.
327
- * The configuration is loaded asynchronously using the APP_INITIALIZER.
328
- * @returns {Function} - A function that loads the configuration from the AppConfigService.
329
- */
330
- {
331
- provide: APP_INITIALIZER,
332
- /**
333
- * This useFactory is executed when the app initializes.
334
- * It calls the AppConfigService to load the configuration.
335
- * If an error occurs, it throws an error.
336
- * @param {AppConfigService} configService - The service responsible for loading the application configuration.
337
- * @returns {Function} - A function that loads the configuration from the AppConfigService.
338
- */
339
- useFactory: (configService: AppConfigService) => () =>
340
- configService.loadAppConfig().catch((error) => {
341
- throw new Error(error);
342
- }),
343
- deps: [AppConfigService],
344
- multi: true,
345
- },
346
-
347
- ]
348
- ,
349
- schemas: [CUSTOM_ELEMENTS_SCHEMA]
350
- })
351
- export class DocumentModule { }
@@ -1,30 +0,0 @@
1
- export interface DocumentCategoryStatus {
2
- // Uppercase keys (original format)
3
- Pending?: number;
4
- Reviewing?: number;
5
- Accepted?: number;
6
- Rejected?: number;
7
-
8
- // Lowercase keys (new format from API)
9
- pending?: number;
10
- reviewing?: number;
11
- approved?: number; // Maps to Accepted
12
- rejected?: number;
13
- }
14
-
15
- export interface DocumentCategoryItem {
16
- _id: string;
17
- label: string;
18
- icon: string;
19
- status: DocumentCategoryStatus;
20
- isSelectable?: boolean; // Indicates if the menu item can be selected based on filtered sections
21
- }
22
-
23
- export interface DocumentCategory {
24
- label: string;
25
- items: DocumentCategoryItem[];
26
- }
27
-
28
- export interface DocumentCategoriesResponse {
29
- categories: DocumentCategory[];
30
- }
@@ -1,109 +0,0 @@
1
- /**
2
- * Represents a document in the history item.
3
- */
4
- export interface HistoryDocument {
5
- /**
6
- * Unique identifier of the document
7
- */
8
- _id?: string | null;
9
- /**
10
- * Name of the document
11
- */
12
- docName: string | null;
13
-
14
- /**
15
- * URL of the document
16
- */
17
- documentUrl: string | null;
18
-
19
- /**
20
- * Content type of the document
21
- */
22
- contentType: string | null;
23
-
24
- /**
25
- * Parent request/task document id, if applicable
26
- */
27
- parentDocumentId?: string | null;
28
-
29
- /** Optional alias and flags preserved if backend provides them */
30
- aliasName?: string | null;
31
- isAliasEditable?: boolean | null;
32
- documentTypeName?: string | null;
33
- isSystemDocument?: boolean | null;
34
- }
35
-
36
- /**
37
- * Represents a document history item.
38
- */
39
- export interface DocumentHistoryItem {
40
- /**
41
- * The label/action type (e.g., "Document Uploaded", "Document Rejected", "Document Accepted")
42
- */
43
- label: string;
44
-
45
- /**
46
- * The date and time of the action
47
- */
48
- dateTime: string;
49
-
50
- /**
51
- * Description or comment for the action
52
- */
53
- requestDescription: string;
54
-
55
- /**
56
- * URL of the document (optional) - legacy field
57
- */
58
- documentUrl?: string;
59
-
60
- /**
61
- * Name of the document (optional) - legacy field
62
- */
63
- docName?: string;
64
-
65
- /**
66
- * Array of documents associated with this history item
67
- */
68
- documents?: HistoryDocument[];
69
-
70
- /**
71
- * Name of the user who performed the action
72
- */
73
- userName: string;
74
-
75
- /**
76
- * Role of the user who performed the action
77
- */
78
- userRole: string;
79
- actionColor:string
80
- actionIcon:string
81
- actionIconBgColor:string
82
- actionBgColor:string
83
- actionBorderColor:string
84
- }
85
-
86
- /**
87
- * Represents a document history section with header and list of items.
88
- */
89
- export interface DocumentHistorySection {
90
- /**
91
- * The header/title of the section (e.g., "Initial Request", "Document History")
92
- */
93
- header: string;
94
-
95
- /**
96
- * List of history items in this section
97
- */
98
- list: DocumentHistoryItem[];
99
- }
100
-
101
- /**
102
- * Represents the complete document history response.
103
- */
104
- export interface DocumentHistoryResponse {
105
- /**
106
- * Array of document history sections
107
- */
108
- sections: DocumentHistorySection[];
109
- }
@@ -1,37 +0,0 @@
1
- import { DocumentModel } from './document.model';
2
-
3
- /**
4
- * Represents a document list item within a category
5
- */
6
- export interface DocumentListItem {
7
- _id: string;
8
- fileName: string;
9
- docName: string;
10
- fileSize: string;
11
- documentUrl: string;
12
- status: string;
13
- isUploaded: boolean;
14
- statusId?: string;
15
- uploadedOn: string;
16
- ownerName: string;
17
- contentType: string;
18
- aliasName?: string;
19
- documentType?: string;
20
- documentTypeName?: string;
21
- isAliasEditable?: boolean;
22
- parentDocumentId ?: string;
23
- isSystemDocument?: boolean;
24
- }
25
-
26
-
27
- /**
28
- * Represents the complete document list response
29
- */
30
- export interface DocumentListResponse {
31
- label: string;
32
- categoryDescription: string;
33
- totalDocs: number;
34
- acceptedDocs: number;
35
- list: DocumentListItem[];
36
- completed: string;
37
- }