@sasindi/printlabtestresults 1.0.1

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 (63) hide show
  1. package/LICENSE +354 -0
  2. package/README.md +167 -0
  3. package/dist/117.js +1 -0
  4. package/dist/117.js.map +1 -0
  5. package/dist/127.js +43 -0
  6. package/dist/127.js.map +1 -0
  7. package/dist/145.js +22 -0
  8. package/dist/145.js.map +1 -0
  9. package/dist/197.js +1 -0
  10. package/dist/197.js.map +1 -0
  11. package/dist/237.js +1 -0
  12. package/dist/237.js.map +1 -0
  13. package/dist/340.js +1 -0
  14. package/dist/340.js.map +1 -0
  15. package/dist/362.js +1 -0
  16. package/dist/362.js.map +1 -0
  17. package/dist/480.js +1 -0
  18. package/dist/480.js.map +1 -0
  19. package/dist/517.js +1 -0
  20. package/dist/517.js.map +1 -0
  21. package/dist/529.js +1 -0
  22. package/dist/529.js.map +1 -0
  23. package/dist/538.js +1 -0
  24. package/dist/538.js.map +1 -0
  25. package/dist/578.js +1 -0
  26. package/dist/578.js.map +1 -0
  27. package/dist/652.js +1 -0
  28. package/dist/652.js.map +1 -0
  29. package/dist/668.js +1 -0
  30. package/dist/668.js.map +1 -0
  31. package/dist/7.js +1 -0
  32. package/dist/7.js.map +1 -0
  33. package/dist/749.js +1 -0
  34. package/dist/749.js.map +1 -0
  35. package/dist/898.js +1 -0
  36. package/dist/898.js.map +1 -0
  37. package/dist/964.js +1 -0
  38. package/dist/964.js.map +1 -0
  39. package/dist/976.js +1 -0
  40. package/dist/976.js.map +1 -0
  41. package/dist/977.js +1 -0
  42. package/dist/977.js.map +1 -0
  43. package/dist/98.js +1 -0
  44. package/dist/98.js.map +1 -0
  45. package/dist/997.js +1 -0
  46. package/dist/997.js.map +1 -0
  47. package/dist/main.js +6 -0
  48. package/dist/main.js.map +1 -0
  49. package/dist/openmrs-esm-printlabtestresults.js +6 -0
  50. package/dist/openmrs-esm-printlabtestresults.js.buildmanifest.json +771 -0
  51. package/dist/openmrs-esm-printlabtestresults.js.map +1 -0
  52. package/dist/routes.json +1 -0
  53. package/package.json +102 -0
  54. package/src/config-schema.ts +21 -0
  55. package/src/constants.ts +1 -0
  56. package/src/declarations.d.ts +23 -0
  57. package/src/index.ts +25 -0
  58. package/src/print-lab-test-results.component.tsx +608 -0
  59. package/src/print-lab-test-results.scss +299 -0
  60. package/src/root.component.test.tsx +12 -0
  61. package/src/root.component.tsx +13 -0
  62. package/src/root.scss +5 -0
  63. package/src/routes.json +12 -0
@@ -0,0 +1,299 @@
1
+ @use '@carbon/layout';
2
+ @use '@carbon/type';
3
+
4
+ .container {
5
+ padding: layout.$spacing-05;
6
+ width: 100%;
7
+ margin: 0 auto;
8
+ }
9
+
10
+ .card {
11
+ background-color: #ffffff;
12
+ border-radius: 4px;
13
+ box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
14
+ border: 1px solid #e0e0e0;
15
+ }
16
+
17
+ .cardBody {
18
+ padding: layout.$spacing-06;
19
+ }
20
+
21
+ .heading {
22
+ font-size: 20px;
23
+ font-weight: 600;
24
+ color: #009384;
25
+ margin: 0;
26
+ }
27
+
28
+ .filterRow {
29
+ display: flex;
30
+ justify-content: space-between;
31
+ align-items: center;
32
+ margin-bottom: layout.$spacing-05;
33
+ flex-wrap: wrap;
34
+ gap: 12px;
35
+ }
36
+
37
+ .filterGroup {
38
+ display: flex;
39
+ align-items: center;
40
+ gap: 10px;
41
+ }
42
+
43
+ .labelCompact {
44
+ font-weight: 600;
45
+ font-size: 14px;
46
+ color: #393939;
47
+ }
48
+
49
+ .selectCompact {
50
+ height: 36px;
51
+ padding: 0 12px;
52
+ border: 1px solid #8d8d8d;
53
+ border-radius: 4px;
54
+ background-color: #f4f4f4;
55
+ font-size: 14px;
56
+ outline: none;
57
+ cursor: pointer;
58
+
59
+ &:focus {
60
+ border-color: #0f62fe;
61
+ outline: 2px solid #0f62fe;
62
+ }
63
+ }
64
+
65
+ .searchInput {
66
+ height: 36px;
67
+ width: 280px;
68
+ padding: 0 12px;
69
+ border: 1px solid #8d8d8d;
70
+ border-radius: 4px;
71
+ background-color: #ffffff;
72
+ font-size: 14px;
73
+ outline: none;
74
+
75
+ &:focus {
76
+ border-color: #0f62fe;
77
+ outline: 2px solid #0f62fe;
78
+ }
79
+ }
80
+
81
+ .tableWrapper {
82
+ overflow-x: auto;
83
+ margin-top: layout.$spacing-04;
84
+ border: 1px solid #e0e0e0;
85
+ border-radius: 4px;
86
+ }
87
+
88
+ .dataTable {
89
+ width: 100%;
90
+ border-collapse: collapse;
91
+
92
+ th {
93
+ background-color: #f4f4f4;
94
+ color: #161616;
95
+ font-weight: 600;
96
+ font-size: 13px;
97
+ padding: 12px 14px;
98
+ text-align: left;
99
+ border-bottom: 2px solid #e0e0e0;
100
+ white-space: nowrap;
101
+ }
102
+
103
+ td {
104
+ padding: 10px 14px;
105
+ font-size: 13px;
106
+ color: #393939;
107
+ border-bottom: 1px solid #e0e0e0;
108
+ white-space: nowrap;
109
+ }
110
+
111
+ tbody tr:hover {
112
+ background-color: #eef5f5;
113
+ }
114
+ }
115
+
116
+ .tagOpd {
117
+ display: inline-block;
118
+ padding: 2px 8px;
119
+ border-radius: 12px;
120
+ font-size: 12px;
121
+ font-weight: 600;
122
+ background-color: #edf5ff;
123
+ color: #0043ce;
124
+ }
125
+
126
+ .tagClinic {
127
+ display: inline-block;
128
+ padding: 2px 8px;
129
+ border-radius: 12px;
130
+ font-size: 12px;
131
+ font-weight: 600;
132
+ background-color: #e8daff;
133
+ color: #6929c4;
134
+ }
135
+
136
+ .tagWard {
137
+ display: inline-block;
138
+ padding: 2px 8px;
139
+ border-radius: 12px;
140
+ font-size: 12px;
141
+ font-weight: 600;
142
+ background-color: #defbe6;
143
+ color: #0e6027;
144
+ }
145
+
146
+ .actionBtnGroup {
147
+ display: flex;
148
+ gap: 6px;
149
+ }
150
+
151
+ .btnPrimary {
152
+ background-color: #0f62fe;
153
+ color: #ffffff;
154
+ border: none;
155
+ border-radius: 4px;
156
+ padding: 6px 14px;
157
+ font-size: 13px;
158
+ font-weight: 500;
159
+ cursor: pointer;
160
+ transition: background-color 0.2s;
161
+
162
+ &:hover {
163
+ background-color: #0353e9;
164
+ }
165
+ }
166
+
167
+ .btnSuccess {
168
+ background-color: #24a148;
169
+ color: #ffffff;
170
+ border: none;
171
+ border-radius: 4px;
172
+ padding: 6px 14px;
173
+ font-size: 13px;
174
+ font-weight: 500;
175
+ cursor: pointer;
176
+ transition: background-color 0.2s;
177
+
178
+ &:hover {
179
+ background-color: #198038;
180
+ }
181
+ }
182
+
183
+ .btnSecondary {
184
+ background-color: #393939;
185
+ color: #ffffff;
186
+ border: none;
187
+ border-radius: 4px;
188
+ padding: 6px 14px;
189
+ font-size: 13px;
190
+ font-weight: 500;
191
+ cursor: pointer;
192
+
193
+ &:hover {
194
+ background-color: #4c4c4c;
195
+ }
196
+ }
197
+
198
+ /* Modal Styling */
199
+ .modalOverlay {
200
+ position: fixed;
201
+ top: 0;
202
+ left: 0;
203
+ right: 0;
204
+ bottom: 0;
205
+ background-color: rgba(0, 0, 0, 0.5);
206
+ display: flex;
207
+ align-items: center;
208
+ justify-content: center;
209
+ z-index: 9999;
210
+ }
211
+
212
+ .modalContainer {
213
+ background-color: #ffffff;
214
+ border-radius: 6px;
215
+ width: 90%;
216
+ max-width: 850px;
217
+ max-height: 90vh;
218
+ overflow-y: auto;
219
+ box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
220
+ }
221
+
222
+ .modalHeader {
223
+ display: flex;
224
+ justify-content: space-between;
225
+ align-items: center;
226
+ padding: 16px 24px;
227
+ border-bottom: 1px solid #e0e0e0;
228
+
229
+ h3 {
230
+ margin: 0;
231
+ font-size: 18px;
232
+ font-weight: 600;
233
+ color: #009384;
234
+ }
235
+ }
236
+
237
+ .btnClose {
238
+ background: none;
239
+ border: none;
240
+ font-size: 24px;
241
+ cursor: pointer;
242
+ color: #525252;
243
+
244
+ &:hover {
245
+ color: #161616;
246
+ }
247
+ }
248
+
249
+ .modalBody {
250
+ padding: 20px 24px;
251
+ }
252
+
253
+ .gridForm {
254
+ display: grid;
255
+ grid-template-columns: repeat(3, 1fr);
256
+ gap: 12px 16px;
257
+ margin-bottom: 16px;
258
+ }
259
+
260
+ .formField {
261
+ display: flex;
262
+ flex-direction: column;
263
+ gap: 4px;
264
+
265
+ label {
266
+ font-size: 13px;
267
+ font-weight: 600;
268
+ color: #525252;
269
+ }
270
+
271
+ input, textarea {
272
+ padding: 6px 10px;
273
+ border: 1px solid #8d8d8d;
274
+ border-radius: 4px;
275
+ font-size: 13px;
276
+ background-color: #f4f4f4;
277
+ }
278
+ }
279
+
280
+ .formFieldFull {
281
+ grid-column: span 3;
282
+ }
283
+
284
+ .modalFooter {
285
+ display: flex;
286
+ justify-content: flex-end;
287
+ gap: 12px;
288
+ padding: 16px 24px;
289
+ border-top: 1px solid #e0e0e0;
290
+ }
291
+
292
+ /* Pagination */
293
+ .pagination {
294
+ display: flex;
295
+ justify-content: space-between;
296
+ align-items: center;
297
+ margin-top: 16px;
298
+ font-size: 13px;
299
+ }
@@ -0,0 +1,12 @@
1
+ import React from 'react';
2
+ import { describe, it, expect } from 'vitest';
3
+ import { render, screen } from '@testing-library/react';
4
+ import Root from './root.component';
5
+
6
+ describe('Root', () => {
7
+ it('mounts the route shell without crashing', () => {
8
+ // No route matches the default jsdom URL, so the shell mounts but renders
9
+ // no route content; this asserts the wiring (BrowserRouter + Routes) works.
10
+ expect(() => render(<Root />)).not.toThrow();
11
+ });
12
+ });
@@ -0,0 +1,13 @@
1
+ import React from 'react';
2
+ import { BrowserRouter, Routes, Route } from 'react-router-dom';
3
+ import PrintLabTestResults from './print-lab-test-results.component';
4
+
5
+ const Root: React.FC = () => (
6
+ <BrowserRouter basename={window.getOpenmrsSpaBase()}>
7
+ <Routes>
8
+ <Route path="printlabtestresults" element={<PrintLabTestResults />} />
9
+ </Routes>
10
+ </BrowserRouter>
11
+ );
12
+
13
+ export default Root;
package/src/root.scss ADDED
@@ -0,0 +1,5 @@
1
+ @use '@carbon/layout';
2
+
3
+ .container {
4
+ padding: layout.$spacing-05;
5
+ }
@@ -0,0 +1,12 @@
1
+ {
2
+ "$schema": "https://json.openmrs.org/routes.schema.json",
3
+ "pages": [
4
+ {
5
+ "route": "printlabtestresults",
6
+ "component": "root",
7
+ "online": true
8
+ }
9
+ ],
10
+ "extensions": [
11
+ ]
12
+ }