@situaction/traq-ui-ste 1.1.38 → 1.1.39

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,49 +1,47 @@
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,
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,
18
18
  opened: n = !1,
19
19
  onToggle: t
20
20
  }) => {
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 = [
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 = [
26
26
  e.panel,
27
- P,
27
+ h,
28
28
  !l && e.panelHidden,
29
- l && k,
30
- m ? e.displayPanel : e.hidePanel
29
+ l && P,
30
+ u ? e.displayPanel : e.hidePanel
31
31
  ].filter(Boolean).join(" ");
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));
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));
40
38
  };
41
39
  if (l)
42
40
  return document.addEventListener("mousedown", d), () => {
43
41
  document.removeEventListener("mousedown", d);
44
42
  };
45
- }, [l, t]), /* @__PURE__ */ _("div", { style: h, className: O, children: /* @__PURE__ */ _("div", { ref: a, className: e.box, children: u }) });
43
+ }, [l, t]), /* @__PURE__ */ r("div", { style: m, className: k, children: /* @__PURE__ */ r("div", { ref: p, className: e.box, children: f }) });
46
44
  };
47
45
  export {
48
- I as SidePanel
46
+ $ as SidePanel
49
47
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@situaction/traq-ui-ste",
3
- "version": "1.1.38",
3
+ "version": "1.1.39",
4
4
  "description": "library react component Situaction",
5
5
  "main": "dist/main.js",
6
6
  "types": "dist/main.d.ts",