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,385 @@
1
+ import { useCssVars as re, computed as c, onMounted as ue, ref as p, openBlock as r, createElementBlock as n, normalizeClass as b, normalizeStyle as W, createVNode as ne, createCommentVNode as h, createBlock as E, unref as y, createSlots as ie, withCtx as U, renderSlot as w, normalizeProps as he, guardReactiveProps as ce, createElementVNode as d, Fragment as C, renderList as z, toDisplayString as de } from "vue";
2
+ import { u as ve, o as ye, e as B, g as fe, c as ge, t as me, a as pe, p as k, b as ke, d as $, X as xe, r as _e, f as be } from "./index-BMCvLyab.js";
3
+ import { _ as we } from "./Title-BNPZwnkp.js";
4
+ import { u as Ce, U as $e } from "./usePrinter-BuuBz5JR.js";
5
+ import Fe from "./vue-ui-skeleton-BisWX1sO.js";
6
+ import { u as j } from "./useNestedProp-CkP8xhG_.js";
7
+ import { _ as Pe } from "./_plugin-vue_export-helper-CHgC5LLL.js";
8
+ const Ie = ["id"], Ye = {
9
+ key: 0,
10
+ style: "width:100%"
11
+ }, Me = ["xmlns", "viewBox"], Oe = {
12
+ id: "vueUiPill",
13
+ clipPathUnits: "objectBoundingBox"
14
+ }, Ue = ["fill"], qe = ["id"], Ne = ["stop-color"], Se = ["stop-color"], Le = ["stop-color"], Te = { "clip-path": "url(#vueUiPill)" }, Ge = ["x", "y", "height", "width"], Ve = ["x", "y", "height", "width", "fill"], We = ["x1", "x2", "y1", "y2", "stroke-width", "stroke"], Ee = ["x1", "x2", "y1", "y2", "stroke-width", "stroke"], ze = ["x1", "x2", "y1", "y2", "stroke-width", "stroke"], Be = ["x1", "x2", "y1", "y2", "stroke-width", "stroke"], je = ["x1", "x2", "y1", "y2", "stroke-width", "stroke"], Ae = ["x1", "x2", "y1", "y2", "stroke-width", "stroke"], De = ["x1", "x2", "y1", "y2", "stroke-width", "stroke"], He = ["x1", "x2", "y1", "y2", "stroke-width", "stroke"], Xe = ["x", "y", "height", "width"], Re = ["y", "x", "fill", "font-size", "font-weight"], Je = {
15
+ __name: "vue-ui-thermometer",
16
+ props: {
17
+ dataset: {
18
+ type: Object,
19
+ default() {
20
+ return {};
21
+ }
22
+ },
23
+ config: {
24
+ type: Object,
25
+ default() {
26
+ return {};
27
+ }
28
+ }
29
+ },
30
+ setup(q, { expose: A }) {
31
+ const o = q;
32
+ re((s) => ({
33
+ efcaaea8: Z.value,
34
+ "67dbf562": Q.value,
35
+ bd690a62: K.value
36
+ }));
37
+ const { vue_ui_thermometer: D } = ve(), F = c(() => !!o.dataset && Object.keys(o.dataset).length);
38
+ ue(() => {
39
+ ye(o.dataset) ? B({
40
+ componentName: "VueUiThermometer",
41
+ type: "dataset"
42
+ }) : fe({
43
+ datasetObject: o.dataset,
44
+ requiredAttributes: ["value", "from", "to"]
45
+ }).forEach((s) => {
46
+ B({
47
+ componentName: "VueUiThermometer",
48
+ type: "datasetAttribute",
49
+ property: s
50
+ });
51
+ });
52
+ });
53
+ const f = p(ge()), N = p(null), S = p(0), e = c(() => {
54
+ const s = j({
55
+ userConfig: o.config,
56
+ defaultConfig: D
57
+ });
58
+ return s.theme ? {
59
+ ...j({
60
+ userConfig: me.vue_ui_thermometer[s.theme] || o.config,
61
+ defaultConfig: s
62
+ }),
63
+ customPalette: pe[s.theme] || k
64
+ } : s;
65
+ }), { isPrinting: H, isImaging: X, generatePdf: L, generateImage: T } = Ce({
66
+ elementId: `thermometer__${f.value}`,
67
+ fileName: e.value.style.title.text || "vue-ui-thermometer"
68
+ }), x = c(() => ke(e.value.customPalette)), R = c(() => e.value.style.chart.thermometer.width), v = c(() => o.dataset.steps || 10), i = p({
69
+ top: e.value.style.chart.padding.top,
70
+ left: e.value.style.chart.padding.left,
71
+ right: e.value.style.chart.padding.right,
72
+ bottom: e.value.style.chart.padding.bottom
73
+ });
74
+ function _(s, a, t) {
75
+ const u = [], M = G(s), O = G(a);
76
+ for (let m = 0; m < t; m++) {
77
+ const se = P(M.red, O.red, m, t), le = P(M.green, O.green, m, t), oe = P(M.blue, O.blue, m, t), ae = `#${I(se)}${I(le)}${I(oe)}`;
78
+ u.push(ae);
79
+ }
80
+ return u;
81
+ }
82
+ function G(s) {
83
+ const a = s.slice(1);
84
+ return {
85
+ red: parseInt(a.slice(0, 2), 16),
86
+ green: parseInt(a.slice(2, 4), 16),
87
+ blue: parseInt(a.slice(4, 6), 16)
88
+ };
89
+ }
90
+ function P(s, a, t, u) {
91
+ return Math.round(s + (a - s) * t / u);
92
+ }
93
+ function I(s) {
94
+ return s.toString(16).padStart(2, "0");
95
+ }
96
+ const l = c(() => {
97
+ const s = R.value + i.value.left + i.value.right, a = e.value.style.chart.height;
98
+ return {
99
+ width: s,
100
+ left: i.value.left,
101
+ right: s - i.value.right,
102
+ top: i.value.top,
103
+ bottom: a - i.value.bottom,
104
+ height: a
105
+ };
106
+ }), J = c(() => l.value), Y = c(() => {
107
+ const s = o.dataset.from < 0 ? Math.abs(o.dataset.from) : o.dataset.from, a = o.dataset.to < 0 ? Math.abs(o.dataset.to) : o.dataset.to;
108
+ let t = 0;
109
+ return o.dataset.to > 0 ? t = s + a : s > a ? t = s - a : t = a - s, (1 - (Math.abs(o.dataset.from) + o.dataset.value) / t) * (l.value.height - i.value.top - i.value.bottom);
110
+ }), K = c(() => `${Y.value}px`), Q = c(() => `${l.value.height - e.value.style.chart.padding.bottom - i.value.top}px`), Z = c(() => `${e.value.style.chart.animation.speedMs}ms`), ee = c(() => {
111
+ if (o.dataset.colors) {
112
+ if (!o.dataset.colors.from)
113
+ return _(x.value[0] || k[0], $(o.dataset.colors.to), v.value || 10);
114
+ if (!o.dataset.colors.to)
115
+ return _($(o.dataset.colors.from), x.value[1] || k[1], v.value || 10);
116
+ } else
117
+ return _(x.value[1] || k[1], x.value[0] || k[0], v.value || 10);
118
+ return _($(o.dataset.colors.from), $(o.dataset.colors.to), v.value || 10);
119
+ }), V = c(() => {
120
+ const s = [];
121
+ let a = 0;
122
+ const t = l.value.height - i.value.top - i.value.bottom;
123
+ for (let u = 0; u < t - 1; u += t / v.value)
124
+ s.push({
125
+ x: l.value.left,
126
+ y: l.value.top + u,
127
+ qYLess: l.value.top + u + t / v.value / 4,
128
+ halfY: l.value.top + u + t / v.value / 2,
129
+ qYMore: l.value.top + u + t / v.value / 4 * 3,
130
+ color: ee.value[a],
131
+ height: t / v.value
132
+ }), a += 1;
133
+ return s;
134
+ }), g = p(!1);
135
+ function te(s) {
136
+ g.value = s, S.value += 1;
137
+ }
138
+ return A({
139
+ generatePdf: L,
140
+ generateImage: T
141
+ }), (s, a) => (r(), n("div", {
142
+ ref_key: "thermoChart",
143
+ ref: N,
144
+ class: b(`vue-ui-thermometer ${g.value ? "vue-data-ui-wrapper-fullscreen" : ""}`),
145
+ style: W(`width:100%;background:${e.value.style.chart.backgroundColor};color:${e.value.style.chart.color};font-family:${e.value.style.fontFamily}`),
146
+ id: `thermometer__${f.value}`
147
+ }, [
148
+ e.value.style.title.text ? (r(), n("div", Ye, [
149
+ ne(we, {
150
+ config: {
151
+ title: {
152
+ cy: "thermometer-div-title",
153
+ ...e.value.style.title
154
+ },
155
+ subtitle: {
156
+ cy: "thermometer-div-subtitle",
157
+ ...e.value.style.title.subtitle
158
+ }
159
+ }
160
+ }, null, 8, ["config"])
161
+ ])) : h("", !0),
162
+ e.value.userOptions.show && F.value ? (r(), E($e, {
163
+ ref: "details",
164
+ key: `user_options_${S.value}`,
165
+ backgroundColor: e.value.style.chart.backgroundColor,
166
+ color: e.value.style.chart.color,
167
+ isImaging: y(X),
168
+ isPrinting: y(H),
169
+ uid: f.value,
170
+ hasPdf: e.value.userOptions.buttons.pdf,
171
+ hasImg: e.value.userOptions.buttons.img,
172
+ hasFullscreen: e.value.userOptions.buttons.fullscreen,
173
+ hasXls: !1,
174
+ isFullscreen: g.value,
175
+ titles: { ...e.value.userOptions.buttonTitles },
176
+ chartElement: N.value,
177
+ onToggleFullscreen: te,
178
+ onGeneratePdf: y(L),
179
+ onGenerateImage: y(T)
180
+ }, ie({ _: 2 }, [
181
+ s.$slots.optionPdf ? {
182
+ name: "optionPdf",
183
+ fn: U(() => [
184
+ w(s.$slots, "optionPdf", {}, void 0, !0)
185
+ ]),
186
+ key: "0"
187
+ } : void 0,
188
+ s.$slots.optionImg ? {
189
+ name: "optionImg",
190
+ fn: U(() => [
191
+ w(s.$slots, "optionImg", {}, void 0, !0)
192
+ ]),
193
+ key: "1"
194
+ } : void 0,
195
+ s.$slots.optionFullscreen ? {
196
+ name: "optionFullscreen",
197
+ fn: U(({ toggleFullscreen: t, isFullscreen: u }) => [
198
+ w(s.$slots, "optionFullscreen", he(ce({ toggleFullscreen: t, isFullscreen: u })), void 0, !0)
199
+ ]),
200
+ key: "2"
201
+ } : void 0
202
+ ]), 1032, ["backgroundColor", "color", "isImaging", "isPrinting", "uid", "hasPdf", "hasImg", "hasFullscreen", "isFullscreen", "titles", "chartElement", "onGeneratePdf", "onGenerateImage"])) : h("", !0),
203
+ F.value ? (r(), n("svg", {
204
+ key: 2,
205
+ xmlns: y(xe),
206
+ class: b({ "vue-data-ui-fullscreen--on": g.value, "vue-data-ui-fulscreen--off": !g.value }),
207
+ width: "100%",
208
+ viewBox: `0 0 ${l.value.width} ${l.value.height}`,
209
+ style: W(`background:${e.value.style.chart.backgroundColor}`)
210
+ }, [
211
+ d("defs", null, [
212
+ d("clipPath", Oe, [
213
+ d("rect", {
214
+ x: "0",
215
+ y: "0",
216
+ width: "1",
217
+ height: "1",
218
+ rx: "0.5",
219
+ ry: "0.07",
220
+ fill: e.value.style.chart.backgroundColor
221
+ }, null, 8, Ue)
222
+ ]),
223
+ (r(!0), n(C, null, z(V.value, (t, u) => (r(), n("linearGradient", {
224
+ id: `vueUiThermometerGradient_${u}_${f.value}`,
225
+ x1: "0%",
226
+ y1: "0%",
227
+ x2: "100%",
228
+ y2: "0%"
229
+ }, [
230
+ d("stop", {
231
+ offset: "0%",
232
+ "stop-color": t.color
233
+ }, null, 8, Ne),
234
+ d("stop", {
235
+ offset: "50%",
236
+ "stop-color": `${t.color}${y(_e)[100 - e.value.style.chart.graduations.gradient.intensity]}`
237
+ }, null, 8, Se),
238
+ d("stop", {
239
+ offset: "100%",
240
+ "stop-color": t.color
241
+ }, null, 8, Le)
242
+ ], 8, qe))), 256))
243
+ ]),
244
+ d("g", Te, [
245
+ d("rect", {
246
+ x: l.value.left,
247
+ y: l.value.top,
248
+ height: l.value.height - i.value.top - i.value.bottom,
249
+ width: l.value.width - i.value.left - i.value.right,
250
+ fill: "#FFFFFF"
251
+ }, null, 8, Ge),
252
+ (r(!0), n(C, null, z(V.value, (t, u) => (r(), n("g", {
253
+ key: `graduation_${u}`
254
+ }, [
255
+ d("rect", {
256
+ x: t.x,
257
+ y: t.y,
258
+ height: t.height,
259
+ width: l.value.width - e.value.style.chart.padding.left - e.value.style.chart.padding.right,
260
+ fill: e.value.style.chart.graduations.gradient.show ? `url(#vueUiThermometerGradient_${u}_${f.value})` : t.color,
261
+ "shape-rendering": "crispEdges"
262
+ }, null, 8, Ve),
263
+ e.value.style.chart.graduations.show && ["both", "left"].includes(e.value.style.chart.graduations.sides) ? (r(), n("line", {
264
+ key: 0,
265
+ x1: t.x,
266
+ x2: t.x + 10,
267
+ y1: t.y,
268
+ y2: t.y,
269
+ "stroke-width": e.value.style.chart.graduations.strokeWidth,
270
+ stroke: e.value.style.chart.graduations.stroke,
271
+ "stroke-linecap": "round"
272
+ }, null, 8, We)) : h("", !0),
273
+ e.value.style.chart.graduations.showIntermediate ? (r(), n(C, { key: 1 }, [
274
+ e.value.style.chart.graduations.show && ["both", "left"].includes(e.value.style.chart.graduations.sides) ? (r(), n("line", {
275
+ key: 0,
276
+ x1: t.x,
277
+ x2: t.x + 5,
278
+ y1: t.halfY,
279
+ y2: t.halfY,
280
+ "stroke-width": e.value.style.chart.graduations.strokeWidth / 2,
281
+ stroke: e.value.style.chart.graduations.stroke,
282
+ "stroke-linecap": "round"
283
+ }, null, 8, Ee)) : h("", !0),
284
+ e.value.style.chart.graduations.show && ["both", "left"].includes(e.value.style.chart.graduations.sides) ? (r(), n("line", {
285
+ key: 1,
286
+ x1: t.x,
287
+ x2: t.x + 2.5,
288
+ y1: t.qYLess,
289
+ y2: t.qYLess,
290
+ "stroke-width": e.value.style.chart.graduations.strokeWidth / 2,
291
+ stroke: e.value.style.chart.graduations.stroke,
292
+ "stroke-linecap": "round"
293
+ }, null, 8, ze)) : h("", !0),
294
+ e.value.style.chart.graduations.show && ["both", "left"].includes(e.value.style.chart.graduations.sides) ? (r(), n("line", {
295
+ key: 2,
296
+ x1: t.x,
297
+ x2: t.x + 2.5,
298
+ y1: t.qYMore,
299
+ y2: t.qYMore,
300
+ "stroke-width": e.value.style.chart.graduations.strokeWidth / 2,
301
+ stroke: e.value.style.chart.graduations.stroke,
302
+ "stroke-linecap": "round"
303
+ }, null, 8, Be)) : h("", !0)
304
+ ], 64)) : h("", !0),
305
+ e.value.style.chart.graduations.show && ["both", "right"].includes(e.value.style.chart.graduations.sides) ? (r(), n("line", {
306
+ key: 2,
307
+ x1: l.value.right,
308
+ x2: l.value.right - 10,
309
+ y1: t.y,
310
+ y2: t.y,
311
+ "stroke-width": e.value.style.chart.graduations.strokeWidth,
312
+ stroke: e.value.style.chart.graduations.stroke,
313
+ "stroke-linecap": "round"
314
+ }, null, 8, je)) : h("", !0),
315
+ e.value.style.chart.graduations.showIntermediate ? (r(), n(C, { key: 3 }, [
316
+ e.value.style.chart.graduations.show && ["both", "right"].includes(e.value.style.chart.graduations.sides) ? (r(), n("line", {
317
+ key: 0,
318
+ x1: l.value.right,
319
+ x2: l.value.right - 5,
320
+ y1: t.halfY,
321
+ y2: t.halfY,
322
+ "stroke-width": e.value.style.chart.graduations.strokeWidth / 2,
323
+ stroke: e.value.style.chart.graduations.stroke,
324
+ "stroke-linecap": "round"
325
+ }, null, 8, Ae)) : h("", !0),
326
+ e.value.style.chart.graduations.show && ["both", "right"].includes(e.value.style.chart.graduations.sides) ? (r(), n("line", {
327
+ key: 1,
328
+ x1: l.value.right,
329
+ x2: l.value.right - 2.5,
330
+ y1: t.qYLess,
331
+ y2: t.qYLess,
332
+ "stroke-width": e.value.style.chart.graduations.strokeWidth / 2,
333
+ stroke: e.value.style.chart.graduations.stroke,
334
+ "stroke-linecap": "round"
335
+ }, null, 8, De)) : h("", !0),
336
+ e.value.style.chart.graduations.show && ["both", "right"].includes(e.value.style.chart.graduations.sides) ? (r(), n("line", {
337
+ key: 2,
338
+ x1: l.value.right,
339
+ x2: l.value.right - 2.5,
340
+ y1: t.qYMore,
341
+ y2: t.qYMore,
342
+ "stroke-width": e.value.style.chart.graduations.strokeWidth / 2,
343
+ stroke: e.value.style.chart.graduations.stroke,
344
+ "stroke-linecap": "round"
345
+ }, null, 8, He)) : h("", !0)
346
+ ], 64)) : h("", !0)
347
+ ]))), 128)),
348
+ d("rect", {
349
+ class: b({ "vue-ui-thermometer-temperature": e.value.style.chart.animation.use }),
350
+ x: l.value.left,
351
+ y: l.value.top,
352
+ height: Y.value,
353
+ width: l.value.width - e.value.style.chart.padding.left - e.value.style.chart.padding.right,
354
+ fill: "#FFFFFF66"
355
+ }, null, 10, Xe)
356
+ ]),
357
+ d("text", {
358
+ class: b({ "vue-ui-thermometer-temperature-value": e.value.style.chart.animation.use }),
359
+ y: Y.value + l.value.top + e.value.style.chart.label.fontSize / 3,
360
+ x: l.value.left - 10,
361
+ "text-anchor": "end",
362
+ fill: e.value.style.chart.label.color,
363
+ "font-size": e.value.style.chart.label.fontSize,
364
+ "font-weight": e.value.style.chart.label.bold ? "bold" : "normal"
365
+ }, de(y(be)({ p: e.value.style.chart.label.prefix, v: q.dataset.value, s: e.value.style.chart.label.suffix, r: e.value.style.chart.label.rounding })), 11, Re),
366
+ w(s.$slots, "svg", { svg: J.value }, void 0, !0)
367
+ ], 14, Me)) : h("", !0),
368
+ F.value ? h("", !0) : (r(), E(Fe, {
369
+ key: 3,
370
+ config: {
371
+ type: "thermometer",
372
+ style: {
373
+ backgroundColor: e.value.style.chart.backgroundColor,
374
+ thermometer: {
375
+ color: "#CCCCCC"
376
+ }
377
+ }
378
+ }
379
+ }, null, 8, ["config"]))
380
+ ], 14, Ie));
381
+ }
382
+ }, ot = /* @__PURE__ */ Pe(Je, [["__scopeId", "data-v-eef95fe3"]]);
383
+ export {
384
+ ot as default
385
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),s=require("./index-BkomIE9L.cjs"),A=require("./Title-Cj_xubjI.cjs"),F=require("./usePrinter-r6uHYEcR.cjs"),D=require("./vue-ui-skeleton-JmGp11-u.cjs"),$=require("./useNestedProp-BMxXyPbW.cjs"),R=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),X=["id"],J={key:0,style:"width:100%"},K=["xmlns","viewBox"],Q={id:"vueUiPill",clipPathUnits:"objectBoundingBox"},Z=["fill"],ee=["id"],te=["stop-color"],oe=["stop-color"],le=["stop-color"],re={"clip-path":"url(#vueUiPill)"},ae=["x","y","height","width"],se=["x","y","height","width","fill"],ne=["x1","x2","y1","y2","stroke-width","stroke"],ue=["x1","x2","y1","y2","stroke-width","stroke"],ie=["x1","x2","y1","y2","stroke-width","stroke"],ce=["x1","x2","y1","y2","stroke-width","stroke"],de=["x1","x2","y1","y2","stroke-width","stroke"],he=["x1","x2","y1","y2","stroke-width","stroke"],ve=["x1","x2","y1","y2","stroke-width","stroke"],me=["x1","x2","y1","y2","stroke-width","stroke"],ye=["x","y","height","width"],pe=["y","x","fill","font-size","font-weight"],fe={__name:"vue-ui-thermometer",props:{dataset:{type:Object,default(){return{}}},config:{type:Object,default(){return{}}}},setup(b,{expose:P}){const a=b;e.useCssVars(l=>({efcaaea8:U.value,"67dbf562":O.value,bd690a62:M.value}));const{vue_ui_thermometer:I}=s.useConfig(),p=e.computed(()=>!!a.dataset&&Object.keys(a.dataset).length);e.onMounted(()=>{s.objectIsEmpty(a.dataset)?s.error({componentName:"VueUiThermometer",type:"dataset"}):s.getMissingDatasetAttributes({datasetObject:a.dataset,requiredAttributes:["value","from","to"]}).forEach(l=>{s.error({componentName:"VueUiThermometer",type:"datasetAttribute",property:l})})});const d=e.ref(s.createUid()),C=e.ref(null),w=e.ref(0),t=e.computed(()=>{const l=$.useNestedProp({userConfig:a.config,defaultConfig:I});return l.theme?{...$.useNestedProp({userConfig:s.themes.vue_ui_thermometer[l.theme]||a.config,defaultConfig:l}),customPalette:s.themePalettes[l.theme]||s.palette}:l}),{isPrinting:q,isImaging:S,generatePdf:B,generateImage:N}=F.usePrinter({elementId:`thermometer__${d.value}`,fileName:t.value.style.title.text||"vue-ui-thermometer"}),m=e.computed(()=>s.convertCustomPalette(t.value.customPalette)),T=e.computed(()=>t.value.style.chart.thermometer.width),c=e.computed(()=>a.dataset.steps||10),i=e.ref({top:t.value.style.chart.padding.top,left:t.value.style.chart.padding.left,right:t.value.style.chart.padding.right,bottom:t.value.style.chart.padding.bottom});function y(l,n,o){const u=[],x=E(l),_=E(n);for(let v=0;v<o;v++){const G=f(x.red,_.red,v,o),W=f(x.green,_.green,v,o),H=f(x.blue,_.blue,v,o),j=`#${g(G)}${g(W)}${g(H)}`;u.push(j)}return u}function E(l){const n=l.slice(1);return{red:parseInt(n.slice(0,2),16),green:parseInt(n.slice(2,4),16),blue:parseInt(n.slice(4,6),16)}}function f(l,n,o,u){return Math.round(l+(n-l)*o/u)}function g(l){return l.toString(16).padStart(2,"0")}const r=e.computed(()=>{const l=T.value+i.value.left+i.value.right,n=t.value.style.chart.height;return{width:l,left:i.value.left,right:l-i.value.right,top:i.value.top,bottom:n-i.value.bottom,height:n}}),Y=e.computed(()=>r.value),k=e.computed(()=>{const l=a.dataset.from<0?Math.abs(a.dataset.from):a.dataset.from,n=a.dataset.to<0?Math.abs(a.dataset.to):a.dataset.to;let o=0;return a.dataset.to>0?o=l+n:l>n?o=l-n:o=n-l,(1-(Math.abs(a.dataset.from)+a.dataset.value)/o)*(r.value.height-i.value.top-i.value.bottom)}),M=e.computed(()=>`${k.value}px`),O=e.computed(()=>`${r.value.height-t.value.style.chart.padding.bottom-i.value.top}px`),U=e.computed(()=>`${t.value.style.chart.animation.speedMs}ms`),z=e.computed(()=>{if(a.dataset.colors){if(!a.dataset.colors.from)return y(m.value[0]||s.palette[0],s.convertColorToHex(a.dataset.colors.to),c.value||10);if(!a.dataset.colors.to)return y(s.convertColorToHex(a.dataset.colors.from),m.value[1]||s.palette[1],c.value||10)}else return y(m.value[1]||s.palette[1],m.value[0]||s.palette[0],c.value||10);return y(s.convertColorToHex(a.dataset.colors.from),s.convertColorToHex(a.dataset.colors.to),c.value||10)}),V=e.computed(()=>{const l=[];let n=0;const o=r.value.height-i.value.top-i.value.bottom;for(let u=0;u<o-1;u+=o/c.value)l.push({x:r.value.left,y:r.value.top+u,qYLess:r.value.top+u+o/c.value/4,halfY:r.value.top+u+o/c.value/2,qYMore:r.value.top+u+o/c.value/4*3,color:z.value[n],height:o/c.value}),n+=1;return l}),h=e.ref(!1);function L(l){h.value=l,w.value+=1}return P({generatePdf:B,generateImage:N}),(l,n)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"thermoChart",ref:C,class:e.normalizeClass(`vue-ui-thermometer ${h.value?"vue-data-ui-wrapper-fullscreen":""}`),style:e.normalizeStyle(`width:100%;background:${t.value.style.chart.backgroundColor};color:${t.value.style.chart.color};font-family:${t.value.style.fontFamily}`),id:`thermometer__${d.value}`},[t.value.style.title.text?(e.openBlock(),e.createElementBlock("div",J,[e.createVNode(A._sfc_main,{config:{title:{cy:"thermometer-div-title",...t.value.style.title},subtitle:{cy:"thermometer-div-subtitle",...t.value.style.title.subtitle}}},null,8,["config"])])):e.createCommentVNode("",!0),t.value.userOptions.show&&p.value?(e.openBlock(),e.createBlock(F.UserOptions,{ref:"details",key:`user_options_${w.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isImaging:e.unref(S),isPrinting:e.unref(q),uid:d.value,hasPdf:t.value.userOptions.buttons.pdf,hasImg:t.value.userOptions.buttons.img,hasFullscreen:t.value.userOptions.buttons.fullscreen,hasXls:!1,isFullscreen:h.value,titles:{...t.value.userOptions.buttonTitles},chartElement:C.value,onToggleFullscreen:L,onGeneratePdf:e.unref(B),onGenerateImage:e.unref(N)},e.createSlots({_:2},[l.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionPdf",{},void 0,!0)]),key:"0"}:void 0,l.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionImg",{},void 0,!0)]),key:"1"}:void 0,l.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:o,isFullscreen:u})=>[e.renderSlot(l.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:o,isFullscreen:u})),void 0,!0)]),key:"2"}:void 0]),1032,["backgroundColor","color","isImaging","isPrinting","uid","hasPdf","hasImg","hasFullscreen","isFullscreen","titles","chartElement","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),p.value?(e.openBlock(),e.createElementBlock("svg",{key:2,xmlns:e.unref(s.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":h.value,"vue-data-ui-fulscreen--off":!h.value}),width:"100%",viewBox:`0 0 ${r.value.width} ${r.value.height}`,style:e.normalizeStyle(`background:${t.value.style.chart.backgroundColor}`)},[e.createElementVNode("defs",null,[e.createElementVNode("clipPath",Q,[e.createElementVNode("rect",{x:"0",y:"0",width:"1",height:"1",rx:"0.5",ry:"0.07",fill:t.value.style.chart.backgroundColor},null,8,Z)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(V.value,(o,u)=>(e.openBlock(),e.createElementBlock("linearGradient",{id:`vueUiThermometerGradient_${u}_${d.value}`,x1:"0%",y1:"0%",x2:"100%",y2:"0%"},[e.createElementVNode("stop",{offset:"0%","stop-color":o.color},null,8,te),e.createElementVNode("stop",{offset:"50%","stop-color":`${o.color}${e.unref(s.opacity)[100-t.value.style.chart.graduations.gradient.intensity]}`},null,8,oe),e.createElementVNode("stop",{offset:"100%","stop-color":o.color},null,8,le)],8,ee))),256))]),e.createElementVNode("g",re,[e.createElementVNode("rect",{x:r.value.left,y:r.value.top,height:r.value.height-i.value.top-i.value.bottom,width:r.value.width-i.value.left-i.value.right,fill:"#FFFFFF"},null,8,ae),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(V.value,(o,u)=>(e.openBlock(),e.createElementBlock("g",{key:`graduation_${u}`},[e.createElementVNode("rect",{x:o.x,y:o.y,height:o.height,width:r.value.width-t.value.style.chart.padding.left-t.value.style.chart.padding.right,fill:t.value.style.chart.graduations.gradient.show?`url(#vueUiThermometerGradient_${u}_${d.value})`:o.color,"shape-rendering":"crispEdges"},null,8,se),t.value.style.chart.graduations.show&&["both","left"].includes(t.value.style.chart.graduations.sides)?(e.openBlock(),e.createElementBlock("line",{key:0,x1:o.x,x2:o.x+10,y1:o.y,y2:o.y,"stroke-width":t.value.style.chart.graduations.strokeWidth,stroke:t.value.style.chart.graduations.stroke,"stroke-linecap":"round"},null,8,ne)):e.createCommentVNode("",!0),t.value.style.chart.graduations.showIntermediate?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[t.value.style.chart.graduations.show&&["both","left"].includes(t.value.style.chart.graduations.sides)?(e.openBlock(),e.createElementBlock("line",{key:0,x1:o.x,x2:o.x+5,y1:o.halfY,y2:o.halfY,"stroke-width":t.value.style.chart.graduations.strokeWidth/2,stroke:t.value.style.chart.graduations.stroke,"stroke-linecap":"round"},null,8,ue)):e.createCommentVNode("",!0),t.value.style.chart.graduations.show&&["both","left"].includes(t.value.style.chart.graduations.sides)?(e.openBlock(),e.createElementBlock("line",{key:1,x1:o.x,x2:o.x+2.5,y1:o.qYLess,y2:o.qYLess,"stroke-width":t.value.style.chart.graduations.strokeWidth/2,stroke:t.value.style.chart.graduations.stroke,"stroke-linecap":"round"},null,8,ie)):e.createCommentVNode("",!0),t.value.style.chart.graduations.show&&["both","left"].includes(t.value.style.chart.graduations.sides)?(e.openBlock(),e.createElementBlock("line",{key:2,x1:o.x,x2:o.x+2.5,y1:o.qYMore,y2:o.qYMore,"stroke-width":t.value.style.chart.graduations.strokeWidth/2,stroke:t.value.style.chart.graduations.stroke,"stroke-linecap":"round"},null,8,ce)):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0),t.value.style.chart.graduations.show&&["both","right"].includes(t.value.style.chart.graduations.sides)?(e.openBlock(),e.createElementBlock("line",{key:2,x1:r.value.right,x2:r.value.right-10,y1:o.y,y2:o.y,"stroke-width":t.value.style.chart.graduations.strokeWidth,stroke:t.value.style.chart.graduations.stroke,"stroke-linecap":"round"},null,8,de)):e.createCommentVNode("",!0),t.value.style.chart.graduations.showIntermediate?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[t.value.style.chart.graduations.show&&["both","right"].includes(t.value.style.chart.graduations.sides)?(e.openBlock(),e.createElementBlock("line",{key:0,x1:r.value.right,x2:r.value.right-5,y1:o.halfY,y2:o.halfY,"stroke-width":t.value.style.chart.graduations.strokeWidth/2,stroke:t.value.style.chart.graduations.stroke,"stroke-linecap":"round"},null,8,he)):e.createCommentVNode("",!0),t.value.style.chart.graduations.show&&["both","right"].includes(t.value.style.chart.graduations.sides)?(e.openBlock(),e.createElementBlock("line",{key:1,x1:r.value.right,x2:r.value.right-2.5,y1:o.qYLess,y2:o.qYLess,"stroke-width":t.value.style.chart.graduations.strokeWidth/2,stroke:t.value.style.chart.graduations.stroke,"stroke-linecap":"round"},null,8,ve)):e.createCommentVNode("",!0),t.value.style.chart.graduations.show&&["both","right"].includes(t.value.style.chart.graduations.sides)?(e.openBlock(),e.createElementBlock("line",{key:2,x1:r.value.right,x2:r.value.right-2.5,y1:o.qYMore,y2:o.qYMore,"stroke-width":t.value.style.chart.graduations.strokeWidth/2,stroke:t.value.style.chart.graduations.stroke,"stroke-linecap":"round"},null,8,me)):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0)]))),128)),e.createElementVNode("rect",{class:e.normalizeClass({"vue-ui-thermometer-temperature":t.value.style.chart.animation.use}),x:r.value.left,y:r.value.top,height:k.value,width:r.value.width-t.value.style.chart.padding.left-t.value.style.chart.padding.right,fill:"#FFFFFF66"},null,10,ye)]),e.createElementVNode("text",{class:e.normalizeClass({"vue-ui-thermometer-temperature-value":t.value.style.chart.animation.use}),y:k.value+r.value.top+t.value.style.chart.label.fontSize/3,x:r.value.left-10,"text-anchor":"end",fill:t.value.style.chart.label.color,"font-size":t.value.style.chart.label.fontSize,"font-weight":t.value.style.chart.label.bold?"bold":"normal"},e.toDisplayString(e.unref(s.dataLabel)({p:t.value.style.chart.label.prefix,v:b.dataset.value,s:t.value.style.chart.label.suffix,r:t.value.style.chart.label.rounding})),11,pe),e.renderSlot(l.$slots,"svg",{svg:Y.value},void 0,!0)],14,K)):e.createCommentVNode("",!0),p.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(D.default,{key:3,config:{type:"thermometer",style:{backgroundColor:t.value.style.chart.backgroundColor,thermometer:{color:"#CCCCCC"}}}},null,8,["config"]))],14,X))}},ge=R._export_sfc(fe,[["__scopeId","data-v-eef95fe3"]]);exports.default=ge;
@@ -0,0 +1,64 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),F=require("./useNestedProp-BMxXyPbW.cjs"),w=require("./index-BkomIE9L.cjs"),z=require("./useResponsive-B3TrDDIG.cjs"),b=require("./BaseIcon-BoKtpbrI.cjs"),H=require("./Title-Cj_xubjI.cjs"),A=require("./_plugin-vue_export-helper-BHFhmbuH.cjs");class L{constructor(N,p,_,T=!0,g=!0){this.interval=p,this.elapsed=0,this.isPaused=!1;const C=`
2
+ let interval;
3
+ let elapsed = 0;
4
+ let paused = false;
5
+ let startTime;
6
+ let tickInterval;
7
+
8
+ onmessage = function(e) {
9
+ const { action, data } = e.data;
10
+
11
+ switch(action) {
12
+ case 'start':
13
+ startTime = Date.now();
14
+ tickInterval = data.interval;
15
+ elapsed = 0;
16
+ paused = false;
17
+ interval = setInterval(() => {
18
+ elapsed += tickInterval;
19
+ postMessage({ elapsed, timestamp: Date.now() });
20
+ }, tickInterval);
21
+ break;
22
+
23
+ case 'pause':
24
+ paused = true;
25
+ clearInterval(interval);
26
+ elapsed = Date.now() - startTime;
27
+ break;
28
+
29
+ case 'resume':
30
+ if (paused) {
31
+ startTime = Date.now() - elapsed;
32
+ interval = setInterval(() => {
33
+ elapsed += tickInterval;
34
+ postMessage({ elapsed, timestamp: Date.now() });
35
+ }, tickInterval);
36
+ }
37
+ paused = false;
38
+ break;
39
+
40
+ case 'stop':
41
+ clearInterval(interval);
42
+ elapsed = 0;
43
+ postMessage({ elapsed });
44
+ break;
45
+
46
+ case 'reset':
47
+ elapsed = 0;
48
+ clearInterval(interval);
49
+ postMessage({ elapsed });
50
+ break;
51
+
52
+ case 'lap':
53
+ postMessage({
54
+ elapsed,
55
+ timestamp: Date.now(),
56
+ action: 'lap'
57
+ });
58
+ break;
59
+
60
+ default:
61
+ break;
62
+ }
63
+ };
64
+ `,B=new Blob([C],{type:"application/javascript"}),k=URL.createObjectURL(B),u=new Worker(k);function t(c){let a=Math.floor(c/1e3),n=Math.floor(c%1e3/10),d=Math.floor(a/3600),v=Math.floor(a%3600/60),l=a%60,o="";return g&&(o+=String(d).padStart(2,"0")+":"),o+=String(v).padStart(2,"0")+":",o+=String(l).padStart(2,"0"),T&&(o+="."+String(n).padStart(2,"0")),o}this.start=()=>{this.isPaused=!1,u.postMessage({action:"start",data:{interval:this.interval}})},this.pause=()=>{this.isPaused?this.resume():(this.isPaused=!0,u.postMessage({action:"pause"}))},this.resume=()=>{this.isPaused&&(u.postMessage({action:"resume"}),this.isPaused=!1)},this.stop=()=>{u.postMessage({action:"stop"}),this.isPaused=!1},this.reset=()=>{u.postMessage({action:"reset"}),this.elapsed=0,this.isPaused=!1},this.restart=()=>{this.stop(),this.start()},this.lap=()=>new Promise(c=>{u.postMessage({action:"lap"});const a=n=>{const{elapsed:d,timestamp:v,action:l}=n.data;if(l==="lap"){const o=t(d);c({timestamp:v||0,elapsed:d,formatted:o})}};u.addEventListener("message",a,{once:!0})}),u.onmessage=c=>{const{elapsed:a,timestamp:n}=c.data;this.elapsed=a,N({timestamp:n||0,elapsed:this.elapsed,formatted:t(this.elapsed)})},u.onerror=c=>{_&&_(c)}}}const j=["xmlns","viewBox"],O={key:0},q=["id"],U=["stop-color"],W=["stop-color"],G=["cx","cy","r","fill","stroke","stroke-width"],X=["d","stroke","stroke-width"],J=["r","fill","stroke","stroke-width"],K=["r","fill","stroke","stroke-width"],Q=["x","y"],Y=["x","y","font-size","fill","font-weight"],Z={key:0,class:"vue-ui-timer-controls"},ee=["title"],te=["title"],ae=["title"],le=["title"],se=["title"],oe={__name:"vue-ui-timer",props:{config:{type:Object,default(){return{}}}},emits:["start","pause","reset","restart","lap"],setup(V,{expose:N,emit:p}){const _=V,{vue_ui_timer:T}=w.useConfig(),g=e.ref(null),C=e.ref(null),B=e.ref(null),k=e.ref(null),u=e.ref(w.createUid());e.onMounted(()=>{if(t.value.responsive){const s=z.throttle(()=>{const{width:r,height:i}=z.useResponsive({chart:g.value,title:t.value.style.title.text?C.value:null,legend:B.value});a.value.width=r,a.value.height=i,a.value.tracker.core=w.translateSize({relator:Math.min(r,i),adjuster:t.value.style.width,source:6*t.value.stopwatch.tracker.radiusRatio,threshold:1,fallback:1}),a.value.tracker.aura=w.translateSize({relator:Math.min(r,i),adjuster:t.value.style.width,source:12*t.value.stopwatch.tracker.aura.radiusRatio,threshold:1,fallback:1}),a.value.label=w.translateSize({relator:Math.min(r,i),adjuster:t.value.style.width,source:t.value.stopwatch.label.fontSize,threshold:10,fallback:10})});k.value=new ResizeObserver(s),k.value.observe(g.value.parentNode)}}),e.onBeforeUnmount(()=>{k.value&&k.value.disconnect()});const t=e.computed(()=>F.useNestedProp({userConfig:_.config,defaultConfig:T})),c=e.computed(()=>{if(t.value.stopwatch.showHours&&t.value.stopwatch.showHundredth)return"00:00:00.00";if(t.value.stopwatch.showHours&&!t.value.stopwatch.showHundredth)return"00:00:00";if(!t.value.stopwatch.showHours&&t.value.stopwatch.showHundredth)return"00:00.00";if(!t.value.stopwatch.showHours&&!t.value.stopwatch.showHundredth)return"00:00"}),a=e.ref({height:t.value.style.height,width:t.value.style.width,tracker:{core:6*t.value.stopwatch.tracker.radiusRatio,aura:12*t.value.stopwatch.tracker.aura.radiusRatio},label:t.value.stopwatch.label.fontSize}),n=e.ref(0),d=new L(s=>I(s),10,"",t.value.stopwatch.showHundredth,t.value.stopwatch.showHours),v=e.ref(!0),l=e.ref(!1),o=e.ref(!1);function S(){p("start"),v.value&&d.start(),v.value=!1,l.value=!0}function P(){l.value&&(p("reset"),d.stop(),m.value=[],v.value=!0,l.value=!1)}function E(){o.value=!o.value,p("pause",n.value),d.pause()}function x(){l.value&&(o.value=!1,p("restart"),m.value=[],d.restart())}const m=e.ref([]);async function M(){if(!l.value||o.value)return;const s=await d.lap();s&&(m.value.push(s),p("lap",m.value))}function I({timestamp:s,elapsed:r,formatted:i}){n.value={timestamp:s,elapsed:r,formatted:i}}const h=e.computed(()=>Math.min(a.value.width,a.value.height)/2.5*t.value.stopwatch.track.radiusRatio);function R(s,r){const y=360/(r*1e3);return s*y%360}function $(s){let r=s*(Math.PI/180),i=a.value.width/2+h.value*Math.cos(r),y=a.value.height/2+h.value*Math.sin(r);return{cx:i,cy:y}}const f=e.computed(()=>{const s=R(n.value.elapsed,t.value.stopwatch.cycleSeconds),{cx:r,cy:i}=$(s-90),y=s>180?1:0;return{cx:r||a.value.width/2,cy:i||a.value.height/2-h.value,largeArcFlag:y,sweepFlag:1}});return N({start:S,pause:E,reset:P,restart:x,lap:M}),(s,r)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"timerChart",ref:g,class:"vue-ui-timer",style:e.normalizeStyle({fontFamily:t.value.style.fontFamily,width:"100%",height:t.value.responsive?"100%":"auto",textAlign:"center"})},[t.value.style.title.text?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"chartTitle",ref:C,style:e.normalizeStyle({width:"100%",background:t.value.style.backgroundColor})},[e.createVNode(H._sfc_main,{config:{title:{cy:"title",...t.value.style.title},subtitle:{cy:"subtitle",...t.value.style.title.subtitle}}},null,8,["config"])],4)):e.createCommentVNode("",!0),(e.openBlock(),e.createElementBlock("svg",{xmlns:e.unref(w.XMLNS),viewBox:`0 0 ${a.value.width<=0?10:a.value.width} ${a.value.height<=0?10:a.value.height}`,style:e.normalizeStyle({maxWidth:"100%",overflow:"visible",background:t.value.style.backgroundColor})},[t.value.stopwatch.tracker.gradient.show?(e.openBlock(),e.createElementBlock("defs",O,[e.createElementVNode("radialGradient",{id:`tracker_gradient_${u.value}`,cx:"50%",cy:"50%",r:"50%",fx:"50%",fy:"50%"},[e.createElementVNode("stop",{offset:"0%","stop-color":t.value.stopwatch.tracker.gradient.color},null,8,U),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.stopwatch.tracker.fill},null,8,W)],8,q)])):e.createCommentVNode("",!0),e.createElementVNode("circle",{cx:a.value.width/2,cy:a.value.height/2,r:h.value,fill:t.value.stopwatch.track.fill,stroke:t.value.stopwatch.track.stroke,"stroke-width":t.value.stopwatch.track.strokeWidth},null,8,G),t.value.stopwatch.cycleTrack.show?(e.openBlock(),e.createElementBlock("path",{key:1,d:`M ${a.value.width/2},${a.value.height/2-h.value} A ${h.value},${h.value} 0 ${f.value.largeArcFlag},${f.value.sweepFlag} ${f.value.cx},${f.value.cy}`,stroke:t.value.stopwatch.cycleTrack.stroke,"stroke-width":t.value.stopwatch.cycleTrack.strokeWidth,"stroke-linecap":"round",fill:"none"},null,8,X)):e.createCommentVNode("",!0),e.createElementVNode("circle",e.mergeProps(f.value,{r:a.value.tracker.core,fill:t.value.stopwatch.tracker.gradient.show?`url(#tracker_gradient_${u.value})`:t.value.stopwatch.tracker.fill,stroke:t.value.stopwatch.tracker.stroke,"stroke-width":t.value.stopwatch.tracker.strokeWidth}),null,16,J),t.value.stopwatch.tracker.aura.show?(e.openBlock(),e.createElementBlock("circle",e.mergeProps({key:2},f.value,{r:a.value.tracker.aura,fill:`${t.value.stopwatch.tracker.aura.fill}20`,stroke:t.value.stopwatch.tracker.aura.stroke,"stroke-width":t.value.stopwatch.tracker.aura.strokeWidth}),null,16,K)):e.createCommentVNode("",!0),s.$slots.time?(e.openBlock(),e.createElementBlock("foreignObject",{key:3,x:a.value.width/2,y:a.value.height/2,height:"0.1",width:"0.1",style:{overflow:"visible"}},[e.renderSlot(s.$slots,"time",e.normalizeProps(e.guardReactiveProps({...n.value})),void 0,!0)],8,Q)):(e.openBlock(),e.createElementBlock("text",{key:4,x:a.value.width/2,y:a.value.height/2+a.value.label/4,"font-size":a.value.label,"text-anchor":"middle",fill:t.value.stopwatch.label.color,"font-weight":t.value.stopwatch.label.bold?"bold":"normal",style:{"font-variant-numeric":"tabular-nums !important"}},e.toDisplayString(n.value.formatted||c.value),9,Y))],12,j)),e.createElementVNode("div",{ref_key:"chartLegend",ref:B,style:e.normalizeStyle({width:"100%",backgroundColor:t.value.stopwatch.legend.backgroundColor})},[s.$slots.controls?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Z,[t.value.stopwatch.legend.buttons.start?(e.openBlock(),e.createElementBlock("button",{key:0,title:t.value.stopwatch.legend.buttonTitles.start,onClick:S,class:"vue-ui-timer-button",style:e.normalizeStyle({opacity:l.value?.2:1,cursor:l.value?"default":"pointer"})},[e.createVNode(b.default,{name:"play",stroke:t.value.stopwatch.legend.buttons.iconColor},null,8,["stroke"])],12,ee)):e.createCommentVNode("",!0),t.value.stopwatch.legend.buttons.pause?(e.openBlock(),e.createElementBlock("button",{key:1,title:o.value?t.value.stopwatch.legend.buttonTitles.resume:t.value.stopwatch.legend.buttonTitles.pause,onClick:E,class:"vue-ui-timer-button",style:e.normalizeStyle({opacity:l.value?1:.2,cursor:l.value?"pointer":"default"})},[e.createVNode(b.default,{name:"pause",stroke:t.value.stopwatch.legend.buttons.iconColor},null,8,["stroke"])],12,te)):e.createCommentVNode("",!0),t.value.stopwatch.legend.buttons.reset?(e.openBlock(),e.createElementBlock("button",{key:2,title:t.value.stopwatch.legend.buttonTitles.reset,onClick:P,class:"vue-ui-timer-button",style:e.normalizeStyle({opacity:l.value?1:.2,cursor:l.value?"pointer":"default"})},[e.createVNode(b.default,{name:"stop",stroke:t.value.stopwatch.legend.buttons.iconColor},null,8,["stroke"])],12,ae)):e.createCommentVNode("",!0),t.value.stopwatch.legend.buttons.restart?(e.openBlock(),e.createElementBlock("button",{key:3,title:t.value.stopwatch.legend.buttonTitles.restart,onClick:x,class:"vue-ui-timer-button",style:e.normalizeStyle({opacity:l.value?1:.2,cursor:l.value?"pointer":"default"})},[e.createVNode(b.default,{name:"restart",stroke:t.value.stopwatch.legend.buttons.iconColor},null,8,["stroke"])],12,le)):e.createCommentVNode("",!0),t.value.stopwatch.legend.buttons.lap?(e.openBlock(),e.createElementBlock("button",{key:4,title:t.value.stopwatch.legend.buttonTitles.lap,onClick:M,class:"vue-ui-timer-button",style:e.normalizeStyle({opacity:l.value&&!o.value?1:.2,cursor:l.value&&!o.value?"pointer":"default"})},[e.createVNode(b.default,{name:"lap",stroke:t.value.stopwatch.legend.buttons.iconColor},null,8,["stroke"])],12,se)):e.createCommentVNode("",!0)])),e.renderSlot(s.$slots,"controls",e.normalizeProps(e.guardReactiveProps({start:S,pause:E,reset:P,restart:x,lap:M,laps:m.value,isRunning:l.value,isPaused:o.value,...n.value})),void 0,!0),e.renderSlot(s.$slots,"laps",e.normalizeProps(e.guardReactiveProps({laps:m.value,lap:M,isRunning:l.value,isPaused:o.value,...n.value})),void 0,!0)],4)],4))}},re=A._export_sfc(oe,[["__scopeId","data-v-1e579c02"]]);exports.default=re;