@adyen/bento-vue3 1.95.0 → 1.96.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.
Files changed (104) hide show
  1. package/dist/@types/index.d.ts +77 -0
  2. package/dist/assets/accordion-item.css +1 -1
  3. package/dist/assets/action-bar.css +1 -1
  4. package/dist/assets/base-modal.css +1 -1
  5. package/dist/assets/button-actions.css +1 -1
  6. package/dist/assets/card.css +1 -1
  7. package/dist/assets/data-grid.css +1 -1
  8. package/dist/assets/date-picker.css +1 -1
  9. package/dist/assets/dialog-page.css +1 -1
  10. package/dist/assets/draggable-handle.css +1 -1
  11. package/dist/assets/dropdown.css +1 -1
  12. package/dist/assets/field-label.css +1 -1
  13. package/dist/assets/file-uploader.css +1 -1
  14. package/dist/assets/filter-bar.css +1 -1
  15. package/dist/assets/input-field-password.css +1 -1
  16. package/dist/assets/inspector.css +1 -1
  17. package/dist/assets/modal-fullscreen.css +1 -1
  18. package/dist/assets/navigation-menu-group.css +1 -1
  19. package/dist/assets/secondary-nav.css +1 -1
  20. package/dist/assets/sidepanel.css +1 -1
  21. package/dist/checkbox.js +2 -2
  22. package/dist/chunks/{calendar.74nP7Nu6.js → calendar.iQyNwQBL.js} +64 -58
  23. package/dist/chunks/calendar.iQyNwQBL.js.map +1 -0
  24. package/dist/chunks/{checkbox-group.BWx4wn0F.js → checkbox-group.BcDIXL27.js} +2 -2
  25. package/dist/chunks/{checkbox-group.BWx4wn0F.js.map → checkbox-group.BcDIXL27.js.map} +1 -1
  26. package/dist/chunks/{checkbox.DwfrmbwI.js → checkbox.LTRqb-pE.js} +18 -18
  27. package/dist/chunks/{checkbox.DwfrmbwI.js.map → checkbox.LTRqb-pE.js.map} +1 -1
  28. package/dist/chunks/{code-snippet.B9QFjFXf.js → code-snippet.DHzB-8JJ.js} +2 -2
  29. package/dist/chunks/{code-snippet.B9QFjFXf.js.map → code-snippet.DHzB-8JJ.js.map} +1 -1
  30. package/dist/chunks/{dashboard-section.C4plNql-.js → dashboard-section.Da6ZFGtm.js} +2 -2
  31. package/dist/chunks/{dashboard-section.C4plNql-.js.map → dashboard-section.Da6ZFGtm.js.map} +1 -1
  32. package/dist/chunks/{data-grid-template.Bwxo0AII.js → data-grid-template.-MuGcJp1.js} +2 -2
  33. package/dist/chunks/{data-grid-template.Bwxo0AII.js.map → data-grid-template.-MuGcJp1.js.map} +1 -1
  34. package/dist/chunks/{data-grid.Bx3Xy1tb.js → data-grid.CNIXkdCJ.js} +8 -8
  35. package/dist/chunks/{data-grid.Bx3Xy1tb.js.map → data-grid.CNIXkdCJ.js.map} +1 -1
  36. package/dist/chunks/{date-picker.89J8PGKn.js → date-picker.DyImOUH4.js} +61 -61
  37. package/dist/chunks/date-picker.DyImOUH4.js.map +1 -0
  38. package/dist/chunks/{date-range-picker.iaXigXuW.js → date-range-picker.BigC6wm2.js} +67 -67
  39. package/dist/chunks/{date-range-picker.iaXigXuW.js.map → date-range-picker.BigC6wm2.js.map} +1 -1
  40. package/dist/chunks/draggable-handle.C1dudqKz.js +1649 -0
  41. package/dist/chunks/{draggable-handle.CKuHzAzS.js.map → draggable-handle.C1dudqKz.js.map} +1 -1
  42. package/dist/chunks/{dropdown-tag.DNWUbf7x.js → dropdown-tag.C1ei1SyR.js} +2 -2
  43. package/dist/chunks/{dropdown-tag.DNWUbf7x.js.map → dropdown-tag.C1ei1SyR.js.map} +1 -1
  44. package/dist/chunks/{dropdown.CK8cdMyV.js → dropdown.C5um1anU.js} +292 -278
  45. package/dist/chunks/dropdown.C5um1anU.js.map +1 -0
  46. package/dist/chunks/{filter-bar.CqbdRCQD.js → filter-bar.CvZnM3hM.js} +279 -276
  47. package/dist/chunks/{filter-bar.CqbdRCQD.js.map → filter-bar.CvZnM3hM.js.map} +1 -1
  48. package/dist/chunks/{header-with-views.CB8M1Udi.js → header-with-views.ubPTyW9A.js} +4 -4
  49. package/dist/chunks/{header-with-views.CB8M1Udi.js.map → header-with-views.ubPTyW9A.js.map} +1 -1
  50. package/dist/chunks/{input-field-password.DJKloBB3.js → input-field-password.CZ-NTpZF.js} +5 -3
  51. package/dist/chunks/input-field-password.CZ-NTpZF.js.map +1 -0
  52. package/dist/chunks/{input-field-phone-number.C3fQypln.js → input-field-phone-number.DOHk6gSp.js} +2 -2
  53. package/dist/chunks/{input-field-phone-number.C3fQypln.js.map → input-field-phone-number.DOHk6gSp.js.map} +1 -1
  54. package/dist/chunks/{input-field.HgrRdDec.js → input-field.DBlTGgAD.js} +2 -2
  55. package/dist/chunks/{input-field.HgrRdDec.js.map → input-field.DBlTGgAD.js.map} +1 -1
  56. package/dist/chunks/{input-time.DxCYIHSf.js → input-time.CHIjCO74.js} +3 -3
  57. package/dist/chunks/{input-time.DxCYIHSf.js.map → input-time.CHIjCO74.js.map} +1 -1
  58. package/dist/chunks/{pagination.vqSlDmeK.js → pagination.DbpHH_53.js} +2 -2
  59. package/dist/chunks/{pagination.vqSlDmeK.js.map → pagination.DbpHH_53.js.map} +1 -1
  60. package/dist/chunks/{rich-text-editor.u_fKHVgZ.js → rich-text-editor.u-V4fNWK.js} +2 -2
  61. package/dist/chunks/{rich-text-editor.u_fKHVgZ.js.map → rich-text-editor.u-V4fNWK.js.map} +1 -1
  62. package/dist/chunks/{search-bar.CgSUD89l.js → search-bar.TKgi1KLs.js} +3 -3
  63. package/dist/chunks/{search-bar.CgSUD89l.js.map → search-bar.TKgi1KLs.js.map} +1 -1
  64. package/dist/chunks/secondary-nav.0OsJiAWI.js +315 -0
  65. package/dist/chunks/{secondary-nav.BqqNrHZE.js.map → secondary-nav.0OsJiAWI.js.map} +1 -1
  66. package/dist/chunks/{selection-card-group.C2Av3uyz.js → selection-card-group.C59ZIrVm.js} +9 -9
  67. package/dist/chunks/{selection-card-group.C2Av3uyz.js.map → selection-card-group.C59ZIrVm.js.map} +1 -1
  68. package/dist/chunks/{tab.DWoYKpTv.js → tab.ByjWuWQz.js} +107 -98
  69. package/dist/chunks/{tab.DWoYKpTv.js.map → tab.ByjWuWQz.js.map} +1 -1
  70. package/dist/chunks/{use-cached-selected-values.CtWNiy-e.js → use-cached-selected-values.DOw5IKdU.js} +2 -2
  71. package/dist/chunks/{use-cached-selected-values.CtWNiy-e.js.map → use-cached-selected-values.DOw5IKdU.js.map} +1 -1
  72. package/dist/chunks/{use-date-input-formatter.BshboCF9.js → use-date-input-formatter.x285YiSd.js} +2 -2
  73. package/dist/chunks/{use-date-input-formatter.BshboCF9.js.map → use-date-input-formatter.x285YiSd.js.map} +1 -1
  74. package/dist/code-snippet.js +1 -1
  75. package/dist/dashboard-template.js +1 -1
  76. package/dist/data-grid-template.js +1 -1
  77. package/dist/data-grid.js +1 -1
  78. package/dist/date-picker.js +2 -2
  79. package/dist/date-range-picker.js +2 -2
  80. package/dist/date-time-picker.js +4 -4
  81. package/dist/draggable.js +1 -1
  82. package/dist/dropdown.js +3 -3
  83. package/dist/filter-bar.js +1 -1
  84. package/dist/header-with-views.js +1 -1
  85. package/dist/index.js +25 -25
  86. package/dist/input-field-password.js +1 -1
  87. package/dist/input-field-phone-number.js +1 -1
  88. package/dist/input-field.js +1 -1
  89. package/dist/input-time.js +1 -1
  90. package/dist/internal.js +2 -2
  91. package/dist/pagination.js +1 -1
  92. package/dist/rich-text-editor.js +1 -1
  93. package/dist/search-bar.js +2 -2
  94. package/dist/secondary-nav.js +1 -1
  95. package/dist/selection-card.js +1 -1
  96. package/dist/tabs.js +1 -1
  97. package/dist/web-types.json +1 -1
  98. package/package.json +3 -3
  99. package/dist/chunks/calendar.74nP7Nu6.js.map +0 -1
  100. package/dist/chunks/date-picker.89J8PGKn.js.map +0 -1
  101. package/dist/chunks/draggable-handle.CKuHzAzS.js +0 -1639
  102. package/dist/chunks/dropdown.CK8cdMyV.js.map +0 -1
  103. package/dist/chunks/input-field-password.DJKloBB3.js.map +0 -1
  104. package/dist/chunks/secondary-nav.BqqNrHZE.js +0 -306
@@ -1,1639 +0,0 @@
1
- import { ref as ie, watch as at, markRaw as no, onUnmounted as Nt, defineComponent as xt, computed as Fe, openBlock as ce, createBlock as Lt, resolveDynamicComponent as ro, withCtx as Rt, createElementBlock as Me, Fragment as io, renderList as ao, renderSlot as lo, createElementVNode as Ve, toDisplayString as ft, unref as lt, nextTick as bt, mergeProps as Bt, createCommentVNode as Ft, normalizeClass as so, createVNode as uo } from "vue";
2
- import { u as kt } from "./index.B875RXHM.js";
3
- import { l as co, m as Ne } from "./index.oOAkh64h.js";
4
- import { _ as qe } from "./_plugin-vue_export-helper.CHgC5LLL.js";
5
- import { f as fo } from "./button-actions.CxTxPprd.js";
6
- import { G as ho } from "./grab.DJYL4kBq.js";
7
- /* empty css */
8
- import { A as po } from "./arrow-left.C6UiqO-c.js";
9
- import { A as mo } from "./arrow-right.fSdLV_ho.js";
10
- import "../assets/draggable-handle.css";
11
- function wt(n, e) {
12
- var o = Object.keys(n);
13
- if (Object.getOwnPropertySymbols) {
14
- var t = Object.getOwnPropertySymbols(n);
15
- e && (t = t.filter(function(r) {
16
- return Object.getOwnPropertyDescriptor(n, r).enumerable;
17
- })), o.push.apply(o, t);
18
- }
19
- return o;
20
- }
21
- function q(n) {
22
- for (var e = 1; e < arguments.length; e++) {
23
- var o = arguments[e] != null ? arguments[e] : {};
24
- e % 2 ? wt(Object(o), !0).forEach(function(t) {
25
- go(n, t, o[t]);
26
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(n, Object.getOwnPropertyDescriptors(o)) : wt(Object(o)).forEach(function(t) {
27
- Object.defineProperty(n, t, Object.getOwnPropertyDescriptor(o, t));
28
- });
29
- }
30
- return n;
31
- }
32
- function ke(n) {
33
- "@babel/helpers - typeof";
34
- return typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? ke = function(e) {
35
- return typeof e;
36
- } : ke = function(e) {
37
- return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
38
- }, ke(n);
39
- }
40
- function go(n, e, o) {
41
- return e in n ? Object.defineProperty(n, e, {
42
- value: o,
43
- enumerable: !0,
44
- configurable: !0,
45
- writable: !0
46
- }) : n[e] = o, n;
47
- }
48
- function ee() {
49
- return ee = Object.assign || function(n) {
50
- for (var e = 1; e < arguments.length; e++) {
51
- var o = arguments[e];
52
- for (var t in o)
53
- Object.prototype.hasOwnProperty.call(o, t) && (n[t] = o[t]);
54
- }
55
- return n;
56
- }, ee.apply(this, arguments);
57
- }
58
- function vo(n, e) {
59
- if (n == null) return {};
60
- var o = {}, t = Object.keys(n), r, i;
61
- for (i = 0; i < t.length; i++)
62
- r = t[i], !(e.indexOf(r) >= 0) && (o[r] = n[r]);
63
- return o;
64
- }
65
- function bo(n, e) {
66
- if (n == null) return {};
67
- var o = vo(n, e), t, r;
68
- if (Object.getOwnPropertySymbols) {
69
- var i = Object.getOwnPropertySymbols(n);
70
- for (r = 0; r < i.length; r++)
71
- t = i[r], !(e.indexOf(t) >= 0) && Object.prototype.propertyIsEnumerable.call(n, t) && (o[t] = n[t]);
72
- }
73
- return o;
74
- }
75
- var wo = "1.15.6";
76
- function Q(n) {
77
- if (typeof window < "u" && window.navigator)
78
- return !!/* @__PURE__ */ navigator.userAgent.match(n);
79
- }
80
- var te = Q(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i), Oe = Q(/Edge/i), yt = Q(/firefox/i), De = Q(/safari/i) && !Q(/chrome/i) && !Q(/android/i), ht = Q(/iP(ad|od|hone)/i), Yt = Q(/chrome/i) && Q(/android/i), Xt = {
81
- capture: !1,
82
- passive: !1
83
- };
84
- function y(n, e, o) {
85
- n.addEventListener(e, o, !te && Xt);
86
- }
87
- function b(n, e, o) {
88
- n.removeEventListener(e, o, !te && Xt);
89
- }
90
- function Ue(n, e) {
91
- if (e) {
92
- if (e[0] === ">" && (e = e.substring(1)), n)
93
- try {
94
- if (n.matches)
95
- return n.matches(e);
96
- if (n.msMatchesSelector)
97
- return n.msMatchesSelector(e);
98
- if (n.webkitMatchesSelector)
99
- return n.webkitMatchesSelector(e);
100
- } catch {
101
- return !1;
102
- }
103
- return !1;
104
- }
105
- }
106
- function $t(n) {
107
- return n.host && n !== document && n.host.nodeType ? n.host : n.parentNode;
108
- }
109
- function j(n, e, o, t) {
110
- if (n) {
111
- o = o || document;
112
- do {
113
- if (e != null && (e[0] === ">" ? n.parentNode === o && Ue(n, e) : Ue(n, e)) || t && n === o)
114
- return n;
115
- if (n === o) break;
116
- } while (n = $t(n));
117
- }
118
- return null;
119
- }
120
- var Et = /\s+/g;
121
- function X(n, e, o) {
122
- if (n && e)
123
- if (n.classList)
124
- n.classList[o ? "add" : "remove"](e);
125
- else {
126
- var t = (" " + n.className + " ").replace(Et, " ").replace(" " + e + " ", " ");
127
- n.className = (t + (o ? " " + e : "")).replace(Et, " ");
128
- }
129
- }
130
- function p(n, e, o) {
131
- var t = n && n.style;
132
- if (t) {
133
- if (o === void 0)
134
- return document.defaultView && document.defaultView.getComputedStyle ? o = document.defaultView.getComputedStyle(n, "") : n.currentStyle && (o = n.currentStyle), e === void 0 ? o : o[e];
135
- !(e in t) && e.indexOf("webkit") === -1 && (e = "-webkit-" + e), t[e] = o + (typeof o == "string" ? "" : "px");
136
- }
137
- }
138
- function ge(n, e) {
139
- var o = "";
140
- if (typeof n == "string")
141
- o = n;
142
- else
143
- do {
144
- var t = p(n, "transform");
145
- t && t !== "none" && (o = t + " " + o);
146
- } while (!e && (n = n.parentNode));
147
- var r = window.DOMMatrix || window.WebKitCSSMatrix || window.CSSMatrix || window.MSCSSMatrix;
148
- return r && new r(o);
149
- }
150
- function Ht(n, e, o) {
151
- if (n) {
152
- var t = n.getElementsByTagName(e), r = 0, i = t.length;
153
- if (o)
154
- for (; r < i; r++)
155
- o(t[r], r);
156
- return t;
157
- }
158
- return [];
159
- }
160
- function V() {
161
- var n = document.scrollingElement;
162
- return n || document.documentElement;
163
- }
164
- function A(n, e, o, t, r) {
165
- if (!(!n.getBoundingClientRect && n !== window)) {
166
- var i, a, s, l, u, f, c;
167
- if (n !== window && n.parentNode && n !== V() ? (i = n.getBoundingClientRect(), a = i.top, s = i.left, l = i.bottom, u = i.right, f = i.height, c = i.width) : (a = 0, s = 0, l = window.innerHeight, u = window.innerWidth, f = window.innerHeight, c = window.innerWidth), (e || o) && n !== window && (r = r || n.parentNode, !te))
168
- do
169
- if (r && r.getBoundingClientRect && (p(r, "transform") !== "none" || o && p(r, "position") !== "static")) {
170
- var v = r.getBoundingClientRect();
171
- a -= v.top + parseInt(p(r, "border-top-width")), s -= v.left + parseInt(p(r, "border-left-width")), l = a + i.height, u = s + i.width;
172
- break;
173
- }
174
- while (r = r.parentNode);
175
- if (t && n !== window) {
176
- var _ = ge(r || n), w = _ && _.a, E = _ && _.d;
177
- _ && (a /= E, s /= w, c /= w, f /= E, l = a + f, u = s + c);
178
- }
179
- return {
180
- top: a,
181
- left: s,
182
- bottom: l,
183
- right: u,
184
- width: c,
185
- height: f
186
- };
187
- }
188
- }
189
- function _t(n, e, o) {
190
- for (var t = ae(n, !0), r = A(n)[e]; t; ) {
191
- var i = A(t)[o], a = void 0;
192
- if (a = r >= i, !a) return t;
193
- if (t === V()) break;
194
- t = ae(t, !1);
195
- }
196
- return !1;
197
- }
198
- function ve(n, e, o, t) {
199
- for (var r = 0, i = 0, a = n.children; i < a.length; ) {
200
- if (a[i].style.display !== "none" && a[i] !== m.ghost && (t || a[i] !== m.dragged) && j(a[i], o.draggable, n, !1)) {
201
- if (r === e)
202
- return a[i];
203
- r++;
204
- }
205
- i++;
206
- }
207
- return null;
208
- }
209
- function pt(n, e) {
210
- for (var o = n.lastElementChild; o && (o === m.ghost || p(o, "display") === "none" || e && !Ue(o, e)); )
211
- o = o.previousElementSibling;
212
- return o || null;
213
- }
214
- function U(n, e) {
215
- var o = 0;
216
- if (!n || !n.parentNode)
217
- return -1;
218
- for (; n = n.previousElementSibling; )
219
- n.nodeName.toUpperCase() !== "TEMPLATE" && n !== m.clone && (!e || Ue(n, e)) && o++;
220
- return o;
221
- }
222
- function Dt(n) {
223
- var e = 0, o = 0, t = V();
224
- if (n)
225
- do {
226
- var r = ge(n), i = r.a, a = r.d;
227
- e += n.scrollLeft * i, o += n.scrollTop * a;
228
- } while (n !== t && (n = n.parentNode));
229
- return [e, o];
230
- }
231
- function yo(n, e) {
232
- for (var o in n)
233
- if (n.hasOwnProperty(o)) {
234
- for (var t in e)
235
- if (e.hasOwnProperty(t) && e[t] === n[o][t]) return Number(o);
236
- }
237
- return -1;
238
- }
239
- function ae(n, e) {
240
- if (!n || !n.getBoundingClientRect) return V();
241
- var o = n, t = !1;
242
- do
243
- if (o.clientWidth < o.scrollWidth || o.clientHeight < o.scrollHeight) {
244
- var r = p(o);
245
- if (o.clientWidth < o.scrollWidth && (r.overflowX == "auto" || r.overflowX == "scroll") || o.clientHeight < o.scrollHeight && (r.overflowY == "auto" || r.overflowY == "scroll")) {
246
- if (!o.getBoundingClientRect || o === document.body) return V();
247
- if (t || e) return o;
248
- t = !0;
249
- }
250
- }
251
- while (o = o.parentNode);
252
- return V();
253
- }
254
- function Eo(n, e) {
255
- if (n && e)
256
- for (var o in e)
257
- e.hasOwnProperty(o) && (n[o] = e[o]);
258
- return n;
259
- }
260
- function Ze(n, e) {
261
- return Math.round(n.top) === Math.round(e.top) && Math.round(n.left) === Math.round(e.left) && Math.round(n.height) === Math.round(e.height) && Math.round(n.width) === Math.round(e.width);
262
- }
263
- var Te;
264
- function Ut(n, e) {
265
- return function() {
266
- if (!Te) {
267
- var o = arguments, t = this;
268
- o.length === 1 ? n.call(t, o[0]) : n.apply(t, o), Te = setTimeout(function() {
269
- Te = void 0;
270
- }, e);
271
- }
272
- };
273
- }
274
- function _o() {
275
- clearTimeout(Te), Te = void 0;
276
- }
277
- function Gt(n, e, o) {
278
- n.scrollLeft += e, n.scrollTop += o;
279
- }
280
- function Wt(n) {
281
- var e = window.Polymer, o = window.jQuery || window.Zepto;
282
- return e && e.dom ? e.dom(n).cloneNode(!0) : o ? o(n).clone(!0)[0] : n.cloneNode(!0);
283
- }
284
- function zt(n, e, o) {
285
- var t = {};
286
- return Array.from(n.children).forEach(function(r) {
287
- var i, a, s, l;
288
- if (!(!j(r, e.draggable, n, !1) || r.animated || r === o)) {
289
- var u = A(r);
290
- t.left = Math.min((i = t.left) !== null && i !== void 0 ? i : 1 / 0, u.left), t.top = Math.min((a = t.top) !== null && a !== void 0 ? a : 1 / 0, u.top), t.right = Math.max((s = t.right) !== null && s !== void 0 ? s : -1 / 0, u.right), t.bottom = Math.max((l = t.bottom) !== null && l !== void 0 ? l : -1 / 0, u.bottom);
291
- }
292
- }), t.width = t.right - t.left, t.height = t.bottom - t.top, t.x = t.left, t.y = t.top, t;
293
- }
294
- var k = "Sortable" + (/* @__PURE__ */ new Date()).getTime();
295
- function Do() {
296
- var n = [], e;
297
- return {
298
- captureAnimationState: function() {
299
- if (n = [], !!this.options.animation) {
300
- var t = [].slice.call(this.el.children);
301
- t.forEach(function(r) {
302
- if (!(p(r, "display") === "none" || r === m.ghost)) {
303
- n.push({
304
- target: r,
305
- rect: A(r)
306
- });
307
- var i = q({}, n[n.length - 1].rect);
308
- if (r.thisAnimationDuration) {
309
- var a = ge(r, !0);
310
- a && (i.top -= a.f, i.left -= a.e);
311
- }
312
- r.fromRect = i;
313
- }
314
- });
315
- }
316
- },
317
- addAnimationState: function(t) {
318
- n.push(t);
319
- },
320
- removeAnimationState: function(t) {
321
- n.splice(yo(n, {
322
- target: t
323
- }), 1);
324
- },
325
- animateAll: function(t) {
326
- var r = this;
327
- if (!this.options.animation) {
328
- clearTimeout(e), typeof t == "function" && t();
329
- return;
330
- }
331
- var i = !1, a = 0;
332
- n.forEach(function(s) {
333
- var l = 0, u = s.target, f = u.fromRect, c = A(u), v = u.prevFromRect, _ = u.prevToRect, w = s.rect, E = ge(u, !0);
334
- E && (c.top -= E.f, c.left -= E.e), u.toRect = c, u.thisAnimationDuration && Ze(v, c) && !Ze(f, c) && // Make sure animatingRect is on line between toRect & fromRect
335
- (w.top - c.top) / (w.left - c.left) === (f.top - c.top) / (f.left - c.left) && (l = So(w, v, _, r.options)), Ze(c, f) || (u.prevFromRect = f, u.prevToRect = c, l || (l = r.options.animation), r.animate(u, w, c, l)), l && (i = !0, a = Math.max(a, l), clearTimeout(u.animationResetTimer), u.animationResetTimer = setTimeout(function() {
336
- u.animationTime = 0, u.prevFromRect = null, u.fromRect = null, u.prevToRect = null, u.thisAnimationDuration = null;
337
- }, l), u.thisAnimationDuration = l);
338
- }), clearTimeout(e), i ? e = setTimeout(function() {
339
- typeof t == "function" && t();
340
- }, a) : typeof t == "function" && t(), n = [];
341
- },
342
- animate: function(t, r, i, a) {
343
- if (a) {
344
- p(t, "transition", ""), p(t, "transform", "");
345
- var s = ge(this.el), l = s && s.a, u = s && s.d, f = (r.left - i.left) / (l || 1), c = (r.top - i.top) / (u || 1);
346
- t.animatingX = !!f, t.animatingY = !!c, p(t, "transform", "translate3d(" + f + "px," + c + "px,0)"), this.forRepaintDummy = To(t), p(t, "transition", "transform " + a + "ms" + (this.options.easing ? " " + this.options.easing : "")), p(t, "transform", "translate3d(0,0,0)"), typeof t.animated == "number" && clearTimeout(t.animated), t.animated = setTimeout(function() {
347
- p(t, "transition", ""), p(t, "transform", ""), t.animated = !1, t.animatingX = !1, t.animatingY = !1;
348
- }, a);
349
- }
350
- }
351
- };
352
- }
353
- function To(n) {
354
- return n.offsetWidth;
355
- }
356
- function So(n, e, o, t) {
357
- return Math.sqrt(Math.pow(e.top - n.top, 2) + Math.pow(e.left - n.left, 2)) / Math.sqrt(Math.pow(e.top - o.top, 2) + Math.pow(e.left - o.left, 2)) * t.animation;
358
- }
359
- var fe = [], Je = {
360
- initializeByDefault: !0
361
- }, Ae = {
362
- mount: function(e) {
363
- for (var o in Je)
364
- Je.hasOwnProperty(o) && !(o in e) && (e[o] = Je[o]);
365
- fe.forEach(function(t) {
366
- if (t.pluginName === e.pluginName)
367
- throw "Sortable: Cannot mount plugin ".concat(e.pluginName, " more than once");
368
- }), fe.push(e);
369
- },
370
- pluginEvent: function(e, o, t) {
371
- var r = this;
372
- this.eventCanceled = !1, t.cancel = function() {
373
- r.eventCanceled = !0;
374
- };
375
- var i = e + "Global";
376
- fe.forEach(function(a) {
377
- o[a.pluginName] && (o[a.pluginName][i] && o[a.pluginName][i](q({
378
- sortable: o
379
- }, t)), o.options[a.pluginName] && o[a.pluginName][e] && o[a.pluginName][e](q({
380
- sortable: o
381
- }, t)));
382
- });
383
- },
384
- initializePlugins: function(e, o, t, r) {
385
- fe.forEach(function(s) {
386
- var l = s.pluginName;
387
- if (!(!e.options[l] && !s.initializeByDefault)) {
388
- var u = new s(e, o, e.options);
389
- u.sortable = e, u.options = e.options, e[l] = u, ee(t, u.defaults);
390
- }
391
- });
392
- for (var i in e.options)
393
- if (e.options.hasOwnProperty(i)) {
394
- var a = this.modifyOption(e, i, e.options[i]);
395
- typeof a < "u" && (e.options[i] = a);
396
- }
397
- },
398
- getEventProperties: function(e, o) {
399
- var t = {};
400
- return fe.forEach(function(r) {
401
- typeof r.eventProperties == "function" && ee(t, r.eventProperties.call(o[r.pluginName], e));
402
- }), t;
403
- },
404
- modifyOption: function(e, o, t) {
405
- var r;
406
- return fe.forEach(function(i) {
407
- e[i.pluginName] && i.optionListeners && typeof i.optionListeners[o] == "function" && (r = i.optionListeners[o].call(e[i.pluginName], t));
408
- }), r;
409
- }
410
- };
411
- function Io(n) {
412
- var e = n.sortable, o = n.rootEl, t = n.name, r = n.targetEl, i = n.cloneEl, a = n.toEl, s = n.fromEl, l = n.oldIndex, u = n.newIndex, f = n.oldDraggableIndex, c = n.newDraggableIndex, v = n.originalEvent, _ = n.putSortable, w = n.extraEventProperties;
413
- if (e = e || o && o[k], !!e) {
414
- var E, M = e.options, G = "on" + t.charAt(0).toUpperCase() + t.substr(1);
415
- window.CustomEvent && !te && !Oe ? E = new CustomEvent(t, {
416
- bubbles: !0,
417
- cancelable: !0
418
- }) : (E = document.createEvent("Event"), E.initEvent(t, !0, !0)), E.to = a || o, E.from = s || o, E.item = r || o, E.clone = i, E.oldIndex = l, E.newIndex = u, E.oldDraggableIndex = f, E.newDraggableIndex = c, E.originalEvent = v, E.pullMode = _ ? _.lastPutMode : void 0;
419
- var N = q(q({}, w), Ae.getEventProperties(t, e));
420
- for (var Y in N)
421
- E[Y] = N[Y];
422
- o && o.dispatchEvent(E), M[G] && M[G].call(e, E);
423
- }
424
- }
425
- var Co = ["evt"], F = function(e, o) {
426
- var t = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, r = t.evt, i = bo(t, Co);
427
- Ae.pluginEvent.bind(m)(e, o, q({
428
- dragEl: d,
429
- parentEl: C,
430
- ghostEl: g,
431
- rootEl: S,
432
- nextEl: de,
433
- lastDownEl: Ye,
434
- cloneEl: I,
435
- cloneHidden: re,
436
- dragStarted: ye,
437
- putSortable: x,
438
- activeSortable: m.active,
439
- originalEvent: r,
440
- oldIndex: me,
441
- oldDraggableIndex: Se,
442
- newIndex: $,
443
- newDraggableIndex: ne,
444
- hideGhostForTarget: Kt,
445
- unhideGhostForTarget: Zt,
446
- cloneNowHidden: function() {
447
- re = !0;
448
- },
449
- cloneNowShown: function() {
450
- re = !1;
451
- },
452
- dispatchSortableEvent: function(s) {
453
- B({
454
- sortable: o,
455
- name: s,
456
- originalEvent: r
457
- });
458
- }
459
- }, i));
460
- };
461
- function B(n) {
462
- Io(q({
463
- putSortable: x,
464
- cloneEl: I,
465
- targetEl: d,
466
- rootEl: S,
467
- oldIndex: me,
468
- oldDraggableIndex: Se,
469
- newIndex: $,
470
- newDraggableIndex: ne
471
- }, n));
472
- }
473
- var d, C, g, S, de, Ye, I, re, me, $, Se, ne, xe, x, pe = !1, Ge = !1, We = [], se, z, Qe, et, Tt, St, ye, he, Ie, Ce = !1, Le = !1, Xe, L, tt = [], st = !1, ze = [], Ke = typeof document < "u", Re = ht, It = Oe || te ? "cssFloat" : "float", Mo = Ke && !Yt && !ht && "draggable" in document.createElement("div"), jt = (function() {
474
- if (Ke) {
475
- if (te)
476
- return !1;
477
- var n = document.createElement("x");
478
- return n.style.cssText = "pointer-events:auto", n.style.pointerEvents === "auto";
479
- }
480
- })(), Vt = function(e, o) {
481
- var t = p(e), r = parseInt(t.width) - parseInt(t.paddingLeft) - parseInt(t.paddingRight) - parseInt(t.borderLeftWidth) - parseInt(t.borderRightWidth), i = ve(e, 0, o), a = ve(e, 1, o), s = i && p(i), l = a && p(a), u = s && parseInt(s.marginLeft) + parseInt(s.marginRight) + A(i).width, f = l && parseInt(l.marginLeft) + parseInt(l.marginRight) + A(a).width;
482
- if (t.display === "flex")
483
- return t.flexDirection === "column" || t.flexDirection === "column-reverse" ? "vertical" : "horizontal";
484
- if (t.display === "grid")
485
- return t.gridTemplateColumns.split(" ").length <= 1 ? "vertical" : "horizontal";
486
- if (i && s.float && s.float !== "none") {
487
- var c = s.float === "left" ? "left" : "right";
488
- return a && (l.clear === "both" || l.clear === c) ? "vertical" : "horizontal";
489
- }
490
- return i && (s.display === "block" || s.display === "flex" || s.display === "table" || s.display === "grid" || u >= r && t[It] === "none" || a && t[It] === "none" && u + f > r) ? "vertical" : "horizontal";
491
- }, Oo = function(e, o, t) {
492
- var r = t ? e.left : e.top, i = t ? e.right : e.bottom, a = t ? e.width : e.height, s = t ? o.left : o.top, l = t ? o.right : o.bottom, u = t ? o.width : o.height;
493
- return r === s || i === l || r + a / 2 === s + u / 2;
494
- }, Ao = function(e, o) {
495
- var t;
496
- return We.some(function(r) {
497
- var i = r[k].options.emptyInsertThreshold;
498
- if (!(!i || pt(r))) {
499
- var a = A(r), s = e >= a.left - i && e <= a.right + i, l = o >= a.top - i && o <= a.bottom + i;
500
- if (s && l)
501
- return t = r;
502
- }
503
- }), t;
504
- }, qt = function(e) {
505
- function o(i, a) {
506
- return function(s, l, u, f) {
507
- var c = s.options.group.name && l.options.group.name && s.options.group.name === l.options.group.name;
508
- if (i == null && (a || c))
509
- return !0;
510
- if (i == null || i === !1)
511
- return !1;
512
- if (a && i === "clone")
513
- return i;
514
- if (typeof i == "function")
515
- return o(i(s, l, u, f), a)(s, l, u, f);
516
- var v = (a ? s : l).options.group.name;
517
- return i === !0 || typeof i == "string" && i === v || i.join && i.indexOf(v) > -1;
518
- };
519
- }
520
- var t = {}, r = e.group;
521
- (!r || ke(r) != "object") && (r = {
522
- name: r
523
- }), t.name = r.name, t.checkPull = o(r.pull, !0), t.checkPut = o(r.put), t.revertClone = r.revertClone, e.group = t;
524
- }, Kt = function() {
525
- !jt && g && p(g, "display", "none");
526
- }, Zt = function() {
527
- !jt && g && p(g, "display", "");
528
- };
529
- Ke && !Yt && document.addEventListener("click", function(n) {
530
- if (Ge)
531
- return n.preventDefault(), n.stopPropagation && n.stopPropagation(), n.stopImmediatePropagation && n.stopImmediatePropagation(), Ge = !1, !1;
532
- }, !0);
533
- var ue = function(e) {
534
- if (d) {
535
- e = e.touches ? e.touches[0] : e;
536
- var o = Ao(e.clientX, e.clientY);
537
- if (o) {
538
- var t = {};
539
- for (var r in e)
540
- e.hasOwnProperty(r) && (t[r] = e[r]);
541
- t.target = t.rootEl = o, t.preventDefault = void 0, t.stopPropagation = void 0, o[k]._onDragOver(t);
542
- }
543
- }
544
- }, Po = function(e) {
545
- d && d.parentNode[k]._isOutsideThisEl(e.target);
546
- };
547
- function m(n, e) {
548
- if (!(n && n.nodeType && n.nodeType === 1))
549
- throw "Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(n));
550
- this.el = n, this.options = e = ee({}, e), n[k] = this;
551
- var o = {
552
- group: null,
553
- sort: !0,
554
- disabled: !1,
555
- store: null,
556
- handle: null,
557
- draggable: /^[uo]l$/i.test(n.nodeName) ? ">li" : ">*",
558
- swapThreshold: 1,
559
- // percentage; 0 <= x <= 1
560
- invertSwap: !1,
561
- // invert always
562
- invertedSwapThreshold: null,
563
- // will be set to same as swapThreshold if default
564
- removeCloneOnHide: !0,
565
- direction: function() {
566
- return Vt(n, this.options);
567
- },
568
- ghostClass: "sortable-ghost",
569
- chosenClass: "sortable-chosen",
570
- dragClass: "sortable-drag",
571
- ignore: "a, img",
572
- filter: null,
573
- preventOnFilter: !0,
574
- animation: 0,
575
- easing: null,
576
- setData: function(a, s) {
577
- a.setData("Text", s.textContent);
578
- },
579
- dropBubble: !1,
580
- dragoverBubble: !1,
581
- dataIdAttr: "data-id",
582
- delay: 0,
583
- delayOnTouchOnly: !1,
584
- touchStartThreshold: (Number.parseInt ? Number : window).parseInt(window.devicePixelRatio, 10) || 1,
585
- forceFallback: !1,
586
- fallbackClass: "sortable-fallback",
587
- fallbackOnBody: !1,
588
- fallbackTolerance: 0,
589
- fallbackOffset: {
590
- x: 0,
591
- y: 0
592
- },
593
- // Disabled on Safari: #1571; Enabled on Safari IOS: #2244
594
- supportPointer: m.supportPointer !== !1 && "PointerEvent" in window && (!De || ht),
595
- emptyInsertThreshold: 5
596
- };
597
- Ae.initializePlugins(this, n, o);
598
- for (var t in o)
599
- !(t in e) && (e[t] = o[t]);
600
- qt(e);
601
- for (var r in this)
602
- r.charAt(0) === "_" && typeof this[r] == "function" && (this[r] = this[r].bind(this));
603
- this.nativeDraggable = e.forceFallback ? !1 : Mo, this.nativeDraggable && (this.options.touchStartThreshold = 1), e.supportPointer ? y(n, "pointerdown", this._onTapStart) : (y(n, "mousedown", this._onTapStart), y(n, "touchstart", this._onTapStart)), this.nativeDraggable && (y(n, "dragover", this), y(n, "dragenter", this)), We.push(this.el), e.store && e.store.get && this.sort(e.store.get(this) || []), ee(this, Do());
604
- }
605
- m.prototype = /** @lends Sortable.prototype */
606
- {
607
- constructor: m,
608
- _isOutsideThisEl: function(e) {
609
- !this.el.contains(e) && e !== this.el && (he = null);
610
- },
611
- _getDirection: function(e, o) {
612
- return typeof this.options.direction == "function" ? this.options.direction.call(this, e, o, d) : this.options.direction;
613
- },
614
- _onTapStart: function(e) {
615
- if (e.cancelable) {
616
- var o = this, t = this.el, r = this.options, i = r.preventOnFilter, a = e.type, s = e.touches && e.touches[0] || e.pointerType && e.pointerType === "touch" && e, l = (s || e).target, u = e.target.shadowRoot && (e.path && e.path[0] || e.composedPath && e.composedPath()[0]) || l, f = r.filter;
617
- if (Yo(t), !d && !(/mousedown|pointerdown/.test(a) && e.button !== 0 || r.disabled) && !u.isContentEditable && !(!this.nativeDraggable && De && l && l.tagName.toUpperCase() === "SELECT") && (l = j(l, r.draggable, t, !1), !(l && l.animated) && Ye !== l)) {
618
- if (me = U(l), Se = U(l, r.draggable), typeof f == "function") {
619
- if (f.call(this, e, l, this)) {
620
- B({
621
- sortable: o,
622
- rootEl: u,
623
- name: "filter",
624
- targetEl: l,
625
- toEl: t,
626
- fromEl: t
627
- }), F("filter", o, {
628
- evt: e
629
- }), i && e.preventDefault();
630
- return;
631
- }
632
- } else if (f && (f = f.split(",").some(function(c) {
633
- if (c = j(u, c.trim(), t, !1), c)
634
- return B({
635
- sortable: o,
636
- rootEl: c,
637
- name: "filter",
638
- targetEl: l,
639
- fromEl: t,
640
- toEl: t
641
- }), F("filter", o, {
642
- evt: e
643
- }), !0;
644
- }), f)) {
645
- i && e.preventDefault();
646
- return;
647
- }
648
- r.handle && !j(u, r.handle, t, !1) || this._prepareDragStart(e, s, l);
649
- }
650
- }
651
- },
652
- _prepareDragStart: function(e, o, t) {
653
- var r = this, i = r.el, a = r.options, s = i.ownerDocument, l;
654
- if (t && !d && t.parentNode === i) {
655
- var u = A(t);
656
- if (S = i, d = t, C = d.parentNode, de = d.nextSibling, Ye = t, xe = a.group, m.dragged = d, se = {
657
- target: d,
658
- clientX: (o || e).clientX,
659
- clientY: (o || e).clientY
660
- }, Tt = se.clientX - u.left, St = se.clientY - u.top, this._lastX = (o || e).clientX, this._lastY = (o || e).clientY, d.style["will-change"] = "all", l = function() {
661
- if (F("delayEnded", r, {
662
- evt: e
663
- }), m.eventCanceled) {
664
- r._onDrop();
665
- return;
666
- }
667
- r._disableDelayedDragEvents(), !yt && r.nativeDraggable && (d.draggable = !0), r._triggerDragStart(e, o), B({
668
- sortable: r,
669
- name: "choose",
670
- originalEvent: e
671
- }), X(d, a.chosenClass, !0);
672
- }, a.ignore.split(",").forEach(function(f) {
673
- Ht(d, f.trim(), ot);
674
- }), y(s, "dragover", ue), y(s, "mousemove", ue), y(s, "touchmove", ue), a.supportPointer ? (y(s, "pointerup", r._onDrop), !this.nativeDraggable && y(s, "pointercancel", r._onDrop)) : (y(s, "mouseup", r._onDrop), y(s, "touchend", r._onDrop), y(s, "touchcancel", r._onDrop)), yt && this.nativeDraggable && (this.options.touchStartThreshold = 4, d.draggable = !0), F("delayStart", this, {
675
- evt: e
676
- }), a.delay && (!a.delayOnTouchOnly || o) && (!this.nativeDraggable || !(Oe || te))) {
677
- if (m.eventCanceled) {
678
- this._onDrop();
679
- return;
680
- }
681
- a.supportPointer ? (y(s, "pointerup", r._disableDelayedDrag), y(s, "pointercancel", r._disableDelayedDrag)) : (y(s, "mouseup", r._disableDelayedDrag), y(s, "touchend", r._disableDelayedDrag), y(s, "touchcancel", r._disableDelayedDrag)), y(s, "mousemove", r._delayedDragTouchMoveHandler), y(s, "touchmove", r._delayedDragTouchMoveHandler), a.supportPointer && y(s, "pointermove", r._delayedDragTouchMoveHandler), r._dragStartTimer = setTimeout(l, a.delay);
682
- } else
683
- l();
684
- }
685
- },
686
- _delayedDragTouchMoveHandler: function(e) {
687
- var o = e.touches ? e.touches[0] : e;
688
- Math.max(Math.abs(o.clientX - this._lastX), Math.abs(o.clientY - this._lastY)) >= Math.floor(this.options.touchStartThreshold / (this.nativeDraggable && window.devicePixelRatio || 1)) && this._disableDelayedDrag();
689
- },
690
- _disableDelayedDrag: function() {
691
- d && ot(d), clearTimeout(this._dragStartTimer), this._disableDelayedDragEvents();
692
- },
693
- _disableDelayedDragEvents: function() {
694
- var e = this.el.ownerDocument;
695
- b(e, "mouseup", this._disableDelayedDrag), b(e, "touchend", this._disableDelayedDrag), b(e, "touchcancel", this._disableDelayedDrag), b(e, "pointerup", this._disableDelayedDrag), b(e, "pointercancel", this._disableDelayedDrag), b(e, "mousemove", this._delayedDragTouchMoveHandler), b(e, "touchmove", this._delayedDragTouchMoveHandler), b(e, "pointermove", this._delayedDragTouchMoveHandler);
696
- },
697
- _triggerDragStart: function(e, o) {
698
- o = o || e.pointerType == "touch" && e, !this.nativeDraggable || o ? this.options.supportPointer ? y(document, "pointermove", this._onTouchMove) : o ? y(document, "touchmove", this._onTouchMove) : y(document, "mousemove", this._onTouchMove) : (y(d, "dragend", this), y(S, "dragstart", this._onDragStart));
699
- try {
700
- document.selection ? $e(function() {
701
- document.selection.empty();
702
- }) : window.getSelection().removeAllRanges();
703
- } catch {
704
- }
705
- },
706
- _dragStarted: function(e, o) {
707
- if (pe = !1, S && d) {
708
- F("dragStarted", this, {
709
- evt: o
710
- }), this.nativeDraggable && y(document, "dragover", Po);
711
- var t = this.options;
712
- !e && X(d, t.dragClass, !1), X(d, t.ghostClass, !0), m.active = this, e && this._appendGhost(), B({
713
- sortable: this,
714
- name: "start",
715
- originalEvent: o
716
- });
717
- } else
718
- this._nulling();
719
- },
720
- _emulateDragOver: function() {
721
- if (z) {
722
- this._lastX = z.clientX, this._lastY = z.clientY, Kt();
723
- for (var e = document.elementFromPoint(z.clientX, z.clientY), o = e; e && e.shadowRoot && (e = e.shadowRoot.elementFromPoint(z.clientX, z.clientY), e !== o); )
724
- o = e;
725
- if (d.parentNode[k]._isOutsideThisEl(e), o)
726
- do {
727
- if (o[k]) {
728
- var t = void 0;
729
- if (t = o[k]._onDragOver({
730
- clientX: z.clientX,
731
- clientY: z.clientY,
732
- target: e,
733
- rootEl: o
734
- }), t && !this.options.dragoverBubble)
735
- break;
736
- }
737
- e = o;
738
- } while (o = $t(o));
739
- Zt();
740
- }
741
- },
742
- _onTouchMove: function(e) {
743
- if (se) {
744
- var o = this.options, t = o.fallbackTolerance, r = o.fallbackOffset, i = e.touches ? e.touches[0] : e, a = g && ge(g, !0), s = g && a && a.a, l = g && a && a.d, u = Re && L && Dt(L), f = (i.clientX - se.clientX + r.x) / (s || 1) + (u ? u[0] - tt[0] : 0) / (s || 1), c = (i.clientY - se.clientY + r.y) / (l || 1) + (u ? u[1] - tt[1] : 0) / (l || 1);
745
- if (!m.active && !pe) {
746
- if (t && Math.max(Math.abs(i.clientX - this._lastX), Math.abs(i.clientY - this._lastY)) < t)
747
- return;
748
- this._onDragStart(e, !0);
749
- }
750
- if (g) {
751
- a ? (a.e += f - (Qe || 0), a.f += c - (et || 0)) : a = {
752
- a: 1,
753
- b: 0,
754
- c: 0,
755
- d: 1,
756
- e: f,
757
- f: c
758
- };
759
- var v = "matrix(".concat(a.a, ",").concat(a.b, ",").concat(a.c, ",").concat(a.d, ",").concat(a.e, ",").concat(a.f, ")");
760
- p(g, "webkitTransform", v), p(g, "mozTransform", v), p(g, "msTransform", v), p(g, "transform", v), Qe = f, et = c, z = i;
761
- }
762
- e.cancelable && e.preventDefault();
763
- }
764
- },
765
- _appendGhost: function() {
766
- if (!g) {
767
- var e = this.options.fallbackOnBody ? document.body : S, o = A(d, !0, Re, !0, e), t = this.options;
768
- if (Re) {
769
- for (L = e; p(L, "position") === "static" && p(L, "transform") === "none" && L !== document; )
770
- L = L.parentNode;
771
- L !== document.body && L !== document.documentElement ? (L === document && (L = V()), o.top += L.scrollTop, o.left += L.scrollLeft) : L = V(), tt = Dt(L);
772
- }
773
- g = d.cloneNode(!0), X(g, t.ghostClass, !1), X(g, t.fallbackClass, !0), X(g, t.dragClass, !0), p(g, "transition", ""), p(g, "transform", ""), p(g, "box-sizing", "border-box"), p(g, "margin", 0), p(g, "top", o.top), p(g, "left", o.left), p(g, "width", o.width), p(g, "height", o.height), p(g, "opacity", "0.8"), p(g, "position", Re ? "absolute" : "fixed"), p(g, "zIndex", "100000"), p(g, "pointerEvents", "none"), m.ghost = g, e.appendChild(g), p(g, "transform-origin", Tt / parseInt(g.style.width) * 100 + "% " + St / parseInt(g.style.height) * 100 + "%");
774
- }
775
- },
776
- _onDragStart: function(e, o) {
777
- var t = this, r = e.dataTransfer, i = t.options;
778
- if (F("dragStart", this, {
779
- evt: e
780
- }), m.eventCanceled) {
781
- this._onDrop();
782
- return;
783
- }
784
- F("setupClone", this), m.eventCanceled || (I = Wt(d), I.removeAttribute("id"), I.draggable = !1, I.style["will-change"] = "", this._hideClone(), X(I, this.options.chosenClass, !1), m.clone = I), t.cloneId = $e(function() {
785
- F("clone", t), !m.eventCanceled && (t.options.removeCloneOnHide || S.insertBefore(I, d), t._hideClone(), B({
786
- sortable: t,
787
- name: "clone"
788
- }));
789
- }), !o && X(d, i.dragClass, !0), o ? (Ge = !0, t._loopId = setInterval(t._emulateDragOver, 50)) : (b(document, "mouseup", t._onDrop), b(document, "touchend", t._onDrop), b(document, "touchcancel", t._onDrop), r && (r.effectAllowed = "move", i.setData && i.setData.call(t, r, d)), y(document, "drop", t), p(d, "transform", "translateZ(0)")), pe = !0, t._dragStartId = $e(t._dragStarted.bind(t, o, e)), y(document, "selectstart", t), ye = !0, window.getSelection().removeAllRanges(), De && p(document.body, "user-select", "none");
790
- },
791
- // Returns true - if no further action is needed (either inserted or another condition)
792
- _onDragOver: function(e) {
793
- var o = this.el, t = e.target, r, i, a, s = this.options, l = s.group, u = m.active, f = xe === l, c = s.sort, v = x || u, _, w = this, E = !1;
794
- if (st) return;
795
- function M(we, to) {
796
- F(we, w, q({
797
- evt: e,
798
- isOwner: f,
799
- axis: _ ? "vertical" : "horizontal",
800
- revert: a,
801
- dragRect: r,
802
- targetRect: i,
803
- canSort: c,
804
- fromSortable: v,
805
- target: t,
806
- completed: N,
807
- onMove: function(vt, oo) {
808
- return Be(S, o, d, r, vt, A(vt), e, oo);
809
- },
810
- changed: Y
811
- }, to));
812
- }
813
- function G() {
814
- M("dragOverAnimationCapture"), w.captureAnimationState(), w !== v && v.captureAnimationState();
815
- }
816
- function N(we) {
817
- return M("dragOverCompleted", {
818
- insertion: we
819
- }), we && (f ? u._hideClone() : u._showClone(w), w !== v && (X(d, x ? x.options.ghostClass : u.options.ghostClass, !1), X(d, s.ghostClass, !0)), x !== w && w !== m.active ? x = w : w === m.active && x && (x = null), v === w && (w._ignoreWhileAnimating = t), w.animateAll(function() {
820
- M("dragOverAnimationComplete"), w._ignoreWhileAnimating = null;
821
- }), w !== v && (v.animateAll(), v._ignoreWhileAnimating = null)), (t === d && !d.animated || t === o && !t.animated) && (he = null), !s.dragoverBubble && !e.rootEl && t !== document && (d.parentNode[k]._isOutsideThisEl(e.target), !we && ue(e)), !s.dragoverBubble && e.stopPropagation && e.stopPropagation(), E = !0;
822
- }
823
- function Y() {
824
- $ = U(d), ne = U(d, s.draggable), B({
825
- sortable: w,
826
- name: "change",
827
- toEl: o,
828
- newIndex: $,
829
- newDraggableIndex: ne,
830
- originalEvent: e
831
- });
832
- }
833
- if (e.preventDefault !== void 0 && e.cancelable && e.preventDefault(), t = j(t, s.draggable, o, !0), M("dragOver"), m.eventCanceled) return E;
834
- if (d.contains(e.target) || t.animated && t.animatingX && t.animatingY || w._ignoreWhileAnimating === t)
835
- return N(!1);
836
- if (Ge = !1, u && !s.disabled && (f ? c || (a = C !== S) : x === this || (this.lastPutMode = xe.checkPull(this, u, d, e)) && l.checkPut(this, u, d, e))) {
837
- if (_ = this._getDirection(e, t) === "vertical", r = A(d), M("dragOverValid"), m.eventCanceled) return E;
838
- if (a)
839
- return C = S, G(), this._hideClone(), M("revert"), m.eventCanceled || (de ? S.insertBefore(d, de) : S.appendChild(d)), N(!0);
840
- var R = pt(o, s.draggable);
841
- if (!R || Ro(e, _, this) && !R.animated) {
842
- if (R === d)
843
- return N(!1);
844
- if (R && o === e.target && (t = R), t && (i = A(t)), Be(S, o, d, r, t, i, e, !!t) !== !1)
845
- return G(), R && R.nextSibling ? o.insertBefore(d, R.nextSibling) : o.appendChild(d), C = o, Y(), N(!0);
846
- } else if (R && Lo(e, _, this)) {
847
- var K = ve(o, 0, s, !0);
848
- if (K === d)
849
- return N(!1);
850
- if (t = K, i = A(t), Be(S, o, d, r, t, i, e, !1) !== !1)
851
- return G(), o.insertBefore(d, K), C = o, Y(), N(!0);
852
- } else if (t.parentNode === o) {
853
- i = A(t);
854
- var H = 0, Z, h = d.parentNode !== o, D = !Oo(d.animated && d.toRect || r, t.animated && t.toRect || i, _), P = _ ? "top" : "left", T = _t(t, "top", "top") || _t(d, "top", "top"), J = T ? T.scrollTop : void 0;
855
- he !== t && (Z = i[P], Ce = !1, Le = !D && s.invertSwap || h), H = Bo(e, t, i, _, D ? 1 : s.swapThreshold, s.invertedSwapThreshold == null ? s.swapThreshold : s.invertedSwapThreshold, Le, he === t);
856
- var W;
857
- if (H !== 0) {
858
- var le = U(d);
859
- do
860
- le -= H, W = C.children[le];
861
- while (W && (p(W, "display") === "none" || W === g));
862
- }
863
- if (H === 0 || W === t)
864
- return N(!1);
865
- he = t, Ie = H;
866
- var be = t.nextElementSibling, oe = !1;
867
- oe = H === 1;
868
- var Pe = Be(S, o, d, r, t, i, e, oe);
869
- if (Pe !== !1)
870
- return (Pe === 1 || Pe === -1) && (oe = Pe === 1), st = !0, setTimeout(xo, 30), G(), oe && !be ? o.appendChild(d) : t.parentNode.insertBefore(d, oe ? be : t), T && Gt(T, 0, J - T.scrollTop), C = d.parentNode, Z !== void 0 && !Le && (Xe = Math.abs(Z - A(t)[P])), Y(), N(!0);
871
- }
872
- if (o.contains(d))
873
- return N(!1);
874
- }
875
- return !1;
876
- },
877
- _ignoreWhileAnimating: null,
878
- _offMoveEvents: function() {
879
- b(document, "mousemove", this._onTouchMove), b(document, "touchmove", this._onTouchMove), b(document, "pointermove", this._onTouchMove), b(document, "dragover", ue), b(document, "mousemove", ue), b(document, "touchmove", ue);
880
- },
881
- _offUpEvents: function() {
882
- var e = this.el.ownerDocument;
883
- b(e, "mouseup", this._onDrop), b(e, "touchend", this._onDrop), b(e, "pointerup", this._onDrop), b(e, "pointercancel", this._onDrop), b(e, "touchcancel", this._onDrop), b(document, "selectstart", this);
884
- },
885
- _onDrop: function(e) {
886
- var o = this.el, t = this.options;
887
- if ($ = U(d), ne = U(d, t.draggable), F("drop", this, {
888
- evt: e
889
- }), C = d && d.parentNode, $ = U(d), ne = U(d, t.draggable), m.eventCanceled) {
890
- this._nulling();
891
- return;
892
- }
893
- pe = !1, Le = !1, Ce = !1, clearInterval(this._loopId), clearTimeout(this._dragStartTimer), ut(this.cloneId), ut(this._dragStartId), this.nativeDraggable && (b(document, "drop", this), b(o, "dragstart", this._onDragStart)), this._offMoveEvents(), this._offUpEvents(), De && p(document.body, "user-select", ""), p(d, "transform", ""), e && (ye && (e.cancelable && e.preventDefault(), !t.dropBubble && e.stopPropagation()), g && g.parentNode && g.parentNode.removeChild(g), (S === C || x && x.lastPutMode !== "clone") && I && I.parentNode && I.parentNode.removeChild(I), d && (this.nativeDraggable && b(d, "dragend", this), ot(d), d.style["will-change"] = "", ye && !pe && X(d, x ? x.options.ghostClass : this.options.ghostClass, !1), X(d, this.options.chosenClass, !1), B({
894
- sortable: this,
895
- name: "unchoose",
896
- toEl: C,
897
- newIndex: null,
898
- newDraggableIndex: null,
899
- originalEvent: e
900
- }), S !== C ? ($ >= 0 && (B({
901
- rootEl: C,
902
- name: "add",
903
- toEl: C,
904
- fromEl: S,
905
- originalEvent: e
906
- }), B({
907
- sortable: this,
908
- name: "remove",
909
- toEl: C,
910
- originalEvent: e
911
- }), B({
912
- rootEl: C,
913
- name: "sort",
914
- toEl: C,
915
- fromEl: S,
916
- originalEvent: e
917
- }), B({
918
- sortable: this,
919
- name: "sort",
920
- toEl: C,
921
- originalEvent: e
922
- })), x && x.save()) : $ !== me && $ >= 0 && (B({
923
- sortable: this,
924
- name: "update",
925
- toEl: C,
926
- originalEvent: e
927
- }), B({
928
- sortable: this,
929
- name: "sort",
930
- toEl: C,
931
- originalEvent: e
932
- })), m.active && (($ == null || $ === -1) && ($ = me, ne = Se), B({
933
- sortable: this,
934
- name: "end",
935
- toEl: C,
936
- originalEvent: e
937
- }), this.save()))), this._nulling();
938
- },
939
- _nulling: function() {
940
- F("nulling", this), S = d = C = g = de = I = Ye = re = se = z = ye = $ = ne = me = Se = he = Ie = x = xe = m.dragged = m.ghost = m.clone = m.active = null, ze.forEach(function(e) {
941
- e.checked = !0;
942
- }), ze.length = Qe = et = 0;
943
- },
944
- handleEvent: function(e) {
945
- switch (e.type) {
946
- case "drop":
947
- case "dragend":
948
- this._onDrop(e);
949
- break;
950
- case "dragenter":
951
- case "dragover":
952
- d && (this._onDragOver(e), No(e));
953
- break;
954
- case "selectstart":
955
- e.preventDefault();
956
- break;
957
- }
958
- },
959
- /**
960
- * Serializes the item into an array of string.
961
- * @returns {String[]}
962
- */
963
- toArray: function() {
964
- for (var e = [], o, t = this.el.children, r = 0, i = t.length, a = this.options; r < i; r++)
965
- o = t[r], j(o, a.draggable, this.el, !1) && e.push(o.getAttribute(a.dataIdAttr) || ko(o));
966
- return e;
967
- },
968
- /**
969
- * Sorts the elements according to the array.
970
- * @param {String[]} order order of the items
971
- */
972
- sort: function(e, o) {
973
- var t = {}, r = this.el;
974
- this.toArray().forEach(function(i, a) {
975
- var s = r.children[a];
976
- j(s, this.options.draggable, r, !1) && (t[i] = s);
977
- }, this), o && this.captureAnimationState(), e.forEach(function(i) {
978
- t[i] && (r.removeChild(t[i]), r.appendChild(t[i]));
979
- }), o && this.animateAll();
980
- },
981
- /**
982
- * Save the current sorting
983
- */
984
- save: function() {
985
- var e = this.options.store;
986
- e && e.set && e.set(this);
987
- },
988
- /**
989
- * For each element in the set, get the first element that matches the selector by testing the element itself and traversing up through its ancestors in the DOM tree.
990
- * @param {HTMLElement} el
991
- * @param {String} [selector] default: `options.draggable`
992
- * @returns {HTMLElement|null}
993
- */
994
- closest: function(e, o) {
995
- return j(e, o || this.options.draggable, this.el, !1);
996
- },
997
- /**
998
- * Set/get option
999
- * @param {string} name
1000
- * @param {*} [value]
1001
- * @returns {*}
1002
- */
1003
- option: function(e, o) {
1004
- var t = this.options;
1005
- if (o === void 0)
1006
- return t[e];
1007
- var r = Ae.modifyOption(this, e, o);
1008
- typeof r < "u" ? t[e] = r : t[e] = o, e === "group" && qt(t);
1009
- },
1010
- /**
1011
- * Destroy
1012
- */
1013
- destroy: function() {
1014
- F("destroy", this);
1015
- var e = this.el;
1016
- e[k] = null, b(e, "mousedown", this._onTapStart), b(e, "touchstart", this._onTapStart), b(e, "pointerdown", this._onTapStart), this.nativeDraggable && (b(e, "dragover", this), b(e, "dragenter", this)), Array.prototype.forEach.call(e.querySelectorAll("[draggable]"), function(o) {
1017
- o.removeAttribute("draggable");
1018
- }), this._onDrop(), this._disableDelayedDragEvents(), We.splice(We.indexOf(this.el), 1), this.el = e = null;
1019
- },
1020
- _hideClone: function() {
1021
- if (!re) {
1022
- if (F("hideClone", this), m.eventCanceled) return;
1023
- p(I, "display", "none"), this.options.removeCloneOnHide && I.parentNode && I.parentNode.removeChild(I), re = !0;
1024
- }
1025
- },
1026
- _showClone: function(e) {
1027
- if (e.lastPutMode !== "clone") {
1028
- this._hideClone();
1029
- return;
1030
- }
1031
- if (re) {
1032
- if (F("showClone", this), m.eventCanceled) return;
1033
- d.parentNode == S && !this.options.group.revertClone ? S.insertBefore(I, d) : de ? S.insertBefore(I, de) : S.appendChild(I), this.options.group.revertClone && this.animate(d, I), p(I, "display", ""), re = !1;
1034
- }
1035
- }
1036
- };
1037
- function No(n) {
1038
- n.dataTransfer && (n.dataTransfer.dropEffect = "move"), n.cancelable && n.preventDefault();
1039
- }
1040
- function Be(n, e, o, t, r, i, a, s) {
1041
- var l, u = n[k], f = u.options.onMove, c;
1042
- return window.CustomEvent && !te && !Oe ? l = new CustomEvent("move", {
1043
- bubbles: !0,
1044
- cancelable: !0
1045
- }) : (l = document.createEvent("Event"), l.initEvent("move", !0, !0)), l.to = e, l.from = n, l.dragged = o, l.draggedRect = t, l.related = r || e, l.relatedRect = i || A(e), l.willInsertAfter = s, l.originalEvent = a, n.dispatchEvent(l), f && (c = f.call(u, l, a)), c;
1046
- }
1047
- function ot(n) {
1048
- n.draggable = !1;
1049
- }
1050
- function xo() {
1051
- st = !1;
1052
- }
1053
- function Lo(n, e, o) {
1054
- var t = A(ve(o.el, 0, o.options, !0)), r = zt(o.el, o.options, g), i = 10;
1055
- return e ? n.clientX < r.left - i || n.clientY < t.top && n.clientX < t.right : n.clientY < r.top - i || n.clientY < t.bottom && n.clientX < t.left;
1056
- }
1057
- function Ro(n, e, o) {
1058
- var t = A(pt(o.el, o.options.draggable)), r = zt(o.el, o.options, g), i = 10;
1059
- return e ? n.clientX > r.right + i || n.clientY > t.bottom && n.clientX > t.left : n.clientY > r.bottom + i || n.clientX > t.right && n.clientY > t.top;
1060
- }
1061
- function Bo(n, e, o, t, r, i, a, s) {
1062
- var l = t ? n.clientY : n.clientX, u = t ? o.height : o.width, f = t ? o.top : o.left, c = t ? o.bottom : o.right, v = !1;
1063
- if (!a) {
1064
- if (s && Xe < u * r) {
1065
- if (!Ce && (Ie === 1 ? l > f + u * i / 2 : l < c - u * i / 2) && (Ce = !0), Ce)
1066
- v = !0;
1067
- else if (Ie === 1 ? l < f + Xe : l > c - Xe)
1068
- return -Ie;
1069
- } else if (l > f + u * (1 - r) / 2 && l < c - u * (1 - r) / 2)
1070
- return Fo(e);
1071
- }
1072
- return v = v || a, v && (l < f + u * i / 2 || l > c - u * i / 2) ? l > f + u / 2 ? 1 : -1 : 0;
1073
- }
1074
- function Fo(n) {
1075
- return U(d) < U(n) ? 1 : -1;
1076
- }
1077
- function ko(n) {
1078
- for (var e = n.tagName + n.className + n.src + n.href + n.textContent, o = e.length, t = 0; o--; )
1079
- t += e.charCodeAt(o);
1080
- return t.toString(36);
1081
- }
1082
- function Yo(n) {
1083
- ze.length = 0;
1084
- for (var e = n.getElementsByTagName("input"), o = e.length; o--; ) {
1085
- var t = e[o];
1086
- t.checked && ze.push(t);
1087
- }
1088
- }
1089
- function $e(n) {
1090
- return setTimeout(n, 0);
1091
- }
1092
- function ut(n) {
1093
- return clearTimeout(n);
1094
- }
1095
- Ke && y(document, "touchmove", function(n) {
1096
- (m.active || pe) && n.cancelable && n.preventDefault();
1097
- });
1098
- m.utils = {
1099
- on: y,
1100
- off: b,
1101
- css: p,
1102
- find: Ht,
1103
- is: function(e, o) {
1104
- return !!j(e, o, e, !1);
1105
- },
1106
- extend: Eo,
1107
- throttle: Ut,
1108
- closest: j,
1109
- toggleClass: X,
1110
- clone: Wt,
1111
- index: U,
1112
- nextTick: $e,
1113
- cancelNextTick: ut,
1114
- detectDirection: Vt,
1115
- getChild: ve,
1116
- expando: k
1117
- };
1118
- m.get = function(n) {
1119
- return n[k];
1120
- };
1121
- m.mount = function() {
1122
- for (var n = arguments.length, e = new Array(n), o = 0; o < n; o++)
1123
- e[o] = arguments[o];
1124
- e[0].constructor === Array && (e = e[0]), e.forEach(function(t) {
1125
- if (!t.prototype || !t.prototype.constructor)
1126
- throw "Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(t));
1127
- t.utils && (m.utils = q(q({}, m.utils), t.utils)), Ae.mount(t);
1128
- });
1129
- };
1130
- m.create = function(n, e) {
1131
- return new m(n, e);
1132
- };
1133
- m.version = wo;
1134
- var O = [], Ee, dt, ct = !1, nt, rt, je, _e;
1135
- function Xo() {
1136
- function n() {
1137
- this.defaults = {
1138
- scroll: !0,
1139
- forceAutoScrollFallback: !1,
1140
- scrollSensitivity: 30,
1141
- scrollSpeed: 10,
1142
- bubbleScroll: !0
1143
- };
1144
- for (var e in this)
1145
- e.charAt(0) === "_" && typeof this[e] == "function" && (this[e] = this[e].bind(this));
1146
- }
1147
- return n.prototype = {
1148
- dragStarted: function(o) {
1149
- var t = o.originalEvent;
1150
- this.sortable.nativeDraggable ? y(document, "dragover", this._handleAutoScroll) : this.options.supportPointer ? y(document, "pointermove", this._handleFallbackAutoScroll) : t.touches ? y(document, "touchmove", this._handleFallbackAutoScroll) : y(document, "mousemove", this._handleFallbackAutoScroll);
1151
- },
1152
- dragOverCompleted: function(o) {
1153
- var t = o.originalEvent;
1154
- !this.options.dragOverBubble && !t.rootEl && this._handleAutoScroll(t);
1155
- },
1156
- drop: function() {
1157
- this.sortable.nativeDraggable ? b(document, "dragover", this._handleAutoScroll) : (b(document, "pointermove", this._handleFallbackAutoScroll), b(document, "touchmove", this._handleFallbackAutoScroll), b(document, "mousemove", this._handleFallbackAutoScroll)), Ct(), He(), _o();
1158
- },
1159
- nulling: function() {
1160
- je = dt = Ee = ct = _e = nt = rt = null, O.length = 0;
1161
- },
1162
- _handleFallbackAutoScroll: function(o) {
1163
- this._handleAutoScroll(o, !0);
1164
- },
1165
- _handleAutoScroll: function(o, t) {
1166
- var r = this, i = (o.touches ? o.touches[0] : o).clientX, a = (o.touches ? o.touches[0] : o).clientY, s = document.elementFromPoint(i, a);
1167
- if (je = o, t || this.options.forceAutoScrollFallback || Oe || te || De) {
1168
- it(o, this.options, s, t);
1169
- var l = ae(s, !0);
1170
- ct && (!_e || i !== nt || a !== rt) && (_e && Ct(), _e = setInterval(function() {
1171
- var u = ae(document.elementFromPoint(i, a), !0);
1172
- u !== l && (l = u, He()), it(o, r.options, u, t);
1173
- }, 10), nt = i, rt = a);
1174
- } else {
1175
- if (!this.options.bubbleScroll || ae(s, !0) === V()) {
1176
- He();
1177
- return;
1178
- }
1179
- it(o, this.options, ae(s, !1), !1);
1180
- }
1181
- }
1182
- }, ee(n, {
1183
- pluginName: "scroll",
1184
- initializeByDefault: !0
1185
- });
1186
- }
1187
- function He() {
1188
- O.forEach(function(n) {
1189
- clearInterval(n.pid);
1190
- }), O = [];
1191
- }
1192
- function Ct() {
1193
- clearInterval(_e);
1194
- }
1195
- var it = Ut(function(n, e, o, t) {
1196
- if (e.scroll) {
1197
- var r = (n.touches ? n.touches[0] : n).clientX, i = (n.touches ? n.touches[0] : n).clientY, a = e.scrollSensitivity, s = e.scrollSpeed, l = V(), u = !1, f;
1198
- dt !== o && (dt = o, He(), Ee = e.scroll, f = e.scrollFn, Ee === !0 && (Ee = ae(o, !0)));
1199
- var c = 0, v = Ee;
1200
- do {
1201
- var _ = v, w = A(_), E = w.top, M = w.bottom, G = w.left, N = w.right, Y = w.width, R = w.height, K = void 0, H = void 0, Z = _.scrollWidth, h = _.scrollHeight, D = p(_), P = _.scrollLeft, T = _.scrollTop;
1202
- _ === l ? (K = Y < Z && (D.overflowX === "auto" || D.overflowX === "scroll" || D.overflowX === "visible"), H = R < h && (D.overflowY === "auto" || D.overflowY === "scroll" || D.overflowY === "visible")) : (K = Y < Z && (D.overflowX === "auto" || D.overflowX === "scroll"), H = R < h && (D.overflowY === "auto" || D.overflowY === "scroll"));
1203
- var J = K && (Math.abs(N - r) <= a && P + Y < Z) - (Math.abs(G - r) <= a && !!P), W = H && (Math.abs(M - i) <= a && T + R < h) - (Math.abs(E - i) <= a && !!T);
1204
- if (!O[c])
1205
- for (var le = 0; le <= c; le++)
1206
- O[le] || (O[le] = {});
1207
- (O[c].vx != J || O[c].vy != W || O[c].el !== _) && (O[c].el = _, O[c].vx = J, O[c].vy = W, clearInterval(O[c].pid), (J != 0 || W != 0) && (u = !0, O[c].pid = setInterval((function() {
1208
- t && this.layer === 0 && m.active._onTouchMove(je);
1209
- var be = O[this.layer].vy ? O[this.layer].vy * s : 0, oe = O[this.layer].vx ? O[this.layer].vx * s : 0;
1210
- typeof f == "function" && f.call(m.dragged.parentNode[k], oe, be, n, je, O[this.layer].el) !== "continue" || Gt(O[this.layer].el, oe, be);
1211
- }).bind({
1212
- layer: c
1213
- }), 24))), c++;
1214
- } while (e.bubbleScroll && v !== l && (v = ae(v, !1)));
1215
- ct = u;
1216
- }
1217
- }, 30), Jt = function(e) {
1218
- var o = e.originalEvent, t = e.putSortable, r = e.dragEl, i = e.activeSortable, a = e.dispatchSortableEvent, s = e.hideGhostForTarget, l = e.unhideGhostForTarget;
1219
- if (o) {
1220
- var u = t || i;
1221
- s();
1222
- var f = o.changedTouches && o.changedTouches.length ? o.changedTouches[0] : o, c = document.elementFromPoint(f.clientX, f.clientY);
1223
- l(), u && !u.el.contains(c) && (a("spill"), this.onSpill({
1224
- dragEl: r,
1225
- putSortable: t
1226
- }));
1227
- }
1228
- };
1229
- function mt() {
1230
- }
1231
- mt.prototype = {
1232
- startIndex: null,
1233
- dragStart: function(e) {
1234
- var o = e.oldDraggableIndex;
1235
- this.startIndex = o;
1236
- },
1237
- onSpill: function(e) {
1238
- var o = e.dragEl, t = e.putSortable;
1239
- this.sortable.captureAnimationState(), t && t.captureAnimationState();
1240
- var r = ve(this.sortable.el, this.startIndex, this.options);
1241
- r ? this.sortable.el.insertBefore(o, r) : this.sortable.el.appendChild(o), this.sortable.animateAll(), t && t.animateAll();
1242
- },
1243
- drop: Jt
1244
- };
1245
- ee(mt, {
1246
- pluginName: "revertOnSpill"
1247
- });
1248
- function gt() {
1249
- }
1250
- gt.prototype = {
1251
- onSpill: function(e) {
1252
- var o = e.dragEl, t = e.putSortable, r = t || this.sortable;
1253
- r.captureAnimationState(), o.parentNode && o.parentNode.removeChild(o), r.animateAll();
1254
- },
1255
- drop: Jt
1256
- };
1257
- ee(gt, {
1258
- pluginName: "removeOnSpill"
1259
- });
1260
- m.mount(new Xo());
1261
- m.mount(gt, mt);
1262
- function $o(n, e = ie({})) {
1263
- const o = ie(null), t = () => {
1264
- o.value?.destroy && (o.value.destroy(), o.value = null);
1265
- };
1266
- return at(
1267
- n,
1268
- (r) => {
1269
- if (r != null) {
1270
- const i = new m(r, {
1271
- ...e.value,
1272
- /**
1273
- * Allows the component to be dragged only
1274
- * with the handle component
1275
- */
1276
- handle: ".b-draggable-handle",
1277
- /**
1278
- * Disables the component from being dragged
1279
- */
1280
- filter: ".b-draggable-handle--disabled"
1281
- });
1282
- o.value = no(i);
1283
- } else
1284
- t();
1285
- },
1286
- { immediate: !0 }
1287
- ), at(e, (r) => {
1288
- if (r && o.value)
1289
- for (const i in r)
1290
- o.value.option(i, r[i]);
1291
- }), Nt(() => {
1292
- o.value && t();
1293
- }), {
1294
- draggableElement: o
1295
- };
1296
- }
1297
- const Ho = 1e3;
1298
- function Uo() {
1299
- const n = ie("");
1300
- let e = null;
1301
- const o = () => {
1302
- e && (clearTimeout(e), e = null);
1303
- }, t = (r) => {
1304
- o(), n.value = "", e = setTimeout(() => {
1305
- n.value = r, e = null;
1306
- }, Ho);
1307
- };
1308
- return Nt(() => {
1309
- o();
1310
- }), {
1311
- /**
1312
- * The message to be announced to screen readers.
1313
- */
1314
- announcementMessage: n,
1315
- /**
1316
- * Method to trigger an announcement.
1317
- */
1318
- announce: t
1319
- };
1320
- }
1321
- const Go = co(() => {
1322
- const n = ie(!1);
1323
- return typeof window < "u" && (Ne(
1324
- window,
1325
- "keydown",
1326
- (e) => {
1327
- e.key === "Tab" && (n.value = !0);
1328
- },
1329
- { capture: !0 }
1330
- ), Ne(
1331
- window,
1332
- "mousedown",
1333
- () => {
1334
- n.value = !1;
1335
- },
1336
- { capture: !0 }
1337
- ), Ne(
1338
- window,
1339
- "touchstart",
1340
- () => {
1341
- n.value = !1;
1342
- },
1343
- { capture: !0, passive: !0 }
1344
- ), Ne(window, "blur", () => {
1345
- n.value = !1;
1346
- })), { isKeyboardUser: n };
1347
- }), Qt = {
1348
- "en-US": { youHaveMovedFromPositionToPosition: "You have moved {itemLabel} from position {indexOrigin} to position {indexTarget} of {total}." }
1349
- }, Wo = {
1350
- class: "b-draggable__announcement",
1351
- role: "status",
1352
- "aria-live": "polite"
1353
- }, zo = {
1354
- name: "bento-draggable",
1355
- model: { prop: "items", event: "update:items" },
1356
- i18n: { messages: Qt }
1357
- }, jo = /* @__PURE__ */ xt({
1358
- ...zo,
1359
- props: {
1360
- announcement: { default: "" },
1361
- disableAutoSort: { type: Boolean, default: !1 },
1362
- el: { default: "div" },
1363
- items: { default: () => [] },
1364
- options: { default: () => ({}) }
1365
- },
1366
- emits: ["update:items"],
1367
- setup(n, { expose: e, emit: o }) {
1368
- const t = n, r = o, i = ie(null), a = ie(!1), s = ie([]), l = ie(null), u = Fe(() => i.value ? {
1369
- ...t.options,
1370
- onStart: (h) => {
1371
- a.value = !0, t.options?.onStart && t.options?.onStart(h);
1372
- },
1373
- onEnd: (h) => {
1374
- setTimeout(() => {
1375
- a.value = !1, t.options?.onEnd && t.options?.onEnd(h);
1376
- });
1377
- },
1378
- onSort: (h) => {
1379
- if (t.options?.onSort) {
1380
- t.options.onSort(h);
1381
- return;
1382
- }
1383
- if (!t.disableAutoSort) {
1384
- const { oldIndex: D, newIndex: P, from: T, to: J } = h;
1385
- T === J && T === i.value && D !== void 0 && P !== void 0 && M(D, P);
1386
- }
1387
- }
1388
- } : {}), { announcementMessage: f, announce: c } = Uo(), { t: v } = kt({ messages: Qt }), { draggableElement: _ } = $o(i, u), { isKeyboardUser: w } = Go(), E = async (h) => {
1389
- if (await bt(), h !== -1 && i.value) {
1390
- const P = i.value.children[h]?.querySelector(".b-draggable-handle button");
1391
- await bt(), P?.focus();
1392
- }
1393
- }, M = async (h, D) => {
1394
- if (h < 0 || D < 0 || h >= t.items.length || D >= t.items.length || h === D)
1395
- return;
1396
- const P = Array.from(t.items), [T] = P.splice(h, 1);
1397
- P.splice(D, 0, T), l.value = T, r("update:items", P.filter(Boolean));
1398
- const J = T.label, W = t?.announcement || v("youHaveMovedFromPositionToPosition", {
1399
- itemLabel: J,
1400
- indexOrigin: h + 1,
1401
- indexTarget: D + 1,
1402
- total: t.items.length
1403
- });
1404
- t.announcement !== "disabled" && c(W);
1405
- }, G = (h) => M(h, h - 1), N = (h) => M(h, h + 1), Y = (h) => M(h, h - 1), R = (h) => M(h, h + 1), K = (h) => M(h, 0), H = (h) => M(h, t.items.length - 1), Z = (h) => ({
1406
- up: h === 0,
1407
- top: h === 0,
1408
- down: h === t.items.length - 1,
1409
- bottom: h === t.items.length - 1,
1410
- left: !0,
1411
- right: !0
1412
- });
1413
- return at(
1414
- () => t.items,
1415
- async (h) => {
1416
- if (h) {
1417
- if (w.value && h.length > 0 && s.value.length > 0) {
1418
- if (l.value) {
1419
- const D = h.indexOf(l.value);
1420
- D !== -1 && await E(D), l.value = null;
1421
- } else if (h.length > s.value.length) {
1422
- const D = h.findIndex((P) => !s.value.includes(P));
1423
- D !== -1 && await E(D);
1424
- }
1425
- }
1426
- s.value = [...h];
1427
- }
1428
- },
1429
- { deep: !0, immediate: !0 }
1430
- ), e({
1431
- /**
1432
- * A ref to the container DOM element.
1433
- */
1434
- containerRef: i,
1435
- /**
1436
- * The underlying SortableJS instance, which provides methods like `toArray()`, `sort()`, and `destroy()`.
1437
- */
1438
- draggableElement: _,
1439
- /**
1440
- * A boolean ref that is `true` when an item is being dragged.
1441
- */
1442
- isDragging: a,
1443
- /**
1444
- * Announces a message to screen reader users via the live region.
1445
- */
1446
- announce: c,
1447
- /**
1448
- * Moves an item from one index to another and emits the updated list.
1449
- */
1450
- moveItem: M,
1451
- /**
1452
- * Programmatically focuses the draggable handle button at the given index.
1453
- */
1454
- focus: E
1455
- }), (h, D) => (ce(), Lt(ro(h.el), {
1456
- ref_key: "containerRef",
1457
- ref: i
1458
- }, {
1459
- default: Rt(() => [
1460
- (ce(!0), Me(io, null, ao(h.items, (P, T) => lo(h.$slots, "default", {
1461
- item: P,
1462
- index: T,
1463
- moveUp: () => G(T),
1464
- moveRight: () => R(T),
1465
- moveDown: () => N(T),
1466
- moveLeft: () => Y(T),
1467
- moveTop: () => K(T),
1468
- moveBottom: () => H(T),
1469
- disabledMenus: Z(T)
1470
- }, void 0, !0)), 256)),
1471
- Ve("div", Wo, ft(lt(f)), 1)
1472
- ]),
1473
- _: 3
1474
- }, 512));
1475
- }
1476
- }), pn = /* @__PURE__ */ qe(jo, [["__scopeId", "data-v-804b6e95"]]);
1477
- let Mt = 0;
1478
- const Vo = {
1479
- beforeCreate() {
1480
- this.uuid = Mt.toString(), Mt += 1;
1481
- }
1482
- }, qo = { key: 0 };
1483
- function Ko(n, e, o, t, r, i) {
1484
- return ce(), Me("svg", Bt({ role: "img" }, n.$attrs, {
1485
- class: "ui-assets-icons-16",
1486
- xmlns: "http://www.w3.org/2000/svg",
1487
- width: "16",
1488
- height: "16",
1489
- fill: "none"
1490
- }), [
1491
- n.$attrs["svg-title"] ? (ce(), Me("title", qo, ft(n.$attrs["svg-title"]), 1)) : Ft("", !0),
1492
- e[0] || (e[0] = Ve("path", {
1493
- fill: "#001222",
1494
- d: "M8.75023 3.81089L13.0001 8.06077L14.0608 7.00011L8.00011 0.939453L1.93945 7.00011L3.00011 8.06077L7.25023 3.81066V14.7502H8.75023V3.81089Z"
1495
- }, null, -1))
1496
- ], 16);
1497
- }
1498
- const Ot = /* @__PURE__ */ qe(Vo, [["render", Ko]]);
1499
- let At = 0;
1500
- const Zo = {
1501
- beforeCreate() {
1502
- this.uuid = At.toString(), At += 1;
1503
- }
1504
- }, Jo = { key: 0 };
1505
- function Qo(n, e, o, t, r, i) {
1506
- return ce(), Me("svg", Bt({ role: "img" }, n.$attrs, {
1507
- class: "ui-assets-icons-16",
1508
- xmlns: "http://www.w3.org/2000/svg",
1509
- width: "16",
1510
- height: "16",
1511
- fill: "none"
1512
- }), [
1513
- n.$attrs["svg-title"] ? (ce(), Me("title", Jo, ft(n.$attrs["svg-title"]), 1)) : Ft("", !0),
1514
- e[0] || (e[0] = Ve("path", {
1515
- fill: "#001222",
1516
- d: "M7.25434 12.1937L3.00011 7.93952L1.93945 9.00018L8.00011 15.0608L14.0608 9.00018L13.0001 7.93952L8.75433 12.1853L8.74316 1.24951L7.24316 1.25104L7.25434 12.1937Z"
1517
- }, null, -1))
1518
- ], 16);
1519
- }
1520
- const Pt = /* @__PURE__ */ qe(Zo, [["render", Qo]]), eo = {
1521
- "de-DE": { moveDown: "Nach unten", moveLeft: "Nach links", moveRight: "Nach rechts bewegen", moveToTheBottom: "Nach unten", moveToTheTop: "Nach oben", moveUp: "Nach oben", reorderLabel: "{label} neu anordnen" },
1522
- "en-GB": { moveDown: "Move down", moveLeft: "Move left", moveRight: "Move right", moveToTheBottom: "Move to the bottom", moveToTheTop: "Move to the top", moveUp: "Move up", reorderLabel: "Reorder {label}" },
1523
- "en-US": { moveDown: "Move down", moveLeft: "Move left", moveRight: "Move right", moveToTheBottom: "Move to the bottom", moveToTheTop: "Move to the top", moveUp: "Move up", reorderLabel: "Reorder {label}" },
1524
- "es-ES": { moveDown: "Mover hacia abajo", moveLeft: "Mover a la izquierda", moveRight: "Mover a la derecha", moveToTheBottom: "Mover a la parte inferior", moveToTheTop: "Mover a la parte superior", moveUp: "Mover hacia arriba", reorderLabel: "Reordenar {label}" },
1525
- "es-MX": { moveDown: "Mover hacia abajo", moveLeft: "Mover a la izquierda", moveRight: "Mover a la derecha", moveToTheBottom: "Mover a la parte inferior", moveToTheTop: "Mover a la parte superior", moveUp: "Mover hacia arriba", reorderLabel: "Reordenar {label}" },
1526
- "fr-FR": { moveDown: "Déplacer vers le bas", moveLeft: "Déplacer à gauche", moveRight: "Déplacer à droite", moveToTheBottom: "Déplacer tout en bas", moveToTheTop: "Déplacer tout en haut", moveUp: "Déplacer vers le haut", reorderLabel: "Réorganiser {label}" },
1527
- "it-IT": { moveDown: "Sposta giù", moveLeft: "Sposta a sinistra", moveRight: "Sposta a destra", moveToTheBottom: "Sposta in fondo", moveToTheTop: "Sposta in cima", moveUp: "Sposta in alto", reorderLabel: "Riordina {label}" },
1528
- "ja-JP": { moveDown: "下に移動", moveLeft: "左に移動", moveRight: "右に移動", moveToTheBottom: "一番下に移動", moveToTheTop: "一番上に移動", moveUp: "上に移動", reorderLabel: "{label}を並べ替え" },
1529
- "pt-BR": { moveDown: "Mover para baixo", moveLeft: "Mover para a esquerda", moveRight: "Mover para a direita", moveToTheBottom: "Mover para embaixo", moveToTheTop: "Mover para o topo", moveUp: "Mover para cima", reorderLabel: "Reordenar {label}" },
1530
- "zh-CN": { moveDown: "下移", moveLeft: "左移", moveRight: "右移", moveToTheBottom: "移至底部", moveToTheTop: "移至顶部", moveUp: "上移", reorderLabel: "重新排序 {label}" }
1531
- }, en = { class: "b-draggable-handle__icon" }, tn = {
1532
- i18n: { messages: eo },
1533
- name: "bento-draggable-handle"
1534
- }, on = /* @__PURE__ */ xt({
1535
- ...tn,
1536
- props: {
1537
- condensed: { type: Boolean, default: !1 },
1538
- disabled: { type: Boolean, default: !1 },
1539
- disabledMenus: { default: () => ({}) },
1540
- label: {},
1541
- variant: { default: "up-and-down" }
1542
- },
1543
- emits: ["move-bottom", "move-down", "move-left", "move-right", "move-top", "move-up"],
1544
- setup(n, { emit: e }) {
1545
- const { t: o } = kt({ messages: eo }), t = n, r = e, i = Fe(
1546
- () => ({
1547
- "aria-label": o("reorderLabel", { label: t.label }),
1548
- condensed: t.condensed,
1549
- disabled: t.disabled,
1550
- variant: "tertiary"
1551
- })
1552
- ), a = Fe(() => ({
1553
- /**
1554
- * Disables the handle and prevents the entire
1555
- * element from being dragged.
1556
- * Used by `useBentoDraggable`
1557
- */
1558
- "b-draggable-handle--disabled": t.disabled
1559
- })), s = Fe(() => {
1560
- const l = {
1561
- up: {
1562
- text: o("moveUp"),
1563
- handler: () => r("move-up"),
1564
- disabled: t.disabledMenus.up,
1565
- icon: Ot
1566
- },
1567
- down: {
1568
- text: o("moveDown"),
1569
- handler: () => r("move-down"),
1570
- disabled: t.disabledMenus.down,
1571
- icon: Pt
1572
- },
1573
- left: {
1574
- text: o("moveLeft"),
1575
- handler: () => r("move-left"),
1576
- disabled: t.disabledMenus.left,
1577
- icon: po
1578
- },
1579
- right: {
1580
- text: o("moveRight"),
1581
- handler: () => r("move-right"),
1582
- disabled: t.disabledMenus.right,
1583
- icon: mo
1584
- },
1585
- top: {
1586
- text: o("moveToTheTop"),
1587
- handler: () => r("move-top"),
1588
- disabled: t.disabledMenus.top,
1589
- icon: Ot
1590
- },
1591
- bottom: {
1592
- text: o("moveToTheBottom"),
1593
- handler: () => r("move-bottom"),
1594
- disabled: t.disabledMenus.bottom,
1595
- icon: Pt
1596
- }
1597
- };
1598
- return t.variant === "up-and-down" ? [
1599
- l.up,
1600
- // Divider added after "Move down"
1601
- {
1602
- ...l.down,
1603
- addDivider: !0
1604
- },
1605
- l.top,
1606
- l.bottom
1607
- ] : [
1608
- l.up,
1609
- l.down,
1610
- l.left,
1611
- // Divider added after "Move right"
1612
- {
1613
- ...l.right,
1614
- addDivider: !0
1615
- },
1616
- l.top,
1617
- l.bottom
1618
- ];
1619
- });
1620
- return (l, u) => (ce(), Lt(lt(fo), {
1621
- class: so(["b-draggable-handle", a.value]),
1622
- data: s.value,
1623
- "menu-width": 250,
1624
- button: i.value
1625
- }, {
1626
- iconLeft: Rt(() => [
1627
- Ve("span", en, [
1628
- uo(lt(ho), { "aria-hidden": "true" })
1629
- ])
1630
- ]),
1631
- _: 1
1632
- }, 8, ["class", "data", "button"]));
1633
- }
1634
- }), mn = /* @__PURE__ */ qe(on, [["__scopeId", "data-v-6bba7f31"]]);
1635
- export {
1636
- mn as a,
1637
- pn as d
1638
- };
1639
- //# sourceMappingURL=draggable-handle.CKuHzAzS.js.map