cat-documents-ng 1.0.4 → 1.0.6
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/ng-package.json +10 -0
- package/package.json +5 -11
- package/src/Shared/components/confirmation-dialog/confirmation-dialog.component.html +3 -0
- package/src/Shared/components/confirmation-dialog/confirmation-dialog.component.scss +13 -0
- package/src/Shared/components/confirmation-dialog/confirmation-dialog.component.spec.ts +70 -0
- package/src/Shared/components/confirmation-dialog/confirmation-dialog.component.ts +133 -0
- package/src/Shared/components/table-primary/table-primary.component.html +66 -0
- package/src/Shared/components/table-primary/table-primary.component.scss +227 -0
- package/src/Shared/components/table-primary/table-primary.component.spec.ts +23 -0
- package/src/Shared/components/table-primary/table-primary.component.ts +143 -0
- package/src/Shared/components/table-primary/table-primary.model.ts +21 -0
- package/src/Shared/constant/ERROR.ts +55 -0
- package/src/Shared/constant/PERMISSIONS.ts +17 -0
- package/src/Shared/constant/SHARED.ts +936 -0
- package/{Shared/constant/URLS.d.ts → src/Shared/constant/URLS.ts} +31 -25
- package/src/Shared/services/app-config.service.spec.ts +19 -0
- package/src/Shared/services/app-config.service.ts +73 -0
- package/{Shared/services/global-error.handler.d.ts → src/Shared/services/global-error.handler.ts} +11 -9
- package/src/Shared/services/session.service.spec.ts +16 -0
- package/src/Shared/services/session.service.ts +76 -0
- package/src/Shared/shared.module.ts +25 -0
- package/src/lib/document/components/csv-viewer/csv-viewer.component.ts +1 -0
- package/src/lib/document/components/document-actions/document-actions.component.html +59 -0
- package/src/lib/document/components/document-actions/document-actions.component.scss +362 -0
- package/src/lib/document/components/document-actions/document-actions.component.spec.ts +297 -0
- package/src/lib/document/components/document-actions/document-actions.component.ts +163 -0
- package/src/lib/document/components/document-container/document-container.component.html +36 -0
- package/src/lib/document/components/document-container/document-container.component.scss +144 -0
- package/src/lib/document/components/document-container/document-container.component.spec.ts +110 -0
- package/src/lib/document/components/document-container/document-container.component.ts +363 -0
- package/src/lib/document/components/document-content-viewer/document-content-viewer.component.html +332 -0
- package/src/lib/document/components/document-content-viewer/document-content-viewer.component.scss +1877 -0
- package/src/lib/document/components/document-content-viewer/document-content-viewer.component.spec.ts +258 -0
- package/src/lib/document/components/document-content-viewer/document-content-viewer.component.ts +664 -0
- package/src/lib/document/components/document-history/document-history.component.html +96 -0
- package/src/lib/document/components/document-history/document-history.component.scss +392 -0
- package/src/lib/document/components/document-history/document-history.component.spec.ts +93 -0
- package/src/lib/document/components/document-history/document-history.component.ts +373 -0
- package/src/lib/document/components/document-list/document-list.component.html +46 -0
- package/src/lib/document/components/document-list/document-list.component.scss +513 -0
- package/src/lib/document/components/document-list/document-list.component.spec.ts +486 -0
- package/src/lib/document/components/document-list/document-list.component.ts +682 -0
- package/src/lib/document/components/document-list-item/document-list-item.component.html +36 -0
- package/src/lib/document/components/document-list-item/document-list-item.component.scss +34 -0
- package/src/lib/document/components/document-list-item/document-list-item.component.spec.ts +75 -0
- package/src/lib/document/components/document-list-item/document-list-item.component.ts +40 -0
- package/src/lib/document/components/document-search/document-search.component.html +64 -0
- package/src/lib/document/components/document-search/document-search.component.scss +206 -0
- package/src/lib/document/components/document-search/document-search.component.spec.ts +82 -0
- package/src/lib/document/components/document-search/document-search.component.ts +163 -0
- package/src/lib/document/components/document-status/document-status.component.html +31 -0
- package/src/lib/document/components/document-status/document-status.component.scss +192 -0
- package/src/lib/document/components/document-status/document-status.component.spec.ts +23 -0
- package/src/lib/document/components/document-status/document-status.component.ts +87 -0
- package/src/lib/document/components/document-upload/document-upload.component.html +160 -0
- package/src/lib/document/components/document-upload/document-upload.component.scss +235 -0
- package/src/lib/document/components/document-upload/document-upload.component.spec.ts +95 -0
- package/src/lib/document/components/document-upload/document-upload.component.ts +668 -0
- package/src/lib/document/components/document-viewer/document-viewer.component.html +50 -0
- package/src/lib/document/components/document-viewer/document-viewer.component.scss +187 -0
- package/src/lib/document/components/document-viewer/document-viewer.component.spec.ts +79 -0
- package/src/lib/document/components/document-viewer/document-viewer.component.ts +261 -0
- package/src/lib/document/components/document-zoom-controls/document-zoom-controls.component.html +48 -0
- package/src/lib/document/components/document-zoom-controls/document-zoom-controls.component.scss +320 -0
- package/src/lib/document/components/document-zoom-controls/document-zoom-controls.component.spec.ts +59 -0
- package/src/lib/document/components/document-zoom-controls/document-zoom-controls.component.ts +150 -0
- package/src/lib/document/components/documents-menu/documents-menu.component.html +44 -0
- package/src/lib/document/components/documents-menu/documents-menu.component.scss +363 -0
- package/src/lib/document/components/documents-menu/documents-menu.component.spec.ts +23 -0
- package/src/lib/document/components/documents-menu/documents-menu.component.ts +316 -0
- package/src/lib/document/components/folder-block/folder-block.component.html +46 -0
- package/src/lib/document/components/folder-block/folder-block.component.scss +9 -0
- package/src/lib/document/components/folder-block/folder-block.component.spec.ts +70 -0
- package/{lib/document/components/folder-block/folder-block.component.d.ts → src/lib/document/components/folder-block/folder-block.component.ts} +28 -12
- package/src/lib/document/components/folder-container/folder-container.component.html +56 -0
- package/src/lib/document/components/folder-container/folder-container.component.scss +20 -0
- package/src/lib/document/components/folder-container/folder-container.component.spec.ts +27 -0
- package/src/lib/document/components/folder-container/folder-container.component.ts +328 -0
- package/src/lib/document/components/linked-document/linked-document.component.html +23 -0
- package/src/lib/document/components/linked-document/linked-document.component.scss +10 -0
- package/src/lib/document/components/linked-document/linked-document.component.spec.ts +61 -0
- package/src/lib/document/components/linked-document/linked-document.component.ts +49 -0
- package/src/lib/document/components/request-document/request-document.component.html +86 -0
- package/src/lib/document/components/request-document/request-document.component.scss +16 -0
- package/src/lib/document/components/request-document/request-document.component.ts +278 -0
- package/src/lib/document/components/sidebar/sidebar.component.html +75 -0
- package/src/lib/document/components/sidebar/sidebar.component.scss +157 -0
- package/src/lib/document/components/sidebar/sidebar.component.spec.ts +114 -0
- package/src/lib/document/components/sidebar/sidebar.component.ts +223 -0
- package/src/lib/document/components/user-list/user-list.component.html +33 -0
- package/src/lib/document/components/user-list/user-list.component.scss +118 -0
- package/src/lib/document/components/user-list/user-list.component.spec.ts +23 -0
- package/src/lib/document/components/user-list/user-list.component.ts +181 -0
- package/src/lib/document/constant/DOCUMENT_HISTORY.ts +52 -0
- package/src/lib/document/directives/document.directive.ts +32 -0
- package/src/lib/document/directives/permission.directive.spec.ts +0 -0
- package/src/lib/document/directives/permission.directive.ts +72 -0
- package/src/lib/document/document.module.ts +351 -0
- package/{lib/document/models/document-alert.model.d.ts → src/lib/document/models/document-alert.model.ts} +11 -4
- package/src/lib/document/models/document-category.model.ts +30 -0
- package/src/lib/document/models/document-history.model.ts +109 -0
- package/src/lib/document/models/document-list-response.model.ts +37 -0
- package/src/lib/document/models/document-type.model.ts +44 -0
- package/src/lib/document/models/document.model.ts +53 -0
- package/{lib/document/models/folder.model.d.ts → src/lib/document/models/folder.model.ts} +10 -4
- package/src/lib/document/models/status-data.model.ts +31 -0
- package/src/lib/document/models/uploaded-file-response.model.ts +7 -0
- package/src/lib/document/models/user-list.model.ts +10 -0
- package/src/lib/document/services/csv-parser.service.spec.ts +97 -0
- package/src/lib/document/services/csv-parser.service.ts +303 -0
- package/src/lib/document/services/document-actions.service.ts +125 -0
- package/src/lib/document/services/document-content-type.service.ts +193 -0
- package/src/lib/document/services/document-history-style.service.ts +138 -0
- package/src/lib/document/services/document-history.service.ts +129 -0
- package/src/lib/document/services/document-http.service.spec.ts +119 -0
- package/src/lib/document/services/document-http.service.ts +497 -0
- package/src/lib/document/services/document-list.service.ts +195 -0
- package/src/lib/document/services/document-menu.service.ts +277 -0
- package/src/lib/document/services/document-scroll.service.ts +138 -0
- package/src/lib/document/services/document-severity.service.ts +98 -0
- package/src/lib/document/services/document-table-builder.service.ts +82 -0
- package/src/lib/document/services/document-upload-business.service.ts +326 -0
- package/src/lib/document/services/document-upload-data.service.ts +82 -0
- package/src/lib/document/services/document-upload-form.service.ts +149 -0
- package/src/lib/document/services/document-upload.service.spec.ts +99 -0
- package/src/lib/document/services/document-upload.service.ts +209 -0
- package/src/lib/document/services/document-viewer.service.ts +279 -0
- package/src/lib/document/services/document-zoom.service.spec.ts +56 -0
- package/src/lib/document/services/document-zoom.service.ts +164 -0
- package/src/lib/document/services/document.service.ts +356 -0
- package/src/lib/document/services/eml-parser.service.ts +444 -0
- package/src/lib/document/services/excel-parser.service.spec.ts +66 -0
- package/src/lib/document/services/excel-parser.service.ts +483 -0
- package/src/lib/document/services/file-format.service.spec.ts +16 -0
- package/src/lib/document/services/file-format.service.ts +63 -0
- package/src/lib/document/services/status-calculator.service.ts +44 -0
- package/src/lib/document/services/user-list.service.ts +77 -0
- package/src/lib/document/state/document.query.ts +378 -0
- package/{lib/document/state/document.service.d.ts → src/lib/document/state/document.service.ts} +46 -15
- package/src/lib/document/state/document.state.ts +100 -0
- package/src/lib/document/state/document.store.ts +200 -0
- package/{public-api.d.ts → src/public-api.ts} +4 -0
- package/tsconfig.lib.json +15 -0
- package/tsconfig.lib.prod.json +11 -0
- package/tsconfig.spec.json +15 -0
- package/Shared/components/confirmation-dialog/confirmation-dialog.component.d.ts +0 -44
- package/Shared/components/table-primary/table-primary.component.d.ts +0 -31
- package/Shared/components/table-primary/table-primary.model.d.ts +0 -19
- package/Shared/constant/ERROR.d.ts +0 -52
- package/Shared/constant/SHARED.d.ts +0 -546
- package/Shared/services/app-config.service.d.ts +0 -51
- package/Shared/services/session.service.d.ts +0 -46
- package/Shared/shared.module.d.ts +0 -14
- package/fesm2022/cat-documents-ng.mjs +0 -11392
- package/fesm2022/cat-documents-ng.mjs.map +0 -1
- package/index.d.ts +0 -5
- package/lib/document/components/document-actions/document-actions.component.d.ts +0 -78
- package/lib/document/components/document-container/document-container.component.d.ts +0 -162
- package/lib/document/components/document-content-viewer/document-content-viewer.component.d.ts +0 -291
- package/lib/document/components/document-history/document-history.component.d.ts +0 -160
- package/lib/document/components/document-list/document-list.component.d.ts +0 -299
- package/lib/document/components/document-list-item/document-list-item.component.d.ts +0 -28
- package/lib/document/components/document-search/document-search.component.d.ts +0 -77
- package/lib/document/components/document-status/document-status.component.d.ts +0 -24
- package/lib/document/components/document-upload/document-upload.component.d.ts +0 -321
- package/lib/document/components/document-viewer/document-viewer.component.d.ts +0 -137
- package/lib/document/components/document-zoom-controls/document-zoom-controls.component.d.ts +0 -33
- package/lib/document/components/documents-menu/documents-menu.component.d.ts +0 -110
- package/lib/document/components/folder-container/folder-container.component.d.ts +0 -162
- package/lib/document/components/linked-document/linked-document.component.d.ts +0 -39
- package/lib/document/components/request-document/request-document.component.d.ts +0 -69
- package/lib/document/components/sidebar/sidebar.component.d.ts +0 -109
- package/lib/document/components/user-list/user-list.component.d.ts +0 -34
- package/lib/document/constant/DOCUMENT_HISTORY.d.ts +0 -41
- package/lib/document/directives/document.directive.d.ts +0 -20
- package/lib/document/directives/permission.directive.d.ts +0 -38
- package/lib/document/document.module.d.ts +0 -60
- package/lib/document/models/document-category.model.d.ts +0 -24
- package/lib/document/models/document-history.model.d.ts +0 -94
- package/lib/document/models/document-list-response.model.d.ts +0 -33
- package/lib/document/models/document-type.model.d.ts +0 -37
- package/lib/document/models/document.model.d.ts +0 -44
- package/lib/document/models/status-data.model.d.ts +0 -27
- package/lib/document/models/uploaded-file-response.model.d.ts +0 -7
- package/lib/document/models/user-list.model.d.ts +0 -8
- package/lib/document/services/csv-parser.service.d.ts +0 -88
- package/lib/document/services/document-actions.service.d.ts +0 -48
- package/lib/document/services/document-content-type.service.d.ts +0 -85
- package/lib/document/services/document-history-style.service.d.ts +0 -34
- package/lib/document/services/document-history.service.d.ts +0 -42
- package/lib/document/services/document-http.service.d.ts +0 -179
- package/lib/document/services/document-list.service.d.ts +0 -74
- package/lib/document/services/document-menu.service.d.ts +0 -122
- package/lib/document/services/document-scroll.service.d.ts +0 -55
- package/lib/document/services/document-table-builder.service.d.ts +0 -38
- package/lib/document/services/document-upload-business.service.d.ts +0 -107
- package/lib/document/services/document-upload-data.service.d.ts +0 -40
- package/lib/document/services/document-upload-form.service.d.ts +0 -41
- package/lib/document/services/document-upload.service.d.ts +0 -99
- package/lib/document/services/document-viewer.service.d.ts +0 -97
- package/lib/document/services/document-zoom.service.d.ts +0 -81
- package/lib/document/services/document.service.d.ts +0 -161
- package/lib/document/services/eml-parser.service.d.ts +0 -116
- package/lib/document/services/excel-parser.service.d.ts +0 -169
- package/lib/document/services/file-format.service.d.ts +0 -34
- package/lib/document/services/status-calculator.service.d.ts +0 -20
- package/lib/document/services/user-list.service.d.ts +0 -29
- package/lib/document/state/document.query.d.ts +0 -243
- package/lib/document/state/document.state.d.ts +0 -61
- package/lib/document/state/document.store.d.ts +0 -56
package/src/lib/document/components/document-zoom-controls/document-zoom-controls.component.scss
ADDED
|
@@ -0,0 +1,320 @@
|
|
|
1
|
+
|
|
2
|
+
.control-container {
|
|
3
|
+
display: flex;
|
|
4
|
+
flex-direction: row;
|
|
5
|
+
align-items: center;
|
|
6
|
+
justify-content: space-between;
|
|
7
|
+
gap: 0;
|
|
8
|
+
width: 100%;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
// Document name editing section
|
|
12
|
+
.document-name-display {
|
|
13
|
+
display: flex;
|
|
14
|
+
flex-direction: column;
|
|
15
|
+
gap: 0.25rem;
|
|
16
|
+
cursor: pointer;
|
|
17
|
+
padding: 0.75rem;
|
|
18
|
+
border-radius: 0.5rem;
|
|
19
|
+
transition: all 0.2s ease;
|
|
20
|
+
border: 1px solid transparent;
|
|
21
|
+
margin-right: auto;
|
|
22
|
+
|
|
23
|
+
&:hover {
|
|
24
|
+
background-color: transparent;
|
|
25
|
+
border-color: transparent;
|
|
26
|
+
transform: none;
|
|
27
|
+
box-shadow: none;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// Highlighting for editable document names
|
|
31
|
+
&.clickable-doc-name {
|
|
32
|
+
&:hover {
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
// Non-editable document names remain neutral
|
|
37
|
+
&.non-clickable-doc-name {
|
|
38
|
+
cursor: default;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.alias-name {
|
|
42
|
+
font-weight: 600;
|
|
43
|
+
color: #1e293b;
|
|
44
|
+
font-size: 1.125rem;
|
|
45
|
+
display: flex;
|
|
46
|
+
align-items: center;
|
|
47
|
+
gap: 0.5rem;
|
|
48
|
+
line-height: 1.4;
|
|
49
|
+
|
|
50
|
+
.edit-icon-small {
|
|
51
|
+
font-size: 0.75rem;
|
|
52
|
+
color: #64748b;
|
|
53
|
+
opacity: 0.7;
|
|
54
|
+
transition: all 0.2s ease;
|
|
55
|
+
padding: 0.25rem;
|
|
56
|
+
border-radius: 0.25rem;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
// Only apply hover styles when document is editable
|
|
61
|
+
&.clickable-doc-name .alias-name:hover {
|
|
62
|
+
color: #1d4ed8;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.document-name {
|
|
66
|
+
font-size: 0.875rem;
|
|
67
|
+
color: #64748b;
|
|
68
|
+
font-weight: 400;
|
|
69
|
+
line-height: 1.3;
|
|
70
|
+
word-break: break-all;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
// Only show edit icon hover effects when document is editable
|
|
74
|
+
&.clickable-doc-name:hover .edit-icon-small {
|
|
75
|
+
opacity: 1;
|
|
76
|
+
color: #475569;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
// Inline editing style to match header-with-underline design
|
|
82
|
+
.document-edit-container {
|
|
83
|
+
display: flex;
|
|
84
|
+
flex-direction: column;
|
|
85
|
+
gap: 0.375rem;
|
|
86
|
+
padding: 0;
|
|
87
|
+
background: transparent;
|
|
88
|
+
border-radius: 0;
|
|
89
|
+
border: none;
|
|
90
|
+
|
|
91
|
+
.document-name-input {
|
|
92
|
+
border: none !important;
|
|
93
|
+
border-bottom: 2px solid #3b82f6 !important;
|
|
94
|
+
border-radius: 0 !important;
|
|
95
|
+
padding: 0.25rem 0 !important;
|
|
96
|
+
font-size: 1.125rem !important;
|
|
97
|
+
font-weight: 600 !important;
|
|
98
|
+
color: #1e293b !important;
|
|
99
|
+
background: transparent !important;
|
|
100
|
+
transition: border-color 0.2s ease;
|
|
101
|
+
width: auto;
|
|
102
|
+
min-width: 12rem;
|
|
103
|
+
max-width: 100%;
|
|
104
|
+
box-shadow: none !important;
|
|
105
|
+
outline: none !important;
|
|
106
|
+
|
|
107
|
+
&:focus {
|
|
108
|
+
outline: none !important;
|
|
109
|
+
border-bottom-color: #1d4ed8 !important;
|
|
110
|
+
box-shadow: none !important;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
&::placeholder {
|
|
114
|
+
color: #94a3b8;
|
|
115
|
+
font-weight: 400;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
.document-name-subline {
|
|
120
|
+
font-size: 0.875rem;
|
|
121
|
+
color: #94a3b8;
|
|
122
|
+
padding-left: 0;
|
|
123
|
+
line-height: 1.3;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
// Ensure PrimeNG input styles don't reintroduce borders/shadows
|
|
128
|
+
:host ::ng-deep .document-name-input.p-inputtext,
|
|
129
|
+
:host ::ng-deep .document-name-input.p-inputtext:enabled:focus,
|
|
130
|
+
:host ::ng-deep .document-name-input.p-inputtext:focus {
|
|
131
|
+
border: none !important;
|
|
132
|
+
border-bottom: 2px solid #3b82f6 !important;
|
|
133
|
+
border-radius: 0 !important;
|
|
134
|
+
box-shadow: none !important;
|
|
135
|
+
outline: none !important;
|
|
136
|
+
background: transparent !important;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
// Neutralize PrimeNG hover styles
|
|
140
|
+
:host ::ng-deep .document-name-input.p-inputtext:hover,
|
|
141
|
+
:host ::ng-deep .document-name-input.p-inputtext:enabled:hover {
|
|
142
|
+
border: none !important;
|
|
143
|
+
border-bottom: 2px solid #1d4ed8 !important;
|
|
144
|
+
border-radius: 0 !important;
|
|
145
|
+
box-shadow: none !important;
|
|
146
|
+
outline: none !important;
|
|
147
|
+
background: transparent !important;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
.error-message-wrapper {
|
|
151
|
+
color: #dc2626;
|
|
152
|
+
font-size: 0.875rem;
|
|
153
|
+
font-weight: 500;
|
|
154
|
+
padding: 0.5rem 0.75rem;
|
|
155
|
+
background-color: #fef2f2;
|
|
156
|
+
border: 1px solid #fecaca;
|
|
157
|
+
border-radius: 0.5rem;
|
|
158
|
+
margin-top: 0.25rem;
|
|
159
|
+
display: flex;
|
|
160
|
+
align-items: center;
|
|
161
|
+
gap: 0.5rem;
|
|
162
|
+
|
|
163
|
+
&::before {
|
|
164
|
+
content: "⚠";
|
|
165
|
+
font-size: 1rem;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
// Zoom controls section
|
|
170
|
+
.zoom-controls {
|
|
171
|
+
display: flex;
|
|
172
|
+
align-items: center;
|
|
173
|
+
gap: 0.75rem;
|
|
174
|
+
transition: all 0.2s ease;
|
|
175
|
+
margin-left: auto;
|
|
176
|
+
padding-right: 10px;
|
|
177
|
+
.zoom-button {
|
|
178
|
+
width: 44px;
|
|
179
|
+
height: 44px;
|
|
180
|
+
border-radius: 0.5rem;
|
|
181
|
+
border: none;
|
|
182
|
+
background: white;
|
|
183
|
+
color: #475569;
|
|
184
|
+
display: flex;
|
|
185
|
+
align-items: center;
|
|
186
|
+
justify-content: center;
|
|
187
|
+
cursor: pointer;
|
|
188
|
+
transition: all 0.2s ease;
|
|
189
|
+
font-size: 1.25rem;
|
|
190
|
+
font-weight: 600;
|
|
191
|
+
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
|
|
192
|
+
|
|
193
|
+
&:hover:not(:disabled) {
|
|
194
|
+
background: #3b82f6;
|
|
195
|
+
color: white;
|
|
196
|
+
transform: translateY(-2px);
|
|
197
|
+
box-shadow: 0 6px 16px rgba(59, 130, 246, 0.4);
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
&:active:not(:disabled) {
|
|
201
|
+
transform: translateY(0);
|
|
202
|
+
box-shadow: 0 2px 6px rgba(59, 130, 246, 0.3);
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
&:disabled {
|
|
206
|
+
opacity: 0.4;
|
|
207
|
+
cursor: not-allowed;
|
|
208
|
+
background: #f1f5f9;
|
|
209
|
+
color: #94a3b8;
|
|
210
|
+
transform: none;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
i {
|
|
214
|
+
font-size: 1rem;
|
|
215
|
+
transition: transform 0.2s ease;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
&:hover:not(:disabled) i {
|
|
219
|
+
transform: scale(1.1);
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
.zoom-level {
|
|
224
|
+
min-width: 4.5rem;
|
|
225
|
+
text-align: center;
|
|
226
|
+
font-weight: 700;
|
|
227
|
+
color: #1e293b;
|
|
228
|
+
font-size: 1rem;
|
|
229
|
+
background: white;
|
|
230
|
+
padding: 0.75rem 1rem;
|
|
231
|
+
border-radius: 0.5rem;
|
|
232
|
+
border: 1px solid #e2e8f0;
|
|
233
|
+
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
|
|
234
|
+
transition: all 0.2s ease;
|
|
235
|
+
user-select: none;
|
|
236
|
+
|
|
237
|
+
&:hover {
|
|
238
|
+
background: #f8fafc;
|
|
239
|
+
border-color: #cbd5e1;
|
|
240
|
+
transform: translateY(-1px);
|
|
241
|
+
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
.reset-button {
|
|
246
|
+
padding: 0.75rem 1.25rem;
|
|
247
|
+
border: 1px solid #cbd5e1;
|
|
248
|
+
background: white;
|
|
249
|
+
color: #64748b;
|
|
250
|
+
border-radius: 0.5rem;
|
|
251
|
+
font-size: 0.875rem;
|
|
252
|
+
font-weight: 500;
|
|
253
|
+
cursor: pointer;
|
|
254
|
+
transition: all 0.2s ease;
|
|
255
|
+
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
|
|
256
|
+
white-space: nowrap;
|
|
257
|
+
|
|
258
|
+
&:hover {
|
|
259
|
+
background: #f8fafc;
|
|
260
|
+
border-color: #94a3b8;
|
|
261
|
+
color: #475569;
|
|
262
|
+
transform: translateY(-1px);
|
|
263
|
+
box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1);
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
&:active {
|
|
267
|
+
transform: translateY(0);
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
// Responsive design
|
|
273
|
+
@media (max-width: 768px) {
|
|
274
|
+
.control-container {
|
|
275
|
+
gap: 0.75rem;
|
|
276
|
+
flex-direction: column;
|
|
277
|
+
align-items: stretch;
|
|
278
|
+
justify-content: flex-start;
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
.document-name-display {
|
|
282
|
+
margin-right: 0;
|
|
283
|
+
margin-bottom: 0.5rem;
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
.zoom-controls {
|
|
287
|
+
margin-left: 0;
|
|
288
|
+
align-self: flex-end;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
.zoom-controls {
|
|
292
|
+
padding: 0.75rem;
|
|
293
|
+
gap: 0.5rem;
|
|
294
|
+
flex-wrap: wrap;
|
|
295
|
+
justify-content: center;
|
|
296
|
+
|
|
297
|
+
.zoom-button {
|
|
298
|
+
width: 40px;
|
|
299
|
+
height: 40px;
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
.zoom-level {
|
|
303
|
+
min-width: 4rem;
|
|
304
|
+
padding: 0.5rem 0.75rem;
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
.reset-button {
|
|
308
|
+
padding: 0.5rem 1rem;
|
|
309
|
+
font-size: 0.8rem;
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
.document-name-display {
|
|
314
|
+
padding: 0.5rem;
|
|
315
|
+
|
|
316
|
+
.alias-name {
|
|
317
|
+
font-size: 1rem;
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
}
|
package/src/lib/document/components/document-zoom-controls/document-zoom-controls.component.spec.ts
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
+
import { DocumentZoomControlsComponent } from './document-zoom-controls.component';
|
|
3
|
+
import { DocumentZoomService } from '../../services/document-zoom.service';
|
|
4
|
+
import { ButtonModule } from 'primeng/button';
|
|
5
|
+
|
|
6
|
+
describe('DocumentZoomControlsComponent', () => {
|
|
7
|
+
let component: DocumentZoomControlsComponent;
|
|
8
|
+
let fixture: ComponentFixture<DocumentZoomControlsComponent>;
|
|
9
|
+
let zoomService: jasmine.SpyObj<DocumentZoomService>;
|
|
10
|
+
|
|
11
|
+
beforeEach(async () => {
|
|
12
|
+
const spy = jasmine.createSpyObj('DocumentZoomService', ['zoomIn', 'zoomOut', 'resetZoom'], {
|
|
13
|
+
zoomLevel$: { subscribe: () => {} },
|
|
14
|
+
zoomConfig: { minZoom: 25, maxZoom: 400 }
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
await TestBed.configureTestingModule({
|
|
18
|
+
declarations: [DocumentZoomControlsComponent],
|
|
19
|
+
imports: [ButtonModule],
|
|
20
|
+
providers: [
|
|
21
|
+
{ provide: DocumentZoomService, useValue: spy }
|
|
22
|
+
]
|
|
23
|
+
}).compileComponents();
|
|
24
|
+
|
|
25
|
+
fixture = TestBed.createComponent(DocumentZoomControlsComponent);
|
|
26
|
+
component = fixture.componentInstance;
|
|
27
|
+
zoomService = TestBed.inject(DocumentZoomService) as jasmine.SpyObj<DocumentZoomService>;
|
|
28
|
+
fixture.detectChanges();
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
it('should create', () => {
|
|
32
|
+
expect(component).toBeTruthy();
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
it('should call zoomIn when zoom in button is clicked', () => {
|
|
36
|
+
component.zoomIn();
|
|
37
|
+
expect(zoomService.zoomIn).toHaveBeenCalled();
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
it('should call zoomOut when zoom out button is clicked', () => {
|
|
41
|
+
component.zoomOut();
|
|
42
|
+
expect(zoomService.zoomOut).toHaveBeenCalled();
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
it('should call resetZoom when reset button is clicked', () => {
|
|
46
|
+
component.resetZoom();
|
|
47
|
+
expect(zoomService.resetZoom).toHaveBeenCalled();
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
it('should disable zoom out button when at minimum zoom', () => {
|
|
51
|
+
component.currentZoom = 25;
|
|
52
|
+
expect(component.isZoomOutDisabled).toBe(true);
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
it('should disable zoom in button when at maximum zoom', () => {
|
|
56
|
+
component.currentZoom = 400;
|
|
57
|
+
expect(component.isZoomInDisabled).toBe(true);
|
|
58
|
+
});
|
|
59
|
+
});
|
package/src/lib/document/components/document-zoom-controls/document-zoom-controls.component.ts
ADDED
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import { Component, OnInit, OnDestroy, Input, Output, EventEmitter } from '@angular/core';
|
|
2
|
+
import { DocumentZoomService } from '../../services/document-zoom.service';
|
|
3
|
+
import { DocumentHttpService } from '../../services/document-http.service';
|
|
4
|
+
import { DocumentListItem } from '../../models/document-list-response.model';
|
|
5
|
+
import { Subscription } from 'rxjs';
|
|
6
|
+
import { SHARED } from '../../../../Shared/constant/SHARED';
|
|
7
|
+
import { ERRORS } from '../../../../Shared/constant/ERROR';
|
|
8
|
+
|
|
9
|
+
@Component({
|
|
10
|
+
selector: 'document-zoom-controls',
|
|
11
|
+
templateUrl: './document-zoom-controls.component.html',
|
|
12
|
+
styleUrls: ['./document-zoom-controls.component.scss'],
|
|
13
|
+
standalone:false
|
|
14
|
+
})
|
|
15
|
+
export class DocumentZoomControlsComponent implements OnInit, OnDestroy {
|
|
16
|
+
@Input() selectedDocument?: DocumentListItem;
|
|
17
|
+
@Input() contextId?: string = SHARED.EMPTY;
|
|
18
|
+
@Input() isFormHide: boolean = false;
|
|
19
|
+
@Output() documentNameUpdated = new EventEmitter<void>();
|
|
20
|
+
|
|
21
|
+
currentZoom: number = 100;
|
|
22
|
+
private subscription: Subscription = new Subscription();
|
|
23
|
+
|
|
24
|
+
// Document name editing properties
|
|
25
|
+
isEditingDocumentName: boolean = false;
|
|
26
|
+
documentName: string = SHARED.EMPTY;
|
|
27
|
+
fileNameError: string = SHARED.EMPTY;
|
|
28
|
+
disallowedCharsRegex: RegExp = /[<>:"\/\\|?*]/;
|
|
29
|
+
|
|
30
|
+
constructor(
|
|
31
|
+
private zoomService: DocumentZoomService,
|
|
32
|
+
private documentHttpService: DocumentHttpService
|
|
33
|
+
) {}
|
|
34
|
+
|
|
35
|
+
ngOnInit(): void {
|
|
36
|
+
this.subscription.add(
|
|
37
|
+
this.zoomService.zoomLevel$.subscribe(zoom => {
|
|
38
|
+
this.currentZoom = zoom;
|
|
39
|
+
})
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
ngOnDestroy(): void {
|
|
44
|
+
this.subscription.unsubscribe();
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
get isZoomOutDisabled(): boolean {
|
|
48
|
+
return this.currentZoom <= this.zoomService.zoomConfig.minZoom;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
get isZoomInDisabled(): boolean {
|
|
52
|
+
return this.currentZoom >= this.zoomService.zoomConfig.maxZoom;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
zoomIn(): void {
|
|
56
|
+
this.zoomService.zoomIn();
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
zoomOut(): void {
|
|
60
|
+
this.zoomService.zoomOut();
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
resetZoom(): void {
|
|
64
|
+
this.zoomService.resetZoom();
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
// Document name editing methods
|
|
68
|
+
onDocumentNameClick(): void {
|
|
69
|
+
// Only allow editing if the document alias is editable
|
|
70
|
+
if (!this.selectedDocument?.isAliasEditable) {
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
this.isEditingDocumentName = true;
|
|
75
|
+
if (this.selectedDocument?.aliasName && this.selectedDocument.aliasName.trim() !== SHARED.EMPTY) {
|
|
76
|
+
this.documentName = this.selectedDocument.aliasName;
|
|
77
|
+
} else if (this.selectedDocument?.docName) {
|
|
78
|
+
const lastDotIndex = this.selectedDocument.docName.lastIndexOf('.');
|
|
79
|
+
if (lastDotIndex !== -1) {
|
|
80
|
+
this.documentName = this.selectedDocument.docName.substring(0, lastDotIndex);
|
|
81
|
+
} else {
|
|
82
|
+
this.documentName = this.selectedDocument.docName;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
setTimeout(() => {
|
|
87
|
+
const inputElement = document.querySelector('.document-name-input') as HTMLInputElement;
|
|
88
|
+
if (inputElement) {
|
|
89
|
+
inputElement.focus();
|
|
90
|
+
inputElement.select();
|
|
91
|
+
}
|
|
92
|
+
}, 100);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
cancelDocumentNameEdit(): void {
|
|
96
|
+
this.isEditingDocumentName = false;
|
|
97
|
+
this.fileNameError = SHARED.EMPTY;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
onDocumentNameChange(event: Event): void {
|
|
101
|
+
const input = event.target as HTMLInputElement;
|
|
102
|
+
this.documentName = input.value;
|
|
103
|
+
if (this.disallowedCharsRegex.test(this.documentName)) {
|
|
104
|
+
this.fileNameError = ERRORS.ERROR_FILE_NAME_INVALID_CHARACTERS;
|
|
105
|
+
} else if (this.documentName.trim() === SHARED.EMPTY) {
|
|
106
|
+
this.fileNameError = ERRORS.ERROR_FILE_NAME_EMPTY;
|
|
107
|
+
} else {
|
|
108
|
+
this.fileNameError = SHARED.EMPTY;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
handleSaveClick(): void {
|
|
113
|
+
if (!this.selectedDocument?._id) {
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
let hasChanged = false;
|
|
118
|
+
if (this.selectedDocument.aliasName && this.selectedDocument.aliasName.trim() !== SHARED.EMPTY) {
|
|
119
|
+
hasChanged = this.documentName !== this.selectedDocument.aliasName;
|
|
120
|
+
} else if (this.selectedDocument.docName) {
|
|
121
|
+
const docNameWithoutExtension = this.selectedDocument.docName.lastIndexOf(SHARED.DOT) !== -1
|
|
122
|
+
? this.selectedDocument.docName.substring(0, this.selectedDocument.docName.lastIndexOf(SHARED.DOT))
|
|
123
|
+
: this.selectedDocument.docName;
|
|
124
|
+
hasChanged = this.documentName !== docNameWithoutExtension;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
if (hasChanged && !this.fileNameError) {
|
|
128
|
+
const payload = { aliasName: this.documentName };
|
|
129
|
+
this.documentHttpService.updateDocumentName(this.selectedDocument._id, payload)
|
|
130
|
+
.subscribe({
|
|
131
|
+
next: (res: any) => {
|
|
132
|
+
if (res && res.aliasName) {
|
|
133
|
+
this.selectedDocument!.aliasName = res.aliasName;
|
|
134
|
+
} else {
|
|
135
|
+
this.selectedDocument!.aliasName = this.documentName;
|
|
136
|
+
}
|
|
137
|
+
this.isEditingDocumentName = false;
|
|
138
|
+
this.fileNameError = SHARED.EMPTY;
|
|
139
|
+
this.documentNameUpdated.emit();
|
|
140
|
+
},
|
|
141
|
+
error: (error: any) => {
|
|
142
|
+
this.fileNameError = error.message;
|
|
143
|
+
}
|
|
144
|
+
});
|
|
145
|
+
} else {
|
|
146
|
+
this.isEditingDocumentName = false;
|
|
147
|
+
this.fileNameError = SHARED.EMPTY;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
<div class="document-sidebar-container">
|
|
2
|
+
<!-- Menu items are now used for navigation to specific sections, not for filtering documents -->
|
|
3
|
+
<p-card class="widget-menu-wrapper h-full">
|
|
4
|
+
@if(applicationNumber){
|
|
5
|
+
<div class="flex align-items-center justify-content-between widget-menu-header-wrapper">
|
|
6
|
+
<p class="mb-0 application-title-wrapper">ID - {{applicationNumber}}</p>
|
|
7
|
+
<div class="expand-icon-wrapper">
|
|
8
|
+
<i class="ri-arrow-left-s-line text-primary flex align-items-center justify-content-center w-full h-full"></i>
|
|
9
|
+
</div>
|
|
10
|
+
</div>
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
<div class="widget-menu-container" >
|
|
14
|
+
<div class="widget-menu-wrapper h-ful l custom-scroll">
|
|
15
|
+
<p-menu [model]="categories" styleClass="w-full md:w-15rem">
|
|
16
|
+
<ng-template pTemplate="submenuheader" let-item>
|
|
17
|
+
<span [style]="{
|
|
18
|
+
color : '#9EA0B3'
|
|
19
|
+
}">{{ item.label }} Documents</span>
|
|
20
|
+
</ng-template>
|
|
21
|
+
<ng-template pTemplate="item" let-item>
|
|
22
|
+
<a pRipple
|
|
23
|
+
class="flex align-items-center p-menuitem-link"
|
|
24
|
+
[class.selected-menu-item]="selectedMenuItemId === item._id"
|
|
25
|
+
[class.disabled-menu-item]="item.isSelectable === false"
|
|
26
|
+
[class.pointer-events-none]="item.isSelectable === false"
|
|
27
|
+
[style.opacity]="item.isSelectable === false ? '0.5' : '1'"
|
|
28
|
+
[style.cursor]="item.isSelectable === false ? 'not-allowed' : 'pointer'"
|
|
29
|
+
(click)="onMenuItemClick($event, item)">
|
|
30
|
+
<span [class]="item.icon" class="text-xl"></span>
|
|
31
|
+
<span class="ml-2">{{ item.label }}</span>
|
|
32
|
+
<p-badge *ngIf="item.menuData?.shouldShowBadge"
|
|
33
|
+
class="ml-auto"
|
|
34
|
+
[severity]="item.menuData?.badgeSeverity"
|
|
35
|
+
[value]="item.menuData?.badgeValue" />
|
|
36
|
+
</a>
|
|
37
|
+
</ng-template>
|
|
38
|
+
</p-menu>
|
|
39
|
+
</div>
|
|
40
|
+
</div>
|
|
41
|
+
</p-card>
|
|
42
|
+
</div>
|
|
43
|
+
|
|
44
|
+
|