hplx-feature-library 1.0.115 → 1.0.117

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.
@@ -1,5 +1,5 @@
1
- import { j as e, Y as L, P as B, M as R } from "./index-CuCeJNEo.js";
2
- import { createContext as A, useContext as G, useMemo as O, useState as N, useRef as P, useEffect as j, useCallback as S } from "react";
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: i } = M(), p = O(() => Math.ceil(C.totalRecords / C.pageSize), [C.pageSize, C.totalRecords]), o = (c) => {
16
- let h = C.activePage;
17
- c === k.PREV_PAGE && C.activePage > 1 ? h = h - 1 : c === k.NEXT_PAGE && C.activePage < p && (h = h + 1), l?.(h);
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: `${i ?? ""} hfl-text-Gray-500 hfl-font-inter hfl-leading-12 hfl-text-2 hfl-font-inter-0`,
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: `${i ?? ""} hx_left hfl-text-4 hfl-text-Gray-700`,
40
+ iconFile: `${r ?? ""} hx_left hfl-text-4 hfl-text-Gray-700`,
41
41
  onClick: () => {
42
- o(k.PREV_PAGE);
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: `${i ?? ""} hx_right hfl-text-4 hfl-text-Gray-700`,
55
+ iconFile: `${r ?? ""} hx_right hfl-text-4 hfl-text-Gray-700`,
56
56
  onClick: () => {
57
- o(k.NEXT_PAGE);
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: i, isSelected: p, isDisabled: o } = C;
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: !o && p,
73
- disabled: o,
74
- onChange: () => !o && i(l),
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] ${o ? "hfl-text-Gray-400" : ""}`,
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: i,
90
+ filterclassname: r,
91
91
  filterButtonStyles: p = "",
92
- clearFilterButtonStyles: o = "",
93
- showApplyFilter: c = !1,
94
- onApplyFilter: h,
92
+ clearFilterButtonStyles: h = "",
93
+ showApplyFilter: d = !1,
94
+ onApplyFilter: n,
95
95
  onClearFilter: g
96
- } = C, [x, t] = N([]), [y, s] = N(0), a = P(null), d = P(null), r = P(null), b = P(null), [n, u] = N(!1), f = () => {
97
- h && h(x), u(!1);
98
- }, w = () => {
99
- g && g(), u(!1);
100
- }, v = (m) => {
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
- (F) => F.map(
103
- (_, T) => T === m ? { ..._, isSelected: !_.isSelected } : { ..._ }
102
+ (P) => P.map(
103
+ (_, T) => T === u ? { ..._, isSelected: !_.isSelected } : { ..._ }
104
104
  )
105
105
  );
106
106
  };
107
107
  return j(() => {
108
- t(l), s(l.filter((m) => m.isSelected && !m.isDisabled).length);
108
+ t(l), a(l.filter((u) => u.isSelected && !u.isDisabled).length);
109
109
  }, [l]), j(() => {
110
- const m = (F) => {
111
- F.target instanceof HTMLElement && d.current && !d.current.contains(F.target) && a.current && !a.current.contains(F.target) && (!r.current || r && r.current && !r.current.contains(F.target)) && (!b.current || b && b.current && !b.current.contains(F.target)) && (u(!1), t(l));
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 n ? document.addEventListener("mousedown", m) : document.removeEventListener("mousedown", m), () => {
114
- document.removeEventListener("mousedown", m);
113
+ return c ? document.addEventListener("mousedown", u) : document.removeEventListener("mousedown", u), () => {
114
+ document.removeEventListener("mousedown", u);
115
115
  };
116
- }, [n, d, u]), /* @__PURE__ */ e.jsxs("div", { className: "hfl-relative", style: { minWidth: "10rem" }, children: [
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: a,
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: () => u(!n),
122
+ onClick: () => w(!c),
123
123
  children: [
124
- /* @__PURE__ */ e.jsx("span", { className: "hfl-text-1 hfl-text-Gray-400", children: y > 0 ? `${y} Selected` : "Select Table Filter" }),
125
- /* @__PURE__ */ e.jsx("i", { className: `${n ? "hx_up" : "hx_down"} hfl-text-1 hfl-text-Gray-500` })
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
- n && /* @__PURE__ */ e.jsxs(
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 ${i}`,
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: d,
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((m, F) => /* @__PURE__ */ e.jsx(
139
+ children: x.map((u, P) => /* @__PURE__ */ e.jsx(
140
140
  D,
141
141
  {
142
- isSelected: m.isSelected,
143
- isDisabled: m.isDisabled ?? !1,
144
- label: m.name,
145
- onCheck: () => v(F)
142
+ isSelected: u.isSelected,
143
+ isDisabled: u.isDisabled ?? !1,
144
+ label: u.name,
145
+ onCheck: () => v(P)
146
146
  },
147
- `dropdown-option-${m.name}`
147
+ `dropdown-option-${u.name}`
148
148
  ))
149
149
  }
150
150
  ),
151
- c && /* @__PURE__ */ e.jsxs("div", { className: "hfl-flex hfl-bg-White hfl-px-2 hfl-border-t hfl-gap-3 hfl-border-Gray-200", children: [
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: f,
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: r,
157
+ ref: o,
158
158
  children: "Apply Filter"
159
159
  }
160
160
  ),
161
161
  /* @__PURE__ */ e.jsx(
162
162
  "button",
163
163
  {
164
- onClick: w,
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 ${o}`,
166
- ref: b,
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: i,
179
+ description: r,
180
180
  onPageRefresh: p,
181
- buttonClassName: o,
182
- titleClassName: c,
183
- descriptionClassName: h,
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 ${c}`, children: l }),
195
- /* @__PURE__ */ e.jsx(B, { variant: "Medium", type: "Text md", className: `hfl-mb-1 ${h}`, children: i }),
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: o,
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: i }) => /* @__PURE__ */ e.jsx(
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" : ""} ${i ? `${l?.headerCellClasses ?? ""} hfl-py-2 hfl-justify-between hfl-relative` : `${l?.cellClasses ?? ""} hfl-min-h-[40px] hfl-py-1`}`,
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: i }) => /* @__PURE__ */ e.jsx(
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 ${i ?? ""} ${l ? "hfl-bg-White" : "hfl-bg-White odd:hfl-bg-Gray-50"}`,
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: i,
235
+ rightPinnedColumns: r,
236
236
  nonPinnedColumns: p,
237
- tableBodyClassesToOverride: o,
238
- rowClassesForSpecificIndex: c,
239
- tableBodyParentDivRef: h
240
- } = M(), g = (s, a, d) => {
241
- const r = a[s?.field];
242
- return s?.valueFormatter ? s?.valueFormatter(r, a, s, d) : r;
243
- }, x = (s, a, d, r) => /* @__PURE__ */ e.jsx(H, { column: s, colIndex: r, rowIndex: d, children: s?.renderCell ? s?.renderCell(g(s, a, d), a, s, d) : g(s, a, d) }, `${d}-${r}`), t = (s, a, d, r) => /* @__PURE__ */ e.jsx("div", { style: { height: "inherit" }, className: r, children: s.map((b, n) => x(b, a, d, n)) }), y = (s, a) => /* @__PURE__ */ e.jsxs(
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 ${c.index === a ? c.rowClasses : ""}`,
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, s, a, "hfl-flex hfl-h-inherit hfl-w-full"),
255
+ t(p, a, i, "hfl-flex hfl-h-inherit hfl-w-full"),
256
256
  t(
257
- i,
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" + a
264
+ "tr" + i
265
265
  );
266
- return /* @__PURE__ */ e.jsx("div", { ref: h, className: `${o ?? ""} hfl-max-h-500`, children: C.map((s, a) => y(s, a)) });
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: i,
270
+ onCheck: r,
271
271
  filterclassname: p,
272
- filterButtonStyles: o = "",
273
- showApplyFilter: c = !1,
274
- onApplyFilter: h,
272
+ filterButtonStyles: h = "",
273
+ showApplyFilter: d = !1,
274
+ onApplyFilter: n,
275
275
  field: g,
276
276
  resetDropDownData: x,
277
277
  showSearch: t,
278
- searchQuery: y,
279
- setSearchQuery: s,
280
- dropdownCloseEventOnClickOutside: a
281
- } = C, d = P(null), r = P(null), b = P(null), { showDropdown: n, setShowDropdown: u } = M(), f = () => {
282
- h && h(g), u(null);
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 w = (v) => {
285
+ const s = (v) => {
286
286
  if (v.target instanceof HTMLElement) {
287
- const m = document.getElementById(`filter-button-${n}`);
288
- d.current && !d.current.contains(v.target) && m && !m.contains(v.target) && b && !b.current?.contains(v.target) && (!r.current || r && r.current && !r.current.contains(v.target)) && (c && x && x(g), u(null), a?.());
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 n ? document.addEventListener("mousedown", w) : document.removeEventListener("mousedown", w), () => {
292
- document.removeEventListener("mousedown", w);
291
+ return c ? document.addEventListener("mousedown", s) : document.removeEventListener("mousedown", s), () => {
292
+ document.removeEventListener("mousedown", s);
293
293
  };
294
- }, [n, d, u]), /* @__PURE__ */ e.jsxs(
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: b,
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: y,
310
+ value: b,
311
311
  className: "hfl-p-1 hfl-w-full focus-visible:hfl-outline-none",
312
312
  placeholder: "Search Service",
313
- onChange: (w) => {
314
- s?.(w.target.value);
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: d,
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((w) => /* @__PURE__ */ e.jsx(
326
+ children: l.map((s) => /* @__PURE__ */ e.jsx(
327
327
  D,
328
328
  {
329
- isSelected: w.isSelected,
329
+ isSelected: s.isSelected,
330
330
  isDisabled: !1,
331
- label: w.name,
332
- onCheck: i
331
+ label: s.name,
332
+ onCheck: r
333
333
  },
334
- `dropdown-option-${w.name}`
334
+ `dropdown-option-${s.name}`
335
335
  ))
336
336
  }
337
337
  ),
338
- c && /* @__PURE__ */ e.jsx(
338
+ d && /* @__PURE__ */ e.jsx(
339
339
  "button",
340
340
  {
341
- onClick: f,
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 ${o}`,
343
- ref: r,
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: i,
354
+ nonPinnedColumns: r,
355
355
  headerRowClasses: p,
356
- hideHeader: o,
357
- showDropdown: c,
358
- setShowDropdown: h
359
- } = M(), g = S(
360
- (t, y) => /* @__PURE__ */ e.jsxs(H, { column: t, isHeaderCell: !0, colIndex: y, children: [
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
- R,
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: () => c === t?.field ? h(null) : h(t?.field),
383
+ onClick: () => d === t?.field ? n(null) : n(t?.field),
384
384
  id: `filter-button-${t?.field}`
385
385
  }
386
386
  ),
387
- c === t?.field && /* @__PURE__ */ e.jsx(
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-${y}`),
406
- [h, c]
407
- ), x = S(
408
- (t, y) => /* @__PURE__ */ e.jsx("div", { className: y, children: t.map((s, a) => g(s, a)) }),
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: !o && /* @__PURE__ */ e.jsxs(
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(i, "hfl-flex hfl-h-inherit hfl-w-full"),
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: i,
451
+ rowData: r,
452
452
  headerRowClasses: p,
453
- rowClassesForSpecificIndex: o,
454
- tableBodyClassesToOverride: c,
455
- hideHeader: h,
453
+ rowClassesForSpecificIndex: h,
454
+ tableBodyClassesToOverride: d,
455
+ hideHeader: n,
456
456
  paginationProps: g,
457
457
  onPaginationClick: x,
458
458
  displayPaginationClassesToOverride: t,
459
- displayNoDataFoundProps: y,
460
- enableTableFilter: s,
461
- tableBodyParentDivRef: a
459
+ displayNoDataFoundProps: b,
460
+ enableTableFilter: a,
461
+ tableBodyParentDivRef: i
462
462
  }) => {
463
- const [d, r] = N(null), b = {
464
- rowsData: i,
463
+ const [f, o] = N(null), m = {
464
+ rowsData: r,
465
465
  allColumns: l,
466
- leftPinnedColumns: l.filter((n) => n.pinned === Z.Left),
467
- rightPinnedColumns: l.filter((n) => n.pinned === Z.Right),
466
+ leftPinnedColumns: l.filter((c) => c.pinned === Z.Left),
467
+ rightPinnedColumns: l.filter((c) => c.pinned === Z.Right),
468
468
  nonPinnedColumns: l.filter(
469
- (n) => n.pinned !== Z.Right && n.pinned !== Z.Left
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: o,
475
- tableBodyClassesToOverride: c,
476
- hideHeader: h,
477
- showDropdown: d,
478
- setShowDropdown: r,
474
+ rowClassesForSpecificIndex: h,
475
+ tableBodyClassesToOverride: d,
476
+ hideHeader: n,
477
+ showDropdown: f,
478
+ setShowDropdown: o,
479
479
  displayPaginationClassesToOverride: t,
480
- displayNoDataFoundProps: y,
481
- enableTableFilter: s,
482
- tableBodyParentDivRef: a
480
+ displayNoDataFoundProps: b,
481
+ enableTableFilter: a,
482
+ tableBodyParentDivRef: i
483
483
  };
484
- return /* @__PURE__ */ e.jsx($.Provider, { value: b, children: C });
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: i = !1,
559
+ enableCheckboxesToSelect: r = !1,
560
560
  tableHeaderRowClasses: p,
561
- investigationCheckBoxMap: o,
562
- onColumnCheckboxClickHandler: c,
563
- onRowCheckboxClickHandler: h
561
+ investigationCheckBoxMap: h,
562
+ onColumnCheckboxClickHandler: d,
563
+ onRowCheckboxClickHandler: n,
564
+ onRefresh: g
564
565
  }) => {
565
- const [g, x] = N([]), [t, y] = N([]), [s, a] = N([]), d = P(null);
566
+ const [x, t] = N([]), [b, a] = N([]), [i, f] = N([]), o = F(null);
566
567
  j(() => {
567
- if (!C.length) return;
568
- const b = [...new Set(C.map((f) => f.test_date))];
569
- y(b);
570
- const n = /* @__PURE__ */ new Map();
571
- C?.forEach((f) => {
572
- const w = l.find((m) => m?.test_id?.toString() === f?.test_id?.toString());
573
- n.has(f.test_id) || n.set(f.test_id, {
574
- created_on: f.created_on,
575
- out_of_range: f.out_of_range,
576
- test_date: f.test_date,
577
- test_id: f.test_id,
578
- test_name: w?.test_names || f.test_name,
579
- test_value: f.test_value,
580
- test_unit: w?.test_units || f.test_unit
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 v = n.get(f.test_id);
583
- v[f.test_date] = f.test_value;
586
+ const u = w.get(s.test_id);
587
+ u[s.test_date] = s.test_value;
584
588
  });
585
- const u = Array.from(n.values());
586
- x(u);
589
+ const y = Array.from(w.values());
590
+ t(y);
587
591
  }, [C, l]);
588
- const r = "hfl-text-1";
592
+ const m = "hfl-text-1";
589
593
  return j(() => {
590
- const b = [
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: `${r}`,
598
- renderCell: (u, f, w, v) => /* @__PURE__ */ e.jsx(e.Fragment, { children: v + 1 })
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,28 @@ 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: `${r}`,
607
- enableColumnCheckbox: i,
608
- isCheckBoxMarked: o.get("test_name"),
609
- onColumnCheckboxClick: (u) => {
610
- c("test_name", u);
610
+ cellClasses: `${m}`,
611
+ enableColumnCheckbox: r,
612
+ isCheckBoxMarked: h.get("test_name"),
613
+ onColumnCheckboxClick: (y) => {
614
+ d("test_name", y);
611
615
  },
612
- renderCell: (u, f) => /* @__PURE__ */ e.jsxs("div", { className: "hfl-flex hfl-items-center", children: [
613
- i && /* @__PURE__ */ e.jsx(
614
- R,
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: (w) => {
620
- h?.(), console.log("id", w);
623
+ onClick: (v) => {
624
+ n?.(), console.log("id", v);
621
625
  },
622
- id: `checkbox-test-${f.test_id}`,
626
+ id: `checkbox-test-${s.test_id}`,
623
627
  isMarked: !0,
624
628
  checkboxClasses: "hfl-gap-0"
625
629
  }
626
630
  ),
627
- u
631
+ y
628
632
  ] })
629
633
  },
630
634
  {
@@ -633,35 +637,40 @@ const H = ({ children: C, column: l, isHeaderCell: i }) => /* @__PURE__ */ e.jsx
633
637
  pinned: "left",
634
638
  width: "80px",
635
639
  minWidth: "80px",
636
- cellClasses: `${r}`
640
+ cellClasses: `${m}`
637
641
  }
638
- ], n = t.map((u) => ({
639
- field: u,
640
- fieldHeaderName: u,
642
+ ], w = b.map((y) => ({
643
+ field: y,
644
+ fieldHeaderName: y,
641
645
  width: "150px",
642
646
  minWidth: "150px",
643
- cellClasses: `${r}`,
644
- enableColumnCheckbox: i,
645
- isCheckBoxMarked: o.get(u),
646
- onColumnCheckboxClick: (f) => {
647
- c(u, f);
647
+ cellClasses: `${m}`,
648
+ enableColumnCheckbox: r,
649
+ isCheckBoxMarked: h.get(y),
650
+ onColumnCheckboxClick: (s) => {
651
+ d(y, s);
648
652
  }
649
653
  }));
650
- a([...b, ...n]);
654
+ f([...c, ...w]);
651
655
  }, [
652
- t,
653
- i,
654
- o,
655
- c,
656
- h
656
+ b,
657
+ r,
658
+ h,
659
+ d,
660
+ n
657
661
  ]), /* @__PURE__ */ e.jsx(
658
662
  K,
659
663
  {
660
664
  headerRowClasses: `hfl-bg-Blue_gray-50 hfl-text-Indigo-500 hfl-text-1 hfl-border ${p}`,
661
- tableRef: d,
662
- columns: s,
665
+ tableRef: o,
666
+ columns: i,
663
667
  tableName: "Investigations",
664
- rows: g
668
+ rows: x,
669
+ displayNoDataFoundProps: {
670
+ title: "No Investigation Available",
671
+ description: "Please create a new investigation or refresh",
672
+ onPageReload: g
673
+ }
665
674
  }
666
675
  );
667
676
  };