hplx-feature-library 1.0.86 → 1.0.88

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.
@@ -7,5 +7,5 @@ interface InvestigationsTableProps {
7
7
  investigationCheckBoxMap: Map<string, boolean>;
8
8
  onColumnCheckboxClickHandler: (key: string, isClicked: boolean) => void;
9
9
  }
10
- declare const AllInvestigationsTable: ({ data, testDetails, enableColumnCheckbox, tableHeaderRowClasses, investigationCheckBoxMap, onColumnCheckboxClickHandler, }: InvestigationsTableProps) => import("react/jsx-runtime").JSX.Element;
11
- export default AllInvestigationsTable;
10
+ declare const _default: import('react').MemoExoticComponent<({ data, testDetails, enableColumnCheckbox, tableHeaderRowClasses, investigationCheckBoxMap, onColumnCheckboxClickHandler, }: InvestigationsTableProps) => import("react/jsx-runtime").JSX.Element>;
11
+ export default _default;
@@ -1,4 +1,4 @@
1
- import { A as f } from "../AllInvestigationsTable-CrkLZ6Wl.js";
1
+ import { A as f } from "../AllInvestigationsTable-CZToe0yL.js";
2
2
  export {
3
3
  f as default
4
4
  };
@@ -1,21 +1,21 @@
1
- import { j as i, u as R } from "./index-D6vi5Sgs.js";
2
- import { useState as m, useRef as j, useEffect as h } from "react";
3
- const $ = ({
1
+ import { j as l, u as R } from "./index-D6vi5Sgs.js";
2
+ import { memo as $, useState as m, useRef as j, useEffect as x, useMemo as D } from "react";
3
+ const A = ({
4
4
  data: n = [],
5
5
  testDetails: c = [],
6
- enableColumnCheckbox: l,
7
- tableHeaderRowClasses: p,
6
+ enableColumnCheckbox: i = !1,
7
+ tableHeaderRowClasses: u,
8
8
  investigationCheckBoxMap: o,
9
9
  onColumnCheckboxClickHandler: d
10
10
  }) => {
11
- const [x, g] = m([]), [u, w] = m([]), [v, C] = m([]), b = j(null);
12
- h(() => {
11
+ const [g, v] = m([]), [h, w] = m([]), [p, C] = m([]), N = j(null);
12
+ x(() => {
13
13
  if (!n.length) return;
14
14
  const r = [...new Set(n.map((e) => e.test_date))];
15
15
  w(r);
16
16
  const s = /* @__PURE__ */ new Map();
17
17
  n.forEach((e) => {
18
- const _ = c.find((N) => N?.test_id?.toString() === e?.test_id?.toString());
18
+ const _ = c.find((I) => I?.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,15 +29,16 @@ const $ = ({
29
29
  f[e.test_date] = e.test_value;
30
30
  });
31
31
  const t = Array.from(s.values());
32
- g(t);
32
+ v(t);
33
33
  }, [n, c]);
34
34
  const a = "hfl-text-1";
35
- return h(() => {
35
+ x(() => {
36
+ console.log(i);
36
37
  const r = [
37
38
  {
38
39
  field: "#",
39
40
  fieldHeaderName: "No.",
40
- renderCell: (t, e, _, f) => /* @__PURE__ */ i.jsx(i.Fragment, { children: f + 1 }),
41
+ renderCell: (t, e, _, f) => /* @__PURE__ */ l.jsx(l.Fragment, { children: f + 1 }),
41
42
  pinned: "left",
42
43
  width: "60px",
43
44
  minWidth: "60px",
@@ -50,7 +51,7 @@ const $ = ({
50
51
  width: "250px",
51
52
  minWidth: "250px",
52
53
  cellClasses: `${a}`,
53
- enabledColumnCheckbox: l,
54
+ enabledColumnCheckbox: i,
54
55
  isCheckboxMarked: o.get("test_name"),
55
56
  onColumnCheckboxClick: (t) => {
56
57
  d("test_name", t);
@@ -64,30 +65,32 @@ const $ = ({
64
65
  minWidth: "80px",
65
66
  cellClasses: `${a}`
66
67
  }
67
- ], s = u.map((t) => ({
68
+ ], s = h.map((t) => ({
68
69
  field: t,
69
70
  fieldHeaderName: t,
70
71
  width: "150px",
71
72
  minWidth: "150px",
72
73
  cellClasses: `${a}`,
73
- enabledColumnCheckbox: l,
74
+ enabledColumnCheckbox: i,
74
75
  isCheckboxMarked: o.get(t),
75
76
  onColumnCheckboxClick: (e) => {
76
77
  d(t, e);
77
78
  }
78
79
  }));
79
80
  C([...r, ...s]);
80
- }, [u, l, o, d]), /* @__PURE__ */ i.jsx("div", { className: "", children: /* @__PURE__ */ i.jsx(
81
+ }, [h, i, o, d]);
82
+ const b = D(() => /* @__PURE__ */ l.jsx(
81
83
  R,
82
84
  {
83
- headerRowClasses: `hfl-bg-Blue_gray-50 hfl-text-Indigo-500 hfl-text-1 hfl-border ${p}`,
84
- tableRef: b,
85
- columns: v,
85
+ headerRowClasses: `hfl-bg-Blue_gray-50 hfl-text-Indigo-500 hfl-text-1 hfl-border ${u}`,
86
+ tableRef: N,
87
+ columns: p,
86
88
  tableName: "Investigations",
87
- rows: x
89
+ rows: g
88
90
  }
89
- ) });
90
- };
91
+ ), [p, g, u]);
92
+ return /* @__PURE__ */ l.jsx("div", { className: "", children: b });
93
+ }, E = $(A);
91
94
  export {
92
- $ as A
95
+ E as A
93
96
  };
@@ -0,0 +1 @@
1
+ "use strict";const i=require("./index-D-wXK-PO.cjs"),s=require("react"),C=({data:a=[],testDetails:f=[],enableColumnCheckbox:l=!1,tableHeaderRowClasses:m,investigationCheckBoxMap:d,onColumnCheckboxClickHandler:r})=>{const[x,p]=s.useState([]),[g,v]=s.useState([]),[h,w]=s.useState([]),R=s.useRef(null);s.useEffect(()=>{if(!a.length)return;const u=[...new Set(a.map(e=>e.test_date))];v(u);const n=new Map;a.forEach(e=>{const c=f.find(j=>j?.test_id?.toString()===e?.test_id?.toString());n.has(e.test_id)||n.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:c?.test_names||e.test_name,test_value:e.test_value,test_unit:c?.test_units||e.test_unit});const _=n.get(e.test_id);_[e.test_date]=e.test_value});const t=Array.from(n.values());p(t)},[a,f]);const o="hfl-text-1";s.useEffect(()=>{console.log(l);const u=[{field:"#",fieldHeaderName:"No.",renderCell:(t,e,c,_)=>i.jsxRuntimeExports.jsx(i.jsxRuntimeExports.Fragment,{children:_+1}),pinned:"left",width:"60px",minWidth:"60px",cellClasses:`${o}`},{field:"test_name",fieldHeaderName:"Tests / Investigations",pinned:"left",width:"250px",minWidth:"250px",cellClasses:`${o}`,enabledColumnCheckbox:l,isCheckboxMarked:d.get("test_name"),onColumnCheckboxClick:t=>{r("test_name",t)}},{field:"test_unit",fieldHeaderName:"Units",pinned:"left",width:"80px",minWidth:"80px",cellClasses:`${o}`}],n=g.map(t=>({field:t,fieldHeaderName:t,width:"150px",minWidth:"150px",cellClasses:`${o}`,enabledColumnCheckbox:l,isCheckboxMarked:d.get(t),onColumnCheckboxClick:e=>{r(t,e)}}));w([...u,...n])},[g,l,d,r]);const b=s.useMemo(()=>i.jsxRuntimeExports.jsx(i.uO,{headerRowClasses:`hfl-bg-Blue_gray-50 hfl-text-Indigo-500 hfl-text-1 hfl-border ${m}`,tableRef:R,columns:h,tableName:"Investigations",rows:x}),[h,x,m]);return i.jsxRuntimeExports.jsx("div",{className:"",children:b})},E=s.memo(C);exports.AllInvestigationsTable=E;
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { P as r } from "./PediatricsCalculatorTable-DelYgJEq.js";
2
- import { A as a } from "./AllInvestigationsTable-CrkLZ6Wl.js";
2
+ import { A as a } from "./AllInvestigationsTable-CZToe0yL.js";
3
3
  import { A as f } from "./AlertPopup-BNDuLUqA.js";
4
4
  import { default as p } from "./CustomDropdown/index.js";
5
5
  import { default as u } from "./DateTimePicker/DateAndTimePicker/index.js";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "hplx-feature-library",
3
3
  "private": false,
4
- "version": "1.0.86",
4
+ "version": "1.0.88",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "dev": "npm i hplx-react-elements-dev@qa && vite",
@@ -1 +0,0 @@
1
- "use strict";const i=require("./index-D-wXK-PO.cjs"),n=require("react"),b=({data:a=[],testDetails:f=[],enableColumnCheckbox:o,tableHeaderRowClasses:x,investigationCheckBoxMap:d,onColumnCheckboxClickHandler:r})=>{const[h,g]=n.useState([]),[m,p]=n.useState([]),[v,w]=n.useState([]),C=n.useRef(null);n.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";return n.useEffect(()=>{const u=[{field:"#",fieldHeaderName:"No.",renderCell:(t,e,_,c)=>i.jsxRuntimeExports.jsx(i.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)}}));w([...u,...s])},[m,o,d,r]),i.jsxRuntimeExports.jsx("div",{className:"",children:i.jsxRuntimeExports.jsx(i.uO,{headerRowClasses:`hfl-bg-Blue_gray-50 hfl-text-Indigo-500 hfl-text-1 hfl-border ${x}`,tableRef:C,columns:v,tableName:"Investigations",rows:h})})};exports.AllInvestigationsTable=b;