hplx-feature-library 1.0.171 → 1.0.172
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/AllInvestigations/components/AllInvestigationsTable.d.ts +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-C3aTtdGN.cjs +79 -0
- package/dist/AllInvestigationsTable-C7jrmW8z.js +17354 -0
- package/dist/Attachments/index.js +6163 -6279
- package/dist/PediatricsCalculator/index.js +1 -1
- package/dist/{PediatricsCalculatorTable-Dwluo5W0.js → PediatricsCalculatorTable-Be2H_OXh.js} +203 -210
- package/dist/{PediatricsCalculatorTable-BglWcUGO.cjs → PediatricsCalculatorTable-fk_QinWG.cjs} +11 -11
- 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/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/components/Modal.d.ts +5 -0
- package/dist/constants/TrendGraphsConstants.d.ts +2 -0
- package/dist/hplx-feature-library.css +1 -1
- package/dist/{useOutsideClick-CYAjbj1N.js → index-4whwJbrk.js} +812 -823
- package/dist/{useOutsideClick-COATBT9j.cjs → index-C6KQLMQs.cjs} +23 -23
- package/dist/index-CJFGOBPb.js +122 -0
- package/dist/index-DfcUmlge.cjs +17 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +4 -2
- package/dist/types/AllInvestigationTypes/index.js +4 -0
- package/dist/types/AllInvestigationTypes.d.ts +43 -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/useOutsideClick-C4Q0aGuf.js +15 -0
- package/dist/useOutsideClick-CicUjzPP.cjs +1 -0
- package/package.json +12 -1
package/dist/{PediatricsCalculatorTable-Dwluo5W0.js → PediatricsCalculatorTable-Be2H_OXh.js}
RENAMED
|
@@ -1,21 +1,23 @@
|
|
|
1
|
-
import { j as n, b as $, O as at, K as be,
|
|
2
|
-
import ye, { createContext as
|
|
3
|
-
import { C_MedicineCalculatorList as De, C_FrequencyDosageMap as Ue, C_MedicineTypeList as Ie, C_MedicineFrequencyList as $e, C_DefaultMgKgFields as
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { j as n, b as $, O as at, K as be, N as Ct, c as _e, g as ot, r as st, a as Ot } from "./index-4whwJbrk.js";
|
|
2
|
+
import ye, { createContext as Nt, useContext as Et, useState as K, useRef as we, useMemo as ve, useCallback as G, useEffect as ae, forwardRef as St, useImperativeHandle as Mt } from "react";
|
|
3
|
+
import { C_MedicineCalculatorList as De, C_FrequencyDosageMap as Ue, C_MedicineTypeList as Ie, C_MedicineFrequencyList as $e, C_DefaultMgKgFields as jt, C_DefaultMlKgFields as Tt, C_Table_Column_Name as Dt } from "./constants/PediatricsCalculatorConstants/index.js";
|
|
4
|
+
import { u as It } from "./useClickOutside-BjJyGTec.js";
|
|
5
|
+
import { u as Rt } from "./useOutsideClick-C4Q0aGuf.js";
|
|
6
|
+
import Ft from "react-dom";
|
|
7
|
+
const it = Nt(null), ct = () => {
|
|
8
|
+
const l = Et(it);
|
|
7
9
|
if (!l) throw new Error("usePediatricsCalculatorTableContext must be used inside a MedicineTableProvider");
|
|
8
10
|
return l;
|
|
9
|
-
},
|
|
11
|
+
}, At = ({
|
|
10
12
|
effectiveEditMode: l,
|
|
11
13
|
rowData: r,
|
|
12
|
-
isSavedToLibrary:
|
|
14
|
+
isSavedToLibrary: x,
|
|
13
15
|
onSave: u,
|
|
14
16
|
onCancel: f,
|
|
15
|
-
onEdit:
|
|
17
|
+
onEdit: y,
|
|
16
18
|
onCheckboxToggle: m
|
|
17
19
|
}) => {
|
|
18
|
-
const { variant: t, externallyTriggeredEditMode: C, setRowToDelete:
|
|
20
|
+
const { variant: t, externallyTriggeredEditMode: C, setRowToDelete: b, openPopupForRow: h } = ct();
|
|
19
21
|
return t === "standard" ? l ? /* @__PURE__ */ n.jsxs("div", { className: "hfl-grid hfl-grid-cols-[1fr_1fr] hfl-border-1 hfl-border-Gray-200 hfl-rounded-lg ", children: [
|
|
20
22
|
/* @__PURE__ */ n.jsx(
|
|
21
23
|
"button",
|
|
@@ -27,7 +29,7 @@ const it = Et(null), ct = () => {
|
|
|
27
29
|
),
|
|
28
30
|
/* @__PURE__ */ n.jsx("button", { className: "hfl-px-3 hfl-py-2 hfl-text-Error-600 hover:hfl-bg-Error-50", onClick: f, children: /* @__PURE__ */ n.jsx($, { variant: "Medium", type: "Text xs", className: "", children: "Cancel" }) })
|
|
29
31
|
] }) : /* @__PURE__ */ n.jsxs("div", { className: "hfl-grid hfl-grid-cols-[1fr_1fr_1fr] hfl-border-1 hfl-border-Gray-200 hfl-rounded-lg", children: [
|
|
30
|
-
/* @__PURE__ */ n.jsx("button", { className: "hfl-px-3 hfl-py-1 hfl-text-Blue_gray-800 hover:hfl-bg-Primary-50", onClick:
|
|
32
|
+
/* @__PURE__ */ n.jsx("button", { className: "hfl-px-3 hfl-py-1 hfl-text-Blue_gray-800 hover:hfl-bg-Primary-50", onClick: y, children: /* @__PURE__ */ n.jsx($, { variant: "Medium", type: "Text xs", className: "", children: "Edit" }) }),
|
|
31
33
|
/* @__PURE__ */ n.jsx(
|
|
32
34
|
"button",
|
|
33
35
|
{
|
|
@@ -40,7 +42,7 @@ const it = Et(null), ct = () => {
|
|
|
40
42
|
"button",
|
|
41
43
|
{
|
|
42
44
|
className: "hx_delete hfl-px-3 hfl-py-2 hfl-text-Error-500 hover:hfl-bg-Error-50",
|
|
43
|
-
onClick: () =>
|
|
45
|
+
onClick: () => b?.(r.rowId)
|
|
44
46
|
}
|
|
45
47
|
)
|
|
46
48
|
] }) : /* @__PURE__ */ n.jsx(
|
|
@@ -51,32 +53,23 @@ const it = Et(null), ct = () => {
|
|
|
51
53
|
id: r.rowId,
|
|
52
54
|
size: "md",
|
|
53
55
|
onClick: m,
|
|
54
|
-
isMarked:
|
|
56
|
+
isMarked: x ?? !1,
|
|
55
57
|
checkboxClasses: "hfl-mt-2",
|
|
56
58
|
checkBoxInnerDivClasses: "hfl-text-Blue-600 hfl-bg-Blue-50"
|
|
57
59
|
},
|
|
58
60
|
r.rowId
|
|
59
61
|
);
|
|
60
|
-
}, At = (l, r) => {
|
|
61
|
-
re(() => {
|
|
62
|
-
const y = (u) => {
|
|
63
|
-
l.current && !l.current.contains(u.target) && r();
|
|
64
|
-
};
|
|
65
|
-
return document.addEventListener("mousedown", y), () => {
|
|
66
|
-
document.removeEventListener("mousedown", y);
|
|
67
|
-
};
|
|
68
|
-
}, [l, r]);
|
|
69
62
|
};
|
|
70
63
|
function Lt(l) {
|
|
71
|
-
const { options: r, selectedOption:
|
|
64
|
+
const { options: r, selectedOption: x, onChangeHandler: u } = l;
|
|
72
65
|
return /* @__PURE__ */ n.jsx("div", { className: "hfl-flex hfl-gap-2 hfl-h-full hfl-items-center hfl-px-4 hfl-justify-center hfl-py-1", children: r?.map((f) => /* @__PURE__ */ n.jsx("div", { className: "hfl-bg-White hfl-rounded-lg", children: /* @__PURE__ */ n.jsx(
|
|
73
66
|
be,
|
|
74
67
|
{
|
|
75
68
|
onClick: () => u && u(f),
|
|
76
|
-
hierarchy:
|
|
69
|
+
hierarchy: x?.label === f.label ? "Primary" : "Secondary-Grey",
|
|
77
70
|
size: "sm",
|
|
78
71
|
textField: f.label,
|
|
79
|
-
className:
|
|
72
|
+
className: x?.label === f.label ? "hfl-bg-Blue-600" : ""
|
|
80
73
|
}
|
|
81
74
|
) }, f.label)) });
|
|
82
75
|
}
|
|
@@ -84,14 +77,14 @@ const kt = "data:image/svg+xml,%3csvg%20width='10'%20height='6'%20viewBox='0%200
|
|
|
84
77
|
function B(l) {
|
|
85
78
|
const {
|
|
86
79
|
label: r,
|
|
87
|
-
labelClassName:
|
|
80
|
+
labelClassName: x,
|
|
88
81
|
hideDropdownIcon: u,
|
|
89
82
|
showClearOption: f,
|
|
90
|
-
isRequiredField:
|
|
83
|
+
isRequiredField: y,
|
|
91
84
|
btnClassName: m,
|
|
92
85
|
placeholder: t,
|
|
93
86
|
options: C,
|
|
94
|
-
selectedOption:
|
|
87
|
+
selectedOption: b,
|
|
95
88
|
onChangeHandler: h,
|
|
96
89
|
inputValue: o,
|
|
97
90
|
inputChangeHandler: v,
|
|
@@ -127,7 +120,7 @@ function B(l) {
|
|
|
127
120
|
alternateListBgStyle: oe,
|
|
128
121
|
showLabelTooltip: P = !1,
|
|
129
122
|
labelToolTipContent: Z = "",
|
|
130
|
-
inputContainerClasses:
|
|
123
|
+
inputContainerClasses: re = "",
|
|
131
124
|
onInputFocus: ue
|
|
132
125
|
} = l, [se, de] = K(!1), [pe, vt] = K(null), xe = we(null), Se = we(null), Pe = we(null), Me = we([]), yt = ve(() => C?.filter((F) => F ? F.label.toLowerCase().includes((o ?? "").toLowerCase()) : void 0), [o, C]), [bt, je] = K(!1), xt = () => {
|
|
133
126
|
de(!1), T && v && v(""), vt(null);
|
|
@@ -137,7 +130,7 @@ function B(l) {
|
|
|
137
130
|
},
|
|
138
131
|
[c]
|
|
139
132
|
), He = (o?.length || 0) + 2 + Number(H || 0);
|
|
140
|
-
|
|
133
|
+
Rt(xe, xt), ae(() => {
|
|
141
134
|
pe !== null && Me.current[pe] && Me.current[pe].scrollIntoView({ block: "nearest" });
|
|
142
135
|
}, [pe]);
|
|
143
136
|
const he = G(() => {
|
|
@@ -149,12 +142,12 @@ function B(l) {
|
|
|
149
142
|
}
|
|
150
143
|
}
|
|
151
144
|
}, [q, se, D]);
|
|
152
|
-
|
|
145
|
+
ae(() => {
|
|
153
146
|
if (q)
|
|
154
147
|
return se ? (he(), window.addEventListener("scroll", he, !0)) : window.removeEventListener("scroll", he, !0), () => {
|
|
155
148
|
window.removeEventListener("scroll", he, !0);
|
|
156
149
|
};
|
|
157
|
-
}, [q, he, se]),
|
|
150
|
+
}, [q, he, se]), It(xe, () => {
|
|
158
151
|
bt && g && g();
|
|
159
152
|
});
|
|
160
153
|
const We = (F) => {
|
|
@@ -170,15 +163,15 @@ function B(l) {
|
|
|
170
163
|
);
|
|
171
164
|
return /* @__PURE__ */ n.jsxs("div", { className: `hfl-relative hfl-inline-block hfl-text-left ${te || ""}`, children: [
|
|
172
165
|
!!r && /* @__PURE__ */ n.jsxs("div", { className: "hfl-text-Gray-700 hfl-mb-1 hfl-flex", children: [
|
|
173
|
-
/* @__PURE__ */ n.jsx($, { type: "Text sm", variant: "Medium", className:
|
|
174
|
-
|
|
175
|
-
P && /* @__PURE__ */ n.jsx(
|
|
166
|
+
/* @__PURE__ */ n.jsx($, { type: "Text sm", variant: "Medium", className: x || "", children: `${r}` }),
|
|
167
|
+
y && /* @__PURE__ */ n.jsx("span", { className: "hfl-ml-1 hfl-text-Error-600", children: "*" }),
|
|
168
|
+
P && /* @__PURE__ */ n.jsx(Ct, { variant: "Right", text: Z, theme: "dark", children: /* @__PURE__ */ n.jsx("i", { className: "hx_info-filled" }) })
|
|
176
169
|
] }),
|
|
177
170
|
D ? /* @__PURE__ */ n.jsxs(n.Fragment, { children: [
|
|
178
171
|
/* @__PURE__ */ n.jsxs(
|
|
179
172
|
"div",
|
|
180
173
|
{
|
|
181
|
-
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 ${re || ""} ${O || "hfl-border-1"} hfl-rounded-lg hfl-overflow-x-auto ${e ? "hfl-border-Error-300" : "hfl-border-Gray-300"} ${i || "hfl-h-10"} ${c ? "!hfl-bg-Gray-50 !hfl-pointer-events-none" : E || "hfl-bg-White"} hover:hfl-border-Primary-300 hover:hfl-shadow-xs-primary`,
|
|
182
175
|
onClick: c ? () => {
|
|
183
176
|
} : qe,
|
|
184
177
|
children: [
|
|
@@ -234,7 +227,7 @@ function B(l) {
|
|
|
234
227
|
{
|
|
235
228
|
className: `${o ? "hx_close hfl-cursor-pointer" : "hx_down"} hfl-mx-2`,
|
|
236
229
|
onClick: () => {
|
|
237
|
-
(
|
|
230
|
+
(b?.value || o) && (v && v(""), je(!0));
|
|
238
231
|
}
|
|
239
232
|
}
|
|
240
233
|
),
|
|
@@ -256,7 +249,7 @@ function B(l) {
|
|
|
256
249
|
ref: Pe,
|
|
257
250
|
onClick: qe,
|
|
258
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 ${m || ""} ${O || "hfl-border-1"} ${e ? "hfl-border-Error-300" : "hfl-border-Gray-300"} ${i || "hfl-h-[40px]"} ${c ? "!hfl-bg-Gray-50 !hfl-cursor-not-allowed" : ""}`,
|
|
259
|
-
style: W ||
|
|
252
|
+
style: W || b?.label ? {} : _ ? {
|
|
260
253
|
fontFamily: _?.fontFamily,
|
|
261
254
|
fontSize: _?.fontSize,
|
|
262
255
|
fontWeight: _?.fontWeight,
|
|
@@ -264,7 +257,7 @@ function B(l) {
|
|
|
264
257
|
color: _?.color
|
|
265
258
|
} : {},
|
|
266
259
|
children: [
|
|
267
|
-
/* @__PURE__ */ n.jsx("span", { className: "hfl-pr-4", children: W ||
|
|
260
|
+
/* @__PURE__ */ n.jsx("span", { className: "hfl-pr-4", children: W || b?.label || t || "Select an option" }),
|
|
268
261
|
/* @__PURE__ */ n.jsx("img", { src: kt, alt: "down arrow" })
|
|
269
262
|
]
|
|
270
263
|
}
|
|
@@ -287,7 +280,7 @@ function B(l) {
|
|
|
287
280
|
}
|
|
288
281
|
) : !1,
|
|
289
282
|
(w ? yt : C)?.map((F, U) => {
|
|
290
|
-
const Q = T ? !!I?.some((Te) => Te.value === F?.value) : !1, Be =
|
|
283
|
+
const Q = T ? !!I?.some((Te) => Te.value === F?.value) : !1, Be = b?.value === F?.value, wt = pe === U;
|
|
291
284
|
return F ? /* @__PURE__ */ n.jsx(
|
|
292
285
|
"li",
|
|
293
286
|
{
|
|
@@ -332,7 +325,7 @@ var Re, ze;
|
|
|
332
325
|
function Pt() {
|
|
333
326
|
if (ze) return Re;
|
|
334
327
|
ze = 1;
|
|
335
|
-
var l = "Expected a function", r = NaN,
|
|
328
|
+
var l = "Expected a function", r = NaN, x = "[object Symbol]", u = /^\s+|\s+$/g, f = /^[-+]0x[0-9a-f]+$/i, y = /^0b[01]+$/i, m = /^0o[0-7]+$/i, t = parseInt, C = typeof _e == "object" && _e && _e.Object === Object && _e, b = typeof self == "object" && self && self.Object === Object && self, h = C || b || Function("return this")(), o = Object.prototype, v = o.toString, g = Math.max, s = Math.min, w = function() {
|
|
336
329
|
return h.Date.now();
|
|
337
330
|
};
|
|
338
331
|
function M(N, I, T) {
|
|
@@ -341,19 +334,19 @@ function Pt() {
|
|
|
341
334
|
throw new TypeError(l);
|
|
342
335
|
I = H(I) || 0, D(T) && (c = !!T.leading, E = "maxWait" in T, L = E ? g(H(T.maxWait) || 0, I) : L, e = "trailing" in T ? !!T.trailing : e);
|
|
343
336
|
function d(P) {
|
|
344
|
-
var Z = R,
|
|
345
|
-
return R = k = void 0, i = P, p = N.apply(
|
|
337
|
+
var Z = R, re = k;
|
|
338
|
+
return R = k = void 0, i = P, p = N.apply(re, Z), p;
|
|
346
339
|
}
|
|
347
340
|
function _(P) {
|
|
348
341
|
return i = P, a = setTimeout(q, I), c ? d(P) : p;
|
|
349
342
|
}
|
|
350
343
|
function S(P) {
|
|
351
|
-
var Z = P - O,
|
|
352
|
-
return E ? s(ue, L -
|
|
344
|
+
var Z = P - O, re = P - i, ue = I - Z;
|
|
345
|
+
return E ? s(ue, L - re) : ue;
|
|
353
346
|
}
|
|
354
347
|
function j(P) {
|
|
355
|
-
var Z = P - O,
|
|
356
|
-
return O === void 0 || Z >= I || Z < 0 || E &&
|
|
348
|
+
var Z = P - O, re = P - i;
|
|
349
|
+
return O === void 0 || Z >= I || Z < 0 || E && re >= L;
|
|
357
350
|
}
|
|
358
351
|
function q() {
|
|
359
352
|
var P = w();
|
|
@@ -390,7 +383,7 @@ function Pt() {
|
|
|
390
383
|
return !!N && typeof N == "object";
|
|
391
384
|
}
|
|
392
385
|
function W(N) {
|
|
393
|
-
return typeof N == "symbol" || A(N) && v.call(N) ==
|
|
386
|
+
return typeof N == "symbol" || A(N) && v.call(N) == x;
|
|
394
387
|
}
|
|
395
388
|
function H(N) {
|
|
396
389
|
if (typeof N == "number")
|
|
@@ -404,17 +397,17 @@ function Pt() {
|
|
|
404
397
|
if (typeof N != "string")
|
|
405
398
|
return N === 0 ? N : +N;
|
|
406
399
|
N = N.replace(u, "");
|
|
407
|
-
var T =
|
|
400
|
+
var T = y.test(N);
|
|
408
401
|
return T || m.test(N) ? t(N.slice(2), T ? 2 : 8) : f.test(N) ? r : +N;
|
|
409
402
|
}
|
|
410
403
|
return Re = M, Re;
|
|
411
404
|
}
|
|
412
405
|
var qt = Pt();
|
|
413
406
|
const Ht = /* @__PURE__ */ ot(qt), Fe = (l, r) => {
|
|
414
|
-
const
|
|
415
|
-
if (!l || !r || isNaN(
|
|
407
|
+
const x = parseFloat(l), u = parseFloat(r);
|
|
408
|
+
if (!l || !r || isNaN(x) || isNaN(u) || u === 0)
|
|
416
409
|
return "";
|
|
417
|
-
const f =
|
|
410
|
+
const f = x / u;
|
|
418
411
|
return Number.isInteger(f) ? f.toString(10) : f.toFixed(3).replace(/\.?0+$/, "");
|
|
419
412
|
}, ne = (l) => /^(\d+)?(\.)?(\d*)?$/.test(l), Y = ({ label: l, children: r }) => /* @__PURE__ */ n.jsxs(
|
|
420
413
|
$,
|
|
@@ -445,24 +438,24 @@ const Ht = /* @__PURE__ */ ot(qt), Fe = (l, r) => {
|
|
|
445
438
|
children: l
|
|
446
439
|
}
|
|
447
440
|
), Wt = ye.memo(
|
|
448
|
-
function({ rowData: r, isEditing:
|
|
441
|
+
function({ rowData: r, isEditing: x, setIsEditing: u, onSaveRow: f, allowCustomMedicineInput: y }) {
|
|
449
442
|
const {
|
|
450
443
|
variant: m,
|
|
451
444
|
externallyTriggeredEditMode: t,
|
|
452
445
|
externallyTriggeredEditRowIds: C,
|
|
453
|
-
getMedicineOptions:
|
|
446
|
+
getMedicineOptions: b,
|
|
454
447
|
onRowChange: h,
|
|
455
448
|
onRowDelete: o
|
|
456
449
|
} = ct(), [v, g] = K([]), [s, w] = K(r), [M, D] = K(r.medicine_name);
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
}, [r.medicine_name,
|
|
460
|
-
|
|
461
|
-
}, [r,
|
|
462
|
-
const A = async (e) => (await
|
|
450
|
+
ae(() => {
|
|
451
|
+
x || D(r.medicine_name);
|
|
452
|
+
}, [r.medicine_name, x]), ae(() => {
|
|
453
|
+
x || w(r);
|
|
454
|
+
}, [r, x]);
|
|
455
|
+
const A = async (e) => (await b?.(e))?.map((_) => ({
|
|
463
456
|
label: _.doctorMedicineName,
|
|
464
457
|
value: _
|
|
465
|
-
})) || [], H = t || C?.includes(r.rowId) ||
|
|
458
|
+
})) || [], H = t || C?.includes(r.rowId) || x, N = ve(() => s.out_of_range || r.out_of_range, [s.out_of_range, r.out_of_range]), I = ve(() => s?.isDosageMismatch || r?.isDosageMismatch, [s?.isDosageMismatch, r?.isDosageMismatch]), T = ye.useMemo(() => s.calculation_type === De[0] ? s.calculation_fields : null, [s.calculation_fields, s.calculation_type]), R = ye.useMemo(() => s.calculation_type === De[1] ? s.calculation_fields : null, [s.calculation_fields, s.calculation_type]), k = (e, d) => {
|
|
466
459
|
let _;
|
|
467
460
|
if (e === "calculation_type") {
|
|
468
461
|
const S = d, j = {
|
|
@@ -472,7 +465,7 @@ const Ht = /* @__PURE__ */ ot(qt), Fe = (l, r) => {
|
|
|
472
465
|
_ = {
|
|
473
466
|
...s,
|
|
474
467
|
calculation_type: S,
|
|
475
|
-
calculation_fields: S === "mg/kg/dose" ? { ...
|
|
468
|
+
calculation_fields: S === "mg/kg/dose" ? { ...jt, ...j } : { ...Tt, ...j }
|
|
476
469
|
};
|
|
477
470
|
} else
|
|
478
471
|
_ = {
|
|
@@ -489,7 +482,7 @@ const Ht = /* @__PURE__ */ ot(qt), Fe = (l, r) => {
|
|
|
489
482
|
/* @__PURE__ */ n.jsx("div", { className: "hx_warning hfl-text-Error-400" }),
|
|
490
483
|
/* @__PURE__ */ n.jsx($, { variant: "Regular", type: "Text sm", className: "hfl-px-2 hfl-text-1 hfl-text-Error-500", children: "Dosage exceed safety limits" })
|
|
491
484
|
] }), []);
|
|
492
|
-
|
|
485
|
+
ae(() => () => {
|
|
493
486
|
L.cancel();
|
|
494
487
|
}, [L]);
|
|
495
488
|
const a = G(
|
|
@@ -569,7 +562,7 @@ const Ht = /* @__PURE__ */ ot(qt), Fe = (l, r) => {
|
|
|
569
562
|
inputProps: {
|
|
570
563
|
onBlur: (e) => {
|
|
571
564
|
const d = e.relatedTarget;
|
|
572
|
-
if (!(d && d.closest(".custom-dropdown-menu")) && !
|
|
565
|
+
if (!(d && d.closest(".custom-dropdown-menu")) && !y) {
|
|
573
566
|
const _ = s.medicine_name?.trim() || "";
|
|
574
567
|
v.some((j) => j.label === _) || w((j) => ({ ...j, medicine_name: M }));
|
|
575
568
|
}
|
|
@@ -842,7 +835,7 @@ const Ht = /* @__PURE__ */ ot(qt), Fe = (l, r) => {
|
|
|
842
835
|
N && p
|
|
843
836
|
] }) }),
|
|
844
837
|
/* @__PURE__ */ n.jsx("div", { className: "hfl-w-full hfl-py-2.5 hfl-min-w-0", children: /* @__PURE__ */ n.jsx(
|
|
845
|
-
|
|
838
|
+
At,
|
|
846
839
|
{
|
|
847
840
|
effectiveEditMode: H,
|
|
848
841
|
rowData: r,
|
|
@@ -859,7 +852,7 @@ const Ht = /* @__PURE__ */ ot(qt), Fe = (l, r) => {
|
|
|
859
852
|
},
|
|
860
853
|
(l, r) => l.isEditing === r.isEditing && l.rowData.rowId === r.rowData.rowId && l.rowData.isEditing === r.rowData.isEditing && l.rowData.medicine_name === r.rowData.medicine_name && l.rowData.generic_name === r.rowData.generic_name && l.rowData.type === r.rowData.type && l.rowData.pedia_dosage === r.rowData.pedia_dosage && l.rowData.calculation_type === r.rowData.calculation_type && JSON.stringify(l.rowData.calculation_fields) === JSON.stringify(r.rowData.calculation_fields) && l.rowData.out_of_range === r.rowData.out_of_range && l.rowData.isDosageMismatch === r.rowData.isDosageMismatch && l.rowData.calculation_fields.pedia_dosage === r.rowData.calculation_fields.pedia_dosage && l.rowData?.isNewlyAdded === r.rowData?.isNewlyAdded && l.rowData?.pedia_data_available === r.rowData?.pedia_data_available
|
|
861
854
|
);
|
|
862
|
-
var Ce = { exports: {} },
|
|
855
|
+
var Ce = { exports: {} }, le = {}, Oe = { exports: {} }, V = {}, Ne = { exports: {} }, Ve;
|
|
863
856
|
function ut() {
|
|
864
857
|
return Ve || (Ve = 1, function(l, r) {
|
|
865
858
|
Object.defineProperty(r, "__esModule", {
|
|
@@ -876,8 +869,8 @@ function ut() {
|
|
|
876
869
|
*
|
|
877
870
|
* http://api.jqueryui.com/category/ui-core/
|
|
878
871
|
*/
|
|
879
|
-
var
|
|
880
|
-
function
|
|
872
|
+
var x = "none", u = "contents", f = /^(input|select|textarea|button|object|iframe)$/;
|
|
873
|
+
function y(o, v) {
|
|
881
874
|
return v.getPropertyValue("overflow") !== "visible" || // if 'overflow: visible' set, check if there is actually any overflow
|
|
882
875
|
o.scrollWidth <= 0 && o.scrollHeight <= 0;
|
|
883
876
|
}
|
|
@@ -886,7 +879,7 @@ function ut() {
|
|
|
886
879
|
if (v && !o.innerHTML) return !0;
|
|
887
880
|
try {
|
|
888
881
|
var g = window.getComputedStyle(o), s = g.getPropertyValue("display");
|
|
889
|
-
return v ? s !== u &&
|
|
882
|
+
return v ? s !== u && y(o, g) : s === x;
|
|
890
883
|
} catch {
|
|
891
884
|
return console.warn("Failed to inspect element style"), !1;
|
|
892
885
|
}
|
|
@@ -902,7 +895,7 @@ function ut() {
|
|
|
902
895
|
var g = o.nodeName.toLowerCase(), s = f.test(g) && !o.disabled || g === "a" && o.href || v;
|
|
903
896
|
return s && t(o);
|
|
904
897
|
}
|
|
905
|
-
function
|
|
898
|
+
function b(o) {
|
|
906
899
|
var v = o.getAttribute("tabindex");
|
|
907
900
|
v === null && (v = void 0);
|
|
908
901
|
var g = isNaN(v);
|
|
@@ -912,7 +905,7 @@ function ut() {
|
|
|
912
905
|
var v = [].slice.call(o.querySelectorAll("*"), 0).reduce(function(g, s) {
|
|
913
906
|
return g.concat(s.shadowRoot ? h(s.shadowRoot) : [s]);
|
|
914
907
|
}, []);
|
|
915
|
-
return v.filter(
|
|
908
|
+
return v.filter(b);
|
|
916
909
|
}
|
|
917
910
|
l.exports = r.default;
|
|
918
911
|
}(Ne, Ne.exports)), Ne.exports;
|
|
@@ -922,12 +915,12 @@ function Bt() {
|
|
|
922
915
|
if (Ge) return V;
|
|
923
916
|
Ge = 1, Object.defineProperty(V, "__esModule", {
|
|
924
917
|
value: !0
|
|
925
|
-
}), V.resetState = m, V.log = t, V.handleBlur = C, V.handleFocus =
|
|
926
|
-
var l = ut(), r =
|
|
927
|
-
function
|
|
918
|
+
}), V.resetState = m, V.log = t, V.handleBlur = C, V.handleFocus = b, V.markForFocusLater = h, V.returnFocus = o, V.popWithoutFocus = v, V.setupScopedFocus = g, V.teardownScopedFocus = s;
|
|
919
|
+
var l = ut(), r = x(l);
|
|
920
|
+
function x(w) {
|
|
928
921
|
return w && w.__esModule ? w : { default: w };
|
|
929
922
|
}
|
|
930
|
-
var u = [], f = null,
|
|
923
|
+
var u = [], f = null, y = !1;
|
|
931
924
|
function m() {
|
|
932
925
|
u = [];
|
|
933
926
|
}
|
|
@@ -938,11 +931,11 @@ function Bt() {
|
|
|
938
931
|
}), console.log("end focusManager ----------"));
|
|
939
932
|
}
|
|
940
933
|
function C() {
|
|
941
|
-
|
|
934
|
+
y = !0;
|
|
942
935
|
}
|
|
943
|
-
function
|
|
944
|
-
if (
|
|
945
|
-
if (
|
|
936
|
+
function b() {
|
|
937
|
+
if (y) {
|
|
938
|
+
if (y = !1, !f)
|
|
946
939
|
return;
|
|
947
940
|
setTimeout(function() {
|
|
948
941
|
if (!f.contains(document.activeElement)) {
|
|
@@ -968,10 +961,10 @@ function Bt() {
|
|
|
968
961
|
u.length > 0 && u.pop();
|
|
969
962
|
}
|
|
970
963
|
function g(w) {
|
|
971
|
-
f = w, window.addEventListener ? (window.addEventListener("blur", C, !1), document.addEventListener("focus",
|
|
964
|
+
f = w, window.addEventListener ? (window.addEventListener("blur", C, !1), document.addEventListener("focus", b, !0)) : (window.attachEvent("onBlur", C), document.attachEvent("onFocus", b));
|
|
972
965
|
}
|
|
973
966
|
function s() {
|
|
974
|
-
f = null, window.addEventListener ? (window.removeEventListener("blur", C), document.removeEventListener("focus",
|
|
967
|
+
f = null, window.addEventListener ? (window.removeEventListener("blur", C), document.removeEventListener("focus", b)) : (window.detachEvent("onBlur", C), document.detachEvent("onFocus", b));
|
|
975
968
|
}
|
|
976
969
|
return V;
|
|
977
970
|
}
|
|
@@ -981,21 +974,21 @@ function Ut() {
|
|
|
981
974
|
Object.defineProperty(r, "__esModule", {
|
|
982
975
|
value: !0
|
|
983
976
|
}), r.default = m;
|
|
984
|
-
var
|
|
977
|
+
var x = ut(), u = f(x);
|
|
985
978
|
function f(t) {
|
|
986
979
|
return t && t.__esModule ? t : { default: t };
|
|
987
980
|
}
|
|
988
|
-
function
|
|
981
|
+
function y() {
|
|
989
982
|
var t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : document;
|
|
990
|
-
return t.activeElement.shadowRoot ?
|
|
983
|
+
return t.activeElement.shadowRoot ? y(t.activeElement.shadowRoot) : t.activeElement;
|
|
991
984
|
}
|
|
992
985
|
function m(t, C) {
|
|
993
|
-
var
|
|
994
|
-
if (!
|
|
986
|
+
var b = (0, u.default)(t);
|
|
987
|
+
if (!b.length) {
|
|
995
988
|
C.preventDefault();
|
|
996
989
|
return;
|
|
997
990
|
}
|
|
998
|
-
var h = void 0, o = C.shiftKey, v =
|
|
991
|
+
var h = void 0, o = C.shiftKey, v = b[0], g = b[b.length - 1], s = y();
|
|
999
992
|
if (t === s) {
|
|
1000
993
|
if (!o) return;
|
|
1001
994
|
h = g;
|
|
@@ -1006,8 +999,8 @@ function Ut() {
|
|
|
1006
999
|
}
|
|
1007
1000
|
var w = /(\bChrome\b|\bSafari\b)\//.exec(navigator.userAgent), M = w != null && w[1] != "Chrome" && /\biPod\b|\biPad\b/g.exec(navigator.userAgent) == null;
|
|
1008
1001
|
if (M) {
|
|
1009
|
-
var D =
|
|
1010
|
-
if (D > -1 && (D += o ? -1 : 1), h =
|
|
1002
|
+
var D = b.indexOf(s);
|
|
1003
|
+
if (D > -1 && (D += o ? -1 : 1), h = b[D], typeof h > "u") {
|
|
1011
1004
|
C.preventDefault(), h = o ? g : v, h.focus();
|
|
1012
1005
|
return;
|
|
1013
1006
|
}
|
|
@@ -1024,30 +1017,30 @@ function $t() {
|
|
|
1024
1017
|
var l = process.env.NODE_ENV !== "production", r = function() {
|
|
1025
1018
|
};
|
|
1026
1019
|
if (l) {
|
|
1027
|
-
var
|
|
1020
|
+
var x = function(f, y) {
|
|
1028
1021
|
var m = arguments.length;
|
|
1029
|
-
|
|
1022
|
+
y = new Array(m > 1 ? m - 1 : 0);
|
|
1030
1023
|
for (var t = 1; t < m; t++)
|
|
1031
|
-
|
|
1032
|
-
var C = 0,
|
|
1033
|
-
return
|
|
1024
|
+
y[t - 1] = arguments[t];
|
|
1025
|
+
var C = 0, b = "Warning: " + f.replace(/%s/g, function() {
|
|
1026
|
+
return y[C++];
|
|
1034
1027
|
});
|
|
1035
|
-
typeof console < "u" && console.error(
|
|
1028
|
+
typeof console < "u" && console.error(b);
|
|
1036
1029
|
try {
|
|
1037
|
-
throw new Error(
|
|
1030
|
+
throw new Error(b);
|
|
1038
1031
|
} catch {
|
|
1039
1032
|
}
|
|
1040
1033
|
};
|
|
1041
|
-
r = function(u, f,
|
|
1034
|
+
r = function(u, f, y) {
|
|
1042
1035
|
var m = arguments.length;
|
|
1043
|
-
|
|
1036
|
+
y = new Array(m > 2 ? m - 2 : 0);
|
|
1044
1037
|
for (var t = 2; t < m; t++)
|
|
1045
|
-
|
|
1038
|
+
y[t - 2] = arguments[t];
|
|
1046
1039
|
if (f === void 0)
|
|
1047
1040
|
throw new Error(
|
|
1048
1041
|
"`warning(condition, format, ...args)` requires a warning message argument"
|
|
1049
1042
|
);
|
|
1050
|
-
u ||
|
|
1043
|
+
u || x.apply(null, [f].concat(y));
|
|
1051
1044
|
};
|
|
1052
1045
|
}
|
|
1053
1046
|
return Ae = r, Ae;
|
|
@@ -1062,13 +1055,13 @@ var Je;
|
|
|
1062
1055
|
function zt() {
|
|
1063
1056
|
return Je || (Je = 1, function(l) {
|
|
1064
1057
|
(function() {
|
|
1065
|
-
var r = !!(typeof window < "u" && window.document && window.document.createElement),
|
|
1058
|
+
var r = !!(typeof window < "u" && window.document && window.document.createElement), x = {
|
|
1066
1059
|
canUseDOM: r,
|
|
1067
1060
|
canUseWorkers: typeof Worker < "u",
|
|
1068
1061
|
canUseEventListeners: r && !!(window.addEventListener || window.attachEvent),
|
|
1069
1062
|
canUseViewport: r && !!window.screen
|
|
1070
1063
|
};
|
|
1071
|
-
l.exports ? l.exports =
|
|
1064
|
+
l.exports ? l.exports = x : window.ExecutionEnvironment = x;
|
|
1072
1065
|
})();
|
|
1073
1066
|
}(Le)), Le.exports;
|
|
1074
1067
|
}
|
|
@@ -1078,9 +1071,9 @@ function ke() {
|
|
|
1078
1071
|
Xe = 1, Object.defineProperty(ee, "__esModule", {
|
|
1079
1072
|
value: !0
|
|
1080
1073
|
}), ee.canUseDOM = ee.SafeNodeList = ee.SafeHTMLCollection = void 0;
|
|
1081
|
-
var l = zt(), r =
|
|
1082
|
-
function y
|
|
1083
|
-
return
|
|
1074
|
+
var l = zt(), r = x(l);
|
|
1075
|
+
function x(y) {
|
|
1076
|
+
return y && y.__esModule ? y : { default: y };
|
|
1084
1077
|
}
|
|
1085
1078
|
var u = r.default, f = u.canUseDOM ? window.HTMLElement : {};
|
|
1086
1079
|
return ee.SafeHTMLCollection = u.canUseDOM ? window.HTMLCollection : {}, ee.SafeNodeList = u.canUseDOM ? window.NodeList : {}, ee.canUseDOM = u.canUseDOM, ee.default = f, ee;
|
|
@@ -1090,13 +1083,13 @@ function ft() {
|
|
|
1090
1083
|
if (Ze) return X;
|
|
1091
1084
|
Ze = 1, Object.defineProperty(X, "__esModule", {
|
|
1092
1085
|
value: !0
|
|
1093
|
-
}), X.resetState =
|
|
1094
|
-
var l = $t(), r = u(l),
|
|
1086
|
+
}), X.resetState = y, X.log = m, X.assertNodeList = t, X.setElement = C, X.validateElement = b, X.hide = h, X.show = o, X.documentNotReadyOrSSRTesting = v;
|
|
1087
|
+
var l = $t(), r = u(l), x = ke();
|
|
1095
1088
|
function u(g) {
|
|
1096
1089
|
return g && g.__esModule ? g : { default: g };
|
|
1097
1090
|
}
|
|
1098
1091
|
var f = null;
|
|
1099
|
-
function
|
|
1092
|
+
function y() {
|
|
1100
1093
|
f && (f.removeAttribute ? f.removeAttribute("aria-hidden") : f.length != null ? f.forEach(function(g) {
|
|
1101
1094
|
return g.removeAttribute("aria-hidden");
|
|
1102
1095
|
}) : document.querySelectorAll(f).forEach(function(g) {
|
|
@@ -1115,20 +1108,20 @@ function ft() {
|
|
|
1115
1108
|
}
|
|
1116
1109
|
function C(g) {
|
|
1117
1110
|
var s = g;
|
|
1118
|
-
if (typeof s == "string" &&
|
|
1111
|
+
if (typeof s == "string" && x.canUseDOM) {
|
|
1119
1112
|
var w = document.querySelectorAll(s);
|
|
1120
1113
|
t(w, s), s = w;
|
|
1121
1114
|
}
|
|
1122
1115
|
return f = s || f, f;
|
|
1123
1116
|
}
|
|
1124
|
-
function
|
|
1117
|
+
function b(g) {
|
|
1125
1118
|
var s = g || f;
|
|
1126
1119
|
return s ? Array.isArray(s) || s instanceof HTMLCollection || s instanceof NodeList ? s : [s] : ((0, r.default)(!1, ["react-modal: App element is not defined.", "Please use `Modal.setAppElement(el)` or set `appElement={el}`.", "This is needed so screen readers don't see main content", "when modal is opened. It is not recommended, but you can opt-out", "by setting `ariaHideApp={false}`."].join(" ")), []);
|
|
1127
1120
|
}
|
|
1128
1121
|
function h(g) {
|
|
1129
1122
|
var s = !0, w = !1, M = void 0;
|
|
1130
1123
|
try {
|
|
1131
|
-
for (var D =
|
|
1124
|
+
for (var D = b(g)[Symbol.iterator](), A; !(s = (A = D.next()).done); s = !0) {
|
|
1132
1125
|
var W = A.value;
|
|
1133
1126
|
W.setAttribute("aria-hidden", "true");
|
|
1134
1127
|
}
|
|
@@ -1146,7 +1139,7 @@ function ft() {
|
|
|
1146
1139
|
function o(g) {
|
|
1147
1140
|
var s = !0, w = !1, M = void 0;
|
|
1148
1141
|
try {
|
|
1149
|
-
for (var D =
|
|
1142
|
+
for (var D = b(g)[Symbol.iterator](), A; !(s = (A = D.next()).done); s = !0) {
|
|
1150
1143
|
var W = A.value;
|
|
1151
1144
|
W.removeAttribute("aria-hidden");
|
|
1152
1145
|
}
|
|
@@ -1173,31 +1166,31 @@ function Vt() {
|
|
|
1173
1166
|
value: !0
|
|
1174
1167
|
}), ie.resetState = u, ie.log = f;
|
|
1175
1168
|
var l = {}, r = {};
|
|
1176
|
-
function
|
|
1177
|
-
|
|
1169
|
+
function x(b, h) {
|
|
1170
|
+
b.classList.remove(h);
|
|
1178
1171
|
}
|
|
1179
1172
|
function u() {
|
|
1180
|
-
var
|
|
1173
|
+
var b = document.getElementsByTagName("html")[0];
|
|
1181
1174
|
for (var h in l)
|
|
1182
|
-
|
|
1175
|
+
x(b, l[h]);
|
|
1183
1176
|
var o = document.body;
|
|
1184
1177
|
for (var v in r)
|
|
1185
|
-
|
|
1178
|
+
x(o, r[v]);
|
|
1186
1179
|
l = {}, r = {};
|
|
1187
1180
|
}
|
|
1188
1181
|
function f() {
|
|
1189
1182
|
if (process.env.NODE_ENV !== "production") {
|
|
1190
|
-
var
|
|
1183
|
+
var b = document.getElementsByTagName("html")[0].className, h = `Show tracked classes:
|
|
1191
1184
|
|
|
1192
1185
|
`;
|
|
1193
|
-
h += "<html /> (" +
|
|
1186
|
+
h += "<html /> (" + b + `):
|
|
1194
1187
|
`;
|
|
1195
1188
|
for (var o in l)
|
|
1196
1189
|
h += " " + o + " " + l[o] + `
|
|
1197
1190
|
`;
|
|
1198
|
-
|
|
1191
|
+
b = document.body.className, h += `
|
|
1199
1192
|
|
|
1200
|
-
doc.body (` +
|
|
1193
|
+
doc.body (` + b + `):
|
|
1201
1194
|
`;
|
|
1202
1195
|
for (var v in r)
|
|
1203
1196
|
h += " " + v + " " + r[v] + `
|
|
@@ -1206,13 +1199,13 @@ doc.body (` + x + `):
|
|
|
1206
1199
|
`, console.log(h);
|
|
1207
1200
|
}
|
|
1208
1201
|
}
|
|
1209
|
-
var
|
|
1202
|
+
var y = function(h, o) {
|
|
1210
1203
|
return h[o] || (h[o] = 0), h[o] += 1, o;
|
|
1211
1204
|
}, m = function(h, o) {
|
|
1212
1205
|
return h[o] && (h[o] -= 1), o;
|
|
1213
1206
|
}, t = function(h, o, v) {
|
|
1214
1207
|
v.forEach(function(g) {
|
|
1215
|
-
|
|
1208
|
+
y(o, g), h.add(g);
|
|
1216
1209
|
});
|
|
1217
1210
|
}, C = function(h, o, v) {
|
|
1218
1211
|
v.forEach(function(g) {
|
|
@@ -1231,13 +1224,13 @@ function dt() {
|
|
|
1231
1224
|
et = 1, Object.defineProperty(fe, "__esModule", {
|
|
1232
1225
|
value: !0
|
|
1233
1226
|
}), fe.log = u, fe.resetState = f;
|
|
1234
|
-
function l(
|
|
1235
|
-
if (!(
|
|
1227
|
+
function l(y, m) {
|
|
1228
|
+
if (!(y instanceof m))
|
|
1236
1229
|
throw new TypeError("Cannot call a class as a function");
|
|
1237
1230
|
}
|
|
1238
|
-
var r = function
|
|
1231
|
+
var r = function y() {
|
|
1239
1232
|
var m = this;
|
|
1240
|
-
l(this,
|
|
1233
|
+
l(this, y), this.register = function(t) {
|
|
1241
1234
|
if (m.openInstances.indexOf(t) !== -1) {
|
|
1242
1235
|
process.env.NODE_ENV !== "production" && console.warn("React-Modal: Cannot register modal instance that's already open");
|
|
1243
1236
|
return;
|
|
@@ -1261,16 +1254,16 @@ function dt() {
|
|
|
1261
1254
|
);
|
|
1262
1255
|
});
|
|
1263
1256
|
}, this.openInstances = [], this.subscribers = [];
|
|
1264
|
-
},
|
|
1257
|
+
}, x = new r();
|
|
1265
1258
|
function u() {
|
|
1266
|
-
console.log("portalOpenInstances ----------"), console.log(
|
|
1267
|
-
return console.log(
|
|
1259
|
+
console.log("portalOpenInstances ----------"), console.log(x.openInstances.length), x.openInstances.forEach(function(y) {
|
|
1260
|
+
return console.log(y);
|
|
1268
1261
|
}), console.log("end portalOpenInstances ----------");
|
|
1269
1262
|
}
|
|
1270
1263
|
function f() {
|
|
1271
|
-
|
|
1264
|
+
x = new r();
|
|
1272
1265
|
}
|
|
1273
|
-
return fe.default =
|
|
1266
|
+
return fe.default = x, fe;
|
|
1274
1267
|
}
|
|
1275
1268
|
var ge = {}, tt;
|
|
1276
1269
|
function Gt() {
|
|
@@ -1278,20 +1271,20 @@ function Gt() {
|
|
|
1278
1271
|
tt = 1, Object.defineProperty(ge, "__esModule", {
|
|
1279
1272
|
value: !0
|
|
1280
1273
|
}), ge.resetState = m, ge.log = t;
|
|
1281
|
-
var l = dt(), r =
|
|
1282
|
-
function
|
|
1274
|
+
var l = dt(), r = x(l);
|
|
1275
|
+
function x(h) {
|
|
1283
1276
|
return h && h.__esModule ? h : { default: h };
|
|
1284
1277
|
}
|
|
1285
|
-
var u = void 0, f = void 0,
|
|
1278
|
+
var u = void 0, f = void 0, y = [];
|
|
1286
1279
|
function m() {
|
|
1287
1280
|
for (var h = [u, f], o = 0; o < h.length; o++) {
|
|
1288
1281
|
var v = h[o];
|
|
1289
1282
|
v && v.parentNode && v.parentNode.removeChild(v);
|
|
1290
1283
|
}
|
|
1291
|
-
u = f = null,
|
|
1284
|
+
u = f = null, y = [];
|
|
1292
1285
|
}
|
|
1293
1286
|
function t() {
|
|
1294
|
-
console.log("bodyTrap ----------"), console.log(
|
|
1287
|
+
console.log("bodyTrap ----------"), console.log(y.length);
|
|
1295
1288
|
for (var h = [u, f], o = 0; o < h.length; o++) {
|
|
1296
1289
|
var v = h[o], g = v || {};
|
|
1297
1290
|
console.log(g.nodeName, g.className, g.id);
|
|
@@ -1299,16 +1292,16 @@ function Gt() {
|
|
|
1299
1292
|
console.log("edn bodyTrap ----------");
|
|
1300
1293
|
}
|
|
1301
1294
|
function C() {
|
|
1302
|
-
if (
|
|
1295
|
+
if (y.length === 0) {
|
|
1303
1296
|
process.env.NODE_ENV !== "production" && console.warn("React-Modal: Open instances > 0 expected");
|
|
1304
1297
|
return;
|
|
1305
1298
|
}
|
|
1306
|
-
|
|
1299
|
+
y[y.length - 1].focusContent();
|
|
1307
1300
|
}
|
|
1308
|
-
function
|
|
1309
|
-
!u && !f && (u = document.createElement("div"), u.setAttribute("data-react-modal-body-trap", ""), u.style.position = "absolute", u.style.opacity = "0", u.setAttribute("tabindex", "0"), u.addEventListener("focus", C), f = u.cloneNode(), f.addEventListener("focus", C)),
|
|
1301
|
+
function b(h, o) {
|
|
1302
|
+
!u && !f && (u = document.createElement("div"), u.setAttribute("data-react-modal-body-trap", ""), u.style.position = "absolute", u.style.opacity = "0", u.setAttribute("tabindex", "0"), u.addEventListener("focus", C), f = u.cloneNode(), f.addEventListener("focus", C)), y = o, y.length > 0 ? (document.body.firstChild !== u && document.body.insertBefore(u, document.body.firstChild), document.body.lastChild !== f && document.body.appendChild(f)) : (u.parentElement && u.parentElement.removeChild(u), f.parentElement && f.parentElement.removeChild(f));
|
|
1310
1303
|
}
|
|
1311
|
-
return r.default.subscribe(
|
|
1304
|
+
return r.default.subscribe(b), ge;
|
|
1312
1305
|
}
|
|
1313
1306
|
var nt;
|
|
1314
1307
|
function Kt() {
|
|
@@ -1316,7 +1309,7 @@ function Kt() {
|
|
|
1316
1309
|
Object.defineProperty(r, "__esModule", {
|
|
1317
1310
|
value: !0
|
|
1318
1311
|
});
|
|
1319
|
-
var
|
|
1312
|
+
var x = Object.assign || function(i) {
|
|
1320
1313
|
for (var c = 1; c < arguments.length; c++) {
|
|
1321
1314
|
var E = arguments[c];
|
|
1322
1315
|
for (var e in E)
|
|
@@ -1337,7 +1330,7 @@ function Kt() {
|
|
|
1337
1330
|
return function(c, E, e) {
|
|
1338
1331
|
return E && i(c.prototype, E), e && i(c, e), c;
|
|
1339
1332
|
};
|
|
1340
|
-
}(),
|
|
1333
|
+
}(), y = ye, m = /* @__PURE__ */ st(), t = N(m), C = Bt(), b = H(C), h = Ut(), o = N(h), v = ft(), g = H(v), s = Vt(), w = H(s), M = ke(), D = N(M), A = dt(), W = N(A);
|
|
1341
1334
|
Gt();
|
|
1342
1335
|
function H(i) {
|
|
1343
1336
|
if (i && i.__esModule)
|
|
@@ -1383,9 +1376,9 @@ function Kt() {
|
|
|
1383
1376
|
e.content = d, e.props.contentRef && e.props.contentRef(d);
|
|
1384
1377
|
}, e.afterClose = function() {
|
|
1385
1378
|
var d = e.props, _ = d.appElement, S = d.ariaHideApp, j = d.htmlOpenClassName, q = d.bodyOpenClassName, z = d.parentSelector, te = z && z().ownerDocument || document;
|
|
1386
|
-
q && w.remove(te.body, q), j && w.remove(te.getElementsByTagName("html")[0], j), S && a > 0 && (a -= 1, a === 0 && g.show(_)), e.props.shouldFocusAfterRender && (e.props.shouldReturnFocusAfterClose ? (
|
|
1379
|
+
q && w.remove(te.body, q), j && w.remove(te.getElementsByTagName("html")[0], j), S && a > 0 && (a -= 1, a === 0 && g.show(_)), e.props.shouldFocusAfterRender && (e.props.shouldReturnFocusAfterClose ? (b.returnFocus(e.props.preventScroll), b.teardownScopedFocus()) : b.popWithoutFocus()), e.props.onAfterClose && e.props.onAfterClose(), W.default.deregister(e);
|
|
1387
1380
|
}, e.open = function() {
|
|
1388
|
-
e.beforeOpen(), e.state.afterOpen && e.state.beforeClose ? (clearTimeout(e.closeTimer), e.setState({ beforeClose: !1 })) : (e.props.shouldFocusAfterRender && (
|
|
1381
|
+
e.beforeOpen(), e.state.afterOpen && e.state.beforeClose ? (clearTimeout(e.closeTimer), e.setState({ beforeClose: !1 })) : (e.props.shouldFocusAfterRender && (b.setupScopedFocus(e.node), b.markForFocusLater()), e.setState({ isOpen: !0 }, function() {
|
|
1389
1382
|
e.openAnimationFrame = requestAnimationFrame(function() {
|
|
1390
1383
|
e.setState({ afterOpen: !0 }), e.props.isOpen && e.props.onAfterOpen && e.props.onAfterOpen({
|
|
1391
1384
|
overlayEl: e.overlay,
|
|
@@ -1476,13 +1469,13 @@ function Kt() {
|
|
|
1476
1469
|
var ce = {
|
|
1477
1470
|
ref: this.setOverlayRef,
|
|
1478
1471
|
className: this.buildClassName("overlay", S),
|
|
1479
|
-
style:
|
|
1472
|
+
style: x({}, te, this.props.style.overlay),
|
|
1480
1473
|
onClick: this.handleOverlayOnClick,
|
|
1481
1474
|
onMouseDown: this.handleOverlayOnMouseDown
|
|
1482
|
-
}, oe =
|
|
1475
|
+
}, oe = x({
|
|
1483
1476
|
id: d,
|
|
1484
1477
|
ref: this.setContentRef,
|
|
1485
|
-
style:
|
|
1478
|
+
style: x({}, z, this.props.style.content),
|
|
1486
1479
|
className: this.buildClassName("content", _),
|
|
1487
1480
|
tabIndex: "-1",
|
|
1488
1481
|
onKeyDown: this.handleKeyDown,
|
|
@@ -1491,13 +1484,13 @@ function Kt() {
|
|
|
1491
1484
|
onClick: this.handleContentOnClick,
|
|
1492
1485
|
role: this.props.role,
|
|
1493
1486
|
"aria-label": this.props.contentLabel
|
|
1494
|
-
}, this.attributesFromObject("aria",
|
|
1487
|
+
}, this.attributesFromObject("aria", x({ modal: !0 }, this.props.aria)), this.attributesFromObject("data", this.props.data || {}), {
|
|
1495
1488
|
"data-testid": this.props.testId
|
|
1496
1489
|
}), P = this.props.contentElement(oe, q);
|
|
1497
1490
|
return this.props.overlayElement(ce, P);
|
|
1498
1491
|
}
|
|
1499
1492
|
}]), c;
|
|
1500
|
-
}(
|
|
1493
|
+
}(y.Component);
|
|
1501
1494
|
O.defaultProps = {
|
|
1502
1495
|
style: {
|
|
1503
1496
|
overlay: {},
|
|
@@ -1549,21 +1542,21 @@ function pt() {
|
|
|
1549
1542
|
l != null && this.setState(l);
|
|
1550
1543
|
}
|
|
1551
1544
|
function ht(l) {
|
|
1552
|
-
function r(
|
|
1553
|
-
var u = this.constructor.getDerivedStateFromProps(l,
|
|
1545
|
+
function r(x) {
|
|
1546
|
+
var u = this.constructor.getDerivedStateFromProps(l, x);
|
|
1554
1547
|
return u ?? null;
|
|
1555
1548
|
}
|
|
1556
1549
|
this.setState(r.bind(this));
|
|
1557
1550
|
}
|
|
1558
1551
|
function mt(l, r) {
|
|
1559
1552
|
try {
|
|
1560
|
-
var
|
|
1553
|
+
var x = this.props, u = this.state;
|
|
1561
1554
|
this.props = l, this.state = r, this.__reactInternalSnapshotFlag = !0, this.__reactInternalSnapshot = this.getSnapshotBeforeUpdate(
|
|
1562
|
-
|
|
1555
|
+
x,
|
|
1563
1556
|
u
|
|
1564
1557
|
);
|
|
1565
1558
|
} finally {
|
|
1566
|
-
this.props =
|
|
1559
|
+
this.props = x, this.state = u;
|
|
1567
1560
|
}
|
|
1568
1561
|
}
|
|
1569
1562
|
pt.__suppressDeprecationWarning = !0;
|
|
@@ -1575,14 +1568,14 @@ function Yt(l) {
|
|
|
1575
1568
|
throw new Error("Can only polyfill class components");
|
|
1576
1569
|
if (typeof l.getDerivedStateFromProps != "function" && typeof r.getSnapshotBeforeUpdate != "function")
|
|
1577
1570
|
return l;
|
|
1578
|
-
var
|
|
1579
|
-
if (typeof r.componentWillMount == "function" ?
|
|
1580
|
-
var
|
|
1571
|
+
var x = null, u = null, f = null;
|
|
1572
|
+
if (typeof r.componentWillMount == "function" ? x = "componentWillMount" : typeof r.UNSAFE_componentWillMount == "function" && (x = "UNSAFE_componentWillMount"), typeof r.componentWillReceiveProps == "function" ? u = "componentWillReceiveProps" : typeof r.UNSAFE_componentWillReceiveProps == "function" && (u = "UNSAFE_componentWillReceiveProps"), typeof r.componentWillUpdate == "function" ? f = "componentWillUpdate" : typeof r.UNSAFE_componentWillUpdate == "function" && (f = "UNSAFE_componentWillUpdate"), x !== null || u !== null || f !== null) {
|
|
1573
|
+
var y = l.displayName || l.name, m = typeof l.getDerivedStateFromProps == "function" ? "getDerivedStateFromProps()" : "getSnapshotBeforeUpdate()";
|
|
1581
1574
|
throw Error(
|
|
1582
1575
|
`Unsafe legacy lifecycles will not be called for components using new component APIs.
|
|
1583
1576
|
|
|
1584
|
-
` +
|
|
1585
|
-
` +
|
|
1577
|
+
` + y + " uses " + m + " but also contains the following legacy lifecycles:" + (x !== null ? `
|
|
1578
|
+
` + x : "") + (u !== null ? `
|
|
1586
1579
|
` + u : "") + (f !== null ? `
|
|
1587
1580
|
` + f : "") + `
|
|
1588
1581
|
|
|
@@ -1597,9 +1590,9 @@ https://fb.me/react-async-component-lifecycle-hooks`
|
|
|
1597
1590
|
);
|
|
1598
1591
|
r.componentWillUpdate = mt;
|
|
1599
1592
|
var t = r.componentDidUpdate;
|
|
1600
|
-
r.componentDidUpdate = function(
|
|
1593
|
+
r.componentDidUpdate = function(b, h, o) {
|
|
1601
1594
|
var v = this.__reactInternalSnapshotFlag ? this.__reactInternalSnapshot : o;
|
|
1602
|
-
t.call(this,
|
|
1595
|
+
t.call(this, b, h, v);
|
|
1603
1596
|
};
|
|
1604
1597
|
}
|
|
1605
1598
|
return l;
|
|
@@ -1607,13 +1600,13 @@ https://fb.me/react-async-component-lifecycle-hooks`
|
|
|
1607
1600
|
const Jt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1608
1601
|
__proto__: null,
|
|
1609
1602
|
polyfill: Yt
|
|
1610
|
-
}, Symbol.toStringTag, { value: "Module" })), Xt = /* @__PURE__ */
|
|
1603
|
+
}, Symbol.toStringTag, { value: "Module" })), Xt = /* @__PURE__ */ Ot(Jt);
|
|
1611
1604
|
var rt;
|
|
1612
1605
|
function Zt() {
|
|
1613
|
-
if (rt) return
|
|
1614
|
-
rt = 1, Object.defineProperty(
|
|
1606
|
+
if (rt) return le;
|
|
1607
|
+
rt = 1, Object.defineProperty(le, "__esModule", {
|
|
1615
1608
|
value: !0
|
|
1616
|
-
}),
|
|
1609
|
+
}), le.bodyOpenClassName = le.portalClassName = void 0;
|
|
1617
1610
|
var l = Object.assign || function(p) {
|
|
1618
1611
|
for (var a = 1; a < arguments.length; a++) {
|
|
1619
1612
|
var O = arguments[a];
|
|
@@ -1631,7 +1624,7 @@ function Zt() {
|
|
|
1631
1624
|
return function(a, O, i) {
|
|
1632
1625
|
return O && p(a.prototype, O), i && p(a, i), a;
|
|
1633
1626
|
};
|
|
1634
|
-
}(),
|
|
1627
|
+
}(), x = ye, u = M(x), f = Ft, y = M(f), m = /* @__PURE__ */ st(), t = M(m), C = Kt(), b = M(C), h = ft(), o = w(h), v = ke(), g = M(v), s = Xt;
|
|
1635
1628
|
function w(p) {
|
|
1636
1629
|
if (p && p.__esModule)
|
|
1637
1630
|
return p;
|
|
@@ -1658,10 +1651,10 @@ function Zt() {
|
|
|
1658
1651
|
throw new TypeError("Super expression must either be null or a function, not " + typeof a);
|
|
1659
1652
|
p.prototype = Object.create(a && a.prototype, { constructor: { value: p, enumerable: !1, writable: !0, configurable: !0 } }), a && (Object.setPrototypeOf ? Object.setPrototypeOf(p, a) : p.__proto__ = a);
|
|
1660
1653
|
}
|
|
1661
|
-
var H =
|
|
1654
|
+
var H = le.portalClassName = "ReactModalPortal", N = le.bodyOpenClassName = "ReactModal__Body--open", I = v.canUseDOM && y.default.createPortal !== void 0, T = function(a) {
|
|
1662
1655
|
return document.createElement(a);
|
|
1663
1656
|
}, R = function() {
|
|
1664
|
-
return I ?
|
|
1657
|
+
return I ? y.default.createPortal : y.default.unstable_renderSubtreeIntoContainer;
|
|
1665
1658
|
};
|
|
1666
1659
|
function k(p) {
|
|
1667
1660
|
return p();
|
|
@@ -1674,13 +1667,13 @@ function Zt() {
|
|
|
1674
1667
|
for (var e = arguments.length, d = Array(e), _ = 0; _ < e; _++)
|
|
1675
1668
|
d[_] = arguments[_];
|
|
1676
1669
|
return E = (i = (c = A(this, (O = a.__proto__ || Object.getPrototypeOf(a)).call.apply(O, [this].concat(d))), c), c.removePortal = function() {
|
|
1677
|
-
!I &&
|
|
1670
|
+
!I && y.default.unmountComponentAtNode(c.node);
|
|
1678
1671
|
var S = k(c.props.parentSelector);
|
|
1679
1672
|
S && S.contains(c.node) ? S.removeChild(c.node) : console.warn('React-Modal: "parentSelector" prop did not returned any DOM element. Make sure that the parent element is unmounted to avoid any memory leaks.');
|
|
1680
1673
|
}, c.portalRef = function(S) {
|
|
1681
1674
|
c.portal = S;
|
|
1682
1675
|
}, c.renderPortal = function(S) {
|
|
1683
|
-
var j = R(), q = j(c, u.default.createElement(
|
|
1676
|
+
var j = R(), q = j(c, u.default.createElement(b.default, l({ defaultStyles: a.defaultStyles }, S)), c.node);
|
|
1684
1677
|
c.portalRef(q);
|
|
1685
1678
|
}, i), A(c, E);
|
|
1686
1679
|
}
|
|
@@ -1724,7 +1717,7 @@ function Zt() {
|
|
|
1724
1717
|
return null;
|
|
1725
1718
|
!this.node && I && (this.node = T("div"));
|
|
1726
1719
|
var i = R();
|
|
1727
|
-
return i(u.default.createElement(
|
|
1720
|
+
return i(u.default.createElement(b.default, l({
|
|
1728
1721
|
ref: this.portalRef,
|
|
1729
1722
|
defaultStyles: a.defaultStyles
|
|
1730
1723
|
}, this.props)), this.node);
|
|
@@ -1737,7 +1730,7 @@ function Zt() {
|
|
|
1737
1730
|
/* eslint-disable react/no-unused-prop-types */
|
|
1738
1731
|
/* eslint-enable react/no-unused-prop-types */
|
|
1739
1732
|
}]), a;
|
|
1740
|
-
}(
|
|
1733
|
+
}(x.Component);
|
|
1741
1734
|
return L.propTypes = {
|
|
1742
1735
|
isOpen: t.default.bool.isRequired,
|
|
1743
1736
|
style: t.default.shape({
|
|
@@ -1831,7 +1824,7 @@ function Zt() {
|
|
|
1831
1824
|
}
|
|
1832
1825
|
}, (0, s.polyfill)(L), process.env.NODE_ENV !== "production" && (L.setCreateHTMLElement = function(p) {
|
|
1833
1826
|
return T = p;
|
|
1834
|
-
}),
|
|
1827
|
+
}), le.default = L, le;
|
|
1835
1828
|
}
|
|
1836
1829
|
var lt;
|
|
1837
1830
|
function Qt() {
|
|
@@ -1839,9 +1832,9 @@ function Qt() {
|
|
|
1839
1832
|
Object.defineProperty(r, "__esModule", {
|
|
1840
1833
|
value: !0
|
|
1841
1834
|
});
|
|
1842
|
-
var
|
|
1843
|
-
function f(
|
|
1844
|
-
return
|
|
1835
|
+
var x = Zt(), u = f(x);
|
|
1836
|
+
function f(y) {
|
|
1837
|
+
return y && y.__esModule ? y : { default: y };
|
|
1845
1838
|
}
|
|
1846
1839
|
r.default = u.default, l.exports = r.default;
|
|
1847
1840
|
}(Ce, Ce.exports)), Ce.exports;
|
|
@@ -1850,14 +1843,14 @@ var en = Qt();
|
|
|
1850
1843
|
const gt = /* @__PURE__ */ ot(en), tn = (l) => {
|
|
1851
1844
|
const {
|
|
1852
1845
|
openState: r,
|
|
1853
|
-
closePopupCallback:
|
|
1846
|
+
closePopupCallback: x,
|
|
1854
1847
|
headingIconFile: u,
|
|
1855
1848
|
headingText: f,
|
|
1856
|
-
subHeadingText:
|
|
1849
|
+
subHeadingText: y,
|
|
1857
1850
|
positiveButtonText: m,
|
|
1858
1851
|
negativeButtonText: t,
|
|
1859
1852
|
classNamePositiveBtn: C,
|
|
1860
|
-
classNameNegativeBtn:
|
|
1853
|
+
classNameNegativeBtn: b,
|
|
1861
1854
|
positiveActionCallback: h,
|
|
1862
1855
|
negativeActionCallback: o
|
|
1863
1856
|
} = l;
|
|
@@ -1865,7 +1858,7 @@ const gt = /* @__PURE__ */ ot(en), tn = (l) => {
|
|
|
1865
1858
|
gt,
|
|
1866
1859
|
{
|
|
1867
1860
|
isOpen: r,
|
|
1868
|
-
onRequestClose:
|
|
1861
|
+
onRequestClose: x,
|
|
1869
1862
|
shouldCloseOnOverlayClick: !1,
|
|
1870
1863
|
style: {
|
|
1871
1864
|
overlay: {
|
|
@@ -1892,7 +1885,7 @@ const gt = /* @__PURE__ */ ot(en), tn = (l) => {
|
|
|
1892
1885
|
children: [
|
|
1893
1886
|
u == "warning" && /* @__PURE__ */ n.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__ */ n.jsx("i", { className: "hx_warning hfl-text-5" }) }),
|
|
1894
1887
|
/* @__PURE__ */ n.jsx($, { variant: "Medium", type: "Text xl", className: "hfl-mt-5 hfl-text-Gray-900", children: f }),
|
|
1895
|
-
|
|
1888
|
+
y && /* @__PURE__ */ n.jsx($, { variant: "Regular", type: "Text sm", className: "hfl-mt-1 hfl-text-Gray-500 ", children: y }),
|
|
1896
1889
|
/* @__PURE__ */ n.jsxs("div", { className: "hfl-mt-4 hfl-flex hfl-items-center hfl-justify-center hfl-gap-4", children: [
|
|
1897
1890
|
t && /* @__PURE__ */ n.jsx(
|
|
1898
1891
|
be,
|
|
@@ -1900,7 +1893,7 @@ const gt = /* @__PURE__ */ ot(en), tn = (l) => {
|
|
|
1900
1893
|
size: "md",
|
|
1901
1894
|
textField: t,
|
|
1902
1895
|
hierarchy: "Primary",
|
|
1903
|
-
className:
|
|
1896
|
+
className: b || "",
|
|
1904
1897
|
onClick: o,
|
|
1905
1898
|
"data-qa": "negative-action"
|
|
1906
1899
|
}
|
|
@@ -1920,8 +1913,8 @@ const gt = /* @__PURE__ */ ot(en), tn = (l) => {
|
|
|
1920
1913
|
]
|
|
1921
1914
|
}
|
|
1922
1915
|
);
|
|
1923
|
-
}, nn = ({ open: l, onCancel: r, onCopySave:
|
|
1924
|
-
const [
|
|
1916
|
+
}, nn = ({ open: l, onCancel: r, onCopySave: x, rowMedicineData: u, getMedicineOptions: f }) => {
|
|
1917
|
+
const [y, m] = K([]), [t, C] = K(""), [b, h] = K([]), o = G(
|
|
1925
1918
|
async (w) => {
|
|
1926
1919
|
const D = (await f?.(w))?.map(
|
|
1927
1920
|
(A) => ({
|
|
@@ -1933,12 +1926,12 @@ const gt = /* @__PURE__ */ ot(en), tn = (l) => {
|
|
|
1933
1926
|
},
|
|
1934
1927
|
[f]
|
|
1935
1928
|
);
|
|
1936
|
-
|
|
1929
|
+
ae(() => {
|
|
1937
1930
|
l && o(t);
|
|
1938
1931
|
}, [t, o, l]);
|
|
1939
1932
|
const v = (w) => {
|
|
1940
1933
|
const M = w.value;
|
|
1941
|
-
|
|
1934
|
+
y.some(
|
|
1942
1935
|
(A) => A.medicineId === M.medicineId && A.doctorMedicineName.trim().toLowerCase() === M.doctorMedicineName.trim().toLowerCase()
|
|
1943
1936
|
) || m((A) => [...A, M]), C(""), h([]);
|
|
1944
1937
|
}, g = (w) => {
|
|
@@ -1990,11 +1983,11 @@ const gt = /* @__PURE__ */ ot(en), tn = (l) => {
|
|
|
1990
1983
|
inputChangeHandler: C,
|
|
1991
1984
|
onChangeHandler: v,
|
|
1992
1985
|
onInputFocus: s,
|
|
1993
|
-
options:
|
|
1986
|
+
options: b,
|
|
1994
1987
|
placeholder: "Search for medicines"
|
|
1995
1988
|
}
|
|
1996
1989
|
),
|
|
1997
|
-
/* @__PURE__ */ n.jsx("div", { className: "hfl-flex hfl-flex-wrap hfl-gap-2", children:
|
|
1990
|
+
/* @__PURE__ */ n.jsx("div", { className: "hfl-flex hfl-flex-wrap hfl-gap-2", children: y.map((w) => /* @__PURE__ */ n.jsxs(
|
|
1998
1991
|
"div",
|
|
1999
1992
|
{
|
|
2000
1993
|
className: "hfl-flex hfl-items-center hfl-bg-Gray-100 hfl-px-2 hfl-py-0.5 hfl-rounded-md hfl-gap-1",
|
|
@@ -2013,9 +2006,9 @@ const gt = /* @__PURE__ */ ot(en), tn = (l) => {
|
|
|
2013
2006
|
{
|
|
2014
2007
|
size: "md",
|
|
2015
2008
|
textField: "Save",
|
|
2016
|
-
disabled: !
|
|
2009
|
+
disabled: !y || y.length == 0,
|
|
2017
2010
|
onClick: async () => {
|
|
2018
|
-
await
|
|
2011
|
+
await x(u, y) && r();
|
|
2019
2012
|
},
|
|
2020
2013
|
className: "hfl-bg-Primary-600 hfl-text-White disabled:hfl-opacity-50 disabled:hfl-cursor-not-allowed",
|
|
2021
2014
|
hierarchy: "Primary"
|
|
@@ -2025,18 +2018,18 @@ const gt = /* @__PURE__ */ ot(en), tn = (l) => {
|
|
|
2025
2018
|
]
|
|
2026
2019
|
}
|
|
2027
2020
|
);
|
|
2028
|
-
},
|
|
2021
|
+
}, un = St(
|
|
2029
2022
|
({
|
|
2030
2023
|
data: l = [],
|
|
2031
2024
|
variant: r,
|
|
2032
|
-
externallyTriggeredEditRowIds:
|
|
2025
|
+
externallyTriggeredEditRowIds: x = [],
|
|
2033
2026
|
externallyTriggeredEditMode: u = !1,
|
|
2034
2027
|
allowCustomMedicineInput: f = !0,
|
|
2035
|
-
getMedicineOptions:
|
|
2028
|
+
getMedicineOptions: y,
|
|
2036
2029
|
onRowChange: m,
|
|
2037
2030
|
onRowDelete: t,
|
|
2038
2031
|
onRowCopy: C,
|
|
2039
|
-
onSaveRow:
|
|
2032
|
+
onSaveRow: b,
|
|
2040
2033
|
externalSaveTrigger: h,
|
|
2041
2034
|
setSearchDisabled: o
|
|
2042
2035
|
}, v) => {
|
|
@@ -2052,7 +2045,7 @@ const gt = /* @__PURE__ */ ot(en), tn = (l) => {
|
|
|
2052
2045
|
const p = l.filter((a) => a.isEditing && a.medicine_name);
|
|
2053
2046
|
if (p.length !== 0)
|
|
2054
2047
|
try {
|
|
2055
|
-
await
|
|
2048
|
+
await b?.(p) && p.forEach((O) => {
|
|
2056
2049
|
m?.({ ...O, isEditing: !1 });
|
|
2057
2050
|
});
|
|
2058
2051
|
} catch (a) {
|
|
@@ -2060,10 +2053,10 @@ const gt = /* @__PURE__ */ ot(en), tn = (l) => {
|
|
|
2060
2053
|
} finally {
|
|
2061
2054
|
o?.(!1);
|
|
2062
2055
|
}
|
|
2063
|
-
}, [l,
|
|
2064
|
-
|
|
2056
|
+
}, [l, b, m, o]);
|
|
2057
|
+
ae(() => {
|
|
2065
2058
|
h && H();
|
|
2066
|
-
}, [h, H]),
|
|
2059
|
+
}, [h, H]), ae(() => {
|
|
2067
2060
|
const p = l.some((a) => a.isEditing);
|
|
2068
2061
|
o?.(p);
|
|
2069
2062
|
}, [l, o]);
|
|
@@ -2083,30 +2076,30 @@ const gt = /* @__PURE__ */ ot(en), tn = (l) => {
|
|
|
2083
2076
|
}, []), R = G(
|
|
2084
2077
|
async (p) => {
|
|
2085
2078
|
try {
|
|
2086
|
-
return await
|
|
2079
|
+
return await b?.([p]) ? (m?.({ ...p, isEditing: !1 }), !0) : !1;
|
|
2087
2080
|
} catch (a) {
|
|
2088
2081
|
return console.error("Save row failed", a), !1;
|
|
2089
2082
|
}
|
|
2090
2083
|
},
|
|
2091
|
-
[
|
|
2084
|
+
[b, m]
|
|
2092
2085
|
), k = G(async () => {
|
|
2093
2086
|
const p = l.filter((a) => a.isEditing && a.medicine_name);
|
|
2094
2087
|
if (p.length === 0) return !0;
|
|
2095
2088
|
try {
|
|
2096
|
-
const a = await
|
|
2089
|
+
const a = await b?.(p);
|
|
2097
2090
|
return a && l.map((i) => i.isEditing ? { ...i, isEditing: !1 } : i).forEach((i) => m?.(i)), !!a;
|
|
2098
2091
|
} catch (a) {
|
|
2099
2092
|
return console.error("External bulk save failed", a), !1;
|
|
2100
2093
|
}
|
|
2101
|
-
}, [l,
|
|
2102
|
-
|
|
2094
|
+
}, [l, b, m]);
|
|
2095
|
+
Mt(v, () => ({
|
|
2103
2096
|
triggerExternalSave: k
|
|
2104
2097
|
}));
|
|
2105
2098
|
const L = {
|
|
2106
2099
|
variant: r,
|
|
2107
2100
|
externallyTriggeredEditMode: u,
|
|
2108
|
-
externallyTriggeredEditRowIds:
|
|
2109
|
-
getMedicineOptions:
|
|
2101
|
+
externallyTriggeredEditRowIds: x,
|
|
2102
|
+
getMedicineOptions: y,
|
|
2110
2103
|
onRowChange: (p, a) => {
|
|
2111
2104
|
W(p.rowId, p, a), m?.(p, a);
|
|
2112
2105
|
},
|
|
@@ -2116,7 +2109,7 @@ const gt = /* @__PURE__ */ ot(en), tn = (l) => {
|
|
|
2116
2109
|
openPopupForRow: N
|
|
2117
2110
|
};
|
|
2118
2111
|
return /* @__PURE__ */ n.jsxs("div", { className: "hfl-border-1 hfl-border-Gray-200", children: [
|
|
2119
|
-
/* @__PURE__ */ n.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:
|
|
2112
|
+
/* @__PURE__ */ n.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: Dt.map((p) => /* @__PURE__ */ n.jsx($, { variant: "Medium", type: "Text sm", className: "hfl-text-Blue_gray-600", children: p }, p)) }),
|
|
2120
2113
|
/* @__PURE__ */ n.jsxs(it.Provider, { value: L, children: [
|
|
2121
2114
|
/* @__PURE__ */ n.jsx("div", { className: "table-body", children: l.length === 0 ? /* @__PURE__ */ n.jsx($, { variant: "Medium", type: "Text sm", className: "hfl-text-Blue_gray-600 hfl-px-2 hfl-py-3", children: "No medicines added" }) : l.map((p) => /* @__PURE__ */ n.jsx(
|
|
2122
2115
|
Wt,
|
|
@@ -2151,7 +2144,7 @@ const gt = /* @__PURE__ */ ot(en), tn = (l) => {
|
|
|
2151
2144
|
onCancel: () => M(!1),
|
|
2152
2145
|
onCopySave: C,
|
|
2153
2146
|
rowMedicineData: D,
|
|
2154
|
-
getMedicineOptions:
|
|
2147
|
+
getMedicineOptions: y
|
|
2155
2148
|
}
|
|
2156
2149
|
)
|
|
2157
2150
|
] })
|
|
@@ -2159,5 +2152,5 @@ const gt = /* @__PURE__ */ ot(en), tn = (l) => {
|
|
|
2159
2152
|
}
|
|
2160
2153
|
);
|
|
2161
2154
|
export {
|
|
2162
|
-
|
|
2155
|
+
un as P
|
|
2163
2156
|
};
|