hplx-feature-library 1.0.94 → 1.0.95

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