vue-data-ui 2.3.38 → 2.3.39
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.
- package/dist/{Arrow-C3soCsF0.js → Arrow-B0RusPlY.js} +1 -1
- package/dist/{Arrow-vS43S38d.cjs → Arrow-gLWBasXL.cjs} +1 -1
- package/dist/{BaseIcon-BoEJRb0e.cjs → BaseIcon-Cfy7hUAu.cjs} +1 -1
- package/dist/{BaseIcon-B8hVR5-4.js → BaseIcon-E5xGjSQn.js} +1 -1
- package/dist/{DataTable-DKkvLXwD.js → DataTable-CcVgHrwx.js} +2 -2
- package/dist/{DataTable-BrnFSdXo.cjs → DataTable-D7JJfjpO.cjs} +1 -1
- package/dist/{Legend-D7zc_ula.cjs → Legend-BDgAlEzL.cjs} +1 -1
- package/dist/{Legend-DpiZXeY0.js → Legend-BPGeRVxf.js} +1 -1
- package/dist/{Shape-CWtwGdQ_.cjs → Shape-DDEKu71I.cjs} +1 -1
- package/dist/{Shape-BpneoNiL.js → Shape-DnfO-k8Q.js} +1 -1
- package/dist/{Slicer-DwAQJLPa.cjs → Slicer-BhktgQpC.cjs} +1 -1
- package/dist/{Slicer-CTBvSici.js → Slicer-Dr5g4_di.js} +1 -1
- package/dist/{Title-BvczMERR.cjs → Title-BngFmPpq.cjs} +1 -1
- package/dist/{Title-0FYOLRT9.js → Title-DJW7JJGo.js} +1 -1
- package/dist/{Tooltip-hkjfa0I0.js → Tooltip-pvQzx3z4.js} +1 -1
- package/dist/{Tooltip-QvjV7FFJ.cjs → Tooltip-ztxY4WiA.cjs} +1 -1
- package/dist/{index-6dSPekJy.cjs → index-COMTToJY.cjs} +1 -1
- package/dist/{index-BUQIyeLx.js → index-CQyrBpOX.js} +1 -1
- package/dist/{useNestedProp-CW-4h79P.js → useNestedProp-CK_S9Ya9.js} +1 -1
- package/dist/{useNestedProp-C0FeJ2Gu.cjs → useNestedProp-DJwc68Re.cjs} +1 -1
- package/dist/{usePrinter-Dx2e-dXi.js → usePrinter-BJn_Etby.js} +1 -1
- package/dist/{usePrinter-Si0o8ws0.cjs → usePrinter-THxtdQMP.cjs} +1 -1
- package/dist/{vue-data-ui-SFL-vicz.js → vue-data-ui-9yG_ZuXl.js} +57 -57
- package/dist/{vue-data-ui-BhNefJqd.cjs → vue-data-ui-gHSCvnDy.cjs} +1 -1
- package/dist/vue-data-ui.cjs +1 -1
- package/dist/vue-data-ui.js +1 -1
- package/dist/{vue-ui-3d-bar-C6K-OwN2.cjs → vue-ui-3d-bar-6G46Xaar.cjs} +1 -1
- package/dist/{vue-ui-3d-bar-SzGt2SPF.js → vue-ui-3d-bar-BqL1MhRd.js} +7 -7
- package/dist/{vue-ui-accordion-COKJwPZR.cjs → vue-ui-accordion-BDkYau8u.cjs} +1 -1
- package/dist/{vue-ui-accordion-B_7G2YRK.js → vue-ui-accordion-DqRnuig6.js} +3 -3
- package/dist/{vue-ui-age-pyramid-BpENrca-.cjs → vue-ui-age-pyramid-BPyJ5l9B.cjs} +1 -1
- package/dist/{vue-ui-age-pyramid-CCAD1S4K.js → vue-ui-age-pyramid-IRh5kfKI.js} +8 -8
- package/dist/{vue-ui-annotator-D-af73uG.js → vue-ui-annotator-BlxLsUao.js} +1 -1
- package/dist/{vue-ui-annotator-DVUPNP51.cjs → vue-ui-annotator-CS2-dXB1.cjs} +1 -1
- package/dist/{vue-ui-candlestick-DdObXSwq.cjs → vue-ui-candlestick-D6iWs_w-.cjs} +1 -1
- package/dist/{vue-ui-candlestick-Dafy2mS8.js → vue-ui-candlestick-bqMr_UNG.js} +9 -9
- package/dist/{vue-ui-carousel-table-qft3cy1n.js → vue-ui-carousel-table-BPbrMmZ5.js} +4 -4
- package/dist/{vue-ui-carousel-table-bYSgV27Q.cjs → vue-ui-carousel-table-BmR6Xj7Q.cjs} +1 -1
- package/dist/{vue-ui-chestnut-DCIswacl.js → vue-ui-chestnut-BlhoOgtt.js} +6 -6
- package/dist/{vue-ui-chestnut-DSf7prYO.cjs → vue-ui-chestnut-lh4q8a6L.cjs} +1 -1
- package/dist/{vue-ui-cursor-Dc9Esi6P.cjs → vue-ui-cursor-BWUNJ2kc.cjs} +1 -1
- package/dist/{vue-ui-cursor-C70l6xpc.js → vue-ui-cursor-DwilivV-.js} +2 -2
- package/dist/{vue-ui-dashboard-cG4gRYbw.js → vue-ui-dashboard-B1EdqIcE.js} +2 -2
- package/dist/{vue-ui-dashboard-BQm48CXc.cjs → vue-ui-dashboard-BCeu5EHs.cjs} +1 -1
- package/dist/{vue-ui-digits-CeUaMGOT.cjs → vue-ui-digits-DqGz7C40.cjs} +1 -1
- package/dist/{vue-ui-digits-D0E4R4fa.js → vue-ui-digits-YOnGoYnu.js} +2 -2
- package/dist/{vue-ui-donut-BMMREL4b.cjs → vue-ui-donut-Crhz1o2x.cjs} +1 -1
- package/dist/{vue-ui-donut-BkEBJEsA.js → vue-ui-donut-DJ3z2Uyy.js} +9 -9
- package/dist/{vue-ui-donut-evolution-BlR9YmXE.js → vue-ui-donut-evolution-CGBLKyts.js} +9 -9
- package/dist/{vue-ui-donut-evolution-BdhZKkJR.cjs → vue-ui-donut-evolution-irJ5g-tB.cjs} +1 -1
- package/dist/{vue-ui-dumbbell-WOJbZokq.cjs → vue-ui-dumbbell-C7lYqtns.cjs} +1 -1
- package/dist/{vue-ui-dumbbell-BF7SZx1w.js → vue-ui-dumbbell-YiLDRgnr.js} +8 -8
- package/dist/{vue-ui-flow-C3newyQP.js → vue-ui-flow-B7nJzAUa.js} +7 -7
- package/dist/{vue-ui-flow-D5x8svE5.cjs → vue-ui-flow-C5XhyO1a.cjs} +1 -1
- package/dist/{vue-ui-galaxy-BJHQBQJ6.js → vue-ui-galaxy-CXiYVwzF.js} +9 -9
- package/dist/{vue-ui-galaxy-CIUd-hLW.cjs → vue-ui-galaxy-CkiIGplF.cjs} +1 -1
- package/dist/{vue-ui-gauge-BmXTSe6K.cjs → vue-ui-gauge-Box-ij8Z.cjs} +1 -1
- package/dist/{vue-ui-gauge-BaAskWex.js → vue-ui-gauge-DQdwIuYM.js} +5 -5
- package/dist/{vue-ui-gizmo-k-23quhf.cjs → vue-ui-gizmo-lQ-JQuH5.cjs} +1 -1
- package/dist/{vue-ui-gizmo-nZu_bqHD.js → vue-ui-gizmo-yMLEUprK.js} +2 -2
- package/dist/{vue-ui-heatmap-GQGsHp13.cjs → vue-ui-heatmap-D9uCI4vM.cjs} +1 -1
- package/dist/{vue-ui-heatmap-T885Tnk8.js → vue-ui-heatmap-DdolYuul.js} +8 -8
- package/dist/{vue-ui-kpi-YxP9VEld.cjs → vue-ui-kpi-CcufgDrC.cjs} +1 -1
- package/dist/{vue-ui-kpi-CLlR3RB1.js → vue-ui-kpi-Db-iLGIK.js} +4 -4
- package/dist/{vue-ui-mini-loader-C3STpvno.js → vue-ui-mini-loader-B5ZAVomk.js} +2 -2
- package/dist/{vue-ui-mini-loader-Ci--uadG.cjs → vue-ui-mini-loader-CxJ-z9rE.cjs} +1 -1
- package/dist/{vue-ui-molecule-C75VtN_7.cjs → vue-ui-molecule-C2m9xcdx.cjs} +1 -1
- package/dist/{vue-ui-molecule-BhkU3GG9.js → vue-ui-molecule-DjClBVrK.js} +9 -9
- package/dist/{vue-ui-mood-radar-qkkSh5uu.cjs → vue-ui-mood-radar-CE3utSmC.cjs} +1 -1
- package/dist/{vue-ui-mood-radar-D6TUYY_M.js → vue-ui-mood-radar-UN10Owti.js} +9 -9
- package/dist/{vue-ui-nested-donuts-BZCpf3YO.js → vue-ui-nested-donuts-DUytF3gU.js} +9 -9
- package/dist/{vue-ui-nested-donuts-CMRz1BD7.cjs → vue-ui-nested-donuts-iXADllgD.cjs} +1 -1
- package/dist/{vue-ui-onion-DlpliEql.cjs → vue-ui-onion-BUI2Pkue.cjs} +1 -1
- package/dist/{vue-ui-onion--dpVGKXA.js → vue-ui-onion-D5nX9TfZ.js} +9 -9
- package/dist/{vue-ui-parallel-coordinate-plot-DI2yWHex.js → vue-ui-parallel-coordinate-plot-CXOgpfTc.js} +10 -10
- package/dist/{vue-ui-parallel-coordinate-plot-Bk6c5TU6.cjs → vue-ui-parallel-coordinate-plot-q1BCGfqt.cjs} +1 -1
- package/dist/{vue-ui-quadrant-61FAsLt_.js → vue-ui-quadrant-BF2MCegC.js} +10 -10
- package/dist/{vue-ui-quadrant-DlyQdOTe.cjs → vue-ui-quadrant-g-zHilV9.cjs} +1 -1
- package/dist/{vue-ui-quick-chart-Bo9EatY6.cjs → vue-ui-quick-chart-Ca-2xvNg.cjs} +1 -1
- package/dist/{vue-ui-quick-chart-D9118LBz.js → vue-ui-quick-chart-zvfAdour.js} +6 -6
- package/dist/{vue-ui-radar-DAcOkXYC.cjs → vue-ui-radar-BjPOMUF0.cjs} +1 -1
- package/dist/{vue-ui-radar-VzDbMQrc.js → vue-ui-radar-CzEW9PsS.js} +10 -10
- package/dist/{vue-ui-rating-C9s1UuCt.cjs → vue-ui-rating-BNg7w51y.cjs} +1 -1
- package/dist/{vue-ui-rating-Chd-JwKZ.js → vue-ui-rating-BjmKc3wq.js} +2 -2
- package/dist/{vue-ui-relation-circle-CtIAIfL4.js → vue-ui-relation-circle-BJJ7raSa.js} +5 -5
- package/dist/{vue-ui-relation-circle-Byo0UcEM.cjs → vue-ui-relation-circle-DA3hM60W.cjs} +1 -1
- package/dist/{vue-ui-rings-DgNSeH6a.cjs → vue-ui-rings-DB7ZLrAT.cjs} +1 -1
- package/dist/{vue-ui-rings-CGhwerNx.js → vue-ui-rings-bHA_aSSF.js} +9 -9
- package/dist/{vue-ui-scatter-P_2ULGfQ.js → vue-ui-scatter-B6SJj98H.js} +10 -10
- package/dist/{vue-ui-scatter-B-ojlWTB.cjs → vue-ui-scatter-HNeVup0c.cjs} +1 -1
- package/dist/{vue-ui-screenshot-tFVVwLtm.js → vue-ui-screenshot-BiiJxMC8.js} +1 -1
- package/dist/{vue-ui-screenshot-CI8_1GLp.cjs → vue-ui-screenshot-k4Or7u-C.cjs} +1 -1
- package/dist/{vue-ui-skeleton-BxxNQUrb.js → vue-ui-skeleton-CjYyI3Lv.js} +2 -2
- package/dist/{vue-ui-skeleton-BnEVwnIx.cjs → vue-ui-skeleton-DYdGA7uQ.cjs} +1 -1
- package/dist/{vue-ui-smiley-BQNccgAJ.cjs → vue-ui-smiley-ByuyPzc9.cjs} +1 -1
- package/dist/{vue-ui-smiley-DcpmB774.js → vue-ui-smiley-UjJLCUmA.js} +2 -2
- package/dist/{vue-ui-spark-trend-RL_EM0RZ.js → vue-ui-spark-trend-BLRiuWa6.js} +4 -4
- package/dist/{vue-ui-spark-trend-Bh18Pfrn.cjs → vue-ui-spark-trend-D0PCBdx2.cjs} +1 -1
- package/dist/{vue-ui-sparkbar-IwZY49cH.cjs → vue-ui-sparkbar-TZC1RhBk.cjs} +1 -1
- package/dist/{vue-ui-sparkbar-qP5wp1Am.js → vue-ui-sparkbar-lF45jZmU.js} +3 -3
- package/dist/{vue-ui-sparkgauge-C-irMYQ7.cjs → vue-ui-sparkgauge-BBDYAjXD.cjs} +1 -1
- package/dist/{vue-ui-sparkgauge-CieVHHem.js → vue-ui-sparkgauge-BV0puE5M.js} +3 -3
- package/dist/{vue-ui-sparkhistogram-CxE07zkX.js → vue-ui-sparkhistogram-0M-yChB2.js} +4 -4
- package/dist/{vue-ui-sparkhistogram-7PTHSMpu.cjs → vue-ui-sparkhistogram-vCVdP_Vp.cjs} +1 -1
- package/dist/{vue-ui-sparkline-BV32rnNA.js → vue-ui-sparkline-Cxmg-Mpb.js} +3 -3
- package/dist/{vue-ui-sparkline-C4Z1nhoS.cjs → vue-ui-sparkline-mn0nDWC2.cjs} +1 -1
- package/dist/{vue-ui-sparkstackbar-BPxh6x8e.cjs → vue-ui-sparkstackbar-CKCZgV0u.cjs} +1 -1
- package/dist/{vue-ui-sparkstackbar-BxVHQmWd.js → vue-ui-sparkstackbar-Dw9Bhm6u.js} +3 -3
- package/dist/{vue-ui-stackbar-BnhTABFS.cjs → vue-ui-stackbar-DH5EbkWA.cjs} +1 -1
- package/dist/{vue-ui-stackbar-BIKMWKTB.js → vue-ui-stackbar-P-SgetqL.js} +10 -10
- package/dist/{vue-ui-strip-plot-Cfev39-s.js → vue-ui-strip-plot-B4L64D2e.js} +9 -9
- package/dist/{vue-ui-strip-plot-BoDJjL5h.cjs → vue-ui-strip-plot-DD1KLWvq.cjs} +1 -1
- package/dist/{vue-ui-table-C8Ky-ayZ.cjs → vue-ui-table-B8VYN1DQ.cjs} +1 -1
- package/dist/{vue-ui-table-cc6HxZm6.js → vue-ui-table-DKlWL1sg.js} +1 -1
- package/dist/{vue-ui-table-heatmap-G0YbR7QX.cjs → vue-ui-table-heatmap-CTq6J5BC.cjs} +1 -1
- package/dist/{vue-ui-table-heatmap-BJUnCLfJ.js → vue-ui-table-heatmap-CvTl-kYk.js} +4 -4
- package/dist/{vue-ui-table-sparkline-CjB5rPvu.js → vue-ui-table-sparkline-BOmWrdlg.js} +5 -5
- package/dist/{vue-ui-table-sparkline-CB7YeTxk.cjs → vue-ui-table-sparkline-BXem0A7t.cjs} +1 -1
- package/dist/{vue-ui-thermometer-CGwZBdZB.cjs → vue-ui-thermometer-BDnoT676.cjs} +1 -1
- package/dist/{vue-ui-thermometer-oCCUz0GL.js → vue-ui-thermometer-BsuH7l6d.js} +5 -5
- package/dist/{vue-ui-timer-BfXXvGcg.js → vue-ui-timer-CqLYv7at.js} +4 -4
- package/dist/{vue-ui-timer-Ckc70jvb.cjs → vue-ui-timer-FXG91zBm.cjs} +1 -1
- package/dist/{vue-ui-tiremarks-UswjRrUQ.js → vue-ui-tiremarks-B2jU97U6.js} +5 -5
- package/dist/{vue-ui-tiremarks-Di3x1YHW.cjs → vue-ui-tiremarks-CT7yMfna.cjs} +1 -1
- package/dist/{vue-ui-treemap-BcPfm4KP.js → vue-ui-treemap-DSdNtVRs.js} +9 -9
- package/dist/{vue-ui-treemap-CrAw0owp.cjs → vue-ui-treemap-rOLqWnMD.cjs} +1 -1
- package/dist/{vue-ui-vertical-bar-BScBqH6z.cjs → vue-ui-vertical-bar-DJBOce-a.cjs} +1 -1
- package/dist/{vue-ui-vertical-bar-2_WbKIT1.js → vue-ui-vertical-bar-_ZuU0A54.js} +9 -9
- package/dist/{vue-ui-waffle-Dzi3EgQM.cjs → vue-ui-waffle-BzKAYW6F.cjs} +1 -1
- package/dist/{vue-ui-waffle-CStE_uxm.js → vue-ui-waffle-CKp48kdM.js} +9 -9
- package/dist/{vue-ui-wheel-Eyej3znn.cjs → vue-ui-wheel-6FFJt53W.cjs} +1 -1
- package/dist/{vue-ui-wheel-FI9_Qnln.js → vue-ui-wheel-DPjB5xcl.js} +5 -5
- package/dist/{vue-ui-word-cloud-Ycqmen8O.js → vue-ui-word-cloud-BY_qs7bW.js} +7 -7
- package/dist/{vue-ui-word-cloud-M_xW3qre.cjs → vue-ui-word-cloud-VybUTXFv.cjs} +1 -1
- package/dist/{vue-ui-xy-B5_TQJnd.js → vue-ui-xy-BgBvVtwZ.js} +12 -12
- package/dist/{vue-ui-xy-BrdhxozQ.cjs → vue-ui-xy-CVxPe82S.cjs} +1 -1
- package/dist/{vue-ui-xy-canvas-w5aPclyY.js → vue-ui-xy-canvas-B2mkEuiI.js} +10 -10
- package/dist/{vue-ui-xy-canvas-uDottxNK.cjs → vue-ui-xy-canvas-BjPLlJyo.cjs} +1 -1
- package/package.json +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),i=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),i=require("./index-COMTToJY.cjs"),J=require("./useResponsive-B3TrDDIG.cjs"),ye=require("./Title-BngFmPpq.cjs"),K=require("./usePrinter-THxtdQMP.cjs"),he=require("./Tooltip-ztxY4WiA.cjs"),pe=require("./DataTable-D7JJfjpO.cjs"),fe=require("./vue-ui-skeleton-DYdGA7uQ.cjs"),ge=require("./Slicer-BhktgQpC.cjs"),me=require("./vue-ui-accordion-BDkYau8u.cjs"),Q=require("./useNestedProp-DJwc68Re.cjs"),ke=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),xe=["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={key:3,class:"vue-data-ui-watermark"},Je=["innerHTML"],Ke={__name:"vue-ui-candlestick",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},setup(f,{expose:Z}){const h=f,{vue_ui_candlestick:ee}=i.useConfig(),m=e.computed(()=>!!h.dataset&&h.dataset.length),y=e.ref(i.createUid()),te=e.ref(null),_=e.ref(!1),B=e.ref(""),S=e.ref(void 0),T=e.ref(0),F=e.ref(0),k=e.ref(null),A=e.ref(null),L=e.ref(null),R=e.ref(null),t=e.computed(()=>{const o=Q.useNestedProp({userConfig:h.config,defaultConfig:ee});return o.theme?{...Q.useNestedProp({userConfig:i.themes.vue_ui_candlestick[o.theme]||h.config,defaultConfig:o})}:o}),n=e.ref({height:t.value.style.height,width:t.value.style.width,xAxisFontSize:t.value.style.layout.grid.xAxis.dataLabels.fontSize,yAxisFontSize:t.value.style.layout.grid.yAxis.dataLabels.fontSize}),b=e.ref(null);e.onMounted(()=>{if(i.objectIsEmpty(h.dataset)&&i.error({componentName:"VueUiCandlestick",type:"dataset"}),t.value.responsive){const o=J.throttle(()=>{const{width:u,height:l}=J.useResponsive({chart:k.value,title:t.value.style.title.text?A.value:null,slicer:R.value,legend:L.value});n.value.width=u,n.value.height=l,n.value.xAxisFontSize=i.translateSize({relator:Math.min(u,l),adjuster:t.value.style.width,source:t.value.style.layout.grid.xAxis.dataLabels.fontSize,threshold:6,fallback:6}),n.value.yAxisFontSize=i.translateSize({relator:Math.min(u,l),adjuster:t.value.style.width,source:t.value.style.layout.grid.yAxis.dataLabels.fontSize,threshold:6,fallback:6})});b.value=new ResizeObserver(o),b.value.observe(k.value.parentNode)}}),e.onBeforeUnmount(()=>{b.value&&b.value.disconnect()});const{isPrinting:P,isImaging:I,generatePdf:O,generateImage:M}=K.usePrinter({elementId:`vue-ui-candlestick_${y.value}`,fileName:t.value.style.title.text||"vue-ui-candlestick"}),p=e.ref({showTable:t.value.table.show,showTooltip:t.value.style.tooltip.show}),s=e.computed(()=>{const{top:o,right:u,bottom:l,left:a}=t.value.style.layout.padding;return{top:o,right:n.value.width-u,left:a,bottom:n.value.height-l,width:n.value.width-a-u,height:n.value.height-o-l}}),V=e.computed(()=>h.dataset.length),d=e.ref({start:0,end:V.value}),U=e.computed(()=>h.dataset.slice(d.value.start,d.value.end)),E=e.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})}),U.value.map(o=>({period:o[0],open:o[1],high:o[2],low:o[3],last:o[4],volume:o[5]})))),r=e.computed(()=>s.value.width/U.value.length),D=e.computed(()=>({max:Math.max(...E.value.map(o=>o.high)),min:0})),g=e.computed(()=>i.calculateNiceScale(D.value.min,D.value.max,t.value.style.layout.grid.yAxis.dataLabels.steps));function w(o,u){return{...o,x:s.value.left+u*r.value+r.value/2,y:s.value.top+(1-o/g.value.max)*s.value.height,value:o}}const c=e.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/g.value.max}const oe=e.computed(()=>g.value.ticks.map(o=>({y:s.value.bottom-s.value.height*le(o),value:o}))),ae=e.computed(()=>E.value.map(o=>o.period)),z=e.ref(null);function ue(o,u){S.value=o,z.value={datapoint:u,seriesIndex:o,series:c.value,config:t.value};const l=t.value.style.tooltip.customFormat;if(i.isFunction(l)&&i.functionReturnsString(()=>l({seriesIndex:o,datapoint:u,series:c.value,config:t.value})))B.value=l({seriesIndex:o,datapoint:u,series:c.value,config:t.value});else if(t.value.style.tooltip.show){let a="";const{period:v,open:$,high:N,low:H,last:j,volume:X,isBullish:Y}=c.value[o],{period:Ze,open:re,high:ne,low:de,last:ce,volume:ve}=t.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="${t.value.style.layout.candle.borderRadius*3}" stroke="${t.value.style.layout.candle.stroke}" stroke-width="${t.value.style.layout.candle.strokeWidth}"
|
|
2
2
|
fill="${t.value.style.layout.candle.gradient.show?Y?`url(#bullish_gradient_${y.value})`:`url(#bearish_gradient_${y.value})`:Y?t.value.style.layout.candle.colors.bullish:t.value.style.layout.candle.colors.bearish}"/></svg>${v}</div>`,a+=`${ve} : <b>${isNaN(X)?"-":Number(X.toFixed(t.value.style.tooltip.roundingValue)).toLocaleString()}</b>`,a+=`<div style="margin-top:6px;padding-top:6px;border-top:1px solid ${t.value.style.tooltip.borderColor}">`,a+=`<div>${re}: <b>${t.value.style.tooltip.prefix} ${isNaN($.value)?"-":Number($.value.toFixed(t.value.style.tooltip.roundingValue)).toLocaleString()} ${t.value.style.tooltip.suffix}</b></div>`,a+=`<div>${ne}: <b>${t.value.style.tooltip.prefix} ${isNaN(N.value)?"-":Number(N.value.toFixed(t.value.style.tooltip.roundingValue)).toLocaleString()} ${t.value.style.tooltip.suffix}</b></div>`,a+=`<div>${de}: <b>${t.value.style.tooltip.prefix} ${isNaN(H.value)?"-":Number(H.value.toFixed(t.value.style.tooltip.roundingValue)).toLocaleString()} ${t.value.style.tooltip.suffix}</b></div>`,a+=`<div>${ce}: <b>${t.value.style.tooltip.prefix} ${isNaN(j.value)?"-":Number(j.value.toFixed(t.value.style.tooltip.roundingValue)).toLocaleString()} ${t.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 q(){e.nextTick(()=>{const o=[t.value.translations.period,t.value.translations.open,t.value.translations.high,t.value.translations.low,t.value.translations.last,t.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=[[t.value.style.title.text],[t.value.style.title.subtitle.text],[[""],[""],[""]]].concat([o]).concat(u),a=i.createCsvContent(l);i.downloadCsv({csvContent:a,title:t.value.style.title.text||"vue-ui-candlestick"})})}const C=e.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="${t.value.style.layout.candle.borderRadius*3}" fill="${t.value.style.layout.candle.gradient.show?a.isBullish?`url(#bullish_gradient_${y.value}`:`url(#bearish_gradient_${y.value})`:a.isBullish?t.value.style.layout.candle.colors.bullish:t.value.style.layout.candle.colors.bearish}"/></svg> ${a.period}`,`${t.value.table.td.prefix} ${isNaN(a.open.value)?"-":Number(a.open.value.toFixed(t.value.table.td.roundingValue)).toLocaleString()} ${t.value.table.td.suffix}`,`${t.value.table.td.prefix} ${isNaN(a.high.value)?"-":Number(a.high.value.toFixed(t.value.table.td.roundingValue)).toLocaleString()} ${t.value.table.td.suffix}`,`${t.value.table.td.prefix} ${isNaN(a.low.value)?"-":Number(a.low.value.toFixed(t.value.table.td.roundingValue)).toLocaleString()} ${t.value.table.td.suffix}`,`${t.value.table.td.prefix} ${isNaN(a.last.value)?"-":Number(a.last.value.toFixed(t.value.table.td.roundingValue)).toLocaleString()} ${t.value.table.td.suffix}`,`${isNaN(a.volume)?"-":a.volume.toLocaleString()}`]),u={th:{backgroundColor:t.value.table.th.backgroundColor,color:t.value.table.th.color,outline:t.value.table.th.outline},td:{backgroundColor:t.value.table.td.backgroundColor,color:t.value.table.td.color,outline:t.value.table.td.outline},breakpoint:t.value.table.responsiveBreakpoint},l=[t.value.translations.period,t.value.translations.open,t.value.translations.high,t.value.translations.low,t.value.translations.last,t.value.translations.volume];return{head:l,body:o,config:u,colNames:l}}),x=e.ref(!1);function se(o){x.value=o,T.value+=1}function W(){p.value.showTable=!p.value.showTable}function G(){p.value.showTooltip=!p.value.showTooltip}return Z({generatePdf:O,generateCsv:q,generateImage:M,toggleTable:W,toggleTooltip:G}),(o,u)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"candlestickChart",ref:k,class:e.normalizeClass(`vue-ui-candlestick ${x.value?"vue-data-ui-wrapper-fullscreen":""} ${t.value.useCssAnimation?"":"vue-ui-dna"}`),style:e.normalizeStyle(`position:relative;font-family:${t.value.style.fontFamily}; text-align:center;${t.value.style.title.text?"":"padding-top:36px"};background:${t.value.style.backgroundColor}; ${t.value.responsive?"height: 100%":""}`),id:`vue-ui-candlestick_${y.value}`},[t.value.style.title.text?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"chartTitle",ref:A,style:e.normalizeStyle(`width:100%;background:${t.value.style.backgroundColor}`)},[e.createVNode(ye._sfc_main,{config:{title:{cy:"candlestick-div-title",...t.value.style.title},subtitle:{cy:"candlestick-div-subtitle",...t.value.style.title.subtitle}}},null,8,["config"])],4)):e.createCommentVNode("",!0),t.value.userOptions.show&&m.value?(e.openBlock(),e.createBlock(K.UserOptions,{ref_key:"details",ref:te,key:`user_options_${T.value}`,backgroundColor:t.value.style.backgroundColor,color:t.value.style.color,isImaging:e.unref(I),isPrinting:e.unref(P),uid:y.value,hasTooltip:t.value.userOptions.buttons.tooltip&&t.value.style.tooltip.show,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:x.value,isTooltip:p.value.showTooltip,titles:{...t.value.userOptions.buttonTitles},chartElement:k.value,onToggleFullscreen:se,onGeneratePdf:e.unref(O),onGenerateCsv:q,onGenerateImage:e.unref(M),onToggleTable:W,onToggleTooltip:G},e.createSlots({_:2},[o.$slots.optionTooltip?{name:"optionTooltip",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionTooltip",{},void 0,!0)]),key:"0"}:void 0,o.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionPdf",{},void 0,!0)]),key:"1"}:void 0,o.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionCsv",{},void 0,!0)]),key:"2"}:void 0,o.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionImg",{},void 0,!0)]),key:"3"}:void 0,o.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionTable",{},void 0,!0)]),key:"4"}:void 0,o.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:l,isFullscreen:a})=>[e.renderSlot(o.$slots,"optionFullscreen",e.normalizeProps(e.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"])):e.createCommentVNode("",!0),m.value?(e.openBlock(),e.createElementBlock("svg",{key:2,xmlns:e.unref(i.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":x.value,"vue-data-ui-fulscreen--off":!x.value}),viewBox:`0 0 ${n.value.width<=0?10:n.value.width} ${n.value.height<=0?10:n.value.height}`,style:e.normalizeStyle(`max-width:100%;overflow:visible;background:${t.value.style.backgroundColor};color:${t.value.style.color}`)},[c.value.length>0?(e.openBlock(),e.createElementBlock("g",we,[e.createElementVNode("defs",null,[e.createElementVNode("linearGradient",{id:`bearish_gradient_${y.value}`,x2:"0%",y2:"100%"},[e.createElementVNode("stop",{offset:"0%","stop-color":t.value.style.layout.candle.colors.bearish},null,8,$e),e.createElementVNode("stop",{offset:"50%","stop-color":`${e.unref(i.shiftHue)(t.value.style.layout.candle.colors.bearish,.02)}DE`},null,8,Ne),e.createElementVNode("stop",{offset:"100%","stop-color":`${e.unref(i.shiftHue)(t.value.style.layout.candle.colors.bearish,.05)}66`},null,8,_e)],8,Ce),e.createElementVNode("linearGradient",{id:`bullish_gradient_${y.value}`,x2:"0%",y2:"100%"},[e.createElementVNode("stop",{offset:"0%","stop-color":t.value.style.layout.candle.colors.bullish},null,8,Se),e.createElementVNode("stop",{offset:"50%","stop-color":`${e.unref(i.shiftHue)(t.value.style.layout.candle.colors.bullish,.02)}DE`},null,8,Ve),e.createElementVNode("stop",{offset:"100%","stop-color":`${e.unref(i.shiftHue)(t.value.style.layout.candle.colors.bullish,.05)}66`},null,8,Ee)],8,Be)]),t.value.style.layout.grid.show?(e.openBlock(),e.createElementBlock("g",ze,[e.createElementVNode("line",{x1:s.value.left,x2:s.value.left,y1:s.value.top,y2:s.value.bottom,stroke:t.value.style.layout.grid.stroke,"stroke-width":t.value.style.layout.grid.strokeWidth,"stroke-linecap":"round"},null,8,Te),e.createElementVNode("line",{x1:s.value.left,x2:s.value.right,y1:s.value.bottom,y2:s.value.bottom,stroke:t.value.style.layout.grid.stroke,"stroke-width":t.value.style.layout.grid.strokeWidth,"stroke-linecap":"round"},null,8,Fe)])):e.createCommentVNode("",!0),t.value.style.layout.grid.yAxis.dataLabels.show?(e.openBlock(),e.createElementBlock("g",Ae,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(oe.value,(l,a)=>(e.openBlock(),e.createElementBlock("g",null,[l.value>=g.value.min&&l.value<=g.value.max?(e.openBlock(),e.createElementBlock("line",{key:0,x1:s.value.left,x2:s.value.left-5,y1:l.y,y2:l.y,stroke:t.value.style.layout.grid.stroke,"stroke-width":t.value.style.layout.grid.strokeWidth,"stroke-linecap":"round"},null,8,Le)):e.createCommentVNode("",!0),l.value>=g.value.min&&l.value<=g.value.max?(e.openBlock(),e.createElementBlock("text",{key:1,x:s.value.left-8+t.value.style.layout.grid.yAxis.dataLabels.offsetX,y:l.y+n.value.yAxisFontSize/3,"font-size":n.value.yAxisFontSize,"text-anchor":"end",fill:t.value.style.layout.grid.yAxis.dataLabels.color,"font-weight":t.value.style.layout.grid.yAxis.dataLabels.bold?"bold":"normal"},e.toDisplayString(t.value.style.layout.grid.yAxis.dataLabels.prefix)+" "+e.toDisplayString(e.unref(i.canShowValue)(l.value)?l.value.toFixed(t.value.style.layout.grid.yAxis.dataLabels.roundingValue):"")+" "+e.toDisplayString(t.value.style.layout.grid.yAxis.dataLabels.suffix),9,Re)):e.createCommentVNode("",!0)]))),256))])):e.createCommentVNode("",!0),t.value.style.layout.grid.xAxis.dataLabels.show?(e.openBlock(),e.createElementBlock("g",Pe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ae.value,(l,a)=>(e.openBlock(),e.createElementBlock("g",null,[e.createElementVNode("text",{transform:`translate(${s.value.left+r.value*a+r.value/2}, ${s.value.bottom+n.value.xAxisFontSize*2+t.value.style.layout.grid.xAxis.dataLabels.offsetY}), rotate(${t.value.style.layout.grid.xAxis.dataLabels.rotation})`,"text-anchor":t.value.style.layout.grid.xAxis.dataLabels.rotation>0?"start":t.value.style.layout.grid.xAxis.dataLabels.rotation<0?"end":"middle","font-size":n.value.xAxisFontSize,fill:t.value.style.layout.grid.xAxis.dataLabels.color,"font-weight":t.value.style.layout.grid.xAxis.dataLabels.bold?"bold":"normal"},e.toDisplayString(l),9,Ie)]))),256))])):e.createCommentVNode("",!0),e.createElementVNode("g",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,(l,a)=>(e.openBlock(),e.createElementBlock("g",null,[e.createElementVNode("line",{x1:l.open.x,x2:l.open.x,y1:l.high.y,y2:l.low.y,stroke:t.value.style.layout.wick.stroke,"stroke-width":t.value.style.layout.wick.strokeWidth,"stroke-linecap":"round"},null,8,Oe),t.value.style.layout.wick.extremity.shape==="circle"?(e.openBlock(),e.createElementBlock("g",Me,[e.createElementVNode("circle",{cx:l.high.x,cy:l.high.y,r:t.value.style.layout.wick.extremity.size==="auto"?r.value/20:t.value.style.layout.wick.extremity.size,fill:t.value.style.layout.wick.extremity.color},null,8,Ue),e.createElementVNode("circle",{cx:l.low.x,cy:l.low.y,r:t.value.style.layout.wick.extremity.size==="auto"?r.value/20:t.value.style.layout.wick.extremity.size,fill:t.value.style.layout.wick.extremity.color},null,8,De)])):e.createCommentVNode("",!0),t.value.style.layout.wick.extremity.shape==="line"?(e.openBlock(),e.createElementBlock("g",qe,[e.createElementVNode("line",{x1:l.high.x-(t.value.style.layout.wick.extremity.size==="auto"?r.value*t.value.style.layout.candle.widthRatio:t.value.style.layout.wick.extremity.size)/2,x2:l.high.x+(t.value.style.layout.wick.extremity.size==="auto"?r.value*t.value.style.layout.candle.widthRatio:t.value.style.layout.wick.extremity.size)/2,y1:l.high.y,y2:l.high.y,stroke:t.value.style.layout.wick.extremity.color,"stroke-width":t.value.style.layout.wick.strokeWidth,"stroke-linecap":"round"},null,8,We),e.createElementVNode("line",{x1:l.low.x-(t.value.style.layout.wick.extremity.size==="auto"?r.value*t.value.style.layout.candle.widthRatio:t.value.style.layout.wick.extremity.size)/2,x2:l.low.x+(t.value.style.layout.wick.extremity.size==="auto"?r.value*t.value.style.layout.candle.widthRatio:t.value.style.layout.wick.extremity.size)/2,y1:l.low.y,y2:l.low.y,stroke:t.value.style.layout.wick.extremity.color,"stroke-width":t.value.style.layout.wick.strokeWidth,"stroke-linecap":"round"},null,8,Ge)])):e.createCommentVNode("",!0)]))),256))]),e.createElementVNode("g",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,(l,a)=>(e.openBlock(),e.createElementBlock("rect",{x:l.open.x-r.value/2+r.value*(1-t.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:r.value*t.value.style.layout.candle.widthRatio<=0?1e-4:r.value*t.value.style.layout.candle.widthRatio,fill:t.value.style.layout.candle.gradient.underlayer,rx:t.value.style.layout.candle.borderRadius,stroke:"none"},null,8,He))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,(l,a)=>(e.openBlock(),e.createElementBlock("rect",{x:l.open.x-r.value/2+r.value*(1-t.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:r.value*t.value.style.layout.candle.widthRatio<=0?1e-4:r.value*t.value.style.layout.candle.widthRatio,fill:l.isBullish?t.value.style.layout.candle.gradient.show?`url(#bullish_gradient_${y.value})`:t.value.style.layout.candle.colors.bullish:t.value.style.layout.candle.gradient.show?`url(#bearish_gradient_${y.value})`:t.value.style.layout.candle.colors.bearish,rx:t.value.style.layout.candle.borderRadius,stroke:t.value.style.layout.candle.stroke,"stroke-width":t.value.style.layout.candle.strokeWidth,"stroke-linecap":"round","stroke-linejoin":"round"},null,8,je))),256))]),e.createElementVNode("g",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,(l,a)=>(e.openBlock(),e.createElementBlock("rect",{x:s.value.left+a*r.value,y:s.value.top,height:s.value.height<=0?1e-4:s.value.height,width:r.value<=0?1e-4:r.value,fill:S.value===a?`${t.value.style.layout.selector.color}${e.unref(i.opacity)[t.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))])])):e.createCommentVNode("",!0),e.renderSlot(o.$slots,"svg",{svg:n.value},void 0,!0)],14,be)):e.createCommentVNode("",!0),o.$slots.watermark?(e.openBlock(),e.createElementBlock("div",Ye,[e.renderSlot(o.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(P)||e.unref(I)})),void 0,!0)])):e.createCommentVNode("",!0),m.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(fe.default,{key:4,config:{type:"candlesticks",style:{backgroundColor:t.value.style.backgroundColor,candlesticks:{axis:{color:"#CCCCCC"},candle:{color:"#CCCCCC"}}}}},null,8,["config"])),t.value.style.zoom.show&&m.value?(e.openBlock(),e.createElementBlock("div",{key:5,ref_key:"chartSlicer",ref:R},[(e.openBlock(),e.createBlock(ge.Slicer,{key:`slicer_${F.value}`,background:t.value.style.zoom.color,borderColor:t.value.style.backgroundColor,fontSize:t.value.style.zoom.fontSize,useResetSlot:t.value.style.zoom.useResetSlot,labelLeft:f.dataset[d.value.start]?f.dataset[d.value.start][0]:f.dataset[0][0],labelRight:f.dataset[d.value.end-1]?f.dataset[d.value.end-1][0]:f.dataset.at(-1)[0],textColor:t.value.style.color,inputColor:t.value.style.zoom.color,selectColor:t.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":e.withCtx(({reset:l})=>[e.renderSlot(o.$slots,"reset-action",e.normalizeProps(e.guardReactiveProps({reset:l})),void 0,!0)]),_:3},8,["background","borderColor","fontSize","useResetSlot","labelLeft","labelRight","textColor","inputColor","selectColor","max","valueStart","valueEnd","start","end"]))],512)):e.createCommentVNode("",!0),e.createElementVNode("div",{ref_key:"chartLegend",ref:L},[e.renderSlot(o.$slots,"legend",{legend:c.value},void 0,!0)],512),e.createVNode(he._sfc_main,{show:p.value.showTooltip&&_.value,backgroundColor:t.value.style.tooltip.backgroundColor,color:t.value.style.tooltip.color,borderRadius:t.value.style.tooltip.borderRadius,borderColor:t.value.style.tooltip.borderColor,borderWidth:t.value.style.tooltip.borderWidth,fontSize:t.value.style.tooltip.fontSize,backgroundOpacity:t.value.style.tooltip.backgroundOpacity,position:t.value.style.tooltip.position,offsetY:t.value.style.tooltip.offsetY,parent:k.value,content:B.value,isCustom:t.value.style.tooltip.customFormat&&typeof t.value.style.tooltip.customFormat=="function"},{"tooltip-before":e.withCtx(()=>[e.renderSlot(o.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({...z.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(o.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...z.value})),void 0,!0)]),_:3},8,["show","backgroundColor","color","borderRadius","borderColor","borderWidth","fontSize","backgroundOpacity","position","offsetY","parent","content","isCustom"]),m.value?(e.openBlock(),e.createBlock(me.default,{key:6,hideDetails:"",config:{open:p.value.showTable,maxHeight:1e4,body:{backgroundColor:t.value.style.backgroundColor,color:t.value.style.color},head:{backgroundColor:t.value.style.backgroundColor,color:t.value.style.color}}},{content:e.withCtx(()=>[e.createVNode(pe.DataTable,{colNames:C.value.colNames,head:C.value.head,body:C.value.body,config:C.value.config,title:`${t.value.style.title.text}${t.value.style.title.subtitle.text?` : ${t.value.style.title.subtitle.text}`:""}`,onClose:u[3]||(u[3]=l=>p.value.showTable=!1)},{th:e.withCtx(({th:l})=>[e.createTextVNode(e.toDisplayString(l),1)]),td:e.withCtx(({td:l})=>[e.createElementVNode("div",{innerHTML:l},null,8,Je)]),_:1},8,["colNames","head","body","config","title"])]),_:1},8,["config"])):e.createCommentVNode("",!0)],14,xe))}},Qe=ke._export_sfc(Ke,[["__scopeId","data-v-6b386f48"]]);exports.default=Qe;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { computed as h, ref as v, onMounted as Ae, onBeforeUnmount as Fe, openBlock as s, createElementBlock as u, normalizeClass as ce, normalizeStyle as H, createVNode as Y, createCommentVNode as y, createBlock as M, unref as p, createSlots as Le, withCtx as b, renderSlot as x, normalizeProps as F, guardReactiveProps as L, createElementVNode as n, Fragment as N, renderList as S, toDisplayString as R, 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, A as Me, X as Ue, s as U, B as Ee, v as We, w as De, x as Ge, q as Xe, r as je, C as he } from "./index-
|
|
2
|
+
import { u as Ie, c as Be, t as Oe, o as Pe, e as C, A as Me, X as Ue, s as U, B as Ee, v as We, w as De, x as Ge, q as Xe, r as je, C as he } from "./index-CQyrBpOX.js";
|
|
3
3
|
import { t as He, u as Ye } from "./useResponsive-NZB-WLRF.js";
|
|
4
|
-
import { _ as qe } from "./Title-
|
|
5
|
-
import { u as Je, U as Ke } from "./usePrinter-
|
|
6
|
-
import { _ as Qe } from "./Tooltip-
|
|
7
|
-
import { D as Ze } from "./DataTable-
|
|
8
|
-
import et from "./vue-ui-skeleton-
|
|
9
|
-
import { S as tt } from "./Slicer-
|
|
10
|
-
import lt from "./vue-ui-accordion-
|
|
11
|
-
import { u as pe } from "./useNestedProp-
|
|
4
|
+
import { _ as qe } from "./Title-DJW7JJGo.js";
|
|
5
|
+
import { u as Je, U as Ke } from "./usePrinter-BJn_Etby.js";
|
|
6
|
+
import { _ as Qe } from "./Tooltip-pvQzx3z4.js";
|
|
7
|
+
import { D as Ze } from "./DataTable-CcVgHrwx.js";
|
|
8
|
+
import et from "./vue-ui-skeleton-CjYyI3Lv.js";
|
|
9
|
+
import { S as tt } from "./Slicer-Dr5g4_di.js";
|
|
10
|
+
import lt from "./vue-ui-accordion-DqRnuig6.js";
|
|
11
|
+
import { u as pe } from "./useNestedProp-CK_S9Ya9.js";
|
|
12
12
|
import { _ as ot } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
13
13
|
const at = ["id"], st = ["xmlns", "viewBox"], ut = { 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 = {
|
|
14
14
|
key: 3,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ref as o, onMounted as F, computed as B, onBeforeUnmount as ie, watch as ye, openBlock as u, createElementBlock as r, createElementVNode as z, normalizeStyle as d, unref as b, normalizeClass as Ce, createTextVNode as U, toDisplayString as V, renderSlot as p, Fragment as G, renderList as M, normalizeProps as q, guardReactiveProps as D, createCommentVNode as E, createBlock as se, createSlots as $e, withCtx as O, nextTick as Te } from "vue";
|
|
2
|
-
import { u as Ae, c as xe, o as X, e as j, v as ke, q as we, r as Ie } from "./index-
|
|
3
|
-
import { u as Fe } from "./useNestedProp-
|
|
4
|
-
import { u as Be, U as Oe } from "./usePrinter-
|
|
5
|
-
import Pe from "./vue-ui-skeleton-
|
|
2
|
+
import { u as Ae, c as xe, o as X, e as j, v as ke, q as we, r as Ie } from "./index-CQyrBpOX.js";
|
|
3
|
+
import { u as Fe } from "./useNestedProp-CK_S9Ya9.js";
|
|
4
|
+
import { u as Be, U as Oe } from "./usePrinter-BJn_Etby.js";
|
|
5
|
+
import Pe from "./vue-ui-skeleton-CjYyI3Lv.js";
|
|
6
6
|
import { _ as Re } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
7
7
|
const ze = ["id"], Ee = ["height"], Ne = ["data-cell", "height"], Se = {
|
|
8
8
|
__name: "vue-ui-carousel-table",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),u=require("./index-6dSPekJy.cjs"),te=require("./useNestedProp-C0FeJ2Gu.cjs"),D=require("./usePrinter-Si0o8ws0.cjs"),oe=require("./vue-ui-skeleton-BnEVwnIx.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(c,{expose:G}){const l=c,{vue_ui_carousel_table:j}=u.useConfig(),A=e.ref(u.createUid()),z=e.ref(!1),m=e.ref(!!l.dataset);e.onMounted(()=>{u.objectIsEmpty(l.dataset)?u.error({componentName:"VueUiCarouselTable",type:"dataset"}):((!l.dataset.head||u.objectIsEmpty(l.dataset.head))&&(u.error({componentName:"VueUiCarouselTable",type:"datasetAttribute",property:"head"}),m.value=!1),(!l.dataset.body||u.objectIsEmpty(l.dataset.body))&&(u.error({componentName:"VueUiCarouselTable",type:"datasetAttribute",property:"body"}),m.value=!1))});const t=e.computed(()=>te.useNestedProp({userConfig:l.config,defaultConfig:j})),{isPrinting:I,isImaging:P,generatePdf:X,generateImage:F}=D.usePrinter({elementId:`carousel-table_${A.value}`,fileName:t.value.caption.text||"vue-ui-carousel-table"}),s=e.ref({showAnimation:t.value.animation.use}),i=e.ref(null),N=e.ref(null),h=e.ref(null),g=e.ref(null),b=e.ref(0),B=e.ref(0),$=e.ref(!1),y=e.ref(null),v=e.ref(null),k=e.ref(0);function R(){y.value&&(v.value={elements:y.value.getElementsByTagName("tr"),heights:Array.from(y.value.getElementsByTagName("tr")).map(o=>o.getBoundingClientRect().height)})}e.onMounted(R);const J=e.computed(()=>!v.value||!v.value.heights.length?0:Math.max(...v.value.heights)+b.value+B.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+b.value+B.value),w=e.ref(0),C=e.ref(null),T=e.ref(0),p=e.ref(!1),O=e.ref(0);e.onMounted(()=>{h.value&&(b.value=h.value.getBoundingClientRect().height),g.value&&(B.value=g.value.getBoundingClientRect().height),s.value.showAnimation&&v.value&&V()}),e.onMounted(()=>{if(i.value){let a=function(){const r=o.getBoundingClientRect().bottom;n.forEach(d=>{d.getBoundingClientRect().top<r?d.style.visibility="hidden":d.style.visibility="visible"})};const o=i.value.querySelector("thead"),n=Array.from(y.value.querySelectorAll("tr"));i.value.addEventListener("scroll",a),a(),e.onBeforeUnmount(()=>{i.value.removeEventListener("scroll",a)})}});function W(o){z.value=o,O.value+=1}function V(){!C.value&&!p.value&&(C.value=requestAnimationFrame(L))}function Y(){if(!i.value)return!1;const{scrollTop:o,scrollHeight:n,clientHeight:a}=i.value;return o+a>=n}function L(o){if(p.value)return;T.value||(T.value=o),o-T.value>=t.value.animation.speedMs&&(w.value+=v.value.heights[k.value],(Y()||k.value>=v.value.heights.length)&&(w.value=0,k.value=-1),k.value+=1,i.value&&i.value.scrollTo({top:w.value,behavior:"smooth"}),T.value=o),C.value=requestAnimationFrame(L)}function f(){p.value=!0,cancelAnimationFrame(C.value),C.value=null}e.onBeforeUnmount(f);function x(){!p.value||!s.value.showAnimation||(p.value=!1,T.value=0,V())}function Z(){t.value.animation.pauseOnHover&&f()}const S=e.ref(null);function _(){f(),clearTimeout(S.value)}function M(){clearTimeout(S.value),S.value=setTimeout(x,1e3)}e.watch(()=>t.value.animation.use,o=>{o?(s.value.showAnimation=!0,x()):(s.value.showAnimation=!1,f())});const ee=e.computed(()=>t.value.responsiveBreakpoint);e.onMounted(()=>{const o=new ResizeObserver(n=>{n.forEach(a=>{$.value=a.contentRect.width<ee.value}),b.value=h.value?h.value.getBoundingClientRect().height:0,B.value=g.value?g.value.getBoundingClientRect().height:0,k.value=0,R()});i.value&&o.observe(i.value)});function q(){X()}function H(){s.value.showAnimation=!s.value.showAnimation,s.value.showAnimation?x():f()}function U(){e.nextTick(()=>{const o=l.dataset.head.map((r,d)=>[[l.dataset.body[d]]]),n=[[t.value.caption.text],[l.dataset.head.map(r=>[r])]].concat(o),a=u.createCsvContent(n);u.downloadCsv({csvContent:a,title:t.value.caption.text||"vue-ui-carousel-table"})})}return G({pauseAnimation:f,resumeAnimation:x,toggleAnimation:H,generateCsv:U,generatePdf:q,generateImage:F}),(o,n)=>(e.openBlock(),e.createElementBlock("div",{style:{position:"relative",overflow:"visible"},ref_key:"chartContainer",ref:N},[e.createElementVNode("div",{ref_key:"tableContainer",ref:i,id:`carousel-table_${A.value}`,style:e.normalizeStyle({height:e.unref(I)||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":!p.value}),onMouseenter:n[0]||(n[0]=a=>Z()),onMouseleave:n[1]||(n[1]=a=>x()),onTouchstart:n[2]||(n[2]=a=>_()),onTouchend:n[3]||(n[3]=a=>M()),onTouchcancel:n[4]||(n[4]=a=>M())},[m.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:h,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:`${b.value}px`,zIndex:1})},[e.createElementVNode("tr",{ref_key:"tableRow",ref:g,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(c.dataset.head,(a,r)=>(e.openBlock(),e.createElementBlock("th",{role:"cell",key:`th_${r}`,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?"":a)+" ",1),e.renderSlot(o.$slots,"th",e.normalizeProps(e.guardReactiveProps({th:a,colIndex:r})),void 0,!0)],4))),128))],12,le)],4),c.dataset.body&&c.dataset.head?(e.openBlock(),e.createElementBlock("tbody",{key:0,ref_key:"tbody",ref:y,style:e.normalizeStyle({clipPath:"inset(0,0,0,0)"})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.dataset.body,(a,r)=>(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(a,(d,E)=>(e.openBlock(),e.createElementBlock("td",{role:"cell","data-cell":c.dataset.head[E]||"",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(u.opacity)[r%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?"":d)+" ",1),e.renderSlot(o.$slots,"td",e.normalizeProps(e.guardReactiveProps({td:d,rowIndex:r,colIndex:E})),void 0,!0)],12,re))),256))],4))),256))],4)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0)],46,ne),m.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(oe.default,{key:0,config:{type:"table"}})),t.value.userOptions.show&&m.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(I),isImaging:e.unref(P),uid:A.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:!s.value.showAnimation,hasFullscreen:t.value.userOptions.buttons.fullscreen,isFullscreen:z.value,chartElement:N.value,titles:{...t.value.userOptions.buttonTitles},zIndex:3,noOffset:"",onGeneratePdf:q,onGenerateCsv:U,onGenerateImage:e.unref(F),onToggleAnimation:H,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:a,isFullscreen:r})=>[e.renderSlot(o.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:a,isFullscreen:r})),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-f722c10b"]]);exports.default=ue;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),u=require("./index-COMTToJY.cjs"),te=require("./useNestedProp-DJwc68Re.cjs"),D=require("./usePrinter-THxtdQMP.cjs"),oe=require("./vue-ui-skeleton-DYdGA7uQ.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(c,{expose:G}){const l=c,{vue_ui_carousel_table:j}=u.useConfig(),A=e.ref(u.createUid()),z=e.ref(!1),m=e.ref(!!l.dataset);e.onMounted(()=>{u.objectIsEmpty(l.dataset)?u.error({componentName:"VueUiCarouselTable",type:"dataset"}):((!l.dataset.head||u.objectIsEmpty(l.dataset.head))&&(u.error({componentName:"VueUiCarouselTable",type:"datasetAttribute",property:"head"}),m.value=!1),(!l.dataset.body||u.objectIsEmpty(l.dataset.body))&&(u.error({componentName:"VueUiCarouselTable",type:"datasetAttribute",property:"body"}),m.value=!1))});const t=e.computed(()=>te.useNestedProp({userConfig:l.config,defaultConfig:j})),{isPrinting:I,isImaging:P,generatePdf:X,generateImage:F}=D.usePrinter({elementId:`carousel-table_${A.value}`,fileName:t.value.caption.text||"vue-ui-carousel-table"}),s=e.ref({showAnimation:t.value.animation.use}),i=e.ref(null),N=e.ref(null),h=e.ref(null),g=e.ref(null),b=e.ref(0),B=e.ref(0),$=e.ref(!1),y=e.ref(null),v=e.ref(null),k=e.ref(0);function R(){y.value&&(v.value={elements:y.value.getElementsByTagName("tr"),heights:Array.from(y.value.getElementsByTagName("tr")).map(o=>o.getBoundingClientRect().height)})}e.onMounted(R);const J=e.computed(()=>!v.value||!v.value.heights.length?0:Math.max(...v.value.heights)+b.value+B.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+b.value+B.value),w=e.ref(0),C=e.ref(null),T=e.ref(0),p=e.ref(!1),O=e.ref(0);e.onMounted(()=>{h.value&&(b.value=h.value.getBoundingClientRect().height),g.value&&(B.value=g.value.getBoundingClientRect().height),s.value.showAnimation&&v.value&&V()}),e.onMounted(()=>{if(i.value){let a=function(){const r=o.getBoundingClientRect().bottom;n.forEach(d=>{d.getBoundingClientRect().top<r?d.style.visibility="hidden":d.style.visibility="visible"})};const o=i.value.querySelector("thead"),n=Array.from(y.value.querySelectorAll("tr"));i.value.addEventListener("scroll",a),a(),e.onBeforeUnmount(()=>{i.value.removeEventListener("scroll",a)})}});function W(o){z.value=o,O.value+=1}function V(){!C.value&&!p.value&&(C.value=requestAnimationFrame(L))}function Y(){if(!i.value)return!1;const{scrollTop:o,scrollHeight:n,clientHeight:a}=i.value;return o+a>=n}function L(o){if(p.value)return;T.value||(T.value=o),o-T.value>=t.value.animation.speedMs&&(w.value+=v.value.heights[k.value],(Y()||k.value>=v.value.heights.length)&&(w.value=0,k.value=-1),k.value+=1,i.value&&i.value.scrollTo({top:w.value,behavior:"smooth"}),T.value=o),C.value=requestAnimationFrame(L)}function f(){p.value=!0,cancelAnimationFrame(C.value),C.value=null}e.onBeforeUnmount(f);function x(){!p.value||!s.value.showAnimation||(p.value=!1,T.value=0,V())}function Z(){t.value.animation.pauseOnHover&&f()}const S=e.ref(null);function _(){f(),clearTimeout(S.value)}function M(){clearTimeout(S.value),S.value=setTimeout(x,1e3)}e.watch(()=>t.value.animation.use,o=>{o?(s.value.showAnimation=!0,x()):(s.value.showAnimation=!1,f())});const ee=e.computed(()=>t.value.responsiveBreakpoint);e.onMounted(()=>{const o=new ResizeObserver(n=>{n.forEach(a=>{$.value=a.contentRect.width<ee.value}),b.value=h.value?h.value.getBoundingClientRect().height:0,B.value=g.value?g.value.getBoundingClientRect().height:0,k.value=0,R()});i.value&&o.observe(i.value)});function q(){X()}function H(){s.value.showAnimation=!s.value.showAnimation,s.value.showAnimation?x():f()}function U(){e.nextTick(()=>{const o=l.dataset.head.map((r,d)=>[[l.dataset.body[d]]]),n=[[t.value.caption.text],[l.dataset.head.map(r=>[r])]].concat(o),a=u.createCsvContent(n);u.downloadCsv({csvContent:a,title:t.value.caption.text||"vue-ui-carousel-table"})})}return G({pauseAnimation:f,resumeAnimation:x,toggleAnimation:H,generateCsv:U,generatePdf:q,generateImage:F}),(o,n)=>(e.openBlock(),e.createElementBlock("div",{style:{position:"relative",overflow:"visible"},ref_key:"chartContainer",ref:N},[e.createElementVNode("div",{ref_key:"tableContainer",ref:i,id:`carousel-table_${A.value}`,style:e.normalizeStyle({height:e.unref(I)||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":!p.value}),onMouseenter:n[0]||(n[0]=a=>Z()),onMouseleave:n[1]||(n[1]=a=>x()),onTouchstart:n[2]||(n[2]=a=>_()),onTouchend:n[3]||(n[3]=a=>M()),onTouchcancel:n[4]||(n[4]=a=>M())},[m.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:h,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:`${b.value}px`,zIndex:1})},[e.createElementVNode("tr",{ref_key:"tableRow",ref:g,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(c.dataset.head,(a,r)=>(e.openBlock(),e.createElementBlock("th",{role:"cell",key:`th_${r}`,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?"":a)+" ",1),e.renderSlot(o.$slots,"th",e.normalizeProps(e.guardReactiveProps({th:a,colIndex:r})),void 0,!0)],4))),128))],12,le)],4),c.dataset.body&&c.dataset.head?(e.openBlock(),e.createElementBlock("tbody",{key:0,ref_key:"tbody",ref:y,style:e.normalizeStyle({clipPath:"inset(0,0,0,0)"})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.dataset.body,(a,r)=>(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(a,(d,E)=>(e.openBlock(),e.createElementBlock("td",{role:"cell","data-cell":c.dataset.head[E]||"",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(u.opacity)[r%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?"":d)+" ",1),e.renderSlot(o.$slots,"td",e.normalizeProps(e.guardReactiveProps({td:d,rowIndex:r,colIndex:E})),void 0,!0)],12,re))),256))],4))),256))],4)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0)],46,ne),m.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(oe.default,{key:0,config:{type:"table"}})),t.value.userOptions.show&&m.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(I),isImaging:e.unref(P),uid:A.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:!s.value.showAnimation,hasFullscreen:t.value.userOptions.buttons.fullscreen,isFullscreen:z.value,chartElement:N.value,titles:{...t.value.userOptions.buttonTitles},zIndex:3,noOffset:"",onGeneratePdf:q,onGenerateCsv:U,onGenerateImage:e.unref(F),onToggleAnimation:H,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:a,isFullscreen:r})=>[e.renderSlot(o.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:a,isFullscreen:r})),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-f722c10b"]]);exports.default=ue;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { useCssVars as Me, computed as $, ref as z, onMounted as je, openBlock as a, createElementBlock as o, normalizeClass as m, normalizeStyle as h, createBlock as ee, unref as n, createSlots as Xe, withCtx as U, renderSlot as j, normalizeProps as be, guardReactiveProps as pe, createCommentVNode as b, toDisplayString as c, createElementVNode as s, Fragment as p, renderList as g, createTextVNode as W, withKeys as Oe, createVNode as Ge, nextTick as ge } from "vue";
|
|
2
|
-
import { u as Ee, c as Ae, t as Ue, a as De, p as I, b as Ye, g as te, e as K, d as le, o as qe, X as He, s as _e, v as S, i as G, f as T, D as xe, m as me, j as We, k as P, n as H, q as Ke, r as Je } from "./index-
|
|
3
|
-
import { u as Qe, U as Ze } from "./usePrinter-
|
|
4
|
-
import et from "./vue-ui-skeleton-
|
|
5
|
-
import tt from "./BaseIcon-
|
|
6
|
-
import lt from "./vue-ui-accordion-
|
|
7
|
-
import { u as ke } from "./useNestedProp-
|
|
2
|
+
import { u as Ee, c as Ae, t as Ue, a as De, p as I, b as Ye, g as te, e as K, d as le, o as qe, X as He, s as _e, v as S, i as G, f as T, D as xe, m as me, j as We, k as P, n as H, q as Ke, r as Je } from "./index-CQyrBpOX.js";
|
|
3
|
+
import { u as Qe, U as Ze } from "./usePrinter-BJn_Etby.js";
|
|
4
|
+
import et from "./vue-ui-skeleton-CjYyI3Lv.js";
|
|
5
|
+
import tt from "./BaseIcon-E5xGjSQn.js";
|
|
6
|
+
import lt from "./vue-ui-accordion-DqRnuig6.js";
|
|
7
|
+
import { u as ke } from "./useNestedProp-CK_S9Ya9.js";
|
|
8
8
|
import { _ as at } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
9
9
|
const ot = ["id"], st = ["xmlns", "viewBox"], ut = { key: 0 }, nt = ["fill", "font-weight", "font-size", "x", "y"], rt = ["fill", "font-weight", "font-size", "x", "y"], it = ["id"], ct = ["stop-color"], dt = ["stop-color"], vt = ["id"], yt = ["stop-color"], ht = ["stop-color"], ft = ["id"], bt = ["stop-color"], pt = ["stop-color"], gt = ["stop-color"], _t = ["id"], xt = ["stop-color"], mt = ["stop-color"], kt = ["stop-color"], wt = ["id"], $t = ["stop-color"], Ct = ["stop-color"], zt = ["stop-color"], Tt = { key: 1 }, Nt = ["x", "y", "font-size", "font-weight", "fill"], St = ["x", "y", "font-size", "font-weight", "fill"], Ft = ["d", "stroke"], Lt = ["cx", "cy", "r", "fill"], It = ["cx", "cy", "r", "fill", "stroke", "stroke-width", "onClick"], Pt = { key: 2 }, Vt = ["x", "y", "font-size", "fill", "onClick"], Rt = { key: 0 }, Bt = ["x", "y", "fill", "font-size", "font-weight"], Mt = ["x", "y", "height", "width", "fill", "rx", "onClick"], jt = ["x", "y", "height", "width", "fill", "rx", "stroke", "stroke-width", "onClick"], Xt = { key: 3 }, Ot = ["x", "y", "fill", "font-size", "onClick"], Gt = ["d", "stroke"], Et = ["cx", "cy", "fill", "onClick"], At = ["fill", "cx", "cy", "r", "onClick"], Ut = { key: 4 }, Dt = ["x", "y", "font-size", "font-weight", "fill"], Yt = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], qt = ["y", "height", "width"], Ht = { style: { width: "100%", height: "100%", display: "flex", "align-items": "center", "justify-content": "center", "flex-direction": "column" } }, Wt = { style: { display: "flex", "align-items": "center", "justify-content": "center", gap: "12px", "flex-wrap": "wrap", "flex-direction": "row" } }, Kt = {
|
|
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"),o=require("./index-6dSPekJy.cjs"),Y=require("./usePrinter-Si0o8ws0.cjs"),ce=require("./vue-ui-skeleton-BnEVwnIx.cjs"),ie=require("./BaseIcon-BoEJRb0e.cjs"),de=require("./vue-ui-accordion-COKJwPZR.cjs"),H=require("./useNestedProp-C0FeJ2Gu.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"],be=["id"],ge=["stop-color"],ke=["stop-color"],_e=["id"],xe=["stop-color"],Be=["stop-color"],Ee=["id"],Ne=["stop-color"],Se=["stop-color"],ze=["stop-color"],Ce=["id"],we=["stop-color"],Ve=["stop-color"],$e=["stop-color"],Te=["id"],Fe=["stop-color"],Le=["stop-color"],De=["stop-color"],Ie={key:1},Me=["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"],bt=["cx","cy","fill"],gt=["x","y","fill","font-size","font-weight"],kt=["x","y","fill","font-size","font-weight"],_t=["x","text-anchor","y","fill","font-size"],xt=["x","text-anchor","y","fill","font-size"],Bt=["x","text-anchor","y","fill","font-size"],Et=["x","text-anchor","y","fill","font-size"],Nt=["x","text-anchor","y","fill","font-size"],St=["x","y","font-size","fill"],zt=["x","y","font-size","fill"],Ct=["x","y","font-size","fill"],wt={key:2,class:"vue-data-ui-watermark"},Vt={style:{"padding-top":"36px",position:"relative"}},$t={class:"vue-ui-data-table"},Tt={key:0},Ft=["data-cell"],Lt={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},Dt={key:0},It={key:1},Mt=["data-cell"],Pt={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},Ot={key:0},Rt={key:1},Xt=["data-cell"],jt={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},At={key:0},Gt={key:1},Ut=["data-cell"],qt={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},Yt={key:0},Ht={key:1},Wt=["data-cell"],Kt={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},Jt={key:0},Qt={key:1},Zt=["data-cell"],el={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},tl={key:0},ll={key:1},al=["data-cell"],ol={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},nl={key:0},rl={key:1},sl=["data-cell"],ul={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},cl=["data-cell"],il={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},dl=["data-cell"],yl={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},vl=["data-cell"],hl={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},pl=["data-cell"],fl={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},ml={__name:"vue-ui-chestnut",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectRoot","selectBranch","selectNut"],setup(W,{expose:K,emit:S}){const _=W;e.useCssVars(a=>({"545cdfba":a.tdo}));const{vue_ui_chestnut:J}=o.useConfig(),C=e.computed(()=>!!_.dataset&&_.dataset.length),h=e.ref(o.createUid()),L=e.ref(null),Q=e.ref(null),D=e.ref(0),t=e.computed(()=>{const a=H.useNestedProp({userConfig:_.config,defaultConfig:J});return a.theme?{...H.useNestedProp({userConfig:o.themes.vue_ui_chestnut[a.theme]||_.config,defaultConfig:a}),customPalette:o.themePalettes[a.theme]||o.palette}:a}),{isPrinting:I,isImaging:M,generatePdf:P,generateImage:O}=Y.usePrinter({elementId:`vue-ui-chestnut_${h.value}`,fileName:t.value.style.chart.layout.title.text||"vue-ui-chestnut"}),$=e.computed(()=>o.convertCustomPalette(t.value.customPalette)),w=e.ref({showTable:t.value.table.show}),R=e.ref(null),X=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})),k=e.computed(()=>C.value?_.dataset.flatMap(a=>a.branches.map(s=>s.value)).reduce((a,s)=>a+s):0),m=e.computed(()=>(_.dataset.forEach((a,s)=>{o.getMissingDatasetAttributes({datasetObject:a,requiredAttributes:["name","branches"]}).forEach(l=>{o.error({componentName:"VueUiChestnut",type:"datasetSerieAttribute",property:l,index:s})}),a.branches&&a.branches.forEach((l,n)=>{o.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","value"]}).forEach(d=>{o.error({componentName:"VueUiChestnut",type:"datasetSerieAttribute",property:d,index:`${s} - ${n}`})}),l.breakdown&&l.breakdown.forEach((d,i)=>{o.getMissingDatasetAttributes({datasetObject:d,requiredAttributes:["name","value"]}).forEach(y=>{o.error({componentName:"VueUiChestnut",type:"datasetSerieAttribute",property:y,index:`${s} - ${n} - ${i}`})})})})}),_.dataset.map((a,s)=>{const l=a.branches.map(n=>n.value).reduce((n,d)=>n+d);return{...a,color:o.convertColorToHex(a.color)||$.value[s]||o.palette[s]||o.palette[s%o.palette.length],id:a.id||`root_${s}_${h.value}`,type:"root",total:l,rootIndex:s,branches:a.branches.map((n,d)=>({...n,rootName:a.name,rootIndex:s,color:o.convertColorToHex(a.color)||$.value[s]||o.palette[s]||o.palette[s%o.palette.length],value:n.value>=0?n.value:0,id:n.id||`branch_${s}_${d}_${h.value}`,proportionToRoot:n.value/l,type:"branch",breakdown:n.breakdown.map((i,y)=>({table:{rootName:a.name,rootValue:l,rootToTotal:l/k.value,branchName:n.name,branchValue:n.value,branchToTotal:n.value/k.value,branchToRoot:n.value/l,nutName:i.name,nutValue:i.value,nutToTotal:i.value/k.value,nutToRoot:i.value/l,nutToBranch:i.value/n.value},...i,type:"nut",branchName:n.name,rootName:a.name,branchTotal:n.value>=0?n.value:0,proportionToBranch:i.value/n.value,proportionToRoot:i.value/l,proportionToTree:i.value/k.value,rootIndex:s,id:i.id||`nut_${s}_${d}_${y}_${h.value}`,color:o.convertColorToHex(i.color)||$.value[y]||o.palette[y]||o.palette[y%o.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)))),j=e.computed(()=>256+r.value.padding.left),E=e.computed(()=>m.value.sort((a,s)=>s.total-a.total).map((a,s)=>{const l=f.value.height/m.value.length/2,n=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:n<r.value.branchSize/2?r.value.branchSize/2:n}})),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(()=>E.value.flatMap(a=>a.branches)),x=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:j.value,x2:384*a.value/ae.value*oe.value+j.value})));function T(a){const s=E.value.find(l=>l.rootIndex===a.rootIndex);return{x:s.x,y:s.y,r:s.r}}const c=e.ref(null),B=e.ref(null),v=e.ref(null),b=e.ref(null);function p(){c.value=null,v.value=null,b.value=null}function g(a){return b.value?b.value===null?!0:a.type==="root"?a.id===b.value.id:a.rootIndex===b.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 A(a){p(),e.nextTick(()=>{c.value=a,v.value=a,B.value=o.makeDonut({series:a.breakdown,base:1},a.x2+24+t.value.style.chart.layout.nuts.offsetX,a.y1+r.value.branchSize/2,80,80),S("selectNut",a.breakdown)})}function N(){c.value=null,B.value=null,S("selectNut",null)}function F(a){v.value&&v.value.id===a.id?(v.value=null,p(),S("selectBranch",null)):(p(),v.value=a,S("selectBranch",a))}function G(a){b.value&&b.value.id===a.id?(p(),S("selectRoot",null)):(p(),b.value=a,S("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=>{X.value=l.contentRect.width<Z.value})}).observe(R.value)}e.onMounted(()=>{o.objectIsEmpty(_.dataset)&&o.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,n)=>l.branches.flatMap((d,i)=>d.breakdown.flatMap((y,gl)=>y.table)));return{head:a,body:s}});function U(){e.nextTick(()=>{const a=[[t.value.style.chart.layout.title.text],[t.value.style.chart.layout.title.subtitle.text],[""],["Grand total",k.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]),n=a.concat([s]).concat(l),d=o.createCsvContent(n);o.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,D.value+=1}function q(){w.value.showTable=!w.value.showTable}return K({getData:ee,generatePdf:P,generateCsv:U,generateImage:O,toggleTable:q}),(a,s)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(`vue-ui-chestnut ${V.value?"vue-data-ui-wrapper-fullscreen":""}`),ref_key:"chestnutChart",ref:L,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(Y.UserOptions,{ref_key:"details",ref:Q,key:`user_options_${D.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isImaging:e.unref(M),isPrinting:e.unref(I),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:L.value,onToggleFullscreen:ue,onGeneratePdf:e.unref(P),onGenerateCsv:U,onGenerateImage:e.unref(O),onToggleTable:q},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:n})=>[e.renderSlot(a.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:l,isFullscreen:n})),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(o.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,n)=>(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(o.shiftHue)(l.color,.05)}${e.unref(o.opacity)[100-t.value.style.chart.layout.roots.gradientIntensity]}`},null,8,ge),e.createElementVNode("stop",{offset:"100%","stop-color":l.color},null,8,ke)],8,be))),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,xe),e.createElementVNode("stop",{offset:"100%","stop-color":`${e.unref(o.shiftHue)(l.color,.02)}${e.unref(o.opacity)[100-t.value.style.chart.layout.branches.gradientIntensity]}`},null,8,Be)],8,_e))),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(o.opacity)[0]}`},null,8,Ne),e.createElementVNode("stop",{offset:"80%","stop-color":`#FFFFFF${e.unref(o.opacity)[t.value.style.chart.layout.nuts.selected.gradientIntensity]}`},null,8,Se),e.createElementVNode("stop",{offset:"100%","stop-color":`#FFFFFF${e.unref(o.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(o.opacity)[0]}`},null,8,we),e.createElementVNode("stop",{offset:"80%","stop-color":`#FFFFFF${e.unref(o.opacity)[t.value.style.chart.layout.nuts.gradientIntensity]}`},null,8,Ve),e.createElementVNode("stop",{offset:"100%","stop-color":`#FFFFFF${e.unref(o.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(o.opacity)[100]}`},null,8,Fe),e.createElementVNode("stop",{offset:"80%","stop-color":`${t.value.style.chart.backgroundColor}${e.unref(o.opacity)[60]}`},null,8,Le),e.createElementVNode("stop",{offset:"100%","stop-color":`${t.value.style.chart.backgroundColor}${e.unref(o.opacity)[0]}`},null,8,De)],8,Te)]),t.value.style.chart.layout.grandTotal.show?(e.openBlock(),e.createElementBlock("g",Ie,[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,Me),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(e.unref(o.applyDataLabel)(t.value.style.chart.layout.grandTotal.formatter,k.value,e.unref(o.dataLabel)({p:t.value.style.chart.layout.grandTotal.prefix,v:k.value,s:t.value.style.chart.layout.grandTotal.suffix,r:t.value.style.chart.layout.grandTotal.roundingValue}))),9,Pe)])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(x.value,l=>(e.openBlock(),e.createElementBlock("g",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value.branchSize,(n,d)=>(e.openBlock(),e.createElementBlock("path",{d:`M
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),o=require("./index-COMTToJY.cjs"),Y=require("./usePrinter-THxtdQMP.cjs"),ce=require("./vue-ui-skeleton-DYdGA7uQ.cjs"),ie=require("./BaseIcon-Cfy7hUAu.cjs"),de=require("./vue-ui-accordion-BDkYau8u.cjs"),H=require("./useNestedProp-DJwc68Re.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"],be=["id"],ge=["stop-color"],ke=["stop-color"],_e=["id"],xe=["stop-color"],Be=["stop-color"],Ee=["id"],Ne=["stop-color"],Se=["stop-color"],ze=["stop-color"],Ce=["id"],we=["stop-color"],Ve=["stop-color"],$e=["stop-color"],Te=["id"],Fe=["stop-color"],Le=["stop-color"],De=["stop-color"],Ie={key:1},Me=["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"],bt=["cx","cy","fill"],gt=["x","y","fill","font-size","font-weight"],kt=["x","y","fill","font-size","font-weight"],_t=["x","text-anchor","y","fill","font-size"],xt=["x","text-anchor","y","fill","font-size"],Bt=["x","text-anchor","y","fill","font-size"],Et=["x","text-anchor","y","fill","font-size"],Nt=["x","text-anchor","y","fill","font-size"],St=["x","y","font-size","fill"],zt=["x","y","font-size","fill"],Ct=["x","y","font-size","fill"],wt={key:2,class:"vue-data-ui-watermark"},Vt={style:{"padding-top":"36px",position:"relative"}},$t={class:"vue-ui-data-table"},Tt={key:0},Ft=["data-cell"],Lt={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},Dt={key:0},It={key:1},Mt=["data-cell"],Pt={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},Ot={key:0},Rt={key:1},Xt=["data-cell"],jt={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},At={key:0},Gt={key:1},Ut=["data-cell"],qt={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},Yt={key:0},Ht={key:1},Wt=["data-cell"],Kt={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},Jt={key:0},Qt={key:1},Zt=["data-cell"],el={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},tl={key:0},ll={key:1},al=["data-cell"],ol={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},nl={key:0},rl={key:1},sl=["data-cell"],ul={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},cl=["data-cell"],il={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},dl=["data-cell"],yl={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},vl=["data-cell"],hl={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},pl=["data-cell"],fl={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},ml={__name:"vue-ui-chestnut",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectRoot","selectBranch","selectNut"],setup(W,{expose:K,emit:S}){const _=W;e.useCssVars(a=>({"545cdfba":a.tdo}));const{vue_ui_chestnut:J}=o.useConfig(),C=e.computed(()=>!!_.dataset&&_.dataset.length),h=e.ref(o.createUid()),L=e.ref(null),Q=e.ref(null),D=e.ref(0),t=e.computed(()=>{const a=H.useNestedProp({userConfig:_.config,defaultConfig:J});return a.theme?{...H.useNestedProp({userConfig:o.themes.vue_ui_chestnut[a.theme]||_.config,defaultConfig:a}),customPalette:o.themePalettes[a.theme]||o.palette}:a}),{isPrinting:I,isImaging:M,generatePdf:P,generateImage:O}=Y.usePrinter({elementId:`vue-ui-chestnut_${h.value}`,fileName:t.value.style.chart.layout.title.text||"vue-ui-chestnut"}),$=e.computed(()=>o.convertCustomPalette(t.value.customPalette)),w=e.ref({showTable:t.value.table.show}),R=e.ref(null),X=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})),k=e.computed(()=>C.value?_.dataset.flatMap(a=>a.branches.map(s=>s.value)).reduce((a,s)=>a+s):0),m=e.computed(()=>(_.dataset.forEach((a,s)=>{o.getMissingDatasetAttributes({datasetObject:a,requiredAttributes:["name","branches"]}).forEach(l=>{o.error({componentName:"VueUiChestnut",type:"datasetSerieAttribute",property:l,index:s})}),a.branches&&a.branches.forEach((l,n)=>{o.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","value"]}).forEach(d=>{o.error({componentName:"VueUiChestnut",type:"datasetSerieAttribute",property:d,index:`${s} - ${n}`})}),l.breakdown&&l.breakdown.forEach((d,i)=>{o.getMissingDatasetAttributes({datasetObject:d,requiredAttributes:["name","value"]}).forEach(y=>{o.error({componentName:"VueUiChestnut",type:"datasetSerieAttribute",property:y,index:`${s} - ${n} - ${i}`})})})})}),_.dataset.map((a,s)=>{const l=a.branches.map(n=>n.value).reduce((n,d)=>n+d);return{...a,color:o.convertColorToHex(a.color)||$.value[s]||o.palette[s]||o.palette[s%o.palette.length],id:a.id||`root_${s}_${h.value}`,type:"root",total:l,rootIndex:s,branches:a.branches.map((n,d)=>({...n,rootName:a.name,rootIndex:s,color:o.convertColorToHex(a.color)||$.value[s]||o.palette[s]||o.palette[s%o.palette.length],value:n.value>=0?n.value:0,id:n.id||`branch_${s}_${d}_${h.value}`,proportionToRoot:n.value/l,type:"branch",breakdown:n.breakdown.map((i,y)=>({table:{rootName:a.name,rootValue:l,rootToTotal:l/k.value,branchName:n.name,branchValue:n.value,branchToTotal:n.value/k.value,branchToRoot:n.value/l,nutName:i.name,nutValue:i.value,nutToTotal:i.value/k.value,nutToRoot:i.value/l,nutToBranch:i.value/n.value},...i,type:"nut",branchName:n.name,rootName:a.name,branchTotal:n.value>=0?n.value:0,proportionToBranch:i.value/n.value,proportionToRoot:i.value/l,proportionToTree:i.value/k.value,rootIndex:s,id:i.id||`nut_${s}_${d}_${y}_${h.value}`,color:o.convertColorToHex(i.color)||$.value[y]||o.palette[y]||o.palette[y%o.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)))),j=e.computed(()=>256+r.value.padding.left),E=e.computed(()=>m.value.sort((a,s)=>s.total-a.total).map((a,s)=>{const l=f.value.height/m.value.length/2,n=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:n<r.value.branchSize/2?r.value.branchSize/2:n}})),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(()=>E.value.flatMap(a=>a.branches)),x=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:j.value,x2:384*a.value/ae.value*oe.value+j.value})));function T(a){const s=E.value.find(l=>l.rootIndex===a.rootIndex);return{x:s.x,y:s.y,r:s.r}}const c=e.ref(null),B=e.ref(null),v=e.ref(null),b=e.ref(null);function p(){c.value=null,v.value=null,b.value=null}function g(a){return b.value?b.value===null?!0:a.type==="root"?a.id===b.value.id:a.rootIndex===b.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 A(a){p(),e.nextTick(()=>{c.value=a,v.value=a,B.value=o.makeDonut({series:a.breakdown,base:1},a.x2+24+t.value.style.chart.layout.nuts.offsetX,a.y1+r.value.branchSize/2,80,80),S("selectNut",a.breakdown)})}function N(){c.value=null,B.value=null,S("selectNut",null)}function F(a){v.value&&v.value.id===a.id?(v.value=null,p(),S("selectBranch",null)):(p(),v.value=a,S("selectBranch",a))}function G(a){b.value&&b.value.id===a.id?(p(),S("selectRoot",null)):(p(),b.value=a,S("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=>{X.value=l.contentRect.width<Z.value})}).observe(R.value)}e.onMounted(()=>{o.objectIsEmpty(_.dataset)&&o.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,n)=>l.branches.flatMap((d,i)=>d.breakdown.flatMap((y,gl)=>y.table)));return{head:a,body:s}});function U(){e.nextTick(()=>{const a=[[t.value.style.chart.layout.title.text],[t.value.style.chart.layout.title.subtitle.text],[""],["Grand total",k.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]),n=a.concat([s]).concat(l),d=o.createCsvContent(n);o.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,D.value+=1}function q(){w.value.showTable=!w.value.showTable}return K({getData:ee,generatePdf:P,generateCsv:U,generateImage:O,toggleTable:q}),(a,s)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(`vue-ui-chestnut ${V.value?"vue-data-ui-wrapper-fullscreen":""}`),ref_key:"chestnutChart",ref:L,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(Y.UserOptions,{ref_key:"details",ref:Q,key:`user_options_${D.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isImaging:e.unref(M),isPrinting:e.unref(I),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:L.value,onToggleFullscreen:ue,onGeneratePdf:e.unref(P),onGenerateCsv:U,onGenerateImage:e.unref(O),onToggleTable:q},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:n})=>[e.renderSlot(a.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:l,isFullscreen:n})),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(o.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,n)=>(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(o.shiftHue)(l.color,.05)}${e.unref(o.opacity)[100-t.value.style.chart.layout.roots.gradientIntensity]}`},null,8,ge),e.createElementVNode("stop",{offset:"100%","stop-color":l.color},null,8,ke)],8,be))),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,xe),e.createElementVNode("stop",{offset:"100%","stop-color":`${e.unref(o.shiftHue)(l.color,.02)}${e.unref(o.opacity)[100-t.value.style.chart.layout.branches.gradientIntensity]}`},null,8,Be)],8,_e))),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(o.opacity)[0]}`},null,8,Ne),e.createElementVNode("stop",{offset:"80%","stop-color":`#FFFFFF${e.unref(o.opacity)[t.value.style.chart.layout.nuts.selected.gradientIntensity]}`},null,8,Se),e.createElementVNode("stop",{offset:"100%","stop-color":`#FFFFFF${e.unref(o.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(o.opacity)[0]}`},null,8,we),e.createElementVNode("stop",{offset:"80%","stop-color":`#FFFFFF${e.unref(o.opacity)[t.value.style.chart.layout.nuts.gradientIntensity]}`},null,8,Ve),e.createElementVNode("stop",{offset:"100%","stop-color":`#FFFFFF${e.unref(o.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(o.opacity)[100]}`},null,8,Fe),e.createElementVNode("stop",{offset:"80%","stop-color":`${t.value.style.chart.backgroundColor}${e.unref(o.opacity)[60]}`},null,8,Le),e.createElementVNode("stop",{offset:"100%","stop-color":`${t.value.style.chart.backgroundColor}${e.unref(o.opacity)[0]}`},null,8,De)],8,Te)]),t.value.style.chart.layout.grandTotal.show?(e.openBlock(),e.createElementBlock("g",Ie,[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,Me),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(e.unref(o.applyDataLabel)(t.value.style.chart.layout.grandTotal.formatter,k.value,e.unref(o.dataLabel)({p:t.value.style.chart.layout.grandTotal.prefix,v:k.value,s:t.value.style.chart.layout.grandTotal.suffix,r:t.value.style.chart.layout.grandTotal.roundingValue}))),9,Pe)])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(x.value,l=>(e.openBlock(),e.createElementBlock("g",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value.branchSize,(n,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-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("vue"),_=require("./useNestedProp-DJwc68Re.cjs"),i=require("./index-COMTToJY.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-
|
|
3
|
-
import { u as O, c as B, X as N, v as T } from "./index-
|
|
2
|
+
import { u as z } from "./useNestedProp-CK_S9Ya9.js";
|
|
3
|
+
import { u as O, c as B, X as N, v as T } from "./index-CQyrBpOX.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,7 +1,7 @@
|
|
|
1
1
|
import { useCssVars as J, computed as _, ref as r, watch as K, openBlock as w, createElementBlock as y, createElementVNode as g, normalizeStyle as z, createCommentVNode as I, Fragment as D, renderList as Q, normalizeClass as Z, renderSlot as ee, pushScopeId as te, popScopeId as oe, createStaticVNode as ae } from "vue";
|
|
2
2
|
import { p as le } from "./pdf-97UbtKC2.js";
|
|
3
|
-
import { u as ue } from "./useNestedProp-
|
|
4
|
-
import { u as ne } from "./index-
|
|
3
|
+
import { u as ue } from "./useNestedProp-CK_S9Ya9.js";
|
|
4
|
+
import { u as ne } from "./index-CQyrBpOX.js";
|
|
5
5
|
import { _ as se } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
6
6
|
const ie = (M) => (te("data-v-57895b3a"), M = M(), oe(), M), re = {
|
|
7
7
|
key: 0,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("vue"),R=require("./pdf-Cz3729tZ.cjs"),q=require("./useNestedProp-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("vue"),R=require("./pdf-Cz3729tZ.cjs"),q=require("./useNestedProp-DJwc68Re.cjs"),O=require("./index-COMTToJY.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 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("vue"),g=require("./useNestedProp-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("vue"),g=require("./useNestedProp-DJwc68Re.cjs"),L=require("./index-COMTToJY.cjs"),f={key:0},m=["d","fill"],k=["d","fill"],h=["d","fill"],v=["d","fill"],C=["d","fill"],N=["d","fill"],b=["d","fill"],B={key:1},E=["cx","cy","fill"],q={__name:"Digit",props:{quanta:{type:String,default:null},backgroundColor:{type:String,default:"#e1e5e8"},color:{type:String,default:"#000000"},x:{type:Number,default:0},y:{type:Number,default:0}},setup(e){const u=e,$=t.ref({0:"1111110",1:"0110000",2:"1101101",3:"1111001",4:"0110011",5:"1011011",6:"1011111",7:"1110000",8:"1111111",9:"1111011","-":"0000001",X:"0000000"}),l=t.computed(()=>[void 0,null].includes(u.quanta)?$.value.X:$.value[u.quanta]);return(a,x)=>(t.openBlock(),t.createElementBlock(t.Fragment,null,[[void 0,null,"."].includes(e.quanta)?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("g",f,[t.createElementVNode("path",{d:`M ${e.x} ${e.y} L ${e.x+2} ${e.y-2} L ${e.x+24} ${e.y-2} L ${e.x+26} ${e.y} L ${e.x+24} ${e.y+2} L ${e.x+2} ${e.y+2}Z`,fill:l.value[0]==1?e.color:e.backgroundColor,stroke:"none"},null,8,m),t.createElementVNode("path",{d:`M ${e.x+26} ${e.y+26} L ${e.x+26} ${e.y+4} L ${e.x+28} ${e.y+2} L ${e.x+30} ${e.y+4} L ${e.x+30} ${e.y+26} L ${e.x+28} ${e.y+28} L ${e.x+26} ${e.y+26}`,fill:l.value[1]==1?e.color:e.backgroundColor,stroke:"none"},null,8,k),t.createElementVNode("path",{d:`M ${e.x+26} ${e.y+56} L ${e.x+26} ${e.y+34} L ${e.x+28} ${e.y+32} L ${e.x+30} ${e.y+34} L ${e.x+30} ${e.y+56} L ${e.x+28} ${e.y+58} L ${e.x+26} ${e.y+56}`,fill:l.value[2]==1?e.color:e.backgroundColor,stroke:"none"},null,8,h),t.createElementVNode("path",{d:`M ${e.x+2} ${e.y+58} L ${e.x} ${e.y+60} L ${e.x+2} ${e.y+62} L ${e.x+24} ${e.y+62} L ${e.x+26} ${e.y+60} L ${e.x+24} ${e.y+58} L ${e.x+2} ${e.y+58}`,fill:l.value[3]==1?e.color:e.backgroundColor,stroke:"none"},null,8,v),t.createElementVNode("path",{d:`M ${e.x} ${e.y+34} L ${e.x-2} ${e.y+32} L ${e.x-4} ${e.y+34} L ${e.x-4} ${e.y+56} L ${e.x-2} ${e.y+58} L ${e.x} ${e.y+56} L ${e.x} ${e.y+34}`,fill:l.value[4]==1?e.color:e.backgroundColor,stroke:"none"},null,8,C),t.createElementVNode("path",{d:`M ${e.x-2} ${e.y+2} L ${e.x} ${e.y+4} L ${e.x} ${e.y+26} L ${e.x-2} ${e.y+28} L ${e.x-4} ${e.y+26} L ${e.x-4} ${e.y+4} L ${e.x-2} ${e.y+2}`,fill:l.value[5]==1?e.color:e.backgroundColor,stroke:"none"},null,8,N),t.createElementVNode("path",{d:`M ${e.x+2} ${e.y+28} L ${e.x} ${e.y+30} L ${e.x+2} ${e.y+32} L ${e.x+24} ${e.y+32} L ${e.x+26} ${e.y+30} L ${e.x+24} ${e.y+28} L ${e.x+2} ${e.y+28}`,fill:l.value[6]==1?e.color:e.backgroundColor,stroke:"none"},null,8,b)])),e.quanta=="."?(t.openBlock(),t.createElementBlock("g",B,[t.createElementVNode("circle",{cx:e.x-8,cy:e.y+60,r:3,fill:e.color},null,8,E)])):t.createCommentVNode("",!0)],64))}},M=["xmlns","viewBox"],V={__name:"vue-ui-digits",props:{dataset:{type:Number,default:0},config:{type:Object,default(){return{}}}},setup(e){const u=e,{vue_ui_digits:$}=L.useConfig(),l=t.computed(()=>g.useNestedProp({userConfig:u.config,defaultConfig:$})),a=t.computed(()=>{const c=(u.dataset||0).toString().split(""),d=[],n={x:10,y:10};let i=0;for(let y=0;y<c.length;y+=1){const o=c[y];d.push({x:n.x+i,y:n.y,quanta:o}),o=="."?i+=2:i+=44}return d}),x=t.computed(()=>Math.max(...a.value.map(c=>c.x))+36);return(c,d)=>(t.openBlock(),t.createElementBlock("svg",{xmlns:t.unref(L.XMLNS),viewBox:`0 0 ${x.value} 80`,style:t.normalizeStyle(`background:${l.value.backgroundColor};${l.value.height?`height:${l.value.height};`:""}${l.value.width?`width:${l.value.width}`:""}`)},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(a.value,n=>(t.openBlock(),t.createBlock(q,{x:n.x,y:n.y,quanta:n.quanta,color:l.value.digits.color,backgroundColor:l.value.digits.skeletonColor},null,8,["x","y","quanta","color","backgroundColor"]))),256))],12,M))}};exports.default=V;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ref as k, computed as d, openBlock as $, createElementBlock as i, Fragment as o, createElementVNode as l, createCommentVNode as m, unref as v, normalizeStyle as C, renderList as b, createBlock as N } from "vue";
|
|
2
|
-
import { u as q } from "./useNestedProp-
|
|
3
|
-
import { u as M, X as S } from "./index-
|
|
2
|
+
import { u as q } from "./useNestedProp-CK_S9Ya9.js";
|
|
3
|
+
import { u as M, X as S } from "./index-CQyrBpOX.js";
|
|
4
4
|
const w = { key: 0 }, B = ["d", "fill"], F = ["d", "fill"], X = ["d", "fill"], E = ["d", "fill"], I = ["d", "fill"], O = ["d", "fill"], A = ["d", "fill"], D = { key: 1 }, G = ["cx", "cy", "fill"], V = {
|
|
5
5
|
__name: "Digit",
|
|
6
6
|
props: {
|