@commercetools/nimbus 0.0.0-canary-20251023151517 → 0.0.0-canary-20251023154609
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/{draggable-list-CvV3nvYT.cjs.js → draggable-list-CdReG0dt.cjs.js} +3 -3
- package/dist/chunks/draggable-list-CdReG0dt.cjs.js.map +1 -0
- package/dist/chunks/{draggable-list-BVbOhuq3.es.js → draggable-list-D1fi4DB4.es.js} +1222 -1148
- package/dist/chunks/draggable-list-D1fi4DB4.es.js.map +1 -0
- package/dist/components/draggable-list/components/draggable-list.root.d.ts +1 -1
- package/dist/components/draggable-list/draggable-list.d.ts +1 -1
- package/dist/components/draggable-list/draggable-list.types.d.ts +22 -0
- package/dist/components/draggable-list.cjs +1 -1
- package/dist/components/draggable-list.es.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.es.js +1 -1
- package/package.json +6 -5
- package/dist/chunks/draggable-list-BVbOhuq3.es.js.map +0 -1
- package/dist/chunks/draggable-list-CvV3nvYT.cjs.js.map +0 -1
|
@@ -1,168 +1,168 @@
|
|
|
1
|
-
import { jsx as w, jsxs as
|
|
2
|
-
import A, { useState as X, useEffect as
|
|
3
|
-
import { defineMessages as
|
|
4
|
-
import { $ as
|
|
5
|
-
import { b as
|
|
6
|
-
import { f as
|
|
7
|
-
import { a as
|
|
8
|
-
import { $ as
|
|
9
|
-
import { a as
|
|
10
|
-
import { a as
|
|
11
|
-
import { $ as
|
|
12
|
-
import { $ as
|
|
13
|
-
import { c as
|
|
14
|
-
import { $ as
|
|
15
|
-
import { $ as
|
|
16
|
-
import { $ as
|
|
17
|
-
import { b as
|
|
18
|
-
import { $ as
|
|
19
|
-
import { $ as
|
|
20
|
-
import { $ as
|
|
21
|
-
import { b as
|
|
22
|
-
import { a as
|
|
23
|
-
import { $ as
|
|
24
|
-
import { $ as
|
|
25
|
-
import { $ as
|
|
26
|
-
import { $ as
|
|
27
|
-
import { f as
|
|
28
|
-
import { $ as
|
|
29
|
-
import { d as
|
|
30
|
-
import { $ as
|
|
31
|
-
import { b as
|
|
32
|
-
import { b as
|
|
33
|
-
import { $ as
|
|
34
|
-
import { $ as
|
|
35
|
-
import { flushSync as
|
|
36
|
-
import { useSlotRecipe as
|
|
37
|
-
import { e as
|
|
38
|
-
import { createSlotRecipeContext as
|
|
39
|
-
import { DragIndicator as
|
|
40
|
-
import { C as
|
|
41
|
-
import { I as
|
|
1
|
+
import { jsx as w, jsxs as We, Fragment as dt } from "react/jsx-runtime";
|
|
2
|
+
import A, { useState as X, useEffect as L, useRef as S, version as st, useCallback as J, useImperativeHandle as ct, useMemo as Ke, forwardRef as Qe, useContext as W, createContext as pt, createElement as Dt } from "react";
|
|
3
|
+
import { defineMessages as gt, useIntl as _e } from "react-intl";
|
|
4
|
+
import { $ as mt } from "./Button-CafJrK0a.es.js";
|
|
5
|
+
import { b as ft, a as eu, c as Bt } from "./RSPContexts-DV4cFLUV.es.js";
|
|
6
|
+
import { f as xt, h as ke, k as bt } from "./SelectionManager-Dn0USbbI.es.js";
|
|
7
|
+
import { a as Pe, d as uu, f as be, $ as tu } from "./utils-DF3YB901.es.js";
|
|
8
|
+
import { $ as fe, b as Et, a as Ct, c as $t, d as gn } from "./DragAndDrop-CMsguxa3.es.js";
|
|
9
|
+
import { a as Ae } from "./ListBox-C4BToxCj.es.js";
|
|
10
|
+
import { a as yt, $ as vt } from "./SelectionIndicator-B27AsfqE.es.js";
|
|
11
|
+
import { $ as ht } from "./Text-DOcU1ycg.es.js";
|
|
12
|
+
import { $ as kt, e as At, f as Tt, g as Ft, h as bn } from "./CollectionBuilder-D6lZ-33j.es.js";
|
|
13
|
+
import { c as ee, b as ru, $ as nu, a as Ie } from "./mergeProps-_eTFpDiB.es.js";
|
|
14
|
+
import { $ as ou } from "./filterDOMProps-BSVCO5jK.es.js";
|
|
15
|
+
import { $ as iu } from "./useObjectRef-CaJ5pgjX.es.js";
|
|
16
|
+
import { $ as vn } from "./inertValue-B7loUihk.es.js";
|
|
17
|
+
import { b as St, a as Kt, $ as Pt } from "./useGridListItem-Cr6HZ3kJ.es.js";
|
|
18
|
+
import { $ as It } from "./useGridSelectionCheckbox-Cb6QZ_p2.es.js";
|
|
19
|
+
import { $ as zt } from "./useHover-CKzcGypZ.es.js";
|
|
20
|
+
import { $ as au } from "./useFocusRing-BOzVUoTi.es.js";
|
|
21
|
+
import { b as wt } from "./FocusScope-CZUuDxle.es.js";
|
|
22
|
+
import { a as ze } from "./VisuallyHidden-D6n3An4K.es.js";
|
|
23
|
+
import { $ as Ot, a as Vt } from "./useListState-DXCqV37_.es.js";
|
|
24
|
+
import { $ as jt } from "./useCollator-BjnMaGJd.es.js";
|
|
25
|
+
import { $ as lu } from "./context-DW7UvQ8z.es.js";
|
|
26
|
+
import { $ as Me } from "./ListKeyboardDelegate-D7v3HUvw.es.js";
|
|
27
|
+
import { f as Lt, b as Rt, e as du, d as su, c as oe } from "./useFocusVisible-BLRuz6I4.es.js";
|
|
28
|
+
import { $ as ie } from "./LiveAnnouncer-CsPyaceH.es.js";
|
|
29
|
+
import { d as Mt } from "./Dialog-Cx5MzP6O.es.js";
|
|
30
|
+
import { $ as Nt } from "./getScrollParent-DWQTVYMz.es.js";
|
|
31
|
+
import { b as we, $ as Ht } from "./scrollIntoView-CaRCBiMb.es.js";
|
|
32
|
+
import { b as Ut, c as qt, a as Gt, f as Xt } from "./platform-Z5fvtFmM.es.js";
|
|
33
|
+
import { $ as Be } from "./useLocalizedStringFormatter-DaRRUvyV.es.js";
|
|
34
|
+
import { $ as Yt } from "./useGlobalListeners-BOOfV5Wh.es.js";
|
|
35
|
+
import { flushSync as Zt } from "react-dom";
|
|
36
|
+
import { useSlotRecipe as Jt } from "@chakra-ui/react/styled-system";
|
|
37
|
+
import { e as cu } from "./extract-style-props-CTU5PJnh.es.js";
|
|
38
|
+
import { createSlotRecipeContext as Wt } from "@chakra-ui/react";
|
|
39
|
+
import { DragIndicator as Qt, Close as _t } from "@commercetools/nimbus-icons";
|
|
40
|
+
import { C as er } from "./checkbox-B-1U4AKF.es.js";
|
|
41
|
+
import { I as Ne } from "./icon-button-CNauu_zf.es.js";
|
|
42
42
|
import { F as Y } from "./form-field-CH7MhZMM.es.js";
|
|
43
43
|
var I = /* @__PURE__ */ (function(e) {
|
|
44
44
|
return e[e.none = 0] = "none", e[e.cancel = 0] = "cancel", e[e.move = 1] = "move", e[e.copy = 2] = "copy", e[e.link = 4] = "link", e[e.all = 7] = "all", e;
|
|
45
45
|
})({});
|
|
46
|
-
const
|
|
46
|
+
const pu = {
|
|
47
47
|
...I,
|
|
48
48
|
copyMove: 3,
|
|
49
49
|
copyLink: 6,
|
|
50
50
|
linkMove: 5,
|
|
51
51
|
all: 7,
|
|
52
52
|
uninitialized: 7
|
|
53
|
-
},
|
|
54
|
-
|
|
55
|
-
const
|
|
53
|
+
}, Du = /* @__PURE__ */ gu(pu);
|
|
54
|
+
Du[7] = "all";
|
|
55
|
+
const te = {
|
|
56
56
|
none: "cancel",
|
|
57
57
|
link: "link",
|
|
58
58
|
copy: "copy",
|
|
59
59
|
move: "move"
|
|
60
|
-
},
|
|
61
|
-
function
|
|
60
|
+
}, Ee = /* @__PURE__ */ gu(te);
|
|
61
|
+
function gu(e) {
|
|
62
62
|
let u = {};
|
|
63
63
|
for (let r in e) u[e[r]] = r;
|
|
64
64
|
return u;
|
|
65
65
|
}
|
|
66
|
-
const
|
|
66
|
+
const ur = /* @__PURE__ */ new Set([
|
|
67
67
|
"text/plain",
|
|
68
68
|
"text/uri-list",
|
|
69
69
|
"text/html"
|
|
70
|
-
]),
|
|
71
|
-
function
|
|
72
|
-
let { id: u } =
|
|
70
|
+
]), pe = "application/vnd.react-aria.items+json", De = "application/octet-stream", Oe = /* @__PURE__ */ new WeakMap(), mu = /* @__PURE__ */ Symbol();
|
|
71
|
+
function tr(e) {
|
|
72
|
+
let { id: u } = Oe.get(e) || {};
|
|
73
73
|
if (!u) throw new Error("Droppable item outside a droppable collection");
|
|
74
74
|
return u;
|
|
75
75
|
}
|
|
76
|
-
function
|
|
77
|
-
let { ref: u } =
|
|
76
|
+
function rr(e) {
|
|
77
|
+
let { ref: u } = Oe.get(e) || {};
|
|
78
78
|
if (!u) throw new Error("Droppable item outside a droppable collection");
|
|
79
79
|
return u;
|
|
80
80
|
}
|
|
81
|
-
function
|
|
81
|
+
function G(e) {
|
|
82
82
|
let u = /* @__PURE__ */ new Set();
|
|
83
83
|
for (let r of e) for (let t of Object.keys(r)) u.add(t);
|
|
84
84
|
return u;
|
|
85
85
|
}
|
|
86
|
-
function
|
|
86
|
+
function fu(e) {
|
|
87
87
|
return e || (e = "virtual"), e === "pointer" && (e = "virtual"), e === "virtual" && typeof window < "u" && "ontouchstart" in window && (e = "touch"), e;
|
|
88
88
|
}
|
|
89
|
-
function
|
|
90
|
-
return
|
|
89
|
+
function Ve() {
|
|
90
|
+
return fu(Lt());
|
|
91
91
|
}
|
|
92
|
-
function
|
|
93
|
-
return
|
|
92
|
+
function Bu() {
|
|
93
|
+
return fu(Rt());
|
|
94
94
|
}
|
|
95
|
-
function
|
|
96
|
-
let r = /* @__PURE__ */ new Map(), t = !1,
|
|
97
|
-
for (let
|
|
98
|
-
let a = Object.keys(
|
|
95
|
+
function nr(e, u) {
|
|
96
|
+
let r = /* @__PURE__ */ new Map(), t = !1, n = [];
|
|
97
|
+
for (let o of u) {
|
|
98
|
+
let a = Object.keys(o);
|
|
99
99
|
a.length > 1 && (t = !0);
|
|
100
100
|
let l = {};
|
|
101
101
|
for (let m of a) {
|
|
102
|
-
let
|
|
103
|
-
|
|
104
|
-
let
|
|
105
|
-
l[m] =
|
|
102
|
+
let g = r.get(m);
|
|
103
|
+
g ? t = !0 : (g = [], r.set(m, g));
|
|
104
|
+
let c = o[m];
|
|
105
|
+
l[m] = c, g.push(c);
|
|
106
106
|
}
|
|
107
|
-
|
|
107
|
+
n.push(l);
|
|
108
108
|
}
|
|
109
|
-
for (let [
|
|
109
|
+
for (let [o, a] of r) if (ur.has(o)) {
|
|
110
110
|
let l = a.join(`
|
|
111
111
|
`);
|
|
112
|
-
e.items.add(l,
|
|
112
|
+
e.items.add(l, o);
|
|
113
113
|
} else
|
|
114
|
-
e.items.add(a[0],
|
|
114
|
+
e.items.add(a[0], o);
|
|
115
115
|
if (t) {
|
|
116
|
-
let
|
|
117
|
-
e.items.add(
|
|
116
|
+
let o = JSON.stringify(n);
|
|
117
|
+
e.items.add(o, pe);
|
|
118
118
|
}
|
|
119
119
|
}
|
|
120
|
-
class
|
|
120
|
+
class ae {
|
|
121
121
|
has(u) {
|
|
122
|
-
return this.includesUnknownTypes || u ===
|
|
122
|
+
return this.includesUnknownTypes || u === mu && this.types.has(De) ? !0 : typeof u == "string" && this.types.has(u);
|
|
123
123
|
}
|
|
124
124
|
constructor(u) {
|
|
125
125
|
this.types = /* @__PURE__ */ new Set();
|
|
126
126
|
let r = !1;
|
|
127
|
-
for (let t of u.items) t.type !==
|
|
127
|
+
for (let t of u.items) t.type !== pe && (t.kind === "file" && (r = !0), t.type ? this.types.add(t.type) : this.types.add(De));
|
|
128
128
|
this.includesUnknownTypes = !r && u.types.includes("Files");
|
|
129
129
|
}
|
|
130
130
|
}
|
|
131
|
-
function
|
|
131
|
+
function or(e) {
|
|
132
132
|
let u = [];
|
|
133
133
|
if (!e) return u;
|
|
134
134
|
let r = !1;
|
|
135
|
-
if (e.types.includes(
|
|
136
|
-
let t = e.getData(
|
|
137
|
-
for (let
|
|
135
|
+
if (e.types.includes(pe)) try {
|
|
136
|
+
let t = e.getData(pe), n = JSON.parse(t);
|
|
137
|
+
for (let o of n) u.push({
|
|
138
138
|
kind: "text",
|
|
139
|
-
types: new Set(Object.keys(
|
|
140
|
-
getText: (a) => Promise.resolve(
|
|
139
|
+
types: new Set(Object.keys(o)),
|
|
140
|
+
getText: (a) => Promise.resolve(o[a])
|
|
141
141
|
});
|
|
142
142
|
r = !0;
|
|
143
143
|
} catch {
|
|
144
144
|
}
|
|
145
145
|
if (!r) {
|
|
146
146
|
let t = /* @__PURE__ */ new Map();
|
|
147
|
-
for (let
|
|
148
|
-
if (
|
|
149
|
-
t.set(
|
|
150
|
-
else if (
|
|
151
|
-
if (typeof
|
|
152
|
-
let
|
|
153
|
-
if (!
|
|
154
|
-
|
|
147
|
+
for (let n of e.items)
|
|
148
|
+
if (n.kind === "string")
|
|
149
|
+
t.set(n.type || De, e.getData(n.type));
|
|
150
|
+
else if (n.kind === "file")
|
|
151
|
+
if (typeof n.webkitGetAsEntry == "function") {
|
|
152
|
+
let o = n.webkitGetAsEntry();
|
|
153
|
+
if (!o) continue;
|
|
154
|
+
o.isFile ? u.push(Te(n.getAsFile())) : o.isDirectory && u.push(xu(o));
|
|
155
155
|
} else
|
|
156
|
-
u.push(
|
|
156
|
+
u.push(Te(n.getAsFile()));
|
|
157
157
|
t.size > 0 && u.push({
|
|
158
158
|
kind: "text",
|
|
159
159
|
types: new Set(t.keys()),
|
|
160
|
-
getText: (
|
|
160
|
+
getText: (n) => Promise.resolve(t.get(n))
|
|
161
161
|
});
|
|
162
162
|
}
|
|
163
163
|
return u;
|
|
164
164
|
}
|
|
165
|
-
function
|
|
165
|
+
function ir(e) {
|
|
166
166
|
return typeof e.text == "function" ? e.text() : new Promise((u, r) => {
|
|
167
167
|
let t = new FileReader();
|
|
168
168
|
t.onload = () => {
|
|
@@ -170,109 +170,109 @@ function rr(e) {
|
|
|
170
170
|
}, t.onerror = r, t.readAsText(e);
|
|
171
171
|
});
|
|
172
172
|
}
|
|
173
|
-
function
|
|
173
|
+
function Te(e) {
|
|
174
174
|
if (!e) throw new Error("No file provided");
|
|
175
175
|
return {
|
|
176
176
|
kind: "file",
|
|
177
|
-
type: e.type ||
|
|
177
|
+
type: e.type || De,
|
|
178
178
|
name: e.name,
|
|
179
|
-
getText: () =>
|
|
179
|
+
getText: () => ir(e),
|
|
180
180
|
getFile: () => Promise.resolve(e)
|
|
181
181
|
};
|
|
182
182
|
}
|
|
183
|
-
function
|
|
183
|
+
function xu(e) {
|
|
184
184
|
return {
|
|
185
185
|
kind: "directory",
|
|
186
186
|
name: e.name,
|
|
187
|
-
getEntries: () =>
|
|
187
|
+
getEntries: () => ar(e)
|
|
188
188
|
};
|
|
189
189
|
}
|
|
190
|
-
async function*
|
|
190
|
+
async function* ar(e) {
|
|
191
191
|
let u = e.createReader(), r;
|
|
192
192
|
do {
|
|
193
|
-
r = await new Promise((t,
|
|
194
|
-
u.readEntries(t,
|
|
193
|
+
r = await new Promise((t, n) => {
|
|
194
|
+
u.readEntries(t, n);
|
|
195
195
|
});
|
|
196
196
|
for (let t of r)
|
|
197
197
|
if (t.isFile) {
|
|
198
|
-
let
|
|
199
|
-
yield
|
|
200
|
-
} else t.isDirectory && (yield
|
|
198
|
+
let n = await lr(t);
|
|
199
|
+
yield Te(n);
|
|
200
|
+
} else t.isDirectory && (yield xu(t));
|
|
201
201
|
} while (r.length > 0);
|
|
202
202
|
}
|
|
203
|
-
function
|
|
203
|
+
function lr(e) {
|
|
204
204
|
return new Promise((u, r) => e.file(u, r));
|
|
205
205
|
}
|
|
206
|
-
function
|
|
206
|
+
function He(e) {
|
|
207
207
|
return e.kind === "text";
|
|
208
208
|
}
|
|
209
209
|
let z = {
|
|
210
210
|
draggingKeys: /* @__PURE__ */ new Set()
|
|
211
211
|
};
|
|
212
|
-
function
|
|
212
|
+
function dr(e) {
|
|
213
213
|
z.draggingCollectionRef = e;
|
|
214
214
|
}
|
|
215
|
-
function
|
|
215
|
+
function sr(e) {
|
|
216
216
|
z.draggingKeys = e;
|
|
217
217
|
}
|
|
218
218
|
function Z(e) {
|
|
219
219
|
z.dropCollectionRef = e;
|
|
220
220
|
}
|
|
221
|
-
function
|
|
221
|
+
function bu() {
|
|
222
222
|
z = {
|
|
223
223
|
draggingKeys: /* @__PURE__ */ new Set()
|
|
224
224
|
};
|
|
225
225
|
}
|
|
226
|
-
function
|
|
226
|
+
function cr(e) {
|
|
227
227
|
z = e;
|
|
228
228
|
}
|
|
229
229
|
function H(e) {
|
|
230
230
|
let { draggingCollectionRef: u, dropCollectionRef: r } = z;
|
|
231
231
|
return u?.current != null && u.current === (e?.current || r?.current);
|
|
232
232
|
}
|
|
233
|
-
let
|
|
234
|
-
function
|
|
235
|
-
|
|
233
|
+
let ce;
|
|
234
|
+
function ge(e) {
|
|
235
|
+
ce = e;
|
|
236
236
|
}
|
|
237
|
-
let
|
|
238
|
-
function
|
|
239
|
-
|
|
237
|
+
let Fe = I.none;
|
|
238
|
+
function Ce(e) {
|
|
239
|
+
Fe = e;
|
|
240
240
|
}
|
|
241
|
-
let
|
|
242
|
-
function
|
|
243
|
-
return
|
|
244
|
-
|
|
241
|
+
let Se = /* @__PURE__ */ new Map(), re = /* @__PURE__ */ new Map(), j = null, me = /* @__PURE__ */ new Set();
|
|
242
|
+
function Eu(e) {
|
|
243
|
+
return Se.set(e.element, e), j?.updateValidDropTargets(), () => {
|
|
244
|
+
Se.delete(e.element), j?.updateValidDropTargets();
|
|
245
245
|
};
|
|
246
246
|
}
|
|
247
|
-
function
|
|
248
|
-
return
|
|
249
|
-
|
|
247
|
+
function pr(e) {
|
|
248
|
+
return re.set(e.element, e), () => {
|
|
249
|
+
re.delete(e.element);
|
|
250
250
|
};
|
|
251
251
|
}
|
|
252
|
-
function
|
|
252
|
+
function Dr(e, u) {
|
|
253
253
|
if (j) throw new Error("Cannot begin dragging while already dragging");
|
|
254
|
-
j = new
|
|
255
|
-
j && (j.setup(),
|
|
254
|
+
j = new xr(e, u), requestAnimationFrame(() => {
|
|
255
|
+
j && (j.setup(), Bu() === "keyboard" && j.next());
|
|
256
256
|
});
|
|
257
|
-
for (let r of
|
|
257
|
+
for (let r of me) r();
|
|
258
258
|
}
|
|
259
|
-
function
|
|
259
|
+
function je() {
|
|
260
260
|
let [e, u] = X(j);
|
|
261
|
-
return
|
|
261
|
+
return L(() => {
|
|
262
262
|
let r = () => u(j);
|
|
263
|
-
return
|
|
264
|
-
|
|
263
|
+
return me.add(r), () => {
|
|
264
|
+
me.delete(r);
|
|
265
265
|
};
|
|
266
266
|
}, []), e;
|
|
267
267
|
}
|
|
268
|
-
function
|
|
268
|
+
function gr() {
|
|
269
269
|
return !!j;
|
|
270
270
|
}
|
|
271
|
-
function
|
|
271
|
+
function mr() {
|
|
272
272
|
j = null;
|
|
273
|
-
for (let e of
|
|
273
|
+
for (let e of me) e();
|
|
274
274
|
}
|
|
275
|
-
const
|
|
275
|
+
const Ue = [
|
|
276
276
|
"pointerdown",
|
|
277
277
|
"pointermove",
|
|
278
278
|
"pointerenter",
|
|
@@ -292,25 +292,25 @@ const He = [
|
|
|
292
292
|
"touchend",
|
|
293
293
|
"focusin",
|
|
294
294
|
"focusout"
|
|
295
|
-
],
|
|
295
|
+
], fr = [
|
|
296
296
|
"pointerup",
|
|
297
297
|
"mouseup",
|
|
298
298
|
"touchend"
|
|
299
|
-
],
|
|
299
|
+
], Br = {
|
|
300
300
|
keyboard: "dragStartedKeyboard",
|
|
301
301
|
touch: "dragStartedTouch",
|
|
302
302
|
virtual: "dragStartedVirtual"
|
|
303
303
|
};
|
|
304
|
-
class
|
|
304
|
+
class xr {
|
|
305
305
|
setup() {
|
|
306
306
|
document.addEventListener("keydown", this.onKeyDown, !0), document.addEventListener("keyup", this.onKeyUp, !0), window.addEventListener("focus", this.onFocus, !0), window.addEventListener("blur", this.onBlur, !0), document.addEventListener("click", this.onClick, !0), document.addEventListener("pointerdown", this.onPointerDown, !0);
|
|
307
|
-
for (let u of
|
|
308
|
-
this.mutationObserver = new MutationObserver(() => this.updateValidDropTargets()), this.updateValidDropTargets(),
|
|
307
|
+
for (let u of Ue) document.addEventListener(u, this.cancelEvent, !0);
|
|
308
|
+
this.mutationObserver = new MutationObserver(() => this.updateValidDropTargets()), this.updateValidDropTargets(), ie(this.stringFormatter.format(Br[Bu()]));
|
|
309
309
|
}
|
|
310
310
|
teardown() {
|
|
311
311
|
var u, r, t;
|
|
312
312
|
document.removeEventListener("keydown", this.onKeyDown, !0), document.removeEventListener("keyup", this.onKeyUp, !0), window.removeEventListener("focus", this.onFocus, !0), window.removeEventListener("blur", this.onBlur, !0), document.removeEventListener("click", this.onClick, !0), document.removeEventListener("pointerdown", this.onPointerDown, !0);
|
|
313
|
-
for (let
|
|
313
|
+
for (let n of Ue) document.removeEventListener(n, this.cancelEvent, !0);
|
|
314
314
|
(u = this.mutationObserver) === null || u === void 0 || u.disconnect(), (r = (t = this).restoreAriaHidden) === null || r === void 0 || r.call(t);
|
|
315
315
|
}
|
|
316
316
|
onKeyDown(u) {
|
|
@@ -328,8 +328,8 @@ class mr {
|
|
|
328
328
|
}
|
|
329
329
|
}
|
|
330
330
|
getCurrentActivateButton() {
|
|
331
|
-
var u, r, t,
|
|
332
|
-
return (a = (
|
|
331
|
+
var u, r, t, n, o, a;
|
|
332
|
+
return (a = (o = (r = this.currentDropItem) === null || r === void 0 || (u = r.activateButtonRef) === null || u === void 0 ? void 0 : u.current) !== null && o !== void 0 ? o : (n = this.currentDropTarget) === null || n === void 0 || (t = n.activateButtonRef) === null || t === void 0 ? void 0 : t.current) !== null && a !== void 0 ? a : null;
|
|
333
333
|
}
|
|
334
334
|
onFocus(u) {
|
|
335
335
|
let r = this.getCurrentActivateButton();
|
|
@@ -338,13 +338,13 @@ class mr {
|
|
|
338
338
|
return;
|
|
339
339
|
}
|
|
340
340
|
if (u.target !== this.dragTarget.element && this.cancelEvent(u), !(u.target instanceof HTMLElement) || u.target === this.dragTarget.element) return;
|
|
341
|
-
let t = this.validDropTargets.find((
|
|
341
|
+
let t = this.validDropTargets.find((o) => o.element === u.target) || this.validDropTargets.find((o) => o.element.contains(u.target));
|
|
342
342
|
if (!t) {
|
|
343
343
|
this.currentDropTarget ? this.currentDropTarget.element.focus() : this.dragTarget.element.focus();
|
|
344
344
|
return;
|
|
345
345
|
}
|
|
346
|
-
let
|
|
347
|
-
t && this.setCurrentDropTarget(t,
|
|
346
|
+
let n = re.get(u.target);
|
|
347
|
+
t && this.setCurrentDropTarget(t, n);
|
|
348
348
|
}
|
|
349
349
|
onBlur(u) {
|
|
350
350
|
let r = this.getCurrentActivateButton();
|
|
@@ -355,16 +355,16 @@ class mr {
|
|
|
355
355
|
u.target !== this.dragTarget.element && this.cancelEvent(u), (!u.relatedTarget || !(u.relatedTarget instanceof HTMLElement)) && (this.currentDropTarget ? this.currentDropTarget.element.focus() : this.dragTarget.element.focus());
|
|
356
356
|
}
|
|
357
357
|
onClick(u) {
|
|
358
|
-
if (this.cancelEvent(u),
|
|
358
|
+
if (this.cancelEvent(u), du(u) || this.isVirtualClick) {
|
|
359
359
|
var r, t;
|
|
360
360
|
let a = [
|
|
361
|
-
...
|
|
362
|
-
].find((
|
|
363
|
-
var
|
|
364
|
-
return
|
|
365
|
-
}), l = this.validDropTargets.find((
|
|
366
|
-
var
|
|
367
|
-
let m = (
|
|
361
|
+
...re.values()
|
|
362
|
+
].find((g) => {
|
|
363
|
+
var c, B;
|
|
364
|
+
return g.element === u.target || ((B = g.activateButtonRef) === null || B === void 0 || (c = B.current) === null || c === void 0 ? void 0 : c.contains(u.target));
|
|
365
|
+
}), l = this.validDropTargets.find((g) => g.element.contains(u.target));
|
|
366
|
+
var n;
|
|
367
|
+
let m = (n = a == null || (r = a.activateButtonRef) === null || r === void 0 ? void 0 : r.current) !== null && n !== void 0 ? n : l == null || (t = l.activateButtonRef) === null || t === void 0 ? void 0 : t.current;
|
|
368
368
|
if (m?.contains(u.target) && l) {
|
|
369
369
|
this.activate(l, a);
|
|
370
370
|
return;
|
|
@@ -377,43 +377,43 @@ class mr {
|
|
|
377
377
|
}
|
|
378
378
|
}
|
|
379
379
|
onPointerDown(u) {
|
|
380
|
-
this.cancelEvent(u), this.isVirtualClick =
|
|
380
|
+
this.cancelEvent(u), this.isVirtualClick = su(u);
|
|
381
381
|
}
|
|
382
382
|
cancelEvent(u) {
|
|
383
383
|
var r;
|
|
384
|
-
(u.type === "focusin" || u.type === "focusout") && (u.target === ((r = this.dragTarget) === null || r === void 0 ? void 0 : r.element) || u.target === this.getCurrentActivateButton()) || (
|
|
384
|
+
(u.type === "focusin" || u.type === "focusout") && (u.target === ((r = this.dragTarget) === null || r === void 0 ? void 0 : r.element) || u.target === this.getCurrentActivateButton()) || (fr.includes(u.type) || u.preventDefault(), u.stopPropagation(), u.stopImmediatePropagation());
|
|
385
385
|
}
|
|
386
386
|
updateValidDropTargets() {
|
|
387
387
|
if (!this.mutationObserver) return;
|
|
388
|
-
if (this.mutationObserver.disconnect(), this.restoreAriaHidden && this.restoreAriaHidden(), this.validDropTargets =
|
|
389
|
-
let
|
|
388
|
+
if (this.mutationObserver.disconnect(), this.restoreAriaHidden && this.restoreAriaHidden(), this.validDropTargets = br(this.dragTarget), this.validDropTargets.length > 0) {
|
|
389
|
+
let n = this.findNearestDropTarget();
|
|
390
390
|
this.validDropTargets = [
|
|
391
|
-
...this.validDropTargets.slice(
|
|
392
|
-
...this.validDropTargets.slice(0,
|
|
391
|
+
...this.validDropTargets.slice(n),
|
|
392
|
+
...this.validDropTargets.slice(0, n)
|
|
393
393
|
];
|
|
394
394
|
}
|
|
395
395
|
this.currentDropTarget && !this.validDropTargets.includes(this.currentDropTarget) && this.setCurrentDropTarget(this.validDropTargets[0]);
|
|
396
|
-
let u =
|
|
397
|
-
...
|
|
398
|
-
].filter((
|
|
399
|
-
this.restoreAriaHidden =
|
|
396
|
+
let u = G(this.dragTarget.items), r = [
|
|
397
|
+
...re.values()
|
|
398
|
+
].filter((n) => typeof n.getDropOperation == "function" ? n.getDropOperation(u, this.dragTarget.allowedDropOperations) !== "cancel" : !0), t = this.validDropTargets.filter((n) => !r.some((o) => n.element.contains(o.element)));
|
|
399
|
+
this.restoreAriaHidden = Mt([
|
|
400
400
|
this.dragTarget.element,
|
|
401
|
-
...r.flatMap((
|
|
402
|
-
var
|
|
403
|
-
return !((
|
|
404
|
-
|
|
405
|
-
(a =
|
|
401
|
+
...r.flatMap((n) => {
|
|
402
|
+
var o, a;
|
|
403
|
+
return !((o = n.activateButtonRef) === null || o === void 0) && o.current ? [
|
|
404
|
+
n.element,
|
|
405
|
+
(a = n.activateButtonRef) === null || a === void 0 ? void 0 : a.current
|
|
406
406
|
] : [
|
|
407
|
-
|
|
407
|
+
n.element
|
|
408
408
|
];
|
|
409
409
|
}),
|
|
410
|
-
...t.flatMap((
|
|
411
|
-
var
|
|
412
|
-
return !((
|
|
413
|
-
|
|
414
|
-
(a =
|
|
410
|
+
...t.flatMap((n) => {
|
|
411
|
+
var o, a;
|
|
412
|
+
return !((o = n.activateButtonRef) === null || o === void 0) && o.current ? [
|
|
413
|
+
n.element,
|
|
414
|
+
(a = n.activateButtonRef) === null || a === void 0 ? void 0 : a.current
|
|
415
415
|
] : [
|
|
416
|
-
|
|
416
|
+
n.element
|
|
417
417
|
];
|
|
418
418
|
})
|
|
419
419
|
], {
|
|
@@ -453,9 +453,9 @@ class mr {
|
|
|
453
453
|
}
|
|
454
454
|
findNearestDropTarget() {
|
|
455
455
|
let u = this.dragTarget.element.getBoundingClientRect(), r = 1 / 0, t = -1;
|
|
456
|
-
for (let
|
|
457
|
-
let a = this.validDropTargets[
|
|
458
|
-
|
|
456
|
+
for (let n = 0; n < this.validDropTargets.length; n++) {
|
|
457
|
+
let a = this.validDropTargets[n].element.getBoundingClientRect(), l = a.left - u.left, m = a.top - u.top, g = l * l + m * m;
|
|
458
|
+
g < r && (r = g, t = n);
|
|
459
459
|
}
|
|
460
460
|
return t;
|
|
461
461
|
}
|
|
@@ -483,12 +483,12 @@ class mr {
|
|
|
483
483
|
}
|
|
484
484
|
if (r != null && r !== this.currentDropItem && (this.currentDropTarget && typeof this.currentDropTarget.onDropTargetEnter == "function" && this.currentDropTarget.onDropTargetEnter(r.target), r.element.focus(), this.currentDropItem = r, !this.initialFocused)) {
|
|
485
485
|
let t = r?.element.getAttribute("aria-label");
|
|
486
|
-
t &&
|
|
486
|
+
t && ie(t, "polite"), this.initialFocused = !0;
|
|
487
487
|
}
|
|
488
488
|
}
|
|
489
489
|
end() {
|
|
490
490
|
var u;
|
|
491
|
-
if (this.teardown(),
|
|
491
|
+
if (this.teardown(), mr(), typeof this.dragTarget.onDragEnd == "function") {
|
|
492
492
|
let t = (this.currentDropTarget && this.dropOperation !== "cancel" ? this.currentDropTarget : this.dragTarget).element.getBoundingClientRect();
|
|
493
493
|
this.dragTarget.onDragEnd({
|
|
494
494
|
type: "dragend",
|
|
@@ -502,7 +502,7 @@ class mr {
|
|
|
502
502
|
}))), this.setCurrentDropTarget(null);
|
|
503
503
|
}
|
|
504
504
|
cancel() {
|
|
505
|
-
this.setCurrentDropTarget(null), this.end(), this.dragTarget.element.closest('[aria-hidden="true"], [inert]') || this.dragTarget.element.focus(),
|
|
505
|
+
this.setCurrentDropTarget(null), this.end(), this.dragTarget.element.closest('[aria-hidden="true"], [inert]') || this.dragTarget.element.focus(), ie(this.stringFormatter.format("dropCanceled"));
|
|
506
506
|
}
|
|
507
507
|
drop(u) {
|
|
508
508
|
if (!this.currentDropTarget) {
|
|
@@ -510,53 +510,53 @@ class mr {
|
|
|
510
510
|
return;
|
|
511
511
|
}
|
|
512
512
|
if (typeof u?.getDropOperation == "function") {
|
|
513
|
-
let t =
|
|
513
|
+
let t = G(this.dragTarget.items);
|
|
514
514
|
this.dropOperation = u.getDropOperation(t, this.dragTarget.allowedDropOperations);
|
|
515
515
|
} else if (typeof this.currentDropTarget.getDropOperation == "function") {
|
|
516
|
-
let t =
|
|
516
|
+
let t = G(this.dragTarget.items);
|
|
517
517
|
this.dropOperation = this.currentDropTarget.getDropOperation(t, this.dragTarget.allowedDropOperations);
|
|
518
518
|
} else
|
|
519
519
|
this.dropOperation = this.dragTarget.allowedDropOperations[0];
|
|
520
520
|
if (typeof this.currentDropTarget.onDrop == "function") {
|
|
521
|
-
let t = this.dragTarget.items.map((
|
|
521
|
+
let t = this.dragTarget.items.map((o) => ({
|
|
522
522
|
kind: "text",
|
|
523
|
-
types: new Set(Object.keys(
|
|
524
|
-
getText: (a) => Promise.resolve(
|
|
525
|
-
})),
|
|
523
|
+
types: new Set(Object.keys(o)),
|
|
524
|
+
getText: (a) => Promise.resolve(o[a])
|
|
525
|
+
})), n = this.currentDropTarget.element.getBoundingClientRect();
|
|
526
526
|
var r;
|
|
527
527
|
this.currentDropTarget.onDrop({
|
|
528
528
|
type: "drop",
|
|
529
|
-
x:
|
|
530
|
-
y:
|
|
529
|
+
x: n.left + n.width / 2,
|
|
530
|
+
y: n.top + n.height / 2,
|
|
531
531
|
items: t,
|
|
532
532
|
dropOperation: this.dropOperation
|
|
533
533
|
}, (r = u?.target) !== null && r !== void 0 ? r : null);
|
|
534
534
|
}
|
|
535
|
-
this.end(),
|
|
535
|
+
this.end(), ie(this.stringFormatter.format("dropComplete"));
|
|
536
536
|
}
|
|
537
537
|
activate(u, r) {
|
|
538
538
|
if (u && typeof u.onDropActivate == "function") {
|
|
539
539
|
var t;
|
|
540
|
-
let
|
|
540
|
+
let n = (t = r?.target) !== null && t !== void 0 ? t : null, o = u.element.getBoundingClientRect();
|
|
541
541
|
u.onDropActivate({
|
|
542
542
|
type: "dropactivate",
|
|
543
|
-
x:
|
|
544
|
-
y:
|
|
545
|
-
},
|
|
543
|
+
x: o.left + o.width / 2,
|
|
544
|
+
y: o.top + o.height / 2
|
|
545
|
+
}, n);
|
|
546
546
|
}
|
|
547
547
|
}
|
|
548
548
|
constructor(u, r) {
|
|
549
549
|
this.validDropTargets = [], this.currentDropTarget = null, this.currentDropItem = null, this.dropOperation = null, this.mutationObserver = null, this.restoreAriaHidden = null, this.isVirtualClick = !1, this.dragTarget = u, this.stringFormatter = r, this.onKeyDown = this.onKeyDown.bind(this), this.onKeyUp = this.onKeyUp.bind(this), this.onFocus = this.onFocus.bind(this), this.onBlur = this.onBlur.bind(this), this.onClick = this.onClick.bind(this), this.onPointerDown = this.onPointerDown.bind(this), this.cancelEvent = this.cancelEvent.bind(this), this.initialFocused = !1;
|
|
550
550
|
}
|
|
551
551
|
}
|
|
552
|
-
function
|
|
553
|
-
let u =
|
|
552
|
+
function br(e) {
|
|
553
|
+
let u = G(e.items);
|
|
554
554
|
return [
|
|
555
|
-
...
|
|
555
|
+
...Se.values()
|
|
556
556
|
].filter((r) => r.element.closest('[aria-hidden="true"], [inert]') ? !1 : typeof r.getDropOperation == "function" ? r.getDropOperation(u, e.allowedDropOperations) !== "cancel" : !0);
|
|
557
557
|
}
|
|
558
|
-
var
|
|
559
|
-
|
|
558
|
+
var Cu = {};
|
|
559
|
+
Cu = {
|
|
560
560
|
dragDescriptionKeyboard: "اضغط Enter لبدء السحب.",
|
|
561
561
|
dragDescriptionKeyboardAlt: "اضغط على Alt + Enter لبدء السحب.",
|
|
562
562
|
dragDescriptionLongPress: "اضغط باستمرار لبدء السحب.",
|
|
@@ -597,8 +597,8 @@ bu = {
|
|
|
597
597
|
insertBefore: (e) => `أدخل قبل ${e.itemText}`,
|
|
598
598
|
insertBetween: (e) => `أدخل بين ${e.beforeItemText} و ${e.afterItemText}`
|
|
599
599
|
};
|
|
600
|
-
var
|
|
601
|
-
|
|
600
|
+
var $u = {};
|
|
601
|
+
$u = {
|
|
602
602
|
dragDescriptionKeyboard: "Натиснете „Enter“, за да започнете да плъзгате.",
|
|
603
603
|
dragDescriptionKeyboardAlt: "Натиснете Alt + Enter, за да започнете да плъзгате.",
|
|
604
604
|
dragDescriptionLongPress: "Натиснете продължително, за да започнете да плъзгате.",
|
|
@@ -639,8 +639,8 @@ xu = {
|
|
|
639
639
|
insertBefore: (e) => `Вмъкни преди ${e.itemText}`,
|
|
640
640
|
insertBetween: (e) => `Вмъкни между ${e.beforeItemText} и ${e.afterItemText}`
|
|
641
641
|
};
|
|
642
|
-
var
|
|
643
|
-
|
|
642
|
+
var yu = {};
|
|
643
|
+
yu = {
|
|
644
644
|
dragDescriptionKeyboard: "Stisknutím klávesy Enter začnete s přetahováním.",
|
|
645
645
|
dragDescriptionKeyboardAlt: "Stisknutím Alt + Enter zahájíte přetahování.",
|
|
646
646
|
dragDescriptionLongPress: "Dlouhým stisknutím zahájíte přetahování.",
|
|
@@ -682,8 +682,8 @@ Eu = {
|
|
|
682
682
|
insertBefore: (e) => `Vložit před ${e.itemText}`,
|
|
683
683
|
insertBetween: (e) => `Vložit mezi ${e.beforeItemText} a ${e.afterItemText}`
|
|
684
684
|
};
|
|
685
|
-
var
|
|
686
|
-
|
|
685
|
+
var vu = {};
|
|
686
|
+
vu = {
|
|
687
687
|
dragDescriptionKeyboard: "Tryk på Enter for at starte med at trække.",
|
|
688
688
|
dragDescriptionKeyboardAlt: "Tryk på Alt + Enter for at starte med at trække.",
|
|
689
689
|
dragDescriptionLongPress: "Tryk længe for at starte med at trække.",
|
|
@@ -724,8 +724,8 @@ Cu = {
|
|
|
724
724
|
insertBefore: (e) => `Indsæt før ${e.itemText}`,
|
|
725
725
|
insertBetween: (e) => `Indsæt mellem ${e.beforeItemText} og ${e.afterItemText}`
|
|
726
726
|
};
|
|
727
|
-
var
|
|
728
|
-
|
|
727
|
+
var hu = {};
|
|
728
|
+
hu = {
|
|
729
729
|
dragDescriptionKeyboard: "Drücken Sie die Eingabetaste, um den Ziehvorgang zu starten.",
|
|
730
730
|
dragDescriptionKeyboardAlt: "Alt + Eingabe drücken, um den Ziehvorgang zu starten.",
|
|
731
731
|
dragDescriptionLongPress: "Lang drücken, um mit dem Ziehen zu beginnen.",
|
|
@@ -766,8 +766,8 @@ $u = {
|
|
|
766
766
|
insertBefore: (e) => `Vor ${e.itemText} einfügen`,
|
|
767
767
|
insertBetween: (e) => `Zwischen ${e.beforeItemText} und ${e.afterItemText} einfügen`
|
|
768
768
|
};
|
|
769
|
-
var
|
|
770
|
-
|
|
769
|
+
var ku = {};
|
|
770
|
+
ku = {
|
|
771
771
|
dragDescriptionKeyboard: "Πατήστε Enter για έναρξη της μεταφοράς.",
|
|
772
772
|
dragDescriptionKeyboardAlt: "Πατήστε Alt + Enter για έναρξη της μεταφοράς.",
|
|
773
773
|
dragDescriptionLongPress: "Πατήστε παρατεταμένα για να ξεκινήσετε τη μεταφορά.",
|
|
@@ -808,8 +808,8 @@ yu = {
|
|
|
808
808
|
insertBefore: (e) => `Εισαγωγή πριν από ${e.itemText}`,
|
|
809
809
|
insertBetween: (e) => `Εισαγωγή μεταξύ ${e.beforeItemText} και ${e.afterItemText}`
|
|
810
810
|
};
|
|
811
|
-
var
|
|
812
|
-
|
|
811
|
+
var Au = {};
|
|
812
|
+
Au = {
|
|
813
813
|
dragItem: (e) => `Drag ${e.itemText}`,
|
|
814
814
|
dragSelectedItems: (e, u) => `Drag ${u.plural(e.count, {
|
|
815
815
|
one: () => `${u.number(e.count)} selected item`,
|
|
@@ -850,8 +850,8 @@ vu = {
|
|
|
850
850
|
insertBetween: (e) => `Insert between ${e.beforeItemText} and ${e.afterItemText}`,
|
|
851
851
|
insertAfter: (e) => `Insert after ${e.itemText}`
|
|
852
852
|
};
|
|
853
|
-
var
|
|
854
|
-
|
|
853
|
+
var Tu = {};
|
|
854
|
+
Tu = {
|
|
855
855
|
dragDescriptionKeyboard: "Pulse Intro para empezar a arrastrar.",
|
|
856
856
|
dragDescriptionKeyboardAlt: "Pulse Intro para empezar a arrastrar.",
|
|
857
857
|
dragDescriptionLongPress: "Mantenga pulsado para comenzar a arrastrar.",
|
|
@@ -892,8 +892,8 @@ hu = {
|
|
|
892
892
|
insertBefore: (e) => `Insertar antes de ${e.itemText}`,
|
|
893
893
|
insertBetween: (e) => `Insertar entre ${e.beforeItemText} y ${e.afterItemText}`
|
|
894
894
|
};
|
|
895
|
-
var
|
|
896
|
-
|
|
895
|
+
var Fu = {};
|
|
896
|
+
Fu = {
|
|
897
897
|
dragDescriptionKeyboard: "Lohistamise alustamiseks vajutage klahvi Enter.",
|
|
898
898
|
dragDescriptionKeyboardAlt: "Lohistamise alustamiseks vajutage klahvikombinatsiooni Alt + Enter.",
|
|
899
899
|
dragDescriptionLongPress: "Vajutage pikalt lohistamise alustamiseks.",
|
|
@@ -934,8 +934,8 @@ ku = {
|
|
|
934
934
|
insertBefore: (e) => `Sisesta ${e.itemText} ette`,
|
|
935
935
|
insertBetween: (e) => `Sisesta ${e.beforeItemText} ja ${e.afterItemText} vahele`
|
|
936
936
|
};
|
|
937
|
-
var
|
|
938
|
-
|
|
937
|
+
var Su = {};
|
|
938
|
+
Su = {
|
|
939
939
|
dragDescriptionKeyboard: "Aloita vetäminen painamalla Enter-näppäintä.",
|
|
940
940
|
dragDescriptionKeyboardAlt: "Aloita vetäminen painamalla Alt + Enter -näppäinyhdistelmää.",
|
|
941
941
|
dragDescriptionLongPress: "Aloita vetäminen pitämällä painettuna.",
|
|
@@ -976,8 +976,8 @@ Au = {
|
|
|
976
976
|
insertBefore: (e) => `Lisää ennen kohdetta ${e.itemText}`,
|
|
977
977
|
insertBetween: (e) => `Lisää kohteiden ${e.beforeItemText} ja ${e.afterItemText} väliin`
|
|
978
978
|
};
|
|
979
|
-
var
|
|
980
|
-
|
|
979
|
+
var Ku = {};
|
|
980
|
+
Ku = {
|
|
981
981
|
dragDescriptionKeyboard: "Appuyez sur Entrée pour commencer le déplacement.",
|
|
982
982
|
dragDescriptionKeyboardAlt: "Appuyez sur Alt + Entrée pour commencer à faire glisser.",
|
|
983
983
|
dragDescriptionLongPress: "Appuyez de manière prolongée pour commencer à faire glisser.",
|
|
@@ -1018,8 +1018,8 @@ Tu = {
|
|
|
1018
1018
|
insertBefore: (e) => `Insérer avant ${e.itemText}`,
|
|
1019
1019
|
insertBetween: (e) => `Insérer entre ${e.beforeItemText} et ${e.afterItemText}`
|
|
1020
1020
|
};
|
|
1021
|
-
var
|
|
1022
|
-
|
|
1021
|
+
var Pu = {};
|
|
1022
|
+
Pu = {
|
|
1023
1023
|
dragDescriptionKeyboard: "הקש על Enter כדי להתחיל לגרור.",
|
|
1024
1024
|
dragDescriptionKeyboardAlt: "הקש Alt + Enter כדי להתחיל לגרור.",
|
|
1025
1025
|
dragDescriptionLongPress: "לחץ לחיצה ארוכה כדי להתחיל לגרור.",
|
|
@@ -1060,8 +1060,8 @@ Fu = {
|
|
|
1060
1060
|
insertBefore: (e) => `הוסף לפני ${e.itemText}`,
|
|
1061
1061
|
insertBetween: (e) => `הוסף בין ${e.beforeItemText} לבין ${e.afterItemText}`
|
|
1062
1062
|
};
|
|
1063
|
-
var
|
|
1064
|
-
|
|
1063
|
+
var Iu = {};
|
|
1064
|
+
Iu = {
|
|
1065
1065
|
dragDescriptionKeyboard: "Pritisnite Enter da biste počeli povlačiti.",
|
|
1066
1066
|
dragDescriptionKeyboardAlt: "Pritisnite Alt + Enter za početak povlačenja.",
|
|
1067
1067
|
dragDescriptionLongPress: "Dugo pritisnite za početak povlačenja.",
|
|
@@ -1102,8 +1102,8 @@ Su = {
|
|
|
1102
1102
|
insertBefore: (e) => `Ispustite ispred stavke ${e.itemText}`,
|
|
1103
1103
|
insertBetween: (e) => `Umetnite između stavki ${e.beforeItemText} i ${e.afterItemText}`
|
|
1104
1104
|
};
|
|
1105
|
-
var
|
|
1106
|
-
|
|
1105
|
+
var zu = {};
|
|
1106
|
+
zu = {
|
|
1107
1107
|
dragDescriptionKeyboard: "Nyomja le az Enter billentyűt a húzás megkezdéséhez.",
|
|
1108
1108
|
dragDescriptionKeyboardAlt: "Nyomja le az Alt + Enter billentyűket a húzás megkezdéséhez.",
|
|
1109
1109
|
dragDescriptionLongPress: "Hosszan nyomja meg a húzás elindításához.",
|
|
@@ -1144,8 +1144,8 @@ Ku = {
|
|
|
1144
1144
|
insertBefore: (e) => `Beszúrás ${e.itemText} elé`,
|
|
1145
1145
|
insertBetween: (e) => `Beszúrás ${e.beforeItemText} és ${e.afterItemText} közé`
|
|
1146
1146
|
};
|
|
1147
|
-
var
|
|
1148
|
-
|
|
1147
|
+
var wu = {};
|
|
1148
|
+
wu = {
|
|
1149
1149
|
dragDescriptionKeyboard: "Premi Invio per iniziare a trascinare.",
|
|
1150
1150
|
dragDescriptionKeyboardAlt: "Premi Alt + Invio per iniziare a trascinare.",
|
|
1151
1151
|
dragDescriptionLongPress: "Premi a lungo per iniziare a trascinare.",
|
|
@@ -1186,8 +1186,8 @@ Pu = {
|
|
|
1186
1186
|
insertBefore: (e) => `Inserisci prima di ${e.itemText}`,
|
|
1187
1187
|
insertBetween: (e) => `Inserisci tra ${e.beforeItemText} e ${e.afterItemText}`
|
|
1188
1188
|
};
|
|
1189
|
-
var
|
|
1190
|
-
|
|
1189
|
+
var Ou = {};
|
|
1190
|
+
Ou = {
|
|
1191
1191
|
dragDescriptionKeyboard: "Enter キーを押してドラッグを開始してください。",
|
|
1192
1192
|
dragDescriptionKeyboardAlt: "Alt+Enter キーを押してドラッグを開始します。",
|
|
1193
1193
|
dragDescriptionLongPress: "長押ししてドラッグを開始します。",
|
|
@@ -1228,8 +1228,8 @@ Iu = {
|
|
|
1228
1228
|
insertBefore: (e) => `${e.itemText} の前に挿入`,
|
|
1229
1229
|
insertBetween: (e) => `${e.beforeItemText} と ${e.afterItemText} の間に挿入`
|
|
1230
1230
|
};
|
|
1231
|
-
var
|
|
1232
|
-
|
|
1231
|
+
var Vu = {};
|
|
1232
|
+
Vu = {
|
|
1233
1233
|
dragDescriptionKeyboard: "드래그를 시작하려면 Enter를 누르세요.",
|
|
1234
1234
|
dragDescriptionKeyboardAlt: "드래그를 시작하려면 Alt + Enter를 누르십시오.",
|
|
1235
1235
|
dragDescriptionLongPress: "드래그를 시작하려면 길게 누르십시오.",
|
|
@@ -1270,8 +1270,8 @@ zu = {
|
|
|
1270
1270
|
insertBefore: (e) => `${e.itemText} 이전에 삽입`,
|
|
1271
1271
|
insertBetween: (e) => `${e.beforeItemText} 및 ${e.afterItemText} 사이에 삽입`
|
|
1272
1272
|
};
|
|
1273
|
-
var
|
|
1274
|
-
|
|
1273
|
+
var ju = {};
|
|
1274
|
+
ju = {
|
|
1275
1275
|
dragDescriptionKeyboard: "Paspauskite „Enter“, kad pradėtumėte vilkti.",
|
|
1276
1276
|
dragDescriptionKeyboardAlt: "Paspauskite „Alt + Enter“, kad pradėtumėte vilkti.",
|
|
1277
1277
|
dragDescriptionLongPress: "Palaikykite nuspaudę, kad pradėtumėte vilkti.",
|
|
@@ -1312,8 +1312,8 @@ wu = {
|
|
|
1312
1312
|
insertBefore: (e) => `Įterpti prieš ${e.itemText}`,
|
|
1313
1313
|
insertBetween: (e) => `Įterpti tarp ${e.beforeItemText} ir ${e.afterItemText}`
|
|
1314
1314
|
};
|
|
1315
|
-
var
|
|
1316
|
-
|
|
1315
|
+
var Lu = {};
|
|
1316
|
+
Lu = {
|
|
1317
1317
|
dragDescriptionKeyboard: "Nospiediet Enter, lai sāktu vilkšanu.",
|
|
1318
1318
|
dragDescriptionKeyboardAlt: "Nospiediet taustiņu kombināciju Alt+Enter, lai sāktu vilkšanu.",
|
|
1319
1319
|
dragDescriptionLongPress: "Turiet nospiestu, lai sāktu vilkšanu.",
|
|
@@ -1354,8 +1354,8 @@ Ou = {
|
|
|
1354
1354
|
insertBefore: (e) => `Ievietojiet pirms ${e.itemText}`,
|
|
1355
1355
|
insertBetween: (e) => `Ievietojiet starp ${e.beforeItemText} un ${e.afterItemText}`
|
|
1356
1356
|
};
|
|
1357
|
-
var
|
|
1358
|
-
|
|
1357
|
+
var Ru = {};
|
|
1358
|
+
Ru = {
|
|
1359
1359
|
dragDescriptionKeyboard: "Trykk på Enter for å begynne å dra.",
|
|
1360
1360
|
dragDescriptionKeyboardAlt: "Trykk på Alt + Enter for å begynne å dra.",
|
|
1361
1361
|
dragDescriptionLongPress: "Trykk lenge for å begynne å dra.",
|
|
@@ -1396,8 +1396,8 @@ Vu = {
|
|
|
1396
1396
|
insertBefore: (e) => `Sett inn før ${e.itemText}`,
|
|
1397
1397
|
insertBetween: (e) => `Sett inn mellom ${e.beforeItemText} og ${e.afterItemText}`
|
|
1398
1398
|
};
|
|
1399
|
-
var
|
|
1400
|
-
|
|
1399
|
+
var Mu = {};
|
|
1400
|
+
Mu = {
|
|
1401
1401
|
dragDescriptionKeyboard: "Druk op Enter om te slepen.",
|
|
1402
1402
|
dragDescriptionKeyboardAlt: "Druk op Alt + Enter om te slepen.",
|
|
1403
1403
|
dragDescriptionLongPress: "Houd lang ingedrukt om te slepen.",
|
|
@@ -1438,8 +1438,8 @@ ju = {
|
|
|
1438
1438
|
insertBefore: (e) => `Plaatsen vóór ${e.itemText}`,
|
|
1439
1439
|
insertBetween: (e) => `Plaatsen tussen ${e.beforeItemText} en ${e.afterItemText}`
|
|
1440
1440
|
};
|
|
1441
|
-
var
|
|
1442
|
-
|
|
1441
|
+
var Nu = {};
|
|
1442
|
+
Nu = {
|
|
1443
1443
|
dragDescriptionKeyboard: "Naciśnij Enter, aby rozpocząć przeciąganie.",
|
|
1444
1444
|
dragDescriptionKeyboardAlt: "Naciśnij Alt + Enter, aby rozpocząć przeciąganie.",
|
|
1445
1445
|
dragDescriptionLongPress: "Naciśnij i przytrzymaj, aby rozpocząć przeciąganie.",
|
|
@@ -1480,8 +1480,8 @@ Lu = {
|
|
|
1480
1480
|
insertBefore: (e) => `Umieść przed ${e.itemText}`,
|
|
1481
1481
|
insertBetween: (e) => `Umieść między ${e.beforeItemText} i ${e.afterItemText}`
|
|
1482
1482
|
};
|
|
1483
|
-
var
|
|
1484
|
-
|
|
1483
|
+
var Hu = {};
|
|
1484
|
+
Hu = {
|
|
1485
1485
|
dragDescriptionKeyboard: "Pressione Enter para começar a arrastar.",
|
|
1486
1486
|
dragDescriptionKeyboardAlt: "Pressione Alt + Enter para começar a arrastar.",
|
|
1487
1487
|
dragDescriptionLongPress: "Pressione e segure para começar a arrastar.",
|
|
@@ -1522,8 +1522,8 @@ Ru = {
|
|
|
1522
1522
|
insertBefore: (e) => `Inserir antes de ${e.itemText}`,
|
|
1523
1523
|
insertBetween: (e) => `Inserir entre ${e.beforeItemText} e ${e.afterItemText}`
|
|
1524
1524
|
};
|
|
1525
|
-
var
|
|
1526
|
-
|
|
1525
|
+
var Uu = {};
|
|
1526
|
+
Uu = {
|
|
1527
1527
|
dragDescriptionKeyboard: "Prima Enter para iniciar o arrasto.",
|
|
1528
1528
|
dragDescriptionKeyboardAlt: "Prima Alt + Enter para iniciar o arrasto.",
|
|
1529
1529
|
dragDescriptionLongPress: "Prima longamente para começar a arrastar.",
|
|
@@ -1564,8 +1564,8 @@ Mu = {
|
|
|
1564
1564
|
insertBefore: (e) => `Inserir antes de ${e.itemText}`,
|
|
1565
1565
|
insertBetween: (e) => `Inserir entre ${e.beforeItemText} e ${e.afterItemText}`
|
|
1566
1566
|
};
|
|
1567
|
-
var
|
|
1568
|
-
|
|
1567
|
+
var qu = {};
|
|
1568
|
+
qu = {
|
|
1569
1569
|
dragDescriptionKeyboard: "Apăsați pe Enter pentru a începe glisarea.",
|
|
1570
1570
|
dragDescriptionKeyboardAlt: "Apăsați pe Alt + Enter pentru a începe glisarea.",
|
|
1571
1571
|
dragDescriptionLongPress: "Apăsați lung pentru a începe glisarea.",
|
|
@@ -1606,8 +1606,8 @@ Nu = {
|
|
|
1606
1606
|
insertBefore: (e) => `Inserați înainte de ${e.itemText}`,
|
|
1607
1607
|
insertBetween: (e) => `Inserați între ${e.beforeItemText} și ${e.afterItemText}`
|
|
1608
1608
|
};
|
|
1609
|
-
var
|
|
1610
|
-
|
|
1609
|
+
var Gu = {};
|
|
1610
|
+
Gu = {
|
|
1611
1611
|
dragDescriptionKeyboard: "Нажмите клавишу Enter для начала перетаскивания.",
|
|
1612
1612
|
dragDescriptionKeyboardAlt: "Нажмите Alt + Enter, чтобы начать перетаскивать.",
|
|
1613
1613
|
dragDescriptionLongPress: "Нажмите и удерживайте, чтобы начать перетаскивать.",
|
|
@@ -1648,8 +1648,8 @@ Hu = {
|
|
|
1648
1648
|
insertBefore: (e) => `Вставить перед ${e.itemText}`,
|
|
1649
1649
|
insertBetween: (e) => `Вставить между ${e.beforeItemText} и ${e.afterItemText}`
|
|
1650
1650
|
};
|
|
1651
|
-
var
|
|
1652
|
-
|
|
1651
|
+
var Xu = {};
|
|
1652
|
+
Xu = {
|
|
1653
1653
|
dragDescriptionKeyboard: "Stlačením klávesu Enter začnete presúvanie.",
|
|
1654
1654
|
dragDescriptionKeyboardAlt: "Stlačením klávesov Alt + Enter začnete presúvanie.",
|
|
1655
1655
|
dragDescriptionLongPress: "Dlhým stlačením začnete presúvanie.",
|
|
@@ -1690,8 +1690,8 @@ Uu = {
|
|
|
1690
1690
|
insertBefore: (e) => `Vložiť pred položku ${e.itemText}`,
|
|
1691
1691
|
insertBetween: (e) => `Vložiť medzi položky ${e.beforeItemText} a ${e.afterItemText}`
|
|
1692
1692
|
};
|
|
1693
|
-
var
|
|
1694
|
-
|
|
1693
|
+
var Yu = {};
|
|
1694
|
+
Yu = {
|
|
1695
1695
|
dragDescriptionKeyboard: "Pritisnite tipko Enter za začetek vlečenja.",
|
|
1696
1696
|
dragDescriptionKeyboardAlt: "Pritisnite tipki Alt + Enter za začetek vlečenja.",
|
|
1697
1697
|
dragDescriptionLongPress: "Pritisnite in zadržite za začetek vlečenja.",
|
|
@@ -1732,8 +1732,8 @@ Gu = {
|
|
|
1732
1732
|
insertBefore: (e) => `Vstavi pred ${e.itemText}`,
|
|
1733
1733
|
insertBetween: (e) => `Vstavi med ${e.beforeItemText} in ${e.afterItemText}`
|
|
1734
1734
|
};
|
|
1735
|
-
var
|
|
1736
|
-
|
|
1735
|
+
var Zu = {};
|
|
1736
|
+
Zu = {
|
|
1737
1737
|
dragDescriptionKeyboard: "Pritisnite Enter da biste započeli prevlačenje.",
|
|
1738
1738
|
dragDescriptionKeyboardAlt: "Pritisnite Alt + Enter da biste započeli prevlačenje.",
|
|
1739
1739
|
dragDescriptionLongPress: "Pritisnite dugo da biste započeli prevlačenje.",
|
|
@@ -1774,8 +1774,8 @@ qu = {
|
|
|
1774
1774
|
insertBefore: (e) => `Umetnite ispred ${e.itemText}`,
|
|
1775
1775
|
insertBetween: (e) => `Umetnite između ${e.beforeItemText} i ${e.afterItemText}`
|
|
1776
1776
|
};
|
|
1777
|
-
var
|
|
1778
|
-
|
|
1777
|
+
var Ju = {};
|
|
1778
|
+
Ju = {
|
|
1779
1779
|
dragDescriptionKeyboard: "Tryck på enter för att börja dra.",
|
|
1780
1780
|
dragDescriptionKeyboardAlt: "Tryck på Alt + Retur för att börja dra.",
|
|
1781
1781
|
dragDescriptionLongPress: "Tryck länge för att börja dra.",
|
|
@@ -1816,8 +1816,8 @@ Xu = {
|
|
|
1816
1816
|
insertBefore: (e) => `Infoga före ${e.itemText}`,
|
|
1817
1817
|
insertBetween: (e) => `Infoga mellan ${e.beforeItemText} och ${e.afterItemText}`
|
|
1818
1818
|
};
|
|
1819
|
-
var
|
|
1820
|
-
|
|
1819
|
+
var Wu = {};
|
|
1820
|
+
Wu = {
|
|
1821
1821
|
dragDescriptionKeyboard: "Sürüklemeyi başlatmak için Enter'a basın.",
|
|
1822
1822
|
dragDescriptionKeyboardAlt: "Sürüklemeyi başlatmak için Alt + Enter'a basın.",
|
|
1823
1823
|
dragDescriptionLongPress: "Sürüklemeye başlamak için uzun basın.",
|
|
@@ -1858,8 +1858,8 @@ Yu = {
|
|
|
1858
1858
|
insertBefore: (e) => `${e.itemText}’den önce gir`,
|
|
1859
1859
|
insertBetween: (e) => `${e.beforeItemText} ve ${e.afterItemText} arasına gir`
|
|
1860
1860
|
};
|
|
1861
|
-
var
|
|
1862
|
-
|
|
1861
|
+
var Qu = {};
|
|
1862
|
+
Qu = {
|
|
1863
1863
|
dragDescriptionKeyboard: "Натисніть Enter, щоб почати перетягування.",
|
|
1864
1864
|
dragDescriptionKeyboardAlt: "Натисніть Alt + Enter, щоб почати перетягування.",
|
|
1865
1865
|
dragDescriptionLongPress: "Натисніть і утримуйте, щоб почати перетягування.",
|
|
@@ -1900,8 +1900,8 @@ Zu = {
|
|
|
1900
1900
|
insertBefore: (e) => `Вставити перед ${e.itemText}`,
|
|
1901
1901
|
insertBetween: (e) => `Вставити між ${e.beforeItemText} і ${e.afterItemText}`
|
|
1902
1902
|
};
|
|
1903
|
-
var
|
|
1904
|
-
|
|
1903
|
+
var _u = {};
|
|
1904
|
+
_u = {
|
|
1905
1905
|
dragDescriptionKeyboard: "按 Enter 开始拖动。",
|
|
1906
1906
|
dragDescriptionKeyboardAlt: "按 Alt + Enter 开始拖动。",
|
|
1907
1907
|
dragDescriptionLongPress: "长按以开始拖动。",
|
|
@@ -1942,8 +1942,8 @@ Ju = {
|
|
|
1942
1942
|
insertBefore: (e) => `插入到 ${e.itemText} 之前`,
|
|
1943
1943
|
insertBetween: (e) => `插入到 ${e.beforeItemText} 和 ${e.afterItemText} 之间`
|
|
1944
1944
|
};
|
|
1945
|
-
var
|
|
1946
|
-
|
|
1945
|
+
var et = {};
|
|
1946
|
+
et = {
|
|
1947
1947
|
dragDescriptionKeyboard: "按 Enter 鍵以開始拖曳。",
|
|
1948
1948
|
dragDescriptionKeyboardAlt: "按 Alt+Enter 鍵以開始拖曳。",
|
|
1949
1949
|
dragDescriptionLongPress: "長按以開始拖曳。",
|
|
@@ -1984,47 +1984,47 @@ Wu = {
|
|
|
1984
1984
|
insertBefore: (e) => `插入至「${e.itemText}」之前`,
|
|
1985
1985
|
insertBetween: (e) => `插入至「${e.beforeItemText}」和「${e.afterItemText}」之間`
|
|
1986
1986
|
};
|
|
1987
|
-
var
|
|
1988
|
-
|
|
1989
|
-
"ar-AE":
|
|
1990
|
-
"bg-BG":
|
|
1991
|
-
"cs-CZ":
|
|
1992
|
-
"da-DK":
|
|
1993
|
-
"de-DE":
|
|
1994
|
-
"el-GR":
|
|
1995
|
-
"en-US":
|
|
1996
|
-
"es-ES":
|
|
1997
|
-
"et-EE":
|
|
1998
|
-
"fi-FI":
|
|
1999
|
-
"fr-FR":
|
|
2000
|
-
"he-IL":
|
|
2001
|
-
"hr-HR":
|
|
2002
|
-
"hu-HU":
|
|
2003
|
-
"it-IT":
|
|
2004
|
-
"ja-JP":
|
|
2005
|
-
"ko-KR":
|
|
2006
|
-
"lt-LT":
|
|
2007
|
-
"lv-LV":
|
|
2008
|
-
"nb-NO":
|
|
2009
|
-
"nl-NL":
|
|
2010
|
-
"pl-PL":
|
|
2011
|
-
"pt-BR":
|
|
2012
|
-
"pt-PT":
|
|
2013
|
-
"ro-RO":
|
|
2014
|
-
"ru-RU":
|
|
2015
|
-
"sk-SK":
|
|
2016
|
-
"sl-SI":
|
|
2017
|
-
"sr-SP":
|
|
2018
|
-
"sv-SE":
|
|
2019
|
-
"tr-TR":
|
|
2020
|
-
"uk-UA":
|
|
2021
|
-
"zh-CN":
|
|
2022
|
-
"zh-TW":
|
|
1987
|
+
var ne = {};
|
|
1988
|
+
ne = {
|
|
1989
|
+
"ar-AE": Cu,
|
|
1990
|
+
"bg-BG": $u,
|
|
1991
|
+
"cs-CZ": yu,
|
|
1992
|
+
"da-DK": vu,
|
|
1993
|
+
"de-DE": hu,
|
|
1994
|
+
"el-GR": ku,
|
|
1995
|
+
"en-US": Au,
|
|
1996
|
+
"es-ES": Tu,
|
|
1997
|
+
"et-EE": Fu,
|
|
1998
|
+
"fi-FI": Su,
|
|
1999
|
+
"fr-FR": Ku,
|
|
2000
|
+
"he-IL": Pu,
|
|
2001
|
+
"hr-HR": Iu,
|
|
2002
|
+
"hu-HU": zu,
|
|
2003
|
+
"it-IT": wu,
|
|
2004
|
+
"ja-JP": Ou,
|
|
2005
|
+
"ko-KR": Vu,
|
|
2006
|
+
"lt-LT": ju,
|
|
2007
|
+
"lv-LV": Lu,
|
|
2008
|
+
"nb-NO": Ru,
|
|
2009
|
+
"nl-NL": Mu,
|
|
2010
|
+
"pl-PL": Nu,
|
|
2011
|
+
"pt-BR": Hu,
|
|
2012
|
+
"pt-PT": Uu,
|
|
2013
|
+
"ro-RO": qu,
|
|
2014
|
+
"ru-RU": Gu,
|
|
2015
|
+
"sk-SK": Xu,
|
|
2016
|
+
"sl-SI": Yu,
|
|
2017
|
+
"sr-SP": Zu,
|
|
2018
|
+
"sv-SE": Ju,
|
|
2019
|
+
"tr-TR": Wu,
|
|
2020
|
+
"uk-UA": Qu,
|
|
2021
|
+
"zh-CN": _u,
|
|
2022
|
+
"zh-TW": et
|
|
2023
2023
|
};
|
|
2024
|
-
function
|
|
2024
|
+
function Er(e) {
|
|
2025
2025
|
return e && e.__esModule ? e.default : e;
|
|
2026
2026
|
}
|
|
2027
|
-
const
|
|
2027
|
+
const qe = {
|
|
2028
2028
|
keyboard: {
|
|
2029
2029
|
start: "dragDescriptionKeyboard",
|
|
2030
2030
|
end: "endDragKeyboard"
|
|
@@ -2038,130 +2038,130 @@ const Ue = {
|
|
|
2038
2038
|
end: "endDragVirtual"
|
|
2039
2039
|
}
|
|
2040
2040
|
};
|
|
2041
|
-
function
|
|
2042
|
-
let { hasDragButton: u, isDisabled: r } = e, t =
|
|
2041
|
+
function Cr(e) {
|
|
2042
|
+
let { hasDragButton: u, isDisabled: r } = e, t = Be(Er(ne), "@react-aria/dnd"), n = S({
|
|
2043
2043
|
options: e,
|
|
2044
2044
|
x: 0,
|
|
2045
2045
|
y: 0
|
|
2046
2046
|
}).current;
|
|
2047
|
-
|
|
2048
|
-
let
|
|
2049
|
-
|
|
2050
|
-
}, { addGlobalListener:
|
|
2051
|
-
var
|
|
2052
|
-
if (
|
|
2053
|
-
if (
|
|
2054
|
-
|
|
2047
|
+
n.options = e;
|
|
2048
|
+
let o = S(null), [a, l] = X(!1), m = (s) => {
|
|
2049
|
+
o.current = s, l(!!s);
|
|
2050
|
+
}, { addGlobalListener: g, removeAllGlobalListeners: c } = Yt(), B = S(null), p = (s) => {
|
|
2051
|
+
var b, $, h;
|
|
2052
|
+
if (s.defaultPrevented) return;
|
|
2053
|
+
if (s.stopPropagation(), B.current === "virtual") {
|
|
2054
|
+
s.preventDefault(), D(s.target), B.current = null;
|
|
2055
2055
|
return;
|
|
2056
2056
|
}
|
|
2057
2057
|
typeof e.onDragStart == "function" && e.onDragStart({
|
|
2058
2058
|
type: "dragstart",
|
|
2059
|
-
x:
|
|
2060
|
-
y:
|
|
2059
|
+
x: s.clientX,
|
|
2060
|
+
y: s.clientY
|
|
2061
2061
|
});
|
|
2062
2062
|
let k = e.getItems();
|
|
2063
|
-
(
|
|
2063
|
+
(b = ($ = s.dataTransfer).clearData) === null || b === void 0 || b.call($), nr(s.dataTransfer, k);
|
|
2064
2064
|
let T = I.all;
|
|
2065
2065
|
if (typeof e.getAllowedDropOperations == "function") {
|
|
2066
2066
|
let v = e.getAllowedDropOperations();
|
|
2067
2067
|
T = I.none;
|
|
2068
2068
|
for (let F of v) T |= I[F] || I.none;
|
|
2069
2069
|
}
|
|
2070
|
-
|
|
2071
|
-
let
|
|
2072
|
-
|
|
2070
|
+
Ce(T);
|
|
2071
|
+
let K = Du[T] || "none";
|
|
2072
|
+
s.dataTransfer.effectAllowed = K === "cancel" ? "none" : K, typeof ((h = e.preview) === null || h === void 0 ? void 0 : h.current) == "function" && e.preview.current(k, (v, F, P) => {
|
|
2073
2073
|
if (!v) return;
|
|
2074
|
-
let V = v.getBoundingClientRect(),
|
|
2074
|
+
let V = v.getBoundingClientRect(), R = s.currentTarget.getBoundingClientRect(), M = s.clientX - R.x, U = s.clientY - R.y;
|
|
2075
2075
|
(M > V.width || U > V.height) && (M = V.width / 2, U = V.height / 2);
|
|
2076
|
-
let N = M,
|
|
2077
|
-
typeof F == "number" && typeof P == "number" && (N = F,
|
|
2078
|
-
let
|
|
2079
|
-
v.style.height = `${
|
|
2080
|
-
}),
|
|
2076
|
+
let N = M, q = U;
|
|
2077
|
+
typeof F == "number" && typeof P == "number" && (N = F, q = P), N = Math.max(0, Math.min(N, V.width)), q = Math.max(0, Math.min(q, V.height));
|
|
2078
|
+
let xe = 2 * Math.round(V.height / 2);
|
|
2079
|
+
v.style.height = `${xe}px`, s.dataTransfer.setDragImage(v, N, q);
|
|
2080
|
+
}), g(window, "drop", (v) => {
|
|
2081
2081
|
v.preventDefault(), v.stopPropagation(), console.warn("Drags initiated from the React Aria useDrag hook may only be dropped on a target created with useDrop. This ensures that a keyboard and screen reader accessible alternative is available.");
|
|
2082
2082
|
}, {
|
|
2083
2083
|
once: !0
|
|
2084
|
-
}),
|
|
2085
|
-
let O =
|
|
2084
|
+
}), n.x = s.clientX, n.y = s.clientY;
|
|
2085
|
+
let O = s.target;
|
|
2086
2086
|
requestAnimationFrame(() => {
|
|
2087
2087
|
m(O);
|
|
2088
2088
|
});
|
|
2089
|
-
}, C = (
|
|
2090
|
-
|
|
2089
|
+
}, C = (s) => {
|
|
2090
|
+
s.stopPropagation(), !(s.clientX === n.x && s.clientY === n.y) && (typeof e.onDragMove == "function" && e.onDragMove({
|
|
2091
2091
|
type: "dragmove",
|
|
2092
|
-
x:
|
|
2093
|
-
y:
|
|
2094
|
-
}),
|
|
2095
|
-
},
|
|
2096
|
-
if (
|
|
2097
|
-
let
|
|
2092
|
+
x: s.clientX,
|
|
2093
|
+
y: s.clientY
|
|
2094
|
+
}), n.x = s.clientX, n.y = s.clientY);
|
|
2095
|
+
}, f = (s) => {
|
|
2096
|
+
if (s.stopPropagation(), typeof e.onDragEnd == "function") {
|
|
2097
|
+
let b = {
|
|
2098
2098
|
type: "dragend",
|
|
2099
|
-
x:
|
|
2100
|
-
y:
|
|
2101
|
-
dropOperation:
|
|
2099
|
+
x: s.clientX,
|
|
2100
|
+
y: s.clientY,
|
|
2101
|
+
dropOperation: te[s.dataTransfer.dropEffect]
|
|
2102
2102
|
};
|
|
2103
|
-
|
|
2103
|
+
ce && (b.dropOperation = te[ce]), e.onDragEnd(b);
|
|
2104
2104
|
}
|
|
2105
|
-
m(null),
|
|
2105
|
+
m(null), c(), Ce(I.none), ge(void 0);
|
|
2106
2106
|
};
|
|
2107
|
-
|
|
2108
|
-
if (
|
|
2109
|
-
if (typeof
|
|
2110
|
-
let
|
|
2107
|
+
L(() => () => {
|
|
2108
|
+
if (o.current && (!o.current.isConnected || parseInt(st, 10) < 17)) {
|
|
2109
|
+
if (typeof n.options.onDragEnd == "function") {
|
|
2110
|
+
let s = {
|
|
2111
2111
|
type: "dragend",
|
|
2112
2112
|
x: 0,
|
|
2113
2113
|
y: 0,
|
|
2114
|
-
dropOperation:
|
|
2114
|
+
dropOperation: te[ce || "none"]
|
|
2115
2115
|
};
|
|
2116
|
-
|
|
2116
|
+
n.options.onDragEnd(s);
|
|
2117
2117
|
}
|
|
2118
|
-
m(null),
|
|
2118
|
+
m(null), Ce(I.none), ge(void 0);
|
|
2119
2119
|
}
|
|
2120
2120
|
}, [
|
|
2121
|
-
|
|
2121
|
+
n
|
|
2122
2122
|
]);
|
|
2123
|
-
let x = (
|
|
2124
|
-
|
|
2125
|
-
},
|
|
2126
|
-
if (typeof
|
|
2127
|
-
let
|
|
2128
|
-
|
|
2123
|
+
let x = (s) => {
|
|
2124
|
+
s.pointerType !== "keyboard" && s.pointerType !== "virtual" || D(s.target);
|
|
2125
|
+
}, D = (s) => {
|
|
2126
|
+
if (typeof n.options.onDragStart == "function") {
|
|
2127
|
+
let b = s.getBoundingClientRect();
|
|
2128
|
+
n.options.onDragStart({
|
|
2129
2129
|
type: "dragstart",
|
|
2130
|
-
x:
|
|
2131
|
-
y:
|
|
2130
|
+
x: b.x + b.width / 2,
|
|
2131
|
+
y: b.y + b.height / 2
|
|
2132
2132
|
});
|
|
2133
2133
|
}
|
|
2134
|
-
|
|
2135
|
-
element:
|
|
2136
|
-
items:
|
|
2137
|
-
allowedDropOperations: typeof
|
|
2134
|
+
Dr({
|
|
2135
|
+
element: s,
|
|
2136
|
+
items: n.options.getItems(),
|
|
2137
|
+
allowedDropOperations: typeof n.options.getAllowedDropOperations == "function" ? n.options.getAllowedDropOperations() : [
|
|
2138
2138
|
"move",
|
|
2139
2139
|
"copy",
|
|
2140
2140
|
"link"
|
|
2141
2141
|
],
|
|
2142
|
-
onDragEnd(
|
|
2143
|
-
m(null), typeof
|
|
2142
|
+
onDragEnd(b) {
|
|
2143
|
+
m(null), typeof n.options.onDragEnd == "function" && n.options.onDragEnd(b);
|
|
2144
2144
|
}
|
|
2145
|
-
}, t), m(
|
|
2146
|
-
},
|
|
2145
|
+
}, t), m(s);
|
|
2146
|
+
}, E = Ve(), y = a ? qe[E].end : qe[E].start, i = we(t.format(y)), d = {};
|
|
2147
2147
|
return u || (d = {
|
|
2148
2148
|
...i,
|
|
2149
|
-
onPointerDown(
|
|
2150
|
-
if (B.current =
|
|
2149
|
+
onPointerDown(s) {
|
|
2150
|
+
if (B.current = su(s.nativeEvent) ? "virtual" : s.pointerType, s.width < 1 && s.height < 1)
|
|
2151
2151
|
B.current = "virtual";
|
|
2152
2152
|
else {
|
|
2153
|
-
let
|
|
2154
|
-
Math.abs(
|
|
2153
|
+
let b = s.currentTarget.getBoundingClientRect(), $ = s.clientX - b.x, h = s.clientY - b.y, k = b.width / 2, T = b.height / 2;
|
|
2154
|
+
Math.abs($ - k) <= 0.5 && Math.abs(h - T) <= 0.5 ? B.current = "virtual" : B.current = s.pointerType;
|
|
2155
2155
|
}
|
|
2156
2156
|
},
|
|
2157
|
-
onKeyDownCapture(
|
|
2158
|
-
|
|
2157
|
+
onKeyDownCapture(s) {
|
|
2158
|
+
s.target === s.currentTarget && s.key === "Enter" && (s.preventDefault(), s.stopPropagation());
|
|
2159
2159
|
},
|
|
2160
|
-
onKeyUpCapture(
|
|
2161
|
-
|
|
2160
|
+
onKeyUpCapture(s) {
|
|
2161
|
+
s.target === s.currentTarget && s.key === "Enter" && (s.preventDefault(), s.stopPropagation(), D(s.target));
|
|
2162
2162
|
},
|
|
2163
|
-
onClick(
|
|
2164
|
-
(
|
|
2163
|
+
onClick(s) {
|
|
2164
|
+
(du(s.nativeEvent) || B.current === "virtual") && (s.preventDefault(), s.stopPropagation(), D(s.target));
|
|
2165
2165
|
}
|
|
2166
2166
|
}), r ? {
|
|
2167
2167
|
dragProps: {
|
|
@@ -2173,9 +2173,9 @@ function br(e) {
|
|
|
2173
2173
|
dragProps: {
|
|
2174
2174
|
...d,
|
|
2175
2175
|
draggable: "true",
|
|
2176
|
-
onDragStart:
|
|
2176
|
+
onDragStart: p,
|
|
2177
2177
|
onDrag: C,
|
|
2178
|
-
onDragEnd:
|
|
2178
|
+
onDragEnd: f
|
|
2179
2179
|
},
|
|
2180
2180
|
dragButtonProps: {
|
|
2181
2181
|
...i,
|
|
@@ -2184,19 +2184,19 @@ function br(e) {
|
|
|
2184
2184
|
isDragging: a
|
|
2185
2185
|
};
|
|
2186
2186
|
}
|
|
2187
|
-
function
|
|
2187
|
+
function $r(e) {
|
|
2188
2188
|
return e && e.__esModule ? e.default : e;
|
|
2189
2189
|
}
|
|
2190
|
-
const
|
|
2190
|
+
const yr = {
|
|
2191
2191
|
keyboard: "dropDescriptionKeyboard",
|
|
2192
2192
|
touch: "dropDescriptionTouch",
|
|
2193
2193
|
virtual: "dropDescriptionVirtual"
|
|
2194
2194
|
};
|
|
2195
|
-
function
|
|
2196
|
-
let e =
|
|
2195
|
+
function ut() {
|
|
2196
|
+
let e = Be($r(ne), "@react-aria/dnd"), u = Ve(), r = je();
|
|
2197
2197
|
return {
|
|
2198
2198
|
dropProps: {
|
|
2199
|
-
...
|
|
2199
|
+
...we(r ? e.format(yr[u]) : ""),
|
|
2200
2200
|
// Mobile Safari does not properly bubble click events on elements except links or inputs
|
|
2201
2201
|
// unless there is an onclick handler bound directly to the element itself. By adding this
|
|
2202
2202
|
// handler, React will take care of adding that for us, and we are able to handle document
|
|
@@ -2207,9 +2207,9 @@ function Qu() {
|
|
|
2207
2207
|
}
|
|
2208
2208
|
};
|
|
2209
2209
|
}
|
|
2210
|
-
const
|
|
2211
|
-
function
|
|
2212
|
-
let { hasDropButton: u, isDisabled: r } = e, [t,
|
|
2210
|
+
const vr = 800;
|
|
2211
|
+
function hr(e) {
|
|
2212
|
+
let { hasDropButton: u, isDisabled: r } = e, [t, n] = X(!1), o = S({
|
|
2213
2213
|
x: 0,
|
|
2214
2214
|
y: 0,
|
|
2215
2215
|
dragOverElements: /* @__PURE__ */ new Set(),
|
|
@@ -2217,7 +2217,7 @@ function $r(e) {
|
|
|
2217
2217
|
allowedOperations: I.all,
|
|
2218
2218
|
dropActivateTimer: void 0
|
|
2219
2219
|
}).current, a = (i) => {
|
|
2220
|
-
if (
|
|
2220
|
+
if (n(!0), typeof e.onDropEnter == "function") {
|
|
2221
2221
|
let d = i.currentTarget.getBoundingClientRect();
|
|
2222
2222
|
e.onDropEnter({
|
|
2223
2223
|
type: "dropenter",
|
|
@@ -2226,7 +2226,7 @@ function $r(e) {
|
|
|
2226
2226
|
});
|
|
2227
2227
|
}
|
|
2228
2228
|
}, l = (i) => {
|
|
2229
|
-
if (
|
|
2229
|
+
if (n(!1), typeof e.onDropExit == "function") {
|
|
2230
2230
|
let d = i.currentTarget.getBoundingClientRect();
|
|
2231
2231
|
e.onDropExit({
|
|
2232
2232
|
type: "dropexit",
|
|
@@ -2237,106 +2237,106 @@ function $r(e) {
|
|
|
2237
2237
|
}, m = (i) => {
|
|
2238
2238
|
i.preventDefault(), i.stopPropagation();
|
|
2239
2239
|
let d = Ge(i);
|
|
2240
|
-
if (i.clientX ===
|
|
2241
|
-
i.dataTransfer.dropEffect =
|
|
2240
|
+
if (i.clientX === o.x && i.clientY === o.y && d === o.allowedOperations) {
|
|
2241
|
+
i.dataTransfer.dropEffect = o.dropEffect;
|
|
2242
2242
|
return;
|
|
2243
2243
|
}
|
|
2244
|
-
|
|
2245
|
-
let
|
|
2246
|
-
if (d !==
|
|
2247
|
-
let
|
|
2244
|
+
o.x = i.clientX, o.y = i.clientY;
|
|
2245
|
+
let s = o.dropEffect;
|
|
2246
|
+
if (d !== o.allowedOperations) {
|
|
2247
|
+
let b = $e(d), $ = b[0];
|
|
2248
2248
|
if (typeof e.getDropOperation == "function") {
|
|
2249
|
-
let h = new
|
|
2250
|
-
|
|
2249
|
+
let h = new ae(i.dataTransfer);
|
|
2250
|
+
$ = le(d, e.getDropOperation(h, b));
|
|
2251
2251
|
}
|
|
2252
|
-
|
|
2252
|
+
o.dropEffect = Ee[$] || "none";
|
|
2253
2253
|
}
|
|
2254
2254
|
if (typeof e.getDropOperationForPoint == "function") {
|
|
2255
|
-
let
|
|
2256
|
-
|
|
2255
|
+
let b = new ae(i.dataTransfer), $ = i.currentTarget.getBoundingClientRect(), h = le(d, e.getDropOperationForPoint(b, $e(d), o.x - $.x, o.y - $.y));
|
|
2256
|
+
o.dropEffect = Ee[h] || "none";
|
|
2257
2257
|
}
|
|
2258
|
-
if (
|
|
2259
|
-
let
|
|
2258
|
+
if (o.allowedOperations = d, i.dataTransfer.dropEffect = o.dropEffect, o.dropEffect === "none" && s !== "none" ? l(i) : o.dropEffect !== "none" && s === "none" && a(i), typeof e.onDropMove == "function" && o.dropEffect !== "none") {
|
|
2259
|
+
let b = i.currentTarget.getBoundingClientRect();
|
|
2260
2260
|
e.onDropMove({
|
|
2261
2261
|
type: "dropmove",
|
|
2262
|
-
x:
|
|
2263
|
-
y:
|
|
2262
|
+
x: o.x - b.x,
|
|
2263
|
+
y: o.y - b.y
|
|
2264
2264
|
});
|
|
2265
2265
|
}
|
|
2266
|
-
if (clearTimeout(
|
|
2267
|
-
let
|
|
2268
|
-
|
|
2269
|
-
|
|
2266
|
+
if (clearTimeout(o.dropActivateTimer), e.onDropActivate && typeof e.onDropActivate == "function" && o.dropEffect !== "none") {
|
|
2267
|
+
let b = e.onDropActivate, $ = i.currentTarget.getBoundingClientRect();
|
|
2268
|
+
o.dropActivateTimer = setTimeout(() => {
|
|
2269
|
+
b({
|
|
2270
2270
|
type: "dropactivate",
|
|
2271
|
-
x:
|
|
2272
|
-
y:
|
|
2271
|
+
x: o.x - $.x,
|
|
2272
|
+
y: o.y - $.y
|
|
2273
2273
|
});
|
|
2274
|
-
},
|
|
2274
|
+
}, vr);
|
|
2275
2275
|
}
|
|
2276
|
-
},
|
|
2277
|
-
if (i.preventDefault(), i.stopPropagation(),
|
|
2278
|
-
let d = Ge(i),
|
|
2276
|
+
}, g = (i) => {
|
|
2277
|
+
if (i.preventDefault(), i.stopPropagation(), o.dragOverElements.add(i.target), o.dragOverElements.size > 1) return;
|
|
2278
|
+
let d = Ge(i), s = $e(d), b = s[0];
|
|
2279
2279
|
if (typeof e.getDropOperation == "function") {
|
|
2280
|
-
let
|
|
2281
|
-
|
|
2280
|
+
let $ = new ae(i.dataTransfer);
|
|
2281
|
+
b = le(d, e.getDropOperation($, s));
|
|
2282
2282
|
}
|
|
2283
2283
|
if (typeof e.getDropOperationForPoint == "function") {
|
|
2284
|
-
let
|
|
2285
|
-
|
|
2284
|
+
let $ = new ae(i.dataTransfer), h = i.currentTarget.getBoundingClientRect();
|
|
2285
|
+
b = le(d, e.getDropOperationForPoint($, s, i.clientX - h.x, i.clientY - h.y));
|
|
2286
2286
|
}
|
|
2287
|
-
|
|
2288
|
-
},
|
|
2289
|
-
i.preventDefault(), i.stopPropagation(),
|
|
2290
|
-
for (let d of
|
|
2291
|
-
|
|
2287
|
+
o.x = i.clientX, o.y = i.clientY, o.allowedOperations = d, o.dropEffect = Ee[b] || "none", i.dataTransfer.dropEffect = o.dropEffect, b !== "cancel" && a(i);
|
|
2288
|
+
}, c = (i) => {
|
|
2289
|
+
i.preventDefault(), i.stopPropagation(), o.dragOverElements.delete(i.target);
|
|
2290
|
+
for (let d of o.dragOverElements) i.currentTarget.contains(d) || o.dragOverElements.delete(d);
|
|
2291
|
+
o.dragOverElements.size > 0 || (o.dropEffect !== "none" && l(i), clearTimeout(o.dropActivateTimer));
|
|
2292
2292
|
}, B = (i) => {
|
|
2293
|
-
if (i.preventDefault(), i.stopPropagation(),
|
|
2294
|
-
let
|
|
2293
|
+
if (i.preventDefault(), i.stopPropagation(), ge(o.dropEffect), typeof e.onDrop == "function") {
|
|
2294
|
+
let s = te[o.dropEffect], b = or(i.dataTransfer), $ = i.currentTarget.getBoundingClientRect(), h = {
|
|
2295
2295
|
type: "drop",
|
|
2296
|
-
x: i.clientX -
|
|
2297
|
-
y: i.clientY - y
|
|
2298
|
-
items:
|
|
2299
|
-
dropOperation:
|
|
2296
|
+
x: i.clientX - $.x,
|
|
2297
|
+
y: i.clientY - $.y,
|
|
2298
|
+
items: b,
|
|
2299
|
+
dropOperation: s
|
|
2300
2300
|
};
|
|
2301
2301
|
e.onDrop(h);
|
|
2302
2302
|
}
|
|
2303
2303
|
let d = {
|
|
2304
2304
|
...z
|
|
2305
2305
|
};
|
|
2306
|
-
|
|
2307
|
-
},
|
|
2306
|
+
o.dragOverElements.clear(), l(i), clearTimeout(o.dropActivateTimer), d.draggingCollectionRef == null ? ge(void 0) : cr(d);
|
|
2307
|
+
}, p = ee((i) => {
|
|
2308
2308
|
typeof e.onDropEnter == "function" && e.onDropEnter(i);
|
|
2309
|
-
}), C =
|
|
2309
|
+
}), C = ee((i) => {
|
|
2310
2310
|
typeof e.onDropExit == "function" && e.onDropExit(i);
|
|
2311
|
-
}),
|
|
2311
|
+
}), f = ee((i) => {
|
|
2312
2312
|
typeof e.onDropActivate == "function" && e.onDropActivate(i);
|
|
2313
|
-
}), x =
|
|
2313
|
+
}), x = ee((i) => {
|
|
2314
2314
|
typeof e.onDrop == "function" && e.onDrop(i);
|
|
2315
|
-
}),
|
|
2316
|
-
|
|
2317
|
-
if (!(r || !
|
|
2318
|
-
return
|
|
2319
|
-
element:
|
|
2320
|
-
getDropOperation:
|
|
2315
|
+
}), D = ee((i, d) => e.getDropOperation ? e.getDropOperation(i, d) : d[0]), { ref: E } = e;
|
|
2316
|
+
ru(() => {
|
|
2317
|
+
if (!(r || !E.current))
|
|
2318
|
+
return Eu({
|
|
2319
|
+
element: E.current,
|
|
2320
|
+
getDropOperation: D,
|
|
2321
2321
|
onDropEnter(i) {
|
|
2322
|
-
|
|
2322
|
+
n(!0), p(i);
|
|
2323
2323
|
},
|
|
2324
2324
|
onDropExit(i) {
|
|
2325
|
-
|
|
2325
|
+
n(!1), C(i);
|
|
2326
2326
|
},
|
|
2327
2327
|
onDrop: x,
|
|
2328
|
-
onDropActivate:
|
|
2328
|
+
onDropActivate: f
|
|
2329
2329
|
});
|
|
2330
2330
|
}, [
|
|
2331
2331
|
r,
|
|
2332
|
-
|
|
2333
|
-
s,
|
|
2332
|
+
E,
|
|
2334
2333
|
D,
|
|
2334
|
+
p,
|
|
2335
2335
|
C,
|
|
2336
2336
|
x,
|
|
2337
|
-
|
|
2337
|
+
f
|
|
2338
2338
|
]);
|
|
2339
|
-
let { dropProps:
|
|
2339
|
+
let { dropProps: y } = ut();
|
|
2340
2340
|
return r ? {
|
|
2341
2341
|
dropProps: {},
|
|
2342
2342
|
dropButtonProps: {
|
|
@@ -2345,65 +2345,65 @@ function $r(e) {
|
|
|
2345
2345
|
isDropTarget: !1
|
|
2346
2346
|
} : {
|
|
2347
2347
|
dropProps: {
|
|
2348
|
-
...!u &&
|
|
2349
|
-
onDragEnter:
|
|
2348
|
+
...!u && y,
|
|
2349
|
+
onDragEnter: g,
|
|
2350
2350
|
onDragOver: m,
|
|
2351
|
-
onDragLeave:
|
|
2351
|
+
onDragLeave: c,
|
|
2352
2352
|
onDrop: B
|
|
2353
2353
|
},
|
|
2354
2354
|
dropButtonProps: {
|
|
2355
|
-
...u &&
|
|
2355
|
+
...u && y
|
|
2356
2356
|
},
|
|
2357
2357
|
isDropTarget: t
|
|
2358
2358
|
};
|
|
2359
2359
|
}
|
|
2360
2360
|
function Ge(e) {
|
|
2361
|
-
let u =
|
|
2362
|
-
|
|
2361
|
+
let u = pu[e.dataTransfer.effectAllowed];
|
|
2362
|
+
Fe && (u &= Fe);
|
|
2363
2363
|
let r = I.none;
|
|
2364
|
-
return
|
|
2364
|
+
return Ut() ? (e.altKey && (r |= I.copy), e.ctrlKey && !qt() && (r |= I.link), e.metaKey && (r |= I.move)) : (e.altKey && (r |= I.link), e.shiftKey && (r |= I.move), e.ctrlKey && (r |= I.copy)), r ? u & r : u;
|
|
2365
2365
|
}
|
|
2366
|
-
function
|
|
2366
|
+
function $e(e) {
|
|
2367
2367
|
let u = [];
|
|
2368
2368
|
return e & I.move && u.push("move"), e & I.copy && u.push("copy"), e & I.link && u.push("link"), u;
|
|
2369
2369
|
}
|
|
2370
|
-
function
|
|
2370
|
+
function le(e, u) {
|
|
2371
2371
|
let r = I[u];
|
|
2372
2372
|
return e & r ? u : "cancel";
|
|
2373
2373
|
}
|
|
2374
|
-
function
|
|
2374
|
+
function kr(e, u, r, t, n = !1, o = !1) {
|
|
2375
2375
|
switch (t) {
|
|
2376
2376
|
case "left":
|
|
2377
|
-
return
|
|
2377
|
+
return n ? ye(e, u, r, o, "left") : ve(e, u, r, o, "left");
|
|
2378
2378
|
case "right":
|
|
2379
|
-
return
|
|
2379
|
+
return n ? ve(e, u, r, o, "right") : ye(e, u, r, o, "right");
|
|
2380
2380
|
case "up":
|
|
2381
|
-
return
|
|
2381
|
+
return ve(e, u, r, o);
|
|
2382
2382
|
case "down":
|
|
2383
|
-
return
|
|
2383
|
+
return ye(e, u, r, o);
|
|
2384
2384
|
}
|
|
2385
2385
|
}
|
|
2386
|
-
function
|
|
2386
|
+
function ye(e, u, r, t = !1, n = null) {
|
|
2387
2387
|
if (!r) return {
|
|
2388
2388
|
type: "root"
|
|
2389
2389
|
};
|
|
2390
2390
|
if (r.type === "root") {
|
|
2391
|
-
var
|
|
2392
|
-
let
|
|
2393
|
-
return
|
|
2391
|
+
var o, a;
|
|
2392
|
+
let c = (a = (o = e.getFirstKey) === null || o === void 0 ? void 0 : o.call(e)) !== null && a !== void 0 ? a : null;
|
|
2393
|
+
return c != null ? {
|
|
2394
2394
|
type: "item",
|
|
2395
|
-
key:
|
|
2395
|
+
key: c,
|
|
2396
2396
|
dropPosition: "before"
|
|
2397
2397
|
} : null;
|
|
2398
2398
|
}
|
|
2399
2399
|
if (r.type === "item") {
|
|
2400
|
-
var l, m,
|
|
2401
|
-
let
|
|
2402
|
-
|
|
2400
|
+
var l, m, g;
|
|
2401
|
+
let c = null;
|
|
2402
|
+
n ? c = n === "right" ? (l = e.getKeyRightOf) === null || l === void 0 ? void 0 : l.call(e, r.key) : (m = e.getKeyLeftOf) === null || m === void 0 ? void 0 : m.call(e, r.key) : c = (g = e.getKeyBelow) === null || g === void 0 ? void 0 : g.call(e, r.key);
|
|
2403
2403
|
let B = u.getKeyAfter(r.key);
|
|
2404
|
-
if (
|
|
2404
|
+
if (c != null && c !== B) return {
|
|
2405
2405
|
type: "item",
|
|
2406
|
-
key:
|
|
2406
|
+
key: c,
|
|
2407
2407
|
dropPosition: r.dropPosition
|
|
2408
2408
|
};
|
|
2409
2409
|
switch (r.dropPosition) {
|
|
@@ -2414,8 +2414,8 @@ function $e(e, u, r, t = !1, o = null) {
|
|
|
2414
2414
|
dropPosition: "on"
|
|
2415
2415
|
};
|
|
2416
2416
|
case "on": {
|
|
2417
|
-
let
|
|
2418
|
-
return
|
|
2417
|
+
let p = u.getItem(r.key), C = c != null ? u.getItem(c) : null;
|
|
2418
|
+
return p && C && C.level >= p.level ? {
|
|
2419
2419
|
type: "item",
|
|
2420
2420
|
key: C.key,
|
|
2421
2421
|
dropPosition: "before"
|
|
@@ -2426,9 +2426,9 @@ function $e(e, u, r, t = !1, o = null) {
|
|
|
2426
2426
|
};
|
|
2427
2427
|
}
|
|
2428
2428
|
case "after": {
|
|
2429
|
-
let
|
|
2430
|
-
if (
|
|
2431
|
-
let C = u.getItem(
|
|
2429
|
+
let p = u.getItem(r.key);
|
|
2430
|
+
if (p && p.nextKey == null && p.parentKey != null) {
|
|
2431
|
+
let C = u.getItem(p.parentKey);
|
|
2432
2432
|
if (C?.nextKey != null) return {
|
|
2433
2433
|
type: "item",
|
|
2434
2434
|
key: C.nextKey,
|
|
@@ -2440,9 +2440,9 @@ function $e(e, u, r, t = !1, o = null) {
|
|
|
2440
2440
|
dropPosition: "after"
|
|
2441
2441
|
};
|
|
2442
2442
|
}
|
|
2443
|
-
if (
|
|
2443
|
+
if (p?.nextKey != null) return {
|
|
2444
2444
|
type: "item",
|
|
2445
|
-
key:
|
|
2445
|
+
key: p.nextKey,
|
|
2446
2446
|
dropPosition: "on"
|
|
2447
2447
|
};
|
|
2448
2448
|
}
|
|
@@ -2452,41 +2452,41 @@ function $e(e, u, r, t = !1, o = null) {
|
|
|
2452
2452
|
type: "root"
|
|
2453
2453
|
} : null;
|
|
2454
2454
|
}
|
|
2455
|
-
function
|
|
2455
|
+
function ve(e, u, r, t = !1, n = null) {
|
|
2456
2456
|
if (!r || t && r.type === "root") {
|
|
2457
|
-
var
|
|
2458
|
-
let
|
|
2459
|
-
for (;
|
|
2460
|
-
|
|
2461
|
-
let B = u.getItem(
|
|
2462
|
-
|
|
2457
|
+
var o;
|
|
2458
|
+
let g = null, c = (o = e.getLastKey) === null || o === void 0 ? void 0 : o.call(e);
|
|
2459
|
+
for (; c != null; ) {
|
|
2460
|
+
g = c;
|
|
2461
|
+
let B = u.getItem(c);
|
|
2462
|
+
c = B?.parentKey;
|
|
2463
2463
|
}
|
|
2464
|
-
return
|
|
2464
|
+
return g != null ? {
|
|
2465
2465
|
type: "item",
|
|
2466
|
-
key:
|
|
2466
|
+
key: g,
|
|
2467
2467
|
dropPosition: "after"
|
|
2468
2468
|
} : null;
|
|
2469
2469
|
}
|
|
2470
2470
|
if (r.type === "item") {
|
|
2471
2471
|
var a, l, m;
|
|
2472
|
-
let
|
|
2473
|
-
|
|
2474
|
-
let
|
|
2475
|
-
if (
|
|
2472
|
+
let g = null;
|
|
2473
|
+
n ? g = n === "left" ? (a = e.getKeyLeftOf) === null || a === void 0 ? void 0 : a.call(e, r.key) : (l = e.getKeyRightOf) === null || l === void 0 ? void 0 : l.call(e, r.key) : g = (m = e.getKeyAbove) === null || m === void 0 ? void 0 : m.call(e, r.key);
|
|
2474
|
+
let c = u.getKeyBefore(r.key);
|
|
2475
|
+
if (g != null && g !== c) return {
|
|
2476
2476
|
type: "item",
|
|
2477
|
-
key:
|
|
2477
|
+
key: g,
|
|
2478
2478
|
dropPosition: r.dropPosition
|
|
2479
2479
|
};
|
|
2480
2480
|
switch (r.dropPosition) {
|
|
2481
2481
|
case "before": {
|
|
2482
2482
|
let B = u.getItem(r.key);
|
|
2483
2483
|
if (B && B.prevKey != null) {
|
|
2484
|
-
let
|
|
2485
|
-
if (
|
|
2484
|
+
let p = Xe(u, B.prevKey);
|
|
2485
|
+
if (p) return p;
|
|
2486
2486
|
}
|
|
2487
|
-
return
|
|
2487
|
+
return g != null ? {
|
|
2488
2488
|
type: "item",
|
|
2489
|
-
key:
|
|
2489
|
+
key: g,
|
|
2490
2490
|
dropPosition: "on"
|
|
2491
2491
|
} : {
|
|
2492
2492
|
type: "root"
|
|
@@ -2499,7 +2499,7 @@ function ye(e, u, r, t = !1, o = null) {
|
|
|
2499
2499
|
dropPosition: "before"
|
|
2500
2500
|
};
|
|
2501
2501
|
case "after": {
|
|
2502
|
-
let B =
|
|
2502
|
+
let B = Xe(u, r.key);
|
|
2503
2503
|
return B || {
|
|
2504
2504
|
type: "item",
|
|
2505
2505
|
key: r.key,
|
|
@@ -2512,11 +2512,11 @@ function ye(e, u, r, t = !1, o = null) {
|
|
|
2512
2512
|
type: "root"
|
|
2513
2513
|
} : null;
|
|
2514
2514
|
}
|
|
2515
|
-
function
|
|
2516
|
-
let r = e.getItem(u), t = e.getKeyAfter(u),
|
|
2517
|
-
if (r &&
|
|
2518
|
-
let
|
|
2519
|
-
for (let l of
|
|
2515
|
+
function Xe(e, u) {
|
|
2516
|
+
let r = e.getItem(u), t = e.getKeyAfter(u), n = t != null ? e.getItem(t) : null;
|
|
2517
|
+
if (r && n && n.level > r.level) {
|
|
2518
|
+
let o = xt(r, e), a = null;
|
|
2519
|
+
for (let l of o) l.type === "item" && (a = l);
|
|
2520
2520
|
if (a) return {
|
|
2521
2521
|
type: "item",
|
|
2522
2522
|
key: a.key,
|
|
@@ -2525,250 +2525,250 @@ function qe(e, u) {
|
|
|
2525
2525
|
}
|
|
2526
2526
|
return null;
|
|
2527
2527
|
}
|
|
2528
|
-
const
|
|
2529
|
-
function
|
|
2530
|
-
let u =
|
|
2531
|
-
|
|
2528
|
+
const de = 20;
|
|
2529
|
+
function Ar(e) {
|
|
2530
|
+
let u = S(null), r = S(!0), t = S(!0);
|
|
2531
|
+
L(() => {
|
|
2532
2532
|
if (e.current) {
|
|
2533
|
-
u.current =
|
|
2533
|
+
u.current = Ht(e.current) ? e.current : Nt(e.current);
|
|
2534
2534
|
let a = window.getComputedStyle(u.current);
|
|
2535
2535
|
r.current = /(auto|scroll)/.test(a.overflowX), t.current = /(auto|scroll)/.test(a.overflowY);
|
|
2536
2536
|
}
|
|
2537
2537
|
}, [
|
|
2538
2538
|
e
|
|
2539
2539
|
]);
|
|
2540
|
-
let
|
|
2540
|
+
let n = S({
|
|
2541
2541
|
timer: void 0,
|
|
2542
2542
|
dx: 0,
|
|
2543
2543
|
dy: 0
|
|
2544
2544
|
}).current;
|
|
2545
|
-
|
|
2546
|
-
|
|
2545
|
+
L(() => () => {
|
|
2546
|
+
n.timer && (cancelAnimationFrame(n.timer), n.timer = void 0);
|
|
2547
2547
|
}, [
|
|
2548
|
-
|
|
2548
|
+
n
|
|
2549
2549
|
]);
|
|
2550
|
-
let
|
|
2551
|
-
r.current && u.current && (u.current.scrollLeft +=
|
|
2550
|
+
let o = J(() => {
|
|
2551
|
+
r.current && u.current && (u.current.scrollLeft += n.dx), t.current && u.current && (u.current.scrollTop += n.dy), n.timer && (n.timer = requestAnimationFrame(o));
|
|
2552
2552
|
}, [
|
|
2553
2553
|
u,
|
|
2554
|
-
|
|
2554
|
+
n
|
|
2555
2555
|
]);
|
|
2556
2556
|
return {
|
|
2557
2557
|
move(a, l) {
|
|
2558
|
-
if (!
|
|
2559
|
-
let m = u.current.getBoundingClientRect(),
|
|
2560
|
-
a <
|
|
2558
|
+
if (!Gt() || Xt() || !u.current) return;
|
|
2559
|
+
let m = u.current.getBoundingClientRect(), g = de, c = de, B = m.height - de, p = m.width - de;
|
|
2560
|
+
a < g || a > p || l < c || l > B ? (a < g ? n.dx = a - g : a > p && (n.dx = a - p), l < c ? n.dy = l - c : l > B && (n.dy = l - B), n.timer || (n.timer = requestAnimationFrame(o))) : this.stop();
|
|
2561
2561
|
},
|
|
2562
2562
|
stop() {
|
|
2563
|
-
|
|
2563
|
+
n.timer && (cancelAnimationFrame(n.timer), n.timer = void 0);
|
|
2564
2564
|
}
|
|
2565
2565
|
};
|
|
2566
2566
|
}
|
|
2567
|
-
function
|
|
2568
|
-
let t =
|
|
2567
|
+
function Tr(e, u, r) {
|
|
2568
|
+
let t = S({
|
|
2569
2569
|
props: e,
|
|
2570
2570
|
state: u,
|
|
2571
2571
|
nextTarget: null,
|
|
2572
2572
|
dropOperation: null
|
|
2573
2573
|
}).current;
|
|
2574
2574
|
t.props = e, t.state = u;
|
|
2575
|
-
let
|
|
2576
|
-
let { onInsert: C, onRootDrop:
|
|
2577
|
-
(
|
|
2578
|
-
let
|
|
2579
|
-
return T.kind === "directory" ?
|
|
2580
|
-
|
|
2581
|
-
]) :
|
|
2575
|
+
let n = J(async (p) => {
|
|
2576
|
+
let { onInsert: C, onRootDrop: f, onItemDrop: x, onReorder: D, onMove: E, acceptedDragTypes: y = "all", shouldAcceptItemDrop: i } = t.props, { draggingKeys: d } = z, s = H(r), { target: b, dropOperation: $, items: h } = p, k = h;
|
|
2577
|
+
(y !== "all" || i) && (k = h.filter((T) => {
|
|
2578
|
+
let K;
|
|
2579
|
+
return T.kind === "directory" ? K = /* @__PURE__ */ new Set([
|
|
2580
|
+
mu
|
|
2581
|
+
]) : K = T.kind === "file" ? /* @__PURE__ */ new Set([
|
|
2582
2582
|
T.type
|
|
2583
|
-
]) : T.types,
|
|
2584
|
-
})), k.length > 0 && (
|
|
2583
|
+
]) : T.types, y === "all" || y.some((O) => K.has(O)) ? b.type === "item" && b.dropPosition === "on" && i ? i(b, K) : !0 : !1;
|
|
2584
|
+
})), k.length > 0 && (b.type === "root" && f && await f({
|
|
2585
2585
|
items: k,
|
|
2586
|
-
dropOperation:
|
|
2587
|
-
}),
|
|
2586
|
+
dropOperation: $
|
|
2587
|
+
}), b.type === "item" && (b.dropPosition === "on" && x && await x({
|
|
2588
2588
|
items: k,
|
|
2589
|
-
dropOperation:
|
|
2590
|
-
isInternal:
|
|
2591
|
-
target:
|
|
2592
|
-
}),
|
|
2589
|
+
dropOperation: $,
|
|
2590
|
+
isInternal: s,
|
|
2591
|
+
target: b
|
|
2592
|
+
}), E && s && await E({
|
|
2593
2593
|
keys: d,
|
|
2594
|
-
dropOperation:
|
|
2595
|
-
target:
|
|
2596
|
-
}),
|
|
2594
|
+
dropOperation: $,
|
|
2595
|
+
target: b
|
|
2596
|
+
}), b.dropPosition !== "on" && (!s && C && await C({
|
|
2597
2597
|
items: k,
|
|
2598
|
-
dropOperation:
|
|
2599
|
-
target:
|
|
2600
|
-
}),
|
|
2598
|
+
dropOperation: $,
|
|
2599
|
+
target: b
|
|
2600
|
+
}), s && D && await D({
|
|
2601
2601
|
keys: d,
|
|
2602
|
-
dropOperation:
|
|
2603
|
-
target:
|
|
2602
|
+
dropOperation: $,
|
|
2603
|
+
target: b
|
|
2604
2604
|
}))));
|
|
2605
2605
|
}, [
|
|
2606
2606
|
t,
|
|
2607
2607
|
r
|
|
2608
|
-
]),
|
|
2608
|
+
]), o = Ar(r), { dropProps: a } = hr({
|
|
2609
2609
|
ref: r,
|
|
2610
2610
|
onDropEnter() {
|
|
2611
2611
|
t.nextTarget != null && u.setTarget(t.nextTarget);
|
|
2612
2612
|
},
|
|
2613
|
-
onDropMove(
|
|
2614
|
-
t.nextTarget != null && u.setTarget(t.nextTarget),
|
|
2613
|
+
onDropMove(p) {
|
|
2614
|
+
t.nextTarget != null && u.setTarget(t.nextTarget), o.move(p.x, p.y);
|
|
2615
2615
|
},
|
|
2616
|
-
getDropOperationForPoint(
|
|
2617
|
-
let { draggingKeys:
|
|
2618
|
-
target:
|
|
2619
|
-
types:
|
|
2616
|
+
getDropOperationForPoint(p, C, f, x) {
|
|
2617
|
+
let { draggingKeys: D, dropCollectionRef: E } = z, y = H(r), i = (s) => u.getDropOperation({
|
|
2618
|
+
target: s,
|
|
2619
|
+
types: p,
|
|
2620
2620
|
allowedOperations: C,
|
|
2621
|
-
isInternal:
|
|
2622
|
-
draggingKeys:
|
|
2623
|
-
}) !== "cancel", d = e.dropTargetDelegate.getDropTargetFromPoint(
|
|
2621
|
+
isInternal: y,
|
|
2622
|
+
draggingKeys: D
|
|
2623
|
+
}) !== "cancel", d = e.dropTargetDelegate.getDropTargetFromPoint(f, x, i);
|
|
2624
2624
|
if (!d)
|
|
2625
2625
|
return t.dropOperation = "cancel", t.nextTarget = null, "cancel";
|
|
2626
2626
|
if (t.dropOperation = u.getDropOperation({
|
|
2627
2627
|
target: d,
|
|
2628
|
-
types:
|
|
2628
|
+
types: p,
|
|
2629
2629
|
allowedOperations: C,
|
|
2630
|
-
isInternal:
|
|
2631
|
-
draggingKeys:
|
|
2630
|
+
isInternal: y,
|
|
2631
|
+
draggingKeys: D
|
|
2632
2632
|
}), t.dropOperation === "cancel") {
|
|
2633
|
-
let
|
|
2633
|
+
let s = {
|
|
2634
2634
|
type: "root"
|
|
2635
|
-
},
|
|
2636
|
-
target:
|
|
2637
|
-
types:
|
|
2635
|
+
}, b = u.getDropOperation({
|
|
2636
|
+
target: s,
|
|
2637
|
+
types: p,
|
|
2638
2638
|
allowedOperations: C,
|
|
2639
|
-
isInternal:
|
|
2640
|
-
draggingKeys:
|
|
2639
|
+
isInternal: y,
|
|
2640
|
+
draggingKeys: D
|
|
2641
2641
|
});
|
|
2642
|
-
|
|
2642
|
+
b !== "cancel" && (d = s, t.dropOperation = b);
|
|
2643
2643
|
}
|
|
2644
|
-
return d && t.dropOperation !== "cancel" && r?.current !==
|
|
2644
|
+
return d && t.dropOperation !== "cancel" && r?.current !== E?.current && Z(r), t.nextTarget = t.dropOperation === "cancel" ? null : d, t.dropOperation;
|
|
2645
2645
|
},
|
|
2646
2646
|
onDropExit() {
|
|
2647
|
-
Z(void 0), u.setTarget(null),
|
|
2647
|
+
Z(void 0), u.setTarget(null), o.stop();
|
|
2648
2648
|
},
|
|
2649
|
-
onDropActivate(
|
|
2649
|
+
onDropActivate(p) {
|
|
2650
2650
|
var C;
|
|
2651
2651
|
((C = u.target) === null || C === void 0 ? void 0 : C.type) === "item" && typeof e.onDropActivate == "function" && e.onDropActivate({
|
|
2652
2652
|
type: "dropactivate",
|
|
2653
|
-
x:
|
|
2654
|
-
y:
|
|
2653
|
+
x: p.x,
|
|
2654
|
+
y: p.y,
|
|
2655
2655
|
target: u.target
|
|
2656
2656
|
});
|
|
2657
2657
|
},
|
|
2658
|
-
onDrop(
|
|
2659
|
-
Z(r), u.target && p
|
|
2658
|
+
onDrop(p) {
|
|
2659
|
+
Z(r), u.target && g(p, u.target);
|
|
2660
2660
|
let { draggingCollectionRef: C } = z;
|
|
2661
|
-
C == null &&
|
|
2661
|
+
C == null && bu();
|
|
2662
2662
|
}
|
|
2663
|
-
}), l =
|
|
2664
|
-
let { state:
|
|
2663
|
+
}), l = S(null), m = J(() => {
|
|
2664
|
+
let { state: p } = t;
|
|
2665
2665
|
if (l.current) {
|
|
2666
2666
|
var C;
|
|
2667
|
-
let { target:
|
|
2668
|
-
if (
|
|
2669
|
-
let
|
|
2670
|
-
for (let
|
|
2671
|
-
if (
|
|
2672
|
-
let
|
|
2673
|
-
if (
|
|
2674
|
-
let h =
|
|
2675
|
-
h?.type === "cell" && (
|
|
2667
|
+
let { target: D, collection: E, selectedKeys: y, focusedKey: i, isInternal: d, draggingKeys: s } = l.current;
|
|
2668
|
+
if (p.collection.size > E.size && p.selectionManager.isSelectionEqual(y)) {
|
|
2669
|
+
let b = /* @__PURE__ */ new Set();
|
|
2670
|
+
for (let $ of p.collection.getKeys()) E.getItem($) || b.add($);
|
|
2671
|
+
if (p.selectionManager.setSelectedKeys(b), p.selectionManager.focusedKey === i) {
|
|
2672
|
+
let $ = b.keys().next().value;
|
|
2673
|
+
if ($ != null) {
|
|
2674
|
+
let h = p.collection.getItem($);
|
|
2675
|
+
h?.type === "cell" && ($ = h.parentKey), $ != null && p.selectionManager.setFocusedKey($), p.selectionManager.selectionMode === "none" && oe("keyboard");
|
|
2676
2676
|
}
|
|
2677
2677
|
}
|
|
2678
|
-
} else if (i != null &&
|
|
2679
|
-
var
|
|
2680
|
-
|
|
2681
|
-
} else
|
|
2682
|
-
|
|
2678
|
+
} else if (i != null && p.selectionManager.focusedKey === i && d && D.type === "item" && D.dropPosition !== "on" && s.has((C = p.collection.getItem(i)) === null || C === void 0 ? void 0 : C.parentKey)) {
|
|
2679
|
+
var f, x;
|
|
2680
|
+
p.selectionManager.setFocusedKey((x = (f = p.collection.getItem(i)) === null || f === void 0 ? void 0 : f.parentKey) !== null && x !== void 0 ? x : null), oe("keyboard");
|
|
2681
|
+
} else p.selectionManager.focusedKey === i && D.type === "item" && D.dropPosition === "on" && p.collection.getItem(D.key) != null ? (p.selectionManager.setFocusedKey(D.key), oe("keyboard")) : p.selectionManager.focusedKey != null && !p.selectionManager.isSelected(p.selectionManager.focusedKey) && oe("keyboard");
|
|
2682
|
+
p.selectionManager.setFocused(!0);
|
|
2683
2683
|
}
|
|
2684
2684
|
}, [
|
|
2685
2685
|
t
|
|
2686
|
-
]),
|
|
2687
|
-
let { state:
|
|
2686
|
+
]), g = J((p, C) => {
|
|
2687
|
+
let { state: f } = t;
|
|
2688
2688
|
l.current = {
|
|
2689
2689
|
timeout: void 0,
|
|
2690
|
-
focusedKey:
|
|
2691
|
-
collection:
|
|
2692
|
-
selectedKeys:
|
|
2690
|
+
focusedKey: f.selectionManager.focusedKey,
|
|
2691
|
+
collection: f.collection,
|
|
2692
|
+
selectedKeys: f.selectionManager.selectedKeys,
|
|
2693
2693
|
draggingKeys: z.draggingKeys,
|
|
2694
2694
|
isInternal: H(r),
|
|
2695
2695
|
target: C
|
|
2696
|
-
}, (t.props.onDrop ||
|
|
2696
|
+
}, (t.props.onDrop || n)({
|
|
2697
2697
|
type: "drop",
|
|
2698
|
-
x:
|
|
2699
|
-
y:
|
|
2698
|
+
x: p.x,
|
|
2699
|
+
y: p.y,
|
|
2700
2700
|
target: C,
|
|
2701
|
-
items:
|
|
2702
|
-
dropOperation:
|
|
2701
|
+
items: p.items,
|
|
2702
|
+
dropOperation: p.dropOperation
|
|
2703
2703
|
}), l.current.timeout = setTimeout(() => {
|
|
2704
2704
|
m(), l.current = null;
|
|
2705
2705
|
}, 50);
|
|
2706
2706
|
}, [
|
|
2707
2707
|
t,
|
|
2708
|
-
|
|
2708
|
+
n,
|
|
2709
2709
|
r,
|
|
2710
2710
|
m
|
|
2711
2711
|
]);
|
|
2712
|
-
|
|
2712
|
+
L(() => () => {
|
|
2713
2713
|
l.current && clearTimeout(l.current.timeout);
|
|
2714
|
-
}, []),
|
|
2714
|
+
}, []), ru(() => {
|
|
2715
2715
|
l.current && u.collection !== l.current.collection && m();
|
|
2716
2716
|
});
|
|
2717
|
-
let { direction:
|
|
2718
|
-
|
|
2717
|
+
let { direction: c } = lu();
|
|
2718
|
+
L(() => {
|
|
2719
2719
|
if (!r.current) return;
|
|
2720
|
-
let
|
|
2721
|
-
let d = 0,
|
|
2720
|
+
let p = (x, D = !0, E = "down") => kr(t.props.keyboardDelegate, t.state.collection, x, E, c === "rtl", D), C = (x, D = !0) => p(x, D, "up"), f = (x, D, E, y, i = !0) => {
|
|
2721
|
+
let d = 0, s, { draggingKeys: b } = z, $ = H(r);
|
|
2722
2722
|
do {
|
|
2723
|
-
let h =
|
|
2723
|
+
let h = y(x, i);
|
|
2724
2724
|
if (!h) return null;
|
|
2725
|
-
x = h,
|
|
2725
|
+
x = h, s = t.state.getDropOperation({
|
|
2726
2726
|
target: h,
|
|
2727
|
-
types:
|
|
2728
|
-
allowedOperations:
|
|
2729
|
-
isInternal:
|
|
2730
|
-
draggingKeys:
|
|
2727
|
+
types: D,
|
|
2728
|
+
allowedOperations: E,
|
|
2729
|
+
isInternal: $,
|
|
2730
|
+
draggingKeys: b
|
|
2731
2731
|
}), x.type === "root" && d++;
|
|
2732
|
-
} while (
|
|
2733
|
-
return
|
|
2732
|
+
} while (s === "cancel" && !t.state.isDropTarget(x) && d < 2);
|
|
2733
|
+
return s === "cancel" ? null : x;
|
|
2734
2734
|
};
|
|
2735
|
-
return
|
|
2735
|
+
return Eu({
|
|
2736
2736
|
element: r.current,
|
|
2737
2737
|
preventFocusOnDrop: !0,
|
|
2738
|
-
getDropOperation(x,
|
|
2738
|
+
getDropOperation(x, D) {
|
|
2739
2739
|
if (t.state.target) {
|
|
2740
|
-
let { draggingKeys:
|
|
2740
|
+
let { draggingKeys: y } = z, i = H(r);
|
|
2741
2741
|
return t.state.getDropOperation({
|
|
2742
2742
|
target: t.state.target,
|
|
2743
2743
|
types: x,
|
|
2744
|
-
allowedOperations:
|
|
2744
|
+
allowedOperations: D,
|
|
2745
2745
|
isInternal: i,
|
|
2746
|
-
draggingKeys:
|
|
2746
|
+
draggingKeys: y
|
|
2747
2747
|
});
|
|
2748
2748
|
}
|
|
2749
|
-
return
|
|
2749
|
+
return f(null, x, D, p) ? "move" : "cancel";
|
|
2750
2750
|
},
|
|
2751
|
-
onDropEnter(x,
|
|
2752
|
-
let
|
|
2751
|
+
onDropEnter(x, D) {
|
|
2752
|
+
let E = G(D.items), y = t.state.selectionManager, i = null;
|
|
2753
2753
|
Z(r);
|
|
2754
|
-
let d =
|
|
2755
|
-
if (
|
|
2754
|
+
let d = y.focusedKey, s = "after", b = d != null ? t.state.collection.getItem(d) : null;
|
|
2755
|
+
if (b?.type === "cell" && (d = b.parentKey), d != null && y.isSelected(d) && (y.selectedKeys.size > 1 && y.firstSelectedKey === d ? s = "before" : d = y.lastSelectedKey), d != null) {
|
|
2756
2756
|
i = {
|
|
2757
2757
|
type: "item",
|
|
2758
2758
|
key: d,
|
|
2759
|
-
dropPosition:
|
|
2759
|
+
dropPosition: s
|
|
2760
2760
|
};
|
|
2761
2761
|
let { draggingKeys: h } = z, k = H(r);
|
|
2762
|
-
var
|
|
2762
|
+
var $;
|
|
2763
2763
|
t.state.getDropOperation({
|
|
2764
2764
|
target: i,
|
|
2765
|
-
types:
|
|
2766
|
-
allowedOperations:
|
|
2765
|
+
types: E,
|
|
2766
|
+
allowedOperations: D.allowedDropOperations,
|
|
2767
2767
|
isInternal: k,
|
|
2768
2768
|
draggingKeys: h
|
|
2769
|
-
}) === "cancel" && (i = (
|
|
2769
|
+
}) === "cancel" && (i = ($ = f(i, E, D.allowedDropOperations, p, !1)) !== null && $ !== void 0 ? $ : f(i, E, D.allowedDropOperations, C, !1));
|
|
2770
2770
|
}
|
|
2771
|
-
i || (i =
|
|
2771
|
+
i || (i = f(null, E, D.allowedDropOperations, p)), t.state.setTarget(i);
|
|
2772
2772
|
},
|
|
2773
2773
|
onDropExit() {
|
|
2774
2774
|
Z(void 0), t.state.setTarget(null);
|
|
@@ -2776,71 +2776,71 @@ function hr(e, u, r) {
|
|
|
2776
2776
|
onDropTargetEnter(x) {
|
|
2777
2777
|
t.state.setTarget(x);
|
|
2778
2778
|
},
|
|
2779
|
-
onDropActivate(x,
|
|
2780
|
-
|
|
2779
|
+
onDropActivate(x, D) {
|
|
2780
|
+
D?.type === "item" && D?.dropPosition === "on" && typeof t.props.onDropActivate == "function" && t.props.onDropActivate({
|
|
2781
2781
|
type: "dropactivate",
|
|
2782
2782
|
x: x.x,
|
|
2783
2783
|
y: x.y,
|
|
2784
|
-
target:
|
|
2784
|
+
target: D
|
|
2785
2785
|
});
|
|
2786
2786
|
},
|
|
2787
|
-
onDrop(x,
|
|
2788
|
-
Z(r), t.state.target &&
|
|
2787
|
+
onDrop(x, D) {
|
|
2788
|
+
Z(r), t.state.target && g(x, D || t.state.target);
|
|
2789
2789
|
},
|
|
2790
|
-
onKeyDown(x,
|
|
2791
|
-
var
|
|
2792
|
-
let { keyboardDelegate: i } = t.props, d =
|
|
2790
|
+
onKeyDown(x, D) {
|
|
2791
|
+
var E, y;
|
|
2792
|
+
let { keyboardDelegate: i } = t.props, d = G(D.items);
|
|
2793
2793
|
switch (x.key) {
|
|
2794
2794
|
case "ArrowDown":
|
|
2795
2795
|
if (i.getKeyBelow) {
|
|
2796
|
-
let v =
|
|
2796
|
+
let v = f(t.state.target, d, D.allowedDropOperations, (F, P) => p(F, P, "down"));
|
|
2797
2797
|
t.state.setTarget(v);
|
|
2798
2798
|
}
|
|
2799
2799
|
break;
|
|
2800
2800
|
case "ArrowUp":
|
|
2801
2801
|
if (i.getKeyAbove) {
|
|
2802
|
-
let v =
|
|
2802
|
+
let v = f(t.state.target, d, D.allowedDropOperations, (F, P) => p(F, P, "up"));
|
|
2803
2803
|
t.state.setTarget(v);
|
|
2804
2804
|
}
|
|
2805
2805
|
break;
|
|
2806
2806
|
case "ArrowLeft":
|
|
2807
2807
|
if (i.getKeyLeftOf) {
|
|
2808
|
-
let v =
|
|
2808
|
+
let v = f(t.state.target, d, D.allowedDropOperations, (F, P) => p(F, P, "left"));
|
|
2809
2809
|
t.state.setTarget(v);
|
|
2810
2810
|
}
|
|
2811
2811
|
break;
|
|
2812
2812
|
case "ArrowRight":
|
|
2813
2813
|
if (i.getKeyRightOf) {
|
|
2814
|
-
let v =
|
|
2814
|
+
let v = f(t.state.target, d, D.allowedDropOperations, (F, P) => p(F, P, "right"));
|
|
2815
2815
|
t.state.setTarget(v);
|
|
2816
2816
|
}
|
|
2817
2817
|
break;
|
|
2818
2818
|
case "Home":
|
|
2819
2819
|
if (i.getFirstKey) {
|
|
2820
|
-
let v =
|
|
2820
|
+
let v = f(null, d, D.allowedDropOperations, p);
|
|
2821
2821
|
t.state.setTarget(v);
|
|
2822
2822
|
}
|
|
2823
2823
|
break;
|
|
2824
2824
|
case "End":
|
|
2825
2825
|
if (i.getLastKey) {
|
|
2826
|
-
let v =
|
|
2826
|
+
let v = f(null, d, D.allowedDropOperations, C);
|
|
2827
2827
|
t.state.setTarget(v);
|
|
2828
2828
|
}
|
|
2829
2829
|
break;
|
|
2830
2830
|
case "PageDown":
|
|
2831
2831
|
if (i.getKeyPageBelow) {
|
|
2832
2832
|
let v = t.state.target;
|
|
2833
|
-
if (!v) v =
|
|
2833
|
+
if (!v) v = f(null, d, D.allowedDropOperations, p);
|
|
2834
2834
|
else {
|
|
2835
|
-
var
|
|
2836
|
-
let F = (
|
|
2835
|
+
var s, b;
|
|
2836
|
+
let F = (s = i.getFirstKey) === null || s === void 0 ? void 0 : s.call(i);
|
|
2837
2837
|
v.type === "item" && (F = v.key);
|
|
2838
2838
|
let P = null;
|
|
2839
2839
|
F != null && (P = i.getKeyPageBelow(F));
|
|
2840
2840
|
let V = v.type === "item" ? v.dropPosition : "after";
|
|
2841
|
-
if (P == null || v.type === "item" && v.key === ((
|
|
2842
|
-
var
|
|
2843
|
-
P = (h = (
|
|
2841
|
+
if (P == null || v.type === "item" && v.key === ((b = i.getLastKey) === null || b === void 0 ? void 0 : b.call(i))) {
|
|
2842
|
+
var $, h;
|
|
2843
|
+
P = (h = ($ = i.getLastKey) === null || $ === void 0 ? void 0 : $.call(i)) !== null && h !== void 0 ? h : null, V = "after";
|
|
2844
2844
|
}
|
|
2845
2845
|
if (P == null) break;
|
|
2846
2846
|
v = {
|
|
@@ -2848,15 +2848,15 @@ function hr(e, u, r) {
|
|
|
2848
2848
|
key: P,
|
|
2849
2849
|
dropPosition: V
|
|
2850
2850
|
};
|
|
2851
|
-
let { draggingCollectionRef:
|
|
2851
|
+
let { draggingCollectionRef: R, draggingKeys: M } = z, U = R?.current === r?.current, N = t.state.getDropOperation({
|
|
2852
2852
|
target: v,
|
|
2853
2853
|
types: d,
|
|
2854
|
-
allowedOperations:
|
|
2854
|
+
allowedOperations: D.allowedDropOperations,
|
|
2855
2855
|
isInternal: U,
|
|
2856
2856
|
draggingKeys: M
|
|
2857
2857
|
});
|
|
2858
2858
|
var k;
|
|
2859
|
-
N === "cancel" && (v = (k =
|
|
2859
|
+
N === "cancel" && (v = (k = f(v, d, D.allowedDropOperations, p, !1)) !== null && k !== void 0 ? k : f(v, d, D.allowedDropOperations, C, !1));
|
|
2860
2860
|
}
|
|
2861
2861
|
t.state.setTarget(v ?? t.state.target);
|
|
2862
2862
|
}
|
|
@@ -2864,54 +2864,54 @@ function hr(e, u, r) {
|
|
|
2864
2864
|
case "PageUp": {
|
|
2865
2865
|
if (!i.getKeyPageAbove) break;
|
|
2866
2866
|
let v = t.state.target;
|
|
2867
|
-
if (!v) v =
|
|
2867
|
+
if (!v) v = f(null, d, D.allowedDropOperations, C);
|
|
2868
2868
|
else if (v.type === "item") {
|
|
2869
2869
|
var T;
|
|
2870
2870
|
if (v.key === ((T = i.getFirstKey) === null || T === void 0 ? void 0 : T.call(i))) v = {
|
|
2871
2871
|
type: "root"
|
|
2872
2872
|
};
|
|
2873
2873
|
else {
|
|
2874
|
-
let
|
|
2875
|
-
if (
|
|
2876
|
-
var
|
|
2877
|
-
|
|
2874
|
+
let R = i.getKeyPageAbove(v.key), M = v.dropPosition;
|
|
2875
|
+
if (R == null) {
|
|
2876
|
+
var K;
|
|
2877
|
+
R = (K = i.getFirstKey) === null || K === void 0 ? void 0 : K.call(i), M = "before";
|
|
2878
2878
|
}
|
|
2879
|
-
if (
|
|
2879
|
+
if (R == null) break;
|
|
2880
2880
|
v = {
|
|
2881
2881
|
type: "item",
|
|
2882
|
-
key:
|
|
2882
|
+
key: R,
|
|
2883
2883
|
dropPosition: M
|
|
2884
2884
|
};
|
|
2885
2885
|
}
|
|
2886
2886
|
let { draggingKeys: F } = z, P = H(r), V = t.state.getDropOperation({
|
|
2887
2887
|
target: v,
|
|
2888
2888
|
types: d,
|
|
2889
|
-
allowedOperations:
|
|
2889
|
+
allowedOperations: D.allowedDropOperations,
|
|
2890
2890
|
isInternal: P,
|
|
2891
2891
|
draggingKeys: F
|
|
2892
2892
|
});
|
|
2893
2893
|
var O;
|
|
2894
|
-
V === "cancel" && (v = (O =
|
|
2894
|
+
V === "cancel" && (v = (O = f(v, d, D.allowedDropOperations, C, !1)) !== null && O !== void 0 ? O : f(v, d, D.allowedDropOperations, p, !1));
|
|
2895
2895
|
}
|
|
2896
2896
|
t.state.setTarget(v ?? t.state.target);
|
|
2897
2897
|
break;
|
|
2898
2898
|
}
|
|
2899
2899
|
}
|
|
2900
|
-
(
|
|
2900
|
+
(E = (y = t.props).onKeyDown) === null || E === void 0 || E.call(y, x);
|
|
2901
2901
|
}
|
|
2902
2902
|
});
|
|
2903
2903
|
}, [
|
|
2904
2904
|
t,
|
|
2905
2905
|
r,
|
|
2906
|
-
|
|
2907
|
-
|
|
2906
|
+
g,
|
|
2907
|
+
c
|
|
2908
2908
|
]);
|
|
2909
|
-
let B =
|
|
2910
|
-
return
|
|
2909
|
+
let B = nu();
|
|
2910
|
+
return Oe.set(u, {
|
|
2911
2911
|
id: B,
|
|
2912
2912
|
ref: r
|
|
2913
2913
|
}), {
|
|
2914
|
-
collectionProps:
|
|
2914
|
+
collectionProps: Ie(a, {
|
|
2915
2915
|
id: B,
|
|
2916
2916
|
// Remove description from collection element. If dropping on the entire collection,
|
|
2917
2917
|
// there should be a drop indicator that has this description, so no need to double announce.
|
|
@@ -2919,20 +2919,20 @@ function hr(e, u, r) {
|
|
|
2919
2919
|
})
|
|
2920
2920
|
};
|
|
2921
2921
|
}
|
|
2922
|
-
function
|
|
2923
|
-
let { dropProps: t } =
|
|
2924
|
-
|
|
2925
|
-
if (r.current) return
|
|
2922
|
+
function tt(e, u, r) {
|
|
2923
|
+
let { dropProps: t } = ut(), n = rr(u);
|
|
2924
|
+
L(() => {
|
|
2925
|
+
if (r.current) return pr({
|
|
2926
2926
|
element: r.current,
|
|
2927
2927
|
target: e.target,
|
|
2928
|
-
getDropOperation(
|
|
2929
|
-
let { draggingKeys:
|
|
2928
|
+
getDropOperation(c, B) {
|
|
2929
|
+
let { draggingKeys: p } = z, C = H(n);
|
|
2930
2930
|
return u.getDropOperation({
|
|
2931
2931
|
target: e.target,
|
|
2932
|
-
types:
|
|
2932
|
+
types: c,
|
|
2933
2933
|
allowedOperations: B,
|
|
2934
2934
|
isInternal: C,
|
|
2935
|
-
draggingKeys:
|
|
2935
|
+
draggingKeys: p
|
|
2936
2936
|
});
|
|
2937
2937
|
},
|
|
2938
2938
|
activateButtonRef: e.activateButtonRef
|
|
@@ -2941,86 +2941,86 @@ function _u(e, u, r) {
|
|
|
2941
2941
|
r,
|
|
2942
2942
|
e.target,
|
|
2943
2943
|
u,
|
|
2944
|
-
|
|
2944
|
+
n,
|
|
2945
2945
|
e.activateButtonRef
|
|
2946
2946
|
]);
|
|
2947
|
-
let
|
|
2947
|
+
let o = je(), { draggingKeys: a } = z, l = H(n), m = o && u.getDropOperation({
|
|
2948
2948
|
target: e.target,
|
|
2949
|
-
types:
|
|
2950
|
-
allowedOperations:
|
|
2949
|
+
types: G(o.dragTarget.items),
|
|
2950
|
+
allowedOperations: o.dragTarget.allowedDropOperations,
|
|
2951
2951
|
isInternal: l,
|
|
2952
2952
|
draggingKeys: a
|
|
2953
|
-
}) !== "cancel",
|
|
2954
|
-
return
|
|
2955
|
-
|
|
2953
|
+
}) !== "cancel", g = u.isDropTarget(e.target);
|
|
2954
|
+
return L(() => {
|
|
2955
|
+
o && g && r.current && r.current.focus();
|
|
2956
2956
|
}, [
|
|
2957
|
-
|
|
2958
|
-
|
|
2957
|
+
g,
|
|
2958
|
+
o,
|
|
2959
2959
|
r
|
|
2960
2960
|
]), {
|
|
2961
2961
|
dropProps: {
|
|
2962
2962
|
...t,
|
|
2963
|
-
"aria-hidden": !
|
|
2963
|
+
"aria-hidden": !o || m ? void 0 : "true"
|
|
2964
2964
|
},
|
|
2965
|
-
isDropTarget:
|
|
2965
|
+
isDropTarget: g
|
|
2966
2966
|
};
|
|
2967
2967
|
}
|
|
2968
|
-
function
|
|
2968
|
+
function Fr(e) {
|
|
2969
2969
|
return e && e.__esModule ? e.default : e;
|
|
2970
2970
|
}
|
|
2971
|
-
function
|
|
2972
|
-
let { target: t } = e, { collection:
|
|
2973
|
-
var
|
|
2974
|
-
return
|
|
2975
|
-
},
|
|
2971
|
+
function Sr(e, u, r) {
|
|
2972
|
+
let { target: t } = e, { collection: n } = u, o = Be(Fr(ne), "@react-aria/dnd"), a = je(), { dropProps: l } = tt(e, u, r), m = nu(), g = (D) => {
|
|
2973
|
+
var E, y, i, d;
|
|
2974
|
+
return D == null ? "" : (d = (i = (E = n.getTextValue) === null || E === void 0 ? void 0 : E.call(n, D)) !== null && i !== void 0 ? i : (y = n.getItem(D)) === null || y === void 0 ? void 0 : y.textValue) !== null && d !== void 0 ? d : "";
|
|
2975
|
+
}, c = "", B;
|
|
2976
2976
|
if (t.type === "root")
|
|
2977
|
-
|
|
2978
|
-
else if (t.dropPosition === "on")
|
|
2979
|
-
itemText:
|
|
2977
|
+
c = o.format("dropOnRoot"), B = `${m} ${tr(u)}`;
|
|
2978
|
+
else if (t.dropPosition === "on") c = o.format("dropOnItem", {
|
|
2979
|
+
itemText: g(t.key)
|
|
2980
2980
|
});
|
|
2981
2981
|
else {
|
|
2982
|
-
let
|
|
2982
|
+
let D, E;
|
|
2983
2983
|
if (t.dropPosition === "before") {
|
|
2984
|
-
var
|
|
2985
|
-
let
|
|
2986
|
-
|
|
2987
|
-
} else
|
|
2984
|
+
var p;
|
|
2985
|
+
let y = (p = n.getItem(t.key)) === null || p === void 0 ? void 0 : p.prevKey, i = y != null ? n.getItem(y) : null;
|
|
2986
|
+
D = i?.type === "item" ? i.key : null;
|
|
2987
|
+
} else D = t.key;
|
|
2988
2988
|
if (t.dropPosition === "after") {
|
|
2989
2989
|
var C;
|
|
2990
|
-
let
|
|
2991
|
-
|
|
2992
|
-
} else
|
|
2993
|
-
|
|
2994
|
-
beforeItemText:
|
|
2995
|
-
afterItemText:
|
|
2996
|
-
}) :
|
|
2997
|
-
itemText:
|
|
2998
|
-
}) :
|
|
2999
|
-
itemText:
|
|
2990
|
+
let y = (C = n.getItem(t.key)) === null || C === void 0 ? void 0 : C.nextKey, i = y != null ? n.getItem(y) : null;
|
|
2991
|
+
E = i?.type === "item" ? i.key : null;
|
|
2992
|
+
} else E = t.key;
|
|
2993
|
+
D != null && E != null ? c = o.format("insertBetween", {
|
|
2994
|
+
beforeItemText: g(D),
|
|
2995
|
+
afterItemText: g(E)
|
|
2996
|
+
}) : D != null ? c = o.format("insertAfter", {
|
|
2997
|
+
itemText: g(D)
|
|
2998
|
+
}) : E != null && (c = o.format("insertBefore", {
|
|
2999
|
+
itemText: g(E)
|
|
3000
3000
|
}));
|
|
3001
3001
|
}
|
|
3002
|
-
let
|
|
3002
|
+
let f = u.isDropTarget(t), x = a ? l["aria-hidden"] : "true";
|
|
3003
3003
|
return {
|
|
3004
3004
|
dropIndicatorProps: {
|
|
3005
3005
|
...l,
|
|
3006
3006
|
id: m,
|
|
3007
|
-
"aria-roledescription":
|
|
3008
|
-
"aria-label":
|
|
3007
|
+
"aria-roledescription": o.format("dropIndicator"),
|
|
3008
|
+
"aria-label": c,
|
|
3009
3009
|
"aria-labelledby": B,
|
|
3010
3010
|
"aria-hidden": x,
|
|
3011
3011
|
tabIndex: -1
|
|
3012
3012
|
},
|
|
3013
|
-
isDropTarget:
|
|
3013
|
+
isDropTarget: f,
|
|
3014
3014
|
// If aria-hidden, we are either not in a drag session or the drop target is invalid.
|
|
3015
3015
|
// In that case, there's no need to render anything at all unless we need to show the indicator visually.
|
|
3016
3016
|
// This can happen when dragging using the native DnD API as opposed to keyboard dragging.
|
|
3017
|
-
isHidden: !
|
|
3017
|
+
isHidden: !f && !!x
|
|
3018
3018
|
};
|
|
3019
3019
|
}
|
|
3020
|
-
function
|
|
3020
|
+
function Kr(e) {
|
|
3021
3021
|
return e && e.__esModule ? e.default : e;
|
|
3022
3022
|
}
|
|
3023
|
-
const
|
|
3023
|
+
const Pr = {
|
|
3024
3024
|
keyboard: {
|
|
3025
3025
|
selected: "dragSelectedKeyboard",
|
|
3026
3026
|
notSelected: "dragDescriptionKeyboard"
|
|
@@ -3034,80 +3034,80 @@ const Fr = {
|
|
|
3034
3034
|
notSelected: "dragDescriptionVirtual"
|
|
3035
3035
|
}
|
|
3036
3036
|
};
|
|
3037
|
-
function
|
|
3038
|
-
let r =
|
|
3037
|
+
function Ir(e, u) {
|
|
3038
|
+
let r = Be(Kr(ne), "@react-aria/dnd"), t = u.isDisabled || u.selectionManager.isDisabled(e.key), { dragProps: n, dragButtonProps: o } = Cr({
|
|
3039
3039
|
getItems() {
|
|
3040
3040
|
return u.getItems(e.key);
|
|
3041
3041
|
},
|
|
3042
3042
|
preview: u.preview,
|
|
3043
3043
|
getAllowedDropOperations: u.getAllowedDropOperations,
|
|
3044
3044
|
hasDragButton: e.hasDragButton,
|
|
3045
|
-
onDragStart(
|
|
3046
|
-
u.startDrag(e.key,
|
|
3045
|
+
onDragStart(E) {
|
|
3046
|
+
u.startDrag(e.key, E), sr(u.draggingKeys);
|
|
3047
3047
|
},
|
|
3048
|
-
onDragMove(
|
|
3049
|
-
u.moveDrag(
|
|
3048
|
+
onDragMove(E) {
|
|
3049
|
+
u.moveDrag(E);
|
|
3050
3050
|
},
|
|
3051
|
-
onDragEnd(
|
|
3052
|
-
let { dropOperation:
|
|
3051
|
+
onDragEnd(E) {
|
|
3052
|
+
let { dropOperation: y } = E, i = y === "cancel" ? !1 : H();
|
|
3053
3053
|
u.endDrag({
|
|
3054
|
-
...
|
|
3054
|
+
...E,
|
|
3055
3055
|
keys: u.draggingKeys,
|
|
3056
3056
|
isInternal: i
|
|
3057
|
-
}),
|
|
3057
|
+
}), bu();
|
|
3058
3058
|
}
|
|
3059
|
-
}), a = u.collection.getItem(e.key), l = u.getKeysForDrag(e.key).size, m = l > 1 && u.selectionManager.isSelected(e.key),
|
|
3059
|
+
}), a = u.collection.getItem(e.key), l = u.getKeysForDrag(e.key).size, m = l > 1 && u.selectionManager.isSelected(e.key), g, c, B = Ve();
|
|
3060
3060
|
if (!e.hasDragButton && u.selectionManager.selectionMode !== "none") {
|
|
3061
|
-
let
|
|
3062
|
-
e.hasAction && B === "keyboard" && (
|
|
3061
|
+
let E = Pr[B][m ? "selected" : "notSelected"];
|
|
3062
|
+
e.hasAction && B === "keyboard" && (E += "Alt"), m ? c = r.format(E, {
|
|
3063
3063
|
count: l
|
|
3064
|
-
}) :
|
|
3065
|
-
} else if (m)
|
|
3064
|
+
}) : c = r.format(E), delete n.onClick;
|
|
3065
|
+
} else if (m) g = r.format("dragSelectedItems", {
|
|
3066
3066
|
count: l
|
|
3067
3067
|
});
|
|
3068
3068
|
else {
|
|
3069
|
-
var
|
|
3070
|
-
let
|
|
3071
|
-
|
|
3072
|
-
itemText:
|
|
3069
|
+
var p, C, f, x;
|
|
3070
|
+
let E = (x = (f = (p = (C = u.collection).getTextValue) === null || p === void 0 ? void 0 : p.call(C, e.key)) !== null && f !== void 0 ? f : a?.textValue) !== null && x !== void 0 ? x : "";
|
|
3071
|
+
g = r.format("dragItem", {
|
|
3072
|
+
itemText: E
|
|
3073
3073
|
});
|
|
3074
3074
|
}
|
|
3075
|
-
let
|
|
3076
|
-
if (
|
|
3077
|
-
let { onKeyDownCapture:
|
|
3078
|
-
B === "touch" && delete
|
|
3079
|
-
i.altKey &&
|
|
3080
|
-
},
|
|
3081
|
-
i.altKey &&
|
|
3075
|
+
let D = we(c);
|
|
3076
|
+
if (c && Object.assign(n, D), !e.hasDragButton && e.hasAction) {
|
|
3077
|
+
let { onKeyDownCapture: E, onKeyUpCapture: y } = n;
|
|
3078
|
+
B === "touch" && delete n["aria-describedby"], n.onKeyDownCapture = (i) => {
|
|
3079
|
+
i.altKey && E?.(i);
|
|
3080
|
+
}, n.onKeyUpCapture = (i) => {
|
|
3081
|
+
i.altKey && y?.(i);
|
|
3082
3082
|
};
|
|
3083
3083
|
}
|
|
3084
3084
|
return {
|
|
3085
|
-
dragProps: t ? {} :
|
|
3085
|
+
dragProps: t ? {} : n,
|
|
3086
3086
|
dragButtonProps: {
|
|
3087
|
-
...
|
|
3087
|
+
...o,
|
|
3088
3088
|
isDisabled: t,
|
|
3089
|
-
"aria-label":
|
|
3089
|
+
"aria-label": g
|
|
3090
3090
|
}
|
|
3091
3091
|
};
|
|
3092
3092
|
}
|
|
3093
|
-
function
|
|
3093
|
+
function zr(e, u, r) {
|
|
3094
3094
|
let { draggingCollectionRef: t } = z;
|
|
3095
|
-
u.draggingKeys.size > 0 && t?.current !== r.current &&
|
|
3095
|
+
u.draggingKeys.size > 0 && t?.current !== r.current && dr(r);
|
|
3096
3096
|
}
|
|
3097
|
-
const
|
|
3098
|
-
let t = u.children, [
|
|
3099
|
-
return
|
|
3100
|
-
let
|
|
3101
|
-
|
|
3102
|
-
|
|
3103
|
-
}),
|
|
3104
|
-
|
|
3097
|
+
const wr = /* @__PURE__ */ A.forwardRef(function(u, r) {
|
|
3098
|
+
let t = u.children, [n, o] = X(null), a = S(null), l = S(void 0);
|
|
3099
|
+
return ct(r, () => (m, g) => {
|
|
3100
|
+
let c = t(m), B, p, C;
|
|
3101
|
+
c && typeof c == "object" && "element" in c ? (B = c.element, p = c.x, C = c.y) : B = c, Zt(() => {
|
|
3102
|
+
o(B);
|
|
3103
|
+
}), g(a.current, p, C), l.current = requestAnimationFrame(() => {
|
|
3104
|
+
o(null);
|
|
3105
3105
|
});
|
|
3106
3106
|
}, [
|
|
3107
3107
|
t
|
|
3108
|
-
]),
|
|
3108
|
+
]), L(() => () => {
|
|
3109
3109
|
l.current && cancelAnimationFrame(l.current);
|
|
3110
|
-
}, []),
|
|
3110
|
+
}, []), n ? /* @__PURE__ */ A.createElement("div", {
|
|
3111
3111
|
style: {
|
|
3112
3112
|
zIndex: -100,
|
|
3113
3113
|
position: "absolute",
|
|
@@ -3115,9 +3115,9 @@ const Pr = /* @__PURE__ */ A.forwardRef(function(u, r) {
|
|
|
3115
3115
|
left: -1e5
|
|
3116
3116
|
},
|
|
3117
3117
|
ref: a
|
|
3118
|
-
},
|
|
3118
|
+
}, n) : null;
|
|
3119
3119
|
});
|
|
3120
|
-
class
|
|
3120
|
+
class Or {
|
|
3121
3121
|
getPrimaryStart(u) {
|
|
3122
3122
|
return this.orientation === "horizontal" ? u.left : u.top;
|
|
3123
3123
|
}
|
|
@@ -3140,43 +3140,43 @@ class Ir {
|
|
|
3140
3140
|
return this.getFlowEnd(u) - this.getFlowStart(u);
|
|
3141
3141
|
}
|
|
3142
3142
|
getDropTargetFromPoint(u, r, t) {
|
|
3143
|
-
var
|
|
3143
|
+
var n;
|
|
3144
3144
|
if (this.collection[Symbol.iterator]().next().done || !this.ref.current) return {
|
|
3145
3145
|
type: "root"
|
|
3146
3146
|
};
|
|
3147
|
-
let
|
|
3148
|
-
a += this.getPrimaryStart(
|
|
3149
|
-
let m = this.layout === "stack" ? a : l,
|
|
3150
|
-
for (let d of C) d instanceof HTMLElement && d.dataset.key != null &&
|
|
3147
|
+
let o = this.ref.current.getBoundingClientRect(), a = this.orientation === "horizontal" ? u : r, l = this.orientation === "horizontal" ? r : u;
|
|
3148
|
+
a += this.getPrimaryStart(o), l += this.getSecondaryStart(o);
|
|
3149
|
+
let m = this.layout === "stack" ? a : l, g = this.orientation === "horizontal" && this.direction === "rtl", c = this.layout === "grid" && this.orientation === "vertical" && this.direction === "rtl", B = this.layout === "stack" ? g : c, p = (n = this.ref.current) === null || n === void 0 ? void 0 : n.dataset.collection, C = this.ref.current.querySelectorAll(p ? `[data-collection="${CSS.escape(p)}"]` : "[data-key]"), f = /* @__PURE__ */ new Map();
|
|
3150
|
+
for (let d of C) d instanceof HTMLElement && d.dataset.key != null && f.set(d.dataset.key, d);
|
|
3151
3151
|
let x = [
|
|
3152
3152
|
...this.collection
|
|
3153
|
-
].filter((d) => d.type === "item"),
|
|
3154
|
-
for (;
|
|
3155
|
-
let d = Math.floor((
|
|
3156
|
-
if (!
|
|
3157
|
-
let
|
|
3158
|
-
k ?
|
|
3153
|
+
].filter((d) => d.type === "item"), D = 0, E = x.length;
|
|
3154
|
+
for (; D < E; ) {
|
|
3155
|
+
let d = Math.floor((D + E) / 2), s = x[d], b = f.get(String(s.key));
|
|
3156
|
+
if (!b) break;
|
|
3157
|
+
let $ = b.getBoundingClientRect(), h = (k) => {
|
|
3158
|
+
k ? D = d + 1 : E = d;
|
|
3159
3159
|
};
|
|
3160
|
-
if (a < this.getPrimaryStart(
|
|
3161
|
-
else if (a > this.getPrimaryEnd(
|
|
3162
|
-
else if (l < this.getSecondaryStart(
|
|
3163
|
-
else if (l > this.getSecondaryEnd(
|
|
3160
|
+
if (a < this.getPrimaryStart($)) h(g);
|
|
3161
|
+
else if (a > this.getPrimaryEnd($)) h(!g);
|
|
3162
|
+
else if (l < this.getSecondaryStart($)) h(c);
|
|
3163
|
+
else if (l > this.getSecondaryEnd($)) h(!c);
|
|
3164
3164
|
else {
|
|
3165
3165
|
let k = {
|
|
3166
3166
|
type: "item",
|
|
3167
|
-
key:
|
|
3167
|
+
key: s.key,
|
|
3168
3168
|
dropPosition: "on"
|
|
3169
3169
|
};
|
|
3170
3170
|
if (t(k))
|
|
3171
|
-
m <= this.getFlowStart(
|
|
3171
|
+
m <= this.getFlowStart($) + 5 && t({
|
|
3172
3172
|
...k,
|
|
3173
3173
|
dropPosition: "before"
|
|
3174
|
-
}) ? k.dropPosition = B ? "after" : "before" : m >= this.getFlowEnd(
|
|
3174
|
+
}) ? k.dropPosition = B ? "after" : "before" : m >= this.getFlowEnd($) - 5 && t({
|
|
3175
3175
|
...k,
|
|
3176
3176
|
dropPosition: "after"
|
|
3177
3177
|
}) && (k.dropPosition = B ? "before" : "after");
|
|
3178
3178
|
else {
|
|
3179
|
-
let T = this.getFlowStart(
|
|
3179
|
+
let T = this.getFlowStart($) + this.getFlowSize($) / 2;
|
|
3180
3180
|
m <= T && t({
|
|
3181
3181
|
...k,
|
|
3182
3182
|
dropPosition: "before"
|
|
@@ -3188,14 +3188,14 @@ class Ir {
|
|
|
3188
3188
|
return k;
|
|
3189
3189
|
}
|
|
3190
3190
|
}
|
|
3191
|
-
let
|
|
3192
|
-
return
|
|
3191
|
+
let y = x[Math.min(D, x.length - 1)], i = f.get(String(y.key));
|
|
3192
|
+
return o = i?.getBoundingClientRect(), o && (a < this.getPrimaryStart(o) || Math.abs(m - this.getFlowStart(o)) < Math.abs(m - this.getFlowEnd(o))) ? {
|
|
3193
3193
|
type: "item",
|
|
3194
|
-
key:
|
|
3194
|
+
key: y.key,
|
|
3195
3195
|
dropPosition: B ? "after" : "before"
|
|
3196
3196
|
} : {
|
|
3197
3197
|
type: "item",
|
|
3198
|
-
key:
|
|
3198
|
+
key: y.key,
|
|
3199
3199
|
dropPosition: B ? "before" : "after"
|
|
3200
3200
|
};
|
|
3201
3201
|
}
|
|
@@ -3203,96 +3203,96 @@ class Ir {
|
|
|
3203
3203
|
this.collection = u, this.ref = r, this.layout = t?.layout || "stack", this.orientation = t?.orientation || "vertical", this.direction = t?.direction || "ltr";
|
|
3204
3204
|
}
|
|
3205
3205
|
}
|
|
3206
|
-
function
|
|
3206
|
+
function Vr(e, u) {
|
|
3207
3207
|
let { key: r } = e;
|
|
3208
|
-
const { checkboxProps: t } =
|
|
3208
|
+
const { checkboxProps: t } = It(e, u);
|
|
3209
3209
|
return {
|
|
3210
3210
|
checkboxProps: {
|
|
3211
3211
|
...t,
|
|
3212
|
-
"aria-labelledby": `${t.id} ${
|
|
3212
|
+
"aria-labelledby": `${t.id} ${St(u, r)}`
|
|
3213
3213
|
}
|
|
3214
3214
|
};
|
|
3215
3215
|
}
|
|
3216
|
-
function
|
|
3217
|
-
let { getItems: u, isDisabled: r, collection: t, selectionManager:
|
|
3216
|
+
function jr(e) {
|
|
3217
|
+
let { getItems: u, isDisabled: r, collection: t, selectionManager: n, onDragStart: o, onDragMove: a, onDragEnd: l, preview: m, getAllowedDropOperations: g } = e, [, c] = X(!1), B = S(/* @__PURE__ */ new Set()), p = S(null), C = (f) => {
|
|
3218
3218
|
let x = /* @__PURE__ */ new Set();
|
|
3219
|
-
if (
|
|
3220
|
-
let
|
|
3221
|
-
if (
|
|
3222
|
-
let
|
|
3219
|
+
if (n.isSelected(f)) for (let D of n.selectedKeys) {
|
|
3220
|
+
let E = t.getItem(D);
|
|
3221
|
+
if (E) {
|
|
3222
|
+
let y = !1, i = E.parentKey;
|
|
3223
3223
|
for (; i != null; ) {
|
|
3224
|
-
if (
|
|
3225
|
-
|
|
3224
|
+
if (n.selectedKeys.has(i)) {
|
|
3225
|
+
y = !0;
|
|
3226
3226
|
break;
|
|
3227
3227
|
}
|
|
3228
3228
|
let d = t.getItem(i);
|
|
3229
3229
|
i = d ? d.parentKey : null;
|
|
3230
3230
|
}
|
|
3231
|
-
|
|
3231
|
+
y || x.add(D);
|
|
3232
3232
|
}
|
|
3233
3233
|
}
|
|
3234
|
-
else x.add(
|
|
3234
|
+
else x.add(f);
|
|
3235
3235
|
return x;
|
|
3236
3236
|
};
|
|
3237
3237
|
return {
|
|
3238
3238
|
collection: t,
|
|
3239
|
-
selectionManager:
|
|
3239
|
+
selectionManager: n,
|
|
3240
3240
|
get draggedKey() {
|
|
3241
|
-
return
|
|
3241
|
+
return p.current;
|
|
3242
3242
|
},
|
|
3243
3243
|
get draggingKeys() {
|
|
3244
3244
|
return B.current;
|
|
3245
3245
|
},
|
|
3246
|
-
isDragging(
|
|
3247
|
-
return B.current.has(
|
|
3246
|
+
isDragging(f) {
|
|
3247
|
+
return B.current.has(f);
|
|
3248
3248
|
},
|
|
3249
3249
|
getKeysForDrag: C,
|
|
3250
|
-
getItems(
|
|
3251
|
-
let x = C(
|
|
3252
|
-
for (let
|
|
3253
|
-
var
|
|
3254
|
-
let i = (
|
|
3255
|
-
i != null &&
|
|
3250
|
+
getItems(f) {
|
|
3251
|
+
let x = C(f), D = [];
|
|
3252
|
+
for (let y of x) {
|
|
3253
|
+
var E;
|
|
3254
|
+
let i = (E = t.getItem(y)) === null || E === void 0 ? void 0 : E.value;
|
|
3255
|
+
i != null && D.push(i);
|
|
3256
3256
|
}
|
|
3257
|
-
return u(C(
|
|
3257
|
+
return u(C(f), D);
|
|
3258
3258
|
},
|
|
3259
3259
|
isDisabled: r,
|
|
3260
3260
|
preview: m,
|
|
3261
|
-
getAllowedDropOperations:
|
|
3262
|
-
startDrag(
|
|
3263
|
-
let
|
|
3264
|
-
B.current =
|
|
3261
|
+
getAllowedDropOperations: g,
|
|
3262
|
+
startDrag(f, x) {
|
|
3263
|
+
let D = C(f);
|
|
3264
|
+
B.current = D, p.current = f, n.setFocused(!1), c(!0), typeof o == "function" && o({
|
|
3265
3265
|
...x,
|
|
3266
|
-
keys:
|
|
3266
|
+
keys: D
|
|
3267
3267
|
});
|
|
3268
3268
|
},
|
|
3269
|
-
moveDrag(
|
|
3269
|
+
moveDrag(f) {
|
|
3270
3270
|
typeof a == "function" && a({
|
|
3271
|
-
...
|
|
3271
|
+
...f,
|
|
3272
3272
|
keys: B.current
|
|
3273
3273
|
});
|
|
3274
3274
|
},
|
|
3275
|
-
endDrag(
|
|
3276
|
-
let { isInternal: x } =
|
|
3275
|
+
endDrag(f) {
|
|
3276
|
+
let { isInternal: x } = f;
|
|
3277
3277
|
typeof l == "function" && l({
|
|
3278
|
-
...
|
|
3278
|
+
...f,
|
|
3279
3279
|
keys: B.current,
|
|
3280
3280
|
isInternal: x
|
|
3281
|
-
}), B.current = /* @__PURE__ */ new Set(),
|
|
3281
|
+
}), B.current = /* @__PURE__ */ new Set(), p.current = null, c(!1);
|
|
3282
3282
|
}
|
|
3283
3283
|
};
|
|
3284
3284
|
}
|
|
3285
|
-
function
|
|
3286
|
-
let { acceptedDragTypes: u = "all", isDisabled: r, onInsert: t, onRootDrop:
|
|
3285
|
+
function Lr(e) {
|
|
3286
|
+
let { acceptedDragTypes: u = "all", isDisabled: r, onInsert: t, onRootDrop: n, onItemDrop: o, onReorder: a, onMove: l, shouldAcceptItemDrop: m, collection: g, selectionManager: c, onDropEnter: B, getDropOperation: p, onDrop: C } = e, [f, x] = X(null), D = S(null), E = (i) => {
|
|
3287
3287
|
if (i.dropPosition === "before") {
|
|
3288
|
-
let d =
|
|
3288
|
+
let d = g.getItem(i.key);
|
|
3289
3289
|
return d && d.prevKey != null ? {
|
|
3290
3290
|
type: "item",
|
|
3291
3291
|
key: d.prevKey,
|
|
3292
3292
|
dropPosition: "after"
|
|
3293
3293
|
} : null;
|
|
3294
3294
|
} else if (i.dropPosition === "after") {
|
|
3295
|
-
let d =
|
|
3295
|
+
let d = g.getItem(i.key);
|
|
3296
3296
|
return d && d.nextKey != null ? {
|
|
3297
3297
|
type: "item",
|
|
3298
3298
|
key: d.nextKey,
|
|
@@ -3300,36 +3300,36 @@ function Or(e) {
|
|
|
3300
3300
|
} : null;
|
|
3301
3301
|
}
|
|
3302
3302
|
return null;
|
|
3303
|
-
},
|
|
3304
|
-
let { target: d, types:
|
|
3303
|
+
}, y = J((i) => {
|
|
3304
|
+
let { target: d, types: s, allowedOperations: b, isInternal: $, draggingKeys: h } = i;
|
|
3305
3305
|
if (r || !d) return "cancel";
|
|
3306
|
-
if (u === "all" || u.some((k) =>
|
|
3307
|
-
let k = t && d.type === "item" &&
|
|
3306
|
+
if (u === "all" || u.some((k) => s.has(k))) {
|
|
3307
|
+
let k = t && d.type === "item" && !$ && (d.dropPosition === "before" || d.dropPosition === "after"), T = a && d.type === "item" && $ && (d.dropPosition === "before" || d.dropPosition === "after") && Rr(g, d, h), K = d.type !== "item" || d.dropPosition !== "on" || !m || m(d, s), O = l && d.type === "item" && $ && K, v = n && d.type === "root" && !$, F = o && d.type === "item" && d.dropPosition === "on" && !($ && d.key != null && h.has(d.key)) && K;
|
|
3308
3308
|
if (C || k || T || O || v || F)
|
|
3309
|
-
return
|
|
3309
|
+
return p ? p(d, s, b) : b[0];
|
|
3310
3310
|
}
|
|
3311
3311
|
return "cancel";
|
|
3312
3312
|
}, [
|
|
3313
3313
|
r,
|
|
3314
|
-
|
|
3314
|
+
g,
|
|
3315
3315
|
u,
|
|
3316
|
-
|
|
3316
|
+
p,
|
|
3317
3317
|
t,
|
|
3318
|
-
o,
|
|
3319
3318
|
n,
|
|
3319
|
+
o,
|
|
3320
3320
|
m,
|
|
3321
3321
|
a,
|
|
3322
3322
|
l,
|
|
3323
3323
|
C
|
|
3324
3324
|
]);
|
|
3325
3325
|
return {
|
|
3326
|
-
collection:
|
|
3327
|
-
selectionManager:
|
|
3326
|
+
collection: g,
|
|
3327
|
+
selectionManager: c,
|
|
3328
3328
|
isDisabled: r,
|
|
3329
|
-
target:
|
|
3329
|
+
target: f,
|
|
3330
3330
|
setTarget(i) {
|
|
3331
3331
|
if (this.isDropTarget(i)) return;
|
|
3332
|
-
let d =
|
|
3332
|
+
let d = D.current;
|
|
3333
3333
|
d && typeof e.onDropExit == "function" && e.onDropExit({
|
|
3334
3334
|
type: "dropexit",
|
|
3335
3335
|
x: 0,
|
|
@@ -3340,18 +3340,18 @@ function Or(e) {
|
|
|
3340
3340
|
x: 0,
|
|
3341
3341
|
y: 0,
|
|
3342
3342
|
target: i
|
|
3343
|
-
}),
|
|
3343
|
+
}), D.current = i ?? null, x(i ?? null);
|
|
3344
3344
|
},
|
|
3345
3345
|
isDropTarget(i) {
|
|
3346
|
-
let d =
|
|
3347
|
-
return !d || !i ? !1 :
|
|
3346
|
+
let d = D.current;
|
|
3347
|
+
return !d || !i ? !1 : he(i, d) ? !0 : i?.type === "item" && d?.type === "item" && i.key !== d.key && i.dropPosition !== d.dropPosition && i.dropPosition !== "on" && d.dropPosition !== "on" ? he(E(i), d) || he(i, E(d)) : !1;
|
|
3348
3348
|
},
|
|
3349
3349
|
getDropOperation(i) {
|
|
3350
|
-
return
|
|
3350
|
+
return y(i);
|
|
3351
3351
|
}
|
|
3352
3352
|
};
|
|
3353
3353
|
}
|
|
3354
|
-
function
|
|
3354
|
+
function he(e, u) {
|
|
3355
3355
|
if (!e) return !u;
|
|
3356
3356
|
switch (e.type) {
|
|
3357
3357
|
case "root":
|
|
@@ -3360,174 +3360,174 @@ function ve(e, u) {
|
|
|
3360
3360
|
return u?.type === "item" && u?.key === e.key && u?.dropPosition === e.dropPosition;
|
|
3361
3361
|
}
|
|
3362
3362
|
}
|
|
3363
|
-
function
|
|
3363
|
+
function Rr(e, u, r) {
|
|
3364
3364
|
let t = e.getItem(u.key);
|
|
3365
|
-
for (let
|
|
3366
|
-
let
|
|
3367
|
-
if (
|
|
3365
|
+
for (let n of r) {
|
|
3366
|
+
let o = e.getItem(n);
|
|
3367
|
+
if (o?.parentKey !== t?.parentKey) return !1;
|
|
3368
3368
|
}
|
|
3369
3369
|
return !0;
|
|
3370
3370
|
}
|
|
3371
|
-
function
|
|
3372
|
-
let { initialItems: u = [], initialSelectedKeys: r, getKey: t = (
|
|
3373
|
-
var
|
|
3374
|
-
return (
|
|
3375
|
-
}, filter:
|
|
3371
|
+
function Mr(e) {
|
|
3372
|
+
let { initialItems: u = [], initialSelectedKeys: r, getKey: t = (g) => {
|
|
3373
|
+
var c;
|
|
3374
|
+
return (c = g.id) !== null && c !== void 0 ? c : g.key;
|
|
3375
|
+
}, filter: n, initialFilterText: o = "" } = e, [a, l] = X({
|
|
3376
3376
|
items: u,
|
|
3377
3377
|
selectedKeys: r === "all" ? "all" : new Set(r || []),
|
|
3378
|
-
filterText:
|
|
3379
|
-
}), m =
|
|
3378
|
+
filterText: o
|
|
3379
|
+
}), m = Ke(() => n ? a.items.filter((g) => n(g, a.filterText)) : a.items, [
|
|
3380
3380
|
a.items,
|
|
3381
3381
|
a.filterText,
|
|
3382
|
-
|
|
3382
|
+
n
|
|
3383
3383
|
]);
|
|
3384
3384
|
return {
|
|
3385
3385
|
...a,
|
|
3386
3386
|
items: m,
|
|
3387
|
-
...
|
|
3387
|
+
...Nr({
|
|
3388
3388
|
getKey: t
|
|
3389
3389
|
}, l),
|
|
3390
|
-
getItem(
|
|
3391
|
-
return a.items.find((
|
|
3390
|
+
getItem(g) {
|
|
3391
|
+
return a.items.find((c) => t(c) === g);
|
|
3392
3392
|
}
|
|
3393
3393
|
};
|
|
3394
3394
|
}
|
|
3395
|
-
function
|
|
3395
|
+
function Nr(e, u) {
|
|
3396
3396
|
let { cursor: r, getKey: t } = e;
|
|
3397
3397
|
return {
|
|
3398
|
-
setSelectedKeys(
|
|
3399
|
-
u((
|
|
3400
|
-
...
|
|
3401
|
-
selectedKeys:
|
|
3398
|
+
setSelectedKeys(n) {
|
|
3399
|
+
u((o) => ({
|
|
3400
|
+
...o,
|
|
3401
|
+
selectedKeys: n
|
|
3402
3402
|
}));
|
|
3403
3403
|
},
|
|
3404
|
-
addKeysToSelection(
|
|
3405
|
-
u((
|
|
3406
|
-
...
|
|
3404
|
+
addKeysToSelection(n) {
|
|
3405
|
+
u((o) => o.selectedKeys === "all" ? o : n === "all" ? {
|
|
3406
|
+
...o,
|
|
3407
3407
|
selectedKeys: "all"
|
|
3408
3408
|
} : {
|
|
3409
|
-
...
|
|
3409
|
+
...o,
|
|
3410
3410
|
selectedKeys: /* @__PURE__ */ new Set([
|
|
3411
|
-
...
|
|
3412
|
-
...
|
|
3411
|
+
...o.selectedKeys,
|
|
3412
|
+
...n
|
|
3413
3413
|
])
|
|
3414
3414
|
});
|
|
3415
3415
|
},
|
|
3416
|
-
removeKeysFromSelection(
|
|
3417
|
-
u((
|
|
3418
|
-
if (
|
|
3419
|
-
...
|
|
3416
|
+
removeKeysFromSelection(n) {
|
|
3417
|
+
u((o) => {
|
|
3418
|
+
if (n === "all") return {
|
|
3419
|
+
...o,
|
|
3420
3420
|
selectedKeys: /* @__PURE__ */ new Set()
|
|
3421
3421
|
};
|
|
3422
|
-
let a =
|
|
3423
|
-
for (let l of
|
|
3422
|
+
let a = o.selectedKeys === "all" ? new Set(o.items.map(t)) : new Set(o.selectedKeys);
|
|
3423
|
+
for (let l of n) a.delete(l);
|
|
3424
3424
|
return {
|
|
3425
|
-
...
|
|
3425
|
+
...o,
|
|
3426
3426
|
selectedKeys: a
|
|
3427
3427
|
};
|
|
3428
3428
|
});
|
|
3429
3429
|
},
|
|
3430
|
-
setFilterText(
|
|
3431
|
-
u((
|
|
3432
|
-
...
|
|
3433
|
-
filterText:
|
|
3430
|
+
setFilterText(n) {
|
|
3431
|
+
u((o) => ({
|
|
3432
|
+
...o,
|
|
3433
|
+
filterText: n
|
|
3434
3434
|
}));
|
|
3435
3435
|
},
|
|
3436
|
-
insert(
|
|
3437
|
-
u((a) =>
|
|
3436
|
+
insert(n, ...o) {
|
|
3437
|
+
u((a) => ue(a, n, ...o));
|
|
3438
3438
|
},
|
|
3439
|
-
insertBefore(
|
|
3439
|
+
insertBefore(n, ...o) {
|
|
3440
3440
|
u((a) => {
|
|
3441
|
-
let l = a.items.findIndex((m) => t?.(m) ===
|
|
3441
|
+
let l = a.items.findIndex((m) => t?.(m) === n);
|
|
3442
3442
|
if (l === -1)
|
|
3443
3443
|
if (a.items.length === 0) l = 0;
|
|
3444
3444
|
else return a;
|
|
3445
|
-
return
|
|
3445
|
+
return ue(a, l, ...o);
|
|
3446
3446
|
});
|
|
3447
3447
|
},
|
|
3448
|
-
insertAfter(
|
|
3448
|
+
insertAfter(n, ...o) {
|
|
3449
3449
|
u((a) => {
|
|
3450
|
-
let l = a.items.findIndex((m) => t?.(m) ===
|
|
3450
|
+
let l = a.items.findIndex((m) => t?.(m) === n);
|
|
3451
3451
|
if (l === -1)
|
|
3452
3452
|
if (a.items.length === 0) l = 0;
|
|
3453
3453
|
else return a;
|
|
3454
|
-
return
|
|
3454
|
+
return ue(a, l + 1, ...o);
|
|
3455
3455
|
});
|
|
3456
3456
|
},
|
|
3457
|
-
prepend(...
|
|
3458
|
-
u((
|
|
3457
|
+
prepend(...n) {
|
|
3458
|
+
u((o) => ue(o, 0, ...n));
|
|
3459
3459
|
},
|
|
3460
|
-
append(...
|
|
3461
|
-
u((
|
|
3460
|
+
append(...n) {
|
|
3461
|
+
u((o) => ue(o, o.items.length, ...n));
|
|
3462
3462
|
},
|
|
3463
|
-
remove(...
|
|
3464
|
-
u((
|
|
3465
|
-
let a = new Set(
|
|
3466
|
-
if (
|
|
3467
|
-
m = new Set(
|
|
3468
|
-
for (let
|
|
3463
|
+
remove(...n) {
|
|
3464
|
+
u((o) => {
|
|
3465
|
+
let a = new Set(n), l = o.items.filter((g) => !a.has(t(g))), m = "all";
|
|
3466
|
+
if (o.selectedKeys !== "all") {
|
|
3467
|
+
m = new Set(o.selectedKeys);
|
|
3468
|
+
for (let g of n) m.delete(g);
|
|
3469
3469
|
}
|
|
3470
3470
|
return r == null && l.length === 0 && (m = /* @__PURE__ */ new Set()), {
|
|
3471
|
-
...
|
|
3471
|
+
...o,
|
|
3472
3472
|
items: l,
|
|
3473
3473
|
selectedKeys: m
|
|
3474
3474
|
};
|
|
3475
3475
|
});
|
|
3476
3476
|
},
|
|
3477
3477
|
removeSelectedItems() {
|
|
3478
|
-
u((
|
|
3479
|
-
if (
|
|
3480
|
-
...
|
|
3478
|
+
u((n) => {
|
|
3479
|
+
if (n.selectedKeys === "all") return {
|
|
3480
|
+
...n,
|
|
3481
3481
|
items: [],
|
|
3482
3482
|
selectedKeys: /* @__PURE__ */ new Set()
|
|
3483
3483
|
};
|
|
3484
|
-
let
|
|
3484
|
+
let o = n.selectedKeys, a = n.items.filter((l) => !o.has(t(l)));
|
|
3485
3485
|
return {
|
|
3486
|
-
...
|
|
3486
|
+
...n,
|
|
3487
3487
|
items: a,
|
|
3488
3488
|
selectedKeys: /* @__PURE__ */ new Set()
|
|
3489
3489
|
};
|
|
3490
3490
|
});
|
|
3491
3491
|
},
|
|
3492
|
-
move(
|
|
3492
|
+
move(n, o) {
|
|
3493
3493
|
u((a) => {
|
|
3494
|
-
let l = a.items.findIndex((
|
|
3494
|
+
let l = a.items.findIndex((c) => t(c) === n);
|
|
3495
3495
|
if (l === -1) return a;
|
|
3496
|
-
let m = a.items.slice(), [
|
|
3497
|
-
return m.splice(
|
|
3496
|
+
let m = a.items.slice(), [g] = m.splice(l, 1);
|
|
3497
|
+
return m.splice(o, 0, g), {
|
|
3498
3498
|
...a,
|
|
3499
3499
|
items: m
|
|
3500
3500
|
};
|
|
3501
3501
|
});
|
|
3502
3502
|
},
|
|
3503
|
-
moveBefore(
|
|
3503
|
+
moveBefore(n, o) {
|
|
3504
3504
|
u((a) => {
|
|
3505
|
-
let l = a.items.findIndex((
|
|
3505
|
+
let l = a.items.findIndex((c) => t(c) === n);
|
|
3506
3506
|
if (l === -1) return a;
|
|
3507
|
-
let
|
|
3508
|
-
...
|
|
3509
|
-
]).map((
|
|
3510
|
-
return
|
|
3507
|
+
let g = (Array.isArray(o) ? o : [
|
|
3508
|
+
...o
|
|
3509
|
+
]).map((c) => a.items.findIndex((B) => t(B) === c)).sort((c, B) => c - B);
|
|
3510
|
+
return Ye(a, g, l);
|
|
3511
3511
|
});
|
|
3512
3512
|
},
|
|
3513
|
-
moveAfter(
|
|
3513
|
+
moveAfter(n, o) {
|
|
3514
3514
|
u((a) => {
|
|
3515
|
-
let l = a.items.findIndex((
|
|
3515
|
+
let l = a.items.findIndex((c) => t(c) === n);
|
|
3516
3516
|
if (l === -1) return a;
|
|
3517
|
-
let
|
|
3518
|
-
...
|
|
3519
|
-
]).map((
|
|
3520
|
-
return
|
|
3517
|
+
let g = (Array.isArray(o) ? o : [
|
|
3518
|
+
...o
|
|
3519
|
+
]).map((c) => a.items.findIndex((B) => t(B) === c)).sort((c, B) => c - B);
|
|
3520
|
+
return Ye(a, g, l + 1);
|
|
3521
3521
|
});
|
|
3522
3522
|
},
|
|
3523
|
-
update(
|
|
3523
|
+
update(n, o) {
|
|
3524
3524
|
u((a) => {
|
|
3525
|
-
let l = a.items.findIndex((m) => t(m) ===
|
|
3525
|
+
let l = a.items.findIndex((m) => t(m) === n);
|
|
3526
3526
|
return l === -1 ? a : {
|
|
3527
3527
|
...a,
|
|
3528
3528
|
items: [
|
|
3529
3529
|
...a.items.slice(0, l),
|
|
3530
|
-
|
|
3530
|
+
o,
|
|
3531
3531
|
...a.items.slice(l + 1)
|
|
3532
3532
|
]
|
|
3533
3533
|
};
|
|
@@ -3535,7 +3535,7 @@ function Lr(e, u) {
|
|
|
3535
3535
|
}
|
|
3536
3536
|
};
|
|
3537
3537
|
}
|
|
3538
|
-
function
|
|
3538
|
+
function ue(e, u, ...r) {
|
|
3539
3539
|
return {
|
|
3540
3540
|
...e,
|
|
3541
3541
|
items: [
|
|
@@ -3545,134 +3545,134 @@ function ee(e, u, ...r) {
|
|
|
3545
3545
|
]
|
|
3546
3546
|
};
|
|
3547
3547
|
}
|
|
3548
|
-
function
|
|
3549
|
-
r -= u.filter((
|
|
3550
|
-
let t = u.map((
|
|
3551
|
-
from:
|
|
3548
|
+
function Ye(e, u, r) {
|
|
3549
|
+
r -= u.filter((o) => o < r).length;
|
|
3550
|
+
let t = u.map((o) => ({
|
|
3551
|
+
from: o,
|
|
3552
3552
|
to: r++
|
|
3553
3553
|
}));
|
|
3554
|
-
for (let
|
|
3555
|
-
let a = t[
|
|
3556
|
-
for (let l =
|
|
3554
|
+
for (let o = 0; o < t.length; o++) {
|
|
3555
|
+
let a = t[o].from;
|
|
3556
|
+
for (let l = o; l < t.length; l++)
|
|
3557
3557
|
t[l].from > a && t[l].from--;
|
|
3558
3558
|
}
|
|
3559
|
-
for (let
|
|
3560
|
-
let a = t[
|
|
3561
|
-
for (let l = t.length - 1; l >
|
|
3559
|
+
for (let o = 0; o < t.length; o++) {
|
|
3560
|
+
let a = t[o];
|
|
3561
|
+
for (let l = t.length - 1; l > o; l--) {
|
|
3562
3562
|
let m = t[l];
|
|
3563
3563
|
m.from < a.to ? a.to++ : m.from++;
|
|
3564
3564
|
}
|
|
3565
3565
|
}
|
|
3566
|
-
let
|
|
3567
|
-
for (let
|
|
3568
|
-
let [a] =
|
|
3569
|
-
|
|
3566
|
+
let n = e.items.slice();
|
|
3567
|
+
for (let o of t) {
|
|
3568
|
+
let [a] = n.splice(o.from, 1);
|
|
3569
|
+
n.splice(o.to, 0, a);
|
|
3570
3570
|
}
|
|
3571
3571
|
return {
|
|
3572
3572
|
...e,
|
|
3573
|
-
items:
|
|
3573
|
+
items: n
|
|
3574
3574
|
};
|
|
3575
3575
|
}
|
|
3576
|
-
const
|
|
3577
|
-
return [u, r] =
|
|
3578
|
-
content: /* @__PURE__ */ A.createElement(
|
|
3579
|
-
}, (t) => /* @__PURE__ */ A.createElement(
|
|
3576
|
+
const Hr = /* @__PURE__ */ pt(null), Ur = /* @__PURE__ */ Qe(function(u, r) {
|
|
3577
|
+
return [u, r] = tu(u, r, Hr), /* @__PURE__ */ A.createElement(Tt, {
|
|
3578
|
+
content: /* @__PURE__ */ A.createElement(Ft, u)
|
|
3579
|
+
}, (t) => /* @__PURE__ */ A.createElement(qr, {
|
|
3580
3580
|
props: u,
|
|
3581
3581
|
collection: t,
|
|
3582
3582
|
gridListRef: r
|
|
3583
3583
|
}));
|
|
3584
3584
|
});
|
|
3585
|
-
function
|
|
3586
|
-
[e, r] =
|
|
3587
|
-
let { shouldUseVirtualFocus: t, filter:
|
|
3585
|
+
function qr({ props: e, collection: u, gridListRef: r }) {
|
|
3586
|
+
[e, r] = tu(e, r, eu);
|
|
3587
|
+
let { shouldUseVirtualFocus: t, filter: n, disallowTypeAhead: o, ...a } = e, { dragAndDropHooks: l, keyboardNavigationBehavior: m = "arrow", layout: g = "stack" } = e, { CollectionRoot: c, isVirtualized: B, layoutDelegate: p, dropTargetDelegate: C } = W(ke), f = Ot({
|
|
3588
3588
|
...a,
|
|
3589
3589
|
collection: u,
|
|
3590
3590
|
children: void 0,
|
|
3591
|
-
layoutDelegate:
|
|
3592
|
-
}), x =
|
|
3591
|
+
layoutDelegate: p
|
|
3592
|
+
}), x = Vt(f, n), D = jt({
|
|
3593
3593
|
usage: "search",
|
|
3594
3594
|
sensitivity: "base"
|
|
3595
|
-
}), { disabledBehavior:
|
|
3595
|
+
}), { disabledBehavior: E, disabledKeys: y } = x.selectionManager, { direction: i } = lu(), d = Ke(() => new Me({
|
|
3596
3596
|
collection: x.collection,
|
|
3597
|
-
collator:
|
|
3597
|
+
collator: D,
|
|
3598
3598
|
ref: r,
|
|
3599
|
-
disabledKeys:
|
|
3600
|
-
disabledBehavior:
|
|
3601
|
-
layoutDelegate:
|
|
3602
|
-
layout:
|
|
3599
|
+
disabledKeys: y,
|
|
3600
|
+
disabledBehavior: E,
|
|
3601
|
+
layoutDelegate: p,
|
|
3602
|
+
layout: g,
|
|
3603
3603
|
direction: i
|
|
3604
3604
|
}), [
|
|
3605
3605
|
x.collection,
|
|
3606
3606
|
r,
|
|
3607
|
+
g,
|
|
3608
|
+
y,
|
|
3609
|
+
E,
|
|
3607
3610
|
p,
|
|
3608
|
-
$,
|
|
3609
|
-
f,
|
|
3610
3611
|
D,
|
|
3611
|
-
s,
|
|
3612
3612
|
i
|
|
3613
|
-
]), { gridProps:
|
|
3613
|
+
]), { gridProps: s } = Pt({
|
|
3614
3614
|
...a,
|
|
3615
3615
|
keyboardDelegate: d,
|
|
3616
3616
|
// Only tab navigation is supported in grid layout.
|
|
3617
|
-
keyboardNavigationBehavior:
|
|
3617
|
+
keyboardNavigationBehavior: g === "grid" ? "tab" : m,
|
|
3618
3618
|
isVirtualized: B,
|
|
3619
3619
|
shouldSelectOnPressUp: e.shouldSelectOnPressUp
|
|
3620
|
-
}, x, r),
|
|
3621
|
-
|
|
3622
|
-
process.env.NODE_ENV !== "production" && (k.current !==
|
|
3620
|
+
}, x, r), b = x.selectionManager, $ = !!l?.useDraggableCollectionState, h = !!l?.useDroppableCollectionState, k = S($), T = S(h);
|
|
3621
|
+
L(() => {
|
|
3622
|
+
process.env.NODE_ENV !== "production" && (k.current !== $ && console.warn("Drag hooks were provided during one render, but not another. This should be avoided as it may produce unexpected behavior."), T.current !== h && console.warn("Drop hooks were provided during one render, but not another. This should be avoided as it may produce unexpected behavior."));
|
|
3623
3623
|
}, [
|
|
3624
|
-
|
|
3624
|
+
$,
|
|
3625
3625
|
h
|
|
3626
3626
|
]);
|
|
3627
|
-
let
|
|
3628
|
-
if (
|
|
3629
|
-
|
|
3627
|
+
let K, O, v, F = !1, P = null, V = S(null);
|
|
3628
|
+
if ($ && l) {
|
|
3629
|
+
K = l.useDraggableCollectionState({
|
|
3630
3630
|
collection: x.collection,
|
|
3631
|
-
selectionManager:
|
|
3631
|
+
selectionManager: b,
|
|
3632
3632
|
preview: l.renderDragPreview ? V : void 0
|
|
3633
|
-
}), l.useDraggableCollection({},
|
|
3634
|
-
let
|
|
3635
|
-
P = l.renderDragPreview ? /* @__PURE__ */ A.createElement(
|
|
3633
|
+
}), l.useDraggableCollection({}, K, r);
|
|
3634
|
+
let _ = l.DragPreview;
|
|
3635
|
+
P = l.renderDragPreview ? /* @__PURE__ */ A.createElement(_, {
|
|
3636
3636
|
ref: V
|
|
3637
3637
|
}, l.renderDragPreview) : null;
|
|
3638
3638
|
}
|
|
3639
3639
|
if (h && l) {
|
|
3640
3640
|
O = l.useDroppableCollectionState({
|
|
3641
3641
|
collection: x.collection,
|
|
3642
|
-
selectionManager:
|
|
3642
|
+
selectionManager: b
|
|
3643
3643
|
});
|
|
3644
|
-
let
|
|
3644
|
+
let _ = new Me({
|
|
3645
3645
|
collection: x.collection,
|
|
3646
|
-
disabledKeys:
|
|
3647
|
-
disabledBehavior:
|
|
3646
|
+
disabledKeys: b.disabledKeys,
|
|
3647
|
+
disabledBehavior: b.disabledBehavior,
|
|
3648
3648
|
ref: r
|
|
3649
|
-
}),
|
|
3650
|
-
layout:
|
|
3649
|
+
}), lt = l.dropTargetDelegate || C || new l.ListDropTargetDelegate(u, r, {
|
|
3650
|
+
layout: g,
|
|
3651
3651
|
direction: i
|
|
3652
3652
|
});
|
|
3653
3653
|
v = l.useDroppableCollection({
|
|
3654
|
-
keyboardDelegate:
|
|
3655
|
-
dropTargetDelegate:
|
|
3654
|
+
keyboardDelegate: _,
|
|
3655
|
+
dropTargetDelegate: lt
|
|
3656
3656
|
}, O, r), F = O.isDropTarget({
|
|
3657
3657
|
type: "root"
|
|
3658
3658
|
});
|
|
3659
3659
|
}
|
|
3660
|
-
let { focusProps:
|
|
3660
|
+
let { focusProps: R, isFocused: M, isFocusVisible: U } = au(), N = x.collection.size === 0, q = {
|
|
3661
3661
|
isDropTarget: F,
|
|
3662
3662
|
isEmpty: N,
|
|
3663
3663
|
isFocused: M,
|
|
3664
3664
|
isFocusVisible: U,
|
|
3665
|
-
layout:
|
|
3665
|
+
layout: g,
|
|
3666
3666
|
state: x
|
|
3667
|
-
},
|
|
3667
|
+
}, xe = Pe({
|
|
3668
3668
|
className: e.className,
|
|
3669
3669
|
style: e.style,
|
|
3670
3670
|
defaultClassName: "react-aria-GridList",
|
|
3671
|
-
values:
|
|
3672
|
-
}),
|
|
3671
|
+
values: q
|
|
3672
|
+
}), Re = null, it = null;
|
|
3673
3673
|
if (N && e.renderEmptyState) {
|
|
3674
|
-
let
|
|
3675
|
-
|
|
3674
|
+
let _ = e.renderEmptyState(q);
|
|
3675
|
+
Re = /* @__PURE__ */ A.createElement("div", {
|
|
3676
3676
|
role: "row",
|
|
3677
3677
|
"aria-rowindex": 1,
|
|
3678
3678
|
style: {
|
|
@@ -3683,13 +3683,13 @@ function Nr({ props: e, collection: u, gridListRef: r }) {
|
|
|
3683
3683
|
style: {
|
|
3684
3684
|
display: "contents"
|
|
3685
3685
|
}
|
|
3686
|
-
},
|
|
3686
|
+
}, _));
|
|
3687
3687
|
}
|
|
3688
|
-
let
|
|
3688
|
+
let at = ou(e, {
|
|
3689
3689
|
global: !0
|
|
3690
3690
|
});
|
|
3691
|
-
return /* @__PURE__ */ A.createElement(
|
|
3692
|
-
...
|
|
3691
|
+
return /* @__PURE__ */ A.createElement(wt, null, /* @__PURE__ */ A.createElement("div", {
|
|
3692
|
+
...Ie(at, xe, s, R, v?.collectionProps, it),
|
|
3693
3693
|
ref: r,
|
|
3694
3694
|
slot: e.slot || void 0,
|
|
3695
3695
|
onScroll: e.onScroll,
|
|
@@ -3697,63 +3697,63 @@ function Nr({ props: e, collection: u, gridListRef: r }) {
|
|
|
3697
3697
|
"data-empty": N || void 0,
|
|
3698
3698
|
"data-focused": M || void 0,
|
|
3699
3699
|
"data-focus-visible": U || void 0,
|
|
3700
|
-
"data-layout":
|
|
3701
|
-
}, /* @__PURE__ */ A.createElement(
|
|
3700
|
+
"data-layout": g
|
|
3701
|
+
}, /* @__PURE__ */ A.createElement(uu, {
|
|
3702
3702
|
values: [
|
|
3703
3703
|
[
|
|
3704
|
-
|
|
3704
|
+
Ae,
|
|
3705
3705
|
x
|
|
3706
3706
|
],
|
|
3707
3707
|
[
|
|
3708
|
-
|
|
3708
|
+
fe,
|
|
3709
3709
|
{
|
|
3710
3710
|
dragAndDropHooks: l,
|
|
3711
|
-
dragState:
|
|
3711
|
+
dragState: K,
|
|
3712
3712
|
dropState: O
|
|
3713
3713
|
}
|
|
3714
3714
|
],
|
|
3715
3715
|
[
|
|
3716
|
-
|
|
3716
|
+
Et,
|
|
3717
3717
|
{
|
|
3718
|
-
render:
|
|
3718
|
+
render: Xr
|
|
3719
3719
|
}
|
|
3720
3720
|
]
|
|
3721
3721
|
]
|
|
3722
|
-
}, h && /* @__PURE__ */ A.createElement(
|
|
3722
|
+
}, h && /* @__PURE__ */ A.createElement(Jr, null), /* @__PURE__ */ A.createElement(vt, null, /* @__PURE__ */ A.createElement(c, {
|
|
3723
3723
|
collection: x.collection,
|
|
3724
3724
|
scrollRef: r,
|
|
3725
|
-
persistedKeys:
|
|
3726
|
-
renderDropIndicator:
|
|
3727
|
-
}))),
|
|
3725
|
+
persistedKeys: $t(b, l, O),
|
|
3726
|
+
renderDropIndicator: Ct(l, O)
|
|
3727
|
+
}))), Re, P));
|
|
3728
3728
|
}
|
|
3729
|
-
const
|
|
3730
|
-
let
|
|
3729
|
+
const Gr = /* @__PURE__ */ kt(At, function(u, r, t) {
|
|
3730
|
+
let n = W(Ae), { dragAndDropHooks: o, dragState: a, dropState: l } = W(fe), m = iu(r), { isVirtualized: g } = W(ke), { rowProps: c, gridCellProps: B, descriptionProps: p, ...C } = Kt({
|
|
3731
3731
|
node: t,
|
|
3732
3732
|
shouldSelectOnPressUp: !!a,
|
|
3733
|
-
isVirtualized:
|
|
3734
|
-
},
|
|
3733
|
+
isVirtualized: g
|
|
3734
|
+
}, n, m), { hoverProps: f, isHovered: x } = zt({
|
|
3735
3735
|
isDisabled: !C.allowsSelection && !C.hasAction,
|
|
3736
3736
|
onHoverStart: t.props.onHoverStart,
|
|
3737
3737
|
onHoverChange: t.props.onHoverChange,
|
|
3738
3738
|
onHoverEnd: t.props.onHoverEnd
|
|
3739
|
-
}), { isFocusVisible:
|
|
3739
|
+
}), { isFocusVisible: D, focusProps: E } = au(), { checkboxProps: y } = Vr({
|
|
3740
3740
|
key: t.key
|
|
3741
|
-
},
|
|
3741
|
+
}, n), i = n.selectionManager.disabledBehavior === "all" && C.isDisabled ? {
|
|
3742
3742
|
isDisabled: !0
|
|
3743
3743
|
} : {}, d = null;
|
|
3744
|
-
a &&
|
|
3744
|
+
a && o && (d = o.useDraggableItem({
|
|
3745
3745
|
key: t.key,
|
|
3746
3746
|
hasDragButton: !0
|
|
3747
3747
|
}, a));
|
|
3748
|
-
let
|
|
3749
|
-
l &&
|
|
3748
|
+
let s = null, b = S(null), { visuallyHiddenProps: $ } = ze();
|
|
3749
|
+
l && o && (s = o.useDropIndicator({
|
|
3750
3750
|
target: {
|
|
3751
3751
|
type: "item",
|
|
3752
3752
|
key: t.key,
|
|
3753
3753
|
dropPosition: "on"
|
|
3754
3754
|
}
|
|
3755
|
-
}, l,
|
|
3756
|
-
let h = a && a.isDragging(t.key), k =
|
|
3755
|
+
}, l, b));
|
|
3756
|
+
let h = a && a.isDragging(t.key), k = Pe({
|
|
3757
3757
|
...u,
|
|
3758
3758
|
id: void 0,
|
|
3759
3759
|
children: t.rendered,
|
|
@@ -3761,25 +3761,25 @@ const Hr = /* @__PURE__ */ yt(vt, function(u, r, t) {
|
|
|
3761
3761
|
values: {
|
|
3762
3762
|
...C,
|
|
3763
3763
|
isHovered: x,
|
|
3764
|
-
isFocusVisible:
|
|
3765
|
-
selectionMode:
|
|
3766
|
-
selectionBehavior:
|
|
3764
|
+
isFocusVisible: D,
|
|
3765
|
+
selectionMode: n.selectionManager.selectionMode,
|
|
3766
|
+
selectionBehavior: n.selectionManager.selectionBehavior,
|
|
3767
3767
|
allowsDragging: !!a,
|
|
3768
3768
|
isDragging: h,
|
|
3769
|
-
isDropTarget:
|
|
3769
|
+
isDropTarget: s?.isDropTarget
|
|
3770
3770
|
}
|
|
3771
|
-
}), T =
|
|
3772
|
-
|
|
3771
|
+
}), T = S(null);
|
|
3772
|
+
L(() => {
|
|
3773
3773
|
a && !T.current && console.warn('Draggable items in a GridList must contain a <Button slot="drag"> element so that keyboard and screen reader users can drag them.');
|
|
3774
|
-
}, []),
|
|
3774
|
+
}, []), L(() => {
|
|
3775
3775
|
!t.textValue && process.env.NODE_ENV !== "production" && console.warn("A `textValue` prop is required for <GridListItem> elements with non-plain text children in order to support accessibility features such as type to select.");
|
|
3776
3776
|
}, [
|
|
3777
3777
|
t.textValue
|
|
3778
3778
|
]);
|
|
3779
|
-
let
|
|
3779
|
+
let K = ou(u, {
|
|
3780
3780
|
global: !0
|
|
3781
3781
|
});
|
|
3782
|
-
return delete
|
|
3782
|
+
return delete K.id, delete K.onClick, /* @__PURE__ */ A.createElement(A.Fragment, null, s && !s.isHidden && /* @__PURE__ */ A.createElement("div", {
|
|
3783
3783
|
role: "row",
|
|
3784
3784
|
style: {
|
|
3785
3785
|
position: "absolute"
|
|
@@ -3788,40 +3788,40 @@ const Hr = /* @__PURE__ */ yt(vt, function(u, r, t) {
|
|
|
3788
3788
|
role: "gridcell"
|
|
3789
3789
|
}, /* @__PURE__ */ A.createElement("div", {
|
|
3790
3790
|
role: "button",
|
|
3791
|
-
|
|
3792
|
-
...
|
|
3793
|
-
ref:
|
|
3791
|
+
...$,
|
|
3792
|
+
...s?.dropIndicatorProps,
|
|
3793
|
+
ref: b
|
|
3794
3794
|
}))), /* @__PURE__ */ A.createElement("div", {
|
|
3795
|
-
...
|
|
3795
|
+
...Ie(K, k, c, E, f, d?.dragProps),
|
|
3796
3796
|
ref: m,
|
|
3797
3797
|
"data-selected": C.isSelected || void 0,
|
|
3798
3798
|
"data-disabled": C.isDisabled || void 0,
|
|
3799
3799
|
"data-hovered": x || void 0,
|
|
3800
3800
|
"data-focused": C.isFocused || void 0,
|
|
3801
|
-
"data-focus-visible":
|
|
3801
|
+
"data-focus-visible": D || void 0,
|
|
3802
3802
|
"data-pressed": C.isPressed || void 0,
|
|
3803
3803
|
"data-allows-dragging": !!a || void 0,
|
|
3804
3804
|
"data-dragging": h || void 0,
|
|
3805
|
-
"data-drop-target":
|
|
3806
|
-
"data-selection-mode":
|
|
3805
|
+
"data-drop-target": s?.isDropTarget || void 0,
|
|
3806
|
+
"data-selection-mode": n.selectionManager.selectionMode === "none" ? void 0 : n.selectionManager.selectionMode
|
|
3807
3807
|
}, /* @__PURE__ */ A.createElement("div", {
|
|
3808
3808
|
...B,
|
|
3809
3809
|
style: {
|
|
3810
3810
|
display: "contents"
|
|
3811
3811
|
}
|
|
3812
|
-
}, /* @__PURE__ */ A.createElement(
|
|
3812
|
+
}, /* @__PURE__ */ A.createElement(uu, {
|
|
3813
3813
|
values: [
|
|
3814
3814
|
[
|
|
3815
|
-
|
|
3815
|
+
ft,
|
|
3816
3816
|
{
|
|
3817
3817
|
slots: {
|
|
3818
3818
|
[be]: {},
|
|
3819
|
-
selection:
|
|
3819
|
+
selection: y
|
|
3820
3820
|
}
|
|
3821
3821
|
}
|
|
3822
3822
|
],
|
|
3823
3823
|
[
|
|
3824
|
-
|
|
3824
|
+
mt,
|
|
3825
3825
|
{
|
|
3826
3826
|
slots: {
|
|
3827
3827
|
[be]: i,
|
|
@@ -3836,32 +3836,32 @@ const Hr = /* @__PURE__ */ yt(vt, function(u, r, t) {
|
|
|
3836
3836
|
}
|
|
3837
3837
|
],
|
|
3838
3838
|
[
|
|
3839
|
-
|
|
3839
|
+
ht,
|
|
3840
3840
|
{
|
|
3841
3841
|
slots: {
|
|
3842
3842
|
[be]: {},
|
|
3843
|
-
description:
|
|
3843
|
+
description: p
|
|
3844
3844
|
}
|
|
3845
3845
|
}
|
|
3846
3846
|
],
|
|
3847
3847
|
[
|
|
3848
|
-
|
|
3849
|
-
|
|
3848
|
+
ke,
|
|
3849
|
+
bt
|
|
3850
3850
|
],
|
|
3851
3851
|
[
|
|
3852
|
-
|
|
3852
|
+
Ae,
|
|
3853
3853
|
null
|
|
3854
3854
|
],
|
|
3855
3855
|
[
|
|
3856
|
-
|
|
3856
|
+
eu,
|
|
3857
3857
|
null
|
|
3858
3858
|
],
|
|
3859
3859
|
[
|
|
3860
|
-
|
|
3860
|
+
Bt,
|
|
3861
3861
|
null
|
|
3862
3862
|
],
|
|
3863
3863
|
[
|
|
3864
|
-
|
|
3864
|
+
yt,
|
|
3865
3865
|
{
|
|
3866
3866
|
isSelected: C.isSelected
|
|
3867
3867
|
}
|
|
@@ -3869,20 +3869,20 @@ const Hr = /* @__PURE__ */ yt(vt, function(u, r, t) {
|
|
|
3869
3869
|
]
|
|
3870
3870
|
}, k.children))));
|
|
3871
3871
|
});
|
|
3872
|
-
function
|
|
3873
|
-
u =
|
|
3874
|
-
let { dragAndDropHooks: r, dropState: t } = W(
|
|
3875
|
-
return a ? null : /* @__PURE__ */ A.createElement(
|
|
3872
|
+
function Xr(e, u) {
|
|
3873
|
+
u = iu(u);
|
|
3874
|
+
let { dragAndDropHooks: r, dropState: t } = W(fe), n = S(null), { dropIndicatorProps: o, isHidden: a, isDropTarget: l } = r.useDropIndicator(e, t, n);
|
|
3875
|
+
return a ? null : /* @__PURE__ */ A.createElement(Zr, {
|
|
3876
3876
|
...e,
|
|
3877
|
-
dropIndicatorProps:
|
|
3877
|
+
dropIndicatorProps: o,
|
|
3878
3878
|
isDropTarget: l,
|
|
3879
|
-
buttonRef:
|
|
3879
|
+
buttonRef: n,
|
|
3880
3880
|
ref: u
|
|
3881
3881
|
});
|
|
3882
3882
|
}
|
|
3883
|
-
function
|
|
3884
|
-
let { dropIndicatorProps: r, isDropTarget: t, buttonRef:
|
|
3885
|
-
...
|
|
3883
|
+
function Yr(e, u) {
|
|
3884
|
+
let { dropIndicatorProps: r, isDropTarget: t, buttonRef: n, ...o } = e, { visuallyHiddenProps: a } = ze(), l = Pe({
|
|
3885
|
+
...o,
|
|
3886
3886
|
defaultClassName: "react-aria-DropIndicator",
|
|
3887
3887
|
values: {
|
|
3888
3888
|
isDropTarget: t
|
|
@@ -3899,19 +3899,19 @@ function Gr(e, u) {
|
|
|
3899
3899
|
...a,
|
|
3900
3900
|
role: "button",
|
|
3901
3901
|
...r,
|
|
3902
|
-
ref:
|
|
3902
|
+
ref: n
|
|
3903
3903
|
}), l.children));
|
|
3904
3904
|
}
|
|
3905
|
-
const
|
|
3906
|
-
function
|
|
3907
|
-
let { dragAndDropHooks: e, dropState: u } = W(
|
|
3905
|
+
const Zr = /* @__PURE__ */ Qe(Yr);
|
|
3906
|
+
function Jr() {
|
|
3907
|
+
let { dragAndDropHooks: e, dropState: u } = W(fe), r = S(null), { dropIndicatorProps: t } = e.useDropIndicator({
|
|
3908
3908
|
target: {
|
|
3909
3909
|
type: "root"
|
|
3910
3910
|
}
|
|
3911
|
-
}, u, r),
|
|
3911
|
+
}, u, r), n = u.isDropTarget({
|
|
3912
3912
|
type: "root"
|
|
3913
|
-
}), { visuallyHiddenProps:
|
|
3914
|
-
return !
|
|
3913
|
+
}), { visuallyHiddenProps: o } = ze();
|
|
3914
|
+
return !n && t["aria-hidden"] ? null : /* @__PURE__ */ A.createElement("div", {
|
|
3915
3915
|
role: "row",
|
|
3916
3916
|
"aria-hidden": t["aria-hidden"],
|
|
3917
3917
|
style: {
|
|
@@ -3921,37 +3921,89 @@ function Xr() {
|
|
|
3921
3921
|
role: "gridcell"
|
|
3922
3922
|
}, /* @__PURE__ */ A.createElement("div", {
|
|
3923
3923
|
role: "button",
|
|
3924
|
-
...
|
|
3924
|
+
...o,
|
|
3925
3925
|
...t,
|
|
3926
3926
|
ref: r
|
|
3927
3927
|
})));
|
|
3928
3928
|
}
|
|
3929
|
-
function
|
|
3929
|
+
function Wr(e) {
|
|
3930
3930
|
return {
|
|
3931
|
-
dragAndDropHooks:
|
|
3932
|
-
let { onDrop: r, onInsert: t, onItemDrop:
|
|
3933
|
-
return
|
|
3934
|
-
return
|
|
3935
|
-
...
|
|
3931
|
+
dragAndDropHooks: Ke(() => {
|
|
3932
|
+
let { onDrop: r, onInsert: t, onItemDrop: n, onReorder: o, onMove: a, onRootDrop: l, getItems: m, renderDragPreview: g, renderDropIndicator: c, dropTargetDelegate: B } = e, p = !!m, C = !!(r || t || n || o || a || l), f = {};
|
|
3933
|
+
return p && (f.useDraggableCollectionState = function(D) {
|
|
3934
|
+
return jr({
|
|
3935
|
+
...D,
|
|
3936
3936
|
...e
|
|
3937
3937
|
});
|
|
3938
|
-
},
|
|
3939
|
-
return
|
|
3940
|
-
...
|
|
3938
|
+
}, f.useDraggableCollection = zr, f.useDraggableItem = Ir, f.DragPreview = wr, f.renderDragPreview = g, f.isVirtualDragging = gr), C && (f.useDroppableCollectionState = function(D) {
|
|
3939
|
+
return Lr({
|
|
3940
|
+
...D,
|
|
3941
3941
|
...e
|
|
3942
3942
|
});
|
|
3943
|
-
},
|
|
3944
|
-
return
|
|
3945
|
-
...
|
|
3943
|
+
}, f.useDroppableItem = tt, f.useDroppableCollection = function(D, E, y) {
|
|
3944
|
+
return Tr({
|
|
3945
|
+
...D,
|
|
3946
3946
|
...e
|
|
3947
|
-
},
|
|
3948
|
-
},
|
|
3947
|
+
}, E, y);
|
|
3948
|
+
}, f.useDropIndicator = Sr, f.renderDropIndicator = c, f.dropTargetDelegate = B, f.ListDropTargetDelegate = Or), f;
|
|
3949
3949
|
}, [
|
|
3950
3950
|
e
|
|
3951
3951
|
])
|
|
3952
3952
|
};
|
|
3953
3953
|
}
|
|
3954
|
-
|
|
3954
|
+
var Ze = Object.prototype.hasOwnProperty;
|
|
3955
|
+
function Je(e, u, r) {
|
|
3956
|
+
for (r of e.keys())
|
|
3957
|
+
if (Q(r, u)) return r;
|
|
3958
|
+
}
|
|
3959
|
+
function Q(e, u) {
|
|
3960
|
+
var r, t, n;
|
|
3961
|
+
if (e === u) return !0;
|
|
3962
|
+
if (e && u && (r = e.constructor) === u.constructor) {
|
|
3963
|
+
if (r === Date) return e.getTime() === u.getTime();
|
|
3964
|
+
if (r === RegExp) return e.toString() === u.toString();
|
|
3965
|
+
if (r === Array) {
|
|
3966
|
+
if ((t = e.length) === u.length)
|
|
3967
|
+
for (; t-- && Q(e[t], u[t]); ) ;
|
|
3968
|
+
return t === -1;
|
|
3969
|
+
}
|
|
3970
|
+
if (r === Set) {
|
|
3971
|
+
if (e.size !== u.size)
|
|
3972
|
+
return !1;
|
|
3973
|
+
for (t of e)
|
|
3974
|
+
if (n = t, n && typeof n == "object" && (n = Je(u, n), !n) || !u.has(n)) return !1;
|
|
3975
|
+
return !0;
|
|
3976
|
+
}
|
|
3977
|
+
if (r === Map) {
|
|
3978
|
+
if (e.size !== u.size)
|
|
3979
|
+
return !1;
|
|
3980
|
+
for (t of e)
|
|
3981
|
+
if (n = t[0], n && typeof n == "object" && (n = Je(u, n), !n) || !Q(t[1], u.get(n)))
|
|
3982
|
+
return !1;
|
|
3983
|
+
return !0;
|
|
3984
|
+
}
|
|
3985
|
+
if (r === ArrayBuffer)
|
|
3986
|
+
e = new Uint8Array(e), u = new Uint8Array(u);
|
|
3987
|
+
else if (r === DataView) {
|
|
3988
|
+
if ((t = e.byteLength) === u.byteLength)
|
|
3989
|
+
for (; t-- && e.getInt8(t) === u.getInt8(t); ) ;
|
|
3990
|
+
return t === -1;
|
|
3991
|
+
}
|
|
3992
|
+
if (ArrayBuffer.isView(e)) {
|
|
3993
|
+
if ((t = e.byteLength) === u.byteLength)
|
|
3994
|
+
for (; t-- && e[t] === u[t]; ) ;
|
|
3995
|
+
return t === -1;
|
|
3996
|
+
}
|
|
3997
|
+
if (!r || typeof e == "object") {
|
|
3998
|
+
t = 0;
|
|
3999
|
+
for (r in e)
|
|
4000
|
+
if (Ze.call(e, r) && ++t && !Ze.call(u, r) || !(r in u) || !Q(e[r], u[r])) return !1;
|
|
4001
|
+
return Object.keys(u).length === t;
|
|
4002
|
+
}
|
|
4003
|
+
}
|
|
4004
|
+
return e !== e && u !== u;
|
|
4005
|
+
}
|
|
4006
|
+
const rt = /* @__PURE__ */ gt({
|
|
3955
4007
|
emptyMessage: {
|
|
3956
4008
|
id: "Nimbus.DraggableList.emptyMessage",
|
|
3957
4009
|
description: "message displayed when drag-and-drop enabled list is empty",
|
|
@@ -3962,166 +4014,188 @@ const et = /* @__PURE__ */ ct({
|
|
|
3962
4014
|
description: "label for button that removes an item from the list",
|
|
3963
4015
|
defaultMessage: "remove item"
|
|
3964
4016
|
}
|
|
3965
|
-
}), { withProvider:
|
|
4017
|
+
}), { withProvider: Qr, withContext: Le } = /* @__PURE__ */ Wt({
|
|
3966
4018
|
key: "draggableList"
|
|
3967
|
-
}),
|
|
4019
|
+
}), _r = /* @__PURE__ */ Qr("div", "root"), en = /* @__PURE__ */ Le("div", "item"), un = /* @__PURE__ */ Le("div", "itemContent"), tn = /* @__PURE__ */ Le("div", "empty"), nt = ({
|
|
3968
4020
|
children: e,
|
|
3969
4021
|
id: u,
|
|
3970
4022
|
onRemoveItem: r,
|
|
3971
4023
|
textValue: t,
|
|
3972
|
-
...
|
|
4024
|
+
...n
|
|
3973
4025
|
}) => {
|
|
3974
|
-
const { formatMessage:
|
|
3975
|
-
return /* @__PURE__ */ w(
|
|
3976
|
-
|
|
4026
|
+
const { formatMessage: o } = _e(), a = typeof e == "string" ? e : void 0, [l, m] = cu(n);
|
|
4027
|
+
return /* @__PURE__ */ w(en, { ...l, asChild: !0, children: /* @__PURE__ */ w(
|
|
4028
|
+
Gr,
|
|
3977
4029
|
{
|
|
3978
4030
|
id: u,
|
|
3979
4031
|
textValue: t ?? a,
|
|
3980
4032
|
...m,
|
|
3981
|
-
children: ({ allowsDragging:
|
|
3982
|
-
|
|
4033
|
+
children: ({ allowsDragging: g, selectionBehavior: c, selectionMode: B }) => /* @__PURE__ */ We(dt, { children: [
|
|
4034
|
+
g && // @ts-expect-error slot="drag" handles adding the required props
|
|
3983
4035
|
/* @__PURE__ */ w(
|
|
3984
|
-
|
|
4036
|
+
Ne,
|
|
3985
4037
|
{
|
|
3986
4038
|
slot: "drag",
|
|
3987
4039
|
size: "2xs",
|
|
3988
4040
|
variant: "ghost",
|
|
3989
4041
|
flex: "0 0 auto",
|
|
3990
4042
|
colorPalette: "neutral",
|
|
3991
|
-
children: /* @__PURE__ */ w(
|
|
4043
|
+
children: /* @__PURE__ */ w(Qt, {})
|
|
3992
4044
|
}
|
|
3993
4045
|
),
|
|
3994
|
-
B === "multiple" &&
|
|
3995
|
-
/* @__PURE__ */ w(
|
|
4046
|
+
B === "multiple" && c === "toggle" && /* @__PURE__ */ w(er, { flex: "0 0 auto", slot: "selection" }),
|
|
4047
|
+
/* @__PURE__ */ w(un, { children: e }),
|
|
3996
4048
|
r && /* @__PURE__ */ w(
|
|
3997
|
-
|
|
4049
|
+
Ne,
|
|
3998
4050
|
{
|
|
3999
|
-
"aria-label":
|
|
4051
|
+
"aria-label": o(rt.removeButtonLabel),
|
|
4000
4052
|
size: "2xs",
|
|
4001
4053
|
variant: "ghost",
|
|
4002
4054
|
onPress: u ? () => r(u) : void 0,
|
|
4003
4055
|
flex: "0 0 auto",
|
|
4004
4056
|
colorPalette: "neutral",
|
|
4005
|
-
children: /* @__PURE__ */ w(
|
|
4057
|
+
children: /* @__PURE__ */ w(_t, {})
|
|
4006
4058
|
}
|
|
4007
4059
|
)
|
|
4008
4060
|
] })
|
|
4009
4061
|
}
|
|
4010
4062
|
) });
|
|
4011
|
-
},
|
|
4063
|
+
}, se = "nimbus-draggable-list-item", rn = (e) => e.key ?? e.id, ot = ({
|
|
4012
4064
|
children: e,
|
|
4013
4065
|
ref: u,
|
|
4014
4066
|
items: r = [],
|
|
4015
|
-
|
|
4067
|
+
getKey: t = rn,
|
|
4068
|
+
onUpdateItems: n,
|
|
4016
4069
|
removableItems: o,
|
|
4017
|
-
renderEmptyState:
|
|
4018
|
-
...
|
|
4070
|
+
renderEmptyState: a,
|
|
4071
|
+
...l
|
|
4019
4072
|
}) => {
|
|
4020
|
-
const { formatMessage:
|
|
4021
|
-
|
|
4022
|
-
t
|
|
4023
|
-
},
|
|
4024
|
-
|
|
4073
|
+
const { formatMessage: m } = _e(), g = a ?? m(rt.emptyMessage), c = Mr({
|
|
4074
|
+
initialItems: r,
|
|
4075
|
+
getKey: t
|
|
4076
|
+
}), B = S(!1), p = S(r ?? []);
|
|
4077
|
+
L(() => {
|
|
4078
|
+
if (r !== p.current && !Q(r, p.current) && !Q(r, c.items)) {
|
|
4079
|
+
B.current = !0;
|
|
4080
|
+
const i = c.items.map((s) => t(s));
|
|
4081
|
+
if (c.remove(...i), c.append(...r), c.selectedKeys !== "all" && c.selectedKeys.size > 0) {
|
|
4082
|
+
const s = new Set(r.map(($) => t($))), b = new Set(
|
|
4083
|
+
[...c.selectedKeys].filter(($) => s.has($))
|
|
4084
|
+
);
|
|
4085
|
+
c.setSelectedKeys(b);
|
|
4086
|
+
}
|
|
4087
|
+
p.current = r;
|
|
4088
|
+
let d = !1;
|
|
4089
|
+
return queueMicrotask(() => {
|
|
4090
|
+
d || (B.current = !1);
|
|
4091
|
+
}), () => {
|
|
4092
|
+
d = !0;
|
|
4093
|
+
};
|
|
4094
|
+
}
|
|
4095
|
+
}, [r, t]), L(() => {
|
|
4096
|
+
B.current || (p.current = c.items, n?.(c.items));
|
|
4097
|
+
}, [c.items, n]);
|
|
4098
|
+
const { dragAndDropHooks: C } = Wr({
|
|
4025
4099
|
// Provide item data to drag'n'drop handler
|
|
4026
|
-
getItems(
|
|
4027
|
-
return
|
|
4028
|
-
[
|
|
4100
|
+
getItems(i, d) {
|
|
4101
|
+
return d.map((s) => ({
|
|
4102
|
+
[se]: JSON.stringify(s)
|
|
4029
4103
|
//TODO: also handle text/plain item type (to allow dropping items into list that are not list items)?
|
|
4030
4104
|
}));
|
|
4031
4105
|
},
|
|
4032
4106
|
// Accept `nimbus-draggable-list-item` drag item type
|
|
4033
|
-
acceptedDragTypes: [
|
|
4107
|
+
acceptedDragTypes: [se],
|
|
4034
4108
|
// Ensure items are always moved rather than copied
|
|
4035
4109
|
getDropOperation: () => "move",
|
|
4036
4110
|
// Handle dropping items from other lists between list items
|
|
4037
|
-
async onInsert(
|
|
4038
|
-
const
|
|
4039
|
-
|
|
4040
|
-
async (
|
|
4111
|
+
async onInsert(i) {
|
|
4112
|
+
const d = await Promise.all(
|
|
4113
|
+
i.items.filter(He).map(
|
|
4114
|
+
async (s) => JSON.parse(await s.getText(se))
|
|
4041
4115
|
)
|
|
4042
4116
|
);
|
|
4043
|
-
|
|
4117
|
+
i.target.dropPosition === "before" ? c.insertBefore(i.target.key, ...d) : i.target.dropPosition === "after" && c.insertAfter(i.target.key, ...d);
|
|
4044
4118
|
},
|
|
4045
4119
|
// Handle drops on list when empty
|
|
4046
|
-
async onRootDrop(
|
|
4047
|
-
const
|
|
4048
|
-
|
|
4049
|
-
async (
|
|
4120
|
+
async onRootDrop(i) {
|
|
4121
|
+
const d = await Promise.all(
|
|
4122
|
+
i.items.filter(He).map(
|
|
4123
|
+
async (s) => JSON.parse(await s.getText(se))
|
|
4050
4124
|
)
|
|
4051
4125
|
);
|
|
4052
|
-
|
|
4126
|
+
c.append(...d);
|
|
4053
4127
|
},
|
|
4054
4128
|
// Handle reordering within list
|
|
4055
|
-
onReorder(
|
|
4056
|
-
|
|
4129
|
+
onReorder(i) {
|
|
4130
|
+
i.target.dropPosition === "before" ? c.moveBefore(i.target.key, i.keys) : i.target.dropPosition === "after" && c.moveAfter(i.target.key, i.keys);
|
|
4057
4131
|
},
|
|
4058
4132
|
// Remove the items from the source list on drop
|
|
4059
4133
|
// if they were moved to a different list.
|
|
4060
|
-
async onDragEnd(
|
|
4061
|
-
|
|
4134
|
+
async onDragEnd(i) {
|
|
4135
|
+
i.dropOperation === "move" && !i.isInternal && c.remove(...i.keys);
|
|
4062
4136
|
}
|
|
4063
|
-
}),
|
|
4064
|
-
(
|
|
4065
|
-
|
|
4137
|
+
}), f = J(
|
|
4138
|
+
(i) => {
|
|
4139
|
+
c.remove(i);
|
|
4066
4140
|
},
|
|
4067
|
-
[
|
|
4141
|
+
[c.remove]
|
|
4068
4142
|
);
|
|
4069
4143
|
if (!e && r?.length > 0 && (!r?.[0]?.key || !r?.[0]?.label))
|
|
4070
4144
|
throw new Error(
|
|
4071
4145
|
'Nimbus DraggableList: when "children" is not provided, items must have both "key" and "label" properties'
|
|
4072
4146
|
);
|
|
4073
|
-
const
|
|
4074
|
-
return /* @__PURE__ */ w(
|
|
4075
|
-
|
|
4147
|
+
const x = Jt({ key: "draggableList" }), [D] = x.splitVariantProps(l), [E, y] = cu(l);
|
|
4148
|
+
return /* @__PURE__ */ w(_r, { ...E, ...D, asChild: !0, children: /* @__PURE__ */ w(
|
|
4149
|
+
Ur,
|
|
4076
4150
|
{
|
|
4077
4151
|
ref: u,
|
|
4078
|
-
...
|
|
4079
|
-
renderEmptyState: () => /* @__PURE__ */ w(
|
|
4080
|
-
dragAndDropHooks:
|
|
4081
|
-
items:
|
|
4082
|
-
dependencies: [
|
|
4083
|
-
children: (
|
|
4084
|
-
...
|
|
4085
|
-
onRemoveItem: o ?
|
|
4086
|
-
}) : e : /* @__PURE__ */
|
|
4087
|
-
|
|
4152
|
+
...y,
|
|
4153
|
+
renderEmptyState: () => /* @__PURE__ */ w(tn, { children: g }),
|
|
4154
|
+
dragAndDropHooks: C,
|
|
4155
|
+
items: c.items,
|
|
4156
|
+
dependencies: [f],
|
|
4157
|
+
children: (i) => e ? typeof e == "function" ? e({
|
|
4158
|
+
...i,
|
|
4159
|
+
onRemoveItem: o ? f : void 0
|
|
4160
|
+
}) : e : /* @__PURE__ */ Dt(
|
|
4161
|
+
nt,
|
|
4088
4162
|
{
|
|
4089
|
-
...
|
|
4090
|
-
key:
|
|
4091
|
-
onRemoveItem: o ?
|
|
4163
|
+
...i,
|
|
4164
|
+
key: i.key,
|
|
4165
|
+
onRemoveItem: o ? f : void 0
|
|
4092
4166
|
},
|
|
4093
|
-
|
|
4167
|
+
i.label
|
|
4094
4168
|
)
|
|
4095
4169
|
}
|
|
4096
4170
|
) });
|
|
4097
|
-
},
|
|
4171
|
+
}, nn = ({
|
|
4098
4172
|
label: e,
|
|
4099
4173
|
description: u,
|
|
4100
4174
|
error: r,
|
|
4101
4175
|
infoBox: t,
|
|
4102
|
-
isRequired:
|
|
4103
|
-
isInvalid:
|
|
4176
|
+
isRequired: n,
|
|
4177
|
+
isInvalid: o,
|
|
4104
4178
|
isDisabled: a,
|
|
4105
4179
|
isReadOnly: l,
|
|
4106
4180
|
id: m,
|
|
4107
|
-
items:
|
|
4108
|
-
...
|
|
4109
|
-
}) => /* @__PURE__ */
|
|
4181
|
+
items: g,
|
|
4182
|
+
...c
|
|
4183
|
+
}) => /* @__PURE__ */ We(
|
|
4110
4184
|
Y.Root,
|
|
4111
4185
|
{
|
|
4112
4186
|
id: m,
|
|
4113
|
-
isRequired:
|
|
4114
|
-
isInvalid:
|
|
4187
|
+
isRequired: n,
|
|
4188
|
+
isInvalid: o,
|
|
4115
4189
|
isDisabled: a,
|
|
4116
4190
|
isReadOnly: l,
|
|
4117
4191
|
children: [
|
|
4118
4192
|
/* @__PURE__ */ w(Y.Label, { children: e }),
|
|
4119
4193
|
/* @__PURE__ */ w(Y.Input, { children: /* @__PURE__ */ w(
|
|
4120
|
-
|
|
4194
|
+
ot,
|
|
4121
4195
|
{
|
|
4122
|
-
disabledKeys: a ?
|
|
4123
|
-
items:
|
|
4124
|
-
...
|
|
4196
|
+
disabledKeys: a ? g?.map((B) => B.key) : void 0,
|
|
4197
|
+
items: g,
|
|
4198
|
+
...c
|
|
4125
4199
|
}
|
|
4126
4200
|
) }),
|
|
4127
4201
|
u && /* @__PURE__ */ w(Y.Description, { children: u }),
|
|
@@ -4129,7 +4203,7 @@ const et = /* @__PURE__ */ ct({
|
|
|
4129
4203
|
t && /* @__PURE__ */ w(Y.InfoBox, { children: t })
|
|
4130
4204
|
]
|
|
4131
4205
|
}
|
|
4132
|
-
),
|
|
4206
|
+
), Wn = {
|
|
4133
4207
|
/**
|
|
4134
4208
|
* # DraggableList.Root
|
|
4135
4209
|
*
|
|
@@ -4157,7 +4231,7 @@ const et = /* @__PURE__ */ ct({
|
|
|
4157
4231
|
* <DraggableList.Root items={itemsWithKeyAndLabel} aria-label="Priority list" />
|
|
4158
4232
|
* ```
|
|
4159
4233
|
*/
|
|
4160
|
-
Root:
|
|
4234
|
+
Root: ot,
|
|
4161
4235
|
/**
|
|
4162
4236
|
* # DraggableList.Item
|
|
4163
4237
|
*
|
|
@@ -4179,7 +4253,7 @@ const et = /* @__PURE__ */ ct({
|
|
|
4179
4253
|
* </DraggableList.Root>
|
|
4180
4254
|
* ```
|
|
4181
4255
|
*/
|
|
4182
|
-
Item:
|
|
4256
|
+
Item: nt,
|
|
4183
4257
|
/**
|
|
4184
4258
|
* # DraggableList.Field
|
|
4185
4259
|
*
|
|
@@ -4200,12 +4274,12 @@ const et = /* @__PURE__ */ ct({
|
|
|
4200
4274
|
* />
|
|
4201
4275
|
* ```
|
|
4202
4276
|
*/
|
|
4203
|
-
Field:
|
|
4277
|
+
Field: nn
|
|
4204
4278
|
};
|
|
4205
4279
|
export {
|
|
4206
|
-
|
|
4207
|
-
|
|
4208
|
-
|
|
4209
|
-
|
|
4280
|
+
Wn as D,
|
|
4281
|
+
ot as a,
|
|
4282
|
+
nt as b,
|
|
4283
|
+
nn as c
|
|
4210
4284
|
};
|
|
4211
|
-
//# sourceMappingURL=draggable-list-
|
|
4285
|
+
//# sourceMappingURL=draggable-list-D1fi4DB4.es.js.map
|