cat-documents-ng 0.0.10 → 0.0.12
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.
- package/README.md +19 -15
- package/Shared/constant/SHARED.d.ts +150 -0
- package/{projects/cat-document-lib/src/Shared/constant/URLS.ts → Shared/constant/URLS.d.ts} +29 -31
- package/Shared/services/app-config.service.d.ts +51 -0
- package/{projects/cat-document-lib/src/Shared/services/global-error.handler.ts → Shared/services/global-error.handler.d.ts} +27 -29
- package/fesm2022/cat-documents-ng.mjs +1411 -0
- package/fesm2022/cat-documents-ng.mjs.map +1 -0
- package/index.d.ts +5 -0
- package/lib/document/components/document-container/document-container.component.d.ts +44 -0
- package/lib/document/components/document-list/document-list.component.d.ts +47 -0
- package/lib/document/components/document-list-item/document-list-item.component.d.ts +28 -0
- package/lib/document/components/document-upload/document-upload.component.d.ts +113 -0
- package/lib/document/components/document-viewer/document-viewer.component.d.ts +113 -0
- 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} +37 -51
- package/lib/document/components/folder-container/folder-container.component.d.ts +28 -0
- package/lib/document/document.module.d.ts +35 -0
- package/lib/document/models/document.model.d.ts +33 -0
- package/{projects/cat-document-lib/src/lib/document/models/folder.model.ts → lib/document/models/folder.model.d.ts} +29 -35
- package/lib/document/services/file-format.service.d.ts +23 -0
- package/{projects/cat-document-lib/src/lib/document/state/document.service.ts → lib/document/state/document.service.d.ts} +64 -95
- package/{projects/cat-document-lib/src/lib/document/state/document.state.ts → lib/document/state/document.state.d.ts} +30 -39
- package/lib/document/state/document.store.d.ts +20 -0
- package/package.json +25 -66
- package/{projects/cat-document-lib/src/public-api.ts → public-api.d.ts} +3 -8
- package/src/assets/config/app.config.json +4 -0
- package/.github/PULL_REQUEST_TEMPLATE.md +0 -32
- package/.github/workflows/pr-validation.yml +0 -87
- package/.husky/pre-commit +0 -4
- package/angular.json +0 -119
- package/eslint.config.cjs +0 -148
- package/projects/cat-document-lib/README.md +0 -63
- package/projects/cat-document-lib/jest.config.mjs +0 -18
- package/projects/cat-document-lib/ng-package.json +0 -11
- package/projects/cat-document-lib/package-lock.json +0 -599
- package/projects/cat-document-lib/package.json +0 -19
- package/projects/cat-document-lib/setup-jest.ts +0 -10
- package/projects/cat-document-lib/src/Shared/constant/SHARED.ts +0 -232
- package/projects/cat-document-lib/src/Shared/services/app-config.service.spec.ts +0 -16
- package/projects/cat-document-lib/src/Shared/services/app-config.service.ts +0 -73
- package/projects/cat-document-lib/src/lib/document/components/document-container/document-container.component.html +0 -6
- package/projects/cat-document-lib/src/lib/document/components/document-container/document-container.component.scss +0 -0
- package/projects/cat-document-lib/src/lib/document/components/document-container/document-container.component.spec.ts +0 -0
- package/projects/cat-document-lib/src/lib/document/components/document-container/document-container.component.ts +0 -82
- package/projects/cat-document-lib/src/lib/document/components/document-list/document-list.component.html +0 -35
- package/projects/cat-document-lib/src/lib/document/components/document-list/document-list.component.scss +0 -12
- package/projects/cat-document-lib/src/lib/document/components/document-list/document-list.component.spec.ts +0 -0
- package/projects/cat-document-lib/src/lib/document/components/document-list/document-list.component.ts +0 -73
- package/projects/cat-document-lib/src/lib/document/components/document-list-item/document-list-item.component.html +0 -33
- package/projects/cat-document-lib/src/lib/document/components/document-list-item/document-list-item.component.scss +0 -22
- package/projects/cat-document-lib/src/lib/document/components/document-list-item/document-list-item.component.spec.ts +0 -23
- package/projects/cat-document-lib/src/lib/document/components/document-list-item/document-list-item.component.ts +0 -40
- package/projects/cat-document-lib/src/lib/document/components/document-upload/document-upload.component.html +0 -56
- package/projects/cat-document-lib/src/lib/document/components/document-upload/document-upload.component.scss +0 -26
- package/projects/cat-document-lib/src/lib/document/components/document-upload/document-upload.component.spec.ts +0 -24
- package/projects/cat-document-lib/src/lib/document/components/document-upload/document-upload.component.ts +0 -184
- package/projects/cat-document-lib/src/lib/document/components/document-viewer/document-viewer.component.html +0 -244
- package/projects/cat-document-lib/src/lib/document/components/document-viewer/document-viewer.component.scss +0 -36
- package/projects/cat-document-lib/src/lib/document/components/document-viewer/document-viewer.component.spec.ts +0 -21
- package/projects/cat-document-lib/src/lib/document/components/document-viewer/document-viewer.component.ts +0 -125
- package/projects/cat-document-lib/src/lib/document/components/folder-block/folder-block.component.html +0 -46
- package/projects/cat-document-lib/src/lib/document/components/folder-block/folder-block.component.scss +0 -0
- package/projects/cat-document-lib/src/lib/document/components/folder-block/folder-block.component.spec.ts +0 -0
- package/projects/cat-document-lib/src/lib/document/components/folder-container/folder-container.component.html +0 -2
- package/projects/cat-document-lib/src/lib/document/components/folder-container/folder-container.component.scss +0 -0
- package/projects/cat-document-lib/src/lib/document/components/folder-container/folder-container.component.spec.ts +0 -0
- package/projects/cat-document-lib/src/lib/document/components/folder-container/folder-container.component.ts +0 -29
- package/projects/cat-document-lib/src/lib/document/document.module.ts +0 -191
- package/projects/cat-document-lib/src/lib/document/models/document.model.ts +0 -39
- package/projects/cat-document-lib/src/lib/document/services/file-format.service.spec.ts +0 -16
- package/projects/cat-document-lib/src/lib/document/services/file-format.service.ts +0 -41
- package/projects/cat-document-lib/src/lib/document/state/document.query.ts +0 -23
- package/projects/cat-document-lib/src/lib/document/state/document.store.ts +0 -23
- package/projects/cat-document-lib/tsconfig.lib.json +0 -15
- package/projects/cat-document-lib/tsconfig.lib.prod.json +0 -11
- package/projects/cat-document-lib/tsconfig.spec.json +0 -15
- package/public/favicon.ico +0 -0
- package/src/app/app.component.html +0 -1
- package/src/app/app.component.scss +0 -0
- package/src/app/app.component.spec.ts +0 -29
- package/src/app/app.component.ts +0 -15
- package/src/app/app.module.ts +0 -60
- package/src/app/app.routing.module.ts +0 -19
- package/src/index.html +0 -13
- package/src/main.ts +0 -5
- package/src/styles.scss +0 -39
- package/tsconfig.app.json +0 -15
- package/tsconfig.json +0 -32
- /package/{projects/cat-document-lib/src → src}/assets/images/FolderImg.png +0 -0
- /package/{projects/cat-document-lib/src → src}/assets/images/Frame.png +0 -0
- /package/{projects/cat-document-lib/src → src}/assets/images/document.png +0 -0
package/README.md
CHANGED
|
@@ -1,16 +1,6 @@
|
|
|
1
|
-
#
|
|
1
|
+
# CatDocumentLib
|
|
2
2
|
|
|
3
|
-
This project was generated using [Angular CLI](https://github.com/angular/angular-cli) version 19.0.
|
|
4
|
-
|
|
5
|
-
## Development server
|
|
6
|
-
|
|
7
|
-
To start a local development server, run:
|
|
8
|
-
|
|
9
|
-
```bash
|
|
10
|
-
ng serve
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
Once the server is running, open your browser and navigate to `http://localhost:4200/`. The application will automatically reload whenever you modify any of the source files.
|
|
3
|
+
This project was generated using [Angular CLI](https://github.com/angular/angular-cli) version 19.0.0.
|
|
14
4
|
|
|
15
5
|
## Code scaffolding
|
|
16
6
|
|
|
@@ -28,13 +18,27 @@ ng generate --help
|
|
|
28
18
|
|
|
29
19
|
## Building
|
|
30
20
|
|
|
31
|
-
To build the
|
|
21
|
+
To build the library, run:
|
|
32
22
|
|
|
33
23
|
```bash
|
|
34
|
-
ng build
|
|
24
|
+
ng build cat-document-lib
|
|
35
25
|
```
|
|
36
26
|
|
|
37
|
-
This will compile your project and
|
|
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
|
+
```
|
|
38
42
|
|
|
39
43
|
## Running unit tests
|
|
40
44
|
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The `SHARED` class contains shared constants used across the application.
|
|
3
|
+
* These constants are related to document statuses and other shared data.
|
|
4
|
+
*/
|
|
5
|
+
export declare class SHARED {
|
|
6
|
+
/**
|
|
7
|
+
* Represents the count of missing files.
|
|
8
|
+
*/
|
|
9
|
+
static MISSINGCOUNT: number;
|
|
10
|
+
/**
|
|
11
|
+
* Represents the count of pending files.
|
|
12
|
+
*/
|
|
13
|
+
static PENDINGCOUNT: number;
|
|
14
|
+
/**
|
|
15
|
+
* Represents an empty string.
|
|
16
|
+
*/
|
|
17
|
+
static EMPTY: string;
|
|
18
|
+
/**
|
|
19
|
+
* Represents an true.
|
|
20
|
+
* @static
|
|
21
|
+
* @type {boolean}
|
|
22
|
+
*/
|
|
23
|
+
static TRUE: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Represents an false.
|
|
26
|
+
* @static
|
|
27
|
+
* @type {boolean}
|
|
28
|
+
*/
|
|
29
|
+
static FALSE: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Represents an INITIAL_COUNT.
|
|
32
|
+
*/
|
|
33
|
+
static INITIAL_COUNT: number;
|
|
34
|
+
/**
|
|
35
|
+
* Represents an INITIAL_VALUE.
|
|
36
|
+
*/
|
|
37
|
+
static INITIAL_VALUE: number;
|
|
38
|
+
/**
|
|
39
|
+
* Represents the constant value for one (1).
|
|
40
|
+
* @static
|
|
41
|
+
* @type {number}
|
|
42
|
+
*/
|
|
43
|
+
static ONE: number;
|
|
44
|
+
/**
|
|
45
|
+
* Represents the constant value for two (2).
|
|
46
|
+
* @static
|
|
47
|
+
* @type {number}
|
|
48
|
+
*/
|
|
49
|
+
static TWO: number;
|
|
50
|
+
/**
|
|
51
|
+
* Represents the constant value for ten (10).
|
|
52
|
+
* @static
|
|
53
|
+
* @type {number}
|
|
54
|
+
*/
|
|
55
|
+
static TEN: number;
|
|
56
|
+
/**
|
|
57
|
+
* Represents the constant string value 'files' used for file-related operations.
|
|
58
|
+
* @static
|
|
59
|
+
* @type {string}
|
|
60
|
+
*/
|
|
61
|
+
static FILE: string;
|
|
62
|
+
/**
|
|
63
|
+
* Represents the array of file size units ('B', 'KB', 'MB') used for file size formatting.
|
|
64
|
+
* @static
|
|
65
|
+
* @type {string[]}
|
|
66
|
+
*/
|
|
67
|
+
static FILE_SIZE_UNITS: string[];
|
|
68
|
+
/**
|
|
69
|
+
* Show SEVERITY value.
|
|
70
|
+
* @static
|
|
71
|
+
* @type {'error'}
|
|
72
|
+
*/
|
|
73
|
+
static SEVERITY: string;
|
|
74
|
+
/**
|
|
75
|
+
* Show upload summery if it's failed.
|
|
76
|
+
* @static
|
|
77
|
+
* @type {'Upload Failed'}
|
|
78
|
+
*/
|
|
79
|
+
static UPLOAD_SUMMERY: string;
|
|
80
|
+
/**
|
|
81
|
+
* Represent empty array.
|
|
82
|
+
* @static
|
|
83
|
+
* @type {{}}
|
|
84
|
+
*/
|
|
85
|
+
static EMPTY_ARRAY: never[];
|
|
86
|
+
/**
|
|
87
|
+
* Represent contextId.
|
|
88
|
+
* @static
|
|
89
|
+
* @type {string}
|
|
90
|
+
*/
|
|
91
|
+
static CONTEXT_ID: string;
|
|
92
|
+
/**
|
|
93
|
+
* Represent fileSize.
|
|
94
|
+
* @static
|
|
95
|
+
* @type {string}
|
|
96
|
+
*/
|
|
97
|
+
static FILE_SIZE: string;
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* `DUMMYDOCUMENTLIST` is a mock list of document objects used for testing and development purposes.
|
|
101
|
+
* Each document includes an ID, file name, status, and document URL.
|
|
102
|
+
*/
|
|
103
|
+
export declare const DUMMYDOCUMENTLIST: {
|
|
104
|
+
_id: number;
|
|
105
|
+
fileName: string;
|
|
106
|
+
status: string;
|
|
107
|
+
documentUrl: string;
|
|
108
|
+
}[];
|
|
109
|
+
/**
|
|
110
|
+
* `FOLDERPANEL` is a mock list of folder data representing various folders in the application.
|
|
111
|
+
* Each folder contains an ID, file count, text description, missing files count, and pending files count.
|
|
112
|
+
*/
|
|
113
|
+
export declare const FOLDERPANEL: {
|
|
114
|
+
_id: string;
|
|
115
|
+
fileCount: number;
|
|
116
|
+
text: string;
|
|
117
|
+
missingFiles: number;
|
|
118
|
+
pendingFiles: number;
|
|
119
|
+
}[];
|
|
120
|
+
/**
|
|
121
|
+
* Dummy data for sumaery.
|
|
122
|
+
* @type {{}}
|
|
123
|
+
*/
|
|
124
|
+
export declare const DUMMYSUMMARY: ({
|
|
125
|
+
status: string;
|
|
126
|
+
date: string;
|
|
127
|
+
icon: string;
|
|
128
|
+
color: string;
|
|
129
|
+
image: string;
|
|
130
|
+
} | {
|
|
131
|
+
status: string;
|
|
132
|
+
date: string;
|
|
133
|
+
icon: string;
|
|
134
|
+
color: string;
|
|
135
|
+
image?: undefined;
|
|
136
|
+
})[];
|
|
137
|
+
/**
|
|
138
|
+
* Dummy data for list box.
|
|
139
|
+
* @type {{}}
|
|
140
|
+
*/
|
|
141
|
+
export declare const COUNTRIES: {
|
|
142
|
+
name: string;
|
|
143
|
+
code: string;
|
|
144
|
+
checked: boolean;
|
|
145
|
+
}[];
|
|
146
|
+
/**
|
|
147
|
+
* Default supported image types.
|
|
148
|
+
* @type {{}}
|
|
149
|
+
*/
|
|
150
|
+
export declare const SUPPORTED_IMAGE_TYPES: string[];
|
|
@@ -1,31 +1,29 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Class that holds the URLs used throughout the application.
|
|
3
|
-
* These URLs are typically used for making API requests and accessing various resources.
|
|
4
|
-
* @class URLS
|
|
5
|
-
* @typedef {URLS}
|
|
6
|
-
*/
|
|
7
|
-
export class URLS {
|
|
8
|
-
/**
|
|
9
|
-
* The URL to fetch the application configuration file.
|
|
10
|
-
* This JSON file typically contains settings and options for the application.
|
|
11
|
-
* @static
|
|
12
|
-
* @type {string}
|
|
13
|
-
*/
|
|
14
|
-
static CONFIGFILEURL
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
* @
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
static CONTEXT = "?contextId=";
|
|
31
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* Class that holds the URLs used throughout the application.
|
|
3
|
+
* These URLs are typically used for making API requests and accessing various resources.
|
|
4
|
+
* @class URLS
|
|
5
|
+
* @typedef {URLS}
|
|
6
|
+
*/
|
|
7
|
+
export declare class URLS {
|
|
8
|
+
/**
|
|
9
|
+
* The URL to fetch the application configuration file.
|
|
10
|
+
* This JSON file typically contains settings and options for the application.
|
|
11
|
+
* @static
|
|
12
|
+
* @type {string}
|
|
13
|
+
*/
|
|
14
|
+
static CONFIGFILEURL: string;
|
|
15
|
+
/**
|
|
16
|
+
* The URL endpoint for document uploads.
|
|
17
|
+
* Used to send documents to the server for storage or processing.
|
|
18
|
+
* @static
|
|
19
|
+
* @type {string}
|
|
20
|
+
*/
|
|
21
|
+
static DOCUMENT_UPLOAD: string;
|
|
22
|
+
/**
|
|
23
|
+
* The query parameter to pass a context ID in API requests.
|
|
24
|
+
* Used to specify the context for certain API calls, such as filtering or scoping the request.
|
|
25
|
+
* @static
|
|
26
|
+
* @type {string}
|
|
27
|
+
*/
|
|
28
|
+
static CONTEXT: string;
|
|
29
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { HttpClient } from '@angular/common/http';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
/**
|
|
4
|
+
* Service that handles loading and providing configuration settings for the application.
|
|
5
|
+
* It fetches configuration data from a remote server and exposes various configuration options.
|
|
6
|
+
* @class AppConfigService
|
|
7
|
+
* @typedef {AppConfigService}
|
|
8
|
+
*/
|
|
9
|
+
export declare class AppConfigService {
|
|
10
|
+
private http;
|
|
11
|
+
/**
|
|
12
|
+
* Holds the configuration data loaded from the server.
|
|
13
|
+
* @private
|
|
14
|
+
* @type {*}
|
|
15
|
+
*/
|
|
16
|
+
private appConfig;
|
|
17
|
+
/**
|
|
18
|
+
* Creates an instance of AppConfigService.
|
|
19
|
+
* Initializes the HttpClient for making HTTP requests.
|
|
20
|
+
* @class
|
|
21
|
+
* @param {HttpClient} http - The HttpClient service used for making HTTP requests.
|
|
22
|
+
*/
|
|
23
|
+
constructor(http: HttpClient);
|
|
24
|
+
/**
|
|
25
|
+
* Loads the application configuration from the server by making an HTTP request to the configuration URL.
|
|
26
|
+
* This method retrieves the configuration data and assigns it to the appConfig property.
|
|
27
|
+
* @async
|
|
28
|
+
* @returns {*}
|
|
29
|
+
*/
|
|
30
|
+
loadAppConfig(): Promise<void>;
|
|
31
|
+
/**
|
|
32
|
+
* Returns the base URL for the API from the loaded configuration.
|
|
33
|
+
* @readonly
|
|
34
|
+
* @type {*}
|
|
35
|
+
*/
|
|
36
|
+
get apiBaseUrl(): any;
|
|
37
|
+
/**
|
|
38
|
+
* Returns the local server API URL from the loaded configuration.
|
|
39
|
+
* @readonly
|
|
40
|
+
* @type {*}
|
|
41
|
+
*/
|
|
42
|
+
get localServerApi(): any;
|
|
43
|
+
/**
|
|
44
|
+
* Returns the visibility options from the loaded configuration.
|
|
45
|
+
* @readonly
|
|
46
|
+
* @type {*}
|
|
47
|
+
*/
|
|
48
|
+
get visibilityOptions(): any;
|
|
49
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AppConfigService, never>;
|
|
50
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<AppConfigService>;
|
|
51
|
+
}
|
|
@@ -1,29 +1,27 @@
|
|
|
1
|
-
import { ErrorHandler,
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* @
|
|
8
|
-
* @
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
*
|
|
15
|
-
* @
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}
|
|
29
|
-
}
|
|
1
|
+
import { ErrorHandler, Injector } from '@angular/core';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
/**
|
|
4
|
+
* GlobalErrorHandler is a custom error handler that implements the ErrorHandler interface.
|
|
5
|
+
* It is used to handle both HTTP errors and other types of errors globally in the application.
|
|
6
|
+
* @class
|
|
7
|
+
* @implements {ErrorHandler}
|
|
8
|
+
* @decorator {Injectable}
|
|
9
|
+
*/
|
|
10
|
+
export declare class GlobalErrorHandler implements ErrorHandler {
|
|
11
|
+
private injector;
|
|
12
|
+
/**
|
|
13
|
+
* Creates an instance of GlobalErrorHandler.
|
|
14
|
+
* @constructor
|
|
15
|
+
* @param {Injector} injector - The Angular injector used to get instances of services.
|
|
16
|
+
*/
|
|
17
|
+
constructor(injector: Injector);
|
|
18
|
+
/**
|
|
19
|
+
* Handles errors globally in the application.
|
|
20
|
+
*
|
|
21
|
+
* @param {any} error - The error object that needs to be handled.
|
|
22
|
+
* @returns {void}
|
|
23
|
+
*/
|
|
24
|
+
handleError(error: any): void;
|
|
25
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<GlobalErrorHandler, never>;
|
|
26
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<GlobalErrorHandler>;
|
|
27
|
+
}
|