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