hplx-feature-library 1.0.87 → 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.
- package/dist/AllInvestigations/index.js +1 -1
- package/dist/AllInvestigationsTable-CZToe0yL.js +96 -0
- package/dist/AllInvestigationsTable-CufAOpeZ.cjs +1 -0
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/dist/AllInvestigationsTable-BpvG2JBy.js +0 -99
- package/dist/AllInvestigationsTable-ClRk37sV.cjs +0 -1
|
@@ -0,0 +1,96 @@
|
|
|
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
|
+
};
|
|
@@ -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-
|
|
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,99 +0,0 @@
|
|
|
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
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
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;
|