@situaction/traq-ui-ste 1.2.9 → 1.2.11
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.
- package/dist/components/button/Button.js +41 -41
- package/dist/components/calendar/Calendar.js +319 -319
- package/dist/components/editable-select/EditableSelect.d.ts +4 -1
- package/dist/components/editable-select/EditableSelect.js +41 -32
- package/dist/components/icon-button/IconButton.js +21 -21
- package/dist/components/input/Input.js +34 -34
- package/dist/components/menu/Menu.js +59 -57
- package/dist/components/select/Select.d.ts +10 -9
- package/dist/components/select/Select.js +159 -149
- package/dist/components/tabs/Tabs.js +102 -94
- package/dist/styles/Button.css +1 -1
- package/dist/styles/Calendar.css +1 -1
- package/dist/styles/EditableSelect.css +1 -1
- package/dist/styles/IconButton.css +1 -1
- package/dist/styles/Input.css +1 -1
- package/dist/styles/Menu.css +1 -1
- package/dist/styles/Tabs.css +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { SelectItem } from '../select/Select';
|
|
2
|
+
import { Size } from '../interface';
|
|
2
3
|
|
|
3
4
|
interface EditableSelectProps {
|
|
4
5
|
/** Label displayed above the select or static value */
|
|
@@ -15,6 +16,8 @@ interface EditableSelectProps {
|
|
|
15
16
|
onSelect?: (selected: SelectItem) => void;
|
|
16
17
|
/** The currently selected item */
|
|
17
18
|
selected?: SelectItem;
|
|
19
|
+
/** Size of select */
|
|
20
|
+
size?: Size;
|
|
18
21
|
/** If true, the select takes full width */
|
|
19
22
|
fullWidth?: boolean;
|
|
20
23
|
}
|
|
@@ -23,5 +26,5 @@ interface EditableSelectProps {
|
|
|
23
26
|
* and a Select dropdown based on the `edit` prop. It is commonly used
|
|
24
27
|
* in forms or data views where inline editing is required.
|
|
25
28
|
*/
|
|
26
|
-
export declare const EditableSelect: ({ label, listItems, value, placeholder, edit, onSelect, selected, fullWidth }: EditableSelectProps) => import("react/jsx-runtime").JSX.Element;
|
|
29
|
+
export declare const EditableSelect: ({ label, listItems, value, placeholder, edit, onSelect, selected, size, fullWidth }: EditableSelectProps) => import("react/jsx-runtime").JSX.Element;
|
|
27
30
|
export {};
|
|
@@ -1,36 +1,45 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { Select as
|
|
3
|
-
import '../../styles/EditableSelect.css';const
|
|
4
|
-
editableSelect:
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { jsxs as d, Fragment as o, jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import { Select as F } from "../select/Select.js";
|
|
3
|
+
import '../../styles/EditableSelect.css';const q = "_editableSelect_1nilm_30", f = "_fullWidth_1nilm_39", z = "_statiqueField_1nilm_43", e = {
|
|
4
|
+
editableSelect: q,
|
|
5
|
+
fullWidth: f,
|
|
6
|
+
statiqueField: z,
|
|
7
|
+
"statiqueField-size-xl": "_statiqueField-size-xl_1nilm_56",
|
|
8
|
+
"statiqueField-size-l": "_statiqueField-size-l_1nilm_63",
|
|
9
|
+
"statiqueField-size-m": "_statiqueField-size-m_1nilm_70",
|
|
10
|
+
"statiqueField-size-s": "_statiqueField-size-s_1nilm_77"
|
|
11
|
+
}, x = ({
|
|
7
12
|
label: l,
|
|
8
|
-
listItems:
|
|
13
|
+
listItems: m,
|
|
9
14
|
value: t,
|
|
10
|
-
placeholder:
|
|
11
|
-
edit:
|
|
12
|
-
onSelect:
|
|
13
|
-
selected:
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
{
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
] })
|
|
15
|
+
placeholder: n,
|
|
16
|
+
edit: c,
|
|
17
|
+
onSelect: _,
|
|
18
|
+
selected: u,
|
|
19
|
+
size: s = "m",
|
|
20
|
+
fullWidth: a = !1
|
|
21
|
+
}) => {
|
|
22
|
+
const r = e[`statiqueField-size-${s}`] ?? e["statiqueField-size-m"];
|
|
23
|
+
return c ? /* @__PURE__ */ d(o, { children: [
|
|
24
|
+
/* @__PURE__ */ i("span", { className: "textSmall", children: l }),
|
|
25
|
+
/* @__PURE__ */ i(
|
|
26
|
+
F,
|
|
27
|
+
{
|
|
28
|
+
size: s,
|
|
29
|
+
listItem: m,
|
|
30
|
+
placeholder: n,
|
|
31
|
+
modeDisplay: "text",
|
|
32
|
+
onSelect: _,
|
|
33
|
+
selected: u,
|
|
34
|
+
autoCloseCondition: !0,
|
|
35
|
+
fullWidth: a ?? !1
|
|
36
|
+
}
|
|
37
|
+
)
|
|
38
|
+
] }) : /* @__PURE__ */ d("div", { className: `${e.editableSelect} ${a ? e.fullWidth : ""}`, children: [
|
|
39
|
+
/* @__PURE__ */ i("span", { className: "textSmall", children: l }),
|
|
40
|
+
/* @__PURE__ */ i("div", { className: `${e.statiqueField} ${r} textSmall`, children: (t == null ? void 0 : t.trim()) || "-" })
|
|
41
|
+
] });
|
|
42
|
+
};
|
|
34
43
|
export {
|
|
35
|
-
|
|
44
|
+
x as EditableSelect
|
|
36
45
|
};
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import { jsx as a } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import '../../styles/IconButton.css';const z = "
|
|
2
|
+
import { forwardRef as w } from "react";
|
|
3
|
+
import '../../styles/IconButton.css';const z = "_button_wxoc4_30", m = "_flexHorizontalCenter_wxoc4_185", t = {
|
|
4
4
|
button: z,
|
|
5
|
-
"button-round": "_button-
|
|
6
|
-
"button-primary": "_button-
|
|
7
|
-
"button-secondary": "_button-
|
|
8
|
-
"button-tertiary": "_button-
|
|
9
|
-
"button-ghost": "_button-
|
|
10
|
-
"button-icon": "_button-
|
|
11
|
-
"button-icon-selected": "_button-icon-
|
|
12
|
-
"button-error": "_button-
|
|
13
|
-
"button-size-xl": "_button-size-
|
|
14
|
-
"button-size-l": "_button-size-
|
|
15
|
-
"button-size-m": "_button-size-
|
|
16
|
-
"button-size-s": "_button-size-
|
|
17
|
-
"button-size-menu": "_button-size-
|
|
5
|
+
"button-round": "_button-round_wxoc4_58",
|
|
6
|
+
"button-primary": "_button-primary_wxoc4_61",
|
|
7
|
+
"button-secondary": "_button-secondary_wxoc4_75",
|
|
8
|
+
"button-tertiary": "_button-tertiary_wxoc4_91",
|
|
9
|
+
"button-ghost": "_button-ghost_wxoc4_107",
|
|
10
|
+
"button-icon": "_button-icon_wxoc4_124",
|
|
11
|
+
"button-icon-selected": "_button-icon-selected_wxoc4_136",
|
|
12
|
+
"button-error": "_button-error_wxoc4_145",
|
|
13
|
+
"button-size-xl": "_button-size-xl_wxoc4_158",
|
|
14
|
+
"button-size-l": "_button-size-l_wxoc4_163",
|
|
15
|
+
"button-size-m": "_button-size-m_wxoc4_168",
|
|
16
|
+
"button-size-s": "_button-size-s_wxoc4_173",
|
|
17
|
+
"button-size-menu": "_button-size-menu_wxoc4_178",
|
|
18
18
|
flexHorizontalCenter: m
|
|
19
|
-
}, d =
|
|
19
|
+
}, d = w(
|
|
20
20
|
({
|
|
21
21
|
mode: o = "primary",
|
|
22
22
|
size: n = "m",
|
|
@@ -25,12 +25,12 @@ import '../../styles/IconButton.css';const z = "_button_kvvl4_30", m = "_flexHor
|
|
|
25
25
|
round: u,
|
|
26
26
|
disabled: r,
|
|
27
27
|
children: b,
|
|
28
|
-
onClick:
|
|
28
|
+
onClick: c,
|
|
29
29
|
...s
|
|
30
30
|
}, i) => {
|
|
31
|
-
const
|
|
31
|
+
const x = () => e ? "error" : o, l = [
|
|
32
32
|
t.button,
|
|
33
|
-
t[`button-${
|
|
33
|
+
t[`button-${x()}`],
|
|
34
34
|
u && t["button-round"],
|
|
35
35
|
t[`button-size-${n}`],
|
|
36
36
|
_ && o === "icon" && t["button-icon-selected"],
|
|
@@ -40,8 +40,8 @@ import '../../styles/IconButton.css';const z = "_button_kvvl4_30", m = "_flexHor
|
|
|
40
40
|
"button",
|
|
41
41
|
{
|
|
42
42
|
ref: i,
|
|
43
|
-
className:
|
|
44
|
-
onClick:
|
|
43
|
+
className: l,
|
|
44
|
+
onClick: c,
|
|
45
45
|
disabled: r,
|
|
46
46
|
...s,
|
|
47
47
|
children: b
|
|
@@ -1,42 +1,42 @@
|
|
|
1
|
-
import { jsxs as a, jsx as t, Fragment as
|
|
2
|
-
import { useState as
|
|
3
|
-
import '../../styles/Input.css';const
|
|
4
|
-
"input-style": "_input-
|
|
5
|
-
"input-style-disabled": "_input-style-
|
|
6
|
-
"input-style-focused": "_input-style-
|
|
7
|
-
"input-style-secondary": "_input-style-
|
|
8
|
-
"input-style-ghost": "_input-style-
|
|
9
|
-
"input-style-error": "_input-style-
|
|
10
|
-
"input-container": "_input-
|
|
11
|
-
"input-style-size-xl": "_input-style-size-
|
|
12
|
-
"input-style-size-l": "_input-style-size-
|
|
13
|
-
"input-style-size-m": "_input-style-size-
|
|
14
|
-
"input-style-size-s": "_input-style-size-
|
|
15
|
-
"input-style-radius": "_input-style-
|
|
16
|
-
flexHorizontalBetween:
|
|
1
|
+
import { jsxs as a, jsx as t, Fragment as c } from "react/jsx-runtime";
|
|
2
|
+
import { useState as p, useRef as _ } from "react";
|
|
3
|
+
import '../../styles/Input.css';const j = "_flexHorizontalBetween_12i5w_141", N = "_flexHorizontal_12i5w_141", e = {
|
|
4
|
+
"input-style": "_input-style_12i5w_30",
|
|
5
|
+
"input-style-disabled": "_input-style-disabled_12i5w_60",
|
|
6
|
+
"input-style-focused": "_input-style-focused_12i5w_71",
|
|
7
|
+
"input-style-secondary": "_input-style-secondary_12i5w_78",
|
|
8
|
+
"input-style-ghost": "_input-style-ghost_12i5w_92",
|
|
9
|
+
"input-style-error": "_input-style-error_12i5w_95",
|
|
10
|
+
"input-container": "_input-container_12i5w_105",
|
|
11
|
+
"input-style-size-xl": "_input-style-size-xl_12i5w_109",
|
|
12
|
+
"input-style-size-l": "_input-style-size-l_12i5w_116",
|
|
13
|
+
"input-style-size-m": "_input-style-size-m_12i5w_123",
|
|
14
|
+
"input-style-size-s": "_input-style-size-s_12i5w_130",
|
|
15
|
+
"input-style-radius": "_input-style-radius_12i5w_137",
|
|
16
|
+
flexHorizontalBetween: j,
|
|
17
17
|
flexHorizontal: N
|
|
18
18
|
}, R = ({
|
|
19
|
-
sizeStyle:
|
|
20
|
-
labelUnit:
|
|
19
|
+
sizeStyle: y = "m",
|
|
20
|
+
labelUnit: i,
|
|
21
21
|
status: n = "default",
|
|
22
|
-
childrenLeft:
|
|
22
|
+
childrenLeft: l,
|
|
23
23
|
childrenRight: o,
|
|
24
|
-
round:
|
|
24
|
+
round: d,
|
|
25
25
|
disabled: u,
|
|
26
|
-
defaultValue:
|
|
27
|
-
...
|
|
26
|
+
defaultValue: f,
|
|
27
|
+
...w
|
|
28
28
|
}) => {
|
|
29
|
-
const [
|
|
30
|
-
|
|
29
|
+
const [z, r] = p(!1), [h, x] = p(f || ""), m = _(null), s = _(null), g = () => r(!0), B = () => r(!1), C = (F) => {
|
|
30
|
+
x(F.target.value);
|
|
31
31
|
}, H = () => {
|
|
32
32
|
s.current && s.current.focus();
|
|
33
33
|
}, S = [
|
|
34
34
|
e["input-style"],
|
|
35
|
-
e[`input-style-size-${
|
|
36
|
-
|
|
35
|
+
e[`input-style-size-${y}`],
|
|
36
|
+
d && e["input-style-radius"],
|
|
37
37
|
e.flexHorizontalBetween
|
|
38
38
|
].filter(Boolean).join(" "), v = [
|
|
39
|
-
|
|
39
|
+
z && e["input-style-focused"],
|
|
40
40
|
u && e["input-style-disabled"],
|
|
41
41
|
n === "secondary" && e["input-style-secondary"],
|
|
42
42
|
n === "ghost" && e["input-style-ghost"]
|
|
@@ -45,7 +45,7 @@ import '../../styles/Input.css';const F = "_flexHorizontalBetween_xyzdj_157", N
|
|
|
45
45
|
"div",
|
|
46
46
|
{
|
|
47
47
|
ref: m,
|
|
48
|
-
className:
|
|
48
|
+
className: `${S} ${(() => {
|
|
49
49
|
switch (n) {
|
|
50
50
|
case "error":
|
|
51
51
|
return e["input-style-error"];
|
|
@@ -57,20 +57,20 @@ import '../../styles/Input.css';const F = "_flexHorizontalBetween_xyzdj_157", N
|
|
|
57
57
|
onBlur: B,
|
|
58
58
|
onClick: H,
|
|
59
59
|
children: [
|
|
60
|
-
|
|
60
|
+
l && /* @__PURE__ */ t(c, { children: l }),
|
|
61
61
|
/* @__PURE__ */ t("div", { className: e["input-container"], children: /* @__PURE__ */ t(
|
|
62
62
|
"input",
|
|
63
63
|
{
|
|
64
|
-
autoCorrect: "
|
|
64
|
+
autoCorrect: "off",
|
|
65
65
|
disabled: u,
|
|
66
|
-
value:
|
|
66
|
+
value: h,
|
|
67
67
|
onChange: C,
|
|
68
68
|
ref: s,
|
|
69
|
-
...
|
|
69
|
+
...w
|
|
70
70
|
}
|
|
71
71
|
) }),
|
|
72
|
-
/* @__PURE__ */ a(
|
|
73
|
-
|
|
72
|
+
/* @__PURE__ */ a(c, { children: [
|
|
73
|
+
i && /* @__PURE__ */ t("div", { children: i }),
|
|
74
74
|
o && /* @__PURE__ */ t("span", { className: e.flexHorizontal, children: o })
|
|
75
75
|
] })
|
|
76
76
|
]
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useState as c, useRef as
|
|
3
|
-
import { Button as
|
|
4
|
-
import { IconButton as
|
|
5
|
-
import { Icon as
|
|
1
|
+
import { jsx as o, jsxs as d } from "react/jsx-runtime";
|
|
2
|
+
import { useState as c, useRef as v, useEffect as M } from "react";
|
|
3
|
+
import { Button as $ } from "../button/Button.js";
|
|
4
|
+
import { IconButton as f } from "../icon-button/IconButton.js";
|
|
5
|
+
import { Icon as N } from "../icon/Icon.js";
|
|
6
6
|
import { Modal as W } from "../modal/Modal.js";
|
|
7
7
|
import "../theme/ThemeContext.js";
|
|
8
8
|
import '../../styles/Size.css';import '../../styles/Menu.css';/* empty css */
|
|
9
|
-
const y = "
|
|
9
|
+
const y = "_fullHeight_11eub_15", O = "_fullWidth_11eub_18", j = "_open_11eub_21", D = "_close_11eub_25", q = "_menuButton_11eub_29", A = "_closeIcon_11eub_37", F = "_label_11eub_43", G = "_textEllipsis_11eub_47", J = "_pointer_11eub_52", K = "_fullImg_11eub_55", Q = "_menuParams_11eub_61", T = "_line_11eub_67", U = "_borderRadiusM_11eub_74", X = "_menuItem_11eub_78", Y = "_longLogo_11eub_87", Z = "_flexVerticalBetweenStart_11eub_92", ee = "_flexHorizontalBetween_11eub_99", le = "_flexHorizontalCenter_11eub_106", oe = "_flexVertical_11eub_92", ne = "_flexVerticalBetweenCenter_11eub_121", e = {
|
|
10
10
|
fullHeight: y,
|
|
11
11
|
fullWidth: O,
|
|
12
12
|
open: j,
|
|
@@ -21,100 +21,102 @@ const y = "_fullHeight_o2xi7_15", O = "_fullWidth_o2xi7_18", j = "_open_o2xi7_21
|
|
|
21
21
|
line: T,
|
|
22
22
|
borderRadiusM: U,
|
|
23
23
|
menuItem: X,
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
24
|
+
longLogo: Y,
|
|
25
|
+
flexVerticalBetweenStart: Z,
|
|
26
|
+
flexHorizontalBetween: ee,
|
|
27
|
+
flexHorizontalCenter: le,
|
|
28
|
+
flexVertical: oe,
|
|
29
|
+
flexVerticalBetweenCenter: ne
|
|
30
|
+
}, fe = ({ menuItems: s = [], menuParams: r = [], shortLogo: m, logo: h, isOpen: p, defaultOpen: w = !1, selectedId: u }) => {
|
|
31
|
+
const [t, b] = c(w ?? !1), [x, g] = c(u ?? (s.length > 0 ? s[0].id : null)), H = v(null), [z, _] = c(!1), [I, C] = c(!1), [V, L] = c(null), [k, E] = c({}), R = v(null);
|
|
32
|
+
M(() => {
|
|
33
|
+
u != null && g(u);
|
|
34
|
+
}, [u]);
|
|
35
|
+
const B = (l, i) => {
|
|
36
|
+
if (l.stopPropagation(), g(i), s) {
|
|
35
37
|
const n = s.find((a) => a.id === i);
|
|
36
38
|
n == null || n.onClick();
|
|
37
39
|
}
|
|
38
40
|
}, S = () => {
|
|
39
|
-
|
|
40
|
-
}, P = (
|
|
41
|
+
b(!t), _(!1);
|
|
42
|
+
}, P = (l) => {
|
|
41
43
|
var i;
|
|
42
44
|
if (r) {
|
|
43
|
-
const n = r.find((a) => a.id ===
|
|
45
|
+
const n = r.find((a) => a.id === l);
|
|
44
46
|
if (!n) return;
|
|
45
47
|
if (n.content) {
|
|
46
48
|
const a = t ? "200px" : "40px";
|
|
47
|
-
|
|
49
|
+
L(n.content), E({ ...n.position, left: a }), C(!0);
|
|
48
50
|
} else
|
|
49
51
|
(i = n.onClick) == null || i.call(n);
|
|
50
52
|
}
|
|
51
53
|
};
|
|
52
|
-
return
|
|
53
|
-
|
|
54
|
-
}, [t]), /* @__PURE__ */
|
|
55
|
-
/* @__PURE__ */
|
|
56
|
-
/* @__PURE__ */
|
|
54
|
+
return M(() => {
|
|
55
|
+
p && p(t);
|
|
56
|
+
}, [t]), /* @__PURE__ */ o("nav", { ref: H, children: /* @__PURE__ */ d("div", { className: `${e.flexVerticalBetweenStart} ${e.fullHeight} ${t ? e.open : e.close}`, children: [
|
|
57
|
+
/* @__PURE__ */ d("div", { className: e.fullWidth, children: [
|
|
58
|
+
/* @__PURE__ */ o(
|
|
57
59
|
"div",
|
|
58
60
|
{
|
|
59
|
-
className: `${e.
|
|
61
|
+
className: `${e.flexHorizontalCenter} ${e.pointer} ${e.textEllipsis}`,
|
|
60
62
|
onClick: () => S(),
|
|
61
|
-
children: t ? /* @__PURE__ */
|
|
62
|
-
|
|
63
|
-
/* @__PURE__ */
|
|
64
|
-
] }) : /* @__PURE__ */
|
|
63
|
+
children: t ? /* @__PURE__ */ d("div", { className: e.fullImg, children: [
|
|
64
|
+
h && /* @__PURE__ */ o("img", { className: e.longLogo, src: h, alt: "Logo situaction" }),
|
|
65
|
+
/* @__PURE__ */ o(f, { mode: "ghost", size: "menu", children: /* @__PURE__ */ o(N, { icon: "CaretDoubleLeft", size: 16, weight: "duotone" }) })
|
|
66
|
+
] }) : /* @__PURE__ */ o(
|
|
65
67
|
"div",
|
|
66
68
|
{
|
|
67
69
|
className: e.closeIcon,
|
|
68
70
|
onMouseEnter: () => _(!0),
|
|
69
71
|
onMouseLeave: () => _(!1),
|
|
70
|
-
onClick: () =>
|
|
71
|
-
children:
|
|
72
|
+
onClick: () => b(!t),
|
|
73
|
+
children: z || !m ? /* @__PURE__ */ o(f, { mode: "ghost", size: "menu", children: /* @__PURE__ */ o(N, { icon: "CaretDoubleRight", size: 22, weight: "duotone" }) }) : /* @__PURE__ */ o("img", { src: m, alt: "Logo situaction" })
|
|
72
74
|
}
|
|
73
75
|
)
|
|
74
76
|
}
|
|
75
77
|
),
|
|
76
|
-
/* @__PURE__ */
|
|
77
|
-
|
|
78
|
+
/* @__PURE__ */ o("div", { className: e.menuItem, children: s && s.map((l) => t ? /* @__PURE__ */ o("div", { className: `${e.textEllipsis} ${e.menuButton}`, children: /* @__PURE__ */ o(
|
|
79
|
+
$,
|
|
78
80
|
{
|
|
79
|
-
mode:
|
|
80
|
-
label:
|
|
81
|
-
onClick: (i) =>
|
|
82
|
-
childrenLeft:
|
|
81
|
+
mode: x === l.id ? "secondary" : "ghost",
|
|
82
|
+
label: l.label,
|
|
83
|
+
onClick: (i) => B(i, l.id),
|
|
84
|
+
childrenLeft: l.icon
|
|
83
85
|
}
|
|
84
|
-
) }, `button-${
|
|
85
|
-
|
|
86
|
+
) }, `button-${l.id}`) : /* @__PURE__ */ o("div", { className: e.textEllipsis, children: /* @__PURE__ */ o(
|
|
87
|
+
f,
|
|
86
88
|
{
|
|
87
|
-
mode:
|
|
88
|
-
children:
|
|
89
|
-
onClick: (i) =>
|
|
89
|
+
mode: x === l.id ? "secondary" : "ghost",
|
|
90
|
+
children: l.icon,
|
|
91
|
+
onClick: (i) => B(i, l.id)
|
|
90
92
|
}
|
|
91
|
-
) }, `icon-${
|
|
92
|
-
/* @__PURE__ */
|
|
93
|
+
) }, `icon-${l.id}`)) }),
|
|
94
|
+
/* @__PURE__ */ o("div", { className: e.line })
|
|
93
95
|
] }),
|
|
94
|
-
/* @__PURE__ */
|
|
95
|
-
r && r.map((
|
|
96
|
+
/* @__PURE__ */ d("div", { className: `${e.menuParams} ${e.flexVerticalBetweenCenter}`, children: [
|
|
97
|
+
r && r.map((l) => /* @__PURE__ */ o(
|
|
96
98
|
"div",
|
|
97
99
|
{
|
|
98
100
|
className: `${e.fullWidth} ${e.textEllipsis}`,
|
|
99
|
-
onClick: () => P(
|
|
100
|
-
children: t ? /* @__PURE__ */
|
|
101
|
+
onClick: () => P(l.id),
|
|
102
|
+
children: t ? /* @__PURE__ */ o("div", { className: e.menuButton, children: /* @__PURE__ */ o($, { mode: "ghost", label: l.label, childrenLeft: l.icon }, l.id) }) : /* @__PURE__ */ o(f, { mode: "ghost", children: l.icon })
|
|
101
103
|
},
|
|
102
|
-
`param-icon-${
|
|
104
|
+
`param-icon-${l.id}`
|
|
103
105
|
)),
|
|
104
|
-
/* @__PURE__ */
|
|
106
|
+
/* @__PURE__ */ o(
|
|
105
107
|
W,
|
|
106
108
|
{
|
|
107
|
-
ref:
|
|
109
|
+
ref: R,
|
|
108
110
|
className: e.borderRadiusM,
|
|
109
|
-
open:
|
|
111
|
+
open: I,
|
|
110
112
|
onClose: () => C(!1),
|
|
111
|
-
position:
|
|
112
|
-
children:
|
|
113
|
+
position: k,
|
|
114
|
+
children: V
|
|
113
115
|
}
|
|
114
116
|
)
|
|
115
117
|
] })
|
|
116
118
|
] }) });
|
|
117
119
|
};
|
|
118
120
|
export {
|
|
119
|
-
|
|
121
|
+
fe as Menu
|
|
120
122
|
};
|
|
@@ -7,22 +7,23 @@ export type SelectItem = {
|
|
|
7
7
|
value: string;
|
|
8
8
|
};
|
|
9
9
|
export interface SelectProps {
|
|
10
|
-
/** The currently selected item. If not provided, the first item from `listItem` will be used.
|
|
10
|
+
/** The currently selected item. If not provided, the first item from `listItem` will be used. **/
|
|
11
11
|
selected?: SelectItem;
|
|
12
|
-
/** The size of the select button ('s', 'm', 'l', 'xl'). Default is 'm'.
|
|
12
|
+
/** The size of the select button ('s', 'm', 'l', 'xl'). Default is 'm'. **/
|
|
13
13
|
size?: Size | 'menu';
|
|
14
|
-
/** The list of selectable items, each with a label, an optional icon, and a value.
|
|
14
|
+
/** The list of selectable items, each with a label, an optional icon, and a value. **/
|
|
15
15
|
listItem: SelectItem[];
|
|
16
|
-
/**
|
|
16
|
+
/**
|
|
17
|
+
* Determines how the selected item is displayed:
|
|
17
18
|
* - 'all' (icon + text if both exist),
|
|
18
19
|
* - 'icon' (only the icon),
|
|
19
20
|
* - 'text' (only the text).
|
|
20
21
|
* Default is 'all'.
|
|
21
22
|
*/
|
|
22
23
|
modeDisplay?: 'icon' | 'text' | 'all';
|
|
23
|
-
/** Callback function triggered when an item is selected, returning the selected object.
|
|
24
|
+
/** Callback function triggered when an item is selected, returning the selected object. **/
|
|
24
25
|
onSelect?: (selected: SelectItem) => void;
|
|
25
|
-
/** Position personnalized
|
|
26
|
+
/** Position personnalized **/
|
|
26
27
|
positionOverride?: {
|
|
27
28
|
top?: string;
|
|
28
29
|
left?: string;
|
|
@@ -30,12 +31,12 @@ export interface SelectProps {
|
|
|
30
31
|
bottom?: string;
|
|
31
32
|
width?: string;
|
|
32
33
|
};
|
|
33
|
-
/** Text displayed when no item is selected
|
|
34
|
+
/** Text displayed when no item is selected **/
|
|
34
35
|
placeholder?: string;
|
|
35
36
|
searchPlaceholder?: string;
|
|
36
|
-
/** Condition to close the modal
|
|
37
|
+
/** Condition to close the modal **/
|
|
37
38
|
autoCloseCondition: boolean;
|
|
38
|
-
/** Enable a search input inside the select modal to filter options
|
|
39
|
+
/** Enable a search input inside the select modal to filter options **/
|
|
39
40
|
searchable?: boolean;
|
|
40
41
|
fullWidth?: boolean;
|
|
41
42
|
}
|