overview-components 1.0.97 → 1.0.99

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 (113) hide show
  1. package/dist/index.d.ts +27 -0
  2. package/dist/index.d.ts.map +1 -1
  3. package/dist/index.js +10180 -40
  4. package/dist/shared/lit-icon-button.d.ts +1 -1
  5. package/dist/shared/lit-icon-button.d.ts.map +1 -1
  6. package/dist/shared/lit-loading-bar.d.ts +3 -3
  7. package/dist/shared/lit-loading-bar.d.ts.map +1 -1
  8. package/dist/style.css +1 -0
  9. package/package.json +1 -1
  10. package/dist/_virtual/FileSaver.min.js +0 -4
  11. package/dist/_virtual/_commonjsHelpers.js +0 -8
  12. package/dist/_virtual/lodash.js +0 -4
  13. package/dist/assets/generated/locales/de.js +0 -73
  14. package/dist/assets/generated/locales/en.js +0 -73
  15. package/dist/assets/generated/locales/fr.js +0 -73
  16. package/dist/assets/generated/locales/hr.js +0 -73
  17. package/dist/assets/generated/locales/it.js +0 -73
  18. package/dist/assets/generated/locales/pl.js +0 -73
  19. package/dist/assets/generated/locales/ro.js +0 -73
  20. package/dist/assets/generated/locales/sk.js +0 -73
  21. package/dist/assets/generated/locales/sr.js +0 -73
  22. package/dist/components/lit-attachments-tab.js +0 -519
  23. package/dist/components/lit-badge.js +0 -100
  24. package/dist/components/lit-case-variables-tab.js +0 -727
  25. package/dist/components/lit-chart.js +0 -395
  26. package/dist/components/lit-data-grid-tanstack.js +0 -1733
  27. package/dist/components/lit-filter-modal.js +0 -312
  28. package/dist/components/lit-multiselect-item.js +0 -530
  29. package/dist/components/lit-section-tab.js +0 -133
  30. package/dist/components/lit-tabs-overview.js +0 -304
  31. package/dist/components/react-wrappers/attachments-tab.js +0 -14
  32. package/dist/components/react-wrappers/badge.js +0 -14
  33. package/dist/components/react-wrappers/button.js +0 -14
  34. package/dist/components/react-wrappers/case-variables-tab.js +0 -14
  35. package/dist/components/react-wrappers/chart.js +0 -14
  36. package/dist/components/react-wrappers/data-grid-tanstack.js +0 -14
  37. package/dist/components/react-wrappers/filter-modal.js +0 -14
  38. package/dist/components/react-wrappers/progress-bar.js +0 -14
  39. package/dist/components/react-wrappers/section-tab.js +0 -14
  40. package/dist/components/react-wrappers/tabs-overview.js +0 -14
  41. package/dist/node_modules/@floating-ui/core/dist/floating-ui.core.js +0 -432
  42. package/dist/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +0 -306
  43. package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js +0 -127
  44. package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.js +0 -127
  45. package/dist/node_modules/@kurkle/color/dist/color.esm.js +0 -448
  46. package/dist/node_modules/@lit/localize/init/install.js +0 -11
  47. package/dist/node_modules/@lit/localize/init/runtime.js +0 -42
  48. package/dist/node_modules/@lit/localize/internal/default-msg.js +0 -10
  49. package/dist/node_modules/@lit/localize/internal/deferred.js +0 -21
  50. package/dist/node_modules/@lit/localize/internal/fnv1a64.js +0 -17
  51. package/dist/node_modules/@lit/localize/internal/id-generation.js +0 -14
  52. package/dist/node_modules/@lit/localize/internal/locale-status-event.js +0 -9
  53. package/dist/node_modules/@lit/localize/internal/runtime-msg.js +0 -42
  54. package/dist/node_modules/@lit/localize/internal/str-tag.js +0 -15
  55. package/dist/node_modules/@lit/react/create-component.js +0 -35
  56. package/dist/node_modules/@lit/reactive-element/css-tag.js +0 -50
  57. package/dist/node_modules/@lit/reactive-element/decorators/base.js +0 -9
  58. package/dist/node_modules/@lit/reactive-element/decorators/custom-element.js +0 -13
  59. package/dist/node_modules/@lit/reactive-element/decorators/property.js +0 -37
  60. package/dist/node_modules/@lit/reactive-element/decorators/query.js +0 -20
  61. package/dist/node_modules/@lit/reactive-element/decorators/state.js +0 -12
  62. package/dist/node_modules/@lit/reactive-element/reactive-element.js +0 -250
  63. package/dist/node_modules/@tanstack/lit-table/build/lib/index.js +0 -104
  64. package/dist/node_modules/@tanstack/lit-virtual/dist/esm/index.js +0 -40
  65. package/dist/node_modules/@tanstack/table-core/build/lib/index.js +0 -1956
  66. package/dist/node_modules/@tanstack/virtual-core/dist/esm/index.js +0 -490
  67. package/dist/node_modules/@tanstack/virtual-core/dist/esm/utils.js +0 -52
  68. package/dist/node_modules/chart.js/dist/chart.js +0 -7122
  69. package/dist/node_modules/chart.js/dist/chunks/helpers.segment.js +0 -1691
  70. package/dist/node_modules/file-saver/dist/FileSaver.min.js +0 -74
  71. package/dist/node_modules/lit-element/lit-element.js +0 -51
  72. package/dist/node_modules/lit-html/async-directive.js +0 -69
  73. package/dist/node_modules/lit-html/directive-helpers.js +0 -45
  74. package/dist/node_modules/lit-html/directive.js +0 -27
  75. package/dist/node_modules/lit-html/directives/ref.js +0 -42
  76. package/dist/node_modules/lit-html/directives/repeat.js +0 -61
  77. package/dist/node_modules/lit-html/directives/style-map.js +0 -36
  78. package/dist/node_modules/lit-html/directives/unsafe-html.js +0 -27
  79. package/dist/node_modules/lit-html/lit-html.js +0 -243
  80. package/dist/node_modules/lodash/lodash.js +0 -3678
  81. package/dist/node_modules/luxon/src/datetime.js +0 -1793
  82. package/dist/node_modules/luxon/src/duration.js +0 -723
  83. package/dist/node_modules/luxon/src/errors.js +0 -40
  84. package/dist/node_modules/luxon/src/impl/conversions.js +0 -92
  85. package/dist/node_modules/luxon/src/impl/diff.js +0 -36
  86. package/dist/node_modules/luxon/src/impl/digits.js +0 -74
  87. package/dist/node_modules/luxon/src/impl/english.js +0 -138
  88. package/dist/node_modules/luxon/src/impl/formats.js +0 -150
  89. package/dist/node_modules/luxon/src/impl/formatter.js +0 -245
  90. package/dist/node_modules/luxon/src/impl/invalid.js +0 -11
  91. package/dist/node_modules/luxon/src/impl/locale.js +0 -282
  92. package/dist/node_modules/luxon/src/impl/regexParser.js +0 -202
  93. package/dist/node_modules/luxon/src/impl/tokenParser.js +0 -329
  94. package/dist/node_modules/luxon/src/impl/util.js +0 -206
  95. package/dist/node_modules/luxon/src/impl/zoneUtil.js +0 -19
  96. package/dist/node_modules/luxon/src/info.js +0 -180
  97. package/dist/node_modules/luxon/src/interval.js +0 -466
  98. package/dist/node_modules/luxon/src/settings.js +0 -150
  99. package/dist/node_modules/luxon/src/zone.js +0 -88
  100. package/dist/node_modules/luxon/src/zones/IANAZone.js +0 -178
  101. package/dist/node_modules/luxon/src/zones/fixedOffsetZone.js +0 -125
  102. package/dist/node_modules/luxon/src/zones/invalidZone.js +0 -41
  103. package/dist/node_modules/luxon/src/zones/systemZone.js +0 -47
  104. package/dist/node_modules/sortablejs/modular/sortable.esm.js +0 -1261
  105. package/dist/shared/lit-button.js +0 -142
  106. package/dist/shared/lit-progress-bar.js +0 -83
  107. package/dist/shared/simple-tooltip.js +0 -174
  108. package/dist/shared/styles/button-shared-styles.js +0 -205
  109. package/dist/utils/currency.js +0 -13
  110. package/dist/utils/custom-filters.js +0 -50
  111. package/dist/utils/date.js +0 -15
  112. package/dist/utils/getOperatorByType.js +0 -52
  113. package/dist/utils/localization.js +0 -30
@@ -1,1261 +0,0 @@
1
- /**!
2
- * Sortable 1.15.6
3
- * @author RubaXa <trash@rubaxa.org>
4
- * @author owenm <owen23355@gmail.com>
5
- * @license MIT
6
- */
7
- function se(o, t) {
8
- var e = Object.keys(o);
9
- if (Object.getOwnPropertySymbols) {
10
- var n = Object.getOwnPropertySymbols(o);
11
- t && (n = n.filter(function(i) {
12
- return Object.getOwnPropertyDescriptor(o, i).enumerable;
13
- })), e.push.apply(e, n);
14
- }
15
- return e;
16
- }
17
- function z(o) {
18
- for (var t = 1; t < arguments.length; t++) {
19
- var e = arguments[t] != null ? arguments[t] : {};
20
- t % 2 ? se(Object(e), !0).forEach(function(n) {
21
- Me(o, n, e[n]);
22
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(o, Object.getOwnPropertyDescriptors(e)) : se(Object(e)).forEach(function(n) {
23
- Object.defineProperty(o, n, Object.getOwnPropertyDescriptor(e, n));
24
- });
25
- }
26
- return o;
27
- }
28
- function Mt(o) {
29
- "@babel/helpers - typeof";
30
- return typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? Mt = function(t) {
31
- return typeof t;
32
- } : Mt = function(t) {
33
- return t && typeof Symbol == "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
34
- }, Mt(o);
35
- }
36
- function Me(o, t, e) {
37
- return t in o ? Object.defineProperty(o, t, {
38
- value: e,
39
- enumerable: !0,
40
- configurable: !0,
41
- writable: !0
42
- }) : o[t] = e, o;
43
- }
44
- function q() {
45
- return q = Object.assign || function(o) {
46
- for (var t = 1; t < arguments.length; t++) {
47
- var e = arguments[t];
48
- for (var n in e)
49
- Object.prototype.hasOwnProperty.call(e, n) && (o[n] = e[n]);
50
- }
51
- return o;
52
- }, q.apply(this, arguments);
53
- }
54
- function Fe(o, t) {
55
- if (o == null) return {};
56
- var e = {}, n = Object.keys(o), i, r;
57
- for (r = 0; r < n.length; r++)
58
- i = n[r], !(t.indexOf(i) >= 0) && (e[i] = o[i]);
59
- return e;
60
- }
61
- function Re(o, t) {
62
- if (o == null) return {};
63
- var e = Fe(o, t), n, i;
64
- if (Object.getOwnPropertySymbols) {
65
- var r = Object.getOwnPropertySymbols(o);
66
- for (i = 0; i < r.length; i++)
67
- n = r[i], !(t.indexOf(n) >= 0) && Object.prototype.propertyIsEnumerable.call(o, n) && (e[n] = o[n]);
68
- }
69
- return e;
70
- }
71
- var Xe = "1.15.6";
72
- function U(o) {
73
- if (typeof window < "u" && window.navigator)
74
- return !!/* @__PURE__ */ navigator.userAgent.match(o);
75
- }
76
- var V = U(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i), Ct = U(/Edge/i), ue = U(/firefox/i), wt = U(/safari/i) && !U(/chrome/i) && !U(/android/i), oe = U(/iP(ad|od|hone)/i), ve = U(/chrome/i) && U(/android/i), be = {
77
- capture: !1,
78
- passive: !1
79
- };
80
- function v(o, t, e) {
81
- o.addEventListener(t, e, !V && be);
82
- }
83
- function m(o, t, e) {
84
- o.removeEventListener(t, e, !V && be);
85
- }
86
- function kt(o, t) {
87
- if (t) {
88
- if (t[0] === ">" && (t = t.substring(1)), o)
89
- try {
90
- if (o.matches)
91
- return o.matches(t);
92
- if (o.msMatchesSelector)
93
- return o.msMatchesSelector(t);
94
- if (o.webkitMatchesSelector)
95
- return o.webkitMatchesSelector(t);
96
- } catch {
97
- return !1;
98
- }
99
- return !1;
100
- }
101
- }
102
- function Ee(o) {
103
- return o.host && o !== document && o.host.nodeType ? o.host : o.parentNode;
104
- }
105
- function W(o, t, e, n) {
106
- if (o) {
107
- e = e || document;
108
- do {
109
- if (t != null && (t[0] === ">" ? o.parentNode === e && kt(o, t) : kt(o, t)) || n && o === e)
110
- return o;
111
- if (o === e) break;
112
- } while (o = Ee(o));
113
- }
114
- return null;
115
- }
116
- var fe = /\s+/g;
117
- function R(o, t, e) {
118
- if (o && t)
119
- if (o.classList)
120
- o.classList[e ? "add" : "remove"](t);
121
- else {
122
- var n = (" " + o.className + " ").replace(fe, " ").replace(" " + t + " ", " ");
123
- o.className = (n + (e ? " " + t : "")).replace(fe, " ");
124
- }
125
- }
126
- function h(o, t, e) {
127
- var n = o && o.style;
128
- if (n) {
129
- if (e === void 0)
130
- return document.defaultView && document.defaultView.getComputedStyle ? e = document.defaultView.getComputedStyle(o, "") : o.currentStyle && (e = o.currentStyle), t === void 0 ? e : e[t];
131
- !(t in n) && t.indexOf("webkit") === -1 && (t = "-webkit-" + t), n[t] = e + (typeof e == "string" ? "" : "px");
132
- }
133
- }
134
- function ct(o, t) {
135
- var e = "";
136
- if (typeof o == "string")
137
- e = o;
138
- else
139
- do {
140
- var n = h(o, "transform");
141
- n && n !== "none" && (e = n + " " + e);
142
- } while (!t && (o = o.parentNode));
143
- var i = window.DOMMatrix || window.WebKitCSSMatrix || window.CSSMatrix || window.MSCSSMatrix;
144
- return i && new i(e);
145
- }
146
- function ye(o, t, e) {
147
- if (o) {
148
- var n = o.getElementsByTagName(t), i = 0, r = n.length;
149
- if (e)
150
- for (; i < r; i++)
151
- e(n[i], i);
152
- return n;
153
- }
154
- return [];
155
- }
156
- function L() {
157
- var o = document.scrollingElement;
158
- return o || document.documentElement;
159
- }
160
- function C(o, t, e, n, i) {
161
- if (!(!o.getBoundingClientRect && o !== window)) {
162
- var r, a, l, s, u, d, c;
163
- if (o !== window && o.parentNode && o !== L() ? (r = o.getBoundingClientRect(), a = r.top, l = r.left, s = r.bottom, u = r.right, d = r.height, c = r.width) : (a = 0, l = 0, s = window.innerHeight, u = window.innerWidth, d = window.innerHeight, c = window.innerWidth), (t || e) && o !== window && (i = i || o.parentNode, !V))
164
- do
165
- if (i && i.getBoundingClientRect && (h(i, "transform") !== "none" || e && h(i, "position") !== "static")) {
166
- var b = i.getBoundingClientRect();
167
- a -= b.top + parseInt(h(i, "border-top-width")), l -= b.left + parseInt(h(i, "border-left-width")), s = a + r.height, u = l + r.width;
168
- break;
169
- }
170
- while (i = i.parentNode);
171
- if (n && o !== window) {
172
- var w = ct(i || o), E = w && w.a, y = w && w.d;
173
- w && (a /= y, l /= E, c /= E, d /= y, s = a + d, u = l + c);
174
- }
175
- return {
176
- top: a,
177
- left: l,
178
- bottom: s,
179
- right: u,
180
- width: c,
181
- height: d
182
- };
183
- }
184
- }
185
- function ce(o, t, e) {
186
- for (var n = tt(o, !0), i = C(o)[t]; n; ) {
187
- var r = C(n)[e], a = void 0;
188
- if (a = i >= r, !a) return n;
189
- if (n === L()) break;
190
- n = tt(n, !1);
191
- }
192
- return !1;
193
- }
194
- function dt(o, t, e, n) {
195
- for (var i = 0, r = 0, a = o.children; r < a.length; ) {
196
- if (a[r].style.display !== "none" && a[r] !== p.ghost && (n || a[r] !== p.dragged) && W(a[r], e.draggable, o, !1)) {
197
- if (i === t)
198
- return a[r];
199
- i++;
200
- }
201
- r++;
202
- }
203
- return null;
204
- }
205
- function ie(o, t) {
206
- for (var e = o.lastElementChild; e && (e === p.ghost || h(e, "display") === "none" || t && !kt(e, t)); )
207
- e = e.previousElementSibling;
208
- return e || null;
209
- }
210
- function Y(o, t) {
211
- var e = 0;
212
- if (!o || !o.parentNode)
213
- return -1;
214
- for (; o = o.previousElementSibling; )
215
- o.nodeName.toUpperCase() !== "TEMPLATE" && o !== p.clone && (!t || kt(o, t)) && e++;
216
- return e;
217
- }
218
- function de(o) {
219
- var t = 0, e = 0, n = L();
220
- if (o)
221
- do {
222
- var i = ct(o), r = i.a, a = i.d;
223
- t += o.scrollLeft * r, e += o.scrollTop * a;
224
- } while (o !== n && (o = o.parentNode));
225
- return [t, e];
226
- }
227
- function Ye(o, t) {
228
- for (var e in o)
229
- if (o.hasOwnProperty(e)) {
230
- for (var n in t)
231
- if (t.hasOwnProperty(n) && t[n] === o[e][n]) return Number(e);
232
- }
233
- return -1;
234
- }
235
- function tt(o, t) {
236
- if (!o || !o.getBoundingClientRect) return L();
237
- var e = o, n = !1;
238
- do
239
- if (e.clientWidth < e.scrollWidth || e.clientHeight < e.scrollHeight) {
240
- var i = h(e);
241
- if (e.clientWidth < e.scrollWidth && (i.overflowX == "auto" || i.overflowX == "scroll") || e.clientHeight < e.scrollHeight && (i.overflowY == "auto" || i.overflowY == "scroll")) {
242
- if (!e.getBoundingClientRect || e === document.body) return L();
243
- if (n || t) return e;
244
- n = !0;
245
- }
246
- }
247
- while (e = e.parentNode);
248
- return L();
249
- }
250
- function ke(o, t) {
251
- if (o && t)
252
- for (var e in t)
253
- t.hasOwnProperty(e) && (o[e] = t[e]);
254
- return o;
255
- }
256
- function zt(o, t) {
257
- return Math.round(o.top) === Math.round(t.top) && Math.round(o.left) === Math.round(t.left) && Math.round(o.height) === Math.round(t.height) && Math.round(o.width) === Math.round(t.width);
258
- }
259
- var _t;
260
- function we(o, t) {
261
- return function() {
262
- if (!_t) {
263
- var e = arguments, n = this;
264
- e.length === 1 ? o.call(n, e[0]) : o.apply(n, e), _t = setTimeout(function() {
265
- _t = void 0;
266
- }, t);
267
- }
268
- };
269
- }
270
- function Be() {
271
- clearTimeout(_t), _t = void 0;
272
- }
273
- function _e(o, t, e) {
274
- o.scrollLeft += t, o.scrollTop += e;
275
- }
276
- function De(o) {
277
- var t = window.Polymer, e = window.jQuery || window.Zepto;
278
- return t && t.dom ? t.dom(o).cloneNode(!0) : e ? e(o).clone(!0)[0] : o.cloneNode(!0);
279
- }
280
- function Se(o, t, e) {
281
- var n = {};
282
- return Array.from(o.children).forEach(function(i) {
283
- var r, a, l, s;
284
- if (!(!W(i, t.draggable, o, !1) || i.animated || i === e)) {
285
- var u = C(i);
286
- n.left = Math.min((r = n.left) !== null && r !== void 0 ? r : 1 / 0, u.left), n.top = Math.min((a = n.top) !== null && a !== void 0 ? a : 1 / 0, u.top), n.right = Math.max((l = n.right) !== null && l !== void 0 ? l : -1 / 0, u.right), n.bottom = Math.max((s = n.bottom) !== null && s !== void 0 ? s : -1 / 0, u.bottom);
287
- }
288
- }), n.width = n.right - n.left, n.height = n.bottom - n.top, n.x = n.left, n.y = n.top, n;
289
- }
290
- var N = "Sortable" + (/* @__PURE__ */ new Date()).getTime();
291
- function He() {
292
- var o = [], t;
293
- return {
294
- captureAnimationState: function() {
295
- if (o = [], !!this.options.animation) {
296
- var n = [].slice.call(this.el.children);
297
- n.forEach(function(i) {
298
- if (!(h(i, "display") === "none" || i === p.ghost)) {
299
- o.push({
300
- target: i,
301
- rect: C(i)
302
- });
303
- var r = z({}, o[o.length - 1].rect);
304
- if (i.thisAnimationDuration) {
305
- var a = ct(i, !0);
306
- a && (r.top -= a.f, r.left -= a.e);
307
- }
308
- i.fromRect = r;
309
- }
310
- });
311
- }
312
- },
313
- addAnimationState: function(n) {
314
- o.push(n);
315
- },
316
- removeAnimationState: function(n) {
317
- o.splice(Ye(o, {
318
- target: n
319
- }), 1);
320
- },
321
- animateAll: function(n) {
322
- var i = this;
323
- if (!this.options.animation) {
324
- clearTimeout(t), typeof n == "function" && n();
325
- return;
326
- }
327
- var r = !1, a = 0;
328
- o.forEach(function(l) {
329
- var s = 0, u = l.target, d = u.fromRect, c = C(u), b = u.prevFromRect, w = u.prevToRect, E = l.rect, y = ct(u, !0);
330
- y && (c.top -= y.f, c.left -= y.e), u.toRect = c, u.thisAnimationDuration && zt(b, c) && !zt(d, c) && // Make sure animatingRect is on line between toRect & fromRect
331
- (E.top - c.top) / (E.left - c.left) === (d.top - c.top) / (d.left - c.left) && (s = Ge(E, b, w, i.options)), zt(c, d) || (u.prevFromRect = d, u.prevToRect = c, s || (s = i.options.animation), i.animate(u, E, c, s)), s && (r = !0, a = Math.max(a, s), clearTimeout(u.animationResetTimer), u.animationResetTimer = setTimeout(function() {
332
- u.animationTime = 0, u.prevFromRect = null, u.fromRect = null, u.prevToRect = null, u.thisAnimationDuration = null;
333
- }, s), u.thisAnimationDuration = s);
334
- }), clearTimeout(t), r ? t = setTimeout(function() {
335
- typeof n == "function" && n();
336
- }, a) : typeof n == "function" && n(), o = [];
337
- },
338
- animate: function(n, i, r, a) {
339
- if (a) {
340
- h(n, "transition", ""), h(n, "transform", "");
341
- var l = ct(this.el), s = l && l.a, u = l && l.d, d = (i.left - r.left) / (s || 1), c = (i.top - r.top) / (u || 1);
342
- n.animatingX = !!d, n.animatingY = !!c, h(n, "transform", "translate3d(" + d + "px," + c + "px,0)"), this.forRepaintDummy = We(n), h(n, "transition", "transform " + a + "ms" + (this.options.easing ? " " + this.options.easing : "")), h(n, "transform", "translate3d(0,0,0)"), typeof n.animated == "number" && clearTimeout(n.animated), n.animated = setTimeout(function() {
343
- h(n, "transition", ""), h(n, "transform", ""), n.animated = !1, n.animatingX = !1, n.animatingY = !1;
344
- }, a);
345
- }
346
- }
347
- };
348
- }
349
- function We(o) {
350
- return o.offsetWidth;
351
- }
352
- function Ge(o, t, e, n) {
353
- return Math.sqrt(Math.pow(t.top - o.top, 2) + Math.pow(t.left - o.left, 2)) / Math.sqrt(Math.pow(t.top - e.top, 2) + Math.pow(t.left - e.left, 2)) * n.animation;
354
- }
355
- var lt = [], jt = {
356
- initializeByDefault: !0
357
- }, Ot = {
358
- mount: function(t) {
359
- for (var e in jt)
360
- jt.hasOwnProperty(e) && !(e in t) && (t[e] = jt[e]);
361
- lt.forEach(function(n) {
362
- if (n.pluginName === t.pluginName)
363
- throw "Sortable: Cannot mount plugin ".concat(t.pluginName, " more than once");
364
- }), lt.push(t);
365
- },
366
- pluginEvent: function(t, e, n) {
367
- var i = this;
368
- this.eventCanceled = !1, n.cancel = function() {
369
- i.eventCanceled = !0;
370
- };
371
- var r = t + "Global";
372
- lt.forEach(function(a) {
373
- e[a.pluginName] && (e[a.pluginName][r] && e[a.pluginName][r](z({
374
- sortable: e
375
- }, n)), e.options[a.pluginName] && e[a.pluginName][t] && e[a.pluginName][t](z({
376
- sortable: e
377
- }, n)));
378
- });
379
- },
380
- initializePlugins: function(t, e, n, i) {
381
- lt.forEach(function(l) {
382
- var s = l.pluginName;
383
- if (!(!t.options[s] && !l.initializeByDefault)) {
384
- var u = new l(t, e, t.options);
385
- u.sortable = t, u.options = t.options, t[s] = u, q(n, u.defaults);
386
- }
387
- });
388
- for (var r in t.options)
389
- if (t.options.hasOwnProperty(r)) {
390
- var a = this.modifyOption(t, r, t.options[r]);
391
- typeof a < "u" && (t.options[r] = a);
392
- }
393
- },
394
- getEventProperties: function(t, e) {
395
- var n = {};
396
- return lt.forEach(function(i) {
397
- typeof i.eventProperties == "function" && q(n, i.eventProperties.call(e[i.pluginName], t));
398
- }), n;
399
- },
400
- modifyOption: function(t, e, n) {
401
- var i;
402
- return lt.forEach(function(r) {
403
- t[r.pluginName] && r.optionListeners && typeof r.optionListeners[e] == "function" && (i = r.optionListeners[e].call(t[r.pluginName], n));
404
- }), i;
405
- }
406
- };
407
- function Le(o) {
408
- var t = o.sortable, e = o.rootEl, n = o.name, i = o.targetEl, r = o.cloneEl, a = o.toEl, l = o.fromEl, s = o.oldIndex, u = o.newIndex, d = o.oldDraggableIndex, c = o.newDraggableIndex, b = o.originalEvent, w = o.putSortable, E = o.extraEventProperties;
409
- if (t = t || e && e[N], !!t) {
410
- var y, k = t.options, j = "on" + n.charAt(0).toUpperCase() + n.substr(1);
411
- window.CustomEvent && !V && !Ct ? y = new CustomEvent(n, {
412
- bubbles: !0,
413
- cancelable: !0
414
- }) : (y = document.createEvent("Event"), y.initEvent(n, !0, !0)), y.to = a || e, y.from = l || e, y.item = i || e, y.clone = r, y.oldIndex = s, y.newIndex = u, y.oldDraggableIndex = d, y.newDraggableIndex = c, y.originalEvent = b, y.pullMode = w ? w.lastPutMode : void 0;
415
- var A = z(z({}, E), Ot.getEventProperties(n, t));
416
- for (var B in A)
417
- y[B] = A[B];
418
- e && e.dispatchEvent(y), k[j] && k[j].call(t, y);
419
- }
420
- }
421
- var ze = ["evt"], x = function(t, e) {
422
- var n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, i = n.evt, r = Re(n, ze);
423
- Ot.pluginEvent.bind(p)(t, e, z({
424
- dragEl: f,
425
- parentEl: S,
426
- ghostEl: g,
427
- rootEl: _,
428
- nextEl: at,
429
- lastDownEl: Ft,
430
- cloneEl: D,
431
- cloneHidden: J,
432
- dragStarted: bt,
433
- putSortable: O,
434
- activeSortable: p.active,
435
- originalEvent: i,
436
- oldIndex: ft,
437
- oldDraggableIndex: Dt,
438
- newIndex: X,
439
- newDraggableIndex: Q,
440
- hideGhostForTarget: Ie,
441
- unhideGhostForTarget: Ae,
442
- cloneNowHidden: function() {
443
- J = !0;
444
- },
445
- cloneNowShown: function() {
446
- J = !1;
447
- },
448
- dispatchSortableEvent: function(l) {
449
- P({
450
- sortable: e,
451
- name: l,
452
- originalEvent: i
453
- });
454
- }
455
- }, r));
456
- };
457
- function P(o) {
458
- Le(z({
459
- putSortable: O,
460
- cloneEl: D,
461
- targetEl: f,
462
- rootEl: _,
463
- oldIndex: ft,
464
- oldDraggableIndex: Dt,
465
- newIndex: X,
466
- newDraggableIndex: Q
467
- }, o));
468
- }
469
- var f, S, g, _, at, Ft, D, J, ft, X, Dt, Q, At, O, ut = !1, Bt = !1, Ht = [], it, H, $t, Ut, he, pe, bt, st, St, Tt = !1, Pt = !1, Rt, I, qt = [], Jt = !1, Wt = [], Lt = typeof document < "u", xt = oe, ge = Ct || V ? "cssFloat" : "float", je = Lt && !ve && !oe && "draggable" in document.createElement("div"), Te = function() {
470
- if (Lt) {
471
- if (V)
472
- return !1;
473
- var o = document.createElement("x");
474
- return o.style.cssText = "pointer-events:auto", o.style.pointerEvents === "auto";
475
- }
476
- }(), Ce = function(t, e) {
477
- var n = h(t), i = parseInt(n.width) - parseInt(n.paddingLeft) - parseInt(n.paddingRight) - parseInt(n.borderLeftWidth) - parseInt(n.borderRightWidth), r = dt(t, 0, e), a = dt(t, 1, e), l = r && h(r), s = a && h(a), u = l && parseInt(l.marginLeft) + parseInt(l.marginRight) + C(r).width, d = s && parseInt(s.marginLeft) + parseInt(s.marginRight) + C(a).width;
478
- if (n.display === "flex")
479
- return n.flexDirection === "column" || n.flexDirection === "column-reverse" ? "vertical" : "horizontal";
480
- if (n.display === "grid")
481
- return n.gridTemplateColumns.split(" ").length <= 1 ? "vertical" : "horizontal";
482
- if (r && l.float && l.float !== "none") {
483
- var c = l.float === "left" ? "left" : "right";
484
- return a && (s.clear === "both" || s.clear === c) ? "vertical" : "horizontal";
485
- }
486
- return r && (l.display === "block" || l.display === "flex" || l.display === "table" || l.display === "grid" || u >= i && n[ge] === "none" || a && n[ge] === "none" && u + d > i) ? "vertical" : "horizontal";
487
- }, $e = function(t, e, n) {
488
- var i = n ? t.left : t.top, r = n ? t.right : t.bottom, a = n ? t.width : t.height, l = n ? e.left : e.top, s = n ? e.right : e.bottom, u = n ? e.width : e.height;
489
- return i === l || r === s || i + a / 2 === l + u / 2;
490
- }, Ue = function(t, e) {
491
- var n;
492
- return Ht.some(function(i) {
493
- var r = i[N].options.emptyInsertThreshold;
494
- if (!(!r || ie(i))) {
495
- var a = C(i), l = t >= a.left - r && t <= a.right + r, s = e >= a.top - r && e <= a.bottom + r;
496
- if (l && s)
497
- return n = i;
498
- }
499
- }), n;
500
- }, Oe = function(t) {
501
- function e(r, a) {
502
- return function(l, s, u, d) {
503
- var c = l.options.group.name && s.options.group.name && l.options.group.name === s.options.group.name;
504
- if (r == null && (a || c))
505
- return !0;
506
- if (r == null || r === !1)
507
- return !1;
508
- if (a && r === "clone")
509
- return r;
510
- if (typeof r == "function")
511
- return e(r(l, s, u, d), a)(l, s, u, d);
512
- var b = (a ? l : s).options.group.name;
513
- return r === !0 || typeof r == "string" && r === b || r.join && r.indexOf(b) > -1;
514
- };
515
- }
516
- var n = {}, i = t.group;
517
- (!i || Mt(i) != "object") && (i = {
518
- name: i
519
- }), n.name = i.name, n.checkPull = e(i.pull, !0), n.checkPut = e(i.put), n.revertClone = i.revertClone, t.group = n;
520
- }, Ie = function() {
521
- !Te && g && h(g, "display", "none");
522
- }, Ae = function() {
523
- !Te && g && h(g, "display", "");
524
- };
525
- Lt && !ve && document.addEventListener("click", function(o) {
526
- if (Bt)
527
- return o.preventDefault(), o.stopPropagation && o.stopPropagation(), o.stopImmediatePropagation && o.stopImmediatePropagation(), Bt = !1, !1;
528
- }, !0);
529
- var rt = function(t) {
530
- if (f) {
531
- t = t.touches ? t.touches[0] : t;
532
- var e = Ue(t.clientX, t.clientY);
533
- if (e) {
534
- var n = {};
535
- for (var i in t)
536
- t.hasOwnProperty(i) && (n[i] = t[i]);
537
- n.target = n.rootEl = e, n.preventDefault = void 0, n.stopPropagation = void 0, e[N]._onDragOver(n);
538
- }
539
- }
540
- }, qe = function(t) {
541
- f && f.parentNode[N]._isOutsideThisEl(t.target);
542
- };
543
- function p(o, t) {
544
- if (!(o && o.nodeType && o.nodeType === 1))
545
- throw "Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(o));
546
- this.el = o, this.options = t = q({}, t), o[N] = this;
547
- var e = {
548
- group: null,
549
- sort: !0,
550
- disabled: !1,
551
- store: null,
552
- handle: null,
553
- draggable: /^[uo]l$/i.test(o.nodeName) ? ">li" : ">*",
554
- swapThreshold: 1,
555
- // percentage; 0 <= x <= 1
556
- invertSwap: !1,
557
- // invert always
558
- invertedSwapThreshold: null,
559
- // will be set to same as swapThreshold if default
560
- removeCloneOnHide: !0,
561
- direction: function() {
562
- return Ce(o, this.options);
563
- },
564
- ghostClass: "sortable-ghost",
565
- chosenClass: "sortable-chosen",
566
- dragClass: "sortable-drag",
567
- ignore: "a, img",
568
- filter: null,
569
- preventOnFilter: !0,
570
- animation: 0,
571
- easing: null,
572
- setData: function(a, l) {
573
- a.setData("Text", l.textContent);
574
- },
575
- dropBubble: !1,
576
- dragoverBubble: !1,
577
- dataIdAttr: "data-id",
578
- delay: 0,
579
- delayOnTouchOnly: !1,
580
- touchStartThreshold: (Number.parseInt ? Number : window).parseInt(window.devicePixelRatio, 10) || 1,
581
- forceFallback: !1,
582
- fallbackClass: "sortable-fallback",
583
- fallbackOnBody: !1,
584
- fallbackTolerance: 0,
585
- fallbackOffset: {
586
- x: 0,
587
- y: 0
588
- },
589
- // Disabled on Safari: #1571; Enabled on Safari IOS: #2244
590
- supportPointer: p.supportPointer !== !1 && "PointerEvent" in window && (!wt || oe),
591
- emptyInsertThreshold: 5
592
- };
593
- Ot.initializePlugins(this, o, e);
594
- for (var n in e)
595
- !(n in t) && (t[n] = e[n]);
596
- Oe(t);
597
- for (var i in this)
598
- i.charAt(0) === "_" && typeof this[i] == "function" && (this[i] = this[i].bind(this));
599
- this.nativeDraggable = t.forceFallback ? !1 : je, this.nativeDraggable && (this.options.touchStartThreshold = 1), t.supportPointer ? v(o, "pointerdown", this._onTapStart) : (v(o, "mousedown", this._onTapStart), v(o, "touchstart", this._onTapStart)), this.nativeDraggable && (v(o, "dragover", this), v(o, "dragenter", this)), Ht.push(this.el), t.store && t.store.get && this.sort(t.store.get(this) || []), q(this, He());
600
- }
601
- p.prototype = /** @lends Sortable.prototype */
602
- {
603
- constructor: p,
604
- _isOutsideThisEl: function(t) {
605
- !this.el.contains(t) && t !== this.el && (st = null);
606
- },
607
- _getDirection: function(t, e) {
608
- return typeof this.options.direction == "function" ? this.options.direction.call(this, t, e, f) : this.options.direction;
609
- },
610
- _onTapStart: function(t) {
611
- if (t.cancelable) {
612
- var e = this, n = this.el, i = this.options, r = i.preventOnFilter, a = t.type, l = t.touches && t.touches[0] || t.pointerType && t.pointerType === "touch" && t, s = (l || t).target, u = t.target.shadowRoot && (t.path && t.path[0] || t.composedPath && t.composedPath()[0]) || s, d = i.filter;
613
- if (nn(n), !f && !(/mousedown|pointerdown/.test(a) && t.button !== 0 || i.disabled) && !u.isContentEditable && !(!this.nativeDraggable && wt && s && s.tagName.toUpperCase() === "SELECT") && (s = W(s, i.draggable, n, !1), !(s && s.animated) && Ft !== s)) {
614
- if (ft = Y(s), Dt = Y(s, i.draggable), typeof d == "function") {
615
- if (d.call(this, t, s, this)) {
616
- P({
617
- sortable: e,
618
- rootEl: u,
619
- name: "filter",
620
- targetEl: s,
621
- toEl: n,
622
- fromEl: n
623
- }), x("filter", e, {
624
- evt: t
625
- }), r && t.preventDefault();
626
- return;
627
- }
628
- } else if (d && (d = d.split(",").some(function(c) {
629
- if (c = W(u, c.trim(), n, !1), c)
630
- return P({
631
- sortable: e,
632
- rootEl: c,
633
- name: "filter",
634
- targetEl: s,
635
- fromEl: n,
636
- toEl: n
637
- }), x("filter", e, {
638
- evt: t
639
- }), !0;
640
- }), d)) {
641
- r && t.preventDefault();
642
- return;
643
- }
644
- i.handle && !W(u, i.handle, n, !1) || this._prepareDragStart(t, l, s);
645
- }
646
- }
647
- },
648
- _prepareDragStart: function(t, e, n) {
649
- var i = this, r = i.el, a = i.options, l = r.ownerDocument, s;
650
- if (n && !f && n.parentNode === r) {
651
- var u = C(n);
652
- if (_ = r, f = n, S = f.parentNode, at = f.nextSibling, Ft = n, At = a.group, p.dragged = f, it = {
653
- target: f,
654
- clientX: (e || t).clientX,
655
- clientY: (e || t).clientY
656
- }, he = it.clientX - u.left, pe = it.clientY - u.top, this._lastX = (e || t).clientX, this._lastY = (e || t).clientY, f.style["will-change"] = "all", s = function() {
657
- if (x("delayEnded", i, {
658
- evt: t
659
- }), p.eventCanceled) {
660
- i._onDrop();
661
- return;
662
- }
663
- i._disableDelayedDragEvents(), !ue && i.nativeDraggable && (f.draggable = !0), i._triggerDragStart(t, e), P({
664
- sortable: i,
665
- name: "choose",
666
- originalEvent: t
667
- }), R(f, a.chosenClass, !0);
668
- }, a.ignore.split(",").forEach(function(d) {
669
- ye(f, d.trim(), Vt);
670
- }), v(l, "dragover", rt), v(l, "mousemove", rt), v(l, "touchmove", rt), a.supportPointer ? (v(l, "pointerup", i._onDrop), !this.nativeDraggable && v(l, "pointercancel", i._onDrop)) : (v(l, "mouseup", i._onDrop), v(l, "touchend", i._onDrop), v(l, "touchcancel", i._onDrop)), ue && this.nativeDraggable && (this.options.touchStartThreshold = 4, f.draggable = !0), x("delayStart", this, {
671
- evt: t
672
- }), a.delay && (!a.delayOnTouchOnly || e) && (!this.nativeDraggable || !(Ct || V))) {
673
- if (p.eventCanceled) {
674
- this._onDrop();
675
- return;
676
- }
677
- a.supportPointer ? (v(l, "pointerup", i._disableDelayedDrag), v(l, "pointercancel", i._disableDelayedDrag)) : (v(l, "mouseup", i._disableDelayedDrag), v(l, "touchend", i._disableDelayedDrag), v(l, "touchcancel", i._disableDelayedDrag)), v(l, "mousemove", i._delayedDragTouchMoveHandler), v(l, "touchmove", i._delayedDragTouchMoveHandler), a.supportPointer && v(l, "pointermove", i._delayedDragTouchMoveHandler), i._dragStartTimer = setTimeout(s, a.delay);
678
- } else
679
- s();
680
- }
681
- },
682
- _delayedDragTouchMoveHandler: function(t) {
683
- var e = t.touches ? t.touches[0] : t;
684
- Math.max(Math.abs(e.clientX - this._lastX), Math.abs(e.clientY - this._lastY)) >= Math.floor(this.options.touchStartThreshold / (this.nativeDraggable && window.devicePixelRatio || 1)) && this._disableDelayedDrag();
685
- },
686
- _disableDelayedDrag: function() {
687
- f && Vt(f), clearTimeout(this._dragStartTimer), this._disableDelayedDragEvents();
688
- },
689
- _disableDelayedDragEvents: function() {
690
- var t = this.el.ownerDocument;
691
- m(t, "mouseup", this._disableDelayedDrag), m(t, "touchend", this._disableDelayedDrag), m(t, "touchcancel", this._disableDelayedDrag), m(t, "pointerup", this._disableDelayedDrag), m(t, "pointercancel", this._disableDelayedDrag), m(t, "mousemove", this._delayedDragTouchMoveHandler), m(t, "touchmove", this._delayedDragTouchMoveHandler), m(t, "pointermove", this._delayedDragTouchMoveHandler);
692
- },
693
- _triggerDragStart: function(t, e) {
694
- e = e || t.pointerType == "touch" && t, !this.nativeDraggable || e ? this.options.supportPointer ? v(document, "pointermove", this._onTouchMove) : e ? v(document, "touchmove", this._onTouchMove) : v(document, "mousemove", this._onTouchMove) : (v(f, "dragend", this), v(_, "dragstart", this._onDragStart));
695
- try {
696
- document.selection ? Xt(function() {
697
- document.selection.empty();
698
- }) : window.getSelection().removeAllRanges();
699
- } catch {
700
- }
701
- },
702
- _dragStarted: function(t, e) {
703
- if (ut = !1, _ && f) {
704
- x("dragStarted", this, {
705
- evt: e
706
- }), this.nativeDraggable && v(document, "dragover", qe);
707
- var n = this.options;
708
- !t && R(f, n.dragClass, !1), R(f, n.ghostClass, !0), p.active = this, t && this._appendGhost(), P({
709
- sortable: this,
710
- name: "start",
711
- originalEvent: e
712
- });
713
- } else
714
- this._nulling();
715
- },
716
- _emulateDragOver: function() {
717
- if (H) {
718
- this._lastX = H.clientX, this._lastY = H.clientY, Ie();
719
- for (var t = document.elementFromPoint(H.clientX, H.clientY), e = t; t && t.shadowRoot && (t = t.shadowRoot.elementFromPoint(H.clientX, H.clientY), t !== e); )
720
- e = t;
721
- if (f.parentNode[N]._isOutsideThisEl(t), e)
722
- do {
723
- if (e[N]) {
724
- var n = void 0;
725
- if (n = e[N]._onDragOver({
726
- clientX: H.clientX,
727
- clientY: H.clientY,
728
- target: t,
729
- rootEl: e
730
- }), n && !this.options.dragoverBubble)
731
- break;
732
- }
733
- t = e;
734
- } while (e = Ee(e));
735
- Ae();
736
- }
737
- },
738
- _onTouchMove: function(t) {
739
- if (it) {
740
- var e = this.options, n = e.fallbackTolerance, i = e.fallbackOffset, r = t.touches ? t.touches[0] : t, a = g && ct(g, !0), l = g && a && a.a, s = g && a && a.d, u = xt && I && de(I), d = (r.clientX - it.clientX + i.x) / (l || 1) + (u ? u[0] - qt[0] : 0) / (l || 1), c = (r.clientY - it.clientY + i.y) / (s || 1) + (u ? u[1] - qt[1] : 0) / (s || 1);
741
- if (!p.active && !ut) {
742
- if (n && Math.max(Math.abs(r.clientX - this._lastX), Math.abs(r.clientY - this._lastY)) < n)
743
- return;
744
- this._onDragStart(t, !0);
745
- }
746
- if (g) {
747
- a ? (a.e += d - ($t || 0), a.f += c - (Ut || 0)) : a = {
748
- a: 1,
749
- b: 0,
750
- c: 0,
751
- d: 1,
752
- e: d,
753
- f: c
754
- };
755
- var b = "matrix(".concat(a.a, ",").concat(a.b, ",").concat(a.c, ",").concat(a.d, ",").concat(a.e, ",").concat(a.f, ")");
756
- h(g, "webkitTransform", b), h(g, "mozTransform", b), h(g, "msTransform", b), h(g, "transform", b), $t = d, Ut = c, H = r;
757
- }
758
- t.cancelable && t.preventDefault();
759
- }
760
- },
761
- _appendGhost: function() {
762
- if (!g) {
763
- var t = this.options.fallbackOnBody ? document.body : _, e = C(f, !0, xt, !0, t), n = this.options;
764
- if (xt) {
765
- for (I = t; h(I, "position") === "static" && h(I, "transform") === "none" && I !== document; )
766
- I = I.parentNode;
767
- I !== document.body && I !== document.documentElement ? (I === document && (I = L()), e.top += I.scrollTop, e.left += I.scrollLeft) : I = L(), qt = de(I);
768
- }
769
- g = f.cloneNode(!0), R(g, n.ghostClass, !1), R(g, n.fallbackClass, !0), R(g, n.dragClass, !0), h(g, "transition", ""), h(g, "transform", ""), h(g, "box-sizing", "border-box"), h(g, "margin", 0), h(g, "top", e.top), h(g, "left", e.left), h(g, "width", e.width), h(g, "height", e.height), h(g, "opacity", "0.8"), h(g, "position", xt ? "absolute" : "fixed"), h(g, "zIndex", "100000"), h(g, "pointerEvents", "none"), p.ghost = g, t.appendChild(g), h(g, "transform-origin", he / parseInt(g.style.width) * 100 + "% " + pe / parseInt(g.style.height) * 100 + "%");
770
- }
771
- },
772
- _onDragStart: function(t, e) {
773
- var n = this, i = t.dataTransfer, r = n.options;
774
- if (x("dragStart", this, {
775
- evt: t
776
- }), p.eventCanceled) {
777
- this._onDrop();
778
- return;
779
- }
780
- x("setupClone", this), p.eventCanceled || (D = De(f), D.removeAttribute("id"), D.draggable = !1, D.style["will-change"] = "", this._hideClone(), R(D, this.options.chosenClass, !1), p.clone = D), n.cloneId = Xt(function() {
781
- x("clone", n), !p.eventCanceled && (n.options.removeCloneOnHide || _.insertBefore(D, f), n._hideClone(), P({
782
- sortable: n,
783
- name: "clone"
784
- }));
785
- }), !e && R(f, r.dragClass, !0), e ? (Bt = !0, n._loopId = setInterval(n._emulateDragOver, 50)) : (m(document, "mouseup", n._onDrop), m(document, "touchend", n._onDrop), m(document, "touchcancel", n._onDrop), i && (i.effectAllowed = "move", r.setData && r.setData.call(n, i, f)), v(document, "drop", n), h(f, "transform", "translateZ(0)")), ut = !0, n._dragStartId = Xt(n._dragStarted.bind(n, e, t)), v(document, "selectstart", n), bt = !0, window.getSelection().removeAllRanges(), wt && h(document.body, "user-select", "none");
786
- },
787
- // Returns true - if no further action is needed (either inserted or another condition)
788
- _onDragOver: function(t) {
789
- var e = this.el, n = t.target, i, r, a, l = this.options, s = l.group, u = p.active, d = At === s, c = l.sort, b = O || u, w, E = this, y = !1;
790
- if (Jt) return;
791
- function k(vt, xe) {
792
- x(vt, E, z({
793
- evt: t,
794
- isOwner: d,
795
- axis: w ? "vertical" : "horizontal",
796
- revert: a,
797
- dragRect: i,
798
- targetRect: r,
799
- canSort: c,
800
- fromSortable: b,
801
- target: n,
802
- completed: A,
803
- onMove: function(le, Ne) {
804
- return Nt(_, e, f, i, le, C(le), t, Ne);
805
- },
806
- changed: B
807
- }, xe));
808
- }
809
- function j() {
810
- k("dragOverAnimationCapture"), E.captureAnimationState(), E !== b && b.captureAnimationState();
811
- }
812
- function A(vt) {
813
- return k("dragOverCompleted", {
814
- insertion: vt
815
- }), vt && (d ? u._hideClone() : u._showClone(E), E !== b && (R(f, O ? O.options.ghostClass : u.options.ghostClass, !1), R(f, l.ghostClass, !0)), O !== E && E !== p.active ? O = E : E === p.active && O && (O = null), b === E && (E._ignoreWhileAnimating = n), E.animateAll(function() {
816
- k("dragOverAnimationComplete"), E._ignoreWhileAnimating = null;
817
- }), E !== b && (b.animateAll(), b._ignoreWhileAnimating = null)), (n === f && !f.animated || n === e && !n.animated) && (st = null), !l.dragoverBubble && !t.rootEl && n !== document && (f.parentNode[N]._isOutsideThisEl(t.target), !vt && rt(t)), !l.dragoverBubble && t.stopPropagation && t.stopPropagation(), y = !0;
818
- }
819
- function B() {
820
- X = Y(f), Q = Y(f, l.draggable), P({
821
- sortable: E,
822
- name: "change",
823
- toEl: e,
824
- newIndex: X,
825
- newDraggableIndex: Q,
826
- originalEvent: t
827
- });
828
- }
829
- if (t.preventDefault !== void 0 && t.cancelable && t.preventDefault(), n = W(n, l.draggable, e, !0), k("dragOver"), p.eventCanceled) return y;
830
- if (f.contains(t.target) || n.animated && n.animatingX && n.animatingY || E._ignoreWhileAnimating === n)
831
- return A(!1);
832
- if (Bt = !1, u && !l.disabled && (d ? c || (a = S !== _) : O === this || (this.lastPutMode = At.checkPull(this, u, f, t)) && s.checkPut(this, u, f, t))) {
833
- if (w = this._getDirection(t, n) === "vertical", i = C(f), k("dragOverValid"), p.eventCanceled) return y;
834
- if (a)
835
- return S = _, j(), this._hideClone(), k("revert"), p.eventCanceled || (at ? _.insertBefore(f, at) : _.appendChild(f)), A(!0);
836
- var M = ie(e, l.draggable);
837
- if (!M || Qe(t, w, this) && !M.animated) {
838
- if (M === f)
839
- return A(!1);
840
- if (M && e === t.target && (n = M), n && (r = C(n)), Nt(_, e, f, i, n, r, t, !!n) !== !1)
841
- return j(), M && M.nextSibling ? e.insertBefore(f, M.nextSibling) : e.appendChild(f), S = e, B(), A(!0);
842
- } else if (M && Ze(t, w, this)) {
843
- var et = dt(e, 0, l, !0);
844
- if (et === f)
845
- return A(!1);
846
- if (n = et, r = C(n), Nt(_, e, f, i, n, r, t, !1) !== !1)
847
- return j(), e.insertBefore(f, et), S = e, B(), A(!0);
848
- } else if (n.parentNode === e) {
849
- r = C(n);
850
- var G = 0, nt, ht = f.parentNode !== e, F = !$e(f.animated && f.toRect || i, n.animated && n.toRect || r, w), pt = w ? "top" : "left", K = ce(n, "top", "top") || ce(f, "top", "top"), gt = K ? K.scrollTop : void 0;
851
- st !== n && (nt = r[pt], Tt = !1, Pt = !F && l.invertSwap || ht), G = Je(t, n, r, w, F ? 1 : l.swapThreshold, l.invertedSwapThreshold == null ? l.swapThreshold : l.invertedSwapThreshold, Pt, st === n);
852
- var $;
853
- if (G !== 0) {
854
- var ot = Y(f);
855
- do
856
- ot -= G, $ = S.children[ot];
857
- while ($ && (h($, "display") === "none" || $ === g));
858
- }
859
- if (G === 0 || $ === n)
860
- return A(!1);
861
- st = n, St = G;
862
- var mt = n.nextElementSibling, Z = !1;
863
- Z = G === 1;
864
- var It = Nt(_, e, f, i, n, r, t, Z);
865
- if (It !== !1)
866
- return (It === 1 || It === -1) && (Z = It === 1), Jt = !0, setTimeout(Ke, 30), j(), Z && !mt ? e.appendChild(f) : n.parentNode.insertBefore(f, Z ? mt : n), K && _e(K, 0, gt - K.scrollTop), S = f.parentNode, nt !== void 0 && !Pt && (Rt = Math.abs(nt - C(n)[pt])), B(), A(!0);
867
- }
868
- if (e.contains(f))
869
- return A(!1);
870
- }
871
- return !1;
872
- },
873
- _ignoreWhileAnimating: null,
874
- _offMoveEvents: function() {
875
- m(document, "mousemove", this._onTouchMove), m(document, "touchmove", this._onTouchMove), m(document, "pointermove", this._onTouchMove), m(document, "dragover", rt), m(document, "mousemove", rt), m(document, "touchmove", rt);
876
- },
877
- _offUpEvents: function() {
878
- var t = this.el.ownerDocument;
879
- m(t, "mouseup", this._onDrop), m(t, "touchend", this._onDrop), m(t, "pointerup", this._onDrop), m(t, "pointercancel", this._onDrop), m(t, "touchcancel", this._onDrop), m(document, "selectstart", this);
880
- },
881
- _onDrop: function(t) {
882
- var e = this.el, n = this.options;
883
- if (X = Y(f), Q = Y(f, n.draggable), x("drop", this, {
884
- evt: t
885
- }), S = f && f.parentNode, X = Y(f), Q = Y(f, n.draggable), p.eventCanceled) {
886
- this._nulling();
887
- return;
888
- }
889
- ut = !1, Pt = !1, Tt = !1, clearInterval(this._loopId), clearTimeout(this._dragStartTimer), te(this.cloneId), te(this._dragStartId), this.nativeDraggable && (m(document, "drop", this), m(e, "dragstart", this._onDragStart)), this._offMoveEvents(), this._offUpEvents(), wt && h(document.body, "user-select", ""), h(f, "transform", ""), t && (bt && (t.cancelable && t.preventDefault(), !n.dropBubble && t.stopPropagation()), g && g.parentNode && g.parentNode.removeChild(g), (_ === S || O && O.lastPutMode !== "clone") && D && D.parentNode && D.parentNode.removeChild(D), f && (this.nativeDraggable && m(f, "dragend", this), Vt(f), f.style["will-change"] = "", bt && !ut && R(f, O ? O.options.ghostClass : this.options.ghostClass, !1), R(f, this.options.chosenClass, !1), P({
890
- sortable: this,
891
- name: "unchoose",
892
- toEl: S,
893
- newIndex: null,
894
- newDraggableIndex: null,
895
- originalEvent: t
896
- }), _ !== S ? (X >= 0 && (P({
897
- rootEl: S,
898
- name: "add",
899
- toEl: S,
900
- fromEl: _,
901
- originalEvent: t
902
- }), P({
903
- sortable: this,
904
- name: "remove",
905
- toEl: S,
906
- originalEvent: t
907
- }), P({
908
- rootEl: S,
909
- name: "sort",
910
- toEl: S,
911
- fromEl: _,
912
- originalEvent: t
913
- }), P({
914
- sortable: this,
915
- name: "sort",
916
- toEl: S,
917
- originalEvent: t
918
- })), O && O.save()) : X !== ft && X >= 0 && (P({
919
- sortable: this,
920
- name: "update",
921
- toEl: S,
922
- originalEvent: t
923
- }), P({
924
- sortable: this,
925
- name: "sort",
926
- toEl: S,
927
- originalEvent: t
928
- })), p.active && ((X == null || X === -1) && (X = ft, Q = Dt), P({
929
- sortable: this,
930
- name: "end",
931
- toEl: S,
932
- originalEvent: t
933
- }), this.save()))), this._nulling();
934
- },
935
- _nulling: function() {
936
- x("nulling", this), _ = f = S = g = at = D = Ft = J = it = H = bt = X = Q = ft = Dt = st = St = O = At = p.dragged = p.ghost = p.clone = p.active = null, Wt.forEach(function(t) {
937
- t.checked = !0;
938
- }), Wt.length = $t = Ut = 0;
939
- },
940
- handleEvent: function(t) {
941
- switch (t.type) {
942
- case "drop":
943
- case "dragend":
944
- this._onDrop(t);
945
- break;
946
- case "dragenter":
947
- case "dragover":
948
- f && (this._onDragOver(t), Ve(t));
949
- break;
950
- case "selectstart":
951
- t.preventDefault();
952
- break;
953
- }
954
- },
955
- /**
956
- * Serializes the item into an array of string.
957
- * @returns {String[]}
958
- */
959
- toArray: function() {
960
- for (var t = [], e, n = this.el.children, i = 0, r = n.length, a = this.options; i < r; i++)
961
- e = n[i], W(e, a.draggable, this.el, !1) && t.push(e.getAttribute(a.dataIdAttr) || en(e));
962
- return t;
963
- },
964
- /**
965
- * Sorts the elements according to the array.
966
- * @param {String[]} order order of the items
967
- */
968
- sort: function(t, e) {
969
- var n = {}, i = this.el;
970
- this.toArray().forEach(function(r, a) {
971
- var l = i.children[a];
972
- W(l, this.options.draggable, i, !1) && (n[r] = l);
973
- }, this), e && this.captureAnimationState(), t.forEach(function(r) {
974
- n[r] && (i.removeChild(n[r]), i.appendChild(n[r]));
975
- }), e && this.animateAll();
976
- },
977
- /**
978
- * Save the current sorting
979
- */
980
- save: function() {
981
- var t = this.options.store;
982
- t && t.set && t.set(this);
983
- },
984
- /**
985
- * 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.
986
- * @param {HTMLElement} el
987
- * @param {String} [selector] default: `options.draggable`
988
- * @returns {HTMLElement|null}
989
- */
990
- closest: function(t, e) {
991
- return W(t, e || this.options.draggable, this.el, !1);
992
- },
993
- /**
994
- * Set/get option
995
- * @param {string} name
996
- * @param {*} [value]
997
- * @returns {*}
998
- */
999
- option: function(t, e) {
1000
- var n = this.options;
1001
- if (e === void 0)
1002
- return n[t];
1003
- var i = Ot.modifyOption(this, t, e);
1004
- typeof i < "u" ? n[t] = i : n[t] = e, t === "group" && Oe(n);
1005
- },
1006
- /**
1007
- * Destroy
1008
- */
1009
- destroy: function() {
1010
- x("destroy", this);
1011
- var t = this.el;
1012
- t[N] = null, m(t, "mousedown", this._onTapStart), m(t, "touchstart", this._onTapStart), m(t, "pointerdown", this._onTapStart), this.nativeDraggable && (m(t, "dragover", this), m(t, "dragenter", this)), Array.prototype.forEach.call(t.querySelectorAll("[draggable]"), function(e) {
1013
- e.removeAttribute("draggable");
1014
- }), this._onDrop(), this._disableDelayedDragEvents(), Ht.splice(Ht.indexOf(this.el), 1), this.el = t = null;
1015
- },
1016
- _hideClone: function() {
1017
- if (!J) {
1018
- if (x("hideClone", this), p.eventCanceled) return;
1019
- h(D, "display", "none"), this.options.removeCloneOnHide && D.parentNode && D.parentNode.removeChild(D), J = !0;
1020
- }
1021
- },
1022
- _showClone: function(t) {
1023
- if (t.lastPutMode !== "clone") {
1024
- this._hideClone();
1025
- return;
1026
- }
1027
- if (J) {
1028
- if (x("showClone", this), p.eventCanceled) return;
1029
- f.parentNode == _ && !this.options.group.revertClone ? _.insertBefore(D, f) : at ? _.insertBefore(D, at) : _.appendChild(D), this.options.group.revertClone && this.animate(f, D), h(D, "display", ""), J = !1;
1030
- }
1031
- }
1032
- };
1033
- function Ve(o) {
1034
- o.dataTransfer && (o.dataTransfer.dropEffect = "move"), o.cancelable && o.preventDefault();
1035
- }
1036
- function Nt(o, t, e, n, i, r, a, l) {
1037
- var s, u = o[N], d = u.options.onMove, c;
1038
- return window.CustomEvent && !V && !Ct ? s = new CustomEvent("move", {
1039
- bubbles: !0,
1040
- cancelable: !0
1041
- }) : (s = document.createEvent("Event"), s.initEvent("move", !0, !0)), s.to = t, s.from = o, s.dragged = e, s.draggedRect = n, s.related = i || t, s.relatedRect = r || C(t), s.willInsertAfter = l, s.originalEvent = a, o.dispatchEvent(s), d && (c = d.call(u, s, a)), c;
1042
- }
1043
- function Vt(o) {
1044
- o.draggable = !1;
1045
- }
1046
- function Ke() {
1047
- Jt = !1;
1048
- }
1049
- function Ze(o, t, e) {
1050
- var n = C(dt(e.el, 0, e.options, !0)), i = Se(e.el, e.options, g), r = 10;
1051
- return t ? o.clientX < i.left - r || o.clientY < n.top && o.clientX < n.right : o.clientY < i.top - r || o.clientY < n.bottom && o.clientX < n.left;
1052
- }
1053
- function Qe(o, t, e) {
1054
- var n = C(ie(e.el, e.options.draggable)), i = Se(e.el, e.options, g), r = 10;
1055
- return t ? o.clientX > i.right + r || o.clientY > n.bottom && o.clientX > n.left : o.clientY > i.bottom + r || o.clientX > n.right && o.clientY > n.top;
1056
- }
1057
- function Je(o, t, e, n, i, r, a, l) {
1058
- var s = n ? o.clientY : o.clientX, u = n ? e.height : e.width, d = n ? e.top : e.left, c = n ? e.bottom : e.right, b = !1;
1059
- if (!a) {
1060
- if (l && Rt < u * i) {
1061
- if (!Tt && (St === 1 ? s > d + u * r / 2 : s < c - u * r / 2) && (Tt = !0), Tt)
1062
- b = !0;
1063
- else if (St === 1 ? s < d + Rt : s > c - Rt)
1064
- return -St;
1065
- } else if (s > d + u * (1 - i) / 2 && s < c - u * (1 - i) / 2)
1066
- return tn(t);
1067
- }
1068
- return b = b || a, b && (s < d + u * r / 2 || s > c - u * r / 2) ? s > d + u / 2 ? 1 : -1 : 0;
1069
- }
1070
- function tn(o) {
1071
- return Y(f) < Y(o) ? 1 : -1;
1072
- }
1073
- function en(o) {
1074
- for (var t = o.tagName + o.className + o.src + o.href + o.textContent, e = t.length, n = 0; e--; )
1075
- n += t.charCodeAt(e);
1076
- return n.toString(36);
1077
- }
1078
- function nn(o) {
1079
- Wt.length = 0;
1080
- for (var t = o.getElementsByTagName("input"), e = t.length; e--; ) {
1081
- var n = t[e];
1082
- n.checked && Wt.push(n);
1083
- }
1084
- }
1085
- function Xt(o) {
1086
- return setTimeout(o, 0);
1087
- }
1088
- function te(o) {
1089
- return clearTimeout(o);
1090
- }
1091
- Lt && v(document, "touchmove", function(o) {
1092
- (p.active || ut) && o.cancelable && o.preventDefault();
1093
- });
1094
- p.utils = {
1095
- on: v,
1096
- off: m,
1097
- css: h,
1098
- find: ye,
1099
- is: function(t, e) {
1100
- return !!W(t, e, t, !1);
1101
- },
1102
- extend: ke,
1103
- throttle: we,
1104
- closest: W,
1105
- toggleClass: R,
1106
- clone: De,
1107
- index: Y,
1108
- nextTick: Xt,
1109
- cancelNextTick: te,
1110
- detectDirection: Ce,
1111
- getChild: dt,
1112
- expando: N
1113
- };
1114
- p.get = function(o) {
1115
- return o[N];
1116
- };
1117
- p.mount = function() {
1118
- for (var o = arguments.length, t = new Array(o), e = 0; e < o; e++)
1119
- t[e] = arguments[e];
1120
- t[0].constructor === Array && (t = t[0]), t.forEach(function(n) {
1121
- if (!n.prototype || !n.prototype.constructor)
1122
- throw "Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(n));
1123
- n.utils && (p.utils = z(z({}, p.utils), n.utils)), Ot.mount(n);
1124
- });
1125
- };
1126
- p.create = function(o, t) {
1127
- return new p(o, t);
1128
- };
1129
- p.version = Xe;
1130
- var T = [], Et, ee, ne = !1, Kt, Zt, Gt, yt;
1131
- function on() {
1132
- function o() {
1133
- this.defaults = {
1134
- scroll: !0,
1135
- forceAutoScrollFallback: !1,
1136
- scrollSensitivity: 30,
1137
- scrollSpeed: 10,
1138
- bubbleScroll: !0
1139
- };
1140
- for (var t in this)
1141
- t.charAt(0) === "_" && typeof this[t] == "function" && (this[t] = this[t].bind(this));
1142
- }
1143
- return o.prototype = {
1144
- dragStarted: function(e) {
1145
- var n = e.originalEvent;
1146
- this.sortable.nativeDraggable ? v(document, "dragover", this._handleAutoScroll) : this.options.supportPointer ? v(document, "pointermove", this._handleFallbackAutoScroll) : n.touches ? v(document, "touchmove", this._handleFallbackAutoScroll) : v(document, "mousemove", this._handleFallbackAutoScroll);
1147
- },
1148
- dragOverCompleted: function(e) {
1149
- var n = e.originalEvent;
1150
- !this.options.dragOverBubble && !n.rootEl && this._handleAutoScroll(n);
1151
- },
1152
- drop: function() {
1153
- this.sortable.nativeDraggable ? m(document, "dragover", this._handleAutoScroll) : (m(document, "pointermove", this._handleFallbackAutoScroll), m(document, "touchmove", this._handleFallbackAutoScroll), m(document, "mousemove", this._handleFallbackAutoScroll)), me(), Yt(), Be();
1154
- },
1155
- nulling: function() {
1156
- Gt = ee = Et = ne = yt = Kt = Zt = null, T.length = 0;
1157
- },
1158
- _handleFallbackAutoScroll: function(e) {
1159
- this._handleAutoScroll(e, !0);
1160
- },
1161
- _handleAutoScroll: function(e, n) {
1162
- var i = this, r = (e.touches ? e.touches[0] : e).clientX, a = (e.touches ? e.touches[0] : e).clientY, l = document.elementFromPoint(r, a);
1163
- if (Gt = e, n || this.options.forceAutoScrollFallback || Ct || V || wt) {
1164
- Qt(e, this.options, l, n);
1165
- var s = tt(l, !0);
1166
- ne && (!yt || r !== Kt || a !== Zt) && (yt && me(), yt = setInterval(function() {
1167
- var u = tt(document.elementFromPoint(r, a), !0);
1168
- u !== s && (s = u, Yt()), Qt(e, i.options, u, n);
1169
- }, 10), Kt = r, Zt = a);
1170
- } else {
1171
- if (!this.options.bubbleScroll || tt(l, !0) === L()) {
1172
- Yt();
1173
- return;
1174
- }
1175
- Qt(e, this.options, tt(l, !1), !1);
1176
- }
1177
- }
1178
- }, q(o, {
1179
- pluginName: "scroll",
1180
- initializeByDefault: !0
1181
- });
1182
- }
1183
- function Yt() {
1184
- T.forEach(function(o) {
1185
- clearInterval(o.pid);
1186
- }), T = [];
1187
- }
1188
- function me() {
1189
- clearInterval(yt);
1190
- }
1191
- var Qt = we(function(o, t, e, n) {
1192
- if (t.scroll) {
1193
- var i = (o.touches ? o.touches[0] : o).clientX, r = (o.touches ? o.touches[0] : o).clientY, a = t.scrollSensitivity, l = t.scrollSpeed, s = L(), u = !1, d;
1194
- ee !== e && (ee = e, Yt(), Et = t.scroll, d = t.scrollFn, Et === !0 && (Et = tt(e, !0)));
1195
- var c = 0, b = Et;
1196
- do {
1197
- var w = b, E = C(w), y = E.top, k = E.bottom, j = E.left, A = E.right, B = E.width, M = E.height, et = void 0, G = void 0, nt = w.scrollWidth, ht = w.scrollHeight, F = h(w), pt = w.scrollLeft, K = w.scrollTop;
1198
- w === s ? (et = B < nt && (F.overflowX === "auto" || F.overflowX === "scroll" || F.overflowX === "visible"), G = M < ht && (F.overflowY === "auto" || F.overflowY === "scroll" || F.overflowY === "visible")) : (et = B < nt && (F.overflowX === "auto" || F.overflowX === "scroll"), G = M < ht && (F.overflowY === "auto" || F.overflowY === "scroll"));
1199
- var gt = et && (Math.abs(A - i) <= a && pt + B < nt) - (Math.abs(j - i) <= a && !!pt), $ = G && (Math.abs(k - r) <= a && K + M < ht) - (Math.abs(y - r) <= a && !!K);
1200
- if (!T[c])
1201
- for (var ot = 0; ot <= c; ot++)
1202
- T[ot] || (T[ot] = {});
1203
- (T[c].vx != gt || T[c].vy != $ || T[c].el !== w) && (T[c].el = w, T[c].vx = gt, T[c].vy = $, clearInterval(T[c].pid), (gt != 0 || $ != 0) && (u = !0, T[c].pid = setInterval((function() {
1204
- n && this.layer === 0 && p.active._onTouchMove(Gt);
1205
- var mt = T[this.layer].vy ? T[this.layer].vy * l : 0, Z = T[this.layer].vx ? T[this.layer].vx * l : 0;
1206
- typeof d == "function" && d.call(p.dragged.parentNode[N], Z, mt, o, Gt, T[this.layer].el) !== "continue" || _e(T[this.layer].el, Z, mt);
1207
- }).bind({
1208
- layer: c
1209
- }), 24))), c++;
1210
- } while (t.bubbleScroll && b !== s && (b = tt(b, !1)));
1211
- ne = u;
1212
- }
1213
- }, 30), Pe = function(t) {
1214
- var e = t.originalEvent, n = t.putSortable, i = t.dragEl, r = t.activeSortable, a = t.dispatchSortableEvent, l = t.hideGhostForTarget, s = t.unhideGhostForTarget;
1215
- if (e) {
1216
- var u = n || r;
1217
- l();
1218
- var d = e.changedTouches && e.changedTouches.length ? e.changedTouches[0] : e, c = document.elementFromPoint(d.clientX, d.clientY);
1219
- s(), u && !u.el.contains(c) && (a("spill"), this.onSpill({
1220
- dragEl: i,
1221
- putSortable: n
1222
- }));
1223
- }
1224
- };
1225
- function re() {
1226
- }
1227
- re.prototype = {
1228
- startIndex: null,
1229
- dragStart: function(t) {
1230
- var e = t.oldDraggableIndex;
1231
- this.startIndex = e;
1232
- },
1233
- onSpill: function(t) {
1234
- var e = t.dragEl, n = t.putSortable;
1235
- this.sortable.captureAnimationState(), n && n.captureAnimationState();
1236
- var i = dt(this.sortable.el, this.startIndex, this.options);
1237
- i ? this.sortable.el.insertBefore(e, i) : this.sortable.el.appendChild(e), this.sortable.animateAll(), n && n.animateAll();
1238
- },
1239
- drop: Pe
1240
- };
1241
- q(re, {
1242
- pluginName: "revertOnSpill"
1243
- });
1244
- function ae() {
1245
- }
1246
- ae.prototype = {
1247
- onSpill: function(t) {
1248
- var e = t.dragEl, n = t.putSortable, i = n || this.sortable;
1249
- i.captureAnimationState(), e.parentNode && e.parentNode.removeChild(e), i.animateAll();
1250
- },
1251
- drop: Pe
1252
- };
1253
- q(ae, {
1254
- pluginName: "removeOnSpill"
1255
- });
1256
- p.mount(new on());
1257
- p.mount(ae, re);
1258
- export {
1259
- p as Sortable,
1260
- p as default
1261
- };