hplx-feature-library 1.0.200 → 1.0.202
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/{APIAction-l6i46qgX.js → APIAction-BpUGTq-P.js} +23 -24
- package/dist/APIAction-Dh8yXpE0.cjs +1 -0
- package/dist/Attachments/index.js +1 -1
- package/dist/{Attachments-BzZHI8d3.js → Attachments-3UkuRnaT.js} +6297 -6180
- package/dist/Attachments-B9GrTokn.cjs +202 -0
- package/dist/PatientAddEdit/index.js +1 -1
- package/dist/PatientAddEdit-DKtOZH2N.cjs +7 -0
- package/dist/{PatientAddEdit-CPjv2_ZF.js → PatientAddEdit-DjNwzBQV.js} +18 -20
- package/dist/PatientPopup/index.js +1 -1
- package/dist/PatientPopupContainer-Bg9zUots.cjs +36 -0
- package/dist/{PatientPopupContainer-Bf80eZlB.js → PatientPopupContainer-RxozPrZy.js} +47 -49
- package/dist/PediatricsCalculator/index.js +1 -1
- package/dist/PediatricsCalculatorTable-bTvt7SWQ.cjs +9 -0
- package/dist/{PediatricsCalculatorTable-G0ttbDpi.js → PediatricsCalculatorTable-qu37FR7D.js} +236 -228
- package/dist/{PrintModal-ifEeax6V.js → PrintModal-D4AX-Rz-.js} +3203 -3215
- package/dist/{PrintModal-Db9_gQic.cjs → PrintModal-DYCkcIdD.cjs} +52 -50
- package/dist/{ReusableModal-CIgDYOWZ.cjs → ReusableModal-2GKjVVbf.cjs} +1 -1
- package/dist/{ReusableModal-CT4_gW1b.js → ReusableModal-BL_DwV8I.js} +1 -1
- package/dist/SearchPatients/index.js +1 -1
- package/dist/{SearchPatients-BYGGaUoD.js → SearchPatients-B34Jmyh7.js} +3 -3
- package/dist/{SearchPatients-BXNWucYz.cjs → SearchPatients-CKu0XGDw.cjs} +1 -1
- package/dist/common-utils-B6431-iN.js +2657 -0
- package/dist/common-utils-DeErqLTB.cjs +6 -0
- package/dist/hplx-feature-library.css +1 -1
- package/dist/{index-T1lUjzhG.js → index-BzwuwvT5.js} +1 -1
- package/dist/{index-DQlbIHh3.cjs → index-CJ2AKRoq.cjs} +26 -26
- package/dist/{index-DkA8S5IK.cjs → index-CRCsQdYf.cjs} +1 -1
- package/dist/{index-Bd0CDVpH.js → index-UPYT3B9g.js} +2 -3
- package/dist/index.d.ts +0 -3
- package/dist/index.js +12 -18
- package/dist/nineDots/index.d.ts +0 -1
- package/dist/print-pdf/index.js +1 -1
- package/dist/types/CommonTypes.d.ts +1 -1
- package/dist/userProfile/index.d.ts +0 -1
- package/package.json +9 -14
- package/dist/APIAction-5-3i1gGx.cjs +0 -1
- package/dist/AllInvestigations/components/AllInvestigationsTable.d.ts +0 -19
- package/dist/AllInvestigations/index.d.ts +0 -1
- package/dist/AllInvestigations/index.js +0 -4
- package/dist/AllInvestigations/utils/test-tange-util.d.ts +0 -8
- package/dist/AllInvestigationsTable-BDLPOHjr.cjs +0 -79
- package/dist/AllInvestigationsTable-Dg-YXASz.js +0 -17065
- package/dist/Attachments-CziD-_gm.cjs +0 -186
- package/dist/CommonConstant-Bj7SvPfU.js +0 -436
- package/dist/CommonConstant-COHqiSWL.cjs +0 -1
- package/dist/NineDots/index.js +0 -4
- package/dist/NineDots-BEzE3Pj8.cjs +0 -3
- package/dist/NineDots-CCtE2t9I.js +0 -1788
- package/dist/PatientAddEdit-UFho4sOA.cjs +0 -7
- package/dist/PatientPopupContainer-SfsdSNpR.cjs +0 -36
- package/dist/PediatricsCalculatorTable-B4fTy1J5.cjs +0 -9
- package/dist/ReusableTable/ReusableTable.d.ts +0 -3
- package/dist/ReusableTable/ReusableTableConstants.d.ts +0 -8
- package/dist/ReusableTable/ReusableTableTypes.d.ts +0 -96
- package/dist/ReusableTable/components/EmptyTableContainer.d.ts +0 -12
- package/dist/ReusableTable/components/FilterCheckbox.d.ts +0 -8
- package/dist/ReusableTable/components/FilterDropdown.d.ts +0 -17
- package/dist/ReusableTable/components/Pagination.d.ts +0 -2
- package/dist/ReusableTable/components/TableBody.d.ts +0 -2
- package/dist/ReusableTable/components/TableCell.d.ts +0 -3
- package/dist/ReusableTable/components/TableFilterSelect.d.ts +0 -12
- package/dist/ReusableTable/components/TableHead.d.ts +0 -2
- package/dist/ReusableTable/components/TableMain.d.ts +0 -2
- package/dist/ReusableTable/components/TableRow.d.ts +0 -3
- package/dist/ReusableTable/context/TableContext.d.ts +0 -21
- package/dist/ReusableTable/context/TableContextBase.d.ts +0 -26
- package/dist/ReusableTable/context/useTableContext.d.ts +0 -2
- package/dist/TrendGraphs/AreaChartComponent.d.ts +0 -9
- package/dist/TrendGraphs/LineChartComponent/DataPointToolTip.d.ts +0 -16
- package/dist/TrendGraphs/LineChartComponent/LineChartBody.d.ts +0 -2
- package/dist/TrendGraphs/LineChartComponent/LineChartHeader.d.ts +0 -2
- package/dist/TrendGraphs/LineChartComponent/index.d.ts +0 -2
- package/dist/TrendGraphs/context/index.d.ts +0 -2
- package/dist/TrendGraphs/hooks/useTrendGraphContext.d.ts +0 -2
- package/dist/TrendGraphs/utils/index.d.ts +0 -4
- package/dist/UserProfile/index.js +0 -4
- package/dist/UserProfile-CcEbhDhd.js +0 -1761
- package/dist/UserProfile-DkQgWGvV.cjs +0 -14
- package/dist/clsx-C11secjj.cjs +0 -1
- package/dist/clsx-OuTLNxxd.js +0 -16
- package/dist/common-utils-CJv4_aVl.cjs +0 -6
- package/dist/common-utils-Dq5TMP7t.js +0 -1952
- package/dist/components/Modal.d.ts +0 -5
- package/dist/constants/TrendGraphsConstants.d.ts +0 -2
- package/dist/dayjs.min-D52_GdfV.js +0 -284
- package/dist/dayjs.min-DXp74Ozx.cjs +0 -1
- package/dist/index-CJFGOBPb.js +0 -122
- package/dist/index-DfcUmlge.cjs +0 -17
- package/dist/types/AllInvestigationTypes/index.js +0 -4
- package/dist/types/AllInvestigationTypes.d.ts +0 -45
- package/dist/types/NineDotsTypes/index.js +0 -1
- package/dist/types/TrendGraphTypes.d.ts +0 -19
- package/dist/useClickOutside-BjJyGTec.js +0 -14
- package/dist/useClickOutside-DsVG12Cs.cjs +0 -1
package/dist/{PediatricsCalculatorTable-G0ttbDpi.js → PediatricsCalculatorTable-qu37FR7D.js}
RENAMED
|
@@ -1,48 +1,47 @@
|
|
|
1
|
-
import { j as e, b as
|
|
2
|
-
import be, { createContext as Ge, useContext as Ve, useState as G, useRef as pe, useMemo as re, useCallback as W,
|
|
1
|
+
import { j as e, b as L, O as Ee, K as oe, N as Re, d as ue, g as We } from "./index-UPYT3B9g.js";
|
|
2
|
+
import be, { createContext as Ge, useContext as Ve, useEffect as X, useState as G, useRef as pe, useMemo as re, useCallback as W, forwardRef as Pe, useImperativeHandle as Ke } from "react";
|
|
3
3
|
import { C_MedicineCalculatorList as _e, C_FrequencyDosageMap as Me, C_MedicineTypeList as we, C_MedicineFrequencyList as Se, C_DefaultMgKgFields as Je, C_DefaultMlKgFields as Ye, C_Table_Column_Name as Ue } from "./constants/PediatricsCalculatorConstants/index.js";
|
|
4
|
-
import { u as Xe } from "./
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
effectiveEditMode: a,
|
|
4
|
+
import { u as Xe } from "./useOutsideClick-C4Q0aGuf.js";
|
|
5
|
+
import { M as Fe } from "./index-BzwuwvT5.js";
|
|
6
|
+
const Oe = Ge(null), Le = () => {
|
|
7
|
+
const n = Ve(Oe);
|
|
8
|
+
if (!n) throw new Error("usePediatricsCalculatorTableContext must be used inside a MedicineTableProvider");
|
|
9
|
+
return n;
|
|
10
|
+
}, Ze = ({
|
|
11
|
+
effectiveEditMode: n,
|
|
13
12
|
rowData: t,
|
|
14
|
-
isSavedToLibrary:
|
|
15
|
-
onSave:
|
|
16
|
-
onCancel:
|
|
13
|
+
isSavedToLibrary: p,
|
|
14
|
+
onSave: y,
|
|
15
|
+
onCancel: g,
|
|
17
16
|
onEdit: N,
|
|
18
17
|
onCheckboxToggle: i
|
|
19
18
|
}) => {
|
|
20
|
-
const { variant: C, externallyTriggeredEditMode: w, setRowToDelete:
|
|
21
|
-
return C === "standard" ?
|
|
19
|
+
const { variant: C, externallyTriggeredEditMode: w, setRowToDelete: _, openPopupForRow: k } = Le();
|
|
20
|
+
return C === "standard" ? n ? /* @__PURE__ */ e.jsxs("div", { className: "hfl-grid hfl-grid-cols-[1fr_1fr] hfl-border-1 hfl-border-Gray-200 hfl-rounded-lg ", children: [
|
|
22
21
|
/* @__PURE__ */ e.jsx(
|
|
23
22
|
"button",
|
|
24
23
|
{
|
|
25
24
|
className: "hfl-px-3 hfl-py-1 hfl-text-Blue_gray-800 hfl-border-r-1 hover:hfl-bg-Primary-50",
|
|
26
|
-
onClick:
|
|
27
|
-
children: /* @__PURE__ */ e.jsx(
|
|
25
|
+
onClick: y,
|
|
26
|
+
children: /* @__PURE__ */ e.jsx(L, { variant: "Medium", type: "Text xs", className: "hfl-text-Blue_gray-800", children: "Save" })
|
|
28
27
|
}
|
|
29
28
|
),
|
|
30
|
-
/* @__PURE__ */ e.jsx("button", { className: "hfl-px-3 hfl-py-2 hfl-text-Error-600 hover:hfl-bg-Error-50", onClick:
|
|
29
|
+
/* @__PURE__ */ e.jsx("button", { className: "hfl-px-3 hfl-py-2 hfl-text-Error-600 hover:hfl-bg-Error-50", onClick: g, children: /* @__PURE__ */ e.jsx(L, { variant: "Medium", type: "Text xs", className: "", children: "Cancel" }) })
|
|
31
30
|
] }) : /* @__PURE__ */ e.jsxs("div", { className: "hfl-grid hfl-grid-cols-[1fr_1fr_1fr] hfl-border-1 hfl-border-Gray-200 hfl-rounded-lg", children: [
|
|
32
|
-
/* @__PURE__ */ e.jsx("button", { className: "hfl-px-3 hfl-py-1 hfl-text-Blue_gray-800 hover:hfl-bg-Primary-50", onClick: N, children: /* @__PURE__ */ e.jsx(
|
|
31
|
+
/* @__PURE__ */ e.jsx("button", { className: "hfl-px-3 hfl-py-1 hfl-text-Blue_gray-800 hover:hfl-bg-Primary-50", onClick: N, children: /* @__PURE__ */ e.jsx(L, { variant: "Medium", type: "Text xs", className: "", children: "Edit" }) }),
|
|
33
32
|
/* @__PURE__ */ e.jsx(
|
|
34
33
|
"button",
|
|
35
34
|
{
|
|
36
35
|
className: "hfl-px-3 hfl-py-2 hfl-text-Blue_gray-800 hfl-border-x-1 hover:hfl-bg-Primary-50",
|
|
37
36
|
onClick: () => k?.(t),
|
|
38
|
-
children: /* @__PURE__ */ e.jsx(
|
|
37
|
+
children: /* @__PURE__ */ e.jsx(L, { variant: "Medium", type: "Text xs", className: "", children: "Copy" })
|
|
39
38
|
}
|
|
40
39
|
),
|
|
41
40
|
/* @__PURE__ */ e.jsx(
|
|
42
41
|
"button",
|
|
43
42
|
{
|
|
44
43
|
className: "hx_delete hfl-px-3 hfl-py-2 hfl-text-Error-500 hover:hfl-bg-Error-50",
|
|
45
|
-
onClick: () =>
|
|
44
|
+
onClick: () => _?.(t.rowId)
|
|
46
45
|
}
|
|
47
46
|
)
|
|
48
47
|
] }) : /* @__PURE__ */ e.jsx(
|
|
@@ -53,48 +52,57 @@ const Oe = Ge(null), $e = () => {
|
|
|
53
52
|
id: t.rowId,
|
|
54
53
|
size: "md",
|
|
55
54
|
onClick: i,
|
|
56
|
-
isMarked:
|
|
55
|
+
isMarked: p ?? !1,
|
|
57
56
|
checkboxClasses: "hfl-mt-2",
|
|
58
57
|
checkBoxInnerDivClasses: "hfl-text-Blue-600 hfl-bg-Blue-50"
|
|
59
58
|
},
|
|
60
59
|
t.rowId
|
|
61
60
|
);
|
|
61
|
+
}, Qe = (n, t) => {
|
|
62
|
+
X(() => {
|
|
63
|
+
const p = (y) => {
|
|
64
|
+
n.current && !n.current.contains(y.target) && t();
|
|
65
|
+
};
|
|
66
|
+
return document.addEventListener("mousedown", p), () => {
|
|
67
|
+
document.removeEventListener("mousedown", p);
|
|
68
|
+
};
|
|
69
|
+
}, [n, t]);
|
|
62
70
|
};
|
|
63
|
-
function el(
|
|
64
|
-
const { options: t, selectedOption:
|
|
65
|
-
return /* @__PURE__ */ e.jsx("div", { className: "hfl-flex hfl-gap-2 hfl-h-full hfl-items-center hfl-px-4 hfl-justify-center hfl-py-1", children: t?.map((
|
|
71
|
+
function el(n) {
|
|
72
|
+
const { options: t, selectedOption: p, onChangeHandler: y } = n;
|
|
73
|
+
return /* @__PURE__ */ e.jsx("div", { className: "hfl-flex hfl-gap-2 hfl-h-full hfl-items-center hfl-px-4 hfl-justify-center hfl-py-1", children: t?.map((g) => /* @__PURE__ */ e.jsx("div", { className: "hfl-bg-White hfl-rounded-lg", children: /* @__PURE__ */ e.jsx(
|
|
66
74
|
oe,
|
|
67
75
|
{
|
|
68
|
-
onClick: () =>
|
|
69
|
-
hierarchy:
|
|
76
|
+
onClick: () => y && y(g),
|
|
77
|
+
hierarchy: p?.label === g.label ? "Primary" : "Secondary-Grey",
|
|
70
78
|
size: "sm",
|
|
71
|
-
textField:
|
|
72
|
-
className:
|
|
79
|
+
textField: g.label,
|
|
80
|
+
className: p?.label === g.label ? "hfl-bg-Blue-600" : ""
|
|
73
81
|
}
|
|
74
|
-
) },
|
|
82
|
+
) }, g.label)) });
|
|
75
83
|
}
|
|
76
84
|
const ll = "data:image/svg+xml,%3csvg%20width='10'%20height='6'%20viewBox='0%200%2010%206'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M0.480062%200.819173C0.650418%200.648817%200.92662%200.648817%201.09698%200.819173L4.71454%204.43674L8.3321%200.819173C8.50246%200.648817%208.77866%200.648817%208.94902%200.819173C9.11937%200.98953%209.11937%201.26573%208.94902%201.43609L5.023%205.36211C4.85264%205.53246%204.57644%205.53246%204.40608%205.36211L0.480062%201.43609C0.309706%201.26573%200.309706%200.98953%200.480062%200.819173Z'%20fill='%23667085'/%3e%3c/svg%3e";
|
|
77
|
-
function D(
|
|
85
|
+
function D(n) {
|
|
78
86
|
const {
|
|
79
87
|
label: t,
|
|
80
|
-
labelClassName:
|
|
81
|
-
hideDropdownIcon:
|
|
82
|
-
showClearOption:
|
|
88
|
+
labelClassName: p,
|
|
89
|
+
hideDropdownIcon: y,
|
|
90
|
+
showClearOption: g,
|
|
83
91
|
isRequiredField: N,
|
|
84
92
|
btnClassName: i,
|
|
85
93
|
placeholder: C,
|
|
86
94
|
options: w,
|
|
87
|
-
selectedOption:
|
|
95
|
+
selectedOption: _,
|
|
88
96
|
onChangeHandler: k,
|
|
89
|
-
inputValue:
|
|
90
|
-
inputChangeHandler:
|
|
97
|
+
inputValue: b,
|
|
98
|
+
inputChangeHandler: $,
|
|
91
99
|
onInputFocusOutEvent: B,
|
|
92
100
|
inputClassName: s,
|
|
93
|
-
isSearchable:
|
|
101
|
+
isSearchable: m,
|
|
94
102
|
inputType: H,
|
|
95
103
|
showInput: M,
|
|
96
104
|
inputSuffix: S,
|
|
97
|
-
selectedLabel:
|
|
105
|
+
selectedLabel: Z,
|
|
98
106
|
suffixPadding: V,
|
|
99
107
|
disableInputAutoSize: r,
|
|
100
108
|
selectedOptions: x,
|
|
@@ -103,7 +111,7 @@ function D(a) {
|
|
|
103
111
|
showToggle: z,
|
|
104
112
|
toggleChangeHandler: E,
|
|
105
113
|
selectedToggleOption: o,
|
|
106
|
-
toggleOptionsList:
|
|
114
|
+
toggleOptionsList: a,
|
|
107
115
|
border: I,
|
|
108
116
|
height: j,
|
|
109
117
|
disabled: T,
|
|
@@ -120,19 +128,19 @@ function D(a) {
|
|
|
120
128
|
alternateListBgStyle: te,
|
|
121
129
|
showLabelTooltip: v = !1,
|
|
122
130
|
labelToolTipContent: J = "",
|
|
123
|
-
inputContainerClasses:
|
|
131
|
+
inputContainerClasses: Q = "",
|
|
124
132
|
onInputFocus: le
|
|
125
|
-
} =
|
|
126
|
-
|
|
133
|
+
} = n, [ee, ne] = G(!1), [ae, $e] = G(null), he = pe(null), me = pe(null), Ce = pe(null), ge = pe([]), Be = re(() => w?.filter((h) => h ? h.label.toLowerCase().includes((b ?? "").toLowerCase()) : void 0), [b, w]), [He, xe] = G(!1), ze = () => {
|
|
134
|
+
ne(!1), f && $ && $(""), $e(null);
|
|
127
135
|
}, Ne = W(
|
|
128
136
|
(h) => {
|
|
129
|
-
h.stopPropagation(), T ||
|
|
137
|
+
h.stopPropagation(), T || ne((O) => !O);
|
|
130
138
|
},
|
|
131
139
|
[T]
|
|
132
|
-
), Ie = (
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
}, [
|
|
140
|
+
), Ie = (b?.length || 0) + 2 + Number(V || 0);
|
|
141
|
+
Xe(he, ze), X(() => {
|
|
142
|
+
ae !== null && ge.current[ae] && ge.current[ae].scrollIntoView({ block: "nearest" });
|
|
143
|
+
}, [ae]);
|
|
136
144
|
const se = W(() => {
|
|
137
145
|
if (R && ee) {
|
|
138
146
|
const h = M ? me.current : Ce.current, O = he.current;
|
|
@@ -142,12 +150,12 @@ function D(a) {
|
|
|
142
150
|
}
|
|
143
151
|
}
|
|
144
152
|
}, [R, ee, M]);
|
|
145
|
-
|
|
153
|
+
X(() => {
|
|
146
154
|
if (R)
|
|
147
155
|
return ee ? (se(), window.addEventListener("scroll", se, !0)) : window.removeEventListener("scroll", se, !0), () => {
|
|
148
156
|
window.removeEventListener("scroll", se, !0);
|
|
149
157
|
};
|
|
150
|
-
}, [R, se, ee]),
|
|
158
|
+
}, [R, se, ee]), Qe(he, () => {
|
|
151
159
|
He && B && B();
|
|
152
160
|
});
|
|
153
161
|
const Te = (h) => {
|
|
@@ -157,13 +165,13 @@ function D(a) {
|
|
|
157
165
|
}
|
|
158
166
|
}, qe = W(
|
|
159
167
|
async (h) => {
|
|
160
|
-
h.stopPropagation(), ee ||
|
|
168
|
+
h.stopPropagation(), ee || ne(!0), le && await le();
|
|
161
169
|
},
|
|
162
170
|
[le, ee]
|
|
163
171
|
);
|
|
164
172
|
return /* @__PURE__ */ e.jsxs("div", { className: `hfl-relative hfl-inline-block hfl-text-left ${de || ""}`, children: [
|
|
165
173
|
!!t && /* @__PURE__ */ e.jsxs("div", { className: "hfl-text-Gray-700 hfl-mb-1 hfl-flex", children: [
|
|
166
|
-
/* @__PURE__ */ e.jsx(
|
|
174
|
+
/* @__PURE__ */ e.jsx(L, { type: "Text sm", variant: "Medium", className: p || "", children: `${t}` }),
|
|
167
175
|
N && /* @__PURE__ */ e.jsx("span", { className: "hfl-ml-1 hfl-text-Error-600", children: "*" }),
|
|
168
176
|
v && /* @__PURE__ */ e.jsx(Re, { variant: "Right", text: J, theme: "dark", children: /* @__PURE__ */ e.jsx("i", { className: "hx_info-filled" }) })
|
|
169
177
|
] }),
|
|
@@ -171,7 +179,7 @@ function D(a) {
|
|
|
171
179
|
/* @__PURE__ */ e.jsxs(
|
|
172
180
|
"div",
|
|
173
181
|
{
|
|
174
|
-
className: `hfl-flex hfl-items-center hfl-shadow-xs hfl-px-2 ${
|
|
182
|
+
className: `hfl-flex hfl-items-center hfl-shadow-xs hfl-px-2 ${Q || ""} ${I || "hfl-border-1"} hfl-rounded-lg hfl-overflow-x-auto ${l ? "hfl-border-Error-300" : "hfl-border-Gray-300"} ${j || "hfl-h-10"} ${T ? "!hfl-bg-Gray-50 !hfl-pointer-events-none" : q || "hfl-bg-White"} hover:hfl-border-Primary-300 hover:hfl-shadow-xs-primary`,
|
|
175
183
|
onClick: T ? () => {
|
|
176
184
|
} : Ne,
|
|
177
185
|
children: [
|
|
@@ -207,27 +215,27 @@ function D(a) {
|
|
|
207
215
|
"input",
|
|
208
216
|
{
|
|
209
217
|
ref: me,
|
|
210
|
-
style: r ? {} : { width: `${Number(
|
|
218
|
+
style: r ? {} : { width: `${Number(b?.length) > 4 ? (b?.length || 0) + 5 : 12}ch` },
|
|
211
219
|
type: H,
|
|
212
220
|
placeholder: C,
|
|
213
|
-
value:
|
|
221
|
+
value: b,
|
|
214
222
|
className: `input-placeholder hfl-flex-1 hfl-pl-2 hfl-placeholder hfl-py-1 focus-visible:hfl-outline-0 focus-visible:hfl-outline-none hfl-border-0 focus:hfl-border-0 ${T ? "!hfl-bg-Gray-50 !hfl-cursor-not-allowed" : q || "hfl-bg-White"} ${s || ""}`,
|
|
215
223
|
onChange: (h) => {
|
|
216
|
-
|
|
224
|
+
$ && $(h.target.value), xe(!0);
|
|
217
225
|
},
|
|
218
226
|
onClick: qe,
|
|
219
|
-
onKeyDown: (h) => F && F(h,
|
|
227
|
+
onKeyDown: (h) => F && F(h, ne, me),
|
|
220
228
|
maxLength: fe ?? fe,
|
|
221
|
-
...
|
|
229
|
+
...n.inputProps || {}
|
|
222
230
|
}
|
|
223
231
|
),
|
|
224
|
-
!
|
|
225
|
-
|
|
232
|
+
!y && !g && /* @__PURE__ */ e.jsx("i", { className: "hx_down hfl-mx-2" }),
|
|
233
|
+
g && /* @__PURE__ */ e.jsx(
|
|
226
234
|
"i",
|
|
227
235
|
{
|
|
228
|
-
className: `${
|
|
236
|
+
className: `${b ? "hx_close hfl-cursor-pointer" : "hx_down"} hfl-mx-2`,
|
|
229
237
|
onClick: () => {
|
|
230
|
-
(
|
|
238
|
+
(_?.value || b) && ($ && $(""), xe(!0));
|
|
231
239
|
}
|
|
232
240
|
}
|
|
233
241
|
),
|
|
@@ -249,7 +257,7 @@ function D(a) {
|
|
|
249
257
|
ref: Ce,
|
|
250
258
|
onClick: Ne,
|
|
251
259
|
className: `hfl-w-full hfl-bg-White hfl-py-[6px] hfl-px-4 hfl-rounded-lg hfl-inline-flex hfl-justify-between hfl-items-center ${i || ""} ${I || "hfl-border-1"} ${l ? "hfl-border-Error-300" : "hfl-border-Gray-300"} ${j || "hfl-h-[40px]"} ${T ? "!hfl-bg-Gray-50 !hfl-cursor-not-allowed" : ""}`,
|
|
252
|
-
style:
|
|
260
|
+
style: Z || _?.label ? {} : c ? {
|
|
253
261
|
fontFamily: c?.fontFamily,
|
|
254
262
|
fontSize: c?.fontSize,
|
|
255
263
|
fontWeight: c?.fontWeight,
|
|
@@ -257,7 +265,7 @@ function D(a) {
|
|
|
257
265
|
color: c?.color
|
|
258
266
|
} : {},
|
|
259
267
|
children: [
|
|
260
|
-
/* @__PURE__ */ e.jsx("span", { className: "hfl-pr-4", children:
|
|
268
|
+
/* @__PURE__ */ e.jsx("span", { className: "hfl-pr-4", children: Z || _?.label || C || "Select an option" }),
|
|
261
269
|
/* @__PURE__ */ e.jsx("img", { src: ll, alt: "down arrow" })
|
|
262
270
|
]
|
|
263
271
|
}
|
|
@@ -276,16 +284,16 @@ function D(a) {
|
|
|
276
284
|
{
|
|
277
285
|
onChangeHandler: E,
|
|
278
286
|
selectedOption: o,
|
|
279
|
-
options:
|
|
287
|
+
options: a
|
|
280
288
|
}
|
|
281
289
|
) : !1,
|
|
282
|
-
(
|
|
283
|
-
const Y = f ? !!x?.some((ye) => ye.value === h?.value) : !1, ke =
|
|
290
|
+
(m ? Be : w)?.map((h, O) => {
|
|
291
|
+
const Y = f ? !!x?.some((ye) => ye.value === h?.value) : !1, ke = _?.value === h?.value, Ae = ae === O;
|
|
284
292
|
return h ? /* @__PURE__ */ e.jsx(
|
|
285
293
|
"li",
|
|
286
294
|
{
|
|
287
295
|
onClick: () => {
|
|
288
|
-
f ? Te(h) : (k && k(h),
|
|
296
|
+
f ? Te(h) : (k && k(h), ne(!1), xe(!1));
|
|
289
297
|
},
|
|
290
298
|
className: `hfl-text-1 hfl-block hfl-px-4 hfl-py-2 hfl-rounded-md hover:hfl-bg-Blue-50 hfl-cursor-pointer custom_dropdown_item ${te ? "odd:hfl-bg-Gray-100" : ""} ${ke ? "hfl-bg-Blue-50 hfl-text-Blue-500" : ""}`,
|
|
291
299
|
role: "menuitem",
|
|
@@ -325,53 +333,53 @@ var je, De;
|
|
|
325
333
|
function tl() {
|
|
326
334
|
if (De) return je;
|
|
327
335
|
De = 1;
|
|
328
|
-
var
|
|
336
|
+
var n = "Expected a function", t = NaN, p = "[object Symbol]", y = /^\s+|\s+$/g, g = /^[-+]0x[0-9a-f]+$/i, N = /^0b[01]+$/i, i = /^0o[0-7]+$/i, C = parseInt, w = typeof ue == "object" && ue && ue.Object === Object && ue, _ = typeof self == "object" && self && self.Object === Object && self, k = w || _ || Function("return this")(), b = Object.prototype, $ = b.toString, B = Math.max, s = Math.min, m = function() {
|
|
329
337
|
return k.Date.now();
|
|
330
338
|
};
|
|
331
339
|
function H(r, x, f) {
|
|
332
|
-
var u, z, E, o,
|
|
340
|
+
var u, z, E, o, a, I, j = 0, T = !1, q = !1, l = !0;
|
|
333
341
|
if (typeof r != "function")
|
|
334
|
-
throw new TypeError(
|
|
342
|
+
throw new TypeError(n);
|
|
335
343
|
x = V(x) || 0, M(f) && (T = !!f.leading, q = "maxWait" in f, E = q ? B(V(f.maxWait) || 0, x) : E, l = "trailing" in f ? !!f.trailing : l);
|
|
336
344
|
function d(v) {
|
|
337
|
-
var J = u,
|
|
338
|
-
return u = z = void 0, j = v, o = r.apply(
|
|
345
|
+
var J = u, Q = z;
|
|
346
|
+
return u = z = void 0, j = v, o = r.apply(Q, J), o;
|
|
339
347
|
}
|
|
340
348
|
function c(v) {
|
|
341
|
-
return j = v,
|
|
349
|
+
return j = v, a = setTimeout(R, x), T ? d(v) : o;
|
|
342
350
|
}
|
|
343
351
|
function F(v) {
|
|
344
|
-
var J = v - I,
|
|
345
|
-
return q ? s(le, E -
|
|
352
|
+
var J = v - I, Q = v - j, le = x - J;
|
|
353
|
+
return q ? s(le, E - Q) : le;
|
|
346
354
|
}
|
|
347
355
|
function A(v) {
|
|
348
|
-
var J = v - I,
|
|
349
|
-
return I === void 0 || J >= x || J < 0 || q &&
|
|
356
|
+
var J = v - I, Q = v - j;
|
|
357
|
+
return I === void 0 || J >= x || J < 0 || q && Q >= E;
|
|
350
358
|
}
|
|
351
359
|
function R() {
|
|
352
|
-
var v =
|
|
360
|
+
var v = m();
|
|
353
361
|
if (A(v))
|
|
354
362
|
return ce(v);
|
|
355
|
-
|
|
363
|
+
a = setTimeout(R, F(v));
|
|
356
364
|
}
|
|
357
365
|
function ce(v) {
|
|
358
|
-
return
|
|
366
|
+
return a = void 0, l && u ? d(v) : (u = z = void 0, o);
|
|
359
367
|
}
|
|
360
368
|
function de() {
|
|
361
|
-
|
|
369
|
+
a !== void 0 && clearTimeout(a), j = 0, u = I = z = a = void 0;
|
|
362
370
|
}
|
|
363
371
|
function fe() {
|
|
364
|
-
return
|
|
372
|
+
return a === void 0 ? o : ce(m());
|
|
365
373
|
}
|
|
366
374
|
function te() {
|
|
367
|
-
var v =
|
|
375
|
+
var v = m(), J = A(v);
|
|
368
376
|
if (u = arguments, z = this, I = v, J) {
|
|
369
|
-
if (
|
|
377
|
+
if (a === void 0)
|
|
370
378
|
return c(I);
|
|
371
379
|
if (q)
|
|
372
|
-
return
|
|
380
|
+
return a = setTimeout(R, x), d(I);
|
|
373
381
|
}
|
|
374
|
-
return
|
|
382
|
+
return a === void 0 && (a = setTimeout(R, x)), o;
|
|
375
383
|
}
|
|
376
384
|
return te.cancel = de, te.flush = fe, te;
|
|
377
385
|
}
|
|
@@ -382,13 +390,13 @@ function tl() {
|
|
|
382
390
|
function S(r) {
|
|
383
391
|
return !!r && typeof r == "object";
|
|
384
392
|
}
|
|
385
|
-
function
|
|
386
|
-
return typeof r == "symbol" || S(r) &&
|
|
393
|
+
function Z(r) {
|
|
394
|
+
return typeof r == "symbol" || S(r) && $.call(r) == p;
|
|
387
395
|
}
|
|
388
396
|
function V(r) {
|
|
389
397
|
if (typeof r == "number")
|
|
390
398
|
return r;
|
|
391
|
-
if (
|
|
399
|
+
if (Z(r))
|
|
392
400
|
return t;
|
|
393
401
|
if (M(r)) {
|
|
394
402
|
var x = typeof r.valueOf == "function" ? r.valueOf() : r;
|
|
@@ -396,66 +404,66 @@ function tl() {
|
|
|
396
404
|
}
|
|
397
405
|
if (typeof r != "string")
|
|
398
406
|
return r === 0 ? r : +r;
|
|
399
|
-
r = r.replace(
|
|
407
|
+
r = r.replace(y, "");
|
|
400
408
|
var f = N.test(r);
|
|
401
|
-
return f || i.test(r) ? C(r.slice(2), f ? 2 : 8) :
|
|
409
|
+
return f || i.test(r) ? C(r.slice(2), f ? 2 : 8) : g.test(r) ? t : +r;
|
|
402
410
|
}
|
|
403
411
|
return je = H, je;
|
|
404
412
|
}
|
|
405
|
-
var
|
|
406
|
-
const
|
|
407
|
-
const
|
|
408
|
-
if (!
|
|
413
|
+
var nl = tl();
|
|
414
|
+
const al = /* @__PURE__ */ We(nl), ve = (n, t) => {
|
|
415
|
+
const p = parseFloat(n), y = parseFloat(t);
|
|
416
|
+
if (!n || !t || isNaN(p) || isNaN(y) || y === 0)
|
|
409
417
|
return "";
|
|
410
|
-
const
|
|
411
|
-
return Number.isInteger(
|
|
412
|
-
}, U = (
|
|
413
|
-
|
|
418
|
+
const g = p / y;
|
|
419
|
+
return Number.isInteger(g) ? g.toString(10) : g.toFixed(3).replace(/\.?0+$/, "");
|
|
420
|
+
}, U = (n) => /^(\d+)?(\.)?(\d*)?$/.test(n), P = ({ label: n, children: t }) => /* @__PURE__ */ e.jsxs(
|
|
421
|
+
L,
|
|
414
422
|
{
|
|
415
423
|
variant: "Regular",
|
|
416
424
|
type: "Text sm",
|
|
417
425
|
className: "hfl-grid hfl-grid-cols-2 hfl-items-center hfl-text-Blue_gray-800 hfl-justify-between hfl-gap-8",
|
|
418
426
|
children: [
|
|
419
427
|
/* @__PURE__ */ e.jsxs("span", { className: "hfl-flex-shrink-0", children: [
|
|
420
|
-
|
|
428
|
+
n,
|
|
421
429
|
":"
|
|
422
430
|
] }),
|
|
423
431
|
/* @__PURE__ */ e.jsx("div", { className: "hfl-flex-1 hfl-min-w-0", children: t })
|
|
424
432
|
]
|
|
425
433
|
}
|
|
426
|
-
), K = ({ label:
|
|
434
|
+
), K = ({ label: n, value: t }) => /* @__PURE__ */ e.jsxs(L, { variant: "Regular", type: "Text sm", className: "hfl-flex hfl-text-Blue_gray-800 hfl-gap-1", children: [
|
|
427
435
|
/* @__PURE__ */ e.jsxs("span", { className: "hfl-flex-shrink-0", children: [
|
|
428
|
-
|
|
436
|
+
n,
|
|
429
437
|
":"
|
|
430
438
|
] }),
|
|
431
|
-
/* @__PURE__ */ e.jsx(
|
|
432
|
-
] }), ie = ({ children:
|
|
433
|
-
|
|
439
|
+
/* @__PURE__ */ e.jsx(L, { variant: "Bold", type: "Text sm", className: "hfl-text-Blue_gray-800 hfl-break-words hfl-min-w-0", children: t || "--" })
|
|
440
|
+
] }), ie = ({ children: n, className: t = "" }) => /* @__PURE__ */ e.jsx(
|
|
441
|
+
L,
|
|
434
442
|
{
|
|
435
443
|
variant: "Regular",
|
|
436
444
|
type: "Text sm",
|
|
437
445
|
className: `hfl-text-Blue_gray-800 hfl-px-2 hfl-break-words hfl-overflow-wrap-anywhere hfl-min-w-0 ${t}`,
|
|
438
|
-
children:
|
|
446
|
+
children: n
|
|
439
447
|
}
|
|
440
448
|
), sl = be.memo(
|
|
441
|
-
function({ rowData: t, isEditing:
|
|
449
|
+
function({ rowData: t, isEditing: p, setIsEditing: y, onSaveRow: g, allowCustomMedicineInput: N }) {
|
|
442
450
|
const {
|
|
443
451
|
variant: i,
|
|
444
452
|
externallyTriggeredEditMode: C,
|
|
445
453
|
externallyTriggeredEditRowIds: w,
|
|
446
|
-
getMedicineOptions:
|
|
454
|
+
getMedicineOptions: _,
|
|
447
455
|
onRowChange: k,
|
|
448
|
-
onRowDelete:
|
|
449
|
-
} =
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
}, [t.medicine_name,
|
|
453
|
-
|
|
454
|
-
}, [t,
|
|
455
|
-
const S = async (l) => (await
|
|
456
|
+
onRowDelete: b
|
|
457
|
+
} = Le(), [$, B] = G([]), [s, m] = G(t), [H, M] = G(t.medicine_name);
|
|
458
|
+
X(() => {
|
|
459
|
+
p || M(t.medicine_name);
|
|
460
|
+
}, [t.medicine_name, p]), X(() => {
|
|
461
|
+
p || m(t);
|
|
462
|
+
}, [t, p]);
|
|
463
|
+
const S = async (l) => (await _?.(l))?.map((c) => ({
|
|
456
464
|
label: c.doctorMedicineName,
|
|
457
465
|
value: c
|
|
458
|
-
})) || [], V = C || w?.includes(t.rowId) ||
|
|
466
|
+
})) || [], V = C || w?.includes(t.rowId) || p, r = re(() => s.out_of_range || t.out_of_range, [s.out_of_range, t.out_of_range]), x = re(() => s?.isDosageMismatch || t?.isDosageMismatch, [s?.isDosageMismatch, t?.isDosageMismatch]), f = be.useMemo(() => s.calculation_type === _e[0] ? s.calculation_fields : null, [s.calculation_fields, s.calculation_type]), u = be.useMemo(() => s.calculation_type === _e[1] ? s.calculation_fields : null, [s.calculation_fields, s.calculation_type]), z = (l, d) => {
|
|
459
467
|
let c;
|
|
460
468
|
if (l === "calculation_type") {
|
|
461
469
|
const F = d, A = {
|
|
@@ -472,22 +480,22 @@ const nl = /* @__PURE__ */ We(al), ve = (a, t) => {
|
|
|
472
480
|
...s,
|
|
473
481
|
[l]: d
|
|
474
482
|
};
|
|
475
|
-
|
|
483
|
+
m(c), i === "prescription" && E(c, l);
|
|
476
484
|
}, E = re(
|
|
477
|
-
() =>
|
|
485
|
+
() => al((l, d) => {
|
|
478
486
|
k?.(l, d || void 0);
|
|
479
487
|
}, 500),
|
|
480
488
|
[k]
|
|
481
489
|
), o = re(() => /* @__PURE__ */ e.jsxs("div", { className: "hfl-mb-1 hfl-flex hfl-w-max hfl-items-center hfl-rounded hfl-border-1 hfl-border-Warning-400 hfl-bg-Warning-50 hfl-p-1 hfl-px-2", children: [
|
|
482
490
|
/* @__PURE__ */ e.jsx("div", { className: "hx_warning hfl-text-Error-400" }),
|
|
483
|
-
/* @__PURE__ */ e.jsx(
|
|
491
|
+
/* @__PURE__ */ e.jsx(L, { variant: "Regular", type: "Text sm", className: "hfl-px-2 hfl-text-1 hfl-text-Error-500", children: "Dosage exceed safety limits" })
|
|
484
492
|
] }), []);
|
|
485
|
-
|
|
493
|
+
X(() => () => {
|
|
486
494
|
E.cancel();
|
|
487
495
|
}, [E]);
|
|
488
|
-
const
|
|
496
|
+
const a = W(
|
|
489
497
|
(l, d) => {
|
|
490
|
-
|
|
498
|
+
m((c) => {
|
|
491
499
|
let F = { ...c.calculation_fields, [l]: d };
|
|
492
500
|
if (l === "frequency" && i === "standard") {
|
|
493
501
|
const R = Me[d] || [];
|
|
@@ -509,16 +517,16 @@ const nl = /* @__PURE__ */ We(al), ve = (a, t) => {
|
|
|
509
517
|
...s,
|
|
510
518
|
calculation_fields: { ...s.calculation_fields }
|
|
511
519
|
};
|
|
512
|
-
await
|
|
520
|
+
await g?.(l) && E({ ...l, isNewlyAdded: !1, isEditing: !1 });
|
|
513
521
|
}, j = async () => {
|
|
514
522
|
if (!t.medicine_name || t.medicine_name.trim() === "") {
|
|
515
|
-
|
|
523
|
+
b?.(t.rowId);
|
|
516
524
|
return;
|
|
517
525
|
}
|
|
518
|
-
|
|
526
|
+
m(t), i === "standard" && y(!1);
|
|
519
527
|
}, T = (l) => i === "prescription" && (l === "medicine_name" || l === "generic_name" || l === "type" || l === "calculation_type") ? !1 : V, q = () => {
|
|
520
528
|
const l = !(s?.isSavedToLibrary ?? !1), d = { ...s, isSavedToLibrary: l };
|
|
521
|
-
|
|
529
|
+
m(d), E(d, "isSavedToLibrary");
|
|
522
530
|
};
|
|
523
531
|
return /* @__PURE__ */ e.jsxs(
|
|
524
532
|
"div",
|
|
@@ -547,7 +555,7 @@ const nl = /* @__PURE__ */ We(al), ve = (a, t) => {
|
|
|
547
555
|
},
|
|
548
556
|
onChangeHandler: (l) => {
|
|
549
557
|
const d = l.value, c = we.find((F) => F.val === d.medicineType);
|
|
550
|
-
|
|
558
|
+
m((F) => ({
|
|
551
559
|
...F,
|
|
552
560
|
medicine_name: d.doctorMedicineName,
|
|
553
561
|
medicine_id: d.medicineId,
|
|
@@ -555,7 +563,7 @@ const nl = /* @__PURE__ */ We(al), ve = (a, t) => {
|
|
|
555
563
|
type: c?.type ?? ""
|
|
556
564
|
})), M(d.doctorMedicineName);
|
|
557
565
|
},
|
|
558
|
-
options:
|
|
566
|
+
options: $,
|
|
559
567
|
isSearchable: !0,
|
|
560
568
|
placeholder: "Search medicine",
|
|
561
569
|
disabled: !s?.isNewlyAdded,
|
|
@@ -564,7 +572,7 @@ const nl = /* @__PURE__ */ We(al), ve = (a, t) => {
|
|
|
564
572
|
const d = l.relatedTarget;
|
|
565
573
|
if (!(d && d.closest(".custom-dropdown-menu")) && !N) {
|
|
566
574
|
const c = s.medicine_name?.trim() || "";
|
|
567
|
-
|
|
575
|
+
$.some((A) => A.label === c) || m((A) => ({ ...A, medicine_name: H }));
|
|
568
576
|
}
|
|
569
577
|
}
|
|
570
578
|
}
|
|
@@ -628,7 +636,7 @@ const nl = /* @__PURE__ */ We(al), ve = (a, t) => {
|
|
|
628
636
|
inputType: "text",
|
|
629
637
|
inputValue: f.drug_strength || "",
|
|
630
638
|
inputChangeHandler: (l) => {
|
|
631
|
-
U(l) &&
|
|
639
|
+
U(l) && a("drug_strength", l);
|
|
632
640
|
}
|
|
633
641
|
}
|
|
634
642
|
) }),
|
|
@@ -643,7 +651,7 @@ const nl = /* @__PURE__ */ We(al), ve = (a, t) => {
|
|
|
643
651
|
inputType: "text",
|
|
644
652
|
inputValue: f.dose_mg_kg || "",
|
|
645
653
|
inputChangeHandler: (l) => {
|
|
646
|
-
U(l) &&
|
|
654
|
+
U(l) && a("dose_mg_kg", l);
|
|
647
655
|
}
|
|
648
656
|
}
|
|
649
657
|
) }),
|
|
@@ -659,7 +667,7 @@ const nl = /* @__PURE__ */ We(al), ve = (a, t) => {
|
|
|
659
667
|
} : void 0,
|
|
660
668
|
options: Se.map((l) => ({ label: l, value: l })),
|
|
661
669
|
onChangeHandler: (l) => {
|
|
662
|
-
|
|
670
|
+
a("frequency", l.value);
|
|
663
671
|
}
|
|
664
672
|
}
|
|
665
673
|
) }),
|
|
@@ -674,7 +682,7 @@ const nl = /* @__PURE__ */ We(al), ve = (a, t) => {
|
|
|
674
682
|
inputType: "text",
|
|
675
683
|
inputValue: f.max_mg_dose || "",
|
|
676
684
|
inputChangeHandler: (l) => {
|
|
677
|
-
U(l) &&
|
|
685
|
+
U(l) && a("max_mg_dose", l);
|
|
678
686
|
}
|
|
679
687
|
}
|
|
680
688
|
) }),
|
|
@@ -689,7 +697,7 @@ const nl = /* @__PURE__ */ We(al), ve = (a, t) => {
|
|
|
689
697
|
inputType: "text",
|
|
690
698
|
inputValue: f.max_mg_day || "",
|
|
691
699
|
inputChangeHandler: (l) => {
|
|
692
|
-
U(l) &&
|
|
700
|
+
U(l) && a("max_mg_day", l);
|
|
693
701
|
}
|
|
694
702
|
}
|
|
695
703
|
) })
|
|
@@ -706,7 +714,7 @@ const nl = /* @__PURE__ */ We(al), ve = (a, t) => {
|
|
|
706
714
|
inputType: "text",
|
|
707
715
|
inputValue: u.drug_strength || "",
|
|
708
716
|
inputChangeHandler: (l) => {
|
|
709
|
-
U(l) && (
|
|
717
|
+
U(l) && (a("drug_strength", l), a("dose_ml_kg", ve(u.dose_mg_kg, l)));
|
|
710
718
|
}
|
|
711
719
|
}
|
|
712
720
|
) }),
|
|
@@ -721,7 +729,7 @@ const nl = /* @__PURE__ */ We(al), ve = (a, t) => {
|
|
|
721
729
|
inputType: "text",
|
|
722
730
|
inputValue: u.dose_mg_kg || "",
|
|
723
731
|
inputChangeHandler: (l) => {
|
|
724
|
-
U(l) && (
|
|
732
|
+
U(l) && (a("dose_mg_kg", l), a("dose_ml_kg", ve(l, u.drug_strength)));
|
|
725
733
|
}
|
|
726
734
|
}
|
|
727
735
|
) }),
|
|
@@ -737,7 +745,7 @@ const nl = /* @__PURE__ */ We(al), ve = (a, t) => {
|
|
|
737
745
|
inputType: "text",
|
|
738
746
|
inputValue: ve(u.dose_mg_kg, u.drug_strength) || "",
|
|
739
747
|
inputChangeHandler: (l) => {
|
|
740
|
-
U(l) &&
|
|
748
|
+
U(l) && a("dose_ml_kg", l);
|
|
741
749
|
}
|
|
742
750
|
}
|
|
743
751
|
) }),
|
|
@@ -753,7 +761,7 @@ const nl = /* @__PURE__ */ We(al), ve = (a, t) => {
|
|
|
753
761
|
} : void 0,
|
|
754
762
|
options: Se.map((l) => ({ label: l, value: l })),
|
|
755
763
|
onChangeHandler: (l) => {
|
|
756
|
-
|
|
764
|
+
a("frequency", l.value);
|
|
757
765
|
}
|
|
758
766
|
}
|
|
759
767
|
) }),
|
|
@@ -768,7 +776,7 @@ const nl = /* @__PURE__ */ We(al), ve = (a, t) => {
|
|
|
768
776
|
inputType: "text",
|
|
769
777
|
inputValue: u.max_ml_dose || "",
|
|
770
778
|
inputChangeHandler: (l) => {
|
|
771
|
-
U(l) &&
|
|
779
|
+
U(l) && a("max_ml_dose", l);
|
|
772
780
|
}
|
|
773
781
|
}
|
|
774
782
|
) }),
|
|
@@ -783,7 +791,7 @@ const nl = /* @__PURE__ */ We(al), ve = (a, t) => {
|
|
|
783
791
|
inputType: "text",
|
|
784
792
|
inputValue: u.max_ml_day || "",
|
|
785
793
|
inputChangeHandler: (l) => {
|
|
786
|
-
U(l) &&
|
|
794
|
+
U(l) && a("max_ml_day", l);
|
|
787
795
|
}
|
|
788
796
|
}
|
|
789
797
|
) })
|
|
@@ -817,13 +825,13 @@ const nl = /* @__PURE__ */ We(al), ve = (a, t) => {
|
|
|
817
825
|
showInput: i !== "standard",
|
|
818
826
|
disableInputAutoSize: !0,
|
|
819
827
|
inputValue: i === "standard" ? s.calculation_fields.pedia_dosage : s.pedia_dosage,
|
|
820
|
-
inputChangeHandler: (c) => i === "prescription" ? z("pedia_dosage", c) :
|
|
828
|
+
inputChangeHandler: (c) => i === "prescription" ? z("pedia_dosage", c) : a("pedia_dosage", c),
|
|
821
829
|
selectedOption: i === "standard" ? {
|
|
822
830
|
label: s.calculation_fields.pedia_dosage,
|
|
823
831
|
value: s.calculation_fields.pedia_dosage
|
|
824
832
|
} : void 0,
|
|
825
833
|
options: i !== "prescription" ? d.map((c) => ({ label: c, value: c })) : void 0,
|
|
826
|
-
onChangeHandler: i !== "prescription" ? (c) =>
|
|
834
|
+
onChangeHandler: i !== "prescription" ? (c) => a("pedia_dosage", c.value) : void 0,
|
|
827
835
|
hideDropdownIcon: i === "prescription",
|
|
828
836
|
showEmptyDropdownPopup: i !== "prescription",
|
|
829
837
|
showErrorMsg: i === "prescription" ? r || x : !1,
|
|
@@ -835,14 +843,14 @@ const nl = /* @__PURE__ */ We(al), ve = (a, t) => {
|
|
|
835
843
|
r && o
|
|
836
844
|
] }) }),
|
|
837
845
|
/* @__PURE__ */ e.jsx("div", { className: "hfl-w-full hfl-py-2.5 hfl-min-w-0", children: /* @__PURE__ */ e.jsx(
|
|
838
|
-
|
|
846
|
+
Ze,
|
|
839
847
|
{
|
|
840
848
|
effectiveEditMode: V,
|
|
841
849
|
rowData: t,
|
|
842
850
|
isSavedToLibrary: s.isSavedToLibrary ?? !1,
|
|
843
851
|
onSave: I,
|
|
844
852
|
onCancel: j,
|
|
845
|
-
onEdit: () =>
|
|
853
|
+
onEdit: () => y(!0),
|
|
846
854
|
onCheckboxToggle: q
|
|
847
855
|
}
|
|
848
856
|
) })
|
|
@@ -850,26 +858,26 @@ const nl = /* @__PURE__ */ We(al), ve = (a, t) => {
|
|
|
850
858
|
}
|
|
851
859
|
);
|
|
852
860
|
},
|
|
853
|
-
(
|
|
854
|
-
), il = (
|
|
861
|
+
(n, t) => n.isEditing === t.isEditing && n.rowData.rowId === t.rowData.rowId && n.rowData.isEditing === t.rowData.isEditing && n.rowData.medicine_name === t.rowData.medicine_name && n.rowData.generic_name === t.rowData.generic_name && n.rowData.type === t.rowData.type && n.rowData.pedia_dosage === t.rowData.pedia_dosage && n.rowData.calculation_type === t.rowData.calculation_type && JSON.stringify(n.rowData.calculation_fields) === JSON.stringify(t.rowData.calculation_fields) && n.rowData.out_of_range === t.rowData.out_of_range && n.rowData.isDosageMismatch === t.rowData.isDosageMismatch && n.rowData.calculation_fields.pedia_dosage === t.rowData.calculation_fields.pedia_dosage && n.rowData?.isNewlyAdded === t.rowData?.isNewlyAdded && n.rowData?.pedia_data_available === t.rowData?.pedia_data_available
|
|
862
|
+
), il = (n) => {
|
|
855
863
|
const {
|
|
856
864
|
openState: t,
|
|
857
|
-
closePopupCallback:
|
|
858
|
-
headingIconFile:
|
|
859
|
-
headingText:
|
|
865
|
+
closePopupCallback: p,
|
|
866
|
+
headingIconFile: y,
|
|
867
|
+
headingText: g,
|
|
860
868
|
subHeadingText: N,
|
|
861
869
|
positiveButtonText: i,
|
|
862
870
|
negativeButtonText: C,
|
|
863
871
|
classNamePositiveBtn: w,
|
|
864
|
-
classNameNegativeBtn:
|
|
872
|
+
classNameNegativeBtn: _,
|
|
865
873
|
positiveActionCallback: k,
|
|
866
|
-
negativeActionCallback:
|
|
867
|
-
} =
|
|
874
|
+
negativeActionCallback: b
|
|
875
|
+
} = n;
|
|
868
876
|
return /* @__PURE__ */ e.jsxs(
|
|
869
877
|
Fe,
|
|
870
878
|
{
|
|
871
879
|
isOpen: t,
|
|
872
|
-
onRequestClose:
|
|
880
|
+
onRequestClose: p,
|
|
873
881
|
shouldCloseOnOverlayClick: !1,
|
|
874
882
|
style: {
|
|
875
883
|
overlay: {
|
|
@@ -894,9 +902,9 @@ const nl = /* @__PURE__ */ We(al), ve = (a, t) => {
|
|
|
894
902
|
}
|
|
895
903
|
},
|
|
896
904
|
children: [
|
|
897
|
-
|
|
898
|
-
/* @__PURE__ */ e.jsx(
|
|
899
|
-
N && /* @__PURE__ */ e.jsx(
|
|
905
|
+
y == "warning" && /* @__PURE__ */ e.jsx("div", { className: "hfl-hx_warning hfl-mb-4 hfl-flex hfl-h-12 hfl-w-12 hfl-items-center hfl-justify-center hfl-rounded-full hfl-border-8 hfl-border-Warning-50 hfl-bg-Warning-100 hfl-text-Warning-600", children: /* @__PURE__ */ e.jsx("i", { className: "hx_warning hfl-text-5" }) }),
|
|
906
|
+
/* @__PURE__ */ e.jsx(L, { variant: "Medium", type: "Text xl", className: "hfl-mt-5 hfl-text-Gray-900", children: g }),
|
|
907
|
+
N && /* @__PURE__ */ e.jsx(L, { variant: "Regular", type: "Text sm", className: "hfl-mt-1 hfl-text-Gray-500 ", children: N }),
|
|
900
908
|
/* @__PURE__ */ e.jsxs("div", { className: "hfl-mt-4 hfl-flex hfl-items-center hfl-justify-center hfl-gap-4", children: [
|
|
901
909
|
C && /* @__PURE__ */ e.jsx(
|
|
902
910
|
oe,
|
|
@@ -904,8 +912,8 @@ const nl = /* @__PURE__ */ We(al), ve = (a, t) => {
|
|
|
904
912
|
size: "md",
|
|
905
913
|
textField: C,
|
|
906
914
|
hierarchy: "Primary",
|
|
907
|
-
className:
|
|
908
|
-
onClick:
|
|
915
|
+
className: _ || "",
|
|
916
|
+
onClick: b,
|
|
909
917
|
"data-qa": "negative-action"
|
|
910
918
|
}
|
|
911
919
|
),
|
|
@@ -924,10 +932,10 @@ const nl = /* @__PURE__ */ We(al), ve = (a, t) => {
|
|
|
924
932
|
]
|
|
925
933
|
}
|
|
926
934
|
);
|
|
927
|
-
}, rl = ({ open:
|
|
928
|
-
const [N, i] = G([]), [C, w] = G(""), [
|
|
929
|
-
async (
|
|
930
|
-
const M = (await
|
|
935
|
+
}, rl = ({ open: n, onCancel: t, onCopySave: p, rowMedicineData: y, getMedicineOptions: g }) => {
|
|
936
|
+
const [N, i] = G([]), [C, w] = G(""), [_, k] = G([]), b = W(
|
|
937
|
+
async (m) => {
|
|
938
|
+
const M = (await g?.(m))?.map(
|
|
931
939
|
(S) => ({
|
|
932
940
|
label: S.doctorMedicineName,
|
|
933
941
|
value: S
|
|
@@ -935,25 +943,25 @@ const nl = /* @__PURE__ */ We(al), ve = (a, t) => {
|
|
|
935
943
|
);
|
|
936
944
|
k(M || []);
|
|
937
945
|
},
|
|
938
|
-
[
|
|
946
|
+
[g]
|
|
939
947
|
);
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
}, [C,
|
|
943
|
-
const
|
|
944
|
-
const H =
|
|
948
|
+
X(() => {
|
|
949
|
+
n && b(C);
|
|
950
|
+
}, [C, b, n]);
|
|
951
|
+
const $ = (m) => {
|
|
952
|
+
const H = m.value;
|
|
945
953
|
N.some(
|
|
946
954
|
(S) => S.medicineId === H.medicineId && S.doctorMedicineName.trim().toLowerCase() === H.doctorMedicineName.trim().toLowerCase()
|
|
947
955
|
) || i((S) => [...S, H]), w(""), k([]);
|
|
948
|
-
}, B = (
|
|
949
|
-
i((H) => H.filter((M) => M.medicineId !==
|
|
956
|
+
}, B = (m) => {
|
|
957
|
+
i((H) => H.filter((M) => M.medicineId !== m));
|
|
950
958
|
}, s = async () => {
|
|
951
|
-
C.trim() || await
|
|
959
|
+
C.trim() || await b("");
|
|
952
960
|
};
|
|
953
961
|
return /* @__PURE__ */ e.jsxs(
|
|
954
962
|
Fe,
|
|
955
963
|
{
|
|
956
|
-
isOpen:
|
|
964
|
+
isOpen: n,
|
|
957
965
|
onRequestClose: t,
|
|
958
966
|
shouldCloseOnOverlayClick: !1,
|
|
959
967
|
style: {
|
|
@@ -975,7 +983,7 @@ const nl = /* @__PURE__ */ We(al), ve = (a, t) => {
|
|
|
975
983
|
},
|
|
976
984
|
children: [
|
|
977
985
|
/* @__PURE__ */ e.jsx(
|
|
978
|
-
|
|
986
|
+
L,
|
|
979
987
|
{
|
|
980
988
|
variant: "Bold",
|
|
981
989
|
type: "Text lg",
|
|
@@ -992,22 +1000,22 @@ const nl = /* @__PURE__ */ We(al), ve = (a, t) => {
|
|
|
992
1000
|
isSearchable: !0,
|
|
993
1001
|
disableInputAutoSize: !0,
|
|
994
1002
|
inputChangeHandler: w,
|
|
995
|
-
onChangeHandler:
|
|
1003
|
+
onChangeHandler: $,
|
|
996
1004
|
onInputFocus: s,
|
|
997
|
-
options:
|
|
1005
|
+
options: _,
|
|
998
1006
|
placeholder: "Search for medicines"
|
|
999
1007
|
}
|
|
1000
1008
|
),
|
|
1001
|
-
/* @__PURE__ */ e.jsx("div", { className: "hfl-flex hfl-flex-wrap hfl-gap-2", children: N.map((
|
|
1009
|
+
/* @__PURE__ */ e.jsx("div", { className: "hfl-flex hfl-flex-wrap hfl-gap-2", children: N.map((m) => /* @__PURE__ */ e.jsxs(
|
|
1002
1010
|
"div",
|
|
1003
1011
|
{
|
|
1004
1012
|
className: "hfl-flex hfl-items-center hfl-bg-Gray-100 hfl-px-2 hfl-py-0.5 hfl-rounded-md hfl-gap-1",
|
|
1005
1013
|
children: [
|
|
1006
|
-
/* @__PURE__ */ e.jsx(
|
|
1007
|
-
/* @__PURE__ */ e.jsx("button", { className: "hfl-text-Blue_gray-800", onClick: () => B(
|
|
1014
|
+
/* @__PURE__ */ e.jsx(L, { variant: "Regular", type: "Text sm", className: "hfl-text-nowrap", children: m.doctorMedicineName }),
|
|
1015
|
+
/* @__PURE__ */ e.jsx("button", { className: "hfl-text-Blue_gray-800", onClick: () => B(m.medicineId), children: /* @__PURE__ */ e.jsx("i", { className: "hx_close" }) })
|
|
1008
1016
|
]
|
|
1009
1017
|
},
|
|
1010
|
-
|
|
1018
|
+
m.doctorMedicineName + m.medicineId
|
|
1011
1019
|
)) })
|
|
1012
1020
|
] }),
|
|
1013
1021
|
/* @__PURE__ */ e.jsxs("div", { className: "hfl-flex hfl-justify-end hfl-gap-2.5 hfl-bg-Gray-50 hfl-px-7 hfl-py-3 hfl-border-t hfl-border-Gray-200", children: [
|
|
@@ -1019,7 +1027,7 @@ const nl = /* @__PURE__ */ We(al), ve = (a, t) => {
|
|
|
1019
1027
|
textField: "Save",
|
|
1020
1028
|
disabled: !N || N.length == 0,
|
|
1021
1029
|
onClick: async () => {
|
|
1022
|
-
await
|
|
1030
|
+
await p(y, N) && t();
|
|
1023
1031
|
},
|
|
1024
1032
|
className: "hfl-bg-Primary-600 hfl-text-White disabled:hfl-opacity-50 disabled:hfl-cursor-not-allowed",
|
|
1025
1033
|
hierarchy: "Primary"
|
|
@@ -1029,48 +1037,48 @@ const nl = /* @__PURE__ */ We(al), ve = (a, t) => {
|
|
|
1029
1037
|
]
|
|
1030
1038
|
}
|
|
1031
1039
|
);
|
|
1032
|
-
},
|
|
1040
|
+
}, ul = Pe(
|
|
1033
1041
|
({
|
|
1034
|
-
data:
|
|
1042
|
+
data: n = [],
|
|
1035
1043
|
variant: t,
|
|
1036
|
-
externallyTriggeredEditRowIds:
|
|
1037
|
-
externallyTriggeredEditMode:
|
|
1038
|
-
allowCustomMedicineInput:
|
|
1044
|
+
externallyTriggeredEditRowIds: p = [],
|
|
1045
|
+
externallyTriggeredEditMode: y = !1,
|
|
1046
|
+
allowCustomMedicineInput: g = !0,
|
|
1039
1047
|
getMedicineOptions: N,
|
|
1040
1048
|
onRowChange: i,
|
|
1041
1049
|
onRowDelete: C,
|
|
1042
1050
|
onRowCopy: w,
|
|
1043
|
-
onSaveRow:
|
|
1051
|
+
onSaveRow: _,
|
|
1044
1052
|
externalSaveTrigger: k,
|
|
1045
|
-
setSearchDisabled:
|
|
1046
|
-
},
|
|
1047
|
-
const [B, s] = G(null), [
|
|
1048
|
-
(o,
|
|
1049
|
-
const j =
|
|
1053
|
+
setSearchDisabled: b
|
|
1054
|
+
}, $) => {
|
|
1055
|
+
const [B, s] = G(null), [m, H] = G(!1), [M, S] = G(), Z = W(
|
|
1056
|
+
(o, a, I) => {
|
|
1057
|
+
const j = n.find((q) => q.rowId === o);
|
|
1050
1058
|
if (!j) return;
|
|
1051
|
-
const T = { ...j, ...
|
|
1059
|
+
const T = { ...j, ...a };
|
|
1052
1060
|
i?.(T, I || void 0);
|
|
1053
1061
|
},
|
|
1054
|
-
[
|
|
1062
|
+
[n, i]
|
|
1055
1063
|
), V = W(async () => {
|
|
1056
|
-
const o =
|
|
1064
|
+
const o = n.filter((a) => a.isEditing && a.medicine_name);
|
|
1057
1065
|
if (o.length !== 0)
|
|
1058
1066
|
try {
|
|
1059
|
-
await
|
|
1067
|
+
await _?.(o) && o.forEach((I) => {
|
|
1060
1068
|
i?.({ ...I, isEditing: !1 });
|
|
1061
1069
|
});
|
|
1062
|
-
} catch (
|
|
1063
|
-
console.error("Bulk save failed",
|
|
1070
|
+
} catch (a) {
|
|
1071
|
+
console.error("Bulk save failed", a);
|
|
1064
1072
|
} finally {
|
|
1065
|
-
|
|
1073
|
+
b?.(!1);
|
|
1066
1074
|
}
|
|
1067
|
-
}, [
|
|
1068
|
-
|
|
1075
|
+
}, [n, _, i, b]);
|
|
1076
|
+
X(() => {
|
|
1069
1077
|
k && V();
|
|
1070
|
-
}, [k, V]),
|
|
1071
|
-
const o =
|
|
1072
|
-
|
|
1073
|
-
}, [
|
|
1078
|
+
}, [k, V]), X(() => {
|
|
1079
|
+
const o = n.some((a) => a.isEditing);
|
|
1080
|
+
b?.(o);
|
|
1081
|
+
}, [n, b]);
|
|
1074
1082
|
const r = W((o) => {
|
|
1075
1083
|
S(o), H(!0);
|
|
1076
1084
|
}, []), x = W(async () => {
|
|
@@ -1087,32 +1095,32 @@ const nl = /* @__PURE__ */ We(al), ve = (a, t) => {
|
|
|
1087
1095
|
}, []), u = W(
|
|
1088
1096
|
async (o) => {
|
|
1089
1097
|
try {
|
|
1090
|
-
return await
|
|
1091
|
-
} catch (
|
|
1092
|
-
return console.error("Save row failed",
|
|
1098
|
+
return await _?.([o]) ? (i?.({ ...o, isEditing: !1 }), !0) : !1;
|
|
1099
|
+
} catch (a) {
|
|
1100
|
+
return console.error("Save row failed", a), !1;
|
|
1093
1101
|
}
|
|
1094
1102
|
},
|
|
1095
|
-
[
|
|
1103
|
+
[_, i]
|
|
1096
1104
|
), z = W(async () => {
|
|
1097
|
-
const o =
|
|
1105
|
+
const o = n.filter((a) => a.isEditing && a.medicine_name);
|
|
1098
1106
|
if (o.length === 0) return !0;
|
|
1099
1107
|
try {
|
|
1100
|
-
const
|
|
1101
|
-
return
|
|
1102
|
-
} catch (
|
|
1103
|
-
return console.error("External bulk save failed",
|
|
1108
|
+
const a = await _?.(o);
|
|
1109
|
+
return a && n.map((j) => j.isEditing ? { ...j, isEditing: !1 } : j).forEach((j) => i?.(j)), !!a;
|
|
1110
|
+
} catch (a) {
|
|
1111
|
+
return console.error("External bulk save failed", a), !1;
|
|
1104
1112
|
}
|
|
1105
|
-
}, [
|
|
1106
|
-
Ke(
|
|
1113
|
+
}, [n, _, i]);
|
|
1114
|
+
Ke($, () => ({
|
|
1107
1115
|
triggerExternalSave: z
|
|
1108
1116
|
}));
|
|
1109
1117
|
const E = {
|
|
1110
1118
|
variant: t,
|
|
1111
|
-
externallyTriggeredEditMode:
|
|
1112
|
-
externallyTriggeredEditRowIds:
|
|
1119
|
+
externallyTriggeredEditMode: y,
|
|
1120
|
+
externallyTriggeredEditRowIds: p,
|
|
1113
1121
|
getMedicineOptions: N,
|
|
1114
|
-
onRowChange: (o,
|
|
1115
|
-
|
|
1122
|
+
onRowChange: (o, a) => {
|
|
1123
|
+
Z(o.rowId, o, a), i?.(o, a);
|
|
1116
1124
|
},
|
|
1117
1125
|
onRowDelete: C,
|
|
1118
1126
|
onRowCopy: w,
|
|
@@ -1120,16 +1128,16 @@ const nl = /* @__PURE__ */ We(al), ve = (a, t) => {
|
|
|
1120
1128
|
openPopupForRow: r
|
|
1121
1129
|
};
|
|
1122
1130
|
return /* @__PURE__ */ e.jsxs("div", { className: "hfl-border-1 hfl-border-Gray-200", children: [
|
|
1123
|
-
/* @__PURE__ */ e.jsx("div", { className: "table-header hfl-grid hfl-grid-cols-[1.36fr_1.36fr_1.02fr_1.25fr_2.27fr_1.36fr_1.36fr] hfl-gap-2 hfl-py-2 hfl-px-2 hfl-font-bold hfl-border-b-1 hfl-border-Gray-200 hfl-bg-Blue_gray-50", children: Ue.map((o) => /* @__PURE__ */ e.jsx(
|
|
1131
|
+
/* @__PURE__ */ e.jsx("div", { className: "table-header hfl-grid hfl-grid-cols-[1.36fr_1.36fr_1.02fr_1.25fr_2.27fr_1.36fr_1.36fr] hfl-gap-2 hfl-py-2 hfl-px-2 hfl-font-bold hfl-border-b-1 hfl-border-Gray-200 hfl-bg-Blue_gray-50", children: Ue.map((o) => /* @__PURE__ */ e.jsx(L, { variant: "Medium", type: "Text sm", className: "hfl-text-Blue_gray-600", children: o }, o)) }),
|
|
1124
1132
|
/* @__PURE__ */ e.jsxs(Oe.Provider, { value: E, children: [
|
|
1125
|
-
/* @__PURE__ */ e.jsx("div", { className: "table-body", children:
|
|
1133
|
+
/* @__PURE__ */ e.jsx("div", { className: "table-body", children: n.length === 0 ? /* @__PURE__ */ e.jsx(L, { variant: "Medium", type: "Text sm", className: "hfl-text-Blue_gray-600 hfl-px-2 hfl-py-3", children: "No medicines added" }) : n.map((o) => /* @__PURE__ */ e.jsx(
|
|
1126
1134
|
sl,
|
|
1127
1135
|
{
|
|
1128
1136
|
rowData: o,
|
|
1129
1137
|
isEditing: o.isEditing || !1,
|
|
1130
|
-
setIsEditing: (
|
|
1138
|
+
setIsEditing: (a) => Z(o.rowId, { isEditing: a }),
|
|
1131
1139
|
onSaveRow: u,
|
|
1132
|
-
allowCustomMedicineInput:
|
|
1140
|
+
allowCustomMedicineInput: g
|
|
1133
1141
|
},
|
|
1134
1142
|
o.rowId
|
|
1135
1143
|
)) }),
|
|
@@ -1151,7 +1159,7 @@ const nl = /* @__PURE__ */ We(al), ve = (a, t) => {
|
|
|
1151
1159
|
/* @__PURE__ */ e.jsx(
|
|
1152
1160
|
rl,
|
|
1153
1161
|
{
|
|
1154
|
-
open:
|
|
1162
|
+
open: m,
|
|
1155
1163
|
onCancel: () => H(!1),
|
|
1156
1164
|
onCopySave: w,
|
|
1157
1165
|
rowMedicineData: M,
|
|
@@ -1163,5 +1171,5 @@ const nl = /* @__PURE__ */ We(al), ve = (a, t) => {
|
|
|
1163
1171
|
}
|
|
1164
1172
|
);
|
|
1165
1173
|
export {
|
|
1166
|
-
|
|
1174
|
+
ul as P
|
|
1167
1175
|
};
|