vue-data-ui 2.3.80 → 2.3.82
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-BwOfAkTh.cjs → Arrow-BTO6BS7p.cjs} +1 -1
- package/dist/{Arrow-BI2HWbkl.js → Arrow-D-Ef1hLL.js} +1 -1
- package/dist/{BaseIcon-BhdIp3HQ.js → BaseIcon-CVe5ECp8.js} +1 -1
- package/dist/{BaseIcon-DU-oJKBy.cjs → BaseIcon-DS9Fpauh.cjs} +1 -1
- package/dist/{DataTable-ysqfWT9v.cjs → DataTable-BfvpbyB5.cjs} +1 -1
- package/dist/{DataTable-CThhaAYT.js → DataTable-OKHTStDc.js} +2 -2
- package/dist/{Legend-DtnPX_Dc.cjs → Legend-B3B4K_lr.cjs} +1 -1
- package/dist/{Legend-DxRA5XXC.js → Legend-Bt4nNAHo.js} +1 -1
- package/dist/{Shape-EntBaNbX.js → Shape-C0HIiqHY.js} +1 -1
- package/dist/{Shape-DJdHakOl.cjs → Shape-Dg4DHNlU.cjs} +1 -1
- package/dist/{Slicer-xJl1pkRn.cjs → Slicer-BPvgOo6Z.cjs} +1 -1
- package/dist/{Slicer-BLFTdmNs.js → Slicer-CB-YgfIM.js} +2 -2
- package/dist/{Title-DOzi72Pu.cjs → Title-B238VbIb.cjs} +1 -1
- package/dist/{Title-Bgh58KWs.js → Title-CXeDgAE7.js} +1 -1
- package/dist/{Tooltip-HqwVgkYT.js → Tooltip-_e0VoMC-.js} +1 -1
- package/dist/{Tooltip-DWx3KcqE.cjs → Tooltip-hihJcWT0.cjs} +1 -1
- package/dist/{index-C_xZ1jJj.js → index-B6m-GhsP.js} +1 -1
- package/dist/{index-BofUHMEw.cjs → index-CeMgFh6-.cjs} +1 -1
- package/dist/style.css +1 -1
- package/dist/{useNestedProp-9QKvGow8.js → useNestedProp-BrcBWysp.js} +1 -1
- package/dist/{useNestedProp-DGK0LGfN.cjs → useNestedProp-CD3RA8XO.cjs} +1 -1
- package/dist/{usePrinter-BJ7GxAOO.js → usePrinter-BkKBQlCO.js} +1 -1
- package/dist/{usePrinter-_JYb_33H.cjs → usePrinter-_rbdfvVi.cjs} +1 -1
- package/dist/{vue-data-ui-BDRU4x1z.cjs → vue-data-ui-BgHHdUNr.cjs} +1 -1
- package/dist/{vue-data-ui-MIo8xmC1.js → vue-data-ui-wvh5ZEeD.js} +57 -57
- package/dist/vue-data-ui.cjs +1 -1
- package/dist/vue-data-ui.js +1 -1
- package/dist/{vue-ui-3d-bar-Dul4M5zs.js → vue-ui-3d-bar-DNHZheVL.js} +7 -7
- package/dist/{vue-ui-3d-bar-Clct1WMZ.cjs → vue-ui-3d-bar-ia_wUTc1.cjs} +1 -1
- package/dist/{vue-ui-accordion-issoIPFd.js → vue-ui-accordion-BygOGjRr.js} +3 -3
- package/dist/{vue-ui-accordion-XtygMpX7.cjs → vue-ui-accordion-CH_rY04P.cjs} +1 -1
- package/dist/{vue-ui-age-pyramid-DnfnIupT.js → vue-ui-age-pyramid-BZrN9gk2.js} +8 -8
- package/dist/{vue-ui-age-pyramid-EsCLRd6s.cjs → vue-ui-age-pyramid-DftioDeW.cjs} +1 -1
- package/dist/{vue-ui-annotator-zFbcfeEs.cjs → vue-ui-annotator-BGYJrkr0.cjs} +1 -1
- package/dist/{vue-ui-annotator-CmrenuBi.js → vue-ui-annotator-DRpBiqTN.js} +1 -1
- package/dist/{vue-ui-candlestick-DlwYwMdG.js → vue-ui-candlestick-BP5nrvrA.js} +9 -9
- package/dist/{vue-ui-candlestick-Bdo2RhhM.cjs → vue-ui-candlestick-CVgaOkTY.cjs} +1 -1
- package/dist/{vue-ui-carousel-table-IN0an_Jc.cjs → vue-ui-carousel-table-Cd93n0fJ.cjs} +1 -1
- package/dist/{vue-ui-carousel-table-mo9C1GJ9.js → vue-ui-carousel-table-Dtkm1_OH.js} +4 -4
- package/dist/{vue-ui-chestnut-C9jiVBGB.cjs → vue-ui-chestnut-B6_rC31R.cjs} +1 -1
- package/dist/{vue-ui-chestnut-DUeStDzz.js → vue-ui-chestnut-CKviQSxK.js} +6 -6
- package/dist/{vue-ui-cursor-BoetT349.cjs → vue-ui-cursor-C4FRP_Nc.cjs} +1 -1
- package/dist/{vue-ui-cursor-x_Ai6P6S.js → vue-ui-cursor-_egqr6DD.js} +2 -2
- package/dist/{vue-ui-dashboard-B8IRsFc3.js → vue-ui-dashboard-DUgt8PIq.js} +2 -2
- package/dist/{vue-ui-dashboard-DUH23G5u.cjs → vue-ui-dashboard-iPdvuNQ9.cjs} +1 -1
- package/dist/{vue-ui-digits-BO5Bxyib.js → vue-ui-digits-CcrjtXtk.js} +2 -2
- package/dist/{vue-ui-digits-ByNeTvE4.cjs → vue-ui-digits-OWEvFsfq.cjs} +1 -1
- package/dist/{vue-ui-donut-CDizH2x3.cjs → vue-ui-donut-D2SQezST.cjs} +1 -1
- package/dist/{vue-ui-donut-DC6mZWdM.js → vue-ui-donut-Dmr11NmB.js} +9 -9
- package/dist/{vue-ui-donut-evolution-B2U3g0Yw.js → vue-ui-donut-evolution-D1LXnQfC.js} +48 -48
- package/dist/{vue-ui-donut-evolution-B7G4UB_e.cjs → vue-ui-donut-evolution-PtyzK7G6.cjs} +1 -1
- package/dist/{vue-ui-dumbbell-DD7RtYjl.cjs → vue-ui-dumbbell-Bbv_WYY2.cjs} +1 -1
- package/dist/{vue-ui-dumbbell-81Azsrmw.js → vue-ui-dumbbell-CNX0gxiM.js} +8 -8
- package/dist/{vue-ui-flow-BbJmSWr4.cjs → vue-ui-flow-DRjha-Xx.cjs} +1 -1
- package/dist/{vue-ui-flow-CTobijfD.js → vue-ui-flow-FsawfZQj.js} +7 -7
- package/dist/{vue-ui-galaxy-BxkH3rZs.cjs → vue-ui-galaxy-BCMTqPX1.cjs} +1 -1
- package/dist/{vue-ui-galaxy-B9U-hTWd.js → vue-ui-galaxy-Eev5Q8w4.js} +9 -9
- package/dist/{vue-ui-gauge-DezT9Iw3.cjs → vue-ui-gauge-CPMlQvxU.cjs} +1 -1
- package/dist/{vue-ui-gauge-BvS6Ep8K.js → vue-ui-gauge-DBxTCkge.js} +5 -5
- package/dist/{vue-ui-gizmo-CCSV95Cw.js → vue-ui-gizmo-BAiNxz8X.js} +2 -2
- package/dist/{vue-ui-gizmo-CdGlyolL.cjs → vue-ui-gizmo-CxnoYWwd.cjs} +1 -1
- package/dist/{vue-ui-heatmap-DQntMs3y.js → vue-ui-heatmap-BpHByyVR.js} +8 -8
- package/dist/{vue-ui-heatmap-Decb4BRV.cjs → vue-ui-heatmap-DvsH2Au0.cjs} +1 -1
- package/dist/{vue-ui-kpi-yDsCX1qh.js → vue-ui-kpi-CyvW8X1f.js} +3 -3
- package/dist/{vue-ui-kpi-MZSJlc3i.cjs → vue-ui-kpi-DFquN6Ls.cjs} +1 -1
- package/dist/{vue-ui-mini-loader-DluKyWjA.js → vue-ui-mini-loader--6qogu7d.js} +2 -2
- package/dist/{vue-ui-mini-loader-Dz3LxxFJ.cjs → vue-ui-mini-loader-DIa_OVyM.cjs} +1 -1
- package/dist/{vue-ui-molecule-rmhSL2tT.cjs → vue-ui-molecule-CbLmk-Fv.cjs} +1 -1
- package/dist/{vue-ui-molecule-BG1BbGts.js → vue-ui-molecule-YJ0bXwbB.js} +9 -9
- package/dist/{vue-ui-mood-radar-EO6jRkGF.js → vue-ui-mood-radar-B8QHrApG.js} +9 -9
- package/dist/{vue-ui-mood-radar-owAd1Twe.cjs → vue-ui-mood-radar-BV5RnpiH.cjs} +1 -1
- package/dist/{vue-ui-nested-donuts-HDfFuFhB.js → vue-ui-nested-donuts-CLhrY6y1.js} +9 -9
- package/dist/{vue-ui-nested-donuts-u-4RFRIE.cjs → vue-ui-nested-donuts-DKAkxEPd.cjs} +1 -1
- package/dist/{vue-ui-onion-DqMY1iPE.js → vue-ui-onion-BXdEzlmA.js} +9 -9
- package/dist/{vue-ui-onion-BUOOD3WG.cjs → vue-ui-onion-CkknGnDm.cjs} +1 -1
- package/dist/{vue-ui-parallel-coordinate-plot-CUU74I_R.js → vue-ui-parallel-coordinate-plot-4XBOTcO8.js} +10 -10
- package/dist/{vue-ui-parallel-coordinate-plot-2JGpf8SJ.cjs → vue-ui-parallel-coordinate-plot-CE31yJK_.cjs} +1 -1
- package/dist/{vue-ui-quadrant-BrbrrHLN.js → vue-ui-quadrant-CgMsyw3Q.js} +10 -10
- package/dist/{vue-ui-quadrant-BXUtKBlK.cjs → vue-ui-quadrant-D9_7g38o.cjs} +1 -1
- package/dist/{vue-ui-quick-chart-BeJMzQZr.js → vue-ui-quick-chart-Cgbq5tLg.js} +334 -334
- package/dist/vue-ui-quick-chart-sMi9mLRt.cjs +15 -0
- package/dist/{vue-ui-radar-BMbWx0XC.js → vue-ui-radar-BvN2WTtC.js} +10 -10
- package/dist/{vue-ui-radar-yFYbYYI9.cjs → vue-ui-radar-CkcPJX_6.cjs} +1 -1
- package/dist/{vue-ui-rating-Ckh6xyv1.cjs → vue-ui-rating-Cl-ncmAS.cjs} +1 -1
- package/dist/{vue-ui-rating-D19QGpzZ.js → vue-ui-rating-DfKMxLTK.js} +2 -2
- package/dist/{vue-ui-relation-circle-YH6EpWSC.cjs → vue-ui-relation-circle-CJP9zuqV.cjs} +1 -1
- package/dist/{vue-ui-relation-circle-DqdXa6V6.js → vue-ui-relation-circle-DV5lMEvZ.js} +5 -5
- package/dist/{vue-ui-rings-CDqf78PA.js → vue-ui-rings-Bu-zVpHc.js} +9 -9
- package/dist/{vue-ui-rings-Dbi3uWQh.cjs → vue-ui-rings-C8u__5v-.cjs} +1 -1
- package/dist/{vue-ui-scatter-Ch3iYYoX.cjs → vue-ui-scatter-D3FTfnsR.cjs} +1 -1
- package/dist/{vue-ui-scatter-D3IFY9II.js → vue-ui-scatter-WeSsnz6H.js} +10 -10
- package/dist/{vue-ui-screenshot-Xtz1BC-w.js → vue-ui-screenshot-B9Mbp_0-.js} +1 -1
- package/dist/{vue-ui-screenshot-DBmmftjw.cjs → vue-ui-screenshot-BFL-8cPa.cjs} +1 -1
- package/dist/{vue-ui-skeleton-C3UWXP3Q.js → vue-ui-skeleton-BOhyMEA5.js} +2 -2
- package/dist/{vue-ui-skeleton-Bx_kbjKr.cjs → vue-ui-skeleton-dfikkXQa.cjs} +1 -1
- package/dist/{vue-ui-smiley-BCorPn2E.cjs → vue-ui-smiley-BVd6D7fu.cjs} +1 -1
- package/dist/{vue-ui-smiley-FhcqViE3.js → vue-ui-smiley-CwYjTYN8.js} +2 -2
- package/dist/{vue-ui-spark-trend-RJUm-CJC.js → vue-ui-spark-trend-D6IwslA-.js} +4 -4
- package/dist/{vue-ui-spark-trend-C1BmsVRe.cjs → vue-ui-spark-trend-DuIEXk8W.cjs} +1 -1
- package/dist/{vue-ui-sparkbar-C6sZ4mYK.js → vue-ui-sparkbar-1v_BypP0.js} +3 -3
- package/dist/{vue-ui-sparkbar-CtQSQySy.cjs → vue-ui-sparkbar-woU3TqMe.cjs} +1 -1
- package/dist/{vue-ui-sparkgauge-CoyqAUDp.cjs → vue-ui-sparkgauge-B4wnbfIi.cjs} +1 -1
- package/dist/{vue-ui-sparkgauge-C1pOZo8V.js → vue-ui-sparkgauge-Cwu4aQUR.js} +3 -3
- package/dist/{vue-ui-sparkhistogram-Mh93EuLF.js → vue-ui-sparkhistogram-BTdWXIO8.js} +4 -4
- package/dist/{vue-ui-sparkhistogram-DvBJHfyk.cjs → vue-ui-sparkhistogram-wRqt6OJx.cjs} +1 -1
- package/dist/{vue-ui-sparkline-DiAIsoI3.js → vue-ui-sparkline-B2v0wJH3.js} +3 -3
- package/dist/{vue-ui-sparkline-CXIAmE5m.cjs → vue-ui-sparkline-DE3oMNsY.cjs} +1 -1
- package/dist/{vue-ui-sparkstackbar-Bb8ZtMfn.js → vue-ui-sparkstackbar-B4lRHLJK.js} +3 -3
- package/dist/{vue-ui-sparkstackbar-BePzQn-H.cjs → vue-ui-sparkstackbar-DIk48oMu.cjs} +1 -1
- package/dist/{vue-ui-stackbar-B7KyGHZZ.js → vue-ui-stackbar-DSc8j8LH.js} +10 -10
- package/dist/{vue-ui-stackbar-BiNZ2pBZ.cjs → vue-ui-stackbar-DVdBUu5U.cjs} +1 -1
- package/dist/{vue-ui-strip-plot-8d_juyi7.js → vue-ui-strip-plot-6hhRMLCq.js} +9 -9
- package/dist/{vue-ui-strip-plot-CY5rDwjh.cjs → vue-ui-strip-plot-Cjays3PT.cjs} +1 -1
- package/dist/{vue-ui-table-CoGh4xvF.cjs → vue-ui-table-D-_a1UzS.cjs} +1 -1
- package/dist/{vue-ui-table-CSm91gHM.js → vue-ui-table-DQkiNDaZ.js} +1 -1
- package/dist/{vue-ui-table-heatmap-CwDproVr.cjs → vue-ui-table-heatmap-BRvVWrf1.cjs} +1 -1
- package/dist/{vue-ui-table-heatmap-B30TipjK.js → vue-ui-table-heatmap-_KVKSH7q.js} +4 -4
- package/dist/{vue-ui-table-sparkline-BcFIKA8V.js → vue-ui-table-sparkline-C_0i15kC.js} +5 -5
- package/dist/{vue-ui-table-sparkline-B8lCOsfc.cjs → vue-ui-table-sparkline-kyYy6tk8.cjs} +1 -1
- package/dist/{vue-ui-thermometer-D6rDq4hj.cjs → vue-ui-thermometer-BjU-T5A0.cjs} +1 -1
- package/dist/{vue-ui-thermometer-CPqFKYwL.js → vue-ui-thermometer-y3Hm1mwz.js} +5 -5
- package/dist/{vue-ui-timer-DdQB8bF5.js → vue-ui-timer-7ouUkgHq.js} +4 -4
- package/dist/{vue-ui-timer-C70sw9Rc.cjs → vue-ui-timer-CVHz7dT6.cjs} +1 -1
- package/dist/{vue-ui-tiremarks-DDCOUKU9.js → vue-ui-tiremarks-8-riUzAT.js} +5 -5
- package/dist/{vue-ui-tiremarks-o-KdCzZV.cjs → vue-ui-tiremarks-Dr9qSWVo.cjs} +1 -1
- package/dist/{vue-ui-treemap-BOCZ8x4F.js → vue-ui-treemap-ChYWvnSf.js} +9 -9
- package/dist/{vue-ui-treemap-C3XRZk0P.cjs → vue-ui-treemap-CmoQK2_G.cjs} +1 -1
- package/dist/{vue-ui-vertical-bar-C2ZIoY0I.cjs → vue-ui-vertical-bar-Doj3k8dI.cjs} +1 -1
- package/dist/{vue-ui-vertical-bar-CAlQekf-.js → vue-ui-vertical-bar-Ecx25LWQ.js} +9 -9
- package/dist/{vue-ui-waffle-D1eYO-NM.cjs → vue-ui-waffle-BgoDu9wa.cjs} +1 -1
- package/dist/{vue-ui-waffle-CasLSUzY.js → vue-ui-waffle-BlqBRA5E.js} +9 -9
- package/dist/{vue-ui-wheel-C4ODblPX.cjs → vue-ui-wheel-BlVmj1yz.cjs} +1 -1
- package/dist/{vue-ui-wheel-CHn24pYD.js → vue-ui-wheel-DNndo4fU.js} +5 -5
- package/dist/{vue-ui-word-cloud-uGJLXPYv.js → vue-ui-word-cloud-C9XDZjPt.js} +7 -7
- package/dist/{vue-ui-word-cloud-XCS_A5_a.cjs → vue-ui-word-cloud-Cvyev8yY.cjs} +1 -1
- package/dist/{vue-ui-xy-KnfMOUv4.js → vue-ui-xy-DkNi0ZJ4.js} +12 -12
- package/dist/{vue-ui-xy-canvas-DVjSzeFt.js → vue-ui-xy-canvas-DIFlyxki.js} +10 -10
- package/dist/{vue-ui-xy-canvas-Yy7FaFLS.cjs → vue-ui-xy-canvas-a3pNJKYd.cjs} +1 -1
- package/dist/{vue-ui-xy-CH9wvh8w.cjs → vue-ui-xy-x5TSd-hr.cjs} +1 -1
- package/package.json +1 -1
- package/dist/vue-ui-quick-chart-CNn9Wt0K.cjs +0 -15
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("./html2canvas.esm-BA_v9SIU.cjs"),I=require("./jspdf.es.min-DLYY9DTT.cjs"),u=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("./html2canvas.esm-BA_v9SIU.cjs"),I=require("./jspdf.es.min-DLYY9DTT.cjs"),u=require("./index-CeMgFh6-.cjs"),o=require("vue"),F=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),f={props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{shapes:[],lastSelectedShape:void 0}}}},data(){return{activeShape:void 0,strokeSize:1,currentPointer:{start:{x:0,y:0},end:{x:0,end:0}},currentTarget:void 0,hoveredShapeId:void 0,isBold:!1,isBulletTextMode:!1,isDash:!1,isDeleteMode:!1,isDrawing:!1,isDrawingNewShape:!0,isDrawMode:!1,isItalic:!1,isMouseDown:!1,isMoveMode:!1,isPrinting:!1,isResizeMode:!1,isSelectMode:!1,isSummaryOpen:!1,isTextMode:!1,isUnderline:!1,isWriting:!1,lastSelectedShape:this.dataset.lastSelectedShape,pointerDownId:-1,pointerPosition:{x:0,y:0},preventEdit:!0,selectedGroup:[],shapes:this.dataset.shapes?this.dataset.shapes:[],shapesOrder:[],step:Math.round(Math.random())*1e5,svgHeight:1e3,svgWidth:1e3,options:{arrow:{color:"grey",filled:!0},circle:{color:"grey",filled:!1,radius:3,strokeWidth:2},rect:{color:"grey",filled:!1,strokeWidth:2,height:12,width:12}},selectedColor:"#000000",showCaret:!1,sizeRatio:1,slottedSvg:void 0,sourceWidth:1,sourceHeight:1,textAlign:"start",textFont:20,transparency:100,transparencyCodes:u.opacity}},watch:{shapes:{handler(e){e.length===0&&(this.lastSelectedShape=void 0)}}},computed:{FINAL_CONFIG(){const e=u.useConfig().vue_ui_annotator;if(!Object.keys(this.config||{}).length)return e;const l=this.treeShake({defaultConfig:e,userConfig:this.config});return this.convertConfigColors(l)},canSelect(){return this.shapes.filter(e=>!["line","group"].includes(e.type)).length>1},colorTransparency(){return this.transparencyCodes[this.transparency>98?98:this.transparency]},cursorClass(){switch(!0){case this.isDeleteMode:return"default";case this.isMoveMode:return"move";case this.isTextMode:return"text";case this.isResizeMode:return"se-resize";default:return""}},records(){return this.shapes},userShapes(){return this.records.map(e=>{switch(!0){case(e&&e.type==="arrow"):const l=e.strokeWidth>3?5:10,s=e.strokeWidth>3?2.5:5;return`
|
|
2
2
|
<defs>
|
|
3
3
|
<marker
|
|
4
4
|
id="${e.id}"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import p from "./html2canvas.esm-d2sM-0Wm.js";
|
|
2
2
|
import { E as _ } from "./jspdf.es.min-C660YX78.js";
|
|
3
|
-
import { z as v, u as w, A, B as M } from "./index-
|
|
3
|
+
import { z as v, u as w, A, B as M } from "./index-B6m-GhsP.js";
|
|
4
4
|
import { openBlock as d, createElementBlock as n, createElementVNode as r, normalizeStyle as c, toDisplayString as u, normalizeClass as y, createCommentVNode as a, withDirectives as f, vModelCheckbox as g, vModelText as C, renderSlot as O, Fragment as L, renderList as G, createStaticVNode as N, pushScopeId as m, popScopeId as T } from "vue";
|
|
5
5
|
import { _ as R } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
6
6
|
const D = {
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { computed as h, ref as v, watch as fe, onMounted as Ie, onBeforeUnmount as Oe, openBlock as u, createElementBlock as s, normalizeClass as be, normalizeStyle as q, createBlock as N, createCommentVNode as c, unref as p, createSlots as Be, withCtx as b, renderSlot as x, normalizeProps as L, guardReactiveProps as R, createElementVNode as n, Fragment as S, renderList as z, toDisplayString as V, createVNode as Pe, createTextVNode as Me, nextTick as Ue } from "vue";
|
|
2
|
-
import { u as Ee, c as De, t as We, o as Ge, e as C, C as Xe, v as I, X as je, w as D, D as He, s as Ye, x as qe, y as Je, q as Ke, r as Qe, E as xe } from "./index-
|
|
2
|
+
import { u as Ee, c as De, t as We, o as Ge, e as C, C as Xe, v as I, X as je, w as D, D as He, s as Ye, x as qe, y as Je, q as Ke, r as Qe, E as xe } from "./index-B6m-GhsP.js";
|
|
3
3
|
import { t as Ze, u as et } from "./useResponsive-NZB-WLRF.js";
|
|
4
|
-
import { _ as tt } from "./Title-
|
|
5
|
-
import { u as lt, U as ot } from "./usePrinter-
|
|
6
|
-
import { _ as at } from "./Tooltip-
|
|
7
|
-
import { D as ut } from "./DataTable-
|
|
8
|
-
import st from "./vue-ui-skeleton-
|
|
9
|
-
import { S as it } from "./Slicer-
|
|
10
|
-
import nt from "./vue-ui-accordion-
|
|
11
|
-
import { u as me } from "./useNestedProp-
|
|
4
|
+
import { _ as tt } from "./Title-CXeDgAE7.js";
|
|
5
|
+
import { u as lt, U as ot } from "./usePrinter-BkKBQlCO.js";
|
|
6
|
+
import { _ as at } from "./Tooltip-_e0VoMC-.js";
|
|
7
|
+
import { D as ut } from "./DataTable-OKHTStDc.js";
|
|
8
|
+
import st from "./vue-ui-skeleton-BOhyMEA5.js";
|
|
9
|
+
import { S as it } from "./Slicer-CB-YgfIM.js";
|
|
10
|
+
import nt from "./vue-ui-accordion-BygOGjRr.js";
|
|
11
|
+
import { u as me } from "./useNestedProp-BrcBWysp.js";
|
|
12
12
|
import { _ as rt } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
13
13
|
const vt = ["id"], dt = ["xmlns", "viewBox"], yt = { key: 0 }, ct = ["id"], ht = ["stop-color"], pt = ["stop-color"], gt = ["stop-color"], ft = ["id"], bt = ["stop-color"], xt = ["stop-color"], mt = ["stop-color"], kt = { key: 0 }, wt = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], $t = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], _t = { key: 1 }, Ct = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], Nt = ["x", "y", "font-size", "fill", "font-weight"], St = { key: 2 }, zt = ["transform", "text-anchor", "font-size", "fill", "font-weight"], Tt = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], At = { key: 0 }, Ft = ["cx", "cy", "r", "fill"], Lt = ["cx", "cy", "r", "fill"], Rt = { key: 1 }, Vt = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], It = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], Ot = ["x", "y", "height", "width", "fill", "rx"], Bt = ["x", "y", "height", "width", "fill", "rx", "stroke", "stroke-width"], Pt = ["x", "y", "height", "width", "fill", "onMouseover"], Mt = {
|
|
14
14
|
key: 3,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),i=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),i=require("./index-CeMgFh6-.cjs"),ee=require("./useResponsive-B3TrDDIG.cjs"),ge=require("./Title-B238VbIb.cjs"),te=require("./usePrinter-_rbdfvVi.cjs"),me=require("./Tooltip-hihJcWT0.cjs"),ke=require("./DataTable-BfvpbyB5.cjs"),xe=require("./vue-ui-skeleton-dfikkXQa.cjs"),be=require("./Slicer-BPvgOo6Z.cjs"),we=require("./vue-ui-accordion-CH_rY04P.cjs"),le=require("./useNestedProp-CD3RA8XO.cjs"),Ce=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),Ne=["id"],$e=["xmlns","viewBox"],_e={key:0},Be=["id"],Se=["stop-color"],Ve=["stop-color"],Ee=["stop-color"],ze=["id"],Te=["stop-color"],Fe=["stop-color"],Ae=["stop-color"],Le={key:0},Re=["x1","x2","y1","y2","stroke","stroke-width"],Pe=["x1","x2","y1","y2","stroke","stroke-width"],Ie={key:1},Oe=["x1","x2","y1","y2","stroke","stroke-width"],Me=["x","y","font-size","fill","font-weight"],Ue={key:2},De=["transform","text-anchor","font-size","fill","font-weight"],qe=["x1","x2","y1","y2","stroke","stroke-width"],We={key:0},Ge=["cx","cy","r","fill"],He=["cx","cy","r","fill"],je={key:1},Xe=["x1","x2","y1","y2","stroke","stroke-width"],Ye=["x1","x2","y1","y2","stroke","stroke-width"],Je=["x","y","height","width","fill","rx"],Ke=["x","y","height","width","fill","rx","stroke","stroke-width"],Qe=["x","y","height","width","fill","onMouseover"],Ze={key:3,class:"vue-data-ui-watermark"},et=["innerHTML"],tt={__name:"vue-ui-candlestick",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},setup(f,{expose:oe}){const h=f,{vue_ui_candlestick:ae}=i.useConfig(),m=e.computed(()=>!!h.dataset&&h.dataset.length),y=e.ref(i.createUid()),ue=e.ref(null),B=e.ref(!1),S=e.ref(""),V=e.ref(void 0),F=e.ref(0),k=e.ref(null),A=e.ref(null),L=e.ref(null),R=e.ref(null),b=e.ref(0),P=e.ref(0),I=e.ref(0),t=e.computed({get:()=>O(),set:l=>l});function O(){const l=le.useNestedProp({userConfig:h.config,defaultConfig:ae});return l.theme?{...le.useNestedProp({userConfig:i.themes.vue_ui_candlestick[l.theme]||h.config,defaultConfig:l})}:l}e.watch(()=>h.config,l=>{t.value=O(),M(),b.value+=1,I.value+=1,P.value+=1},{deep:!0}),e.watch(()=>h.dataset,l=>{d.value.start=0,d.value.end=l.length,b.value+=1},{deep:!0});const r=e.ref({height:t.value.style.height,width:t.value.style.width,xAxisFontSize:t.value.style.layout.grid.xAxis.dataLabels.fontSize,yAxisFontSize:t.value.style.layout.grid.yAxis.dataLabels.fontSize}),w=e.ref(null);e.onMounted(()=>{M()});function M(){if(i.objectIsEmpty(h.dataset)&&i.error({componentName:"VueUiCandlestick",type:"dataset"}),t.value.responsive){const l=ee.throttle(()=>{const{width:u,height:o}=ee.useResponsive({chart:k.value,title:t.value.style.title.text?A.value:null,slicer:R.value,legend:L.value});r.value.width=u,r.value.height=o,r.value.xAxisFontSize=i.translateSize({relator:Math.min(u,o),adjuster:t.value.style.width,source:t.value.style.layout.grid.xAxis.dataLabels.fontSize,threshold:6,fallback:6}),r.value.yAxisFontSize=i.translateSize({relator:Math.min(u,o),adjuster:t.value.style.width,source:t.value.style.layout.grid.yAxis.dataLabels.fontSize,threshold:6,fallback:6})});w.value=new ResizeObserver(l),w.value.observe(k.value.parentNode)}}e.onBeforeUnmount(()=>{w.value&&w.value.disconnect()});const{isPrinting:U,isImaging:D,generatePdf:q,generateImage:W}=te.usePrinter({elementId:`vue-ui-candlestick_${y.value}`,fileName:t.value.style.title.text||"vue-ui-candlestick"}),p=e.ref({showTable:t.value.table.show,showTooltip:t.value.style.tooltip.show}),s=e.computed(()=>{const{top:l,right:u,bottom:o,left:a}=t.value.style.layout.padding;return{top:l,right:r.value.width-u,left:a,bottom:r.value.height-o,width:r.value.width-a-u,height:r.value.height-l-o}}),E=e.computed(()=>h.dataset.length),d=e.ref({start:0,end:E.value}),G=e.computed(()=>h.dataset.slice(d.value.start,d.value.end)),z=e.computed(()=>(h.dataset.forEach((l,u)=>{[null,void 0].includes(l[0])&&i.error({componentName:"VueUiCandlestick",type:"datasetAttribute",property:"period (index 0)",index:u}),[null,void 0].includes(l[1])&&i.error({componentName:"VueUiCandlestick",type:"datasetAttribute",property:"open (index 1)",index:u}),[null,void 0].includes(l[2])&&i.error({componentName:"VueUiCandlestick",type:"datasetAttribute",property:"high (index 2)",index:u}),[null,void 0].includes(l[3])&&i.error({componentName:"VueUiCandlestick",type:"datasetAttribute",property:"low (index 3)",index:u}),[null,void 0].includes(l[4])&&i.error({componentName:"VueUiCandlestick",type:"datasetAttribute",property:"last (index 4)",index:u}),[null,void 0].includes(l[5])&&i.error({componentName:"VueUiCandlestick",type:"datasetAttribute",property:"volume (index 5)",index:u})}),G.value.map(l=>({period:l[0],open:l[1],high:l[2],low:l[3],last:l[4],volume:l[5]})))),n=e.computed(()=>s.value.width/G.value.length),H=e.computed(()=>({max:Math.max(...z.value.map(l=>l.high)),min:0})),g=e.computed(()=>i.calculateNiceScale(H.value.min,H.value.max,t.value.style.layout.grid.yAxis.dataLabels.steps));function C(l,u){return{...l,x:i.checkNaN(s.value.left+u*n.value+n.value/2),y:i.checkNaN(s.value.top+(1-l/g.value.max)*s.value.height),value:i.checkNaN(l)}}const c=e.computed(()=>z.value.map((l,u)=>{const o=C(l.open,u),a=C(l.high,u),v=C(l.low,u),$=C(l.last,u),_=l.last>l.open;return{period:l.period,open:o,high:a,low:v,last:$,volume:l.volume,isBullish:_}}));function ie(l){return i.checkNaN(l/g.value.max)}const se=e.computed(()=>g.value.ticks.map(l=>({y:s.value.bottom-s.value.height*ie(l),value:i.checkNaN(l)}))),ne=e.computed(()=>z.value.map(l=>l.period)),T=e.ref(null);function re(l,u){V.value=l,T.value={datapoint:u,seriesIndex:l,series:c.value,config:t.value};const o=t.value.style.tooltip.customFormat;if(i.isFunction(o)&&i.functionReturnsString(()=>o({seriesIndex:l,datapoint:u,series:c.value,config:t.value})))S.value=o({seriesIndex:l,datapoint:u,series:c.value,config:t.value});else if(t.value.style.tooltip.show){let a="";const{period:v,open:$,high:_,low:J,last:K,volume:Q,isBullish:Z}=c.value[l],{period:ot,open:ve,high:ye,low:he,last:pe,volume:fe}=t.value.translations;a+=`<div><svg style="margin-right:6px" viewBox="0 0 12 12" height="12" width="12"><rect x="0" y="0" height="12" width="12" rx="${t.value.style.layout.candle.borderRadius*3}" stroke="${t.value.style.layout.candle.stroke}" stroke-width="${t.value.style.layout.candle.strokeWidth}"
|
|
2
2
|
fill="${t.value.style.layout.candle.gradient.show?Z?`url(#bullish_gradient_${y.value})`:`url(#bearish_gradient_${y.value})`:Z?t.value.style.layout.candle.colors.bullish:t.value.style.layout.candle.colors.bearish}"/></svg>${v}</div>`,a+=`${fe} : <b>${isNaN(Q)?"-":Number(Q.toFixed(t.value.style.tooltip.roundingValue)).toLocaleString()}</b>`,a+=`<div style="margin-top:6px;padding-top:6px;border-top:1px solid ${t.value.style.tooltip.borderColor}">`,a+=`<div>${ve}: <b>${t.value.style.tooltip.prefix} ${isNaN($.value)?"-":Number($.value.toFixed(t.value.style.tooltip.roundingValue)).toLocaleString()} ${t.value.style.tooltip.suffix}</b></div>`,a+=`<div>${ye}: <b>${t.value.style.tooltip.prefix} ${isNaN(_.value)?"-":Number(_.value.toFixed(t.value.style.tooltip.roundingValue)).toLocaleString()} ${t.value.style.tooltip.suffix}</b></div>`,a+=`<div>${he}: <b>${t.value.style.tooltip.prefix} ${isNaN(J.value)?"-":Number(J.value.toFixed(t.value.style.tooltip.roundingValue)).toLocaleString()} ${t.value.style.tooltip.suffix}</b></div>`,a+=`<div>${pe}: <b>${t.value.style.tooltip.prefix} ${isNaN(K.value)?"-":Number(K.value.toFixed(t.value.style.tooltip.roundingValue)).toLocaleString()} ${t.value.style.tooltip.suffix}</b></div>`,a+="</div>",S.value=`<div style="text-align:right">${a}</div>`}B.value=!0}function de(){d.value={start:0,end:E.value},b.value+=1}function j(){e.nextTick(()=>{const l=[t.value.translations.period,t.value.translations.open,t.value.translations.high,t.value.translations.low,t.value.translations.last,t.value.translations.volume],u=c.value.map(v=>[v.period,v.open.value,v.high.value,v.low.value,v.last.value,v.volume]),o=[[t.value.style.title.text],[t.value.style.title.subtitle.text],[[""],[""],[""]]].concat([l]).concat(u),a=i.createCsvContent(o);i.downloadCsv({csvContent:a,title:t.value.style.title.text||"vue-ui-candlestick"})})}const N=e.computed(()=>{const l=c.value.map(a=>[`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 12 12" height="12" width="12" style="margin-right: 6px"><rect x="0" y="0" height="12" width="12" :rx="${t.value.style.layout.candle.borderRadius*3}" fill="${t.value.style.layout.candle.gradient.show?a.isBullish?`url(#bullish_gradient_${y.value}`:`url(#bearish_gradient_${y.value})`:a.isBullish?t.value.style.layout.candle.colors.bullish:t.value.style.layout.candle.colors.bearish}"/></svg> ${a.period}`,`${t.value.table.td.prefix} ${isNaN(a.open.value)?"-":Number(a.open.value.toFixed(t.value.table.td.roundingValue)).toLocaleString()} ${t.value.table.td.suffix}`,`${t.value.table.td.prefix} ${isNaN(a.high.value)?"-":Number(a.high.value.toFixed(t.value.table.td.roundingValue)).toLocaleString()} ${t.value.table.td.suffix}`,`${t.value.table.td.prefix} ${isNaN(a.low.value)?"-":Number(a.low.value.toFixed(t.value.table.td.roundingValue)).toLocaleString()} ${t.value.table.td.suffix}`,`${t.value.table.td.prefix} ${isNaN(a.last.value)?"-":Number(a.last.value.toFixed(t.value.table.td.roundingValue)).toLocaleString()} ${t.value.table.td.suffix}`,`${isNaN(a.volume)?"-":a.volume.toLocaleString()}`]),u={th:{backgroundColor:t.value.table.th.backgroundColor,color:t.value.table.th.color,outline:t.value.table.th.outline},td:{backgroundColor:t.value.table.td.backgroundColor,color:t.value.table.td.color,outline:t.value.table.td.outline},breakpoint:t.value.table.responsiveBreakpoint},o=[t.value.translations.period,t.value.translations.open,t.value.translations.high,t.value.translations.low,t.value.translations.last,t.value.translations.volume];return{head:o,body:l,config:u,colNames:o}}),x=e.ref(!1);function ce(l){x.value=l,F.value+=1}function X(){p.value.showTable=!p.value.showTable}function Y(){p.value.showTooltip=!p.value.showTooltip}return oe({generatePdf:q,generateCsv:j,generateImage:W,toggleTable:X,toggleTooltip:Y}),(l,u)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"candlestickChart",ref:k,class:e.normalizeClass(`vue-ui-candlestick ${x.value?"vue-data-ui-wrapper-fullscreen":""} ${t.value.useCssAnimation?"":"vue-ui-dna"}`),style:e.normalizeStyle(`position:relative;font-family:${t.value.style.fontFamily}; text-align:center;${t.value.style.title.text?"":"padding-top:36px"};background:${t.value.style.backgroundColor}; ${t.value.responsive?"height: 100%":""}`),id:`vue-ui-candlestick_${y.value}`},[t.value.style.title.text?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"chartTitle",ref:A,style:e.normalizeStyle(`width:100%;background:${t.value.style.backgroundColor}`)},[(e.openBlock(),e.createBlock(ge._sfc_main,{key:`title_${I.value}`,config:{title:{cy:"candlestick-div-title",...t.value.style.title},subtitle:{cy:"candlestick-div-subtitle",...t.value.style.title.subtitle}}},null,8,["config"]))],4)):e.createCommentVNode("",!0),t.value.userOptions.show&&m.value?(e.openBlock(),e.createBlock(te.UserOptions,{ref_key:"details",ref:ue,key:`user_options_${F.value}`,backgroundColor:t.value.style.backgroundColor,color:t.value.style.color,isImaging:e.unref(D),isPrinting:e.unref(U),uid:y.value,hasTooltip:t.value.userOptions.buttons.tooltip&&t.value.style.tooltip.show,hasPdf:t.value.userOptions.buttons.pdf,hasImg:t.value.userOptions.buttons.img,hasXls:t.value.userOptions.buttons.csv,hasTable:t.value.userOptions.buttons.table,hasFullscreen:t.value.userOptions.buttons.fullscreen,isFullscreen:x.value,isTooltip:p.value.showTooltip,titles:{...t.value.userOptions.buttonTitles},chartElement:k.value,onToggleFullscreen:ce,onGeneratePdf:e.unref(q),onGenerateCsv:j,onGenerateImage:e.unref(W),onToggleTable:X,onToggleTooltip:Y},e.createSlots({_:2},[l.$slots.optionTooltip?{name:"optionTooltip",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionTooltip",{},void 0,!0)]),key:"0"}:void 0,l.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionPdf",{},void 0,!0)]),key:"1"}:void 0,l.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionCsv",{},void 0,!0)]),key:"2"}:void 0,l.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionImg",{},void 0,!0)]),key:"3"}:void 0,l.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionTable",{},void 0,!0)]),key:"4"}:void 0,l.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:o,isFullscreen:a})=>[e.renderSlot(l.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:o,isFullscreen:a})),void 0,!0)]),key:"5"}:void 0]),1032,["backgroundColor","color","isImaging","isPrinting","uid","hasTooltip","hasPdf","hasImg","hasXls","hasTable","hasFullscreen","isFullscreen","isTooltip","titles","chartElement","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),m.value?(e.openBlock(),e.createElementBlock("svg",{key:2,xmlns:e.unref(i.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":x.value,"vue-data-ui-fulscreen--off":!x.value}),viewBox:`0 0 ${r.value.width<=0?10:r.value.width} ${r.value.height<=0?10:r.value.height}`,style:e.normalizeStyle(`max-width:100%;overflow:visible;background:${t.value.style.backgroundColor};color:${t.value.style.color}`)},[c.value.length>0?(e.openBlock(),e.createElementBlock("g",_e,[e.createElementVNode("defs",null,[e.createElementVNode("linearGradient",{id:`bearish_gradient_${y.value}`,x2:"0%",y2:"100%"},[e.createElementVNode("stop",{offset:"0%","stop-color":t.value.style.layout.candle.colors.bearish},null,8,Se),e.createElementVNode("stop",{offset:"50%","stop-color":`${e.unref(i.shiftHue)(t.value.style.layout.candle.colors.bearish,.02)}DE`},null,8,Ve),e.createElementVNode("stop",{offset:"100%","stop-color":`${e.unref(i.shiftHue)(t.value.style.layout.candle.colors.bearish,.05)}66`},null,8,Ee)],8,Be),e.createElementVNode("linearGradient",{id:`bullish_gradient_${y.value}`,x2:"0%",y2:"100%"},[e.createElementVNode("stop",{offset:"0%","stop-color":t.value.style.layout.candle.colors.bullish},null,8,Te),e.createElementVNode("stop",{offset:"50%","stop-color":`${e.unref(i.shiftHue)(t.value.style.layout.candle.colors.bullish,.02)}DE`},null,8,Fe),e.createElementVNode("stop",{offset:"100%","stop-color":`${e.unref(i.shiftHue)(t.value.style.layout.candle.colors.bullish,.05)}66`},null,8,Ae)],8,ze)]),t.value.style.layout.grid.show?(e.openBlock(),e.createElementBlock("g",Le,[e.createElementVNode("line",{x1:s.value.left,x2:s.value.left,y1:s.value.top,y2:s.value.bottom,stroke:t.value.style.layout.grid.stroke,"stroke-width":t.value.style.layout.grid.strokeWidth,"stroke-linecap":"round"},null,8,Re),e.createElementVNode("line",{x1:s.value.left,x2:s.value.right,y1:s.value.bottom,y2:s.value.bottom,stroke:t.value.style.layout.grid.stroke,"stroke-width":t.value.style.layout.grid.strokeWidth,"stroke-linecap":"round"},null,8,Pe)])):e.createCommentVNode("",!0),t.value.style.layout.grid.yAxis.dataLabels.show?(e.openBlock(),e.createElementBlock("g",Ie,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(se.value,(o,a)=>(e.openBlock(),e.createElementBlock("g",null,[o.value>=g.value.min&&o.value<=g.value.max?(e.openBlock(),e.createElementBlock("line",{key:0,x1:s.value.left,x2:s.value.left-5,y1:o.y,y2:o.y,stroke:t.value.style.layout.grid.stroke,"stroke-width":t.value.style.layout.grid.strokeWidth,"stroke-linecap":"round"},null,8,Oe)):e.createCommentVNode("",!0),o.value>=g.value.min&&o.value<=g.value.max?(e.openBlock(),e.createElementBlock("text",{key:1,x:s.value.left-8+t.value.style.layout.grid.yAxis.dataLabels.offsetX,y:o.y+r.value.yAxisFontSize/3,"font-size":r.value.yAxisFontSize,"text-anchor":"end",fill:t.value.style.layout.grid.yAxis.dataLabels.color,"font-weight":t.value.style.layout.grid.yAxis.dataLabels.bold?"bold":"normal"},e.toDisplayString(t.value.style.layout.grid.yAxis.dataLabels.prefix)+" "+e.toDisplayString(e.unref(i.canShowValue)(o.value)?o.value.toFixed(t.value.style.layout.grid.yAxis.dataLabels.roundingValue):"")+" "+e.toDisplayString(t.value.style.layout.grid.yAxis.dataLabels.suffix),9,Me)):e.createCommentVNode("",!0)]))),256))])):e.createCommentVNode("",!0),t.value.style.layout.grid.xAxis.dataLabels.show?(e.openBlock(),e.createElementBlock("g",Ue,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ne.value,(o,a)=>(e.openBlock(),e.createElementBlock("g",null,[e.createElementVNode("text",{transform:`translate(${s.value.left+n.value*a+n.value/2}, ${s.value.bottom+r.value.xAxisFontSize*2+t.value.style.layout.grid.xAxis.dataLabels.offsetY}), rotate(${t.value.style.layout.grid.xAxis.dataLabels.rotation})`,"text-anchor":t.value.style.layout.grid.xAxis.dataLabels.rotation>0?"start":t.value.style.layout.grid.xAxis.dataLabels.rotation<0?"end":"middle","font-size":r.value.xAxisFontSize,fill:t.value.style.layout.grid.xAxis.dataLabels.color,"font-weight":t.value.style.layout.grid.xAxis.dataLabels.bold?"bold":"normal"},e.toDisplayString(o),9,De)]))),256))])):e.createCommentVNode("",!0),e.createElementVNode("g",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,(o,a)=>(e.openBlock(),e.createElementBlock("g",null,[e.createElementVNode("line",{x1:o.open.x,x2:o.open.x,y1:o.high.y,y2:o.low.y,stroke:t.value.style.layout.wick.stroke,"stroke-width":t.value.style.layout.wick.strokeWidth,"stroke-linecap":"round"},null,8,qe),t.value.style.layout.wick.extremity.shape==="circle"?(e.openBlock(),e.createElementBlock("g",We,[e.createElementVNode("circle",{cx:o.high.x,cy:o.high.y,r:t.value.style.layout.wick.extremity.size==="auto"?n.value/20:t.value.style.layout.wick.extremity.size,fill:t.value.style.layout.wick.extremity.color},null,8,Ge),e.createElementVNode("circle",{cx:o.low.x,cy:o.low.y,r:t.value.style.layout.wick.extremity.size==="auto"?n.value/20:t.value.style.layout.wick.extremity.size,fill:t.value.style.layout.wick.extremity.color},null,8,He)])):e.createCommentVNode("",!0),t.value.style.layout.wick.extremity.shape==="line"?(e.openBlock(),e.createElementBlock("g",je,[e.createElementVNode("line",{x1:o.high.x-(t.value.style.layout.wick.extremity.size==="auto"?n.value*t.value.style.layout.candle.widthRatio:t.value.style.layout.wick.extremity.size)/2,x2:o.high.x+(t.value.style.layout.wick.extremity.size==="auto"?n.value*t.value.style.layout.candle.widthRatio:t.value.style.layout.wick.extremity.size)/2,y1:o.high.y,y2:o.high.y,stroke:t.value.style.layout.wick.extremity.color,"stroke-width":t.value.style.layout.wick.strokeWidth,"stroke-linecap":"round"},null,8,Xe),e.createElementVNode("line",{x1:o.low.x-(t.value.style.layout.wick.extremity.size==="auto"?n.value*t.value.style.layout.candle.widthRatio:t.value.style.layout.wick.extremity.size)/2,x2:o.low.x+(t.value.style.layout.wick.extremity.size==="auto"?n.value*t.value.style.layout.candle.widthRatio:t.value.style.layout.wick.extremity.size)/2,y1:o.low.y,y2:o.low.y,stroke:t.value.style.layout.wick.extremity.color,"stroke-width":t.value.style.layout.wick.strokeWidth,"stroke-linecap":"round"},null,8,Ye)])):e.createCommentVNode("",!0)]))),256))]),e.createElementVNode("g",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,(o,a)=>(e.openBlock(),e.createElementBlock("rect",{x:o.open.x-n.value/2+n.value*(1-t.value.style.layout.candle.widthRatio)/2,y:o.isBullish?o.last.y:o.open.y,height:Math.abs(o.last.y-o.open.y)<=0?1e-4:Math.abs(o.last.y-o.open.y),width:n.value*t.value.style.layout.candle.widthRatio<=0?1e-4:n.value*t.value.style.layout.candle.widthRatio,fill:t.value.style.layout.candle.gradient.underlayer,rx:t.value.style.layout.candle.borderRadius,stroke:"none"},null,8,Je))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,(o,a)=>(e.openBlock(),e.createElementBlock("rect",{x:o.open.x-n.value/2+n.value*(1-t.value.style.layout.candle.widthRatio)/2,y:o.isBullish?o.last.y:o.open.y,height:Math.abs(o.last.y-o.open.y)<=0?1e-4:Math.abs(o.last.y-o.open.y),width:n.value*t.value.style.layout.candle.widthRatio<=0?1e-4:n.value*t.value.style.layout.candle.widthRatio,fill:o.isBullish?t.value.style.layout.candle.gradient.show?`url(#bullish_gradient_${y.value})`:t.value.style.layout.candle.colors.bullish:t.value.style.layout.candle.gradient.show?`url(#bearish_gradient_${y.value})`:t.value.style.layout.candle.colors.bearish,rx:t.value.style.layout.candle.borderRadius,stroke:t.value.style.layout.candle.stroke,"stroke-width":t.value.style.layout.candle.strokeWidth,"stroke-linecap":"round","stroke-linejoin":"round"},null,8,Ke))),256))]),e.createElementVNode("g",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,(o,a)=>(e.openBlock(),e.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:V.value===a?e.unref(i.setOpacity)(t.value.style.layout.selector.color,t.value.style.layout.selector.opacity):"transparent",onMouseover:v=>re(a,o),onMouseleave:u[0]||(u[0]=v=>{V.value=void 0,B.value=!1})},null,40,Qe))),256))])])):e.createCommentVNode("",!0),e.renderSlot(l.$slots,"svg",{svg:r.value},void 0,!0)],14,$e)):e.createCommentVNode("",!0),l.$slots.watermark?(e.openBlock(),e.createElementBlock("div",Ze,[e.renderSlot(l.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(U)||e.unref(D)})),void 0,!0)])):e.createCommentVNode("",!0),m.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(xe.default,{key:4,config:{type:"candlesticks",style:{backgroundColor:t.value.style.backgroundColor,candlesticks:{axis:{color:"#CCCCCC"},candle:{color:"#CCCCCC"}}}}},null,8,["config"])),t.value.style.zoom.show&&m.value?(e.openBlock(),e.createElementBlock("div",{key:5,ref_key:"chartSlicer",ref:R},[(e.openBlock(),e.createBlock(be.Slicer,{key:`slicer_${b.value}`,background:t.value.style.zoom.color,borderColor:t.value.style.backgroundColor,fontSize:t.value.style.zoom.fontSize,useResetSlot:t.value.style.zoom.useResetSlot,labelLeft:f.dataset[d.value.start]?f.dataset[d.value.start][0]:f.dataset[0][0],labelRight:f.dataset[d.value.end-1]?f.dataset[d.value.end-1][0]:f.dataset.at(-1)[0],textColor:t.value.style.color,inputColor:t.value.style.zoom.color,selectColor:t.value.style.zoom.highlightColor,max:E.value,min:0,valueStart:d.value.start,valueEnd:d.value.end,start:d.value.start,"onUpdate:start":u[1]||(u[1]=o=>d.value.start=o),end:d.value.end,"onUpdate:end":u[2]||(u[2]=o=>d.value.end=o),onReset:de},{"reset-action":e.withCtx(({reset:o})=>[e.renderSlot(l.$slots,"reset-action",e.normalizeProps(e.guardReactiveProps({reset:o})),void 0,!0)]),_:3},8,["background","borderColor","fontSize","useResetSlot","labelLeft","labelRight","textColor","inputColor","selectColor","max","valueStart","valueEnd","start","end"]))],512)):e.createCommentVNode("",!0),e.createElementVNode("div",{ref_key:"chartLegend",ref:L},[e.renderSlot(l.$slots,"legend",{legend:c.value},void 0,!0)],512),e.createVNode(me._sfc_main,{show:p.value.showTooltip&&B.value,backgroundColor:t.value.style.tooltip.backgroundColor,color:t.value.style.tooltip.color,borderRadius:t.value.style.tooltip.borderRadius,borderColor:t.value.style.tooltip.borderColor,borderWidth:t.value.style.tooltip.borderWidth,fontSize:t.value.style.tooltip.fontSize,backgroundOpacity:t.value.style.tooltip.backgroundOpacity,position:t.value.style.tooltip.position,offsetY:t.value.style.tooltip.offsetY,parent:k.value,content:S.value,isCustom:t.value.style.tooltip.customFormat&&typeof t.value.style.tooltip.customFormat=="function"},{"tooltip-before":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({...T.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...T.value})),void 0,!0)]),_:3},8,["show","backgroundColor","color","borderRadius","borderColor","borderWidth","fontSize","backgroundOpacity","position","offsetY","parent","content","isCustom"]),m.value?(e.openBlock(),e.createBlock(we.default,{key:6,hideDetails:"",config:{open:p.value.showTable,maxHeight:1e4,body:{backgroundColor:t.value.style.backgroundColor,color:t.value.style.color},head:{backgroundColor:t.value.style.backgroundColor,color:t.value.style.color}}},{content:e.withCtx(()=>[(e.openBlock(),e.createBlock(ke.DataTable,{key:`table_${P.value}`,colNames:N.value.colNames,head:N.value.head,body:N.value.body,config:N.value.config,title:`${t.value.style.title.text}${t.value.style.title.subtitle.text?` : ${t.value.style.title.subtitle.text}`:""}`,onClose:u[3]||(u[3]=o=>p.value.showTable=!1)},{th:e.withCtx(({th:o})=>[e.createTextVNode(e.toDisplayString(o),1)]),td:e.withCtx(({td:o})=>[e.createElementVNode("div",{innerHTML:o},null,8,et)]),_:1},8,["colNames","head","body","config","title"]))]),_:1},8,["config"])):e.createCommentVNode("",!0)],14,Ne))}},lt=Ce._export_sfc(tt,[["__scopeId","data-v-b23b9d6f"]]);exports.default=lt;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),u=require("./index-BofUHMEw.cjs"),ae=require("./useNestedProp-DGK0LGfN.cjs"),j=require("./usePrinter-_JYb_33H.cjs"),ne=require("./vue-ui-skeleton-Bx_kbjKr.cjs"),le=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),re=["id"],ie=["height"],ue=["data-cell","height"],se={__name:"vue-ui-carousel-table",props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{}}}},setup(p,{expose:X}){const l=p,{vue_ui_carousel_table:_}=u.useConfig(),A=e.ref(u.createUid()),I=e.ref(!1),g=e.ref(!!l.dataset);e.onMounted(()=>{P()});function P(){u.objectIsEmpty(l.dataset)?u.error({componentName:"VueUiCarouselTable",type:"dataset"}):((!l.dataset.head||u.objectIsEmpty(l.dataset.head))&&(u.error({componentName:"VueUiCarouselTable",type:"datasetAttribute",property:"head"}),g.value=!1),(!l.dataset.body||u.objectIsEmpty(l.dataset.body))&&(u.error({componentName:"VueUiCarouselTable",type:"datasetAttribute",property:"body"}),g.value=!1))}const t=e.computed({get:()=>F(),set:o=>o});function F(){return ae.useNestedProp({userConfig:l.config,defaultConfig:_})}e.watch(()=>l.config,o=>{t.value=F(),P()},{deep:!0}),e.watch(()=>l.dataset,o=>{S()},{deep:!0});const{isPrinting:N,isImaging:O,generatePdf:J,generateImage:R}=j.usePrinter({elementId:`carousel-table_${A.value}`,fileName:t.value.caption.text||"vue-ui-carousel-table"}),s=e.ref({showAnimation:t.value.animation.use}),i=e.ref(null),V=e.ref(null),b=e.ref(null),y=e.ref(null),C=e.ref(0),B=e.ref(0),$=e.ref(!1),k=e.ref(null),c=e.ref(null),T=e.ref(0);function S(){k.value&&(c.value={elements:k.value.getElementsByTagName("tr"),heights:Array.from(k.value.getElementsByTagName("tr")).map(o=>o.getBoundingClientRect().height)})}e.onMounted(S);const K=e.computed(()=>!c.value||!c.value.heights.length?0:Math.max(...c.value.heights)+C.value+B.value),Q=e.computed(()=>l.dataset.body?t.value.tbody.tr.visible<=l.dataset.body.length?t.value.tbody.tr.visible:l.dataset.body.length:0),W=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)*Q.value+C.value+B.value),w=e.ref(0),x=e.ref(null),f=e.ref(0),m=e.ref(!1),L=e.ref(0);e.onMounted(()=>{b.value&&(C.value=b.value.getBoundingClientRect().height),y.value&&(B.value=y.value.getBoundingClientRect().height),s.value.showAnimation&&c.value&&M()}),e.onMounted(()=>{if(i.value){let a=function(){const r=o.getBoundingClientRect().bottom;n.forEach(d=>{d.getBoundingClientRect().top<r?d.style.visibility="hidden":d.style.visibility="visible"})};const o=i.value.querySelector("thead"),n=Array.from(k.value.querySelectorAll("tr"));i.value.addEventListener("scroll",a),a(),e.onBeforeUnmount(()=>{i.value.removeEventListener("scroll",a)})}});function Y(o){I.value=o,L.value+=1}function M(){!x.value&&!m.value&&(x.value=requestAnimationFrame(q))}function Z(){if(!i.value)return!1;const{scrollTop:o,scrollHeight:n,clientHeight:a}=i.value;return o+a>=n}function q(o){if(m.value)return;f.value||(f.value=o),o-f.value>=t.value.animation.speedMs&&(w.value+=c.value.heights[T.value],(Z()||T.value>=c.value.heights.length)&&(w.value=0,T.value=-1),T.value+=1,i.value&&i.value.scrollTo({top:w.value,behavior:"smooth"}),f.value=o),x.value=requestAnimationFrame(q)}function v(){m.value=!0,cancelAnimationFrame(x.value),x.value=null}e.onBeforeUnmount(v);function h(){!m.value||!s.value.showAnimation||(m.value=!1,f.value=0,M())}function ee(){t.value.animation.pauseOnHover&&v()}const E=e.ref(null);function te(){v(),clearTimeout(E.value)}function H(){clearTimeout(E.value),E.value=setTimeout(h,1e3)}e.watch(()=>t.value.animation.use,o=>{o?(s.value.showAnimation=!0,h()):(s.value.showAnimation=!1,v())});const oe=e.computed(()=>t.value.responsiveBreakpoint);e.onMounted(()=>{const o=new ResizeObserver(n=>{n.forEach(a=>{$.value=a.contentRect.width<oe.value}),C.value=b.value?b.value.getBoundingClientRect().height:0,B.value=y.value?y.value.getBoundingClientRect().height:0,T.value=0,e.nextTick(()=>{v(),f.value=0,w.value=0,S(),h()})});i.value&&o.observe(i.value)});function U(){J()}function D(){s.value.showAnimation=!s.value.showAnimation,s.value.showAnimation?h():v()}function G(){e.nextTick(()=>{const o=l.dataset.head.map((r,d)=>[[l.dataset.body[d]]]),n=[[t.value.caption.text],[l.dataset.head.map(r=>[r])]].concat(o),a=u.createCsvContent(n);u.downloadCsv({csvContent:a,title:t.value.caption.text||"vue-ui-carousel-table"})})}return X({pauseAnimation:v,resumeAnimation:h,toggleAnimation:D,generateCsv:G,generatePdf:U,generateImage:R}),(o,n)=>(e.openBlock(),e.createElementBlock("div",{style:{position:"relative",overflow:"visible"},ref_key:"chartContainer",ref:V},[e.createElementVNode("div",{ref_key:"tableContainer",ref:i,id:`carousel-table_${A.value}`,style:e.normalizeStyle({height:e.unref(N)||e.unref(O)?"auto":`${Math.max(W.value,K.value)}px`,containerType:"inline-size",position:"relative",overflow:"auto",fontFamily:t.value.fontFamily}),class:e.normalizeClass({"vue-ui-responsive":$.value,"is-playing":!m.value}),onMouseenter:n[0]||(n[0]=a=>ee()),onMouseleave:n[1]||(n[1]=a=>h()),onTouchstart:n[2]||(n[2]=a=>te()),onTouchend:n[3]||(n[3]=a=>H()),onTouchcancel:n[4]||(n[4]=a=>H())},[g.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:b,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:`${C.value}px`,zIndex:1})},[e.createElementVNode("tr",{ref_key:"tableRow",ref:y,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(p.dataset.head,(a,r)=>(e.openBlock(),e.createElementBlock("th",{role:"cell",key:`th_${r}`,style:e.normalizeStyle({...t.value.thead.tr.th.style,border:t.value.thead.tr.th.border.size?`${t.value.thead.tr.th.border.size}px solid ${t.value.thead.tr.th.border.color}`:"none",paddingTop:t.value.thead.tr.th.padding.top+"px",paddingRight:t.value.thead.tr.th.padding.right+"px",paddingBottom:t.value.thead.tr.th.padding.bottom+"px",paddingLeft:t.value.thead.tr.th.padding.left+"px"})},[e.createTextVNode(e.toDisplayString(o.$slots.th?"":a)+" ",1),e.renderSlot(o.$slots,"th",e.normalizeProps(e.guardReactiveProps({th:a,colIndex:r})),void 0,!0)],4))),128))],12,ie)],4),p.dataset.body&&p.dataset.head?(e.openBlock(),e.createElementBlock("tbody",{key:0,ref_key:"tbody",ref:k,style:e.normalizeStyle({clipPath:"inset(0,0,0,0)"})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p.dataset.body,(a,r)=>(e.openBlock(),e.createElementBlock("tr",{style:e.normalizeStyle({...t.value.tbody.tr.style,border:`${t.value.tbody.tr.border.size}px solid ${t.value.tbody.tr.border.color}`,verticalAlign:"middle"})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a,(d,z)=>(e.openBlock(),e.createElementBlock("td",{role:"cell","data-cell":p.dataset.head[z]||"",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:e.unref(u.setOpacity)(t.value.tbody.tr.td.style.backgroundColor,r%2===0&&t.value.tbody.tr.td.alternateColor?t.value.tbody.tr.td.alternateOpacity*100:100),paddingTop:t.value.tbody.tr.td.padding.top+"px",paddingRight:t.value.tbody.tr.td.padding.right+"px",paddingBottom:t.value.tbody.tr.td.padding.bottom+"px",paddingLeft:t.value.tbody.tr.td.padding.left+"px",verticalAlign:"middle"}),height:`${t.value.tbody.tr.height}px`},[e.createTextVNode(e.toDisplayString(o.$slots.td?"":d)+" ",1),e.renderSlot(o.$slots,"td",e.normalizeProps(e.guardReactiveProps({td:d,rowIndex:r,colIndex:z})),void 0,!0)],12,ue))),256))],4))),256))],4)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0)],46,re),g.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(ne.default,{key:0,config:{type:"table"}})),t.value.userOptions.show&&g.value?(e.openBlock(),e.createBlock(j.UserOptions,{ref:"details",key:`user_option_${L.value}`,backgroundColor:t.value.style.backgroundColor,color:t.value.style.color,isPrinting:e.unref(N),isImaging:e.unref(O),uid:A.value,hasTooltip:!1,hasPdf:t.value.userOptions.buttons.pdf,hasImg:t.value.userOptions.buttons.img,hasXls:t.value.userOptions.buttons.csv,hasTable:!1,hasLabel:!1,hasAnimation:t.value.userOptions.buttons.animation,isAnimation:!s.value.showAnimation,hasFullscreen:t.value.userOptions.buttons.fullscreen,isFullscreen:I.value,chartElement:V.value,titles:{...t.value.userOptions.buttonTitles},zIndex:3,noOffset:"",onGeneratePdf:U,onGenerateCsv:G,onGenerateImage:e.unref(R),onToggleAnimation:D,onToggleFullscreen:Y},e.createSlots({_:2},[o.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionPdf",{},void 0,!0)]),key:"0"}:void 0,o.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionCsv",{},void 0,!0)]),key:"1"}:void 0,o.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionImg",{},void 0,!0)]),key:"2"}:void 0,o.$slots.optionAnimation?{name:"optionAnimation",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionAnimation",{},void 0,!0)]),key:"3"}:void 0,o.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:a,isFullscreen:r})=>[e.renderSlot(o.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:a,isFullscreen:r})),void 0,!0)]),key:"4"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasPdf","hasImg","hasXls","hasAnimation","isAnimation","hasFullscreen","isFullscreen","chartElement","titles","onGenerateImage"])):e.createCommentVNode("",!0)],512))}},de=le._export_sfc(se,[["__scopeId","data-v-4dad7e0c"]]);exports.default=de;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),u=require("./index-CeMgFh6-.cjs"),ae=require("./useNestedProp-CD3RA8XO.cjs"),j=require("./usePrinter-_rbdfvVi.cjs"),ne=require("./vue-ui-skeleton-dfikkXQa.cjs"),le=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),re=["id"],ie=["height"],ue=["data-cell","height"],se={__name:"vue-ui-carousel-table",props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{}}}},setup(p,{expose:X}){const l=p,{vue_ui_carousel_table:_}=u.useConfig(),A=e.ref(u.createUid()),I=e.ref(!1),g=e.ref(!!l.dataset);e.onMounted(()=>{P()});function P(){u.objectIsEmpty(l.dataset)?u.error({componentName:"VueUiCarouselTable",type:"dataset"}):((!l.dataset.head||u.objectIsEmpty(l.dataset.head))&&(u.error({componentName:"VueUiCarouselTable",type:"datasetAttribute",property:"head"}),g.value=!1),(!l.dataset.body||u.objectIsEmpty(l.dataset.body))&&(u.error({componentName:"VueUiCarouselTable",type:"datasetAttribute",property:"body"}),g.value=!1))}const t=e.computed({get:()=>F(),set:o=>o});function F(){return ae.useNestedProp({userConfig:l.config,defaultConfig:_})}e.watch(()=>l.config,o=>{t.value=F(),P()},{deep:!0}),e.watch(()=>l.dataset,o=>{S()},{deep:!0});const{isPrinting:N,isImaging:O,generatePdf:J,generateImage:R}=j.usePrinter({elementId:`carousel-table_${A.value}`,fileName:t.value.caption.text||"vue-ui-carousel-table"}),s=e.ref({showAnimation:t.value.animation.use}),i=e.ref(null),V=e.ref(null),b=e.ref(null),y=e.ref(null),C=e.ref(0),B=e.ref(0),$=e.ref(!1),k=e.ref(null),c=e.ref(null),T=e.ref(0);function S(){k.value&&(c.value={elements:k.value.getElementsByTagName("tr"),heights:Array.from(k.value.getElementsByTagName("tr")).map(o=>o.getBoundingClientRect().height)})}e.onMounted(S);const K=e.computed(()=>!c.value||!c.value.heights.length?0:Math.max(...c.value.heights)+C.value+B.value),Q=e.computed(()=>l.dataset.body?t.value.tbody.tr.visible<=l.dataset.body.length?t.value.tbody.tr.visible:l.dataset.body.length:0),W=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)*Q.value+C.value+B.value),w=e.ref(0),x=e.ref(null),f=e.ref(0),m=e.ref(!1),L=e.ref(0);e.onMounted(()=>{b.value&&(C.value=b.value.getBoundingClientRect().height),y.value&&(B.value=y.value.getBoundingClientRect().height),s.value.showAnimation&&c.value&&M()}),e.onMounted(()=>{if(i.value){let a=function(){const r=o.getBoundingClientRect().bottom;n.forEach(d=>{d.getBoundingClientRect().top<r?d.style.visibility="hidden":d.style.visibility="visible"})};const o=i.value.querySelector("thead"),n=Array.from(k.value.querySelectorAll("tr"));i.value.addEventListener("scroll",a),a(),e.onBeforeUnmount(()=>{i.value.removeEventListener("scroll",a)})}});function Y(o){I.value=o,L.value+=1}function M(){!x.value&&!m.value&&(x.value=requestAnimationFrame(q))}function Z(){if(!i.value)return!1;const{scrollTop:o,scrollHeight:n,clientHeight:a}=i.value;return o+a>=n}function q(o){if(m.value)return;f.value||(f.value=o),o-f.value>=t.value.animation.speedMs&&(w.value+=c.value.heights[T.value],(Z()||T.value>=c.value.heights.length)&&(w.value=0,T.value=-1),T.value+=1,i.value&&i.value.scrollTo({top:w.value,behavior:"smooth"}),f.value=o),x.value=requestAnimationFrame(q)}function v(){m.value=!0,cancelAnimationFrame(x.value),x.value=null}e.onBeforeUnmount(v);function h(){!m.value||!s.value.showAnimation||(m.value=!1,f.value=0,M())}function ee(){t.value.animation.pauseOnHover&&v()}const E=e.ref(null);function te(){v(),clearTimeout(E.value)}function H(){clearTimeout(E.value),E.value=setTimeout(h,1e3)}e.watch(()=>t.value.animation.use,o=>{o?(s.value.showAnimation=!0,h()):(s.value.showAnimation=!1,v())});const oe=e.computed(()=>t.value.responsiveBreakpoint);e.onMounted(()=>{const o=new ResizeObserver(n=>{n.forEach(a=>{$.value=a.contentRect.width<oe.value}),C.value=b.value?b.value.getBoundingClientRect().height:0,B.value=y.value?y.value.getBoundingClientRect().height:0,T.value=0,e.nextTick(()=>{v(),f.value=0,w.value=0,S(),h()})});i.value&&o.observe(i.value)});function U(){J()}function D(){s.value.showAnimation=!s.value.showAnimation,s.value.showAnimation?h():v()}function G(){e.nextTick(()=>{const o=l.dataset.head.map((r,d)=>[[l.dataset.body[d]]]),n=[[t.value.caption.text],[l.dataset.head.map(r=>[r])]].concat(o),a=u.createCsvContent(n);u.downloadCsv({csvContent:a,title:t.value.caption.text||"vue-ui-carousel-table"})})}return X({pauseAnimation:v,resumeAnimation:h,toggleAnimation:D,generateCsv:G,generatePdf:U,generateImage:R}),(o,n)=>(e.openBlock(),e.createElementBlock("div",{style:{position:"relative",overflow:"visible"},ref_key:"chartContainer",ref:V},[e.createElementVNode("div",{ref_key:"tableContainer",ref:i,id:`carousel-table_${A.value}`,style:e.normalizeStyle({height:e.unref(N)||e.unref(O)?"auto":`${Math.max(W.value,K.value)}px`,containerType:"inline-size",position:"relative",overflow:"auto",fontFamily:t.value.fontFamily}),class:e.normalizeClass({"vue-ui-responsive":$.value,"is-playing":!m.value}),onMouseenter:n[0]||(n[0]=a=>ee()),onMouseleave:n[1]||(n[1]=a=>h()),onTouchstart:n[2]||(n[2]=a=>te()),onTouchend:n[3]||(n[3]=a=>H()),onTouchcancel:n[4]||(n[4]=a=>H())},[g.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:b,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:`${C.value}px`,zIndex:1})},[e.createElementVNode("tr",{ref_key:"tableRow",ref:y,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(p.dataset.head,(a,r)=>(e.openBlock(),e.createElementBlock("th",{role:"cell",key:`th_${r}`,style:e.normalizeStyle({...t.value.thead.tr.th.style,border:t.value.thead.tr.th.border.size?`${t.value.thead.tr.th.border.size}px solid ${t.value.thead.tr.th.border.color}`:"none",paddingTop:t.value.thead.tr.th.padding.top+"px",paddingRight:t.value.thead.tr.th.padding.right+"px",paddingBottom:t.value.thead.tr.th.padding.bottom+"px",paddingLeft:t.value.thead.tr.th.padding.left+"px"})},[e.createTextVNode(e.toDisplayString(o.$slots.th?"":a)+" ",1),e.renderSlot(o.$slots,"th",e.normalizeProps(e.guardReactiveProps({th:a,colIndex:r})),void 0,!0)],4))),128))],12,ie)],4),p.dataset.body&&p.dataset.head?(e.openBlock(),e.createElementBlock("tbody",{key:0,ref_key:"tbody",ref:k,style:e.normalizeStyle({clipPath:"inset(0,0,0,0)"})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p.dataset.body,(a,r)=>(e.openBlock(),e.createElementBlock("tr",{style:e.normalizeStyle({...t.value.tbody.tr.style,border:`${t.value.tbody.tr.border.size}px solid ${t.value.tbody.tr.border.color}`,verticalAlign:"middle"})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a,(d,z)=>(e.openBlock(),e.createElementBlock("td",{role:"cell","data-cell":p.dataset.head[z]||"",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:e.unref(u.setOpacity)(t.value.tbody.tr.td.style.backgroundColor,r%2===0&&t.value.tbody.tr.td.alternateColor?t.value.tbody.tr.td.alternateOpacity*100:100),paddingTop:t.value.tbody.tr.td.padding.top+"px",paddingRight:t.value.tbody.tr.td.padding.right+"px",paddingBottom:t.value.tbody.tr.td.padding.bottom+"px",paddingLeft:t.value.tbody.tr.td.padding.left+"px",verticalAlign:"middle"}),height:`${t.value.tbody.tr.height}px`},[e.createTextVNode(e.toDisplayString(o.$slots.td?"":d)+" ",1),e.renderSlot(o.$slots,"td",e.normalizeProps(e.guardReactiveProps({td:d,rowIndex:r,colIndex:z})),void 0,!0)],12,ue))),256))],4))),256))],4)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0)],46,re),g.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(ne.default,{key:0,config:{type:"table"}})),t.value.userOptions.show&&g.value?(e.openBlock(),e.createBlock(j.UserOptions,{ref:"details",key:`user_option_${L.value}`,backgroundColor:t.value.style.backgroundColor,color:t.value.style.color,isPrinting:e.unref(N),isImaging:e.unref(O),uid:A.value,hasTooltip:!1,hasPdf:t.value.userOptions.buttons.pdf,hasImg:t.value.userOptions.buttons.img,hasXls:t.value.userOptions.buttons.csv,hasTable:!1,hasLabel:!1,hasAnimation:t.value.userOptions.buttons.animation,isAnimation:!s.value.showAnimation,hasFullscreen:t.value.userOptions.buttons.fullscreen,isFullscreen:I.value,chartElement:V.value,titles:{...t.value.userOptions.buttonTitles},zIndex:3,noOffset:"",onGeneratePdf:U,onGenerateCsv:G,onGenerateImage:e.unref(R),onToggleAnimation:D,onToggleFullscreen:Y},e.createSlots({_:2},[o.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionPdf",{},void 0,!0)]),key:"0"}:void 0,o.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionCsv",{},void 0,!0)]),key:"1"}:void 0,o.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionImg",{},void 0,!0)]),key:"2"}:void 0,o.$slots.optionAnimation?{name:"optionAnimation",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionAnimation",{},void 0,!0)]),key:"3"}:void 0,o.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:a,isFullscreen:r})=>[e.renderSlot(o.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:a,isFullscreen:r})),void 0,!0)]),key:"4"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasPdf","hasImg","hasXls","hasAnimation","isAnimation","hasFullscreen","isFullscreen","chartElement","titles","onGenerateImage"])):e.createCommentVNode("",!0)],512))}},de=le._export_sfc(se,[["__scopeId","data-v-4dad7e0c"]]);exports.default=de;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ref as o, onMounted as F, computed as B, watch as V, onBeforeUnmount as re, nextTick as de, openBlock as u, createElementBlock as r, createElementVNode as E, normalizeStyle as d, unref as C, normalizeClass as Ae, createTextVNode as G, toDisplayString as M, renderSlot as p, Fragment as q, renderList as D, normalizeProps as X, guardReactiveProps as j, createCommentVNode as N, createBlock as ve, createSlots as xe, withCtx as O } from "vue";
|
|
2
|
-
import { u as ke, c as we, o as J, e as K, s as Ie, q as Fe, r as Be } from "./index-
|
|
3
|
-
import { u as Oe } from "./useNestedProp-
|
|
4
|
-
import { u as Pe, U as Re } from "./usePrinter-
|
|
5
|
-
import ze from "./vue-ui-skeleton-
|
|
2
|
+
import { u as ke, c as we, o as J, e as K, s as Ie, q as Fe, r as Be } from "./index-B6m-GhsP.js";
|
|
3
|
+
import { u as Oe } from "./useNestedProp-BrcBWysp.js";
|
|
4
|
+
import { u as Pe, U as Re } from "./usePrinter-BkKBQlCO.js";
|
|
5
|
+
import ze from "./vue-ui-skeleton-BOhyMEA5.js";
|
|
6
6
|
import { _ as Ee } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
7
7
|
const Ne = ["id"], Se = ["height"], He = ["data-cell", "height"], Le = {
|
|
8
8
|
__name: "vue-ui-carousel-table",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),o=require("./index-BofUHMEw.cjs"),H=require("./usePrinter-_JYb_33H.cjs"),de=require("./vue-ui-skeleton-Bx_kbjKr.cjs"),ye=require("./BaseIcon-DU-oJKBy.cjs"),ve=require("./vue-ui-accordion-XtygMpX7.cjs"),W=require("./useNestedProp-DGK0LGfN.cjs"),he=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),fe=["id"],pe=["xmlns","viewBox"],me={key:0},be=["fill","font-weight","font-size","x","y"],ge=["fill","font-weight","font-size","x","y"],ke=["id"],_e=["stop-color"],xe=["stop-color"],Be=["id"],Ee=["stop-color"],Ne=["stop-color"],Se=["id"],ze=["stop-color"],Ce=["stop-color"],we=["stop-color"],Ve=["id"],$e=["stop-color"],Te=["stop-color"],Fe=["stop-color"],Le=["id"],De=["stop-color"],Oe=["stop-color"],Ie=["stop-color"],Me={key:1},Pe=["x","y","font-size","font-weight","fill"],Re=["x","y","font-size","font-weight","fill"],Xe=["d","stroke"],je=["cx","cy","r","fill"],Ae=["cx","cy","r","fill","stroke","stroke-width","onClick"],Ge={key:2},Ue=["x","y","font-size","fill","onClick"],qe={key:0},Ye=["x","y","fill","font-size","font-weight"],He=["x","y","height","width","fill","rx","onClick"],We=["x","y","height","width","fill","rx","stroke","stroke-width","onClick"],Ke={key:3},Je=["x","y","fill","font-size","onClick"],Qe=["d","stroke"],Ze=["fill","cx","cy","r","onClick"],et={key:4},tt=["x","y","font-size","font-weight","fill"],lt=["x1","x2","y1","y2","stroke","stroke-width"],at=["y","height","width"],ot={style:{width:"100%",height:"100%",display:"flex","align-items":"center","justify-content":"center","flex-direction":"column"}},nt={style:{display:"flex","align-items":"center","justify-content":"center",gap:"12px","flex-wrap":"wrap","flex-direction":"row"}},rt={viewBox:"0 0 20 20",height:"16",width:"16"},st=["fill"],ut={key:6},ct=["y","height","width"],it={style:{width:"100%",height:"100%",display:"flex","align-items":"center","justify-content":"center","flex-direction":"column"}},dt={style:{display:"flex","align-items":"center","justify-content":"center",gap:"12px","flex-wrap":"wrap","flex-direction":"row"}},yt={viewBox:"0 0 20 20",height:"16",width:"16"},vt=["fill"],ht=["cx","cy","fill"],ft=["d","stroke"],pt=["cx","cy","fill"],mt=["d","stroke"],bt=["cx","cy","fill"],gt=["cx","cy","fill"],kt=["x","y","fill","font-size","font-weight"],_t=["x","y","fill","font-size","font-weight"],xt=["x","text-anchor","y","fill","font-size"],Bt=["x","text-anchor","y","fill","font-size"],Et=["x","text-anchor","y","fill","font-size"],Nt=["x","text-anchor","y","fill","font-size"],St=["x","text-anchor","y","fill","font-size"],zt=["x","y","font-size","fill"],Ct=["x","y","font-size","fill"],wt=["x","y","font-size","fill"],Vt={key:2,class:"vue-data-ui-watermark"},$t={style:{"padding-top":"36px",position:"relative"}},Tt={class:"vue-ui-data-table"},Ft={key:0},Lt=["data-cell"],Dt={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},Ot={key:0},It={key:1},Mt=["data-cell"],Pt={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},Rt={key:0},Xt={key:1},jt=["data-cell"],At={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},Gt={key:0},Ut={key:1},qt=["data-cell"],Yt={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},Ht={key:0},Wt={key:1},Kt=["data-cell"],Jt={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},Qt={key:0},Zt={key:1},el=["data-cell"],tl={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},ll={key:0},al={key:1},ol=["data-cell"],nl={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},rl={key:0},sl={key:1},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"],fl={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},pl=["data-cell"],ml={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},bl={__name:"vue-ui-chestnut",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectRoot","selectBranch","selectNut"],setup(K,{expose:J,emit:S}){const k=K;e.useCssVars(a=>({"1f0e4d4b":a.tdo}));const{vue_ui_chestnut:Q}=o.useConfig(),C=e.computed(()=>!!k.dataset&&k.dataset.length),h=e.ref(o.createUid()),D=e.ref(null),Z=e.ref(null),O=e.ref(0),t=e.computed({get:()=>I(),set:a=>a});function I(){const a=W.useNestedProp({userConfig:k.config,defaultConfig:Q});return a.theme?{...W.useNestedProp({userConfig:o.themes.vue_ui_chestnut[a.theme]||k.config,defaultConfig:a}),customPalette:o.themePalettes[a.theme]||o.palette}:a}e.watch(()=>k.config,a=>{t.value=I(),U()},{deep:!0});const{isPrinting:M,isImaging:P,generatePdf:R,generateImage:X}=H.usePrinter({elementId:`vue-ui-chestnut_${h.value}`,fileName:t.value.style.chart.layout.title.text||"vue-ui-chestnut"}),$=e.computed(()=>o.convertCustomPalette(t.value.customPalette)),w=e.ref({showTable:t.value.table.show}),T=e.ref(null),j=e.ref(!1),ee=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}),p=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})),_=e.computed(()=>C.value?k.dataset.flatMap(a=>(a.branches||[]).map(s=>s.value||0)).reduce((a,s)=>a+s,0):0),m=e.computed(()=>(k.dataset.forEach((a,s)=>{o.getMissingDatasetAttributes({datasetObject:a,requiredAttributes:["name","branches"]}).forEach(l=>{o.error({componentName:"VueUiChestnut",type:"datasetSerieAttribute",property:l,index:s})}),a.branches&&a.branches.forEach((l,n)=>{o.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","value"]}).forEach(d=>{o.error({componentName:"VueUiChestnut",type:"datasetSerieAttribute",property:d,index:`${s} - ${n}`})}),l.breakdown&&l.breakdown.forEach((d,i)=>{o.getMissingDatasetAttributes({datasetObject:d,requiredAttributes:["name","value"]}).forEach(y=>{o.error({componentName:"VueUiChestnut",type:"datasetSerieAttribute",property:y,index:`${s} - ${n} - ${i}`})})})})}),k.dataset.map((a,s)=>{const l=(a.branches||[]).map(n=>n.value||0).reduce((n,d)=>n+d,0);return{...a,color:o.convertColorToHex(a.color)||$.value[s]||o.palette[s]||o.palette[s%o.palette.length],id:a.id||`root_${s}_${h.value}`,type:"root",total:l,rootIndex:s,branches:(a.branches||[]).map((n,d)=>({...n,rootName:a.name,rootIndex:s,color:o.convertColorToHex(a.color)||$.value[s]||o.palette[s]||o.palette[s%o.palette.length],value:n.value>=0?n.value:0,id:n.id||`branch_${s}_${d}_${h.value}`,proportionToRoot:n.value/l,type:"branch",breakdown:(n.breakdown||[]).map((i,y)=>({table:{rootName:a.name,rootValue:l,rootToTotal:l/_.value,branchName:n.name,branchValue:n.value,branchToTotal:n.value/_.value,branchToRoot:n.value/l,nutName:i.name,nutValue:i.value,nutToTotal:i.value/_.value,nutToRoot:i.value/l,nutToBranch:i.value/n.value},...i,type:"nut",branchName:n.name,rootName:a.name,branchTotal:n.value>=0?n.value:0,proportionToBranch:i.value/n.value,proportionToRoot:i.value/l,proportionToTree:i.value/_.value,rootIndex:s,id:i.id||`nut_${s}_${d}_${y}_${h.value}`,color:o.convertColorToHex(i.color)||$.value[y]||o.palette[y]||o.palette[y%o.palette.length],value:i.value>=0?i.value:0}))}))}})));function te(){return m.value}const le=e.computed(()=>m.value.flatMap(a=>a.branches).length),ae=e.computed(()=>Math.max(...m.value.map(a=>a.branches.map(s=>s.value).reduce((s,l)=>s+l,0)))),oe=e.computed(()=>Math.max(...m.value.flatMap(a=>a.branches.map(s=>s.value)))),A=e.computed(()=>256+r.value.padding.left),B=e.computed(()=>m.value.sort((a,s)=>s.total-a.total).map((a,s)=>{const l=p.value.height/m.value.length/2,n=a.total/ae.value*(l>64?64:l);return{...a,x:p.value.seedX,y:p.value.top+p.value.height/m.value.length*(s+1)-(p.value.height/m.value.length/2+r.value.gap/2),r:n<r.value.branchSize/2?r.value.branchSize/2:n}})),ne=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),re=e.computed(()=>B.value.flatMap(a=>a.branches)),E=e.computed(()=>re.value.sort((a,s)=>s.value-a.value).map((a,s)=>({...a,y1:s*r.value.branchSize+p.value.top+s*r.value.gap,y2:s*r.value.branchSize+r.value.branchSize,x1:A.value,x2:384*a.value/oe.value*ne.value+A.value})));function F(a){const s=B.value.find(l=>l.rootIndex===a.rootIndex);return{x:s.x,y:s.y,r:s.r}}const u=e.ref(null),x=e.ref(null),v=e.ref(null),b=e.ref(null);function f(){u.value=null,v.value=null,b.value=null}function g(a){return b.value?b.value===null?!0:a.type==="root"?a.id===b.value.id:a.rootIndex===b.value.rootIndex:u.value===null&&v.value===null?!0:a.type==="nut"?u.value.id===a.id:a.type==="branch"?v.value.id===a.id:a.type==="root"?v.value&&v.value.rootIndex===a.rootIndex||u.value&&u.value.rootIndex===a.rootIndex:!1}function se(a){f(),e.nextTick(()=>{u.value=a,v.value=a,x.value=o.makeDonut({series:a.breakdown,base:1},a.x2+24+t.value.style.chart.layout.nuts.offsetX,a.y1+r.value.branchSize/2,80,80),S("selectNut",a.breakdown)})}function N(){u.value=null,x.value=null,S("selectNut",null)}function L(a){v.value&&v.value.id===a.id?(v.value=null,f(),S("selectBranch",null)):(f(),v.value=a,S("selectBranch",a))}function G(a){b.value&&b.value.id===a.id?(f(),S("selectRoot",null)):(f(),b.value=a,S("selectRoot",a))}function ue(){return p.value.bottom-(u.value.y1+180)<0?0:p.value.bottom}function z(a){return a.proportion*100>t.value.style.chart.layout.nuts.selected.labels.dataLabels.hideUnderValue}function ce(){const a=new ResizeObserver(s=>{s.forEach(l=>{j.value=l.contentRect.width<ee.value})});T.value&&a.observe(T.value)}e.onMounted(()=>{U()});function U(){o.objectIsEmpty(k.dataset)&&o.error({componentName:"VueUiChestnut",type:"dataset"});const a=le.value*(r.value.branchSize+r.value.gap)+r.value.padding.top+r.value.padding.bottom;r.value.height=a,ce()}const c=e.computed(()=>{const a=[t.value.table.th.translations.rootName,t.value.table.th.translations.rootValue,t.value.table.th.translations.rootToTotal,t.value.table.th.translations.branchName,t.value.table.th.translations.branchValue,t.value.table.th.translations.branchToRoot,t.value.table.th.translations.branchToTotal,t.value.table.th.translations.nutName,t.value.table.th.translations.nutValue,t.value.table.th.translations.nutToBranch,t.value.table.th.translations.nutToRoot,t.value.table.th.translations.nutToTotal],s=m.value.flatMap((l,n)=>l.branches.flatMap((d,i)=>d.breakdown.flatMap((y,kl)=>y.table)));return{head:a,body:s}});function q(){e.nextTick(()=>{const a=[[t.value.style.chart.layout.title.text],[t.value.style.chart.layout.title.subtitle.text],[""],["Grand total",_.value],[""]],s=c.value.head,l=c.value.body.map((i,y)=>[c.value.body[y-1]&&c.value.body[y-1].rootName===i.rootName?"":i.rootName,c.value.body[y-1]&&c.value.body[y-1].rootName===i.rootName?"":i.rootValue,c.value.body[y-1]&&c.value.body[y-1].rootName===i.rootName?"":i.rootToTotal,c.value.body[y-1]&&c.value.body[y-1].branchName===i.branchName?"":i.branchName,c.value.body[y-1]&&c.value.body[y-1].branchName===i.branchName?"":i.branchValue,c.value.body[y-1]&&c.value.body[y-1].branchName===i.branchName?"":i.branchToRoot,c.value.body[y-1]&&c.value.body[y-1].branchName===i.branchName?"":i.branchToTotal,i.nutName,i.nutValue,i.nutToBranch,i.nutToRoot,i.nutToTotal]),n=a.concat([s]).concat(l),d=o.createCsvContent(n);o.downloadCsv({csvContent:d,title:t.value.style.chart.layout.title.text||"vue-ui-chestnut"})})}const V=e.ref(!1);function ie(a){V.value=a,O.value+=1}function Y(){w.value.showTable=!w.value.showTable}return J({getData:te,generatePdf:R,generateCsv:q,generateImage:X,toggleTable:Y}),(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(H.UserOptions,{ref_key:"details",ref:Z,key:`user_options_${O.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isImaging:e.unref(P),isPrinting:e.unref(M),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:ie,onGeneratePdf:e.unref(R),onGenerateCsv:q,onGenerateImage:e.unref(X),onToggleTable:Y},e.createSlots({_:2},[a.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionPdf",{},void 0,!0)]),key:"0"}:void 0,a.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionCsv",{},void 0,!0)]),key:"1"}:void 0,a.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionImg",{},void 0,!0)]),key:"2"}:void 0,a.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionTable",{},void 0,!0)]),key:"3"}:void 0,a.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:l,isFullscreen:n})=>[e.renderSlot(a.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:l,isFullscreen:n})),void 0,!0)]),key:"4"}:void 0]),1032,["backgroundColor","color","isImaging","isPrinting","uid","hasPdf","hasImg","hasXls","hasTable","hasFullscreen","isFullscreen","titles","chartElement","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),r.value.height>0&&C.value?(e.openBlock(),e.createElementBlock("svg",{key:1,xmlns:e.unref(o.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":V.value,"vue-data-ui-fulscreen--off":!V.value}),viewBox:`0 0 ${r.value.width} ${r.value.height}`,style:e.normalizeStyle(`max-width:100%;overflow:visible;background:${t.value.style.chart.backgroundColor};color:${t.value.style.chart.color}`)},[u.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("g",me,[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:f},e.toDisplayString(t.value.style.chart.layout.title.text),9,be)):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:f},e.toDisplayString(t.value.style.chart.layout.title.subtitle.text),9,ge)):e.createCommentVNode("",!0)])),e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,(l,n)=>(e.openBlock(),e.createElementBlock("radialGradient",{cx:"50%",cy:"50%",r:"50%",fx:"50%",fy:"50%",id:`root_gradient_${h.value}_${l.rootIndex}`},[e.createElementVNode("stop",{offset:"0%","stop-color":e.unref(o.setOpacity)(e.unref(o.shiftHue)(l.color,.05),100-t.value.style.chart.layout.roots.gradientIntensity)},null,8,_e),e.createElementVNode("stop",{offset:"100%","stop-color":l.color},null,8,xe)],8,ke))),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,Ee),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(o.setOpacity)(e.unref(o.shiftHue)(l.color,.02),100-t.value.style.chart.layout.branches.gradientIntensity)},null,8,Ne)],8,Be))),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":e.unref(o.setOpacity)("#FFFFFF",0)},null,8,ze),e.createElementVNode("stop",{offset:"80%","stop-color":e.unref(o.setOpacity)("#FFFFFF",t.value.style.chart.layout.nuts.selected.gradientIntensity)},null,8,Ce),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(o.setOpacity)("#FFFFFF",0)},null,8,we)],8,Se),e.createElementVNode("radialGradient",{cx:"50%",cy:"50%",r:"50%",fx:"50%",fy:"50%",id:`nut_${h.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":e.unref(o.setOpacity)("#FFFFFF",0)},null,8,$e),e.createElementVNode("stop",{offset:"80%","stop-color":e.unref(o.setOpacity)("#FFFFFF",t.value.style.chart.layout.nuts.gradientIntensity)},null,8,Te),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(o.setOpacity)("#FFFFFF",0)},null,8,Fe)],8,Ve),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":e.unref(o.setOpacity)(t.value.style.chart.backgroundColor,100)},null,8,De),e.createElementVNode("stop",{offset:"80%","stop-color":e.unref(o.setOpacity)(t.value.style.chart.backgroundColor,60)},null,8,Oe),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(o.setOpacity)(t.value.style.chart.backgroundColor,0)},null,8,Ie)],8,Le)]),t.value.style.chart.layout.grandTotal.show?(e.openBlock(),e.createElementBlock("g",Me,[e.createElementVNode("text",{x:p.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:f},e.toDisplayString(t.value.style.chart.layout.grandTotal.text),9,Pe),e.createElementVNode("text",{x:p.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:f},e.toDisplayString(e.unref(o.applyDataLabel)(t.value.style.chart.layout.grandTotal.formatter,_.value,e.unref(o.dataLabel)({p:t.value.style.chart.layout.grandTotal.prefix,v:_.value,s:t.value.style.chart.layout.grandTotal.suffix,r:t.value.style.chart.layout.grandTotal.roundingValue}))),9,Re)])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(E.value,l=>(e.openBlock(),e.createElementBlock("g",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value.branchSize,(n,d)=>(e.openBlock(),e.createElementBlock("path",{d:`M
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),o=require("./index-CeMgFh6-.cjs"),H=require("./usePrinter-_rbdfvVi.cjs"),de=require("./vue-ui-skeleton-dfikkXQa.cjs"),ye=require("./BaseIcon-DS9Fpauh.cjs"),ve=require("./vue-ui-accordion-CH_rY04P.cjs"),W=require("./useNestedProp-CD3RA8XO.cjs"),he=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),fe=["id"],pe=["xmlns","viewBox"],me={key:0},be=["fill","font-weight","font-size","x","y"],ge=["fill","font-weight","font-size","x","y"],ke=["id"],_e=["stop-color"],xe=["stop-color"],Be=["id"],Ee=["stop-color"],Ne=["stop-color"],Se=["id"],ze=["stop-color"],Ce=["stop-color"],we=["stop-color"],Ve=["id"],$e=["stop-color"],Te=["stop-color"],Fe=["stop-color"],Le=["id"],De=["stop-color"],Oe=["stop-color"],Ie=["stop-color"],Me={key:1},Pe=["x","y","font-size","font-weight","fill"],Re=["x","y","font-size","font-weight","fill"],Xe=["d","stroke"],je=["cx","cy","r","fill"],Ae=["cx","cy","r","fill","stroke","stroke-width","onClick"],Ge={key:2},Ue=["x","y","font-size","fill","onClick"],qe={key:0},Ye=["x","y","fill","font-size","font-weight"],He=["x","y","height","width","fill","rx","onClick"],We=["x","y","height","width","fill","rx","stroke","stroke-width","onClick"],Ke={key:3},Je=["x","y","fill","font-size","onClick"],Qe=["d","stroke"],Ze=["fill","cx","cy","r","onClick"],et={key:4},tt=["x","y","font-size","font-weight","fill"],lt=["x1","x2","y1","y2","stroke","stroke-width"],at=["y","height","width"],ot={style:{width:"100%",height:"100%",display:"flex","align-items":"center","justify-content":"center","flex-direction":"column"}},nt={style:{display:"flex","align-items":"center","justify-content":"center",gap:"12px","flex-wrap":"wrap","flex-direction":"row"}},rt={viewBox:"0 0 20 20",height:"16",width:"16"},st=["fill"],ut={key:6},ct=["y","height","width"],it={style:{width:"100%",height:"100%",display:"flex","align-items":"center","justify-content":"center","flex-direction":"column"}},dt={style:{display:"flex","align-items":"center","justify-content":"center",gap:"12px","flex-wrap":"wrap","flex-direction":"row"}},yt={viewBox:"0 0 20 20",height:"16",width:"16"},vt=["fill"],ht=["cx","cy","fill"],ft=["d","stroke"],pt=["cx","cy","fill"],mt=["d","stroke"],bt=["cx","cy","fill"],gt=["cx","cy","fill"],kt=["x","y","fill","font-size","font-weight"],_t=["x","y","fill","font-size","font-weight"],xt=["x","text-anchor","y","fill","font-size"],Bt=["x","text-anchor","y","fill","font-size"],Et=["x","text-anchor","y","fill","font-size"],Nt=["x","text-anchor","y","fill","font-size"],St=["x","text-anchor","y","fill","font-size"],zt=["x","y","font-size","fill"],Ct=["x","y","font-size","fill"],wt=["x","y","font-size","fill"],Vt={key:2,class:"vue-data-ui-watermark"},$t={style:{"padding-top":"36px",position:"relative"}},Tt={class:"vue-ui-data-table"},Ft={key:0},Lt=["data-cell"],Dt={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},Ot={key:0},It={key:1},Mt=["data-cell"],Pt={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},Rt={key:0},Xt={key:1},jt=["data-cell"],At={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},Gt={key:0},Ut={key:1},qt=["data-cell"],Yt={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},Ht={key:0},Wt={key:1},Kt=["data-cell"],Jt={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},Qt={key:0},Zt={key:1},el=["data-cell"],tl={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},ll={key:0},al={key:1},ol=["data-cell"],nl={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},rl={key:0},sl={key:1},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"],fl={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},pl=["data-cell"],ml={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},bl={__name:"vue-ui-chestnut",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectRoot","selectBranch","selectNut"],setup(K,{expose:J,emit:S}){const k=K;e.useCssVars(a=>({"1f0e4d4b":a.tdo}));const{vue_ui_chestnut:Q}=o.useConfig(),C=e.computed(()=>!!k.dataset&&k.dataset.length),h=e.ref(o.createUid()),D=e.ref(null),Z=e.ref(null),O=e.ref(0),t=e.computed({get:()=>I(),set:a=>a});function I(){const a=W.useNestedProp({userConfig:k.config,defaultConfig:Q});return a.theme?{...W.useNestedProp({userConfig:o.themes.vue_ui_chestnut[a.theme]||k.config,defaultConfig:a}),customPalette:o.themePalettes[a.theme]||o.palette}:a}e.watch(()=>k.config,a=>{t.value=I(),U()},{deep:!0});const{isPrinting:M,isImaging:P,generatePdf:R,generateImage:X}=H.usePrinter({elementId:`vue-ui-chestnut_${h.value}`,fileName:t.value.style.chart.layout.title.text||"vue-ui-chestnut"}),$=e.computed(()=>o.convertCustomPalette(t.value.customPalette)),w=e.ref({showTable:t.value.table.show}),T=e.ref(null),j=e.ref(!1),ee=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}),p=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})),_=e.computed(()=>C.value?k.dataset.flatMap(a=>(a.branches||[]).map(s=>s.value||0)).reduce((a,s)=>a+s,0):0),m=e.computed(()=>(k.dataset.forEach((a,s)=>{o.getMissingDatasetAttributes({datasetObject:a,requiredAttributes:["name","branches"]}).forEach(l=>{o.error({componentName:"VueUiChestnut",type:"datasetSerieAttribute",property:l,index:s})}),a.branches&&a.branches.forEach((l,n)=>{o.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","value"]}).forEach(d=>{o.error({componentName:"VueUiChestnut",type:"datasetSerieAttribute",property:d,index:`${s} - ${n}`})}),l.breakdown&&l.breakdown.forEach((d,i)=>{o.getMissingDatasetAttributes({datasetObject:d,requiredAttributes:["name","value"]}).forEach(y=>{o.error({componentName:"VueUiChestnut",type:"datasetSerieAttribute",property:y,index:`${s} - ${n} - ${i}`})})})})}),k.dataset.map((a,s)=>{const l=(a.branches||[]).map(n=>n.value||0).reduce((n,d)=>n+d,0);return{...a,color:o.convertColorToHex(a.color)||$.value[s]||o.palette[s]||o.palette[s%o.palette.length],id:a.id||`root_${s}_${h.value}`,type:"root",total:l,rootIndex:s,branches:(a.branches||[]).map((n,d)=>({...n,rootName:a.name,rootIndex:s,color:o.convertColorToHex(a.color)||$.value[s]||o.palette[s]||o.palette[s%o.palette.length],value:n.value>=0?n.value:0,id:n.id||`branch_${s}_${d}_${h.value}`,proportionToRoot:n.value/l,type:"branch",breakdown:(n.breakdown||[]).map((i,y)=>({table:{rootName:a.name,rootValue:l,rootToTotal:l/_.value,branchName:n.name,branchValue:n.value,branchToTotal:n.value/_.value,branchToRoot:n.value/l,nutName:i.name,nutValue:i.value,nutToTotal:i.value/_.value,nutToRoot:i.value/l,nutToBranch:i.value/n.value},...i,type:"nut",branchName:n.name,rootName:a.name,branchTotal:n.value>=0?n.value:0,proportionToBranch:i.value/n.value,proportionToRoot:i.value/l,proportionToTree:i.value/_.value,rootIndex:s,id:i.id||`nut_${s}_${d}_${y}_${h.value}`,color:o.convertColorToHex(i.color)||$.value[y]||o.palette[y]||o.palette[y%o.palette.length],value:i.value>=0?i.value:0}))}))}})));function te(){return m.value}const le=e.computed(()=>m.value.flatMap(a=>a.branches).length),ae=e.computed(()=>Math.max(...m.value.map(a=>a.branches.map(s=>s.value).reduce((s,l)=>s+l,0)))),oe=e.computed(()=>Math.max(...m.value.flatMap(a=>a.branches.map(s=>s.value)))),A=e.computed(()=>256+r.value.padding.left),B=e.computed(()=>m.value.sort((a,s)=>s.total-a.total).map((a,s)=>{const l=p.value.height/m.value.length/2,n=a.total/ae.value*(l>64?64:l);return{...a,x:p.value.seedX,y:p.value.top+p.value.height/m.value.length*(s+1)-(p.value.height/m.value.length/2+r.value.gap/2),r:n<r.value.branchSize/2?r.value.branchSize/2:n}})),ne=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),re=e.computed(()=>B.value.flatMap(a=>a.branches)),E=e.computed(()=>re.value.sort((a,s)=>s.value-a.value).map((a,s)=>({...a,y1:s*r.value.branchSize+p.value.top+s*r.value.gap,y2:s*r.value.branchSize+r.value.branchSize,x1:A.value,x2:384*a.value/oe.value*ne.value+A.value})));function F(a){const s=B.value.find(l=>l.rootIndex===a.rootIndex);return{x:s.x,y:s.y,r:s.r}}const u=e.ref(null),x=e.ref(null),v=e.ref(null),b=e.ref(null);function f(){u.value=null,v.value=null,b.value=null}function g(a){return b.value?b.value===null?!0:a.type==="root"?a.id===b.value.id:a.rootIndex===b.value.rootIndex:u.value===null&&v.value===null?!0:a.type==="nut"?u.value.id===a.id:a.type==="branch"?v.value.id===a.id:a.type==="root"?v.value&&v.value.rootIndex===a.rootIndex||u.value&&u.value.rootIndex===a.rootIndex:!1}function se(a){f(),e.nextTick(()=>{u.value=a,v.value=a,x.value=o.makeDonut({series:a.breakdown,base:1},a.x2+24+t.value.style.chart.layout.nuts.offsetX,a.y1+r.value.branchSize/2,80,80),S("selectNut",a.breakdown)})}function N(){u.value=null,x.value=null,S("selectNut",null)}function L(a){v.value&&v.value.id===a.id?(v.value=null,f(),S("selectBranch",null)):(f(),v.value=a,S("selectBranch",a))}function G(a){b.value&&b.value.id===a.id?(f(),S("selectRoot",null)):(f(),b.value=a,S("selectRoot",a))}function ue(){return p.value.bottom-(u.value.y1+180)<0?0:p.value.bottom}function z(a){return a.proportion*100>t.value.style.chart.layout.nuts.selected.labels.dataLabels.hideUnderValue}function ce(){const a=new ResizeObserver(s=>{s.forEach(l=>{j.value=l.contentRect.width<ee.value})});T.value&&a.observe(T.value)}e.onMounted(()=>{U()});function U(){o.objectIsEmpty(k.dataset)&&o.error({componentName:"VueUiChestnut",type:"dataset"});const a=le.value*(r.value.branchSize+r.value.gap)+r.value.padding.top+r.value.padding.bottom;r.value.height=a,ce()}const c=e.computed(()=>{const a=[t.value.table.th.translations.rootName,t.value.table.th.translations.rootValue,t.value.table.th.translations.rootToTotal,t.value.table.th.translations.branchName,t.value.table.th.translations.branchValue,t.value.table.th.translations.branchToRoot,t.value.table.th.translations.branchToTotal,t.value.table.th.translations.nutName,t.value.table.th.translations.nutValue,t.value.table.th.translations.nutToBranch,t.value.table.th.translations.nutToRoot,t.value.table.th.translations.nutToTotal],s=m.value.flatMap((l,n)=>l.branches.flatMap((d,i)=>d.breakdown.flatMap((y,kl)=>y.table)));return{head:a,body:s}});function q(){e.nextTick(()=>{const a=[[t.value.style.chart.layout.title.text],[t.value.style.chart.layout.title.subtitle.text],[""],["Grand total",_.value],[""]],s=c.value.head,l=c.value.body.map((i,y)=>[c.value.body[y-1]&&c.value.body[y-1].rootName===i.rootName?"":i.rootName,c.value.body[y-1]&&c.value.body[y-1].rootName===i.rootName?"":i.rootValue,c.value.body[y-1]&&c.value.body[y-1].rootName===i.rootName?"":i.rootToTotal,c.value.body[y-1]&&c.value.body[y-1].branchName===i.branchName?"":i.branchName,c.value.body[y-1]&&c.value.body[y-1].branchName===i.branchName?"":i.branchValue,c.value.body[y-1]&&c.value.body[y-1].branchName===i.branchName?"":i.branchToRoot,c.value.body[y-1]&&c.value.body[y-1].branchName===i.branchName?"":i.branchToTotal,i.nutName,i.nutValue,i.nutToBranch,i.nutToRoot,i.nutToTotal]),n=a.concat([s]).concat(l),d=o.createCsvContent(n);o.downloadCsv({csvContent:d,title:t.value.style.chart.layout.title.text||"vue-ui-chestnut"})})}const V=e.ref(!1);function ie(a){V.value=a,O.value+=1}function Y(){w.value.showTable=!w.value.showTable}return J({getData:te,generatePdf:R,generateCsv:q,generateImage:X,toggleTable:Y}),(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(H.UserOptions,{ref_key:"details",ref:Z,key:`user_options_${O.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isImaging:e.unref(P),isPrinting:e.unref(M),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:ie,onGeneratePdf:e.unref(R),onGenerateCsv:q,onGenerateImage:e.unref(X),onToggleTable:Y},e.createSlots({_:2},[a.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionPdf",{},void 0,!0)]),key:"0"}:void 0,a.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionCsv",{},void 0,!0)]),key:"1"}:void 0,a.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionImg",{},void 0,!0)]),key:"2"}:void 0,a.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionTable",{},void 0,!0)]),key:"3"}:void 0,a.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:l,isFullscreen:n})=>[e.renderSlot(a.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:l,isFullscreen:n})),void 0,!0)]),key:"4"}:void 0]),1032,["backgroundColor","color","isImaging","isPrinting","uid","hasPdf","hasImg","hasXls","hasTable","hasFullscreen","isFullscreen","titles","chartElement","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),r.value.height>0&&C.value?(e.openBlock(),e.createElementBlock("svg",{key:1,xmlns:e.unref(o.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":V.value,"vue-data-ui-fulscreen--off":!V.value}),viewBox:`0 0 ${r.value.width} ${r.value.height}`,style:e.normalizeStyle(`max-width:100%;overflow:visible;background:${t.value.style.chart.backgroundColor};color:${t.value.style.chart.color}`)},[u.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("g",me,[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:f},e.toDisplayString(t.value.style.chart.layout.title.text),9,be)):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:f},e.toDisplayString(t.value.style.chart.layout.title.subtitle.text),9,ge)):e.createCommentVNode("",!0)])),e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,(l,n)=>(e.openBlock(),e.createElementBlock("radialGradient",{cx:"50%",cy:"50%",r:"50%",fx:"50%",fy:"50%",id:`root_gradient_${h.value}_${l.rootIndex}`},[e.createElementVNode("stop",{offset:"0%","stop-color":e.unref(o.setOpacity)(e.unref(o.shiftHue)(l.color,.05),100-t.value.style.chart.layout.roots.gradientIntensity)},null,8,_e),e.createElementVNode("stop",{offset:"100%","stop-color":l.color},null,8,xe)],8,ke))),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,Ee),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(o.setOpacity)(e.unref(o.shiftHue)(l.color,.02),100-t.value.style.chart.layout.branches.gradientIntensity)},null,8,Ne)],8,Be))),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":e.unref(o.setOpacity)("#FFFFFF",0)},null,8,ze),e.createElementVNode("stop",{offset:"80%","stop-color":e.unref(o.setOpacity)("#FFFFFF",t.value.style.chart.layout.nuts.selected.gradientIntensity)},null,8,Ce),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(o.setOpacity)("#FFFFFF",0)},null,8,we)],8,Se),e.createElementVNode("radialGradient",{cx:"50%",cy:"50%",r:"50%",fx:"50%",fy:"50%",id:`nut_${h.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":e.unref(o.setOpacity)("#FFFFFF",0)},null,8,$e),e.createElementVNode("stop",{offset:"80%","stop-color":e.unref(o.setOpacity)("#FFFFFF",t.value.style.chart.layout.nuts.gradientIntensity)},null,8,Te),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(o.setOpacity)("#FFFFFF",0)},null,8,Fe)],8,Ve),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":e.unref(o.setOpacity)(t.value.style.chart.backgroundColor,100)},null,8,De),e.createElementVNode("stop",{offset:"80%","stop-color":e.unref(o.setOpacity)(t.value.style.chart.backgroundColor,60)},null,8,Oe),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(o.setOpacity)(t.value.style.chart.backgroundColor,0)},null,8,Ie)],8,Le)]),t.value.style.chart.layout.grandTotal.show?(e.openBlock(),e.createElementBlock("g",Me,[e.createElementVNode("text",{x:p.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:f},e.toDisplayString(t.value.style.chart.layout.grandTotal.text),9,Pe),e.createElementVNode("text",{x:p.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:f},e.toDisplayString(e.unref(o.applyDataLabel)(t.value.style.chart.layout.grandTotal.formatter,_.value,e.unref(o.dataLabel)({p:t.value.style.chart.layout.grandTotal.prefix,v:_.value,s:t.value.style.chart.layout.grandTotal.suffix,r:t.value.style.chart.layout.grandTotal.roundingValue}))),9,Re)])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(E.value,l=>(e.openBlock(),e.createElementBlock("g",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value.branchSize,(n,d)=>(e.openBlock(),e.createElementBlock("path",{d:`M
|
|
2
2
|
${l.x1},${l.y1+d}
|
|
3
3
|
C${l.x1-20},${l.y1+d}
|
|
4
4
|
${l.x1-80},${l.y1+d}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { useCssVars as Oe, computed as $, ref as z, watch as Xe, onMounted as Ge, openBlock as a, createElementBlock as o, normalizeClass as m, normalizeStyle as h, createBlock as te, unref as n, createSlots as Ee, withCtx as U, renderSlot as M, normalizeProps as pe, guardReactiveProps as ge, createCommentVNode as f, toDisplayString as c, createElementVNode as s, Fragment as g, renderList as _, createTextVNode as W, withKeys as Ae, createVNode as Ue, nextTick as _e } from "vue";
|
|
2
|
-
import { u as De, c as Ye, t as qe, a as He, p as I, b as We, g as le, e as K, d as ae, o as Ke, X as Je, s as S, w as xe, i as G, f as T, F as me, m as ke, j as Qe, k as P, n as H, q as Ze, r as et } from "./index-
|
|
3
|
-
import { u as tt, U as lt } from "./usePrinter-
|
|
4
|
-
import at from "./vue-ui-skeleton-
|
|
5
|
-
import ot from "./BaseIcon-
|
|
6
|
-
import st from "./vue-ui-accordion-
|
|
7
|
-
import { u as we } from "./useNestedProp-
|
|
2
|
+
import { u as De, c as Ye, t as qe, a as He, p as I, b as We, g as le, e as K, d as ae, o as Ke, X as Je, s as S, w as xe, i as G, f as T, F as me, m as ke, j as Qe, k as P, n as H, q as Ze, r as et } from "./index-B6m-GhsP.js";
|
|
3
|
+
import { u as tt, U as lt } from "./usePrinter-BkKBQlCO.js";
|
|
4
|
+
import at from "./vue-ui-skeleton-BOhyMEA5.js";
|
|
5
|
+
import ot from "./BaseIcon-CVe5ECp8.js";
|
|
6
|
+
import st from "./vue-ui-accordion-BygOGjRr.js";
|
|
7
|
+
import { u as we } from "./useNestedProp-BrcBWysp.js";
|
|
8
8
|
import { _ as ut } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
9
9
|
const nt = ["id"], rt = ["xmlns", "viewBox"], it = { key: 0 }, ct = ["fill", "font-weight", "font-size", "x", "y"], dt = ["fill", "font-weight", "font-size", "x", "y"], vt = ["id"], yt = ["stop-color"], ht = ["stop-color"], ft = ["id"], bt = ["stop-color"], pt = ["stop-color"], gt = ["id"], _t = ["stop-color"], xt = ["stop-color"], mt = ["stop-color"], kt = ["id"], wt = ["stop-color"], $t = ["stop-color"], Ct = ["stop-color"], zt = ["id"], Tt = ["stop-color"], Nt = ["stop-color"], St = ["stop-color"], Ft = { key: 1 }, Lt = ["x", "y", "font-size", "font-weight", "fill"], It = ["x", "y", "font-size", "font-weight", "fill"], Pt = ["d", "stroke"], Vt = ["cx", "cy", "r", "fill"], Rt = ["cx", "cy", "r", "fill", "stroke", "stroke-width", "onClick"], Bt = { key: 2 }, Mt = ["x", "y", "font-size", "fill", "onClick"], jt = { key: 0 }, Ot = ["x", "y", "fill", "font-size", "font-weight"], Xt = ["x", "y", "height", "width", "fill", "rx", "onClick"], Gt = ["x", "y", "height", "width", "fill", "rx", "stroke", "stroke-width", "onClick"], Et = { key: 3 }, At = ["x", "y", "fill", "font-size", "onClick"], Ut = ["d", "stroke"], Dt = ["fill", "cx", "cy", "r", "onClick"], Yt = { key: 4 }, qt = ["x", "y", "font-size", "font-weight", "fill"], Ht = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], Wt = ["y", "height", "width"], Kt = { style: { width: "100%", height: "100%", display: "flex", "align-items": "center", "justify-content": "center", "flex-direction": "column" } }, Jt = { style: { display: "flex", "align-items": "center", "justify-content": "center", gap: "12px", "flex-wrap": "wrap", "flex-direction": "row" } }, Qt = {
|
|
10
10
|
viewBox: "0 0 20 20",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("vue"),_=require("./useNestedProp-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("vue"),_=require("./useNestedProp-CD3RA8XO.cjs"),i=require("./index-CeMgFh6-.cjs"),C=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),m=l=>(t.pushScopeId("data-v-6a1383ea"),l=l(),t.popScopeId(),l),p=["xmlns","height","width"],x={id:"follower",fy:"30%",fx:"30%"},E=["stop-color","stop-opacity"],N=m(()=>t.createElementVNode("stop",{offset:"95%","stop-color":"transparent"},null,-1)),g=["r","fill","stroke","stroke-width","stroke-dasharray"],V=["r","fill"],S={key:2,class:"wave"},w=["id"],B=["id"],R=m(()=>t.createElementVNode("feColorMatrix",{type:"saturate",values:"0"},null,-1)),b=["filter","stroke"],F={key:3,class:"crosshair"},z=["x1","stroke","stroke-width","stroke-dasharray"],I=["x1","stroke","stroke-width","stroke-dasharray"],L=["y1","stroke","stroke-width","stroke-dasharray"],O=["y1","stroke","stroke-width","stroke-dasharray"],T=["cy","r","fill"],D=["cy","r","fill"],$=["cx","r","fill"],W=["cx","r","fill"],G={key:5,class:"coordinates"},P=["x","y","font-size","fill"],q=["transform"],A=["font-size","fill"],M={__name:"vue-ui-cursor",props:{config:{type:Object,default:{}}},setup(l){const k=l,{vue_ui_cursor:y}=i.useConfig(),c=t.ref(i.createUid()),e=t.computed(()=>_.useNestedProp({userConfig:k.config,defaultConfig:y})),o=t.ref({x:-100,y:-100});function u({clientX:r,clientY:f,...j}){o.value.x=r-e.value.centerCircleRadius,o.value.y=f-e.value.centerCircleRadius}function d(r){o.value.x=r.targetTouches[0].clientX-e.value.centerCircleRadius,o.value.y=r.targetTouches[0].clientY-e.value.centerCircleRadius}const v=t.ref(!0);function s(r){v.value=r}const a=t.ref(!1),n=t.ref(null);function h(){a.value=!1,n.value&&clearTimeout(n.value),t.nextTick(()=>{a.value=!0,n.value=setTimeout(()=>{a.value=!1},1e3)})}return t.onMounted(()=>{const r=e.value.parentId?document.getElementById(e.value.parentId):document.getElementsByTagName("div")[0];r.addEventListener("mousemove",u),r.addEventListener("touchmove",d),r.addEventListener("mouseleave",()=>s(!1)),r.addEventListener("mouseenter",()=>s(!0)),r.addEventListener("click",h)}),t.onBeforeUnmount(()=>{const r=e.value.parentId?document.getElementById(e.value.parentId):document.getElementsByTagName("div")[0];r.removeEventListener("mousemove",u),r.removeEventListener("touchmove",d),r.removeEventListener("mouseleave",()=>s(!1)),r.removeEventListener("mouseenter",()=>s(!0)),r.removeEventListener("click",h)}),t.computed(()=>e.value.centerCircleRadius/2.5),(r,f)=>v.value?(t.openBlock(),t.createElementBlock("svg",{key:0,"data-html2canvas-ignore":"",xmlns:t.unref(i.XMLNS),style:t.normalizeStyle(`z-index: 2147483647; overflow: visible; pointer-events: none;background: transparent; position:fixed; top:${o.value.y}px; left:${o.value.x}px;`),viewBox:"0 0 100 100",height:e.value.centerCircleRadius*2,width:e.value.centerCircleRadius*2},[t.createElementVNode("defs",null,[t.createElementVNode("radialGradient",x,[t.createElementVNode("stop",{offset:"10%","stop-color":e.value.bubbleEffectColor,"stop-opacity":e.value.bubbleEffectOpacity},null,8,E),N])]),e.value.showCenterCircle?(t.openBlock(),t.createElementBlock("circle",{key:0,cx:50,cy:50,r:e.value.centerCircleRadius,fill:t.unref(i.setOpacity)(e.value.centerCircleColor,e.value.centerCircleOpacity*100),stroke:e.value.centerCircleStroke,"stroke-width":e.value.centerCircleStrokeWidth,"stroke-dasharray":e.value.centerCircleDasharray},null,8,g)):t.createCommentVNode("",!0),e.value.bubbleEffect?(t.openBlock(),t.createElementBlock("circle",{key:1,cx:50,cy:50,r:e.value.centerCircleRadius,fill:"url(#follower)",stroke:"none"},null,8,V)):t.createCommentVNode("",!0),e.value.useWaveOnClick?(t.openBlock(),t.createElementBlock("g",S,[t.createElementVNode("defs",null,[t.createElementVNode("filter",{id:`blur_${c.value}`,x:"-50%",y:"-50%",width:"200%",height:"200%"},[t.createElementVNode("feGaussianBlur",{in:"SourceGraphic",stdDeviation:4,id:`blur_std_${c.value}`},null,8,B),R],8,w)]),a.value?(t.openBlock(),t.createElementBlock("circle",{key:0,class:t.normalizeClass({"circle-wave":a.value}),cx:50,cy:50,r:50,filter:`url(#blur_${c.value})`,stroke:e.value.centerCircleStroke,fill:"none","stroke-width":"3"},null,10,b)):t.createCommentVNode("",!0)])):t.createCommentVNode("",!0),e.value.showCrosshair?(t.openBlock(),t.createElementBlock("g",F,[t.createElementVNode("line",{x1:-e.value.centerCircleRadius+50,x2:-5e3,y1:50,y2:50,stroke:e.value.crosshairStroke,"stroke-width":e.value.crosshairStrokeWidth,"stroke-dasharray":e.value.crosshairDasharray,"stroke-linecap":"round"},null,8,z),t.createElementVNode("line",{x1:50+e.value.centerCircleRadius,x2:5e3,y1:50,y2:50,stroke:e.value.crosshairStroke,"stroke-width":e.value.crosshairStrokeWidth,"stroke-dasharray":e.value.crosshairDasharray,"stroke-linecap":"round"},null,8,I),t.createElementVNode("line",{x1:50,x2:50,y1:-e.value.centerCircleRadius+50,y2:-5e3,stroke:e.value.crosshairStroke,"stroke-width":e.value.crosshairStrokeWidth,"stroke-dasharray":e.value.crosshairDasharray,"stroke-linecap":"round"},null,8,L),t.createElementVNode("line",{x1:50,x2:50,y1:e.value.centerCircleRadius+50,y2:5e3,stroke:e.value.crosshairStroke,"stroke-width":e.value.crosshairStrokeWidth,"stroke-dasharray":e.value.crosshairDasharray,"stroke-linecap":"round"},null,8,O)])):t.createCommentVNode("",!0),e.value.showIntersectCircles?(t.openBlock(),t.createElementBlock("g",{key:4,class:t.normalizeClass({"rotating-circles":e.value.isLoading})},[t.createElementVNode("circle",{cx:50,cy:e.value.centerCircleRadius+50,r:e.value.intersectCirclesRadius,fill:e.value.intersectCirclesFill},null,8,T),t.createElementVNode("circle",{cx:50,cy:-e.value.centerCircleRadius+50,r:e.value.intersectCirclesRadius,fill:e.value.intersectCirclesFill},null,8,D),t.createElementVNode("circle",{cx:-e.value.centerCircleRadius+50,cy:50,r:e.value.intersectCirclesRadius,fill:e.value.intersectCirclesFill},null,8,$),t.createElementVNode("circle",{cx:e.value.centerCircleRadius+50,cy:50,r:e.value.intersectCirclesRadius,fill:e.value.intersectCirclesFill},null,8,W)],2)):t.createCommentVNode("",!0),e.value.showCoordinates?(t.openBlock(),t.createElementBlock("g",G,[t.createElementVNode("text",{"text-anchor":"end",x:-e.value.centerCircleRadius+50-e.value.coordinatesFontSize/2+e.value.coordinatesOffset,y:50-e.value.coordinatesFontSize/2+e.value.coordinatesOffset,"font-size":e.value.coordinatesFontSize,fill:e.value.coordinatesColor,style:{"font-variant-numeric":"tabular-nums"},"font-family":"Arial"},t.toDisplayString(o.value.x.toFixed(0)),9,P),t.createElementVNode("g",{transform:`translate(${50-e.value.coordinatesFontSize/2+e.value.coordinatesOffset}, ${-e.value.centerCircleRadius+50-e.value.coordinatesFontSize/2+e.value.coordinatesOffset})`},[t.createElementVNode("text",{"text-anchor":"start","font-size":e.value.coordinatesFontSize,fill:e.value.coordinatesColor,style:{"font-variant-numeric":"tabular-nums"},transform:"rotate(-90)","font-family":"Arial"},t.toDisplayString(o.value.y.toFixed(0)),9,A)],8,q)])):t.createCommentVNode("",!0)],12,p)):t.createCommentVNode("",!0)}},U=C._export_sfc(M,[["__scopeId","data-v-6a1383ea"]]);exports.default=U;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ref as n, computed as m, onMounted as R, onBeforeUnmount as E, openBlock as o, createElementBlock as l, unref as C, normalizeStyle as b, createElementVNode as r, createCommentVNode as a, 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, s as T } from "./index-
|
|
2
|
+
import { u as z } from "./useNestedProp-BrcBWysp.js";
|
|
3
|
+
import { u as O, c as B, X as N, s as T } from "./index-B6m-GhsP.js";
|
|
4
4
|
import { _ as D } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
5
5
|
const g = (i) => (I("data-v-6a1383ea"), i = i(), L(), i), $ = ["xmlns", "height", "width"], W = {
|
|
6
6
|
id: "follower",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useCssVars as J, computed as _, ref as r, watch as K, openBlock as w, createElementBlock as y, createElementVNode as g, normalizeStyle as z, createCommentVNode as I, Fragment as D, renderList as Q, normalizeClass as Z, renderSlot as ee, pushScopeId as te, popScopeId as oe, createStaticVNode as ae } from "vue";
|
|
2
2
|
import { p as le } from "./pdf-97UbtKC2.js";
|
|
3
|
-
import { u as ue } from "./useNestedProp-
|
|
4
|
-
import { u as ne } from "./index-
|
|
3
|
+
import { u as ue } from "./useNestedProp-BrcBWysp.js";
|
|
4
|
+
import { u as ne } from "./index-B6m-GhsP.js";
|
|
5
5
|
import { _ as se } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
6
6
|
const ie = (M) => (te("data-v-57895b3a"), M = M(), oe(), M), re = {
|
|
7
7
|
key: 0,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("vue"),R=require("./pdf-Cz3729tZ.cjs"),q=require("./useNestedProp-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("vue"),R=require("./pdf-Cz3729tZ.cjs"),q=require("./useNestedProp-CD3RA8XO.cjs"),O=require("./index-CeMgFh6-.cjs"),j=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),A=b=>(o.pushScopeId("data-v-57895b3a"),b=b(),o.popScopeId(),b),G={key:0,"data-html2canvas-ignore":"",style:{width:"100%",display:"flex","justify-content":"end"}},U=["disabled"],J=["stroke"],K=o.createStaticVNode('<path stroke="none" d="M0 0h24v24H0z" fill="none" data-v-57895b3a></path><path d="M18 16v.01" data-v-57895b3a></path><path d="M6 16v.01" data-v-57895b3a></path><path d="M12 5v.01" data-v-57895b3a></path><path d="M12 12v.01" data-v-57895b3a></path><path d="M12 1a4 4 0 0 1 2.001 7.464l.001 .072a3.998 3.998 0 0 1 1.987 3.758l.22 .128a3.978 3.978 0 0 1 1.591 -.417l.2 -.005a4 4 0 1 1 -3.994 3.77l-.28 -.16c-.522 .25 -1.108 .39 -1.726 .39c-.619 0 -1.205 -.14 -1.728 -.391l-.279 .16l.007 .231a4 4 0 1 1 -2.212 -3.579l.222 -.129a3.998 3.998 0 0 1 1.988 -3.756l.002 -.071a4 4 0 0 1 -1.995 -3.265l-.005 -.2a4 4 0 0 1 4 -4z" data-v-57895b3a></path>',6),Q=[K],Z={key:1},ee=["id"],te=A(()=>o.createElementVNode("div",{class:"vue-ui-dashboard-grid"},null,-1)),oe=["onMousedown","onTouchstart"],le=["onMousedown","onTouchstart"],ae=["onMousedown","onTouchstart"],ne=["onMousedown","onTouchstart"],ue=["onMousedown","onTouchstart"],M=20,se={__name:"vue-ui-dashboard",props:{dataset:Array,config:Object},emits:["change"],setup(b,{expose:$,emit:B}){const T=b;o.useCssVars(e=>({"417957d3":I.value,"60fae9e7":D.value}));const{vue_ui_dashboard:N}=O.useConfig(),i=o.computed(()=>q.useNestedProp({userConfig:T.config,defaultConfig:N})),z=o.ref(`vue-ui-dashboard-${Math.random()}`),d=o.ref(i.value.locked);function S(){d.value=!d.value}const s=o.ref(T.dataset),h=o.ref(null),u=o.ref(null),v=o.ref({x:0,y:0}),f=o.ref({x:0,y:0}),r=o.ref(null),c=o.ref(!1),p=o.ref(null),y=o.ref(!1);function E(){y.value=!0,R.pdf({domElement:document.getElementById(`vue-ui-dashboard_${z.value}`),fileName:"vue-ui-dashboard"}).finally(()=>{y.value=!1})}function x(e){if(!d.value&&(c.value=!0,p.value=e,u.value===null)){h.value=e,v.value={x:event.clientX,y:event.clientY};const t=s.value[e],a=100-t.width,l=100-t.height;t.left<0&&(t.left=0),t.top<0&&(t.top=0),t.left>a&&(t.left=a),t.top>l&&(t.top=l),t.left<0&&(t.left=0),t.top<0&&(t.top=0),t.left+t.width>100&&(t.left=100-t.width),t.top+t.height>100&&(t.top=100-t.height)}}function m(e,t){c.value=!0,p.value=e,u.value={index:e,direction:t};const a=s.value[e];f.value={x:event.clientX,y:event.clientY,initialWidth:a.width,initialHeight:a.height}}function C(e,t,a){if(u.value.direction.includes("top")){const l=e.height-a/r.value.offsetHeight*100;l>=M&&(e.top+=a/r.value.offsetHeight*100,e.height=l)}if(u.value.direction.includes("bottom")){const l=e.height+a/r.value.offsetHeight*100;l>=M&&(e.height=l)}if(u.value.direction.includes("left")){const l=e.width-t/r.value.offsetWidth*100;l>=M&&(e.left+=t/r.value.offsetWidth*100,e.width=l)}if(u.value.direction.includes("right")){const l=e.width+t/r.value.offsetWidth*100;l>=M&&(e.width=l)}}function X(e){if(!d.value){if(c.value=!0,h.value!==null){const t=s.value[h.value],a=e.clientX-v.value.x,l=e.clientY-v.value.y,n=t.left+a/r.value.offsetWidth*100,g=t.top+l/r.value.offsetHeight*100;n>=0&&g>=0&&n+t.width<=100&&g+t.height<=100&&(t.left=n,t.top=g),v.value={x:e.clientX,y:e.clientY}}if(u.value!==null){const t=s.value[u.value.index],a=e.clientX-f.value.x,l=e.clientY-f.value.y;C(t,a,l),f.value={x:e.clientX,y:e.clientY}}}}o.watch(s,e=>{e&&!c.value&&B("change",s.value)},{deep:!0});function Y(){h.value=null,u.value=null,c.value=!1,p.value=null,s.value.forEach(e=>{e.left=Math.round(e.left/100*100),e.top=Math.round(e.top/100*100),e.width=Math.round(e.width/100*100),e.height=Math.round(e.height/100*100)})}function V(e){d.value||(c.value=!0,p.value=e,u.value===null&&(h.value=e,v.value={x:event.touches[0].clientX,y:event.touches[0].clientY}))}function k(e,t,a){if(c.value=!0,p.value=e,u.value===null){u.value={index:e,direction:t};const l=s.value[e];f.value={x:a.touches[0].clientX,y:a.touches[0].clientY,initialWidth:l.width,initialHeight:l.height}}}function _(e){if(c.value=!0,e.preventDefault(),u.value!==null){const t=s.value[u.value.index],a=e.touches[0].clientX-f.value.x,l=e.touches[0].clientY-f.value.y;C(t,a,l),f.value={x:e.touches[0].clientX,y:e.touches[0].clientY}}}function H(e){if(!d.value&&(c.value=!0,e.preventDefault(),h.value!==null)){const t=s.value[h.value],a=e.touches[0].clientX-v.value.x,l=e.touches[0].clientY-v.value.y,n=t.left+a/r.value.offsetWidth*100,g=t.top+l/r.value.offsetHeight*100;n>=0&&g>=0&&n+t.width<=100&&g+t.height<=100&&(t.left=n,t.top=g),v.value={x:e.touches[0].clientX,y:e.touches[0].clientY}}}function w(){c.value=!1,p.value=null,h.value=null,u.value=null,s.value.forEach(e=>{e.left=Math.round(e.left/100*100),e.top=Math.round(e.top/100*100),e.width=Math.round(e.width/100*100),e.height=Math.round(e.height/100*100)})}const I=o.computed(()=>i.value.style.item.borderColor),D=o.computed(()=>i.value.style.resizeHandles.backgroundColor),W=o.computed(()=>i.value.style.board.aspectRatio),L=o.computed(()=>i.value.style.board.backgroundColor),P=o.computed(()=>i.value.style.board.border);function F(){return s.value}return $({generatePdf:E,getItemsPositions:F,toggleLock:S}),(e,t)=>(o.openBlock(),o.createElementBlock("div",null,[i.value.allowPrint?(o.openBlock(),o.createElementBlock("div",G,[o.createElementVNode("button",{class:"vue-ui-dashboard-button",onClick:E,disabled:y.value,style:o.normalizeStyle([{"margin-top":"12px"},`color:${i.value.style.board.color}`])},[y.value?(o.openBlock(),o.createElementBlock("svg",{key:0,class:"vue-ui-dashboard-print-icon",xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:i.value.style.board.color,fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},Q,8,J)):(o.openBlock(),o.createElementBlock("span",Z,"PDF"))],12,U)])):o.createCommentVNode("",!0),o.createElementVNode("div",{class:"vue-ui-dashboard-container",ref_key:"dashboardContainer",ref:r,id:`vue-ui-dashboard_${z.value}`,style:o.normalizeStyle(`border:${P.value}; sbackground:${L.value}; aspect-ratio:${W.value}`)},[o.createElementVNode("div",{class:"vue-ui-dashboard-grid-container",ref:"container",onMousemove:X,onMouseup:Y,onTouchmove:H,onTouchend:w,style:o.normalizeStyle(`background:${i.value.style.board.backgroundColor}`)},[te,(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(s.value,(a,l)=>(o.openBlock(),o.createElementBlock("div",{key:a.id,class:o.normalizeClass({"vue-ui-dashboard-grid-item":!0,"vue-ui-dashboard-grid-item--locked":d.value}),style:o.normalizeStyle({width:`${a.width}%`,height:`${a.height}%`,left:`${a.left}%`,top:`${a.top}%`,cursor:"move",boxShadow:p.value===l?"0 6px 12px -3px rgba(0,0,0,0.3)":"",zIndex:p.value===l?"1":"0",backgroundColor:i.value.style.item.backgroundColor}),onMousedown:n=>x(l),onTouchstart:n=>V(l)},[d.value?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[o.createElementVNode("div",{class:"vue-ui-dashboard-resize-handle vue-ui-dashboard-top-left",onMousedown:n=>m(l,"top-left"),onTouchstart:n=>k(l,"top-left",n),onTouchmove:t[0]||(t[0]=n=>_(n)),onTouchend:w},null,40,le),o.createElementVNode("div",{class:"vue-ui-dashboard-resize-handle vue-ui-dashboard-top-right",onMousedown:n=>m(l,"top-right"),onTouchstart:n=>k(l,"top-right",n),onTouchmove:t[1]||(t[1]=n=>_(n)),onTouchend:w},null,40,ae),o.createElementVNode("div",{class:"vue-ui-dashboard-resize-handle vue-ui-dashboard-bottom-left",onMousedown:n=>m(l,"bottom-left"),onTouchstart:n=>k(l,"bottom-left",n),onTouchmove:t[2]||(t[2]=n=>_(n)),onTouchend:w},null,40,ne),o.createElementVNode("div",{class:"vue-ui-dashboard-resize-handle vue-ui-dashboard-bottom-right",onMousedown:n=>m(l,"bottom-right"),onTouchstart:n=>k(l,"bottom-right",n),onTouchmove:t[3]||(t[3]=n=>_(n)),onTouchend:w},null,40,ue)],64)),o.renderSlot(e.$slots,"content",{item:a,index:l,left:a.left,top:a.top,height:a.height,width:a.width},void 0,!0)],46,oe))),128))],36)],12,ee)]))}},ie=j._export_sfc(se,[["__scopeId","data-v-57895b3a"]]);exports.default=ie;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ref as k, computed as d, openBlock as $, createElementBlock as i, Fragment as o, createElementVNode as l, createCommentVNode as m, unref as v, normalizeStyle as C, renderList as b, createBlock as N } from "vue";
|
|
2
|
-
import { u as q } from "./useNestedProp-
|
|
3
|
-
import { u as M, X as S } from "./index-
|
|
2
|
+
import { u as q } from "./useNestedProp-BrcBWysp.js";
|
|
3
|
+
import { u as M, X as S } from "./index-B6m-GhsP.js";
|
|
4
4
|
const w = { key: 0 }, B = ["d", "fill"], F = ["d", "fill"], X = ["d", "fill"], E = ["d", "fill"], I = ["d", "fill"], O = ["d", "fill"], A = ["d", "fill"], D = { key: 1 }, G = ["cx", "cy", "fill"], V = {
|
|
5
5
|
__name: "Digit",
|
|
6
6
|
props: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("vue"),g=require("./useNestedProp-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("vue"),g=require("./useNestedProp-CD3RA8XO.cjs"),L=require("./index-CeMgFh6-.cjs"),f={key:0},m=["d","fill"],k=["d","fill"],h=["d","fill"],v=["d","fill"],C=["d","fill"],N=["d","fill"],b=["d","fill"],B={key:1},E=["cx","cy","fill"],q={__name:"Digit",props:{quanta:{type:String,default:null},backgroundColor:{type:String,default:"#e1e5e8"},color:{type:String,default:"#000000"},x:{type:Number,default:0},y:{type:Number,default:0}},setup(e){const u=e,$=t.ref({0:"1111110",1:"0110000",2:"1101101",3:"1111001",4:"0110011",5:"1011011",6:"1011111",7:"1110000",8:"1111111",9:"1111011","-":"0000001",X:"0000000"}),l=t.computed(()=>[void 0,null].includes(u.quanta)?$.value.X:$.value[u.quanta]);return(a,x)=>(t.openBlock(),t.createElementBlock(t.Fragment,null,[[void 0,null,"."].includes(e.quanta)?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("g",f,[t.createElementVNode("path",{d:`M ${e.x} ${e.y} L ${e.x+2} ${e.y-2} L ${e.x+24} ${e.y-2} L ${e.x+26} ${e.y} L ${e.x+24} ${e.y+2} L ${e.x+2} ${e.y+2}Z`,fill:l.value[0]==1?e.color:e.backgroundColor,stroke:"none"},null,8,m),t.createElementVNode("path",{d:`M ${e.x+26} ${e.y+26} L ${e.x+26} ${e.y+4} L ${e.x+28} ${e.y+2} L ${e.x+30} ${e.y+4} L ${e.x+30} ${e.y+26} L ${e.x+28} ${e.y+28} L ${e.x+26} ${e.y+26}`,fill:l.value[1]==1?e.color:e.backgroundColor,stroke:"none"},null,8,k),t.createElementVNode("path",{d:`M ${e.x+26} ${e.y+56} L ${e.x+26} ${e.y+34} L ${e.x+28} ${e.y+32} L ${e.x+30} ${e.y+34} L ${e.x+30} ${e.y+56} L ${e.x+28} ${e.y+58} L ${e.x+26} ${e.y+56}`,fill:l.value[2]==1?e.color:e.backgroundColor,stroke:"none"},null,8,h),t.createElementVNode("path",{d:`M ${e.x+2} ${e.y+58} L ${e.x} ${e.y+60} L ${e.x+2} ${e.y+62} L ${e.x+24} ${e.y+62} L ${e.x+26} ${e.y+60} L ${e.x+24} ${e.y+58} L ${e.x+2} ${e.y+58}`,fill:l.value[3]==1?e.color:e.backgroundColor,stroke:"none"},null,8,v),t.createElementVNode("path",{d:`M ${e.x} ${e.y+34} L ${e.x-2} ${e.y+32} L ${e.x-4} ${e.y+34} L ${e.x-4} ${e.y+56} L ${e.x-2} ${e.y+58} L ${e.x} ${e.y+56} L ${e.x} ${e.y+34}`,fill:l.value[4]==1?e.color:e.backgroundColor,stroke:"none"},null,8,C),t.createElementVNode("path",{d:`M ${e.x-2} ${e.y+2} L ${e.x} ${e.y+4} L ${e.x} ${e.y+26} L ${e.x-2} ${e.y+28} L ${e.x-4} ${e.y+26} L ${e.x-4} ${e.y+4} L ${e.x-2} ${e.y+2}`,fill:l.value[5]==1?e.color:e.backgroundColor,stroke:"none"},null,8,N),t.createElementVNode("path",{d:`M ${e.x+2} ${e.y+28} L ${e.x} ${e.y+30} L ${e.x+2} ${e.y+32} L ${e.x+24} ${e.y+32} L ${e.x+26} ${e.y+30} L ${e.x+24} ${e.y+28} L ${e.x+2} ${e.y+28}`,fill:l.value[6]==1?e.color:e.backgroundColor,stroke:"none"},null,8,b)])),e.quanta=="."?(t.openBlock(),t.createElementBlock("g",B,[t.createElementVNode("circle",{cx:e.x-8,cy:e.y+60,r:3,fill:e.color},null,8,E)])):t.createCommentVNode("",!0)],64))}},M=["xmlns","viewBox"],V={__name:"vue-ui-digits",props:{dataset:{type:Number,default:0},config:{type:Object,default(){return{}}}},setup(e){const u=e,{vue_ui_digits:$}=L.useConfig(),l=t.computed(()=>g.useNestedProp({userConfig:u.config,defaultConfig:$})),a=t.computed(()=>{const c=(u.dataset||0).toString().split(""),d=[],n={x:10,y:10};let i=0;for(let y=0;y<c.length;y+=1){const o=c[y];d.push({x:n.x+i,y:n.y,quanta:o}),o=="."?i+=2:i+=44}return d}),x=t.computed(()=>Math.max(...a.value.map(c=>c.x))+36);return(c,d)=>(t.openBlock(),t.createElementBlock("svg",{xmlns:t.unref(L.XMLNS),viewBox:`0 0 ${x.value} 80`,style:t.normalizeStyle(`background:${l.value.backgroundColor};${l.value.height?`height:${l.value.height};`:""}${l.value.width?`width:${l.value.width}`:""}`)},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(a.value,n=>(t.openBlock(),t.createBlock(q,{x:n.x,y:n.y,quanta:n.quanta,color:l.value.digits.color,backgroundColor:l.value.digits.skeletonColor},null,8,["x","y","quanta","color","backgroundColor"]))),256))],12,M))}};exports.default=V;
|