react-animated-select 0.4.1 → 0.5.2
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/README.md +8 -7
- package/dist/index.cjs.js +9 -9
- package/dist/index.css +1 -1
- package/dist/index.es.js +1030 -885
- package/index.d.ts +7 -1
- package/package.json +1 -1
- package/src/animated.jsx +43 -16
- package/src/index.js +1 -0
- package/src/options.jsx +80 -14
- package/src/select.css +27 -16
- package/src/select.jsx +13 -9
- package/src/selectJSX.jsx +49 -15
- package/src/useSelect.jsx +5 -1
- package/src/useSelectLogic.jsx +86 -24
package/dist/index.es.js
CHANGED
|
@@ -1,269 +1,270 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { CSSTransition as
|
|
3
|
-
import
|
|
4
|
-
var
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
1
|
+
import Be, { createContext as Ze, memo as Fe, useRef as fe, useState as ue, useCallback as N, useEffect as re, useMemo as de, useId as ze, forwardRef as ur, useImperativeHandle as dr, isValidElement as fr, cloneElement as gr, useContext as Le } from "react";
|
|
2
|
+
import { CSSTransition as Te, TransitionGroup as pr } from "react-transition-group";
|
|
3
|
+
import { createPortal as hr } from "react-dom";
|
|
4
|
+
import './index.css';var ke = { exports: {} }, Se = {};
|
|
5
|
+
var Me;
|
|
6
|
+
function xr() {
|
|
7
|
+
if (Me) return Se;
|
|
8
|
+
Me = 1;
|
|
9
|
+
var e = /* @__PURE__ */ Symbol.for("react.transitional.element"), i = /* @__PURE__ */ Symbol.for("react.fragment");
|
|
10
|
+
function a(o, l, n) {
|
|
11
|
+
var m = null;
|
|
12
|
+
if (n !== void 0 && (m = "" + n), l.key !== void 0 && (m = "" + l.key), "key" in l) {
|
|
13
|
+
n = {};
|
|
14
|
+
for (var y in l)
|
|
15
|
+
y !== "key" && (n[y] = l[y]);
|
|
16
|
+
} else n = l;
|
|
17
|
+
return l = n.ref, {
|
|
18
|
+
$$typeof: e,
|
|
19
|
+
type: o,
|
|
20
|
+
key: m,
|
|
21
|
+
ref: l !== void 0 ? l : null,
|
|
22
|
+
props: n
|
|
22
23
|
};
|
|
23
24
|
}
|
|
24
|
-
return
|
|
25
|
+
return Se.Fragment = i, Se.jsx = a, Se.jsxs = a, Se;
|
|
25
26
|
}
|
|
26
|
-
var
|
|
27
|
-
var
|
|
28
|
-
function
|
|
29
|
-
return
|
|
30
|
-
function r
|
|
31
|
-
if (
|
|
32
|
-
if (typeof
|
|
33
|
-
return
|
|
34
|
-
if (typeof
|
|
35
|
-
switch (
|
|
36
|
-
case
|
|
27
|
+
var _e = {};
|
|
28
|
+
var Ve;
|
|
29
|
+
function br() {
|
|
30
|
+
return Ve || (Ve = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
31
|
+
function e(r) {
|
|
32
|
+
if (r == null) return null;
|
|
33
|
+
if (typeof r == "function")
|
|
34
|
+
return r.$$typeof === h ? null : r.displayName || r.name || null;
|
|
35
|
+
if (typeof r == "string") return r;
|
|
36
|
+
switch (r) {
|
|
37
|
+
case R:
|
|
37
38
|
return "Fragment";
|
|
38
|
-
case
|
|
39
|
+
case T:
|
|
39
40
|
return "Profiler";
|
|
40
|
-
case
|
|
41
|
+
case C:
|
|
41
42
|
return "StrictMode";
|
|
42
|
-
case
|
|
43
|
+
case X:
|
|
43
44
|
return "Suspense";
|
|
44
|
-
case
|
|
45
|
+
case te:
|
|
45
46
|
return "SuspenseList";
|
|
46
|
-
case
|
|
47
|
+
case G:
|
|
47
48
|
return "Activity";
|
|
48
49
|
}
|
|
49
|
-
if (typeof
|
|
50
|
-
switch (typeof
|
|
50
|
+
if (typeof r == "object")
|
|
51
|
+
switch (typeof r.tag == "number" && console.error(
|
|
51
52
|
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
52
|
-
),
|
|
53
|
-
case
|
|
53
|
+
), r.$$typeof) {
|
|
54
|
+
case P:
|
|
54
55
|
return "Portal";
|
|
55
|
-
case u:
|
|
56
|
-
return e.displayName || "Context";
|
|
57
|
-
case F:
|
|
58
|
-
return (e._context.displayName || "Context") + ".Consumer";
|
|
59
56
|
case U:
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
return f = e.displayName || null, f !== null ? f : r(e.type) || "Memo";
|
|
57
|
+
return r.displayName || "Context";
|
|
58
|
+
case z:
|
|
59
|
+
return (r._context.displayName || "Context") + ".Consumer";
|
|
64
60
|
case Q:
|
|
65
|
-
|
|
61
|
+
var g = r.render;
|
|
62
|
+
return r = r.displayName, r || (r = g.displayName || g.name || "", r = r !== "" ? "ForwardRef(" + r + ")" : "ForwardRef"), r;
|
|
63
|
+
case ne:
|
|
64
|
+
return g = r.displayName || null, g !== null ? g : e(r.type) || "Memo";
|
|
65
|
+
case c:
|
|
66
|
+
g = r._payload, r = r._init;
|
|
66
67
|
try {
|
|
67
|
-
return r(
|
|
68
|
+
return e(r(g));
|
|
68
69
|
} catch {
|
|
69
70
|
}
|
|
70
71
|
}
|
|
71
72
|
return null;
|
|
72
73
|
}
|
|
73
|
-
function
|
|
74
|
-
return "" +
|
|
74
|
+
function i(r) {
|
|
75
|
+
return "" + r;
|
|
75
76
|
}
|
|
76
|
-
function a(
|
|
77
|
+
function a(r) {
|
|
77
78
|
try {
|
|
78
|
-
|
|
79
|
-
var
|
|
79
|
+
i(r);
|
|
80
|
+
var g = !1;
|
|
80
81
|
} catch {
|
|
81
|
-
|
|
82
|
+
g = !0;
|
|
82
83
|
}
|
|
83
|
-
if (
|
|
84
|
-
|
|
85
|
-
var w =
|
|
84
|
+
if (g) {
|
|
85
|
+
g = console;
|
|
86
|
+
var w = g.error, A = typeof Symbol == "function" && Symbol.toStringTag && r[Symbol.toStringTag] || r.constructor.name || "Object";
|
|
86
87
|
return w.call(
|
|
87
|
-
|
|
88
|
+
g,
|
|
88
89
|
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
89
|
-
|
|
90
|
-
),
|
|
90
|
+
A
|
|
91
|
+
), i(r);
|
|
91
92
|
}
|
|
92
93
|
}
|
|
93
|
-
function
|
|
94
|
-
if (
|
|
95
|
-
if (typeof
|
|
94
|
+
function o(r) {
|
|
95
|
+
if (r === R) return "<>";
|
|
96
|
+
if (typeof r == "object" && r !== null && r.$$typeof === c)
|
|
96
97
|
return "<...>";
|
|
97
98
|
try {
|
|
98
|
-
var
|
|
99
|
-
return
|
|
99
|
+
var g = e(r);
|
|
100
|
+
return g ? "<" + g + ">" : "<...>";
|
|
100
101
|
} catch {
|
|
101
102
|
return "<...>";
|
|
102
103
|
}
|
|
103
104
|
}
|
|
104
|
-
function
|
|
105
|
-
var
|
|
106
|
-
return
|
|
105
|
+
function l() {
|
|
106
|
+
var r = E.A;
|
|
107
|
+
return r === null ? null : r.getOwner();
|
|
107
108
|
}
|
|
108
|
-
function
|
|
109
|
+
function n() {
|
|
109
110
|
return Error("react-stack-top-frame");
|
|
110
111
|
}
|
|
111
|
-
function
|
|
112
|
-
if (
|
|
113
|
-
var
|
|
114
|
-
if (
|
|
112
|
+
function m(r) {
|
|
113
|
+
if (k.call(r, "key")) {
|
|
114
|
+
var g = Object.getOwnPropertyDescriptor(r, "key").get;
|
|
115
|
+
if (g && g.isReactWarning) return !1;
|
|
115
116
|
}
|
|
116
|
-
return
|
|
117
|
+
return r.key !== void 0;
|
|
117
118
|
}
|
|
118
|
-
function
|
|
119
|
+
function y(r, g) {
|
|
119
120
|
function w() {
|
|
120
|
-
|
|
121
|
+
H || (H = !0, console.error(
|
|
121
122
|
"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
|
|
122
|
-
|
|
123
|
+
g
|
|
123
124
|
));
|
|
124
125
|
}
|
|
125
|
-
w.isReactWarning = !0, Object.defineProperty(
|
|
126
|
+
w.isReactWarning = !0, Object.defineProperty(r, "key", {
|
|
126
127
|
get: w,
|
|
127
128
|
configurable: !0
|
|
128
129
|
});
|
|
129
130
|
}
|
|
130
|
-
function
|
|
131
|
-
var
|
|
132
|
-
return
|
|
131
|
+
function b() {
|
|
132
|
+
var r = e(this.type);
|
|
133
|
+
return ge[r] || (ge[r] = !0, console.error(
|
|
133
134
|
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
134
|
-
)),
|
|
135
|
+
)), r = this.props.ref, r !== void 0 ? r : null;
|
|
135
136
|
}
|
|
136
|
-
function p(
|
|
137
|
-
var
|
|
138
|
-
return
|
|
139
|
-
$$typeof:
|
|
140
|
-
type:
|
|
141
|
-
key:
|
|
137
|
+
function p(r, g, w, A, B, Z) {
|
|
138
|
+
var t = w.ref;
|
|
139
|
+
return r = {
|
|
140
|
+
$$typeof: O,
|
|
141
|
+
type: r,
|
|
142
|
+
key: g,
|
|
142
143
|
props: w,
|
|
143
|
-
_owner:
|
|
144
|
-
}, (
|
|
144
|
+
_owner: A
|
|
145
|
+
}, (t !== void 0 ? t : null) !== null ? Object.defineProperty(r, "ref", {
|
|
145
146
|
enumerable: !1,
|
|
146
|
-
get:
|
|
147
|
-
}) : Object.defineProperty(
|
|
147
|
+
get: b
|
|
148
|
+
}) : Object.defineProperty(r, "ref", { enumerable: !1, value: null }), r._store = {}, Object.defineProperty(r._store, "validated", {
|
|
148
149
|
configurable: !1,
|
|
149
150
|
enumerable: !1,
|
|
150
151
|
writable: !0,
|
|
151
152
|
value: 0
|
|
152
|
-
}), Object.defineProperty(
|
|
153
|
+
}), Object.defineProperty(r, "_debugInfo", {
|
|
153
154
|
configurable: !1,
|
|
154
155
|
enumerable: !1,
|
|
155
156
|
writable: !0,
|
|
156
157
|
value: null
|
|
157
|
-
}), Object.defineProperty(
|
|
158
|
+
}), Object.defineProperty(r, "_debugStack", {
|
|
158
159
|
configurable: !1,
|
|
159
160
|
enumerable: !1,
|
|
160
161
|
writable: !0,
|
|
161
|
-
value:
|
|
162
|
-
}), Object.defineProperty(
|
|
162
|
+
value: B
|
|
163
|
+
}), Object.defineProperty(r, "_debugTask", {
|
|
163
164
|
configurable: !1,
|
|
164
165
|
enumerable: !1,
|
|
165
166
|
writable: !0,
|
|
166
|
-
value:
|
|
167
|
-
}), Object.freeze && (Object.freeze(
|
|
167
|
+
value: Z
|
|
168
|
+
}), Object.freeze && (Object.freeze(r.props), Object.freeze(r)), r;
|
|
168
169
|
}
|
|
169
|
-
function
|
|
170
|
-
var
|
|
171
|
-
if (
|
|
172
|
-
if (
|
|
173
|
-
if (
|
|
174
|
-
for (
|
|
175
|
-
|
|
176
|
-
Object.freeze && Object.freeze(
|
|
170
|
+
function L(r, g, w, A, B, Z) {
|
|
171
|
+
var t = g.children;
|
|
172
|
+
if (t !== void 0)
|
|
173
|
+
if (A)
|
|
174
|
+
if (Y(t)) {
|
|
175
|
+
for (A = 0; A < t.length; A++)
|
|
176
|
+
j(t[A]);
|
|
177
|
+
Object.freeze && Object.freeze(t);
|
|
177
178
|
} else
|
|
178
179
|
console.error(
|
|
179
180
|
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
180
181
|
);
|
|
181
|
-
else
|
|
182
|
-
if (
|
|
183
|
-
|
|
184
|
-
var
|
|
185
|
-
return
|
|
182
|
+
else j(t);
|
|
183
|
+
if (k.call(g, "key")) {
|
|
184
|
+
t = e(r);
|
|
185
|
+
var f = Object.keys(g).filter(function(x) {
|
|
186
|
+
return x !== "key";
|
|
186
187
|
});
|
|
187
|
-
|
|
188
|
+
A = 0 < f.length ? "{key: someKey, " + f.join(": ..., ") + ": ...}" : "{key: someKey}", ie[t + A] || (f = 0 < f.length ? "{" + f.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
188
189
|
`A props object containing a "key" prop is being spread into JSX:
|
|
189
190
|
let props = %s;
|
|
190
191
|
<%s {...props} />
|
|
191
192
|
React keys must be passed directly to JSX without using spread:
|
|
192
193
|
let props = %s;
|
|
193
194
|
<%s key={someKey} {...props} />`,
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
), ie[
|
|
195
|
+
A,
|
|
196
|
+
t,
|
|
197
|
+
f,
|
|
198
|
+
t
|
|
199
|
+
), ie[t + A] = !0);
|
|
199
200
|
}
|
|
200
|
-
if (
|
|
201
|
+
if (t = null, w !== void 0 && (a(w), t = "" + w), m(g) && (a(g.key), t = "" + g.key), "key" in g) {
|
|
201
202
|
w = {};
|
|
202
|
-
for (var
|
|
203
|
-
|
|
204
|
-
} else w =
|
|
205
|
-
return
|
|
203
|
+
for (var s in g)
|
|
204
|
+
s !== "key" && (w[s] = g[s]);
|
|
205
|
+
} else w = g;
|
|
206
|
+
return t && y(
|
|
206
207
|
w,
|
|
207
|
-
typeof
|
|
208
|
+
typeof r == "function" ? r.displayName || r.name || "Unknown" : r
|
|
208
209
|
), p(
|
|
209
|
-
|
|
210
|
-
|
|
210
|
+
r,
|
|
211
|
+
t,
|
|
211
212
|
w,
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
213
|
+
l(),
|
|
214
|
+
B,
|
|
215
|
+
Z
|
|
215
216
|
);
|
|
216
217
|
}
|
|
217
|
-
function
|
|
218
|
-
|
|
218
|
+
function j(r) {
|
|
219
|
+
V(r) ? r._store && (r._store.validated = 1) : typeof r == "object" && r !== null && r.$$typeof === c && (r._payload.status === "fulfilled" ? V(r._payload.value) && r._payload.value._store && (r._payload.value._store.validated = 1) : r._store && (r._store.validated = 1));
|
|
219
220
|
}
|
|
220
|
-
function
|
|
221
|
-
return typeof
|
|
221
|
+
function V(r) {
|
|
222
|
+
return typeof r == "object" && r !== null && r.$$typeof === O;
|
|
222
223
|
}
|
|
223
|
-
var
|
|
224
|
+
var J = Be, O = /* @__PURE__ */ Symbol.for("react.transitional.element"), P = /* @__PURE__ */ Symbol.for("react.portal"), R = /* @__PURE__ */ Symbol.for("react.fragment"), C = /* @__PURE__ */ Symbol.for("react.strict_mode"), T = /* @__PURE__ */ Symbol.for("react.profiler"), z = /* @__PURE__ */ Symbol.for("react.consumer"), U = /* @__PURE__ */ Symbol.for("react.context"), Q = /* @__PURE__ */ Symbol.for("react.forward_ref"), X = /* @__PURE__ */ Symbol.for("react.suspense"), te = /* @__PURE__ */ Symbol.for("react.suspense_list"), ne = /* @__PURE__ */ Symbol.for("react.memo"), c = /* @__PURE__ */ Symbol.for("react.lazy"), G = /* @__PURE__ */ Symbol.for("react.activity"), h = /* @__PURE__ */ Symbol.for("react.client.reference"), E = J.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, k = Object.prototype.hasOwnProperty, Y = Array.isArray, S = console.createTask ? console.createTask : function() {
|
|
224
225
|
return null;
|
|
225
226
|
};
|
|
226
|
-
|
|
227
|
-
react_stack_bottom_frame: function(
|
|
228
|
-
return
|
|
227
|
+
J = {
|
|
228
|
+
react_stack_bottom_frame: function(r) {
|
|
229
|
+
return r();
|
|
229
230
|
}
|
|
230
231
|
};
|
|
231
|
-
var
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
)(),
|
|
235
|
-
|
|
236
|
-
var
|
|
237
|
-
return
|
|
238
|
-
|
|
239
|
-
|
|
232
|
+
var H, ge = {}, K = J.react_stack_bottom_frame.bind(
|
|
233
|
+
J,
|
|
234
|
+
n
|
|
235
|
+
)(), le = S(o(n)), ie = {};
|
|
236
|
+
_e.Fragment = R, _e.jsx = function(r, g, w) {
|
|
237
|
+
var A = 1e4 > E.recentlyCreatedOwnerStacks++;
|
|
238
|
+
return L(
|
|
239
|
+
r,
|
|
240
|
+
g,
|
|
240
241
|
w,
|
|
241
242
|
!1,
|
|
242
|
-
|
|
243
|
-
|
|
243
|
+
A ? Error("react-stack-top-frame") : K,
|
|
244
|
+
A ? S(o(r)) : le
|
|
244
245
|
);
|
|
245
|
-
},
|
|
246
|
-
var
|
|
247
|
-
return
|
|
248
|
-
|
|
249
|
-
|
|
246
|
+
}, _e.jsxs = function(r, g, w) {
|
|
247
|
+
var A = 1e4 > E.recentlyCreatedOwnerStacks++;
|
|
248
|
+
return L(
|
|
249
|
+
r,
|
|
250
|
+
g,
|
|
250
251
|
w,
|
|
251
252
|
!0,
|
|
252
|
-
|
|
253
|
-
|
|
253
|
+
A ? Error("react-stack-top-frame") : K,
|
|
254
|
+
A ? S(o(r)) : le
|
|
254
255
|
);
|
|
255
256
|
};
|
|
256
|
-
})()),
|
|
257
|
+
})()), _e;
|
|
257
258
|
}
|
|
258
|
-
var
|
|
259
|
-
function
|
|
260
|
-
return
|
|
259
|
+
var Ue;
|
|
260
|
+
function yr() {
|
|
261
|
+
return Ue || (Ue = 1, process.env.NODE_ENV === "production" ? ke.exports = xr() : ke.exports = br()), ke.exports;
|
|
261
262
|
}
|
|
262
|
-
var
|
|
263
|
-
const
|
|
263
|
+
var d = yr();
|
|
264
|
+
const qe = ({ className: e = "", ...i }) => /* @__PURE__ */ d.jsx(
|
|
264
265
|
"svg",
|
|
265
266
|
{
|
|
266
|
-
className:
|
|
267
|
+
className: e,
|
|
267
268
|
role: "button",
|
|
268
269
|
"aria-label": "Clear selection",
|
|
269
270
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -271,360 +272,429 @@ const We = ({ className: r = "", ...s }) => /* @__PURE__ */ o.jsx(
|
|
|
271
272
|
width: "1em",
|
|
272
273
|
height: "1em",
|
|
273
274
|
fill: "currentColor",
|
|
274
|
-
...
|
|
275
|
-
children: /* @__PURE__ */
|
|
275
|
+
...i,
|
|
276
|
+
children: /* @__PURE__ */ d.jsx("path", { d: "M310.6 361.4c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L160 301.3 54.6 406.6c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L114.7 256 9.4 150.6c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0L160 210.7 265.4 105.4c12.5-12.5 32.8-12.5 45.3 0s12.5 32.8 0 45.3L205.3 256l105.3 105.4z" })
|
|
276
277
|
}
|
|
277
|
-
),
|
|
278
|
+
), mr = ({ className: e = "", ...i }) => /* @__PURE__ */ d.jsx(
|
|
278
279
|
"svg",
|
|
279
280
|
{
|
|
280
|
-
className:
|
|
281
|
+
className: e,
|
|
281
282
|
xmlns: "http://www.w3.org/2000/svg",
|
|
282
283
|
viewBox: "0 0 448 512",
|
|
283
284
|
width: "1em",
|
|
284
285
|
height: "1em",
|
|
285
286
|
fill: "currentColor",
|
|
286
|
-
...
|
|
287
|
-
children: /* @__PURE__ */
|
|
287
|
+
...i,
|
|
288
|
+
children: /* @__PURE__ */ d.jsx("path", { d: "M34.9 289.5l175.9-175.8c9.4-9.4 24.6-9.4 33.9 0L420.1 289.5c15.1 15.1 4.4 41-17 41H51.9c-21.4 0-32.1-25.9-17-41z" })
|
|
288
289
|
}
|
|
289
|
-
),
|
|
290
|
+
), Xe = ({ className: e = "", ...i }) => /* @__PURE__ */ d.jsx(
|
|
290
291
|
"svg",
|
|
291
292
|
{
|
|
292
|
-
className:
|
|
293
|
+
className: e,
|
|
293
294
|
xmlns: "http://www.w3.org/2000/svg",
|
|
294
295
|
viewBox: "0 0 24 24",
|
|
295
296
|
width: "1em",
|
|
296
297
|
height: "1em",
|
|
297
298
|
fill: "currentColor",
|
|
298
|
-
...
|
|
299
|
-
children: /* @__PURE__ */
|
|
299
|
+
...i,
|
|
300
|
+
children: /* @__PURE__ */ d.jsx("path", { d: "M20.285 6.708a1 1 0 0 0-1.414-1.416l-9.192 9.192-4.243-4.244a1 1 0 1 0-1.414 1.416l5 5a1 1 0 0 0 1.414 0l9.849-9.948z" })
|
|
300
301
|
}
|
|
301
|
-
),
|
|
302
|
-
const
|
|
303
|
-
if (typeof
|
|
304
|
-
return
|
|
305
|
-
const
|
|
306
|
-
return
|
|
307
|
-
},
|
|
308
|
-
function
|
|
309
|
-
visibility:
|
|
310
|
-
children:
|
|
302
|
+
), He = (e, i = "invalid-option", a = "") => {
|
|
303
|
+
const o = a ? a.replace(/:/g, "") : "";
|
|
304
|
+
if (typeof e != "string" || !e.trim())
|
|
305
|
+
return o ? `${i}-${o}` : `${i}-${Math.random().toString(36).slice(2, 8)}`;
|
|
306
|
+
const l = e.normalize("NFKD").replace(/[\u0300-\u036f]/g, "").replace(/\s+/g, "-").replace(/[^\p{L}\p{N}-]+/gu, "").toLowerCase();
|
|
307
|
+
return l ? l || `${i}-${Math.random().toString(36).slice(2, 8)}` : o ? `${i}-${o}` : `${i}-${Math.random().toString(36).slice(2, 8)}`;
|
|
308
|
+
}, Ge = Ze(null);
|
|
309
|
+
function Er({
|
|
310
|
+
visibility: e,
|
|
311
|
+
children: i,
|
|
311
312
|
selectRef: a,
|
|
312
|
-
onAnimationDone:
|
|
313
|
-
unmount:
|
|
314
|
-
duration:
|
|
315
|
-
easing:
|
|
316
|
-
offset:
|
|
317
|
-
animateOpacity:
|
|
313
|
+
onAnimationDone: o,
|
|
314
|
+
unmount: l = !0,
|
|
315
|
+
duration: n,
|
|
316
|
+
easing: m,
|
|
317
|
+
offset: y,
|
|
318
|
+
animateOpacity: b,
|
|
319
|
+
style: p,
|
|
320
|
+
className: L
|
|
318
321
|
}) {
|
|
319
|
-
const
|
|
320
|
-
|
|
322
|
+
const j = fe(null), [V, J] = ue(0), [O, P] = ue({ top: 0, left: 0, width: 0 }), R = N(() => {
|
|
323
|
+
if (a?.current) {
|
|
324
|
+
const c = a.current.getBoundingClientRect(), G = window.innerHeight, h = j.current?.scrollHeight || 250, E = G - c.bottom, k = E < h && c.top > E;
|
|
325
|
+
P({
|
|
326
|
+
top: c.top,
|
|
327
|
+
bottom: c.bottom,
|
|
328
|
+
left: c.left,
|
|
329
|
+
width: c.width,
|
|
330
|
+
isUpward: k
|
|
331
|
+
});
|
|
332
|
+
}
|
|
333
|
+
}, [a]);
|
|
334
|
+
re(() => {
|
|
335
|
+
if (e)
|
|
336
|
+
return R(), window.addEventListener("scroll", R, !0), window.addEventListener("resize", R), () => {
|
|
337
|
+
window.removeEventListener("scroll", R, !0), window.removeEventListener("resize", R);
|
|
338
|
+
};
|
|
339
|
+
}, [e, R]);
|
|
340
|
+
const C = `height var(--rac-duration) ${m}${b ? `, opacity var(--rac-duration) ${m}` : ""}`;
|
|
341
|
+
re(() => {
|
|
321
342
|
if (!a?.current) return;
|
|
322
|
-
|
|
323
|
-
const
|
|
324
|
-
for (let
|
|
343
|
+
J(a.current.offsetHeight);
|
|
344
|
+
const G = new ResizeObserver((h) => {
|
|
345
|
+
for (let E of h) J(E.target.offsetHeight);
|
|
325
346
|
});
|
|
326
|
-
return
|
|
347
|
+
return G.observe(a.current), () => G.disconnect();
|
|
327
348
|
}, [a]);
|
|
328
|
-
const
|
|
329
|
-
position: "
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
349
|
+
const T = {
|
|
350
|
+
position: "fixed",
|
|
351
|
+
"--rac-duration": `${n}ms`,
|
|
352
|
+
"--rac-easing": m,
|
|
353
|
+
left: `${O.left}px`,
|
|
354
|
+
width: `${O.width}px`,
|
|
333
355
|
overflow: "hidden",
|
|
334
|
-
marginTop: "2px",
|
|
335
356
|
zIndex: "1",
|
|
336
|
-
height:
|
|
337
|
-
opacity:
|
|
338
|
-
pointerEvents:
|
|
339
|
-
visibility:
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
},
|
|
356
|
-
const
|
|
357
|
-
|
|
357
|
+
height: e ? "auto" : "0px",
|
|
358
|
+
opacity: b ? e ? 1 : 0 : 1,
|
|
359
|
+
pointerEvents: e ? "all" : "none",
|
|
360
|
+
visibility: V ? "visible" : "hidden",
|
|
361
|
+
boxSizing: "border-box",
|
|
362
|
+
transformOrigin: O.isUpward ? "bottom" : "top",
|
|
363
|
+
...O.isUpward ? {
|
|
364
|
+
bottom: `${window.innerHeight - O.top + y}px`,
|
|
365
|
+
top: "auto"
|
|
366
|
+
} : {
|
|
367
|
+
top: `${O.bottom + y}px`,
|
|
368
|
+
bottom: "auto"
|
|
369
|
+
},
|
|
370
|
+
...Object.fromEntries(
|
|
371
|
+
Object.entries(p || {}).map(([c, G]) => [
|
|
372
|
+
c.startsWith("--") ? c : `--rac-${c.replace(/([A-Z])/g, "-$1").toLowerCase()}`,
|
|
373
|
+
G
|
|
374
|
+
])
|
|
375
|
+
)
|
|
376
|
+
}, z = N(() => {
|
|
377
|
+
const c = j.current;
|
|
378
|
+
c && (c.style.height = "0px", b && (c.style.opacity = "0"), c.style.transition = "");
|
|
379
|
+
}, [b]), U = N(() => {
|
|
380
|
+
const c = j.current;
|
|
381
|
+
c && (c.style.transition = C, c.style.height = `${c.scrollHeight}px`, b && (c.style.opacity = "1"));
|
|
382
|
+
}, [C, b]), Q = N(() => {
|
|
383
|
+
const c = j.current;
|
|
384
|
+
c && (c.style.height = "auto", c.style.transition = "", o && o());
|
|
385
|
+
}, [o]), X = N(() => {
|
|
386
|
+
const c = j.current;
|
|
387
|
+
c && (c.style.height = `${c.scrollHeight}px`, b && (c.style.opacity = "1"), c.offsetHeight, c.style.transition = C);
|
|
388
|
+
}, [C, b]), te = N(() => {
|
|
389
|
+
const c = j.current;
|
|
390
|
+
c && (c.style.height = "0px", b && (c.style.opacity = "0"));
|
|
391
|
+
}, [b]), ne = N(() => {
|
|
392
|
+
const c = j.current;
|
|
393
|
+
c && (c.style.transition = "");
|
|
358
394
|
}, []);
|
|
359
|
-
return
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
395
|
+
return hr(
|
|
396
|
+
/* @__PURE__ */ d.jsx(
|
|
397
|
+
Te,
|
|
398
|
+
{
|
|
399
|
+
in: e,
|
|
400
|
+
timeout: n,
|
|
401
|
+
classNames: "rac-options",
|
|
402
|
+
unmountOnExit: l,
|
|
403
|
+
nodeRef: j,
|
|
404
|
+
onEnter: z,
|
|
405
|
+
onEntering: U,
|
|
406
|
+
onEntered: Q,
|
|
407
|
+
onExit: X,
|
|
408
|
+
onExiting: te,
|
|
409
|
+
onExited: ne,
|
|
410
|
+
children: /* @__PURE__ */ d.jsx(
|
|
411
|
+
"div",
|
|
412
|
+
{
|
|
413
|
+
ref: j,
|
|
414
|
+
className: `rac-options ${L || ""}`,
|
|
415
|
+
style: {
|
|
416
|
+
...T,
|
|
417
|
+
"--rac-duration": `${n}ms`,
|
|
418
|
+
"--rac-duration-fast": "calc(var(--rac-duration) * 0.5)",
|
|
419
|
+
"--rac-duration-base": "var(--rac-duration)",
|
|
420
|
+
"--rac-duration-slow": "calc(var(--rac-duration) * 1.3)"
|
|
421
|
+
},
|
|
422
|
+
onMouseDown: (c) => {
|
|
423
|
+
c.preventDefault();
|
|
424
|
+
},
|
|
425
|
+
children: i
|
|
426
|
+
}
|
|
427
|
+
)
|
|
428
|
+
}
|
|
429
|
+
),
|
|
430
|
+
document.body
|
|
383
431
|
);
|
|
384
432
|
}
|
|
385
|
-
const
|
|
433
|
+
const vr = Fe(Er, (e, i) => e.visibility === i.visibility && e.duration === i.duration && e.easing === i.easing && e.offset === i.offset && e.animateOpacity === i.animateOpacity && e.selectRef === i.selectRef && e.children === i.children && JSON.stringify(e.style) === JSON.stringify(i.style));
|
|
386
434
|
function Re({
|
|
387
|
-
visibility:
|
|
388
|
-
children:
|
|
435
|
+
visibility: e,
|
|
436
|
+
children: i,
|
|
389
437
|
duration: a = 300,
|
|
390
|
-
unmount:
|
|
391
|
-
style:
|
|
438
|
+
unmount: o,
|
|
439
|
+
style: l
|
|
392
440
|
}) {
|
|
393
|
-
const
|
|
394
|
-
return /* @__PURE__ */
|
|
395
|
-
|
|
441
|
+
const n = fe(null);
|
|
442
|
+
return /* @__PURE__ */ d.jsx(
|
|
443
|
+
Te,
|
|
396
444
|
{
|
|
397
|
-
in:
|
|
445
|
+
in: e,
|
|
398
446
|
timeout: a,
|
|
399
447
|
classNames: "rac-slide-left",
|
|
400
448
|
unmountOnExit: !0,
|
|
401
|
-
nodeRef:
|
|
402
|
-
onEnter: () =>
|
|
403
|
-
onEntering: () =>
|
|
404
|
-
onEntered: () =>
|
|
405
|
-
onExit: () =>
|
|
406
|
-
onExiting: () =>
|
|
407
|
-
onExited: () =>
|
|
408
|
-
children: /* @__PURE__ */
|
|
449
|
+
nodeRef: n,
|
|
450
|
+
onEnter: () => n.current.style.width = "0px",
|
|
451
|
+
onEntering: () => n.current.style.width = n.current.scrollWidth + "px",
|
|
452
|
+
onEntered: () => n.current.style.width = "auto",
|
|
453
|
+
onExit: () => n.current.style.width = n.current.scrollWidth + "px",
|
|
454
|
+
onExiting: () => n.current.style.width = "0px",
|
|
455
|
+
onExited: () => o?.(),
|
|
456
|
+
children: /* @__PURE__ */ d.jsx(
|
|
409
457
|
"div",
|
|
410
458
|
{
|
|
411
|
-
ref:
|
|
459
|
+
ref: n,
|
|
412
460
|
style: {
|
|
413
|
-
...
|
|
461
|
+
...l,
|
|
414
462
|
overflow: "hidden",
|
|
415
463
|
transition: `width ${a}ms ease`
|
|
416
464
|
},
|
|
417
|
-
children:
|
|
465
|
+
children: i
|
|
418
466
|
}
|
|
419
467
|
)
|
|
420
468
|
}
|
|
421
469
|
);
|
|
422
470
|
}
|
|
423
|
-
const
|
|
424
|
-
const
|
|
425
|
-
return /* @__PURE__ */
|
|
426
|
-
|
|
471
|
+
const Ke = ({ children: e, duration: i, widthMode: a = !1, ...o }) => {
|
|
472
|
+
const l = fe(null);
|
|
473
|
+
return /* @__PURE__ */ d.jsx(
|
|
474
|
+
Te,
|
|
427
475
|
{
|
|
428
|
-
nodeRef:
|
|
429
|
-
timeout:
|
|
476
|
+
nodeRef: l,
|
|
477
|
+
timeout: i,
|
|
430
478
|
classNames: "rac-slide-left",
|
|
431
|
-
...
|
|
479
|
+
...o,
|
|
432
480
|
onEnter: () => {
|
|
433
|
-
n
|
|
481
|
+
const n = l.current;
|
|
482
|
+
a ? n.style.width = "0px" : (n.style.height = "0px", n.style.transform = "translateY(-10px)"), n.style.opacity = "0";
|
|
434
483
|
},
|
|
435
484
|
onEntering: () => {
|
|
436
|
-
n
|
|
485
|
+
const n = l.current;
|
|
486
|
+
n.offsetHeight, a ? n.style.width = n.scrollWidth + "px" : (n.style.height = n.scrollHeight + "px", n.style.transform = "translateY(0)"), n.style.opacity = "1";
|
|
437
487
|
},
|
|
438
488
|
onEntered: () => {
|
|
439
|
-
n
|
|
489
|
+
const n = l.current;
|
|
490
|
+
n.style.width = a ? "auto" : "", n.style.height = a ? "" : "auto", n.style.opacity = "1", n.style.transform = "";
|
|
440
491
|
},
|
|
441
492
|
onExit: () => {
|
|
442
|
-
n
|
|
493
|
+
const n = l.current;
|
|
494
|
+
a ? n.style.width = n.offsetWidth + "px" : (n.style.height = n.offsetHeight + "px", n.style.position = "absolute"), n.style.opacity = "1";
|
|
443
495
|
},
|
|
444
496
|
onExiting: () => {
|
|
445
|
-
|
|
497
|
+
const n = l.current;
|
|
498
|
+
a ? n.style.width = "0px" : (n.style.height = "0px", n.style.transform = "translateY(10px)"), n.style.opacity = "0";
|
|
446
499
|
},
|
|
447
|
-
children: /* @__PURE__ */
|
|
500
|
+
children: /* @__PURE__ */ d.jsx(
|
|
448
501
|
"div",
|
|
449
502
|
{
|
|
450
|
-
ref:
|
|
503
|
+
ref: l,
|
|
451
504
|
style: {
|
|
452
505
|
display: "flex",
|
|
453
506
|
alignItems: "center",
|
|
454
507
|
height: "100%",
|
|
455
508
|
overflow: "hidden",
|
|
456
509
|
whiteSpace: "nowrap",
|
|
457
|
-
transition: `all ${
|
|
510
|
+
transition: `all ${i}ms ease`,
|
|
511
|
+
top: 0,
|
|
512
|
+
left: 0
|
|
458
513
|
},
|
|
459
|
-
children:
|
|
514
|
+
children: e
|
|
460
515
|
}
|
|
461
516
|
)
|
|
462
517
|
}
|
|
463
518
|
);
|
|
464
|
-
},
|
|
465
|
-
let
|
|
466
|
-
if (
|
|
467
|
-
|
|
468
|
-
else if (
|
|
469
|
-
|
|
470
|
-
else if (
|
|
471
|
-
const
|
|
472
|
-
(
|
|
519
|
+
}, wr = Fe(({ element: e, index: i, remove: a, renderIcon: o, DelIcon: l, normalizedOptions: n }) => {
|
|
520
|
+
let m = null;
|
|
521
|
+
if (e?.jsx)
|
|
522
|
+
m = e.jsx;
|
|
523
|
+
else if (e?.name)
|
|
524
|
+
m = e.name;
|
|
525
|
+
else if (e?.raw !== void 0) {
|
|
526
|
+
const p = n.find(
|
|
527
|
+
(L) => L.raw === e.raw || L.original === e.raw || L.userId === e.raw
|
|
473
528
|
);
|
|
474
|
-
|
|
529
|
+
p && (m = p.jsx ?? p.name);
|
|
475
530
|
}
|
|
476
|
-
|
|
477
|
-
const
|
|
478
|
-
|
|
479
|
-
}, [
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
531
|
+
m == null && (m = typeof e == "object" ? e.label ?? e.name ?? e.value ?? "Selected item" : String(e));
|
|
532
|
+
const y = N((p) => {
|
|
533
|
+
p.stopPropagation(), p.preventDefault(), a(e.id);
|
|
534
|
+
}, [e.id, a]), b = N((p) => {
|
|
535
|
+
p.stopPropagation(), p.preventDefault();
|
|
536
|
+
}, []);
|
|
537
|
+
return /* @__PURE__ */ d.jsxs("div", { className: "rac-multiple-selected-option", children: [
|
|
538
|
+
m,
|
|
539
|
+
o(l, { onClick: y, onMouseDown: b })
|
|
483
540
|
] });
|
|
484
|
-
}),
|
|
485
|
-
selectRef:
|
|
486
|
-
selectId:
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
541
|
+
}), jr = Fe(({
|
|
542
|
+
selectRef: e,
|
|
543
|
+
selectId: i,
|
|
544
|
+
removeOption: a,
|
|
545
|
+
renderOptions: o,
|
|
546
|
+
selected: l,
|
|
547
|
+
selectedIDs: n,
|
|
548
|
+
setSelectedIds: m,
|
|
549
|
+
normalizedOptions: y,
|
|
550
|
+
title: b,
|
|
551
|
+
visibility: p,
|
|
552
|
+
active: L,
|
|
553
|
+
hasOptions: j,
|
|
554
|
+
hasActualValue: V,
|
|
555
|
+
optionsClassName: J,
|
|
556
|
+
selectedText: O,
|
|
557
|
+
disabled: P,
|
|
558
|
+
loading: R,
|
|
559
|
+
error: C,
|
|
560
|
+
registerOption: T,
|
|
561
|
+
unregisterOption: z,
|
|
562
|
+
handleBlur: U,
|
|
563
|
+
handleFocus: Q,
|
|
564
|
+
handleToggle: X,
|
|
565
|
+
handleKeyDown: te,
|
|
566
|
+
handleListScroll: ne,
|
|
567
|
+
setAnimationFinished: c,
|
|
568
|
+
clear: G,
|
|
569
|
+
children: h,
|
|
570
|
+
placeholder: E,
|
|
571
|
+
className: k,
|
|
572
|
+
style: Y,
|
|
573
|
+
duration: S,
|
|
574
|
+
easing: H,
|
|
575
|
+
offset: ge,
|
|
576
|
+
animateOpacity: K,
|
|
577
|
+
unmount: le,
|
|
578
|
+
ArrowIcon: ie,
|
|
579
|
+
ClearIcon: r,
|
|
580
|
+
DelIcon: g,
|
|
581
|
+
renderIcon: w,
|
|
582
|
+
hasMore: A,
|
|
583
|
+
loadButton: B
|
|
525
584
|
}) => {
|
|
526
|
-
const
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
585
|
+
const Z = fe(null);
|
|
586
|
+
re(() => {
|
|
587
|
+
e && (typeof e == "function" ? e(Z.current) : e.current = Z.current);
|
|
588
|
+
}, [e]);
|
|
589
|
+
const t = N((s) => {
|
|
590
|
+
a ? a(s) : m((x) => x.filter((_) => _.id !== s));
|
|
591
|
+
}, [a, m]), f = n?.map((s, x) => /* @__PURE__ */ d.jsx(
|
|
592
|
+
Ke,
|
|
530
593
|
{
|
|
531
|
-
duration:
|
|
532
|
-
|
|
533
|
-
|
|
594
|
+
duration: S,
|
|
595
|
+
widthMode: !0,
|
|
596
|
+
children: /* @__PURE__ */ d.jsx(
|
|
597
|
+
wr,
|
|
534
598
|
{
|
|
535
|
-
element:
|
|
536
|
-
index:
|
|
537
|
-
remove:
|
|
538
|
-
renderIcon:
|
|
539
|
-
DelIcon:
|
|
540
|
-
normalizedOptions:
|
|
599
|
+
element: s,
|
|
600
|
+
index: x,
|
|
601
|
+
remove: t,
|
|
602
|
+
renderIcon: w,
|
|
603
|
+
DelIcon: g,
|
|
604
|
+
normalizedOptions: y
|
|
541
605
|
},
|
|
542
|
-
|
|
606
|
+
s.id ?? x
|
|
543
607
|
)
|
|
544
608
|
},
|
|
545
|
-
|
|
609
|
+
s.id ?? x
|
|
546
610
|
));
|
|
547
|
-
return /* @__PURE__ */
|
|
548
|
-
|
|
611
|
+
return /* @__PURE__ */ d.jsxs(
|
|
612
|
+
Ge.Provider,
|
|
549
613
|
{
|
|
550
|
-
value: { registerOption:
|
|
614
|
+
value: { registerOption: T, unregisterOption: z },
|
|
551
615
|
children: [
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
/* @__PURE__ */ o.jsxs(
|
|
616
|
+
h,
|
|
617
|
+
/* @__PURE__ */ d.jsxs(
|
|
555
618
|
"div",
|
|
556
619
|
{
|
|
557
|
-
ref:
|
|
558
|
-
style: {
|
|
620
|
+
ref: Z,
|
|
621
|
+
style: {
|
|
622
|
+
...Y,
|
|
623
|
+
"--rac-duration": `${S}ms`,
|
|
624
|
+
"--rac-duration-fast": "calc(var(--rac-duration) * 0.5)",
|
|
625
|
+
"--rac-duration-base": "var(--rac-duration)",
|
|
626
|
+
"--rac-duration-slow": "calc(var(--rac-duration) * 1.3)"
|
|
627
|
+
},
|
|
559
628
|
className: `rac-select
|
|
560
|
-
${
|
|
561
|
-
${!
|
|
562
|
-
${
|
|
563
|
-
${
|
|
564
|
-
tabIndex:
|
|
629
|
+
${k}
|
|
630
|
+
${!j || P ? "rac-disabled-style" : ""}
|
|
631
|
+
${R ? "rac-loading-style" : ""}
|
|
632
|
+
${C ? "rac-error-style" : ""}`,
|
|
633
|
+
tabIndex: L ? 0 : -1,
|
|
565
634
|
role: "combobox",
|
|
566
635
|
"aria-haspopup": "listbox",
|
|
567
|
-
"aria-expanded":
|
|
568
|
-
"aria-controls": `${
|
|
569
|
-
"aria-label":
|
|
570
|
-
"aria-disabled":
|
|
571
|
-
...
|
|
572
|
-
onBlur:
|
|
573
|
-
onFocus:
|
|
574
|
-
onClick:
|
|
575
|
-
onKeyDown:
|
|
636
|
+
"aria-expanded": p,
|
|
637
|
+
"aria-controls": `${i}-listbox`,
|
|
638
|
+
"aria-label": E,
|
|
639
|
+
"aria-disabled": P || !j,
|
|
640
|
+
...L && {
|
|
641
|
+
onBlur: U,
|
|
642
|
+
onFocus: Q,
|
|
643
|
+
onClick: X,
|
|
644
|
+
onKeyDown: te
|
|
576
645
|
},
|
|
577
646
|
children: [
|
|
578
|
-
/* @__PURE__ */
|
|
647
|
+
/* @__PURE__ */ d.jsx(
|
|
579
648
|
"div",
|
|
580
649
|
{
|
|
581
650
|
className: `rac-select-title
|
|
582
|
-
${!
|
|
651
|
+
${!C && !R && l?.type === "boolean" ? l.raw ? "rac-true-option" : "rac-false-option" : ""}
|
|
583
652
|
`,
|
|
584
|
-
children: /* @__PURE__ */
|
|
585
|
-
|
|
653
|
+
children: /* @__PURE__ */ d.jsx(pr, { component: null, children: n?.length && !O ? f : /* @__PURE__ */ d.jsxs(
|
|
654
|
+
Ke,
|
|
586
655
|
{
|
|
587
|
-
duration:
|
|
656
|
+
duration: S,
|
|
657
|
+
widthMode: !0,
|
|
588
658
|
children: [
|
|
589
|
-
/* @__PURE__ */
|
|
590
|
-
/* @__PURE__ */
|
|
591
|
-
/* @__PURE__ */
|
|
592
|
-
/* @__PURE__ */
|
|
593
|
-
/* @__PURE__ */
|
|
659
|
+
/* @__PURE__ */ d.jsx("span", { className: "rac-title-text", children: b }),
|
|
660
|
+
/* @__PURE__ */ d.jsx(Re, { visibility: R && !C, duration: S, children: /* @__PURE__ */ d.jsxs("span", { className: "rac-loading-dots", children: [
|
|
661
|
+
/* @__PURE__ */ d.jsx("i", {}),
|
|
662
|
+
/* @__PURE__ */ d.jsx("i", {}),
|
|
663
|
+
/* @__PURE__ */ d.jsx("i", {})
|
|
594
664
|
] }) })
|
|
595
665
|
]
|
|
596
666
|
},
|
|
597
|
-
|
|
667
|
+
b
|
|
598
668
|
) })
|
|
599
669
|
}
|
|
600
670
|
),
|
|
601
|
-
/* @__PURE__ */
|
|
602
|
-
/* @__PURE__ */
|
|
671
|
+
/* @__PURE__ */ d.jsxs("div", { className: "rac-select-buttons", children: [
|
|
672
|
+
/* @__PURE__ */ d.jsx(
|
|
603
673
|
Re,
|
|
604
674
|
{
|
|
605
|
-
visibility:
|
|
606
|
-
duration:
|
|
675
|
+
visibility: V && j && !P && !R && !C,
|
|
676
|
+
duration: S,
|
|
607
677
|
style: { display: "grid" },
|
|
608
|
-
children:
|
|
678
|
+
children: w(r, {
|
|
609
679
|
className: "rac-select-cancel",
|
|
610
|
-
onMouseDown: (
|
|
611
|
-
|
|
680
|
+
onMouseDown: (s) => {
|
|
681
|
+
s.preventDefault(), s.stopPropagation();
|
|
612
682
|
},
|
|
613
|
-
onClick:
|
|
683
|
+
onClick: G
|
|
614
684
|
})
|
|
615
685
|
}
|
|
616
686
|
),
|
|
617
|
-
/* @__PURE__ */
|
|
687
|
+
/* @__PURE__ */ d.jsx(
|
|
618
688
|
Re,
|
|
619
689
|
{
|
|
620
|
-
visibility:
|
|
621
|
-
duration:
|
|
690
|
+
visibility: L,
|
|
691
|
+
duration: S,
|
|
622
692
|
style: { display: "grid" },
|
|
623
|
-
children: /* @__PURE__ */
|
|
693
|
+
children: /* @__PURE__ */ d.jsx(
|
|
624
694
|
"span",
|
|
625
695
|
{
|
|
626
|
-
className: `rac-select-arrow-wrapper ${
|
|
627
|
-
children:
|
|
696
|
+
className: `rac-select-arrow-wrapper ${p ? "--open" : ""}`,
|
|
697
|
+
children: w(ie, {
|
|
628
698
|
className: "rac-select-arrow-wrapper"
|
|
629
699
|
})
|
|
630
700
|
}
|
|
@@ -632,38 +702,43 @@ const Ue = ({ children: r, duration: s, ...a }) => {
|
|
|
632
702
|
}
|
|
633
703
|
)
|
|
634
704
|
] }),
|
|
635
|
-
/* @__PURE__ */
|
|
636
|
-
|
|
705
|
+
/* @__PURE__ */ d.jsx(
|
|
706
|
+
vr,
|
|
637
707
|
{
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
708
|
+
className: J,
|
|
709
|
+
visibility: p,
|
|
710
|
+
selectRef: e,
|
|
711
|
+
onAnimationDone: () => c(!0),
|
|
712
|
+
unmount: le,
|
|
713
|
+
duration: S,
|
|
714
|
+
easing: H,
|
|
715
|
+
offset: ge,
|
|
716
|
+
animateOpacity: K,
|
|
717
|
+
style: {
|
|
718
|
+
...Y,
|
|
719
|
+
"--rac-duration": `${S}ms`
|
|
720
|
+
},
|
|
721
|
+
children: /* @__PURE__ */ d.jsxs(
|
|
647
722
|
"div",
|
|
648
723
|
{
|
|
649
|
-
onScroll:
|
|
724
|
+
onScroll: ne,
|
|
650
725
|
tabIndex: "-1",
|
|
651
726
|
className: "rac-select-list",
|
|
652
727
|
role: "listbox",
|
|
653
728
|
"aria-label": "Options",
|
|
654
729
|
children: [
|
|
655
|
-
|
|
656
|
-
!
|
|
730
|
+
o,
|
|
731
|
+
!B && A && /* @__PURE__ */ d.jsxs(
|
|
657
732
|
"div",
|
|
658
733
|
{
|
|
659
734
|
className: "rac-select-option rac-disabled-option rac-loading-option",
|
|
660
|
-
onClick: (
|
|
735
|
+
onClick: (s) => s.stopPropagation(),
|
|
661
736
|
children: [
|
|
662
|
-
/* @__PURE__ */
|
|
663
|
-
/* @__PURE__ */
|
|
664
|
-
/* @__PURE__ */
|
|
665
|
-
/* @__PURE__ */
|
|
666
|
-
/* @__PURE__ */
|
|
737
|
+
/* @__PURE__ */ d.jsx("span", { className: "rac-loading-option-title", children: "Loading" }),
|
|
738
|
+
/* @__PURE__ */ d.jsxs("span", { className: "rac-loading-dots", children: [
|
|
739
|
+
/* @__PURE__ */ d.jsx("i", {}),
|
|
740
|
+
/* @__PURE__ */ d.jsx("i", {}),
|
|
741
|
+
/* @__PURE__ */ d.jsx("i", {})
|
|
667
742
|
] })
|
|
668
743
|
]
|
|
669
744
|
}
|
|
@@ -680,359 +755,407 @@ const Ue = ({ children: r, duration: s, ...a }) => {
|
|
|
680
755
|
}
|
|
681
756
|
);
|
|
682
757
|
});
|
|
683
|
-
function
|
|
684
|
-
disabled:
|
|
685
|
-
open:
|
|
758
|
+
function Sr({
|
|
759
|
+
disabled: e,
|
|
760
|
+
open: i,
|
|
686
761
|
setOpen: a,
|
|
687
|
-
options:
|
|
688
|
-
selectOption:
|
|
689
|
-
selected:
|
|
690
|
-
multiple:
|
|
691
|
-
hasMore:
|
|
692
|
-
loadMore:
|
|
762
|
+
options: o = [],
|
|
763
|
+
selectOption: l,
|
|
764
|
+
selected: n,
|
|
765
|
+
multiple: m,
|
|
766
|
+
hasMore: y,
|
|
767
|
+
loadMore: b,
|
|
693
768
|
loadButton: p,
|
|
694
|
-
loadButtonText:
|
|
695
|
-
setLoadingTitle:
|
|
696
|
-
loadOffset:
|
|
697
|
-
loadAhead:
|
|
698
|
-
expandedGroups:
|
|
769
|
+
loadButtonText: L,
|
|
770
|
+
setLoadingTitle: j,
|
|
771
|
+
loadOffset: V,
|
|
772
|
+
loadAhead: J,
|
|
773
|
+
expandedGroups: O
|
|
699
774
|
}) {
|
|
700
|
-
const
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
}, [
|
|
704
|
-
const
|
|
705
|
-
!
|
|
706
|
-
}, [
|
|
707
|
-
if (p || !
|
|
708
|
-
const { scrollTop:
|
|
709
|
-
|
|
710
|
-
}, [p,
|
|
711
|
-
|
|
712
|
-
!p &&
|
|
713
|
-
}, [
|
|
714
|
-
const
|
|
715
|
-
|
|
775
|
+
const P = fe(!1), R = fe(0), C = fe(!1), [T, z] = ue(-1);
|
|
776
|
+
re(() => {
|
|
777
|
+
C.current = !1, p && j(L);
|
|
778
|
+
}, [o.length, y, p, L, j]);
|
|
779
|
+
const U = N(() => {
|
|
780
|
+
!y || C.current || (C.current = !0, b());
|
|
781
|
+
}, [y, b]), Q = N((h) => {
|
|
782
|
+
if (p || !y || C.current) return;
|
|
783
|
+
const { scrollTop: E, scrollHeight: k, clientHeight: Y } = h.currentTarget;
|
|
784
|
+
k - E <= Y + V && U();
|
|
785
|
+
}, [p, y, V, U]);
|
|
786
|
+
re(() => {
|
|
787
|
+
!p && i && y && T >= o.length - J && U();
|
|
788
|
+
}, [T, i, y, o.length, J, p, U]), re(() => {
|
|
789
|
+
const h = () => {
|
|
790
|
+
R.current = Date.now();
|
|
716
791
|
};
|
|
717
|
-
return window.addEventListener("focus",
|
|
718
|
-
}, []),
|
|
719
|
-
if (!
|
|
720
|
-
|
|
792
|
+
return window.addEventListener("focus", h), () => window.removeEventListener("focus", h);
|
|
793
|
+
}, []), re(() => {
|
|
794
|
+
if (!i) {
|
|
795
|
+
z(-1);
|
|
721
796
|
return;
|
|
722
797
|
}
|
|
723
|
-
if (
|
|
798
|
+
if (T >= 0 && T < o.length && !(!o[T] || o[T].hidden || o[T].groupHeader))
|
|
724
799
|
return;
|
|
725
|
-
let
|
|
726
|
-
if (
|
|
727
|
-
const
|
|
728
|
-
|
|
800
|
+
let h = -1;
|
|
801
|
+
if (n) {
|
|
802
|
+
const E = m ? n[0] : n;
|
|
803
|
+
E && (h = o.findIndex((k) => k.id === E.id && !k.disabled && !k.hidden && !k.groupHeader));
|
|
729
804
|
}
|
|
730
|
-
|
|
731
|
-
}, [
|
|
732
|
-
const
|
|
733
|
-
const
|
|
734
|
-
if (
|
|
735
|
-
let
|
|
736
|
-
for (let
|
|
737
|
-
if (
|
|
738
|
-
return
|
|
739
|
-
if (
|
|
805
|
+
h === -1 && (h = o.findIndex((E) => !E.disabled && !E.hidden && !E.groupHeader)), z(h);
|
|
806
|
+
}, [i, o, n]);
|
|
807
|
+
const X = N((h, E) => {
|
|
808
|
+
const k = (H) => H && !H?.groupHeader && (!H?.group || O?.has(H?.group)) && !H?.disabled && !H?.loading, Y = o.length;
|
|
809
|
+
if (Y === 0) return -1;
|
|
810
|
+
let S = h;
|
|
811
|
+
for (let H = 0; H < Y; H++) {
|
|
812
|
+
if (S = (S + E + Y) % Y, !p && y && (E > 0 && S === 0 || E < 0 && S === Y - 1))
|
|
813
|
+
return h;
|
|
814
|
+
if (k(o[S])) return S;
|
|
740
815
|
}
|
|
741
|
-
return
|
|
742
|
-
}, [
|
|
743
|
-
|
|
816
|
+
return h;
|
|
817
|
+
}, [o, y, p, O]), te = N((h) => {
|
|
818
|
+
const E = h.relatedTarget?.closest(".rac-options");
|
|
819
|
+
!h.currentTarget.contains(h.relatedTarget) && !E && a(!1);
|
|
744
820
|
}, [a]), ne = N(() => {
|
|
745
|
-
|
|
746
|
-
|
|
821
|
+
e || document.hidden || Date.now() - R.current < 100 || i || (a(!0), P.current = !0, setTimeout(() => {
|
|
822
|
+
P.current = !1;
|
|
747
823
|
}, 200));
|
|
748
|
-
}, [
|
|
749
|
-
|
|
750
|
-
}, [
|
|
751
|
-
if (!
|
|
752
|
-
switch (
|
|
824
|
+
}, [e, i, a]), c = N((h) => {
|
|
825
|
+
e || h.target.closest(".rac-select-cancel") || P.current || a(!i);
|
|
826
|
+
}, [e, i, a]), G = N((h) => {
|
|
827
|
+
if (!e)
|
|
828
|
+
switch (h.key) {
|
|
753
829
|
case "Enter":
|
|
754
830
|
case " ":
|
|
755
|
-
|
|
831
|
+
h.preventDefault(), i ? T !== -1 && o[T] && l(o[T], h) : a(!0);
|
|
756
832
|
break;
|
|
757
833
|
case "Escape":
|
|
758
|
-
|
|
834
|
+
h.preventDefault(), a(!1);
|
|
759
835
|
break;
|
|
760
836
|
case "ArrowDown":
|
|
761
|
-
|
|
837
|
+
h.preventDefault(), i ? z((E) => X(E, 1)) : a(!0);
|
|
762
838
|
break;
|
|
763
839
|
case "ArrowUp":
|
|
764
|
-
|
|
840
|
+
h.preventDefault(), i ? z((E) => X(E, -1)) : a(!0);
|
|
765
841
|
break;
|
|
766
842
|
case "Tab":
|
|
767
|
-
|
|
843
|
+
i && a(!1);
|
|
768
844
|
break;
|
|
769
845
|
}
|
|
770
|
-
}, [
|
|
771
|
-
return
|
|
772
|
-
handleBlur:
|
|
846
|
+
}, [e, i, a, T, o, l, X]);
|
|
847
|
+
return de(() => ({
|
|
848
|
+
handleBlur: te,
|
|
773
849
|
handleFocus: ne,
|
|
774
|
-
handleToggle:
|
|
775
|
-
handleKeyDown:
|
|
776
|
-
highlightedIndex:
|
|
777
|
-
setHighlightedIndex:
|
|
778
|
-
handleListScroll:
|
|
779
|
-
}), [
|
|
850
|
+
handleToggle: c,
|
|
851
|
+
handleKeyDown: G,
|
|
852
|
+
highlightedIndex: T,
|
|
853
|
+
setHighlightedIndex: z,
|
|
854
|
+
handleListScroll: Q
|
|
855
|
+
}), [te, ne, c, G, T, Q]);
|
|
780
856
|
}
|
|
781
|
-
const
|
|
782
|
-
if (
|
|
783
|
-
const a =
|
|
784
|
-
if (a) return String(
|
|
785
|
-
const
|
|
786
|
-
return
|
|
857
|
+
const _r = ["group", "disabled", "options", "items", "children"], Ie = ["name", "label", "id", "value"], Ne = (e, i = !1) => {
|
|
858
|
+
if (i && typeof e.group == "string") return e.group;
|
|
859
|
+
const a = Ie.find((l) => e[l] != null && e[l] !== "");
|
|
860
|
+
if (a) return String(e[a]);
|
|
861
|
+
const o = Object.entries(e).find(([l, n]) => !_r.includes(l) && n != null && n !== "");
|
|
862
|
+
return o ? String(o[1]) : null;
|
|
787
863
|
};
|
|
788
|
-
function
|
|
789
|
-
options:
|
|
790
|
-
jsxOptions:
|
|
864
|
+
function $r({
|
|
865
|
+
options: e = [],
|
|
866
|
+
jsxOptions: i = [],
|
|
791
867
|
value: a,
|
|
792
|
-
defaultValue:
|
|
793
|
-
onChange:
|
|
794
|
-
disabled:
|
|
795
|
-
loading:
|
|
796
|
-
error:
|
|
797
|
-
multiple:
|
|
868
|
+
defaultValue: o,
|
|
869
|
+
onChange: l,
|
|
870
|
+
disabled: n = !1,
|
|
871
|
+
loading: m = !1,
|
|
872
|
+
error: y = !1,
|
|
873
|
+
multiple: b = !1,
|
|
798
874
|
placeholder: p = "Choose option",
|
|
799
|
-
emptyText:
|
|
800
|
-
disabledText:
|
|
801
|
-
loadingText:
|
|
802
|
-
errorText:
|
|
803
|
-
disabledOption:
|
|
804
|
-
emptyOption:
|
|
805
|
-
invalidOption:
|
|
806
|
-
setVisibility:
|
|
807
|
-
hasMore:
|
|
808
|
-
loadButton:
|
|
809
|
-
setLoadingTitle:
|
|
810
|
-
loadingTitle:
|
|
811
|
-
loadMoreText:
|
|
812
|
-
loadMore:
|
|
875
|
+
emptyText: L = "No options",
|
|
876
|
+
disabledText: j = "Disabled",
|
|
877
|
+
loadingText: V = "Loading",
|
|
878
|
+
errorText: J = "Failed to load",
|
|
879
|
+
disabledOption: O = "Disabled option",
|
|
880
|
+
emptyOption: P = "Empty option",
|
|
881
|
+
invalidOption: R = "Invalid option",
|
|
882
|
+
setVisibility: C,
|
|
883
|
+
hasMore: T,
|
|
884
|
+
loadButton: z,
|
|
885
|
+
setLoadingTitle: U,
|
|
886
|
+
loadingTitle: Q,
|
|
887
|
+
loadMoreText: X,
|
|
888
|
+
loadMore: te,
|
|
813
889
|
childrenFirst: ne,
|
|
814
|
-
groupsClosed:
|
|
890
|
+
groupsClosed: c
|
|
815
891
|
}) {
|
|
816
|
-
const
|
|
817
|
-
|
|
818
|
-
const
|
|
819
|
-
return
|
|
892
|
+
const G = ze(), h = a !== void 0, [E, k] = ue(null), [Y, S] = ue([]), [H, ge] = ue(/* @__PURE__ */ new Set()), K = fe(null), le = N((t) => {
|
|
893
|
+
ge((f) => {
|
|
894
|
+
const s = new Set(f);
|
|
895
|
+
return s.has(t) ? s.delete(t) : s.add(t), s;
|
|
820
896
|
});
|
|
821
|
-
}, []), ie = N((t,
|
|
822
|
-
const
|
|
897
|
+
}, []), ie = N((t, f, s = "n", x = null, _ = !1) => {
|
|
898
|
+
const ee = `${G}-${s}-${f}`;
|
|
823
899
|
if (t == null || t === "")
|
|
824
|
-
return { id:
|
|
900
|
+
return { id: ee, userId: null, name: P, raw: null, disabled: !0, type: "normal", group: x, groupDisabled: _ };
|
|
825
901
|
if (typeof t == "function")
|
|
826
|
-
return { id:
|
|
902
|
+
return { id: ee, userId: null, name: R, raw: t, disabled: !0, invalid: !0, type: "normal", group: x };
|
|
827
903
|
if (typeof t == "object" && !Array.isArray(t)) {
|
|
828
|
-
const
|
|
829
|
-
let
|
|
904
|
+
const he = x || t.group || null, se = _ || t.disabled === !0, ye = t.id ?? t.value ?? t.name ?? t.label, D = t.value !== void 0 ? t.value : t.id !== void 0 ? t.id : t;
|
|
905
|
+
let u = Ne(t) || (se ? O : P);
|
|
830
906
|
return {
|
|
831
|
-
id:
|
|
832
|
-
userId:
|
|
833
|
-
name:
|
|
834
|
-
raw:
|
|
907
|
+
id: ee,
|
|
908
|
+
userId: ye,
|
|
909
|
+
name: u,
|
|
910
|
+
raw: D,
|
|
835
911
|
original: t,
|
|
836
|
-
disabled:
|
|
837
|
-
type: typeof
|
|
838
|
-
group:
|
|
839
|
-
groupDisabled:
|
|
912
|
+
disabled: se || u === P && !se,
|
|
913
|
+
type: typeof D == "boolean" ? "boolean" : "normal",
|
|
914
|
+
group: he,
|
|
915
|
+
groupDisabled: _
|
|
840
916
|
};
|
|
841
917
|
}
|
|
842
918
|
return {
|
|
843
|
-
id:
|
|
919
|
+
id: ee,
|
|
844
920
|
userId: t,
|
|
845
921
|
name: String(t),
|
|
846
922
|
raw: t,
|
|
847
923
|
original: t,
|
|
848
|
-
disabled:
|
|
924
|
+
disabled: _,
|
|
849
925
|
type: typeof t == "boolean" ? "boolean" : "normal",
|
|
850
|
-
group:
|
|
926
|
+
group: x
|
|
851
927
|
};
|
|
852
|
-
}, [
|
|
853
|
-
const t = /* @__PURE__ */ new Map(),
|
|
854
|
-
if (
|
|
855
|
-
const
|
|
928
|
+
}, [G, P, R, O]), r = de(() => {
|
|
929
|
+
const t = /* @__PURE__ */ new Map(), f = [], s = i.map((u, $) => {
|
|
930
|
+
if (u.isGroupMarker) return { ...u, type: "group-marker" };
|
|
931
|
+
const W = !u.label && !u.userId && !u.value && (u.value === void 0 || u.value === null || u.value === "") && !u.hasJsx;
|
|
856
932
|
return {
|
|
857
|
-
...
|
|
858
|
-
id: `jsx-${
|
|
859
|
-
index:
|
|
860
|
-
userId:
|
|
861
|
-
raw:
|
|
862
|
-
original:
|
|
863
|
-
name:
|
|
864
|
-
disabled: !!
|
|
865
|
-
type: typeof
|
|
866
|
-
group:
|
|
933
|
+
...u,
|
|
934
|
+
id: `jsx-${u.id}`,
|
|
935
|
+
index: $,
|
|
936
|
+
userId: u.userId,
|
|
937
|
+
raw: u.value,
|
|
938
|
+
original: u.value,
|
|
939
|
+
name: W ? P : u.label || u.userId || String(u.value || ""),
|
|
940
|
+
disabled: !!u.disabled || W,
|
|
941
|
+
type: typeof u.value == "boolean" ? "boolean" : "normal",
|
|
942
|
+
group: u.group || null
|
|
867
943
|
};
|
|
868
944
|
});
|
|
869
|
-
let
|
|
870
|
-
const
|
|
871
|
-
Array.isArray(
|
|
872
|
-
if (!
|
|
873
|
-
const xe = `${
|
|
874
|
-
if (
|
|
875
|
-
const
|
|
876
|
-
t.has(
|
|
877
|
-
} else if (
|
|
878
|
-
Object.entries(
|
|
879
|
-
const
|
|
880
|
-
|
|
945
|
+
let x = 0;
|
|
946
|
+
const _ = (u, $ = null, W = !1, oe = "0") => {
|
|
947
|
+
Array.isArray(u) || (u = [u]), u.forEach((F, me) => {
|
|
948
|
+
if (!F) return;
|
|
949
|
+
const xe = `${oe}-${me}`, ve = typeof F == "object" && !Array.isArray(F);
|
|
950
|
+
if (ve && ("options" in F || "group" in F && !Ie.some((M) => M in F))) {
|
|
951
|
+
const M = Ne(F, !0) || "Empty group";
|
|
952
|
+
t.has(M) || t.set(M, { disabled: !!F.disabled, closedByDefault: !!F.disabled || c, items: [] }), F.options ? _(F.options, M, W || !!F.disabled, xe) : f.push({ id: `empty-${M}-${xe}`, name: M, group: M, isPlaceholder: !0, type: "group-marker", index: x++ });
|
|
953
|
+
} else if (ve && !Ie.some((M) => M in F) && !F.group)
|
|
954
|
+
Object.entries(F).forEach(([M, we], Oe) => {
|
|
955
|
+
const Pe = ie(we, `${xe}-${Oe}`, "normal", $, W);
|
|
956
|
+
f.push({ ...Pe, index: x++ });
|
|
881
957
|
});
|
|
882
958
|
else {
|
|
883
|
-
const
|
|
884
|
-
|
|
959
|
+
const M = ie(F, xe, "normal", $, W);
|
|
960
|
+
f.push({ ...M, index: x++ });
|
|
885
961
|
}
|
|
886
962
|
});
|
|
887
963
|
};
|
|
888
|
-
|
|
889
|
-
const
|
|
964
|
+
_(e);
|
|
965
|
+
const ee = ne ? [...s, ...f] : [...f, ...s];
|
|
890
966
|
if (!K.current)
|
|
891
|
-
K.current = new Map(
|
|
967
|
+
K.current = new Map(ee.map((u, $) => [u.id, $]));
|
|
892
968
|
else {
|
|
893
|
-
let
|
|
894
|
-
if (
|
|
895
|
-
K.current.has(
|
|
896
|
-
}),
|
|
897
|
-
const
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
}), K.current =
|
|
969
|
+
let u = !1;
|
|
970
|
+
if (ee.forEach(($) => {
|
|
971
|
+
K.current.has($.id) || (u = !0);
|
|
972
|
+
}), u) {
|
|
973
|
+
const $ = /* @__PURE__ */ new Map();
|
|
974
|
+
ee.forEach((W, oe) => {
|
|
975
|
+
$.set(W.id, oe);
|
|
976
|
+
}), K.current = $;
|
|
901
977
|
}
|
|
902
978
|
}
|
|
903
|
-
const
|
|
904
|
-
const
|
|
905
|
-
return
|
|
906
|
-
}),
|
|
907
|
-
|
|
908
|
-
if (!
|
|
909
|
-
|
|
910
|
-
else if (
|
|
911
|
-
const
|
|
912
|
-
t.has(
|
|
979
|
+
const he = [...ee].sort((u, $) => {
|
|
980
|
+
const W = K.current.get(u.id) ?? 999999, oe = K.current.get($.id) ?? 999999;
|
|
981
|
+
return W - oe;
|
|
982
|
+
}), se = [], ye = /* @__PURE__ */ new Set();
|
|
983
|
+
he.forEach((u) => {
|
|
984
|
+
if (!u.group)
|
|
985
|
+
se.push({ type: "item", data: u });
|
|
986
|
+
else if (ye.has(u.group) || (ye.add(u.group), se.push({ type: "group", name: u.group })), !u.isPlaceholder && !u.isGroupMarker) {
|
|
987
|
+
const $ = t.get(u.group) || { items: [] };
|
|
988
|
+
t.has(u.group) || t.set(u.group, $), $.items.push(u);
|
|
913
989
|
}
|
|
914
990
|
});
|
|
915
|
-
const
|
|
916
|
-
return
|
|
917
|
-
if (
|
|
918
|
-
|
|
991
|
+
const D = [];
|
|
992
|
+
return se.forEach((u) => {
|
|
993
|
+
if (u.type === "item")
|
|
994
|
+
D.push(u.data);
|
|
919
995
|
else {
|
|
920
|
-
const
|
|
921
|
-
|
|
922
|
-
id: `group-header-${
|
|
923
|
-
name:
|
|
924
|
-
disabled: !!
|
|
996
|
+
const $ = u.name, W = t.get($), oe = H.has($);
|
|
997
|
+
D.push({
|
|
998
|
+
id: `group-header-${$}`,
|
|
999
|
+
name: $,
|
|
1000
|
+
disabled: !!W?.disabled,
|
|
925
1001
|
groupHeader: !0,
|
|
926
|
-
expanded:
|
|
1002
|
+
expanded: oe,
|
|
927
1003
|
type: "group",
|
|
928
1004
|
hidden: !1
|
|
929
|
-
}),
|
|
930
|
-
|
|
1005
|
+
}), W?.items.forEach((F) => {
|
|
1006
|
+
const me = H.size > 0 ? !oe : !!c;
|
|
1007
|
+
D.push({ ...F, hidden: me });
|
|
931
1008
|
});
|
|
932
1009
|
}
|
|
933
|
-
}),
|
|
1010
|
+
}), T && z && D.push({
|
|
934
1011
|
id: "special-load-more-id",
|
|
935
|
-
name:
|
|
1012
|
+
name: Q,
|
|
936
1013
|
loadMore: !0,
|
|
937
|
-
loading:
|
|
1014
|
+
loading: Q === X,
|
|
938
1015
|
type: "special"
|
|
939
|
-
}),
|
|
940
|
-
}, [
|
|
941
|
-
|
|
942
|
-
if (
|
|
1016
|
+
}), D;
|
|
1017
|
+
}, [e, i, G, ie, ne, T, z, Q, X, c, H, P]);
|
|
1018
|
+
re(() => {
|
|
1019
|
+
if (H.size > 0 || c) return;
|
|
943
1020
|
const t = /* @__PURE__ */ new Set();
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
}), t.size > 0 &&
|
|
947
|
-
}, [
|
|
948
|
-
const
|
|
1021
|
+
r.forEach((f) => {
|
|
1022
|
+
f.groupHeader && !f.disabled && t.add(f.name);
|
|
1023
|
+
}), t.size > 0 && ge(t);
|
|
1024
|
+
}, [r, c]);
|
|
1025
|
+
const g = N((t) => {
|
|
949
1026
|
if (t == null) return null;
|
|
950
|
-
const
|
|
951
|
-
if (
|
|
1027
|
+
const f = r.find((s) => s.original === t);
|
|
1028
|
+
if (f) return f.id;
|
|
952
1029
|
if (typeof t == "object")
|
|
953
1030
|
try {
|
|
954
|
-
const
|
|
955
|
-
return
|
|
956
|
-
(
|
|
1031
|
+
const s = JSON.stringify(t);
|
|
1032
|
+
return r.find(
|
|
1033
|
+
(x) => x.original && typeof x.original == "object" && JSON.stringify(x.original) === s
|
|
957
1034
|
)?.id ?? null;
|
|
958
1035
|
} catch {
|
|
959
1036
|
return null;
|
|
960
1037
|
}
|
|
961
1038
|
return null;
|
|
962
|
-
}, [
|
|
963
|
-
|
|
964
|
-
const t =
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
1039
|
+
}, [r]);
|
|
1040
|
+
re(() => {
|
|
1041
|
+
const t = h ? a : o;
|
|
1042
|
+
if (t == null || Array.isArray(t) && t.length === 0) {
|
|
1043
|
+
k(null), S([]);
|
|
1044
|
+
return;
|
|
1045
|
+
}
|
|
1046
|
+
const f = (s) => {
|
|
1047
|
+
const x = g(s), _ = r.find((he) => he.id === x);
|
|
1048
|
+
if (_) return _;
|
|
1049
|
+
const ee = typeof s == "object" ? s.id || s.value || JSON.stringify(s) : String(s);
|
|
1050
|
+
return typeof s == "object" && s !== null ? {
|
|
1051
|
+
id: `virtual-${ee}`,
|
|
1052
|
+
name: Ne(s) || String(s.id || "Selected Object"),
|
|
1053
|
+
raw: s.value ?? s.id ?? s,
|
|
1054
|
+
original: s,
|
|
1055
|
+
userId: s.id ?? s.value ?? null,
|
|
1056
|
+
virtual: !0
|
|
1057
|
+
} : {
|
|
1058
|
+
id: `virtual-${ee}`,
|
|
1059
|
+
name: String(s),
|
|
1060
|
+
raw: s,
|
|
1061
|
+
original: s,
|
|
1062
|
+
userId: s,
|
|
1063
|
+
virtual: !0
|
|
1064
|
+
};
|
|
1065
|
+
};
|
|
1066
|
+
if (b) {
|
|
1067
|
+
const x = (Array.isArray(t) ? t : [t]).map(f);
|
|
1068
|
+
S(x);
|
|
1069
|
+
} else {
|
|
1070
|
+
const s = Array.isArray(t) ? t[0] : t, x = f(s);
|
|
1071
|
+
k((_) => _ === x.id ? _ : x.id);
|
|
1072
|
+
}
|
|
1073
|
+
}, [a, o, h, r, g, b]);
|
|
1074
|
+
const w = de(() => {
|
|
1075
|
+
const t = r.find((f) => f.id === E);
|
|
1076
|
+
if (t) return t;
|
|
1077
|
+
if (!b && E?.startsWith("virtual-")) {
|
|
1078
|
+
const f = h ? a : o, s = Array.isArray(f) ? f[0] : f;
|
|
1079
|
+
if (s)
|
|
1080
|
+
return {
|
|
1081
|
+
id: E,
|
|
1082
|
+
name: typeof s == "object" ? Ne(s) : String(s),
|
|
1083
|
+
original: s
|
|
1084
|
+
};
|
|
1085
|
+
}
|
|
1086
|
+
return null;
|
|
1087
|
+
}, [E, r, b, h, a, o]), A = N((t, f) => {
|
|
971
1088
|
if (t.groupHeader) {
|
|
972
|
-
|
|
1089
|
+
f?.stopPropagation(), f?.preventDefault(), t.disabled || le(t.name);
|
|
973
1090
|
return;
|
|
974
1091
|
}
|
|
975
1092
|
if (t.disabled || t.loadMore) {
|
|
976
|
-
|
|
1093
|
+
f?.stopPropagation(), f?.preventDefault(), t.loadMore && !t.loading && (U(X), te());
|
|
977
1094
|
return;
|
|
978
1095
|
}
|
|
979
|
-
if (
|
|
1096
|
+
if (b) {
|
|
980
1097
|
if (t.disabled || t.groupHeader || t.loadMore) {
|
|
981
|
-
|
|
1098
|
+
f?.stopPropagation(), f?.preventDefault();
|
|
982
1099
|
return;
|
|
983
1100
|
}
|
|
984
|
-
|
|
1101
|
+
f?.stopPropagation(), f?.preventDefault();
|
|
1102
|
+
const x = Y?.some((_) => _.id === t.id) ? Y.filter((_) => _.id !== t.id) : [...Y, t];
|
|
1103
|
+
S(x), l?.(x.map((_) => _.original), x.map((_) => _.userId));
|
|
985
1104
|
return;
|
|
986
1105
|
}
|
|
987
|
-
|
|
988
|
-
}, [
|
|
989
|
-
|
|
990
|
-
}, [
|
|
1106
|
+
k(t.id), l?.(t.original, t.userId), C(!1);
|
|
1107
|
+
}, [l, C, te, X, U, le]), B = N(() => {
|
|
1108
|
+
k(null), S([]), l?.(null, null);
|
|
1109
|
+
}, [l]), Z = N((t) => {
|
|
1110
|
+
const f = Y.filter((s) => s.id !== t);
|
|
1111
|
+
S(f), l?.(f.map((s) => s.original), f.map((s) => s.userId));
|
|
1112
|
+
}, [Y, l]);
|
|
991
1113
|
return {
|
|
992
|
-
normalizedOptions:
|
|
1114
|
+
normalizedOptions: r,
|
|
993
1115
|
selected: w,
|
|
994
|
-
selectOption:
|
|
995
|
-
clear:
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
1116
|
+
selectOption: A,
|
|
1117
|
+
clear: B,
|
|
1118
|
+
removeOption: Z,
|
|
1119
|
+
hasOptions: r.length > 0,
|
|
1120
|
+
active: !y && !m && !n && r.length > 0,
|
|
1121
|
+
selectedValue: a ?? o,
|
|
999
1122
|
placeholder: p,
|
|
1000
|
-
emptyText:
|
|
1001
|
-
disabledText:
|
|
1002
|
-
loadingText:
|
|
1003
|
-
errorText:
|
|
1004
|
-
disabledOption:
|
|
1005
|
-
emptyOption:
|
|
1006
|
-
invalidOption:
|
|
1007
|
-
disabled:
|
|
1008
|
-
loading:
|
|
1009
|
-
error:
|
|
1010
|
-
expandedGroups:
|
|
1011
|
-
toggleGroup:
|
|
1012
|
-
selectedIDs:
|
|
1013
|
-
multiple:
|
|
1014
|
-
setSelectedIds:
|
|
1123
|
+
emptyText: L,
|
|
1124
|
+
disabledText: j,
|
|
1125
|
+
loadingText: V,
|
|
1126
|
+
errorText: J,
|
|
1127
|
+
disabledOption: O,
|
|
1128
|
+
emptyOption: P,
|
|
1129
|
+
invalidOption: R,
|
|
1130
|
+
disabled: n,
|
|
1131
|
+
loading: m,
|
|
1132
|
+
error: y,
|
|
1133
|
+
expandedGroups: H,
|
|
1134
|
+
toggleGroup: le,
|
|
1135
|
+
selectedIDs: Y,
|
|
1136
|
+
multiple: b,
|
|
1137
|
+
setSelectedIds: S
|
|
1015
1138
|
};
|
|
1016
1139
|
}
|
|
1017
|
-
function
|
|
1018
|
-
const
|
|
1019
|
-
return /* @__PURE__ */
|
|
1020
|
-
|
|
1140
|
+
function kr({ visibility: e, children: i, duration: a = 300 }) {
|
|
1141
|
+
const o = fe(null);
|
|
1142
|
+
return /* @__PURE__ */ d.jsx(
|
|
1143
|
+
Te,
|
|
1021
1144
|
{
|
|
1022
|
-
in:
|
|
1145
|
+
in: e,
|
|
1023
1146
|
timeout: 300,
|
|
1024
1147
|
classNames: "slideDown",
|
|
1025
1148
|
unmountOnExit: !0,
|
|
1026
|
-
nodeRef:
|
|
1027
|
-
onEnter: () =>
|
|
1028
|
-
onEntering: () =>
|
|
1029
|
-
onEntered: () =>
|
|
1030
|
-
onExit: () =>
|
|
1031
|
-
onExiting: () =>
|
|
1032
|
-
children: /* @__PURE__ */
|
|
1149
|
+
nodeRef: o,
|
|
1150
|
+
onEnter: () => o.current.style.height = "0px",
|
|
1151
|
+
onEntering: () => o.current.style.height = o.current.scrollHeight + "px",
|
|
1152
|
+
onEntered: () => o.current.style.height = "auto",
|
|
1153
|
+
onExit: () => o.current.style.height = o.current.scrollHeight + "px",
|
|
1154
|
+
onExiting: () => o.current.style.height = "0px",
|
|
1155
|
+
children: /* @__PURE__ */ d.jsx(
|
|
1033
1156
|
"div",
|
|
1034
1157
|
{
|
|
1035
|
-
ref:
|
|
1158
|
+
ref: o,
|
|
1036
1159
|
style: {
|
|
1037
1160
|
overflow: "hidden",
|
|
1038
1161
|
transition: `height ${a}ms ease`,
|
|
@@ -1040,274 +1163,296 @@ function wr({ visibility: r, children: s, duration: a = 300 }) {
|
|
|
1040
1163
|
},
|
|
1041
1164
|
className: "slideDown-enter-done",
|
|
1042
1165
|
tabIndex: -1,
|
|
1043
|
-
children:
|
|
1166
|
+
children: i
|
|
1044
1167
|
}
|
|
1045
1168
|
)
|
|
1046
1169
|
}
|
|
1047
1170
|
);
|
|
1048
1171
|
}
|
|
1049
|
-
const
|
|
1050
|
-
if (!
|
|
1051
|
-
if (typeof
|
|
1052
|
-
if (
|
|
1053
|
-
if (typeof
|
|
1054
|
-
const a =
|
|
1055
|
-
return /* @__PURE__ */
|
|
1172
|
+
const De = (e, i) => {
|
|
1173
|
+
if (!e) return null;
|
|
1174
|
+
if (typeof e == "string") return /* @__PURE__ */ d.jsx("img", { src: e, ...i, alt: "" });
|
|
1175
|
+
if (fr(e)) return gr(e, i);
|
|
1176
|
+
if (typeof e == "function" || typeof e == "object" && e.$$typeof) {
|
|
1177
|
+
const a = e;
|
|
1178
|
+
return /* @__PURE__ */ d.jsx(a, { ...i });
|
|
1056
1179
|
}
|
|
1057
1180
|
return null;
|
|
1058
|
-
},
|
|
1059
|
-
const
|
|
1060
|
-
return
|
|
1181
|
+
}, Nr = (e, i, a, o, l, n, m, y) => {
|
|
1182
|
+
const b = y?.some((p) => p.id === e.id);
|
|
1183
|
+
return e.groupHeader ? "rac-select-option rac-group-option" : [
|
|
1061
1184
|
"rac-select-option",
|
|
1062
|
-
|
|
1063
|
-
(
|
|
1064
|
-
|
|
1065
|
-
(
|
|
1066
|
-
(
|
|
1067
|
-
|
|
1068
|
-
typeof
|
|
1185
|
+
e.className,
|
|
1186
|
+
(b || o === e.id) && "rac-selected",
|
|
1187
|
+
i === a && "rac-highlighted",
|
|
1188
|
+
(e.disabled || e.loading) && "rac-disabled-option",
|
|
1189
|
+
(e.invalid || e.name === m) && "rac-invalid-option",
|
|
1190
|
+
e.loadMore && l === n && "rac-loading-option",
|
|
1191
|
+
typeof e.raw == "boolean" && (e.raw ? "rac-true-option" : "rac-false-option")
|
|
1069
1192
|
].filter(Boolean).join(" ");
|
|
1070
|
-
},
|
|
1071
|
-
unmount:
|
|
1072
|
-
children:
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
duration: v = 300,
|
|
1193
|
+
}, Or = ur(({
|
|
1194
|
+
unmount: e,
|
|
1195
|
+
children: i,
|
|
1196
|
+
visibility: a,
|
|
1197
|
+
ownBehavior: o = !1,
|
|
1198
|
+
alwaysOpen: l = !1,
|
|
1199
|
+
duration: n = 300,
|
|
1078
1200
|
easing: m = "ease-out",
|
|
1079
|
-
offset:
|
|
1080
|
-
animateOpacity:
|
|
1081
|
-
style:
|
|
1201
|
+
offset: y = 0,
|
|
1202
|
+
animateOpacity: b = !0,
|
|
1203
|
+
style: p = {},
|
|
1082
1204
|
className: L = "",
|
|
1083
|
-
ArrowIcon:
|
|
1084
|
-
ClearIcon:
|
|
1085
|
-
DelIcon:
|
|
1086
|
-
CheckIcon: O =
|
|
1087
|
-
hasMore:
|
|
1088
|
-
loadMore:
|
|
1205
|
+
ArrowIcon: j = mr,
|
|
1206
|
+
ClearIcon: V = qe,
|
|
1207
|
+
DelIcon: J = qe,
|
|
1208
|
+
CheckIcon: O = Xe,
|
|
1209
|
+
hasMore: P = !1,
|
|
1210
|
+
loadMore: R = () => {
|
|
1089
1211
|
console.warn("loadMore not implemented");
|
|
1090
1212
|
},
|
|
1091
|
-
loadButton:
|
|
1092
|
-
loadButtonText:
|
|
1093
|
-
loadMoreText:
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1213
|
+
loadButton: C = !1,
|
|
1214
|
+
loadButtonText: T = "Load more",
|
|
1215
|
+
loadMoreText: z = "Loading",
|
|
1216
|
+
selectedText: U = void 0,
|
|
1217
|
+
loadOffset: Q = 100,
|
|
1218
|
+
loadAhead: X = 3,
|
|
1219
|
+
childrenFirst: te = !1,
|
|
1097
1220
|
groupsClosed: ne = !1,
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1221
|
+
optionsClassName: c = "",
|
|
1222
|
+
...G
|
|
1223
|
+
}, h) => {
|
|
1224
|
+
const E = ze(), k = de(() => E.replace(/:/g, ""), [E]), [Y, S] = ue([]), [H, ge] = ue(!1), [K, le] = ue(C ? T : z), [ie, r] = ue(!1), g = fe(null), w = N((I) => {
|
|
1225
|
+
S((q) => {
|
|
1226
|
+
const ae = q.findIndex((ce) => ce.id === I.id);
|
|
1227
|
+
if (ae !== -1) {
|
|
1228
|
+
const ce = q[ae];
|
|
1229
|
+
if (ce.label === I.label && ce.value === I.value && ce.disabled === I.disabled && ce.group === I.group)
|
|
1230
|
+
return q;
|
|
1231
|
+
const je = [...q];
|
|
1232
|
+
return je[ae] = I, je;
|
|
1109
1233
|
}
|
|
1110
|
-
return [...
|
|
1234
|
+
return [...q, I];
|
|
1111
1235
|
});
|
|
1112
|
-
}, []),
|
|
1113
|
-
|
|
1114
|
-
const
|
|
1115
|
-
return
|
|
1236
|
+
}, []), A = N((I) => {
|
|
1237
|
+
S((q) => {
|
|
1238
|
+
const ae = q.filter((ce) => ce.id !== I);
|
|
1239
|
+
return ae.length === q.length ? q : ae;
|
|
1116
1240
|
});
|
|
1117
|
-
}, []),
|
|
1118
|
-
|
|
1119
|
-
}, [
|
|
1120
|
-
...
|
|
1241
|
+
}, []), B = l ? !0 : o ? !!a : H, Z = N((I) => {
|
|
1242
|
+
l || o || ge(I);
|
|
1243
|
+
}, [l, o]), t = $r({
|
|
1244
|
+
...G,
|
|
1121
1245
|
setVisibility: Z,
|
|
1122
|
-
jsxOptions:
|
|
1123
|
-
hasMore:
|
|
1124
|
-
loadButton:
|
|
1125
|
-
loadingTitle:
|
|
1126
|
-
loadMore:
|
|
1127
|
-
loadMoreText:
|
|
1128
|
-
setLoadingTitle:
|
|
1129
|
-
childrenFirst:
|
|
1246
|
+
jsxOptions: Y,
|
|
1247
|
+
hasMore: P,
|
|
1248
|
+
loadButton: C,
|
|
1249
|
+
loadingTitle: K,
|
|
1250
|
+
loadMore: R,
|
|
1251
|
+
loadMoreText: z,
|
|
1252
|
+
setLoadingTitle: le,
|
|
1253
|
+
childrenFirst: te,
|
|
1130
1254
|
groupsClosed: ne
|
|
1131
|
-
}), { multiple:
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
}, [
|
|
1135
|
-
(
|
|
1136
|
-
}, [
|
|
1137
|
-
if (
|
|
1138
|
-
const
|
|
1139
|
-
|
|
1255
|
+
}), { multiple: f, normalizedOptions: s, selected: x, selectOption: _, clear: ee, removeOption: he, hasOptions: se, active: ye, selectedValue: D, disabled: u, loading: $, error: W, placeholder: oe, invalidOption: F, emptyText: me, disabledText: xe, loadingText: ve, errorText: Ae, expandedGroups: M, selectedIDs: we, setSelectedIds: Oe } = t, Pe = Sr({ setLoadingTitle: le, loadButton: C, loadButtonText: T, hasMore: P, loadMore: R, disabled: u, multiple: f, open: B, setOpen: Z, options: s, selectOption: _, selected: x, loadOffset: Q, loadAhead: X, expandedGroups: M }), { handleListScroll: er, handleBlur: rr, handleFocus: tr, handleToggle: nr, handleKeyDown: sr, highlightedIndex: Ee, setHighlightedIndex: Ce } = Pe;
|
|
1256
|
+
dr(h, () => g.current), re(() => {
|
|
1257
|
+
B || r(!1);
|
|
1258
|
+
}, [B]), re(() => {
|
|
1259
|
+
(W || u || $ || !se) && Z(!1);
|
|
1260
|
+
}, [W, u, $, se, Z]), re(() => {
|
|
1261
|
+
if (B && ie && Ee !== -1) {
|
|
1262
|
+
const I = s[Ee];
|
|
1263
|
+
I && document.getElementById(`opt-${k}-${He(I.id)}`)?.scrollIntoView({ block: "nearest" });
|
|
1140
1264
|
}
|
|
1141
|
-
}, [
|
|
1142
|
-
const
|
|
1143
|
-
if (
|
|
1144
|
-
if (
|
|
1145
|
-
if (
|
|
1146
|
-
if (
|
|
1147
|
-
if (
|
|
1148
|
-
|
|
1149
|
-
|
|
1265
|
+
}, [Ee, B, ie, s, k]);
|
|
1266
|
+
const $e = de(() => D != null && !(Array.isArray(D) && D.length === 0) && !(typeof D == "object" && Object.keys(D).length === 0), [D]), ir = de(() => {
|
|
1267
|
+
if (W) return Ae;
|
|
1268
|
+
if ($) return ve;
|
|
1269
|
+
if (u) return xe;
|
|
1270
|
+
if ($e && U) return U;
|
|
1271
|
+
if (x) return x.jsx ?? x.name;
|
|
1272
|
+
if ($e) {
|
|
1273
|
+
const I = s.find((q) => q.raw === D);
|
|
1274
|
+
return I ? I.name : typeof D == "object" && D !== null ? D.name ?? D.label ?? "Selected Object" : String(D);
|
|
1150
1275
|
}
|
|
1151
|
-
return
|
|
1152
|
-
}, [
|
|
1153
|
-
const
|
|
1154
|
-
let
|
|
1155
|
-
const ce =
|
|
1156
|
-
|
|
1157
|
-
/* @__PURE__ */
|
|
1158
|
-
|
|
1276
|
+
return se ? oe : me;
|
|
1277
|
+
}, [u, $, W, se, x, D, oe, Ae, ve, xe, me, $e, s]), or = de(() => {
|
|
1278
|
+
const I = [];
|
|
1279
|
+
let q = [], ae = null;
|
|
1280
|
+
const ce = s.reduce((v, pe) => (pe.group && (v[pe.group] = (v[pe.group] || 0) + 1), v), {}), je = (v) => {
|
|
1281
|
+
v === null || q.length === 0 || (I.push(
|
|
1282
|
+
/* @__PURE__ */ d.jsx(
|
|
1283
|
+
kr,
|
|
1159
1284
|
{
|
|
1160
|
-
visibility:
|
|
1161
|
-
children:
|
|
1285
|
+
visibility: M.has(v),
|
|
1286
|
+
children: q
|
|
1162
1287
|
},
|
|
1163
|
-
`slide-${
|
|
1288
|
+
`slide-${v}`
|
|
1164
1289
|
)
|
|
1165
|
-
),
|
|
1166
|
-
},
|
|
1290
|
+
), q = []);
|
|
1291
|
+
}, We = (v, pe) => /* @__PURE__ */ d.jsxs(
|
|
1167
1292
|
"div",
|
|
1168
1293
|
{
|
|
1169
|
-
id: `opt-${
|
|
1294
|
+
id: `opt-${k}-${He(v.id)}`,
|
|
1170
1295
|
role: "option",
|
|
1171
|
-
"aria-selected":
|
|
1172
|
-
"aria-disabled":
|
|
1173
|
-
className:
|
|
1174
|
-
onClick: (be) => !
|
|
1175
|
-
onMouseEnter: () => !
|
|
1296
|
+
"aria-selected": x?.id === v.id,
|
|
1297
|
+
"aria-disabled": v.disabled || v.loading,
|
|
1298
|
+
className: Nr(v, pe, Ee, x?.id, K, z, F, we),
|
|
1299
|
+
onClick: (be) => !v.loading && _(v, be),
|
|
1300
|
+
onMouseEnter: () => !v.disabled && !v.loading && Ce(pe),
|
|
1176
1301
|
children: [
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
/* @__PURE__ */
|
|
1180
|
-
/* @__PURE__ */
|
|
1181
|
-
/* @__PURE__ */
|
|
1302
|
+
v.jsx ?? v.name,
|
|
1303
|
+
v.loading && /* @__PURE__ */ d.jsxs("span", { className: "rac-loading-dots", children: [
|
|
1304
|
+
/* @__PURE__ */ d.jsx("i", {}),
|
|
1305
|
+
/* @__PURE__ */ d.jsx("i", {}),
|
|
1306
|
+
/* @__PURE__ */ d.jsx("i", {})
|
|
1182
1307
|
] }),
|
|
1183
|
-
|
|
1184
|
-
|
|
1308
|
+
f && !v.disabled ? /* @__PURE__ */ d.jsx("div", { className: "rac-checkbox", children: De(
|
|
1309
|
+
Xe,
|
|
1185
1310
|
{
|
|
1186
1311
|
className: `
|
|
1187
1312
|
rac-checkmark
|
|
1188
|
-
${
|
|
1313
|
+
${we?.some((be) => be.id === v.id) ? "--checked" : ""}`
|
|
1189
1314
|
}
|
|
1190
1315
|
) }) : null
|
|
1191
1316
|
]
|
|
1192
1317
|
},
|
|
1193
|
-
|
|
1318
|
+
v.id
|
|
1194
1319
|
);
|
|
1195
|
-
return
|
|
1196
|
-
const be =
|
|
1197
|
-
if ((be || !
|
|
1198
|
-
|
|
1199
|
-
const
|
|
1200
|
-
|
|
1201
|
-
/* @__PURE__ */
|
|
1320
|
+
return s.forEach((v, pe) => {
|
|
1321
|
+
const be = v.groupHeader, Je = !!v.group;
|
|
1322
|
+
if ((be || !Je && ae !== null) && (je(ae), be || (ae = null)), be) {
|
|
1323
|
+
ae = v.name;
|
|
1324
|
+
const ar = M.has(v.name), lr = ce[v.name] > 0;
|
|
1325
|
+
I.push(
|
|
1326
|
+
/* @__PURE__ */ d.jsxs(
|
|
1202
1327
|
"div",
|
|
1203
1328
|
{
|
|
1204
1329
|
className: [
|
|
1205
1330
|
"rac-group-header",
|
|
1206
|
-
|
|
1331
|
+
v.disabled && "rac-disabled-group"
|
|
1207
1332
|
].filter(Boolean).join(" "),
|
|
1208
|
-
onClick: (
|
|
1333
|
+
onClick: (cr) => _(v, cr),
|
|
1209
1334
|
children: [
|
|
1210
|
-
/* @__PURE__ */
|
|
1211
|
-
/* @__PURE__ */
|
|
1335
|
+
/* @__PURE__ */ d.jsx("span", { className: "rac-group-title-text", children: v.name }),
|
|
1336
|
+
/* @__PURE__ */ d.jsx(
|
|
1212
1337
|
Re,
|
|
1213
1338
|
{
|
|
1214
|
-
visibility:
|
|
1215
|
-
duration:
|
|
1339
|
+
visibility: lr && !v.disabled,
|
|
1340
|
+
duration: n,
|
|
1216
1341
|
style: { display: "grid" },
|
|
1217
|
-
children: /* @__PURE__ */
|
|
1342
|
+
children: /* @__PURE__ */ d.jsx("span", { className: `rac-group-arrow-wrapper ${ar ? "--open" : ""}`, children: De(j, { className: "rac-select-arrow-wrapper" }) })
|
|
1218
1343
|
}
|
|
1219
1344
|
)
|
|
1220
1345
|
]
|
|
1221
1346
|
},
|
|
1222
|
-
|
|
1347
|
+
v.id
|
|
1223
1348
|
)
|
|
1224
1349
|
);
|
|
1225
|
-
} else
|
|
1226
|
-
}),
|
|
1350
|
+
} else Je ? q.push(We(v, pe)) : I.push(We(v, pe));
|
|
1351
|
+
}), je(ae), I;
|
|
1227
1352
|
}, [
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
ye,
|
|
1233
|
-
se,
|
|
1234
|
-
u,
|
|
1235
|
-
ae,
|
|
1236
|
-
Ae,
|
|
1353
|
+
s,
|
|
1354
|
+
_,
|
|
1355
|
+
k,
|
|
1356
|
+
x,
|
|
1237
1357
|
Ee,
|
|
1238
|
-
|
|
1358
|
+
K,
|
|
1359
|
+
z,
|
|
1360
|
+
F,
|
|
1361
|
+
Ce,
|
|
1362
|
+
M,
|
|
1363
|
+
j
|
|
1239
1364
|
]);
|
|
1240
|
-
return /* @__PURE__ */
|
|
1241
|
-
|
|
1365
|
+
return /* @__PURE__ */ d.jsx(
|
|
1366
|
+
jr,
|
|
1242
1367
|
{
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1368
|
+
selectedText: U,
|
|
1369
|
+
selectRef: g,
|
|
1370
|
+
selectId: k,
|
|
1371
|
+
selectedIDs: we,
|
|
1372
|
+
setSelectedIds: Oe,
|
|
1373
|
+
multiple: f,
|
|
1374
|
+
removeOption: he,
|
|
1375
|
+
optionsClassName: c,
|
|
1376
|
+
renderIcon: De,
|
|
1377
|
+
normalizedOptions: s,
|
|
1378
|
+
renderOptions: or,
|
|
1379
|
+
selected: x,
|
|
1380
|
+
title: ir,
|
|
1381
|
+
visibility: B,
|
|
1382
|
+
active: ye,
|
|
1383
|
+
hasOptions: se,
|
|
1384
|
+
hasActualValue: $e,
|
|
1385
|
+
highlightedIndex: Ee,
|
|
1386
|
+
animationFinished: ie,
|
|
1387
|
+
disabled: u,
|
|
1388
|
+
loading: $,
|
|
1389
|
+
error: W,
|
|
1262
1390
|
setVisibility: Z,
|
|
1263
|
-
setHighlightedIndex:
|
|
1264
|
-
setAnimationFinished:
|
|
1265
|
-
handleBlur:
|
|
1266
|
-
handleFocus:
|
|
1267
|
-
handleToggle:
|
|
1268
|
-
handleKeyDown:
|
|
1269
|
-
handleListScroll:
|
|
1270
|
-
selectOption:
|
|
1271
|
-
clear:
|
|
1272
|
-
registerOption:
|
|
1273
|
-
unregisterOption:
|
|
1274
|
-
children:
|
|
1275
|
-
|
|
1276
|
-
placeholder: G,
|
|
1391
|
+
setHighlightedIndex: Ce,
|
|
1392
|
+
setAnimationFinished: r,
|
|
1393
|
+
handleBlur: rr,
|
|
1394
|
+
handleFocus: tr,
|
|
1395
|
+
handleToggle: nr,
|
|
1396
|
+
handleKeyDown: sr,
|
|
1397
|
+
handleListScroll: er,
|
|
1398
|
+
selectOption: _,
|
|
1399
|
+
clear: ee,
|
|
1400
|
+
registerOption: w,
|
|
1401
|
+
unregisterOption: A,
|
|
1402
|
+
children: i,
|
|
1403
|
+
placeholder: oe,
|
|
1277
1404
|
className: L,
|
|
1278
|
-
style:
|
|
1279
|
-
duration:
|
|
1405
|
+
style: p,
|
|
1406
|
+
duration: n,
|
|
1280
1407
|
easing: m,
|
|
1281
|
-
offset:
|
|
1282
|
-
animateOpacity:
|
|
1283
|
-
unmount:
|
|
1284
|
-
ArrowIcon:
|
|
1285
|
-
ClearIcon:
|
|
1286
|
-
DelIcon:
|
|
1287
|
-
hasMore:
|
|
1288
|
-
loadButton:
|
|
1408
|
+
offset: y,
|
|
1409
|
+
animateOpacity: b,
|
|
1410
|
+
unmount: e,
|
|
1411
|
+
ArrowIcon: j,
|
|
1412
|
+
ClearIcon: V,
|
|
1413
|
+
DelIcon: J,
|
|
1414
|
+
hasMore: P,
|
|
1415
|
+
loadButton: C
|
|
1289
1416
|
}
|
|
1290
1417
|
);
|
|
1291
|
-
}),
|
|
1292
|
-
function
|
|
1293
|
-
const
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1418
|
+
}), Qe = Ze(null);
|
|
1419
|
+
function Pr({ children: e, name: i, label: a, value: o, id: l, emptyGroupText: n = "Empty group" }) {
|
|
1420
|
+
const m = Le(Ge), y = de(() => {
|
|
1421
|
+
const p = i ?? a ?? o ?? l;
|
|
1422
|
+
return p != null && p !== "" ? String(p) : n;
|
|
1423
|
+
}, [i, a, o, l, n]), b = de(() => `group-marker-${He(y)}`, [y]);
|
|
1424
|
+
return re(() => {
|
|
1425
|
+
if (!m) return;
|
|
1426
|
+
const p = {
|
|
1427
|
+
id: b,
|
|
1428
|
+
group: y,
|
|
1429
|
+
isGroupMarker: !0,
|
|
1430
|
+
disabled: !0
|
|
1431
|
+
};
|
|
1432
|
+
return m.registerOption(p), () => m.unregisterOption(b);
|
|
1433
|
+
}, [m.registerOption, m.unregisterOption, b, y]), /* @__PURE__ */ d.jsx(Qe.Provider, { value: y, children: e });
|
|
1434
|
+
}
|
|
1435
|
+
const Ye = (e) => e ? typeof e == "string" || typeof e == "number" ? String(e) : Array.isArray(e) ? e.map(Ye).join(" ").replace(/\s+/g, " ").trim() : Be.isValidElement(e) ? Ye(e.props.children) : "" : "";
|
|
1436
|
+
function Cr({ value: e, id: i, className: a, children: o, disabled: l, group: n }) {
|
|
1437
|
+
const m = Le(Ge), y = Le(Qe), b = m?.registerOption, p = m?.unregisterOption, L = ze(), j = de(() => i ? String(i) : L.replace(/:/g, ""), [i, L]);
|
|
1438
|
+
return re(() => {
|
|
1439
|
+
if (!b) return;
|
|
1440
|
+
const V = Ye(o), J = o != null;
|
|
1441
|
+
let O = "";
|
|
1442
|
+
return V ? O = V : i != null && i !== "" ? O = String(i) : e != null && e !== "" && (O = String(e)), b({
|
|
1443
|
+
id: j,
|
|
1444
|
+
value: e !== void 0 ? e : V,
|
|
1445
|
+
label: O,
|
|
1446
|
+
jsx: o,
|
|
1447
|
+
hasJsx: J,
|
|
1304
1448
|
className: a,
|
|
1305
|
-
disabled: !!
|
|
1306
|
-
group:
|
|
1307
|
-
}), () => p(
|
|
1308
|
-
}, [
|
|
1449
|
+
disabled: !!l,
|
|
1450
|
+
group: n || y || null
|
|
1451
|
+
}), () => p(j);
|
|
1452
|
+
}, [j, e, o, a, l, n, y, b, p]), null;
|
|
1309
1453
|
}
|
|
1310
1454
|
export {
|
|
1311
|
-
|
|
1312
|
-
|
|
1455
|
+
Pr as OptGroup,
|
|
1456
|
+
Cr as Option,
|
|
1457
|
+
Or as Select
|
|
1313
1458
|
};
|