hplx-feature-library 1.0.83 → 1.0.85

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,4 +1,4 @@
1
- import { A as f } from "../AllInvestigationsTable-RWRitNq3.js";
1
+ import { A as f } from "../AllInvestigationsTable-HZvjAr2s.js";
2
2
  export {
3
3
  f as default
4
4
  };
@@ -0,0 +1 @@
1
+ "use strict";const n=require("./index-D-wXK-PO.cjs"),i=require("react"),C=({data:a=[],testDetails:f=[],enableColumnCheckbox:o,tableHeaderRowClasses:x,investigationCheckBoxMap:d,onColumnCheckboxClickHandler:r})=>{const[h,g]=i.useState([]),[m,p]=i.useState([]),v=i.useRef(null);i.useEffect(()=>{if(!a.length)return;const u=[...new Set(a.map(e=>e.test_date))];p(u);const s=new Map;a.forEach(e=>{const _=f.find(R=>R?.test_id?.toString()===e?.test_id?.toString());s.has(e.test_id)||s.set(e.test_id,{created_on:e.created_on,out_of_range:e.out_of_range,test_date:e.test_date,test_id:e.test_id,test_name:_?.test_names||e.test_name,test_value:e.test_value,test_unit:_?.test_units||e.test_unit});const c=s.get(e.test_id);c[e.test_date]=e.test_value});const t=Array.from(s.values());g(t)},[a,f]);const l="hfl-text-1",w=i.useMemo(()=>{const u=[{field:"#",fieldHeaderName:"No.",renderCell:(t,e,_,c)=>n.jsxRuntimeExports.jsx(n.jsxRuntimeExports.Fragment,{children:c+1}),pinned:"left",width:"60px",minWidth:"60px",cellClasses:`${l}`},{field:"test_name",fieldHeaderName:"Tests / Investigations",pinned:"left",width:"250px",minWidth:"250px",cellClasses:`${l}`,enabledColumnCheckbox:o,isCheckboxMarked:d.get("test_name"),onColumnCheckboxClick:t=>{r("test_name",t)}},{field:"test_unit",fieldHeaderName:"Units",pinned:"left",width:"80px",minWidth:"80px",cellClasses:`${l}`}],s=m.map(t=>({field:t,fieldHeaderName:t,width:"150px",minWidth:"150px",cellClasses:`${l}`,enabledColumnCheckbox:o,isCheckboxMarked:d.get(t),onColumnCheckboxClick:e=>{r(t,e)}}));return[...u,...s]},[m,o,d,r]);return n.jsxRuntimeExports.jsx("div",{className:"",children:n.jsxRuntimeExports.jsx(n.uO,{headerRowClasses:`hfl-bg-Blue_gray-50 hfl-text-Indigo-500 hfl-text-1 hfl-border ${x}`,tableRef:v,columns:w,tableName:"Investigations",rows:h})})};exports.AllInvestigationsTable=C;
@@ -1,21 +1,21 @@
1
- import { j as a, u as R } from "./index-D6vi5Sgs.js";
2
- import { useState as c, useRef as j, useEffect as C, useMemo as D } from "react";
3
- const S = ({
1
+ import { j as i, u as b } from "./index-D6vi5Sgs.js";
2
+ import { useState as c, useRef as N, useEffect as R, useMemo as j } from "react";
3
+ const $ = ({
4
4
  data: n = [],
5
5
  testDetails: m = [],
6
6
  enableColumnCheckbox: l,
7
7
  tableHeaderRowClasses: h,
8
- investigationCheckBoxMap: d,
9
- onColumnCheckboxClickHandler: o
8
+ investigationCheckBoxMap: o,
9
+ onColumnCheckboxClickHandler: d
10
10
  }) => {
11
- const [p, g] = c([]), [u, x] = c([]), w = j(null);
12
- C(() => {
11
+ const [p, x] = c([]), [u, g] = c([]), w = N(null);
12
+ R(() => {
13
13
  if (!n.length) return;
14
14
  const r = [...new Set(n.map((e) => e.test_date))];
15
- x(r);
15
+ g(r);
16
16
  const s = /* @__PURE__ */ new Map();
17
17
  n.forEach((e) => {
18
- const _ = m.find((N) => N?.test_id?.toString() === e?.test_id?.toString());
18
+ const _ = m.find((C) => C?.test_id?.toString() === e?.test_id?.toString());
19
19
  s.has(e.test_id) || s.set(e.test_id, {
20
20
  created_on: e.created_on,
21
21
  out_of_range: e.out_of_range,
@@ -29,18 +29,18 @@ const S = ({
29
29
  f[e.test_date] = e.test_value;
30
30
  });
31
31
  const t = Array.from(s.values());
32
- g(t);
32
+ x(t);
33
33
  }, [n, m]);
34
- const i = "hfl-text-1", v = D(() => {
34
+ const a = "hfl-text-1", v = j(() => {
35
35
  const r = [
36
36
  {
37
37
  field: "#",
38
38
  fieldHeaderName: "No.",
39
- renderCell: (t, e, _, f) => /* @__PURE__ */ a.jsx(a.Fragment, { children: f + 1 }),
39
+ renderCell: (t, e, _, f) => /* @__PURE__ */ i.jsx(i.Fragment, { children: f + 1 }),
40
40
  pinned: "left",
41
41
  width: "60px",
42
42
  minWidth: "60px",
43
- cellClasses: `${i}`
43
+ cellClasses: `${a}`
44
44
  },
45
45
  {
46
46
  field: "test_name",
@@ -48,11 +48,11 @@ const S = ({
48
48
  pinned: "left",
49
49
  width: "250px",
50
50
  minWidth: "250px",
51
- cellClasses: `${i}`,
52
- enableColumnCheckbox: l,
53
- isCheckboxMarked: d.get("test_name"),
51
+ cellClasses: `${a}`,
52
+ enabledColumnCheckbox: l,
53
+ isCheckboxMarked: o.get("test_name"),
54
54
  onColumnCheckboxClick: (t) => {
55
- o("test_name", t);
55
+ d("test_name", t);
56
56
  }
57
57
  },
58
58
  {
@@ -61,24 +61,24 @@ const S = ({
61
61
  pinned: "left",
62
62
  width: "80px",
63
63
  minWidth: "80px",
64
- cellClasses: `${i}`
64
+ cellClasses: `${a}`
65
65
  }
66
66
  ], s = u.map((t) => ({
67
67
  field: t,
68
68
  fieldHeaderName: t,
69
69
  width: "150px",
70
70
  minWidth: "150px",
71
- cellClasses: `${i}`,
72
- enableColumnCheckbox: l,
73
- isCheckboxMarked: d.get(t),
71
+ cellClasses: `${a}`,
72
+ enabledColumnCheckbox: l,
73
+ isCheckboxMarked: o.get(t),
74
74
  onColumnCheckboxClick: (e) => {
75
- o(t, e);
75
+ d(t, e);
76
76
  }
77
77
  }));
78
78
  return [...r, ...s];
79
- }, [u, l, d, o]);
80
- return /* @__PURE__ */ a.jsx("div", { className: "", children: /* @__PURE__ */ a.jsx(
81
- R,
79
+ }, [u, l, o, d]);
80
+ return /* @__PURE__ */ i.jsx("div", { className: "", children: /* @__PURE__ */ i.jsx(
81
+ b,
82
82
  {
83
83
  headerRowClasses: `hfl-bg-Blue_gray-50 hfl-text-Indigo-500 hfl-text-1 hfl-border ${h}`,
84
84
  tableRef: w,
@@ -89,5 +89,5 @@ const S = ({
89
89
  ) });
90
90
  };
91
91
  export {
92
- S as A
92
+ $ as A
93
93
  };