vue-data-ui 2.3.10 → 2.3.12

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 (140) hide show
  1. package/dist/{Arrow-f4c5AEIv.cjs → Arrow-CAMiXnML.cjs} +1 -1
  2. package/dist/{Arrow-BO8QA2_F.js → Arrow-D9RknCbe.js} +1 -1
  3. package/dist/{BaseIcon-BGeIE3vn.cjs → BaseIcon-5MAyZTOz.cjs} +1 -1
  4. package/dist/{BaseIcon-NaAlKaAM.js → BaseIcon-DB1g9sdS.js} +1 -1
  5. package/dist/{DataTable-R7hmQ0wl.js → DataTable-Bza1ed62.js} +2 -2
  6. package/dist/{DataTable-CXkMZ3ja.cjs → DataTable-CGX9xKvm.cjs} +1 -1
  7. package/dist/{Legend-VoYDt_v5.cjs → Legend-BEMGbN0s.cjs} +1 -1
  8. package/dist/{Legend-BKBuWgj8.js → Legend-C4cCpb4z.js} +1 -1
  9. package/dist/{Shape-DH2ovwu7.cjs → Shape-BTzik3V0.cjs} +1 -1
  10. package/dist/{Shape-CCI8C_dI.js → Shape-Bttb-v8s.js} +1 -1
  11. package/dist/{Slicer-CPQW_sm_.cjs → Slicer-CuwuufTu.cjs} +1 -1
  12. package/dist/{Slicer-C1zx1qMy.js → Slicer-WyjxXfiD.js} +1 -1
  13. package/dist/{Title-DJ269q6H.js → Title-BSpLzDC1.js} +1 -1
  14. package/dist/{Title-gCBF7AU7.cjs → Title-XRMcJkna.cjs} +1 -1
  15. package/dist/{Tooltip-Qv4VexrA.cjs → Tooltip-COgv-iii.cjs} +1 -1
  16. package/dist/{Tooltip-CKKSlbSq.js → Tooltip-DI8_Wjjy.js} +1 -1
  17. package/dist/{index-Xau3hcRk.cjs → index-BDKEFvEF.cjs} +1 -1
  18. package/dist/{index-BK818aZo.js → index-ByO3Ywek.js} +1 -1
  19. package/dist/style.css +1 -1
  20. package/dist/types/vue-data-ui.d.cts +3 -2
  21. package/dist/types/vue-data-ui.d.ts +3 -2
  22. package/dist/{useNestedProp-hi25rRoY.js → useNestedProp-Da77DnaA.js} +1 -1
  23. package/dist/{useNestedProp-C_EQ-Kxy.cjs → useNestedProp-Dikfncsl.cjs} +1 -1
  24. package/dist/{usePrinter-C-2KAW2f.js → usePrinter-Dda5FBG3.js} +1 -1
  25. package/dist/{usePrinter-Dhvmhwhf.cjs → usePrinter-DedM_6px.cjs} +1 -1
  26. package/dist/{vue-data-ui-ifINAh05.cjs → vue-data-ui-CV6BvTv3.cjs} +1 -1
  27. package/dist/{vue-data-ui-DPu_2hNJ.js → vue-data-ui-Cl7hqjOh.js} +55 -55
  28. package/dist/vue-data-ui.cjs +1 -1
  29. package/dist/vue-data-ui.js +1 -1
  30. package/dist/{vue-ui-3d-bar-DPqaPUTZ.cjs → vue-ui-3d-bar-DMek7e52.cjs} +1 -1
  31. package/dist/{vue-ui-3d-bar-BaR6gHYb.js → vue-ui-3d-bar-DoFgj58m.js} +7 -7
  32. package/dist/{vue-ui-accordion-BjU8im6m.cjs → vue-ui-accordion-BytUYLYl.cjs} +1 -1
  33. package/dist/{vue-ui-accordion-CH8K6f6J.js → vue-ui-accordion-CbKHVPHh.js} +3 -3
  34. package/dist/{vue-ui-age-pyramid-CDotLSiv.js → vue-ui-age-pyramid-CZy4Y3uw.js} +8 -8
  35. package/dist/{vue-ui-age-pyramid-Dt9ILoAz.cjs → vue-ui-age-pyramid-DjlXDjMI.cjs} +1 -1
  36. package/dist/{vue-ui-annotator-C2bmdjLc.cjs → vue-ui-annotator-BJShyHMc.cjs} +1 -1
  37. package/dist/{vue-ui-annotator-CoH_aFJm.js → vue-ui-annotator-BqG8z2Ms.js} +1 -1
  38. package/dist/{vue-ui-candlestick-C5SjZVYs.cjs → vue-ui-candlestick-DJETMuli.cjs} +1 -1
  39. package/dist/{vue-ui-candlestick-G_90YTDo.js → vue-ui-candlestick-DkOQM3qu.js} +9 -9
  40. package/dist/{vue-ui-carousel-table-CptU7uki.cjs → vue-ui-carousel-table-BQipTTWP.cjs} +1 -1
  41. package/dist/{vue-ui-carousel-table-DzxLQOiB.js → vue-ui-carousel-table-C2vcNP0X.js} +4 -4
  42. package/dist/{vue-ui-chestnut-Cj5fJhR5.js → vue-ui-chestnut-D39qozSK.js} +6 -6
  43. package/dist/{vue-ui-chestnut-D8RaQMzo.cjs → vue-ui-chestnut-D3FtT3JK.cjs} +1 -1
  44. package/dist/{vue-ui-cursor-pZEn4NtN.cjs → vue-ui-cursor-CpJO5mEd.cjs} +1 -1
  45. package/dist/{vue-ui-cursor-G8ixOooh.js → vue-ui-cursor-LMFBAzPM.js} +2 -2
  46. package/dist/{vue-ui-dashboard-C46M9Oob.cjs → vue-ui-dashboard-BzOic-SZ.cjs} +1 -1
  47. package/dist/{vue-ui-dashboard-CaMDg3iT.js → vue-ui-dashboard-C-LaI61T.js} +2 -2
  48. package/dist/{vue-ui-digits-CXTC7Ypr.js → vue-ui-digits-BMoM0DwG.js} +2 -2
  49. package/dist/{vue-ui-digits-BnzhiKJT.cjs → vue-ui-digits-D2XilsJW.cjs} +1 -1
  50. package/dist/{vue-ui-donut-De--4Msd.cjs → vue-ui-donut-BYacXuN1.cjs} +1 -1
  51. package/dist/{vue-ui-donut-Caan2HEG.js → vue-ui-donut-DvESP2fh.js} +9 -9
  52. package/dist/{vue-ui-donut-evolution-CUV7vE4C.js → vue-ui-donut-evolution-Dr1MkSB2.js} +9 -9
  53. package/dist/{vue-ui-donut-evolution-DwPXJh13.cjs → vue-ui-donut-evolution-DwhuTpBB.cjs} +1 -1
  54. package/dist/{vue-ui-dumbbell-BzqRvxE9.cjs → vue-ui-dumbbell-CzYf1Etr.cjs} +1 -1
  55. package/dist/{vue-ui-dumbbell-2D7NAlDu.js → vue-ui-dumbbell-kTZ4cbhw.js} +8 -8
  56. package/dist/{vue-ui-flow-CSlnKCEh.cjs → vue-ui-flow-BJbCaSJI.cjs} +1 -1
  57. package/dist/{vue-ui-flow-DsqenwU_.js → vue-ui-flow-BkSTX5_A.js} +7 -7
  58. package/dist/{vue-ui-galaxy-WwvhRAFa.cjs → vue-ui-galaxy-Bb-A8wCU.cjs} +1 -1
  59. package/dist/{vue-ui-galaxy-CLXeRR9E.js → vue-ui-galaxy-DiKAWRBN.js} +9 -9
  60. package/dist/{vue-ui-gauge-zoUBHBL2.js → vue-ui-gauge-Dt6Cuuo0.js} +4 -4
  61. package/dist/{vue-ui-gauge-B_5_uMiG.cjs → vue-ui-gauge-DvYBrZs4.cjs} +1 -1
  62. package/dist/{vue-ui-heatmap-D-oq-QFJ.js → vue-ui-heatmap-B9B0h5N8.js} +8 -8
  63. package/dist/{vue-ui-heatmap-Gv6Y0025.cjs → vue-ui-heatmap-KHa42VW8.cjs} +1 -1
  64. package/dist/{vue-ui-kpi-Bgxu139K.cjs → vue-ui-kpi-BfqVRF0H.cjs} +1 -1
  65. package/dist/{vue-ui-kpi-CE3UnfLM.js → vue-ui-kpi-Bts4qzfH.js} +2 -2
  66. package/dist/{vue-ui-mini-loader-Fap6KDDb.js → vue-ui-mini-loader-CZtaTr-s.js} +2 -2
  67. package/dist/{vue-ui-mini-loader-KFiTgq0Z.cjs → vue-ui-mini-loader-DdlM_ms1.cjs} +1 -1
  68. package/dist/{vue-ui-molecule-CaKXLDG3.cjs → vue-ui-molecule-Cey5Cuqp.cjs} +1 -1
  69. package/dist/{vue-ui-molecule-QMshD0fQ.js → vue-ui-molecule-Y29DXzD8.js} +9 -9
  70. package/dist/{vue-ui-mood-radar-BFKJ6-wI.cjs → vue-ui-mood-radar-BGQYx51N.cjs} +1 -1
  71. package/dist/{vue-ui-mood-radar-woI18vdU.js → vue-ui-mood-radar-CaXsxM2P.js} +9 -9
  72. package/dist/{vue-ui-nested-donuts-BH8pGgVI.js → vue-ui-nested-donuts-8aIjfQHr.js} +9 -9
  73. package/dist/{vue-ui-nested-donuts-Nb5Jg_SG.cjs → vue-ui-nested-donuts-B0OSKK4x.cjs} +1 -1
  74. package/dist/{vue-ui-onion-bofmS_kO.js → vue-ui-onion-BuM5DcbA.js} +9 -9
  75. package/dist/{vue-ui-onion-BBYwZtjh.cjs → vue-ui-onion-D8Ug2z_r.cjs} +1 -1
  76. package/dist/{vue-ui-parallel-coordinate-plot-DVW0LYp7.js → vue-ui-parallel-coordinate-plot-BnylgPQ1.js} +10 -10
  77. package/dist/{vue-ui-parallel-coordinate-plot-C-ZbQgN7.cjs → vue-ui-parallel-coordinate-plot-RAjWALxs.cjs} +1 -1
  78. package/dist/{vue-ui-quadrant-DFMVk5eC.cjs → vue-ui-quadrant-Bd9XzzOJ.cjs} +1 -1
  79. package/dist/{vue-ui-quadrant-fhx9NkrR.js → vue-ui-quadrant-DpUSb39t.js} +10 -10
  80. package/dist/{vue-ui-quick-chart-S6LEQLn7.cjs → vue-ui-quick-chart-7dYq_RGE.cjs} +1 -1
  81. package/dist/{vue-ui-quick-chart-5rggkq9-.js → vue-ui-quick-chart-CMkvhuhW.js} +6 -6
  82. package/dist/{vue-ui-radar-B8RvpBi-.js → vue-ui-radar-BlHTPxa4.js} +10 -10
  83. package/dist/{vue-ui-radar-CsR9V_Sl.cjs → vue-ui-radar-DVFyhzLg.cjs} +1 -1
  84. package/dist/{vue-ui-rating-CgzLPjlb.cjs → vue-ui-rating-DRncGN96.cjs} +1 -1
  85. package/dist/{vue-ui-rating-ClQkygLG.js → vue-ui-rating-cVAVmnzB.js} +2 -2
  86. package/dist/{vue-ui-relation-circle-B2hJDB7v.js → vue-ui-relation-circle-B8iBDo0q.js} +5 -5
  87. package/dist/{vue-ui-relation-circle-D0zllKLp.cjs → vue-ui-relation-circle-C8QjpkXl.cjs} +1 -1
  88. package/dist/{vue-ui-rings-D3nNsoiU.js → vue-ui-rings-CQq3JQNk.js} +9 -9
  89. package/dist/{vue-ui-rings-CLIeS7BN.cjs → vue-ui-rings-m4MWlNsq.cjs} +1 -1
  90. package/dist/{vue-ui-scatter-DitnL-sZ.js → vue-ui-scatter-C-Egs7S_.js} +10 -10
  91. package/dist/{vue-ui-scatter-bPAA5OYI.cjs → vue-ui-scatter-mNEnBtaf.cjs} +1 -1
  92. package/dist/{vue-ui-screenshot-C-uHRqZ7.cjs → vue-ui-screenshot-Bl9jX-C2.cjs} +1 -1
  93. package/dist/{vue-ui-screenshot-DayBW_7b.js → vue-ui-screenshot-DfHSBG7u.js} +1 -1
  94. package/dist/{vue-ui-skeleton-DJtTdfNg.js → vue-ui-skeleton-BxRSQeuo.js} +2 -2
  95. package/dist/{vue-ui-skeleton-CgYrDrh-.cjs → vue-ui-skeleton-rY_nZhMQ.cjs} +1 -1
  96. package/dist/{vue-ui-smiley-CvpPFDBL.cjs → vue-ui-smiley-BWTx88Vc.cjs} +1 -1
  97. package/dist/{vue-ui-smiley-CZTyxQvT.js → vue-ui-smiley-J5ng6jFT.js} +2 -2
  98. package/dist/{vue-ui-spark-trend-DZm9J_ZI.cjs → vue-ui-spark-trend-CKllSCO9.cjs} +1 -1
  99. package/dist/{vue-ui-spark-trend--aNEsQNW.js → vue-ui-spark-trend-CSgSKyhQ.js} +4 -4
  100. package/dist/{vue-ui-sparkbar-uvq7AcMr.js → vue-ui-sparkbar-BDSuCvBs.js} +54 -47
  101. package/dist/{vue-ui-sparkbar-C43IyepC.cjs → vue-ui-sparkbar-wLasc_jU.cjs} +1 -1
  102. package/dist/{vue-ui-sparkgauge-BP11yMVn.cjs → vue-ui-sparkgauge-DLf9qwso.cjs} +1 -1
  103. package/dist/{vue-ui-sparkgauge-V1zC6qrt.js → vue-ui-sparkgauge-DsKCi2rC.js} +3 -3
  104. package/dist/vue-ui-sparkhistogram-BY9WjI96.js +261 -0
  105. package/dist/vue-ui-sparkhistogram-D3xFCR7z.cjs +1 -0
  106. package/dist/{vue-ui-sparkline-C3C9heBc.cjs → vue-ui-sparkline-BhB4gTda.cjs} +1 -1
  107. package/dist/{vue-ui-sparkline-DOAhQCt5.js → vue-ui-sparkline-D8gMceMV.js} +3 -3
  108. package/dist/{vue-ui-sparkstackbar-ObA64D3E.js → vue-ui-sparkstackbar-8ap_HMW0.js} +3 -3
  109. package/dist/{vue-ui-sparkstackbar-Bk7nIBnD.cjs → vue-ui-sparkstackbar-dINlqLlM.cjs} +1 -1
  110. package/dist/{vue-ui-strip-plot-6eenEjje.js → vue-ui-strip-plot-Duu9jsML.js} +9 -9
  111. package/dist/{vue-ui-strip-plot-CffrlZCk.cjs → vue-ui-strip-plot-wUXpoWOD.cjs} +1 -1
  112. package/dist/{vue-ui-table-BbMFv-oU.js → vue-ui-table-Bbjo6d7J.js} +1 -1
  113. package/dist/{vue-ui-table-CzAWebM5.cjs → vue-ui-table-DPBuQHl9.cjs} +1 -1
  114. package/dist/{vue-ui-table-heatmap-CR4Z6gFJ.cjs → vue-ui-table-heatmap-BWUGw4tD.cjs} +1 -1
  115. package/dist/{vue-ui-table-heatmap-B9YVKhvr.js → vue-ui-table-heatmap-CokrixjX.js} +4 -4
  116. package/dist/{vue-ui-table-sparkline-D7b-hkZg.js → vue-ui-table-sparkline-B4f74K6D.js} +5 -5
  117. package/dist/{vue-ui-table-sparkline-BZdfmaoe.cjs → vue-ui-table-sparkline-DwStFsdv.cjs} +1 -1
  118. package/dist/{vue-ui-thermometer-CfGfCzz9.js → vue-ui-thermometer-Bvw08auw.js} +5 -5
  119. package/dist/{vue-ui-thermometer-DJw8iKSK.cjs → vue-ui-thermometer-D4lvsaZQ.cjs} +1 -1
  120. package/dist/{vue-ui-timer-DjSR1opQ.cjs → vue-ui-timer-BSU22BD2.cjs} +1 -1
  121. package/dist/{vue-ui-timer-PdZYURw6.js → vue-ui-timer-C6zSHO_W.js} +4 -4
  122. package/dist/{vue-ui-tiremarks-9o6eS1Mc.js → vue-ui-tiremarks-BY4m2mEn.js} +5 -5
  123. package/dist/{vue-ui-tiremarks-DmQpv3n0.cjs → vue-ui-tiremarks-CH0_xCoD.cjs} +1 -1
  124. package/dist/{vue-ui-treemap-BQlEP4Wi.cjs → vue-ui-treemap-DIxqUkmn.cjs} +1 -1
  125. package/dist/{vue-ui-treemap-hdJRrv6w.js → vue-ui-treemap-DWBXR_CR.js} +9 -9
  126. package/dist/{vue-ui-vertical-bar-BRhV9I7i.js → vue-ui-vertical-bar-BxvhqgWg.js} +9 -9
  127. package/dist/{vue-ui-vertical-bar-CXn4FfOg.cjs → vue-ui-vertical-bar-DnPmmj4p.cjs} +1 -1
  128. package/dist/{vue-ui-waffle-CXyoderQ.js → vue-ui-waffle-BlFjCDDx.js} +9 -9
  129. package/dist/{vue-ui-waffle-CjAIw38i.cjs → vue-ui-waffle-CYpc5Enk.cjs} +1 -1
  130. package/dist/{vue-ui-wheel-BU_90Fhv.js → vue-ui-wheel-CHvx9zQF.js} +5 -5
  131. package/dist/{vue-ui-wheel-DLj-V4jn.cjs → vue-ui-wheel-WxC0_YV_.cjs} +1 -1
  132. package/dist/{vue-ui-word-cloud-DQ72J4Ro.js → vue-ui-word-cloud-BnLAMza-.js} +6 -6
  133. package/dist/{vue-ui-word-cloud-CtBamLvE.cjs → vue-ui-word-cloud-LMl5vudk.cjs} +1 -1
  134. package/dist/{vue-ui-xy-Bz15K-CC.cjs → vue-ui-xy-DHzwqXVf.cjs} +1 -1
  135. package/dist/{vue-ui-xy-DYEsmppC.js → vue-ui-xy-DStN5sP4.js} +12 -12
  136. package/dist/{vue-ui-xy-canvas-BRWp_v0p.js → vue-ui-xy-canvas-D3zCvIfh.js} +10 -10
  137. package/dist/{vue-ui-xy-canvas-DLN-ipCw.cjs → vue-ui-xy-canvas-DTjWEsfN.cjs} +1 -1
  138. package/package.json +1 -1
  139. package/dist/vue-ui-sparkhistogram-BIUsoRQJ.js +0 -244
  140. package/dist/vue-ui-sparkhistogram-Dipd391E.cjs +0 -1
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("vue"),u=require("./index-Xau3hcRk.cjs"),F=require("./useResponsive-B3TrDDIG.cjs"),j=require("./Title-gCBF7AU7.cjs"),P=require("./usePrinter-Dhvmhwhf.cjs"),Y=require("./Tooltip-Qv4VexrA.cjs"),J=require("./DataTable-CXkMZ3ja.cjs"),K=require("./vue-ui-skeleton-CgYrDrh-.cjs"),Q=require("./vue-ui-accordion-BjU8im6m.cjs"),I=require("./useNestedProp-C_EQ-Kxy.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;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("vue"),u=require("./index-BDKEFvEF.cjs"),F=require("./useResponsive-B3TrDDIG.cjs"),j=require("./Title-XRMcJkna.cjs"),P=require("./usePrinter-DedM_6px.cjs"),Y=require("./Tooltip-COgv-iii.cjs"),J=require("./DataTable-CGX9xKvm.cjs"),K=require("./vue-ui-skeleton-rY_nZhMQ.cjs"),Q=require("./vue-ui-accordion-BytUYLYl.cjs"),I=require("./useNestedProp-Dikfncsl.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;
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const I=require("./html2canvas.esm-BA_v9SIU.cjs"),b=require("./jspdf.es.min-DLYY9DTT.cjs"),u=require("./index-Xau3hcRk.cjs"),o=require("vue"),F=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),C={props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{shapes:[],lastSelectedShape:void 0}}}},data(){return{activeShape:void 0,strokeSize:1,currentPointer:{start:{x:0,y:0},end:{x:0,end:0}},currentTarget:void 0,hoveredShapeId:void 0,isBold:!1,isBulletTextMode:!1,isDash:!1,isDeleteMode:!1,isDrawing:!1,isDrawingNewShape:!0,isDrawMode:!1,isItalic:!1,isMouseDown:!1,isMoveMode:!1,isPrinting:!1,isResizeMode:!1,isSelectMode:!1,isSummaryOpen:!1,isTextMode:!1,isUnderline:!1,isWriting:!1,lastSelectedShape:this.dataset.lastSelectedShape,pointerDownId:-1,pointerPosition:{x:0,y:0},preventEdit:!0,selectedGroup:[],shapes:this.dataset.shapes?this.dataset.shapes:[],shapesOrder:[],step:Math.round(Math.random())*1e5,svgHeight:1e3,svgWidth:1e3,options:{arrow:{color:"grey",filled:!0},circle:{color:"grey",filled:!1,radius:3,strokeWidth:2},rect:{color:"grey",filled:!1,strokeWidth:2,height:12,width:12}},selectedColor:"#000000",showCaret:!1,sizeRatio:1,slottedSvg:void 0,sourceWidth:1,sourceHeight:1,textAlign:"start",textFont:20,transparency:100,transparencyCodes:u.opacity}},watch:{shapes:{handler(e){e.length===0&&(this.lastSelectedShape=void 0)}}},computed:{FINAL_CONFIG(){const e=u.useConfig().vue_ui_annotator;if(!Object.keys(this.config||{}).length)return e;const l=this.treeShake({defaultConfig:e,userConfig:this.config});return this.convertConfigColors(l)},canSelect(){return this.shapes.filter(e=>!["line","group"].includes(e.type)).length>1},colorTransparency(){return this.transparencyCodes[this.transparency>98?98:this.transparency]},cursorClass(){switch(!0){case this.isDeleteMode:return"default";case this.isMoveMode:return"move";case this.isTextMode:return"text";case this.isResizeMode:return"se-resize";default:return""}},records(){return this.shapes},userShapes(){return this.records.map(e=>{switch(!0){case(e&&e.type==="arrow"):const l=e.strokeWidth>3?5:10,s=e.strokeWidth>3?2.5:5;return`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const I=require("./html2canvas.esm-BA_v9SIU.cjs"),b=require("./jspdf.es.min-DLYY9DTT.cjs"),u=require("./index-BDKEFvEF.cjs"),o=require("vue"),F=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),C={props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{shapes:[],lastSelectedShape:void 0}}}},data(){return{activeShape:void 0,strokeSize:1,currentPointer:{start:{x:0,y:0},end:{x:0,end:0}},currentTarget:void 0,hoveredShapeId:void 0,isBold:!1,isBulletTextMode:!1,isDash:!1,isDeleteMode:!1,isDrawing:!1,isDrawingNewShape:!0,isDrawMode:!1,isItalic:!1,isMouseDown:!1,isMoveMode:!1,isPrinting:!1,isResizeMode:!1,isSelectMode:!1,isSummaryOpen:!1,isTextMode:!1,isUnderline:!1,isWriting:!1,lastSelectedShape:this.dataset.lastSelectedShape,pointerDownId:-1,pointerPosition:{x:0,y:0},preventEdit:!0,selectedGroup:[],shapes:this.dataset.shapes?this.dataset.shapes:[],shapesOrder:[],step:Math.round(Math.random())*1e5,svgHeight:1e3,svgWidth:1e3,options:{arrow:{color:"grey",filled:!0},circle:{color:"grey",filled:!1,radius:3,strokeWidth:2},rect:{color:"grey",filled:!1,strokeWidth:2,height:12,width:12}},selectedColor:"#000000",showCaret:!1,sizeRatio:1,slottedSvg:void 0,sourceWidth:1,sourceHeight:1,textAlign:"start",textFont:20,transparency:100,transparencyCodes:u.opacity}},watch:{shapes:{handler(e){e.length===0&&(this.lastSelectedShape=void 0)}}},computed:{FINAL_CONFIG(){const e=u.useConfig().vue_ui_annotator;if(!Object.keys(this.config||{}).length)return e;const l=this.treeShake({defaultConfig:e,userConfig:this.config});return this.convertConfigColors(l)},canSelect(){return this.shapes.filter(e=>!["line","group"].includes(e.type)).length>1},colorTransparency(){return this.transparencyCodes[this.transparency>98?98:this.transparency]},cursorClass(){switch(!0){case this.isDeleteMode:return"default";case this.isMoveMode:return"move";case this.isTextMode:return"text";case this.isResizeMode:return"se-resize";default:return""}},records(){return this.shapes},userShapes(){return this.records.map(e=>{switch(!0){case(e&&e.type==="arrow"):const l=e.strokeWidth>3?5:10,s=e.strokeWidth>3?2.5:5;return`
2
2
  <defs>
3
3
  <marker
4
4
  id="${e.id}"
@@ -1,6 +1,6 @@
1
1
  import p from "./html2canvas.esm-d2sM-0Wm.js";
2
2
  import { E as _ } from "./jspdf.es.min-C660YX78.js";
3
- import { r as v, u as w, x as A, y as M } from "./index-BK818aZo.js";
3
+ import { r as v, u as w, x as A, y as M } from "./index-ByO3Ywek.js";
4
4
  import { openBlock as d, createElementBlock as n, createElementVNode as r, normalizeStyle as c, toDisplayString as u, normalizeClass as y, createCommentVNode as a, withDirectives as f, vModelCheckbox as g, vModelText as C, renderSlot as O, Fragment as L, renderList as G, createStaticVNode as N, pushScopeId as m, popScopeId as T } from "vue";
5
5
  import { _ as R } from "./_plugin-vue_export-helper-CHgC5LLL.js";
6
6
  const D = {
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("vue"),i=require("./index-Xau3hcRk.cjs"),X=require("./useResponsive-B3TrDDIG.cjs"),ye=require("./Title-gCBF7AU7.cjs"),Y=require("./usePrinter-Dhvmhwhf.cjs"),he=require("./Tooltip-Qv4VexrA.cjs"),pe=require("./DataTable-CXkMZ3ja.cjs"),ge=require("./vue-ui-skeleton-CgYrDrh-.cjs"),fe=require("./Slicer-CPQW_sm_.cjs"),me=require("./vue-ui-accordion-BjU8im6m.cjs"),J=require("./useNestedProp-C_EQ-Kxy.cjs"),xe=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),ke=["id"],be=["xmlns","viewBox"],we={key:0},Ce=["id"],$e=["stop-color"],Ne=["stop-color"],_e=["stop-color"],Be=["id"],Se=["stop-color"],Ve=["stop-color"],Ee=["stop-color"],ze={key:0},Te=["x1","x2","y1","y2","stroke","stroke-width"],Fe=["x1","x2","y1","y2","stroke","stroke-width"],Ae={key:1},Le=["x1","x2","y1","y2","stroke","stroke-width"],Re=["x","y","font-size","fill","font-weight"],Pe={key:2},Ie=["transform","text-anchor","font-size","fill","font-weight"],Oe=["x1","x2","y1","y2","stroke","stroke-width"],Me={key:0},Ue=["cx","cy","r","fill"],De=["cx","cy","r","fill"],qe={key:1},We=["x1","x2","y1","y2","stroke","stroke-width"],Ge=["x1","x2","y1","y2","stroke","stroke-width"],He=["x","y","height","width","fill","rx"],je=["x","y","height","width","fill","rx","stroke","stroke-width"],Xe=["x","y","height","width","fill","onMouseover"],Ye=["innerHTML"],Je={__name:"vue-ui-candlestick",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},setup(g,{expose:K}){const h=g,{vue_ui_candlestick:Q}=i.useConfig(),m=t.computed(()=>!!h.dataset&&h.dataset.length),y=t.ref(i.createUid()),Z=t.ref(null),_=t.ref(!1),B=t.ref(""),S=t.ref(void 0),T=t.ref(0),F=t.ref(0),x=t.ref(null),A=t.ref(null),L=t.ref(null),R=t.ref(null),e=t.computed(()=>{const o=J.useNestedProp({userConfig:h.config,defaultConfig:Q});return o.theme?{...J.useNestedProp({userConfig:i.themes.vue_ui_candlestick[o.theme]||h.config,defaultConfig:o})}:o}),r=t.ref({height:e.value.style.height,width:e.value.style.width,xAxisFontSize:e.value.style.layout.grid.xAxis.dataLabels.fontSize,yAxisFontSize:e.value.style.layout.grid.yAxis.dataLabels.fontSize}),b=t.ref(null);t.onMounted(()=>{if(i.objectIsEmpty(h.dataset)&&i.error({componentName:"VueUiCandlestick",type:"dataset"}),e.value.responsive){const o=X.throttle(()=>{const{width:u,height:l}=X.useResponsive({chart:x.value,title:e.value.style.title.text?A.value:null,slicer:R.value,legend:L.value});r.value.width=u,r.value.height=l,r.value.xAxisFontSize=i.translateSize({relator:Math.min(u,l),adjuster:e.value.style.width,source:e.value.style.layout.grid.xAxis.dataLabels.fontSize,threshold:6,fallback:6}),r.value.yAxisFontSize=i.translateSize({relator:Math.min(u,l),adjuster:e.value.style.width,source:e.value.style.layout.grid.yAxis.dataLabels.fontSize,threshold:6,fallback:6})});b.value=new ResizeObserver(o),b.value.observe(x.value.parentNode)}}),t.onBeforeUnmount(()=>{b.value&&b.value.disconnect()});const{isPrinting:ee,isImaging:te,generatePdf:P,generateImage:I}=Y.usePrinter({elementId:`vue-ui-candlestick_${y.value}`,fileName:e.value.style.title.text||"vue-ui-candlestick"}),p=t.ref({showTable:e.value.table.show,showTooltip:e.value.style.tooltip.show}),s=t.computed(()=>{const{top:o,right:u,bottom:l,left:a}=e.value.style.layout.padding;return{top:o,right:r.value.width-u,left:a,bottom:r.value.height-l,width:r.value.width-a-u,height:r.value.height-o-l}}),V=t.computed(()=>h.dataset.length),d=t.ref({start:0,end:V.value}),O=t.computed(()=>h.dataset.slice(d.value.start,d.value.end)),E=t.computed(()=>(h.dataset.forEach((o,u)=>{[null,void 0].includes(o[0])&&i.error({componentName:"VueUiCandlestick",type:"datasetAttribute",property:"period (index 0)",index:u}),[null,void 0].includes(o[1])&&i.error({componentName:"VueUiCandlestick",type:"datasetAttribute",property:"open (index 1)",index:u}),[null,void 0].includes(o[2])&&i.error({componentName:"VueUiCandlestick",type:"datasetAttribute",property:"high (index 2)",index:u}),[null,void 0].includes(o[3])&&i.error({componentName:"VueUiCandlestick",type:"datasetAttribute",property:"low (index 3)",index:u}),[null,void 0].includes(o[4])&&i.error({componentName:"VueUiCandlestick",type:"datasetAttribute",property:"last (index 4)",index:u}),[null,void 0].includes(o[5])&&i.error({componentName:"VueUiCandlestick",type:"datasetAttribute",property:"volume (index 5)",index:u})}),O.value.map(o=>({period:o[0],open:o[1],high:o[2],low:o[3],last:o[4],volume:o[5]})))),n=t.computed(()=>s.value.width/O.value.length),M=t.computed(()=>({max:Math.max(...E.value.map(o=>o.high)),min:0})),f=t.computed(()=>i.calculateNiceScale(M.value.min,M.value.max,e.value.style.layout.grid.yAxis.dataLabels.steps));function w(o,u){return{...o,x:s.value.left+u*n.value+n.value/2,y:s.value.top+(1-o/f.value.max)*s.value.height,value:o}}const c=t.computed(()=>E.value.map((o,u)=>{const l=w(o.open,u),a=w(o.high,u),v=w(o.low,u),$=w(o.last,u),N=o.last>o.open;return{period:o.period,open:l,high:a,low:v,last:$,volume:o.volume,isBullish:N}}));function le(o){return o/f.value.max}const oe=t.computed(()=>f.value.ticks.map(o=>({y:s.value.bottom-s.value.height*le(o),value:o}))),ae=t.computed(()=>E.value.map(o=>o.period)),z=t.ref(null);function ue(o,u){S.value=o,z.value={datapoint:u,seriesIndex:o,series:c.value,config:e.value};const l=e.value.style.tooltip.customFormat;if(i.isFunction(l)&&i.functionReturnsString(()=>l({seriesIndex:o,datapoint:u,series:c.value,config:e.value})))B.value=l({seriesIndex:o,datapoint:u,series:c.value,config:e.value});else if(e.value.style.tooltip.show){let a="";const{period:v,open:$,high:N,low:W,last:G,volume:H,isBullish:j}=c.value[o],{period:Qe,open:ne,high:re,low:de,last:ce,volume:ve}=e.value.translations;a+=`<div><svg style="margin-right:6px" viewBox="0 0 12 12" height="12" width="12"><rect x="0" y="0" height="12" width="12" rx="${e.value.style.layout.candle.borderRadius*3}" stroke="${e.value.style.layout.candle.stroke}" stroke-width="${e.value.style.layout.candle.strokeWidth}"
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("vue"),i=require("./index-BDKEFvEF.cjs"),X=require("./useResponsive-B3TrDDIG.cjs"),ye=require("./Title-XRMcJkna.cjs"),Y=require("./usePrinter-DedM_6px.cjs"),he=require("./Tooltip-COgv-iii.cjs"),pe=require("./DataTable-CGX9xKvm.cjs"),ge=require("./vue-ui-skeleton-rY_nZhMQ.cjs"),fe=require("./Slicer-CuwuufTu.cjs"),me=require("./vue-ui-accordion-BytUYLYl.cjs"),J=require("./useNestedProp-Dikfncsl.cjs"),xe=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),ke=["id"],be=["xmlns","viewBox"],we={key:0},Ce=["id"],$e=["stop-color"],Ne=["stop-color"],_e=["stop-color"],Be=["id"],Se=["stop-color"],Ve=["stop-color"],Ee=["stop-color"],ze={key:0},Te=["x1","x2","y1","y2","stroke","stroke-width"],Fe=["x1","x2","y1","y2","stroke","stroke-width"],Ae={key:1},Le=["x1","x2","y1","y2","stroke","stroke-width"],Re=["x","y","font-size","fill","font-weight"],Pe={key:2},Ie=["transform","text-anchor","font-size","fill","font-weight"],Oe=["x1","x2","y1","y2","stroke","stroke-width"],Me={key:0},Ue=["cx","cy","r","fill"],De=["cx","cy","r","fill"],qe={key:1},We=["x1","x2","y1","y2","stroke","stroke-width"],Ge=["x1","x2","y1","y2","stroke","stroke-width"],He=["x","y","height","width","fill","rx"],je=["x","y","height","width","fill","rx","stroke","stroke-width"],Xe=["x","y","height","width","fill","onMouseover"],Ye=["innerHTML"],Je={__name:"vue-ui-candlestick",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},setup(g,{expose:K}){const h=g,{vue_ui_candlestick:Q}=i.useConfig(),m=t.computed(()=>!!h.dataset&&h.dataset.length),y=t.ref(i.createUid()),Z=t.ref(null),_=t.ref(!1),B=t.ref(""),S=t.ref(void 0),T=t.ref(0),F=t.ref(0),x=t.ref(null),A=t.ref(null),L=t.ref(null),R=t.ref(null),e=t.computed(()=>{const o=J.useNestedProp({userConfig:h.config,defaultConfig:Q});return o.theme?{...J.useNestedProp({userConfig:i.themes.vue_ui_candlestick[o.theme]||h.config,defaultConfig:o})}:o}),r=t.ref({height:e.value.style.height,width:e.value.style.width,xAxisFontSize:e.value.style.layout.grid.xAxis.dataLabels.fontSize,yAxisFontSize:e.value.style.layout.grid.yAxis.dataLabels.fontSize}),b=t.ref(null);t.onMounted(()=>{if(i.objectIsEmpty(h.dataset)&&i.error({componentName:"VueUiCandlestick",type:"dataset"}),e.value.responsive){const o=X.throttle(()=>{const{width:u,height:l}=X.useResponsive({chart:x.value,title:e.value.style.title.text?A.value:null,slicer:R.value,legend:L.value});r.value.width=u,r.value.height=l,r.value.xAxisFontSize=i.translateSize({relator:Math.min(u,l),adjuster:e.value.style.width,source:e.value.style.layout.grid.xAxis.dataLabels.fontSize,threshold:6,fallback:6}),r.value.yAxisFontSize=i.translateSize({relator:Math.min(u,l),adjuster:e.value.style.width,source:e.value.style.layout.grid.yAxis.dataLabels.fontSize,threshold:6,fallback:6})});b.value=new ResizeObserver(o),b.value.observe(x.value.parentNode)}}),t.onBeforeUnmount(()=>{b.value&&b.value.disconnect()});const{isPrinting:ee,isImaging:te,generatePdf:P,generateImage:I}=Y.usePrinter({elementId:`vue-ui-candlestick_${y.value}`,fileName:e.value.style.title.text||"vue-ui-candlestick"}),p=t.ref({showTable:e.value.table.show,showTooltip:e.value.style.tooltip.show}),s=t.computed(()=>{const{top:o,right:u,bottom:l,left:a}=e.value.style.layout.padding;return{top:o,right:r.value.width-u,left:a,bottom:r.value.height-l,width:r.value.width-a-u,height:r.value.height-o-l}}),V=t.computed(()=>h.dataset.length),d=t.ref({start:0,end:V.value}),O=t.computed(()=>h.dataset.slice(d.value.start,d.value.end)),E=t.computed(()=>(h.dataset.forEach((o,u)=>{[null,void 0].includes(o[0])&&i.error({componentName:"VueUiCandlestick",type:"datasetAttribute",property:"period (index 0)",index:u}),[null,void 0].includes(o[1])&&i.error({componentName:"VueUiCandlestick",type:"datasetAttribute",property:"open (index 1)",index:u}),[null,void 0].includes(o[2])&&i.error({componentName:"VueUiCandlestick",type:"datasetAttribute",property:"high (index 2)",index:u}),[null,void 0].includes(o[3])&&i.error({componentName:"VueUiCandlestick",type:"datasetAttribute",property:"low (index 3)",index:u}),[null,void 0].includes(o[4])&&i.error({componentName:"VueUiCandlestick",type:"datasetAttribute",property:"last (index 4)",index:u}),[null,void 0].includes(o[5])&&i.error({componentName:"VueUiCandlestick",type:"datasetAttribute",property:"volume (index 5)",index:u})}),O.value.map(o=>({period:o[0],open:o[1],high:o[2],low:o[3],last:o[4],volume:o[5]})))),n=t.computed(()=>s.value.width/O.value.length),M=t.computed(()=>({max:Math.max(...E.value.map(o=>o.high)),min:0})),f=t.computed(()=>i.calculateNiceScale(M.value.min,M.value.max,e.value.style.layout.grid.yAxis.dataLabels.steps));function w(o,u){return{...o,x:s.value.left+u*n.value+n.value/2,y:s.value.top+(1-o/f.value.max)*s.value.height,value:o}}const c=t.computed(()=>E.value.map((o,u)=>{const l=w(o.open,u),a=w(o.high,u),v=w(o.low,u),$=w(o.last,u),N=o.last>o.open;return{period:o.period,open:l,high:a,low:v,last:$,volume:o.volume,isBullish:N}}));function le(o){return o/f.value.max}const oe=t.computed(()=>f.value.ticks.map(o=>({y:s.value.bottom-s.value.height*le(o),value:o}))),ae=t.computed(()=>E.value.map(o=>o.period)),z=t.ref(null);function ue(o,u){S.value=o,z.value={datapoint:u,seriesIndex:o,series:c.value,config:e.value};const l=e.value.style.tooltip.customFormat;if(i.isFunction(l)&&i.functionReturnsString(()=>l({seriesIndex:o,datapoint:u,series:c.value,config:e.value})))B.value=l({seriesIndex:o,datapoint:u,series:c.value,config:e.value});else if(e.value.style.tooltip.show){let a="";const{period:v,open:$,high:N,low:W,last:G,volume:H,isBullish:j}=c.value[o],{period:Qe,open:ne,high:re,low:de,last:ce,volume:ve}=e.value.translations;a+=`<div><svg style="margin-right:6px" viewBox="0 0 12 12" height="12" width="12"><rect x="0" y="0" height="12" width="12" rx="${e.value.style.layout.candle.borderRadius*3}" stroke="${e.value.style.layout.candle.stroke}" stroke-width="${e.value.style.layout.candle.strokeWidth}"
2
2
  fill="${e.value.style.layout.candle.gradient.show?j?`url(#bullish_gradient_${y.value})`:`url(#bearish_gradient_${y.value})`:j?e.value.style.layout.candle.colors.bullish:e.value.style.layout.candle.colors.bearish}"/></svg>${v}</div>`,a+=`${ve} : <b>${isNaN(H)?"-":Number(H.toFixed(e.value.style.tooltip.roundingValue)).toLocaleString()}</b>`,a+=`<div style="margin-top:6px;padding-top:6px;border-top:1px solid ${e.value.style.tooltip.borderColor}">`,a+=`<div>${ne}: <b>${e.value.style.tooltip.prefix} ${isNaN($.value)?"-":Number($.value.toFixed(e.value.style.tooltip.roundingValue)).toLocaleString()} ${e.value.style.tooltip.suffix}</b></div>`,a+=`<div>${re}: <b>${e.value.style.tooltip.prefix} ${isNaN(N.value)?"-":Number(N.value.toFixed(e.value.style.tooltip.roundingValue)).toLocaleString()} ${e.value.style.tooltip.suffix}</b></div>`,a+=`<div>${de}: <b>${e.value.style.tooltip.prefix} ${isNaN(W.value)?"-":Number(W.value.toFixed(e.value.style.tooltip.roundingValue)).toLocaleString()} ${e.value.style.tooltip.suffix}</b></div>`,a+=`<div>${ce}: <b>${e.value.style.tooltip.prefix} ${isNaN(G.value)?"-":Number(G.value.toFixed(e.value.style.tooltip.roundingValue)).toLocaleString()} ${e.value.style.tooltip.suffix}</b></div>`,a+="</div>",B.value=`<div style="text-align:right">${a}</div>`}_.value=!0}function ie(){d.value={start:0,end:V.value},F.value+=1}function U(){t.nextTick(()=>{const o=[e.value.translations.period,e.value.translations.open,e.value.translations.high,e.value.translations.low,e.value.translations.last,e.value.translations.volume],u=c.value.map(v=>[v.period,v.open.value,v.high.value,v.low.value,v.last.value,v.volume]),l=[[e.value.style.title.text],[e.value.style.title.subtitle.text],[[""],[""],[""]]].concat([o]).concat(u),a=i.createCsvContent(l);i.downloadCsv({csvContent:a,title:e.value.style.title.text||"vue-ui-candlestick"})})}const C=t.computed(()=>{const o=c.value.map(a=>[`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 12 12" height="12" width="12" style="margin-right: 6px"><rect x="0" y="0" height="12" width="12" :rx="${e.value.style.layout.candle.borderRadius*3}" fill="${e.value.style.layout.candle.gradient.show?a.isBullish?`url(#bullish_gradient_${y.value}`:`url(#bearish_gradient_${y.value})`:a.isBullish?e.value.style.layout.candle.colors.bullish:e.value.style.layout.candle.colors.bearish}"/></svg> ${a.period}`,`${e.value.table.td.prefix} ${isNaN(a.open.value)?"-":Number(a.open.value.toFixed(e.value.table.td.roundingValue)).toLocaleString()} ${e.value.table.td.suffix}`,`${e.value.table.td.prefix} ${isNaN(a.high.value)?"-":Number(a.high.value.toFixed(e.value.table.td.roundingValue)).toLocaleString()} ${e.value.table.td.suffix}`,`${e.value.table.td.prefix} ${isNaN(a.low.value)?"-":Number(a.low.value.toFixed(e.value.table.td.roundingValue)).toLocaleString()} ${e.value.table.td.suffix}`,`${e.value.table.td.prefix} ${isNaN(a.last.value)?"-":Number(a.last.value.toFixed(e.value.table.td.roundingValue)).toLocaleString()} ${e.value.table.td.suffix}`,`${isNaN(a.volume)?"-":a.volume.toLocaleString()}`]),u={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},l=[e.value.translations.period,e.value.translations.open,e.value.translations.high,e.value.translations.low,e.value.translations.last,e.value.translations.volume];return{head:l,body:o,config:u,colNames:l}}),k=t.ref(!1);function se(o){k.value=o,T.value+=1}function D(){p.value.showTable=!p.value.showTable}function q(){p.value.showTooltip=!p.value.showTooltip}return K({generatePdf:P,generateCsv:U,generateImage:I,toggleTable:D,toggleTooltip:q}),(o,u)=>(t.openBlock(),t.createElementBlock("div",{ref_key:"candlestickChart",ref:x,class:t.normalizeClass(`vue-ui-candlestick ${k.value?"vue-data-ui-wrapper-fullscreen":""} ${e.value.useCssAnimation?"":"vue-ui-dna"}`),style:t.normalizeStyle(`position:relative;font-family:${e.value.style.fontFamily}; text-align:center;${e.value.style.title.text?"":"padding-top:36px"};background:${e.value.style.backgroundColor}; ${e.value.responsive?"height: 100%":""}`),id:`vue-ui-candlestick_${y.value}`},[e.value.style.title.text?(t.openBlock(),t.createElementBlock("div",{key:0,ref_key:"chartTitle",ref:A,style:t.normalizeStyle(`width:100%;background:${e.value.style.backgroundColor}`)},[t.createVNode(ye._sfc_main,{config:{title:{cy:"candlestick-div-title",...e.value.style.title},subtitle:{cy:"candlestick-div-subtitle",...e.value.style.title.subtitle}}},null,8,["config"])],4)):t.createCommentVNode("",!0),e.value.userOptions.show&&m.value?(t.openBlock(),t.createBlock(Y.UserOptions,{ref_key:"details",ref:Z,key:`user_options_${T.value}`,backgroundColor:e.value.style.backgroundColor,color:e.value.style.color,isImaging:t.unref(te),isPrinting:t.unref(ee),uid:y.value,hasTooltip:e.value.userOptions.buttons.tooltip&&e.value.style.tooltip.show,hasPdf:e.value.userOptions.buttons.pdf,hasImg:e.value.userOptions.buttons.img,hasXls:e.value.userOptions.buttons.csv,hasTable:e.value.userOptions.buttons.table,hasFullscreen:e.value.userOptions.buttons.fullscreen,isFullscreen:k.value,isTooltip:p.value.showTooltip,titles:{...e.value.userOptions.buttonTitles},chartElement:x.value,onToggleFullscreen:se,onGeneratePdf:t.unref(P),onGenerateCsv:U,onGenerateImage:t.unref(I),onToggleTable:D,onToggleTooltip:q},t.createSlots({_:2},[o.$slots.optionTooltip?{name:"optionTooltip",fn:t.withCtx(()=>[t.renderSlot(o.$slots,"optionTooltip",{},void 0,!0)]),key:"0"}:void 0,o.$slots.optionPdf?{name:"optionPdf",fn:t.withCtx(()=>[t.renderSlot(o.$slots,"optionPdf",{},void 0,!0)]),key:"1"}:void 0,o.$slots.optionCsv?{name:"optionCsv",fn:t.withCtx(()=>[t.renderSlot(o.$slots,"optionCsv",{},void 0,!0)]),key:"2"}:void 0,o.$slots.optionImg?{name:"optionImg",fn:t.withCtx(()=>[t.renderSlot(o.$slots,"optionImg",{},void 0,!0)]),key:"3"}:void 0,o.$slots.optionTable?{name:"optionTable",fn:t.withCtx(()=>[t.renderSlot(o.$slots,"optionTable",{},void 0,!0)]),key:"4"}:void 0,o.$slots.optionFullscreen?{name:"optionFullscreen",fn:t.withCtx(({toggleFullscreen:l,isFullscreen:a})=>[t.renderSlot(o.$slots,"optionFullscreen",t.normalizeProps(t.guardReactiveProps({toggleFullscreen:l,isFullscreen:a})),void 0,!0)]),key:"5"}:void 0]),1032,["backgroundColor","color","isImaging","isPrinting","uid","hasTooltip","hasPdf","hasImg","hasXls","hasTable","hasFullscreen","isFullscreen","isTooltip","titles","chartElement","onGeneratePdf","onGenerateImage"])):t.createCommentVNode("",!0),m.value?(t.openBlock(),t.createElementBlock("svg",{key:2,xmlns:t.unref(i.XMLNS),class:t.normalizeClass({"vue-data-ui-fullscreen--on":k.value,"vue-data-ui-fulscreen--off":!k.value}),viewBox:`0 0 ${r.value.width<=0?10:r.value.width} ${r.value.height<=0?10:r.value.height}`,style:t.normalizeStyle(`max-width:100%;overflow:visible;background:${e.value.style.backgroundColor};color:${e.value.style.color}`)},[c.value.length>0?(t.openBlock(),t.createElementBlock("g",we,[t.createElementVNode("defs",null,[t.createElementVNode("linearGradient",{id:`bearish_gradient_${y.value}`,x2:"0%",y2:"100%"},[t.createElementVNode("stop",{offset:"0%","stop-color":e.value.style.layout.candle.colors.bearish},null,8,$e),t.createElementVNode("stop",{offset:"50%","stop-color":`${t.unref(i.shiftHue)(e.value.style.layout.candle.colors.bearish,.02)}DE`},null,8,Ne),t.createElementVNode("stop",{offset:"100%","stop-color":`${t.unref(i.shiftHue)(e.value.style.layout.candle.colors.bearish,.05)}66`},null,8,_e)],8,Ce),t.createElementVNode("linearGradient",{id:`bullish_gradient_${y.value}`,x2:"0%",y2:"100%"},[t.createElementVNode("stop",{offset:"0%","stop-color":e.value.style.layout.candle.colors.bullish},null,8,Se),t.createElementVNode("stop",{offset:"50%","stop-color":`${t.unref(i.shiftHue)(e.value.style.layout.candle.colors.bullish,.02)}DE`},null,8,Ve),t.createElementVNode("stop",{offset:"100%","stop-color":`${t.unref(i.shiftHue)(e.value.style.layout.candle.colors.bullish,.05)}66`},null,8,Ee)],8,Be)]),e.value.style.layout.grid.show?(t.openBlock(),t.createElementBlock("g",ze,[t.createElementVNode("line",{x1:s.value.left,x2:s.value.left,y1:s.value.top,y2:s.value.bottom,stroke:e.value.style.layout.grid.stroke,"stroke-width":e.value.style.layout.grid.strokeWidth,"stroke-linecap":"round"},null,8,Te),t.createElementVNode("line",{x1:s.value.left,x2:s.value.right,y1:s.value.bottom,y2:s.value.bottom,stroke:e.value.style.layout.grid.stroke,"stroke-width":e.value.style.layout.grid.strokeWidth,"stroke-linecap":"round"},null,8,Fe)])):t.createCommentVNode("",!0),e.value.style.layout.grid.yAxis.dataLabels.show?(t.openBlock(),t.createElementBlock("g",Ae,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(oe.value,(l,a)=>(t.openBlock(),t.createElementBlock("g",null,[l.value>=f.value.min&&l.value<=f.value.max?(t.openBlock(),t.createElementBlock("line",{key:0,x1:s.value.left,x2:s.value.left-5,y1:l.y,y2:l.y,stroke:e.value.style.layout.grid.stroke,"stroke-width":e.value.style.layout.grid.strokeWidth,"stroke-linecap":"round"},null,8,Le)):t.createCommentVNode("",!0),l.value>=f.value.min&&l.value<=f.value.max?(t.openBlock(),t.createElementBlock("text",{key:1,x:s.value.left-8+e.value.style.layout.grid.yAxis.dataLabels.offsetX,y:l.y+r.value.yAxisFontSize/3,"font-size":r.value.yAxisFontSize,"text-anchor":"end",fill:e.value.style.layout.grid.yAxis.dataLabels.color,"font-weight":e.value.style.layout.grid.yAxis.dataLabels.bold?"bold":"normal"},t.toDisplayString(e.value.style.layout.grid.yAxis.dataLabels.prefix)+" "+t.toDisplayString(t.unref(i.canShowValue)(l.value)?l.value.toFixed(e.value.style.layout.grid.yAxis.dataLabels.roundingValue):"")+" "+t.toDisplayString(e.value.style.layout.grid.yAxis.dataLabels.suffix),9,Re)):t.createCommentVNode("",!0)]))),256))])):t.createCommentVNode("",!0),e.value.style.layout.grid.xAxis.dataLabels.show?(t.openBlock(),t.createElementBlock("g",Pe,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(ae.value,(l,a)=>(t.openBlock(),t.createElementBlock("g",null,[t.createElementVNode("text",{transform:`translate(${s.value.left+n.value*a+n.value/2}, ${s.value.bottom+r.value.xAxisFontSize*2+e.value.style.layout.grid.xAxis.dataLabels.offsetY}), rotate(${e.value.style.layout.grid.xAxis.dataLabels.rotation})`,"text-anchor":e.value.style.layout.grid.xAxis.dataLabels.rotation>0?"start":e.value.style.layout.grid.xAxis.dataLabels.rotation<0?"end":"middle","font-size":r.value.xAxisFontSize,fill:e.value.style.layout.grid.xAxis.dataLabels.color,"font-weight":e.value.style.layout.grid.xAxis.dataLabels.bold?"bold":"normal"},t.toDisplayString(l),9,Ie)]))),256))])):t.createCommentVNode("",!0),t.createElementVNode("g",null,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(c.value,(l,a)=>(t.openBlock(),t.createElementBlock("g",null,[t.createElementVNode("line",{x1:l.open.x,x2:l.open.x,y1:l.high.y,y2:l.low.y,stroke:e.value.style.layout.wick.stroke,"stroke-width":e.value.style.layout.wick.strokeWidth,"stroke-linecap":"round"},null,8,Oe),e.value.style.layout.wick.extremity.shape==="circle"?(t.openBlock(),t.createElementBlock("g",Me,[t.createElementVNode("circle",{cx:l.high.x,cy:l.high.y,r:e.value.style.layout.wick.extremity.size==="auto"?n.value/20:e.value.style.layout.wick.extremity.size,fill:e.value.style.layout.wick.extremity.color},null,8,Ue),t.createElementVNode("circle",{cx:l.low.x,cy:l.low.y,r:e.value.style.layout.wick.extremity.size==="auto"?n.value/20:e.value.style.layout.wick.extremity.size,fill:e.value.style.layout.wick.extremity.color},null,8,De)])):t.createCommentVNode("",!0),e.value.style.layout.wick.extremity.shape==="line"?(t.openBlock(),t.createElementBlock("g",qe,[t.createElementVNode("line",{x1:l.high.x-(e.value.style.layout.wick.extremity.size==="auto"?n.value*e.value.style.layout.candle.widthRatio:e.value.style.layout.wick.extremity.size)/2,x2:l.high.x+(e.value.style.layout.wick.extremity.size==="auto"?n.value*e.value.style.layout.candle.widthRatio:e.value.style.layout.wick.extremity.size)/2,y1:l.high.y,y2:l.high.y,stroke:e.value.style.layout.wick.extremity.color,"stroke-width":e.value.style.layout.wick.strokeWidth,"stroke-linecap":"round"},null,8,We),t.createElementVNode("line",{x1:l.low.x-(e.value.style.layout.wick.extremity.size==="auto"?n.value*e.value.style.layout.candle.widthRatio:e.value.style.layout.wick.extremity.size)/2,x2:l.low.x+(e.value.style.layout.wick.extremity.size==="auto"?n.value*e.value.style.layout.candle.widthRatio:e.value.style.layout.wick.extremity.size)/2,y1:l.low.y,y2:l.low.y,stroke:e.value.style.layout.wick.extremity.color,"stroke-width":e.value.style.layout.wick.strokeWidth,"stroke-linecap":"round"},null,8,Ge)])):t.createCommentVNode("",!0)]))),256))]),t.createElementVNode("g",null,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(c.value,(l,a)=>(t.openBlock(),t.createElementBlock("rect",{x:l.open.x-n.value/2+n.value*(1-e.value.style.layout.candle.widthRatio)/2,y:l.isBullish?l.last.y:l.open.y,height:Math.abs(l.last.y-l.open.y)<=0?1e-4:Math.abs(l.last.y-l.open.y),width:n.value*e.value.style.layout.candle.widthRatio<=0?1e-4:n.value*e.value.style.layout.candle.widthRatio,fill:e.value.style.layout.candle.gradient.underlayer,rx:e.value.style.layout.candle.borderRadius,stroke:"none"},null,8,He))),256)),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(c.value,(l,a)=>(t.openBlock(),t.createElementBlock("rect",{x:l.open.x-n.value/2+n.value*(1-e.value.style.layout.candle.widthRatio)/2,y:l.isBullish?l.last.y:l.open.y,height:Math.abs(l.last.y-l.open.y)<=0?1e-4:Math.abs(l.last.y-l.open.y),width:n.value*e.value.style.layout.candle.widthRatio<=0?1e-4:n.value*e.value.style.layout.candle.widthRatio,fill:l.isBullish?e.value.style.layout.candle.gradient.show?`url(#bullish_gradient_${y.value})`:e.value.style.layout.candle.colors.bullish:e.value.style.layout.candle.gradient.show?`url(#bearish_gradient_${y.value})`:e.value.style.layout.candle.colors.bearish,rx:e.value.style.layout.candle.borderRadius,stroke:e.value.style.layout.candle.stroke,"stroke-width":e.value.style.layout.candle.strokeWidth,"stroke-linecap":"round","stroke-linejoin":"round"},null,8,je))),256))]),t.createElementVNode("g",null,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(c.value,(l,a)=>(t.openBlock(),t.createElementBlock("rect",{x:s.value.left+a*n.value,y:s.value.top,height:s.value.height<=0?1e-4:s.value.height,width:n.value<=0?1e-4:n.value,fill:S.value===a?`${e.value.style.layout.selector.color}${t.unref(i.opacity)[e.value.style.layout.selector.opacity]}`:"transparent",onMouseover:v=>ue(a,l),onMouseleave:u[0]||(u[0]=v=>{S.value=void 0,_.value=!1})},null,40,Xe))),256))])])):t.createCommentVNode("",!0),t.renderSlot(o.$slots,"svg",{svg:r.value},void 0,!0)],14,be)):t.createCommentVNode("",!0),m.value?t.createCommentVNode("",!0):(t.openBlock(),t.createBlock(ge.default,{key:3,config:{type:"candlesticks",style:{backgroundColor:e.value.style.backgroundColor,candlesticks:{axis:{color:"#CCCCCC"},candle:{color:"#CCCCCC"}}}}},null,8,["config"])),e.value.style.zoom.show&&m.value?(t.openBlock(),t.createElementBlock("div",{key:4,ref_key:"chartSlicer",ref:R},[(t.openBlock(),t.createBlock(fe.Slicer,{key:`slicer_${F.value}`,background:e.value.style.zoom.color,borderColor:e.value.style.backgroundColor,fontSize:e.value.style.zoom.fontSize,useResetSlot:e.value.style.zoom.useResetSlot,labelLeft:g.dataset[d.value.start]?g.dataset[d.value.start][0]:g.dataset[0][0],labelRight:g.dataset[d.value.end-1]?g.dataset[d.value.end-1][0]:g.dataset.at(-1)[0],textColor:e.value.style.color,inputColor:e.value.style.zoom.color,selectColor:e.value.style.zoom.highlightColor,max:V.value,min:0,valueStart:d.value.start,valueEnd:d.value.end,start:d.value.start,"onUpdate:start":u[1]||(u[1]=l=>d.value.start=l),end:d.value.end,"onUpdate:end":u[2]||(u[2]=l=>d.value.end=l),onReset:ie},{"reset-action":t.withCtx(({reset:l})=>[t.renderSlot(o.$slots,"reset-action",t.normalizeProps(t.guardReactiveProps({reset:l})),void 0,!0)]),_:3},8,["background","borderColor","fontSize","useResetSlot","labelLeft","labelRight","textColor","inputColor","selectColor","max","valueStart","valueEnd","start","end"]))],512)):t.createCommentVNode("",!0),t.createElementVNode("div",{ref_key:"chartLegend",ref:L},[t.renderSlot(o.$slots,"legend",{legend:c.value},void 0,!0)],512),t.createVNode(he._sfc_main,{show:p.value.showTooltip&&_.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:x.value,content:B.value,isCustom:e.value.style.tooltip.customFormat&&typeof e.value.style.tooltip.customFormat=="function"},{"tooltip-before":t.withCtx(()=>[t.renderSlot(o.$slots,"tooltip-before",t.normalizeProps(t.guardReactiveProps({...z.value})),void 0,!0)]),"tooltip-after":t.withCtx(()=>[t.renderSlot(o.$slots,"tooltip-after",t.normalizeProps(t.guardReactiveProps({...z.value})),void 0,!0)]),_:3},8,["show","backgroundColor","color","borderRadius","borderColor","borderWidth","fontSize","backgroundOpacity","parent","content","isCustom"]),m.value?(t.openBlock(),t.createBlock(me.default,{key:5,hideDetails:"",config:{open:p.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(pe.DataTable,{colNames:C.value.colNames,head:C.value.head,body:C.value.body,config:C.value.config,title:`${e.value.style.title.text}${e.value.style.title.subtitle.text?` : ${e.value.style.title.subtitle.text}`:""}`,onClose:u[3]||(u[3]=l=>p.value.showTable=!1)},{th:t.withCtx(({th:l})=>[t.createTextVNode(t.toDisplayString(l),1)]),td:t.withCtx(({td:l})=>[t.createElementVNode("div",{innerHTML:l},null,8,Ye)]),_:1},8,["colNames","head","body","config","title"])]),_:1},8,["config"])):t.createCommentVNode("",!0)],14,ke))}},Ke=xe._export_sfc(Je,[["__scopeId","data-v-0ed64fca"]]);exports.default=Ke;
@@ -1,14 +1,14 @@
1
1
  import { computed as h, ref as v, onMounted as Ae, onBeforeUnmount as Fe, openBlock as u, createElementBlock as s, normalizeClass as ve, normalizeStyle as H, createVNode as q, createCommentVNode as y, createBlock as O, unref as x, createSlots as Le, withCtx as f, renderSlot as m, normalizeProps as P, guardReactiveProps as M, createElementVNode as n, Fragment as N, renderList as S, toDisplayString as F, createTextVNode as Re, nextTick as Ve } from "vue";
2
- import { u as Ie, c as Be, t as Oe, o as Pe, e as C, z as Me, X as Ue, s as U, A as Ee, r as We, v as De, w as Ge, n as Xe, q as je, B as ye } from "./index-BK818aZo.js";
2
+ import { u as Ie, c as Be, t as Oe, o as Pe, e as C, z as Me, X as Ue, s as U, A as Ee, r as We, v as De, w as Ge, n as Xe, q as je, B as ye } from "./index-ByO3Ywek.js";
3
3
  import { t as He, u as qe } from "./useResponsive-NZB-WLRF.js";
4
- import { _ as Ye } from "./Title-DJ269q6H.js";
5
- import { u as Je, U as Ke } from "./usePrinter-C-2KAW2f.js";
6
- import { _ as Qe } from "./Tooltip-CKKSlbSq.js";
7
- import { D as Ze } from "./DataTable-R7hmQ0wl.js";
8
- import et from "./vue-ui-skeleton-DJtTdfNg.js";
9
- import { S as tt } from "./Slicer-C1zx1qMy.js";
10
- import lt from "./vue-ui-accordion-CH8K6f6J.js";
11
- import { u as ce } from "./useNestedProp-hi25rRoY.js";
4
+ import { _ as Ye } from "./Title-BSpLzDC1.js";
5
+ import { u as Je, U as Ke } from "./usePrinter-Dda5FBG3.js";
6
+ import { _ as Qe } from "./Tooltip-DI8_Wjjy.js";
7
+ import { D as Ze } from "./DataTable-Bza1ed62.js";
8
+ import et from "./vue-ui-skeleton-BxRSQeuo.js";
9
+ import { S as tt } from "./Slicer-WyjxXfiD.js";
10
+ import lt from "./vue-ui-accordion-CbKHVPHh.js";
11
+ import { u as ce } from "./useNestedProp-Da77DnaA.js";
12
12
  import { _ as ot } from "./_plugin-vue_export-helper-CHgC5LLL.js";
13
13
  const at = ["id"], ut = ["xmlns", "viewBox"], st = { key: 0 }, it = ["id"], nt = ["stop-color"], rt = ["stop-color"], dt = ["stop-color"], vt = ["id"], yt = ["stop-color"], ct = ["stop-color"], ht = ["stop-color"], pt = { key: 0 }, gt = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], ft = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], bt = { key: 1 }, xt = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], mt = ["x", "y", "font-size", "fill", "font-weight"], kt = { key: 2 }, wt = ["transform", "text-anchor", "font-size", "fill", "font-weight"], $t = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], _t = { key: 0 }, Ct = ["cx", "cy", "r", "fill"], Nt = ["cx", "cy", "r", "fill"], St = { key: 1 }, zt = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], Tt = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], At = ["x", "y", "height", "width", "fill", "rx"], Ft = ["x", "y", "height", "width", "fill", "rx", "stroke", "stroke-width"], Lt = ["x", "y", "height", "width", "fill", "onMouseover"], Rt = ["innerHTML"], Vt = {
14
14
  __name: "vue-ui-candlestick",
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("./index-Xau3hcRk.cjs"),te=require("./useNestedProp-C_EQ-Kxy.cjs"),D=require("./usePrinter-Dhvmhwhf.cjs"),oe=require("./vue-ui-skeleton-CgYrDrh-.cjs"),ae=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),ne=["id"],le=["height"],re=["data-cell","height"],ie={__name:"vue-ui-carousel-table",props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{}}}},setup(v,{expose:G}){const l=v,{vue_ui_carousel_table:j}=r.useConfig(),w=e.ref(r.createUid()),I=e.ref(!1),f=e.ref(!!l.dataset);e.onMounted(()=>{r.objectIsEmpty(l.dataset)?r.error({componentName:"VueUiCarouselTable",type:"dataset"}):((!l.dataset.head||r.objectIsEmpty(l.dataset.head))&&(r.error({componentName:"VueUiCarouselTable",type:"datasetAttribute",property:"head"}),f.value=!1),(!l.dataset.body||r.objectIsEmpty(l.dataset.body))&&(r.error({componentName:"VueUiCarouselTable",type:"datasetAttribute",property:"body"}),f.value=!1))});const t=e.computed(()=>te.useNestedProp({userConfig:l.config,defaultConfig:j})),{isPrinting:z,isImaging:P,generatePdf:X,generateImage:E}=D.usePrinter({elementId:`carousel-table_${w.value}`,fileName:t.value.caption.text||"vue-ui-carousel-table"}),u=e.ref({showAnimation:t.value.animation.use}),s=e.ref(null),F=e.ref(null),m=e.ref(null),h=e.ref(null),g=e.ref(0),x=e.ref(0),$=e.ref(!1),T=e.ref(null),d=e.ref(null),b=e.ref(0);function N(){T.value&&(d.value={elements:T.value.getElementsByTagName("tr"),heights:Array.from(T.value.getElementsByTagName("tr")).map(o=>o.getBoundingClientRect().height)})}e.onMounted(N);const J=e.computed(()=>!d.value||!d.value.heights.length?0:Math.max(...d.value.heights)+g.value+x.value),K=e.computed(()=>l.dataset.body?t.value.tbody.tr.visible<=l.dataset.body.length?t.value.tbody.tr.visible:l.dataset.body.length:0),Q=e.computed(()=>(t.value.tbody.tr.height+t.value.tbody.tr.td.padding.top+t.value.tbody.tr.td.padding.bottom+t.value.tbody.tr.border.size*2)*K.value+g.value+x.value),A=e.ref(0),y=e.ref(null),k=e.ref(0),c=e.ref(!1),O=e.ref(0);e.onMounted(()=>{m.value&&(g.value=m.value.getBoundingClientRect().height),h.value&&(x.value=h.value.getBoundingClientRect().height),u.value.showAnimation&&d.value&&R()});function W(o){I.value=o,O.value+=1}function R(){!y.value&&!c.value&&(y.value=requestAnimationFrame(V))}function Y(){if(!s.value)return!1;const{scrollTop:o,scrollHeight:a,clientHeight:n}=s.value;return o+n>=a}function V(o){if(c.value)return;k.value||(k.value=o),o-k.value>=t.value.animation.speedMs&&(A.value+=d.value.heights[b.value],(Y()||b.value>=d.value.heights.length)&&(A.value=0,b.value=0),s.value&&(s.value.scrollTo({top:A.value,behavior:"smooth"}),b.value+=1),k.value=o),y.value=requestAnimationFrame(V)}function p(){c.value=!0,cancelAnimationFrame(y.value),y.value=null}e.onBeforeUnmount(p);function C(){!c.value||!u.value.showAnimation||(c.value=!1,k.value=0,R())}function Z(){t.value.animation.pauseOnHover&&p()}const S=e.ref(null);function _(){p(),clearTimeout(S.value)}function H(){clearTimeout(S.value),S.value=setTimeout(C,1e3)}e.watch(()=>t.value.animation.use,o=>{o?(u.value.showAnimation=!0,C()):(u.value.showAnimation=!1,p())});const ee=e.computed(()=>t.value.responsiveBreakpoint);e.onMounted(()=>{const o=new ResizeObserver(a=>{a.forEach(n=>{$.value=n.contentRect.width<ee.value}),g.value=m.value?m.value.getBoundingClientRect().height:0,x.value=h.value?h.value.getBoundingClientRect().height:0,b.value=0,N()});s.value&&o.observe(s.value)});function M(){X()}function L(){u.value.showAnimation=!u.value.showAnimation,u.value.showAnimation?C():p()}function U(){e.nextTick(()=>{const o=l.dataset.head.map((i,B)=>[[l.dataset.body[B]]]),a=[[t.value.caption.text],[l.dataset.head.map(i=>[i])]].concat(o),n=r.createCsvContent(a);r.downloadCsv({csvContent:n,title:t.value.caption.text||"vue-ui-carousel-table"})})}return G({pauseAnimation:p,resumeAnimation:C,toggleAnimation:L,generateCsv:U,generatePdf:M,generateImage:E}),(o,a)=>(e.openBlock(),e.createElementBlock("div",{style:{position:"relative",overflow:"visible"},ref_key:"chartContainer",ref:F},[e.createElementVNode("div",{ref_key:"tableContainer",ref:s,id:`carousel-table_${w.value}`,style:e.normalizeStyle({height:e.unref(z)||e.unref(P)?"auto":`${Math.max(Q.value,J.value)}px`,containerType:"inline-size",position:"relative",overflow:"auto",fontFamily:t.value.fontFamily}),class:e.normalizeClass({"vue-ui-responsive":$.value,"is-playing":!c.value}),onMouseenter:a[0]||(a[0]=n=>Z()),onMouseleave:a[1]||(a[1]=n=>C()),onTouchstart:a[2]||(a[2]=n=>_()),onTouchend:a[3]||(a[3]=n=>H()),onTouchcancel:a[4]||(a[4]=n=>H())},[f.value?(e.openBlock(),e.createElementBlock("table",{key:0,class:"vue-data-ui-carousel-table",style:e.normalizeStyle({...t.value.style,border:`${t.value.border.size}px solid ${t.value.border.color}`,width:"100%",borderCollapse:"collapse"})},[e.createElementVNode("caption",{ref_key:"caption",ref:m,class:"vue-data-ui-carousel-table-caption",style:e.normalizeStyle({...t.value.caption.style,fontFamily:"inherit",position:"sticky",top:0,zIndex:2,paddingTop:t.value.caption.padding.top+"px",paddingRight:t.value.caption.padding.right+"px",paddingBottom:t.value.caption.padding.bottom+"px",paddingLeft:t.value.caption.padding.left+"px",boxShadow:$.value?t.value.thead.tr.style.boxShadow:"none",minHeight:"36px"})},[e.createTextVNode(e.toDisplayString(t.value.caption.text&&!o.$slots.caption?t.value.caption.text:"")+" ",1),e.renderSlot(o.$slots,"caption",{},void 0,!0)],4),e.createElementVNode("thead",{style:e.normalizeStyle({...t.value.thead.style,position:"sticky",top:`${g.value}px`,zIndex:1})},[e.createElementVNode("tr",{ref_key:"tableRow",ref:h,role:"row",style:e.normalizeStyle({...t.value.thead.tr.style,border:t.value.thead.tr.border.size?`${t.value.thead.tr.border.size}px solid ${t.value.thead.tr.border.color}`:"none",boxShadow:$.value?"none":t.value.thead.tr.style.boxShadow}),height:`${t.value.thead.tr.height}px`},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.dataset.head,(n,i)=>(e.openBlock(),e.createElementBlock("th",{role:"cell",key:`th_${i}`,style:e.normalizeStyle({...t.value.thead.tr.th.style,border:t.value.thead.tr.th.border.size?`${t.value.thead.tr.th.border.size}px solid ${t.value.thead.tr.th.border.color}`:"none",paddingTop:t.value.thead.tr.th.padding.top+"px",paddingRight:t.value.thead.tr.th.padding.right+"px",paddingBottom:t.value.thead.tr.th.padding.bottom+"px",paddingLeft:t.value.thead.tr.th.padding.left+"px"})},[e.createTextVNode(e.toDisplayString(o.$slots.th?"":n)+" ",1),e.renderSlot(o.$slots,"th",e.normalizeProps(e.guardReactiveProps({th:n,colIndex:i})),void 0,!0)],4))),128))],12,le)],4),v.dataset.body&&v.dataset.head?(e.openBlock(),e.createElementBlock("tbody",{key:0,ref_key:"tbody",ref:T},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.dataset.body,(n,i)=>(e.openBlock(),e.createElementBlock("tr",{style:e.normalizeStyle({...t.value.tbody.tr.style,border:`${t.value.tbody.tr.border.size}px solid ${t.value.tbody.tr.border.color}`,verticalAlign:"middle"})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n,(B,q)=>(e.openBlock(),e.createElementBlock("td",{role:"cell","data-cell":v.dataset.head[q]||"",style:e.normalizeStyle({...t.value.tbody.tr.td.style,border:`${t.value.tbody.tr.td.border.size}px solid ${t.value.tbody.tr.td.border.color}`,backgroundColor:t.value.tbody.tr.td.style.backgroundColor+e.unref(r.opacity)[i%2===0&&t.value.tbody.tr.td.alternateColor?t.value.tbody.tr.td.alternateOpacity*100:100],paddingTop:t.value.tbody.tr.td.padding.top+"px",paddingRight:t.value.tbody.tr.td.padding.right+"px",paddingBottom:t.value.tbody.tr.td.padding.bottom+"px",paddingLeft:t.value.tbody.tr.td.padding.left+"px",verticalAlign:"middle"}),height:`${t.value.tbody.tr.height}px`},[e.createTextVNode(e.toDisplayString(o.$slots.td?"":B)+" ",1),e.renderSlot(o.$slots,"td",e.normalizeProps(e.guardReactiveProps({td:B,rowIndex:i,colIndex:q})),void 0,!0)],12,re))),256))],4))),256))],512)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0)],46,ne),f.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(oe.default,{key:0,config:{type:"table"}})),t.value.userOptions.show&&f.value?(e.openBlock(),e.createBlock(D.UserOptions,{ref:"details",key:`user_option_${O.value}`,backgroundColor:t.value.style.backgroundColor,color:t.value.style.color,isPrinting:e.unref(z),isImaging:e.unref(P),uid:w.value,hasTooltip:!1,hasPdf:t.value.userOptions.buttons.pdf,hasImg:t.value.userOptions.buttons.img,hasXls:t.value.userOptions.buttons.csv,hasTable:!1,hasLabel:!1,hasAnimation:t.value.userOptions.buttons.animation,isAnimation:!u.value.showAnimation,hasFullscreen:t.value.userOptions.buttons.fullscreen,isFullscreen:I.value,chartElement:F.value,titles:{...t.value.userOptions.buttonTitles},zIndex:3,noOffset:"",onGeneratePdf:M,onGenerateCsv:U,onGenerateImage:e.unref(E),onToggleAnimation:L,onToggleFullscreen:W},e.createSlots({_:2},[o.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionPdf",{},void 0,!0)]),key:"0"}:void 0,o.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionCsv",{},void 0,!0)]),key:"1"}:void 0,o.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionImg",{},void 0,!0)]),key:"2"}:void 0,o.$slots.optionAnimation?{name:"optionAnimation",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionAnimation",{},void 0,!0)]),key:"3"}:void 0,o.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:n,isFullscreen:i})=>[e.renderSlot(o.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:n,isFullscreen:i})),void 0,!0)]),key:"4"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasPdf","hasImg","hasXls","hasAnimation","isAnimation","hasFullscreen","isFullscreen","chartElement","titles","onGenerateImage"])):e.createCommentVNode("",!0)],512))}},ue=ae._export_sfc(ie,[["__scopeId","data-v-c06beec9"]]);exports.default=ue;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("./index-BDKEFvEF.cjs"),te=require("./useNestedProp-Dikfncsl.cjs"),D=require("./usePrinter-DedM_6px.cjs"),oe=require("./vue-ui-skeleton-rY_nZhMQ.cjs"),ae=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),ne=["id"],le=["height"],re=["data-cell","height"],ie={__name:"vue-ui-carousel-table",props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{}}}},setup(v,{expose:G}){const l=v,{vue_ui_carousel_table:j}=r.useConfig(),w=e.ref(r.createUid()),I=e.ref(!1),f=e.ref(!!l.dataset);e.onMounted(()=>{r.objectIsEmpty(l.dataset)?r.error({componentName:"VueUiCarouselTable",type:"dataset"}):((!l.dataset.head||r.objectIsEmpty(l.dataset.head))&&(r.error({componentName:"VueUiCarouselTable",type:"datasetAttribute",property:"head"}),f.value=!1),(!l.dataset.body||r.objectIsEmpty(l.dataset.body))&&(r.error({componentName:"VueUiCarouselTable",type:"datasetAttribute",property:"body"}),f.value=!1))});const t=e.computed(()=>te.useNestedProp({userConfig:l.config,defaultConfig:j})),{isPrinting:z,isImaging:P,generatePdf:X,generateImage:E}=D.usePrinter({elementId:`carousel-table_${w.value}`,fileName:t.value.caption.text||"vue-ui-carousel-table"}),u=e.ref({showAnimation:t.value.animation.use}),s=e.ref(null),F=e.ref(null),m=e.ref(null),h=e.ref(null),g=e.ref(0),x=e.ref(0),$=e.ref(!1),T=e.ref(null),d=e.ref(null),b=e.ref(0);function N(){T.value&&(d.value={elements:T.value.getElementsByTagName("tr"),heights:Array.from(T.value.getElementsByTagName("tr")).map(o=>o.getBoundingClientRect().height)})}e.onMounted(N);const J=e.computed(()=>!d.value||!d.value.heights.length?0:Math.max(...d.value.heights)+g.value+x.value),K=e.computed(()=>l.dataset.body?t.value.tbody.tr.visible<=l.dataset.body.length?t.value.tbody.tr.visible:l.dataset.body.length:0),Q=e.computed(()=>(t.value.tbody.tr.height+t.value.tbody.tr.td.padding.top+t.value.tbody.tr.td.padding.bottom+t.value.tbody.tr.border.size*2)*K.value+g.value+x.value),A=e.ref(0),y=e.ref(null),k=e.ref(0),c=e.ref(!1),O=e.ref(0);e.onMounted(()=>{m.value&&(g.value=m.value.getBoundingClientRect().height),h.value&&(x.value=h.value.getBoundingClientRect().height),u.value.showAnimation&&d.value&&R()});function W(o){I.value=o,O.value+=1}function R(){!y.value&&!c.value&&(y.value=requestAnimationFrame(V))}function Y(){if(!s.value)return!1;const{scrollTop:o,scrollHeight:a,clientHeight:n}=s.value;return o+n>=a}function V(o){if(c.value)return;k.value||(k.value=o),o-k.value>=t.value.animation.speedMs&&(A.value+=d.value.heights[b.value],(Y()||b.value>=d.value.heights.length)&&(A.value=0,b.value=0),s.value&&(s.value.scrollTo({top:A.value,behavior:"smooth"}),b.value+=1),k.value=o),y.value=requestAnimationFrame(V)}function p(){c.value=!0,cancelAnimationFrame(y.value),y.value=null}e.onBeforeUnmount(p);function C(){!c.value||!u.value.showAnimation||(c.value=!1,k.value=0,R())}function Z(){t.value.animation.pauseOnHover&&p()}const S=e.ref(null);function _(){p(),clearTimeout(S.value)}function H(){clearTimeout(S.value),S.value=setTimeout(C,1e3)}e.watch(()=>t.value.animation.use,o=>{o?(u.value.showAnimation=!0,C()):(u.value.showAnimation=!1,p())});const ee=e.computed(()=>t.value.responsiveBreakpoint);e.onMounted(()=>{const o=new ResizeObserver(a=>{a.forEach(n=>{$.value=n.contentRect.width<ee.value}),g.value=m.value?m.value.getBoundingClientRect().height:0,x.value=h.value?h.value.getBoundingClientRect().height:0,b.value=0,N()});s.value&&o.observe(s.value)});function M(){X()}function L(){u.value.showAnimation=!u.value.showAnimation,u.value.showAnimation?C():p()}function U(){e.nextTick(()=>{const o=l.dataset.head.map((i,B)=>[[l.dataset.body[B]]]),a=[[t.value.caption.text],[l.dataset.head.map(i=>[i])]].concat(o),n=r.createCsvContent(a);r.downloadCsv({csvContent:n,title:t.value.caption.text||"vue-ui-carousel-table"})})}return G({pauseAnimation:p,resumeAnimation:C,toggleAnimation:L,generateCsv:U,generatePdf:M,generateImage:E}),(o,a)=>(e.openBlock(),e.createElementBlock("div",{style:{position:"relative",overflow:"visible"},ref_key:"chartContainer",ref:F},[e.createElementVNode("div",{ref_key:"tableContainer",ref:s,id:`carousel-table_${w.value}`,style:e.normalizeStyle({height:e.unref(z)||e.unref(P)?"auto":`${Math.max(Q.value,J.value)}px`,containerType:"inline-size",position:"relative",overflow:"auto",fontFamily:t.value.fontFamily}),class:e.normalizeClass({"vue-ui-responsive":$.value,"is-playing":!c.value}),onMouseenter:a[0]||(a[0]=n=>Z()),onMouseleave:a[1]||(a[1]=n=>C()),onTouchstart:a[2]||(a[2]=n=>_()),onTouchend:a[3]||(a[3]=n=>H()),onTouchcancel:a[4]||(a[4]=n=>H())},[f.value?(e.openBlock(),e.createElementBlock("table",{key:0,class:"vue-data-ui-carousel-table",style:e.normalizeStyle({...t.value.style,border:`${t.value.border.size}px solid ${t.value.border.color}`,width:"100%",borderCollapse:"collapse"})},[e.createElementVNode("caption",{ref_key:"caption",ref:m,class:"vue-data-ui-carousel-table-caption",style:e.normalizeStyle({...t.value.caption.style,fontFamily:"inherit",position:"sticky",top:0,zIndex:2,paddingTop:t.value.caption.padding.top+"px",paddingRight:t.value.caption.padding.right+"px",paddingBottom:t.value.caption.padding.bottom+"px",paddingLeft:t.value.caption.padding.left+"px",boxShadow:$.value?t.value.thead.tr.style.boxShadow:"none",minHeight:"36px"})},[e.createTextVNode(e.toDisplayString(t.value.caption.text&&!o.$slots.caption?t.value.caption.text:"")+" ",1),e.renderSlot(o.$slots,"caption",{},void 0,!0)],4),e.createElementVNode("thead",{style:e.normalizeStyle({...t.value.thead.style,position:"sticky",top:`${g.value}px`,zIndex:1})},[e.createElementVNode("tr",{ref_key:"tableRow",ref:h,role:"row",style:e.normalizeStyle({...t.value.thead.tr.style,border:t.value.thead.tr.border.size?`${t.value.thead.tr.border.size}px solid ${t.value.thead.tr.border.color}`:"none",boxShadow:$.value?"none":t.value.thead.tr.style.boxShadow}),height:`${t.value.thead.tr.height}px`},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.dataset.head,(n,i)=>(e.openBlock(),e.createElementBlock("th",{role:"cell",key:`th_${i}`,style:e.normalizeStyle({...t.value.thead.tr.th.style,border:t.value.thead.tr.th.border.size?`${t.value.thead.tr.th.border.size}px solid ${t.value.thead.tr.th.border.color}`:"none",paddingTop:t.value.thead.tr.th.padding.top+"px",paddingRight:t.value.thead.tr.th.padding.right+"px",paddingBottom:t.value.thead.tr.th.padding.bottom+"px",paddingLeft:t.value.thead.tr.th.padding.left+"px"})},[e.createTextVNode(e.toDisplayString(o.$slots.th?"":n)+" ",1),e.renderSlot(o.$slots,"th",e.normalizeProps(e.guardReactiveProps({th:n,colIndex:i})),void 0,!0)],4))),128))],12,le)],4),v.dataset.body&&v.dataset.head?(e.openBlock(),e.createElementBlock("tbody",{key:0,ref_key:"tbody",ref:T},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.dataset.body,(n,i)=>(e.openBlock(),e.createElementBlock("tr",{style:e.normalizeStyle({...t.value.tbody.tr.style,border:`${t.value.tbody.tr.border.size}px solid ${t.value.tbody.tr.border.color}`,verticalAlign:"middle"})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n,(B,q)=>(e.openBlock(),e.createElementBlock("td",{role:"cell","data-cell":v.dataset.head[q]||"",style:e.normalizeStyle({...t.value.tbody.tr.td.style,border:`${t.value.tbody.tr.td.border.size}px solid ${t.value.tbody.tr.td.border.color}`,backgroundColor:t.value.tbody.tr.td.style.backgroundColor+e.unref(r.opacity)[i%2===0&&t.value.tbody.tr.td.alternateColor?t.value.tbody.tr.td.alternateOpacity*100:100],paddingTop:t.value.tbody.tr.td.padding.top+"px",paddingRight:t.value.tbody.tr.td.padding.right+"px",paddingBottom:t.value.tbody.tr.td.padding.bottom+"px",paddingLeft:t.value.tbody.tr.td.padding.left+"px",verticalAlign:"middle"}),height:`${t.value.tbody.tr.height}px`},[e.createTextVNode(e.toDisplayString(o.$slots.td?"":B)+" ",1),e.renderSlot(o.$slots,"td",e.normalizeProps(e.guardReactiveProps({td:B,rowIndex:i,colIndex:q})),void 0,!0)],12,re))),256))],4))),256))],512)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0)],46,ne),f.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(oe.default,{key:0,config:{type:"table"}})),t.value.userOptions.show&&f.value?(e.openBlock(),e.createBlock(D.UserOptions,{ref:"details",key:`user_option_${O.value}`,backgroundColor:t.value.style.backgroundColor,color:t.value.style.color,isPrinting:e.unref(z),isImaging:e.unref(P),uid:w.value,hasTooltip:!1,hasPdf:t.value.userOptions.buttons.pdf,hasImg:t.value.userOptions.buttons.img,hasXls:t.value.userOptions.buttons.csv,hasTable:!1,hasLabel:!1,hasAnimation:t.value.userOptions.buttons.animation,isAnimation:!u.value.showAnimation,hasFullscreen:t.value.userOptions.buttons.fullscreen,isFullscreen:I.value,chartElement:F.value,titles:{...t.value.userOptions.buttonTitles},zIndex:3,noOffset:"",onGeneratePdf:M,onGenerateCsv:U,onGenerateImage:e.unref(E),onToggleAnimation:L,onToggleFullscreen:W},e.createSlots({_:2},[o.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionPdf",{},void 0,!0)]),key:"0"}:void 0,o.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionCsv",{},void 0,!0)]),key:"1"}:void 0,o.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionImg",{},void 0,!0)]),key:"2"}:void 0,o.$slots.optionAnimation?{name:"optionAnimation",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionAnimation",{},void 0,!0)]),key:"3"}:void 0,o.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:n,isFullscreen:i})=>[e.renderSlot(o.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:n,isFullscreen:i})),void 0,!0)]),key:"4"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasPdf","hasImg","hasXls","hasAnimation","isAnimation","hasFullscreen","isFullscreen","chartElement","titles","onGenerateImage"])):e.createCommentVNode("",!0)],512))}},ue=ae._export_sfc(ie,[["__scopeId","data-v-c06beec9"]]);exports.default=ue;
@@ -1,8 +1,8 @@
1
1
  import { ref as a, onMounted as B, computed as w, onBeforeUnmount as be, watch as ye, openBlock as i, createElementBlock as s, createElementVNode as R, normalizeStyle as d, unref as m, normalizeClass as Ce, createTextVNode as U, toDisplayString as L, renderSlot as v, Fragment as G, renderList as M, normalizeProps as V, guardReactiveProps as D, createCommentVNode as N, createBlock as ie, createSlots as $e, withCtx as I, nextTick as Te } from "vue";
2
- import { u as xe, c as Ae, o as q, e as X, r as ke, n as we, q as Ie } from "./index-BK818aZo.js";
3
- import { u as Fe } from "./useNestedProp-hi25rRoY.js";
4
- import { u as Oe, U as Pe } from "./usePrinter-C-2KAW2f.js";
5
- import ze from "./vue-ui-skeleton-DJtTdfNg.js";
2
+ import { u as xe, c as Ae, o as q, e as X, r as ke, n as we, q as Ie } from "./index-ByO3Ywek.js";
3
+ import { u as Fe } from "./useNestedProp-Da77DnaA.js";
4
+ import { u as Oe, U as Pe } from "./usePrinter-Dda5FBG3.js";
5
+ import ze from "./vue-ui-skeleton-BxRSQeuo.js";
6
6
  import { _ as Be } from "./_plugin-vue_export-helper-CHgC5LLL.js";
7
7
  const Re = ["id"], Ne = ["height"], Ee = ["data-cell", "height"], Se = {
8
8
  __name: "vue-ui-carousel-table",
@@ -1,10 +1,10 @@
1
1
  import { useCssVars as Pe, computed as $, ref as z, onMounted as Ve, openBlock as a, createElementBlock as o, normalizeClass as m, normalizeStyle as h, createBlock as Q, unref as y, createSlots as Re, withCtx as E, renderSlot as X, normalizeProps as Be, guardReactiveProps as Me, createCommentVNode as b, toDisplayString as n, createElementVNode as s, Fragment as p, renderList as _, createTextVNode as Y, withKeys as je, createVNode as Xe, nextTick as ve } from "vue";
2
- import { u as Oe, c as Ge, t as Ee, a as Ae, p as I, b as Ue, g as Z, e as H, d as ee, o as De, X as Ye, s as ye, r as F, C as he, m as fe, i as qe, j as L, k as q, n as He, q as We } from "./index-BK818aZo.js";
3
- import { u as Ke, U as Je } from "./usePrinter-C-2KAW2f.js";
4
- import Qe from "./vue-ui-skeleton-DJtTdfNg.js";
5
- import Ze from "./BaseIcon-NaAlKaAM.js";
6
- import et from "./vue-ui-accordion-CH8K6f6J.js";
7
- import { u as be } from "./useNestedProp-hi25rRoY.js";
2
+ import { u as Oe, c as Ge, t as Ee, a as Ae, p as I, b as Ue, g as Z, e as H, d as ee, o as De, X as Ye, s as ye, r as F, C as he, m as fe, i as qe, j as L, k as q, n as He, q as We } from "./index-ByO3Ywek.js";
3
+ import { u as Ke, U as Je } from "./usePrinter-Dda5FBG3.js";
4
+ import Qe from "./vue-ui-skeleton-BxRSQeuo.js";
5
+ import Ze from "./BaseIcon-DB1g9sdS.js";
6
+ import et from "./vue-ui-accordion-CbKHVPHh.js";
7
+ import { u as be } from "./useNestedProp-Da77DnaA.js";
8
8
  import { _ as tt } from "./_plugin-vue_export-helper-CHgC5LLL.js";
9
9
  const lt = ["id"], at = ["xmlns", "viewBox"], ot = { key: 0 }, st = ["fill", "font-weight", "font-size", "x", "y"], ut = ["fill", "font-weight", "font-size", "x", "y"], nt = ["id"], rt = ["stop-color"], it = ["stop-color"], ct = ["id"], dt = ["stop-color"], vt = ["stop-color"], yt = ["id"], ht = ["stop-color"], ft = ["stop-color"], bt = ["stop-color"], pt = ["id"], _t = ["stop-color"], gt = ["stop-color"], xt = ["stop-color"], mt = ["id"], kt = ["stop-color"], wt = ["stop-color"], $t = ["stop-color"], Ct = { key: 1 }, zt = ["x", "y", "font-size", "font-weight", "fill"], Tt = ["x", "y", "font-size", "font-weight", "fill"], Ft = ["d", "stroke"], Nt = ["cx", "cy", "r", "fill"], St = ["cx", "cy", "r", "fill", "stroke", "stroke-width", "onClick"], It = { key: 2 }, Lt = ["x", "y", "font-size", "fill", "onClick"], Pt = { key: 0 }, Vt = ["x", "y", "fill", "font-size", "font-weight"], Rt = ["x", "y", "height", "width", "fill", "rx", "onClick"], Bt = ["x", "y", "height", "width", "fill", "rx", "stroke", "stroke-width", "onClick"], Mt = { key: 3 }, jt = ["x", "y", "fill", "font-size", "onClick"], Xt = ["d", "stroke"], Ot = ["cx", "cy", "fill", "onClick"], Gt = ["fill", "cx", "cy", "r", "onClick"], Et = { key: 4 }, At = ["x", "y", "font-size", "font-weight", "fill"], Ut = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], Dt = ["y", "height", "width"], Yt = { style: { width: "100%", height: "100%", display: "flex", "align-items": "center", "justify-content": "center", "flex-direction": "column" } }, qt = { style: { display: "flex", "align-items": "center", "justify-content": "center", gap: "12px", "flex-wrap": "wrap", "flex-direction": "row" } }, Ht = {
10
10
  viewBox: "0 0 20 20",
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),n=require("./index-Xau3hcRk.cjs"),U=require("./usePrinter-Dhvmhwhf.cjs"),ce=require("./vue-ui-skeleton-CgYrDrh-.cjs"),ie=require("./BaseIcon-BGeIE3vn.cjs"),de=require("./vue-ui-accordion-BjU8im6m.cjs"),q=require("./useNestedProp-C_EQ-Kxy.cjs"),ye=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),ve=["id"],he=["xmlns","viewBox"],pe={key:0},fe=["fill","font-weight","font-size","x","y"],me=["fill","font-weight","font-size","x","y"],ge=["id"],be=["stop-color"],ke=["stop-color"],xe=["id"],_e=["stop-color"],Be=["stop-color"],Ee=["id"],Se=["stop-color"],Ne=["stop-color"],ze=["stop-color"],Ce=["id"],we=["stop-color"],Ve=["stop-color"],$e=["stop-color"],Te=["id"],Fe=["stop-color"],De=["stop-color"],Le=["stop-color"],Me={key:1},Ie=["x","y","font-size","font-weight","fill"],Pe=["x","y","font-size","font-weight","fill"],Oe=["d","stroke"],Re=["cx","cy","r","fill"],Xe=["cx","cy","r","fill","stroke","stroke-width","onClick"],je={key:2},Ae=["x","y","font-size","fill","onClick"],Ge={key:0},Ue=["x","y","fill","font-size","font-weight"],qe=["x","y","height","width","fill","rx","onClick"],Ye=["x","y","height","width","fill","rx","stroke","stroke-width","onClick"],He={key:3},We=["x","y","fill","font-size","onClick"],Ke=["d","stroke"],Je=["cx","cy","fill","onClick"],Qe=["fill","cx","cy","r","onClick"],Ze={key:4},et=["x","y","font-size","font-weight","fill"],tt=["x1","x2","y1","y2","stroke","stroke-width"],lt=["y","height","width"],at={style:{width:"100%",height:"100%",display:"flex","align-items":"center","justify-content":"center","flex-direction":"column"}},ot={style:{display:"flex","align-items":"center","justify-content":"center",gap:"12px","flex-wrap":"wrap","flex-direction":"row"}},nt={viewBox:"0 0 20 20",height:"16",width:"16"},rt=["fill"],st={key:6},ut=["y","height","width"],ct={style:{width:"100%",height:"100%",display:"flex","align-items":"center","justify-content":"center","flex-direction":"column"}},it={style:{display:"flex","align-items":"center","justify-content":"center",gap:"12px","flex-wrap":"wrap","flex-direction":"row"}},dt={viewBox:"0 0 20 20",height:"16",width:"16"},yt=["fill"],vt=["d","stroke"],ht=["cx","cy","fill"],pt=["cx","cy","fill"],ft=["d","stroke"],mt=["cx","cy","fill"],gt=["cx","cy","fill"],bt=["x","y","fill","font-size","font-weight"],kt=["x","y","fill","font-size","font-weight"],xt=["x","text-anchor","y","fill","font-size"],_t=["x","text-anchor","y","fill","font-size"],Bt=["x","text-anchor","y","fill","font-size"],Et=["x","text-anchor","y","fill","font-size"],St=["x","text-anchor","y","fill","font-size"],Nt=["x","y","font-size","fill"],zt=["x","y","font-size","fill"],Ct=["x","y","font-size","fill"],wt={style:{"padding-top":"36px",position:"relative"}},Vt={class:"vue-ui-data-table"},$t={key:0},Tt=["data-cell"],Ft={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},Dt={key:0},Lt={key:1},Mt=["data-cell"],It={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},Pt={key:0},Ot={key:1},Rt=["data-cell"],Xt={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},jt={key:0},At={key:1},Gt=["data-cell"],Ut={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},qt={key:0},Yt={key:1},Ht=["data-cell"],Wt={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},Kt={key:0},Jt={key:1},Qt=["data-cell"],Zt={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},el={key:0},tl={key:1},ll=["data-cell"],al={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},ol={key:0},nl={key:1},rl=["data-cell"],sl={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},ul=["data-cell"],cl={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},il=["data-cell"],dl={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},yl=["data-cell"],vl={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},hl=["data-cell"],pl={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},fl={__name:"vue-ui-chestnut",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectRoot","selectBranch","selectNut"],setup(Y,{expose:H,emit:N}){const k=Y;e.useCssVars(a=>({a08a8b28:a.tdo}));const{vue_ui_chestnut:W}=n.useConfig(),C=e.computed(()=>!!k.dataset&&k.dataset.length),h=e.ref(n.createUid()),D=e.ref(null),K=e.ref(null),L=e.ref(0),t=e.computed(()=>{const a=q.useNestedProp({userConfig:k.config,defaultConfig:W});return a.theme?{...q.useNestedProp({userConfig:n.themes.vue_ui_chestnut[a.theme]||k.config,defaultConfig:a}),customPalette:n.themePalettes[a.theme]||n.palette}:a}),{isPrinting:J,isImaging:Q,generatePdf:M,generateImage:I}=U.usePrinter({elementId:`vue-ui-chestnut_${h.value}`,fileName:t.value.style.chart.layout.title.text||"vue-ui-chestnut"}),$=e.computed(()=>n.convertCustomPalette(t.value.customPalette)),w=e.ref({showTable:t.value.table.show}),P=e.ref(null),O=e.ref(!1),Z=e.computed(()=>t.value.table.responsiveBreakpoint),r=e.ref({gap:6,padding:{top:102,left:12,right:12,bottom:96},width:1024,height:0,branchSize:32,branchStart:128}),f=e.computed(()=>({left:r.value.padding.left,top:r.value.padding.top,right:r.value.width-r.value.padding.right,bottom:r.value.height-r.value.padding.bottom,width:r.value.width-(r.value.padding.left+r.value.padding.right),height:r.value.height-(r.value.padding.top+r.value.padding.bottom),seedX:r.value.padding.left+64})),x=e.computed(()=>C.value?k.dataset.flatMap(a=>a.branches.map(s=>s.value)).reduce((a,s)=>a+s):0),m=e.computed(()=>(k.dataset.forEach((a,s)=>{n.getMissingDatasetAttributes({datasetObject:a,requiredAttributes:["name","branches"]}).forEach(l=>{n.error({componentName:"VueUiChestnut",type:"datasetSerieAttribute",property:l,index:s})}),a.branches&&a.branches.forEach((l,o)=>{n.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","value"]}).forEach(d=>{n.error({componentName:"VueUiChestnut",type:"datasetSerieAttribute",property:d,index:`${s} - ${o}`})}),l.breakdown&&l.breakdown.forEach((d,i)=>{n.getMissingDatasetAttributes({datasetObject:d,requiredAttributes:["name","value"]}).forEach(y=>{n.error({componentName:"VueUiChestnut",type:"datasetSerieAttribute",property:y,index:`${s} - ${o} - ${i}`})})})})}),k.dataset.map((a,s)=>{const l=a.branches.map(o=>o.value).reduce((o,d)=>o+d);return{...a,color:n.convertColorToHex(a.color)||$.value[s]||n.palette[s]||n.palette[s%n.palette.length],id:a.id||`root_${s}_${h.value}`,type:"root",total:l,rootIndex:s,branches:a.branches.map((o,d)=>({...o,rootName:a.name,rootIndex:s,color:n.convertColorToHex(a.color)||$.value[s]||n.palette[s]||n.palette[s%n.palette.length],value:o.value>=0?o.value:0,id:o.id||`branch_${s}_${d}_${h.value}`,proportionToRoot:o.value/l,type:"branch",breakdown:o.breakdown.map((i,y)=>({table:{rootName:a.name,rootValue:l,rootToTotal:l/x.value,branchName:o.name,branchValue:o.value,branchToTotal:o.value/x.value,branchToRoot:o.value/l,nutName:i.name,nutValue:i.value,nutToTotal:i.value/x.value,nutToRoot:i.value/l,nutToBranch:i.value/o.value},...i,type:"nut",branchName:o.name,rootName:a.name,branchTotal:o.value>=0?o.value:0,proportionToBranch:i.value/o.value,proportionToRoot:i.value/l,proportionToTree:i.value/x.value,rootIndex:s,id:i.id||`nut_${s}_${d}_${y}_${h.value}`,color:n.convertColorToHex(i.color)||$.value[y]||n.palette[y]||n.palette[y%n.palette.length],value:i.value>=0?i.value:0}))}))}})));function ee(){return m.value}const te=e.computed(()=>m.value.flatMap(a=>a.branches).length),le=e.computed(()=>Math.max(...m.value.map(a=>a.branches.map(s=>s.value).reduce((s,l)=>s+l,0)))),ae=e.computed(()=>Math.max(...m.value.flatMap(a=>a.branches.map(s=>s.value)))),R=e.computed(()=>256+r.value.padding.left),B=e.computed(()=>m.value.sort((a,s)=>s.total-a.total).map((a,s)=>{const l=f.value.height/m.value.length/2,o=a.total/le.value*(l>64?64:l);return{...a,x:f.value.seedX,y:f.value.top+f.value.height/m.value.length*(s+1)-(f.value.height/m.value.length/2+r.value.gap/2),r:o<r.value.branchSize/2?r.value.branchSize/2:o}})),oe=e.computed(()=>t.value.style.chart.layout.branches.widthRatio<=0?.1:t.value.style.chart.layout.branches.widthRatio>1.8?1.8:t.value.style.chart.layout.branches.widthRatio),ne=e.computed(()=>B.value.flatMap(a=>a.branches)),_=e.computed(()=>ne.value.sort((a,s)=>s.value-a.value).map((a,s)=>({...a,y1:s*r.value.branchSize+f.value.top+s*r.value.gap,y2:s*r.value.branchSize+r.value.branchSize,x1:R.value,x2:384*a.value/ae.value*oe.value+R.value})));function T(a){const s=B.value.find(l=>l.rootIndex===a.rootIndex);return{x:s.x,y:s.y,r:s.r}}const c=e.ref(null),E=e.ref(null),v=e.ref(null),g=e.ref(null);function p(){c.value=null,v.value=null,g.value=null}function b(a){return g.value?g.value===null?!0:a.type==="root"?a.id===g.value.id:a.rootIndex===g.value.rootIndex:c.value===null&&v.value===null?!0:a.type==="nut"?c.value.id===a.id:a.type==="branch"?v.value.id===a.id:a.type==="root"?v.value&&v.value.rootIndex===a.rootIndex||c.value&&c.value.rootIndex===a.rootIndex:!1}function X(a){p(),e.nextTick(()=>{c.value=a,v.value=a,E.value=n.makeDonut({series:a.breakdown,base:1},a.x2+24+t.value.style.chart.layout.nuts.offsetX,a.y1+r.value.branchSize/2,80,80),N("selectNut",a.breakdown)})}function S(){c.value=null,E.value=null,N("selectNut",null)}function F(a){v.value&&v.value.id===a.id?(v.value=null,p(),N("selectBranch",null)):(p(),v.value=a,N("selectBranch",a))}function j(a){g.value&&g.value.id===a.id?(p(),N("selectRoot",null)):(p(),g.value=a,N("selectRoot",a))}function re(){return f.value.bottom-(c.value.y1+180)<0?0:f.value.bottom}function z(a){return a.proportion*100>t.value.style.chart.layout.nuts.selected.labels.dataLabels.hideUnderValue}function se(){new ResizeObserver(s=>{s.forEach(l=>{O.value=l.contentRect.width<Z.value})}).observe(P.value)}e.onMounted(()=>{n.objectIsEmpty(k.dataset)&&n.error({componentName:"VueUiChestnut",type:"dataset"});const a=te.value*(r.value.branchSize+r.value.gap)+r.value.padding.top+r.value.padding.bottom;r.value.height=a,se()});const u=e.computed(()=>{const a=[t.value.table.th.translations.rootName,t.value.table.th.translations.rootValue,t.value.table.th.translations.rootToTotal,t.value.table.th.translations.branchName,t.value.table.th.translations.branchValue,t.value.table.th.translations.branchToRoot,t.value.table.th.translations.branchToTotal,t.value.table.th.translations.nutName,t.value.table.th.translations.nutValue,t.value.table.th.translations.nutToBranch,t.value.table.th.translations.nutToRoot,t.value.table.th.translations.nutToTotal],s=m.value.flatMap((l,o)=>l.branches.flatMap((d,i)=>d.breakdown.flatMap((y,gl)=>y.table)));return{head:a,body:s}});function A(){e.nextTick(()=>{const a=[[t.value.style.chart.layout.title.text],[t.value.style.chart.layout.title.subtitle.text],[""],["Grand total",x.value],[""]],s=u.value.head,l=u.value.body.map((i,y)=>[u.value.body[y-1]&&u.value.body[y-1].rootName===i.rootName?"":i.rootName,u.value.body[y-1]&&u.value.body[y-1].rootName===i.rootName?"":i.rootValue,u.value.body[y-1]&&u.value.body[y-1].rootName===i.rootName?"":i.rootToTotal,u.value.body[y-1]&&u.value.body[y-1].branchName===i.branchName?"":i.branchName,u.value.body[y-1]&&u.value.body[y-1].branchName===i.branchName?"":i.branchValue,u.value.body[y-1]&&u.value.body[y-1].branchName===i.branchName?"":i.branchToRoot,u.value.body[y-1]&&u.value.body[y-1].branchName===i.branchName?"":i.branchToTotal,i.nutName,i.nutValue,i.nutToBranch,i.nutToRoot,i.nutToTotal]),o=a.concat([s]).concat(l),d=n.createCsvContent(o);n.downloadCsv({csvContent:d,title:t.value.style.chart.layout.title.text||"vue-ui-chestnut"})})}const V=e.ref(!1);function ue(a){V.value=a,L.value+=1}function G(){w.value.showTable=!w.value.showTable}return H({getData:ee,generatePdf:M,generateCsv:A,generateImage:I,toggleTable:G}),(a,s)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(`vue-ui-chestnut ${V.value?"vue-data-ui-wrapper-fullscreen":""}`),ref_key:"chestnutChart",ref:D,id:`vue-ui-chestnut_${h.value}`,style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};width:100%; text-align:center;padding-top:36px;background:${t.value.style.chart.backgroundColor}`)},[t.value.userOptions.show&&C.value?(e.openBlock(),e.createBlock(U.UserOptions,{ref_key:"details",ref:K,key:`user_options_${L.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isImaging:e.unref(Q),isPrinting:e.unref(J),uid:h.value,hasPdf:t.value.userOptions.buttons.pdf,hasImg:t.value.userOptions.buttons.img,hasXls:t.value.userOptions.buttons.csv,hasTable:t.value.userOptions.buttons.table,hasFullscreen:t.value.userOptions.buttons.fullscreen,isFullscreen:V.value,titles:{...t.value.userOptions.buttonTitles},chartElement:D.value,onToggleFullscreen:ue,onGeneratePdf:e.unref(M),onGenerateCsv:A,onGenerateImage:e.unref(I),onToggleTable:G},e.createSlots({_:2},[a.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionPdf",{},void 0,!0)]),key:"0"}:void 0,a.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionCsv",{},void 0,!0)]),key:"1"}:void 0,a.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionImg",{},void 0,!0)]),key:"2"}:void 0,a.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionTable",{},void 0,!0)]),key:"3"}:void 0,a.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:l,isFullscreen:o})=>[e.renderSlot(a.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:l,isFullscreen:o})),void 0,!0)]),key:"4"}:void 0]),1032,["backgroundColor","color","isImaging","isPrinting","uid","hasPdf","hasImg","hasXls","hasTable","hasFullscreen","isFullscreen","titles","chartElement","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),r.value.height>0&&C.value?(e.openBlock(),e.createElementBlock("svg",{key:1,xmlns:e.unref(n.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":V.value,"vue-data-ui-fulscreen--off":!V.value}),viewBox:`0 0 ${r.value.width} ${r.value.height}`,style:e.normalizeStyle(`max-width:100%;overflow:visible;background:${t.value.style.chart.backgroundColor};color:${t.value.style.chart.color}`)},[c.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("g",pe,[t.value.style.chart.layout.title.text?(e.openBlock(),e.createElementBlock("text",{key:0,"text-anchor":"middle",fill:t.value.style.chart.layout.title.color,"font-weight":t.value.style.chart.layout.title.bold?"bold":"normal","font-size":t.value.style.chart.layout.title.fontSize,x:r.value.width/2,y:12+t.value.style.chart.layout.title.fontSize+t.value.style.chart.layout.title.offsetY,onClick:p},e.toDisplayString(t.value.style.chart.layout.title.text),9,fe)):e.createCommentVNode("",!0),t.value.style.chart.layout.title.subtitle.text?(e.openBlock(),e.createElementBlock("text",{key:1,"text-anchor":"middle",fill:t.value.style.chart.layout.title.subtitle.color,"font-weight":t.value.style.chart.layout.title.subtitle.bold?"bold":"normal","font-size":t.value.style.chart.layout.title.subtitle.fontSize,x:r.value.width/2,y:48+t.value.style.chart.layout.title.subtitle.fontSize+t.value.style.chart.layout.title.subtitle.offsetY,onClick:p},e.toDisplayString(t.value.style.chart.layout.title.subtitle.text),9,me)):e.createCommentVNode("",!0)])),e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,(l,o)=>(e.openBlock(),e.createElementBlock("radialGradient",{cx:"50%",cy:"50%",r:"50%",fx:"50%",fy:"50%",id:`root_gradient_${h.value}_${l.rootIndex}`},[e.createElementVNode("stop",{offset:"0%","stop-color":`${e.unref(n.shiftHue)(l.color,.05)}${e.unref(n.opacity)[100-t.value.style.chart.layout.roots.gradientIntensity]}`},null,8,be),e.createElementVNode("stop",{offset:"100%","stop-color":l.color},null,8,ke)],8,ge))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,l=>(e.openBlock(),e.createElementBlock("linearGradient",{x1:"0%",y1:"0%",x2:"100%",y2:"0%",id:`branch_gradient_${h.value}_${l.rootIndex}`},[e.createElementVNode("stop",{offset:"0%","stop-color":l.color},null,8,_e),e.createElementVNode("stop",{offset:"100%","stop-color":`${e.unref(n.shiftHue)(l.color,.02)}${e.unref(n.opacity)[100-t.value.style.chart.layout.branches.gradientIntensity]}`},null,8,Be)],8,xe))),256)),e.createElementVNode("radialGradient",{cx:"50%",cy:"50%",r:"50%",fx:"50%",fy:"50%",id:`nutpick_${h.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":`#FFFFFF${e.unref(n.opacity)[0]}`},null,8,Se),e.createElementVNode("stop",{offset:"80%","stop-color":`#FFFFFF${e.unref(n.opacity)[t.value.style.chart.layout.nuts.selected.gradientIntensity]}`},null,8,Ne),e.createElementVNode("stop",{offset:"100%","stop-color":`#FFFFFF${e.unref(n.opacity)[0]}`},null,8,ze)],8,Ee),e.createElementVNode("radialGradient",{cx:"50%",cy:"50%",r:"50%",fx:"50%",fy:"50%",id:`nut_${h.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":`#FFFFFF${e.unref(n.opacity)[0]}`},null,8,we),e.createElementVNode("stop",{offset:"80%","stop-color":`#FFFFFF${e.unref(n.opacity)[t.value.style.chart.layout.nuts.gradientIntensity]}`},null,8,Ve),e.createElementVNode("stop",{offset:"100%","stop-color":`#FFFFFF${e.unref(n.opacity)[0]}`},null,8,$e)],8,Ce),e.createElementVNode("radialGradient",{cx:"50%",cy:"50%",r:"50%",fx:"50%",fy:"50%",id:`nut_underlayer_${h.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":`${t.value.style.chart.backgroundColor}${e.unref(n.opacity)[100]}`},null,8,Fe),e.createElementVNode("stop",{offset:"80%","stop-color":`${t.value.style.chart.backgroundColor}${e.unref(n.opacity)[60]}`},null,8,De),e.createElementVNode("stop",{offset:"100%","stop-color":`${t.value.style.chart.backgroundColor}${e.unref(n.opacity)[0]}`},null,8,Le)],8,Te)]),t.value.style.chart.layout.grandTotal.show?(e.openBlock(),e.createElementBlock("g",Me,[e.createElementVNode("text",{x:f.value.seedX,y:32+t.value.style.chart.layout.grandTotal.offsetY,"font-size":t.value.style.chart.layout.grandTotal.fontSize,"font-weight":t.value.style.chart.layout.grandTotal.bold?"bold":"normal",fill:t.value.style.chart.layout.grandTotal.color,"text-anchor":"middle",onClick:p},e.toDisplayString(t.value.style.chart.layout.grandTotal.text),9,Ie),e.createElementVNode("text",{x:f.value.seedX,y:38+t.value.style.chart.layout.grandTotal.fontSize+t.value.style.chart.layout.grandTotal.offsetY,"font-size":t.value.style.chart.layout.grandTotal.fontSize,"font-weight":t.value.style.chart.layout.grandTotal.bold?"bold":"normal",fill:t.value.style.chart.layout.grandTotal.color,"text-anchor":"middle",onClick:p},e.toDisplayString(t.value.style.chart.layout.grandTotal.prefix)+" "+e.toDisplayString(x.value.toFixed(t.value.style.chart.layout.grandTotal.roundingValue))+" "+e.toDisplayString(t.value.style.chart.layout.grandTotal.suffix),9,Pe)])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_.value,l=>(e.openBlock(),e.createElementBlock("g",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value.branchSize,(o,d)=>(e.openBlock(),e.createElementBlock("path",{d:`M
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),n=require("./index-BDKEFvEF.cjs"),U=require("./usePrinter-DedM_6px.cjs"),ce=require("./vue-ui-skeleton-rY_nZhMQ.cjs"),ie=require("./BaseIcon-5MAyZTOz.cjs"),de=require("./vue-ui-accordion-BytUYLYl.cjs"),q=require("./useNestedProp-Dikfncsl.cjs"),ye=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),ve=["id"],he=["xmlns","viewBox"],pe={key:0},fe=["fill","font-weight","font-size","x","y"],me=["fill","font-weight","font-size","x","y"],ge=["id"],be=["stop-color"],ke=["stop-color"],xe=["id"],_e=["stop-color"],Be=["stop-color"],Ee=["id"],Se=["stop-color"],Ne=["stop-color"],ze=["stop-color"],Ce=["id"],we=["stop-color"],Ve=["stop-color"],$e=["stop-color"],Te=["id"],Fe=["stop-color"],De=["stop-color"],Le=["stop-color"],Me={key:1},Ie=["x","y","font-size","font-weight","fill"],Pe=["x","y","font-size","font-weight","fill"],Oe=["d","stroke"],Re=["cx","cy","r","fill"],Xe=["cx","cy","r","fill","stroke","stroke-width","onClick"],je={key:2},Ae=["x","y","font-size","fill","onClick"],Ge={key:0},Ue=["x","y","fill","font-size","font-weight"],qe=["x","y","height","width","fill","rx","onClick"],Ye=["x","y","height","width","fill","rx","stroke","stroke-width","onClick"],He={key:3},We=["x","y","fill","font-size","onClick"],Ke=["d","stroke"],Je=["cx","cy","fill","onClick"],Qe=["fill","cx","cy","r","onClick"],Ze={key:4},et=["x","y","font-size","font-weight","fill"],tt=["x1","x2","y1","y2","stroke","stroke-width"],lt=["y","height","width"],at={style:{width:"100%",height:"100%",display:"flex","align-items":"center","justify-content":"center","flex-direction":"column"}},ot={style:{display:"flex","align-items":"center","justify-content":"center",gap:"12px","flex-wrap":"wrap","flex-direction":"row"}},nt={viewBox:"0 0 20 20",height:"16",width:"16"},rt=["fill"],st={key:6},ut=["y","height","width"],ct={style:{width:"100%",height:"100%",display:"flex","align-items":"center","justify-content":"center","flex-direction":"column"}},it={style:{display:"flex","align-items":"center","justify-content":"center",gap:"12px","flex-wrap":"wrap","flex-direction":"row"}},dt={viewBox:"0 0 20 20",height:"16",width:"16"},yt=["fill"],vt=["d","stroke"],ht=["cx","cy","fill"],pt=["cx","cy","fill"],ft=["d","stroke"],mt=["cx","cy","fill"],gt=["cx","cy","fill"],bt=["x","y","fill","font-size","font-weight"],kt=["x","y","fill","font-size","font-weight"],xt=["x","text-anchor","y","fill","font-size"],_t=["x","text-anchor","y","fill","font-size"],Bt=["x","text-anchor","y","fill","font-size"],Et=["x","text-anchor","y","fill","font-size"],St=["x","text-anchor","y","fill","font-size"],Nt=["x","y","font-size","fill"],zt=["x","y","font-size","fill"],Ct=["x","y","font-size","fill"],wt={style:{"padding-top":"36px",position:"relative"}},Vt={class:"vue-ui-data-table"},$t={key:0},Tt=["data-cell"],Ft={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},Dt={key:0},Lt={key:1},Mt=["data-cell"],It={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},Pt={key:0},Ot={key:1},Rt=["data-cell"],Xt={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},jt={key:0},At={key:1},Gt=["data-cell"],Ut={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},qt={key:0},Yt={key:1},Ht=["data-cell"],Wt={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},Kt={key:0},Jt={key:1},Qt=["data-cell"],Zt={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},el={key:0},tl={key:1},ll=["data-cell"],al={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},ol={key:0},nl={key:1},rl=["data-cell"],sl={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},ul=["data-cell"],cl={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},il=["data-cell"],dl={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},yl=["data-cell"],vl={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},hl=["data-cell"],pl={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},fl={__name:"vue-ui-chestnut",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectRoot","selectBranch","selectNut"],setup(Y,{expose:H,emit:N}){const k=Y;e.useCssVars(a=>({a08a8b28:a.tdo}));const{vue_ui_chestnut:W}=n.useConfig(),C=e.computed(()=>!!k.dataset&&k.dataset.length),h=e.ref(n.createUid()),D=e.ref(null),K=e.ref(null),L=e.ref(0),t=e.computed(()=>{const a=q.useNestedProp({userConfig:k.config,defaultConfig:W});return a.theme?{...q.useNestedProp({userConfig:n.themes.vue_ui_chestnut[a.theme]||k.config,defaultConfig:a}),customPalette:n.themePalettes[a.theme]||n.palette}:a}),{isPrinting:J,isImaging:Q,generatePdf:M,generateImage:I}=U.usePrinter({elementId:`vue-ui-chestnut_${h.value}`,fileName:t.value.style.chart.layout.title.text||"vue-ui-chestnut"}),$=e.computed(()=>n.convertCustomPalette(t.value.customPalette)),w=e.ref({showTable:t.value.table.show}),P=e.ref(null),O=e.ref(!1),Z=e.computed(()=>t.value.table.responsiveBreakpoint),r=e.ref({gap:6,padding:{top:102,left:12,right:12,bottom:96},width:1024,height:0,branchSize:32,branchStart:128}),f=e.computed(()=>({left:r.value.padding.left,top:r.value.padding.top,right:r.value.width-r.value.padding.right,bottom:r.value.height-r.value.padding.bottom,width:r.value.width-(r.value.padding.left+r.value.padding.right),height:r.value.height-(r.value.padding.top+r.value.padding.bottom),seedX:r.value.padding.left+64})),x=e.computed(()=>C.value?k.dataset.flatMap(a=>a.branches.map(s=>s.value)).reduce((a,s)=>a+s):0),m=e.computed(()=>(k.dataset.forEach((a,s)=>{n.getMissingDatasetAttributes({datasetObject:a,requiredAttributes:["name","branches"]}).forEach(l=>{n.error({componentName:"VueUiChestnut",type:"datasetSerieAttribute",property:l,index:s})}),a.branches&&a.branches.forEach((l,o)=>{n.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","value"]}).forEach(d=>{n.error({componentName:"VueUiChestnut",type:"datasetSerieAttribute",property:d,index:`${s} - ${o}`})}),l.breakdown&&l.breakdown.forEach((d,i)=>{n.getMissingDatasetAttributes({datasetObject:d,requiredAttributes:["name","value"]}).forEach(y=>{n.error({componentName:"VueUiChestnut",type:"datasetSerieAttribute",property:y,index:`${s} - ${o} - ${i}`})})})})}),k.dataset.map((a,s)=>{const l=a.branches.map(o=>o.value).reduce((o,d)=>o+d);return{...a,color:n.convertColorToHex(a.color)||$.value[s]||n.palette[s]||n.palette[s%n.palette.length],id:a.id||`root_${s}_${h.value}`,type:"root",total:l,rootIndex:s,branches:a.branches.map((o,d)=>({...o,rootName:a.name,rootIndex:s,color:n.convertColorToHex(a.color)||$.value[s]||n.palette[s]||n.palette[s%n.palette.length],value:o.value>=0?o.value:0,id:o.id||`branch_${s}_${d}_${h.value}`,proportionToRoot:o.value/l,type:"branch",breakdown:o.breakdown.map((i,y)=>({table:{rootName:a.name,rootValue:l,rootToTotal:l/x.value,branchName:o.name,branchValue:o.value,branchToTotal:o.value/x.value,branchToRoot:o.value/l,nutName:i.name,nutValue:i.value,nutToTotal:i.value/x.value,nutToRoot:i.value/l,nutToBranch:i.value/o.value},...i,type:"nut",branchName:o.name,rootName:a.name,branchTotal:o.value>=0?o.value:0,proportionToBranch:i.value/o.value,proportionToRoot:i.value/l,proportionToTree:i.value/x.value,rootIndex:s,id:i.id||`nut_${s}_${d}_${y}_${h.value}`,color:n.convertColorToHex(i.color)||$.value[y]||n.palette[y]||n.palette[y%n.palette.length],value:i.value>=0?i.value:0}))}))}})));function ee(){return m.value}const te=e.computed(()=>m.value.flatMap(a=>a.branches).length),le=e.computed(()=>Math.max(...m.value.map(a=>a.branches.map(s=>s.value).reduce((s,l)=>s+l,0)))),ae=e.computed(()=>Math.max(...m.value.flatMap(a=>a.branches.map(s=>s.value)))),R=e.computed(()=>256+r.value.padding.left),B=e.computed(()=>m.value.sort((a,s)=>s.total-a.total).map((a,s)=>{const l=f.value.height/m.value.length/2,o=a.total/le.value*(l>64?64:l);return{...a,x:f.value.seedX,y:f.value.top+f.value.height/m.value.length*(s+1)-(f.value.height/m.value.length/2+r.value.gap/2),r:o<r.value.branchSize/2?r.value.branchSize/2:o}})),oe=e.computed(()=>t.value.style.chart.layout.branches.widthRatio<=0?.1:t.value.style.chart.layout.branches.widthRatio>1.8?1.8:t.value.style.chart.layout.branches.widthRatio),ne=e.computed(()=>B.value.flatMap(a=>a.branches)),_=e.computed(()=>ne.value.sort((a,s)=>s.value-a.value).map((a,s)=>({...a,y1:s*r.value.branchSize+f.value.top+s*r.value.gap,y2:s*r.value.branchSize+r.value.branchSize,x1:R.value,x2:384*a.value/ae.value*oe.value+R.value})));function T(a){const s=B.value.find(l=>l.rootIndex===a.rootIndex);return{x:s.x,y:s.y,r:s.r}}const c=e.ref(null),E=e.ref(null),v=e.ref(null),g=e.ref(null);function p(){c.value=null,v.value=null,g.value=null}function b(a){return g.value?g.value===null?!0:a.type==="root"?a.id===g.value.id:a.rootIndex===g.value.rootIndex:c.value===null&&v.value===null?!0:a.type==="nut"?c.value.id===a.id:a.type==="branch"?v.value.id===a.id:a.type==="root"?v.value&&v.value.rootIndex===a.rootIndex||c.value&&c.value.rootIndex===a.rootIndex:!1}function X(a){p(),e.nextTick(()=>{c.value=a,v.value=a,E.value=n.makeDonut({series:a.breakdown,base:1},a.x2+24+t.value.style.chart.layout.nuts.offsetX,a.y1+r.value.branchSize/2,80,80),N("selectNut",a.breakdown)})}function S(){c.value=null,E.value=null,N("selectNut",null)}function F(a){v.value&&v.value.id===a.id?(v.value=null,p(),N("selectBranch",null)):(p(),v.value=a,N("selectBranch",a))}function j(a){g.value&&g.value.id===a.id?(p(),N("selectRoot",null)):(p(),g.value=a,N("selectRoot",a))}function re(){return f.value.bottom-(c.value.y1+180)<0?0:f.value.bottom}function z(a){return a.proportion*100>t.value.style.chart.layout.nuts.selected.labels.dataLabels.hideUnderValue}function se(){new ResizeObserver(s=>{s.forEach(l=>{O.value=l.contentRect.width<Z.value})}).observe(P.value)}e.onMounted(()=>{n.objectIsEmpty(k.dataset)&&n.error({componentName:"VueUiChestnut",type:"dataset"});const a=te.value*(r.value.branchSize+r.value.gap)+r.value.padding.top+r.value.padding.bottom;r.value.height=a,se()});const u=e.computed(()=>{const a=[t.value.table.th.translations.rootName,t.value.table.th.translations.rootValue,t.value.table.th.translations.rootToTotal,t.value.table.th.translations.branchName,t.value.table.th.translations.branchValue,t.value.table.th.translations.branchToRoot,t.value.table.th.translations.branchToTotal,t.value.table.th.translations.nutName,t.value.table.th.translations.nutValue,t.value.table.th.translations.nutToBranch,t.value.table.th.translations.nutToRoot,t.value.table.th.translations.nutToTotal],s=m.value.flatMap((l,o)=>l.branches.flatMap((d,i)=>d.breakdown.flatMap((y,gl)=>y.table)));return{head:a,body:s}});function A(){e.nextTick(()=>{const a=[[t.value.style.chart.layout.title.text],[t.value.style.chart.layout.title.subtitle.text],[""],["Grand total",x.value],[""]],s=u.value.head,l=u.value.body.map((i,y)=>[u.value.body[y-1]&&u.value.body[y-1].rootName===i.rootName?"":i.rootName,u.value.body[y-1]&&u.value.body[y-1].rootName===i.rootName?"":i.rootValue,u.value.body[y-1]&&u.value.body[y-1].rootName===i.rootName?"":i.rootToTotal,u.value.body[y-1]&&u.value.body[y-1].branchName===i.branchName?"":i.branchName,u.value.body[y-1]&&u.value.body[y-1].branchName===i.branchName?"":i.branchValue,u.value.body[y-1]&&u.value.body[y-1].branchName===i.branchName?"":i.branchToRoot,u.value.body[y-1]&&u.value.body[y-1].branchName===i.branchName?"":i.branchToTotal,i.nutName,i.nutValue,i.nutToBranch,i.nutToRoot,i.nutToTotal]),o=a.concat([s]).concat(l),d=n.createCsvContent(o);n.downloadCsv({csvContent:d,title:t.value.style.chart.layout.title.text||"vue-ui-chestnut"})})}const V=e.ref(!1);function ue(a){V.value=a,L.value+=1}function G(){w.value.showTable=!w.value.showTable}return H({getData:ee,generatePdf:M,generateCsv:A,generateImage:I,toggleTable:G}),(a,s)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(`vue-ui-chestnut ${V.value?"vue-data-ui-wrapper-fullscreen":""}`),ref_key:"chestnutChart",ref:D,id:`vue-ui-chestnut_${h.value}`,style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};width:100%; text-align:center;padding-top:36px;background:${t.value.style.chart.backgroundColor}`)},[t.value.userOptions.show&&C.value?(e.openBlock(),e.createBlock(U.UserOptions,{ref_key:"details",ref:K,key:`user_options_${L.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isImaging:e.unref(Q),isPrinting:e.unref(J),uid:h.value,hasPdf:t.value.userOptions.buttons.pdf,hasImg:t.value.userOptions.buttons.img,hasXls:t.value.userOptions.buttons.csv,hasTable:t.value.userOptions.buttons.table,hasFullscreen:t.value.userOptions.buttons.fullscreen,isFullscreen:V.value,titles:{...t.value.userOptions.buttonTitles},chartElement:D.value,onToggleFullscreen:ue,onGeneratePdf:e.unref(M),onGenerateCsv:A,onGenerateImage:e.unref(I),onToggleTable:G},e.createSlots({_:2},[a.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionPdf",{},void 0,!0)]),key:"0"}:void 0,a.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionCsv",{},void 0,!0)]),key:"1"}:void 0,a.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionImg",{},void 0,!0)]),key:"2"}:void 0,a.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionTable",{},void 0,!0)]),key:"3"}:void 0,a.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:l,isFullscreen:o})=>[e.renderSlot(a.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:l,isFullscreen:o})),void 0,!0)]),key:"4"}:void 0]),1032,["backgroundColor","color","isImaging","isPrinting","uid","hasPdf","hasImg","hasXls","hasTable","hasFullscreen","isFullscreen","titles","chartElement","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),r.value.height>0&&C.value?(e.openBlock(),e.createElementBlock("svg",{key:1,xmlns:e.unref(n.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":V.value,"vue-data-ui-fulscreen--off":!V.value}),viewBox:`0 0 ${r.value.width} ${r.value.height}`,style:e.normalizeStyle(`max-width:100%;overflow:visible;background:${t.value.style.chart.backgroundColor};color:${t.value.style.chart.color}`)},[c.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("g",pe,[t.value.style.chart.layout.title.text?(e.openBlock(),e.createElementBlock("text",{key:0,"text-anchor":"middle",fill:t.value.style.chart.layout.title.color,"font-weight":t.value.style.chart.layout.title.bold?"bold":"normal","font-size":t.value.style.chart.layout.title.fontSize,x:r.value.width/2,y:12+t.value.style.chart.layout.title.fontSize+t.value.style.chart.layout.title.offsetY,onClick:p},e.toDisplayString(t.value.style.chart.layout.title.text),9,fe)):e.createCommentVNode("",!0),t.value.style.chart.layout.title.subtitle.text?(e.openBlock(),e.createElementBlock("text",{key:1,"text-anchor":"middle",fill:t.value.style.chart.layout.title.subtitle.color,"font-weight":t.value.style.chart.layout.title.subtitle.bold?"bold":"normal","font-size":t.value.style.chart.layout.title.subtitle.fontSize,x:r.value.width/2,y:48+t.value.style.chart.layout.title.subtitle.fontSize+t.value.style.chart.layout.title.subtitle.offsetY,onClick:p},e.toDisplayString(t.value.style.chart.layout.title.subtitle.text),9,me)):e.createCommentVNode("",!0)])),e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,(l,o)=>(e.openBlock(),e.createElementBlock("radialGradient",{cx:"50%",cy:"50%",r:"50%",fx:"50%",fy:"50%",id:`root_gradient_${h.value}_${l.rootIndex}`},[e.createElementVNode("stop",{offset:"0%","stop-color":`${e.unref(n.shiftHue)(l.color,.05)}${e.unref(n.opacity)[100-t.value.style.chart.layout.roots.gradientIntensity]}`},null,8,be),e.createElementVNode("stop",{offset:"100%","stop-color":l.color},null,8,ke)],8,ge))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,l=>(e.openBlock(),e.createElementBlock("linearGradient",{x1:"0%",y1:"0%",x2:"100%",y2:"0%",id:`branch_gradient_${h.value}_${l.rootIndex}`},[e.createElementVNode("stop",{offset:"0%","stop-color":l.color},null,8,_e),e.createElementVNode("stop",{offset:"100%","stop-color":`${e.unref(n.shiftHue)(l.color,.02)}${e.unref(n.opacity)[100-t.value.style.chart.layout.branches.gradientIntensity]}`},null,8,Be)],8,xe))),256)),e.createElementVNode("radialGradient",{cx:"50%",cy:"50%",r:"50%",fx:"50%",fy:"50%",id:`nutpick_${h.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":`#FFFFFF${e.unref(n.opacity)[0]}`},null,8,Se),e.createElementVNode("stop",{offset:"80%","stop-color":`#FFFFFF${e.unref(n.opacity)[t.value.style.chart.layout.nuts.selected.gradientIntensity]}`},null,8,Ne),e.createElementVNode("stop",{offset:"100%","stop-color":`#FFFFFF${e.unref(n.opacity)[0]}`},null,8,ze)],8,Ee),e.createElementVNode("radialGradient",{cx:"50%",cy:"50%",r:"50%",fx:"50%",fy:"50%",id:`nut_${h.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":`#FFFFFF${e.unref(n.opacity)[0]}`},null,8,we),e.createElementVNode("stop",{offset:"80%","stop-color":`#FFFFFF${e.unref(n.opacity)[t.value.style.chart.layout.nuts.gradientIntensity]}`},null,8,Ve),e.createElementVNode("stop",{offset:"100%","stop-color":`#FFFFFF${e.unref(n.opacity)[0]}`},null,8,$e)],8,Ce),e.createElementVNode("radialGradient",{cx:"50%",cy:"50%",r:"50%",fx:"50%",fy:"50%",id:`nut_underlayer_${h.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":`${t.value.style.chart.backgroundColor}${e.unref(n.opacity)[100]}`},null,8,Fe),e.createElementVNode("stop",{offset:"80%","stop-color":`${t.value.style.chart.backgroundColor}${e.unref(n.opacity)[60]}`},null,8,De),e.createElementVNode("stop",{offset:"100%","stop-color":`${t.value.style.chart.backgroundColor}${e.unref(n.opacity)[0]}`},null,8,Le)],8,Te)]),t.value.style.chart.layout.grandTotal.show?(e.openBlock(),e.createElementBlock("g",Me,[e.createElementVNode("text",{x:f.value.seedX,y:32+t.value.style.chart.layout.grandTotal.offsetY,"font-size":t.value.style.chart.layout.grandTotal.fontSize,"font-weight":t.value.style.chart.layout.grandTotal.bold?"bold":"normal",fill:t.value.style.chart.layout.grandTotal.color,"text-anchor":"middle",onClick:p},e.toDisplayString(t.value.style.chart.layout.grandTotal.text),9,Ie),e.createElementVNode("text",{x:f.value.seedX,y:38+t.value.style.chart.layout.grandTotal.fontSize+t.value.style.chart.layout.grandTotal.offsetY,"font-size":t.value.style.chart.layout.grandTotal.fontSize,"font-weight":t.value.style.chart.layout.grandTotal.bold?"bold":"normal",fill:t.value.style.chart.layout.grandTotal.color,"text-anchor":"middle",onClick:p},e.toDisplayString(t.value.style.chart.layout.grandTotal.prefix)+" "+e.toDisplayString(x.value.toFixed(t.value.style.chart.layout.grandTotal.roundingValue))+" "+e.toDisplayString(t.value.style.chart.layout.grandTotal.suffix),9,Pe)])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_.value,l=>(e.openBlock(),e.createElementBlock("g",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value.branchSize,(o,d)=>(e.openBlock(),e.createElementBlock("path",{d:`M
2
2
  ${l.x1},${l.y1+d}
3
3
  C${l.x1-20},${l.y1+d}
4
4
  ${l.x1-80},${l.y1+d}
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("vue"),_=require("./useNestedProp-C_EQ-Kxy.cjs"),i=require("./index-Xau3hcRk.cjs"),C=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),m=l=>(t.pushScopeId("data-v-fe8d65eb"),l=l(),t.popScopeId(),l),p=["xmlns","height","width"],x={id:"follower",fy:"30%",fx:"30%"},E=["stop-color","stop-opacity"],N=m(()=>t.createElementVNode("stop",{offset:"95%","stop-color":"transparent"},null,-1)),g=["r","fill","stroke","stroke-width","stroke-dasharray"],V=["r","fill"],S={key:2,class:"wave"},w=["id"],b=["id"],B=m(()=>t.createElementVNode("feColorMatrix",{type:"saturate",values:"0"},null,-1)),R=["filter","stroke"],F={key:3,class:"crosshair"},z=["x1","stroke","stroke-width","stroke-dasharray"],I=["x1","stroke","stroke-width","stroke-dasharray"],L=["y1","stroke","stroke-width","stroke-dasharray"],O=["y1","stroke","stroke-width","stroke-dasharray"],T=["cy","r","fill"],D=["cy","r","fill"],$=["cx","r","fill"],W=["cx","r","fill"],G={key:5,class:"coordinates"},P=["x","y","font-size","fill"],q=["transform"],A=["font-size","fill"],M={__name:"vue-ui-cursor",props:{config:{type:Object,default:{}}},setup(l){const k=l,{vue_ui_cursor:y}=i.useConfig(),c=t.ref(i.createUid()),e=t.computed(()=>_.useNestedProp({userConfig:k.config,defaultConfig:y})),o=t.ref({x:-100,y:-100});function u({clientX:r,clientY:h,...j}){o.value.x=r-e.value.centerCircleRadius,o.value.y=h-e.value.centerCircleRadius}function d(r){o.value.x=r.targetTouches[0].clientX-e.value.centerCircleRadius,o.value.y=r.targetTouches[0].clientY-e.value.centerCircleRadius}const v=t.ref(!0);function a(r){v.value=r}const s=t.ref(!1),n=t.ref(null);function f(){s.value=!1,n.value&&clearTimeout(n.value),t.nextTick(()=>{s.value=!0,n.value=setTimeout(()=>{s.value=!1},1e3)})}return t.onMounted(()=>{const r=e.value.parentId?document.getElementById(e.value.parentId):document.getElementsByTagName("div")[0];r.addEventListener("mousemove",u),r.addEventListener("touchmove",d),r.addEventListener("mouseleave",()=>a(!1)),r.addEventListener("mouseenter",()=>a(!0)),r.addEventListener("click",f)}),t.onBeforeUnmount(()=>{const r=e.value.parentId?document.getElementById(e.value.parentId):document.getElementsByTagName("div")[0];r.removeEventListener("mousemove",u),r.removeEventListener("touchmove",d),r.removeEventListener("mouseleave",()=>a(!1)),r.removeEventListener("mouseenter",()=>a(!0)),r.removeEventListener("click",f)}),t.computed(()=>e.value.centerCircleRadius/2.5),(r,h)=>v.value?(t.openBlock(),t.createElementBlock("svg",{key:0,"data-html2canvas-ignore":"",xmlns:t.unref(i.XMLNS),style:t.normalizeStyle(`z-index: 2147483647; overflow: visible; pointer-events: none;background: transparent; position:fixed; top:${o.value.y}px; left:${o.value.x}px;`),viewBox:"0 0 100 100",height:e.value.centerCircleRadius*2,width:e.value.centerCircleRadius*2},[t.createElementVNode("defs",null,[t.createElementVNode("radialGradient",x,[t.createElementVNode("stop",{offset:"10%","stop-color":e.value.bubbleEffectColor,"stop-opacity":e.value.bubbleEffectOpacity},null,8,E),N])]),e.value.showCenterCircle?(t.openBlock(),t.createElementBlock("circle",{key:0,cx:50,cy:50,r:e.value.centerCircleRadius,fill:e.value.centerCircleColor+t.unref(i.opacity)[e.value.centerCircleOpacity*100],stroke:e.value.centerCircleStroke,"stroke-width":e.value.centerCircleStrokeWidth,"stroke-dasharray":e.value.centerCircleDasharray},null,8,g)):t.createCommentVNode("",!0),e.value.bubbleEffect?(t.openBlock(),t.createElementBlock("circle",{key:1,cx:50,cy:50,r:e.value.centerCircleRadius,fill:"url(#follower)",stroke:"none"},null,8,V)):t.createCommentVNode("",!0),e.value.useWaveOnClick?(t.openBlock(),t.createElementBlock("g",S,[t.createElementVNode("defs",null,[t.createElementVNode("filter",{id:`blur_${c.value}`,x:"-50%",y:"-50%",width:"200%",height:"200%"},[t.createElementVNode("feGaussianBlur",{in:"SourceGraphic",stdDeviation:4,id:`blur_std_${c.value}`},null,8,b),B],8,w)]),s.value?(t.openBlock(),t.createElementBlock("circle",{key:0,class:t.normalizeClass({"circle-wave":s.value}),cx:50,cy:50,r:50,filter:`url(#blur_${c.value})`,stroke:e.value.centerCircleStroke,fill:"none","stroke-width":"3"},null,10,R)):t.createCommentVNode("",!0)])):t.createCommentVNode("",!0),e.value.showCrosshair?(t.openBlock(),t.createElementBlock("g",F,[t.createElementVNode("line",{x1:-e.value.centerCircleRadius+50,x2:-5e3,y1:50,y2:50,stroke:e.value.crosshairStroke,"stroke-width":e.value.crosshairStrokeWidth,"stroke-dasharray":e.value.crosshairDasharray,"stroke-linecap":"round"},null,8,z),t.createElementVNode("line",{x1:50+e.value.centerCircleRadius,x2:5e3,y1:50,y2:50,stroke:e.value.crosshairStroke,"stroke-width":e.value.crosshairStrokeWidth,"stroke-dasharray":e.value.crosshairDasharray,"stroke-linecap":"round"},null,8,I),t.createElementVNode("line",{x1:50,x2:50,y1:-e.value.centerCircleRadius+50,y2:-5e3,stroke:e.value.crosshairStroke,"stroke-width":e.value.crosshairStrokeWidth,"stroke-dasharray":e.value.crosshairDasharray,"stroke-linecap":"round"},null,8,L),t.createElementVNode("line",{x1:50,x2:50,y1:e.value.centerCircleRadius+50,y2:5e3,stroke:e.value.crosshairStroke,"stroke-width":e.value.crosshairStrokeWidth,"stroke-dasharray":e.value.crosshairDasharray,"stroke-linecap":"round"},null,8,O)])):t.createCommentVNode("",!0),e.value.showIntersectCircles?(t.openBlock(),t.createElementBlock("g",{key:4,class:t.normalizeClass({"rotating-circles":e.value.isLoading})},[t.createElementVNode("circle",{cx:50,cy:e.value.centerCircleRadius+50,r:e.value.intersectCirclesRadius,fill:e.value.intersectCirclesFill},null,8,T),t.createElementVNode("circle",{cx:50,cy:-e.value.centerCircleRadius+50,r:e.value.intersectCirclesRadius,fill:e.value.intersectCirclesFill},null,8,D),t.createElementVNode("circle",{cx:-e.value.centerCircleRadius+50,cy:50,r:e.value.intersectCirclesRadius,fill:e.value.intersectCirclesFill},null,8,$),t.createElementVNode("circle",{cx:e.value.centerCircleRadius+50,cy:50,r:e.value.intersectCirclesRadius,fill:e.value.intersectCirclesFill},null,8,W)],2)):t.createCommentVNode("",!0),e.value.showCoordinates?(t.openBlock(),t.createElementBlock("g",G,[t.createElementVNode("text",{"text-anchor":"end",x:-e.value.centerCircleRadius+50-e.value.coordinatesFontSize/2+e.value.coordinatesOffset,y:50-e.value.coordinatesFontSize/2+e.value.coordinatesOffset,"font-size":e.value.coordinatesFontSize,fill:e.value.coordinatesColor,style:{"font-variant-numeric":"tabular-nums"},"font-family":"Arial"},t.toDisplayString(o.value.x.toFixed(0)),9,P),t.createElementVNode("g",{transform:`translate(${50-e.value.coordinatesFontSize/2+e.value.coordinatesOffset}, ${-e.value.centerCircleRadius+50-e.value.coordinatesFontSize/2+e.value.coordinatesOffset})`},[t.createElementVNode("text",{"text-anchor":"start","font-size":e.value.coordinatesFontSize,fill:e.value.coordinatesColor,style:{"font-variant-numeric":"tabular-nums"},transform:"rotate(-90)","font-family":"Arial"},t.toDisplayString(o.value.y.toFixed(0)),9,A)],8,q)])):t.createCommentVNode("",!0)],12,p)):t.createCommentVNode("",!0)}},U=C._export_sfc(M,[["__scopeId","data-v-fe8d65eb"]]);exports.default=U;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("vue"),_=require("./useNestedProp-Dikfncsl.cjs"),i=require("./index-BDKEFvEF.cjs"),C=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),m=l=>(t.pushScopeId("data-v-fe8d65eb"),l=l(),t.popScopeId(),l),p=["xmlns","height","width"],x={id:"follower",fy:"30%",fx:"30%"},E=["stop-color","stop-opacity"],N=m(()=>t.createElementVNode("stop",{offset:"95%","stop-color":"transparent"},null,-1)),g=["r","fill","stroke","stroke-width","stroke-dasharray"],V=["r","fill"],S={key:2,class:"wave"},w=["id"],b=["id"],B=m(()=>t.createElementVNode("feColorMatrix",{type:"saturate",values:"0"},null,-1)),R=["filter","stroke"],F={key:3,class:"crosshair"},z=["x1","stroke","stroke-width","stroke-dasharray"],I=["x1","stroke","stroke-width","stroke-dasharray"],L=["y1","stroke","stroke-width","stroke-dasharray"],O=["y1","stroke","stroke-width","stroke-dasharray"],T=["cy","r","fill"],D=["cy","r","fill"],$=["cx","r","fill"],W=["cx","r","fill"],G={key:5,class:"coordinates"},P=["x","y","font-size","fill"],q=["transform"],A=["font-size","fill"],M={__name:"vue-ui-cursor",props:{config:{type:Object,default:{}}},setup(l){const k=l,{vue_ui_cursor:y}=i.useConfig(),c=t.ref(i.createUid()),e=t.computed(()=>_.useNestedProp({userConfig:k.config,defaultConfig:y})),o=t.ref({x:-100,y:-100});function u({clientX:r,clientY:h,...j}){o.value.x=r-e.value.centerCircleRadius,o.value.y=h-e.value.centerCircleRadius}function d(r){o.value.x=r.targetTouches[0].clientX-e.value.centerCircleRadius,o.value.y=r.targetTouches[0].clientY-e.value.centerCircleRadius}const v=t.ref(!0);function a(r){v.value=r}const s=t.ref(!1),n=t.ref(null);function f(){s.value=!1,n.value&&clearTimeout(n.value),t.nextTick(()=>{s.value=!0,n.value=setTimeout(()=>{s.value=!1},1e3)})}return t.onMounted(()=>{const r=e.value.parentId?document.getElementById(e.value.parentId):document.getElementsByTagName("div")[0];r.addEventListener("mousemove",u),r.addEventListener("touchmove",d),r.addEventListener("mouseleave",()=>a(!1)),r.addEventListener("mouseenter",()=>a(!0)),r.addEventListener("click",f)}),t.onBeforeUnmount(()=>{const r=e.value.parentId?document.getElementById(e.value.parentId):document.getElementsByTagName("div")[0];r.removeEventListener("mousemove",u),r.removeEventListener("touchmove",d),r.removeEventListener("mouseleave",()=>a(!1)),r.removeEventListener("mouseenter",()=>a(!0)),r.removeEventListener("click",f)}),t.computed(()=>e.value.centerCircleRadius/2.5),(r,h)=>v.value?(t.openBlock(),t.createElementBlock("svg",{key:0,"data-html2canvas-ignore":"",xmlns:t.unref(i.XMLNS),style:t.normalizeStyle(`z-index: 2147483647; overflow: visible; pointer-events: none;background: transparent; position:fixed; top:${o.value.y}px; left:${o.value.x}px;`),viewBox:"0 0 100 100",height:e.value.centerCircleRadius*2,width:e.value.centerCircleRadius*2},[t.createElementVNode("defs",null,[t.createElementVNode("radialGradient",x,[t.createElementVNode("stop",{offset:"10%","stop-color":e.value.bubbleEffectColor,"stop-opacity":e.value.bubbleEffectOpacity},null,8,E),N])]),e.value.showCenterCircle?(t.openBlock(),t.createElementBlock("circle",{key:0,cx:50,cy:50,r:e.value.centerCircleRadius,fill:e.value.centerCircleColor+t.unref(i.opacity)[e.value.centerCircleOpacity*100],stroke:e.value.centerCircleStroke,"stroke-width":e.value.centerCircleStrokeWidth,"stroke-dasharray":e.value.centerCircleDasharray},null,8,g)):t.createCommentVNode("",!0),e.value.bubbleEffect?(t.openBlock(),t.createElementBlock("circle",{key:1,cx:50,cy:50,r:e.value.centerCircleRadius,fill:"url(#follower)",stroke:"none"},null,8,V)):t.createCommentVNode("",!0),e.value.useWaveOnClick?(t.openBlock(),t.createElementBlock("g",S,[t.createElementVNode("defs",null,[t.createElementVNode("filter",{id:`blur_${c.value}`,x:"-50%",y:"-50%",width:"200%",height:"200%"},[t.createElementVNode("feGaussianBlur",{in:"SourceGraphic",stdDeviation:4,id:`blur_std_${c.value}`},null,8,b),B],8,w)]),s.value?(t.openBlock(),t.createElementBlock("circle",{key:0,class:t.normalizeClass({"circle-wave":s.value}),cx:50,cy:50,r:50,filter:`url(#blur_${c.value})`,stroke:e.value.centerCircleStroke,fill:"none","stroke-width":"3"},null,10,R)):t.createCommentVNode("",!0)])):t.createCommentVNode("",!0),e.value.showCrosshair?(t.openBlock(),t.createElementBlock("g",F,[t.createElementVNode("line",{x1:-e.value.centerCircleRadius+50,x2:-5e3,y1:50,y2:50,stroke:e.value.crosshairStroke,"stroke-width":e.value.crosshairStrokeWidth,"stroke-dasharray":e.value.crosshairDasharray,"stroke-linecap":"round"},null,8,z),t.createElementVNode("line",{x1:50+e.value.centerCircleRadius,x2:5e3,y1:50,y2:50,stroke:e.value.crosshairStroke,"stroke-width":e.value.crosshairStrokeWidth,"stroke-dasharray":e.value.crosshairDasharray,"stroke-linecap":"round"},null,8,I),t.createElementVNode("line",{x1:50,x2:50,y1:-e.value.centerCircleRadius+50,y2:-5e3,stroke:e.value.crosshairStroke,"stroke-width":e.value.crosshairStrokeWidth,"stroke-dasharray":e.value.crosshairDasharray,"stroke-linecap":"round"},null,8,L),t.createElementVNode("line",{x1:50,x2:50,y1:e.value.centerCircleRadius+50,y2:5e3,stroke:e.value.crosshairStroke,"stroke-width":e.value.crosshairStrokeWidth,"stroke-dasharray":e.value.crosshairDasharray,"stroke-linecap":"round"},null,8,O)])):t.createCommentVNode("",!0),e.value.showIntersectCircles?(t.openBlock(),t.createElementBlock("g",{key:4,class:t.normalizeClass({"rotating-circles":e.value.isLoading})},[t.createElementVNode("circle",{cx:50,cy:e.value.centerCircleRadius+50,r:e.value.intersectCirclesRadius,fill:e.value.intersectCirclesFill},null,8,T),t.createElementVNode("circle",{cx:50,cy:-e.value.centerCircleRadius+50,r:e.value.intersectCirclesRadius,fill:e.value.intersectCirclesFill},null,8,D),t.createElementVNode("circle",{cx:-e.value.centerCircleRadius+50,cy:50,r:e.value.intersectCirclesRadius,fill:e.value.intersectCirclesFill},null,8,$),t.createElementVNode("circle",{cx:e.value.centerCircleRadius+50,cy:50,r:e.value.intersectCirclesRadius,fill:e.value.intersectCirclesFill},null,8,W)],2)):t.createCommentVNode("",!0),e.value.showCoordinates?(t.openBlock(),t.createElementBlock("g",G,[t.createElementVNode("text",{"text-anchor":"end",x:-e.value.centerCircleRadius+50-e.value.coordinatesFontSize/2+e.value.coordinatesOffset,y:50-e.value.coordinatesFontSize/2+e.value.coordinatesOffset,"font-size":e.value.coordinatesFontSize,fill:e.value.coordinatesColor,style:{"font-variant-numeric":"tabular-nums"},"font-family":"Arial"},t.toDisplayString(o.value.x.toFixed(0)),9,P),t.createElementVNode("g",{transform:`translate(${50-e.value.coordinatesFontSize/2+e.value.coordinatesOffset}, ${-e.value.centerCircleRadius+50-e.value.coordinatesFontSize/2+e.value.coordinatesOffset})`},[t.createElementVNode("text",{"text-anchor":"start","font-size":e.value.coordinatesFontSize,fill:e.value.coordinatesColor,style:{"font-variant-numeric":"tabular-nums"},transform:"rotate(-90)","font-family":"Arial"},t.toDisplayString(o.value.y.toFixed(0)),9,A)],8,q)])):t.createCommentVNode("",!0)],12,p)):t.createCommentVNode("",!0)}},U=C._export_sfc(M,[["__scopeId","data-v-fe8d65eb"]]);exports.default=U;
@@ -1,6 +1,6 @@
1
1
  import { ref as n, computed as m, onMounted as R, onBeforeUnmount as b, openBlock as o, createElementBlock as l, unref as C, normalizeStyle as E, createElementVNode as r, createCommentVNode as i, normalizeClass as p, toDisplayString as x, nextTick as F, pushScopeId as I, popScopeId as L } from "vue";
2
- import { u as z } from "./useNestedProp-hi25rRoY.js";
3
- import { u as O, c as B, X as N, r as T } from "./index-BK818aZo.js";
2
+ import { u as z } from "./useNestedProp-Da77DnaA.js";
3
+ import { u as O, c as B, X as N, r as T } from "./index-ByO3Ywek.js";
4
4
  import { _ as D } from "./_plugin-vue_export-helper-CHgC5LLL.js";
5
5
  const g = (a) => (I("data-v-fe8d65eb"), a = a(), L(), a), $ = ["xmlns", "height", "width"], W = {
6
6
  id: "follower",
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("vue"),R=require("./pdf-Cz3729tZ.cjs"),q=require("./useNestedProp-C_EQ-Kxy.cjs"),O=require("./index-Xau3hcRk.cjs"),j=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),A=b=>(o.pushScopeId("data-v-57895b3a"),b=b(),o.popScopeId(),b),G={key:0,"data-html2canvas-ignore":"",style:{width:"100%",display:"flex","justify-content":"end"}},U=["disabled"],J=["stroke"],K=o.createStaticVNode('<path stroke="none" d="M0 0h24v24H0z" fill="none" data-v-57895b3a></path><path d="M18 16v.01" data-v-57895b3a></path><path d="M6 16v.01" data-v-57895b3a></path><path d="M12 5v.01" data-v-57895b3a></path><path d="M12 12v.01" data-v-57895b3a></path><path d="M12 1a4 4 0 0 1 2.001 7.464l.001 .072a3.998 3.998 0 0 1 1.987 3.758l.22 .128a3.978 3.978 0 0 1 1.591 -.417l.2 -.005a4 4 0 1 1 -3.994 3.77l-.28 -.16c-.522 .25 -1.108 .39 -1.726 .39c-.619 0 -1.205 -.14 -1.728 -.391l-.279 .16l.007 .231a4 4 0 1 1 -2.212 -3.579l.222 -.129a3.998 3.998 0 0 1 1.988 -3.756l.002 -.071a4 4 0 0 1 -1.995 -3.265l-.005 -.2a4 4 0 0 1 4 -4z" data-v-57895b3a></path>',6),Q=[K],Z={key:1},ee=["id"],te=A(()=>o.createElementVNode("div",{class:"vue-ui-dashboard-grid"},null,-1)),oe=["onMousedown","onTouchstart"],le=["onMousedown","onTouchstart"],ae=["onMousedown","onTouchstart"],ne=["onMousedown","onTouchstart"],ue=["onMousedown","onTouchstart"],M=20,se={__name:"vue-ui-dashboard",props:{dataset:Array,config:Object},emits:["change"],setup(b,{expose:$,emit:B}){const T=b;o.useCssVars(e=>({"417957d3":I.value,"60fae9e7":D.value}));const{vue_ui_dashboard:N}=O.useConfig(),i=o.computed(()=>q.useNestedProp({userConfig:T.config,defaultConfig:N})),z=o.ref(`vue-ui-dashboard-${Math.random()}`),d=o.ref(i.value.locked);function S(){d.value=!d.value}const s=o.ref(T.dataset),h=o.ref(null),u=o.ref(null),v=o.ref({x:0,y:0}),f=o.ref({x:0,y:0}),r=o.ref(null),c=o.ref(!1),p=o.ref(null),y=o.ref(!1);function E(){y.value=!0,R.pdf({domElement:document.getElementById(`vue-ui-dashboard_${z.value}`),fileName:"vue-ui-dashboard"}).finally(()=>{y.value=!1})}function x(e){if(!d.value&&(c.value=!0,p.value=e,u.value===null)){h.value=e,v.value={x:event.clientX,y:event.clientY};const t=s.value[e],a=100-t.width,l=100-t.height;t.left<0&&(t.left=0),t.top<0&&(t.top=0),t.left>a&&(t.left=a),t.top>l&&(t.top=l),t.left<0&&(t.left=0),t.top<0&&(t.top=0),t.left+t.width>100&&(t.left=100-t.width),t.top+t.height>100&&(t.top=100-t.height)}}function m(e,t){c.value=!0,p.value=e,u.value={index:e,direction:t};const a=s.value[e];f.value={x:event.clientX,y:event.clientY,initialWidth:a.width,initialHeight:a.height}}function C(e,t,a){if(u.value.direction.includes("top")){const l=e.height-a/r.value.offsetHeight*100;l>=M&&(e.top+=a/r.value.offsetHeight*100,e.height=l)}if(u.value.direction.includes("bottom")){const l=e.height+a/r.value.offsetHeight*100;l>=M&&(e.height=l)}if(u.value.direction.includes("left")){const l=e.width-t/r.value.offsetWidth*100;l>=M&&(e.left+=t/r.value.offsetWidth*100,e.width=l)}if(u.value.direction.includes("right")){const l=e.width+t/r.value.offsetWidth*100;l>=M&&(e.width=l)}}function X(e){if(!d.value){if(c.value=!0,h.value!==null){const t=s.value[h.value],a=e.clientX-v.value.x,l=e.clientY-v.value.y,n=t.left+a/r.value.offsetWidth*100,g=t.top+l/r.value.offsetHeight*100;n>=0&&g>=0&&n+t.width<=100&&g+t.height<=100&&(t.left=n,t.top=g),v.value={x:e.clientX,y:e.clientY}}if(u.value!==null){const t=s.value[u.value.index],a=e.clientX-f.value.x,l=e.clientY-f.value.y;C(t,a,l),f.value={x:e.clientX,y:e.clientY}}}}o.watch(s,e=>{e&&!c.value&&B("change",s.value)},{deep:!0});function Y(){h.value=null,u.value=null,c.value=!1,p.value=null,s.value.forEach(e=>{e.left=Math.round(e.left/100*100),e.top=Math.round(e.top/100*100),e.width=Math.round(e.width/100*100),e.height=Math.round(e.height/100*100)})}function V(e){d.value||(c.value=!0,p.value=e,u.value===null&&(h.value=e,v.value={x:event.touches[0].clientX,y:event.touches[0].clientY}))}function k(e,t,a){if(c.value=!0,p.value=e,u.value===null){u.value={index:e,direction:t};const l=s.value[e];f.value={x:a.touches[0].clientX,y:a.touches[0].clientY,initialWidth:l.width,initialHeight:l.height}}}function _(e){if(c.value=!0,e.preventDefault(),u.value!==null){const t=s.value[u.value.index],a=e.touches[0].clientX-f.value.x,l=e.touches[0].clientY-f.value.y;C(t,a,l),f.value={x:e.touches[0].clientX,y:e.touches[0].clientY}}}function H(e){if(!d.value&&(c.value=!0,e.preventDefault(),h.value!==null)){const t=s.value[h.value],a=e.touches[0].clientX-v.value.x,l=e.touches[0].clientY-v.value.y,n=t.left+a/r.value.offsetWidth*100,g=t.top+l/r.value.offsetHeight*100;n>=0&&g>=0&&n+t.width<=100&&g+t.height<=100&&(t.left=n,t.top=g),v.value={x:e.touches[0].clientX,y:e.touches[0].clientY}}}function w(){c.value=!1,p.value=null,h.value=null,u.value=null,s.value.forEach(e=>{e.left=Math.round(e.left/100*100),e.top=Math.round(e.top/100*100),e.width=Math.round(e.width/100*100),e.height=Math.round(e.height/100*100)})}const I=o.computed(()=>i.value.style.item.borderColor),D=o.computed(()=>i.value.style.resizeHandles.backgroundColor),W=o.computed(()=>i.value.style.board.aspectRatio),L=o.computed(()=>i.value.style.board.backgroundColor),P=o.computed(()=>i.value.style.board.border);function F(){return s.value}return $({generatePdf:E,getItemsPositions:F,toggleLock:S}),(e,t)=>(o.openBlock(),o.createElementBlock("div",null,[i.value.allowPrint?(o.openBlock(),o.createElementBlock("div",G,[o.createElementVNode("button",{class:"vue-ui-dashboard-button",onClick:E,disabled:y.value,style:o.normalizeStyle([{"margin-top":"12px"},`color:${i.value.style.board.color}`])},[y.value?(o.openBlock(),o.createElementBlock("svg",{key:0,class:"vue-ui-dashboard-print-icon",xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:i.value.style.board.color,fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},Q,8,J)):(o.openBlock(),o.createElementBlock("span",Z,"PDF"))],12,U)])):o.createCommentVNode("",!0),o.createElementVNode("div",{class:"vue-ui-dashboard-container",ref_key:"dashboardContainer",ref:r,id:`vue-ui-dashboard_${z.value}`,style:o.normalizeStyle(`border:${P.value}; sbackground:${L.value}; aspect-ratio:${W.value}`)},[o.createElementVNode("div",{class:"vue-ui-dashboard-grid-container",ref:"container",onMousemove:X,onMouseup:Y,onTouchmove:H,onTouchend:w,style:o.normalizeStyle(`background:${i.value.style.board.backgroundColor}`)},[te,(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(s.value,(a,l)=>(o.openBlock(),o.createElementBlock("div",{key:a.id,class:o.normalizeClass({"vue-ui-dashboard-grid-item":!0,"vue-ui-dashboard-grid-item--locked":d.value}),style:o.normalizeStyle({width:`${a.width}%`,height:`${a.height}%`,left:`${a.left}%`,top:`${a.top}%`,cursor:"move",boxShadow:p.value===l?"0 6px 12px -3px rgba(0,0,0,0.3)":"",zIndex:p.value===l?"1":"0",backgroundColor:i.value.style.item.backgroundColor}),onMousedown:n=>x(l),onTouchstart:n=>V(l)},[d.value?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[o.createElementVNode("div",{class:"vue-ui-dashboard-resize-handle vue-ui-dashboard-top-left",onMousedown:n=>m(l,"top-left"),onTouchstart:n=>k(l,"top-left",n),onTouchmove:t[0]||(t[0]=n=>_(n)),onTouchend:w},null,40,le),o.createElementVNode("div",{class:"vue-ui-dashboard-resize-handle vue-ui-dashboard-top-right",onMousedown:n=>m(l,"top-right"),onTouchstart:n=>k(l,"top-right",n),onTouchmove:t[1]||(t[1]=n=>_(n)),onTouchend:w},null,40,ae),o.createElementVNode("div",{class:"vue-ui-dashboard-resize-handle vue-ui-dashboard-bottom-left",onMousedown:n=>m(l,"bottom-left"),onTouchstart:n=>k(l,"bottom-left",n),onTouchmove:t[2]||(t[2]=n=>_(n)),onTouchend:w},null,40,ne),o.createElementVNode("div",{class:"vue-ui-dashboard-resize-handle vue-ui-dashboard-bottom-right",onMousedown:n=>m(l,"bottom-right"),onTouchstart:n=>k(l,"bottom-right",n),onTouchmove:t[3]||(t[3]=n=>_(n)),onTouchend:w},null,40,ue)],64)),o.renderSlot(e.$slots,"content",{item:a,index:l,left:a.left,top:a.top,height:a.height,width:a.width},void 0,!0)],46,oe))),128))],36)],12,ee)]))}},ie=j._export_sfc(se,[["__scopeId","data-v-57895b3a"]]);exports.default=ie;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("vue"),R=require("./pdf-Cz3729tZ.cjs"),q=require("./useNestedProp-Dikfncsl.cjs"),O=require("./index-BDKEFvEF.cjs"),j=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),A=b=>(o.pushScopeId("data-v-57895b3a"),b=b(),o.popScopeId(),b),G={key:0,"data-html2canvas-ignore":"",style:{width:"100%",display:"flex","justify-content":"end"}},U=["disabled"],J=["stroke"],K=o.createStaticVNode('<path stroke="none" d="M0 0h24v24H0z" fill="none" data-v-57895b3a></path><path d="M18 16v.01" data-v-57895b3a></path><path d="M6 16v.01" data-v-57895b3a></path><path d="M12 5v.01" data-v-57895b3a></path><path d="M12 12v.01" data-v-57895b3a></path><path d="M12 1a4 4 0 0 1 2.001 7.464l.001 .072a3.998 3.998 0 0 1 1.987 3.758l.22 .128a3.978 3.978 0 0 1 1.591 -.417l.2 -.005a4 4 0 1 1 -3.994 3.77l-.28 -.16c-.522 .25 -1.108 .39 -1.726 .39c-.619 0 -1.205 -.14 -1.728 -.391l-.279 .16l.007 .231a4 4 0 1 1 -2.212 -3.579l.222 -.129a3.998 3.998 0 0 1 1.988 -3.756l.002 -.071a4 4 0 0 1 -1.995 -3.265l-.005 -.2a4 4 0 0 1 4 -4z" data-v-57895b3a></path>',6),Q=[K],Z={key:1},ee=["id"],te=A(()=>o.createElementVNode("div",{class:"vue-ui-dashboard-grid"},null,-1)),oe=["onMousedown","onTouchstart"],le=["onMousedown","onTouchstart"],ae=["onMousedown","onTouchstart"],ne=["onMousedown","onTouchstart"],ue=["onMousedown","onTouchstart"],M=20,se={__name:"vue-ui-dashboard",props:{dataset:Array,config:Object},emits:["change"],setup(b,{expose:$,emit:B}){const T=b;o.useCssVars(e=>({"417957d3":I.value,"60fae9e7":D.value}));const{vue_ui_dashboard:N}=O.useConfig(),i=o.computed(()=>q.useNestedProp({userConfig:T.config,defaultConfig:N})),z=o.ref(`vue-ui-dashboard-${Math.random()}`),d=o.ref(i.value.locked);function S(){d.value=!d.value}const s=o.ref(T.dataset),h=o.ref(null),u=o.ref(null),v=o.ref({x:0,y:0}),f=o.ref({x:0,y:0}),r=o.ref(null),c=o.ref(!1),p=o.ref(null),y=o.ref(!1);function E(){y.value=!0,R.pdf({domElement:document.getElementById(`vue-ui-dashboard_${z.value}`),fileName:"vue-ui-dashboard"}).finally(()=>{y.value=!1})}function x(e){if(!d.value&&(c.value=!0,p.value=e,u.value===null)){h.value=e,v.value={x:event.clientX,y:event.clientY};const t=s.value[e],a=100-t.width,l=100-t.height;t.left<0&&(t.left=0),t.top<0&&(t.top=0),t.left>a&&(t.left=a),t.top>l&&(t.top=l),t.left<0&&(t.left=0),t.top<0&&(t.top=0),t.left+t.width>100&&(t.left=100-t.width),t.top+t.height>100&&(t.top=100-t.height)}}function m(e,t){c.value=!0,p.value=e,u.value={index:e,direction:t};const a=s.value[e];f.value={x:event.clientX,y:event.clientY,initialWidth:a.width,initialHeight:a.height}}function C(e,t,a){if(u.value.direction.includes("top")){const l=e.height-a/r.value.offsetHeight*100;l>=M&&(e.top+=a/r.value.offsetHeight*100,e.height=l)}if(u.value.direction.includes("bottom")){const l=e.height+a/r.value.offsetHeight*100;l>=M&&(e.height=l)}if(u.value.direction.includes("left")){const l=e.width-t/r.value.offsetWidth*100;l>=M&&(e.left+=t/r.value.offsetWidth*100,e.width=l)}if(u.value.direction.includes("right")){const l=e.width+t/r.value.offsetWidth*100;l>=M&&(e.width=l)}}function X(e){if(!d.value){if(c.value=!0,h.value!==null){const t=s.value[h.value],a=e.clientX-v.value.x,l=e.clientY-v.value.y,n=t.left+a/r.value.offsetWidth*100,g=t.top+l/r.value.offsetHeight*100;n>=0&&g>=0&&n+t.width<=100&&g+t.height<=100&&(t.left=n,t.top=g),v.value={x:e.clientX,y:e.clientY}}if(u.value!==null){const t=s.value[u.value.index],a=e.clientX-f.value.x,l=e.clientY-f.value.y;C(t,a,l),f.value={x:e.clientX,y:e.clientY}}}}o.watch(s,e=>{e&&!c.value&&B("change",s.value)},{deep:!0});function Y(){h.value=null,u.value=null,c.value=!1,p.value=null,s.value.forEach(e=>{e.left=Math.round(e.left/100*100),e.top=Math.round(e.top/100*100),e.width=Math.round(e.width/100*100),e.height=Math.round(e.height/100*100)})}function V(e){d.value||(c.value=!0,p.value=e,u.value===null&&(h.value=e,v.value={x:event.touches[0].clientX,y:event.touches[0].clientY}))}function k(e,t,a){if(c.value=!0,p.value=e,u.value===null){u.value={index:e,direction:t};const l=s.value[e];f.value={x:a.touches[0].clientX,y:a.touches[0].clientY,initialWidth:l.width,initialHeight:l.height}}}function _(e){if(c.value=!0,e.preventDefault(),u.value!==null){const t=s.value[u.value.index],a=e.touches[0].clientX-f.value.x,l=e.touches[0].clientY-f.value.y;C(t,a,l),f.value={x:e.touches[0].clientX,y:e.touches[0].clientY}}}function H(e){if(!d.value&&(c.value=!0,e.preventDefault(),h.value!==null)){const t=s.value[h.value],a=e.touches[0].clientX-v.value.x,l=e.touches[0].clientY-v.value.y,n=t.left+a/r.value.offsetWidth*100,g=t.top+l/r.value.offsetHeight*100;n>=0&&g>=0&&n+t.width<=100&&g+t.height<=100&&(t.left=n,t.top=g),v.value={x:e.touches[0].clientX,y:e.touches[0].clientY}}}function w(){c.value=!1,p.value=null,h.value=null,u.value=null,s.value.forEach(e=>{e.left=Math.round(e.left/100*100),e.top=Math.round(e.top/100*100),e.width=Math.round(e.width/100*100),e.height=Math.round(e.height/100*100)})}const I=o.computed(()=>i.value.style.item.borderColor),D=o.computed(()=>i.value.style.resizeHandles.backgroundColor),W=o.computed(()=>i.value.style.board.aspectRatio),L=o.computed(()=>i.value.style.board.backgroundColor),P=o.computed(()=>i.value.style.board.border);function F(){return s.value}return $({generatePdf:E,getItemsPositions:F,toggleLock:S}),(e,t)=>(o.openBlock(),o.createElementBlock("div",null,[i.value.allowPrint?(o.openBlock(),o.createElementBlock("div",G,[o.createElementVNode("button",{class:"vue-ui-dashboard-button",onClick:E,disabled:y.value,style:o.normalizeStyle([{"margin-top":"12px"},`color:${i.value.style.board.color}`])},[y.value?(o.openBlock(),o.createElementBlock("svg",{key:0,class:"vue-ui-dashboard-print-icon",xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:i.value.style.board.color,fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},Q,8,J)):(o.openBlock(),o.createElementBlock("span",Z,"PDF"))],12,U)])):o.createCommentVNode("",!0),o.createElementVNode("div",{class:"vue-ui-dashboard-container",ref_key:"dashboardContainer",ref:r,id:`vue-ui-dashboard_${z.value}`,style:o.normalizeStyle(`border:${P.value}; sbackground:${L.value}; aspect-ratio:${W.value}`)},[o.createElementVNode("div",{class:"vue-ui-dashboard-grid-container",ref:"container",onMousemove:X,onMouseup:Y,onTouchmove:H,onTouchend:w,style:o.normalizeStyle(`background:${i.value.style.board.backgroundColor}`)},[te,(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(s.value,(a,l)=>(o.openBlock(),o.createElementBlock("div",{key:a.id,class:o.normalizeClass({"vue-ui-dashboard-grid-item":!0,"vue-ui-dashboard-grid-item--locked":d.value}),style:o.normalizeStyle({width:`${a.width}%`,height:`${a.height}%`,left:`${a.left}%`,top:`${a.top}%`,cursor:"move",boxShadow:p.value===l?"0 6px 12px -3px rgba(0,0,0,0.3)":"",zIndex:p.value===l?"1":"0",backgroundColor:i.value.style.item.backgroundColor}),onMousedown:n=>x(l),onTouchstart:n=>V(l)},[d.value?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[o.createElementVNode("div",{class:"vue-ui-dashboard-resize-handle vue-ui-dashboard-top-left",onMousedown:n=>m(l,"top-left"),onTouchstart:n=>k(l,"top-left",n),onTouchmove:t[0]||(t[0]=n=>_(n)),onTouchend:w},null,40,le),o.createElementVNode("div",{class:"vue-ui-dashboard-resize-handle vue-ui-dashboard-top-right",onMousedown:n=>m(l,"top-right"),onTouchstart:n=>k(l,"top-right",n),onTouchmove:t[1]||(t[1]=n=>_(n)),onTouchend:w},null,40,ae),o.createElementVNode("div",{class:"vue-ui-dashboard-resize-handle vue-ui-dashboard-bottom-left",onMousedown:n=>m(l,"bottom-left"),onTouchstart:n=>k(l,"bottom-left",n),onTouchmove:t[2]||(t[2]=n=>_(n)),onTouchend:w},null,40,ne),o.createElementVNode("div",{class:"vue-ui-dashboard-resize-handle vue-ui-dashboard-bottom-right",onMousedown:n=>m(l,"bottom-right"),onTouchstart:n=>k(l,"bottom-right",n),onTouchmove:t[3]||(t[3]=n=>_(n)),onTouchend:w},null,40,ue)],64)),o.renderSlot(e.$slots,"content",{item:a,index:l,left:a.left,top:a.top,height:a.height,width:a.width},void 0,!0)],46,oe))),128))],36)],12,ee)]))}},ie=j._export_sfc(se,[["__scopeId","data-v-57895b3a"]]);exports.default=ie;