vue-data-ui 2.12.6 → 2.12.7-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (109) hide show
  1. package/dist/{Arrow-Bd9ZVBnX.js → Arrow-C5-RFd0F.js} +1 -1
  2. package/dist/BaseDraggableDialog-CKbomZCX.js +180 -0
  3. package/dist/{BaseIcon-CNbwMh_-.js → BaseIcon-DhWmrDAn.js} +1 -1
  4. package/dist/{ColorPicker-B_FoQwtO.js → ColorPicker-F4TctKaQ.js} +23 -24
  5. package/dist/{DataTable-Rajdtaf6.js → DataTable-Y5HbiUZU.js} +11 -11
  6. package/dist/{Legend-BxtDQCIv.js → Legend-DtTYopxf.js} +8 -8
  7. package/dist/NonSvgPenAndPaper-PC9Yu1K_.js +467 -0
  8. package/dist/PackageVersion-DaWGaZxE.js +10 -0
  9. package/dist/{PenAndPaper-BkP3J-Ft.js → PenAndPaper-C-CpE0NC.js} +8 -10
  10. package/dist/RecursiveCircles-Dn3TGoL6.js +96 -0
  11. package/dist/RecursiveLabels-NTMB9w5C.js +49 -0
  12. package/dist/RecursiveLinks-ld_gDZH4.js +64 -0
  13. package/dist/{Shape-C69a0f29.js → Shape-B6kIkp2s.js} +2 -2
  14. package/dist/{Slicer-7qFdY-bT.js → Slicer-DXpA-pZk.js} +2 -2
  15. package/dist/SparkTooltip-DcdMxgqn.js +68 -0
  16. package/dist/{Title-CzaCeCOm.js → Title-Bc66VstS.js} +2 -2
  17. package/dist/Tooltip-B07vY6jm.js +149 -0
  18. package/dist/{usePrinter-C5bLp34h.js → UserOptions-C8X2STEg.js} +172 -231
  19. package/dist/{dom-to-png-Bm0D0yPL.js → dom-to-png-DH-7H-9g.js} +1 -1
  20. package/dist/{img-BN9AzqUr.js → img-CEn9LJxg.js} +1 -1
  21. package/dist/{index-BFzQMJda.js → index-BHEd2dgu.js} +21 -21
  22. package/dist/{pdf-uTbs813M.js → pdf-BfkyEFza.js} +1 -1
  23. package/dist/style.css +1 -1
  24. package/dist/useChartAccessibility-9icAAmYg.js +12 -0
  25. package/dist/useMouse-AicQS8Vf.js +13 -0
  26. package/dist/{useNestedProp-v7KPpwuP.js → useNestedProp-CZztHZIm.js} +1 -1
  27. package/dist/{usePanZoom-CUkkqW81.js → usePanZoom-BQMvRXEQ.js} +16 -17
  28. package/dist/usePrinter-C8URL2IU.js +53 -0
  29. package/dist/vClickOutside-C6WiFswA.js +13 -0
  30. package/dist/{vue-data-ui-D1k8FeRp.js → vue-data-ui-C0tGhjs9.js} +63 -63
  31. package/dist/vue-data-ui.js +19 -19
  32. package/dist/{vue-ui-3d-bar-DoklA4DT.js → vue-ui-3d-bar-CriyJ0Da.js} +397 -402
  33. package/dist/{vue-ui-accordion-BUz4JIIX.js → vue-ui-accordion-DntThSTF.js} +3 -3
  34. package/dist/{vue-ui-age-pyramid-4kyBq-Dy.js → vue-ui-age-pyramid-BwgozppD.js} +215 -218
  35. package/dist/{vue-ui-annotator-Bq1ZeFfb.js → vue-ui-annotator-B7jNrpQ0.js} +2 -2
  36. package/dist/{vue-ui-bullet-DU10avvA.js → vue-ui-bullet-C20X1YRt.js} +137 -140
  37. package/dist/{vue-ui-candlestick-BI1t3flz.js → vue-ui-candlestick-B264jwvu.js} +265 -271
  38. package/dist/{vue-ui-carousel-table-VowLf_oc.js → vue-ui-carousel-table-ECSEPy9m.js} +137 -137
  39. package/dist/{vue-ui-chestnut-BHjV3d94.js → vue-ui-chestnut-BxjeL4B6.js} +397 -400
  40. package/dist/{vue-ui-chord-CPr7r-2_.js → vue-ui-chord-CJNnQbPC.js} +356 -364
  41. package/dist/vue-ui-circle-pack-0RLVrL7y.js +656 -0
  42. package/dist/{vue-ui-cursor-C9teAbVI.js → vue-ui-cursor-c9pZbUX7.js} +2 -2
  43. package/dist/{vue-ui-dashboard-CwDYB8tP.js → vue-ui-dashboard-DJTFcJry.js} +62 -62
  44. package/dist/{vue-ui-digits-CHmkL0hn.js → vue-ui-digits-Cwy7WTqM.js} +2 -2
  45. package/dist/vue-ui-donut-BIFf4SLq.js +1292 -0
  46. package/dist/vue-ui-donut-evolution-mc_-1JSs.js +864 -0
  47. package/dist/{vue-ui-dumbbell-DTKLLd1N.js → vue-ui-dumbbell-D50S44wU.js} +265 -270
  48. package/dist/{vue-ui-flow-BLBhsU2n.js → vue-ui-flow-CxDTjjYn.js} +291 -300
  49. package/dist/{vue-ui-funnel-CIrWdeBk.js → vue-ui-funnel-DeC0U017.js} +216 -219
  50. package/dist/{vue-ui-galaxy-ByhKyIV4.js → vue-ui-galaxy-n0MW2u-q.js} +227 -235
  51. package/dist/{vue-ui-gauge-BbfBMpng.js → vue-ui-gauge-AYMCSEtU.js} +240 -243
  52. package/dist/{vue-ui-gizmo-BM-_QfHM.js → vue-ui-gizmo-Ckz1h7XW.js} +57 -58
  53. package/dist/{vue-ui-heatmap-BA4z4hsw.js → vue-ui-heatmap-m0SgFsTu.js} +239 -242
  54. package/dist/{vue-ui-history-plot-8vM_IUy8.js → vue-ui-history-plot-BrcF_YLL.js} +257 -262
  55. package/dist/{vue-ui-kpi-D57QLK6A.js → vue-ui-kpi-DiVxDYiV.js} +29 -30
  56. package/dist/{vue-ui-mini-loader-CR4c-xJQ.js → vue-ui-mini-loader-CqbUMft8.js} +2 -2
  57. package/dist/vue-ui-molecule-BCUC8QED.js +580 -0
  58. package/dist/{vue-ui-mood-radar-Brc9cxoD.js → vue-ui-mood-radar-DrrjD9S1.js} +180 -186
  59. package/dist/{vue-ui-nested-donuts-W3Z5F--L.js → vue-ui-nested-donuts-8RTss1yH.js} +366 -374
  60. package/dist/{vue-ui-onion-BNBlGNlF.js → vue-ui-onion-CmPLnisN.js} +252 -258
  61. package/dist/{vue-ui-parallel-coordinate-plot-B5G3jyvg.js → vue-ui-parallel-coordinate-plot-BsbEUu_g.js} +292 -298
  62. package/dist/{vue-ui-quadrant-CUy9mVIA.js → vue-ui-quadrant-CdM3bVZs.js} +403 -409
  63. package/dist/{vue-ui-quick-chart-D4_8mRXU.js → vue-ui-quick-chart-C-lgCI6O.js} +611 -616
  64. package/dist/{vue-ui-radar-BUk56jGL.js → vue-ui-radar-Dq94lb99.js} +270 -277
  65. package/dist/{vue-ui-rating-B9TQl5KP.js → vue-ui-rating-DceDRLFc.js} +2 -2
  66. package/dist/vue-ui-relation-circle-DsKddA_I.js +525 -0
  67. package/dist/{vue-ui-ridgeline-Cl06bGom.js → vue-ui-ridgeline-CVR7NvJ_.js} +313 -317
  68. package/dist/{vue-ui-rings-B6bpFlFp.js → vue-ui-rings-B0soMLZ5.js} +260 -266
  69. package/dist/{vue-ui-scatter--WUuVw5G.js → vue-ui-scatter-Bq4_NUfW.js} +368 -374
  70. package/dist/{vue-ui-skeleton-B_YI7Yuc.js → vue-ui-skeleton-CG3Pn3Zg.js} +19 -19
  71. package/dist/{vue-ui-smiley-Bbam2fDz.js → vue-ui-smiley-aGKTgh42.js} +2 -2
  72. package/dist/{vue-ui-spark-trend-DavXuwGt.js → vue-ui-spark-trend--6lA4742.js} +114 -117
  73. package/dist/{vue-ui-sparkbar-9N1FU9-J.js → vue-ui-sparkbar-BXx7Vglf.js} +104 -106
  74. package/dist/{vue-ui-sparkgauge-_9ntq4EK.js → vue-ui-sparkgauge-zM4_Tgqb.js} +72 -74
  75. package/dist/{vue-ui-sparkhistogram-BEzOV4HV.js → vue-ui-sparkhistogram-BDNrZbWN.js} +93 -95
  76. package/dist/vue-ui-sparkline-CzzyDmYJ.js +459 -0
  77. package/dist/{vue-ui-sparkstackbar-BSWcs3v0.js → vue-ui-sparkstackbar-tBSUQ_09.js} +102 -105
  78. package/dist/{vue-ui-stackbar-gG5BLlAr.js → vue-ui-stackbar-BriZOfj6.js} +409 -412
  79. package/dist/{vue-ui-strip-plot-BJouRmxh.js → vue-ui-strip-plot-DzYyFp3o.js} +240 -246
  80. package/dist/{vue-ui-table-D9Ry8s4N.js → vue-ui-table-C2qosrZR.js} +3 -3
  81. package/dist/{vue-ui-table-heatmap-Bizzpi31.js → vue-ui-table-heatmap-COKfg2KT.js} +90 -90
  82. package/dist/{vue-ui-table-sparkline-Dg54Ovs2.js → vue-ui-table-sparkline-D7C5AiCp.js} +212 -212
  83. package/dist/{vue-ui-thermometer-6MSdF_Gm.js → vue-ui-thermometer-CDG6vSMm.js} +154 -157
  84. package/dist/{vue-ui-timer-ByaKokk8.js → vue-ui-timer-DOoO0CVB.js} +180 -181
  85. package/dist/vue-ui-tiremarks-BSPIy1A3.js +341 -0
  86. package/dist/vue-ui-treemap-DsMmxgin.js +947 -0
  87. package/dist/{vue-ui-vertical-bar-CE4oBwBv.js → vue-ui-vertical-bar-B2_ZHuyv.js} +381 -386
  88. package/dist/{vue-ui-waffle-DNEEnY_G.js → vue-ui-waffle-YhkwHcUX.js} +312 -318
  89. package/dist/vue-ui-wheel-CWHJwyyL.js +335 -0
  90. package/dist/vue-ui-word-cloud-BLgEqHRF.js +642 -0
  91. package/dist/{vue-ui-world-Brhq17TE.js → vue-ui-world-BQelvSLD.js} +389 -400
  92. package/dist/{vue-ui-xy-K2G7QQxG.js → vue-ui-xy-D1luVUXJ.js} +845 -846
  93. package/dist/vue-ui-xy-canvas-C7Pu9RFN.js +1206 -0
  94. package/package.json +6 -6
  95. package/dist/BaseDraggableDialog-Bzwlfmy1.js +0 -186
  96. package/dist/PackageVersion-BjrblLPQ.js +0 -10
  97. package/dist/Tooltip-CWmRmhJr.js +0 -158
  98. package/dist/useChartAccessibility-BWojgys7.js +0 -13
  99. package/dist/vue-ui-circle-pack-D_jYpsuD.js +0 -659
  100. package/dist/vue-ui-donut-WRUDvvZa.js +0 -1292
  101. package/dist/vue-ui-donut-evolution-BQxV5D_L.js +0 -871
  102. package/dist/vue-ui-molecule-Bq69N7rC.js +0 -782
  103. package/dist/vue-ui-relation-circle-T6aTibIU.js +0 -528
  104. package/dist/vue-ui-sparkline-D__GCUAz.js +0 -519
  105. package/dist/vue-ui-tiremarks-Z8pjUT1g.js +0 -344
  106. package/dist/vue-ui-treemap-pRJ3be5l.js +0 -956
  107. package/dist/vue-ui-wheel-DWPYZxdT.js +0 -338
  108. package/dist/vue-ui-word-cloud-DAR7R8F8.js +0 -648
  109. package/dist/vue-ui-xy-canvas-ml44sPHS.js +0 -1673
@@ -0,0 +1,467 @@
1
+ import { ref as i, computed as we, onMounted as ke, nextTick as be, onBeforeUnmount as Ce, watch as oe, createElementBlock as x, openBlock as y, Fragment as q, createCommentVNode as Y, normalizeStyle as b, normalizeClass as D, createElementVNode as C, withDirectives as ae, createVNode as M, toDisplayString as re, unref as se, vModelText as ue, withModifiers as ie, renderList as ce } from "vue";
2
+ import { l as $e, f as Se, X as Ae } from "./index-BHEd2dgu.js";
3
+ import R from "./BaseIcon-DhWmrDAn.js";
4
+ import { C as Ee } from "./ColorPicker-F4TctKaQ.js";
5
+ import { _ as Be } from "./_plugin-vue_export-helper-CHgC5LLL.js";
6
+ const Te = {
7
+ class: /* @__PURE__ */ D({
8
+ "vue-ui-pen-and-paper-action": !0
9
+ }),
10
+ style: { padding: "0 !important" }
11
+ }, De = ["disabled"], Ne = ["data-mode", "xmlns", "viewBox"], Me = ["cx", "cy", "r", "fill"], Le = ["d", "stroke", "stroke-width"], Fe = ["x", "y", "fill", "font-size"], Pe = ["x", "dy"], ze = ["d", "stroke", "stroke-width"], Xe = {
12
+ __name: "NonSvgPenAndPaper",
13
+ props: {
14
+ parent: {
15
+ type: HTMLElement
16
+ },
17
+ backgroundColor: {
18
+ type: String,
19
+ default: "#FFFFFF"
20
+ },
21
+ color: {
22
+ type: String,
23
+ default: "#2D353C"
24
+ },
25
+ active: {
26
+ type: Boolean,
27
+ default: !1
28
+ }
29
+ },
30
+ emits: ["close"],
31
+ setup(u, { emit: ve }) {
32
+ const $ = u, de = ve, w = i([]), N = i([]), G = i("0 0 0 0"), S = i($.color), L = i(1), m = i("draw"), c = i(null), V = i(!1), p = i(null), F = i({ x: 0, y: 0 }), A = i([""]), P = i({ row: 0, col: 0 }), E = i(16);
33
+ let pe = 1;
34
+ function I() {
35
+ return pe++;
36
+ }
37
+ function fe(l) {
38
+ const e = k.value;
39
+ if (!e) return { x: 0, y: 0 };
40
+ const t = e.createSVGPoint();
41
+ let n = l.clientX, o = l.clientY;
42
+ l.touches && l.touches.length && (n = l.touches[0].clientX, o = l.touches[0].clientY), t.x = n, t.y = o;
43
+ const a = e.getScreenCTM()?.inverse();
44
+ return a ? t.matrixTransform(a) : { x: 0, y: 0 };
45
+ }
46
+ function Q(l) {
47
+ if (!c.value || m.value !== "text" || V.value) return;
48
+ const { x: e, y: t } = fe(l);
49
+ F.value = { x: e, y: t }, A.value = [""], P.value = { row: 0, col: 0 };
50
+ const n = document.createElementNS("http://www.w3.org/2000/svg", "text");
51
+ n.setAttribute("x", e), n.setAttribute("y", t), n.setAttribute("fill", S.value), n.setAttribute("font-size", E.value), n.setAttribute("font-family", "sans-serif"), n.setAttribute("class", "vue-data-ui-doodle"), n.setAttribute("dominant-baseline", "hanging"), n.setAttribute("pointer-events", "all");
52
+ const o = document.createElementNS("http://www.w3.org/2000/svg", "tspan");
53
+ o.setAttribute("x", e), o.setAttribute("dy", "0"), o.textContent = "", n.appendChild(o), n.style.pointerEvents = "none", n.style.userSelect = "none", c.value.appendChild(n), p.value = n, V.value = !0, window.addEventListener("keydown", H), window.addEventListener("mousedown", J, !0), O(), j();
54
+ }
55
+ function H(l) {
56
+ if (!V.value) return;
57
+ let { row: e, col: t } = P.value, n = A.value.slice(), o = !1;
58
+ if (l.key === "Enter") {
59
+ const a = n[e], r = a.slice(0, t), v = a.slice(t);
60
+ n.splice(e, 1, r, v), e += 1, t = 0, o = !0, l.preventDefault();
61
+ } else if (l.key === "Backspace") {
62
+ if (t > 0)
63
+ n[e] = n[e].slice(0, t - 1) + n[e].slice(t), t -= 1, o = !0;
64
+ else if (e > 0) {
65
+ const a = n[e - 1].length;
66
+ n[e - 1] += n[e], n.splice(e, 1), e -= 1, t = a, o = !0;
67
+ }
68
+ l.preventDefault();
69
+ } else if (l.key === "Delete")
70
+ t < n[e].length ? (n[e] = n[e].slice(0, t) + n[e].slice(t + 1), o = !0) : e < n.length - 1 && (n[e] += n[e + 1], n.splice(e + 1, 1), o = !0), l.preventDefault();
71
+ else if (l.key === "ArrowLeft")
72
+ t > 0 ? t -= 1 : e > 0 && (e -= 1, t = n[e].length), o = !0, l.preventDefault();
73
+ else if (l.key === "ArrowRight")
74
+ t < n[e].length ? t += 1 : e < n.length - 1 && (e += 1, t = 0), o = !0, l.preventDefault();
75
+ else if (l.key === "ArrowUp")
76
+ e > 0 && (e -= 1, t = Math.min(t, n[e].length), o = !0), l.preventDefault();
77
+ else if (l.key === "ArrowDown")
78
+ e < n.length - 1 && (e += 1, t = Math.min(t, n[e].length), o = !0), l.preventDefault();
79
+ else if (l.key.length === 1 && !l.ctrlKey && !l.metaKey && !l.altKey)
80
+ n[e] = n[e].slice(0, t) + l.key + n[e].slice(t), t += 1, o = !0, l.preventDefault();
81
+ else if (l.key === "Escape") {
82
+ Z(!0);
83
+ return;
84
+ } else l.key === "Tab" && l.preventDefault();
85
+ o && (A.value = n, P.value = { row: e, col: t }, O(), j());
86
+ }
87
+ function O() {
88
+ const l = p.value, { x: e, y: t } = F.value;
89
+ for (; l.firstChild; ) l.removeChild(l.firstChild);
90
+ A.value.forEach((n, o) => {
91
+ const a = document.createElementNS("http://www.w3.org/2000/svg", "tspan");
92
+ a.setAttribute("x", e), a.setAttribute("dy", o === 0 ? "0" : `${E.value * 1.2}`), a.textContent = n.length ? n : "​", l.appendChild(a);
93
+ });
94
+ }
95
+ function j() {
96
+ const l = c.value.querySelector(".vue-data-ui-svg-caret");
97
+ l && c.value.removeChild(l);
98
+ const e = p.value;
99
+ if (!e) return;
100
+ const { x: t, y: n } = F.value, { row: o, col: a } = P.value, r = E.value, v = e.childNodes[o];
101
+ if (!v) return;
102
+ let d = v.textContent.slice(0, a);
103
+ d.endsWith(" ") && (d += " ");
104
+ const s = document.createElementNS("http://www.w3.org/2000/svg", "text");
105
+ s.setAttribute("x", t), s.setAttribute("y", n), s.setAttribute("font-size", r), s.setAttribute("font-family", "sans-serif"), s.textContent = d || "", c.value.appendChild(s);
106
+ const f = s.getBBox();
107
+ c.value.removeChild(s);
108
+ let h = n + o * r * 1.2, T = t + f.width;
109
+ const g = document.createElementNS("http://www.w3.org/2000/svg", "rect");
110
+ g.setAttribute("x", T), g.setAttribute("y", h), g.setAttribute("width", 1), g.setAttribute("height", r), g.setAttribute("fill", S.value), g.setAttribute("class", "vue-data-ui-svg-caret"), c.value.appendChild(g);
111
+ }
112
+ function J(l) {
113
+ if (p.value && !p.value.contains(l.target)) {
114
+ const e = p.value.children;
115
+ e.length === 1 && (e[0].textContent === "" || e[0].textContent === "​") && p.value.remove(), Z(!1);
116
+ }
117
+ }
118
+ function Z(l = !1) {
119
+ window.removeEventListener("keydown", H), window.removeEventListener("mousedown", J, !0);
120
+ const e = c.value?.querySelector(".vue-data-ui-svg-caret");
121
+ e && c.value.removeChild(e);
122
+ const t = A.value.every(
123
+ (n) => !n || n === "​"
124
+ );
125
+ l || t || w.value.push({
126
+ id: I(),
127
+ type: "text",
128
+ x: F.value.x,
129
+ y: F.value.y,
130
+ color: S.value,
131
+ fontSize: E.value,
132
+ lines: A.value.map((n) => n)
133
+ }), p.value && c.value && c.value.contains(p.value) && c.value.removeChild(p.value), V.value = !1, p.value = null, A.value = [""], P.value = { row: 0, col: 0 };
134
+ }
135
+ const B = we(() => $e($.color, 0.6));
136
+ function W({ width: l, height: e }) {
137
+ G.value = `0 0 ${l} ${e}`;
138
+ }
139
+ const U = i(null);
140
+ ke(() => {
141
+ be(() => {
142
+ if ($.parent) {
143
+ U.value = new ResizeObserver((t) => {
144
+ for (const n of t) {
145
+ const { width: o, height: a } = n.contentRect;
146
+ W({ width: o, height: a });
147
+ }
148
+ }), U.value.observe($.parent);
149
+ const { width: l, height: e } = $.parent.getBoundingClientRect();
150
+ W({ width: l, height: e });
151
+ }
152
+ }), c.value = k.value.querySelector("g");
153
+ }), Ce(() => {
154
+ U.value && U.value.disconnect();
155
+ }), oe(
156
+ () => $.parent,
157
+ (l) => {
158
+ if (!l) return;
159
+ const { width: e, height: t } = $.parent.getBoundingClientRect();
160
+ W({ width: e, height: t });
161
+ },
162
+ { immediate: !0 }
163
+ ), oe(m, (l) => {
164
+ l === "text" ? k.value?.addEventListener("mousedown", Q) : k.value?.removeEventListener("mousedown", Q);
165
+ });
166
+ const z = i(!1), X = i(""), k = i(null);
167
+ function _(l) {
168
+ if (m.value !== "draw" || !k.value) return;
169
+ z.value = !0;
170
+ const { x: e, y: t } = ne(l);
171
+ X.value = `M ${e} ${t}`;
172
+ }
173
+ function ee(l) {
174
+ if (!z.value || !k.value) return;
175
+ const { x: e, y: t } = ne(l);
176
+ X.value += ` ${e} ${t}`;
177
+ }
178
+ function te(l) {
179
+ const e = l.trim().split(/\s+/);
180
+ if (e.length < 4)
181
+ return l;
182
+ const t = e.slice(1).map(Number);
183
+ if (t.length % 2 !== 0)
184
+ return l;
185
+ const n = he(t), o = [`M ${n[0]} ${n[1]}`];
186
+ for (let v = 2; v < n.length - 2; v += 2) {
187
+ const d = n[v - 2], s = n[v - 1], f = n[v], h = n[v + 1], T = (d + f) / 2, g = (s + h) / 2;
188
+ o.push(`Q ${d} ${s} ${T} ${g}`);
189
+ }
190
+ const a = n[n.length - 2], r = n[n.length - 1];
191
+ return o.push(`L ${a} ${r}`), o.join(" ");
192
+ }
193
+ function he(l, e = 1) {
194
+ const t = [...l];
195
+ for (let n = 2; n < l.length - 2; n += 2) {
196
+ const o = l[n], a = l[n + 1], r = l[n - 2], v = l[n - 1], d = l[n + 2], s = l[n + 3];
197
+ t[n] = o + e * ((r + d) / 2 - o), t[n + 1] = a + e * ((v + s) / 2 - a);
198
+ }
199
+ return t;
200
+ }
201
+ function ge(l) {
202
+ const e = l.trim().split(/\s+/);
203
+ let t = "", n = "", o = null, a = null;
204
+ for (let r = 0; r < e.length; r += 1) {
205
+ const v = e[r];
206
+ if (isNaN(v)) {
207
+ if (n = v, n === "M" || n === "L")
208
+ o = parseFloat(e[++r]), a = parseFloat(e[++r]), t += `${n}${o} ${a}`;
209
+ else if (n === "Q") {
210
+ const d = parseFloat(e[++r]), s = parseFloat(e[++r]), f = parseFloat(e[++r]), h = parseFloat(e[++r]);
211
+ d === o && s === a ? t += `t${f - o} ${h - a}` : t += `q${d - o} ${s - a} ${f - o} ${h - a}`, o = f, a = h;
212
+ }
213
+ } else {
214
+ const d = parseFloat(v), s = parseFloat(e[++r]);
215
+ if (n === "L") {
216
+ const f = d - o, h = s - a;
217
+ f === 0 ? t += `v${h}` : h === 0 ? t += `h${f}` : t += `l${f} ${h}`, o = d, a = s;
218
+ } else if (n === "Q") {
219
+ const f = d, h = s, T = parseFloat(e[++r]), g = parseFloat(e[++r]);
220
+ f === o && h === a ? t += `t${T - o} ${g - a}` : t += `q${f - o} ${h - a} ${T - o} ${g - a}`, o = T, a = g;
221
+ }
222
+ }
223
+ }
224
+ return t;
225
+ }
226
+ function K() {
227
+ z.value && (w.value.push({
228
+ id: I(),
229
+ strokeWidth: L.value,
230
+ path: ge(te(X.value)),
231
+ color: S.value
232
+ }), N.value = [], X.value = ""), z.value = !1;
233
+ }
234
+ function ne(l) {
235
+ if (!k.value) return { x: 0, y: 0 };
236
+ const e = k.value.getBoundingClientRect();
237
+ let t, n;
238
+ return l.touches && l.touches.length ? (t = l.touches[0].clientX, n = l.touches[0].clientY) : (t = l.clientX, n = l.clientY), {
239
+ x: t - e.left,
240
+ y: n - e.top
241
+ };
242
+ }
243
+ function xe() {
244
+ if (w.value.length > 0) {
245
+ const l = w.value.pop();
246
+ N.value.push(l);
247
+ }
248
+ }
249
+ function ye() {
250
+ if (N.value.length > 0) {
251
+ const l = N.value.pop();
252
+ w.value.push(l);
253
+ }
254
+ }
255
+ function me() {
256
+ w.value = [], N.value = [];
257
+ }
258
+ const le = i(null);
259
+ return (l, e) => (y(), x(q, null, [
260
+ u.active ? (y(), x("div", {
261
+ key: 0,
262
+ "data-dom-to-png-ignore": "",
263
+ class: D({
264
+ "vue-ui-pen-and-paper-actions": !0,
265
+ visible: u.active
266
+ }),
267
+ style: b({ backgroundColor: u.backgroundColor })
268
+ }, [
269
+ C("button", {
270
+ class: "vue-ui-pen-and-paper-action",
271
+ style: b({
272
+ backgroundColor: u.backgroundColor,
273
+ border: `1px solid ${B.value}`
274
+ }),
275
+ onClick: e[0] || (e[0] = (t) => de("close"))
276
+ }, [
277
+ M(R, {
278
+ name: "close",
279
+ stroke: u.color
280
+ }, null, 8, ["stroke"])
281
+ ], 4),
282
+ C("button", Te, [
283
+ M(Ee, {
284
+ value: S.value,
285
+ "onUpdate:value": e[1] || (e[1] = (t) => S.value = t),
286
+ backgroundColor: u.backgroundColor,
287
+ buttonBorderColor: B.value
288
+ }, null, 8, ["value", "backgroundColor", "buttonBorderColor"])
289
+ ]),
290
+ C("button", {
291
+ class: D(["vue-ui-pen-and-paper-action", { "vue-ui-pen-and-paper-action-active": m.value === "text" }]),
292
+ onClick: e[2] || (e[2] = (t) => m.value = m.value === "text" ? "draw" : "text"),
293
+ style: b({
294
+ backgroundColor: u.backgroundColor,
295
+ border: `1px solid ${B.value}`
296
+ })
297
+ }, [
298
+ M(R, {
299
+ name: m.value === "draw" ? "annotator" : "text",
300
+ stroke: u.color
301
+ }, null, 8, ["name", "stroke"]),
302
+ C("div", {
303
+ style: b({
304
+ position: "absolute",
305
+ bottom: "-20px",
306
+ color: B.value,
307
+ width: "100%",
308
+ textAlign: "center",
309
+ fontSize: "12px"
310
+ })
311
+ }, re(se(Se)({
312
+ v: m.value === "draw" ? L.value : E.value,
313
+ s: "px",
314
+ r: 1
315
+ })), 5)
316
+ ], 6),
317
+ C("button", {
318
+ class: D({
319
+ "vue-ui-pen-and-paper-action": !0,
320
+ "vue-ui-pen-and-paper-action-disabled": !w.value.length
321
+ }),
322
+ disabled: !w.value.length,
323
+ style: b({
324
+ backgroundColor: u.backgroundColor,
325
+ border: `1px solid ${B.value}`,
326
+ marginTop: "20px"
327
+ }),
328
+ onClick: xe
329
+ }, [
330
+ M(R, {
331
+ name: "restart",
332
+ stroke: u.color
333
+ }, null, 8, ["stroke"])
334
+ ], 14, De),
335
+ C("button", {
336
+ class: D({
337
+ "vue-ui-pen-and-paper-action": !0,
338
+ "vue-ui-pen-and-paper-action-disabled": !N.value.length
339
+ }),
340
+ style: b({
341
+ backgroundColor: u.backgroundColor,
342
+ border: `1px solid ${B.value}`
343
+ }),
344
+ onClick: ye
345
+ }, [
346
+ M(R, {
347
+ name: "restart",
348
+ stroke: u.color,
349
+ style: { transform: "scaleX(-1)" }
350
+ }, null, 8, ["stroke"])
351
+ ], 6),
352
+ C("button", {
353
+ class: D([{
354
+ "vue-ui-pen-and-paper-action": !0,
355
+ "vue-ui-pen-and-paper-action-disabled": !w.value.length
356
+ }, "vue-ui-pen-and-paper-action"]),
357
+ style: b({
358
+ backgroundColor: u.backgroundColor,
359
+ border: `1px solid ${B.value}`
360
+ }),
361
+ onClick: me
362
+ }, [
363
+ M(R, {
364
+ name: "trash",
365
+ stroke: u.color
366
+ }, null, 8, ["stroke"])
367
+ ], 6),
368
+ m.value === "draw" ? ae((y(), x("input", {
369
+ key: 0,
370
+ ref_key: "range",
371
+ ref: le,
372
+ type: "range",
373
+ class: "vertical-range",
374
+ min: 0.5,
375
+ max: 12,
376
+ step: 0.1,
377
+ "onUpdate:modelValue": e[3] || (e[3] = (t) => L.value = t),
378
+ style: b({ accentColor: u.color })
379
+ }, null, 4)), [
380
+ [ue, L.value]
381
+ ]) : Y("", !0),
382
+ m.value === "text" ? ae((y(), x("input", {
383
+ key: 1,
384
+ ref_key: "range",
385
+ ref: le,
386
+ type: "range",
387
+ class: "vertical-range",
388
+ min: 3,
389
+ max: 48,
390
+ step: 0.1,
391
+ "onUpdate:modelValue": e[4] || (e[4] = (t) => E.value = t),
392
+ style: b({ accentColor: u.color })
393
+ }, null, 4)), [
394
+ [ue, E.value]
395
+ ]) : Y("", !0)
396
+ ], 6)) : Y("", !0),
397
+ (y(), x("svg", {
398
+ "data-mode": m.value,
399
+ ref_key: "svgElement",
400
+ ref: k,
401
+ xmlns: se(Ae),
402
+ viewBox: G.value,
403
+ class: D({
404
+ "vue-ui-pen-and-paper": !0,
405
+ inactive: !u.active
406
+ }),
407
+ onMousedown: _,
408
+ onMousemove: ee,
409
+ onMouseup: K,
410
+ onMouseleave: K,
411
+ onTouchstart: ie(_, ["prevent"]),
412
+ onTouchmove: ie(ee, ["prevent"]),
413
+ onTouchend: K
414
+ }, [
415
+ C("g", {
416
+ ref_key: "G",
417
+ ref: c
418
+ }, [
419
+ (y(!0), x(q, null, ce(w.value, (t) => (y(), x(q, {
420
+ key: t.id
421
+ }, [
422
+ t.path && t.path.replace("M", "").split(" ").length === 2 ? (y(), x("circle", {
423
+ key: 0,
424
+ cx: t.path.replace("M", "").split(" ")[0],
425
+ cy: t.path.replace("M", "").split(" ")[1],
426
+ r: t.strokeWidth / 2,
427
+ fill: t.color
428
+ }, null, 8, Me)) : t.path ? (y(), x("path", {
429
+ key: 1,
430
+ class: "vue-ui-pen-and-paper-path",
431
+ d: t.path,
432
+ stroke: t.color,
433
+ "stroke-width": t.strokeWidth,
434
+ fill: "none"
435
+ }, null, 8, Le)) : t.type === "text" ? (y(), x("text", {
436
+ key: 2,
437
+ x: t.x,
438
+ y: t.y,
439
+ fill: t.color,
440
+ "font-size": t.fontSize,
441
+ "font-family": "sans-serif",
442
+ "dominant-baseline": "hanging",
443
+ class: "vue-ui-pen-and-paper-text"
444
+ }, [
445
+ (y(!0), x(q, null, ce(t.lines, (n, o) => (y(), x("tspan", {
446
+ key: o,
447
+ x: t.x,
448
+ dy: o === 0 ? "0" : t.fontSize * 1.2
449
+ }, re(n.length ? n : "​"), 9, Pe))), 128))
450
+ ], 8, Fe)) : Y("", !0)
451
+ ], 64))), 128))
452
+ ], 512),
453
+ z.value ? (y(), x("path", {
454
+ key: 0,
455
+ class: "vue-ui-pen-and-paper-path vue-ui-pen-and-paper-path-drawing",
456
+ d: te(X.value),
457
+ stroke: S.value,
458
+ "stroke-width": L.value * 1.1,
459
+ fill: "none"
460
+ }, null, 8, ze)) : Y("", !0)
461
+ ], 42, Ne))
462
+ ], 64));
463
+ }
464
+ }, We = /* @__PURE__ */ Be(Xe, [["__scopeId", "data-v-14478ba4"]]);
465
+ export {
466
+ We as default
467
+ };
@@ -0,0 +1,10 @@
1
+ import { createElementBlock as e, openBlock as t, toDisplayString as o, unref as r } from "vue";
2
+ const a = "2.12.7-beta.1", n = { "aria-hidden": "true" }, p = {
3
+ __name: "PackageVersion",
4
+ setup(s) {
5
+ return (c, i) => (t(), e("desc", n, "Composed with Vue Data UI " + o(r(a)), 1));
6
+ }
7
+ };
8
+ export {
9
+ p as default
10
+ };
@@ -1,7 +1,7 @@
1
1
  import { ref as c, computed as ge, watch as X, nextTick as le, onMounted as pe, onBeforeUnmount as me, createElementBlock as Y, createCommentVNode as q, openBlock as z, normalizeStyle as x, createElementVNode as k, withDirectives as ae, createVNode as R, normalizeClass as G, toDisplayString as Ae, unref as he, vModelText as oe } from "vue";
2
- import T from "./BaseIcon-CNbwMh_-.js";
3
- import { C as we } from "./ColorPicker-B_FoQwtO.js";
4
- import { l as be, f as xe } from "./index-BFzQMJda.js";
2
+ import T from "./BaseIcon-DhWmrDAn.js";
3
+ import { C as we } from "./ColorPicker-F4TctKaQ.js";
4
+ import { l as be, f as xe } from "./index-BHEd2dgu.js";
5
5
  const ye = {
6
6
  class: "vue-ui-pen-and-paper-action",
7
7
  style: { padding: "0 !important" }
@@ -105,15 +105,14 @@ const ye = {
105
105
  }
106
106
  }
107
107
  function ee(l = !1) {
108
- var a;
109
108
  window.removeEventListener("keydown", j), window.removeEventListener("mousedown", _, !0);
110
109
  const e = o.value.querySelector(".vue-data-ui-svg-caret");
111
110
  e && o.value.removeChild(e);
112
- const n = (a = f.value) == null ? void 0 : a.children;
111
+ const n = f.value?.children;
113
112
  let t = !1;
114
113
  if (n && n.length === 1) {
115
- const r = n[0].textContent;
116
- t = !r || r === "​";
114
+ const a = n[0].textContent;
115
+ t = !a || a === "​";
117
116
  }
118
117
  l || 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), Q.value = !1, f.value = null, N.value = [""], D.value = { row: 0, col: 0 };
119
118
  }
@@ -127,12 +126,11 @@ const ye = {
127
126
  }
128
127
  }
129
128
  function V(l) {
130
- var a;
131
129
  const e = s.svgRef;
132
130
  if (!e) return { x: 0, y: 0 };
133
131
  const n = e.createSVGPoint();
134
132
  n.x = l.clientX, n.y = l.clientY;
135
- const t = (a = e.getScreenCTM()) == null ? void 0 : a.inverse();
133
+ const t = e.getScreenCTM()?.inverse();
136
134
  return t ? n.matrixTransform(t) : { x: 0, y: 0 };
137
135
  }
138
136
  function ue(l) {
@@ -371,5 +369,5 @@ const ye = {
371
369
  }
372
370
  };
373
371
  export {
374
- Be as _
372
+ Be as default
375
373
  };
@@ -0,0 +1,96 @@
1
+ import { toRef as m, resolveComponent as R, createElementBlock as s, openBlock as o, Fragment as u, renderList as k, createCommentVNode as a, createBlock as $, createElementVNode as U, withModifiers as w, renderSlot as h, mergeProps as f, withCtx as x } from "vue";
2
+ const F = ["cx", "cy", "r", "fill", "stroke", "stroke-width", "onClick", "onMouseover"], M = ["x", "y", "height", "width", "onClick", "onMouseover"], P = {
3
+ __name: "RecursiveCircles",
4
+ props: {
5
+ color: {
6
+ type: String,
7
+ default: "#000000"
8
+ },
9
+ dataset: {
10
+ type: Array,
11
+ default: () => []
12
+ },
13
+ hoveredUid: {
14
+ type: String,
15
+ default: null
16
+ },
17
+ linkColor: {
18
+ type: String,
19
+ default: "#CCCCCC"
20
+ },
21
+ stroke: {
22
+ type: String,
23
+ default: "#FFFFFF"
24
+ },
25
+ strokeHovered: {
26
+ type: String,
27
+ default: "#000000"
28
+ }
29
+ },
30
+ emits: ["click", "hover"],
31
+ setup(t, { emit: y }) {
32
+ const C = t, v = y;
33
+ function d(r) {
34
+ v("click", r);
35
+ }
36
+ function n(r) {
37
+ v("hover", r);
38
+ }
39
+ return m(C, "dataset").value.forEach((r) => {
40
+ r.nodes && r.nodes.length > 0 && r.nodes.forEach((l) => {
41
+ l.ancestor = r;
42
+ });
43
+ }), (r, l) => {
44
+ const g = R("RecursiveCircles", !0);
45
+ return o(!0), s(u, null, k(t.dataset, (e) => (o(), s(u, null, [
46
+ e.polygonPath && e.polygonPath.coordinates ? (o(), s(u, { key: 0 }, [
47
+ (o(!0), s(u, null, k(e.polygonPath.coordinates, (i, S) => (o(), s(u, null, [
48
+ U("circle", {
49
+ cx: i.x,
50
+ cy: i.y,
51
+ r: e.circleRadius,
52
+ fill: `url(#gradient_${e.color})`,
53
+ stroke: t.hoveredUid && t.hoveredUid === e.uid ? t.strokeHovered : t.stroke,
54
+ "stroke-width": t.hoveredUid && t.hoveredUid === e.uid ? e.circleRadius / 6 : e.circleRadius / 12,
55
+ style: { cursor: "pointer" },
56
+ onClick: (c) => d(e),
57
+ onMouseover: (c) => n(e),
58
+ onMouseleave: l[0] || (l[0] = (c) => n(null))
59
+ }, null, 40, F),
60
+ r.$slots.node ? (o(), s("foreignObject", {
61
+ key: 0,
62
+ x: i.x - e.circleRadius,
63
+ y: i.y - e.circleRadius,
64
+ height: e.circleRadius * 2,
65
+ width: e.circleRadius * 2,
66
+ style: { overflow: "visible" },
67
+ onClick: w((c) => d(e), ["stop"]),
68
+ onMouseover: (c) => n(e),
69
+ onMouseleave: l[1] || (l[1] = (c) => n(null))
70
+ }, [
71
+ h(r.$slots, "node", f({ ref_for: !0 }, { node: e }))
72
+ ], 40, M)) : a("", !0)
73
+ ], 64))), 256)),
74
+ e.nodes && e.nodes.length > 0 ? (o(), $(g, {
75
+ key: 0,
76
+ dataset: e.nodes,
77
+ color: t.color,
78
+ stroke: t.stroke,
79
+ strokeHovered: t.strokeHovered,
80
+ hoveredUid: t.hoveredUid,
81
+ onClick: d,
82
+ onHover: n
83
+ }, {
84
+ node: x(({ node: i }) => [
85
+ h(r.$slots, "node", f({ ref_for: !0 }, { node: i }))
86
+ ]),
87
+ _: 2
88
+ }, 1032, ["dataset", "color", "stroke", "strokeHovered", "hoveredUid"])) : a("", !0)
89
+ ], 64)) : a("", !0)
90
+ ], 64))), 256);
91
+ };
92
+ }
93
+ };
94
+ export {
95
+ P as default
96
+ };
@@ -0,0 +1,49 @@
1
+ import { toRef as d, resolveComponent as m, createElementBlock as l, openBlock as t, Fragment as a, renderList as c, createCommentVNode as i, createBlock as h, toDisplayString as y } from "vue";
2
+ const f = ["x", "y", "fill", "font-size"], R = {
3
+ __name: "RecursiveLabels",
4
+ props: {
5
+ color: {
6
+ type: String,
7
+ default: "#000000"
8
+ },
9
+ dataset: {
10
+ type: Array,
11
+ default: () => []
12
+ },
13
+ hoveredUid: {
14
+ type: String,
15
+ default: null
16
+ }
17
+ },
18
+ emits: ["zoom", "hover"],
19
+ setup(o, { emit: p }) {
20
+ return d(o, "dataset").value.forEach((r) => {
21
+ r.nodes && r.nodes.length > 0 && r.nodes.forEach((n) => {
22
+ n.ancestor = r;
23
+ });
24
+ }), (r, n) => {
25
+ const u = m("RecursiveLabels", !0);
26
+ return t(!0), l(a, null, c(o.dataset, (e) => (t(), l(a, null, [
27
+ e.polygonPath && e.polygonPath.coordinates ? (t(), l(a, { key: 0 }, [
28
+ (t(!0), l(a, null, c(e.polygonPath.coordinates, (s) => (t(), l("text", {
29
+ x: s.x,
30
+ y: s.y + e.circleRadius * 2,
31
+ fill: o.color,
32
+ "font-size": e.circleRadius,
33
+ "text-anchor": "middle",
34
+ style: { opacity: "0.8", "pointer-events": "none" }
35
+ }, y(e.name), 9, f))), 256)),
36
+ e.nodes && e.nodes.length > 0 ? (t(), h(u, {
37
+ key: 0,
38
+ dataset: e.nodes,
39
+ color: o.color,
40
+ hoveredUid: o.hoveredUid
41
+ }, null, 8, ["dataset", "color", "hoveredUid"])) : i("", !0)
42
+ ], 64)) : i("", !0)
43
+ ], 64))), 256);
44
+ };
45
+ }
46
+ };
47
+ export {
48
+ R as default
49
+ };