hplx-feature-library 1.0.106 → 1.0.108

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,7 +1,7 @@
1
- import { j as e, Y as L, P as S, M as E } from "./index-Bs8a30WQ.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
- const B = A(void 0), M = () => {
4
- const C = G(B);
1
+ import { j as e, Y as L, P as B, M as R } from "./index-Bs8a30WQ.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";
3
+ const $ = A(void 0), M = () => {
4
+ const C = G($);
5
5
  if (!C)
6
6
  throw new Error("useTableContext must be used within a TableProvider");
7
7
  return C;
@@ -12,15 +12,15 @@ const B = A(void 0), M = () => {
12
12
  Left: "left",
13
13
  Right: "right"
14
14
  }, z = () => {
15
- const { paginationProps: C, onPaginationClick: l, displayPaginationClassesToOverride: n } = M(), x = O(() => Math.ceil(C.totalRecords / C.pageSize), [C.pageSize, C.totalRecords]), o = (c) => {
16
- let d = C.activePage;
17
- c === k.PREV_PAGE && C.activePage > 1 ? d = d - 1 : c === k.NEXT_PAGE && C.activePage < x && (d = d + 1), l?.(d);
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);
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: `${n ?? ""} hfl-text-Gray-500 hfl-font-inter hfl-leading-12 hfl-text-2 hfl-font-inter-0`,
23
+ className: `${i ?? ""} 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,7 +37,7 @@ const B = A(void 0), M = () => {
37
37
  hierarchy: "Secondary-Grey",
38
38
  size: "sm",
39
39
  icon: "Only",
40
- iconFile: `${n ?? ""} hx_left hfl-text-4 hfl-text-Gray-700`,
40
+ iconFile: `${i ?? ""} hx_left hfl-text-4 hfl-text-Gray-700`,
41
41
  onClick: () => {
42
42
  o(k.PREV_PAGE);
43
43
  },
@@ -52,26 +52,26 @@ const B = A(void 0), M = () => {
52
52
  hierarchy: "Secondary-Grey",
53
53
  size: "sm",
54
54
  icon: "Only",
55
- iconFile: `${n ?? ""} hx_right hfl-text-4 hfl-text-Gray-700`,
55
+ iconFile: `${i ?? ""} hx_right hfl-text-4 hfl-text-Gray-700`,
56
56
  onClick: () => {
57
57
  o(k.NEXT_PAGE);
58
58
  },
59
59
  textField: "",
60
- disabled: !C.currentPageRowCount || C.activePage === x
60
+ disabled: !C.currentPageRowCount || C.activePage === p
61
61
  }
62
62
  )
63
63
  ] });
64
64
  };
65
- function $(C) {
66
- const { label: l, onCheck: n, isSelected: x, isDisabled: o } = C;
65
+ function D(C) {
66
+ const { label: l, onCheck: i, isSelected: p, isDisabled: o } = 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 && x,
72
+ checked: !o && p,
73
73
  disabled: o,
74
- onChange: () => !o && n(l),
74
+ onChange: () => !o && i(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
  ),
@@ -87,64 +87,64 @@ function $(C) {
87
87
  const V = (C) => {
88
88
  const {
89
89
  options: l,
90
- filterclassname: n,
91
- filterButtonStyles: x = "",
90
+ filterclassname: i,
91
+ filterButtonStyles: p = "",
92
92
  clearFilterButtonStyles: o = "",
93
93
  showApplyFilter: c = !1,
94
- onApplyFilter: d,
95
- onClearFilter: m
96
- } = C, [u, t] = N([]), [w, s] = N(0), a = F(null), h = F(null), f = F(null), p = F(null), [i, r] = N(!1), P = () => {
97
- d && d(u), r(!1);
98
- }, b = () => {
99
- m && m(), r(!1);
100
- }, y = (g) => {
94
+ onApplyFilter: h,
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) => {
101
101
  t(
102
- (v) => v.map(
103
- (_, T) => T === g ? { ..._, isSelected: !_.isSelected } : { ..._ }
102
+ (F) => F.map(
103
+ (_, T) => T === m ? { ..._, isSelected: !_.isSelected } : { ..._ }
104
104
  )
105
105
  );
106
106
  };
107
107
  return j(() => {
108
- t(l), s(l.filter((g) => g.isSelected && !g.isDisabled).length);
108
+ t(l), s(l.filter((m) => m.isSelected && !m.isDisabled).length);
109
109
  }, [l]), j(() => {
110
- const g = (v) => {
111
- v.target instanceof HTMLElement && h.current && !h.current.contains(v.target) && a.current && !a.current.contains(v.target) && (!f.current || f && f.current && !f.current.contains(v.target)) && (!p.current || p && p.current && !p.current.contains(v.target)) && (r(!1), t(l));
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));
112
112
  };
113
- return i ? document.addEventListener("mousedown", g) : document.removeEventListener("mousedown", g), () => {
114
- document.removeEventListener("mousedown", g);
113
+ return n ? document.addEventListener("mousedown", m) : document.removeEventListener("mousedown", m), () => {
114
+ document.removeEventListener("mousedown", m);
115
115
  };
116
- }, [i, h, r]), /* @__PURE__ */ e.jsxs("div", { className: "hfl-relative", style: { minWidth: "10rem" }, children: [
116
+ }, [n, d, u]), /* @__PURE__ */ e.jsxs("div", { className: "hfl-relative", style: { minWidth: "10rem" }, children: [
117
117
  /* @__PURE__ */ e.jsxs(
118
118
  "div",
119
119
  {
120
120
  ref: a,
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: () => r(!i),
122
+ onClick: () => u(!n),
123
123
  children: [
124
- /* @__PURE__ */ e.jsx("span", { className: "hfl-text-1 hfl-text-Gray-400", children: w > 0 ? `${w} Selected` : "Select Table Filter" }),
125
- /* @__PURE__ */ e.jsx("i", { className: `${i ? "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: 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` })
126
126
  ]
127
127
  }
128
128
  ),
129
- i && /* @__PURE__ */ e.jsxs(
129
+ n && /* @__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 ${n}`,
132
+ className: `hfl-absolute hfl-z-50 hfl-rounded-lg hfl-bg-White hfl-shadow-4xl hfl-border-1 ${i}`,
133
133
  children: [
134
134
  /* @__PURE__ */ e.jsx(
135
135
  "ul",
136
136
  {
137
- ref: h,
137
+ ref: d,
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: u.map((g, v) => /* @__PURE__ */ e.jsx(
140
- $,
139
+ children: x.map((m, F) => /* @__PURE__ */ e.jsx(
140
+ D,
141
141
  {
142
- isSelected: g.isSelected,
143
- isDisabled: g.isDisabled ?? !1,
144
- label: g.name,
145
- onCheck: () => y(v)
142
+ isSelected: m.isSelected,
143
+ isDisabled: m.isDisabled ?? !1,
144
+ label: m.name,
145
+ onCheck: () => v(F)
146
146
  },
147
- `dropdown-option-${g.name}`
147
+ `dropdown-option-${m.name}`
148
148
  ))
149
149
  }
150
150
  ),
@@ -152,18 +152,18 @@ const V = (C) => {
152
152
  /* @__PURE__ */ e.jsx(
153
153
  "button",
154
154
  {
155
- onClick: P,
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 ${x}`,
157
- ref: f,
155
+ onClick: f,
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,
158
158
  children: "Apply Filter"
159
159
  }
160
160
  ),
161
161
  /* @__PURE__ */ e.jsx(
162
162
  "button",
163
163
  {
164
- onClick: b,
164
+ onClick: w,
165
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: p,
166
+ ref: b,
167
167
  children: "Clear Filter"
168
168
  }
169
169
  )
@@ -176,30 +176,30 @@ const V = (C) => {
176
176
  function Q(C) {
177
177
  const {
178
178
  title: l,
179
- description: n,
180
- onPageRefresh: x,
179
+ description: i,
180
+ onPageRefresh: p,
181
181
  buttonClassName: o,
182
182
  titleClassName: c,
183
- descriptionClassName: d,
184
- containerClassName: m,
185
- imageClassName: u
183
+ descriptionClassName: h,
184
+ containerClassName: g,
185
+ imageClassName: x
186
186
  } = C;
187
187
  return /* @__PURE__ */ e.jsxs(
188
188
  "div",
189
189
  {
190
- className: `hfl-flex hfl-justify-center hfl-items-center xs:hfl-py-2 xs:hfl-px-8 sm:hfl-py-4 sm:hfl-px-16 hfl-border-t-1 hfl-border-Gray-300 ${m}`,
190
+ className: `hfl-flex hfl-justify-center hfl-items-center xs:hfl-py-2 xs:hfl-px-8 sm:hfl-py-4 sm:hfl-px-16 hfl-border-t-1 hfl-border-Gray-300 ${g}`,
191
191
  children: [
192
- /* @__PURE__ */ e.jsx("img", { src: W, className: u || "", alt: "No records found image" }),
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(S, { variant: "Bold", type: "Display xs", className: `hfl-mb-1 ${c}`, children: l }),
195
- /* @__PURE__ */ e.jsx(S, { variant: "Medium", type: "Text md", className: `hfl-mb-1 ${d}`, children: n }),
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 }),
196
196
  /* @__PURE__ */ e.jsx(
197
197
  L,
198
198
  {
199
199
  hierarchy: "Primary",
200
200
  size: "sm",
201
201
  className: o,
202
- onClick: x,
202
+ onClick: p,
203
203
  icon: "Left",
204
204
  iconFile: "hx_rewind",
205
205
  textField: "Refresh"
@@ -210,7 +210,7 @@ function Q(C) {
210
210
  }
211
211
  );
212
212
  }
213
- const D = ({ children: C, column: l, isHeaderCell: n }) => /* @__PURE__ */ e.jsx(
213
+ const H = ({ children: C, column: l, isHeaderCell: i }) => /* @__PURE__ */ e.jsx(
214
214
  "div",
215
215
  {
216
216
  style: {
@@ -219,29 +219,29 @@ const D = ({ children: C, column: l, isHeaderCell: n }) => /* @__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" : ""} ${n ? `${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" : ""} ${i ? `${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
- ), H = ({ children: C, isHeaderRow: l, classes: n }) => /* @__PURE__ */ e.jsx(
225
+ ), E = ({ children: C, isHeaderRow: l, classes: i }) => /* @__PURE__ */ e.jsx(
226
226
  "div",
227
227
  {
228
- className: `hfl-flex hfl-justify-start hfl-items-stretch ${n ?? ""} ${l ? "hfl-bg-White" : "hfl-bg-White odd:hfl-bg-Gray-50"}`,
228
+ className: `hfl-flex hfl-justify-start hfl-items-stretch ${i ?? ""} ${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: n,
236
- nonPinnedColumns: x,
235
+ rightPinnedColumns: i,
236
+ nonPinnedColumns: p,
237
237
  tableBodyClassesToOverride: o,
238
238
  rowClassesForSpecificIndex: c,
239
- tableBodyParentDivRef: d
240
- } = M(), m = (s, a, h) => {
241
- const f = a[s?.field];
242
- return s?.valueFormatter ? s?.valueFormatter(f, a, s, h) : f;
243
- }, u = (s, a, h, f) => /* @__PURE__ */ e.jsx(D, { column: s, colIndex: f, rowIndex: h, children: s?.renderCell ? s?.renderCell(m(s, a, h), a, s, h) : m(s, a, h) }, `${h}-${f}`), t = (s, a, h, f) => /* @__PURE__ */ e.jsx("div", { style: { height: "inherit" }, className: f, children: s.map((p, i) => u(p, a, h, i)) }), w = (s, a) => /* @__PURE__ */ e.jsxs(
244
- H,
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(
244
+ E,
245
245
  {
246
246
  classes: `hfl-text-LightBlack-1 hfl-text-1 hfl-leading-12 hfl-font-inter-0 ${c.index === a ? c.rowClasses : ""}`,
247
247
  isHeaderRow: !1,
@@ -252,9 +252,9 @@ const D = ({ children: C, column: l, isHeaderCell: n }) => /* @__PURE__ */ e.jsx
252
252
  a,
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(x, s, a, "hfl-flex hfl-h-inherit hfl-w-full"),
255
+ t(p, s, a, "hfl-flex hfl-h-inherit hfl-w-full"),
256
256
  t(
257
- n,
257
+ i,
258
258
  s,
259
259
  a,
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"
@@ -263,43 +263,43 @@ const D = ({ children: C, column: l, isHeaderCell: n }) => /* @__PURE__ */ e.jsx
263
263
  },
264
264
  "tr" + a
265
265
  );
266
- return /* @__PURE__ */ e.jsx("div", { ref: d, className: `${o ?? ""} hfl-max-h-500`, children: C.map((s, a) => w(s, a)) });
267
- }, X = "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", I = (C) => {
266
+ return /* @__PURE__ */ e.jsx("div", { ref: h, className: `${o ?? ""} hfl-max-h-500`, children: C.map((s, a) => y(s, a)) });
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: n,
271
- filterclassname: x,
270
+ onCheck: i,
271
+ filterclassname: p,
272
272
  filterButtonStyles: o = "",
273
273
  showApplyFilter: c = !1,
274
- onApplyFilter: d,
275
- field: m,
276
- resetDropDownData: u,
274
+ onApplyFilter: h,
275
+ field: g,
276
+ resetDropDownData: x,
277
277
  showSearch: t,
278
- searchQuery: w,
278
+ searchQuery: y,
279
279
  setSearchQuery: s,
280
280
  dropdownCloseEventOnClickOutside: a
281
- } = C, h = F(null), f = F(null), p = F(null), { showDropdown: i, setShowDropdown: r } = M(), P = () => {
282
- d && d(m), r(null);
281
+ } = C, d = P(null), r = P(null), b = P(null), { showDropdown: n, setShowDropdown: u } = M(), f = () => {
282
+ h && h(g), u(null);
283
283
  };
284
284
  return j(() => {
285
- const b = (y) => {
286
- if (y.target instanceof HTMLElement) {
287
- const g = document.getElementById(`filter-button-${i}`);
288
- h.current && !h.current.contains(y.target) && g && !g.contains(y.target) && p && !p.current?.contains(y.target) && (!f.current || f && f.current && !f.current.contains(y.target)) && (c && u && u(m), r(null), a?.());
285
+ const w = (v) => {
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?.());
289
289
  }
290
290
  };
291
- return i ? document.addEventListener("mousedown", b) : document.removeEventListener("mousedown", b), () => {
292
- document.removeEventListener("mousedown", b);
291
+ return n ? document.addEventListener("mousedown", w) : document.removeEventListener("mousedown", w), () => {
292
+ document.removeEventListener("mousedown", w);
293
293
  };
294
- }, [i, h, r]), /* @__PURE__ */ e.jsxs(
294
+ }, [n, d, u]), /* @__PURE__ */ e.jsxs(
295
295
  "div",
296
296
  {
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 ${x}`,
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}`,
298
298
  children: [
299
299
  t && /* @__PURE__ */ e.jsxs(
300
300
  "div",
301
301
  {
302
- ref: p,
302
+ ref: b,
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 D = ({ children: C, column: l, isHeaderCell: n }) => /* @__PURE__ */ e.jsx
307
307
  "input",
308
308
  {
309
309
  type: "string",
310
- value: w,
310
+ value: y,
311
311
  className: "hfl-p-1 hfl-w-full focus-visible:hfl-outline-none",
312
312
  placeholder: "Search Service",
313
- onChange: (b) => {
314
- s?.(b.target.value);
313
+ onChange: (w) => {
314
+ s?.(w.target.value);
315
315
  }
316
316
  }
317
317
  )
@@ -321,26 +321,26 @@ const D = ({ children: C, column: l, isHeaderCell: n }) => /* @__PURE__ */ e.jsx
321
321
  /* @__PURE__ */ e.jsx(
322
322
  "ul",
323
323
  {
324
- ref: h,
324
+ ref: d,
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((b) => /* @__PURE__ */ e.jsx(
327
- $,
326
+ children: l.map((w) => /* @__PURE__ */ e.jsx(
327
+ D,
328
328
  {
329
- isSelected: b.isSelected,
329
+ isSelected: w.isSelected,
330
330
  isDisabled: !1,
331
- label: b.name,
332
- onCheck: n
331
+ label: w.name,
332
+ onCheck: i
333
333
  },
334
- `dropdown-option-${b.name}`
334
+ `dropdown-option-${w.name}`
335
335
  ))
336
336
  }
337
337
  ),
338
338
  c && /* @__PURE__ */ e.jsx(
339
339
  "button",
340
340
  {
341
- onClick: P,
341
+ onClick: f,
342
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: f,
343
+ ref: r,
344
344
  children: "Apply Filter"
345
345
  }
346
346
  )
@@ -351,16 +351,16 @@ const D = ({ children: C, column: l, isHeaderCell: n }) => /* @__PURE__ */ e.jsx
351
351
  const {
352
352
  leftPinnedColumns: C,
353
353
  rightPinnedColumns: l,
354
- nonPinnedColumns: n,
355
- headerRowClasses: x,
354
+ nonPinnedColumns: i,
355
+ headerRowClasses: p,
356
356
  hideHeader: o,
357
357
  showDropdown: c,
358
- setShowDropdown: d
359
- } = M(), m = R(
360
- (t, w) => /* @__PURE__ */ e.jsxs(D, { column: t, isHeaderCell: !0, colIndex: w, children: [
358
+ setShowDropdown: h
359
+ } = M(), g = S(
360
+ (t, y) => /* @__PURE__ */ e.jsxs(H, { column: t, isHeaderCell: !0, colIndex: y, 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
- E,
363
+ R,
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",
@@ -379,13 +379,13 @@ const D = ({ children: C, column: l, isHeaderCell: n }) => /* @__PURE__ */ e.jsx
379
379
  "img",
380
380
  {
381
381
  alt: "filter-icon",
382
- src: X,
383
- onClick: () => c === t?.field ? d(null) : d(t?.field),
382
+ src: I,
383
+ onClick: () => c === t?.field ? h(null) : h(t?.field),
384
384
  id: `filter-button-${t?.field}`
385
385
  }
386
386
  ),
387
387
  c === t?.field && /* @__PURE__ */ e.jsx(
388
- I,
388
+ X,
389
389
  {
390
390
  options: t?.filterValues ?? [],
391
391
  onCheck: t?.onFilterCheck ?? (() => {
@@ -402,24 +402,24 @@ const D = ({ children: C, column: l, isHeaderCell: n }) => /* @__PURE__ */ e.jsx
402
402
  dropdownCloseEventOnClickOutside: t?.dropdownCloseEventOnClickOutside
403
403
  }
404
404
  )
405
- ] }, `th-${w}`),
406
- [d, c]
407
- ), u = R(
408
- (t, w) => /* @__PURE__ */ e.jsx("div", { className: w, children: t.map((s, a) => m(s, a)) }),
409
- [m]
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)) }),
409
+ [g]
410
410
  );
411
411
  return /* @__PURE__ */ e.jsx(e.Fragment, { children: !o && /* @__PURE__ */ e.jsxs(
412
- H,
412
+ E,
413
413
  {
414
414
  isHeaderRow: !0,
415
- classes: `${x ?? ""} hfl-sticky hfl-top-0 hfl-left-0 hfl-z-20 hfl-text-LightBlack-1 hfl-text-1 hfl-leading-12 hfl-font-inter-2 hfl-border-b hfl-border-t hfl-border-Gray-200`,
415
+ classes: `${p ?? ""} hfl-sticky hfl-top-0 hfl-left-0 hfl-z-20 hfl-text-LightBlack-1 hfl-text-1 hfl-leading-12 hfl-font-inter-2 hfl-border-b hfl-border-t hfl-border-Gray-200`,
416
416
  children: [
417
- u(
417
+ x(
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
- u(n, "hfl-flex hfl-h-inherit hfl-w-full"),
422
- u(
421
+ x(i, "hfl-flex hfl-h-inherit hfl-w-full"),
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"
425
425
  )
@@ -448,40 +448,40 @@ const D = ({ children: C, column: l, isHeaderCell: n }) => /* @__PURE__ */ e.jsx
448
448
  }, J = ({
449
449
  children: C,
450
450
  initialColumns: l,
451
- rowData: n,
452
- headerRowClasses: x,
451
+ rowData: i,
452
+ headerRowClasses: p,
453
453
  rowClassesForSpecificIndex: o,
454
454
  tableBodyClassesToOverride: c,
455
- hideHeader: d,
456
- paginationProps: m,
457
- onPaginationClick: u,
455
+ hideHeader: h,
456
+ paginationProps: g,
457
+ onPaginationClick: x,
458
458
  displayPaginationClassesToOverride: t,
459
- displayNoDataFoundProps: w,
459
+ displayNoDataFoundProps: y,
460
460
  enableTableFilter: s,
461
461
  tableBodyParentDivRef: a
462
462
  }) => {
463
- const [h, f] = N(null), p = {
464
- rowsData: n,
463
+ const [d, r] = N(null), b = {
464
+ rowsData: i,
465
465
  allColumns: l,
466
- leftPinnedColumns: l.filter((i) => i.pinned === Z.Left),
467
- rightPinnedColumns: l.filter((i) => i.pinned === Z.Right),
466
+ leftPinnedColumns: l.filter((n) => n.pinned === Z.Left),
467
+ rightPinnedColumns: l.filter((n) => n.pinned === Z.Right),
468
468
  nonPinnedColumns: l.filter(
469
- (i) => i.pinned !== Z.Right && i.pinned !== Z.Left
469
+ (n) => n.pinned !== Z.Right && n.pinned !== Z.Left
470
470
  ),
471
- paginationProps: m,
472
- onPaginationClick: u,
473
- headerRowClasses: x,
471
+ paginationProps: g,
472
+ onPaginationClick: x,
473
+ headerRowClasses: p,
474
474
  rowClassesForSpecificIndex: o,
475
475
  tableBodyClassesToOverride: c,
476
- hideHeader: d,
477
- showDropdown: h,
478
- setShowDropdown: f,
476
+ hideHeader: h,
477
+ showDropdown: d,
478
+ setShowDropdown: r,
479
479
  displayPaginationClassesToOverride: t,
480
- displayNoDataFoundProps: w,
480
+ displayNoDataFoundProps: y,
481
481
  enableTableFilter: s,
482
482
  tableBodyParentDivRef: a
483
483
  };
484
- return /* @__PURE__ */ e.jsx(B.Provider, { value: p, children: C });
484
+ return /* @__PURE__ */ e.jsx($.Provider, { value: b, children: C });
485
485
  }, K = (C) => {
486
486
  const l = {
487
487
  activePage: C.paginationProps?.activePage ?? 0,
@@ -556,46 +556,46 @@ const D = ({ children: C, column: l, isHeaderCell: n }) => /* @__PURE__ */ e.jsx
556
556
  }, l2 = ({
557
557
  data: C = [],
558
558
  testDetails: l = [],
559
- enableColumnCheckbox: n = !1,
560
- tableHeaderRowClasses: x,
559
+ enableCheckboxesToSelect: i = !1,
560
+ tableHeaderRowClasses: p,
561
561
  investigationCheckBoxMap: o,
562
- onColumnCheckboxClickHandler: c
562
+ onColumnCheckboxClickHandler: c,
563
+ onRowCheckboxClickHandler: h
563
564
  }) => {
564
- const [d, m] = N([]), [u, t] = N([]), [w, s] = N([]), a = F(null);
565
+ const [g, x] = N([]), [t, y] = N([]), [s, a] = N([]), d = P(null);
565
566
  j(() => {
566
567
  if (!C.length) return;
567
- const f = [...new Set(C.map((r) => r.test_date))];
568
- t(f);
569
- const p = /* @__PURE__ */ new Map();
570
- C?.forEach((r) => {
571
- const P = l.find((y) => y?.test_id?.toString() === r?.test_id?.toString());
572
- p.has(r.test_id) || p.set(r.test_id, {
573
- created_on: r.created_on,
574
- out_of_range: r.out_of_range,
575
- test_date: r.test_date,
576
- test_id: r.test_id,
577
- test_name: P?.test_names || r.test_name,
578
- test_value: r.test_value,
579
- test_unit: P?.test_units || r.test_unit
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
580
581
  });
581
- const b = p.get(r.test_id);
582
- b[r.test_date] = r.test_value;
582
+ const v = n.get(f.test_id);
583
+ v[f.test_date] = f.test_value;
583
584
  });
584
- const i = Array.from(p.values());
585
- m(i);
585
+ const u = Array.from(n.values());
586
+ x(u);
586
587
  }, [C, l]);
587
- const h = "hfl-text-1";
588
+ const r = "hfl-text-1";
588
589
  return j(() => {
589
- console.log(n);
590
- const f = [
590
+ const b = [
591
591
  {
592
592
  field: "#",
593
593
  fieldHeaderName: "No.",
594
- renderCell: (i, r, P, b) => /* @__PURE__ */ e.jsx(e.Fragment, { children: b + 1 }),
595
594
  pinned: "left",
596
595
  width: "60px",
597
596
  minWidth: "60px",
598
- cellClasses: `${h}`
597
+ cellClasses: `${r}`,
598
+ renderCell: (u, f, w, v) => /* @__PURE__ */ e.jsx(e.Fragment, { children: v + 1 })
599
599
  },
600
600
  {
601
601
  field: "test_name",
@@ -603,12 +603,29 @@ const D = ({ children: C, column: l, isHeaderCell: n }) => /* @__PURE__ */ e.jsx
603
603
  pinned: "left",
604
604
  width: "250px",
605
605
  minWidth: "250px",
606
- cellClasses: `${h}`,
607
- enableColumnCheckbox: n,
606
+ cellClasses: `${r}`,
607
+ enableColumnCheckbox: i,
608
608
  isCheckBoxMarked: o.get("test_name"),
609
- onColumnCheckboxClick: (i) => {
610
- c("test_name", i);
611
- }
609
+ onColumnCheckboxClick: (u) => {
610
+ c("test_name", u);
611
+ },
612
+ renderCell: (u, f) => /* @__PURE__ */ e.jsxs("div", { className: "hfl-flex hfl-items-center", children: [
613
+ i && /* @__PURE__ */ e.jsx(
614
+ R,
615
+ {
616
+ size: "md",
617
+ 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
+ text: "",
619
+ onClick: (w) => {
620
+ h?.(), console.log("id", w);
621
+ },
622
+ id: `checkbox-test-${f.test_id}`,
623
+ isMarked: !0,
624
+ checkboxClasses: "hfl-gap-0"
625
+ }
626
+ ),
627
+ u
628
+ ] })
612
629
  },
613
630
  {
614
631
  field: "test_unit",
@@ -616,29 +633,35 @@ const D = ({ children: C, column: l, isHeaderCell: n }) => /* @__PURE__ */ e.jsx
616
633
  pinned: "left",
617
634
  width: "80px",
618
635
  minWidth: "80px",
619
- cellClasses: `${h}`
636
+ cellClasses: `${r}`
620
637
  }
621
- ], p = u.map((i) => ({
622
- field: i,
623
- fieldHeaderName: i,
638
+ ], n = t.map((u) => ({
639
+ field: u,
640
+ fieldHeaderName: u,
624
641
  width: "150px",
625
642
  minWidth: "150px",
626
- cellClasses: `${h}`,
627
- enableColumnCheckbox: n,
628
- isCheckBoxMarked: o.get(i),
629
- onColumnCheckboxClick: (r) => {
630
- c(i, r);
643
+ cellClasses: `${r}`,
644
+ enableColumnCheckbox: i,
645
+ isCheckBoxMarked: o.get(u),
646
+ onColumnCheckboxClick: (f) => {
647
+ c(u, f);
631
648
  }
632
649
  }));
633
- s([...f, ...p]);
634
- }, [u, n, o, c]), /* @__PURE__ */ e.jsx(
650
+ a([...b, ...n]);
651
+ }, [
652
+ t,
653
+ i,
654
+ o,
655
+ c,
656
+ h
657
+ ]), /* @__PURE__ */ e.jsx(
635
658
  K,
636
659
  {
637
- headerRowClasses: `hfl-bg-Blue_gray-50 hfl-text-Indigo-500 hfl-text-1 hfl-border ${x}`,
638
- tableRef: a,
639
- columns: w,
660
+ headerRowClasses: `hfl-bg-Blue_gray-50 hfl-text-Indigo-500 hfl-text-1 hfl-border ${p}`,
661
+ tableRef: d,
662
+ columns: s,
640
663
  tableName: "Investigations",
641
- rows: d
664
+ rows: g
642
665
  }
643
666
  );
644
667
  };