vue-data-ui 3.5.0 → 3.5.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 (144) hide show
  1. package/README.md +26 -0
  2. package/dist/{ColorPicker-J5wOPCeB.js → ColorPicker-ChuwChMo.js} +58 -56
  3. package/dist/{NonSvgPenAndPaper-C7TRn0_3.js → NonSvgPenAndPaper-DVgKKLIf.js} +1 -1
  4. package/dist/{PackageVersion-Cyx_s25h.js → PackageVersion-DQvyATVa.js} +1 -1
  5. package/dist/PenAndPaper-SZQIAgkg.js +388 -0
  6. package/dist/{Title-l36lOBMx.js → Title-isbiM8i8.js} +1 -1
  7. package/dist/components/vue-ui-3d-bar.js +1 -1
  8. package/dist/components/vue-ui-accordion.js +1 -1
  9. package/dist/components/vue-ui-age-pyramid.js +1 -1
  10. package/dist/components/vue-ui-annotator.js +1 -1
  11. package/dist/components/vue-ui-bullet.js +1 -1
  12. package/dist/components/vue-ui-candlestick.js +1 -1
  13. package/dist/components/vue-ui-carousel-table.js +1 -1
  14. package/dist/components/vue-ui-chestnut.js +1 -1
  15. package/dist/components/vue-ui-chord.js +1 -1
  16. package/dist/components/vue-ui-circle-pack.js +1 -1
  17. package/dist/components/vue-ui-cursor.js +1 -1
  18. package/dist/components/vue-ui-dashboard.js +1 -1
  19. package/dist/components/vue-ui-digits.js +1 -1
  20. package/dist/components/vue-ui-donut-evolution.js +1 -1
  21. package/dist/components/vue-ui-donut.js +1 -1
  22. package/dist/components/vue-ui-dumbbell.js +1 -1
  23. package/dist/components/vue-ui-flow.js +1 -1
  24. package/dist/components/vue-ui-funnel.js +1 -1
  25. package/dist/components/vue-ui-galaxy.js +1 -1
  26. package/dist/components/vue-ui-gauge.js +1 -1
  27. package/dist/components/vue-ui-gizmo.js +1 -1
  28. package/dist/components/vue-ui-heatmap.js +1 -1
  29. package/dist/components/vue-ui-history-plot.js +1 -1
  30. package/dist/components/vue-ui-horizontal-bar.js +1 -1
  31. package/dist/components/vue-ui-kpi.js +1 -1
  32. package/dist/components/vue-ui-mini-loader.js +1 -1
  33. package/dist/components/vue-ui-molecule.js +1 -1
  34. package/dist/components/vue-ui-mood-radar.js +1 -1
  35. package/dist/components/vue-ui-nested-donuts.js +1 -1
  36. package/dist/components/vue-ui-onion.js +1 -1
  37. package/dist/components/vue-ui-parallel-coordinate-plot.js +1 -1
  38. package/dist/components/vue-ui-quadrant.js +1 -1
  39. package/dist/components/vue-ui-quick-chart.js +1 -1
  40. package/dist/components/vue-ui-radar.js +1 -1
  41. package/dist/components/vue-ui-rating.js +1 -1
  42. package/dist/components/vue-ui-relation-circle.js +1 -1
  43. package/dist/components/vue-ui-ridgeline.js +1 -1
  44. package/dist/components/vue-ui-rings.js +1 -1
  45. package/dist/components/vue-ui-scatter.js +1 -1
  46. package/dist/components/vue-ui-skeleton.js +1 -1
  47. package/dist/components/vue-ui-smiley.js +1 -1
  48. package/dist/components/vue-ui-spark-trend.js +1 -1
  49. package/dist/components/vue-ui-sparkbar.js +1 -1
  50. package/dist/components/vue-ui-sparkgauge.js +1 -1
  51. package/dist/components/vue-ui-sparkhistogram.js +1 -1
  52. package/dist/components/vue-ui-sparkline.js +1 -1
  53. package/dist/components/vue-ui-sparkstackbar.js +1 -1
  54. package/dist/components/vue-ui-stackbar.js +1 -1
  55. package/dist/components/vue-ui-strip-plot.js +1 -1
  56. package/dist/components/vue-ui-table-heatmap.js +1 -1
  57. package/dist/components/vue-ui-table-sparkline.js +1 -1
  58. package/dist/components/vue-ui-table.js +1 -1
  59. package/dist/components/vue-ui-thermometer.js +1 -1
  60. package/dist/components/vue-ui-timer.js +1 -1
  61. package/dist/components/vue-ui-tiremarks.js +1 -1
  62. package/dist/components/vue-ui-treemap.js +1 -1
  63. package/dist/components/vue-ui-vertical-bar.js +1 -1
  64. package/dist/components/vue-ui-waffle.js +1 -1
  65. package/dist/components/vue-ui-wheel.js +1 -1
  66. package/dist/components/vue-ui-word-cloud.js +1 -1
  67. package/dist/components/vue-ui-world.js +1 -1
  68. package/dist/components/vue-ui-xy-canvas.js +1 -1
  69. package/dist/components/vue-ui-xy.js +1 -1
  70. package/dist/style.css +1 -1
  71. package/dist/types/vue-data-ui.d.ts +17 -8
  72. package/dist/{useNestedProp-BjZe1Y85.js → useNestedProp-DjGXw6S9.js} +22 -8
  73. package/dist/{vue-data-ui-DxgRqCAo.js → vue-data-ui-B_RxfmEm.js} +63 -63
  74. package/dist/vue-data-ui.js +64 -64
  75. package/dist/{vue-ui-3d-bar-DmNJp8SY.js → vue-ui-3d-bar-CMNYyVa2.js} +454 -434
  76. package/dist/{vue-ui-accordion-CZ0thhxa.js → vue-ui-accordion-CqhVCfc2.js} +1 -1
  77. package/dist/{vue-ui-age-pyramid-CPAP3sNY.js → vue-ui-age-pyramid-Vqa9iYXE.js} +180 -160
  78. package/dist/{vue-ui-annotator-BylDgUVb.js → vue-ui-annotator-nNv10fBm.js} +3 -3
  79. package/dist/{vue-ui-bullet-Ce6uvCQJ.js → vue-ui-bullet-BWEBeYV5.js} +190 -170
  80. package/dist/{vue-ui-candlestick-DewevWV_.js → vue-ui-candlestick-BoLzL0g1.js} +201 -181
  81. package/dist/{vue-ui-carousel-table-Dv1CDfE5.js → vue-ui-carousel-table-Bi6wvUUU.js} +2 -2
  82. package/dist/{vue-ui-chestnut-D9sdFZ4E.js → vue-ui-chestnut-BGz1TLXG.js} +375 -355
  83. package/dist/vue-ui-chord-CebhS7ln.js +1153 -0
  84. package/dist/{vue-ui-circle-pack-Be74QB_0.js → vue-ui-circle-pack-7PJVyKjp.js} +289 -269
  85. package/dist/{vue-ui-cursor-ik59bfC4.js → vue-ui-cursor-qYLAwvzn.js} +1 -1
  86. package/dist/vue-ui-dashboard-DcmMvhgM.js +432 -0
  87. package/dist/{vue-ui-digits-ByNNcWXi.js → vue-ui-digits-DyE8eU1m.js} +1 -1
  88. package/dist/{vue-ui-donut-BRGFcgxS.js → vue-ui-donut-CxZcJFTo.js} +462 -442
  89. package/dist/{vue-ui-donut-evolution-DJ0C-7jH.js → vue-ui-donut-evolution-BVYL-BUJ.js} +293 -273
  90. package/dist/{vue-ui-dumbbell-iQJ0BUhm.js → vue-ui-dumbbell-QxZn86A3.js} +210 -190
  91. package/dist/{vue-ui-flow-CTYFoib3.js → vue-ui-flow-DEI5LRch.js} +339 -319
  92. package/dist/{vue-ui-funnel-CG55Xcdy.js → vue-ui-funnel-B_A5orFg.js} +218 -198
  93. package/dist/{vue-ui-galaxy-BQrxjKZJ.js → vue-ui-galaxy-CUoDRr-O.js} +201 -181
  94. package/dist/{vue-ui-gauge-Tc-0NI0Y.js → vue-ui-gauge-46tSRZN5.js} +311 -291
  95. package/dist/{vue-ui-gizmo-P8h-gnLd.js → vue-ui-gizmo-BOgbsXao.js} +2 -2
  96. package/dist/{vue-ui-heatmap-BZimPzsL.js → vue-ui-heatmap-DKKjl1A2.js} +303 -283
  97. package/dist/{vue-ui-history-plot-BVzbuqYY.js → vue-ui-history-plot-C6p_aThr.js} +229 -209
  98. package/dist/{vue-ui-kpi-BGGff8LM.js → vue-ui-kpi-B1yJ83aF.js} +2 -2
  99. package/dist/{vue-ui-mini-loader-CSF-7TJL.js → vue-ui-mini-loader-BudcNBg-.js} +1 -1
  100. package/dist/{vue-ui-molecule-BALqwB8c.js → vue-ui-molecule-L90GnHee.js} +156 -136
  101. package/dist/{vue-ui-mood-radar-QJ5nlZby.js → vue-ui-mood-radar-Dhigm5rw.js} +266 -246
  102. package/dist/{vue-ui-nested-donuts-CmUabkkQ.js → vue-ui-nested-donuts-D0MCLs5n.js} +506 -486
  103. package/dist/{vue-ui-onion-DAOCf3f8.js → vue-ui-onion-B7yPJ3gL.js} +220 -200
  104. package/dist/{vue-ui-parallel-coordinate-plot-D8jTuFjq.js → vue-ui-parallel-coordinate-plot-DY21ivNe.js} +235 -215
  105. package/dist/{vue-ui-quadrant-CO52mSRY.js → vue-ui-quadrant-b0vMRaq-.js} +463 -443
  106. package/dist/{vue-ui-quick-chart-DEaVSldE.js → vue-ui-quick-chart-VK2EN7sh.js} +288 -268
  107. package/dist/{vue-ui-radar-C5V4hhbW.js → vue-ui-radar-B5Vkoz9M.js} +331 -311
  108. package/dist/{vue-ui-rating-CiMoFM_c.js → vue-ui-rating-BH4DW1ZY.js} +1 -1
  109. package/dist/{vue-ui-relation-circle-CbMM0Jka.js → vue-ui-relation-circle-XHbE-ZUX.js} +228 -208
  110. package/dist/{vue-ui-ridgeline-CXCIRDq6.js → vue-ui-ridgeline-CAMNq-p_.js} +242 -222
  111. package/dist/{vue-ui-rings-BpUcyqo7.js → vue-ui-rings-ImGOqm_J.js} +189 -169
  112. package/dist/{vue-ui-scatter--Dxe-hfO.js → vue-ui-scatter-CterNJYe.js} +275 -255
  113. package/dist/{vue-ui-skeleton-BWq-VDzg.js → vue-ui-skeleton-CykXHWj-.js} +2 -2
  114. package/dist/{vue-ui-smiley-sGFRbn31.js → vue-ui-smiley-DnGm6qrK.js} +1 -1
  115. package/dist/{vue-ui-spark-trend-T4J_YOa_.js → vue-ui-spark-trend-N1AsNQJA.js} +2 -2
  116. package/dist/{vue-ui-sparkbar-DnKP55Vu.js → vue-ui-sparkbar-Bvsi5DTT.js} +2 -2
  117. package/dist/{vue-ui-sparkgauge-BDQLP-zi.js → vue-ui-sparkgauge-DyJmWCWT.js} +2 -2
  118. package/dist/{vue-ui-sparkhistogram-Dm7QXrA-.js → vue-ui-sparkhistogram-5eKrkmSb.js} +143 -140
  119. package/dist/{vue-ui-sparkline-tXGDLHRy.js → vue-ui-sparkline-ChKAzlVq.js} +2 -2
  120. package/dist/{vue-ui-sparkstackbar-M53Nt07M.js → vue-ui-sparkstackbar-BXNy6nuw.js} +2 -2
  121. package/dist/vue-ui-stackbar-1IwvUYBO.js +1827 -0
  122. package/dist/{vue-ui-strip-plot-BX9i3wMn.js → vue-ui-strip-plot-B1wGxP8-.js} +245 -225
  123. package/dist/{vue-ui-table-7r02N9R9.js → vue-ui-table-DSsIrT4L.js} +3 -3
  124. package/dist/{vue-ui-table-heatmap-BqCEBoUf.js → vue-ui-table-heatmap-DXFHy7-E.js} +1 -1
  125. package/dist/{vue-ui-table-sparkline-DZaAh10E.js → vue-ui-table-sparkline-DpqY_4ay.js} +2 -2
  126. package/dist/vue-ui-thermometer-CMKvSA8p.js +584 -0
  127. package/dist/{vue-ui-timer-Ds-MJoW2.js → vue-ui-timer-BpdCY_wg.js} +3 -3
  128. package/dist/vue-ui-tiremarks-CNipzVli.js +450 -0
  129. package/dist/{vue-ui-treemap-BEvl8hiw.js → vue-ui-treemap-DPE8SY0_.js} +453 -433
  130. package/dist/{vue-ui-vertical-bar-D8dtM8sw.js → vue-ui-vertical-bar-ZU1GCbX0.js} +323 -303
  131. package/dist/{vue-ui-waffle-B3q-2SCR.js → vue-ui-waffle-z7nuSuSV.js} +219 -199
  132. package/dist/vue-ui-wheel-DLRoRjeM.js +663 -0
  133. package/dist/{vue-ui-word-cloud-ChT7uLbN.js → vue-ui-word-cloud-D2r5E3pP.js} +248 -228
  134. package/dist/{vue-ui-world-CdP4g_3_.js → vue-ui-world-goXYnTyM.js} +287 -267
  135. package/dist/{vue-ui-xy-B68qQ-gX.js → vue-ui-xy-NDDbNbds.js} +389 -369
  136. package/dist/{vue-ui-xy-canvas-DDngEA1s.js → vue-ui-xy-canvas-2a6NlQe3.js} +4 -4
  137. package/package.json +4 -4
  138. package/dist/PenAndPaper-DSvu9dwa.js +0 -373
  139. package/dist/vue-ui-chord-BG4dxKNA.js +0 -1133
  140. package/dist/vue-ui-dashboard-C4BLwHey.js +0 -412
  141. package/dist/vue-ui-stackbar-CkBOjryQ.js +0 -1724
  142. package/dist/vue-ui-thermometer-CFPt3MOv.js +0 -564
  143. package/dist/vue-ui-tiremarks-2eIQ6vxu.js +0 -430
  144. package/dist/vue-ui-wheel-BpirIgAG.js +0 -643
@@ -1,7 +1,7 @@
1
1
  import { defineAsyncComponent as pe, ref as d, computed as g, useSlots as Tl, onMounted as Aa, toRefs as Al, watch as P, nextTick as be, onBeforeUnmount as Fa, shallowRef as Ye, createElementBlock as Fe, openBlock as R, normalizeClass as Fl, normalizeStyle as xe, createCommentVNode as W, createElementVNode as J, createBlock as V, unref as L, createSlots as Ra, withCtx as b, renderSlot as M, normalizeProps as K, guardReactiveProps as ee, createVNode as Oa, Teleport as Rl, toDisplayString as Ge, resolveDynamicComponent as Ol, mergeProps as Pl, createTextVNode as Pa } from "vue";
2
2
  import { c as Dl, t as El, b as Nl, p as ae, O as Le, e as _l, m as qe, a as se, d as re, h as Da, u as Hl, a1 as Xl, w as Ul, o as Bl, f as Wl, G as Ea, s as ke, S as Vl, P as Yl, Q as Gl, H as ql } from "./lib-C_mNZmhD.js";
3
3
  import { c as Zl, a as Ze, d as jl, t as Jl, u as Ql, l as C, r as Re, b as Y, p as Na } from "./useResponsive-DfdjqQps.js";
4
- import { u as Kl, a as je } from "./useNestedProp-BjZe1Y85.js";
4
+ import { u as Kl, a as je } from "./useNestedProp-DjGXw6S9.js";
5
5
  import { u as et, B as at } from "./BaseScanner-BgWxam9d.js";
6
6
  import { u as lt } from "./usePrinter-DTzqpYKF.js";
7
7
  import { u as tt, a as ot, l as ut } from "./useTimeLabels-BGFjWgrv.js";
@@ -10,9 +10,9 @@ import { u as rt } from "./useChartAccessibility-9icAAmYg.js";
10
10
  import nt from "./img-BecE5qXd.js";
11
11
  import { t as it } from "./themes-AUNCOb2G.js";
12
12
  import vt from "./Legend-G6GMcdAc.js";
13
- import ct from "./Title-l36lOBMx.js";
13
+ import ct from "./Title-isbiM8i8.js";
14
14
  import dt from "./BaseIcon-BmMbm4d0.js";
15
- import ht from "./vue-ui-accordion-CZ0thhxa.js";
15
+ import ht from "./vue-ui-accordion-CqhVCfc2.js";
16
16
  import { S as ft } from "./SlicerPreview-ij72TAs6.js";
17
17
  import { _ as yt } from "./_plugin-vue_export-helper-CHgC5LLL.js";
18
18
  const mt = ["id"], gt = ["id"], pt = ["id"], bt = ["onClick"], xt = {
@@ -40,7 +40,7 @@ const mt = ["id"], gt = ["id"], pt = ["id"], bt = ["onClick"], xt = {
40
40
  },
41
41
  emits: ["selectLegend", "selectX"],
42
42
  setup(Je, { expose: _a, emit: Ha }) {
43
- const Xa = pe(() => import("./Tooltip-oWCO1HKy.js")), Ua = pe(() => import("./DataTable-BT7VF2ua.js")), Ba = pe(() => import("./UserOptions-CGnQt6Fd.js")), Wa = pe(() => import("./NonSvgPenAndPaper-C7TRn0_3.js")), Va = pe(() => import("./BaseDraggableDialog-ymf2sfB8.js")), { vue_ui_xy_canvas: Ya } = Kl(), p = Je, Q = d(Dl()), H = d(null), le = d(null), v = d(null), m = d(1), G = d(1), ne = d(!1), h = d(null), Ce = d(""), Qe = d(null), $ = d([]), te = d(1), D = d(!0), X = d(!0), we = d(null), Ke = d(0), ie = d(!1), ea = d(null), aa = d(null), q = d(null), la = d(null), Oe = d(0), Pe = d(0), De = d(0), E = d(null), ta = d(!1), ve = d(null), Ee = d(null), ce = d(!1), oa = d(!1), Se = d(!1), w = d(null), U = g(() => Array.isArray(He.value) && He.value.length > 0), Ne = Ha, Ga = Tl();
43
+ const Xa = pe(() => import("./Tooltip-oWCO1HKy.js")), Ua = pe(() => import("./DataTable-BT7VF2ua.js")), Ba = pe(() => import("./UserOptions-CGnQt6Fd.js")), Wa = pe(() => import("./NonSvgPenAndPaper-DVgKKLIf.js")), Va = pe(() => import("./BaseDraggableDialog-ymf2sfB8.js")), { vue_ui_xy_canvas: Ya } = Kl(), p = Je, Q = d(Dl()), H = d(null), le = d(null), v = d(null), m = d(1), G = d(1), ne = d(!1), h = d(null), Ce = d(""), Qe = d(null), $ = d([]), te = d(1), D = d(!0), X = d(!0), we = d(null), Ke = d(0), ie = d(!1), ea = d(null), aa = d(null), q = d(null), la = d(null), Oe = d(0), Pe = d(0), De = d(0), E = d(null), ta = d(!1), ve = d(null), Ee = d(null), ce = d(!1), oa = d(!1), Se = d(!1), w = d(null), U = g(() => Array.isArray(He.value) && He.value.length > 0), Ne = Ha, Ga = Tl();
44
44
  Aa(() => {
45
45
  Ga["chart-background"] && console.warn("VueUiXyCanvas does not support the #chart-background slot.");
46
46
  });
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "vue-data-ui",
3
3
  "private": false,
4
- "version": "3.5.0",
4
+ "version": "3.5.1",
5
5
  "type": "module",
6
6
  "description": "A user-empowering data visualization Vue 3 components library for eloquent data storytelling",
7
7
  "keywords": [
@@ -106,12 +106,12 @@
106
106
  },
107
107
  "devDependencies": {
108
108
  "@vitejs/plugin-vue": "^6.0.1",
109
- "cypress": "^14.5.0",
109
+ "cypress": "^15.5.0",
110
110
  "remove-attr": "^0.0.13",
111
111
  "sass": "^1.57.1",
112
112
  "simple-git": "^3.24.0",
113
- "vite": "^7.1.11",
114
- "vitest": "^3.2.4",
113
+ "vite": "^7.1.12",
114
+ "vitest": "^4.0.5",
115
115
  "vue": "^3.5.22"
116
116
  }
117
117
  }
@@ -1,373 +0,0 @@
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 C, withDirectives as ae, createVNode as $, normalizeClass as G, toDisplayString as Ae, unref as he, vModelText as oe } from "vue";
2
- import T from "./BaseIcon-BmMbm4d0.js";
3
- import { C as we } from "./ColorPicker-J5wOPCeB.js";
4
- import { S as be, d as xe } from "./lib-C_mNZmhD.js";
5
- const ye = {
6
- class: "vue-ui-pen-and-paper-action",
7
- style: { padding: "0 !important" }
8
- }, ke = ["disabled"], Be = {
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: se }) {
34
- const s = d, ue = se, b = c([]), E = c([]), S = c(s.color), R = c(2), M = c(!1), P = c(""), o = c(null), A = c(null), F = c(null), h = c("draw"), Q = c(!1), f = c(null), H = c({ x: 0, y: 0 }), N = c([""]), D = c({ row: 0, col: 0 }), L = c(16), W = 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 O(l) {
36
- if (!o.value || h.value !== "text" || Q.value) return;
37
- const { x: e, y: n } = V(l);
38
- H.value = { x: e, y: n }, N.value = [""], D.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", n), t.setAttribute("fill", S.value), t.setAttribute("font-size", L.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, Q.value = !0, window.addEventListener("keydown", j), window.addEventListener("mousedown", _, !0), J(), Z();
43
- }
44
- function j(l) {
45
- if (!Q.value) return;
46
- let { row: e, col: n } = D.value, t = N.value.slice(), a = !1;
47
- if (l.key === "Enter") {
48
- const u = t[e], r = u.slice(0, n), v = u.slice(n);
49
- t.splice(e, 1, r, v), e += 1, n = 0, a = !0, l.preventDefault();
50
- } else if (l.key === "Backspace") {
51
- if (n > 0)
52
- t[e] = t[e].slice(0, n - 1) + t[e].slice(n), n -= 1, a = !0;
53
- else if (e > 0) {
54
- const u = t[e - 1].length;
55
- t[e - 1] += t[e], t.splice(e, 1), e -= 1, n = u, a = !0;
56
- }
57
- l.preventDefault();
58
- } else if (l.key === "Delete")
59
- n < t[e].length ? (t[e] = t[e].slice(0, n) + t[e].slice(n + 1), a = !0) : e < t.length - 1 && (t[e] += t[e + 1], t.splice(e + 1, 1), a = !0), l.preventDefault();
60
- else if (l.key === "ArrowLeft")
61
- n > 0 ? n -= 1 : e > 0 && (e -= 1, n = t[e].length), a = !0, l.preventDefault();
62
- else if (l.key === "ArrowRight")
63
- n < t[e].length ? n += 1 : e < t.length - 1 && (e += 1, n = 0), a = !0, l.preventDefault();
64
- else if (l.key === "ArrowUp")
65
- e > 0 && (e -= 1, n = Math.min(n, t[e].length), a = !0), l.preventDefault();
66
- else if (l.key === "ArrowDown")
67
- e < t.length - 1 && (e += 1, n = Math.min(n, t[e].length), a = !0), l.preventDefault();
68
- else if (l.key.length === 1 && !l.ctrlKey && !l.metaKey && !l.altKey)
69
- t[e] = t[e].slice(0, n) + l.key + t[e].slice(n), n += 1, a = !0, l.preventDefault();
70
- else if (l.key === "Escape") {
71
- ee(!0);
72
- return;
73
- } else l.key === "Tab" && l.preventDefault();
74
- a && (N.value = t, D.value = { row: e, col: n }, J(), Z());
75
- }
76
- function J() {
77
- const l = f.value, { x: e } = H.value;
78
- for (; l.firstChild; ) l.removeChild(l.firstChild);
79
- N.value.forEach((n, t) => {
80
- const a = document.createElementNS("http://www.w3.org/2000/svg", "tspan");
81
- a.setAttribute("x", e), a.setAttribute("dy", t === 0 ? "0" : `${L.value * 1.2 * s.scale}`), a.textContent = n.length ? n : "​", l.appendChild(a);
82
- });
83
- }
84
- function Z() {
85
- const l = o.value.querySelector(".vue-data-ui-svg-caret");
86
- l && o.value.removeChild(l);
87
- const e = f.value;
88
- if (!e) return;
89
- const { x: n, y: t } = H.value, { row: a, col: u } = D.value, r = L.value * s.scale, v = e.childNodes[a];
90
- if (!v) return;
91
- let g = v.textContent.slice(0, u);
92
- g.endsWith(" ") && (g += " ");
93
- const i = document.createElementNS("http://www.w3.org/2000/svg", "text");
94
- i.setAttribute("x", n), i.setAttribute("y", t), i.setAttribute("font-size", r), i.setAttribute("font-family", "sans-serif"), i.textContent = g || "", o.value.appendChild(i);
95
- const p = i.getBBox();
96
- o.value.removeChild(i);
97
- let m = t + a * r * 1.2, k = n + p.width;
98
- const w = document.createElementNS("http://www.w3.org/2000/svg", "rect");
99
- w.setAttribute("x", k), w.setAttribute("y", m), w.setAttribute("width", 2), w.setAttribute("height", r), w.setAttribute("fill", S.value), w.setAttribute("class", "vue-data-ui-svg-caret"), o.value.appendChild(w);
100
- }
101
- function _(l) {
102
- if (f.value && !f.value.contains(l.target)) {
103
- const e = f.value.children;
104
- e.length === 1 && (e[0].textContent === "" || e[0].textContent === "​") && f.value.remove(), ee(!1);
105
- }
106
- }
107
- function ee(l = !1) {
108
- window.removeEventListener("keydown", j), window.removeEventListener("mousedown", _, !0);
109
- const e = o.value.querySelector(".vue-data-ui-svg-caret");
110
- e && o.value.removeChild(e);
111
- const n = f.value?.children;
112
- let t = !1;
113
- if (n && n.length === 1) {
114
- const a = n[0].textContent;
115
- t = !a || a === "​";
116
- }
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 };
118
- }
119
- const y = ge(() => be(s.color, 0.6));
120
- function te() {
121
- if (!o.value) return;
122
- const l = o.value.querySelector(".vue-data-ui-mask");
123
- if (l && o.value.removeChild(l), 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 V(l) {
129
- const e = s.svgRef;
130
- if (!e) return { x: 0, y: 0 };
131
- const n = e.createSVGPoint();
132
- n.x = l.clientX, n.y = l.clientY;
133
- const t = e.getScreenCTM()?.inverse();
134
- return t ? n.matrixTransform(t) : { x: 0, y: 0 };
135
- }
136
- function re(l) {
137
- const e = l.trim().split(/\s+/);
138
- if (e.length < 4)
139
- return l;
140
- const n = e.slice(1).map(Number);
141
- if (n.length % 2 !== 0)
142
- return l;
143
- const t = ie(n), 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], p = t[v], m = t[v + 1], k = (g + p) / 2, w = (i + m) / 2;
146
- a.push(`Q ${g} ${i} ${k} ${w}`);
147
- }
148
- const u = t[t.length - 2], r = t[t.length - 1];
149
- return a.push(`L ${u} ${r}`), a.join(" ");
150
- }
151
- function ie(l, e = 1) {
152
- const n = [...l];
153
- for (let t = 2; t < l.length - 2; t += 2) {
154
- const a = l[t], u = l[t + 1], r = l[t - 2], v = l[t - 1], g = l[t + 2], i = l[t + 3];
155
- n[t] = a + e * ((r + g) / 2 - a), n[t + 1] = u + e * ((v + i) / 2 - u);
156
- }
157
- return n;
158
- }
159
- function ve(l) {
160
- const e = l.trim().split(/\s+/);
161
- let n = "", t = "", a = null, u = null;
162
- for (let r = 0; r < e.length; r += 1) {
163
- const v = e[r];
164
- if (isNaN(v)) {
165
- if (t = v, t === "M" || t === "L")
166
- a = parseFloat(e[++r]), u = parseFloat(e[++r]), n += `${t}${a} ${u}`;
167
- else if (t === "Q") {
168
- const g = parseFloat(e[++r]), i = parseFloat(e[++r]), p = parseFloat(e[++r]), m = parseFloat(e[++r]);
169
- g === a && i === u ? n += `t${p - a} ${m - u}` : n += `q${g - a} ${i - u} ${p - a} ${m - u}`, a = p, u = m;
170
- }
171
- } else {
172
- const g = parseFloat(v), i = parseFloat(e[++r]);
173
- if (t === "L") {
174
- const p = g - a, m = i - u;
175
- p === 0 ? n += `v${m}` : m === 0 ? n += `h${p}` : n += `l${p} ${m}`, a = g, u = i;
176
- } else if (t === "Q") {
177
- const p = g, m = i, k = parseFloat(e[++r]), w = parseFloat(e[++r]);
178
- p === a && m === u ? n += `t${k - a} ${w - u}` : n += `q${p - a} ${m - u} ${k - a} ${w - u}`, a = k, u = w;
179
- }
180
- }
181
- }
182
- return n;
183
- }
184
- function I(l) {
185
- if (h.value !== "draw" || !s.active || !o.value) return;
186
- M.value = !0;
187
- const { x: e, y: n } = V(l);
188
- F.value = { x: e, y: n }, P.value = `M ${e} ${n}`, A.value = document.createElementNS("http://www.w3.org/2000/svg", "path"), A.value.setAttribute("stroke", S.value), A.value.setAttribute("stroke-width", R.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 K(l) {
191
- if (!M.value || !o.value || !A.value) return;
192
- const { x: e, y: n } = V(l);
193
- P.value += ` ${e} ${n}`, A.value.setAttribute("d", P.value);
194
- }
195
- function B(l) {
196
- if (M.value && o.value && A.value) {
197
- const { x: e, y: n } = V(l);
198
- if (F.value && F.value.x === e && F.value.y === n) {
199
- const t = document.createElementNS("http://www.w3.org/2000/svg", "circle");
200
- t.setAttribute("cx", e), t.setAttribute("cy", n), t.setAttribute("r", R.value * s.scale / 2), t.setAttribute("fill", S.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", ve(re(P.value))), b.value.push(t);
204
- }
205
- E.value = [], A.value = "";
206
- }
207
- M.value = !1;
208
- }
209
- function ce() {
210
- if (b.value.length > 0) {
211
- const l = b.value.pop();
212
- E.value.push(l), o.value && o.value.removeChild(l);
213
- }
214
- }
215
- function de() {
216
- if (E.value.length > 0) {
217
- const l = E.value.pop();
218
- b.value.push(l), o.value && o.value.appendChild(l);
219
- }
220
- }
221
- function fe() {
222
- o.value && (o.value.innerHTML = ""), b.value = [], E.value = [], te();
223
- }
224
- X(h, () => {
225
- s.active && (U(), ne(), h.value === "text" ? o.value.style.cursor = "text" : o.value.style.cursor = W.value);
226
- });
227
- function ne() {
228
- !s.svgRef || !s.active || (h.value === "draw" ? (s.svgRef.addEventListener("mousedown", I), s.svgRef.addEventListener("mousemove", K), s.svgRef.addEventListener("mouseup", B), s.svgRef.addEventListener("mouseleave", B), s.svgRef.addEventListener("touchstart", I, { passive: !1 }), s.svgRef.addEventListener("touchmove", K, { passive: !1 }), s.svgRef.addEventListener("touchend", B)) : h.value === "text" && s.svgRef.addEventListener("mousedown", O), o.value && (o.value.style.pointerEvents = "auto"));
229
- }
230
- function U() {
231
- s.svgRef && (s.svgRef.removeEventListener("mousedown", I), s.svgRef.removeEventListener("mousemove", K), s.svgRef.removeEventListener("mouseup", B), s.svgRef.removeEventListener("mouseleave", B), s.svgRef.removeEventListener("touchstart", I), s.svgRef.removeEventListener("touchmove", K), s.svgRef.removeEventListener("touchend", B), s.svgRef.removeEventListener("mousedown", O), o.value && (o.value.style.pointerEvents = "none"));
232
- }
233
- return X(() => s.active, (l) => {
234
- l ? ne() : U();
235
- }), X(() => s.active, () => {
236
- le(() => {
237
- te();
238
- });
239
- }), pe(() => {
240
- le(() => {
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 = W.value, s.svgRef.appendChild(o.value), U());
242
- });
243
- }), me(() => {
244
- o.value && s.svgRef && (o.value.remove(), U());
245
- }), (l, e) => d.active ? (z(), Y("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
- C("button", {
252
- class: "vue-ui-pen-and-paper-action",
253
- onClick: e[0] || (e[0] = (n) => ue("close")),
254
- style: x({
255
- backgroundColor: d.backgroundColor,
256
- border: `1px solid ${y.value}`
257
- })
258
- }, [
259
- $(T, {
260
- name: "close",
261
- stroke: d.color
262
- }, null, 8, ["stroke"])
263
- ], 4),
264
- C("button", ye, [
265
- $(we, {
266
- value: S.value,
267
- "onUpdate:value": e[1] || (e[1] = (n) => S.value = n),
268
- backgroundColor: d.backgroundColor,
269
- buttonBorderColor: y.value
270
- }, null, 8, ["value", "backgroundColor", "buttonBorderColor"])
271
- ]),
272
- C("button", {
273
- class: G(["vue-ui-pen-and-paper-action", { "vue-ui-pen-and-paper-action-active": h.value === "text" }]),
274
- onClick: e[2] || (e[2] = (n) => h.value = h.value === "text" ? "draw" : "text"),
275
- style: x({
276
- backgroundColor: d.backgroundColor,
277
- border: `1px solid ${y.value}`
278
- })
279
- }, [
280
- $(T, {
281
- name: h.value === "draw" ? "annotator" : "text",
282
- stroke: d.color
283
- }, null, 8, ["name", "stroke"]),
284
- C("div", {
285
- style: x({
286
- position: "absolute",
287
- bottom: "-20px",
288
- color: y.value,
289
- width: "100%",
290
- textAlign: "center",
291
- fontSize: "12px",
292
- fontVariantNumeric: "tabular-nums"
293
- })
294
- }, Ae(he(xe)({
295
- v: h.value === "draw" ? R.value : L.value,
296
- s: "px",
297
- r: 1
298
- })), 5)
299
- ], 6),
300
- C("button", {
301
- class: G(["vue-ui-pen-and-paper-action", { "vue-ui-pen-and-paper-action-disabled": !b.value.length }]),
302
- disabled: !b.value.length,
303
- onClick: ce,
304
- style: x({
305
- backgroundColor: d.backgroundColor,
306
- border: `1px solid ${y.value}`,
307
- marginTop: "20px"
308
- })
309
- }, [
310
- $(T, {
311
- name: "restart",
312
- stroke: d.color
313
- }, null, 8, ["stroke"])
314
- ], 14, ke),
315
- C("button", {
316
- class: G(["vue-ui-pen-and-paper-action", { "vue-ui-pen-and-paper-action-disabled": !E.value.length }]),
317
- onClick: de,
318
- style: x({
319
- backgroundColor: d.backgroundColor,
320
- border: `1px solid ${y.value}`
321
- })
322
- }, [
323
- $(T, {
324
- name: "restart",
325
- stroke: d.color,
326
- style: { transform: "scaleX(-1)" }
327
- }, null, 8, ["stroke"])
328
- ], 6),
329
- C("button", {
330
- class: G(["vue-ui-pen-and-paper-action", { "vue-ui-pen-and-paper-action-disabled": !b.value.length }]),
331
- onClick: fe,
332
- style: x({
333
- backgroundColor: d.backgroundColor,
334
- border: `1px solid ${y.value}`
335
- })
336
- }, [
337
- $(T, {
338
- name: "trash",
339
- stroke: d.color
340
- }, null, 8, ["stroke"])
341
- ], 6),
342
- h.value === "draw" ? ae((z(), Y("input", {
343
- key: 0,
344
- ref: "range",
345
- type: "range",
346
- class: "vertical-range",
347
- min: 0.5,
348
- max: 12,
349
- step: 0.1,
350
- "onUpdate:modelValue": e[3] || (e[3] = (n) => R.value = n),
351
- style: x({ accentColor: d.color })
352
- }, null, 4)), [
353
- [oe, R.value]
354
- ]) : q("", !0),
355
- h.value === "text" ? ae((z(), Y("input", {
356
- key: 1,
357
- ref: "range",
358
- type: "range",
359
- class: "vertical-range",
360
- min: 3,
361
- max: 48,
362
- step: 0.1,
363
- "onUpdate:modelValue": e[4] || (e[4] = (n) => L.value = n),
364
- style: x({ accentColor: d.color })
365
- }, null, 4)), [
366
- [oe, L.value]
367
- ]) : q("", !0)
368
- ], 4)) : q("", !0);
369
- }
370
- };
371
- export {
372
- Be as default
373
- };