hplx-feature-library 1.0.116 → 1.0.118
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/dist/AllInvestigations/components/AllInvestigationsTable.d.ts +3 -2
- package/dist/AllInvestigations/index.js +1 -1
- package/dist/{AllInvestigationsTable-DHVToel4.cjs → AllInvestigationsTable-Dyv14SPT.cjs} +1 -1
- package/dist/{AllInvestigationsTable-9PwU9Rw4.js → AllInvestigationsTable-eoa_vhlb.js} +207 -200
- package/dist/index.js +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { j as e, Y as L, P as B, M as
|
|
2
|
-
import { createContext as A, useContext as G, useMemo as O, useState as N, useRef as
|
|
1
|
+
import { j as e, Y as L, P as B, M as S } from "./index-CuCeJNEo.js";
|
|
2
|
+
import { createContext as A, useContext as G, useMemo as O, useState as N, useRef as F, useEffect as j, useCallback as R } from "react";
|
|
3
3
|
const $ = A(void 0), M = () => {
|
|
4
4
|
const C = G($);
|
|
5
5
|
if (!C)
|
|
@@ -12,15 +12,15 @@ const $ = A(void 0), M = () => {
|
|
|
12
12
|
Left: "left",
|
|
13
13
|
Right: "right"
|
|
14
14
|
}, z = () => {
|
|
15
|
-
const { paginationProps: C, onPaginationClick: l, displayPaginationClassesToOverride:
|
|
16
|
-
let
|
|
17
|
-
|
|
15
|
+
const { paginationProps: C, onPaginationClick: l, displayPaginationClassesToOverride: r } = M(), p = O(() => Math.ceil(C.totalRecords / C.pageSize), [C.pageSize, C.totalRecords]), h = (d) => {
|
|
16
|
+
let n = C.activePage;
|
|
17
|
+
d === k.PREV_PAGE && C.activePage > 1 ? n = n - 1 : d === k.NEXT_PAGE && C.activePage < p && (n = n + 1), l?.(n);
|
|
18
18
|
};
|
|
19
19
|
return /* @__PURE__ */ e.jsxs("div", { className: "hfl-flex hfl-justify-between hfl-items-center hfl-gap-2", children: [
|
|
20
20
|
/* @__PURE__ */ e.jsxs(
|
|
21
21
|
"h1",
|
|
22
22
|
{
|
|
23
|
-
className: `${
|
|
23
|
+
className: `${r ?? ""} hfl-text-Gray-500 hfl-font-inter hfl-leading-12 hfl-text-2 hfl-font-inter-0`,
|
|
24
24
|
children: [
|
|
25
25
|
`${C.pageSize * (C.activePage - 1) + 1}`,
|
|
26
26
|
"-",
|
|
@@ -37,9 +37,9 @@ const $ = A(void 0), M = () => {
|
|
|
37
37
|
hierarchy: "Secondary-Grey",
|
|
38
38
|
size: "sm",
|
|
39
39
|
icon: "Only",
|
|
40
|
-
iconFile: `${
|
|
40
|
+
iconFile: `${r ?? ""} hx_left hfl-text-4 hfl-text-Gray-700`,
|
|
41
41
|
onClick: () => {
|
|
42
|
-
|
|
42
|
+
h(k.PREV_PAGE);
|
|
43
43
|
},
|
|
44
44
|
textField: "",
|
|
45
45
|
disabled: C.activePage === 1 || C.activePage === 0
|
|
@@ -52,9 +52,9 @@ const $ = A(void 0), M = () => {
|
|
|
52
52
|
hierarchy: "Secondary-Grey",
|
|
53
53
|
size: "sm",
|
|
54
54
|
icon: "Only",
|
|
55
|
-
iconFile: `${
|
|
55
|
+
iconFile: `${r ?? ""} hx_right hfl-text-4 hfl-text-Gray-700`,
|
|
56
56
|
onClick: () => {
|
|
57
|
-
|
|
57
|
+
h(k.NEXT_PAGE);
|
|
58
58
|
},
|
|
59
59
|
textField: "",
|
|
60
60
|
disabled: !C.currentPageRowCount || C.activePage === p
|
|
@@ -63,22 +63,22 @@ const $ = A(void 0), M = () => {
|
|
|
63
63
|
] });
|
|
64
64
|
};
|
|
65
65
|
function D(C) {
|
|
66
|
-
const { label: l, onCheck:
|
|
66
|
+
const { label: l, onCheck: r, isSelected: p, isDisabled: h } = C;
|
|
67
67
|
return /* @__PURE__ */ e.jsxs("li", { className: "hfl-flex hfl-items-center hfl-w-full hfl-py-2", children: [
|
|
68
68
|
/* @__PURE__ */ e.jsx(
|
|
69
69
|
"input",
|
|
70
70
|
{
|
|
71
71
|
type: "checkbox",
|
|
72
|
-
checked: !
|
|
73
|
-
disabled:
|
|
74
|
-
onChange: () => !
|
|
72
|
+
checked: !h && p,
|
|
73
|
+
disabled: h,
|
|
74
|
+
onChange: () => !h && r(l),
|
|
75
75
|
className: "hfl-appearance-none hfl-mr-1 hfl-min-w-[16px] hfl-min-h-[16px] hfl-border-1 hfl-border-Gray-300 hfl-bg-white hfl-rounded-md hfl-checked:bg-blue-800 hfl-checked:border-transparent checked:hfl-bg-Blue-600 disabled:hfl-text-Gray-200 disabled:hfl-bg-Gray-200"
|
|
76
76
|
}
|
|
77
77
|
),
|
|
78
78
|
/* @__PURE__ */ e.jsx(
|
|
79
79
|
"h3",
|
|
80
80
|
{
|
|
81
|
-
className: `hfl-overflow-hidden hfl-text-ellipsis hfl-whitespace-nowrap hfl-font-inter-0 hfl-text-[13px] ${
|
|
81
|
+
className: `hfl-overflow-hidden hfl-text-ellipsis hfl-whitespace-nowrap hfl-font-inter-0 hfl-text-[13px] ${h ? "hfl-text-Gray-400" : ""}`,
|
|
82
82
|
children: l
|
|
83
83
|
}
|
|
84
84
|
)
|
|
@@ -87,83 +87,83 @@ function D(C) {
|
|
|
87
87
|
const V = (C) => {
|
|
88
88
|
const {
|
|
89
89
|
options: l,
|
|
90
|
-
filterclassname:
|
|
90
|
+
filterclassname: r,
|
|
91
91
|
filterButtonStyles: p = "",
|
|
92
|
-
clearFilterButtonStyles:
|
|
93
|
-
showApplyFilter:
|
|
94
|
-
onApplyFilter:
|
|
92
|
+
clearFilterButtonStyles: h = "",
|
|
93
|
+
showApplyFilter: d = !1,
|
|
94
|
+
onApplyFilter: n,
|
|
95
95
|
onClearFilter: g
|
|
96
|
-
} = C, [x, t] = N([]), [
|
|
97
|
-
|
|
98
|
-
},
|
|
99
|
-
g && g(),
|
|
100
|
-
}, v = (
|
|
96
|
+
} = C, [x, t] = N([]), [b, a] = N(0), i = F(null), f = F(null), o = F(null), m = F(null), [c, w] = N(!1), y = () => {
|
|
97
|
+
n && n(x), w(!1);
|
|
98
|
+
}, s = () => {
|
|
99
|
+
g && g(), w(!1);
|
|
100
|
+
}, v = (u) => {
|
|
101
101
|
t(
|
|
102
|
-
(
|
|
103
|
-
(_, T) => T ===
|
|
102
|
+
(P) => P.map(
|
|
103
|
+
(_, T) => T === u ? { ..._, isSelected: !_.isSelected } : { ..._ }
|
|
104
104
|
)
|
|
105
105
|
);
|
|
106
106
|
};
|
|
107
107
|
return j(() => {
|
|
108
|
-
t(l),
|
|
108
|
+
t(l), a(l.filter((u) => u.isSelected && !u.isDisabled).length);
|
|
109
109
|
}, [l]), j(() => {
|
|
110
|
-
const
|
|
111
|
-
|
|
110
|
+
const u = (P) => {
|
|
111
|
+
P.target instanceof HTMLElement && f.current && !f.current.contains(P.target) && i.current && !i.current.contains(P.target) && (!o.current || o && o.current && !o.current.contains(P.target)) && (!m.current || m && m.current && !m.current.contains(P.target)) && (w(!1), t(l));
|
|
112
112
|
};
|
|
113
|
-
return
|
|
114
|
-
document.removeEventListener("mousedown",
|
|
113
|
+
return c ? document.addEventListener("mousedown", u) : document.removeEventListener("mousedown", u), () => {
|
|
114
|
+
document.removeEventListener("mousedown", u);
|
|
115
115
|
};
|
|
116
|
-
}, [
|
|
116
|
+
}, [c, f, w]), /* @__PURE__ */ e.jsxs("div", { className: "hfl-relative", style: { minWidth: "10rem" }, children: [
|
|
117
117
|
/* @__PURE__ */ e.jsxs(
|
|
118
118
|
"div",
|
|
119
119
|
{
|
|
120
|
-
ref:
|
|
120
|
+
ref: i,
|
|
121
121
|
className: "hfl-flex hfl-items-center hfl-gap-4 hfl-cursor-pointer hfl-justify-between hfl-border hfl-px-2 hfl-py-1.5 hfl-rounded-md hfl-border-Gray-200",
|
|
122
|
-
onClick: () =>
|
|
122
|
+
onClick: () => w(!c),
|
|
123
123
|
children: [
|
|
124
|
-
/* @__PURE__ */ e.jsx("span", { className: "hfl-text-1 hfl-text-Gray-400", children:
|
|
125
|
-
/* @__PURE__ */ e.jsx("i", { className: `${
|
|
124
|
+
/* @__PURE__ */ e.jsx("span", { className: "hfl-text-1 hfl-text-Gray-400", children: b > 0 ? `${b} Selected` : "Select Table Filter" }),
|
|
125
|
+
/* @__PURE__ */ e.jsx("i", { className: `${c ? "hx_up" : "hx_down"} hfl-text-1 hfl-text-Gray-500` })
|
|
126
126
|
]
|
|
127
127
|
}
|
|
128
128
|
),
|
|
129
|
-
|
|
129
|
+
c && /* @__PURE__ */ e.jsxs(
|
|
130
130
|
"div",
|
|
131
131
|
{
|
|
132
|
-
className: `hfl-absolute hfl-z-50 hfl-rounded-lg hfl-bg-White hfl-shadow-4xl hfl-border-1 ${
|
|
132
|
+
className: `hfl-absolute hfl-z-50 hfl-rounded-lg hfl-bg-White hfl-shadow-4xl hfl-border-1 ${r}`,
|
|
133
133
|
children: [
|
|
134
134
|
/* @__PURE__ */ e.jsx(
|
|
135
135
|
"ul",
|
|
136
136
|
{
|
|
137
|
-
ref:
|
|
137
|
+
ref: f,
|
|
138
138
|
className: "hfl-pb-1 hfl-px-3 hfl-py-2 hfl-max-h-[200px] hfl-rounded-lg hfl-overflow-y-scroll hfl-overflow-x-hidden ",
|
|
139
|
-
children: x.map((
|
|
139
|
+
children: x.map((u, P) => /* @__PURE__ */ e.jsx(
|
|
140
140
|
D,
|
|
141
141
|
{
|
|
142
|
-
isSelected:
|
|
143
|
-
isDisabled:
|
|
144
|
-
label:
|
|
145
|
-
onCheck: () => v(
|
|
142
|
+
isSelected: u.isSelected,
|
|
143
|
+
isDisabled: u.isDisabled ?? !1,
|
|
144
|
+
label: u.name,
|
|
145
|
+
onCheck: () => v(P)
|
|
146
146
|
},
|
|
147
|
-
`dropdown-option-${
|
|
147
|
+
`dropdown-option-${u.name}`
|
|
148
148
|
))
|
|
149
149
|
}
|
|
150
150
|
),
|
|
151
|
-
|
|
151
|
+
d && /* @__PURE__ */ e.jsxs("div", { className: "hfl-flex hfl-bg-White hfl-px-2 hfl-border-t hfl-gap-3 hfl-border-Gray-200", children: [
|
|
152
152
|
/* @__PURE__ */ e.jsx(
|
|
153
153
|
"button",
|
|
154
154
|
{
|
|
155
|
-
onClick:
|
|
155
|
+
onClick: y,
|
|
156
156
|
className: `hfl-my-2 hfl-whitespace-nowrap hfl-text-White hfl-text-[13px] hfl-bg-Blue-600 hfl-cursor-pointer hover:hfl-bg-Blue-50 hover:hfl-border hover:hfl-border-Blue-300 hover:hfl-text-Blue-600 hfl-py-2 hfl-px-4 hfl-rounded-lg hfl-border-1 hfl-font-inter-0 ${p}`,
|
|
157
|
-
ref:
|
|
157
|
+
ref: o,
|
|
158
158
|
children: "Apply Filter"
|
|
159
159
|
}
|
|
160
160
|
),
|
|
161
161
|
/* @__PURE__ */ e.jsx(
|
|
162
162
|
"button",
|
|
163
163
|
{
|
|
164
|
-
onClick:
|
|
165
|
-
className: `hfl-my-2 hfl-whitespace-nowrap hfl-text-LightBlack-1 hfl-text-[13px] hfl-bg-White hfl-cursor-pointer hfl-py-2 hfl-px-4 hfl-rounded-lg hfl-border-1 hfl-border-gray-200 hfl-font-inter-0 ${
|
|
166
|
-
ref:
|
|
164
|
+
onClick: s,
|
|
165
|
+
className: `hfl-my-2 hfl-whitespace-nowrap hfl-text-LightBlack-1 hfl-text-[13px] hfl-bg-White hfl-cursor-pointer hfl-py-2 hfl-px-4 hfl-rounded-lg hfl-border-1 hfl-border-gray-200 hfl-font-inter-0 ${h}`,
|
|
166
|
+
ref: m,
|
|
167
167
|
children: "Clear Filter"
|
|
168
168
|
}
|
|
169
169
|
)
|
|
@@ -176,11 +176,11 @@ const V = (C) => {
|
|
|
176
176
|
function Q(C) {
|
|
177
177
|
const {
|
|
178
178
|
title: l,
|
|
179
|
-
description:
|
|
179
|
+
description: r,
|
|
180
180
|
onPageRefresh: p,
|
|
181
|
-
buttonClassName:
|
|
182
|
-
titleClassName:
|
|
183
|
-
descriptionClassName:
|
|
181
|
+
buttonClassName: h,
|
|
182
|
+
titleClassName: d,
|
|
183
|
+
descriptionClassName: n,
|
|
184
184
|
containerClassName: g,
|
|
185
185
|
imageClassName: x
|
|
186
186
|
} = C;
|
|
@@ -191,14 +191,14 @@ function Q(C) {
|
|
|
191
191
|
children: [
|
|
192
192
|
/* @__PURE__ */ e.jsx("img", { src: W, className: x || "", alt: "No records found image" }),
|
|
193
193
|
/* @__PURE__ */ e.jsxs("div", { className: "xs:hfl-ml-8 sm:hfl-ml-12 ", children: [
|
|
194
|
-
/* @__PURE__ */ e.jsx(B, { variant: "Bold", type: "Display xs", className: `hfl-mb-1 ${
|
|
195
|
-
/* @__PURE__ */ e.jsx(B, { variant: "Medium", type: "Text md", className: `hfl-mb-1 ${
|
|
194
|
+
/* @__PURE__ */ e.jsx(B, { variant: "Bold", type: "Display xs", className: `hfl-mb-1 ${d}`, children: l }),
|
|
195
|
+
/* @__PURE__ */ e.jsx(B, { variant: "Medium", type: "Text md", className: `hfl-mb-1 ${n}`, children: r }),
|
|
196
196
|
/* @__PURE__ */ e.jsx(
|
|
197
197
|
L,
|
|
198
198
|
{
|
|
199
199
|
hierarchy: "Primary",
|
|
200
200
|
size: "sm",
|
|
201
|
-
className:
|
|
201
|
+
className: h,
|
|
202
202
|
onClick: p,
|
|
203
203
|
icon: "Left",
|
|
204
204
|
iconFile: "hx_rewind",
|
|
@@ -210,7 +210,7 @@ function Q(C) {
|
|
|
210
210
|
}
|
|
211
211
|
);
|
|
212
212
|
}
|
|
213
|
-
const H = ({ children: C, column: l, isHeaderCell:
|
|
213
|
+
const H = ({ children: C, column: l, isHeaderCell: r }) => /* @__PURE__ */ e.jsx(
|
|
214
214
|
"div",
|
|
215
215
|
{
|
|
216
216
|
style: {
|
|
@@ -219,79 +219,79 @@ const H = ({ children: C, column: l, isHeaderCell: i }) => /* @__PURE__ */ e.jsx
|
|
|
219
219
|
maxWidth: l?.width ? "" : "100px",
|
|
220
220
|
wordBreak: "break-word"
|
|
221
221
|
},
|
|
222
|
-
className: `hfl-flex hfl-items-center hfl-px-4 hfl-text-left hfl-min-w-100 ${l?.pinned === "left" ? "hfl-z-10" : ""} ${
|
|
222
|
+
className: `hfl-flex hfl-items-center hfl-px-4 hfl-text-left hfl-min-w-100 ${l?.pinned === "left" ? "hfl-z-10" : ""} ${r ? `${l?.headerCellClasses ?? ""} hfl-py-2 hfl-justify-between hfl-relative` : `${l?.cellClasses ?? ""} hfl-min-h-[40px] hfl-py-1`}`,
|
|
223
223
|
children: C
|
|
224
224
|
}
|
|
225
|
-
), E = ({ children: C, isHeaderRow: l, classes:
|
|
225
|
+
), E = ({ children: C, isHeaderRow: l, classes: r }) => /* @__PURE__ */ e.jsx(
|
|
226
226
|
"div",
|
|
227
227
|
{
|
|
228
|
-
className: `hfl-flex hfl-justify-start hfl-items-stretch ${
|
|
228
|
+
className: `hfl-flex hfl-justify-start hfl-items-stretch ${r ?? ""} ${l ? "hfl-bg-White" : "hfl-bg-White odd:hfl-bg-Gray-50"}`,
|
|
229
229
|
children: C
|
|
230
230
|
}
|
|
231
231
|
), U = () => {
|
|
232
232
|
const {
|
|
233
233
|
rowsData: C,
|
|
234
234
|
leftPinnedColumns: l,
|
|
235
|
-
rightPinnedColumns:
|
|
235
|
+
rightPinnedColumns: r,
|
|
236
236
|
nonPinnedColumns: p,
|
|
237
|
-
tableBodyClassesToOverride:
|
|
238
|
-
rowClassesForSpecificIndex:
|
|
239
|
-
tableBodyParentDivRef:
|
|
240
|
-
} = M(), g = (
|
|
241
|
-
const
|
|
242
|
-
return
|
|
243
|
-
}, x = (
|
|
237
|
+
tableBodyClassesToOverride: h,
|
|
238
|
+
rowClassesForSpecificIndex: d,
|
|
239
|
+
tableBodyParentDivRef: n
|
|
240
|
+
} = M(), g = (a, i, f) => {
|
|
241
|
+
const o = i[a?.field];
|
|
242
|
+
return a?.valueFormatter ? a?.valueFormatter(o, i, a, f) : o;
|
|
243
|
+
}, x = (a, i, f, o) => /* @__PURE__ */ e.jsx(H, { column: a, colIndex: o, rowIndex: f, children: a?.renderCell ? a?.renderCell(g(a, i, f), i, a, f) : g(a, i, f) }, `${f}-${o}`), t = (a, i, f, o) => /* @__PURE__ */ e.jsx("div", { style: { height: "inherit" }, className: o, children: a.map((m, c) => x(m, i, f, c)) }), b = (a, i) => /* @__PURE__ */ e.jsxs(
|
|
244
244
|
E,
|
|
245
245
|
{
|
|
246
|
-
classes: `hfl-text-LightBlack-1 hfl-text-1 hfl-leading-12 hfl-font-inter-0 ${
|
|
246
|
+
classes: `hfl-text-LightBlack-1 hfl-text-1 hfl-leading-12 hfl-font-inter-0 ${d.index === i ? d.rowClasses : ""}`,
|
|
247
247
|
isHeaderRow: !1,
|
|
248
248
|
children: [
|
|
249
249
|
t(
|
|
250
250
|
l,
|
|
251
|
-
s,
|
|
252
251
|
a,
|
|
252
|
+
i,
|
|
253
253
|
"hfl-flex hfl-sticky hfl-left-0 hfl-z-10 hfl-bg-inherit hfl-shadow-lg hfl-shadow-Gray-300"
|
|
254
254
|
),
|
|
255
|
-
t(p,
|
|
255
|
+
t(p, a, i, "hfl-flex hfl-h-inherit hfl-w-full"),
|
|
256
256
|
t(
|
|
257
|
-
|
|
258
|
-
s,
|
|
257
|
+
r,
|
|
259
258
|
a,
|
|
259
|
+
i,
|
|
260
260
|
"hfl-flex hfl-h-inherit hfl-sticky hfl-right-0 hfl-z-10 hfl-bg-inherit hfl-shadow-lg hfl-shadow-Gray-300"
|
|
261
261
|
)
|
|
262
262
|
]
|
|
263
263
|
},
|
|
264
|
-
"tr" +
|
|
264
|
+
"tr" + i
|
|
265
265
|
);
|
|
266
|
-
return /* @__PURE__ */ e.jsx("div", { ref:
|
|
266
|
+
return /* @__PURE__ */ e.jsx("div", { ref: n, className: `${h ?? ""} hfl-max-h-500`, children: C.map((a, i) => b(a, i)) });
|
|
267
267
|
}, I = "data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M9%2010.6667C9.27614%2010.6667%209.5%2010.8905%209.5%2011.1667C9.5%2011.4428%209.27614%2011.6667%209%2011.6667H7C6.72386%2011.6667%206.5%2011.4428%206.5%2011.1667C6.5%2010.8905%206.72386%2010.6667%207%2010.6667H9ZM11%207.33333C11.2761%207.33333%2011.5%207.55719%2011.5%207.83333C11.5%208.10948%2011.2761%208.33333%2011%208.33333H5C4.72386%208.33333%204.5%208.10948%204.5%207.83333C4.5%207.55719%204.72386%207.33333%205%207.33333H11ZM13%204C13.2761%204%2013.5%204.22386%2013.5%204.5C13.5%204.77614%2013.2761%205%2013%205H3C2.72386%205%202.5%204.77614%202.5%204.5C2.5%204.22386%202.72386%204%203%204H13Z'%20fill='%23667085'/%3e%3c/svg%3e", X = (C) => {
|
|
268
268
|
const {
|
|
269
269
|
options: l,
|
|
270
|
-
onCheck:
|
|
270
|
+
onCheck: r,
|
|
271
271
|
filterclassname: p,
|
|
272
|
-
filterButtonStyles:
|
|
273
|
-
showApplyFilter:
|
|
274
|
-
onApplyFilter:
|
|
272
|
+
filterButtonStyles: h = "",
|
|
273
|
+
showApplyFilter: d = !1,
|
|
274
|
+
onApplyFilter: n,
|
|
275
275
|
field: g,
|
|
276
276
|
resetDropDownData: x,
|
|
277
277
|
showSearch: t,
|
|
278
|
-
searchQuery:
|
|
279
|
-
setSearchQuery:
|
|
280
|
-
dropdownCloseEventOnClickOutside:
|
|
281
|
-
} = C,
|
|
282
|
-
|
|
278
|
+
searchQuery: b,
|
|
279
|
+
setSearchQuery: a,
|
|
280
|
+
dropdownCloseEventOnClickOutside: i
|
|
281
|
+
} = C, f = F(null), o = F(null), m = F(null), { showDropdown: c, setShowDropdown: w } = M(), y = () => {
|
|
282
|
+
n && n(g), w(null);
|
|
283
283
|
};
|
|
284
284
|
return j(() => {
|
|
285
|
-
const
|
|
285
|
+
const s = (v) => {
|
|
286
286
|
if (v.target instanceof HTMLElement) {
|
|
287
|
-
const
|
|
288
|
-
|
|
287
|
+
const u = document.getElementById(`filter-button-${c}`);
|
|
288
|
+
f.current && !f.current.contains(v.target) && u && !u.contains(v.target) && m && !m.current?.contains(v.target) && (!o.current || o && o.current && !o.current.contains(v.target)) && (d && x && x(g), w(null), i?.());
|
|
289
289
|
}
|
|
290
290
|
};
|
|
291
|
-
return
|
|
292
|
-
document.removeEventListener("mousedown",
|
|
291
|
+
return c ? document.addEventListener("mousedown", s) : document.removeEventListener("mousedown", s), () => {
|
|
292
|
+
document.removeEventListener("mousedown", s);
|
|
293
293
|
};
|
|
294
|
-
}, [
|
|
294
|
+
}, [c, f, w]), /* @__PURE__ */ e.jsxs(
|
|
295
295
|
"div",
|
|
296
296
|
{
|
|
297
297
|
className: `hfl-px-3 hfl-z-[10000000] hfl-py-2 hfl-top-[48px] hfl-left-[20px] hfl-rounded-lg hfl-bg-White hfl-absolute hfl-shadow-4xl hfl-border-1 ${p}`,
|
|
@@ -299,7 +299,7 @@ const H = ({ children: C, column: l, isHeaderCell: i }) => /* @__PURE__ */ e.jsx
|
|
|
299
299
|
t && /* @__PURE__ */ e.jsxs(
|
|
300
300
|
"div",
|
|
301
301
|
{
|
|
302
|
-
ref:
|
|
302
|
+
ref: m,
|
|
303
303
|
className: "hfl-flex hfl-items-center hfl-w-full hfl-px-2 hfl-py-1 hfl-border hfl-rounded-lg",
|
|
304
304
|
children: [
|
|
305
305
|
/* @__PURE__ */ e.jsx("i", { className: "hx_search" }),
|
|
@@ -307,11 +307,11 @@ const H = ({ children: C, column: l, isHeaderCell: i }) => /* @__PURE__ */ e.jsx
|
|
|
307
307
|
"input",
|
|
308
308
|
{
|
|
309
309
|
type: "string",
|
|
310
|
-
value:
|
|
310
|
+
value: b,
|
|
311
311
|
className: "hfl-p-1 hfl-w-full focus-visible:hfl-outline-none",
|
|
312
312
|
placeholder: "Search Service",
|
|
313
|
-
onChange: (
|
|
314
|
-
|
|
313
|
+
onChange: (s) => {
|
|
314
|
+
a?.(s.target.value);
|
|
315
315
|
}
|
|
316
316
|
}
|
|
317
317
|
)
|
|
@@ -321,26 +321,26 @@ const H = ({ children: C, column: l, isHeaderCell: i }) => /* @__PURE__ */ e.jsx
|
|
|
321
321
|
/* @__PURE__ */ e.jsx(
|
|
322
322
|
"ul",
|
|
323
323
|
{
|
|
324
|
-
ref:
|
|
324
|
+
ref: f,
|
|
325
325
|
className: "hfl-pb-1 hfl-w-[150px] hfl-max-h-[200px] hfl-rounded-lg hfl-overflow-y-scroll hfl-overflow-x-hidden ",
|
|
326
|
-
children: l.map((
|
|
326
|
+
children: l.map((s) => /* @__PURE__ */ e.jsx(
|
|
327
327
|
D,
|
|
328
328
|
{
|
|
329
|
-
isSelected:
|
|
329
|
+
isSelected: s.isSelected,
|
|
330
330
|
isDisabled: !1,
|
|
331
|
-
label:
|
|
332
|
-
onCheck:
|
|
331
|
+
label: s.name,
|
|
332
|
+
onCheck: r
|
|
333
333
|
},
|
|
334
|
-
`dropdown-option-${
|
|
334
|
+
`dropdown-option-${s.name}`
|
|
335
335
|
))
|
|
336
336
|
}
|
|
337
337
|
),
|
|
338
|
-
|
|
338
|
+
d && /* @__PURE__ */ e.jsx(
|
|
339
339
|
"button",
|
|
340
340
|
{
|
|
341
|
-
onClick:
|
|
342
|
-
className: `hfl-text-Blue-950 hfl-text-[13px] hfl-mt-1 hfl-pb-0.5 hfl-rounded-lg hfl-border-0 hfl-font-inter-0 ${
|
|
343
|
-
ref:
|
|
341
|
+
onClick: y,
|
|
342
|
+
className: `hfl-text-Blue-950 hfl-text-[13px] hfl-mt-1 hfl-pb-0.5 hfl-rounded-lg hfl-border-0 hfl-font-inter-0 ${h}`,
|
|
343
|
+
ref: o,
|
|
344
344
|
children: "Apply Filter"
|
|
345
345
|
}
|
|
346
346
|
)
|
|
@@ -351,16 +351,16 @@ const H = ({ children: C, column: l, isHeaderCell: i }) => /* @__PURE__ */ e.jsx
|
|
|
351
351
|
const {
|
|
352
352
|
leftPinnedColumns: C,
|
|
353
353
|
rightPinnedColumns: l,
|
|
354
|
-
nonPinnedColumns:
|
|
354
|
+
nonPinnedColumns: r,
|
|
355
355
|
headerRowClasses: p,
|
|
356
|
-
hideHeader:
|
|
357
|
-
showDropdown:
|
|
358
|
-
setShowDropdown:
|
|
359
|
-
} = M(), g =
|
|
360
|
-
(t,
|
|
356
|
+
hideHeader: h,
|
|
357
|
+
showDropdown: d,
|
|
358
|
+
setShowDropdown: n
|
|
359
|
+
} = M(), g = R(
|
|
360
|
+
(t, b) => /* @__PURE__ */ e.jsxs(H, { column: t, isHeaderCell: !0, colIndex: b, children: [
|
|
361
361
|
/* @__PURE__ */ e.jsxs("div", { className: "hfl-flex hfl-gap-0 hfl-flex-row hfl-items-center", children: [
|
|
362
362
|
t?.enableColumnCheckbox && /* @__PURE__ */ e.jsx(
|
|
363
|
-
|
|
363
|
+
S,
|
|
364
364
|
{
|
|
365
365
|
size: "md",
|
|
366
366
|
checkBoxInnerDivClasses: "!hfl-w-4 !hfl-h-4 !hfl-mr-1 !hfl-text-Blue-600 !hfl-border-Blue-600 !hfl-bg-Blue-50 hover:hfl-bg-Blue-50 hover:hfl-border-Blue-600",
|
|
@@ -380,11 +380,11 @@ const H = ({ children: C, column: l, isHeaderCell: i }) => /* @__PURE__ */ e.jsx
|
|
|
380
380
|
{
|
|
381
381
|
alt: "filter-icon",
|
|
382
382
|
src: I,
|
|
383
|
-
onClick: () =>
|
|
383
|
+
onClick: () => d === t?.field ? n(null) : n(t?.field),
|
|
384
384
|
id: `filter-button-${t?.field}`
|
|
385
385
|
}
|
|
386
386
|
),
|
|
387
|
-
|
|
387
|
+
d === t?.field && /* @__PURE__ */ e.jsx(
|
|
388
388
|
X,
|
|
389
389
|
{
|
|
390
390
|
options: t?.filterValues ?? [],
|
|
@@ -402,13 +402,13 @@ const H = ({ children: C, column: l, isHeaderCell: i }) => /* @__PURE__ */ e.jsx
|
|
|
402
402
|
dropdownCloseEventOnClickOutside: t?.dropdownCloseEventOnClickOutside
|
|
403
403
|
}
|
|
404
404
|
)
|
|
405
|
-
] }, `th-${
|
|
406
|
-
[
|
|
407
|
-
), x =
|
|
408
|
-
(t,
|
|
405
|
+
] }, `th-${b}`),
|
|
406
|
+
[n, d]
|
|
407
|
+
), x = R(
|
|
408
|
+
(t, b) => /* @__PURE__ */ e.jsx("div", { className: b, children: t.map((a, i) => g(a, i)) }),
|
|
409
409
|
[g]
|
|
410
410
|
);
|
|
411
|
-
return /* @__PURE__ */ e.jsx(e.Fragment, { children: !
|
|
411
|
+
return /* @__PURE__ */ e.jsx(e.Fragment, { children: !h && /* @__PURE__ */ e.jsxs(
|
|
412
412
|
E,
|
|
413
413
|
{
|
|
414
414
|
isHeaderRow: !0,
|
|
@@ -418,7 +418,7 @@ const H = ({ children: C, column: l, isHeaderCell: i }) => /* @__PURE__ */ e.jsx
|
|
|
418
418
|
C,
|
|
419
419
|
"hfl-flex hfl-sticky hfl-left-0 hfl-z-10 hfl-bg-inherit hfl-shadow-md hfl-shadow-Gray-200"
|
|
420
420
|
),
|
|
421
|
-
x(
|
|
421
|
+
x(r, "hfl-flex hfl-h-inherit hfl-w-full"),
|
|
422
422
|
x(
|
|
423
423
|
l,
|
|
424
424
|
"hfl-flex hfl-sticky hfl-right-0 hfl-z-10 hfl-bg-inherit hfl-shadow-md hfl-shadow-Gray-200"
|
|
@@ -448,40 +448,40 @@ const H = ({ children: C, column: l, isHeaderCell: i }) => /* @__PURE__ */ e.jsx
|
|
|
448
448
|
}, J = ({
|
|
449
449
|
children: C,
|
|
450
450
|
initialColumns: l,
|
|
451
|
-
rowData:
|
|
451
|
+
rowData: r,
|
|
452
452
|
headerRowClasses: p,
|
|
453
|
-
rowClassesForSpecificIndex:
|
|
454
|
-
tableBodyClassesToOverride:
|
|
455
|
-
hideHeader:
|
|
453
|
+
rowClassesForSpecificIndex: h,
|
|
454
|
+
tableBodyClassesToOverride: d,
|
|
455
|
+
hideHeader: n,
|
|
456
456
|
paginationProps: g,
|
|
457
457
|
onPaginationClick: x,
|
|
458
458
|
displayPaginationClassesToOverride: t,
|
|
459
|
-
displayNoDataFoundProps:
|
|
460
|
-
enableTableFilter:
|
|
461
|
-
tableBodyParentDivRef:
|
|
459
|
+
displayNoDataFoundProps: b,
|
|
460
|
+
enableTableFilter: a,
|
|
461
|
+
tableBodyParentDivRef: i
|
|
462
462
|
}) => {
|
|
463
|
-
const [
|
|
464
|
-
rowsData:
|
|
463
|
+
const [f, o] = N(null), m = {
|
|
464
|
+
rowsData: r,
|
|
465
465
|
allColumns: l,
|
|
466
|
-
leftPinnedColumns: l.filter((
|
|
467
|
-
rightPinnedColumns: l.filter((
|
|
466
|
+
leftPinnedColumns: l.filter((c) => c.pinned === Z.Left),
|
|
467
|
+
rightPinnedColumns: l.filter((c) => c.pinned === Z.Right),
|
|
468
468
|
nonPinnedColumns: l.filter(
|
|
469
|
-
(
|
|
469
|
+
(c) => c.pinned !== Z.Right && c.pinned !== Z.Left
|
|
470
470
|
),
|
|
471
471
|
paginationProps: g,
|
|
472
472
|
onPaginationClick: x,
|
|
473
473
|
headerRowClasses: p,
|
|
474
|
-
rowClassesForSpecificIndex:
|
|
475
|
-
tableBodyClassesToOverride:
|
|
476
|
-
hideHeader:
|
|
477
|
-
showDropdown:
|
|
478
|
-
setShowDropdown:
|
|
474
|
+
rowClassesForSpecificIndex: h,
|
|
475
|
+
tableBodyClassesToOverride: d,
|
|
476
|
+
hideHeader: n,
|
|
477
|
+
showDropdown: f,
|
|
478
|
+
setShowDropdown: o,
|
|
479
479
|
displayPaginationClassesToOverride: t,
|
|
480
|
-
displayNoDataFoundProps:
|
|
481
|
-
enableTableFilter:
|
|
482
|
-
tableBodyParentDivRef:
|
|
480
|
+
displayNoDataFoundProps: b,
|
|
481
|
+
enableTableFilter: a,
|
|
482
|
+
tableBodyParentDivRef: i
|
|
483
483
|
};
|
|
484
|
-
return /* @__PURE__ */ e.jsx($.Provider, { value:
|
|
484
|
+
return /* @__PURE__ */ e.jsx($.Provider, { value: m, children: C });
|
|
485
485
|
}, K = (C) => {
|
|
486
486
|
const l = {
|
|
487
487
|
activePage: C.paginationProps?.activePage ?? 0,
|
|
@@ -556,46 +556,50 @@ const H = ({ children: C, column: l, isHeaderCell: i }) => /* @__PURE__ */ e.jsx
|
|
|
556
556
|
}, l2 = ({
|
|
557
557
|
data: C = [],
|
|
558
558
|
testDetails: l = [],
|
|
559
|
-
enableCheckboxesToSelect:
|
|
559
|
+
enableCheckboxesToSelect: r = !1,
|
|
560
560
|
tableHeaderRowClasses: p,
|
|
561
|
-
investigationCheckBoxMap:
|
|
562
|
-
onColumnCheckboxClickHandler:
|
|
563
|
-
onRowCheckboxClickHandler:
|
|
561
|
+
investigationCheckBoxMap: h,
|
|
562
|
+
onColumnCheckboxClickHandler: d,
|
|
563
|
+
onRowCheckboxClickHandler: n,
|
|
564
|
+
onRefresh: g
|
|
564
565
|
}) => {
|
|
565
|
-
const [
|
|
566
|
+
const [x, t] = N([]), [b, a] = N([]), [i, f] = N([]), o = F(null);
|
|
566
567
|
j(() => {
|
|
567
|
-
if (!C.length)
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
C
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
568
|
+
if (!C.length) {
|
|
569
|
+
t([]);
|
|
570
|
+
return;
|
|
571
|
+
}
|
|
572
|
+
const c = [...new Set(C.map((s) => s.test_date))];
|
|
573
|
+
a(c);
|
|
574
|
+
const w = /* @__PURE__ */ new Map();
|
|
575
|
+
C?.forEach((s) => {
|
|
576
|
+
const v = l.find((P) => P?.test_id?.toString() === s?.test_id?.toString());
|
|
577
|
+
w.has(s.test_id) || w.set(s.test_id, {
|
|
578
|
+
created_on: s.created_on,
|
|
579
|
+
out_of_range: s.out_of_range,
|
|
580
|
+
test_date: s.test_date,
|
|
581
|
+
test_id: s.test_id,
|
|
582
|
+
test_name: v?.test_names || s.test_name,
|
|
583
|
+
test_value: s.test_value,
|
|
584
|
+
test_unit: v?.test_units || s.test_unit
|
|
581
585
|
});
|
|
582
|
-
const
|
|
583
|
-
|
|
586
|
+
const u = w.get(s.test_id);
|
|
587
|
+
u[s.test_date] = s.test_value;
|
|
584
588
|
});
|
|
585
|
-
const
|
|
586
|
-
|
|
589
|
+
const y = Array.from(w.values());
|
|
590
|
+
t(y);
|
|
587
591
|
}, [C, l]);
|
|
588
|
-
const
|
|
592
|
+
const m = "hfl-text-1";
|
|
589
593
|
return j(() => {
|
|
590
|
-
const
|
|
594
|
+
const c = [
|
|
591
595
|
{
|
|
592
596
|
field: "#",
|
|
593
597
|
fieldHeaderName: "No.",
|
|
594
598
|
pinned: "left",
|
|
595
599
|
width: "60px",
|
|
596
600
|
minWidth: "60px",
|
|
597
|
-
cellClasses: `${
|
|
598
|
-
renderCell: (
|
|
601
|
+
cellClasses: `${m}`,
|
|
602
|
+
renderCell: (y, s, v, u) => /* @__PURE__ */ e.jsx(e.Fragment, { children: u + 1 })
|
|
599
603
|
},
|
|
600
604
|
{
|
|
601
605
|
field: "test_name",
|
|
@@ -603,28 +607,26 @@ const H = ({ children: C, column: l, isHeaderCell: i }) => /* @__PURE__ */ e.jsx
|
|
|
603
607
|
pinned: "left",
|
|
604
608
|
width: "250px",
|
|
605
609
|
minWidth: "250px",
|
|
606
|
-
cellClasses: `${
|
|
607
|
-
enableColumnCheckbox:
|
|
608
|
-
isCheckBoxMarked:
|
|
609
|
-
onColumnCheckboxClick: (
|
|
610
|
-
|
|
610
|
+
cellClasses: `${m}`,
|
|
611
|
+
enableColumnCheckbox: r,
|
|
612
|
+
isCheckBoxMarked: h.get("test_name"),
|
|
613
|
+
onColumnCheckboxClick: (y) => {
|
|
614
|
+
d("test_name", y);
|
|
611
615
|
},
|
|
612
|
-
renderCell: (
|
|
613
|
-
|
|
614
|
-
|
|
616
|
+
renderCell: (y, s) => /* @__PURE__ */ e.jsxs("div", { className: "hfl-flex hfl-items-center", children: [
|
|
617
|
+
r && /* @__PURE__ */ e.jsx(
|
|
618
|
+
S,
|
|
615
619
|
{
|
|
616
620
|
size: "md",
|
|
617
621
|
checkBoxInnerDivClasses: "!hfl-w-4 !hfl-h-4 !hfl-mr-1 !hfl-text-Blue-600 !hfl-border-Blue-600 !hfl-bg-Blue-50 hover:hfl-bg-Blue-50 hover:hfl-border-Blue-600",
|
|
618
622
|
text: "",
|
|
619
|
-
onClick: (
|
|
620
|
-
|
|
621
|
-
},
|
|
622
|
-
id: `checkbox-test-${f.test_id}`,
|
|
623
|
+
onClick: () => n?.(s.test_id),
|
|
624
|
+
id: `checkbox-test-${s.test_id}`,
|
|
623
625
|
isMarked: !0,
|
|
624
626
|
checkboxClasses: "hfl-gap-0"
|
|
625
627
|
}
|
|
626
628
|
),
|
|
627
|
-
|
|
629
|
+
y
|
|
628
630
|
] })
|
|
629
631
|
},
|
|
630
632
|
{
|
|
@@ -633,35 +635,40 @@ const H = ({ children: C, column: l, isHeaderCell: i }) => /* @__PURE__ */ e.jsx
|
|
|
633
635
|
pinned: "left",
|
|
634
636
|
width: "80px",
|
|
635
637
|
minWidth: "80px",
|
|
636
|
-
cellClasses: `${
|
|
638
|
+
cellClasses: `${m}`
|
|
637
639
|
}
|
|
638
|
-
],
|
|
639
|
-
field:
|
|
640
|
-
fieldHeaderName:
|
|
640
|
+
], w = b.map((y) => ({
|
|
641
|
+
field: y,
|
|
642
|
+
fieldHeaderName: y,
|
|
641
643
|
width: "150px",
|
|
642
644
|
minWidth: "150px",
|
|
643
|
-
cellClasses: `${
|
|
644
|
-
enableColumnCheckbox:
|
|
645
|
-
isCheckBoxMarked:
|
|
646
|
-
onColumnCheckboxClick: (
|
|
647
|
-
|
|
645
|
+
cellClasses: `${m}`,
|
|
646
|
+
enableColumnCheckbox: r,
|
|
647
|
+
isCheckBoxMarked: h.get(y),
|
|
648
|
+
onColumnCheckboxClick: (s) => {
|
|
649
|
+
d(y, s);
|
|
648
650
|
}
|
|
649
651
|
}));
|
|
650
|
-
|
|
652
|
+
f([...c, ...w]);
|
|
651
653
|
}, [
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
654
|
+
b,
|
|
655
|
+
r,
|
|
656
|
+
h,
|
|
657
|
+
d,
|
|
658
|
+
n
|
|
657
659
|
]), /* @__PURE__ */ e.jsx(
|
|
658
660
|
K,
|
|
659
661
|
{
|
|
660
662
|
headerRowClasses: `hfl-bg-Blue_gray-50 hfl-text-Indigo-500 hfl-text-1 hfl-border ${p}`,
|
|
661
|
-
tableRef:
|
|
662
|
-
columns:
|
|
663
|
+
tableRef: o,
|
|
664
|
+
columns: i,
|
|
663
665
|
tableName: "Investigations",
|
|
664
|
-
rows:
|
|
666
|
+
rows: x,
|
|
667
|
+
displayNoDataFoundProps: {
|
|
668
|
+
title: "No Investigation Available",
|
|
669
|
+
description: "Please create a new investigation or refresh",
|
|
670
|
+
onPageReload: g
|
|
671
|
+
}
|
|
665
672
|
}
|
|
666
673
|
);
|
|
667
674
|
};
|