@situaction/traq-ui-ste 1.2.30 → 1.2.31
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.
|
@@ -5,18 +5,18 @@ import { Input as G } from "../input/Input.js";
|
|
|
5
5
|
import { IconButton as H } from "../icon-button/IconButton.js";
|
|
6
6
|
import "../accordion/Accordion.js";
|
|
7
7
|
import { Icon as _ } from "../icon/Icon.js";
|
|
8
|
-
import { Modal as
|
|
8
|
+
import { Modal as I } from "../modal/Modal.js";
|
|
9
9
|
import "../carousel/Carousel.js";
|
|
10
10
|
import "../carousel/FadeCarousel.js";
|
|
11
11
|
import "../theme/ThemeContext.js";
|
|
12
12
|
import '../../styles/Size.css';import '../../styles/Select.css';/* empty css */
|
|
13
|
-
const
|
|
14
|
-
selectContainer:
|
|
15
|
-
children:
|
|
16
|
-
active:
|
|
17
|
-
selectList:
|
|
18
|
-
modal:
|
|
19
|
-
itemLabel:
|
|
13
|
+
const J = "_selectContainer_133eb_54", Q = "_children_133eb_61", X = "_active_133eb_78", Y = "_selectList_133eb_82", Z = "_modal_133eb_91", O = "_itemLabel_133eb_98", ee = "_searchWrapper_133eb_103", te = "_noResults_133eb_109", f = {
|
|
14
|
+
selectContainer: J,
|
|
15
|
+
children: Q,
|
|
16
|
+
active: X,
|
|
17
|
+
selectList: Y,
|
|
18
|
+
modal: Z,
|
|
19
|
+
itemLabel: O,
|
|
20
20
|
searchWrapper: ee,
|
|
21
21
|
noResults: te
|
|
22
22
|
}, me = ({
|
|
@@ -27,15 +27,15 @@ const Q = "_selectContainer_133eb_54", X = "_children_133eb_61", Y = "_active_13
|
|
|
27
27
|
onSelect: B,
|
|
28
28
|
positionOverride: b,
|
|
29
29
|
placeholder: x = "Sélectionner",
|
|
30
|
-
searchPlaceholder:
|
|
30
|
+
searchPlaceholder: U,
|
|
31
31
|
autoCloseCondition: w,
|
|
32
|
-
searchable:
|
|
32
|
+
searchable: V = !1,
|
|
33
33
|
fullWidth: T = !1
|
|
34
34
|
}) => {
|
|
35
35
|
const [t, l] = y(!1), [A, K] = y({
|
|
36
36
|
top: "calc(100% + 6px)",
|
|
37
37
|
left: "0px"
|
|
38
|
-
}), [n, S] = y(k ?? null), [$, F] = y(""), u = v(null),
|
|
38
|
+
}), [n, S] = y(k ?? null), [$, F] = y(""), u = v(null), z = v(null), N = v(null), P = v({}), j = v({}), p = v(null);
|
|
39
39
|
d(() => {
|
|
40
40
|
S(k || null);
|
|
41
41
|
}, [k]), d(() => {
|
|
@@ -85,7 +85,7 @@ const Q = "_selectContainer_133eb_54", X = "_children_133eb_61", Y = "_active_13
|
|
|
85
85
|
"aria-haspopup": "listbox"
|
|
86
86
|
}
|
|
87
87
|
);
|
|
88
|
-
},
|
|
88
|
+
}, D = h.filter(
|
|
89
89
|
(e) => String(e.label ?? "").toLowerCase().includes($.toLowerCase())
|
|
90
90
|
), [C, R] = y("");
|
|
91
91
|
return d(() => {
|
|
@@ -137,7 +137,7 @@ const Q = "_selectContainer_133eb_54", X = "_children_133eb_61", Y = "_active_13
|
|
|
137
137
|
return (a = o.label) == null ? void 0 : a.toLowerCase().startsWith(c);
|
|
138
138
|
});
|
|
139
139
|
if (i) {
|
|
140
|
-
const o =
|
|
140
|
+
const o = j.current[i.value];
|
|
141
141
|
o && o.scrollIntoView({ block: "start", behavior: "smooth" });
|
|
142
142
|
}
|
|
143
143
|
}
|
|
@@ -151,7 +151,7 @@ const Q = "_selectContainer_133eb_54", X = "_children_133eb_61", Y = "_active_13
|
|
|
151
151
|
}, [t, b]), d(() => {
|
|
152
152
|
if (!t || !w) return;
|
|
153
153
|
const e = (r) => {
|
|
154
|
-
const c = r.target, i = u.current, o =
|
|
154
|
+
const c = r.target, i = u.current, o = z.current;
|
|
155
155
|
i && i.contains(c) || o && o.contains(c) || l(!1);
|
|
156
156
|
};
|
|
157
157
|
return document.addEventListener("mousedown", e), document.addEventListener("touchstart", e, { passive: !0 }), () => {
|
|
@@ -166,7 +166,7 @@ const Q = "_selectContainer_133eb_54", X = "_children_133eb_61", Y = "_active_13
|
|
|
166
166
|
}, [t, w]), /* @__PURE__ */ L("div", { className: f.selectContainer, children: [
|
|
167
167
|
q(),
|
|
168
168
|
/* @__PURE__ */ s(
|
|
169
|
-
|
|
169
|
+
I,
|
|
170
170
|
{
|
|
171
171
|
anchorRef: u,
|
|
172
172
|
open: t,
|
|
@@ -175,13 +175,13 @@ const Q = "_selectContainer_133eb_54", X = "_children_133eb_61", Y = "_active_13
|
|
|
175
175
|
disableOverlay: !0,
|
|
176
176
|
className: f.modal,
|
|
177
177
|
autoCloseCondition: w,
|
|
178
|
-
children: /* @__PURE__ */ L("div", { ref:
|
|
179
|
-
|
|
178
|
+
children: /* @__PURE__ */ L("div", { ref: z, children: [
|
|
179
|
+
V && /* @__PURE__ */ L("div", { children: [
|
|
180
180
|
/* @__PURE__ */ s(
|
|
181
181
|
G,
|
|
182
182
|
{
|
|
183
183
|
type: "text",
|
|
184
|
-
placeholder:
|
|
184
|
+
placeholder: U,
|
|
185
185
|
status: "ghost",
|
|
186
186
|
sizeStyle: "s",
|
|
187
187
|
value: $,
|
|
@@ -191,22 +191,22 @@ const Q = "_selectContainer_133eb_54", X = "_children_133eb_61", Y = "_active_13
|
|
|
191
191
|
/* @__PURE__ */ s("div", { className: f.searchWrapper })
|
|
192
192
|
] }),
|
|
193
193
|
/* @__PURE__ */ L("div", { className: f.selectList, ref: N, children: [
|
|
194
|
-
|
|
194
|
+
D.map((e) => /* @__PURE__ */ L(
|
|
195
195
|
"div",
|
|
196
196
|
{
|
|
197
|
-
ref: (r) =>
|
|
197
|
+
ref: (r) => j.current[e.value] = r,
|
|
198
198
|
className: `${f.children} ${(n == null ? void 0 : n.value) === e.value ? f.active : ""}`,
|
|
199
199
|
onClick: () => M(e),
|
|
200
200
|
role: "option",
|
|
201
201
|
"aria-selected": (n == null ? void 0 : n.value) === e.value,
|
|
202
202
|
children: [
|
|
203
|
-
e.icon && /* @__PURE__ */ s(_, { icon: e.icon, size:
|
|
203
|
+
e.icon && /* @__PURE__ */ s(_, { icon: e.icon, size: e.sizeIcon ? e.sizeIcon : 20 }),
|
|
204
204
|
e.label && /* @__PURE__ */ s("div", { className: f.itemLabel, children: e.label })
|
|
205
205
|
]
|
|
206
206
|
},
|
|
207
207
|
e.value
|
|
208
208
|
)),
|
|
209
|
-
|
|
209
|
+
D.length === 0 && /* @__PURE__ */ s("div", { className: `${f.noResults} textSmall`, children: "Aucun résultat" })
|
|
210
210
|
] })
|
|
211
211
|
] })
|
|
212
212
|
}
|