vue-data-ui 3.5.0 → 3.5.2
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 +26 -0
- package/dist/{ColorPicker-J5wOPCeB.js → ColorPicker-ChuwChMo.js} +58 -56
- package/dist/{NonSvgPenAndPaper-C7TRn0_3.js → NonSvgPenAndPaper-DVgKKLIf.js} +1 -1
- package/dist/{PackageVersion-Cyx_s25h.js → PackageVersion-Y7t79Jtq.js} +1 -1
- package/dist/PenAndPaper-SZQIAgkg.js +388 -0
- package/dist/{Title-l36lOBMx.js → Title-BzH_LEA3.js} +1 -1
- package/dist/components/vue-ui-3d-bar.js +1 -1
- package/dist/components/vue-ui-accordion.js +1 -1
- package/dist/components/vue-ui-age-pyramid.js +1 -1
- package/dist/components/vue-ui-annotator.js +1 -1
- package/dist/components/vue-ui-bullet.js +1 -1
- package/dist/components/vue-ui-candlestick.js +1 -1
- package/dist/components/vue-ui-carousel-table.js +1 -1
- package/dist/components/vue-ui-chestnut.js +1 -1
- package/dist/components/vue-ui-chord.js +1 -1
- package/dist/components/vue-ui-circle-pack.js +1 -1
- package/dist/components/vue-ui-cursor.js +1 -1
- package/dist/components/vue-ui-dashboard.js +1 -1
- package/dist/components/vue-ui-digits.js +1 -1
- package/dist/components/vue-ui-donut-evolution.js +1 -1
- package/dist/components/vue-ui-donut.js +1 -1
- package/dist/components/vue-ui-dumbbell.js +1 -1
- package/dist/components/vue-ui-flow.js +1 -1
- package/dist/components/vue-ui-funnel.js +1 -1
- package/dist/components/vue-ui-galaxy.js +1 -1
- package/dist/components/vue-ui-gauge.js +1 -1
- package/dist/components/vue-ui-gizmo.js +1 -1
- package/dist/components/vue-ui-heatmap.js +1 -1
- package/dist/components/vue-ui-history-plot.js +1 -1
- package/dist/components/vue-ui-horizontal-bar.js +1 -1
- package/dist/components/vue-ui-kpi.js +1 -1
- package/dist/components/vue-ui-mini-loader.js +1 -1
- package/dist/components/vue-ui-molecule.js +1 -1
- package/dist/components/vue-ui-mood-radar.js +1 -1
- package/dist/components/vue-ui-nested-donuts.js +1 -1
- package/dist/components/vue-ui-onion.js +1 -1
- package/dist/components/vue-ui-parallel-coordinate-plot.js +1 -1
- package/dist/components/vue-ui-quadrant.js +1 -1
- package/dist/components/vue-ui-quick-chart.js +1 -1
- package/dist/components/vue-ui-radar.js +1 -1
- package/dist/components/vue-ui-rating.js +1 -1
- package/dist/components/vue-ui-relation-circle.js +1 -1
- package/dist/components/vue-ui-ridgeline.js +1 -1
- package/dist/components/vue-ui-rings.js +1 -1
- package/dist/components/vue-ui-scatter.js +1 -1
- package/dist/components/vue-ui-skeleton.js +1 -1
- package/dist/components/vue-ui-smiley.js +1 -1
- package/dist/components/vue-ui-spark-trend.js +1 -1
- package/dist/components/vue-ui-sparkbar.js +1 -1
- package/dist/components/vue-ui-sparkgauge.js +1 -1
- package/dist/components/vue-ui-sparkhistogram.js +1 -1
- package/dist/components/vue-ui-sparkline.js +1 -1
- package/dist/components/vue-ui-sparkstackbar.js +1 -1
- package/dist/components/vue-ui-stackbar.js +1 -1
- package/dist/components/vue-ui-strip-plot.js +1 -1
- package/dist/components/vue-ui-table-heatmap.js +1 -1
- package/dist/components/vue-ui-table-sparkline.js +1 -1
- package/dist/components/vue-ui-table.js +1 -1
- package/dist/components/vue-ui-thermometer.js +1 -1
- package/dist/components/vue-ui-timer.js +1 -1
- package/dist/components/vue-ui-tiremarks.js +1 -1
- package/dist/components/vue-ui-treemap.js +1 -1
- package/dist/components/vue-ui-vertical-bar.js +1 -1
- package/dist/components/vue-ui-waffle.js +1 -1
- package/dist/components/vue-ui-wheel.js +1 -1
- package/dist/components/vue-ui-word-cloud.js +1 -1
- package/dist/components/vue-ui-world.js +1 -1
- package/dist/components/vue-ui-xy-canvas.js +1 -1
- package/dist/components/vue-ui-xy.js +1 -1
- package/dist/style.css +1 -1
- package/dist/types/vue-data-ui.d.ts +17 -8
- package/dist/{useNestedProp-BjZe1Y85.js → useNestedProp-CReNavA0.js} +23 -9
- package/dist/{vue-data-ui-DxgRqCAo.js → vue-data-ui-BRaq4hRp.js} +63 -63
- package/dist/vue-data-ui.js +64 -64
- package/dist/{vue-ui-3d-bar-DmNJp8SY.js → vue-ui-3d-bar-BB4ii8Nt.js} +454 -434
- package/dist/{vue-ui-accordion-CZ0thhxa.js → vue-ui-accordion-BmFTVF1a.js} +1 -1
- package/dist/{vue-ui-age-pyramid-CPAP3sNY.js → vue-ui-age-pyramid-8bUepd28.js} +180 -160
- package/dist/{vue-ui-annotator-BylDgUVb.js → vue-ui-annotator-CcpaXBNK.js} +3 -3
- package/dist/{vue-ui-bullet-Ce6uvCQJ.js → vue-ui-bullet-BvT4scFv.js} +190 -170
- package/dist/{vue-ui-candlestick-DewevWV_.js → vue-ui-candlestick-CMP7UL6z.js} +201 -181
- package/dist/{vue-ui-carousel-table-Dv1CDfE5.js → vue-ui-carousel-table-CzOcKsDj.js} +2 -2
- package/dist/{vue-ui-chestnut-D9sdFZ4E.js → vue-ui-chestnut-S787oASt.js} +375 -355
- package/dist/vue-ui-chord-Dl9Y4mcz.js +1153 -0
- package/dist/{vue-ui-circle-pack-Be74QB_0.js → vue-ui-circle-pack-CU09BzOV.js} +289 -269
- package/dist/{vue-ui-cursor-ik59bfC4.js → vue-ui-cursor-C3yD_TUr.js} +1 -1
- package/dist/vue-ui-dashboard-BfEcVRxQ.js +432 -0
- package/dist/{vue-ui-digits-ByNNcWXi.js → vue-ui-digits-pRh179Gg.js} +1 -1
- package/dist/{vue-ui-donut-BRGFcgxS.js → vue-ui-donut-B_tEm4dT.js} +462 -442
- package/dist/{vue-ui-donut-evolution-DJ0C-7jH.js → vue-ui-donut-evolution-DiGhMwMO.js} +293 -273
- package/dist/{vue-ui-dumbbell-iQJ0BUhm.js → vue-ui-dumbbell-BlF3CLbN.js} +210 -190
- package/dist/{vue-ui-flow-CTYFoib3.js → vue-ui-flow-BQi5L8mJ.js} +339 -319
- package/dist/{vue-ui-funnel-CG55Xcdy.js → vue-ui-funnel-CM_6Sare.js} +218 -198
- package/dist/{vue-ui-galaxy-BQrxjKZJ.js → vue-ui-galaxy-BnZA62Li.js} +201 -181
- package/dist/{vue-ui-gauge-Tc-0NI0Y.js → vue-ui-gauge-DAk72bez.js} +311 -291
- package/dist/{vue-ui-gizmo-P8h-gnLd.js → vue-ui-gizmo-BQzQlUJ8.js} +2 -2
- package/dist/{vue-ui-heatmap-BZimPzsL.js → vue-ui-heatmap-C9MhHWpp.js} +303 -283
- package/dist/{vue-ui-history-plot-BVzbuqYY.js → vue-ui-history-plot-BYQh3E8U.js} +229 -209
- package/dist/{vue-ui-kpi-BGGff8LM.js → vue-ui-kpi-jcrPjW4C.js} +2 -2
- package/dist/{vue-ui-mini-loader-CSF-7TJL.js → vue-ui-mini-loader-DTM98mRN.js} +1 -1
- package/dist/{vue-ui-molecule-BALqwB8c.js → vue-ui-molecule-Bd1OXvl3.js} +156 -136
- package/dist/{vue-ui-mood-radar-QJ5nlZby.js → vue-ui-mood-radar-DuoiTsYn.js} +266 -246
- package/dist/{vue-ui-nested-donuts-CmUabkkQ.js → vue-ui-nested-donuts-BTswQFjz.js} +506 -486
- package/dist/{vue-ui-onion-DAOCf3f8.js → vue-ui-onion-D-1U2Qgl.js} +220 -200
- package/dist/{vue-ui-parallel-coordinate-plot-D8jTuFjq.js → vue-ui-parallel-coordinate-plot-D-7VFHas.js} +235 -215
- package/dist/{vue-ui-quadrant-CO52mSRY.js → vue-ui-quadrant-CeM23s0z.js} +463 -443
- package/dist/{vue-ui-quick-chart-DEaVSldE.js → vue-ui-quick-chart-C0RMQzjC.js} +288 -268
- package/dist/{vue-ui-radar-C5V4hhbW.js → vue-ui-radar-BSfxyur3.js} +331 -311
- package/dist/{vue-ui-rating-CiMoFM_c.js → vue-ui-rating-tj97undO.js} +1 -1
- package/dist/{vue-ui-relation-circle-CbMM0Jka.js → vue-ui-relation-circle-C7uV2mIj.js} +228 -208
- package/dist/{vue-ui-ridgeline-CXCIRDq6.js → vue-ui-ridgeline-CYMfTlwI.js} +242 -222
- package/dist/{vue-ui-rings-BpUcyqo7.js → vue-ui-rings-C96aj57d.js} +189 -169
- package/dist/{vue-ui-scatter--Dxe-hfO.js → vue-ui-scatter-CtvOXUnx.js} +275 -255
- package/dist/{vue-ui-skeleton-BWq-VDzg.js → vue-ui-skeleton-87TORm6s.js} +2 -2
- package/dist/{vue-ui-smiley-sGFRbn31.js → vue-ui-smiley-B74geHT3.js} +1 -1
- package/dist/{vue-ui-spark-trend-T4J_YOa_.js → vue-ui-spark-trend-6_Ibziyv.js} +2 -2
- package/dist/{vue-ui-sparkbar-DnKP55Vu.js → vue-ui-sparkbar-BDCocMLI.js} +2 -2
- package/dist/{vue-ui-sparkgauge-BDQLP-zi.js → vue-ui-sparkgauge-CQ4Zk9-f.js} +2 -2
- package/dist/{vue-ui-sparkhistogram-Dm7QXrA-.js → vue-ui-sparkhistogram-BlTV9wfn.js} +143 -140
- package/dist/{vue-ui-sparkline-tXGDLHRy.js → vue-ui-sparkline-DWESyiqL.js} +2 -2
- package/dist/{vue-ui-sparkstackbar-M53Nt07M.js → vue-ui-sparkstackbar-DK_7X8mL.js} +2 -2
- package/dist/vue-ui-stackbar-BWuw8ff4.js +1827 -0
- package/dist/{vue-ui-strip-plot-BX9i3wMn.js → vue-ui-strip-plot-C1N2n39d.js} +245 -225
- package/dist/{vue-ui-table-7r02N9R9.js → vue-ui-table-CcuoPHgI.js} +3 -3
- package/dist/{vue-ui-table-heatmap-BqCEBoUf.js → vue-ui-table-heatmap-C9EMEM3Z.js} +1 -1
- package/dist/{vue-ui-table-sparkline-DZaAh10E.js → vue-ui-table-sparkline-BAxmZRff.js} +2 -2
- package/dist/vue-ui-thermometer-CDrM-WFq.js +584 -0
- package/dist/{vue-ui-timer-Ds-MJoW2.js → vue-ui-timer-BVsUQJz_.js} +3 -3
- package/dist/vue-ui-tiremarks-BQH2pNkG.js +450 -0
- package/dist/{vue-ui-treemap-BEvl8hiw.js → vue-ui-treemap-6WLoCHsH.js} +453 -433
- package/dist/{vue-ui-vertical-bar-D8dtM8sw.js → vue-ui-vertical-bar-B3gfBqD_.js} +323 -303
- package/dist/{vue-ui-waffle-B3q-2SCR.js → vue-ui-waffle-Bhlqo4xM.js} +219 -199
- package/dist/vue-ui-wheel-CqHw1WuW.js +663 -0
- package/dist/{vue-ui-word-cloud-ChT7uLbN.js → vue-ui-word-cloud-CKuWZGLv.js} +248 -228
- package/dist/{vue-ui-world-CdP4g_3_.js → vue-ui-world-C8KVyDim.js} +287 -267
- package/dist/{vue-ui-xy-B68qQ-gX.js → vue-ui-xy-Cz2qIEfi.js} +389 -369
- package/dist/{vue-ui-xy-canvas-DDngEA1s.js → vue-ui-xy-canvas-y4h7gEFp.js} +4 -4
- package/package.json +4 -4
- package/dist/PenAndPaper-DSvu9dwa.js +0 -373
- package/dist/vue-ui-chord-BG4dxKNA.js +0 -1133
- package/dist/vue-ui-dashboard-C4BLwHey.js +0 -412
- package/dist/vue-ui-stackbar-CkBOjryQ.js +0 -1724
- package/dist/vue-ui-thermometer-CFPt3MOv.js +0 -564
- package/dist/vue-ui-tiremarks-2eIQ6vxu.js +0 -430
- package/dist/vue-ui-wheel-BpirIgAG.js +0 -643
|
@@ -0,0 +1,388 @@
|
|
|
1
|
+
import { ref as c, computed as he, watch as z, nextTick as se, onMounted as Ae, onBeforeUnmount as we, createElementBlock as W, createCommentVNode as O, openBlock as j, normalizeStyle as x, createElementVNode as S, withDirectives as re, renderSlot as B, createVNode as R, withCtx as be, normalizeProps as T, guardReactiveProps as M, normalizeClass as Y, toDisplayString as xe, unref as ye, vModelText as ue } from "vue";
|
|
2
|
+
import F from "./BaseIcon-BmMbm4d0.js";
|
|
3
|
+
import { C as Ce } from "./ColorPicker-ChuwChMo.js";
|
|
4
|
+
import { S as ke, d as Se } from "./lib-C_mNZmhD.js";
|
|
5
|
+
const Ee = {
|
|
6
|
+
class: "vue-ui-pen-and-paper-action",
|
|
7
|
+
style: { padding: "0 !important" }
|
|
8
|
+
}, $e = ["disabled"], De = {
|
|
9
|
+
__name: "PenAndPaper",
|
|
10
|
+
props: {
|
|
11
|
+
svgRef: {
|
|
12
|
+
type: [Object, null, void 0],
|
|
13
|
+
required: !0
|
|
14
|
+
},
|
|
15
|
+
color: {
|
|
16
|
+
type: String,
|
|
17
|
+
default: "#2D353C"
|
|
18
|
+
},
|
|
19
|
+
backgroundColor: {
|
|
20
|
+
type: String,
|
|
21
|
+
default: "#FFFFFF"
|
|
22
|
+
},
|
|
23
|
+
active: {
|
|
24
|
+
type: Boolean,
|
|
25
|
+
default: !1
|
|
26
|
+
},
|
|
27
|
+
scale: {
|
|
28
|
+
type: Number,
|
|
29
|
+
default: 1
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
emits: ["close"],
|
|
33
|
+
setup(d, { emit: ie }) {
|
|
34
|
+
const s = d, ve = ie, b = c([]), y = c([]), E = c(s.color), N = c(2), Q = c(!1), V = c(""), o = c(null), A = c(null), I = c(null), p = c("draw"), K = c(!1), f = c(null), q = c({ x: 0, y: 0 }), D = c([""]), P = c({ row: 0, col: 0 }), $ = c(16), J = c("url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAABg2lDQ1BJQ0MgcHJvZmlsZQAAKJF9kT1Iw0AcxV9TpSIVh2YQcchQnSyIijhKFYtgobQVWnUwufQLmjQkKS6OgmvBwY/FqoOLs64OroIg+AHi6OSk6CIl/i8ptIjx4Lgf7+497t4BQrPKNKtnAtB020wn4lIuvyqFXhGGiAhCiMnMMpKZxSx8x9c9Any9i/Es/3N/jgG1YDEgIBHPMcO0iTeIZzZtg/M+scjKskp8Tjxu0gWJH7muePzGueSywDNFM5ueJxaJpVIXK13MyqZGPE0cVTWd8oWcxyrnLc5atc7a9+QvDBf0lQzXaY4ggSUkkYIEBXVUUIWNGK06KRbStB/38Q+7/hS5FHJVwMixgBo0yK4f/A9+d2sVpya9pHAc6H1xnI9RILQLtBqO833sOK0TIPgMXOkdf60JzH6S3uho0SNgcBu4uO5oyh5wuQMMPRmyKbtSkKZQLALvZ/RNeSByC/Sveb2193H6AGSpq+Ub4OAQGCtR9rrPu/u6e/v3TLu/H5C7crM1WjgWAAAABmJLR0QAqwB5AHWF+8OUAAAACXBIWXMAAC4jAAAuIwF4pT92AAAAB3RJTUUH5gwUExIUagzGcQAAABl0RVh0Q29tbWVudABDcmVhdGVkIHdpdGggR0lNUFeBDhcAAABfSURBVBjTldAxDoNQDIPhL0+q1L33P1AvAhN7xfK6WAgoLfSfrNiykpQtE+7RLzx2vgF9D3o8lWDmn1QVVMP0LZQGmNtqp1/cmou0XHdG/+sYeGZwFBqPCub8rkcvvAGvsi1VYarR8wAAAABJRU5ErkJggg==') 5 5, auto");
|
|
35
|
+
function Z(n) {
|
|
36
|
+
if (!o.value || p.value !== "text" || K.value) return;
|
|
37
|
+
const { x: e, y: l } = U(n);
|
|
38
|
+
q.value = { x: e, y: l }, D.value = [""], P.value = { row: 0, col: 0 };
|
|
39
|
+
const t = document.createElementNS("http://www.w3.org/2000/svg", "text");
|
|
40
|
+
t.setAttribute("x", e), t.setAttribute("y", l), t.setAttribute("fill", E.value), t.setAttribute("font-size", $.value * s.scale), t.setAttribute("font-family", "sans-serif"), t.setAttribute("class", "vue-data-ui-doodle"), t.setAttribute("dominant-baseline", "hanging"), t.setAttribute("pointer-events", "all");
|
|
41
|
+
const a = document.createElementNS("http://www.w3.org/2000/svg", "tspan");
|
|
42
|
+
a.setAttribute("x", e), a.setAttribute("dy", "0"), a.textContent = "", t.appendChild(a), t.style.pointerEvents = "none", t.style.userSelect = "none", o.value.appendChild(t), f.value = t, K.value = !0, window.addEventListener("keydown", _), window.addEventListener("mousedown", ne, !0), ee(), te();
|
|
43
|
+
}
|
|
44
|
+
function _(n) {
|
|
45
|
+
if (!K.value) return;
|
|
46
|
+
let { row: e, col: l } = P.value, t = D.value.slice(), a = !1;
|
|
47
|
+
if (n.key === "Enter") {
|
|
48
|
+
const r = t[e], u = r.slice(0, l), v = r.slice(l);
|
|
49
|
+
t.splice(e, 1, u, v), e += 1, l = 0, a = !0, n.preventDefault();
|
|
50
|
+
} else if (n.key === "Backspace") {
|
|
51
|
+
if (l > 0)
|
|
52
|
+
t[e] = t[e].slice(0, l - 1) + t[e].slice(l), l -= 1, a = !0;
|
|
53
|
+
else if (e > 0) {
|
|
54
|
+
const r = t[e - 1].length;
|
|
55
|
+
t[e - 1] += t[e], t.splice(e, 1), e -= 1, l = r, a = !0;
|
|
56
|
+
}
|
|
57
|
+
n.preventDefault();
|
|
58
|
+
} else if (n.key === "Delete")
|
|
59
|
+
l < t[e].length ? (t[e] = t[e].slice(0, l) + t[e].slice(l + 1), a = !0) : e < t.length - 1 && (t[e] += t[e + 1], t.splice(e + 1, 1), a = !0), n.preventDefault();
|
|
60
|
+
else if (n.key === "ArrowLeft")
|
|
61
|
+
l > 0 ? l -= 1 : e > 0 && (e -= 1, l = t[e].length), a = !0, n.preventDefault();
|
|
62
|
+
else if (n.key === "ArrowRight")
|
|
63
|
+
l < t[e].length ? l += 1 : e < t.length - 1 && (e += 1, l = 0), a = !0, n.preventDefault();
|
|
64
|
+
else if (n.key === "ArrowUp")
|
|
65
|
+
e > 0 && (e -= 1, l = Math.min(l, t[e].length), a = !0), n.preventDefault();
|
|
66
|
+
else if (n.key === "ArrowDown")
|
|
67
|
+
e < t.length - 1 && (e += 1, l = Math.min(l, t[e].length), a = !0), n.preventDefault();
|
|
68
|
+
else if (n.key.length === 1 && !n.ctrlKey && !n.metaKey && !n.altKey)
|
|
69
|
+
t[e] = t[e].slice(0, l) + n.key + t[e].slice(l), l += 1, a = !0, n.preventDefault();
|
|
70
|
+
else if (n.key === "Escape") {
|
|
71
|
+
le(!0);
|
|
72
|
+
return;
|
|
73
|
+
} else n.key === "Tab" && n.preventDefault();
|
|
74
|
+
a && (D.value = t, P.value = { row: e, col: l }, ee(), te());
|
|
75
|
+
}
|
|
76
|
+
function ee() {
|
|
77
|
+
const n = f.value, { x: e } = q.value;
|
|
78
|
+
for (; n.firstChild; ) n.removeChild(n.firstChild);
|
|
79
|
+
D.value.forEach((l, t) => {
|
|
80
|
+
const a = document.createElementNS("http://www.w3.org/2000/svg", "tspan");
|
|
81
|
+
a.setAttribute("x", e), a.setAttribute("dy", t === 0 ? "0" : `${$.value * 1.2 * s.scale}`), a.textContent = l.length ? l : "", n.appendChild(a);
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
function te() {
|
|
85
|
+
const n = o.value.querySelector(".vue-data-ui-svg-caret");
|
|
86
|
+
n && o.value.removeChild(n);
|
|
87
|
+
const e = f.value;
|
|
88
|
+
if (!e) return;
|
|
89
|
+
const { x: l, y: t } = q.value, { row: a, col: r } = P.value, u = $.value * s.scale, v = e.childNodes[a];
|
|
90
|
+
if (!v) return;
|
|
91
|
+
let g = v.textContent.slice(0, r);
|
|
92
|
+
g.endsWith(" ") && (g += " ");
|
|
93
|
+
const i = document.createElementNS("http://www.w3.org/2000/svg", "text");
|
|
94
|
+
i.setAttribute("x", l), i.setAttribute("y", t), i.setAttribute("font-size", u), i.setAttribute("font-family", "sans-serif"), i.textContent = g || "", o.value.appendChild(i);
|
|
95
|
+
const m = i.getBBox();
|
|
96
|
+
o.value.removeChild(i);
|
|
97
|
+
let h = t + a * u * 1.2, k = l + m.width;
|
|
98
|
+
const w = document.createElementNS("http://www.w3.org/2000/svg", "rect");
|
|
99
|
+
w.setAttribute("x", k), w.setAttribute("y", h), w.setAttribute("width", 2), w.setAttribute("height", u), w.setAttribute("fill", E.value), w.setAttribute("class", "vue-data-ui-svg-caret"), o.value.appendChild(w);
|
|
100
|
+
}
|
|
101
|
+
function ne(n) {
|
|
102
|
+
if (f.value && !f.value.contains(n.target)) {
|
|
103
|
+
const e = f.value.children;
|
|
104
|
+
e.length === 1 && (e[0].textContent === "" || e[0].textContent === "") && f.value.remove(), le(!1);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
function le(n = !1) {
|
|
108
|
+
window.removeEventListener("keydown", _), window.removeEventListener("mousedown", ne, !0);
|
|
109
|
+
const e = o.value.querySelector(".vue-data-ui-svg-caret");
|
|
110
|
+
e && o.value.removeChild(e);
|
|
111
|
+
const l = f.value?.children;
|
|
112
|
+
let t = !1;
|
|
113
|
+
if (l && l.length === 1) {
|
|
114
|
+
const a = l[0].textContent;
|
|
115
|
+
t = !a || a === "";
|
|
116
|
+
}
|
|
117
|
+
n || t ? f.value && o.value.contains(f.value) && o.value.removeChild(f.value) : f.value && o.value.contains(f.value) && b.value.push(f.value), K.value = !1, f.value = null, D.value = [""], P.value = { row: 0, col: 0 };
|
|
118
|
+
}
|
|
119
|
+
const C = he(() => ke(s.color, 0.6));
|
|
120
|
+
function ae() {
|
|
121
|
+
if (!o.value) return;
|
|
122
|
+
const n = o.value.querySelector(".vue-data-ui-mask");
|
|
123
|
+
if (n && o.value.removeChild(n), s.active) {
|
|
124
|
+
const e = document.createElementNS("http://www.w3.org/2000/svg", "rect");
|
|
125
|
+
e.setAttribute("class", "vue-data-ui-mask"), e.setAttribute("width", "100%"), e.setAttribute("height", "100%"), e.setAttribute("fill", "transparent"), e.setAttribute("pointer-events", "all"), o.value.insertBefore(e, o.value.firstChild);
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
function U(n) {
|
|
129
|
+
const e = s.svgRef;
|
|
130
|
+
if (!e) return { x: 0, y: 0 };
|
|
131
|
+
const l = e.createSVGPoint();
|
|
132
|
+
l.x = n.clientX, l.y = n.clientY;
|
|
133
|
+
const t = e.getScreenCTM()?.inverse();
|
|
134
|
+
return t ? l.matrixTransform(t) : { x: 0, y: 0 };
|
|
135
|
+
}
|
|
136
|
+
function ce(n) {
|
|
137
|
+
const e = n.trim().split(/\s+/);
|
|
138
|
+
if (e.length < 4)
|
|
139
|
+
return n;
|
|
140
|
+
const l = e.slice(1).map(Number);
|
|
141
|
+
if (l.length % 2 !== 0)
|
|
142
|
+
return n;
|
|
143
|
+
const t = de(l), a = [`M ${t[0]} ${t[1]}`];
|
|
144
|
+
for (let v = 2; v < t.length - 2; v += 2) {
|
|
145
|
+
const g = t[v - 2], i = t[v - 1], m = t[v], h = t[v + 1], k = (g + m) / 2, w = (i + h) / 2;
|
|
146
|
+
a.push(`Q ${g} ${i} ${k} ${w}`);
|
|
147
|
+
}
|
|
148
|
+
const r = t[t.length - 2], u = t[t.length - 1];
|
|
149
|
+
return a.push(`L ${r} ${u}`), a.join(" ");
|
|
150
|
+
}
|
|
151
|
+
function de(n, e = 1) {
|
|
152
|
+
const l = [...n];
|
|
153
|
+
for (let t = 2; t < n.length - 2; t += 2) {
|
|
154
|
+
const a = n[t], r = n[t + 1], u = n[t - 2], v = n[t - 1], g = n[t + 2], i = n[t + 3];
|
|
155
|
+
l[t] = a + e * ((u + g) / 2 - a), l[t + 1] = r + e * ((v + i) / 2 - r);
|
|
156
|
+
}
|
|
157
|
+
return l;
|
|
158
|
+
}
|
|
159
|
+
function fe(n) {
|
|
160
|
+
const e = n.trim().split(/\s+/);
|
|
161
|
+
let l = "", t = "", a = null, r = null;
|
|
162
|
+
for (let u = 0; u < e.length; u += 1) {
|
|
163
|
+
const v = e[u];
|
|
164
|
+
if (isNaN(v)) {
|
|
165
|
+
if (t = v, t === "M" || t === "L")
|
|
166
|
+
a = parseFloat(e[++u]), r = parseFloat(e[++u]), l += `${t}${a} ${r}`;
|
|
167
|
+
else if (t === "Q") {
|
|
168
|
+
const g = parseFloat(e[++u]), i = parseFloat(e[++u]), m = parseFloat(e[++u]), h = parseFloat(e[++u]);
|
|
169
|
+
g === a && i === r ? l += `t${m - a} ${h - r}` : l += `q${g - a} ${i - r} ${m - a} ${h - r}`, a = m, r = h;
|
|
170
|
+
}
|
|
171
|
+
} else {
|
|
172
|
+
const g = parseFloat(v), i = parseFloat(e[++u]);
|
|
173
|
+
if (t === "L") {
|
|
174
|
+
const m = g - a, h = i - r;
|
|
175
|
+
m === 0 ? l += `v${h}` : h === 0 ? l += `h${m}` : l += `l${m} ${h}`, a = g, r = i;
|
|
176
|
+
} else if (t === "Q") {
|
|
177
|
+
const m = g, h = i, k = parseFloat(e[++u]), w = parseFloat(e[++u]);
|
|
178
|
+
m === a && h === r ? l += `t${k - a} ${w - r}` : l += `q${m - a} ${h - r} ${k - a} ${w - r}`, a = k, r = w;
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
return l;
|
|
183
|
+
}
|
|
184
|
+
function G(n) {
|
|
185
|
+
if (p.value !== "draw" || !s.active || !o.value) return;
|
|
186
|
+
Q.value = !0;
|
|
187
|
+
const { x: e, y: l } = U(n);
|
|
188
|
+
I.value = { x: e, y: l }, V.value = `M ${e} ${l}`, A.value = document.createElementNS("http://www.w3.org/2000/svg", "path"), A.value.setAttribute("stroke", E.value), A.value.setAttribute("stroke-width", N.value * s.scale), A.value.setAttribute("fill", "none"), A.value.setAttribute("stroke-linecap", "round"), A.value.setAttribute("stroke-linejoin", "round"), A.value.setAttribute("class", "vue-data-ui-doodle"), o.value.appendChild(A.value);
|
|
189
|
+
}
|
|
190
|
+
function H(n) {
|
|
191
|
+
if (!Q.value || !o.value || !A.value) return;
|
|
192
|
+
const { x: e, y: l } = U(n);
|
|
193
|
+
V.value += ` ${e} ${l}`, A.value.setAttribute("d", V.value);
|
|
194
|
+
}
|
|
195
|
+
function L(n) {
|
|
196
|
+
if (Q.value && o.value && A.value) {
|
|
197
|
+
const { x: e, y: l } = U(n);
|
|
198
|
+
if (I.value && I.value.x === e && I.value.y === l) {
|
|
199
|
+
const t = document.createElementNS("http://www.w3.org/2000/svg", "circle");
|
|
200
|
+
t.setAttribute("cx", e), t.setAttribute("cy", l), t.setAttribute("r", N.value * s.scale / 2), t.setAttribute("fill", E.value), t.setAttribute("class", "vue-data-ui-doodle"), o.value.appendChild(t), b.value.push(t);
|
|
201
|
+
} else {
|
|
202
|
+
const t = A.value;
|
|
203
|
+
t.setAttribute("d", fe(ce(V.value))), b.value.push(t);
|
|
204
|
+
}
|
|
205
|
+
y.value = [], A.value = "";
|
|
206
|
+
}
|
|
207
|
+
Q.value = !1;
|
|
208
|
+
}
|
|
209
|
+
function ge() {
|
|
210
|
+
if (b.value.length > 0) {
|
|
211
|
+
const n = b.value.pop();
|
|
212
|
+
y.value.push(n), o.value && o.value.removeChild(n);
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
function pe() {
|
|
216
|
+
if (y.value.length > 0) {
|
|
217
|
+
const n = y.value.pop();
|
|
218
|
+
b.value.push(n), o.value && o.value.appendChild(n);
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
function me() {
|
|
222
|
+
o.value && (o.value.innerHTML = ""), b.value = [], y.value = [], ae();
|
|
223
|
+
}
|
|
224
|
+
z(p, () => {
|
|
225
|
+
s.active && (X(), oe(), p.value === "text" ? o.value.style.cursor = "text" : o.value.style.cursor = J.value);
|
|
226
|
+
});
|
|
227
|
+
function oe() {
|
|
228
|
+
!s.svgRef || !s.active || (p.value === "draw" ? (s.svgRef.addEventListener("mousedown", G), s.svgRef.addEventListener("mousemove", H), s.svgRef.addEventListener("mouseup", L), s.svgRef.addEventListener("mouseleave", L), s.svgRef.addEventListener("touchstart", G, { passive: !1 }), s.svgRef.addEventListener("touchmove", H, { passive: !1 }), s.svgRef.addEventListener("touchend", L)) : p.value === "text" && s.svgRef.addEventListener("mousedown", Z), o.value && (o.value.style.pointerEvents = "auto"));
|
|
229
|
+
}
|
|
230
|
+
function X() {
|
|
231
|
+
s.svgRef && (s.svgRef.removeEventListener("mousedown", G), s.svgRef.removeEventListener("mousemove", H), s.svgRef.removeEventListener("mouseup", L), s.svgRef.removeEventListener("mouseleave", L), s.svgRef.removeEventListener("touchstart", G), s.svgRef.removeEventListener("touchmove", H), s.svgRef.removeEventListener("touchend", L), s.svgRef.removeEventListener("mousedown", Z), o.value && (o.value.style.pointerEvents = "none"));
|
|
232
|
+
}
|
|
233
|
+
return z(() => s.active, (n) => {
|
|
234
|
+
n ? oe() : X();
|
|
235
|
+
}), z(() => s.active, () => {
|
|
236
|
+
se(() => {
|
|
237
|
+
ae();
|
|
238
|
+
});
|
|
239
|
+
}), Ae(() => {
|
|
240
|
+
se(() => {
|
|
241
|
+
s.svgRef && (o.value = document.createElementNS("http://www.w3.org/2000/svg", "g"), o.value.setAttribute("class", "vue-data-ui-doodles"), o.value.style.cursor = J.value, s.svgRef.appendChild(o.value), X());
|
|
242
|
+
});
|
|
243
|
+
}), we(() => {
|
|
244
|
+
o.value && s.svgRef && (o.value.remove(), X());
|
|
245
|
+
}), (n, e) => d.active ? (j(), W("div", {
|
|
246
|
+
key: 0,
|
|
247
|
+
"data-dom-to-png-ignore": "",
|
|
248
|
+
class: "vue-ui-pen-and-paper-actions",
|
|
249
|
+
style: x({ backgroundColor: d.backgroundColor })
|
|
250
|
+
}, [
|
|
251
|
+
S("button", {
|
|
252
|
+
class: "vue-ui-pen-and-paper-action",
|
|
253
|
+
onClick: e[0] || (e[0] = (l) => ve("close")),
|
|
254
|
+
style: x({
|
|
255
|
+
backgroundColor: d.backgroundColor,
|
|
256
|
+
border: `1px solid ${C.value}`
|
|
257
|
+
})
|
|
258
|
+
}, [
|
|
259
|
+
B(n.$slots, "annotator-action-close", {}, () => [
|
|
260
|
+
R(F, {
|
|
261
|
+
name: "close",
|
|
262
|
+
stroke: d.color
|
|
263
|
+
}, null, 8, ["stroke"])
|
|
264
|
+
])
|
|
265
|
+
], 4),
|
|
266
|
+
S("button", Ee, [
|
|
267
|
+
R(Ce, {
|
|
268
|
+
value: E.value,
|
|
269
|
+
"onUpdate:value": e[1] || (e[1] = (l) => E.value = l),
|
|
270
|
+
backgroundColor: d.backgroundColor,
|
|
271
|
+
buttonBorderColor: C.value
|
|
272
|
+
}, {
|
|
273
|
+
"annotator-action-color": be(({ color: l }) => [
|
|
274
|
+
B(n.$slots, "annotator-action-color", T(M({ color: l })))
|
|
275
|
+
]),
|
|
276
|
+
_: 3
|
|
277
|
+
}, 8, ["value", "backgroundColor", "buttonBorderColor"])
|
|
278
|
+
]),
|
|
279
|
+
S("button", {
|
|
280
|
+
class: Y(["vue-ui-pen-and-paper-action", { "vue-ui-pen-and-paper-action-active": p.value === "text" }]),
|
|
281
|
+
onClick: e[2] || (e[2] = (l) => p.value = p.value === "text" ? "draw" : "text"),
|
|
282
|
+
style: x({
|
|
283
|
+
backgroundColor: d.backgroundColor,
|
|
284
|
+
border: `1px solid ${C.value}`
|
|
285
|
+
})
|
|
286
|
+
}, [
|
|
287
|
+
B(n.$slots, "annotator-action-draw", T(M({ mode: p.value })), () => [
|
|
288
|
+
R(F, {
|
|
289
|
+
name: p.value === "draw" ? "annotator" : "text",
|
|
290
|
+
stroke: d.color
|
|
291
|
+
}, null, 8, ["name", "stroke"])
|
|
292
|
+
]),
|
|
293
|
+
S("div", {
|
|
294
|
+
style: x({
|
|
295
|
+
position: "absolute",
|
|
296
|
+
bottom: "-20px",
|
|
297
|
+
color: C.value,
|
|
298
|
+
width: "100%",
|
|
299
|
+
textAlign: "center",
|
|
300
|
+
fontSize: "12px",
|
|
301
|
+
fontVariantNumeric: "tabular-nums"
|
|
302
|
+
})
|
|
303
|
+
}, xe(ye(Se)({
|
|
304
|
+
v: p.value === "draw" ? N.value : $.value,
|
|
305
|
+
s: "px",
|
|
306
|
+
r: 1
|
|
307
|
+
})), 5)
|
|
308
|
+
], 6),
|
|
309
|
+
S("button", {
|
|
310
|
+
class: Y(["vue-ui-pen-and-paper-action", { "vue-ui-pen-and-paper-action-disabled": !b.value.length }]),
|
|
311
|
+
disabled: !b.value.length,
|
|
312
|
+
onClick: ge,
|
|
313
|
+
style: x({
|
|
314
|
+
backgroundColor: d.backgroundColor,
|
|
315
|
+
border: `1px solid ${C.value}`,
|
|
316
|
+
marginTop: "20px"
|
|
317
|
+
})
|
|
318
|
+
}, [
|
|
319
|
+
B(n.$slots, "annotator-action-undo", T(M({ disabled: !b.value.length })), () => [
|
|
320
|
+
R(F, {
|
|
321
|
+
name: "restart",
|
|
322
|
+
stroke: d.color
|
|
323
|
+
}, null, 8, ["stroke"])
|
|
324
|
+
])
|
|
325
|
+
], 14, $e),
|
|
326
|
+
S("button", {
|
|
327
|
+
class: Y(["vue-ui-pen-and-paper-action", { "vue-ui-pen-and-paper-action-disabled": !y.value.length }]),
|
|
328
|
+
onClick: pe,
|
|
329
|
+
style: x({
|
|
330
|
+
backgroundColor: d.backgroundColor,
|
|
331
|
+
border: `1px solid ${C.value}`
|
|
332
|
+
})
|
|
333
|
+
}, [
|
|
334
|
+
B(n.$slots, "annotator-action-redo", T(M({ disabled: !y.value.length })), () => [
|
|
335
|
+
R(F, {
|
|
336
|
+
name: "restart",
|
|
337
|
+
stroke: d.color,
|
|
338
|
+
style: { transform: "scaleX(-1)" }
|
|
339
|
+
}, null, 8, ["stroke"])
|
|
340
|
+
])
|
|
341
|
+
], 6),
|
|
342
|
+
S("button", {
|
|
343
|
+
class: Y(["vue-ui-pen-and-paper-action", { "vue-ui-pen-and-paper-action-disabled": !b.value.length }]),
|
|
344
|
+
onClick: me,
|
|
345
|
+
style: x({
|
|
346
|
+
backgroundColor: d.backgroundColor,
|
|
347
|
+
border: `1px solid ${C.value}`
|
|
348
|
+
})
|
|
349
|
+
}, [
|
|
350
|
+
B(n.$slots, "annotator-action-delete", T(M({ disabled: !b.value.length })), () => [
|
|
351
|
+
R(F, {
|
|
352
|
+
name: "trash",
|
|
353
|
+
stroke: d.color
|
|
354
|
+
}, null, 8, ["stroke"])
|
|
355
|
+
])
|
|
356
|
+
], 6),
|
|
357
|
+
p.value === "draw" ? re((j(), W("input", {
|
|
358
|
+
key: 0,
|
|
359
|
+
ref: "range",
|
|
360
|
+
type: "range",
|
|
361
|
+
class: "vertical-range",
|
|
362
|
+
min: 0.5,
|
|
363
|
+
max: 12,
|
|
364
|
+
step: 0.1,
|
|
365
|
+
"onUpdate:modelValue": e[3] || (e[3] = (l) => N.value = l),
|
|
366
|
+
style: x({ accentColor: d.color })
|
|
367
|
+
}, null, 4)), [
|
|
368
|
+
[ue, N.value]
|
|
369
|
+
]) : O("", !0),
|
|
370
|
+
p.value === "text" ? re((j(), W("input", {
|
|
371
|
+
key: 1,
|
|
372
|
+
ref: "range",
|
|
373
|
+
type: "range",
|
|
374
|
+
class: "vertical-range",
|
|
375
|
+
min: 3,
|
|
376
|
+
max: 48,
|
|
377
|
+
step: 0.1,
|
|
378
|
+
"onUpdate:modelValue": e[4] || (e[4] = (l) => $.value = l),
|
|
379
|
+
style: x({ accentColor: d.color })
|
|
380
|
+
}, null, 4)), [
|
|
381
|
+
[ue, $.value]
|
|
382
|
+
]) : O("", !0)
|
|
383
|
+
], 4)) : O("", !0);
|
|
384
|
+
}
|
|
385
|
+
};
|
|
386
|
+
export {
|
|
387
|
+
De as default
|
|
388
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createElementBlock as l, openBlock as n, Fragment as f, createElementVNode as p, createCommentVNode as o, normalizeStyle as d, unref as e, toDisplayString as g, renderSlot as r } from "vue";
|
|
2
|
-
import { a as s } from "./useNestedProp-
|
|
2
|
+
import { a as s } from "./useNestedProp-CReNavA0.js";
|
|
3
3
|
const b = {
|
|
4
4
|
__name: "Title",
|
|
5
5
|
props: {
|