@situaction/traq-ui-ste 1.1.36 → 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.
@@ -15,8 +15,6 @@ interface EditableSelectProps {
15
15
  onSelect?: (selected: SelectItem) => void;
16
16
  /** The currently selected item */
17
17
  selected?: SelectItem;
18
- /** Condition that automatically closes the dropdown */
19
- autoCloseCondition?: boolean;
20
18
  /** If true, the select takes full width */
21
19
  fullWidth?: boolean;
22
20
  }
@@ -25,5 +23,5 @@ interface EditableSelectProps {
25
23
  * and a Select dropdown based on the `edit` prop. It is commonly used
26
24
  * in forms or data views where inline editing is required.
27
25
  */
28
- export declare const EditableSelect: ({ label, listItems, value, placeholder, edit, onSelect, selected, autoCloseCondition, fullWidth }: EditableSelectProps) => import("react/jsx-runtime").JSX.Element;
26
+ export declare const EditableSelect: ({ label, listItems, value, placeholder, edit, onSelect, selected, fullWidth }: EditableSelectProps) => import("react/jsx-runtime").JSX.Element;
29
27
  export {};
@@ -1,37 +1,36 @@
1
- import { jsxs as l, Fragment as S, jsx as e } from "react/jsx-runtime";
2
- import { Select as x } from "../select/Select.js";
3
- import '../../styles/EditableSelect.css';const p = "_editableSelect_6vsm4_30", _ = "_statiqueField_6vsm4_40", i = {
4
- editableSelect: p,
5
- statiqueField: _
6
- }, F = ({
7
- label: s,
1
+ import { jsxs as i, Fragment as m, jsx as e } from "react/jsx-runtime";
2
+ import { Select as S } from "../select/Select.js";
3
+ import '../../styles/EditableSelect.css';const x = "_editableSelect_j0aoc_30", f = "_statiqueField_j0aoc_40", s = {
4
+ editableSelect: x,
5
+ statiqueField: f
6
+ }, _ = ({
7
+ label: l,
8
8
  listItems: a,
9
9
  value: t,
10
10
  placeholder: c,
11
11
  edit: d,
12
- onSelect: m,
13
- selected: r,
14
- autoCloseCondition: n = !1,
12
+ onSelect: r,
13
+ selected: n,
15
14
  fullWidth: o = !1
16
- }) => d ? /* @__PURE__ */ l(S, { children: [
17
- /* @__PURE__ */ e("span", { className: "textSmall", children: s }),
15
+ }) => d ? /* @__PURE__ */ i(m, { children: [
16
+ /* @__PURE__ */ e("span", { className: "textSmall", children: l }),
18
17
  /* @__PURE__ */ e(
19
- x,
18
+ S,
20
19
  {
21
20
  size: "s",
22
21
  listItem: a,
23
22
  placeholder: c,
24
23
  modeDisplay: "text",
25
- onSelect: m,
26
- selected: r,
27
- autoCloseCondition: n,
28
- fullWidth: o
24
+ onSelect: r,
25
+ selected: n,
26
+ autoCloseCondition: !0,
27
+ fullWidth: o ?? !1
29
28
  }
30
29
  )
31
- ] }) : /* @__PURE__ */ l("div", { className: i.editableSelect, children: [
32
- /* @__PURE__ */ e("span", { className: "textSmall", children: s }),
33
- /* @__PURE__ */ e("div", { className: `${i.statiqueField} textSmall`, children: (t == null ? void 0 : t.trim()) || "-" })
30
+ ] }) : /* @__PURE__ */ i("div", { className: s.editableSelect, children: [
31
+ /* @__PURE__ */ e("span", { className: "textSmall", children: l }),
32
+ /* @__PURE__ */ e("div", { className: `${s.statiqueField} textSmall`, children: (t == null ? void 0 : t.trim()) || "-" })
34
33
  ] });
35
34
  export {
36
- F as EditableSelect
35
+ _ as EditableSelect
37
36
  };
@@ -1,17 +1,13 @@
1
1
  import { ReactNode, RefObject } from 'react';
2
2
 
3
3
  export interface ModalProps {
4
- /** Determines whether the modal is open or closed.
5
- * If true, the modal is displayed; if false, it is hidden. */
4
+ /** Determines whether the modal is open or closed */
6
5
  open: boolean;
7
- /** Callback function to handle closing the modal.
8
- * Triggered when clicking outside the modal content. */
6
+ /** Callback function to handle closing the modal */
9
7
  onClose: () => void;
10
- /** Content to be displayed inside the modal.
11
- * Typically includes child components or HTML elements. */
8
+ /** Content to be displayed inside the modal */
12
9
  children: ReactNode;
13
- /** Optional object to specify the positioning of the modal.
14
- * Supports CSS properties such as top, left, right, bottom, and width. */
10
+ /** Optional custom position for the modal */
15
11
  position?: {
16
12
  top?: string;
17
13
  left?: string;
@@ -19,17 +15,15 @@ export interface ModalProps {
19
15
  bottom?: string;
20
16
  width?: string;
21
17
  };
22
- /** Optional additional CSS class names to apply custom styles to the modal. */
18
+ /** Centers the modal automatically in the middle of the screen */
19
+ centered?: boolean;
20
+ /** Optional additional CSS classes */
23
21
  className?: string;
24
- /** Option to disable the overlay and the blocking of events outside the modal */
22
+ /** Disable overlay and event blocking */
25
23
  disableOverlay?: boolean;
26
- /** Condition to close the modal */
24
+ /** Auto-close condition */
27
25
  autoCloseCondition?: boolean;
26
+ /** Optional anchor reference for positioning */
28
27
  anchorRef?: RefObject<HTMLElement>;
29
28
  }
30
- /**
31
- * Modal component that renders content in a floating layer above the main UI.
32
- * It supports custom positioning and closes when clicking outside of its content area.
33
- * The component uses a ref to detect clicks outside the modal.
34
- */
35
29
  export declare const Modal: import('react').ForwardRefExoticComponent<ModalProps & import('react').RefAttributes<HTMLDivElement>>;
@@ -1,54 +1,63 @@
1
- import { jsxs as j, Fragment as M, jsx as v } from "react/jsx-runtime";
2
- import { forwardRef as N, useRef as S, useState as k, useEffect as w, useLayoutEffect as q } from "react";
3
- import '../../styles/Modal.css';const A = "_overlay_lv2n7_2", B = "_modalContent_lv2n7_12", g = {
4
- overlay: A,
5
- modalContent: B
6
- }, O = N(
7
- ({ open: t, onClose: d, children: y, position: e, className: _, disableOverlay: b = !1, autoCloseCondition: m, anchorRef: a }, x) => {
8
- const E = S(null), c = x || E, [l, $] = k();
9
- return w(() => {
10
- !m && m !== void 0 && t && d();
11
- }, [m, t, d]), q(() => {
12
- if (a != null && a.current && t && !e) {
13
- const r = a.current.getBoundingClientRect();
14
- $({
15
- top: `${r.bottom + window.scrollY}px`,
16
- left: `${r.left + window.scrollX}px`
1
+ import { jsxs as $, Fragment as j, jsx as u } from "react/jsx-runtime";
2
+ import { forwardRef as k, useRef as C, useState as E, useEffect as N, useLayoutEffect as B } from "react";
3
+ import '../../styles/Modal.css';const F = "_overlay_b1r7c_1", L = "_modalContent_b1r7c_12", M = "_centered_b1r7c_19", d = {
4
+ overlay: F,
5
+ modalContent: L,
6
+ centered: M
7
+ }, Y = k(
8
+ ({
9
+ open: a,
10
+ onClose: c,
11
+ children: _,
12
+ position: l,
13
+ centered: r = !1,
14
+ className: b,
15
+ disableOverlay: v = !1,
16
+ autoCloseCondition: m,
17
+ anchorRef: f
18
+ }, g) => {
19
+ const w = C(null), y = g || w, [e, x] = E();
20
+ return N(() => {
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
+ x({
26
+ top: `${t.bottom + window.scrollY}px`,
27
+ left: `${t.left + window.scrollX}px`
17
28
  });
18
29
  }
19
- }, [a, t, e]), w(() => {
20
- const r = (u) => {
21
- const f = c.current;
22
- f && !f.contains(u.target) && t && ![...document.querySelectorAll(".dialog")].some(
23
- (L) => L.contains(u.target)
24
- ) && d();
25
- };
26
- return document.addEventListener("mousedown", r), () => {
27
- document.removeEventListener("mousedown", r);
28
- };
29
- }, [d, t, c]), t ? /* @__PURE__ */ j(M, { children: [
30
- !b && /* @__PURE__ */ v("div", { className: g.overlay }),
31
- /* @__PURE__ */ v(
30
+ }, [f, a, l, r]), a ? /* @__PURE__ */ $(j, { children: [
31
+ !v && /* @__PURE__ */ u(
32
32
  "div",
33
33
  {
34
- ref: c,
35
- className: `${g.modalContent} ${_ || ""}`,
36
- onMouseDown: (r) => r.stopPropagation(),
34
+ className: d.overlay,
35
+ onClick: (t) => {
36
+ t.stopPropagation(), c();
37
+ }
38
+ }
39
+ ),
40
+ /* @__PURE__ */ u(
41
+ "div",
42
+ {
43
+ ref: y,
44
+ className: `${d.modalContent} ${b || ""} ${r ? d.centered : ""}`,
37
45
  style: {
38
46
  position: "absolute",
39
- top: (e == null ? void 0 : e.top) ?? (l == null ? void 0 : l.top),
40
- left: (e == null ? void 0 : e.left) ?? (l == null ? void 0 : l.left),
41
- right: e == null ? void 0 : e.right,
42
- bottom: e == null ? void 0 : e.bottom,
43
- width: e == null ? void 0 : e.width,
44
- transform: !(e != null && e.top) && !(e != null && e.left) && !l ? "translate(-50%, -50%)" : void 0
47
+ top: r ? "50%" : (l == null ? void 0 : l.top) ?? (e == null ? void 0 : e.top),
48
+ left: r ? "50%" : (l == null ? void 0 : l.left) ?? (e == null ? void 0 : e.left),
49
+ right: l == null ? void 0 : l.right,
50
+ bottom: l == null ? void 0 : l.bottom,
51
+ width: l == null ? void 0 : l.width,
52
+ transform: r || !(l != null && l.top) && !(l != null && l.left) && !e ? "translate(-50%, -50%)" : void 0
45
53
  },
46
- children: y
54
+ onClick: (t) => t.stopPropagation(),
55
+ children: _
47
56
  }
48
57
  )
49
58
  ] }) : null;
50
59
  }
51
60
  );
52
61
  export {
53
- O as Modal
62
+ Y as Modal
54
63
  };
@@ -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
  };
@@ -1 +1 @@
1
- ._editableSelect_6vsm4_30{width:100%;gap:.25rem;display:flex;justify-content:flex-start;align-items:start;flex-direction:column;cursor:default}._statiqueField_6vsm4_40{width:100%;border-radius:4px;border:1px solid var(--input-primary-default-border);padding:.5rem}
1
+ ._editableSelect_j0aoc_30{width:100%;gap:.25rem;display:flex;justify-content:flex-start;align-items:start;flex-direction:column;cursor:default}._statiqueField_j0aoc_40{width:100%;border-radius:4px;border:1px solid var(--input-primary-default-border);padding:.5rem;box-sizing:border-box}
@@ -1 +1 @@
1
- @charset "UTF-8";._overlay_lv2n7_2{position:fixed;top:0;left:0;right:0;bottom:0;z-index:3;pointer-events:auto}._modalContent_lv2n7_12{position:absolute;z-index:12;border:1px solid var(--general-border-window);background-color:var(--background-primary)}
1
+ ._overlay_b1r7c_1{position:fixed;top:0;left:0;right:0;bottom:0;background-color:#0000004d;z-index:11;pointer-events:auto}._modalContent_b1r7c_12{position:absolute;z-index:12;border:1px solid var(--general-border-window);background-color:var(--background-primary)}._centered_b1r7c_19{max-width:90%;max-height:90%}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@situaction/traq-ui-ste",
3
- "version": "1.1.36",
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",