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