vue-data-ui 2.3.8 → 2.3.10
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-CS3h3CsG.js → Arrow-BO8QA2_F.js} +1 -1
- package/dist/{Arrow-DUJvJpMd.cjs → Arrow-f4c5AEIv.cjs} +1 -1
- package/dist/{BaseIcon-ByV6y3w8.cjs → BaseIcon-BGeIE3vn.cjs} +1 -1
- package/dist/{BaseIcon-CVk_WG9x.js → BaseIcon-NaAlKaAM.js} +1 -1
- package/dist/{DataTable-C4CMZu2s.cjs → DataTable-CXkMZ3ja.cjs} +1 -1
- package/dist/{DataTable-B-LJlgjS.js → DataTable-R7hmQ0wl.js} +2 -2
- package/dist/{Legend-DVsCAbZS.js → Legend-BKBuWgj8.js} +1 -1
- package/dist/{Legend-DWBU0qDC.cjs → Legend-VoYDt_v5.cjs} +1 -1
- package/dist/{Shape-w47nQzLj.js → Shape-CCI8C_dI.js} +1 -1
- package/dist/{Shape-CcbBblwI.cjs → Shape-DH2ovwu7.cjs} +1 -1
- package/dist/{Slicer-2MG0k2PP.js → Slicer-C1zx1qMy.js} +1 -1
- package/dist/{Slicer-CY-QTbH4.cjs → Slicer-CPQW_sm_.cjs} +1 -1
- package/dist/{Title-D_FeWJsx.js → Title-DJ269q6H.js} +1 -1
- package/dist/{Title-D6zeMzr0.cjs → Title-gCBF7AU7.cjs} +1 -1
- package/dist/{Tooltip-BY94WbUk.js → Tooltip-CKKSlbSq.js} +1 -1
- package/dist/{Tooltip-2d9jRdHk.cjs → Tooltip-Qv4VexrA.cjs} +1 -1
- package/dist/{index-DLi6mPet.js → index-BK818aZo.js} +1 -1
- package/dist/{index-BQbaKiSm.cjs → index-Xau3hcRk.cjs} +1 -1
- package/dist/style.css +1 -1
- package/dist/{useNestedProp-B6CpIX-3.cjs → useNestedProp-C_EQ-Kxy.cjs} +1 -1
- package/dist/{useNestedProp-DmMzRJ1O.js → useNestedProp-hi25rRoY.js} +1 -1
- package/dist/{usePrinter-BnaEziDF.js → usePrinter-C-2KAW2f.js} +1 -1
- package/dist/{usePrinter-BANjHBXe.cjs → usePrinter-Dhvmhwhf.cjs} +1 -1
- package/dist/{vue-data-ui-Br12h04t.js → vue-data-ui-DPu_2hNJ.js} +55 -55
- package/dist/{vue-data-ui-DWSz421j.cjs → vue-data-ui-ifINAh05.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-CNpZvjQ1.js → vue-ui-3d-bar-BaR6gHYb.js} +7 -7
- package/dist/{vue-ui-3d-bar-BFu2IXOP.cjs → vue-ui-3d-bar-DPqaPUTZ.cjs} +1 -1
- package/dist/{vue-ui-accordion-CHVCSgY3.cjs → vue-ui-accordion-BjU8im6m.cjs} +1 -1
- package/dist/{vue-ui-accordion-DzCdp527.js → vue-ui-accordion-CH8K6f6J.js} +3 -3
- package/dist/{vue-ui-age-pyramid-CCezvPxx.js → vue-ui-age-pyramid-CDotLSiv.js} +8 -8
- package/dist/{vue-ui-age-pyramid-DaUZgLYc.cjs → vue-ui-age-pyramid-Dt9ILoAz.cjs} +1 -1
- package/dist/{vue-ui-annotator-CZ3Lk0Ky.cjs → vue-ui-annotator-C2bmdjLc.cjs} +1 -1
- package/dist/{vue-ui-annotator-QPK7ARtK.js → vue-ui-annotator-CoH_aFJm.js} +1 -1
- package/dist/{vue-ui-candlestick-CaofVEg_.cjs → vue-ui-candlestick-C5SjZVYs.cjs} +1 -1
- package/dist/{vue-ui-candlestick-kh_Ft3mr.js → vue-ui-candlestick-G_90YTDo.js} +9 -9
- package/dist/vue-ui-carousel-table-CptU7uki.cjs +1 -0
- package/dist/vue-ui-carousel-table-DzxLQOiB.js +330 -0
- package/dist/{vue-ui-chestnut-BypPYKEQ.js → vue-ui-chestnut-Cj5fJhR5.js} +6 -6
- package/dist/{vue-ui-chestnut-joiWg5ii.cjs → vue-ui-chestnut-D8RaQMzo.cjs} +1 -1
- package/dist/{vue-ui-cursor-CVwqSrVu.js → vue-ui-cursor-G8ixOooh.js} +2 -2
- package/dist/{vue-ui-cursor-CaxdcYVa.cjs → vue-ui-cursor-pZEn4NtN.cjs} +1 -1
- package/dist/{vue-ui-dashboard-B12glgQZ.cjs → vue-ui-dashboard-C46M9Oob.cjs} +1 -1
- package/dist/{vue-ui-dashboard-C7roqJdv.js → vue-ui-dashboard-CaMDg3iT.js} +2 -2
- package/dist/{vue-ui-digits-BeGGrWds.cjs → vue-ui-digits-BnzhiKJT.cjs} +1 -1
- package/dist/{vue-ui-digits-DZBXECIq.js → vue-ui-digits-CXTC7Ypr.js} +2 -2
- package/dist/{vue-ui-donut-DoMzPJHF.js → vue-ui-donut-Caan2HEG.js} +9 -9
- package/dist/{vue-ui-donut-diN8RiYm.cjs → vue-ui-donut-De--4Msd.cjs} +1 -1
- package/dist/{vue-ui-donut-evolution-CXT7c3_C.js → vue-ui-donut-evolution-CUV7vE4C.js} +9 -9
- package/dist/{vue-ui-donut-evolution-CTgTqsih.cjs → vue-ui-donut-evolution-DwPXJh13.cjs} +1 -1
- package/dist/{vue-ui-dumbbell-1StMWJ5B.js → vue-ui-dumbbell-2D7NAlDu.js} +8 -8
- package/dist/{vue-ui-dumbbell-B6th1M9b.cjs → vue-ui-dumbbell-BzqRvxE9.cjs} +1 -1
- package/dist/{vue-ui-flow-Bux2O68S.cjs → vue-ui-flow-CSlnKCEh.cjs} +1 -1
- package/dist/{vue-ui-flow-ynx-run3.js → vue-ui-flow-DsqenwU_.js} +7 -7
- package/dist/{vue-ui-galaxy-C7GEYMQB.js → vue-ui-galaxy-CLXeRR9E.js} +9 -9
- package/dist/{vue-ui-galaxy-D9QnmX0M.cjs → vue-ui-galaxy-WwvhRAFa.cjs} +1 -1
- package/dist/{vue-ui-gauge-DrgKJTGw.cjs → vue-ui-gauge-B_5_uMiG.cjs} +1 -1
- package/dist/{vue-ui-gauge-DU8VU1m7.js → vue-ui-gauge-zoUBHBL2.js} +4 -4
- package/dist/{vue-ui-heatmap-DUuN0fGR.js → vue-ui-heatmap-D-oq-QFJ.js} +8 -8
- package/dist/{vue-ui-heatmap-BIBsrwjz.cjs → vue-ui-heatmap-Gv6Y0025.cjs} +1 -1
- package/dist/{vue-ui-kpi-CLEQSt4V.cjs → vue-ui-kpi-Bgxu139K.cjs} +1 -1
- package/dist/{vue-ui-kpi-BoGsykfq.js → vue-ui-kpi-CE3UnfLM.js} +2 -2
- package/dist/{vue-ui-mini-loader-CNCZkUvI.js → vue-ui-mini-loader-Fap6KDDb.js} +2 -2
- package/dist/{vue-ui-mini-loader-CIPfR_lB.cjs → vue-ui-mini-loader-KFiTgq0Z.cjs} +1 -1
- package/dist/{vue-ui-molecule-Da19KH5g.cjs → vue-ui-molecule-CaKXLDG3.cjs} +1 -1
- package/dist/{vue-ui-molecule-Brw0qOjw.js → vue-ui-molecule-QMshD0fQ.js} +9 -9
- package/dist/{vue-ui-mood-radar-BktJHBX_.cjs → vue-ui-mood-radar-BFKJ6-wI.cjs} +1 -1
- package/dist/{vue-ui-mood-radar-hIUOJ8Cd.js → vue-ui-mood-radar-woI18vdU.js} +9 -9
- package/dist/{vue-ui-nested-donuts-DXZXCu5s.js → vue-ui-nested-donuts-BH8pGgVI.js} +9 -9
- package/dist/{vue-ui-nested-donuts-2GqE8lhb.cjs → vue-ui-nested-donuts-Nb5Jg_SG.cjs} +1 -1
- package/dist/{vue-ui-onion-DqnFyhwy.cjs → vue-ui-onion-BBYwZtjh.cjs} +1 -1
- package/dist/{vue-ui-onion-Bx2_3hmi.js → vue-ui-onion-bofmS_kO.js} +9 -9
- package/dist/{vue-ui-parallel-coordinate-plot-CIkVq6XI.cjs → vue-ui-parallel-coordinate-plot-C-ZbQgN7.cjs} +1 -1
- package/dist/{vue-ui-parallel-coordinate-plot-DgjecbC2.js → vue-ui-parallel-coordinate-plot-DVW0LYp7.js} +10 -10
- package/dist/{vue-ui-quadrant-DUNTLV5w.cjs → vue-ui-quadrant-DFMVk5eC.cjs} +1 -1
- package/dist/{vue-ui-quadrant-DlSMixki.js → vue-ui-quadrant-fhx9NkrR.js} +10 -10
- package/dist/{vue-ui-quick-chart-_ysWkoF7.js → vue-ui-quick-chart-5rggkq9-.js} +6 -6
- package/dist/{vue-ui-quick-chart-CpdxM7qN.cjs → vue-ui-quick-chart-S6LEQLn7.cjs} +1 -1
- package/dist/{vue-ui-radar-Fh5UQO5Z.js → vue-ui-radar-B8RvpBi-.js} +10 -10
- package/dist/{vue-ui-radar-B8fTGb35.cjs → vue-ui-radar-CsR9V_Sl.cjs} +1 -1
- package/dist/{vue-ui-rating-BTbg-bNd.cjs → vue-ui-rating-CgzLPjlb.cjs} +1 -1
- package/dist/{vue-ui-rating-CwV_45UQ.js → vue-ui-rating-ClQkygLG.js} +2 -2
- package/dist/{vue-ui-relation-circle-B61AGVtF.js → vue-ui-relation-circle-B2hJDB7v.js} +5 -5
- package/dist/{vue-ui-relation-circle-BrHBPn8C.cjs → vue-ui-relation-circle-D0zllKLp.cjs} +1 -1
- package/dist/{vue-ui-rings-BSbFTwmB.cjs → vue-ui-rings-CLIeS7BN.cjs} +1 -1
- package/dist/{vue-ui-rings-DwtqKTGk.js → vue-ui-rings-D3nNsoiU.js} +9 -9
- package/dist/{vue-ui-scatter-CFXQQZQr.js → vue-ui-scatter-DitnL-sZ.js} +10 -10
- package/dist/{vue-ui-scatter-BdphtRDE.cjs → vue-ui-scatter-bPAA5OYI.cjs} +1 -1
- package/dist/{vue-ui-screenshot-ChP1r5WI.cjs → vue-ui-screenshot-C-uHRqZ7.cjs} +1 -1
- package/dist/{vue-ui-screenshot-CkI4Gtys.js → vue-ui-screenshot-DayBW_7b.js} +1 -1
- package/dist/{vue-ui-skeleton-DIm7kxhc.cjs → vue-ui-skeleton-CgYrDrh-.cjs} +1 -1
- package/dist/{vue-ui-skeleton-CmXMTbOC.js → vue-ui-skeleton-DJtTdfNg.js} +2 -2
- package/dist/{vue-ui-smiley-BQJ6XX_L.js → vue-ui-smiley-CZTyxQvT.js} +2 -2
- package/dist/{vue-ui-smiley-BQ1_0eFh.cjs → vue-ui-smiley-CvpPFDBL.cjs} +1 -1
- package/dist/{vue-ui-spark-trend-Dx4w74bw.js → vue-ui-spark-trend--aNEsQNW.js} +4 -4
- package/dist/{vue-ui-spark-trend-COUBPV4j.cjs → vue-ui-spark-trend-DZm9J_ZI.cjs} +1 -1
- package/dist/vue-ui-sparkbar-C43IyepC.cjs +1 -0
- package/dist/{vue-ui-sparkbar-CxKIVunV.js → vue-ui-sparkbar-uvq7AcMr.js} +86 -77
- package/dist/{vue-ui-sparkgauge-Bd2F7zw1.cjs → vue-ui-sparkgauge-BP11yMVn.cjs} +1 -1
- package/dist/{vue-ui-sparkgauge-BhVgI98W.js → vue-ui-sparkgauge-V1zC6qrt.js} +3 -3
- package/dist/{vue-ui-sparkhistogram-CKw6tZnv.js → vue-ui-sparkhistogram-BIUsoRQJ.js} +4 -4
- package/dist/{vue-ui-sparkhistogram-B1Txwx4N.cjs → vue-ui-sparkhistogram-Dipd391E.cjs} +1 -1
- package/dist/{vue-ui-sparkline-CrXPLabK.cjs → vue-ui-sparkline-C3C9heBc.cjs} +1 -1
- package/dist/{vue-ui-sparkline-CSEByr6z.js → vue-ui-sparkline-DOAhQCt5.js} +3 -3
- package/dist/{vue-ui-sparkstackbar-BfP1wyyg.cjs → vue-ui-sparkstackbar-Bk7nIBnD.cjs} +1 -1
- package/dist/{vue-ui-sparkstackbar-CQLWpdxG.js → vue-ui-sparkstackbar-ObA64D3E.js} +3 -3
- package/dist/{vue-ui-strip-plot-DAJ0qjKU.js → vue-ui-strip-plot-6eenEjje.js} +9 -9
- package/dist/{vue-ui-strip-plot-N-_mlbwb.cjs → vue-ui-strip-plot-CffrlZCk.cjs} +1 -1
- package/dist/{vue-ui-table-DFe98urD.js → vue-ui-table-BbMFv-oU.js} +1 -1
- package/dist/{vue-ui-table-t1jDOoJW.cjs → vue-ui-table-CzAWebM5.cjs} +1 -1
- package/dist/{vue-ui-table-heatmap-DUonA4jJ.js → vue-ui-table-heatmap-B9YVKhvr.js} +4 -4
- package/dist/{vue-ui-table-heatmap-oEi-vxRg.cjs → vue-ui-table-heatmap-CR4Z6gFJ.cjs} +1 -1
- package/dist/{vue-ui-table-sparkline-DKoH5PeD.cjs → vue-ui-table-sparkline-BZdfmaoe.cjs} +1 -1
- package/dist/{vue-ui-table-sparkline-BIY7GWik.js → vue-ui-table-sparkline-D7b-hkZg.js} +5 -5
- package/dist/{vue-ui-thermometer-BiWx3ujG.js → vue-ui-thermometer-CfGfCzz9.js} +5 -5
- package/dist/{vue-ui-thermometer-ZgNA47Fv.cjs → vue-ui-thermometer-DJw8iKSK.cjs} +1 -1
- package/dist/{vue-ui-timer-BmThVcD0.cjs → vue-ui-timer-DjSR1opQ.cjs} +1 -1
- package/dist/{vue-ui-timer-BFKnN8tS.js → vue-ui-timer-PdZYURw6.js} +4 -4
- package/dist/{vue-ui-tiremarks-BO_X27nw.js → vue-ui-tiremarks-9o6eS1Mc.js} +5 -5
- package/dist/{vue-ui-tiremarks-D9ClW4XX.cjs → vue-ui-tiremarks-DmQpv3n0.cjs} +1 -1
- package/dist/{vue-ui-treemap-BVV-tfRq.cjs → vue-ui-treemap-BQlEP4Wi.cjs} +1 -1
- package/dist/{vue-ui-treemap-Crrd_rpP.js → vue-ui-treemap-hdJRrv6w.js} +9 -9
- package/dist/{vue-ui-vertical-bar-CyuImTrh.js → vue-ui-vertical-bar-BRhV9I7i.js} +9 -9
- package/dist/{vue-ui-vertical-bar-k9KkT9mN.cjs → vue-ui-vertical-bar-CXn4FfOg.cjs} +1 -1
- package/dist/{vue-ui-waffle-CYSDDS3-.js → vue-ui-waffle-CXyoderQ.js} +83 -83
- package/dist/{vue-ui-waffle-DenwQo8B.cjs → vue-ui-waffle-CjAIw38i.cjs} +1 -1
- package/dist/{vue-ui-wheel-C8-f39P2.js → vue-ui-wheel-BU_90Fhv.js} +5 -5
- package/dist/{vue-ui-wheel-Cx7SBWWF.cjs → vue-ui-wheel-DLj-V4jn.cjs} +1 -1
- package/dist/{vue-ui-word-cloud-CMsakywD.cjs → vue-ui-word-cloud-CtBamLvE.cjs} +1 -1
- package/dist/{vue-ui-word-cloud-D9y9Iht6.js → vue-ui-word-cloud-DQ72J4Ro.js} +6 -6
- package/dist/{vue-ui-xy-BxCALt6U.cjs → vue-ui-xy-Bz15K-CC.cjs} +1 -1
- package/dist/{vue-ui-xy-Dhpahzod.js → vue-ui-xy-DYEsmppC.js} +12 -12
- package/dist/{vue-ui-xy-canvas-COwqkdZB.js → vue-ui-xy-canvas-BRWp_v0p.js} +10 -10
- package/dist/{vue-ui-xy-canvas-B_Fi2be0.cjs → vue-ui-xy-canvas-DLN-ipCw.cjs} +1 -1
- package/package.json +1 -1
- package/dist/vue-ui-carousel-table-Cti_GQvV.cjs +0 -1
- package/dist/vue-ui-carousel-table-CxTbe6SP.js +0 -314
- package/dist/vue-ui-sparkbar-Cdcndp7Q.cjs +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("vue"),i=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("vue"),i=require("./index-Xau3hcRk.cjs"),X=require("./useResponsive-B3TrDDIG.cjs"),ye=require("./Title-gCBF7AU7.cjs"),Y=require("./usePrinter-Dhvmhwhf.cjs"),he=require("./Tooltip-Qv4VexrA.cjs"),pe=require("./DataTable-CXkMZ3ja.cjs"),ge=require("./vue-ui-skeleton-CgYrDrh-.cjs"),fe=require("./Slicer-CPQW_sm_.cjs"),me=require("./vue-ui-accordion-BjU8im6m.cjs"),J=require("./useNestedProp-C_EQ-Kxy.cjs"),xe=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),ke=["id"],be=["xmlns","viewBox"],we={key:0},Ce=["id"],$e=["stop-color"],Ne=["stop-color"],_e=["stop-color"],Be=["id"],Se=["stop-color"],Ve=["stop-color"],Ee=["stop-color"],ze={key:0},Te=["x1","x2","y1","y2","stroke","stroke-width"],Fe=["x1","x2","y1","y2","stroke","stroke-width"],Ae={key:1},Le=["x1","x2","y1","y2","stroke","stroke-width"],Re=["x","y","font-size","fill","font-weight"],Pe={key:2},Ie=["transform","text-anchor","font-size","fill","font-weight"],Oe=["x1","x2","y1","y2","stroke","stroke-width"],Me={key:0},Ue=["cx","cy","r","fill"],De=["cx","cy","r","fill"],qe={key:1},We=["x1","x2","y1","y2","stroke","stroke-width"],Ge=["x1","x2","y1","y2","stroke","stroke-width"],He=["x","y","height","width","fill","rx"],je=["x","y","height","width","fill","rx","stroke","stroke-width"],Xe=["x","y","height","width","fill","onMouseover"],Ye=["innerHTML"],Je={__name:"vue-ui-candlestick",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},setup(g,{expose:K}){const h=g,{vue_ui_candlestick:Q}=i.useConfig(),m=t.computed(()=>!!h.dataset&&h.dataset.length),y=t.ref(i.createUid()),Z=t.ref(null),_=t.ref(!1),B=t.ref(""),S=t.ref(void 0),T=t.ref(0),F=t.ref(0),x=t.ref(null),A=t.ref(null),L=t.ref(null),R=t.ref(null),e=t.computed(()=>{const o=J.useNestedProp({userConfig:h.config,defaultConfig:Q});return o.theme?{...J.useNestedProp({userConfig:i.themes.vue_ui_candlestick[o.theme]||h.config,defaultConfig:o})}:o}),r=t.ref({height:e.value.style.height,width:e.value.style.width,xAxisFontSize:e.value.style.layout.grid.xAxis.dataLabels.fontSize,yAxisFontSize:e.value.style.layout.grid.yAxis.dataLabels.fontSize}),b=t.ref(null);t.onMounted(()=>{if(i.objectIsEmpty(h.dataset)&&i.error({componentName:"VueUiCandlestick",type:"dataset"}),e.value.responsive){const o=X.throttle(()=>{const{width:u,height:l}=X.useResponsive({chart:x.value,title:e.value.style.title.text?A.value:null,slicer:R.value,legend:L.value});r.value.width=u,r.value.height=l,r.value.xAxisFontSize=i.translateSize({relator:Math.min(u,l),adjuster:e.value.style.width,source:e.value.style.layout.grid.xAxis.dataLabels.fontSize,threshold:6,fallback:6}),r.value.yAxisFontSize=i.translateSize({relator:Math.min(u,l),adjuster:e.value.style.width,source:e.value.style.layout.grid.yAxis.dataLabels.fontSize,threshold:6,fallback:6})});b.value=new ResizeObserver(o),b.value.observe(x.value.parentNode)}}),t.onBeforeUnmount(()=>{b.value&&b.value.disconnect()});const{isPrinting:ee,isImaging:te,generatePdf:P,generateImage:I}=Y.usePrinter({elementId:`vue-ui-candlestick_${y.value}`,fileName:e.value.style.title.text||"vue-ui-candlestick"}),p=t.ref({showTable:e.value.table.show,showTooltip:e.value.style.tooltip.show}),s=t.computed(()=>{const{top:o,right:u,bottom:l,left:a}=e.value.style.layout.padding;return{top:o,right:r.value.width-u,left:a,bottom:r.value.height-l,width:r.value.width-a-u,height:r.value.height-o-l}}),V=t.computed(()=>h.dataset.length),d=t.ref({start:0,end:V.value}),O=t.computed(()=>h.dataset.slice(d.value.start,d.value.end)),E=t.computed(()=>(h.dataset.forEach((o,u)=>{[null,void 0].includes(o[0])&&i.error({componentName:"VueUiCandlestick",type:"datasetAttribute",property:"period (index 0)",index:u}),[null,void 0].includes(o[1])&&i.error({componentName:"VueUiCandlestick",type:"datasetAttribute",property:"open (index 1)",index:u}),[null,void 0].includes(o[2])&&i.error({componentName:"VueUiCandlestick",type:"datasetAttribute",property:"high (index 2)",index:u}),[null,void 0].includes(o[3])&&i.error({componentName:"VueUiCandlestick",type:"datasetAttribute",property:"low (index 3)",index:u}),[null,void 0].includes(o[4])&&i.error({componentName:"VueUiCandlestick",type:"datasetAttribute",property:"last (index 4)",index:u}),[null,void 0].includes(o[5])&&i.error({componentName:"VueUiCandlestick",type:"datasetAttribute",property:"volume (index 5)",index:u})}),O.value.map(o=>({period:o[0],open:o[1],high:o[2],low:o[3],last:o[4],volume:o[5]})))),n=t.computed(()=>s.value.width/O.value.length),M=t.computed(()=>({max:Math.max(...E.value.map(o=>o.high)),min:0})),f=t.computed(()=>i.calculateNiceScale(M.value.min,M.value.max,e.value.style.layout.grid.yAxis.dataLabels.steps));function w(o,u){return{...o,x:s.value.left+u*n.value+n.value/2,y:s.value.top+(1-o/f.value.max)*s.value.height,value:o}}const c=t.computed(()=>E.value.map((o,u)=>{const l=w(o.open,u),a=w(o.high,u),v=w(o.low,u),$=w(o.last,u),N=o.last>o.open;return{period:o.period,open:l,high:a,low:v,last:$,volume:o.volume,isBullish:N}}));function le(o){return o/f.value.max}const oe=t.computed(()=>f.value.ticks.map(o=>({y:s.value.bottom-s.value.height*le(o),value:o}))),ae=t.computed(()=>E.value.map(o=>o.period)),z=t.ref(null);function ue(o,u){S.value=o,z.value={datapoint:u,seriesIndex:o,series:c.value,config:e.value};const l=e.value.style.tooltip.customFormat;if(i.isFunction(l)&&i.functionReturnsString(()=>l({seriesIndex:o,datapoint:u,series:c.value,config:e.value})))B.value=l({seriesIndex:o,datapoint:u,series:c.value,config:e.value});else if(e.value.style.tooltip.show){let a="";const{period:v,open:$,high:N,low:W,last:G,volume:H,isBullish:j}=c.value[o],{period:Qe,open:ne,high:re,low:de,last:ce,volume:ve}=e.value.translations;a+=`<div><svg style="margin-right:6px" viewBox="0 0 12 12" height="12" width="12"><rect x="0" y="0" height="12" width="12" rx="${e.value.style.layout.candle.borderRadius*3}" stroke="${e.value.style.layout.candle.stroke}" stroke-width="${e.value.style.layout.candle.strokeWidth}"
|
|
2
2
|
fill="${e.value.style.layout.candle.gradient.show?j?`url(#bullish_gradient_${y.value})`:`url(#bearish_gradient_${y.value})`:j?e.value.style.layout.candle.colors.bullish:e.value.style.layout.candle.colors.bearish}"/></svg>${v}</div>`,a+=`${ve} : <b>${isNaN(H)?"-":Number(H.toFixed(e.value.style.tooltip.roundingValue)).toLocaleString()}</b>`,a+=`<div style="margin-top:6px;padding-top:6px;border-top:1px solid ${e.value.style.tooltip.borderColor}">`,a+=`<div>${ne}: <b>${e.value.style.tooltip.prefix} ${isNaN($.value)?"-":Number($.value.toFixed(e.value.style.tooltip.roundingValue)).toLocaleString()} ${e.value.style.tooltip.suffix}</b></div>`,a+=`<div>${re}: <b>${e.value.style.tooltip.prefix} ${isNaN(N.value)?"-":Number(N.value.toFixed(e.value.style.tooltip.roundingValue)).toLocaleString()} ${e.value.style.tooltip.suffix}</b></div>`,a+=`<div>${de}: <b>${e.value.style.tooltip.prefix} ${isNaN(W.value)?"-":Number(W.value.toFixed(e.value.style.tooltip.roundingValue)).toLocaleString()} ${e.value.style.tooltip.suffix}</b></div>`,a+=`<div>${ce}: <b>${e.value.style.tooltip.prefix} ${isNaN(G.value)?"-":Number(G.value.toFixed(e.value.style.tooltip.roundingValue)).toLocaleString()} ${e.value.style.tooltip.suffix}</b></div>`,a+="</div>",B.value=`<div style="text-align:right">${a}</div>`}_.value=!0}function ie(){d.value={start:0,end:V.value},F.value+=1}function U(){t.nextTick(()=>{const o=[e.value.translations.period,e.value.translations.open,e.value.translations.high,e.value.translations.low,e.value.translations.last,e.value.translations.volume],u=c.value.map(v=>[v.period,v.open.value,v.high.value,v.low.value,v.last.value,v.volume]),l=[[e.value.style.title.text],[e.value.style.title.subtitle.text],[[""],[""],[""]]].concat([o]).concat(u),a=i.createCsvContent(l);i.downloadCsv({csvContent:a,title:e.value.style.title.text||"vue-ui-candlestick"})})}const C=t.computed(()=>{const o=c.value.map(a=>[`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 12 12" height="12" width="12" style="margin-right: 6px"><rect x="0" y="0" height="12" width="12" :rx="${e.value.style.layout.candle.borderRadius*3}" fill="${e.value.style.layout.candle.gradient.show?a.isBullish?`url(#bullish_gradient_${y.value}`:`url(#bearish_gradient_${y.value})`:a.isBullish?e.value.style.layout.candle.colors.bullish:e.value.style.layout.candle.colors.bearish}"/></svg> ${a.period}`,`${e.value.table.td.prefix} ${isNaN(a.open.value)?"-":Number(a.open.value.toFixed(e.value.table.td.roundingValue)).toLocaleString()} ${e.value.table.td.suffix}`,`${e.value.table.td.prefix} ${isNaN(a.high.value)?"-":Number(a.high.value.toFixed(e.value.table.td.roundingValue)).toLocaleString()} ${e.value.table.td.suffix}`,`${e.value.table.td.prefix} ${isNaN(a.low.value)?"-":Number(a.low.value.toFixed(e.value.table.td.roundingValue)).toLocaleString()} ${e.value.table.td.suffix}`,`${e.value.table.td.prefix} ${isNaN(a.last.value)?"-":Number(a.last.value.toFixed(e.value.table.td.roundingValue)).toLocaleString()} ${e.value.table.td.suffix}`,`${isNaN(a.volume)?"-":a.volume.toLocaleString()}`]),u={th:{backgroundColor:e.value.table.th.backgroundColor,color:e.value.table.th.color,outline:e.value.table.th.outline},td:{backgroundColor:e.value.table.td.backgroundColor,color:e.value.table.td.color,outline:e.value.table.td.outline},breakpoint:e.value.table.responsiveBreakpoint},l=[e.value.translations.period,e.value.translations.open,e.value.translations.high,e.value.translations.low,e.value.translations.last,e.value.translations.volume];return{head:l,body:o,config:u,colNames:l}}),k=t.ref(!1);function se(o){k.value=o,T.value+=1}function D(){p.value.showTable=!p.value.showTable}function q(){p.value.showTooltip=!p.value.showTooltip}return K({generatePdf:P,generateCsv:U,generateImage:I,toggleTable:D,toggleTooltip:q}),(o,u)=>(t.openBlock(),t.createElementBlock("div",{ref_key:"candlestickChart",ref:x,class:t.normalizeClass(`vue-ui-candlestick ${k.value?"vue-data-ui-wrapper-fullscreen":""} ${e.value.useCssAnimation?"":"vue-ui-dna"}`),style:t.normalizeStyle(`position:relative;font-family:${e.value.style.fontFamily}; text-align:center;${e.value.style.title.text?"":"padding-top:36px"};background:${e.value.style.backgroundColor}; ${e.value.responsive?"height: 100%":""}`),id:`vue-ui-candlestick_${y.value}`},[e.value.style.title.text?(t.openBlock(),t.createElementBlock("div",{key:0,ref_key:"chartTitle",ref:A,style:t.normalizeStyle(`width:100%;background:${e.value.style.backgroundColor}`)},[t.createVNode(ye._sfc_main,{config:{title:{cy:"candlestick-div-title",...e.value.style.title},subtitle:{cy:"candlestick-div-subtitle",...e.value.style.title.subtitle}}},null,8,["config"])],4)):t.createCommentVNode("",!0),e.value.userOptions.show&&m.value?(t.openBlock(),t.createBlock(Y.UserOptions,{ref_key:"details",ref:Z,key:`user_options_${T.value}`,backgroundColor:e.value.style.backgroundColor,color:e.value.style.color,isImaging:t.unref(te),isPrinting:t.unref(ee),uid:y.value,hasTooltip:e.value.userOptions.buttons.tooltip&&e.value.style.tooltip.show,hasPdf:e.value.userOptions.buttons.pdf,hasImg:e.value.userOptions.buttons.img,hasXls:e.value.userOptions.buttons.csv,hasTable:e.value.userOptions.buttons.table,hasFullscreen:e.value.userOptions.buttons.fullscreen,isFullscreen:k.value,isTooltip:p.value.showTooltip,titles:{...e.value.userOptions.buttonTitles},chartElement:x.value,onToggleFullscreen:se,onGeneratePdf:t.unref(P),onGenerateCsv:U,onGenerateImage:t.unref(I),onToggleTable:D,onToggleTooltip:q},t.createSlots({_:2},[o.$slots.optionTooltip?{name:"optionTooltip",fn:t.withCtx(()=>[t.renderSlot(o.$slots,"optionTooltip",{},void 0,!0)]),key:"0"}:void 0,o.$slots.optionPdf?{name:"optionPdf",fn:t.withCtx(()=>[t.renderSlot(o.$slots,"optionPdf",{},void 0,!0)]),key:"1"}:void 0,o.$slots.optionCsv?{name:"optionCsv",fn:t.withCtx(()=>[t.renderSlot(o.$slots,"optionCsv",{},void 0,!0)]),key:"2"}:void 0,o.$slots.optionImg?{name:"optionImg",fn:t.withCtx(()=>[t.renderSlot(o.$slots,"optionImg",{},void 0,!0)]),key:"3"}:void 0,o.$slots.optionTable?{name:"optionTable",fn:t.withCtx(()=>[t.renderSlot(o.$slots,"optionTable",{},void 0,!0)]),key:"4"}:void 0,o.$slots.optionFullscreen?{name:"optionFullscreen",fn:t.withCtx(({toggleFullscreen:l,isFullscreen:a})=>[t.renderSlot(o.$slots,"optionFullscreen",t.normalizeProps(t.guardReactiveProps({toggleFullscreen:l,isFullscreen:a})),void 0,!0)]),key:"5"}:void 0]),1032,["backgroundColor","color","isImaging","isPrinting","uid","hasTooltip","hasPdf","hasImg","hasXls","hasTable","hasFullscreen","isFullscreen","isTooltip","titles","chartElement","onGeneratePdf","onGenerateImage"])):t.createCommentVNode("",!0),m.value?(t.openBlock(),t.createElementBlock("svg",{key:2,xmlns:t.unref(i.XMLNS),class:t.normalizeClass({"vue-data-ui-fullscreen--on":k.value,"vue-data-ui-fulscreen--off":!k.value}),viewBox:`0 0 ${r.value.width<=0?10:r.value.width} ${r.value.height<=0?10:r.value.height}`,style:t.normalizeStyle(`max-width:100%;overflow:visible;background:${e.value.style.backgroundColor};color:${e.value.style.color}`)},[c.value.length>0?(t.openBlock(),t.createElementBlock("g",we,[t.createElementVNode("defs",null,[t.createElementVNode("linearGradient",{id:`bearish_gradient_${y.value}`,x2:"0%",y2:"100%"},[t.createElementVNode("stop",{offset:"0%","stop-color":e.value.style.layout.candle.colors.bearish},null,8,$e),t.createElementVNode("stop",{offset:"50%","stop-color":`${t.unref(i.shiftHue)(e.value.style.layout.candle.colors.bearish,.02)}DE`},null,8,Ne),t.createElementVNode("stop",{offset:"100%","stop-color":`${t.unref(i.shiftHue)(e.value.style.layout.candle.colors.bearish,.05)}66`},null,8,_e)],8,Ce),t.createElementVNode("linearGradient",{id:`bullish_gradient_${y.value}`,x2:"0%",y2:"100%"},[t.createElementVNode("stop",{offset:"0%","stop-color":e.value.style.layout.candle.colors.bullish},null,8,Se),t.createElementVNode("stop",{offset:"50%","stop-color":`${t.unref(i.shiftHue)(e.value.style.layout.candle.colors.bullish,.02)}DE`},null,8,Ve),t.createElementVNode("stop",{offset:"100%","stop-color":`${t.unref(i.shiftHue)(e.value.style.layout.candle.colors.bullish,.05)}66`},null,8,Ee)],8,Be)]),e.value.style.layout.grid.show?(t.openBlock(),t.createElementBlock("g",ze,[t.createElementVNode("line",{x1:s.value.left,x2:s.value.left,y1:s.value.top,y2:s.value.bottom,stroke:e.value.style.layout.grid.stroke,"stroke-width":e.value.style.layout.grid.strokeWidth,"stroke-linecap":"round"},null,8,Te),t.createElementVNode("line",{x1:s.value.left,x2:s.value.right,y1:s.value.bottom,y2:s.value.bottom,stroke:e.value.style.layout.grid.stroke,"stroke-width":e.value.style.layout.grid.strokeWidth,"stroke-linecap":"round"},null,8,Fe)])):t.createCommentVNode("",!0),e.value.style.layout.grid.yAxis.dataLabels.show?(t.openBlock(),t.createElementBlock("g",Ae,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(oe.value,(l,a)=>(t.openBlock(),t.createElementBlock("g",null,[l.value>=f.value.min&&l.value<=f.value.max?(t.openBlock(),t.createElementBlock("line",{key:0,x1:s.value.left,x2:s.value.left-5,y1:l.y,y2:l.y,stroke:e.value.style.layout.grid.stroke,"stroke-width":e.value.style.layout.grid.strokeWidth,"stroke-linecap":"round"},null,8,Le)):t.createCommentVNode("",!0),l.value>=f.value.min&&l.value<=f.value.max?(t.openBlock(),t.createElementBlock("text",{key:1,x:s.value.left-8+e.value.style.layout.grid.yAxis.dataLabels.offsetX,y:l.y+r.value.yAxisFontSize/3,"font-size":r.value.yAxisFontSize,"text-anchor":"end",fill:e.value.style.layout.grid.yAxis.dataLabels.color,"font-weight":e.value.style.layout.grid.yAxis.dataLabels.bold?"bold":"normal"},t.toDisplayString(e.value.style.layout.grid.yAxis.dataLabels.prefix)+" "+t.toDisplayString(t.unref(i.canShowValue)(l.value)?l.value.toFixed(e.value.style.layout.grid.yAxis.dataLabels.roundingValue):"")+" "+t.toDisplayString(e.value.style.layout.grid.yAxis.dataLabels.suffix),9,Re)):t.createCommentVNode("",!0)]))),256))])):t.createCommentVNode("",!0),e.value.style.layout.grid.xAxis.dataLabels.show?(t.openBlock(),t.createElementBlock("g",Pe,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(ae.value,(l,a)=>(t.openBlock(),t.createElementBlock("g",null,[t.createElementVNode("text",{transform:`translate(${s.value.left+n.value*a+n.value/2}, ${s.value.bottom+r.value.xAxisFontSize*2+e.value.style.layout.grid.xAxis.dataLabels.offsetY}), rotate(${e.value.style.layout.grid.xAxis.dataLabels.rotation})`,"text-anchor":e.value.style.layout.grid.xAxis.dataLabels.rotation>0?"start":e.value.style.layout.grid.xAxis.dataLabels.rotation<0?"end":"middle","font-size":r.value.xAxisFontSize,fill:e.value.style.layout.grid.xAxis.dataLabels.color,"font-weight":e.value.style.layout.grid.xAxis.dataLabels.bold?"bold":"normal"},t.toDisplayString(l),9,Ie)]))),256))])):t.createCommentVNode("",!0),t.createElementVNode("g",null,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(c.value,(l,a)=>(t.openBlock(),t.createElementBlock("g",null,[t.createElementVNode("line",{x1:l.open.x,x2:l.open.x,y1:l.high.y,y2:l.low.y,stroke:e.value.style.layout.wick.stroke,"stroke-width":e.value.style.layout.wick.strokeWidth,"stroke-linecap":"round"},null,8,Oe),e.value.style.layout.wick.extremity.shape==="circle"?(t.openBlock(),t.createElementBlock("g",Me,[t.createElementVNode("circle",{cx:l.high.x,cy:l.high.y,r:e.value.style.layout.wick.extremity.size==="auto"?n.value/20:e.value.style.layout.wick.extremity.size,fill:e.value.style.layout.wick.extremity.color},null,8,Ue),t.createElementVNode("circle",{cx:l.low.x,cy:l.low.y,r:e.value.style.layout.wick.extremity.size==="auto"?n.value/20:e.value.style.layout.wick.extremity.size,fill:e.value.style.layout.wick.extremity.color},null,8,De)])):t.createCommentVNode("",!0),e.value.style.layout.wick.extremity.shape==="line"?(t.openBlock(),t.createElementBlock("g",qe,[t.createElementVNode("line",{x1:l.high.x-(e.value.style.layout.wick.extremity.size==="auto"?n.value*e.value.style.layout.candle.widthRatio:e.value.style.layout.wick.extremity.size)/2,x2:l.high.x+(e.value.style.layout.wick.extremity.size==="auto"?n.value*e.value.style.layout.candle.widthRatio:e.value.style.layout.wick.extremity.size)/2,y1:l.high.y,y2:l.high.y,stroke:e.value.style.layout.wick.extremity.color,"stroke-width":e.value.style.layout.wick.strokeWidth,"stroke-linecap":"round"},null,8,We),t.createElementVNode("line",{x1:l.low.x-(e.value.style.layout.wick.extremity.size==="auto"?n.value*e.value.style.layout.candle.widthRatio:e.value.style.layout.wick.extremity.size)/2,x2:l.low.x+(e.value.style.layout.wick.extremity.size==="auto"?n.value*e.value.style.layout.candle.widthRatio:e.value.style.layout.wick.extremity.size)/2,y1:l.low.y,y2:l.low.y,stroke:e.value.style.layout.wick.extremity.color,"stroke-width":e.value.style.layout.wick.strokeWidth,"stroke-linecap":"round"},null,8,Ge)])):t.createCommentVNode("",!0)]))),256))]),t.createElementVNode("g",null,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(c.value,(l,a)=>(t.openBlock(),t.createElementBlock("rect",{x:l.open.x-n.value/2+n.value*(1-e.value.style.layout.candle.widthRatio)/2,y:l.isBullish?l.last.y:l.open.y,height:Math.abs(l.last.y-l.open.y)<=0?1e-4:Math.abs(l.last.y-l.open.y),width:n.value*e.value.style.layout.candle.widthRatio<=0?1e-4:n.value*e.value.style.layout.candle.widthRatio,fill:e.value.style.layout.candle.gradient.underlayer,rx:e.value.style.layout.candle.borderRadius,stroke:"none"},null,8,He))),256)),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(c.value,(l,a)=>(t.openBlock(),t.createElementBlock("rect",{x:l.open.x-n.value/2+n.value*(1-e.value.style.layout.candle.widthRatio)/2,y:l.isBullish?l.last.y:l.open.y,height:Math.abs(l.last.y-l.open.y)<=0?1e-4:Math.abs(l.last.y-l.open.y),width:n.value*e.value.style.layout.candle.widthRatio<=0?1e-4:n.value*e.value.style.layout.candle.widthRatio,fill:l.isBullish?e.value.style.layout.candle.gradient.show?`url(#bullish_gradient_${y.value})`:e.value.style.layout.candle.colors.bullish:e.value.style.layout.candle.gradient.show?`url(#bearish_gradient_${y.value})`:e.value.style.layout.candle.colors.bearish,rx:e.value.style.layout.candle.borderRadius,stroke:e.value.style.layout.candle.stroke,"stroke-width":e.value.style.layout.candle.strokeWidth,"stroke-linecap":"round","stroke-linejoin":"round"},null,8,je))),256))]),t.createElementVNode("g",null,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(c.value,(l,a)=>(t.openBlock(),t.createElementBlock("rect",{x:s.value.left+a*n.value,y:s.value.top,height:s.value.height<=0?1e-4:s.value.height,width:n.value<=0?1e-4:n.value,fill:S.value===a?`${e.value.style.layout.selector.color}${t.unref(i.opacity)[e.value.style.layout.selector.opacity]}`:"transparent",onMouseover:v=>ue(a,l),onMouseleave:u[0]||(u[0]=v=>{S.value=void 0,_.value=!1})},null,40,Xe))),256))])])):t.createCommentVNode("",!0),t.renderSlot(o.$slots,"svg",{svg:r.value},void 0,!0)],14,be)):t.createCommentVNode("",!0),m.value?t.createCommentVNode("",!0):(t.openBlock(),t.createBlock(ge.default,{key:3,config:{type:"candlesticks",style:{backgroundColor:e.value.style.backgroundColor,candlesticks:{axis:{color:"#CCCCCC"},candle:{color:"#CCCCCC"}}}}},null,8,["config"])),e.value.style.zoom.show&&m.value?(t.openBlock(),t.createElementBlock("div",{key:4,ref_key:"chartSlicer",ref:R},[(t.openBlock(),t.createBlock(fe.Slicer,{key:`slicer_${F.value}`,background:e.value.style.zoom.color,borderColor:e.value.style.backgroundColor,fontSize:e.value.style.zoom.fontSize,useResetSlot:e.value.style.zoom.useResetSlot,labelLeft:g.dataset[d.value.start]?g.dataset[d.value.start][0]:g.dataset[0][0],labelRight:g.dataset[d.value.end-1]?g.dataset[d.value.end-1][0]:g.dataset.at(-1)[0],textColor:e.value.style.color,inputColor:e.value.style.zoom.color,selectColor:e.value.style.zoom.highlightColor,max:V.value,min:0,valueStart:d.value.start,valueEnd:d.value.end,start:d.value.start,"onUpdate:start":u[1]||(u[1]=l=>d.value.start=l),end:d.value.end,"onUpdate:end":u[2]||(u[2]=l=>d.value.end=l),onReset:ie},{"reset-action":t.withCtx(({reset:l})=>[t.renderSlot(o.$slots,"reset-action",t.normalizeProps(t.guardReactiveProps({reset:l})),void 0,!0)]),_:3},8,["background","borderColor","fontSize","useResetSlot","labelLeft","labelRight","textColor","inputColor","selectColor","max","valueStart","valueEnd","start","end"]))],512)):t.createCommentVNode("",!0),t.createElementVNode("div",{ref_key:"chartLegend",ref:L},[t.renderSlot(o.$slots,"legend",{legend:c.value},void 0,!0)],512),t.createVNode(he._sfc_main,{show:p.value.showTooltip&&_.value,backgroundColor:e.value.style.tooltip.backgroundColor,color:e.value.style.tooltip.color,borderRadius:e.value.style.tooltip.borderRadius,borderColor:e.value.style.tooltip.borderColor,borderWidth:e.value.style.tooltip.borderWidth,fontSize:e.value.style.tooltip.fontSize,backgroundOpacity:e.value.style.tooltip.backgroundOpacity,parent:x.value,content:B.value,isCustom:e.value.style.tooltip.customFormat&&typeof e.value.style.tooltip.customFormat=="function"},{"tooltip-before":t.withCtx(()=>[t.renderSlot(o.$slots,"tooltip-before",t.normalizeProps(t.guardReactiveProps({...z.value})),void 0,!0)]),"tooltip-after":t.withCtx(()=>[t.renderSlot(o.$slots,"tooltip-after",t.normalizeProps(t.guardReactiveProps({...z.value})),void 0,!0)]),_:3},8,["show","backgroundColor","color","borderRadius","borderColor","borderWidth","fontSize","backgroundOpacity","parent","content","isCustom"]),m.value?(t.openBlock(),t.createBlock(me.default,{key:5,hideDetails:"",config:{open:p.value.showTable,maxHeight:1e4,body:{backgroundColor:e.value.style.backgroundColor,color:e.value.style.color},head:{backgroundColor:e.value.style.backgroundColor,color:e.value.style.color}}},{content:t.withCtx(()=>[t.createVNode(pe.DataTable,{colNames:C.value.colNames,head:C.value.head,body:C.value.body,config:C.value.config,title:`${e.value.style.title.text}${e.value.style.title.subtitle.text?` : ${e.value.style.title.subtitle.text}`:""}`,onClose:u[3]||(u[3]=l=>p.value.showTable=!1)},{th:t.withCtx(({th:l})=>[t.createTextVNode(t.toDisplayString(l),1)]),td:t.withCtx(({td:l})=>[t.createElementVNode("div",{innerHTML:l},null,8,Ye)]),_:1},8,["colNames","head","body","config","title"])]),_:1},8,["config"])):t.createCommentVNode("",!0)],14,ke))}},Ke=xe._export_sfc(Je,[["__scopeId","data-v-0ed64fca"]]);exports.default=Ke;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { computed as h, ref as v, onMounted as Ae, onBeforeUnmount as Fe, openBlock as u, createElementBlock as s, normalizeClass as ve, normalizeStyle as H, createVNode as q, createCommentVNode as y, createBlock as O, unref as x, createSlots as Le, withCtx as f, renderSlot as m, normalizeProps as P, guardReactiveProps as M, createElementVNode as n, Fragment as N, renderList as S, toDisplayString as F, createTextVNode as Re, nextTick as Ve } from "vue";
|
|
2
|
-
import { u as Ie, c as Be, t as Oe, o as Pe, e as C, z as Me, X as Ue, s as U, A as Ee, r as We, v as De, w as Ge, n as Xe, q as je, B as ye } from "./index-
|
|
2
|
+
import { u as Ie, c as Be, t as Oe, o as Pe, e as C, z as Me, X as Ue, s as U, A as Ee, r as We, v as De, w as Ge, n as Xe, q as je, B as ye } from "./index-BK818aZo.js";
|
|
3
3
|
import { t as He, u as qe } from "./useResponsive-NZB-WLRF.js";
|
|
4
|
-
import { _ as Ye } 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 ce } from "./useNestedProp-
|
|
4
|
+
import { _ as Ye } from "./Title-DJ269q6H.js";
|
|
5
|
+
import { u as Je, U as Ke } from "./usePrinter-C-2KAW2f.js";
|
|
6
|
+
import { _ as Qe } from "./Tooltip-CKKSlbSq.js";
|
|
7
|
+
import { D as Ze } from "./DataTable-R7hmQ0wl.js";
|
|
8
|
+
import et from "./vue-ui-skeleton-DJtTdfNg.js";
|
|
9
|
+
import { S as tt } from "./Slicer-C1zx1qMy.js";
|
|
10
|
+
import lt from "./vue-ui-accordion-CH8K6f6J.js";
|
|
11
|
+
import { u as ce } from "./useNestedProp-hi25rRoY.js";
|
|
12
12
|
import { _ as ot } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
13
13
|
const at = ["id"], ut = ["xmlns", "viewBox"], st = { key: 0 }, it = ["id"], nt = ["stop-color"], rt = ["stop-color"], dt = ["stop-color"], vt = ["id"], yt = ["stop-color"], ct = ["stop-color"], ht = ["stop-color"], pt = { key: 0 }, gt = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], ft = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], bt = { key: 1 }, xt = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], mt = ["x", "y", "font-size", "fill", "font-weight"], kt = { key: 2 }, wt = ["transform", "text-anchor", "font-size", "fill", "font-weight"], $t = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], _t = { key: 0 }, Ct = ["cx", "cy", "r", "fill"], Nt = ["cx", "cy", "r", "fill"], St = { key: 1 }, zt = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], Tt = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], At = ["x", "y", "height", "width", "fill", "rx"], Ft = ["x", "y", "height", "width", "fill", "rx", "stroke", "stroke-width"], Lt = ["x", "y", "height", "width", "fill", "onMouseover"], Rt = ["innerHTML"], Vt = {
|
|
14
14
|
__name: "vue-ui-candlestick",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("./index-Xau3hcRk.cjs"),te=require("./useNestedProp-C_EQ-Kxy.cjs"),D=require("./usePrinter-Dhvmhwhf.cjs"),oe=require("./vue-ui-skeleton-CgYrDrh-.cjs"),ae=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),ne=["id"],le=["height"],re=["data-cell","height"],ie={__name:"vue-ui-carousel-table",props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{}}}},setup(v,{expose:G}){const l=v,{vue_ui_carousel_table:j}=r.useConfig(),w=e.ref(r.createUid()),I=e.ref(!1),f=e.ref(!!l.dataset);e.onMounted(()=>{r.objectIsEmpty(l.dataset)?r.error({componentName:"VueUiCarouselTable",type:"dataset"}):((!l.dataset.head||r.objectIsEmpty(l.dataset.head))&&(r.error({componentName:"VueUiCarouselTable",type:"datasetAttribute",property:"head"}),f.value=!1),(!l.dataset.body||r.objectIsEmpty(l.dataset.body))&&(r.error({componentName:"VueUiCarouselTable",type:"datasetAttribute",property:"body"}),f.value=!1))});const t=e.computed(()=>te.useNestedProp({userConfig:l.config,defaultConfig:j})),{isPrinting:z,isImaging:P,generatePdf:X,generateImage:E}=D.usePrinter({elementId:`carousel-table_${w.value}`,fileName:t.value.caption.text||"vue-ui-carousel-table"}),u=e.ref({showAnimation:t.value.animation.use}),s=e.ref(null),F=e.ref(null),m=e.ref(null),h=e.ref(null),g=e.ref(0),x=e.ref(0),$=e.ref(!1),T=e.ref(null),d=e.ref(null),b=e.ref(0);function N(){T.value&&(d.value={elements:T.value.getElementsByTagName("tr"),heights:Array.from(T.value.getElementsByTagName("tr")).map(o=>o.getBoundingClientRect().height)})}e.onMounted(N);const J=e.computed(()=>!d.value||!d.value.heights.length?0:Math.max(...d.value.heights)+g.value+x.value),K=e.computed(()=>l.dataset.body?t.value.tbody.tr.visible<=l.dataset.body.length?t.value.tbody.tr.visible:l.dataset.body.length:0),Q=e.computed(()=>(t.value.tbody.tr.height+t.value.tbody.tr.td.padding.top+t.value.tbody.tr.td.padding.bottom+t.value.tbody.tr.border.size*2)*K.value+g.value+x.value),A=e.ref(0),y=e.ref(null),k=e.ref(0),c=e.ref(!1),O=e.ref(0);e.onMounted(()=>{m.value&&(g.value=m.value.getBoundingClientRect().height),h.value&&(x.value=h.value.getBoundingClientRect().height),u.value.showAnimation&&d.value&&R()});function W(o){I.value=o,O.value+=1}function R(){!y.value&&!c.value&&(y.value=requestAnimationFrame(V))}function Y(){if(!s.value)return!1;const{scrollTop:o,scrollHeight:a,clientHeight:n}=s.value;return o+n>=a}function V(o){if(c.value)return;k.value||(k.value=o),o-k.value>=t.value.animation.speedMs&&(A.value+=d.value.heights[b.value],(Y()||b.value>=d.value.heights.length)&&(A.value=0,b.value=0),s.value&&(s.value.scrollTo({top:A.value,behavior:"smooth"}),b.value+=1),k.value=o),y.value=requestAnimationFrame(V)}function p(){c.value=!0,cancelAnimationFrame(y.value),y.value=null}e.onBeforeUnmount(p);function C(){!c.value||!u.value.showAnimation||(c.value=!1,k.value=0,R())}function Z(){t.value.animation.pauseOnHover&&p()}const S=e.ref(null);function _(){p(),clearTimeout(S.value)}function H(){clearTimeout(S.value),S.value=setTimeout(C,1e3)}e.watch(()=>t.value.animation.use,o=>{o?(u.value.showAnimation=!0,C()):(u.value.showAnimation=!1,p())});const ee=e.computed(()=>t.value.responsiveBreakpoint);e.onMounted(()=>{const o=new ResizeObserver(a=>{a.forEach(n=>{$.value=n.contentRect.width<ee.value}),g.value=m.value?m.value.getBoundingClientRect().height:0,x.value=h.value?h.value.getBoundingClientRect().height:0,b.value=0,N()});s.value&&o.observe(s.value)});function M(){X()}function L(){u.value.showAnimation=!u.value.showAnimation,u.value.showAnimation?C():p()}function U(){e.nextTick(()=>{const o=l.dataset.head.map((i,B)=>[[l.dataset.body[B]]]),a=[[t.value.caption.text],[l.dataset.head.map(i=>[i])]].concat(o),n=r.createCsvContent(a);r.downloadCsv({csvContent:n,title:t.value.caption.text||"vue-ui-carousel-table"})})}return G({pauseAnimation:p,resumeAnimation:C,toggleAnimation:L,generateCsv:U,generatePdf:M,generateImage:E}),(o,a)=>(e.openBlock(),e.createElementBlock("div",{style:{position:"relative",overflow:"visible"},ref_key:"chartContainer",ref:F},[e.createElementVNode("div",{ref_key:"tableContainer",ref:s,id:`carousel-table_${w.value}`,style:e.normalizeStyle({height:e.unref(z)||e.unref(P)?"auto":`${Math.max(Q.value,J.value)}px`,containerType:"inline-size",position:"relative",overflow:"auto",fontFamily:t.value.fontFamily}),class:e.normalizeClass({"vue-ui-responsive":$.value,"is-playing":!c.value}),onMouseenter:a[0]||(a[0]=n=>Z()),onMouseleave:a[1]||(a[1]=n=>C()),onTouchstart:a[2]||(a[2]=n=>_()),onTouchend:a[3]||(a[3]=n=>H()),onTouchcancel:a[4]||(a[4]=n=>H())},[f.value?(e.openBlock(),e.createElementBlock("table",{key:0,class:"vue-data-ui-carousel-table",style:e.normalizeStyle({...t.value.style,border:`${t.value.border.size}px solid ${t.value.border.color}`,width:"100%",borderCollapse:"collapse"})},[e.createElementVNode("caption",{ref_key:"caption",ref:m,class:"vue-data-ui-carousel-table-caption",style:e.normalizeStyle({...t.value.caption.style,fontFamily:"inherit",position:"sticky",top:0,zIndex:2,paddingTop:t.value.caption.padding.top+"px",paddingRight:t.value.caption.padding.right+"px",paddingBottom:t.value.caption.padding.bottom+"px",paddingLeft:t.value.caption.padding.left+"px",boxShadow:$.value?t.value.thead.tr.style.boxShadow:"none",minHeight:"36px"})},[e.createTextVNode(e.toDisplayString(t.value.caption.text&&!o.$slots.caption?t.value.caption.text:"")+" ",1),e.renderSlot(o.$slots,"caption",{},void 0,!0)],4),e.createElementVNode("thead",{style:e.normalizeStyle({...t.value.thead.style,position:"sticky",top:`${g.value}px`,zIndex:1})},[e.createElementVNode("tr",{ref_key:"tableRow",ref:h,role:"row",style:e.normalizeStyle({...t.value.thead.tr.style,border:t.value.thead.tr.border.size?`${t.value.thead.tr.border.size}px solid ${t.value.thead.tr.border.color}`:"none",boxShadow:$.value?"none":t.value.thead.tr.style.boxShadow}),height:`${t.value.thead.tr.height}px`},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.dataset.head,(n,i)=>(e.openBlock(),e.createElementBlock("th",{role:"cell",key:`th_${i}`,style:e.normalizeStyle({...t.value.thead.tr.th.style,border:t.value.thead.tr.th.border.size?`${t.value.thead.tr.th.border.size}px solid ${t.value.thead.tr.th.border.color}`:"none",paddingTop:t.value.thead.tr.th.padding.top+"px",paddingRight:t.value.thead.tr.th.padding.right+"px",paddingBottom:t.value.thead.tr.th.padding.bottom+"px",paddingLeft:t.value.thead.tr.th.padding.left+"px"})},[e.createTextVNode(e.toDisplayString(o.$slots.th?"":n)+" ",1),e.renderSlot(o.$slots,"th",e.normalizeProps(e.guardReactiveProps({th:n,colIndex:i})),void 0,!0)],4))),128))],12,le)],4),v.dataset.body&&v.dataset.head?(e.openBlock(),e.createElementBlock("tbody",{key:0,ref_key:"tbody",ref:T},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.dataset.body,(n,i)=>(e.openBlock(),e.createElementBlock("tr",{style:e.normalizeStyle({...t.value.tbody.tr.style,border:`${t.value.tbody.tr.border.size}px solid ${t.value.tbody.tr.border.color}`,verticalAlign:"middle"})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n,(B,q)=>(e.openBlock(),e.createElementBlock("td",{role:"cell","data-cell":v.dataset.head[q]||"",style:e.normalizeStyle({...t.value.tbody.tr.td.style,border:`${t.value.tbody.tr.td.border.size}px solid ${t.value.tbody.tr.td.border.color}`,backgroundColor:t.value.tbody.tr.td.style.backgroundColor+e.unref(r.opacity)[i%2===0&&t.value.tbody.tr.td.alternateColor?t.value.tbody.tr.td.alternateOpacity*100:100],paddingTop:t.value.tbody.tr.td.padding.top+"px",paddingRight:t.value.tbody.tr.td.padding.right+"px",paddingBottom:t.value.tbody.tr.td.padding.bottom+"px",paddingLeft:t.value.tbody.tr.td.padding.left+"px",verticalAlign:"middle"}),height:`${t.value.tbody.tr.height}px`},[e.createTextVNode(e.toDisplayString(o.$slots.td?"":B)+" ",1),e.renderSlot(o.$slots,"td",e.normalizeProps(e.guardReactiveProps({td:B,rowIndex:i,colIndex:q})),void 0,!0)],12,re))),256))],4))),256))],512)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0)],46,ne),f.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(oe.default,{key:0,config:{type:"table"}})),t.value.userOptions.show&&f.value?(e.openBlock(),e.createBlock(D.UserOptions,{ref:"details",key:`user_option_${O.value}`,backgroundColor:t.value.style.backgroundColor,color:t.value.style.color,isPrinting:e.unref(z),isImaging:e.unref(P),uid:w.value,hasTooltip:!1,hasPdf:t.value.userOptions.buttons.pdf,hasImg:t.value.userOptions.buttons.img,hasXls:t.value.userOptions.buttons.csv,hasTable:!1,hasLabel:!1,hasAnimation:t.value.userOptions.buttons.animation,isAnimation:!u.value.showAnimation,hasFullscreen:t.value.userOptions.buttons.fullscreen,isFullscreen:I.value,chartElement:F.value,titles:{...t.value.userOptions.buttonTitles},zIndex:3,noOffset:"",onGeneratePdf:M,onGenerateCsv:U,onGenerateImage:e.unref(E),onToggleAnimation:L,onToggleFullscreen:W},e.createSlots({_:2},[o.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionPdf",{},void 0,!0)]),key:"0"}:void 0,o.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionCsv",{},void 0,!0)]),key:"1"}:void 0,o.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionImg",{},void 0,!0)]),key:"2"}:void 0,o.$slots.optionAnimation?{name:"optionAnimation",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionAnimation",{},void 0,!0)]),key:"3"}:void 0,o.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:n,isFullscreen:i})=>[e.renderSlot(o.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:n,isFullscreen:i})),void 0,!0)]),key:"4"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasPdf","hasImg","hasXls","hasAnimation","isAnimation","hasFullscreen","isFullscreen","chartElement","titles","onGenerateImage"])):e.createCommentVNode("",!0)],512))}},ue=ae._export_sfc(ie,[["__scopeId","data-v-c06beec9"]]);exports.default=ue;
|
|
@@ -0,0 +1,330 @@
|
|
|
1
|
+
import { ref as a, onMounted as B, computed as w, onBeforeUnmount as be, watch as ye, openBlock as i, createElementBlock as s, createElementVNode as R, normalizeStyle as d, unref as m, normalizeClass as Ce, createTextVNode as U, toDisplayString as L, renderSlot as v, Fragment as G, renderList as M, normalizeProps as V, guardReactiveProps as D, createCommentVNode as N, createBlock as ie, createSlots as $e, withCtx as I, nextTick as Te } from "vue";
|
|
2
|
+
import { u as xe, c as Ae, o as q, e as X, r as ke, n as we, q as Ie } from "./index-BK818aZo.js";
|
|
3
|
+
import { u as Fe } from "./useNestedProp-hi25rRoY.js";
|
|
4
|
+
import { u as Oe, U as Pe } from "./usePrinter-C-2KAW2f.js";
|
|
5
|
+
import ze from "./vue-ui-skeleton-DJtTdfNg.js";
|
|
6
|
+
import { _ as Be } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
7
|
+
const Re = ["id"], Ne = ["height"], Ee = ["data-cell", "height"], Se = {
|
|
8
|
+
__name: "vue-ui-carousel-table",
|
|
9
|
+
props: {
|
|
10
|
+
config: {
|
|
11
|
+
type: Object,
|
|
12
|
+
default() {
|
|
13
|
+
return {};
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
dataset: {
|
|
17
|
+
type: Object,
|
|
18
|
+
default() {
|
|
19
|
+
return {};
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
setup(h, { expose: ue }) {
|
|
24
|
+
const l = h, { vue_ui_carousel_table: se } = xe(), E = a(Ae()), j = a(!1), b = a(!!l.dataset);
|
|
25
|
+
B(() => {
|
|
26
|
+
q(l.dataset) ? X({
|
|
27
|
+
componentName: "VueUiCarouselTable",
|
|
28
|
+
type: "dataset"
|
|
29
|
+
}) : ((!l.dataset.head || q(l.dataset.head)) && (X({
|
|
30
|
+
componentName: "VueUiCarouselTable",
|
|
31
|
+
type: "datasetAttribute",
|
|
32
|
+
property: "head"
|
|
33
|
+
}), b.value = !1), (!l.dataset.body || q(l.dataset.body)) && (X({
|
|
34
|
+
componentName: "VueUiCarouselTable",
|
|
35
|
+
type: "datasetAttribute",
|
|
36
|
+
property: "body"
|
|
37
|
+
}), b.value = !1));
|
|
38
|
+
});
|
|
39
|
+
const e = w(() => Fe({
|
|
40
|
+
userConfig: l.config,
|
|
41
|
+
defaultConfig: se
|
|
42
|
+
})), { isPrinting: J, isImaging: K, generatePdf: re, generateImage: Q } = Oe({
|
|
43
|
+
elementId: `carousel-table_${E.value}`,
|
|
44
|
+
fileName: e.value.caption.text || "vue-ui-carousel-table"
|
|
45
|
+
}), r = a({
|
|
46
|
+
showAnimation: e.value.animation.use
|
|
47
|
+
}), p = a(null), W = a(null), y = a(null), C = a(null), $ = a(0), F = a(0), O = a(!1), P = a(null), c = a(null), T = a(0);
|
|
48
|
+
function Y() {
|
|
49
|
+
P.value && (c.value = {
|
|
50
|
+
elements: P.value.getElementsByTagName("tr"),
|
|
51
|
+
heights: Array.from(P.value.getElementsByTagName("tr")).map((t) => t.getBoundingClientRect().height)
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
B(Y);
|
|
55
|
+
const de = w(() => !c.value || !c.value.heights.length ? 0 : Math.max(...c.value.heights) + $.value + F.value), ve = w(() => l.dataset.body ? e.value.tbody.tr.visible <= l.dataset.body.length ? e.value.tbody.tr.visible : l.dataset.body.length : 0), pe = w(() => (e.value.tbody.tr.height + e.value.tbody.tr.td.padding.top + e.value.tbody.tr.td.padding.bottom + e.value.tbody.tr.border.size * 2) * ve.value + $.value + F.value), S = a(0), x = a(null), A = a(0), f = a(!1), Z = a(0);
|
|
56
|
+
B(() => {
|
|
57
|
+
y.value && ($.value = y.value.getBoundingClientRect().height), C.value && (F.value = C.value.getBoundingClientRect().height), r.value.showAnimation && c.value && _();
|
|
58
|
+
});
|
|
59
|
+
function ce(t) {
|
|
60
|
+
j.value = t, Z.value += 1;
|
|
61
|
+
}
|
|
62
|
+
function _() {
|
|
63
|
+
!x.value && !f.value && (x.value = requestAnimationFrame(ee));
|
|
64
|
+
}
|
|
65
|
+
function he() {
|
|
66
|
+
if (!p.value) return !1;
|
|
67
|
+
const { scrollTop: t, scrollHeight: o, clientHeight: n } = p.value;
|
|
68
|
+
return t + n >= o;
|
|
69
|
+
}
|
|
70
|
+
function ee(t) {
|
|
71
|
+
if (f.value) return;
|
|
72
|
+
A.value || (A.value = t), t - A.value >= e.value.animation.speedMs && (S.value += c.value.heights[T.value], (he() || T.value >= c.value.heights.length) && (S.value = 0, T.value = 0), p.value && (p.value.scrollTo({
|
|
73
|
+
top: S.value,
|
|
74
|
+
behavior: "smooth"
|
|
75
|
+
}), T.value += 1), A.value = t), x.value = requestAnimationFrame(ee);
|
|
76
|
+
}
|
|
77
|
+
function g() {
|
|
78
|
+
f.value = !0, cancelAnimationFrame(x.value), x.value = null;
|
|
79
|
+
}
|
|
80
|
+
be(g);
|
|
81
|
+
function k() {
|
|
82
|
+
!f.value || !r.value.showAnimation || (f.value = !1, A.value = 0, _());
|
|
83
|
+
}
|
|
84
|
+
function fe() {
|
|
85
|
+
e.value.animation.pauseOnHover && g();
|
|
86
|
+
}
|
|
87
|
+
const H = a(null);
|
|
88
|
+
function ge() {
|
|
89
|
+
g(), clearTimeout(H.value);
|
|
90
|
+
}
|
|
91
|
+
function te() {
|
|
92
|
+
clearTimeout(H.value), H.value = setTimeout(k, 1e3);
|
|
93
|
+
}
|
|
94
|
+
ye(
|
|
95
|
+
() => e.value.animation.use,
|
|
96
|
+
(t) => {
|
|
97
|
+
t ? (r.value.showAnimation = !0, k()) : (r.value.showAnimation = !1, g());
|
|
98
|
+
}
|
|
99
|
+
);
|
|
100
|
+
const me = w(() => e.value.responsiveBreakpoint);
|
|
101
|
+
B(() => {
|
|
102
|
+
const t = new ResizeObserver((o) => {
|
|
103
|
+
o.forEach((n) => {
|
|
104
|
+
O.value = n.contentRect.width < me.value;
|
|
105
|
+
}), $.value = y.value ? y.value.getBoundingClientRect().height : 0, F.value = C.value ? C.value.getBoundingClientRect().height : 0, T.value = 0, Y();
|
|
106
|
+
});
|
|
107
|
+
p.value && t.observe(p.value);
|
|
108
|
+
});
|
|
109
|
+
function ae() {
|
|
110
|
+
re();
|
|
111
|
+
}
|
|
112
|
+
function oe() {
|
|
113
|
+
r.value.showAnimation = !r.value.showAnimation, r.value.showAnimation ? k() : g();
|
|
114
|
+
}
|
|
115
|
+
function ne() {
|
|
116
|
+
Te(() => {
|
|
117
|
+
const t = l.dataset.head.map((u, z) => [
|
|
118
|
+
[l.dataset.body[z]]
|
|
119
|
+
]), o = [
|
|
120
|
+
[e.value.caption.text],
|
|
121
|
+
[l.dataset.head.map((u) => [u])]
|
|
122
|
+
].concat(t), n = we(o);
|
|
123
|
+
Ie({
|
|
124
|
+
csvContent: n,
|
|
125
|
+
title: e.value.caption.text || "vue-ui-carousel-table"
|
|
126
|
+
});
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
return ue({
|
|
130
|
+
pauseAnimation: g,
|
|
131
|
+
resumeAnimation: k,
|
|
132
|
+
toggleAnimation: oe,
|
|
133
|
+
generateCsv: ne,
|
|
134
|
+
generatePdf: ae,
|
|
135
|
+
generateImage: Q
|
|
136
|
+
}), (t, o) => (i(), s("div", {
|
|
137
|
+
style: { position: "relative", overflow: "visible" },
|
|
138
|
+
ref_key: "chartContainer",
|
|
139
|
+
ref: W
|
|
140
|
+
}, [
|
|
141
|
+
R("div", {
|
|
142
|
+
ref_key: "tableContainer",
|
|
143
|
+
ref: p,
|
|
144
|
+
id: `carousel-table_${E.value}`,
|
|
145
|
+
style: d({
|
|
146
|
+
height: m(J) || m(K) ? "auto" : `${Math.max(pe.value, de.value)}px`,
|
|
147
|
+
containerType: "inline-size",
|
|
148
|
+
position: "relative",
|
|
149
|
+
overflow: "auto",
|
|
150
|
+
fontFamily: e.value.fontFamily
|
|
151
|
+
}),
|
|
152
|
+
class: Ce({ "vue-ui-responsive": O.value, "is-playing": !f.value }),
|
|
153
|
+
onMouseenter: o[0] || (o[0] = (n) => fe()),
|
|
154
|
+
onMouseleave: o[1] || (o[1] = (n) => k()),
|
|
155
|
+
onTouchstart: o[2] || (o[2] = (n) => ge()),
|
|
156
|
+
onTouchend: o[3] || (o[3] = (n) => te()),
|
|
157
|
+
onTouchcancel: o[4] || (o[4] = (n) => te())
|
|
158
|
+
}, [
|
|
159
|
+
b.value ? (i(), s("table", {
|
|
160
|
+
key: 0,
|
|
161
|
+
class: "vue-data-ui-carousel-table",
|
|
162
|
+
style: d({
|
|
163
|
+
...e.value.style,
|
|
164
|
+
border: `${e.value.border.size}px solid ${e.value.border.color}`,
|
|
165
|
+
width: "100%",
|
|
166
|
+
borderCollapse: "collapse"
|
|
167
|
+
})
|
|
168
|
+
}, [
|
|
169
|
+
R("caption", {
|
|
170
|
+
ref_key: "caption",
|
|
171
|
+
ref: y,
|
|
172
|
+
class: "vue-data-ui-carousel-table-caption",
|
|
173
|
+
style: d({
|
|
174
|
+
...e.value.caption.style,
|
|
175
|
+
fontFamily: "inherit",
|
|
176
|
+
position: "sticky",
|
|
177
|
+
top: 0,
|
|
178
|
+
zIndex: 2,
|
|
179
|
+
paddingTop: e.value.caption.padding.top + "px",
|
|
180
|
+
paddingRight: e.value.caption.padding.right + "px",
|
|
181
|
+
paddingBottom: e.value.caption.padding.bottom + "px",
|
|
182
|
+
paddingLeft: e.value.caption.padding.left + "px",
|
|
183
|
+
boxShadow: O.value ? e.value.thead.tr.style.boxShadow : "none",
|
|
184
|
+
minHeight: "36px"
|
|
185
|
+
})
|
|
186
|
+
}, [
|
|
187
|
+
U(L(e.value.caption.text && !t.$slots.caption ? e.value.caption.text : "") + " ", 1),
|
|
188
|
+
v(t.$slots, "caption", {}, void 0, !0)
|
|
189
|
+
], 4),
|
|
190
|
+
R("thead", {
|
|
191
|
+
style: d({ ...e.value.thead.style, position: "sticky", top: `${$.value}px`, zIndex: 1 })
|
|
192
|
+
}, [
|
|
193
|
+
R("tr", {
|
|
194
|
+
ref_key: "tableRow",
|
|
195
|
+
ref: C,
|
|
196
|
+
role: "row",
|
|
197
|
+
style: d({
|
|
198
|
+
...e.value.thead.tr.style,
|
|
199
|
+
border: e.value.thead.tr.border.size ? `${e.value.thead.tr.border.size}px solid ${e.value.thead.tr.border.color}` : "none",
|
|
200
|
+
boxShadow: O.value ? "none" : e.value.thead.tr.style.boxShadow
|
|
201
|
+
}),
|
|
202
|
+
height: `${e.value.thead.tr.height}px`
|
|
203
|
+
}, [
|
|
204
|
+
(i(!0), s(G, null, M(h.dataset.head, (n, u) => (i(), s("th", {
|
|
205
|
+
role: "cell",
|
|
206
|
+
key: `th_${u}`,
|
|
207
|
+
style: d({
|
|
208
|
+
...e.value.thead.tr.th.style,
|
|
209
|
+
border: e.value.thead.tr.th.border.size ? `${e.value.thead.tr.th.border.size}px solid ${e.value.thead.tr.th.border.color}` : "none",
|
|
210
|
+
paddingTop: e.value.thead.tr.th.padding.top + "px",
|
|
211
|
+
paddingRight: e.value.thead.tr.th.padding.right + "px",
|
|
212
|
+
paddingBottom: e.value.thead.tr.th.padding.bottom + "px",
|
|
213
|
+
paddingLeft: e.value.thead.tr.th.padding.left + "px"
|
|
214
|
+
})
|
|
215
|
+
}, [
|
|
216
|
+
U(L(t.$slots.th ? "" : n) + " ", 1),
|
|
217
|
+
v(t.$slots, "th", V(D({ th: n, colIndex: u })), void 0, !0)
|
|
218
|
+
], 4))), 128))
|
|
219
|
+
], 12, Ne)
|
|
220
|
+
], 4),
|
|
221
|
+
h.dataset.body && h.dataset.head ? (i(), s("tbody", {
|
|
222
|
+
key: 0,
|
|
223
|
+
ref_key: "tbody",
|
|
224
|
+
ref: P
|
|
225
|
+
}, [
|
|
226
|
+
(i(!0), s(G, null, M(h.dataset.body, (n, u) => (i(), s("tr", {
|
|
227
|
+
style: d({
|
|
228
|
+
...e.value.tbody.tr.style,
|
|
229
|
+
border: `${e.value.tbody.tr.border.size}px solid ${e.value.tbody.tr.border.color}`,
|
|
230
|
+
verticalAlign: "middle"
|
|
231
|
+
})
|
|
232
|
+
}, [
|
|
233
|
+
(i(!0), s(G, null, M(n, (z, le) => (i(), s("td", {
|
|
234
|
+
role: "cell",
|
|
235
|
+
"data-cell": h.dataset.head[le] || "",
|
|
236
|
+
style: d({
|
|
237
|
+
...e.value.tbody.tr.td.style,
|
|
238
|
+
border: `${e.value.tbody.tr.td.border.size}px solid ${e.value.tbody.tr.td.border.color}`,
|
|
239
|
+
backgroundColor: e.value.tbody.tr.td.style.backgroundColor + m(ke)[u % 2 === 0 && e.value.tbody.tr.td.alternateColor ? e.value.tbody.tr.td.alternateOpacity * 100 : 100],
|
|
240
|
+
paddingTop: e.value.tbody.tr.td.padding.top + "px",
|
|
241
|
+
paddingRight: e.value.tbody.tr.td.padding.right + "px",
|
|
242
|
+
paddingBottom: e.value.tbody.tr.td.padding.bottom + "px",
|
|
243
|
+
paddingLeft: e.value.tbody.tr.td.padding.left + "px",
|
|
244
|
+
verticalAlign: "middle"
|
|
245
|
+
}),
|
|
246
|
+
height: `${e.value.tbody.tr.height}px`
|
|
247
|
+
}, [
|
|
248
|
+
U(L(t.$slots.td ? "" : z) + " ", 1),
|
|
249
|
+
v(t.$slots, "td", V(D({ td: z, rowIndex: u, colIndex: le })), void 0, !0)
|
|
250
|
+
], 12, Ee))), 256))
|
|
251
|
+
], 4))), 256))
|
|
252
|
+
], 512)) : N("", !0)
|
|
253
|
+
], 4)) : N("", !0)
|
|
254
|
+
], 46, Re),
|
|
255
|
+
b.value ? N("", !0) : (i(), ie(ze, {
|
|
256
|
+
key: 0,
|
|
257
|
+
config: {
|
|
258
|
+
type: "table"
|
|
259
|
+
}
|
|
260
|
+
})),
|
|
261
|
+
e.value.userOptions.show && b.value ? (i(), ie(Pe, {
|
|
262
|
+
ref: "details",
|
|
263
|
+
key: `user_option_${Z.value}`,
|
|
264
|
+
backgroundColor: e.value.style.backgroundColor,
|
|
265
|
+
color: e.value.style.color,
|
|
266
|
+
isPrinting: m(J),
|
|
267
|
+
isImaging: m(K),
|
|
268
|
+
uid: E.value,
|
|
269
|
+
hasTooltip: !1,
|
|
270
|
+
hasPdf: e.value.userOptions.buttons.pdf,
|
|
271
|
+
hasImg: e.value.userOptions.buttons.img,
|
|
272
|
+
hasXls: e.value.userOptions.buttons.csv,
|
|
273
|
+
hasTable: !1,
|
|
274
|
+
hasLabel: !1,
|
|
275
|
+
hasAnimation: e.value.userOptions.buttons.animation,
|
|
276
|
+
isAnimation: !r.value.showAnimation,
|
|
277
|
+
hasFullscreen: e.value.userOptions.buttons.fullscreen,
|
|
278
|
+
isFullscreen: j.value,
|
|
279
|
+
chartElement: W.value,
|
|
280
|
+
titles: { ...e.value.userOptions.buttonTitles },
|
|
281
|
+
zIndex: 3,
|
|
282
|
+
noOffset: "",
|
|
283
|
+
onGeneratePdf: ae,
|
|
284
|
+
onGenerateCsv: ne,
|
|
285
|
+
onGenerateImage: m(Q),
|
|
286
|
+
onToggleAnimation: oe,
|
|
287
|
+
onToggleFullscreen: ce
|
|
288
|
+
}, $e({ _: 2 }, [
|
|
289
|
+
t.$slots.optionPdf ? {
|
|
290
|
+
name: "optionPdf",
|
|
291
|
+
fn: I(() => [
|
|
292
|
+
v(t.$slots, "optionPdf", {}, void 0, !0)
|
|
293
|
+
]),
|
|
294
|
+
key: "0"
|
|
295
|
+
} : void 0,
|
|
296
|
+
t.$slots.optionCsv ? {
|
|
297
|
+
name: "optionCsv",
|
|
298
|
+
fn: I(() => [
|
|
299
|
+
v(t.$slots, "optionCsv", {}, void 0, !0)
|
|
300
|
+
]),
|
|
301
|
+
key: "1"
|
|
302
|
+
} : void 0,
|
|
303
|
+
t.$slots.optionImg ? {
|
|
304
|
+
name: "optionImg",
|
|
305
|
+
fn: I(() => [
|
|
306
|
+
v(t.$slots, "optionImg", {}, void 0, !0)
|
|
307
|
+
]),
|
|
308
|
+
key: "2"
|
|
309
|
+
} : void 0,
|
|
310
|
+
t.$slots.optionAnimation ? {
|
|
311
|
+
name: "optionAnimation",
|
|
312
|
+
fn: I(() => [
|
|
313
|
+
v(t.$slots, "optionAnimation", {}, void 0, !0)
|
|
314
|
+
]),
|
|
315
|
+
key: "3"
|
|
316
|
+
} : void 0,
|
|
317
|
+
t.$slots.optionFullscreen ? {
|
|
318
|
+
name: "optionFullscreen",
|
|
319
|
+
fn: I(({ toggleFullscreen: n, isFullscreen: u }) => [
|
|
320
|
+
v(t.$slots, "optionFullscreen", V(D({ toggleFullscreen: n, isFullscreen: u })), void 0, !0)
|
|
321
|
+
]),
|
|
322
|
+
key: "4"
|
|
323
|
+
} : void 0
|
|
324
|
+
]), 1032, ["backgroundColor", "color", "isPrinting", "isImaging", "uid", "hasPdf", "hasImg", "hasXls", "hasAnimation", "isAnimation", "hasFullscreen", "isFullscreen", "chartElement", "titles", "onGenerateImage"])) : N("", !0)
|
|
325
|
+
], 512));
|
|
326
|
+
}
|
|
327
|
+
}, De = /* @__PURE__ */ Be(Se, [["__scopeId", "data-v-c06beec9"]]);
|
|
328
|
+
export {
|
|
329
|
+
De as default
|
|
330
|
+
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { useCssVars as Pe, computed as $, ref as z, onMounted as Ve, openBlock as a, createElementBlock as o, normalizeClass as m, normalizeStyle as h, createBlock as Q, unref as y, createSlots as Re, withCtx as E, renderSlot as X, normalizeProps as Be, guardReactiveProps as Me, createCommentVNode as b, toDisplayString as n, createElementVNode as s, Fragment as p, renderList as _, createTextVNode as Y, withKeys as je, createVNode as Xe, nextTick as ve } from "vue";
|
|
2
|
-
import { u as Oe, c as Ge, t as Ee, a as Ae, p as I, b as Ue, g as Z, e as H, d as ee, o as De, X as Ye, s as ye, r as F, C as he, m as fe, i as qe, j as L, k as q, n as He, q as We } from "./index-
|
|
3
|
-
import { u as Ke, U as Je } from "./usePrinter-
|
|
4
|
-
import Qe from "./vue-ui-skeleton-
|
|
5
|
-
import Ze from "./BaseIcon-
|
|
6
|
-
import et from "./vue-ui-accordion-
|
|
7
|
-
import { u as be } from "./useNestedProp-
|
|
2
|
+
import { u as Oe, c as Ge, t as Ee, a as Ae, p as I, b as Ue, g as Z, e as H, d as ee, o as De, X as Ye, s as ye, r as F, C as he, m as fe, i as qe, j as L, k as q, n as He, q as We } from "./index-BK818aZo.js";
|
|
3
|
+
import { u as Ke, U as Je } from "./usePrinter-C-2KAW2f.js";
|
|
4
|
+
import Qe from "./vue-ui-skeleton-DJtTdfNg.js";
|
|
5
|
+
import Ze from "./BaseIcon-NaAlKaAM.js";
|
|
6
|
+
import et from "./vue-ui-accordion-CH8K6f6J.js";
|
|
7
|
+
import { u as be } from "./useNestedProp-hi25rRoY.js";
|
|
8
8
|
import { _ as tt } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
9
9
|
const lt = ["id"], at = ["xmlns", "viewBox"], ot = { key: 0 }, st = ["fill", "font-weight", "font-size", "x", "y"], ut = ["fill", "font-weight", "font-size", "x", "y"], nt = ["id"], rt = ["stop-color"], it = ["stop-color"], ct = ["id"], dt = ["stop-color"], vt = ["stop-color"], yt = ["id"], ht = ["stop-color"], ft = ["stop-color"], bt = ["stop-color"], pt = ["id"], _t = ["stop-color"], gt = ["stop-color"], xt = ["stop-color"], mt = ["id"], kt = ["stop-color"], wt = ["stop-color"], $t = ["stop-color"], Ct = { key: 1 }, zt = ["x", "y", "font-size", "font-weight", "fill"], Tt = ["x", "y", "font-size", "font-weight", "fill"], Ft = ["d", "stroke"], Nt = ["cx", "cy", "r", "fill"], St = ["cx", "cy", "r", "fill", "stroke", "stroke-width", "onClick"], It = { key: 2 }, Lt = ["x", "y", "font-size", "fill", "onClick"], Pt = { key: 0 }, Vt = ["x", "y", "fill", "font-size", "font-weight"], Rt = ["x", "y", "height", "width", "fill", "rx", "onClick"], Bt = ["x", "y", "height", "width", "fill", "rx", "stroke", "stroke-width", "onClick"], Mt = { key: 3 }, jt = ["x", "y", "fill", "font-size", "onClick"], Xt = ["d", "stroke"], Ot = ["cx", "cy", "fill", "onClick"], Gt = ["fill", "cx", "cy", "r", "onClick"], Et = { key: 4 }, At = ["x", "y", "font-size", "font-weight", "fill"], Ut = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], Dt = ["y", "height", "width"], Yt = { style: { width: "100%", height: "100%", display: "flex", "align-items": "center", "justify-content": "center", "flex-direction": "column" } }, qt = { style: { display: "flex", "align-items": "center", "justify-content": "center", gap: "12px", "flex-wrap": "wrap", "flex-direction": "row" } }, Ht = {
|
|
10
10
|
viewBox: "0 0 20 20",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),n=require("./index-BQbaKiSm.cjs"),U=require("./usePrinter-BANjHBXe.cjs"),ce=require("./vue-ui-skeleton-DIm7kxhc.cjs"),ie=require("./BaseIcon-ByV6y3w8.cjs"),de=require("./vue-ui-accordion-CHVCSgY3.cjs"),q=require("./useNestedProp-B6CpIX-3.cjs"),ye=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),ve=["id"],he=["xmlns","viewBox"],pe={key:0},fe=["fill","font-weight","font-size","x","y"],me=["fill","font-weight","font-size","x","y"],ge=["id"],be=["stop-color"],ke=["stop-color"],xe=["id"],_e=["stop-color"],Be=["stop-color"],Ee=["id"],Se=["stop-color"],Ne=["stop-color"],ze=["stop-color"],Ce=["id"],we=["stop-color"],Ve=["stop-color"],$e=["stop-color"],Te=["id"],Fe=["stop-color"],De=["stop-color"],Le=["stop-color"],Me={key:1},Ie=["x","y","font-size","font-weight","fill"],Pe=["x","y","font-size","font-weight","fill"],Oe=["d","stroke"],Re=["cx","cy","r","fill"],Xe=["cx","cy","r","fill","stroke","stroke-width","onClick"],je={key:2},Ae=["x","y","font-size","fill","onClick"],Ge={key:0},Ue=["x","y","fill","font-size","font-weight"],qe=["x","y","height","width","fill","rx","onClick"],Ye=["x","y","height","width","fill","rx","stroke","stroke-width","onClick"],He={key:3},We=["x","y","fill","font-size","onClick"],Ke=["d","stroke"],Je=["cx","cy","fill","onClick"],Qe=["fill","cx","cy","r","onClick"],Ze={key:4},et=["x","y","font-size","font-weight","fill"],tt=["x1","x2","y1","y2","stroke","stroke-width"],lt=["y","height","width"],at={style:{width:"100%",height:"100%",display:"flex","align-items":"center","justify-content":"center","flex-direction":"column"}},ot={style:{display:"flex","align-items":"center","justify-content":"center",gap:"12px","flex-wrap":"wrap","flex-direction":"row"}},nt={viewBox:"0 0 20 20",height:"16",width:"16"},rt=["fill"],st={key:6},ut=["y","height","width"],ct={style:{width:"100%",height:"100%",display:"flex","align-items":"center","justify-content":"center","flex-direction":"column"}},it={style:{display:"flex","align-items":"center","justify-content":"center",gap:"12px","flex-wrap":"wrap","flex-direction":"row"}},dt={viewBox:"0 0 20 20",height:"16",width:"16"},yt=["fill"],vt=["d","stroke"],ht=["cx","cy","fill"],pt=["cx","cy","fill"],ft=["d","stroke"],mt=["cx","cy","fill"],gt=["cx","cy","fill"],bt=["x","y","fill","font-size","font-weight"],kt=["x","y","fill","font-size","font-weight"],xt=["x","text-anchor","y","fill","font-size"],_t=["x","text-anchor","y","fill","font-size"],Bt=["x","text-anchor","y","fill","font-size"],Et=["x","text-anchor","y","fill","font-size"],St=["x","text-anchor","y","fill","font-size"],Nt=["x","y","font-size","fill"],zt=["x","y","font-size","fill"],Ct=["x","y","font-size","fill"],wt={style:{"padding-top":"36px",position:"relative"}},Vt={class:"vue-ui-data-table"},$t={key:0},Tt=["data-cell"],Ft={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},Dt={key:0},Lt={key:1},Mt=["data-cell"],It={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},Pt={key:0},Ot={key:1},Rt=["data-cell"],Xt={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},jt={key:0},At={key:1},Gt=["data-cell"],Ut={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},qt={key:0},Yt={key:1},Ht=["data-cell"],Wt={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},Kt={key:0},Jt={key:1},Qt=["data-cell"],Zt={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},el={key:0},tl={key:1},ll=["data-cell"],al={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},ol={key:0},nl={key:1},rl=["data-cell"],sl={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},ul=["data-cell"],cl={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},il=["data-cell"],dl={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},yl=["data-cell"],vl={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},hl=["data-cell"],pl={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},fl={__name:"vue-ui-chestnut",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectRoot","selectBranch","selectNut"],setup(Y,{expose:H,emit:N}){const k=Y;e.useCssVars(a=>({a08a8b28:a.tdo}));const{vue_ui_chestnut:W}=n.useConfig(),C=e.computed(()=>!!k.dataset&&k.dataset.length),h=e.ref(n.createUid()),D=e.ref(null),K=e.ref(null),L=e.ref(0),t=e.computed(()=>{const a=q.useNestedProp({userConfig:k.config,defaultConfig:W});return a.theme?{...q.useNestedProp({userConfig:n.themes.vue_ui_chestnut[a.theme]||k.config,defaultConfig:a}),customPalette:n.themePalettes[a.theme]||n.palette}:a}),{isPrinting:J,isImaging:Q,generatePdf:M,generateImage:I}=U.usePrinter({elementId:`vue-ui-chestnut_${h.value}`,fileName:t.value.style.chart.layout.title.text||"vue-ui-chestnut"}),$=e.computed(()=>n.convertCustomPalette(t.value.customPalette)),w=e.ref({showTable:t.value.table.show}),P=e.ref(null),O=e.ref(!1),Z=e.computed(()=>t.value.table.responsiveBreakpoint),r=e.ref({gap:6,padding:{top:102,left:12,right:12,bottom:96},width:1024,height:0,branchSize:32,branchStart:128}),f=e.computed(()=>({left:r.value.padding.left,top:r.value.padding.top,right:r.value.width-r.value.padding.right,bottom:r.value.height-r.value.padding.bottom,width:r.value.width-(r.value.padding.left+r.value.padding.right),height:r.value.height-(r.value.padding.top+r.value.padding.bottom),seedX:r.value.padding.left+64})),x=e.computed(()=>C.value?k.dataset.flatMap(a=>a.branches.map(s=>s.value)).reduce((a,s)=>a+s):0),m=e.computed(()=>(k.dataset.forEach((a,s)=>{n.getMissingDatasetAttributes({datasetObject:a,requiredAttributes:["name","branches"]}).forEach(l=>{n.error({componentName:"VueUiChestnut",type:"datasetSerieAttribute",property:l,index:s})}),a.branches&&a.branches.forEach((l,o)=>{n.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","value"]}).forEach(d=>{n.error({componentName:"VueUiChestnut",type:"datasetSerieAttribute",property:d,index:`${s} - ${o}`})}),l.breakdown&&l.breakdown.forEach((d,i)=>{n.getMissingDatasetAttributes({datasetObject:d,requiredAttributes:["name","value"]}).forEach(y=>{n.error({componentName:"VueUiChestnut",type:"datasetSerieAttribute",property:y,index:`${s} - ${o} - ${i}`})})})})}),k.dataset.map((a,s)=>{const l=a.branches.map(o=>o.value).reduce((o,d)=>o+d);return{...a,color:n.convertColorToHex(a.color)||$.value[s]||n.palette[s]||n.palette[s%n.palette.length],id:a.id||`root_${s}_${h.value}`,type:"root",total:l,rootIndex:s,branches:a.branches.map((o,d)=>({...o,rootName:a.name,rootIndex:s,color:n.convertColorToHex(a.color)||$.value[s]||n.palette[s]||n.palette[s%n.palette.length],value:o.value>=0?o.value:0,id:o.id||`branch_${s}_${d}_${h.value}`,proportionToRoot:o.value/l,type:"branch",breakdown:o.breakdown.map((i,y)=>({table:{rootName:a.name,rootValue:l,rootToTotal:l/x.value,branchName:o.name,branchValue:o.value,branchToTotal:o.value/x.value,branchToRoot:o.value/l,nutName:i.name,nutValue:i.value,nutToTotal:i.value/x.value,nutToRoot:i.value/l,nutToBranch:i.value/o.value},...i,type:"nut",branchName:o.name,rootName:a.name,branchTotal:o.value>=0?o.value:0,proportionToBranch:i.value/o.value,proportionToRoot:i.value/l,proportionToTree:i.value/x.value,rootIndex:s,id:i.id||`nut_${s}_${d}_${y}_${h.value}`,color:n.convertColorToHex(i.color)||$.value[y]||n.palette[y]||n.palette[y%n.palette.length],value:i.value>=0?i.value:0}))}))}})));function ee(){return m.value}const te=e.computed(()=>m.value.flatMap(a=>a.branches).length),le=e.computed(()=>Math.max(...m.value.map(a=>a.branches.map(s=>s.value).reduce((s,l)=>s+l,0)))),ae=e.computed(()=>Math.max(...m.value.flatMap(a=>a.branches.map(s=>s.value)))),R=e.computed(()=>256+r.value.padding.left),B=e.computed(()=>m.value.sort((a,s)=>s.total-a.total).map((a,s)=>{const l=f.value.height/m.value.length/2,o=a.total/le.value*(l>64?64:l);return{...a,x:f.value.seedX,y:f.value.top+f.value.height/m.value.length*(s+1)-(f.value.height/m.value.length/2+r.value.gap/2),r:o<r.value.branchSize/2?r.value.branchSize/2:o}})),oe=e.computed(()=>t.value.style.chart.layout.branches.widthRatio<=0?.1:t.value.style.chart.layout.branches.widthRatio>1.8?1.8:t.value.style.chart.layout.branches.widthRatio),ne=e.computed(()=>B.value.flatMap(a=>a.branches)),_=e.computed(()=>ne.value.sort((a,s)=>s.value-a.value).map((a,s)=>({...a,y1:s*r.value.branchSize+f.value.top+s*r.value.gap,y2:s*r.value.branchSize+r.value.branchSize,x1:R.value,x2:384*a.value/ae.value*oe.value+R.value})));function T(a){const s=B.value.find(l=>l.rootIndex===a.rootIndex);return{x:s.x,y:s.y,r:s.r}}const c=e.ref(null),E=e.ref(null),v=e.ref(null),g=e.ref(null);function p(){c.value=null,v.value=null,g.value=null}function b(a){return g.value?g.value===null?!0:a.type==="root"?a.id===g.value.id:a.rootIndex===g.value.rootIndex:c.value===null&&v.value===null?!0:a.type==="nut"?c.value.id===a.id:a.type==="branch"?v.value.id===a.id:a.type==="root"?v.value&&v.value.rootIndex===a.rootIndex||c.value&&c.value.rootIndex===a.rootIndex:!1}function X(a){p(),e.nextTick(()=>{c.value=a,v.value=a,E.value=n.makeDonut({series:a.breakdown,base:1},a.x2+24+t.value.style.chart.layout.nuts.offsetX,a.y1+r.value.branchSize/2,80,80),N("selectNut",a.breakdown)})}function S(){c.value=null,E.value=null,N("selectNut",null)}function F(a){v.value&&v.value.id===a.id?(v.value=null,p(),N("selectBranch",null)):(p(),v.value=a,N("selectBranch",a))}function j(a){g.value&&g.value.id===a.id?(p(),N("selectRoot",null)):(p(),g.value=a,N("selectRoot",a))}function re(){return f.value.bottom-(c.value.y1+180)<0?0:f.value.bottom}function z(a){return a.proportion*100>t.value.style.chart.layout.nuts.selected.labels.dataLabels.hideUnderValue}function se(){new ResizeObserver(s=>{s.forEach(l=>{O.value=l.contentRect.width<Z.value})}).observe(P.value)}e.onMounted(()=>{n.objectIsEmpty(k.dataset)&&n.error({componentName:"VueUiChestnut",type:"dataset"});const a=te.value*(r.value.branchSize+r.value.gap)+r.value.padding.top+r.value.padding.bottom;r.value.height=a,se()});const u=e.computed(()=>{const a=[t.value.table.th.translations.rootName,t.value.table.th.translations.rootValue,t.value.table.th.translations.rootToTotal,t.value.table.th.translations.branchName,t.value.table.th.translations.branchValue,t.value.table.th.translations.branchToRoot,t.value.table.th.translations.branchToTotal,t.value.table.th.translations.nutName,t.value.table.th.translations.nutValue,t.value.table.th.translations.nutToBranch,t.value.table.th.translations.nutToRoot,t.value.table.th.translations.nutToTotal],s=m.value.flatMap((l,o)=>l.branches.flatMap((d,i)=>d.breakdown.flatMap((y,gl)=>y.table)));return{head:a,body:s}});function A(){e.nextTick(()=>{const a=[[t.value.style.chart.layout.title.text],[t.value.style.chart.layout.title.subtitle.text],[""],["Grand total",x.value],[""]],s=u.value.head,l=u.value.body.map((i,y)=>[u.value.body[y-1]&&u.value.body[y-1].rootName===i.rootName?"":i.rootName,u.value.body[y-1]&&u.value.body[y-1].rootName===i.rootName?"":i.rootValue,u.value.body[y-1]&&u.value.body[y-1].rootName===i.rootName?"":i.rootToTotal,u.value.body[y-1]&&u.value.body[y-1].branchName===i.branchName?"":i.branchName,u.value.body[y-1]&&u.value.body[y-1].branchName===i.branchName?"":i.branchValue,u.value.body[y-1]&&u.value.body[y-1].branchName===i.branchName?"":i.branchToRoot,u.value.body[y-1]&&u.value.body[y-1].branchName===i.branchName?"":i.branchToTotal,i.nutName,i.nutValue,i.nutToBranch,i.nutToRoot,i.nutToTotal]),o=a.concat([s]).concat(l),d=n.createCsvContent(o);n.downloadCsv({csvContent:d,title:t.value.style.chart.layout.title.text||"vue-ui-chestnut"})})}const V=e.ref(!1);function ue(a){V.value=a,L.value+=1}function G(){w.value.showTable=!w.value.showTable}return H({getData:ee,generatePdf:M,generateCsv:A,generateImage:I,toggleTable:G}),(a,s)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(`vue-ui-chestnut ${V.value?"vue-data-ui-wrapper-fullscreen":""}`),ref_key:"chestnutChart",ref:D,id:`vue-ui-chestnut_${h.value}`,style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};width:100%; text-align:center;padding-top:36px;background:${t.value.style.chart.backgroundColor}`)},[t.value.userOptions.show&&C.value?(e.openBlock(),e.createBlock(U.UserOptions,{ref_key:"details",ref:K,key:`user_options_${L.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isImaging:e.unref(Q),isPrinting:e.unref(J),uid:h.value,hasPdf:t.value.userOptions.buttons.pdf,hasImg:t.value.userOptions.buttons.img,hasXls:t.value.userOptions.buttons.csv,hasTable:t.value.userOptions.buttons.table,hasFullscreen:t.value.userOptions.buttons.fullscreen,isFullscreen:V.value,titles:{...t.value.userOptions.buttonTitles},chartElement:D.value,onToggleFullscreen:ue,onGeneratePdf:e.unref(M),onGenerateCsv:A,onGenerateImage:e.unref(I),onToggleTable:G},e.createSlots({_:2},[a.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionPdf",{},void 0,!0)]),key:"0"}:void 0,a.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionCsv",{},void 0,!0)]),key:"1"}:void 0,a.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionImg",{},void 0,!0)]),key:"2"}:void 0,a.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionTable",{},void 0,!0)]),key:"3"}:void 0,a.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:l,isFullscreen:o})=>[e.renderSlot(a.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:l,isFullscreen:o})),void 0,!0)]),key:"4"}:void 0]),1032,["backgroundColor","color","isImaging","isPrinting","uid","hasPdf","hasImg","hasXls","hasTable","hasFullscreen","isFullscreen","titles","chartElement","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),r.value.height>0&&C.value?(e.openBlock(),e.createElementBlock("svg",{key:1,xmlns:e.unref(n.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":V.value,"vue-data-ui-fulscreen--off":!V.value}),viewBox:`0 0 ${r.value.width} ${r.value.height}`,style:e.normalizeStyle(`max-width:100%;overflow:visible;background:${t.value.style.chart.backgroundColor};color:${t.value.style.chart.color}`)},[c.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("g",pe,[t.value.style.chart.layout.title.text?(e.openBlock(),e.createElementBlock("text",{key:0,"text-anchor":"middle",fill:t.value.style.chart.layout.title.color,"font-weight":t.value.style.chart.layout.title.bold?"bold":"normal","font-size":t.value.style.chart.layout.title.fontSize,x:r.value.width/2,y:12+t.value.style.chart.layout.title.fontSize+t.value.style.chart.layout.title.offsetY,onClick:p},e.toDisplayString(t.value.style.chart.layout.title.text),9,fe)):e.createCommentVNode("",!0),t.value.style.chart.layout.title.subtitle.text?(e.openBlock(),e.createElementBlock("text",{key:1,"text-anchor":"middle",fill:t.value.style.chart.layout.title.subtitle.color,"font-weight":t.value.style.chart.layout.title.subtitle.bold?"bold":"normal","font-size":t.value.style.chart.layout.title.subtitle.fontSize,x:r.value.width/2,y:48+t.value.style.chart.layout.title.subtitle.fontSize+t.value.style.chart.layout.title.subtitle.offsetY,onClick:p},e.toDisplayString(t.value.style.chart.layout.title.subtitle.text),9,me)):e.createCommentVNode("",!0)])),e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,(l,o)=>(e.openBlock(),e.createElementBlock("radialGradient",{cx:"50%",cy:"50%",r:"50%",fx:"50%",fy:"50%",id:`root_gradient_${h.value}_${l.rootIndex}`},[e.createElementVNode("stop",{offset:"0%","stop-color":`${e.unref(n.shiftHue)(l.color,.05)}${e.unref(n.opacity)[100-t.value.style.chart.layout.roots.gradientIntensity]}`},null,8,be),e.createElementVNode("stop",{offset:"100%","stop-color":l.color},null,8,ke)],8,ge))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,l=>(e.openBlock(),e.createElementBlock("linearGradient",{x1:"0%",y1:"0%",x2:"100%",y2:"0%",id:`branch_gradient_${h.value}_${l.rootIndex}`},[e.createElementVNode("stop",{offset:"0%","stop-color":l.color},null,8,_e),e.createElementVNode("stop",{offset:"100%","stop-color":`${e.unref(n.shiftHue)(l.color,.02)}${e.unref(n.opacity)[100-t.value.style.chart.layout.branches.gradientIntensity]}`},null,8,Be)],8,xe))),256)),e.createElementVNode("radialGradient",{cx:"50%",cy:"50%",r:"50%",fx:"50%",fy:"50%",id:`nutpick_${h.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":`#FFFFFF${e.unref(n.opacity)[0]}`},null,8,Se),e.createElementVNode("stop",{offset:"80%","stop-color":`#FFFFFF${e.unref(n.opacity)[t.value.style.chart.layout.nuts.selected.gradientIntensity]}`},null,8,Ne),e.createElementVNode("stop",{offset:"100%","stop-color":`#FFFFFF${e.unref(n.opacity)[0]}`},null,8,ze)],8,Ee),e.createElementVNode("radialGradient",{cx:"50%",cy:"50%",r:"50%",fx:"50%",fy:"50%",id:`nut_${h.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":`#FFFFFF${e.unref(n.opacity)[0]}`},null,8,we),e.createElementVNode("stop",{offset:"80%","stop-color":`#FFFFFF${e.unref(n.opacity)[t.value.style.chart.layout.nuts.gradientIntensity]}`},null,8,Ve),e.createElementVNode("stop",{offset:"100%","stop-color":`#FFFFFF${e.unref(n.opacity)[0]}`},null,8,$e)],8,Ce),e.createElementVNode("radialGradient",{cx:"50%",cy:"50%",r:"50%",fx:"50%",fy:"50%",id:`nut_underlayer_${h.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":`${t.value.style.chart.backgroundColor}${e.unref(n.opacity)[100]}`},null,8,Fe),e.createElementVNode("stop",{offset:"80%","stop-color":`${t.value.style.chart.backgroundColor}${e.unref(n.opacity)[60]}`},null,8,De),e.createElementVNode("stop",{offset:"100%","stop-color":`${t.value.style.chart.backgroundColor}${e.unref(n.opacity)[0]}`},null,8,Le)],8,Te)]),t.value.style.chart.layout.grandTotal.show?(e.openBlock(),e.createElementBlock("g",Me,[e.createElementVNode("text",{x:f.value.seedX,y:32+t.value.style.chart.layout.grandTotal.offsetY,"font-size":t.value.style.chart.layout.grandTotal.fontSize,"font-weight":t.value.style.chart.layout.grandTotal.bold?"bold":"normal",fill:t.value.style.chart.layout.grandTotal.color,"text-anchor":"middle",onClick:p},e.toDisplayString(t.value.style.chart.layout.grandTotal.text),9,Ie),e.createElementVNode("text",{x:f.value.seedX,y:38+t.value.style.chart.layout.grandTotal.fontSize+t.value.style.chart.layout.grandTotal.offsetY,"font-size":t.value.style.chart.layout.grandTotal.fontSize,"font-weight":t.value.style.chart.layout.grandTotal.bold?"bold":"normal",fill:t.value.style.chart.layout.grandTotal.color,"text-anchor":"middle",onClick:p},e.toDisplayString(t.value.style.chart.layout.grandTotal.prefix)+" "+e.toDisplayString(x.value.toFixed(t.value.style.chart.layout.grandTotal.roundingValue))+" "+e.toDisplayString(t.value.style.chart.layout.grandTotal.suffix),9,Pe)])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_.value,l=>(e.openBlock(),e.createElementBlock("g",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value.branchSize,(o,d)=>(e.openBlock(),e.createElementBlock("path",{d:`M
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),n=require("./index-Xau3hcRk.cjs"),U=require("./usePrinter-Dhvmhwhf.cjs"),ce=require("./vue-ui-skeleton-CgYrDrh-.cjs"),ie=require("./BaseIcon-BGeIE3vn.cjs"),de=require("./vue-ui-accordion-BjU8im6m.cjs"),q=require("./useNestedProp-C_EQ-Kxy.cjs"),ye=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),ve=["id"],he=["xmlns","viewBox"],pe={key:0},fe=["fill","font-weight","font-size","x","y"],me=["fill","font-weight","font-size","x","y"],ge=["id"],be=["stop-color"],ke=["stop-color"],xe=["id"],_e=["stop-color"],Be=["stop-color"],Ee=["id"],Se=["stop-color"],Ne=["stop-color"],ze=["stop-color"],Ce=["id"],we=["stop-color"],Ve=["stop-color"],$e=["stop-color"],Te=["id"],Fe=["stop-color"],De=["stop-color"],Le=["stop-color"],Me={key:1},Ie=["x","y","font-size","font-weight","fill"],Pe=["x","y","font-size","font-weight","fill"],Oe=["d","stroke"],Re=["cx","cy","r","fill"],Xe=["cx","cy","r","fill","stroke","stroke-width","onClick"],je={key:2},Ae=["x","y","font-size","fill","onClick"],Ge={key:0},Ue=["x","y","fill","font-size","font-weight"],qe=["x","y","height","width","fill","rx","onClick"],Ye=["x","y","height","width","fill","rx","stroke","stroke-width","onClick"],He={key:3},We=["x","y","fill","font-size","onClick"],Ke=["d","stroke"],Je=["cx","cy","fill","onClick"],Qe=["fill","cx","cy","r","onClick"],Ze={key:4},et=["x","y","font-size","font-weight","fill"],tt=["x1","x2","y1","y2","stroke","stroke-width"],lt=["y","height","width"],at={style:{width:"100%",height:"100%",display:"flex","align-items":"center","justify-content":"center","flex-direction":"column"}},ot={style:{display:"flex","align-items":"center","justify-content":"center",gap:"12px","flex-wrap":"wrap","flex-direction":"row"}},nt={viewBox:"0 0 20 20",height:"16",width:"16"},rt=["fill"],st={key:6},ut=["y","height","width"],ct={style:{width:"100%",height:"100%",display:"flex","align-items":"center","justify-content":"center","flex-direction":"column"}},it={style:{display:"flex","align-items":"center","justify-content":"center",gap:"12px","flex-wrap":"wrap","flex-direction":"row"}},dt={viewBox:"0 0 20 20",height:"16",width:"16"},yt=["fill"],vt=["d","stroke"],ht=["cx","cy","fill"],pt=["cx","cy","fill"],ft=["d","stroke"],mt=["cx","cy","fill"],gt=["cx","cy","fill"],bt=["x","y","fill","font-size","font-weight"],kt=["x","y","fill","font-size","font-weight"],xt=["x","text-anchor","y","fill","font-size"],_t=["x","text-anchor","y","fill","font-size"],Bt=["x","text-anchor","y","fill","font-size"],Et=["x","text-anchor","y","fill","font-size"],St=["x","text-anchor","y","fill","font-size"],Nt=["x","y","font-size","fill"],zt=["x","y","font-size","fill"],Ct=["x","y","font-size","fill"],wt={style:{"padding-top":"36px",position:"relative"}},Vt={class:"vue-ui-data-table"},$t={key:0},Tt=["data-cell"],Ft={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},Dt={key:0},Lt={key:1},Mt=["data-cell"],It={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},Pt={key:0},Ot={key:1},Rt=["data-cell"],Xt={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},jt={key:0},At={key:1},Gt=["data-cell"],Ut={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},qt={key:0},Yt={key:1},Ht=["data-cell"],Wt={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},Kt={key:0},Jt={key:1},Qt=["data-cell"],Zt={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},el={key:0},tl={key:1},ll=["data-cell"],al={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},ol={key:0},nl={key:1},rl=["data-cell"],sl={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},ul=["data-cell"],cl={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},il=["data-cell"],dl={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},yl=["data-cell"],vl={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},hl=["data-cell"],pl={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},fl={__name:"vue-ui-chestnut",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectRoot","selectBranch","selectNut"],setup(Y,{expose:H,emit:N}){const k=Y;e.useCssVars(a=>({a08a8b28:a.tdo}));const{vue_ui_chestnut:W}=n.useConfig(),C=e.computed(()=>!!k.dataset&&k.dataset.length),h=e.ref(n.createUid()),D=e.ref(null),K=e.ref(null),L=e.ref(0),t=e.computed(()=>{const a=q.useNestedProp({userConfig:k.config,defaultConfig:W});return a.theme?{...q.useNestedProp({userConfig:n.themes.vue_ui_chestnut[a.theme]||k.config,defaultConfig:a}),customPalette:n.themePalettes[a.theme]||n.palette}:a}),{isPrinting:J,isImaging:Q,generatePdf:M,generateImage:I}=U.usePrinter({elementId:`vue-ui-chestnut_${h.value}`,fileName:t.value.style.chart.layout.title.text||"vue-ui-chestnut"}),$=e.computed(()=>n.convertCustomPalette(t.value.customPalette)),w=e.ref({showTable:t.value.table.show}),P=e.ref(null),O=e.ref(!1),Z=e.computed(()=>t.value.table.responsiveBreakpoint),r=e.ref({gap:6,padding:{top:102,left:12,right:12,bottom:96},width:1024,height:0,branchSize:32,branchStart:128}),f=e.computed(()=>({left:r.value.padding.left,top:r.value.padding.top,right:r.value.width-r.value.padding.right,bottom:r.value.height-r.value.padding.bottom,width:r.value.width-(r.value.padding.left+r.value.padding.right),height:r.value.height-(r.value.padding.top+r.value.padding.bottom),seedX:r.value.padding.left+64})),x=e.computed(()=>C.value?k.dataset.flatMap(a=>a.branches.map(s=>s.value)).reduce((a,s)=>a+s):0),m=e.computed(()=>(k.dataset.forEach((a,s)=>{n.getMissingDatasetAttributes({datasetObject:a,requiredAttributes:["name","branches"]}).forEach(l=>{n.error({componentName:"VueUiChestnut",type:"datasetSerieAttribute",property:l,index:s})}),a.branches&&a.branches.forEach((l,o)=>{n.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","value"]}).forEach(d=>{n.error({componentName:"VueUiChestnut",type:"datasetSerieAttribute",property:d,index:`${s} - ${o}`})}),l.breakdown&&l.breakdown.forEach((d,i)=>{n.getMissingDatasetAttributes({datasetObject:d,requiredAttributes:["name","value"]}).forEach(y=>{n.error({componentName:"VueUiChestnut",type:"datasetSerieAttribute",property:y,index:`${s} - ${o} - ${i}`})})})})}),k.dataset.map((a,s)=>{const l=a.branches.map(o=>o.value).reduce((o,d)=>o+d);return{...a,color:n.convertColorToHex(a.color)||$.value[s]||n.palette[s]||n.palette[s%n.palette.length],id:a.id||`root_${s}_${h.value}`,type:"root",total:l,rootIndex:s,branches:a.branches.map((o,d)=>({...o,rootName:a.name,rootIndex:s,color:n.convertColorToHex(a.color)||$.value[s]||n.palette[s]||n.palette[s%n.palette.length],value:o.value>=0?o.value:0,id:o.id||`branch_${s}_${d}_${h.value}`,proportionToRoot:o.value/l,type:"branch",breakdown:o.breakdown.map((i,y)=>({table:{rootName:a.name,rootValue:l,rootToTotal:l/x.value,branchName:o.name,branchValue:o.value,branchToTotal:o.value/x.value,branchToRoot:o.value/l,nutName:i.name,nutValue:i.value,nutToTotal:i.value/x.value,nutToRoot:i.value/l,nutToBranch:i.value/o.value},...i,type:"nut",branchName:o.name,rootName:a.name,branchTotal:o.value>=0?o.value:0,proportionToBranch:i.value/o.value,proportionToRoot:i.value/l,proportionToTree:i.value/x.value,rootIndex:s,id:i.id||`nut_${s}_${d}_${y}_${h.value}`,color:n.convertColorToHex(i.color)||$.value[y]||n.palette[y]||n.palette[y%n.palette.length],value:i.value>=0?i.value:0}))}))}})));function ee(){return m.value}const te=e.computed(()=>m.value.flatMap(a=>a.branches).length),le=e.computed(()=>Math.max(...m.value.map(a=>a.branches.map(s=>s.value).reduce((s,l)=>s+l,0)))),ae=e.computed(()=>Math.max(...m.value.flatMap(a=>a.branches.map(s=>s.value)))),R=e.computed(()=>256+r.value.padding.left),B=e.computed(()=>m.value.sort((a,s)=>s.total-a.total).map((a,s)=>{const l=f.value.height/m.value.length/2,o=a.total/le.value*(l>64?64:l);return{...a,x:f.value.seedX,y:f.value.top+f.value.height/m.value.length*(s+1)-(f.value.height/m.value.length/2+r.value.gap/2),r:o<r.value.branchSize/2?r.value.branchSize/2:o}})),oe=e.computed(()=>t.value.style.chart.layout.branches.widthRatio<=0?.1:t.value.style.chart.layout.branches.widthRatio>1.8?1.8:t.value.style.chart.layout.branches.widthRatio),ne=e.computed(()=>B.value.flatMap(a=>a.branches)),_=e.computed(()=>ne.value.sort((a,s)=>s.value-a.value).map((a,s)=>({...a,y1:s*r.value.branchSize+f.value.top+s*r.value.gap,y2:s*r.value.branchSize+r.value.branchSize,x1:R.value,x2:384*a.value/ae.value*oe.value+R.value})));function T(a){const s=B.value.find(l=>l.rootIndex===a.rootIndex);return{x:s.x,y:s.y,r:s.r}}const c=e.ref(null),E=e.ref(null),v=e.ref(null),g=e.ref(null);function p(){c.value=null,v.value=null,g.value=null}function b(a){return g.value?g.value===null?!0:a.type==="root"?a.id===g.value.id:a.rootIndex===g.value.rootIndex:c.value===null&&v.value===null?!0:a.type==="nut"?c.value.id===a.id:a.type==="branch"?v.value.id===a.id:a.type==="root"?v.value&&v.value.rootIndex===a.rootIndex||c.value&&c.value.rootIndex===a.rootIndex:!1}function X(a){p(),e.nextTick(()=>{c.value=a,v.value=a,E.value=n.makeDonut({series:a.breakdown,base:1},a.x2+24+t.value.style.chart.layout.nuts.offsetX,a.y1+r.value.branchSize/2,80,80),N("selectNut",a.breakdown)})}function S(){c.value=null,E.value=null,N("selectNut",null)}function F(a){v.value&&v.value.id===a.id?(v.value=null,p(),N("selectBranch",null)):(p(),v.value=a,N("selectBranch",a))}function j(a){g.value&&g.value.id===a.id?(p(),N("selectRoot",null)):(p(),g.value=a,N("selectRoot",a))}function re(){return f.value.bottom-(c.value.y1+180)<0?0:f.value.bottom}function z(a){return a.proportion*100>t.value.style.chart.layout.nuts.selected.labels.dataLabels.hideUnderValue}function se(){new ResizeObserver(s=>{s.forEach(l=>{O.value=l.contentRect.width<Z.value})}).observe(P.value)}e.onMounted(()=>{n.objectIsEmpty(k.dataset)&&n.error({componentName:"VueUiChestnut",type:"dataset"});const a=te.value*(r.value.branchSize+r.value.gap)+r.value.padding.top+r.value.padding.bottom;r.value.height=a,se()});const u=e.computed(()=>{const a=[t.value.table.th.translations.rootName,t.value.table.th.translations.rootValue,t.value.table.th.translations.rootToTotal,t.value.table.th.translations.branchName,t.value.table.th.translations.branchValue,t.value.table.th.translations.branchToRoot,t.value.table.th.translations.branchToTotal,t.value.table.th.translations.nutName,t.value.table.th.translations.nutValue,t.value.table.th.translations.nutToBranch,t.value.table.th.translations.nutToRoot,t.value.table.th.translations.nutToTotal],s=m.value.flatMap((l,o)=>l.branches.flatMap((d,i)=>d.breakdown.flatMap((y,gl)=>y.table)));return{head:a,body:s}});function A(){e.nextTick(()=>{const a=[[t.value.style.chart.layout.title.text],[t.value.style.chart.layout.title.subtitle.text],[""],["Grand total",x.value],[""]],s=u.value.head,l=u.value.body.map((i,y)=>[u.value.body[y-1]&&u.value.body[y-1].rootName===i.rootName?"":i.rootName,u.value.body[y-1]&&u.value.body[y-1].rootName===i.rootName?"":i.rootValue,u.value.body[y-1]&&u.value.body[y-1].rootName===i.rootName?"":i.rootToTotal,u.value.body[y-1]&&u.value.body[y-1].branchName===i.branchName?"":i.branchName,u.value.body[y-1]&&u.value.body[y-1].branchName===i.branchName?"":i.branchValue,u.value.body[y-1]&&u.value.body[y-1].branchName===i.branchName?"":i.branchToRoot,u.value.body[y-1]&&u.value.body[y-1].branchName===i.branchName?"":i.branchToTotal,i.nutName,i.nutValue,i.nutToBranch,i.nutToRoot,i.nutToTotal]),o=a.concat([s]).concat(l),d=n.createCsvContent(o);n.downloadCsv({csvContent:d,title:t.value.style.chart.layout.title.text||"vue-ui-chestnut"})})}const V=e.ref(!1);function ue(a){V.value=a,L.value+=1}function G(){w.value.showTable=!w.value.showTable}return H({getData:ee,generatePdf:M,generateCsv:A,generateImage:I,toggleTable:G}),(a,s)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(`vue-ui-chestnut ${V.value?"vue-data-ui-wrapper-fullscreen":""}`),ref_key:"chestnutChart",ref:D,id:`vue-ui-chestnut_${h.value}`,style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};width:100%; text-align:center;padding-top:36px;background:${t.value.style.chart.backgroundColor}`)},[t.value.userOptions.show&&C.value?(e.openBlock(),e.createBlock(U.UserOptions,{ref_key:"details",ref:K,key:`user_options_${L.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isImaging:e.unref(Q),isPrinting:e.unref(J),uid:h.value,hasPdf:t.value.userOptions.buttons.pdf,hasImg:t.value.userOptions.buttons.img,hasXls:t.value.userOptions.buttons.csv,hasTable:t.value.userOptions.buttons.table,hasFullscreen:t.value.userOptions.buttons.fullscreen,isFullscreen:V.value,titles:{...t.value.userOptions.buttonTitles},chartElement:D.value,onToggleFullscreen:ue,onGeneratePdf:e.unref(M),onGenerateCsv:A,onGenerateImage:e.unref(I),onToggleTable:G},e.createSlots({_:2},[a.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionPdf",{},void 0,!0)]),key:"0"}:void 0,a.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionCsv",{},void 0,!0)]),key:"1"}:void 0,a.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionImg",{},void 0,!0)]),key:"2"}:void 0,a.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionTable",{},void 0,!0)]),key:"3"}:void 0,a.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:l,isFullscreen:o})=>[e.renderSlot(a.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:l,isFullscreen:o})),void 0,!0)]),key:"4"}:void 0]),1032,["backgroundColor","color","isImaging","isPrinting","uid","hasPdf","hasImg","hasXls","hasTable","hasFullscreen","isFullscreen","titles","chartElement","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),r.value.height>0&&C.value?(e.openBlock(),e.createElementBlock("svg",{key:1,xmlns:e.unref(n.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":V.value,"vue-data-ui-fulscreen--off":!V.value}),viewBox:`0 0 ${r.value.width} ${r.value.height}`,style:e.normalizeStyle(`max-width:100%;overflow:visible;background:${t.value.style.chart.backgroundColor};color:${t.value.style.chart.color}`)},[c.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("g",pe,[t.value.style.chart.layout.title.text?(e.openBlock(),e.createElementBlock("text",{key:0,"text-anchor":"middle",fill:t.value.style.chart.layout.title.color,"font-weight":t.value.style.chart.layout.title.bold?"bold":"normal","font-size":t.value.style.chart.layout.title.fontSize,x:r.value.width/2,y:12+t.value.style.chart.layout.title.fontSize+t.value.style.chart.layout.title.offsetY,onClick:p},e.toDisplayString(t.value.style.chart.layout.title.text),9,fe)):e.createCommentVNode("",!0),t.value.style.chart.layout.title.subtitle.text?(e.openBlock(),e.createElementBlock("text",{key:1,"text-anchor":"middle",fill:t.value.style.chart.layout.title.subtitle.color,"font-weight":t.value.style.chart.layout.title.subtitle.bold?"bold":"normal","font-size":t.value.style.chart.layout.title.subtitle.fontSize,x:r.value.width/2,y:48+t.value.style.chart.layout.title.subtitle.fontSize+t.value.style.chart.layout.title.subtitle.offsetY,onClick:p},e.toDisplayString(t.value.style.chart.layout.title.subtitle.text),9,me)):e.createCommentVNode("",!0)])),e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,(l,o)=>(e.openBlock(),e.createElementBlock("radialGradient",{cx:"50%",cy:"50%",r:"50%",fx:"50%",fy:"50%",id:`root_gradient_${h.value}_${l.rootIndex}`},[e.createElementVNode("stop",{offset:"0%","stop-color":`${e.unref(n.shiftHue)(l.color,.05)}${e.unref(n.opacity)[100-t.value.style.chart.layout.roots.gradientIntensity]}`},null,8,be),e.createElementVNode("stop",{offset:"100%","stop-color":l.color},null,8,ke)],8,ge))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,l=>(e.openBlock(),e.createElementBlock("linearGradient",{x1:"0%",y1:"0%",x2:"100%",y2:"0%",id:`branch_gradient_${h.value}_${l.rootIndex}`},[e.createElementVNode("stop",{offset:"0%","stop-color":l.color},null,8,_e),e.createElementVNode("stop",{offset:"100%","stop-color":`${e.unref(n.shiftHue)(l.color,.02)}${e.unref(n.opacity)[100-t.value.style.chart.layout.branches.gradientIntensity]}`},null,8,Be)],8,xe))),256)),e.createElementVNode("radialGradient",{cx:"50%",cy:"50%",r:"50%",fx:"50%",fy:"50%",id:`nutpick_${h.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":`#FFFFFF${e.unref(n.opacity)[0]}`},null,8,Se),e.createElementVNode("stop",{offset:"80%","stop-color":`#FFFFFF${e.unref(n.opacity)[t.value.style.chart.layout.nuts.selected.gradientIntensity]}`},null,8,Ne),e.createElementVNode("stop",{offset:"100%","stop-color":`#FFFFFF${e.unref(n.opacity)[0]}`},null,8,ze)],8,Ee),e.createElementVNode("radialGradient",{cx:"50%",cy:"50%",r:"50%",fx:"50%",fy:"50%",id:`nut_${h.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":`#FFFFFF${e.unref(n.opacity)[0]}`},null,8,we),e.createElementVNode("stop",{offset:"80%","stop-color":`#FFFFFF${e.unref(n.opacity)[t.value.style.chart.layout.nuts.gradientIntensity]}`},null,8,Ve),e.createElementVNode("stop",{offset:"100%","stop-color":`#FFFFFF${e.unref(n.opacity)[0]}`},null,8,$e)],8,Ce),e.createElementVNode("radialGradient",{cx:"50%",cy:"50%",r:"50%",fx:"50%",fy:"50%",id:`nut_underlayer_${h.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":`${t.value.style.chart.backgroundColor}${e.unref(n.opacity)[100]}`},null,8,Fe),e.createElementVNode("stop",{offset:"80%","stop-color":`${t.value.style.chart.backgroundColor}${e.unref(n.opacity)[60]}`},null,8,De),e.createElementVNode("stop",{offset:"100%","stop-color":`${t.value.style.chart.backgroundColor}${e.unref(n.opacity)[0]}`},null,8,Le)],8,Te)]),t.value.style.chart.layout.grandTotal.show?(e.openBlock(),e.createElementBlock("g",Me,[e.createElementVNode("text",{x:f.value.seedX,y:32+t.value.style.chart.layout.grandTotal.offsetY,"font-size":t.value.style.chart.layout.grandTotal.fontSize,"font-weight":t.value.style.chart.layout.grandTotal.bold?"bold":"normal",fill:t.value.style.chart.layout.grandTotal.color,"text-anchor":"middle",onClick:p},e.toDisplayString(t.value.style.chart.layout.grandTotal.text),9,Ie),e.createElementVNode("text",{x:f.value.seedX,y:38+t.value.style.chart.layout.grandTotal.fontSize+t.value.style.chart.layout.grandTotal.offsetY,"font-size":t.value.style.chart.layout.grandTotal.fontSize,"font-weight":t.value.style.chart.layout.grandTotal.bold?"bold":"normal",fill:t.value.style.chart.layout.grandTotal.color,"text-anchor":"middle",onClick:p},e.toDisplayString(t.value.style.chart.layout.grandTotal.prefix)+" "+e.toDisplayString(x.value.toFixed(t.value.style.chart.layout.grandTotal.roundingValue))+" "+e.toDisplayString(t.value.style.chart.layout.grandTotal.suffix),9,Pe)])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_.value,l=>(e.openBlock(),e.createElementBlock("g",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value.branchSize,(o,d)=>(e.openBlock(),e.createElementBlock("path",{d:`M
|
|
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,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, r as T } from "./index-
|
|
2
|
+
import { u as z } from "./useNestedProp-hi25rRoY.js";
|
|
3
|
+
import { u as O, c as B, X as N, r as T } from "./index-BK818aZo.js";
|
|
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",
|