hplx-feature-library 1.0.70 → 1.0.71

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.
@@ -0,0 +1,7 @@
1
+ import { I_InvestigationsByDate, I_TestRanges } from '../../types/AllInvestigationTypes';
2
+ interface InvestigationsTableProps {
3
+ data: I_InvestigationsByDate[];
4
+ testDetails: I_TestRanges[];
5
+ }
6
+ declare const AllInvestigationsTable: ({ data, testDetails }: InvestigationsTableProps) => import("react/jsx-runtime").JSX.Element;
7
+ export default AllInvestigationsTable;
@@ -0,0 +1 @@
1
+ export { default } from './components/AllInvestigationsTable';
@@ -0,0 +1,4 @@
1
+ import { A as f } from "../AllInvestigationsTable-DA2nD9k6.js";
2
+ export {
3
+ f as default
4
+ };
@@ -0,0 +1,2 @@
1
+ import { I_InvestigationsByDate } from '../../types/AllInvestigationTypes';
2
+ export declare const mockData: I_InvestigationsByDate[];
@@ -0,0 +1 @@
1
+ "use strict";const i=require("./index-BojgO48C.cjs"),a=require("react"),v=({data:l=[],testDetails:u=[]})=>{const[_,f]=a.useState([]),[c,m]=a.useState([]),x=a.useRef(null);a.useEffect(()=>{if(!l.length)return;const r=[...new Set(l.map(s=>s.test_date))];m(r);const t=new Map;l.forEach(s=>{s.tests.forEach(e=>{const d=u.find(g=>g.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:s.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 p=t.get(e.test_id);p[s.test_date]=e.test_value})});const n=Array.from(t.values());f(n)},[l,u]);const o="hfl-text-1",h=a.useMemo(()=>{const r=[{field:"#",fieldHeaderName:"No.",renderCell:(n,s,e,d)=>i.jsxRuntimeExports.jsx(i.jsxRuntimeExports.Fragment,{children:d+1}),pinned:"left",width:"60px",minWidth:"60px",cellClasses:`${o}`},{field:"test_name",fieldHeaderName:"Tests / Investigations",pinned:"left",width:"250px",minWidth:"250px",cellClasses:`${o}`},{field:"test_unit",fieldHeaderName:"Units",pinned:"left",width:"80px",minWidth:"80px",cellClasses:`${o}`}],t=c.map(n=>({field:n,fieldHeaderName:n,width:"150px",minWidth:"150px",cellClasses:`${o}`}));return[...r,...t]},[c]);return 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",tableRef:x,columns:h,tableName:"Investigations",rows:_})})};exports.AllInvestigationsTable=v;
@@ -0,0 +1,78 @@
1
+ import { j as o, u as v } from "./index-BocogwgJ.js";
2
+ import { useState as f, useRef as w, useEffect as C, useMemo as N } from "react";
3
+ const j = ({ data: a = [], testDetails: r = [] }) => {
4
+ const [c, u] = f([]), [_, m] = f([]), h = w(null);
5
+ C(() => {
6
+ if (!a.length) return;
7
+ const d = [...new Set(a.map((s) => s.test_date))];
8
+ m(d);
9
+ const t = /* @__PURE__ */ new Map();
10
+ a.forEach((s) => {
11
+ s.tests.forEach((e) => {
12
+ const l = r.find((g) => g.test_id.toString() === e.test_id.toString());
13
+ t.has(e.test_id) || t.set(e.test_id, {
14
+ created_on: e.created_on,
15
+ out_of_range: e.out_of_range,
16
+ test_date: s.test_date,
17
+ test_id: e.test_id,
18
+ test_name: l?.test_names || e.test_name,
19
+ test_value: e.test_value,
20
+ test_unit: l?.test_units || e.test_unit
21
+ });
22
+ const x = t.get(e.test_id);
23
+ x[s.test_date] = e.test_value;
24
+ });
25
+ });
26
+ const n = Array.from(t.values());
27
+ u(n);
28
+ }, [a, r]);
29
+ const i = "hfl-text-1", p = N(() => {
30
+ const d = [
31
+ {
32
+ field: "#",
33
+ fieldHeaderName: "No.",
34
+ renderCell: (n, s, e, l) => /* @__PURE__ */ o.jsx(o.Fragment, { children: l + 1 }),
35
+ pinned: "left",
36
+ width: "60px",
37
+ minWidth: "60px",
38
+ cellClasses: `${i}`
39
+ },
40
+ {
41
+ field: "test_name",
42
+ fieldHeaderName: "Tests / Investigations",
43
+ pinned: "left",
44
+ width: "250px",
45
+ minWidth: "250px",
46
+ cellClasses: `${i}`
47
+ },
48
+ {
49
+ field: "test_unit",
50
+ fieldHeaderName: "Units",
51
+ pinned: "left",
52
+ width: "80px",
53
+ minWidth: "80px",
54
+ cellClasses: `${i}`
55
+ }
56
+ ], t = _.map((n) => ({
57
+ field: n,
58
+ fieldHeaderName: n,
59
+ width: "150px",
60
+ minWidth: "150px",
61
+ cellClasses: `${i}`
62
+ }));
63
+ return [...d, ...t];
64
+ }, [_]);
65
+ return /* @__PURE__ */ o.jsx("div", { className: "", children: /* @__PURE__ */ o.jsx(
66
+ v,
67
+ {
68
+ headerRowClasses: "hfl-bg-Blue_gray-50 hfl-text-Indigo-500 hfl-text-1 hfl-border",
69
+ tableRef: h,
70
+ columns: p,
71
+ tableName: "Investigations",
72
+ rows: c
73
+ }
74
+ ) });
75
+ };
76
+ export {
77
+ j as A
78
+ };
package/dist/index.d.ts CHANGED
@@ -3,4 +3,4 @@ export { default as CustomDropdown } from './components/CustomDropdown';
3
3
  export { default as ToggleButtons } from './components/ToggleButtons';
4
4
  export { default as DateAndTimePicker } from './components/datepicker/DateAndTimePicker';
5
5
  export { default as PediatricsCalculator } from './PediatricsCalculator';
6
- export { default as Investigations } from './Investigations';
6
+ export { default as AllInvestigations } from './AllInvestigations';