@kashifd/jwero-components 0.5.78 → 0.5.79
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/index.es.js +27 -7
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/index.umd.js
CHANGED
|
@@ -1051,5 +1051,5 @@ rect.legend-mouseover-inactive,
|
|
|
1051
1051
|
|
|
1052
1052
|
.apexcharts-rangebar-goals-markers {
|
|
1053
1053
|
pointer-events: none
|
|
1054
|
-
}`;var A=((y=r.opts.chart)===null||y===void 0?void 0:y.nonce)||r.w.config.chart.nonce;A&&v.setAttribute("nonce",A),h?f.prepend(v):p.head.appendChild(v)}var C=r.create(r.w.config.series,{});if(!C)return o(r);r.mount(C).then(function(){typeof r.w.config.chart.events.mounted=="function"&&r.w.config.chart.events.mounted(r,r.w),r.events.fireEvent("mounted",[r,r.w]),o(C)}).catch(function(S){l(S)})}else l(new Error("Element not found"))})}},{key:"create",value:function(r,o){var l=this.w;new Xe(this).initModules();var u=this.w.globals;if(u.noData=!1,u.animationEnded=!1,this.responsive.checkResponsiveConfig(o),l.config.xaxis.convertedCatToNumeric&&new Ce(l.config).convertCatToNumericXaxis(l.config,this.ctx),this.el===null||(this.core.setupElements(),l.config.chart.type==="treemap"&&(l.config.grid.show=!1,l.config.yaxis[0].show=!1),u.svgWidth===0))return u.animationEnded=!0,null;var f=_.checkComboSeries(r,l.config.chart.type);u.comboCharts=f.comboCharts,u.comboBarCount=f.comboBarCount;var h=r.every(function(A){return A.data&&A.data.length===0});(r.length===0||h&&u.collapsedSeries.length<1)&&this.series.handleNoData(),this.events.setupEventHandlers(),this.data.parseData(r),this.theme.init(),new he(this).setGlobalMarkerSize(),this.formatters.setLabelFormatters(),this.titleSubtitle.draw(),u.noData&&u.collapsedSeries.length!==u.series.length&&!l.config.legend.showForSingleSeries||this.legend.init(),this.series.hasAllSeriesEqualX(),u.axisCharts&&(this.core.coreCalculations(),l.config.xaxis.type!=="category"&&this.formatters.setLabelFormatters(),this.ctx.toolbar.minX=l.globals.minX,this.ctx.toolbar.maxX=l.globals.maxX),this.formatters.heatmapLabelFormatters(),new _(this).getLargestMarkerSize(),this.dimensions.plotCoords();var p=this.core.xySettings();this.grid.createGridMask();var v=this.core.plotChartType(r,p),y=new se(this);return y.bringForward(),l.config.dataLabels.background.enabled&&y.dataLabelsBackground(),this.core.shiftGraphPosition(),{elGraph:v,xyRatios:p,dimensions:{plot:{left:l.globals.translateX,top:l.globals.translateY,width:l.globals.gridWidth,height:l.globals.gridHeight}}}}},{key:"mount",value:function(){var r=this,o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,l=this,u=l.w;return new Promise(function(f,h){if(l.el===null)return h(new Error("Not enough data to display or target element not found"));(o===null||u.globals.allSeriesCollapsed)&&l.series.handleNoData(),l.grid=new Pe(l);var p,v,y=l.grid.drawGrid();if(l.annotations=new ne(l),l.annotations.drawImageAnnos(),l.annotations.drawTextAnnos(),u.config.grid.position==="back"&&(y&&u.globals.dom.elGraphical.add(y.el),y!=null&&(p=y.elGridBorders)!==null&&p!==void 0&&p.node&&u.globals.dom.elGraphical.add(y.elGridBorders)),Array.isArray(o.elGraph))for(var A=0;A<o.elGraph.length;A++)u.globals.dom.elGraphical.add(o.elGraph[A]);else u.globals.dom.elGraphical.add(o.elGraph);u.config.grid.position==="front"&&(y&&u.globals.dom.elGraphical.add(y.el),y!=null&&(v=y.elGridBorders)!==null&&v!==void 0&&v.node&&u.globals.dom.elGraphical.add(y.elGridBorders)),u.config.xaxis.crosshairs.position==="front"&&l.crosshairs.drawXCrosshairs(),u.config.yaxis[0].crosshairs.position==="front"&&l.crosshairs.drawYCrosshairs(),u.config.chart.type!=="treemap"&&l.axes.drawAxis(u.config.chart.type,y);var C=new Se(r.ctx,y),S=new we(r.ctx,y);if(y!==null&&(C.xAxisLabelCorrections(y.xAxisTickWidth),S.setYAxisTextAlignments(),u.config.yaxis.map(function(j,F){u.globals.ignoreYAxisIndexes.indexOf(F)===-1&&S.yAxisTitleRotate(F,j.opposite)})),l.annotations.drawAxesAnnotations(),!u.globals.noData){if(u.config.tooltip.enabled&&!u.globals.noData&&l.w.globals.tooltip.drawTooltip(o.xyRatios),u.globals.axisCharts&&(u.globals.isXNumeric||u.config.xaxis.convertedCatToNumeric||u.globals.isRangeBar))(u.config.chart.zoom.enabled||u.config.chart.selection&&u.config.chart.selection.enabled||u.config.chart.pan&&u.config.chart.pan.enabled)&&l.zoomPanSelection.init({xyRatios:o.xyRatios});else{var M=u.config.chart.toolbar.tools;["zoom","zoomin","zoomout","selection","pan","reset"].forEach(function(j){M[j]=!1})}u.config.chart.toolbar.show&&!u.globals.allSeriesCollapsed&&l.toolbar.createToolbar()}u.globals.memory.methodsToExec.length>0&&u.globals.memory.methodsToExec.forEach(function(j){j.method(j.params,!1,j.context)}),u.globals.axisCharts||u.globals.noData||l.core.resizeNonAxisCharts(),f(l)})}},{key:"destroy",value:function(){var r,o;window.removeEventListener("resize",this.windowResizeHandler),this.el.parentNode,r=this.parentResizeHandler,(o=Ke.get(r))&&(o.disconnect(),Ke.delete(r));var l=this.w.config.chart.id;l&&Apex._chartInstances.forEach(function(u,f){u.id===R.escapeString(l)&&Apex._chartInstances.splice(f,1)}),new nt(this.ctx).clear({isUpdating:!1})}},{key:"updateOptions",value:function(r){var o=this,l=arguments.length>1&&arguments[1]!==void 0&&arguments[1],u=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2],f=!(arguments.length>3&&arguments[3]!==void 0)||arguments[3],h=!(arguments.length>4&&arguments[4]!==void 0)||arguments[4],p=this.w;return p.globals.selection=void 0,r.series&&(this.series.resetSeries(!1,!0,!1),r.series.length&&r.series[0].data&&(r.series=r.series.map(function(v,y){return o.updateHelpers._extendSeries(v,y)})),this.updateHelpers.revertDefaultAxisMinMax()),r.xaxis&&(r=this.updateHelpers.forceXAxisUpdate(r)),r.yaxis&&(r=this.updateHelpers.forceYAxisUpdate(r)),p.globals.collapsedSeriesIndices.length>0&&this.series.clearPreviousPaths(),r.theme&&(r=this.theme.updateThemeOptions(r)),this.updateHelpers._updateOptions(r,l,u,f,h)}},{key:"updateSeries",value:function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],o=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],l=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2];return this.series.resetSeries(!1),this.updateHelpers.revertDefaultAxisMinMax(),this.updateHelpers._updateSeries(r,o,l)}},{key:"appendSeries",value:function(r){var o=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],l=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2],u=this.w.config.series.slice();return u.push(r),this.series.resetSeries(!1),this.updateHelpers.revertDefaultAxisMinMax(),this.updateHelpers._updateSeries(u,o,l)}},{key:"appendData",value:function(r){var o=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],l=this;l.w.globals.dataChanged=!0,l.series.getPreviousPaths();for(var u=l.w.config.series.slice(),f=0;f<u.length;f++)if(r[f]!==null&&r[f]!==void 0)for(var h=0;h<r[f].data.length;h++)u[f].data.push(r[f].data[h]);return l.w.config.series=u,o&&(l.w.globals.initialSeries=R.clone(l.w.config.series)),this.update()}},{key:"update",value:function(r){var o=this;return new Promise(function(l,u){new nt(o.ctx).clear({isUpdating:!0});var f=o.create(o.w.config.series,r);if(!f)return l(o);o.mount(f).then(function(){typeof o.w.config.chart.events.updated=="function"&&o.w.config.chart.events.updated(o,o.w),o.events.fireEvent("updated",[o,o.w]),o.w.globals.isDirty=!0,l(o)}).catch(function(h){u(h)})})}},{key:"getSyncedCharts",value:function(){var r=this.getGroupedCharts(),o=[this];return r.length&&(o=[],r.forEach(function(l){o.push(l)})),o}},{key:"getGroupedCharts",value:function(){var r=this;return Apex._chartInstances.filter(function(o){if(o.group)return!0}).map(function(o){return r.w.config.chart.group===o.group?o.chart:r})}},{key:"toggleSeries",value:function(r){return this.series.toggleSeries(r)}},{key:"highlightSeriesOnLegendHover",value:function(r,o){return this.series.toggleSeriesOnHover(r,o)}},{key:"showSeries",value:function(r){this.series.showSeries(r)}},{key:"hideSeries",value:function(r){this.series.hideSeries(r)}},{key:"isSeriesHidden",value:function(r){this.series.isSeriesHidden(r)}},{key:"resetSeries",value:function(){var r=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0],o=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];this.series.resetSeries(r,o)}},{key:"addEventListener",value:function(r,o){this.events.addEventListener(r,o)}},{key:"removeEventListener",value:function(r,o){this.events.removeEventListener(r,o)}},{key:"addXaxisAnnotation",value:function(r){var o=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],l=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0,u=this;l&&(u=l),u.annotations.addXaxisAnnotationExternal(r,o,u)}},{key:"addYaxisAnnotation",value:function(r){var o=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],l=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0,u=this;l&&(u=l),u.annotations.addYaxisAnnotationExternal(r,o,u)}},{key:"addPointAnnotation",value:function(r){var o=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],l=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0,u=this;l&&(u=l),u.annotations.addPointAnnotationExternal(r,o,u)}},{key:"clearAnnotations",value:function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:void 0,o=this;r&&(o=r),o.annotations.clearAnnotations(o)}},{key:"removeAnnotation",value:function(r){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:void 0,l=this;o&&(l=o),l.annotations.removeAnnotation(l,r)}},{key:"getChartArea",value:function(){return this.w.globals.dom.baseEl.querySelector(".apexcharts-inner")}},{key:"getSeriesTotalXRange",value:function(r,o){return this.coreUtils.getSeriesTotalsXRange(r,o)}},{key:"getHighestValueInSeries",value:function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return new xe(this.ctx).getMinYMaxY(r).highestY}},{key:"getLowestValueInSeries",value:function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return new xe(this.ctx).getMinYMaxY(r).lowestY}},{key:"getSeriesTotal",value:function(){return this.w.globals.seriesTotals}},{key:"toggleDataPointSelection",value:function(r,o){return this.updateHelpers.toggleDataPointSelection(r,o)}},{key:"zoomX",value:function(r,o){this.ctx.toolbar.zoomUpdateOptions(r,o)}},{key:"setLocale",value:function(r){this.localization.setCurrentLocaleValues(r)}},{key:"dataURI",value:function(r){return new me(this.ctx).dataURI(r)}},{key:"exportToCSV",value:function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return new me(this.ctx).exportToCSV(r)}},{key:"paper",value:function(){return this.w.globals.dom.Paper}},{key:"_parentResizeCallback",value:function(){this.w.globals.animationEnded&&this.w.config.chart.redrawOnParentResize&&this._windowResize()}},{key:"_windowResize",value:function(){var r=this;clearTimeout(this.w.globals.resizeTimer),this.w.globals.resizeTimer=window.setTimeout(function(){r.w.globals.resized=!0,r.w.globals.dataChanged=!1,r.ctx.update()},150)}},{key:"_windowResizeHandler",value:function(){var r=this.w.config.chart.redrawOnWindowResize;typeof r=="function"&&(r=r()),r&&this._windowResize()}}],[{key:"getChartByID",value:function(r){var o=R.escapeString(r);if(Apex._chartInstances){var l=Apex._chartInstances.filter(function(u){return u.id===o})[0];return l&&l.chart}}},{key:"initOnLoad",value:function(){for(var r=document.querySelectorAll("[data-apexcharts]"),o=0;o<r.length;o++)new $(r[o],JSON.parse(r[o].getAttribute("data-options"))).render()}},{key:"exec",value:function(r,o){var l=this.getChartByID(r);if(l){l.w.globals.isExecCalled=!0;var u=null;if(l.publicMethods.indexOf(o)!==-1){for(var f=arguments.length,h=new Array(f>2?f-2:0),p=2;p<f;p++)h[p-2]=arguments[p];u=l[o].apply(l,h)}return u}}},{key:"merge",value:function(r,o){return R.extend(r,o)}}]),$}();e.exports=bt})(Mh,Mh.exports);var kV=Mh.exports,Io;Object.defineProperty(C0,"__esModule",{value:!0});var TV=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},OV=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n,a=arguments[t];for(n in a)Object.prototype.hasOwnProperty.call(a,n)&&(e[n]=a[n])}return e},DV=function(){function e(t,n){for(var a=0;a<n.length;a++){var s=n[a];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(t,s.key,s)}}return function(t,n,a){return n&&e(t.prototype,n),a&&e(t,a),t}}(),MV=kV,S0=Ph(MV),k0=yt,_s=Ph(k0),PV=Rn,No=Ph(PV);function Ph(e){return e&&e.__esModule?e:{default:e}}function EV(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function RV(e,t){var n,a={};for(n in e)0<=t.indexOf(n)||Object.prototype.hasOwnProperty.call(e,n)&&(a[n]=e[n]);return a}function IV(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function NV(e,t){if(e)return!t||typeof t!="object"&&typeof t!="function"?e:t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}function LV(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}window.ApexCharts=S0.default;var T0=function(){function e(t){IV(this,e);var n=NV(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return _s.default.createRef?n.chartRef=_s.default.createRef():n.setRef=function(a){return n.chartRef=a},n.chart=null,n}return LV(e,k0.Component),DV(e,[{key:"render",value:function(){var t=RV(this.props,[]);return _s.default.createElement("div",OV({ref:_s.default.createRef?this.chartRef:this.setRef},t))}},{key:"componentDidMount",value:function(){var t=_s.default.createRef?this.chartRef.current:this.chartRef;this.chart=new S0.default(t,this.getConfig()),this.chart.render()}},{key:"getConfig",value:function(){var c=this.props,t=c.type,n=c.height,a=c.width,s=c.series,c=c.options;return this.extend(c,{chart:{type:t,height:n,width:a},series:s})}},{key:"isObject",value:function(t){return t&&(t===void 0?"undefined":TV(t))==="object"&&!Array.isArray(t)&&t!=null}},{key:"extend",value:function(t,n){var a=this,s=(typeof Object.assign!="function"&&(Object.assign=function(c){if(c==null)throw new TypeError("Cannot convert undefined or null to object");for(var d=Object(c),g=1;g<arguments.length;g++){var m=arguments[g];if(m!=null)for(var b in m)m.hasOwnProperty(b)&&(d[b]=m[b])}return d}),Object.assign({},t));return this.isObject(t)&&this.isObject(n)&&Object.keys(n).forEach(function(c){a.isObject(n[c])&&c in t?s[c]=a.extend(t[c],n[c]):Object.assign(s,EV({},c,n[c]))}),s}},{key:"componentDidUpdate",value:function(t){if(!this.chart)return null;var s=this.props,g=s.options,n=s.series,a=s.height,s=s.width,c=JSON.stringify(t.options),d=JSON.stringify(t.series),g=JSON.stringify(g),m=JSON.stringify(n);c===g&&d===m&&a===t.height&&s===t.width||(d!==m&&c===g&&a===t.height&&s===t.width?this.chart.updateSeries(n):this.chart.updateOptions(this.getConfig()))}},{key:"componentWillUnmount",value:function(){this.chart&&typeof this.chart.destroy=="function"&&this.chart.destroy()}}]),e}();(Io=C0.default=T0).propTypes={type:No.default.string.isRequired,width:No.default.oneOfType([No.default.string,No.default.number]),height:No.default.oneOfType([No.default.string,No.default.number]),series:No.default.array.isRequired,options:No.default.object.isRequired},T0.defaultProps={type:"line",width:"100%",height:"auto"};const jV=({name:e,labels:t,data:n})=>{const a={chart:{type:"line",toolbar:{show:!1}},xaxis:{categories:t},stroke:{curve:"smooth"},grid:{padding:{left:0,right:0}},colors:["#2E93FA"],dataLabels:{enabled:!1},tooltip:{enabled:!0}},s=[{name:e||"",data:n}];return k.jsx(Io,{options:a,series:s,type:"line",height:"100%",width:"100%"})},FV=({name:e,data:t,barColor:n})=>{const s={chart:{type:"bar",toolbar:{show:!1}},plotOptions:{bar:{borderRadius:10,dataLabels:{position:"top"}}},xaxis:{categories:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],position:"top",axisBorder:{show:!1},axisTicks:{show:!1},crosshairs:{fill:{type:"gradient",gradient:{colorFrom:"#D8E3F0",colorTo:"#BED1E6",stops:[0,100],opacityFrom:.4,opacityTo:.5}}},tooltip:{enabled:!0}},colors:[n||"#2E93FA"],dataLabels:{enabled:!0,formatter:d=>`${d}%`,style:{colors:[ut.colors.text_secondary]},offsetY:-20},tooltip:{enabled:!0},yaxis:{axisBorder:{show:!1},axisTicks:{show:!1},labels:{show:!1,formatter:function(d){return d+"%"}}}},c=[{name:e||"",data:t}];return k.jsx(Io,{options:s,series:c,type:"bar",height:"100%",width:"100%"})},BV=({name:e,data:t,labels:n})=>{const a={series:[{data:t}],chart:{type:"bar",toolbar:{show:!1}},plotOptions:{bar:{borderRadius:0,horizontal:!0,distributed:!0,barHeight:"80%",isFunnel:!0}},dataLabels:{offsetY:5,enabled:!0,formatter:function(c,d){return`${t[d.dataPointIndex]}`},style:{colors:[ut.colors.text_tertiary,ut.colors.medium_slate_blue,ut.colors.persian_green,ut.colors.rose,ut.colors.selective_yellow],fontFamily:"Inter, sans-serif",fontSize:"0.875rem",fontWeight:"600"}},xaxis:{categories:n,labels:{show:!1}},yaxis:{labels:{align:"left",show:!0,style:{colors:[ut.colors.text_tertiary,ut.colors.medium_slate_blue,ut.colors.persian_green,ut.colors.rose,ut.colors.selective_yellow],fontSize:"0.875rem",fontFamily:"Inter,sans-serif",fontWeight:"600"}},opposite:!0},colors:[ut.colors.light_grey,ut.colors.light_blue,ut.colors.light_green,ut.colors.light_orange,ut.colors.light_yellow],legend:{show:!1,position:"right",labels:{colors:ut.colors.burning_pink}},tooltip:{y:{formatter:function(c,d){return t[d.dataPointIndex]}}}},s=[{name:e||"",data:n==null?void 0:n.map((c,d)=>(d+1)*20).reverse()}];return k.jsx(Io,{options:a,series:s,type:"bar"})},zV=({name:e,data:t,labels:n})=>{const a={chart:{type:"area",toolbar:{show:!1}},dataLabels:{enabled:!1},stroke:{curve:"smooth"},xaxis:{categories:n,labels:{show:!0,style:{colors:[ut.colors.text_tertiary],fontFamily:"Inter,sans-serif",fontWeight:"400",fontSize:"12px"}}},yaxis:{labels:{align:"left",formatter:function(s){return`${s}`},style:{colors:[ut.colors.text_tertiary],fontFamily:"Inter,sans-serif",fontWeight:"400",fontSize:"12px"}},opposite:!0},fill:{type:"gradient",gradient:{shadeIntensity:1,opacityFrom:.3,opacityTo:.9,stops:[0,90,100]}}};return k.jsx(Io,{options:a,series:[{name:e||"",data:t}],type:"area",height:"100%",width:"100%"})};function VV(e){if(e.length<2)return 0;const t=[...e].sort((c,d)=>c-d),n=t.slice(1).map((c,d)=>c-t[d]),s=n.reduce((c,d)=>c+d,0)/n.length;return Math.max(s,0)}const WV=({labels:e=[],data:t=[],name:n})=>{const a=Ro.isArrayWithValues(t)&&t.length>1?VV(t):Ro.isArrayWithValues(t)&&t.length===1?t[0]*2:0,s=a>0?Math.max(...t)+a:0,c={chart:{type:"bar",toolbar:{show:!1}},plotOptions:{bar:{borderRadius:10,horizontal:!0,barHeight:"50%",dataLabels:{position:"top"}}},grid:{show:!0,borderColor:ut.colors.surface2_lightgrey,strokeDashArray:4,position:"back",xaxis:{lines:{show:!0}},yaxis:{lines:{show:!1}}},xaxis:{categories:e,axisBorder:{show:!1},axisTicks:{show:!1},min:0,max:s},yaxis:{axisBorder:{show:!1},axisTicks:{show:!1}},dataLabels:{offsetX:15,textAnchor:"start",enabled:!0,style:{colors:["#999"]}},colors:[ut.colors.tertiary]},d=[{name:n||"",data:t}];return k.jsx(Io,{options:c,series:d,type:"bar",height:"100%",width:"100%"})},HV=({data:e,labels:t})=>{const n={chart:{type:"donut"},labels:t,colors:[ut.colors.neutral,ut.colors.tertiary,ut.colors.secondary,ut.colors.rose],legend:{show:!0,position:"right",fontFamily:"Inter,sans-serif",labels:{colors:"#000000",useSeriesColors:!1}},dataLabels:{enabled:!1},responsive:[{breakpoint:480,options:{chart:{width:300},legend:{position:"bottom"}}}]};return k.jsx(Io,{options:n,series:e,type:"donut",width:"100%",height:"100%"})},O0=e=>{if(!e)return{};let t={};return Array.isArray(e)?e.forEach(n=>{typeof n=="object"&&!Array.isArray(n)&&n!==null&&(t={...t,...n})}):typeof e=="object"&&!Array.isArray(e)&&e!==null&&(t={...e}),{fontSize:t.fontSize,fontWeight:t.fontWeight,fontFamily:t.fontFamily,color:t.color}},YV=({completionRate:e,size:t,labelOptions:n})=>{const a=typeof e=="number"&&e>=0&&e<=100?e:0,c={...{name:"Completion Rate",nameSx:{fontSize:"1rem",fontWeight:500,fontFamily:"Inter, sans-serif",color:ut.colors.text_tertiary},valueSx:{fontSize:"2rem",fontWeight:600,fontFamily:"Inter, sans-serif",color:ut.colors.positive}},...n},d=O0(c.nameSx),g=O0(c.valueSx),m={chart:{type:"radialBar",offsetY:0},plotOptions:{radialBar:{startAngle:0,endAngle:360,hollow:{size:`${t}%`||"70%"},dataLabels:{name:{offsetY:20,show:!0,...d},value:{offsetY:-18,formatter:function(w){return`${w}%`},...g}}}},fill:{colors:[ut.colors.positive]},stroke:{lineCap:"round"},labels:[c.name]},b=[a];return k.jsx(Io,{options:m,series:b,type:"radialBar"})},XV=({series:e,label:t})=>{const n={chart:{type:"line",toolbar:{show:!1}},stroke:{width:2,curve:"smooth"},xaxis:{categories:t,labels:{style:{colors:t.map(()=>ut.colors.text_tertiary)}}},yaxis:{labels:{style:{colors:[ut.colors.text_tertiary]}}},colors:[ut.colors.medium_slate_blue,ut.colors.selective_yellow,ut.colors.rose],legend:{position:"top",horizontalAlign:"left",labels:{colors:[ut.colors.text_primary]}},tooltip:{enabled:!0,theme:"dark"}};return k.jsx(Io,{options:n,series:e,type:"line",height:"100%",width:"100%"})},UV=({type:e="radial",NumericChartData:t,completionRate:n,data:a,series:s,size:c,chartSx:d,barColor:g,label:m,labelName:b,labelOptions:w})=>{const T={height:"100%",flex:1,width:"100%",...d};return k.jsxs(rt,{sx:T,children:[e==="radial"&&k.jsx(YV,{size:c,completionRate:n,labelOptions:w}),e==="pie"&&k.jsx(HV,{data:a,labels:m}),e==="racing_bar"&&k.jsx(WV,{name:b,data:a,labels:m}),e==="area"&&k.jsx(zV,{name:b,data:a,labels:m}),e==="funnel"&&k.jsx(BV,{name:b,data:a,labels:m}),e==="bar"&&k.jsx(FV,{name:b,data:a,barColor:g}),e==="line"&&k.jsx(jV,{name:b,labels:m,data:a}),e==="numeric"&&k.jsx(SV,{data:t}),e==="multiple_line"&&k.jsx(XV,{series:s,label:m})]})};jt.JweroAccordion=A0,jt.JweroActionsButton=rV,jt.JweroAlerts=fV,jt.JweroBadge=Ol,jt.JweroBreadcrumbs=j8,jt.JweroButtonMenu=_8,jt.JweroCharts=UV,jt.JweroCheckbox=qs,jt.JweroChip=g0,jt.JweroConfirmationDialog=Gz,jt.JweroCustomField=Ky,jt.JweroDataCard=Q8,jt.JweroDataTable=B8,jt.JweroDateFilter=d8,jt.JweroDialogFooter=N8,jt.JweroDialogHeader=I8,jt.JweroDrawer=G8,jt.JweroEmptyState=iV,jt.JweroMenu=Ch,jt.JweroOrderCard=CV,jt.JweroPopper=lu,jt.JweroPrimaryButton=li,jt.JweroRadio=cu,jt.JweroSearchBox=h8,jt.JweroSidebar=L8,jt.JweroSnackbar=p8,jt.JweroStatusChip=$s,jt.JweroTable=i0,jt.JweroTabs=E8,jt.JweroTaskCard=cV,jt.JweroTooltip=Qy,jt.JweroTypography=wt,jt.JweroUserAvatar=Ah,jt.JweroVerticalTabs=Z8,jt.JweroViewOptions=R8,Object.defineProperty(jt,Symbol.toStringTag,{value:"Module"})});
|
|
1054
|
+
}`;var A=((y=r.opts.chart)===null||y===void 0?void 0:y.nonce)||r.w.config.chart.nonce;A&&v.setAttribute("nonce",A),h?f.prepend(v):p.head.appendChild(v)}var C=r.create(r.w.config.series,{});if(!C)return o(r);r.mount(C).then(function(){typeof r.w.config.chart.events.mounted=="function"&&r.w.config.chart.events.mounted(r,r.w),r.events.fireEvent("mounted",[r,r.w]),o(C)}).catch(function(S){l(S)})}else l(new Error("Element not found"))})}},{key:"create",value:function(r,o){var l=this.w;new Xe(this).initModules();var u=this.w.globals;if(u.noData=!1,u.animationEnded=!1,this.responsive.checkResponsiveConfig(o),l.config.xaxis.convertedCatToNumeric&&new Ce(l.config).convertCatToNumericXaxis(l.config,this.ctx),this.el===null||(this.core.setupElements(),l.config.chart.type==="treemap"&&(l.config.grid.show=!1,l.config.yaxis[0].show=!1),u.svgWidth===0))return u.animationEnded=!0,null;var f=_.checkComboSeries(r,l.config.chart.type);u.comboCharts=f.comboCharts,u.comboBarCount=f.comboBarCount;var h=r.every(function(A){return A.data&&A.data.length===0});(r.length===0||h&&u.collapsedSeries.length<1)&&this.series.handleNoData(),this.events.setupEventHandlers(),this.data.parseData(r),this.theme.init(),new he(this).setGlobalMarkerSize(),this.formatters.setLabelFormatters(),this.titleSubtitle.draw(),u.noData&&u.collapsedSeries.length!==u.series.length&&!l.config.legend.showForSingleSeries||this.legend.init(),this.series.hasAllSeriesEqualX(),u.axisCharts&&(this.core.coreCalculations(),l.config.xaxis.type!=="category"&&this.formatters.setLabelFormatters(),this.ctx.toolbar.minX=l.globals.minX,this.ctx.toolbar.maxX=l.globals.maxX),this.formatters.heatmapLabelFormatters(),new _(this).getLargestMarkerSize(),this.dimensions.plotCoords();var p=this.core.xySettings();this.grid.createGridMask();var v=this.core.plotChartType(r,p),y=new se(this);return y.bringForward(),l.config.dataLabels.background.enabled&&y.dataLabelsBackground(),this.core.shiftGraphPosition(),{elGraph:v,xyRatios:p,dimensions:{plot:{left:l.globals.translateX,top:l.globals.translateY,width:l.globals.gridWidth,height:l.globals.gridHeight}}}}},{key:"mount",value:function(){var r=this,o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,l=this,u=l.w;return new Promise(function(f,h){if(l.el===null)return h(new Error("Not enough data to display or target element not found"));(o===null||u.globals.allSeriesCollapsed)&&l.series.handleNoData(),l.grid=new Pe(l);var p,v,y=l.grid.drawGrid();if(l.annotations=new ne(l),l.annotations.drawImageAnnos(),l.annotations.drawTextAnnos(),u.config.grid.position==="back"&&(y&&u.globals.dom.elGraphical.add(y.el),y!=null&&(p=y.elGridBorders)!==null&&p!==void 0&&p.node&&u.globals.dom.elGraphical.add(y.elGridBorders)),Array.isArray(o.elGraph))for(var A=0;A<o.elGraph.length;A++)u.globals.dom.elGraphical.add(o.elGraph[A]);else u.globals.dom.elGraphical.add(o.elGraph);u.config.grid.position==="front"&&(y&&u.globals.dom.elGraphical.add(y.el),y!=null&&(v=y.elGridBorders)!==null&&v!==void 0&&v.node&&u.globals.dom.elGraphical.add(y.elGridBorders)),u.config.xaxis.crosshairs.position==="front"&&l.crosshairs.drawXCrosshairs(),u.config.yaxis[0].crosshairs.position==="front"&&l.crosshairs.drawYCrosshairs(),u.config.chart.type!=="treemap"&&l.axes.drawAxis(u.config.chart.type,y);var C=new Se(r.ctx,y),S=new we(r.ctx,y);if(y!==null&&(C.xAxisLabelCorrections(y.xAxisTickWidth),S.setYAxisTextAlignments(),u.config.yaxis.map(function(j,F){u.globals.ignoreYAxisIndexes.indexOf(F)===-1&&S.yAxisTitleRotate(F,j.opposite)})),l.annotations.drawAxesAnnotations(),!u.globals.noData){if(u.config.tooltip.enabled&&!u.globals.noData&&l.w.globals.tooltip.drawTooltip(o.xyRatios),u.globals.axisCharts&&(u.globals.isXNumeric||u.config.xaxis.convertedCatToNumeric||u.globals.isRangeBar))(u.config.chart.zoom.enabled||u.config.chart.selection&&u.config.chart.selection.enabled||u.config.chart.pan&&u.config.chart.pan.enabled)&&l.zoomPanSelection.init({xyRatios:o.xyRatios});else{var M=u.config.chart.toolbar.tools;["zoom","zoomin","zoomout","selection","pan","reset"].forEach(function(j){M[j]=!1})}u.config.chart.toolbar.show&&!u.globals.allSeriesCollapsed&&l.toolbar.createToolbar()}u.globals.memory.methodsToExec.length>0&&u.globals.memory.methodsToExec.forEach(function(j){j.method(j.params,!1,j.context)}),u.globals.axisCharts||u.globals.noData||l.core.resizeNonAxisCharts(),f(l)})}},{key:"destroy",value:function(){var r,o;window.removeEventListener("resize",this.windowResizeHandler),this.el.parentNode,r=this.parentResizeHandler,(o=Ke.get(r))&&(o.disconnect(),Ke.delete(r));var l=this.w.config.chart.id;l&&Apex._chartInstances.forEach(function(u,f){u.id===R.escapeString(l)&&Apex._chartInstances.splice(f,1)}),new nt(this.ctx).clear({isUpdating:!1})}},{key:"updateOptions",value:function(r){var o=this,l=arguments.length>1&&arguments[1]!==void 0&&arguments[1],u=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2],f=!(arguments.length>3&&arguments[3]!==void 0)||arguments[3],h=!(arguments.length>4&&arguments[4]!==void 0)||arguments[4],p=this.w;return p.globals.selection=void 0,r.series&&(this.series.resetSeries(!1,!0,!1),r.series.length&&r.series[0].data&&(r.series=r.series.map(function(v,y){return o.updateHelpers._extendSeries(v,y)})),this.updateHelpers.revertDefaultAxisMinMax()),r.xaxis&&(r=this.updateHelpers.forceXAxisUpdate(r)),r.yaxis&&(r=this.updateHelpers.forceYAxisUpdate(r)),p.globals.collapsedSeriesIndices.length>0&&this.series.clearPreviousPaths(),r.theme&&(r=this.theme.updateThemeOptions(r)),this.updateHelpers._updateOptions(r,l,u,f,h)}},{key:"updateSeries",value:function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],o=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],l=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2];return this.series.resetSeries(!1),this.updateHelpers.revertDefaultAxisMinMax(),this.updateHelpers._updateSeries(r,o,l)}},{key:"appendSeries",value:function(r){var o=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],l=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2],u=this.w.config.series.slice();return u.push(r),this.series.resetSeries(!1),this.updateHelpers.revertDefaultAxisMinMax(),this.updateHelpers._updateSeries(u,o,l)}},{key:"appendData",value:function(r){var o=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],l=this;l.w.globals.dataChanged=!0,l.series.getPreviousPaths();for(var u=l.w.config.series.slice(),f=0;f<u.length;f++)if(r[f]!==null&&r[f]!==void 0)for(var h=0;h<r[f].data.length;h++)u[f].data.push(r[f].data[h]);return l.w.config.series=u,o&&(l.w.globals.initialSeries=R.clone(l.w.config.series)),this.update()}},{key:"update",value:function(r){var o=this;return new Promise(function(l,u){new nt(o.ctx).clear({isUpdating:!0});var f=o.create(o.w.config.series,r);if(!f)return l(o);o.mount(f).then(function(){typeof o.w.config.chart.events.updated=="function"&&o.w.config.chart.events.updated(o,o.w),o.events.fireEvent("updated",[o,o.w]),o.w.globals.isDirty=!0,l(o)}).catch(function(h){u(h)})})}},{key:"getSyncedCharts",value:function(){var r=this.getGroupedCharts(),o=[this];return r.length&&(o=[],r.forEach(function(l){o.push(l)})),o}},{key:"getGroupedCharts",value:function(){var r=this;return Apex._chartInstances.filter(function(o){if(o.group)return!0}).map(function(o){return r.w.config.chart.group===o.group?o.chart:r})}},{key:"toggleSeries",value:function(r){return this.series.toggleSeries(r)}},{key:"highlightSeriesOnLegendHover",value:function(r,o){return this.series.toggleSeriesOnHover(r,o)}},{key:"showSeries",value:function(r){this.series.showSeries(r)}},{key:"hideSeries",value:function(r){this.series.hideSeries(r)}},{key:"isSeriesHidden",value:function(r){this.series.isSeriesHidden(r)}},{key:"resetSeries",value:function(){var r=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0],o=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];this.series.resetSeries(r,o)}},{key:"addEventListener",value:function(r,o){this.events.addEventListener(r,o)}},{key:"removeEventListener",value:function(r,o){this.events.removeEventListener(r,o)}},{key:"addXaxisAnnotation",value:function(r){var o=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],l=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0,u=this;l&&(u=l),u.annotations.addXaxisAnnotationExternal(r,o,u)}},{key:"addYaxisAnnotation",value:function(r){var o=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],l=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0,u=this;l&&(u=l),u.annotations.addYaxisAnnotationExternal(r,o,u)}},{key:"addPointAnnotation",value:function(r){var o=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],l=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0,u=this;l&&(u=l),u.annotations.addPointAnnotationExternal(r,o,u)}},{key:"clearAnnotations",value:function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:void 0,o=this;r&&(o=r),o.annotations.clearAnnotations(o)}},{key:"removeAnnotation",value:function(r){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:void 0,l=this;o&&(l=o),l.annotations.removeAnnotation(l,r)}},{key:"getChartArea",value:function(){return this.w.globals.dom.baseEl.querySelector(".apexcharts-inner")}},{key:"getSeriesTotalXRange",value:function(r,o){return this.coreUtils.getSeriesTotalsXRange(r,o)}},{key:"getHighestValueInSeries",value:function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return new xe(this.ctx).getMinYMaxY(r).highestY}},{key:"getLowestValueInSeries",value:function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return new xe(this.ctx).getMinYMaxY(r).lowestY}},{key:"getSeriesTotal",value:function(){return this.w.globals.seriesTotals}},{key:"toggleDataPointSelection",value:function(r,o){return this.updateHelpers.toggleDataPointSelection(r,o)}},{key:"zoomX",value:function(r,o){this.ctx.toolbar.zoomUpdateOptions(r,o)}},{key:"setLocale",value:function(r){this.localization.setCurrentLocaleValues(r)}},{key:"dataURI",value:function(r){return new me(this.ctx).dataURI(r)}},{key:"exportToCSV",value:function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return new me(this.ctx).exportToCSV(r)}},{key:"paper",value:function(){return this.w.globals.dom.Paper}},{key:"_parentResizeCallback",value:function(){this.w.globals.animationEnded&&this.w.config.chart.redrawOnParentResize&&this._windowResize()}},{key:"_windowResize",value:function(){var r=this;clearTimeout(this.w.globals.resizeTimer),this.w.globals.resizeTimer=window.setTimeout(function(){r.w.globals.resized=!0,r.w.globals.dataChanged=!1,r.ctx.update()},150)}},{key:"_windowResizeHandler",value:function(){var r=this.w.config.chart.redrawOnWindowResize;typeof r=="function"&&(r=r()),r&&this._windowResize()}}],[{key:"getChartByID",value:function(r){var o=R.escapeString(r);if(Apex._chartInstances){var l=Apex._chartInstances.filter(function(u){return u.id===o})[0];return l&&l.chart}}},{key:"initOnLoad",value:function(){for(var r=document.querySelectorAll("[data-apexcharts]"),o=0;o<r.length;o++)new $(r[o],JSON.parse(r[o].getAttribute("data-options"))).render()}},{key:"exec",value:function(r,o){var l=this.getChartByID(r);if(l){l.w.globals.isExecCalled=!0;var u=null;if(l.publicMethods.indexOf(o)!==-1){for(var f=arguments.length,h=new Array(f>2?f-2:0),p=2;p<f;p++)h[p-2]=arguments[p];u=l[o].apply(l,h)}return u}}},{key:"merge",value:function(r,o){return R.extend(r,o)}}]),$}();e.exports=bt})(Mh,Mh.exports);var kV=Mh.exports,Io;Object.defineProperty(C0,"__esModule",{value:!0});var TV=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},OV=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n,a=arguments[t];for(n in a)Object.prototype.hasOwnProperty.call(a,n)&&(e[n]=a[n])}return e},DV=function(){function e(t,n){for(var a=0;a<n.length;a++){var s=n[a];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(t,s.key,s)}}return function(t,n,a){return n&&e(t.prototype,n),a&&e(t,a),t}}(),MV=kV,S0=Ph(MV),k0=yt,_s=Ph(k0),PV=Rn,No=Ph(PV);function Ph(e){return e&&e.__esModule?e:{default:e}}function EV(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function RV(e,t){var n,a={};for(n in e)0<=t.indexOf(n)||Object.prototype.hasOwnProperty.call(e,n)&&(a[n]=e[n]);return a}function IV(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function NV(e,t){if(e)return!t||typeof t!="object"&&typeof t!="function"?e:t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}function LV(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}window.ApexCharts=S0.default;var T0=function(){function e(t){IV(this,e);var n=NV(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return _s.default.createRef?n.chartRef=_s.default.createRef():n.setRef=function(a){return n.chartRef=a},n.chart=null,n}return LV(e,k0.Component),DV(e,[{key:"render",value:function(){var t=RV(this.props,[]);return _s.default.createElement("div",OV({ref:_s.default.createRef?this.chartRef:this.setRef},t))}},{key:"componentDidMount",value:function(){var t=_s.default.createRef?this.chartRef.current:this.chartRef;this.chart=new S0.default(t,this.getConfig()),this.chart.render()}},{key:"getConfig",value:function(){var c=this.props,t=c.type,n=c.height,a=c.width,s=c.series,c=c.options;return this.extend(c,{chart:{type:t,height:n,width:a},series:s})}},{key:"isObject",value:function(t){return t&&(t===void 0?"undefined":TV(t))==="object"&&!Array.isArray(t)&&t!=null}},{key:"extend",value:function(t,n){var a=this,s=(typeof Object.assign!="function"&&(Object.assign=function(c){if(c==null)throw new TypeError("Cannot convert undefined or null to object");for(var d=Object(c),g=1;g<arguments.length;g++){var m=arguments[g];if(m!=null)for(var b in m)m.hasOwnProperty(b)&&(d[b]=m[b])}return d}),Object.assign({},t));return this.isObject(t)&&this.isObject(n)&&Object.keys(n).forEach(function(c){a.isObject(n[c])&&c in t?s[c]=a.extend(t[c],n[c]):Object.assign(s,EV({},c,n[c]))}),s}},{key:"componentDidUpdate",value:function(t){if(!this.chart)return null;var s=this.props,g=s.options,n=s.series,a=s.height,s=s.width,c=JSON.stringify(t.options),d=JSON.stringify(t.series),g=JSON.stringify(g),m=JSON.stringify(n);c===g&&d===m&&a===t.height&&s===t.width||(d!==m&&c===g&&a===t.height&&s===t.width?this.chart.updateSeries(n):this.chart.updateOptions(this.getConfig()))}},{key:"componentWillUnmount",value:function(){this.chart&&typeof this.chart.destroy=="function"&&this.chart.destroy()}}]),e}();(Io=C0.default=T0).propTypes={type:No.default.string.isRequired,width:No.default.oneOfType([No.default.string,No.default.number]),height:No.default.oneOfType([No.default.string,No.default.number]),series:No.default.array.isRequired,options:No.default.object.isRequired},T0.defaultProps={type:"line",width:"100%",height:"auto"};const jV=({name:e,labels:t,data:n})=>{const a={chart:{type:"line",toolbar:{show:!1}},xaxis:{categories:t},stroke:{curve:"smooth"},grid:{padding:{left:0,right:0}},colors:["#2E93FA"],dataLabels:{enabled:!1},tooltip:{enabled:!0}},s=[{name:e||"",data:n}];return k.jsx(Io,{options:a,series:s,type:"line",height:"100%",width:"100%"})},FV=({name:e,data:t,barColor:n})=>{const s={chart:{type:"bar",toolbar:{show:!1}},plotOptions:{bar:{borderRadius:10,dataLabels:{position:"top"}}},xaxis:{categories:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],position:"top",axisBorder:{show:!1},axisTicks:{show:!1},crosshairs:{fill:{type:"gradient",gradient:{colorFrom:"#D8E3F0",colorTo:"#BED1E6",stops:[0,100],opacityFrom:.4,opacityTo:.5}}},tooltip:{enabled:!0}},colors:[n||"#2E93FA"],dataLabels:{enabled:!0,formatter:d=>`${d}%`,style:{colors:[ut.colors.text_secondary]},offsetY:-20},tooltip:{enabled:!0},yaxis:{axisBorder:{show:!1},axisTicks:{show:!1},labels:{show:!1,formatter:function(d){return d+"%"}}}},c=[{name:e||"",data:t}];return k.jsx(Io,{options:s,series:c,type:"bar",height:"100%",width:"100%"})},BV=({name:e,data:t,labels:n})=>{const a={series:[{data:t}],chart:{type:"bar",toolbar:{show:!1}},plotOptions:{bar:{borderRadius:0,horizontal:!0,distributed:!0,barHeight:"80%",isFunnel:!0}},dataLabels:{offsetY:5,enabled:!0,formatter:function(c,d){return`${t[d.dataPointIndex]}`},style:{colors:[ut.colors.text_tertiary,ut.colors.medium_slate_blue,ut.colors.persian_green,ut.colors.rose,ut.colors.selective_yellow],fontFamily:"Inter, sans-serif",fontSize:"0.875rem",fontWeight:"600"}},xaxis:{categories:n,labels:{show:!1}},yaxis:{labels:{align:"left",show:!0,style:{colors:[ut.colors.text_tertiary,ut.colors.medium_slate_blue,ut.colors.persian_green,ut.colors.rose,ut.colors.selective_yellow],fontSize:"0.875rem",fontFamily:"Inter,sans-serif",fontWeight:"600"}},opposite:!0},colors:[ut.colors.light_grey,ut.colors.light_blue,ut.colors.light_green,ut.colors.light_orange,ut.colors.light_yellow],legend:{show:!1,position:"right",labels:{colors:ut.colors.burning_pink}},tooltip:{y:{formatter:function(c,d){return t[d.dataPointIndex]}}}},s=[{name:e||"",data:n==null?void 0:n.map((c,d)=>(d+1)*20).reverse()}];return k.jsx(Io,{options:a,series:s,type:"bar",height:"100%",width:"100%"})},zV=({name:e,data:t,labels:n})=>{const a={chart:{type:"area",toolbar:{show:!1}},dataLabels:{enabled:!1},stroke:{curve:"smooth"},xaxis:{categories:n,labels:{show:!0,style:{colors:[ut.colors.text_tertiary],fontFamily:"Inter,sans-serif",fontWeight:"400",fontSize:"12px"}}},yaxis:{labels:{align:"left",formatter:function(s){return`${s}`},style:{colors:[ut.colors.text_tertiary],fontFamily:"Inter,sans-serif",fontWeight:"400",fontSize:"12px"}},opposite:!0},fill:{type:"gradient",gradient:{shadeIntensity:1,opacityFrom:.3,opacityTo:.9,stops:[0,90,100]}}};return k.jsx(Io,{options:a,series:[{name:e||"",data:t}],type:"area",height:"100%",width:"100%"})};function VV(e){if(e.length<2)return 0;const t=[...e].sort((c,d)=>c-d),n=t.slice(1).map((c,d)=>c-t[d]),s=n.reduce((c,d)=>c+d,0)/n.length;return Math.max(s,0)}const WV=({labels:e=[],data:t=[],name:n})=>{const a=Ro.isArrayWithValues(t)&&t.length>1?VV(t):Ro.isArrayWithValues(t)&&t.length===1?t[0]*2:0,s=a>0?Math.max(...t)+a:0,c={chart:{type:"bar",toolbar:{show:!1}},plotOptions:{bar:{borderRadius:10,horizontal:!0,barHeight:"50%",dataLabels:{position:"top"}}},grid:{show:!0,borderColor:ut.colors.surface2_lightgrey,strokeDashArray:4,position:"back",xaxis:{lines:{show:!0}},yaxis:{lines:{show:!1}}},xaxis:{categories:e,axisBorder:{show:!1},axisTicks:{show:!1},min:0,max:s},yaxis:{axisBorder:{show:!1},axisTicks:{show:!1}},dataLabels:{offsetX:15,textAnchor:"start",enabled:!0,style:{colors:["#999"]}},colors:[ut.colors.tertiary]},d=[{name:n||"",data:t}];return k.jsx(Io,{options:c,series:d,type:"bar",height:"100%",width:"100%"})},HV=({data:e,labels:t})=>{const n={chart:{type:"donut"},labels:t,colors:[ut.colors.neutral,ut.colors.tertiary,ut.colors.secondary,ut.colors.rose],legend:{show:!0,position:"right",fontFamily:"Inter,sans-serif",labels:{colors:"#000000",useSeriesColors:!1}},dataLabels:{enabled:!1},responsive:[{breakpoint:480,options:{chart:{width:300},legend:{position:"bottom"}}}]};return k.jsx(Io,{options:n,series:e,type:"donut",width:"100%",height:"100%"})},O0=e=>{if(!e)return{};let t={};return Array.isArray(e)?e.forEach(n=>{typeof n=="object"&&!Array.isArray(n)&&n!==null&&(t={...t,...n})}):typeof e=="object"&&!Array.isArray(e)&&e!==null&&(t={...e}),{fontSize:t.fontSize,fontWeight:t.fontWeight,fontFamily:t.fontFamily,color:t.color}},YV=({completionRate:e,size:t=70,labelOptions:n})=>{const a=typeof e=="number"&&e>=0&&e<=100?e:0,c={...{name:"Completion Rate",nameSx:{fontSize:"1rem",fontWeight:500,fontFamily:"Inter, sans-serif",color:ut.colors.text_tertiary},valueSx:{fontSize:t>60?"2rem":t>50?"1.5rem":"1rem",fontWeight:600,fontFamily:"Inter, sans-serif",color:ut.colors.positive}},...n},d=O0(c.nameSx),g=O0(c.valueSx),m={chart:{type:"radialBar",offsetY:0,height:"100%",width:"100%"},plotOptions:{radialBar:{startAngle:0,endAngle:360,hollow:{size:`${t}%`},dataLabels:{name:{offsetY:20,show:!0,...d},value:{offsetY:-7,formatter:function(w){return`${w}%`},...g}}}},fill:{colors:[ut.colors.positive]},stroke:{lineCap:"round"},labels:[c.name]},b=[a];return k.jsx(Io,{options:m,series:b,type:"radialBar",height:"100%",width:"100%"})},XV=({series:e,label:t})=>{const n={chart:{type:"line",toolbar:{show:!1}},stroke:{width:2,curve:"smooth"},xaxis:{categories:t,labels:{style:{colors:t.map(()=>ut.colors.text_tertiary)}}},yaxis:{labels:{style:{colors:[ut.colors.text_tertiary]}}},colors:[ut.colors.medium_slate_blue,ut.colors.selective_yellow,ut.colors.rose],legend:{position:"top",horizontalAlign:"left",labels:{colors:[ut.colors.text_primary]}},tooltip:{enabled:!0,theme:"dark"}};return k.jsx(Io,{options:n,series:e,type:"line",height:"100%",width:"100%"})},UV=({type:e="radial",NumericChartData:t,completionRate:n,data:a,series:s,size:c,chartSx:d,barColor:g,label:m,labelName:b,labelOptions:w})=>{const T={height:"100%",flex:1,width:"100%",...d};return k.jsxs(rt,{sx:T,children:[e==="radial"&&k.jsx(YV,{size:c,completionRate:n,labelOptions:w}),e==="pie"&&k.jsx(HV,{data:a,labels:m}),e==="racing_bar"&&k.jsx(WV,{name:b,data:a,labels:m}),e==="area"&&k.jsx(zV,{name:b,data:a,labels:m}),e==="funnel"&&k.jsx(BV,{name:b,data:a,labels:m}),e==="bar"&&k.jsx(FV,{name:b,data:a,barColor:g}),e==="line"&&k.jsx(jV,{name:b,labels:m,data:a}),e==="numeric"&&k.jsx(SV,{data:t}),e==="multiple_line"&&k.jsx(XV,{series:s,label:m})]})};jt.JweroAccordion=A0,jt.JweroActionsButton=rV,jt.JweroAlerts=fV,jt.JweroBadge=Ol,jt.JweroBreadcrumbs=j8,jt.JweroButtonMenu=_8,jt.JweroCharts=UV,jt.JweroCheckbox=qs,jt.JweroChip=g0,jt.JweroConfirmationDialog=Gz,jt.JweroCustomField=Ky,jt.JweroDataCard=Q8,jt.JweroDataTable=B8,jt.JweroDateFilter=d8,jt.JweroDialogFooter=N8,jt.JweroDialogHeader=I8,jt.JweroDrawer=G8,jt.JweroEmptyState=iV,jt.JweroMenu=Ch,jt.JweroOrderCard=CV,jt.JweroPopper=lu,jt.JweroPrimaryButton=li,jt.JweroRadio=cu,jt.JweroSearchBox=h8,jt.JweroSidebar=L8,jt.JweroSnackbar=p8,jt.JweroStatusChip=$s,jt.JweroTable=i0,jt.JweroTabs=E8,jt.JweroTaskCard=cV,jt.JweroTooltip=Qy,jt.JweroTypography=wt,jt.JweroUserAvatar=Ah,jt.JweroVerticalTabs=Z8,jt.JweroViewOptions=R8,Object.defineProperty(jt,Symbol.toStringTag,{value:"Module"})});
|
|
1055
1055
|
//# sourceMappingURL=index.umd.js.map
|