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