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