@orchidui/dashboard 0.0.1 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +0 -0
- package/dist/Dashboard/Card/OcCard.js +4 -0
- package/dist/Dashboard/Charts/BarChart/OcBarChart.js +5 -0
- package/dist/Dashboard/Charts/BarRaceChart/OcBarRaceChart.js +5 -0
- package/dist/Dashboard/Charts/LineChart/OcLineChart.js +5 -0
- package/dist/Dashboard/Charts/PieChart/OcPieChart.js +5 -0
- package/dist/Dashboard/CodeBlock/customTheme.js +1090 -0
- package/dist/Dashboard/ColorPicker/components/converters.js +100 -0
- package/dist/Dashboard/DataTable/utils/editColumnsUtils.js +29 -0
- package/dist/Dashboard/TextEditor/QuillEditor.js +5 -0
- package/dist/Dashboard/composables/useChart.js +25 -0
- package/dist/OcBarChart-CgKo9rAM.js +116 -0
- package/dist/OcBarRaceChart-Cu4K9WI5.js +140 -0
- package/dist/OcCard-w0EuBfr4.js +216 -0
- package/dist/OcCodeBlock-chTpuRDc.js +63 -0
- package/dist/OcLineChart-dAL6sRiP.js +161 -0
- package/dist/OcPieChart-Kn-CkXip.js +136 -0
- package/dist/QuillEditor-CEkhRyf0.js +7729 -0
- package/dist/index.js +4355 -1
- package/dist/style.css +1 -0
- package/package.json +8 -5
package/dist/index.js
CHANGED
|
@@ -1 +1,4355 @@
|
|
|
1
|
-
|
|
1
|
+
var El = Object.defineProperty;
|
|
2
|
+
var Dl = (e, t, n) => t in e ? El(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
3
|
+
var un = (e, t, n) => Dl(e, typeof t != "symbol" ? t + "" : t, n);
|
|
4
|
+
import { defineComponent as ll, h as _n, resolveComponent as Il, ref as _, onMounted as Tt, openBlock as w, createBlock as ce, unref as M, withCtx as be, createElementVNode as P, createElementBlock as N, createVNode as q, mergeProps as Fn, Fragment as We, renderList as vt, normalizeClass as we, toDisplayString as Et, createCommentVNode as K, computed as Me, createSlots as al, renderSlot as Qe, normalizeProps as Pn, guardReactiveProps as Ln, withKeys as Tn, nextTick as ol, normalizeStyle as lt, createTextVNode as ft, watch as Dt, inject as Ft, reactive as Nn, provide as Vt, withDirectives as Ol, vShow as Tl, defineAsyncComponent as Vl } from "vue";
|
|
5
|
+
import { Dropdown as rn, Icon as Ee, Checkbox as Al, Button as It, Table as Ml, Tabs as _l, Pagination as Fl, PrevNext as Rn, Select as il, Input as xt, TableHeader as Pl, Chip as dn, FormBuilder as Ll, BaseInput as rl, Slider as Gt } from "@orchidui/core";
|
|
6
|
+
import { hslToRgb as Bn, hsl2Hex as jn, rgb2Hex as Hn, rgbaToHex8 as Nl, hexToRgb as cn, rgbToHue as Ut, rgbToHsl as Yn, hex8ToRgba as Rl, parseRgba as Bl, parseRgb as jl } from "./Dashboard/ColorPicker/components/converters.js";
|
|
7
|
+
import { c as Hl, g as Yl, Q as Le, a as Ul } from "./QuillEditor-CEkhRyf0.js";
|
|
8
|
+
import { PieChart as Xl } from "./Dashboard/Charts/PieChart/OcPieChart.js";
|
|
9
|
+
import { LineChart as gi } from "./Dashboard/Charts/LineChart/OcLineChart.js";
|
|
10
|
+
import { BarChart as vi } from "./Dashboard/Charts/BarChart/OcBarChart.js";
|
|
11
|
+
import { BarRaceChart as yi } from "./Dashboard/Charts/BarRaceChart/OcBarRaceChart.js";
|
|
12
|
+
import { _ as xi } from "./OcCard-w0EuBfr4.js";
|
|
13
|
+
import { getFromLocalStorage as sl, formatHeadersFromLocalStorage as ul, formatHeadersToLocalStorage as Ql, setInLocalStorage as Wl } from "./Dashboard/DataTable/utils/editColumnsUtils.js";
|
|
14
|
+
var dl = { exports: {} };
|
|
15
|
+
(function(e, t) {
|
|
16
|
+
(function(n, l) {
|
|
17
|
+
e.exports = l();
|
|
18
|
+
})(Hl, function() {
|
|
19
|
+
var n = 1e3, l = 6e4, a = 36e5, i = "millisecond", r = "second", s = "minute", o = "hour", u = "day", g = "week", p = "month", y = "quarter", m = "year", D = "date", k = "Invalid Date", le = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, G = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, fe = { name: "en", weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), ordinal: function(L) {
|
|
20
|
+
var E = ["th", "st", "nd", "rd"], x = L % 100;
|
|
21
|
+
return "[" + L + (E[(x - 20) % 10] || E[x] || E[0]) + "]";
|
|
22
|
+
} }, pe = function(L, E, x) {
|
|
23
|
+
var T = String(L);
|
|
24
|
+
return !T || T.length >= E ? L : "" + Array(E + 1 - T.length).join(x) + L;
|
|
25
|
+
}, he = { s: pe, z: function(L) {
|
|
26
|
+
var E = -L.utcOffset(), x = Math.abs(E), T = Math.floor(x / 60), C = x % 60;
|
|
27
|
+
return (E <= 0 ? "+" : "-") + pe(T, 2, "0") + ":" + pe(C, 2, "0");
|
|
28
|
+
}, m: function L(E, x) {
|
|
29
|
+
if (E.date() < x.date()) return -L(x, E);
|
|
30
|
+
var T = 12 * (x.year() - E.year()) + (x.month() - E.month()), C = E.clone().add(T, p), H = x - C < 0, j = E.clone().add(T + (H ? -1 : 1), p);
|
|
31
|
+
return +(-(T + (x - C) / (H ? C - j : j - C)) || 0);
|
|
32
|
+
}, a: function(L) {
|
|
33
|
+
return L < 0 ? Math.ceil(L) || 0 : Math.floor(L);
|
|
34
|
+
}, p: function(L) {
|
|
35
|
+
return { M: p, y: m, w: g, d: u, D, h: o, m: s, s: r, ms: i, Q: y }[L] || String(L || "").toLowerCase().replace(/s$/, "");
|
|
36
|
+
}, u: function(L) {
|
|
37
|
+
return L === void 0;
|
|
38
|
+
} }, B = "en", ae = {};
|
|
39
|
+
ae[B] = fe;
|
|
40
|
+
var De = "$isDayjsObject", xe = function(L) {
|
|
41
|
+
return L instanceof ye || !(!L || !L[De]);
|
|
42
|
+
}, F = function L(E, x, T) {
|
|
43
|
+
var C;
|
|
44
|
+
if (!E) return B;
|
|
45
|
+
if (typeof E == "string") {
|
|
46
|
+
var H = E.toLowerCase();
|
|
47
|
+
ae[H] && (C = H), x && (ae[H] = x, C = H);
|
|
48
|
+
var j = E.split("-");
|
|
49
|
+
if (!C && j.length > 1) return L(j[0]);
|
|
50
|
+
} else {
|
|
51
|
+
var re = E.name;
|
|
52
|
+
ae[re] = E, C = re;
|
|
53
|
+
}
|
|
54
|
+
return !T && C && (B = C), C || !T && B;
|
|
55
|
+
}, V = function(L, E) {
|
|
56
|
+
if (xe(L)) return L.clone();
|
|
57
|
+
var x = typeof E == "object" ? E : {};
|
|
58
|
+
return x.date = L, x.args = arguments, new ye(x);
|
|
59
|
+
}, Y = he;
|
|
60
|
+
Y.l = F, Y.i = xe, Y.w = function(L, E) {
|
|
61
|
+
return V(L, { locale: E.$L, utc: E.$u, x: E.$x, $offset: E.$offset });
|
|
62
|
+
};
|
|
63
|
+
var ye = function() {
|
|
64
|
+
function L(x) {
|
|
65
|
+
this.$L = F(x.locale, null, !0), this.parse(x), this.$x = this.$x || x.x || {}, this[De] = !0;
|
|
66
|
+
}
|
|
67
|
+
var E = L.prototype;
|
|
68
|
+
return E.parse = function(x) {
|
|
69
|
+
this.$d = function(T) {
|
|
70
|
+
var C = T.date, H = T.utc;
|
|
71
|
+
if (C === null) return /* @__PURE__ */ new Date(NaN);
|
|
72
|
+
if (Y.u(C)) return /* @__PURE__ */ new Date();
|
|
73
|
+
if (C instanceof Date) return new Date(C);
|
|
74
|
+
if (typeof C == "string" && !/Z$/i.test(C)) {
|
|
75
|
+
var j = C.match(le);
|
|
76
|
+
if (j) {
|
|
77
|
+
var re = j[2] - 1 || 0, oe = (j[7] || "0").substring(0, 3);
|
|
78
|
+
return H ? new Date(Date.UTC(j[1], re, j[3] || 1, j[4] || 0, j[5] || 0, j[6] || 0, oe)) : new Date(j[1], re, j[3] || 1, j[4] || 0, j[5] || 0, j[6] || 0, oe);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
return new Date(C);
|
|
82
|
+
}(x), this.init();
|
|
83
|
+
}, E.init = function() {
|
|
84
|
+
var x = this.$d;
|
|
85
|
+
this.$y = x.getFullYear(), this.$M = x.getMonth(), this.$D = x.getDate(), this.$W = x.getDay(), this.$H = x.getHours(), this.$m = x.getMinutes(), this.$s = x.getSeconds(), this.$ms = x.getMilliseconds();
|
|
86
|
+
}, E.$utils = function() {
|
|
87
|
+
return Y;
|
|
88
|
+
}, E.isValid = function() {
|
|
89
|
+
return this.$d.toString() !== k;
|
|
90
|
+
}, E.isSame = function(x, T) {
|
|
91
|
+
var C = V(x);
|
|
92
|
+
return this.startOf(T) <= C && C <= this.endOf(T);
|
|
93
|
+
}, E.isAfter = function(x, T) {
|
|
94
|
+
return V(x) < this.startOf(T);
|
|
95
|
+
}, E.isBefore = function(x, T) {
|
|
96
|
+
return this.endOf(T) < V(x);
|
|
97
|
+
}, E.$g = function(x, T, C) {
|
|
98
|
+
return Y.u(x) ? this[T] : this.set(C, x);
|
|
99
|
+
}, E.unix = function() {
|
|
100
|
+
return Math.floor(this.valueOf() / 1e3);
|
|
101
|
+
}, E.valueOf = function() {
|
|
102
|
+
return this.$d.getTime();
|
|
103
|
+
}, E.startOf = function(x, T) {
|
|
104
|
+
var C = this, H = !!Y.u(T) || T, j = Y.p(x), re = function(v, z) {
|
|
105
|
+
var ie = Y.w(C.$u ? Date.UTC(C.$y, z, v) : new Date(C.$y, z, v), C);
|
|
106
|
+
return H ? ie : ie.endOf(u);
|
|
107
|
+
}, oe = function(v, z) {
|
|
108
|
+
return Y.w(C.toDate()[v].apply(C.toDate("s"), (H ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(z)), C);
|
|
109
|
+
}, Se = this.$W, $e = this.$M, se = this.$D, Ce = "set" + (this.$u ? "UTC" : "");
|
|
110
|
+
switch (j) {
|
|
111
|
+
case m:
|
|
112
|
+
return H ? re(1, 0) : re(31, 11);
|
|
113
|
+
case p:
|
|
114
|
+
return H ? re(1, $e) : re(0, $e + 1);
|
|
115
|
+
case g:
|
|
116
|
+
var Re = this.$locale().weekStart || 0, b = (Se < Re ? Se + 7 : Se) - Re;
|
|
117
|
+
return re(H ? se - b : se + (6 - b), $e);
|
|
118
|
+
case u:
|
|
119
|
+
case D:
|
|
120
|
+
return oe(Ce + "Hours", 0);
|
|
121
|
+
case o:
|
|
122
|
+
return oe(Ce + "Minutes", 1);
|
|
123
|
+
case s:
|
|
124
|
+
return oe(Ce + "Seconds", 2);
|
|
125
|
+
case r:
|
|
126
|
+
return oe(Ce + "Milliseconds", 3);
|
|
127
|
+
default:
|
|
128
|
+
return this.clone();
|
|
129
|
+
}
|
|
130
|
+
}, E.endOf = function(x) {
|
|
131
|
+
return this.startOf(x, !1);
|
|
132
|
+
}, E.$set = function(x, T) {
|
|
133
|
+
var C, H = Y.p(x), j = "set" + (this.$u ? "UTC" : ""), re = (C = {}, C[u] = j + "Date", C[D] = j + "Date", C[p] = j + "Month", C[m] = j + "FullYear", C[o] = j + "Hours", C[s] = j + "Minutes", C[r] = j + "Seconds", C[i] = j + "Milliseconds", C)[H], oe = H === u ? this.$D + (T - this.$W) : T;
|
|
134
|
+
if (H === p || H === m) {
|
|
135
|
+
var Se = this.clone().set(D, 1);
|
|
136
|
+
Se.$d[re](oe), Se.init(), this.$d = Se.set(D, Math.min(this.$D, Se.daysInMonth())).$d;
|
|
137
|
+
} else re && this.$d[re](oe);
|
|
138
|
+
return this.init(), this;
|
|
139
|
+
}, E.set = function(x, T) {
|
|
140
|
+
return this.clone().$set(x, T);
|
|
141
|
+
}, E.get = function(x) {
|
|
142
|
+
return this[Y.p(x)]();
|
|
143
|
+
}, E.add = function(x, T) {
|
|
144
|
+
var C, H = this;
|
|
145
|
+
x = Number(x);
|
|
146
|
+
var j = Y.p(T), re = function($e) {
|
|
147
|
+
var se = V(H);
|
|
148
|
+
return Y.w(se.date(se.date() + Math.round($e * x)), H);
|
|
149
|
+
};
|
|
150
|
+
if (j === p) return this.set(p, this.$M + x);
|
|
151
|
+
if (j === m) return this.set(m, this.$y + x);
|
|
152
|
+
if (j === u) return re(1);
|
|
153
|
+
if (j === g) return re(7);
|
|
154
|
+
var oe = (C = {}, C[s] = l, C[o] = a, C[r] = n, C)[j] || 1, Se = this.$d.getTime() + x * oe;
|
|
155
|
+
return Y.w(Se, this);
|
|
156
|
+
}, E.subtract = function(x, T) {
|
|
157
|
+
return this.add(-1 * x, T);
|
|
158
|
+
}, E.format = function(x) {
|
|
159
|
+
var T = this, C = this.$locale();
|
|
160
|
+
if (!this.isValid()) return C.invalidDate || k;
|
|
161
|
+
var H = x || "YYYY-MM-DDTHH:mm:ssZ", j = Y.z(this), re = this.$H, oe = this.$m, Se = this.$M, $e = C.weekdays, se = C.months, Ce = C.meridiem, Re = function(z, ie, ue, ge) {
|
|
162
|
+
return z && (z[ie] || z(T, H)) || ue[ie].slice(0, ge);
|
|
163
|
+
}, b = function(z) {
|
|
164
|
+
return Y.s(re % 12 || 12, z, "0");
|
|
165
|
+
}, v = Ce || function(z, ie, ue) {
|
|
166
|
+
var ge = z < 12 ? "AM" : "PM";
|
|
167
|
+
return ue ? ge.toLowerCase() : ge;
|
|
168
|
+
};
|
|
169
|
+
return H.replace(G, function(z, ie) {
|
|
170
|
+
return ie || function(ue) {
|
|
171
|
+
switch (ue) {
|
|
172
|
+
case "YY":
|
|
173
|
+
return String(T.$y).slice(-2);
|
|
174
|
+
case "YYYY":
|
|
175
|
+
return Y.s(T.$y, 4, "0");
|
|
176
|
+
case "M":
|
|
177
|
+
return Se + 1;
|
|
178
|
+
case "MM":
|
|
179
|
+
return Y.s(Se + 1, 2, "0");
|
|
180
|
+
case "MMM":
|
|
181
|
+
return Re(C.monthsShort, Se, se, 3);
|
|
182
|
+
case "MMMM":
|
|
183
|
+
return Re(se, Se);
|
|
184
|
+
case "D":
|
|
185
|
+
return T.$D;
|
|
186
|
+
case "DD":
|
|
187
|
+
return Y.s(T.$D, 2, "0");
|
|
188
|
+
case "d":
|
|
189
|
+
return String(T.$W);
|
|
190
|
+
case "dd":
|
|
191
|
+
return Re(C.weekdaysMin, T.$W, $e, 2);
|
|
192
|
+
case "ddd":
|
|
193
|
+
return Re(C.weekdaysShort, T.$W, $e, 3);
|
|
194
|
+
case "dddd":
|
|
195
|
+
return $e[T.$W];
|
|
196
|
+
case "H":
|
|
197
|
+
return String(re);
|
|
198
|
+
case "HH":
|
|
199
|
+
return Y.s(re, 2, "0");
|
|
200
|
+
case "h":
|
|
201
|
+
return b(1);
|
|
202
|
+
case "hh":
|
|
203
|
+
return b(2);
|
|
204
|
+
case "a":
|
|
205
|
+
return v(re, oe, !0);
|
|
206
|
+
case "A":
|
|
207
|
+
return v(re, oe, !1);
|
|
208
|
+
case "m":
|
|
209
|
+
return String(oe);
|
|
210
|
+
case "mm":
|
|
211
|
+
return Y.s(oe, 2, "0");
|
|
212
|
+
case "s":
|
|
213
|
+
return String(T.$s);
|
|
214
|
+
case "ss":
|
|
215
|
+
return Y.s(T.$s, 2, "0");
|
|
216
|
+
case "SSS":
|
|
217
|
+
return Y.s(T.$ms, 3, "0");
|
|
218
|
+
case "Z":
|
|
219
|
+
return j;
|
|
220
|
+
}
|
|
221
|
+
return null;
|
|
222
|
+
}(z) || j.replace(":", "");
|
|
223
|
+
});
|
|
224
|
+
}, E.utcOffset = function() {
|
|
225
|
+
return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
|
|
226
|
+
}, E.diff = function(x, T, C) {
|
|
227
|
+
var H, j = this, re = Y.p(T), oe = V(x), Se = (oe.utcOffset() - this.utcOffset()) * l, $e = this - oe, se = function() {
|
|
228
|
+
return Y.m(j, oe);
|
|
229
|
+
};
|
|
230
|
+
switch (re) {
|
|
231
|
+
case m:
|
|
232
|
+
H = se() / 12;
|
|
233
|
+
break;
|
|
234
|
+
case p:
|
|
235
|
+
H = se();
|
|
236
|
+
break;
|
|
237
|
+
case y:
|
|
238
|
+
H = se() / 3;
|
|
239
|
+
break;
|
|
240
|
+
case g:
|
|
241
|
+
H = ($e - Se) / 6048e5;
|
|
242
|
+
break;
|
|
243
|
+
case u:
|
|
244
|
+
H = ($e - Se) / 864e5;
|
|
245
|
+
break;
|
|
246
|
+
case o:
|
|
247
|
+
H = $e / a;
|
|
248
|
+
break;
|
|
249
|
+
case s:
|
|
250
|
+
H = $e / l;
|
|
251
|
+
break;
|
|
252
|
+
case r:
|
|
253
|
+
H = $e / n;
|
|
254
|
+
break;
|
|
255
|
+
default:
|
|
256
|
+
H = $e;
|
|
257
|
+
}
|
|
258
|
+
return C ? H : Y.a(H);
|
|
259
|
+
}, E.daysInMonth = function() {
|
|
260
|
+
return this.endOf(p).$D;
|
|
261
|
+
}, E.$locale = function() {
|
|
262
|
+
return ae[this.$L];
|
|
263
|
+
}, E.locale = function(x, T) {
|
|
264
|
+
if (!x) return this.$L;
|
|
265
|
+
var C = this.clone(), H = F(x, T, !0);
|
|
266
|
+
return H && (C.$L = H), C;
|
|
267
|
+
}, E.clone = function() {
|
|
268
|
+
return Y.w(this.$d, this);
|
|
269
|
+
}, E.toDate = function() {
|
|
270
|
+
return new Date(this.valueOf());
|
|
271
|
+
}, E.toJSON = function() {
|
|
272
|
+
return this.isValid() ? this.toISOString() : null;
|
|
273
|
+
}, E.toISOString = function() {
|
|
274
|
+
return this.$d.toISOString();
|
|
275
|
+
}, E.toString = function() {
|
|
276
|
+
return this.$d.toUTCString();
|
|
277
|
+
}, L;
|
|
278
|
+
}(), Ve = ye.prototype;
|
|
279
|
+
return V.prototype = Ve, [["$ms", i], ["$s", r], ["$m", s], ["$H", o], ["$W", u], ["$M", p], ["$y", m], ["$D", D]].forEach(function(L) {
|
|
280
|
+
Ve[L[1]] = function(E) {
|
|
281
|
+
return this.$g(E, L[0], L[1]);
|
|
282
|
+
};
|
|
283
|
+
}), V.extend = function(L, E) {
|
|
284
|
+
return L.$i || (L(E, ye, V), L.$i = !0), V;
|
|
285
|
+
}, V.locale = F, V.isDayjs = xe, V.unix = function(L) {
|
|
286
|
+
return V(1e3 * L);
|
|
287
|
+
}, V.en = ae[B], V.Ls = ae, V.p = {}, V;
|
|
288
|
+
});
|
|
289
|
+
})(dl);
|
|
290
|
+
var ql = dl.exports;
|
|
291
|
+
const fn = /* @__PURE__ */ Yl(ql);
|
|
292
|
+
/*!
|
|
293
|
+
* vue-draggable-next v2.2.0
|
|
294
|
+
* (c) 2023 Anish George
|
|
295
|
+
* @license MIT
|
|
296
|
+
*/
|
|
297
|
+
/**!
|
|
298
|
+
* Sortable 1.14.0
|
|
299
|
+
* @author RubaXa <trash@rubaxa.org>
|
|
300
|
+
* @author owenm <owen23355@gmail.com>
|
|
301
|
+
* @license MIT
|
|
302
|
+
*/
|
|
303
|
+
function Un(e, t) {
|
|
304
|
+
var n = Object.keys(e);
|
|
305
|
+
if (Object.getOwnPropertySymbols) {
|
|
306
|
+
var l = Object.getOwnPropertySymbols(e);
|
|
307
|
+
t && (l = l.filter(function(a) {
|
|
308
|
+
return Object.getOwnPropertyDescriptor(e, a).enumerable;
|
|
309
|
+
})), n.push.apply(n, l);
|
|
310
|
+
}
|
|
311
|
+
return n;
|
|
312
|
+
}
|
|
313
|
+
function rt(e) {
|
|
314
|
+
for (var t = 1; t < arguments.length; t++) {
|
|
315
|
+
var n = arguments[t] != null ? arguments[t] : {};
|
|
316
|
+
t % 2 ? Un(Object(n), !0).forEach(function(l) {
|
|
317
|
+
Gl(e, l, n[l]);
|
|
318
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : Un(Object(n)).forEach(function(l) {
|
|
319
|
+
Object.defineProperty(e, l, Object.getOwnPropertyDescriptor(n, l));
|
|
320
|
+
});
|
|
321
|
+
}
|
|
322
|
+
return e;
|
|
323
|
+
}
|
|
324
|
+
function zt(e) {
|
|
325
|
+
"@babel/helpers - typeof";
|
|
326
|
+
return typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? zt = function(t) {
|
|
327
|
+
return typeof t;
|
|
328
|
+
} : zt = function(t) {
|
|
329
|
+
return t && typeof Symbol == "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
|
|
330
|
+
}, zt(e);
|
|
331
|
+
}
|
|
332
|
+
function Gl(e, t, n) {
|
|
333
|
+
return t in e ? Object.defineProperty(e, t, {
|
|
334
|
+
value: n,
|
|
335
|
+
enumerable: !0,
|
|
336
|
+
configurable: !0,
|
|
337
|
+
writable: !0
|
|
338
|
+
}) : e[t] = n, e;
|
|
339
|
+
}
|
|
340
|
+
function dt() {
|
|
341
|
+
return dt = Object.assign || function(e) {
|
|
342
|
+
for (var t = 1; t < arguments.length; t++) {
|
|
343
|
+
var n = arguments[t];
|
|
344
|
+
for (var l in n)
|
|
345
|
+
Object.prototype.hasOwnProperty.call(n, l) && (e[l] = n[l]);
|
|
346
|
+
}
|
|
347
|
+
return e;
|
|
348
|
+
}, dt.apply(this, arguments);
|
|
349
|
+
}
|
|
350
|
+
function zl(e, t) {
|
|
351
|
+
if (e == null) return {};
|
|
352
|
+
var n = {}, l = Object.keys(e), a, i;
|
|
353
|
+
for (i = 0; i < l.length; i++)
|
|
354
|
+
a = l[i], !(t.indexOf(a) >= 0) && (n[a] = e[a]);
|
|
355
|
+
return n;
|
|
356
|
+
}
|
|
357
|
+
function Kl(e, t) {
|
|
358
|
+
if (e == null) return {};
|
|
359
|
+
var n = zl(e, t), l, a;
|
|
360
|
+
if (Object.getOwnPropertySymbols) {
|
|
361
|
+
var i = Object.getOwnPropertySymbols(e);
|
|
362
|
+
for (a = 0; a < i.length; a++)
|
|
363
|
+
l = i[a], !(t.indexOf(l) >= 0) && Object.prototype.propertyIsEnumerable.call(e, l) && (n[l] = e[l]);
|
|
364
|
+
}
|
|
365
|
+
return n;
|
|
366
|
+
}
|
|
367
|
+
var Zl = "1.14.0";
|
|
368
|
+
function ut(e) {
|
|
369
|
+
if (typeof window < "u" && window.navigator)
|
|
370
|
+
return !!/* @__PURE__ */ navigator.userAgent.match(e);
|
|
371
|
+
}
|
|
372
|
+
var ct = ut(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i), jt = ut(/Edge/i), Xn = ut(/firefox/i), Pt = ut(/safari/i) && !ut(/chrome/i) && !ut(/android/i), cl = ut(/iP(ad|od|hone)/i), Jl = ut(/chrome/i) && ut(/android/i), fl = {
|
|
373
|
+
capture: !1,
|
|
374
|
+
passive: !1
|
|
375
|
+
};
|
|
376
|
+
function ve(e, t, n) {
|
|
377
|
+
e.addEventListener(t, n, !ct && fl);
|
|
378
|
+
}
|
|
379
|
+
function de(e, t, n) {
|
|
380
|
+
e.removeEventListener(t, n, !ct && fl);
|
|
381
|
+
}
|
|
382
|
+
function tn(e, t) {
|
|
383
|
+
if (t) {
|
|
384
|
+
if (t[0] === ">" && (t = t.substring(1)), e)
|
|
385
|
+
try {
|
|
386
|
+
if (e.matches)
|
|
387
|
+
return e.matches(t);
|
|
388
|
+
if (e.msMatchesSelector)
|
|
389
|
+
return e.msMatchesSelector(t);
|
|
390
|
+
if (e.webkitMatchesSelector)
|
|
391
|
+
return e.webkitMatchesSelector(t);
|
|
392
|
+
} catch {
|
|
393
|
+
return !1;
|
|
394
|
+
}
|
|
395
|
+
return !1;
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
function ea(e) {
|
|
399
|
+
return e.host && e !== document && e.host.nodeType ? e.host : e.parentNode;
|
|
400
|
+
}
|
|
401
|
+
function ot(e, t, n, l) {
|
|
402
|
+
if (e) {
|
|
403
|
+
n = n || document;
|
|
404
|
+
do {
|
|
405
|
+
if (t != null && (t[0] === ">" ? e.parentNode === n && tn(e, t) : tn(e, t)) || l && e === n)
|
|
406
|
+
return e;
|
|
407
|
+
if (e === n) break;
|
|
408
|
+
} while (e = ea(e));
|
|
409
|
+
}
|
|
410
|
+
return null;
|
|
411
|
+
}
|
|
412
|
+
var Qn = /\s+/g;
|
|
413
|
+
function qe(e, t, n) {
|
|
414
|
+
if (e && t)
|
|
415
|
+
if (e.classList)
|
|
416
|
+
e.classList[n ? "add" : "remove"](t);
|
|
417
|
+
else {
|
|
418
|
+
var l = (" " + e.className + " ").replace(Qn, " ").replace(" " + t + " ", " ");
|
|
419
|
+
e.className = (l + (n ? " " + t : "")).replace(Qn, " ");
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
function X(e, t, n) {
|
|
423
|
+
var l = e && e.style;
|
|
424
|
+
if (l) {
|
|
425
|
+
if (n === void 0)
|
|
426
|
+
return document.defaultView && document.defaultView.getComputedStyle ? n = document.defaultView.getComputedStyle(e, "") : e.currentStyle && (n = e.currentStyle), t === void 0 ? n : n[t];
|
|
427
|
+
!(t in l) && t.indexOf("webkit") === -1 && (t = "-webkit-" + t), l[t] = n + (typeof n == "string" ? "" : "px");
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
function Ct(e, t) {
|
|
431
|
+
var n = "";
|
|
432
|
+
if (typeof e == "string")
|
|
433
|
+
n = e;
|
|
434
|
+
else
|
|
435
|
+
do {
|
|
436
|
+
var l = X(e, "transform");
|
|
437
|
+
l && l !== "none" && (n = l + " " + n);
|
|
438
|
+
} while (!t && (e = e.parentNode));
|
|
439
|
+
var a = window.DOMMatrix || window.WebKitCSSMatrix || window.CSSMatrix || window.MSCSSMatrix;
|
|
440
|
+
return a && new a(n);
|
|
441
|
+
}
|
|
442
|
+
function pl(e, t, n) {
|
|
443
|
+
if (e) {
|
|
444
|
+
var l = e.getElementsByTagName(t), a = 0, i = l.length;
|
|
445
|
+
if (n)
|
|
446
|
+
for (; a < i; a++)
|
|
447
|
+
n(l[a], a);
|
|
448
|
+
return l;
|
|
449
|
+
}
|
|
450
|
+
return [];
|
|
451
|
+
}
|
|
452
|
+
function it() {
|
|
453
|
+
var e = document.scrollingElement;
|
|
454
|
+
return e || document.documentElement;
|
|
455
|
+
}
|
|
456
|
+
function _e(e, t, n, l, a) {
|
|
457
|
+
if (!(!e.getBoundingClientRect && e !== window)) {
|
|
458
|
+
var i, r, s, o, u, g, p;
|
|
459
|
+
if (e !== window && e.parentNode && e !== it() ? (i = e.getBoundingClientRect(), r = i.top, s = i.left, o = i.bottom, u = i.right, g = i.height, p = i.width) : (r = 0, s = 0, o = window.innerHeight, u = window.innerWidth, g = window.innerHeight, p = window.innerWidth), (t || n) && e !== window && (a = a || e.parentNode, !ct))
|
|
460
|
+
do
|
|
461
|
+
if (a && a.getBoundingClientRect && (X(a, "transform") !== "none" || n && X(a, "position") !== "static")) {
|
|
462
|
+
var y = a.getBoundingClientRect();
|
|
463
|
+
r -= y.top + parseInt(X(a, "border-top-width")), s -= y.left + parseInt(X(a, "border-left-width")), o = r + i.height, u = s + i.width;
|
|
464
|
+
break;
|
|
465
|
+
}
|
|
466
|
+
while (a = a.parentNode);
|
|
467
|
+
if (l && e !== window) {
|
|
468
|
+
var m = Ct(a || e), D = m && m.a, k = m && m.d;
|
|
469
|
+
m && (r /= k, s /= D, p /= D, g /= k, o = r + g, u = s + p);
|
|
470
|
+
}
|
|
471
|
+
return {
|
|
472
|
+
top: r,
|
|
473
|
+
left: s,
|
|
474
|
+
bottom: o,
|
|
475
|
+
right: u,
|
|
476
|
+
width: p,
|
|
477
|
+
height: g
|
|
478
|
+
};
|
|
479
|
+
}
|
|
480
|
+
}
|
|
481
|
+
function Wn(e, t, n) {
|
|
482
|
+
for (var l = mt(e, !0), a = _e(e)[t]; l; ) {
|
|
483
|
+
var i = _e(l)[n], r = void 0;
|
|
484
|
+
if (r = a >= i, !r) return l;
|
|
485
|
+
if (l === it()) break;
|
|
486
|
+
l = mt(l, !1);
|
|
487
|
+
}
|
|
488
|
+
return !1;
|
|
489
|
+
}
|
|
490
|
+
function Ot(e, t, n, l) {
|
|
491
|
+
for (var a = 0, i = 0, r = e.children; i < r.length; ) {
|
|
492
|
+
if (r[i].style.display !== "none" && r[i] !== Q.ghost && (l || r[i] !== Q.dragged) && ot(r[i], n.draggable, e, !1)) {
|
|
493
|
+
if (a === t)
|
|
494
|
+
return r[i];
|
|
495
|
+
a++;
|
|
496
|
+
}
|
|
497
|
+
i++;
|
|
498
|
+
}
|
|
499
|
+
return null;
|
|
500
|
+
}
|
|
501
|
+
function Vn(e, t) {
|
|
502
|
+
for (var n = e.lastElementChild; n && (n === Q.ghost || X(n, "display") === "none" || t && !tn(n, t)); )
|
|
503
|
+
n = n.previousElementSibling;
|
|
504
|
+
return n || null;
|
|
505
|
+
}
|
|
506
|
+
function Je(e, t) {
|
|
507
|
+
var n = 0;
|
|
508
|
+
if (!e || !e.parentNode)
|
|
509
|
+
return -1;
|
|
510
|
+
for (; e = e.previousElementSibling; )
|
|
511
|
+
e.nodeName.toUpperCase() !== "TEMPLATE" && e !== Q.clone && (!t || tn(e, t)) && n++;
|
|
512
|
+
return n;
|
|
513
|
+
}
|
|
514
|
+
function qn(e) {
|
|
515
|
+
var t = 0, n = 0, l = it();
|
|
516
|
+
if (e)
|
|
517
|
+
do {
|
|
518
|
+
var a = Ct(e), i = a.a, r = a.d;
|
|
519
|
+
t += e.scrollLeft * i, n += e.scrollTop * r;
|
|
520
|
+
} while (e !== l && (e = e.parentNode));
|
|
521
|
+
return [t, n];
|
|
522
|
+
}
|
|
523
|
+
function ta(e, t) {
|
|
524
|
+
for (var n in e)
|
|
525
|
+
if (e.hasOwnProperty(n)) {
|
|
526
|
+
for (var l in t)
|
|
527
|
+
if (t.hasOwnProperty(l) && t[l] === e[n][l]) return Number(n);
|
|
528
|
+
}
|
|
529
|
+
return -1;
|
|
530
|
+
}
|
|
531
|
+
function mt(e, t) {
|
|
532
|
+
if (!e || !e.getBoundingClientRect) return it();
|
|
533
|
+
var n = e, l = !1;
|
|
534
|
+
do
|
|
535
|
+
if (n.clientWidth < n.scrollWidth || n.clientHeight < n.scrollHeight) {
|
|
536
|
+
var a = X(n);
|
|
537
|
+
if (n.clientWidth < n.scrollWidth && (a.overflowX == "auto" || a.overflowX == "scroll") || n.clientHeight < n.scrollHeight && (a.overflowY == "auto" || a.overflowY == "scroll")) {
|
|
538
|
+
if (!n.getBoundingClientRect || n === document.body) return it();
|
|
539
|
+
if (l || t) return n;
|
|
540
|
+
l = !0;
|
|
541
|
+
}
|
|
542
|
+
}
|
|
543
|
+
while (n = n.parentNode);
|
|
544
|
+
return it();
|
|
545
|
+
}
|
|
546
|
+
function na(e, t) {
|
|
547
|
+
if (e && t)
|
|
548
|
+
for (var n in t)
|
|
549
|
+
t.hasOwnProperty(n) && (e[n] = t[n]);
|
|
550
|
+
return e;
|
|
551
|
+
}
|
|
552
|
+
function pn(e, t) {
|
|
553
|
+
return Math.round(e.top) === Math.round(t.top) && Math.round(e.left) === Math.round(t.left) && Math.round(e.height) === Math.round(t.height) && Math.round(e.width) === Math.round(t.width);
|
|
554
|
+
}
|
|
555
|
+
var Lt;
|
|
556
|
+
function gl(e, t) {
|
|
557
|
+
return function() {
|
|
558
|
+
if (!Lt) {
|
|
559
|
+
var n = arguments, l = this;
|
|
560
|
+
n.length === 1 ? e.call(l, n[0]) : e.apply(l, n), Lt = setTimeout(function() {
|
|
561
|
+
Lt = void 0;
|
|
562
|
+
}, t);
|
|
563
|
+
}
|
|
564
|
+
};
|
|
565
|
+
}
|
|
566
|
+
function la() {
|
|
567
|
+
clearTimeout(Lt), Lt = void 0;
|
|
568
|
+
}
|
|
569
|
+
function ml(e, t, n) {
|
|
570
|
+
e.scrollLeft += t, e.scrollTop += n;
|
|
571
|
+
}
|
|
572
|
+
function vl(e) {
|
|
573
|
+
var t = window.Polymer, n = window.jQuery || window.Zepto;
|
|
574
|
+
return t && t.dom ? t.dom(e).cloneNode(!0) : n ? n(e).clone(!0)[0] : e.cloneNode(!0);
|
|
575
|
+
}
|
|
576
|
+
var ze = "Sortable" + (/* @__PURE__ */ new Date()).getTime();
|
|
577
|
+
function aa() {
|
|
578
|
+
var e = [], t;
|
|
579
|
+
return {
|
|
580
|
+
captureAnimationState: function() {
|
|
581
|
+
if (e = [], !!this.options.animation) {
|
|
582
|
+
var l = [].slice.call(this.el.children);
|
|
583
|
+
l.forEach(function(a) {
|
|
584
|
+
if (!(X(a, "display") === "none" || a === Q.ghost)) {
|
|
585
|
+
e.push({
|
|
586
|
+
target: a,
|
|
587
|
+
rect: _e(a)
|
|
588
|
+
});
|
|
589
|
+
var i = rt({}, e[e.length - 1].rect);
|
|
590
|
+
if (a.thisAnimationDuration) {
|
|
591
|
+
var r = Ct(a, !0);
|
|
592
|
+
r && (i.top -= r.f, i.left -= r.e);
|
|
593
|
+
}
|
|
594
|
+
a.fromRect = i;
|
|
595
|
+
}
|
|
596
|
+
});
|
|
597
|
+
}
|
|
598
|
+
},
|
|
599
|
+
addAnimationState: function(l) {
|
|
600
|
+
e.push(l);
|
|
601
|
+
},
|
|
602
|
+
removeAnimationState: function(l) {
|
|
603
|
+
e.splice(ta(e, {
|
|
604
|
+
target: l
|
|
605
|
+
}), 1);
|
|
606
|
+
},
|
|
607
|
+
animateAll: function(l) {
|
|
608
|
+
var a = this;
|
|
609
|
+
if (!this.options.animation) {
|
|
610
|
+
clearTimeout(t), typeof l == "function" && l();
|
|
611
|
+
return;
|
|
612
|
+
}
|
|
613
|
+
var i = !1, r = 0;
|
|
614
|
+
e.forEach(function(s) {
|
|
615
|
+
var o = 0, u = s.target, g = u.fromRect, p = _e(u), y = u.prevFromRect, m = u.prevToRect, D = s.rect, k = Ct(u, !0);
|
|
616
|
+
k && (p.top -= k.f, p.left -= k.e), u.toRect = p, u.thisAnimationDuration && pn(y, p) && !pn(g, p) && // Make sure animatingRect is on line between toRect & fromRect
|
|
617
|
+
(D.top - p.top) / (D.left - p.left) === (g.top - p.top) / (g.left - p.left) && (o = ia(D, y, m, a.options)), pn(p, g) || (u.prevFromRect = g, u.prevToRect = p, o || (o = a.options.animation), a.animate(u, D, p, o)), o && (i = !0, r = Math.max(r, o), clearTimeout(u.animationResetTimer), u.animationResetTimer = setTimeout(function() {
|
|
618
|
+
u.animationTime = 0, u.prevFromRect = null, u.fromRect = null, u.prevToRect = null, u.thisAnimationDuration = null;
|
|
619
|
+
}, o), u.thisAnimationDuration = o);
|
|
620
|
+
}), clearTimeout(t), i ? t = setTimeout(function() {
|
|
621
|
+
typeof l == "function" && l();
|
|
622
|
+
}, r) : typeof l == "function" && l(), e = [];
|
|
623
|
+
},
|
|
624
|
+
animate: function(l, a, i, r) {
|
|
625
|
+
if (r) {
|
|
626
|
+
X(l, "transition", ""), X(l, "transform", "");
|
|
627
|
+
var s = Ct(this.el), o = s && s.a, u = s && s.d, g = (a.left - i.left) / (o || 1), p = (a.top - i.top) / (u || 1);
|
|
628
|
+
l.animatingX = !!g, l.animatingY = !!p, X(l, "transform", "translate3d(" + g + "px," + p + "px,0)"), this.forRepaintDummy = oa(l), X(l, "transition", "transform " + r + "ms" + (this.options.easing ? " " + this.options.easing : "")), X(l, "transform", "translate3d(0,0,0)"), typeof l.animated == "number" && clearTimeout(l.animated), l.animated = setTimeout(function() {
|
|
629
|
+
X(l, "transition", ""), X(l, "transform", ""), l.animated = !1, l.animatingX = !1, l.animatingY = !1;
|
|
630
|
+
}, r);
|
|
631
|
+
}
|
|
632
|
+
}
|
|
633
|
+
};
|
|
634
|
+
}
|
|
635
|
+
function oa(e) {
|
|
636
|
+
return e.offsetWidth;
|
|
637
|
+
}
|
|
638
|
+
function ia(e, t, n, l) {
|
|
639
|
+
return Math.sqrt(Math.pow(t.top - e.top, 2) + Math.pow(t.left - e.left, 2)) / Math.sqrt(Math.pow(t.top - n.top, 2) + Math.pow(t.left - n.left, 2)) * l.animation;
|
|
640
|
+
}
|
|
641
|
+
var wt = [], gn = {
|
|
642
|
+
initializeByDefault: !0
|
|
643
|
+
}, Ht = {
|
|
644
|
+
mount: function(t) {
|
|
645
|
+
for (var n in gn)
|
|
646
|
+
gn.hasOwnProperty(n) && !(n in t) && (t[n] = gn[n]);
|
|
647
|
+
wt.forEach(function(l) {
|
|
648
|
+
if (l.pluginName === t.pluginName)
|
|
649
|
+
throw "Sortable: Cannot mount plugin ".concat(t.pluginName, " more than once");
|
|
650
|
+
}), wt.push(t);
|
|
651
|
+
},
|
|
652
|
+
pluginEvent: function(t, n, l) {
|
|
653
|
+
var a = this;
|
|
654
|
+
this.eventCanceled = !1, l.cancel = function() {
|
|
655
|
+
a.eventCanceled = !0;
|
|
656
|
+
};
|
|
657
|
+
var i = t + "Global";
|
|
658
|
+
wt.forEach(function(r) {
|
|
659
|
+
n[r.pluginName] && (n[r.pluginName][i] && n[r.pluginName][i](rt({
|
|
660
|
+
sortable: n
|
|
661
|
+
}, l)), n.options[r.pluginName] && n[r.pluginName][t] && n[r.pluginName][t](rt({
|
|
662
|
+
sortable: n
|
|
663
|
+
}, l)));
|
|
664
|
+
});
|
|
665
|
+
},
|
|
666
|
+
initializePlugins: function(t, n, l, a) {
|
|
667
|
+
wt.forEach(function(s) {
|
|
668
|
+
var o = s.pluginName;
|
|
669
|
+
if (!(!t.options[o] && !s.initializeByDefault)) {
|
|
670
|
+
var u = new s(t, n, t.options);
|
|
671
|
+
u.sortable = t, u.options = t.options, t[o] = u, dt(l, u.defaults);
|
|
672
|
+
}
|
|
673
|
+
});
|
|
674
|
+
for (var i in t.options)
|
|
675
|
+
if (t.options.hasOwnProperty(i)) {
|
|
676
|
+
var r = this.modifyOption(t, i, t.options[i]);
|
|
677
|
+
typeof r < "u" && (t.options[i] = r);
|
|
678
|
+
}
|
|
679
|
+
},
|
|
680
|
+
getEventProperties: function(t, n) {
|
|
681
|
+
var l = {};
|
|
682
|
+
return wt.forEach(function(a) {
|
|
683
|
+
typeof a.eventProperties == "function" && dt(l, a.eventProperties.call(n[a.pluginName], t));
|
|
684
|
+
}), l;
|
|
685
|
+
},
|
|
686
|
+
modifyOption: function(t, n, l) {
|
|
687
|
+
var a;
|
|
688
|
+
return wt.forEach(function(i) {
|
|
689
|
+
t[i.pluginName] && i.optionListeners && typeof i.optionListeners[n] == "function" && (a = i.optionListeners[n].call(t[i.pluginName], l));
|
|
690
|
+
}), a;
|
|
691
|
+
}
|
|
692
|
+
};
|
|
693
|
+
function ra(e) {
|
|
694
|
+
var t = e.sortable, n = e.rootEl, l = e.name, a = e.targetEl, i = e.cloneEl, r = e.toEl, s = e.fromEl, o = e.oldIndex, u = e.newIndex, g = e.oldDraggableIndex, p = e.newDraggableIndex, y = e.originalEvent, m = e.putSortable, D = e.extraEventProperties;
|
|
695
|
+
if (t = t || n && n[ze], !!t) {
|
|
696
|
+
var k, le = t.options, G = "on" + l.charAt(0).toUpperCase() + l.substr(1);
|
|
697
|
+
window.CustomEvent && !ct && !jt ? k = new CustomEvent(l, {
|
|
698
|
+
bubbles: !0,
|
|
699
|
+
cancelable: !0
|
|
700
|
+
}) : (k = document.createEvent("Event"), k.initEvent(l, !0, !0)), k.to = r || n, k.from = s || n, k.item = a || n, k.clone = i, k.oldIndex = o, k.newIndex = u, k.oldDraggableIndex = g, k.newDraggableIndex = p, k.originalEvent = y, k.pullMode = m ? m.lastPutMode : void 0;
|
|
701
|
+
var fe = rt(rt({}, D), Ht.getEventProperties(l, t));
|
|
702
|
+
for (var pe in fe)
|
|
703
|
+
k[pe] = fe[pe];
|
|
704
|
+
n && n.dispatchEvent(k), le[G] && le[G].call(t, k);
|
|
705
|
+
}
|
|
706
|
+
}
|
|
707
|
+
var sa = ["evt"], Xe = function(t, n) {
|
|
708
|
+
var l = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, a = l.evt, i = Kl(l, sa);
|
|
709
|
+
Ht.pluginEvent.bind(Q)(t, n, rt({
|
|
710
|
+
dragEl: $,
|
|
711
|
+
parentEl: Ie,
|
|
712
|
+
ghostEl: te,
|
|
713
|
+
rootEl: ke,
|
|
714
|
+
nextEl: bt,
|
|
715
|
+
lastDownEl: Kt,
|
|
716
|
+
cloneEl: Oe,
|
|
717
|
+
cloneHidden: gt,
|
|
718
|
+
dragStarted: At,
|
|
719
|
+
putSortable: Ne,
|
|
720
|
+
activeSortable: Q.active,
|
|
721
|
+
originalEvent: a,
|
|
722
|
+
oldIndex: kt,
|
|
723
|
+
oldDraggableIndex: Nt,
|
|
724
|
+
newIndex: Ge,
|
|
725
|
+
newDraggableIndex: pt,
|
|
726
|
+
hideGhostForTarget: xl,
|
|
727
|
+
unhideGhostForTarget: wl,
|
|
728
|
+
cloneNowHidden: function() {
|
|
729
|
+
gt = !0;
|
|
730
|
+
},
|
|
731
|
+
cloneNowShown: function() {
|
|
732
|
+
gt = !1;
|
|
733
|
+
},
|
|
734
|
+
dispatchSortableEvent: function(s) {
|
|
735
|
+
He({
|
|
736
|
+
sortable: n,
|
|
737
|
+
name: s,
|
|
738
|
+
originalEvent: a
|
|
739
|
+
});
|
|
740
|
+
}
|
|
741
|
+
}, i));
|
|
742
|
+
};
|
|
743
|
+
function He(e) {
|
|
744
|
+
ra(rt({
|
|
745
|
+
putSortable: Ne,
|
|
746
|
+
cloneEl: Oe,
|
|
747
|
+
targetEl: $,
|
|
748
|
+
rootEl: ke,
|
|
749
|
+
oldIndex: kt,
|
|
750
|
+
oldDraggableIndex: Nt,
|
|
751
|
+
newIndex: Ge,
|
|
752
|
+
newDraggableIndex: pt
|
|
753
|
+
}, e));
|
|
754
|
+
}
|
|
755
|
+
var $, Ie, te, ke, bt, Kt, Oe, gt, kt, Ge, Nt, pt, Xt, Ne, $t = !1, nn = !1, ln = [], ht, nt, mn, vn, Gn, zn, At, St, Rt, Bt = !1, Qt = !1, Zt, Be, hn = [], kn = !1, an = [], sn = typeof document < "u", Wt = cl, Kn = jt || ct ? "cssFloat" : "float", ua = sn && !Jl && !cl && "draggable" in document.createElement("div"), hl = function() {
|
|
756
|
+
if (sn) {
|
|
757
|
+
if (ct)
|
|
758
|
+
return !1;
|
|
759
|
+
var e = document.createElement("x");
|
|
760
|
+
return e.style.cssText = "pointer-events:auto", e.style.pointerEvents === "auto";
|
|
761
|
+
}
|
|
762
|
+
}(), yl = function(t, n) {
|
|
763
|
+
var l = X(t), a = parseInt(l.width) - parseInt(l.paddingLeft) - parseInt(l.paddingRight) - parseInt(l.borderLeftWidth) - parseInt(l.borderRightWidth), i = Ot(t, 0, n), r = Ot(t, 1, n), s = i && X(i), o = r && X(r), u = s && parseInt(s.marginLeft) + parseInt(s.marginRight) + _e(i).width, g = o && parseInt(o.marginLeft) + parseInt(o.marginRight) + _e(r).width;
|
|
764
|
+
if (l.display === "flex")
|
|
765
|
+
return l.flexDirection === "column" || l.flexDirection === "column-reverse" ? "vertical" : "horizontal";
|
|
766
|
+
if (l.display === "grid")
|
|
767
|
+
return l.gridTemplateColumns.split(" ").length <= 1 ? "vertical" : "horizontal";
|
|
768
|
+
if (i && s.float && s.float !== "none") {
|
|
769
|
+
var p = s.float === "left" ? "left" : "right";
|
|
770
|
+
return r && (o.clear === "both" || o.clear === p) ? "vertical" : "horizontal";
|
|
771
|
+
}
|
|
772
|
+
return i && (s.display === "block" || s.display === "flex" || s.display === "table" || s.display === "grid" || u >= a && l[Kn] === "none" || r && l[Kn] === "none" && u + g > a) ? "vertical" : "horizontal";
|
|
773
|
+
}, da = function(t, n, l) {
|
|
774
|
+
var a = l ? t.left : t.top, i = l ? t.right : t.bottom, r = l ? t.width : t.height, s = l ? n.left : n.top, o = l ? n.right : n.bottom, u = l ? n.width : n.height;
|
|
775
|
+
return a === s || i === o || a + r / 2 === s + u / 2;
|
|
776
|
+
}, ca = function(t, n) {
|
|
777
|
+
var l;
|
|
778
|
+
return ln.some(function(a) {
|
|
779
|
+
var i = a[ze].options.emptyInsertThreshold;
|
|
780
|
+
if (!(!i || Vn(a))) {
|
|
781
|
+
var r = _e(a), s = t >= r.left - i && t <= r.right + i, o = n >= r.top - i && n <= r.bottom + i;
|
|
782
|
+
if (s && o)
|
|
783
|
+
return l = a;
|
|
784
|
+
}
|
|
785
|
+
}), l;
|
|
786
|
+
}, bl = function(t) {
|
|
787
|
+
function n(i, r) {
|
|
788
|
+
return function(s, o, u, g) {
|
|
789
|
+
var p = s.options.group.name && o.options.group.name && s.options.group.name === o.options.group.name;
|
|
790
|
+
if (i == null && (r || p))
|
|
791
|
+
return !0;
|
|
792
|
+
if (i == null || i === !1)
|
|
793
|
+
return !1;
|
|
794
|
+
if (r && i === "clone")
|
|
795
|
+
return i;
|
|
796
|
+
if (typeof i == "function")
|
|
797
|
+
return n(i(s, o, u, g), r)(s, o, u, g);
|
|
798
|
+
var y = (r ? s : o).options.group.name;
|
|
799
|
+
return i === !0 || typeof i == "string" && i === y || i.join && i.indexOf(y) > -1;
|
|
800
|
+
};
|
|
801
|
+
}
|
|
802
|
+
var l = {}, a = t.group;
|
|
803
|
+
(!a || zt(a) != "object") && (a = {
|
|
804
|
+
name: a
|
|
805
|
+
}), l.name = a.name, l.checkPull = n(a.pull, !0), l.checkPut = n(a.put), l.revertClone = a.revertClone, t.group = l;
|
|
806
|
+
}, xl = function() {
|
|
807
|
+
!hl && te && X(te, "display", "none");
|
|
808
|
+
}, wl = function() {
|
|
809
|
+
!hl && te && X(te, "display", "");
|
|
810
|
+
};
|
|
811
|
+
sn && document.addEventListener("click", function(e) {
|
|
812
|
+
if (nn)
|
|
813
|
+
return e.preventDefault(), e.stopPropagation && e.stopPropagation(), e.stopImmediatePropagation && e.stopImmediatePropagation(), nn = !1, !1;
|
|
814
|
+
}, !0);
|
|
815
|
+
var yt = function(t) {
|
|
816
|
+
if ($) {
|
|
817
|
+
t = t.touches ? t.touches[0] : t;
|
|
818
|
+
var n = ca(t.clientX, t.clientY);
|
|
819
|
+
if (n) {
|
|
820
|
+
var l = {};
|
|
821
|
+
for (var a in t)
|
|
822
|
+
t.hasOwnProperty(a) && (l[a] = t[a]);
|
|
823
|
+
l.target = l.rootEl = n, l.preventDefault = void 0, l.stopPropagation = void 0, n[ze]._onDragOver(l);
|
|
824
|
+
}
|
|
825
|
+
}
|
|
826
|
+
}, fa = function(t) {
|
|
827
|
+
$ && $.parentNode[ze]._isOutsideThisEl(t.target);
|
|
828
|
+
};
|
|
829
|
+
function Q(e, t) {
|
|
830
|
+
if (!(e && e.nodeType && e.nodeType === 1))
|
|
831
|
+
throw "Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(e));
|
|
832
|
+
this.el = e, this.options = t = dt({}, t), e[ze] = this;
|
|
833
|
+
var n = {
|
|
834
|
+
group: null,
|
|
835
|
+
sort: !0,
|
|
836
|
+
disabled: !1,
|
|
837
|
+
store: null,
|
|
838
|
+
handle: null,
|
|
839
|
+
draggable: /^[uo]l$/i.test(e.nodeName) ? ">li" : ">*",
|
|
840
|
+
swapThreshold: 1,
|
|
841
|
+
// percentage; 0 <= x <= 1
|
|
842
|
+
invertSwap: !1,
|
|
843
|
+
// invert always
|
|
844
|
+
invertedSwapThreshold: null,
|
|
845
|
+
// will be set to same as swapThreshold if default
|
|
846
|
+
removeCloneOnHide: !0,
|
|
847
|
+
direction: function() {
|
|
848
|
+
return yl(e, this.options);
|
|
849
|
+
},
|
|
850
|
+
ghostClass: "sortable-ghost",
|
|
851
|
+
chosenClass: "sortable-chosen",
|
|
852
|
+
dragClass: "sortable-drag",
|
|
853
|
+
ignore: "a, img",
|
|
854
|
+
filter: null,
|
|
855
|
+
preventOnFilter: !0,
|
|
856
|
+
animation: 0,
|
|
857
|
+
easing: null,
|
|
858
|
+
setData: function(r, s) {
|
|
859
|
+
r.setData("Text", s.textContent);
|
|
860
|
+
},
|
|
861
|
+
dropBubble: !1,
|
|
862
|
+
dragoverBubble: !1,
|
|
863
|
+
dataIdAttr: "data-id",
|
|
864
|
+
delay: 0,
|
|
865
|
+
delayOnTouchOnly: !1,
|
|
866
|
+
touchStartThreshold: (Number.parseInt ? Number : window).parseInt(window.devicePixelRatio, 10) || 1,
|
|
867
|
+
forceFallback: !1,
|
|
868
|
+
fallbackClass: "sortable-fallback",
|
|
869
|
+
fallbackOnBody: !1,
|
|
870
|
+
fallbackTolerance: 0,
|
|
871
|
+
fallbackOffset: {
|
|
872
|
+
x: 0,
|
|
873
|
+
y: 0
|
|
874
|
+
},
|
|
875
|
+
supportPointer: Q.supportPointer !== !1 && "PointerEvent" in window && !Pt,
|
|
876
|
+
emptyInsertThreshold: 5
|
|
877
|
+
};
|
|
878
|
+
Ht.initializePlugins(this, e, n);
|
|
879
|
+
for (var l in n)
|
|
880
|
+
!(l in t) && (t[l] = n[l]);
|
|
881
|
+
bl(t);
|
|
882
|
+
for (var a in this)
|
|
883
|
+
a.charAt(0) === "_" && typeof this[a] == "function" && (this[a] = this[a].bind(this));
|
|
884
|
+
this.nativeDraggable = t.forceFallback ? !1 : ua, this.nativeDraggable && (this.options.touchStartThreshold = 1), t.supportPointer ? ve(e, "pointerdown", this._onTapStart) : (ve(e, "mousedown", this._onTapStart), ve(e, "touchstart", this._onTapStart)), this.nativeDraggable && (ve(e, "dragover", this), ve(e, "dragenter", this)), ln.push(this.el), t.store && t.store.get && this.sort(t.store.get(this) || []), dt(this, aa());
|
|
885
|
+
}
|
|
886
|
+
Q.prototype = /** @lends Sortable.prototype */
|
|
887
|
+
{
|
|
888
|
+
constructor: Q,
|
|
889
|
+
_isOutsideThisEl: function(t) {
|
|
890
|
+
!this.el.contains(t) && t !== this.el && (St = null);
|
|
891
|
+
},
|
|
892
|
+
_getDirection: function(t, n) {
|
|
893
|
+
return typeof this.options.direction == "function" ? this.options.direction.call(this, t, n, $) : this.options.direction;
|
|
894
|
+
},
|
|
895
|
+
_onTapStart: function(t) {
|
|
896
|
+
if (t.cancelable) {
|
|
897
|
+
var n = this, l = this.el, a = this.options, i = a.preventOnFilter, r = t.type, s = t.touches && t.touches[0] || t.pointerType && t.pointerType === "touch" && t, o = (s || t).target, u = t.target.shadowRoot && (t.path && t.path[0] || t.composedPath && t.composedPath()[0]) || o, g = a.filter;
|
|
898
|
+
if (xa(l), !$ && !(/mousedown|pointerdown/.test(r) && t.button !== 0 || a.disabled) && !u.isContentEditable && !(!this.nativeDraggable && Pt && o && o.tagName.toUpperCase() === "SELECT") && (o = ot(o, a.draggable, l, !1), !(o && o.animated) && Kt !== o)) {
|
|
899
|
+
if (kt = Je(o), Nt = Je(o, a.draggable), typeof g == "function") {
|
|
900
|
+
if (g.call(this, t, o, this)) {
|
|
901
|
+
He({
|
|
902
|
+
sortable: n,
|
|
903
|
+
rootEl: u,
|
|
904
|
+
name: "filter",
|
|
905
|
+
targetEl: o,
|
|
906
|
+
toEl: l,
|
|
907
|
+
fromEl: l
|
|
908
|
+
}), Xe("filter", n, {
|
|
909
|
+
evt: t
|
|
910
|
+
}), i && t.cancelable && t.preventDefault();
|
|
911
|
+
return;
|
|
912
|
+
}
|
|
913
|
+
} else if (g && (g = g.split(",").some(function(p) {
|
|
914
|
+
if (p = ot(u, p.trim(), l, !1), p)
|
|
915
|
+
return He({
|
|
916
|
+
sortable: n,
|
|
917
|
+
rootEl: p,
|
|
918
|
+
name: "filter",
|
|
919
|
+
targetEl: o,
|
|
920
|
+
fromEl: l,
|
|
921
|
+
toEl: l
|
|
922
|
+
}), Xe("filter", n, {
|
|
923
|
+
evt: t
|
|
924
|
+
}), !0;
|
|
925
|
+
}), g)) {
|
|
926
|
+
i && t.cancelable && t.preventDefault();
|
|
927
|
+
return;
|
|
928
|
+
}
|
|
929
|
+
a.handle && !ot(u, a.handle, l, !1) || this._prepareDragStart(t, s, o);
|
|
930
|
+
}
|
|
931
|
+
}
|
|
932
|
+
},
|
|
933
|
+
_prepareDragStart: function(t, n, l) {
|
|
934
|
+
var a = this, i = a.el, r = a.options, s = i.ownerDocument, o;
|
|
935
|
+
if (l && !$ && l.parentNode === i) {
|
|
936
|
+
var u = _e(l);
|
|
937
|
+
if (ke = i, $ = l, Ie = $.parentNode, bt = $.nextSibling, Kt = l, Xt = r.group, Q.dragged = $, ht = {
|
|
938
|
+
target: $,
|
|
939
|
+
clientX: (n || t).clientX,
|
|
940
|
+
clientY: (n || t).clientY
|
|
941
|
+
}, Gn = ht.clientX - u.left, zn = ht.clientY - u.top, this._lastX = (n || t).clientX, this._lastY = (n || t).clientY, $.style["will-change"] = "all", o = function() {
|
|
942
|
+
if (Xe("delayEnded", a, {
|
|
943
|
+
evt: t
|
|
944
|
+
}), Q.eventCanceled) {
|
|
945
|
+
a._onDrop();
|
|
946
|
+
return;
|
|
947
|
+
}
|
|
948
|
+
a._disableDelayedDragEvents(), !Xn && a.nativeDraggable && ($.draggable = !0), a._triggerDragStart(t, n), He({
|
|
949
|
+
sortable: a,
|
|
950
|
+
name: "choose",
|
|
951
|
+
originalEvent: t
|
|
952
|
+
}), qe($, r.chosenClass, !0);
|
|
953
|
+
}, r.ignore.split(",").forEach(function(g) {
|
|
954
|
+
pl($, g.trim(), yn);
|
|
955
|
+
}), ve(s, "dragover", yt), ve(s, "mousemove", yt), ve(s, "touchmove", yt), ve(s, "mouseup", a._onDrop), ve(s, "touchend", a._onDrop), ve(s, "touchcancel", a._onDrop), Xn && this.nativeDraggable && (this.options.touchStartThreshold = 4, $.draggable = !0), Xe("delayStart", this, {
|
|
956
|
+
evt: t
|
|
957
|
+
}), r.delay && (!r.delayOnTouchOnly || n) && (!this.nativeDraggable || !(jt || ct))) {
|
|
958
|
+
if (Q.eventCanceled) {
|
|
959
|
+
this._onDrop();
|
|
960
|
+
return;
|
|
961
|
+
}
|
|
962
|
+
ve(s, "mouseup", a._disableDelayedDrag), ve(s, "touchend", a._disableDelayedDrag), ve(s, "touchcancel", a._disableDelayedDrag), ve(s, "mousemove", a._delayedDragTouchMoveHandler), ve(s, "touchmove", a._delayedDragTouchMoveHandler), r.supportPointer && ve(s, "pointermove", a._delayedDragTouchMoveHandler), a._dragStartTimer = setTimeout(o, r.delay);
|
|
963
|
+
} else
|
|
964
|
+
o();
|
|
965
|
+
}
|
|
966
|
+
},
|
|
967
|
+
_delayedDragTouchMoveHandler: function(t) {
|
|
968
|
+
var n = t.touches ? t.touches[0] : t;
|
|
969
|
+
Math.max(Math.abs(n.clientX - this._lastX), Math.abs(n.clientY - this._lastY)) >= Math.floor(this.options.touchStartThreshold / (this.nativeDraggable && window.devicePixelRatio || 1)) && this._disableDelayedDrag();
|
|
970
|
+
},
|
|
971
|
+
_disableDelayedDrag: function() {
|
|
972
|
+
$ && yn($), clearTimeout(this._dragStartTimer), this._disableDelayedDragEvents();
|
|
973
|
+
},
|
|
974
|
+
_disableDelayedDragEvents: function() {
|
|
975
|
+
var t = this.el.ownerDocument;
|
|
976
|
+
de(t, "mouseup", this._disableDelayedDrag), de(t, "touchend", this._disableDelayedDrag), de(t, "touchcancel", this._disableDelayedDrag), de(t, "mousemove", this._delayedDragTouchMoveHandler), de(t, "touchmove", this._delayedDragTouchMoveHandler), de(t, "pointermove", this._delayedDragTouchMoveHandler);
|
|
977
|
+
},
|
|
978
|
+
_triggerDragStart: function(t, n) {
|
|
979
|
+
n = n || t.pointerType == "touch" && t, !this.nativeDraggable || n ? this.options.supportPointer ? ve(document, "pointermove", this._onTouchMove) : n ? ve(document, "touchmove", this._onTouchMove) : ve(document, "mousemove", this._onTouchMove) : (ve($, "dragend", this), ve(ke, "dragstart", this._onDragStart));
|
|
980
|
+
try {
|
|
981
|
+
document.selection ? Jt(function() {
|
|
982
|
+
document.selection.empty();
|
|
983
|
+
}) : window.getSelection().removeAllRanges();
|
|
984
|
+
} catch {
|
|
985
|
+
}
|
|
986
|
+
},
|
|
987
|
+
_dragStarted: function(t, n) {
|
|
988
|
+
if ($t = !1, ke && $) {
|
|
989
|
+
Xe("dragStarted", this, {
|
|
990
|
+
evt: n
|
|
991
|
+
}), this.nativeDraggable && ve(document, "dragover", fa);
|
|
992
|
+
var l = this.options;
|
|
993
|
+
!t && qe($, l.dragClass, !1), qe($, l.ghostClass, !0), Q.active = this, t && this._appendGhost(), He({
|
|
994
|
+
sortable: this,
|
|
995
|
+
name: "start",
|
|
996
|
+
originalEvent: n
|
|
997
|
+
});
|
|
998
|
+
} else
|
|
999
|
+
this._nulling();
|
|
1000
|
+
},
|
|
1001
|
+
_emulateDragOver: function() {
|
|
1002
|
+
if (nt) {
|
|
1003
|
+
this._lastX = nt.clientX, this._lastY = nt.clientY, xl();
|
|
1004
|
+
for (var t = document.elementFromPoint(nt.clientX, nt.clientY), n = t; t && t.shadowRoot && (t = t.shadowRoot.elementFromPoint(nt.clientX, nt.clientY), t !== n); )
|
|
1005
|
+
n = t;
|
|
1006
|
+
if ($.parentNode[ze]._isOutsideThisEl(t), n)
|
|
1007
|
+
do {
|
|
1008
|
+
if (n[ze]) {
|
|
1009
|
+
var l = void 0;
|
|
1010
|
+
if (l = n[ze]._onDragOver({
|
|
1011
|
+
clientX: nt.clientX,
|
|
1012
|
+
clientY: nt.clientY,
|
|
1013
|
+
target: t,
|
|
1014
|
+
rootEl: n
|
|
1015
|
+
}), l && !this.options.dragoverBubble)
|
|
1016
|
+
break;
|
|
1017
|
+
}
|
|
1018
|
+
t = n;
|
|
1019
|
+
} while (n = n.parentNode);
|
|
1020
|
+
wl();
|
|
1021
|
+
}
|
|
1022
|
+
},
|
|
1023
|
+
_onTouchMove: function(t) {
|
|
1024
|
+
if (ht) {
|
|
1025
|
+
var n = this.options, l = n.fallbackTolerance, a = n.fallbackOffset, i = t.touches ? t.touches[0] : t, r = te && Ct(te, !0), s = te && r && r.a, o = te && r && r.d, u = Wt && Be && qn(Be), g = (i.clientX - ht.clientX + a.x) / (s || 1) + (u ? u[0] - hn[0] : 0) / (s || 1), p = (i.clientY - ht.clientY + a.y) / (o || 1) + (u ? u[1] - hn[1] : 0) / (o || 1);
|
|
1026
|
+
if (!Q.active && !$t) {
|
|
1027
|
+
if (l && Math.max(Math.abs(i.clientX - this._lastX), Math.abs(i.clientY - this._lastY)) < l)
|
|
1028
|
+
return;
|
|
1029
|
+
this._onDragStart(t, !0);
|
|
1030
|
+
}
|
|
1031
|
+
if (te) {
|
|
1032
|
+
r ? (r.e += g - (mn || 0), r.f += p - (vn || 0)) : r = {
|
|
1033
|
+
a: 1,
|
|
1034
|
+
b: 0,
|
|
1035
|
+
c: 0,
|
|
1036
|
+
d: 1,
|
|
1037
|
+
e: g,
|
|
1038
|
+
f: p
|
|
1039
|
+
};
|
|
1040
|
+
var y = "matrix(".concat(r.a, ",").concat(r.b, ",").concat(r.c, ",").concat(r.d, ",").concat(r.e, ",").concat(r.f, ")");
|
|
1041
|
+
X(te, "webkitTransform", y), X(te, "mozTransform", y), X(te, "msTransform", y), X(te, "transform", y), mn = g, vn = p, nt = i;
|
|
1042
|
+
}
|
|
1043
|
+
t.cancelable && t.preventDefault();
|
|
1044
|
+
}
|
|
1045
|
+
},
|
|
1046
|
+
_appendGhost: function() {
|
|
1047
|
+
if (!te) {
|
|
1048
|
+
var t = this.options.fallbackOnBody ? document.body : ke, n = _e($, !0, Wt, !0, t), l = this.options;
|
|
1049
|
+
if (Wt) {
|
|
1050
|
+
for (Be = t; X(Be, "position") === "static" && X(Be, "transform") === "none" && Be !== document; )
|
|
1051
|
+
Be = Be.parentNode;
|
|
1052
|
+
Be !== document.body && Be !== document.documentElement ? (Be === document && (Be = it()), n.top += Be.scrollTop, n.left += Be.scrollLeft) : Be = it(), hn = qn(Be);
|
|
1053
|
+
}
|
|
1054
|
+
te = $.cloneNode(!0), qe(te, l.ghostClass, !1), qe(te, l.fallbackClass, !0), qe(te, l.dragClass, !0), X(te, "transition", ""), X(te, "transform", ""), X(te, "box-sizing", "border-box"), X(te, "margin", 0), X(te, "top", n.top), X(te, "left", n.left), X(te, "width", n.width), X(te, "height", n.height), X(te, "opacity", "0.8"), X(te, "position", Wt ? "absolute" : "fixed"), X(te, "zIndex", "100000"), X(te, "pointerEvents", "none"), Q.ghost = te, t.appendChild(te), X(te, "transform-origin", Gn / parseInt(te.style.width) * 100 + "% " + zn / parseInt(te.style.height) * 100 + "%");
|
|
1055
|
+
}
|
|
1056
|
+
},
|
|
1057
|
+
_onDragStart: function(t, n) {
|
|
1058
|
+
var l = this, a = t.dataTransfer, i = l.options;
|
|
1059
|
+
if (Xe("dragStart", this, {
|
|
1060
|
+
evt: t
|
|
1061
|
+
}), Q.eventCanceled) {
|
|
1062
|
+
this._onDrop();
|
|
1063
|
+
return;
|
|
1064
|
+
}
|
|
1065
|
+
Xe("setupClone", this), Q.eventCanceled || (Oe = vl($), Oe.draggable = !1, Oe.style["will-change"] = "", this._hideClone(), qe(Oe, this.options.chosenClass, !1), Q.clone = Oe), l.cloneId = Jt(function() {
|
|
1066
|
+
Xe("clone", l), !Q.eventCanceled && (l.options.removeCloneOnHide || ke.insertBefore(Oe, $), l._hideClone(), He({
|
|
1067
|
+
sortable: l,
|
|
1068
|
+
name: "clone"
|
|
1069
|
+
}));
|
|
1070
|
+
}), !n && qe($, i.dragClass, !0), n ? (nn = !0, l._loopId = setInterval(l._emulateDragOver, 50)) : (de(document, "mouseup", l._onDrop), de(document, "touchend", l._onDrop), de(document, "touchcancel", l._onDrop), a && (a.effectAllowed = "move", i.setData && i.setData.call(l, a, $)), ve(document, "drop", l), X($, "transform", "translateZ(0)")), $t = !0, l._dragStartId = Jt(l._dragStarted.bind(l, n, t)), ve(document, "selectstart", l), At = !0, Pt && X(document.body, "user-select", "none");
|
|
1071
|
+
},
|
|
1072
|
+
// Returns true - if no further action is needed (either inserted or another condition)
|
|
1073
|
+
_onDragOver: function(t) {
|
|
1074
|
+
var n = this.el, l = t.target, a, i, r, s = this.options, o = s.group, u = Q.active, g = Xt === o, p = s.sort, y = Ne || u, m, D = this, k = !1;
|
|
1075
|
+
if (kn) return;
|
|
1076
|
+
function le(C, H) {
|
|
1077
|
+
Xe(C, D, rt({
|
|
1078
|
+
evt: t,
|
|
1079
|
+
isOwner: g,
|
|
1080
|
+
axis: m ? "vertical" : "horizontal",
|
|
1081
|
+
revert: r,
|
|
1082
|
+
dragRect: a,
|
|
1083
|
+
targetRect: i,
|
|
1084
|
+
canSort: p,
|
|
1085
|
+
fromSortable: y,
|
|
1086
|
+
target: l,
|
|
1087
|
+
completed: fe,
|
|
1088
|
+
onMove: function(re, oe) {
|
|
1089
|
+
return qt(ke, n, $, a, re, _e(re), t, oe);
|
|
1090
|
+
},
|
|
1091
|
+
changed: pe
|
|
1092
|
+
}, H));
|
|
1093
|
+
}
|
|
1094
|
+
function G() {
|
|
1095
|
+
le("dragOverAnimationCapture"), D.captureAnimationState(), D !== y && y.captureAnimationState();
|
|
1096
|
+
}
|
|
1097
|
+
function fe(C) {
|
|
1098
|
+
return le("dragOverCompleted", {
|
|
1099
|
+
insertion: C
|
|
1100
|
+
}), C && (g ? u._hideClone() : u._showClone(D), D !== y && (qe($, Ne ? Ne.options.ghostClass : u.options.ghostClass, !1), qe($, s.ghostClass, !0)), Ne !== D && D !== Q.active ? Ne = D : D === Q.active && Ne && (Ne = null), y === D && (D._ignoreWhileAnimating = l), D.animateAll(function() {
|
|
1101
|
+
le("dragOverAnimationComplete"), D._ignoreWhileAnimating = null;
|
|
1102
|
+
}), D !== y && (y.animateAll(), y._ignoreWhileAnimating = null)), (l === $ && !$.animated || l === n && !l.animated) && (St = null), !s.dragoverBubble && !t.rootEl && l !== document && ($.parentNode[ze]._isOutsideThisEl(t.target), !C && yt(t)), !s.dragoverBubble && t.stopPropagation && t.stopPropagation(), k = !0;
|
|
1103
|
+
}
|
|
1104
|
+
function pe() {
|
|
1105
|
+
Ge = Je($), pt = Je($, s.draggable), He({
|
|
1106
|
+
sortable: D,
|
|
1107
|
+
name: "change",
|
|
1108
|
+
toEl: n,
|
|
1109
|
+
newIndex: Ge,
|
|
1110
|
+
newDraggableIndex: pt,
|
|
1111
|
+
originalEvent: t
|
|
1112
|
+
});
|
|
1113
|
+
}
|
|
1114
|
+
if (t.preventDefault !== void 0 && t.cancelable && t.preventDefault(), l = ot(l, s.draggable, n, !0), le("dragOver"), Q.eventCanceled) return k;
|
|
1115
|
+
if ($.contains(t.target) || l.animated && l.animatingX && l.animatingY || D._ignoreWhileAnimating === l)
|
|
1116
|
+
return fe(!1);
|
|
1117
|
+
if (nn = !1, u && !s.disabled && (g ? p || (r = Ie !== ke) : Ne === this || (this.lastPutMode = Xt.checkPull(this, u, $, t)) && o.checkPut(this, u, $, t))) {
|
|
1118
|
+
if (m = this._getDirection(t, l) === "vertical", a = _e($), le("dragOverValid"), Q.eventCanceled) return k;
|
|
1119
|
+
if (r)
|
|
1120
|
+
return Ie = ke, G(), this._hideClone(), le("revert"), Q.eventCanceled || (bt ? ke.insertBefore($, bt) : ke.appendChild($)), fe(!0);
|
|
1121
|
+
var he = Vn(n, s.draggable);
|
|
1122
|
+
if (!he || va(t, m, this) && !he.animated) {
|
|
1123
|
+
if (he === $)
|
|
1124
|
+
return fe(!1);
|
|
1125
|
+
if (he && n === t.target && (l = he), l && (i = _e(l)), qt(ke, n, $, a, l, i, t, !!l) !== !1)
|
|
1126
|
+
return G(), n.appendChild($), Ie = n, pe(), fe(!0);
|
|
1127
|
+
} else if (he && ma(t, m, this)) {
|
|
1128
|
+
var B = Ot(n, 0, s, !0);
|
|
1129
|
+
if (B === $)
|
|
1130
|
+
return fe(!1);
|
|
1131
|
+
if (l = B, i = _e(l), qt(ke, n, $, a, l, i, t, !1) !== !1)
|
|
1132
|
+
return G(), n.insertBefore($, B), Ie = n, pe(), fe(!0);
|
|
1133
|
+
} else if (l.parentNode === n) {
|
|
1134
|
+
i = _e(l);
|
|
1135
|
+
var ae = 0, De, xe = $.parentNode !== n, F = !da($.animated && $.toRect || a, l.animated && l.toRect || i, m), V = m ? "top" : "left", Y = Wn(l, "top", "top") || Wn($, "top", "top"), ye = Y ? Y.scrollTop : void 0;
|
|
1136
|
+
St !== l && (De = i[V], Bt = !1, Qt = !F && s.invertSwap || xe), ae = ha(t, l, i, m, F ? 1 : s.swapThreshold, s.invertedSwapThreshold == null ? s.swapThreshold : s.invertedSwapThreshold, Qt, St === l);
|
|
1137
|
+
var Ve;
|
|
1138
|
+
if (ae !== 0) {
|
|
1139
|
+
var L = Je($);
|
|
1140
|
+
do
|
|
1141
|
+
L -= ae, Ve = Ie.children[L];
|
|
1142
|
+
while (Ve && (X(Ve, "display") === "none" || Ve === te));
|
|
1143
|
+
}
|
|
1144
|
+
if (ae === 0 || Ve === l)
|
|
1145
|
+
return fe(!1);
|
|
1146
|
+
St = l, Rt = ae;
|
|
1147
|
+
var E = l.nextElementSibling, x = !1;
|
|
1148
|
+
x = ae === 1;
|
|
1149
|
+
var T = qt(ke, n, $, a, l, i, t, x);
|
|
1150
|
+
if (T !== !1)
|
|
1151
|
+
return (T === 1 || T === -1) && (x = T === 1), kn = !0, setTimeout(ga, 30), G(), x && !E ? n.appendChild($) : l.parentNode.insertBefore($, x ? E : l), Y && ml(Y, 0, ye - Y.scrollTop), Ie = $.parentNode, De !== void 0 && !Qt && (Zt = Math.abs(De - _e(l)[V])), pe(), fe(!0);
|
|
1152
|
+
}
|
|
1153
|
+
if (n.contains($))
|
|
1154
|
+
return fe(!1);
|
|
1155
|
+
}
|
|
1156
|
+
return !1;
|
|
1157
|
+
},
|
|
1158
|
+
_ignoreWhileAnimating: null,
|
|
1159
|
+
_offMoveEvents: function() {
|
|
1160
|
+
de(document, "mousemove", this._onTouchMove), de(document, "touchmove", this._onTouchMove), de(document, "pointermove", this._onTouchMove), de(document, "dragover", yt), de(document, "mousemove", yt), de(document, "touchmove", yt);
|
|
1161
|
+
},
|
|
1162
|
+
_offUpEvents: function() {
|
|
1163
|
+
var t = this.el.ownerDocument;
|
|
1164
|
+
de(t, "mouseup", this._onDrop), de(t, "touchend", this._onDrop), de(t, "pointerup", this._onDrop), de(t, "touchcancel", this._onDrop), de(document, "selectstart", this);
|
|
1165
|
+
},
|
|
1166
|
+
_onDrop: function(t) {
|
|
1167
|
+
var n = this.el, l = this.options;
|
|
1168
|
+
if (Ge = Je($), pt = Je($, l.draggable), Xe("drop", this, {
|
|
1169
|
+
evt: t
|
|
1170
|
+
}), Ie = $ && $.parentNode, Ge = Je($), pt = Je($, l.draggable), Q.eventCanceled) {
|
|
1171
|
+
this._nulling();
|
|
1172
|
+
return;
|
|
1173
|
+
}
|
|
1174
|
+
$t = !1, Qt = !1, Bt = !1, clearInterval(this._loopId), clearTimeout(this._dragStartTimer), Cn(this.cloneId), Cn(this._dragStartId), this.nativeDraggable && (de(document, "drop", this), de(n, "dragstart", this._onDragStart)), this._offMoveEvents(), this._offUpEvents(), Pt && X(document.body, "user-select", ""), X($, "transform", ""), t && (At && (t.cancelable && t.preventDefault(), !l.dropBubble && t.stopPropagation()), te && te.parentNode && te.parentNode.removeChild(te), (ke === Ie || Ne && Ne.lastPutMode !== "clone") && Oe && Oe.parentNode && Oe.parentNode.removeChild(Oe), $ && (this.nativeDraggable && de($, "dragend", this), yn($), $.style["will-change"] = "", At && !$t && qe($, Ne ? Ne.options.ghostClass : this.options.ghostClass, !1), qe($, this.options.chosenClass, !1), He({
|
|
1175
|
+
sortable: this,
|
|
1176
|
+
name: "unchoose",
|
|
1177
|
+
toEl: Ie,
|
|
1178
|
+
newIndex: null,
|
|
1179
|
+
newDraggableIndex: null,
|
|
1180
|
+
originalEvent: t
|
|
1181
|
+
}), ke !== Ie ? (Ge >= 0 && (He({
|
|
1182
|
+
rootEl: Ie,
|
|
1183
|
+
name: "add",
|
|
1184
|
+
toEl: Ie,
|
|
1185
|
+
fromEl: ke,
|
|
1186
|
+
originalEvent: t
|
|
1187
|
+
}), He({
|
|
1188
|
+
sortable: this,
|
|
1189
|
+
name: "remove",
|
|
1190
|
+
toEl: Ie,
|
|
1191
|
+
originalEvent: t
|
|
1192
|
+
}), He({
|
|
1193
|
+
rootEl: Ie,
|
|
1194
|
+
name: "sort",
|
|
1195
|
+
toEl: Ie,
|
|
1196
|
+
fromEl: ke,
|
|
1197
|
+
originalEvent: t
|
|
1198
|
+
}), He({
|
|
1199
|
+
sortable: this,
|
|
1200
|
+
name: "sort",
|
|
1201
|
+
toEl: Ie,
|
|
1202
|
+
originalEvent: t
|
|
1203
|
+
})), Ne && Ne.save()) : Ge !== kt && Ge >= 0 && (He({
|
|
1204
|
+
sortable: this,
|
|
1205
|
+
name: "update",
|
|
1206
|
+
toEl: Ie,
|
|
1207
|
+
originalEvent: t
|
|
1208
|
+
}), He({
|
|
1209
|
+
sortable: this,
|
|
1210
|
+
name: "sort",
|
|
1211
|
+
toEl: Ie,
|
|
1212
|
+
originalEvent: t
|
|
1213
|
+
})), Q.active && ((Ge == null || Ge === -1) && (Ge = kt, pt = Nt), He({
|
|
1214
|
+
sortable: this,
|
|
1215
|
+
name: "end",
|
|
1216
|
+
toEl: Ie,
|
|
1217
|
+
originalEvent: t
|
|
1218
|
+
}), this.save()))), this._nulling();
|
|
1219
|
+
},
|
|
1220
|
+
_nulling: function() {
|
|
1221
|
+
Xe("nulling", this), ke = $ = Ie = te = bt = Oe = Kt = gt = ht = nt = At = Ge = pt = kt = Nt = St = Rt = Ne = Xt = Q.dragged = Q.ghost = Q.clone = Q.active = null, an.forEach(function(t) {
|
|
1222
|
+
t.checked = !0;
|
|
1223
|
+
}), an.length = mn = vn = 0;
|
|
1224
|
+
},
|
|
1225
|
+
handleEvent: function(t) {
|
|
1226
|
+
switch (t.type) {
|
|
1227
|
+
case "drop":
|
|
1228
|
+
case "dragend":
|
|
1229
|
+
this._onDrop(t);
|
|
1230
|
+
break;
|
|
1231
|
+
case "dragenter":
|
|
1232
|
+
case "dragover":
|
|
1233
|
+
$ && (this._onDragOver(t), pa(t));
|
|
1234
|
+
break;
|
|
1235
|
+
case "selectstart":
|
|
1236
|
+
t.preventDefault();
|
|
1237
|
+
break;
|
|
1238
|
+
}
|
|
1239
|
+
},
|
|
1240
|
+
/**
|
|
1241
|
+
* Serializes the item into an array of string.
|
|
1242
|
+
* @returns {String[]}
|
|
1243
|
+
*/
|
|
1244
|
+
toArray: function() {
|
|
1245
|
+
for (var t = [], n, l = this.el.children, a = 0, i = l.length, r = this.options; a < i; a++)
|
|
1246
|
+
n = l[a], ot(n, r.draggable, this.el, !1) && t.push(n.getAttribute(r.dataIdAttr) || ba(n));
|
|
1247
|
+
return t;
|
|
1248
|
+
},
|
|
1249
|
+
/**
|
|
1250
|
+
* Sorts the elements according to the array.
|
|
1251
|
+
* @param {String[]} order order of the items
|
|
1252
|
+
*/
|
|
1253
|
+
sort: function(t, n) {
|
|
1254
|
+
var l = {}, a = this.el;
|
|
1255
|
+
this.toArray().forEach(function(i, r) {
|
|
1256
|
+
var s = a.children[r];
|
|
1257
|
+
ot(s, this.options.draggable, a, !1) && (l[i] = s);
|
|
1258
|
+
}, this), n && this.captureAnimationState(), t.forEach(function(i) {
|
|
1259
|
+
l[i] && (a.removeChild(l[i]), a.appendChild(l[i]));
|
|
1260
|
+
}), n && this.animateAll();
|
|
1261
|
+
},
|
|
1262
|
+
/**
|
|
1263
|
+
* Save the current sorting
|
|
1264
|
+
*/
|
|
1265
|
+
save: function() {
|
|
1266
|
+
var t = this.options.store;
|
|
1267
|
+
t && t.set && t.set(this);
|
|
1268
|
+
},
|
|
1269
|
+
/**
|
|
1270
|
+
* 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.
|
|
1271
|
+
* @param {HTMLElement} el
|
|
1272
|
+
* @param {String} [selector] default: `options.draggable`
|
|
1273
|
+
* @returns {HTMLElement|null}
|
|
1274
|
+
*/
|
|
1275
|
+
closest: function(t, n) {
|
|
1276
|
+
return ot(t, n || this.options.draggable, this.el, !1);
|
|
1277
|
+
},
|
|
1278
|
+
/**
|
|
1279
|
+
* Set/get option
|
|
1280
|
+
* @param {string} name
|
|
1281
|
+
* @param {*} [value]
|
|
1282
|
+
* @returns {*}
|
|
1283
|
+
*/
|
|
1284
|
+
option: function(t, n) {
|
|
1285
|
+
var l = this.options;
|
|
1286
|
+
if (n === void 0)
|
|
1287
|
+
return l[t];
|
|
1288
|
+
var a = Ht.modifyOption(this, t, n);
|
|
1289
|
+
typeof a < "u" ? l[t] = a : l[t] = n, t === "group" && bl(l);
|
|
1290
|
+
},
|
|
1291
|
+
/**
|
|
1292
|
+
* Destroy
|
|
1293
|
+
*/
|
|
1294
|
+
destroy: function() {
|
|
1295
|
+
Xe("destroy", this);
|
|
1296
|
+
var t = this.el;
|
|
1297
|
+
t[ze] = null, de(t, "mousedown", this._onTapStart), de(t, "touchstart", this._onTapStart), de(t, "pointerdown", this._onTapStart), this.nativeDraggable && (de(t, "dragover", this), de(t, "dragenter", this)), Array.prototype.forEach.call(t.querySelectorAll("[draggable]"), function(n) {
|
|
1298
|
+
n.removeAttribute("draggable");
|
|
1299
|
+
}), this._onDrop(), this._disableDelayedDragEvents(), ln.splice(ln.indexOf(this.el), 1), this.el = t = null;
|
|
1300
|
+
},
|
|
1301
|
+
_hideClone: function() {
|
|
1302
|
+
if (!gt) {
|
|
1303
|
+
if (Xe("hideClone", this), Q.eventCanceled) return;
|
|
1304
|
+
X(Oe, "display", "none"), this.options.removeCloneOnHide && Oe.parentNode && Oe.parentNode.removeChild(Oe), gt = !0;
|
|
1305
|
+
}
|
|
1306
|
+
},
|
|
1307
|
+
_showClone: function(t) {
|
|
1308
|
+
if (t.lastPutMode !== "clone") {
|
|
1309
|
+
this._hideClone();
|
|
1310
|
+
return;
|
|
1311
|
+
}
|
|
1312
|
+
if (gt) {
|
|
1313
|
+
if (Xe("showClone", this), Q.eventCanceled) return;
|
|
1314
|
+
$.parentNode == ke && !this.options.group.revertClone ? ke.insertBefore(Oe, $) : bt ? ke.insertBefore(Oe, bt) : ke.appendChild(Oe), this.options.group.revertClone && this.animate($, Oe), X(Oe, "display", ""), gt = !1;
|
|
1315
|
+
}
|
|
1316
|
+
}
|
|
1317
|
+
};
|
|
1318
|
+
function pa(e) {
|
|
1319
|
+
e.dataTransfer && (e.dataTransfer.dropEffect = "move"), e.cancelable && e.preventDefault();
|
|
1320
|
+
}
|
|
1321
|
+
function qt(e, t, n, l, a, i, r, s) {
|
|
1322
|
+
var o, u = e[ze], g = u.options.onMove, p;
|
|
1323
|
+
return window.CustomEvent && !ct && !jt ? o = new CustomEvent("move", {
|
|
1324
|
+
bubbles: !0,
|
|
1325
|
+
cancelable: !0
|
|
1326
|
+
}) : (o = document.createEvent("Event"), o.initEvent("move", !0, !0)), o.to = t, o.from = e, o.dragged = n, o.draggedRect = l, o.related = a || t, o.relatedRect = i || _e(t), o.willInsertAfter = s, o.originalEvent = r, e.dispatchEvent(o), g && (p = g.call(u, o, r)), p;
|
|
1327
|
+
}
|
|
1328
|
+
function yn(e) {
|
|
1329
|
+
e.draggable = !1;
|
|
1330
|
+
}
|
|
1331
|
+
function ga() {
|
|
1332
|
+
kn = !1;
|
|
1333
|
+
}
|
|
1334
|
+
function ma(e, t, n) {
|
|
1335
|
+
var l = _e(Ot(n.el, 0, n.options, !0)), a = 10;
|
|
1336
|
+
return t ? e.clientX < l.left - a || e.clientY < l.top && e.clientX < l.right : e.clientY < l.top - a || e.clientY < l.bottom && e.clientX < l.left;
|
|
1337
|
+
}
|
|
1338
|
+
function va(e, t, n) {
|
|
1339
|
+
var l = _e(Vn(n.el, n.options.draggable)), a = 10;
|
|
1340
|
+
return t ? e.clientX > l.right + a || e.clientX <= l.right && e.clientY > l.bottom && e.clientX >= l.left : e.clientX > l.right && e.clientY > l.top || e.clientX <= l.right && e.clientY > l.bottom + a;
|
|
1341
|
+
}
|
|
1342
|
+
function ha(e, t, n, l, a, i, r, s) {
|
|
1343
|
+
var o = l ? e.clientY : e.clientX, u = l ? n.height : n.width, g = l ? n.top : n.left, p = l ? n.bottom : n.right, y = !1;
|
|
1344
|
+
if (!r) {
|
|
1345
|
+
if (s && Zt < u * a) {
|
|
1346
|
+
if (!Bt && (Rt === 1 ? o > g + u * i / 2 : o < p - u * i / 2) && (Bt = !0), Bt)
|
|
1347
|
+
y = !0;
|
|
1348
|
+
else if (Rt === 1 ? o < g + Zt : o > p - Zt)
|
|
1349
|
+
return -Rt;
|
|
1350
|
+
} else if (o > g + u * (1 - a) / 2 && o < p - u * (1 - a) / 2)
|
|
1351
|
+
return ya(t);
|
|
1352
|
+
}
|
|
1353
|
+
return y = y || r, y && (o < g + u * i / 2 || o > p - u * i / 2) ? o > g + u / 2 ? 1 : -1 : 0;
|
|
1354
|
+
}
|
|
1355
|
+
function ya(e) {
|
|
1356
|
+
return Je($) < Je(e) ? 1 : -1;
|
|
1357
|
+
}
|
|
1358
|
+
function ba(e) {
|
|
1359
|
+
for (var t = e.tagName + e.className + e.src + e.href + e.textContent, n = t.length, l = 0; n--; )
|
|
1360
|
+
l += t.charCodeAt(n);
|
|
1361
|
+
return l.toString(36);
|
|
1362
|
+
}
|
|
1363
|
+
function xa(e) {
|
|
1364
|
+
an.length = 0;
|
|
1365
|
+
for (var t = e.getElementsByTagName("input"), n = t.length; n--; ) {
|
|
1366
|
+
var l = t[n];
|
|
1367
|
+
l.checked && an.push(l);
|
|
1368
|
+
}
|
|
1369
|
+
}
|
|
1370
|
+
function Jt(e) {
|
|
1371
|
+
return setTimeout(e, 0);
|
|
1372
|
+
}
|
|
1373
|
+
function Cn(e) {
|
|
1374
|
+
return clearTimeout(e);
|
|
1375
|
+
}
|
|
1376
|
+
sn && ve(document, "touchmove", function(e) {
|
|
1377
|
+
(Q.active || $t) && e.cancelable && e.preventDefault();
|
|
1378
|
+
});
|
|
1379
|
+
Q.utils = {
|
|
1380
|
+
on: ve,
|
|
1381
|
+
off: de,
|
|
1382
|
+
css: X,
|
|
1383
|
+
find: pl,
|
|
1384
|
+
is: function(t, n) {
|
|
1385
|
+
return !!ot(t, n, t, !1);
|
|
1386
|
+
},
|
|
1387
|
+
extend: na,
|
|
1388
|
+
throttle: gl,
|
|
1389
|
+
closest: ot,
|
|
1390
|
+
toggleClass: qe,
|
|
1391
|
+
clone: vl,
|
|
1392
|
+
index: Je,
|
|
1393
|
+
nextTick: Jt,
|
|
1394
|
+
cancelNextTick: Cn,
|
|
1395
|
+
detectDirection: yl,
|
|
1396
|
+
getChild: Ot
|
|
1397
|
+
};
|
|
1398
|
+
Q.get = function(e) {
|
|
1399
|
+
return e[ze];
|
|
1400
|
+
};
|
|
1401
|
+
Q.mount = function() {
|
|
1402
|
+
for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++)
|
|
1403
|
+
t[n] = arguments[n];
|
|
1404
|
+
t[0].constructor === Array && (t = t[0]), t.forEach(function(l) {
|
|
1405
|
+
if (!l.prototype || !l.prototype.constructor)
|
|
1406
|
+
throw "Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(l));
|
|
1407
|
+
l.utils && (Q.utils = rt(rt({}, Q.utils), l.utils)), Ht.mount(l);
|
|
1408
|
+
});
|
|
1409
|
+
};
|
|
1410
|
+
Q.create = function(e, t) {
|
|
1411
|
+
return new Q(e, t);
|
|
1412
|
+
};
|
|
1413
|
+
Q.version = Zl;
|
|
1414
|
+
var Ae = [], Mt, En, Dn = !1, bn, xn, on, _t;
|
|
1415
|
+
function wa() {
|
|
1416
|
+
function e() {
|
|
1417
|
+
this.defaults = {
|
|
1418
|
+
scroll: !0,
|
|
1419
|
+
forceAutoScrollFallback: !1,
|
|
1420
|
+
scrollSensitivity: 30,
|
|
1421
|
+
scrollSpeed: 10,
|
|
1422
|
+
bubbleScroll: !0
|
|
1423
|
+
};
|
|
1424
|
+
for (var t in this)
|
|
1425
|
+
t.charAt(0) === "_" && typeof this[t] == "function" && (this[t] = this[t].bind(this));
|
|
1426
|
+
}
|
|
1427
|
+
return e.prototype = {
|
|
1428
|
+
dragStarted: function(n) {
|
|
1429
|
+
var l = n.originalEvent;
|
|
1430
|
+
this.sortable.nativeDraggable ? ve(document, "dragover", this._handleAutoScroll) : this.options.supportPointer ? ve(document, "pointermove", this._handleFallbackAutoScroll) : l.touches ? ve(document, "touchmove", this._handleFallbackAutoScroll) : ve(document, "mousemove", this._handleFallbackAutoScroll);
|
|
1431
|
+
},
|
|
1432
|
+
dragOverCompleted: function(n) {
|
|
1433
|
+
var l = n.originalEvent;
|
|
1434
|
+
!this.options.dragOverBubble && !l.rootEl && this._handleAutoScroll(l);
|
|
1435
|
+
},
|
|
1436
|
+
drop: function() {
|
|
1437
|
+
this.sortable.nativeDraggable ? de(document, "dragover", this._handleAutoScroll) : (de(document, "pointermove", this._handleFallbackAutoScroll), de(document, "touchmove", this._handleFallbackAutoScroll), de(document, "mousemove", this._handleFallbackAutoScroll)), Zn(), en(), la();
|
|
1438
|
+
},
|
|
1439
|
+
nulling: function() {
|
|
1440
|
+
on = En = Mt = Dn = _t = bn = xn = null, Ae.length = 0;
|
|
1441
|
+
},
|
|
1442
|
+
_handleFallbackAutoScroll: function(n) {
|
|
1443
|
+
this._handleAutoScroll(n, !0);
|
|
1444
|
+
},
|
|
1445
|
+
_handleAutoScroll: function(n, l) {
|
|
1446
|
+
var a = this, i = (n.touches ? n.touches[0] : n).clientX, r = (n.touches ? n.touches[0] : n).clientY, s = document.elementFromPoint(i, r);
|
|
1447
|
+
if (on = n, l || this.options.forceAutoScrollFallback || jt || ct || Pt) {
|
|
1448
|
+
wn(n, this.options, s, l);
|
|
1449
|
+
var o = mt(s, !0);
|
|
1450
|
+
Dn && (!_t || i !== bn || r !== xn) && (_t && Zn(), _t = setInterval(function() {
|
|
1451
|
+
var u = mt(document.elementFromPoint(i, r), !0);
|
|
1452
|
+
u !== o && (o = u, en()), wn(n, a.options, u, l);
|
|
1453
|
+
}, 10), bn = i, xn = r);
|
|
1454
|
+
} else {
|
|
1455
|
+
if (!this.options.bubbleScroll || mt(s, !0) === it()) {
|
|
1456
|
+
en();
|
|
1457
|
+
return;
|
|
1458
|
+
}
|
|
1459
|
+
wn(n, this.options, mt(s, !1), !1);
|
|
1460
|
+
}
|
|
1461
|
+
}
|
|
1462
|
+
}, dt(e, {
|
|
1463
|
+
pluginName: "scroll",
|
|
1464
|
+
initializeByDefault: !0
|
|
1465
|
+
});
|
|
1466
|
+
}
|
|
1467
|
+
function en() {
|
|
1468
|
+
Ae.forEach(function(e) {
|
|
1469
|
+
clearInterval(e.pid);
|
|
1470
|
+
}), Ae = [];
|
|
1471
|
+
}
|
|
1472
|
+
function Zn() {
|
|
1473
|
+
clearInterval(_t);
|
|
1474
|
+
}
|
|
1475
|
+
var wn = gl(function(e, t, n, l) {
|
|
1476
|
+
if (t.scroll) {
|
|
1477
|
+
var a = (e.touches ? e.touches[0] : e).clientX, i = (e.touches ? e.touches[0] : e).clientY, r = t.scrollSensitivity, s = t.scrollSpeed, o = it(), u = !1, g;
|
|
1478
|
+
En !== n && (En = n, en(), Mt = t.scroll, g = t.scrollFn, Mt === !0 && (Mt = mt(n, !0)));
|
|
1479
|
+
var p = 0, y = Mt;
|
|
1480
|
+
do {
|
|
1481
|
+
var m = y, D = _e(m), k = D.top, le = D.bottom, G = D.left, fe = D.right, pe = D.width, he = D.height, B = void 0, ae = void 0, De = m.scrollWidth, xe = m.scrollHeight, F = X(m), V = m.scrollLeft, Y = m.scrollTop;
|
|
1482
|
+
m === o ? (B = pe < De && (F.overflowX === "auto" || F.overflowX === "scroll" || F.overflowX === "visible"), ae = he < xe && (F.overflowY === "auto" || F.overflowY === "scroll" || F.overflowY === "visible")) : (B = pe < De && (F.overflowX === "auto" || F.overflowX === "scroll"), ae = he < xe && (F.overflowY === "auto" || F.overflowY === "scroll"));
|
|
1483
|
+
var ye = B && (Math.abs(fe - a) <= r && V + pe < De) - (Math.abs(G - a) <= r && !!V), Ve = ae && (Math.abs(le - i) <= r && Y + he < xe) - (Math.abs(k - i) <= r && !!Y);
|
|
1484
|
+
if (!Ae[p])
|
|
1485
|
+
for (var L = 0; L <= p; L++)
|
|
1486
|
+
Ae[L] || (Ae[L] = {});
|
|
1487
|
+
(Ae[p].vx != ye || Ae[p].vy != Ve || Ae[p].el !== m) && (Ae[p].el = m, Ae[p].vx = ye, Ae[p].vy = Ve, clearInterval(Ae[p].pid), (ye != 0 || Ve != 0) && (u = !0, Ae[p].pid = setInterval((function() {
|
|
1488
|
+
l && this.layer === 0 && Q.active._onTouchMove(on);
|
|
1489
|
+
var E = Ae[this.layer].vy ? Ae[this.layer].vy * s : 0, x = Ae[this.layer].vx ? Ae[this.layer].vx * s : 0;
|
|
1490
|
+
typeof g == "function" && g.call(Q.dragged.parentNode[ze], x, E, e, on, Ae[this.layer].el) !== "continue" || ml(Ae[this.layer].el, x, E);
|
|
1491
|
+
}).bind({
|
|
1492
|
+
layer: p
|
|
1493
|
+
}), 24))), p++;
|
|
1494
|
+
} while (t.bubbleScroll && y !== o && (y = mt(y, !1)));
|
|
1495
|
+
Dn = u;
|
|
1496
|
+
}
|
|
1497
|
+
}, 30), Sl = function(t) {
|
|
1498
|
+
var n = t.originalEvent, l = t.putSortable, a = t.dragEl, i = t.activeSortable, r = t.dispatchSortableEvent, s = t.hideGhostForTarget, o = t.unhideGhostForTarget;
|
|
1499
|
+
if (n) {
|
|
1500
|
+
var u = l || i;
|
|
1501
|
+
s();
|
|
1502
|
+
var g = n.changedTouches && n.changedTouches.length ? n.changedTouches[0] : n, p = document.elementFromPoint(g.clientX, g.clientY);
|
|
1503
|
+
o(), u && !u.el.contains(p) && (r("spill"), this.onSpill({
|
|
1504
|
+
dragEl: a,
|
|
1505
|
+
putSortable: l
|
|
1506
|
+
}));
|
|
1507
|
+
}
|
|
1508
|
+
};
|
|
1509
|
+
function An() {
|
|
1510
|
+
}
|
|
1511
|
+
An.prototype = {
|
|
1512
|
+
startIndex: null,
|
|
1513
|
+
dragStart: function(t) {
|
|
1514
|
+
var n = t.oldDraggableIndex;
|
|
1515
|
+
this.startIndex = n;
|
|
1516
|
+
},
|
|
1517
|
+
onSpill: function(t) {
|
|
1518
|
+
var n = t.dragEl, l = t.putSortable;
|
|
1519
|
+
this.sortable.captureAnimationState(), l && l.captureAnimationState();
|
|
1520
|
+
var a = Ot(this.sortable.el, this.startIndex, this.options);
|
|
1521
|
+
a ? this.sortable.el.insertBefore(n, a) : this.sortable.el.appendChild(n), this.sortable.animateAll(), l && l.animateAll();
|
|
1522
|
+
},
|
|
1523
|
+
drop: Sl
|
|
1524
|
+
};
|
|
1525
|
+
dt(An, {
|
|
1526
|
+
pluginName: "revertOnSpill"
|
|
1527
|
+
});
|
|
1528
|
+
function Mn() {
|
|
1529
|
+
}
|
|
1530
|
+
Mn.prototype = {
|
|
1531
|
+
onSpill: function(t) {
|
|
1532
|
+
var n = t.dragEl, l = t.putSortable, a = l || this.sortable;
|
|
1533
|
+
a.captureAnimationState(), n.parentNode && n.parentNode.removeChild(n), a.animateAll();
|
|
1534
|
+
},
|
|
1535
|
+
drop: Sl
|
|
1536
|
+
};
|
|
1537
|
+
dt(Mn, {
|
|
1538
|
+
pluginName: "removeOnSpill"
|
|
1539
|
+
});
|
|
1540
|
+
Q.mount(new wa());
|
|
1541
|
+
Q.mount(Mn, An);
|
|
1542
|
+
function Sa() {
|
|
1543
|
+
return typeof window < "u" ? window.console : global.console;
|
|
1544
|
+
}
|
|
1545
|
+
const $a = Sa();
|
|
1546
|
+
function ka(e) {
|
|
1547
|
+
const t = /* @__PURE__ */ Object.create(null);
|
|
1548
|
+
return function(l) {
|
|
1549
|
+
return t[l] || (t[l] = e(l));
|
|
1550
|
+
};
|
|
1551
|
+
}
|
|
1552
|
+
const Ca = /-(\w)/g, Jn = ka((e) => e.replace(Ca, (t, n) => n ? n.toUpperCase() : ""));
|
|
1553
|
+
function Sn(e) {
|
|
1554
|
+
e.parentElement !== null && e.parentElement.removeChild(e);
|
|
1555
|
+
}
|
|
1556
|
+
function el(e, t, n) {
|
|
1557
|
+
const l = n === 0 ? e.children[0] : e.children[n - 1].nextSibling;
|
|
1558
|
+
e.insertBefore(t, l);
|
|
1559
|
+
}
|
|
1560
|
+
function Ea(e, t) {
|
|
1561
|
+
return Object.values(e).indexOf(t);
|
|
1562
|
+
}
|
|
1563
|
+
function Da(e, t, n, l) {
|
|
1564
|
+
if (!e)
|
|
1565
|
+
return [];
|
|
1566
|
+
const a = Object.values(e), i = t.length - l;
|
|
1567
|
+
return [...t].map((s, o) => o >= i ? a.length : a.indexOf(s));
|
|
1568
|
+
}
|
|
1569
|
+
function $l(e, t) {
|
|
1570
|
+
this.$nextTick(() => this.$emit(e.toLowerCase(), t));
|
|
1571
|
+
}
|
|
1572
|
+
function Ia(e) {
|
|
1573
|
+
return (t) => {
|
|
1574
|
+
this.realList !== null && this["onDrag" + e](t), $l.call(this, e, t);
|
|
1575
|
+
};
|
|
1576
|
+
}
|
|
1577
|
+
function Oa(e) {
|
|
1578
|
+
return ["transition-group", "TransitionGroup"].includes(e);
|
|
1579
|
+
}
|
|
1580
|
+
function Ta(e) {
|
|
1581
|
+
if (!e || e.length !== 1)
|
|
1582
|
+
return !1;
|
|
1583
|
+
const [{ type: t }] = e;
|
|
1584
|
+
return t ? Oa(t.name) : !1;
|
|
1585
|
+
}
|
|
1586
|
+
function Va(e, t) {
|
|
1587
|
+
return t ? { ...t.props, ...t.attrs } : e;
|
|
1588
|
+
}
|
|
1589
|
+
const In = ["Start", "Add", "Remove", "Update", "End"], On = ["Choose", "Unchoose", "Sort", "Filter", "Clone"], Aa = ["Move", ...In, ...On].map((e) => "on" + e);
|
|
1590
|
+
let $n = null;
|
|
1591
|
+
const Ma = {
|
|
1592
|
+
options: Object,
|
|
1593
|
+
list: {
|
|
1594
|
+
type: Array,
|
|
1595
|
+
required: !1,
|
|
1596
|
+
default: null
|
|
1597
|
+
},
|
|
1598
|
+
noTransitionOnDrag: {
|
|
1599
|
+
type: Boolean,
|
|
1600
|
+
default: !1
|
|
1601
|
+
},
|
|
1602
|
+
clone: {
|
|
1603
|
+
type: Function,
|
|
1604
|
+
default: (e) => e
|
|
1605
|
+
},
|
|
1606
|
+
tag: {
|
|
1607
|
+
type: String,
|
|
1608
|
+
default: "div"
|
|
1609
|
+
},
|
|
1610
|
+
move: {
|
|
1611
|
+
type: Function,
|
|
1612
|
+
default: null
|
|
1613
|
+
},
|
|
1614
|
+
componentData: {
|
|
1615
|
+
type: Object,
|
|
1616
|
+
required: !1,
|
|
1617
|
+
default: null
|
|
1618
|
+
},
|
|
1619
|
+
component: {
|
|
1620
|
+
type: String,
|
|
1621
|
+
default: null
|
|
1622
|
+
},
|
|
1623
|
+
modelValue: {
|
|
1624
|
+
type: Array,
|
|
1625
|
+
required: !1,
|
|
1626
|
+
default: null
|
|
1627
|
+
}
|
|
1628
|
+
}, tl = ll({
|
|
1629
|
+
name: "VueDraggableNext",
|
|
1630
|
+
inheritAttrs: !1,
|
|
1631
|
+
emits: [
|
|
1632
|
+
"update:modelValue",
|
|
1633
|
+
"move",
|
|
1634
|
+
"change",
|
|
1635
|
+
...In.map((e) => e.toLowerCase()),
|
|
1636
|
+
...On.map((e) => e.toLowerCase())
|
|
1637
|
+
],
|
|
1638
|
+
props: Ma,
|
|
1639
|
+
data() {
|
|
1640
|
+
return {
|
|
1641
|
+
transitionMode: !1,
|
|
1642
|
+
noneFunctionalComponentMode: !1,
|
|
1643
|
+
headerOffset: 0,
|
|
1644
|
+
footerOffset: 0,
|
|
1645
|
+
_sortable: {},
|
|
1646
|
+
visibleIndexes: [],
|
|
1647
|
+
context: {}
|
|
1648
|
+
};
|
|
1649
|
+
},
|
|
1650
|
+
render() {
|
|
1651
|
+
const e = this.$slots.default ? this.$slots.default() : null, t = Va(this.$attrs, this.componentData);
|
|
1652
|
+
return e ? (this.transitionMode = Ta(e), _n(this.getTag(), t, e)) : _n(this.getTag(), t, []);
|
|
1653
|
+
},
|
|
1654
|
+
created() {
|
|
1655
|
+
this.list !== null && this.modelValue !== null && $a.error("list props are mutually exclusive! Please set one.");
|
|
1656
|
+
},
|
|
1657
|
+
mounted() {
|
|
1658
|
+
const e = {};
|
|
1659
|
+
In.forEach((a) => {
|
|
1660
|
+
e["on" + a] = Ia.call(this, a);
|
|
1661
|
+
}), On.forEach((a) => {
|
|
1662
|
+
e["on" + a] = $l.bind(this, a);
|
|
1663
|
+
});
|
|
1664
|
+
const t = Object.keys(this.$attrs).reduce((a, i) => (a[Jn(i)] = this.$attrs[i], a), {}), n = Object.assign({}, t, e, {
|
|
1665
|
+
onMove: (a, i) => this.onDragMove(a, i)
|
|
1666
|
+
});
|
|
1667
|
+
!("draggable" in n) && (n.draggable = ">*");
|
|
1668
|
+
const l = this.$el.nodeType === 1 ? this.$el : this.$el.parentElement;
|
|
1669
|
+
this._sortable = new Q(l, n), l.__draggable_component__ = this, this.computeIndexes();
|
|
1670
|
+
},
|
|
1671
|
+
beforeUnmount() {
|
|
1672
|
+
try {
|
|
1673
|
+
this._sortable !== void 0 && this._sortable.destroy();
|
|
1674
|
+
} catch {
|
|
1675
|
+
}
|
|
1676
|
+
},
|
|
1677
|
+
computed: {
|
|
1678
|
+
realList() {
|
|
1679
|
+
return this.list ? this.list : this.modelValue;
|
|
1680
|
+
}
|
|
1681
|
+
},
|
|
1682
|
+
watch: {
|
|
1683
|
+
$attrs: {
|
|
1684
|
+
handler(e) {
|
|
1685
|
+
this.updateOptions(e);
|
|
1686
|
+
},
|
|
1687
|
+
deep: !0
|
|
1688
|
+
},
|
|
1689
|
+
realList() {
|
|
1690
|
+
this.computeIndexes();
|
|
1691
|
+
}
|
|
1692
|
+
},
|
|
1693
|
+
methods: {
|
|
1694
|
+
getTag() {
|
|
1695
|
+
return this.component ? Il(this.component) : this.tag;
|
|
1696
|
+
},
|
|
1697
|
+
updateOptions(e) {
|
|
1698
|
+
for (var t in e) {
|
|
1699
|
+
const n = Jn(t);
|
|
1700
|
+
Aa.indexOf(n) === -1 && this._sortable.option(n, e[t]);
|
|
1701
|
+
}
|
|
1702
|
+
},
|
|
1703
|
+
getChildrenNodes() {
|
|
1704
|
+
return this.$el.children;
|
|
1705
|
+
},
|
|
1706
|
+
computeIndexes() {
|
|
1707
|
+
this.$nextTick(() => {
|
|
1708
|
+
this.visibleIndexes = Da(this.getChildrenNodes(), this.$el.children, this.transitionMode, this.footerOffset);
|
|
1709
|
+
});
|
|
1710
|
+
},
|
|
1711
|
+
getUnderlyingVm(e) {
|
|
1712
|
+
const t = Ea(this.getChildrenNodes() || [], e);
|
|
1713
|
+
if (t === -1)
|
|
1714
|
+
return null;
|
|
1715
|
+
const n = this.realList[t];
|
|
1716
|
+
return { index: t, element: n };
|
|
1717
|
+
},
|
|
1718
|
+
emitChanges(e) {
|
|
1719
|
+
this.$nextTick(() => {
|
|
1720
|
+
this.$emit("change", e);
|
|
1721
|
+
});
|
|
1722
|
+
},
|
|
1723
|
+
alterList(e) {
|
|
1724
|
+
if (this.list) {
|
|
1725
|
+
e(this.list);
|
|
1726
|
+
return;
|
|
1727
|
+
}
|
|
1728
|
+
const t = [...this.modelValue];
|
|
1729
|
+
e(t), this.$emit("update:modelValue", t);
|
|
1730
|
+
},
|
|
1731
|
+
spliceList() {
|
|
1732
|
+
const e = (t) => t.splice(...arguments);
|
|
1733
|
+
this.alterList(e);
|
|
1734
|
+
},
|
|
1735
|
+
updatePosition(e, t) {
|
|
1736
|
+
const n = (l) => l.splice(t, 0, l.splice(e, 1)[0]);
|
|
1737
|
+
this.alterList(n);
|
|
1738
|
+
},
|
|
1739
|
+
getVmIndex(e) {
|
|
1740
|
+
const t = this.visibleIndexes, n = t.length;
|
|
1741
|
+
return e > n - 1 ? n : t[e];
|
|
1742
|
+
},
|
|
1743
|
+
getComponent() {
|
|
1744
|
+
return this.$slots.default ? (
|
|
1745
|
+
//@ts-ignore
|
|
1746
|
+
this.$slots.default()[0].componentInstance
|
|
1747
|
+
) : null;
|
|
1748
|
+
},
|
|
1749
|
+
resetTransitionData(e) {
|
|
1750
|
+
if (!this.noTransitionOnDrag || !this.transitionMode)
|
|
1751
|
+
return;
|
|
1752
|
+
var t = this.getChildrenNodes();
|
|
1753
|
+
t[e].data = null;
|
|
1754
|
+
const n = this.getComponent();
|
|
1755
|
+
n.children = [], n.kept = void 0;
|
|
1756
|
+
},
|
|
1757
|
+
onDragStart(e) {
|
|
1758
|
+
this.computeIndexes(), this.context = this.getUnderlyingVm(e.item), this.context && (e.item._underlying_vm_ = this.clone(this.context.element), $n = e.item);
|
|
1759
|
+
},
|
|
1760
|
+
onDragAdd(e) {
|
|
1761
|
+
const t = e.item._underlying_vm_;
|
|
1762
|
+
if (t === void 0)
|
|
1763
|
+
return;
|
|
1764
|
+
Sn(e.item);
|
|
1765
|
+
const n = this.getVmIndex(e.newIndex);
|
|
1766
|
+
this.spliceList(n, 0, t), this.computeIndexes();
|
|
1767
|
+
const l = { element: t, newIndex: n };
|
|
1768
|
+
this.emitChanges({ added: l });
|
|
1769
|
+
},
|
|
1770
|
+
onDragRemove(e) {
|
|
1771
|
+
if (el(this.$el, e.item, e.oldIndex), e.pullMode === "clone") {
|
|
1772
|
+
Sn(e.clone);
|
|
1773
|
+
return;
|
|
1774
|
+
}
|
|
1775
|
+
if (!this.context)
|
|
1776
|
+
return;
|
|
1777
|
+
const t = this.context.index;
|
|
1778
|
+
this.spliceList(t, 1);
|
|
1779
|
+
const n = { element: this.context.element, oldIndex: t };
|
|
1780
|
+
this.resetTransitionData(t), this.emitChanges({ removed: n });
|
|
1781
|
+
},
|
|
1782
|
+
onDragUpdate(e) {
|
|
1783
|
+
Sn(e.item), el(e.from, e.item, e.oldIndex);
|
|
1784
|
+
const t = this.context.index, n = this.getVmIndex(e.newIndex);
|
|
1785
|
+
this.updatePosition(t, n);
|
|
1786
|
+
const l = { element: this.context.element, oldIndex: t, newIndex: n };
|
|
1787
|
+
this.emitChanges({ moved: l });
|
|
1788
|
+
},
|
|
1789
|
+
updateProperty(e, t) {
|
|
1790
|
+
e.hasOwnProperty(t) && (e[t] += this.headerOffset);
|
|
1791
|
+
},
|
|
1792
|
+
onDragMove(e, t) {
|
|
1793
|
+
const n = this.move;
|
|
1794
|
+
if (!n || !this.realList)
|
|
1795
|
+
return !0;
|
|
1796
|
+
const l = this.getRelatedContextFromMoveEvent(e), a = this.context, i = this.computeFutureIndex(l, e);
|
|
1797
|
+
Object.assign(a, { futureIndex: i });
|
|
1798
|
+
const r = Object.assign({}, e, {
|
|
1799
|
+
relatedContext: l,
|
|
1800
|
+
draggedContext: a
|
|
1801
|
+
});
|
|
1802
|
+
return n(r, t);
|
|
1803
|
+
},
|
|
1804
|
+
onDragEnd() {
|
|
1805
|
+
this.computeIndexes(), $n = null;
|
|
1806
|
+
},
|
|
1807
|
+
getTrargetedComponent(e) {
|
|
1808
|
+
return e.__draggable_component__;
|
|
1809
|
+
},
|
|
1810
|
+
getRelatedContextFromMoveEvent({ to: e, related: t }) {
|
|
1811
|
+
const n = this.getTrargetedComponent(e);
|
|
1812
|
+
if (!n)
|
|
1813
|
+
return { component: n };
|
|
1814
|
+
const l = n.realList, a = { list: l, component: n };
|
|
1815
|
+
if (e !== t && l && n.getUnderlyingVm) {
|
|
1816
|
+
const i = n.getUnderlyingVm(t);
|
|
1817
|
+
if (i)
|
|
1818
|
+
return Object.assign(i, a);
|
|
1819
|
+
}
|
|
1820
|
+
return a;
|
|
1821
|
+
},
|
|
1822
|
+
computeFutureIndex(e, t) {
|
|
1823
|
+
const n = [...t.to.children].filter((r) => r.style.display !== "none");
|
|
1824
|
+
if (n.length === 0)
|
|
1825
|
+
return 0;
|
|
1826
|
+
const l = n.indexOf(t.related), a = e.component.getVmIndex(l);
|
|
1827
|
+
return n.indexOf($n) !== -1 || !t.willInsertAfter ? a : a + 1;
|
|
1828
|
+
}
|
|
1829
|
+
}
|
|
1830
|
+
}), _a = { class: "p-5 gap-y-4 text-sm flex w-[250px] flex-col" }, Fa = {
|
|
1831
|
+
key: 0,
|
|
1832
|
+
class: "gap-y-2 flex flex-col border-b pb-3 border-oc-gray-200"
|
|
1833
|
+
}, Pa = { class: "gap-y-2 flex flex-col" }, La = {
|
|
1834
|
+
key: 0,
|
|
1835
|
+
class: "flex items-center bg-white justify-between h-[26px]"
|
|
1836
|
+
}, Na = { class: "flex items-center w-full gap-x-3" }, Ra = { class: "truncate w-full max-w-[160px]" }, Ba = {
|
|
1837
|
+
__name: "ColumnEdit",
|
|
1838
|
+
props: {
|
|
1839
|
+
options: {
|
|
1840
|
+
type: Object,
|
|
1841
|
+
default: () => ({})
|
|
1842
|
+
},
|
|
1843
|
+
headers: {
|
|
1844
|
+
type: Array,
|
|
1845
|
+
default: () => []
|
|
1846
|
+
},
|
|
1847
|
+
localKey: {
|
|
1848
|
+
type: String,
|
|
1849
|
+
default: ""
|
|
1850
|
+
}
|
|
1851
|
+
},
|
|
1852
|
+
emits: ["change-active", "onMoved", "update-order"],
|
|
1853
|
+
setup(e, { emit: t }) {
|
|
1854
|
+
const n = t, l = e, a = _([]), i = _([]), r = _(!1), s = (u = !1) => {
|
|
1855
|
+
i.value = i.value.map((g) => ({
|
|
1856
|
+
...g,
|
|
1857
|
+
isActive: !0
|
|
1858
|
+
})), n("update-order", {
|
|
1859
|
+
fixedHeaders: i.value,
|
|
1860
|
+
activeHeaders: a.value,
|
|
1861
|
+
isOnMount: u
|
|
1862
|
+
});
|
|
1863
|
+
}, o = {
|
|
1864
|
+
handle: ".drag-el",
|
|
1865
|
+
filter: ".is-disabled",
|
|
1866
|
+
group: "headers",
|
|
1867
|
+
animation: 500,
|
|
1868
|
+
forceFallback: !1,
|
|
1869
|
+
move: (u) => u.to.dataset.activeHeaders ? !0 : !!u.draggedContext.futureIndex,
|
|
1870
|
+
"onUpdate:modelValue": () => s()
|
|
1871
|
+
};
|
|
1872
|
+
return Tt(() => {
|
|
1873
|
+
const u = sl(l.localKey), { fixed: g, active: p } = ul(u, l.headers, l.localKey);
|
|
1874
|
+
i.value = g || l.headers.slice(0, 1), a.value = p || l.headers.slice(1).map((y) => {
|
|
1875
|
+
var m, D, k;
|
|
1876
|
+
return {
|
|
1877
|
+
...y,
|
|
1878
|
+
isActive: ((k = (D = (m = l.options) == null ? void 0 : m.active) == null ? void 0 : D.find((le) => le.key === y.key)) == null ? void 0 : k.isActive) ?? !0
|
|
1879
|
+
};
|
|
1880
|
+
}), s(!0);
|
|
1881
|
+
}), (u, g) => (w(), ce(M(rn), {
|
|
1882
|
+
modelValue: r.value,
|
|
1883
|
+
"onUpdate:modelValue": g[3] || (g[3] = (p) => r.value = p),
|
|
1884
|
+
class: "h-[36px]",
|
|
1885
|
+
"is-attach-to-body": ""
|
|
1886
|
+
}, {
|
|
1887
|
+
menu: be(() => [
|
|
1888
|
+
P("div", _a, [
|
|
1889
|
+
i.value.length ? (w(), N("div", Fa, [
|
|
1890
|
+
g[4] || (g[4] = P("span", { class: "text-oc-text-400 font-medium" }, "Fixed columns", -1)),
|
|
1891
|
+
q(M(tl), Fn({
|
|
1892
|
+
key: "key",
|
|
1893
|
+
modelValue: i.value,
|
|
1894
|
+
"onUpdate:modelValue": g[0] || (g[0] = (p) => i.value = p)
|
|
1895
|
+
}, o), {
|
|
1896
|
+
default: be(() => [
|
|
1897
|
+
(w(!0), N(We, null, vt(i.value, (p, y) => (w(), N("div", {
|
|
1898
|
+
key: p.key,
|
|
1899
|
+
class: we(["flex items-center justify-between h-[26px]", y ? "" : "is-disabled"])
|
|
1900
|
+
}, [
|
|
1901
|
+
P("span", null, Et(p.label), 1),
|
|
1902
|
+
y ? (w(), ce(M(Ee), {
|
|
1903
|
+
key: 0,
|
|
1904
|
+
width: "18",
|
|
1905
|
+
height: "18",
|
|
1906
|
+
class: "text-oc-text-400 drag-el cursor-move",
|
|
1907
|
+
name: "draggable"
|
|
1908
|
+
})) : K("", !0)
|
|
1909
|
+
], 2))), 128))
|
|
1910
|
+
]),
|
|
1911
|
+
_: 1
|
|
1912
|
+
}, 16, ["modelValue"])
|
|
1913
|
+
])) : K("", !0),
|
|
1914
|
+
P("div", Pa, [
|
|
1915
|
+
g[5] || (g[5] = P("span", { class: "text-oc-text-400 font-medium" }, "Active columns", -1)),
|
|
1916
|
+
q(M(tl), Fn({
|
|
1917
|
+
key: "key",
|
|
1918
|
+
modelValue: a.value,
|
|
1919
|
+
"onUpdate:modelValue": g[2] || (g[2] = (p) => a.value = p)
|
|
1920
|
+
}, o, { "data-active-headers": "true" }), {
|
|
1921
|
+
default: be(() => [
|
|
1922
|
+
(w(!0), N(We, null, vt(a.value, (p) => (w(), N(We, {
|
|
1923
|
+
key: p.key
|
|
1924
|
+
}, [
|
|
1925
|
+
p.key !== "actions" ? (w(), N("div", La, [
|
|
1926
|
+
P("div", Na, [
|
|
1927
|
+
q(M(Al), {
|
|
1928
|
+
modelValue: p.isActive,
|
|
1929
|
+
"onUpdate:modelValue": [
|
|
1930
|
+
(y) => p.isActive = y,
|
|
1931
|
+
g[1] || (g[1] = (y) => s())
|
|
1932
|
+
],
|
|
1933
|
+
class: "!w-fit"
|
|
1934
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue"]),
|
|
1935
|
+
P("div", Ra, Et(p.label), 1)
|
|
1936
|
+
]),
|
|
1937
|
+
a.value.length > 1 ? (w(), ce(M(Ee), {
|
|
1938
|
+
key: 0,
|
|
1939
|
+
width: "18",
|
|
1940
|
+
height: "18",
|
|
1941
|
+
class: "text-oc-text-400 drag-el cursor-move",
|
|
1942
|
+
name: "draggable"
|
|
1943
|
+
})) : K("", !0)
|
|
1944
|
+
])) : K("", !0)
|
|
1945
|
+
], 64))), 128))
|
|
1946
|
+
]),
|
|
1947
|
+
_: 1
|
|
1948
|
+
}, 16, ["modelValue"])
|
|
1949
|
+
])
|
|
1950
|
+
])
|
|
1951
|
+
]),
|
|
1952
|
+
default: be(() => [
|
|
1953
|
+
q(M(It), {
|
|
1954
|
+
label: "Edit Column",
|
|
1955
|
+
"left-icon": "setting",
|
|
1956
|
+
variant: "secondary"
|
|
1957
|
+
})
|
|
1958
|
+
]),
|
|
1959
|
+
_: 1
|
|
1960
|
+
}, 8, ["modelValue"]));
|
|
1961
|
+
}
|
|
1962
|
+
}, ja = { class: "flex flex-col gap-9 relative" }, Ha = {
|
|
1963
|
+
key: 0,
|
|
1964
|
+
class: "flex items-center px-4 min-h-[52px]"
|
|
1965
|
+
}, Ya = {
|
|
1966
|
+
key: 0,
|
|
1967
|
+
class: "flex gap-5 items-center absolute left-5"
|
|
1968
|
+
}, Ua = {
|
|
1969
|
+
key: 1,
|
|
1970
|
+
class: "flex gap-3 absolute left-5"
|
|
1971
|
+
}, Xa = {
|
|
1972
|
+
key: 1,
|
|
1973
|
+
class: "flex w-full gap-5 md:justify-start justify-center"
|
|
1974
|
+
}, Qa = {
|
|
1975
|
+
key: 2,
|
|
1976
|
+
class: "hidden md:flex items-center"
|
|
1977
|
+
}, si = {
|
|
1978
|
+
__name: "OcDataTable",
|
|
1979
|
+
props: {
|
|
1980
|
+
isLoading: Boolean,
|
|
1981
|
+
id: {
|
|
1982
|
+
type: String,
|
|
1983
|
+
required: !0
|
|
1984
|
+
},
|
|
1985
|
+
options: {
|
|
1986
|
+
type: Object,
|
|
1987
|
+
required: !0
|
|
1988
|
+
},
|
|
1989
|
+
filter: {
|
|
1990
|
+
type: Object,
|
|
1991
|
+
required: !0
|
|
1992
|
+
},
|
|
1993
|
+
selected: {
|
|
1994
|
+
type: Array,
|
|
1995
|
+
required: !1
|
|
1996
|
+
},
|
|
1997
|
+
rowClass: String,
|
|
1998
|
+
rowKey: {
|
|
1999
|
+
type: String,
|
|
2000
|
+
Function,
|
|
2001
|
+
default: "id"
|
|
2002
|
+
},
|
|
2003
|
+
rowLink: String
|
|
2004
|
+
},
|
|
2005
|
+
emits: {
|
|
2006
|
+
"update:selected": [],
|
|
2007
|
+
"update:filter": [],
|
|
2008
|
+
"click:row": [],
|
|
2009
|
+
"filter-fields-changed": [],
|
|
2010
|
+
"filter-removed": [],
|
|
2011
|
+
"search-query-changed": [],
|
|
2012
|
+
"hover:cell": []
|
|
2013
|
+
},
|
|
2014
|
+
setup(e, { emit: t }) {
|
|
2015
|
+
var H, j, re, oe, Se, $e, se, Ce, Re;
|
|
2016
|
+
const n = e, l = t, a = Me(() => {
|
|
2017
|
+
var b;
|
|
2018
|
+
return (b = n.options) == null ? void 0 : b.pagination;
|
|
2019
|
+
}), i = Me(() => {
|
|
2020
|
+
var b;
|
|
2021
|
+
return (b = n.options) == null ? void 0 : b.cursor;
|
|
2022
|
+
}), r = _(), s = Me(() => {
|
|
2023
|
+
var b;
|
|
2024
|
+
return (b = n.options) == null ? void 0 : b.tableOptions;
|
|
2025
|
+
}), o = Me(() => {
|
|
2026
|
+
var b;
|
|
2027
|
+
return {
|
|
2028
|
+
...s.value,
|
|
2029
|
+
headers: r.value ? r.value.filter((v) => x(v.key)) : (b = s.value) == null ? void 0 : b.headers.filter((v) => x(v.key))
|
|
2030
|
+
};
|
|
2031
|
+
}), u = Me(() => {
|
|
2032
|
+
var b;
|
|
2033
|
+
return (b = n.options) == null ? void 0 : b.filterOptions;
|
|
2034
|
+
}), g = Me(() => {
|
|
2035
|
+
var b;
|
|
2036
|
+
return (b = n.options) == null ? void 0 : b.hidePerPageDropdown;
|
|
2037
|
+
}), p = Me(() => {
|
|
2038
|
+
var b;
|
|
2039
|
+
return ((b = a.value) == null ? void 0 : b.last_page) === 1;
|
|
2040
|
+
}), y = _(!1), m = _(n.filter[(j = (H = u.value) == null ? void 0 : H.tabs) == null ? void 0 : j.key]), D = _(n.filter.page), k = _(
|
|
2041
|
+
(oe = (re = u.value) == null ? void 0 : re.per_page) != null && oe.key ? n.filter[($e = (Se = u.value) == null ? void 0 : Se.per_page) == null ? void 0 : $e.key] : n.filter.per_page
|
|
2042
|
+
), le = ((Re = n.filter[(Ce = (se = u.value) == null ? void 0 : se.search) == null ? void 0 : Ce.key]) == null ? void 0 : Re.trim()) ?? "", G = _(le ? le.split(",") : []), fe = _(!1), pe = Me(
|
|
2043
|
+
() => {
|
|
2044
|
+
var b, v;
|
|
2045
|
+
return (v = (b = n.options) == null ? void 0 : b.perPageOptions) == null ? void 0 : v.map(
|
|
2046
|
+
(z) => ({
|
|
2047
|
+
label: `${z}`,
|
|
2048
|
+
value: z
|
|
2049
|
+
})
|
|
2050
|
+
);
|
|
2051
|
+
}
|
|
2052
|
+
), he = Me(() => {
|
|
2053
|
+
let b = [
|
|
2054
|
+
{
|
|
2055
|
+
label: "10",
|
|
2056
|
+
value: 10
|
|
2057
|
+
},
|
|
2058
|
+
{
|
|
2059
|
+
label: "15",
|
|
2060
|
+
value: 15
|
|
2061
|
+
},
|
|
2062
|
+
{
|
|
2063
|
+
label: "20",
|
|
2064
|
+
value: 20
|
|
2065
|
+
},
|
|
2066
|
+
{
|
|
2067
|
+
label: "25",
|
|
2068
|
+
value: 25
|
|
2069
|
+
},
|
|
2070
|
+
{
|
|
2071
|
+
label: "40",
|
|
2072
|
+
value: 40
|
|
2073
|
+
},
|
|
2074
|
+
{
|
|
2075
|
+
label: "50",
|
|
2076
|
+
value: 50
|
|
2077
|
+
},
|
|
2078
|
+
{
|
|
2079
|
+
label: "75",
|
|
2080
|
+
value: 75
|
|
2081
|
+
},
|
|
2082
|
+
{
|
|
2083
|
+
label: "99",
|
|
2084
|
+
value: 99
|
|
2085
|
+
}
|
|
2086
|
+
], v = pe.value ?? b;
|
|
2087
|
+
if (a.value) {
|
|
2088
|
+
const z = a.value.total < 100 ? a.value.total : 100;
|
|
2089
|
+
z > 10 && (v = v.filter((ie) => ie.value <= z));
|
|
2090
|
+
}
|
|
2091
|
+
return [...new Set(v)];
|
|
2092
|
+
}), B = Me(() => {
|
|
2093
|
+
var b;
|
|
2094
|
+
return ((b = n.selected) == null ? void 0 : b.length) > 0;
|
|
2095
|
+
}), ae = (b) => {
|
|
2096
|
+
!b.trim() || G.value.includes(b) || (u.value ? G.value.push(b) : G.value = [b], ye(), l("search-query-changed", b));
|
|
2097
|
+
}, De = (b) => {
|
|
2098
|
+
G.value = G.value.filter((v) => v !== b), ye();
|
|
2099
|
+
}, xe = n.filter;
|
|
2100
|
+
!xe && a ? xe.page = 1 : !xe && i && (xe.cursor = "");
|
|
2101
|
+
const F = _(xe), V = () => {
|
|
2102
|
+
var v, z, ie, ue, ge, U, Te, O;
|
|
2103
|
+
G.value = [];
|
|
2104
|
+
const b = {};
|
|
2105
|
+
u.value ? xe.page = 1 : xe.cursor = "", (z = (v = u.value) == null ? void 0 : v.per_page) != null && z.key ? b[(ue = (ie = u.value) == null ? void 0 : ie.per_page) == null ? void 0 : ue.key] = k.value : b.per_page = k.value, (U = (ge = u.value) == null ? void 0 : ge.tabs) != null && U.key ? b[(O = (Te = u.value) == null ? void 0 : Te.tabs) == null ? void 0 : O.key] = m.value : b.tabs = m.value, F.value = b, ye();
|
|
2106
|
+
}, Y = () => {
|
|
2107
|
+
ye(null, D.value);
|
|
2108
|
+
}, ye = (b = null, v = !1, z = "") => {
|
|
2109
|
+
var ie, ue, ge;
|
|
2110
|
+
a.value && !v && (D.value = 1), a.value ? F.value.page = D.value : F.value.cursor = z, (ie = u.value) != null && ie.per_page ? F.value[u.value.per_page.key] = k.value : F.value.per_page = k.value, (ue = u.value) != null && ue.tabs && (F.value[u.value.tabs.key] = m.value), (ge = u.value) != null && ge.search && (F.value[u.value.search.key] = G.value.join()), b && (y.value = !1, F.value = { ...F.value, ...b }, Object.keys(F.value).forEach((U) => {
|
|
2111
|
+
Array.isArray(F.value[U]) && F.value[U].length === 0 && delete F.value[U];
|
|
2112
|
+
})), l("update:filter", F.value);
|
|
2113
|
+
}, Ve = (b, v) => {
|
|
2114
|
+
ye(b), l("filter-removed", v);
|
|
2115
|
+
}, L = (b) => {
|
|
2116
|
+
let v = [];
|
|
2117
|
+
return b.forEach((z) => {
|
|
2118
|
+
v.push(z.key);
|
|
2119
|
+
}), v;
|
|
2120
|
+
}, E = Me(() => {
|
|
2121
|
+
if (F.value) {
|
|
2122
|
+
let b = [];
|
|
2123
|
+
return Object.keys(F.value).forEach((v) => {
|
|
2124
|
+
var ge, U, Te, O, h, W, Fe, Ye, Ke, et, at;
|
|
2125
|
+
let z = (U = (ge = u.value) == null ? void 0 : ge.tabs) == null ? void 0 : U.key;
|
|
2126
|
+
const ie = (O = (Te = u.value) == null ? void 0 : Te.search) == null ? void 0 : O.key, ue = ((W = (h = u.value) == null ? void 0 : h.per_page) == null ? void 0 : W.key) ?? "per_page";
|
|
2127
|
+
if ((Fe = u.value.form) == null || Fe.find((Pe) => {
|
|
2128
|
+
Pe.name === z && (z = "");
|
|
2129
|
+
}), v !== "page" && v !== "cursor" && v !== ue && v !== z && v !== ie) {
|
|
2130
|
+
let Pe = null, me = (Ye = u.value.form) == null ? void 0 : Ye.find((tt) => {
|
|
2131
|
+
if (typeof tt.name == "object") {
|
|
2132
|
+
let je = !1;
|
|
2133
|
+
return tt.name.forEach((Ze) => {
|
|
2134
|
+
Ze.key === v && (je = !0, Pe = L(tt.name));
|
|
2135
|
+
}), je;
|
|
2136
|
+
} else
|
|
2137
|
+
return tt.name === v;
|
|
2138
|
+
}), Ue = "";
|
|
2139
|
+
if (me && F.value[v]) {
|
|
2140
|
+
if (typeof me.name == "object" ? (Ke = me.name) == null || Ke.forEach((je) => {
|
|
2141
|
+
Ue && (Ue += " - "), Ue += F.value[je.key];
|
|
2142
|
+
}) : Ue = F.value[v], me.props.options && (Ue = (me.props.multiple ? F.value[v] : [F.value[v]]).map(
|
|
2143
|
+
(Ze) => {
|
|
2144
|
+
var Yt;
|
|
2145
|
+
return (Yt = me.props.options.find(({ value: c }) => c === Ze)) == null ? void 0 : Yt.label;
|
|
2146
|
+
}
|
|
2147
|
+
).join(", ")), me.type === "RangeInput" && Array.isArray(F.value[v]) && (Ue = F.value[v][0].toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",") + " - " + F.value[v][1].toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",")), me.type === "DatePicker")
|
|
2148
|
+
if (((et = me == null ? void 0 : me.props) == null ? void 0 : et.type) === "range" && me.name && me.name[1]) {
|
|
2149
|
+
const je = fn(F.value[me.name[0].key]).format("MM/DD/YYYY"), Ze = fn(F.value[me.name[1].key]).format("MM/DD/YYYY");
|
|
2150
|
+
Ue = je === Ze ? je : je + " - " + Ze;
|
|
2151
|
+
} else Ue = fn(F.value[me.name]).format("MM/DD/YYYY");
|
|
2152
|
+
let tt = `${(at = me == null ? void 0 : me.props) == null ? void 0 : at.label} : ${Ue}`;
|
|
2153
|
+
me && me.name && typeof me.name == "object" && b.find((Ze) => Ze.name === Pe[0]) && (tt = ""), b.push({
|
|
2154
|
+
label: tt,
|
|
2155
|
+
name: v,
|
|
2156
|
+
multiNames: Pe
|
|
2157
|
+
});
|
|
2158
|
+
}
|
|
2159
|
+
}
|
|
2160
|
+
}), b;
|
|
2161
|
+
}
|
|
2162
|
+
return [];
|
|
2163
|
+
}), x = (b) => {
|
|
2164
|
+
var v, z, ie, ue, ge, U;
|
|
2165
|
+
return ((U = (ge = (ue = (ie = F.value) == null ? void 0 : ie[(z = (v = u.value) == null ? void 0 : v.columnEdit) == null ? void 0 : z.key]) == null ? void 0 : ue.active) == null ? void 0 : ge.find((Te) => Te.key === b)) == null ? void 0 : U.isActive) ?? !0;
|
|
2166
|
+
}, T = ({ fixedHeaders: b, activeHeaders: v, isOnMount: z }) => {
|
|
2167
|
+
var ie, ue, ge, U;
|
|
2168
|
+
if (F.value[(ue = (ie = u.value) == null ? void 0 : ie.columnEdit) == null ? void 0 : ue.key].fixed = b, F.value[(U = (ge = u.value) == null ? void 0 : ge.columnEdit) == null ? void 0 : U.key].active = v, r.value = [...b, ...v], !z) {
|
|
2169
|
+
const Te = Ql(b, v);
|
|
2170
|
+
Wl(u.value.columnEdit.localStorageKey, Te);
|
|
2171
|
+
}
|
|
2172
|
+
}, C = () => {
|
|
2173
|
+
var b, v, z, ie, ue, ge;
|
|
2174
|
+
if ((v = (b = u.value) == null ? void 0 : b.columnEdit) != null && v.localStorageKey) {
|
|
2175
|
+
const U = sl(u.value.columnEdit.localStorageKey);
|
|
2176
|
+
if (U) {
|
|
2177
|
+
const { fixed: Te, active: O } = ul(
|
|
2178
|
+
U,
|
|
2179
|
+
s.value.headers,
|
|
2180
|
+
u.value.columnEdit.localStorageKey
|
|
2181
|
+
);
|
|
2182
|
+
F.value[(ie = (z = u.value) == null ? void 0 : z.columnEdit) == null ? void 0 : ie.key].fixed = Te, F.value[(ge = (ue = u.value) == null ? void 0 : ue.columnEdit) == null ? void 0 : ge.key].active = O, r.value = [...Te, ...O];
|
|
2183
|
+
}
|
|
2184
|
+
}
|
|
2185
|
+
};
|
|
2186
|
+
return Tt(() => {
|
|
2187
|
+
C();
|
|
2188
|
+
}), (b, v) => {
|
|
2189
|
+
var z, ie, ue, ge;
|
|
2190
|
+
return w(), N("div", ja, [
|
|
2191
|
+
s.value ? (w(), ce(M(Ml), {
|
|
2192
|
+
key: 0,
|
|
2193
|
+
selected: e.selected,
|
|
2194
|
+
"row-key": e.rowKey,
|
|
2195
|
+
options: o.value,
|
|
2196
|
+
"is-loading": e.isLoading,
|
|
2197
|
+
"loading-rows": k.value,
|
|
2198
|
+
"row-class": e.rowClass,
|
|
2199
|
+
"row-link": e.rowLink,
|
|
2200
|
+
"is-sticky": s.value.isSticky,
|
|
2201
|
+
"is-borderless": s.value.isBorderless,
|
|
2202
|
+
"onUpdate:selected": v[7] || (v[7] = (U) => b.$emit("update:selected", U)),
|
|
2203
|
+
"onClick:row": v[8] || (v[8] = (U) => b.$emit("click:row", U)),
|
|
2204
|
+
"onHover:cell": v[9] || (v[9] = (U) => b.$emit("hover:cell", U))
|
|
2205
|
+
}, al({
|
|
2206
|
+
after: be(() => [
|
|
2207
|
+
Qe(b.$slots, "after")
|
|
2208
|
+
]),
|
|
2209
|
+
empty: be(() => [
|
|
2210
|
+
Qe(b.$slots, "empty")
|
|
2211
|
+
]),
|
|
2212
|
+
"table-header": be((U) => [
|
|
2213
|
+
Qe(b.$slots, "table-header", Pn(Ln(U)))
|
|
2214
|
+
]),
|
|
2215
|
+
"table-body": be((U) => [
|
|
2216
|
+
Qe(b.$slots, "table-body", Pn(Ln(U)))
|
|
2217
|
+
]),
|
|
2218
|
+
_: 2
|
|
2219
|
+
}, [
|
|
2220
|
+
b.$slots.before || (z = u.value) != null && z.search || (ie = u.value) != null && ie.form || (ue = u.value) != null && ue.tabs ? {
|
|
2221
|
+
name: "before",
|
|
2222
|
+
fn: be(() => {
|
|
2223
|
+
var U, Te, O, h;
|
|
2224
|
+
return [
|
|
2225
|
+
Qe(b.$slots, "before"),
|
|
2226
|
+
(U = u.value) != null && U.search || (Te = u.value) != null && Te.form || (O = u.value) != null && O.tabs ? (w(), N("div", Ha, [
|
|
2227
|
+
B.value ? (w(), N("div", Ya, [
|
|
2228
|
+
Qe(b.$slots, "bulk-actions", { selectedRows: e.selected })
|
|
2229
|
+
])) : (w(), N("div", Ua, [
|
|
2230
|
+
(h = u.value) != null && h.tabs ? (w(), ce(M(_l), {
|
|
2231
|
+
key: 0,
|
|
2232
|
+
modelValue: m.value,
|
|
2233
|
+
"onUpdate:modelValue": [
|
|
2234
|
+
v[0] || (v[0] = (W) => m.value = W),
|
|
2235
|
+
v[1] || (v[1] = (W) => ye(null))
|
|
2236
|
+
],
|
|
2237
|
+
tabs: u.value.tabs.options,
|
|
2238
|
+
variant: "pills"
|
|
2239
|
+
}, null, 8, ["modelValue", "tabs"])) : K("", !0)
|
|
2240
|
+
])),
|
|
2241
|
+
Qe(b.$slots, "filter-options", {}, () => {
|
|
2242
|
+
var W, Fe, Ye, Ke, et, at;
|
|
2243
|
+
return [
|
|
2244
|
+
(W = u.value) != null && W.search || (Fe = u.value) != null && Fe.form || (Ye = u.value) != null && Ye.columnEdit ? (w(), N("div", {
|
|
2245
|
+
key: 0,
|
|
2246
|
+
class: we([
|
|
2247
|
+
"flex gap-3 absolute ml-auto bg-oc-bg-light right-4 max-w-[calc(100%-24px)]",
|
|
2248
|
+
u.value ? fe.value ? "md:w-fit w-full" : "" : "w-full justify-end"
|
|
2249
|
+
])
|
|
2250
|
+
}, [
|
|
2251
|
+
(Ke = u.value) != null && Ke.search ? (w(), ce(M(qa), {
|
|
2252
|
+
key: 0,
|
|
2253
|
+
"is-search-only": !u.value.tabs || u.value.isSearchOnly,
|
|
2254
|
+
onAddQuery: ae,
|
|
2255
|
+
onToggle: v[2] || (v[2] = (Pe) => fe.value = Pe)
|
|
2256
|
+
}, null, 8, ["is-search-only"])) : K("", !0),
|
|
2257
|
+
(et = u.value) != null && et.form ? (w(), ce(M(rn), {
|
|
2258
|
+
key: 1,
|
|
2259
|
+
modelValue: y.value,
|
|
2260
|
+
"onUpdate:modelValue": v[6] || (v[6] = (Pe) => y.value = Pe),
|
|
2261
|
+
distance: 9,
|
|
2262
|
+
placement: "bottom-end",
|
|
2263
|
+
"is-attach-to-body": ""
|
|
2264
|
+
}, {
|
|
2265
|
+
menu: be(() => [
|
|
2266
|
+
y.value ? (w(), ce(M(eo), {
|
|
2267
|
+
key: 0,
|
|
2268
|
+
id: e.id,
|
|
2269
|
+
"json-form": u.value.form ?? [],
|
|
2270
|
+
grid: u.value.grid ?? null,
|
|
2271
|
+
values: n.filter,
|
|
2272
|
+
actions: u.value.actions,
|
|
2273
|
+
onApplyFilter: v[3] || (v[3] = (Pe) => ye(Pe)),
|
|
2274
|
+
onFilterFieldsChanged: v[4] || (v[4] = (Pe) => l("filter-fields-changed", Pe)),
|
|
2275
|
+
onCancel: v[5] || (v[5] = (Pe) => y.value = !1)
|
|
2276
|
+
}, {
|
|
2277
|
+
default: be(({ errors: Pe, values: me, jsonForm: Ue, updateForm: tt }) => [
|
|
2278
|
+
Qe(b.$slots, "custom-filter-form", {
|
|
2279
|
+
errors: Pe,
|
|
2280
|
+
values: me,
|
|
2281
|
+
jsonForm: Ue,
|
|
2282
|
+
updateFilter: tt
|
|
2283
|
+
})
|
|
2284
|
+
]),
|
|
2285
|
+
_: 3
|
|
2286
|
+
}, 8, ["id", "json-form", "grid", "values", "actions"])) : K("", !0)
|
|
2287
|
+
]),
|
|
2288
|
+
default: be(() => [
|
|
2289
|
+
q(M(It), {
|
|
2290
|
+
"is-active": y.value,
|
|
2291
|
+
variant: "secondary",
|
|
2292
|
+
"left-icon": "filter"
|
|
2293
|
+
}, null, 8, ["is-active"])
|
|
2294
|
+
]),
|
|
2295
|
+
_: 3
|
|
2296
|
+
}, 8, ["modelValue"])) : K("", !0),
|
|
2297
|
+
u.value.columnEdit ? (w(), ce(Ba, {
|
|
2298
|
+
key: 2,
|
|
2299
|
+
options: F.value.columnEdit,
|
|
2300
|
+
headers: ((at = s.value) == null ? void 0 : at.headers) || [],
|
|
2301
|
+
"local-key": u.value.columnEdit.localStorageKey,
|
|
2302
|
+
onUpdateOrder: T
|
|
2303
|
+
}, null, 8, ["options", "headers", "local-key"])) : K("", !0)
|
|
2304
|
+
], 2)) : K("", !0)
|
|
2305
|
+
];
|
|
2306
|
+
})
|
|
2307
|
+
])) : K("", !0),
|
|
2308
|
+
q(M(za), {
|
|
2309
|
+
filters: E.value,
|
|
2310
|
+
queries: G.value,
|
|
2311
|
+
class: "border-t border-oc-gray-200",
|
|
2312
|
+
onRemoveQuery: De,
|
|
2313
|
+
onRemoveAll: V,
|
|
2314
|
+
onRemoveFilter: Ve
|
|
2315
|
+
}, null, 8, ["filters", "queries"])
|
|
2316
|
+
];
|
|
2317
|
+
}),
|
|
2318
|
+
key: "0"
|
|
2319
|
+
} : void 0,
|
|
2320
|
+
vt((ge = s.value) == null ? void 0 : ge.headers, (U, Te) => ({
|
|
2321
|
+
name: U.key,
|
|
2322
|
+
fn: be(({ data: O, item: h }) => [
|
|
2323
|
+
Qe(b.$slots, U.key, {
|
|
2324
|
+
data: O,
|
|
2325
|
+
item: h
|
|
2326
|
+
})
|
|
2327
|
+
])
|
|
2328
|
+
}))
|
|
2329
|
+
]), 1032, ["selected", "row-key", "options", "is-loading", "loading-rows", "row-class", "row-link", "is-sticky", "is-borderless"])) : K("", !0),
|
|
2330
|
+
Qe(b.$slots, "before-pagination"),
|
|
2331
|
+
a.value || i.value ? (w(), N("div", {
|
|
2332
|
+
key: 1,
|
|
2333
|
+
class: we(["flex gap-3 items-center", a.value && a.value.last_page === 1 ? "justify-end" : ""])
|
|
2334
|
+
}, [
|
|
2335
|
+
a.value && !p.value ? (w(), ce(M(Fl), {
|
|
2336
|
+
key: 0,
|
|
2337
|
+
modelValue: D.value,
|
|
2338
|
+
"onUpdate:modelValue": [
|
|
2339
|
+
v[10] || (v[10] = (U) => D.value = U),
|
|
2340
|
+
Y
|
|
2341
|
+
],
|
|
2342
|
+
class: "justify-center",
|
|
2343
|
+
"max-page": a.value.last_page,
|
|
2344
|
+
strategy: a.value.strategy,
|
|
2345
|
+
"total-visible": "5"
|
|
2346
|
+
}, null, 8, ["modelValue", "max-page", "strategy"])) : K("", !0),
|
|
2347
|
+
i.value ? (w(), N("div", Xa, [
|
|
2348
|
+
q(M(Rn), {
|
|
2349
|
+
disabled: !i.value.prev,
|
|
2350
|
+
onClick: v[11] || (v[11] = (U) => i.value.prev ? ye(null, !1, i.value.prev) : null)
|
|
2351
|
+
}, null, 8, ["disabled"]),
|
|
2352
|
+
q(M(Rn), {
|
|
2353
|
+
disabled: !i.value.next,
|
|
2354
|
+
"is-next": "",
|
|
2355
|
+
onClick: v[12] || (v[12] = (U) => i.value.next ? ye(null, !1, i.value.next) : null)
|
|
2356
|
+
}, null, 8, ["disabled"])
|
|
2357
|
+
])) : K("", !0),
|
|
2358
|
+
g.value ? K("", !0) : (w(), N("div", Qa, [
|
|
2359
|
+
q(M(il), {
|
|
2360
|
+
modelValue: k.value,
|
|
2361
|
+
"onUpdate:modelValue": [
|
|
2362
|
+
v[13] || (v[13] = (U) => k.value = U),
|
|
2363
|
+
v[14] || (v[14] = (U) => ye(null))
|
|
2364
|
+
],
|
|
2365
|
+
label: "Item per page",
|
|
2366
|
+
"is-inline-label": "",
|
|
2367
|
+
"popper-options": { placement: "auto" },
|
|
2368
|
+
options: he.value
|
|
2369
|
+
}, null, 8, ["modelValue", "options"])
|
|
2370
|
+
]))
|
|
2371
|
+
], 2)) : K("", !0)
|
|
2372
|
+
]);
|
|
2373
|
+
};
|
|
2374
|
+
}
|
|
2375
|
+
}, Wa = { class: "flex gap-x-4" }, qa = {
|
|
2376
|
+
__name: "OcFilterSearch",
|
|
2377
|
+
props: {
|
|
2378
|
+
isSearchOnly: Boolean
|
|
2379
|
+
},
|
|
2380
|
+
emits: {
|
|
2381
|
+
addQuery: [],
|
|
2382
|
+
toggle: []
|
|
2383
|
+
},
|
|
2384
|
+
setup(e, { emit: t }) {
|
|
2385
|
+
const n = t, l = _(!1), a = _(""), i = _(), r = async () => {
|
|
2386
|
+
l.value = !0, n("toggle", l), await ol(), i.value.focus();
|
|
2387
|
+
};
|
|
2388
|
+
return (s, o) => (w(), N(We, null, [
|
|
2389
|
+
P("div", {
|
|
2390
|
+
class: we(["w-full", l.value || e.isSearchOnly ? "" : "absolute max-w-0 overflow-hidden"])
|
|
2391
|
+
}, [
|
|
2392
|
+
P("div", Wa, [
|
|
2393
|
+
q(M(xt), {
|
|
2394
|
+
ref_key: "searchInput",
|
|
2395
|
+
ref: i,
|
|
2396
|
+
modelValue: a.value,
|
|
2397
|
+
"onUpdate:modelValue": o[0] || (o[0] = (u) => a.value = u),
|
|
2398
|
+
placeholder: "Search something here",
|
|
2399
|
+
class: "md:min-w-[310px]",
|
|
2400
|
+
icon: "search",
|
|
2401
|
+
onKeyup: o[1] || (o[1] = Tn(
|
|
2402
|
+
() => {
|
|
2403
|
+
s.$emit("addQuery", a.value), a.value = "";
|
|
2404
|
+
},
|
|
2405
|
+
["enter"]
|
|
2406
|
+
))
|
|
2407
|
+
}, null, 8, ["modelValue"]),
|
|
2408
|
+
e.isSearchOnly ? (w(), ce(M(It), {
|
|
2409
|
+
key: 0,
|
|
2410
|
+
label: "Search",
|
|
2411
|
+
variant: "secondary",
|
|
2412
|
+
class: "shrink-0",
|
|
2413
|
+
onClick: o[2] || (o[2] = () => {
|
|
2414
|
+
s.$emit("addQuery", a.value), a.value = "";
|
|
2415
|
+
})
|
|
2416
|
+
})) : (w(), N("span", {
|
|
2417
|
+
key: 1,
|
|
2418
|
+
class: "py-3 text-base cursor-pointer flex normal-case items-center font-medium text-oc-text-400",
|
|
2419
|
+
onClick: o[3] || (o[3] = () => {
|
|
2420
|
+
l.value = !1, s.$emit("toggle", l.value), a.value = "";
|
|
2421
|
+
})
|
|
2422
|
+
}, " Clear "))
|
|
2423
|
+
])
|
|
2424
|
+
], 2),
|
|
2425
|
+
e.isSearchOnly ? K("", !0) : (w(), N("div", {
|
|
2426
|
+
key: 0,
|
|
2427
|
+
class: we(l.value ? "max-w-0 overflow-hidden" : "")
|
|
2428
|
+
}, [
|
|
2429
|
+
l.value ? K("", !0) : (w(), ce(M(It), {
|
|
2430
|
+
key: 0,
|
|
2431
|
+
variant: "secondary",
|
|
2432
|
+
"left-icon": "search",
|
|
2433
|
+
onClick: r
|
|
2434
|
+
}))
|
|
2435
|
+
], 2))
|
|
2436
|
+
], 64));
|
|
2437
|
+
}
|
|
2438
|
+
}, Ga = { class: "flex gap-1 items-center normal-case flex-wrap" }, za = {
|
|
2439
|
+
__name: "OcFilterSearchFor",
|
|
2440
|
+
props: {
|
|
2441
|
+
filters: Object,
|
|
2442
|
+
queries: Object
|
|
2443
|
+
},
|
|
2444
|
+
emits: {
|
|
2445
|
+
removeQuery: [],
|
|
2446
|
+
removeFilter: [],
|
|
2447
|
+
removeAll: []
|
|
2448
|
+
},
|
|
2449
|
+
setup(e, { emit: t }) {
|
|
2450
|
+
const n = e, l = t, a = Me(() => {
|
|
2451
|
+
var s;
|
|
2452
|
+
let r = [];
|
|
2453
|
+
return (s = n.filters) == null || s.forEach((o) => {
|
|
2454
|
+
if (o.multiNames) {
|
|
2455
|
+
const u = r.find((g) => g.name === o.multiNames[0]);
|
|
2456
|
+
u ? u.label = u.label + o.label : r.push(o);
|
|
2457
|
+
} else
|
|
2458
|
+
r.push(o);
|
|
2459
|
+
}), r;
|
|
2460
|
+
}), i = (r, s) => {
|
|
2461
|
+
let o = {};
|
|
2462
|
+
o[r] = "", s ? s.forEach((u) => {
|
|
2463
|
+
let g = {};
|
|
2464
|
+
g[u] = "", l("removeFilter", g, u);
|
|
2465
|
+
}) : l("removeFilter", o, r);
|
|
2466
|
+
};
|
|
2467
|
+
return (r, s) => a.value.length > 0 || e.queries.length > 0 ? (w(), ce(M(Pl), {
|
|
2468
|
+
key: 0,
|
|
2469
|
+
class: "!w-full !justify-start !bg-oc-bg-light"
|
|
2470
|
+
}, {
|
|
2471
|
+
default: be(() => [
|
|
2472
|
+
P("div", Ga, [
|
|
2473
|
+
s[1] || (s[1] = P("span", { class: "pr-2 text-sm font-medium text-oc-text" }, "Search for:", -1)),
|
|
2474
|
+
(w(!0), N(We, null, vt(e.queries, (o) => (w(), ce(M(dn), {
|
|
2475
|
+
key: o,
|
|
2476
|
+
variant: "accent-1",
|
|
2477
|
+
closable: "",
|
|
2478
|
+
label: o,
|
|
2479
|
+
onRemove: (u) => r.$emit("removeQuery", o)
|
|
2480
|
+
}, null, 8, ["label", "onRemove"]))), 128)),
|
|
2481
|
+
(w(!0), N(We, null, vt(a.value, (o) => (w(), ce(M(dn), {
|
|
2482
|
+
key: o.name,
|
|
2483
|
+
variant: "accent-1",
|
|
2484
|
+
closable: "",
|
|
2485
|
+
label: o.label,
|
|
2486
|
+
onRemove: (u) => i(o.name, o.multiNames)
|
|
2487
|
+
}, null, 8, ["label", "onRemove"]))), 128)),
|
|
2488
|
+
q(M(dn), {
|
|
2489
|
+
variant: "gray",
|
|
2490
|
+
class: "cursor-pointer",
|
|
2491
|
+
label: "Clear all",
|
|
2492
|
+
onClick: s[0] || (s[0] = (o) => r.$emit("removeAll"))
|
|
2493
|
+
})
|
|
2494
|
+
])
|
|
2495
|
+
]),
|
|
2496
|
+
_: 1
|
|
2497
|
+
})) : K("", !0);
|
|
2498
|
+
}
|
|
2499
|
+
}, Ka = { class: "flex w-[326px] flex-col gap-y-5" }, Za = { class: "max-h-[500px] overflow-y-auto p-5" }, Ja = { class: "flex gap-x-5 px-5 pb-5" }, eo = {
|
|
2500
|
+
__name: "OcFilterForm",
|
|
2501
|
+
props: {
|
|
2502
|
+
id: {
|
|
2503
|
+
type: String,
|
|
2504
|
+
required: !0
|
|
2505
|
+
},
|
|
2506
|
+
jsonForm: {
|
|
2507
|
+
type: Array
|
|
2508
|
+
},
|
|
2509
|
+
values: {
|
|
2510
|
+
type: Object
|
|
2511
|
+
},
|
|
2512
|
+
actions: {
|
|
2513
|
+
type: Object
|
|
2514
|
+
},
|
|
2515
|
+
grid: {
|
|
2516
|
+
type: Object,
|
|
2517
|
+
default: null
|
|
2518
|
+
}
|
|
2519
|
+
},
|
|
2520
|
+
emits: ["applyFilter", "cancel", "filter-fields-changed"],
|
|
2521
|
+
setup(e, { emit: t }) {
|
|
2522
|
+
const n = e, l = t, a = _({}), i = _({}), r = _([]), s = (m) => {
|
|
2523
|
+
r.value.findIndex((k) => k === m) >= 0 || r.value.push(m);
|
|
2524
|
+
}, o = (m, D = null) => {
|
|
2525
|
+
typeof m.name == "object" ? m.name.forEach((k, le) => {
|
|
2526
|
+
a.value[k.key] = D[le];
|
|
2527
|
+
}) : a.value[m.name] = D, s(m.name);
|
|
2528
|
+
}, u = Me(() => Object.values(a.value).length > 0), g = Me(() => {
|
|
2529
|
+
var m, D;
|
|
2530
|
+
return ((D = (m = n.actions) == null ? void 0 : m.applyButton) == null ? void 0 : D.label) || "Apply";
|
|
2531
|
+
}), p = Me(() => {
|
|
2532
|
+
var m, D;
|
|
2533
|
+
return ((D = (m = n.actions) == null ? void 0 : m.cancelButton) == null ? void 0 : D.label) || "Cancel";
|
|
2534
|
+
});
|
|
2535
|
+
Tt(() => {
|
|
2536
|
+
a.value = { ...n.values };
|
|
2537
|
+
});
|
|
2538
|
+
const y = () => {
|
|
2539
|
+
l("applyFilter", a.value), l("filter-fields-changed", r.value), r.value = [];
|
|
2540
|
+
};
|
|
2541
|
+
return (m, D) => (w(), N("div", Ka, [
|
|
2542
|
+
Qe(m.$slots, "default", {
|
|
2543
|
+
errors: i.value,
|
|
2544
|
+
values: a.value,
|
|
2545
|
+
jsonForm: e.jsonForm,
|
|
2546
|
+
updateForm: o
|
|
2547
|
+
}, () => [
|
|
2548
|
+
P("div", Za, [
|
|
2549
|
+
q(M(Ll), {
|
|
2550
|
+
id: `filter-form-${e.id}`,
|
|
2551
|
+
class: "grid gap-5",
|
|
2552
|
+
errors: i.value,
|
|
2553
|
+
values: a.value,
|
|
2554
|
+
"json-form": e.jsonForm,
|
|
2555
|
+
grid: e.grid ?? null,
|
|
2556
|
+
onOnUpdate: o
|
|
2557
|
+
}, null, 8, ["id", "errors", "values", "json-form", "grid"])
|
|
2558
|
+
])
|
|
2559
|
+
]),
|
|
2560
|
+
P("div", Ja, [
|
|
2561
|
+
q(M(It), {
|
|
2562
|
+
class: "w-full",
|
|
2563
|
+
variant: "secondary",
|
|
2564
|
+
label: p.value,
|
|
2565
|
+
onClick: D[0] || (D[0] = (k) => m.$emit("cancel"))
|
|
2566
|
+
}, null, 8, ["label"]),
|
|
2567
|
+
q(M(It), {
|
|
2568
|
+
class: "w-full",
|
|
2569
|
+
"is-disabled": !u.value,
|
|
2570
|
+
label: g.value,
|
|
2571
|
+
onClick: y
|
|
2572
|
+
}, null, 8, ["is-disabled", "label"])
|
|
2573
|
+
])
|
|
2574
|
+
]));
|
|
2575
|
+
}
|
|
2576
|
+
}, to = { key: 1 }, no = {
|
|
2577
|
+
__name: "OcColorPicker",
|
|
2578
|
+
props: {
|
|
2579
|
+
modelValue: {
|
|
2580
|
+
type: String,
|
|
2581
|
+
default: ""
|
|
2582
|
+
},
|
|
2583
|
+
variant: {
|
|
2584
|
+
type: String,
|
|
2585
|
+
default: "solid"
|
|
2586
|
+
},
|
|
2587
|
+
hideOpacity: Boolean,
|
|
2588
|
+
hideInputColor: Boolean,
|
|
2589
|
+
presetColors: {
|
|
2590
|
+
type: Array
|
|
2591
|
+
}
|
|
2592
|
+
},
|
|
2593
|
+
emits: ["update:model-value"],
|
|
2594
|
+
setup(e, { emit: t }) {
|
|
2595
|
+
const n = e, l = t, a = _(!1), i = _(n.modelValue), r = (k) => {
|
|
2596
|
+
k && (i.value = k, l("update:model-value", k));
|
|
2597
|
+
}, s = Me(() => n.variant === "gradient" ? {
|
|
2598
|
+
class: "w-[20px] h-[20px] hide-svg-icon",
|
|
2599
|
+
style: {
|
|
2600
|
+
background: i.value
|
|
2601
|
+
}
|
|
2602
|
+
} : {
|
|
2603
|
+
style: {
|
|
2604
|
+
color: i.value
|
|
2605
|
+
}
|
|
2606
|
+
}), o = _(), u = _([]), g = () => {
|
|
2607
|
+
u.value.length > 8 && (u.value = u.value.filter((k, le) => le < 8)), localStorage.setItem("ck-cp-local-color-list", JSON.stringify(u.value));
|
|
2608
|
+
};
|
|
2609
|
+
let p = localStorage.getItem("ck-cp-local-color-list");
|
|
2610
|
+
p && (u.value = [...new Set(JSON.parse(p))], g());
|
|
2611
|
+
const y = (k) => {
|
|
2612
|
+
if (!k && i.value)
|
|
2613
|
+
if (u.value.find((G) => G === i.value))
|
|
2614
|
+
u.value = [
|
|
2615
|
+
i.value,
|
|
2616
|
+
...u.value.filter((G) => G !== i.value)
|
|
2617
|
+
], g();
|
|
2618
|
+
else {
|
|
2619
|
+
u.value.length >= 9 && u.value.pop();
|
|
2620
|
+
let G = i.value;
|
|
2621
|
+
u.value.unshift(G), g();
|
|
2622
|
+
}
|
|
2623
|
+
}, m = _(!1), D = (k) => {
|
|
2624
|
+
i.value = k, l("update:model-value", k), a.value = !1;
|
|
2625
|
+
};
|
|
2626
|
+
return (k, le) => (w(), ce(M(rl), {
|
|
2627
|
+
class: we(e.hideInputColor ? "w-[40px]" : ""),
|
|
2628
|
+
onClick: le[1] || (le[1] = () => {
|
|
2629
|
+
var G;
|
|
2630
|
+
return (G = o.value) == null ? void 0 : G.toggleDropdown();
|
|
2631
|
+
})
|
|
2632
|
+
}, {
|
|
2633
|
+
default: be(() => [
|
|
2634
|
+
q(M(rn), {
|
|
2635
|
+
ref_key: "dropdownRef",
|
|
2636
|
+
ref: o,
|
|
2637
|
+
modelValue: a.value,
|
|
2638
|
+
"onUpdate:modelValue": [
|
|
2639
|
+
le[0] || (le[0] = (G) => a.value = G),
|
|
2640
|
+
y
|
|
2641
|
+
],
|
|
2642
|
+
"max-menu-height": 800,
|
|
2643
|
+
placement: "auto"
|
|
2644
|
+
}, {
|
|
2645
|
+
menu: be(() => [
|
|
2646
|
+
m.value ? K("", !0) : (w(), ce(M(zo), {
|
|
2647
|
+
key: 0,
|
|
2648
|
+
variant: e.variant,
|
|
2649
|
+
"show-alpha": !e.hideOpacity,
|
|
2650
|
+
type: e.hideOpacity ? "HEX" : "HEX8",
|
|
2651
|
+
"model-value": e.modelValue,
|
|
2652
|
+
"last-used-colors": u.value,
|
|
2653
|
+
"preset-colors": e.presetColors,
|
|
2654
|
+
"onUpdate:modelValue": r,
|
|
2655
|
+
onLastUsedPick: D
|
|
2656
|
+
}, null, 8, ["variant", "show-alpha", "type", "model-value", "last-used-colors", "preset-colors"]))
|
|
2657
|
+
]),
|
|
2658
|
+
default: be(() => [
|
|
2659
|
+
e.hideInputColor ? (w(), N("div", to, [
|
|
2660
|
+
Qe(k.$slots, "picker-icon", {}, () => [
|
|
2661
|
+
q(M(Ee), {
|
|
2662
|
+
class: "cursor-pointer",
|
|
2663
|
+
style: lt(`color: ${i.value}`),
|
|
2664
|
+
name: "drop"
|
|
2665
|
+
}, null, 8, ["style"])
|
|
2666
|
+
])
|
|
2667
|
+
])) : (w(), ce(M(xt), {
|
|
2668
|
+
key: 0,
|
|
2669
|
+
"model-value": i.value,
|
|
2670
|
+
icon: "drop",
|
|
2671
|
+
"icon-props": s.value,
|
|
2672
|
+
placeholder: "#FFFFFF",
|
|
2673
|
+
"onUpdate:modelValue": r
|
|
2674
|
+
}, al({ _: 2 }, [
|
|
2675
|
+
k.$slots.leading ? {
|
|
2676
|
+
name: "leading",
|
|
2677
|
+
fn: be(() => [
|
|
2678
|
+
Qe(k.$slots, "leading")
|
|
2679
|
+
]),
|
|
2680
|
+
key: "0"
|
|
2681
|
+
} : void 0
|
|
2682
|
+
]), 1032, ["model-value", "icon-props"]))
|
|
2683
|
+
]),
|
|
2684
|
+
_: 3
|
|
2685
|
+
}, 8, ["modelValue"])
|
|
2686
|
+
]),
|
|
2687
|
+
_: 3
|
|
2688
|
+
}, 8, ["class"]));
|
|
2689
|
+
}
|
|
2690
|
+
}, lo = ["id"], ao = { class: "flex items-center gap-x-3 px-5" }, oo = { class: "flex items-center gap-x-5 cursor-pointer" }, io = { class: "flex flex-col py-2 overflow-hidden" }, ro = ["onClick"], so = { class: "flex gap-x-3 items-center px-5" }, uo = { class: "flex items-center gap-x-3 px-5" }, co = { class: "flex gap-x-3 items-center px-5" }, fo = { class: "flex gap-x-3 items-center px-5" }, po = { class: "flex items-center" }, go = { class: "grid cursor-pointer px-5" }, mo = {
|
|
2691
|
+
key: 5,
|
|
2692
|
+
class: "flex gap-x-3 items-center px-5"
|
|
2693
|
+
}, vo = { class: "flex" }, ho = { class: "mt-1 mx-2 cursor-pointer" }, ui = {
|
|
2694
|
+
__name: "OcTextEditor",
|
|
2695
|
+
props: {
|
|
2696
|
+
/**
|
|
2697
|
+
* The font sizes of the editor.
|
|
2698
|
+
*/
|
|
2699
|
+
fontSizes: { type: Array, required: !0 },
|
|
2700
|
+
/**
|
|
2701
|
+
* The initial font size of the editor. (if empty the first item of `fontSizes` will be used, needs to be a value of `fontSizes`)
|
|
2702
|
+
*/
|
|
2703
|
+
initialFontSize: { type: String },
|
|
2704
|
+
modelValue: String,
|
|
2705
|
+
image: String,
|
|
2706
|
+
errorMessage: {
|
|
2707
|
+
type: String,
|
|
2708
|
+
default: ""
|
|
2709
|
+
},
|
|
2710
|
+
label: {
|
|
2711
|
+
type: String,
|
|
2712
|
+
default: ""
|
|
2713
|
+
},
|
|
2714
|
+
hint: {
|
|
2715
|
+
type: String,
|
|
2716
|
+
default: ""
|
|
2717
|
+
},
|
|
2718
|
+
isRequired: {
|
|
2719
|
+
type: Boolean,
|
|
2720
|
+
default: !1
|
|
2721
|
+
},
|
|
2722
|
+
labelIcon: {
|
|
2723
|
+
type: String,
|
|
2724
|
+
default: ""
|
|
2725
|
+
},
|
|
2726
|
+
tooltipText: {
|
|
2727
|
+
type: String,
|
|
2728
|
+
default: ""
|
|
2729
|
+
},
|
|
2730
|
+
tooltipOptions: {
|
|
2731
|
+
type: Object,
|
|
2732
|
+
default: () => ({})
|
|
2733
|
+
},
|
|
2734
|
+
variant: {
|
|
2735
|
+
type: String,
|
|
2736
|
+
validator: (e) => ["default", "text-only"].includes(e),
|
|
2737
|
+
default: "default"
|
|
2738
|
+
},
|
|
2739
|
+
placeholder: {
|
|
2740
|
+
type: String,
|
|
2741
|
+
default: ""
|
|
2742
|
+
}
|
|
2743
|
+
},
|
|
2744
|
+
emits: ["update:modelValue", "update:image"],
|
|
2745
|
+
setup(e, { emit: t }) {
|
|
2746
|
+
const n = e, l = t, a = {
|
|
2747
|
+
default: [
|
|
2748
|
+
"changes",
|
|
2749
|
+
"font-size",
|
|
2750
|
+
"font-style",
|
|
2751
|
+
"link",
|
|
2752
|
+
"image",
|
|
2753
|
+
"quote",
|
|
2754
|
+
"media",
|
|
2755
|
+
"list",
|
|
2756
|
+
"alignment"
|
|
2757
|
+
],
|
|
2758
|
+
"text-only": ["changes", "font-size", "font-style", "link", "quote", "list", "alignment"]
|
|
2759
|
+
}, i = Me(() => a[n.variant]), r = Le.import("attributors/style/size");
|
|
2760
|
+
r.whitelist = n.fontSizes.map((O) => O.value), Le.register(r, !0);
|
|
2761
|
+
const s = Le.import("attributors/style/align");
|
|
2762
|
+
Le.register(s, !0);
|
|
2763
|
+
const o = Le.import("attributors/style/background");
|
|
2764
|
+
Le.register(o, !0);
|
|
2765
|
+
const u = Le.import("attributors/style/color");
|
|
2766
|
+
Le.register(u, !0);
|
|
2767
|
+
const g = Le.import("attributors/style/direction");
|
|
2768
|
+
Le.register(g, !0);
|
|
2769
|
+
const p = Le.import("attributors/style/font");
|
|
2770
|
+
Le.register(p, !0);
|
|
2771
|
+
const y = Le.import("blots/block/embed");
|
|
2772
|
+
class m extends y {
|
|
2773
|
+
}
|
|
2774
|
+
un(m, "blotName", "divider"), un(m, "tagName", "hr"), Le.register(m);
|
|
2775
|
+
const D = () => {
|
|
2776
|
+
if (V.value.getQuill().getSelection(!0)) {
|
|
2777
|
+
const h = V.value.getQuill().getSelection(!0);
|
|
2778
|
+
V.value.getQuill().insertText(h.index, `
|
|
2779
|
+
`, Le.sources.USER), V.value.getQuill().insertEmbed(h.index + 1, "divider", !0, Le.sources.USER), V.value.getQuill().setSelection(h.index + 2, Le.sources.SILENT);
|
|
2780
|
+
}
|
|
2781
|
+
}, k = _(
|
|
2782
|
+
Math.random().toString(36).replace(/[^a-zA-Z]+/g, "")
|
|
2783
|
+
), le = _(!1), G = _(!1), fe = _(!1), pe = _(!1), he = _(!1), B = _(!1), ae = _(!1), De = _(""), xe = _(""), F = _(""), V = _(), Y = _(!1), ye = _(n.image), Ve = (O) => {
|
|
2784
|
+
le.value = V.value.getQuill().history.stack.undo.length > 0, G.value = V.value.getQuill().history.stack.redo.length > 0, fe.value = V.value.getQuill().getFormat().bold, pe.value = V.value.getQuill().getFormat().italic, he.value = V.value.getQuill().getFormat().underline, ae.value = V.value.getQuill().getFormat().blockquote, xe.value = V.value.getQuill().getFormat().list, F.value = V.value.getQuill().getFormat().align;
|
|
2785
|
+
let h = document.createElement("div");
|
|
2786
|
+
h.innerHTML = O, Y.value && (h.innerText ? l("update:modelValue", O || "") : l("update:modelValue", ""), h.remove());
|
|
2787
|
+
}, L = () => {
|
|
2788
|
+
V.value.getQuill().history.undo(), Ve(n.modelValue);
|
|
2789
|
+
}, E = () => {
|
|
2790
|
+
V.value.getQuill().history.redo(), Ve(n.modelValue);
|
|
2791
|
+
}, x = () => {
|
|
2792
|
+
var O;
|
|
2793
|
+
V.value.getQuill().format("bold", !fe.value), (O = V.value.getQuill().getSelection()) != null && O.length || (fe.value = !fe.value);
|
|
2794
|
+
}, T = () => {
|
|
2795
|
+
var O;
|
|
2796
|
+
V.value.getQuill().format("italic", !pe.value), (O = V.value.getQuill().getSelection()) != null && O.length || (pe.value = !pe.value);
|
|
2797
|
+
}, C = () => {
|
|
2798
|
+
var O;
|
|
2799
|
+
V.value.getQuill().format("underline", !he.value), (O = V.value.getQuill().getSelection()) != null && O.length || (he.value = !he.value);
|
|
2800
|
+
}, H = (O) => {
|
|
2801
|
+
V.value.getQuill().format("size", O), De.value = O, B.value = !1;
|
|
2802
|
+
}, j = () => {
|
|
2803
|
+
const O = V.value.getQuill().getSelection();
|
|
2804
|
+
O && O.length > 0 && V.value.getQuill().theme.tooltip.edit();
|
|
2805
|
+
}, re = () => {
|
|
2806
|
+
V.value.getQuill().format("blockquote", !ae.value);
|
|
2807
|
+
}, oe = (O) => {
|
|
2808
|
+
const h = V.value.getQuill().getSelection();
|
|
2809
|
+
h && (V.value.getQuill().clipboard.dangerouslyPasteHTML(h.index, `<img src="${O}" />`), ye.value = O, l("update:image", ye.value));
|
|
2810
|
+
}, Se = () => {
|
|
2811
|
+
V.value.getQuill().getSelection() || V.value.getQuill().setSelection(V.value.getQuill().getLength() - 1);
|
|
2812
|
+
const O = document.createElement("input");
|
|
2813
|
+
O.type = "file", O.accept = "jpg,.jpeg,.png,.webp,.gif", O.onchange = () => {
|
|
2814
|
+
const h = O.files[0], W = new FileReader();
|
|
2815
|
+
W.onload = () => oe(W.result), W.readAsDataURL(h);
|
|
2816
|
+
}, O.click();
|
|
2817
|
+
}, $e = (O) => /^data:image\/(png|jpg|jpeg|gif);base64,/.test(O), se = (O) => {
|
|
2818
|
+
setTimeout(() => {
|
|
2819
|
+
var W;
|
|
2820
|
+
if (O) {
|
|
2821
|
+
const Fe = V.value.getHTML(), Ye = document.createElement("div");
|
|
2822
|
+
Ye.innerHTML = Fe;
|
|
2823
|
+
let Ke = Ye.getElementsByTagName("img");
|
|
2824
|
+
if (Ke && Ke.length > 0)
|
|
2825
|
+
for (let et = 0; et < Ke.length; et++) {
|
|
2826
|
+
const at = (W = Ke[et]) == null ? void 0 : W.getAttribute("src");
|
|
2827
|
+
$e(at) && l("update:image", at);
|
|
2828
|
+
}
|
|
2829
|
+
}
|
|
2830
|
+
}, 100);
|
|
2831
|
+
const { items: h } = O.clipboardData;
|
|
2832
|
+
h.length && h[0].getAsString((W) => {
|
|
2833
|
+
$e(W) && (V.value.getQuill().getSelection() || V.value.getQuill().setSelection(V.value.getQuill().getLength() - 1));
|
|
2834
|
+
});
|
|
2835
|
+
}, Ce = () => {
|
|
2836
|
+
V.value.getQuill().theme.tooltip.edit("video");
|
|
2837
|
+
}, Re = (O) => {
|
|
2838
|
+
V.value.getQuill().format("list", O), xe.value = O;
|
|
2839
|
+
}, b = (O = void 0) => {
|
|
2840
|
+
V.value.getQuill().format("align", O), F.value = O;
|
|
2841
|
+
}, v = _(""), z = () => {
|
|
2842
|
+
V.value.getQuill().format("color", v.value);
|
|
2843
|
+
};
|
|
2844
|
+
Tt(() => {
|
|
2845
|
+
H(n.initialFontSize || n.fontSizes[0].value), Y.value = !0;
|
|
2846
|
+
});
|
|
2847
|
+
const ie = _(100), ue = _(!1), ge = (O) => {
|
|
2848
|
+
var W, Fe;
|
|
2849
|
+
ie.value = O;
|
|
2850
|
+
const h = (W = window.getSelection()) == null ? void 0 : W.focusNode;
|
|
2851
|
+
h && h.nodeName !== "#text" && (V.value.getQuill().format("width", `${ie.value}%`), (Fe = h == null ? void 0 : h.querySelector("img")) == null || Fe.setAttribute("style", "margin:auto;display:block;"));
|
|
2852
|
+
}, U = (O = "left") => {
|
|
2853
|
+
var W, Fe;
|
|
2854
|
+
const h = (W = window.getSelection()) == null ? void 0 : W.focusNode;
|
|
2855
|
+
if (h && h.nodeName !== "#text") {
|
|
2856
|
+
let Ye = "float:left";
|
|
2857
|
+
O == "center" ? Ye = "" : O == "right" && (Ye = "float:right"), (Fe = h == null ? void 0 : h.querySelector("img")) == null || Fe.setAttribute("style", `margin:auto;display:block;${Ye}`);
|
|
2858
|
+
}
|
|
2859
|
+
}, Te = () => {
|
|
2860
|
+
var h;
|
|
2861
|
+
const O = (h = window.getSelection()) == null ? void 0 : h.focusNode;
|
|
2862
|
+
ue.value = O.innerHTML && O.innerHTML.includes("<img");
|
|
2863
|
+
};
|
|
2864
|
+
return (O, h) => (w(), ce(M(rl), {
|
|
2865
|
+
label: e.label,
|
|
2866
|
+
hint: e.hint,
|
|
2867
|
+
"error-message": e.errorMessage,
|
|
2868
|
+
"is-required": e.isRequired,
|
|
2869
|
+
"label-icon": e.labelIcon,
|
|
2870
|
+
"tooltip-text": e.tooltipText,
|
|
2871
|
+
"tooltip-options": e.tooltipOptions
|
|
2872
|
+
}, {
|
|
2873
|
+
default: be(() => [
|
|
2874
|
+
P("div", {
|
|
2875
|
+
class: we(["grid", { "has-error": e.errorMessage }]),
|
|
2876
|
+
onClick: Te
|
|
2877
|
+
}, [
|
|
2878
|
+
k.value ? (w(), ce(M(Ul), {
|
|
2879
|
+
key: 0,
|
|
2880
|
+
id: `#${k.value}`,
|
|
2881
|
+
ref_key: "quill",
|
|
2882
|
+
ref: V,
|
|
2883
|
+
content: e.modelValue,
|
|
2884
|
+
options: {
|
|
2885
|
+
bounds: `#${k.value}`
|
|
2886
|
+
},
|
|
2887
|
+
theme: "snow",
|
|
2888
|
+
"content-type": "html",
|
|
2889
|
+
class: "min-h-[200px]",
|
|
2890
|
+
placeholder: e.placeholder,
|
|
2891
|
+
"onUpdate:content": Ve,
|
|
2892
|
+
onPaste: se
|
|
2893
|
+
}, {
|
|
2894
|
+
toolbar: be(() => [
|
|
2895
|
+
P("div", {
|
|
2896
|
+
id: k.value,
|
|
2897
|
+
class: "flex min-h-[36px] flex-wrap !py-2 !px-3 gap-y-2 rounded-t"
|
|
2898
|
+
}, [
|
|
2899
|
+
i.value.includes("changes") ? (w(), N(We, { key: 0 }, [
|
|
2900
|
+
P("div", ao, [
|
|
2901
|
+
q(M(Ee), {
|
|
2902
|
+
class: we(le.value ? "text-oc-text cursor-pointer" : "text-oc-text-300"),
|
|
2903
|
+
width: "20",
|
|
2904
|
+
height: "20",
|
|
2905
|
+
name: "text-editor/undo",
|
|
2906
|
+
onClick: L
|
|
2907
|
+
}, null, 8, ["class"]),
|
|
2908
|
+
q(M(Ee), {
|
|
2909
|
+
class: we(G.value ? "text-oc-text cursor-pointer" : "text-oc-text-300"),
|
|
2910
|
+
width: "20",
|
|
2911
|
+
height: "20",
|
|
2912
|
+
name: "text-editor/redo",
|
|
2913
|
+
onClick: E
|
|
2914
|
+
}, null, 8, ["class"])
|
|
2915
|
+
]),
|
|
2916
|
+
h[12] || (h[12] = P("div", { class: "border-l border-oc-gray-200" }, null, -1))
|
|
2917
|
+
], 64)) : K("", !0),
|
|
2918
|
+
i.value.includes("font-size") ? (w(), N(We, { key: 1 }, [
|
|
2919
|
+
q(M(rn), {
|
|
2920
|
+
modelValue: B.value,
|
|
2921
|
+
"onUpdate:modelValue": h[0] || (h[0] = (W) => B.value = W),
|
|
2922
|
+
class: "px-5"
|
|
2923
|
+
}, {
|
|
2924
|
+
menu: be(() => [
|
|
2925
|
+
P("div", io, [
|
|
2926
|
+
(w(!0), N(We, null, vt(e.fontSizes, (W) => (w(), N("div", {
|
|
2927
|
+
key: W.value,
|
|
2928
|
+
class: we(["min-w-[120px] cursor-pointer py-2 px-3 hover:bg-oc-gray-50", De.value === W.value ? "font-medium" : ""]),
|
|
2929
|
+
onClick: (Fe) => H(W.value)
|
|
2930
|
+
}, Et(W.label), 11, ro))), 128))
|
|
2931
|
+
])
|
|
2932
|
+
]),
|
|
2933
|
+
default: be(() => {
|
|
2934
|
+
var W;
|
|
2935
|
+
return [
|
|
2936
|
+
P("div", oo, [
|
|
2937
|
+
ft(Et((W = e.fontSizes.find((Fe) => Fe.value === De.value)) == null ? void 0 : W.label) + " ", 1),
|
|
2938
|
+
q(M(Ee), {
|
|
2939
|
+
width: "20",
|
|
2940
|
+
height: "20",
|
|
2941
|
+
name: "chevron-down",
|
|
2942
|
+
class: we(["transition-all", B.value ? "rotate-180" : ""])
|
|
2943
|
+
}, null, 8, ["class"])
|
|
2944
|
+
])
|
|
2945
|
+
];
|
|
2946
|
+
}),
|
|
2947
|
+
_: 1
|
|
2948
|
+
}, 8, ["modelValue"]),
|
|
2949
|
+
h[13] || (h[13] = P("div", { class: "border-l border-oc-gray-200" }, null, -1))
|
|
2950
|
+
], 64)) : K("", !0),
|
|
2951
|
+
i.value.includes("font-style") ? (w(), N(We, { key: 2 }, [
|
|
2952
|
+
P("div", so, [
|
|
2953
|
+
q(M(Ee), {
|
|
2954
|
+
class: we(["cursor-pointer", fe.value ? "text-oc-text" : "text-oc-text-300"]),
|
|
2955
|
+
width: "20",
|
|
2956
|
+
height: "20",
|
|
2957
|
+
name: "text-editor/bold",
|
|
2958
|
+
onClick: x
|
|
2959
|
+
}, null, 8, ["class"]),
|
|
2960
|
+
q(M(Ee), {
|
|
2961
|
+
class: we(["cursor-pointer", pe.value ? "text-oc-text" : "text-oc-text-300"]),
|
|
2962
|
+
width: "20",
|
|
2963
|
+
height: "20",
|
|
2964
|
+
name: "text-editor/italic",
|
|
2965
|
+
onClick: T
|
|
2966
|
+
}, null, 8, ["class"]),
|
|
2967
|
+
q(M(Ee), {
|
|
2968
|
+
class: we(["cursor-pointer", he.value ? "text-oc-text" : "text-oc-text-300"]),
|
|
2969
|
+
width: "20",
|
|
2970
|
+
height: "20",
|
|
2971
|
+
name: "text-editor/underline",
|
|
2972
|
+
onClick: C
|
|
2973
|
+
}, null, 8, ["class"])
|
|
2974
|
+
]),
|
|
2975
|
+
h[14] || (h[14] = P("div", { class: "border-l border-oc-gray-200" }, null, -1))
|
|
2976
|
+
], 64)) : K("", !0),
|
|
2977
|
+
P("div", uo, [
|
|
2978
|
+
i.value.includes("link") ? (w(), ce(M(Ee), {
|
|
2979
|
+
key: 0,
|
|
2980
|
+
class: "cursor-pointer",
|
|
2981
|
+
width: "20",
|
|
2982
|
+
height: "20",
|
|
2983
|
+
name: "text-editor/link",
|
|
2984
|
+
onClick: j
|
|
2985
|
+
})) : K("", !0),
|
|
2986
|
+
i.value.includes("image") ? (w(), ce(M(Ee), {
|
|
2987
|
+
key: 1,
|
|
2988
|
+
class: "cursor-pointer",
|
|
2989
|
+
width: "20",
|
|
2990
|
+
height: "20",
|
|
2991
|
+
name: "text-editor/image",
|
|
2992
|
+
onClick: Se
|
|
2993
|
+
})) : K("", !0),
|
|
2994
|
+
i.value.includes("quote") ? (w(), ce(M(Ee), {
|
|
2995
|
+
key: 2,
|
|
2996
|
+
class: we(["cursor-pointer", ae.value ? "text-oc-text" : "text-oc-text-300"]),
|
|
2997
|
+
width: "20",
|
|
2998
|
+
height: "20",
|
|
2999
|
+
name: "text-editor/quote",
|
|
3000
|
+
onClick: re
|
|
3001
|
+
}, null, 8, ["class"])) : K("", !0),
|
|
3002
|
+
i.value.includes("media") ? (w(), ce(M(Ee), {
|
|
3003
|
+
key: 3,
|
|
3004
|
+
class: "cursor-pointer",
|
|
3005
|
+
width: "20",
|
|
3006
|
+
height: "20",
|
|
3007
|
+
name: "text-editor/media",
|
|
3008
|
+
onClick: Ce
|
|
3009
|
+
})) : K("", !0)
|
|
3010
|
+
]),
|
|
3011
|
+
i.value.includes("list") ? (w(), N(We, { key: 3 }, [
|
|
3012
|
+
h[15] || (h[15] = P("div", { class: "border-l border-oc-gray-200" }, null, -1)),
|
|
3013
|
+
P("div", co, [
|
|
3014
|
+
q(M(Ee), {
|
|
3015
|
+
class: we(["cursor-pointer", xe.value === "bullet" ? "text-oc-text" : "text-oc-text-300"]),
|
|
3016
|
+
width: "20",
|
|
3017
|
+
height: "20",
|
|
3018
|
+
name: "text-editor/bullet",
|
|
3019
|
+
onClick: h[1] || (h[1] = (W) => Re("bullet"))
|
|
3020
|
+
}, null, 8, ["class"]),
|
|
3021
|
+
q(M(Ee), {
|
|
3022
|
+
class: we(["cursor-pointer", xe.value === "ordered" ? "text-oc-text" : "text-oc-text-300"]),
|
|
3023
|
+
width: "20",
|
|
3024
|
+
height: "20",
|
|
3025
|
+
name: "text-editor/number",
|
|
3026
|
+
onClick: h[2] || (h[2] = (W) => Re("ordered"))
|
|
3027
|
+
}, null, 8, ["class"])
|
|
3028
|
+
])
|
|
3029
|
+
], 64)) : K("", !0),
|
|
3030
|
+
i.value.includes("alignment") ? (w(), N(We, { key: 4 }, [
|
|
3031
|
+
h[16] || (h[16] = P("div", { class: "border-l border-oc-gray-200" }, null, -1)),
|
|
3032
|
+
P("div", fo, [
|
|
3033
|
+
q(M(Ee), {
|
|
3034
|
+
class: we(["cursor-pointer", F.value ? "text-oc-text-300" : "text-oc-text"]),
|
|
3035
|
+
width: "20",
|
|
3036
|
+
height: "20",
|
|
3037
|
+
name: "text-editor/left",
|
|
3038
|
+
onClick: h[3] || (h[3] = (W) => b())
|
|
3039
|
+
}, null, 8, ["class"]),
|
|
3040
|
+
q(M(Ee), {
|
|
3041
|
+
class: we(["cursor-pointer", F.value === "center" ? "text-oc-text" : "text-oc-text-300"]),
|
|
3042
|
+
width: "20",
|
|
3043
|
+
height: "20",
|
|
3044
|
+
name: "text-editor/center",
|
|
3045
|
+
onClick: h[4] || (h[4] = (W) => b("center"))
|
|
3046
|
+
}, null, 8, ["class"]),
|
|
3047
|
+
q(M(Ee), {
|
|
3048
|
+
class: we(["cursor-pointer", F.value === "right" ? "text-oc-text" : "text-oc-text-300"]),
|
|
3049
|
+
width: "20",
|
|
3050
|
+
height: "20",
|
|
3051
|
+
name: "text-editor/right",
|
|
3052
|
+
onClick: h[5] || (h[5] = (W) => b("right"))
|
|
3053
|
+
}, null, 8, ["class"]),
|
|
3054
|
+
q(M(Ee), {
|
|
3055
|
+
class: we(["cursor-pointer", F.value === "justify" ? "text-oc-text" : "text-oc-text-300"]),
|
|
3056
|
+
width: "20",
|
|
3057
|
+
height: "20",
|
|
3058
|
+
name: "text-editor/justify",
|
|
3059
|
+
onClick: h[6] || (h[6] = (W) => b("justify"))
|
|
3060
|
+
}, null, 8, ["class"])
|
|
3061
|
+
])
|
|
3062
|
+
], 64)) : K("", !0),
|
|
3063
|
+
h[18] || (h[18] = P("div", { class: "border-l border-oc-gray-200" }, null, -1)),
|
|
3064
|
+
P("div", po, [
|
|
3065
|
+
q(M(no), {
|
|
3066
|
+
modelValue: v.value,
|
|
3067
|
+
"onUpdate:modelValue": [
|
|
3068
|
+
h[7] || (h[7] = (W) => v.value = W),
|
|
3069
|
+
z
|
|
3070
|
+
],
|
|
3071
|
+
"hide-input-color": ""
|
|
3072
|
+
}, {
|
|
3073
|
+
"picker-icon": be(() => [
|
|
3074
|
+
P("div", go, [
|
|
3075
|
+
P("div", {
|
|
3076
|
+
style: lt(`color:${v.value}`)
|
|
3077
|
+
}, "A", 4),
|
|
3078
|
+
P("div", {
|
|
3079
|
+
class: "h-[5px] w-full rounded border",
|
|
3080
|
+
style: lt(`background:${v.value}`)
|
|
3081
|
+
}, null, 4)
|
|
3082
|
+
])
|
|
3083
|
+
]),
|
|
3084
|
+
_: 1
|
|
3085
|
+
}, 8, ["modelValue"])
|
|
3086
|
+
]),
|
|
3087
|
+
h[19] || (h[19] = P("div", { class: "border-l border-oc-gray-200" }, null, -1)),
|
|
3088
|
+
ue.value ? (w(), N("div", mo, [
|
|
3089
|
+
q(M(Gt), {
|
|
3090
|
+
label: "Image width",
|
|
3091
|
+
class: "w-[120px]",
|
|
3092
|
+
"model-value": ie.value,
|
|
3093
|
+
"min-limit": 0,
|
|
3094
|
+
"max-limit": 100,
|
|
3095
|
+
"onUpdate:modelValue": ge
|
|
3096
|
+
}, null, 8, ["model-value"]),
|
|
3097
|
+
P("div", vo, [
|
|
3098
|
+
q(M(Ee), {
|
|
3099
|
+
class: "cursor-pointer",
|
|
3100
|
+
width: "20",
|
|
3101
|
+
height: "20",
|
|
3102
|
+
name: "text-editor/left",
|
|
3103
|
+
onClick: h[8] || (h[8] = (W) => U())
|
|
3104
|
+
}),
|
|
3105
|
+
q(M(Ee), {
|
|
3106
|
+
class: "cursor-pointer",
|
|
3107
|
+
width: "20",
|
|
3108
|
+
height: "20",
|
|
3109
|
+
name: "text-editor/center",
|
|
3110
|
+
onClick: h[9] || (h[9] = (W) => U("center"))
|
|
3111
|
+
}),
|
|
3112
|
+
q(M(Ee), {
|
|
3113
|
+
class: "cursor-pointer",
|
|
3114
|
+
width: "20",
|
|
3115
|
+
height: "20",
|
|
3116
|
+
name: "text-editor/right",
|
|
3117
|
+
onClick: h[10] || (h[10] = (W) => U("right"))
|
|
3118
|
+
})
|
|
3119
|
+
])
|
|
3120
|
+
])) : K("", !0),
|
|
3121
|
+
P("div", ho, [
|
|
3122
|
+
(w(), N("svg", {
|
|
3123
|
+
width: "20",
|
|
3124
|
+
height: "20",
|
|
3125
|
+
viewBox: "0 0 15 15",
|
|
3126
|
+
fill: "none",
|
|
3127
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
3128
|
+
onClick: h[11] || (h[11] = (W) => D())
|
|
3129
|
+
}, h[17] || (h[17] = [
|
|
3130
|
+
P("path", {
|
|
3131
|
+
"fill-rule": "evenodd",
|
|
3132
|
+
"clip-rule": "evenodd",
|
|
3133
|
+
d: "M2 7.5C2 7.22386 2.22386 7 2.5 7H12.5C12.7761 7 13 7.22386 13 7.5C13 7.77614 12.7761 8 12.5 8H2.5C2.22386 8 2 7.77614 2 7.5Z",
|
|
3134
|
+
fill: "#000000"
|
|
3135
|
+
}, null, -1)
|
|
3136
|
+
])))
|
|
3137
|
+
])
|
|
3138
|
+
], 8, lo)
|
|
3139
|
+
]),
|
|
3140
|
+
_: 1
|
|
3141
|
+
}, 8, ["id", "content", "options", "placeholder"])) : K("", !0)
|
|
3142
|
+
], 2)
|
|
3143
|
+
]),
|
|
3144
|
+
_: 1
|
|
3145
|
+
}, 8, ["label", "hint", "error-message", "is-required", "label-icon", "tooltip-text", "tooltip-options"]));
|
|
3146
|
+
}
|
|
3147
|
+
}, yo = {
|
|
3148
|
+
__name: "InputHex",
|
|
3149
|
+
props: {
|
|
3150
|
+
modelValue: {
|
|
3151
|
+
type: String
|
|
3152
|
+
}
|
|
3153
|
+
},
|
|
3154
|
+
emits: {
|
|
3155
|
+
"update:modelValue": []
|
|
3156
|
+
},
|
|
3157
|
+
setup(e, { emit: t }) {
|
|
3158
|
+
const n = e, l = t, a = _(""), i = (s) => {
|
|
3159
|
+
a.value = s, a.value = `#${s.replace(/#/g, "")}`;
|
|
3160
|
+
}, r = () => {
|
|
3161
|
+
let s = a.value;
|
|
3162
|
+
if (s === n.modelValue) return;
|
|
3163
|
+
if (!/^#[0-9a-fA-F]+$/.test(s)) {
|
|
3164
|
+
a.value = n.modelValue;
|
|
3165
|
+
return;
|
|
3166
|
+
}
|
|
3167
|
+
let o = s.replace(/#/g, "");
|
|
3168
|
+
switch (o.length) {
|
|
3169
|
+
case 0:
|
|
3170
|
+
o = n.modelValue.replace("#", "");
|
|
3171
|
+
break;
|
|
3172
|
+
case 1:
|
|
3173
|
+
case 2:
|
|
3174
|
+
o = o.repeat(3);
|
|
3175
|
+
break;
|
|
3176
|
+
case 4:
|
|
3177
|
+
case 5:
|
|
3178
|
+
o = o.slice(0, 3);
|
|
3179
|
+
break;
|
|
3180
|
+
case 3:
|
|
3181
|
+
case 6:
|
|
3182
|
+
break;
|
|
3183
|
+
default:
|
|
3184
|
+
o = o.slice(0, 6);
|
|
3185
|
+
}
|
|
3186
|
+
a.value = `#${o.toUpperCase()}`, l("update:modelValue", a.value);
|
|
3187
|
+
};
|
|
3188
|
+
return Dt(
|
|
3189
|
+
() => n.modelValue,
|
|
3190
|
+
(s, o) => {
|
|
3191
|
+
s !== o && (a.value = s);
|
|
3192
|
+
},
|
|
3193
|
+
{ immediate: !0 }
|
|
3194
|
+
), (s, o) => (w(), ce(M(xt), {
|
|
3195
|
+
class: "w-[158px]",
|
|
3196
|
+
placeholder: "#FFFFFF",
|
|
3197
|
+
"model-value": a.value,
|
|
3198
|
+
"onUpdate:modelValue": i,
|
|
3199
|
+
onBlur: r,
|
|
3200
|
+
onKeyup: Tn(r, ["enter"])
|
|
3201
|
+
}, null, 8, ["model-value"]));
|
|
3202
|
+
}
|
|
3203
|
+
}, bo = { class: "grid grid-cols-3 gap-3" }, nl = {
|
|
3204
|
+
__name: "InputRgbHsl",
|
|
3205
|
+
props: {
|
|
3206
|
+
inputType: {
|
|
3207
|
+
default: "RGB",
|
|
3208
|
+
type: String
|
|
3209
|
+
},
|
|
3210
|
+
rgbValue: {
|
|
3211
|
+
type: Object
|
|
3212
|
+
},
|
|
3213
|
+
hslValue: {
|
|
3214
|
+
type: Object
|
|
3215
|
+
}
|
|
3216
|
+
},
|
|
3217
|
+
emits: {
|
|
3218
|
+
"update-rgb-value": [],
|
|
3219
|
+
"update-hsl-value": []
|
|
3220
|
+
},
|
|
3221
|
+
setup(e, { emit: t }) {
|
|
3222
|
+
const n = e, l = t, a = _({
|
|
3223
|
+
r: 0,
|
|
3224
|
+
g: 0,
|
|
3225
|
+
b: 0
|
|
3226
|
+
}), i = _(), r = _(), s = _(), o = (p, y) => {
|
|
3227
|
+
var D, k, le;
|
|
3228
|
+
let m = 255;
|
|
3229
|
+
if (n.inputType == "HSL" && (m = 100, p == "r" && (m = 360)), !isNaN(parseInt(y))) {
|
|
3230
|
+
if (p == "r") {
|
|
3231
|
+
let G = parseInt(y);
|
|
3232
|
+
G <= m && (a.value.r = G, n.inputType == "RGB" ? u("r") : g()), (D = i.value) == null || D.focus();
|
|
3233
|
+
} else if (p == "g") {
|
|
3234
|
+
let G = parseInt(y);
|
|
3235
|
+
G <= m && (a.value.g = G, n.inputType == "RGB" ? u("g") : g()), (k = r.value) == null || k.focus();
|
|
3236
|
+
} else if (p == "b") {
|
|
3237
|
+
let G = parseInt(y);
|
|
3238
|
+
G <= m && (a.value.b = G, n.inputType == "RGB" ? u("b") : g()), (le = s.value) == null || le.focus();
|
|
3239
|
+
}
|
|
3240
|
+
}
|
|
3241
|
+
}, u = (p) => {
|
|
3242
|
+
l("update-rgb-value", {
|
|
3243
|
+
type: p,
|
|
3244
|
+
value: {
|
|
3245
|
+
r: parseInt(a.value.r),
|
|
3246
|
+
g: parseInt(a.value.g),
|
|
3247
|
+
b: parseInt(a.value.b)
|
|
3248
|
+
}
|
|
3249
|
+
});
|
|
3250
|
+
}, g = () => {
|
|
3251
|
+
l("update-hsl-value", {
|
|
3252
|
+
h: parseInt(a.value.r),
|
|
3253
|
+
s: parseInt(a.value.g),
|
|
3254
|
+
l: parseInt(a.value.b)
|
|
3255
|
+
});
|
|
3256
|
+
};
|
|
3257
|
+
return n.inputType === "RGB" ? Dt(
|
|
3258
|
+
() => n.rgbValue,
|
|
3259
|
+
(p, y) => {
|
|
3260
|
+
p !== y && (a.value = p);
|
|
3261
|
+
},
|
|
3262
|
+
{ immediate: !0, deep: !0 }
|
|
3263
|
+
) : Dt(
|
|
3264
|
+
() => n.hslValue,
|
|
3265
|
+
(p) => {
|
|
3266
|
+
a.value = {
|
|
3267
|
+
r: p.h,
|
|
3268
|
+
g: p.s,
|
|
3269
|
+
b: p.l
|
|
3270
|
+
};
|
|
3271
|
+
},
|
|
3272
|
+
{ immediate: !0, deep: !0 }
|
|
3273
|
+
), (p, y) => (w(), N("div", bo, [
|
|
3274
|
+
q(M(xt), {
|
|
3275
|
+
ref_key: "rInputEl",
|
|
3276
|
+
ref: i,
|
|
3277
|
+
"model-value": a.value.r,
|
|
3278
|
+
placeholder: "100",
|
|
3279
|
+
"onUpdate:modelValue": y[0] || (y[0] = (m) => o("r", m))
|
|
3280
|
+
}, null, 8, ["model-value"]),
|
|
3281
|
+
q(M(xt), {
|
|
3282
|
+
ref_key: "gInputEl",
|
|
3283
|
+
ref: r,
|
|
3284
|
+
"model-value": a.value.g,
|
|
3285
|
+
placeholder: "100",
|
|
3286
|
+
"onUpdate:modelValue": y[1] || (y[1] = (m) => o("g", m))
|
|
3287
|
+
}, null, 8, ["model-value"]),
|
|
3288
|
+
q(M(xt), {
|
|
3289
|
+
ref_key: "bInputEl",
|
|
3290
|
+
ref: s,
|
|
3291
|
+
"model-value": a.value.b,
|
|
3292
|
+
placeholder: "100",
|
|
3293
|
+
"onUpdate:modelValue": y[2] || (y[2] = (m) => o("b", m))
|
|
3294
|
+
}, null, 8, ["model-value"])
|
|
3295
|
+
]));
|
|
3296
|
+
}
|
|
3297
|
+
}, xo = {
|
|
3298
|
+
__name: "InputOpacity",
|
|
3299
|
+
props: {
|
|
3300
|
+
modelValue: {
|
|
3301
|
+
type: Number
|
|
3302
|
+
}
|
|
3303
|
+
},
|
|
3304
|
+
emits: {
|
|
3305
|
+
"update:modelValue": []
|
|
3306
|
+
},
|
|
3307
|
+
setup(e, { emit: t }) {
|
|
3308
|
+
const n = e, l = t, a = _(""), i = (s) => {
|
|
3309
|
+
a.value = s;
|
|
3310
|
+
}, r = () => {
|
|
3311
|
+
let s = parseInt(a.value);
|
|
3312
|
+
s && s <= 100 ? l("update:modelValue", s) : a.value = n.modelValue;
|
|
3313
|
+
};
|
|
3314
|
+
return Dt(
|
|
3315
|
+
() => n.modelValue,
|
|
3316
|
+
(s, o) => {
|
|
3317
|
+
s !== o && (a.value = s);
|
|
3318
|
+
},
|
|
3319
|
+
{ immediate: !0 }
|
|
3320
|
+
), (s, o) => (w(), ce(M(xt), {
|
|
3321
|
+
class: "w-[75px]",
|
|
3322
|
+
placeholder: "100",
|
|
3323
|
+
"model-value": a.value,
|
|
3324
|
+
"onUpdate:modelValue": i,
|
|
3325
|
+
onBlur: r,
|
|
3326
|
+
onKeyup: Tn(r, ["enter"])
|
|
3327
|
+
}, {
|
|
3328
|
+
leading: be(() => o[0] || (o[0] = [
|
|
3329
|
+
ft("%")
|
|
3330
|
+
])),
|
|
3331
|
+
_: 1
|
|
3332
|
+
}, 8, ["model-value"]));
|
|
3333
|
+
}
|
|
3334
|
+
}, wo = {
|
|
3335
|
+
__name: "SelectColorFormat",
|
|
3336
|
+
props: {
|
|
3337
|
+
modelValue: { default: "RGB", type: String }
|
|
3338
|
+
},
|
|
3339
|
+
emits: ["update:model-value"],
|
|
3340
|
+
setup(e, { emit: t }) {
|
|
3341
|
+
const l = _(e.modelValue), a = t, i = (r) => {
|
|
3342
|
+
l.value = r, a("update:model-value", r);
|
|
3343
|
+
};
|
|
3344
|
+
return (r, s) => (w(), ce(M(il), {
|
|
3345
|
+
class: "!w-[80px]",
|
|
3346
|
+
"model-value": l.value,
|
|
3347
|
+
options: [
|
|
3348
|
+
{
|
|
3349
|
+
label: "HEX",
|
|
3350
|
+
value: "HEX"
|
|
3351
|
+
},
|
|
3352
|
+
{
|
|
3353
|
+
label: "RGB",
|
|
3354
|
+
value: "RGB"
|
|
3355
|
+
},
|
|
3356
|
+
{
|
|
3357
|
+
label: "HSL",
|
|
3358
|
+
value: "HSL"
|
|
3359
|
+
}
|
|
3360
|
+
],
|
|
3361
|
+
"onUpdate:modelValue": i
|
|
3362
|
+
}, null, 8, ["model-value"]));
|
|
3363
|
+
}
|
|
3364
|
+
}, So = { class: "opacity-bar" }, $o = { class: "picker-opacity-slider opacity-bar-background" }, ko = ["value"], Co = {
|
|
3365
|
+
__name: "SliderOpacity",
|
|
3366
|
+
props: {
|
|
3367
|
+
modelValue: { default: 0, type: Number }
|
|
3368
|
+
},
|
|
3369
|
+
emits: ["update:modelValue", "onInput"],
|
|
3370
|
+
setup(e, { emit: t }) {
|
|
3371
|
+
const n = Ft("opacitySlider"), l = t, a = (i) => {
|
|
3372
|
+
l("update:modelValue", parseInt(i.target.value)), l("onInput", i);
|
|
3373
|
+
};
|
|
3374
|
+
return (i, r) => (w(), N("div", So, [
|
|
3375
|
+
P("div", $o, [
|
|
3376
|
+
P("input", {
|
|
3377
|
+
ref_key: "opacitySlider",
|
|
3378
|
+
ref: n,
|
|
3379
|
+
value: e.modelValue,
|
|
3380
|
+
class: "opacity__slider",
|
|
3381
|
+
type: "range",
|
|
3382
|
+
min: "0",
|
|
3383
|
+
max: "100",
|
|
3384
|
+
onInput: a
|
|
3385
|
+
}, null, 40, ko)
|
|
3386
|
+
])
|
|
3387
|
+
]));
|
|
3388
|
+
}
|
|
3389
|
+
}, Eo = {
|
|
3390
|
+
__name: "SliderGradient",
|
|
3391
|
+
props: {
|
|
3392
|
+
gradientType: String
|
|
3393
|
+
},
|
|
3394
|
+
emits: ["onAddColor", "onMouseDown", "onDeleteColor"],
|
|
3395
|
+
setup(e, { emit: t }) {
|
|
3396
|
+
const n = Ft("gradientBar"), l = _(), a = t, i = (y) => {
|
|
3397
|
+
y.preventDefault();
|
|
3398
|
+
}, r = _("left:0"), s = _(!1), o = (y) => {
|
|
3399
|
+
a("onMouseDown", y);
|
|
3400
|
+
}, u = () => {
|
|
3401
|
+
let y = l.value.querySelector(".select");
|
|
3402
|
+
r.value = y == null ? void 0 : y.getAttribute("style");
|
|
3403
|
+
}, g = () => {
|
|
3404
|
+
var m;
|
|
3405
|
+
u(), (((m = l.value.querySelectorAll(".gradient-handle")) == null ? void 0 : m.length) ?? 2) > 2 ? s.value = !0 : s.value = !1;
|
|
3406
|
+
}, p = (y) => {
|
|
3407
|
+
s.value = !1, a("onAddColor", y);
|
|
3408
|
+
};
|
|
3409
|
+
return (y, m) => (w(), N("div", {
|
|
3410
|
+
ref_key: "gradientSlider",
|
|
3411
|
+
ref: l,
|
|
3412
|
+
class: "relative h-[40px]",
|
|
3413
|
+
onClick: g
|
|
3414
|
+
}, [
|
|
3415
|
+
P("button", {
|
|
3416
|
+
type: "button",
|
|
3417
|
+
class: we(["absolute top-[-18px] text-oc-accent-3 rounded-[4px] border-2 border-oc-gray-200 p-2 bg-oc-bg-light", s.value ? "" : "!hidden"]),
|
|
3418
|
+
style: lt(r.value),
|
|
3419
|
+
onClick: m[0] || (m[0] = (D) => y.$emit("onDeleteColor"))
|
|
3420
|
+
}, [
|
|
3421
|
+
q(M(Ee), {
|
|
3422
|
+
name: "bin",
|
|
3423
|
+
width: "14",
|
|
3424
|
+
height: "14"
|
|
3425
|
+
})
|
|
3426
|
+
], 6),
|
|
3427
|
+
P("div", {
|
|
3428
|
+
class: we(["gradient-bar", {
|
|
3429
|
+
"mt-[20px]": e.gradientType === "linear",
|
|
3430
|
+
"mt-[12px]": e.gradientType === "radial"
|
|
3431
|
+
}]),
|
|
3432
|
+
onMousedown: o,
|
|
3433
|
+
onDragstart: i
|
|
3434
|
+
}, [
|
|
3435
|
+
P("div", {
|
|
3436
|
+
ref_key: "gradientBar",
|
|
3437
|
+
ref: n,
|
|
3438
|
+
class: "gradient-container",
|
|
3439
|
+
onDblclick: p
|
|
3440
|
+
}, null, 544)
|
|
3441
|
+
], 34)
|
|
3442
|
+
], 512));
|
|
3443
|
+
}
|
|
3444
|
+
}, Do = { class: "picker-hue" }, Io = ["value"], Oo = {
|
|
3445
|
+
__name: "SliderHue",
|
|
3446
|
+
props: {
|
|
3447
|
+
modelValue: { default: 0, type: Number }
|
|
3448
|
+
},
|
|
3449
|
+
emits: ["update:modelValue", "onInput", "onChange"],
|
|
3450
|
+
setup(e, { emit: t }) {
|
|
3451
|
+
const n = t, l = (a) => {
|
|
3452
|
+
n("update:modelValue", parseFloat(a.target.value)), n("onInput", a);
|
|
3453
|
+
};
|
|
3454
|
+
return (a, i) => (w(), N("div", Do, [
|
|
3455
|
+
P("input", {
|
|
3456
|
+
value: e.modelValue,
|
|
3457
|
+
class: "picker-hue-range-slider",
|
|
3458
|
+
type: "range",
|
|
3459
|
+
min: "0",
|
|
3460
|
+
max: "360",
|
|
3461
|
+
step: "0.1",
|
|
3462
|
+
onInput: l,
|
|
3463
|
+
onChange: i[0] || (i[0] = (r) => a.$emit("onChange", r))
|
|
3464
|
+
}, null, 40, Io)
|
|
3465
|
+
]));
|
|
3466
|
+
}
|
|
3467
|
+
}, To = { class: "px-2 mt-2" }, Vo = {
|
|
3468
|
+
key: 1,
|
|
3469
|
+
class: "grid grid-cols-2 gap-4 px-1"
|
|
3470
|
+
}, Ao = {
|
|
3471
|
+
__name: "GradientSettings",
|
|
3472
|
+
props: {
|
|
3473
|
+
mode: {
|
|
3474
|
+
default: "gradient",
|
|
3475
|
+
type: String
|
|
3476
|
+
},
|
|
3477
|
+
gradientType: { default: "linear", type: String },
|
|
3478
|
+
angle: { default: 90, type: Number },
|
|
3479
|
+
percentageX: { default: 50, type: Number },
|
|
3480
|
+
percentageY: { default: 50, type: Number }
|
|
3481
|
+
},
|
|
3482
|
+
emits: ["update:angle", "update:percentageX", "update:percentageY", "onInput"],
|
|
3483
|
+
setup(e, { emit: t }) {
|
|
3484
|
+
const n = _(!1), l = _(!1);
|
|
3485
|
+
Tt(() => {
|
|
3486
|
+
n.value = !0, l.value = !0;
|
|
3487
|
+
});
|
|
3488
|
+
const a = t, i = (r, s) => {
|
|
3489
|
+
let o = parseInt(r);
|
|
3490
|
+
switch (s) {
|
|
3491
|
+
case "angle":
|
|
3492
|
+
r > 360 ? o = 360 : r < 0 && (o = 0), a("update:angle", o), a("onInput");
|
|
3493
|
+
break;
|
|
3494
|
+
case "percentageX":
|
|
3495
|
+
r > 100 ? o = 100 : r < 0 && (o = 0), a("update:percentageX", o), a("onInput");
|
|
3496
|
+
break;
|
|
3497
|
+
case "percentageY":
|
|
3498
|
+
r > 100 ? o = 100 : r < 0 && (o = 0), a("update:percentageY", o), a("onInput");
|
|
3499
|
+
break;
|
|
3500
|
+
}
|
|
3501
|
+
};
|
|
3502
|
+
return (r, s) => (w(), N("div", To, [
|
|
3503
|
+
e.gradientType == "linear" && n.value ? (w(), ce(M(Gt), {
|
|
3504
|
+
key: 0,
|
|
3505
|
+
label: "Angle",
|
|
3506
|
+
"model-value": e.angle,
|
|
3507
|
+
"min-limit": 0,
|
|
3508
|
+
"max-limit": 360,
|
|
3509
|
+
"onUpdate:modelValue": s[0] || (s[0] = (o) => i(o, "angle"))
|
|
3510
|
+
}, {
|
|
3511
|
+
"min-limit-label": be(() => s[3] || (s[3] = [
|
|
3512
|
+
ft("0 ")
|
|
3513
|
+
])),
|
|
3514
|
+
"max-limit-label": be(() => s[4] || (s[4] = [
|
|
3515
|
+
ft("360"),
|
|
3516
|
+
P("span", null, "°", -1)
|
|
3517
|
+
])),
|
|
3518
|
+
_: 1
|
|
3519
|
+
}, 8, ["model-value"])) : K("", !0),
|
|
3520
|
+
e.gradientType == "radial" && l.value ? (w(), N("div", Vo, [
|
|
3521
|
+
q(M(Gt), {
|
|
3522
|
+
label: "Position X",
|
|
3523
|
+
"model-value": e.percentageX,
|
|
3524
|
+
"min-limit": 0,
|
|
3525
|
+
"max-limit": 100,
|
|
3526
|
+
"onUpdate:modelValue": s[1] || (s[1] = (o) => i(o, "percentageX"))
|
|
3527
|
+
}, {
|
|
3528
|
+
"min-limit-label": be(() => s[5] || (s[5] = [
|
|
3529
|
+
ft("0")
|
|
3530
|
+
])),
|
|
3531
|
+
"max-limit-label": be(() => s[6] || (s[6] = [
|
|
3532
|
+
ft("100%")
|
|
3533
|
+
])),
|
|
3534
|
+
_: 1
|
|
3535
|
+
}, 8, ["model-value"]),
|
|
3536
|
+
q(M(Gt), {
|
|
3537
|
+
label: "Position Y",
|
|
3538
|
+
"model-value": e.percentageY,
|
|
3539
|
+
"min-limit": 0,
|
|
3540
|
+
"max-limit": 100,
|
|
3541
|
+
"onUpdate:modelValue": s[2] || (s[2] = (o) => i(o, "percentageY"))
|
|
3542
|
+
}, {
|
|
3543
|
+
"min-limit-label": be(() => s[7] || (s[7] = [
|
|
3544
|
+
ft("0")
|
|
3545
|
+
])),
|
|
3546
|
+
"max-limit-label": be(() => s[8] || (s[8] = [
|
|
3547
|
+
ft("100%")
|
|
3548
|
+
])),
|
|
3549
|
+
_: 1
|
|
3550
|
+
}, 8, ["model-value"])
|
|
3551
|
+
])) : K("", !0)
|
|
3552
|
+
]));
|
|
3553
|
+
}
|
|
3554
|
+
}, Mo = {
|
|
3555
|
+
__name: "PickerWrap",
|
|
3556
|
+
emits: ["onMouseDown"],
|
|
3557
|
+
setup(e) {
|
|
3558
|
+
const t = Ft("canvas"), n = Ft("pickerWrap"), l = Ft("pickerPointer"), a = (i) => {
|
|
3559
|
+
i.preventDefault();
|
|
3560
|
+
};
|
|
3561
|
+
return (i, r) => (w(), N("div", {
|
|
3562
|
+
ref_key: "pickerWrap",
|
|
3563
|
+
ref: n,
|
|
3564
|
+
class: "cp-picker-wrap",
|
|
3565
|
+
onMousedown: r[0] || (r[0] = (s) => i.$emit("onMouseDown", s)),
|
|
3566
|
+
onDragstart: a
|
|
3567
|
+
}, [
|
|
3568
|
+
P("canvas", {
|
|
3569
|
+
ref_key: "canvas",
|
|
3570
|
+
ref: t,
|
|
3571
|
+
class: "colour-area"
|
|
3572
|
+
}, null, 512),
|
|
3573
|
+
r[1] || (r[1] = P("div", { class: "colour-area-mask" }, null, -1)),
|
|
3574
|
+
P("div", {
|
|
3575
|
+
ref_key: "pickerPointer",
|
|
3576
|
+
ref: l,
|
|
3577
|
+
class: "colour-area-point-circle"
|
|
3578
|
+
}, null, 512)
|
|
3579
|
+
], 544));
|
|
3580
|
+
}
|
|
3581
|
+
}, _o = { class: "w-full flex justify-center" }, Fo = {
|
|
3582
|
+
key: 1,
|
|
3583
|
+
width: "28",
|
|
3584
|
+
height: "28",
|
|
3585
|
+
viewBox: "0 0 28 28",
|
|
3586
|
+
fill: "none",
|
|
3587
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
3588
|
+
}, Po = {
|
|
3589
|
+
__name: "ColorType",
|
|
3590
|
+
props: {
|
|
3591
|
+
variant: String,
|
|
3592
|
+
mode: {
|
|
3593
|
+
default: "gradient",
|
|
3594
|
+
type: String
|
|
3595
|
+
},
|
|
3596
|
+
gradientType: { default: "linear", type: String },
|
|
3597
|
+
iconClasses: {
|
|
3598
|
+
default: () => ({
|
|
3599
|
+
linear: "",
|
|
3600
|
+
radial: ""
|
|
3601
|
+
}),
|
|
3602
|
+
type: Object
|
|
3603
|
+
},
|
|
3604
|
+
modelValue: String
|
|
3605
|
+
},
|
|
3606
|
+
emits: ["onChangeMode"],
|
|
3607
|
+
setup(e) {
|
|
3608
|
+
return (t, n) => (w(), N("div", _o, [
|
|
3609
|
+
P("button", {
|
|
3610
|
+
type: "button",
|
|
3611
|
+
class: we(e.mode == "solid" ? "active" : ""),
|
|
3612
|
+
style: { padding: "7px" },
|
|
3613
|
+
onClick: n[0] || (n[0] = (l) => t.$emit("onChangeMode", "solid"))
|
|
3614
|
+
}, [
|
|
3615
|
+
e.modelValue && e.mode == "solid" ? (w(), N("div", {
|
|
3616
|
+
key: 0,
|
|
3617
|
+
class: "w-[28px] h-[28px] rounded-full border",
|
|
3618
|
+
style: lt(`background:${e.modelValue}`)
|
|
3619
|
+
}, null, 4)) : (w(), N("svg", Fo, n[3] || (n[3] = [
|
|
3620
|
+
P("g", { opacity: "0.5" }, [
|
|
3621
|
+
P("path", {
|
|
3622
|
+
d: "M0 14C0 6.26801 6.26801 0 14 0C21.732 0 28 6.26801 28 14C28 21.732 21.732 28 14 28C6.26801 28 0 21.732 0 14Z",
|
|
3623
|
+
fill: "#03102F"
|
|
3624
|
+
})
|
|
3625
|
+
], -1)
|
|
3626
|
+
])))
|
|
3627
|
+
], 2),
|
|
3628
|
+
P("button", {
|
|
3629
|
+
type: "button",
|
|
3630
|
+
class: we(e.gradientType == "linear" && e.mode != "solid" ? "active" : ""),
|
|
3631
|
+
style: lt(`${e.iconClasses.linear ? "" : "padding: 7px;"}`),
|
|
3632
|
+
onClick: n[1] || (n[1] = (l) => t.$emit("onChangeMode", "linear"))
|
|
3633
|
+
}, [
|
|
3634
|
+
P("div", {
|
|
3635
|
+
class: "w-[28px] h-[28px] rounded-full border",
|
|
3636
|
+
style: lt(
|
|
3637
|
+
e.modelValue && e.gradientType == "linear" && e.mode != "solid" ? `background:${e.modelValue}` : `
|
|
3638
|
+
background: linear-gradient(
|
|
3639
|
+
180deg,
|
|
3640
|
+
#03102f 0%,
|
|
3641
|
+
rgba(3, 16, 47, 0) 100%
|
|
3642
|
+
);
|
|
3643
|
+
`
|
|
3644
|
+
)
|
|
3645
|
+
}, null, 4)
|
|
3646
|
+
], 6),
|
|
3647
|
+
P("button", {
|
|
3648
|
+
type: "button",
|
|
3649
|
+
class: we(e.gradientType == "radial" && e.mode != "solid" ? "active" : ""),
|
|
3650
|
+
style: lt(`${e.iconClasses.radial ? "" : "padding: 6px;"}`),
|
|
3651
|
+
onClick: n[2] || (n[2] = (l) => t.$emit("onChangeMode", "radial"))
|
|
3652
|
+
}, [
|
|
3653
|
+
P("div", {
|
|
3654
|
+
class: "w-[28px] h-[28px] rounded-full border",
|
|
3655
|
+
style: lt(
|
|
3656
|
+
e.modelValue && e.gradientType == "radial" && e.mode != "solid" ? `background:${e.modelValue}` : "background: radial-gradient(circle at 50% 50%, rgb(255, 255, 255) 0%, rgb(3, 16, 47) 100%);"
|
|
3657
|
+
)
|
|
3658
|
+
}, null, 4)
|
|
3659
|
+
], 6)
|
|
3660
|
+
]));
|
|
3661
|
+
}
|
|
3662
|
+
}, Lo = ["cp-theme"], No = {
|
|
3663
|
+
key: 0,
|
|
3664
|
+
class: "flex justify-end border-b h-[46px] relative mt-[-5px] mb-5"
|
|
3665
|
+
}, Ro = {
|
|
3666
|
+
key: 1,
|
|
3667
|
+
class: "grid items-center mb-5"
|
|
3668
|
+
}, Bo = { key: 2 }, jo = { key: 0 }, Ho = { class: "ck-cp-local-color-conatiner" }, Yo = ["onClick"], Uo = { class: "flex items-center gap-2" }, Xo = { id: "ck-cp-target-background" }, Qo = { class: "flex gap-3" }, Wo = {
|
|
3669
|
+
key: 0,
|
|
3670
|
+
class: "w-full flex gap-3"
|
|
3671
|
+
}, qo = {
|
|
3672
|
+
key: 4,
|
|
3673
|
+
class: "ck-cp-local-color-conatiner"
|
|
3674
|
+
}, Go = ["onClick"], zo = {
|
|
3675
|
+
__name: "OcColorPickerPopup",
|
|
3676
|
+
props: {
|
|
3677
|
+
modelValue: {
|
|
3678
|
+
default: "",
|
|
3679
|
+
type: String
|
|
3680
|
+
},
|
|
3681
|
+
type: { default: "HEX8", type: String },
|
|
3682
|
+
inputType: { default: "HEX", type: String },
|
|
3683
|
+
theme: { default: "light", type: String },
|
|
3684
|
+
showColorList: { default: !0, type: Boolean },
|
|
3685
|
+
showEyeDrop: { default: !0, type: Boolean },
|
|
3686
|
+
showAlpha: { default: !0, type: Boolean },
|
|
3687
|
+
showInputMenu: { default: !0, type: Boolean },
|
|
3688
|
+
showInputSet: { default: !0, type: Boolean },
|
|
3689
|
+
disabled: { default: !1, type: Boolean },
|
|
3690
|
+
iconClasses: {
|
|
3691
|
+
default: () => ({
|
|
3692
|
+
linear: "",
|
|
3693
|
+
radial: "",
|
|
3694
|
+
ruler: "",
|
|
3695
|
+
eyeDroper: "",
|
|
3696
|
+
inputMenu: "",
|
|
3697
|
+
save: "",
|
|
3698
|
+
delete: ""
|
|
3699
|
+
}),
|
|
3700
|
+
type: Object
|
|
3701
|
+
},
|
|
3702
|
+
presetColors: Array,
|
|
3703
|
+
variant: {
|
|
3704
|
+
type: String,
|
|
3705
|
+
default: "solid"
|
|
3706
|
+
},
|
|
3707
|
+
lastUsedColors: Array
|
|
3708
|
+
},
|
|
3709
|
+
emits: ["update:modelValue", "last-used-pick"],
|
|
3710
|
+
setup(e, { emit: t }) {
|
|
3711
|
+
const n = e, l = _(n.variant == "gradient" ? "gradient" : "solid"), a = _(null), i = t, r = _(n.modelValue), s = (c) => {
|
|
3712
|
+
r.value = c, le.value && i("update:modelValue", c);
|
|
3713
|
+
}, o = _([
|
|
3714
|
+
{ id: 1, r: 68, g: 71, b: 119, a: 100, percent: 0, hue: 0, select: !0 },
|
|
3715
|
+
{ id: 2, r: 0, g: 0, b: 255, a: 100, percent: 100, hue: 0, select: !1 }
|
|
3716
|
+
]), u = _(n.lastUsedColors);
|
|
3717
|
+
Dt(
|
|
3718
|
+
() => n.lastUsedColors,
|
|
3719
|
+
() => {
|
|
3720
|
+
u.value = n.lastUsedColors;
|
|
3721
|
+
},
|
|
3722
|
+
{
|
|
3723
|
+
deep: !0
|
|
3724
|
+
}
|
|
3725
|
+
);
|
|
3726
|
+
const g = Me(() => n.variant !== "gradient" ? u.value.filter((c) => !c.includes("linear") && !c.includes("radial")) : u.value), p = _(!1), y = _("linear"), m = Nn({
|
|
3727
|
+
angle: 90,
|
|
3728
|
+
percentageX: 50,
|
|
3729
|
+
percentageY: 50
|
|
3730
|
+
}), D = _(""), k = _(n.inputType), le = _(!1), G = _(), fe = _(), pe = _(), he = _(), B = _(), ae = Nn({
|
|
3731
|
+
h: 0,
|
|
3732
|
+
s: 0,
|
|
3733
|
+
l: 0
|
|
3734
|
+
});
|
|
3735
|
+
Vt("gradientBar", fe), Vt("canvas", pe), Vt("pickerWrap", he), Vt("pickerPointer", B), Vt("opacitySlider", G);
|
|
3736
|
+
let De = 0, xe = 0, F = 0, V = 0, Y = 0, ye = 0;
|
|
3737
|
+
const Ve = (c) => {
|
|
3738
|
+
!he.value || !B.value || (Y = he.value.offsetHeight - B.value.offsetHeight, ye = he.value.offsetWidth - B.value.offsetWidth, F = c.clientX - c.target.getBoundingClientRect().left, V = c.clientY - c.target.getBoundingClientRect().top, De = F - B.value.offsetWidth / 2, xe = V - B.value.offsetHeight / 2, B.value.style.left = `${De}px`, B.value.style.top = `${xe}px`, x(!1), me(), window.addEventListener("mousemove", L), window.addEventListener("mouseup", E));
|
|
3739
|
+
}, L = (c) => {
|
|
3740
|
+
c.preventDefault();
|
|
3741
|
+
const d = he.value.getBoundingClientRect(), f = c.clientX - d.left - B.value.offsetWidth / 2, S = c.clientY - d.top - B.value.offsetHeight / 2;
|
|
3742
|
+
f >= 0 && f <= ye ? (De = f, B.value.style.left = `${f}px`) : 0 > f ? (De = 0, B.value.style.left = "0px") : f > ye && (De = ye, B.value.style.left = `${ye}px`), S >= 0 && S <= Y ? (xe = S, B.value.style.top = `${S}px`) : 0 > S ? (xe = 0, B.value.style.top = "0px") : S > Y && (xe = Y, B.value.style.top = `${Y}px`), x(!1), me();
|
|
3743
|
+
}, E = () => {
|
|
3744
|
+
window.removeEventListener("mousemove", L), window.removeEventListener("mouseup", E);
|
|
3745
|
+
}, x = (c) => {
|
|
3746
|
+
if (!c) {
|
|
3747
|
+
let d = H();
|
|
3748
|
+
const f = Bn(T.value, d.s, d.l);
|
|
3749
|
+
if (f) {
|
|
3750
|
+
if (le.value) {
|
|
3751
|
+
let S = o.value.find((I) => I.select == !0);
|
|
3752
|
+
S && (S.r = f.r, S.g = f.g, S.b = f.b);
|
|
3753
|
+
}
|
|
3754
|
+
O(), h();
|
|
3755
|
+
}
|
|
3756
|
+
}
|
|
3757
|
+
}, T = _(0), C = async (c) => {
|
|
3758
|
+
const { rgb: d } = jn(T.value, 100, 50);
|
|
3759
|
+
Te(d), setTimeout(() => {
|
|
3760
|
+
x(c), me();
|
|
3761
|
+
}, 0);
|
|
3762
|
+
}, H = () => {
|
|
3763
|
+
let c = { s: 0, l: 0 }, d = he.value.offsetWidth - B.value.offsetWidth, f = he.value.offsetHeight - B.value.offsetHeight, S = parseInt(B.value.style.left), A = 1 - parseInt(B.value.style.top) / f, Z = S / d;
|
|
3764
|
+
return c.l = A / 2 * (2 - Z), c.s = A * Z / (1 - Math.abs(2 * c.l - 1)), Number.isNaN(c.s) && (c.s = c.l), c.l = c.l > 1 ? 1 : c.l, c.s = c.s > 1 ? 1 : c.s, c;
|
|
3765
|
+
}, j = () => {
|
|
3766
|
+
const c = o.value.find((d) => d.select == !0);
|
|
3767
|
+
if (c) {
|
|
3768
|
+
const { l: d, s: f } = Yn(c.r, c.g, c.b);
|
|
3769
|
+
let S = d, I = f;
|
|
3770
|
+
Number.isNaN(I) && (I = S);
|
|
3771
|
+
let A = { x: 0, y: 0 }, Z = he.value.offsetWidth - B.value.offsetWidth, ne = he.value.offsetHeight - B.value.offsetHeight;
|
|
3772
|
+
const [J, R] = 2 * S - 1 < 0 ? [
|
|
3773
|
+
Z * 2 * I / (1 + I),
|
|
3774
|
+
ne * (1 - S * (1 + I))
|
|
3775
|
+
] : [
|
|
3776
|
+
-Z * 2 * (S - 1) * I / (S + I - S * I),
|
|
3777
|
+
ne * (S - 1) * (I - 1)
|
|
3778
|
+
];
|
|
3779
|
+
return A.x = J, A.y = R, A;
|
|
3780
|
+
} else
|
|
3781
|
+
return null;
|
|
3782
|
+
}, re = () => {
|
|
3783
|
+
const c = o.value.find((d) => d.select == !0);
|
|
3784
|
+
c && (c.hue = T.value);
|
|
3785
|
+
}, oe = _(100), Se = (c) => {
|
|
3786
|
+
if (n.showAlpha) {
|
|
3787
|
+
const d = o.value.find((f) => f.select == !0);
|
|
3788
|
+
d && (d.a = parseInt(c), h());
|
|
3789
|
+
}
|
|
3790
|
+
}, $e = (c) => {
|
|
3791
|
+
var f, S, I, A;
|
|
3792
|
+
const d = (S = (f = a.value) == null ? void 0 : f.querySelector(".gradient-handle-content")) == null ? void 0 : S.getBoundingClientRect();
|
|
3793
|
+
return c === 0 ? "0px" : c === 100 && d ? `${(((I = fe.value) == null ? void 0 : I.offsetWidth) || 0) - (d.width || 0)}px` : `${(((A = fe.value) == null ? void 0 : A.offsetWidth) || 0) * (c / 100) - ((d == null ? void 0 : d.width) || 0) / 2}px`;
|
|
3794
|
+
};
|
|
3795
|
+
let se = null, Ce = null;
|
|
3796
|
+
const Re = (c) => {
|
|
3797
|
+
var S, I;
|
|
3798
|
+
const f = c.target.offsetParent;
|
|
3799
|
+
if ((S = f == null ? void 0 : f.id) != null && S.includes("clr-gb-")) {
|
|
3800
|
+
const A = f.id.replace("clr-gb-", "");
|
|
3801
|
+
Ce = f;
|
|
3802
|
+
const Z = o.value.find((ne) => ne.select == !0);
|
|
3803
|
+
if (Z && Z.id != A) {
|
|
3804
|
+
const ne = (I = a.value) == null ? void 0 : I.querySelector(".gradient-handle.select");
|
|
3805
|
+
ne == null || ne.classList.remove("select"), f.classList.add("select");
|
|
3806
|
+
const J = o.value.findIndex((R) => R.select == !0);
|
|
3807
|
+
for (let R = 0; R < o.value.length; R++) {
|
|
3808
|
+
const ee = o.value[R];
|
|
3809
|
+
if (ee.id == A) {
|
|
3810
|
+
J != -1 && (o.value[J].select = !1), o.value[R].select = !0, oe.value = ee.a, ue(ee.r, ee.g, ee.b, ee.hue, !0), O(), me();
|
|
3811
|
+
break;
|
|
3812
|
+
}
|
|
3813
|
+
}
|
|
3814
|
+
}
|
|
3815
|
+
window.addEventListener("mousemove", v), window.addEventListener("mouseup", b);
|
|
3816
|
+
}
|
|
3817
|
+
}, b = () => {
|
|
3818
|
+
window.removeEventListener("mousemove", v), window.removeEventListener("mouseup", Re);
|
|
3819
|
+
}, v = (c) => {
|
|
3820
|
+
var A, Z;
|
|
3821
|
+
c.preventDefault();
|
|
3822
|
+
const d = (Z = (A = a.value) == null ? void 0 : A.querySelector(".gradient-handle-content")) == null ? void 0 : Z.getBoundingClientRect(), f = se == null ? void 0 : se.getBoundingClientRect(), S = f.width - (d == null ? void 0 : d.width);
|
|
3823
|
+
let I = c.clientX - (f.left || 0) - ((d == null ? void 0 : d.width) || 0) / 2;
|
|
3824
|
+
if (I < 0 ? I = 0 : I > S && (I = S), Ce) {
|
|
3825
|
+
Ce.style.left = `${I}px`;
|
|
3826
|
+
const ne = parseFloat((I / ((f == null ? void 0 : f.width) - (d == null ? void 0 : d.width)) * 100).toFixed(0)), J = o.value.find(
|
|
3827
|
+
(R) => R.id == (Ce == null ? void 0 : Ce.id.replace("clr-gb-", ""))
|
|
3828
|
+
);
|
|
3829
|
+
J && (J.percent = ne), h();
|
|
3830
|
+
}
|
|
3831
|
+
}, z = (c) => {
|
|
3832
|
+
var ne, J;
|
|
3833
|
+
const d = se == null ? void 0 : se.getBoundingClientRect(), f = Math.round((c.clientX - ((d == null ? void 0 : d.left) || 0)) / ((d == null ? void 0 : d.width) || 1) * 100), S = o.value.findIndex((R) => R.select == !0), I = o.value[S], A = {
|
|
3834
|
+
id: Date.now(),
|
|
3835
|
+
r: I.r,
|
|
3836
|
+
g: I.g,
|
|
3837
|
+
b: I.b,
|
|
3838
|
+
a: I.a,
|
|
3839
|
+
percent: f,
|
|
3840
|
+
hue: I.hue,
|
|
3841
|
+
select: !0
|
|
3842
|
+
};
|
|
3843
|
+
o.value[S].select = !1;
|
|
3844
|
+
const Z = (ne = a.value) == null ? void 0 : ne.querySelector(".gradient-handle.select");
|
|
3845
|
+
Z == null || Z.classList.remove("select"), o.value = [...o.value, A], U(A), Ce = (J = a.value) == null ? void 0 : J.querySelector(`#clr-gb-${A.id}`), h();
|
|
3846
|
+
}, ie = (c) => {
|
|
3847
|
+
if (c.r == 0 && c.g == 0 && c.b == 0)
|
|
3848
|
+
return !0;
|
|
3849
|
+
if (c.r == 255 && c.g == 255 && c.b == 255)
|
|
3850
|
+
return !0;
|
|
3851
|
+
{
|
|
3852
|
+
const d = pe.value.getContext("2d", { willReadFrequently: !0 }), f = pe.value.width, S = pe.value.height, I = d.getImageData(0, 0, f, S).data, A = c.r, Z = c.g, ne = c.b;
|
|
3853
|
+
for (let J = 0; J < S; J++)
|
|
3854
|
+
for (let R = 0; R < f; R++) {
|
|
3855
|
+
const ee = (J * f + R) * 4, st = I[ee], kl = I[ee + 1], Cl = I[ee + 2];
|
|
3856
|
+
if (st === A && kl === Z && Cl === ne)
|
|
3857
|
+
return !0;
|
|
3858
|
+
}
|
|
3859
|
+
return !1;
|
|
3860
|
+
}
|
|
3861
|
+
}, ue = (c, d, f, S, I) => {
|
|
3862
|
+
setTimeout(() => {
|
|
3863
|
+
if (ie({ r: c, g: d, b: f })) {
|
|
3864
|
+
let A = j();
|
|
3865
|
+
A && (B.value.style.left = `${A.x}px`, B.value.style.top = `${A.y}px`);
|
|
3866
|
+
} else {
|
|
3867
|
+
let A = j();
|
|
3868
|
+
A && (B.value.style.left = `${A.x}px`, B.value.style.top = `${A.y}px`), T.value = S, C(I);
|
|
3869
|
+
}
|
|
3870
|
+
}, 0);
|
|
3871
|
+
}, ge = () => {
|
|
3872
|
+
o.value.forEach((f) => U(f)), W();
|
|
3873
|
+
const c = o.value[0];
|
|
3874
|
+
T.value = c.hue, C(!0);
|
|
3875
|
+
let d = j();
|
|
3876
|
+
d && (B.value.style.left = `${d.x}px`, B.value.style.top = `${d.y}px`), O(), h();
|
|
3877
|
+
}, U = (c) => {
|
|
3878
|
+
if (l.value == "gradient") {
|
|
3879
|
+
let d = document.createElement("div");
|
|
3880
|
+
d.id = `clr-gb-${c.id}`, d.classList.add("gradient-handle"), d.style.left = $e(c.percent);
|
|
3881
|
+
let f = document.createElement("div");
|
|
3882
|
+
f.classList.add("gradient-handle-content"), c.select == !0 && d.classList.add("select"), d.appendChild(f), se && se.appendChild(d);
|
|
3883
|
+
}
|
|
3884
|
+
}, Te = (c) => {
|
|
3885
|
+
const d = pe.value.getContext("2d", { willReadFrequently: !0 }), f = pe.value.width, S = pe.value.height;
|
|
3886
|
+
d.fillStyle = `rgb(${c[0]},${c[1]},${c[2]})`, d.fillRect(0, 0, f, S);
|
|
3887
|
+
let I = d.createLinearGradient(0, 0, f - 12, 0);
|
|
3888
|
+
I.addColorStop(0, "rgb(255,255,255)"), I.addColorStop(1, "rgba(255,255,255,0)"), d.fillStyle = I, d.fillRect(0, 0, f, S);
|
|
3889
|
+
let A = d.createLinearGradient(0, 0, 0, S);
|
|
3890
|
+
A.addColorStop(0, "rgba(0,0,0,0)"), A.addColorStop(1, "rgb(0,0,0)"), d.fillStyle = A, d.fillRect(0, 0, f, S);
|
|
3891
|
+
}, O = () => {
|
|
3892
|
+
if (n.showAlpha) {
|
|
3893
|
+
let c = o.value.find((d) => d.select == !0);
|
|
3894
|
+
c && (G.value.style.background = ` linear-gradient(90deg,rgba(255, 255, 255, 0) 0%, rgba(${c.r}, ${c.g}, ${c.b}, 100) 97%)`);
|
|
3895
|
+
}
|
|
3896
|
+
}, h = () => {
|
|
3897
|
+
var c;
|
|
3898
|
+
if (l.value == "gradient") {
|
|
3899
|
+
o.value.sort((I, A) => I.percent - A.percent);
|
|
3900
|
+
let d = "linear-gradient(90deg, ", f;
|
|
3901
|
+
if (y.value == "linear") {
|
|
3902
|
+
f = `linear-gradient(${m.angle}deg, `;
|
|
3903
|
+
for (let I = 0; I < o.value.length; I++) {
|
|
3904
|
+
const { r: A, g: Z, b: ne, a: J, percent: R } = o.value[I];
|
|
3905
|
+
o.value.length - 1 == I ? (d = d + `rgba(${A},${Z},${ne},${J / 100}) ${R}%)`, f = f + `rgba(${A},${Z},${ne},${J / 100}) ${R}%)`) : (d = d + `rgba(${A},${Z},${ne},${J / 100}) ${R}%, `, f = f + `rgba(${A},${Z},${ne},${J / 100}) ${R}%, `);
|
|
3906
|
+
}
|
|
3907
|
+
} else {
|
|
3908
|
+
f = `radial-gradient(circle at ${m.percentageX}% ${m.percentageY}%, `;
|
|
3909
|
+
for (let I = 0; I < o.value.length; I++) {
|
|
3910
|
+
const { r: A, g: Z, b: ne, a: J, percent: R } = o.value[I];
|
|
3911
|
+
o.value.length - 1 == I ? (d = d + `rgba(${A},${Z},${ne},${J / 100}) ${R}%)`, f = f + `rgba(${A},${Z},${ne},${J / 100}) ${R}%)`) : (d = d + `rgba(${A},${Z},${ne},${J / 100}) ${R}%, `, f = f + `rgba(${A},${Z},${ne},${J / 100}) ${R}%, `);
|
|
3912
|
+
}
|
|
3913
|
+
}
|
|
3914
|
+
fe.value.style.backgroundImage = d;
|
|
3915
|
+
let S = (c = a.value) == null ? void 0 : c.querySelector("#ck-cp-target-background");
|
|
3916
|
+
S && (S.style.backgroundImage = f, le.value && s(S.style.backgroundImage));
|
|
3917
|
+
} else {
|
|
3918
|
+
const { r: d, g: f, b: S, a: I } = o.value[0];
|
|
3919
|
+
let A = "";
|
|
3920
|
+
switch (n.type) {
|
|
3921
|
+
case "HEX8":
|
|
3922
|
+
A = Nl(d, f, S, I / 100);
|
|
3923
|
+
break;
|
|
3924
|
+
case "RGBA":
|
|
3925
|
+
A = `rgba(${d},${f},${S},${I / 100})`;
|
|
3926
|
+
break;
|
|
3927
|
+
case "RGB":
|
|
3928
|
+
A = `rgb(${d},${f},${S})`;
|
|
3929
|
+
break;
|
|
3930
|
+
case "HEX":
|
|
3931
|
+
A = Hn(d, f, S);
|
|
3932
|
+
break;
|
|
3933
|
+
}
|
|
3934
|
+
s(A);
|
|
3935
|
+
}
|
|
3936
|
+
}, W = () => {
|
|
3937
|
+
o.value.forEach((c) => {
|
|
3938
|
+
c.hue = Ut(c.r, c.g, c.b);
|
|
3939
|
+
});
|
|
3940
|
+
}, Fe = (c) => {
|
|
3941
|
+
y.value = c, h();
|
|
3942
|
+
}, Ye = () => {
|
|
3943
|
+
var c, d;
|
|
3944
|
+
if (o.value.length > 2) {
|
|
3945
|
+
const f = o.value.findIndex((S) => S.select == !0);
|
|
3946
|
+
if (f !== -1) {
|
|
3947
|
+
const S = o.value[f].id;
|
|
3948
|
+
o.value.splice(f, 1);
|
|
3949
|
+
const I = (c = a.value) == null ? void 0 : c.querySelector(`#clr-gb-${S}`);
|
|
3950
|
+
I == null || I.remove();
|
|
3951
|
+
const A = o.value[0];
|
|
3952
|
+
A && (A.select = !0, Ce = (d = a.value) == null ? void 0 : d.querySelector(`#clr-gb-${A.id}`), Ce == null || Ce.classList.add("select"), ue(A.r, A.g, A.b, A.hue, !1), me(), h());
|
|
3953
|
+
}
|
|
3954
|
+
}
|
|
3955
|
+
}, Ke = () => {
|
|
3956
|
+
var f;
|
|
3957
|
+
const c = (f = a.value) == null ? void 0 : f.querySelector("#cp-btn-eyedropper");
|
|
3958
|
+
c == null || c.classList.add("active"), new EyeDropper().open().then((S) => {
|
|
3959
|
+
const { sRGBHex: I } = S, A = o.value.find((ne) => ne.select == !0), Z = cn(I);
|
|
3960
|
+
if (Z) {
|
|
3961
|
+
const ne = Ut(Z.r, Z.g, Z.b);
|
|
3962
|
+
if (A && (A.hue = ne, A.r = Z.r, A.g = Z.g, A.b = Z.b), ie(Z)) {
|
|
3963
|
+
const J = j();
|
|
3964
|
+
J && (B.value.style.left = `${J.x}px`, B.value.style.top = `${J.y}px`);
|
|
3965
|
+
} else {
|
|
3966
|
+
T.value = ne;
|
|
3967
|
+
const { rgb: J } = jn(ne, 100, 50);
|
|
3968
|
+
Te(J);
|
|
3969
|
+
const R = j();
|
|
3970
|
+
R && (B.value.style.left = `${R.x}px`, B.value.style.top = `${R.y}px`);
|
|
3971
|
+
}
|
|
3972
|
+
me(), O(), h(), c == null || c.classList.remove("active");
|
|
3973
|
+
}
|
|
3974
|
+
}).catch(() => {
|
|
3975
|
+
c == null || c.classList.remove("active");
|
|
3976
|
+
});
|
|
3977
|
+
}, et = (c) => {
|
|
3978
|
+
const { value: d, type: f } = c;
|
|
3979
|
+
if (f != "a") {
|
|
3980
|
+
const S = o.value.find((I) => I.select == !0);
|
|
3981
|
+
if (S) {
|
|
3982
|
+
S.r = parseInt(d.r), S.g = parseInt(d.g), S.b = parseInt(d.b);
|
|
3983
|
+
const I = Ut(S.r, S.g, S.b);
|
|
3984
|
+
S.hue = I, ue(S.r, S.g, S.b, S.hue, !0), h(), O();
|
|
3985
|
+
}
|
|
3986
|
+
} else
|
|
3987
|
+
oe.value = d, h(), O();
|
|
3988
|
+
}, at = (c) => {
|
|
3989
|
+
ae.h = c.h, ae.s = c.s, ae.l = c.l;
|
|
3990
|
+
const d = o.value.find((f) => f.select == !0);
|
|
3991
|
+
if (d && !Number.isNaN(ae.h) && !Number.isNaN(ae.s) && !Number.isNaN(ae.l)) {
|
|
3992
|
+
const { r: f, g: S, b: I } = Bn(ae.h, ae.s / 100, ae.l / 100);
|
|
3993
|
+
d.hue = ae.h, d.r = f, d.g = S, d.b = I, ue(d.r, d.g, d.b, d.hue, !0), h(), O();
|
|
3994
|
+
}
|
|
3995
|
+
}, Pe = () => {
|
|
3996
|
+
if (D.value) {
|
|
3997
|
+
const c = cn(D.value);
|
|
3998
|
+
if (c) {
|
|
3999
|
+
const d = Ut(c.r, c.g, c.b), f = o.value.find((S) => S.select == !0);
|
|
4000
|
+
f && (f.r = c.r, f.g = c.g, f.b = c.b, f.hue = d, ue(c.r, c.g, c.b, f.hue, !0), h(), O(), je(k.value));
|
|
4001
|
+
}
|
|
4002
|
+
}
|
|
4003
|
+
}, me = () => {
|
|
4004
|
+
const c = o.value.find((d) => d.select == !0);
|
|
4005
|
+
c && (D.value = Hn(c.r, c.g, c.b).toUpperCase()), je(k.value);
|
|
4006
|
+
}, Ue = (c) => {
|
|
4007
|
+
i("last-used-pick", c);
|
|
4008
|
+
};
|
|
4009
|
+
window.EyeDropper && (p.value = !0);
|
|
4010
|
+
const tt = (c = "") => {
|
|
4011
|
+
if (l.value == "gradient") {
|
|
4012
|
+
let d = c.includes("linear") ? "linear" : "radial", f = [];
|
|
4013
|
+
if (y.value = d, d == "linear") {
|
|
4014
|
+
let S = /^linear-gradient\((.*)\)$/, I = c.replace(";", "").trim().match(S), A = /,\s*(?![^()]*\))/;
|
|
4015
|
+
if (I) {
|
|
4016
|
+
let Z = I[1].split(A);
|
|
4017
|
+
for (let ne = 0; ne < Z.length; ne++) {
|
|
4018
|
+
const J = Z[ne];
|
|
4019
|
+
let R = {
|
|
4020
|
+
id: ne,
|
|
4021
|
+
r: 0,
|
|
4022
|
+
g: 0,
|
|
4023
|
+
b: 0,
|
|
4024
|
+
a: 100,
|
|
4025
|
+
percent: 100,
|
|
4026
|
+
hue: 0,
|
|
4027
|
+
select: !1
|
|
4028
|
+
};
|
|
4029
|
+
if (J.includes("deg"))
|
|
4030
|
+
m.angle = parseInt(J.replace("deg", ""));
|
|
4031
|
+
else if (J.includes("rgba")) {
|
|
4032
|
+
let ee = J.trim().replace(/rgba|\(|\)|%/g, "").replace(/,/g, " ").split(" ");
|
|
4033
|
+
ee = ee.filter((st) => st.trim() !== ""), R.r = parseInt(ee[0]), R.g = parseInt(ee[1]), R.b = parseInt(ee[2]), R.a = parseFloat(ee[3]) * 100, R.percent = parseInt(ee[4]), f.push(R);
|
|
4034
|
+
} else if (J.includes("rgb")) {
|
|
4035
|
+
let ee = J.trim().replace(/rgb|\(|\)|%/g, "").replace(/,/g, " ").split(" ");
|
|
4036
|
+
ee = ee.filter((st) => st.trim() !== ""), R.r = parseInt(ee[0]), R.g = parseInt(ee[1]), R.b = parseInt(ee[2]), R.percent = parseInt(ee[3]), f.push(R);
|
|
4037
|
+
}
|
|
4038
|
+
}
|
|
4039
|
+
}
|
|
4040
|
+
} else {
|
|
4041
|
+
let S = /^radial-gradient\((.*)\)$/, I = c.replace(";", "").trim().match(S), A = /,\s*(?![^()]*\))/;
|
|
4042
|
+
if (I) {
|
|
4043
|
+
let Z = I[1].split(A);
|
|
4044
|
+
for (let ne = 0; ne < Z.length; ne++) {
|
|
4045
|
+
const J = Z[ne];
|
|
4046
|
+
let R = {
|
|
4047
|
+
id: ne,
|
|
4048
|
+
r: 0,
|
|
4049
|
+
g: 0,
|
|
4050
|
+
b: 0,
|
|
4051
|
+
a: 100,
|
|
4052
|
+
percent: 100,
|
|
4053
|
+
hue: 0,
|
|
4054
|
+
select: !1
|
|
4055
|
+
};
|
|
4056
|
+
if (J.includes("circle at")) {
|
|
4057
|
+
let ee = J.replace("circle at ", "").replace(" ", "").replace(/%/g, " ").trim().split(" ");
|
|
4058
|
+
m.percentageX = parseInt(ee[0]), m.percentageY = parseInt(ee[1]);
|
|
4059
|
+
} else if (J.includes("rgba")) {
|
|
4060
|
+
let ee = J.replace(/rgba|\(|\)|%/g, "").replace(/,/g, " ").split(" ");
|
|
4061
|
+
ee = ee.filter((st) => st.trim() !== ""), R.r = parseInt(ee[0]), R.g = parseInt(ee[1]), R.b = parseInt(ee[2]), R.a = parseFloat(ee[3]) * 100, R.percent = parseInt(ee[4]), f.push(R);
|
|
4062
|
+
} else if (J.includes("rgb")) {
|
|
4063
|
+
let ee = J.replace(/rgb|\(|\)|%/g, "").replace(/,/g, " ").split(" ");
|
|
4064
|
+
ee = ee.filter((st) => st.trim() !== ""), R.r = parseInt(ee[0]), R.g = parseInt(ee[1]), R.b = parseInt(ee[2]), R.percent = parseInt(ee[3]), f.push(R);
|
|
4065
|
+
}
|
|
4066
|
+
}
|
|
4067
|
+
}
|
|
4068
|
+
}
|
|
4069
|
+
f.length > 1 && (o.value = f, o.value[0].select = !0, oe.value = o.value[0].a);
|
|
4070
|
+
} else if (c) {
|
|
4071
|
+
let d = {
|
|
4072
|
+
r: 0,
|
|
4073
|
+
g: 0,
|
|
4074
|
+
b: 0,
|
|
4075
|
+
a: 0
|
|
4076
|
+
};
|
|
4077
|
+
if (c.includes("#"))
|
|
4078
|
+
if (c.length >= 8)
|
|
4079
|
+
d = Rl(c);
|
|
4080
|
+
else {
|
|
4081
|
+
let f = cn(c);
|
|
4082
|
+
f ? (d.a = 1, d.r = f.r, d.g = f.g, d.b = f.b) : d = null;
|
|
4083
|
+
}
|
|
4084
|
+
else if (c.includes("rgb"))
|
|
4085
|
+
if (c.includes("rgba"))
|
|
4086
|
+
d = Bl(c);
|
|
4087
|
+
else {
|
|
4088
|
+
let f = jl(c);
|
|
4089
|
+
f ? (d.a = 1, d.r = f.r, d.g = f.g, d.b = f.b) : d = null;
|
|
4090
|
+
}
|
|
4091
|
+
d && (o.value[0].r = d.r, o.value[0].b = d.b, o.value[0].g = d.g, o.value[0].a = parseInt((d.a * 100).toFixed(0)), oe.value = o.value[0].a, o.value[0].hue = 0);
|
|
4092
|
+
}
|
|
4093
|
+
}, je = (c) => {
|
|
4094
|
+
const d = o.value.find((f) => f.select == !0);
|
|
4095
|
+
if (d) {
|
|
4096
|
+
switch (c) {
|
|
4097
|
+
case "RGB":
|
|
4098
|
+
break;
|
|
4099
|
+
case "HSL": {
|
|
4100
|
+
const { h: f, s: S, l: I } = Yn(d.r, d.g, d.b);
|
|
4101
|
+
ae.h = Math.round(f), ae.s = Math.round(S * 100), ae.l = Math.round(I * 100);
|
|
4102
|
+
break;
|
|
4103
|
+
}
|
|
4104
|
+
}
|
|
4105
|
+
k.value = c;
|
|
4106
|
+
}
|
|
4107
|
+
}, Ze = (c) => {
|
|
4108
|
+
c && tt(c), ge();
|
|
4109
|
+
};
|
|
4110
|
+
Dt(
|
|
4111
|
+
() => n.modelValue,
|
|
4112
|
+
(c, d) => {
|
|
4113
|
+
c !== d && c !== r.value && (o.value.forEach((f) => {
|
|
4114
|
+
const S = se == null ? void 0 : se.querySelector(`#clr-gb-${f.id}`);
|
|
4115
|
+
S == null || S.remove();
|
|
4116
|
+
}), Ze(c));
|
|
4117
|
+
}
|
|
4118
|
+
);
|
|
4119
|
+
const Yt = (c) => {
|
|
4120
|
+
o.value.forEach((d) => {
|
|
4121
|
+
const f = se == null ? void 0 : se.querySelector(`#clr-gb-${d.id}`);
|
|
4122
|
+
f == null || f.remove();
|
|
4123
|
+
}), c !== "solid" ? (l.value = "gradient", setTimeout(() => {
|
|
4124
|
+
var d;
|
|
4125
|
+
se = (d = a.value) == null ? void 0 : d.querySelector(".gradient-bar"), Fe(c), ge();
|
|
4126
|
+
}, 200)) : c === "solid" && (l.value = "solid", o.value = o.value.map((d) => (d.select = !1, d)), o.value[0].select = !0, setTimeout(() => {
|
|
4127
|
+
Ze(n.modelValue);
|
|
4128
|
+
}, 200));
|
|
4129
|
+
};
|
|
4130
|
+
return Tt(() => {
|
|
4131
|
+
var c;
|
|
4132
|
+
l.value = n.modelValue.includes("linear") || n.modelValue.includes("radial") ? "gradient" : "solid", l.value == "gradient" && (se = (c = a.value) == null ? void 0 : c.querySelector(".gradient-bar")), Ze(n.modelValue), je(k.value), ol(() => {
|
|
4133
|
+
le.value = !0;
|
|
4134
|
+
});
|
|
4135
|
+
}), (c, d) => (w(), N("div", {
|
|
4136
|
+
ref_key: "pickerTemplateRef",
|
|
4137
|
+
ref: a,
|
|
4138
|
+
class: we(["ck-cp-container", e.disabled ? "ck-cp-disabled " : ""]),
|
|
4139
|
+
"cp-theme": e.theme
|
|
4140
|
+
}, [
|
|
4141
|
+
e.variant == "gradient" ? (w(), N("div", No, [
|
|
4142
|
+
q(Po, {
|
|
4143
|
+
class: "mr-auto",
|
|
4144
|
+
variant: e.variant,
|
|
4145
|
+
mode: l.value,
|
|
4146
|
+
"model-value": e.modelValue,
|
|
4147
|
+
iconClasses: e.iconClasses,
|
|
4148
|
+
gradientType: y.value,
|
|
4149
|
+
onOnChangeMode: Yt
|
|
4150
|
+
}, null, 8, ["variant", "mode", "model-value", "iconClasses", "gradientType"])
|
|
4151
|
+
])) : K("", !0),
|
|
4152
|
+
l.value == "gradient" && e.variant == "gradient" ? (w(), N("div", Ro, [
|
|
4153
|
+
q(Eo, {
|
|
4154
|
+
gradientType: y.value,
|
|
4155
|
+
onOnAddColor: z,
|
|
4156
|
+
onOnMouseDown: Re,
|
|
4157
|
+
onOnDeleteColor: Ye
|
|
4158
|
+
}, null, 8, ["gradientType"]),
|
|
4159
|
+
q(Ao, {
|
|
4160
|
+
percentageY: m.percentageY,
|
|
4161
|
+
"onUpdate:percentageY": d[0] || (d[0] = (f) => m.percentageY = f),
|
|
4162
|
+
angle: m.angle,
|
|
4163
|
+
"onUpdate:angle": d[1] || (d[1] = (f) => m.angle = f),
|
|
4164
|
+
percentageX: m.percentageX,
|
|
4165
|
+
"onUpdate:percentageX": d[2] || (d[2] = (f) => m.percentageX = f),
|
|
4166
|
+
inputType: k.value,
|
|
4167
|
+
mode: l.value,
|
|
4168
|
+
gradientType: y.value,
|
|
4169
|
+
onOnInput: h
|
|
4170
|
+
}, null, 8, ["percentageY", "angle", "percentageX", "inputType", "mode", "gradientType"])
|
|
4171
|
+
])) : (w(), N("div", Bo, [
|
|
4172
|
+
e.presetColors ? (w(), N("div", jo, [
|
|
4173
|
+
d[10] || (d[10] = P("div", { class: "text-oc-text-400 text-sm my-3 font-medium" }, "Choose color", -1)),
|
|
4174
|
+
P("div", Ho, [
|
|
4175
|
+
(w(!0), N(We, null, vt(e.presetColors, (f) => (w(), N("div", {
|
|
4176
|
+
key: `color-${f}`,
|
|
4177
|
+
class: "ck-cp-color-item !w-[32px] !h-[32px]",
|
|
4178
|
+
style: lt(`background:${f}`),
|
|
4179
|
+
onClick: (S) => Ue(f)
|
|
4180
|
+
}, null, 12, Yo))), 128))
|
|
4181
|
+
])
|
|
4182
|
+
])) : K("", !0)
|
|
4183
|
+
])),
|
|
4184
|
+
q(Mo, { onOnMouseDown: Ve }),
|
|
4185
|
+
P("div", Uo, [
|
|
4186
|
+
q(Oo, {
|
|
4187
|
+
class: we(p.value ? "max-w-[90%]" : ""),
|
|
4188
|
+
modelValue: T.value,
|
|
4189
|
+
"onUpdate:modelValue": d[3] || (d[3] = (f) => T.value = f),
|
|
4190
|
+
onOnInput: d[4] || (d[4] = (f) => C(!1)),
|
|
4191
|
+
onOnChange: re
|
|
4192
|
+
}, null, 8, ["class", "modelValue"]),
|
|
4193
|
+
p.value ? (w(), N("button", {
|
|
4194
|
+
key: 0,
|
|
4195
|
+
id: "cp-btn-eyedropper",
|
|
4196
|
+
type: "button",
|
|
4197
|
+
class: "cp-btn",
|
|
4198
|
+
style: { padding: "7px" },
|
|
4199
|
+
onClick: Ke
|
|
4200
|
+
}, d[11] || (d[11] = [
|
|
4201
|
+
P("svg", {
|
|
4202
|
+
version: "1.1",
|
|
4203
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
4204
|
+
width: "32",
|
|
4205
|
+
height: "32",
|
|
4206
|
+
viewBox: "0 0 32 32"
|
|
4207
|
+
}, [
|
|
4208
|
+
P("path", { d: "M21.35 1.825l-6.344 6.35-0.588-0.588c-0.781-0.781-2.050-0.781-2.831 0s-0.781 2.050 0 2.831l10 10c0.781 0.781 2.050 0.781 2.831 0s0.781-2.050 0-2.831l-0.587-0.587 6.344-6.35c2.438-2.438 2.438-6.388 0-8.819s-6.387-2.438-8.819 0zM3.462 20.206c-0.938 0.938-1.462 2.212-1.462 3.538v2.65l-1.663 2.494c-0.531 0.794-0.425 1.85 0.25 2.525s1.731 0.781 2.525 0.25l2.494-1.663h2.65c1.325 0 2.6-0.525 3.537-1.462l7.544-7.544-2.831-2.831-7.544 7.544c-0.188 0.188-0.444 0.294-0.706 0.294h-2.256v-2.256c0-0.262 0.106-0.519 0.294-0.706l7.544-7.544-2.831-2.831-7.544 7.544z" })
|
|
4209
|
+
], -1)
|
|
4210
|
+
]))) : K("", !0)
|
|
4211
|
+
]),
|
|
4212
|
+
e.showAlpha ? (w(), ce(Co, {
|
|
4213
|
+
key: 3,
|
|
4214
|
+
modelValue: oe.value,
|
|
4215
|
+
"onUpdate:modelValue": d[5] || (d[5] = (f) => oe.value = f),
|
|
4216
|
+
onOnInput: d[6] || (d[6] = (f) => Se(f.target.value))
|
|
4217
|
+
}, null, 8, ["modelValue"])) : K("", !0),
|
|
4218
|
+
Ol(P("div", Xo, null, 512), [
|
|
4219
|
+
[Tl, !1]
|
|
4220
|
+
]),
|
|
4221
|
+
P("div", Qo, [
|
|
4222
|
+
q(wo, {
|
|
4223
|
+
"model-value": k.value,
|
|
4224
|
+
"onUpdate:modelValue": je
|
|
4225
|
+
}, null, 8, ["model-value"]),
|
|
4226
|
+
le.value && e.showInputSet ? (w(), N("div", Wo, [
|
|
4227
|
+
k.value == "HEX" ? (w(), ce(yo, {
|
|
4228
|
+
key: 0,
|
|
4229
|
+
modelValue: D.value,
|
|
4230
|
+
"onUpdate:modelValue": [
|
|
4231
|
+
d[7] || (d[7] = (f) => D.value = f),
|
|
4232
|
+
Pe
|
|
4233
|
+
]
|
|
4234
|
+
}, null, 8, ["modelValue"])) : K("", !0),
|
|
4235
|
+
k.value == "RGB" ? (w(), ce(nl, {
|
|
4236
|
+
key: 1,
|
|
4237
|
+
"rgb-value": o.value.find((f) => f.select == !0),
|
|
4238
|
+
onUpdateRgbValue: et
|
|
4239
|
+
}, null, 8, ["rgb-value"])) : K("", !0),
|
|
4240
|
+
k.value == "HSL" ? (w(), ce(nl, {
|
|
4241
|
+
key: 2,
|
|
4242
|
+
"input-type": "HSL",
|
|
4243
|
+
"hsl-value": ae,
|
|
4244
|
+
onUpdateHslValue: at
|
|
4245
|
+
}, null, 8, ["hsl-value"])) : K("", !0),
|
|
4246
|
+
e.showAlpha ? (w(), ce(xo, {
|
|
4247
|
+
key: 3,
|
|
4248
|
+
modelValue: oe.value,
|
|
4249
|
+
"onUpdate:modelValue": [
|
|
4250
|
+
d[8] || (d[8] = (f) => oe.value = f),
|
|
4251
|
+
d[9] || (d[9] = (f) => Se(f))
|
|
4252
|
+
]
|
|
4253
|
+
}, null, 8, ["modelValue"])) : K("", !0)
|
|
4254
|
+
])) : K("", !0)
|
|
4255
|
+
]),
|
|
4256
|
+
d[12] || (d[12] = P("div", { class: "text-oc-text-400 text-sm my-3 font-medium font-inter" }, "Last used", -1)),
|
|
4257
|
+
u.value.length > 0 && e.showColorList ? (w(), N("div", qo, [
|
|
4258
|
+
(w(!0), N(We, null, vt(g.value, (f) => (w(), N("div", {
|
|
4259
|
+
key: `color-${f}`,
|
|
4260
|
+
class: "ck-cp-color-item !w-[32px] !h-[32px]",
|
|
4261
|
+
style: lt(`background:${f}`),
|
|
4262
|
+
onClick: (S) => Ue(f)
|
|
4263
|
+
}, null, 12, Go))), 128))
|
|
4264
|
+
])) : K("", !0)
|
|
4265
|
+
], 10, Lo));
|
|
4266
|
+
}
|
|
4267
|
+
}, Ko = { class: "flex flex-col pt-10 px-7 gap-y-7 items-center" }, Zo = { class: "flex flex-col gap-y-4 text-center items-center" }, Jo = {
|
|
4268
|
+
key: 0,
|
|
4269
|
+
class: "text-xl font-medium"
|
|
4270
|
+
}, ei = {
|
|
4271
|
+
key: 0,
|
|
4272
|
+
class: "text-sm text-oc-text-400"
|
|
4273
|
+
}, di = /* @__PURE__ */ ll({
|
|
4274
|
+
__name: "OcOnboardingProgressbar",
|
|
4275
|
+
props: {
|
|
4276
|
+
title: {
|
|
4277
|
+
type: String,
|
|
4278
|
+
default: ""
|
|
4279
|
+
},
|
|
4280
|
+
description: {
|
|
4281
|
+
type: String,
|
|
4282
|
+
default: ""
|
|
4283
|
+
},
|
|
4284
|
+
value: {
|
|
4285
|
+
type: [String, Number],
|
|
4286
|
+
default: "0"
|
|
4287
|
+
},
|
|
4288
|
+
chartData: {
|
|
4289
|
+
type: Array,
|
|
4290
|
+
default: () => []
|
|
4291
|
+
}
|
|
4292
|
+
},
|
|
4293
|
+
setup(e) {
|
|
4294
|
+
const t = e, n = Me(() => ({
|
|
4295
|
+
grid: {
|
|
4296
|
+
containLabel: !1
|
|
4297
|
+
},
|
|
4298
|
+
series: [
|
|
4299
|
+
{
|
|
4300
|
+
name: "Onboarding Progressbar",
|
|
4301
|
+
type: "pie",
|
|
4302
|
+
emphasis: {
|
|
4303
|
+
disabled: !0
|
|
4304
|
+
},
|
|
4305
|
+
avoidLabelOverlap: !1,
|
|
4306
|
+
label: {
|
|
4307
|
+
color: "#000",
|
|
4308
|
+
fontWeight: "bold",
|
|
4309
|
+
fontFamily: "Inter",
|
|
4310
|
+
fontSize: "24",
|
|
4311
|
+
position: "center",
|
|
4312
|
+
formatter: () => t.value + "%"
|
|
4313
|
+
},
|
|
4314
|
+
labelLine: {
|
|
4315
|
+
show: !0
|
|
4316
|
+
},
|
|
4317
|
+
radius: ["60%", "100%"],
|
|
4318
|
+
data: t.chartData
|
|
4319
|
+
}
|
|
4320
|
+
]
|
|
4321
|
+
}));
|
|
4322
|
+
return (l, a) => (w(), N("div", Ko, [
|
|
4323
|
+
q(M(Xl), {
|
|
4324
|
+
class: "w-[140px] bg-white rounded-full h-[140px]",
|
|
4325
|
+
"additional-options": n.value,
|
|
4326
|
+
"tooltip-formatter": () => null,
|
|
4327
|
+
"tooltip-value-formatter": () => null
|
|
4328
|
+
}, null, 8, ["additional-options"]),
|
|
4329
|
+
P("div", Zo, [
|
|
4330
|
+
e.title ? (w(), N("span", Jo, Et(e.title), 1)) : K("", !0),
|
|
4331
|
+
Qe(l.$slots, "description", {}, () => [
|
|
4332
|
+
e.description ? (w(), N("span", ei, Et(e.description), 1)) : K("", !0)
|
|
4333
|
+
])
|
|
4334
|
+
])
|
|
4335
|
+
]));
|
|
4336
|
+
}
|
|
4337
|
+
}), ci = Vl(
|
|
4338
|
+
() => import("./OcCodeBlock-chTpuRDc.js")
|
|
4339
|
+
);
|
|
4340
|
+
export {
|
|
4341
|
+
vi as BarChart,
|
|
4342
|
+
yi as BarRaceChart,
|
|
4343
|
+
xi as Card,
|
|
4344
|
+
ci as CodeBlock,
|
|
4345
|
+
no as ColorPicker,
|
|
4346
|
+
zo as ColorPickerPopup,
|
|
4347
|
+
si as DataTable,
|
|
4348
|
+
eo as FilterForm,
|
|
4349
|
+
qa as FilterSearch,
|
|
4350
|
+
za as FilterSearchFor,
|
|
4351
|
+
gi as LineChart,
|
|
4352
|
+
di as OnboardingProgressbar,
|
|
4353
|
+
Xl as PieChart,
|
|
4354
|
+
ui as TextEditor
|
|
4355
|
+
};
|