cat-documents-ng 1.0.2 → 1.0.4

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 (142) hide show
  1. package/README.md +298 -35
  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/Shared/constant/URLS.d.ts +123 -0
  8. package/Shared/services/app-config.service.d.ts +51 -0
  9. package/{projects/cat-document-lib/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 +11392 -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/{projects/cat-document-lib/src/lib/document/components/folder-block/folder-block.component.ts → lib/document/components/folder-block/folder-block.component.d.ts} +12 -26
  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/lib/document/models/document-alert.model.d.ts +38 -0
  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/{projects/cat-document-lib/src/lib/document/models/folder.model.ts → lib/document/models/folder.model.d.ts} +7 -13
  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/{projects/cat-document-lib/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 +19 -57
  74. package/public-api.d.ts +27 -0
  75. package/src/assets/images/Document interface.png +0 -0
  76. package/src/assets/images/Document upload.png +0 -0
  77. package/src/assets/images/Pdf viewer dialog.png +0 -0
  78. package/.github/PULL_REQUEST_TEMPLATE.md +0 -32
  79. package/.husky/pre-commit +0 -4
  80. package/angular.json +0 -119
  81. package/eslint.config.cjs +0 -148
  82. package/projects/cat-document-lib/README.md +0 -63
  83. package/projects/cat-document-lib/ng-package.json +0 -11
  84. package/projects/cat-document-lib/package.json +0 -16
  85. package/projects/cat-document-lib/setup-jest.ts +0 -1
  86. package/projects/cat-document-lib/src/lib/document/components/document-container/document-container.component.html +0 -6
  87. package/projects/cat-document-lib/src/lib/document/components/document-container/document-container.component.scss +0 -0
  88. package/projects/cat-document-lib/src/lib/document/components/document-container/document-container.component.spec.ts +0 -0
  89. package/projects/cat-document-lib/src/lib/document/components/document-container/document-container.component.ts +0 -82
  90. package/projects/cat-document-lib/src/lib/document/components/document-list/document-list.component.html +0 -35
  91. package/projects/cat-document-lib/src/lib/document/components/document-list/document-list.component.scss +0 -12
  92. package/projects/cat-document-lib/src/lib/document/components/document-list/document-list.component.spec.ts +0 -0
  93. package/projects/cat-document-lib/src/lib/document/components/document-list/document-list.component.ts +0 -73
  94. package/projects/cat-document-lib/src/lib/document/components/document-list-item/document-list-item.component.html +0 -33
  95. package/projects/cat-document-lib/src/lib/document/components/document-list-item/document-list-item.component.scss +0 -22
  96. package/projects/cat-document-lib/src/lib/document/components/document-list-item/document-list-item.component.spec.ts +0 -23
  97. package/projects/cat-document-lib/src/lib/document/components/document-list-item/document-list-item.component.ts +0 -40
  98. package/projects/cat-document-lib/src/lib/document/components/document-upload/document-upload.component.html +0 -56
  99. package/projects/cat-document-lib/src/lib/document/components/document-upload/document-upload.component.scss +0 -26
  100. package/projects/cat-document-lib/src/lib/document/components/document-upload/document-upload.component.spec.ts +0 -24
  101. package/projects/cat-document-lib/src/lib/document/components/document-upload/document-upload.component.ts +0 -184
  102. package/projects/cat-document-lib/src/lib/document/components/document-viewer/document-viewer.component.html +0 -244
  103. package/projects/cat-document-lib/src/lib/document/components/document-viewer/document-viewer.component.scss +0 -36
  104. package/projects/cat-document-lib/src/lib/document/components/document-viewer/document-viewer.component.spec.ts +0 -21
  105. package/projects/cat-document-lib/src/lib/document/components/document-viewer/document-viewer.component.ts +0 -125
  106. package/projects/cat-document-lib/src/lib/document/components/folder-block/folder-block.component.html +0 -46
  107. package/projects/cat-document-lib/src/lib/document/components/folder-block/folder-block.component.scss +0 -0
  108. package/projects/cat-document-lib/src/lib/document/components/folder-block/folder-block.component.spec.ts +0 -0
  109. package/projects/cat-document-lib/src/lib/document/components/folder-container/folder-container.component.html +0 -2
  110. package/projects/cat-document-lib/src/lib/document/components/folder-container/folder-container.component.scss +0 -0
  111. package/projects/cat-document-lib/src/lib/document/components/folder-container/folder-container.component.spec.ts +0 -0
  112. package/projects/cat-document-lib/src/lib/document/components/folder-container/folder-container.component.ts +0 -29
  113. package/projects/cat-document-lib/src/lib/document/document.module.ts +0 -187
  114. package/projects/cat-document-lib/src/lib/document/models/document.model.ts +0 -39
  115. package/projects/cat-document-lib/src/lib/document/services/file-format.service.spec.ts +0 -16
  116. package/projects/cat-document-lib/src/lib/document/services/file-format.service.ts +0 -41
  117. package/projects/cat-document-lib/src/lib/document/state/document.query.ts +0 -23
  118. package/projects/cat-document-lib/src/lib/document/state/document.state.ts +0 -39
  119. package/projects/cat-document-lib/src/lib/document/state/document.store.ts +0 -23
  120. package/projects/cat-document-lib/src/public-api.ts +0 -8
  121. package/projects/cat-document-lib/src/shared/constant/SHARED.ts +0 -232
  122. package/projects/cat-document-lib/src/shared/constant/URLS.ts +0 -31
  123. package/projects/cat-document-lib/src/shared/services/app-config.service.spec.ts +0 -16
  124. package/projects/cat-document-lib/src/shared/services/app-config.service.ts +0 -73
  125. package/projects/cat-document-lib/tsconfig.lib.json +0 -15
  126. package/projects/cat-document-lib/tsconfig.lib.prod.json +0 -11
  127. package/projects/cat-document-lib/tsconfig.spec.json +0 -15
  128. package/public/favicon.ico +0 -0
  129. package/src/app/app.component.html +0 -1
  130. package/src/app/app.component.scss +0 -0
  131. package/src/app/app.component.spec.ts +0 -29
  132. package/src/app/app.component.ts +0 -15
  133. package/src/app/app.module.ts +0 -60
  134. package/src/app/app.routing.module.ts +0 -19
  135. package/src/index.html +0 -13
  136. package/src/main.ts +0 -5
  137. package/src/styles.scss +0 -39
  138. package/tsconfig.app.json +0 -15
  139. package/tsconfig.json +0 -32
  140. /package/{projects/cat-document-lib/src → src}/assets/images/FolderImg.png +0 -0
  141. /package/{projects/cat-document-lib/src → src}/assets/images/Frame.png +0 -0
  142. /package/{projects/cat-document-lib/src → src}/assets/images/document.png +0 -0
@@ -0,0 +1,56 @@
1
+ import { EntityStore } from '@datorama/akita';
2
+ import { DocumentState } from './document.state';
3
+ import { DocumentCategory } from '../models/document-category.model';
4
+ import { Message } from 'primeng/api';
5
+ import { DocumentModel } from '../models/document.model';
6
+ import { UserListModel } from '../models/user-list.model';
7
+ import { StatusDataModel } from '../models/status-data.model';
8
+ import { DocumentListResponse } from '../models/document-list-response.model';
9
+ import { DocumentListItem } from '../models/document-list-response.model';
10
+ import { DocumentHistorySection } from '../models/document-history.model';
11
+ import * as i0 from "@angular/core";
12
+ /**
13
+ * Store that manages the state of documents in the application.
14
+ * The `DocumentStore` class extends Akita's `EntityStore` to manage the entity state for documents.
15
+ * It uses the `createInitialState` function to initialize the store with default values and
16
+ * is configured with the name `'documents'`.
17
+ * @augments EntityStore<DocumentState>
18
+ */
19
+ export declare class DocumentStore extends EntityStore<DocumentState> {
20
+ /**
21
+ * Creates an instance of `DocumentStore` with the initial state of the documents.
22
+ */
23
+ constructor();
24
+ setUploadedDocumentFiles(files: any[]): void;
25
+ setFolders(folders: any): void;
26
+ setDocumentTypes(documentType: any): void;
27
+ setDocumentAlert(documentAlert: any): void;
28
+ setParentDocumentTypeId(parentDocumentTypeId: string): void;
29
+ setMessage(message: Message[]): void;
30
+ setDocumentList(documents: DocumentModel[]): void;
31
+ setDocumentCategories(categories: DocumentCategory[]): void;
32
+ setSelectedMenuItem(menuItem: string | null): void;
33
+ setSelectedUserId(userId: string | null): void;
34
+ setSelectedStatus(status: string | null): void;
35
+ setSearchKey(searchKey: string | null): void;
36
+ setSelectionState(menuItem: string | null, userId: string | null, status: string | null, searchKey?: string | null): void;
37
+ clearSelectionState(): void;
38
+ setShowUserList(show: boolean): void;
39
+ setCurrentDocument(document: DocumentModel | null): void;
40
+ setUserList(userList: UserListModel[]): void;
41
+ setStatusData(statusData: StatusDataModel[]): void;
42
+ setDocumentListResponse(response: DocumentListResponse[] | null): void;
43
+ setSelectedDocument(document: DocumentListItem | undefined): void;
44
+ setDocumentHistory(history: DocumentHistorySection[]): void;
45
+ setShowDocumentHistory(show: boolean): void;
46
+ setIsActionLoading(loading: boolean): void;
47
+ setDocumentStatus(status: 'pending' | 'accepted' | 'rejected'): void;
48
+ setDocumentIsUploaded(uploaded: boolean): void;
49
+ setAlertData(alertData: any): void;
50
+ setDeleteError(error: any): void;
51
+ setDeleteSuccess(success: boolean): void;
52
+ updateDocumentViewerState(document?: DocumentListItem, history?: DocumentHistorySection[], showHistory?: boolean, loading?: boolean, status?: 'pending' | 'accepted' | 'rejected', uploaded?: boolean, alertData?: any): void;
53
+ clearDocumentViewerState(): void;
54
+ static ɵfac: i0.ɵɵFactoryDeclaration<DocumentStore, never>;
55
+ static ɵprov: i0.ɵɵInjectableDeclaration<DocumentStore>;
56
+ }
package/package.json CHANGED
@@ -1,63 +1,25 @@
1
1
  {
2
2
  "name": "cat-documents-ng",
3
- "version": "1.0.2",
4
- "scripts": {
5
- "ng": "ng",
6
- "start": "ng serve",
7
- "build": "ng build",
8
- "watch": "ng build --watch --configuration development",
9
- "test": "jest --config projects/cat-document-lib/jest.config.mjs",
10
- "lint": "ng lint",
11
- "prepare": "husky install"
12
- },
13
- "type": "module",
14
- "dependencies": {
15
- "@angular/animations": "^19.0.4",
16
- "@angular/cdk": "^18.2.14",
3
+ "version": "1.0.4",
4
+ "peerDependencies": {
17
5
  "@angular/common": "^19.0.0",
18
- "@angular/compiler": "^19.0.0",
19
- "@angular/core": "^19.0.0",
20
- "@angular/forms": "^19.0.0",
21
- "@angular/platform-browser": "^19.0.0",
22
- "@angular/platform-browser-dynamic": "^19.0.0",
23
- "@angular/router": "^19.0.0",
24
- "@datorama/akita": "^8.0.1",
25
- "jsdocs": "^1.0.0",
26
- "moment": "^2.30.1",
27
- "ng2-pdf-viewer": "^9.1.5",
28
- "primeflex": "^3.3.1",
29
- "primeicons": "^7.0.0",
30
- "primeng": "^17.18.10",
31
- "rxjs": "~7.8.0",
32
- "tslib": "^2.3.0",
33
- "zone.js": "~0.15.0"
6
+ "@angular/core": "^19.0.0"
34
7
  },
35
- "devDependencies": {
36
- "@angular-devkit/build-angular": "^19.0.5",
37
- "@angular-eslint/eslint-plugin": "^19.0.2",
38
- "@angular-eslint/eslint-plugin-template": "^19.0.2",
39
- "@angular-eslint/template-parser": "^19.0.2",
40
- "@angular/cli": "^19.0.5",
41
- "@angular/compiler-cli": "^19.0.0",
42
- "@eslint/js": "^9.17.0",
43
- "@types/jest": "^29.5.14",
44
- "@typescript-eslint/eslint-plugin": "^8.18.0",
45
- "@typescript-eslint/parser": "^8.18.0",
46
- "angular-eslint": "19.0.2",
47
- "eslint": "^9.17.0",
48
- "eslint-plugin-jsdoc": "^50.6.1",
49
- "husky": "^9.1.7",
50
- "jest": "^29.7.0",
51
- "jest-preset-angular": "^14.4.2",
52
- "lint-staged": "^15.2.11",
53
- "ng-packagr": "^19.0.0",
54
- "typescript": "~5.6.2",
55
- "typescript-eslint": "8.18.0"
8
+ "dependencies": {
9
+ "tslib": "^2.3.0"
56
10
  },
57
- "lint-staged": {
58
- "**/*.ts": "eslint",
59
- "**/*.js": "eslint --fix",
60
- "**/*.html": "eslint --fix",
61
- "*.js": "eslint --cache --fix"
11
+ "typings": "index.d.ts",
12
+ "sideEffects": false,
13
+ "main": "bundles/cat-document-lib.umd.js",
14
+ "module": "fesm2022/cat-documents-ng.mjs",
15
+ "es2015": "fesm2015/cat-document-lib.js",
16
+ "exports": {
17
+ "./package.json": {
18
+ "default": "./package.json"
19
+ },
20
+ ".": {
21
+ "types": "./index.d.ts",
22
+ "default": "./fesm2022/cat-documents-ng.mjs"
23
+ }
62
24
  }
63
- }
25
+ }
@@ -0,0 +1,27 @@
1
+ export * from './lib/document/document.module';
2
+ export * from './lib/document/components/document-container/document-container.component';
3
+ export * from './lib/document/components/document-upload/document-upload.component';
4
+ export * from './lib/document/components/document-viewer/document-viewer.component';
5
+ export * from './lib/document/components/document-content-viewer/document-content-viewer.component';
6
+ export * from './lib/document/components/document-zoom-controls/document-zoom-controls.component';
7
+ export * from './lib/document/components/document-actions/document-actions.component';
8
+ export * from './lib/document/components/document-history/document-history.component';
9
+ export * from './lib/document/components/document-list/document-list.component';
10
+ export * from './lib/document/components/document-search/document-search.component';
11
+ export * from './lib/document/components/sidebar/sidebar.component';
12
+ export * from './lib/document/components/request-document/request-document.component';
13
+ export * from './lib/document/models/document-history.model';
14
+ export * from './lib/document/models/uploaded-file-response.model';
15
+ export * from './lib/document/services/document-table-builder.service';
16
+ export * from './lib/document/services/document-content-type.service';
17
+ export * from './lib/document/services/document-zoom.service';
18
+ export * from './lib/document/services/eml-parser.service';
19
+ export * from './lib/document/services/excel-parser.service';
20
+ export * from './lib/document/services/csv-parser.service';
21
+ export * from './lib/document/directives/document.directive';
22
+ export * from './lib/document/directives/permission.directive';
23
+ export * from './Shared/components/confirmation-dialog/confirmation-dialog.component';
24
+ export * from './Shared/components/table-primary/table-primary.component';
25
+ export * from './Shared/components/table-primary/table-primary.model';
26
+ export * from './Shared/constant/SHARED';
27
+ export * from './Shared/shared.module';
@@ -1,32 +0,0 @@
1
- ## Hello Developer,
2
- Thank you for raising the Pull Request!
3
- We greatly appreciate your efforts and contributions to the team. To ensure the quality and standards our team is committed to, we kindly request you to complete the checklist below before submitting the PR.
4
-
5
- ## Pull Request Checklist
6
-
7
- ### Code Quality
8
- - [Y/N] Code adheres to coding standards and style guides.
9
- - [Y/N] Code is properly commented and documented.
10
- - [Y/N] No Hard-coded values are added.
11
- - [Y/N] PR doesn't include more than 10 files.
12
-
13
- ### Clean Coding
14
- - [Y/N] Classes and methods adheres to Single Responsibility Principle
15
- - [Y/N] Classes are not exceeding 200 lines of code
16
- - [Y/N] Methods are not exceeding 20 lines of code
17
-
18
- ### Testing
19
- - [Y/N] Unit tests are written and executed.
20
- - [Y/N] All tests pass successfully.
21
- - [Y/N] Manual testing is completed and verified.
22
-
23
- ### Functionality
24
- - [Y/N] Feature behaves as expected.
25
- - [Y/N] Edge cases are handled.
26
-
27
- ### Documentation
28
- - [Y/N] Relevant documentation is updated (e.g., README, user guides, API docs).
29
-
30
- ### Dependencies
31
- - [Y/N] No unused dependencies or imports.
32
- - [Y/N] Dependencies are updated and compatible.
package/.husky/pre-commit DELETED
@@ -1,4 +0,0 @@
1
- #!/bin/sh
2
- . "$(dirname "$0")/_/husky.sh"
3
-
4
- npx lint-staged
package/angular.json DELETED
@@ -1,119 +0,0 @@
1
- {
2
- "$schema": "./node_modules/@angular/cli/lib/config/schema.json",
3
- "version": 1,
4
- "newProjectRoot": "projects",
5
- "projects": {
6
- "cat-documents-ng": {
7
- "projectType": "application",
8
- "schematics": {
9
- "@schematics/angular:component": {
10
- "style": "scss"
11
- }
12
- },
13
- "root": "",
14
- "sourceRoot": "src",
15
- "prefix": "app",
16
- "architect": {
17
- "build": {
18
- "builder": "@angular-devkit/build-angular:application",
19
- "options": {
20
- "outputPath": "dist/cat-documents-ng",
21
- "index": "src/index.html",
22
- "browser": "src/main.ts",
23
- "polyfills": ["zone.js"],
24
- "tsConfig": "tsconfig.app.json",
25
- "inlineStyleLanguage": "scss",
26
- "assets": [
27
- "src/favicon.ico",
28
- "src/assets",
29
- {
30
- "glob": "**/*",
31
- "input": "dist/cat-document-lib/src/assets",
32
- "output": "assets"
33
- }
34
- ],
35
- "styles": [
36
- "./node_modules/primeng/resources/themes/saga-blue/theme.css",
37
- "./node_modules/primeng/resources/primeng.min.css",
38
- "./node_modules/primeicons/primeicons.css",
39
- "./node_modules/primeflex/primeflex.css",
40
- "src/styles.scss"
41
- ],
42
- "scripts": []
43
- },
44
- "configurations": {
45
- "production": {
46
- "budgets": [
47
- {
48
- "type": "initial",
49
- "maximumWarning": "500kB",
50
- "maximumError": "1MB"
51
- },
52
- {
53
- "type": "anyComponentStyle",
54
- "maximumWarning": "4kB",
55
- "maximumError": "8kB"
56
- }
57
- ],
58
- "outputHashing": "all"
59
- },
60
- "development": {
61
- "optimization": false,
62
- "extractLicenses": false,
63
- "sourceMap": true
64
- }
65
- },
66
- "defaultConfiguration": "production"
67
- },
68
- "serve": {
69
- "builder": "@angular-devkit/build-angular:dev-server",
70
- "configurations": {
71
- "production": {
72
- "buildTarget": "cat-documents-ng:build:production"
73
- },
74
- "development": {
75
- "buildTarget": "cat-documents-ng:build:development"
76
- }
77
- },
78
- "defaultConfiguration": "development"
79
- },
80
- "extract-i18n": {
81
- "builder": "@angular-devkit/build-angular:extract-i18n"
82
- },
83
- "lint": {
84
- "builder": "@angular-eslint/builder:lint",
85
- "options": {
86
- "eslintConfig": "eslint.config.js",
87
- "lintFilePatterns": ["src/**/*.ts", "src/**/*.html"]
88
- }
89
- }
90
- }
91
- },
92
- "cat-document-lib": {
93
- "projectType": "library",
94
- "root": "projects/cat-document-lib",
95
- "sourceRoot": "projects/cat-document-lib/src",
96
- "prefix": "lib",
97
- "architect": {
98
- "build": {
99
- "builder": "@angular-devkit/build-angular:ng-packagr",
100
- "options": {
101
- "project": "projects/cat-document-lib/ng-package.json"
102
- },
103
- "configurations": {
104
- "production": {
105
- "tsConfig": "projects/cat-document-lib/tsconfig.lib.prod.json"
106
- },
107
- "development": {
108
- "tsConfig": "projects/cat-document-lib/tsconfig.lib.json"
109
- }
110
- },
111
- "defaultConfiguration": "production"
112
- }
113
- }
114
- }
115
- },
116
- "cli": {
117
- "analytics": "77456047-823c-4f1a-b41d-1ddee393b72d"
118
- }
119
- }
package/eslint.config.cjs DELETED
@@ -1,148 +0,0 @@
1
- // @ts-check
2
- const eslint = require("@eslint/js");
3
- const tseslint = require("@typescript-eslint/eslint-plugin");
4
- const tseslintParser = require("@typescript-eslint/parser");
5
- const angular = require("@angular-eslint/eslint-plugin");
6
- const jsdoc = require("eslint-plugin-jsdoc");
7
- const angularParser = require("@angular-eslint/template-parser");
8
-
9
- module.exports = [
10
- {
11
- files: ["**/*.ts"],
12
- languageOptions: {
13
- parser: tseslintParser, // Use TypeScript parser for .ts files
14
- parserOptions: {
15
- ecmaVersion: 2020,
16
- sourceType: "module",
17
- project: "./tsconfig.json", // Ensure this points to your tsconfig.json
18
- },
19
- },
20
- plugins: {
21
- "@typescript-eslint": tseslint,
22
- "@angular-eslint": angular,
23
- jsdoc,
24
- },
25
- rules: {
26
- "@angular-eslint/directive-selector": [
27
- "error",
28
- {
29
- type: "attribute",
30
- style: "camelCase",
31
- },
32
- ],
33
- "@angular-eslint/component-selector": [
34
- "error",
35
- {
36
- type: "element",
37
- style: "kebab-case",
38
- },
39
- ],
40
- "jsdoc/check-access": 1, // Recommended
41
- "jsdoc/check-alignment": 1, // Recommended
42
- "jsdoc/check-param-names": 1, // Recommended
43
- "jsdoc/check-property-names": 1, // Recommended
44
- "jsdoc/check-tag-names": 1, // Recommended
45
- "jsdoc/check-types": 1, // Recommended
46
- "jsdoc/check-values": 1, // Recommended
47
- "jsdoc/empty-tags": 1, // Recommended
48
- "jsdoc/implements-on-classes": 1, // Recommended
49
- "jsdoc/multiline-blocks": 1, // Recommended
50
- "jsdoc/no-multi-asterisks": 1, // Recommended
51
- "jsdoc/no-undefined-types": 1, // Recommended
52
- "jsdoc/require-jsdoc": [
53
- "error",
54
- {
55
- "contexts": [
56
- "ClassDeclaration",
57
- "ClassExpression",
58
- "ArrowFunctionExpression",
59
- "FunctionDeclaration",
60
- "FunctionExpression",
61
- ],
62
- },
63
- ],
64
- 'jsdoc/require-description': 'error',
65
- "jsdoc/require-param": 1, // Recommended
66
- "jsdoc/require-param-description": 1, // Recommended
67
- "jsdoc/require-param-name": 1, // Recommended
68
- "jsdoc/require-param-type": 1, // Recommended
69
- "jsdoc/require-property": 1, // Recommended
70
- "jsdoc/require-property-description": 1, // Recommended
71
- "jsdoc/require-property-name": 1, // Recommended
72
- "jsdoc/require-property-type": 1, // Recommended
73
- "jsdoc/require-returns": 1, // Recommended
74
- "jsdoc/require-returns-check": 1, // Recommended
75
- "jsdoc/require-returns-description": 1, // Recommended
76
- "jsdoc/require-returns-type": 1, // Recommended
77
- "jsdoc/require-yields": 1, // Recommended
78
- "jsdoc/require-yields-check": 1, // Recommended
79
- "jsdoc/tag-lines": 1, // Recommended
80
- "jsdoc/valid-types": 1, // Recommended
81
- "max-lines": [
82
- "error",
83
- {
84
- max: 200,
85
- skipBlankLines: true,
86
- skipComments: true,
87
- },
88
- ],
89
- "max-lines-per-function": [
90
- "error",
91
- {
92
- max: 20,
93
- skipBlankLines: true,
94
- skipComments: true,
95
- IIFEs: true,
96
- },
97
- ],
98
- },
99
- },
100
- {
101
- files: ["**/*.html"],
102
- languageOptions: {
103
- parser: angularParser, // Use Angular template parser
104
- },
105
- plugins: {
106
- "@angular-eslint": angular,
107
- },
108
- rules: {
109
- // Add custom template rules here if needed
110
- },
111
- },
112
- {
113
- files: ["**/*.spec.ts"],
114
- languageOptions: {
115
- parser: tseslintParser, // Use TypeScript parser for .spec.ts files
116
- parserOptions: {
117
- ecmaVersion: 2020,
118
- sourceType: "module",
119
- project: "./tsconfig.json", // Ensure this points to your tsconfig.json
120
- },
121
- },
122
- plugins: {
123
- "@typescript-eslint": tseslint,
124
- "@angular-eslint": angular,
125
- },
126
- rules: {
127
- // Custom rules for spec files, e.g., allow certain things that are specific to testing
128
- "max-lines": [
129
- "error", // You might want to warn rather than error in test files
130
- {
131
- max: 500, // Allow more lines in spec files
132
- skipBlankLines: true,
133
- skipComments: true,
134
- },
135
- ],
136
- "max-lines-per-function": [
137
- "error", // You might want to relax this for test files as well
138
- {
139
- max: 50, // Allow more lines in functions in spec files
140
- skipBlankLines: true,
141
- skipComments: true,
142
- IIFEs: true,
143
- },
144
- ],
145
- // Add other rules specific to testing or Jest (if applicable)
146
- },
147
- }
148
- ];
@@ -1,63 +0,0 @@
1
- # CatDocumentLib
2
-
3
- This project was generated using [Angular CLI](https://github.com/angular/angular-cli) version 19.0.0.
4
-
5
- ## Code scaffolding
6
-
7
- Angular CLI includes powerful code scaffolding tools. To generate a new component, run:
8
-
9
- ```bash
10
- ng generate component component-name
11
- ```
12
-
13
- For a complete list of available schematics (such as `components`, `directives`, or `pipes`), run:
14
-
15
- ```bash
16
- ng generate --help
17
- ```
18
-
19
- ## Building
20
-
21
- To build the library, run:
22
-
23
- ```bash
24
- ng build cat-document-lib
25
- ```
26
-
27
- This command will compile your project, and the build artifacts will be placed in the `dist/` directory.
28
-
29
- ### Publishing the Library
30
-
31
- Once the project is built, you can publish your library by following these steps:
32
-
33
- 1. Navigate to the `dist` directory:
34
- ```bash
35
- cd dist/cat-document-lib
36
- ```
37
-
38
- 2. Run the `npm publish` command to publish your library to the npm registry:
39
- ```bash
40
- npm publish
41
- ```
42
-
43
- ## Running unit tests
44
-
45
- To execute unit tests with the [Karma](https://karma-runner.github.io) test runner, use the following command:
46
-
47
- ```bash
48
- ng test
49
- ```
50
-
51
- ## Running end-to-end tests
52
-
53
- For end-to-end (e2e) testing, run:
54
-
55
- ```bash
56
- ng e2e
57
- ```
58
-
59
- Angular CLI does not come with an end-to-end testing framework by default. You can choose one that suits your needs.
60
-
61
- ## Additional Resources
62
-
63
- For more information on using the Angular CLI, including detailed command references, visit the [Angular CLI Overview and Command Reference](https://angular.dev/tools/cli) page.
@@ -1,11 +0,0 @@
1
- {
2
- "$schema": "../../node_modules/ng-packagr/ng-package.schema.json",
3
- "dest": "../../dist/cat-document-lib",
4
- "lib": {
5
- "entryFile": "src/public-api.ts"
6
- },
7
- "assets": [
8
- "src/assets"
9
- ]
10
-
11
- }
@@ -1,16 +0,0 @@
1
- {
2
- "name": "cat-document-lib",
3
- "version": "0.0.1",
4
- "peerDependencies": {
5
- "@angular/common": "^19.0.0",
6
- "@angular/core": "^19.0.0"
7
- },
8
- "dependencies": {
9
- "tslib": "^2.3.0"
10
- },
11
- "typings": "index.d.ts",
12
- "sideEffects": false,
13
- "main": "bundles/cat-document-lib.umd.js",
14
- "module": "fesm2015/cat-document-lib.js",
15
- "es2015": "fesm2015/cat-document-lib.js"
16
- }
@@ -1 +0,0 @@
1
- import 'jest-preset-angular/setup-jest';
@@ -1,6 +0,0 @@
1
- <div class="grid m-0">
2
- <div class="col-12 md:col-12 lg:col-12 overflow-y-scroll py-0 pl-0" >
3
- <lib-folder-container [documentList]="documentList"></lib-folder-container>
4
- <lib-document-list [documentList]="documentList"></lib-document-list>
5
- </div>
6
- </div>
@@ -1,82 +0,0 @@
1
- import { Component, Input, OnInit } from '@angular/core';
2
- import { SHARED } from '../../../../Shared/constant/SHARED';
3
- import { DocumentService } from '../../state/document.service';
4
- import { DocumentModel } from '../../models/document.model';
5
- import { URLS } from '../../../../Shared/constant/URLS';
6
- import { Subscription } from 'rxjs';
7
-
8
-
9
- /**
10
- *This component is responsible for managing and displaying a list of documents.
11
- * @class DocumentContainerComponent
12
- * @typedef {DocumentContainerComponent}
13
- */
14
- @Component({
15
- selector: 'lib-document-container',
16
- standalone: false,
17
- templateUrl: './document-container.component.html',
18
- styleUrl: './document-container.component.scss'
19
- })
20
- export class DocumentContainerComponent implements OnInit{
21
-
22
- /**
23
- * Creates an instance of DocumentContainerComponent.
24
- * @class
25
- * @param {DocumentService} documentService - Service to manage document-related operations.
26
- */
27
- constructor(public documentService : DocumentService){
28
-
29
- }
30
- /**
31
- * Get contextId in input.
32
- * @type {string}
33
- */
34
- @Input() contextId : string = SHARED.EMPTY;
35
- /**
36
- * The list of dummy documents.
37
- * @type {Array}
38
- */
39
- documentList : DocumentModel[] = []
40
-
41
- /**
42
- * Holds the subscription to manage observable cleanup.
43
- * @private
44
- * @type {Subscription}
45
- */
46
- private subscription: Subscription = new Subscription();
47
-
48
- /**
49
- * Call document service method to get the document by contextId.
50
- */
51
- ngOnInit(): void {
52
- const documentSubscription = this.documentService
53
- .getById(`${URLS.CONTEXT}${this.contextId}`)
54
- .subscribe({
55
- /**
56
- * Handles the successful API response.
57
- * @param {DocumentModel[]} res - The list of documents returned by the API.
58
- */
59
- next: (res: DocumentModel[]) => {
60
- if (res) {
61
- this.documentList = res;
62
- }
63
- },
64
- /**
65
- * Handles errors that occur during the API call.
66
- * Logs the error to the console.
67
- * @param {any} err - The error object returned from the API.
68
- */
69
- error: (err) => {
70
- throw new Error(err)
71
- }
72
- });
73
- this.subscription.add(documentSubscription);
74
- }
75
-
76
- /**
77
- * Unsubscribe subscription on destroy of component .
78
- */
79
- ngOnDestroy(): void {
80
- this.subscription.unsubscribe();
81
- }
82
- }