asma-ui-core 3.54.3 → 3.55.0
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.
|
@@ -1,47 +1,65 @@
|
|
|
1
|
-
import { cn as
|
|
2
|
-
import { resolveSx as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
1
|
+
import { cn as u } from "../../../helpers/cn.js";
|
|
2
|
+
import { resolveSx as c } from "../../../helpers/sx.js";
|
|
3
|
+
import { TOP_LAYER_PROPS as _, TOP_LAYER_RESET_STYLE as L, getOpenModalDialogAncestor as S, useTopLayerRef as T } from "../../../hooks/useTopLayer.hook.js";
|
|
4
|
+
import { useFocusTrap as b } from "../../../hooks/useFocusTrap.hook.js";
|
|
5
|
+
import { useEffect as m, useRef as k } from "react";
|
|
6
|
+
import { jsx as d, jsxs as D } from "react/jsx-runtime";
|
|
7
|
+
import { FloatingPortal as P } from "@floating-ui/react";
|
|
8
|
+
var O = {
|
|
8
9
|
left: "inset-y-0 left-0 h-full",
|
|
9
10
|
right: "inset-y-0 right-0 h-full",
|
|
10
11
|
top: "inset-x-0 top-0 w-full",
|
|
11
12
|
bottom: "inset-x-0 bottom-0 w-full"
|
|
12
|
-
},
|
|
13
|
+
}, A = {
|
|
13
14
|
left: "-translate-x-full",
|
|
14
15
|
right: "translate-x-full",
|
|
15
16
|
top: "-translate-y-full",
|
|
16
17
|
bottom: "translate-y-full"
|
|
17
|
-
},
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
18
|
+
}, K = ({ open: e = !1, onClose: n, anchor: a = "left", variant: p = "temporary", hideBackdrop: v, className: y, sx: x, PaperProps: i, ModalProps: E, anchorEl: h, children: R }) => {
|
|
19
|
+
const r = p === "temporary", s = S(h), o = s !== void 0, l = k(null), g = T((t) => {
|
|
20
|
+
l.current = t instanceof HTMLDivElement ? t : null;
|
|
21
|
+
}), w = o ? g : (t) => {
|
|
22
|
+
l.current = t;
|
|
23
|
+
};
|
|
24
|
+
return m(() => {
|
|
25
|
+
if (!e || !r) return;
|
|
26
|
+
const t = (f) => {
|
|
27
|
+
f.key === "Escape" && n?.(f, "escapeKeyDown");
|
|
23
28
|
};
|
|
24
|
-
return document.addEventListener("keydown",
|
|
29
|
+
return document.addEventListener("keydown", t), () => document.removeEventListener("keydown", t);
|
|
25
30
|
}, [
|
|
26
|
-
t,
|
|
27
31
|
e,
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
32
|
+
r,
|
|
33
|
+
n
|
|
34
|
+
]), b(e && r, l), m(() => {
|
|
35
|
+
if (!e || !o) return;
|
|
36
|
+
const t = l.current;
|
|
37
|
+
if (!(!t || typeof t.showPopover != "function"))
|
|
38
|
+
try {
|
|
39
|
+
t.matches(":popover-open") || t.showPopover();
|
|
40
|
+
} catch {
|
|
41
|
+
}
|
|
42
|
+
}, [e, o]), r && !e && !E?.keepMounted ? null : /* @__PURE__ */ D(P, {
|
|
43
|
+
root: s,
|
|
44
|
+
children: [r && !v && e && /* @__PURE__ */ d("div", {
|
|
45
|
+
className: "fixed inset-0 z-[1200] bg-[#626e7eb2]",
|
|
46
|
+
onClick: (t) => n?.(t, "backdropClick")
|
|
47
|
+
}), /* @__PURE__ */ d("div", {
|
|
48
|
+
ref: w,
|
|
49
|
+
...o ? _ : {},
|
|
50
|
+
role: r ? "dialog" : void 0,
|
|
51
|
+
"aria-modal": r && e ? !0 : void 0,
|
|
52
|
+
"aria-hidden": !e,
|
|
53
|
+
className: u("fixed z-[1200] overflow-auto bg-white transition-transform duration-300", e && "shadow-[0px_4px_40px_0px_#22213366]", O[a], !e && u(A[a], "pointer-events-none"), y, i?.className),
|
|
54
|
+
style: {
|
|
55
|
+
...o ? L : {},
|
|
56
|
+
...c(x),
|
|
57
|
+
...c(i?.sx)
|
|
58
|
+
},
|
|
59
|
+
children: R
|
|
60
|
+
})]
|
|
61
|
+
});
|
|
44
62
|
};
|
|
45
63
|
export {
|
|
46
|
-
|
|
64
|
+
K as StyledDrawer
|
|
47
65
|
};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { setPickerPosition as f } from "./helpers.js";
|
|
2
2
|
import { StyledDayPicker as k } from "./components/StyledDayPicker.js";
|
|
3
|
-
import { StyledCalendarPicker as
|
|
4
|
-
import { DatePickerInputIndex as
|
|
3
|
+
import { StyledCalendarPicker as u } from "./components/StyledCalendarPicker.js";
|
|
4
|
+
import { DatePickerInputIndex as x } from "./components/DatePickerInputIndex.js";
|
|
5
5
|
import { useIsMobileView as v } from "../../hooks/useWindowWidthSize.hook.js";
|
|
6
6
|
import { StyledDrawer as C } from "../../../components/navigation/drawer/StyledDrawer.js";
|
|
7
7
|
import { useBackNavigationClose as b } from "../../hooks/useBackNavigationClose.hook.js";
|
|
8
8
|
import { useState as a } from "react";
|
|
9
9
|
import { Fragment as h, jsx as o, jsxs as y } from "react/jsx-runtime";
|
|
10
|
-
var
|
|
10
|
+
var E = (p) => {
|
|
11
11
|
const s = v(), [e, n] = a(null), [c, m] = a(!1), [d, i] = a(!1), P = (l) => {
|
|
12
12
|
n(l.currentTarget), f(l, m);
|
|
13
13
|
}, r = () => {
|
|
@@ -23,11 +23,11 @@ var j = (p) => {
|
|
|
23
23
|
onValidatedOnce: () => i(!1)
|
|
24
24
|
};
|
|
25
25
|
return /* @__PURE__ */ y(h, { children: [
|
|
26
|
-
/* @__PURE__ */ o(
|
|
26
|
+
/* @__PURE__ */ o(x, {
|
|
27
27
|
datePickerProps: t,
|
|
28
28
|
onClick: P
|
|
29
29
|
}),
|
|
30
|
-
!s && /* @__PURE__ */ o(
|
|
30
|
+
!s && /* @__PURE__ */ o(u, {
|
|
31
31
|
datePickerProps: { ...t },
|
|
32
32
|
popoverProps: {
|
|
33
33
|
open: !!e,
|
|
@@ -40,8 +40,7 @@ var j = (p) => {
|
|
|
40
40
|
anchor: "bottom",
|
|
41
41
|
open: !!e,
|
|
42
42
|
onClose: r,
|
|
43
|
-
|
|
44
|
-
className: "z-[1300]",
|
|
43
|
+
anchorEl: e,
|
|
45
44
|
children: /* @__PURE__ */ o("div", {
|
|
46
45
|
className: "mx-auto max-w-[360px] px-2 pb-[max(1.5rem,env(safe-area-inset-bottom))]",
|
|
47
46
|
children: /* @__PURE__ */ o(k, {
|
|
@@ -57,5 +56,5 @@ var j = (p) => {
|
|
|
57
56
|
] });
|
|
58
57
|
};
|
|
59
58
|
export {
|
|
60
|
-
|
|
59
|
+
E as StyledDatePicker
|
|
61
60
|
};
|