cat-documents-ng 0.0.5 → 0.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (75) hide show
  1. package/.github/PULL_REQUEST_TEMPLATE.md +32 -0
  2. package/.github/workflows/pr-validation.yml +87 -0
  3. package/.husky/pre-commit +4 -0
  4. package/README.md +59 -63
  5. package/angular.json +119 -0
  6. package/eslint.config.cjs +148 -0
  7. package/package.json +66 -19
  8. package/projects/cat-document-lib/README.md +63 -0
  9. package/{jest.config.mjs → projects/cat-document-lib/jest.config.mjs} +18 -18
  10. package/{ng-package.json → projects/cat-document-lib/ng-package.json} +10 -10
  11. package/projects/cat-document-lib/package-lock.json +599 -0
  12. package/projects/cat-document-lib/package.json +19 -0
  13. package/{setup-jest.ts → projects/cat-document-lib/setup-jest.ts} +9 -9
  14. package/{src/shared → projects/cat-document-lib/src/Shared}/constant/SHARED.ts +231 -231
  15. package/{src/shared → projects/cat-document-lib/src/Shared}/constant/URLS.ts +31 -31
  16. package/{src/shared → projects/cat-document-lib/src/Shared}/services/app-config.service.spec.ts +16 -16
  17. package/{src/shared → projects/cat-document-lib/src/Shared}/services/app-config.service.ts +73 -73
  18. package/{src/shared → projects/cat-document-lib/src/Shared}/services/global-error.handler.ts +29 -29
  19. package/{src → projects/cat-document-lib/src}/lib/document/components/document-container/document-container.component.html +5 -5
  20. package/{src → projects/cat-document-lib/src}/lib/document/components/document-container/document-container.component.ts +82 -82
  21. package/{src → projects/cat-document-lib/src}/lib/document/components/document-list/document-list.component.html +34 -34
  22. package/{src → projects/cat-document-lib/src}/lib/document/components/document-list/document-list.component.scss +11 -11
  23. package/{src → projects/cat-document-lib/src}/lib/document/components/document-list/document-list.component.ts +73 -73
  24. package/{src → projects/cat-document-lib/src}/lib/document/components/document-list-item/document-list-item.component.html +32 -32
  25. package/{src → projects/cat-document-lib/src}/lib/document/components/document-list-item/document-list-item.component.scss +21 -21
  26. package/{src → projects/cat-document-lib/src}/lib/document/components/document-list-item/document-list-item.component.spec.ts +23 -23
  27. package/{src → projects/cat-document-lib/src}/lib/document/components/document-list-item/document-list-item.component.ts +40 -40
  28. package/{src → projects/cat-document-lib/src}/lib/document/components/document-upload/document-upload.component.html +55 -55
  29. package/{src → projects/cat-document-lib/src}/lib/document/components/document-upload/document-upload.component.scss +26 -26
  30. package/{src → projects/cat-document-lib/src}/lib/document/components/document-upload/document-upload.component.spec.ts +24 -24
  31. package/{src → projects/cat-document-lib/src}/lib/document/components/document-upload/document-upload.component.ts +184 -184
  32. package/{src → projects/cat-document-lib/src}/lib/document/components/document-viewer/document-viewer.component.html +244 -244
  33. package/{src → projects/cat-document-lib/src}/lib/document/components/document-viewer/document-viewer.component.scss +35 -35
  34. package/{src → projects/cat-document-lib/src}/lib/document/components/document-viewer/document-viewer.component.spec.ts +21 -21
  35. package/{src → projects/cat-document-lib/src}/lib/document/components/document-viewer/document-viewer.component.ts +125 -125
  36. package/{src → projects/cat-document-lib/src}/lib/document/components/folder-block/folder-block.component.html +46 -46
  37. package/{src → projects/cat-document-lib/src}/lib/document/components/folder-block/folder-block.component.ts +51 -51
  38. package/{src → projects/cat-document-lib/src}/lib/document/components/folder-container/folder-container.component.html +1 -1
  39. package/{src → projects/cat-document-lib/src}/lib/document/components/folder-container/folder-container.component.ts +29 -29
  40. package/{src → projects/cat-document-lib/src}/lib/document/document.module.ts +191 -191
  41. package/{src → projects/cat-document-lib/src}/lib/document/models/document.model.ts +39 -39
  42. package/{src → projects/cat-document-lib/src}/lib/document/models/folder.model.ts +35 -35
  43. package/{src → projects/cat-document-lib/src}/lib/document/services/file-format.service.spec.ts +16 -16
  44. package/{src → projects/cat-document-lib/src}/lib/document/services/file-format.service.ts +41 -41
  45. package/{src → projects/cat-document-lib/src}/lib/document/state/document.query.ts +23 -23
  46. package/{src → projects/cat-document-lib/src}/lib/document/state/document.service.ts +95 -95
  47. package/{src → projects/cat-document-lib/src}/lib/document/state/document.state.ts +39 -39
  48. package/{src → projects/cat-document-lib/src}/lib/document/state/document.store.ts +23 -23
  49. package/{src → projects/cat-document-lib/src}/public-api.ts +8 -8
  50. package/{tsconfig.lib.json → projects/cat-document-lib/tsconfig.lib.json} +15 -15
  51. package/{tsconfig.lib.prod.json → projects/cat-document-lib/tsconfig.lib.prod.json} +11 -11
  52. package/{tsconfig.spec.json → projects/cat-document-lib/tsconfig.spec.json} +15 -15
  53. package/public/favicon.ico +0 -0
  54. package/src/app/app.component.html +1 -0
  55. package/src/app/app.component.scss +0 -0
  56. package/src/app/app.component.spec.ts +29 -0
  57. package/src/app/app.component.ts +15 -0
  58. package/src/app/app.module.ts +60 -0
  59. package/src/app/app.routing.module.ts +19 -0
  60. package/src/index.html +13 -0
  61. package/src/main.ts +5 -0
  62. package/src/styles.scss +39 -0
  63. package/tsconfig.app.json +15 -0
  64. package/tsconfig.json +32 -0
  65. package/src/assets/config/app.config.json +0 -4
  66. /package/{src → projects/cat-document-lib/src}/assets/images/FolderImg.png +0 -0
  67. /package/{src → projects/cat-document-lib/src}/assets/images/Frame.png +0 -0
  68. /package/{src → projects/cat-document-lib/src}/assets/images/document.png +0 -0
  69. /package/{src → projects/cat-document-lib/src}/lib/document/components/document-container/document-container.component.scss +0 -0
  70. /package/{src → projects/cat-document-lib/src}/lib/document/components/document-container/document-container.component.spec.ts +0 -0
  71. /package/{src → projects/cat-document-lib/src}/lib/document/components/document-list/document-list.component.spec.ts +0 -0
  72. /package/{src → projects/cat-document-lib/src}/lib/document/components/folder-block/folder-block.component.scss +0 -0
  73. /package/{src → projects/cat-document-lib/src}/lib/document/components/folder-block/folder-block.component.spec.ts +0 -0
  74. /package/{src → projects/cat-document-lib/src}/lib/document/components/folder-container/folder-container.component.scss +0 -0
  75. /package/{src → projects/cat-document-lib/src}/lib/document/components/folder-container/folder-container.component.spec.ts +0 -0
@@ -1,23 +1,23 @@
1
- import { Injectable } from '@angular/core';
2
- import { QueryEntity } from '@datorama/akita';
3
- import { DocumentStore } from './document.store';
4
- import { DocumentState } from './document.state';
5
-
6
- /**
7
- * Service that provides querying capabilities for the `DocumentStore`.
8
- *
9
- * The `DocumentQuery` class extends Akita's `QueryEntity`, allowing consumers
10
- * to retrieve, observe, and filter data from the `DocumentStore` in a reactive manner.
11
- *
12
- * @extends QueryEntity<DocumentState>
13
- * * Creates an instance of `DocumentQuery`.
14
- *
15
- * @param {DocumentStore} store - The underlying store that holds the document state.
16
- */
17
-
18
- @Injectable({ providedIn: 'root' })
19
- export class DocumentQuery extends QueryEntity<DocumentState> {
20
- constructor(protected override store: DocumentStore) {
21
- super(store);
22
- }
23
- }
1
+ import { Injectable } from '@angular/core';
2
+ import { QueryEntity } from '@datorama/akita';
3
+ import { DocumentStore } from './document.store';
4
+ import { DocumentState } from './document.state';
5
+
6
+ /**
7
+ * Service that provides querying capabilities for the `DocumentStore`.
8
+ *
9
+ * The `DocumentQuery` class extends Akita's `QueryEntity`, allowing consumers
10
+ * to retrieve, observe, and filter data from the `DocumentStore` in a reactive manner.
11
+ *
12
+ * @extends QueryEntity<DocumentState>
13
+ * * Creates an instance of `DocumentQuery`.
14
+ *
15
+ * @param {DocumentStore} store - The underlying store that holds the document state.
16
+ */
17
+
18
+ @Injectable({ providedIn: 'root' })
19
+ export class DocumentQuery extends QueryEntity<DocumentState> {
20
+ constructor(protected override store: DocumentStore) {
21
+ super(store);
22
+ }
23
+ }
@@ -1,95 +1,95 @@
1
- import { Injectable } from '@angular/core';
2
- import { HttpClient } from '@angular/common/http';
3
- import { DocumentStore } from './document.store';
4
- import { Observable, tap } from 'rxjs';
5
- import { AppConfigService } from '../../../Shared/services/app-config.service';
6
- import { URLS } from '../../../Shared/constant/URLS';
7
- import { DocumentModel } from '../models/document.model';
8
-
9
- /**
10
- * Service for managing document-related operations.
11
- * The `DocumentService` acts as a bridge between the application and the backend API for handling document-related data.
12
- * It interacts with the `DocumentStore` for state management and uses `HttpClient` for making HTTP requests.
13
- * Creates an instance of `DocumentService`.
14
- * @param {DocumentStore} documentStore - The store that manages the state of documents.
15
- * @param {HttpClient} http - The Angular HTTP client for making API requests.
16
- */
17
- @Injectable({ providedIn: 'root' })
18
- export class DocumentService {
19
-
20
- /**
21
- * Creates an instance of DocumentService.
22
- * @param {DocumentStore} documentStore - Store managing the state of documents.
23
- * @param {HttpClient} http - Angular HTTP client for making API requests.
24
- * @param {AppConfigService} appConfigService - Service for retrieving application configuration, such as API base URL.
25
- */
26
- constructor(
27
- public documentStore: DocumentStore,
28
- private http: HttpClient,
29
- public appConfigService: AppConfigService
30
- ) { }
31
-
32
- /**
33
- * Get api url from appConfigService.
34
- * @readonly
35
- * @type {string}
36
- */
37
- get apiUrl(): string {
38
- return this.appConfigService.apiBaseUrl;
39
- }
40
-
41
- /**
42
- * Sends a request to create a new document.
43
- * @param {*} entity - The data of the document to be created.
44
- * @returns {Observable<any>} Observable that emits the newly created document.
45
- */
46
- create(entity: any): Observable<any> {
47
- return this.http.post<any>(`${this.apiUrl}${URLS.DOCUMENT_UPLOAD}`, entity).pipe(
48
- tap((newEntity: any) => this.documentStore.add(newEntity))
49
- );
50
- }
51
-
52
- /**
53
- * Fetches all documents from the backend.
54
- * @returns {Observable<DocumentModel[]>} Observable that emits an array of documents.
55
- */
56
- getAll(): Observable<DocumentModel[]> {
57
- return this.http.get<DocumentModel[]>(`${this.apiUrl}${URLS.DOCUMENT_UPLOAD}`).pipe(
58
- tap((entities: DocumentModel[]) => this.documentStore.set(entities))
59
- );
60
- }
61
-
62
- /**
63
- * Fetches a document by its ID.
64
- * @param {string} id - The unique identifier of the document.
65
- * @returns {Observable<any>} Observable that emits the retrieved document.
66
- */
67
- getById(id: string): Observable<any> {
68
- return this.http.get<any>(`${this.apiUrl}${URLS.DOCUMENT_UPLOAD}/${id}`).pipe(
69
- tap((entity: any) => this.documentStore.upsert(id, entity))
70
- );
71
- }
72
-
73
- /**
74
- * Updates an existing document by its ID.
75
- * @param {string} id - The unique identifier of the document.
76
- * @param {DocumentModel} entity - The updated data of the document.
77
- * @returns {Observable<DocumentModel>} Observable that emits the updated document.
78
- */
79
- update(id: string, entity: DocumentModel): Observable<DocumentModel> {
80
- return this.http.put<DocumentModel>(`${this.apiUrl}${URLS.DOCUMENT_UPLOAD}/${id}`, entity).pipe(
81
- tap((updatedEntity: DocumentModel) => this.documentStore.update(id, updatedEntity))
82
- );
83
- }
84
-
85
- /**
86
- * Deletes a document by its ID.
87
- * @param {string} id - The unique identifier of the document to be deleted.
88
- * @returns {Observable<void>} Observable that completes when the document is deleted.
89
- */
90
- delete(id: string): Observable<void> {
91
- return this.http.delete<void>(`${this.apiUrl}${URLS.DOCUMENT_UPLOAD}/${id}`).pipe(
92
- tap(() => this.documentStore.remove(id))
93
- );
94
- }
95
- }
1
+ import { Injectable } from '@angular/core';
2
+ import { HttpClient } from '@angular/common/http';
3
+ import { DocumentStore } from './document.store';
4
+ import { Observable, tap } from 'rxjs';
5
+ import { AppConfigService } from '../../../Shared/services/app-config.service';
6
+ import { URLS } from '../../../Shared/constant/URLS';
7
+ import { DocumentModel } from '../models/document.model';
8
+
9
+ /**
10
+ * Service for managing document-related operations.
11
+ * The `DocumentService` acts as a bridge between the application and the backend API for handling document-related data.
12
+ * It interacts with the `DocumentStore` for state management and uses `HttpClient` for making HTTP requests.
13
+ * Creates an instance of `DocumentService`.
14
+ * @param {DocumentStore} documentStore - The store that manages the state of documents.
15
+ * @param {HttpClient} http - The Angular HTTP client for making API requests.
16
+ */
17
+ @Injectable({ providedIn: 'root' })
18
+ export class DocumentService {
19
+
20
+ /**
21
+ * Creates an instance of DocumentService.
22
+ * @param {DocumentStore} documentStore - Store managing the state of documents.
23
+ * @param {HttpClient} http - Angular HTTP client for making API requests.
24
+ * @param {AppConfigService} appConfigService - Service for retrieving application configuration, such as API base URL.
25
+ */
26
+ constructor(
27
+ public documentStore: DocumentStore,
28
+ private http: HttpClient,
29
+ public appConfigService: AppConfigService
30
+ ) { }
31
+
32
+ /**
33
+ * Get api url from appConfigService.
34
+ * @readonly
35
+ * @type {string}
36
+ */
37
+ get apiUrl(): string {
38
+ return this.appConfigService.apiBaseUrl;
39
+ }
40
+
41
+ /**
42
+ * Sends a request to create a new document.
43
+ * @param {*} entity - The data of the document to be created.
44
+ * @returns {Observable<any>} Observable that emits the newly created document.
45
+ */
46
+ create(entity: any): Observable<any> {
47
+ return this.http.post<any>(`${this.apiUrl}${URLS.DOCUMENT_UPLOAD}`, entity).pipe(
48
+ tap((newEntity: any) => this.documentStore.add(newEntity))
49
+ );
50
+ }
51
+
52
+ /**
53
+ * Fetches all documents from the backend.
54
+ * @returns {Observable<DocumentModel[]>} Observable that emits an array of documents.
55
+ */
56
+ getAll(): Observable<DocumentModel[]> {
57
+ return this.http.get<DocumentModel[]>(`${this.apiUrl}${URLS.DOCUMENT_UPLOAD}`).pipe(
58
+ tap((entities: DocumentModel[]) => this.documentStore.set(entities))
59
+ );
60
+ }
61
+
62
+ /**
63
+ * Fetches a document by its ID.
64
+ * @param {string} id - The unique identifier of the document.
65
+ * @returns {Observable<any>} Observable that emits the retrieved document.
66
+ */
67
+ getById(id: string): Observable<any> {
68
+ return this.http.get<any>(`${this.apiUrl}${URLS.DOCUMENT_UPLOAD}/${id}`).pipe(
69
+ tap((entity: any) => this.documentStore.upsert(id, entity))
70
+ );
71
+ }
72
+
73
+ /**
74
+ * Updates an existing document by its ID.
75
+ * @param {string} id - The unique identifier of the document.
76
+ * @param {DocumentModel} entity - The updated data of the document.
77
+ * @returns {Observable<DocumentModel>} Observable that emits the updated document.
78
+ */
79
+ update(id: string, entity: DocumentModel): Observable<DocumentModel> {
80
+ return this.http.put<DocumentModel>(`${this.apiUrl}${URLS.DOCUMENT_UPLOAD}/${id}`, entity).pipe(
81
+ tap((updatedEntity: DocumentModel) => this.documentStore.update(id, updatedEntity))
82
+ );
83
+ }
84
+
85
+ /**
86
+ * Deletes a document by its ID.
87
+ * @param {string} id - The unique identifier of the document to be deleted.
88
+ * @returns {Observable<void>} Observable that completes when the document is deleted.
89
+ */
90
+ delete(id: string): Observable<void> {
91
+ return this.http.delete<void>(`${this.apiUrl}${URLS.DOCUMENT_UPLOAD}/${id}`).pipe(
92
+ tap(() => this.documentStore.remove(id))
93
+ );
94
+ }
95
+ }
@@ -1,39 +1,39 @@
1
- import { EntityState } from '@datorama/akita';
2
- import { DocumentModel } from '../models/document.model';
3
-
4
- /**
5
- * Represents the state of the documents in the application.
6
- *
7
- * This interface extends Akita's `EntityState` to include additional properties
8
- * for managing document-specific data, such as `records`, `filteredRecords` and `folderId`.
9
- *
10
- * @extends EntityState<DocumentModel, string>
11
- *
12
- * @property {any[]} records - A collection of records related to documents.
13
- * @property {any[]} filteredRecords - A collection of filteredRecords related to documents.
14
- * @property {string | null} folderId - The ID of the currently selected folder, or `null` if no folder is selected.
15
- * @property {boolean} isDialogOpen - A flag indicating whether a dialog is open.
16
- */
17
- export interface DocumentState extends EntityState<DocumentModel, string> {
18
- records: DocumentModel[];
19
- folderId: string | null;
20
- isDialogOpen: boolean;
21
- filteredRecords:DocumentModel[]
22
- }
23
-
24
- /**
25
- * Creates the initial state for the `DocumentState` store.
26
- *
27
- * This function provides default values for all properties in the `DocumentState` interface,
28
- * ensuring the store starts with a consistent initial structure.
29
- *
30
- * @returns {DocumentState} The initial state of the document store.
31
- */
32
- export function createInitialState(): DocumentState {
33
- return {
34
- records: [],
35
- filteredRecords: [],
36
- folderId: null,
37
- isDialogOpen: false,
38
- };
39
- }
1
+ import { EntityState } from '@datorama/akita';
2
+ import { DocumentModel } from '../models/document.model';
3
+
4
+ /**
5
+ * Represents the state of the documents in the application.
6
+ *
7
+ * This interface extends Akita's `EntityState` to include additional properties
8
+ * for managing document-specific data, such as `records`, `filteredRecords` and `folderId`.
9
+ *
10
+ * @extends EntityState<DocumentModel, string>
11
+ *
12
+ * @property {any[]} records - A collection of records related to documents.
13
+ * @property {any[]} filteredRecords - A collection of filteredRecords related to documents.
14
+ * @property {string | null} folderId - The ID of the currently selected folder, or `null` if no folder is selected.
15
+ * @property {boolean} isDialogOpen - A flag indicating whether a dialog is open.
16
+ */
17
+ export interface DocumentState extends EntityState<DocumentModel, string> {
18
+ records: DocumentModel[];
19
+ folderId: string | null;
20
+ isDialogOpen: boolean;
21
+ filteredRecords:DocumentModel[]
22
+ }
23
+
24
+ /**
25
+ * Creates the initial state for the `DocumentState` store.
26
+ *
27
+ * This function provides default values for all properties in the `DocumentState` interface,
28
+ * ensuring the store starts with a consistent initial structure.
29
+ *
30
+ * @returns {DocumentState} The initial state of the document store.
31
+ */
32
+ export function createInitialState(): DocumentState {
33
+ return {
34
+ records: [],
35
+ filteredRecords: [],
36
+ folderId: null,
37
+ isDialogOpen: false,
38
+ };
39
+ }
@@ -1,23 +1,23 @@
1
- import { Injectable } from '@angular/core';
2
- import { EntityStore, StoreConfig } from '@datorama/akita';
3
- import { createInitialState, DocumentState } from './document.state';
4
-
5
- /**
6
- * Store that manages the state of documents in the application.
7
- *
8
- * The `DocumentStore` class extends Akita's `EntityStore` to manage the entity state for documents.
9
- * It uses the `createInitialState` function to initialize the store with default values and
10
- * is configured with the name `'documents'`.
11
- *
12
- * @extends EntityStore<DocumentState>
13
- */
14
- @Injectable({ providedIn: 'root' })
15
- @StoreConfig({ name: 'documents' })
16
- export class DocumentStore extends EntityStore<DocumentState> {
17
- /**
18
- * Creates an instance of `DocumentStore` with the initial state of the documents.
19
- */
20
- constructor() {
21
- super(createInitialState());
22
- }
23
- }
1
+ import { Injectable } from '@angular/core';
2
+ import { EntityStore, StoreConfig } from '@datorama/akita';
3
+ import { createInitialState, DocumentState } from './document.state';
4
+
5
+ /**
6
+ * Store that manages the state of documents in the application.
7
+ *
8
+ * The `DocumentStore` class extends Akita's `EntityStore` to manage the entity state for documents.
9
+ * It uses the `createInitialState` function to initialize the store with default values and
10
+ * is configured with the name `'documents'`.
11
+ *
12
+ * @extends EntityStore<DocumentState>
13
+ */
14
+ @Injectable({ providedIn: 'root' })
15
+ @StoreConfig({ name: 'documents' })
16
+ export class DocumentStore extends EntityStore<DocumentState> {
17
+ /**
18
+ * Creates an instance of `DocumentStore` with the initial state of the documents.
19
+ */
20
+ constructor() {
21
+ super(createInitialState());
22
+ }
23
+ }
@@ -1,8 +1,8 @@
1
- /*
2
- * Public API Surface of cat-document-lib
3
- */
4
-
5
- export * from './lib/document/document.module';
6
- export * from './lib/document/components/document-container/document-container.component';
7
- export * from './lib/document/components/document-viewer/document-viewer.component'
8
-
1
+ /*
2
+ * Public API Surface of cat-document-lib
3
+ */
4
+
5
+ export * from './lib/document/document.module';
6
+ export * from './lib/document/components/document-container/document-container.component';
7
+ export * from './lib/document/components/document-viewer/document-viewer.component'
8
+
@@ -1,15 +1,15 @@
1
- /* To learn more about Typescript configuration file: https://www.typescriptlang.org/docs/handbook/tsconfig-json.html. */
2
- /* To learn more about Angular compiler options: https://angular.dev/reference/configs/angular-compiler-options. */
3
- {
4
- "extends": "../../tsconfig.json",
5
- "compilerOptions": {
6
- "outDir": "../../out-tsc/lib",
7
- "declaration": true,
8
- "declarationMap": true,
9
- "inlineSources": true,
10
- "types": []
11
- },
12
- "exclude": [
13
- "**/*.spec.ts"
14
- ]
15
- }
1
+ /* To learn more about Typescript configuration file: https://www.typescriptlang.org/docs/handbook/tsconfig-json.html. */
2
+ /* To learn more about Angular compiler options: https://angular.dev/reference/configs/angular-compiler-options. */
3
+ {
4
+ "extends": "../../tsconfig.json",
5
+ "compilerOptions": {
6
+ "outDir": "../../out-tsc/lib",
7
+ "declaration": true,
8
+ "declarationMap": true,
9
+ "inlineSources": true,
10
+ "types": []
11
+ },
12
+ "exclude": [
13
+ "**/*.spec.ts"
14
+ ]
15
+ }
@@ -1,11 +1,11 @@
1
- /* To learn more about Typescript configuration file: https://www.typescriptlang.org/docs/handbook/tsconfig-json.html. */
2
- /* To learn more about Angular compiler options: https://angular.dev/reference/configs/angular-compiler-options. */
3
- {
4
- "extends": "./tsconfig.lib.json",
5
- "compilerOptions": {
6
- "declarationMap": false
7
- },
8
- "angularCompilerOptions": {
9
- "compilationMode": "partial"
10
- }
11
- }
1
+ /* To learn more about Typescript configuration file: https://www.typescriptlang.org/docs/handbook/tsconfig-json.html. */
2
+ /* To learn more about Angular compiler options: https://angular.dev/reference/configs/angular-compiler-options. */
3
+ {
4
+ "extends": "./tsconfig.lib.json",
5
+ "compilerOptions": {
6
+ "declarationMap": false
7
+ },
8
+ "angularCompilerOptions": {
9
+ "compilationMode": "partial"
10
+ }
11
+ }
@@ -1,15 +1,15 @@
1
- /* To learn more about Typescript configuration file: https://www.typescriptlang.org/docs/handbook/tsconfig-json.html. */
2
- /* To learn more about Angular compiler options: https://angular.dev/reference/configs/angular-compiler-options. */
3
- {
4
- "extends": "../../tsconfig.json",
5
- "compilerOptions": {
6
- "outDir": "../../out-tsc/spec",
7
- "types": [
8
- "jest"
9
- ]
10
- },
11
- "include": [
12
- "**/*.spec.ts",
13
- "**/*.d.ts"
14
- ]
15
- }
1
+ /* To learn more about Typescript configuration file: https://www.typescriptlang.org/docs/handbook/tsconfig-json.html. */
2
+ /* To learn more about Angular compiler options: https://angular.dev/reference/configs/angular-compiler-options. */
3
+ {
4
+ "extends": "../../tsconfig.json",
5
+ "compilerOptions": {
6
+ "outDir": "../../out-tsc/spec",
7
+ "types": [
8
+ "jest"
9
+ ]
10
+ },
11
+ "include": [
12
+ "**/*.spec.ts",
13
+ "**/*.d.ts"
14
+ ]
15
+ }
Binary file
@@ -0,0 +1 @@
1
+ <lib-document-container></lib-document-container>
File without changes
@@ -0,0 +1,29 @@
1
+ import { TestBed } from '@angular/core/testing';
2
+ import { AppComponent } from './app.component';
3
+
4
+ describe('AppComponent', () => {
5
+ beforeEach(async () => {
6
+ await TestBed.configureTestingModule({
7
+ imports: [AppComponent],
8
+ }).compileComponents();
9
+ });
10
+
11
+ it('should create the app', () => {
12
+ const fixture = TestBed.createComponent(AppComponent);
13
+ const app = fixture.componentInstance;
14
+ expect(app).toBeTruthy();
15
+ });
16
+
17
+ it(`should have the 'cat-documents-ng' title`, () => {
18
+ const fixture = TestBed.createComponent(AppComponent);
19
+ const app = fixture.componentInstance;
20
+ expect(app.title).toEqual('cat-documents-ng');
21
+ });
22
+
23
+ it('should render title', () => {
24
+ const fixture = TestBed.createComponent(AppComponent);
25
+ fixture.detectChanges();
26
+ const compiled = fixture.nativeElement as HTMLElement;
27
+ expect(compiled.querySelector('h1')?.textContent).toContain('Hello, cat-documents-ng');
28
+ });
29
+ });
@@ -0,0 +1,15 @@
1
+ import { Component } from '@angular/core';
2
+ import { RouterOutlet } from '@angular/router';
3
+
4
+ /**
5
+ *
6
+ */
7
+ @Component({
8
+ selector: 'app-root',
9
+ standalone : false,
10
+ templateUrl: './app.component.html',
11
+ styleUrl: './app.component.scss'
12
+ })
13
+ export class AppComponent {
14
+ title = 'cat-documents-ng';
15
+ }
@@ -0,0 +1,60 @@
1
+ import { APP_INITIALIZER, NgModule } from '@angular/core';
2
+ import { CommonModule } from '@angular/common';
3
+ import { AppRoutingModule } from './app.routing.module';
4
+ import { AppComponent } from './app.component';
5
+ import { BrowserModule } from '@angular/platform-browser';
6
+ import { DocumentModule } from '../../projects/cat-document-lib/src/public-api';
7
+ import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
8
+ import { AppConfigService } from '../../projects/cat-document-lib/src/Shared/services/app-config.service';
9
+ import { GlobalErrorHandler } from '../../projects/cat-document-lib/src/Shared/services/global-error.handler';
10
+
11
+ /**
12
+ * The root module of the Angular application.
13
+ *
14
+ * The `AppModule` is the starting point of the application, declaring the main application component,
15
+ * importing necessary Angular modules, and bootstrapping the root component.
16
+ */
17
+ @NgModule({
18
+ declarations: [
19
+ /**
20
+ * Declares the main application component.
21
+ */
22
+ AppComponent
23
+ ],
24
+ imports: [
25
+ /**
26
+ * Provides Angular's commonly needed directives and pipes.
27
+ */
28
+ CommonModule,
29
+ /**
30
+ * Handles routing configuration for the application.
31
+ */
32
+ AppRoutingModule,
33
+ /**
34
+ * Provides essential Angular services for browser-based applications.
35
+ */
36
+ BrowserModule,
37
+ /**
38
+ * Imports the custom DocumentModule, which contains document-related features.
39
+ */
40
+ DocumentModule,
41
+ /**
42
+ * Enables animations for Angular components in the application.
43
+ */
44
+ BrowserAnimationsModule
45
+ ],
46
+ bootstrap: [
47
+ /**
48
+ * Specifies the root component to bootstrap the application.
49
+ */
50
+ AppComponent
51
+ ],
52
+ providers: [
53
+ /**
54
+ * Registers the global error handler for the application.
55
+ */
56
+
57
+ ]
58
+
59
+ })
60
+ export class AppModule {}
@@ -0,0 +1,19 @@
1
+ import { NgModule } from '@angular/core';
2
+ import { RouterModule, Routes } from '@angular/router';
3
+ import { AppComponent } from './app.component';
4
+
5
+ const routes: Routes = [
6
+ {
7
+ path : "",
8
+ component : AppComponent
9
+ }
10
+ ];
11
+
12
+ /**
13
+ *
14
+ */
15
+ @NgModule({
16
+ imports: [RouterModule.forChild(routes)],
17
+ exports: [RouterModule]
18
+ })
19
+ export class AppRoutingModule { }
package/src/index.html ADDED
@@ -0,0 +1,13 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <title>CatDocumentsNg</title>
6
+ <base href="/">
7
+ <meta name="viewport" content="width=device-width, initial-scale=1">
8
+ <link rel="icon" type="image/x-icon" href="favicon.ico">
9
+ </head>
10
+ <body>
11
+ <app-root></app-root>
12
+ </body>
13
+ </html>
package/src/main.ts ADDED
@@ -0,0 +1,5 @@
1
+ import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
2
+ import { AppModule } from './app/app.module';
3
+
4
+ platformBrowserDynamic().bootstrapModule(AppModule)
5
+ .catch(err => console.error(err));