@situaction/traq-ui-ste 1.1.35 → 1.1.36
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.
|
@@ -36,8 +36,8 @@ import '../../styles/Modal.css';const A = "_overlay_lv2n7_2", B = "_modalContent
|
|
|
36
36
|
onMouseDown: (r) => r.stopPropagation(),
|
|
37
37
|
style: {
|
|
38
38
|
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)
|
|
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
41
|
right: e == null ? void 0 : e.right,
|
|
42
42
|
bottom: e == null ? void 0 : e.bottom,
|
|
43
43
|
width: e == null ? void 0 : e.width,
|
|
@@ -18,7 +18,7 @@ const z = "_selectContainer_1o5wx_54", A = "_selected_1o5wx_57", D = "_children_
|
|
|
18
18
|
}, ce = ({
|
|
19
19
|
selected: _,
|
|
20
20
|
size: b = "m",
|
|
21
|
-
listItem:
|
|
21
|
+
listItem: s,
|
|
22
22
|
modeDisplay: g = "all",
|
|
23
23
|
onSelect: B,
|
|
24
24
|
positionOverride: R,
|
|
@@ -29,17 +29,17 @@ const z = "_selectContainer_1o5wx_54", A = "_selected_1o5wx_57", D = "_children_
|
|
|
29
29
|
const [n, u] = x(!1), U = h(null), [V, F] = x({
|
|
30
30
|
top: "calc(100% + 6px)",
|
|
31
31
|
left: "0px"
|
|
32
|
-
}), [
|
|
32
|
+
}), [c, L] = x(_ ?? null);
|
|
33
33
|
w(() => {
|
|
34
|
-
_ ? L(_) :
|
|
35
|
-
}, [_,
|
|
34
|
+
_ ? L(_) : s.length > 0 ? L(s[0]) : L(null);
|
|
35
|
+
}, [_, s]), w(() => {
|
|
36
36
|
R && F(R);
|
|
37
37
|
}, [R]);
|
|
38
38
|
const M = (e) => {
|
|
39
39
|
L(e), u(!1), B && B(e);
|
|
40
40
|
}, O = () => {
|
|
41
|
-
const e =
|
|
42
|
-
return g === "icon" && e ? /* @__PURE__ */ r(W, { ref: d, mode: "tertiary", size: b, onClick: () => u(!n), children: /* @__PURE__ */ r(p, { icon:
|
|
41
|
+
const e = c == null ? void 0 : c.icon, o = (c == null ? void 0 : c.label) || P || "Sélectionner";
|
|
42
|
+
return g === "icon" && e ? /* @__PURE__ */ r(W, { ref: d, mode: "tertiary", size: b, onClick: () => u(!n), children: /* @__PURE__ */ r(p, { icon: c.icon }) }) : g === "text" ? /* @__PURE__ */ r(
|
|
43
43
|
N,
|
|
44
44
|
{
|
|
45
45
|
ref: d,
|
|
@@ -58,7 +58,7 @@ const z = "_selectContainer_1o5wx_54", A = "_selected_1o5wx_57", D = "_children_
|
|
|
58
58
|
label: o,
|
|
59
59
|
size: b,
|
|
60
60
|
fullWidth: T,
|
|
61
|
-
childrenLeft: e && /* @__PURE__ */ r(p, { icon:
|
|
61
|
+
childrenLeft: e && /* @__PURE__ */ r(p, { icon: c.icon }),
|
|
62
62
|
childrenRight: /* @__PURE__ */ r(p, { icon: n ? "CaretUp" : "CaretDown", size: 14, weight: "bold" }),
|
|
63
63
|
onClick: () => u(!n)
|
|
64
64
|
}
|
|
@@ -77,11 +77,11 @@ const z = "_selectContainer_1o5wx_54", A = "_selected_1o5wx_57", D = "_children_
|
|
|
77
77
|
if (!n) return;
|
|
78
78
|
const o = e.key.length === 1 ? e.key.toLowerCase() : "";
|
|
79
79
|
if (!o) return;
|
|
80
|
-
const
|
|
81
|
-
v(
|
|
82
|
-
const a =
|
|
83
|
-
var
|
|
84
|
-
return (
|
|
80
|
+
const l = k + o;
|
|
81
|
+
v(l);
|
|
82
|
+
const a = s.find((t) => {
|
|
83
|
+
var i;
|
|
84
|
+
return (i = t.label) == null ? void 0 : i.toLowerCase().startsWith(l);
|
|
85
85
|
});
|
|
86
86
|
if (a) {
|
|
87
87
|
const t = C.current[a.value];
|
|
@@ -93,23 +93,23 @@ const z = "_selectContainer_1o5wx_54", A = "_selected_1o5wx_57", D = "_children_
|
|
|
93
93
|
};
|
|
94
94
|
w(() => (n ? window.addEventListener("keydown", S) : (window.removeEventListener("keydown", S), v("")), () => {
|
|
95
95
|
window.removeEventListener("keydown", S);
|
|
96
|
-
}), [n, k,
|
|
96
|
+
}), [n, k, s]), w(() => {
|
|
97
97
|
const e = (o) => {
|
|
98
98
|
if (!n) return;
|
|
99
|
-
const
|
|
100
|
-
if (!
|
|
101
|
-
const a = k +
|
|
99
|
+
const l = o.key.length === 1 ? o.key.toLowerCase() : "";
|
|
100
|
+
if (!l) return;
|
|
101
|
+
const a = k + l;
|
|
102
102
|
v(a);
|
|
103
|
-
const t =
|
|
104
|
-
(
|
|
103
|
+
const t = s.find(
|
|
104
|
+
(i) => {
|
|
105
105
|
var y;
|
|
106
|
-
return (y =
|
|
106
|
+
return (y = i.label) == null ? void 0 : y.toLowerCase().startsWith(a);
|
|
107
107
|
}
|
|
108
108
|
);
|
|
109
109
|
if (t && E.current && t.value in C.current && C.current[t.value]) {
|
|
110
|
-
const
|
|
111
|
-
|
|
112
|
-
top: y.offsetTop -
|
|
110
|
+
const i = E.current, y = C.current[t.value];
|
|
111
|
+
i.scrollTo({
|
|
112
|
+
top: y.offsetTop - i.offsetTop,
|
|
113
113
|
behavior: "smooth"
|
|
114
114
|
});
|
|
115
115
|
}
|
|
@@ -118,15 +118,15 @@ const z = "_selectContainer_1o5wx_54", A = "_selected_1o5wx_57", D = "_children_
|
|
|
118
118
|
}, 700);
|
|
119
119
|
};
|
|
120
120
|
return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
|
|
121
|
-
}, [n,
|
|
121
|
+
}, [n, s, k]), w(() => {
|
|
122
122
|
if (!n) return;
|
|
123
123
|
const e = (o) => {
|
|
124
|
-
const
|
|
125
|
-
if (
|
|
126
|
-
const a =
|
|
124
|
+
const l = o.key.toLowerCase();
|
|
125
|
+
if (l.length === 1) {
|
|
126
|
+
const a = s.find(
|
|
127
127
|
(t) => {
|
|
128
|
-
var
|
|
129
|
-
return (
|
|
128
|
+
var i;
|
|
129
|
+
return (i = t.label) == null ? void 0 : i.toLowerCase().startsWith(l);
|
|
130
130
|
}
|
|
131
131
|
);
|
|
132
132
|
if (a) {
|
|
@@ -136,7 +136,7 @@ const z = "_selectContainer_1o5wx_54", A = "_selected_1o5wx_57", D = "_children_
|
|
|
136
136
|
}
|
|
137
137
|
};
|
|
138
138
|
return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
|
|
139
|
-
}, [n,
|
|
139
|
+
}, [n, s]);
|
|
140
140
|
const d = h(null);
|
|
141
141
|
return w(() => {
|
|
142
142
|
if (n && d.current) {
|
|
@@ -159,11 +159,11 @@ const z = "_selectContainer_1o5wx_54", A = "_selected_1o5wx_57", D = "_children_
|
|
|
159
159
|
disableOverlay: !0,
|
|
160
160
|
className: m.modal,
|
|
161
161
|
autoCloseCondition: j,
|
|
162
|
-
children: /* @__PURE__ */ r("div", { className: m.selectList, ref: E, children:
|
|
162
|
+
children: /* @__PURE__ */ r("div", { className: m.selectList, ref: E, children: s.map((e) => /* @__PURE__ */ $(
|
|
163
163
|
"div",
|
|
164
164
|
{
|
|
165
165
|
ref: (o) => K.current[e.value] = o,
|
|
166
|
-
className: `${m.children} ${(
|
|
166
|
+
className: `${m.children} ${(c == null ? void 0 : c.value) === e.value ? m.active : ""}`,
|
|
167
167
|
onClick: () => M(e),
|
|
168
168
|
children: [
|
|
169
169
|
e.icon && /* @__PURE__ */ r(p, { icon: e.icon, size: 16 }),
|