@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: t,
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: a
18
- }, w) => {
19
- const y = C(null), g = w || y, [e, x] = E();
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 && t && c();
22
- }, [m, t, c]), B(() => {
23
- if (a != null && a.current && t && !l && !r) {
24
- const f = a.current.getBoundingClientRect();
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: `${f.bottom + window.scrollY}px`,
27
- left: `${f.left + window.scrollX}px`
26
+ top: `${t.bottom + window.scrollY}px`,
27
+ left: `${t.left + window.scrollX}px`
28
28
  });
29
29
  }
30
- }, [a, t, l, r]), t ? /* @__PURE__ */ $(j, { children: [
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: c
35
+ onClick: (t) => {
36
+ t.stopPropagation(), c();
37
+ }
36
38
  }
37
39
  ),
38
40
  /* @__PURE__ */ u(
39
41
  "div",
40
42
  {
41
- ref: g,
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: (f) => f.stopPropagation(),
54
+ onClick: (t) => t.stopPropagation(),
53
55
  children: _
54
56
  }
55
57
  )
@@ -1,47 +1,49 @@
1
- import { jsx as r } from "react/jsx-runtime";
2
- import { useState as _, useRef as R, useEffect as y } from "react";
3
- import '../../../styles/SidePanel.css';const L = "_panel_lk5yy_1", x = "_openPanelBtn_lk5yy_9", v = "_box_lk5yy_18", b = "_panelLeft_lk5yy_29", B = "_panelRight_lk5yy_36", C = "_panelOpenedLeft_lk5yy_43", H = "_panelOpenedRight_lk5yy_47", S = "_panelHidden_lk5yy_51", E = "_displayPanel_lk5yy_55", N = "_hidePanel_lk5yy_59", e = {
4
- panel: L,
5
- openPanelBtn: x,
6
- box: v,
7
- panelLeft: b,
8
- panelRight: B,
9
- panelOpenedLeft: C,
10
- panelOpenedRight: H,
11
- panelHidden: S,
12
- displayPanel: E,
13
- hidePanel: N
14
- }, $ = ({
15
- children: f,
16
- width: a,
17
- left: o = !0,
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, s] = _(n), [u, i] = _(n), p = R(null), m = {
22
- "--dynamic-left": `-${a}`,
23
- "--dynamic-right": `-${a}`,
24
- width: a
25
- }, h = o ? e.panelLeft : e.panelRight, P = o ? e.panelOpenedLeft : e.panelOpenedRight, k = [
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
- h,
27
+ P,
28
28
  !l && e.panelHidden,
29
- l && P,
30
- u ? e.displayPanel : e.hidePanel
29
+ l && k,
30
+ m ? e.displayPanel : e.hidePanel
31
31
  ].filter(Boolean).join(" ");
32
- return y(() => {
33
- n ? (i(!0), setTimeout(() => s(!0), 10)) : (s(!1), setTimeout(() => i(!1), 300));
34
- }, [n]), y(() => {
35
- const d = (O) => {
36
- const c = O.target;
37
- c.closest("[data-ignore-outside-click]") || p.current && !p.current.contains(c) && (s(!1), t == null || t(!1), setTimeout(() => i(!1), 300));
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__ */ r("div", { style: m, className: k, children: /* @__PURE__ */ r("div", { ref: p, className: e.box, children: f }) });
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
- $ as SidePanel
48
+ I as SidePanel
47
49
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@situaction/traq-ui-ste",
3
- "version": "1.1.37",
3
+ "version": "1.1.38",
4
4
  "description": "library react component Situaction",
5
5
  "main": "dist/main.js",
6
6
  "types": "dist/main.d.ts",