@devgateway/dvz-ui-react 1.7.2 → 1.7.3

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.
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const d=require("react/jsx-runtime"),h=require("react"),ue=require("semantic-ui-react"),Qa=require("../data/DataProvider.js"),Za=require("../data/DataConsumer.js"),Oa=require("../../utils/deviceType.js"),er=require("./Pie.js");require("immutable");const tr=require("./Radar.js"),ar=require("./Bar.js"),rr=require("./Line.js"),or=require("@devgateway/wp-react-lib"),Q=require("./data/index.js"),nr=require("./CSVDataFrame.js"),sr=require("./colors/ColorProvider.js"),ot=require("./Messages.js"),ir=require("react-redux"),lr=require("react-intl"),dr=y=>{console.log("manual colors...",y["data-manual-colors"]);let{parent:me,editing:i=!1,unique:Z,childContent:L,categories:X,injectedMeasures:l,"data-app":o="csv","data-dvz-proxy-dataset-id":pe,"data-group":he="default","data-height":S=500,"data-type":B="bar","data-dimension1":E,"data-dimension2":fe,"data-dimension3":pr,"data-color-by":q="index","data-scheme":O="system","data-group-mode":nt="grouped","data-left-legend":st="Left Legend","data-legend-label":it="","data-bottom-legend":lt="Bottom Legend","data-dualmode":dt,"data-legend-position":ge="right","data-show-legends":be="true","data-data-source-label":hr="Source","data-chart-data-source":fr="Data Source","data-toggle-info-label":gr="Info Graphic","data-toggle-chart-label":br="Chart","data-tick-rotation":m=0,"data-tick-color":ct="rgb(92,93,99)","data-measures":ut="{}","data-format":xr="{}","data-csv":mt="","data-margin-left":pt=50,"data-margin-top":ht=25,"data-margin-right":ft=25,"data-margin-bottom":gt=25,"data-start-angle":bt=0,"data-end-angle":xt=360,"data-view-mode":xe="info","data-filters":wt="[]","data-tooltip-html":vt="","data-layout":ee="vertical","data-reverse":we="false","data-offset-y":yt="-40","data-line-layer-enabled":ve="false","data-overlays":Lt="[]","data-max-value":kt="auto","data-value-scale":Tt="linear","data-swap":V="false","data-no-data-message":Ct="No data matches your selection","data-bar-color":Mt="rgb(0,0,0)","data-override-tick-color":ye="false","data-fixed-min-value":It=0,"data-fixed-max-value":At=0,"data-bar-padding":Rt=.15,"data-bar-label-position":Dt="middle","data-line-label-position":Ft="none","data-show-grid":Le="true","data-include-overall":ke="false","data-bar-inner-padding":Pt=.7,"data-x-label-color":Bt="#000","data-bar-label-color":Et="#000","data-legend-label-color":qt="#000","data-tooltip-enabled":Te="true","data-use-check-box-background":Ce="false","data-use-label-background":Me="true","data-highlight-xaxis-line":Ie="false","data-show-tick-line":Ae="true","data-show-right-axis":Re="true","data-manual-colors":Nt="{}","data-right-legend":zt="","data-offset-right":Xt="40","data-offset-bottom":St="40","data-hidden-bars":Vt=[],"data-confidence-intervals":Gt="[]","data-enable-area":De="false","data-area-shading-criteria":Ut="DEFAULT","data-area-lower-bound":$t="","data-area-upper-bound":Wt="","data-show-points":Fe="true","data-center-label":Ht="","data-show-arc-labels":Pe="true","data-show-arc-link-labels":Be="true","data-slice-padding":Yt=1,"data-center-label-font-weight":_t="normal","data-center-label-font-size":Jt="12","data-center-label-xoffset":jt=0,"data-center-label-yoffset":Kt=0,"data-group-total-measure":Qt="","data-show-group-total":Ee="true","data-group-total-label":Zt="","data-group-total-format":Ot="{}","data-group-total-label-offset":ea,"data-group-total-fixed-position":qe="false","data-tooltip-enable-markdown":G="false","data-y-axis-tick-values":Ne="10","data-x-axis-tick-values":ze="10","data-enable-grid-y":k="true","data-enable-grid-x":T="false","data-offset-text":ta=0,"data-overall-label":te="Overall","data-min-max-clamp":aa="false","data-reverse-legend":Xe="false","data-sort":Se="default","data-sort-reverse":U="false","data-sort-second-dimension":Ve="default","data-sort-reverse-second-dimension":$="false","data-radar-curve":ra="linearClosed","data-radar-fill-opacity":oa=.25,"data-radar-border-width":na=2,"data-radar-grid-levels":sa=3,"data-radar-grid-shape":ia="circular","data-radar-grid-label-offset":la=36,"data-radar-enable-dots":Ge="true","data-radar-dot-size":da=8,"data-radar-enable-dot-label":Ue="true","data-radar-dot-label-offset":ca=-12,"data-mobile-customization":$e="{}","data-show-percentage":We="false","data-preview-mode":f="Desktop","data-wait-for-filters":ua="false","data-line-curve":ma="linear","data-show-legends-in-columns":He="false","data-number-of-legend-columns":pa=4,"data-line-x-axis-tick-mode":ha="none","data-line-x-axis-tick-count":fa=10,"data-line-x-axis-tick-every":ga=1,pageModuleProps:g}=y;const ba=i,t=JSON.parse(decodeURIComponent($e)),[ae,xa]=h.useState(window.innerWidth<=1250),x=ae&&((t==null?void 0:t.showCustomization)??!1);g!=null&&g.previewMode&&(g!=null&&g.editing)&&(f=g.previewMode,i=g.editing);const wa=["Tablet"].includes(f)&&i,va=["Mobile"].includes(f)&&i,ya=["Desktop"].includes(f)&&i,c=x&&f!=="Desktop",u=x&&!i,re=()=>{const e=window.matchMedia("(min-width: 768px) and (max-width: 1250px)").matches,r=window.matchMedia("(max-width: 767px)").matches;switch(!0){case ya:return m;case wa:return x?(t==null?void 0:t.tabletXAxisTextRotation)??m:m;case va:return x?(t==null?void 0:t.mobileXAxisTextRotation)??m:m;case e:return x?(t==null?void 0:t.tabletXAxisTextRotation)??m:m;case r:return x?(t==null?void 0:t.mobileXAxisTextRotation)??m:m;default:return m}},La=re(),[ka,Ye]=h.useState(La),_e=y.intl.locale,W=h.useRef(null),Je=e=>{try{return ba?e:decodeURIComponent(e)}catch{return console.error(`error decoding value:${e}`),e}},C=e=>{try{return JSON.parse(Je(e))}catch{console.error(`error parsing value:${e}`)}return null},Ta=()=>{const e=C(Nt);if(!e)return null;const r=e[o];if(o==="csv"&&r&&O==="manual"){if(r[q]!==void 0)return r;if(typeof r=="object"&&r!==null&&!Array.isArray(r)&&Object.values(r).some(p=>typeof p=="string"&&(p.startsWith("#")||p.startsWith("rgb"))))return{[q]:r}}return r},Ca=()=>C(ut),je=()=>{var e;if(a!=null&&a[o]){let r=(e=a==null?void 0:a[o])==null?void 0:e.format;if(!r){const n=Object.keys(a==null?void 0:a[o]);for(let p=0;p<n.length;p++)if(a!=null&&a[o][n[p]].selected&&(a!=null&&a[o][n[p]].format)){r=a==null?void 0:a[o][n[p]].format;break}}return r}return a!=null&&a.csv?a.csv.format:null},Ma=()=>{let e=null;return a!=null&&a[o]?a[o].useCustomAxisFormat&&a[o].customFormat&&(e=a[o].customFormat):a!=null&&a.csv&&a.csv.useCustomAxisFormat&&a.csv.customFormat&&(e=a.csv.customFormat),e},Ia=()=>a!=null&&a[o]?Object.keys(a[o]).map(e=>({value:e,...a[o][e]})).filter(e=>e.selected).map(e=>e.value):[],Ke=()=>{const e={};return a!=null&&a[o]&&Object.keys(a[o]).map(n=>({value:n,...a[o][n]})).filter(n=>n.selected&&n.hasCustomLabel).forEach(n=>{e[n.value]=n.customLabel}),e},Aa=()=>a!=null&&a[o]?Object.keys(a[o]).filter(e=>a[o][e].allowSelection):[];let a=Ca(),w=Ia(),b=je();const Ra=Aa();let oe=st,ne=zt,se=Je(vt);if(l!=null&&l[o]){const e=Object.keys(l[o].measures).map(r=>({value:r,...l[o].measures[r]})).filter(r=>r.selected).map(r=>r.value);a=l,w=e,b=je(),oe=l.leftTitle,ne=l.rightTitle,l.customTooltip&&(se=l.customTooltip)}const Da=b?{style:b.style==="compacted"?"decimal":b.style,notation:b.style==="compacted"?"compact":"standard",currency:b.currency,minimumFractionDigits:parseInt(b.minimumFractionDigits),maximumFractionDigits:parseInt(b.maximumFractionDigits)}:{notation:"standard",currency:"USD",minimumFractionDigits:2,maximumFractionDigits:2},Fa=Ma(),s=C(Ot),Pa={style:(s==null?void 0:s.style)==="compacted"?"decimal":s==null?void 0:s.style,notation:(s==null?void 0:s.style)==="compacted"?"compact":"standard",currency:s==null?void 0:s.currency,minimumFractionDigits:parseInt(s==null?void 0:s.minimumFractionDigits),maximumFractionDigits:parseInt(s==null?void 0:s.maximumFractionDigits)},[Ba,wr]=h.useState(xe),Ea=i?xe:Ba,qa={scheme:O,colorBy:q},H=i?S-80:S,Na=()=>(c||u)&&!(t!=null&&t.showXAxisTitle)?"":lt,za=()=>c||u?t!=null&&t.showYAxisTitle?oe:"":oe,Xa=()=>c||u?t!=null&&t.showRightAxisTitle?ne:"":ne,Sa={left:za(),bottom:Na(),right:Xa()},Y=e=>{if(e==="true"||e===!0)return!0;if(e==="false"||e===!1)return!1},Qe=()=>{Y(T)&&!Y(k)?(T=!1,k=!0):!Y(T)&&Y(k)&&(T=!0,k=!1)},Va=()=>ee==="horizontal"?(Qe(),"vertical"):(Qe(),"horizontal"),Ga=()=>t!=null&&t.chartLayoutOverride?Va():ee,_=(e,r,n)=>e?Number.parseInt(r)??n:n,Ze=(e,r,n)=>e?r??n:n;h.useEffect(()=>{const e=()=>{xa(window.innerWidth<=1250);const r=re();Ye(r)};return window.addEventListener("resize",e),Ye(re()),()=>{window.removeEventListener("resize",e)}},[i,f,x,m,t==null?void 0:t.tabletXAxisTextRotation,t==null?void 0:t.mobileXAxisTextRotation]);const Ua=()=>{const e=["tablet","mobile","midTablet"].includes(Oa.default());return i&&f==="Desktop"?ge:e?"bottom":ge},Oe={app:o,editing:i,tickColor:decodeURIComponent(ct),tickRotation:ka,layout:c||u?Ga():ee,reverse:we==!0||we=="true",showLegends:be==!0||be=="true",legendLabel:it,swap:V==!0||V=="true",showGrid:Le==!0||Le=="true",showPercentage:We==!0||We=="true",marginLeft:_(c||u,Number.parseInt(t==null?void 0:t.marginLeft),parseInt(pt)),marginTop:_(c||u,Number.parseInt(t==null?void 0:t.marginTop),parseInt(ht)),marginRight:_(c||u,Number.parseInt(t==null?void 0:t.marginRight),Number.parseInt(ft)),marginBottom:_(c||u,Number.parseInt(t==null?void 0:t.marginBottom),Number.parseInt(gt)),height:`${H}px`,legendPosition:Ua(),legends:Sa,tooltip:G==!0||G=="true"?se:se.replace(/\r\n/g,"<hr/>").replace(/[\r\n]/g,"<hr/>"),colors:qa,groupMode:nt,format:Da,startAngle:bt,endAngle:xt,offsetY:yt,maxValue:kt,valueScale:Tt,categories:X,lineLayerEnabled:ve==!0||ve=="true",overlays:C(Lt)||[],barColor:decodeURIComponent(Mt),overrideTickColor:ye==!0||ye=="true",fixedMinValue:It,fixedMaxValue:At,barPadding:Ze(c||u,t==null?void 0:t.barPadding,Rt),barLabelPosition:Dt,lineLabelPosition:Ft,barInnerPadding:Ze(c||u,t==null?void 0:t.barInnerPadding,Pt),xLabelColor:decodeURIComponent(Bt),barLabelColor:decodeURIComponent(Et),legendLabelColor:decodeURIComponent(qt),tooltipEnabled:Te==!0||Te=="true",legendLabelBack:Me==!0||Me=="true",legendCheckBack:Ce==!0||Ce=="true",highlightXAxisLine:Ie==!0||Ie=="true",showTickLine:Ae==!0||Ae=="true",showRightAxis:Re==!0||Re=="true",offsetRight:Xt,offsetBottom:St,confidenceIntervals:C(Gt)||[],showPoints:Fe==!0||Fe=="true",enableArea:De==!0||De=="true",areaShadingCriteria:Ut,areaLowerBound:$t,areaUpperBound:Wt,showGroupTotal:Ee==!0||Ee=="true",groupTotalMeasure:Qt,groupTotalLabel:Zt,groupTotalFormat:Pa,groupTotalOffset:ea,groupTotalFixedPosition:qe==!0||qe=="true",centerLabel:Ht,showArcLabels:Pe==!0||Pe=="true",showArcLinkLabels:Be==!0||Be=="true",slicePadding:Yt,centerLabelFontWeight:_t,centerLabelFontSize:Jt,centerLabelXOffset:jt,centerLabelYOffset:Kt,userMeasures:Ra,tooltipEnableMarkdown:G==!0||G=="true",yAxisTickValues:c||u?t.yAxisTickValues??Ne:Ne,xAxisTickValues:c||u?t.xAxisTickValues??ze:ze,lineXAxisTickMode:ha,lineXAxisTickCount:parseInt(fa)||10,lineXAxisTickEvery:parseInt(ga)||1,enableGridY:k==!0||k=="true",enableGridX:T==!0||T=="true",offsetText:ta,selectedMeasures:w,overallLabel:te,minMaxClamp:aa,reverseLegend:Xe==!0||Xe=="true",customAxisFormat:Fa,sort:Se,sortReverse:U==!0||U=="true",sortReverseSecondDimension:$==!0||$=="true",radarCurve:ra,radarFillOpacity:oa,radarBorderWidth:na,radarGridLevels:sa,radarGridShape:ia,radarGridLabelOffset:la,radarEnableDots:Ge==!0||Ge=="true",radarDotSize:da,radarEnableDotLabel:Ue==!0||Ue=="true",radarDotLabelOffset:ca,sortSecondDimension:Ve,mobileCustomization:$e,dimension1:E,previewMode:f,lineCurve:ma,showLegendsInColumns:He==!0||He=="true",numberOfLegendColumns:parseInt(pa)||4},ie={},le=C(wt)||{};le&&le.forEach&&le.forEach(e=>{e.value!=null&&e.value.filter(r=>r!=null&&r.toString().trim()!="").length>0&&(ie[e.param]=e.value)}),pe&&(ie.dvzProxyDatasetId=pe);let M=null,I=null;if(o==="csv")M=nr.default;else switch(B){case"line":M=Q.default.LineDataFrame;break;case"pie":M=Q.default.PieDataFrame;break;case"radar":M=Q.default.BarDataFrame;break;default:M=Q.default.BarDataFrame;break}let A=!1;switch(B){case"bar":I=ar.default,A=o!="csv"&&E=="none"&&w.length==0;break;case"line":I=rr.default,A=o!=="csv"&&(w.length===0||E==="none");break;case"pie":A=o!="csv"&&w.length==0,I=er.default;break;case"radar":A=o!="csv"&&w.length==0,I=tr.default;break;default:I=d.jsx("div",{children:"No Chart"});break}const $a=dt==="true",N=[];E!="none"&&N.push(E),fe!="none"&&N.push(fe);const[et,Wa]=h.useState(0),[vr,Ha]=h.useState(tt());function tt(){var e;return((e=window.screen.orientation)==null?void 0:e.type)||(window.innerWidth>window.innerHeight?"landscape-primary":"portrait-primary")}return h.useEffect(()=>{const e=setTimeout(()=>{ae&&(()=>{const n=W.current.querySelector(".legends.container.has-standard-12-font-size.bottom")||W.current.querySelector(".legends.container.items-section:not(.legends.container.top .items-section)");if(!n||n.closest(".legends.container.top"))return;const{clientHeight:p}=n,z=window.getComputedStyle(n),Ya=parseInt(z.marginTop),at=parseInt(z.marginBottom),_a=parseInt(z.paddingTop),Ja=parseInt(z.paddingBottom),ja=p+Ya+at+_a+Ja,rt=n.closest(".ui.fluid.container.content");if(rt){const v=rt.querySelector(".data-source");if(v){const R=v.getBoundingClientRect(),D=n.getBoundingClientRect();if(D.bottom!==0&&R.top!==0){if(n.textContent.trim()==="")return;const J=at,j=D.bottom+J,ce=window.getComputedStyle(v),K=parseFloat(ce.marginTop)||0,F=R.top-K;if(j>F){let P=j-F;P<5&&(P+=1),v.style.marginTop=`${P+1}px`}}else setTimeout(()=>{R.top<D.bottom&&(v.style.marginTop=`${D.bottom-R.top+1}px`)},1e3)}}const de=n.closest(".chart.container");if(de){const v=de.getBoundingClientRect(),R=window.getComputedStyle(de),D=Number.parseFloat(R.marginBottom)||0,J=v.bottom+D,j=n.getBoundingClientRect(),ce=Number.parseFloat(z.marginTop)||0,K=j.top-ce;if(K<J){const F=J-K,P=200,Ka=Math.min(F+1,P);F>0&&F<P&&(n.style.marginTop=`${Ka}px`)}}Wa(ja)})()},100);return()=>{clearTimeout(e)}},[ae,W]),h.useEffect(()=>{const e=()=>{setTimeout(()=>{Ha(tt())},100)};return window.screen.orientation?window.screen.orientation.addEventListener("change",e):window.addEventListener("resize",e),()=>{window.screen.orientation?window.screen.orientation.removeEventListener("change",e):window.removeEventListener("resize",e)}},[]),d.jsx("div",{ref:W,children:d.jsxs(ue.Container,{className:"chart container",style:{minHeight:B==="pie"&&window.innerWidth<=480?`${parseInt(S)+parseInt(et)*.5}px`:`${parseInt(S)+parseInt(et)}px`},fluid:!0,children:[d.jsx(Qa.default,{editing:i,style:{height:`${H}px`},params:ie,waitForFilters:ua==="true",app:o,group:he,csv:mt,store:[o,Z,...N],source:N.join("/"),children:d.jsxs(ue.Container,{style:{height:`${H}px`},className:"body",fluid:!0,children:[A&&d.jsx(ot.default,{editing:i}),!A&&d.jsxs(Za.default,{children:[d.jsx(ot.default,{app:o,group:he,noDataMsg:Ct,children:" "}),d.jsx(M,{locale:_e,colorBy:q,hiddenBars:Vt,swap:V==="true"||V===!0,type:B,includeTotal:!0,includeOverall:ke===!0||ke==="true",overallLabel:te,measures:w,dimensions:[...N],sort:Se,sortReverse:U===!0||U==="true",sortSecondDimension:Ve,sortReverseSecondDimension:$===!0||$==="true",customLabels:Ke(),children:d.jsx(sr.default,{type:B,app:o,locale:_e,overallLabel:te,customLabels:Ke(),manualColors:Ta(),colorBy:q,scheme:O,barColor:Oe.barColor,children:d.jsx(I,{...Oe})})})]})]})}),d.jsx("br",{}),$a&&L&&Ea==="info"&&d.jsx(ue.Container,{fluid:!0,style:{height:H+"px"},className:"body",children:d.jsx(or.PostContent,{post:{content:{rendered:L}}})})]})})},cr=(y,me)=>{const{"data-app":i,"data-group":Z}=me,L=y.getIn(["data","measures",i,Z]),X=y.getIn(["data","pageModuleProps"]),l={};return L&&Object.keys(L).length>0&&(l.injectedMeasures=L??{}),X&&(l.pageModuleProps=X),l},ur={},mr=ir.connect(cr,ur)(lr.injectIntl(dr));exports.default=mr;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const l=require("react/jsx-runtime"),h=require("react"),pe=require("semantic-ui-react"),Qa=require("../data/DataProvider.js"),Za=require("../data/DataConsumer.js"),Oa=require("../../utils/deviceType.js"),er=require("./Pie.js");require("immutable");const tr=require("./Radar.js"),ar=require("./Bar.js"),rr=require("./Line.js"),or=require("@devgateway/wp-react-lib"),O=require("./data/index.js"),nr=require("./CSVDataFrame.js"),sr=require("./colors/ColorProvider.js"),nt=require("./Messages.js"),ir=require("react-redux"),dr=require("react-intl"),lr=P=>{let{parent:he,editing:i=!1,unique:ee,childContent:k,categories:G,injectedMeasures:d,"data-app":r="csv","data-dvz-proxy-dataset-id":fe,"data-group":ge="default","data-height":V=500,"data-type":q="bar","data-dimension1":N,"data-dimension2":be,"data-dimension3":pr,"data-color-by":z="index","data-scheme":te="system","data-group-mode":st="grouped","data-left-legend":it="Left Legend","data-legend-label":dt="","data-bottom-legend":lt="Bottom Legend","data-dualmode":ct,"data-legend-position":xe="right","data-show-legends":we="true","data-data-source-label":hr="Source","data-chart-data-source":fr="Data Source","data-toggle-info-label":gr="Info Graphic","data-toggle-chart-label":br="Chart","data-tick-rotation":m=0,"data-tick-color":ut="rgb(92,93,99)","data-measures":mt="{}","data-format":xr="{}","data-csv":pt="","data-margin-left":ht=50,"data-margin-top":ft=25,"data-margin-right":gt=25,"data-margin-bottom":bt=25,"data-start-angle":xt=0,"data-end-angle":wt=360,"data-view-mode":ve="info","data-filters":vt="[]","data-tooltip-html":yt="","data-layout":ae="vertical","data-reverse":ye="false","data-offset-y":Lt="-40","data-line-layer-enabled":Le="false","data-overlays":kt="[]","data-max-value":Tt="auto","data-value-scale":Ct="linear","data-swap":U="false","data-no-data-message":Mt="No data matches your selection","data-bar-color":It="rgb(0,0,0)","data-override-tick-color":ke="false","data-fixed-min-value":Rt=0,"data-fixed-max-value":At=0,"data-bar-padding":Dt=.15,"data-bar-label-position":Ft="middle","data-line-label-position":Bt="none","data-show-grid":Te="true","data-include-overall":Ce="false","data-bar-inner-padding":Et=.7,"data-x-label-color":Pt="#000","data-bar-label-color":qt="#000","data-legend-label-color":Nt="#000","data-tooltip-enabled":Me="true","data-use-check-box-background":Ie="false","data-use-label-background":Re="true","data-highlight-xaxis-line":Ae="false","data-show-tick-line":De="true","data-show-right-axis":Fe="true","data-manual-colors":zt="{}","data-right-legend":Xt="","data-offset-right":St="40","data-offset-bottom":Gt="40","data-hidden-bars":Vt=[],"data-confidence-intervals":Ut="[]","data-enable-area":Be="false","data-area-shading-criteria":$t="DEFAULT","data-area-lower-bound":Ht="","data-area-upper-bound":Wt="","data-show-points":Ee="true","data-center-label":Yt="","data-show-arc-labels":Pe="true","data-show-arc-link-labels":qe="true","data-slice-padding":_t=1,"data-center-label-font-weight":Jt="normal","data-center-label-font-size":jt="12","data-center-label-xoffset":Kt=0,"data-center-label-yoffset":Qt=0,"data-group-total-measure":Zt="","data-show-group-total":Ne="true","data-group-total-label":Ot="","data-group-total-format":ea="{}","data-group-total-label-offset":ta,"data-group-total-fixed-position":ze="false","data-tooltip-enable-markdown":$="false","data-y-axis-tick-values":Xe="10","data-x-axis-tick-values":Se="10","data-enable-grid-y":T="true","data-enable-grid-x":C="false","data-offset-text":aa=0,"data-overall-label":re="Overall","data-min-max-clamp":ra="false","data-reverse-legend":Ge="false","data-sort":Ve="default","data-sort-reverse":H="false","data-sort-second-dimension":Ue="default","data-sort-reverse-second-dimension":W="false","data-radar-curve":oa="linearClosed","data-radar-fill-opacity":na=.25,"data-radar-border-width":sa=2,"data-radar-grid-levels":ia=3,"data-radar-grid-shape":da="circular","data-radar-grid-label-offset":la=36,"data-radar-enable-dots":$e="true","data-radar-dot-size":ca=8,"data-radar-enable-dot-label":He="true","data-radar-dot-label-offset":ua=-12,"data-mobile-customization":We="{}","data-show-percentage":Ye="false","data-preview-mode":f="Desktop","data-wait-for-filters":ma="false","data-line-curve":pa="linear","data-show-legends-in-columns":_e="false","data-number-of-legend-columns":ha=4,"data-line-x-axis-tick-mode":fa="none","data-line-x-axis-tick-count":ga=10,"data-line-x-axis-tick-every":ba=1,pageModuleProps:g}=P;const xa=i,t=JSON.parse(decodeURIComponent(We)),[oe,wa]=h.useState(window.innerWidth<=1250),w=oe&&((t==null?void 0:t.showCustomization)??!1);g!=null&&g.previewMode&&(g!=null&&g.editing)&&(f=g.previewMode,i=g.editing);const va=["Tablet"].includes(f)&&i,ya=["Mobile"].includes(f)&&i,La=["Desktop"].includes(f)&&i,c=w&&f!=="Desktop",u=w&&!i,ne=()=>{const e=window.matchMedia("(min-width: 768px) and (max-width: 1250px)").matches,n=window.matchMedia("(max-width: 767px)").matches;switch(!0){case La:return m;case va:return w?(t==null?void 0:t.tabletXAxisTextRotation)??m:m;case ya:return w?(t==null?void 0:t.mobileXAxisTextRotation)??m:m;case e:return w?(t==null?void 0:t.tabletXAxisTextRotation)??m:m;case n:return w?(t==null?void 0:t.mobileXAxisTextRotation)??m:m;default:return m}},ka=ne(),[Ta,Je]=h.useState(ka),je=P.intl.locale,Y=h.useRef(null),Ke=e=>{try{return xa?e:decodeURIComponent(e)}catch{return console.error(`error decoding value:${e}`),e}},M=e=>{try{return JSON.parse(Ke(e))}catch{console.error(`error parsing value:${e}`)}return null},Ca=()=>{const e=M(zt);if(!e)return null;const n=e[r];if(r==="csv"&&n&&te==="manual"){const o={},p={};Object.keys(n).forEach(S=>{const x=n[S];typeof x=="string"?o[S]=x:typeof x=="object"&&x!==null&&(p[S]=x)});const y=p[z]||{};return{[z]:{...o,...y}}}return n},Ma=()=>M(mt),Qe=()=>{var e;if(a!=null&&a[r]){let n=(e=a==null?void 0:a[r])==null?void 0:e.format;if(!n){const o=Object.keys(a==null?void 0:a[r]);for(let p=0;p<o.length;p++)if(a!=null&&a[r][o[p]].selected&&(a!=null&&a[r][o[p]].format)){n=a==null?void 0:a[r][o[p]].format;break}}return n}return a!=null&&a.csv?a.csv.format:null},Ia=()=>{let e=null;return a!=null&&a[r]?a[r].useCustomAxisFormat&&a[r].customFormat&&(e=a[r].customFormat):a!=null&&a.csv&&a.csv.useCustomAxisFormat&&a.csv.customFormat&&(e=a.csv.customFormat),e},Ra=()=>a!=null&&a[r]?Object.keys(a[r]).map(e=>({value:e,...a[r][e]})).filter(e=>e.selected).map(e=>e.value):[],Ze=()=>{const e={};return a!=null&&a[r]&&Object.keys(a[r]).map(o=>({value:o,...a[r][o]})).filter(o=>o.selected&&o.hasCustomLabel).forEach(o=>{e[o.value]=o.customLabel}),e},Aa=()=>a!=null&&a[r]?Object.keys(a[r]).filter(e=>a[r][e].allowSelection):[];let a=Ma(),v=Ra(),b=Qe();const Da=Aa();let se=it,ie=Xt,de=Ke(yt);if(d!=null&&d[r]){const e=Object.keys(d[r].measures).map(n=>({value:n,...d[r].measures[n]})).filter(n=>n.selected).map(n=>n.value);a=d,v=e,b=Qe(),se=d.leftTitle,ie=d.rightTitle,d.customTooltip&&(de=d.customTooltip)}const Fa=b?{style:b.style==="compacted"?"decimal":b.style,notation:b.style==="compacted"?"compact":"standard",currency:b.currency,minimumFractionDigits:parseInt(b.minimumFractionDigits),maximumFractionDigits:parseInt(b.maximumFractionDigits)}:{notation:"standard",currency:"USD",minimumFractionDigits:2,maximumFractionDigits:2},Ba=Ia(),s=M(ea),Ea={style:(s==null?void 0:s.style)==="compacted"?"decimal":s==null?void 0:s.style,notation:(s==null?void 0:s.style)==="compacted"?"compact":"standard",currency:s==null?void 0:s.currency,minimumFractionDigits:parseInt(s==null?void 0:s.minimumFractionDigits),maximumFractionDigits:parseInt(s==null?void 0:s.maximumFractionDigits)},[Pa,wr]=h.useState(ve),qa=i?ve:Pa,Na={scheme:te,colorBy:z},_=i?V-80:V,za=()=>(c||u)&&!(t!=null&&t.showXAxisTitle)?"":lt,Xa=()=>c||u?t!=null&&t.showYAxisTitle?se:"":se,Sa=()=>c||u?t!=null&&t.showRightAxisTitle?ie:"":ie,Ga={left:Xa(),bottom:za(),right:Sa()},J=e=>{if(e==="true"||e===!0)return!0;if(e==="false"||e===!1)return!1},Oe=()=>{J(C)&&!J(T)?(C=!1,T=!0):!J(C)&&J(T)&&(C=!0,T=!1)},Va=()=>ae==="horizontal"?(Oe(),"vertical"):(Oe(),"horizontal"),Ua=()=>t!=null&&t.chartLayoutOverride?Va():ae,j=(e,n,o)=>e?Number.parseInt(n)??o:o,et=(e,n,o)=>e?n??o:o;h.useEffect(()=>{const e=()=>{wa(window.innerWidth<=1250);const n=ne();Je(n)};return window.addEventListener("resize",e),Je(ne()),()=>{window.removeEventListener("resize",e)}},[i,f,w,m,t==null?void 0:t.tabletXAxisTextRotation,t==null?void 0:t.mobileXAxisTextRotation]);const $a=()=>{const e=["tablet","mobile","midTablet"].includes(Oa.default());return i&&f==="Desktop"?xe:e?"bottom":xe},tt={app:r,editing:i,tickColor:decodeURIComponent(ut),tickRotation:Ta,layout:c||u?Ua():ae,reverse:ye==!0||ye=="true",showLegends:we==!0||we=="true",legendLabel:dt,swap:U==!0||U=="true",showGrid:Te==!0||Te=="true",showPercentage:Ye==!0||Ye=="true",marginLeft:j(c||u,Number.parseInt(t==null?void 0:t.marginLeft),parseInt(ht)),marginTop:j(c||u,Number.parseInt(t==null?void 0:t.marginTop),parseInt(ft)),marginRight:j(c||u,Number.parseInt(t==null?void 0:t.marginRight),Number.parseInt(gt)),marginBottom:j(c||u,Number.parseInt(t==null?void 0:t.marginBottom),Number.parseInt(bt)),height:`${_}px`,legendPosition:$a(),legends:Ga,tooltip:$==!0||$=="true"?de:de.replace(/\r\n/g,"<hr/>").replace(/[\r\n]/g,"<hr/>"),colors:Na,groupMode:st,format:Fa,startAngle:xt,endAngle:wt,offsetY:Lt,maxValue:Tt,valueScale:Ct,categories:G,lineLayerEnabled:Le==!0||Le=="true",overlays:M(kt)||[],barColor:decodeURIComponent(It),overrideTickColor:ke==!0||ke=="true",fixedMinValue:Rt,fixedMaxValue:At,barPadding:et(c||u,t==null?void 0:t.barPadding,Dt),barLabelPosition:Ft,lineLabelPosition:Bt,barInnerPadding:et(c||u,t==null?void 0:t.barInnerPadding,Et),xLabelColor:decodeURIComponent(Pt),barLabelColor:decodeURIComponent(qt),legendLabelColor:decodeURIComponent(Nt),tooltipEnabled:Me==!0||Me=="true",legendLabelBack:Re==!0||Re=="true",legendCheckBack:Ie==!0||Ie=="true",highlightXAxisLine:Ae==!0||Ae=="true",showTickLine:De==!0||De=="true",showRightAxis:Fe==!0||Fe=="true",offsetRight:St,offsetBottom:Gt,confidenceIntervals:M(Ut)||[],showPoints:Ee==!0||Ee=="true",enableArea:Be==!0||Be=="true",areaShadingCriteria:$t,areaLowerBound:Ht,areaUpperBound:Wt,showGroupTotal:Ne==!0||Ne=="true",groupTotalMeasure:Zt,groupTotalLabel:Ot,groupTotalFormat:Ea,groupTotalOffset:ta,groupTotalFixedPosition:ze==!0||ze=="true",centerLabel:Yt,showArcLabels:Pe==!0||Pe=="true",showArcLinkLabels:qe==!0||qe=="true",slicePadding:_t,centerLabelFontWeight:Jt,centerLabelFontSize:jt,centerLabelXOffset:Kt,centerLabelYOffset:Qt,userMeasures:Da,tooltipEnableMarkdown:$==!0||$=="true",yAxisTickValues:c||u?t.yAxisTickValues??Xe:Xe,xAxisTickValues:c||u?t.xAxisTickValues??Se:Se,lineXAxisTickMode:fa,lineXAxisTickCount:parseInt(ga)||10,lineXAxisTickEvery:parseInt(ba)||1,enableGridY:T==!0||T=="true",enableGridX:C==!0||C=="true",offsetText:aa,selectedMeasures:v,overallLabel:re,minMaxClamp:ra,reverseLegend:Ge==!0||Ge=="true",customAxisFormat:Ba,sort:Ve,sortReverse:H==!0||H=="true",sortReverseSecondDimension:W==!0||W=="true",radarCurve:oa,radarFillOpacity:na,radarBorderWidth:sa,radarGridLevels:ia,radarGridShape:da,radarGridLabelOffset:la,radarEnableDots:$e==!0||$e=="true",radarDotSize:ca,radarEnableDotLabel:He==!0||He=="true",radarDotLabelOffset:ua,sortSecondDimension:Ue,mobileCustomization:We,dimension1:N,previewMode:f,lineCurve:pa,showLegendsInColumns:_e==!0||_e=="true",numberOfLegendColumns:parseInt(ha)||4},le={},ce=M(vt)||{};ce&&ce.forEach&&ce.forEach(e=>{e.value!=null&&e.value.filter(n=>n!=null&&n.toString().trim()!="").length>0&&(le[e.param]=e.value)}),fe&&(le.dvzProxyDatasetId=fe);let I=null,R=null;if(r==="csv")I=nr.default;else switch(q){case"line":I=O.default.LineDataFrame;break;case"pie":I=O.default.PieDataFrame;break;case"radar":I=O.default.BarDataFrame;break;default:I=O.default.BarDataFrame;break}let A=!1;switch(q){case"bar":R=ar.default,A=r!="csv"&&N=="none"&&v.length==0;break;case"line":R=rr.default,A=r!=="csv"&&(v.length===0||N==="none");break;case"pie":A=r!="csv"&&v.length==0,R=er.default;break;case"radar":A=r!="csv"&&v.length==0,R=tr.default;break;default:R=l.jsx("div",{children:"No Chart"});break}const Ha=ct==="true",X=[];N!="none"&&X.push(N),be!="none"&&X.push(be);const[at,Wa]=h.useState(0),[vr,Ya]=h.useState(rt());function rt(){var e;return((e=window.screen.orientation)==null?void 0:e.type)||(window.innerWidth>window.innerHeight?"landscape-primary":"portrait-primary")}return h.useEffect(()=>{const e=setTimeout(()=>{oe&&(()=>{const o=Y.current.querySelector(".legends.container.has-standard-12-font-size.bottom")||Y.current.querySelector(".legends.container.items-section:not(.legends.container.top .items-section)");if(!o||o.closest(".legends.container.top"))return;const{clientHeight:p}=o,y=window.getComputedStyle(o),S=parseInt(y.marginTop),x=parseInt(y.marginBottom),_a=parseInt(y.paddingTop),Ja=parseInt(y.paddingBottom),ja=p+S+x+_a+Ja,ot=o.closest(".ui.fluid.container.content");if(ot){const L=ot.querySelector(".data-source");if(L){const D=L.getBoundingClientRect(),F=o.getBoundingClientRect();if(F.bottom!==0&&D.top!==0){if(o.textContent.trim()==="")return;const K=x,Q=F.bottom+K,me=window.getComputedStyle(L),Z=parseFloat(me.marginTop)||0,B=D.top-Z;if(Q>B){let E=Q-B;E<5&&(E+=1),L.style.marginTop=`${E+1}px`}}else setTimeout(()=>{D.top<F.bottom&&(L.style.marginTop=`${F.bottom-D.top+1}px`)},1e3)}}const ue=o.closest(".chart.container");if(ue){const L=ue.getBoundingClientRect(),D=window.getComputedStyle(ue),F=Number.parseFloat(D.marginBottom)||0,K=L.bottom+F,Q=o.getBoundingClientRect(),me=Number.parseFloat(y.marginTop)||0,Z=Q.top-me;if(Z<K){const B=K-Z,E=200,Ka=Math.min(B+1,E);B>0&&B<E&&(o.style.marginTop=`${Ka}px`)}}Wa(ja)})()},100);return()=>{clearTimeout(e)}},[oe,Y]),h.useEffect(()=>{const e=()=>{setTimeout(()=>{Ya(rt())},100)};return window.screen.orientation?window.screen.orientation.addEventListener("change",e):window.addEventListener("resize",e),()=>{window.screen.orientation?window.screen.orientation.removeEventListener("change",e):window.removeEventListener("resize",e)}},[]),l.jsx("div",{ref:Y,children:l.jsxs(pe.Container,{className:"chart container",style:{minHeight:q==="pie"&&window.innerWidth<=480?`${parseInt(V)+parseInt(at)*.5}px`:`${parseInt(V)+parseInt(at)}px`},fluid:!0,children:[l.jsx(Qa.default,{editing:i,style:{height:`${_}px`},params:le,waitForFilters:ma==="true",app:r,group:ge,csv:pt,store:[r,ee,...X],source:X.join("/"),children:l.jsxs(pe.Container,{style:{height:`${_}px`},className:"body",fluid:!0,children:[A&&l.jsx(nt.default,{editing:i}),!A&&l.jsxs(Za.default,{children:[l.jsx(nt.default,{app:r,group:ge,noDataMsg:Mt,children:" "}),l.jsx(I,{locale:je,colorBy:z,hiddenBars:Vt,swap:U==="true"||U===!0,type:q,includeTotal:!0,includeOverall:Ce===!0||Ce==="true",overallLabel:re,measures:v,dimensions:[...X],sort:Ve,sortReverse:H===!0||H==="true",sortSecondDimension:Ue,sortReverseSecondDimension:W===!0||W==="true",customLabels:Ze(),children:l.jsx(sr.default,{type:q,app:r,locale:je,overallLabel:re,customLabels:Ze(),manualColors:Ca(),colorBy:z,scheme:te,barColor:tt.barColor,children:l.jsx(R,{...tt})})})]})]})}),l.jsx("br",{}),Ha&&k&&qa==="info"&&l.jsx(pe.Container,{fluid:!0,style:{height:_+"px"},className:"body",children:l.jsx(or.PostContent,{post:{content:{rendered:k}}})})]})})},cr=(P,he)=>{const{"data-app":i,"data-group":ee}=he,k=P.getIn(["data","measures",i,ee]),G=P.getIn(["data","pageModuleProps"]),d={};return k&&Object.keys(k).length>0&&(d.injectedMeasures=k??{}),G&&(d.pageModuleProps=G),d},ur={},mr=ir.connect(cr,ur)(dr.injectIntl(lr));exports.default=mr;
@@ -1,6 +1,6 @@
1
- import { jsx as p, jsxs as ue } from "react/jsx-runtime";
2
- import { useState as X, useRef as ja, useEffect as me } from "react";
3
- import { Container as pe } from "semantic-ui-react";
1
+ import { jsx as m, jsxs as pe } from "react/jsx-runtime";
2
+ import { useState as V, useRef as ja, useEffect as he } from "react";
3
+ import { Container as fe } from "semantic-ui-react";
4
4
  import er from "../data/DataProvider.js";
5
5
  import tr from "../data/DataConsumer.js";
6
6
  import ar from "../../utils/deviceType.js";
@@ -10,246 +10,246 @@ import or from "./Radar.js";
10
10
  import nr from "./Bar.js";
11
11
  import ir from "./Line.js";
12
12
  import { PostContent as sr } from "@devgateway/wp-react-lib";
13
- import Z from "./data/index.js";
14
- import lr from "./CSVDataFrame.js";
15
- import dr from "./colors/ColorProvider.js";
16
- import it from "./Messages.js";
13
+ import j from "./data/index.js";
14
+ import dr from "./CSVDataFrame.js";
15
+ import lr from "./colors/ColorProvider.js";
16
+ import st from "./Messages.js";
17
17
  import { connect as cr } from "react-redux";
18
18
  import { injectIntl as ur } from "react-intl";
19
- const mr = (v) => {
20
- console.log("manual colors...", v["data-manual-colors"]);
19
+ const mr = (P) => {
21
20
  let {
22
- parent: he,
21
+ parent: ge,
23
22
  editing: s = !1,
24
- unique: O,
25
- childContent: y,
26
- categories: V,
27
- injectedMeasures: l,
28
- "data-app": o = "csv",
29
- "data-dvz-proxy-dataset-id": ge,
30
- "data-group": fe = "default",
31
- "data-height": G = 500,
32
- "data-type": B = "bar",
23
+ unique: ee,
24
+ childContent: L,
25
+ categories: U,
26
+ injectedMeasures: d,
27
+ "data-app": r = "csv",
28
+ "data-dvz-proxy-dataset-id": be,
29
+ "data-group": we = "default",
30
+ "data-height": S = 500,
31
+ "data-type": E = "bar",
33
32
  //'data-source': source = 'gender/smoke',f
34
- "data-dimension1": P,
35
- "data-dimension2": be,
36
- "data-dimension3": gr,
37
- "data-color-by": E = "index",
38
- "data-scheme": j = "system",
39
- "data-group-mode": st = "grouped",
33
+ "data-dimension1": N,
34
+ "data-dimension2": xe,
35
+ "data-dimension3": fr,
36
+ "data-color-by": z = "index",
37
+ "data-scheme": te = "system",
38
+ "data-group-mode": dt = "grouped",
40
39
  "data-left-legend": lt = "Left Legend",
41
- "data-legend-label": dt = "",
42
- "data-bottom-legend": ct = "Bottom Legend",
43
- "data-dualmode": ut,
44
- "data-legend-position": we = "right",
45
- "data-show-legends": xe = "true",
46
- "data-data-source-label": fr = "Source",
40
+ "data-legend-label": ct = "",
41
+ "data-bottom-legend": ut = "Bottom Legend",
42
+ "data-dualmode": mt,
43
+ "data-legend-position": ve = "right",
44
+ "data-show-legends": ye = "true",
45
+ "data-data-source-label": gr = "Source",
47
46
  "data-chart-data-source": br = "Data Source",
48
47
  "data-toggle-info-label": wr = "Info Graphic",
49
48
  "data-toggle-chart-label": xr = "Chart",
50
49
  //'data-number-format': format = '{"style":"percent", "minimumFractionDigits": 1, "maximumFractionDigits": 1}',
51
50
  "data-tick-rotation": u = 0,
52
- "data-tick-color": mt = "rgb(92,93,99)",
53
- "data-measures": pt = "{}",
51
+ "data-tick-color": pt = "rgb(92,93,99)",
52
+ "data-measures": ht = "{}",
54
53
  "data-format": vr = "{}",
55
- "data-csv": ht = "",
54
+ "data-csv": ft = "",
56
55
  "data-margin-left": gt = 50,
57
- "data-margin-top": ft = 25,
58
- "data-margin-right": bt = 25,
59
- "data-margin-bottom": wt = 25,
60
- "data-start-angle": xt = 0,
61
- "data-end-angle": vt = 360,
62
- "data-view-mode": ve = "info",
63
- "data-filters": yt = "[]",
56
+ "data-margin-top": bt = 25,
57
+ "data-margin-right": wt = 25,
58
+ "data-margin-bottom": xt = 25,
59
+ "data-start-angle": vt = 0,
60
+ "data-end-angle": yt = 360,
61
+ "data-view-mode": Le = "info",
62
+ "data-filters": Lt = "[]",
64
63
  //filters
65
- "data-tooltip-html": Lt = "",
66
- "data-layout": ee = "vertical",
67
- "data-reverse": ye = "false",
68
- "data-offset-y": kt = "-40",
69
- "data-line-layer-enabled": Le = "false",
64
+ "data-tooltip-html": kt = "",
65
+ "data-layout": ae = "vertical",
66
+ "data-reverse": ke = "false",
67
+ "data-offset-y": Tt = "-40",
68
+ "data-line-layer-enabled": Te = "false",
70
69
  //"data-csv-line-layer-data": csvLineLayerData = "",
71
70
  //"data-csv-line-color": lineColor = "#000000",
72
71
  //"data-csv-line-tooltip": lineTooltip = "",
73
72
  //"data-csv-line-title": lineTitle = "",
74
- "data-overlays": Tt = "[]",
75
- "data-max-value": Ct = "auto",
76
- "data-value-scale": At = "linear",
77
- "data-swap": U = "false",
78
- "data-no-data-message": It = "No data matches your selection",
79
- "data-bar-color": Mt = "rgb(0,0,0)",
80
- "data-override-tick-color": ke = "false",
81
- "data-fixed-min-value": Dt = 0,
82
- "data-fixed-max-value": Rt = 0,
83
- "data-bar-padding": Ft = 0.15,
84
- "data-bar-label-position": Bt = "middle",
85
- "data-line-label-position": Pt = "none",
86
- "data-show-grid": Te = "true",
87
- "data-include-overall": Ce = "false",
88
- "data-bar-inner-padding": Et = 0.7,
89
- "data-x-label-color": Nt = "#000",
90
- "data-bar-label-color": zt = "#000",
91
- "data-legend-label-color": Xt = "#000",
73
+ "data-overlays": Ct = "[]",
74
+ "data-max-value": It = "auto",
75
+ "data-value-scale": Mt = "linear",
76
+ "data-swap": $ = "false",
77
+ "data-no-data-message": At = "No data matches your selection",
78
+ "data-bar-color": Dt = "rgb(0,0,0)",
79
+ "data-override-tick-color": Ce = "false",
80
+ "data-fixed-min-value": Rt = 0,
81
+ "data-fixed-max-value": Ft = 0,
82
+ "data-bar-padding": Bt = 0.15,
83
+ "data-bar-label-position": Pt = "middle",
84
+ "data-line-label-position": Et = "none",
85
+ "data-show-grid": Ie = "true",
86
+ "data-include-overall": Me = "false",
87
+ "data-bar-inner-padding": Nt = 0.7,
88
+ "data-x-label-color": zt = "#000",
89
+ "data-bar-label-color": Xt = "#000",
90
+ "data-legend-label-color": Gt = "#000",
92
91
  "data-tooltip-enabled": Ae = "true",
93
- "data-use-check-box-background": Ie = "false",
94
- "data-use-label-background": Me = "true",
95
- "data-highlight-xaxis-line": De = "false",
96
- "data-show-tick-line": Re = "true",
97
- "data-show-right-axis": Fe = "true",
92
+ "data-use-check-box-background": De = "false",
93
+ "data-use-label-background": Re = "true",
94
+ "data-highlight-xaxis-line": Fe = "false",
95
+ "data-show-tick-line": Be = "true",
96
+ "data-show-right-axis": Pe = "true",
98
97
  "data-manual-colors": Vt = "{}",
99
- "data-right-legend": Gt = "",
100
- "data-offset-right": Ut = "40",
98
+ "data-right-legend": Ut = "",
99
+ "data-offset-right": St = "40",
101
100
  "data-offset-bottom": $t = "40",
102
- "data-hidden-bars": St = [],
103
- "data-confidence-intervals": Ht = "[]",
104
- "data-enable-area": Be = "false",
105
- "data-area-shading-criteria": Wt = "DEFAULT",
106
- "data-area-lower-bound": Yt = "",
107
- "data-area-upper-bound": qt = "",
108
- "data-show-points": Pe = "true",
109
- "data-center-label": Jt = "",
110
- "data-show-arc-labels": Ee = "true",
111
- "data-show-arc-link-labels": Ne = "true",
112
- "data-slice-padding": _t = 1,
113
- "data-center-label-font-weight": Kt = "normal",
114
- "data-center-label-font-size": Qt = "12",
115
- "data-center-label-xoffset": Zt = 0,
116
- "data-center-label-yoffset": Ot = 0,
117
- "data-group-total-measure": jt = "",
118
- "data-show-group-total": ze = "true",
119
- "data-group-total-label": ea = "",
120
- "data-group-total-format": ta = "{}",
121
- "data-group-total-label-offset": aa,
122
- "data-group-total-fixed-position": Xe = "false",
123
- "data-tooltip-enable-markdown": $ = "false",
124
- "data-y-axis-tick-values": Ve = "10",
125
- "data-x-axis-tick-values": Ge = "10",
126
- "data-enable-grid-y": L = "true",
127
- "data-enable-grid-x": k = "false",
128
- "data-offset-text": ra = 0,
129
- "data-overall-label": te = "Overall",
130
- "data-min-max-clamp": oa = "false",
131
- "data-reverse-legend": Ue = "false",
132
- "data-sort": $e = "default",
133
- "data-sort-reverse": S = "false",
134
- "data-sort-second-dimension": Se = "default",
135
- "data-sort-reverse-second-dimension": H = "false",
136
- "data-radar-curve": na = "linearClosed",
137
- "data-radar-fill-opacity": ia = 0.25,
138
- "data-radar-border-width": sa = 2,
101
+ "data-hidden-bars": Ht = [],
102
+ "data-confidence-intervals": Wt = "[]",
103
+ "data-enable-area": Ee = "false",
104
+ "data-area-shading-criteria": Yt = "DEFAULT",
105
+ "data-area-lower-bound": qt = "",
106
+ "data-area-upper-bound": Jt = "",
107
+ "data-show-points": Ne = "true",
108
+ "data-center-label": _t = "",
109
+ "data-show-arc-labels": ze = "true",
110
+ "data-show-arc-link-labels": Xe = "true",
111
+ "data-slice-padding": Kt = 1,
112
+ "data-center-label-font-weight": Qt = "normal",
113
+ "data-center-label-font-size": Zt = "12",
114
+ "data-center-label-xoffset": Ot = 0,
115
+ "data-center-label-yoffset": jt = 0,
116
+ "data-group-total-measure": ea = "",
117
+ "data-show-group-total": Ge = "true",
118
+ "data-group-total-label": ta = "",
119
+ "data-group-total-format": aa = "{}",
120
+ "data-group-total-label-offset": ra,
121
+ "data-group-total-fixed-position": Ve = "false",
122
+ "data-tooltip-enable-markdown": H = "false",
123
+ "data-y-axis-tick-values": Ue = "10",
124
+ "data-x-axis-tick-values": Se = "10",
125
+ "data-enable-grid-y": k = "true",
126
+ "data-enable-grid-x": T = "false",
127
+ "data-offset-text": oa = 0,
128
+ "data-overall-label": re = "Overall",
129
+ "data-min-max-clamp": na = "false",
130
+ "data-reverse-legend": $e = "false",
131
+ "data-sort": He = "default",
132
+ "data-sort-reverse": W = "false",
133
+ "data-sort-second-dimension": We = "default",
134
+ "data-sort-reverse-second-dimension": Y = "false",
135
+ "data-radar-curve": ia = "linearClosed",
136
+ "data-radar-fill-opacity": sa = 0.25,
137
+ "data-radar-border-width": da = 2,
139
138
  "data-radar-grid-levels": la = 3,
140
- "data-radar-grid-shape": da = "circular",
141
- "data-radar-grid-label-offset": ca = 36,
142
- "data-radar-enable-dots": He = "true",
143
- "data-radar-dot-size": ua = 8,
144
- "data-radar-enable-dot-label": We = "true",
145
- "data-radar-dot-label-offset": ma = -12,
146
- "data-mobile-customization": Ye = "{}",
147
- "data-show-percentage": qe = "false",
139
+ "data-radar-grid-shape": ca = "circular",
140
+ "data-radar-grid-label-offset": ua = 36,
141
+ "data-radar-enable-dots": Ye = "true",
142
+ "data-radar-dot-size": ma = 8,
143
+ "data-radar-enable-dot-label": qe = "true",
144
+ "data-radar-dot-label-offset": pa = -12,
145
+ "data-mobile-customization": Je = "{}",
146
+ "data-show-percentage": _e = "false",
148
147
  "data-preview-mode": h = "Desktop",
149
- "data-wait-for-filters": pa = "false",
150
- "data-line-curve": ha = "linear",
151
- "data-show-legends-in-columns": Je = "false",
148
+ "data-wait-for-filters": ha = "false",
149
+ "data-line-curve": fa = "linear",
150
+ "data-show-legends-in-columns": Ke = "false",
152
151
  "data-number-of-legend-columns": ga = 4,
153
- "data-line-x-axis-tick-mode": fa = "none",
154
- "data-line-x-axis-tick-count": ba = 10,
155
- "data-line-x-axis-tick-every": wa = 1,
156
- pageModuleProps: g
157
- } = v;
158
- const xa = s, t = JSON.parse(
159
- decodeURIComponent(Ye)
160
- ), [ae, va] = X(
152
+ "data-line-x-axis-tick-mode": ba = "none",
153
+ "data-line-x-axis-tick-count": wa = 10,
154
+ "data-line-x-axis-tick-every": xa = 1,
155
+ pageModuleProps: f
156
+ } = P;
157
+ const va = s, t = JSON.parse(
158
+ decodeURIComponent(Je)
159
+ ), [oe, ya] = V(
161
160
  window.innerWidth <= 1250
162
- ), b = ae && ((t == null ? void 0 : t.showCustomization) ?? !1);
163
- g != null && g.previewMode && (g != null && g.editing) && (h = g.previewMode, s = g.editing);
164
- const ya = ["Tablet"].includes(h) && s, La = ["Mobile"].includes(h) && s, ka = ["Desktop"].includes(h) && s, d = b && h !== "Desktop", c = b && !s, re = () => {
161
+ ), w = oe && ((t == null ? void 0 : t.showCustomization) ?? !1);
162
+ f != null && f.previewMode && (f != null && f.editing) && (h = f.previewMode, s = f.editing);
163
+ const La = ["Tablet"].includes(h) && s, ka = ["Mobile"].includes(h) && s, Ta = ["Desktop"].includes(h) && s, l = w && h !== "Desktop", c = w && !s, ne = () => {
165
164
  const e = window.matchMedia(
166
165
  "(min-width: 768px) and (max-width: 1250px)"
167
- ).matches, r = window.matchMedia("(max-width: 767px)").matches;
166
+ ).matches, n = window.matchMedia("(max-width: 767px)").matches;
168
167
  switch (!0) {
169
- case ka:
168
+ case Ta:
170
169
  return u;
171
- case ya:
172
- return b ? (t == null ? void 0 : t.tabletXAxisTextRotation) ?? u : u;
173
170
  case La:
174
- return b ? (t == null ? void 0 : t.mobileXAxisTextRotation) ?? u : u;
171
+ return w ? (t == null ? void 0 : t.tabletXAxisTextRotation) ?? u : u;
172
+ case ka:
173
+ return w ? (t == null ? void 0 : t.mobileXAxisTextRotation) ?? u : u;
175
174
  case e:
176
- return b ? (t == null ? void 0 : t.tabletXAxisTextRotation) ?? u : u;
177
- case r:
178
- return b ? (t == null ? void 0 : t.mobileXAxisTextRotation) ?? u : u;
175
+ return w ? (t == null ? void 0 : t.tabletXAxisTextRotation) ?? u : u;
176
+ case n:
177
+ return w ? (t == null ? void 0 : t.mobileXAxisTextRotation) ?? u : u;
179
178
  default:
180
179
  return u;
181
180
  }
182
- }, Ta = re(), [Ca, _e] = X(Ta), Ke = v.intl.locale, W = ja(null), Qe = (e) => {
181
+ }, Ca = ne(), [Ia, Qe] = V(Ca), Ze = P.intl.locale, q = ja(null), Oe = (e) => {
183
182
  try {
184
- return xa ? e : decodeURIComponent(e);
183
+ return va ? e : decodeURIComponent(e);
185
184
  } catch {
186
185
  return console.error(`error decoding value:${e}`), e;
187
186
  }
188
- }, T = (e) => {
187
+ }, C = (e) => {
189
188
  try {
190
- return JSON.parse(Qe(e));
189
+ return JSON.parse(Oe(e));
191
190
  } catch {
192
191
  console.error(`error parsing value:${e}`);
193
192
  }
194
193
  return null;
195
- }, Aa = () => {
196
- const e = T(Vt);
194
+ }, Ma = () => {
195
+ const e = C(Vt);
197
196
  if (!e) return null;
198
- const r = e[o];
199
- if (o === "csv" && r && j === "manual") {
200
- if (r[E] !== void 0)
201
- return r;
202
- if (typeof r == "object" && r !== null && !Array.isArray(r) && Object.values(r).some(
203
- (m) => typeof m == "string" && (m.startsWith("#") || m.startsWith("rgb"))
204
- ))
205
- return { [E]: r };
197
+ const n = e[r];
198
+ if (r === "csv" && n && te === "manual") {
199
+ const o = {}, p = {};
200
+ Object.keys(n).forEach((G) => {
201
+ const b = n[G];
202
+ typeof b == "string" ? o[G] = b : typeof b == "object" && b !== null && (p[G] = b);
203
+ });
204
+ const v = p[z] || {};
205
+ return { [z]: { ...o, ...v } };
206
206
  }
207
- return r;
208
- }, Ia = () => T(pt), Ze = () => {
207
+ return n;
208
+ }, Aa = () => C(ht), je = () => {
209
209
  var e;
210
- if (a != null && a[o]) {
211
- let r = (e = a == null ? void 0 : a[o]) == null ? void 0 : e.format;
212
- if (!r) {
213
- const n = Object.keys(a == null ? void 0 : a[o]);
214
- for (let m = 0; m < n.length; m++)
215
- if (a != null && a[o][n[m]].selected && (a != null && a[o][n[m]].format)) {
216
- r = a == null ? void 0 : a[o][n[m]].format;
210
+ if (a != null && a[r]) {
211
+ let n = (e = a == null ? void 0 : a[r]) == null ? void 0 : e.format;
212
+ if (!n) {
213
+ const o = Object.keys(a == null ? void 0 : a[r]);
214
+ for (let p = 0; p < o.length; p++)
215
+ if (a != null && a[r][o[p]].selected && (a != null && a[r][o[p]].format)) {
216
+ n = a == null ? void 0 : a[r][o[p]].format;
217
217
  break;
218
218
  }
219
219
  }
220
- return r;
220
+ return n;
221
221
  }
222
222
  return a != null && a.csv ? a.csv.format : null;
223
- }, Ma = () => {
223
+ }, Da = () => {
224
224
  let e = null;
225
- return a != null && a[o] ? a[o].useCustomAxisFormat && a[o].customFormat && (e = a[o].customFormat) : a != null && a.csv && a.csv.useCustomAxisFormat && a.csv.customFormat && (e = a.csv.customFormat), e;
226
- }, Da = () => a != null && a[o] ? Object.keys(a[o]).map((e) => ({ value: e, ...a[o][e] })).filter((e) => e.selected).map((e) => e.value) : [], Oe = () => {
225
+ return a != null && a[r] ? a[r].useCustomAxisFormat && a[r].customFormat && (e = a[r].customFormat) : a != null && a.csv && a.csv.useCustomAxisFormat && a.csv.customFormat && (e = a.csv.customFormat), e;
226
+ }, Ra = () => a != null && a[r] ? Object.keys(a[r]).map((e) => ({ value: e, ...a[r][e] })).filter((e) => e.selected).map((e) => e.value) : [], et = () => {
227
227
  const e = {};
228
- return a != null && a[o] && Object.keys(a[o]).map((n) => ({ value: n, ...a[o][n] })).filter((n) => n.selected && n.hasCustomLabel).forEach((n) => {
229
- e[n.value] = n.customLabel;
228
+ return a != null && a[r] && Object.keys(a[r]).map((o) => ({ value: o, ...a[r][o] })).filter((o) => o.selected && o.hasCustomLabel).forEach((o) => {
229
+ e[o.value] = o.customLabel;
230
230
  }), e;
231
- }, Ra = () => a != null && a[o] ? Object.keys(a[o]).filter(
232
- (e) => a[o][e].allowSelection
231
+ }, Fa = () => a != null && a[r] ? Object.keys(a[r]).filter(
232
+ (e) => a[r][e].allowSelection
233
233
  ) : [];
234
- let a = Ia(), w = Da(), f = Ze();
235
- const Fa = Ra();
236
- let oe = lt, ne = Gt, ie = Qe(Lt);
237
- if (l != null && l[o]) {
238
- const e = Object.keys(l[o].measures).map((r) => ({ value: r, ...l[o].measures[r] })).filter((r) => r.selected).map((r) => r.value);
239
- a = l, w = e, f = Ze(), oe = l.leftTitle, ne = l.rightTitle, l.customTooltip && (ie = l.customTooltip);
234
+ let a = Aa(), x = Ra(), g = je();
235
+ const Ba = Fa();
236
+ let ie = lt, se = Ut, de = Oe(kt);
237
+ if (d != null && d[r]) {
238
+ const e = Object.keys(d[r].measures).map((n) => ({ value: n, ...d[r].measures[n] })).filter((n) => n.selected).map((n) => n.value);
239
+ a = d, x = e, g = je(), ie = d.leftTitle, se = d.rightTitle, d.customTooltip && (de = d.customTooltip);
240
240
  }
241
- const Ba = f ? {
242
- style: f.style === "compacted" ? "decimal" : f.style,
243
- notation: f.style === "compacted" ? "compact" : "standard",
244
- currency: f.currency,
245
- minimumFractionDigits: parseInt(f.minimumFractionDigits),
246
- maximumFractionDigits: parseInt(f.maximumFractionDigits)
241
+ const Pa = g ? {
242
+ style: g.style === "compacted" ? "decimal" : g.style,
243
+ notation: g.style === "compacted" ? "compact" : "standard",
244
+ currency: g.currency,
245
+ minimumFractionDigits: parseInt(g.minimumFractionDigits),
246
+ maximumFractionDigits: parseInt(g.maximumFractionDigits)
247
247
  } : {
248
248
  notation: "standard",
249
249
  currency: "USD",
250
250
  minimumFractionDigits: 2,
251
251
  maximumFractionDigits: 2
252
- }, Pa = Ma(), i = T(ta), Ea = {
252
+ }, Ea = Da(), i = C(aa), Na = {
253
253
  style: (i == null ? void 0 : i.style) === "compacted" ? "decimal" : i == null ? void 0 : i.style,
254
254
  notation: (i == null ? void 0 : i.style) === "compacted" ? "compact" : "standard",
255
255
  currency: i == null ? void 0 : i.currency,
@@ -259,337 +259,337 @@ const mr = (v) => {
259
259
  maximumFractionDigits: parseInt(
260
260
  i == null ? void 0 : i.maximumFractionDigits
261
261
  )
262
- }, [Na, yr] = X(ve), za = s ? ve : Na, Xa = {
263
- scheme: j,
264
- colorBy: E
265
- }, Y = s ? G - 80 : G, Va = () => (d || c) && !(t != null && t.showXAxisTitle) ? "" : ct, Ga = () => d || c ? t != null && t.showYAxisTitle ? oe : "" : oe, Ua = () => d || c ? t != null && t.showRightAxisTitle ? ne : "" : ne, $a = {
266
- left: Ga(),
262
+ }, [za, yr] = V(Le), Xa = s ? Le : za, Ga = {
263
+ scheme: te,
264
+ colorBy: z
265
+ }, J = s ? S - 80 : S, Va = () => (l || c) && !(t != null && t.showXAxisTitle) ? "" : ut, Ua = () => l || c ? t != null && t.showYAxisTitle ? ie : "" : ie, Sa = () => l || c ? t != null && t.showRightAxisTitle ? se : "" : se, $a = {
266
+ left: Ua(),
267
267
  bottom: Va(),
268
- right: Ua()
269
- }, q = (e) => {
268
+ right: Sa()
269
+ }, _ = (e) => {
270
270
  if (e === "true" || e === !0)
271
271
  return !0;
272
272
  if (e === "false" || e === !1)
273
273
  return !1;
274
- }, je = () => {
275
- q(k) && !q(L) ? (k = !1, L = !0) : !q(k) && q(L) && (k = !0, L = !1);
276
- }, Sa = () => ee === "horizontal" ? (je(), "vertical") : (je(), "horizontal"), Ha = () => t != null && t.chartLayoutOverride ? Sa() : ee, J = (e, r, n) => e ? Number.parseInt(r) ?? n : n, et = (e, r, n) => e ? r ?? n : n;
277
- me(() => {
274
+ }, tt = () => {
275
+ _(T) && !_(k) ? (T = !1, k = !0) : !_(T) && _(k) && (T = !0, k = !1);
276
+ }, Ha = () => ae === "horizontal" ? (tt(), "vertical") : (tt(), "horizontal"), Wa = () => t != null && t.chartLayoutOverride ? Ha() : ae, K = (e, n, o) => e ? Number.parseInt(n) ?? o : o, at = (e, n, o) => e ? n ?? o : o;
277
+ he(() => {
278
278
  const e = () => {
279
- va(window.innerWidth <= 1250);
280
- const r = re();
281
- _e(r);
279
+ ya(window.innerWidth <= 1250);
280
+ const n = ne();
281
+ Qe(n);
282
282
  };
283
- return window.addEventListener("resize", e), _e(re()), () => {
283
+ return window.addEventListener("resize", e), Qe(ne()), () => {
284
284
  window.removeEventListener("resize", e);
285
285
  };
286
286
  }, [
287
287
  s,
288
288
  h,
289
- b,
289
+ w,
290
290
  u,
291
291
  t == null ? void 0 : t.tabletXAxisTextRotation,
292
292
  t == null ? void 0 : t.mobileXAxisTextRotation
293
293
  ]);
294
- const Wa = () => {
294
+ const Ya = () => {
295
295
  const e = ["tablet", "mobile", "midTablet"].includes(
296
296
  ar()
297
297
  );
298
- return s && h === "Desktop" ? we : e ? "bottom" : we;
299
- }, tt = {
300
- app: o,
298
+ return s && h === "Desktop" ? ve : e ? "bottom" : ve;
299
+ }, rt = {
300
+ app: r,
301
301
  editing: s,
302
- tickColor: decodeURIComponent(mt),
303
- tickRotation: Ca,
304
- layout: d || c ? Ha() : ee,
305
- reverse: ye == !0 || ye == "true",
306
- showLegends: xe == !0 || xe == "true",
307
- legendLabel: dt,
308
- swap: U == !0 || U == "true",
309
- showGrid: Te == !0 || Te == "true",
310
- showPercentage: qe == !0 || qe == "true",
311
- marginLeft: J(
312
- d || c,
302
+ tickColor: decodeURIComponent(pt),
303
+ tickRotation: Ia,
304
+ layout: l || c ? Wa() : ae,
305
+ reverse: ke == !0 || ke == "true",
306
+ showLegends: ye == !0 || ye == "true",
307
+ legendLabel: ct,
308
+ swap: $ == !0 || $ == "true",
309
+ showGrid: Ie == !0 || Ie == "true",
310
+ showPercentage: _e == !0 || _e == "true",
311
+ marginLeft: K(
312
+ l || c,
313
313
  Number.parseInt(t == null ? void 0 : t.marginLeft),
314
314
  parseInt(gt)
315
315
  ),
316
- marginTop: J(
317
- d || c,
316
+ marginTop: K(
317
+ l || c,
318
318
  Number.parseInt(t == null ? void 0 : t.marginTop),
319
- parseInt(ft)
319
+ parseInt(bt)
320
320
  ),
321
- marginRight: J(
322
- d || c,
321
+ marginRight: K(
322
+ l || c,
323
323
  Number.parseInt(t == null ? void 0 : t.marginRight),
324
- Number.parseInt(bt)
324
+ Number.parseInt(wt)
325
325
  ),
326
- marginBottom: J(
327
- d || c,
326
+ marginBottom: K(
327
+ l || c,
328
328
  Number.parseInt(t == null ? void 0 : t.marginBottom),
329
- Number.parseInt(wt)
329
+ Number.parseInt(xt)
330
330
  ),
331
- height: `${Y}px`,
332
- legendPosition: Wa(),
331
+ height: `${J}px`,
332
+ legendPosition: Ya(),
333
333
  legends: $a,
334
- tooltip: $ == !0 || $ == "true" ? ie : ie.replace(/\r\n/g, "<hr/>").replace(/[\r\n]/g, "<hr/>"),
335
- colors: Xa,
336
- groupMode: st,
337
- format: Ba,
338
- startAngle: xt,
339
- endAngle: vt,
340
- offsetY: kt,
334
+ tooltip: H == !0 || H == "true" ? de : de.replace(/\r\n/g, "<hr/>").replace(/[\r\n]/g, "<hr/>"),
335
+ colors: Ga,
336
+ groupMode: dt,
337
+ format: Pa,
338
+ startAngle: vt,
339
+ endAngle: yt,
340
+ offsetY: Tt,
341
341
  // csvLineLayerData,
342
342
  // lineColor: decodeURIComponent(lineColor),
343
343
  // lineTooltip,
344
344
  // lineTitle,
345
- maxValue: Ct,
346
- valueScale: At,
347
- categories: V,
348
- lineLayerEnabled: Le == !0 || Le == "true",
349
- overlays: T(Tt) || [],
350
- barColor: decodeURIComponent(Mt),
351
- overrideTickColor: ke == !0 || ke == "true",
352
- fixedMinValue: Dt,
353
- fixedMaxValue: Rt,
354
- barPadding: et(
355
- d || c,
345
+ maxValue: It,
346
+ valueScale: Mt,
347
+ categories: U,
348
+ lineLayerEnabled: Te == !0 || Te == "true",
349
+ overlays: C(Ct) || [],
350
+ barColor: decodeURIComponent(Dt),
351
+ overrideTickColor: Ce == !0 || Ce == "true",
352
+ fixedMinValue: Rt,
353
+ fixedMaxValue: Ft,
354
+ barPadding: at(
355
+ l || c,
356
356
  t == null ? void 0 : t.barPadding,
357
- Ft
357
+ Bt
358
358
  ),
359
- barLabelPosition: Bt,
360
- lineLabelPosition: Pt,
361
- barInnerPadding: et(
362
- d || c,
359
+ barLabelPosition: Pt,
360
+ lineLabelPosition: Et,
361
+ barInnerPadding: at(
362
+ l || c,
363
363
  t == null ? void 0 : t.barInnerPadding,
364
- Et
364
+ Nt
365
365
  ),
366
- xLabelColor: decodeURIComponent(Nt),
367
- barLabelColor: decodeURIComponent(zt),
368
- legendLabelColor: decodeURIComponent(Xt),
366
+ xLabelColor: decodeURIComponent(zt),
367
+ barLabelColor: decodeURIComponent(Xt),
368
+ legendLabelColor: decodeURIComponent(Gt),
369
369
  tooltipEnabled: Ae == !0 || Ae == "true",
370
- legendLabelBack: Me == !0 || Me == "true",
371
- legendCheckBack: Ie == !0 || Ie == "true",
372
- highlightXAxisLine: De == !0 || De == "true",
373
- showTickLine: Re == !0 || Re == "true",
374
- showRightAxis: Fe == !0 || Fe == "true",
375
- offsetRight: Ut,
370
+ legendLabelBack: Re == !0 || Re == "true",
371
+ legendCheckBack: De == !0 || De == "true",
372
+ highlightXAxisLine: Fe == !0 || Fe == "true",
373
+ showTickLine: Be == !0 || Be == "true",
374
+ showRightAxis: Pe == !0 || Pe == "true",
375
+ offsetRight: St,
376
376
  offsetBottom: $t,
377
- confidenceIntervals: T(Ht) || [],
378
- showPoints: Pe == !0 || Pe == "true",
379
- enableArea: Be == !0 || Be == "true",
380
- areaShadingCriteria: Wt,
381
- areaLowerBound: Yt,
382
- areaUpperBound: qt,
383
- showGroupTotal: ze == !0 || ze == "true",
384
- groupTotalMeasure: jt,
385
- groupTotalLabel: ea,
386
- groupTotalFormat: Ea,
387
- groupTotalOffset: aa,
388
- groupTotalFixedPosition: Xe == !0 || Xe == "true",
389
- centerLabel: Jt,
390
- showArcLabels: Ee == !0 || Ee == "true",
391
- showArcLinkLabels: Ne == !0 || Ne == "true",
392
- slicePadding: _t,
393
- centerLabelFontWeight: Kt,
394
- centerLabelFontSize: Qt,
395
- centerLabelXOffset: Zt,
396
- centerLabelYOffset: Ot,
397
- userMeasures: Fa,
398
- tooltipEnableMarkdown: $ == !0 || $ == "true",
399
- yAxisTickValues: d || c ? t.yAxisTickValues ?? Ve : Ve,
400
- xAxisTickValues: d || c ? t.xAxisTickValues ?? Ge : Ge,
401
- lineXAxisTickMode: fa,
402
- lineXAxisTickCount: parseInt(ba) || 10,
403
- lineXAxisTickEvery: parseInt(wa) || 1,
404
- enableGridY: L == !0 || L == "true",
405
- enableGridX: k == !0 || k == "true",
406
- offsetText: ra,
407
- selectedMeasures: w,
408
- overallLabel: te,
409
- minMaxClamp: oa,
410
- reverseLegend: Ue == !0 || Ue == "true",
411
- customAxisFormat: Pa,
412
- sort: $e,
413
- sortReverse: S == !0 || S == "true",
414
- sortReverseSecondDimension: H == !0 || H == "true",
415
- radarCurve: na,
416
- radarFillOpacity: ia,
417
- radarBorderWidth: sa,
377
+ confidenceIntervals: C(Wt) || [],
378
+ showPoints: Ne == !0 || Ne == "true",
379
+ enableArea: Ee == !0 || Ee == "true",
380
+ areaShadingCriteria: Yt,
381
+ areaLowerBound: qt,
382
+ areaUpperBound: Jt,
383
+ showGroupTotal: Ge == !0 || Ge == "true",
384
+ groupTotalMeasure: ea,
385
+ groupTotalLabel: ta,
386
+ groupTotalFormat: Na,
387
+ groupTotalOffset: ra,
388
+ groupTotalFixedPosition: Ve == !0 || Ve == "true",
389
+ centerLabel: _t,
390
+ showArcLabels: ze == !0 || ze == "true",
391
+ showArcLinkLabels: Xe == !0 || Xe == "true",
392
+ slicePadding: Kt,
393
+ centerLabelFontWeight: Qt,
394
+ centerLabelFontSize: Zt,
395
+ centerLabelXOffset: Ot,
396
+ centerLabelYOffset: jt,
397
+ userMeasures: Ba,
398
+ tooltipEnableMarkdown: H == !0 || H == "true",
399
+ yAxisTickValues: l || c ? t.yAxisTickValues ?? Ue : Ue,
400
+ xAxisTickValues: l || c ? t.xAxisTickValues ?? Se : Se,
401
+ lineXAxisTickMode: ba,
402
+ lineXAxisTickCount: parseInt(wa) || 10,
403
+ lineXAxisTickEvery: parseInt(xa) || 1,
404
+ enableGridY: k == !0 || k == "true",
405
+ enableGridX: T == !0 || T == "true",
406
+ offsetText: oa,
407
+ selectedMeasures: x,
408
+ overallLabel: re,
409
+ minMaxClamp: na,
410
+ reverseLegend: $e == !0 || $e == "true",
411
+ customAxisFormat: Ea,
412
+ sort: He,
413
+ sortReverse: W == !0 || W == "true",
414
+ sortReverseSecondDimension: Y == !0 || Y == "true",
415
+ radarCurve: ia,
416
+ radarFillOpacity: sa,
417
+ radarBorderWidth: da,
418
418
  radarGridLevels: la,
419
- radarGridShape: da,
420
- radarGridLabelOffset: ca,
421
- radarEnableDots: He == !0 || He == "true",
422
- radarDotSize: ua,
423
- radarEnableDotLabel: We == !0 || We == "true",
424
- radarDotLabelOffset: ma,
425
- sortSecondDimension: Se,
426
- mobileCustomization: Ye,
427
- dimension1: P,
419
+ radarGridShape: ca,
420
+ radarGridLabelOffset: ua,
421
+ radarEnableDots: Ye == !0 || Ye == "true",
422
+ radarDotSize: ma,
423
+ radarEnableDotLabel: qe == !0 || qe == "true",
424
+ radarDotLabelOffset: pa,
425
+ sortSecondDimension: We,
426
+ mobileCustomization: Je,
427
+ dimension1: N,
428
428
  previewMode: h,
429
- lineCurve: ha,
430
- showLegendsInColumns: Je == !0 || Je == "true",
429
+ lineCurve: fa,
430
+ showLegendsInColumns: Ke == !0 || Ke == "true",
431
431
  numberOfLegendColumns: parseInt(ga) || 4
432
- }, se = {}, le = T(yt) || {};
433
- le && le.forEach && le.forEach((e) => {
434
- e.value != null && e.value.filter((r) => r != null && r.toString().trim() != "").length > 0 && (se[e.param] = e.value);
435
- }), ge && (se.dvzProxyDatasetId = ge);
436
- let C = null, A = null;
437
- if (o === "csv")
438
- C = lr;
432
+ }, le = {}, ce = C(Lt) || {};
433
+ ce && ce.forEach && ce.forEach((e) => {
434
+ e.value != null && e.value.filter((n) => n != null && n.toString().trim() != "").length > 0 && (le[e.param] = e.value);
435
+ }), be && (le.dvzProxyDatasetId = be);
436
+ let I = null, M = null;
437
+ if (r === "csv")
438
+ I = dr;
439
439
  else
440
- switch (B) {
440
+ switch (E) {
441
441
  case "line":
442
- C = Z.LineDataFrame;
442
+ I = j.LineDataFrame;
443
443
  break;
444
444
  case "pie":
445
- C = Z.PieDataFrame;
445
+ I = j.PieDataFrame;
446
446
  break;
447
447
  case "radar":
448
- C = Z.BarDataFrame;
448
+ I = j.BarDataFrame;
449
449
  break;
450
450
  default:
451
- C = Z.BarDataFrame;
451
+ I = j.BarDataFrame;
452
452
  break;
453
453
  }
454
- let I = !1;
455
- switch (B) {
454
+ let A = !1;
455
+ switch (E) {
456
456
  case "bar":
457
- A = nr, I = o != "csv" && P == "none" && w.length == 0;
457
+ M = nr, A = r != "csv" && N == "none" && x.length == 0;
458
458
  break;
459
459
  case "line":
460
- A = ir, I = o !== "csv" && (w.length === 0 || P === "none");
460
+ M = ir, A = r !== "csv" && (x.length === 0 || N === "none");
461
461
  break;
462
462
  case "pie":
463
- I = o != "csv" && w.length == 0, A = rr;
463
+ A = r != "csv" && x.length == 0, M = rr;
464
464
  break;
465
465
  case "radar":
466
- I = o != "csv" && w.length == 0, A = or;
466
+ A = r != "csv" && x.length == 0, M = or;
467
467
  break;
468
468
  default:
469
- A = /* @__PURE__ */ p("div", { children: "No Chart" });
469
+ M = /* @__PURE__ */ m("div", { children: "No Chart" });
470
470
  break;
471
471
  }
472
- const Ya = ut === "true", N = [];
473
- P != "none" && N.push(P), be != "none" && N.push(be);
474
- const [at, qa] = X(0), [Lr, Ja] = X(rt());
475
- function rt() {
472
+ const qa = mt === "true", X = [];
473
+ N != "none" && X.push(N), xe != "none" && X.push(xe);
474
+ const [ot, Ja] = V(0), [Lr, _a] = V(nt());
475
+ function nt() {
476
476
  var e;
477
477
  return ((e = window.screen.orientation) == null ? void 0 : e.type) || (window.innerWidth > window.innerHeight ? "landscape-primary" : "portrait-primary");
478
478
  }
479
- return me(() => {
479
+ return he(() => {
480
480
  const e = setTimeout(() => {
481
- ae && (() => {
482
- const n = W.current.querySelector(
481
+ oe && (() => {
482
+ const o = q.current.querySelector(
483
483
  ".legends.container.has-standard-12-font-size.bottom"
484
- ) || W.current.querySelector(
484
+ ) || q.current.querySelector(
485
485
  ".legends.container.items-section:not(.legends.container.top .items-section)"
486
486
  );
487
- if (!n || n.closest(".legends.container.top")) return;
488
- const { clientHeight: m } = n, z = window.getComputedStyle(n), _a = parseInt(z.marginTop), ot = parseInt(z.marginBottom), Ka = parseInt(z.paddingTop), Qa = parseInt(z.paddingBottom), Za = m + _a + ot + Ka + Qa, nt = n.closest(
487
+ if (!o || o.closest(".legends.container.top")) return;
488
+ const { clientHeight: p } = o, v = window.getComputedStyle(o), G = parseInt(v.marginTop), b = parseInt(v.marginBottom), Ka = parseInt(v.paddingTop), Qa = parseInt(v.paddingBottom), Za = p + G + b + Ka + Qa, it = o.closest(
489
489
  ".ui.fluid.container.content"
490
490
  );
491
- if (nt) {
492
- const x = nt.querySelector(".data-source");
493
- if (x) {
494
- const M = x.getBoundingClientRect(), D = n.getBoundingClientRect();
495
- if (D.bottom !== 0 && M.top !== 0) {
496
- if (n.textContent.trim() === "") return;
497
- const _ = ot, K = D.bottom + _, ce = window.getComputedStyle(x), Q = parseFloat(ce.marginTop) || 0, R = M.top - Q;
498
- if (K > R) {
499
- let F = K - R;
500
- F < 5 && (F += 1), x.style.marginTop = `${F + 1}px`;
491
+ if (it) {
492
+ const y = it.querySelector(".data-source");
493
+ if (y) {
494
+ const D = y.getBoundingClientRect(), R = o.getBoundingClientRect();
495
+ if (R.bottom !== 0 && D.top !== 0) {
496
+ if (o.textContent.trim() === "") return;
497
+ const Q = b, Z = R.bottom + Q, me = window.getComputedStyle(y), O = parseFloat(me.marginTop) || 0, F = D.top - O;
498
+ if (Z > F) {
499
+ let B = Z - F;
500
+ B < 5 && (B += 1), y.style.marginTop = `${B + 1}px`;
501
501
  }
502
502
  } else
503
503
  setTimeout(() => {
504
- M.top < D.bottom && (x.style.marginTop = `${D.bottom - M.top + 1}px`);
504
+ D.top < R.bottom && (y.style.marginTop = `${R.bottom - D.top + 1}px`);
505
505
  }, 1e3);
506
506
  }
507
507
  }
508
- const de = n.closest(".chart.container");
509
- if (de) {
510
- const x = de.getBoundingClientRect(), M = window.getComputedStyle(de), D = Number.parseFloat(M.marginBottom) || 0, _ = x.bottom + D, K = n.getBoundingClientRect(), ce = Number.parseFloat(z.marginTop) || 0, Q = K.top - ce;
511
- if (Q < _) {
512
- const R = _ - Q, F = 200, Oa = Math.min(R + 1, F);
513
- R > 0 && R < F && (n.style.marginTop = `${Oa}px`);
508
+ const ue = o.closest(".chart.container");
509
+ if (ue) {
510
+ const y = ue.getBoundingClientRect(), D = window.getComputedStyle(ue), R = Number.parseFloat(D.marginBottom) || 0, Q = y.bottom + R, Z = o.getBoundingClientRect(), me = Number.parseFloat(v.marginTop) || 0, O = Z.top - me;
511
+ if (O < Q) {
512
+ const F = Q - O, B = 200, Oa = Math.min(F + 1, B);
513
+ F > 0 && F < B && (o.style.marginTop = `${Oa}px`);
514
514
  }
515
515
  }
516
- qa(Za);
516
+ Ja(Za);
517
517
  })();
518
518
  }, 100);
519
519
  return () => {
520
520
  clearTimeout(e);
521
521
  };
522
- }, [ae, W]), me(() => {
522
+ }, [oe, q]), he(() => {
523
523
  const e = () => {
524
524
  setTimeout(() => {
525
- Ja(rt());
525
+ _a(nt());
526
526
  }, 100);
527
527
  };
528
528
  return window.screen.orientation ? window.screen.orientation.addEventListener("change", e) : window.addEventListener("resize", e), () => {
529
529
  window.screen.orientation ? window.screen.orientation.removeEventListener("change", e) : window.removeEventListener("resize", e);
530
530
  };
531
- }, []), /* @__PURE__ */ p("div", { ref: W, children: /* @__PURE__ */ ue(
532
- pe,
531
+ }, []), /* @__PURE__ */ m("div", { ref: q, children: /* @__PURE__ */ pe(
532
+ fe,
533
533
  {
534
534
  className: "chart container",
535
535
  style: {
536
- minHeight: B === "pie" && window.innerWidth <= 480 ? `${parseInt(G) + parseInt(at) * 0.5}px` : `${parseInt(G) + parseInt(at)}px`
536
+ minHeight: E === "pie" && window.innerWidth <= 480 ? `${parseInt(S) + parseInt(ot) * 0.5}px` : `${parseInt(S) + parseInt(ot)}px`
537
537
  },
538
538
  fluid: !0,
539
539
  children: [
540
- /* @__PURE__ */ p(
540
+ /* @__PURE__ */ m(
541
541
  er,
542
542
  {
543
543
  editing: s,
544
- style: { height: `${Y}px` },
545
- params: se,
546
- waitForFilters: pa === "true",
547
- app: o,
548
- group: fe,
549
- csv: ht,
550
- store: [o, O, ...N],
551
- source: N.join("/"),
552
- children: /* @__PURE__ */ ue(
553
- pe,
544
+ style: { height: `${J}px` },
545
+ params: le,
546
+ waitForFilters: ha === "true",
547
+ app: r,
548
+ group: we,
549
+ csv: ft,
550
+ store: [r, ee, ...X],
551
+ source: X.join("/"),
552
+ children: /* @__PURE__ */ pe(
553
+ fe,
554
554
  {
555
- style: { height: `${Y}px` },
555
+ style: { height: `${J}px` },
556
556
  className: "body",
557
557
  fluid: !0,
558
558
  children: [
559
- I && /* @__PURE__ */ p(it, { editing: s }),
560
- !I && /* @__PURE__ */ ue(tr, { children: [
561
- /* @__PURE__ */ p(it, { app: o, group: fe, noDataMsg: It, children: " " }),
562
- /* @__PURE__ */ p(
563
- C,
559
+ A && /* @__PURE__ */ m(st, { editing: s }),
560
+ !A && /* @__PURE__ */ pe(tr, { children: [
561
+ /* @__PURE__ */ m(st, { app: r, group: we, noDataMsg: At, children: " " }),
562
+ /* @__PURE__ */ m(
563
+ I,
564
564
  {
565
- locale: Ke,
566
- colorBy: E,
567
- hiddenBars: St,
568
- swap: U === "true" || U === !0,
569
- type: B,
565
+ locale: Ze,
566
+ colorBy: z,
567
+ hiddenBars: Ht,
568
+ swap: $ === "true" || $ === !0,
569
+ type: E,
570
570
  includeTotal: !0,
571
- includeOverall: Ce === !0 || Ce === "true",
572
- overallLabel: te,
573
- measures: w,
574
- dimensions: [...N],
575
- sort: $e,
576
- sortReverse: S === !0 || S === "true",
577
- sortSecondDimension: Se,
578
- sortReverseSecondDimension: H === !0 || H === "true",
579
- customLabels: Oe(),
580
- children: /* @__PURE__ */ p(
581
- dr,
571
+ includeOverall: Me === !0 || Me === "true",
572
+ overallLabel: re,
573
+ measures: x,
574
+ dimensions: [...X],
575
+ sort: He,
576
+ sortReverse: W === !0 || W === "true",
577
+ sortSecondDimension: We,
578
+ sortReverseSecondDimension: Y === !0 || Y === "true",
579
+ customLabels: et(),
580
+ children: /* @__PURE__ */ m(
581
+ lr,
582
582
  {
583
- type: B,
584
- app: o,
585
- locale: Ke,
586
- overallLabel: te,
587
- customLabels: Oe(),
588
- manualColors: Aa(),
589
- colorBy: E,
590
- scheme: j,
591
- barColor: tt.barColor,
592
- children: /* @__PURE__ */ p(A, { ...tt })
583
+ type: E,
584
+ app: r,
585
+ locale: Ze,
586
+ overallLabel: re,
587
+ customLabels: et(),
588
+ manualColors: Ma(),
589
+ colorBy: z,
590
+ scheme: te,
591
+ barColor: rt.barColor,
592
+ children: /* @__PURE__ */ m(M, { ...rt })
593
593
  }
594
594
  )
595
595
  }
@@ -600,23 +600,23 @@ const mr = (v) => {
600
600
  )
601
601
  }
602
602
  ),
603
- /* @__PURE__ */ p("br", {}),
604
- Ya && y && za === "info" && /* @__PURE__ */ p(
605
- pe,
603
+ /* @__PURE__ */ m("br", {}),
604
+ qa && L && Xa === "info" && /* @__PURE__ */ m(
605
+ fe,
606
606
  {
607
607
  fluid: !0,
608
- style: { height: Y + "px" },
608
+ style: { height: J + "px" },
609
609
  className: "body",
610
- children: /* @__PURE__ */ p(sr, { post: { content: { rendered: y } } })
610
+ children: /* @__PURE__ */ m(sr, { post: { content: { rendered: L } } })
611
611
  }
612
612
  )
613
613
  ]
614
614
  }
615
615
  ) });
616
- }, pr = (v, he) => {
617
- const { "data-app": s, "data-group": O } = he, y = v.getIn(["data", "measures", s, O]), V = v.getIn(["data", "pageModuleProps"]), l = {};
618
- return y && Object.keys(y).length > 0 && (l.injectedMeasures = y ?? {}), V && (l.pageModuleProps = V), l;
619
- }, hr = {}, $r = cr(pr, hr)(ur(mr));
616
+ }, pr = (P, ge) => {
617
+ const { "data-app": s, "data-group": ee } = ge, L = P.getIn(["data", "measures", s, ee]), U = P.getIn(["data", "pageModuleProps"]), d = {};
618
+ return L && Object.keys(L).length > 0 && (d.injectedMeasures = L ?? {}), U && (d.pageModuleProps = U), d;
619
+ }, hr = {}, Sr = cr(pr, hr)(ur(mr));
620
620
  export {
621
- $r as default
621
+ Sr as default
622
622
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@devgateway/dvz-ui-react",
3
- "version": "1.7.2",
3
+ "version": "1.7.3",
4
4
  "main": "dist/cjs/index.js",
5
5
  "module": "dist/esm/index.js",
6
6
  "types": "dist/types/index.d.ts",