vue-data-ui 2.3.3 → 2.3.5

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 (154) hide show
  1. package/README.md +19 -15
  2. package/dist/Arrow-BSOdhAJO.cjs +1 -0
  3. package/dist/Arrow-BjDVSrfA.js +101 -0
  4. package/dist/BaseIcon-BoKtpbrI.cjs +1 -0
  5. package/dist/BaseIcon-vmmfWlyR.js +174 -0
  6. package/dist/DataTable-CaB7GIwQ.js +127 -0
  7. package/dist/DataTable-ssrNbONo.cjs +1 -0
  8. package/dist/Legend-DHpoRTAE.js +62 -0
  9. package/dist/Legend-Dl5IYoxK.cjs +1 -0
  10. package/dist/Shape-CQT4S7N-.js +107 -0
  11. package/dist/Shape-CaF4pvOn.cjs +1 -0
  12. package/dist/Slicer-Bdb1BlrC.js +156 -0
  13. package/dist/Slicer-QC8nTm24.cjs +1 -0
  14. package/dist/Title-BNPZwnkp.js +46 -0
  15. package/dist/Title-Cj_xubjI.cjs +1 -0
  16. package/dist/Tooltip-CdJ5hegk.cjs +1 -0
  17. package/dist/Tooltip-ZnJAz6dl.js +94 -0
  18. package/dist/_plugin-vue_export-helper-BHFhmbuH.cjs +1 -0
  19. package/dist/_plugin-vue_export-helper-CHgC5LLL.js +9 -0
  20. package/dist/documentation/installation.md +14 -13
  21. package/dist/html2canvas.esm-BA_v9SIU.cjs +22 -0
  22. package/dist/html2canvas.esm-d2sM-0Wm.js +4870 -0
  23. package/dist/index-BMCvLyab.js +10369 -0
  24. package/dist/index-BkomIE9L.cjs +4 -0
  25. package/dist/{index.es-ypwniJN8.js → index.es-YufTdp0y.js} +1 -1
  26. package/dist/{index.es-Dnua3tHc.cjs → index.es-uyeSCnWE.cjs} +1 -1
  27. package/dist/jspdf.es.min-C660YX78.js +8038 -0
  28. package/dist/jspdf.es.min-DLYY9DTT.cjs +243 -0
  29. package/dist/pdf-97UbtKC2.js +44 -0
  30. package/dist/pdf-Cz3729tZ.cjs +1 -0
  31. package/dist/style.css +1 -1
  32. package/dist/types/vue-data-ui.d.cts +105 -5
  33. package/dist/types/vue-data-ui.d.ts +105 -5
  34. package/dist/useNestedProp-BMxXyPbW.cjs +1 -0
  35. package/dist/useNestedProp-CkP8xhG_.js +13 -0
  36. package/dist/usePrinter-BuuBz5JR.js +513 -0
  37. package/dist/usePrinter-r6uHYEcR.cjs +1 -0
  38. package/dist/useResponsive-B3TrDDIG.cjs +1 -0
  39. package/dist/useResponsive-NZB-WLRF.js +187 -0
  40. package/dist/vue-data-ui-Bc5U1cOP.cjs +9 -0
  41. package/dist/vue-data-ui-DxeO0iaC.js +254 -0
  42. package/dist/vue-data-ui.cjs +1 -1
  43. package/dist/vue-data-ui.js +61 -59
  44. package/dist/vue-ui-3d-bar-32wM0tiX.js +1085 -0
  45. package/dist/vue-ui-3d-bar-CgB0fLQT.cjs +19 -0
  46. package/dist/vue-ui-accordion-CLlVxx3Q.js +77 -0
  47. package/dist/vue-ui-accordion-SXsobrUt.cjs +1 -0
  48. package/dist/vue-ui-age-pyramid-D_CY99xF.js +596 -0
  49. package/dist/vue-ui-age-pyramid-DqiwcOIr.cjs +1 -0
  50. package/dist/vue-ui-annotator-DvP-IxDm.js +2177 -0
  51. package/dist/vue-ui-annotator-mntqd3q_.cjs +371 -0
  52. package/dist/vue-ui-candlestick-C-5u3i-1.js +657 -0
  53. package/dist/vue-ui-candlestick-C_TvUQvH.cjs +2 -0
  54. package/dist/vue-ui-carousel-table-BCePqkuz.cjs +1 -0
  55. package/dist/vue-ui-carousel-table-CAqhsLVx.js +304 -0
  56. package/dist/vue-ui-chestnut-DhWlw2MD.cjs +6 -0
  57. package/dist/vue-ui-chestnut-DylSfYMB.js +1051 -0
  58. package/dist/vue-ui-cursor-B04HJQVl.cjs +1 -0
  59. package/dist/vue-ui-cursor-DTYEMgbU.js +229 -0
  60. package/dist/vue-ui-dashboard-Bd0-cmSZ.js +232 -0
  61. package/dist/vue-ui-dashboard-DFIYwP1s.cjs +1 -0
  62. package/dist/vue-ui-digits-CW5qNMIk.js +153 -0
  63. package/dist/vue-ui-digits-Ced5mBJZ.cjs +1 -0
  64. package/dist/vue-ui-donut-DIhhgvWp.cjs +1 -0
  65. package/dist/vue-ui-donut-EeVmrVJs.js +743 -0
  66. package/dist/vue-ui-donut-evolution-BN08Y2hy.js +799 -0
  67. package/dist/vue-ui-donut-evolution-Ct6KAzs-.cjs +1 -0
  68. package/dist/vue-ui-dumbbell-BMlxS1Nq.js +624 -0
  69. package/dist/vue-ui-dumbbell-pextarqH.cjs +9 -0
  70. package/dist/vue-ui-flow-BXVsbmyb.cjs +1 -0
  71. package/dist/vue-ui-flow-CHmkgfyb.js +454 -0
  72. package/dist/vue-ui-galaxy-D4xyd-J1.cjs +1 -0
  73. package/dist/vue-ui-galaxy-kiVOZOBz.js +485 -0
  74. package/dist/vue-ui-gauge-BcO-z97J.js +466 -0
  75. package/dist/vue-ui-gauge-DPFBsbFj.cjs +1 -0
  76. package/dist/vue-ui-heatmap-DBOKYaJz.cjs +1 -0
  77. package/dist/vue-ui-heatmap-DD-Bzddj.js +598 -0
  78. package/dist/vue-ui-kpi-BEgf5yDv.cjs +1 -0
  79. package/dist/vue-ui-kpi-BS0o7zb9.js +54 -0
  80. package/dist/vue-ui-mini-loader-Bm5EJxtG.cjs +1 -0
  81. package/dist/vue-ui-mini-loader-DJEvG6ju.js +131 -0
  82. package/dist/vue-ui-molecule-DdwnFEBJ.js +750 -0
  83. package/dist/vue-ui-molecule-DzUqcaxd.cjs +1 -0
  84. package/dist/vue-ui-mood-radar-B9Gczs_Z.js +548 -0
  85. package/dist/vue-ui-mood-radar-DbB7m4Ku.cjs +1 -0
  86. package/dist/vue-ui-nested-donuts-BSINf8hd.cjs +16 -0
  87. package/dist/vue-ui-nested-donuts-CVQ1CaXo.js +771 -0
  88. package/dist/vue-ui-onion-D3-6Tv4u.cjs +1 -0
  89. package/dist/vue-ui-onion-Ut75t7hB.js +554 -0
  90. package/dist/vue-ui-parallel-coordinate-plot-Bjo09ZTX.js +651 -0
  91. package/dist/vue-ui-parallel-coordinate-plot-CJGkoIgN.cjs +8 -0
  92. package/dist/vue-ui-quadrant-CzCvejGn.cjs +1 -0
  93. package/dist/vue-ui-quadrant-Du9PKvlO.js +1178 -0
  94. package/dist/vue-ui-quick-chart-BsxsPbjz.cjs +13 -0
  95. package/dist/vue-ui-quick-chart-u0cPmD3q.js +1310 -0
  96. package/dist/vue-ui-radar-CBrpuE5r.js +614 -0
  97. package/dist/vue-ui-radar-DIpCrj1h.cjs +1 -0
  98. package/dist/vue-ui-rating-CaeGGlCw.js +271 -0
  99. package/dist/vue-ui-rating-D8fJC8Yt.cjs +1 -0
  100. package/dist/vue-ui-relation-circle-5DNf880s.js +304 -0
  101. package/dist/vue-ui-relation-circle-Ky3nPk6S.cjs +1 -0
  102. package/dist/vue-ui-rings-CffZ4T2S.cjs +1 -0
  103. package/dist/vue-ui-rings-IE3IdNRF.js +510 -0
  104. package/dist/vue-ui-scatter-C4GCZm0V.js +874 -0
  105. package/dist/vue-ui-scatter-TsX5dW9l.cjs +1 -0
  106. package/dist/vue-ui-screenshot-Bl3oooKI.js +160 -0
  107. package/dist/vue-ui-screenshot-Bzpg6yof.cjs +3 -0
  108. package/dist/vue-ui-skeleton-BisWX1sO.js +2064 -0
  109. package/dist/vue-ui-skeleton-JmGp11-u.cjs +41 -0
  110. package/dist/vue-ui-smiley-BhSrt9f-.cjs +2 -0
  111. package/dist/vue-ui-smiley-Sth2pqG1.js +763 -0
  112. package/dist/vue-ui-spark-trend-C8NSz4l8.cjs +1 -0
  113. package/dist/vue-ui-spark-trend-DAqO0TW2.js +246 -0
  114. package/dist/vue-ui-sparkbar-B0zX7NU7.js +242 -0
  115. package/dist/vue-ui-sparkbar-hL1Q6ObK.cjs +1 -0
  116. package/dist/vue-ui-sparkgauge-CWR8zJnU.js +157 -0
  117. package/dist/vue-ui-sparkgauge-tbVqaLCK.cjs +1 -0
  118. package/dist/vue-ui-sparkhistogram-Dv-lml4g.cjs +1 -0
  119. package/dist/vue-ui-sparkhistogram-DxqCtDpw.js +244 -0
  120. package/dist/vue-ui-sparkline-B6pvaBY_.cjs +1 -0
  121. package/dist/vue-ui-sparkline-BpL1jn7F.js +333 -0
  122. package/dist/vue-ui-sparkstackbar-BzbuBNIV.js +244 -0
  123. package/dist/vue-ui-sparkstackbar-CQ2TEi4p.cjs +1 -0
  124. package/dist/vue-ui-strip-plot-DCC6F4VM.cjs +1 -0
  125. package/dist/vue-ui-strip-plot-DCcbD6UE.js +618 -0
  126. package/dist/vue-ui-table-CFqIWfxl.js +1430 -0
  127. package/dist/vue-ui-table-CseaFWgX.cjs +14 -0
  128. package/dist/vue-ui-table-heatmap-Bwut-V1D.cjs +1 -0
  129. package/dist/vue-ui-table-heatmap-Bz8KYDxr.js +237 -0
  130. package/dist/vue-ui-table-sparkline-CJBU3y8-.cjs +1 -0
  131. package/dist/vue-ui-table-sparkline-z29ND2lq.js +420 -0
  132. package/dist/vue-ui-thermometer-BNAITzJa.js +385 -0
  133. package/dist/vue-ui-thermometer-DM2IKhqN.cjs +1 -0
  134. package/dist/vue-ui-timer-DLfXuW8T.cjs +64 -0
  135. package/dist/vue-ui-timer-DV6lQVHU.js +453 -0
  136. package/dist/vue-ui-tiremarks-B1bd1jPf.cjs +1 -0
  137. package/dist/vue-ui-tiremarks-WyQPg7yo.js +249 -0
  138. package/dist/vue-ui-treemap-BZGmoDHb.cjs +1 -0
  139. package/dist/vue-ui-treemap-DKmBhzV-.js +722 -0
  140. package/dist/vue-ui-vertical-bar-Bi-0rRN3.cjs +4 -0
  141. package/dist/vue-ui-vertical-bar-C-ySfrhJ.js +737 -0
  142. package/dist/vue-ui-waffle-CGRWu-da.js +638 -0
  143. package/dist/vue-ui-waffle-VLYkR-YZ.cjs +1 -0
  144. package/dist/vue-ui-wheel-D2q5vy5V.cjs +1 -0
  145. package/dist/vue-ui-wheel-Pj9OPk9f.js +227 -0
  146. package/dist/vue-ui-word-cloud-8Vr-jo1p.js +346 -0
  147. package/dist/vue-ui-word-cloud-Ba4BjatU.cjs +1 -0
  148. package/dist/vue-ui-xy-C4QW5Lfl.cjs +3 -0
  149. package/dist/vue-ui-xy-canvas-Be-Da_0x.cjs +9 -0
  150. package/dist/vue-ui-xy-canvas-DnLWrf0e.js +1006 -0
  151. package/dist/vue-ui-xy-qToggEfh.js +2064 -0
  152. package/package.json +1 -1
  153. package/dist/index-BcMihqI4.cjs +0 -843
  154. package/dist/index-C7FeCQ7K.js +0 -57303
@@ -0,0 +1,157 @@
1
+ import { computed as s, onMounted as _, ref as m, watch as F, openBlock as n, createElementBlock as r, normalizeStyle as v, toDisplayString as y, createCommentVNode as c, unref as $, createElementVNode as i, normalizeClass as O, createBlock as j } from "vue";
2
+ import { u as B, o as E, e as w, g as D, c as G, t as I, H as U, X as V, f as q } from "./index-BMCvLyab.js";
3
+ import { u as C } from "./useNestedProp-CkP8xhG_.js";
4
+ import H from "./vue-ui-skeleton-BisWX1sO.js";
5
+ const P = ["xmlns", "viewBox"], T = ["id"], X = ["stop-color"], R = ["stop-color"], Y = ["d", "stroke", "stroke-linecap"], J = ["d", "stroke", "stroke-linecap", "stroke-dashoffset"], K = ["x", "y", "font-size", "fill", "font-weight"], te = {
6
+ __name: "vue-ui-sparkgauge",
7
+ props: {
8
+ config: {
9
+ type: Object,
10
+ default() {
11
+ return {};
12
+ }
13
+ },
14
+ dataset: {
15
+ type: Object,
16
+ default() {
17
+ return {};
18
+ }
19
+ }
20
+ },
21
+ setup(L) {
22
+ const t = L, { vue_ui_sparkgauge: A } = B(), g = s(() => !!t.dataset && Object.keys(t.dataset).length);
23
+ _(() => {
24
+ E(t.dataset) ? w({
25
+ componentName: "VueUiSparkgauge",
26
+ type: "dataset"
27
+ }) : D({
28
+ datasetObject: t.dataset,
29
+ requiredAttributes: ["value", "min", "max"]
30
+ }).forEach((l) => {
31
+ w({
32
+ componentName: "VueUiSparkgauge",
33
+ type: "datasetAttribute",
34
+ property: l
35
+ });
36
+ });
37
+ });
38
+ const p = m(G()), e = s(() => {
39
+ const l = C({
40
+ userConfig: t.config,
41
+ defaultConfig: A
42
+ });
43
+ return l.theme ? {
44
+ ...C({
45
+ userConfig: I.vue_ui_sparkgauge[l.theme] || t.config,
46
+ defaultConfig: l
47
+ })
48
+ } : l;
49
+ }), u = s(() => ({
50
+ height: e.value.style.height,
51
+ width: 128,
52
+ base: e.value.style.basePosition
53
+ })), a = s(() => {
54
+ const l = t.dataset.min ?? 0, f = t.dataset.max ?? 0, N = f - l;
55
+ return {
56
+ min: l,
57
+ max: f,
58
+ diff: N
59
+ };
60
+ }), o = m(e.value.style.animation.show ? a.value.min : t.dataset.value);
61
+ F(() => t.dataset.value, () => {
62
+ o.value = m(e.value.style.animation.show ? a.value.min : t.dataset.value), b();
63
+ });
64
+ const h = s(() => o.value > a.value.max ? a.value.max : o.value < a.value.min ? a.value.min : o.value), S = s(() => a.value.diff / e.value.style.animation.speedMs);
65
+ _(() => {
66
+ b();
67
+ });
68
+ function b() {
69
+ function l() {
70
+ o.value += S.value, o.value < t.dataset.value ? requestAnimationFrame(l) : o.value = t.dataset.value;
71
+ }
72
+ e.value.style.animation.show && (o.value = a.value.min, l());
73
+ }
74
+ const d = s(() => t.dataset.title ?? ""), k = s(() => o.value >= 0 ? (h.value - a.value.min) / a.value.diff : (Math.abs(a.value.min) - Math.abs(h.value)) / a.value.diff), x = s(() => U(e.value.style.colors.min, e.value.style.colors.max, a.value.min, a.value.max, o.value)), z = s(() => e.value.style.dataLabel.autoColor ? x.value : e.value.style.dataLabel.color), M = s(() => e.value.style.track.autoColor ? x.value : e.value.style.track.color);
75
+ return (l, f) => (n(), r("div", {
76
+ style: v(`font-family:${e.value.style.fontFamily};width: 100%; background:${e.value.style.background}`)
77
+ }, [
78
+ e.value.style.title.show && d.value && e.value.style.title.position === "top" ? (n(), r("div", {
79
+ key: 0,
80
+ class: "vue-data-ui-sparkgauge-label",
81
+ style: v(`font-size:${e.value.style.title.fontSize}px;text-align:${e.value.style.title.textAlign};font-weight:${e.value.style.title.bold ? "bold" : "normal"};color:${e.value.style.title.color}`)
82
+ }, y(d.value), 5)) : c("", !0),
83
+ g.value ? (n(), r("svg", {
84
+ key: 1,
85
+ xmlns: $(V),
86
+ viewBox: `0 0 ${u.value.width} ${u.value.height}`,
87
+ style: v(`overflow: visible; background:${e.value.style.background}; width:100%;`)
88
+ }, [
89
+ i("defs", null, [
90
+ i("linearGradient", {
91
+ id: `gradient_${p.value}`,
92
+ x1: "-10%",
93
+ y1: "100%",
94
+ x2: "110%",
95
+ y2: "100%"
96
+ }, [
97
+ i("stop", {
98
+ offset: "0%",
99
+ "stop-color": e.value.style.colors.min
100
+ }, null, 8, X),
101
+ i("stop", {
102
+ offset: "100%",
103
+ "stop-color": e.value.style.colors.max
104
+ }, null, 8, R)
105
+ ], 8, T)
106
+ ]),
107
+ i("path", {
108
+ d: `M10 ${u.value.base} A 1 1 0 1 1 118 ${u.value.base}`,
109
+ stroke: e.value.style.gutter.color,
110
+ "stroke-width": 8,
111
+ "stroke-linecap": e.value.style.gutter.strokeLinecap,
112
+ fill: "none"
113
+ }, null, 8, Y),
114
+ k.value !== 0 ? (n(), r("path", {
115
+ key: 0,
116
+ d: `M10 ${u.value.base} A 1 1 0 1 1 118 ${u.value.base}`,
117
+ stroke: e.value.style.colors.showGradient ? `url(#gradient_${p.value})` : M.value,
118
+ "stroke-width": 8,
119
+ "stroke-linecap": e.value.style.track.strokeLinecap,
120
+ fill: "none",
121
+ "stroke-dasharray": 169.5,
122
+ "stroke-dashoffset": 169.5 - 169.5 * k.value,
123
+ class: O({ "vue-ui-sparkgauge-track": e.value.style.animation.show }),
124
+ style: v(e.value.style.animation.show ? `animation: vue-ui-sparkgauge-animation ${e.value.style.animation.speedMs}ms ease-in;` : "")
125
+ }, null, 14, J)) : c("", !0),
126
+ i("text", {
127
+ "text-anchor": "middle",
128
+ x: u.value.width / 2,
129
+ y: u.value.base + 6 + e.value.style.dataLabel.offsetY,
130
+ "font-size": e.value.style.dataLabel.fontSize,
131
+ fill: z.value,
132
+ "font-weight": e.value.style.dataLabel.bold ? "bold" : "normal"
133
+ }, y($(q)({ p: e.value.style.dataLabel.prefix, v: o.value, s: e.value.style.dataLabel.suffix, r: e.value.style.dataLabel.rounding })), 9, K)
134
+ ], 12, P)) : c("", !0),
135
+ g.value ? c("", !0) : (n(), j(H, {
136
+ key: 2,
137
+ config: {
138
+ type: "gauge",
139
+ style: {
140
+ backgroundColor: e.value.style.background,
141
+ gauge: {
142
+ color: "#CCCCCC"
143
+ }
144
+ }
145
+ }
146
+ }, null, 8, ["config"])),
147
+ e.value.style.title.show && d.value && e.value.style.title.position === "bottom" ? (n(), r("div", {
148
+ key: 3,
149
+ class: "vue-data-ui-sparkgauge-label",
150
+ style: v(`font-size:${e.value.style.title.fontSize}px;text-align:${e.value.style.title.textAlign};font-weight:${e.value.style.title.bold ? "bold" : "normal"};font-weight:${e.value.style.title.bold ? "bold" : "normal"};color:${e.value.style.title.color}`)
151
+ }, y(d.value), 5)) : c("", !0)
152
+ ], 4));
153
+ }
154
+ };
155
+ export {
156
+ te as default
157
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),u=require("./index-BkomIE9L.cjs"),p=require("./useNestedProp-BMxXyPbW.cjs"),C=require("./vue-ui-skeleton-JmGp11-u.cjs"),$=["xmlns","viewBox"],w=["id"],N=["stop-color"],S=["stop-color"],L=["d","stroke","stroke-linecap"],B=["d","stroke","stroke-linecap","stroke-dashoffset"],E=["x","y","font-size","fill","font-weight"],z={__name:"vue-ui-sparkgauge",props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{}}}},setup(g){const a=g,{vue_ui_sparkgauge:k}=u.useConfig(),c=e.computed(()=>!!a.dataset&&Object.keys(a.dataset).length);e.onMounted(()=>{u.objectIsEmpty(a.dataset)?u.error({componentName:"VueUiSparkgauge",type:"dataset"}):u.getMissingDatasetAttributes({datasetObject:a.dataset,requiredAttributes:["value","min","max"]}).forEach(o=>{u.error({componentName:"VueUiSparkgauge",type:"datasetAttribute",property:o})})});const d=e.ref(u.createUid()),t=e.computed(()=>{const o=p.useNestedProp({userConfig:a.config,defaultConfig:k});return o.theme?{...p.useNestedProp({userConfig:u.themes.vue_ui_sparkgauge[o.theme]||a.config,defaultConfig:o})}:o}),n=e.computed(()=>({height:t.value.style.height,width:128,base:t.value.style.basePosition})),l=e.computed(()=>{const o=a.dataset.min??0,i=a.dataset.max??0,_=i-o;return{min:o,max:i,diff:_}}),s=e.ref(t.value.style.animation.show?l.value.min:a.dataset.value);e.watch(()=>a.dataset.value,()=>{s.value=e.ref(t.value.style.animation.show?l.value.min:a.dataset.value),m()});const v=e.computed(()=>s.value>l.value.max?l.value.max:s.value<l.value.min?l.value.min:s.value),b=e.computed(()=>l.value.diff/t.value.style.animation.speedMs);e.onMounted(()=>{m()});function m(){function o(){s.value+=b.value,s.value<a.dataset.value?requestAnimationFrame(o):s.value=a.dataset.value}t.value.style.animation.show&&(s.value=l.value.min,o())}const r=e.computed(()=>a.dataset.title??""),y=e.computed(()=>s.value>=0?(v.value-l.value.min)/l.value.diff:(Math.abs(l.value.min)-Math.abs(v.value))/l.value.diff),f=e.computed(()=>u.interpolateColorHex(t.value.style.colors.min,t.value.style.colors.max,l.value.min,l.value.max,s.value)),h=e.computed(()=>t.value.style.dataLabel.autoColor?f.value:t.value.style.dataLabel.color),x=e.computed(()=>t.value.style.track.autoColor?f.value:t.value.style.track.color);return(o,i)=>(e.openBlock(),e.createElementBlock("div",{style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};width: 100%; background:${t.value.style.background}`)},[t.value.style.title.show&&r.value&&t.value.style.title.position==="top"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"vue-data-ui-sparkgauge-label",style:e.normalizeStyle(`font-size:${t.value.style.title.fontSize}px;text-align:${t.value.style.title.textAlign};font-weight:${t.value.style.title.bold?"bold":"normal"};color:${t.value.style.title.color}`)},e.toDisplayString(r.value),5)):e.createCommentVNode("",!0),c.value?(e.openBlock(),e.createElementBlock("svg",{key:1,xmlns:e.unref(u.XMLNS),viewBox:`0 0 ${n.value.width} ${n.value.height}`,style:e.normalizeStyle(`overflow: visible; background:${t.value.style.background}; width:100%;`)},[e.createElementVNode("defs",null,[e.createElementVNode("linearGradient",{id:`gradient_${d.value}`,x1:"-10%",y1:"100%",x2:"110%",y2:"100%"},[e.createElementVNode("stop",{offset:"0%","stop-color":t.value.style.colors.min},null,8,N),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.colors.max},null,8,S)],8,w)]),e.createElementVNode("path",{d:`M10 ${n.value.base} A 1 1 0 1 1 118 ${n.value.base}`,stroke:t.value.style.gutter.color,"stroke-width":8,"stroke-linecap":t.value.style.gutter.strokeLinecap,fill:"none"},null,8,L),y.value!==0?(e.openBlock(),e.createElementBlock("path",{key:0,d:`M10 ${n.value.base} A 1 1 0 1 1 118 ${n.value.base}`,stroke:t.value.style.colors.showGradient?`url(#gradient_${d.value})`:x.value,"stroke-width":8,"stroke-linecap":t.value.style.track.strokeLinecap,fill:"none","stroke-dasharray":169.5,"stroke-dashoffset":169.5-169.5*y.value,class:e.normalizeClass({"vue-ui-sparkgauge-track":t.value.style.animation.show}),style:e.normalizeStyle(t.value.style.animation.show?`animation: vue-ui-sparkgauge-animation ${t.value.style.animation.speedMs}ms ease-in;`:"")},null,14,B)):e.createCommentVNode("",!0),e.createElementVNode("text",{"text-anchor":"middle",x:n.value.width/2,y:n.value.base+6+t.value.style.dataLabel.offsetY,"font-size":t.value.style.dataLabel.fontSize,fill:h.value,"font-weight":t.value.style.dataLabel.bold?"bold":"normal"},e.toDisplayString(e.unref(u.dataLabel)({p:t.value.style.dataLabel.prefix,v:s.value,s:t.value.style.dataLabel.suffix,r:t.value.style.dataLabel.rounding})),9,E)],12,$)):e.createCommentVNode("",!0),c.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(C.default,{key:2,config:{type:"gauge",style:{backgroundColor:t.value.style.background,gauge:{color:"#CCCCCC"}}}},null,8,["config"])),t.value.style.title.show&&r.value&&t.value.style.title.position==="bottom"?(e.openBlock(),e.createElementBlock("div",{key:3,class:"vue-data-ui-sparkgauge-label",style:e.normalizeStyle(`font-size:${t.value.style.title.fontSize}px;text-align:${t.value.style.title.textAlign};font-weight:${t.value.style.title.bold?"bold":"normal"};font-weight:${t.value.style.title.bold?"bold":"normal"};color:${t.value.style.title.color}`)},e.toDisplayString(r.value),5)):e.createCommentVNode("",!0)],4))}};exports.default=z;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),n=require("./index-BkomIE9L.cjs"),k=require("./useNestedProp-BMxXyPbW.cjs"),V=require("./Shape-CaF4pvOn.cjs"),D=require("./vue-ui-skeleton-JmGp11-u.cjs"),F=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),M={key:0},A={key:1},H=["xmlns","viewBox"],q=["id"],I=["stop-color"],U=["stop-color"],W=["id"],O=["stop-color"],j=["stop-color"],P={key:0},T=["x","y","height","width","fill","stroke","stroke-width","rx"],X={key:1},Y=["x","y","font-size","font-weight","fill"],G=["x","y","font-size","fill"],R=["x","y","font-size","fill"],J=["height","width","x","onMouseover","stroke","stroke-width","rx","stroke-dasharray","onClick"],K={__name:"vue-ui-sparkhistogram",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectDatapoint"],setup(b,{emit:x}){const u=b;e.useCssVars(o=>({"34a5ebe4":S.value}));const{vue_ui_sparkhistogram:_}=n.useConfig(),f=e.computed(()=>!!u.dataset&&u.dataset.length);e.onMounted(()=>{n.objectIsEmpty(u.dataset)?n.error({componentName:"VueUiSparkHistogram",type:"dataset"}):u.dataset.forEach((o,s)=>{n.getMissingDatasetAttributes({datasetObject:o,requiredAttributes:["value"]}).forEach(l=>{n.error({componentName:"VueUiSparkHistogram",type:"datasetSerieAttribute",property:l,index:s})})})});const v=e.ref(n.createUid()),t=e.computed(()=>{const o=k.useNestedProp({userConfig:u.config,defaultConfig:_});return o.theme?{...k.useNestedProp({userConfig:n.themes.vue_ui_sparkhistogram[o.theme]||u.config,defaultConfig:o})}:o}),c=e.computed(()=>{const o=t.value.style.layout.height,s=t.value.style.layout.width,l=t.value.style.layout.padding.top,a=o-t.value.style.layout.padding.bottom,d=t.value.style.layout.padding.left,y=s-t.value.style.layout.padding.right,p=l+(o-l-t.value.style.layout.padding.bottom)/2,g=o-t.value.style.layout.padding.top-t.value.style.layout.padding.bottom,m=s-t.value.style.layout.padding.left-t.value.style.layout.padding.right;return{bottom:a,centerY:p,drawingHeight:g,drawingWidth:m,height:o,left:d,right:y,top:l,width:s}}),B=e.computed(()=>Math.max(...u.dataset.map(o=>Math.abs(o.value||0))));function $(o){return Math.abs(o)/B.value}const i=e.computed(()=>u.dataset.map((o,s)=>{const l=$(o.value||0),a=c.value.drawingHeight*l,d=c.value.drawingWidth/u.dataset.length,y=d*(t.value.style.bars.gap/100),p=d-y,g=c.value.centerY-a/2,m=c.value.left+(y/2+s*d),w=c.value.left+s*d,h=typeof o.intensity>"u"?100:Math.round(o.intensity*100),N=o.value>=0?`${t.value.style.bars.colors.positive}${n.opacity[h]}`:`${t.value.style.bars.colors.negative}${n.opacity[h]}`,C=o.value>=0?t.value.style.bars.colors.positive:t.value.style.bars.colors.negative,L=o.value>=0?`url(#gradient_positive_${s}_${v.value})`:`url(#gradient_negative_${s}_${v.value})`,z=m+p/2;return{...o,color:N,gradient:L,height:a,intensity:h,proportion:l,stroke:C,textAnchor:z,trapX:w,unitWidth:d,width:p,x:m,y:g}})),r=e.ref(null);function E(o,s){x("selectDatapoint",{datapoint:o,index:s})}const S=e.computed(()=>`${t.value.style.animation.speedMs}ms`);return(o,s)=>(e.openBlock(),e.createElementBlock("div",{style:e.normalizeStyle(`width:100%;background:${t.value.style.backgroundColor};font-family:${t.value.style.fontFamily}`),onMouseleave:s[1]||(s[1]=l=>r.value=null)},[t.value.style.title.text?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle(`width:calc(100% - 12px);background:${t.value.style.backgroundColor};margin:0 auto;margin:${t.value.style.title.margin};padding: 0 6px;text-align:${t.value.style.title.textAlign}`)},[e.createElementVNode("div",{style:e.normalizeStyle(`font-size:${t.value.style.title.fontSize}px;color:${t.value.style.title.color};font-weight:${t.value.style.title.bold?"bold":"normal"}`)},[e.createTextVNode(e.toDisplayString(t.value.style.title.text)+" ",1),r.value!==null?(e.openBlock(),e.createElementBlock("span",M,"- "+e.toDisplayString(i.value[r.value].timeLabel||"")+" "+e.toDisplayString(t.value.style.labels.value.prefix)+e.toDisplayString(isNaN(i.value[r.value].value)?"":": "+Number(i.value[r.value].value.toFixed(t.value.style.labels.value.rounding)).toLocaleString())+e.toDisplayString(t.value.style.labels.value.suffix),1)):e.createCommentVNode("",!0),e.createTextVNode(),![void 0,null].includes(r.value)&&![null,void 0].includes(i.value[r.value].valueLabel)?(e.openBlock(),e.createElementBlock("span",A,"("+e.toDisplayString(i.value[r.value].valueLabel||0)+")",1)):e.createCommentVNode("",!0)],4),t.value.style.title.subtitle.text?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle(`font-size:${t.value.style.title.subtitle.fontSize}px;color:${t.value.style.title.subtitle.color};font-weight:${t.value.style.title.subtitle.bold?"bold":"normal"}`)},e.toDisplayString(t.value.style.title.subtitle.text),5)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),f.value?(e.openBlock(),e.createElementBlock("svg",{key:1,xmlns:e.unref(n.XMLNS),viewBox:`0 0 ${c.value.width} ${c.value.height}`,style:{overflow:"visible"}},[e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,(l,a)=>(e.openBlock(),e.createElementBlock("radialGradient",{id:`gradient_positive_${a}_${v.value}`,cy:"50%",cx:"50%",r:"50%",fx:"50%",fy:"50%"},[e.createElementVNode("stop",{offset:"0%","stop-color":`${e.unref(n.shiftHue)(t.value.style.bars.colors.positive,.05)}${e.unref(n.opacity)[l.intensity]}`},null,8,I),e.createElementVNode("stop",{offset:"100%","stop-color":`${t.value.style.bars.colors.positive}${e.unref(n.opacity)[l.intensity]}`},null,8,U)],8,q))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,(l,a)=>(e.openBlock(),e.createElementBlock("radialGradient",{id:`gradient_negative_${a}_${v.value}`,cy:"50%",cx:"50%",r:"50%",fx:"50%",fy:"50%"},[e.createElementVNode("stop",{offset:"0%","stop-color":`${e.unref(n.shiftHue)(t.value.style.bars.colors.negative,.05)}${e.unref(n.opacity)[l.intensity]}`},null,8,O),e.createElementVNode("stop",{offset:"100%","stop-color":`${t.value.style.bars.colors.negative}${e.unref(n.opacity)[l.intensity]}`},null,8,j)],8,W))),256))]),!t.value.style.bars.shape||t.value.style.bars.shape==="square"?(e.openBlock(),e.createElementBlock("g",P,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,(l,a)=>(e.openBlock(),e.createElementBlock("rect",{x:l.x,y:l.y,height:l.height,width:l.width,fill:t.value.style.bars.colors.gradient.show?l.gradient:l.color,stroke:l.stroke,"stroke-width":t.value.style.bars.strokeWidth,rx:`${t.value.style.bars.borderRadius*l.proportion/12}%`,class:e.normalizeClass({"vue-ui-sparkhistogram-shape":t.value.style.animation.show})},null,10,T))),256))])):(e.openBlock(),e.createElementBlock("g",X,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,(l,a)=>(e.openBlock(),e.createBlock(V._sfc_main,{plot:{x:l.x+l.width/2,y:l.y+l.height/2},color:t.value.style.bars.colors.gradient.show?l.gradient:l.color,shape:t.value.style.bars.shape,radius:l.height*.4,class:e.normalizeClass({"vue-ui-sparkhistogram-shape":t.value.style.animation.show})},null,8,["plot","color","shape","radius","class"]))),256))])),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,(l,a)=>(e.openBlock(),e.createElementBlock("text",{"text-anchor":"middle",x:l.textAnchor,y:l.y-t.value.style.labels.value.fontSize/3+t.value.style.labels.value.offsetY,"font-size":t.value.style.labels.value.fontSize,"font-weight":t.value.style.labels.value.bold?"bold":"normal",fill:t.value.style.labels.value.color},e.toDisplayString(t.value.style.labels.value.prefix)+e.toDisplayString(isNaN(l.value)?"":Number(l.value.toFixed(t.value.style.labels.value.rounding)).toLocaleString())+e.toDisplayString(t.value.style.labels.value.suffix),9,Y))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,(l,a)=>(e.openBlock(),e.createElementBlock("g",null,[l.valueLabel?(e.openBlock(),e.createElementBlock("text",{key:0,x:l.textAnchor,y:l.y+l.height+t.value.style.labels.valueLabel.fontSize,"font-size":t.value.style.labels.valueLabel.fontSize,"text-anchor":"middle",fill:t.value.style.labels.valueLabel.color},e.toDisplayString(l.valueLabel),9,G)):e.createCommentVNode("",!0)]))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,(l,a)=>(e.openBlock(),e.createElementBlock("g",null,[l.timeLabel?(e.openBlock(),e.createElementBlock("text",{key:0,x:l.textAnchor,y:c.value.height-t.value.style.labels.timeLabel.fontSize/2,"font-size":t.value.style.labels.timeLabel.fontSize,fill:t.value.style.labels.timeLabel.color,"text-anchor":"middle"},e.toDisplayString(l.timeLabel),9,R)):e.createCommentVNode("",!0)]))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,(l,a)=>(e.openBlock(),e.createElementBlock("g",null,[e.createElementVNode("rect",{height:c.value.height,width:l.unitWidth,fill:"transparent",x:l.trapX,y:0,onMouseover:d=>r.value=a,onMouseleave:s[0]||(s[0]=d=>r.value=null),stroke:r.value!==null&&r.value===a?t.value.style.selector.stroke:"","stroke-width":r.value!==null&&r.value===a?t.value.style.selector.strokeWidth:0,rx:t.value.style.selector.borderRadius,"stroke-dasharray":t.value.style.selector.strokeDasharray,onClick:()=>E(l,a)},null,40,J)]))),256))],8,H)):e.createCommentVNode("",!0),f.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(D.default,{key:2,config:{type:"sparkHistogram",style:{backgroundColor:t.value.style.backgroundColor,sparkHistogram:{color:"#CCCCCC"}}}},null,8,["config"]))],36))}},Q=F._export_sfc(K,[["__scopeId","data-v-7aed7086"]]);exports.default=Q;
@@ -0,0 +1,244 @@
1
+ import { useCssVars as R, computed as b, onMounted as T, ref as S, openBlock as a, createElementBlock as s, normalizeStyle as w, createElementVNode as f, createTextVNode as N, toDisplayString as r, createCommentVNode as c, unref as p, Fragment as h, renderList as g, normalizeClass as M, createBlock as A } from "vue";
2
+ import { u as P, o as J, e as D, g as K, c as Q, t as Z, r as m, X as ee, s as F } from "./index-BMCvLyab.js";
3
+ import { u as H } from "./useNestedProp-CkP8xhG_.js";
4
+ import { _ as te } from "./Shape-CQT4S7N-.js";
5
+ import le from "./vue-ui-skeleton-BisWX1sO.js";
6
+ import { _ as ae } from "./_plugin-vue_export-helper-CHgC5LLL.js";
7
+ const se = { key: 0 }, oe = { key: 1 }, ue = ["xmlns", "viewBox"], ie = ["id"], ne = ["stop-color"], re = ["stop-color"], ve = ["id"], de = ["stop-color"], ye = ["stop-color"], ce = { key: 0 }, he = ["x", "y", "height", "width", "fill", "stroke", "stroke-width", "rx"], ge = { key: 1 }, fe = ["x", "y", "font-size", "font-weight", "fill"], pe = ["x", "y", "font-size", "fill"], be = ["x", "y", "font-size", "fill"], me = ["height", "width", "x", "onMouseover", "stroke", "stroke-width", "rx", "stroke-dasharray", "onClick"], xe = {
8
+ __name: "vue-ui-sparkhistogram",
9
+ props: {
10
+ config: {
11
+ type: Object,
12
+ default() {
13
+ return {};
14
+ }
15
+ },
16
+ dataset: {
17
+ type: Array,
18
+ default() {
19
+ return [];
20
+ }
21
+ }
22
+ },
23
+ emits: ["selectDatapoint"],
24
+ setup(V, { emit: E }) {
25
+ const v = V;
26
+ R((l) => ({
27
+ "34a5ebe4": O.value
28
+ }));
29
+ const { vue_ui_sparkhistogram: I } = P(), z = b(() => !!v.dataset && v.dataset.length);
30
+ T(() => {
31
+ J(v.dataset) ? D({
32
+ componentName: "VueUiSparkHistogram",
33
+ type: "dataset"
34
+ }) : v.dataset.forEach((l, u) => {
35
+ K({
36
+ datasetObject: l,
37
+ requiredAttributes: ["value"]
38
+ }).forEach((t) => {
39
+ D({
40
+ componentName: "VueUiSparkHistogram",
41
+ type: "datasetSerieAttribute",
42
+ property: t,
43
+ index: u
44
+ });
45
+ });
46
+ });
47
+ });
48
+ const x = S(Q()), e = b(() => {
49
+ const l = H({
50
+ userConfig: v.config,
51
+ defaultConfig: I
52
+ });
53
+ return l.theme ? {
54
+ ...H({
55
+ userConfig: Z.vue_ui_sparkhistogram[l.theme] || v.config,
56
+ defaultConfig: l
57
+ })
58
+ } : l;
59
+ }), d = b(() => {
60
+ const l = e.value.style.layout.height, u = e.value.style.layout.width, t = e.value.style.layout.padding.top, o = l - e.value.style.layout.padding.bottom, y = e.value.style.layout.padding.left, _ = u - e.value.style.layout.padding.right, k = t + (l - t - e.value.style.layout.padding.bottom) / 2, C = l - e.value.style.layout.padding.top - e.value.style.layout.padding.bottom, $ = u - e.value.style.layout.padding.left - e.value.style.layout.padding.right;
61
+ return {
62
+ bottom: o,
63
+ centerY: k,
64
+ drawingHeight: C,
65
+ drawingWidth: $,
66
+ height: l,
67
+ left: y,
68
+ right: _,
69
+ top: t,
70
+ width: u
71
+ };
72
+ }), W = b(() => Math.max(...v.dataset.map((l) => Math.abs(l.value || 0))));
73
+ function B(l) {
74
+ return Math.abs(l) / W.value;
75
+ }
76
+ const n = b(() => v.dataset.map((l, u) => {
77
+ const t = B(l.value || 0), o = d.value.drawingHeight * t, y = d.value.drawingWidth / v.dataset.length, _ = y * (e.value.style.bars.gap / 100), k = y - _, C = d.value.centerY - o / 2, $ = d.value.left + (_ / 2 + u * y), X = d.value.left + u * y, L = typeof l.intensity > "u" ? 100 : Math.round(l.intensity * 100), j = l.value >= 0 ? `${e.value.style.bars.colors.positive}${m[L]}` : `${e.value.style.bars.colors.negative}${m[L]}`, Y = l.value >= 0 ? e.value.style.bars.colors.positive : e.value.style.bars.colors.negative, q = l.value >= 0 ? `url(#gradient_positive_${u}_${x.value})` : `url(#gradient_negative_${u}_${x.value})`, G = $ + k / 2;
78
+ return {
79
+ ...l,
80
+ color: j,
81
+ gradient: q,
82
+ height: o,
83
+ intensity: L,
84
+ proportion: t,
85
+ stroke: Y,
86
+ textAnchor: G,
87
+ trapX: X,
88
+ unitWidth: y,
89
+ width: k,
90
+ x: $,
91
+ y: C
92
+ };
93
+ })), i = S(null);
94
+ function U(l, u) {
95
+ E("selectDatapoint", { datapoint: l, index: u });
96
+ }
97
+ const O = b(() => `${e.value.style.animation.speedMs}ms`);
98
+ return (l, u) => (a(), s("div", {
99
+ style: w(`width:100%;background:${e.value.style.backgroundColor};font-family:${e.value.style.fontFamily}`),
100
+ onMouseleave: u[1] || (u[1] = (t) => i.value = null)
101
+ }, [
102
+ e.value.style.title.text ? (a(), s("div", {
103
+ key: 0,
104
+ style: w(`width:calc(100% - 12px);background:${e.value.style.backgroundColor};margin:0 auto;margin:${e.value.style.title.margin};padding: 0 6px;text-align:${e.value.style.title.textAlign}`)
105
+ }, [
106
+ f("div", {
107
+ style: w(`font-size:${e.value.style.title.fontSize}px;color:${e.value.style.title.color};font-weight:${e.value.style.title.bold ? "bold" : "normal"}`)
108
+ }, [
109
+ N(r(e.value.style.title.text) + " ", 1),
110
+ i.value !== null ? (a(), s("span", se, "- " + r(n.value[i.value].timeLabel || "") + " " + r(e.value.style.labels.value.prefix) + r(isNaN(n.value[i.value].value) ? "" : ": " + Number(n.value[i.value].value.toFixed(e.value.style.labels.value.rounding)).toLocaleString()) + r(e.value.style.labels.value.suffix), 1)) : c("", !0),
111
+ N(),
112
+ ![void 0, null].includes(i.value) && ![null, void 0].includes(n.value[i.value].valueLabel) ? (a(), s("span", oe, "(" + r(n.value[i.value].valueLabel || 0) + ")", 1)) : c("", !0)
113
+ ], 4),
114
+ e.value.style.title.subtitle.text ? (a(), s("div", {
115
+ key: 0,
116
+ style: w(`font-size:${e.value.style.title.subtitle.fontSize}px;color:${e.value.style.title.subtitle.color};font-weight:${e.value.style.title.subtitle.bold ? "bold" : "normal"}`)
117
+ }, r(e.value.style.title.subtitle.text), 5)) : c("", !0)
118
+ ], 4)) : c("", !0),
119
+ z.value ? (a(), s("svg", {
120
+ key: 1,
121
+ xmlns: p(ee),
122
+ viewBox: `0 0 ${d.value.width} ${d.value.height}`,
123
+ style: { overflow: "visible" }
124
+ }, [
125
+ f("defs", null, [
126
+ (a(!0), s(h, null, g(n.value, (t, o) => (a(), s("radialGradient", {
127
+ id: `gradient_positive_${o}_${x.value}`,
128
+ cy: "50%",
129
+ cx: "50%",
130
+ r: "50%",
131
+ fx: "50%",
132
+ fy: "50%"
133
+ }, [
134
+ f("stop", {
135
+ offset: "0%",
136
+ "stop-color": `${p(F)(e.value.style.bars.colors.positive, 0.05)}${p(m)[t.intensity]}`
137
+ }, null, 8, ne),
138
+ f("stop", {
139
+ offset: "100%",
140
+ "stop-color": `${e.value.style.bars.colors.positive}${p(m)[t.intensity]}`
141
+ }, null, 8, re)
142
+ ], 8, ie))), 256)),
143
+ (a(!0), s(h, null, g(n.value, (t, o) => (a(), s("radialGradient", {
144
+ id: `gradient_negative_${o}_${x.value}`,
145
+ cy: "50%",
146
+ cx: "50%",
147
+ r: "50%",
148
+ fx: "50%",
149
+ fy: "50%"
150
+ }, [
151
+ f("stop", {
152
+ offset: "0%",
153
+ "stop-color": `${p(F)(e.value.style.bars.colors.negative, 0.05)}${p(m)[t.intensity]}`
154
+ }, null, 8, de),
155
+ f("stop", {
156
+ offset: "100%",
157
+ "stop-color": `${e.value.style.bars.colors.negative}${p(m)[t.intensity]}`
158
+ }, null, 8, ye)
159
+ ], 8, ve))), 256))
160
+ ]),
161
+ !e.value.style.bars.shape || e.value.style.bars.shape === "square" ? (a(), s("g", ce, [
162
+ (a(!0), s(h, null, g(n.value, (t, o) => (a(), s("rect", {
163
+ x: t.x,
164
+ y: t.y,
165
+ height: t.height,
166
+ width: t.width,
167
+ fill: e.value.style.bars.colors.gradient.show ? t.gradient : t.color,
168
+ stroke: t.stroke,
169
+ "stroke-width": e.value.style.bars.strokeWidth,
170
+ rx: `${e.value.style.bars.borderRadius * t.proportion / 12}%`,
171
+ class: M({ "vue-ui-sparkhistogram-shape": e.value.style.animation.show })
172
+ }, null, 10, he))), 256))
173
+ ])) : (a(), s("g", ge, [
174
+ (a(!0), s(h, null, g(n.value, (t, o) => (a(), A(te, {
175
+ plot: { x: t.x + t.width / 2, y: t.y + t.height / 2 },
176
+ color: e.value.style.bars.colors.gradient.show ? t.gradient : t.color,
177
+ shape: e.value.style.bars.shape,
178
+ radius: t.height * 0.4,
179
+ class: M({ "vue-ui-sparkhistogram-shape": e.value.style.animation.show })
180
+ }, null, 8, ["plot", "color", "shape", "radius", "class"]))), 256))
181
+ ])),
182
+ (a(!0), s(h, null, g(n.value, (t, o) => (a(), s("text", {
183
+ "text-anchor": "middle",
184
+ x: t.textAnchor,
185
+ y: t.y - e.value.style.labels.value.fontSize / 3 + e.value.style.labels.value.offsetY,
186
+ "font-size": e.value.style.labels.value.fontSize,
187
+ "font-weight": e.value.style.labels.value.bold ? "bold" : "normal",
188
+ fill: e.value.style.labels.value.color
189
+ }, r(e.value.style.labels.value.prefix) + r(isNaN(t.value) ? "" : Number(t.value.toFixed(e.value.style.labels.value.rounding)).toLocaleString()) + r(e.value.style.labels.value.suffix), 9, fe))), 256)),
190
+ (a(!0), s(h, null, g(n.value, (t, o) => (a(), s("g", null, [
191
+ t.valueLabel ? (a(), s("text", {
192
+ key: 0,
193
+ x: t.textAnchor,
194
+ y: t.y + t.height + e.value.style.labels.valueLabel.fontSize,
195
+ "font-size": e.value.style.labels.valueLabel.fontSize,
196
+ "text-anchor": "middle",
197
+ fill: e.value.style.labels.valueLabel.color
198
+ }, r(t.valueLabel), 9, pe)) : c("", !0)
199
+ ]))), 256)),
200
+ (a(!0), s(h, null, g(n.value, (t, o) => (a(), s("g", null, [
201
+ t.timeLabel ? (a(), s("text", {
202
+ key: 0,
203
+ x: t.textAnchor,
204
+ y: d.value.height - e.value.style.labels.timeLabel.fontSize / 2,
205
+ "font-size": e.value.style.labels.timeLabel.fontSize,
206
+ fill: e.value.style.labels.timeLabel.color,
207
+ "text-anchor": "middle"
208
+ }, r(t.timeLabel), 9, be)) : c("", !0)
209
+ ]))), 256)),
210
+ (a(!0), s(h, null, g(n.value, (t, o) => (a(), s("g", null, [
211
+ f("rect", {
212
+ height: d.value.height,
213
+ width: t.unitWidth,
214
+ fill: "transparent",
215
+ x: t.trapX,
216
+ y: 0,
217
+ onMouseover: (y) => i.value = o,
218
+ onMouseleave: u[0] || (u[0] = (y) => i.value = null),
219
+ stroke: i.value !== null && i.value === o ? e.value.style.selector.stroke : "",
220
+ "stroke-width": i.value !== null && i.value === o ? e.value.style.selector.strokeWidth : 0,
221
+ rx: e.value.style.selector.borderRadius,
222
+ "stroke-dasharray": e.value.style.selector.strokeDasharray,
223
+ onClick: () => U(t, o)
224
+ }, null, 40, me)
225
+ ]))), 256))
226
+ ], 8, ue)) : c("", !0),
227
+ z.value ? c("", !0) : (a(), A(le, {
228
+ key: 2,
229
+ config: {
230
+ type: "sparkHistogram",
231
+ style: {
232
+ backgroundColor: e.value.style.backgroundColor,
233
+ sparkHistogram: {
234
+ color: "#CCCCCC"
235
+ }
236
+ }
237
+ }
238
+ }, null, 8, ["config"]))
239
+ ], 36));
240
+ }
241
+ }, ze = /* @__PURE__ */ ae(xe, [["__scopeId", "data-v-7aed7086"]]);
242
+ export {
243
+ ze as default
244
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),n=require("./index-BkomIE9L.cjs"),B=require("./useNestedProp-BMxXyPbW.cjs"),z=require("./vue-ui-skeleton-JmGp11-u.cjs"),A=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),D=["id"],F=["xmlns","viewBox"],G=["id"],W=["stop-color"],q=["stop-color"],T=["id"],j=["stop-color"],H=["stop-color"],O=["id"],U=["stop-color"],X=["stop-color"],Z={key:0},R=["d","fill"],Y=["d","fill"],J=["d","stroke","stroke-width"],K=["x1","x2","y1","y2","stroke","stroke-width"],Q=["x","y","width","height","fill","rx"],ee=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray"],te=["x1","x2","y1","y2","stroke","stroke-dasharray","stroke-width"],le=["cx","cy","r","fill","stroke","stroke-width"],ae=["x","y","font-size","font-weight","fill"],oe=["x","y","height","width","onMouseenter","onClick"],ne={__name:"vue-ui-sparkline",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}},showInfo:{type:Boolean,default:!0},selectedIndex:{type:Number,default:void 0}},emits:["hoverIndex","selectDatapoint"],setup(m,{emit:b}){const i=m,{vue_ui_sparkline:$}=n.useConfig(),g=e.computed(()=>!!i.dataset&&i.dataset.length),v=e.ref(n.createUid()),t=e.computed(()=>{const l=B.useNestedProp({userConfig:i.config,defaultConfig:$});return l.theme?{...B.useNestedProp({userConfig:n.themes.vue_ui_sparkline[l.theme]||i.config,defaultConfig:l})}:l}),f=e.ref(i.dataset.map(l=>t.value.style.animation.show?{...l,value:null}:{...l,value:[void 0].includes(l.value)?null:l.value}));e.onMounted(()=>{if(n.objectIsEmpty(i.dataset)?n.error({componentName:"VueUiSparkline",type:"dataset"}):i.dataset.forEach((l,r)=>{n.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["period","value"]}).forEach(a=>{n.error({componentName:"VueUiSparkline",type:"datasetSerieAttribute",property:a,index:r})})}),t.value.style.animation.show&&i.dataset.length>1){let a=function(){r<i.dataset.length?(f.value.push(i.dataset[r]),setTimeout(()=>{requestAnimationFrame(a)},l)):f.value=i.dataset,r+=1};f.value=[];const l=t.value.style.animation.animationFrames/i.dataset.length;let r=0;a()}});const d=e.ref({height:80,width:500}),L=e.ref(6),o=e.computed(()=>({top:12,left:0,right:d.value.width,bottom:d.value.height-3,start:i.showInfo&&t.value.style.dataLabel.show&&t.value.style.dataLabel.position==="left"?d.value.width-t.value.style.chartWidth:30,width:i.showInfo&&t.value.style.dataLabel.show?t.value.style.chartWidth:d.value.width-30,height:d.value.height-12})),_=e.computed(()=>Math.min(...f.value.map(l=>isNaN(l.value)||[void 0,null,"NaN",NaN,1/0,-1/0].includes(l.value)?0:l.value||0))),V=e.computed(()=>Math.max(...f.value.map(l=>isNaN(l.value)||[void 0,null,"NaN",NaN,1/0,-1/0].includes(l.value)?0:l.value||0))),p=e.computed(()=>{const l=_.value>=0?0:_.value;return Math.abs(l)}),E=e.computed(()=>V.value+p.value+L.value),x=e.computed(()=>o.value.bottom-o.value.height*w(p.value));function w(l){return l/E.value}const y=e.computed(()=>i.dataset.length-1),u=e.computed(()=>f.value.map((l,r)=>{const a=isNaN(l.value)||[void 0,null,"NaN",NaN,1/0,-1/0].includes(l.value)?0:l.value||0;return{absoluteValue:a,period:l.period,plotValue:a+p.value,toMax:w(a+p.value),x:o.value.start+r*(o.value.width/(y.value+1)>30?30:o.value.width/(y.value+1)),y:o.value.bottom-o.value.height*w(a+p.value),id:`plot_${v.value}_${r}`,color:k.value?t.value.style.bar.color:t.value.style.area.useGradient?n.shiftHue(t.value.style.line.color,.05*(1-r/y.value)):t.value.style.line.color,width:o.value.width/(y.value+1)>30?30:o.value.width/(y.value+1)}})),C=e.computed(()=>{const l={x:u.value[0].x,y:d.value.height-6},r={x:u.value[u.value.length-1].x,y:d.value.height-6},a=[];return u.value.forEach(s=>{a.push(`${s.x},${s.y} `)}),[l.x,l.y,...a,r.x,r.y].toString()}),c=e.ref(void 0);function I(l,r){c.value=l,b("hoverIndex",{index:r})}function S(){c.value=void 0,b("hoverIndex",{index:void 0})}const h=e.computed(()=>{if(g.value){const l=u.value.map(a=>a.absoluteValue),r=l.reduce((a,s)=>a+s,0);return{latest:u.value[u.value.length-1].absoluteValue,sum:r,average:r/u.value.length,median:n.calcMedian(l),trend:n.calcLinearProgression(u.value.map(({x:a,y:s,absoluteValue:N})=>({x:a,y:s,value:N}))).trend}}else return{latest:null,sum:null,average:null,median:null,trend:null}}),M=e.computed(()=>g.value?t.value.style.dataLabel.valueType==="latest"?h.value.latest:t.value.style.dataLabel.valueType==="sum"?h.value.sum:t.value.style.dataLabel.valueType==="average"?h.value.average:0:0),k=e.computed(()=>t.value.type&&t.value.type==="bar");function P(l,r){b("selectDatapoint",{datapoint:l,index:r})}return(l,r)=>(e.openBlock(),e.createElementBlock("div",{class:"vue-ui-sparkline",id:v.value,style:e.normalizeStyle(`width:100%;font-family:${t.value.style.fontFamily}`)},[e.renderSlot(l.$slots,"before",e.normalizeProps(e.guardReactiveProps({selected:c.value,latest:h.value.latest,sum:h.value.sum,average:h.value.average,median:h.value.median,trend:h.value.trend})),void 0,!0),t.value.style.title.show&&m.showInfo?(e.openBlock(),e.createElementBlock("div",{key:0,class:"vue-ui-sparkline-title",style:e.normalizeStyle(`display:flex;align-items:center;width:100%;color:${t.value.style.title.color};background:${t.value.style.backgroundColor};justify-content:${t.value.style.title.textAlign==="left"?"flex-start":t.value.style.title.textAlign==="right"?"flex-end":"center"};height:${t.value.style.title.fontSize*2}px;font-size:${t.value.style.title.fontSize}px;font-weight:${t.value.style.title.bold?"bold":"normal"};`)},[e.createElementVNode("span",{style:e.normalizeStyle(`padding:${t.value.style.title.textAlign==="left"?"0 0 0 12px":t.value.style.title.textAlign==="right"?"0 12px 0 0":"0"}`)},e.toDisplayString(c.value?c.value.period:t.value.style.title.text),5)],4)):e.createCommentVNode("",!0),g.value?(e.openBlock(),e.createElementBlock("svg",{key:1,xmlns:e.unref(n.XMLNS),viewBox:`0 0 ${d.value.width} ${d.value.height}`,style:e.normalizeStyle(`background:${t.value.style.backgroundColor};overflow:visible`)},[e.createElementVNode("defs",null,[e.createElementVNode("linearGradient",{x1:"0%",y1:"0%",x2:"100%",y2:"0%",id:`sparkline_gradient_${v.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":`${e.unref(n.shiftHue)(t.value.style.area.color,.05)}${e.unref(n.opacity)[t.value.style.area.opacity]}`},null,8,W),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.area.color+e.unref(n.opacity)[t.value.style.area.opacity]},null,8,q)],8,G),e.createElementVNode("linearGradient",{x2:"0%",y2:"100%",id:`sparkline_bar_gradient_pos_${v.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":t.value.style.bar.color},null,8,j),e.createElementVNode("stop",{offset:"100%","stop-color":`${e.unref(n.shiftHue)(t.value.style.bar.color,.05)}`},null,8,H)],8,T),e.createElementVNode("linearGradient",{x2:"0%",y2:"100%",id:`sparkline_bar_gradient_neg_${v.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":`${e.unref(n.shiftHue)(t.value.style.bar.color,.05)}`},null,8,U),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.bar.color},null,8,X)],8,O)]),t.value.style.area.show&&!k.value&&u.value[0]?(e.openBlock(),e.createElementBlock("g",Z,[t.value.style.line.smooth?(e.openBlock(),e.createElementBlock("path",{key:0,d:`M ${u.value[0].x},${o.value.bottom} ${e.unref(n.createSmoothPath)(u.value)} L ${u.value.at(-1).x},${o.value.bottom} Z`,fill:t.value.style.area.useGradient?`url(#sparkline_gradient_${v.value})`:`${t.value.style.area.color}${e.unref(n.opacity)[t.value.style.area.opacity]}`},null,8,R)):(e.openBlock(),e.createElementBlock("path",{key:1,d:`M${C.value}Z`,fill:t.value.style.area.useGradient?`url(#sparkline_gradient_${v.value})`:`${t.value.style.area.color}${e.unref(n.opacity)[t.value.style.area.opacity]}`},null,8,Y))])):e.createCommentVNode("",!0),t.value.style.line.smooth&&!k.value?(e.openBlock(),e.createElementBlock("path",{key:1,d:`M ${e.unref(n.createSmoothPath)(u.value)}`,stroke:t.value.style.line.color,fill:"none","stroke-width":t.value.style.line.strokeWidth,"stroke-linecap":"round"},null,8,J)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.value,(a,s)=>(e.openBlock(),e.createElementBlock("g",null,[s<u.value.length-1&&!t.value.style.line.smooth&&!k.value?(e.openBlock(),e.createElementBlock("line",{key:0,x1:a.x,x2:u.value[s+1].x,y1:a.y,y2:u.value[s+1].y,stroke:a.color,"stroke-width":t.value.style.line.strokeWidth,"stroke-linecap":"round","stroke-linejoin":"round","shape-rendering":"geometricPrecision"},null,8,K)):e.createCommentVNode("",!0),k.value?(e.openBlock(),e.createElementBlock("rect",{key:1,x:a.x-a.width/2,y:a.absoluteValue>0?a.y:x.value,width:a.width,height:Math.abs(a.y-x.value),fill:a.absoluteValue>0?`url(#sparkline_bar_gradient_pos_${v.value})`:`url(#sparkline_bar_gradient_neg_${v.value})`,rx:t.value.style.bar.borderRadius},null,8,Q)):e.createCommentVNode("",!0),t.value.style.verticalIndicator.show&&(c.value&&a.id===c.value.id||m.selectedIndex===s)?(e.openBlock(),e.createElementBlock("line",{key:2,x1:a.x,x2:a.x,y1:o.value.top-6,y2:o.value.bottom,stroke:t.value.style.verticalIndicator.color||a.color,"stroke-width":t.value.style.verticalIndicator.strokeWidth,"stroke-linecap":"round","stroke-dasharray":t.value.style.verticalIndicator.strokeDasharray||0},null,8,ee)):e.createCommentVNode("",!0)]))),256)),_.value<0?(e.openBlock(),e.createElementBlock("line",{key:2,x1:o.value.start,x2:o.value.start+o.value.width-16,y1:x.value,y2:x.value,stroke:t.value.style.zeroLine.color,"stroke-dasharray":t.value.style.zeroLine.strokeWidth*2,"stroke-width":t.value.style.zeroLine.strokeWidth,"stroke-linecap":"round"},null,8,te)):e.createCommentVNode("",!0),t.value.style.plot.show?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:3},e.renderList(u.value,(a,s)=>(e.openBlock(),e.createElementBlock("g",null,[c.value&&a.id===c.value.id||m.selectedIndex===s?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:a.x,cy:a.y,r:t.value.style.plot.radius,fill:a.color,stroke:t.value.style.plot.stroke,"stroke-width":t.value.style.plot.strokeWidth},null,8,le)):e.createCommentVNode("",!0)]))),256)):e.createCommentVNode("",!0),m.showInfo&&t.value.style.dataLabel.show?(e.openBlock(),e.createElementBlock("text",{key:4,x:t.value.style.dataLabel.position==="left"?12+t.value.style.dataLabel.offsetX:o.value.width+12+t.value.style.dataLabel.offsetX,y:d.value.height/2+t.value.style.dataLabel.fontSize/2.5+t.value.style.dataLabel.offsetY,"font-size":t.value.style.dataLabel.fontSize,"font-weight":t.value.style.dataLabel.bold?"bold":"normal",fill:t.value.style.dataLabel.color},e.toDisplayString(c.value?e.unref(n.dataLabel)({p:t.value.style.dataLabel.prefix,v:c.value.absoluteValue,s:t.value.style.dataLabel.suffix,r:t.value.style.dataLabel.roundingValue}):e.unref(n.dataLabel)({p:t.value.style.dataLabel.prefix,v:M.value,s:t.value.style.dataLabel.suffix,r:t.value.style.dataLabel.roundingValue})),9,ae)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.value,(a,s)=>(e.openBlock(),e.createElementBlock("rect",{x:a.x-(o.value.width/(y.value+1)>30?30:o.value.width/(y.value+1))/2,y:o.value.top-6,height:o.value.height+6,width:o.value.width/(y.value+1)>30?30:o.value.width/(y.value+1),fill:"transparent",onMouseenter:N=>I(a,s),onMouseleave:S,onClick:()=>P(a,s)},null,40,oe))),256)),e.renderSlot(l.$slots,"svg",{svg:d.value},void 0,!0)],12,F)):e.createCommentVNode("",!0),g.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(z.default,{key:2,config:{type:"sparkline",style:{backgroundColor:t.value.style.backgroundColor,sparkline:{color:"#CCCCCC"}}}},null,8,["config"]))],12,D))}},ue=A._export_sfc(ne,[["__scopeId","data-v-ee68f40e"]]);exports.default=ue;