@situaction/traq-ui-ste 1.1.37 → 1.1.38
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.
|
@@ -6,7 +6,7 @@ import '../../styles/Modal.css';const F = "_overlay_b1r7c_1", L = "_modalContent
|
|
|
6
6
|
centered: M
|
|
7
7
|
}, Y = k(
|
|
8
8
|
({
|
|
9
|
-
open:
|
|
9
|
+
open: a,
|
|
10
10
|
onClose: c,
|
|
11
11
|
children: _,
|
|
12
12
|
position: l,
|
|
@@ -14,31 +14,33 @@ import '../../styles/Modal.css';const F = "_overlay_b1r7c_1", L = "_modalContent
|
|
|
14
14
|
className: b,
|
|
15
15
|
disableOverlay: v = !1,
|
|
16
16
|
autoCloseCondition: m,
|
|
17
|
-
anchorRef:
|
|
18
|
-
},
|
|
19
|
-
const
|
|
17
|
+
anchorRef: f
|
|
18
|
+
}, g) => {
|
|
19
|
+
const w = C(null), y = g || w, [e, x] = E();
|
|
20
20
|
return N(() => {
|
|
21
|
-
!m && m !== void 0 &&
|
|
22
|
-
}, [m,
|
|
23
|
-
if (
|
|
24
|
-
const
|
|
21
|
+
!m && m !== void 0 && a && c();
|
|
22
|
+
}, [m, a, c]), B(() => {
|
|
23
|
+
if (f != null && f.current && a && !l && !r) {
|
|
24
|
+
const t = f.current.getBoundingClientRect();
|
|
25
25
|
x({
|
|
26
|
-
top: `${
|
|
27
|
-
left: `${
|
|
26
|
+
top: `${t.bottom + window.scrollY}px`,
|
|
27
|
+
left: `${t.left + window.scrollX}px`
|
|
28
28
|
});
|
|
29
29
|
}
|
|
30
|
-
}, [
|
|
30
|
+
}, [f, a, l, r]), a ? /* @__PURE__ */ $(j, { children: [
|
|
31
31
|
!v && /* @__PURE__ */ u(
|
|
32
32
|
"div",
|
|
33
33
|
{
|
|
34
34
|
className: d.overlay,
|
|
35
|
-
onClick:
|
|
35
|
+
onClick: (t) => {
|
|
36
|
+
t.stopPropagation(), c();
|
|
37
|
+
}
|
|
36
38
|
}
|
|
37
39
|
),
|
|
38
40
|
/* @__PURE__ */ u(
|
|
39
41
|
"div",
|
|
40
42
|
{
|
|
41
|
-
ref:
|
|
43
|
+
ref: y,
|
|
42
44
|
className: `${d.modalContent} ${b || ""} ${r ? d.centered : ""}`,
|
|
43
45
|
style: {
|
|
44
46
|
position: "absolute",
|
|
@@ -49,7 +51,7 @@ import '../../styles/Modal.css';const F = "_overlay_b1r7c_1", L = "_modalContent
|
|
|
49
51
|
width: l == null ? void 0 : l.width,
|
|
50
52
|
transform: r || !(l != null && l.top) && !(l != null && l.left) && !e ? "translate(-50%, -50%)" : void 0
|
|
51
53
|
},
|
|
52
|
-
onClick: (
|
|
54
|
+
onClick: (t) => t.stopPropagation(),
|
|
53
55
|
children: _
|
|
54
56
|
}
|
|
55
57
|
)
|
|
@@ -1,47 +1,49 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useState as
|
|
3
|
-
import '../../../styles/SidePanel.css';const
|
|
4
|
-
panel:
|
|
5
|
-
openPanelBtn:
|
|
6
|
-
box:
|
|
7
|
-
panelLeft:
|
|
8
|
-
panelRight:
|
|
9
|
-
panelOpenedLeft:
|
|
10
|
-
panelOpenedRight:
|
|
11
|
-
panelHidden:
|
|
12
|
-
displayPanel:
|
|
13
|
-
hidePanel:
|
|
14
|
-
},
|
|
15
|
-
children:
|
|
16
|
-
width:
|
|
17
|
-
left:
|
|
1
|
+
import { jsx as _ } from "react/jsx-runtime";
|
|
2
|
+
import { useState as y, useRef as L, useEffect as f } from "react";
|
|
3
|
+
import '../../../styles/SidePanel.css';const x = "_panel_lk5yy_1", v = "_openPanelBtn_lk5yy_9", b = "_box_lk5yy_18", B = "_panelLeft_lk5yy_29", C = "_panelRight_lk5yy_36", H = "_panelOpenedLeft_lk5yy_43", S = "_panelOpenedRight_lk5yy_47", E = "_panelHidden_lk5yy_51", N = "_displayPanel_lk5yy_55", g = "_hidePanel_lk5yy_59", e = {
|
|
4
|
+
panel: x,
|
|
5
|
+
openPanelBtn: v,
|
|
6
|
+
box: b,
|
|
7
|
+
panelLeft: B,
|
|
8
|
+
panelRight: C,
|
|
9
|
+
panelOpenedLeft: H,
|
|
10
|
+
panelOpenedRight: S,
|
|
11
|
+
panelHidden: E,
|
|
12
|
+
displayPanel: N,
|
|
13
|
+
hidePanel: g
|
|
14
|
+
}, I = ({
|
|
15
|
+
children: u,
|
|
16
|
+
width: s,
|
|
17
|
+
left: c = !0,
|
|
18
18
|
opened: n = !1,
|
|
19
19
|
onToggle: t
|
|
20
20
|
}) => {
|
|
21
|
-
const [l,
|
|
22
|
-
"--dynamic-left": `-${
|
|
23
|
-
"--dynamic-right": `-${
|
|
24
|
-
width:
|
|
25
|
-
},
|
|
21
|
+
const [l, i] = y(n), [m, p] = y(n), a = L(null), h = {
|
|
22
|
+
"--dynamic-left": `-${s}`,
|
|
23
|
+
"--dynamic-right": `-${s}`,
|
|
24
|
+
width: s
|
|
25
|
+
}, P = c ? e.panelLeft : e.panelRight, k = c ? e.panelOpenedLeft : e.panelOpenedRight, O = [
|
|
26
26
|
e.panel,
|
|
27
|
-
|
|
27
|
+
P,
|
|
28
28
|
!l && e.panelHidden,
|
|
29
|
-
l &&
|
|
30
|
-
|
|
29
|
+
l && k,
|
|
30
|
+
m ? e.displayPanel : e.hidePanel
|
|
31
31
|
].filter(Boolean).join(" ");
|
|
32
|
-
return
|
|
33
|
-
n ? (
|
|
34
|
-
}, [n]),
|
|
35
|
-
const d = (
|
|
36
|
-
|
|
37
|
-
|
|
32
|
+
return f(() => {
|
|
33
|
+
n ? (p(!0), setTimeout(() => i(!0), 10)) : (i(!1), setTimeout(() => p(!1), 300));
|
|
34
|
+
}, [n]), f(() => {
|
|
35
|
+
const d = (R) => {
|
|
36
|
+
var r;
|
|
37
|
+
const o = R.target;
|
|
38
|
+
o.closest("[data-ignore-outside-click]") || // déjà présent
|
|
39
|
+
(r = a.current) != null && r.contains(o) || a.current && !a.current.contains(o) && (i(!1), t == null || t(!1), setTimeout(() => p(!1), 300));
|
|
38
40
|
};
|
|
39
41
|
if (l)
|
|
40
42
|
return document.addEventListener("mousedown", d), () => {
|
|
41
43
|
document.removeEventListener("mousedown", d);
|
|
42
44
|
};
|
|
43
|
-
}, [l, t]), /* @__PURE__ */
|
|
45
|
+
}, [l, t]), /* @__PURE__ */ _("div", { style: h, className: O, children: /* @__PURE__ */ _("div", { ref: a, className: e.box, children: u }) });
|
|
44
46
|
};
|
|
45
47
|
export {
|
|
46
|
-
|
|
48
|
+
I as SidePanel
|
|
47
49
|
};
|