@object-ui/plugin-view 3.1.0 → 3.1.2
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/.turbo/turbo-build.log +5 -5
- package/CHANGELOG.md +23 -0
- package/dist/index.js +1093 -1061
- package/dist/index.umd.cjs +3 -3
- package/package.json +7 -7
- package/src/FilterUI.tsx +33 -0
- package/src/ObjectView.tsx +11 -3
- package/src/__tests__/FilterUI.test.tsx +97 -0
- package/src/__tests__/ObjectView.test.tsx +40 -0
- package/src/__tests__/registration.test.tsx +0 -32
package/dist/index.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import
|
|
3
|
-
import { buildExpandFields as
|
|
4
|
-
import { ObjectGrid as
|
|
1
|
+
import * as Q from "react";
|
|
2
|
+
import ve, { useState as ee, useMemo as V, useEffect as W, useCallback as L, useRef as q, useLayoutEffect as Mr, createContext as wt, memo as Pr, useReducer as Lr, useContext as Ge } from "react";
|
|
3
|
+
import { buildExpandFields as _r, ComponentRegistry as Ke } from "@object-ui/core";
|
|
4
|
+
import { ObjectGrid as $r } from "@object-ui/plugin-grid";
|
|
5
5
|
import { ObjectForm as Gt } from "@object-ui/plugin-form";
|
|
6
|
-
import { Button as
|
|
7
|
-
import { Trash2 as
|
|
8
|
-
import { SchemaRenderer as
|
|
6
|
+
import { Button as Ce, Select as Ot, SelectTrigger as It, SelectValue as kt, cn as re, SelectContent as Vt, SelectItem as pt, Tabs as Zn, TabsList as er, TabsTrigger as tr, NavigationOverlay as Cn, Drawer as nr, DrawerContent as rr, DrawerHeader as ir, DrawerTitle as or, DrawerDescription as sr, Dialog as zr, DialogContent as Br, DialogHeader as Ur, DialogTitle as Yr, DialogDescription as Wr, Label as Gr, Popover as ar, PopoverTrigger as lr, PopoverContent as cr, Input as We, Checkbox as Sn, SortBuilder as Hr, Badge as Ht, TooltipProvider as Xr, DropdownMenu as qr, DropdownMenuTrigger as Kr, DropdownMenuContent as Jr, DropdownMenuItem as Qr, Tooltip as Nn, TooltipTrigger as Dn, TooltipContent as Rn, ContextMenu as Zr, ContextMenuTrigger as ei, ContextMenuContent as ti, ContextMenuItem as qe, ContextMenuSeparator as En, ContextMenuSub as ni, ContextMenuSubTrigger as ri, ContextMenuSubContent as ii } from "@object-ui/components";
|
|
7
|
+
import { Trash2 as dr, Copy as un, Settings as oi, Share2 as Mt, Plus as fn, icons as si, GanttChartSquare as ai, Images as li, Map as ci, Activity as di, Calendar as rn, LayoutGrid as ur, Grid as ui, FileText as fi, List as pi, SlidersHorizontal as An, X as hi, ArrowUp as gi, ArrowDown as vi, Lock as on, Check as bi, MoreHorizontal as mi, Pin as Xt, Table as xi, Save as wi, Globe as yi, Pencil as ji, Star as Tn, PinOff as Ci, GripVertical as Si, Settings2 as Ni } from "lucide-react";
|
|
8
|
+
import { SchemaRenderer as Fn } from "@object-ui/react";
|
|
9
9
|
import { unstable_batchedUpdates as Nt, createPortal as Di } from "react-dom";
|
|
10
10
|
var Dt = { exports: {} }, ut = {};
|
|
11
|
-
var
|
|
11
|
+
var On;
|
|
12
12
|
function Ri() {
|
|
13
|
-
if (
|
|
14
|
-
|
|
13
|
+
if (On) return ut;
|
|
14
|
+
On = 1;
|
|
15
15
|
var e = /* @__PURE__ */ Symbol.for("react.transitional.element"), t = /* @__PURE__ */ Symbol.for("react.fragment");
|
|
16
16
|
function n(r, o, s) {
|
|
17
17
|
var l = null;
|
|
@@ -31,22 +31,22 @@ function Ri() {
|
|
|
31
31
|
return ut.Fragment = t, ut.jsx = n, ut.jsxs = n, ut;
|
|
32
32
|
}
|
|
33
33
|
var ft = {};
|
|
34
|
-
var
|
|
34
|
+
var In;
|
|
35
35
|
function Ei() {
|
|
36
|
-
return
|
|
36
|
+
return In || (In = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
37
37
|
function e(h) {
|
|
38
38
|
if (h == null) return null;
|
|
39
39
|
if (typeof h == "function")
|
|
40
|
-
return h.$$typeof ===
|
|
40
|
+
return h.$$typeof === _ ? null : h.displayName || h.name || null;
|
|
41
41
|
if (typeof h == "string") return h;
|
|
42
42
|
switch (h) {
|
|
43
43
|
case j:
|
|
44
44
|
return "Fragment";
|
|
45
|
-
case
|
|
45
|
+
case m:
|
|
46
46
|
return "Profiler";
|
|
47
47
|
case N:
|
|
48
48
|
return "StrictMode";
|
|
49
|
-
case
|
|
49
|
+
case k:
|
|
50
50
|
return "Suspense";
|
|
51
51
|
case x:
|
|
52
52
|
return "SuspenseList";
|
|
@@ -59,14 +59,14 @@ function Ei() {
|
|
|
59
59
|
), h.$$typeof) {
|
|
60
60
|
case f:
|
|
61
61
|
return "Portal";
|
|
62
|
-
case
|
|
62
|
+
case A:
|
|
63
63
|
return h.displayName || "Context";
|
|
64
64
|
case C:
|
|
65
65
|
return (h._context.displayName || "Context") + ".Consumer";
|
|
66
|
-
case
|
|
66
|
+
case F:
|
|
67
67
|
var d = h.render;
|
|
68
68
|
return h = h.displayName, h || (h = d.displayName || d.name || "", h = h !== "" ? "ForwardRef(" + h + ")" : "ForwardRef"), h;
|
|
69
|
-
case
|
|
69
|
+
case R:
|
|
70
70
|
return d = h.displayName || null, d !== null ? d : e(h.type) || "Memo";
|
|
71
71
|
case I:
|
|
72
72
|
d = h._payload, h = h._init;
|
|
@@ -89,11 +89,11 @@ function Ei() {
|
|
|
89
89
|
}
|
|
90
90
|
if (d) {
|
|
91
91
|
d = console;
|
|
92
|
-
var
|
|
93
|
-
return
|
|
92
|
+
var O = d.error, T = typeof Symbol == "function" && Symbol.toStringTag && h[Symbol.toStringTag] || h.constructor.name || "Object";
|
|
93
|
+
return O.call(
|
|
94
94
|
d,
|
|
95
95
|
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
96
|
-
|
|
96
|
+
T
|
|
97
97
|
), t(h);
|
|
98
98
|
}
|
|
99
99
|
}
|
|
@@ -109,28 +109,28 @@ function Ei() {
|
|
|
109
109
|
}
|
|
110
110
|
}
|
|
111
111
|
function o() {
|
|
112
|
-
var h =
|
|
112
|
+
var h = B.A;
|
|
113
113
|
return h === null ? null : h.getOwner();
|
|
114
114
|
}
|
|
115
115
|
function s() {
|
|
116
116
|
return Error("react-stack-top-frame");
|
|
117
117
|
}
|
|
118
118
|
function l(h) {
|
|
119
|
-
if (
|
|
119
|
+
if (ie.call(h, "key")) {
|
|
120
120
|
var d = Object.getOwnPropertyDescriptor(h, "key").get;
|
|
121
121
|
if (d && d.isReactWarning) return !1;
|
|
122
122
|
}
|
|
123
123
|
return h.key !== void 0;
|
|
124
124
|
}
|
|
125
125
|
function a(h, d) {
|
|
126
|
-
function
|
|
127
|
-
|
|
126
|
+
function O() {
|
|
127
|
+
he || (he = !0, console.error(
|
|
128
128
|
"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
|
|
129
129
|
d
|
|
130
130
|
));
|
|
131
131
|
}
|
|
132
|
-
|
|
133
|
-
get:
|
|
132
|
+
O.isReactWarning = !0, Object.defineProperty(h, "key", {
|
|
133
|
+
get: O,
|
|
134
134
|
configurable: !0
|
|
135
135
|
});
|
|
136
136
|
}
|
|
@@ -140,15 +140,15 @@ function Ei() {
|
|
|
140
140
|
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
141
141
|
)), h = this.props.ref, h !== void 0 ? h : null;
|
|
142
142
|
}
|
|
143
|
-
function p(h, d,
|
|
144
|
-
var
|
|
143
|
+
function p(h, d, O, T, ce, Y) {
|
|
144
|
+
var H = O.ref;
|
|
145
145
|
return h = {
|
|
146
146
|
$$typeof: S,
|
|
147
147
|
type: h,
|
|
148
148
|
key: d,
|
|
149
|
-
props:
|
|
150
|
-
_owner:
|
|
151
|
-
}, (
|
|
149
|
+
props: O,
|
|
150
|
+
_owner: T
|
|
151
|
+
}, (H !== void 0 ? H : null) !== null ? Object.defineProperty(h, "ref", {
|
|
152
152
|
enumerable: !1,
|
|
153
153
|
get: u
|
|
154
154
|
}) : Object.defineProperty(h, "ref", { enumerable: !1, value: null }), h._store = {}, Object.defineProperty(h._store, "validated", {
|
|
@@ -165,135 +165,135 @@ function Ei() {
|
|
|
165
165
|
configurable: !1,
|
|
166
166
|
enumerable: !1,
|
|
167
167
|
writable: !0,
|
|
168
|
-
value:
|
|
168
|
+
value: ce
|
|
169
169
|
}), Object.defineProperty(h, "_debugTask", {
|
|
170
170
|
configurable: !1,
|
|
171
171
|
enumerable: !1,
|
|
172
172
|
writable: !0,
|
|
173
|
-
value:
|
|
173
|
+
value: Y
|
|
174
174
|
}), Object.freeze && (Object.freeze(h.props), Object.freeze(h)), h;
|
|
175
175
|
}
|
|
176
|
-
function
|
|
177
|
-
var
|
|
178
|
-
if (
|
|
179
|
-
if (
|
|
180
|
-
if (
|
|
181
|
-
for (
|
|
182
|
-
c(
|
|
183
|
-
Object.freeze && Object.freeze(
|
|
176
|
+
function v(h, d, O, T, ce, Y) {
|
|
177
|
+
var H = d.children;
|
|
178
|
+
if (H !== void 0)
|
|
179
|
+
if (T)
|
|
180
|
+
if (Z(H)) {
|
|
181
|
+
for (T = 0; T < H.length; T++)
|
|
182
|
+
c(H[T]);
|
|
183
|
+
Object.freeze && Object.freeze(H);
|
|
184
184
|
} else
|
|
185
185
|
console.error(
|
|
186
186
|
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
187
187
|
);
|
|
188
|
-
else c(
|
|
189
|
-
if (
|
|
190
|
-
|
|
191
|
-
var
|
|
188
|
+
else c(H);
|
|
189
|
+
if (ie.call(d, "key")) {
|
|
190
|
+
H = e(h);
|
|
191
|
+
var de = Object.keys(d).filter(function(g) {
|
|
192
192
|
return g !== "key";
|
|
193
193
|
});
|
|
194
|
-
|
|
194
|
+
T = 0 < de.length ? "{key: someKey, " + de.join(": ..., ") + ": ...}" : "{key: someKey}", Ne[H + T] || (de = 0 < de.length ? "{" + de.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
195
195
|
`A props object containing a "key" prop is being spread into JSX:
|
|
196
196
|
let props = %s;
|
|
197
197
|
<%s {...props} />
|
|
198
198
|
React keys must be passed directly to JSX without using spread:
|
|
199
199
|
let props = %s;
|
|
200
200
|
<%s key={someKey} {...props} />`,
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
),
|
|
201
|
+
T,
|
|
202
|
+
H,
|
|
203
|
+
de,
|
|
204
|
+
H
|
|
205
|
+
), Ne[H + T] = !0);
|
|
206
206
|
}
|
|
207
|
-
if (
|
|
208
|
-
|
|
209
|
-
for (var
|
|
210
|
-
|
|
211
|
-
} else
|
|
212
|
-
return
|
|
213
|
-
|
|
207
|
+
if (H = null, O !== void 0 && (n(O), H = "" + O), l(d) && (n(d.key), H = "" + d.key), "key" in d) {
|
|
208
|
+
O = {};
|
|
209
|
+
for (var ue in d)
|
|
210
|
+
ue !== "key" && (O[ue] = d[ue]);
|
|
211
|
+
} else O = d;
|
|
212
|
+
return H && a(
|
|
213
|
+
O,
|
|
214
214
|
typeof h == "function" ? h.displayName || h.name || "Unknown" : h
|
|
215
215
|
), p(
|
|
216
216
|
h,
|
|
217
|
-
|
|
218
|
-
|
|
217
|
+
H,
|
|
218
|
+
O,
|
|
219
219
|
o(),
|
|
220
|
-
|
|
221
|
-
|
|
220
|
+
ce,
|
|
221
|
+
Y
|
|
222
222
|
);
|
|
223
223
|
}
|
|
224
224
|
function c(h) {
|
|
225
|
-
|
|
225
|
+
w(h) ? h._store && (h._store.validated = 1) : typeof h == "object" && h !== null && h.$$typeof === I && (h._payload.status === "fulfilled" ? w(h._payload.value) && h._payload.value._store && (h._payload.value._store.validated = 1) : h._store && (h._store.validated = 1));
|
|
226
226
|
}
|
|
227
|
-
function
|
|
227
|
+
function w(h) {
|
|
228
228
|
return typeof h == "object" && h !== null && h.$$typeof === S;
|
|
229
229
|
}
|
|
230
|
-
var
|
|
230
|
+
var b = ve, S = /* @__PURE__ */ Symbol.for("react.transitional.element"), f = /* @__PURE__ */ Symbol.for("react.portal"), j = /* @__PURE__ */ Symbol.for("react.fragment"), N = /* @__PURE__ */ Symbol.for("react.strict_mode"), m = /* @__PURE__ */ Symbol.for("react.profiler"), C = /* @__PURE__ */ Symbol.for("react.consumer"), A = /* @__PURE__ */ Symbol.for("react.context"), F = /* @__PURE__ */ Symbol.for("react.forward_ref"), k = /* @__PURE__ */ Symbol.for("react.suspense"), x = /* @__PURE__ */ Symbol.for("react.suspense_list"), R = /* @__PURE__ */ Symbol.for("react.memo"), I = /* @__PURE__ */ Symbol.for("react.lazy"), M = /* @__PURE__ */ Symbol.for("react.activity"), _ = /* @__PURE__ */ Symbol.for("react.client.reference"), B = b.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, ie = Object.prototype.hasOwnProperty, Z = Array.isArray, pe = console.createTask ? console.createTask : function() {
|
|
231
231
|
return null;
|
|
232
232
|
};
|
|
233
|
-
|
|
233
|
+
b = {
|
|
234
234
|
react_stack_bottom_frame: function(h) {
|
|
235
235
|
return h();
|
|
236
236
|
}
|
|
237
237
|
};
|
|
238
|
-
var
|
|
239
|
-
|
|
238
|
+
var he, ne = {}, $ = b.react_stack_bottom_frame.bind(
|
|
239
|
+
b,
|
|
240
240
|
s
|
|
241
|
-
)(),
|
|
242
|
-
ft.Fragment = j, ft.jsx = function(h, d,
|
|
243
|
-
var
|
|
244
|
-
return
|
|
241
|
+
)(), G = pe(r(s)), Ne = {};
|
|
242
|
+
ft.Fragment = j, ft.jsx = function(h, d, O) {
|
|
243
|
+
var T = 1e4 > B.recentlyCreatedOwnerStacks++;
|
|
244
|
+
return v(
|
|
245
245
|
h,
|
|
246
246
|
d,
|
|
247
|
-
|
|
247
|
+
O,
|
|
248
248
|
!1,
|
|
249
|
-
|
|
250
|
-
|
|
249
|
+
T ? Error("react-stack-top-frame") : $,
|
|
250
|
+
T ? pe(r(h)) : G
|
|
251
251
|
);
|
|
252
|
-
}, ft.jsxs = function(h, d,
|
|
253
|
-
var
|
|
254
|
-
return
|
|
252
|
+
}, ft.jsxs = function(h, d, O) {
|
|
253
|
+
var T = 1e4 > B.recentlyCreatedOwnerStacks++;
|
|
254
|
+
return v(
|
|
255
255
|
h,
|
|
256
256
|
d,
|
|
257
|
-
|
|
257
|
+
O,
|
|
258
258
|
!0,
|
|
259
|
-
|
|
260
|
-
|
|
259
|
+
T ? Error("react-stack-top-frame") : $,
|
|
260
|
+
T ? pe(r(h)) : G
|
|
261
261
|
);
|
|
262
262
|
};
|
|
263
263
|
})()), ft;
|
|
264
264
|
}
|
|
265
|
-
var
|
|
265
|
+
var kn;
|
|
266
266
|
function Ai() {
|
|
267
|
-
return
|
|
267
|
+
return kn || (kn = 1, process.env.NODE_ENV === "production" ? Dt.exports = Ri() : Dt.exports = Ei()), Dt.exports;
|
|
268
268
|
}
|
|
269
269
|
var i = Ai();
|
|
270
|
-
function
|
|
270
|
+
function fr(e) {
|
|
271
271
|
var t, n, r = "";
|
|
272
272
|
if (typeof e == "string" || typeof e == "number") r += e;
|
|
273
273
|
else if (typeof e == "object") if (Array.isArray(e)) {
|
|
274
274
|
var o = e.length;
|
|
275
|
-
for (t = 0; t < o; t++) e[t] && (n =
|
|
275
|
+
for (t = 0; t < o; t++) e[t] && (n = fr(e[t])) && (r && (r += " "), r += n);
|
|
276
276
|
} else for (n in e) e[n] && (r && (r += " "), r += n);
|
|
277
277
|
return r;
|
|
278
278
|
}
|
|
279
279
|
function Ti() {
|
|
280
|
-
for (var e, t, n = 0, r = "", o = arguments.length; n < o; n++) (e = arguments[n]) && (t =
|
|
280
|
+
for (var e, t, n = 0, r = "", o = arguments.length; n < o; n++) (e = arguments[n]) && (t = fr(e)) && (r && (r += " "), r += t);
|
|
281
281
|
return r;
|
|
282
282
|
}
|
|
283
|
-
const
|
|
283
|
+
const Vn = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, Mn = Ti, et = (e, t) => (n) => {
|
|
284
284
|
var r;
|
|
285
|
-
if (t?.variants == null) return
|
|
285
|
+
if (t?.variants == null) return Mn(e, n?.class, n?.className);
|
|
286
286
|
const { variants: o, defaultVariants: s } = t, l = Object.keys(o).map((p) => {
|
|
287
|
-
const
|
|
288
|
-
if (
|
|
289
|
-
const
|
|
290
|
-
return o[p][
|
|
291
|
-
}), a = n && Object.entries(n).reduce((p,
|
|
292
|
-
let [c,
|
|
293
|
-
return
|
|
294
|
-
}, {}), u = t == null || (r = t.compoundVariants) === null || r === void 0 ? void 0 : r.reduce((p,
|
|
295
|
-
let { class: c, className:
|
|
296
|
-
return Object.entries(
|
|
287
|
+
const v = n?.[p], c = s?.[p];
|
|
288
|
+
if (v === null) return null;
|
|
289
|
+
const w = Vn(v) || Vn(c);
|
|
290
|
+
return o[p][w];
|
|
291
|
+
}), a = n && Object.entries(n).reduce((p, v) => {
|
|
292
|
+
let [c, w] = v;
|
|
293
|
+
return w === void 0 || (p[c] = w), p;
|
|
294
|
+
}, {}), u = t == null || (r = t.compoundVariants) === null || r === void 0 ? void 0 : r.reduce((p, v) => {
|
|
295
|
+
let { class: c, className: w, ...b } = v;
|
|
296
|
+
return Object.entries(b).every((S) => {
|
|
297
297
|
let [f, j] = S;
|
|
298
298
|
return Array.isArray(j) ? j.includes({
|
|
299
299
|
...s,
|
|
@@ -305,10 +305,10 @@ const kn = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, Vn = Ti, e
|
|
|
305
305
|
}) ? [
|
|
306
306
|
...p,
|
|
307
307
|
c,
|
|
308
|
-
|
|
308
|
+
w
|
|
309
309
|
] : p;
|
|
310
310
|
}, []);
|
|
311
|
-
return
|
|
311
|
+
return Mn(e, l, u, n?.class, n?.className);
|
|
312
312
|
}, Fi = {
|
|
313
313
|
list: "List",
|
|
314
314
|
detail: "Detail",
|
|
@@ -323,7 +323,7 @@ const kn = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, Vn = Ti, e
|
|
|
323
323
|
list: pi,
|
|
324
324
|
detail: fi,
|
|
325
325
|
grid: ui,
|
|
326
|
-
kanban:
|
|
326
|
+
kanban: ur,
|
|
327
327
|
calendar: rn,
|
|
328
328
|
timeline: di,
|
|
329
329
|
map: ci,
|
|
@@ -378,7 +378,7 @@ function Pi(e) {
|
|
|
378
378
|
const Li = {
|
|
379
379
|
Home: "House"
|
|
380
380
|
};
|
|
381
|
-
function
|
|
381
|
+
function pr(e) {
|
|
382
382
|
if (!e) return null;
|
|
383
383
|
const t = Pi(e), n = Li[t] || t;
|
|
384
384
|
return si[n] || null;
|
|
@@ -386,23 +386,23 @@ function fr(e) {
|
|
|
386
386
|
function qt(e) {
|
|
387
387
|
return e.label ? e.label : Fi[e.type] || e.type;
|
|
388
388
|
}
|
|
389
|
-
function
|
|
390
|
-
return e.icon ?
|
|
389
|
+
function Pn(e) {
|
|
390
|
+
return e.icon ? pr(e.icon) : Oi[e.type] || null;
|
|
391
391
|
}
|
|
392
392
|
function _i(e) {
|
|
393
393
|
return e.activeView ? e.activeView : e.defaultView ? e.defaultView : e.views?.[0]?.type;
|
|
394
394
|
}
|
|
395
|
-
const
|
|
395
|
+
const Ln = {
|
|
396
396
|
share: Mt,
|
|
397
397
|
settings: oi,
|
|
398
398
|
duplicate: un,
|
|
399
|
-
delete:
|
|
399
|
+
delete: dr
|
|
400
400
|
}, $i = {
|
|
401
401
|
share: "Share",
|
|
402
402
|
settings: "Settings",
|
|
403
403
|
duplicate: "Duplicate",
|
|
404
404
|
delete: "Delete"
|
|
405
|
-
},
|
|
405
|
+
}, hr = ({
|
|
406
406
|
schema: e,
|
|
407
407
|
className: t,
|
|
408
408
|
onViewChange: n,
|
|
@@ -411,8 +411,8 @@ const Pn = {
|
|
|
411
411
|
createViewLabel: s = "Create view",
|
|
412
412
|
...l
|
|
413
413
|
}) => {
|
|
414
|
-
const a =
|
|
415
|
-
|
|
414
|
+
const a = Q.useMemo(() => e.storageKey ? e.storageKey : `view-switcher${e.id ? `-${e.id}` : ""}`, [e.id, e.storageKey]), [u, p] = Q.useState(() => _i(e));
|
|
415
|
+
Q.useEffect(() => {
|
|
416
416
|
if (e.activeView) {
|
|
417
417
|
p(e.activeView);
|
|
418
418
|
return;
|
|
@@ -421,42 +421,42 @@ const Pn = {
|
|
|
421
421
|
try {
|
|
422
422
|
const x = localStorage.getItem(a);
|
|
423
423
|
if (x) {
|
|
424
|
-
const
|
|
425
|
-
|
|
424
|
+
const R = e.views.find((I) => I.type === x)?.type;
|
|
425
|
+
R && p(R);
|
|
426
426
|
}
|
|
427
427
|
} catch {
|
|
428
428
|
}
|
|
429
|
-
}, [e.activeView, e.persistPreference, e.views, a]),
|
|
429
|
+
}, [e.activeView, e.persistPreference, e.views, a]), Q.useEffect(() => {
|
|
430
430
|
if (!(!e.persistPreference || !u || e.activeView))
|
|
431
431
|
try {
|
|
432
432
|
localStorage.setItem(a, u);
|
|
433
433
|
} catch {
|
|
434
434
|
}
|
|
435
435
|
}, [u, e.activeView, e.persistPreference, a]);
|
|
436
|
-
const
|
|
436
|
+
const v = Q.useCallback((x) => {
|
|
437
437
|
n?.(x), e.onViewChange && typeof window < "u" && window.dispatchEvent(
|
|
438
438
|
new CustomEvent(e.onViewChange, {
|
|
439
439
|
detail: { view: x }
|
|
440
440
|
})
|
|
441
441
|
);
|
|
442
|
-
}, [n, e.onViewChange]), c =
|
|
443
|
-
p(x),
|
|
444
|
-
}, [
|
|
445
|
-
const I = x.icon &&
|
|
442
|
+
}, [n, e.onViewChange]), c = Q.useCallback((x) => {
|
|
443
|
+
p(x), v(x);
|
|
444
|
+
}, [v]), w = u || e.views?.[0]?.type, b = w || "", S = e.views.find((x) => x.type === w) || e.views?.[0], f = e.variant || "tabs", j = e.position || "top", N = j === "left" || j === "right", m = N ? "vertical" : "horizontal", C = e.viewActions && e.viewActions.length > 0 ? /* @__PURE__ */ i.jsx("div", { className: "flex items-center gap-1", children: e.viewActions.map((x, R) => {
|
|
445
|
+
const I = x.icon && pr(x.icon) || Ln[x.type];
|
|
446
446
|
return /* @__PURE__ */ i.jsx(
|
|
447
|
-
|
|
447
|
+
Ce,
|
|
448
448
|
{
|
|
449
449
|
type: "button",
|
|
450
450
|
variant: "ghost",
|
|
451
451
|
size: "icon-sm",
|
|
452
|
-
onClick: () => o?.(x.type,
|
|
452
|
+
onClick: () => o?.(x.type, w),
|
|
453
453
|
title: $i[x.type] || x.type,
|
|
454
454
|
children: I ? /* @__PURE__ */ i.jsx(I, { className: "h-3.5 w-3.5" }) : null
|
|
455
455
|
},
|
|
456
|
-
`action-${x.type}-${
|
|
456
|
+
`action-${x.type}-${R}`
|
|
457
457
|
);
|
|
458
|
-
}) }) : null,
|
|
459
|
-
|
|
458
|
+
}) }) : null, A = e.allowCreateView ? /* @__PURE__ */ i.jsx(
|
|
459
|
+
Ce,
|
|
460
460
|
{
|
|
461
461
|
type: "button",
|
|
462
462
|
variant: "ghost",
|
|
@@ -465,57 +465,57 @@ const Pn = {
|
|
|
465
465
|
title: s,
|
|
466
466
|
children: /* @__PURE__ */ i.jsx(fn, { className: "h-3.5 w-3.5" })
|
|
467
467
|
}
|
|
468
|
-
) : null,
|
|
469
|
-
f === "dropdown" && /* @__PURE__ */ i.jsxs(Ot, { value:
|
|
470
|
-
/* @__PURE__ */ i.jsx(It, { className:
|
|
471
|
-
/* @__PURE__ */ i.jsx(Vt, { children: e.views.map((x,
|
|
468
|
+
) : null, F = /* @__PURE__ */ i.jsxs("div", { className: re(ki({ orientation: m }), "flex items-center gap-1"), children: [
|
|
469
|
+
f === "dropdown" && /* @__PURE__ */ i.jsxs(Ot, { value: b, onValueChange: (x) => c(x), children: [
|
|
470
|
+
/* @__PURE__ */ i.jsx(It, { className: re("w-full", N ? "h-10" : "h-9"), children: /* @__PURE__ */ i.jsx(kt, { placeholder: "Select view" }) }),
|
|
471
|
+
/* @__PURE__ */ i.jsx(Vt, { children: e.views.map((x, R) => /* @__PURE__ */ i.jsx(pt, { value: x.type, children: qt(x) }, `${x.type}-${R}`)) })
|
|
472
472
|
] }),
|
|
473
|
-
f === "buttons" && /* @__PURE__ */ i.jsx("div", { className:
|
|
474
|
-
const I = x.type ===
|
|
473
|
+
f === "buttons" && /* @__PURE__ */ i.jsx("div", { className: re(Vi({ orientation: m })), children: e.views.map((x, R) => {
|
|
474
|
+
const I = x.type === w, M = Pn(x);
|
|
475
475
|
return /* @__PURE__ */ i.jsxs(
|
|
476
|
-
|
|
476
|
+
Ce,
|
|
477
477
|
{
|
|
478
478
|
type: "button",
|
|
479
479
|
size: "sm",
|
|
480
480
|
variant: I ? "secondary" : "ghost",
|
|
481
|
-
className:
|
|
481
|
+
className: re("justify-start gap-2", N ? "w-full" : ""),
|
|
482
482
|
onClick: () => c(x.type),
|
|
483
483
|
children: [
|
|
484
484
|
M ? /* @__PURE__ */ i.jsx(M, { className: "h-4 w-4" }) : null,
|
|
485
485
|
/* @__PURE__ */ i.jsx("span", { children: qt(x) })
|
|
486
486
|
]
|
|
487
487
|
},
|
|
488
|
-
`${x.type}-${
|
|
488
|
+
`${x.type}-${R}`
|
|
489
489
|
);
|
|
490
490
|
}) }),
|
|
491
|
-
f === "tabs" && /* @__PURE__ */ i.jsx(
|
|
492
|
-
const I =
|
|
491
|
+
f === "tabs" && /* @__PURE__ */ i.jsx(Zn, { value: b, onValueChange: (x) => c(x), children: /* @__PURE__ */ i.jsx(er, { className: re(Mi({ orientation: m })), children: e.views.map((x, R) => {
|
|
492
|
+
const I = Pn(x);
|
|
493
493
|
return /* @__PURE__ */ i.jsxs(
|
|
494
|
-
|
|
494
|
+
tr,
|
|
495
495
|
{
|
|
496
496
|
value: x.type,
|
|
497
|
-
className:
|
|
497
|
+
className: re("gap-2", N ? "justify-start" : ""),
|
|
498
498
|
children: [
|
|
499
499
|
I ? /* @__PURE__ */ i.jsx(I, { className: "h-4 w-4" }) : null,
|
|
500
500
|
/* @__PURE__ */ i.jsx("span", { children: qt(x) })
|
|
501
501
|
]
|
|
502
502
|
},
|
|
503
|
-
`${x.type}-${
|
|
503
|
+
`${x.type}-${R}`
|
|
504
504
|
);
|
|
505
505
|
}) }) }),
|
|
506
506
|
C,
|
|
507
|
-
|
|
508
|
-
] }),
|
|
507
|
+
A
|
|
508
|
+
] }), k = S?.schema ? Array.isArray(S.schema) ? /* @__PURE__ */ i.jsx("div", { className: "space-y-4", children: S.schema.map((x, R) => /* @__PURE__ */ i.jsx(Fn, { schema: x, ...l }, `${S.type}-${R}`)) }) : /* @__PURE__ */ i.jsx(Fn, { schema: S.schema, ...l }) : null;
|
|
509
509
|
return /* @__PURE__ */ i.jsxs(
|
|
510
510
|
"div",
|
|
511
511
|
{
|
|
512
|
-
className:
|
|
512
|
+
className: re(
|
|
513
513
|
Ii({ position: j }),
|
|
514
514
|
t
|
|
515
515
|
),
|
|
516
516
|
children: [
|
|
517
|
-
/* @__PURE__ */ i.jsx("div", { className:
|
|
518
|
-
/* @__PURE__ */ i.jsx("div", { className: "flex-1 min-w-0", children:
|
|
517
|
+
/* @__PURE__ */ i.jsx("div", { className: re("shrink-0", N ? "flex flex-col" : "flex"), children: F }),
|
|
518
|
+
/* @__PURE__ */ i.jsx("div", { className: "flex-1 min-w-0", children: k })
|
|
519
519
|
]
|
|
520
520
|
}
|
|
521
521
|
);
|
|
@@ -536,42 +536,42 @@ const zi = ({
|
|
|
536
536
|
onEdit: a,
|
|
537
537
|
renderListView: u,
|
|
538
538
|
toolbarAddon: p,
|
|
539
|
-
onCreateView:
|
|
539
|
+
onCreateView: v,
|
|
540
540
|
onViewAction: c
|
|
541
541
|
}) => {
|
|
542
|
-
const [
|
|
543
|
-
|
|
542
|
+
const [w, b] = ee(null), [S, f] = ee(!1), [j, N] = ee("create"), [m, C] = ee(null), [A, F] = ee(0), [k, x] = ee([]), [R, I] = ee(!1), [M, _] = ee({}), [B, ie] = ee([]), Z = e.listViews, pe = Z != null && Object.keys(Z).length > 0, [he, ne] = ee(() => e.defaultListView && Z?.[e.defaultListView] ? e.defaultListView : Z && Object.keys(Z)[0] || ""), $ = V(() => !pe || !he ? null : Z[he] || null, [pe, he, Z]), G = V(() => r && r.length > 0 ? r : null, [r]), Ne = G != null && G.length > 0, h = o || G?.[0]?.id, d = G?.find((y) => y.id === h) || G?.[0], O = V(() => $?.type ? $.type : d?.type ? d.type : e.defaultViewType || "grid", [$, d, e.defaultViewType]), T = e.navigation;
|
|
543
|
+
W(() => {
|
|
544
544
|
let y = !0;
|
|
545
545
|
const D = async () => {
|
|
546
546
|
try {
|
|
547
|
-
const
|
|
548
|
-
y &&
|
|
549
|
-
} catch (
|
|
550
|
-
console.error("Failed to fetch object schema:",
|
|
547
|
+
const E = await t.getObjectSchema(e.objectName);
|
|
548
|
+
y && b(E);
|
|
549
|
+
} catch (E) {
|
|
550
|
+
console.error("Failed to fetch object schema:", E);
|
|
551
551
|
}
|
|
552
552
|
};
|
|
553
553
|
return e.objectName && t && D(), () => {
|
|
554
554
|
y = !1;
|
|
555
555
|
};
|
|
556
|
-
}, [e.objectName, t]),
|
|
556
|
+
}, [e.objectName, t]), W(() => {
|
|
557
557
|
let y = !0;
|
|
558
558
|
return (async () => {
|
|
559
|
-
if (!(
|
|
559
|
+
if (!(O === "grid" && !u) && !(!t || !e.objectName)) {
|
|
560
560
|
I(!0);
|
|
561
561
|
try {
|
|
562
|
-
const
|
|
562
|
+
const E = $?.filter || d?.filter || e.table?.defaultFilters || [], we = Object.entries(M).filter(([, P]) => P !== void 0 && P !== "" && P !== null).map(([P, je]) => [P, "=", je]);
|
|
563
563
|
let ae = [];
|
|
564
|
-
|
|
565
|
-
const
|
|
564
|
+
E.length > 0 && we.length > 0 ? ae = ["and", ...E, ...we] : we.length === 1 ? ae = we[0] : we.length > 1 ? ae = ["and", ...we] : ae = E;
|
|
565
|
+
const ye = B.length > 0 ? B.map((P) => ({ field: P.field, order: P.direction })) : $?.sort || d?.sort || e.table?.defaultSort || void 0, le = _r(w?.fields), me = await t.find(e.objectName, {
|
|
566
566
|
$filter: ae.length > 0 ? ae : void 0,
|
|
567
|
-
$orderby:
|
|
567
|
+
$orderby: ye,
|
|
568
568
|
$top: 100,
|
|
569
|
-
...
|
|
569
|
+
...le.length > 0 ? { $expand: le } : {}
|
|
570
570
|
});
|
|
571
|
-
let
|
|
572
|
-
Array.isArray(
|
|
573
|
-
} catch (
|
|
574
|
-
console.error("ObjectView data fetch error:",
|
|
571
|
+
let J = [];
|
|
572
|
+
Array.isArray(me) ? J = me : me && typeof me == "object" && (Array.isArray(me.data) ? J = me.data : Array.isArray(me.records) && (J = me.records)), y && x(J);
|
|
573
|
+
} catch (E) {
|
|
574
|
+
console.error("ObjectView data fetch error:", E);
|
|
575
575
|
} finally {
|
|
576
576
|
y && I(!1);
|
|
577
577
|
}
|
|
@@ -579,75 +579,75 @@ const zi = ({
|
|
|
579
579
|
})(), () => {
|
|
580
580
|
y = !1;
|
|
581
581
|
};
|
|
582
|
-
}, [e.objectName, t,
|
|
583
|
-
const
|
|
582
|
+
}, [e.objectName, t, O, M, B, A, $, d, u, w]);
|
|
583
|
+
const ce = e.layout || "drawer", Y = e.operations || e.table?.operations || {
|
|
584
584
|
create: !0,
|
|
585
585
|
read: !0,
|
|
586
586
|
update: !0,
|
|
587
587
|
delete: !0
|
|
588
|
-
},
|
|
589
|
-
|
|
590
|
-
}, [
|
|
588
|
+
}, H = L(() => {
|
|
589
|
+
ce === "page" && e.onNavigate ? e.onNavigate("new", "edit") : (N("create"), C(null), f(!0));
|
|
590
|
+
}, [ce, e]), de = L((y) => {
|
|
591
591
|
if (a) {
|
|
592
592
|
a(y);
|
|
593
593
|
return;
|
|
594
594
|
}
|
|
595
|
-
if (
|
|
595
|
+
if (ce === "page" && e.onNavigate) {
|
|
596
596
|
const D = y._id || y.id;
|
|
597
597
|
e.onNavigate(D, "edit");
|
|
598
598
|
} else
|
|
599
599
|
N("edit"), C(y), f(!0);
|
|
600
|
-
}, [
|
|
601
|
-
if (
|
|
600
|
+
}, [ce, e, a]), ue = L((y) => {
|
|
601
|
+
if (ce === "page" && e.onNavigate) {
|
|
602
602
|
const D = y._id || y.id;
|
|
603
603
|
e.onNavigate(D, "view");
|
|
604
604
|
} else
|
|
605
605
|
N("view"), C(y), f(!0);
|
|
606
|
-
}, [
|
|
606
|
+
}, [ce, e]), g = L((y) => {
|
|
607
607
|
if (l) {
|
|
608
608
|
l(y);
|
|
609
609
|
return;
|
|
610
610
|
}
|
|
611
|
-
if (
|
|
612
|
-
if (
|
|
611
|
+
if (T) {
|
|
612
|
+
if (T.mode === "none" || T.preventNavigation)
|
|
613
613
|
return;
|
|
614
|
-
if (
|
|
615
|
-
const D = y._id || y.id,
|
|
616
|
-
window.open(
|
|
614
|
+
if (T.mode === "new_window" || T.openNewTab) {
|
|
615
|
+
const D = y._id || y.id, E = `/${e.objectName}/${encodeURIComponent(String(D))}`;
|
|
616
|
+
window.open(E, "_blank");
|
|
617
617
|
return;
|
|
618
618
|
}
|
|
619
|
-
if (
|
|
619
|
+
if (T.mode === "drawer") {
|
|
620
620
|
N("view"), C(y), f(!0);
|
|
621
621
|
return;
|
|
622
622
|
}
|
|
623
|
-
if (
|
|
623
|
+
if (T.mode === "modal") {
|
|
624
624
|
N("view"), C(y), f(!0);
|
|
625
625
|
return;
|
|
626
626
|
}
|
|
627
|
-
if (
|
|
627
|
+
if (T.mode === "page") {
|
|
628
628
|
const D = y._id || y.id;
|
|
629
629
|
e.onNavigate && e.onNavigate(D, "view");
|
|
630
630
|
return;
|
|
631
631
|
}
|
|
632
|
-
if (
|
|
632
|
+
if (T.mode === "split" || T.mode === "popover") {
|
|
633
633
|
N("view"), C(y), f(!0);
|
|
634
634
|
return;
|
|
635
635
|
}
|
|
636
636
|
}
|
|
637
|
-
|
|
638
|
-
}, [l,
|
|
639
|
-
|
|
640
|
-
}, []), K =
|
|
641
|
-
|
|
642
|
-
}, []),
|
|
643
|
-
f(!1), C(null),
|
|
644
|
-
}, []),
|
|
637
|
+
Y.read !== !1 && ue(y);
|
|
638
|
+
}, [l, T, Y.read, ue, e]), te = L((y) => {
|
|
639
|
+
F((D) => D + 1);
|
|
640
|
+
}, []), K = L((y) => {
|
|
641
|
+
F((D) => D + 1);
|
|
642
|
+
}, []), oe = L(() => {
|
|
643
|
+
f(!1), C(null), F((y) => y + 1);
|
|
644
|
+
}, []), U = L(() => {
|
|
645
645
|
f(!1), C(null);
|
|
646
646
|
}, []);
|
|
647
|
-
|
|
648
|
-
|
|
647
|
+
L(() => {
|
|
648
|
+
F((y) => y + 1);
|
|
649
649
|
}, []);
|
|
650
|
-
const
|
|
650
|
+
const De = V(() => !Ne || !G || G.length <= 1 ? null : {
|
|
651
651
|
type: "view-switcher",
|
|
652
652
|
variant: "tabs",
|
|
653
653
|
position: "top",
|
|
@@ -655,7 +655,7 @@ const zi = ({
|
|
|
655
655
|
storageKey: `view-pref-${e.objectName}`,
|
|
656
656
|
defaultView: d?.type || "grid",
|
|
657
657
|
activeView: d?.type || "grid",
|
|
658
|
-
views:
|
|
658
|
+
views: G.map((y) => {
|
|
659
659
|
const D = {
|
|
660
660
|
kanban: "kanban",
|
|
661
661
|
calendar: "calendar",
|
|
@@ -675,26 +675,28 @@ const zi = ({
|
|
|
675
675
|
}),
|
|
676
676
|
allowCreateView: e.allowCreateView,
|
|
677
677
|
viewActions: e.viewActions
|
|
678
|
-
}, [
|
|
679
|
-
if (!
|
|
680
|
-
const D =
|
|
678
|
+
}, [Ne, G, d, e.objectName, e.allowCreateView, e.viewActions]), be = L((y) => {
|
|
679
|
+
if (!G) return;
|
|
680
|
+
const D = G.find((E) => E.type === y);
|
|
681
681
|
D && s && s(D.id);
|
|
682
|
-
}, [
|
|
682
|
+
}, [G, s]), it = L((y) => {
|
|
683
683
|
ne(y);
|
|
684
684
|
}, []);
|
|
685
|
-
|
|
685
|
+
V(() => {
|
|
686
686
|
if (e.showFilters === !1) return null;
|
|
687
|
-
const y = e.filterableFields, D =
|
|
688
|
-
const
|
|
689
|
-
let
|
|
690
|
-
return
|
|
691
|
-
(
|
|
687
|
+
const y = e.filterableFields, D = w?.fields || {}, we = (y ? y.map((ae) => [ae, D[ae] || { label: ae }]) : Object.entries(D).filter(([, ae]) => !ae.hidden).slice(0, 8)).map(([ae, ye]) => {
|
|
688
|
+
const le = ye.type || "text";
|
|
689
|
+
let me = "text", J;
|
|
690
|
+
return le === "number" || le === "currency" || le === "percent" ? me = "number" : le === "boolean" || le === "toggle" ? me = "boolean" : le === "date" || le === "datetime" ? me = "date" : le === "select" || le === "status" || ye.options ? (me = "select", J = (ye.options || []).map(
|
|
691
|
+
(P) => typeof P == "string" ? { label: P, value: P } : { label: P.label, value: P.value }
|
|
692
|
+
)) : (le === "lookup" || le === "master_detail" || le === "user" || le === "owner") && ye.options && ye.options.length > 0 && (me = "multi-select", J = (ye.options || []).map(
|
|
693
|
+
(P) => typeof P == "string" ? { label: P, value: P } : { label: P.label, value: P.value }
|
|
692
694
|
)), {
|
|
693
695
|
field: ae,
|
|
694
|
-
label:
|
|
695
|
-
type:
|
|
696
|
-
placeholder: `Filter ${
|
|
697
|
-
...
|
|
696
|
+
label: ye.label || ae,
|
|
697
|
+
type: me,
|
|
698
|
+
placeholder: `Filter ${ye.label || ae}...`,
|
|
699
|
+
...J ? { options: J } : {}
|
|
698
700
|
};
|
|
699
701
|
});
|
|
700
702
|
return we.length === 0 ? null : {
|
|
@@ -705,23 +707,23 @@ const zi = ({
|
|
|
705
707
|
filters: we,
|
|
706
708
|
values: M
|
|
707
709
|
};
|
|
708
|
-
}, [e.showFilters, e.filterableFields,
|
|
710
|
+
}, [e.showFilters, e.filterableFields, w, M]);
|
|
709
711
|
const He = e.showSort;
|
|
710
|
-
|
|
712
|
+
V(() => {
|
|
711
713
|
if (He === !1) return null;
|
|
712
|
-
const y =
|
|
714
|
+
const y = w?.fields || {}, D = Object.entries(y).filter(([, E]) => !E.hidden).slice(0, 10).map(([E, we]) => ({ field: E, label: we.label || E }));
|
|
713
715
|
return D.length === 0 ? null : {
|
|
714
716
|
type: "sort-ui",
|
|
715
717
|
variant: "dropdown",
|
|
716
718
|
multiple: !1,
|
|
717
719
|
fields: D,
|
|
718
|
-
sort:
|
|
720
|
+
sort: B
|
|
719
721
|
};
|
|
720
|
-
}, [
|
|
721
|
-
const _e =
|
|
722
|
+
}, [w, B, He]);
|
|
723
|
+
const _e = L((y) => {
|
|
722
724
|
const D = {
|
|
723
725
|
objectName: e.objectName,
|
|
724
|
-
fields:
|
|
726
|
+
fields: $?.columns || d?.columns || e.table?.fields,
|
|
725
727
|
className: "h-full w-full",
|
|
726
728
|
showSearch: d?.showSearch ?? e.showSearch ?? !1,
|
|
727
729
|
showSort: d?.showSort ?? e.showSort ?? !1,
|
|
@@ -729,7 +731,7 @@ const zi = ({
|
|
|
729
731
|
striped: d?.striped ?? !1,
|
|
730
732
|
bordered: d?.bordered ?? !1,
|
|
731
733
|
color: d?.color
|
|
732
|
-
},
|
|
734
|
+
}, E = $?.options || d || {};
|
|
733
735
|
if (process.env.NODE_ENV === "development") {
|
|
734
736
|
const we = [
|
|
735
737
|
"startDateField",
|
|
@@ -745,9 +747,9 @@ const zi = ({
|
|
|
745
747
|
"subtitleField",
|
|
746
748
|
"latitudeField",
|
|
747
749
|
"longitudeField"
|
|
748
|
-
], ae =
|
|
749
|
-
|
|
750
|
-
`[Spec Compliance] View options use flat properties ${JSON.stringify(
|
|
750
|
+
], ae = E[y] || {}, ye = we.filter((le) => le in E && !(le in ae));
|
|
751
|
+
ye.length > 0 && console.warn(
|
|
752
|
+
`[Spec Compliance] View options use flat properties ${JSON.stringify(ye)}. Move them under options.${y} per @objectstack/spec protocol.`
|
|
751
753
|
);
|
|
752
754
|
}
|
|
753
755
|
switch (y) {
|
|
@@ -755,79 +757,79 @@ const zi = ({
|
|
|
755
757
|
return {
|
|
756
758
|
type: "object-kanban",
|
|
757
759
|
...D,
|
|
758
|
-
groupBy:
|
|
759
|
-
groupField:
|
|
760
|
-
titleField:
|
|
760
|
+
groupBy: E.kanban?.groupField || "status",
|
|
761
|
+
groupField: E.kanban?.groupField || "status",
|
|
762
|
+
titleField: E.kanban?.titleField || "name",
|
|
761
763
|
cardFields: D.fields || [],
|
|
762
|
-
...
|
|
764
|
+
...E.kanban || {}
|
|
763
765
|
};
|
|
764
766
|
case "calendar":
|
|
765
767
|
return {
|
|
766
768
|
type: "object-calendar",
|
|
767
769
|
...D,
|
|
768
|
-
startDateField:
|
|
769
|
-
endDateField:
|
|
770
|
-
titleField:
|
|
771
|
-
...
|
|
770
|
+
startDateField: E.calendar?.startDateField || "start_date",
|
|
771
|
+
endDateField: E.calendar?.endDateField || "end_date",
|
|
772
|
+
titleField: E.calendar?.titleField || "name",
|
|
773
|
+
...E.calendar || {}
|
|
772
774
|
};
|
|
773
775
|
case "gallery":
|
|
774
776
|
return {
|
|
775
777
|
type: "object-gallery",
|
|
776
778
|
...D,
|
|
777
|
-
imageField:
|
|
778
|
-
titleField:
|
|
779
|
-
subtitleField:
|
|
780
|
-
...
|
|
779
|
+
imageField: E.gallery?.imageField,
|
|
780
|
+
titleField: E.gallery?.titleField || "name",
|
|
781
|
+
subtitleField: E.gallery?.subtitleField,
|
|
782
|
+
...E.gallery || {}
|
|
781
783
|
};
|
|
782
784
|
case "timeline":
|
|
783
785
|
return {
|
|
784
786
|
type: "object-timeline",
|
|
785
787
|
...D,
|
|
786
|
-
dateField:
|
|
787
|
-
titleField:
|
|
788
|
-
...
|
|
788
|
+
dateField: E.timeline?.dateField || "created_at",
|
|
789
|
+
titleField: E.timeline?.titleField || "name",
|
|
790
|
+
...E.timeline || {}
|
|
789
791
|
};
|
|
790
792
|
case "gantt":
|
|
791
793
|
return {
|
|
792
794
|
type: "object-gantt",
|
|
793
795
|
...D,
|
|
794
|
-
startDateField:
|
|
795
|
-
endDateField:
|
|
796
|
-
progressField:
|
|
797
|
-
dependenciesField:
|
|
798
|
-
...
|
|
796
|
+
startDateField: E.gantt?.startDateField || "start_date",
|
|
797
|
+
endDateField: E.gantt?.endDateField || "end_date",
|
|
798
|
+
progressField: E.gantt?.progressField || "progress",
|
|
799
|
+
dependenciesField: E.gantt?.dependenciesField || "dependencies",
|
|
800
|
+
...E.gantt || {}
|
|
799
801
|
};
|
|
800
802
|
case "map":
|
|
801
803
|
return {
|
|
802
804
|
type: "object-map",
|
|
803
805
|
...D,
|
|
804
|
-
locationField:
|
|
805
|
-
...
|
|
806
|
+
locationField: E.map?.locationField || "location",
|
|
807
|
+
...E.map || {}
|
|
806
808
|
};
|
|
807
809
|
default:
|
|
808
810
|
return null;
|
|
809
811
|
}
|
|
810
|
-
}, [e.objectName, e.table?.fields,
|
|
812
|
+
}, [e.objectName, e.table?.fields, $, d]), Re = V(() => ({
|
|
811
813
|
type: "object-grid",
|
|
812
814
|
objectName: e.objectName,
|
|
813
815
|
title: e.table?.title,
|
|
814
816
|
description: e.table?.description,
|
|
815
|
-
fields:
|
|
816
|
-
columns:
|
|
817
|
+
fields: $?.columns || d?.columns || e.table?.fields,
|
|
818
|
+
columns: $?.columns || d?.columns || e.table?.columns,
|
|
817
819
|
operations: {
|
|
818
|
-
...
|
|
820
|
+
...Y,
|
|
819
821
|
create: !1
|
|
820
822
|
// Create is handled by the view's create button
|
|
821
823
|
},
|
|
822
|
-
defaultFilters:
|
|
823
|
-
defaultSort:
|
|
824
|
+
defaultFilters: $?.filter || d?.filter || e.table?.defaultFilters,
|
|
825
|
+
defaultSort: $?.sort || d?.sort || e.table?.defaultSort,
|
|
824
826
|
pageSize: e.table?.pageSize,
|
|
825
827
|
selectable: e.table?.selectable,
|
|
826
828
|
striped: d?.striped ?? e.table?.striped,
|
|
827
829
|
bordered: d?.bordered ?? e.table?.bordered,
|
|
828
830
|
className: e.table?.className
|
|
829
|
-
}), [e,
|
|
830
|
-
const y =
|
|
831
|
+
}), [e, Y, $, d]), se = () => {
|
|
832
|
+
const y = m ? m._id || m.id : void 0;
|
|
831
833
|
return {
|
|
832
834
|
type: "object-form",
|
|
833
835
|
objectName: e.objectName,
|
|
@@ -848,12 +850,12 @@ const zi = ({
|
|
|
848
850
|
initialValues: e.form?.initialValues,
|
|
849
851
|
readOnly: e.form?.readOnly || j === "view",
|
|
850
852
|
className: e.form?.className,
|
|
851
|
-
onSuccess:
|
|
852
|
-
onCancel:
|
|
853
|
+
onSuccess: oe,
|
|
854
|
+
onCancel: U
|
|
853
855
|
};
|
|
854
|
-
},
|
|
856
|
+
}, X = () => {
|
|
855
857
|
if (e.form?.title) return e.form.title;
|
|
856
|
-
const y =
|
|
858
|
+
const y = w?.label || e.objectName;
|
|
857
859
|
switch (j) {
|
|
858
860
|
case "create":
|
|
859
861
|
return `Create ${y}`;
|
|
@@ -864,39 +866,39 @@ const zi = ({
|
|
|
864
866
|
default:
|
|
865
867
|
return y;
|
|
866
868
|
}
|
|
867
|
-
}, Pe =
|
|
868
|
-
const y =
|
|
869
|
+
}, Pe = V(() => {
|
|
870
|
+
const y = T?.width;
|
|
869
871
|
return y ? typeof y == "number" ? `max-w-[${y}px]` : `max-w-[${y}]` : "";
|
|
870
|
-
}, [
|
|
871
|
-
/* @__PURE__ */ i.jsxs(
|
|
872
|
-
/* @__PURE__ */ i.jsx(
|
|
873
|
-
e.form?.description && /* @__PURE__ */ i.jsx(
|
|
872
|
+
}, [T]), Je = () => /* @__PURE__ */ i.jsx(nr, { open: S, onOpenChange: f, direction: "right", children: /* @__PURE__ */ i.jsxs(rr, { className: re("w-full sm:max-w-2xl", Pe), children: [
|
|
873
|
+
/* @__PURE__ */ i.jsxs(ir, { children: [
|
|
874
|
+
/* @__PURE__ */ i.jsx(or, { children: X() }),
|
|
875
|
+
e.form?.description && /* @__PURE__ */ i.jsx(sr, { children: e.form.description })
|
|
874
876
|
] }),
|
|
875
877
|
/* @__PURE__ */ i.jsx("div", { className: "flex-1 overflow-y-auto px-4 pb-4", children: /* @__PURE__ */ i.jsx(Gt, { schema: se(), dataSource: t }) })
|
|
876
|
-
] }) }), ot = () => /* @__PURE__ */ i.jsx(
|
|
877
|
-
/* @__PURE__ */ i.jsxs(
|
|
878
|
-
/* @__PURE__ */ i.jsx(
|
|
879
|
-
e.form?.description && /* @__PURE__ */ i.jsx(
|
|
878
|
+
] }) }), ot = () => /* @__PURE__ */ i.jsx(zr, { open: S, onOpenChange: f, children: /* @__PURE__ */ i.jsxs(Br, { className: re("max-w-2xl max-h-[90vh] overflow-y-auto", Pe), children: [
|
|
879
|
+
/* @__PURE__ */ i.jsxs(Ur, { children: [
|
|
880
|
+
/* @__PURE__ */ i.jsx(Yr, { children: X() }),
|
|
881
|
+
e.form?.description && /* @__PURE__ */ i.jsx(Wr, { children: e.form.description })
|
|
880
882
|
] }),
|
|
881
883
|
/* @__PURE__ */ i.jsx(Gt, { schema: se(), dataSource: t })
|
|
882
|
-
] }) }), Yt =
|
|
884
|
+
] }) }), Yt = V(() => Object.keys(M).some(
|
|
883
885
|
(D) => M[D] !== void 0 && M[D] !== "" && M[D] !== null
|
|
884
|
-
) ? Object.entries(M).filter(([, D]) => D !== void 0 && D !== "" && D !== null).map(([D,
|
|
885
|
-
const y = `${e.objectName}-${
|
|
886
|
+
) ? Object.entries(M).filter(([, D]) => D !== void 0 && D !== "" && D !== null).map(([D, E]) => ({ field: D, operator: "equals", value: E })) : $?.filter || d?.filter || e.table?.defaultFilters, [M, $, d, e.table?.defaultFilters]), $e = V(() => B.length > 0 ? B : $?.sort || d?.sort || e.table?.defaultSort, [B, $, d, e.table?.defaultSort]), Ie = () => {
|
|
887
|
+
const y = `${e.objectName}-${he || d?.id || "default"}-${O}-${A}`;
|
|
886
888
|
if (u)
|
|
887
889
|
return u({
|
|
888
890
|
schema: {
|
|
889
891
|
type: "list-view",
|
|
890
892
|
objectName: e.objectName,
|
|
891
|
-
viewType:
|
|
892
|
-
fields:
|
|
893
|
+
viewType: O,
|
|
894
|
+
fields: $?.columns || d?.columns || e.table?.fields,
|
|
893
895
|
filters: Yt,
|
|
894
896
|
sort: $e,
|
|
895
897
|
// Propagate appearance/view-config properties for live preview
|
|
896
898
|
rowHeight: d?.rowHeight,
|
|
897
899
|
densityMode: d?.densityMode,
|
|
898
900
|
groupBy: d?.groupBy,
|
|
899
|
-
options:
|
|
901
|
+
options: $?.options || d,
|
|
900
902
|
// Propagate toolbar toggle flags
|
|
901
903
|
showSearch: d?.showSearch ?? e.showSearch,
|
|
902
904
|
showFilters: d?.showFilters ?? e.showFilters,
|
|
@@ -934,6 +936,7 @@ const zi = ({
|
|
|
934
936
|
addRecord: d?.addRecord ?? e.addRecord,
|
|
935
937
|
conditionalFormatting: d?.conditionalFormatting ?? e.conditionalFormatting,
|
|
936
938
|
quickFilters: d?.quickFilters ?? e.quickFilters,
|
|
939
|
+
userFilters: d?.userFilters ?? e.userFilters,
|
|
937
940
|
showRecordCount: d?.showRecordCount ?? e.showRecordCount,
|
|
938
941
|
allowPrinting: d?.allowPrinting ?? e.allowPrinting,
|
|
939
942
|
virtualScroll: d?.virtualScroll ?? e.virtualScroll,
|
|
@@ -942,90 +945,90 @@ const zi = ({
|
|
|
942
945
|
tabs: e.tabs
|
|
943
946
|
},
|
|
944
947
|
dataSource: t,
|
|
945
|
-
onEdit:
|
|
948
|
+
onEdit: de,
|
|
946
949
|
onRowClick: g,
|
|
947
950
|
className: "h-full"
|
|
948
951
|
});
|
|
949
|
-
if (
|
|
950
|
-
const D = _e(
|
|
952
|
+
if (O !== "grid") {
|
|
953
|
+
const D = _e(O);
|
|
951
954
|
if (D && Tt)
|
|
952
955
|
return /* @__PURE__ */ i.jsx(
|
|
953
956
|
Tt,
|
|
954
957
|
{
|
|
955
958
|
schema: D,
|
|
956
959
|
dataSource: t,
|
|
957
|
-
data:
|
|
958
|
-
loading:
|
|
960
|
+
data: k,
|
|
961
|
+
loading: R
|
|
959
962
|
},
|
|
960
963
|
y
|
|
961
964
|
);
|
|
962
965
|
if (!Tt)
|
|
963
966
|
return /* @__PURE__ */ i.jsx("div", { className: "flex items-center justify-center h-40 text-muted-foreground", children: /* @__PURE__ */ i.jsxs("p", { children: [
|
|
964
967
|
"SchemaRenderer not available. Install @object-ui/react to render ",
|
|
965
|
-
|
|
968
|
+
O,
|
|
966
969
|
" views."
|
|
967
970
|
] }) });
|
|
968
971
|
}
|
|
969
972
|
return /* @__PURE__ */ i.jsx(
|
|
970
|
-
|
|
973
|
+
$r,
|
|
971
974
|
{
|
|
972
|
-
schema:
|
|
975
|
+
schema: Re,
|
|
973
976
|
dataSource: t,
|
|
974
977
|
onRowClick: g,
|
|
975
|
-
onEdit:
|
|
976
|
-
onDelete:
|
|
977
|
-
onBulkDelete:
|
|
978
|
+
onEdit: Y.update !== !1 ? de : void 0,
|
|
979
|
+
onDelete: Y.delete !== !1 ? te : void 0,
|
|
980
|
+
onBulkDelete: Y.delete !== !1 ? K : void 0
|
|
978
981
|
},
|
|
979
982
|
y
|
|
980
983
|
);
|
|
981
984
|
}, Xe = () => {
|
|
982
|
-
if (!
|
|
983
|
-
const y = Object.entries(
|
|
984
|
-
return y.length <= 1 ? null : /* @__PURE__ */ i.jsx(
|
|
985
|
+
if (!pe) return null;
|
|
986
|
+
const y = Object.entries(Z);
|
|
987
|
+
return y.length <= 1 ? null : /* @__PURE__ */ i.jsx(Zn, { value: he, onValueChange: it, className: "w-full", children: /* @__PURE__ */ i.jsx(er, { className: "w-auto", children: y.map(([D, E]) => /* @__PURE__ */ i.jsx(tr, { value: D, className: "text-sm", children: E.label || D }, D)) }) });
|
|
985
988
|
}, st = () => {
|
|
986
|
-
const y = e.showCreate !== !1 &&
|
|
987
|
-
return !
|
|
988
|
-
|
|
989
|
+
const y = e.showCreate !== !1 && Y.create !== !1, D = e.showViewSwitcher === !0, E = Xe();
|
|
990
|
+
return !E && !D && !y && !p ? null : /* @__PURE__ */ i.jsxs("div", { className: "flex flex-col gap-3", children: [
|
|
991
|
+
E,
|
|
989
992
|
(D || y || p) && /* @__PURE__ */ i.jsxs("div", { className: "flex items-center justify-between gap-4", children: [
|
|
990
|
-
/* @__PURE__ */ i.jsx("div", { className: "flex items-center gap-2", children: D &&
|
|
991
|
-
|
|
993
|
+
/* @__PURE__ */ i.jsx("div", { className: "flex items-center gap-2", children: D && De && /* @__PURE__ */ i.jsx(
|
|
994
|
+
hr,
|
|
992
995
|
{
|
|
993
|
-
schema:
|
|
996
|
+
schema: De,
|
|
994
997
|
onViewChange: be,
|
|
995
|
-
onCreateView:
|
|
998
|
+
onCreateView: v,
|
|
996
999
|
onViewAction: c,
|
|
997
1000
|
className: "overflow-x-auto"
|
|
998
1001
|
}
|
|
999
1002
|
) }),
|
|
1000
1003
|
/* @__PURE__ */ i.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
1001
1004
|
p,
|
|
1002
|
-
y && /* @__PURE__ */ i.jsxs(
|
|
1005
|
+
y && /* @__PURE__ */ i.jsxs(Ce, { size: "sm", onClick: H, children: [
|
|
1003
1006
|
/* @__PURE__ */ i.jsx(fn, { className: "h-4 w-4" }),
|
|
1004
1007
|
"Create"
|
|
1005
1008
|
] })
|
|
1006
1009
|
] })
|
|
1007
1010
|
] })
|
|
1008
1011
|
] });
|
|
1009
|
-
},
|
|
1010
|
-
y ||
|
|
1011
|
-
}, [
|
|
1012
|
-
if (
|
|
1013
|
-
const y =
|
|
1014
|
-
return /* @__PURE__ */ i.jsxs("div", { className:
|
|
1012
|
+
}, Ee = T?.mode === "modal" ? "modal" : T?.mode === "drawer" ? "drawer" : T?.mode === "split" ? "split" : T?.mode === "popover" ? "popover" : ce, at = (y) => /* @__PURE__ */ i.jsx("div", { className: "space-y-3", children: /* @__PURE__ */ i.jsx(Gt, { schema: se(), dataSource: t }) }), St = L((y) => {
|
|
1013
|
+
y || U();
|
|
1014
|
+
}, [U]);
|
|
1015
|
+
if (Ee === "split") {
|
|
1016
|
+
const y = w?.label || e.objectName;
|
|
1017
|
+
return /* @__PURE__ */ i.jsxs("div", { className: re("flex flex-col h-full min-w-0 overflow-hidden", n), children: [
|
|
1015
1018
|
(e.title || e.description) && /* @__PURE__ */ i.jsxs("div", { className: "mb-4 shrink-0", children: [
|
|
1016
1019
|
e.title && /* @__PURE__ */ i.jsx("h2", { className: "text-2xl font-bold tracking-tight", children: e.title }),
|
|
1017
1020
|
e.description && /* @__PURE__ */ i.jsx("p", { className: "text-muted-foreground mt-1", children: e.description })
|
|
1018
1021
|
] }),
|
|
1019
1022
|
/* @__PURE__ */ i.jsx("div", { className: "mb-4 shrink-0", children: st() }),
|
|
1020
|
-
/* @__PURE__ */ i.jsx("div", { className: "flex-1 min-h-0 min-w-0 overflow-hidden", children: S &&
|
|
1023
|
+
/* @__PURE__ */ i.jsx("div", { className: "flex-1 min-h-0 min-w-0 overflow-hidden", children: S && m ? /* @__PURE__ */ i.jsx(
|
|
1021
1024
|
Cn,
|
|
1022
1025
|
{
|
|
1023
1026
|
isOpen: S,
|
|
1024
|
-
selectedRecord:
|
|
1027
|
+
selectedRecord: m,
|
|
1025
1028
|
mode: "split",
|
|
1026
|
-
close:
|
|
1029
|
+
close: U,
|
|
1027
1030
|
setIsOpen: St,
|
|
1028
|
-
width:
|
|
1031
|
+
width: T?.width,
|
|
1029
1032
|
isOverlay: !0,
|
|
1030
1033
|
title: `${y} Detail`,
|
|
1031
1034
|
mainContent: /* @__PURE__ */ i.jsx("div", { className: "h-full overflow-auto", children: Ie() }),
|
|
@@ -1034,26 +1037,26 @@ const zi = ({
|
|
|
1034
1037
|
) : Ie() })
|
|
1035
1038
|
] });
|
|
1036
1039
|
}
|
|
1037
|
-
return /* @__PURE__ */ i.jsxs("div", { className:
|
|
1040
|
+
return /* @__PURE__ */ i.jsxs("div", { className: re("flex flex-col h-full min-w-0 overflow-hidden", n), children: [
|
|
1038
1041
|
(e.title || e.description) && /* @__PURE__ */ i.jsxs("div", { className: "mb-4 shrink-0", children: [
|
|
1039
1042
|
e.title && /* @__PURE__ */ i.jsx("h2", { className: "text-2xl font-bold tracking-tight", children: e.title }),
|
|
1040
1043
|
e.description && /* @__PURE__ */ i.jsx("p", { className: "text-muted-foreground mt-1", children: e.description })
|
|
1041
1044
|
] }),
|
|
1042
1045
|
/* @__PURE__ */ i.jsx("div", { className: "mb-4 shrink-0", children: st() }),
|
|
1043
1046
|
/* @__PURE__ */ i.jsx("div", { className: "flex-1 min-h-0 min-w-0 overflow-hidden", children: Ie() }),
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
+
Ee === "drawer" && Je(),
|
|
1048
|
+
Ee === "modal" && ot(),
|
|
1049
|
+
Ee === "popover" && S && m && /* @__PURE__ */ i.jsx(
|
|
1047
1050
|
Cn,
|
|
1048
1051
|
{
|
|
1049
1052
|
isOpen: S,
|
|
1050
|
-
selectedRecord:
|
|
1053
|
+
selectedRecord: m,
|
|
1051
1054
|
mode: "popover",
|
|
1052
|
-
close:
|
|
1055
|
+
close: U,
|
|
1053
1056
|
setIsOpen: St,
|
|
1054
|
-
width:
|
|
1057
|
+
width: T?.width,
|
|
1055
1058
|
isOverlay: !0,
|
|
1056
|
-
title:
|
|
1059
|
+
title: X(),
|
|
1057
1060
|
children: at
|
|
1058
1061
|
}
|
|
1059
1062
|
)
|
|
@@ -1074,29 +1077,29 @@ const zi = ({
|
|
|
1074
1077
|
className: t,
|
|
1075
1078
|
onChange: n
|
|
1076
1079
|
}) => {
|
|
1077
|
-
const [r, o] =
|
|
1078
|
-
|
|
1080
|
+
const [r, o] = Q.useState(e.values || {}), [s, l] = Q.useState(!1);
|
|
1081
|
+
Q.useEffect(() => {
|
|
1079
1082
|
e.values && o(e.values);
|
|
1080
1083
|
}, [e.values]);
|
|
1081
|
-
const a =
|
|
1084
|
+
const a = Q.useCallback((f) => {
|
|
1082
1085
|
n?.(f), e.onChange && typeof window < "u" && window.dispatchEvent(
|
|
1083
1086
|
new CustomEvent(e.onChange, {
|
|
1084
1087
|
detail: { values: f }
|
|
1085
1088
|
})
|
|
1086
1089
|
);
|
|
1087
|
-
}, [n, e.onChange]), u =
|
|
1090
|
+
}, [n, e.onChange]), u = Q.useCallback((f, j) => {
|
|
1088
1091
|
const N = { ...r, [f]: j };
|
|
1089
1092
|
o(N), e.showApply || a(N);
|
|
1090
|
-
}, [a, e.showApply, r]), p =
|
|
1093
|
+
}, [a, e.showApply, r]), p = Q.useCallback(() => {
|
|
1091
1094
|
const f = {};
|
|
1092
1095
|
if (o(f), e.showApply) {
|
|
1093
1096
|
a(f);
|
|
1094
1097
|
return;
|
|
1095
1098
|
}
|
|
1096
1099
|
a(f);
|
|
1097
|
-
}, [a, e.showApply]),
|
|
1100
|
+
}, [a, e.showApply]), v = Q.useCallback(() => {
|
|
1098
1101
|
a(r), l(!1);
|
|
1099
|
-
}, [a, r]), c =
|
|
1102
|
+
}, [a, r]), c = Q.useMemo(() => Object.values(r).filter((f) => !Bi(f)).length, [r]), w = (f) => {
|
|
1100
1103
|
const j = f.label || f.field, N = f.placeholder || `Filter by ${j}`;
|
|
1101
1104
|
switch (f.type) {
|
|
1102
1105
|
case "number":
|
|
@@ -1106,9 +1109,9 @@ const zi = ({
|
|
|
1106
1109
|
type: "number",
|
|
1107
1110
|
value: r[f.field] ?? "",
|
|
1108
1111
|
placeholder: N,
|
|
1109
|
-
onChange: (
|
|
1110
|
-
const C =
|
|
1111
|
-
u(f.field,
|
|
1112
|
+
onChange: (m) => {
|
|
1113
|
+
const C = m.target.value, A = C === "" ? "" : Number(C);
|
|
1114
|
+
u(f.field, A);
|
|
1112
1115
|
}
|
|
1113
1116
|
}
|
|
1114
1117
|
);
|
|
@@ -1117,35 +1120,64 @@ const zi = ({
|
|
|
1117
1120
|
Ot,
|
|
1118
1121
|
{
|
|
1119
1122
|
value: r[f.field] !== void 0 ? String(r[f.field]) : "",
|
|
1120
|
-
onValueChange: (
|
|
1121
|
-
const C = f.options?.find((
|
|
1122
|
-
u(f.field, C ? C.value :
|
|
1123
|
+
onValueChange: (m) => {
|
|
1124
|
+
const C = f.options?.find((A) => String(A.value) === m);
|
|
1125
|
+
u(f.field, C ? C.value : m);
|
|
1123
1126
|
},
|
|
1124
1127
|
children: [
|
|
1125
1128
|
/* @__PURE__ */ i.jsx(It, { children: /* @__PURE__ */ i.jsx(kt, { placeholder: N }) }),
|
|
1126
|
-
/* @__PURE__ */ i.jsx(Vt, { children: f.options?.map((
|
|
1129
|
+
/* @__PURE__ */ i.jsx(Vt, { children: f.options?.map((m) => /* @__PURE__ */ i.jsx(pt, { value: String(m.value), children: m.label }, String(m.value))) })
|
|
1127
1130
|
]
|
|
1128
1131
|
}
|
|
1129
1132
|
);
|
|
1133
|
+
case "multi-select": {
|
|
1134
|
+
const m = r[f.field], C = Array.isArray(m) ? m : m ? [m] : [];
|
|
1135
|
+
return /* @__PURE__ */ i.jsx("div", { className: "max-h-40 overflow-y-auto space-y-0.5 border rounded-md p-2", children: f.options?.map((A) => {
|
|
1136
|
+
const F = C.map(String).includes(String(A.value));
|
|
1137
|
+
return /* @__PURE__ */ i.jsxs(
|
|
1138
|
+
"label",
|
|
1139
|
+
{
|
|
1140
|
+
className: re(
|
|
1141
|
+
"flex items-center gap-2 text-sm py-1 px-1.5 rounded cursor-pointer",
|
|
1142
|
+
F ? "bg-primary/5 text-primary" : "hover:bg-muted"
|
|
1143
|
+
),
|
|
1144
|
+
children: [
|
|
1145
|
+
/* @__PURE__ */ i.jsx(
|
|
1146
|
+
Sn,
|
|
1147
|
+
{
|
|
1148
|
+
checked: F,
|
|
1149
|
+
onCheckedChange: (k) => {
|
|
1150
|
+
const x = k ? [...C, A.value] : C.filter((R) => String(R) !== String(A.value));
|
|
1151
|
+
u(f.field, x);
|
|
1152
|
+
}
|
|
1153
|
+
}
|
|
1154
|
+
),
|
|
1155
|
+
/* @__PURE__ */ i.jsx("span", { className: "truncate", children: A.label })
|
|
1156
|
+
]
|
|
1157
|
+
},
|
|
1158
|
+
String(A.value)
|
|
1159
|
+
);
|
|
1160
|
+
}) });
|
|
1161
|
+
}
|
|
1130
1162
|
case "date":
|
|
1131
1163
|
return /* @__PURE__ */ i.jsx(
|
|
1132
1164
|
We,
|
|
1133
1165
|
{
|
|
1134
1166
|
type: "date",
|
|
1135
1167
|
value: r[f.field] ?? "",
|
|
1136
|
-
onChange: (
|
|
1168
|
+
onChange: (m) => u(f.field, m.target.value)
|
|
1137
1169
|
}
|
|
1138
1170
|
);
|
|
1139
1171
|
case "date-range": {
|
|
1140
|
-
const
|
|
1172
|
+
const m = Ui(r[f.field]);
|
|
1141
1173
|
return /* @__PURE__ */ i.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
1142
1174
|
/* @__PURE__ */ i.jsx(
|
|
1143
1175
|
We,
|
|
1144
1176
|
{
|
|
1145
1177
|
type: "date",
|
|
1146
|
-
value:
|
|
1178
|
+
value: m.start ?? "",
|
|
1147
1179
|
onChange: (C) => {
|
|
1148
|
-
u(f.field, { ...
|
|
1180
|
+
u(f.field, { ...m, start: C.target.value });
|
|
1149
1181
|
}
|
|
1150
1182
|
}
|
|
1151
1183
|
),
|
|
@@ -1153,9 +1185,9 @@ const zi = ({
|
|
|
1153
1185
|
We,
|
|
1154
1186
|
{
|
|
1155
1187
|
type: "date",
|
|
1156
|
-
value:
|
|
1188
|
+
value: m.end ?? "",
|
|
1157
1189
|
onChange: (C) => {
|
|
1158
|
-
u(f.field, { ...
|
|
1190
|
+
u(f.field, { ...m, end: C.target.value });
|
|
1159
1191
|
}
|
|
1160
1192
|
}
|
|
1161
1193
|
)
|
|
@@ -1164,10 +1196,10 @@ const zi = ({
|
|
|
1164
1196
|
case "boolean":
|
|
1165
1197
|
return /* @__PURE__ */ i.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
1166
1198
|
/* @__PURE__ */ i.jsx(
|
|
1167
|
-
|
|
1199
|
+
Sn,
|
|
1168
1200
|
{
|
|
1169
1201
|
checked: !!r[f.field],
|
|
1170
|
-
onCheckedChange: (
|
|
1202
|
+
onCheckedChange: (m) => u(f.field, !!m)
|
|
1171
1203
|
}
|
|
1172
1204
|
),
|
|
1173
1205
|
/* @__PURE__ */ i.jsx("span", { className: "text-sm text-muted-foreground", children: "Enabled" })
|
|
@@ -1178,43 +1210,43 @@ const zi = ({
|
|
|
1178
1210
|
{
|
|
1179
1211
|
value: r[f.field] ?? "",
|
|
1180
1212
|
placeholder: N,
|
|
1181
|
-
onChange: (
|
|
1213
|
+
onChange: (m) => u(f.field, m.target.value)
|
|
1182
1214
|
}
|
|
1183
1215
|
);
|
|
1184
1216
|
}
|
|
1185
|
-
},
|
|
1217
|
+
}, b = /* @__PURE__ */ i.jsxs("div", { className: "space-y-4", children: [
|
|
1186
1218
|
/* @__PURE__ */ i.jsx("div", { className: "grid gap-4 sm:grid-cols-2", children: e.filters.map((f) => /* @__PURE__ */ i.jsxs("div", { className: "space-y-2", children: [
|
|
1187
|
-
/* @__PURE__ */ i.jsx(
|
|
1188
|
-
|
|
1219
|
+
/* @__PURE__ */ i.jsx(Gr, { className: "text-xs text-muted-foreground", children: f.label || f.field }),
|
|
1220
|
+
w(f)
|
|
1189
1221
|
] }, f.field)) }),
|
|
1190
1222
|
(e.showApply || e.showClear) && /* @__PURE__ */ i.jsxs("div", { className: "flex items-center justify-end gap-2 border-t pt-3", children: [
|
|
1191
|
-
e.showClear && /* @__PURE__ */ i.jsx(
|
|
1192
|
-
e.showApply && /* @__PURE__ */ i.jsx(
|
|
1223
|
+
e.showClear && /* @__PURE__ */ i.jsx(Ce, { type: "button", variant: "ghost", size: "sm", onClick: p, children: "Clear" }),
|
|
1224
|
+
e.showApply && /* @__PURE__ */ i.jsx(Ce, { type: "button", size: "sm", onClick: v, children: "Apply" })
|
|
1193
1225
|
] })
|
|
1194
1226
|
] }), S = e.layout || "inline";
|
|
1195
|
-
return S === "popover" ? /* @__PURE__ */ i.jsx("div", { className:
|
|
1196
|
-
/* @__PURE__ */ i.jsx(
|
|
1197
|
-
/* @__PURE__ */ i.jsx(
|
|
1227
|
+
return S === "popover" ? /* @__PURE__ */ i.jsx("div", { className: re(Kt({ layout: S }), t), children: /* @__PURE__ */ i.jsxs(ar, { open: s, onOpenChange: l, children: [
|
|
1228
|
+
/* @__PURE__ */ i.jsx(lr, { asChild: !0, children: /* @__PURE__ */ i.jsxs(Ce, { type: "button", variant: c > 0 ? "secondary" : "outline", size: "sm", className: "gap-2", children: [
|
|
1229
|
+
/* @__PURE__ */ i.jsx(An, { className: "h-4 w-4" }),
|
|
1198
1230
|
"Filters",
|
|
1199
1231
|
c > 0 && /* @__PURE__ */ i.jsx("span", { className: "inline-flex h-5 min-w-[20px] items-center justify-center rounded-full bg-primary/10 px-1 text-xs font-medium text-primary", children: c })
|
|
1200
1232
|
] }) }),
|
|
1201
|
-
/* @__PURE__ */ i.jsx(
|
|
1202
|
-
] }) }) : S === "drawer" ? /* @__PURE__ */ i.jsxs("div", { className:
|
|
1203
|
-
/* @__PURE__ */ i.jsxs(
|
|
1204
|
-
/* @__PURE__ */ i.jsx(
|
|
1233
|
+
/* @__PURE__ */ i.jsx(cr, { align: "start", className: "w-[520px] p-4", children: b })
|
|
1234
|
+
] }) }) : S === "drawer" ? /* @__PURE__ */ i.jsxs("div", { className: re(Kt({ layout: S }), t), children: [
|
|
1235
|
+
/* @__PURE__ */ i.jsxs(Ce, { type: "button", variant: c > 0 ? "secondary" : "outline", size: "sm", className: "gap-2", onClick: () => l(!0), children: [
|
|
1236
|
+
/* @__PURE__ */ i.jsx(An, { className: "h-4 w-4" }),
|
|
1205
1237
|
"Filters",
|
|
1206
1238
|
c > 0 && /* @__PURE__ */ i.jsx("span", { className: "inline-flex h-5 min-w-[20px] items-center justify-center rounded-full bg-primary/10 px-1 text-xs font-medium text-primary", children: c })
|
|
1207
1239
|
] }),
|
|
1208
|
-
/* @__PURE__ */ i.jsx(
|
|
1209
|
-
/* @__PURE__ */ i.jsxs(
|
|
1210
|
-
/* @__PURE__ */ i.jsx(
|
|
1211
|
-
/* @__PURE__ */ i.jsx(
|
|
1240
|
+
/* @__PURE__ */ i.jsx(nr, { open: s, onOpenChange: l, children: /* @__PURE__ */ i.jsxs(rr, { children: [
|
|
1241
|
+
/* @__PURE__ */ i.jsxs(ir, { children: [
|
|
1242
|
+
/* @__PURE__ */ i.jsx(or, { children: "Filters" }),
|
|
1243
|
+
/* @__PURE__ */ i.jsx(sr, { children: "Refine the data with advanced filters." })
|
|
1212
1244
|
] }),
|
|
1213
|
-
/* @__PURE__ */ i.jsx("div", { className: "px-4 pb-6", children:
|
|
1245
|
+
/* @__PURE__ */ i.jsx("div", { className: "px-4 pb-6", children: b })
|
|
1214
1246
|
] }) })
|
|
1215
|
-
] }) : /* @__PURE__ */ i.jsxs("div", { className:
|
|
1216
|
-
|
|
1217
|
-
!e.showApply && e.showClear && /* @__PURE__ */ i.jsxs(
|
|
1247
|
+
] }) : /* @__PURE__ */ i.jsxs("div", { className: re(Kt({ layout: S }), t), children: [
|
|
1248
|
+
b,
|
|
1249
|
+
!e.showApply && e.showClear && /* @__PURE__ */ i.jsxs(Ce, { type: "button", variant: "ghost", size: "sm", className: "gap-2", onClick: p, children: [
|
|
1218
1250
|
/* @__PURE__ */ i.jsx(hi, { className: "h-3.5 w-3.5" }),
|
|
1219
1251
|
"Clear filters"
|
|
1220
1252
|
] })
|
|
@@ -1233,7 +1265,7 @@ const zi = ({
|
|
|
1233
1265
|
}), Qt = (e) => e ? e.map((t) => ({
|
|
1234
1266
|
field: t.field,
|
|
1235
1267
|
direction: t.direction
|
|
1236
|
-
})) : [],
|
|
1268
|
+
})) : [], _n = (e) => e.map((t) => ({
|
|
1237
1269
|
id: `${t.field}-${t.direction}`,
|
|
1238
1270
|
field: t.field,
|
|
1239
1271
|
order: t.direction
|
|
@@ -1245,25 +1277,25 @@ const zi = ({
|
|
|
1245
1277
|
className: t,
|
|
1246
1278
|
onChange: n
|
|
1247
1279
|
}) => {
|
|
1248
|
-
const [r, o] =
|
|
1249
|
-
|
|
1280
|
+
const [r, o] = Q.useState(() => Qt(e.sort)), [s, l] = Q.useState(() => _n(Qt(e.sort)));
|
|
1281
|
+
Q.useEffect(() => {
|
|
1250
1282
|
const c = Qt(e.sort);
|
|
1251
|
-
o(c), l(
|
|
1283
|
+
o(c), l(_n(c));
|
|
1252
1284
|
}, [e.sort]);
|
|
1253
|
-
const a =
|
|
1285
|
+
const a = Q.useCallback((c) => {
|
|
1254
1286
|
o(c), n?.(c), e.onChange && typeof window < "u" && window.dispatchEvent(
|
|
1255
1287
|
new CustomEvent(e.onChange, {
|
|
1256
1288
|
detail: { sort: c }
|
|
1257
1289
|
})
|
|
1258
1290
|
);
|
|
1259
|
-
}, [n, e.onChange]), u =
|
|
1260
|
-
const
|
|
1261
|
-
if (!
|
|
1262
|
-
const f =
|
|
1291
|
+
}, [n, e.onChange]), u = Q.useCallback((c) => {
|
|
1292
|
+
const w = r.find((f) => f.field === c), b = !!e.multiple;
|
|
1293
|
+
if (!w) {
|
|
1294
|
+
const f = b ? [...r, { field: c, direction: "asc" }] : [{ field: c, direction: "asc" }];
|
|
1263
1295
|
a(f);
|
|
1264
1296
|
return;
|
|
1265
1297
|
}
|
|
1266
|
-
if (
|
|
1298
|
+
if (w.direction === "asc") {
|
|
1267
1299
|
const f = r.map(
|
|
1268
1300
|
(j) => j.field === c ? { ...j, direction: "desc" } : j
|
|
1269
1301
|
);
|
|
@@ -1274,26 +1306,26 @@ const zi = ({
|
|
|
1274
1306
|
a(S);
|
|
1275
1307
|
}, [a, e.multiple, r]);
|
|
1276
1308
|
if ((e.variant || "dropdown") === "buttons")
|
|
1277
|
-
return /* @__PURE__ */ i.jsx("div", { className:
|
|
1278
|
-
const
|
|
1309
|
+
return /* @__PURE__ */ i.jsx("div", { className: re(Jt({ variant: "buttons" }), t), children: e.fields.map((c) => {
|
|
1310
|
+
const w = r.find((S) => S.field === c.field), b = w?.direction === "asc" ? gi : vi;
|
|
1279
1311
|
return /* @__PURE__ */ i.jsxs(
|
|
1280
|
-
|
|
1312
|
+
Ce,
|
|
1281
1313
|
{
|
|
1282
1314
|
type: "button",
|
|
1283
|
-
variant:
|
|
1315
|
+
variant: w ? "secondary" : "outline",
|
|
1284
1316
|
size: "sm",
|
|
1285
1317
|
onClick: () => u(c.field),
|
|
1286
1318
|
className: "gap-2",
|
|
1287
1319
|
children: [
|
|
1288
1320
|
/* @__PURE__ */ i.jsx("span", { children: c.label || c.field }),
|
|
1289
|
-
|
|
1321
|
+
w && /* @__PURE__ */ i.jsx(b, { className: "h-3.5 w-3.5" })
|
|
1290
1322
|
]
|
|
1291
1323
|
},
|
|
1292
1324
|
c.field
|
|
1293
1325
|
);
|
|
1294
1326
|
}) });
|
|
1295
1327
|
if (e.multiple)
|
|
1296
|
-
return /* @__PURE__ */ i.jsx("div", { className:
|
|
1328
|
+
return /* @__PURE__ */ i.jsx("div", { className: re(Jt({ variant: "builder" }), t), children: /* @__PURE__ */ i.jsx(
|
|
1297
1329
|
Hr,
|
|
1298
1330
|
{
|
|
1299
1331
|
fields: e.fields.map((c) => ({ value: c.field, label: c.label || c.field })),
|
|
@@ -1303,18 +1335,18 @@ const zi = ({
|
|
|
1303
1335
|
}
|
|
1304
1336
|
}
|
|
1305
1337
|
) });
|
|
1306
|
-
const
|
|
1307
|
-
return /* @__PURE__ */ i.jsxs("div", { className:
|
|
1338
|
+
const v = r[0];
|
|
1339
|
+
return /* @__PURE__ */ i.jsxs("div", { className: re(Jt({ variant: "dropdown" }), t), children: [
|
|
1308
1340
|
/* @__PURE__ */ i.jsxs(
|
|
1309
1341
|
Ot,
|
|
1310
1342
|
{
|
|
1311
|
-
value:
|
|
1343
|
+
value: v?.field || "",
|
|
1312
1344
|
onValueChange: (c) => {
|
|
1313
1345
|
if (!c) {
|
|
1314
1346
|
a([]);
|
|
1315
1347
|
return;
|
|
1316
1348
|
}
|
|
1317
|
-
a([{ field: c, direction:
|
|
1349
|
+
a([{ field: c, direction: v?.direction || "asc" }]);
|
|
1318
1350
|
},
|
|
1319
1351
|
children: [
|
|
1320
1352
|
/* @__PURE__ */ i.jsx(It, { className: "w-56", children: /* @__PURE__ */ i.jsx(kt, { placeholder: "Select field" }) }),
|
|
@@ -1325,9 +1357,9 @@ const zi = ({
|
|
|
1325
1357
|
/* @__PURE__ */ i.jsxs(
|
|
1326
1358
|
Ot,
|
|
1327
1359
|
{
|
|
1328
|
-
value:
|
|
1360
|
+
value: v?.direction || "asc",
|
|
1329
1361
|
onValueChange: (c) => {
|
|
1330
|
-
|
|
1362
|
+
v?.field && a([{ field: v.field, direction: c }]);
|
|
1331
1363
|
},
|
|
1332
1364
|
children: [
|
|
1333
1365
|
/* @__PURE__ */ i.jsx(It, { className: "w-36", children: /* @__PURE__ */ i.jsx(kt, {}) }),
|
|
@@ -1359,26 +1391,26 @@ const qi = ({
|
|
|
1359
1391
|
onShare: r,
|
|
1360
1392
|
className: o
|
|
1361
1393
|
}) => {
|
|
1362
|
-
const [s, l] =
|
|
1363
|
-
const
|
|
1394
|
+
const [s, l] = Q.useState(null), [a, u] = Q.useState(!1), [p, v] = Q.useState(!1), [c, w] = Q.useState(""), [b, S] = Q.useState(""), f = n ?? (typeof window < "u" ? window.location.origin : ""), j = Q.useCallback(() => {
|
|
1395
|
+
const m = Hi(), C = Xi(f, e, t, m);
|
|
1364
1396
|
l(C), u(!1);
|
|
1365
|
-
const
|
|
1366
|
-
r?.(C, { password: c || void 0, expiresAt:
|
|
1367
|
-
}, [f, e, t, r, c,
|
|
1397
|
+
const A = b ? new Date(Date.now() + parseInt(b, 10) * 864e5).toISOString() : void 0;
|
|
1398
|
+
r?.(C, { password: c || void 0, expiresAt: A });
|
|
1399
|
+
}, [f, e, t, r, c, b]), N = Q.useCallback(async () => {
|
|
1368
1400
|
if (s)
|
|
1369
1401
|
try {
|
|
1370
1402
|
await navigator.clipboard.writeText(s), u(!0), setTimeout(() => u(!1), 2e3);
|
|
1371
1403
|
} catch {
|
|
1372
|
-
const
|
|
1373
|
-
|
|
1404
|
+
const m = document.createElement("textarea");
|
|
1405
|
+
m.value = s, document.body.appendChild(m), m.select(), document.execCommand("copy"), document.body.removeChild(m), u(!0), setTimeout(() => u(!1), 2e3);
|
|
1374
1406
|
}
|
|
1375
1407
|
}, [s]);
|
|
1376
|
-
return /* @__PURE__ */ i.jsxs(
|
|
1377
|
-
/* @__PURE__ */ i.jsx(
|
|
1408
|
+
return /* @__PURE__ */ i.jsxs(ar, { open: p, onOpenChange: v, children: [
|
|
1409
|
+
/* @__PURE__ */ i.jsx(lr, { asChild: !0, children: /* @__PURE__ */ i.jsxs(Ce, { variant: "outline", size: "sm", className: re("gap-2", o), children: [
|
|
1378
1410
|
/* @__PURE__ */ i.jsx(Mt, { className: "h-4 w-4" }),
|
|
1379
1411
|
"Share"
|
|
1380
1412
|
] }) }),
|
|
1381
|
-
/* @__PURE__ */ i.jsxs(
|
|
1413
|
+
/* @__PURE__ */ i.jsxs(cr, { className: "w-96 space-y-4", align: "end", children: [
|
|
1382
1414
|
/* @__PURE__ */ i.jsxs("div", { className: "space-y-2", children: [
|
|
1383
1415
|
/* @__PURE__ */ i.jsxs("div", { className: "flex items-center justify-between", children: [
|
|
1384
1416
|
/* @__PURE__ */ i.jsx("h4", { className: "text-sm font-medium", children: "Share View" }),
|
|
@@ -1394,31 +1426,31 @@ const qi = ({
|
|
|
1394
1426
|
value: s,
|
|
1395
1427
|
readOnly: !0,
|
|
1396
1428
|
className: "h-8 text-xs",
|
|
1397
|
-
onClick: (
|
|
1429
|
+
onClick: (m) => m.target.select()
|
|
1398
1430
|
}
|
|
1399
1431
|
),
|
|
1400
1432
|
/* @__PURE__ */ i.jsx(
|
|
1401
|
-
|
|
1433
|
+
Ce,
|
|
1402
1434
|
{
|
|
1403
1435
|
variant: "outline",
|
|
1404
1436
|
size: "sm",
|
|
1405
1437
|
onClick: N,
|
|
1406
1438
|
className: "shrink-0 gap-1",
|
|
1407
|
-
children: a ? /* @__PURE__ */ i.jsx(
|
|
1439
|
+
children: a ? /* @__PURE__ */ i.jsx(bi, { className: "h-4 w-4 text-green-500" }) : /* @__PURE__ */ i.jsx(un, { className: "h-4 w-4" })
|
|
1408
1440
|
}
|
|
1409
1441
|
)
|
|
1410
1442
|
] }),
|
|
1411
|
-
(c ||
|
|
1443
|
+
(c || b) && /* @__PURE__ */ i.jsxs("div", { className: "flex items-center gap-2 flex-wrap", children: [
|
|
1412
1444
|
c && /* @__PURE__ */ i.jsxs(Ht, { variant: "outline", className: "text-xs gap-1", children: [
|
|
1413
1445
|
/* @__PURE__ */ i.jsx(on, { className: "h-3 w-3" }),
|
|
1414
1446
|
"Password protected"
|
|
1415
1447
|
] }),
|
|
1416
|
-
|
|
1448
|
+
b && /* @__PURE__ */ i.jsxs(Ht, { variant: "outline", className: "text-xs gap-1", children: [
|
|
1417
1449
|
/* @__PURE__ */ i.jsx(rn, { className: "h-3 w-3" }),
|
|
1418
1450
|
"Expires in ",
|
|
1419
|
-
|
|
1451
|
+
b,
|
|
1420
1452
|
" day",
|
|
1421
|
-
|
|
1453
|
+
b !== "1" ? "s" : ""
|
|
1422
1454
|
] })
|
|
1423
1455
|
] })
|
|
1424
1456
|
] }) : /* @__PURE__ */ i.jsxs("div", { className: "space-y-3", children: [
|
|
@@ -1432,7 +1464,7 @@ const qi = ({
|
|
|
1432
1464
|
{
|
|
1433
1465
|
type: "password",
|
|
1434
1466
|
value: c,
|
|
1435
|
-
onChange: (
|
|
1467
|
+
onChange: (m) => w(m.target.value),
|
|
1436
1468
|
placeholder: "Enter password...",
|
|
1437
1469
|
className: "h-8 text-xs"
|
|
1438
1470
|
}
|
|
@@ -1446,8 +1478,8 @@ const qi = ({
|
|
|
1446
1478
|
/* @__PURE__ */ i.jsxs(
|
|
1447
1479
|
"select",
|
|
1448
1480
|
{
|
|
1449
|
-
value:
|
|
1450
|
-
onChange: (
|
|
1481
|
+
value: b,
|
|
1482
|
+
onChange: (m) => S(m.target.value),
|
|
1451
1483
|
className: "w-full h-8 text-xs rounded-md border border-input bg-background px-3",
|
|
1452
1484
|
children: [
|
|
1453
1485
|
/* @__PURE__ */ i.jsx("option", { value: "", children: "Never" }),
|
|
@@ -1459,7 +1491,7 @@ const qi = ({
|
|
|
1459
1491
|
}
|
|
1460
1492
|
)
|
|
1461
1493
|
] }),
|
|
1462
|
-
/* @__PURE__ */ i.jsxs(
|
|
1494
|
+
/* @__PURE__ */ i.jsxs(Ce, { onClick: j, className: "w-full gap-2", size: "sm", children: [
|
|
1463
1495
|
/* @__PURE__ */ i.jsx(Mt, { className: "h-4 w-4" }),
|
|
1464
1496
|
"Generate Link"
|
|
1465
1497
|
] })
|
|
@@ -1470,7 +1502,7 @@ const qi = ({
|
|
|
1470
1502
|
function Ki() {
|
|
1471
1503
|
for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++)
|
|
1472
1504
|
t[n] = arguments[n];
|
|
1473
|
-
return
|
|
1505
|
+
return V(
|
|
1474
1506
|
() => (r) => {
|
|
1475
1507
|
t.forEach((o) => o(r));
|
|
1476
1508
|
},
|
|
@@ -1487,45 +1519,45 @@ function tt(e) {
|
|
|
1487
1519
|
function pn(e) {
|
|
1488
1520
|
return "nodeType" in e;
|
|
1489
1521
|
}
|
|
1490
|
-
function
|
|
1522
|
+
function Se(e) {
|
|
1491
1523
|
var t, n;
|
|
1492
1524
|
return e ? tt(e) ? e : pn(e) && (t = (n = e.ownerDocument) == null ? void 0 : n.defaultView) != null ? t : window : window;
|
|
1493
1525
|
}
|
|
1494
1526
|
function hn(e) {
|
|
1495
1527
|
const {
|
|
1496
1528
|
Document: t
|
|
1497
|
-
} =
|
|
1529
|
+
} = Se(e);
|
|
1498
1530
|
return e instanceof t;
|
|
1499
1531
|
}
|
|
1500
1532
|
function yt(e) {
|
|
1501
|
-
return tt(e) ? !1 : e instanceof
|
|
1533
|
+
return tt(e) ? !1 : e instanceof Se(e).HTMLElement;
|
|
1502
1534
|
}
|
|
1503
|
-
function
|
|
1504
|
-
return e instanceof
|
|
1535
|
+
function gr(e) {
|
|
1536
|
+
return e instanceof Se(e).SVGElement;
|
|
1505
1537
|
}
|
|
1506
1538
|
function nt(e) {
|
|
1507
|
-
return e ? tt(e) ? e.document : pn(e) ? hn(e) ? e : yt(e) ||
|
|
1539
|
+
return e ? tt(e) ? e.document : pn(e) ? hn(e) ? e : yt(e) || gr(e) ? e.ownerDocument : document : document : document;
|
|
1508
1540
|
}
|
|
1509
|
-
const Me = zt ?
|
|
1541
|
+
const Me = zt ? Mr : W;
|
|
1510
1542
|
function gn(e) {
|
|
1511
1543
|
const t = q(e);
|
|
1512
1544
|
return Me(() => {
|
|
1513
1545
|
t.current = e;
|
|
1514
|
-
}),
|
|
1546
|
+
}), L(function() {
|
|
1515
1547
|
for (var n = arguments.length, r = new Array(n), o = 0; o < n; o++)
|
|
1516
1548
|
r[o] = arguments[o];
|
|
1517
1549
|
return t.current == null ? void 0 : t.current(...r);
|
|
1518
1550
|
}, []);
|
|
1519
1551
|
}
|
|
1520
1552
|
function Ji() {
|
|
1521
|
-
const e = q(null), t =
|
|
1553
|
+
const e = q(null), t = L((r, o) => {
|
|
1522
1554
|
e.current = setInterval(r, o);
|
|
1523
|
-
}, []), n =
|
|
1555
|
+
}, []), n = L(() => {
|
|
1524
1556
|
e.current !== null && (clearInterval(e.current), e.current = null);
|
|
1525
1557
|
}, []);
|
|
1526
1558
|
return [t, n];
|
|
1527
1559
|
}
|
|
1528
|
-
function
|
|
1560
|
+
function bt(e, t) {
|
|
1529
1561
|
t === void 0 && (t = [e]);
|
|
1530
1562
|
const n = q(e);
|
|
1531
1563
|
return Me(() => {
|
|
@@ -1534,7 +1566,7 @@ function vt(e, t) {
|
|
|
1534
1566
|
}
|
|
1535
1567
|
function jt(e, t) {
|
|
1536
1568
|
const n = q();
|
|
1537
|
-
return
|
|
1569
|
+
return V(
|
|
1538
1570
|
() => {
|
|
1539
1571
|
const r = e(n.current);
|
|
1540
1572
|
return n.current = r, r;
|
|
@@ -1544,7 +1576,7 @@ function jt(e, t) {
|
|
|
1544
1576
|
);
|
|
1545
1577
|
}
|
|
1546
1578
|
function Pt(e) {
|
|
1547
|
-
const t = gn(e), n = q(null), r =
|
|
1579
|
+
const t = gn(e), n = q(null), r = L(
|
|
1548
1580
|
(o) => {
|
|
1549
1581
|
o !== n.current && t?.(o, n.current), n.current = o;
|
|
1550
1582
|
},
|
|
@@ -1555,28 +1587,28 @@ function Pt(e) {
|
|
|
1555
1587
|
}
|
|
1556
1588
|
function sn(e) {
|
|
1557
1589
|
const t = q();
|
|
1558
|
-
return
|
|
1590
|
+
return W(() => {
|
|
1559
1591
|
t.current = e;
|
|
1560
1592
|
}, [e]), t.current;
|
|
1561
1593
|
}
|
|
1562
1594
|
let Zt = {};
|
|
1563
1595
|
function Ct(e, t) {
|
|
1564
|
-
return
|
|
1596
|
+
return V(() => {
|
|
1565
1597
|
if (t)
|
|
1566
1598
|
return t;
|
|
1567
1599
|
const n = Zt[e] == null ? 0 : Zt[e] + 1;
|
|
1568
1600
|
return Zt[e] = n, e + "-" + n;
|
|
1569
1601
|
}, [e, t]);
|
|
1570
1602
|
}
|
|
1571
|
-
function
|
|
1603
|
+
function vr(e) {
|
|
1572
1604
|
return function(t) {
|
|
1573
1605
|
for (var n = arguments.length, r = new Array(n > 1 ? n - 1 : 0), o = 1; o < n; o++)
|
|
1574
1606
|
r[o - 1] = arguments[o];
|
|
1575
1607
|
return r.reduce((s, l) => {
|
|
1576
1608
|
const a = Object.entries(l);
|
|
1577
1609
|
for (const [u, p] of a) {
|
|
1578
|
-
const
|
|
1579
|
-
|
|
1610
|
+
const v = s[u];
|
|
1611
|
+
v != null && (s[u] = v + e * p);
|
|
1580
1612
|
}
|
|
1581
1613
|
return s;
|
|
1582
1614
|
}, {
|
|
@@ -1584,16 +1616,16 @@ function gr(e) {
|
|
|
1584
1616
|
});
|
|
1585
1617
|
};
|
|
1586
1618
|
}
|
|
1587
|
-
const Ze = /* @__PURE__ */
|
|
1619
|
+
const Ze = /* @__PURE__ */ vr(1), Lt = /* @__PURE__ */ vr(-1);
|
|
1588
1620
|
function Qi(e) {
|
|
1589
1621
|
return "clientX" in e && "clientY" in e;
|
|
1590
1622
|
}
|
|
1591
|
-
function
|
|
1623
|
+
function vn(e) {
|
|
1592
1624
|
if (!e)
|
|
1593
1625
|
return !1;
|
|
1594
1626
|
const {
|
|
1595
1627
|
KeyboardEvent: t
|
|
1596
|
-
} =
|
|
1628
|
+
} = Se(e.target);
|
|
1597
1629
|
return t && e instanceof t;
|
|
1598
1630
|
}
|
|
1599
1631
|
function Zi(e) {
|
|
@@ -1601,7 +1633,7 @@ function Zi(e) {
|
|
|
1601
1633
|
return !1;
|
|
1602
1634
|
const {
|
|
1603
1635
|
TouchEvent: t
|
|
1604
|
-
} =
|
|
1636
|
+
} = Se(e.target);
|
|
1605
1637
|
return t && e instanceof t;
|
|
1606
1638
|
}
|
|
1607
1639
|
function an(e) {
|
|
@@ -1670,9 +1702,9 @@ const mt = /* @__PURE__ */ Object.freeze({
|
|
|
1670
1702
|
return t + " " + n + "ms " + r;
|
|
1671
1703
|
}
|
|
1672
1704
|
}
|
|
1673
|
-
}),
|
|
1705
|
+
}), $n = "a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";
|
|
1674
1706
|
function eo(e) {
|
|
1675
|
-
return e.matches(
|
|
1707
|
+
return e.matches($n) ? e : e.querySelector($n);
|
|
1676
1708
|
}
|
|
1677
1709
|
const to = {
|
|
1678
1710
|
display: "none"
|
|
@@ -1682,7 +1714,7 @@ function no(e) {
|
|
|
1682
1714
|
id: t,
|
|
1683
1715
|
value: n
|
|
1684
1716
|
} = e;
|
|
1685
|
-
return
|
|
1717
|
+
return ve.createElement("div", {
|
|
1686
1718
|
id: t,
|
|
1687
1719
|
style: to
|
|
1688
1720
|
}, n);
|
|
@@ -1707,7 +1739,7 @@ function ro(e) {
|
|
|
1707
1739
|
clipPath: "inset(100%)",
|
|
1708
1740
|
whiteSpace: "nowrap"
|
|
1709
1741
|
};
|
|
1710
|
-
return
|
|
1742
|
+
return ve.createElement("div", {
|
|
1711
1743
|
id: t,
|
|
1712
1744
|
style: o,
|
|
1713
1745
|
role: "status",
|
|
@@ -1718,7 +1750,7 @@ function ro(e) {
|
|
|
1718
1750
|
function io() {
|
|
1719
1751
|
const [e, t] = ee("");
|
|
1720
1752
|
return {
|
|
1721
|
-
announce:
|
|
1753
|
+
announce: L((r) => {
|
|
1722
1754
|
r != null && t(r);
|
|
1723
1755
|
}, []),
|
|
1724
1756
|
announcement: e
|
|
@@ -1727,15 +1759,15 @@ function io() {
|
|
|
1727
1759
|
const br = /* @__PURE__ */ wt(null);
|
|
1728
1760
|
function oo(e) {
|
|
1729
1761
|
const t = Ge(br);
|
|
1730
|
-
|
|
1762
|
+
W(() => {
|
|
1731
1763
|
if (!t)
|
|
1732
1764
|
throw new Error("useDndMonitor must be used within a children of <DndContext>");
|
|
1733
1765
|
return t(e);
|
|
1734
1766
|
}, [e, t]);
|
|
1735
1767
|
}
|
|
1736
1768
|
function so() {
|
|
1737
|
-
const [e] = ee(() => /* @__PURE__ */ new Set()), t =
|
|
1738
|
-
return [
|
|
1769
|
+
const [e] = ee(() => /* @__PURE__ */ new Set()), t = L((r) => (e.add(r), () => e.delete(r)), [e]);
|
|
1770
|
+
return [L((r) => {
|
|
1739
1771
|
let {
|
|
1740
1772
|
type: o,
|
|
1741
1773
|
event: s
|
|
@@ -1791,76 +1823,76 @@ function co(e) {
|
|
|
1791
1823
|
announce: s,
|
|
1792
1824
|
announcement: l
|
|
1793
1825
|
} = io(), a = Ct("DndLiveRegion"), [u, p] = ee(!1);
|
|
1794
|
-
if (
|
|
1826
|
+
if (W(() => {
|
|
1795
1827
|
p(!0);
|
|
1796
|
-
}, []), oo(
|
|
1828
|
+
}, []), oo(V(() => ({
|
|
1797
1829
|
onDragStart(c) {
|
|
1798
1830
|
let {
|
|
1799
|
-
active:
|
|
1831
|
+
active: w
|
|
1800
1832
|
} = c;
|
|
1801
1833
|
s(t.onDragStart({
|
|
1802
|
-
active:
|
|
1834
|
+
active: w
|
|
1803
1835
|
}));
|
|
1804
1836
|
},
|
|
1805
1837
|
onDragMove(c) {
|
|
1806
1838
|
let {
|
|
1807
|
-
active:
|
|
1808
|
-
over:
|
|
1839
|
+
active: w,
|
|
1840
|
+
over: b
|
|
1809
1841
|
} = c;
|
|
1810
1842
|
t.onDragMove && s(t.onDragMove({
|
|
1811
|
-
active:
|
|
1812
|
-
over:
|
|
1843
|
+
active: w,
|
|
1844
|
+
over: b
|
|
1813
1845
|
}));
|
|
1814
1846
|
},
|
|
1815
1847
|
onDragOver(c) {
|
|
1816
1848
|
let {
|
|
1817
|
-
active:
|
|
1818
|
-
over:
|
|
1849
|
+
active: w,
|
|
1850
|
+
over: b
|
|
1819
1851
|
} = c;
|
|
1820
1852
|
s(t.onDragOver({
|
|
1821
|
-
active:
|
|
1822
|
-
over:
|
|
1853
|
+
active: w,
|
|
1854
|
+
over: b
|
|
1823
1855
|
}));
|
|
1824
1856
|
},
|
|
1825
1857
|
onDragEnd(c) {
|
|
1826
1858
|
let {
|
|
1827
|
-
active:
|
|
1828
|
-
over:
|
|
1859
|
+
active: w,
|
|
1860
|
+
over: b
|
|
1829
1861
|
} = c;
|
|
1830
1862
|
s(t.onDragEnd({
|
|
1831
|
-
active:
|
|
1832
|
-
over:
|
|
1863
|
+
active: w,
|
|
1864
|
+
over: b
|
|
1833
1865
|
}));
|
|
1834
1866
|
},
|
|
1835
1867
|
onDragCancel(c) {
|
|
1836
1868
|
let {
|
|
1837
|
-
active:
|
|
1838
|
-
over:
|
|
1869
|
+
active: w,
|
|
1870
|
+
over: b
|
|
1839
1871
|
} = c;
|
|
1840
1872
|
s(t.onDragCancel({
|
|
1841
|
-
active:
|
|
1842
|
-
over:
|
|
1873
|
+
active: w,
|
|
1874
|
+
over: b
|
|
1843
1875
|
}));
|
|
1844
1876
|
}
|
|
1845
1877
|
}), [s, t])), !u)
|
|
1846
1878
|
return null;
|
|
1847
|
-
const
|
|
1879
|
+
const v = ve.createElement(ve.Fragment, null, ve.createElement(no, {
|
|
1848
1880
|
id: r,
|
|
1849
1881
|
value: o.draggable
|
|
1850
|
-
}),
|
|
1882
|
+
}), ve.createElement(ro, {
|
|
1851
1883
|
id: a,
|
|
1852
1884
|
announcement: l
|
|
1853
1885
|
}));
|
|
1854
|
-
return n ? Di(
|
|
1886
|
+
return n ? Di(v, n) : v;
|
|
1855
1887
|
}
|
|
1856
|
-
var
|
|
1888
|
+
var fe;
|
|
1857
1889
|
(function(e) {
|
|
1858
1890
|
e.DragStart = "dragStart", e.DragMove = "dragMove", e.DragEnd = "dragEnd", e.DragCancel = "dragCancel", e.DragOver = "dragOver", e.RegisterDroppable = "registerDroppable", e.SetDroppableDisabled = "setDroppableDisabled", e.UnregisterDroppable = "unregisterDroppable";
|
|
1859
|
-
})(
|
|
1891
|
+
})(fe || (fe = {}));
|
|
1860
1892
|
function _t() {
|
|
1861
1893
|
}
|
|
1862
|
-
function
|
|
1863
|
-
return
|
|
1894
|
+
function zn(e, t) {
|
|
1895
|
+
return V(
|
|
1864
1896
|
() => ({
|
|
1865
1897
|
sensor: e,
|
|
1866
1898
|
options: t ?? {}
|
|
@@ -1872,7 +1904,7 @@ function $n(e, t) {
|
|
|
1872
1904
|
function uo() {
|
|
1873
1905
|
for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++)
|
|
1874
1906
|
t[n] = arguments[n];
|
|
1875
|
-
return
|
|
1907
|
+
return V(
|
|
1876
1908
|
() => [...t].filter((r) => r != null),
|
|
1877
1909
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1878
1910
|
[...t]
|
|
@@ -1915,25 +1947,25 @@ function go(e, t) {
|
|
|
1915
1947
|
const [n] = e;
|
|
1916
1948
|
return n[t];
|
|
1917
1949
|
}
|
|
1918
|
-
function
|
|
1950
|
+
function Bn(e, t, n) {
|
|
1919
1951
|
return t === void 0 && (t = e.left), n === void 0 && (n = e.top), {
|
|
1920
1952
|
x: t + e.width * 0.5,
|
|
1921
1953
|
y: n + e.height * 0.5
|
|
1922
1954
|
};
|
|
1923
1955
|
}
|
|
1924
|
-
const
|
|
1956
|
+
const vo = (e) => {
|
|
1925
1957
|
let {
|
|
1926
1958
|
collisionRect: t,
|
|
1927
1959
|
droppableRects: n,
|
|
1928
1960
|
droppableContainers: r
|
|
1929
1961
|
} = e;
|
|
1930
|
-
const o =
|
|
1962
|
+
const o = Bn(t, t.left, t.top), s = [];
|
|
1931
1963
|
for (const l of r) {
|
|
1932
1964
|
const {
|
|
1933
1965
|
id: a
|
|
1934
1966
|
} = l, u = n.get(a);
|
|
1935
1967
|
if (u) {
|
|
1936
|
-
const p = fo(
|
|
1968
|
+
const p = fo(Bn(u), o);
|
|
1937
1969
|
s.push({
|
|
1938
1970
|
id: a,
|
|
1939
1971
|
data: {
|
|
@@ -1945,10 +1977,10 @@ const bo = (e) => {
|
|
|
1945
1977
|
}
|
|
1946
1978
|
return s.sort(po);
|
|
1947
1979
|
};
|
|
1948
|
-
function
|
|
1980
|
+
function bo(e, t) {
|
|
1949
1981
|
const n = Math.max(t.top, e.top), r = Math.max(t.left, e.left), o = Math.min(t.left + t.width, e.left + e.width), s = Math.min(t.top + t.height, e.top + e.height), l = o - r, a = s - n;
|
|
1950
1982
|
if (r < o && n < s) {
|
|
1951
|
-
const u = t.width * t.height, p = e.width * e.height,
|
|
1983
|
+
const u = t.width * t.height, p = e.width * e.height, v = l * a, c = v / (u + p - v);
|
|
1952
1984
|
return Number(c.toFixed(4));
|
|
1953
1985
|
}
|
|
1954
1986
|
return 0;
|
|
@@ -1965,7 +1997,7 @@ const mo = (e) => {
|
|
|
1965
1997
|
id: l
|
|
1966
1998
|
} = s, a = n.get(l);
|
|
1967
1999
|
if (a) {
|
|
1968
|
-
const u =
|
|
2000
|
+
const u = bo(a, t);
|
|
1969
2001
|
u > 0 && o.push({
|
|
1970
2002
|
id: l,
|
|
1971
2003
|
data: {
|
|
@@ -1984,7 +2016,7 @@ function xo(e, t, n) {
|
|
|
1984
2016
|
scaleY: t && n ? t.height / n.height : 1
|
|
1985
2017
|
};
|
|
1986
2018
|
}
|
|
1987
|
-
function
|
|
2019
|
+
function mr(e, t) {
|
|
1988
2020
|
return e && t ? {
|
|
1989
2021
|
x: e.left - t.left,
|
|
1990
2022
|
y: e.top - t.top
|
|
@@ -2035,12 +2067,12 @@ function Co(e, t, n) {
|
|
|
2035
2067
|
scaleY: s,
|
|
2036
2068
|
x: l,
|
|
2037
2069
|
y: a
|
|
2038
|
-
} = r, u = e.left - l - (1 - o) * parseFloat(n), p = e.top - a - (1 - s) * parseFloat(n.slice(n.indexOf(" ") + 1)),
|
|
2070
|
+
} = r, u = e.left - l - (1 - o) * parseFloat(n), p = e.top - a - (1 - s) * parseFloat(n.slice(n.indexOf(" ") + 1)), v = o ? e.width / o : e.width, c = s ? e.height / s : e.height;
|
|
2039
2071
|
return {
|
|
2040
|
-
width:
|
|
2072
|
+
width: v,
|
|
2041
2073
|
height: c,
|
|
2042
2074
|
top: p,
|
|
2043
|
-
right: u +
|
|
2075
|
+
right: u + v,
|
|
2044
2076
|
bottom: p + c,
|
|
2045
2077
|
left: u
|
|
2046
2078
|
};
|
|
@@ -2054,9 +2086,9 @@ function rt(e, t) {
|
|
|
2054
2086
|
if (t.ignoreTransform) {
|
|
2055
2087
|
const {
|
|
2056
2088
|
transform: p,
|
|
2057
|
-
transformOrigin:
|
|
2058
|
-
} =
|
|
2059
|
-
p && (n = Co(n, p,
|
|
2089
|
+
transformOrigin: v
|
|
2090
|
+
} = Se(e).getComputedStyle(e);
|
|
2091
|
+
p && (n = Co(n, p, v));
|
|
2060
2092
|
}
|
|
2061
2093
|
const {
|
|
2062
2094
|
top: r,
|
|
@@ -2075,7 +2107,7 @@ function rt(e, t) {
|
|
|
2075
2107
|
right: u
|
|
2076
2108
|
};
|
|
2077
2109
|
}
|
|
2078
|
-
function
|
|
2110
|
+
function Un(e) {
|
|
2079
2111
|
return rt(e, {
|
|
2080
2112
|
ignoreTransform: !0
|
|
2081
2113
|
});
|
|
@@ -2092,61 +2124,61 @@ function No(e) {
|
|
|
2092
2124
|
};
|
|
2093
2125
|
}
|
|
2094
2126
|
function Do(e, t) {
|
|
2095
|
-
return t === void 0 && (t =
|
|
2127
|
+
return t === void 0 && (t = Se(e).getComputedStyle(e)), t.position === "fixed";
|
|
2096
2128
|
}
|
|
2097
2129
|
function Ro(e, t) {
|
|
2098
|
-
t === void 0 && (t =
|
|
2130
|
+
t === void 0 && (t = Se(e).getComputedStyle(e));
|
|
2099
2131
|
const n = /(auto|scroll|overlay)/;
|
|
2100
2132
|
return ["overflow", "overflowX", "overflowY"].some((o) => {
|
|
2101
2133
|
const s = t[o];
|
|
2102
2134
|
return typeof s == "string" ? n.test(s) : !1;
|
|
2103
2135
|
});
|
|
2104
2136
|
}
|
|
2105
|
-
function
|
|
2137
|
+
function bn(e, t) {
|
|
2106
2138
|
const n = [];
|
|
2107
2139
|
function r(o) {
|
|
2108
2140
|
if (t != null && n.length >= t || !o)
|
|
2109
2141
|
return n;
|
|
2110
2142
|
if (hn(o) && o.scrollingElement != null && !n.includes(o.scrollingElement))
|
|
2111
2143
|
return n.push(o.scrollingElement), n;
|
|
2112
|
-
if (!yt(o) ||
|
|
2144
|
+
if (!yt(o) || gr(o) || n.includes(o))
|
|
2113
2145
|
return n;
|
|
2114
|
-
const s =
|
|
2146
|
+
const s = Se(e).getComputedStyle(o);
|
|
2115
2147
|
return o !== e && Ro(o, s) && n.push(o), Do(o, s) ? n : r(o.parentNode);
|
|
2116
2148
|
}
|
|
2117
2149
|
return e ? r(e) : n;
|
|
2118
2150
|
}
|
|
2119
|
-
function
|
|
2120
|
-
const [t] =
|
|
2151
|
+
function xr(e) {
|
|
2152
|
+
const [t] = bn(e, 1);
|
|
2121
2153
|
return t ?? null;
|
|
2122
2154
|
}
|
|
2123
2155
|
function en(e) {
|
|
2124
2156
|
return !zt || !e ? null : tt(e) ? e : pn(e) ? hn(e) || e === nt(e).scrollingElement ? window : yt(e) ? e : null : null;
|
|
2125
2157
|
}
|
|
2126
|
-
function
|
|
2158
|
+
function wr(e) {
|
|
2127
2159
|
return tt(e) ? e.scrollX : e.scrollLeft;
|
|
2128
2160
|
}
|
|
2129
|
-
function
|
|
2161
|
+
function yr(e) {
|
|
2130
2162
|
return tt(e) ? e.scrollY : e.scrollTop;
|
|
2131
2163
|
}
|
|
2132
2164
|
function ln(e) {
|
|
2133
2165
|
return {
|
|
2134
|
-
x:
|
|
2135
|
-
y:
|
|
2166
|
+
x: wr(e),
|
|
2167
|
+
y: yr(e)
|
|
2136
2168
|
};
|
|
2137
2169
|
}
|
|
2138
|
-
var
|
|
2170
|
+
var ge;
|
|
2139
2171
|
(function(e) {
|
|
2140
2172
|
e[e.Forward = 1] = "Forward", e[e.Backward = -1] = "Backward";
|
|
2141
|
-
})(
|
|
2142
|
-
function
|
|
2173
|
+
})(ge || (ge = {}));
|
|
2174
|
+
function jr(e) {
|
|
2143
2175
|
return !zt || !e ? !1 : e === document.scrollingElement;
|
|
2144
2176
|
}
|
|
2145
|
-
function
|
|
2177
|
+
function Cr(e) {
|
|
2146
2178
|
const t = {
|
|
2147
2179
|
x: 0,
|
|
2148
2180
|
y: 0
|
|
2149
|
-
}, n =
|
|
2181
|
+
}, n = jr(e) ? {
|
|
2150
2182
|
height: window.innerHeight,
|
|
2151
2183
|
width: window.innerWidth
|
|
2152
2184
|
} : {
|
|
@@ -2179,10 +2211,10 @@ function Ao(e, t, n, r, o) {
|
|
|
2179
2211
|
r === void 0 && (r = 10), o === void 0 && (o = Eo);
|
|
2180
2212
|
const {
|
|
2181
2213
|
isTop: p,
|
|
2182
|
-
isBottom:
|
|
2214
|
+
isBottom: v,
|
|
2183
2215
|
isLeft: c,
|
|
2184
|
-
isRight:
|
|
2185
|
-
} =
|
|
2216
|
+
isRight: w
|
|
2217
|
+
} = Cr(e), b = {
|
|
2186
2218
|
x: 0,
|
|
2187
2219
|
y: 0
|
|
2188
2220
|
}, S = {
|
|
@@ -2192,8 +2224,8 @@ function Ao(e, t, n, r, o) {
|
|
|
2192
2224
|
height: t.height * o.y,
|
|
2193
2225
|
width: t.width * o.x
|
|
2194
2226
|
};
|
|
2195
|
-
return !p && s <= t.top + f.height ? (
|
|
2196
|
-
direction:
|
|
2227
|
+
return !p && s <= t.top + f.height ? (b.y = ge.Backward, S.y = r * Math.abs((t.top + f.height - s) / f.height)) : !v && u >= t.bottom - f.height && (b.y = ge.Forward, S.y = r * Math.abs((t.bottom - f.height - u) / f.height)), !w && a >= t.right - f.width ? (b.x = ge.Forward, S.x = r * Math.abs((t.right - f.width - a) / f.width)) : !c && l <= t.left + f.width && (b.x = ge.Backward, S.x = r * Math.abs((t.left + f.width - l) / f.width)), {
|
|
2228
|
+
direction: b,
|
|
2197
2229
|
speed: S
|
|
2198
2230
|
};
|
|
2199
2231
|
}
|
|
@@ -2227,14 +2259,14 @@ function To(e) {
|
|
|
2227
2259
|
height: e.clientHeight
|
|
2228
2260
|
};
|
|
2229
2261
|
}
|
|
2230
|
-
function
|
|
2262
|
+
function Sr(e) {
|
|
2231
2263
|
return e.reduce((t, n) => Ze(t, ln(n)), Oe);
|
|
2232
2264
|
}
|
|
2233
2265
|
function Fo(e) {
|
|
2234
|
-
return e.reduce((t, n) => t +
|
|
2266
|
+
return e.reduce((t, n) => t + wr(n), 0);
|
|
2235
2267
|
}
|
|
2236
2268
|
function Oo(e) {
|
|
2237
|
-
return e.reduce((t, n) => t +
|
|
2269
|
+
return e.reduce((t, n) => t + yr(n), 0);
|
|
2238
2270
|
}
|
|
2239
2271
|
function Io(e, t) {
|
|
2240
2272
|
if (t === void 0 && (t = rt), !e)
|
|
@@ -2245,7 +2277,7 @@ function Io(e, t) {
|
|
|
2245
2277
|
bottom: o,
|
|
2246
2278
|
right: s
|
|
2247
2279
|
} = t(e);
|
|
2248
|
-
|
|
2280
|
+
xr(e) && (o <= 0 || s <= 0 || n >= window.innerHeight || r >= window.innerWidth) && e.scrollIntoView({
|
|
2249
2281
|
block: "center",
|
|
2250
2282
|
inline: "center"
|
|
2251
2283
|
});
|
|
@@ -2254,7 +2286,7 @@ const ko = [["x", ["left", "right"], Fo], ["y", ["top", "bottom"], Oo]];
|
|
|
2254
2286
|
class mn {
|
|
2255
2287
|
constructor(t, n) {
|
|
2256
2288
|
this.rect = void 0, this.width = void 0, this.height = void 0, this.top = void 0, this.bottom = void 0, this.right = void 0, this.left = void 0;
|
|
2257
|
-
const r =
|
|
2289
|
+
const r = bn(n), o = Sr(r);
|
|
2258
2290
|
this.rect = {
|
|
2259
2291
|
...t
|
|
2260
2292
|
}, this.width = t.width, this.height = t.height;
|
|
@@ -2262,8 +2294,8 @@ class mn {
|
|
|
2262
2294
|
for (const u of l)
|
|
2263
2295
|
Object.defineProperty(this, u, {
|
|
2264
2296
|
get: () => {
|
|
2265
|
-
const p = a(r),
|
|
2266
|
-
return this.rect[u] +
|
|
2297
|
+
const p = a(r), v = o[s] - p;
|
|
2298
|
+
return this.rect[u] + v;
|
|
2267
2299
|
},
|
|
2268
2300
|
enumerable: !0
|
|
2269
2301
|
});
|
|
@@ -2289,7 +2321,7 @@ class ht {
|
|
|
2289
2321
|
function Vo(e) {
|
|
2290
2322
|
const {
|
|
2291
2323
|
EventTarget: t
|
|
2292
|
-
} =
|
|
2324
|
+
} = Se(e);
|
|
2293
2325
|
return e instanceof t ? e : nt(e);
|
|
2294
2326
|
}
|
|
2295
2327
|
function tn(e, t) {
|
|
@@ -2300,41 +2332,41 @@ var Fe;
|
|
|
2300
2332
|
(function(e) {
|
|
2301
2333
|
e.Click = "click", e.DragStart = "dragstart", e.Keydown = "keydown", e.ContextMenu = "contextmenu", e.Resize = "resize", e.SelectionChange = "selectionchange", e.VisibilityChange = "visibilitychange";
|
|
2302
2334
|
})(Fe || (Fe = {}));
|
|
2303
|
-
function
|
|
2335
|
+
function Yn(e) {
|
|
2304
2336
|
e.preventDefault();
|
|
2305
2337
|
}
|
|
2306
2338
|
function Mo(e) {
|
|
2307
2339
|
e.stopPropagation();
|
|
2308
2340
|
}
|
|
2309
|
-
var
|
|
2341
|
+
var z;
|
|
2310
2342
|
(function(e) {
|
|
2311
2343
|
e.Space = "Space", e.Down = "ArrowDown", e.Right = "ArrowRight", e.Left = "ArrowLeft", e.Up = "ArrowUp", e.Esc = "Escape", e.Enter = "Enter", e.Tab = "Tab";
|
|
2312
|
-
})(
|
|
2313
|
-
const
|
|
2314
|
-
start: [
|
|
2315
|
-
cancel: [
|
|
2316
|
-
end: [
|
|
2344
|
+
})(z || (z = {}));
|
|
2345
|
+
const Nr = {
|
|
2346
|
+
start: [z.Space, z.Enter],
|
|
2347
|
+
cancel: [z.Esc],
|
|
2348
|
+
end: [z.Space, z.Enter, z.Tab]
|
|
2317
2349
|
}, Po = (e, t) => {
|
|
2318
2350
|
let {
|
|
2319
2351
|
currentCoordinates: n
|
|
2320
2352
|
} = t;
|
|
2321
2353
|
switch (e.code) {
|
|
2322
|
-
case
|
|
2354
|
+
case z.Right:
|
|
2323
2355
|
return {
|
|
2324
2356
|
...n,
|
|
2325
2357
|
x: n.x + 25
|
|
2326
2358
|
};
|
|
2327
|
-
case
|
|
2359
|
+
case z.Left:
|
|
2328
2360
|
return {
|
|
2329
2361
|
...n,
|
|
2330
2362
|
x: n.x - 25
|
|
2331
2363
|
};
|
|
2332
|
-
case
|
|
2364
|
+
case z.Down:
|
|
2333
2365
|
return {
|
|
2334
2366
|
...n,
|
|
2335
2367
|
y: n.y + 25
|
|
2336
2368
|
};
|
|
2337
|
-
case
|
|
2369
|
+
case z.Up:
|
|
2338
2370
|
return {
|
|
2339
2371
|
...n,
|
|
2340
2372
|
y: n.y - 25
|
|
@@ -2349,7 +2381,7 @@ class xn {
|
|
|
2349
2381
|
target: n
|
|
2350
2382
|
}
|
|
2351
2383
|
} = t;
|
|
2352
|
-
this.props = t, this.listeners = new ht(nt(n)), this.windowListeners = new ht(
|
|
2384
|
+
this.props = t, this.listeners = new ht(nt(n)), this.windowListeners = new ht(Se(n)), this.handleKeyDown = this.handleKeyDown.bind(this), this.handleCancel = this.handleCancel.bind(this), this.attach();
|
|
2353
2385
|
}
|
|
2354
2386
|
attach() {
|
|
2355
2387
|
this.handleStart(), this.windowListeners.add(Fe.Resize, this.handleCancel), this.windowListeners.add(Fe.VisibilityChange, this.handleCancel), setTimeout(() => this.listeners.add(Fe.Keydown, this.handleKeyDown));
|
|
@@ -2362,13 +2394,13 @@ class xn {
|
|
|
2362
2394
|
r && Io(r), n(Oe);
|
|
2363
2395
|
}
|
|
2364
2396
|
handleKeyDown(t) {
|
|
2365
|
-
if (
|
|
2397
|
+
if (vn(t)) {
|
|
2366
2398
|
const {
|
|
2367
2399
|
active: n,
|
|
2368
2400
|
context: r,
|
|
2369
2401
|
options: o
|
|
2370
2402
|
} = this.props, {
|
|
2371
|
-
keyboardCodes: s =
|
|
2403
|
+
keyboardCodes: s = Nr,
|
|
2372
2404
|
coordinateGetter: l = Po,
|
|
2373
2405
|
scrollBehavior: a = "smooth"
|
|
2374
2406
|
} = o, {
|
|
@@ -2384,18 +2416,18 @@ class xn {
|
|
|
2384
2416
|
}
|
|
2385
2417
|
const {
|
|
2386
2418
|
collisionRect: p
|
|
2387
|
-
} = r.current,
|
|
2419
|
+
} = r.current, v = p ? {
|
|
2388
2420
|
x: p.left,
|
|
2389
2421
|
y: p.top
|
|
2390
2422
|
} : Oe;
|
|
2391
|
-
this.referenceCoordinates || (this.referenceCoordinates =
|
|
2423
|
+
this.referenceCoordinates || (this.referenceCoordinates = v);
|
|
2392
2424
|
const c = l(t, {
|
|
2393
2425
|
active: n,
|
|
2394
2426
|
context: r.current,
|
|
2395
|
-
currentCoordinates:
|
|
2427
|
+
currentCoordinates: v
|
|
2396
2428
|
});
|
|
2397
2429
|
if (c) {
|
|
2398
|
-
const
|
|
2430
|
+
const w = Lt(c, v), b = {
|
|
2399
2431
|
x: 0,
|
|
2400
2432
|
y: 0
|
|
2401
2433
|
}, {
|
|
@@ -2404,46 +2436,46 @@ class xn {
|
|
|
2404
2436
|
for (const f of S) {
|
|
2405
2437
|
const j = t.code, {
|
|
2406
2438
|
isTop: N,
|
|
2407
|
-
isRight:
|
|
2439
|
+
isRight: m,
|
|
2408
2440
|
isLeft: C,
|
|
2409
|
-
isBottom:
|
|
2410
|
-
maxScroll:
|
|
2411
|
-
minScroll:
|
|
2412
|
-
} =
|
|
2413
|
-
x: Math.min(j ===
|
|
2414
|
-
y: Math.min(j ===
|
|
2415
|
-
}, I = j ===
|
|
2416
|
-
if (I &&
|
|
2417
|
-
const
|
|
2418
|
-
if (
|
|
2441
|
+
isBottom: A,
|
|
2442
|
+
maxScroll: F,
|
|
2443
|
+
minScroll: k
|
|
2444
|
+
} = Cr(f), x = To(f), R = {
|
|
2445
|
+
x: Math.min(j === z.Right ? x.right - x.width / 2 : x.right, Math.max(j === z.Right ? x.left : x.left + x.width / 2, c.x)),
|
|
2446
|
+
y: Math.min(j === z.Down ? x.bottom - x.height / 2 : x.bottom, Math.max(j === z.Down ? x.top : x.top + x.height / 2, c.y))
|
|
2447
|
+
}, I = j === z.Right && !m || j === z.Left && !C, M = j === z.Down && !A || j === z.Up && !N;
|
|
2448
|
+
if (I && R.x !== c.x) {
|
|
2449
|
+
const _ = f.scrollLeft + w.x, B = j === z.Right && _ <= F.x || j === z.Left && _ >= k.x;
|
|
2450
|
+
if (B && !w.y) {
|
|
2419
2451
|
f.scrollTo({
|
|
2420
|
-
left:
|
|
2452
|
+
left: _,
|
|
2421
2453
|
behavior: a
|
|
2422
2454
|
});
|
|
2423
2455
|
return;
|
|
2424
2456
|
}
|
|
2425
|
-
|
|
2426
|
-
left: -
|
|
2457
|
+
B ? b.x = f.scrollLeft - _ : b.x = j === z.Right ? f.scrollLeft - F.x : f.scrollLeft - k.x, b.x && f.scrollBy({
|
|
2458
|
+
left: -b.x,
|
|
2427
2459
|
behavior: a
|
|
2428
2460
|
});
|
|
2429
2461
|
break;
|
|
2430
|
-
} else if (M &&
|
|
2431
|
-
const
|
|
2432
|
-
if (
|
|
2462
|
+
} else if (M && R.y !== c.y) {
|
|
2463
|
+
const _ = f.scrollTop + w.y, B = j === z.Down && _ <= F.y || j === z.Up && _ >= k.y;
|
|
2464
|
+
if (B && !w.x) {
|
|
2433
2465
|
f.scrollTo({
|
|
2434
|
-
top:
|
|
2466
|
+
top: _,
|
|
2435
2467
|
behavior: a
|
|
2436
2468
|
});
|
|
2437
2469
|
return;
|
|
2438
2470
|
}
|
|
2439
|
-
|
|
2440
|
-
top: -
|
|
2471
|
+
B ? b.y = f.scrollTop - _ : b.y = j === z.Down ? f.scrollTop - F.y : f.scrollTop - k.y, b.y && f.scrollBy({
|
|
2472
|
+
top: -b.y,
|
|
2441
2473
|
behavior: a
|
|
2442
2474
|
});
|
|
2443
2475
|
break;
|
|
2444
2476
|
}
|
|
2445
2477
|
}
|
|
2446
|
-
this.handleMove(t, Ze(Lt(c, this.referenceCoordinates),
|
|
2478
|
+
this.handleMove(t, Ze(Lt(c, this.referenceCoordinates), b));
|
|
2447
2479
|
}
|
|
2448
2480
|
}
|
|
2449
2481
|
}
|
|
@@ -2473,7 +2505,7 @@ xn.activators = [{
|
|
|
2473
2505
|
eventName: "onKeyDown",
|
|
2474
2506
|
handler: (e, t, n) => {
|
|
2475
2507
|
let {
|
|
2476
|
-
keyboardCodes: r =
|
|
2508
|
+
keyboardCodes: r = Nr,
|
|
2477
2509
|
onActivation: o
|
|
2478
2510
|
} = t, {
|
|
2479
2511
|
active: s
|
|
@@ -2490,10 +2522,10 @@ xn.activators = [{
|
|
|
2490
2522
|
return !1;
|
|
2491
2523
|
}
|
|
2492
2524
|
}];
|
|
2493
|
-
function
|
|
2525
|
+
function Wn(e) {
|
|
2494
2526
|
return !!(e && "distance" in e);
|
|
2495
2527
|
}
|
|
2496
|
-
function
|
|
2528
|
+
function Gn(e) {
|
|
2497
2529
|
return !!(e && "delay" in e);
|
|
2498
2530
|
}
|
|
2499
2531
|
class wn {
|
|
@@ -2505,7 +2537,7 @@ class wn {
|
|
|
2505
2537
|
} = t, {
|
|
2506
2538
|
target: l
|
|
2507
2539
|
} = s;
|
|
2508
|
-
this.props = t, this.events = n, this.document = nt(l), this.documentListeners = new ht(this.document), this.listeners = new ht(r), this.windowListeners = new ht(
|
|
2540
|
+
this.props = t, this.events = n, this.document = nt(l), this.documentListeners = new ht(this.document), this.listeners = new ht(r), this.windowListeners = new ht(Se(l)), this.initialCoordinates = (o = an(s)) != null ? o : Oe, this.handleStart = this.handleStart.bind(this), this.handleMove = this.handleMove.bind(this), this.handleEnd = this.handleEnd.bind(this), this.handleCancel = this.handleCancel.bind(this), this.handleKeydown = this.handleKeydown.bind(this), this.removeTextSelection = this.removeTextSelection.bind(this), this.attach();
|
|
2509
2541
|
}
|
|
2510
2542
|
attach() {
|
|
2511
2543
|
const {
|
|
@@ -2519,18 +2551,18 @@ class wn {
|
|
|
2519
2551
|
} = this;
|
|
2520
2552
|
if (this.listeners.add(t.move.name, this.handleMove, {
|
|
2521
2553
|
passive: !1
|
|
2522
|
-
}), this.listeners.add(t.end.name, this.handleEnd), t.cancel && this.listeners.add(t.cancel.name, this.handleCancel), this.windowListeners.add(Fe.Resize, this.handleCancel), this.windowListeners.add(Fe.DragStart,
|
|
2554
|
+
}), this.listeners.add(t.end.name, this.handleEnd), t.cancel && this.listeners.add(t.cancel.name, this.handleCancel), this.windowListeners.add(Fe.Resize, this.handleCancel), this.windowListeners.add(Fe.DragStart, Yn), this.windowListeners.add(Fe.VisibilityChange, this.handleCancel), this.windowListeners.add(Fe.ContextMenu, Yn), this.documentListeners.add(Fe.Keydown, this.handleKeydown), n) {
|
|
2523
2555
|
if (r != null && r({
|
|
2524
2556
|
event: this.props.event,
|
|
2525
2557
|
activeNode: this.props.activeNode,
|
|
2526
2558
|
options: this.props.options
|
|
2527
2559
|
}))
|
|
2528
2560
|
return this.handleStart();
|
|
2529
|
-
if (
|
|
2561
|
+
if (Gn(n)) {
|
|
2530
2562
|
this.timeoutId = setTimeout(this.handleStart, n.delay), this.handlePending(n);
|
|
2531
2563
|
return;
|
|
2532
2564
|
}
|
|
2533
|
-
if (
|
|
2565
|
+
if (Wn(n)) {
|
|
2534
2566
|
this.handlePending(n);
|
|
2535
2567
|
return;
|
|
2536
2568
|
}
|
|
@@ -2573,13 +2605,13 @@ class wn {
|
|
|
2573
2605
|
return;
|
|
2574
2606
|
const u = (n = an(t)) != null ? n : Oe, p = Lt(o, u);
|
|
2575
2607
|
if (!r && a) {
|
|
2576
|
-
if (
|
|
2608
|
+
if (Wn(a)) {
|
|
2577
2609
|
if (a.tolerance != null && tn(p, a.tolerance))
|
|
2578
2610
|
return this.handleCancel();
|
|
2579
2611
|
if (tn(p, a.distance))
|
|
2580
2612
|
return this.handleStart();
|
|
2581
2613
|
}
|
|
2582
|
-
if (
|
|
2614
|
+
if (Gn(a) && tn(p, a.tolerance))
|
|
2583
2615
|
return this.handleCancel();
|
|
2584
2616
|
this.handlePending(a, p);
|
|
2585
2617
|
return;
|
|
@@ -2601,7 +2633,7 @@ class wn {
|
|
|
2601
2633
|
this.detach(), this.activated || t(this.props.active), n();
|
|
2602
2634
|
}
|
|
2603
2635
|
handleKeydown(t) {
|
|
2604
|
-
t.code ===
|
|
2636
|
+
t.code === z.Esc && this.handleCancel();
|
|
2605
2637
|
}
|
|
2606
2638
|
removeTextSelection() {
|
|
2607
2639
|
var t;
|
|
@@ -2731,11 +2763,11 @@ function Bo(e) {
|
|
|
2731
2763
|
order: a = $t.TreeOrder,
|
|
2732
2764
|
pointerCoordinates: u,
|
|
2733
2765
|
scrollableAncestors: p,
|
|
2734
|
-
scrollableAncestorRects:
|
|
2766
|
+
scrollableAncestorRects: v,
|
|
2735
2767
|
delta: c,
|
|
2736
|
-
threshold:
|
|
2768
|
+
threshold: w
|
|
2737
2769
|
} = e;
|
|
2738
|
-
const
|
|
2770
|
+
const b = Yo({
|
|
2739
2771
|
delta: c,
|
|
2740
2772
|
disabled: !s
|
|
2741
2773
|
}), [S, f] = Ji(), j = q({
|
|
@@ -2744,7 +2776,7 @@ function Bo(e) {
|
|
|
2744
2776
|
}), N = q({
|
|
2745
2777
|
x: 0,
|
|
2746
2778
|
y: 0
|
|
2747
|
-
}),
|
|
2779
|
+
}), m = V(() => {
|
|
2748
2780
|
switch (n) {
|
|
2749
2781
|
case gt.Pointer:
|
|
2750
2782
|
return u ? {
|
|
@@ -2756,33 +2788,33 @@ function Bo(e) {
|
|
|
2756
2788
|
case gt.DraggableRect:
|
|
2757
2789
|
return o;
|
|
2758
2790
|
}
|
|
2759
|
-
}, [n, o, u]), C = q(null),
|
|
2760
|
-
const
|
|
2761
|
-
if (!
|
|
2791
|
+
}, [n, o, u]), C = q(null), A = L(() => {
|
|
2792
|
+
const k = C.current;
|
|
2793
|
+
if (!k)
|
|
2762
2794
|
return;
|
|
2763
|
-
const x = j.current.x * N.current.x,
|
|
2764
|
-
|
|
2765
|
-
}, []),
|
|
2766
|
-
|
|
2795
|
+
const x = j.current.x * N.current.x, R = j.current.y * N.current.y;
|
|
2796
|
+
k.scrollBy(x, R);
|
|
2797
|
+
}, []), F = V(() => a === $t.TreeOrder ? [...p].reverse() : p, [a, p]);
|
|
2798
|
+
W(
|
|
2767
2799
|
() => {
|
|
2768
|
-
if (!s || !p.length || !
|
|
2800
|
+
if (!s || !p.length || !m) {
|
|
2769
2801
|
f();
|
|
2770
2802
|
return;
|
|
2771
2803
|
}
|
|
2772
|
-
for (const
|
|
2773
|
-
if (r?.(
|
|
2804
|
+
for (const k of F) {
|
|
2805
|
+
if (r?.(k) === !1)
|
|
2774
2806
|
continue;
|
|
2775
|
-
const x = p.indexOf(
|
|
2776
|
-
if (!
|
|
2807
|
+
const x = p.indexOf(k), R = v[x];
|
|
2808
|
+
if (!R)
|
|
2777
2809
|
continue;
|
|
2778
2810
|
const {
|
|
2779
2811
|
direction: I,
|
|
2780
2812
|
speed: M
|
|
2781
|
-
} = Ao(
|
|
2782
|
-
for (const
|
|
2783
|
-
|
|
2813
|
+
} = Ao(k, R, m, t, w);
|
|
2814
|
+
for (const _ of ["x", "y"])
|
|
2815
|
+
b[_][I[_]] || (M[_] = 0, I[_] = 0);
|
|
2784
2816
|
if (M.x > 0 || M.y > 0) {
|
|
2785
|
-
f(), C.current =
|
|
2817
|
+
f(), C.current = k, S(A, l), j.current = M, N.current = I;
|
|
2786
2818
|
return;
|
|
2787
2819
|
}
|
|
2788
2820
|
}
|
|
@@ -2797,32 +2829,32 @@ function Bo(e) {
|
|
|
2797
2829
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
2798
2830
|
[
|
|
2799
2831
|
t,
|
|
2800
|
-
|
|
2832
|
+
A,
|
|
2801
2833
|
r,
|
|
2802
2834
|
f,
|
|
2803
2835
|
s,
|
|
2804
2836
|
l,
|
|
2805
2837
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
2806
|
-
JSON.stringify(
|
|
2838
|
+
JSON.stringify(m),
|
|
2807
2839
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
2808
|
-
JSON.stringify(
|
|
2840
|
+
JSON.stringify(b),
|
|
2809
2841
|
S,
|
|
2810
2842
|
p,
|
|
2811
|
-
|
|
2812
|
-
|
|
2843
|
+
F,
|
|
2844
|
+
v,
|
|
2813
2845
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
2814
|
-
JSON.stringify(
|
|
2846
|
+
JSON.stringify(w)
|
|
2815
2847
|
]
|
|
2816
2848
|
);
|
|
2817
2849
|
}
|
|
2818
2850
|
const Uo = {
|
|
2819
2851
|
x: {
|
|
2820
|
-
[
|
|
2821
|
-
[
|
|
2852
|
+
[ge.Backward]: !1,
|
|
2853
|
+
[ge.Forward]: !1
|
|
2822
2854
|
},
|
|
2823
2855
|
y: {
|
|
2824
|
-
[
|
|
2825
|
-
[
|
|
2856
|
+
[ge.Backward]: !1,
|
|
2857
|
+
[ge.Forward]: !1
|
|
2826
2858
|
}
|
|
2827
2859
|
};
|
|
2828
2860
|
function Yo(e) {
|
|
@@ -2840,12 +2872,12 @@ function Yo(e) {
|
|
|
2840
2872
|
};
|
|
2841
2873
|
return {
|
|
2842
2874
|
x: {
|
|
2843
|
-
[
|
|
2844
|
-
[
|
|
2875
|
+
[ge.Backward]: o.x[ge.Backward] || s.x === -1,
|
|
2876
|
+
[ge.Forward]: o.x[ge.Forward] || s.x === 1
|
|
2845
2877
|
},
|
|
2846
2878
|
y: {
|
|
2847
|
-
[
|
|
2848
|
-
[
|
|
2879
|
+
[ge.Backward]: o.y[ge.Backward] || s.y === -1,
|
|
2880
|
+
[ge.Forward]: o.y[ge.Forward] || s.y === 1
|
|
2849
2881
|
}
|
|
2850
2882
|
};
|
|
2851
2883
|
}, [n, t, r]);
|
|
@@ -2858,7 +2890,7 @@ function Wo(e, t) {
|
|
|
2858
2890
|
}, [r, t]);
|
|
2859
2891
|
}
|
|
2860
2892
|
function Go(e, t) {
|
|
2861
|
-
return
|
|
2893
|
+
return V(() => e.reduce((n, r) => {
|
|
2862
2894
|
const {
|
|
2863
2895
|
sensor: o
|
|
2864
2896
|
} = r, s = o.activators.map((l) => ({
|
|
@@ -2876,7 +2908,7 @@ var dn;
|
|
|
2876
2908
|
(function(e) {
|
|
2877
2909
|
e.Optimized = "optimized";
|
|
2878
2910
|
})(dn || (dn = {}));
|
|
2879
|
-
const
|
|
2911
|
+
const Hn = /* @__PURE__ */ new Map();
|
|
2880
2912
|
function Ho(e, t) {
|
|
2881
2913
|
let {
|
|
2882
2914
|
dragging: n,
|
|
@@ -2887,52 +2919,52 @@ function Ho(e, t) {
|
|
|
2887
2919
|
frequency: a,
|
|
2888
2920
|
measure: u,
|
|
2889
2921
|
strategy: p
|
|
2890
|
-
} = o,
|
|
2891
|
-
N === void 0 && (N = []), !
|
|
2892
|
-
}, [
|
|
2922
|
+
} = o, v = q(e), c = j(), w = bt(c), b = L(function(N) {
|
|
2923
|
+
N === void 0 && (N = []), !w.current && l((m) => m === null ? N : m.concat(N.filter((C) => !m.includes(C))));
|
|
2924
|
+
}, [w]), S = q(null), f = jt((N) => {
|
|
2893
2925
|
if (c && !n)
|
|
2894
|
-
return
|
|
2895
|
-
if (!N || N ===
|
|
2896
|
-
const
|
|
2926
|
+
return Hn;
|
|
2927
|
+
if (!N || N === Hn || v.current !== e || s != null) {
|
|
2928
|
+
const m = /* @__PURE__ */ new Map();
|
|
2897
2929
|
for (let C of e) {
|
|
2898
2930
|
if (!C)
|
|
2899
2931
|
continue;
|
|
2900
2932
|
if (s && s.length > 0 && !s.includes(C.id) && C.rect.current) {
|
|
2901
|
-
|
|
2933
|
+
m.set(C.id, C.rect.current);
|
|
2902
2934
|
continue;
|
|
2903
2935
|
}
|
|
2904
|
-
const
|
|
2905
|
-
C.rect.current =
|
|
2936
|
+
const A = C.node.current, F = A ? new mn(u(A), A) : null;
|
|
2937
|
+
C.rect.current = F, F && m.set(C.id, F);
|
|
2906
2938
|
}
|
|
2907
|
-
return
|
|
2939
|
+
return m;
|
|
2908
2940
|
}
|
|
2909
2941
|
return N;
|
|
2910
2942
|
}, [e, s, n, c, u]);
|
|
2911
|
-
return
|
|
2912
|
-
|
|
2913
|
-
}, [e]),
|
|
2943
|
+
return W(() => {
|
|
2944
|
+
v.current = e;
|
|
2945
|
+
}, [e]), W(
|
|
2914
2946
|
() => {
|
|
2915
|
-
c ||
|
|
2947
|
+
c || b();
|
|
2916
2948
|
},
|
|
2917
2949
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
2918
2950
|
[n, c]
|
|
2919
|
-
),
|
|
2951
|
+
), W(
|
|
2920
2952
|
() => {
|
|
2921
2953
|
s && s.length > 0 && l(null);
|
|
2922
2954
|
},
|
|
2923
2955
|
//eslint-disable-next-line react-hooks/exhaustive-deps
|
|
2924
2956
|
[JSON.stringify(s)]
|
|
2925
|
-
),
|
|
2957
|
+
), W(
|
|
2926
2958
|
() => {
|
|
2927
2959
|
c || typeof a != "number" || S.current !== null || (S.current = setTimeout(() => {
|
|
2928
|
-
|
|
2960
|
+
b(), S.current = null;
|
|
2929
2961
|
}, a));
|
|
2930
2962
|
},
|
|
2931
2963
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
2932
|
-
[a, c,
|
|
2964
|
+
[a, c, b, ...r]
|
|
2933
2965
|
), {
|
|
2934
2966
|
droppableRects: f,
|
|
2935
|
-
measureDroppableContainers:
|
|
2967
|
+
measureDroppableContainers: b,
|
|
2936
2968
|
measuringScheduled: s != null
|
|
2937
2969
|
};
|
|
2938
2970
|
function j() {
|
|
@@ -2946,18 +2978,18 @@ function Ho(e, t) {
|
|
|
2946
2978
|
}
|
|
2947
2979
|
}
|
|
2948
2980
|
}
|
|
2949
|
-
function
|
|
2981
|
+
function Dr(e, t) {
|
|
2950
2982
|
return jt((n) => e ? n || (typeof t == "function" ? t(e) : e) : null, [t, e]);
|
|
2951
2983
|
}
|
|
2952
2984
|
function Xo(e, t) {
|
|
2953
|
-
return
|
|
2985
|
+
return Dr(e, t);
|
|
2954
2986
|
}
|
|
2955
2987
|
function qo(e) {
|
|
2956
2988
|
let {
|
|
2957
2989
|
callback: t,
|
|
2958
2990
|
disabled: n
|
|
2959
2991
|
} = e;
|
|
2960
|
-
const r = gn(t), o =
|
|
2992
|
+
const r = gn(t), o = V(() => {
|
|
2961
2993
|
if (n || typeof window > "u" || typeof window.MutationObserver > "u")
|
|
2962
2994
|
return;
|
|
2963
2995
|
const {
|
|
@@ -2965,14 +2997,14 @@ function qo(e) {
|
|
|
2965
2997
|
} = window;
|
|
2966
2998
|
return new s(r);
|
|
2967
2999
|
}, [r, n]);
|
|
2968
|
-
return
|
|
3000
|
+
return W(() => () => o?.disconnect(), [o]), o;
|
|
2969
3001
|
}
|
|
2970
3002
|
function Bt(e) {
|
|
2971
3003
|
let {
|
|
2972
3004
|
callback: t,
|
|
2973
3005
|
disabled: n
|
|
2974
3006
|
} = e;
|
|
2975
|
-
const r = gn(t), o =
|
|
3007
|
+
const r = gn(t), o = V(
|
|
2976
3008
|
() => {
|
|
2977
3009
|
if (n || typeof window > "u" || typeof window.ResizeObserver > "u")
|
|
2978
3010
|
return;
|
|
@@ -2984,12 +3016,12 @@ function Bt(e) {
|
|
|
2984
3016
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
2985
3017
|
[n]
|
|
2986
3018
|
);
|
|
2987
|
-
return
|
|
3019
|
+
return W(() => () => o?.disconnect(), [o]), o;
|
|
2988
3020
|
}
|
|
2989
3021
|
function Ko(e) {
|
|
2990
3022
|
return new mn(rt(e), e);
|
|
2991
3023
|
}
|
|
2992
|
-
function
|
|
3024
|
+
function Xn(e, t, n) {
|
|
2993
3025
|
t === void 0 && (t = Ko);
|
|
2994
3026
|
const [r, o] = ee(null);
|
|
2995
3027
|
function s() {
|
|
@@ -3000,8 +3032,8 @@ function Hn(e, t, n) {
|
|
|
3000
3032
|
var p;
|
|
3001
3033
|
return (p = u ?? n) != null ? p : null;
|
|
3002
3034
|
}
|
|
3003
|
-
const
|
|
3004
|
-
return JSON.stringify(u) === JSON.stringify(
|
|
3035
|
+
const v = t(e);
|
|
3036
|
+
return JSON.stringify(u) === JSON.stringify(v) ? u : v;
|
|
3005
3037
|
});
|
|
3006
3038
|
}
|
|
3007
3039
|
const l = qo({
|
|
@@ -3009,10 +3041,10 @@ function Hn(e, t, n) {
|
|
|
3009
3041
|
if (e)
|
|
3010
3042
|
for (const p of u) {
|
|
3011
3043
|
const {
|
|
3012
|
-
type:
|
|
3044
|
+
type: v,
|
|
3013
3045
|
target: c
|
|
3014
3046
|
} = p;
|
|
3015
|
-
if (
|
|
3047
|
+
if (v === "childList" && c instanceof HTMLElement && c.contains(e)) {
|
|
3016
3048
|
s();
|
|
3017
3049
|
break;
|
|
3018
3050
|
}
|
|
@@ -3029,22 +3061,22 @@ function Hn(e, t, n) {
|
|
|
3029
3061
|
}, [e]), r;
|
|
3030
3062
|
}
|
|
3031
3063
|
function Jo(e) {
|
|
3032
|
-
const t =
|
|
3033
|
-
return
|
|
3064
|
+
const t = Dr(e);
|
|
3065
|
+
return mr(e, t);
|
|
3034
3066
|
}
|
|
3035
|
-
const
|
|
3067
|
+
const qn = [];
|
|
3036
3068
|
function Qo(e) {
|
|
3037
|
-
const t = q(e), n = jt((r) => e ? r && r !==
|
|
3038
|
-
return
|
|
3069
|
+
const t = q(e), n = jt((r) => e ? r && r !== qn && e && t.current && e.parentNode === t.current.parentNode ? r : bn(e) : qn, [e]);
|
|
3070
|
+
return W(() => {
|
|
3039
3071
|
t.current = e;
|
|
3040
3072
|
}, [e]), n;
|
|
3041
3073
|
}
|
|
3042
3074
|
function Zo(e) {
|
|
3043
|
-
const [t, n] = ee(null), r = q(e), o =
|
|
3075
|
+
const [t, n] = ee(null), r = q(e), o = L((s) => {
|
|
3044
3076
|
const l = en(s.target);
|
|
3045
3077
|
l && n((a) => a ? (a.set(l, ln(l)), new Map(a)) : null);
|
|
3046
3078
|
}, []);
|
|
3047
|
-
return
|
|
3079
|
+
return W(() => {
|
|
3048
3080
|
const s = r.current;
|
|
3049
3081
|
if (e !== s) {
|
|
3050
3082
|
l(s);
|
|
@@ -3065,24 +3097,24 @@ function Zo(e) {
|
|
|
3065
3097
|
p?.removeEventListener("scroll", o);
|
|
3066
3098
|
});
|
|
3067
3099
|
}
|
|
3068
|
-
}, [o, e]),
|
|
3100
|
+
}, [o, e]), V(() => e.length ? t ? Array.from(t.values()).reduce((s, l) => Ze(s, l), Oe) : Sr(e) : Oe, [e, t]);
|
|
3069
3101
|
}
|
|
3070
|
-
function
|
|
3102
|
+
function Kn(e, t) {
|
|
3071
3103
|
t === void 0 && (t = []);
|
|
3072
3104
|
const n = q(null);
|
|
3073
|
-
return
|
|
3105
|
+
return W(
|
|
3074
3106
|
() => {
|
|
3075
3107
|
n.current = null;
|
|
3076
3108
|
},
|
|
3077
3109
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
3078
3110
|
t
|
|
3079
|
-
),
|
|
3111
|
+
), W(() => {
|
|
3080
3112
|
const r = e !== Oe;
|
|
3081
3113
|
r && !n.current && (n.current = e), !r && n.current && (n.current = null);
|
|
3082
3114
|
}, [e]), n.current ? Lt(e, n.current) : Oe;
|
|
3083
3115
|
}
|
|
3084
3116
|
function es(e) {
|
|
3085
|
-
|
|
3117
|
+
W(
|
|
3086
3118
|
() => {
|
|
3087
3119
|
if (!zt)
|
|
3088
3120
|
return;
|
|
@@ -3108,7 +3140,7 @@ function es(e) {
|
|
|
3108
3140
|
);
|
|
3109
3141
|
}
|
|
3110
3142
|
function ts(e, t) {
|
|
3111
|
-
return
|
|
3143
|
+
return V(() => e.reduce((n, r) => {
|
|
3112
3144
|
let {
|
|
3113
3145
|
eventName: o,
|
|
3114
3146
|
handler: s
|
|
@@ -3118,15 +3150,15 @@ function ts(e, t) {
|
|
|
3118
3150
|
}, n;
|
|
3119
3151
|
}, {}), [e, t]);
|
|
3120
3152
|
}
|
|
3121
|
-
function
|
|
3122
|
-
return
|
|
3153
|
+
function Rr(e) {
|
|
3154
|
+
return V(() => e ? No(e) : null, [e]);
|
|
3123
3155
|
}
|
|
3124
|
-
const
|
|
3156
|
+
const Jn = [];
|
|
3125
3157
|
function ns(e, t) {
|
|
3126
3158
|
t === void 0 && (t = rt);
|
|
3127
|
-
const [n] = e, r =
|
|
3159
|
+
const [n] = e, r = Rr(n ? Se(n) : null), [o, s] = ee(Jn);
|
|
3128
3160
|
function l() {
|
|
3129
|
-
s(() => e.length ? e.map((u) =>
|
|
3161
|
+
s(() => e.length ? e.map((u) => jr(u) ? r : new mn(t(u), u)) : Jn);
|
|
3130
3162
|
}
|
|
3131
3163
|
const a = Bt({
|
|
3132
3164
|
callback: l
|
|
@@ -3147,28 +3179,28 @@ function is(e) {
|
|
|
3147
3179
|
let {
|
|
3148
3180
|
measure: t
|
|
3149
3181
|
} = e;
|
|
3150
|
-
const [n, r] = ee(null), o =
|
|
3182
|
+
const [n, r] = ee(null), o = L((p) => {
|
|
3151
3183
|
for (const {
|
|
3152
|
-
target:
|
|
3184
|
+
target: v
|
|
3153
3185
|
} of p)
|
|
3154
|
-
if (yt(
|
|
3186
|
+
if (yt(v)) {
|
|
3155
3187
|
r((c) => {
|
|
3156
|
-
const
|
|
3188
|
+
const w = t(v);
|
|
3157
3189
|
return c ? {
|
|
3158
3190
|
...c,
|
|
3159
|
-
width:
|
|
3160
|
-
height:
|
|
3161
|
-
} :
|
|
3191
|
+
width: w.width,
|
|
3192
|
+
height: w.height
|
|
3193
|
+
} : w;
|
|
3162
3194
|
});
|
|
3163
3195
|
break;
|
|
3164
3196
|
}
|
|
3165
3197
|
}, [t]), s = Bt({
|
|
3166
3198
|
callback: o
|
|
3167
|
-
}), l =
|
|
3168
|
-
const
|
|
3169
|
-
s?.disconnect(),
|
|
3199
|
+
}), l = L((p) => {
|
|
3200
|
+
const v = rs(p);
|
|
3201
|
+
s?.disconnect(), v && s?.observe(v), r(v ? t(v) : null);
|
|
3170
3202
|
}, [t, s]), [a, u] = Pt(l);
|
|
3171
|
-
return
|
|
3203
|
+
return V(() => ({
|
|
3172
3204
|
nodeRef: a,
|
|
3173
3205
|
rect: n,
|
|
3174
3206
|
setRef: u
|
|
@@ -3184,10 +3216,10 @@ const os = [{
|
|
|
3184
3216
|
current: {}
|
|
3185
3217
|
}, Ft = {
|
|
3186
3218
|
draggable: {
|
|
3187
|
-
measure:
|
|
3219
|
+
measure: Un
|
|
3188
3220
|
},
|
|
3189
3221
|
droppable: {
|
|
3190
|
-
measure:
|
|
3222
|
+
measure: Un,
|
|
3191
3223
|
strategy: xt.WhileDragging,
|
|
3192
3224
|
frequency: dn.Optimized
|
|
3193
3225
|
},
|
|
@@ -3195,7 +3227,7 @@ const os = [{
|
|
|
3195
3227
|
measure: rt
|
|
3196
3228
|
}
|
|
3197
3229
|
};
|
|
3198
|
-
class
|
|
3230
|
+
class vt extends Map {
|
|
3199
3231
|
get(t) {
|
|
3200
3232
|
var n;
|
|
3201
3233
|
return t != null && (n = super.get(t)) != null ? n : void 0;
|
|
@@ -3225,7 +3257,7 @@ const as = {
|
|
|
3225
3257
|
containerNodeRect: null,
|
|
3226
3258
|
draggableNodes: /* @__PURE__ */ new Map(),
|
|
3227
3259
|
droppableRects: /* @__PURE__ */ new Map(),
|
|
3228
|
-
droppableContainers: /* @__PURE__ */ new
|
|
3260
|
+
droppableContainers: /* @__PURE__ */ new vt(),
|
|
3229
3261
|
over: null,
|
|
3230
3262
|
dragOverlay: {
|
|
3231
3263
|
nodeRef: {
|
|
@@ -3252,7 +3284,7 @@ const as = {
|
|
|
3252
3284
|
draggableNodes: /* @__PURE__ */ new Map(),
|
|
3253
3285
|
over: null,
|
|
3254
3286
|
measureDroppableContainers: _t
|
|
3255
|
-
}, Ut = /* @__PURE__ */ wt(ls),
|
|
3287
|
+
}, Ut = /* @__PURE__ */ wt(ls), Er = /* @__PURE__ */ wt(as);
|
|
3256
3288
|
function cs() {
|
|
3257
3289
|
return {
|
|
3258
3290
|
draggable: {
|
|
@@ -3268,13 +3300,13 @@ function cs() {
|
|
|
3268
3300
|
}
|
|
3269
3301
|
},
|
|
3270
3302
|
droppable: {
|
|
3271
|
-
containers: new
|
|
3303
|
+
containers: new vt()
|
|
3272
3304
|
}
|
|
3273
3305
|
};
|
|
3274
3306
|
}
|
|
3275
3307
|
function ds(e, t) {
|
|
3276
3308
|
switch (t.type) {
|
|
3277
|
-
case
|
|
3309
|
+
case fe.DragStart:
|
|
3278
3310
|
return {
|
|
3279
3311
|
...e,
|
|
3280
3312
|
draggable: {
|
|
@@ -3283,7 +3315,7 @@ function ds(e, t) {
|
|
|
3283
3315
|
active: t.active
|
|
3284
3316
|
}
|
|
3285
3317
|
};
|
|
3286
|
-
case
|
|
3318
|
+
case fe.DragMove:
|
|
3287
3319
|
return e.draggable.active == null ? e : {
|
|
3288
3320
|
...e,
|
|
3289
3321
|
draggable: {
|
|
@@ -3294,8 +3326,8 @@ function ds(e, t) {
|
|
|
3294
3326
|
}
|
|
3295
3327
|
}
|
|
3296
3328
|
};
|
|
3297
|
-
case
|
|
3298
|
-
case
|
|
3329
|
+
case fe.DragEnd:
|
|
3330
|
+
case fe.DragCancel:
|
|
3299
3331
|
return {
|
|
3300
3332
|
...e,
|
|
3301
3333
|
draggable: {
|
|
@@ -3311,12 +3343,12 @@ function ds(e, t) {
|
|
|
3311
3343
|
}
|
|
3312
3344
|
}
|
|
3313
3345
|
};
|
|
3314
|
-
case
|
|
3346
|
+
case fe.RegisterDroppable: {
|
|
3315
3347
|
const {
|
|
3316
3348
|
element: n
|
|
3317
3349
|
} = t, {
|
|
3318
3350
|
id: r
|
|
3319
|
-
} = n, o = new
|
|
3351
|
+
} = n, o = new vt(e.droppable.containers);
|
|
3320
3352
|
return o.set(r, n), {
|
|
3321
3353
|
...e,
|
|
3322
3354
|
droppable: {
|
|
@@ -3325,7 +3357,7 @@ function ds(e, t) {
|
|
|
3325
3357
|
}
|
|
3326
3358
|
};
|
|
3327
3359
|
}
|
|
3328
|
-
case
|
|
3360
|
+
case fe.SetDroppableDisabled: {
|
|
3329
3361
|
const {
|
|
3330
3362
|
id: n,
|
|
3331
3363
|
key: r,
|
|
@@ -3333,7 +3365,7 @@ function ds(e, t) {
|
|
|
3333
3365
|
} = t, s = e.droppable.containers.get(n);
|
|
3334
3366
|
if (!s || r !== s.key)
|
|
3335
3367
|
return e;
|
|
3336
|
-
const l = new
|
|
3368
|
+
const l = new vt(e.droppable.containers);
|
|
3337
3369
|
return l.set(n, {
|
|
3338
3370
|
...s,
|
|
3339
3371
|
disabled: o
|
|
@@ -3345,14 +3377,14 @@ function ds(e, t) {
|
|
|
3345
3377
|
}
|
|
3346
3378
|
};
|
|
3347
3379
|
}
|
|
3348
|
-
case
|
|
3380
|
+
case fe.UnregisterDroppable: {
|
|
3349
3381
|
const {
|
|
3350
3382
|
id: n,
|
|
3351
3383
|
key: r
|
|
3352
3384
|
} = t, o = e.droppable.containers.get(n);
|
|
3353
3385
|
if (!o || r !== o.key)
|
|
3354
3386
|
return e;
|
|
3355
|
-
const s = new
|
|
3387
|
+
const s = new vt(e.droppable.containers);
|
|
3356
3388
|
return s.delete(n), {
|
|
3357
3389
|
...e,
|
|
3358
3390
|
droppable: {
|
|
@@ -3374,9 +3406,9 @@ function us(e) {
|
|
|
3374
3406
|
activatorEvent: r,
|
|
3375
3407
|
draggableNodes: o
|
|
3376
3408
|
} = Ge(Ut), s = sn(r), l = sn(n?.id);
|
|
3377
|
-
return
|
|
3409
|
+
return W(() => {
|
|
3378
3410
|
if (!t && !r && s && l != null) {
|
|
3379
|
-
if (!
|
|
3411
|
+
if (!vn(s) || document.activeElement === s.target)
|
|
3380
3412
|
return;
|
|
3381
3413
|
const a = o.get(l);
|
|
3382
3414
|
if (!a)
|
|
@@ -3388,10 +3420,10 @@ function us(e) {
|
|
|
3388
3420
|
if (!u.current && !p.current)
|
|
3389
3421
|
return;
|
|
3390
3422
|
requestAnimationFrame(() => {
|
|
3391
|
-
for (const
|
|
3392
|
-
if (!
|
|
3423
|
+
for (const v of [u.current, p.current]) {
|
|
3424
|
+
if (!v)
|
|
3393
3425
|
continue;
|
|
3394
|
-
const c = eo(
|
|
3426
|
+
const c = eo(v);
|
|
3395
3427
|
if (c) {
|
|
3396
3428
|
c.focus();
|
|
3397
3429
|
break;
|
|
@@ -3412,7 +3444,7 @@ function fs(e, t) {
|
|
|
3412
3444
|
}), n) : n;
|
|
3413
3445
|
}
|
|
3414
3446
|
function ps(e) {
|
|
3415
|
-
return
|
|
3447
|
+
return V(
|
|
3416
3448
|
() => ({
|
|
3417
3449
|
draggable: {
|
|
3418
3450
|
...Ft.draggable,
|
|
@@ -3455,17 +3487,17 @@ function hs(e) {
|
|
|
3455
3487
|
const p = t?.node.current;
|
|
3456
3488
|
if (!p || p.isConnected === !1)
|
|
3457
3489
|
return;
|
|
3458
|
-
const
|
|
3490
|
+
const v = n(p), c = mr(v, r);
|
|
3459
3491
|
if (l || (c.x = 0), a || (c.y = 0), s.current = !0, Math.abs(c.x) > 0 || Math.abs(c.y) > 0) {
|
|
3460
|
-
const
|
|
3461
|
-
|
|
3492
|
+
const w = xr(p);
|
|
3493
|
+
w && w.scrollBy({
|
|
3462
3494
|
top: c.y,
|
|
3463
3495
|
left: c.x
|
|
3464
3496
|
});
|
|
3465
3497
|
}
|
|
3466
3498
|
}, [t, l, a, r, n]);
|
|
3467
3499
|
}
|
|
3468
|
-
const
|
|
3500
|
+
const Ar = /* @__PURE__ */ wt({
|
|
3469
3501
|
...Oe,
|
|
3470
3502
|
scaleX: 1,
|
|
3471
3503
|
scaleY: 1
|
|
@@ -3474,71 +3506,71 @@ var Ye;
|
|
|
3474
3506
|
(function(e) {
|
|
3475
3507
|
e[e.Uninitialized = 0] = "Uninitialized", e[e.Initializing = 1] = "Initializing", e[e.Initialized = 2] = "Initialized";
|
|
3476
3508
|
})(Ye || (Ye = {}));
|
|
3477
|
-
const gs = /* @__PURE__ */
|
|
3509
|
+
const gs = /* @__PURE__ */ Pr(function(t) {
|
|
3478
3510
|
var n, r, o, s;
|
|
3479
3511
|
let {
|
|
3480
3512
|
id: l,
|
|
3481
3513
|
accessibility: a,
|
|
3482
3514
|
autoScroll: u = !0,
|
|
3483
3515
|
children: p,
|
|
3484
|
-
sensors:
|
|
3516
|
+
sensors: v = os,
|
|
3485
3517
|
collisionDetection: c = mo,
|
|
3486
|
-
measuring:
|
|
3487
|
-
modifiers:
|
|
3518
|
+
measuring: w,
|
|
3519
|
+
modifiers: b,
|
|
3488
3520
|
...S
|
|
3489
3521
|
} = t;
|
|
3490
|
-
const f =
|
|
3522
|
+
const f = Lr(ds, void 0, cs), [j, N] = f, [m, C] = so(), [A, F] = ee(Ye.Uninitialized), k = A === Ye.Initialized, {
|
|
3491
3523
|
draggable: {
|
|
3492
3524
|
active: x,
|
|
3493
|
-
nodes:
|
|
3525
|
+
nodes: R,
|
|
3494
3526
|
translate: I
|
|
3495
3527
|
},
|
|
3496
3528
|
droppable: {
|
|
3497
3529
|
containers: M
|
|
3498
3530
|
}
|
|
3499
|
-
} = j,
|
|
3531
|
+
} = j, _ = x != null ? R.get(x) : null, B = q({
|
|
3500
3532
|
initial: null,
|
|
3501
3533
|
translated: null
|
|
3502
|
-
}),
|
|
3503
|
-
var
|
|
3534
|
+
}), ie = V(() => {
|
|
3535
|
+
var J;
|
|
3504
3536
|
return x != null ? {
|
|
3505
3537
|
id: x,
|
|
3506
3538
|
// It's possible for the active node to unmount while dragging
|
|
3507
|
-
data: (
|
|
3508
|
-
rect:
|
|
3539
|
+
data: (J = _?.data) != null ? J : ss,
|
|
3540
|
+
rect: B
|
|
3509
3541
|
} : null;
|
|
3510
|
-
}, [x,
|
|
3511
|
-
droppableRects:
|
|
3512
|
-
measureDroppableContainers:
|
|
3513
|
-
measuringScheduled:
|
|
3542
|
+
}, [x, _]), Z = q(null), [pe, he] = ee(null), [ne, $] = ee(null), G = bt(S, Object.values(S)), Ne = Ct("DndDescribedBy", l), h = V(() => M.getEnabled(), [M]), d = ps(w), {
|
|
3543
|
+
droppableRects: O,
|
|
3544
|
+
measureDroppableContainers: T,
|
|
3545
|
+
measuringScheduled: ce
|
|
3514
3546
|
} = Ho(h, {
|
|
3515
|
-
dragging:
|
|
3547
|
+
dragging: k,
|
|
3516
3548
|
dependencies: [I.x, I.y],
|
|
3517
3549
|
config: d.droppable
|
|
3518
|
-
}),
|
|
3550
|
+
}), Y = Wo(R, x), H = V(() => ne ? an(ne) : null, [ne]), de = me(), ue = Xo(Y, d.draggable.measure);
|
|
3519
3551
|
hs({
|
|
3520
|
-
activeNode: x != null ?
|
|
3521
|
-
config:
|
|
3522
|
-
initialRect:
|
|
3552
|
+
activeNode: x != null ? R.get(x) : null,
|
|
3553
|
+
config: de.layoutShiftCompensation,
|
|
3554
|
+
initialRect: ue,
|
|
3523
3555
|
measure: d.draggable.measure
|
|
3524
3556
|
});
|
|
3525
|
-
const g =
|
|
3557
|
+
const g = Xn(Y, d.draggable.measure, ue), te = Xn(Y ? Y.parentElement : null), K = q({
|
|
3526
3558
|
activatorEvent: null,
|
|
3527
3559
|
active: null,
|
|
3528
|
-
activeNode:
|
|
3560
|
+
activeNode: Y,
|
|
3529
3561
|
collisionRect: null,
|
|
3530
3562
|
collisions: null,
|
|
3531
|
-
droppableRects:
|
|
3532
|
-
draggableNodes:
|
|
3563
|
+
droppableRects: O,
|
|
3564
|
+
draggableNodes: R,
|
|
3533
3565
|
draggingNode: null,
|
|
3534
3566
|
draggingNodeRect: null,
|
|
3535
3567
|
droppableContainers: M,
|
|
3536
3568
|
over: null,
|
|
3537
3569
|
scrollableAncestors: [],
|
|
3538
3570
|
scrollAdjustedTranslate: null
|
|
3539
|
-
}),
|
|
3571
|
+
}), oe = M.getNodeFor((n = K.current.over) == null ? void 0 : n.id), U = is({
|
|
3540
3572
|
measure: d.dragOverlay.measure
|
|
3541
|
-
}),
|
|
3573
|
+
}), De = (r = U.nodeRef.current) != null ? r : Y, be = k ? (o = U.rect) != null ? o : g : null, it = !!(U.nodeRef.current && U.rect), He = Jo(it ? null : g), _e = Rr(De ? Se(De) : null), Re = Qo(k ? oe ?? Y : null), se = ns(Re), X = fs(b, {
|
|
3542
3574
|
transform: {
|
|
3543
3575
|
x: I.x - He.x,
|
|
3544
3576
|
y: I.y - He.y,
|
|
@@ -3546,108 +3578,108 @@ const gs = /* @__PURE__ */ Mr(function(t) {
|
|
|
3546
3578
|
scaleY: 1
|
|
3547
3579
|
},
|
|
3548
3580
|
activatorEvent: ne,
|
|
3549
|
-
active:
|
|
3581
|
+
active: ie,
|
|
3550
3582
|
activeNodeRect: g,
|
|
3551
3583
|
containerNodeRect: te,
|
|
3552
3584
|
draggingNodeRect: be,
|
|
3553
3585
|
over: K.current.over,
|
|
3554
|
-
overlayNodeRect:
|
|
3555
|
-
scrollableAncestors:
|
|
3586
|
+
overlayNodeRect: U.rect,
|
|
3587
|
+
scrollableAncestors: Re,
|
|
3556
3588
|
scrollableAncestorRects: se,
|
|
3557
3589
|
windowRect: _e
|
|
3558
|
-
}), Pe =
|
|
3559
|
-
active:
|
|
3590
|
+
}), Pe = H ? Ze(H, I) : null, Je = Zo(Re), ot = Kn(Je), Yt = Kn(Je, [g]), $e = Ze(X, ot), Ie = be ? yo(be, X) : null, Xe = ie && Ie ? c({
|
|
3591
|
+
active: ie,
|
|
3560
3592
|
collisionRect: Ie,
|
|
3561
|
-
droppableRects:
|
|
3593
|
+
droppableRects: O,
|
|
3562
3594
|
droppableContainers: h,
|
|
3563
3595
|
pointerCoordinates: Pe
|
|
3564
|
-
}) : null, st = go(Xe, "id"), [
|
|
3565
|
-
(
|
|
3596
|
+
}) : null, st = go(Xe, "id"), [Ee, at] = ee(null), St = it ? X : Ze(X, Yt), y = xo(St, (s = Ee?.rect) != null ? s : null, g), D = q(null), E = L(
|
|
3597
|
+
(J, P) => {
|
|
3566
3598
|
let {
|
|
3567
|
-
sensor:
|
|
3599
|
+
sensor: je,
|
|
3568
3600
|
options: ze
|
|
3569
|
-
} =
|
|
3570
|
-
if (
|
|
3601
|
+
} = P;
|
|
3602
|
+
if (Z.current == null)
|
|
3571
3603
|
return;
|
|
3572
|
-
const Te =
|
|
3604
|
+
const Te = R.get(Z.current);
|
|
3573
3605
|
if (!Te)
|
|
3574
3606
|
return;
|
|
3575
|
-
const
|
|
3576
|
-
active:
|
|
3607
|
+
const Ae = J.nativeEvent, ke = new je({
|
|
3608
|
+
active: Z.current,
|
|
3577
3609
|
activeNode: Te,
|
|
3578
|
-
event:
|
|
3610
|
+
event: Ae,
|
|
3579
3611
|
options: ze,
|
|
3580
3612
|
// Sensors need to be instantiated with refs for arguments that change over time
|
|
3581
3613
|
// otherwise they are frozen in time with the stale arguments
|
|
3582
3614
|
context: K,
|
|
3583
|
-
onAbort(
|
|
3584
|
-
if (!
|
|
3615
|
+
onAbort(xe) {
|
|
3616
|
+
if (!R.get(xe))
|
|
3585
3617
|
return;
|
|
3586
3618
|
const {
|
|
3587
3619
|
onDragAbort: Ve
|
|
3588
|
-
} =
|
|
3589
|
-
id:
|
|
3620
|
+
} = G.current, Le = {
|
|
3621
|
+
id: xe
|
|
3590
3622
|
};
|
|
3591
|
-
Ve?.(Le),
|
|
3623
|
+
Ve?.(Le), m({
|
|
3592
3624
|
type: "onDragAbort",
|
|
3593
3625
|
event: Le
|
|
3594
3626
|
});
|
|
3595
3627
|
},
|
|
3596
|
-
onPending(
|
|
3597
|
-
if (!
|
|
3628
|
+
onPending(xe, Be, Ve, Le) {
|
|
3629
|
+
if (!R.get(xe))
|
|
3598
3630
|
return;
|
|
3599
3631
|
const {
|
|
3600
3632
|
onDragPending: ct
|
|
3601
|
-
} =
|
|
3602
|
-
id:
|
|
3633
|
+
} = G.current, Ue = {
|
|
3634
|
+
id: xe,
|
|
3603
3635
|
constraint: Be,
|
|
3604
3636
|
initialCoordinates: Ve,
|
|
3605
3637
|
offset: Le
|
|
3606
3638
|
};
|
|
3607
|
-
ct?.(Ue),
|
|
3639
|
+
ct?.(Ue), m({
|
|
3608
3640
|
type: "onDragPending",
|
|
3609
3641
|
event: Ue
|
|
3610
3642
|
});
|
|
3611
3643
|
},
|
|
3612
|
-
onStart(
|
|
3613
|
-
const Be =
|
|
3644
|
+
onStart(xe) {
|
|
3645
|
+
const Be = Z.current;
|
|
3614
3646
|
if (Be == null)
|
|
3615
3647
|
return;
|
|
3616
|
-
const Ve =
|
|
3648
|
+
const Ve = R.get(Be);
|
|
3617
3649
|
if (!Ve)
|
|
3618
3650
|
return;
|
|
3619
3651
|
const {
|
|
3620
3652
|
onDragStart: Le
|
|
3621
|
-
} =
|
|
3622
|
-
activatorEvent:
|
|
3653
|
+
} = G.current, lt = {
|
|
3654
|
+
activatorEvent: Ae,
|
|
3623
3655
|
active: {
|
|
3624
3656
|
id: Be,
|
|
3625
3657
|
data: Ve.data,
|
|
3626
|
-
rect:
|
|
3658
|
+
rect: B
|
|
3627
3659
|
}
|
|
3628
3660
|
};
|
|
3629
3661
|
Nt(() => {
|
|
3630
|
-
Le?.(lt),
|
|
3631
|
-
type:
|
|
3632
|
-
initialCoordinates:
|
|
3662
|
+
Le?.(lt), F(Ye.Initializing), N({
|
|
3663
|
+
type: fe.DragStart,
|
|
3664
|
+
initialCoordinates: xe,
|
|
3633
3665
|
active: Be
|
|
3634
|
-
}),
|
|
3666
|
+
}), m({
|
|
3635
3667
|
type: "onDragStart",
|
|
3636
3668
|
event: lt
|
|
3637
|
-
}),
|
|
3669
|
+
}), he(D.current), $(Ae);
|
|
3638
3670
|
});
|
|
3639
3671
|
},
|
|
3640
|
-
onMove(
|
|
3672
|
+
onMove(xe) {
|
|
3641
3673
|
N({
|
|
3642
|
-
type:
|
|
3643
|
-
coordinates:
|
|
3674
|
+
type: fe.DragMove,
|
|
3675
|
+
coordinates: xe
|
|
3644
3676
|
});
|
|
3645
3677
|
},
|
|
3646
|
-
onEnd: Qe(
|
|
3647
|
-
onCancel: Qe(
|
|
3678
|
+
onEnd: Qe(fe.DragEnd),
|
|
3679
|
+
onCancel: Qe(fe.DragCancel)
|
|
3648
3680
|
});
|
|
3649
3681
|
D.current = ke;
|
|
3650
|
-
function Qe(
|
|
3682
|
+
function Qe(xe) {
|
|
3651
3683
|
return async function() {
|
|
3652
3684
|
const {
|
|
3653
3685
|
active: Ve,
|
|
@@ -3659,23 +3691,23 @@ const gs = /* @__PURE__ */ Mr(function(t) {
|
|
|
3659
3691
|
if (Ve && ct) {
|
|
3660
3692
|
const {
|
|
3661
3693
|
cancelDrop: dt
|
|
3662
|
-
} =
|
|
3694
|
+
} = G.current;
|
|
3663
3695
|
Ue = {
|
|
3664
|
-
activatorEvent:
|
|
3696
|
+
activatorEvent: Ae,
|
|
3665
3697
|
active: Ve,
|
|
3666
3698
|
collisions: Le,
|
|
3667
3699
|
delta: ct,
|
|
3668
3700
|
over: lt
|
|
3669
|
-
},
|
|
3701
|
+
}, xe === fe.DragEnd && typeof dt == "function" && await Promise.resolve(dt(Ue)) && (xe = fe.DragCancel);
|
|
3670
3702
|
}
|
|
3671
|
-
|
|
3703
|
+
Z.current = null, Nt(() => {
|
|
3672
3704
|
N({
|
|
3673
|
-
type:
|
|
3674
|
-
}),
|
|
3675
|
-
const dt =
|
|
3705
|
+
type: xe
|
|
3706
|
+
}), F(Ye.Uninitialized), at(null), he(null), $(null), D.current = null;
|
|
3707
|
+
const dt = xe === fe.DragEnd ? "onDragEnd" : "onDragCancel";
|
|
3676
3708
|
if (Ue) {
|
|
3677
|
-
const Wt =
|
|
3678
|
-
Wt?.(Ue),
|
|
3709
|
+
const Wt = G.current[dt];
|
|
3710
|
+
Wt?.(Ue), m({
|
|
3679
3711
|
type: dt,
|
|
3680
3712
|
event: Ue
|
|
3681
3713
|
});
|
|
@@ -3685,40 +3717,40 @@ const gs = /* @__PURE__ */ Mr(function(t) {
|
|
|
3685
3717
|
}
|
|
3686
3718
|
},
|
|
3687
3719
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
3688
|
-
[
|
|
3689
|
-
), we =
|
|
3690
|
-
const Te =
|
|
3720
|
+
[R]
|
|
3721
|
+
), we = L((J, P) => (je, ze) => {
|
|
3722
|
+
const Te = je.nativeEvent, Ae = R.get(ze);
|
|
3691
3723
|
if (
|
|
3692
3724
|
// Another sensor is already instantiating
|
|
3693
|
-
|
|
3694
|
-
!
|
|
3725
|
+
Z.current !== null || // No active draggable
|
|
3726
|
+
!Ae || // Event has already been captured
|
|
3695
3727
|
Te.dndKit || Te.defaultPrevented
|
|
3696
3728
|
)
|
|
3697
3729
|
return;
|
|
3698
3730
|
const ke = {
|
|
3699
|
-
active:
|
|
3731
|
+
active: Ae
|
|
3700
3732
|
};
|
|
3701
|
-
|
|
3702
|
-
capturedBy:
|
|
3703
|
-
},
|
|
3704
|
-
}, [
|
|
3705
|
-
es(
|
|
3706
|
-
g &&
|
|
3707
|
-
}, [g,
|
|
3733
|
+
J(je, P.options, ke) === !0 && (Te.dndKit = {
|
|
3734
|
+
capturedBy: P.sensor
|
|
3735
|
+
}, Z.current = ze, E(je, P));
|
|
3736
|
+
}, [R, E]), ae = Go(v, we);
|
|
3737
|
+
es(v), Me(() => {
|
|
3738
|
+
g && A === Ye.Initializing && F(Ye.Initialized);
|
|
3739
|
+
}, [g, A]), W(
|
|
3708
3740
|
() => {
|
|
3709
3741
|
const {
|
|
3710
|
-
onDragMove:
|
|
3711
|
-
} =
|
|
3712
|
-
active:
|
|
3713
|
-
activatorEvent:
|
|
3742
|
+
onDragMove: J
|
|
3743
|
+
} = G.current, {
|
|
3744
|
+
active: P,
|
|
3745
|
+
activatorEvent: je,
|
|
3714
3746
|
collisions: ze,
|
|
3715
3747
|
over: Te
|
|
3716
3748
|
} = K.current;
|
|
3717
|
-
if (!
|
|
3749
|
+
if (!P || !je)
|
|
3718
3750
|
return;
|
|
3719
|
-
const
|
|
3720
|
-
active:
|
|
3721
|
-
activatorEvent:
|
|
3751
|
+
const Ae = {
|
|
3752
|
+
active: P,
|
|
3753
|
+
activatorEvent: je,
|
|
3722
3754
|
collisions: ze,
|
|
3723
3755
|
delta: {
|
|
3724
3756
|
x: $e.x,
|
|
@@ -3727,36 +3759,36 @@ const gs = /* @__PURE__ */ Mr(function(t) {
|
|
|
3727
3759
|
over: Te
|
|
3728
3760
|
};
|
|
3729
3761
|
Nt(() => {
|
|
3730
|
-
|
|
3762
|
+
J?.(Ae), m({
|
|
3731
3763
|
type: "onDragMove",
|
|
3732
|
-
event:
|
|
3764
|
+
event: Ae
|
|
3733
3765
|
});
|
|
3734
3766
|
});
|
|
3735
3767
|
},
|
|
3736
3768
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
3737
3769
|
[$e.x, $e.y]
|
|
3738
|
-
),
|
|
3770
|
+
), W(
|
|
3739
3771
|
() => {
|
|
3740
3772
|
const {
|
|
3741
|
-
active:
|
|
3742
|
-
activatorEvent:
|
|
3743
|
-
collisions:
|
|
3773
|
+
active: J,
|
|
3774
|
+
activatorEvent: P,
|
|
3775
|
+
collisions: je,
|
|
3744
3776
|
droppableContainers: ze,
|
|
3745
3777
|
scrollAdjustedTranslate: Te
|
|
3746
3778
|
} = K.current;
|
|
3747
|
-
if (!
|
|
3779
|
+
if (!J || Z.current == null || !P || !Te)
|
|
3748
3780
|
return;
|
|
3749
3781
|
const {
|
|
3750
|
-
onDragOver:
|
|
3751
|
-
} =
|
|
3782
|
+
onDragOver: Ae
|
|
3783
|
+
} = G.current, ke = ze.get(st), Qe = ke && ke.rect.current ? {
|
|
3752
3784
|
id: ke.id,
|
|
3753
3785
|
rect: ke.rect.current,
|
|
3754
3786
|
data: ke.data,
|
|
3755
3787
|
disabled: ke.disabled
|
|
3756
|
-
} : null,
|
|
3757
|
-
active:
|
|
3758
|
-
activatorEvent:
|
|
3759
|
-
collisions:
|
|
3788
|
+
} : null, xe = {
|
|
3789
|
+
active: J,
|
|
3790
|
+
activatorEvent: P,
|
|
3791
|
+
collisions: je,
|
|
3760
3792
|
delta: {
|
|
3761
3793
|
x: Te.x,
|
|
3762
3794
|
y: Te.y
|
|
@@ -3764,9 +3796,9 @@ const gs = /* @__PURE__ */ Mr(function(t) {
|
|
|
3764
3796
|
over: Qe
|
|
3765
3797
|
};
|
|
3766
3798
|
Nt(() => {
|
|
3767
|
-
at(Qe),
|
|
3799
|
+
at(Qe), Ae?.(xe), m({
|
|
3768
3800
|
type: "onDragOver",
|
|
3769
|
-
event:
|
|
3801
|
+
event: xe
|
|
3770
3802
|
});
|
|
3771
3803
|
});
|
|
3772
3804
|
},
|
|
@@ -3775,85 +3807,85 @@ const gs = /* @__PURE__ */ Mr(function(t) {
|
|
|
3775
3807
|
), Me(() => {
|
|
3776
3808
|
K.current = {
|
|
3777
3809
|
activatorEvent: ne,
|
|
3778
|
-
active:
|
|
3779
|
-
activeNode:
|
|
3810
|
+
active: ie,
|
|
3811
|
+
activeNode: Y,
|
|
3780
3812
|
collisionRect: Ie,
|
|
3781
3813
|
collisions: Xe,
|
|
3782
|
-
droppableRects:
|
|
3783
|
-
draggableNodes:
|
|
3784
|
-
draggingNode:
|
|
3814
|
+
droppableRects: O,
|
|
3815
|
+
draggableNodes: R,
|
|
3816
|
+
draggingNode: De,
|
|
3785
3817
|
draggingNodeRect: be,
|
|
3786
3818
|
droppableContainers: M,
|
|
3787
|
-
over:
|
|
3788
|
-
scrollableAncestors:
|
|
3819
|
+
over: Ee,
|
|
3820
|
+
scrollableAncestors: Re,
|
|
3789
3821
|
scrollAdjustedTranslate: $e
|
|
3790
|
-
},
|
|
3822
|
+
}, B.current = {
|
|
3791
3823
|
initial: be,
|
|
3792
3824
|
translated: Ie
|
|
3793
3825
|
};
|
|
3794
|
-
}, [
|
|
3795
|
-
...
|
|
3826
|
+
}, [ie, Y, Xe, Ie, R, De, be, O, M, Ee, Re, $e]), Bo({
|
|
3827
|
+
...de,
|
|
3796
3828
|
delta: I,
|
|
3797
3829
|
draggingRect: Ie,
|
|
3798
3830
|
pointerCoordinates: Pe,
|
|
3799
|
-
scrollableAncestors:
|
|
3831
|
+
scrollableAncestors: Re,
|
|
3800
3832
|
scrollableAncestorRects: se
|
|
3801
3833
|
});
|
|
3802
|
-
const
|
|
3803
|
-
active:
|
|
3804
|
-
activeNode:
|
|
3834
|
+
const ye = V(() => ({
|
|
3835
|
+
active: ie,
|
|
3836
|
+
activeNode: Y,
|
|
3805
3837
|
activeNodeRect: g,
|
|
3806
3838
|
activatorEvent: ne,
|
|
3807
3839
|
collisions: Xe,
|
|
3808
3840
|
containerNodeRect: te,
|
|
3809
|
-
dragOverlay:
|
|
3810
|
-
draggableNodes:
|
|
3841
|
+
dragOverlay: U,
|
|
3842
|
+
draggableNodes: R,
|
|
3811
3843
|
droppableContainers: M,
|
|
3812
|
-
droppableRects:
|
|
3813
|
-
over:
|
|
3814
|
-
measureDroppableContainers:
|
|
3815
|
-
scrollableAncestors:
|
|
3844
|
+
droppableRects: O,
|
|
3845
|
+
over: Ee,
|
|
3846
|
+
measureDroppableContainers: T,
|
|
3847
|
+
scrollableAncestors: Re,
|
|
3816
3848
|
scrollableAncestorRects: se,
|
|
3817
3849
|
measuringConfiguration: d,
|
|
3818
|
-
measuringScheduled:
|
|
3850
|
+
measuringScheduled: ce,
|
|
3819
3851
|
windowRect: _e
|
|
3820
|
-
}), [
|
|
3852
|
+
}), [ie, Y, g, ne, Xe, te, U, R, M, O, Ee, T, Re, se, d, ce, _e]), le = V(() => ({
|
|
3821
3853
|
activatorEvent: ne,
|
|
3822
3854
|
activators: ae,
|
|
3823
|
-
active:
|
|
3855
|
+
active: ie,
|
|
3824
3856
|
activeNodeRect: g,
|
|
3825
3857
|
ariaDescribedById: {
|
|
3826
|
-
draggable:
|
|
3858
|
+
draggable: Ne
|
|
3827
3859
|
},
|
|
3828
3860
|
dispatch: N,
|
|
3829
|
-
draggableNodes:
|
|
3830
|
-
over:
|
|
3831
|
-
measureDroppableContainers:
|
|
3832
|
-
}), [ne, ae,
|
|
3833
|
-
return
|
|
3861
|
+
draggableNodes: R,
|
|
3862
|
+
over: Ee,
|
|
3863
|
+
measureDroppableContainers: T
|
|
3864
|
+
}), [ne, ae, ie, g, N, Ne, R, Ee, T]);
|
|
3865
|
+
return ve.createElement(br.Provider, {
|
|
3834
3866
|
value: C
|
|
3835
|
-
},
|
|
3836
|
-
value:
|
|
3837
|
-
},
|
|
3838
|
-
value:
|
|
3839
|
-
},
|
|
3867
|
+
}, ve.createElement(Ut.Provider, {
|
|
3868
|
+
value: le
|
|
3869
|
+
}, ve.createElement(Er.Provider, {
|
|
3870
|
+
value: ye
|
|
3871
|
+
}, ve.createElement(Ar.Provider, {
|
|
3840
3872
|
value: y
|
|
3841
|
-
}, p)),
|
|
3873
|
+
}, p)), ve.createElement(us, {
|
|
3842
3874
|
disabled: a?.restoreFocus === !1
|
|
3843
|
-
})),
|
|
3875
|
+
})), ve.createElement(co, {
|
|
3844
3876
|
...a,
|
|
3845
|
-
hiddenTextDescribedById:
|
|
3877
|
+
hiddenTextDescribedById: Ne
|
|
3846
3878
|
}));
|
|
3847
|
-
function
|
|
3848
|
-
const
|
|
3879
|
+
function me() {
|
|
3880
|
+
const J = pe?.autoScrollEnabled === !1, P = typeof u == "object" ? u.enabled === !1 : u === !1, je = k && !J && !P;
|
|
3849
3881
|
return typeof u == "object" ? {
|
|
3850
3882
|
...u,
|
|
3851
|
-
enabled:
|
|
3883
|
+
enabled: je
|
|
3852
3884
|
} : {
|
|
3853
|
-
enabled:
|
|
3885
|
+
enabled: je
|
|
3854
3886
|
};
|
|
3855
3887
|
}
|
|
3856
|
-
}),
|
|
3888
|
+
}), vs = /* @__PURE__ */ wt(null), Qn = "button", bs = "Draggable";
|
|
3857
3889
|
function ms(e) {
|
|
3858
3890
|
let {
|
|
3859
3891
|
id: t,
|
|
@@ -3861,25 +3893,25 @@ function ms(e) {
|
|
|
3861
3893
|
disabled: r = !1,
|
|
3862
3894
|
attributes: o
|
|
3863
3895
|
} = e;
|
|
3864
|
-
const s = Ct(
|
|
3896
|
+
const s = Ct(bs), {
|
|
3865
3897
|
activators: l,
|
|
3866
3898
|
activatorEvent: a,
|
|
3867
3899
|
active: u,
|
|
3868
3900
|
activeNodeRect: p,
|
|
3869
|
-
ariaDescribedById:
|
|
3901
|
+
ariaDescribedById: v,
|
|
3870
3902
|
draggableNodes: c,
|
|
3871
|
-
over:
|
|
3903
|
+
over: w
|
|
3872
3904
|
} = Ge(Ut), {
|
|
3873
|
-
role:
|
|
3905
|
+
role: b = Qn,
|
|
3874
3906
|
roleDescription: S = "draggable",
|
|
3875
3907
|
tabIndex: f = 0
|
|
3876
|
-
} = o ?? {}, j = u?.id === t, N = Ge(j ?
|
|
3908
|
+
} = o ?? {}, j = u?.id === t, N = Ge(j ? Ar : vs), [m, C] = Pt(), [A, F] = Pt(), k = ts(l, t), x = bt(n);
|
|
3877
3909
|
Me(
|
|
3878
3910
|
() => (c.set(t, {
|
|
3879
3911
|
id: t,
|
|
3880
3912
|
key: s,
|
|
3881
|
-
node:
|
|
3882
|
-
activatorNode:
|
|
3913
|
+
node: m,
|
|
3914
|
+
activatorNode: A,
|
|
3883
3915
|
data: x
|
|
3884
3916
|
}), () => {
|
|
3885
3917
|
const I = c.get(t);
|
|
@@ -3888,30 +3920,30 @@ function ms(e) {
|
|
|
3888
3920
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
3889
3921
|
[c, t]
|
|
3890
3922
|
);
|
|
3891
|
-
const
|
|
3892
|
-
role:
|
|
3923
|
+
const R = V(() => ({
|
|
3924
|
+
role: b,
|
|
3893
3925
|
tabIndex: f,
|
|
3894
3926
|
"aria-disabled": r,
|
|
3895
|
-
"aria-pressed": j &&
|
|
3927
|
+
"aria-pressed": j && b === Qn ? !0 : void 0,
|
|
3896
3928
|
"aria-roledescription": S,
|
|
3897
|
-
"aria-describedby":
|
|
3898
|
-
}), [r,
|
|
3929
|
+
"aria-describedby": v.draggable
|
|
3930
|
+
}), [r, b, f, j, S, v.draggable]);
|
|
3899
3931
|
return {
|
|
3900
3932
|
active: u,
|
|
3901
3933
|
activatorEvent: a,
|
|
3902
3934
|
activeNodeRect: p,
|
|
3903
|
-
attributes:
|
|
3935
|
+
attributes: R,
|
|
3904
3936
|
isDragging: j,
|
|
3905
|
-
listeners: r ? void 0 :
|
|
3906
|
-
node:
|
|
3907
|
-
over:
|
|
3937
|
+
listeners: r ? void 0 : k,
|
|
3938
|
+
node: m,
|
|
3939
|
+
over: w,
|
|
3908
3940
|
setNodeRef: C,
|
|
3909
|
-
setActivatorNodeRef:
|
|
3941
|
+
setActivatorNodeRef: F,
|
|
3910
3942
|
transform: N
|
|
3911
3943
|
};
|
|
3912
3944
|
}
|
|
3913
3945
|
function xs() {
|
|
3914
|
-
return Ge(
|
|
3946
|
+
return Ge(Er);
|
|
3915
3947
|
}
|
|
3916
3948
|
const ws = "Droppable", ys = {
|
|
3917
3949
|
timeout: 25
|
|
@@ -3928,67 +3960,67 @@ function js(e) {
|
|
|
3928
3960
|
dispatch: a,
|
|
3929
3961
|
over: u,
|
|
3930
3962
|
measureDroppableContainers: p
|
|
3931
|
-
} = Ge(Ut),
|
|
3963
|
+
} = Ge(Ut), v = q({
|
|
3932
3964
|
disabled: n
|
|
3933
|
-
}), c = q(!1),
|
|
3965
|
+
}), c = q(!1), w = q(null), b = q(null), {
|
|
3934
3966
|
disabled: S,
|
|
3935
3967
|
updateMeasurementsFor: f,
|
|
3936
3968
|
timeout: j
|
|
3937
3969
|
} = {
|
|
3938
3970
|
...ys,
|
|
3939
3971
|
...o
|
|
3940
|
-
}, N =
|
|
3972
|
+
}, N = bt(f ?? r), m = L(
|
|
3941
3973
|
() => {
|
|
3942
3974
|
if (!c.current) {
|
|
3943
3975
|
c.current = !0;
|
|
3944
3976
|
return;
|
|
3945
3977
|
}
|
|
3946
|
-
|
|
3947
|
-
p(Array.isArray(N.current) ? N.current : [N.current]),
|
|
3978
|
+
b.current != null && clearTimeout(b.current), b.current = setTimeout(() => {
|
|
3979
|
+
p(Array.isArray(N.current) ? N.current : [N.current]), b.current = null;
|
|
3948
3980
|
}, j);
|
|
3949
3981
|
},
|
|
3950
3982
|
//eslint-disable-next-line react-hooks/exhaustive-deps
|
|
3951
3983
|
[j]
|
|
3952
3984
|
), C = Bt({
|
|
3953
|
-
callback:
|
|
3985
|
+
callback: m,
|
|
3954
3986
|
disabled: S || !l
|
|
3955
|
-
}),
|
|
3956
|
-
C && (I && (C.unobserve(I), c.current = !1),
|
|
3957
|
-
}, [C]), [
|
|
3958
|
-
return
|
|
3959
|
-
!C || !
|
|
3960
|
-
}, [
|
|
3987
|
+
}), A = L((R, I) => {
|
|
3988
|
+
C && (I && (C.unobserve(I), c.current = !1), R && C.observe(R));
|
|
3989
|
+
}, [C]), [F, k] = Pt(A), x = bt(t);
|
|
3990
|
+
return W(() => {
|
|
3991
|
+
!C || !F.current || (C.disconnect(), c.current = !1, C.observe(F.current));
|
|
3992
|
+
}, [F, C]), W(
|
|
3961
3993
|
() => (a({
|
|
3962
|
-
type:
|
|
3994
|
+
type: fe.RegisterDroppable,
|
|
3963
3995
|
element: {
|
|
3964
3996
|
id: r,
|
|
3965
3997
|
key: s,
|
|
3966
3998
|
disabled: n,
|
|
3967
|
-
node:
|
|
3968
|
-
rect:
|
|
3999
|
+
node: F,
|
|
4000
|
+
rect: w,
|
|
3969
4001
|
data: x
|
|
3970
4002
|
}
|
|
3971
4003
|
}), () => a({
|
|
3972
|
-
type:
|
|
4004
|
+
type: fe.UnregisterDroppable,
|
|
3973
4005
|
key: s,
|
|
3974
4006
|
id: r
|
|
3975
4007
|
})),
|
|
3976
4008
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
3977
4009
|
[r]
|
|
3978
|
-
),
|
|
3979
|
-
n !==
|
|
3980
|
-
type:
|
|
4010
|
+
), W(() => {
|
|
4011
|
+
n !== v.current.disabled && (a({
|
|
4012
|
+
type: fe.SetDroppableDisabled,
|
|
3981
4013
|
id: r,
|
|
3982
4014
|
key: s,
|
|
3983
4015
|
disabled: n
|
|
3984
|
-
}),
|
|
4016
|
+
}), v.current.disabled = n);
|
|
3985
4017
|
}, [r, s, n, a]), {
|
|
3986
4018
|
active: l,
|
|
3987
|
-
rect:
|
|
4019
|
+
rect: w,
|
|
3988
4020
|
isOver: u?.id === r,
|
|
3989
|
-
node:
|
|
4021
|
+
node: F,
|
|
3990
4022
|
over: u,
|
|
3991
|
-
setNodeRef:
|
|
4023
|
+
setNodeRef: k
|
|
3992
4024
|
};
|
|
3993
4025
|
}
|
|
3994
4026
|
function jn(e, t, n) {
|
|
@@ -4062,7 +4094,7 @@ function Rs(e, t, n) {
|
|
|
4062
4094
|
const r = e[t], o = e[t - 1], s = e[t + 1];
|
|
4063
4095
|
return !r || !o && !s ? 0 : n < t ? o ? r.left - (o.left + o.width) : s.left - (r.left + r.width) : s ? s.left - (r.left + r.width) : r.left - (o.left + o.width);
|
|
4064
4096
|
}
|
|
4065
|
-
const
|
|
4097
|
+
const Tr = (e) => {
|
|
4066
4098
|
let {
|
|
4067
4099
|
rects: t,
|
|
4068
4100
|
activeIndex: n,
|
|
@@ -4076,15 +4108,15 @@ const Ar = (e) => {
|
|
|
4076
4108
|
scaleX: a.width / l.width,
|
|
4077
4109
|
scaleY: a.height / l.height
|
|
4078
4110
|
};
|
|
4079
|
-
},
|
|
4111
|
+
}, Fr = "Sortable", Or = /* @__PURE__ */ ve.createContext({
|
|
4080
4112
|
activeIndex: -1,
|
|
4081
|
-
containerId:
|
|
4113
|
+
containerId: Fr,
|
|
4082
4114
|
disableTransforms: !1,
|
|
4083
4115
|
items: [],
|
|
4084
4116
|
overIndex: -1,
|
|
4085
4117
|
useDragOverlay: !1,
|
|
4086
4118
|
sortedRects: [],
|
|
4087
|
-
strategy:
|
|
4119
|
+
strategy: Tr,
|
|
4088
4120
|
disabled: {
|
|
4089
4121
|
draggable: !1,
|
|
4090
4122
|
droppable: !1
|
|
@@ -4095,7 +4127,7 @@ function Es(e) {
|
|
|
4095
4127
|
children: t,
|
|
4096
4128
|
id: n,
|
|
4097
4129
|
items: r,
|
|
4098
|
-
strategy: o =
|
|
4130
|
+
strategy: o = Tr,
|
|
4099
4131
|
disabled: s = !1
|
|
4100
4132
|
} = e;
|
|
4101
4133
|
const {
|
|
@@ -4103,30 +4135,30 @@ function Es(e) {
|
|
|
4103
4135
|
dragOverlay: a,
|
|
4104
4136
|
droppableRects: u,
|
|
4105
4137
|
over: p,
|
|
4106
|
-
measureDroppableContainers:
|
|
4107
|
-
} = xs(), c = Ct(
|
|
4138
|
+
measureDroppableContainers: v
|
|
4139
|
+
} = xs(), c = Ct(Fr, n), w = a.rect !== null, b = V(() => r.map((k) => typeof k == "object" && "id" in k ? k.id : k), [r]), S = l != null, f = l ? b.indexOf(l.id) : -1, j = p ? b.indexOf(p.id) : -1, N = q(b), m = !Ss(b, N.current), C = j !== -1 && f === -1 || m, A = Ns(s);
|
|
4108
4140
|
Me(() => {
|
|
4109
|
-
|
|
4110
|
-
}, [
|
|
4111
|
-
N.current =
|
|
4112
|
-
}, [
|
|
4113
|
-
const
|
|
4141
|
+
m && S && v(b);
|
|
4142
|
+
}, [m, b, S, v]), W(() => {
|
|
4143
|
+
N.current = b;
|
|
4144
|
+
}, [b]);
|
|
4145
|
+
const F = V(
|
|
4114
4146
|
() => ({
|
|
4115
4147
|
activeIndex: f,
|
|
4116
4148
|
containerId: c,
|
|
4117
|
-
disabled:
|
|
4149
|
+
disabled: A,
|
|
4118
4150
|
disableTransforms: C,
|
|
4119
|
-
items:
|
|
4151
|
+
items: b,
|
|
4120
4152
|
overIndex: j,
|
|
4121
|
-
useDragOverlay:
|
|
4122
|
-
sortedRects: Cs(
|
|
4153
|
+
useDragOverlay: w,
|
|
4154
|
+
sortedRects: Cs(b, u),
|
|
4123
4155
|
strategy: o
|
|
4124
4156
|
}),
|
|
4125
4157
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
4126
|
-
[f, c,
|
|
4158
|
+
[f, c, A.draggable, A.droppable, C, b, j, u, w, o]
|
|
4127
4159
|
);
|
|
4128
|
-
return
|
|
4129
|
-
value:
|
|
4160
|
+
return ve.createElement(Or.Provider, {
|
|
4161
|
+
value: F
|
|
4130
4162
|
}, t);
|
|
4131
4163
|
}
|
|
4132
4164
|
const As = (e) => {
|
|
@@ -4153,8 +4185,8 @@ const As = (e) => {
|
|
|
4153
4185
|
}, Fs = {
|
|
4154
4186
|
duration: 200,
|
|
4155
4187
|
easing: "ease"
|
|
4156
|
-
},
|
|
4157
|
-
property:
|
|
4188
|
+
}, Ir = "transform", Os = /* @__PURE__ */ mt.Transition.toString({
|
|
4189
|
+
property: Ir,
|
|
4158
4190
|
duration: 0,
|
|
4159
4191
|
easing: "linear"
|
|
4160
4192
|
}), Is = {
|
|
@@ -4174,17 +4206,17 @@ function ks(e) {
|
|
|
4174
4206
|
if (u) {
|
|
4175
4207
|
const p = rt(r.current, {
|
|
4176
4208
|
ignoreTransform: !0
|
|
4177
|
-
}),
|
|
4209
|
+
}), v = {
|
|
4178
4210
|
x: u.left - p.left,
|
|
4179
4211
|
y: u.top - p.top,
|
|
4180
4212
|
scaleX: u.width / p.width,
|
|
4181
4213
|
scaleY: u.height / p.height
|
|
4182
4214
|
};
|
|
4183
|
-
(
|
|
4215
|
+
(v.x || v.y) && l(v);
|
|
4184
4216
|
}
|
|
4185
4217
|
}
|
|
4186
4218
|
n !== a.current && (a.current = n);
|
|
4187
|
-
}, [t, n, r, o]),
|
|
4219
|
+
}, [t, n, r, o]), W(() => {
|
|
4188
4220
|
s && l(null);
|
|
4189
4221
|
}, [s]), s;
|
|
4190
4222
|
}
|
|
@@ -4201,136 +4233,136 @@ function Vs(e) {
|
|
|
4201
4233
|
transition: p = Fs
|
|
4202
4234
|
} = e;
|
|
4203
4235
|
const {
|
|
4204
|
-
items:
|
|
4236
|
+
items: v,
|
|
4205
4237
|
containerId: c,
|
|
4206
|
-
activeIndex:
|
|
4207
|
-
disabled:
|
|
4238
|
+
activeIndex: w,
|
|
4239
|
+
disabled: b,
|
|
4208
4240
|
disableTransforms: S,
|
|
4209
4241
|
sortedRects: f,
|
|
4210
4242
|
overIndex: j,
|
|
4211
4243
|
useDragOverlay: N,
|
|
4212
|
-
strategy:
|
|
4213
|
-
} = Ge(
|
|
4244
|
+
strategy: m
|
|
4245
|
+
} = Ge(Or), C = Ms(r, b), A = v.indexOf(l), F = V(() => ({
|
|
4214
4246
|
sortable: {
|
|
4215
4247
|
containerId: c,
|
|
4216
|
-
index:
|
|
4217
|
-
items:
|
|
4248
|
+
index: A,
|
|
4249
|
+
items: v
|
|
4218
4250
|
},
|
|
4219
4251
|
...o
|
|
4220
|
-
}), [c, o,
|
|
4252
|
+
}), [c, o, A, v]), k = V(() => v.slice(v.indexOf(l)), [v, l]), {
|
|
4221
4253
|
rect: x,
|
|
4222
|
-
node:
|
|
4254
|
+
node: R,
|
|
4223
4255
|
isOver: I,
|
|
4224
4256
|
setNodeRef: M
|
|
4225
4257
|
} = js({
|
|
4226
4258
|
id: l,
|
|
4227
|
-
data:
|
|
4259
|
+
data: F,
|
|
4228
4260
|
disabled: C.droppable,
|
|
4229
4261
|
resizeObserverConfig: {
|
|
4230
|
-
updateMeasurementsFor:
|
|
4262
|
+
updateMeasurementsFor: k,
|
|
4231
4263
|
...u
|
|
4232
4264
|
}
|
|
4233
4265
|
}), {
|
|
4234
|
-
active:
|
|
4235
|
-
activatorEvent:
|
|
4236
|
-
activeNodeRect:
|
|
4237
|
-
attributes:
|
|
4238
|
-
setNodeRef:
|
|
4239
|
-
listeners:
|
|
4266
|
+
active: _,
|
|
4267
|
+
activatorEvent: B,
|
|
4268
|
+
activeNodeRect: ie,
|
|
4269
|
+
attributes: Z,
|
|
4270
|
+
setNodeRef: pe,
|
|
4271
|
+
listeners: he,
|
|
4240
4272
|
isDragging: ne,
|
|
4241
|
-
over:
|
|
4242
|
-
setActivatorNodeRef:
|
|
4243
|
-
transform:
|
|
4273
|
+
over: $,
|
|
4274
|
+
setActivatorNodeRef: G,
|
|
4275
|
+
transform: Ne
|
|
4244
4276
|
} = ms({
|
|
4245
4277
|
id: l,
|
|
4246
|
-
data:
|
|
4278
|
+
data: F,
|
|
4247
4279
|
attributes: {
|
|
4248
4280
|
...Is,
|
|
4249
4281
|
...n
|
|
4250
4282
|
},
|
|
4251
4283
|
disabled: C.draggable
|
|
4252
|
-
}), h = Ki(M,
|
|
4284
|
+
}), h = Ki(M, pe), d = !!_, O = d && !S && Rt(w) && Rt(j), T = !N && ne, ce = T && O ? Ne : null, H = O ? ce ?? (a ?? m)({
|
|
4253
4285
|
rects: f,
|
|
4254
|
-
activeNodeRect:
|
|
4255
|
-
activeIndex:
|
|
4286
|
+
activeNodeRect: ie,
|
|
4287
|
+
activeIndex: w,
|
|
4256
4288
|
overIndex: j,
|
|
4257
|
-
index:
|
|
4258
|
-
}) : null,
|
|
4289
|
+
index: A
|
|
4290
|
+
}) : null, de = Rt(w) && Rt(j) ? s({
|
|
4259
4291
|
id: l,
|
|
4260
|
-
items:
|
|
4261
|
-
activeIndex:
|
|
4292
|
+
items: v,
|
|
4293
|
+
activeIndex: w,
|
|
4262
4294
|
overIndex: j
|
|
4263
|
-
}) :
|
|
4264
|
-
activeId:
|
|
4265
|
-
items:
|
|
4266
|
-
newIndex:
|
|
4295
|
+
}) : A, ue = _?.id, g = q({
|
|
4296
|
+
activeId: ue,
|
|
4297
|
+
items: v,
|
|
4298
|
+
newIndex: de,
|
|
4267
4299
|
containerId: c
|
|
4268
|
-
}), te =
|
|
4269
|
-
active:
|
|
4300
|
+
}), te = v !== g.current.items, K = t({
|
|
4301
|
+
active: _,
|
|
4270
4302
|
containerId: c,
|
|
4271
4303
|
isDragging: ne,
|
|
4272
4304
|
isSorting: d,
|
|
4273
4305
|
id: l,
|
|
4274
|
-
index:
|
|
4275
|
-
items:
|
|
4306
|
+
index: A,
|
|
4307
|
+
items: v,
|
|
4276
4308
|
newIndex: g.current.newIndex,
|
|
4277
4309
|
previousItems: g.current.items,
|
|
4278
4310
|
previousContainerId: g.current.containerId,
|
|
4279
4311
|
transition: p,
|
|
4280
4312
|
wasDragging: g.current.activeId != null
|
|
4281
|
-
}),
|
|
4313
|
+
}), oe = ks({
|
|
4282
4314
|
disabled: !K,
|
|
4283
|
-
index:
|
|
4284
|
-
node:
|
|
4315
|
+
index: A,
|
|
4316
|
+
node: R,
|
|
4285
4317
|
rect: x
|
|
4286
4318
|
});
|
|
4287
|
-
return
|
|
4288
|
-
d && g.current.newIndex !==
|
|
4289
|
-
}, [d,
|
|
4290
|
-
if (
|
|
4319
|
+
return W(() => {
|
|
4320
|
+
d && g.current.newIndex !== de && (g.current.newIndex = de), c !== g.current.containerId && (g.current.containerId = c), v !== g.current.items && (g.current.items = v);
|
|
4321
|
+
}, [d, de, c, v]), W(() => {
|
|
4322
|
+
if (ue === g.current.activeId)
|
|
4291
4323
|
return;
|
|
4292
|
-
if (
|
|
4293
|
-
g.current.activeId =
|
|
4324
|
+
if (ue != null && g.current.activeId == null) {
|
|
4325
|
+
g.current.activeId = ue;
|
|
4294
4326
|
return;
|
|
4295
4327
|
}
|
|
4296
|
-
const
|
|
4297
|
-
g.current.activeId =
|
|
4328
|
+
const De = setTimeout(() => {
|
|
4329
|
+
g.current.activeId = ue;
|
|
4298
4330
|
}, 50);
|
|
4299
|
-
return () => clearTimeout(
|
|
4300
|
-
}, [
|
|
4301
|
-
active:
|
|
4302
|
-
activeIndex:
|
|
4303
|
-
attributes:
|
|
4304
|
-
data:
|
|
4331
|
+
return () => clearTimeout(De);
|
|
4332
|
+
}, [ue]), {
|
|
4333
|
+
active: _,
|
|
4334
|
+
activeIndex: w,
|
|
4335
|
+
attributes: Z,
|
|
4336
|
+
data: F,
|
|
4305
4337
|
rect: x,
|
|
4306
|
-
index:
|
|
4307
|
-
newIndex:
|
|
4308
|
-
items:
|
|
4338
|
+
index: A,
|
|
4339
|
+
newIndex: de,
|
|
4340
|
+
items: v,
|
|
4309
4341
|
isOver: I,
|
|
4310
4342
|
isSorting: d,
|
|
4311
4343
|
isDragging: ne,
|
|
4312
|
-
listeners:
|
|
4313
|
-
node:
|
|
4344
|
+
listeners: he,
|
|
4345
|
+
node: R,
|
|
4314
4346
|
overIndex: j,
|
|
4315
|
-
over:
|
|
4347
|
+
over: $,
|
|
4316
4348
|
setNodeRef: h,
|
|
4317
|
-
setActivatorNodeRef:
|
|
4349
|
+
setActivatorNodeRef: G,
|
|
4318
4350
|
setDroppableNodeRef: M,
|
|
4319
|
-
setDraggableNodeRef:
|
|
4320
|
-
transform:
|
|
4321
|
-
transition:
|
|
4351
|
+
setDraggableNodeRef: pe,
|
|
4352
|
+
transform: oe ?? H,
|
|
4353
|
+
transition: U()
|
|
4322
4354
|
};
|
|
4323
|
-
function
|
|
4355
|
+
function U() {
|
|
4324
4356
|
if (
|
|
4325
4357
|
// Temporarily disable transitions for a single frame to set up derived transforms
|
|
4326
|
-
|
|
4327
|
-
te && g.current.newIndex ===
|
|
4358
|
+
oe || // Or to prevent items jumping to back to their "new" position when items change
|
|
4359
|
+
te && g.current.newIndex === A
|
|
4328
4360
|
)
|
|
4329
4361
|
return Os;
|
|
4330
|
-
if (!(
|
|
4362
|
+
if (!(T && !vn(B) || !p) && (d || K))
|
|
4331
4363
|
return mt.Transition.toString({
|
|
4332
4364
|
...p,
|
|
4333
|
-
property:
|
|
4365
|
+
property: Ir
|
|
4334
4366
|
});
|
|
4335
4367
|
}
|
|
4336
4368
|
}
|
|
@@ -4345,7 +4377,7 @@ function Ms(e, t) {
|
|
|
4345
4377
|
droppable: (r = e?.droppable) != null ? r : t.droppable
|
|
4346
4378
|
};
|
|
4347
4379
|
}
|
|
4348
|
-
|
|
4380
|
+
z.Down, z.Right, z.Up, z.Left;
|
|
4349
4381
|
const At = { private: 0, team: 1, organization: 2, public: 3 }, Ps = 5, Ls = ({ id: e, disabled: t, children: n }) => {
|
|
4350
4382
|
const {
|
|
4351
4383
|
attributes: r,
|
|
@@ -4372,79 +4404,79 @@ const At = { private: 0, team: 1, organization: 2, public: 3 }, Ps = 5, Ls = ({
|
|
|
4372
4404
|
onDuplicateView: a,
|
|
4373
4405
|
onDeleteView: u,
|
|
4374
4406
|
onSetDefaultView: p,
|
|
4375
|
-
onShareView:
|
|
4407
|
+
onShareView: v,
|
|
4376
4408
|
onSaveAsView: c,
|
|
4377
|
-
onPinView:
|
|
4378
|
-
onReorderViews:
|
|
4409
|
+
onPinView: w,
|
|
4410
|
+
onReorderViews: b,
|
|
4379
4411
|
onChangeViewType: S,
|
|
4380
4412
|
onConfigView: f,
|
|
4381
4413
|
availableViewTypes: j,
|
|
4382
4414
|
hasUnsavedChanges: N = !1,
|
|
4383
|
-
onResetChanges:
|
|
4415
|
+
onResetChanges: m,
|
|
4384
4416
|
className: C
|
|
4385
4417
|
}) => {
|
|
4386
4418
|
const {
|
|
4387
|
-
showAddButton:
|
|
4388
|
-
inlineRename:
|
|
4389
|
-
contextMenu:
|
|
4419
|
+
showAddButton: A = !0,
|
|
4420
|
+
inlineRename: F = !0,
|
|
4421
|
+
contextMenu: k = !0,
|
|
4390
4422
|
reorderable: x = !1,
|
|
4391
|
-
maxVisibleTabs:
|
|
4423
|
+
maxVisibleTabs: R = 6,
|
|
4392
4424
|
showIndicators: I = !0,
|
|
4393
4425
|
showSaveAsView: M = !0,
|
|
4394
|
-
showPinnedSection:
|
|
4395
|
-
showVisibilityGroups:
|
|
4396
|
-
} = o, [
|
|
4397
|
-
|
|
4398
|
-
|
|
4399
|
-
}, [
|
|
4400
|
-
const
|
|
4401
|
-
if (!
|
|
4426
|
+
showPinnedSection: _ = !0,
|
|
4427
|
+
showVisibilityGroups: B = !1
|
|
4428
|
+
} = o, [ie, Z] = ee(null), [pe, he] = ee(""), ne = q(null);
|
|
4429
|
+
W(() => {
|
|
4430
|
+
ie && ne.current && (ne.current.focus(), ne.current.select());
|
|
4431
|
+
}, [ie]);
|
|
4432
|
+
const $ = L((g) => {
|
|
4433
|
+
if (!F || !l) return;
|
|
4402
4434
|
const te = e.find((K) => K.id === g);
|
|
4403
|
-
te && (
|
|
4404
|
-
}, [
|
|
4405
|
-
|
|
4406
|
-
}, [
|
|
4407
|
-
|
|
4408
|
-
}, []), h =
|
|
4435
|
+
te && (Z(g), he(te.label));
|
|
4436
|
+
}, [F, l, e]), G = L(() => {
|
|
4437
|
+
ie && pe.trim() && l && l(ie, pe.trim()), Z(null), he("");
|
|
4438
|
+
}, [ie, pe, l]), Ne = L(() => {
|
|
4439
|
+
Z(null), he("");
|
|
4440
|
+
}, []), h = V(() => {
|
|
4409
4441
|
const g = [...e];
|
|
4410
4442
|
return g.sort((te, K) => {
|
|
4411
|
-
if (
|
|
4412
|
-
const
|
|
4413
|
-
if (
|
|
4443
|
+
if (_) {
|
|
4444
|
+
const oe = te.isPinned ? 1 : 0, U = K.isPinned ? 1 : 0;
|
|
4445
|
+
if (oe !== U) return U - oe;
|
|
4414
4446
|
}
|
|
4415
|
-
if (
|
|
4416
|
-
const
|
|
4417
|
-
if (
|
|
4447
|
+
if (B) {
|
|
4448
|
+
const oe = At[te.visibility || "public"] ?? At.public, U = At[K.visibility || "public"] ?? At.public;
|
|
4449
|
+
if (oe !== U) return oe - U;
|
|
4418
4450
|
}
|
|
4419
4451
|
return 0;
|
|
4420
4452
|
}), g;
|
|
4421
|
-
}, [e,
|
|
4422
|
-
|
|
4423
|
-
|
|
4424
|
-
),
|
|
4453
|
+
}, [e, _, B]), d = h.slice(0, R), O = h.slice(R), T = uo(
|
|
4454
|
+
zn(yn, { activationConstraint: { distance: Ps } }),
|
|
4455
|
+
zn(xn)
|
|
4456
|
+
), ce = L((g) => {
|
|
4425
4457
|
const { active: te, over: K } = g;
|
|
4426
|
-
if (!K || te.id === K.id || !
|
|
4427
|
-
const
|
|
4428
|
-
if (
|
|
4429
|
-
const
|
|
4430
|
-
|
|
4431
|
-
}, [h,
|
|
4432
|
-
if (!
|
|
4433
|
-
const te = d[g - 1], K = d[g],
|
|
4434
|
-
return
|
|
4435
|
-
}, [
|
|
4436
|
-
const K = g.id === t,
|
|
4458
|
+
if (!K || te.id === K.id || !b) return;
|
|
4459
|
+
const oe = h.findIndex((be) => be.id === te.id), U = h.findIndex((be) => be.id === K.id);
|
|
4460
|
+
if (oe === -1 || U === -1) return;
|
|
4461
|
+
const De = jn(h, oe, U);
|
|
4462
|
+
b(De.map((be) => be.id));
|
|
4463
|
+
}, [h, b]), Y = xi, H = L((g) => {
|
|
4464
|
+
if (!B || g === 0) return !1;
|
|
4465
|
+
const te = d[g - 1], K = d[g], oe = (U) => U.visibility === "private";
|
|
4466
|
+
return oe(te) && !oe(K);
|
|
4467
|
+
}, [B, d]), de = (g, te) => {
|
|
4468
|
+
const K = g.id === t, oe = r[g.type] || Y, U = ie === g.id, De = I && (g.hasActiveFilters || g.hasActiveSort), be = H(te), He = ((se) => B ? se.visibility === "private" ? /* @__PURE__ */ i.jsx(on, { "data-testid": `view-tab-visibility-${se.id}`, className: "h-3 w-3 text-muted-foreground shrink-0" }) : se.visibility ? /* @__PURE__ */ i.jsx(yi, { "data-testid": `view-tab-visibility-${se.id}`, className: "h-3 w-3 text-muted-foreground shrink-0" }) : null : null)(g), _e = (se) => /* @__PURE__ */ i.jsxs(
|
|
4437
4469
|
"button",
|
|
4438
4470
|
{
|
|
4439
4471
|
"data-testid": `view-tab-${g.id}`,
|
|
4440
|
-
onClick: () => !
|
|
4441
|
-
onDoubleClick: () =>
|
|
4442
|
-
className:
|
|
4472
|
+
onClick: () => !U && n(g.id),
|
|
4473
|
+
onDoubleClick: () => $(g.id),
|
|
4474
|
+
className: re(
|
|
4443
4475
|
"inline-flex items-center gap-1.5 px-3 py-2 text-sm font-medium border-b-2 transition-colors whitespace-nowrap relative",
|
|
4444
4476
|
K ? "border-primary text-primary" : "border-transparent text-muted-foreground hover:text-foreground hover:border-border"
|
|
4445
4477
|
),
|
|
4446
4478
|
children: [
|
|
4447
|
-
x &&
|
|
4479
|
+
x && b && /* @__PURE__ */ i.jsx(
|
|
4448
4480
|
"span",
|
|
4449
4481
|
{
|
|
4450
4482
|
"data-testid": `view-tab-drag-handle-${g.id}`,
|
|
@@ -4454,26 +4486,26 @@ const At = { private: 0, team: 1, organization: 2, public: 3 }, Ps = 5, Ls = ({
|
|
|
4454
4486
|
children: /* @__PURE__ */ i.jsx(Si, { className: "h-3 w-3" })
|
|
4455
4487
|
}
|
|
4456
4488
|
),
|
|
4457
|
-
|
|
4489
|
+
_ && g.isPinned && /* @__PURE__ */ i.jsx(Xt, { "data-testid": `view-tab-pin-indicator-${g.id}`, className: "h-3 w-3 text-primary shrink-0" }),
|
|
4458
4490
|
He,
|
|
4459
|
-
/* @__PURE__ */ i.jsx(
|
|
4460
|
-
|
|
4491
|
+
/* @__PURE__ */ i.jsx(oe, { className: "h-3.5 w-3.5" }),
|
|
4492
|
+
U ? /* @__PURE__ */ i.jsx(
|
|
4461
4493
|
We,
|
|
4462
4494
|
{
|
|
4463
4495
|
ref: ne,
|
|
4464
4496
|
"data-testid": `view-tab-rename-input-${g.id}`,
|
|
4465
|
-
value:
|
|
4466
|
-
onChange: (
|
|
4467
|
-
onBlur:
|
|
4468
|
-
onKeyDown: (
|
|
4469
|
-
|
|
4497
|
+
value: pe,
|
|
4498
|
+
onChange: (X) => he(X.target.value),
|
|
4499
|
+
onBlur: G,
|
|
4500
|
+
onKeyDown: (X) => {
|
|
4501
|
+
X.key === "Enter" && G(), X.key === "Escape" && Ne();
|
|
4470
4502
|
},
|
|
4471
4503
|
className: "h-5 w-24 px-1 py-0 text-sm border-none focus-visible:ring-1",
|
|
4472
|
-
onClick: (
|
|
4504
|
+
onClick: (X) => X.stopPropagation()
|
|
4473
4505
|
}
|
|
4474
4506
|
) : /* @__PURE__ */ i.jsx("span", { children: g.label }),
|
|
4475
|
-
|
|
4476
|
-
/* @__PURE__ */ i.jsx(
|
|
4507
|
+
De && /* @__PURE__ */ i.jsxs(Nn, { children: [
|
|
4508
|
+
/* @__PURE__ */ i.jsx(Dn, { asChild: !0, children: /* @__PURE__ */ i.jsx(
|
|
4477
4509
|
"span",
|
|
4478
4510
|
{
|
|
4479
4511
|
"data-testid": `view-tab-indicator-${g.id}`,
|
|
@@ -4481,17 +4513,17 @@ const At = { private: 0, team: 1, organization: 2, public: 3 }, Ps = 5, Ls = ({
|
|
|
4481
4513
|
children: [g.hasActiveFilters && "F", g.hasActiveSort && "S"].filter(Boolean).join("")
|
|
4482
4514
|
}
|
|
4483
4515
|
) }),
|
|
4484
|
-
/* @__PURE__ */ i.jsx(
|
|
4516
|
+
/* @__PURE__ */ i.jsx(Rn, { side: "bottom", className: "text-xs", children: [g.hasActiveFilters && "Active filters", g.hasActiveSort && "Active sort"].filter(Boolean).join(", ") })
|
|
4485
4517
|
] }),
|
|
4486
|
-
g.isDefault && /* @__PURE__ */ i.jsx(
|
|
4518
|
+
g.isDefault && /* @__PURE__ */ i.jsx(Tn, { className: "h-3 w-3 text-amber-500 fill-amber-500 shrink-0" }),
|
|
4487
4519
|
K && f && /* @__PURE__ */ i.jsx(
|
|
4488
4520
|
"button",
|
|
4489
4521
|
{
|
|
4490
4522
|
type: "button",
|
|
4491
4523
|
"data-testid": `view-tab-config-${g.id}`,
|
|
4492
4524
|
className: "ml-0.5 h-4 w-4 flex items-center justify-center rounded hover:bg-accent shrink-0 opacity-60 hover:opacity-100 transition-opacity",
|
|
4493
|
-
onClick: (
|
|
4494
|
-
|
|
4525
|
+
onClick: (X) => {
|
|
4526
|
+
X.stopPropagation(), f(g.id);
|
|
4495
4527
|
},
|
|
4496
4528
|
"aria-label": `Configure ${g.label}`,
|
|
4497
4529
|
children: /* @__PURE__ */ i.jsx(Ni, { className: "h-3 w-3" })
|
|
@@ -4499,14 +4531,14 @@ const At = { private: 0, team: 1, organization: 2, public: 3 }, Ps = 5, Ls = ({
|
|
|
4499
4531
|
)
|
|
4500
4532
|
]
|
|
4501
4533
|
}
|
|
4502
|
-
),
|
|
4534
|
+
), Re = (se) => !k || U ? se : /* @__PURE__ */ i.jsxs(Zr, { children: [
|
|
4503
4535
|
/* @__PURE__ */ i.jsx(ei, { asChild: !0, children: se }),
|
|
4504
4536
|
/* @__PURE__ */ i.jsxs(ti, { children: [
|
|
4505
4537
|
l && /* @__PURE__ */ i.jsxs(
|
|
4506
4538
|
qe,
|
|
4507
4539
|
{
|
|
4508
4540
|
"data-testid": `context-menu-rename-${g.id}`,
|
|
4509
|
-
onClick: () =>
|
|
4541
|
+
onClick: () => $(g.id),
|
|
4510
4542
|
children: [
|
|
4511
4543
|
/* @__PURE__ */ i.jsx(ji, { className: "h-4 w-4 mr-2" }),
|
|
4512
4544
|
" Rename"
|
|
@@ -4524,11 +4556,11 @@ const At = { private: 0, team: 1, organization: 2, public: 3 }, Ps = 5, Ls = ({
|
|
|
4524
4556
|
]
|
|
4525
4557
|
}
|
|
4526
4558
|
),
|
|
4527
|
-
|
|
4559
|
+
v && /* @__PURE__ */ i.jsxs(
|
|
4528
4560
|
qe,
|
|
4529
4561
|
{
|
|
4530
4562
|
"data-testid": `context-menu-share-${g.id}`,
|
|
4531
|
-
onClick: () =>
|
|
4563
|
+
onClick: () => v(g.id),
|
|
4532
4564
|
children: [
|
|
4533
4565
|
/* @__PURE__ */ i.jsx(Mt, { className: "h-4 w-4 mr-2" }),
|
|
4534
4566
|
" Share View"
|
|
@@ -4541,16 +4573,16 @@ const At = { private: 0, team: 1, organization: 2, public: 3 }, Ps = 5, Ls = ({
|
|
|
4541
4573
|
"data-testid": `context-menu-default-${g.id}`,
|
|
4542
4574
|
onClick: () => p(g.id),
|
|
4543
4575
|
children: [
|
|
4544
|
-
/* @__PURE__ */ i.jsx(
|
|
4576
|
+
/* @__PURE__ */ i.jsx(Tn, { className: "h-4 w-4 mr-2" }),
|
|
4545
4577
|
" Set as Default"
|
|
4546
4578
|
]
|
|
4547
4579
|
}
|
|
4548
4580
|
),
|
|
4549
|
-
|
|
4581
|
+
w && /* @__PURE__ */ i.jsx(
|
|
4550
4582
|
qe,
|
|
4551
4583
|
{
|
|
4552
4584
|
"data-testid": `context-menu-pin-${g.id}`,
|
|
4553
|
-
onClick: () =>
|
|
4585
|
+
onClick: () => w(g.id, !g.isPinned),
|
|
4554
4586
|
children: g.isPinned ? /* @__PURE__ */ i.jsxs(i.Fragment, { children: [
|
|
4555
4587
|
/* @__PURE__ */ i.jsx(Ci, { className: "h-4 w-4 mr-2" }),
|
|
4556
4588
|
" Unpin View"
|
|
@@ -4561,35 +4593,35 @@ const At = { private: 0, team: 1, organization: 2, public: 3 }, Ps = 5, Ls = ({
|
|
|
4561
4593
|
}
|
|
4562
4594
|
),
|
|
4563
4595
|
S && j && j.length > 0 && /* @__PURE__ */ i.jsxs(i.Fragment, { children: [
|
|
4564
|
-
/* @__PURE__ */ i.jsx(
|
|
4596
|
+
/* @__PURE__ */ i.jsx(En, {}),
|
|
4565
4597
|
/* @__PURE__ */ i.jsxs(ni, { children: [
|
|
4566
4598
|
/* @__PURE__ */ i.jsxs(ri, { "data-testid": `context-menu-change-type-${g.id}`, children: [
|
|
4567
|
-
/* @__PURE__ */ i.jsx(
|
|
4599
|
+
/* @__PURE__ */ i.jsx(ur, { className: "h-4 w-4 mr-2" }),
|
|
4568
4600
|
" Change View Type"
|
|
4569
4601
|
] }),
|
|
4570
|
-
/* @__PURE__ */ i.jsx(ii, { "data-testid": `context-menu-type-submenu-${g.id}`, children: j.map((
|
|
4571
|
-
const Pe = r[
|
|
4602
|
+
/* @__PURE__ */ i.jsx(ii, { "data-testid": `context-menu-type-submenu-${g.id}`, children: j.map((X) => {
|
|
4603
|
+
const Pe = r[X.type] || Y;
|
|
4572
4604
|
return /* @__PURE__ */ i.jsxs(
|
|
4573
4605
|
qe,
|
|
4574
4606
|
{
|
|
4575
|
-
"data-testid": `context-menu-type-${g.id}-${
|
|
4576
|
-
disabled:
|
|
4577
|
-
onClick: () => S(g.id,
|
|
4607
|
+
"data-testid": `context-menu-type-${g.id}-${X.type}`,
|
|
4608
|
+
disabled: X.type === g.type,
|
|
4609
|
+
onClick: () => S(g.id, X.type),
|
|
4578
4610
|
children: [
|
|
4579
4611
|
/* @__PURE__ */ i.jsx(Pe, { className: "h-4 w-4 mr-2" }),
|
|
4580
4612
|
/* @__PURE__ */ i.jsxs("div", { className: "flex flex-col", children: [
|
|
4581
|
-
/* @__PURE__ */ i.jsx("span", { children:
|
|
4582
|
-
|
|
4613
|
+
/* @__PURE__ */ i.jsx("span", { children: X.label }),
|
|
4614
|
+
X.description && /* @__PURE__ */ i.jsx("span", { className: "text-xs text-muted-foreground", children: X.description })
|
|
4583
4615
|
] })
|
|
4584
4616
|
]
|
|
4585
4617
|
},
|
|
4586
|
-
|
|
4618
|
+
X.type
|
|
4587
4619
|
);
|
|
4588
4620
|
}) })
|
|
4589
4621
|
] })
|
|
4590
4622
|
] }),
|
|
4591
4623
|
u && /* @__PURE__ */ i.jsxs(i.Fragment, { children: [
|
|
4592
|
-
/* @__PURE__ */ i.jsx(
|
|
4624
|
+
/* @__PURE__ */ i.jsx(En, {}),
|
|
4593
4625
|
/* @__PURE__ */ i.jsxs(
|
|
4594
4626
|
qe,
|
|
4595
4627
|
{
|
|
@@ -4597,7 +4629,7 @@ const At = { private: 0, team: 1, organization: 2, public: 3 }, Ps = 5, Ls = ({
|
|
|
4597
4629
|
onClick: () => u(g.id),
|
|
4598
4630
|
className: "text-destructive focus:text-destructive",
|
|
4599
4631
|
children: [
|
|
4600
|
-
/* @__PURE__ */ i.jsx(
|
|
4632
|
+
/* @__PURE__ */ i.jsx(dr, { className: "h-4 w-4 mr-2" }),
|
|
4601
4633
|
" Delete View"
|
|
4602
4634
|
]
|
|
4603
4635
|
}
|
|
@@ -4605,22 +4637,22 @@ const At = { private: 0, team: 1, organization: 2, public: 3 }, Ps = 5, Ls = ({
|
|
|
4605
4637
|
] })
|
|
4606
4638
|
] })
|
|
4607
4639
|
] });
|
|
4608
|
-
return x &&
|
|
4640
|
+
return x && b ? /* @__PURE__ */ i.jsxs(ve.Fragment, { children: [
|
|
4609
4641
|
be && /* @__PURE__ */ i.jsx("div", { "data-testid": "view-tab-visibility-separator", className: "w-px h-5 bg-border mx-1 self-center shrink-0" }),
|
|
4610
|
-
/* @__PURE__ */ i.jsx(Ls, { id: g.id, children: ({ setNodeRef: se, style:
|
|
4611
|
-
] }, g.id) : /* @__PURE__ */ i.jsxs(
|
|
4642
|
+
/* @__PURE__ */ i.jsx(Ls, { id: g.id, children: ({ setNodeRef: se, style: X, listeners: Pe, attributes: Je, isDragging: ot }) => /* @__PURE__ */ i.jsx("div", { ref: se, style: X, className: re("flex", ot && "z-10"), children: Re(_e({ listeners: Pe, attributes: Je })) }) })
|
|
4643
|
+
] }, g.id) : /* @__PURE__ */ i.jsxs(ve.Fragment, { children: [
|
|
4612
4644
|
be && /* @__PURE__ */ i.jsx("div", { "data-testid": "view-tab-visibility-separator", className: "w-px h-5 bg-border mx-1 self-center shrink-0" }),
|
|
4613
|
-
|
|
4645
|
+
Re(_e())
|
|
4614
4646
|
] }, g.id);
|
|
4615
|
-
},
|
|
4647
|
+
}, ue = /* @__PURE__ */ i.jsx(i.Fragment, { children: d.map((g, te) => de(g, te)) });
|
|
4616
4648
|
return /* @__PURE__ */ i.jsx(Xr, { children: /* @__PURE__ */ i.jsxs(
|
|
4617
4649
|
"div",
|
|
4618
4650
|
{
|
|
4619
4651
|
"data-testid": "view-tab-bar",
|
|
4620
|
-
className:
|
|
4652
|
+
className: re("flex items-center gap-0.5 -mb-px", C),
|
|
4621
4653
|
children: [
|
|
4622
|
-
x &&
|
|
4623
|
-
|
|
4654
|
+
x && b ? /* @__PURE__ */ i.jsx(gs, { sensors: T, collisionDetection: vo, onDragEnd: ce, children: /* @__PURE__ */ i.jsx(Es, { items: d.map((g) => g.id), strategy: Ds, children: /* @__PURE__ */ i.jsx("div", { "data-testid": "view-tab-sortable-container", className: "flex items-center gap-0.5", children: ue }) }) }) : ue,
|
|
4655
|
+
O.length > 0 && /* @__PURE__ */ i.jsxs(qr, { children: [
|
|
4624
4656
|
/* @__PURE__ */ i.jsx(Kr, { asChild: !0, children: /* @__PURE__ */ i.jsxs(
|
|
4625
4657
|
"button",
|
|
4626
4658
|
{
|
|
@@ -4629,14 +4661,14 @@ const At = { private: 0, team: 1, organization: 2, public: 3 }, Ps = 5, Ls = ({
|
|
|
4629
4661
|
children: [
|
|
4630
4662
|
/* @__PURE__ */ i.jsx(mi, { className: "h-4 w-4" }),
|
|
4631
4663
|
/* @__PURE__ */ i.jsxs("span", { className: "text-xs", children: [
|
|
4632
|
-
|
|
4664
|
+
O.length,
|
|
4633
4665
|
" more"
|
|
4634
4666
|
] })
|
|
4635
4667
|
]
|
|
4636
4668
|
}
|
|
4637
4669
|
) }),
|
|
4638
|
-
/* @__PURE__ */ i.jsx(Jr, { align: "end", children:
|
|
4639
|
-
const te = r[g.type] ||
|
|
4670
|
+
/* @__PURE__ */ i.jsx(Jr, { align: "end", children: O.map((g) => {
|
|
4671
|
+
const te = r[g.type] || Y;
|
|
4640
4672
|
return /* @__PURE__ */ i.jsxs(
|
|
4641
4673
|
Qr,
|
|
4642
4674
|
{
|
|
@@ -4653,8 +4685,8 @@ const At = { private: 0, team: 1, organization: 2, public: 3 }, Ps = 5, Ls = ({
|
|
|
4653
4685
|
);
|
|
4654
4686
|
}) })
|
|
4655
4687
|
] }),
|
|
4656
|
-
|
|
4657
|
-
/* @__PURE__ */ i.jsx(
|
|
4688
|
+
A && s && /* @__PURE__ */ i.jsxs(Nn, { children: [
|
|
4689
|
+
/* @__PURE__ */ i.jsx(Dn, { asChild: !0, children: /* @__PURE__ */ i.jsx(
|
|
4658
4690
|
"button",
|
|
4659
4691
|
{
|
|
4660
4692
|
"data-testid": "view-tab-add",
|
|
@@ -4663,7 +4695,7 @@ const At = { private: 0, team: 1, organization: 2, public: 3 }, Ps = 5, Ls = ({
|
|
|
4663
4695
|
children: /* @__PURE__ */ i.jsx(fn, { className: "h-4 w-4" })
|
|
4664
4696
|
}
|
|
4665
4697
|
) }),
|
|
4666
|
-
/* @__PURE__ */ i.jsx(
|
|
4698
|
+
/* @__PURE__ */ i.jsx(Rn, { children: "Add View" })
|
|
4667
4699
|
] }),
|
|
4668
4700
|
M && N && /* @__PURE__ */ i.jsxs(
|
|
4669
4701
|
"div",
|
|
@@ -4674,7 +4706,7 @@ const At = { private: 0, team: 1, organization: 2, public: 3 }, Ps = 5, Ls = ({
|
|
|
4674
4706
|
/* @__PURE__ */ i.jsx(wi, { className: "h-3.5 w-3.5" }),
|
|
4675
4707
|
/* @__PURE__ */ i.jsx("span", { className: "hidden sm:inline", children: "Unsaved changes" }),
|
|
4676
4708
|
c && /* @__PURE__ */ i.jsx(
|
|
4677
|
-
|
|
4709
|
+
Ce,
|
|
4678
4710
|
{
|
|
4679
4711
|
variant: "ghost",
|
|
4680
4712
|
size: "sm",
|
|
@@ -4684,14 +4716,14 @@ const At = { private: 0, team: 1, organization: 2, public: 3 }, Ps = 5, Ls = ({
|
|
|
4684
4716
|
children: "Save as View"
|
|
4685
4717
|
}
|
|
4686
4718
|
),
|
|
4687
|
-
|
|
4688
|
-
|
|
4719
|
+
m && /* @__PURE__ */ i.jsx(
|
|
4720
|
+
Ce,
|
|
4689
4721
|
{
|
|
4690
4722
|
variant: "ghost",
|
|
4691
4723
|
size: "sm",
|
|
4692
4724
|
"data-testid": "view-tab-reset-btn",
|
|
4693
4725
|
className: "h-6 px-2 text-xs",
|
|
4694
|
-
onClick:
|
|
4726
|
+
onClick: m,
|
|
4695
4727
|
children: "Reset"
|
|
4696
4728
|
}
|
|
4697
4729
|
)
|
|
@@ -4701,18 +4733,18 @@ const At = { private: 0, team: 1, organization: 2, public: 3 }, Ps = 5, Ls = ({
|
|
|
4701
4733
|
]
|
|
4702
4734
|
}
|
|
4703
4735
|
) });
|
|
4704
|
-
}, _s =
|
|
4705
|
-
let
|
|
4736
|
+
}, _s = ve.createContext(null);
|
|
4737
|
+
let kr = _s;
|
|
4706
4738
|
try {
|
|
4707
4739
|
const e = require("@object-ui/react");
|
|
4708
|
-
e.SchemaRendererContext && (
|
|
4740
|
+
e.SchemaRendererContext && (kr = e.SchemaRendererContext);
|
|
4709
4741
|
} catch {
|
|
4710
4742
|
}
|
|
4711
|
-
const
|
|
4712
|
-
const n = Ge(
|
|
4743
|
+
const Vr = ({ schema: e }) => {
|
|
4744
|
+
const n = Ge(kr)?.dataSource ?? null;
|
|
4713
4745
|
return /* @__PURE__ */ i.jsx(zi, { schema: e, dataSource: n });
|
|
4714
4746
|
};
|
|
4715
|
-
Ke.register("object-view",
|
|
4747
|
+
Ke.register("object-view", Vr, {
|
|
4716
4748
|
namespace: "plugin-view",
|
|
4717
4749
|
label: "Object View",
|
|
4718
4750
|
category: "view",
|
|
@@ -4744,12 +4776,12 @@ Ke.register("object-view", kr, {
|
|
|
4744
4776
|
showViewSwitcher: !0
|
|
4745
4777
|
}
|
|
4746
4778
|
});
|
|
4747
|
-
Ke.register("view",
|
|
4779
|
+
Ke.register("view", Vr, {
|
|
4748
4780
|
namespace: "plugin-view",
|
|
4749
4781
|
label: "View",
|
|
4750
4782
|
category: "view"
|
|
4751
4783
|
});
|
|
4752
|
-
Ke.register("view-switcher",
|
|
4784
|
+
Ke.register("view-switcher", hr, {
|
|
4753
4785
|
namespace: "view",
|
|
4754
4786
|
label: "View Switcher",
|
|
4755
4787
|
category: "view",
|
|
@@ -4860,6 +4892,6 @@ export {
|
|
|
4860
4892
|
zi as ObjectView,
|
|
4861
4893
|
qi as SharedViewLink,
|
|
4862
4894
|
Gi as SortUI,
|
|
4863
|
-
|
|
4895
|
+
hr as ViewSwitcher,
|
|
4864
4896
|
qs as ViewTabBar
|
|
4865
4897
|
};
|