vue-data-ui 2.3.2 → 2.3.4
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-B6gJebT9.js +101 -0
- package/dist/Arrow-C5yj6zwY.cjs +1 -0
- package/dist/BaseIcon-7_g11dRj.js +174 -0
- package/dist/BaseIcon-JtWoVorZ.cjs +1 -0
- package/dist/DataTable-CwaOlAsy.js +127 -0
- package/dist/DataTable-Rm9II-m2.cjs +1 -0
- package/dist/Legend-CxvJTjEm.js +62 -0
- package/dist/Legend-D59FIuMs.cjs +1 -0
- package/dist/Shape-CVItL3vh.cjs +1 -0
- package/dist/Shape-CjLV0scA.js +107 -0
- package/dist/Slicer-Bxg5niHl.js +156 -0
- package/dist/Slicer-Cdss5Rus.cjs +1 -0
- package/dist/Title-2iks1ziC.js +46 -0
- package/dist/Title-Bb-A5OSV.cjs +1 -0
- package/dist/Tooltip-C3phqKuU.js +94 -0
- package/dist/Tooltip-C_UE6y-E.cjs +1 -0
- package/dist/_plugin-vue_export-helper-BHFhmbuH.cjs +1 -0
- package/dist/_plugin-vue_export-helper-CHgC5LLL.js +9 -0
- package/dist/html2canvas.esm-BA_v9SIU.cjs +22 -0
- package/dist/html2canvas.esm-d2sM-0Wm.js +4870 -0
- package/dist/index-p5gfZSvB.cjs +4 -0
- package/dist/index-uOtklCCx.js +10268 -0
- package/dist/{index.es-BoVO5twe.js → index.es-YufTdp0y.js} +1 -1
- package/dist/{index.es-w_iDpZ-o.cjs → index.es-uyeSCnWE.cjs} +1 -1
- package/dist/jspdf.es.min-C660YX78.js +8038 -0
- package/dist/jspdf.es.min-DLYY9DTT.cjs +243 -0
- package/dist/pdf-97UbtKC2.js +44 -0
- package/dist/pdf-Cz3729tZ.cjs +1 -0
- package/dist/style.css +1 -1
- package/dist/useNestedProp-2kIU-7On.cjs +1 -0
- package/dist/useNestedProp-BgWkUab_.js +13 -0
- package/dist/usePrinter-B6xQCyL-.js +464 -0
- package/dist/usePrinter-fZlsJid8.cjs +1 -0
- package/dist/useResponsive-B3TrDDIG.cjs +1 -0
- package/dist/useResponsive-NZB-WLRF.js +187 -0
- package/dist/vue-data-ui-Be0rgmbA.cjs +9 -0
- package/dist/vue-data-ui-Ccy6rBZN.js +246 -0
- package/dist/vue-data-ui.cjs +1 -1
- package/dist/vue-data-ui.js +62 -61
- package/dist/vue-ui-3d-bar-BKMPFDi2.js +1085 -0
- package/dist/vue-ui-3d-bar-CKa4UXq4.cjs +19 -0
- package/dist/vue-ui-accordion-C_pwrAJl.cjs +1 -0
- package/dist/vue-ui-accordion-HJPf7My0.js +77 -0
- package/dist/vue-ui-age-pyramid-CE1xnA-8.cjs +1 -0
- package/dist/vue-ui-age-pyramid-DB_CL-gu.js +596 -0
- package/dist/vue-ui-annotator-BAMZcPlH.cjs +371 -0
- package/dist/vue-ui-annotator-DQsAL-nZ.js +2177 -0
- package/dist/vue-ui-candlestick-DCl8fpNu.js +657 -0
- package/dist/vue-ui-candlestick-Duv6oG79.cjs +2 -0
- package/dist/vue-ui-chestnut-BYHA6MT4.js +1051 -0
- package/dist/vue-ui-chestnut-mIZ4-ZEM.cjs +6 -0
- package/dist/vue-ui-cursor-C96IChA3.js +229 -0
- package/dist/vue-ui-cursor-De7dy4Mo.cjs +1 -0
- package/dist/vue-ui-dashboard-B2Yz41yO.js +232 -0
- package/dist/vue-ui-dashboard-BMGwKr0K.cjs +1 -0
- package/dist/vue-ui-digits-BnxLp7zQ.js +153 -0
- package/dist/vue-ui-digits-DSWyL-5K.cjs +1 -0
- package/dist/vue-ui-donut-1kei9ws5.cjs +1 -0
- package/dist/vue-ui-donut-B9iXisHK.js +743 -0
- package/dist/vue-ui-donut-evolution-B7Sun8sw.js +799 -0
- package/dist/vue-ui-donut-evolution-yv17DnGy.cjs +1 -0
- package/dist/vue-ui-dumbbell-BJEf_JEq.cjs +9 -0
- package/dist/vue-ui-dumbbell-DIsDnD1d.js +624 -0
- package/dist/vue-ui-flow-BTivYoGd.js +454 -0
- package/dist/vue-ui-flow-DOxJa8di.cjs +1 -0
- package/dist/vue-ui-galaxy-BEmywfFB.js +485 -0
- package/dist/vue-ui-galaxy-CHGOwCwM.cjs +1 -0
- package/dist/vue-ui-gauge-QAfMl-8t.cjs +1 -0
- package/dist/vue-ui-gauge-o4rDOqF3.js +466 -0
- package/dist/vue-ui-heatmap-BS4EzedX.cjs +1 -0
- package/dist/vue-ui-heatmap-DwqQqEsk.js +598 -0
- package/dist/vue-ui-kpi-F4qkJ_U-.cjs +1 -0
- package/dist/vue-ui-kpi-h8elYTcA.js +54 -0
- package/dist/vue-ui-mini-loader-C_8B2Pm6.cjs +1 -0
- package/dist/vue-ui-mini-loader-Cgoi9rhH.js +131 -0
- package/dist/vue-ui-molecule-Bmv76SWz.js +750 -0
- package/dist/vue-ui-molecule-C5CY_YYc.cjs +1 -0
- package/dist/vue-ui-mood-radar-BN0dzlfp.cjs +1 -0
- package/dist/vue-ui-mood-radar-DeMouUIe.js +548 -0
- package/dist/vue-ui-nested-donuts-ZyFoV-Zn.cjs +16 -0
- package/dist/vue-ui-nested-donuts-wOUkSVyZ.js +771 -0
- package/dist/vue-ui-onion-DCOKG2wG.js +554 -0
- package/dist/vue-ui-onion-VmTUo7TR.cjs +1 -0
- package/dist/vue-ui-parallel-coordinate-plot-BGtO2P4a.js +651 -0
- package/dist/vue-ui-parallel-coordinate-plot-BziXRF8E.cjs +8 -0
- package/dist/vue-ui-quadrant--JOTjPZh.js +1178 -0
- package/dist/vue-ui-quadrant-DawUUrur.cjs +1 -0
- package/dist/vue-ui-quick-chart-LXKfaJgS.js +1310 -0
- package/dist/vue-ui-quick-chart-jFlFtiNV.cjs +13 -0
- package/dist/vue-ui-radar-CWNIqvcA.js +614 -0
- package/dist/vue-ui-radar-VGH-lhaT.cjs +1 -0
- package/dist/vue-ui-rating-BNrIoJHN.js +271 -0
- package/dist/vue-ui-rating-Dtu6pwGx.cjs +1 -0
- package/dist/vue-ui-relation-circle-B3NKudOy.js +304 -0
- package/dist/vue-ui-relation-circle-Dwpx9o18.cjs +1 -0
- package/dist/vue-ui-rings-CsUngX_F.js +510 -0
- package/dist/vue-ui-rings-D9_OG--0.cjs +1 -0
- package/dist/vue-ui-scatter-DUsuh7bd.cjs +1 -0
- package/dist/vue-ui-scatter-DgxTz4Jx.js +874 -0
- package/dist/vue-ui-screenshot-51H_VrYY.js +160 -0
- package/dist/vue-ui-screenshot-C2Dz7CAe.cjs +3 -0
- package/dist/vue-ui-skeleton-BM9rwmxY.js +2064 -0
- package/dist/vue-ui-skeleton-sjfOtCZr.cjs +41 -0
- package/dist/vue-ui-smiley-DNnBtHht.cjs +2 -0
- package/dist/vue-ui-smiley-H5rSN-1B.js +763 -0
- package/dist/vue-ui-spark-trend-CLXZDYlk.js +246 -0
- package/dist/vue-ui-spark-trend-R4JJvfry.cjs +1 -0
- package/dist/vue-ui-sparkbar-C0k4ah-7.js +242 -0
- package/dist/vue-ui-sparkbar-CEUDIw0A.cjs +1 -0
- package/dist/vue-ui-sparkgauge-BHj00A07.js +157 -0
- package/dist/vue-ui-sparkgauge-CaEw6nmI.cjs +1 -0
- package/dist/vue-ui-sparkhistogram-B6GuavEu.cjs +1 -0
- package/dist/vue-ui-sparkhistogram-DbMLYKqE.js +244 -0
- package/dist/vue-ui-sparkline-CJydanLS.cjs +1 -0
- package/dist/vue-ui-sparkline-CYova9x3.js +333 -0
- package/dist/vue-ui-sparkstackbar-Df__yM5b.cjs +1 -0
- package/dist/vue-ui-sparkstackbar-N5rVBM2h.js +244 -0
- package/dist/vue-ui-strip-plot-DJJ1vEWz.js +618 -0
- package/dist/vue-ui-strip-plot-b5lhB35d.cjs +1 -0
- package/dist/vue-ui-table-NHhOVDbs.cjs +14 -0
- package/dist/vue-ui-table-heatmap-Cro2etCY.js +237 -0
- package/dist/vue-ui-table-heatmap-DlL2nCqz.cjs +1 -0
- package/dist/vue-ui-table-sparkline-Bw2Gc_ur.cjs +1 -0
- package/dist/vue-ui-table-sparkline-DppMitqF.js +420 -0
- package/dist/vue-ui-table-xSvwJIa7.js +1430 -0
- package/dist/vue-ui-thermometer-M2kdp1x5.js +385 -0
- package/dist/vue-ui-thermometer-Q_3PX2V3.cjs +1 -0
- package/dist/vue-ui-timer-BtSDeIRp.cjs +64 -0
- package/dist/vue-ui-timer-CAaQ-QD6.js +453 -0
- package/dist/vue-ui-tiremarks-CbGOSEvD.cjs +1 -0
- package/dist/vue-ui-tiremarks-JFv4JLP0.js +249 -0
- package/dist/vue-ui-treemap-BqDX-bPf.cjs +1 -0
- package/dist/vue-ui-treemap-DCnv-xYr.js +722 -0
- package/dist/vue-ui-vertical-bar-CEbApJZl.js +737 -0
- package/dist/vue-ui-vertical-bar-CJB_KXyr.cjs +4 -0
- package/dist/vue-ui-waffle-CTS6C7gu.js +638 -0
- package/dist/vue-ui-waffle-IMEbGe-b.cjs +1 -0
- package/dist/vue-ui-wheel-CuOmEWMQ.cjs +1 -0
- package/dist/vue-ui-wheel-_zyCdFiI.js +227 -0
- package/dist/vue-ui-word-cloud-RDlXBEAN.js +346 -0
- package/dist/vue-ui-word-cloud-Y7Yk7uUJ.cjs +1 -0
- package/dist/vue-ui-xy-BZJQBKnU.cjs +3 -0
- package/dist/vue-ui-xy-DsvN9EIQ.js +2064 -0
- package/dist/vue-ui-xy-canvas-D_dnbyFS.cjs +9 -0
- package/dist/vue-ui-xy-canvas-Dbcw8-9Q.js +1006 -0
- package/package.json +1 -1
- package/dist/index-C6KVJkgd.cjs +0 -843
- package/dist/index-bDBuMYfe.js +0 -57303
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),i=require("./index-p5gfZSvB.cjs"),se=require("./Title-Bb-A5OSV.cjs"),X=require("./usePrinter-fZlsJid8.cjs"),ue=require("./vue-ui-skeleton-sjfOtCZr.cjs"),ie=require("./DataTable-Rm9II-m2.cjs"),ce=require("./vue-ui-accordion-C_pwrAJl.cjs"),Z=require("./useNestedProp-2kIU-7On.cjs"),de=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),P=w=>(e.pushScopeId("data-v-30081550"),w=w(),e.popScopeId(),w),he=["id"],ve=["xmlns","viewBox"],fe=["id"],pe=["stop-color"],ke=["stop-color"],me=["id"],ye=["stop-color"],ge=["stop-color"],$e=["id"],_e=["stop-color"],xe=["stop-color"],Be=["id"],be=["stop-color"],Ce=["stop-color"],Ee=["stop-color"],Ne={key:0},we=["id"],Ve=["stop-color"],Fe=["stop-color"],Me=["id"],Se=["stop-color"],De=["stop-color"],Pe=["id"],Te=["stop-color"],Le=["stop-color"],ze=["id"],je=P(()=>e.createElementVNode("stop",{offset:"0%","stop-color":"#FFFFFF"},null,-1)),Oe=P(()=>e.createElementVNode("stop",{offset:"100%","stop-color":"#FFFFFF33"},null,-1)),He=[je,Oe],Ie=["x","y","font-size","font-weight","fill"],We=["x","y"],Ge=["d","stroke"],Ae=["d","stroke"],qe={key:3},Ue={key:0},Xe=["stroke-dasharray","d","stroke","stroke-width"],Ze=["stroke-dasharray","d","stroke","stroke-width"],Re=["stroke-dasharray","d","stroke","stroke-width"],Ye=["stroke-dasharray","d","stroke","stroke-width"],Je={key:1},Ke=["d","stroke","stroke-width","fill"],Qe=["d","stroke","stroke-width","fill"],et=["d","stroke","stroke-width","fill"],tt={key:2},lt=["d","fill","onMouseenter","onClick"],ot=["d","fill","onMouseenter","onClick"],nt=["d","fill","onMouseenter","onClick"],rt=["d","onMouseenter","onClick"],at=["d"],st=["d","stroke"],ut=["onClick"],it=["stroke","d"],ct=["cx","cy","fill","stroke"],dt=["x","y","width","height"],ht={key:1},vt=["d","stroke"],ft=["d","fill","stroke"],pt=["id"],kt=["stop-color"],mt=P(()=>e.createElementVNode("stop",{offset:"77%","stop-color":"#FFFFFF20"},null,-1)),yt=["stop-color"],gt=["cx","cy","fill"],$t=["cx","cy","fill"],_t={key:0},xt=["text-anchor","x","y","fill","font-size"],Bt=["text-anchor","x","y","fill","font-size"],bt={key:2},Ct=["d","fill","stroke"],Et={key:4},Nt={key:0},wt=["stroke-dasharray","d","stroke","stroke-width"],Vt=["stroke-dasharray","d","stroke","stroke-width"],Ft=["stroke-dasharray","d","stroke","stroke-width"],Mt=["stroke-dasharray","d","stroke","stroke-width"],St=["d","stroke","stroke-width","fill"],Dt=["d","stroke","stroke-width","fill"],Pt={key:1},Tt=["onClick"],Lt=["id"],zt=["stop-color"],jt=["stop-color"],Ot=["id"],Ht=["stop-color"],It=["stop-color"],Wt=["stop-color"],Gt=["stop-color"],At=["stop-color"],qt=["onMouseenter","onClick","d","fill"],Ut=["onMouseenter","onClick","d"],Xt=["onMouseenter","onClick","d","fill"],Zt=["onClick"],Rt=["stroke","d"],Yt=["cx","cy","fill","stroke"],Jt=["x","y","width","height"],Kt={key:1},Qt=["d","stroke"],el=["d","fill","stroke"],tl=["id"],ll=["stop-color"],ol=P(()=>e.createElementVNode("stop",{offset:"77%","stop-color":"#FFFFFF20"},null,-1)),nl=["stop-color"],rl=["cx","cy","fill"],al=["cx","cy","fill"],sl={key:0},ul=["text-anchor","x","y","fill","font-size"],il=["text-anchor","x","y","fill","font-size"],cl={key:2},dl=["d","fill","stroke"],hl=["innerHTML"],vl={__name:"vue-ui-3d-bar",props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{}}}},emits:["selectDatapoint"],setup(w,{expose:R,emit:F}){const p=w,{vue_ui_3d_bar:Y}=i.useConfig(),M=e.computed(()=>!!p.dataset&&Object.keys(p.dataset).length),m=e.ref(i.createUid()),J=e.ref(null),z=e.ref(null),b=e.ref(!1),l=e.computed(()=>{const u=Z.useNestedProp({userConfig:p.config,defaultConfig:Y});return u.theme?{...Z.useNestedProp({userConfig:i.themes.vue_ui_3d_bar[u.theme]||p.config,defaultConfig:u}),customPalette:i.themePalettes[u.theme]||i.palette}:u}),{isPrinting:K,isImaging:Q,generatePdf:j,generateImage:O}=X.usePrinter({elementId:`3d_bar_${m.value}`,fileName:l.value.style.chart.title.text||"vue-ui-3d-bar"}),ee=e.computed(()=>i.convertCustomPalette(l.value.customPalette)),S=e.ref({showTable:l.value.table.show}),$=e.computed(()=>p.dataset.series&&p.dataset.series.length),n=e.computed(()=>({height:l.value.style.chart.box.dimensions.height,width:l.value.style.chart.box.dimensions.width,absoluteWidth:l.value.style.chart.box.dimensions.width*($.value?2:1),top:l.value.style.chart.box.dimensions.top,bottom:l.value.style.chart.box.dimensions.bottom,left:l.value.style.chart.box.dimensions.left,right:l.value.style.chart.box.dimensions.right,perspective:l.value.style.chart.box.dimensions.perspective})),g=e.computed(()=>{if($.value){const u=p.dataset.series.map(o=>o.value||0).reduce((o,a)=>o+a,0),r=p.dataset.series.map((o,a)=>({...o,id:i.createUid(),proportion:(o.value||0)/u,color:i.convertColorToHex(o.color)||ee.value[a]||i.palette[a]||i.palette[a%i.palette.length],breakdown:o.breakdown?o.breakdown.sort((s,f)=>f.value-s.value):null})).sort((o,a)=>a.value-o.value),t=[];let c=0;for(let o=0;o<r.length;o+=1)t.push({...r[o],fill:te(c,r[o].proportion,r[o].breakdown,r[o].color)}),c+=r[o].proportion;return t}return null}),x=e.computed(()=>({right:`M${n.value.width/2},${n.value.top} ${n.value.width-n.value.right}, ${n.value.top+n.value.perspective} ${n.value.width-n.value.right},${n.value.height-n.value.bottom-n.value.perspective} ${n.value.width/2},${n.value.height-n.value.bottom}`,left:`M${n.value.width/2},${n.value.top} ${n.value.left},${n.value.top+n.value.perspective} ${n.value.left},${n.value.height-n.value.bottom-n.value.perspective} ${n.value.width/2},${n.value.height-n.value.bottom}`,side:`M${n.value.width/2},${n.value.height-n.value.bottom} ${n.value.width/2},${n.value.top+n.value.perspective*2}`,topSides:`M${n.value.left},${n.value.top+n.value.perspective} ${n.value.width/2},${n.value.top+n.value.perspective*2} ${n.value.width-n.value.right},${n.value.top+n.value.perspective}`,tubeTop:`M${n.value.left},${n.value.top+n.value.perspective} C ${n.value.left},${n.value.top-n.value.perspective/3} ${n.value.width-n.value.right},${n.value.top-n.value.perspective/3} ${n.value.width-n.value.right},${n.value.top+n.value.perspective} C ${n.value.width-n.value.right},${n.value.top+n.value.perspective*2.3} ${n.value.left},${n.value.top+n.value.perspective*2.3} ${n.value.left},${n.value.top+n.value.perspective}`,tubeLeft:`M${n.value.left},${n.value.top+n.value.perspective} ${n.value.left},${n.value.height-n.value.bottom-n.value.perspective}`,tubeRight:`M${n.value.width-n.value.right},${n.value.top+n.value.perspective} ${n.value.width-n.value.right},${n.value.height-n.value.bottom-n.value.perspective}`,tubeBottom:`M${n.value.width-n.value.right},${n.value.height-n.value.bottom-n.value.perspective} C ${n.value.width-n.value.right},${n.value.height} ${n.value.left},${n.value.height} ${n.value.left},${n.value.height-n.value.bottom-n.value.perspective}`})),C=e.ref(l.value.style.chart.animation.use?0:p.dataset.percentage);e.onMounted(()=>{i.objectIsEmpty(p.dataset)?i.error({componentName:"VueUi3dBar",type:"dataset"}):p.dataset.series?p.dataset.series.forEach((o,a)=>{i.getMissingDatasetAttributes({datasetObject:o,requiredAttributes:["name","value"]}).forEach(s=>{i.error({componentName:"VueUi3dBar",type:"datasetSerieAttribute",property:s,index:a})}),o.breakdown&&o.breakdown.forEach((s,f)=>{i.getMissingDatasetAttributes({datasetObject:s,requiredAttributes:["name","value"]}).forEach(k=>{i.error({componentName:"VueUi3dBar",type:"datasetSerieAttribute",property:k,index:`${a} - ${f}`})})})}):i.getMissingDatasetAttributes({datasetObject:p.dataset,requiredAttributes:["percentage"]}).forEach(o=>{i.error({componentName:"VueUi3dBar",type:"datasetAttribute",property:o})});let u=0,r=l.value.style.chart.animation.speed,t=.005*l.value.style.chart.animation.acceleration;function c(){C.value+=r+u,u+=t,C.value<p.dataset.percentage?requestAnimationFrame(c):C.value=p.dataset.percentage}l.value.style.chart.animation.use&&(C.value=0,c())});function te(u,r,t,c){const o=n.value.height-n.value.bottom-n.value.top-n.value.perspective*2,{width:a,height:s,bottom:f,right:k,left:h,perspective:v}=n.value,d=f+o*u,L=s-d-v-o*r/2,ne=L>n.value.height/2?"top":"bottom",G=64,re=!!t;let A=null,q=null;return re&&(t=t.map((U,ae)=>({...U,value:U.value||0,color:i.lightenHexColor(c,ae/t.length)})),A=i.makeDonut({series:t},a+n.value.absoluteWidth/4-14,ne==="top"?L-G:L+G,28,28,1.99999,2,1,360,105.25,14),q=i.makeDonut({series:t},a-k+20,s-d-v-o*r/2,6,6,1.99999,2,1,360,105.25,6)),{donut:A,miniDonut:q,sidePointer:{x:a-k,y:s-d-v-o*r/2,topY:s-d-v-o*r,height:o*r},apexBottom:{y:s-d,x:a/2},apexTop:{y:s-d-o*r,x:a/2},right:`M${a/2},${s-d} ${a/2},${s-d-o*r} ${a-k},${s-d-v-o*r} ${a-k},${s-d-v}Z`,left:`M${a/2},${s-d} ${a/2},${s-d-o*r} ${h}, ${s-d-v-o*r} ${h},${s-d-v}Z`,liningTop:`M${h},${s-d-v-o*r} ${a/2},${s-d-o*r} ${a-k},${s-d-v-o*r}`,liningTopShade:`M${h},${s-d-v-o*r-.5} ${a/2},${s-d-o*r-.5} ${a-k},${s-d-v-o*r-.5}`,top:`M${a/2},${s-d-o*r} ${h},${s-d-v-o*r} ${a/2},${s-d-v*2-o*r} ${a-k},${s-d-v-o*r} Z`,tubeTop:`M${h},${s-d-o*r-v} C ${h},${s-d-o*r-v*2.5} ${a-k},${s-d-o*r-v*2.5} ${a-k},${s-d-o*r-v} C ${a-k},${s-d-o*r+v/2} ${h},${s-d-o*r+v/2} ${h},${s-d-o*r-v}`,bottomTubeTop:`M ${a-k-.5},${s-d-v} C ${a-k-.5},${s-d+v/2} ${h},${s-d+v/2} ${h+.5},${s-d-v}`,tubeBody:`M
|
|
2
|
+
${h},${s-d-o*r-v}
|
|
3
|
+
C ${h},${s-d-o*r+v/2}
|
|
4
|
+
${a-k},${s-d-o*r+v/2}
|
|
5
|
+
${a-k},${s-d-o*r-v}
|
|
6
|
+
L${a-k},${s-d-v}
|
|
7
|
+
C
|
|
8
|
+
${a-k},${s-d+v/2}
|
|
9
|
+
${h},${s-d+v/2}
|
|
10
|
+
${h},${s-d-v}Z`}}const V=e.computed(()=>{const u=C.value/100,r=n.value.height-n.value.bottom-n.value.top-n.value.perspective*2,{width:t,height:c,bottom:o,right:a,left:s,perspective:f}=n.value,h=o+r*0;return{right:`M${t/2},${c-h} ${t/2},${c-h-r*u} ${t-a},${c-h-f-r*u} ${t-a},${c-h-f}Z`,left:`M${t/2},${c-h} ${t/2},${c-h-r*u} ${s}, ${c-h-f-r*u} ${s},${c-h-f}Z`,top:`M${t/2},${c-h-r*u} ${s},${c-h-f-r*u} ${t/2},${c-h-f*2-r*u} ${t-a},${c-h-f-r*u} Z`,tubeTop:`M${s},${c-h-r*u-f} C ${s},${c-h-r*u-f*2.5} ${t-a},${c-h-r*u-f*2.5} ${t-a},${c-h-r*u-f} C ${t-a},${c-h-r*u+f/2} ${s},${c-h-r*u+f/2} ${s},${c-h-r*u-f}`,tubeBody:`M
|
|
11
|
+
${s},${c-h-r*u-f}
|
|
12
|
+
C ${s},${c-h-r*u+f/2}
|
|
13
|
+
${t-a},${c-h-r*u+f/2}
|
|
14
|
+
${t-a},${c-h-r*u-f}
|
|
15
|
+
L${t-a},${c-f*1.5}
|
|
16
|
+
C
|
|
17
|
+
${t-a},${c}
|
|
18
|
+
${s},${c}
|
|
19
|
+
${s},${c-h-f}Z`}}),y=e.ref(null);function _(u,r=!1){F("selectDatapoint",u),r||(y.value=u.id),r&&b.value&&(b.value=!1),r&&!b.value&&(b.value=!0)}function E(){b.value||(y.value=null)}function N(u,r,t=!1){const c=p.dataset.series.map(s=>s.value||0).reduce((s,f)=>s+f,0),o=isNaN(u.value/c)?0:u.value/c*100,a=isNaN(u.value/H(r))?0:u.value/H(r)*100;return t?a:o.toFixed(0)+"%"}function H(u){return[...u].map(r=>r.value).reduce((r,t)=>r+t,0)}const T=e.ref(!1);function le(u){T.value=u}function oe(){return $.value?g.value:p.dataset.percentage}const B=e.computed(()=>{if($.value){const u=g.value.flatMap(t=>t.breakdown&&t.breakdown.length?[{name:t.name,color:t.color},...t.breakdown.map((c,o)=>({name:c.name,color:i.lightenHexColor(t.color,o/t.breakdown.length)}))]:{name:t.name,color:t.color}),r=g.value.flatMap(t=>t.breakdown&&t.breakdown.length?[t.value,...t.breakdown.map(c=>c.value)]:t.value);return{head:u,body:r}}else return null});function I(){if(!$.value){console.warn("VueUi3dBar : CSV download is only available in stack mode (providing dataset.series instead of dataset.percentage)");return}e.nextTick(()=>{const u=g.value.map(o=>o.value).reduce((o,a)=>o+a,0),r=B.value.head.map((o,a)=>[[o.name],[B.value.body[a]],[isNaN(B.value.body[a]/u)?"-":B.value.body[a]/u*100]]),t=[[l.value.style.chart.title.text],[l.value.style.chart.title.subtitle.text],[[""],["val"],["%"]]].concat(r),c=i.createCsvContent(t);i.downloadCsv({csvContent:c,title:l.value.style.chart.title.text||"vue-ui-3d-bar"})})}const D=e.computed(()=>{const u=g.value.map(a=>a.value).reduce((a,s)=>a+s,0),r=[' <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M18 16v2a1 1 0 0 1 -1 1h-11l6 -7l-6 -7h11a1 1 0 0 1 1 1v2" /></svg>',i.dataLabel({p:l.value.style.chart.legend.prefix,v:u,s:l.value.style.chart.legend.suffix,r:l.value.table.td.roundingValue}),"100%"],t=B.value.head.map((a,s)=>{const f=i.dataLabel({p:l.value.style.chart.legend.prefix,v:B.value.body[s],s:l.value.style.chart.legend.suffix,r:l.value.table.td.roundingValue});return[{color:a.color,name:a.name},f,isNaN(B.value.body[s]/u)?"-":(B.value.body[s]/u*100).toFixed(l.value.table.td.roundingPercentage)+"%"]}),c={th:{backgroundColor:l.value.table.th.backgroundColor,color:l.value.table.th.color,outline:l.value.table.th.outline},td:{backgroundColor:l.value.table.td.backgroundColor,color:l.value.table.td.color,outline:l.value.table.td.outline},breakpoint:l.value.table.responsiveBreakpoint,shape:l.value.style.shape==="tube"?"circle":"square"};return{colNames:[l.value.table.columnNames.series,l.value.table.columnNames.value,l.value.table.columnNames.percentage],head:r,body:t,config:c}});function W(){S.value.showTable=!S.value.showTable}return R({generateCsv:I,generatePdf:j,generateImage:O,getData:oe,toggleTable:W}),(u,r)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"bar3dChart",ref:z,class:e.normalizeClass("vue-ui-3d-bar"),style:e.normalizeStyle(`font-family:${l.value.style.fontFamily};width:100%; text-align:center;background:${l.value.style.chart.backgroundColor}`),id:`3d_bar_${m.value}`},[l.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle(`width:100%;background:${l.value.style.chart.backgroundColor}`)},[e.createVNode(se._sfc_main,{config:{title:{cy:"3dBar-div-title",...l.value.style.chart.title},subtitle:{cy:"3dBar-div-subtitle",...l.value.style.chart.title.subtitle}}},null,8,["config"])],4)):e.createCommentVNode("",!0),l.value.userOptions.show&&M.value?(e.openBlock(),e.createBlock(X.UserOptions,{key:1,ref_key:"details",ref:J,backgroundColor:l.value.style.chart.backgroundColor,color:l.value.style.chart.color,isPrinting:e.unref(K),isImaging:e.unref(Q),uid:m.value,hasPdf:l.value.userOptions.buttons.pdf,hasTable:!!$.value&&l.value.userOptions.buttons.table,hasXls:!!$.value&&l.value.userOptions.buttons.csv,hasImg:l.value.userOptions.buttons.img,hasFullscreen:l.value.userOptions.buttons.fullscreen,titles:{...l.value.userOptions.buttonTitles},chartElement:z.value,onToggleFullscreen:le,onGeneratePdf:e.unref(j),onGenerateCsv:I,onGenerateImage:e.unref(O),onToggleTable:W},e.createSlots({_:2},[u.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(u.$slots,"optionPdf",{},void 0,!0)]),key:"0"}:void 0,u.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(u.$slots,"optionCsv",{},void 0,!0)]),key:"1"}:void 0,u.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(u.$slots,"optionImg",{},void 0,!0)]),key:"2"}:void 0,u.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(u.$slots,"optionTable",{},void 0,!0)]),key:"3"}:void 0,u.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:t,isFullscreen:c})=>[e.renderSlot(u.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:t,isFullscreen:c})),void 0,!0)]),key:"4"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasPdf","hasTable","hasXls","hasImg","hasFullscreen","titles","chartElement","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),M.value?(e.openBlock(),e.createElementBlock("svg",{key:2,xmlns:e.unref(i.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":T.value,"vue-data-ui-fulscreen--off":!T.value}),viewBox:`0 0 ${n.value.absoluteWidth} ${n.value.height}`,style:e.normalizeStyle(`max-width:100%; overflow: visible; background:${l.value.style.chart.backgroundColor};color:${l.value.style.chart.color}`)},[e.createElementVNode("defs",null,[e.createElementVNode("radialGradient",{id:`gradient_top${m.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":`${e.unref(i.convertColorToHex)(l.value.style.chart.backgroundColor)}00`},null,8,pe),e.createElementVNode("stop",{offset:"100%","stop-color":`${l.value.style.chart.bar.color}`},null,8,ke)],8,fe),e.createElementVNode("radialGradient",{id:`gradient_left${m.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":`${e.unref(i.convertColorToHex)(l.value.style.chart.backgroundColor)}00`},null,8,ye),e.createElementVNode("stop",{offset:"100%","stop-color":`${l.value.style.chart.bar.color}33`},null,8,ge)],8,me),e.createElementVNode("radialGradient",{id:`gradient_right${m.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":`${e.unref(i.convertColorToHex)(l.value.style.chart.backgroundColor)}00`},null,8,_e),e.createElementVNode("stop",{offset:"100%","stop-color":`${l.value.style.chart.bar.color}33`},null,8,xe)],8,$e),e.createElementVNode("linearGradient",{id:`gradient_tube_body${m.value}`,x1:"0%",y1:"0%",x2:"100%",y2:"0%"},[e.createElementVNode("stop",{offset:"0%","stop-color":`${l.value.style.chart.bar.color}`},null,8,be),e.createElementVNode("stop",{offset:"75%","stop-color":`${e.unref(i.convertColorToHex)(l.value.style.chart.backgroundColor)}00`},null,8,Ce),e.createElementVNode("stop",{offset:"100%","stop-color":`${l.value.style.chart.bar.color}66`},null,8,Ee)],8,Be)]),$.value?(e.openBlock(),e.createElementBlock("defs",Ne,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,t=>(e.openBlock(),e.createElementBlock("radialGradient",{id:`grad_top_${t.id}`},[e.createElementVNode("stop",{offset:"0%","stop-color":`${e.unref(i.lightenHexColor)(t.color,.5)}DD`},null,8,Ve),e.createElementVNode("stop",{offset:"100%","stop-color":`${t.color}`},null,8,Fe)],8,we))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,t=>(e.openBlock(),e.createElementBlock("linearGradient",{id:`grad_left_${t.id}`},[e.createElementVNode("stop",{offset:"0%","stop-color":`${t.color}DD`},null,8,Se),e.createElementVNode("stop",{offset:"100%","stop-color":`${e.unref(i.darkenHexColor)(t.color,.5)}FF`},null,8,De)],8,Me))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,t=>(e.openBlock(),e.createElementBlock("linearGradient",{id:`grad_right_${t.id}`},[e.createElementVNode("stop",{offset:"2%","stop-color":`${e.unref(i.lightenHexColor)(t.color,.5)}FF`},null,8,Te),e.createElementVNode("stop",{offset:"100%","stop-color":`${t.color}DD`},null,8,Le)],8,Pe))),256)),e.createElementVNode("linearGradient",{x1:"0%",y1:"0%",x2:"0%",y2:"100%",id:`vertical_line_${m.value}`},He,8,ze)])):e.createCommentVNode("",!0),l.value.style.chart.dataLabel.show&&![null,void 0].includes(p.dataset.percentage)&&[null,void 0].includes(p.dataset.series)?(e.openBlock(),e.createElementBlock("text",{key:1,x:n.value.width/2,y:n.value.top-l.value.style.chart.dataLabel.fontSize/2,"font-size":l.value.style.chart.dataLabel.fontSize,"font-weight":l.value.style.chart.dataLabel.bold?"bold":"normal",fill:l.value.style.chart.dataLabel.color,"text-anchor":"middle"},e.toDisplayString(Number((isNaN(C.value)?0:C.value).toFixed(l.value.style.chart.dataLabel.rounding)).toLocaleString())+" % ",9,Ie)):e.createCommentVNode("",!0),b.value?(e.openBlock(),e.createElementBlock("g",{key:2,onClick:r[0]||(r[0]=t=>{b.value=!1,y.value=null}),"data-html2canvas-ignore":"",style:{cursor:"pointer"}},[e.createElementVNode("rect",{x:n.value.width/2-6,y:n.value.top-20,height:12,width:12,fill:"transparent"},null,8,We),e.createElementVNode("path",{d:`M${n.value.width/2-6},${n.value.top-20} ${n.value.width/2+6},${n.value.top-9}`,stroke:l.value.style.chart.color,"stroke-linecap":"round","stroke-width":"1"},null,8,Ge),e.createElementVNode("path",{d:`M${n.value.width/2+6},${n.value.top-20} ${n.value.width/2-6},${n.value.top-9}`,stroke:l.value.style.chart.color,"stroke-linecap":"round","stroke-width":"1"},null,8,Ae)])):e.createCommentVNode("",!0),!l.value.style.shape||l.value.style.shape==="bar"?(e.openBlock(),e.createElementBlock("g",qe,[$.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("g",Ue,[e.createElementVNode("path",{"stroke-dasharray":l.value.style.chart.box.strokeDasharray,d:x.value.right,stroke:l.value.style.chart.box.stroke,"stroke-width":l.value.style.chart.box.strokeWidth,"stroke-linejoin":"round","stroke-linecap":"round",fill:"none"},null,8,Xe),e.createElementVNode("path",{"stroke-dasharray":l.value.style.chart.box.strokeDasharray,d:x.value.left,stroke:l.value.style.chart.box.stroke,"stroke-width":l.value.style.chart.box.strokeWidth,"stroke-linejoin":"round","stroke-linecap":"round",fill:"none"},null,8,Ze),e.createElementVNode("path",{"stroke-dasharray":l.value.style.chart.box.strokeDasharray,d:x.value.side,stroke:l.value.style.chart.box.stroke,"stroke-width":l.value.style.chart.box.strokeWidth,"stroke-linejoin":"round","stroke-linecap":"round",fill:"none"},null,8,Re),e.createElementVNode("path",{"stroke-dasharray":l.value.style.chart.box.strokeDasharray,d:x.value.topSides,stroke:l.value.style.chart.box.stroke,"stroke-width":l.value.style.chart.box.strokeWidth,"stroke-linejoin":"round","stroke-linecap":"round",fill:"none"},null,8,Ye)])),$.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("g",Je,[e.createElementVNode("path",{d:V.value.right,stroke:l.value.style.chart.bar.stroke,"stroke-width":l.value.style.chart.bar.strokeWidth,"stroke-linejoin":"round","stroke-linecap":"round",fill:`url(#gradient_right${m.value})`},null,8,Ke),e.createElementVNode("path",{d:V.value.left,stroke:l.value.style.chart.bar.stroke,"stroke-width":l.value.style.chart.bar.strokeWidth,"stroke-linejoin":"round","stroke-linecap":"round",fill:`url(#gradient_left${m.value})`},null,8,Qe),e.createElementVNode("path",{d:V.value.top,stroke:l.value.style.chart.bar.stroke,"stroke-width":l.value.style.chart.bar.strokeWidth,"stroke-linejoin":"round","stroke-linecap":"round",fill:`url(#gradient_top${m.value})`},null,8,et)])),$.value?(e.openBlock(),e.createElementBlock("g",tt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,(t,c)=>(e.openBlock(),e.createElementBlock("g",{style:e.normalizeStyle(`opacity:${y.value?y.value===t.id?1:.3:1}`),class:"vue-ui-3d-bar-stack"},[e.createElementVNode("path",{d:t.fill.right,fill:`url(#grad_right_${t.id})`,onMouseenter:o=>_(t),onClick:o=>_(t,!0),onMouseout:E},null,40,lt),e.createElementVNode("path",{d:t.fill.left,fill:`url(#grad_left_${t.id})`,onMouseenter:o=>_(t),onClick:o=>_(t,!0),onMouseout:E},null,40,ot),e.createElementVNode("path",{d:t.fill.top,fill:`url(#grad_top_${t.id})`,onMouseenter:o=>_(t),onClick:o=>_(t,!0),onMouseout:E},null,40,nt),e.createElementVNode("path",{d:t.fill.liningTop,stroke:"#FFFFFF","stroke-width":"0.5","stroke-linecap":"round",fill:"none",onMouseenter:o=>_(t),onClick:o=>_(t,!0),onMouseout:E},null,40,rt),e.createElementVNode("path",{d:`M ${t.fill.apexTop.x},${t.fill.apexTop.y} ${t.fill.apexBottom.x},${t.fill.apexBottom.y}`,stroke:"#FFFFFF","stroke-width":"0.5","stroke-linecap":"round"},null,8,at)],4))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,(t,c)=>(e.openBlock(),e.createElementBlock("g",null,[c!==g.value.length-1?(e.openBlock(),e.createElementBlock("path",{key:0,d:t.fill.liningTopShade,stroke:l.value.style.chart.bar.shadeColor,"stroke-width":"0.5","stroke-linecap":"round",fill:"none",style:{"pointer-events":"none"}},null,8,st)):e.createCommentVNode("",!0)]))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,(t,c)=>(e.openBlock(),e.createElementBlock("g",{style:e.normalizeStyle(`opacity:${y.value?y.value===t.id?1:0:t.proportion*100>l.value.style.chart.legend.hideUnderPercentage?1:0}`),onClick:o=>F("selectDatapoint",t)},[e.createElementVNode("path",{stroke:l.value.style.chart.color,"stroke-dasharray":"1","stroke-width":"0.5","stroke-linecap":"round",d:`M${t.fill.sidePointer.x},${t.fill.sidePointer.y} ${t.fill.sidePointer.x+20},${t.fill.sidePointer.y}`},null,8,it),!t.fill.miniDonut||y.value?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:t.fill.sidePointer.x+20,cy:t.fill.sidePointer.y,r:2,fill:t.color,stroke:l.value.style.chart.backgroundColor},null,8,ct)):e.createCommentVNode("",!0),(e.openBlock(),e.createElementBlock("foreignObject",{x:t.fill.sidePointer.x+30,y:t.fill.sidePointer.y-l.value.style.chart.legend.fontSize,width:n.value.absoluteWidth/2-12,height:l.value.style.chart.legend.fontSize*2,style:{overflow:"visible",position:"relative"}},[l.value.style.chart.legend.showDefault?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle(`height: 100%; width: 100%; display: flex; flex-direction: row; flex-wrap: wrap; align-items:center;justify-content: flex-start; font-size:${l.value.style.chart.legend.fontSize}px; text-align:left; line-height: ${l.value.style.chart.legend.fontSize}px; color:${l.value.style.chart.legend.color}`)},e.toDisplayString(t.name)+": "+e.toDisplayString(e.unref(i.dataLabel)({v:t.proportion*100,s:"%",r:l.value.style.chart.legend.roundingPercentage}))+" ("+e.toDisplayString(e.unref(i.dataLabel)({p:l.value.style.chart.legend.prefix,v:t.value,s:l.value.style.chart.legend.suffix,r:l.value.style.chart.legend.roundingValue}))+") ",5)):e.createCommentVNode("",!0),e.renderSlot(u.$slots,"legend",e.normalizeProps(e.guardReactiveProps({datapoint:t,config:l.value,dataset:g.value})),void 0,!0)],8,dt)),t.fill.donut&&y.value===t.id?(e.openBlock(),e.createElementBlock("g",ht,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.fill.donut,(o,a)=>(e.openBlock(),e.createElementBlock("g",null,[N(o,t.fill.donut,!0)>6?(e.openBlock(),e.createElementBlock("path",{key:0,d:e.unref(i.calcNutArrowPath)(o,{x:o.cx,y:o.cy},0,8,!1,!0,.5),stroke:o.color,class:"vue-ui-donut-arc-path","stroke-width":"0.5","stroke-linecap":"round","stroke-linejoin":"round",fill:"none"},null,8,vt)):e.createCommentVNode("",!0)]))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.fill.donut,(o,a)=>(e.openBlock(),e.createElementBlock("path",{class:"vue-ui-donut-arc-path",d:o.arcSlice,fill:`${o.color}`,stroke:l.value.style.chart.backgroundColor,"stroke-width":1},null,8,ft))),256)),e.createElementVNode("defs",null,[e.createElementVNode("radialGradient",{id:`hollow_gradient_${m.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":`${e.unref(i.convertColorToHex)(l.value.style.chart.backgroundColor)}00`},null,8,kt),mt,e.createElementVNode("stop",{offset:"100%","stop-color":`${e.unref(i.convertColorToHex)(l.value.style.chart.backgroundColor)}00`},null,8,yt)],8,pt)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.fill.donut,(o,a)=>(e.openBlock(),e.createElementBlock("circle",{class:"vue-ui-donut-arc-path",cx:o.cx,cy:o.cy,r:28,fill:`url(#hollow_gradient_${m.value})`},null,8,gt))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.fill.donut,(o,a)=>(e.openBlock(),e.createElementBlock("circle",{class:"vue-ui-donut-arc-path",cx:o.cx,cy:o.cy,r:14,fill:l.value.style.chart.backgroundColor},null,8,$t))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.fill.donut,(o,a)=>(e.openBlock(),e.createElementBlock("g",null,[N(o,t.fill.donut,!0)>6?(e.openBlock(),e.createElementBlock("g",_t,[e.createElementVNode("text",{"text-anchor":e.unref(i.calcMarkerOffsetX)(o,!0,0).anchor,x:e.unref(i.calcMarkerOffsetX)(o,!0,2).x,y:e.unref(i.calcMarkerOffsetY)(o,12,12),fill:l.value.style.chart.legend.color,"font-size":l.value.style.chart.legend.fontSize/1.5},e.toDisplayString(N(o,t.fill.donut))+" ("+e.toDisplayString(e.unref(i.dataLabel)({p:l.value.style.chart.legend.prefix,v:o.value,s:l.value.style.chart.legend.suffix,rounding:l.value.style.chart.legend.roundingValue}))+") ",9,xt),e.createElementVNode("text",{"text-anchor":e.unref(i.calcMarkerOffsetX)(o).anchor,x:e.unref(i.calcMarkerOffsetX)(o,!0,2).x,y:e.unref(i.calcMarkerOffsetY)(o,12,12)+l.value.style.chart.legend.fontSize/1.5,fill:l.value.style.chart.legend.color,"font-size":l.value.style.chart.legend.fontSize/1.5},e.toDisplayString(o.name),9,Bt)])):e.createCommentVNode("",!0)]))),256))])):e.createCommentVNode("",!0),t.fill.miniDonut&&!y.value?(e.openBlock(),e.createElementBlock("g",bt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.fill.miniDonut,(o,a)=>(e.openBlock(),e.createElementBlock("path",{class:"vue-ui-donut-arc-path",d:o.arcSlice,fill:`${o.color}`,stroke:l.value.style.chart.backgroundColor,"stroke-width":.5},null,8,Ct))),256))])):e.createCommentVNode("",!0)],12,ut))),256))])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),l.value.style.shape==="tube"?(e.openBlock(),e.createElementBlock("g",Et,[$.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("g",Nt,[e.createElementVNode("path",{"stroke-dasharray":l.value.style.chart.box.strokeDasharray,d:x.value.tubeTop,stroke:l.value.style.chart.box.stroke,"stroke-width":l.value.style.chart.box.strokeWidth,"stroke-linejoin":"round","stroke-linecap":"round",fill:"none"},null,8,wt),e.createElementVNode("path",{"stroke-dasharray":l.value.style.chart.box.strokeDasharray,d:x.value.tubeLeft,stroke:l.value.style.chart.box.stroke,"stroke-width":l.value.style.chart.box.strokeWidth,"stroke-linejoin":"round","stroke-linecap":"round",fill:"none"},null,8,Vt),e.createElementVNode("path",{"stroke-dasharray":l.value.style.chart.box.strokeDasharray,d:x.value.tubeRight,stroke:l.value.style.chart.box.stroke,"stroke-width":l.value.style.chart.box.strokeWidth,"stroke-linejoin":"round","stroke-linecap":"round",fill:"none"},null,8,Ft),e.createElementVNode("path",{"stroke-dasharray":l.value.style.chart.box.strokeDasharray,d:x.value.tubeBottom,stroke:l.value.style.chart.box.stroke,"stroke-width":l.value.style.chart.box.strokeWidth,"stroke-linejoin":"round","stroke-linecap":"round",fill:"none"},null,8,Mt),e.createElementVNode("path",{d:V.value.tubeTop,stroke:l.value.style.chart.bar.stroke,"stroke-width":l.value.style.chart.bar.strokeWidth,"stroke-linejoin":"round","stroke-linecap":"round",fill:`url(#gradient_top${m.value})`},null,8,St),e.createElementVNode("path",{d:V.value.tubeBody,stroke:l.value.style.chart.bar.stroke,"stroke-width":l.value.style.chart.bar.strokeWidth,"stroke-linejoin":"round","stroke-linecap":"round",fill:`url(#gradient_tube_body${m.value})`},null,8,Dt)])),$.value?(e.openBlock(),e.createElementBlock("g",Pt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,(t,c)=>(e.openBlock(),e.createElementBlock("g",{style:e.normalizeStyle(`opacity:${y.value?y.value===t.id?1:.3:1}`),class:"vue-ui-3d-bar-stack",onClick:o=>F("selectDatapoint",t)},[e.createElementVNode("defs",null,[e.createElementVNode("radialGradient",{id:`gradient_tube_top_${t.id}`,fx:"10%",cy:"55%"},[e.createElementVNode("stop",{offset:"0%","stop-color":`${e.unref(i.lightenHexColor)(t.color,.5)}DD`},null,8,zt),e.createElementVNode("stop",{offset:"100%","stop-color":`${e.unref(i.darkenHexColor)(t.color,.1)}DD`},null,8,jt)],8,Lt),e.createElementVNode("linearGradient",{id:`gradient_tube_body_${t.id}`,x1:"0%",y1:"0%",x2:"100%",y2:"0%"},[e.createElementVNode("stop",{offset:"0%","stop-color":`${t.color}`},null,8,Ht),e.createElementVNode("stop",{offset:"10%","stop-color":`${e.unref(i.darkenHexColor)(t.color,.7)}FF`},null,8,It),e.createElementVNode("stop",{offset:"25%","stop-color":`${e.unref(i.darkenHexColor)(t.color,.5)}FF`},null,8,Wt),e.createElementVNode("stop",{offset:"75%","stop-color":`${t.color}DD`},null,8,Gt),e.createElementVNode("stop",{offset:"100%","stop-color":`${e.unref(i.lightenHexColor)(t.color,.7)}FF`},null,8,At)],8,Ot)]),e.createElementVNode("path",{onMouseenter:o=>_(t),onClick:o=>_(t,!0),onMouseout:E,d:t.fill.tubeBody,stroke:"#FFFFFF","stroke-width":.5,"stroke-linejoin":"round","stroke-linecap":"round",fill:`url(#gradient_tube_body_${t.id})`},null,40,qt),c>0?(e.openBlock(),e.createElementBlock("path",{key:0,onMouseenter:o=>_(t),onClick:o=>_(t,!0),onMouseout:E,d:t.fill.bottomTubeTop,stroke:"#000000","stroke-width":.5,"stroke-linejoin":"round","stroke-linecap":"round",fill:"none"},null,40,Ut)):e.createCommentVNode("",!0),e.createElementVNode("path",{onMouseenter:o=>_(t),onClick:o=>_(t,!0),onMouseout:E,d:t.fill.tubeTop,stroke:"#FFFFFF","stroke-width":.5,"stroke-linejoin":"round","stroke-linecap":"round",fill:`url(#gradient_tube_top_${t.id})`},null,40,Xt)],12,Tt))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,(t,c)=>(e.openBlock(),e.createElementBlock("g",{style:e.normalizeStyle(`opacity:${y.value?y.value===t.id?1:0:t.proportion*100>l.value.style.chart.legend.hideUnderPercentage?1:0}`),onClick:o=>F("selectDatapoint",t)},[e.createElementVNode("path",{stroke:l.value.style.chart.color,"stroke-dasharray":"1","stroke-width":"0.5","stroke-linecap":"round",d:`M${t.fill.sidePointer.x},${t.fill.sidePointer.y} ${t.fill.sidePointer.x+20},${t.fill.sidePointer.y}`},null,8,Rt),!t.fill.miniDonut||y.value?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:t.fill.sidePointer.x+20,cy:t.fill.sidePointer.y,r:2,fill:t.color,stroke:l.value.style.chart.backgroundColor},null,8,Yt)):e.createCommentVNode("",!0),(e.openBlock(),e.createElementBlock("foreignObject",{x:t.fill.sidePointer.x+30,y:t.fill.sidePointer.y-l.value.style.chart.legend.fontSize,width:n.value.absoluteWidth/2-12,height:l.value.style.chart.legend.fontSize*2,style:{overflow:"visible",position:"relative"}},[l.value.style.chart.legend.showDefault?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle(`height: 100%; width: 100%; display: flex; flex-direction: row; flex-wrap: wrap; align-items:center;justify-content: flex-start; font-size:${l.value.style.chart.legend.fontSize}px; text-align:left; line-height: ${l.value.style.chart.legend.fontSize}px; color:${l.value.style.chart.legend.color}`)},e.toDisplayString(t.name)+": "+e.toDisplayString(e.unref(i.dataLabel)({v:t.proportion*100,s:"%",r:l.value.style.chart.legend.roundingPercentage}))+" ("+e.toDisplayString(e.unref(i.dataLabel)({p:l.value.style.chart.legend.prefix,v:t.value,s:l.value.style.chart.legend.suffix,r:l.value.style.chart.legend.roundingValue}))+") ",5)):e.createCommentVNode("",!0),e.renderSlot(u.$slots,"legend",e.normalizeProps(e.guardReactiveProps({datapoint:t,config:l.value,dataset:g.value})),void 0,!0)],8,Jt)),t.fill.donut&&y.value===t.id?(e.openBlock(),e.createElementBlock("g",Kt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.fill.donut,(o,a)=>(e.openBlock(),e.createElementBlock("g",null,[N(o,t.fill.donut,!0)>6?(e.openBlock(),e.createElementBlock("path",{key:0,d:e.unref(i.calcNutArrowPath)(o,{x:o.cx,y:o.cy},0,8,!1,!0,.5),stroke:o.color,class:"vue-ui-donut-arc-path","stroke-width":"0.5","stroke-linecap":"round","stroke-linejoin":"round",fill:"none"},null,8,Qt)):e.createCommentVNode("",!0)]))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.fill.donut,(o,a)=>(e.openBlock(),e.createElementBlock("path",{class:"vue-ui-donut-arc-path",d:o.arcSlice,fill:`${o.color}`,stroke:l.value.style.chart.backgroundColor,"stroke-width":1},null,8,el))),256)),e.createElementVNode("defs",null,[e.createElementVNode("radialGradient",{id:`hollow_gradient_${m.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":`${e.unref(i.convertColorToHex)(l.value.style.chart.backgroundColor)}00`},null,8,ll),ol,e.createElementVNode("stop",{offset:"100%","stop-color":`${e.unref(i.convertColorToHex)(l.value.style.chart.backgroundColor)}00`},null,8,nl)],8,tl)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.fill.donut,(o,a)=>(e.openBlock(),e.createElementBlock("circle",{class:"vue-ui-donut-arc-path",cx:o.cx,cy:o.cy,r:28,fill:`url(#hollow_gradient_${m.value})`},null,8,rl))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.fill.donut,(o,a)=>(e.openBlock(),e.createElementBlock("circle",{class:"vue-ui-donut-arc-path",cx:o.cx,cy:o.cy,r:14,fill:l.value.style.chart.backgroundColor},null,8,al))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.fill.donut,(o,a)=>(e.openBlock(),e.createElementBlock("g",null,[N(o,t.fill.donut,!0)>6?(e.openBlock(),e.createElementBlock("g",sl,[e.createElementVNode("text",{"text-anchor":e.unref(i.calcMarkerOffsetX)(o,!0,0).anchor,x:e.unref(i.calcMarkerOffsetX)(o,!0,2).x,y:e.unref(i.calcMarkerOffsetY)(o,12,12),fill:l.value.style.chart.legend.color,"font-size":l.value.style.chart.legend.fontSize/1.5},e.toDisplayString(N(o,t.fill.donut))+" ("+e.toDisplayString(e.unref(i.dataLabel)({p:l.value.style.chart.legend.prefix,v:o.value,s:l.value.style.chart.legend.suffix,rounding:l.value.style.chart.legend.roundingValue}))+") ",9,ul),e.createElementVNode("text",{"text-anchor":e.unref(i.calcMarkerOffsetX)(o).anchor,x:e.unref(i.calcMarkerOffsetX)(o,!0,2).x,y:e.unref(i.calcMarkerOffsetY)(o,12,12)+l.value.style.chart.legend.fontSize/1.5,fill:l.value.style.chart.legend.color,"font-size":l.value.style.chart.legend.fontSize/1.5},e.toDisplayString(o.name),9,il)])):e.createCommentVNode("",!0)]))),256))])):e.createCommentVNode("",!0),t.fill.miniDonut&&!y.value?(e.openBlock(),e.createElementBlock("g",cl,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.fill.miniDonut,(o,a)=>(e.openBlock(),e.createElementBlock("path",{class:"vue-ui-donut-arc-path",d:o.arcSlice,fill:`${o.color}`,stroke:l.value.style.chart.backgroundColor,"stroke-width":.5},null,8,dl))),256))])):e.createCommentVNode("",!0)],12,Zt))),256))])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.renderSlot(u.$slots,"svg",{svg:n.value},void 0,!0)],14,ve)):e.createCommentVNode("",!0),M.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(ue.default,{key:3,config:{type:"bar3d",style:{backgroundColor:l.value.style.chart.backgroundColor,bar3d:{color:"#CCCCCC"}}}},null,8,["config"])),M.value&&$.value?(e.openBlock(),e.createBlock(ce.default,{key:4,hideDetails:"",config:{open:S.value.showTable,maxHeight:1e4,body:{backgroundColor:l.value.style.chart.backgroundColor,color:l.value.style.chart.color},head:{backgroundColor:l.value.style.chart.backgroundColor,color:l.value.style.chart.color}}},{content:e.withCtx(()=>[e.createVNode(ie.DataTable,{colNames:D.value.colNames,head:D.value.head,body:D.value.body,config:D.value.config,title:`${l.value.style.chart.title.text}${l.value.style.chart.title.subtitle.text?` : ${l.value.style.chart.title.subtitle.text}`:""}`,onClose:r[1]||(r[1]=t=>S.value.showTable=!1)},{th:e.withCtx(({th:t})=>[e.createElementVNode("div",{innerHTML:t,style:{display:"flex","align-items":"center"}},null,8,hl)]),td:e.withCtx(({td:t})=>[e.createTextVNode(e.toDisplayString(t.name||t),1)]),_:1},8,["colNames","head","body","config","title"])]),_:1},8,["config"])):e.createCommentVNode("",!0)],12,he))}},fl=de._export_sfc(vl,[["__scopeId","data-v-30081550"]]);exports.default=fl;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),p=require("./BaseIcon-JtWoVorZ.cjs"),g=require("./useNestedProp-2kIU-7On.cjs"),u=require("./index-p5gfZSvB.cjs"),f=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),m=["id"],h={key:0,class:"vue-ui-accordion-arrow"},k={__name:"vue-ui-accordion",props:{config:{type:Object,default(){return{}}},hideDetails:{type:Boolean,default:!1}},setup(l){const c=l;e.useCssVars(r=>({"95f7c2e4":v.value}));const{vue_ui_accordion:d}=u.useConfig(),o=e.computed(()=>g.useNestedProp({userConfig:c.config,defaultConfig:d})),a=e.ref(o.value.open),i=e.ref(u.createUid()),t=e.ref(null),n=e.ref(0);e.onMounted(()=>{t.value.open=o.value.open}),e.watch(()=>o.value.open,r=>{t.value.open=r});function s(){(n.value>0||!o.value.open)&&(a.value=!a.value),n.value+=1}const v=e.computed(()=>`${o.value.maxHeight}px`);return(r,C)=>(e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("details",{id:`details_${i.value}`,ref_key:"details",ref:t,onToggle:s},[e.createElementVNode("summary",{class:e.normalizeClass({"vue-ui-accordion-headless":l.hideDetails})},[e.createElementVNode("div",{class:"vue-ui-accordion-head",style:e.normalizeStyle(`background:${o.value.head.backgroundColor};padding:${o.value.head.padding}; ${l.hideDetails?"height: 0px !important; padding: 0 !important;":""}`)},[l.hideDetails?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",h,[o.value.head.useArrowSlot?e.renderSlot(r.$slots,"arrow",e.normalizeProps(e.mergeProps({key:0},{backgroundColor:o.value.head.backgroundColor,color:o.value.head.color,iconColor:o.value.head.iconColor,isOpen:a.value})),void 0,!0):(e.openBlock(),e.createBlock(p.default,{key:1,name:"arrowRight",stroke:o.value.head.iconColor},null,8,["stroke"]))])),e.renderSlot(r.$slots,"title",e.normalizeProps(e.guardReactiveProps({color:o.value.head.color,isOpen:a.value})),void 0,!0)],4)],2)],40,m),e.createElementVNode("div",{class:"vue-ui-accordion-content",style:e.normalizeStyle(`background:${o.value.body.backgroundColor};color:${o.value.body.color}`)},[e.renderSlot(r.$slots,"content",e.normalizeProps(e.guardReactiveProps({backgroundColor:o.value.body.backgroundColor,color:o.value.body.color,isOpen:a.value})),void 0,!0)],4)]))}},y=f._export_sfc(k,[["__scopeId","data-v-28fc829c"]]);exports.default=y;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { useCssVars as y, computed as s, ref as r, onMounted as b, watch as _, openBlock as u, createElementBlock as v, createElementVNode as n, normalizeClass as $, normalizeStyle as p, renderSlot as c, normalizeProps as i, mergeProps as O, createBlock as D, createCommentVNode as N, guardReactiveProps as m } from "vue";
|
|
2
|
+
import w from "./BaseIcon-7_g11dRj.js";
|
|
3
|
+
import { u as x } from "./useNestedProp-BgWkUab_.js";
|
|
4
|
+
import { u as B, c as I } from "./index-uOtklCCx.js";
|
|
5
|
+
import { _ as A } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
6
|
+
const F = ["id"], P = {
|
|
7
|
+
key: 0,
|
|
8
|
+
class: "vue-ui-accordion-arrow"
|
|
9
|
+
}, z = {
|
|
10
|
+
__name: "vue-ui-accordion",
|
|
11
|
+
props: {
|
|
12
|
+
config: {
|
|
13
|
+
type: Object,
|
|
14
|
+
default() {
|
|
15
|
+
return {};
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
hideDetails: {
|
|
19
|
+
type: Boolean,
|
|
20
|
+
default: !1
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
setup(l) {
|
|
24
|
+
const f = l;
|
|
25
|
+
y((o) => ({
|
|
26
|
+
"95f7c2e4": C.value
|
|
27
|
+
}));
|
|
28
|
+
const { vue_ui_accordion: g } = B(), e = s(() => x({
|
|
29
|
+
userConfig: f.config,
|
|
30
|
+
defaultConfig: g
|
|
31
|
+
})), a = r(e.value.open), h = r(I()), t = r(null), d = r(0);
|
|
32
|
+
b(() => {
|
|
33
|
+
t.value.open = e.value.open;
|
|
34
|
+
}), _(() => e.value.open, (o) => {
|
|
35
|
+
t.value.open = o;
|
|
36
|
+
});
|
|
37
|
+
function k() {
|
|
38
|
+
(d.value > 0 || !e.value.open) && (a.value = !a.value), d.value += 1;
|
|
39
|
+
}
|
|
40
|
+
const C = s(() => `${e.value.maxHeight}px`);
|
|
41
|
+
return (o, E) => (u(), v("div", null, [
|
|
42
|
+
n("details", {
|
|
43
|
+
id: `details_${h.value}`,
|
|
44
|
+
ref_key: "details",
|
|
45
|
+
ref: t,
|
|
46
|
+
onToggle: k
|
|
47
|
+
}, [
|
|
48
|
+
n("summary", {
|
|
49
|
+
class: $({ "vue-ui-accordion-headless": l.hideDetails })
|
|
50
|
+
}, [
|
|
51
|
+
n("div", {
|
|
52
|
+
class: "vue-ui-accordion-head",
|
|
53
|
+
style: p(`background:${e.value.head.backgroundColor};padding:${e.value.head.padding}; ${l.hideDetails ? "height: 0px !important; padding: 0 !important;" : ""}`)
|
|
54
|
+
}, [
|
|
55
|
+
l.hideDetails ? N("", !0) : (u(), v("div", P, [
|
|
56
|
+
e.value.head.useArrowSlot ? c(o.$slots, "arrow", i(O({ key: 0 }, { backgroundColor: e.value.head.backgroundColor, color: e.value.head.color, iconColor: e.value.head.iconColor, isOpen: a.value })), void 0, !0) : (u(), D(w, {
|
|
57
|
+
key: 1,
|
|
58
|
+
name: "arrowRight",
|
|
59
|
+
stroke: e.value.head.iconColor
|
|
60
|
+
}, null, 8, ["stroke"]))
|
|
61
|
+
])),
|
|
62
|
+
c(o.$slots, "title", i(m({ color: e.value.head.color, isOpen: a.value })), void 0, !0)
|
|
63
|
+
], 4)
|
|
64
|
+
], 2)
|
|
65
|
+
], 40, F),
|
|
66
|
+
n("div", {
|
|
67
|
+
class: "vue-ui-accordion-content",
|
|
68
|
+
style: p(`background:${e.value.body.backgroundColor};color:${e.value.body.color}`)
|
|
69
|
+
}, [
|
|
70
|
+
c(o.$slots, "content", i(m({ backgroundColor: e.value.body.backgroundColor, color: e.value.body.color, isOpen: a.value })), void 0, !0)
|
|
71
|
+
], 4)
|
|
72
|
+
]));
|
|
73
|
+
}
|
|
74
|
+
}, R = /* @__PURE__ */ A(z, [["__scopeId", "data-v-28fc829c"]]);
|
|
75
|
+
export {
|
|
76
|
+
R as default
|
|
77
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("vue"),u=require("./index-p5gfZSvB.cjs"),F=require("./useResponsive-B3TrDDIG.cjs"),j=require("./Title-Bb-A5OSV.cjs"),P=require("./usePrinter-fZlsJid8.cjs"),Y=require("./Tooltip-C_UE6y-E.cjs"),J=require("./DataTable-Rm9II-m2.cjs"),K=require("./vue-ui-skeleton-sjfOtCZr.cjs"),Q=require("./vue-ui-accordion-C_pwrAJl.cjs"),I=require("./useNestedProp-2kIU-7On.cjs"),Z=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),ee=["id"],te=["xmlns","viewBox"],le=["id"],oe=["stop-color"],ae=["stop-color"],ie=["id"],re=["stop-color"],se=["stop-color"],ue=["x","y","width","height","fill","rx"],ne=["x","y","width","height","fill","rx"],de=["x","y","width","height","fill","rx"],ve=["x","y","width","height","fill","rx"],ce={key:0},ye=["x","y","fill","font-size","font-weight"],he=["x","y","fill","font-size","font-weight"],fe={key:1},ge=["x","y","font-size","fill","font-weight"],pe={key:2},be={key:0},me=["x1","x2","y1","y2","stroke","stroke-width"],xe=["x1","x2","y1","y2","stroke","stroke-width"],ke=["x1","x2","y1","y2","stroke","stroke-width"],we=["x","y","font-size","fill","font-weight"],Ce=["x1","x2","y1","y2","stroke","stroke-width"],_e=["x","y","font-size","fill","font-weight"],Se=["x","y","font-size","fill","font-weight"],Te=["x","y","width","height","fill","onMouseover"],$e={__name:"vue-ui-age-pyramid",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},setup(S,{expose:M}){const d=S,{vue_ui_age_pyramid:O}=u.useConfig(),m=t.computed(()=>!!d.dataset&&d.dataset.length),v=t.ref(u.createUid()),R=t.ref(null),w=t.ref(!1),C=t.ref(""),x=t.ref(null),T=t.ref(0),g=t.ref(null),$=t.ref(null),e=t.computed(()=>{const l=I.useNestedProp({userConfig:d.config,defaultConfig:O});return l.theme?{...I.useNestedProp({userConfig:u.themes.vue_ui_age_pyramid[l.theme]||d.config,defaultConfig:l})}:l}),L=t.ref(null);t.onMounted(()=>{if(u.objectIsEmpty(d.dataset)&&u.error({componentName:"VueUiAgePyramid",type:"dataset"}),e.value.responsive){const l=F.throttle(()=>{const{width:r,height:o}=F.useResponsive({chart:g.value,title:e.value.style.title.text?$.value:null});n.value.width=r,n.value.height=o});L.value=new ResizeObserver(l),L.value.observe(g.value.parentNode)}});const{isPrinting:D,isImaging:q,generatePdf:N,generateImage:B}=P.usePrinter({elementId:`vue-ui-age-pyramid_${v.value}`,fileName:e.value.style.title.text||"vue-ui-age-pyramid"}),c=t.ref({showTable:e.value.table.show,showTooltip:e.value.style.tooltip.show}),n=t.ref({height:e.value.style.height,width:e.value.style.width}),i=t.computed(()=>{const l=n.value.width-e.value.style.layout.padding.right-e.value.style.layout.padding.left,r=e.value.style.layout.padding.left,o=n.value.width-e.value.style.layout.padding.right;return{top:e.value.style.layout.padding.top,left:r,right:o,bottom:n.value.height-e.value.style.layout.padding.bottom,width:l,height:n.value.height-e.value.style.layout.padding.top-e.value.style.layout.padding.bottom,centerX:e.value.style.layout.padding.left+l/2,leftChart:{width:l/2-e.value.style.layout.centerSlit.width,right:r+l/2-e.value.style.layout.centerSlit.width},rightChart:{width:l/2-e.value.style.layout.centerSlit.width,left:r+l/2+e.value.style.layout.centerSlit.width}}}),G=t.computed(()=>d.dataset.map(l=>e.value.style.layout.dataLabels.yAxis.display==="age"?l[1]:l[0])),y=t.computed(()=>{const l=U(p.value/5),r=[],o=[];for(let a=0;a<=5;a+=1){const s=l*a,A=l*(a-5);r.push({value:s,x:i.value.left+i.value.width/2+e.value.style.layout.centerSlit.width+s/p.value*i.value.leftChart.width}),o.push({value:Math.abs(A),x:i.value.left+i.value.width/2+A/p.value*i.value.leftChart.width-e.value.style.layout.centerSlit.width})}return{right:r,left:o}});function U(l){if(l===0)return 0;const o=10**Math.floor(Math.log10(Math.abs(l)));let a;return l<0,a=Math.round(l/o)*o,a}const p=t.computed(()=>Math.max(...d.dataset.flatMap(l=>l.slice(-2)))),h=t.computed(()=>d.dataset.length),W=t.computed(()=>d.dataset.map(l=>({segment:l[0],age:l[1],left:{value:l[2],proportionToMax:l[2]/p.value},right:{value:l[3],proportionToMax:l[3]/p.value}}))),f=t.computed(()=>W.value.map((l,r)=>{const o=i.value.top+i.value.height/h.value*r,a=i.value.height/h.value-e.value.style.layout.bars.gap;return{segment:l.segment,age:l.age,left:{...l.left,y:o,color:e.value.style.layout.bars.left.color,x:i.value.leftChart.right-l.left.proportionToMax*i.value.leftChart.width,width:l.left.proportionToMax*i.value.leftChart.width,height:a},right:{...l.right,y:o,color:e.value.style.layout.bars.right.color,x:i.value.rightChart.left,width:l.right.proportionToMax*i.value.rightChart.width,height:a}}})),_=t.ref(null);function H(l,r){x.value=l,_.value={datapoint:r,seriesIndex:l,series:f.value,config:e.value};const o=e.value.style.tooltip.customFormat;if(u.isFunction(o)&&u.functionReturnsString(()=>o({seriesIndex:l,datapoint:{segment:r[0],index:r[1],left:r[2],right:r[3]},series:f.value,config:e.value})))C.value=o({seriesIndex:l,datapoint:{segment:r[0],index:r[1],left:r[2],right:r[3]},series:f.value,config:e.value});else{let a="";const s=f.value[l];a+=`<div><b>${s.segment}</b></div>`,a+=`<div>${e.value.translations.age}: ${s.age}</div>`,a+=`<div style="margin-top:6px;padding-top:6px;border-top:1px solid ${e.value.style.tooltip.borderColor}">`,a+='<div style="display:flex; flex-direction:row;gap:12px">',a+=`<div style="display:flex;flex-direction:column;align-items:center;justify-content:center"><svg viewBox="0 0 12 12" height="12" width="12"><rect stroke="none" x="0" y="0" height="12" width="12" rx="2" fill="${e.value.style.layout.bars.gradient.underlayer}"/><rect stroke="none" x="0" y="0" height="12" width="12" rx="2" fill="${e.value.style.layout.bars.gradient.show?`url(#age_pyramid_left_${v.value})`:e.value.style.layout.bars.left.color}"/></svg><div>${e.value.translations.female}</div><div><b>${s.left.value.toLocaleString()}</b></div></div>`,a+=`<div style="display:flex;flex-direction:column;align-items:center;justify-content:center"><svg viewBox="0 0 12 12" height="12" width="12"><rect stroke="none" x="0" y="0" height="12" width="12" rx="2" fill="${e.value.style.layout.bars.gradient.underlayer}"/><rect stroke="none" x="0" y="0" height="12" width="12" rx="2" fill="${e.value.style.layout.bars.gradient.show?`url(#age_pyramid_right_${v.value})`:e.value.style.layout.bars.right.color}"/></svg><div>${e.value.translations.male}</div><div><b>${s.right.value.toLocaleString()}</b></div></div>`,a+="</div>",a+=`<div style="margin-top:6px;padding-top:6px;border-top:1px solid ${e.value.style.tooltip.borderColor}"><div>${e.value.translations.total}</div><div><b>${(s.left.value+s.right.value).toLocaleString()}</b></div></div>`,a+="</div>",C.value=`<div>${a}</div>`}w.value=!0}function E(){t.nextTick(()=>{const l=[e.value.translations.year,e.value.translations.age,e.value.translations.female,e.value.translations.male,e.value.translations.total],r=d.dataset.map(s=>[s[0],s[1],s[2],s[3],s[2]+s[3]]),o=[[e.value.style.title.text],[e.value.style.title.subtitle.text],[[""],[""],[""]]].concat([l]).concat(r),a=u.createCsvContent(o);u.downloadCsv({csvContent:a,title:e.value.style.title.text||"vue-ui-heatmap"})})}const k=t.computed(()=>{const l=[e.value.translations.year,e.value.translations.age,e.value.translations.female,e.value.translations.male,e.value.translations.total],r=d.dataset.map(a=>[a[0],a[1],a[2].toLocaleString(),a[3].toLocaleString(),(a[2]+a[3]).toLocaleString()]),o={th:{backgroundColor:e.value.table.th.backgroundColor,color:e.value.table.th.color,outline:e.value.table.th.outline},td:{backgroundColor:e.value.table.td.backgroundColor,color:e.value.table.td.color,outline:e.value.table.td.outline},breakpoint:e.value.table.responsiveBreakpoint};return{head:l,body:r,config:o,colNames:l}}),b=t.ref(!1);function X(l){b.value=l,T.value+=1}function z(){c.value.showTable=!c.value.showTable}function V(){c.value.showTooltip=!c.value.showTooltip}return M({generatePdf:N,generateCsv:E,generateImage:B,toggleTable:z,toggleTooltip:V}),(l,r)=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(`vue-ui-age-pyramid ${b.value?"vue-data-ui-wrapper-fullscreen":""}`),ref_key:"agePyramid",ref:g,id:`vue-ui-age-pyramid_${v.value}`,style:t.normalizeStyle(`font-family:${e.value.style.fontFamily};width:100%; text-align:center;${e.value.style.title.text?"":"padding-top:36px"};background:${e.value.style.backgroundColor};${e.value.responsive?"height:100%":""}`)},[e.value.style.title.text?(t.openBlock(),t.createElementBlock("div",{key:0,ref_key:"chartTitle",ref:$,style:t.normalizeStyle(`width:100%;background:${e.value.style.backgroundColor}`)},[t.createVNode(j._sfc_main,{config:{title:{cy:"pyramid-div-title",...e.value.style.title},subtitle:{cy:"pyramid-div-subtitle",...e.value.style.title.subtitle}}},null,8,["config"])],4)):t.createCommentVNode("",!0),e.value.userOptions.show&&m.value?(t.openBlock(),t.createBlock(P.UserOptions,{ref_key:"details",ref:R,key:`user_options_${T.value}`,backgroundColor:e.value.style.backgroundColor,color:e.value.style.color,isImaging:t.unref(q),isPrinting:t.unref(D),uid:v.value,hasTooltip:e.value.userOptions.buttons.tooltip&&e.value.style.tooltip.show,hasPdf:e.value.userOptions.buttons.pdf,hasXls:e.value.userOptions.buttons.csv,hasImg:e.value.userOptions.buttons.img,hasTable:e.value.userOptions.buttons.table,hasFullscreen:e.value.userOptions.buttons.fullscreen,isFullscreen:b.value,isTooltip:c.value.showTooltip,titles:{...e.value.userOptions.buttonTitles},chartElement:g.value,onToggleFullscreen:X,onGeneratePdf:t.unref(N),onGenerateCsv:E,onGenerateImage:t.unref(B),onToggleTable:z,onToggleTooltip:V},t.createSlots({_:2},[l.$slots.optionTooltip?{name:"optionTooltip",fn:t.withCtx(()=>[t.renderSlot(l.$slots,"optionTooltip",{},void 0,!0)]),key:"0"}:void 0,l.$slots.optionPdf?{name:"optionPdf",fn:t.withCtx(()=>[t.renderSlot(l.$slots,"optionPdf",{},void 0,!0)]),key:"1"}:void 0,l.$slots.optionCsv?{name:"optionCsv",fn:t.withCtx(()=>[t.renderSlot(l.$slots,"optionCsv",{},void 0,!0)]),key:"2"}:void 0,l.$slots.optionImg?{name:"optionImg",fn:t.withCtx(()=>[t.renderSlot(l.$slots,"optionImg",{},void 0,!0)]),key:"3"}:void 0,l.$slots.optionTable?{name:"optionTable",fn:t.withCtx(()=>[t.renderSlot(l.$slots,"optionTable",{},void 0,!0)]),key:"4"}:void 0,l.$slots.optionFullscreen?{name:"optionFullscreen",fn:t.withCtx(({toggleFullscreen:o,isFullscreen:a})=>[t.renderSlot(l.$slots,"optionFullscreen",t.normalizeProps(t.guardReactiveProps({toggleFullscreen:o,isFullscreen:a})),void 0,!0)]),key:"5"}:void 0]),1032,["backgroundColor","color","isImaging","isPrinting","uid","hasTooltip","hasPdf","hasXls","hasImg","hasTable","hasFullscreen","isFullscreen","isTooltip","titles","chartElement","onGeneratePdf","onGenerateImage"])):t.createCommentVNode("",!0),m.value?(t.openBlock(),t.createElementBlock("svg",{key:2,xmlns:t.unref(u.XMLNS),class:t.normalizeClass({"vue-data-ui-fullscreen--on":b.value,"vue-data-ui-fulscreen--off":!b.value}),viewBox:`0 0 ${n.value.width<=0?10:n.value.width} ${n.value.height<=0?10:n.value.height}`,style:t.normalizeStyle(`max-width:100%;overflow:visible;background:${e.value.style.backgroundColor};color:${e.value.style.color}`)},[t.createElementVNode("defs",null,[t.createElementVNode("linearGradient",{id:`age_pyramid_left_${v.value}`,x1:"0%",y1:"0%",x2:"100%",y2:"0%"},[t.createElementVNode("stop",{offset:"0%","stop-color":e.value.style.layout.bars.left.color},null,8,oe),t.createElementVNode("stop",{offset:"100%","stop-color":`${t.unref(u.shiftHue)(e.value.style.layout.bars.left.color,e.value.style.layout.bars.gradient.shiftHue)}${t.unref(u.opacity)[100-e.value.style.layout.bars.gradient.intensity]}`},null,8,ae)],8,le),t.createElementVNode("linearGradient",{id:`age_pyramid_right_${v.value}`,x1:"0%",y1:"0%",x2:"100%",y2:"0%"},[t.createElementVNode("stop",{offset:"0%","stop-color":`${t.unref(u.shiftHue)(e.value.style.layout.bars.right.color,e.value.style.layout.bars.gradient.shiftHue)}${t.unref(u.opacity)[100-e.value.style.layout.bars.gradient.intensity]}`},null,8,re),t.createElementVNode("stop",{offset:"100%","stop-color":e.value.style.layout.bars.right.color},null,8,se)],8,ie)]),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(f.value,(o,a)=>(t.openBlock(),t.createElementBlock("g",null,[t.createElementVNode("rect",{x:o.left.x,y:o.left.y,width:o.left.width<=0?1e-4:o.left.width,height:o.left.height<=0?1e-4:o.left.height,fill:e.value.style.layout.bars.gradient.underlayer,rx:e.value.style.layout.bars.borderRadius},null,8,ue),t.createElementVNode("rect",{x:o.left.x,y:o.left.y,width:o.left.width<=0?1e-4:o.left.width,height:o.left.height<=0?1e-4:o.left.height,fill:e.value.style.layout.bars.gradient.show?`url(#age_pyramid_left_${v.value})`:o.left.color,rx:e.value.style.layout.bars.borderRadius},null,8,ne),t.createElementVNode("rect",{x:o.right.x,y:o.right.y,width:o.right.width<=0?1e-4:o.right.width,height:o.right.height<=0?1e-4:o.right.height,fill:e.value.style.layout.bars.gradient.underlayer,rx:e.value.style.layout.bars.borderRadius},null,8,de),t.createElementVNode("rect",{x:o.right.x,y:o.right.y,width:o.right.width<=0?1e-4:o.right.width,height:o.right.height<=0?1e-4:o.right.height,fill:e.value.style.layout.bars.gradient.show?`url(#age_pyramid_right_${v.value})`:o.right.color,rx:e.value.style.layout.bars.borderRadius},null,8,ve)]))),256)),t.createElementVNode("g",null,[e.value.style.layout.dataLabels.sideTitles.show?(t.openBlock(),t.createElementBlock("g",ce,[t.createElementVNode("text",{x:i.value.left,y:i.value.top+e.value.style.layout.dataLabels.sideTitles.offsetY,fill:e.value.style.layout.dataLabels.sideTitles.useSideColor?e.value.style.layout.bars.left.color:e.value.style.layout.dataLabels.sideTitles.color,"font-size":e.value.style.layout.dataLabels.sideTitles.fontSize,"text-anchor":"start","font-weight":e.value.style.layout.dataLabels.sideTitles.bold?"bold":"normal"},t.toDisplayString(e.value.translations.female),9,ye),t.createElementVNode("text",{x:i.value.right,y:i.value.top+e.value.style.layout.dataLabels.sideTitles.offsetY,fill:e.value.style.layout.dataLabels.sideTitles.useSideColor?e.value.style.layout.bars.right.color:e.value.style.layout.dataLabels.sideTitles.color,"font-size":e.value.style.layout.dataLabels.sideTitles.fontSize,"text-anchor":"end","font-weight":e.value.style.layout.dataLabels.sideTitles.bold?"bold":"normal"},t.toDisplayString(e.value.translations.male),9,he)])):t.createCommentVNode("",!0),e.value.style.layout.dataLabels.yAxis.show?(t.openBlock(),t.createElementBlock("g",fe,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(G.value,(o,a)=>(t.openBlock(),t.createElementBlock(t.Fragment,null,[a%e.value.style.layout.dataLabels.yAxis.showEvery===0?(t.openBlock(),t.createElementBlock("text",{key:0,x:i.value.centerX,y:i.value.top+i.value.height/h.value*a+e.value.style.layout.dataLabels.yAxis.fontSize/3,"text-anchor":"middle","font-size":e.value.style.layout.dataLabels.yAxis.fontSize,fill:e.value.style.layout.dataLabels.yAxis.color,"font-weight":e.value.style.layout.dataLabels.yAxis.bold?"bold":"normal"},t.toDisplayString(o),9,ge)):t.createCommentVNode("",!0)],64))),256))])):t.createCommentVNode("",!0),e.value.style.layout.dataLabels.xAxis.show?(t.openBlock(),t.createElementBlock("g",pe,[e.value.style.layout.grid.show?(t.openBlock(),t.createElementBlock("g",be,[t.createElementVNode("line",{x1:y.value.right[0].x,x2:y.value.right.at(-1).x,y1:i.value.bottom+e.value.style.layout.dataLabels.xAxis.fontSize/2,y2:i.value.bottom+e.value.style.layout.dataLabels.xAxis.fontSize/2,stroke:e.value.style.layout.grid.stroke,"stroke-width":e.value.style.layout.grid.strokeWidth,"stroke-linecap":"round"},null,8,me),t.createElementVNode("line",{x1:y.value.left[0].x,x2:y.value.left.at(-1).x,y1:i.value.bottom+e.value.style.layout.dataLabels.xAxis.fontSize/2,y2:i.value.bottom+e.value.style.layout.dataLabels.xAxis.fontSize/2,stroke:e.value.style.layout.grid.stroke,"stroke-width":e.value.style.layout.grid.strokeWidth,"stroke-linecap":"round"},null,8,xe)])):t.createCommentVNode("",!0),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(y.value.right,o=>(t.openBlock(),t.createElementBlock("g",null,[e.value.style.layout.grid.show?(t.openBlock(),t.createElementBlock("line",{key:0,x1:o.x,x2:o.x,y1:i.value.bottom+e.value.style.layout.dataLabels.xAxis.fontSize/2,y2:i.value.bottom+e.value.style.layout.dataLabels.xAxis.fontSize/4,stroke:e.value.style.layout.grid.stroke,"stroke-width":e.value.style.layout.grid.strokeWidth,"stroke-linecap":"round"},null,8,ke)):t.createCommentVNode("",!0),t.createElementVNode("text",{x:o.x,y:i.value.bottom+e.value.style.layout.dataLabels.xAxis.fontSize*2,"font-size":e.value.style.layout.dataLabels.xAxis.fontSize,fill:e.value.style.layout.dataLabels.xAxis.color,"text-anchor":"middle","font-weight":e.value.style.layout.dataLabels.xAxis.bold?"bold":"normal"},t.toDisplayString(Number((o.value/e.value.style.layout.dataLabels.xAxis.scale).toFixed(0)).toLocaleString()),9,we)]))),256)),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(y.value.left,o=>(t.openBlock(),t.createElementBlock("g",null,[e.value.style.layout.grid.show?(t.openBlock(),t.createElementBlock("line",{key:0,x1:o.x,x2:o.x,y1:i.value.bottom+e.value.style.layout.dataLabels.xAxis.fontSize/2,y2:i.value.bottom+e.value.style.layout.dataLabels.xAxis.fontSize/4,stroke:e.value.style.layout.grid.stroke,"stroke-width":e.value.style.layout.grid.strokeWidth,"stroke-linecap":"round"},null,8,Ce)):t.createCommentVNode("",!0),t.createElementVNode("text",{x:o.x,y:i.value.bottom+e.value.style.layout.dataLabels.xAxis.fontSize*2,"font-size":e.value.style.layout.dataLabels.xAxis.fontSize,fill:e.value.style.layout.dataLabels.xAxis.color,"text-anchor":"middle","font-weight":e.value.style.layout.dataLabels.xAxis.bold?"bold":"normal"},t.toDisplayString(Number((o.value/e.value.style.layout.dataLabels.xAxis.scale).toFixed(0)).toLocaleString()),9,_e)]))),256)),t.createElementVNode("text",{x:i.value.right,y:n.value.height,"text-anchor":"end","font-size":e.value.style.layout.dataLabels.xAxis.fontSize,fill:e.value.style.layout.dataLabels.xAxis.color,"font-weight":e.value.style.layout.dataLabels.xAxis.bold?"bold":"normal"},t.toDisplayString(e.value.style.layout.dataLabels.xAxis.translation),9,Se)])):t.createCommentVNode("",!0)]),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(S.dataset,(o,a)=>(t.openBlock(),t.createElementBlock("g",null,[t.createElementVNode("rect",{x:i.value.left,y:i.value.top+i.value.height/h.value*a-e.value.style.layout.bars.gap/2,width:i.value.width<=0?1e-4:i.value.width,height:i.value.height/h.value<=0?1e-4:i.value.height/h.value,fill:x.value!==null&&x.value===a?`${e.value.style.highlighter.color}${t.unref(u.opacity)[e.value.style.highlighter.opacity]}`:"transparent",onMouseover:s=>H(a,o),onMouseleave:r[0]||(r[0]=s=>{x.value=null,w.value=!1})},null,40,Te)]))),256)),t.renderSlot(l.$slots,"svg",{svg:n.value},void 0,!0)],14,te)):t.createCommentVNode("",!0),m.value?t.createCommentVNode("",!0):(t.openBlock(),t.createBlock(K.default,{key:3,config:{type:"pyramid",style:{backgroundColor:e.value.style.backgroundColor,pyramid:{color:"#CCCCCC"}}}},null,8,["config"])),t.renderSlot(l.$slots,"legend",{legend:f.value},void 0,!0),t.createVNode(Y._sfc_main,{show:c.value.showTooltip&&w.value,backgroundColor:e.value.style.tooltip.backgroundColor,color:e.value.style.tooltip.color,borderRadius:e.value.style.tooltip.borderRadius,borderColor:e.value.style.tooltip.borderColor,borderWidth:e.value.style.tooltip.borderWidth,fontSize:e.value.style.tooltip.fontSize,backgroundOpacity:e.value.style.tooltip.backgroundOpacity,parent:g.value,content:C.value,isCustom:e.value.style.tooltip.customFormat&&typeof e.value.style.tooltip.customFormat=="function"},{"tooltip-before":t.withCtx(()=>[t.renderSlot(l.$slots,"tooltip-before",t.normalizeProps(t.guardReactiveProps({..._.value})),void 0,!0)]),"tooltip-after":t.withCtx(()=>[t.renderSlot(l.$slots,"tooltip-after",t.normalizeProps(t.guardReactiveProps({..._.value})),void 0,!0)]),_:3},8,["show","backgroundColor","color","borderRadius","borderColor","borderWidth","fontSize","backgroundOpacity","parent","content","isCustom"]),m.value?(t.openBlock(),t.createBlock(Q.default,{key:4,hideDetails:"",config:{open:c.value.showTable,maxHeight:1e4,body:{backgroundColor:e.value.style.backgroundColor,color:e.value.style.color},head:{backgroundColor:e.value.style.backgroundColor,color:e.value.style.color}}},{content:t.withCtx(()=>[t.createVNode(J.DataTable,{colNames:k.value.colNames,head:k.value.head,body:k.value.body,config:k.value.config,title:`${e.value.style.title.text}${e.value.style.title.subtitle.text?` : ${e.value.style.title.subtitle.text}`:""}`,onClose:r[1]||(r[1]=o=>c.value.showTable=!1)},{th:t.withCtx(({th:o})=>[t.createTextVNode(t.toDisplayString(o),1)]),td:t.withCtx(({td:o})=>[t.createTextVNode(t.toDisplayString(o),1)]),_:1},8,["colNames","head","body","config","title"])]),_:1},8,["config"])):t.createCommentVNode("",!0)],14,ee))}},Le=Z._export_sfc($e,[["__scopeId","data-v-44b2f1f2"]]);exports.default=Le;
|