@crystaltech/hsms-shared-ui 0.7.14-alpha.0.2 → 0.7.14-alpha.0.4
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/components/HospitalSelect.d.ts +1 -0
- package/dist/index.es.js +25 -22
- package/dist/index.js +1 -1
- package/dist/sw.js +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -28381,40 +28381,43 @@ const J8 = ({
|
|
|
28381
28381
|
size: r = "small"
|
|
28382
28382
|
}) => {
|
|
28383
28383
|
const [i, a] = Ve(e || null), [s, l] = Ve([]), [c, u] = Ve(!0);
|
|
28384
|
-
|
|
28384
|
+
if (Tt(() => {
|
|
28385
28385
|
(async () => {
|
|
28386
28386
|
try {
|
|
28387
|
-
const
|
|
28388
|
-
if (!(
|
|
28389
|
-
const
|
|
28390
|
-
`${
|
|
28387
|
+
const p = Zr(), g = localStorage.getItem("organization_info"), A = g ? JSON.parse(g) : null;
|
|
28388
|
+
if (!(A != null && A.id)) return;
|
|
28389
|
+
const h = await fetch(
|
|
28390
|
+
`${p}/api/public/organization/hospitals?orgId=${A.id}`
|
|
28391
28391
|
);
|
|
28392
|
-
if (!
|
|
28393
|
-
throw new Error(`HTTP error! status: ${
|
|
28394
|
-
const
|
|
28395
|
-
l((
|
|
28396
|
-
} catch (
|
|
28397
|
-
console.error("Failed to load hospitals:",
|
|
28392
|
+
if (!h.ok)
|
|
28393
|
+
throw new Error(`HTTP error! status: ${h.status}`);
|
|
28394
|
+
const m = await h.json();
|
|
28395
|
+
l((m == null ? void 0 : m.data) || []);
|
|
28396
|
+
} catch (p) {
|
|
28397
|
+
console.error("Failed to load hospitals:", p);
|
|
28398
28398
|
} finally {
|
|
28399
28399
|
u(!1);
|
|
28400
28400
|
}
|
|
28401
28401
|
})();
|
|
28402
28402
|
}, []), Tt(() => {
|
|
28403
28403
|
s.length === 1 && i === null && (a(s[0]), t == null || t(s[0]));
|
|
28404
|
-
}, [s, i, t]), c
|
|
28404
|
+
}, [s, i, t]), c)
|
|
28405
|
+
return /* @__PURE__ */ b(Xf, { fullScreen: !0 });
|
|
28406
|
+
const d = localStorage.getItem("i18nextLng") === "bn";
|
|
28407
|
+
return /* @__PURE__ */ b(
|
|
28405
28408
|
gC,
|
|
28406
28409
|
{
|
|
28407
28410
|
value: i,
|
|
28408
28411
|
options: s,
|
|
28409
|
-
getOptionLabel: (
|
|
28412
|
+
getOptionLabel: (f) => f.hospitalName,
|
|
28410
28413
|
noOptionsText: "No hospitals found",
|
|
28411
|
-
onChange: (
|
|
28412
|
-
a(
|
|
28414
|
+
onChange: (f, p) => {
|
|
28415
|
+
a(p), t == null || t(p);
|
|
28413
28416
|
},
|
|
28414
|
-
renderInput: (
|
|
28417
|
+
renderInput: (f) => /* @__PURE__ */ b(
|
|
28415
28418
|
ms,
|
|
28416
28419
|
{
|
|
28417
|
-
...
|
|
28420
|
+
...f,
|
|
28418
28421
|
label: n,
|
|
28419
28422
|
size: r,
|
|
28420
28423
|
sx: {
|
|
@@ -28425,7 +28428,7 @@ const J8 = ({
|
|
|
28425
28428
|
}
|
|
28426
28429
|
}
|
|
28427
28430
|
),
|
|
28428
|
-
renderOption: (
|
|
28431
|
+
renderOption: (f, p) => /* @__PURE__ */ b("li", { ...f, children: d ? p.hospitalNameBn : p.hospitalName }),
|
|
28429
28432
|
fullWidth: !0
|
|
28430
28433
|
}
|
|
28431
28434
|
);
|
|
@@ -29514,9 +29517,9 @@ const IQ = (e) => {
|
|
|
29514
29517
|
flexDirection: "column",
|
|
29515
29518
|
justifyContent: "flex-start",
|
|
29516
29519
|
paddingBottom: e.spacing(2),
|
|
29517
|
-
minHeight: "85vh"
|
|
29518
|
-
paddingLeft:
|
|
29519
|
-
paddingRight:
|
|
29520
|
+
minHeight: "85vh"
|
|
29521
|
+
// paddingLeft: theme.spacing(3),
|
|
29522
|
+
// paddingRight: theme.spacing(3),
|
|
29520
29523
|
})
|
|
29521
29524
|
), OQ = Br(Pe)(({ theme: e }) => ({
|
|
29522
29525
|
backgroundColor: e.palette.background.default,
|
|
@@ -30079,7 +30082,7 @@ const IQ = (e) => {
|
|
|
30079
30082
|
{
|
|
30080
30083
|
sx: {
|
|
30081
30084
|
flexGrow: 1,
|
|
30082
|
-
p: { xs: 2, sm: 3, md: 4 },
|
|
30085
|
+
// p: { xs: 2, sm: 3, md: 4 },
|
|
30083
30086
|
backgroundColor: i.palette.background.default
|
|
30084
30087
|
},
|
|
30085
30088
|
children: /* @__PURE__ */ b(PQ, { children: e })
|