cat-documents-ng 0.0.11 → 0.0.13

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 (90) hide show
  1. package/README.md +19 -15
  2. package/Shared/constant/SHARED.d.ts +150 -0
  3. package/{projects/cat-document-lib/src/Shared/constant/URLS.ts → Shared/constant/URLS.d.ts} +29 -31
  4. package/Shared/services/app-config.service.d.ts +51 -0
  5. package/{projects/cat-document-lib/src/Shared/services/global-error.handler.ts → Shared/services/global-error.handler.d.ts} +27 -29
  6. package/fesm2022/cat-documents-ng.mjs +1411 -0
  7. package/fesm2022/cat-documents-ng.mjs.map +1 -0
  8. package/index.d.ts +5 -0
  9. package/lib/document/components/document-container/document-container.component.d.ts +44 -0
  10. package/lib/document/components/document-list/document-list.component.d.ts +47 -0
  11. package/lib/document/components/document-list-item/document-list-item.component.d.ts +28 -0
  12. package/lib/document/components/document-upload/document-upload.component.d.ts +113 -0
  13. package/lib/document/components/document-viewer/document-viewer.component.d.ts +113 -0
  14. 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
  15. package/lib/document/components/folder-container/folder-container.component.d.ts +28 -0
  16. package/lib/document/document.module.d.ts +35 -0
  17. package/lib/document/models/document.model.d.ts +33 -0
  18. package/{projects/cat-document-lib/src/lib/document/models/folder.model.ts → lib/document/models/folder.model.d.ts} +29 -35
  19. package/lib/document/services/file-format.service.d.ts +23 -0
  20. package/{projects/cat-document-lib/src/lib/document/state/document.service.ts → lib/document/state/document.service.d.ts} +64 -95
  21. package/{projects/cat-document-lib/src/lib/document/state/document.state.ts → lib/document/state/document.state.d.ts} +30 -39
  22. package/lib/document/state/document.store.d.ts +20 -0
  23. package/package.json +25 -66
  24. package/{projects/cat-document-lib/src/public-api.ts → public-api.d.ts} +3 -8
  25. package/src/assets/config/api.config.json +4 -0
  26. package/.github/PULL_REQUEST_TEMPLATE.md +0 -32
  27. package/.github/workflows/pr-validation.yml +0 -87
  28. package/.husky/pre-commit +0 -4
  29. package/angular.json +0 -119
  30. package/eslint.config.cjs +0 -148
  31. package/projects/cat-document-lib/README.md +0 -63
  32. package/projects/cat-document-lib/jest.config.mjs +0 -18
  33. package/projects/cat-document-lib/ng-package.json +0 -11
  34. package/projects/cat-document-lib/package-lock.json +0 -599
  35. package/projects/cat-document-lib/package.json +0 -19
  36. package/projects/cat-document-lib/setup-jest.ts +0 -10
  37. package/projects/cat-document-lib/src/Shared/constant/SHARED.ts +0 -232
  38. package/projects/cat-document-lib/src/Shared/services/app-config.service.spec.ts +0 -16
  39. package/projects/cat-document-lib/src/Shared/services/app-config.service.ts +0 -73
  40. package/projects/cat-document-lib/src/lib/document/components/document-container/document-container.component.html +0 -6
  41. package/projects/cat-document-lib/src/lib/document/components/document-container/document-container.component.scss +0 -0
  42. package/projects/cat-document-lib/src/lib/document/components/document-container/document-container.component.spec.ts +0 -0
  43. package/projects/cat-document-lib/src/lib/document/components/document-container/document-container.component.ts +0 -82
  44. package/projects/cat-document-lib/src/lib/document/components/document-list/document-list.component.html +0 -35
  45. package/projects/cat-document-lib/src/lib/document/components/document-list/document-list.component.scss +0 -12
  46. package/projects/cat-document-lib/src/lib/document/components/document-list/document-list.component.spec.ts +0 -0
  47. package/projects/cat-document-lib/src/lib/document/components/document-list/document-list.component.ts +0 -73
  48. package/projects/cat-document-lib/src/lib/document/components/document-list-item/document-list-item.component.html +0 -33
  49. package/projects/cat-document-lib/src/lib/document/components/document-list-item/document-list-item.component.scss +0 -22
  50. package/projects/cat-document-lib/src/lib/document/components/document-list-item/document-list-item.component.spec.ts +0 -23
  51. package/projects/cat-document-lib/src/lib/document/components/document-list-item/document-list-item.component.ts +0 -40
  52. package/projects/cat-document-lib/src/lib/document/components/document-upload/document-upload.component.html +0 -56
  53. package/projects/cat-document-lib/src/lib/document/components/document-upload/document-upload.component.scss +0 -26
  54. package/projects/cat-document-lib/src/lib/document/components/document-upload/document-upload.component.spec.ts +0 -24
  55. package/projects/cat-document-lib/src/lib/document/components/document-upload/document-upload.component.ts +0 -184
  56. package/projects/cat-document-lib/src/lib/document/components/document-viewer/document-viewer.component.html +0 -244
  57. package/projects/cat-document-lib/src/lib/document/components/document-viewer/document-viewer.component.scss +0 -36
  58. package/projects/cat-document-lib/src/lib/document/components/document-viewer/document-viewer.component.spec.ts +0 -21
  59. package/projects/cat-document-lib/src/lib/document/components/document-viewer/document-viewer.component.ts +0 -125
  60. package/projects/cat-document-lib/src/lib/document/components/folder-block/folder-block.component.html +0 -46
  61. package/projects/cat-document-lib/src/lib/document/components/folder-block/folder-block.component.scss +0 -0
  62. package/projects/cat-document-lib/src/lib/document/components/folder-block/folder-block.component.spec.ts +0 -0
  63. package/projects/cat-document-lib/src/lib/document/components/folder-container/folder-container.component.html +0 -2
  64. package/projects/cat-document-lib/src/lib/document/components/folder-container/folder-container.component.scss +0 -0
  65. package/projects/cat-document-lib/src/lib/document/components/folder-container/folder-container.component.spec.ts +0 -0
  66. package/projects/cat-document-lib/src/lib/document/components/folder-container/folder-container.component.ts +0 -29
  67. package/projects/cat-document-lib/src/lib/document/document.module.ts +0 -191
  68. package/projects/cat-document-lib/src/lib/document/models/document.model.ts +0 -39
  69. package/projects/cat-document-lib/src/lib/document/services/file-format.service.spec.ts +0 -16
  70. package/projects/cat-document-lib/src/lib/document/services/file-format.service.ts +0 -41
  71. package/projects/cat-document-lib/src/lib/document/state/document.query.ts +0 -23
  72. package/projects/cat-document-lib/src/lib/document/state/document.store.ts +0 -23
  73. package/projects/cat-document-lib/tsconfig.lib.json +0 -15
  74. package/projects/cat-document-lib/tsconfig.lib.prod.json +0 -11
  75. package/projects/cat-document-lib/tsconfig.spec.json +0 -15
  76. package/public/favicon.ico +0 -0
  77. package/src/app/app.component.html +0 -1
  78. package/src/app/app.component.scss +0 -0
  79. package/src/app/app.component.spec.ts +0 -29
  80. package/src/app/app.component.ts +0 -15
  81. package/src/app/app.module.ts +0 -60
  82. package/src/app/app.routing.module.ts +0 -19
  83. package/src/index.html +0 -13
  84. package/src/main.ts +0 -5
  85. package/src/styles.scss +0 -39
  86. package/tsconfig.app.json +0 -15
  87. package/tsconfig.json +0 -32
  88. /package/{projects/cat-document-lib/src → src}/assets/images/FolderImg.png +0 -0
  89. /package/{projects/cat-document-lib/src → src}/assets/images/Frame.png +0 -0
  90. /package/{projects/cat-document-lib/src → src}/assets/images/document.png +0 -0
@@ -1,125 +0,0 @@
1
- import {
2
- Component,
3
- Input,
4
- OnInit,
5
- ViewEncapsulation,
6
- } from '@angular/core';
7
- import { DynamicDialogRef } from 'primeng/dynamicdialog';
8
- import { COUNTRIES, DUMMYSUMMARY, SUPPORTED_IMAGE_TYPES } from '../../../../Shared/constant/SHARED';
9
- /**
10
- * For list box data.
11
- * @interface Country
12
- * @typedef {Country}
13
- */
14
- interface Country {
15
- /**
16
- * For the name of the property.
17
- * @type {string}
18
- */
19
- name: string;
20
- /**
21
- * For the unique code of country.
22
- * @type {string}
23
- */
24
- code: string;
25
- /**
26
- * Mark check or unchecked.
27
- * @type {?boolean}
28
- */
29
- checked?: boolean;
30
- }
31
-
32
- /**
33
- * Component for viewing and managing document details.
34
- * @class DocumentViewerComponent
35
- * @typedef {DocumentViewerComponent}
36
- * @implements {OnInit}
37
- */
38
- @Component({
39
- selector: 'document-viewer',
40
- templateUrl: './document-viewer.component.html',
41
- standalone : false,
42
- styleUrl: './document-viewer.component.scss',
43
- encapsulation: ViewEncapsulation.None,
44
- })
45
- export class DocumentViewerComponent implements OnInit {
46
- /**
47
- * Get the selected document by user.
48
- * @type {*}
49
- */
50
- @Input() selectedDocument: any;
51
- /**
52
- * Handle notes data.
53
- * @type {!string}
54
- */
55
- notes!: string;
56
- /**
57
- * Country data according to Country model.
58
- * @type {!Country[]}
59
- */
60
- countries!: Country[];
61
- /**
62
- * Indicates whether a checkbox is selected.
63
- * @type {boolean}
64
- */
65
- checked: boolean = false;
66
-
67
- /**
68
- * The currently selected country.
69
- * @type {Country}
70
- */
71
- selectedCountry!: Country;
72
-
73
- /**
74
- * Reference to the dynamic dialog used for displaying additional details.
75
- * @type {(DynamicDialogRef | undefined)}
76
- */
77
- ref: DynamicDialogRef | undefined;
78
-
79
- /**
80
- * Indicates whether the document has been verified.
81
- * @type {boolean}
82
- */
83
- isVerified: boolean = false;
84
-
85
- /**
86
- * Additional property details related to the document.
87
- * @type {any}
88
- */
89
- propertyDetails: any;
90
-
91
- /**
92
- * List of predefined events used for summaries or alerts.
93
- * @type {*}
94
- */
95
- events = DUMMYSUMMARY;
96
-
97
- /**
98
- * Data used for displaying alert messages.
99
- * @type {any}
100
- */
101
- alertData!: any;
102
-
103
- /**
104
- * Initializes a new instance of the DocumentViewerComponent.
105
- */
106
- constructor() {}
107
-
108
- /**
109
- * Lifecycle hook that is called after data-bound properties are initialized.
110
- * Initializes the list of countries.
111
- */
112
- ngOnInit() {
113
- this.countries = COUNTRIES;
114
- }
115
-
116
-
117
- /**
118
- * Determines if the given content type is an image.
119
- * @param {string} contentType - The MIME type of the content.
120
- * @returns {boolean} `true` if the content type is an image; otherwise, `false`.
121
- */
122
- isImage(contentType: string): boolean {
123
- return SUPPORTED_IMAGE_TYPES.includes(contentType);
124
- }
125
- }
@@ -1,46 +0,0 @@
1
- <div class="card folder-info my-4">
2
- <div class="text-900 text-xl font-semibold mb-3">Folders</div>
3
- <div class="grid">
4
- <div *ngFor="let folder of folderBlocks" class="col-12 md:col-6 xl:col-4">
5
- <div
6
- class="p-3 border-1 h-full surface-border flex flex-column justify-content-between surface-100 hover:surface-100 cursor-pointer border-round"
7
- (click)="handleClickForFilter(folder._id)"
8
- >
9
- <div class="icon">
10
- <img src="../../../../assets/images/FolderImg.png" alt="" />
11
- </div>
12
- <div class="flex flex-column">
13
- <span class="text-600 mt-2"> {{ folder.fileCount }} Files </span>
14
- <span class="text-900 text-lg mt-2 mb-2 font-semibold font-medium">
15
- {{ folder.text }}
16
- </span>
17
- </div>
18
- <hr />
19
- <div class="flex justify-content-between">
20
- <div class="flex flex-column">
21
- <span>Missing</span>
22
- <span
23
- [ngClass]="{
24
- 'text-pink-500': missingFileCount > 0,
25
- 'text-green-500': missingFileCount === 0
26
- }"
27
- >
28
- {{ missingFileCount }}
29
- </span>
30
- </div>
31
- <div class="flex flex-column">
32
- <span>Pending</span>
33
- <span
34
- [ngClass]="{
35
- 'text-yellow-500': pendingFileCount > 0,
36
- 'text-green-500': pendingFileCount === 0
37
- }"
38
- >
39
- {{ pendingFileCount }}
40
- </span>
41
- </div>
42
- </div>
43
- </div>
44
- </div>
45
- </div>
46
- </div>
@@ -1,2 +0,0 @@
1
-
2
- <lib-folder-block [folderBlocks]="folderBlocks"></lib-folder-block>
@@ -1,29 +0,0 @@
1
- import { Component, Input } from '@angular/core';
2
- import { FOLDERPANEL } from '../../../../Shared/constant/SHARED';
3
- import { DocumentModel } from '../../models/document.model';
4
-
5
- /**
6
- * The `FolderContainerComponent` is responsible for rendering a container
7
- * that displays a list of documents and associated folder panel data.
8
- *
9
- * This component utilizes the `FOLDERPANEL` constant for folder panel data
10
- * and accepts a document list input of type `DocumentModel`.
11
- */
12
- @Component({
13
- selector: 'lib-folder-container',
14
- standalone: false,
15
- templateUrl: './folder-container.component.html',
16
- styleUrl: './folder-container.component.scss'
17
- })
18
- export class FolderContainerComponent {
19
- /**
20
- * A list of documents passed as input to the component.
21
- * Represents the document data to be displayed in the folder container.
22
- */
23
- @Input() documentList?: DocumentModel[];
24
-
25
- /**
26
- * Folder blocks data, sourced from the `SHARED` constants.
27
- */
28
- folderBlocks = FOLDERPANEL;
29
- }
@@ -1,191 +0,0 @@
1
- import { APP_INITIALIZER, 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 { HttpClientModule } from '@angular/common/http';
15
- import { ProgressBarModule } from 'primeng/progressbar';
16
- import { BadgeModule } from 'primeng/badge';
17
- import { ListboxModule } from 'primeng/listbox';
18
- import { TimelineModule } from 'primeng/timeline';
19
- import { CheckboxModule } from 'primeng/checkbox';
20
- import { InputTextareaModule } from 'primeng/inputtextarea';
21
- import { FormsModule } from '@angular/forms';
22
- import { DocumentViewerComponent } from './components/document-viewer/document-viewer.component';
23
- import { PdfViewerModule } from 'ng2-pdf-viewer';
24
- import { DialogModule } from 'primeng/dialog';
25
- import { AppConfigService } from '../../Shared/services/app-config.service';
26
- import { GlobalErrorHandler } from '../../Shared/services/global-error.handler';
27
-
28
- /**
29
- * @module DocumentModule
30
- *
31
- * The `DocumentModule` handles the organization and display of document and folder components
32
- * in the application. This module is designed to support features like folder containers,
33
- * document lists, and individual document items.
34
- */
35
- @NgModule({
36
- declarations: [
37
- /**
38
- * The main container for managing documents.
39
- * DocumentContainerComponent
40
- */
41
- DocumentContainerComponent,
42
-
43
- /**
44
- * A container component to manage folders.
45
- * FolderContainerComponent
46
- */
47
- FolderContainerComponent,
48
-
49
- /**
50
- * A block component that represents an individual folder.
51
- * FolderBlockComponent
52
- */
53
- FolderBlockComponent,
54
-
55
- /**
56
- * A component to display a list of documents.
57
- * DocumentListComponent
58
- */
59
- DocumentListComponent,
60
-
61
- /**
62
- * A component representing an individual item in the document list.
63
- * DocumentListItemComponent
64
- */
65
- DocumentListItemComponent,
66
-
67
- /**
68
- * A component representing to upload a file.
69
- */
70
- DocumentUploadComponent,
71
-
72
- /**
73
- * A component representing and allow you to view the document.
74
- */
75
- DocumentViewerComponent,
76
-
77
- ],
78
- imports: [
79
- /**
80
- * Angular's CommonModule is imported to access common directives like `ngIf` and `ngFor`.
81
- */
82
- CommonModule,
83
-
84
- /**
85
- * PrimeNG AccordionModule is used for creating collapsible sections in the UI.
86
- */
87
- AccordionModule,
88
-
89
- /**
90
- * HttpClienModule for the http calls
91
- */
92
- HttpClientModule,
93
-
94
- /**
95
- * PrimeNG ButtonModule is used for creating buttons in the UI.
96
- */
97
- ButtonModule,
98
-
99
- /**
100
- * PrimeNG SidebarModule is used for creating sidebar in the UI.
101
- */
102
- SidebarModule,
103
-
104
- /**
105
- * PrimeNG FileUploadModule is used for uploading file.
106
- */
107
- FileUploadModule,
108
-
109
- /**
110
- * PrimeNG ProgressBarModule is used for showing progress.
111
- */
112
- ProgressBarModule,
113
-
114
- /**
115
- * PrimeNG BadgeModule is used for showing badge value.
116
- */
117
- BadgeModule,
118
-
119
- /**
120
- * PrimeNG ListboxModule is used for showing listbox value.
121
- */
122
- ListboxModule,
123
-
124
- /**
125
- * PrimeNG CheckboxModule is used for showing checkbox value.
126
- */
127
- CheckboxModule,
128
-
129
- /**
130
- * PrimeNG TimelineModule is used for showing timeline value.
131
- */
132
- TimelineModule,
133
- /**
134
- * PrimeNG InputTextareaModule is used for showing textarea value.
135
- */
136
- InputTextareaModule,
137
- /**
138
- * FormsModule to handle the forms.
139
- */
140
- FormsModule,
141
- /**
142
- * PdfViewerModule to handle and make visible the pdf.
143
- */
144
- PdfViewerModule,
145
- /**
146
- * PrimeNG DialogModule is used for showing dialog.
147
- */
148
- DialogModule
149
- ],
150
- exports: [
151
- /**
152
- * Exports the `DocumentContainerComponent` to be used in other modules.
153
- */
154
- DocumentContainerComponent,
155
- /**
156
- * Exports the `DocumentViewerComponent` to be used in other modules.
157
- */
158
- DocumentViewerComponent
159
- ],
160
- providers: [
161
- /**
162
- * Provide the messageservice to be used in other components.
163
- */
164
- MessageService,
165
-
166
- /**
167
- * Provide the messageservice to be used in other components.
168
- */
169
- { provide: GlobalErrorHandler, useClass: GlobalErrorHandler },
170
- /**
171
- * Initializes the application configuration by loading it from the AppConfigService
172
- * before the application starts.
173
- * This ensures that the configuration is available for the rest of the app when needed.
174
- * The configuration is loaded asynchronously using the APP_INITIALIZER.
175
- * @returns {Function} - A function that loads the configuration from the AppConfigService.
176
- */
177
- {
178
- provide: APP_INITIALIZER,
179
- /**
180
- * This useFactory is executed when the app initializes.
181
- */
182
- useFactory: (configService: AppConfigService) => () =>
183
- configService.loadAppConfig().catch((error) => {
184
- throw new Error(error);
185
- }),
186
- deps: [AppConfigService],
187
- multi: true,
188
- }
189
- ]
190
- })
191
- export class DocumentModule { }
@@ -1,39 +0,0 @@
1
- import { SHARED } from "../../../Shared/constant/SHARED";
2
-
3
- /**
4
- * Represents a document model.
5
- *
6
- * This class contains the structure for document-related data, including file name,
7
- * status, and document URL.
8
- */
9
- export class DocumentModel {
10
- /**
11
- * The unique identifier for the document.
12
- * @type {number}
13
- */
14
- _id: number = SHARED.INITIAL_COUNT;
15
-
16
- /**
17
- * The name of the document file.
18
- * @type {?string}
19
- */
20
- fileName?: string;
21
-
22
- /**
23
- * The current status of the document.
24
- * @type {?string}
25
- */
26
- status?: string;
27
-
28
- /**
29
- * The URL where the document is hosted or stored.
30
- * @type {?string}
31
- */
32
- documentUrl?: string;
33
-
34
- /**
35
- * Date of document get uploaded
36
- * @type {?Date}
37
- */
38
- createdAt?: Date
39
- }
@@ -1,16 +0,0 @@
1
- import { TestBed } from '@angular/core/testing';
2
-
3
- import { FileFormatService } from './file-format.service';
4
-
5
- describe('FileFormatService', () => {
6
- let service: FileFormatService;
7
-
8
- beforeEach(() => {
9
- TestBed.configureTestingModule({});
10
- service = TestBed.inject(FileFormatService);
11
- });
12
-
13
- it('should be created', () => {
14
- expect(service).toBeTruthy();
15
- });
16
- });
@@ -1,41 +0,0 @@
1
- import { Injectable } from '@angular/core';
2
- import { SHARED } from '../../../Shared/constant/SHARED';
3
- import { PrimeNGConfig } from 'primeng/api';
4
-
5
- /**
6
- * Description placeholder
7
- * @class FileFormatService
8
- * @typedef {FileFormatService}
9
- */
10
- @Injectable({
11
- providedIn: 'root'
12
- })
13
- export class FileFormatService {
14
-
15
- /**
16
- * Creates an instance of FileFormatService.
17
- * @constructor
18
- */
19
- constructor() { }
20
-
21
- /**
22
- * Description placeholder
23
- * @param {number} bytes
24
- * @param {PrimeNGConfig} config
25
- * @returns {string}
26
- */
27
- formatFileSize(bytes: number, config:PrimeNGConfig): string {
28
- const kilobyte = 1024;
29
- const decimalPlaces = SHARED.ONE;
30
- const sizes = config.translation.fileSizeTypes || SHARED.FILE_SIZE_UNITS;
31
- if (bytes < kilobyte) {
32
- return `${bytes} ${sizes[SHARED.INITIAL_COUNT]}`;
33
- } else if (bytes < kilobyte * kilobyte) {
34
- const kbSize = bytes / kilobyte;
35
- return `${parseFloat(kbSize.toFixed(decimalPlaces))} ${sizes[SHARED.ONE]}`;
36
- } else {
37
- const mbSize = bytes / (kilobyte * kilobyte);
38
- return `${parseFloat(mbSize.toFixed(decimalPlaces))} ${sizes[SHARED.TWO]}`;
39
- }
40
- }
41
- }
@@ -1,23 +0,0 @@
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,23 +0,0 @@
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,15 +0,0 @@
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 +0,0 @@
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 +0,0 @@
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
@@ -1 +0,0 @@
1
- <lib-document-container></lib-document-container>
File without changes
@@ -1,29 +0,0 @@
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
- });
@@ -1,15 +0,0 @@
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
- }