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