hplx-feature-library 1.0.82 → 1.0.83

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