@caspeco/casper-ui-library 8.2.2 → 8.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/modal/modal.spec.d.ts +0 -1
- package/dist/components/modal/modal.spec.d.ts.map +1 -1
- package/dist/components/paginator/paginator.composition.d.ts +1 -0
- package/dist/components/paginator/paginator.composition.d.ts.map +1 -1
- package/dist/components/paginator/paginator.d.ts +3 -1
- package/dist/components/paginator/paginator.d.ts.map +1 -1
- package/dist/components/paginator/paginator.js +12 -11
- package/dist/components/table/helper.d.ts +2 -0
- package/dist/components/table/helper.d.ts.map +1 -0
- package/dist/components/table/helper.js +7 -0
- package/dist/components/table/table-content.d.ts.map +1 -1
- package/dist/components/table/table-content.js +93 -80
- package/dist/components/table/table-context-provider.d.ts +10 -2
- package/dist/components/table/table-context-provider.d.ts.map +1 -1
- package/dist/components/table/table-context-provider.js +149 -110
- package/dist/components/table/table-header-row.d.ts.map +1 -1
- package/dist/components/table/table-header-row.js +170 -121
- package/dist/components/table/table-row.js +11 -11
- package/dist/components/table/table.d.ts +1 -1
- package/dist/components/table/table.d.ts.map +1 -1
- package/dist/components/table/table.js +16 -8
- package/dist/components/table/table.spec.d.ts +0 -1
- package/dist/components/table/table.spec.d.ts.map +1 -1
- package/dist/components/table/types.d.ts +21 -0
- package/dist/components/table/types.d.ts.map +1 -1
- package/dist/components/toggle-button/toggle-button.spec.d.ts +0 -1
- package/dist/components/toggle-button/toggle-button.spec.d.ts.map +1 -1
- package/dist/node_modules/@dnd-kit/abstract/index.js +1142 -0
- package/dist/node_modules/@dnd-kit/collision/dist/index.js +91 -0
- package/dist/node_modules/@dnd-kit/dom/index.js +1554 -0
- package/dist/node_modules/@dnd-kit/dom/sortable.js +631 -0
- package/dist/node_modules/@dnd-kit/dom/utilities.js +943 -0
- package/dist/node_modules/@dnd-kit/geometry/dist/index.js +200 -0
- package/dist/node_modules/@dnd-kit/react/hooks.js +69 -0
- package/dist/node_modules/@dnd-kit/react/index.js +235 -0
- package/dist/node_modules/@dnd-kit/react/sortable.js +129 -0
- package/dist/node_modules/@dnd-kit/react/utilities.js +11 -0
- package/dist/node_modules/@dnd-kit/state/dist/index.js +181 -0
- package/dist/node_modules/@preact/signals-core/dist/signals-core.module.js +265 -0
- package/dist/test-utils/hooks/setup-mock-resize-observer.d.ts +1 -1
- package/dist/test-utils/hooks/setup-mock-resize-observer.d.ts.map +1 -1
- package/dist/theme/theme-config/components/paginator-theme.d.ts +5 -19
- package/dist/theme/theme-config/components/paginator-theme.d.ts.map +1 -1
- package/dist/theme/theme-config/components/paginator-theme.js +34 -18
- package/package.json +3 -1
|
@@ -0,0 +1,1554 @@
|
|
|
1
|
+
import { Plugin as ue, DragDropManager as ur, resolveCustomizable as qe, Sensor as Te, ActivationController as hr, CorePlugin as ft, descriptor as fr, Droppable as pr, Draggable as vr, configurator as pt, ActivationConstraint as an } from "../abstract/index.js";
|
|
2
|
+
import { getRoot as $e, generateUniqueId as et, isSafari as mr, scheduler as Me, Listeners as ln, isElement as le, isHTMLElement as cn, getFrameTransform as Ie, getEventCoordinates as ce, getDocuments as gr, getDocument as Ne, scrollIntoViewIfNeeded as br, DOMRectangle as N, canScroll as yr, detectScrollIntent as _r, isKeyboardEvent as vt, isInteractiveElement as wr, isTextInput as Sr, getScrollableAncestors as Ht, ScrollDirection as R, PositionObserver as Er, isDocument as xr, isShadowRoot as kr, getComputedStyles as dn, parseTranslate as un, getFixedPositionOffset as hn, Styles as Ar, supportsPopover as Vt, showPopover as we, getWindow as fn, prefersReducedMotion as pn, getElementFromPoint as Dr, isPointerEvent as Or, getFrameElement as qt, cloneElement as Cr, supportsStyle as Gt, getFinalKeyframe as Pr, animateTransform as Tr, ProxiedElements as Jt } from "./utilities.js";
|
|
3
|
+
import { computed as tt, deepEqual as $r, effects as Mr, reactive as F, derived as Ge } from "../state/dist/index.js";
|
|
4
|
+
import { Axes as vn, Point as Ir, Rectangle as mn, exceedsDistance as nt } from "../geometry/dist/index.js";
|
|
5
|
+
import { defaultCollisionDetection as Rr } from "../collision/dist/index.js";
|
|
6
|
+
import { untracked as M, effect as J, signal as gn, batch as Wr } from "../../@preact/signals-core/dist/signals-core.module.js";
|
|
7
|
+
var Lr = Object.create, mt = Object.defineProperty, Fr = Object.defineProperties, zr = Object.getOwnPropertyDescriptor, Nr = Object.getOwnPropertyDescriptors, Re = Object.getOwnPropertySymbols, bn = Object.prototype.hasOwnProperty, yn = Object.prototype.propertyIsEnumerable, _n = (e, t) => (t = Symbol[e]) ? t : /* @__PURE__ */ Symbol.for("Symbol." + e), he = (e) => {
|
|
8
|
+
throw TypeError(e);
|
|
9
|
+
}, rt = (e, t, n) => t in e ? mt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, Se = (e, t) => {
|
|
10
|
+
for (var n in t || (t = {}))
|
|
11
|
+
bn.call(t, n) && rt(e, n, t[n]);
|
|
12
|
+
if (Re)
|
|
13
|
+
for (var n of Re(t))
|
|
14
|
+
yn.call(t, n) && rt(e, n, t[n]);
|
|
15
|
+
return e;
|
|
16
|
+
}, gt = (e, t) => Fr(e, Nr(t)), Qt = (e, t) => mt(e, "name", { value: t, configurable: !0 }), wn = (e, t) => {
|
|
17
|
+
var n = {};
|
|
18
|
+
for (var r in e)
|
|
19
|
+
bn.call(e, r) && t.indexOf(r) < 0 && (n[r] = e[r]);
|
|
20
|
+
if (e != null && Re)
|
|
21
|
+
for (var r of Re(e))
|
|
22
|
+
t.indexOf(r) < 0 && yn.call(e, r) && (n[r] = e[r]);
|
|
23
|
+
return n;
|
|
24
|
+
}, fe = (e) => {
|
|
25
|
+
var t;
|
|
26
|
+
return [, , , Lr((t = e?.[_n("metadata")]) != null ? t : null)];
|
|
27
|
+
}, Sn = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"], me = (e) => e !== void 0 && typeof e != "function" ? he("Function expected") : e, Kr = (e, t, n, r, i) => ({ kind: Sn[e], name: t, metadata: r, addInitializer: (s) => n._ ? he("Already initialized") : i.push(me(s || null)) }), Q = (e, t) => rt(t, _n("metadata"), e[3]), x = (e, t, n, r) => {
|
|
28
|
+
for (var i = 0, s = e[t >> 1], o = s && s.length; i < o; i++) t & 1 ? s[i].call(n) : r = s[i].call(n, r);
|
|
29
|
+
return r;
|
|
30
|
+
}, $ = (e, t, n, r, i, s) => {
|
|
31
|
+
var o, a, l, f, d, c = t & 7, h = !!(t & 8), u = !!(t & 16), p = c > 3 ? e.length + 1 : c ? h ? 1 : 2 : 0, w = Sn[c + 5], k = c > 3 && (e[p - 1] = []), C = e[p] || (e[p] = []), b = c && (!u && !h && (i = i.prototype), c < 5 && (c > 3 || !u) && zr(c < 4 ? i : { get [n]() {
|
|
32
|
+
return y(this, s);
|
|
33
|
+
}, set [n](m) {
|
|
34
|
+
return O(this, s, m);
|
|
35
|
+
} }, n));
|
|
36
|
+
c ? u && c < 4 && Qt(s, (c > 2 ? "set " : c > 1 ? "get " : "") + n) : Qt(i, n);
|
|
37
|
+
for (var g = r.length - 1; g >= 0; g--)
|
|
38
|
+
f = Kr(c, n, l = {}, e[3], C), c && (f.static = h, f.private = u, d = f.access = { has: u ? (m) => Ur(i, m) : (m) => n in m }, c ^ 3 && (d.get = u ? (m) => (c ^ 1 ? y : G)(m, i, c ^ 4 ? s : b.get) : (m) => m[n]), c > 2 && (d.set = u ? (m, v) => O(m, i, v, c ^ 4 ? s : b.set) : (m, v) => m[n] = v)), a = (0, r[g])(c ? c < 4 ? u ? s : b[w] : c > 4 ? void 0 : { get: b.get, set: b.set } : i, f), l._ = 1, c ^ 4 || a === void 0 ? me(a) && (c > 4 ? k.unshift(a) : c ? u ? s = a : b[w] = a : i = a) : typeof a != "object" || a === null ? he("Object expected") : (me(o = a.get) && (b.get = o), me(o = a.set) && (b.set = o), me(o = a.init) && k.unshift(o));
|
|
39
|
+
return c || Q(e, i), b && mt(i, n, b), u ? c ^ 4 ? s : b : i;
|
|
40
|
+
}, bt = (e, t, n) => t.has(e) || he("Cannot " + n), Ur = (e, t) => Object(t) !== t ? he('Cannot use the "in" operator on this value') : e.has(t), y = (e, t, n) => (bt(e, t, "read from private field"), n ? n.call(e) : t.get(e)), E = (e, t, n) => t.has(e) ? he("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, n), O = (e, t, n, r) => (bt(e, t, "write to private field"), r ? r.call(e, n) : t.set(e, n), n), G = (e, t, n) => (bt(e, t, "access private method"), n), Zt = {
|
|
41
|
+
role: "button",
|
|
42
|
+
roleDescription: "draggable"
|
|
43
|
+
}, Xr = "dnd-kit-description", Yr = "dnd-kit-announcement", jr = {
|
|
44
|
+
draggable: "To pick up a draggable item, press the space bar. While dragging, use the arrow keys to move the item in a given direction. Press space again to drop the item in its new position, or press escape to cancel."
|
|
45
|
+
}, Br = {
|
|
46
|
+
dragstart({ operation: { source: e } }) {
|
|
47
|
+
if (e)
|
|
48
|
+
return `Picked up draggable item ${e.id}.`;
|
|
49
|
+
},
|
|
50
|
+
dragover({ operation: { source: e, target: t } }) {
|
|
51
|
+
if (!(!e || e.id === t?.id))
|
|
52
|
+
return t ? `Draggable item ${e.id} was moved over droppable target ${t.id}.` : `Draggable item ${e.id} is no longer over a droppable target.`;
|
|
53
|
+
},
|
|
54
|
+
dragend({ operation: { source: e, target: t }, canceled: n }) {
|
|
55
|
+
if (e)
|
|
56
|
+
return n ? `Dragging was cancelled. Draggable item ${e.id} was dropped.` : t ? `Draggable item ${e.id} was dropped over droppable target ${t.id}` : `Draggable item ${e.id} was dropped.`;
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
function Hr(e) {
|
|
60
|
+
const t = e.tagName.toLowerCase();
|
|
61
|
+
return ["input", "select", "textarea", "a", "button"].includes(t);
|
|
62
|
+
}
|
|
63
|
+
function Vr(e, t) {
|
|
64
|
+
const n = document.createElement("div");
|
|
65
|
+
return n.id = e, n.style.setProperty("display", "none"), n.textContent = t, n;
|
|
66
|
+
}
|
|
67
|
+
function qr(e) {
|
|
68
|
+
const t = document.createElement("div");
|
|
69
|
+
return t.id = e, t.setAttribute("role", "status"), t.setAttribute("aria-live", "polite"), t.setAttribute("aria-atomic", "true"), t.style.setProperty("position", "fixed"), t.style.setProperty("width", "1px"), t.style.setProperty("height", "1px"), t.style.setProperty("margin", "-1px"), t.style.setProperty("border", "0"), t.style.setProperty("padding", "0"), t.style.setProperty("overflow", "hidden"), t.style.setProperty("clip", "rect(0 0 0 0)"), t.style.setProperty("clip-path", "inset(100%)"), t.style.setProperty("white-space", "nowrap"), t;
|
|
70
|
+
}
|
|
71
|
+
var Gr = ["dragover", "dragmove"], Jr = class extends ue {
|
|
72
|
+
constructor(e, t) {
|
|
73
|
+
super(e);
|
|
74
|
+
const {
|
|
75
|
+
id: n,
|
|
76
|
+
idPrefix: {
|
|
77
|
+
description: r = Xr,
|
|
78
|
+
announcement: i = Yr
|
|
79
|
+
} = {},
|
|
80
|
+
announcements: s = Br,
|
|
81
|
+
screenReaderInstructions: o = jr,
|
|
82
|
+
debounce: a = 500
|
|
83
|
+
} = t ?? {}, l = n ? `${r}-${n}` : et(r), f = n ? `${i}-${n}` : et(i);
|
|
84
|
+
let d, c, h, u;
|
|
85
|
+
const p = (v = u) => {
|
|
86
|
+
!h || !v || h?.nodeValue !== v && (h.nodeValue = v);
|
|
87
|
+
}, w = () => Me.schedule(p), k = Qr(
|
|
88
|
+
w,
|
|
89
|
+
a
|
|
90
|
+
), C = Object.entries(s).map(
|
|
91
|
+
([v, P]) => this.manager.monitor.addEventListener(
|
|
92
|
+
v,
|
|
93
|
+
(S, z) => {
|
|
94
|
+
const U = h;
|
|
95
|
+
if (!U) return;
|
|
96
|
+
const X = P?.(S, z);
|
|
97
|
+
X && U.nodeValue !== X && (u = X, Gr.includes(v) ? k() : (w(), k.cancel()));
|
|
98
|
+
}
|
|
99
|
+
)
|
|
100
|
+
), b = () => {
|
|
101
|
+
let v = [];
|
|
102
|
+
d?.isConnected || (d = Vr(
|
|
103
|
+
l,
|
|
104
|
+
o.draggable
|
|
105
|
+
), v.push(d)), c?.isConnected || (c = qr(f), h = document.createTextNode(""), c.appendChild(h), v.push(c)), v.length > 0 && document.body.append(...v);
|
|
106
|
+
}, g = /* @__PURE__ */ new Set();
|
|
107
|
+
function m() {
|
|
108
|
+
for (const v of g)
|
|
109
|
+
v();
|
|
110
|
+
}
|
|
111
|
+
this.registerEffect(() => {
|
|
112
|
+
var v;
|
|
113
|
+
g.clear();
|
|
114
|
+
for (const P of this.manager.registry.draggables.value) {
|
|
115
|
+
const S = (v = P.handle) != null ? v : P.element;
|
|
116
|
+
if (S) {
|
|
117
|
+
(!d || !c) && g.add(b), (!Hr(S) || mr()) && !S.hasAttribute("tabindex") && g.add(() => S.setAttribute("tabindex", "0")), !S.hasAttribute("role") && S.tagName.toLowerCase() !== "button" && g.add(
|
|
118
|
+
() => S.setAttribute("role", Zt.role)
|
|
119
|
+
), S.hasAttribute("aria-roledescription") || g.add(
|
|
120
|
+
() => S.setAttribute(
|
|
121
|
+
"aria-roledescription",
|
|
122
|
+
Zt.roleDescription
|
|
123
|
+
)
|
|
124
|
+
), S.hasAttribute("aria-describedby") || g.add(
|
|
125
|
+
() => S.setAttribute("aria-describedby", l)
|
|
126
|
+
);
|
|
127
|
+
for (const U of ["aria-pressed", "aria-grabbed"]) {
|
|
128
|
+
const X = String(P.isDragging);
|
|
129
|
+
S.getAttribute(U) !== X && g.add(() => S.setAttribute(U, X));
|
|
130
|
+
}
|
|
131
|
+
const z = String(P.disabled);
|
|
132
|
+
S.getAttribute("aria-disabled") !== z && g.add(
|
|
133
|
+
() => S.setAttribute("aria-disabled", z)
|
|
134
|
+
);
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
g.size > 0 && Me.schedule(m);
|
|
138
|
+
}), this.destroy = () => {
|
|
139
|
+
super.destroy(), d?.remove(), c?.remove(), C.forEach((v) => v());
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
};
|
|
143
|
+
function Qr(e, t) {
|
|
144
|
+
let n;
|
|
145
|
+
const r = () => {
|
|
146
|
+
clearTimeout(n), n = setTimeout(e, t);
|
|
147
|
+
};
|
|
148
|
+
return r.cancel = () => clearTimeout(n), r;
|
|
149
|
+
}
|
|
150
|
+
var Zr = class extends ue {
|
|
151
|
+
constructor(e, t) {
|
|
152
|
+
super(e, t), this.manager = e;
|
|
153
|
+
const n = tt(
|
|
154
|
+
() => {
|
|
155
|
+
var r;
|
|
156
|
+
return Ne((r = this.manager.dragOperation.source) == null ? void 0 : r.element);
|
|
157
|
+
}
|
|
158
|
+
);
|
|
159
|
+
this.destroy = J(() => {
|
|
160
|
+
var r;
|
|
161
|
+
const { dragOperation: i } = this.manager, { cursor: s = "grabbing", nonce: o } = (r = this.options) != null ? r : {};
|
|
162
|
+
if (i.status.initialized) {
|
|
163
|
+
const a = n.value, l = a.createElement("style");
|
|
164
|
+
return o && l.setAttribute("nonce", o), l.textContent = `* { cursor: ${s} !important; }`, a.head.appendChild(l), () => l.remove();
|
|
165
|
+
}
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
}, We = /* @__PURE__ */ new Map(), En, xn, kn, An, it, ye, K, yt, de, Dn, On, Cn, Pn, Z = class extends (it = ft, An = [F], kn = [Ge], xn = [Ge], En = [Ge], it) {
|
|
169
|
+
constructor(e) {
|
|
170
|
+
super(e), x(K, 5, this), E(this, de), E(this, ye, /* @__PURE__ */ new Set()), E(this, yt, x(K, 8, this, /* @__PURE__ */ new Set())), x(K, 11, this), this.registerEffect(G(this, de, Dn));
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* Registers CSS rules to be injected into the active drag operation's
|
|
174
|
+
* document and shadow roots. The StyleSheetManager handles tracking
|
|
175
|
+
* which roots need the styles and cleaning up when they're no longer needed.
|
|
176
|
+
*
|
|
177
|
+
* Returns a cleanup function that unregisters the rules.
|
|
178
|
+
*/
|
|
179
|
+
register(e) {
|
|
180
|
+
return y(this, ye).add(e), () => {
|
|
181
|
+
y(this, ye).delete(e);
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
/**
|
|
185
|
+
* Adds an additional root to track for style injection.
|
|
186
|
+
* Returns a cleanup function that removes the root.
|
|
187
|
+
*/
|
|
188
|
+
addRoot(e) {
|
|
189
|
+
return M(() => {
|
|
190
|
+
const t = new Set(this.additionalRoots);
|
|
191
|
+
t.add(e), this.additionalRoots = t;
|
|
192
|
+
}), () => {
|
|
193
|
+
M(() => {
|
|
194
|
+
const t = new Set(this.additionalRoots);
|
|
195
|
+
t.delete(e), this.additionalRoots = t;
|
|
196
|
+
});
|
|
197
|
+
};
|
|
198
|
+
}
|
|
199
|
+
get sourceRoot() {
|
|
200
|
+
var e;
|
|
201
|
+
const { source: t } = this.manager.dragOperation;
|
|
202
|
+
return $e((e = t?.element) != null ? e : null);
|
|
203
|
+
}
|
|
204
|
+
get targetRoot() {
|
|
205
|
+
var e;
|
|
206
|
+
const { target: t } = this.manager.dragOperation;
|
|
207
|
+
return $e((e = t?.element) != null ? e : null);
|
|
208
|
+
}
|
|
209
|
+
get roots() {
|
|
210
|
+
const { status: e } = this.manager.dragOperation;
|
|
211
|
+
if (e.initializing || e.initialized) {
|
|
212
|
+
const t = [this.sourceRoot, this.targetRoot].filter(
|
|
213
|
+
(n) => n != null
|
|
214
|
+
);
|
|
215
|
+
return /* @__PURE__ */ new Set([...t, ...this.additionalRoots]);
|
|
216
|
+
}
|
|
217
|
+
return /* @__PURE__ */ new Set();
|
|
218
|
+
}
|
|
219
|
+
};
|
|
220
|
+
K = fe(it);
|
|
221
|
+
ye = /* @__PURE__ */ new WeakMap();
|
|
222
|
+
yt = /* @__PURE__ */ new WeakMap();
|
|
223
|
+
de = /* @__PURE__ */ new WeakSet();
|
|
224
|
+
Dn = function() {
|
|
225
|
+
const { roots: e } = this, t = [];
|
|
226
|
+
for (const n of e)
|
|
227
|
+
for (const r of y(this, ye))
|
|
228
|
+
t.push(G(this, de, On).call(this, n, r));
|
|
229
|
+
return () => {
|
|
230
|
+
for (const n of t)
|
|
231
|
+
n();
|
|
232
|
+
};
|
|
233
|
+
};
|
|
234
|
+
On = function(e, t) {
|
|
235
|
+
let n = We.get(e);
|
|
236
|
+
n || (n = /* @__PURE__ */ new Map(), We.set(e, n));
|
|
237
|
+
let r = n.get(t);
|
|
238
|
+
if (!r) {
|
|
239
|
+
const s = xr(e) ? G(this, de, Cn).call(this, e, n, t) : G(this, de, Pn).call(this, e, n, t);
|
|
240
|
+
if (!s)
|
|
241
|
+
return () => {
|
|
242
|
+
};
|
|
243
|
+
r = s, n.set(t, r);
|
|
244
|
+
}
|
|
245
|
+
r.refCount++;
|
|
246
|
+
let i = !1;
|
|
247
|
+
return () => {
|
|
248
|
+
i || (i = !0, r.refCount--, r.refCount === 0 && r.cleanup());
|
|
249
|
+
};
|
|
250
|
+
};
|
|
251
|
+
Cn = function(e, t, n) {
|
|
252
|
+
const r = e.createElement("style");
|
|
253
|
+
r.textContent = n, e.head.prepend(r);
|
|
254
|
+
const i = new MutationObserver((s) => {
|
|
255
|
+
for (const o of s)
|
|
256
|
+
for (const a of Array.from(o.removedNodes))
|
|
257
|
+
if (a === r) {
|
|
258
|
+
e.head.prepend(r);
|
|
259
|
+
return;
|
|
260
|
+
}
|
|
261
|
+
});
|
|
262
|
+
return i.observe(e.head, { childList: !0 }), {
|
|
263
|
+
refCount: 0,
|
|
264
|
+
cleanup: () => {
|
|
265
|
+
i.disconnect(), r.remove(), t.delete(n), t.size === 0 && We.delete(e);
|
|
266
|
+
}
|
|
267
|
+
};
|
|
268
|
+
};
|
|
269
|
+
Pn = function(e, t, n) {
|
|
270
|
+
!("adoptedStyleSheets" in e && Array.isArray(e.adoptedStyleSheets)) && process.env.NODE_ENV !== "production" && console.error(
|
|
271
|
+
"Cannot inject styles: This browser doesn't support adoptedStyleSheets"
|
|
272
|
+
);
|
|
273
|
+
const r = e.ownerDocument.defaultView, { CSSStyleSheet: i } = r ?? {};
|
|
274
|
+
if (!i)
|
|
275
|
+
return process.env.NODE_ENV !== "production" && console.error(
|
|
276
|
+
"Cannot inject styles: CSSStyleSheet constructor not available"
|
|
277
|
+
), null;
|
|
278
|
+
const s = new i();
|
|
279
|
+
return s.replaceSync(n), e.adoptedStyleSheets.push(s), {
|
|
280
|
+
refCount: 0,
|
|
281
|
+
cleanup: () => {
|
|
282
|
+
var o;
|
|
283
|
+
if (kr(e) && ((o = e.host) != null && o.isConnected)) {
|
|
284
|
+
const a = e.adoptedStyleSheets.indexOf(s);
|
|
285
|
+
a !== -1 && e.adoptedStyleSheets.splice(a, 1);
|
|
286
|
+
}
|
|
287
|
+
t.delete(n), t.size === 0 && We.delete(e);
|
|
288
|
+
}
|
|
289
|
+
};
|
|
290
|
+
};
|
|
291
|
+
$(K, 4, "additionalRoots", An, Z, yt);
|
|
292
|
+
$(K, 2, "sourceRoot", kn, Z);
|
|
293
|
+
$(K, 2, "targetRoot", xn, Z);
|
|
294
|
+
$(K, 2, "roots", En, Z);
|
|
295
|
+
Q(K, Z);
|
|
296
|
+
var De = "data-dnd-", st = `${De}dropping`, D = "--dnd-", L = `${De}dragging`, Le = `${De}placeholder`, ei = [
|
|
297
|
+
L,
|
|
298
|
+
Le,
|
|
299
|
+
"popover",
|
|
300
|
+
"aria-pressed",
|
|
301
|
+
"aria-grabbing"
|
|
302
|
+
], ti = ["view-transition-name"], ni = `
|
|
303
|
+
:is(:root,:host) [${L}] {
|
|
304
|
+
position: fixed !important;
|
|
305
|
+
pointer-events: none !important;
|
|
306
|
+
touch-action: none;
|
|
307
|
+
z-index: calc(infinity);
|
|
308
|
+
will-change: translate;
|
|
309
|
+
top: var(${D}top, 0px) !important;
|
|
310
|
+
left: var(${D}left, 0px) !important;
|
|
311
|
+
right: unset !important;
|
|
312
|
+
bottom: unset !important;
|
|
313
|
+
width: var(${D}width, auto);
|
|
314
|
+
max-width: var(${D}width, auto);
|
|
315
|
+
height: var(${D}height, auto);
|
|
316
|
+
max-height: var(${D}height, auto);
|
|
317
|
+
transition: var(${D}transition) !important;
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
:is(:root,:host) [${Le}] {
|
|
321
|
+
transition: none;
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
:is(:root,:host) [${Le}='hidden'] {
|
|
325
|
+
visibility: hidden;
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
[${L}] * {
|
|
329
|
+
pointer-events: none !important;
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
[${L}]:not([${st}]) {
|
|
333
|
+
translate: var(${D}translate) !important;
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
[${L}][style*='${D}scale'] {
|
|
337
|
+
scale: var(${D}scale) !important;
|
|
338
|
+
transform-origin: var(${D}transform-origin) !important;
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
@layer dnd-kit {
|
|
342
|
+
:where([${L}][popover]) {
|
|
343
|
+
overflow: visible;
|
|
344
|
+
background: unset;
|
|
345
|
+
border: unset;
|
|
346
|
+
margin: unset;
|
|
347
|
+
padding: unset;
|
|
348
|
+
color: inherit;
|
|
349
|
+
|
|
350
|
+
&:is(input, button) {
|
|
351
|
+
border: revert;
|
|
352
|
+
background: revert;
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
[${L}]::backdrop, [${De}overlay]:not([${L}]) {
|
|
357
|
+
display: none;
|
|
358
|
+
visibility: hidden;
|
|
359
|
+
}
|
|
360
|
+
`.replace(/\n+/g, " ").replace(/\s+/g, " ").trim();
|
|
361
|
+
function ri(e, t = "hidden") {
|
|
362
|
+
return M(() => {
|
|
363
|
+
const { element: n, manager: r } = e;
|
|
364
|
+
if (!n || !r) return;
|
|
365
|
+
const i = ii(
|
|
366
|
+
n,
|
|
367
|
+
r.registry.droppables
|
|
368
|
+
), s = [], o = Cr(n), { remove: a } = o;
|
|
369
|
+
return si(i, o, s), oi(o, t), o.remove = () => {
|
|
370
|
+
s.forEach((l) => l()), a.call(o);
|
|
371
|
+
}, o;
|
|
372
|
+
});
|
|
373
|
+
}
|
|
374
|
+
function ii(e, t) {
|
|
375
|
+
const n = /* @__PURE__ */ new Map();
|
|
376
|
+
for (const r of t)
|
|
377
|
+
if (r.element && (e === r.element || e.contains(r.element))) {
|
|
378
|
+
const i = `${De}${et("dom-id")}`;
|
|
379
|
+
r.element.setAttribute(i, ""), n.set(r, i);
|
|
380
|
+
}
|
|
381
|
+
return n;
|
|
382
|
+
}
|
|
383
|
+
function si(e, t, n) {
|
|
384
|
+
for (const [r, i] of e) {
|
|
385
|
+
if (!r.element) continue;
|
|
386
|
+
const s = `[${i}]`, o = t.matches(s) ? t : t.querySelector(s);
|
|
387
|
+
if (r.element.removeAttribute(i), !o) continue;
|
|
388
|
+
const a = r.element;
|
|
389
|
+
r.proxy = o, o.removeAttribute(i), Jt.set(a, o), n.push(() => {
|
|
390
|
+
Jt.delete(a), r.proxy = void 0;
|
|
391
|
+
});
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
function oi(e, t = "hidden") {
|
|
395
|
+
e.setAttribute("inert", "true"), e.setAttribute("tab-index", "-1"), e.setAttribute("aria-hidden", "true"), e.setAttribute(Le, t);
|
|
396
|
+
}
|
|
397
|
+
function Tn(e, t) {
|
|
398
|
+
return e === t ? !0 : qt(e) === qt(t);
|
|
399
|
+
}
|
|
400
|
+
function en(e) {
|
|
401
|
+
const { target: t } = e;
|
|
402
|
+
"newState" in e && e.newState === "closed" && le(t) && t.hasAttribute("popover") && requestAnimationFrame(() => we(t));
|
|
403
|
+
}
|
|
404
|
+
function ot(e) {
|
|
405
|
+
return e.tagName === "TR";
|
|
406
|
+
}
|
|
407
|
+
function ai(e, t, n) {
|
|
408
|
+
const r = new MutationObserver((i) => {
|
|
409
|
+
let s = !1;
|
|
410
|
+
for (const o of i) {
|
|
411
|
+
if (o.target !== e) {
|
|
412
|
+
s = !0;
|
|
413
|
+
continue;
|
|
414
|
+
}
|
|
415
|
+
if (o.type !== "attributes")
|
|
416
|
+
continue;
|
|
417
|
+
const a = o.attributeName;
|
|
418
|
+
if (a.startsWith("aria-") || ei.includes(a))
|
|
419
|
+
continue;
|
|
420
|
+
const l = e.getAttribute(a);
|
|
421
|
+
if (a === "style") {
|
|
422
|
+
if (Gt(e) && Gt(t)) {
|
|
423
|
+
const f = e.style;
|
|
424
|
+
for (const d of Array.from(t.style))
|
|
425
|
+
f.getPropertyValue(d) === "" && t.style.removeProperty(d);
|
|
426
|
+
for (const d of Array.from(f)) {
|
|
427
|
+
if (ti.includes(d) || d.startsWith(D))
|
|
428
|
+
continue;
|
|
429
|
+
const c = f.getPropertyValue(d);
|
|
430
|
+
t.style.setProperty(d, c);
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
} else l !== null ? t.setAttribute(a, l) : t.removeAttribute(a);
|
|
434
|
+
}
|
|
435
|
+
s && n && (t.innerHTML = e.innerHTML);
|
|
436
|
+
});
|
|
437
|
+
return r.observe(e, {
|
|
438
|
+
attributes: !0,
|
|
439
|
+
subtree: !0,
|
|
440
|
+
childList: !0
|
|
441
|
+
}), r;
|
|
442
|
+
}
|
|
443
|
+
function li(e, t, n) {
|
|
444
|
+
const r = new MutationObserver((i) => {
|
|
445
|
+
for (const s of i)
|
|
446
|
+
if (s.addedNodes.length !== 0)
|
|
447
|
+
for (const o of Array.from(s.addedNodes)) {
|
|
448
|
+
if (o.contains(e) && e.nextElementSibling !== t) {
|
|
449
|
+
e.insertAdjacentElement("afterend", t), we(n);
|
|
450
|
+
return;
|
|
451
|
+
}
|
|
452
|
+
if (o.contains(t) && t.previousElementSibling !== e) {
|
|
453
|
+
t.insertAdjacentElement("beforebegin", e), we(n);
|
|
454
|
+
return;
|
|
455
|
+
}
|
|
456
|
+
}
|
|
457
|
+
});
|
|
458
|
+
return r.observe(e.ownerDocument.body, {
|
|
459
|
+
childList: !0,
|
|
460
|
+
subtree: !0
|
|
461
|
+
}), r;
|
|
462
|
+
}
|
|
463
|
+
function ci(e) {
|
|
464
|
+
return new ResizeObserver(() => {
|
|
465
|
+
var t, n;
|
|
466
|
+
const r = new N(e.placeholder, {
|
|
467
|
+
frameTransform: e.frameTransform,
|
|
468
|
+
ignoreTransforms: !0
|
|
469
|
+
}), i = (t = e.transformOrigin) != null ? t : { x: 1, y: 1 }, s = (e.width - r.width) * i.x + e.delta.x, o = (e.height - r.height) * i.y + e.delta.y, a = hn();
|
|
470
|
+
if (e.styles.set(
|
|
471
|
+
{
|
|
472
|
+
width: r.width - e.widthOffset,
|
|
473
|
+
height: r.height - e.heightOffset,
|
|
474
|
+
top: e.top + o + a.y,
|
|
475
|
+
left: e.left + s + a.x
|
|
476
|
+
},
|
|
477
|
+
D
|
|
478
|
+
), (n = e.getElementMutationObserver()) == null || n.takeRecords(), ot(e.element) && ot(e.placeholder)) {
|
|
479
|
+
const l = Array.from(e.element.cells), f = Array.from(e.placeholder.cells);
|
|
480
|
+
e.getSavedCellWidths() || e.setSavedCellWidths(l.map((d) => d.style.width));
|
|
481
|
+
for (const [d, c] of l.entries()) {
|
|
482
|
+
const h = f[d];
|
|
483
|
+
c.style.width = `${h.getBoundingClientRect().width}px`;
|
|
484
|
+
}
|
|
485
|
+
}
|
|
486
|
+
e.dragOperation.shape = new N(e.feedbackElement);
|
|
487
|
+
});
|
|
488
|
+
}
|
|
489
|
+
var di = 250, ui = "ease";
|
|
490
|
+
function hi(e) {
|
|
491
|
+
var t, n, r, i;
|
|
492
|
+
const { animation: s } = e;
|
|
493
|
+
if (typeof s == "function") {
|
|
494
|
+
const b = s({
|
|
495
|
+
element: e.element,
|
|
496
|
+
feedbackElement: e.feedbackElement,
|
|
497
|
+
placeholder: e.placeholder,
|
|
498
|
+
translate: e.translate,
|
|
499
|
+
moved: e.moved
|
|
500
|
+
});
|
|
501
|
+
Promise.resolve(b).then(() => {
|
|
502
|
+
e.cleanup(), requestAnimationFrame(e.restoreFocus);
|
|
503
|
+
});
|
|
504
|
+
return;
|
|
505
|
+
}
|
|
506
|
+
const {
|
|
507
|
+
duration: o = di,
|
|
508
|
+
easing: a = ui
|
|
509
|
+
} = s ?? {};
|
|
510
|
+
we(e.feedbackElement);
|
|
511
|
+
const [, l] = (t = Pr(
|
|
512
|
+
e.feedbackElement,
|
|
513
|
+
(b) => "translate" in b
|
|
514
|
+
)) != null ? t : [];
|
|
515
|
+
l?.pause();
|
|
516
|
+
const f = (n = e.placeholder) != null ? n : e.element, d = {
|
|
517
|
+
frameTransform: Tn(e.feedbackElement, f) ? null : void 0
|
|
518
|
+
}, c = new N(e.feedbackElement, d), h = (r = un(dn(e.feedbackElement).translate)) != null ? r : e.translate, u = new N(f, d), p = mn.delta(c, u, e.alignment), w = {
|
|
519
|
+
x: h.x - p.x,
|
|
520
|
+
y: h.y - p.y
|
|
521
|
+
}, k = Math.round(c.intrinsicHeight) !== Math.round(u.intrinsicHeight) ? {
|
|
522
|
+
minHeight: [
|
|
523
|
+
`${c.intrinsicHeight}px`,
|
|
524
|
+
`${u.intrinsicHeight}px`
|
|
525
|
+
],
|
|
526
|
+
maxHeight: [
|
|
527
|
+
`${c.intrinsicHeight}px`,
|
|
528
|
+
`${u.intrinsicHeight}px`
|
|
529
|
+
]
|
|
530
|
+
} : {}, C = Math.round(c.intrinsicWidth) !== Math.round(u.intrinsicWidth) ? {
|
|
531
|
+
minWidth: [
|
|
532
|
+
`${c.intrinsicWidth}px`,
|
|
533
|
+
`${u.intrinsicWidth}px`
|
|
534
|
+
],
|
|
535
|
+
maxWidth: [
|
|
536
|
+
`${c.intrinsicWidth}px`,
|
|
537
|
+
`${u.intrinsicWidth}px`
|
|
538
|
+
]
|
|
539
|
+
} : {};
|
|
540
|
+
e.styles.set({ transition: e.transition }, D), e.feedbackElement.setAttribute(st, ""), (i = e.getElementMutationObserver()) == null || i.takeRecords(), Tr({
|
|
541
|
+
element: e.feedbackElement,
|
|
542
|
+
keyframes: gt(Se(Se({}, k), C), {
|
|
543
|
+
translate: [
|
|
544
|
+
`${h.x}px ${h.y}px 0`,
|
|
545
|
+
`${w.x}px ${w.y}px 0`
|
|
546
|
+
]
|
|
547
|
+
}),
|
|
548
|
+
options: {
|
|
549
|
+
duration: pn(fn(e.feedbackElement)) ? 0 : e.moved || e.feedbackElement !== e.element ? o : 0,
|
|
550
|
+
easing: a
|
|
551
|
+
}
|
|
552
|
+
}).then(() => {
|
|
553
|
+
e.feedbackElement.removeAttribute(st), l?.finish(), e.cleanup(), requestAnimationFrame(e.restoreFocus);
|
|
554
|
+
});
|
|
555
|
+
}
|
|
556
|
+
var $n, at, Ee, _t, Pe, Mn, In, xe = class extends (at = ue, $n = [F], at) {
|
|
557
|
+
constructor(t, n) {
|
|
558
|
+
super(t, n), E(this, Pe), E(this, _t, x(Ee, 8, this)), x(Ee, 11, this), this.state = {
|
|
559
|
+
initial: {},
|
|
560
|
+
current: {}
|
|
561
|
+
};
|
|
562
|
+
const r = t.registry.plugins.get(
|
|
563
|
+
Z
|
|
564
|
+
), i = r?.register(ni);
|
|
565
|
+
if (i) {
|
|
566
|
+
const s = this.destroy.bind(this);
|
|
567
|
+
this.destroy = () => {
|
|
568
|
+
i(), s();
|
|
569
|
+
};
|
|
570
|
+
}
|
|
571
|
+
this.registerEffect(G(this, Pe, Mn).bind(this, r)), this.registerEffect(G(this, Pe, In));
|
|
572
|
+
}
|
|
573
|
+
};
|
|
574
|
+
Ee = fe(at);
|
|
575
|
+
_t = /* @__PURE__ */ new WeakMap();
|
|
576
|
+
Pe = /* @__PURE__ */ new WeakSet();
|
|
577
|
+
Mn = function(e) {
|
|
578
|
+
const { overlay: t } = this;
|
|
579
|
+
if (!t || !e) return;
|
|
580
|
+
const n = $e(t);
|
|
581
|
+
if (n)
|
|
582
|
+
return e.addRoot(n);
|
|
583
|
+
};
|
|
584
|
+
In = function() {
|
|
585
|
+
var e, t, n;
|
|
586
|
+
const { state: r, manager: i, options: s } = this, { dragOperation: o } = i, { position: a, source: l, status: f } = o;
|
|
587
|
+
if (f.idle) {
|
|
588
|
+
r.current = {}, r.initial = {};
|
|
589
|
+
return;
|
|
590
|
+
}
|
|
591
|
+
if (!l) return;
|
|
592
|
+
const { element: d, feedback: c } = l;
|
|
593
|
+
if (!d || c === "none" || !f.initialized || f.initializing)
|
|
594
|
+
return;
|
|
595
|
+
const { initial: h } = r, u = (e = this.overlay) != null ? e : d, p = Ie(u), w = Ie(d), k = !Tn(d, u), C = new N(d, {
|
|
596
|
+
frameTransform: k ? w : null,
|
|
597
|
+
ignoreTransforms: !k
|
|
598
|
+
}), b = {
|
|
599
|
+
x: w.scaleX / p.scaleX,
|
|
600
|
+
y: w.scaleY / p.scaleY
|
|
601
|
+
};
|
|
602
|
+
let { width: g, height: m, top: v, left: P } = C;
|
|
603
|
+
k && (g = g / b.x, m = m / b.y);
|
|
604
|
+
const S = new Ar(u), {
|
|
605
|
+
transition: z,
|
|
606
|
+
translate: U,
|
|
607
|
+
boxSizing: X,
|
|
608
|
+
paddingBlockStart: qn,
|
|
609
|
+
paddingBlockEnd: Gn,
|
|
610
|
+
paddingInlineStart: Jn,
|
|
611
|
+
paddingInlineEnd: Qn,
|
|
612
|
+
borderInlineStartWidth: Zn,
|
|
613
|
+
borderInlineEndWidth: er,
|
|
614
|
+
borderBlockStartWidth: tr,
|
|
615
|
+
borderBlockEndWidth: nr
|
|
616
|
+
} = dn(d), Ct = c === "clone", Pt = X === "content-box", Tt = Pt ? parseInt(Jn) + parseInt(Qn) + parseInt(Zn) + parseInt(er) : 0, $t = Pt ? parseInt(qn) + parseInt(Gn) + parseInt(tr) + parseInt(nr) : 0, T = c !== "move" && !this.overlay ? ri(l, Ct ? "clone" : "hidden") : null, Xe = M(
|
|
617
|
+
() => vt(i.dragOperation.activatorEvent)
|
|
618
|
+
);
|
|
619
|
+
if (U !== "none") {
|
|
620
|
+
const _ = un(U);
|
|
621
|
+
_ && !h.translate && (h.translate = _);
|
|
622
|
+
}
|
|
623
|
+
if (!h.transformOrigin) {
|
|
624
|
+
const _ = M(() => a.current);
|
|
625
|
+
h.transformOrigin = {
|
|
626
|
+
x: (_.x - P * p.scaleX - p.x) / (g * p.scaleX),
|
|
627
|
+
y: (_.y - v * p.scaleY - p.y) / (m * p.scaleY)
|
|
628
|
+
};
|
|
629
|
+
}
|
|
630
|
+
const { transformOrigin: ee } = h, Mt = v * p.scaleY + p.y, It = P * p.scaleX + p.x;
|
|
631
|
+
if (!h.coordinates && (h.coordinates = {
|
|
632
|
+
x: It,
|
|
633
|
+
y: Mt
|
|
634
|
+
}, b.x !== 1 || b.y !== 1)) {
|
|
635
|
+
const { scaleX: _, scaleY: A } = w, { x: W, y: te } = ee;
|
|
636
|
+
h.coordinates.x += (g * _ - g) * W, h.coordinates.y += (m * A - m) * te;
|
|
637
|
+
}
|
|
638
|
+
h.dimensions || (h.dimensions = { width: g, height: m }), h.frameTransform || (h.frameTransform = p);
|
|
639
|
+
const Rt = {
|
|
640
|
+
x: h.coordinates.x - It,
|
|
641
|
+
y: h.coordinates.y - Mt
|
|
642
|
+
}, Wt = {
|
|
643
|
+
width: (h.dimensions.width * h.frameTransform.scaleX - g * p.scaleX) * ee.x,
|
|
644
|
+
height: (h.dimensions.height * h.frameTransform.scaleY - m * p.scaleY) * ee.y
|
|
645
|
+
}, Ye = {
|
|
646
|
+
x: Rt.x / p.scaleX + Wt.width,
|
|
647
|
+
y: Rt.y / p.scaleY + Wt.height
|
|
648
|
+
}, Lt = {
|
|
649
|
+
left: P + Ye.x,
|
|
650
|
+
top: v + Ye.y
|
|
651
|
+
};
|
|
652
|
+
u.setAttribute(L, "true");
|
|
653
|
+
const Ft = M(() => o.transform), zt = (t = h.translate) != null ? t : { x: 0, y: 0 }, rr = Ft.x * p.scaleX + zt.x, ir = Ft.y * p.scaleY + zt.y, Nt = hn();
|
|
654
|
+
S.set(
|
|
655
|
+
{
|
|
656
|
+
width: g - Tt,
|
|
657
|
+
height: m - $t,
|
|
658
|
+
top: Lt.top + Nt.y,
|
|
659
|
+
left: Lt.left + Nt.x,
|
|
660
|
+
translate: `${rr}px ${ir}px 0`,
|
|
661
|
+
transition: z ? `${z}, translate 0ms linear` : "",
|
|
662
|
+
scale: k ? `${b.x} ${b.y}` : "",
|
|
663
|
+
"transform-origin": `${ee.x * 100}% ${ee.y * 100}%`
|
|
664
|
+
},
|
|
665
|
+
D
|
|
666
|
+
), T && (d.insertAdjacentElement("afterend", T), s?.rootElement && (typeof s.rootElement == "function" ? s.rootElement(l) : s.rootElement).appendChild(d)), Vt(u) && (u.hasAttribute("popover") || u.setAttribute("popover", "manual"), we(u), u.addEventListener("beforetoggle", en));
|
|
667
|
+
let H, je, Oe;
|
|
668
|
+
const Kt = ci({
|
|
669
|
+
placeholder: T,
|
|
670
|
+
element: d,
|
|
671
|
+
feedbackElement: u,
|
|
672
|
+
frameTransform: p,
|
|
673
|
+
transformOrigin: ee,
|
|
674
|
+
width: g,
|
|
675
|
+
height: m,
|
|
676
|
+
top: v,
|
|
677
|
+
left: P,
|
|
678
|
+
widthOffset: Tt,
|
|
679
|
+
heightOffset: $t,
|
|
680
|
+
delta: Ye,
|
|
681
|
+
styles: S,
|
|
682
|
+
dragOperation: o,
|
|
683
|
+
getElementMutationObserver: () => H,
|
|
684
|
+
getSavedCellWidths: () => Oe,
|
|
685
|
+
setSavedCellWidths: (_) => {
|
|
686
|
+
Oe = _;
|
|
687
|
+
}
|
|
688
|
+
}), Ut = new N(u);
|
|
689
|
+
M(() => o.shape = Ut);
|
|
690
|
+
const Be = fn(u), Xt = (_) => {
|
|
691
|
+
this.manager.actions.stop({ event: _ });
|
|
692
|
+
}, sr = pn(Be);
|
|
693
|
+
Xe && Be.addEventListener("resize", Xt), M(() => l.status) === "idle" && requestAnimationFrame(() => l.status = "dragging"), T && (Kt.observe(T), H = ai(
|
|
694
|
+
d,
|
|
695
|
+
T,
|
|
696
|
+
Ct
|
|
697
|
+
), je = li(
|
|
698
|
+
d,
|
|
699
|
+
T,
|
|
700
|
+
u
|
|
701
|
+
));
|
|
702
|
+
const Yt = (n = i.dragOperation.source) == null ? void 0 : n.id, or = () => {
|
|
703
|
+
var _;
|
|
704
|
+
if (!Xe || Yt == null) return;
|
|
705
|
+
const A = i.registry.draggables.get(Yt), W = (_ = A?.handle) != null ? _ : A?.element;
|
|
706
|
+
cn(W) && W.focus();
|
|
707
|
+
}, He = () => {
|
|
708
|
+
var _;
|
|
709
|
+
if (H?.disconnect(), je?.disconnect(), Kt.disconnect(), Be.removeEventListener("resize", Xt), Vt(u) && (u.removeEventListener(
|
|
710
|
+
"beforetoggle",
|
|
711
|
+
en
|
|
712
|
+
), u.removeAttribute("popover")), u.removeAttribute(L), S.reset(), Oe && ot(d)) {
|
|
713
|
+
const W = Array.from(d.cells);
|
|
714
|
+
for (const [te, ne] of W.entries())
|
|
715
|
+
ne.style.width = (_ = Oe[te]) != null ? _ : "";
|
|
716
|
+
}
|
|
717
|
+
l.status = "idle";
|
|
718
|
+
const A = r.current.translate != null;
|
|
719
|
+
T && (A || T.parentElement !== u.parentElement) && u.isConnected && T.replaceWith(u), T?.remove();
|
|
720
|
+
}, ar = s?.dropAnimation, jt = this, lr = Mr(
|
|
721
|
+
// Update transform on move
|
|
722
|
+
() => {
|
|
723
|
+
var _;
|
|
724
|
+
const { transform: A, status: W } = o;
|
|
725
|
+
if (!(!A.x && !A.y && !r.current.translate) && W.dragging) {
|
|
726
|
+
const te = (_ = h.translate) != null ? _ : { x: 0, y: 0 }, ne = {
|
|
727
|
+
x: A.x / p.scaleX + te.x,
|
|
728
|
+
y: A.y / p.scaleY + te.y
|
|
729
|
+
}, Bt = r.current.translate, cr = M(() => o.modifiers), Ve = M(() => {
|
|
730
|
+
var pe;
|
|
731
|
+
return (pe = o.shape) == null ? void 0 : pe.current;
|
|
732
|
+
}), dr = Xe && !sr ? "250ms cubic-bezier(0.25, 1, 0.5, 1)" : "0ms linear";
|
|
733
|
+
if (S.set(
|
|
734
|
+
{
|
|
735
|
+
transition: `${z}, translate ${dr}`,
|
|
736
|
+
translate: `${ne.x}px ${ne.y}px 0`
|
|
737
|
+
},
|
|
738
|
+
D
|
|
739
|
+
), H?.takeRecords(), Ve && Ve !== Ut && Bt && !cr.length) {
|
|
740
|
+
const pe = Ir.delta(ne, Bt);
|
|
741
|
+
o.shape = mn.from(
|
|
742
|
+
Ve.boundingRectangle
|
|
743
|
+
).translate(
|
|
744
|
+
pe.x * p.scaleX,
|
|
745
|
+
pe.y * p.scaleY
|
|
746
|
+
);
|
|
747
|
+
} else
|
|
748
|
+
o.shape = new N(u);
|
|
749
|
+
r.current.translate = ne;
|
|
750
|
+
}
|
|
751
|
+
},
|
|
752
|
+
// Drop animation
|
|
753
|
+
function() {
|
|
754
|
+
if (o.status.dropped) {
|
|
755
|
+
this.dispose(), l.status = "dropping";
|
|
756
|
+
const _ = jt.dropAnimation !== void 0 ? jt.dropAnimation : ar;
|
|
757
|
+
let A = r.current.translate;
|
|
758
|
+
const W = A != null;
|
|
759
|
+
if (!A && d !== u && (A = { x: 0, y: 0 }), !A || _ === null) {
|
|
760
|
+
He();
|
|
761
|
+
return;
|
|
762
|
+
}
|
|
763
|
+
i.renderer.rendering.then(() => {
|
|
764
|
+
hi({
|
|
765
|
+
element: d,
|
|
766
|
+
feedbackElement: u,
|
|
767
|
+
placeholder: T,
|
|
768
|
+
translate: A,
|
|
769
|
+
moved: W,
|
|
770
|
+
transition: z,
|
|
771
|
+
alignment: l.alignment,
|
|
772
|
+
styles: S,
|
|
773
|
+
animation: _ ?? void 0,
|
|
774
|
+
getElementMutationObserver: () => H,
|
|
775
|
+
cleanup: He,
|
|
776
|
+
restoreFocus: or
|
|
777
|
+
});
|
|
778
|
+
});
|
|
779
|
+
}
|
|
780
|
+
}
|
|
781
|
+
);
|
|
782
|
+
return () => {
|
|
783
|
+
He(), lr();
|
|
784
|
+
};
|
|
785
|
+
};
|
|
786
|
+
$(Ee, 4, "overlay", $n, xe, _t);
|
|
787
|
+
Q(Ee, xe);
|
|
788
|
+
xe.configure = pt(xe);
|
|
789
|
+
var fi = xe, ve = !0, pi = !1, Rn, Wn, Ln, Fn, j, wt, St;
|
|
790
|
+
Fn = (Ln = [F], R.Forward), Wn = (Rn = [F], R.Reverse);
|
|
791
|
+
var ke = class {
|
|
792
|
+
constructor() {
|
|
793
|
+
E(this, wt, x(j, 8, this, ve)), x(j, 11, this), E(this, St, x(j, 12, this, ve)), x(j, 15, this);
|
|
794
|
+
}
|
|
795
|
+
isLocked(e) {
|
|
796
|
+
return e === R.Idle ? !1 : e == null ? this[R.Forward] === ve && this[R.Reverse] === ve : this[e] === ve;
|
|
797
|
+
}
|
|
798
|
+
unlock(e) {
|
|
799
|
+
e !== R.Idle && (this[e] = pi);
|
|
800
|
+
}
|
|
801
|
+
};
|
|
802
|
+
j = fe(null);
|
|
803
|
+
wt = /* @__PURE__ */ new WeakMap();
|
|
804
|
+
St = /* @__PURE__ */ new WeakMap();
|
|
805
|
+
$(j, 4, Fn, Ln, ke, wt);
|
|
806
|
+
$(j, 4, Wn, Rn, ke, St);
|
|
807
|
+
Q(j, ke);
|
|
808
|
+
var vi = [R.Forward, R.Reverse], tn = class {
|
|
809
|
+
constructor() {
|
|
810
|
+
this.x = new ke(), this.y = new ke();
|
|
811
|
+
}
|
|
812
|
+
isLocked() {
|
|
813
|
+
return this.x.isLocked() && this.y.isLocked();
|
|
814
|
+
}
|
|
815
|
+
}, mi = class extends ue {
|
|
816
|
+
constructor(e) {
|
|
817
|
+
super(e);
|
|
818
|
+
const t = gn(new tn());
|
|
819
|
+
let n = null;
|
|
820
|
+
this.signal = t, J(() => {
|
|
821
|
+
const { status: r } = e.dragOperation;
|
|
822
|
+
if (!r.initialized) {
|
|
823
|
+
n = null, t.value = new tn();
|
|
824
|
+
return;
|
|
825
|
+
}
|
|
826
|
+
const { delta: i } = e.dragOperation.position;
|
|
827
|
+
if (n) {
|
|
828
|
+
const s = {
|
|
829
|
+
x: nn(i.x, n.x),
|
|
830
|
+
y: nn(i.y, n.y)
|
|
831
|
+
}, o = t.peek();
|
|
832
|
+
Wr(() => {
|
|
833
|
+
for (const a of vn)
|
|
834
|
+
for (const l of vi)
|
|
835
|
+
s[a] === l && o[a].unlock(l);
|
|
836
|
+
t.value = o;
|
|
837
|
+
});
|
|
838
|
+
}
|
|
839
|
+
n = i;
|
|
840
|
+
});
|
|
841
|
+
}
|
|
842
|
+
get current() {
|
|
843
|
+
return this.signal.peek();
|
|
844
|
+
}
|
|
845
|
+
};
|
|
846
|
+
function nn(e, t) {
|
|
847
|
+
return Math.sign(e - t);
|
|
848
|
+
}
|
|
849
|
+
var zn, lt, Ae, Et, Y, ct, Ke = class extends (lt = ft, zn = [F], lt) {
|
|
850
|
+
constructor(e) {
|
|
851
|
+
super(e), E(this, Et, x(Ae, 8, this, !1)), x(Ae, 11, this), E(this, Y), E(this, ct, () => {
|
|
852
|
+
if (!y(this, Y))
|
|
853
|
+
return;
|
|
854
|
+
const { element: s, by: o } = y(this, Y);
|
|
855
|
+
o.y && (s.scrollTop += o.y), o.x && (s.scrollLeft += o.x);
|
|
856
|
+
}), this.scroll = (s) => {
|
|
857
|
+
var o;
|
|
858
|
+
if (this.disabled)
|
|
859
|
+
return !1;
|
|
860
|
+
const a = this.getScrollableElements();
|
|
861
|
+
if (!a)
|
|
862
|
+
return O(this, Y, void 0), !1;
|
|
863
|
+
const { position: l } = this.manager.dragOperation, f = l?.current;
|
|
864
|
+
if (f) {
|
|
865
|
+
const { by: d } = s ?? {}, c = d ? {
|
|
866
|
+
x: rn(d.x),
|
|
867
|
+
y: rn(d.y)
|
|
868
|
+
} : void 0, h = c ? void 0 : this.scrollIntentTracker.current;
|
|
869
|
+
if (h?.isLocked())
|
|
870
|
+
return !1;
|
|
871
|
+
for (const u of a) {
|
|
872
|
+
const p = yr(u, d);
|
|
873
|
+
if (p.x || p.y) {
|
|
874
|
+
const { speed: w, direction: k } = _r(
|
|
875
|
+
u,
|
|
876
|
+
f,
|
|
877
|
+
c
|
|
878
|
+
);
|
|
879
|
+
if (h)
|
|
880
|
+
for (const C of vn)
|
|
881
|
+
h[C].isLocked(k[C]) && (w[C] = 0, k[C] = 0);
|
|
882
|
+
if (k.x || k.y) {
|
|
883
|
+
const { x: C, y: b } = d ?? k, g = C * w.x, m = b * w.y;
|
|
884
|
+
if (g || m) {
|
|
885
|
+
const v = (o = y(this, Y)) == null ? void 0 : o.by;
|
|
886
|
+
if (this.autoScrolling && v && (v.x && !g || v.y && !m))
|
|
887
|
+
continue;
|
|
888
|
+
return O(this, Y, {
|
|
889
|
+
element: u,
|
|
890
|
+
by: {
|
|
891
|
+
x: g,
|
|
892
|
+
y: m
|
|
893
|
+
}
|
|
894
|
+
}), Me.schedule(y(this, ct)), !0;
|
|
895
|
+
}
|
|
896
|
+
}
|
|
897
|
+
}
|
|
898
|
+
}
|
|
899
|
+
}
|
|
900
|
+
return O(this, Y, void 0), !1;
|
|
901
|
+
};
|
|
902
|
+
let t = null, n = null;
|
|
903
|
+
const r = tt(() => {
|
|
904
|
+
const { position: s, source: o } = e.dragOperation;
|
|
905
|
+
if (!s)
|
|
906
|
+
return null;
|
|
907
|
+
const a = Dr(
|
|
908
|
+
$e(o?.element),
|
|
909
|
+
s.current
|
|
910
|
+
);
|
|
911
|
+
return a && (t = a), a ?? t;
|
|
912
|
+
}), i = tt(() => {
|
|
913
|
+
const s = r.value, { documentElement: o } = Ne(s);
|
|
914
|
+
if (!s || s === o) {
|
|
915
|
+
const { target: a } = e.dragOperation, l = a?.element;
|
|
916
|
+
if (l) {
|
|
917
|
+
const f = Ht(l, {
|
|
918
|
+
excludeElement: !1
|
|
919
|
+
});
|
|
920
|
+
return n = f, f;
|
|
921
|
+
}
|
|
922
|
+
}
|
|
923
|
+
if (s) {
|
|
924
|
+
const a = Ht(s, {
|
|
925
|
+
excludeElement: !1
|
|
926
|
+
});
|
|
927
|
+
return this.autoScrolling && n && a.size < n?.size ? n : (n = a, a);
|
|
928
|
+
}
|
|
929
|
+
return n = null, null;
|
|
930
|
+
}, $r);
|
|
931
|
+
this.getScrollableElements = () => i.value, this.scrollIntentTracker = new mi(e), this.destroy = e.monitor.addEventListener("dragmove", (s) => {
|
|
932
|
+
this.disabled || s.defaultPrevented || !vt(e.dragOperation.activatorEvent) || !s.by || this.scroll({ by: s.by }) && s.preventDefault();
|
|
933
|
+
});
|
|
934
|
+
}
|
|
935
|
+
};
|
|
936
|
+
Ae = fe(lt);
|
|
937
|
+
Et = /* @__PURE__ */ new WeakMap();
|
|
938
|
+
Y = /* @__PURE__ */ new WeakMap();
|
|
939
|
+
ct = /* @__PURE__ */ new WeakMap();
|
|
940
|
+
$(Ae, 4, "autoScrolling", zn, Ke, Et);
|
|
941
|
+
Q(Ae, Ke);
|
|
942
|
+
function rn(e) {
|
|
943
|
+
return e > 0 ? R.Forward : e < 0 ? R.Reverse : R.Idle;
|
|
944
|
+
}
|
|
945
|
+
var gi = class {
|
|
946
|
+
constructor(e) {
|
|
947
|
+
this.scheduler = e, this.pending = !1, this.tasks = /* @__PURE__ */ new Set(), this.resolvers = /* @__PURE__ */ new Set(), this.flush = () => {
|
|
948
|
+
const { tasks: t, resolvers: n } = this;
|
|
949
|
+
this.pending = !1, this.tasks = /* @__PURE__ */ new Set(), this.resolvers = /* @__PURE__ */ new Set();
|
|
950
|
+
for (const r of t)
|
|
951
|
+
r();
|
|
952
|
+
for (const r of n)
|
|
953
|
+
r();
|
|
954
|
+
};
|
|
955
|
+
}
|
|
956
|
+
schedule(e) {
|
|
957
|
+
return this.tasks.add(e), this.pending || (this.pending = !0, this.scheduler(this.flush)), new Promise((t) => this.resolvers.add(t));
|
|
958
|
+
}
|
|
959
|
+
}, bi = new gi((e) => {
|
|
960
|
+
typeof requestAnimationFrame == "function" ? requestAnimationFrame(e) : e();
|
|
961
|
+
}), yi = 10, Nn = class extends ue {
|
|
962
|
+
constructor(e, t) {
|
|
963
|
+
super(e);
|
|
964
|
+
const n = e.registry.plugins.get(Ke);
|
|
965
|
+
if (!n)
|
|
966
|
+
throw new Error("AutoScroller plugin depends on Scroller plugin");
|
|
967
|
+
this.destroy = J(() => {
|
|
968
|
+
if (this.disabled)
|
|
969
|
+
return;
|
|
970
|
+
const { position: r, status: i } = e.dragOperation;
|
|
971
|
+
if (i.dragging)
|
|
972
|
+
if (n.scroll()) {
|
|
973
|
+
n.autoScrolling = !0;
|
|
974
|
+
const o = setInterval(
|
|
975
|
+
() => bi.schedule(n.scroll),
|
|
976
|
+
yi
|
|
977
|
+
);
|
|
978
|
+
return () => {
|
|
979
|
+
clearInterval(o);
|
|
980
|
+
};
|
|
981
|
+
} else
|
|
982
|
+
n.autoScrolling = !1;
|
|
983
|
+
});
|
|
984
|
+
}
|
|
985
|
+
}, sn = {
|
|
986
|
+
capture: !0,
|
|
987
|
+
passive: !0
|
|
988
|
+
}, ge, _i = class extends ft {
|
|
989
|
+
constructor(e) {
|
|
990
|
+
super(e), E(this, ge), this.handleScroll = () => {
|
|
991
|
+
y(this, ge) == null && O(this, ge, setTimeout(() => {
|
|
992
|
+
this.manager.collisionObserver.forceUpdate(!1), O(this, ge, void 0);
|
|
993
|
+
}, 50));
|
|
994
|
+
};
|
|
995
|
+
const { dragOperation: t } = this.manager;
|
|
996
|
+
this.destroy = J(() => {
|
|
997
|
+
var n, r, i;
|
|
998
|
+
if (t.status.dragging) {
|
|
999
|
+
const o = (i = (r = (n = t.source) == null ? void 0 : n.element) == null ? void 0 : r.ownerDocument) != null ? i : document;
|
|
1000
|
+
return o.addEventListener("scroll", this.handleScroll, sn), () => {
|
|
1001
|
+
o.removeEventListener(
|
|
1002
|
+
"scroll",
|
|
1003
|
+
this.handleScroll,
|
|
1004
|
+
sn
|
|
1005
|
+
);
|
|
1006
|
+
};
|
|
1007
|
+
}
|
|
1008
|
+
});
|
|
1009
|
+
}
|
|
1010
|
+
};
|
|
1011
|
+
ge = /* @__PURE__ */ new WeakMap();
|
|
1012
|
+
var wi = class extends ue {
|
|
1013
|
+
constructor(e, t) {
|
|
1014
|
+
super(e, t), this.manager = e, this.destroy = J(() => {
|
|
1015
|
+
var n;
|
|
1016
|
+
const { dragOperation: r } = this.manager, { nonce: i } = (n = this.options) != null ? n : {};
|
|
1017
|
+
if (r.status.initialized) {
|
|
1018
|
+
const s = document.createElement("style");
|
|
1019
|
+
return i && s.setAttribute("nonce", i), s.textContent = "* { user-select: none !important; -webkit-user-select: none !important; }", document.head.appendChild(s), Je(), document.addEventListener("selectionchange", Je, {
|
|
1020
|
+
capture: !0
|
|
1021
|
+
}), () => {
|
|
1022
|
+
document.removeEventListener("selectionchange", Je, {
|
|
1023
|
+
capture: !0
|
|
1024
|
+
}), s.remove();
|
|
1025
|
+
};
|
|
1026
|
+
}
|
|
1027
|
+
});
|
|
1028
|
+
}
|
|
1029
|
+
};
|
|
1030
|
+
function Je() {
|
|
1031
|
+
var e;
|
|
1032
|
+
(e = document.getSelection()) == null || e.removeAllRanges();
|
|
1033
|
+
}
|
|
1034
|
+
var be = Object.freeze({
|
|
1035
|
+
offset: 10,
|
|
1036
|
+
keyboardCodes: {
|
|
1037
|
+
start: ["Space", "Enter"],
|
|
1038
|
+
cancel: ["Escape"],
|
|
1039
|
+
end: ["Space", "Enter", "Tab"],
|
|
1040
|
+
up: ["ArrowUp"],
|
|
1041
|
+
down: ["ArrowDown"],
|
|
1042
|
+
left: ["ArrowLeft"],
|
|
1043
|
+
right: ["ArrowRight"]
|
|
1044
|
+
},
|
|
1045
|
+
preventActivation(e, t) {
|
|
1046
|
+
var n;
|
|
1047
|
+
const r = (n = t.handle) != null ? n : t.element;
|
|
1048
|
+
return e.target !== r;
|
|
1049
|
+
}
|
|
1050
|
+
}), ie, Fe = class extends Te {
|
|
1051
|
+
constructor(t, n) {
|
|
1052
|
+
super(t), this.manager = t, this.options = n, E(this, ie, []), this.listeners = new ln(), this.handleSourceKeyDown = (r, i, s) => {
|
|
1053
|
+
if (this.disabled || r.defaultPrevented || !le(r.target) || i.disabled)
|
|
1054
|
+
return;
|
|
1055
|
+
const {
|
|
1056
|
+
keyboardCodes: o = be.keyboardCodes,
|
|
1057
|
+
preventActivation: a = be.preventActivation
|
|
1058
|
+
} = s ?? {};
|
|
1059
|
+
o.start.includes(r.code) && this.manager.dragOperation.status.idle && (a?.(r, i) || this.handleStart(r, i, s));
|
|
1060
|
+
};
|
|
1061
|
+
}
|
|
1062
|
+
bind(t, n = this.options) {
|
|
1063
|
+
return J(() => {
|
|
1064
|
+
var i;
|
|
1065
|
+
const s = (i = t.handle) != null ? i : t.element, o = (a) => {
|
|
1066
|
+
vt(a) && this.handleSourceKeyDown(a, t, n);
|
|
1067
|
+
};
|
|
1068
|
+
if (s)
|
|
1069
|
+
return s.addEventListener("keydown", o), () => {
|
|
1070
|
+
s.removeEventListener("keydown", o);
|
|
1071
|
+
};
|
|
1072
|
+
});
|
|
1073
|
+
}
|
|
1074
|
+
handleStart(t, n, r) {
|
|
1075
|
+
const { element: i } = n;
|
|
1076
|
+
if (!i)
|
|
1077
|
+
throw new Error("Source draggable does not have an associated element");
|
|
1078
|
+
t.preventDefault(), t.stopImmediatePropagation(), br(i);
|
|
1079
|
+
const { center: s } = new N(i);
|
|
1080
|
+
if (this.manager.actions.start({
|
|
1081
|
+
event: t,
|
|
1082
|
+
coordinates: {
|
|
1083
|
+
x: s.x,
|
|
1084
|
+
y: s.y
|
|
1085
|
+
},
|
|
1086
|
+
source: n
|
|
1087
|
+
}).signal.aborted) return this.cleanup();
|
|
1088
|
+
this.sideEffects();
|
|
1089
|
+
const a = Ne(i), l = [
|
|
1090
|
+
this.listeners.bind(a, [
|
|
1091
|
+
{
|
|
1092
|
+
type: "keydown",
|
|
1093
|
+
listener: (f) => this.handleKeyDown(f, n, r),
|
|
1094
|
+
options: { capture: !0 }
|
|
1095
|
+
}
|
|
1096
|
+
])
|
|
1097
|
+
];
|
|
1098
|
+
y(this, ie).push(...l);
|
|
1099
|
+
}
|
|
1100
|
+
handleKeyDown(t, n, r) {
|
|
1101
|
+
const { keyboardCodes: i = be.keyboardCodes } = r ?? {};
|
|
1102
|
+
if (re(t, [...i.end, ...i.cancel])) {
|
|
1103
|
+
t.preventDefault();
|
|
1104
|
+
const s = re(t, i.cancel);
|
|
1105
|
+
this.handleEnd(t, s);
|
|
1106
|
+
return;
|
|
1107
|
+
}
|
|
1108
|
+
re(t, i.up) ? this.handleMove("up", t) : re(t, i.down) && this.handleMove("down", t), re(t, i.left) ? this.handleMove("left", t) : re(t, i.right) && this.handleMove("right", t);
|
|
1109
|
+
}
|
|
1110
|
+
handleEnd(t, n) {
|
|
1111
|
+
this.manager.actions.stop({
|
|
1112
|
+
event: t,
|
|
1113
|
+
canceled: n
|
|
1114
|
+
}), this.cleanup();
|
|
1115
|
+
}
|
|
1116
|
+
handleMove(t, n) {
|
|
1117
|
+
var r, i;
|
|
1118
|
+
const { shape: s } = this.manager.dragOperation, o = n.shiftKey ? 5 : 1;
|
|
1119
|
+
let a = {
|
|
1120
|
+
x: 0,
|
|
1121
|
+
y: 0
|
|
1122
|
+
}, l = (i = (r = this.options) == null ? void 0 : r.offset) != null ? i : be.offset;
|
|
1123
|
+
if (typeof l == "number" && (l = { x: l, y: l }), !!s) {
|
|
1124
|
+
switch (t) {
|
|
1125
|
+
case "up":
|
|
1126
|
+
a = { x: 0, y: -l.y * o };
|
|
1127
|
+
break;
|
|
1128
|
+
case "down":
|
|
1129
|
+
a = { x: 0, y: l.y * o };
|
|
1130
|
+
break;
|
|
1131
|
+
case "left":
|
|
1132
|
+
a = { x: -l.x * o, y: 0 };
|
|
1133
|
+
break;
|
|
1134
|
+
case "right":
|
|
1135
|
+
a = { x: l.x * o, y: 0 };
|
|
1136
|
+
break;
|
|
1137
|
+
}
|
|
1138
|
+
(a.x || a.y) && (n.preventDefault(), this.manager.actions.move({
|
|
1139
|
+
event: n,
|
|
1140
|
+
by: a
|
|
1141
|
+
}));
|
|
1142
|
+
}
|
|
1143
|
+
}
|
|
1144
|
+
sideEffects() {
|
|
1145
|
+
const t = this.manager.registry.plugins.get(Nn);
|
|
1146
|
+
t?.disabled === !1 && (t.disable(), y(this, ie).push(() => {
|
|
1147
|
+
t.enable();
|
|
1148
|
+
}));
|
|
1149
|
+
}
|
|
1150
|
+
cleanup() {
|
|
1151
|
+
y(this, ie).forEach((t) => t()), O(this, ie, []);
|
|
1152
|
+
}
|
|
1153
|
+
destroy() {
|
|
1154
|
+
this.cleanup(), this.listeners.clear();
|
|
1155
|
+
}
|
|
1156
|
+
};
|
|
1157
|
+
ie = /* @__PURE__ */ new WeakMap();
|
|
1158
|
+
Fe.configure = pt(Fe);
|
|
1159
|
+
Fe.defaults = be;
|
|
1160
|
+
var Si = Fe;
|
|
1161
|
+
function re(e, t) {
|
|
1162
|
+
return t.includes(e.code);
|
|
1163
|
+
}
|
|
1164
|
+
var V, Ei = class extends an {
|
|
1165
|
+
constructor() {
|
|
1166
|
+
super(...arguments), E(this, V);
|
|
1167
|
+
}
|
|
1168
|
+
onEvent(e) {
|
|
1169
|
+
switch (e.type) {
|
|
1170
|
+
case "pointerdown":
|
|
1171
|
+
O(this, V, ce(e));
|
|
1172
|
+
break;
|
|
1173
|
+
case "pointermove":
|
|
1174
|
+
if (!y(this, V)) return;
|
|
1175
|
+
const { x: t, y: n } = ce(e), r = {
|
|
1176
|
+
x: t - y(this, V).x,
|
|
1177
|
+
y: n - y(this, V).y
|
|
1178
|
+
}, { tolerance: i } = this.options;
|
|
1179
|
+
if (i && nt(r, i)) {
|
|
1180
|
+
this.abort();
|
|
1181
|
+
return;
|
|
1182
|
+
}
|
|
1183
|
+
nt(r, this.options.value) && this.activate(e);
|
|
1184
|
+
break;
|
|
1185
|
+
case "pointerup":
|
|
1186
|
+
this.abort();
|
|
1187
|
+
break;
|
|
1188
|
+
}
|
|
1189
|
+
}
|
|
1190
|
+
abort() {
|
|
1191
|
+
O(this, V, void 0);
|
|
1192
|
+
}
|
|
1193
|
+
};
|
|
1194
|
+
V = /* @__PURE__ */ new WeakMap();
|
|
1195
|
+
var se, q, xi = class extends an {
|
|
1196
|
+
constructor() {
|
|
1197
|
+
super(...arguments), E(this, se), E(this, q);
|
|
1198
|
+
}
|
|
1199
|
+
onEvent(e) {
|
|
1200
|
+
switch (e.type) {
|
|
1201
|
+
case "pointerdown":
|
|
1202
|
+
O(this, q, ce(e)), O(this, se, setTimeout(
|
|
1203
|
+
() => this.activate(e),
|
|
1204
|
+
this.options.value
|
|
1205
|
+
));
|
|
1206
|
+
break;
|
|
1207
|
+
case "pointermove":
|
|
1208
|
+
if (!y(this, q)) return;
|
|
1209
|
+
const { x: t, y: n } = ce(e), r = {
|
|
1210
|
+
x: t - y(this, q).x,
|
|
1211
|
+
y: n - y(this, q).y
|
|
1212
|
+
};
|
|
1213
|
+
nt(r, this.options.tolerance) && this.abort();
|
|
1214
|
+
break;
|
|
1215
|
+
case "pointerup":
|
|
1216
|
+
this.abort();
|
|
1217
|
+
break;
|
|
1218
|
+
}
|
|
1219
|
+
}
|
|
1220
|
+
abort() {
|
|
1221
|
+
y(this, se) && (clearTimeout(y(this, se)), O(this, q, void 0), O(this, se, void 0));
|
|
1222
|
+
}
|
|
1223
|
+
};
|
|
1224
|
+
se = /* @__PURE__ */ new WeakMap();
|
|
1225
|
+
q = /* @__PURE__ */ new WeakMap();
|
|
1226
|
+
var ae = class {
|
|
1227
|
+
};
|
|
1228
|
+
ae.Delay = xi;
|
|
1229
|
+
ae.Distance = Ei;
|
|
1230
|
+
var dt = Object.freeze({
|
|
1231
|
+
activationConstraints(e, t) {
|
|
1232
|
+
var n;
|
|
1233
|
+
const { pointerType: r, target: i } = e;
|
|
1234
|
+
if (!(r === "mouse" && le(i) && (t.handle === i || (n = t.handle) != null && n.contains(i))))
|
|
1235
|
+
return r === "touch" ? [
|
|
1236
|
+
new ae.Delay({ value: 250, tolerance: 5 })
|
|
1237
|
+
] : Sr(i) && !e.defaultPrevented ? [
|
|
1238
|
+
new ae.Delay({ value: 200, tolerance: 0 })
|
|
1239
|
+
] : [
|
|
1240
|
+
new ae.Delay({ value: 200, tolerance: 10 }),
|
|
1241
|
+
new ae.Distance({ value: 5 })
|
|
1242
|
+
];
|
|
1243
|
+
},
|
|
1244
|
+
preventActivation(e, t) {
|
|
1245
|
+
var n;
|
|
1246
|
+
const { target: r } = e;
|
|
1247
|
+
return r === t.element || r === t.handle || !le(r) || (n = t.handle) != null && n.contains(r) ? !1 : wr(r);
|
|
1248
|
+
}
|
|
1249
|
+
}), oe, ze = class extends Te {
|
|
1250
|
+
constructor(t, n) {
|
|
1251
|
+
super(t), this.manager = t, this.options = n, E(this, oe, /* @__PURE__ */ new Set()), this.listeners = new ln(), this.latest = {
|
|
1252
|
+
event: void 0,
|
|
1253
|
+
coordinates: void 0
|
|
1254
|
+
}, this.handleMove = () => {
|
|
1255
|
+
const { event: r, coordinates: i } = this.latest;
|
|
1256
|
+
!r || !i || this.manager.actions.move({ event: r, to: i });
|
|
1257
|
+
}, this.handleCancel = this.handleCancel.bind(this), this.handlePointerUp = this.handlePointerUp.bind(this), this.handleKeyDown = this.handleKeyDown.bind(this);
|
|
1258
|
+
}
|
|
1259
|
+
activationConstraints(t, n, r = this.options) {
|
|
1260
|
+
const { activationConstraints: i = dt.activationConstraints } = r ?? {};
|
|
1261
|
+
return typeof i == "function" ? i(t, n) : i;
|
|
1262
|
+
}
|
|
1263
|
+
bind(t, n = this.options) {
|
|
1264
|
+
return J(() => {
|
|
1265
|
+
var i;
|
|
1266
|
+
const s = new AbortController(), { signal: o } = s, a = (f) => {
|
|
1267
|
+
Or(f) && this.handlePointerDown(f, t, n);
|
|
1268
|
+
};
|
|
1269
|
+
let l = [(i = t.handle) != null ? i : t.element];
|
|
1270
|
+
n?.activatorElements && (Array.isArray(n.activatorElements) ? l = n.activatorElements : l = n.activatorElements(t));
|
|
1271
|
+
for (const f of l)
|
|
1272
|
+
f && (Oi(f.ownerDocument.defaultView), f.addEventListener("pointerdown", a, { signal: o }));
|
|
1273
|
+
return () => s.abort();
|
|
1274
|
+
});
|
|
1275
|
+
}
|
|
1276
|
+
handlePointerDown(t, n, r) {
|
|
1277
|
+
if (this.disabled || !t.isPrimary || t.button !== 0 || !le(t.target) || n.disabled || Ai(t) || !this.manager.dragOperation.status.idle)
|
|
1278
|
+
return;
|
|
1279
|
+
const { preventActivation: i = dt.preventActivation } = r ?? {};
|
|
1280
|
+
if (i?.(t, n))
|
|
1281
|
+
return;
|
|
1282
|
+
const { target: s } = t, o = cn(s) && s.draggable && s.getAttribute("draggable") === "true", a = Ie(n.element), { x: l, y: f } = ce(t);
|
|
1283
|
+
this.initialCoordinates = {
|
|
1284
|
+
x: l * a.scaleX + a.x,
|
|
1285
|
+
y: f * a.scaleY + a.y
|
|
1286
|
+
};
|
|
1287
|
+
const d = this.activationConstraints(t, n, r);
|
|
1288
|
+
t.sensor = this;
|
|
1289
|
+
const c = new hr(
|
|
1290
|
+
d,
|
|
1291
|
+
(w) => this.handleStart(n, w)
|
|
1292
|
+
);
|
|
1293
|
+
c.signal.onabort = () => this.handleCancel(t), c.onEvent(t), this.controller = c;
|
|
1294
|
+
const h = gr(), u = this.listeners.bind(h, [
|
|
1295
|
+
{
|
|
1296
|
+
type: "pointermove",
|
|
1297
|
+
listener: (w) => this.handlePointerMove(w, n)
|
|
1298
|
+
},
|
|
1299
|
+
{
|
|
1300
|
+
type: "pointerup",
|
|
1301
|
+
listener: this.handlePointerUp,
|
|
1302
|
+
options: {
|
|
1303
|
+
capture: !0
|
|
1304
|
+
}
|
|
1305
|
+
},
|
|
1306
|
+
{
|
|
1307
|
+
type: "pointercancel",
|
|
1308
|
+
listener: this.handleCancel
|
|
1309
|
+
},
|
|
1310
|
+
{
|
|
1311
|
+
// Cancel activation if there is a competing Drag and Drop interaction
|
|
1312
|
+
type: "dragstart",
|
|
1313
|
+
listener: o ? this.handleCancel : Ce,
|
|
1314
|
+
options: {
|
|
1315
|
+
capture: !0
|
|
1316
|
+
}
|
|
1317
|
+
}
|
|
1318
|
+
]), p = () => {
|
|
1319
|
+
u(), this.initialCoordinates = void 0;
|
|
1320
|
+
};
|
|
1321
|
+
y(this, oe).add(p);
|
|
1322
|
+
}
|
|
1323
|
+
handlePointerMove(t, n) {
|
|
1324
|
+
var r, i;
|
|
1325
|
+
if (((r = this.controller) == null ? void 0 : r.activated) === !1) {
|
|
1326
|
+
(i = this.controller) == null || i.onEvent(t);
|
|
1327
|
+
return;
|
|
1328
|
+
}
|
|
1329
|
+
if (this.manager.dragOperation.status.dragging) {
|
|
1330
|
+
const s = ce(t), o = Ie(n.element);
|
|
1331
|
+
s.x = s.x * o.scaleX + o.x, s.y = s.y * o.scaleY + o.y, t.preventDefault(), t.stopPropagation(), this.latest.event = t, this.latest.coordinates = s, Me.schedule(this.handleMove);
|
|
1332
|
+
}
|
|
1333
|
+
}
|
|
1334
|
+
handlePointerUp(t) {
|
|
1335
|
+
const { status: n } = this.manager.dragOperation;
|
|
1336
|
+
if (!n.idle) {
|
|
1337
|
+
t.preventDefault(), t.stopPropagation();
|
|
1338
|
+
const r = !n.initialized;
|
|
1339
|
+
this.manager.actions.stop({ event: t, canceled: r });
|
|
1340
|
+
}
|
|
1341
|
+
this.cleanup();
|
|
1342
|
+
}
|
|
1343
|
+
handleKeyDown(t) {
|
|
1344
|
+
t.key === "Escape" && (t.preventDefault(), this.handleCancel(t));
|
|
1345
|
+
}
|
|
1346
|
+
handleStart(t, n) {
|
|
1347
|
+
const { manager: r, initialCoordinates: i } = this;
|
|
1348
|
+
if (!i || !r.dragOperation.status.idle || n.defaultPrevented)
|
|
1349
|
+
return;
|
|
1350
|
+
if (r.actions.start({
|
|
1351
|
+
coordinates: i,
|
|
1352
|
+
event: n,
|
|
1353
|
+
source: t
|
|
1354
|
+
}).signal.aborted) return this.cleanup();
|
|
1355
|
+
n.preventDefault();
|
|
1356
|
+
const a = Ne(n.target).body;
|
|
1357
|
+
a.setPointerCapture(n.pointerId);
|
|
1358
|
+
const l = le(n.target) ? [n.target, a] : a, f = this.listeners.bind(l, [
|
|
1359
|
+
{
|
|
1360
|
+
// Prevent scrolling on touch devices
|
|
1361
|
+
type: "touchmove",
|
|
1362
|
+
listener: Ce,
|
|
1363
|
+
options: {
|
|
1364
|
+
passive: !1
|
|
1365
|
+
}
|
|
1366
|
+
},
|
|
1367
|
+
{
|
|
1368
|
+
// Prevent click events
|
|
1369
|
+
type: "click",
|
|
1370
|
+
listener: Ce
|
|
1371
|
+
},
|
|
1372
|
+
{
|
|
1373
|
+
type: "contextmenu",
|
|
1374
|
+
listener: Ce
|
|
1375
|
+
},
|
|
1376
|
+
{
|
|
1377
|
+
type: "keydown",
|
|
1378
|
+
listener: this.handleKeyDown
|
|
1379
|
+
}
|
|
1380
|
+
]);
|
|
1381
|
+
y(this, oe).add(f);
|
|
1382
|
+
}
|
|
1383
|
+
handleCancel(t) {
|
|
1384
|
+
const { dragOperation: n } = this.manager;
|
|
1385
|
+
n.status.initialized && this.manager.actions.stop({ event: t, canceled: !0 }), this.cleanup();
|
|
1386
|
+
}
|
|
1387
|
+
cleanup() {
|
|
1388
|
+
this.latest = {
|
|
1389
|
+
event: void 0,
|
|
1390
|
+
coordinates: void 0
|
|
1391
|
+
}, y(this, oe).forEach((t) => t()), y(this, oe).clear();
|
|
1392
|
+
}
|
|
1393
|
+
destroy() {
|
|
1394
|
+
this.cleanup(), this.listeners.clear();
|
|
1395
|
+
}
|
|
1396
|
+
};
|
|
1397
|
+
oe = /* @__PURE__ */ new WeakMap();
|
|
1398
|
+
ze.configure = pt(ze);
|
|
1399
|
+
ze.defaults = dt;
|
|
1400
|
+
var ki = ze;
|
|
1401
|
+
function Ai(e) {
|
|
1402
|
+
return "sensor" in e;
|
|
1403
|
+
}
|
|
1404
|
+
function Ce(e) {
|
|
1405
|
+
e.preventDefault();
|
|
1406
|
+
}
|
|
1407
|
+
function Di() {
|
|
1408
|
+
}
|
|
1409
|
+
var on = /* @__PURE__ */ new WeakSet();
|
|
1410
|
+
function Oi(e) {
|
|
1411
|
+
!e || on.has(e) || (e.addEventListener("touchmove", Di, {
|
|
1412
|
+
capture: !1,
|
|
1413
|
+
passive: !1
|
|
1414
|
+
}), on.add(e));
|
|
1415
|
+
}
|
|
1416
|
+
var Qe = {
|
|
1417
|
+
modifiers: [],
|
|
1418
|
+
plugins: [Jr, Nn, Zr, fi, wi],
|
|
1419
|
+
sensors: [ki, Si]
|
|
1420
|
+
}, Fi = class extends ur {
|
|
1421
|
+
constructor(e = {}) {
|
|
1422
|
+
const t = qe(e.plugins, Qe.plugins), n = qe(e.sensors, Qe.sensors), r = qe(e.modifiers, Qe.modifiers);
|
|
1423
|
+
super(gt(Se({}, e), {
|
|
1424
|
+
plugins: [_i, Ke, Z, ...t],
|
|
1425
|
+
sensors: n,
|
|
1426
|
+
modifiers: r
|
|
1427
|
+
}));
|
|
1428
|
+
}
|
|
1429
|
+
}, Kn, Un, Xn, ut, I, xt, kt, At, Ue = class extends (ut = vr, Xn = [F], Un = [F], Kn = [F], ut) {
|
|
1430
|
+
constructor(e, t) {
|
|
1431
|
+
var n = e, {
|
|
1432
|
+
element: r,
|
|
1433
|
+
effects: i = () => [],
|
|
1434
|
+
handle: s,
|
|
1435
|
+
feedback: o = "default"
|
|
1436
|
+
} = n, a = wn(n, [
|
|
1437
|
+
"element",
|
|
1438
|
+
"effects",
|
|
1439
|
+
"handle",
|
|
1440
|
+
"feedback"
|
|
1441
|
+
]);
|
|
1442
|
+
super(
|
|
1443
|
+
Se({
|
|
1444
|
+
effects: () => [
|
|
1445
|
+
...i(),
|
|
1446
|
+
() => {
|
|
1447
|
+
var l, f;
|
|
1448
|
+
const { manager: d } = this;
|
|
1449
|
+
if (!d) return;
|
|
1450
|
+
const h = ((f = (l = this.sensors) == null ? void 0 : l.map(fr)) != null ? f : [
|
|
1451
|
+
...d.sensors
|
|
1452
|
+
]).map((u) => {
|
|
1453
|
+
const p = u instanceof Te ? u : d.registry.register(u.plugin), w = u instanceof Te ? void 0 : u.options;
|
|
1454
|
+
return p.bind(this, w);
|
|
1455
|
+
});
|
|
1456
|
+
return function() {
|
|
1457
|
+
h.forEach((p) => p());
|
|
1458
|
+
};
|
|
1459
|
+
}
|
|
1460
|
+
]
|
|
1461
|
+
}, a),
|
|
1462
|
+
t
|
|
1463
|
+
), E(this, xt, x(I, 8, this)), x(I, 11, this), E(this, kt, x(I, 12, this)), x(I, 15, this), E(this, At, x(I, 16, this)), x(I, 19, this), this.element = r, this.handle = s, this.feedback = o;
|
|
1464
|
+
}
|
|
1465
|
+
};
|
|
1466
|
+
I = fe(ut);
|
|
1467
|
+
xt = /* @__PURE__ */ new WeakMap();
|
|
1468
|
+
kt = /* @__PURE__ */ new WeakMap();
|
|
1469
|
+
At = /* @__PURE__ */ new WeakMap();
|
|
1470
|
+
$(I, 4, "handle", Xn, Ue, xt);
|
|
1471
|
+
$(I, 4, "element", Un, Ue, kt);
|
|
1472
|
+
$(I, 4, "feedback", Kn, Ue, At);
|
|
1473
|
+
Q(I, Ue);
|
|
1474
|
+
var Yn, jn, ht, B, Dt, Ze, Bn, Hn, _e, Ot, Vn = class extends (ht = pr, jn = [F], Yn = [F], ht) {
|
|
1475
|
+
constructor(e, t) {
|
|
1476
|
+
var n = e, { element: r, effects: i = () => [] } = n, s = wn(n, ["element", "effects"]);
|
|
1477
|
+
const { collisionDetector: o = Rr } = s, a = (f) => {
|
|
1478
|
+
const { manager: d, element: c } = this;
|
|
1479
|
+
if (!c || f === null) {
|
|
1480
|
+
this.shape = void 0;
|
|
1481
|
+
return;
|
|
1482
|
+
}
|
|
1483
|
+
if (!d) return;
|
|
1484
|
+
const h = new N(c), u = M(() => this.shape);
|
|
1485
|
+
return h && u?.equals(h) ? u : (this.shape = h, h);
|
|
1486
|
+
}, l = gn(!1);
|
|
1487
|
+
super(
|
|
1488
|
+
gt(Se({}, s), {
|
|
1489
|
+
collisionDetector: o,
|
|
1490
|
+
effects: () => [
|
|
1491
|
+
...i(),
|
|
1492
|
+
() => {
|
|
1493
|
+
const { element: f, manager: d } = this;
|
|
1494
|
+
if (!d) return;
|
|
1495
|
+
const { dragOperation: c } = d, { source: h } = c;
|
|
1496
|
+
l.value = !!(h && c.status.initialized && f && !this.disabled && this.accepts(h));
|
|
1497
|
+
},
|
|
1498
|
+
() => {
|
|
1499
|
+
const { element: f } = this;
|
|
1500
|
+
if (l.value && f) {
|
|
1501
|
+
const d = new Er(
|
|
1502
|
+
f,
|
|
1503
|
+
a
|
|
1504
|
+
);
|
|
1505
|
+
return () => {
|
|
1506
|
+
d.disconnect(), this.shape = void 0;
|
|
1507
|
+
};
|
|
1508
|
+
}
|
|
1509
|
+
},
|
|
1510
|
+
() => {
|
|
1511
|
+
var f;
|
|
1512
|
+
if ((f = this.manager) != null && f.dragOperation.status.initialized)
|
|
1513
|
+
return () => {
|
|
1514
|
+
this.shape = void 0;
|
|
1515
|
+
};
|
|
1516
|
+
}
|
|
1517
|
+
]
|
|
1518
|
+
}),
|
|
1519
|
+
t
|
|
1520
|
+
), E(this, _e), E(this, Dt, x(B, 8, this)), x(B, 11, this), E(this, Ot, x(B, 12, this)), x(B, 15, this), this.element = r, this.refreshShape = () => a();
|
|
1521
|
+
}
|
|
1522
|
+
set element(e) {
|
|
1523
|
+
O(this, _e, e, Hn);
|
|
1524
|
+
}
|
|
1525
|
+
get element() {
|
|
1526
|
+
var e;
|
|
1527
|
+
return (e = this.proxy) != null ? e : y(this, _e, Bn);
|
|
1528
|
+
}
|
|
1529
|
+
};
|
|
1530
|
+
B = fe(ht);
|
|
1531
|
+
Dt = /* @__PURE__ */ new WeakMap();
|
|
1532
|
+
_e = /* @__PURE__ */ new WeakSet();
|
|
1533
|
+
Ot = /* @__PURE__ */ new WeakMap();
|
|
1534
|
+
Ze = $(B, 20, "#element", jn, _e, Dt), Bn = Ze.get, Hn = Ze.set;
|
|
1535
|
+
$(B, 4, "proxy", Yn, Vn, Ot);
|
|
1536
|
+
Q(B, Vn);
|
|
1537
|
+
export {
|
|
1538
|
+
Jr as Accessibility,
|
|
1539
|
+
Nn as AutoScroller,
|
|
1540
|
+
Zr as Cursor,
|
|
1541
|
+
Fi as DragDropManager,
|
|
1542
|
+
Ue as Draggable,
|
|
1543
|
+
Vn as Droppable,
|
|
1544
|
+
fi as Feedback,
|
|
1545
|
+
Si as KeyboardSensor,
|
|
1546
|
+
ae as PointerActivationConstraints,
|
|
1547
|
+
ki as PointerSensor,
|
|
1548
|
+
wi as PreventSelection,
|
|
1549
|
+
_i as ScrollListener,
|
|
1550
|
+
Ke as Scroller,
|
|
1551
|
+
Z as StyleSheetManager,
|
|
1552
|
+
Qe as defaultPreset,
|
|
1553
|
+
qe as resolveCustomizable
|
|
1554
|
+
};
|