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,596 @@
1
+ import { computed as f, ref as d, onMounted as ve, openBlock as i, createElementBlock as u, normalizeClass as K, normalizeStyle as P, createVNode as N, createCommentVNode as y, createBlock as R, unref as g, createSlots as ye, withCtx as c, renderSlot as p, normalizeProps as D, guardReactiveProps as G, createElementVNode as r, Fragment as C, renderList as S, toDisplayString as m, createTextVNode as Q, nextTick as he } from "vue";
2
+ import { u as ce, c as fe, t as ge, o as pe, e as be, X as xe, s as Z, r as B, v as me, w as we, n as _e, q as ke } from "./index-BMCvLyab.js";
3
+ import { t as Ce, u as $e } from "./useResponsive-NZB-WLRF.js";
4
+ import { _ as Te } from "./Title-BNPZwnkp.js";
5
+ import { u as Le, U as Se } from "./usePrinter-BuuBz5JR.js";
6
+ import { _ as ze } from "./Tooltip-ZnJAz6dl.js";
7
+ import { D as Ae } from "./DataTable-CaB7GIwQ.js";
8
+ import Fe from "./vue-ui-skeleton-BisWX1sO.js";
9
+ import Ie from "./vue-ui-accordion-CLlVxx3Q.js";
10
+ import { u as ee } from "./useNestedProp-CkP8xhG_.js";
11
+ import { _ as Me } from "./_plugin-vue_export-helper-CHgC5LLL.js";
12
+ const Oe = ["id"], Pe = ["xmlns", "viewBox"], Ne = ["id"], Re = ["stop-color"], De = ["stop-color"], Ge = ["id"], Be = ["stop-color"], Ee = ["stop-color"], We = ["x", "y", "width", "height", "fill", "rx"], Xe = ["x", "y", "width", "height", "fill", "rx"], Ue = ["x", "y", "width", "height", "fill", "rx"], Ve = ["x", "y", "width", "height", "fill", "rx"], je = { key: 0 }, He = ["x", "y", "fill", "font-size", "font-weight"], Ye = ["x", "y", "fill", "font-size", "font-weight"], qe = { key: 1 }, Je = ["x", "y", "font-size", "fill", "font-weight"], Ke = { key: 2 }, Qe = { key: 0 }, Ze = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], et = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], tt = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], lt = ["x", "y", "font-size", "fill", "font-weight"], at = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], ot = ["x", "y", "font-size", "fill", "font-weight"], st = ["x", "y", "font-size", "fill", "font-weight"], it = ["x", "y", "width", "height", "fill", "onMouseover"], ut = {
13
+ __name: "vue-ui-age-pyramid",
14
+ props: {
15
+ config: {
16
+ type: Object,
17
+ default() {
18
+ return {};
19
+ }
20
+ },
21
+ dataset: {
22
+ type: Array,
23
+ default() {
24
+ return [];
25
+ }
26
+ }
27
+ },
28
+ setup(E, { expose: te }) {
29
+ const h = E, { vue_ui_age_pyramid: le } = ce(), z = f(() => !!h.dataset && h.dataset.length), b = d(fe()), ae = d(null), I = d(!1), M = d(""), A = d(null), W = d(0), $ = d(null), X = d(null), e = f(() => {
30
+ const t = ee({
31
+ userConfig: h.config,
32
+ defaultConfig: le
33
+ });
34
+ return t.theme ? {
35
+ ...ee({
36
+ userConfig: ge.vue_ui_age_pyramid[t.theme] || h.config,
37
+ defaultConfig: t
38
+ })
39
+ } : t;
40
+ }), U = d(null);
41
+ ve(() => {
42
+ if (pe(h.dataset) && be({
43
+ componentName: "VueUiAgePyramid",
44
+ type: "dataset"
45
+ }), e.value.responsive) {
46
+ const t = Ce(() => {
47
+ const { width: s, height: l } = $e({
48
+ chart: $.value,
49
+ title: e.value.style.title.text ? X.value : null
50
+ });
51
+ v.value.width = s, v.value.height = l;
52
+ });
53
+ U.value = new ResizeObserver(t), U.value.observe($.value.parentNode);
54
+ }
55
+ });
56
+ const { isPrinting: oe, isImaging: se, generatePdf: V, generateImage: j } = Le({
57
+ elementId: `vue-ui-age-pyramid_${b.value}`,
58
+ fileName: e.value.style.title.text || "vue-ui-age-pyramid"
59
+ }), x = d({
60
+ showTable: e.value.table.show,
61
+ showTooltip: e.value.style.tooltip.show
62
+ }), v = d({
63
+ height: e.value.style.height,
64
+ width: e.value.style.width
65
+ }), o = f(() => {
66
+ const t = v.value.width - e.value.style.layout.padding.right - e.value.style.layout.padding.left, s = e.value.style.layout.padding.left, l = v.value.width - e.value.style.layout.padding.right;
67
+ return {
68
+ top: e.value.style.layout.padding.top,
69
+ left: s,
70
+ right: l,
71
+ bottom: v.value.height - e.value.style.layout.padding.bottom,
72
+ width: t,
73
+ height: v.value.height - e.value.style.layout.padding.top - e.value.style.layout.padding.bottom,
74
+ centerX: e.value.style.layout.padding.left + t / 2,
75
+ leftChart: {
76
+ width: t / 2 - e.value.style.layout.centerSlit.width,
77
+ right: s + t / 2 - e.value.style.layout.centerSlit.width
78
+ },
79
+ rightChart: {
80
+ width: t / 2 - e.value.style.layout.centerSlit.width,
81
+ left: s + t / 2 + e.value.style.layout.centerSlit.width
82
+ }
83
+ };
84
+ }), ie = f(() => h.dataset.map((t) => e.value.style.layout.dataLabels.yAxis.display === "age" ? t[1] : t[0])), w = f(() => {
85
+ const t = ue(T.value / 5), s = [], l = [];
86
+ for (let a = 0; a <= 5; a += 1) {
87
+ const n = t * a, J = t * (a - 5);
88
+ s.push({
89
+ value: n,
90
+ x: o.value.left + o.value.width / 2 + e.value.style.layout.centerSlit.width + n / T.value * o.value.leftChart.width
91
+ }), l.push({
92
+ value: Math.abs(J),
93
+ x: o.value.left + o.value.width / 2 + J / T.value * o.value.leftChart.width - e.value.style.layout.centerSlit.width
94
+ });
95
+ }
96
+ return {
97
+ right: s,
98
+ left: l
99
+ };
100
+ });
101
+ function ue(t) {
102
+ if (t === 0) return 0;
103
+ const l = 10 ** Math.floor(Math.log10(Math.abs(t)));
104
+ let a;
105
+ return t < 0, a = Math.round(t / l) * l, a;
106
+ }
107
+ const T = f(() => Math.max(...h.dataset.flatMap((t) => t.slice(-2)))), _ = f(() => h.dataset.length), re = f(() => h.dataset.map((t) => ({
108
+ segment: t[0],
109
+ age: t[1],
110
+ left: {
111
+ value: t[2],
112
+ proportionToMax: t[2] / T.value
113
+ },
114
+ right: {
115
+ value: t[3],
116
+ proportionToMax: t[3] / T.value
117
+ }
118
+ }))), k = f(() => re.value.map((t, s) => {
119
+ const l = o.value.top + o.value.height / _.value * s, a = o.value.height / _.value - e.value.style.layout.bars.gap;
120
+ return {
121
+ segment: t.segment,
122
+ age: t.age,
123
+ left: {
124
+ ...t.left,
125
+ y: l,
126
+ color: e.value.style.layout.bars.left.color,
127
+ x: o.value.leftChart.right - t.left.proportionToMax * o.value.leftChart.width,
128
+ width: t.left.proportionToMax * o.value.leftChart.width,
129
+ height: a
130
+ },
131
+ right: {
132
+ ...t.right,
133
+ y: l,
134
+ color: e.value.style.layout.bars.right.color,
135
+ x: o.value.rightChart.left,
136
+ width: t.right.proportionToMax * o.value.rightChart.width,
137
+ height: a
138
+ }
139
+ };
140
+ })), O = d(null);
141
+ function ne(t, s) {
142
+ A.value = t, O.value = {
143
+ datapoint: s,
144
+ seriesIndex: t,
145
+ series: k.value,
146
+ config: e.value
147
+ };
148
+ const l = e.value.style.tooltip.customFormat;
149
+ if (me(l) && we(() => l({
150
+ seriesIndex: t,
151
+ datapoint: {
152
+ segment: s[0],
153
+ index: s[1],
154
+ left: s[2],
155
+ right: s[3]
156
+ },
157
+ series: k.value,
158
+ config: e.value
159
+ })))
160
+ M.value = l({
161
+ seriesIndex: t,
162
+ datapoint: {
163
+ segment: s[0],
164
+ index: s[1],
165
+ left: s[2],
166
+ right: s[3]
167
+ },
168
+ series: k.value,
169
+ config: e.value
170
+ });
171
+ else {
172
+ let a = "";
173
+ const n = k.value[t];
174
+ a += `<div><b>${n.segment}</b></div>`, a += `<div>${e.value.translations.age}: ${n.age}</div>`, a += `<div style="margin-top:6px;padding-top:6px;border-top:1px solid ${e.value.style.tooltip.borderColor}">`, a += '<div style="display:flex; flex-direction:row;gap:12px">', a += `<div style="display:flex;flex-direction:column;align-items:center;justify-content:center"><svg viewBox="0 0 12 12" height="12" width="12"><rect stroke="none" x="0" y="0" height="12" width="12" rx="2" fill="${e.value.style.layout.bars.gradient.underlayer}"/><rect stroke="none" x="0" y="0" height="12" width="12" rx="2" fill="${e.value.style.layout.bars.gradient.show ? `url(#age_pyramid_left_${b.value})` : e.value.style.layout.bars.left.color}"/></svg><div>${e.value.translations.female}</div><div><b>${n.left.value.toLocaleString()}</b></div></div>`, a += `<div style="display:flex;flex-direction:column;align-items:center;justify-content:center"><svg viewBox="0 0 12 12" height="12" width="12"><rect stroke="none" x="0" y="0" height="12" width="12" rx="2" fill="${e.value.style.layout.bars.gradient.underlayer}"/><rect stroke="none" x="0" y="0" height="12" width="12" rx="2" fill="${e.value.style.layout.bars.gradient.show ? `url(#age_pyramid_right_${b.value})` : e.value.style.layout.bars.right.color}"/></svg><div>${e.value.translations.male}</div><div><b>${n.right.value.toLocaleString()}</b></div></div>`, a += "</div>", a += `<div style="margin-top:6px;padding-top:6px;border-top:1px solid ${e.value.style.tooltip.borderColor}"><div>${e.value.translations.total}</div><div><b>${(n.left.value + n.right.value).toLocaleString()}</b></div></div>`, a += "</div>", M.value = `<div>${a}</div>`;
175
+ }
176
+ I.value = !0;
177
+ }
178
+ function H() {
179
+ he(() => {
180
+ const t = [e.value.translations.year, e.value.translations.age, e.value.translations.female, e.value.translations.male, e.value.translations.total], s = h.dataset.map((n) => [
181
+ n[0],
182
+ n[1],
183
+ n[2],
184
+ n[3],
185
+ n[2] + n[3]
186
+ ]), l = [[e.value.style.title.text], [e.value.style.title.subtitle.text], [[""], [""], [""]]].concat([t]).concat(s), a = _e(l);
187
+ ke({ csvContent: a, title: e.value.style.title.text || "vue-ui-heatmap" });
188
+ });
189
+ }
190
+ const F = f(() => {
191
+ const t = [
192
+ e.value.translations.year,
193
+ e.value.translations.age,
194
+ e.value.translations.female,
195
+ e.value.translations.male,
196
+ e.value.translations.total
197
+ ], s = h.dataset.map((a) => [
198
+ a[0],
199
+ a[1],
200
+ a[2].toLocaleString(),
201
+ a[3].toLocaleString(),
202
+ (a[2] + a[3]).toLocaleString()
203
+ ]), l = {
204
+ th: {
205
+ backgroundColor: e.value.table.th.backgroundColor,
206
+ color: e.value.table.th.color,
207
+ outline: e.value.table.th.outline
208
+ },
209
+ td: {
210
+ backgroundColor: e.value.table.td.backgroundColor,
211
+ color: e.value.table.td.color,
212
+ outline: e.value.table.td.outline
213
+ },
214
+ breakpoint: e.value.table.responsiveBreakpoint
215
+ };
216
+ return { head: t, body: s, config: l, colNames: t };
217
+ }), L = d(!1);
218
+ function de(t) {
219
+ L.value = t, W.value += 1;
220
+ }
221
+ function Y() {
222
+ x.value.showTable = !x.value.showTable;
223
+ }
224
+ function q() {
225
+ x.value.showTooltip = !x.value.showTooltip;
226
+ }
227
+ return te({
228
+ generatePdf: V,
229
+ generateCsv: H,
230
+ generateImage: j,
231
+ toggleTable: Y,
232
+ toggleTooltip: q
233
+ }), (t, s) => (i(), u("div", {
234
+ class: K(`vue-ui-age-pyramid ${L.value ? "vue-data-ui-wrapper-fullscreen" : ""}`),
235
+ ref_key: "agePyramid",
236
+ ref: $,
237
+ id: `vue-ui-age-pyramid_${b.value}`,
238
+ style: P(`font-family:${e.value.style.fontFamily};width:100%; text-align:center;${e.value.style.title.text ? "" : "padding-top:36px"};background:${e.value.style.backgroundColor};${e.value.responsive ? "height:100%" : ""}`)
239
+ }, [
240
+ e.value.style.title.text ? (i(), u("div", {
241
+ key: 0,
242
+ ref_key: "chartTitle",
243
+ ref: X,
244
+ style: P(`width:100%;background:${e.value.style.backgroundColor}`)
245
+ }, [
246
+ N(Te, {
247
+ config: {
248
+ title: {
249
+ cy: "pyramid-div-title",
250
+ ...e.value.style.title
251
+ },
252
+ subtitle: {
253
+ cy: "pyramid-div-subtitle",
254
+ ...e.value.style.title.subtitle
255
+ }
256
+ }
257
+ }, null, 8, ["config"])
258
+ ], 4)) : y("", !0),
259
+ e.value.userOptions.show && z.value ? (i(), R(Se, {
260
+ ref_key: "details",
261
+ ref: ae,
262
+ key: `user_options_${W.value}`,
263
+ backgroundColor: e.value.style.backgroundColor,
264
+ color: e.value.style.color,
265
+ isImaging: g(se),
266
+ isPrinting: g(oe),
267
+ uid: b.value,
268
+ hasTooltip: e.value.userOptions.buttons.tooltip && e.value.style.tooltip.show,
269
+ hasPdf: e.value.userOptions.buttons.pdf,
270
+ hasXls: e.value.userOptions.buttons.csv,
271
+ hasImg: e.value.userOptions.buttons.img,
272
+ hasTable: e.value.userOptions.buttons.table,
273
+ hasFullscreen: e.value.userOptions.buttons.fullscreen,
274
+ isFullscreen: L.value,
275
+ isTooltip: x.value.showTooltip,
276
+ titles: { ...e.value.userOptions.buttonTitles },
277
+ chartElement: $.value,
278
+ onToggleFullscreen: de,
279
+ onGeneratePdf: g(V),
280
+ onGenerateCsv: H,
281
+ onGenerateImage: g(j),
282
+ onToggleTable: Y,
283
+ onToggleTooltip: q
284
+ }, ye({ _: 2 }, [
285
+ t.$slots.optionTooltip ? {
286
+ name: "optionTooltip",
287
+ fn: c(() => [
288
+ p(t.$slots, "optionTooltip", {}, void 0, !0)
289
+ ]),
290
+ key: "0"
291
+ } : void 0,
292
+ t.$slots.optionPdf ? {
293
+ name: "optionPdf",
294
+ fn: c(() => [
295
+ p(t.$slots, "optionPdf", {}, void 0, !0)
296
+ ]),
297
+ key: "1"
298
+ } : void 0,
299
+ t.$slots.optionCsv ? {
300
+ name: "optionCsv",
301
+ fn: c(() => [
302
+ p(t.$slots, "optionCsv", {}, void 0, !0)
303
+ ]),
304
+ key: "2"
305
+ } : void 0,
306
+ t.$slots.optionImg ? {
307
+ name: "optionImg",
308
+ fn: c(() => [
309
+ p(t.$slots, "optionImg", {}, void 0, !0)
310
+ ]),
311
+ key: "3"
312
+ } : void 0,
313
+ t.$slots.optionTable ? {
314
+ name: "optionTable",
315
+ fn: c(() => [
316
+ p(t.$slots, "optionTable", {}, void 0, !0)
317
+ ]),
318
+ key: "4"
319
+ } : void 0,
320
+ t.$slots.optionFullscreen ? {
321
+ name: "optionFullscreen",
322
+ fn: c(({ toggleFullscreen: l, isFullscreen: a }) => [
323
+ p(t.$slots, "optionFullscreen", D(G({ toggleFullscreen: l, isFullscreen: a })), void 0, !0)
324
+ ]),
325
+ key: "5"
326
+ } : void 0
327
+ ]), 1032, ["backgroundColor", "color", "isImaging", "isPrinting", "uid", "hasTooltip", "hasPdf", "hasXls", "hasImg", "hasTable", "hasFullscreen", "isFullscreen", "isTooltip", "titles", "chartElement", "onGeneratePdf", "onGenerateImage"])) : y("", !0),
328
+ z.value ? (i(), u("svg", {
329
+ key: 2,
330
+ xmlns: g(xe),
331
+ class: K({ "vue-data-ui-fullscreen--on": L.value, "vue-data-ui-fulscreen--off": !L.value }),
332
+ viewBox: `0 0 ${v.value.width <= 0 ? 10 : v.value.width} ${v.value.height <= 0 ? 10 : v.value.height}`,
333
+ style: P(`max-width:100%;overflow:visible;background:${e.value.style.backgroundColor};color:${e.value.style.color}`)
334
+ }, [
335
+ r("defs", null, [
336
+ r("linearGradient", {
337
+ id: `age_pyramid_left_${b.value}`,
338
+ x1: "0%",
339
+ y1: "0%",
340
+ x2: "100%",
341
+ y2: "0%"
342
+ }, [
343
+ r("stop", {
344
+ offset: "0%",
345
+ "stop-color": e.value.style.layout.bars.left.color
346
+ }, null, 8, Re),
347
+ r("stop", {
348
+ offset: "100%",
349
+ "stop-color": `${g(Z)(e.value.style.layout.bars.left.color, e.value.style.layout.bars.gradient.shiftHue)}${g(B)[100 - e.value.style.layout.bars.gradient.intensity]}`
350
+ }, null, 8, De)
351
+ ], 8, Ne),
352
+ r("linearGradient", {
353
+ id: `age_pyramid_right_${b.value}`,
354
+ x1: "0%",
355
+ y1: "0%",
356
+ x2: "100%",
357
+ y2: "0%"
358
+ }, [
359
+ r("stop", {
360
+ offset: "0%",
361
+ "stop-color": `${g(Z)(e.value.style.layout.bars.right.color, e.value.style.layout.bars.gradient.shiftHue)}${g(B)[100 - e.value.style.layout.bars.gradient.intensity]}`
362
+ }, null, 8, Be),
363
+ r("stop", {
364
+ offset: "100%",
365
+ "stop-color": e.value.style.layout.bars.right.color
366
+ }, null, 8, Ee)
367
+ ], 8, Ge)
368
+ ]),
369
+ (i(!0), u(C, null, S(k.value, (l, a) => (i(), u("g", null, [
370
+ r("rect", {
371
+ x: l.left.x,
372
+ y: l.left.y,
373
+ width: l.left.width <= 0 ? 1e-4 : l.left.width,
374
+ height: l.left.height <= 0 ? 1e-4 : l.left.height,
375
+ fill: e.value.style.layout.bars.gradient.underlayer,
376
+ rx: e.value.style.layout.bars.borderRadius
377
+ }, null, 8, We),
378
+ r("rect", {
379
+ x: l.left.x,
380
+ y: l.left.y,
381
+ width: l.left.width <= 0 ? 1e-4 : l.left.width,
382
+ height: l.left.height <= 0 ? 1e-4 : l.left.height,
383
+ fill: e.value.style.layout.bars.gradient.show ? `url(#age_pyramid_left_${b.value})` : l.left.color,
384
+ rx: e.value.style.layout.bars.borderRadius
385
+ }, null, 8, Xe),
386
+ r("rect", {
387
+ x: l.right.x,
388
+ y: l.right.y,
389
+ width: l.right.width <= 0 ? 1e-4 : l.right.width,
390
+ height: l.right.height <= 0 ? 1e-4 : l.right.height,
391
+ fill: e.value.style.layout.bars.gradient.underlayer,
392
+ rx: e.value.style.layout.bars.borderRadius
393
+ }, null, 8, Ue),
394
+ r("rect", {
395
+ x: l.right.x,
396
+ y: l.right.y,
397
+ width: l.right.width <= 0 ? 1e-4 : l.right.width,
398
+ height: l.right.height <= 0 ? 1e-4 : l.right.height,
399
+ fill: e.value.style.layout.bars.gradient.show ? `url(#age_pyramid_right_${b.value})` : l.right.color,
400
+ rx: e.value.style.layout.bars.borderRadius
401
+ }, null, 8, Ve)
402
+ ]))), 256)),
403
+ r("g", null, [
404
+ e.value.style.layout.dataLabels.sideTitles.show ? (i(), u("g", je, [
405
+ r("text", {
406
+ x: o.value.left,
407
+ y: o.value.top + e.value.style.layout.dataLabels.sideTitles.offsetY,
408
+ fill: e.value.style.layout.dataLabels.sideTitles.useSideColor ? e.value.style.layout.bars.left.color : e.value.style.layout.dataLabels.sideTitles.color,
409
+ "font-size": e.value.style.layout.dataLabels.sideTitles.fontSize,
410
+ "text-anchor": "start",
411
+ "font-weight": e.value.style.layout.dataLabels.sideTitles.bold ? "bold" : "normal"
412
+ }, m(e.value.translations.female), 9, He),
413
+ r("text", {
414
+ x: o.value.right,
415
+ y: o.value.top + e.value.style.layout.dataLabels.sideTitles.offsetY,
416
+ fill: e.value.style.layout.dataLabels.sideTitles.useSideColor ? e.value.style.layout.bars.right.color : e.value.style.layout.dataLabels.sideTitles.color,
417
+ "font-size": e.value.style.layout.dataLabels.sideTitles.fontSize,
418
+ "text-anchor": "end",
419
+ "font-weight": e.value.style.layout.dataLabels.sideTitles.bold ? "bold" : "normal"
420
+ }, m(e.value.translations.male), 9, Ye)
421
+ ])) : y("", !0),
422
+ e.value.style.layout.dataLabels.yAxis.show ? (i(), u("g", qe, [
423
+ (i(!0), u(C, null, S(ie.value, (l, a) => (i(), u(C, null, [
424
+ a % e.value.style.layout.dataLabels.yAxis.showEvery === 0 ? (i(), u("text", {
425
+ key: 0,
426
+ x: o.value.centerX,
427
+ y: o.value.top + o.value.height / _.value * a + e.value.style.layout.dataLabels.yAxis.fontSize / 3,
428
+ "text-anchor": "middle",
429
+ "font-size": e.value.style.layout.dataLabels.yAxis.fontSize,
430
+ fill: e.value.style.layout.dataLabels.yAxis.color,
431
+ "font-weight": e.value.style.layout.dataLabels.yAxis.bold ? "bold" : "normal"
432
+ }, m(l), 9, Je)) : y("", !0)
433
+ ], 64))), 256))
434
+ ])) : y("", !0),
435
+ e.value.style.layout.dataLabels.xAxis.show ? (i(), u("g", Ke, [
436
+ e.value.style.layout.grid.show ? (i(), u("g", Qe, [
437
+ r("line", {
438
+ x1: w.value.right[0].x,
439
+ x2: w.value.right.at(-1).x,
440
+ y1: o.value.bottom + e.value.style.layout.dataLabels.xAxis.fontSize / 2,
441
+ y2: o.value.bottom + e.value.style.layout.dataLabels.xAxis.fontSize / 2,
442
+ stroke: e.value.style.layout.grid.stroke,
443
+ "stroke-width": e.value.style.layout.grid.strokeWidth,
444
+ "stroke-linecap": "round"
445
+ }, null, 8, Ze),
446
+ r("line", {
447
+ x1: w.value.left[0].x,
448
+ x2: w.value.left.at(-1).x,
449
+ y1: o.value.bottom + e.value.style.layout.dataLabels.xAxis.fontSize / 2,
450
+ y2: o.value.bottom + e.value.style.layout.dataLabels.xAxis.fontSize / 2,
451
+ stroke: e.value.style.layout.grid.stroke,
452
+ "stroke-width": e.value.style.layout.grid.strokeWidth,
453
+ "stroke-linecap": "round"
454
+ }, null, 8, et)
455
+ ])) : y("", !0),
456
+ (i(!0), u(C, null, S(w.value.right, (l) => (i(), u("g", null, [
457
+ e.value.style.layout.grid.show ? (i(), u("line", {
458
+ key: 0,
459
+ x1: l.x,
460
+ x2: l.x,
461
+ y1: o.value.bottom + e.value.style.layout.dataLabels.xAxis.fontSize / 2,
462
+ y2: o.value.bottom + e.value.style.layout.dataLabels.xAxis.fontSize / 4,
463
+ stroke: e.value.style.layout.grid.stroke,
464
+ "stroke-width": e.value.style.layout.grid.strokeWidth,
465
+ "stroke-linecap": "round"
466
+ }, null, 8, tt)) : y("", !0),
467
+ r("text", {
468
+ x: l.x,
469
+ y: o.value.bottom + e.value.style.layout.dataLabels.xAxis.fontSize * 2,
470
+ "font-size": e.value.style.layout.dataLabels.xAxis.fontSize,
471
+ fill: e.value.style.layout.dataLabels.xAxis.color,
472
+ "text-anchor": "middle",
473
+ "font-weight": e.value.style.layout.dataLabels.xAxis.bold ? "bold" : "normal"
474
+ }, m(Number((l.value / e.value.style.layout.dataLabels.xAxis.scale).toFixed(0)).toLocaleString()), 9, lt)
475
+ ]))), 256)),
476
+ (i(!0), u(C, null, S(w.value.left, (l) => (i(), u("g", null, [
477
+ e.value.style.layout.grid.show ? (i(), u("line", {
478
+ key: 0,
479
+ x1: l.x,
480
+ x2: l.x,
481
+ y1: o.value.bottom + e.value.style.layout.dataLabels.xAxis.fontSize / 2,
482
+ y2: o.value.bottom + e.value.style.layout.dataLabels.xAxis.fontSize / 4,
483
+ stroke: e.value.style.layout.grid.stroke,
484
+ "stroke-width": e.value.style.layout.grid.strokeWidth,
485
+ "stroke-linecap": "round"
486
+ }, null, 8, at)) : y("", !0),
487
+ r("text", {
488
+ x: l.x,
489
+ y: o.value.bottom + e.value.style.layout.dataLabels.xAxis.fontSize * 2,
490
+ "font-size": e.value.style.layout.dataLabels.xAxis.fontSize,
491
+ fill: e.value.style.layout.dataLabels.xAxis.color,
492
+ "text-anchor": "middle",
493
+ "font-weight": e.value.style.layout.dataLabels.xAxis.bold ? "bold" : "normal"
494
+ }, m(Number((l.value / e.value.style.layout.dataLabels.xAxis.scale).toFixed(0)).toLocaleString()), 9, ot)
495
+ ]))), 256)),
496
+ r("text", {
497
+ x: o.value.right,
498
+ y: v.value.height,
499
+ "text-anchor": "end",
500
+ "font-size": e.value.style.layout.dataLabels.xAxis.fontSize,
501
+ fill: e.value.style.layout.dataLabels.xAxis.color,
502
+ "font-weight": e.value.style.layout.dataLabels.xAxis.bold ? "bold" : "normal"
503
+ }, m(e.value.style.layout.dataLabels.xAxis.translation), 9, st)
504
+ ])) : y("", !0)
505
+ ]),
506
+ (i(!0), u(C, null, S(E.dataset, (l, a) => (i(), u("g", null, [
507
+ r("rect", {
508
+ x: o.value.left,
509
+ y: o.value.top + o.value.height / _.value * a - e.value.style.layout.bars.gap / 2,
510
+ width: o.value.width <= 0 ? 1e-4 : o.value.width,
511
+ height: o.value.height / _.value <= 0 ? 1e-4 : o.value.height / _.value,
512
+ fill: A.value !== null && A.value === a ? `${e.value.style.highlighter.color}${g(B)[e.value.style.highlighter.opacity]}` : "transparent",
513
+ onMouseover: (n) => ne(a, l),
514
+ onMouseleave: s[0] || (s[0] = (n) => {
515
+ A.value = null, I.value = !1;
516
+ })
517
+ }, null, 40, it)
518
+ ]))), 256)),
519
+ p(t.$slots, "svg", { svg: v.value }, void 0, !0)
520
+ ], 14, Pe)) : y("", !0),
521
+ z.value ? y("", !0) : (i(), R(Fe, {
522
+ key: 3,
523
+ config: {
524
+ type: "pyramid",
525
+ style: {
526
+ backgroundColor: e.value.style.backgroundColor,
527
+ pyramid: {
528
+ color: "#CCCCCC"
529
+ }
530
+ }
531
+ }
532
+ }, null, 8, ["config"])),
533
+ p(t.$slots, "legend", { legend: k.value }, void 0, !0),
534
+ N(ze, {
535
+ show: x.value.showTooltip && I.value,
536
+ backgroundColor: e.value.style.tooltip.backgroundColor,
537
+ color: e.value.style.tooltip.color,
538
+ borderRadius: e.value.style.tooltip.borderRadius,
539
+ borderColor: e.value.style.tooltip.borderColor,
540
+ borderWidth: e.value.style.tooltip.borderWidth,
541
+ fontSize: e.value.style.tooltip.fontSize,
542
+ backgroundOpacity: e.value.style.tooltip.backgroundOpacity,
543
+ parent: $.value,
544
+ content: M.value,
545
+ isCustom: e.value.style.tooltip.customFormat && typeof e.value.style.tooltip.customFormat == "function"
546
+ }, {
547
+ "tooltip-before": c(() => [
548
+ p(t.$slots, "tooltip-before", D(G({ ...O.value })), void 0, !0)
549
+ ]),
550
+ "tooltip-after": c(() => [
551
+ p(t.$slots, "tooltip-after", D(G({ ...O.value })), void 0, !0)
552
+ ]),
553
+ _: 3
554
+ }, 8, ["show", "backgroundColor", "color", "borderRadius", "borderColor", "borderWidth", "fontSize", "backgroundOpacity", "parent", "content", "isCustom"]),
555
+ z.value ? (i(), R(Ie, {
556
+ key: 4,
557
+ hideDetails: "",
558
+ config: {
559
+ open: x.value.showTable,
560
+ maxHeight: 1e4,
561
+ body: {
562
+ backgroundColor: e.value.style.backgroundColor,
563
+ color: e.value.style.color
564
+ },
565
+ head: {
566
+ backgroundColor: e.value.style.backgroundColor,
567
+ color: e.value.style.color
568
+ }
569
+ }
570
+ }, {
571
+ content: c(() => [
572
+ N(Ae, {
573
+ colNames: F.value.colNames,
574
+ head: F.value.head,
575
+ body: F.value.body,
576
+ config: F.value.config,
577
+ title: `${e.value.style.title.text}${e.value.style.title.subtitle.text ? ` : ${e.value.style.title.subtitle.text}` : ""}`,
578
+ onClose: s[1] || (s[1] = (l) => x.value.showTable = !1)
579
+ }, {
580
+ th: c(({ th: l }) => [
581
+ Q(m(l), 1)
582
+ ]),
583
+ td: c(({ td: l }) => [
584
+ Q(m(l), 1)
585
+ ]),
586
+ _: 1
587
+ }, 8, ["colNames", "head", "body", "config", "title"])
588
+ ]),
589
+ _: 1
590
+ }, 8, ["config"])) : y("", !0)
591
+ ], 14, Oe));
592
+ }
593
+ }, xt = /* @__PURE__ */ Me(ut, [["__scopeId", "data-v-44b2f1f2"]]);
594
+ export {
595
+ xt as default
596
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("vue"),u=require("./index-BkomIE9L.cjs"),F=require("./useResponsive-B3TrDDIG.cjs"),j=require("./Title-Cj_xubjI.cjs"),P=require("./usePrinter-r6uHYEcR.cjs"),Y=require("./Tooltip-CdJ5hegk.cjs"),J=require("./DataTable-ssrNbONo.cjs"),K=require("./vue-ui-skeleton-JmGp11-u.cjs"),Q=require("./vue-ui-accordion-SXsobrUt.cjs"),I=require("./useNestedProp-BMxXyPbW.cjs"),Z=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),ee=["id"],te=["xmlns","viewBox"],le=["id"],oe=["stop-color"],ae=["stop-color"],ie=["id"],re=["stop-color"],se=["stop-color"],ue=["x","y","width","height","fill","rx"],ne=["x","y","width","height","fill","rx"],de=["x","y","width","height","fill","rx"],ve=["x","y","width","height","fill","rx"],ce={key:0},ye=["x","y","fill","font-size","font-weight"],he=["x","y","fill","font-size","font-weight"],fe={key:1},ge=["x","y","font-size","fill","font-weight"],pe={key:2},be={key:0},me=["x1","x2","y1","y2","stroke","stroke-width"],xe=["x1","x2","y1","y2","stroke","stroke-width"],ke=["x1","x2","y1","y2","stroke","stroke-width"],we=["x","y","font-size","fill","font-weight"],Ce=["x1","x2","y1","y2","stroke","stroke-width"],_e=["x","y","font-size","fill","font-weight"],Se=["x","y","font-size","fill","font-weight"],Te=["x","y","width","height","fill","onMouseover"],$e={__name:"vue-ui-age-pyramid",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},setup(S,{expose:M}){const d=S,{vue_ui_age_pyramid:O}=u.useConfig(),m=t.computed(()=>!!d.dataset&&d.dataset.length),v=t.ref(u.createUid()),R=t.ref(null),w=t.ref(!1),C=t.ref(""),x=t.ref(null),T=t.ref(0),g=t.ref(null),$=t.ref(null),e=t.computed(()=>{const l=I.useNestedProp({userConfig:d.config,defaultConfig:O});return l.theme?{...I.useNestedProp({userConfig:u.themes.vue_ui_age_pyramid[l.theme]||d.config,defaultConfig:l})}:l}),L=t.ref(null);t.onMounted(()=>{if(u.objectIsEmpty(d.dataset)&&u.error({componentName:"VueUiAgePyramid",type:"dataset"}),e.value.responsive){const l=F.throttle(()=>{const{width:r,height:o}=F.useResponsive({chart:g.value,title:e.value.style.title.text?$.value:null});n.value.width=r,n.value.height=o});L.value=new ResizeObserver(l),L.value.observe(g.value.parentNode)}});const{isPrinting:D,isImaging:q,generatePdf:N,generateImage:B}=P.usePrinter({elementId:`vue-ui-age-pyramid_${v.value}`,fileName:e.value.style.title.text||"vue-ui-age-pyramid"}),c=t.ref({showTable:e.value.table.show,showTooltip:e.value.style.tooltip.show}),n=t.ref({height:e.value.style.height,width:e.value.style.width}),i=t.computed(()=>{const l=n.value.width-e.value.style.layout.padding.right-e.value.style.layout.padding.left,r=e.value.style.layout.padding.left,o=n.value.width-e.value.style.layout.padding.right;return{top:e.value.style.layout.padding.top,left:r,right:o,bottom:n.value.height-e.value.style.layout.padding.bottom,width:l,height:n.value.height-e.value.style.layout.padding.top-e.value.style.layout.padding.bottom,centerX:e.value.style.layout.padding.left+l/2,leftChart:{width:l/2-e.value.style.layout.centerSlit.width,right:r+l/2-e.value.style.layout.centerSlit.width},rightChart:{width:l/2-e.value.style.layout.centerSlit.width,left:r+l/2+e.value.style.layout.centerSlit.width}}}),G=t.computed(()=>d.dataset.map(l=>e.value.style.layout.dataLabels.yAxis.display==="age"?l[1]:l[0])),y=t.computed(()=>{const l=U(p.value/5),r=[],o=[];for(let a=0;a<=5;a+=1){const s=l*a,A=l*(a-5);r.push({value:s,x:i.value.left+i.value.width/2+e.value.style.layout.centerSlit.width+s/p.value*i.value.leftChart.width}),o.push({value:Math.abs(A),x:i.value.left+i.value.width/2+A/p.value*i.value.leftChart.width-e.value.style.layout.centerSlit.width})}return{right:r,left:o}});function U(l){if(l===0)return 0;const o=10**Math.floor(Math.log10(Math.abs(l)));let a;return l<0,a=Math.round(l/o)*o,a}const p=t.computed(()=>Math.max(...d.dataset.flatMap(l=>l.slice(-2)))),h=t.computed(()=>d.dataset.length),W=t.computed(()=>d.dataset.map(l=>({segment:l[0],age:l[1],left:{value:l[2],proportionToMax:l[2]/p.value},right:{value:l[3],proportionToMax:l[3]/p.value}}))),f=t.computed(()=>W.value.map((l,r)=>{const o=i.value.top+i.value.height/h.value*r,a=i.value.height/h.value-e.value.style.layout.bars.gap;return{segment:l.segment,age:l.age,left:{...l.left,y:o,color:e.value.style.layout.bars.left.color,x:i.value.leftChart.right-l.left.proportionToMax*i.value.leftChart.width,width:l.left.proportionToMax*i.value.leftChart.width,height:a},right:{...l.right,y:o,color:e.value.style.layout.bars.right.color,x:i.value.rightChart.left,width:l.right.proportionToMax*i.value.rightChart.width,height:a}}})),_=t.ref(null);function H(l,r){x.value=l,_.value={datapoint:r,seriesIndex:l,series:f.value,config:e.value};const o=e.value.style.tooltip.customFormat;if(u.isFunction(o)&&u.functionReturnsString(()=>o({seriesIndex:l,datapoint:{segment:r[0],index:r[1],left:r[2],right:r[3]},series:f.value,config:e.value})))C.value=o({seriesIndex:l,datapoint:{segment:r[0],index:r[1],left:r[2],right:r[3]},series:f.value,config:e.value});else{let a="";const s=f.value[l];a+=`<div><b>${s.segment}</b></div>`,a+=`<div>${e.value.translations.age}: ${s.age}</div>`,a+=`<div style="margin-top:6px;padding-top:6px;border-top:1px solid ${e.value.style.tooltip.borderColor}">`,a+='<div style="display:flex; flex-direction:row;gap:12px">',a+=`<div style="display:flex;flex-direction:column;align-items:center;justify-content:center"><svg viewBox="0 0 12 12" height="12" width="12"><rect stroke="none" x="0" y="0" height="12" width="12" rx="2" fill="${e.value.style.layout.bars.gradient.underlayer}"/><rect stroke="none" x="0" y="0" height="12" width="12" rx="2" fill="${e.value.style.layout.bars.gradient.show?`url(#age_pyramid_left_${v.value})`:e.value.style.layout.bars.left.color}"/></svg><div>${e.value.translations.female}</div><div><b>${s.left.value.toLocaleString()}</b></div></div>`,a+=`<div style="display:flex;flex-direction:column;align-items:center;justify-content:center"><svg viewBox="0 0 12 12" height="12" width="12"><rect stroke="none" x="0" y="0" height="12" width="12" rx="2" fill="${e.value.style.layout.bars.gradient.underlayer}"/><rect stroke="none" x="0" y="0" height="12" width="12" rx="2" fill="${e.value.style.layout.bars.gradient.show?`url(#age_pyramid_right_${v.value})`:e.value.style.layout.bars.right.color}"/></svg><div>${e.value.translations.male}</div><div><b>${s.right.value.toLocaleString()}</b></div></div>`,a+="</div>",a+=`<div style="margin-top:6px;padding-top:6px;border-top:1px solid ${e.value.style.tooltip.borderColor}"><div>${e.value.translations.total}</div><div><b>${(s.left.value+s.right.value).toLocaleString()}</b></div></div>`,a+="</div>",C.value=`<div>${a}</div>`}w.value=!0}function E(){t.nextTick(()=>{const l=[e.value.translations.year,e.value.translations.age,e.value.translations.female,e.value.translations.male,e.value.translations.total],r=d.dataset.map(s=>[s[0],s[1],s[2],s[3],s[2]+s[3]]),o=[[e.value.style.title.text],[e.value.style.title.subtitle.text],[[""],[""],[""]]].concat([l]).concat(r),a=u.createCsvContent(o);u.downloadCsv({csvContent:a,title:e.value.style.title.text||"vue-ui-heatmap"})})}const k=t.computed(()=>{const l=[e.value.translations.year,e.value.translations.age,e.value.translations.female,e.value.translations.male,e.value.translations.total],r=d.dataset.map(a=>[a[0],a[1],a[2].toLocaleString(),a[3].toLocaleString(),(a[2]+a[3]).toLocaleString()]),o={th:{backgroundColor:e.value.table.th.backgroundColor,color:e.value.table.th.color,outline:e.value.table.th.outline},td:{backgroundColor:e.value.table.td.backgroundColor,color:e.value.table.td.color,outline:e.value.table.td.outline},breakpoint:e.value.table.responsiveBreakpoint};return{head:l,body:r,config:o,colNames:l}}),b=t.ref(!1);function X(l){b.value=l,T.value+=1}function z(){c.value.showTable=!c.value.showTable}function V(){c.value.showTooltip=!c.value.showTooltip}return M({generatePdf:N,generateCsv:E,generateImage:B,toggleTable:z,toggleTooltip:V}),(l,r)=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(`vue-ui-age-pyramid ${b.value?"vue-data-ui-wrapper-fullscreen":""}`),ref_key:"agePyramid",ref:g,id:`vue-ui-age-pyramid_${v.value}`,style:t.normalizeStyle(`font-family:${e.value.style.fontFamily};width:100%; text-align:center;${e.value.style.title.text?"":"padding-top:36px"};background:${e.value.style.backgroundColor};${e.value.responsive?"height:100%":""}`)},[e.value.style.title.text?(t.openBlock(),t.createElementBlock("div",{key:0,ref_key:"chartTitle",ref:$,style:t.normalizeStyle(`width:100%;background:${e.value.style.backgroundColor}`)},[t.createVNode(j._sfc_main,{config:{title:{cy:"pyramid-div-title",...e.value.style.title},subtitle:{cy:"pyramid-div-subtitle",...e.value.style.title.subtitle}}},null,8,["config"])],4)):t.createCommentVNode("",!0),e.value.userOptions.show&&m.value?(t.openBlock(),t.createBlock(P.UserOptions,{ref_key:"details",ref:R,key:`user_options_${T.value}`,backgroundColor:e.value.style.backgroundColor,color:e.value.style.color,isImaging:t.unref(q),isPrinting:t.unref(D),uid:v.value,hasTooltip:e.value.userOptions.buttons.tooltip&&e.value.style.tooltip.show,hasPdf:e.value.userOptions.buttons.pdf,hasXls:e.value.userOptions.buttons.csv,hasImg:e.value.userOptions.buttons.img,hasTable:e.value.userOptions.buttons.table,hasFullscreen:e.value.userOptions.buttons.fullscreen,isFullscreen:b.value,isTooltip:c.value.showTooltip,titles:{...e.value.userOptions.buttonTitles},chartElement:g.value,onToggleFullscreen:X,onGeneratePdf:t.unref(N),onGenerateCsv:E,onGenerateImage:t.unref(B),onToggleTable:z,onToggleTooltip:V},t.createSlots({_:2},[l.$slots.optionTooltip?{name:"optionTooltip",fn:t.withCtx(()=>[t.renderSlot(l.$slots,"optionTooltip",{},void 0,!0)]),key:"0"}:void 0,l.$slots.optionPdf?{name:"optionPdf",fn:t.withCtx(()=>[t.renderSlot(l.$slots,"optionPdf",{},void 0,!0)]),key:"1"}:void 0,l.$slots.optionCsv?{name:"optionCsv",fn:t.withCtx(()=>[t.renderSlot(l.$slots,"optionCsv",{},void 0,!0)]),key:"2"}:void 0,l.$slots.optionImg?{name:"optionImg",fn:t.withCtx(()=>[t.renderSlot(l.$slots,"optionImg",{},void 0,!0)]),key:"3"}:void 0,l.$slots.optionTable?{name:"optionTable",fn:t.withCtx(()=>[t.renderSlot(l.$slots,"optionTable",{},void 0,!0)]),key:"4"}:void 0,l.$slots.optionFullscreen?{name:"optionFullscreen",fn:t.withCtx(({toggleFullscreen:o,isFullscreen:a})=>[t.renderSlot(l.$slots,"optionFullscreen",t.normalizeProps(t.guardReactiveProps({toggleFullscreen:o,isFullscreen:a})),void 0,!0)]),key:"5"}:void 0]),1032,["backgroundColor","color","isImaging","isPrinting","uid","hasTooltip","hasPdf","hasXls","hasImg","hasTable","hasFullscreen","isFullscreen","isTooltip","titles","chartElement","onGeneratePdf","onGenerateImage"])):t.createCommentVNode("",!0),m.value?(t.openBlock(),t.createElementBlock("svg",{key:2,xmlns:t.unref(u.XMLNS),class:t.normalizeClass({"vue-data-ui-fullscreen--on":b.value,"vue-data-ui-fulscreen--off":!b.value}),viewBox:`0 0 ${n.value.width<=0?10:n.value.width} ${n.value.height<=0?10:n.value.height}`,style:t.normalizeStyle(`max-width:100%;overflow:visible;background:${e.value.style.backgroundColor};color:${e.value.style.color}`)},[t.createElementVNode("defs",null,[t.createElementVNode("linearGradient",{id:`age_pyramid_left_${v.value}`,x1:"0%",y1:"0%",x2:"100%",y2:"0%"},[t.createElementVNode("stop",{offset:"0%","stop-color":e.value.style.layout.bars.left.color},null,8,oe),t.createElementVNode("stop",{offset:"100%","stop-color":`${t.unref(u.shiftHue)(e.value.style.layout.bars.left.color,e.value.style.layout.bars.gradient.shiftHue)}${t.unref(u.opacity)[100-e.value.style.layout.bars.gradient.intensity]}`},null,8,ae)],8,le),t.createElementVNode("linearGradient",{id:`age_pyramid_right_${v.value}`,x1:"0%",y1:"0%",x2:"100%",y2:"0%"},[t.createElementVNode("stop",{offset:"0%","stop-color":`${t.unref(u.shiftHue)(e.value.style.layout.bars.right.color,e.value.style.layout.bars.gradient.shiftHue)}${t.unref(u.opacity)[100-e.value.style.layout.bars.gradient.intensity]}`},null,8,re),t.createElementVNode("stop",{offset:"100%","stop-color":e.value.style.layout.bars.right.color},null,8,se)],8,ie)]),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(f.value,(o,a)=>(t.openBlock(),t.createElementBlock("g",null,[t.createElementVNode("rect",{x:o.left.x,y:o.left.y,width:o.left.width<=0?1e-4:o.left.width,height:o.left.height<=0?1e-4:o.left.height,fill:e.value.style.layout.bars.gradient.underlayer,rx:e.value.style.layout.bars.borderRadius},null,8,ue),t.createElementVNode("rect",{x:o.left.x,y:o.left.y,width:o.left.width<=0?1e-4:o.left.width,height:o.left.height<=0?1e-4:o.left.height,fill:e.value.style.layout.bars.gradient.show?`url(#age_pyramid_left_${v.value})`:o.left.color,rx:e.value.style.layout.bars.borderRadius},null,8,ne),t.createElementVNode("rect",{x:o.right.x,y:o.right.y,width:o.right.width<=0?1e-4:o.right.width,height:o.right.height<=0?1e-4:o.right.height,fill:e.value.style.layout.bars.gradient.underlayer,rx:e.value.style.layout.bars.borderRadius},null,8,de),t.createElementVNode("rect",{x:o.right.x,y:o.right.y,width:o.right.width<=0?1e-4:o.right.width,height:o.right.height<=0?1e-4:o.right.height,fill:e.value.style.layout.bars.gradient.show?`url(#age_pyramid_right_${v.value})`:o.right.color,rx:e.value.style.layout.bars.borderRadius},null,8,ve)]))),256)),t.createElementVNode("g",null,[e.value.style.layout.dataLabels.sideTitles.show?(t.openBlock(),t.createElementBlock("g",ce,[t.createElementVNode("text",{x:i.value.left,y:i.value.top+e.value.style.layout.dataLabels.sideTitles.offsetY,fill:e.value.style.layout.dataLabels.sideTitles.useSideColor?e.value.style.layout.bars.left.color:e.value.style.layout.dataLabels.sideTitles.color,"font-size":e.value.style.layout.dataLabels.sideTitles.fontSize,"text-anchor":"start","font-weight":e.value.style.layout.dataLabels.sideTitles.bold?"bold":"normal"},t.toDisplayString(e.value.translations.female),9,ye),t.createElementVNode("text",{x:i.value.right,y:i.value.top+e.value.style.layout.dataLabels.sideTitles.offsetY,fill:e.value.style.layout.dataLabels.sideTitles.useSideColor?e.value.style.layout.bars.right.color:e.value.style.layout.dataLabels.sideTitles.color,"font-size":e.value.style.layout.dataLabels.sideTitles.fontSize,"text-anchor":"end","font-weight":e.value.style.layout.dataLabels.sideTitles.bold?"bold":"normal"},t.toDisplayString(e.value.translations.male),9,he)])):t.createCommentVNode("",!0),e.value.style.layout.dataLabels.yAxis.show?(t.openBlock(),t.createElementBlock("g",fe,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(G.value,(o,a)=>(t.openBlock(),t.createElementBlock(t.Fragment,null,[a%e.value.style.layout.dataLabels.yAxis.showEvery===0?(t.openBlock(),t.createElementBlock("text",{key:0,x:i.value.centerX,y:i.value.top+i.value.height/h.value*a+e.value.style.layout.dataLabels.yAxis.fontSize/3,"text-anchor":"middle","font-size":e.value.style.layout.dataLabels.yAxis.fontSize,fill:e.value.style.layout.dataLabels.yAxis.color,"font-weight":e.value.style.layout.dataLabels.yAxis.bold?"bold":"normal"},t.toDisplayString(o),9,ge)):t.createCommentVNode("",!0)],64))),256))])):t.createCommentVNode("",!0),e.value.style.layout.dataLabels.xAxis.show?(t.openBlock(),t.createElementBlock("g",pe,[e.value.style.layout.grid.show?(t.openBlock(),t.createElementBlock("g",be,[t.createElementVNode("line",{x1:y.value.right[0].x,x2:y.value.right.at(-1).x,y1:i.value.bottom+e.value.style.layout.dataLabels.xAxis.fontSize/2,y2:i.value.bottom+e.value.style.layout.dataLabels.xAxis.fontSize/2,stroke:e.value.style.layout.grid.stroke,"stroke-width":e.value.style.layout.grid.strokeWidth,"stroke-linecap":"round"},null,8,me),t.createElementVNode("line",{x1:y.value.left[0].x,x2:y.value.left.at(-1).x,y1:i.value.bottom+e.value.style.layout.dataLabels.xAxis.fontSize/2,y2:i.value.bottom+e.value.style.layout.dataLabels.xAxis.fontSize/2,stroke:e.value.style.layout.grid.stroke,"stroke-width":e.value.style.layout.grid.strokeWidth,"stroke-linecap":"round"},null,8,xe)])):t.createCommentVNode("",!0),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(y.value.right,o=>(t.openBlock(),t.createElementBlock("g",null,[e.value.style.layout.grid.show?(t.openBlock(),t.createElementBlock("line",{key:0,x1:o.x,x2:o.x,y1:i.value.bottom+e.value.style.layout.dataLabels.xAxis.fontSize/2,y2:i.value.bottom+e.value.style.layout.dataLabels.xAxis.fontSize/4,stroke:e.value.style.layout.grid.stroke,"stroke-width":e.value.style.layout.grid.strokeWidth,"stroke-linecap":"round"},null,8,ke)):t.createCommentVNode("",!0),t.createElementVNode("text",{x:o.x,y:i.value.bottom+e.value.style.layout.dataLabels.xAxis.fontSize*2,"font-size":e.value.style.layout.dataLabels.xAxis.fontSize,fill:e.value.style.layout.dataLabels.xAxis.color,"text-anchor":"middle","font-weight":e.value.style.layout.dataLabels.xAxis.bold?"bold":"normal"},t.toDisplayString(Number((o.value/e.value.style.layout.dataLabels.xAxis.scale).toFixed(0)).toLocaleString()),9,we)]))),256)),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(y.value.left,o=>(t.openBlock(),t.createElementBlock("g",null,[e.value.style.layout.grid.show?(t.openBlock(),t.createElementBlock("line",{key:0,x1:o.x,x2:o.x,y1:i.value.bottom+e.value.style.layout.dataLabels.xAxis.fontSize/2,y2:i.value.bottom+e.value.style.layout.dataLabels.xAxis.fontSize/4,stroke:e.value.style.layout.grid.stroke,"stroke-width":e.value.style.layout.grid.strokeWidth,"stroke-linecap":"round"},null,8,Ce)):t.createCommentVNode("",!0),t.createElementVNode("text",{x:o.x,y:i.value.bottom+e.value.style.layout.dataLabels.xAxis.fontSize*2,"font-size":e.value.style.layout.dataLabels.xAxis.fontSize,fill:e.value.style.layout.dataLabels.xAxis.color,"text-anchor":"middle","font-weight":e.value.style.layout.dataLabels.xAxis.bold?"bold":"normal"},t.toDisplayString(Number((o.value/e.value.style.layout.dataLabels.xAxis.scale).toFixed(0)).toLocaleString()),9,_e)]))),256)),t.createElementVNode("text",{x:i.value.right,y:n.value.height,"text-anchor":"end","font-size":e.value.style.layout.dataLabels.xAxis.fontSize,fill:e.value.style.layout.dataLabels.xAxis.color,"font-weight":e.value.style.layout.dataLabels.xAxis.bold?"bold":"normal"},t.toDisplayString(e.value.style.layout.dataLabels.xAxis.translation),9,Se)])):t.createCommentVNode("",!0)]),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(S.dataset,(o,a)=>(t.openBlock(),t.createElementBlock("g",null,[t.createElementVNode("rect",{x:i.value.left,y:i.value.top+i.value.height/h.value*a-e.value.style.layout.bars.gap/2,width:i.value.width<=0?1e-4:i.value.width,height:i.value.height/h.value<=0?1e-4:i.value.height/h.value,fill:x.value!==null&&x.value===a?`${e.value.style.highlighter.color}${t.unref(u.opacity)[e.value.style.highlighter.opacity]}`:"transparent",onMouseover:s=>H(a,o),onMouseleave:r[0]||(r[0]=s=>{x.value=null,w.value=!1})},null,40,Te)]))),256)),t.renderSlot(l.$slots,"svg",{svg:n.value},void 0,!0)],14,te)):t.createCommentVNode("",!0),m.value?t.createCommentVNode("",!0):(t.openBlock(),t.createBlock(K.default,{key:3,config:{type:"pyramid",style:{backgroundColor:e.value.style.backgroundColor,pyramid:{color:"#CCCCCC"}}}},null,8,["config"])),t.renderSlot(l.$slots,"legend",{legend:f.value},void 0,!0),t.createVNode(Y._sfc_main,{show:c.value.showTooltip&&w.value,backgroundColor:e.value.style.tooltip.backgroundColor,color:e.value.style.tooltip.color,borderRadius:e.value.style.tooltip.borderRadius,borderColor:e.value.style.tooltip.borderColor,borderWidth:e.value.style.tooltip.borderWidth,fontSize:e.value.style.tooltip.fontSize,backgroundOpacity:e.value.style.tooltip.backgroundOpacity,parent:g.value,content:C.value,isCustom:e.value.style.tooltip.customFormat&&typeof e.value.style.tooltip.customFormat=="function"},{"tooltip-before":t.withCtx(()=>[t.renderSlot(l.$slots,"tooltip-before",t.normalizeProps(t.guardReactiveProps({..._.value})),void 0,!0)]),"tooltip-after":t.withCtx(()=>[t.renderSlot(l.$slots,"tooltip-after",t.normalizeProps(t.guardReactiveProps({..._.value})),void 0,!0)]),_:3},8,["show","backgroundColor","color","borderRadius","borderColor","borderWidth","fontSize","backgroundOpacity","parent","content","isCustom"]),m.value?(t.openBlock(),t.createBlock(Q.default,{key:4,hideDetails:"",config:{open:c.value.showTable,maxHeight:1e4,body:{backgroundColor:e.value.style.backgroundColor,color:e.value.style.color},head:{backgroundColor:e.value.style.backgroundColor,color:e.value.style.color}}},{content:t.withCtx(()=>[t.createVNode(J.DataTable,{colNames:k.value.colNames,head:k.value.head,body:k.value.body,config:k.value.config,title:`${e.value.style.title.text}${e.value.style.title.subtitle.text?` : ${e.value.style.title.subtitle.text}`:""}`,onClose:r[1]||(r[1]=o=>c.value.showTable=!1)},{th:t.withCtx(({th:o})=>[t.createTextVNode(t.toDisplayString(o),1)]),td:t.withCtx(({td:o})=>[t.createTextVNode(t.toDisplayString(o),1)]),_:1},8,["colNames","head","body","config","title"])]),_:1},8,["config"])):t.createCommentVNode("",!0)],14,ee))}},Le=Z._export_sfc($e,[["__scopeId","data-v-44b2f1f2"]]);exports.default=Le;