react-animated-select 0.2.9 → 0.3.1
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 +70 -28
- package/demo/README.md +16 -0
- package/demo/eslint.config.js +29 -0
- package/demo/index.html +13 -0
- package/demo/package-lock.json +3436 -0
- package/demo/package.json +37 -0
- package/demo/public/vite.svg +1 -0
- package/demo/src/App.tsx +412 -0
- package/demo/src/main.jsx +9 -0
- package/demo/src/rac.css +754 -0
- package/demo/src/shake.js +11 -0
- package/demo/src/slideDown.jsx +35 -0
- package/demo/vite.config.js +7 -0
- package/dist/index.cjs.js +5 -8
- package/dist/index.css +1 -1
- package/dist/index.es.js +666 -569
- package/index.d.ts +10 -1
- package/package.json +3 -2
- package/src/option.jsx +5 -1
- package/src/select.css +7 -0
- package/src/select.jsx +71 -40
- package/src/useSelect.jsx +77 -8
- package/src/useSelectLogic.jsx +88 -49
package/dist/index.es.js
CHANGED
|
@@ -1,149 +1,149 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { CSSTransition as
|
|
3
|
-
import './index.css';var
|
|
4
|
-
var
|
|
5
|
-
function
|
|
6
|
-
if (
|
|
7
|
-
|
|
8
|
-
var t = /* @__PURE__ */ Symbol.for("react.transitional.element"),
|
|
9
|
-
function
|
|
10
|
-
var
|
|
11
|
-
if (
|
|
12
|
-
|
|
13
|
-
for (var
|
|
14
|
-
|
|
15
|
-
} else
|
|
16
|
-
return
|
|
1
|
+
import _e, { createContext as De, useRef as re, useState as te, useEffect as z, useCallback as R, useMemo as ne, useId as Se, memo as Fe, forwardRef as Ye, useImperativeHandle as Ve, isValidElement as He, cloneElement as We, useContext as ze } from "react";
|
|
2
|
+
import { CSSTransition as Re } from "react-transition-group";
|
|
3
|
+
import './index.css';var ae = { exports: {} }, ie = {};
|
|
4
|
+
var Ee;
|
|
5
|
+
function Ue() {
|
|
6
|
+
if (Ee) return ie;
|
|
7
|
+
Ee = 1;
|
|
8
|
+
var t = /* @__PURE__ */ Symbol.for("react.transitional.element"), s = /* @__PURE__ */ Symbol.for("react.fragment");
|
|
9
|
+
function c(i, b, d) {
|
|
10
|
+
var p = null;
|
|
11
|
+
if (d !== void 0 && (p = "" + d), b.key !== void 0 && (p = "" + b.key), "key" in b) {
|
|
12
|
+
d = {};
|
|
13
|
+
for (var $ in b)
|
|
14
|
+
$ !== "key" && (d[$] = b[$]);
|
|
15
|
+
} else d = b;
|
|
16
|
+
return b = d.ref, {
|
|
17
17
|
$$typeof: t,
|
|
18
|
-
type:
|
|
19
|
-
key:
|
|
20
|
-
ref:
|
|
21
|
-
props:
|
|
18
|
+
type: i,
|
|
19
|
+
key: p,
|
|
20
|
+
ref: b !== void 0 ? b : null,
|
|
21
|
+
props: d
|
|
22
22
|
};
|
|
23
23
|
}
|
|
24
|
-
return
|
|
24
|
+
return ie.Fragment = s, ie.jsx = c, ie.jsxs = c, ie;
|
|
25
25
|
}
|
|
26
|
-
var
|
|
27
|
-
var
|
|
28
|
-
function
|
|
29
|
-
return
|
|
26
|
+
var le = {};
|
|
27
|
+
var me;
|
|
28
|
+
function Je() {
|
|
29
|
+
return me || (me = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
30
30
|
function t(e) {
|
|
31
31
|
if (e == null) return null;
|
|
32
32
|
if (typeof e == "function")
|
|
33
|
-
return e.$$typeof ===
|
|
33
|
+
return e.$$typeof === m ? null : e.displayName || e.name || null;
|
|
34
34
|
if (typeof e == "string") return e;
|
|
35
35
|
switch (e) {
|
|
36
|
-
case
|
|
36
|
+
case w:
|
|
37
37
|
return "Fragment";
|
|
38
|
-
case
|
|
38
|
+
case C:
|
|
39
39
|
return "Profiler";
|
|
40
|
-
case
|
|
40
|
+
case P:
|
|
41
41
|
return "StrictMode";
|
|
42
|
-
case
|
|
42
|
+
case X:
|
|
43
43
|
return "Suspense";
|
|
44
|
-
case
|
|
44
|
+
case I:
|
|
45
45
|
return "SuspenseList";
|
|
46
|
-
case
|
|
46
|
+
case g:
|
|
47
47
|
return "Activity";
|
|
48
48
|
}
|
|
49
49
|
if (typeof e == "object")
|
|
50
50
|
switch (typeof e.tag == "number" && console.error(
|
|
51
51
|
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
52
52
|
), e.$$typeof) {
|
|
53
|
-
case
|
|
53
|
+
case _:
|
|
54
54
|
return "Portal";
|
|
55
55
|
case u:
|
|
56
56
|
return e.displayName || "Context";
|
|
57
|
-
case
|
|
57
|
+
case V:
|
|
58
58
|
return (e._context.displayName || "Context") + ".Consumer";
|
|
59
|
-
case
|
|
60
|
-
var
|
|
61
|
-
return e = e.displayName, e || (e =
|
|
62
|
-
case
|
|
63
|
-
return
|
|
64
|
-
case
|
|
65
|
-
|
|
59
|
+
case D:
|
|
60
|
+
var n = e.render;
|
|
61
|
+
return e = e.displayName, e || (e = n.displayName || n.name || "", e = e !== "" ? "ForwardRef(" + e + ")" : "ForwardRef"), e;
|
|
62
|
+
case J:
|
|
63
|
+
return n = e.displayName || null, n !== null ? n : t(e.type) || "Memo";
|
|
64
|
+
case Y:
|
|
65
|
+
n = e._payload, e = e._init;
|
|
66
66
|
try {
|
|
67
|
-
return t(e(
|
|
67
|
+
return t(e(n));
|
|
68
68
|
} catch {
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
71
|
return null;
|
|
72
72
|
}
|
|
73
|
-
function
|
|
73
|
+
function s(e) {
|
|
74
74
|
return "" + e;
|
|
75
75
|
}
|
|
76
|
-
function
|
|
76
|
+
function c(e) {
|
|
77
77
|
try {
|
|
78
|
-
|
|
79
|
-
var
|
|
78
|
+
s(e);
|
|
79
|
+
var n = !1;
|
|
80
80
|
} catch {
|
|
81
|
-
|
|
81
|
+
n = !0;
|
|
82
82
|
}
|
|
83
|
-
if (
|
|
84
|
-
|
|
85
|
-
var
|
|
86
|
-
return
|
|
87
|
-
|
|
83
|
+
if (n) {
|
|
84
|
+
n = console;
|
|
85
|
+
var r = n.error, a = typeof Symbol == "function" && Symbol.toStringTag && e[Symbol.toStringTag] || e.constructor.name || "Object";
|
|
86
|
+
return r.call(
|
|
87
|
+
n,
|
|
88
88
|
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
89
|
-
|
|
90
|
-
),
|
|
89
|
+
a
|
|
90
|
+
), s(e);
|
|
91
91
|
}
|
|
92
92
|
}
|
|
93
|
-
function
|
|
94
|
-
if (e ===
|
|
95
|
-
if (typeof e == "object" && e !== null && e.$$typeof ===
|
|
93
|
+
function i(e) {
|
|
94
|
+
if (e === w) return "<>";
|
|
95
|
+
if (typeof e == "object" && e !== null && e.$$typeof === Y)
|
|
96
96
|
return "<...>";
|
|
97
97
|
try {
|
|
98
|
-
var
|
|
99
|
-
return
|
|
98
|
+
var n = t(e);
|
|
99
|
+
return n ? "<" + n + ">" : "<...>";
|
|
100
100
|
} catch {
|
|
101
101
|
return "<...>";
|
|
102
102
|
}
|
|
103
103
|
}
|
|
104
|
-
function
|
|
105
|
-
var e =
|
|
104
|
+
function b() {
|
|
105
|
+
var e = L.A;
|
|
106
106
|
return e === null ? null : e.getOwner();
|
|
107
107
|
}
|
|
108
|
-
function
|
|
108
|
+
function d() {
|
|
109
109
|
return Error("react-stack-top-frame");
|
|
110
110
|
}
|
|
111
|
-
function
|
|
112
|
-
if (
|
|
113
|
-
var
|
|
114
|
-
if (
|
|
111
|
+
function p(e) {
|
|
112
|
+
if (x.call(e, "key")) {
|
|
113
|
+
var n = Object.getOwnPropertyDescriptor(e, "key").get;
|
|
114
|
+
if (n && n.isReactWarning) return !1;
|
|
115
115
|
}
|
|
116
116
|
return e.key !== void 0;
|
|
117
117
|
}
|
|
118
|
-
function
|
|
119
|
-
function
|
|
120
|
-
|
|
118
|
+
function $(e, n) {
|
|
119
|
+
function r() {
|
|
120
|
+
K || (K = !0, console.error(
|
|
121
121
|
"%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
|
-
|
|
122
|
+
n
|
|
123
123
|
));
|
|
124
124
|
}
|
|
125
|
-
|
|
126
|
-
get:
|
|
125
|
+
r.isReactWarning = !0, Object.defineProperty(e, "key", {
|
|
126
|
+
get: r,
|
|
127
127
|
configurable: !0
|
|
128
128
|
});
|
|
129
129
|
}
|
|
130
|
-
function
|
|
130
|
+
function y() {
|
|
131
131
|
var e = t(this.type);
|
|
132
|
-
return
|
|
132
|
+
return Q[e] || (Q[e] = !0, console.error(
|
|
133
133
|
"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
134
|
)), e = this.props.ref, e !== void 0 ? e : null;
|
|
135
135
|
}
|
|
136
|
-
function
|
|
137
|
-
var
|
|
136
|
+
function N(e, n, r, a, E, j) {
|
|
137
|
+
var f = r.ref;
|
|
138
138
|
return e = {
|
|
139
|
-
$$typeof:
|
|
139
|
+
$$typeof: S,
|
|
140
140
|
type: e,
|
|
141
|
-
key:
|
|
142
|
-
props:
|
|
143
|
-
_owner:
|
|
144
|
-
}, (
|
|
141
|
+
key: n,
|
|
142
|
+
props: r,
|
|
143
|
+
_owner: a
|
|
144
|
+
}, (f !== void 0 ? f : null) !== null ? Object.defineProperty(e, "ref", {
|
|
145
145
|
enumerable: !1,
|
|
146
|
-
get:
|
|
146
|
+
get: y
|
|
147
147
|
}) : Object.defineProperty(e, "ref", { enumerable: !1, value: null }), e._store = {}, Object.defineProperty(e._store, "validated", {
|
|
148
148
|
configurable: !1,
|
|
149
149
|
enumerable: !1,
|
|
@@ -158,69 +158,69 @@ function Le() {
|
|
|
158
158
|
configurable: !1,
|
|
159
159
|
enumerable: !1,
|
|
160
160
|
writable: !0,
|
|
161
|
-
value:
|
|
161
|
+
value: E
|
|
162
162
|
}), Object.defineProperty(e, "_debugTask", {
|
|
163
163
|
configurable: !1,
|
|
164
164
|
enumerable: !1,
|
|
165
165
|
writable: !0,
|
|
166
|
-
value:
|
|
166
|
+
value: j
|
|
167
167
|
}), Object.freeze && (Object.freeze(e.props), Object.freeze(e)), e;
|
|
168
168
|
}
|
|
169
|
-
function
|
|
170
|
-
var
|
|
171
|
-
if (
|
|
172
|
-
if (
|
|
173
|
-
if (
|
|
174
|
-
for (
|
|
175
|
-
|
|
176
|
-
Object.freeze && Object.freeze(
|
|
169
|
+
function G(e, n, r, a, E, j) {
|
|
170
|
+
var f = n.children;
|
|
171
|
+
if (f !== void 0)
|
|
172
|
+
if (a)
|
|
173
|
+
if (q(f)) {
|
|
174
|
+
for (a = 0; a < f.length; a++)
|
|
175
|
+
U(f[a]);
|
|
176
|
+
Object.freeze && Object.freeze(f);
|
|
177
177
|
} else
|
|
178
178
|
console.error(
|
|
179
179
|
"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
180
|
);
|
|
181
|
-
else
|
|
182
|
-
if (
|
|
183
|
-
|
|
184
|
-
var
|
|
185
|
-
return
|
|
181
|
+
else U(f);
|
|
182
|
+
if (x.call(n, "key")) {
|
|
183
|
+
f = t(e);
|
|
184
|
+
var T = Object.keys(n).filter(function(H) {
|
|
185
|
+
return H !== "key";
|
|
186
186
|
});
|
|
187
|
-
|
|
187
|
+
a = 0 < T.length ? "{key: someKey, " + T.join(": ..., ") + ": ...}" : "{key: someKey}", k[f + a] || (T = 0 < T.length ? "{" + T.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
188
188
|
`A props object containing a "key" prop is being spread into JSX:
|
|
189
189
|
let props = %s;
|
|
190
190
|
<%s {...props} />
|
|
191
191
|
React keys must be passed directly to JSX without using spread:
|
|
192
192
|
let props = %s;
|
|
193
193
|
<%s key={someKey} {...props} />`,
|
|
194
|
+
a,
|
|
195
|
+
f,
|
|
194
196
|
T,
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
w
|
|
198
|
-
), Y[w + T] = !0);
|
|
197
|
+
f
|
|
198
|
+
), k[f + a] = !0);
|
|
199
199
|
}
|
|
200
|
-
if (
|
|
201
|
-
|
|
202
|
-
for (var
|
|
203
|
-
|
|
204
|
-
} else
|
|
205
|
-
return
|
|
206
|
-
|
|
200
|
+
if (f = null, r !== void 0 && (c(r), f = "" + r), p(n) && (c(n.key), f = "" + n.key), "key" in n) {
|
|
201
|
+
r = {};
|
|
202
|
+
for (var O in n)
|
|
203
|
+
O !== "key" && (r[O] = n[O]);
|
|
204
|
+
} else r = n;
|
|
205
|
+
return f && $(
|
|
206
|
+
r,
|
|
207
207
|
typeof e == "function" ? e.displayName || e.name || "Unknown" : e
|
|
208
|
-
),
|
|
208
|
+
), N(
|
|
209
209
|
e,
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
210
|
+
f,
|
|
211
|
+
r,
|
|
212
|
+
b(),
|
|
213
|
+
E,
|
|
214
|
+
j
|
|
215
215
|
);
|
|
216
216
|
}
|
|
217
|
-
function
|
|
218
|
-
|
|
217
|
+
function U(e) {
|
|
218
|
+
F(e) ? e._store && (e._store.validated = 1) : typeof e == "object" && e !== null && e.$$typeof === Y && (e._payload.status === "fulfilled" ? F(e._payload.value) && e._payload.value._store && (e._payload.value._store.validated = 1) : e._store && (e._store.validated = 1));
|
|
219
219
|
}
|
|
220
|
-
function
|
|
221
|
-
return typeof e == "object" && e !== null && e.$$typeof ===
|
|
220
|
+
function F(e) {
|
|
221
|
+
return typeof e == "object" && e !== null && e.$$typeof === S;
|
|
222
222
|
}
|
|
223
|
-
var A =
|
|
223
|
+
var A = _e, S = /* @__PURE__ */ Symbol.for("react.transitional.element"), _ = /* @__PURE__ */ Symbol.for("react.portal"), w = /* @__PURE__ */ Symbol.for("react.fragment"), P = /* @__PURE__ */ Symbol.for("react.strict_mode"), C = /* @__PURE__ */ Symbol.for("react.profiler"), V = /* @__PURE__ */ Symbol.for("react.consumer"), u = /* @__PURE__ */ Symbol.for("react.context"), D = /* @__PURE__ */ Symbol.for("react.forward_ref"), X = /* @__PURE__ */ Symbol.for("react.suspense"), I = /* @__PURE__ */ Symbol.for("react.suspense_list"), J = /* @__PURE__ */ Symbol.for("react.memo"), Y = /* @__PURE__ */ Symbol.for("react.lazy"), g = /* @__PURE__ */ Symbol.for("react.activity"), m = /* @__PURE__ */ Symbol.for("react.client.reference"), L = A.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, x = Object.prototype.hasOwnProperty, q = Array.isArray, M = console.createTask ? console.createTask : function() {
|
|
224
224
|
return null;
|
|
225
225
|
};
|
|
226
226
|
A = {
|
|
@@ -228,39 +228,39 @@ React keys must be passed directly to JSX without using spread:
|
|
|
228
228
|
return e();
|
|
229
229
|
}
|
|
230
230
|
};
|
|
231
|
-
var
|
|
231
|
+
var K, Q = {}, l = A.react_stack_bottom_frame.bind(
|
|
232
232
|
A,
|
|
233
|
-
|
|
234
|
-
)(),
|
|
235
|
-
|
|
236
|
-
var
|
|
237
|
-
return
|
|
233
|
+
d
|
|
234
|
+
)(), v = M(i(d)), k = {};
|
|
235
|
+
le.Fragment = w, le.jsx = function(e, n, r) {
|
|
236
|
+
var a = 1e4 > L.recentlyCreatedOwnerStacks++;
|
|
237
|
+
return G(
|
|
238
238
|
e,
|
|
239
|
-
|
|
240
|
-
|
|
239
|
+
n,
|
|
240
|
+
r,
|
|
241
241
|
!1,
|
|
242
|
-
|
|
243
|
-
|
|
242
|
+
a ? Error("react-stack-top-frame") : l,
|
|
243
|
+
a ? M(i(e)) : v
|
|
244
244
|
);
|
|
245
|
-
},
|
|
246
|
-
var
|
|
247
|
-
return
|
|
245
|
+
}, le.jsxs = function(e, n, r) {
|
|
246
|
+
var a = 1e4 > L.recentlyCreatedOwnerStacks++;
|
|
247
|
+
return G(
|
|
248
248
|
e,
|
|
249
|
-
|
|
250
|
-
|
|
249
|
+
n,
|
|
250
|
+
r,
|
|
251
251
|
!0,
|
|
252
|
-
|
|
253
|
-
|
|
252
|
+
a ? Error("react-stack-top-frame") : l,
|
|
253
|
+
a ? M(i(e)) : v
|
|
254
254
|
);
|
|
255
255
|
};
|
|
256
|
-
})()),
|
|
256
|
+
})()), le;
|
|
257
257
|
}
|
|
258
|
-
var
|
|
259
|
-
function
|
|
260
|
-
return
|
|
258
|
+
var je;
|
|
259
|
+
function qe() {
|
|
260
|
+
return je || (je = 1, process.env.NODE_ENV === "production" ? ae.exports = Ue() : ae.exports = Je()), ae.exports;
|
|
261
261
|
}
|
|
262
|
-
var
|
|
263
|
-
const
|
|
262
|
+
var h = qe();
|
|
263
|
+
const Me = ({ className: t = "", ...s }) => /* @__PURE__ */ h.jsx(
|
|
264
264
|
"svg",
|
|
265
265
|
{
|
|
266
266
|
className: t,
|
|
@@ -271,10 +271,10 @@ const Ye = ({ className: t = "", ...o }) => /* @__PURE__ */ y.jsx(
|
|
|
271
271
|
width: "1em",
|
|
272
272
|
height: "1em",
|
|
273
273
|
fill: "currentColor",
|
|
274
|
-
...
|
|
275
|
-
children: /* @__PURE__ */
|
|
274
|
+
...s,
|
|
275
|
+
children: /* @__PURE__ */ h.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
276
|
}
|
|
277
|
-
),
|
|
277
|
+
), Ge = ({ className: t = "", ...s }) => /* @__PURE__ */ h.jsx(
|
|
278
278
|
"svg",
|
|
279
279
|
{
|
|
280
280
|
className: t,
|
|
@@ -283,563 +283,634 @@ const Ye = ({ className: t = "", ...o }) => /* @__PURE__ */ y.jsx(
|
|
|
283
283
|
width: "1em",
|
|
284
284
|
height: "1em",
|
|
285
285
|
fill: "currentColor",
|
|
286
|
-
...
|
|
287
|
-
children: /* @__PURE__ */
|
|
286
|
+
...s,
|
|
287
|
+
children: /* @__PURE__ */ h.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
288
|
}
|
|
289
|
-
),
|
|
290
|
-
|
|
289
|
+
), $e = De(null), ce = (t, s = "invalid-option", c = "") => {
|
|
290
|
+
const i = c ? c.replace(/:/g, "") : "";
|
|
291
|
+
if (typeof t != "string" || !t.trim())
|
|
292
|
+
return i ? `${s}-${i}` : `${s}-${Math.random().toString(36).slice(2, 8)}`;
|
|
293
|
+
const b = t.normalize("NFKD").replace(/[\u0300-\u036f]/g, "").replace(/\s+/g, "-").replace(/[^\p{L}\p{N}-]+/gu, "").toLowerCase();
|
|
294
|
+
return b ? b || `${s}-${Math.random().toString(36).slice(2, 8)}` : i ? `${s}-${i}` : `${s}-${Math.random().toString(36).slice(2, 8)}`;
|
|
295
|
+
};
|
|
296
|
+
function Xe({
|
|
291
297
|
disabled: t,
|
|
292
|
-
isOpen:
|
|
293
|
-
setIsOpen:
|
|
294
|
-
options:
|
|
295
|
-
selectOption:
|
|
296
|
-
selected:
|
|
298
|
+
isOpen: s,
|
|
299
|
+
setIsOpen: c,
|
|
300
|
+
options: i,
|
|
301
|
+
selectOption: b,
|
|
302
|
+
selected: d,
|
|
303
|
+
hasMore: p,
|
|
304
|
+
loadMore: $,
|
|
305
|
+
loadButton: y,
|
|
306
|
+
loadButtonText: N,
|
|
307
|
+
setLoadingTitle: G,
|
|
308
|
+
loadOffset: U,
|
|
309
|
+
loadAhead: F
|
|
297
310
|
}) {
|
|
298
|
-
const
|
|
299
|
-
|
|
300
|
-
|
|
311
|
+
const A = re(!1), S = re(0), [_, w] = te(-1), P = re(!1), C = re(i?.length || 0);
|
|
312
|
+
z(() => {
|
|
313
|
+
i && i.length !== C.current && (P.current = !1, C.current = i.length, y && G(N));
|
|
314
|
+
}, [i]);
|
|
315
|
+
const V = R(() => {
|
|
316
|
+
!p || P.current || (P.current = !0, $());
|
|
317
|
+
}, [p, $]), u = R((g) => {
|
|
318
|
+
if (y || !p || P.current) return;
|
|
319
|
+
const { scrollTop: m, scrollHeight: L, clientHeight: x } = g.currentTarget, q = U;
|
|
320
|
+
L - m <= x + q && V();
|
|
321
|
+
}, [y, p, V]);
|
|
322
|
+
z(() => {
|
|
323
|
+
if (!y && s && p && _ >= 0) {
|
|
324
|
+
const g = F;
|
|
325
|
+
_ >= i.length - g && V();
|
|
326
|
+
}
|
|
327
|
+
}, [y, _, s, p, i.length, V]), z(() => {
|
|
328
|
+
const g = () => {
|
|
301
329
|
S.current = Date.now();
|
|
302
330
|
};
|
|
303
|
-
return window.addEventListener("focus",
|
|
304
|
-
}, []),
|
|
305
|
-
if (
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
331
|
+
return window.addEventListener("focus", g), () => window.removeEventListener("focus", g);
|
|
332
|
+
}, []), z(() => {
|
|
333
|
+
if (s) {
|
|
334
|
+
if (_ >= 0 && _ < i.length)
|
|
335
|
+
return;
|
|
336
|
+
let g = -1;
|
|
337
|
+
if (d) {
|
|
338
|
+
const m = i.findIndex((L) => L.id === d.id && !L.disabled);
|
|
339
|
+
m >= 0 && (g = m);
|
|
310
340
|
}
|
|
311
|
-
|
|
341
|
+
g === -1 && (g = i.findIndex((m) => !m.disabled)), w(g);
|
|
312
342
|
} else
|
|
313
|
-
|
|
314
|
-
}, [
|
|
315
|
-
const
|
|
316
|
-
|
|
317
|
-
}, [
|
|
318
|
-
t || document.hidden || Date.now() - S.current < 100 ||
|
|
319
|
-
|
|
343
|
+
w(-1);
|
|
344
|
+
}, [s, i]);
|
|
345
|
+
const D = R((g) => {
|
|
346
|
+
g.currentTarget.contains(g.relatedTarget) || c(!1);
|
|
347
|
+
}, [c]), X = R(() => {
|
|
348
|
+
t || document.hidden || Date.now() - S.current < 100 || s || (c(!0), A.current = !0, setTimeout(() => {
|
|
349
|
+
A.current = !1;
|
|
320
350
|
}, 200));
|
|
321
|
-
}, [t,
|
|
322
|
-
t ||
|
|
323
|
-
}, [t,
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
351
|
+
}, [t, s, c]), I = R((g) => {
|
|
352
|
+
t || g.target.closest && g.target.closest(".rac-select-cancel") || A.current || c(!s);
|
|
353
|
+
}, [t, s, c]), J = (g, m) => {
|
|
354
|
+
const L = (M) => M && !M.disabled && !M.loading;
|
|
355
|
+
if (!i.some(L)) return -1;
|
|
356
|
+
let x = g, q = 0;
|
|
357
|
+
do {
|
|
358
|
+
if (x += m, x >= i.length) {
|
|
359
|
+
if (p && !y) return g;
|
|
360
|
+
x = 0;
|
|
361
|
+
}
|
|
362
|
+
if (x < 0) {
|
|
363
|
+
if (p && !y) return g;
|
|
364
|
+
x = i.length - 1;
|
|
365
|
+
}
|
|
366
|
+
q++;
|
|
367
|
+
} while (!L(i[x]) && q <= i.length);
|
|
368
|
+
return x;
|
|
369
|
+
}, Y = R((g) => {
|
|
331
370
|
if (!t)
|
|
332
|
-
switch (
|
|
371
|
+
switch (g.key) {
|
|
333
372
|
case "Enter":
|
|
334
373
|
case " ":
|
|
335
|
-
|
|
374
|
+
g.preventDefault(), s ? _ !== -1 && i[_] && b(i[_], g) : c(!0);
|
|
336
375
|
break;
|
|
337
376
|
case "Escape":
|
|
338
|
-
|
|
377
|
+
g.preventDefault(), c(!1);
|
|
339
378
|
break;
|
|
340
379
|
case "ArrowDown":
|
|
341
|
-
|
|
380
|
+
g.preventDefault(), s ? w((m) => J(m, 1)) : c(!0);
|
|
342
381
|
break;
|
|
343
382
|
case "ArrowUp":
|
|
344
|
-
|
|
383
|
+
g.preventDefault(), s ? w((m) => J(m, -1)) : c(!0);
|
|
345
384
|
break;
|
|
346
385
|
case "Tab":
|
|
347
|
-
|
|
386
|
+
s && c(!1);
|
|
348
387
|
break;
|
|
349
388
|
}
|
|
350
|
-
}, [t,
|
|
351
|
-
return
|
|
352
|
-
handleBlur:
|
|
353
|
-
handleFocus:
|
|
354
|
-
handleToggle:
|
|
355
|
-
handleKeyDown:
|
|
356
|
-
highlightedIndex:
|
|
357
|
-
setHighlightedIndex:
|
|
358
|
-
|
|
389
|
+
}, [t, s, c, _, i, b]);
|
|
390
|
+
return ne(() => ({
|
|
391
|
+
handleBlur: D,
|
|
392
|
+
handleFocus: X,
|
|
393
|
+
handleToggle: I,
|
|
394
|
+
handleKeyDown: Y,
|
|
395
|
+
highlightedIndex: _,
|
|
396
|
+
setHighlightedIndex: w,
|
|
397
|
+
handleListScroll: u
|
|
398
|
+
}), [D, X, I, Y, _, w]);
|
|
359
399
|
}
|
|
360
|
-
function
|
|
400
|
+
function Ke({
|
|
361
401
|
options: t = [],
|
|
362
|
-
jsxOptions:
|
|
363
|
-
value:
|
|
364
|
-
defaultValue:
|
|
365
|
-
onChange:
|
|
366
|
-
disabled:
|
|
367
|
-
loading:
|
|
368
|
-
error:
|
|
369
|
-
placeholder:
|
|
370
|
-
emptyText:
|
|
371
|
-
disabledText:
|
|
372
|
-
loadingText:
|
|
373
|
-
errorText:
|
|
402
|
+
jsxOptions: s = [],
|
|
403
|
+
value: c,
|
|
404
|
+
defaultValue: i = void 0,
|
|
405
|
+
onChange: b,
|
|
406
|
+
disabled: d = !1,
|
|
407
|
+
loading: p = !1,
|
|
408
|
+
error: $ = !1,
|
|
409
|
+
placeholder: y = "Choose option",
|
|
410
|
+
emptyText: N = "No options",
|
|
411
|
+
disabledText: G = "Disabled",
|
|
412
|
+
loadingText: U = "Loading",
|
|
413
|
+
errorText: F = "Failed to load",
|
|
374
414
|
disabledOption: A = "Disabled option",
|
|
375
|
-
emptyOption:
|
|
376
|
-
invalidOption:
|
|
377
|
-
setVisibility:
|
|
415
|
+
emptyOption: S = "Empty option",
|
|
416
|
+
invalidOption: _ = "Invalid option",
|
|
417
|
+
setVisibility: w,
|
|
418
|
+
hasMore: P,
|
|
419
|
+
loadButton: C,
|
|
420
|
+
setLoadingTitle: V,
|
|
421
|
+
loadingTitle: u,
|
|
422
|
+
loadMoreText: D,
|
|
423
|
+
loadMore: X,
|
|
424
|
+
childrenFirst: I
|
|
378
425
|
}) {
|
|
379
|
-
const
|
|
380
|
-
const
|
|
381
|
-
let
|
|
382
|
-
if (typeof
|
|
383
|
-
|
|
384
|
-
key: `invalid-${
|
|
385
|
-
value:
|
|
426
|
+
const J = Se(), Y = c !== void 0, [g, m] = te(null), L = (l) => !l || typeof l != "object" || Array.isArray(l) ? !1 : "id" in l || "value" in l || "name" in l || "label" in l || "disabled" in l, x = ne(() => {
|
|
427
|
+
const l = [], v = (r, a, E) => {
|
|
428
|
+
let j = E?.id ?? E?.value ?? a ?? r;
|
|
429
|
+
if (typeof a == "function") {
|
|
430
|
+
l.push({
|
|
431
|
+
key: `invalid-${l.length}`,
|
|
432
|
+
value: a,
|
|
386
433
|
userId: null,
|
|
387
434
|
disabled: !0,
|
|
388
|
-
|
|
389
|
-
label:
|
|
390
|
-
original:
|
|
435
|
+
invalid: !0,
|
|
436
|
+
label: _,
|
|
437
|
+
original: E
|
|
391
438
|
});
|
|
392
439
|
return;
|
|
393
440
|
}
|
|
394
|
-
if (
|
|
395
|
-
|
|
396
|
-
key: `empty-str-${
|
|
441
|
+
if (a === "") {
|
|
442
|
+
l.push({
|
|
443
|
+
key: `empty-str-${l.length}`,
|
|
397
444
|
value: "",
|
|
398
445
|
userId: null,
|
|
399
446
|
disabled: !0,
|
|
400
|
-
label:
|
|
401
|
-
original:
|
|
447
|
+
label: S,
|
|
448
|
+
original: E
|
|
402
449
|
});
|
|
403
450
|
return;
|
|
404
451
|
}
|
|
405
|
-
if (
|
|
406
|
-
|
|
407
|
-
key: `empty-${
|
|
452
|
+
if (a == null) {
|
|
453
|
+
l.push({
|
|
454
|
+
key: `empty-${l.length}`,
|
|
408
455
|
value: null,
|
|
409
456
|
userId: null,
|
|
410
457
|
disabled: !0,
|
|
411
|
-
label:
|
|
412
|
-
original:
|
|
458
|
+
label: S,
|
|
459
|
+
original: E
|
|
413
460
|
});
|
|
414
461
|
return;
|
|
415
462
|
}
|
|
416
|
-
if (typeof
|
|
417
|
-
|
|
418
|
-
key: `${typeof
|
|
419
|
-
value:
|
|
420
|
-
userId:
|
|
421
|
-
label: String(
|
|
422
|
-
original:
|
|
463
|
+
if (typeof a == "number" || typeof a == "boolean") {
|
|
464
|
+
l.push({
|
|
465
|
+
key: `${typeof a}-${a}-${l.length}`,
|
|
466
|
+
value: a,
|
|
467
|
+
userId: j,
|
|
468
|
+
label: String(a),
|
|
469
|
+
original: E
|
|
423
470
|
});
|
|
424
471
|
return;
|
|
425
|
-
}
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
}) : n.push({
|
|
434
|
-
key: r ?? `opt-${n.length}`,
|
|
435
|
-
value: i,
|
|
436
|
-
userId: R,
|
|
437
|
-
label: String(i ?? r),
|
|
438
|
-
original: h
|
|
439
|
-
});
|
|
472
|
+
} else
|
|
473
|
+
l.push({
|
|
474
|
+
key: r ?? `opt-${l.length}`,
|
|
475
|
+
value: a,
|
|
476
|
+
userId: j,
|
|
477
|
+
label: String(a ?? r),
|
|
478
|
+
original: E
|
|
479
|
+
});
|
|
440
480
|
};
|
|
441
|
-
Array.isArray(t) ? t.forEach((r,
|
|
481
|
+
Array.isArray(t) ? t.forEach((r, a) => {
|
|
442
482
|
if (r && typeof r == "object" && Object.keys(r).length === 1 && r.disabled === !0)
|
|
443
|
-
|
|
444
|
-
else if (
|
|
445
|
-
const
|
|
446
|
-
|
|
447
|
-
|
|
483
|
+
l.push({ key: `dis-${a}`, value: null, userId: null, disabled: !0, label: A, original: r });
|
|
484
|
+
else if (L(r)) {
|
|
485
|
+
const E = r.id ?? (typeof r.value != "object" ? r.value : r.label ?? r.name ?? r.value);
|
|
486
|
+
let j = r.name || r.label || r.id || r.value;
|
|
487
|
+
if (j == null || j === "") {
|
|
488
|
+
const O = Object.entries(r).find(
|
|
489
|
+
([H, B]) => H !== "disabled" && B !== null && B !== void 0 && B !== ""
|
|
490
|
+
);
|
|
491
|
+
O && (j = O[1]);
|
|
492
|
+
}
|
|
493
|
+
const f = j == null || j === "", T = f ? S : String(j);
|
|
494
|
+
l.push({
|
|
495
|
+
key: r.id ?? r.value ?? r.name ?? `opt-${a}`,
|
|
448
496
|
value: r.value !== void 0 ? r.value : r.id !== void 0 ? r.id : r,
|
|
449
|
-
userId:
|
|
450
|
-
disabled: !!r.disabled,
|
|
451
|
-
label:
|
|
497
|
+
userId: E,
|
|
498
|
+
disabled: f || !!r.disabled,
|
|
499
|
+
label: T,
|
|
452
500
|
original: r
|
|
453
501
|
});
|
|
454
|
-
} else r && typeof r == "object" && !Array.isArray(r) ? Object.entries(r).forEach(([
|
|
455
|
-
}) : typeof t == "object" && t !== null && Object.entries(t).forEach(([r,
|
|
456
|
-
const
|
|
457
|
-
id: `${
|
|
502
|
+
} else r && typeof r == "object" && !Array.isArray(r) ? Object.entries(r).forEach(([E, j]) => v(E, j, j)) : v(r, r, r);
|
|
503
|
+
}) : typeof t == "object" && t !== null && Object.entries(t).forEach(([r, a]) => v(r, a, a));
|
|
504
|
+
const k = l.map((r, a) => ({
|
|
505
|
+
id: `${J}-opt-${a}`,
|
|
458
506
|
userId: r.userId,
|
|
459
507
|
name: String(r.label),
|
|
460
508
|
raw: r.value,
|
|
461
509
|
original: r.original,
|
|
462
510
|
disabled: r.disabled,
|
|
463
|
-
|
|
464
|
-
type: typeof r.value == "boolean" ? "boolean" : "normal"
|
|
465
|
-
})), V = o.map((r, i) => ({
|
|
466
|
-
...r,
|
|
467
|
-
id: `jsx-${E.replace(/:/g, "")}-${r.id}-${i}`,
|
|
468
|
-
userId: r.id,
|
|
469
|
-
raw: r.value,
|
|
470
|
-
original: r.value,
|
|
471
|
-
name: r.label,
|
|
511
|
+
invalid: r.invalid,
|
|
472
512
|
type: typeof r.value == "boolean" ? "boolean" : "normal"
|
|
473
|
-
}))
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
513
|
+
})), e = s.map((r, a) => {
|
|
514
|
+
const E = r.value === null || r.value === void 0, j = r.label === null || r.label === void 0 || r.label === "", f = E && j;
|
|
515
|
+
return {
|
|
516
|
+
...r,
|
|
517
|
+
id: `jsx-${J.replace(/:/g, "")}-${r.id}-${a}`,
|
|
518
|
+
userId: r.id,
|
|
519
|
+
raw: r.value,
|
|
520
|
+
original: r.value,
|
|
521
|
+
name: f ? S : r.label,
|
|
522
|
+
disabled: r.disabled || f,
|
|
523
|
+
type: typeof r.value == "boolean" ? "boolean" : "normal"
|
|
524
|
+
};
|
|
525
|
+
}), n = I ? [...e, ...k] : [...k, ...e];
|
|
526
|
+
if (P && C) {
|
|
527
|
+
const r = u === D;
|
|
528
|
+
n.push({
|
|
529
|
+
id: "special-load-more-id",
|
|
530
|
+
name: u,
|
|
531
|
+
loadMore: !0,
|
|
532
|
+
loading: r,
|
|
533
|
+
type: "special"
|
|
534
|
+
});
|
|
535
|
+
}
|
|
536
|
+
return n;
|
|
537
|
+
}, [t, s, J, S, A, P, C, u, D]), q = R((l) => {
|
|
538
|
+
if (l == null) return null;
|
|
539
|
+
const v = x.find((k) => k.original === l || k.raw === l);
|
|
540
|
+
if (v) return v.id;
|
|
541
|
+
if (typeof l == "object")
|
|
480
542
|
try {
|
|
481
|
-
const
|
|
482
|
-
(
|
|
543
|
+
const k = JSON.stringify(l), e = x.find(
|
|
544
|
+
(n) => n.original && typeof n.original == "object" && JSON.stringify(n.original) === k
|
|
483
545
|
);
|
|
484
|
-
if (
|
|
546
|
+
if (e) return e.id;
|
|
485
547
|
} catch {
|
|
486
548
|
}
|
|
487
|
-
return
|
|
488
|
-
}, [
|
|
489
|
-
|
|
490
|
-
const
|
|
491
|
-
|
|
492
|
-
}, [
|
|
493
|
-
const
|
|
494
|
-
if (
|
|
495
|
-
|
|
549
|
+
return x.find((k) => k.userId === l)?.id ?? null;
|
|
550
|
+
}, [x]);
|
|
551
|
+
z(() => {
|
|
552
|
+
const l = Y ? c : i, v = x.find((e) => e.id === g);
|
|
553
|
+
v && (v.original === l || v.raw === l || v.userId === l) || m(q(l));
|
|
554
|
+
}, [c, i, Y, x, q]);
|
|
555
|
+
const M = ne(() => x.find((l) => l.id === g) ?? null, [g, x]), K = R((l, v) => {
|
|
556
|
+
if (l.disabled || l.loadMore) {
|
|
557
|
+
v?.stopPropagation(), v?.preventDefault(), u !== D && (V(D), X());
|
|
496
558
|
return;
|
|
497
559
|
}
|
|
498
|
-
|
|
499
|
-
}, [
|
|
500
|
-
|
|
501
|
-
}, [
|
|
560
|
+
m(l.id), b?.(l.original, l.userId), w(!1);
|
|
561
|
+
}, [b, w]), Q = R(() => {
|
|
562
|
+
m(null), b?.(null, null);
|
|
563
|
+
}, [b]);
|
|
502
564
|
return {
|
|
503
|
-
normalizedOptions:
|
|
504
|
-
selected:
|
|
505
|
-
selectOption:
|
|
506
|
-
clear:
|
|
507
|
-
hasOptions:
|
|
508
|
-
active:
|
|
509
|
-
selectedValue:
|
|
510
|
-
placeholder:
|
|
511
|
-
emptyText:
|
|
512
|
-
disabledText:
|
|
513
|
-
loadingText:
|
|
514
|
-
errorText:
|
|
565
|
+
normalizedOptions: x,
|
|
566
|
+
selected: M,
|
|
567
|
+
selectOption: K,
|
|
568
|
+
clear: Q,
|
|
569
|
+
hasOptions: x.length > 0,
|
|
570
|
+
active: !$ && !p && !d && x.length > 0,
|
|
571
|
+
selectedValue: c ?? i,
|
|
572
|
+
placeholder: y,
|
|
573
|
+
emptyText: N,
|
|
574
|
+
disabledText: G,
|
|
575
|
+
loadingText: U,
|
|
576
|
+
errorText: F,
|
|
515
577
|
disabledOption: A,
|
|
516
|
-
emptyOption:
|
|
517
|
-
invalidOption:
|
|
518
|
-
disabled:
|
|
519
|
-
loading:
|
|
520
|
-
error:
|
|
578
|
+
emptyOption: S,
|
|
579
|
+
invalidOption: _,
|
|
580
|
+
disabled: d,
|
|
581
|
+
loading: p,
|
|
582
|
+
error: $
|
|
521
583
|
};
|
|
522
584
|
}
|
|
523
|
-
|
|
524
|
-
const l = s ? s.replace(/:/g, "") : "";
|
|
525
|
-
if (typeof t != "string" || !t.trim())
|
|
526
|
-
return l ? `${o}-${l}` : `${o}-${Math.random().toString(36).slice(2, 8)}`;
|
|
527
|
-
const f = t.normalize("NFKD").replace(/[\u0300-\u036f]/g, "").replace(/\s+/g, "-").replace(/[^\p{L}\p{N}-]+/gu, "").toLowerCase();
|
|
528
|
-
return f ? f || `${o}-${Math.random().toString(36).slice(2, 8)}` : l ? `${o}-${l}` : `${o}-${Math.random().toString(36).slice(2, 8)}`;
|
|
529
|
-
};
|
|
530
|
-
function He({
|
|
585
|
+
function Ze({
|
|
531
586
|
visibility: t,
|
|
532
|
-
children:
|
|
533
|
-
selectRef:
|
|
534
|
-
onAnimationDone:
|
|
535
|
-
unmount:
|
|
536
|
-
duration:
|
|
537
|
-
easing:
|
|
538
|
-
offset:
|
|
539
|
-
animateOpacity:
|
|
587
|
+
children: s,
|
|
588
|
+
selectRef: c,
|
|
589
|
+
onAnimationDone: i,
|
|
590
|
+
unmount: b = !0,
|
|
591
|
+
duration: d,
|
|
592
|
+
easing: p,
|
|
593
|
+
offset: $,
|
|
594
|
+
animateOpacity: y
|
|
540
595
|
}) {
|
|
541
|
-
const
|
|
542
|
-
|
|
543
|
-
if (!
|
|
544
|
-
|
|
545
|
-
const
|
|
546
|
-
for (let
|
|
596
|
+
const N = re(null), [G, U] = te(0);
|
|
597
|
+
z(() => {
|
|
598
|
+
if (!c?.current) return;
|
|
599
|
+
U(c.current.offsetHeight);
|
|
600
|
+
const D = new ResizeObserver((X) => {
|
|
601
|
+
for (let I of X) U(I.target.offsetHeight);
|
|
547
602
|
});
|
|
548
|
-
return
|
|
549
|
-
}, [
|
|
550
|
-
const
|
|
603
|
+
return D.observe(c.current), () => D.disconnect();
|
|
604
|
+
}, [c]);
|
|
605
|
+
const F = `height ${d}ms ${p}${y ? `, opacity ${d}ms ${p}` : ""}`, A = {
|
|
551
606
|
position: "absolute",
|
|
552
|
-
top: `calc(100% + ${
|
|
607
|
+
top: `calc(100% + ${$}px)`,
|
|
553
608
|
left: "0",
|
|
554
609
|
width: "100%",
|
|
555
610
|
overflow: "hidden",
|
|
556
611
|
marginTop: "2px",
|
|
557
612
|
zIndex: "1",
|
|
558
613
|
height: t ? "auto" : "0px",
|
|
559
|
-
opacity:
|
|
614
|
+
opacity: y ? t ? 1 : 0 : 1,
|
|
560
615
|
pointerEvents: t ? "all" : "none",
|
|
561
|
-
visibility:
|
|
562
|
-
},
|
|
563
|
-
const u =
|
|
564
|
-
u && (u.style.height = "0px",
|
|
565
|
-
}, [
|
|
566
|
-
const u =
|
|
567
|
-
u && (u.style.transition =
|
|
568
|
-
}, [
|
|
569
|
-
const u =
|
|
570
|
-
u && (u.style.height = "auto", u.style.transition = "",
|
|
571
|
-
}, [
|
|
572
|
-
const u =
|
|
573
|
-
u && (u.style.height = `${u.scrollHeight}px`,
|
|
574
|
-
}, [
|
|
575
|
-
const u =
|
|
576
|
-
u && (u.style.height = "0px",
|
|
577
|
-
}, [
|
|
578
|
-
const u =
|
|
616
|
+
visibility: G ? "visible" : "hidden"
|
|
617
|
+
}, S = R(() => {
|
|
618
|
+
const u = N.current;
|
|
619
|
+
u && (u.style.height = "0px", y && (u.style.opacity = "0"), u.style.transition = "");
|
|
620
|
+
}, [y]), _ = R(() => {
|
|
621
|
+
const u = N.current;
|
|
622
|
+
u && (u.style.transition = F, u.style.height = `${u.scrollHeight}px`, y && (u.style.opacity = "1"));
|
|
623
|
+
}, [F, y]), w = R(() => {
|
|
624
|
+
const u = N.current;
|
|
625
|
+
u && (u.style.height = "auto", u.style.transition = "", i && i());
|
|
626
|
+
}, [i]), P = R(() => {
|
|
627
|
+
const u = N.current;
|
|
628
|
+
u && (u.style.height = `${u.scrollHeight}px`, y && (u.style.opacity = "1"), u.offsetHeight, u.style.transition = F);
|
|
629
|
+
}, [F, y]), C = R(() => {
|
|
630
|
+
const u = N.current;
|
|
631
|
+
u && (u.style.height = "0px", y && (u.style.opacity = "0"));
|
|
632
|
+
}, [y]), V = R(() => {
|
|
633
|
+
const u = N.current;
|
|
579
634
|
u && (u.style.transition = "");
|
|
580
635
|
}, []);
|
|
581
|
-
return /* @__PURE__ */
|
|
582
|
-
|
|
636
|
+
return /* @__PURE__ */ h.jsx(
|
|
637
|
+
Re,
|
|
583
638
|
{
|
|
584
639
|
in: t,
|
|
585
|
-
timeout:
|
|
640
|
+
timeout: d,
|
|
586
641
|
classNames: "rac-options",
|
|
587
|
-
unmountOnExit:
|
|
588
|
-
nodeRef:
|
|
589
|
-
onEnter:
|
|
590
|
-
onEntering:
|
|
591
|
-
onEntered:
|
|
592
|
-
onExit:
|
|
593
|
-
onExiting:
|
|
594
|
-
onExited:
|
|
595
|
-
children: /* @__PURE__ */
|
|
642
|
+
unmountOnExit: b,
|
|
643
|
+
nodeRef: N,
|
|
644
|
+
onEnter: S,
|
|
645
|
+
onEntering: _,
|
|
646
|
+
onEntered: w,
|
|
647
|
+
onExit: P,
|
|
648
|
+
onExiting: C,
|
|
649
|
+
onExited: V,
|
|
650
|
+
children: /* @__PURE__ */ h.jsx(
|
|
596
651
|
"div",
|
|
597
652
|
{
|
|
598
|
-
ref:
|
|
653
|
+
ref: N,
|
|
599
654
|
className: "rac-options",
|
|
600
655
|
style: A,
|
|
601
|
-
children:
|
|
656
|
+
children: s
|
|
602
657
|
}
|
|
603
658
|
)
|
|
604
659
|
}
|
|
605
660
|
);
|
|
606
661
|
}
|
|
607
|
-
const
|
|
608
|
-
function
|
|
662
|
+
const Qe = Fe(Ze, (t, s) => t.visibility === s.visibility && t.duration === s.duration && t.easing === s.easing && t.offset === s.offset && t.animateOpacity === s.animateOpacity && t.selectRef === s.selectRef && t.children === s.children);
|
|
663
|
+
function oe({
|
|
609
664
|
visibility: t,
|
|
610
|
-
children:
|
|
611
|
-
duration:
|
|
612
|
-
unmount:
|
|
613
|
-
style:
|
|
665
|
+
children: s,
|
|
666
|
+
duration: c = 300,
|
|
667
|
+
unmount: i,
|
|
668
|
+
style: b
|
|
614
669
|
}) {
|
|
615
|
-
const
|
|
616
|
-
return /* @__PURE__ */
|
|
617
|
-
|
|
670
|
+
const d = re(null);
|
|
671
|
+
return /* @__PURE__ */ h.jsx(
|
|
672
|
+
Re,
|
|
618
673
|
{
|
|
619
674
|
in: t,
|
|
620
|
-
timeout:
|
|
675
|
+
timeout: c,
|
|
621
676
|
classNames: "rac-slide-left",
|
|
622
677
|
unmountOnExit: !0,
|
|
623
|
-
nodeRef:
|
|
624
|
-
onEnter: () =>
|
|
625
|
-
onEntering: () =>
|
|
626
|
-
onEntered: () =>
|
|
627
|
-
onExit: () =>
|
|
628
|
-
onExiting: () =>
|
|
629
|
-
onExited: () =>
|
|
630
|
-
children: /* @__PURE__ */
|
|
678
|
+
nodeRef: d,
|
|
679
|
+
onEnter: () => d.current.style.width = "0px",
|
|
680
|
+
onEntering: () => d.current.style.width = d.current.scrollWidth + "px",
|
|
681
|
+
onEntered: () => d.current.style.width = "auto",
|
|
682
|
+
onExit: () => d.current.style.width = d.current.scrollWidth + "px",
|
|
683
|
+
onExiting: () => d.current.style.width = "0px",
|
|
684
|
+
onExited: () => i?.(),
|
|
685
|
+
children: /* @__PURE__ */ h.jsx(
|
|
631
686
|
"div",
|
|
632
687
|
{
|
|
633
|
-
ref:
|
|
688
|
+
ref: d,
|
|
634
689
|
style: {
|
|
635
|
-
...
|
|
690
|
+
...b,
|
|
636
691
|
overflow: "hidden",
|
|
637
|
-
transition: `width ${
|
|
692
|
+
transition: `width ${c}ms ease`
|
|
638
693
|
},
|
|
639
|
-
children:
|
|
694
|
+
children: s
|
|
640
695
|
}
|
|
641
696
|
)
|
|
642
697
|
}
|
|
643
698
|
);
|
|
644
699
|
}
|
|
645
|
-
const
|
|
700
|
+
const we = (t, s) => {
|
|
646
701
|
if (!t) return null;
|
|
647
702
|
if (typeof t == "string")
|
|
648
|
-
return /* @__PURE__ */
|
|
649
|
-
if (
|
|
650
|
-
return
|
|
703
|
+
return /* @__PURE__ */ h.jsx("img", { src: t, ...s, alt: "" });
|
|
704
|
+
if (He(t))
|
|
705
|
+
return We(t, s);
|
|
651
706
|
if (typeof t == "function" || typeof t == "object" && t.$$typeof) {
|
|
652
|
-
const
|
|
653
|
-
return /* @__PURE__ */
|
|
707
|
+
const c = t;
|
|
708
|
+
return /* @__PURE__ */ h.jsx(c, { ...s });
|
|
654
709
|
}
|
|
655
710
|
return null;
|
|
656
|
-
},
|
|
711
|
+
}, rr = Ye(({
|
|
657
712
|
unmount: t,
|
|
658
|
-
children:
|
|
659
|
-
renderedDropdown:
|
|
660
|
-
visibility:
|
|
661
|
-
ownBehavior:
|
|
662
|
-
alwaysOpen:
|
|
663
|
-
duration:
|
|
664
|
-
easing:
|
|
665
|
-
offset:
|
|
666
|
-
animateOpacity:
|
|
667
|
-
style:
|
|
668
|
-
className:
|
|
669
|
-
ArrowIcon:
|
|
670
|
-
ClearIcon: A =
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
}
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
}, [
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
713
|
+
children: s,
|
|
714
|
+
renderedDropdown: c,
|
|
715
|
+
visibility: i,
|
|
716
|
+
ownBehavior: b = !1,
|
|
717
|
+
alwaysOpen: d = !1,
|
|
718
|
+
duration: p = 300,
|
|
719
|
+
easing: $ = "ease-out",
|
|
720
|
+
offset: y = 2,
|
|
721
|
+
animateOpacity: N = !0,
|
|
722
|
+
style: G = {},
|
|
723
|
+
className: U = "",
|
|
724
|
+
ArrowIcon: F = Ge,
|
|
725
|
+
ClearIcon: A = Me,
|
|
726
|
+
hasMore: S = !1,
|
|
727
|
+
loadMore: _ = () => {
|
|
728
|
+
},
|
|
729
|
+
loadButton: w = !1,
|
|
730
|
+
loadButtonText: P = "Load more",
|
|
731
|
+
loadMoreText: C = "Loading",
|
|
732
|
+
loadOffset: V = 100,
|
|
733
|
+
loadAhead: u = 3,
|
|
734
|
+
childrenFirst: D = !1,
|
|
735
|
+
...X
|
|
736
|
+
}, I) => {
|
|
737
|
+
const [J, Y] = te(w ? P : C);
|
|
738
|
+
z(() => {
|
|
739
|
+
Y(w ? P : C);
|
|
740
|
+
}, [w, P, C]);
|
|
741
|
+
const g = Se(), m = ne(() => g.replace(/:/g, ""), [g]), [L, x] = te([]), q = R((o) => {
|
|
742
|
+
x((W) => [...W, o]);
|
|
743
|
+
}, []), M = R((o) => {
|
|
744
|
+
x((W) => W.filter((ee) => ee.id !== o));
|
|
745
|
+
}, []), K = re(null);
|
|
746
|
+
z(() => {
|
|
747
|
+
I && (typeof I == "function" ? I(K.current) : I.current = K.current);
|
|
748
|
+
}, [I]), Ve(I, () => K.current);
|
|
749
|
+
const [Q, l] = te(!1), v = ne(() => d ? !0 : b ? !!i : Q, [d, b, i, Q]), k = R((o) => {
|
|
750
|
+
d || b || l((W) => typeof o == "function" ? o(W) : o);
|
|
751
|
+
}, [d, b]), { normalizedOptions: e, selected: n, selectOption: r, clear: a, hasOptions: E, active: j, selectedValue: f, disabled: T, loading: O, error: H, placeholder: B, invalidOption: ke, emptyText: de, disabledText: fe, loadingText: ge, errorText: he } = Ke({ ...X, setVisibility: k, jsxOptions: L, hasMore: S, loadButton: w, loadingTitle: J, loadMore: _, loadMoreText: C, setLoadingTitle: Y, childrenFirst: D }), { handleListScroll: Te, handleBlur: Ne, handleFocus: Ae, handleToggle: Pe, handleKeyDown: Ce, highlightedIndex: se, setHighlightedIndex: Ie } = Xe({
|
|
752
|
+
setLoadingTitle: Y,
|
|
753
|
+
loadButton: w,
|
|
754
|
+
loadButtonText: P,
|
|
755
|
+
hasMore: S,
|
|
756
|
+
loadMore: _,
|
|
757
|
+
disabled: T,
|
|
758
|
+
isOpen: v,
|
|
759
|
+
setIsOpen: k,
|
|
760
|
+
options: e,
|
|
761
|
+
selectOption: r,
|
|
762
|
+
selected: n,
|
|
763
|
+
loadOffset: V,
|
|
764
|
+
loadAhead: u
|
|
765
|
+
}), [be, pe] = te(!1);
|
|
766
|
+
z(() => {
|
|
767
|
+
v || pe(!1);
|
|
768
|
+
}, [v]), z(() => {
|
|
769
|
+
(H || T || O || !E) && k(!1);
|
|
770
|
+
}, [H, T, O, E]), z(() => {
|
|
771
|
+
if (v && be && se !== -1) {
|
|
772
|
+
const o = e[se];
|
|
773
|
+
if (o) {
|
|
774
|
+
const W = `opt-${m}-${ce(o.id)}`, ee = document.getElementById(W);
|
|
775
|
+
ee && ee.scrollIntoView({ block: "nearest" });
|
|
701
776
|
}
|
|
702
777
|
}
|
|
703
|
-
}, [
|
|
704
|
-
const
|
|
705
|
-
if (
|
|
706
|
-
if (
|
|
707
|
-
if (
|
|
708
|
-
if (
|
|
709
|
-
if (
|
|
710
|
-
const
|
|
711
|
-
return
|
|
778
|
+
}, [se, v, be, e, m]);
|
|
779
|
+
const ye = f != null && !(Array.isArray(f) && f.length === 0) && !(typeof f == "object" && Object.keys(f).length === 0), xe = ne(() => {
|
|
780
|
+
if (H) return he;
|
|
781
|
+
if (O) return ge;
|
|
782
|
+
if (T) return fe;
|
|
783
|
+
if (n) return n.jsx ?? n.name;
|
|
784
|
+
if (ye) {
|
|
785
|
+
const o = e.find((W) => W.raw === f);
|
|
786
|
+
return o ? o.name : typeof f == "object" && f !== null ? f.name ?? f.label ?? "Selected Object" : String(f);
|
|
712
787
|
}
|
|
713
|
-
return
|
|
714
|
-
}, [
|
|
715
|
-
const
|
|
716
|
-
let
|
|
717
|
-
return
|
|
788
|
+
return E ? B : de;
|
|
789
|
+
}, [T, O, H, E, n, f, B, he, ge, fe, de]), Le = `${m}-listbox`, Oe = ne(() => e?.map((o, W) => {
|
|
790
|
+
const ee = `opt-${m}-${ce(o.id)}`;
|
|
791
|
+
let Z = "rac-select-option";
|
|
792
|
+
return o.className && (Z += ` ${o.className}`), n?.id === o.id && (Z += " rac-selected"), W === se && (Z += " rac-highlighted"), (o.disabled || o.loading) && (Z += " rac-disabled-option"), o.invalid && (Z += " rac-invalid-option"), o.loadMore && J == C && (Z += " rac-loading-option"), typeof o.raw == "boolean" && (Z += o.raw ? " rac-true-option" : " rac-false-option"), o.name == ke && (Z += " rac-invalid-option"), /* @__PURE__ */ h.jsxs(
|
|
718
793
|
"div",
|
|
719
794
|
{
|
|
720
|
-
className:
|
|
721
|
-
onClick: (
|
|
722
|
-
|
|
723
|
-
|
|
795
|
+
className: Z,
|
|
796
|
+
onClick: (ve) => {
|
|
797
|
+
if (o.loading) {
|
|
798
|
+
ve.stopPropagation();
|
|
799
|
+
return;
|
|
800
|
+
}
|
|
801
|
+
r(o, ve);
|
|
802
|
+
},
|
|
803
|
+
onMouseEnter: () => !o.disabled && !o.loading && Ie(W),
|
|
804
|
+
id: ee,
|
|
724
805
|
role: "option",
|
|
725
|
-
"aria-selected":
|
|
726
|
-
"aria-disabled":
|
|
727
|
-
|
|
806
|
+
"aria-selected": n?.id === o.id,
|
|
807
|
+
"aria-disabled": o.disabled || o.loading,
|
|
808
|
+
"data-loading": o.loading,
|
|
809
|
+
children: [
|
|
810
|
+
o.jsx ?? o.name,
|
|
811
|
+
o.loading && /* @__PURE__ */ h.jsxs("span", { className: "rac-loading-dots", children: [
|
|
812
|
+
/* @__PURE__ */ h.jsx("i", {}),
|
|
813
|
+
/* @__PURE__ */ h.jsx("i", {}),
|
|
814
|
+
/* @__PURE__ */ h.jsx("i", {})
|
|
815
|
+
] })
|
|
816
|
+
]
|
|
728
817
|
},
|
|
729
|
-
|
|
818
|
+
o.id
|
|
730
819
|
);
|
|
731
|
-
}), [
|
|
732
|
-
return
|
|
733
|
-
|
|
734
|
-
`%c[Select Library]:%c Invalid prop %coptions%c.
|
|
735
|
-
Expected %cArray%c or %cObject%c, but received %c${typeof g}%c.
|
|
736
|
-
`,
|
|
737
|
-
"color: #ff4d4f; font-weight: bold;",
|
|
738
|
-
"color: default;",
|
|
739
|
-
"color: #1890ff; font-weight: bold;",
|
|
740
|
-
"color: default;",
|
|
741
|
-
"color: #52c41a; font-weight: bold;",
|
|
742
|
-
"color: default;",
|
|
743
|
-
"color: #52c41a; font-weight: bold;",
|
|
744
|
-
"color: default;",
|
|
745
|
-
"color: #ff4d4f; font-weight: bold;",
|
|
746
|
-
"color: default;"
|
|
747
|
-
), K && B !== void 0 && console.warn(
|
|
748
|
-
`%c[Select Library]:%c .
|
|
749
|
-
`,
|
|
750
|
-
"color: #faad14; font-weight: bold;",
|
|
751
|
-
"color: default;"
|
|
752
|
-
));
|
|
753
|
-
}, [g, T, B, K]), /* @__PURE__ */ y.jsxs(
|
|
754
|
-
me.Provider,
|
|
820
|
+
}), [e, r, m, n, se]);
|
|
821
|
+
return /* @__PURE__ */ h.jsxs(
|
|
822
|
+
$e.Provider,
|
|
755
823
|
{
|
|
756
|
-
value: { registerOption:
|
|
824
|
+
value: { registerOption: q, unregisterOption: M },
|
|
757
825
|
children: [
|
|
758
|
-
o,
|
|
759
826
|
s,
|
|
760
|
-
|
|
827
|
+
c,
|
|
828
|
+
/* @__PURE__ */ h.jsxs(
|
|
761
829
|
"div",
|
|
762
830
|
{
|
|
763
831
|
style: {
|
|
764
|
-
"--rac-duration": `${
|
|
765
|
-
...
|
|
832
|
+
"--rac-duration": `${p}ms`,
|
|
833
|
+
...G
|
|
766
834
|
},
|
|
767
835
|
className: `rac-select
|
|
768
|
-
${
|
|
769
|
-
${!
|
|
770
|
-
${
|
|
771
|
-
${
|
|
772
|
-
tabIndex:
|
|
773
|
-
ref:
|
|
836
|
+
${U}
|
|
837
|
+
${!E || T ? "rac-disabled-style" : ""}
|
|
838
|
+
${O ? "rac-loading-style" : ""}
|
|
839
|
+
${H ? "rac-error-style" : ""}`,
|
|
840
|
+
tabIndex: j ? 0 : -1,
|
|
841
|
+
ref: K,
|
|
774
842
|
role: "combobox",
|
|
775
843
|
"aria-haspopup": "listbox",
|
|
776
|
-
"aria-expanded":
|
|
777
|
-
"aria-controls":
|
|
778
|
-
"aria-label":
|
|
779
|
-
"aria-disabled":
|
|
780
|
-
...
|
|
781
|
-
onBlur:
|
|
782
|
-
onFocus:
|
|
783
|
-
onClick:
|
|
784
|
-
onKeyDown:
|
|
844
|
+
"aria-expanded": v,
|
|
845
|
+
"aria-controls": Le,
|
|
846
|
+
"aria-label": B,
|
|
847
|
+
"aria-disabled": T || !E,
|
|
848
|
+
...j && {
|
|
849
|
+
onBlur: Ne,
|
|
850
|
+
onFocus: Ae,
|
|
851
|
+
onClick: Pe,
|
|
852
|
+
onKeyDown: Ce
|
|
785
853
|
},
|
|
786
854
|
children: [
|
|
787
|
-
/* @__PURE__ */
|
|
855
|
+
/* @__PURE__ */ h.jsxs(
|
|
788
856
|
"div",
|
|
789
857
|
{
|
|
790
|
-
className: `rac-select-title ${!
|
|
858
|
+
className: `rac-select-title ${!H && !O && n?.type == "boolean" ? n.raw ? "rac-true-option" : "rac-false-option" : ""}`,
|
|
791
859
|
children: [
|
|
792
|
-
/* @__PURE__ */
|
|
860
|
+
/* @__PURE__ */ h.jsx(
|
|
793
861
|
"span",
|
|
794
862
|
{
|
|
795
863
|
className: "rac-title-text",
|
|
796
|
-
children:
|
|
864
|
+
children: xe
|
|
797
865
|
},
|
|
798
|
-
|
|
866
|
+
xe
|
|
799
867
|
),
|
|
800
|
-
/* @__PURE__ */
|
|
801
|
-
|
|
868
|
+
/* @__PURE__ */ h.jsx(
|
|
869
|
+
oe,
|
|
802
870
|
{
|
|
803
|
-
visibility:
|
|
804
|
-
duration:
|
|
805
|
-
children: /* @__PURE__ */
|
|
806
|
-
/* @__PURE__ */
|
|
807
|
-
/* @__PURE__ */
|
|
808
|
-
/* @__PURE__ */
|
|
871
|
+
visibility: O && !H,
|
|
872
|
+
duration: p,
|
|
873
|
+
children: /* @__PURE__ */ h.jsxs("span", { className: "rac-loading-dots", children: [
|
|
874
|
+
/* @__PURE__ */ h.jsx("i", {}),
|
|
875
|
+
/* @__PURE__ */ h.jsx("i", {}),
|
|
876
|
+
/* @__PURE__ */ h.jsx("i", {})
|
|
809
877
|
] })
|
|
810
878
|
}
|
|
811
879
|
)
|
|
812
880
|
]
|
|
813
881
|
}
|
|
814
882
|
),
|
|
815
|
-
/* @__PURE__ */
|
|
883
|
+
/* @__PURE__ */ h.jsxs(
|
|
816
884
|
"div",
|
|
817
885
|
{
|
|
818
886
|
className: "rac-select-buttons",
|
|
819
887
|
children: [
|
|
820
|
-
/* @__PURE__ */
|
|
821
|
-
|
|
888
|
+
/* @__PURE__ */ h.jsx(
|
|
889
|
+
oe,
|
|
822
890
|
{
|
|
823
|
-
visibility:
|
|
824
|
-
duration:
|
|
891
|
+
visibility: ye && E && !T && !O && !H,
|
|
892
|
+
duration: p,
|
|
825
893
|
style: { display: "grid" },
|
|
826
|
-
children:
|
|
894
|
+
children: we(A, {
|
|
827
895
|
className: "rac-select-cancel",
|
|
828
|
-
|
|
896
|
+
onMouseDown: (o) => {
|
|
897
|
+
o.preventDefault(), o.stopPropagation();
|
|
898
|
+
},
|
|
899
|
+
onClick: a
|
|
829
900
|
})
|
|
830
901
|
}
|
|
831
902
|
),
|
|
832
|
-
/* @__PURE__ */
|
|
833
|
-
|
|
903
|
+
/* @__PURE__ */ h.jsx(
|
|
904
|
+
oe,
|
|
834
905
|
{
|
|
835
|
-
visibility:
|
|
836
|
-
duration:
|
|
906
|
+
visibility: j,
|
|
907
|
+
duration: p,
|
|
837
908
|
style: { display: "grid" },
|
|
838
|
-
children: /* @__PURE__ */
|
|
909
|
+
children: /* @__PURE__ */ h.jsx(
|
|
839
910
|
"span",
|
|
840
911
|
{
|
|
841
|
-
className: `rac-select-arrow-wrapper ${
|
|
842
|
-
children:
|
|
912
|
+
className: `rac-select-arrow-wrapper ${v ? "--open" : ""}`,
|
|
913
|
+
children: we(F, {
|
|
843
914
|
className: "rac-select-arrow-wrapper"
|
|
844
915
|
})
|
|
845
916
|
}
|
|
@@ -849,24 +920,50 @@ Expected %cArray%c or %cObject%c, but received %c${typeof g}%c.
|
|
|
849
920
|
]
|
|
850
921
|
}
|
|
851
922
|
),
|
|
852
|
-
/* @__PURE__ */
|
|
853
|
-
|
|
923
|
+
/* @__PURE__ */ h.jsx(
|
|
924
|
+
Qe,
|
|
854
925
|
{
|
|
855
|
-
visibility:
|
|
856
|
-
selectRef:
|
|
857
|
-
onAnimationDone: () =>
|
|
926
|
+
visibility: v,
|
|
927
|
+
selectRef: K,
|
|
928
|
+
onAnimationDone: () => pe(!0),
|
|
858
929
|
unmount: t,
|
|
859
|
-
duration:
|
|
860
|
-
easing:
|
|
861
|
-
offset:
|
|
862
|
-
animateOpacity:
|
|
863
|
-
children: /* @__PURE__ */
|
|
930
|
+
duration: p,
|
|
931
|
+
easing: $,
|
|
932
|
+
offset: y,
|
|
933
|
+
animateOpacity: N,
|
|
934
|
+
children: /* @__PURE__ */ h.jsxs(
|
|
864
935
|
"div",
|
|
865
936
|
{
|
|
937
|
+
onScroll: Te,
|
|
938
|
+
tabIndex: "-1",
|
|
866
939
|
className: "rac-select-list",
|
|
867
940
|
role: "listbox",
|
|
868
941
|
"aria-label": "Options",
|
|
869
|
-
children:
|
|
942
|
+
children: [
|
|
943
|
+
Oe,
|
|
944
|
+
!w && S ? /* @__PURE__ */ h.jsxs(
|
|
945
|
+
"div",
|
|
946
|
+
{
|
|
947
|
+
onClick: (o) => o.stopPropagation(),
|
|
948
|
+
onMouseEnter: (o) => o.preventDefault(),
|
|
949
|
+
className: "rac-select-option rac-disabled-option rac-loading-option",
|
|
950
|
+
children: [
|
|
951
|
+
/* @__PURE__ */ h.jsx(
|
|
952
|
+
"span",
|
|
953
|
+
{
|
|
954
|
+
className: "rac-loading-option-title",
|
|
955
|
+
children: "Loading"
|
|
956
|
+
}
|
|
957
|
+
),
|
|
958
|
+
/* @__PURE__ */ h.jsxs("span", { className: "rac-loading-dots", children: [
|
|
959
|
+
/* @__PURE__ */ h.jsx("i", {}),
|
|
960
|
+
/* @__PURE__ */ h.jsx("i", {}),
|
|
961
|
+
/* @__PURE__ */ h.jsx("i", {})
|
|
962
|
+
] })
|
|
963
|
+
]
|
|
964
|
+
}
|
|
965
|
+
) : null
|
|
966
|
+
]
|
|
870
967
|
}
|
|
871
968
|
)
|
|
872
969
|
}
|
|
@@ -877,23 +974,23 @@ Expected %cArray%c or %cObject%c, but received %c${typeof g}%c.
|
|
|
877
974
|
]
|
|
878
975
|
}
|
|
879
976
|
);
|
|
880
|
-
}),
|
|
881
|
-
function
|
|
882
|
-
const
|
|
883
|
-
return
|
|
884
|
-
if (!
|
|
885
|
-
const
|
|
886
|
-
id: String(
|
|
887
|
-
value: t !== void 0 ? t :
|
|
888
|
-
label:
|
|
889
|
-
jsx:
|
|
890
|
-
className:
|
|
891
|
-
disabled: !!
|
|
977
|
+
}), ue = (t) => t ? typeof t == "string" || typeof t == "number" ? String(t) : Array.isArray(t) ? t.map(ue).join(" ").replace(/\s+/g, " ").trim() : _e.isValidElement(t) ? ue(t.props.children) : "" : "";
|
|
978
|
+
function tr({ value: t, id: s, className: c, children: i, disabled: b }) {
|
|
979
|
+
const d = ze($e);
|
|
980
|
+
return z(() => {
|
|
981
|
+
if (!d) return;
|
|
982
|
+
const p = ue(i), $ = typeof i == "string" && i !== "" ? i : p || String(t ?? s ?? ""), y = {
|
|
983
|
+
id: String(s ?? ce(String(p))),
|
|
984
|
+
value: t !== void 0 ? t : p,
|
|
985
|
+
label: $,
|
|
986
|
+
jsx: i,
|
|
987
|
+
className: c,
|
|
988
|
+
disabled: !!b
|
|
892
989
|
};
|
|
893
|
-
return
|
|
894
|
-
}, [
|
|
990
|
+
return d.registerOption(y), () => d.unregisterOption(y.id);
|
|
991
|
+
}, [s, t, i, c, b]), null;
|
|
895
992
|
}
|
|
896
993
|
export {
|
|
897
|
-
|
|
898
|
-
|
|
994
|
+
tr as Option,
|
|
995
|
+
rr as Select
|
|
899
996
|
};
|