dsp-semactic 0.6.21 → 0.6.24
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/README.md +5 -5
- package/dist/index.cjs.js +9 -9
- package/dist/index.es.js +397 -397
- package/package.json +48 -48
package/dist/index.es.js
CHANGED
|
@@ -66,7 +66,7 @@ const Ls = {
|
|
|
66
66
|
},
|
|
67
67
|
emits: ["update:modelValue"],
|
|
68
68
|
setup(W, { emit: Le }) {
|
|
69
|
-
const U = W, O = Le, { t: Ze, locale:
|
|
69
|
+
const U = W, O = Le, { t: Ze, locale: k } = Ka(), We = T(!1), me = T("days"), _t = /* @__PURE__ */ new Date(), m = y(() => U.minDate instanceof Date ? U.minDate : _t), xe = T(m.value.getMonth()), $e = T(m.value.getFullYear()), ke = T(m.value.getMonth()), ue = T(m.value.getFullYear()), A = T(m.value.getMonth()), de = T(m.value.getFullYear()), Xe = T("start"), Ye = T(null), Qe = T(null);
|
|
70
70
|
function j() {
|
|
71
71
|
const z = m.value, Q = z.getMonth(), Z = z.getFullYear(), ve = Q === 11 ? 0 : Q + 1, ze = Q === 11 ? Z + 1 : Z;
|
|
72
72
|
return { left: { month: Q, year: Z }, right: { month: ve, year: ze } };
|
|
@@ -111,7 +111,7 @@ const Ls = {
|
|
|
111
111
|
});
|
|
112
112
|
y(() => {
|
|
113
113
|
const z = new Date($e.value, xe.value, 1);
|
|
114
|
-
return new Intl.DateTimeFormat(
|
|
114
|
+
return new Intl.DateTimeFormat(k.value, { month: "long", year: "numeric" }).format(z);
|
|
115
115
|
});
|
|
116
116
|
const ht = y(
|
|
117
117
|
() => Qe.value === "left" ? ke.value : Qe.value === "right" ? A.value : xe.value
|
|
@@ -119,12 +119,12 @@ const Ls = {
|
|
|
119
119
|
() => Qe.value === "left" ? ue.value : Qe.value === "right" ? de.value : $e.value
|
|
120
120
|
), Gt = y(() => {
|
|
121
121
|
const z = new Date($e.value, xe.value, 1);
|
|
122
|
-
return new Intl.DateTimeFormat(
|
|
122
|
+
return new Intl.DateTimeFormat(k.value, { month: "long" }).format(z);
|
|
123
123
|
}), Xt = y(() => {
|
|
124
124
|
const z = new Date(rt.value, ht.value, 1);
|
|
125
|
-
return new Intl.DateTimeFormat(
|
|
125
|
+
return new Intl.DateTimeFormat(k.value, { month: "long" }).format(z);
|
|
126
126
|
}), zt = y(() => {
|
|
127
|
-
const z = new Intl.DateTimeFormat(
|
|
127
|
+
const z = new Intl.DateTimeFormat(k.value, { month: "short" });
|
|
128
128
|
return Array.from(
|
|
129
129
|
{ length: 12 },
|
|
130
130
|
(Q, Z) => z.format(new Date(2024, Z, 1))
|
|
@@ -136,7 +136,7 @@ const Ls = {
|
|
|
136
136
|
const z = ot.value;
|
|
137
137
|
return z.length ? `${z[0]} – ${z[z.length - 1]}` : "";
|
|
138
138
|
}), cn = y(() => {
|
|
139
|
-
const z = new Intl.DateTimeFormat(
|
|
139
|
+
const z = new Intl.DateTimeFormat(k.value, { weekday: "short" }), Q = new Date(2024, 0, 1), Z = [];
|
|
140
140
|
for (let ve = 0; ve < 7; ve++) {
|
|
141
141
|
const ze = new Date(Q);
|
|
142
142
|
ze.setDate(Q.getDate() + ve), Z.push(z.format(ze).slice(0, 2));
|
|
@@ -151,24 +151,24 @@ const Ls = {
|
|
|
151
151
|
}
|
|
152
152
|
const ce = y(
|
|
153
153
|
() => Tt($e.value, xe.value)
|
|
154
|
-
),
|
|
154
|
+
), qe = y(
|
|
155
155
|
() => Tt(ue.value, ke.value)
|
|
156
156
|
), _e = y(
|
|
157
157
|
() => Tt(de.value, A.value)
|
|
158
158
|
);
|
|
159
159
|
y(() => {
|
|
160
160
|
const z = new Date(ue.value, ke.value, 1);
|
|
161
|
-
return new Intl.DateTimeFormat(
|
|
161
|
+
return new Intl.DateTimeFormat(k.value, { month: "long", year: "numeric" }).format(z);
|
|
162
162
|
}), y(() => {
|
|
163
163
|
const z = new Date(de.value, A.value, 1);
|
|
164
|
-
return new Intl.DateTimeFormat(
|
|
164
|
+
return new Intl.DateTimeFormat(k.value, { month: "long", year: "numeric" }).format(z);
|
|
165
165
|
});
|
|
166
166
|
const Fe = y(() => {
|
|
167
167
|
const z = new Date(ue.value, ke.value, 1);
|
|
168
|
-
return new Intl.DateTimeFormat(
|
|
168
|
+
return new Intl.DateTimeFormat(k.value, { month: "long" }).format(z);
|
|
169
169
|
}), lt = y(() => {
|
|
170
170
|
const z = new Date(de.value, A.value, 1);
|
|
171
|
-
return new Intl.DateTimeFormat(
|
|
171
|
+
return new Intl.DateTimeFormat(k.value, { month: "long" }).format(z);
|
|
172
172
|
}), $t = y(
|
|
173
173
|
() => U.availableDates && U.availableDates.length > 0
|
|
174
174
|
), at = y(() => $t.value ? [
|
|
@@ -189,7 +189,7 @@ const Ls = {
|
|
|
189
189
|
{ id: "lastYear", labelKey: "datepicker.quickSelect.lastYear" }
|
|
190
190
|
]), Mt = T({ top: 0, left: 0 });
|
|
191
191
|
function Re() {
|
|
192
|
-
if (!Nt.value || !
|
|
192
|
+
if (!Nt.value || !We.value) return;
|
|
193
193
|
const z = Nt.value.getBoundingClientRect(), Q = window.innerWidth || document.documentElement.clientWidth, Z = window.innerHeight || document.documentElement.clientHeight;
|
|
194
194
|
let ve = z.left, ze = z.bottom + 4;
|
|
195
195
|
const mt = Ut.value;
|
|
@@ -202,7 +202,7 @@ const Ls = {
|
|
|
202
202
|
}
|
|
203
203
|
Mt.value = { top: ze, left: ve };
|
|
204
204
|
}
|
|
205
|
-
const st = y(() => !Nt.value || !
|
|
205
|
+
const st = y(() => !Nt.value || !We.value ? {} : {
|
|
206
206
|
position: "fixed",
|
|
207
207
|
left: `${Mt.value.left}px`,
|
|
208
208
|
top: `${Mt.value.top}px`,
|
|
@@ -298,12 +298,12 @@ const Ls = {
|
|
|
298
298
|
const ve = z === "start" && Z.start ? Z.start : Z.end || Z.start;
|
|
299
299
|
ve && (xe.value = ve.getMonth(), $e.value = ve.getFullYear());
|
|
300
300
|
}
|
|
301
|
-
Nt.value = He.value ? bt.value?.closest(".dss-datepicker__input-wrap") : tt.value, me.value = "days", Qe.value = null,
|
|
301
|
+
Nt.value = He.value ? bt.value?.closest(".dss-datepicker__input-wrap") : tt.value, me.value = "days", Qe.value = null, We.value = !0, ye(() => {
|
|
302
302
|
Re();
|
|
303
303
|
});
|
|
304
304
|
}
|
|
305
305
|
function je() {
|
|
306
|
-
me.value = "days", Qe.value = null, Ye.value = null,
|
|
306
|
+
me.value = "days", Qe.value = null, Ye.value = null, We.value = !1;
|
|
307
307
|
}
|
|
308
308
|
function ge(z, Q) {
|
|
309
309
|
Qe.value = z, me.value = Q;
|
|
@@ -410,7 +410,7 @@ const Ls = {
|
|
|
410
410
|
}
|
|
411
411
|
}
|
|
412
412
|
Bt(yt, () => {
|
|
413
|
-
U.doubleCalendar && Lt.value &&
|
|
413
|
+
U.doubleCalendar && Lt.value && We.value && Je();
|
|
414
414
|
}, { deep: !0 });
|
|
415
415
|
let nl = null, xn = null, ul = null;
|
|
416
416
|
function El() {
|
|
@@ -420,7 +420,7 @@ const Ls = {
|
|
|
420
420
|
z === "years" && ye(() => {
|
|
421
421
|
kt.value?.querySelector(`[data-year="${rt.value}"]`)?.scrollIntoView({ block: "center", behavior: "auto" });
|
|
422
422
|
});
|
|
423
|
-
}), Bt(
|
|
423
|
+
}), Bt(We, (z) => {
|
|
424
424
|
El(), z && (nl = (Q) => {
|
|
425
425
|
Q.key === "Escape" && (me.value === "years" || me.value === "months" ? ct() : je());
|
|
426
426
|
}, xn = () => {
|
|
@@ -523,7 +523,7 @@ const Ls = {
|
|
|
523
523
|
}, null, 8, Ds)
|
|
524
524
|
], 512)) : R("", !0),
|
|
525
525
|
(c(), Ul(Xl, { to: "body" }, [
|
|
526
|
-
|
|
526
|
+
We.value ? (c(), d("div", {
|
|
527
527
|
key: 0,
|
|
528
528
|
class: "dss-datepicker__overlay",
|
|
529
529
|
onClick: Oe(je, ["self"])
|
|
@@ -583,7 +583,7 @@ const Ls = {
|
|
|
583
583
|
}, V(Z), 1))), 128))
|
|
584
584
|
]),
|
|
585
585
|
l("div", qs, [
|
|
586
|
-
(c(!0), d(ne, null, be(
|
|
586
|
+
(c(!0), d(ne, null, be(qe.value, (Z, ve) => (c(), d(ne, {
|
|
587
587
|
key: "L-" + ve
|
|
588
588
|
}, [
|
|
589
589
|
Z ? (c(), d("button", {
|
|
@@ -883,13 +883,13 @@ const Ls = {
|
|
|
883
883
|
},
|
|
884
884
|
emits: ["add-marker", "update-marker", "delete-marker"],
|
|
885
885
|
setup(W, { emit: Le }) {
|
|
886
|
-
const { t: U, locale: O } = Ka(), Ze = Le,
|
|
886
|
+
const { t: U, locale: O } = Ka(), Ze = Le, k = T(null), We = T(null), me = T(null), _t = T(0), m = T(0);
|
|
887
887
|
let xe = null, $e = null;
|
|
888
888
|
const ke = 20, ue = y(() => {
|
|
889
|
-
if (m.value, _t.value, !
|
|
889
|
+
if (m.value, _t.value, !k.value || !We.value) return 0;
|
|
890
890
|
try {
|
|
891
|
-
const e =
|
|
892
|
-
return
|
|
891
|
+
const e = k.value.getBoundingClientRect();
|
|
892
|
+
return We.value.getBoundingClientRect().top - e.top;
|
|
893
893
|
} catch {
|
|
894
894
|
return 0;
|
|
895
895
|
}
|
|
@@ -1182,7 +1182,7 @@ const Ls = {
|
|
|
1182
1182
|
}), ce = y(() => {
|
|
1183
1183
|
const e = j.value;
|
|
1184
1184
|
return e && e.crosshair && e.crosshair.color ? e.crosshair.color : "#666";
|
|
1185
|
-
}),
|
|
1185
|
+
}), qe = y(() => {
|
|
1186
1186
|
const e = j.value;
|
|
1187
1187
|
return !e || !e.zoom ? !1 : e.zoom.enabled === !0;
|
|
1188
1188
|
}), _e = y(() => {
|
|
@@ -1308,13 +1308,13 @@ const Ls = {
|
|
|
1308
1308
|
if (e instanceof Date)
|
|
1309
1309
|
t = new Date(e.getFullYear(), e.getMonth(), e.getDate());
|
|
1310
1310
|
else if (typeof e == "string") {
|
|
1311
|
-
const [C, _,
|
|
1311
|
+
const [C, _, M] = e.split("-"), P = Number(M?.length === 2 ? `20${M}` : M);
|
|
1312
1312
|
t = new Date(P, Number(_) - 1, Number(C));
|
|
1313
1313
|
} else
|
|
1314
1314
|
return 0;
|
|
1315
1315
|
let r = 0, h = 1 / 0;
|
|
1316
1316
|
return o.forEach((C, _) => {
|
|
1317
|
-
const [
|
|
1317
|
+
const [M, P, F] = C.split("-"), B = Number(F?.length === 2 ? `20${F}` : F), D = new Date(B, Number(P) - 1, Number(M)), ae = Math.abs(D - t);
|
|
1318
1318
|
ae < h && (h = ae, r = _);
|
|
1319
1319
|
}), r;
|
|
1320
1320
|
}
|
|
@@ -1367,16 +1367,16 @@ const Ls = {
|
|
|
1367
1367
|
}), Ct = y(() => {
|
|
1368
1368
|
const { width: e, height: o } = mt.value, t = ze.value;
|
|
1369
1369
|
let r, h;
|
|
1370
|
-
const C = q.value.left, _ = q.value.right,
|
|
1370
|
+
const C = q.value.left, _ = q.value.right, M = q.value.top, P = q.value.bottom, F = q.value.width, B = q.value.height;
|
|
1371
1371
|
switch (t) {
|
|
1372
1372
|
case "center":
|
|
1373
|
-
r = C + (F - e) / 2, h =
|
|
1373
|
+
r = C + (F - e) / 2, h = M + (B - o) / 2;
|
|
1374
1374
|
break;
|
|
1375
1375
|
case "top-left":
|
|
1376
|
-
r = C + 15, h =
|
|
1376
|
+
r = C + 15, h = M + 5;
|
|
1377
1377
|
break;
|
|
1378
1378
|
case "top-right":
|
|
1379
|
-
r = _ - e - 15, h =
|
|
1379
|
+
r = _ - e - 15, h = M + 5;
|
|
1380
1380
|
break;
|
|
1381
1381
|
case "bottom-left":
|
|
1382
1382
|
r = C + 15, h = P - o - 5;
|
|
@@ -1684,7 +1684,7 @@ const Ls = {
|
|
|
1684
1684
|
}
|
|
1685
1685
|
return;
|
|
1686
1686
|
}
|
|
1687
|
-
if (se.value.isDragging && se.value.scale > 1 && Ln.value &&
|
|
1687
|
+
if (se.value.isDragging && se.value.scale > 1 && Ln.value && qe.value) {
|
|
1688
1688
|
Pe.value.show = !1;
|
|
1689
1689
|
const Ie = e.clientX - se.value.lastMouseX, { minX: re, maxX: Se } = rn.value, Ae = Se - re || 1, it = Ie * 0.8;
|
|
1690
1690
|
se.value.offsetX += it;
|
|
@@ -1696,8 +1696,8 @@ const Ls = {
|
|
|
1696
1696
|
Pe.value.show = !1;
|
|
1697
1697
|
return;
|
|
1698
1698
|
}
|
|
1699
|
-
const { minX: _, maxX:
|
|
1700
|
-
if (we >= 0 && we <=
|
|
1699
|
+
const { minX: _, maxX: M } = rn.value, P = M - _ || 1, F = P / se.value.scale, B = _ - se.value.offsetX / q.value.width * P, D = (r - q.value.left) / q.value.width, ae = B + D * F, we = Math.round(ae);
|
|
1700
|
+
if (we >= 0 && we <= M) {
|
|
1701
1701
|
const Ie = Jt(we), re = gl.value.map((Se, Ae) => {
|
|
1702
1702
|
const fe = A.series.findIndex((Te) => Te === Se), it = Se.data[we];
|
|
1703
1703
|
return {
|
|
@@ -1727,8 +1727,8 @@ const Ls = {
|
|
|
1727
1727
|
});
|
|
1728
1728
|
return;
|
|
1729
1729
|
}
|
|
1730
|
-
const h = Math.max(0, q.value.left - 20), C = q.value.right, _ = q.value.top,
|
|
1731
|
-
t >= h && t <= C && r >= _ && r <=
|
|
1730
|
+
const h = Math.max(0, q.value.left - 20), C = q.value.right, _ = q.value.top, M = q.value.bottom + 80;
|
|
1731
|
+
t >= h && t <= C && r >= _ && r <= M && (Be.value.show = !1, ye(() => {
|
|
1732
1732
|
Be.value.show = !0, Be.value.x = e.clientX, Be.value.y = e.clientY, Be.value.categoryIndex = null;
|
|
1733
1733
|
const P = Math.max(q.value.left, Math.min(t, q.value.right)) - q.value.left, B = q.value.width / oa.value.length, D = Math.floor(P / B);
|
|
1734
1734
|
D >= 0 && D < oa.value.length && (Be.value.categoryIndex = D);
|
|
@@ -1862,29 +1862,29 @@ const Ls = {
|
|
|
1862
1862
|
C.onload = () => {
|
|
1863
1863
|
clearTimeout(_);
|
|
1864
1864
|
try {
|
|
1865
|
-
const
|
|
1866
|
-
|
|
1867
|
-
const F =
|
|
1865
|
+
const M = document.createElement("canvas"), P = M.getContext("2d");
|
|
1866
|
+
M.width = o, M.height = t, P.fillStyle = "#fafafa", P.fillRect(0, 0, o, t), P.drawImage(C, 0, 0, o, t);
|
|
1867
|
+
const F = M.toDataURL("image/png");
|
|
1868
1868
|
r(F);
|
|
1869
|
-
} catch (
|
|
1870
|
-
console.warn("Canvas conversion failed:",
|
|
1869
|
+
} catch (M) {
|
|
1870
|
+
console.warn("Canvas conversion failed:", M), r(e);
|
|
1871
1871
|
}
|
|
1872
|
-
}, C.onerror = (
|
|
1873
|
-
clearTimeout(_), console.warn("Failed to load image:", e,
|
|
1872
|
+
}, C.onerror = (M) => {
|
|
1873
|
+
clearTimeout(_), console.warn("Failed to load image:", e, M), r(e);
|
|
1874
1874
|
}, C.src = e;
|
|
1875
1875
|
}), Cl = async () => {
|
|
1876
1876
|
try {
|
|
1877
1877
|
const e = Tl();
|
|
1878
1878
|
setTimeout(async () => {
|
|
1879
1879
|
try {
|
|
1880
|
-
const o =
|
|
1880
|
+
const o = We.value;
|
|
1881
1881
|
if (!o) {
|
|
1882
1882
|
console.error("Chart SVG element not found"), Nn(e);
|
|
1883
1883
|
return;
|
|
1884
1884
|
}
|
|
1885
1885
|
const t = Ye(), r = De.value, h = kt.value + t.height, C = o.cloneNode(!0);
|
|
1886
1886
|
C.querySelectorAll(".dss-flag-markers, .dss-flag-line, .dss-flag-extension-line, .dss-flag-count-indicator, .dss-flag-count-text").forEach((fe) => fe.remove());
|
|
1887
|
-
const
|
|
1887
|
+
const M = C.querySelectorAll("image"), P = Array.from(M).map(async (fe) => {
|
|
1888
1888
|
const it = fe.getAttribute("xlink:href") || fe.getAttribute("href");
|
|
1889
1889
|
if (it && !it.startsWith("data:"))
|
|
1890
1890
|
try {
|
|
@@ -1994,11 +1994,11 @@ const Ls = {
|
|
|
1994
1994
|
}, bl = async () => {
|
|
1995
1995
|
try {
|
|
1996
1996
|
const e = Tl();
|
|
1997
|
-
|
|
1997
|
+
k.value && k.value.offsetHeight, await new Promise((fe) => setTimeout(fe, 300));
|
|
1998
1998
|
const o = Ye(), t = De.value, r = kt.value + o.height, h = document.createElement("canvas"), C = h.getContext("2d"), _ = 2;
|
|
1999
1999
|
h.width = t * _, h.height = r * _, h.style.width = t + "px", h.style.height = r + "px", C.scale(_, _), C.fillStyle = "#fafafa", C.fillRect(0, 0, t, r);
|
|
2000
|
-
let
|
|
2001
|
-
if (Ot.value && (C.fillStyle = "#333", C.font = "bold 18px Arial, sans-serif", C.fillText(Ot.value, 24,
|
|
2000
|
+
let M = 30;
|
|
2001
|
+
if (Ot.value && (C.fillStyle = "#333", C.font = "bold 18px Arial, sans-serif", C.fillText(Ot.value, 24, M), M += 30), yt.value && (C.fillStyle = "#666", C.font = "14px Arial, sans-serif", C.fillText(yt.value, 24, M), M += 25), zt.value && A.series.length > 0) {
|
|
2002
2002
|
let fe = t - 200, it = Ot.value || yt.value ? 35 : 25;
|
|
2003
2003
|
const Te = Math.floor((t - 250) / 120);
|
|
2004
2004
|
let Ve = 0;
|
|
@@ -2009,7 +2009,7 @@ const Ls = {
|
|
|
2009
2009
|
}
|
|
2010
2010
|
});
|
|
2011
2011
|
}
|
|
2012
|
-
const F =
|
|
2012
|
+
const F = We.value.cloneNode(!0), B = F.querySelectorAll(".dss-flag-markers, .dss-flag-line, .dss-flag-extension-line, .dss-flag-count-indicator, .dss-flag-count-text"), D = F.querySelectorAll(".dss-crosshair"), ae = F.querySelectorAll('[class*="tooltip"]');
|
|
2013
2013
|
B.forEach((fe) => fe.remove()), D.forEach((fe) => fe.remove()), ae.forEach((fe) => fe.remove()), F.querySelectorAll("image").forEach((fe, it) => {
|
|
2014
2014
|
const Te = fe.getAttribute("xlink:href") || fe.getAttribute("href");
|
|
2015
2015
|
if (Te && !Te.startsWith("data:")) {
|
|
@@ -2123,7 +2123,7 @@ const Ls = {
|
|
|
2123
2123
|
}, sa = (e) => {
|
|
2124
2124
|
Be.value.show && !e.target.closest(".context-menu") && (Be.value.show = !1);
|
|
2125
2125
|
}, Fa = (e) => {
|
|
2126
|
-
if (!Ln.value || !
|
|
2126
|
+
if (!Ln.value || !qe.value) return;
|
|
2127
2127
|
e.preventDefault(), e.stopPropagation(), se.value.isZooming = !0, Pe.value.show = !1, se.value.zoomTimeout && clearTimeout(se.value.zoomTimeout);
|
|
2128
2128
|
const t = e.currentTarget.getBoundingClientRect(), r = e.clientX - t.left, h = e.clientY - t.top;
|
|
2129
2129
|
if (r < q.value.left - 50 || r > q.value.right + 50 || h < q.value.top - 50 || h > q.value.bottom + 100) {
|
|
@@ -2135,31 +2135,31 @@ const Ls = {
|
|
|
2135
2135
|
Math.min(se.value.maxScale, se.value.scale * C)
|
|
2136
2136
|
);
|
|
2137
2137
|
if (_ !== se.value.scale) {
|
|
2138
|
-
const { minX:
|
|
2138
|
+
const { minX: M, maxX: P } = rn.value, F = P - M || 1, B = F / se.value.scale, D = M - se.value.offsetX / q.value.width * F, ae = (r - q.value.left) / q.value.width, we = D + ae * B;
|
|
2139
2139
|
se.value.scale = _;
|
|
2140
2140
|
const Ie = F / se.value.scale, re = we - ae * Ie;
|
|
2141
|
-
se.value.offsetX = -(re -
|
|
2141
|
+
se.value.offsetX = -(re - M) / F * q.value.width, se.value.scale <= 1.01 && (se.value.scale = 1, se.value.offsetX = 0);
|
|
2142
2142
|
}
|
|
2143
2143
|
se.value.zoomTimeout = setTimeout(() => {
|
|
2144
2144
|
se.value.isZooming = !1, se.value.zoomTimeout = null;
|
|
2145
2145
|
}, 300);
|
|
2146
2146
|
}, Qa = (e) => {
|
|
2147
|
-
if (!Ln.value || !
|
|
2147
|
+
if (!Ln.value || !qe.value || se.value.scale <= 1) return;
|
|
2148
2148
|
Pe.value.show = !1;
|
|
2149
2149
|
const t = e.currentTarget.getBoundingClientRect();
|
|
2150
2150
|
e.clientX - t.left, e.clientY - t.top, se.value.isDragging = !0, se.value.lastMouseX = e.clientX, se.value.lastMouseY = e.clientY, e.preventDefault();
|
|
2151
2151
|
}, Pa = () => {
|
|
2152
2152
|
se.value.isDragging = !1;
|
|
2153
2153
|
}, ya = () => {
|
|
2154
|
-
!Ln.value || !
|
|
2155
|
-
}, Ja = () => !Ln.value || !Rn.value || !
|
|
2154
|
+
!Ln.value || !qe.value || (se.value.scale = 1, se.value.offsetX = 0, se.value.isDragging = !1, se.value.zoomTimeout && (clearTimeout(se.value.zoomTimeout), se.value.zoomTimeout = null), se.value.isZooming = !1);
|
|
2155
|
+
}, Ja = () => !Ln.value || !Rn.value || !qe.value ? "default" : se.value.isDragging ? "grabbing" : se.value.scale > 1 ? "grab" : "dss-crosshair", Ca = (e) => {
|
|
2156
2156
|
if (e.length < 2) return "";
|
|
2157
2157
|
if (e.length === 2)
|
|
2158
2158
|
return `M ${e[0].x} ${e[0].y} L ${e[1].x} ${e[1].y}`;
|
|
2159
2159
|
let o = `M ${e[0].x} ${e[0].y}`;
|
|
2160
2160
|
for (let t = 0; t < e.length - 1; t++) {
|
|
2161
|
-
const r = e[Math.max(t - 1, 0)], h = e[t], C = e[t + 1], _ = e[Math.min(t + 2, e.length - 1)],
|
|
2162
|
-
o += ` C ${
|
|
2161
|
+
const r = e[Math.max(t - 1, 0)], h = e[t], C = e[t + 1], _ = e[Math.min(t + 2, e.length - 1)], M = h.x + (C.x - r.x) / 6 * le.value, P = h.y + (C.y - r.y) / 6 * le.value, F = C.x - (_.x - h.x) / 6 * le.value, B = C.y - (_.y - h.y) / 6 * le.value;
|
|
2162
|
+
o += ` C ${M} ${P} ${F} ${B} ${C.x} ${C.y}`;
|
|
2163
2163
|
}
|
|
2164
2164
|
return o;
|
|
2165
2165
|
}, An = y(() => {
|
|
@@ -2186,9 +2186,9 @@ const Ls = {
|
|
|
2186
2186
|
}
|
|
2187
2187
|
let _ = 0;
|
|
2188
2188
|
Ot.value && (_ += 15), yt.value && (_ += 10);
|
|
2189
|
-
const
|
|
2189
|
+
const M = Ye();
|
|
2190
2190
|
let P = h + 16, F = h;
|
|
2191
|
-
zt.value && ot.value === "left" ? P +=
|
|
2191
|
+
zt.value && ot.value === "left" ? P += M.legendWidth || 150 : zt.value && ot.value === "right" && (F += M.legendWidth || 150);
|
|
2192
2192
|
const B = { left: P, top: h + _, right: F, bottom: C };
|
|
2193
2193
|
return t != null ? { left: t, top: t, right: t, bottom: t } : r ? { left: r.left ?? B.left, top: r.top ?? B.top, right: r.right ?? B.right, bottom: r.bottom ?? B.bottom } : B;
|
|
2194
2194
|
}), q = y(() => ({
|
|
@@ -2228,8 +2228,8 @@ const Ls = {
|
|
|
2228
2228
|
), on = y(() => {
|
|
2229
2229
|
const e = hl.value ? Fl.value : 1, o = Wt.value, t = At.value, r = Qt.value, h = wt.value, C = Math.PI, _ = Math.PI + e * Math.PI;
|
|
2230
2230
|
if (e <= 0) return `M ${o} ${t} L ${o} ${t} Z`;
|
|
2231
|
-
const
|
|
2232
|
-
return `M ${o} ${t} L ${
|
|
2231
|
+
const M = o + h * Math.cos(C), P = t + h * Math.sin(C), F = o + h * Math.cos(_), B = t + h * Math.sin(_), D = o + r * Math.cos(_), ae = t + r * Math.sin(_), we = o + r * Math.cos(C), Ie = t + r * Math.sin(C), re = e > 0.5 ? 1 : 0;
|
|
2232
|
+
return `M ${o} ${t} L ${M} ${P} A ${h} ${h} 0 ${re} 1 ${F} ${B} L ${D} ${ae} A ${r} ${r} 0 ${re} 1 ${we} ${Ie} Z`;
|
|
2233
2233
|
}), ba = y(() => {
|
|
2234
2234
|
if (!(!Zn.value || !hl.value) && !xl.value)
|
|
2235
2235
|
return `url(#${dl.value})`;
|
|
@@ -2243,8 +2243,8 @@ const Ls = {
|
|
|
2243
2243
|
const D = o - r, ae = o + r;
|
|
2244
2244
|
return `M ${D} ${t} A ${r} ${r} 0 0 1 ${ae} ${t} A ${r} ${r} 0 0 1 ${D} ${t} Z`;
|
|
2245
2245
|
}
|
|
2246
|
-
const h = -Math.PI / 2, C = h + e * Math.PI * 2, _ = o + r * Math.cos(h),
|
|
2247
|
-
return `M ${o} ${t} L ${_} ${
|
|
2246
|
+
const h = -Math.PI / 2, C = h + e * Math.PI * 2, _ = o + r * Math.cos(h), M = t + r * Math.sin(h), P = o + r * Math.cos(C), F = t + r * Math.sin(C), B = e >= 0.5 ? 1 : 0;
|
|
2247
|
+
return `M ${o} ${t} L ${_} ${M} A ${r} ${r} 0 ${B} 1 ${P} ${F} Z`;
|
|
2248
2248
|
}), Pl = y(() => {
|
|
2249
2249
|
if (ba.value) return ba.value;
|
|
2250
2250
|
if (Wn.value) return `url(#${kl.value})`;
|
|
@@ -2272,29 +2272,29 @@ const Ls = {
|
|
|
2272
2272
|
return Za();
|
|
2273
2273
|
if (!gl.value.length) return { minX: 0, maxX: 1, minY: 0, maxY: 1 };
|
|
2274
2274
|
let e = 1 / 0, o = -1 / 0, t = 0;
|
|
2275
|
-
gl.value.forEach((
|
|
2276
|
-
|
|
2275
|
+
gl.value.forEach((M) => {
|
|
2276
|
+
M.data && M.data.length && (t = Math.max(t, M.data.length - 1), M.data.forEach((P) => {
|
|
2277
2277
|
typeof P == "number" && (e = Math.min(e, P), o = Math.max(o, P));
|
|
2278
2278
|
}));
|
|
2279
2279
|
}), A.categories.length > 0 && (t = Math.max(t, A.categories.length - 1)), e === 1 / 0 && (e = 0, o = 100);
|
|
2280
2280
|
const r = It.value, h = ht.value;
|
|
2281
2281
|
let C, _;
|
|
2282
2282
|
if (r === vl) {
|
|
2283
|
-
const
|
|
2283
|
+
const M = o - e, P = M > 0 ? M * 0.1 : 1;
|
|
2284
2284
|
C = Math.max(0, e - P);
|
|
2285
2285
|
} else if (typeof r == "number")
|
|
2286
2286
|
C = r;
|
|
2287
2287
|
else {
|
|
2288
|
-
const
|
|
2288
|
+
const M = o - e, P = M > 0 ? M * 0.1 : 1;
|
|
2289
2289
|
C = Math.max(0, e - P);
|
|
2290
2290
|
}
|
|
2291
2291
|
if (h === vl) {
|
|
2292
|
-
const
|
|
2292
|
+
const M = o - e, P = M > 0 ? M * 0.1 : 2;
|
|
2293
2293
|
_ = o + P;
|
|
2294
2294
|
} else if (typeof h == "number")
|
|
2295
2295
|
_ = h;
|
|
2296
2296
|
else {
|
|
2297
|
-
const
|
|
2297
|
+
const M = o - e, P = M > 0 ? M * 0.1 : 2;
|
|
2298
2298
|
_ = o + P;
|
|
2299
2299
|
}
|
|
2300
2300
|
return {
|
|
@@ -2323,9 +2323,9 @@ const Ls = {
|
|
|
2323
2323
|
}), !_)
|
|
2324
2324
|
return { minX: 0, maxX: 8, minY: 0, maxY: 50, minSize: 10, maxSize: 30 };
|
|
2325
2325
|
e === o && (e = Math.min(e, 0), o = Math.max(o, A.categories?.length - 1 || 8)), t === r && (t = Math.max(0, t - 10), r = t + 20);
|
|
2326
|
-
const
|
|
2326
|
+
const M = o - e, P = r - t;
|
|
2327
2327
|
let F, B, D, ae;
|
|
2328
|
-
return rt.value !== null ? F = rt.value : F = e -
|
|
2328
|
+
return rt.value !== null ? F = rt.value : F = e - M * 0.1, Gt.value !== null ? B = Gt.value : B = o + M * 0.1, It.value !== null && typeof It.value == "number" ? D = It.value : D = Math.max(0, t - P * 0.1), ht.value !== null && typeof ht.value == "number" ? ae = ht.value : ae = r + P * 0.1, {
|
|
2329
2329
|
minX: F,
|
|
2330
2330
|
maxX: B,
|
|
2331
2331
|
minY: D,
|
|
@@ -2335,8 +2335,8 @@ const Ls = {
|
|
|
2335
2335
|
};
|
|
2336
2336
|
}, Jt = (e) => {
|
|
2337
2337
|
if (tn.value) {
|
|
2338
|
-
const { minX:
|
|
2339
|
-
return q.value.left + (e -
|
|
2338
|
+
const { minX: M, maxX: P } = rn.value, F = P - M || 1;
|
|
2339
|
+
return q.value.left + (e - M) / F * q.value.width;
|
|
2340
2340
|
}
|
|
2341
2341
|
const { minX: o, maxX: t } = rn.value, r = t - o;
|
|
2342
2342
|
if (t === 0 || r === 0)
|
|
@@ -2379,10 +2379,10 @@ const Ls = {
|
|
|
2379
2379
|
}
|
|
2380
2380
|
return Ie;
|
|
2381
2381
|
}
|
|
2382
|
-
const e = [], { minX: o, maxX: t } = rn.value, r = t - o || 1, h = r / se.value.scale, C = o - se.value.offsetX / q.value.width * r, _ = C + h,
|
|
2382
|
+
const e = [], { minX: o, maxX: t } = rn.value, r = t - o || 1, h = r / se.value.scale, C = o - se.value.offsetX / q.value.width * r, _ = C + h, M = Math.max(0, Math.floor(C - 2)), P = Math.min(t, Math.ceil(_ + 2)), F = P - M, B = q.value.width, ae = Math.floor(B / 60);
|
|
2383
2383
|
let we = 1;
|
|
2384
2384
|
F > ae && (we = Math.ceil(F / ae));
|
|
2385
|
-
for (let Ie =
|
|
2385
|
+
for (let Ie = M; Ie <= P; Ie += we)
|
|
2386
2386
|
if (Ie >= 0 && Ie <= t) {
|
|
2387
2387
|
const re = Jt(Ie);
|
|
2388
2388
|
re >= q.value.left - 100 && re <= q.value.right + 100 && e.push({
|
|
@@ -2395,11 +2395,11 @@ const Ls = {
|
|
|
2395
2395
|
}), ss = () => {
|
|
2396
2396
|
const e = [], { minX: o, maxX: t } = rn.value, r = t - o || 1, h = Math.min(8, Math.max(4, Math.floor(q.value.width / 80)));
|
|
2397
2397
|
for (let C = 0; C <= h; C++) {
|
|
2398
|
-
const _ = o + r * C / h,
|
|
2399
|
-
if (
|
|
2398
|
+
const _ = o + r * C / h, M = Jt(_);
|
|
2399
|
+
if (M >= q.value.left - 10 && M <= q.value.right + 10) {
|
|
2400
2400
|
const P = Math.round(_), F = A.categories?.[P];
|
|
2401
2401
|
e.push({
|
|
2402
|
-
x:
|
|
2402
|
+
x: M,
|
|
2403
2403
|
y: q.value.bottom + 20,
|
|
2404
2404
|
text: F || (Number.isInteger(_) ? _.toString() : _.toFixed(1))
|
|
2405
2405
|
});
|
|
@@ -2442,9 +2442,9 @@ const Ls = {
|
|
|
2442
2442
|
if (C)
|
|
2443
2443
|
t = Number(C[1]) / 255, r = Number(C[2]) / 255, h = Number(C[3]) / 255;
|
|
2444
2444
|
else {
|
|
2445
|
-
const
|
|
2446
|
-
if (
|
|
2447
|
-
t = Number(
|
|
2445
|
+
const M = o.match(/^rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.]+)\s*\)$/i);
|
|
2446
|
+
if (M)
|
|
2447
|
+
t = Number(M[1]) / 255, r = Number(M[2]) / 255, h = Number(M[3]) / 255;
|
|
2448
2448
|
else {
|
|
2449
2449
|
const P = o.match(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/);
|
|
2450
2450
|
if (P) {
|
|
@@ -2469,20 +2469,20 @@ const Ls = {
|
|
|
2469
2469
|
if (!e || typeof e != "string") return e;
|
|
2470
2470
|
const o = e.trim(), t = o.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i);
|
|
2471
2471
|
if (t) {
|
|
2472
|
-
const C = Math.max(0, Math.floor(Number(t[1]) * 0.65)), _ = Math.max(0, Math.floor(Number(t[2]) * 0.65)),
|
|
2473
|
-
return `rgb(${C}, ${_}, ${
|
|
2472
|
+
const C = Math.max(0, Math.floor(Number(t[1]) * 0.65)), _ = Math.max(0, Math.floor(Number(t[2]) * 0.65)), M = Math.max(0, Math.floor(Number(t[3]) * 0.65));
|
|
2473
|
+
return `rgb(${C}, ${_}, ${M})`;
|
|
2474
2474
|
}
|
|
2475
2475
|
const r = o.match(/^rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.]+)\s*\)$/i);
|
|
2476
2476
|
if (r) {
|
|
2477
|
-
const C = Math.max(0, Math.floor(Number(r[1]) * 0.65)), _ = Math.max(0, Math.floor(Number(r[2]) * 0.65)),
|
|
2478
|
-
return `rgba(${C}, ${_}, ${
|
|
2477
|
+
const C = Math.max(0, Math.floor(Number(r[1]) * 0.65)), _ = Math.max(0, Math.floor(Number(r[2]) * 0.65)), M = Math.max(0, Math.floor(Number(r[3]) * 0.65));
|
|
2478
|
+
return `rgba(${C}, ${_}, ${M}, ${r[4]})`;
|
|
2479
2479
|
}
|
|
2480
2480
|
const h = o.match(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/);
|
|
2481
2481
|
if (h) {
|
|
2482
2482
|
let C = h[1];
|
|
2483
2483
|
C.length === 3 && (C = C[0] + C[0] + C[1] + C[1] + C[2] + C[2]);
|
|
2484
|
-
const _ = Math.max(0, Math.min(255, Math.floor(parseInt(C.slice(0, 2), 16) * 0.65))),
|
|
2485
|
-
return `#${[_,
|
|
2484
|
+
const _ = Math.max(0, Math.min(255, Math.floor(parseInt(C.slice(0, 2), 16) * 0.65))), M = Math.max(0, Math.min(255, Math.floor(parseInt(C.slice(2, 4), 16) * 0.65))), P = Math.max(0, Math.min(255, Math.floor(parseInt(C.slice(4, 6), 16) * 0.65)));
|
|
2485
|
+
return `#${[_, M, P].map((F) => F.toString(16).padStart(2, "0")).join("")}`;
|
|
2486
2486
|
}
|
|
2487
2487
|
return o;
|
|
2488
2488
|
}, ka = (e, o) => {
|
|
@@ -2512,11 +2512,11 @@ const Ls = {
|
|
|
2512
2512
|
K.value ? ae = Ca(D) : ae = `M ${D[0].x} ${D[0].y}` + D.slice(1).map((we) => ` L ${we.x} ${we.y}`).join(""), _ += (_ ? " " : "") + ae;
|
|
2513
2513
|
}
|
|
2514
2514
|
});
|
|
2515
|
-
const
|
|
2515
|
+
const M = h.reduce((D, ae) => D + Ma(ae), 0), P = Ft.value.has(r), F = Ne.value === r, B = Ne.value !== null && Ne.value !== r;
|
|
2516
2516
|
return {
|
|
2517
2517
|
path: _,
|
|
2518
2518
|
color: Pt(r),
|
|
2519
|
-
pathLength:
|
|
2519
|
+
pathLength: M,
|
|
2520
2520
|
seriesIndex: r,
|
|
2521
2521
|
animationDelay: t * Ke.value,
|
|
2522
2522
|
isHighlighted: F,
|
|
@@ -2531,18 +2531,18 @@ const Ls = {
|
|
|
2531
2531
|
for (let C = 0; C < t.data.length - 1; C++) {
|
|
2532
2532
|
const _ = t.data[C];
|
|
2533
2533
|
if (_ != null) {
|
|
2534
|
-
let
|
|
2534
|
+
let M = -1, P = 0;
|
|
2535
2535
|
for (let F = C + 1; F < t.data.length; F++) {
|
|
2536
2536
|
const B = t.data[F];
|
|
2537
2537
|
if (B == null)
|
|
2538
2538
|
P++;
|
|
2539
2539
|
else {
|
|
2540
|
-
|
|
2540
|
+
M = F;
|
|
2541
2541
|
break;
|
|
2542
2542
|
}
|
|
2543
2543
|
}
|
|
2544
|
-
if (P > 0 &&
|
|
2545
|
-
const F = t.data[
|
|
2544
|
+
if (P > 0 && M !== -1) {
|
|
2545
|
+
const F = t.data[M], B = Cn.value ? wl(_) : Jt(C), D = Cn.value ? Vl(C) : bn(_), ae = Cn.value ? wl(F) : Jt(M), we = Cn.value ? Vl(M) : bn(F), Ie = Ft.value.has(h), re = Ne.value === h, Se = Ne.value !== null && Ne.value !== h;
|
|
2546
2546
|
o.push({
|
|
2547
2547
|
path: `M ${B} ${D} L ${ae} ${we}`,
|
|
2548
2548
|
color: Pt(h),
|
|
@@ -2552,7 +2552,7 @@ const Ls = {
|
|
|
2552
2552
|
isDimmed: Se,
|
|
2553
2553
|
isHidden: Ie,
|
|
2554
2554
|
gapSize: P
|
|
2555
|
-
}), C =
|
|
2555
|
+
}), C = M - 1;
|
|
2556
2556
|
}
|
|
2557
2557
|
}
|
|
2558
2558
|
}
|
|
@@ -2581,10 +2581,10 @@ const Ls = {
|
|
|
2581
2581
|
const _ = o.data.map((P, F) => P == null ? null : {
|
|
2582
2582
|
x: Cn.value ? wl(P) : Jt(F),
|
|
2583
2583
|
y: Cn.value ? Vl(F) : bn(P)
|
|
2584
|
-
}).filter((P) => P !== null),
|
|
2584
|
+
}).filter((P) => P !== null), M = Ma(_);
|
|
2585
2585
|
return {
|
|
2586
2586
|
path: h,
|
|
2587
|
-
pathLength:
|
|
2587
|
+
pathLength: M,
|
|
2588
2588
|
color: Pt(r),
|
|
2589
2589
|
animationDelay: t * Ke.value,
|
|
2590
2590
|
seriesIndex: r
|
|
@@ -2594,17 +2594,17 @@ const Ls = {
|
|
|
2594
2594
|
const e = [];
|
|
2595
2595
|
return Jn.value.forEach((o, t) => {
|
|
2596
2596
|
const r = Ne.value === t, h = Ne.value !== null && Ne.value !== t, C = Ft.value.has(t);
|
|
2597
|
-
o.data.forEach((_,
|
|
2597
|
+
o.data.forEach((_, M) => {
|
|
2598
2598
|
_ != null && e.push({
|
|
2599
|
-
x: Jt(
|
|
2599
|
+
x: Jt(M),
|
|
2600
2600
|
y: bn(_),
|
|
2601
2601
|
color: Pt(t),
|
|
2602
2602
|
value: _,
|
|
2603
|
-
label: A.categories[
|
|
2603
|
+
label: A.categories[M] || M.toString(),
|
|
2604
2604
|
seriesName: o.name,
|
|
2605
|
-
categoryIndex:
|
|
2606
|
-
dataIndex:
|
|
2607
|
-
animationDelay: (t * o.data.length +
|
|
2605
|
+
categoryIndex: M,
|
|
2606
|
+
dataIndex: M,
|
|
2607
|
+
animationDelay: (t * o.data.length + M) * (Ke.value / 8),
|
|
2608
2608
|
isHighlighted: r,
|
|
2609
2609
|
isDimmed: h,
|
|
2610
2610
|
isHidden: C
|
|
@@ -2615,7 +2615,7 @@ const Ls = {
|
|
|
2615
2615
|
if (!sl.value) return [];
|
|
2616
2616
|
const e = [];
|
|
2617
2617
|
return A.series.filter((t) => (t.type || He.value) === "line").forEach((t, r) => {
|
|
2618
|
-
const h = A.series.findIndex((P) => P === t), C = Ne.value === h, _ = Ne.value !== null && Ne.value !== h,
|
|
2618
|
+
const h = A.series.findIndex((P) => P === t), C = Ne.value === h, _ = Ne.value !== null && Ne.value !== h, M = Ft.value.has(h);
|
|
2619
2619
|
t.data.forEach((P, F) => {
|
|
2620
2620
|
P != null && e.push({
|
|
2621
2621
|
x: Jt(F),
|
|
@@ -2629,7 +2629,7 @@ const Ls = {
|
|
|
2629
2629
|
animationDelay: (r * t.data.length + F) * (Ke.value / 8),
|
|
2630
2630
|
isHighlighted: C,
|
|
2631
2631
|
isDimmed: _,
|
|
2632
|
-
isHidden:
|
|
2632
|
+
isHidden: M
|
|
2633
2633
|
});
|
|
2634
2634
|
});
|
|
2635
2635
|
}), e;
|
|
@@ -2639,14 +2639,14 @@ const Ls = {
|
|
|
2639
2639
|
return Jn.value.forEach((o, t) => {
|
|
2640
2640
|
if (!o?.data?.length) return;
|
|
2641
2641
|
const r = Ne.value, h = r !== null && r === t, C = r !== null && r !== t, _ = Ft.value.has(t);
|
|
2642
|
-
o.data.forEach((
|
|
2642
|
+
o.data.forEach((M, P) => {
|
|
2643
2643
|
let F, B, D, ae, we;
|
|
2644
|
-
if (typeof
|
|
2645
|
-
F = typeof
|
|
2646
|
-
else if (Array.isArray(
|
|
2647
|
-
F = typeof
|
|
2648
|
-
else if (typeof
|
|
2649
|
-
F = P, B =
|
|
2644
|
+
if (typeof M == "object" && M !== null && !Array.isArray(M))
|
|
2645
|
+
F = typeof M.x == "number" ? M.x : P, B = typeof M.y == "number" ? M.y : 0, D = typeof M.size == "number" ? M.size : 20, ae = M.label || A.categories?.[P] || `Point ${P + 1}`, we = M.image || M.imageUrl;
|
|
2646
|
+
else if (Array.isArray(M) && M.length >= 3)
|
|
2647
|
+
F = typeof M[0] == "number" ? M[0] : P, B = typeof M[1] == "number" ? M[1] : 0, D = typeof M[2] == "number" ? M[2] : 20, ae = M[3] || A.categories?.[P] || `Point ${P + 1}`, we = M[4];
|
|
2648
|
+
else if (typeof M == "number")
|
|
2649
|
+
F = P, B = M, D = wa(t, P), ae = A.categories?.[P] || `Point ${P + 1}`;
|
|
2650
2650
|
else
|
|
2651
2651
|
return;
|
|
2652
2652
|
!isFinite(F) || !isFinite(B) || !isFinite(D) || e.push({
|
|
@@ -2705,13 +2705,13 @@ const Ls = {
|
|
|
2705
2705
|
});
|
|
2706
2706
|
Ie += ` L ${D[D.length - 1].x} ${h} Z`, _ += (_ ? " " : "") + Ie;
|
|
2707
2707
|
});
|
|
2708
|
-
const
|
|
2708
|
+
const M = Ne.value === o, P = Ne.value !== null && Ne.value !== o, F = Ft.value.has(o), B = t.reduce((D, ae) => D + Ma(ae), 0);
|
|
2709
2709
|
return {
|
|
2710
2710
|
linePath: C,
|
|
2711
2711
|
areaPath: _,
|
|
2712
2712
|
color: Pt(o),
|
|
2713
2713
|
pathLength: B,
|
|
2714
|
-
isHighlighted:
|
|
2714
|
+
isHighlighted: M,
|
|
2715
2715
|
isDimmed: P,
|
|
2716
2716
|
isHidden: F
|
|
2717
2717
|
};
|
|
@@ -2719,13 +2719,13 @@ const Ls = {
|
|
|
2719
2719
|
if (!(["bar"].includes(He.value) || sl.value)) return [];
|
|
2720
2720
|
const e = [], { maxX: o } = rn.value, t = sl.value ? A.series.filter((h) => (h.type || He.value) === "bar") : Jn.value, r = t.length;
|
|
2721
2721
|
if (Cn.value) {
|
|
2722
|
-
const h = o + 1, _ = q.value.height / h,
|
|
2722
|
+
const h = o + 1, _ = q.value.height / h, M = _ * (2 / 3), P = Math.min(4, M / r * 0.15), F = M - (r - 1) * P, B = Math.max(4, F / r);
|
|
2723
2723
|
t.forEach((D, ae) => {
|
|
2724
2724
|
const we = A.series.findIndex((Ae) => Ae === D), Ie = Ne.value === we, re = Ne.value !== null && Ne.value !== we, Se = Ft.value.has(we);
|
|
2725
2725
|
D.data.forEach((Ae, fe) => {
|
|
2726
2726
|
if (Ae == null || typeof Ae != "number" || !isFinite(Ae))
|
|
2727
2727
|
return;
|
|
2728
|
-
const Ve = q.value.top + (fe + 0.5) * _ -
|
|
2728
|
+
const Ve = q.value.top + (fe + 0.5) * _ - M / 2 + ae * (B + P), et = q.value.left, Ge = Math.abs(wl(Ae) - q.value.left);
|
|
2729
2729
|
let Vt = "";
|
|
2730
2730
|
if (K.value && Ge > 0) {
|
|
2731
2731
|
const Dt = Math.min(Ce.value, B / 2, Ge / 2);
|
|
@@ -2758,13 +2758,13 @@ const Ls = {
|
|
|
2758
2758
|
});
|
|
2759
2759
|
});
|
|
2760
2760
|
} else {
|
|
2761
|
-
const h = o + 1, _ = q.value.width / h,
|
|
2761
|
+
const h = o + 1, _ = q.value.width / h, M = _ * 0.8, P = M / r, F = P * 0.05, B = P - F;
|
|
2762
2762
|
t.forEach((D, ae) => {
|
|
2763
2763
|
const we = A.series.findIndex((Ae) => Ae === D), Ie = Ne.value === we, re = Ne.value !== null && Ne.value !== we, Se = Ft.value.has(we);
|
|
2764
2764
|
D.data.forEach((Ae, fe) => {
|
|
2765
2765
|
if (Ae == null || typeof Ae != "number" || !isFinite(Ae))
|
|
2766
2766
|
return;
|
|
2767
|
-
const Ve = q.value.left + (fe + 0.5) * _ -
|
|
2767
|
+
const Ve = q.value.left + (fe + 0.5) * _ - M / 2 + ae * P + F / 2, et = bn(Math.max(0, Ae)), Ge = Math.abs(bn(0) - bn(Ae));
|
|
2768
2768
|
let Vt = "";
|
|
2769
2769
|
if (K.value && Ge > 0) {
|
|
2770
2770
|
const Dt = Math.min(Ce.value, B / 2, Ge / 2);
|
|
@@ -2805,7 +2805,7 @@ const Ls = {
|
|
|
2805
2805
|
let o = He.value === "semi-radial" ? Math.PI : -Math.PI / 2;
|
|
2806
2806
|
const t = He.value === "semi-radial" ? Math.PI : Math.PI * 2, r = [];
|
|
2807
2807
|
if (e.length === 1) {
|
|
2808
|
-
const { series: C, originalIndex: _ } = e[0],
|
|
2808
|
+
const { series: C, originalIndex: _ } = e[0], M = C.data[0] || 0, P = o, F = o + t - 1e-3, B = P + t / 2, D = Wt.value + Math.cos(P) * Qt.value, ae = At.value + Math.sin(P) * Qt.value, we = Wt.value + Math.cos(F) * Qt.value, Ie = At.value + Math.sin(F) * Qt.value, re = Wt.value + Math.cos(F) * wt.value, Se = At.value + Math.sin(F) * wt.value, Ae = Wt.value + Math.cos(P) * wt.value, fe = At.value + Math.sin(P) * wt.value, it = 1, Te = [
|
|
2809
2809
|
`M ${D} ${ae}`,
|
|
2810
2810
|
`A ${Qt.value} ${Qt.value} 0 ${it} 1 ${we} ${Ie}`,
|
|
2811
2811
|
`L ${re} ${Se}`,
|
|
@@ -2817,7 +2817,7 @@ const Ls = {
|
|
|
2817
2817
|
color: Ve,
|
|
2818
2818
|
strokeWidth: $t.value,
|
|
2819
2819
|
strokeColor: ka(0, Ve),
|
|
2820
|
-
value:
|
|
2820
|
+
value: M,
|
|
2821
2821
|
seriesName: C.name,
|
|
2822
2822
|
opacity: 0.8,
|
|
2823
2823
|
isHighlighted: Ne.value === _,
|
|
@@ -2829,7 +2829,7 @@ const Ls = {
|
|
|
2829
2829
|
}), r;
|
|
2830
2830
|
}
|
|
2831
2831
|
if (xl.value && e.length === 2) {
|
|
2832
|
-
const C = e[0], _ = e[1],
|
|
2832
|
+
const C = e[0], _ = e[1], M = Math.min(100, Math.max(0, C.series.data[0] || 0)), P = M / 100 * t, F = (B, D, ae, we, Ie) => {
|
|
2833
2833
|
const re = B + (D - B) / 2, Se = D - B, Ae = Wt.value + Math.cos(B) * Qt.value, fe = At.value + Math.sin(B) * Qt.value, it = Wt.value + Math.cos(D) * Qt.value, Te = At.value + Math.sin(D) * Qt.value, Ve = Wt.value + Math.cos(D) * wt.value, et = At.value + Math.sin(D) * wt.value, Ge = Wt.value + Math.cos(B) * wt.value, Vt = At.value + Math.sin(B) * wt.value, Dt = Se > Math.PI ? 1 : 0, qn = [
|
|
2834
2834
|
`M ${Ae} ${fe}`,
|
|
2835
2835
|
`A ${Qt.value} ${Qt.value} 0 ${Dt} 1 ${it} ${Te}`,
|
|
@@ -2853,11 +2853,11 @@ const Ls = {
|
|
|
2853
2853
|
midAngle: re
|
|
2854
2854
|
};
|
|
2855
2855
|
};
|
|
2856
|
-
return r.push(F(o, o + P, C.series, C.originalIndex,
|
|
2856
|
+
return r.push(F(o, o + P, C.series, C.originalIndex, M)), r.push(F(o, o + t, _.series, _.originalIndex, 100)), r;
|
|
2857
2857
|
}
|
|
2858
2858
|
const h = e.reduce((C, { series: _ }) => C + (_.data[0] || 0), 0);
|
|
2859
2859
|
return h === 0 ? [] : (e.forEach(({ series: C, originalIndex: _ }) => {
|
|
2860
|
-
const
|
|
2860
|
+
const M = C.data[0] || 0, P = M / h * t, F = o, B = o + P, D = F + P / 2, ae = Wt.value + Math.cos(F) * Qt.value, we = At.value + Math.sin(F) * Qt.value, Ie = Wt.value + Math.cos(B) * Qt.value, re = At.value + Math.sin(B) * Qt.value, Se = Wt.value + Math.cos(B) * wt.value, Ae = At.value + Math.sin(B) * wt.value, fe = Wt.value + Math.cos(F) * wt.value, it = At.value + Math.sin(F) * wt.value, Te = P > Math.PI ? 1 : 0, Ve = [
|
|
2861
2861
|
`M ${ae} ${we}`,
|
|
2862
2862
|
`A ${Qt.value} ${Qt.value} 0 ${Te} 1 ${Ie} ${re}`,
|
|
2863
2863
|
`L ${Se} ${Ae}`,
|
|
@@ -2869,7 +2869,7 @@ const Ls = {
|
|
|
2869
2869
|
color: et,
|
|
2870
2870
|
strokeWidth: $t.value,
|
|
2871
2871
|
strokeColor: ka(r.length, et),
|
|
2872
|
-
value:
|
|
2872
|
+
value: M,
|
|
2873
2873
|
seriesName: C.name,
|
|
2874
2874
|
opacity: 0.8,
|
|
2875
2875
|
isHighlighted: Ne.value === _,
|
|
@@ -2888,7 +2888,7 @@ const Ls = {
|
|
|
2888
2888
|
] : e.map((o, t) => ({ segment: o, originalIndex: t }));
|
|
2889
2889
|
}), n = y(() => {
|
|
2890
2890
|
if (!yn.value || !Sn.value) return [];
|
|
2891
|
-
const e = Gn.value, o = Pn.value, t = kn.value, r = Bn.value, h = 15, C = e * 1.3, _ = 0.55,
|
|
2891
|
+
const e = Gn.value, o = Pn.value, t = kn.value, r = Bn.value, h = 15, C = e * 1.3, _ = 0.55, M = (D, ae) => {
|
|
2892
2892
|
const we = Wt.value + Math.cos(D.midAngle) * wt.value, Ie = At.value + Math.sin(D.midAngle) * wt.value, re = Wt.value + Math.cos(D.midAngle) * (wt.value + o), Se = At.value + Math.sin(D.midAngle) * (wt.value + o), fe = re + t * (ae ? 1 : -1), it = ae ? re + h : re - h, Te = Se - r, Ve = `${D.seriesName}: ${xn(D.value)}`, et = Ve.length * e * _;
|
|
2893
2893
|
return {
|
|
2894
2894
|
pointerStartX: we,
|
|
@@ -2914,10 +2914,10 @@ const Ls = {
|
|
|
2914
2914
|
const ae = F[D];
|
|
2915
2915
|
let we = Math.cos(ae.midAngle) >= 0;
|
|
2916
2916
|
if (D > 0) {
|
|
2917
|
-
const re = B[D - 1], Se =
|
|
2917
|
+
const re = B[D - 1], Se = M(ae, we);
|
|
2918
2918
|
P(re, Se) && (we = !we);
|
|
2919
2919
|
}
|
|
2920
|
-
const Ie =
|
|
2920
|
+
const Ie = M(ae, we);
|
|
2921
2921
|
B.push({
|
|
2922
2922
|
...Ie,
|
|
2923
2923
|
color: ae.color,
|
|
@@ -2960,8 +2960,8 @@ const Ls = {
|
|
|
2960
2960
|
if (!t) return;
|
|
2961
2961
|
const r = t.getBoundingClientRect();
|
|
2962
2962
|
let h = o.clientX - r.left + 10, C = o.clientY - r.top - 10;
|
|
2963
|
-
const _ = 200,
|
|
2964
|
-
h + _ > De.value && (h = o.clientX - r.left - _ - 10), C +
|
|
2963
|
+
const _ = 200, M = 120;
|
|
2964
|
+
h + _ > De.value && (h = o.clientX - r.left - _ - 10), C + M > r.height && (C = o.clientY - r.top - M - 10), h < 0 && (h = 10), C < 0 && (C = 10);
|
|
2965
2965
|
const P = Ll.value, F = Il.value, B = P.map((D) => {
|
|
2966
2966
|
const ae = F[D] || D, we = p(D, e);
|
|
2967
2967
|
return we ? { seriesName: e.seriesName, label: e.label, value: `${ae}: ${we}`, color: e.color } : null;
|
|
@@ -3021,12 +3021,12 @@ const Ls = {
|
|
|
3021
3021
|
const t = o.target.closest(".dss-custom-chart-container");
|
|
3022
3022
|
if (!t) return;
|
|
3023
3023
|
const r = t.getBoundingClientRect(), h = Ta(e.categoryIndex), C = e.description || e.comment || "";
|
|
3024
|
-
let _ = o.clientX - r.left + 15,
|
|
3024
|
+
let _ = o.clientX - r.left + 15, M = o.clientY - r.top - 10;
|
|
3025
3025
|
const P = 200, F = C ? 80 : 50;
|
|
3026
|
-
_ + P > De.value && (_ = o.clientX - r.left - P - 15),
|
|
3026
|
+
_ + P > De.value && (_ = o.clientX - r.left - P - 15), M + F > kt.value && (M = o.clientY - r.top - F - 10), _ < 0 && (_ = 10), M < 0 && (M = 10), Mn.value = {
|
|
3027
3027
|
show: !0,
|
|
3028
3028
|
x: _,
|
|
3029
|
-
y:
|
|
3029
|
+
y: M,
|
|
3030
3030
|
categoryValue: h,
|
|
3031
3031
|
description: C
|
|
3032
3032
|
};
|
|
@@ -3046,14 +3046,14 @@ const Ls = {
|
|
|
3046
3046
|
e.push({ x: h, y: C, angle: r, index: t });
|
|
3047
3047
|
}
|
|
3048
3048
|
return e;
|
|
3049
|
-
}),
|
|
3049
|
+
}), Ue = y(() => {
|
|
3050
3050
|
const e = [], o = E.value;
|
|
3051
3051
|
return te.value.forEach((t, r) => {
|
|
3052
|
-
const h = wt.value + 15, C = r * 2 * Math.PI / o - Math.PI / 2, _ = Wt.value + Math.cos(C) * h,
|
|
3052
|
+
const h = wt.value + 15, C = r * 2 * Math.PI / o - Math.PI / 2, _ = Wt.value + Math.cos(C) * h, M = At.value + Math.sin(C) * h + 5;
|
|
3053
3053
|
let P = "middle", F = "middle";
|
|
3054
3054
|
Math.abs(Math.cos(C)) > 0.5 && (P = Math.cos(C) > 0 ? "start" : "end"), Math.abs(Math.sin(C)) > 0.5 && (F = Math.sin(C) > 0 ? "hanging" : "auto"), e.push({
|
|
3055
3055
|
x: _,
|
|
3056
|
-
y:
|
|
3056
|
+
y: M,
|
|
3057
3057
|
text: A.categories[r] || `Axis ${r + 1}`,
|
|
3058
3058
|
anchor: P,
|
|
3059
3059
|
baseline: F
|
|
@@ -3066,7 +3066,7 @@ const Ls = {
|
|
|
3066
3066
|
if (!cl.value) return [];
|
|
3067
3067
|
const e = [], o = E.value;
|
|
3068
3068
|
return Jn.value.forEach((t, r) => {
|
|
3069
|
-
const h = [], C = [], _ = [],
|
|
3069
|
+
const h = [], C = [], _ = [], M = Ne.value === r, P = Ne.value !== null && Ne.value !== r, F = Ft.value.has(r);
|
|
3070
3070
|
for (let B = 0; B < o; B++) {
|
|
3071
3071
|
const D = t.data[B] || 0, we = D / ie.value * wt.value, Ie = B * 2 * Math.PI / o - Math.PI / 2, re = Wt.value + Math.cos(Ie) * we, Se = At.value + Math.sin(Ie) * we;
|
|
3072
3072
|
h.push(`${re},${Se}`), C.push({ x: re, y: Se }), _.push({
|
|
@@ -3086,7 +3086,7 @@ const Ls = {
|
|
|
3086
3086
|
fillOpacity: ct.value,
|
|
3087
3087
|
seriesName: t.name,
|
|
3088
3088
|
value: `${t.name}: ${t.data.join(", ")}`,
|
|
3089
|
-
isHighlighted:
|
|
3089
|
+
isHighlighted: M,
|
|
3090
3090
|
isDimmed: P,
|
|
3091
3091
|
isHidden: F,
|
|
3092
3092
|
seriesIndex: r
|
|
@@ -3097,21 +3097,21 @@ const Ls = {
|
|
|
3097
3097
|
if (!o || o.length < 3) return !1;
|
|
3098
3098
|
let t = !1;
|
|
3099
3099
|
for (let r = 0, h = o.length - 1; r < o.length; h = r++) {
|
|
3100
|
-
const C = o[r].x, _ = o[r].y,
|
|
3101
|
-
_ > e.y != P > e.y && e.x < (
|
|
3100
|
+
const C = o[r].x, _ = o[r].y, M = o[h].x, P = o[h].y;
|
|
3101
|
+
_ > e.y != P > e.y && e.x < (M - C) * (e.y - _) / (P - _) + C && (t = !t);
|
|
3102
3102
|
}
|
|
3103
3103
|
return t;
|
|
3104
3104
|
}, un = (e) => {
|
|
3105
3105
|
if (!cl.value) return;
|
|
3106
3106
|
const o = e.currentTarget.closest(".dss-custom-chart-container");
|
|
3107
3107
|
if (!o) return;
|
|
3108
|
-
const t = o.getBoundingClientRect(), r =
|
|
3108
|
+
const t = o.getBoundingClientRect(), r = We.value?.getBoundingClientRect();
|
|
3109
3109
|
if (!r) return;
|
|
3110
|
-
const h = e.clientX - r.left, C = e.clientY - r.top, _ = pn.value.filter((
|
|
3110
|
+
const h = e.clientX - r.left, C = e.clientY - r.top, _ = pn.value.filter((M) => M.isHidden ? !1 : mn({ x: h, y: C }, M.polygonPoints));
|
|
3111
3111
|
if (_.length > 0) {
|
|
3112
3112
|
_.length, Ne.value = _[0].seriesIndex;
|
|
3113
|
-
const
|
|
3114
|
-
let D =
|
|
3113
|
+
const M = e.clientX - t.left + 10, P = e.clientY - t.top - 10, F = 200, B = 50 + _.length * 25;
|
|
3114
|
+
let D = M, ae = P;
|
|
3115
3115
|
D + F > De.value && (D = e.clientX - t.left - F - 10), ae + B > kt.value && (ae = e.clientY - t.top - B - 10), D < 0 && (D = 10), ae < 0 && (ae = 10);
|
|
3116
3116
|
const we = _.map((Ie) => {
|
|
3117
3117
|
let re = Ie.dataPoints[0], Se = 1 / 0;
|
|
@@ -3145,13 +3145,13 @@ const Ls = {
|
|
|
3145
3145
|
return null;
|
|
3146
3146
|
let h, C;
|
|
3147
3147
|
if (Ln.value) {
|
|
3148
|
-
let
|
|
3148
|
+
let M = -1, P = null;
|
|
3149
3149
|
for (let B = r.data.length - 1; B >= 0; B--)
|
|
3150
3150
|
if (r.data[B] !== null && r.data[B] !== void 0) {
|
|
3151
|
-
|
|
3151
|
+
M = B, P = r.data[B];
|
|
3152
3152
|
break;
|
|
3153
3153
|
}
|
|
3154
|
-
if (
|
|
3154
|
+
if (M === -1 || P === null)
|
|
3155
3155
|
return null;
|
|
3156
3156
|
const F = r.data.map((B, D) => B == null ? null : {
|
|
3157
3157
|
x: Jt(D),
|
|
@@ -3165,10 +3165,10 @@ const Ls = {
|
|
|
3165
3165
|
} else
|
|
3166
3166
|
h = F[0].x + (o.offsetX || 0), C = F[0].y + (o.offsetY || 0);
|
|
3167
3167
|
else
|
|
3168
|
-
h = Jt(
|
|
3168
|
+
h = Jt(M) + (o.offsetX || 0), C = bn(P) + (o.offsetY || 0);
|
|
3169
3169
|
} else if (Sn.value || cl.value) {
|
|
3170
|
-
const
|
|
3171
|
-
h = Wt.value + Math.cos(
|
|
3170
|
+
const M = Math.PI * 2 / e.logos.length * t;
|
|
3171
|
+
h = Wt.value + Math.cos(M) * (wt.value + 30) + (o.offsetX || 0), C = At.value + Math.sin(M) * (wt.value + 30) + (o.offsetY || 0);
|
|
3172
3172
|
}
|
|
3173
3173
|
return {
|
|
3174
3174
|
...o,
|
|
@@ -3205,8 +3205,8 @@ const Ls = {
|
|
|
3205
3205
|
return;
|
|
3206
3206
|
const r = o.target.closest(".dss-custom-chart-container").getBoundingClientRect();
|
|
3207
3207
|
let h = o.clientX - r.left + 10, C = o.clientY - r.top - 10;
|
|
3208
|
-
const _ = 200,
|
|
3209
|
-
h + _ > P && (h = o.clientX - r.left - _ - 10), C +
|
|
3208
|
+
const _ = 200, M = 120, P = De.value, F = kt.value;
|
|
3209
|
+
h + _ > P && (h = o.clientX - r.left - _ - 10), C + M > F && (C = o.clientY - r.top - M - 10), h < 0 && (h = 10), C < 0 && (C = 10);
|
|
3210
3210
|
let B;
|
|
3211
3211
|
typeof e.categoryIndex == "number" ? B = e.categoryIndex : typeof e.dataIndex == "number" ? B = e.dataIndex : e.label && A.categories.includes(e.label) && (B = A.categories.indexOf(e.label));
|
|
3212
3212
|
const D = (Cn.value || He.value === "bar") && e.label ? e.label : e.seriesName || e.label || "";
|
|
@@ -3268,7 +3268,7 @@ const Ls = {
|
|
|
3268
3268
|
};
|
|
3269
3269
|
Et.value.animationId = requestAnimationFrame(e);
|
|
3270
3270
|
}, il = (e) => {
|
|
3271
|
-
const o =
|
|
3271
|
+
const o = k.value;
|
|
3272
3272
|
o && o.style.setProperty("--dss-animation-progress", e);
|
|
3273
3273
|
}, rs = () => {
|
|
3274
3274
|
Et.value.isAnimating = !1, Et.value.hasAnimated = !0, Wn.value && (Yn.value = 1), Et.value.animationId && (cancelAnimationFrame(Et.value.animationId), Et.value.animationId = null);
|
|
@@ -3315,23 +3315,23 @@ const Ls = {
|
|
|
3315
3315
|
document.addEventListener("click", sa);
|
|
3316
3316
|
}) : document.removeEventListener("click", sa);
|
|
3317
3317
|
}), Ya(() => {
|
|
3318
|
-
Ne.value = null, Wn.value && (!x.value || _n.value) && (Yn.value = 1), En(),
|
|
3318
|
+
Ne.value = null, Wn.value && (!x.value || _n.value) && (Yn.value = 1), En(), k.value && typeof ResizeObserver < "u" && (xe = new ResizeObserver((e) => {
|
|
3319
3319
|
const o = e[0];
|
|
3320
3320
|
!o || !o.contentRect || ($e && cancelAnimationFrame($e), $e = requestAnimationFrame(() => {
|
|
3321
3321
|
$e = null;
|
|
3322
3322
|
const { width: t, height: r } = o.contentRect;
|
|
3323
3323
|
_t.value = Math.round(t), m.value = Math.round(r), me.value && (Nt.value = me.value.offsetHeight || ke);
|
|
3324
3324
|
}));
|
|
3325
|
-
}), xe.observe(
|
|
3325
|
+
}), xe.observe(k.value)), x.value && !_n.value ? He.value === "semi-radial" ? setTimeout(() => ts(), J.value) : setTimeout(() => pl(), J.value) : (Et.value.hasAnimated = !0, He.value === "semi-radial" && (Fl.value = 1)), document.addEventListener("mousemove", cs), document.addEventListener("mouseup", ds), document.addEventListener("click", ga);
|
|
3326
3326
|
}), ja(() => {
|
|
3327
|
-
$e && cancelAnimationFrame($e), xe &&
|
|
3327
|
+
$e && cancelAnimationFrame($e), xe && k.value && (xe.unobserve(k.value), xe.disconnect(), xe = null), Et.value.animationId && cancelAnimationFrame(Et.value.animationId), Ql && (cancelAnimationFrame(Ql), Ql = null), se.value.zoomTimeout && clearTimeout(se.value.zoomTimeout), document.removeEventListener("mousemove", cs), document.removeEventListener("mouseup", ds), document.removeEventListener("click", ga), document.removeEventListener("click", sa);
|
|
3328
3328
|
});
|
|
3329
3329
|
const cs = (e) => {
|
|
3330
3330
|
if (se.value.isDragging && se.value.scale > 1 && Ln.value) {
|
|
3331
3331
|
Pe.value.show = !1;
|
|
3332
3332
|
const o = e.clientX - se.value.lastMouseX, { minX: t, maxX: r } = rn.value, h = r - t || 1, _ = o * 0.8;
|
|
3333
3333
|
se.value.offsetX += _;
|
|
3334
|
-
const
|
|
3334
|
+
const M = h / se.value.scale, P = h - M, F = 0, B = -P / h * q.value.width, D = F;
|
|
3335
3335
|
se.value.offsetX = Math.max(B, Math.min(D, se.value.offsetX)), se.value.lastMouseX = e.clientX, se.value.lastMouseY = e.clientY;
|
|
3336
3336
|
}
|
|
3337
3337
|
}, ds = () => {
|
|
@@ -3339,22 +3339,22 @@ const Ls = {
|
|
|
3339
3339
|
!se.value.isDragging && se.value.isZooming;
|
|
3340
3340
|
}, 100));
|
|
3341
3341
|
}, $s = (e, o) => {
|
|
3342
|
-
const t = e.filter((
|
|
3342
|
+
const t = e.filter((M) => M != null);
|
|
3343
3343
|
if (!t || t.length === 0) return { x: 0, y: 0 };
|
|
3344
3344
|
if (t.length === 1 || o <= 0) return t[0];
|
|
3345
3345
|
if (o >= 1) return t[t.length - 1];
|
|
3346
3346
|
let r = 0;
|
|
3347
3347
|
const h = [];
|
|
3348
|
-
for (let
|
|
3349
|
-
const P = t[
|
|
3348
|
+
for (let M = 1; M < t.length; M++) {
|
|
3349
|
+
const P = t[M].x - t[M - 1].x, F = t[M].y - t[M - 1].y, B = Math.sqrt(P * P + F * F);
|
|
3350
3350
|
h.push(B), r += B;
|
|
3351
3351
|
}
|
|
3352
3352
|
const C = r * o;
|
|
3353
3353
|
let _ = 0;
|
|
3354
|
-
for (let
|
|
3355
|
-
const P = _ + h[
|
|
3354
|
+
for (let M = 0; M < h.length; M++) {
|
|
3355
|
+
const P = _ + h[M];
|
|
3356
3356
|
if (C <= P) {
|
|
3357
|
-
const F = (C - _) / h[
|
|
3357
|
+
const F = (C - _) / h[M], B = t[M], D = t[M + 1];
|
|
3358
3358
|
return {
|
|
3359
3359
|
x: B.x + (D.x - B.x) * F,
|
|
3360
3360
|
y: B.y + (D.y - B.y) * F
|
|
@@ -3379,7 +3379,7 @@ const Ls = {
|
|
|
3379
3379
|
}),
|
|
3380
3380
|
"data-chart-type": He.value,
|
|
3381
3381
|
ref_key: "containerEl",
|
|
3382
|
-
ref:
|
|
3382
|
+
ref: k,
|
|
3383
3383
|
onWheel: Fa,
|
|
3384
3384
|
onMousedown: Qa,
|
|
3385
3385
|
onMousemove: St,
|
|
@@ -3494,7 +3494,7 @@ const Ls = {
|
|
|
3494
3494
|
"data-smooth": K.value,
|
|
3495
3495
|
"data-animated": x.value,
|
|
3496
3496
|
ref_key: "svgEl",
|
|
3497
|
-
ref:
|
|
3497
|
+
ref: We
|
|
3498
3498
|
}, [
|
|
3499
3499
|
l("defs", null, [
|
|
3500
3500
|
l("clipPath", Do, [
|
|
@@ -4180,7 +4180,7 @@ const Ls = {
|
|
|
4180
4180
|
}, null, 12, Yi))), 128))
|
|
4181
4181
|
])) : R("", !0),
|
|
4182
4182
|
l("g", ji, [
|
|
4183
|
-
(c(!0), d(ne, null, be(
|
|
4183
|
+
(c(!0), d(ne, null, be(Ue.value, (t, r) => (c(), d("text", {
|
|
4184
4184
|
key: `spider-label-${r}`,
|
|
4185
4185
|
x: t.x + Math.cos(r * 2 * Math.PI / E.value - Math.PI / 2) * 16,
|
|
4186
4186
|
y: t.y + Math.sin(r * 2 * Math.PI / E.value - Math.PI / 2) * 16,
|
|
@@ -4465,7 +4465,7 @@ const Ls = {
|
|
|
4465
4465
|
])) : R("", !0)
|
|
4466
4466
|
], 64))
|
|
4467
4467
|
], 6)) : R("", !0),
|
|
4468
|
-
Ln.value &&
|
|
4468
|
+
Ln.value && qe.value && se.value.scale > 1 ? (c(), d("div", {
|
|
4469
4469
|
key: 4,
|
|
4470
4470
|
class: "dss-zoom-indicator",
|
|
4471
4471
|
onClick: ya
|
|
@@ -4658,7 +4658,7 @@ const Ls = {
|
|
|
4658
4658
|
},
|
|
4659
4659
|
emits: ["close-modal"],
|
|
4660
4660
|
setup(W, { emit: Le }) {
|
|
4661
|
-
const U = W, O = Le, Ze = T(null),
|
|
4661
|
+
const U = W, O = Le, Ze = T(null), k = T(null), We = y(() => {
|
|
4662
4662
|
const A = {
|
|
4663
4663
|
"max-width": U.width
|
|
4664
4664
|
};
|
|
@@ -4680,18 +4680,18 @@ const Ls = {
|
|
|
4680
4680
|
}
|
|
4681
4681
|
function ke() {
|
|
4682
4682
|
const A = document.body, de = document.documentElement;
|
|
4683
|
-
|
|
4683
|
+
k.value = {
|
|
4684
4684
|
bodyOverflow: A.style.overflow,
|
|
4685
4685
|
bodyPosition: A.style.position,
|
|
4686
4686
|
bodyTop: A.style.top,
|
|
4687
4687
|
bodyWidth: A.style.width,
|
|
4688
4688
|
htmlOverflow: de.style.overflow,
|
|
4689
4689
|
scrollY: window.scrollY
|
|
4690
|
-
}, A.style.overflow = "hidden", A.style.position = "fixed", A.style.top = `-${
|
|
4690
|
+
}, A.style.overflow = "hidden", A.style.position = "fixed", A.style.top = `-${k.value.scrollY}px`, A.style.width = "100%", A.style.left = "0", de.style.overflow = "hidden";
|
|
4691
4691
|
}
|
|
4692
4692
|
function ue() {
|
|
4693
|
-
if (!
|
|
4694
|
-
const A = document.body, de = document.documentElement, { bodyOverflow: Xe, bodyPosition: Ye, bodyTop: Qe, bodyWidth: j, htmlOverflow: bt, scrollY: tt } =
|
|
4693
|
+
if (!k.value) return;
|
|
4694
|
+
const A = document.body, de = document.documentElement, { bodyOverflow: Xe, bodyPosition: Ye, bodyTop: Qe, bodyWidth: j, htmlOverflow: bt, scrollY: tt } = k.value;
|
|
4695
4695
|
A.style.overflow = Xe || "", A.style.position = Ye || "", A.style.top = Qe || "", A.style.width = j || "", A.style.left = "", de.style.overflow = bt || "", window.scrollTo(0, tt || 0);
|
|
4696
4696
|
}
|
|
4697
4697
|
return Bt(
|
|
@@ -4720,7 +4720,7 @@ const Ls = {
|
|
|
4720
4720
|
Kt(l("div", {
|
|
4721
4721
|
id: "dss-modal-backdrop",
|
|
4722
4722
|
class: "dss-modal",
|
|
4723
|
-
style: he(
|
|
4723
|
+
style: he(We.value)
|
|
4724
4724
|
}, [
|
|
4725
4725
|
l("div", {
|
|
4726
4726
|
class: "dss-modal-content",
|
|
@@ -4860,7 +4860,7 @@ const Ls = {
|
|
|
4860
4860
|
"search"
|
|
4861
4861
|
],
|
|
4862
4862
|
setup(W, { emit: Le }) {
|
|
4863
|
-
const { t: U, locale: O } = Ka(), Ze = W,
|
|
4863
|
+
const { t: U, locale: O } = Ka(), Ze = W, k = Le, We = {
|
|
4864
4864
|
table: {
|
|
4865
4865
|
width: "auto",
|
|
4866
4866
|
height: null,
|
|
@@ -4917,7 +4917,7 @@ const Ls = {
|
|
|
4917
4917
|
function _t(S) {
|
|
4918
4918
|
return S && typeof S == "object" && !Array.isArray(S);
|
|
4919
4919
|
}
|
|
4920
|
-
const m = y(() => me(
|
|
4920
|
+
const m = y(() => me(We, Ze.options)), xe = y(() => {
|
|
4921
4921
|
const S = m.value.table.width;
|
|
4922
4922
|
return S === "auto" ? null : typeof S == "number" ? S : null;
|
|
4923
4923
|
}), $e = y(() => m.value.table.height), ke = y(() => m.value.table.rowHeight ?? "auto"), ue = y(() => ({ height: ke.value })), A = y(() => m.value.table.expandable === !0), de = y(() => m.value.table.truncated === !0), Xe = y(() => m.value.table.striped), Ye = y(() => m.value.table.bordered), Qe = y(() => m.value.table.hoverable), j = y(() => m.value.table.size), bt = y(() => m.value.table.align || "left");
|
|
@@ -4925,7 +4925,7 @@ const Ls = {
|
|
|
4925
4925
|
const tt = y(() => m.value.selection.enabled), De = y(() => m.value.selection.mode), Nt = y(() => m.value.sorting.enabled), Ut = y(() => m.value.sorting.mode), kt = y(() => m.value.pagination.enabled), nt = y(() => m.value.pagination.rows), He = y(() => m.value.pagination.rowsPerPageOptions), Lt = y(() => m.value.scrollable), Ot = y(() => m.value.emptyMessage), yt = y(() => m.value.toolbar?.downloads?.pdf !== !1), qt = y(() => m.value.toolbar?.downloads?.excel !== !1), ln = y(() => m.value.toolbar?.search !== !1), wn = y(() => yt.value || qt.value || ln.value || It.value), It = y(() => m.value.toolbar?.columnVisibility !== !1), ht = T(""), rt = T(!1), Gt = T(null);
|
|
4926
4926
|
let Xt = null;
|
|
4927
4927
|
function zt() {
|
|
4928
|
-
rt.value ? (Xt && (clearTimeout(Xt), Xt = null), rt.value = !1, ht.value = "",
|
|
4928
|
+
rt.value ? (Xt && (clearTimeout(Xt), Xt = null), rt.value = !1, ht.value = "", k("search", ""), Gt.value?.blur()) : (rt.value = !0, Xt = setTimeout(() => {
|
|
4929
4929
|
Xt = null, Gt.value?.focus();
|
|
4930
4930
|
}, 80));
|
|
4931
4931
|
}
|
|
@@ -4933,7 +4933,7 @@ const Ls = {
|
|
|
4933
4933
|
ht.value || (rt.value = !1);
|
|
4934
4934
|
}
|
|
4935
4935
|
function an() {
|
|
4936
|
-
ht.value = "",
|
|
4936
|
+
ht.value = "", k("search", ""), Gt.value?.focus();
|
|
4937
4937
|
}
|
|
4938
4938
|
const cn = y(() => ({
|
|
4939
4939
|
"dss-table-striped": Xe.value,
|
|
@@ -4942,7 +4942,7 @@ const Ls = {
|
|
|
4942
4942
|
[`dss-table-${j.value}`]: j.value !== "default",
|
|
4943
4943
|
"dss-table-truncated": de.value
|
|
4944
4944
|
})), Tt = (S, w) => S?.field ?? S?.key ?? w, ce = T(/* @__PURE__ */ new Set());
|
|
4945
|
-
function
|
|
4945
|
+
function qe() {
|
|
4946
4946
|
const S = /* @__PURE__ */ new Set();
|
|
4947
4947
|
Ze.columns.forEach((w, L) => {
|
|
4948
4948
|
w?.hidden !== !0 && S.add(Tt(w, L));
|
|
@@ -4965,7 +4965,7 @@ const Ls = {
|
|
|
4965
4965
|
const st = y(() => _e.value.length + (tt.value ? 1 : 0) + (A.value ? 1 : 0)), ee = (S, w) => S?.id ?? S?.key ?? w, K = T(/* @__PURE__ */ new Set()), le = T(null), Ce = (S, w) => K.value.has(ee(S, w)), $ = (S, w, L) => {
|
|
4966
4966
|
L && L.stopPropagation();
|
|
4967
4967
|
const G = ee(S, w), pe = new Set(K.value);
|
|
4968
|
-
pe.has(G) ? (pe.delete(G),
|
|
4968
|
+
pe.has(G) ? (pe.delete(G), k("row-collapse", { data: S, index: w })) : (pe.add(G), k("row-expand", { data: S, index: w })), K.value = pe;
|
|
4969
4969
|
}, x = (S, w) => {
|
|
4970
4970
|
if (!de.value) return;
|
|
4971
4971
|
const L = ee(S, w);
|
|
@@ -5132,10 +5132,10 @@ const Ls = {
|
|
|
5132
5132
|
const Gn = (S) => {
|
|
5133
5133
|
if (!(S.sortable === !1 || !Nt.value))
|
|
5134
5134
|
if (Ut.value === "single")
|
|
5135
|
-
H.value === S.field ? Y.value = Y.value === 1 ? -1 : Y.value === -1 ? 0 : 1 : (H.value = S.field, Y.value = 1), Y.value === 0 && (H.value = null),
|
|
5135
|
+
H.value === S.field ? Y.value = Y.value === 1 ? -1 : Y.value === -1 ? 0 : 1 : (H.value = S.field, Y.value = 1), Y.value === 0 && (H.value = null), k("sort", { field: H.value, order: Y.value });
|
|
5136
5136
|
else {
|
|
5137
5137
|
const w = J.value.findIndex((L) => L.field === S.field);
|
|
5138
|
-
w >= 0 ? J.value[w].order === 1 ? J.value[w].order = -1 : J.value.splice(w, 1) : J.value.push({ field: S.field, order: 1 }),
|
|
5138
|
+
w >= 0 ? J.value[w].order === 1 ? J.value[w].order = -1 : J.value.splice(w, 1) : J.value.push({ field: S.field, order: 1 }), k("sort", { multiSortMeta: J.value });
|
|
5139
5139
|
}
|
|
5140
5140
|
}, Pn = y(() => {
|
|
5141
5141
|
if (!Nt.value) return ul.value;
|
|
@@ -5155,7 +5155,7 @@ const Ls = {
|
|
|
5155
5155
|
return 0;
|
|
5156
5156
|
}), S;
|
|
5157
5157
|
}), kn = T(0), Bn = T(nt.value), ll = T(!1), jl = T(null), na = (S) => {
|
|
5158
|
-
Bn.value = S, ll.value = !1, kn.value = 0,
|
|
5158
|
+
Bn.value = S, ll.value = !1, kn.value = 0, k("page", { page: 0, rows: Bn.value });
|
|
5159
5159
|
};
|
|
5160
5160
|
function Kl(S) {
|
|
5161
5161
|
jl.value && !jl.value.contains(S.target) && (ll.value = !1);
|
|
@@ -5174,14 +5174,14 @@ const Ls = {
|
|
|
5174
5174
|
return w > 0 && w < S;
|
|
5175
5175
|
}), Ft = (S, w) => Qn.value.has(ee(S, w)), Ne = () => {
|
|
5176
5176
|
if (Il.value)
|
|
5177
|
-
Qn.value = /* @__PURE__ */ new Set(),
|
|
5177
|
+
Qn.value = /* @__PURE__ */ new Set(), k("unselect-all");
|
|
5178
5178
|
else {
|
|
5179
5179
|
const S = /* @__PURE__ */ new Set();
|
|
5180
|
-
Pn.value.forEach((w, L) => S.add(ee(w, L))), Qn.value = S,
|
|
5180
|
+
Pn.value.forEach((w, L) => S.add(ee(w, L))), Qn.value = S, k("select-all", Ll.value);
|
|
5181
5181
|
}
|
|
5182
5182
|
}, Rn = (S, w) => {
|
|
5183
5183
|
const L = ee(S, w), G = new Set(Qn.value), pe = G.has(L);
|
|
5184
|
-
De.value === "single" ? pe ? (G.delete(L),
|
|
5184
|
+
De.value === "single" ? pe ? (G.delete(L), k("row-unselect", S)) : (G.clear(), G.add(L), k("row-select", S)) : pe ? (G.delete(L), k("row-unselect", S)) : (G.add(L), k("row-select", S)), Qn.value = G;
|
|
5185
5185
|
}, ft = y(() => {
|
|
5186
5186
|
const S = Vn.value, w = kn.value + 1, L = 2, G = [], pe = [];
|
|
5187
5187
|
let St;
|
|
@@ -5191,9 +5191,9 @@ const Ls = {
|
|
|
5191
5191
|
St && (gt - St === 2 ? pe.push(St + 1) : gt - St !== 1 && pe.push("...")), pe.push(gt), St = gt;
|
|
5192
5192
|
return pe;
|
|
5193
5193
|
}), Mn = (S) => {
|
|
5194
|
-
S < 0 || S >= Vn.value || (kn.value = S,
|
|
5194
|
+
S < 0 || S >= Vn.value || (kn.value = S, k("page", { page: S, rows: Bn.value }));
|
|
5195
5195
|
}, Pe = (S, w, L) => {
|
|
5196
|
-
|
|
5196
|
+
k("row-click", { data: S, index: w, originalEvent: L }), x(S, Dn.value + w);
|
|
5197
5197
|
}, Be = (S, w) => {
|
|
5198
5198
|
const L = Dn.value + w;
|
|
5199
5199
|
return {
|
|
@@ -5221,9 +5221,9 @@ const Ls = {
|
|
|
5221
5221
|
}, { immediate: !0 }), Bt(nt, (S) => {
|
|
5222
5222
|
Bn.value = S, kn.value = 0;
|
|
5223
5223
|
}), Bt(ht, (S) => {
|
|
5224
|
-
|
|
5224
|
+
k("search", S ?? "");
|
|
5225
5225
|
}), Bt(() => Ze.columns, () => {
|
|
5226
|
-
|
|
5226
|
+
qe();
|
|
5227
5227
|
}, { immediate: !0, deep: !0 }), Ya(() => {
|
|
5228
5228
|
document.addEventListener("click", Kl), document.addEventListener("click", Re), document.addEventListener("click", Kn), window.addEventListener("resize", yn), window.addEventListener("scroll", yn, !0);
|
|
5229
5229
|
}), ja(() => {
|
|
@@ -5244,7 +5244,7 @@ const Ls = {
|
|
|
5244
5244
|
key: 0,
|
|
5245
5245
|
type: "button",
|
|
5246
5246
|
class: "dss-table-toolbar-btn",
|
|
5247
|
-
onClick: w[0] || (w[0] = (L) =>
|
|
5247
|
+
onClick: w[0] || (w[0] = (L) => k("download-pdf"))
|
|
5248
5248
|
}, [
|
|
5249
5249
|
w[21] || (w[21] = fs('<span class="dss-table-toolbar-btn-icon" aria-hidden="true"><svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#clip0_download)"><path d="M16.59 9H15V4C15 3.45 14.55 3 14 3H10C9.45 3 9 3.45 9 4V9H7.41C6.52 9 6.07 10.08 6.7 10.71L11.29 15.3C11.68 15.69 12.31 15.69 12.7 15.3L17.29 10.71C17.92 10.08 17.48 9 16.59 9ZM5 19C5 19.55 5.45 20 6 20H18C18.55 20 19 19.55 19 19C19 18.45 18.55 18 18 18H6C5.45 18 5 18.45 5 19Z" fill="currentColor"></path></g><defs><clipPath id="clip0_download"><rect width="24" height="24" fill="white"></rect></clipPath></defs></svg></span>', 1)),
|
|
5250
5250
|
rl(" " + V(X(U)("table.downloadPdf")), 1)
|
|
@@ -5253,7 +5253,7 @@ const Ls = {
|
|
|
5253
5253
|
key: 1,
|
|
5254
5254
|
type: "button",
|
|
5255
5255
|
class: "dss-table-toolbar-btn",
|
|
5256
|
-
onClick: w[1] || (w[1] = (L) =>
|
|
5256
|
+
onClick: w[1] || (w[1] = (L) => k("download-excel"))
|
|
5257
5257
|
}, [
|
|
5258
5258
|
w[22] || (w[22] = fs('<span class="dss-table-toolbar-btn-icon" aria-hidden="true"><svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#clip0_download_excel)"><path d="M16.59 9H15V4C15 3.45 14.55 3 14 3H10C9.45 3 9 3.45 9 4V9H7.41C6.52 9 6.07 10.08 6.7 10.71L11.29 15.3C11.68 15.69 12.31 15.69 12.7 15.3L17.29 10.71C17.92 10.08 17.48 9 16.59 9ZM5 19C5 19.55 5.45 20 6 20H18C18.55 20 19 19.55 19 19C19 18.45 18.55 18 18 18H6C5.45 18 5 18.45 5 19Z" fill="currentColor"></path></g><defs><clipPath id="clip0_download_excel"><rect width="24" height="24" fill="white"></rect></clipPath></defs></svg></span>', 1)),
|
|
5259
5259
|
rl(" " + V(X(U)("table.downloadExcel")), 1)
|
|
@@ -6131,43 +6131,43 @@ const Ls = {
|
|
|
6131
6131
|
"comment-deleted"
|
|
6132
6132
|
],
|
|
6133
6133
|
setup(W, { expose: Le, emit: U }) {
|
|
6134
|
-
const { t: O, locale: Ze } = Ka(),
|
|
6134
|
+
const { t: O, locale: Ze } = Ka(), k = W, We = U, me = xs(), _t = `<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
6135
6135
|
<path d="M10 0C4.5 0 0 4.5 0 10C0 15.5 4.5 20 10 20C15.5 20 20 15.5 20 10C20 4.5 15.5 0 10 0ZM2 10C2 5.6 5.6 2 10 2C11.8 2 13.5 2.6 14.9 3.7L3.7 14.9C2.6 13.5 2 11.8 2 10ZM10 18C8.2 18 6.5 17.4 5.1 16.3L16.3 5.1C17.4 6.5 18 8.2 18 10C18 14.4 14.4 18 10 18Z" fill="#c13340"/>
|
|
6136
|
-
</svg>`, m = T(null), xe = T(null), $e = T(!1), ke = T(!1), ue = T(!1), A = T(""), de = T({}), Xe = T(!1), Ye = T(!1), Qe = T(""), j = T(""), bt = T(null), tt = T(null), De = T(null), Nt = T(null), Ut = T(""), kt = T(!1), nt = T({}), He = T(!1), Lt = T({}), Ot = T(null), yt = T(null), qt = T(!1), ln = T(""), wn = T(null), It = T(""), ht = T(""), rt = T(""), Gt = T(null), Xt = T(null), zt = T(null), ot = T(null), an = T(null), cn = T(!1), Tt = T(""), ce = T({}),
|
|
6137
|
-
"dss-text-editor-no-border": !
|
|
6138
|
-
"dss-text-editor-rounded":
|
|
6139
|
-
"dss-text-editor-full-height":
|
|
6136
|
+
</svg>`, m = T(null), xe = T(null), $e = T(!1), ke = T(!1), ue = T(!1), A = T(""), de = T({}), Xe = T(!1), Ye = T(!1), Qe = T(""), j = T(""), bt = T(null), tt = T(null), De = T(null), Nt = T(null), Ut = T(""), kt = T(!1), nt = T({}), He = T(!1), Lt = T({}), Ot = T(null), yt = T(null), qt = T(!1), ln = T(""), wn = T(null), It = T(""), ht = T(""), rt = T(""), Gt = T(null), Xt = T(null), zt = T(null), ot = T(null), an = T(null), cn = T(!1), Tt = T(""), ce = T({}), qe = T(!1), _e = T("upload"), Fe = T(""), lt = T(null), $t = T(null), at = T([]), Mt = T([]), Re = T(null), st = T(!1), ee = T(""), K = T(""), le = T(""), Ce = T(""), $ = T(""), x = T(""), H = T(null), Y = T(null), J = T(null), Je = T(!1), Ke = T(null), je = T(!1), ge = T(!1), ct = T(null), pt = T("p"), Rt = T(!1), Ht = T([]), vt = T(null), Tn = T(null), dn = T(null), jn = T(!1), Fn = T(0), tl = 100, sn = T(null), nl = y(() => ({
|
|
6137
|
+
"dss-text-editor-no-border": !k.border,
|
|
6138
|
+
"dss-text-editor-rounded": k.rounded,
|
|
6139
|
+
"dss-text-editor-full-height": k.fullHeight,
|
|
6140
6140
|
"dss-comment-overlay-open": En.value !== null
|
|
6141
|
-
})), xn = y(() => ({})), ul = y(() => !
|
|
6142
|
-
height: `${1.6 * 14 *
|
|
6141
|
+
})), xn = y(() => ({})), ul = y(() => !k.fixedHeight || k.fullHeight ? {} : {
|
|
6142
|
+
height: `${1.6 * 14 * k.rows + 24 + 2}px`,
|
|
6143
6143
|
resize: "none",
|
|
6144
6144
|
overflowY: "auto"
|
|
6145
|
-
}), El = y(() => !
|
|
6146
|
-
height: `${1.6 * 14 *
|
|
6145
|
+
}), El = y(() => !k.fixedHeight || k.fullHeight ? {} : {
|
|
6146
|
+
height: `${1.6 * 14 * k.rows + 32}px`,
|
|
6147
6147
|
overflowY: "auto"
|
|
6148
|
-
}), z = y(() =>
|
|
6149
|
-
if (!
|
|
6150
|
-
if (
|
|
6151
|
-
let a =
|
|
6148
|
+
}), z = y(() => k.richText && Mt.value.length > 0), Q = y(() => {
|
|
6149
|
+
if (!k.modelValue) return "";
|
|
6150
|
+
if (k.richText) {
|
|
6151
|
+
let a = k.modelValue.replace(/<script[^>]*>[\s\S]*?<\/script>/gi, "");
|
|
6152
6152
|
return a = a.replace(/<style[^>]*>[\s\S]*?<\/style>/gi, ""), a = a.replace(/<[^>]+>/g, ""), a = a.replace(/ /g, " "), a = a.replace(/&/g, "&"), a = a.replace(/</g, "<"), a = a.replace(/>/g, ">"), a = a.replace(/"/g, '"'), a = a.replace(/'/g, "'"), a = a.replace(/\s+/g, " ").trim(), a;
|
|
6153
6153
|
}
|
|
6154
|
-
return
|
|
6154
|
+
return k.modelValue;
|
|
6155
6155
|
}), Z = y(() => {
|
|
6156
6156
|
const a = Q.value.trim();
|
|
6157
6157
|
return a ? a.split(/\s+/).filter((n) => n.length > 0).length : 0;
|
|
6158
|
-
}), ve = y(() => Q.value.length), ze = y(() => ot.value !== null && _e.value === "upload" && It.value && It.value.startsWith("data:")), mt = y(() =>
|
|
6159
|
-
for (let n = a + 1; n <
|
|
6160
|
-
if (ut(
|
|
6158
|
+
}), ve = y(() => Q.value.length), ze = y(() => ot.value !== null && _e.value === "upload" && It.value && It.value.startsWith("data:")), mt = y(() => k.titlePlaceholder || O("textEditor.placeholders.title")), Ct = y(() => k.descriptionPlaceholder || O("textEditor.placeholders.description")), dt = y(() => k.placeholder || O("textEditor.placeholders.startTyping")), ut = (a) => me && me[a] !== void 0, Hn = (a) => {
|
|
6159
|
+
for (let n = a + 1; n < k.customToolbarSlots.length; n++)
|
|
6160
|
+
if (ut(k.customToolbarSlots[n]))
|
|
6161
6161
|
return !0;
|
|
6162
6162
|
return !1;
|
|
6163
6163
|
}, Kn = (a) => {
|
|
6164
|
-
for (let n = a + 1; n <
|
|
6165
|
-
const s =
|
|
6164
|
+
for (let n = a + 1; n < k.customToolbarSlots.length; n++) {
|
|
6165
|
+
const s = k.customToolbarSlots[n];
|
|
6166
6166
|
if (ut(s) && yn(s))
|
|
6167
6167
|
return !0;
|
|
6168
6168
|
}
|
|
6169
6169
|
return !1;
|
|
6170
|
-
}, yn = (a) =>
|
|
6170
|
+
}, yn = (a) => k.customToolbarFloatingMap.hasOwnProperty(a) ? k.customToolbarFloatingMap[a] === !0 : !0, Gn = y(() => k.customToolbarSlots.some((a) => ut(a) && yn(a))), Pn = y(() => ut("title-slot")), kn = y(() => ut("description-slot")), Bn = (a) => {
|
|
6171
6171
|
if (!a || a.trim() === "")
|
|
6172
6172
|
return "<html></html>";
|
|
6173
6173
|
const n = a.trim();
|
|
@@ -6212,7 +6212,7 @@ const Ls = {
|
|
|
6212
6212
|
return i.includes("started conversation") || i.includes("démarré la conversation") || i === "started conversation" || i === "a démarré la conversation";
|
|
6213
6213
|
}, Nl = (a) => {
|
|
6214
6214
|
const n = a.target.value;
|
|
6215
|
-
|
|
6215
|
+
We("update:modelValue", n), We("change", n);
|
|
6216
6216
|
}, Vn = () => {
|
|
6217
6217
|
if (!H.value) return;
|
|
6218
6218
|
const a = H.value;
|
|
@@ -6240,7 +6240,7 @@ const Ls = {
|
|
|
6240
6240
|
a.value = n, a.offsetHeight, a.style.setProperty("height", `${s}px`, "important"), a.style.setProperty("overflow-y", "hidden", "important"), a.style.setProperty("overflow-x", "hidden", "important"), a.style.setProperty("text-overflow", "ellipsis", "important"), a.style.setProperty("white-space", "nowrap", "important");
|
|
6241
6241
|
}, Qn = (a) => {
|
|
6242
6242
|
const s = a.target.value;
|
|
6243
|
-
je.value && Vn(),
|
|
6243
|
+
je.value && Vn(), We("update:title", s), We("title-change", s), J.value = "title", k.richText && (st.value || (K.value = ee.value, $.value = le.value, x.value = Ce.value), Re.value && clearTimeout(Re.value), st.value = !0, Re.value = setTimeout(() => {
|
|
6244
6244
|
st.value = !1, Pe();
|
|
6245
6245
|
}, 500));
|
|
6246
6246
|
}, Ll = () => {
|
|
@@ -6270,7 +6270,7 @@ const Ls = {
|
|
|
6270
6270
|
a.value = n, a.offsetHeight, a.style.setProperty("height", `${s}px`, "important"), a.style.setProperty("overflow-y", "hidden", "important"), a.style.setProperty("overflow-x", "hidden", "important"), a.style.setProperty("text-overflow", "ellipsis", "important"), a.style.setProperty("white-space", "nowrap", "important");
|
|
6271
6271
|
}, Ne = (a) => {
|
|
6272
6272
|
const s = a.target.value;
|
|
6273
|
-
ge.value && Ll(),
|
|
6273
|
+
ge.value && Ll(), We("update:description", s), We("description-change", s), J.value = "description", k.richText && (st.value || (K.value = ee.value, $.value = le.value, x.value = Ce.value), Re.value && clearTimeout(Re.value), st.value = !0, Re.value = setTimeout(() => {
|
|
6274
6274
|
st.value = !1, Pe();
|
|
6275
6275
|
}, 500));
|
|
6276
6276
|
}, Rn = () => {
|
|
@@ -6339,7 +6339,7 @@ const Ls = {
|
|
|
6339
6339
|
a.removeAllRanges(), a.addRange(n);
|
|
6340
6340
|
}, Pe = (a = !1) => {
|
|
6341
6341
|
if (!m.value) return;
|
|
6342
|
-
const n = m.value.innerHTML, s =
|
|
6342
|
+
const n = m.value.innerHTML, s = k.title || "", i = k.description || "";
|
|
6343
6343
|
if (!a && n === ee.value && s === le.value && i === Ce.value)
|
|
6344
6344
|
return;
|
|
6345
6345
|
const u = {
|
|
@@ -6357,7 +6357,7 @@ const Ls = {
|
|
|
6357
6357
|
const s = a && a.inputType && (a.inputType === "insertText" || a.inputType === "insertCompositionText" || a.inputType === "deleteContentBackward" || a.inputType === "deleteContentForward");
|
|
6358
6358
|
s && ct.value && (ct.value = null), ke.value = !0;
|
|
6359
6359
|
const i = m.value.innerHTML.replace(/<!--[\s\S]*?-->/g, "").replace(/ |\u00A0/g, " "), u = Bn(i);
|
|
6360
|
-
|
|
6360
|
+
We("update:modelValue", u), We("change", u), J.value = "editor", st.value || (K.value = ee.value, $.value = le.value, x.value = Ce.value), Re.value && clearTimeout(Re.value), st.value = !0, Re.value = setTimeout(() => {
|
|
6361
6361
|
st.value = !1, Pe(), vl(), Za();
|
|
6362
6362
|
}, 500), ye(() => {
|
|
6363
6363
|
n && ft(n), se();
|
|
@@ -6504,9 +6504,9 @@ const Ls = {
|
|
|
6504
6504
|
}
|
|
6505
6505
|
}
|
|
6506
6506
|
}, aa = (a) => {
|
|
6507
|
-
vl(),
|
|
6507
|
+
vl(), We("blur", a), xl();
|
|
6508
6508
|
}, S = () => {
|
|
6509
|
-
if (
|
|
6509
|
+
if (k.disabled || !k.richText || !m.value) return;
|
|
6510
6510
|
jt(), Re.value && (clearTimeout(Re.value), Re.value = null), st.value && (Pe(), st.value = !1);
|
|
6511
6511
|
const a = J.value === "title", n = J.value === "description", s = J.value === "editor";
|
|
6512
6512
|
if (at.value.length === 0) {
|
|
@@ -6517,8 +6517,8 @@ const Ls = {
|
|
|
6517
6517
|
}
|
|
6518
6518
|
const i = {
|
|
6519
6519
|
content: m.value.innerHTML,
|
|
6520
|
-
title:
|
|
6521
|
-
description:
|
|
6520
|
+
title: k.title || "",
|
|
6521
|
+
description: k.description || ""
|
|
6522
6522
|
};
|
|
6523
6523
|
Mt.value.push(i);
|
|
6524
6524
|
const u = at.value.pop();
|
|
@@ -6528,7 +6528,7 @@ const Ls = {
|
|
|
6528
6528
|
m.value.innerHTML = f, ee.value = f, le.value = v, Ce.value = p, K.value = f, $.value = v, x.value = p, ye(() => {
|
|
6529
6529
|
Un(), zn(), Zn(), on();
|
|
6530
6530
|
const g = Bn(f);
|
|
6531
|
-
|
|
6531
|
+
We("update:modelValue", g), We("update:title", v), We("update:description", p), We("change", g), We("title-change", v), We("description-change", p), ke.value = !1, ye(() => {
|
|
6532
6532
|
setTimeout(() => {
|
|
6533
6533
|
if (a) {
|
|
6534
6534
|
if (H.value) {
|
|
@@ -6556,7 +6556,7 @@ const Ls = {
|
|
|
6556
6556
|
});
|
|
6557
6557
|
}
|
|
6558
6558
|
}, w = () => {
|
|
6559
|
-
if (
|
|
6559
|
+
if (k.disabled || !k.richText || !m.value) return;
|
|
6560
6560
|
jt();
|
|
6561
6561
|
const a = J.value === "title", n = J.value === "description", s = J.value === "editor";
|
|
6562
6562
|
if (Mt.value.length === 0) {
|
|
@@ -6567,8 +6567,8 @@ const Ls = {
|
|
|
6567
6567
|
}
|
|
6568
6568
|
const i = {
|
|
6569
6569
|
content: m.value.innerHTML,
|
|
6570
|
-
title:
|
|
6571
|
-
description:
|
|
6570
|
+
title: k.title || "",
|
|
6571
|
+
description: k.description || ""
|
|
6572
6572
|
};
|
|
6573
6573
|
at.value.push(i);
|
|
6574
6574
|
const u = Mt.value.pop();
|
|
@@ -6578,7 +6578,7 @@ const Ls = {
|
|
|
6578
6578
|
m.value.innerHTML = f, ee.value = f, le.value = v, Ce.value = p, K.value = f, $.value = v, x.value = p, ye(() => {
|
|
6579
6579
|
Un(), zn(), Zn(), on();
|
|
6580
6580
|
const g = Bn(f);
|
|
6581
|
-
|
|
6581
|
+
We("update:modelValue", g), We("update:title", v), We("update:description", p), We("change", g), We("title-change", v), We("description-change", p), ke.value = !1, ye(() => {
|
|
6582
6582
|
setTimeout(() => {
|
|
6583
6583
|
if (a) {
|
|
6584
6584
|
if (H.value) {
|
|
@@ -6816,7 +6816,7 @@ const Ls = {
|
|
|
6816
6816
|
}
|
|
6817
6817
|
return !0;
|
|
6818
6818
|
}, gt = (a, n = null) => {
|
|
6819
|
-
if (
|
|
6819
|
+
if (k.disabled || !k.richText || !m.value) return;
|
|
6820
6820
|
st.value ? (Re.value && (clearTimeout(Re.value), Re.value = null), Pe(), st.value = !1) : Pe(), jt(), m.value.focus();
|
|
6821
6821
|
const s = window.getSelection();
|
|
6822
6822
|
let i = null;
|
|
@@ -6905,7 +6905,7 @@ const Ls = {
|
|
|
6905
6905
|
Be(), zn(), on();
|
|
6906
6906
|
});
|
|
6907
6907
|
}, Yt = (a, n = null) => {
|
|
6908
|
-
if (
|
|
6908
|
+
if (k.disabled || !m.value)
|
|
6909
6909
|
return !1;
|
|
6910
6910
|
try {
|
|
6911
6911
|
if (a === "formatBlock" && n) {
|
|
@@ -7054,15 +7054,15 @@ const Ls = {
|
|
|
7054
7054
|
return !1;
|
|
7055
7055
|
}
|
|
7056
7056
|
}, en = (a) => {
|
|
7057
|
-
|
|
7057
|
+
k.disabled || !k.richText || (xe.value = xe.value === a ? null : a, a === "askAi" && (yt.value = null));
|
|
7058
7058
|
}, jt = () => {
|
|
7059
7059
|
xe.value = null, lt.value = null;
|
|
7060
7060
|
}, On = (a) => {
|
|
7061
7061
|
gt("formatBlock", a), jt();
|
|
7062
7062
|
}, pa = (a) => {
|
|
7063
7063
|
if (!a || !m.value) return a;
|
|
7064
|
-
const n = (
|
|
7065
|
-
let Me =
|
|
7064
|
+
const n = (Ue) => {
|
|
7065
|
+
let Me = Ue.nodeType === Node.TEXT_NODE ? Ue.parentElement : Ue;
|
|
7066
7066
|
for (; Me && Me !== m.value; ) {
|
|
7067
7067
|
const xt = Me.tagName;
|
|
7068
7068
|
if (xt === "P") {
|
|
@@ -7081,10 +7081,10 @@ const Ls = {
|
|
|
7081
7081
|
m.value,
|
|
7082
7082
|
NodeFilter.SHOW_ELEMENT,
|
|
7083
7083
|
{
|
|
7084
|
-
acceptNode: (
|
|
7085
|
-
const Me =
|
|
7084
|
+
acceptNode: (Ue) => {
|
|
7085
|
+
const Me = Ue.tagName;
|
|
7086
7086
|
if (Me === "P") {
|
|
7087
|
-
const xt =
|
|
7087
|
+
const xt = Ue.parentElement;
|
|
7088
7088
|
if (xt === m.value || xt.tagName === "BLOCKQUOTE")
|
|
7089
7089
|
return NodeFilter.FILTER_ACCEPT;
|
|
7090
7090
|
}
|
|
@@ -7102,7 +7102,7 @@ const Ls = {
|
|
|
7102
7102
|
const E = I[0], ie = I[I.length - 1], te = document.createRange();
|
|
7103
7103
|
return te.setStartBefore(E), te.setEndAfter(ie), te;
|
|
7104
7104
|
}, La = () => {
|
|
7105
|
-
if (
|
|
7105
|
+
if (k.disabled || !k.richText || !m.value) return;
|
|
7106
7106
|
st.value ? (Re.value && (clearTimeout(Re.value), Re.value = null), Pe(), st.value = !1) : Pe(), jt(), m.value.focus();
|
|
7107
7107
|
const a = window.getSelection();
|
|
7108
7108
|
if (a.rangeCount === 0) return;
|
|
@@ -7245,11 +7245,11 @@ const Ls = {
|
|
|
7245
7245
|
Be(), zn();
|
|
7246
7246
|
});
|
|
7247
7247
|
}, Da = () => {
|
|
7248
|
-
|
|
7248
|
+
k.disabled || !k.richText || m.value && (st.value ? (Re.value && (clearTimeout(Re.value), Re.value = null), Pe(), st.value = !1) : Pe(), jt(), m.value.focus(), document.execCommand("insertUnorderedList", !1), ye(() => {
|
|
7249
7249
|
Un(), Be(), on();
|
|
7250
7250
|
}));
|
|
7251
7251
|
}, yl = () => {
|
|
7252
|
-
|
|
7252
|
+
k.disabled || !k.richText || m.value && (st.value ? (Re.value && (clearTimeout(Re.value), Re.value = null), Pe(), st.value = !1) : Pe(), jt(), m.value.focus(), document.execCommand("insertOrderedList", !1), ye(() => {
|
|
7253
7253
|
Un(), Be(), on();
|
|
7254
7254
|
}));
|
|
7255
7255
|
}, Ra = (a) => {
|
|
@@ -7271,7 +7271,7 @@ const Ls = {
|
|
|
7271
7271
|
}
|
|
7272
7272
|
});
|
|
7273
7273
|
}, Na = () => {
|
|
7274
|
-
if (
|
|
7274
|
+
if (k.disabled || !k.richText || !m.value) return;
|
|
7275
7275
|
jt(), m.value.focus();
|
|
7276
7276
|
const a = window.getSelection();
|
|
7277
7277
|
if (a.rangeCount === 0) return;
|
|
@@ -7300,7 +7300,7 @@ const Ls = {
|
|
|
7300
7300
|
Un(), Be(), on();
|
|
7301
7301
|
});
|
|
7302
7302
|
}, Ia = () => {
|
|
7303
|
-
if (
|
|
7303
|
+
if (k.disabled || !k.richText || !m.value) return;
|
|
7304
7304
|
jt(), m.value.focus();
|
|
7305
7305
|
const a = window.getSelection();
|
|
7306
7306
|
if (a.rangeCount === 0) return;
|
|
@@ -7337,7 +7337,7 @@ const Ls = {
|
|
|
7337
7337
|
const n = a.cloneRange(), s = document.createElement("div");
|
|
7338
7338
|
return s.appendChild(n.cloneContents()), s.innerHTML;
|
|
7339
7339
|
}, ga = () => {
|
|
7340
|
-
if (
|
|
7340
|
+
if (k.disabled || !k.richText || !m.value) return;
|
|
7341
7341
|
if (En.value !== null) {
|
|
7342
7342
|
En.value = null, Nn.value = "", Cl.value = "", bl.value = null, Xn.value = [], Rl(!0);
|
|
7343
7343
|
return;
|
|
@@ -7363,11 +7363,11 @@ const Ls = {
|
|
|
7363
7363
|
if (g && i) {
|
|
7364
7364
|
const b = i.querySelector(".dss-text-editor-footer");
|
|
7365
7365
|
if (b) {
|
|
7366
|
-
const N = i.getBoundingClientRect(), I = g.getBoundingClientRect(), E = b.getBoundingClientRect(), ie = I.bottom - N.top, te = E.top - N.top,
|
|
7367
|
-
if (ie > te -
|
|
7366
|
+
const N = i.getBoundingClientRect(), I = g.getBoundingClientRect(), E = b.getBoundingClientRect(), ie = I.bottom - N.top, te = E.top - N.top, Ue = 8;
|
|
7367
|
+
if (ie > te - Ue) {
|
|
7368
7368
|
const Me = E.height;
|
|
7369
7369
|
Tl.value = {
|
|
7370
|
-
bottom: `${Me +
|
|
7370
|
+
bottom: `${Me + Ue}px`,
|
|
7371
7371
|
top: "auto"
|
|
7372
7372
|
};
|
|
7373
7373
|
} else
|
|
@@ -7386,10 +7386,10 @@ const Ls = {
|
|
|
7386
7386
|
selectionText: Cl.value,
|
|
7387
7387
|
selectionRange: bl.value,
|
|
7388
7388
|
commentId: En.value,
|
|
7389
|
-
user:
|
|
7389
|
+
user: k.commentUser || null,
|
|
7390
7390
|
createdAt: n.toISOString()
|
|
7391
7391
|
};
|
|
7392
|
-
Xn.value = [...Xn.value, s],
|
|
7392
|
+
Xn.value = [...Xn.value, s], We("comment-submitted", s), Ja(s), bl.value && !Qa(bl.value) && ya(En.value, bl.value), Nn.value = "", ye(() => {
|
|
7393
7393
|
if (ml.value) {
|
|
7394
7394
|
const i = ml.value;
|
|
7395
7395
|
i.style.height = "auto", i.style.height = `${i.scrollHeight}px`, i.focus();
|
|
@@ -7397,7 +7397,7 @@ const Ls = {
|
|
|
7397
7397
|
ol("sendComment");
|
|
7398
7398
|
});
|
|
7399
7399
|
}, Fa = (a, n) => {
|
|
7400
|
-
if (!(!
|
|
7400
|
+
if (!(!k.commentUser || !a.user || a.user.id !== k.commentUser.id)) {
|
|
7401
7401
|
if (Xn.value = Xn.value.filter((s, i) => i !== n), En.value !== null && m.value) {
|
|
7402
7402
|
const s = String(En.value), i = m.value.querySelector(`[data-comment="${s}"], [data-fake-comment="${s}"]`);
|
|
7403
7403
|
if (i && Xn.value.length > 0) {
|
|
@@ -7407,13 +7407,13 @@ const Ls = {
|
|
|
7407
7407
|
}), u.length > 0 ? i.setAttribute("data-comment-user", JSON.stringify(u[0])) : i.removeAttribute("data-comment-user"), u.length > 1 ? i.setAttribute("data-comment-user-2", JSON.stringify(u[1])) : i.removeAttribute("data-comment-user-2"), i.setAttribute("data-comment-count", String(Xn.value.length));
|
|
7408
7408
|
} else i && Xn.value.length === 0 && (i.removeAttribute("data-comment-user"), i.removeAttribute("data-comment-user-2"), i.setAttribute("data-comment-count", "0"));
|
|
7409
7409
|
}
|
|
7410
|
-
if (
|
|
7410
|
+
if (We("comment-deleted", {
|
|
7411
7411
|
comment: a,
|
|
7412
7412
|
index: n,
|
|
7413
7413
|
commentId: En.value
|
|
7414
|
-
}),
|
|
7415
|
-
const s =
|
|
7416
|
-
|
|
7414
|
+
}), k.comments && Array.isArray(k.comments)) {
|
|
7415
|
+
const s = k.comments.filter((i) => !(i.commentId === a.commentId && i.text === a.text && i.user?.id === a.user?.id));
|
|
7416
|
+
We("update:comments", s);
|
|
7417
7417
|
}
|
|
7418
7418
|
ye(() => {
|
|
7419
7419
|
ol("deleteComment");
|
|
@@ -7486,7 +7486,7 @@ const Ls = {
|
|
|
7486
7486
|
}
|
|
7487
7487
|
}, Ja = (a) => {
|
|
7488
7488
|
if (!a || !a.commentId) return;
|
|
7489
|
-
const n = Array.isArray(
|
|
7489
|
+
const n = Array.isArray(k.comments) ? [...k.comments] : [], s = typeof a.commentId == "string" && a.commentId.startsWith("comment-") ? Date.now() : Number(a.commentId) || a.commentId;
|
|
7490
7490
|
let i = n.findIndex((f) => typeof f.conversation_id == "string" && f.conversation_id.startsWith("comment-") ? null : Number(f.conversation_id) === Number(s) || f.conversation_id === s);
|
|
7491
7491
|
const u = {
|
|
7492
7492
|
text: a.text,
|
|
@@ -7519,9 +7519,9 @@ const Ls = {
|
|
|
7519
7519
|
};
|
|
7520
7520
|
n.push(p);
|
|
7521
7521
|
}
|
|
7522
|
-
ha.value = !0,
|
|
7522
|
+
ha.value = !0, We("update:comments", n);
|
|
7523
7523
|
}, Ca = (a, n = []) => {
|
|
7524
|
-
if (
|
|
7524
|
+
if (k.disabled || !k.richText || !m.value) return;
|
|
7525
7525
|
const s = m.value;
|
|
7526
7526
|
let i = null;
|
|
7527
7527
|
try {
|
|
@@ -7545,8 +7545,8 @@ const Ls = {
|
|
|
7545
7545
|
}
|
|
7546
7546
|
const g = i.getAttribute("data-comment") || i.getAttribute("data-fake-comment");
|
|
7547
7547
|
let b = [];
|
|
7548
|
-
if (g &&
|
|
7549
|
-
const N =
|
|
7548
|
+
if (g && k.comments && Array.isArray(k.comments)) {
|
|
7549
|
+
const N = k.comments.find((I) => String(I.conversation_id) === String(g));
|
|
7550
7550
|
if (N && N.conversation && Array.isArray(N.conversation)) {
|
|
7551
7551
|
const I = N.conversation.map((E) => ({
|
|
7552
7552
|
id: E.id || E.commentary_id,
|
|
@@ -7561,9 +7561,9 @@ const Ls = {
|
|
|
7561
7561
|
}
|
|
7562
7562
|
}
|
|
7563
7563
|
b.length === 0 && Array.isArray(n) && n.length > 0 && (b = n.slice()), b.sort((N, I) => {
|
|
7564
|
-
const E = (
|
|
7565
|
-
if (!
|
|
7566
|
-
const Me = new Date(
|
|
7564
|
+
const E = (Ue) => {
|
|
7565
|
+
if (!Ue) return 0;
|
|
7566
|
+
const Me = new Date(Ue).getTime();
|
|
7567
7567
|
return isNaN(Me) ? 0 : Me;
|
|
7568
7568
|
}, ie = E(N.createdAt), te = E(I.createdAt);
|
|
7569
7569
|
return ie === te ? 0 : ie - te;
|
|
@@ -7577,8 +7577,8 @@ const Ls = {
|
|
|
7577
7577
|
if (N) {
|
|
7578
7578
|
const I = p.querySelector(".dss-text-editor-footer");
|
|
7579
7579
|
if (I) {
|
|
7580
|
-
const E = p.getBoundingClientRect(), ie = N.getBoundingClientRect(), te = I.getBoundingClientRect(),
|
|
7581
|
-
if (
|
|
7580
|
+
const E = p.getBoundingClientRect(), ie = N.getBoundingClientRect(), te = I.getBoundingClientRect(), Ue = ie.bottom - E.top, Me = te.top - E.top, xt = 8;
|
|
7581
|
+
if (Ue > Me - xt) {
|
|
7582
7582
|
const pn = te.height;
|
|
7583
7583
|
Tl.value = {
|
|
7584
7584
|
bottom: `${pn + xt}px`,
|
|
@@ -7591,7 +7591,7 @@ const Ls = {
|
|
|
7591
7591
|
ol("openCommentOverlayForSelector");
|
|
7592
7592
|
});
|
|
7593
7593
|
}, An = T(null), q = T(0), Ln = (a) => {
|
|
7594
|
-
if (!(
|
|
7594
|
+
if (!(k.disabled || !k.richText)) {
|
|
7595
7595
|
if (a.key === "Escape") {
|
|
7596
7596
|
const n = window.getSelection();
|
|
7597
7597
|
if (n.rangeCount > 0) {
|
|
@@ -7720,8 +7720,8 @@ const Ls = {
|
|
|
7720
7720
|
i.nodeType === 3 ? v = i.parentElement : i.tagName === "P" || i.tagName === "DIV" ? v = i : v = i.closest("p, div");
|
|
7721
7721
|
const p = (te) => {
|
|
7722
7722
|
if (!te) return !1;
|
|
7723
|
-
const
|
|
7724
|
-
return
|
|
7723
|
+
const Ue = te.textContent || "", xt = (te.innerHTML || "").trim(), pn = xt.replace(/<br\s*\/?>/gi, "").trim();
|
|
7724
|
+
return Ue.trim() === "" || xt === "" || pn === "" || xt === "<br>" || xt === "<br/>" || xt === "<p></p>" || xt === "<p><br></p>" || xt === "<p><br/></p>" || xt === "<p> </p>" || xt === "<p><br> </p>" || xt === "<div></div>" || xt === "<div><br></div>" || xt === "<div><br/></div>";
|
|
7725
7725
|
}, g = u.lastChild, b = g && g.nodeType === 1 && g.tagName === "BR", N = s.startContainer, I = N.nodeType === 3 ? N.parentElement : N, E = I === u || I && I.parentElement === u;
|
|
7726
7726
|
if (v && p(v) || b && E) {
|
|
7727
7727
|
a.preventDefault(), setTimeout(() => {
|
|
@@ -7752,7 +7752,7 @@ const Ls = {
|
|
|
7752
7752
|
An.value = a.key;
|
|
7753
7753
|
}
|
|
7754
7754
|
}, sl = (a) => {
|
|
7755
|
-
if (
|
|
7755
|
+
if (k.disabled || !k.richText) return;
|
|
7756
7756
|
a.preventDefault();
|
|
7757
7757
|
let n = a.clipboardData.getData("text/html"), s = a.clipboardData.getData("text/plain");
|
|
7758
7758
|
n && (n = n.replace(/<!--[\s\S]*?-->/g, "")), s && (s = s.replace(/<!--[\s\S]*?-->/g, "")), Pe();
|
|
@@ -7774,9 +7774,9 @@ const Ls = {
|
|
|
7774
7774
|
}), u) {
|
|
7775
7775
|
const I = ["P", "H1", "H2", "H3", "H4", "H5", "H6", "DIV", "BLOCKQUOTE", "UL", "OL", "LI"], E = Array.from(g.body.children).filter((ie) => I.includes(ie.tagName));
|
|
7776
7776
|
if (E.length === 1) {
|
|
7777
|
-
const ie = E[0].tagName, te = u.tagName,
|
|
7777
|
+
const ie = E[0].tagName, te = u.tagName, Ue = u.textContent.trim() === "" && !u.querySelector("img");
|
|
7778
7778
|
let Me = !1;
|
|
7779
|
-
if (["H1", "H2", "H3", "H4", "H5", "H6"].includes(te) ? Me = !0 :
|
|
7779
|
+
if (["H1", "H2", "H3", "H4", "H5", "H6"].includes(te) ? Me = !0 : Ue || (ie === te || ie === "P") && (Me = !0), Me)
|
|
7780
7780
|
return E[0].innerHTML.trim();
|
|
7781
7781
|
}
|
|
7782
7782
|
}
|
|
@@ -7889,7 +7889,7 @@ const Ls = {
|
|
|
7889
7889
|
const a = document.querySelector(`.dss-toolbar-dropdown-submenu[data-submenu-id="${lt.value}"]`), n = document.querySelector(`.dss-toolbar-dropdown-item-has-submenu[data-submenu-id="${lt.value}"]`);
|
|
7890
7890
|
a && n && Ml(a, n);
|
|
7891
7891
|
}
|
|
7892
|
-
if (He.value && on(),
|
|
7892
|
+
if (He.value && on(), k.richText) {
|
|
7893
7893
|
if (At !== null)
|
|
7894
7894
|
return;
|
|
7895
7895
|
At = setTimeout(() => {
|
|
@@ -7897,7 +7897,7 @@ const Ls = {
|
|
|
7897
7897
|
}, 150);
|
|
7898
7898
|
}
|
|
7899
7899
|
}, Qt = () => {
|
|
7900
|
-
if (!
|
|
7900
|
+
if (!k.richText) return;
|
|
7901
7901
|
document.querySelectorAll(".dss-toolbar-custom-group").forEach((n) => {
|
|
7902
7902
|
Array.from(n.children).filter(
|
|
7903
7903
|
(i) => i.tagName === "DIV" && !i.classList.contains("dss-toolbar-button")
|
|
@@ -7929,7 +7929,7 @@ const Ls = {
|
|
|
7929
7929
|
});
|
|
7930
7930
|
}), ye(() => {
|
|
7931
7931
|
es();
|
|
7932
|
-
}),
|
|
7932
|
+
}), k.richText && m.value) {
|
|
7933
7933
|
try {
|
|
7934
7934
|
document.execCommand("defaultParagraphSeparator", !1, "p");
|
|
7935
7935
|
} catch {
|
|
@@ -7953,7 +7953,7 @@ const Ls = {
|
|
|
7953
7953
|
Wt(), Qt();
|
|
7954
7954
|
}), m.value.addEventListener("click", (p) => {
|
|
7955
7955
|
const g = p.target;
|
|
7956
|
-
g.closest("a") && !
|
|
7956
|
+
g.closest("a") && !k.disabled && p.preventDefault();
|
|
7957
7957
|
const N = g.closest(".dss-image-no-alt-icon"), I = g.closest(".dss-image-wrapper");
|
|
7958
7958
|
if (N || I && g === I) {
|
|
7959
7959
|
p.preventDefault(), p.stopPropagation();
|
|
@@ -7962,8 +7962,8 @@ const Ls = {
|
|
|
7962
7962
|
} else I && g.tagName !== "IMG" && (p.preventDefault(), ye(() => {
|
|
7963
7963
|
const E = window.getSelection();
|
|
7964
7964
|
if (E.rangeCount > 0) {
|
|
7965
|
-
const te = E.getRangeAt(0).commonAncestorContainer,
|
|
7966
|
-
if (I.contains(
|
|
7965
|
+
const te = E.getRangeAt(0).commonAncestorContainer, Ue = te.nodeType === 3 ? te.parentElement : te;
|
|
7966
|
+
if (I.contains(Ue) && Ue !== I.querySelector("img")) {
|
|
7967
7967
|
const Me = document.createRange();
|
|
7968
7968
|
Me.setStartAfter(I), Me.collapse(!0), E.removeAllRanges(), E.addRange(Me);
|
|
7969
7969
|
}
|
|
@@ -8022,7 +8022,7 @@ const Ls = {
|
|
|
8022
8022
|
Ke.value = null;
|
|
8023
8023
|
return;
|
|
8024
8024
|
}
|
|
8025
|
-
const
|
|
8025
|
+
const Ue = E.commonAncestorContainer, Me = Ue.nodeType === 3 ? Ue.parentElement : Ue;
|
|
8026
8026
|
if (Me?.closest(".dss-image-wrapper") === I || I && I.contains(Me)) {
|
|
8027
8027
|
Ke.value = null;
|
|
8028
8028
|
return;
|
|
@@ -8107,12 +8107,12 @@ const Ls = {
|
|
|
8107
8107
|
subtree: !0
|
|
8108
8108
|
}), p._toolbarMutationObserver = g;
|
|
8109
8109
|
}
|
|
8110
|
-
}),
|
|
8111
|
-
const p = ll(
|
|
8110
|
+
}), k.modelValue) {
|
|
8111
|
+
const p = ll(k.modelValue);
|
|
8112
8112
|
m.value.innerHTML = p, Zt();
|
|
8113
8113
|
}
|
|
8114
8114
|
ye(() => {
|
|
8115
|
-
const p = m.value.innerHTML || "", g =
|
|
8115
|
+
const p = m.value.innerHTML || "", g = k.title || "", b = k.description || "";
|
|
8116
8116
|
ee.value = p, le.value = g, Ce.value = b, $.value = g, x.value = b, Un(), Ee(), G(), dl(), _a(), xa();
|
|
8117
8117
|
}), zn(), Zn(), m.value._mutationObserver = v;
|
|
8118
8118
|
}
|
|
@@ -8126,7 +8126,7 @@ const Ls = {
|
|
|
8126
8126
|
});
|
|
8127
8127
|
const Ba = (a) => {
|
|
8128
8128
|
const n = a.target, s = n.closest("a");
|
|
8129
|
-
if (s && !
|
|
8129
|
+
if (s && !k.disabled) {
|
|
8130
8130
|
a.preventDefault();
|
|
8131
8131
|
const u = document.createRange();
|
|
8132
8132
|
u.selectNodeContents(s);
|
|
@@ -8187,7 +8187,7 @@ const Ls = {
|
|
|
8187
8187
|
}
|
|
8188
8188
|
});
|
|
8189
8189
|
}, dl = () => {
|
|
8190
|
-
if (!
|
|
8190
|
+
if (!k.richText || k.disabled || !m.value) {
|
|
8191
8191
|
pt.value = "p";
|
|
8192
8192
|
return;
|
|
8193
8193
|
}
|
|
@@ -8237,7 +8237,7 @@ const Ls = {
|
|
|
8237
8237
|
}, xl = () => {
|
|
8238
8238
|
He.value = !1;
|
|
8239
8239
|
}, on = () => {
|
|
8240
|
-
if (!
|
|
8240
|
+
if (!k.floatingToolbar || !k.richText || k.disabled) {
|
|
8241
8241
|
He.value = !1;
|
|
8242
8242
|
return;
|
|
8243
8243
|
}
|
|
@@ -8278,8 +8278,8 @@ const Ls = {
|
|
|
8278
8278
|
E = te, ie = te;
|
|
8279
8279
|
}
|
|
8280
8280
|
if (b > 0) {
|
|
8281
|
-
const te = I + v,
|
|
8282
|
-
if (E = Math.max(E, te), ie = Math.min(ie,
|
|
8281
|
+
const te = I + v, Ue = b - I - v;
|
|
8282
|
+
if (E = Math.max(E, te), ie = Math.min(ie, Ue), ie < E) {
|
|
8283
8283
|
const Me = b / 2;
|
|
8284
8284
|
E = Me, ie = Me;
|
|
8285
8285
|
}
|
|
@@ -8292,7 +8292,7 @@ const Ls = {
|
|
|
8292
8292
|
zIndex: 10003
|
|
8293
8293
|
}, He.value = !0;
|
|
8294
8294
|
}, ba = (a) => {
|
|
8295
|
-
|
|
8295
|
+
k.disabled || !k.richText || (yt.value = yt.value === a ? null : a, a === "askAi" && (xe.value = null));
|
|
8296
8296
|
}, Oa = () => {
|
|
8297
8297
|
yt.value = null, lt.value = null;
|
|
8298
8298
|
}, Yn = (a) => {
|
|
@@ -8300,7 +8300,7 @@ const Ls = {
|
|
|
8300
8300
|
};
|
|
8301
8301
|
let kl = null, Wn = null, Dl = null, Pl = null;
|
|
8302
8302
|
const Ql = (a) => {
|
|
8303
|
-
if (
|
|
8303
|
+
if (k.disabled || !k.richText) {
|
|
8304
8304
|
Bl(), Ol();
|
|
8305
8305
|
return;
|
|
8306
8306
|
}
|
|
@@ -8317,9 +8317,9 @@ const Ls = {
|
|
|
8317
8317
|
let u = i.getAttribute("alt");
|
|
8318
8318
|
u === null && (u = i.alt || "");
|
|
8319
8319
|
let f = i.getAttribute("data-alt");
|
|
8320
|
-
f === null && (f = u), i.hasAttribute("alt") || i.setAttribute("alt", u), i.hasAttribute("data-alt") || i.setAttribute("data-alt", f), ot.value = i, Tt.value = u.trim() || O("textEditor.image.noAlt"), cn.value = !0,
|
|
8320
|
+
f === null && (f = u), i.hasAttribute("alt") || i.setAttribute("alt", u), i.hasAttribute("data-alt") || i.setAttribute("data-alt", f), ot.value = i, Tt.value = u.trim() || O("textEditor.image.noAlt"), cn.value = !0, qe.value = !0, wa(i);
|
|
8321
8321
|
} else !i && Pl ? (Pl = null, Dl = setTimeout(() => {
|
|
8322
|
-
|
|
8322
|
+
qe.value || Ol();
|
|
8323
8323
|
}, 150)) : i && i === Pl && wa(i);
|
|
8324
8324
|
}, ts = (a) => {
|
|
8325
8325
|
const n = a.relatedTarget;
|
|
@@ -8339,8 +8339,8 @@ const Ls = {
|
|
|
8339
8339
|
zIndex: 10002
|
|
8340
8340
|
};
|
|
8341
8341
|
}, Ol = () => {
|
|
8342
|
-
|
|
8343
|
-
|
|
8342
|
+
qe.value = !1, setTimeout(() => {
|
|
8343
|
+
qe.value || (cn.value = !1, Tt.value = "", qt.value || (ot.value = null));
|
|
8344
8344
|
}, 100);
|
|
8345
8345
|
}, wa = (a) => {
|
|
8346
8346
|
if (!a || !m.value) return;
|
|
@@ -8481,28 +8481,28 @@ const Ls = {
|
|
|
8481
8481
|
const N = [...b.matchAll(s)];
|
|
8482
8482
|
if (N.length === 0) continue;
|
|
8483
8483
|
const I = N.filter((te) => {
|
|
8484
|
-
const
|
|
8485
|
-
if (Me > 0 && b[Me - 1] === "@" || Me +
|
|
8484
|
+
const Ue = te[0], Me = te.index;
|
|
8485
|
+
if (Me > 0 && b[Me - 1] === "@" || Me + Ue.length < b.length && b[Me + Ue.length] === "@")
|
|
8486
8486
|
return !1;
|
|
8487
8487
|
const xt = g.parentElement;
|
|
8488
8488
|
return !(xt && xt.closest("a"));
|
|
8489
8489
|
});
|
|
8490
8490
|
if (I.length === 0) continue;
|
|
8491
8491
|
if (I.length === 1 && I[0][0] === b.trim()) {
|
|
8492
|
-
const te = I[0][0],
|
|
8493
|
-
Me.href =
|
|
8492
|
+
const te = I[0][0], Ue = te.startsWith("http://") || te.startsWith("https://") ? te : `https://${te}`, Me = document.createElement("a");
|
|
8493
|
+
Me.href = Ue, Me.textContent = te, Me.style.color = "#60afdf", Me.style.textDecoration = "underline", g.parentNode && (g.parentNode.replaceChild(Me, g), v = !0);
|
|
8494
8494
|
continue;
|
|
8495
8495
|
}
|
|
8496
8496
|
let E = 0;
|
|
8497
8497
|
const ie = document.createDocumentFragment();
|
|
8498
8498
|
if (I.forEach((te) => {
|
|
8499
|
-
const
|
|
8500
|
-
if (
|
|
8501
|
-
const mn = b.substring(E,
|
|
8499
|
+
const Ue = te.index, Me = te[0];
|
|
8500
|
+
if (Ue > E) {
|
|
8501
|
+
const mn = b.substring(E, Ue);
|
|
8502
8502
|
mn && ie.appendChild(document.createTextNode(mn));
|
|
8503
8503
|
}
|
|
8504
8504
|
const xt = Me.startsWith("http://") || Me.startsWith("https://") ? Me : `https://${Me}`, pn = document.createElement("a");
|
|
8505
|
-
pn.href = xt, pn.textContent = Me, pn.style.color = "#60afdf", pn.style.textDecoration = "underline", ie.appendChild(pn), E =
|
|
8505
|
+
pn.href = xt, pn.textContent = Me, pn.style.color = "#60afdf", pn.style.textDecoration = "underline", ie.appendChild(pn), E = Ue + Me.length;
|
|
8506
8506
|
}), E < b.length) {
|
|
8507
8507
|
const te = b.substring(E);
|
|
8508
8508
|
te && ie.appendChild(document.createTextNode(te));
|
|
@@ -8588,10 +8588,10 @@ const Ls = {
|
|
|
8588
8588
|
if (!ie) return;
|
|
8589
8589
|
const te = document.createRange();
|
|
8590
8590
|
te.setStart(ie.node, ie.offset), te.setEnd(i.endContainer, i.endOffset);
|
|
8591
|
-
const
|
|
8592
|
-
|
|
8591
|
+
const Ue = document.createElement(g);
|
|
8592
|
+
Ue.textContent = N, te.deleteContents(), te.insertNode(Ue);
|
|
8593
8593
|
const Me = window.getSelection(), xt = document.createRange();
|
|
8594
|
-
xt.setStartAfter(
|
|
8594
|
+
xt.setStartAfter(Ue), xt.collapse(!0), Me.removeAllRanges(), Me.addRange(xt);
|
|
8595
8595
|
const pn = Rn();
|
|
8596
8596
|
ye(() => {
|
|
8597
8597
|
Be(), pn && ft(pn);
|
|
@@ -8637,7 +8637,7 @@ const Ls = {
|
|
|
8637
8637
|
Jt();
|
|
8638
8638
|
return;
|
|
8639
8639
|
}
|
|
8640
|
-
qt.value = !0,
|
|
8640
|
+
qt.value = !0, qe.value = !1, cn.value = !1, ye(() => {
|
|
8641
8641
|
_e.value === "url" && zt.value ? (zt.value.focus(), zt.value.select()) : Gt.value && (Gt.value.focus(), Gt.value.select()), Xt.value && (Xt.value.value = "");
|
|
8642
8642
|
});
|
|
8643
8643
|
}, zl = () => {
|
|
@@ -8722,52 +8722,52 @@ const Ls = {
|
|
|
8722
8722
|
}), zn(), on(), zl();
|
|
8723
8723
|
});
|
|
8724
8724
|
};
|
|
8725
|
-
Bt(() =>
|
|
8726
|
-
if (
|
|
8725
|
+
Bt(() => k.modelValue, (a) => {
|
|
8726
|
+
if (k.richText && m.value && !ke.value) {
|
|
8727
8727
|
const n = ll(a || ""), i = m.value.innerHTML.replace(/ |\u00A0/g, " "), u = n.replace(/ |\u00A0/g, " ");
|
|
8728
8728
|
if (i !== u) {
|
|
8729
8729
|
const f = Rn();
|
|
8730
8730
|
m.value.innerHTML = n, ye(() => {
|
|
8731
8731
|
Zt();
|
|
8732
|
-
const v = m.value.innerHTML || "", p =
|
|
8732
|
+
const v = m.value.innerHTML || "", p = k.title || "", g = k.description || "";
|
|
8733
8733
|
ee.value = v, le.value = p, Ce.value = g, K.value = v, $.value = p, x.value = g, at.value = [], Mt.value = [], Re.value && (clearTimeout(Re.value), Re.value = null), st.value = !1, f && ft(f), Un(), Ee(), G(), zn(), on(), dl(), ol("watch-modelValue");
|
|
8734
8734
|
});
|
|
8735
8735
|
}
|
|
8736
8736
|
}
|
|
8737
|
-
}, { immediate: !0 }), Bt(() =>
|
|
8737
|
+
}, { immediate: !0 }), Bt(() => k.richText, (a) => {
|
|
8738
8738
|
a ? (on(), ye(() => {
|
|
8739
8739
|
_a();
|
|
8740
8740
|
})) : (xl(), Ht.value = [], vt.value && (vt.value.disconnect(), vt.value = null)), dl();
|
|
8741
|
-
}), Bt(() =>
|
|
8741
|
+
}), Bt(() => k.floatingToolbar, (a) => {
|
|
8742
8742
|
a ? on() : xl();
|
|
8743
|
-
}), Bt(() =>
|
|
8743
|
+
}), Bt(() => k.disabled, (a) => {
|
|
8744
8744
|
a && xl(), dl();
|
|
8745
|
-
}), Bt(() =>
|
|
8745
|
+
}), Bt(() => k.description, () => {
|
|
8746
8746
|
ye(() => {
|
|
8747
8747
|
ge.value ? Ll() : Ft();
|
|
8748
8748
|
});
|
|
8749
|
-
}), Bt(() =>
|
|
8749
|
+
}), Bt(() => k.title, () => {
|
|
8750
8750
|
ye(() => {
|
|
8751
8751
|
je.value ? Vn() : Al();
|
|
8752
8752
|
});
|
|
8753
|
-
}), Bt(() =>
|
|
8753
|
+
}), Bt(() => k.customToolbarSlots, () => {
|
|
8754
8754
|
ye(() => {
|
|
8755
8755
|
Qt();
|
|
8756
8756
|
});
|
|
8757
|
-
}, { deep: !0 }), Bt(() =>
|
|
8757
|
+
}, { deep: !0 }), Bt(() => k.comments, (a, n) => {
|
|
8758
8758
|
if (ha.value) {
|
|
8759
8759
|
ha.value = !1;
|
|
8760
8760
|
return;
|
|
8761
8761
|
}
|
|
8762
|
-
Gl.value ||
|
|
8762
|
+
Gl.value || k.richText && m.value && ye(() => {
|
|
8763
8763
|
xa();
|
|
8764
8764
|
});
|
|
8765
8765
|
}, { deep: !0, immediate: !1 });
|
|
8766
8766
|
const xa = () => {
|
|
8767
|
-
if (!Gl.value && !(!
|
|
8767
|
+
if (!Gl.value && !(!k.comments || !Array.isArray(k.comments) || k.comments.length === 0) && !(!k.richText || !m.value)) {
|
|
8768
8768
|
Gl.value = !0;
|
|
8769
8769
|
try {
|
|
8770
|
-
const a = /* @__PURE__ */ new Set(), n =
|
|
8770
|
+
const a = /* @__PURE__ */ new Set(), n = k.comments.filter((v) => {
|
|
8771
8771
|
const p = String(v.conversation_id || v.id);
|
|
8772
8772
|
return a.has(p) ? !1 : (a.add(p), !0);
|
|
8773
8773
|
}), s = m.value.querySelectorAll("[data-comment], [data-fake-comment]"), i = s.length;
|
|
@@ -8798,11 +8798,11 @@ const Ls = {
|
|
|
8798
8798
|
if (N && !N.collapsed) {
|
|
8799
8799
|
const I = N.commonAncestorContainer, E = I.nodeType === 3 ? I.parentElement : I;
|
|
8800
8800
|
if (E) {
|
|
8801
|
-
const
|
|
8802
|
-
if (
|
|
8803
|
-
const Me =
|
|
8801
|
+
const Ue = E.closest("[data-comment], [data-fake-comment]");
|
|
8802
|
+
if (Ue) {
|
|
8803
|
+
const Me = Ue.getAttribute("data-comment") || Ue.getAttribute("data-fake-comment");
|
|
8804
8804
|
if (String(Me) === String(p)) {
|
|
8805
|
-
|
|
8805
|
+
Ue.setAttribute("data-comment", g), Ue.removeAttribute("data-fake-comment"), Jl(Ue, v), f.add(g);
|
|
8806
8806
|
return;
|
|
8807
8807
|
} else
|
|
8808
8808
|
return;
|
|
@@ -8908,7 +8908,7 @@ const Ls = {
|
|
|
8908
8908
|
const v = s.length;
|
|
8909
8909
|
v > 0 ? a.setAttribute("data-comment-count", String(v)) : a.removeAttribute("data-comment-count");
|
|
8910
8910
|
}, ol = (a = "unknown") => {
|
|
8911
|
-
if (!
|
|
8911
|
+
if (!k.richText || !m.value) {
|
|
8912
8912
|
Ht.value = [];
|
|
8913
8913
|
return;
|
|
8914
8914
|
}
|
|
@@ -8939,14 +8939,14 @@ const Ls = {
|
|
|
8939
8939
|
let te = E.getAttribute("data-comment") || E.getAttribute("data-fake-comment");
|
|
8940
8940
|
if (!te) return;
|
|
8941
8941
|
if (typeof te == "string" && te.startsWith("comment-")) {
|
|
8942
|
-
const _n = E.textContent?.trim(), pl =
|
|
8942
|
+
const _n = E.textContent?.trim(), pl = k.comments?.find((il) => (typeof il.conversation_id == "string" && il.conversation_id.startsWith("comment-") ? null : il.conversation_id) && il.selection_text?.trim() === _n);
|
|
8943
8943
|
pl ? (te = String(pl.conversation_id), E.setAttribute("data-comment", te), E.removeAttribute("data-fake-comment")) : (te = String(Date.now()), E.setAttribute("data-comment", te), E.removeAttribute("data-fake-comment"));
|
|
8944
8944
|
}
|
|
8945
|
-
const
|
|
8945
|
+
const Ue = E.getBoundingClientRect(), Me = window.getComputedStyle(E), xt = parseFloat(Me.lineHeight) || parseFloat(Me.fontSize) * 1.2, un = Ue.top - b.top + xt / 2 - 15, hn = b.top - g.top + un;
|
|
8946
8946
|
let vn = null, el = null, Sl = 0;
|
|
8947
8947
|
const In = [], ra = /* @__PURE__ */ new Set();
|
|
8948
|
-
if (te &&
|
|
8949
|
-
const _n =
|
|
8948
|
+
if (te && k.comments) {
|
|
8949
|
+
const _n = k.comments.find((pl) => String(pl.conversation_id || pl.id) === String(te));
|
|
8950
8950
|
if (_n) {
|
|
8951
8951
|
const pl = _n.conversation || [];
|
|
8952
8952
|
pl.length > 0 ? (pl.forEach((il) => {
|
|
@@ -8954,7 +8954,7 @@ const Ls = {
|
|
|
8954
8954
|
}), Sl = pl.length) : (Sl = 0, vn = null, el = null), In.length > 0 ? vn = In[0] : vn = null, In.length > 1 ? el = In[1] : el = null;
|
|
8955
8955
|
}
|
|
8956
8956
|
}
|
|
8957
|
-
const ea =
|
|
8957
|
+
const ea = Ue.top + xt / 2 - 15, fl = ea + 30, Wl = 5, ql = fl > b.top + Wl && ea < b.bottom - Wl ? 1 : 0;
|
|
8958
8958
|
Ht.value.find((_n) => _n.id === te);
|
|
8959
8959
|
let Et = E;
|
|
8960
8960
|
if (!Et && te && m.value) {
|
|
@@ -8976,8 +8976,8 @@ const Ls = {
|
|
|
8976
8976
|
const N = Object.values(s).map((E) => {
|
|
8977
8977
|
const ie = Math.max(0, (E.uniqueUserCount ?? 0) - 2);
|
|
8978
8978
|
if (!E.element && E.id && m.value) {
|
|
8979
|
-
const
|
|
8980
|
-
E.element = m.value.querySelector(`[data-comment="${
|
|
8979
|
+
const Ue = String(E.id);
|
|
8980
|
+
E.element = m.value.querySelector(`[data-comment="${Ue}"], [data-fake-comment="${Ue}"]`);
|
|
8981
8981
|
}
|
|
8982
8982
|
return {
|
|
8983
8983
|
...E,
|
|
@@ -8990,8 +8990,8 @@ const Ls = {
|
|
|
8990
8990
|
(Ht.value.length !== N.length || N.some((E, ie) => {
|
|
8991
8991
|
const te = Ht.value[ie];
|
|
8992
8992
|
if (!te) return !0;
|
|
8993
|
-
const
|
|
8994
|
-
return te.id !== E.id || Math.abs(te.top - E.top) > 1 || te.opacity !== E.opacity || te.totalCount !== E.totalCount || te.additionalCount !== E.additionalCount ||
|
|
8993
|
+
const Ue = (te.firstUser?.id || null) !== (E.firstUser?.id || null), Me = (te.secondUser?.id || null) !== (E.secondUser?.id || null);
|
|
8994
|
+
return te.id !== E.id || Math.abs(te.top - E.top) > 1 || te.opacity !== E.opacity || te.totalCount !== E.totalCount || te.additionalCount !== E.additionalCount || Ue || Me || te.element !== E.element;
|
|
8995
8995
|
})) && (Ht.value = N), jn.value = !1;
|
|
8996
8996
|
}));
|
|
8997
8997
|
}, os = (a) => {
|
|
@@ -9013,7 +9013,7 @@ const Ls = {
|
|
|
9013
9013
|
const n = a.element.getAttribute("data-comment") || a.element.getAttribute("data-fake-comment");
|
|
9014
9014
|
if (!n) return;
|
|
9015
9015
|
const s = `[data-comment="${n}"], [data-fake-comment="${n}"]`;
|
|
9016
|
-
|
|
9016
|
+
We("comment-marker-clicked", {
|
|
9017
9017
|
commentId: n,
|
|
9018
9018
|
selector: s,
|
|
9019
9019
|
element: a.element
|
|
@@ -9021,7 +9021,7 @@ const Ls = {
|
|
|
9021
9021
|
}, Sa = () => {
|
|
9022
9022
|
Rl();
|
|
9023
9023
|
}, _a = () => {
|
|
9024
|
-
!
|
|
9024
|
+
!k.richText || !m.value || (vt.value && vt.value.disconnect(), sn.value !== null && (clearTimeout(sn.value), sn.value = null), vt.value = new MutationObserver(() => {
|
|
9025
9025
|
sn.value === null && (sn.value = setTimeout(() => {
|
|
9026
9026
|
sn.value = null, ye(() => {
|
|
9027
9027
|
ol("MutationObserver");
|
|
@@ -9091,7 +9091,7 @@ const Ls = {
|
|
|
9091
9091
|
}
|
|
9092
9092
|
});
|
|
9093
9093
|
}));
|
|
9094
|
-
}), Bt(() =>
|
|
9094
|
+
}), Bt(() => k.locale, (a) => {
|
|
9095
9095
|
a && a !== Ze.value && (Ze.value = a);
|
|
9096
9096
|
}, { immediate: !0 }), Le({
|
|
9097
9097
|
openCommentOverlayForSelector: Ca,
|
|
@@ -9996,7 +9996,7 @@ const Ls = {
|
|
|
9996
9996
|
}])
|
|
9997
9997
|
}, V(s.text || ""), 3)
|
|
9998
9998
|
]),
|
|
9999
|
-
|
|
9999
|
+
k.commentUser && s.user && s.user.id === k.commentUser.id && !Kl(s.text) ? (c(), d("button", {
|
|
10000
10000
|
key: 1,
|
|
10001
10001
|
type: "button",
|
|
10002
10002
|
class: "dss-comment-delete-button",
|
|
@@ -10124,7 +10124,7 @@ const Ls = {
|
|
|
10124
10124
|
key: 0,
|
|
10125
10125
|
class: "dss-link-popup",
|
|
10126
10126
|
style: he(ce.value),
|
|
10127
|
-
onMouseenter: n[29] || (n[29] = (s) =>
|
|
10127
|
+
onMouseenter: n[29] || (n[29] = (s) => qe.value = !0),
|
|
10128
10128
|
onMouseleave: Ol
|
|
10129
10129
|
}, [
|
|
10130
10130
|
l("div", L1, [
|
|
@@ -10632,12 +10632,12 @@ const Ls = {
|
|
|
10632
10632
|
let le = K[1];
|
|
10633
10633
|
return le.length === 3 && (le = le.split("").map((Ce) => Ce + Ce).join("")), "#" + le;
|
|
10634
10634
|
}
|
|
10635
|
-
function
|
|
10635
|
+
function k(ee, K, le) {
|
|
10636
10636
|
K /= 100, le /= 100;
|
|
10637
10637
|
const Ce = le + K * Math.min(le, 1 - le), $ = Ce === 0 ? 0 : 2 - 2 * le / Ce;
|
|
10638
10638
|
return { h: ee, s: $ * 100, v: Ce * 100 };
|
|
10639
10639
|
}
|
|
10640
|
-
function
|
|
10640
|
+
function We(ee, K, le) {
|
|
10641
10641
|
K /= 100, le /= 100;
|
|
10642
10642
|
const Ce = le * (1 - K / 2), $ = Ce === 0 || Ce === 1 ? 0 : (le - Ce) / Math.min(Ce, 1 - Ce);
|
|
10643
10643
|
return { h: ee, s: $ * 100, l: Ce * 100 };
|
|
@@ -10716,7 +10716,7 @@ const Ls = {
|
|
|
10716
10716
|
}), Gt = y(() => rt.value.toLowerCase()), Xt = y(() => ({
|
|
10717
10717
|
background: `linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, hsl(${j.value.h}, 100%, 50%))`
|
|
10718
10718
|
})), zt = y(() => {
|
|
10719
|
-
const ee =
|
|
10719
|
+
const ee = k(j.value.h, j.value.s, j.value.l);
|
|
10720
10720
|
return {
|
|
10721
10721
|
left: `${ee.s}%`,
|
|
10722
10722
|
bottom: `${ee.v}%`,
|
|
@@ -10745,7 +10745,7 @@ const Ls = {
|
|
|
10745
10745
|
function ce() {
|
|
10746
10746
|
_t("update:modelValue", rt.value);
|
|
10747
10747
|
}
|
|
10748
|
-
function
|
|
10748
|
+
function qe() {
|
|
10749
10749
|
me.disabled || (m.value = !m.value, m.value && (Tt(), ye(() => {
|
|
10750
10750
|
cn(), Ye.value?.focus();
|
|
10751
10751
|
})));
|
|
@@ -10769,7 +10769,7 @@ const Ls = {
|
|
|
10769
10769
|
if (!Xe.value) return;
|
|
10770
10770
|
const K = Xe.value.getBoundingClientRect(), le = (Ce) => {
|
|
10771
10771
|
const $ = Math.max(0, Math.min(1, (Ce.clientX - K.left) / K.width)), x = Math.max(0, Math.min(1, 1 - (Ce.clientY - K.top) / K.height)), H = { h: j.value.h, s: $ * 100, v: x * 100 };
|
|
10772
|
-
j.value =
|
|
10772
|
+
j.value = We(H.h, H.s, H.v);
|
|
10773
10773
|
};
|
|
10774
10774
|
le(ee), document.addEventListener("mousemove", le), document.addEventListener("mouseup", () => {
|
|
10775
10775
|
document.removeEventListener("mousemove", le), ce();
|
|
@@ -10819,7 +10819,7 @@ const Ls = {
|
|
|
10819
10819
|
ref_key: "triggerRef",
|
|
10820
10820
|
ref: A,
|
|
10821
10821
|
class: oe(["dss-color-picker__trigger", { "dss-color-picker__trigger--open": m.value }]),
|
|
10822
|
-
onClick:
|
|
10822
|
+
onClick: qe
|
|
10823
10823
|
}, [
|
|
10824
10824
|
l("span", {
|
|
10825
10825
|
class: "dss-color-picker__swatch",
|
|
@@ -11077,18 +11077,18 @@ const Ls = {
|
|
|
11077
11077
|
},
|
|
11078
11078
|
setup(W) {
|
|
11079
11079
|
const Le = W, U = y(() => Le.size === "small" ? "dss-loaders--size-small" : Le.size === "large" ? "dss-loaders--size-large" : Le.size === "medium" || Le.size == null ? "dss-loaders--size-medium" : null), O = y(() => Le.size === "small" || Le.size === "medium" || Le.size === "large" || Le.size == null ? {} : { "--dss-loader-size": typeof Le.size == "number" ? `${Le.size}px` : String(Le.size) });
|
|
11080
|
-
return (Ze,
|
|
11080
|
+
return (Ze, k) => (c(), d("div", {
|
|
11081
11081
|
class: oe(["dss-loaders", U.value]),
|
|
11082
11082
|
style: he(O.value)
|
|
11083
11083
|
}, [
|
|
11084
11084
|
W.type === "spinner" ? (c(), d("div", H2, [
|
|
11085
|
-
|
|
11085
|
+
k[0] || (k[0] = l("span", {
|
|
11086
11086
|
class: "dss-loader-spinner",
|
|
11087
11087
|
"aria-hidden": "true"
|
|
11088
11088
|
}, null, -1)),
|
|
11089
11089
|
W.label ? (c(), d("span", E2, V(W.label), 1)) : R("", !0)
|
|
11090
11090
|
])) : W.type === "dots" ? (c(), d("div", A2, [
|
|
11091
|
-
|
|
11091
|
+
k[1] || (k[1] = l("span", {
|
|
11092
11092
|
class: "dss-loader-dots",
|
|
11093
11093
|
"aria-hidden": "true"
|
|
11094
11094
|
}, [
|
|
@@ -11098,13 +11098,13 @@ const Ls = {
|
|
|
11098
11098
|
], -1)),
|
|
11099
11099
|
W.label ? (c(), d("span", L2, V(W.label), 1)) : R("", !0)
|
|
11100
11100
|
])) : W.type === "battery" ? (c(), d("div", T2, [
|
|
11101
|
-
|
|
11101
|
+
k[2] || (k[2] = l("div", {
|
|
11102
11102
|
class: "battery",
|
|
11103
11103
|
"aria-hidden": "true"
|
|
11104
11104
|
}, null, -1)),
|
|
11105
11105
|
W.label ? (c(), d("span", V2, V(W.label), 1)) : R("", !0)
|
|
11106
11106
|
])) : W.type === "double-circle" ? (c(), d("div", D2, [
|
|
11107
|
-
|
|
11107
|
+
k[3] || (k[3] = l("span", {
|
|
11108
11108
|
class: "dss-loader-double-circle",
|
|
11109
11109
|
"aria-hidden": "true"
|
|
11110
11110
|
}, [
|
|
@@ -11113,7 +11113,7 @@ const Ls = {
|
|
|
11113
11113
|
], -1)),
|
|
11114
11114
|
W.label ? (c(), d("span", R2, V(W.label), 1)) : R("", !0)
|
|
11115
11115
|
])) : W.type === "bars" ? (c(), d("div", N2, [
|
|
11116
|
-
|
|
11116
|
+
k[4] || (k[4] = l("span", {
|
|
11117
11117
|
class: "dss-loader-bars",
|
|
11118
11118
|
"aria-hidden": "true"
|
|
11119
11119
|
}, [
|
|
@@ -11123,7 +11123,7 @@ const Ls = {
|
|
|
11123
11123
|
], -1)),
|
|
11124
11124
|
W.label ? (c(), d("span", I2, V(W.label), 1)) : R("", !0)
|
|
11125
11125
|
])) : W.type === "inline" ? (c(), d("div", F2, [
|
|
11126
|
-
|
|
11126
|
+
k[5] || (k[5] = l("span", {
|
|
11127
11127
|
class: "dss-loader-inline-spinner",
|
|
11128
11128
|
"aria-hidden": "true"
|
|
11129
11129
|
}, null, -1)),
|
|
@@ -11151,21 +11151,21 @@ const Ls = {
|
|
|
11151
11151
|
},
|
|
11152
11152
|
setup(W) {
|
|
11153
11153
|
const Le = W, U = y(() => {
|
|
11154
|
-
const
|
|
11154
|
+
const k = {
|
|
11155
11155
|
"dss-skeleton--loading": Le.loading,
|
|
11156
11156
|
"dss-skeleton--static": !Le.shimmer,
|
|
11157
11157
|
"dss-skeleton--multiple": Le.mode === "multiple",
|
|
11158
11158
|
"dss-skeleton--dark": Le.darkMode
|
|
11159
11159
|
};
|
|
11160
|
-
return Le.mode === "multiple" && Le.targetClass !== hs && (
|
|
11160
|
+
return Le.mode === "multiple" && Le.targetClass !== hs && (k[`dss-skeleton--target-${Le.targetClass}`] = !0), k;
|
|
11161
11161
|
}), O = y(() => {
|
|
11162
|
-
const
|
|
11163
|
-
return Le.borderRadius && (
|
|
11162
|
+
const k = {};
|
|
11163
|
+
return Le.borderRadius && (k.borderRadius = Le.borderRadius), k;
|
|
11164
11164
|
}), Ze = y(() => {
|
|
11165
|
-
const
|
|
11166
|
-
return Le.borderRadius && (
|
|
11165
|
+
const k = {};
|
|
11166
|
+
return Le.borderRadius && (k["--dss-skeleton-border-radius"] = Le.borderRadius), Le.darkMode ? (k["--dss-skeleton-bg"] = Le.bgDark || "#322c3f", k["--dss-skeleton-shimmer"] = Le.shimmerDark || "#3e3f41", k) : (Le.bgColor && (k["--dss-skeleton-bg"] = Le.bgColor), Le.shimmerColor && (k["--dss-skeleton-shimmer"] = Le.shimmerColor), k);
|
|
11167
11167
|
});
|
|
11168
|
-
return (
|
|
11168
|
+
return (k, We) => (c(), d("div", {
|
|
11169
11169
|
class: oe(["dss-skeleton", U.value]),
|
|
11170
11170
|
style: he(Ze.value)
|
|
11171
11171
|
}, [
|
|
@@ -11178,7 +11178,7 @@ const Ls = {
|
|
|
11178
11178
|
l("div", {
|
|
11179
11179
|
class: oe(["dss-skeleton-content", { "dss-skeleton-content--hidden": W.loading && W.mode === "single" }])
|
|
11180
11180
|
}, [
|
|
11181
|
-
gn(
|
|
11181
|
+
gn(k.$slots, "default")
|
|
11182
11182
|
], 2)
|
|
11183
11183
|
], 6));
|
|
11184
11184
|
}
|
|
@@ -11204,7 +11204,7 @@ const Ls = {
|
|
|
11204
11204
|
},
|
|
11205
11205
|
emits: ["move", "delete"],
|
|
11206
11206
|
setup(W, { emit: Le }) {
|
|
11207
|
-
const U = W, O = Le, Ze = xs(),
|
|
11207
|
+
const U = W, O = Le, Ze = xs(), k = y(() => !!Ze["delete-zone"]), We = {
|
|
11208
11208
|
columnMinWidth: "280px",
|
|
11209
11209
|
columnMaxWidth: "none",
|
|
11210
11210
|
columnGap: "12px",
|
|
@@ -11217,7 +11217,7 @@ const Ls = {
|
|
|
11217
11217
|
showHeader: !0,
|
|
11218
11218
|
unstyled: !1,
|
|
11219
11219
|
deleteZoneAlwaysVisible: !1
|
|
11220
|
-
}, me = y(() => ({ ...
|
|
11220
|
+
}, me = y(() => ({ ...We, ...U.options })), _t = y(() => ({
|
|
11221
11221
|
"--dss-dnd-col-min-w": me.value.columnMinWidth,
|
|
11222
11222
|
"--dss-dnd-col-max-w": me.value.columnMaxWidth,
|
|
11223
11223
|
"--dss-dnd-col-gap": me.value.columnGap,
|
|
@@ -11227,16 +11227,16 @@ const Ls = {
|
|
|
11227
11227
|
let A = null, de = null, Xe = null, Ye = null, Qe = 0, j = 0, bt = "", tt = null;
|
|
11228
11228
|
const De = 5, Nt = y(() => {
|
|
11229
11229
|
const ce = {};
|
|
11230
|
-
for (const
|
|
11231
|
-
ce[
|
|
11230
|
+
for (const qe of U.columns)
|
|
11231
|
+
ce[qe.value] = U.items.filter((_e) => _e[U.columnKey] === qe.value).sort((_e, Fe) => (_e[U.positionKey] ?? 0) - (Fe[U.positionKey] ?? 0));
|
|
11232
11232
|
return ce;
|
|
11233
11233
|
}), Ut = y(() => {
|
|
11234
|
-
const ce = {},
|
|
11234
|
+
const ce = {}, qe = !!m.value, _e = m.value?.[U.itemKey], Fe = xe.value, lt = ke.value;
|
|
11235
11235
|
for (const $t of U.columns) {
|
|
11236
11236
|
const at = Nt.value[$t.value] || [], Mt = [], Re = Fe == $t.value;
|
|
11237
11237
|
let st = 0;
|
|
11238
11238
|
for (let ee = 0; ee < at.length; ee++) {
|
|
11239
|
-
const K = at[ee], le =
|
|
11239
|
+
const K = at[ee], le = qe && K[U.itemKey] === _e;
|
|
11240
11240
|
!le && Re && lt === st && Mt.push({ type: "indicator", key: `ind-${st}` }), le || st++, Mt.push({
|
|
11241
11241
|
type: "item",
|
|
11242
11242
|
item: K,
|
|
@@ -11248,28 +11248,28 @@ const Ls = {
|
|
|
11248
11248
|
}
|
|
11249
11249
|
return ce;
|
|
11250
11250
|
});
|
|
11251
|
-
function kt(ce,
|
|
11251
|
+
function kt(ce, qe) {
|
|
11252
11252
|
const Fe = (Nt.value[ce] || []).filter(
|
|
11253
11253
|
(at) => at[U.itemKey] !== m.value?.[U.itemKey]
|
|
11254
11254
|
);
|
|
11255
11255
|
if (Fe.length === 0) return 1;
|
|
11256
|
-
if (
|
|
11256
|
+
if (qe <= 0) {
|
|
11257
11257
|
const at = Fe[0][U.positionKey];
|
|
11258
11258
|
return at != null && at > 0 ? at / 2 : 0.5;
|
|
11259
11259
|
}
|
|
11260
|
-
if (
|
|
11260
|
+
if (qe >= Fe.length) {
|
|
11261
11261
|
const at = Fe[Fe.length - 1][U.positionKey];
|
|
11262
11262
|
return (at ?? 0) + 1;
|
|
11263
11263
|
}
|
|
11264
|
-
const lt = Fe[
|
|
11264
|
+
const lt = Fe[qe - 1][U.positionKey] ?? 0, $t = Fe[qe][U.positionKey] ?? 0;
|
|
11265
11265
|
return (lt + $t) / 2;
|
|
11266
11266
|
}
|
|
11267
|
-
function nt(ce,
|
|
11267
|
+
function nt(ce, qe, _e) {
|
|
11268
11268
|
Xe && Xe.remove();
|
|
11269
11269
|
const Fe = ce.getBoundingClientRect(), lt = ce.cloneNode(!0);
|
|
11270
11270
|
lt.classList.add("dss-dnd-ghost"), lt.style.cssText = `
|
|
11271
11271
|
position: fixed;
|
|
11272
|
-
left: ${
|
|
11272
|
+
left: ${qe - Qe}px;
|
|
11273
11273
|
top: ${_e - j}px;
|
|
11274
11274
|
width: ${Fe.width}px;
|
|
11275
11275
|
height: ${Fe.height}px;
|
|
@@ -11283,8 +11283,8 @@ const Ls = {
|
|
|
11283
11283
|
cursor: grabbing;
|
|
11284
11284
|
`, document.body.appendChild(lt), Xe = lt;
|
|
11285
11285
|
}
|
|
11286
|
-
function He(ce,
|
|
11287
|
-
Xe && (Xe.style.left = `${ce - Qe}px`, Xe.style.top = `${
|
|
11286
|
+
function He(ce, qe) {
|
|
11287
|
+
Xe && (Xe.style.left = `${ce - Qe}px`, Xe.style.top = `${qe - j}px`);
|
|
11288
11288
|
}
|
|
11289
11289
|
function Lt(ce) {
|
|
11290
11290
|
ce.classList.add("dss-dnd-item--dragging"), ce.style.background = me.value.dragSourceBackground, ce.style.borderColor = me.value.dragSourceBorder, ce.style.transform = "scale(0.97)";
|
|
@@ -11292,19 +11292,19 @@ const Ls = {
|
|
|
11292
11292
|
function Ot(ce) {
|
|
11293
11293
|
ce.classList.remove("dss-dnd-item--dragging"), ce.style.background = "", ce.style.borderColor = "", ce.style.transform = "";
|
|
11294
11294
|
}
|
|
11295
|
-
function yt(ce,
|
|
11296
|
-
return document.elementFromPoint(ce,
|
|
11295
|
+
function yt(ce, qe) {
|
|
11296
|
+
return document.elementFromPoint(ce, qe)?.closest(".dss-dnd-column-body") ?? null;
|
|
11297
11297
|
}
|
|
11298
|
-
function qt(ce,
|
|
11299
|
-
return !!document.elementFromPoint(ce,
|
|
11298
|
+
function qt(ce, qe) {
|
|
11299
|
+
return !!document.elementFromPoint(ce, qe)?.closest("[data-dss-dnd-delete-zone]");
|
|
11300
11300
|
}
|
|
11301
|
-
function ln(ce,
|
|
11302
|
-
if (
|
|
11301
|
+
function ln(ce, qe) {
|
|
11302
|
+
if (k.value && qt(ce, qe)) {
|
|
11303
11303
|
$e.value = !0, xe.value = null, ke.value = -1;
|
|
11304
11304
|
return;
|
|
11305
11305
|
}
|
|
11306
11306
|
$e.value = !1;
|
|
11307
|
-
const _e = yt(ce,
|
|
11307
|
+
const _e = yt(ce, qe), Fe = _e?.getAttribute("data-column") ?? null;
|
|
11308
11308
|
if (!Fe) {
|
|
11309
11309
|
xe.value = null, ke.value = -1;
|
|
11310
11310
|
return;
|
|
@@ -11314,7 +11314,7 @@ const Ls = {
|
|
|
11314
11314
|
let $t = lt.length;
|
|
11315
11315
|
for (let at = 0; at < lt.length; at++) {
|
|
11316
11316
|
const Mt = lt[at].getBoundingClientRect();
|
|
11317
|
-
if (
|
|
11317
|
+
if (qe < Mt.top + Mt.height / 2) {
|
|
11318
11318
|
$t = at;
|
|
11319
11319
|
break;
|
|
11320
11320
|
}
|
|
@@ -11328,8 +11328,8 @@ const Ls = {
|
|
|
11328
11328
|
}
|
|
11329
11329
|
function It(ce) {
|
|
11330
11330
|
window.removeEventListener("pointermove", wn), window.removeEventListener("pointerup", It), window.removeEventListener("pointercancel", It), Ye?.releasePointerCapture?.(ce.pointerId), Ot(Ye), Ye = null;
|
|
11331
|
-
const
|
|
11332
|
-
if (m.value &&
|
|
11331
|
+
const qe = k.value && qt(ce.clientX, ce.clientY);
|
|
11332
|
+
if (m.value && qe)
|
|
11333
11333
|
O("delete", { item: m.value });
|
|
11334
11334
|
else {
|
|
11335
11335
|
const Fe = yt(ce.clientX, ce.clientY)?.getAttribute("data-column") ?? null;
|
|
@@ -11350,20 +11350,20 @@ const Ls = {
|
|
|
11350
11350
|
}
|
|
11351
11351
|
Xe && (Xe.remove(), Xe = null), bt !== null && (document.body.style.cursor = bt, bt = ""), Tt();
|
|
11352
11352
|
}
|
|
11353
|
-
function ht(ce,
|
|
11353
|
+
function ht(ce, qe) {
|
|
11354
11354
|
ce.preventDefault();
|
|
11355
11355
|
const _e = ce.target.closest(".dss-dnd-item");
|
|
11356
11356
|
if (!_e) return;
|
|
11357
11357
|
const Fe = _e.getBoundingClientRect();
|
|
11358
|
-
Qe = ce.clientX - Fe.left, j = ce.clientY - Fe.top, bt = document.body.style.cursor, document.body.style.cursor = "grabbing", m.value =
|
|
11358
|
+
Qe = ce.clientX - Fe.left, j = ce.clientY - Fe.top, bt = document.body.style.cursor, document.body.style.cursor = "grabbing", m.value = qe, Ye = _e, nt(_e, ce.clientX, ce.clientY), requestAnimationFrame(() => Lt(_e)), _e.setPointerCapture?.(ce.pointerId), window.addEventListener("pointermove", wn), window.addEventListener("pointerup", It, { once: !0 }), window.addEventListener("pointercancel", It, { once: !0 });
|
|
11359
11359
|
}
|
|
11360
11360
|
function rt() {
|
|
11361
11361
|
tt && (window.removeEventListener("pointermove", Gt), window.removeEventListener("pointerup", Xt), window.removeEventListener("pointercancel", Xt), tt = null);
|
|
11362
11362
|
}
|
|
11363
11363
|
function Gt(ce) {
|
|
11364
11364
|
if (!tt || ce.pointerId !== tt.pointerId) return;
|
|
11365
|
-
const
|
|
11366
|
-
if (Math.abs(
|
|
11365
|
+
const qe = ce.clientX - tt.startX, _e = ce.clientY - tt.startY;
|
|
11366
|
+
if (Math.abs(qe) >= De || Math.abs(_e) >= De) {
|
|
11367
11367
|
const Fe = tt.item;
|
|
11368
11368
|
rt(), ht(ce, Fe);
|
|
11369
11369
|
}
|
|
@@ -11371,19 +11371,19 @@ const Ls = {
|
|
|
11371
11371
|
function Xt(ce) {
|
|
11372
11372
|
!tt || ce.pointerId !== tt.pointerId || rt();
|
|
11373
11373
|
}
|
|
11374
|
-
function zt(ce,
|
|
11374
|
+
function zt(ce, qe) {
|
|
11375
11375
|
rt(), tt = {
|
|
11376
|
-
item:
|
|
11376
|
+
item: qe,
|
|
11377
11377
|
startX: ce.clientX,
|
|
11378
11378
|
startY: ce.clientY,
|
|
11379
11379
|
pointerId: ce.pointerId
|
|
11380
11380
|
}, window.addEventListener("pointermove", Gt), window.addEventListener("pointerup", Xt), window.addEventListener("pointercancel", Xt);
|
|
11381
11381
|
}
|
|
11382
|
-
function ot(ce,
|
|
11383
|
-
me.value.useHandle || zt(ce,
|
|
11382
|
+
function ot(ce, qe) {
|
|
11383
|
+
me.value.useHandle || zt(ce, qe);
|
|
11384
11384
|
}
|
|
11385
|
-
function an(ce,
|
|
11386
|
-
zt(ce,
|
|
11385
|
+
function an(ce, qe) {
|
|
11386
|
+
zt(ce, qe);
|
|
11387
11387
|
}
|
|
11388
11388
|
function cn() {
|
|
11389
11389
|
A && (cancelAnimationFrame(A), A = null);
|
|
@@ -11393,11 +11393,11 @@ const Ls = {
|
|
|
11393
11393
|
}
|
|
11394
11394
|
return $a(() => {
|
|
11395
11395
|
cn(), rt(), de && clearTimeout(de), Xe && (Xe.remove(), Xe = null);
|
|
11396
|
-
}), (ce,
|
|
11396
|
+
}), (ce, qe) => (c(), d("div", {
|
|
11397
11397
|
class: oe(["dss-dnd", { "dss-dnd--unstyled": me.value.unstyled }]),
|
|
11398
11398
|
style: he(_t.value)
|
|
11399
11399
|
}, [
|
|
11400
|
-
|
|
11400
|
+
k.value ? (c(), Ul(Xl, {
|
|
11401
11401
|
key: 0,
|
|
11402
11402
|
to: "body"
|
|
11403
11403
|
}, [
|
|
@@ -11450,7 +11450,7 @@ const Ls = {
|
|
|
11450
11450
|
onPointerdown: Oe((lt) => an(lt, Fe.item), ["stop"])
|
|
11451
11451
|
}, [
|
|
11452
11452
|
gn(ce.$slots, "handle", {}, () => [
|
|
11453
|
-
|
|
11453
|
+
qe[0] || (qe[0] = l("span", { class: "dss-dnd-handle-icon" }, "⠿", -1))
|
|
11454
11454
|
])
|
|
11455
11455
|
], 40, U2)) : R("", !0),
|
|
11456
11456
|
l("div", X2, [
|
|
@@ -11468,7 +11468,7 @@ const Ls = {
|
|
|
11468
11468
|
], 64))), 128)),
|
|
11469
11469
|
(Nt.value[_e.value] || []).length === 0 && xe.value != _e.value ? (c(), d("div", j2, [
|
|
11470
11470
|
gn(ce.$slots, "empty", { column: _e }, () => [
|
|
11471
|
-
|
|
11471
|
+
qe[1] || (qe[1] = l("span", { class: "dss-dnd-empty-text" }, "No items", -1))
|
|
11472
11472
|
])
|
|
11473
11473
|
])) : R("", !0)
|
|
11474
11474
|
], 8, Z2)
|
|
@@ -11491,7 +11491,7 @@ const Ls = {
|
|
|
11491
11491
|
},
|
|
11492
11492
|
setup(W) {
|
|
11493
11493
|
const Le = W, U = T(null), O = T(!1);
|
|
11494
|
-
let Ze = [],
|
|
11494
|
+
let Ze = [], k = null, We = null;
|
|
11495
11495
|
function me(ue, A) {
|
|
11496
11496
|
const de = [];
|
|
11497
11497
|
for (let Xe = 0; Xe < Le.count; Xe++)
|
|
@@ -11536,7 +11536,7 @@ const Ls = {
|
|
|
11536
11536
|
const bt = Date.now(), tt = bt - Ye;
|
|
11537
11537
|
if (bt < Qe) {
|
|
11538
11538
|
let De = 1;
|
|
11539
|
-
tt > Le.fadeStart && (De = 1 - (tt - Le.fadeStart) / (Le.duration - Le.fadeStart)), m(A, ue.width, ue.height, De), xe(ue.width, ue.height, De),
|
|
11539
|
+
tt > Le.fadeStart && (De = 1 - (tt - Le.fadeStart) / (Le.duration - Le.fadeStart)), m(A, ue.width, ue.height, De), xe(ue.width, ue.height, De), k = requestAnimationFrame(j);
|
|
11540
11540
|
} else
|
|
11541
11541
|
ke();
|
|
11542
11542
|
};
|
|
@@ -11544,12 +11544,12 @@ const Ls = {
|
|
|
11544
11544
|
});
|
|
11545
11545
|
}
|
|
11546
11546
|
function ke() {
|
|
11547
|
-
|
|
11547
|
+
k && (cancelAnimationFrame(k), k = null), Ze = [], O.value = !1;
|
|
11548
11548
|
}
|
|
11549
11549
|
return Bt(() => Le.trigger, (ue) => {
|
|
11550
|
-
ue && (
|
|
11550
|
+
ue && (We && clearTimeout(We), We = setTimeout($e, Le.delay));
|
|
11551
11551
|
}, { immediate: !0 }), $a(() => {
|
|
11552
|
-
ke(),
|
|
11552
|
+
ke(), We && clearTimeout(We);
|
|
11553
11553
|
}), (ue, A) => O.value ? (c(), d("canvas", {
|
|
11554
11554
|
key: 0,
|
|
11555
11555
|
ref_key: "canvasRef",
|
|
@@ -11605,11 +11605,11 @@ const Ls = {
|
|
|
11605
11605
|
},
|
|
11606
11606
|
emits: ["update:modelValue"],
|
|
11607
11607
|
setup(W, { expose: Le, emit: U }) {
|
|
11608
|
-
const O = W, Ze = U,
|
|
11608
|
+
const O = W, Ze = U, k = {
|
|
11609
11609
|
unstyled: !1,
|
|
11610
11610
|
maxUniqueForSelect: 30,
|
|
11611
11611
|
maxUniqueForEnum: 15
|
|
11612
|
-
},
|
|
11612
|
+
}, We = y(() => ({ ...k, ...O.options })), me = {
|
|
11613
11613
|
text: [
|
|
11614
11614
|
{ value: "contains", label: "contains" },
|
|
11615
11615
|
{ value: "not_contains", label: "does not contain" },
|
|
@@ -11690,7 +11690,7 @@ const Ls = {
|
|
|
11690
11690
|
const Y = H.flatMap((Je) => Je).filter((Je) => Je != null);
|
|
11691
11691
|
return Y.length === 0 ? null : typeof Y.find((Je) => Je != null) == "object" ? "arraySelect" : "arrayText";
|
|
11692
11692
|
}
|
|
11693
|
-
return H.every((Y) => typeof Y == "boolean") ? "boolean" : H.every((Y) => typeof Y == "number") ? new Set(H).size <=
|
|
11693
|
+
return H.every((Y) => typeof Y == "boolean") ? "boolean" : H.every((Y) => typeof Y == "number") ? new Set(H).size <= We.value.maxUniqueForEnum ? "select" : "range" : H.every((Y) => typeof Y == "string") ? new Set(H).size <= We.value.maxUniqueForSelect ? "select" : "text" : H.some((Y) => typeof Y == "object" && !Array.isArray(Y)) ? null : "text";
|
|
11694
11694
|
}
|
|
11695
11695
|
const bt = y(() => {
|
|
11696
11696
|
if (!O.data?.length) return [];
|
|
@@ -11828,7 +11828,7 @@ const Ls = {
|
|
|
11828
11828
|
}
|
|
11829
11829
|
Lt();
|
|
11830
11830
|
}
|
|
11831
|
-
function
|
|
11831
|
+
function qe($, x) {
|
|
11832
11832
|
const H = x.target.value;
|
|
11833
11833
|
$.value = H === "" ? null : Number(H);
|
|
11834
11834
|
}
|
|
@@ -12026,7 +12026,7 @@ const Ls = {
|
|
|
12026
12026
|
};
|
|
12027
12027
|
}
|
|
12028
12028
|
return Le({ getDebugState: Ce }), ($, x) => (c(), d("div", {
|
|
12029
|
-
class: oe(["dss-filter", { "dss-filter--unstyled":
|
|
12029
|
+
class: oe(["dss-filter", { "dss-filter--unstyled": We.value.unstyled }])
|
|
12030
12030
|
}, [
|
|
12031
12031
|
l("div", {
|
|
12032
12032
|
class: "dss-filter-global",
|
|
@@ -12200,7 +12200,7 @@ const Ls = {
|
|
|
12200
12200
|
class: "dss-filter-value-input",
|
|
12201
12201
|
placeholder: "Enter value...",
|
|
12202
12202
|
value: H.value,
|
|
12203
|
-
onInput: (J) =>
|
|
12203
|
+
onInput: (J) => qe(H, J),
|
|
12204
12204
|
step: tt.value[H.key]?.type === "int" ? 1 : void 0
|
|
12205
12205
|
}, null, 40, b9)) : ht(H) === "between" ? (c(), d("div", w9, [
|
|
12206
12206
|
l("input", {
|