@bikdotai/bik-component-library 0.0.727-beta.0 → 0.0.727-beta.23
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/cjs/components/analytics-chips-and-dropdowns/AnalyticsTrend.d.ts +0 -1
- package/dist/cjs/components/analytics-chips-and-dropdowns/AnalyticsTrend.js +1 -1
- package/dist/cjs/components/analytics-chips-and-dropdowns/chart/StackedBarChart/StackedBarChart.js +1 -1
- package/dist/cjs/components/analytics-chips-and-dropdowns/chart/StackedBarChart/StackedBarChart.model.d.ts +1 -6
- package/dist/cjs/components/analytics-chips-and-dropdowns/chart/VerticalBarAndLinearGraph/VerticalBarAndLinearGraph.js +1 -1
- package/dist/cjs/components/analytics-chips-and-dropdowns/chart/VerticalBarAndLinearGraph/VerticalBarAndLinearGraph.styles.d.ts +0 -6
- package/dist/cjs/components/analytics-chips-and-dropdowns/chart/VerticalBarAndLinearGraph/VerticalBarAndLinearGraph.styles.js +2 -23
- package/dist/cjs/components/analytics-chips-and-dropdowns/chart/VerticalBarAndLinearGraph/VerticalBarAndLinearGraphModel.d.ts +0 -12
- package/dist/cjs/components/toaster/Toaster.d.ts +1 -0
- package/dist/cjs/components/toaster/Toaster.js +1 -1
- package/dist/cjs/components/toaster/Toaster.styled.js +1 -1
- package/dist/esm/components/analytics-chips-and-dropdowns/AnalyticsTrend.d.ts +0 -1
- package/dist/esm/components/analytics-chips-and-dropdowns/AnalyticsTrend.js +1 -1
- package/dist/esm/components/analytics-chips-and-dropdowns/chart/StackedBarChart/StackedBarChart.js +1 -1
- package/dist/esm/components/analytics-chips-and-dropdowns/chart/StackedBarChart/StackedBarChart.model.d.ts +1 -6
- package/dist/esm/components/analytics-chips-and-dropdowns/chart/VerticalBarAndLinearGraph/VerticalBarAndLinearGraph.js +1 -1
- package/dist/esm/components/analytics-chips-and-dropdowns/chart/VerticalBarAndLinearGraph/VerticalBarAndLinearGraph.styles.d.ts +0 -6
- package/dist/esm/components/analytics-chips-and-dropdowns/chart/VerticalBarAndLinearGraph/VerticalBarAndLinearGraph.styles.js +3 -24
- package/dist/esm/components/analytics-chips-and-dropdowns/chart/VerticalBarAndLinearGraph/VerticalBarAndLinearGraphModel.d.ts +0 -12
- package/dist/esm/components/toaster/Toaster.d.ts +1 -0
- package/dist/esm/components/toaster/Toaster.js +1 -1
- package/dist/esm/components/toaster/Toaster.styled.js +1 -1
- package/package.json +1 -1
- package/dist/cjs/components/analytics-chips-and-dropdowns/chart/VerticalBarAndLinearGraph/VerticalBarAndLinearGraphModel.js +0 -1
- package/dist/esm/components/analytics-chips-and-dropdowns/chart/VerticalBarAndLinearGraph/VerticalBarAndLinearGraphModel.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../node_modules/react/jsx-runtime.js"),t=require("react"),n=require("../shimmer/ShimmerComponent/ShimmerStyled.js"),i=require("../../utils/DateUtils.js"),s=require("../../constants/Theme.js"),r=require("../../assets/icons/arrow_down.svg.js"),o=require("../../assets/icons/arrow_up.svg.js"),l=require("../../assets/icons/info.svg.js"),a=require("../tag/Tag.js"),c=require("../tooltips/Tooltip.js"),x=require("../TypographyStyle.js"),u=require("./chart/utils/calcPercentage.js"),d=require("./CommonStyles.js");function m(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var p=m(t);const j=n=>{let{percent:l,direction:a,timeline:d,customRange:m,trendRaw:p,
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../node_modules/react/jsx-runtime.js"),t=require("react"),n=require("../shimmer/ShimmerComponent/ShimmerStyled.js"),i=require("../../utils/DateUtils.js"),s=require("../../constants/Theme.js"),r=require("../../assets/icons/arrow_down.svg.js"),o=require("../../assets/icons/arrow_up.svg.js"),l=require("../../assets/icons/info.svg.js"),a=require("../tag/Tag.js"),c=require("../tooltips/Tooltip.js"),x=require("../TypographyStyle.js"),u=require("./chart/utils/calcPercentage.js"),d=require("./CommonStyles.js");function m(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var p=m(t);const j=n=>{let{percent:l,direction:a,timeline:d,customRange:m,trendRaw:p,prefixSymbol:j,trendIconStyle:g,isInternationalStore:h,tooltipTimelineText:y,customTimelineText:R}=n;const b=()=>{const e=((null!=p?p:0)>0?"+":"")+(null!=j?j:"");return void 0===p?"--":`${null!=e?e:""}${(()=>{let e="--";if(p)return e=String(h?u.truncateValueForInternationalStore(Math.abs(p)):u.truncateValueForIndianStore(Math.abs(p))),p<0?"-"+e:e})()}`},[f,O]=t.useState(b()),[S,T]=t.useState(R||"");t.useEffect((()=>{R||T("today"===d?"vs yesterday":"yesterday"===d?"vs 1 day before":"7 days"===d?"vs last 7 days":"30 days"===d?"vs last 30 days":"custom"===d&&m?i.default.getAnalyticsCustomDateTimelineText(m):"")}),[d,m]),t.useEffect((()=>{O(b())}),[p]);const v="negative"===a?r.default:o.default,E="negative"===a?s.COLORS.background.negative.vibrant:"positive"===a?s.COLORS.background.positive.vibrant:s.COLORS.content.placeholder;return e.jsxRuntimeExports.jsxs("div",Object.assign({style:{display:"flex",alignItems:"center",flexDirection:"row",flexWrap:"wrap"}},{children:["number"==typeof l&&e.jsxRuntimeExports.jsx(v,{color:E,height:16,width:16,style:Object.assign({marginRight:2},null!=g?g:{})}),"number"==typeof l&&a&&e.jsxRuntimeExports.jsxs(x.Caption,Object.assign({style:{color:E}},{children:["neutral"===a?0:l<1e3?l:">999","%"]})),!!p&&e.jsxRuntimeExports.jsx(x.Caption,Object.assign({style:{marginLeft:4,color:s.COLORS.content.placeholder}},{children:`(${f})`})),d&&(y?e.jsxRuntimeExports.jsx(c.Tooltip,Object.assign({body:y,placement:"bottom"},{children:e.jsxRuntimeExports.jsx(x.Caption,Object.assign({style:{marginLeft:4,color:s.COLORS.content.placeholder}},{children:R||S}))})):e.jsxRuntimeExports.jsx(x.Caption,Object.assign({style:{marginLeft:4,color:s.COLORS.content.placeholder}},{children:R||S})))]}))};exports.AnalyticsTrend=t=>{let{title:i,value:r,trendPercent:o,type:m="horizontal",timeline:g,customRange:h,tooltip:y,card:R=!0,rightSeparator:b=!1,size:f="big",share:O=!1,formatVal:S,prefixSymbol:T,trailingIcon:v,onTrailIconClick:E,iconTooltipBody:C,funnelPercent:w,isLoading:I,trendRaw:$,suffixText:L,trendStyle:q,trendContainerStyle:D,trendIconStyle:F,containerStyle:M,prevTrendDiff:k,relativePercentageDiff:P,isInternationalStore:V,Icon:_,iconContainerStyle:z,tooltipTimelineText:A,customTimelineText:N}=t;const B="big"===f?x.TitleLarge:x.TitleMedium,W=void 0!==o?o<0?"negative":0===o?"neutral":"positive":void 0,U=void 0!==o?O?Math.round(o):Math.abs(Math.round(o)):void 0;return e.jsxRuntimeExports.jsx(d.AnalyticsTrendContainer,Object.assign({card:R,style:Object.assign({},M)},{children:e.jsxRuntimeExports.jsxs("div",Object.assign({style:Object.assign({display:"flex",flexDirection:"row",gap:_?12:4,borderRightWidth:b?1:0,borderRightColor:s.COLORS.stroke.primary,borderRightStyle:"solid",paddingLeft:R?0:24,paddingRight:R?0:24,height:"100%",justifyContent:_?"flex-start":"space-between",alignItems:"center"},null!=D?D:{})},{children:[!!_&&e.jsxRuntimeExports.jsx(d.IconContainer,Object.assign({style:Object.assign({},z)},{children:e.jsxRuntimeExports.jsx(_,{})})),e.jsxRuntimeExports.jsxs("div",Object.assign({style:Object.assign({display:"flex",flexDirection:"column",gap:4,height:"100%"},null!=q?q:{})},{children:[e.jsxRuntimeExports.jsxs("div",Object.assign({style:{display:"flex",flexDirection:"row",gap:4,alignItems:"center"}},{children:[e.jsxRuntimeExports.jsx(x.BodyCaption,Object.assign({style:{color:s.COLORS.content.secondary}},{children:i})),y&&e.jsxRuntimeExports.jsx(c.Tooltip,Object.assign({body:y,placement:"right",width:300},{children:e.jsxRuntimeExports.jsx("div",Object.assign({style:{display:"flex",cursor:"pointer",height:"100%"}},{children:e.jsxRuntimeExports.jsx(l.default,{color:s.COLORS.content.primary,height:16,width:16})}))}))]})),e.jsxRuntimeExports.jsxs("div",Object.assign({style:Object.assign({display:"flex",flexDirection:"row",gap:12,alignItems:"center"},O?{justifyContent:"space-between"}:{})},{children:[I&&e.jsxRuntimeExports.jsx(n.ShimmerComponentStyled,{width:108,height:26}),!I&&e.jsxRuntimeExports.jsx(B,Object.assign({style:{color:s.COLORS.content.primary}},{children:void 0===r?"--":"number"==typeof r&&S?r>999?V?`${null!=T?T:""}${u.truncateValueForInternationalStore(r)} ${null!=L?L:""}`:`${null!=T?T:""}${u.truncateValueForIndianStore(r)} ${null!=L?L:""}`:`${null!=T?T:""}${new Intl.NumberFormat("en-IN",{maximumFractionDigits:2}).format(r)} ${null!=L?L:""}`:`${null!=T?T:""}${r} ${null!=L?L:""}`})),"number"==typeof P&&e.jsxRuntimeExports.jsx(a.Tag,{tagText:`${P}%`,theme:"light",type:"neutral"}),"horizontal"===m&&!I&&!O&&e.jsxRuntimeExports.jsx(j,{timeline:g,customRange:h,percent:U,direction:W,trendRaw:$,prefixSymbol:T,trendIconStyle:F,isInternationalStore:V,tooltipTimelineText:A,customTimelineText:N}),I&&!O&&"horizontal"===m&&e.jsxRuntimeExports.jsx(n.ShimmerComponentStyled,{height:20,width:141,marginTop:6}),"vertical"===m&&!I&&void 0!==w&&e.jsxRuntimeExports.jsx(a.Tag,{tagText:`${w} %`,theme:"light",type:"neutral"}),O&&!I&&void 0!==U&&e.jsxRuntimeExports.jsx(a.Tag,{tagText:`${U} %`,theme:"light",type:"neutral"}),O||I||!k||0==k?e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{}):e.jsxRuntimeExports.jsx(a.Tag,{tagText:(e=>{const t=Math.abs(e);return t%1!=0?`${t.toFixed(1)} %`:`${t} %`})(k),theme:"light",type:"neutral"})]})),"vertical"===m&&!I&&!O&&e.jsxRuntimeExports.jsx("div",Object.assign({style:{marginTop:10}},{children:e.jsxRuntimeExports.jsx(j,{timeline:g,customRange:h,percent:U,direction:W,trendRaw:$,prefixSymbol:T,trendIconStyle:F,isInternationalStore:V,tooltipTimelineText:A,customTimelineText:N})})),I&&"vertical"===m&&e.jsxRuntimeExports.jsx(n.ShimmerComponentStyled,{height:20,width:141,marginTop:6})]})),C&&!I&&e.jsxRuntimeExports.jsx(c.Tooltip,Object.assign({body:C,placement:"right"},{children:v&&e.jsxRuntimeExports.jsx("div",Object.assign({className:"icon--holder",onClick:E},{children:p.default.createElement(v,{height:20,width:20,color:s.COLORS.content.secondary})}))}))]}))}))};
|
package/dist/cjs/components/analytics-chips-and-dropdowns/chart/StackedBarChart/StackedBarChart.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../../node_modules/react/jsx-runtime.js"),t=require("../../../../assets/icons/maximize.svg.js"),i=require("chart.js"),o=require("chartjs-plugin-datalabels"),a=require("react"),l=require("react-chartjs-2"),n=require("../../../icon-button/IconButton.js"),s=require("../../../modals/styledModal.js"),r=require("../../../TypographyStyle.js"),d=require("../../../../constants/Theme.js"),c=require("../utils/calcPercentage.js"),u=require("./StackedBarChart.model.js"),x=require("./StackedBarChart.styles.js");function v(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var p=v(o);i.Chart.register(i.CategoryScale,i.LinearScale,i.BarElement,i.Tooltip,i.Legend,p.default);exports.StackedBarChart=i=>{var o,v,p,O,g,A,b,h,R,j,y,m,f,C,I,T,E,S,N,H,L,k,F,P,B,_,G,w,D,q,Z,z,M,W,$,V,Y,J,K,Q,U,X,ee,te,ie;const{headerIcons:oe=[],legendsAndIconDirection:ae="row"}=i,[le,ne]=a.useState(!1),se=[250,1e3,800,1500,300,600],re=0===i.yAxis.data.length,de=["#5E07BB","#9E77ED","#D2AEFF","#F7D7FF","#CDE1FF","#92AFFA","#3935E1"],ce=["#E6C7FF","#FEC6C6","#FEDEF3","#DEEFFF","#FFD8B1","#C7E5FF","#FFD3E6","#C9FFE5","#FFE3C7","#D9D9FF"],ue=i.customBarColors?i.customBarColors:i.customColourScaleBrand||i.customColourScalePastel?i.colorSchema===u.COLOR_SCHEMA.PASTEL?i.customColourScalePastel:i.customColourScaleBrand:i.colorSchema===u.COLOR_SCHEMA.PASTEL?ce:de,xe=i.customHoverColour,ve=a.useMemo((()=>{var e,t,o;return Object.assign(Object.assign({barPercentage:(null==i?void 0:i.barPercentage)||.4,categoryPercentage:1,pointStyle:"circle",barWidth:i.barWidth,borderRadius:(null==i?void 0:i.borderRadius)||void 0},"object"==typeof(null==i?void 0:i.borderRadius)?{borderSkipped:!1}:{}),(null===(e=null==i?void 0:i.addBarGap)||void 0===e?void 0:e.flag)?{borderWidth:{top:(null===(t=null==i?void 0:i.addBarGap)||void 0===t?void 0:t.value)||2,bottom:(null===(o=null==i?void 0:i.addBarGap)||void 0===o?void 0:o.value)||2,right:0,left:0},borderColor:"transparent"}:{})}),[i.barWidth,null==i?void 0:i.borderRadius,null==i?void 0:i.barPercentage,null==i?void 0:i.addBarGap]),pe={};i.yAxis.data.map((e=>{e.map((e=>{pe[e.name]?pe[e.name].push(e.value):pe[e.name]=[e.value]}))}));const Oe=Object.keys(pe).map(((e,t)=>Object.assign({label:e,data:pe[e],backgroundColor:null==ue?void 0:ue[t],hoverBackgroundColor:void 0===xe?void 0:xe[t]},ve)));let ge;ge=i.renderInHeightWiseManner?Oe.map(((e,t)=>Object.assign(Object.assign({},e),{order:e.data.reduce(((e,t)=>e+(t||0)),0)}))).sort(((e,t)=>t.order-e.order)):Oe;let Ae=i.xAxis.data.map((e=>"string"==typeof e?e:e.name)),be=ge;if(i.truncateBars){const e=((e,t,i)=>{if(t.length<=i)return{truncatedData:e,truncatedLabels:t,originalData:e,originalLabels:t};const o=e.map((e=>e.slice(0,i))),a=e.map((e=>e.slice(i).reduce(((e,t)=>e+t),0)));o.forEach(((e,t)=>e.push(a[t])));const l=t.slice(0,i);return l.push("Others"),{truncatedData:o,truncatedLabels:l,originalData:e,originalLabels:t}})(ge.map((e=>e.data)),Ae,i.truncateBars);ge.forEach(((t,i)=>t.data=e.truncatedData[i])),Ae=e.truncatedLabels,be=e.originalData.map(((e,t)=>Object.assign(Object.assign({},ge[t]),{data:e})))}const he={plugins:{legend:{display:!re&&!i.customLegend,labels:{usePointStyle:!0,fontSize:2}},tooltip:{enabled:!re,callbacks:{label:null===(o=i.tooltipConfig)||void 0===o?void 0:o.labelCallback,title:null===(v=i.tooltipConfig)||void 0===v?void 0:v.titleCallback,footer:null===(p=i.tooltipConfig)||void 0===p?void 0:p.footerCallback},footerFont:null===(g=null===(O=i.tooltipConfig)||void 0===O?void 0:O.footerStyles)||void 0===g?void 0:g.footerFont},datalabels:{display:null!==(A=i.showTotal)&&void 0!==A&&A,anchor:"end",align:"end",clamp:!0,formatter:(e,t)=>{var i;const o=t.datasetIndex,a=t.chart.data.datasets;if(o!==a.length-1)return"";const l=t.dataIndex;let n=0;for(let e=0;e<a.length;e++)n+=null!==(i=a[e].data[l])&&void 0!==i?i:0;return n?n<1e3?n:(n/1e3).toString().substring(0,4)+"k":""},color:d.COLORS.content.secondary}},layout:{padding:{right:i.showTotal&&i.orientation===u.GRAPH_ORIENTATION.HORIZONTAL?50:0,top:i.showTotal&&i.orientation!=u.GRAPH_ORIENTATION.HORIZONTAL?50:0}},responsive:!0,maintainAspectRatio:!1,legend:{display:!i.customLegend,labels:{usePointStyle:!0}},indexAxis:i.orientation===u.GRAPH_ORIENTATION.HORIZONTAL?"y":"x",scales:{x:{title:{display:!!(i.orientation===u.GRAPH_ORIENTATION.HORIZONTAL?null===(b=i.yAxis)||void 0===b?void 0:b.title:null===(h=i.xAxis)||void 0===h?void 0:h.title),text:i.orientation===u.GRAPH_ORIENTATION.HORIZONTAL?null===(R=i.yAxis)||void 0===R?void 0:R.title:null===(j=i.xAxis)||void 0===j?void 0:j.title,color:null!==(f=i.orientation===u.GRAPH_ORIENTATION.HORIZONTAL?null===(y=i.yAxis)||void 0===y?void 0:y.titleColor:null===(m=i.xAxis)||void 0===m?void 0:m.titleColor)&&void 0!==f?f:d.COLORS.content.secondary,font:{size:d.FONTS.caption.fontSize}},grid:{display:i.orientation===u.GRAPH_ORIENTATION.HORIZONTAL&&(void 0===(null===(C=null==i?void 0:i.showGridLines)||void 0===C?void 0:C.x)||(null===(I=null==i?void 0:i.showGridLines)||void 0===I?void 0:I.x)),color:d.COLORS.background.base},ticks:{fontSize:d.FONTS.caption.fontSize,color:null!==(T=i.yAxis.labelColor)&&void 0!==T?T:d.COLORS.content.secondary,callback:i.orientation===u.GRAPH_ORIENTATION.HORIZONTAL?e=>{var t;let o;o=i.isInternationalStore?c.truncateValueForInternationalStore(e):c.truncateValueForIndianStore(e);return`${o}${(null===(t=i.yAxis)||void 0===t?void 0:t.axisSuffix)||""}`}:(null===(E=i.xAxis)||void 0===E?void 0:E.axisSuffix)?e=>`${e}${i.xAxis.axisSuffix}`:void 0},stacked:i.orientation===u.GRAPH_ORIENTATION.HORIZONTAL?"boolean"!=typeof(null===(S=i.yAxis)||void 0===S?void 0:S.stacked)||(null===(N=i.yAxis)||void 0===N?void 0:N.stacked):"boolean"!=typeof(null===(H=i.xAxis)||void 0===H?void 0:H.stacked)||(null===(L=i.xAxis)||void 0===L?void 0:L.stacked)},y:Object.assign(Object.assign({},(null===(k=null==i?void 0:i.equalHeight)||void 0===k?void 0:k.flag)?{suggestedMin:-(null==i?void 0:i.equalHeight.max),suggestedMax:null==i?void 0:i.equalHeight.max}:{}),{max:null===(F=null==i?void 0:i.yAxis)||void 0===F?void 0:F.max,title:{display:!!(i.orientation===u.GRAPH_ORIENTATION.HORIZONTAL?null===(P=i.xAxis)||void 0===P?void 0:P.title:null===(B=i.yAxis)||void 0===B?void 0:B.title),text:i.orientation===u.GRAPH_ORIENTATION.HORIZONTAL?null===(_=i.xAxis)||void 0===_?void 0:_.title:null===(G=i.yAxis)||void 0===G?void 0:G.title,color:null!==(q=i.orientation===u.GRAPH_ORIENTATION.HORIZONTAL?null===(w=i.xAxis)||void 0===w?void 0:w.titleColor:null===(D=i.yAxis)||void 0===D?void 0:D.titleColor)&&void 0!==q?q:d.COLORS.content.secondary,font:{size:d.FONTS.caption.fontSize}},grid:{display:i.orientation!==u.GRAPH_ORIENTATION.HORIZONTAL&&(void 0===(null===(Z=null==i?void 0:i.showGridLines)||void 0===Z?void 0:Z.y)||(null===(z=null==i?void 0:i.showGridLines)||void 0===z?void 0:z.y)),color:d.COLORS.background.base},ticks:Object.assign(Object.assign({stepSize:i.orientation===u.GRAPH_ORIENTATION.HORIZONTAL?null===(M=i.xAxis)||void 0===M?void 0:M.stepSize:null===(W=i.yAxis)||void 0===W?void 0:W.stepSize,fontSize:d.FONTS.caption.fontSize,color:null!==($=i.xAxis.labelColor)&&void 0!==$?$:d.COLORS.content.secondary},re?{min:0,max:2e3,stepSize:200}:{}),{callback:(null==i?void 0:i.ticksCallback)?null==i?void 0:i.ticksCallback:i.orientation===u.GRAPH_ORIENTATION.HORIZONTAL?e=>{var t;let o;o=i.isInternationalStore?c.truncateValueForInternationalStore(e):c.truncateValueForIndianStore(e);return`${o}${(null===(t=i.xAxis)||void 0===t?void 0:t.axisSuffix)||""}`}:(null===(V=i.yAxis)||void 0===V?void 0:V.axisSuffix)?e=>`${e}${i.yAxis.axisSuffix}`:void 0}),stacked:i.orientation===u.GRAPH_ORIENTATION.HORIZONTAL?"boolean"!=typeof(null===(Y=i.xAxis)||void 0===Y?void 0:Y.stacked)||(null===(J=i.xAxis)||void 0===J?void 0:J.stacked):"boolean"!=typeof(null===(K=i.yAxis)||void 0===K?void 0:K.stacked)||(null===(Q=i.yAxis)||void 0===Q?void 0:Q.stacked)})},onClick:(e,t)=>{if(!i.onBarClick)return;const o=t[0].datasetIndex,a=t[0].index,l=e.chart.data.datasets[o].label,n=e.chart.data.labels[a];i.onBarClick(n,l)},onHover:(e,t)=>{i.onBarClick&&t.length&&(e.native.target.style.cursor="pointer")}};let Re;i.orientation&&i.orientation!==u.GRAPH_ORIENTATION.VERTICAL?delete he.scales.y.ticks.callback:delete he.scales.x.ticks.callback,Re=re?[{data:se,backgroundColor:"rgba(0,0,0,0)"}]:ge;const je={labels:Ae,datasets:Re};let ye;ye=re?[{data:se,backgroundColor:"rgba(0,0,0,0)"}]:be;const me={labels:i.xAxis.data.map((e=>"string"==typeof e?e:e.name)),datasets:ye},fe=function(){let t,o=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return t=i.allowChartPopup&&!o?"flex-start":"flex-end",e.jsxRuntimeExports.jsx("div",Object.assign({style:{overflowY:"scroll",display:"flex",flexDirection:"row",gap:"10px",padding:"0px 24px 12px 24px",justifyContent:t,flexWrap:"wrap"}},{children:Oe.map((t=>e.jsxRuntimeExports.jsxs("div",Object.assign({style:{display:"flex",alignItems:"center",gap:"8px",marginTop:"4px"}},{children:[e.jsxRuntimeExports.jsx("div",{style:{backgroundColor:t.backgroundColor,width:"16px",height:"16px",borderRadius:"2px"}}),e.jsxRuntimeExports.jsx(r.BodyTiny,Object.assign({color:d.COLORS.content.secondary},{children:t.label}))]}),t.label.replace(" ","_"))))}))};return e.jsxRuntimeExports.jsxs(x.GraphContainerWrapper,Object.assign({style:null!==(U=i.wrapperStyle)&&void 0!==U?U:{},padding:i.outerPadding,customLegend:i.customLegend},{children:[i.chartHeading&&e.jsxRuntimeExports.jsxs("div",Object.assign({style:{marginBottom:24,display:"flex",justifyContent:i.hideHeading?"flex-end":"space-between"}},{children:[!0!==i.hideHeading&&e.jsxRuntimeExports.jsx(r.TitleRegular,Object.assign({color:null!==(X=i.chartHeading.color)&&void 0!==X?X:d.COLORS.content.secondary},{children:i.chartHeading.heading})),i.allowChartPopup&&e.jsxRuntimeExports.jsx("div",Object.assign({style:{display:"flex",justifyContent:"flex-end"}},{children:e.jsxRuntimeExports.jsx("div",{children:e.jsxRuntimeExports.jsx(n.IconButton,{Icon:t.default,onClick:()=>{ne(!0)}})})}))]})),i.customLegend&&e.jsxRuntimeExports.jsxs("div",Object.assign({style:{display:"flex",flexDirection:ae,justifyContent:"space-between"}},{children:[e.jsxRuntimeExports.jsx(x.HeaderIconWrapper,{children:oe.map(((t,i)=>e.jsxRuntimeExports.jsx("div",{children:e.jsxRuntimeExports.jsx("div",{children:t})},i)))}),fe()]})),e.jsxRuntimeExports.jsx("div",Object.assign({className:"graph__wrapper"},{children:e.jsxRuntimeExports.jsx("div",Object.assign({style:{height:null!==(ee=i.graphCanvasHeight)&&void 0!==ee?ee:500,width:null!==(te=i.graphCanvasWidth)&&void 0!==te?te:"auto"}},{children:e.jsxRuntimeExports.jsx(l.Bar,{options:he,data:je})}))})),le&&e.jsxRuntimeExports.jsx(s.StyledModal,Object.assign({open:le,onClose:()=>ne(!1),closeOnOutsideClick:!0,headingTitle:null===(ie=i.chartHeading)||void 0===ie?void 0:ie.heading,width:"85%"},{children:e.jsxRuntimeExports.jsxs("div",Object.assign({className:"graph__wrapper",style:{padding:"8px"}},{children:[i.customLegend&&fe(!0),e.jsxRuntimeExports.jsx("div",Object.assign({style:{height:"70vh",width:"100%",padding:"16px",borderRadius:"8px"}},{children:e.jsxRuntimeExports.jsx(l.Bar,{options:he,data:me})}))]}))}))]}))};
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../../node_modules/react/jsx-runtime.js"),t=require("../../../../assets/icons/maximize.svg.js"),i=require("chart.js"),o=require("chartjs-plugin-datalabels"),a=require("react"),l=require("react-chartjs-2"),n=require("../../../icon-button/IconButton.js"),s=require("../../../modals/styledModal.js"),r=require("../../../TypographyStyle.js"),d=require("../../../../constants/Theme.js"),c=require("../utils/calcPercentage.js"),u=require("./StackedBarChart.model.js"),x=require("./StackedBarChart.styles.js");function v(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var p=v(o);i.Chart.register(i.CategoryScale,i.LinearScale,i.BarElement,i.Tooltip,i.Legend,p.default);exports.StackedBarChart=i=>{var o,v,p,g,O,b,h,R,A,j,y,m,C,I,T,E,f,N,S,H,L,k,F,P,_,G,B,w,D,q,Z,z,M,W,V,Y,J,K,Q,U,X,$;const{headerIcons:ee=[],legendsAndIconDirection:te="row"}=i,[ie,oe]=a.useState(!1),ae=[250,1e3,800,1500,300,600],le=0===i.yAxis.data.length,ne=void 0===i.customColourScaleBrand&&void 0===i.customColourScalePastel?i.colorSchema===u.COLOR_SCHEMA.PASTEL?["#E6C7FF","#FEC6C6","#FEDEF3","#DEEFFF","#FFD8B1","#C7E5FF","#FFD3E6","#C9FFE5","#FFE3C7","#D9D9FF"]:["#5E07BB","#9E77ED","#D2AEFF","#F7D7FF","#CDE1FF","#92AFFA","#3935E1"]:i.colorSchema===u.COLOR_SCHEMA.PASTEL?i.customColourScalePastel:i.customColourScaleBrand,se=i.customHoverColour,re=a.useMemo((()=>{var e,t,o;return Object.assign(Object.assign({barPercentage:(null==i?void 0:i.barPercentage)||.4,categoryPercentage:1,pointStyle:"circle",barWidth:i.barWidth,borderRadius:(null==i?void 0:i.borderRadius)||void 0},"object"==typeof(null==i?void 0:i.borderRadius)?{borderSkipped:!1}:{}),(null===(e=null==i?void 0:i.addBarGap)||void 0===e?void 0:e.flag)?{borderWidth:{top:(null===(t=null==i?void 0:i.addBarGap)||void 0===t?void 0:t.value)||2,bottom:(null===(o=null==i?void 0:i.addBarGap)||void 0===o?void 0:o.value)||2,right:0,left:0},borderColor:"transparent"}:{})}),[i.barWidth,null==i?void 0:i.borderRadius,null==i?void 0:i.barPercentage,null==i?void 0:i.addBarGap]),de={};i.yAxis.data.map((e=>{e.map((e=>{de[e.name]?de[e.name].push(e.value):de[e.name]=[e.value]}))}));const ce=Object.keys(de).map(((e,t)=>Object.assign({label:e,data:de[e],backgroundColor:null==ne?void 0:ne[t],hoverBackgroundColor:void 0===se?void 0:se[t]},re)));let ue=i.xAxis.data.map((e=>"string"==typeof e?e:e.name)),xe=ce;if(i.truncateBars){const e=((e,t,i)=>{if(t.length<=i)return{truncatedData:e,truncatedLabels:t,originalData:e,originalLabels:t};const o=e.map((e=>e.slice(0,i))),a=e.map((e=>e.slice(i).reduce(((e,t)=>e+t),0)));o.forEach(((e,t)=>e.push(a[t])));const l=t.slice(0,i);return l.push("Others"),{truncatedData:o,truncatedLabels:l,originalData:e,originalLabels:t}})(ce.map((e=>e.data)),ue,i.truncateBars);ce.forEach(((t,i)=>t.data=e.truncatedData[i])),ue=e.truncatedLabels,xe=e.originalData.map(((e,t)=>Object.assign(Object.assign({},ce[t]),{data:e})))}const ve={plugins:{legend:{display:!le&&!i.customLegend,labels:{usePointStyle:!0,fontSize:2}},tooltip:{enabled:!le,callbacks:{label:null===(o=i.tooltipConfig)||void 0===o?void 0:o.labelCallback,title:null===(v=i.tooltipConfig)||void 0===v?void 0:v.titleCallback,footer:null===(p=i.tooltipConfig)||void 0===p?void 0:p.footerCallback},footerFont:null===(O=null===(g=i.tooltipConfig)||void 0===g?void 0:g.footerStyles)||void 0===O?void 0:O.footerFont},datalabels:{display:null!==(b=i.showTotal)&&void 0!==b&&b,anchor:"end",align:"end",clamp:!0,formatter:(e,t)=>{var i;const o=t.datasetIndex,a=t.chart.data.datasets;if(o!==a.length-1)return"";const l=t.dataIndex;let n=0;for(let e=0;e<a.length;e++)n+=null!==(i=a[e].data[l])&&void 0!==i?i:0;return n?n<1e3?n:(n/1e3).toString().substring(0,4)+"k":""},color:d.COLORS.content.secondary}},layout:{padding:{right:i.showTotal&&i.orientation===u.GRAPH_ORIENTATION.HORIZONTAL?50:0,top:i.showTotal&&i.orientation!=u.GRAPH_ORIENTATION.HORIZONTAL?50:0}},responsive:!0,maintainAspectRatio:!1,legend:{display:!i.customLegend,labels:{usePointStyle:!0}},indexAxis:i.orientation===u.GRAPH_ORIENTATION.HORIZONTAL?"y":"x",scales:{x:{title:{display:!!(i.orientation===u.GRAPH_ORIENTATION.HORIZONTAL?null===(h=i.yAxis)||void 0===h?void 0:h.title:null===(R=i.xAxis)||void 0===R?void 0:R.title),text:i.orientation===u.GRAPH_ORIENTATION.HORIZONTAL?null===(A=i.yAxis)||void 0===A?void 0:A.title:null===(j=i.xAxis)||void 0===j?void 0:j.title,color:null!==(C=i.orientation===u.GRAPH_ORIENTATION.HORIZONTAL?null===(y=i.yAxis)||void 0===y?void 0:y.titleColor:null===(m=i.xAxis)||void 0===m?void 0:m.titleColor)&&void 0!==C?C:d.COLORS.content.secondary,font:{size:d.FONTS.caption.fontSize}},grid:{display:i.orientation===u.GRAPH_ORIENTATION.HORIZONTAL&&(void 0===(null===(I=null==i?void 0:i.showGridLines)||void 0===I?void 0:I.x)||(null===(T=null==i?void 0:i.showGridLines)||void 0===T?void 0:T.x)),color:d.COLORS.background.base},ticks:{fontSize:d.FONTS.caption.fontSize,color:null!==(E=i.yAxis.labelColor)&&void 0!==E?E:d.COLORS.content.secondary,callback:i.orientation===u.GRAPH_ORIENTATION.HORIZONTAL?i.isInternationalStore?c.truncateValueForInternationalStore:c.truncateValueForIndianStore:void 0},stacked:i.orientation===u.GRAPH_ORIENTATION.HORIZONTAL?"boolean"!=typeof(null===(f=i.yAxis)||void 0===f?void 0:f.stacked)||(null===(N=i.yAxis)||void 0===N?void 0:N.stacked):"boolean"!=typeof(null===(S=i.xAxis)||void 0===S?void 0:S.stacked)||(null===(H=i.xAxis)||void 0===H?void 0:H.stacked)},y:Object.assign(Object.assign({},(null===(L=null==i?void 0:i.equalHeight)||void 0===L?void 0:L.flag)?{suggestedMin:-(null==i?void 0:i.equalHeight.max),suggestedMax:null==i?void 0:i.equalHeight.max}:{}),{title:{display:!!(i.orientation===u.GRAPH_ORIENTATION.HORIZONTAL?null===(k=i.xAxis)||void 0===k?void 0:k.title:null===(F=i.yAxis)||void 0===F?void 0:F.title),text:i.orientation===u.GRAPH_ORIENTATION.HORIZONTAL?null===(P=i.xAxis)||void 0===P?void 0:P.title:null===(_=i.yAxis)||void 0===_?void 0:_.title,color:null!==(w=i.orientation===u.GRAPH_ORIENTATION.HORIZONTAL?null===(G=i.xAxis)||void 0===G?void 0:G.titleColor:null===(B=i.yAxis)||void 0===B?void 0:B.titleColor)&&void 0!==w?w:d.COLORS.content.secondary,font:{size:d.FONTS.caption.fontSize}},grid:{display:i.orientation!==u.GRAPH_ORIENTATION.HORIZONTAL&&(void 0===(null===(D=null==i?void 0:i.showGridLines)||void 0===D?void 0:D.y)||(null===(q=null==i?void 0:i.showGridLines)||void 0===q?void 0:q.y)),color:d.COLORS.background.base},ticks:Object.assign(Object.assign({stepSize:i.orientation===u.GRAPH_ORIENTATION.HORIZONTAL?null===(Z=i.xAxis)||void 0===Z?void 0:Z.stepSize:null===(z=i.yAxis)||void 0===z?void 0:z.stepSize,fontSize:d.FONTS.caption.fontSize,color:null!==(M=i.xAxis.labelColor)&&void 0!==M?M:d.COLORS.content.secondary},le?{min:0,max:2e3,stepSize:200}:{}),{callback:(null==i?void 0:i.ticksCallback)?null==i?void 0:i.ticksCallback:i.orientation!==u.GRAPH_ORIENTATION.VERTICAL?i.isInternationalStore?c.truncateValueForInternationalStore:c.truncateValueForIndianStore:void 0}),stacked:i.orientation===u.GRAPH_ORIENTATION.HORIZONTAL?"boolean"!=typeof(null===(W=i.xAxis)||void 0===W?void 0:W.stacked)||(null===(V=i.xAxis)||void 0===V?void 0:V.stacked):"boolean"!=typeof(null===(Y=i.yAxis)||void 0===Y?void 0:Y.stacked)||(null===(J=i.yAxis)||void 0===J?void 0:J.stacked)})},onClick:(e,t)=>{if(!i.onBarClick)return;const o=t[0].datasetIndex,a=t[0].index,l=e.chart.data.datasets[o].label,n=e.chart.data.labels[a];i.onBarClick(n,l)},onHover:(e,t)=>{i.onBarClick&&t.length&&(e.native.target.style.cursor="pointer")}};i.orientation&&i.orientation!==u.GRAPH_ORIENTATION.VERTICAL?delete ve.scales.y.ticks.callback:delete ve.scales.x.ticks.callback;const pe={labels:ue,datasets:le?[{data:ae,backgroundColor:"rgba(0,0,0,0)"}]:ce},ge={labels:i.xAxis.data.map((e=>"string"==typeof e?e:e.name)),datasets:le?[{data:ae,backgroundColor:"rgba(0,0,0,0)"}]:xe},Oe=function(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return e.jsxRuntimeExports.jsx("div",Object.assign({style:{overflowY:"scroll",display:"flex",flexDirection:"row",gap:"10px",padding:"0px 24px 12px 24px",justifyContent:i.allowChartPopup&&!t?"flex-start":"flex-end",flexWrap:"wrap"}},{children:ce.map((t=>e.jsxRuntimeExports.jsxs("div",Object.assign({style:{display:"flex",alignItems:"center",gap:"8px",marginTop:"4px"}},{children:[e.jsxRuntimeExports.jsx("div",{style:{backgroundColor:t.backgroundColor,width:"16px",height:"16px",borderRadius:"2px"}}),e.jsxRuntimeExports.jsx(r.BodyTiny,Object.assign({color:d.COLORS.content.secondary},{children:t.label}))]}),t.label.replace(" ","_"))))}))};return e.jsxRuntimeExports.jsxs(x.GraphContainerWrapper,Object.assign({style:null!==(K=i.wrapperStyle)&&void 0!==K?K:{},padding:i.outerPadding,customLegend:i.customLegend},{children:[i.chartHeading&&e.jsxRuntimeExports.jsxs("div",Object.assign({style:{marginBottom:24,display:"flex",justifyContent:i.hideHeading?"flex-end":"space-between"}},{children:[!0!==i.hideHeading&&e.jsxRuntimeExports.jsx(r.TitleRegular,Object.assign({color:null!==(Q=i.chartHeading.color)&&void 0!==Q?Q:d.COLORS.content.secondary},{children:i.chartHeading.heading})),i.allowChartPopup&&e.jsxRuntimeExports.jsx("div",Object.assign({style:{display:"flex",justifyContent:"flex-end"}},{children:e.jsxRuntimeExports.jsx("div",{children:e.jsxRuntimeExports.jsx(n.IconButton,{Icon:t.default,onClick:()=>{oe(!0)}})})}))]})),i.customLegend&&e.jsxRuntimeExports.jsxs("div",Object.assign({style:{display:"flex",flexDirection:te,justifyContent:"space-between"}},{children:[e.jsxRuntimeExports.jsx(x.HeaderIconWrapper,{children:ee.map(((t,i)=>e.jsxRuntimeExports.jsx("div",{children:e.jsxRuntimeExports.jsx("div",{children:t})},i)))}),Oe()]})),e.jsxRuntimeExports.jsx("div",Object.assign({className:"graph__wrapper"},{children:e.jsxRuntimeExports.jsx("div",Object.assign({style:{height:null!==(U=i.graphCanvasHeight)&&void 0!==U?U:500,width:null!==(X=i.graphCanvasWidth)&&void 0!==X?X:"auto"}},{children:e.jsxRuntimeExports.jsx(l.Bar,{options:ve,data:pe})}))})),ie&&e.jsxRuntimeExports.jsx(s.StyledModal,Object.assign({open:ie,onClose:()=>oe(!1),closeOnOutsideClick:!0,headingTitle:null===($=i.chartHeading)||void 0===$?void 0:$.heading,width:"85%"},{children:e.jsxRuntimeExports.jsxs("div",Object.assign({className:"graph__wrapper",style:{padding:"8px"}},{children:[i.customLegend&&Oe(!0),e.jsxRuntimeExports.jsx("div",Object.assign({style:{height:"70vh",width:"100%",padding:"16px",borderRadius:"8px"}},{children:e.jsxRuntimeExports.jsx(l.Bar,{options:ve,data:ge})}))]}))}))]}))};
|
|
@@ -7,8 +7,6 @@ export interface AxisDetailsI {
|
|
|
7
7
|
labelColor?: string;
|
|
8
8
|
stepSize?: number;
|
|
9
9
|
stacked?: boolean;
|
|
10
|
-
axisSuffix?: string;
|
|
11
|
-
max?: number;
|
|
12
10
|
}
|
|
13
11
|
export interface XAxisDataI {
|
|
14
12
|
name: string;
|
|
@@ -60,12 +58,10 @@ export interface StackedBarGraphI {
|
|
|
60
58
|
customColourScaleBrand?: string[];
|
|
61
59
|
customColourScalePastel?: string[];
|
|
62
60
|
customHoverColour?: string[];
|
|
63
|
-
customBarColors?: string[] /** Custom colors for individual bars in the stack */;
|
|
64
61
|
isInternationalStore?: boolean;
|
|
65
62
|
truncateBars?: number;
|
|
66
63
|
allowChartPopup?: boolean;
|
|
67
64
|
hideHeading?: boolean;
|
|
68
|
-
/** borderRadius - if number passes only the top bar of the stack will be given radius. Send object to apply border in all the bars of the stack */
|
|
69
65
|
borderRadius?: number | {
|
|
70
66
|
topLeft?: number;
|
|
71
67
|
topRight?: number;
|
|
@@ -85,8 +81,7 @@ export interface StackedBarGraphI {
|
|
|
85
81
|
flag: boolean;
|
|
86
82
|
value: number;
|
|
87
83
|
};
|
|
88
|
-
ticksCallback?: (value: number
|
|
84
|
+
ticksCallback?: (value: number) => string;
|
|
89
85
|
legendsAndIconDirection?: 'row-reverse' | 'row';
|
|
90
86
|
headerIcons?: React.ReactNode[];
|
|
91
|
-
renderInHeightWiseManner?: boolean /** When true, renders smaller bars on top of larger bars */;
|
|
92
87
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../../node_modules/react/jsx-runtime.js"),i=require("chart.js"),t=require("react-chartjs-2"),r=require("../../../TypographyStyle.js"),o=require("../../../../constants/Theme.js"),s=require("../LineChart/LineChart.styled.js"),a=require("./VerticalBarAndLinearGraph.styles.js");i.Chart.register(i.CategoryScale,i.LinearScale,i.BarElement,i.Tooltip);exports.VerticalBarAndLinearGraph=i=>{var n,l,x,c,d;const p=[0,0,0,0,0,0],g=-1===i.barAxis.data.findIndex((e=>0!==e)),b=-1===i.lineAxis.data.findIndex((e=>0!==e)),u={min:0,max:2e3,stepSize:200},j=[{legend:i.barAxis.title,color:i.barAxis.graphColor},{legend:i.lineAxis.title,color:i.lineAxis.graphColor}],h={responsive:!0,plugins:{legend:{display:!1}},scales:{x:{title:{display:!!i.xAxis.title,text:i.xAxis.title,color:i.xAxis.titleColor,font:{size:o.FONTS.caption.fontSize}},grid:{display:!1,borderColor:o.COLORS.background.base},ticks:{fontSize:o.FONTS.caption.fontSize,color:null!==(n=i.xAxis.labelColor)&&void 0!==n?n:o.COLORS.content.secondary}},bar:{position:"left",title:{display:!!i.barAxis.title,text:i.barAxis.title,color:i.barAxis.titleColor,font:{size:o.FONTS.caption.fontSize}},grid:{borderColor:"white",color:o.COLORS.background.base},ticks:Object.assign({fontSize:o.FONTS.caption.fontSize,color:null!==(l=i.barAxis.labelColor)&&void 0!==l?l:o.COLORS.content.secondary},g?u:{})},line:{position:"right",title:{display:!!i.lineAxis.title,text:i.lineAxis.title,color:i.lineAxis.titleColor,font:{size:o.FONTS.caption.fontSize}},grid:{display:!1,borderColor:"white",color:o.COLORS.background.base},ticks:Object.assign({fontSize:o.FONTS.caption.fontSize,color:null!==(x=i.lineAxis.labelColor)&&void 0!==x?x:o.COLORS.content.secondary},b?u:{}),display:!0}},maintainAspectRatio:!1},A={labels:i.xAxis.forceShowXAxis?i.xAxis.data.map((e=>e.toString())):g&&b?["-","-","-","-","-","-"]:i.xAxis.data.map((e=>e.toString())),datasets:[{yAxisID:"line",type:"line",data:b?p:i.lineAxis.data,borderColor:i.lineAxis.graphColor||"rgba(0,0,0,0)",borderWidth:2,fill:!1,pointRadius:1},{yAxisID:"bar",type:"bar",data:g?p:i.barAxis.data,backgroundColor:i.barAxis.graphColor||"rgba(0,0,0,0)",barPercentage:.4,categoryPercentage:1,borderRadius:4}]};return e.jsxRuntimeExports.jsxs("div",Object.assign({style:{display:"flex",flexDirection:"column",gap:2}},{children:[e.jsxRuntimeExports.jsx(s.LegendWrapper,Object.assign({position:"center"},{children:j.map(((i,t)=>{let{legend:o,color:a}=i;return o?e.jsxRuntimeExports.jsxs(s.LegendContainer,{children:[e.jsxRuntimeExports.jsx(s.LegendColor,{color:a}),e.jsxRuntimeExports.jsx(r.SmallRegular,Object.assign({color:"#667085"},{children:o}))]},t):e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{})}))})),e.jsxRuntimeExports.jsxs(a.GraphContainerWrapper,{children:[i.chartHeading&&e.jsxRuntimeExports.jsx("div",Object.assign({style:{marginBottom:24}},{children:e.jsxRuntimeExports.jsx(r.TitleRegular,Object.assign({color:null!==(c=i.chartHeading.color)&&void 0!==c?c:o.COLORS.content.secondary},{children:i.chartHeading.heading}))})),e.jsxRuntimeExports.jsx("div",Object.assign({style:{height:null!==(d=i.graphCanvasHeight)&&void 0!==d?d:500}},{children:e.jsxRuntimeExports.jsx(t.Chart,{type:"bar",data:A,options:h})}))]})]}))};
|
|
@@ -1,7 +1 @@
|
|
|
1
1
|
export declare const GraphContainerWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
2
|
-
export declare const LegendsWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
3
|
-
export declare const LegendMiddleWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
4
|
-
export declare const LegendColorBox: import("styled-components").StyledComponent<"div", any, {
|
|
5
|
-
color: string;
|
|
6
|
-
}, never>;
|
|
7
|
-
export declare const GraphWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
@@ -1,25 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("styled-components"),r=require("../../../../constants/Theme.js");function
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("styled-components"),r=require("../../../../constants/Theme.js");function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}const n=t(e).default.div`
|
|
2
2
|
background-color: ${r.COLORS.surface.standard};
|
|
3
3
|
padding: 0;
|
|
4
|
-
|
|
5
|
-
display: flex;
|
|
6
|
-
flex-direction: row;
|
|
7
|
-
gap: 10px;
|
|
8
|
-
padding: 0px 24px 12px 24px;
|
|
9
|
-
justify-content: flex-end;
|
|
10
|
-
flex-wrap: wrap;
|
|
11
|
-
`,o=t.default.div`
|
|
12
|
-
display: flex;
|
|
13
|
-
align-items: center;
|
|
14
|
-
gap: 8px;
|
|
15
|
-
margin-top: 4px;
|
|
16
|
-
`,i=t.default.div`
|
|
17
|
-
background-color: ${e=>e.color};
|
|
18
|
-
width: 16px;
|
|
19
|
-
height: 16px;
|
|
20
|
-
border-radius: 2px;
|
|
21
|
-
`,n=t.default.div`
|
|
22
|
-
display: flex;
|
|
23
|
-
flex-direction: column;
|
|
24
|
-
gap: 2px;
|
|
25
|
-
`;exports.GraphContainerWrapper=d,exports.GraphWrapper=n,exports.LegendColorBox=i,exports.LegendMiddleWrapper=o,exports.LegendsWrapper=a;
|
|
4
|
+
`;exports.GraphContainerWrapper=n;
|
|
@@ -4,17 +4,11 @@ export interface AxisDetailsI {
|
|
|
4
4
|
data: number[] | string[];
|
|
5
5
|
labelColor?: string;
|
|
6
6
|
graphColor?: string;
|
|
7
|
-
axisSuffix?: string;
|
|
8
|
-
max?: number;
|
|
9
7
|
}
|
|
10
8
|
export interface ChartHeadingI {
|
|
11
9
|
heading: string;
|
|
12
10
|
color?: string;
|
|
13
11
|
}
|
|
14
|
-
export declare enum GRAPH_ORIENTATION {
|
|
15
|
-
VERTICAL = "vertical",
|
|
16
|
-
HORIZONTAL = "horizontal"
|
|
17
|
-
}
|
|
18
12
|
export interface VerticalBarAndLinearGraphI {
|
|
19
13
|
graphCanvasHeight?: number;
|
|
20
14
|
tickColor?: string;
|
|
@@ -24,11 +18,5 @@ export interface VerticalBarAndLinearGraphI {
|
|
|
24
18
|
forceShowXAxis?: boolean;
|
|
25
19
|
};
|
|
26
20
|
lineAxis: AxisDetailsI;
|
|
27
|
-
lineAxis2?: AxisDetailsI;
|
|
28
21
|
barAxis: AxisDetailsI;
|
|
29
|
-
isInternationalStore?: boolean;
|
|
30
|
-
customLegend?: boolean;
|
|
31
|
-
orientation?: GRAPH_ORIENTATION;
|
|
32
|
-
noDummyValues?: boolean;
|
|
33
|
-
pointRadius?: number;
|
|
34
22
|
}
|
|
@@ -11,6 +11,7 @@ export type ToasterProps = {
|
|
|
11
11
|
subText?: string;
|
|
12
12
|
position?: ToastPosition;
|
|
13
13
|
type?: 'info' | 'success' | 'error' | 'default' | 'warning';
|
|
14
|
+
duration?: number;
|
|
14
15
|
closeOnClick?: boolean;
|
|
15
16
|
hideProgressBar?: boolean;
|
|
16
17
|
autoClose?: number | false | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("../../node_modules/react/jsx-runtime.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("../../node_modules/react/jsx-runtime.js"),e=require("../../assets/icons/alert_triangle.svg.js"),o=require("../../assets/icons/check.svg.js"),s=require("../../assets/icons/cross.svg.js"),n=require("../../assets/icons/errorInfo.svg.js"),i=require("../../assets/icons/info.svg.js"),r=require("react"),u=require("react-dom"),l=require("react-toastify"),a=require("../button/Button.js"),d=require("./Toaster.styled.js"),c=require("../TypographyStyle.js"),x=require("../../constants/Theme.js");function p(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var j=p(r),h=p(u);const g=e=>t.jsxRuntimeExports.jsxs(c.BodySecondary,{children:["Skip in ",e.duration," sec "]}),y=e=>{console.log(e);const o="default"===e.type?"#fff":"success"===e.type?x.COLORS.background.positive.light:"error"===e.type?x.COLORS.background.negative.light:"warning"===e.type?x.COLORS.background.warning.light:x.COLORS.background.brandLight,n="default"===e.type?x.COLORS.stroke.primary:"success"===e.type?x.COLORS.stroke.positive.lightAlt:"error"===e.type?x.COLORS.stroke.negative.lightAlt:"warning"===e.type?x.COLORS.stroke.warning.lightAlt:x.COLORS.stroke.brandLightAlt,i="default"===e.type?x.COLORS.content.primary:"success"===e.type?x.COLORS.content.positive:"error"===e.type?x.COLORS.content.negative:"warning"===e.type?x.COLORS.content.warning:x.COLORS.content.brand,{timerValue:u}=r.useContext(R);return console.log(u),t.jsxRuntimeExports.jsx("div",Object.assign({tabIndex:0,role:"button",style:{backgroundColor:o,border:`1px solid ${n}`,borderRadius:8,position:"absolute",top:-12,right:-12,width:u>0?130:40,display:"flex",justifyContent:"center",alignItems:"center",cursor:"pointer",zIndex:10,paddingRight:u>0?8:0},onClick:e.closeToast,onKeyDown:t=>{"Enter"===t.key&&e.closeToast&&e.closeToast()}},{children:u>0?t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(g,{duration:u}),t.jsxRuntimeExports.jsx(s.default,{height:20,width:20,color:i})]}):t.jsxRuntimeExports.jsx(s.default,{height:20,width:20,color:i})}))},f=e=>{var o,s;const n=x.COLORS.content.placeholder,{toasterText:i}=r.useContext(R);return t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{children:t.jsxRuntimeExports.jsxs("div",Object.assign({style:{display:"flex",flexGrow:1}},{children:[t.jsxRuntimeExports.jsx("div",Object.assign({style:{flexGrow:1,marginRight:32,display:"flex",alignItems:"center"}},{children:t.jsxRuntimeExports.jsxs("div",{children:[e.subText?t.jsxRuntimeExports.jsx(c.TitleSmall,Object.assign({color:"inherit"},{children:null!==(o=e.toastText)&&void 0!==o?o:i})):t.jsxRuntimeExports.jsx(c.BodySecondary,Object.assign({color:"inherit"},{children:null!==(s=e.toastText)&&void 0!==s?s:i})),e.subText&&t.jsxRuntimeExports.jsx("div",Object.assign({style:{marginTop:2}},{children:t.jsxRuntimeExports.jsx(c.BodyCaption,Object.assign({color:x.COLORS.content.secondary},{children:e.subText}))}))]})})),e.showButton&&t.jsxRuntimeExports.jsx("div",Object.assign({style:{display:"flex",flexDirection:"column",alignSelf:"center",padding:"6px 4px",marginRight:{showSecondButton:4,showButton:0}[e.showSecondButton?"showSecondButton":"showButton"]}},{children:t.jsxRuntimeExports.jsx(a.Button,{buttonText:e.buttonText,buttonType:"tertiaryGray",color:x.COLORS.content.secondary,onClick:e.onButtonClick})})),e.showSecondButton&&t.jsxRuntimeExports.jsx("div",Object.assign({style:{display:"flex",flexDirection:"column",alignSelf:"center",padding:"6px 4px"}},{children:t.jsxRuntimeExports.jsx(a.Button,{buttonText:e.secondButtonText,buttonType:"tertiaryGray",color:x.COLORS.content.secondary,onClick:e.onSecondButtonClick})})),e.showButton||e.showSecondButton?t.jsxRuntimeExports.jsx("div",{style:{height:28,alignSelf:"center",marginLeft:8,marginRight:8,borderRight:`1px solid ${n}`,borderRadius:1}}):null]}))})},R=j.default.createContext({toasterText:"",timerValue:0});exports.Toaster=s=>{const u=r.useRef(s.toastId||"default-toast"),[a,c]=r.useState(s.text),[p,j]=r.useState(s.duration||0),g=l.cssTransition({enter:"Toastify__slide-enter",exit:"Toastify__slide-exit"}),m="default"===s.type?null:"success"===s.type?t.jsxRuntimeExports.jsx(o.default,{width:20,height:20,color:x.COLORS.content.positive}):"error"===s.type?t.jsxRuntimeExports.jsx(n.default,{width:20,height:20,color:x.COLORS.content.negative}):"warning"===s.type?t.jsxRuntimeExports.jsx(e.default,{width:20,height:20,color:x.COLORS.content.warning}):t.jsxRuntimeExports.jsx(i.default,{width:20,height:20,color:x.COLORS.content.brand});r.useEffect((()=>{u.current&&u.current===s.toastId?(c(s.text),l.toast.update(u.current,{autoClose:s.autoClose})):u.current&&u.current!==s.toastId&&b(s.text)}),[s.toastId,s.text]),r.useEffect((()=>{if(!s.duration)return;j(s.duration);const t=setInterval((()=>{j((e=>{const o=e-1;return o<=0?(clearInterval(t),0):o}))}),1e3);return()=>clearInterval(t)}),[s.duration]);const b=e=>{var o,n,i,r,a,d,c,x,j,h,R,b;void 0!==s.hideLeftIcon||s.leftIcon?l.toast(t.jsxRuntimeExports.jsx(f,{toastText:e,type:s.type||"info",buttonText:null===(o=s.buttonProps)||void 0===o?void 0:o.buttonText,secondButtonText:null===(n=s.secondButtonProps)||void 0===n?void 0:n.buttonText,showButton:null===(i=s.buttonProps)||void 0===i?void 0:i.showButton,showSecondButton:null===(r=s.secondButtonProps)||void 0===r?void 0:r.showButton,onButtonClick:null===(a=s.buttonProps)||void 0===a?void 0:a.onButtonClick,onSecondButtonClick:null===(d=s.secondButtonProps)||void 0===d?void 0:d.onButtonClick,subText:s.subText}),{onClose:s.onCloseToast?s.onCloseToast:()=>({}),icon:!0!==s.hideLeftIcon&&(s.leftIcon?s.leftIcon:"default"!==s.type&&t.jsxRuntimeExports.jsx("div",Object.assign({style:{display:"flex",alignItems:"flex-start"}},{children:m}))),type:s.type,closeButton:t.jsxRuntimeExports.jsx(y,{type:s.type||"default",timer:p}),toastId:s.toastId||"default-toast",transition:g}):u.current=l.toast(t.jsxRuntimeExports.jsx(f,{toastText:e,type:s.type||"info",buttonText:null===(c=s.buttonProps)||void 0===c?void 0:c.buttonText,secondButtonText:null===(x=s.secondButtonProps)||void 0===x?void 0:x.buttonText,showButton:null===(j=s.buttonProps)||void 0===j?void 0:j.showButton,showSecondButton:null===(h=s.secondButtonProps)||void 0===h?void 0:h.showButton,onButtonClick:null===(R=s.buttonProps)||void 0===R?void 0:R.onButtonClick,onSecondButtonClick:null===(b=s.secondButtonProps)||void 0===b?void 0:b.onButtonClick,subText:s.subText}),{onClose:s.onCloseToast?s.onCloseToast:()=>({}),type:s.type,icon:"default"!==s.type&&t.jsxRuntimeExports.jsx("div",Object.assign({style:{display:"flex",alignItems:"flex-start"}},{children:m})),closeButton:t.jsxRuntimeExports.jsx(y,{type:s.type||"default",timer:p}),toastId:s.toastId||"default-toast",transition:g})};return r.useEffect((()=>{b()}),[]),h.default.createPortal(t.jsxRuntimeExports.jsx(d.ToasterStyled,Object.assign({width:s.width,height:s.height,zIndex:s.zIndex,isSubTextIncluded:!!s.subText,type:s.type},{children:t.jsxRuntimeExports.jsx(R.Provider,Object.assign({value:{toasterText:a,timerValue:p}},{children:t.jsxRuntimeExports.jsx(l.ToastContainer,{position:s.position||"top-right",closeOnClick:s.closeOnClick||!1,hideProgressBar:s.hideProgressBar||!1,draggable:!1,autoClose:s.autoClose||!1,theme:"colored"})}))})),document.body)};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var c=require("../../node_modules/@emotion/styled/base/dist/emotion-styled-base.esm.js"),t=require("../../constants/Theme.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var c=require("../../node_modules/@emotion/styled/base/dist/emotion-styled-base.esm.js"),t=require("../../constants/Theme.js"),l=require("../../constants/zindex.js");const d=c.default("div","production"===process.env.NODE_ENV?{target:"e1tdeuzc0"}:{target:"e1tdeuzc0",label:"ToasterStyled"})("--toastify-color-light:#fff;--toastify-color-dark:#121212;--toastify-text-color-success:",t.COLORS.content.primary,";--toastify-text-color-error:",t.COLORS.content.primary,";--toastify-text-color-warning:",t.COLORS.content.primary,";--toastify-text-color-info:",t.COLORS.content.primary,";--toastify-color-info:",t.COLORS.background.brandLight,";--toastify-color-success:",t.COLORS.background.positive.light,";--toastify-color-error:",t.COLORS.background.negative.light,";--toastify-color-warning:",t.COLORS.background.warning.light,";--toastify-text-color-light:",t.COLORS.content.primary,";--toastify-toast-width:fit-content;--toastify-toast-min-height:",(c=>c.height||(c.isSubTextIncluded?"70px":"56px")),";--toastify-toast-max-height:",(c=>c.height||"fit-content"),";font-family:inherit;z-index:",(c=>c.zIndex||l.ComponentZindex.TOASTER),";.custom-position{position:relative;}.Toastify__toast-container{padding:0;overflow:visible;}.Toastify__toast{position:relative;overflow:visible;}.Toastify__toast--success{border:1px solid ",t.COLORS.stroke.positive.lightAlt,";}.Toastify__toast--info{border:1px solid ",t.COLORS.stroke.brandLightAlt,";}.Toastify__toast--default{border:1px solid ",t.COLORS.stroke.primary,";}.Toastify__toast--error{border:1px solid ",t.COLORS.stroke.negative.lightAlt,";}.Toastify__toast--warning{border:1px solid ",t.COLORS.stroke.warning.lightAlt,";}.Toastify__toast{padding:",(c=>c.isSubTextIncluded?"16px":"12px"),";max-width:",(c=>c.width),";border-radius:8px;}.Toastify__progress-bar{height:4px;}.Toastify__close-button{display:block;margin:auto;}.Toastify__toast-icon{align-self:center;margin-inline-end:12px;height:",(c=>c.isSubTextIncluded?"38px":"20px"),";}.Toastify__toast-body{padding:0;}.Toastify__progress-bar-theme--colored.Toastify__progress-bar--default{background:",t.COLORS.content.brand,";}.Toastify__progress-bar-theme--colored.Toastify__progress-bar--info{background:",t.COLORS.content.brand,";}.Toastify__progress-bar-theme--colored.Toastify__progress-bar--warning{background:",t.COLORS.content.warning,";}.Toastify__progress-bar-theme--colored.Toastify__progress-bar--success{background:",t.COLORS.content.positive,";}.Toastify__progress-bar-theme--colored.Toastify__progress-bar--error{background:",t.COLORS.content.negative,";}.Toastify__toast-body>div:last-child{display:flex;}.Toastify__slide-enter{animation:slideIn 1s ease forwards,bounce cubic-bezier(0.68, -0.55, 0.27, 1.55) 0.5s both;}.Toastify__slide-exit{animation:slideOut 0.5s ease-in-out forwards;}@keyframes bounce{0%,20%,50%,80%,100%{transform:translateY(0);}40%{transform:translateX(-20px);}60%{transform:translateX(20px);}}@keyframes slideIn{0%{transform:translateX(-100%);opacity:0;}100%{transform:translateX(0);opacity:1;}}@keyframes slideOut{0%{transform:translateX(0);opacity:1;}100%{transform:translateX(100%);opacity:0;}}"+("production"===process.env.NODE_ENV?"":"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIlRvYXN0ZXIuc3R5bGVkLnRzeCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFHd0MiLCJmaWxlIjoiVG9hc3Rlci5zdHlsZWQudHN4Iiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHN0eWxlZCBmcm9tICdAZW1vdGlvbi9zdHlsZWQnO1xyXG5pbXBvcnQgeyBDT0xPUlMgfSBmcm9tIFwiLi4vLi4vY29uc3RhbnRzL1RoZW1lXCI7XHJcbmltcG9ydCB7IENvbXBvbmVudFppbmRleCB9IGZyb20gXCIuLi8uLi9jb25zdGFudHMvemluZGV4XCI7XHJcbmV4cG9ydCBjb25zdCBUb2FzdGVyU3R5bGVkID0gc3R5bGVkLmRpdiBgXG5cdC0tdG9hc3RpZnktY29sb3ItbGlnaHQ6ICNmZmY7XG5cdC0tdG9hc3RpZnktY29sb3ItZGFyazogIzEyMTIxMjtcblx0LS10b2FzdGlmeS10ZXh0LWNvbG9yLXN1Y2Nlc3M6ICR7Q09MT1JTLmNvbnRlbnQucHJpbWFyeX07XG5cdC0tdG9hc3RpZnktdGV4dC1jb2xvci1lcnJvcjogJHtDT0xPUlMuY29udGVudC5wcmltYXJ5fTtcblx0LS10b2FzdGlmeS10ZXh0LWNvbG9yLXdhcm5pbmc6ICR7Q09MT1JTLmNvbnRlbnQucHJpbWFyeX07XG5cdC0tdG9hc3RpZnktdGV4dC1jb2xvci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wO1xuXHRcdH1cblx0XHQxMDAlIHtcblx0XHRcdHRyYW5zZm9ybTogdHJhbnNsYXRlWCgwKTsgLyogRW5kIGF0IHRoZSBvcmlnaW5hbCBwb3NpdGlvbiAqL1xuXHRcdFx0b3BhY2l0eTogMTtcblx0XHR9XG5cdH1cblx0QGtleWZyYW1lcyBzbGlkZU91dCB7XG5cdFx0MCUge1xuXHRcdFx0dHJhbnNmb3JtOiB0cmFuc2xhdGVYKDApOyAvKiBTdGFydCBmcm9tIHRoZSBvcmlnaW5hbCBwb3NpdGlvbiAqL1xuXHRcdFx0b3BhY2l0eTogMTtcblx0XHR9XG5cdFx0MTAwJSB7XG5cdFx0XHR0cmFuc2Zvcm06IHRyYW5zbGF0ZVgoMTAwJSk7IC8qIFNsaWRlIG91dCB0byB0aGUgcmlnaHQgKi9cblx0XHRcdG9wYWNpdHk6IDA7XG5cdFx0fVxuXHR9XG5gO1xyXG4vLyMgc291cmNlTWFwcGluZ1VSTD1Ub2FzdGVyLnN0eWxlZC5qcy5tYXAiXX0= */"));exports.ToasterStyled=d;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e}from"../../node_modules/react/jsx-runtime.js";import t,{useState as i,useEffect as n}from"react";import{ShimmerComponentStyled as
|
|
1
|
+
import{j as e}from"../../node_modules/react/jsx-runtime.js";import t,{useState as i,useEffect as n}from"react";import{ShimmerComponentStyled as s}from"../shimmer/ShimmerComponent/ShimmerStyled.js";import r from"../../utils/DateUtils.js";import{COLORS as o}from"../../constants/Theme.js";import l from"../../assets/icons/arrow_down.svg.js";import a from"../../assets/icons/arrow_up.svg.js";import c from"../../assets/icons/info.svg.js";import{Tag as d}from"../tag/Tag.js";import{Tooltip as m}from"../tooltips/Tooltip.js";import{BodyCaption as g,Caption as h,TitleLarge as p,TitleMedium as j}from"../TypographyStyle.js";import{truncateValueForInternationalStore as y,truncateValueForIndianStore as x}from"./chart/utils/calcPercentage.js";import{AnalyticsTrendContainer as u,IconContainer as b}from"./CommonStyles.js";const f=i=>{let{title:n,value:r,trendPercent:l,type:a="horizontal",timeline:h,customRange:f,tooltip:T,card:O=!0,rightSeparator:S=!1,size:w="big",share:$=!1,formatVal:I,prefixSymbol:R,trailingIcon:C,onTrailIconClick:D,iconTooltipBody:M,funnelPercent:k,isLoading:L,trendRaw:z,suffixText:F,trendStyle:P,trendContainerStyle:N,trendIconStyle:_,containerStyle:W,prevTrendDiff:A,relativePercentageDiff:B,isInternationalStore:E,Icon:U,iconContainerStyle:V,tooltipTimelineText:q,customTimelineText:G}=i;const H="big"===w?p:j,J=void 0!==l?l<0?"negative":0===l?"neutral":"positive":void 0,K=void 0!==l?$?Math.round(l):Math.abs(Math.round(l)):void 0;return e.jsx(u,Object.assign({card:O,style:Object.assign({},W)},{children:e.jsxs("div",Object.assign({style:Object.assign({display:"flex",flexDirection:"row",gap:U?12:4,borderRightWidth:S?1:0,borderRightColor:o.stroke.primary,borderRightStyle:"solid",paddingLeft:O?0:24,paddingRight:O?0:24,height:"100%",justifyContent:U?"flex-start":"space-between",alignItems:"center"},null!=N?N:{})},{children:[!!U&&e.jsx(b,Object.assign({style:Object.assign({},V)},{children:e.jsx(U,{})})),e.jsxs("div",Object.assign({style:Object.assign({display:"flex",flexDirection:"column",gap:4,height:"100%"},null!=P?P:{})},{children:[e.jsxs("div",Object.assign({style:{display:"flex",flexDirection:"row",gap:4,alignItems:"center"}},{children:[e.jsx(g,Object.assign({style:{color:o.content.secondary}},{children:n})),T&&e.jsx(m,Object.assign({body:T,placement:"right",width:300},{children:e.jsx("div",Object.assign({style:{display:"flex",cursor:"pointer",height:"100%"}},{children:e.jsx(c,{color:o.content.primary,height:16,width:16})}))}))]})),e.jsxs("div",Object.assign({style:Object.assign({display:"flex",flexDirection:"row",gap:12,alignItems:"center"},$?{justifyContent:"space-between"}:{})},{children:[L&&e.jsx(s,{width:108,height:26}),!L&&e.jsx(H,Object.assign({style:{color:o.content.primary}},{children:void 0===r?"--":"number"==typeof r&&I?r>999?E?`${null!=R?R:""}${y(r)} ${null!=F?F:""}`:`${null!=R?R:""}${x(r)} ${null!=F?F:""}`:`${null!=R?R:""}${new Intl.NumberFormat("en-IN",{maximumFractionDigits:2}).format(r)} ${null!=F?F:""}`:`${null!=R?R:""}${r} ${null!=F?F:""}`})),"number"==typeof B&&e.jsx(d,{tagText:`${B}%`,theme:"light",type:"neutral"}),"horizontal"===a&&!L&&!$&&e.jsx(v,{timeline:h,customRange:f,percent:K,direction:J,trendRaw:z,prefixSymbol:R,trendIconStyle:_,isInternationalStore:E,tooltipTimelineText:q,customTimelineText:G}),L&&!$&&"horizontal"===a&&e.jsx(s,{height:20,width:141,marginTop:6}),"vertical"===a&&!L&&void 0!==k&&e.jsx(d,{tagText:`${k} %`,theme:"light",type:"neutral"}),$&&!L&&void 0!==K&&e.jsx(d,{tagText:`${K} %`,theme:"light",type:"neutral"}),$||L||!A||0==A?e.jsx(e.Fragment,{}):e.jsx(d,{tagText:(e=>{const t=Math.abs(e);return t%1!=0?`${t.toFixed(1)} %`:`${t} %`})(A),theme:"light",type:"neutral"})]})),"vertical"===a&&!L&&!$&&e.jsx("div",Object.assign({style:{marginTop:10}},{children:e.jsx(v,{timeline:h,customRange:f,percent:K,direction:J,trendRaw:z,prefixSymbol:R,trendIconStyle:_,isInternationalStore:E,tooltipTimelineText:q,customTimelineText:G})})),L&&"vertical"===a&&e.jsx(s,{height:20,width:141,marginTop:6})]})),M&&!L&&e.jsx(m,Object.assign({body:M,placement:"right"},{children:C&&e.jsx("div",Object.assign({className:"icon--holder",onClick:D},{children:t.createElement(C,{height:20,width:20,color:o.content.secondary})}))}))]}))}))},v=t=>{let{percent:s,direction:c,timeline:d,customRange:g,trendRaw:p,prefixSymbol:j,trendIconStyle:u,isInternationalStore:b,tooltipTimelineText:f,customTimelineText:v}=t;const T=()=>{const e=((null!=p?p:0)>0?"+":"")+(null!=j?j:"");return void 0===p?"--":`${null!=e?e:""}${(()=>{let e="--";if(p)return e=String(b?y(Math.abs(p)):x(Math.abs(p))),p<0?"-"+e:e})()}`},[O,S]=i(T()),[w,$]=i(v||"");n((()=>{v||$("today"===d?"vs yesterday":"yesterday"===d?"vs 1 day before":"7 days"===d?"vs last 7 days":"30 days"===d?"vs last 30 days":"custom"===d&&g?r.getAnalyticsCustomDateTimelineText(g):"")}),[d,g]),n((()=>{S(T())}),[p]);const I="negative"===c?l:a,R="negative"===c?o.background.negative.vibrant:"positive"===c?o.background.positive.vibrant:o.content.placeholder;return e.jsxs("div",Object.assign({style:{display:"flex",alignItems:"center",flexDirection:"row",flexWrap:"wrap"}},{children:["number"==typeof s&&e.jsx(I,{color:R,height:16,width:16,style:Object.assign({marginRight:2},null!=u?u:{})}),"number"==typeof s&&c&&e.jsxs(h,Object.assign({style:{color:R}},{children:["neutral"===c?0:s<1e3?s:">999","%"]})),!!p&&e.jsx(h,Object.assign({style:{marginLeft:4,color:o.content.placeholder}},{children:`(${O})`})),d&&(f?e.jsx(m,Object.assign({body:f,placement:"bottom"},{children:e.jsx(h,Object.assign({style:{marginLeft:4,color:o.content.placeholder}},{children:v||w}))})):e.jsx(h,Object.assign({style:{marginLeft:4,color:o.content.placeholder}},{children:v||w})))]}))};export{f as AnalyticsTrend};
|
package/dist/esm/components/analytics-chips-and-dropdowns/chart/StackedBarChart/StackedBarChart.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as i}from"../../../../node_modules/react/jsx-runtime.js";import o from"../../../../assets/icons/maximize.svg.js";import{Chart as t,CategoryScale as e,LinearScale as l,BarElement as a,Tooltip as n,Legend as s}from"chart.js";import d from"chartjs-plugin-datalabels";import{useState as r,useMemo as c}from"react";import{Bar as u}from"react-chartjs-2";import{IconButton as v}from"../../../icon-button/IconButton.js";import{StyledModal as x}from"../../../modals/styledModal.js";import{TitleRegular as p,BodyTiny as g}from"../../../TypographyStyle.js";import{COLORS as b,FONTS as h}from"../../../../constants/Theme.js";import{truncateValueForInternationalStore as m,truncateValueForIndianStore as f}from"../utils/calcPercentage.js";import{GRAPH_ORIENTATION as y,COLOR_SCHEMA as j}from"./StackedBarChart.model.js";import{GraphContainerWrapper as A,HeaderIconWrapper as O}from"./StackedBarChart.styles.js";t.register(e,l,a,n,s,d);const C=t=>{var e,l,a,n,s,d,C,k,S,L,F,H,I,T,R,w,B,E,D,N,Z,z,P,G,$,W,_,M,q,V,Y,J,K,Q,U,X,ii,oi,ti,ei,li,ai,ni,si,di;const{headerIcons:ri=[],legendsAndIconDirection:ci="row"}=t,[ui,vi]=r(!1),xi=[250,1e3,800,1500,300,600],pi=0===t.yAxis.data.length,gi=["#5E07BB","#9E77ED","#D2AEFF","#F7D7FF","#CDE1FF","#92AFFA","#3935E1"],bi=["#E6C7FF","#FEC6C6","#FEDEF3","#DEEFFF","#FFD8B1","#C7E5FF","#FFD3E6","#C9FFE5","#FFE3C7","#D9D9FF"],hi=t.customBarColors?t.customBarColors:t.customColourScaleBrand||t.customColourScalePastel?t.colorSchema===j.PASTEL?t.customColourScalePastel:t.customColourScaleBrand:t.colorSchema===j.PASTEL?bi:gi,mi=t.customHoverColour,fi=c((()=>{var i,o,e;return Object.assign(Object.assign({barPercentage:(null==t?void 0:t.barPercentage)||.4,categoryPercentage:1,pointStyle:"circle",barWidth:t.barWidth,borderRadius:(null==t?void 0:t.borderRadius)||void 0},"object"==typeof(null==t?void 0:t.borderRadius)?{borderSkipped:!1}:{}),(null===(i=null==t?void 0:t.addBarGap)||void 0===i?void 0:i.flag)?{borderWidth:{top:(null===(o=null==t?void 0:t.addBarGap)||void 0===o?void 0:o.value)||2,bottom:(null===(e=null==t?void 0:t.addBarGap)||void 0===e?void 0:e.value)||2,right:0,left:0},borderColor:"transparent"}:{})}),[t.barWidth,null==t?void 0:t.borderRadius,null==t?void 0:t.barPercentage,null==t?void 0:t.addBarGap]),yi={};t.yAxis.data.map((i=>{i.map((i=>{yi[i.name]?yi[i.name].push(i.value):yi[i.name]=[i.value]}))}));const ji=Object.keys(yi).map(((i,o)=>Object.assign({label:i,data:yi[i],backgroundColor:null==hi?void 0:hi[o],hoverBackgroundColor:void 0===mi?void 0:mi[o]},fi)));let Ai;Ai=t.renderInHeightWiseManner?ji.map(((i,o)=>Object.assign(Object.assign({},i),{order:i.data.reduce(((i,o)=>i+(o||0)),0)}))).sort(((i,o)=>o.order-i.order)):ji;let Oi=t.xAxis.data.map((i=>"string"==typeof i?i:i.name)),Ci=Ai;if(t.truncateBars){const i=((i,o,t)=>{if(o.length<=t)return{truncatedData:i,truncatedLabels:o,originalData:i,originalLabels:o};const e=i.map((i=>i.slice(0,t))),l=i.map((i=>i.slice(t).reduce(((i,o)=>i+o),0)));e.forEach(((i,o)=>i.push(l[o])));const a=o.slice(0,t);return a.push("Others"),{truncatedData:e,truncatedLabels:a,originalData:i,originalLabels:o}})(Ai.map((i=>i.data)),Oi,t.truncateBars);Ai.forEach(((o,t)=>o.data=i.truncatedData[t])),Oi=i.truncatedLabels,Ci=i.originalData.map(((i,o)=>Object.assign(Object.assign({},Ai[o]),{data:i})))}const ki={plugins:{legend:{display:!pi&&!t.customLegend,labels:{usePointStyle:!0,fontSize:2}},tooltip:{enabled:!pi,callbacks:{label:null===(e=t.tooltipConfig)||void 0===e?void 0:e.labelCallback,title:null===(l=t.tooltipConfig)||void 0===l?void 0:l.titleCallback,footer:null===(a=t.tooltipConfig)||void 0===a?void 0:a.footerCallback},footerFont:null===(s=null===(n=t.tooltipConfig)||void 0===n?void 0:n.footerStyles)||void 0===s?void 0:s.footerFont},datalabels:{display:null!==(d=t.showTotal)&&void 0!==d&&d,anchor:"end",align:"end",clamp:!0,formatter:(i,o)=>{var t;const e=o.datasetIndex,l=o.chart.data.datasets;if(e!==l.length-1)return"";const a=o.dataIndex;let n=0;for(let i=0;i<l.length;i++)n+=null!==(t=l[i].data[a])&&void 0!==t?t:0;return n?n<1e3?n:(n/1e3).toString().substring(0,4)+"k":""},color:b.content.secondary}},layout:{padding:{right:t.showTotal&&t.orientation===y.HORIZONTAL?50:0,top:t.showTotal&&t.orientation!=y.HORIZONTAL?50:0}},responsive:!0,maintainAspectRatio:!1,legend:{display:!t.customLegend,labels:{usePointStyle:!0}},indexAxis:t.orientation===y.HORIZONTAL?"y":"x",scales:{x:{title:{display:!!(t.orientation===y.HORIZONTAL?null===(C=t.yAxis)||void 0===C?void 0:C.title:null===(k=t.xAxis)||void 0===k?void 0:k.title),text:t.orientation===y.HORIZONTAL?null===(S=t.yAxis)||void 0===S?void 0:S.title:null===(L=t.xAxis)||void 0===L?void 0:L.title,color:null!==(I=t.orientation===y.HORIZONTAL?null===(F=t.yAxis)||void 0===F?void 0:F.titleColor:null===(H=t.xAxis)||void 0===H?void 0:H.titleColor)&&void 0!==I?I:b.content.secondary,font:{size:h.caption.fontSize}},grid:{display:t.orientation===y.HORIZONTAL&&(void 0===(null===(T=null==t?void 0:t.showGridLines)||void 0===T?void 0:T.x)||(null===(R=null==t?void 0:t.showGridLines)||void 0===R?void 0:R.x)),color:b.background.base},ticks:{fontSize:h.caption.fontSize,color:null!==(w=t.yAxis.labelColor)&&void 0!==w?w:b.content.secondary,callback:t.orientation===y.HORIZONTAL?i=>{var o;let e;e=t.isInternationalStore?m(i):f(i);return`${e}${(null===(o=t.yAxis)||void 0===o?void 0:o.axisSuffix)||""}`}:(null===(B=t.xAxis)||void 0===B?void 0:B.axisSuffix)?i=>`${i}${t.xAxis.axisSuffix}`:void 0},stacked:t.orientation===y.HORIZONTAL?"boolean"!=typeof(null===(E=t.yAxis)||void 0===E?void 0:E.stacked)||(null===(D=t.yAxis)||void 0===D?void 0:D.stacked):"boolean"!=typeof(null===(N=t.xAxis)||void 0===N?void 0:N.stacked)||(null===(Z=t.xAxis)||void 0===Z?void 0:Z.stacked)},y:Object.assign(Object.assign({},(null===(z=null==t?void 0:t.equalHeight)||void 0===z?void 0:z.flag)?{suggestedMin:-(null==t?void 0:t.equalHeight.max),suggestedMax:null==t?void 0:t.equalHeight.max}:{}),{max:null===(P=null==t?void 0:t.yAxis)||void 0===P?void 0:P.max,title:{display:!!(t.orientation===y.HORIZONTAL?null===(G=t.xAxis)||void 0===G?void 0:G.title:null===($=t.yAxis)||void 0===$?void 0:$.title),text:t.orientation===y.HORIZONTAL?null===(W=t.xAxis)||void 0===W?void 0:W.title:null===(_=t.yAxis)||void 0===_?void 0:_.title,color:null!==(V=t.orientation===y.HORIZONTAL?null===(M=t.xAxis)||void 0===M?void 0:M.titleColor:null===(q=t.yAxis)||void 0===q?void 0:q.titleColor)&&void 0!==V?V:b.content.secondary,font:{size:h.caption.fontSize}},grid:{display:t.orientation!==y.HORIZONTAL&&(void 0===(null===(Y=null==t?void 0:t.showGridLines)||void 0===Y?void 0:Y.y)||(null===(J=null==t?void 0:t.showGridLines)||void 0===J?void 0:J.y)),color:b.background.base},ticks:Object.assign(Object.assign({stepSize:t.orientation===y.HORIZONTAL?null===(K=t.xAxis)||void 0===K?void 0:K.stepSize:null===(Q=t.yAxis)||void 0===Q?void 0:Q.stepSize,fontSize:h.caption.fontSize,color:null!==(U=t.xAxis.labelColor)&&void 0!==U?U:b.content.secondary},pi?{min:0,max:2e3,stepSize:200}:{}),{callback:(null==t?void 0:t.ticksCallback)?null==t?void 0:t.ticksCallback:t.orientation===y.HORIZONTAL?i=>{var o;let e;e=t.isInternationalStore?m(i):f(i);return`${e}${(null===(o=t.xAxis)||void 0===o?void 0:o.axisSuffix)||""}`}:(null===(X=t.yAxis)||void 0===X?void 0:X.axisSuffix)?i=>`${i}${t.yAxis.axisSuffix}`:void 0}),stacked:t.orientation===y.HORIZONTAL?"boolean"!=typeof(null===(ii=t.xAxis)||void 0===ii?void 0:ii.stacked)||(null===(oi=t.xAxis)||void 0===oi?void 0:oi.stacked):"boolean"!=typeof(null===(ti=t.yAxis)||void 0===ti?void 0:ti.stacked)||(null===(ei=t.yAxis)||void 0===ei?void 0:ei.stacked)})},onClick:(i,o)=>{if(!t.onBarClick)return;const e=o[0].datasetIndex,l=o[0].index,a=i.chart.data.datasets[e].label,n=i.chart.data.labels[l];t.onBarClick(n,a)},onHover:(i,o)=>{t.onBarClick&&o.length&&(i.native.target.style.cursor="pointer")}};let Si;t.orientation&&t.orientation!==y.VERTICAL?delete ki.scales.y.ticks.callback:delete ki.scales.x.ticks.callback,Si=pi?[{data:xi,backgroundColor:"rgba(0,0,0,0)"}]:Ai;const Li={labels:Oi,datasets:Si};let Fi;Fi=pi?[{data:xi,backgroundColor:"rgba(0,0,0,0)"}]:Ci;const Hi={labels:t.xAxis.data.map((i=>"string"==typeof i?i:i.name)),datasets:Fi},Ii=function(){let o,e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return o=t.allowChartPopup&&!e?"flex-start":"flex-end",i.jsx("div",Object.assign({style:{overflowY:"scroll",display:"flex",flexDirection:"row",gap:"10px",padding:"0px 24px 12px 24px",justifyContent:o,flexWrap:"wrap"}},{children:ji.map((o=>i.jsxs("div",Object.assign({style:{display:"flex",alignItems:"center",gap:"8px",marginTop:"4px"}},{children:[i.jsx("div",{style:{backgroundColor:o.backgroundColor,width:"16px",height:"16px",borderRadius:"2px"}}),i.jsx(g,Object.assign({color:b.content.secondary},{children:o.label}))]}),o.label.replace(" ","_"))))}))};return i.jsxs(A,Object.assign({style:null!==(li=t.wrapperStyle)&&void 0!==li?li:{},padding:t.outerPadding,customLegend:t.customLegend},{children:[t.chartHeading&&i.jsxs("div",Object.assign({style:{marginBottom:24,display:"flex",justifyContent:t.hideHeading?"flex-end":"space-between"}},{children:[!0!==t.hideHeading&&i.jsx(p,Object.assign({color:null!==(ai=t.chartHeading.color)&&void 0!==ai?ai:b.content.secondary},{children:t.chartHeading.heading})),t.allowChartPopup&&i.jsx("div",Object.assign({style:{display:"flex",justifyContent:"flex-end"}},{children:i.jsx("div",{children:i.jsx(v,{Icon:o,onClick:()=>{vi(!0)}})})}))]})),t.customLegend&&i.jsxs("div",Object.assign({style:{display:"flex",flexDirection:ci,justifyContent:"space-between"}},{children:[i.jsx(O,{children:ri.map(((o,t)=>i.jsx("div",{children:i.jsx("div",{children:o})},t)))}),Ii()]})),i.jsx("div",Object.assign({className:"graph__wrapper"},{children:i.jsx("div",Object.assign({style:{height:null!==(ni=t.graphCanvasHeight)&&void 0!==ni?ni:500,width:null!==(si=t.graphCanvasWidth)&&void 0!==si?si:"auto"}},{children:i.jsx(u,{options:ki,data:Li})}))})),ui&&i.jsx(x,Object.assign({open:ui,onClose:()=>vi(!1),closeOnOutsideClick:!0,headingTitle:null===(di=t.chartHeading)||void 0===di?void 0:di.heading,width:"85%"},{children:i.jsxs("div",Object.assign({className:"graph__wrapper",style:{padding:"8px"}},{children:[t.customLegend&&Ii(!0),i.jsx("div",Object.assign({style:{height:"70vh",width:"100%",padding:"16px",borderRadius:"8px"}},{children:i.jsx(u,{options:ki,data:Hi})}))]}))}))]}))};export{C as StackedBarChart};
|
|
1
|
+
import{j as o}from"../../../../node_modules/react/jsx-runtime.js";import i from"../../../../assets/icons/maximize.svg.js";import{Chart as t,CategoryScale as e,LinearScale as a,BarElement as l,Tooltip as n,Legend as d}from"chart.js";import s from"chartjs-plugin-datalabels";import{useState as r,useMemo as c}from"react";import{Bar as u}from"react-chartjs-2";import{IconButton as v}from"../../../icon-button/IconButton.js";import{StyledModal as p}from"../../../modals/styledModal.js";import{TitleRegular as g,BodyTiny as x}from"../../../TypographyStyle.js";import{COLORS as b,FONTS as h}from"../../../../constants/Theme.js";import{truncateValueForInternationalStore as m,truncateValueForIndianStore as y}from"../utils/calcPercentage.js";import{COLOR_SCHEMA as f,GRAPH_ORIENTATION as j}from"./StackedBarChart.model.js";import{GraphContainerWrapper as O,HeaderIconWrapper as A}from"./StackedBarChart.styles.js";t.register(e,a,l,n,d,s);const C=t=>{var e,a,l,n,d,s,C,k,L,F,S,H,I,T,R,w,E,B,D,N,Z,z,P,G,W,_,q,M,V,Y,J,K,Q,U,X,$,oo,io,to,eo,ao,lo;const{headerIcons:no=[],legendsAndIconDirection:so="row"}=t,[ro,co]=r(!1),uo=[250,1e3,800,1500,300,600],vo=0===t.yAxis.data.length,po=void 0===t.customColourScaleBrand&&void 0===t.customColourScalePastel?t.colorSchema===f.PASTEL?["#E6C7FF","#FEC6C6","#FEDEF3","#DEEFFF","#FFD8B1","#C7E5FF","#FFD3E6","#C9FFE5","#FFE3C7","#D9D9FF"]:["#5E07BB","#9E77ED","#D2AEFF","#F7D7FF","#CDE1FF","#92AFFA","#3935E1"]:t.colorSchema===f.PASTEL?t.customColourScalePastel:t.customColourScaleBrand,go=t.customHoverColour,xo=c((()=>{var o,i,e;return Object.assign(Object.assign({barPercentage:(null==t?void 0:t.barPercentage)||.4,categoryPercentage:1,pointStyle:"circle",barWidth:t.barWidth,borderRadius:(null==t?void 0:t.borderRadius)||void 0},"object"==typeof(null==t?void 0:t.borderRadius)?{borderSkipped:!1}:{}),(null===(o=null==t?void 0:t.addBarGap)||void 0===o?void 0:o.flag)?{borderWidth:{top:(null===(i=null==t?void 0:t.addBarGap)||void 0===i?void 0:i.value)||2,bottom:(null===(e=null==t?void 0:t.addBarGap)||void 0===e?void 0:e.value)||2,right:0,left:0},borderColor:"transparent"}:{})}),[t.barWidth,null==t?void 0:t.borderRadius,null==t?void 0:t.barPercentage,null==t?void 0:t.addBarGap]),bo={};t.yAxis.data.map((o=>{o.map((o=>{bo[o.name]?bo[o.name].push(o.value):bo[o.name]=[o.value]}))}));const ho=Object.keys(bo).map(((o,i)=>Object.assign({label:o,data:bo[o],backgroundColor:null==po?void 0:po[i],hoverBackgroundColor:void 0===go?void 0:go[i]},xo)));let mo=t.xAxis.data.map((o=>"string"==typeof o?o:o.name)),yo=ho;if(t.truncateBars){const o=((o,i,t)=>{if(i.length<=t)return{truncatedData:o,truncatedLabels:i,originalData:o,originalLabels:i};const e=o.map((o=>o.slice(0,t))),a=o.map((o=>o.slice(t).reduce(((o,i)=>o+i),0)));e.forEach(((o,i)=>o.push(a[i])));const l=i.slice(0,t);return l.push("Others"),{truncatedData:e,truncatedLabels:l,originalData:o,originalLabels:i}})(ho.map((o=>o.data)),mo,t.truncateBars);ho.forEach(((i,t)=>i.data=o.truncatedData[t])),mo=o.truncatedLabels,yo=o.originalData.map(((o,i)=>Object.assign(Object.assign({},ho[i]),{data:o})))}const fo={plugins:{legend:{display:!vo&&!t.customLegend,labels:{usePointStyle:!0,fontSize:2}},tooltip:{enabled:!vo,callbacks:{label:null===(e=t.tooltipConfig)||void 0===e?void 0:e.labelCallback,title:null===(a=t.tooltipConfig)||void 0===a?void 0:a.titleCallback,footer:null===(l=t.tooltipConfig)||void 0===l?void 0:l.footerCallback},footerFont:null===(d=null===(n=t.tooltipConfig)||void 0===n?void 0:n.footerStyles)||void 0===d?void 0:d.footerFont},datalabels:{display:null!==(s=t.showTotal)&&void 0!==s&&s,anchor:"end",align:"end",clamp:!0,formatter:(o,i)=>{var t;const e=i.datasetIndex,a=i.chart.data.datasets;if(e!==a.length-1)return"";const l=i.dataIndex;let n=0;for(let o=0;o<a.length;o++)n+=null!==(t=a[o].data[l])&&void 0!==t?t:0;return n?n<1e3?n:(n/1e3).toString().substring(0,4)+"k":""},color:b.content.secondary}},layout:{padding:{right:t.showTotal&&t.orientation===j.HORIZONTAL?50:0,top:t.showTotal&&t.orientation!=j.HORIZONTAL?50:0}},responsive:!0,maintainAspectRatio:!1,legend:{display:!t.customLegend,labels:{usePointStyle:!0}},indexAxis:t.orientation===j.HORIZONTAL?"y":"x",scales:{x:{title:{display:!!(t.orientation===j.HORIZONTAL?null===(C=t.yAxis)||void 0===C?void 0:C.title:null===(k=t.xAxis)||void 0===k?void 0:k.title),text:t.orientation===j.HORIZONTAL?null===(L=t.yAxis)||void 0===L?void 0:L.title:null===(F=t.xAxis)||void 0===F?void 0:F.title,color:null!==(I=t.orientation===j.HORIZONTAL?null===(S=t.yAxis)||void 0===S?void 0:S.titleColor:null===(H=t.xAxis)||void 0===H?void 0:H.titleColor)&&void 0!==I?I:b.content.secondary,font:{size:h.caption.fontSize}},grid:{display:t.orientation===j.HORIZONTAL&&(void 0===(null===(T=null==t?void 0:t.showGridLines)||void 0===T?void 0:T.x)||(null===(R=null==t?void 0:t.showGridLines)||void 0===R?void 0:R.x)),color:b.background.base},ticks:{fontSize:h.caption.fontSize,color:null!==(w=t.yAxis.labelColor)&&void 0!==w?w:b.content.secondary,callback:t.orientation===j.HORIZONTAL?t.isInternationalStore?m:y:void 0},stacked:t.orientation===j.HORIZONTAL?"boolean"!=typeof(null===(E=t.yAxis)||void 0===E?void 0:E.stacked)||(null===(B=t.yAxis)||void 0===B?void 0:B.stacked):"boolean"!=typeof(null===(D=t.xAxis)||void 0===D?void 0:D.stacked)||(null===(N=t.xAxis)||void 0===N?void 0:N.stacked)},y:Object.assign(Object.assign({},(null===(Z=null==t?void 0:t.equalHeight)||void 0===Z?void 0:Z.flag)?{suggestedMin:-(null==t?void 0:t.equalHeight.max),suggestedMax:null==t?void 0:t.equalHeight.max}:{}),{title:{display:!!(t.orientation===j.HORIZONTAL?null===(z=t.xAxis)||void 0===z?void 0:z.title:null===(P=t.yAxis)||void 0===P?void 0:P.title),text:t.orientation===j.HORIZONTAL?null===(G=t.xAxis)||void 0===G?void 0:G.title:null===(W=t.yAxis)||void 0===W?void 0:W.title,color:null!==(M=t.orientation===j.HORIZONTAL?null===(_=t.xAxis)||void 0===_?void 0:_.titleColor:null===(q=t.yAxis)||void 0===q?void 0:q.titleColor)&&void 0!==M?M:b.content.secondary,font:{size:h.caption.fontSize}},grid:{display:t.orientation!==j.HORIZONTAL&&(void 0===(null===(V=null==t?void 0:t.showGridLines)||void 0===V?void 0:V.y)||(null===(Y=null==t?void 0:t.showGridLines)||void 0===Y?void 0:Y.y)),color:b.background.base},ticks:Object.assign(Object.assign({stepSize:t.orientation===j.HORIZONTAL?null===(J=t.xAxis)||void 0===J?void 0:J.stepSize:null===(K=t.yAxis)||void 0===K?void 0:K.stepSize,fontSize:h.caption.fontSize,color:null!==(Q=t.xAxis.labelColor)&&void 0!==Q?Q:b.content.secondary},vo?{min:0,max:2e3,stepSize:200}:{}),{callback:(null==t?void 0:t.ticksCallback)?null==t?void 0:t.ticksCallback:t.orientation!==j.VERTICAL?t.isInternationalStore?m:y:void 0}),stacked:t.orientation===j.HORIZONTAL?"boolean"!=typeof(null===(U=t.xAxis)||void 0===U?void 0:U.stacked)||(null===(X=t.xAxis)||void 0===X?void 0:X.stacked):"boolean"!=typeof(null===($=t.yAxis)||void 0===$?void 0:$.stacked)||(null===(oo=t.yAxis)||void 0===oo?void 0:oo.stacked)})},onClick:(o,i)=>{if(!t.onBarClick)return;const e=i[0].datasetIndex,a=i[0].index,l=o.chart.data.datasets[e].label,n=o.chart.data.labels[a];t.onBarClick(n,l)},onHover:(o,i)=>{t.onBarClick&&i.length&&(o.native.target.style.cursor="pointer")}};t.orientation&&t.orientation!==j.VERTICAL?delete fo.scales.y.ticks.callback:delete fo.scales.x.ticks.callback;const jo={labels:mo,datasets:vo?[{data:uo,backgroundColor:"rgba(0,0,0,0)"}]:ho},Oo={labels:t.xAxis.data.map((o=>"string"==typeof o?o:o.name)),datasets:vo?[{data:uo,backgroundColor:"rgba(0,0,0,0)"}]:yo},Ao=function(){let i=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return o.jsx("div",Object.assign({style:{overflowY:"scroll",display:"flex",flexDirection:"row",gap:"10px",padding:"0px 24px 12px 24px",justifyContent:t.allowChartPopup&&!i?"flex-start":"flex-end",flexWrap:"wrap"}},{children:ho.map((i=>o.jsxs("div",Object.assign({style:{display:"flex",alignItems:"center",gap:"8px",marginTop:"4px"}},{children:[o.jsx("div",{style:{backgroundColor:i.backgroundColor,width:"16px",height:"16px",borderRadius:"2px"}}),o.jsx(x,Object.assign({color:b.content.secondary},{children:i.label}))]}),i.label.replace(" ","_"))))}))};return o.jsxs(O,Object.assign({style:null!==(io=t.wrapperStyle)&&void 0!==io?io:{},padding:t.outerPadding,customLegend:t.customLegend},{children:[t.chartHeading&&o.jsxs("div",Object.assign({style:{marginBottom:24,display:"flex",justifyContent:t.hideHeading?"flex-end":"space-between"}},{children:[!0!==t.hideHeading&&o.jsx(g,Object.assign({color:null!==(to=t.chartHeading.color)&&void 0!==to?to:b.content.secondary},{children:t.chartHeading.heading})),t.allowChartPopup&&o.jsx("div",Object.assign({style:{display:"flex",justifyContent:"flex-end"}},{children:o.jsx("div",{children:o.jsx(v,{Icon:i,onClick:()=>{co(!0)}})})}))]})),t.customLegend&&o.jsxs("div",Object.assign({style:{display:"flex",flexDirection:so,justifyContent:"space-between"}},{children:[o.jsx(A,{children:no.map(((i,t)=>o.jsx("div",{children:o.jsx("div",{children:i})},t)))}),Ao()]})),o.jsx("div",Object.assign({className:"graph__wrapper"},{children:o.jsx("div",Object.assign({style:{height:null!==(eo=t.graphCanvasHeight)&&void 0!==eo?eo:500,width:null!==(ao=t.graphCanvasWidth)&&void 0!==ao?ao:"auto"}},{children:o.jsx(u,{options:fo,data:jo})}))})),ro&&o.jsx(p,Object.assign({open:ro,onClose:()=>co(!1),closeOnOutsideClick:!0,headingTitle:null===(lo=t.chartHeading)||void 0===lo?void 0:lo.heading,width:"85%"},{children:o.jsxs("div",Object.assign({className:"graph__wrapper",style:{padding:"8px"}},{children:[t.customLegend&&Ao(!0),o.jsx("div",Object.assign({style:{height:"70vh",width:"100%",padding:"16px",borderRadius:"8px"}},{children:o.jsx(u,{options:fo,data:Oo})}))]}))}))]}))};export{C as StackedBarChart};
|
|
@@ -7,8 +7,6 @@ export interface AxisDetailsI {
|
|
|
7
7
|
labelColor?: string;
|
|
8
8
|
stepSize?: number;
|
|
9
9
|
stacked?: boolean;
|
|
10
|
-
axisSuffix?: string;
|
|
11
|
-
max?: number;
|
|
12
10
|
}
|
|
13
11
|
export interface XAxisDataI {
|
|
14
12
|
name: string;
|
|
@@ -60,12 +58,10 @@ export interface StackedBarGraphI {
|
|
|
60
58
|
customColourScaleBrand?: string[];
|
|
61
59
|
customColourScalePastel?: string[];
|
|
62
60
|
customHoverColour?: string[];
|
|
63
|
-
customBarColors?: string[] /** Custom colors for individual bars in the stack */;
|
|
64
61
|
isInternationalStore?: boolean;
|
|
65
62
|
truncateBars?: number;
|
|
66
63
|
allowChartPopup?: boolean;
|
|
67
64
|
hideHeading?: boolean;
|
|
68
|
-
/** borderRadius - if number passes only the top bar of the stack will be given radius. Send object to apply border in all the bars of the stack */
|
|
69
65
|
borderRadius?: number | {
|
|
70
66
|
topLeft?: number;
|
|
71
67
|
topRight?: number;
|
|
@@ -85,8 +81,7 @@ export interface StackedBarGraphI {
|
|
|
85
81
|
flag: boolean;
|
|
86
82
|
value: number;
|
|
87
83
|
};
|
|
88
|
-
ticksCallback?: (value: number
|
|
84
|
+
ticksCallback?: (value: number) => string;
|
|
89
85
|
legendsAndIconDirection?: 'row-reverse' | 'row';
|
|
90
86
|
headerIcons?: React.ReactNode[];
|
|
91
|
-
renderInHeightWiseManner?: boolean /** When true, renders smaller bars on top of larger bars */;
|
|
92
87
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as i}from"../../../../node_modules/react/jsx-runtime.js";import{Chart as
|
|
1
|
+
import{j as i}from"../../../../node_modules/react/jsx-runtime.js";import{Chart as t,CategoryScale as e,LinearScale as o,BarElement as r,Tooltip as a}from"chart.js";import{Chart as s}from"react-chartjs-2";import{SmallRegular as l,TitleRegular as n}from"../../../TypographyStyle.js";import{FONTS as c,COLORS as d}from"../../../../constants/Theme.js";import{LegendWrapper as x,LegendContainer as p,LegendColor as g}from"../LineChart/LineChart.styled.js";import{GraphContainerWrapper as b}from"./VerticalBarAndLinearGraph.styles.js";t.register(e,o,r,a);const h=t=>{var e,o,r,a,h;const A=[0,0,0,0,0,0],j=-1===t.barAxis.data.findIndex((i=>0!==i)),m=-1===t.lineAxis.data.findIndex((i=>0!==i)),f={min:0,max:2e3,stepSize:200},y=[{legend:t.barAxis.title,color:t.barAxis.graphColor},{legend:t.lineAxis.title,color:t.lineAxis.graphColor}],C={responsive:!0,plugins:{legend:{display:!1}},scales:{x:{title:{display:!!t.xAxis.title,text:t.xAxis.title,color:t.xAxis.titleColor,font:{size:c.caption.fontSize}},grid:{display:!1,borderColor:d.background.base},ticks:{fontSize:c.caption.fontSize,color:null!==(e=t.xAxis.labelColor)&&void 0!==e?e:d.content.secondary}},bar:{position:"left",title:{display:!!t.barAxis.title,text:t.barAxis.title,color:t.barAxis.titleColor,font:{size:c.caption.fontSize}},grid:{borderColor:"white",color:d.background.base},ticks:Object.assign({fontSize:c.caption.fontSize,color:null!==(o=t.barAxis.labelColor)&&void 0!==o?o:d.content.secondary},j?f:{})},line:{position:"right",title:{display:!!t.lineAxis.title,text:t.lineAxis.title,color:t.lineAxis.titleColor,font:{size:c.caption.fontSize}},grid:{display:!1,borderColor:"white",color:d.background.base},ticks:Object.assign({fontSize:c.caption.fontSize,color:null!==(r=t.lineAxis.labelColor)&&void 0!==r?r:d.content.secondary},m?f:{}),display:!0}},maintainAspectRatio:!1},u={labels:t.xAxis.forceShowXAxis?t.xAxis.data.map((i=>i.toString())):j&&m?["-","-","-","-","-","-"]:t.xAxis.data.map((i=>i.toString())),datasets:[{yAxisID:"line",type:"line",data:m?A:t.lineAxis.data,borderColor:t.lineAxis.graphColor||"rgba(0,0,0,0)",borderWidth:2,fill:!1,pointRadius:1},{yAxisID:"bar",type:"bar",data:j?A:t.barAxis.data,backgroundColor:t.barAxis.graphColor||"rgba(0,0,0,0)",barPercentage:.4,categoryPercentage:1,borderRadius:4}]};return i.jsxs("div",Object.assign({style:{display:"flex",flexDirection:"column",gap:2}},{children:[i.jsx(x,Object.assign({position:"center"},{children:y.map(((t,e)=>{let{legend:o,color:r}=t;return o?i.jsxs(p,{children:[i.jsx(g,{color:r}),i.jsx(l,Object.assign({color:"#667085"},{children:o}))]},e):i.jsx(i.Fragment,{})}))})),i.jsxs(b,{children:[t.chartHeading&&i.jsx("div",Object.assign({style:{marginBottom:24}},{children:i.jsx(n,Object.assign({color:null!==(a=t.chartHeading.color)&&void 0!==a?a:d.content.secondary},{children:t.chartHeading.heading}))})),i.jsx("div",Object.assign({style:{height:null!==(h=t.graphCanvasHeight)&&void 0!==h?h:500}},{children:i.jsx(s,{type:"bar",data:u,options:C})}))]})]}))};export{h as VerticalBarAndLinearGraph};
|
|
@@ -1,7 +1 @@
|
|
|
1
1
|
export declare const GraphContainerWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
2
|
-
export declare const LegendsWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
3
|
-
export declare const LegendMiddleWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
4
|
-
export declare const LegendColorBox: import("styled-components").StyledComponent<"div", any, {
|
|
5
|
-
color: string;
|
|
6
|
-
}, never>;
|
|
7
|
-
export declare const GraphWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
@@ -1,25 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
background-color: ${
|
|
1
|
+
import o from"styled-components";import{COLORS as r}from"../../../../constants/Theme.js";const t=o.div`
|
|
2
|
+
background-color: ${r.surface.standard};
|
|
3
3
|
padding: 0;
|
|
4
|
-
|
|
5
|
-
display: flex;
|
|
6
|
-
flex-direction: row;
|
|
7
|
-
gap: 10px;
|
|
8
|
-
padding: 0px 24px 12px 24px;
|
|
9
|
-
justify-content: flex-end;
|
|
10
|
-
flex-wrap: wrap;
|
|
11
|
-
`,e=p.div`
|
|
12
|
-
display: flex;
|
|
13
|
-
align-items: center;
|
|
14
|
-
gap: 8px;
|
|
15
|
-
margin-top: 4px;
|
|
16
|
-
`,r=p.div`
|
|
17
|
-
background-color: ${p=>p.color};
|
|
18
|
-
width: 16px;
|
|
19
|
-
height: 16px;
|
|
20
|
-
border-radius: 2px;
|
|
21
|
-
`,a=p.div`
|
|
22
|
-
display: flex;
|
|
23
|
-
flex-direction: column;
|
|
24
|
-
gap: 2px;
|
|
25
|
-
`;export{d as GraphContainerWrapper,a as GraphWrapper,r as LegendColorBox,e as LegendMiddleWrapper,i as LegendsWrapper};
|
|
4
|
+
`;export{t as GraphContainerWrapper};
|
|
@@ -4,17 +4,11 @@ export interface AxisDetailsI {
|
|
|
4
4
|
data: number[] | string[];
|
|
5
5
|
labelColor?: string;
|
|
6
6
|
graphColor?: string;
|
|
7
|
-
axisSuffix?: string;
|
|
8
|
-
max?: number;
|
|
9
7
|
}
|
|
10
8
|
export interface ChartHeadingI {
|
|
11
9
|
heading: string;
|
|
12
10
|
color?: string;
|
|
13
11
|
}
|
|
14
|
-
export declare enum GRAPH_ORIENTATION {
|
|
15
|
-
VERTICAL = "vertical",
|
|
16
|
-
HORIZONTAL = "horizontal"
|
|
17
|
-
}
|
|
18
12
|
export interface VerticalBarAndLinearGraphI {
|
|
19
13
|
graphCanvasHeight?: number;
|
|
20
14
|
tickColor?: string;
|
|
@@ -24,11 +18,5 @@ export interface VerticalBarAndLinearGraphI {
|
|
|
24
18
|
forceShowXAxis?: boolean;
|
|
25
19
|
};
|
|
26
20
|
lineAxis: AxisDetailsI;
|
|
27
|
-
lineAxis2?: AxisDetailsI;
|
|
28
21
|
barAxis: AxisDetailsI;
|
|
29
|
-
isInternationalStore?: boolean;
|
|
30
|
-
customLegend?: boolean;
|
|
31
|
-
orientation?: GRAPH_ORIENTATION;
|
|
32
|
-
noDummyValues?: boolean;
|
|
33
|
-
pointRadius?: number;
|
|
34
22
|
}
|
|
@@ -11,6 +11,7 @@ export type ToasterProps = {
|
|
|
11
11
|
subText?: string;
|
|
12
12
|
position?: ToastPosition;
|
|
13
13
|
type?: 'info' | 'success' | 'error' | 'default' | 'warning';
|
|
14
|
+
duration?: number;
|
|
14
15
|
closeOnClick?: boolean;
|
|
15
16
|
hideProgressBar?: boolean;
|
|
16
17
|
autoClose?: number | false | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as t}from"../../node_modules/react/jsx-runtime.js";import o from"../../assets/icons/alert_triangle.svg.js";import e from"../../assets/icons/check.svg.js";import n from"../../assets/icons/cross.svg.js";import s from"../../assets/icons/errorInfo.svg.js";import i from"../../assets/icons/info.svg.js";import
|
|
1
|
+
import{j as t}from"../../node_modules/react/jsx-runtime.js";import o from"../../assets/icons/alert_triangle.svg.js";import e from"../../assets/icons/check.svg.js";import n from"../../assets/icons/cross.svg.js";import s from"../../assets/icons/errorInfo.svg.js";import i from"../../assets/icons/info.svg.js";import r,{useRef as l,useState as c,useEffect as d,useContext as a}from"react";import u from"react-dom";import{cssTransition as p,toast as x,ToastContainer as h}from"react-toastify";import{Button as g}from"../button/Button.js";import{ToasterStyled as y}from"./Toaster.styled.js";import{TitleSmall as b,BodySecondary as f,BodyCaption as j}from"../TypographyStyle.js";import{COLORS as v}from"../../constants/Theme.js";const m=o=>t.jsxs(f,{children:["Skip in ",o.duration," sec "]}),T=o=>{console.log(o);const e="default"===o.type?"#fff":"success"===o.type?v.background.positive.light:"error"===o.type?v.background.negative.light:"warning"===o.type?v.background.warning.light:v.background.brandLight,s="default"===o.type?v.stroke.primary:"success"===o.type?v.stroke.positive.lightAlt:"error"===o.type?v.stroke.negative.lightAlt:"warning"===o.type?v.stroke.warning.lightAlt:v.stroke.brandLightAlt,i="default"===o.type?v.content.primary:"success"===o.type?v.content.positive:"error"===o.type?v.content.negative:"warning"===o.type?v.content.warning:v.content.brand,{timerValue:r}=a(k);return console.log(r),t.jsx("div",Object.assign({tabIndex:0,role:"button",style:{backgroundColor:e,border:`1px solid ${s}`,borderRadius:8,position:"absolute",top:-12,right:-12,width:r>0?130:40,display:"flex",justifyContent:"center",alignItems:"center",cursor:"pointer",zIndex:10,paddingRight:r>0?8:0},onClick:o.closeToast,onKeyDown:t=>{"Enter"===t.key&&o.closeToast&&o.closeToast()}},{children:r>0?t.jsxs(t.Fragment,{children:[t.jsx(m,{duration:r}),t.jsx(n,{height:20,width:20,color:i})]}):t.jsx(n,{height:20,width:20,color:i})}))},B=o=>{var e,n;const s=v.content.placeholder,{toasterText:i}=a(k);return t.jsx(t.Fragment,{children:t.jsxs("div",Object.assign({style:{display:"flex",flexGrow:1}},{children:[t.jsx("div",Object.assign({style:{flexGrow:1,marginRight:32,display:"flex",alignItems:"center"}},{children:t.jsxs("div",{children:[o.subText?t.jsx(b,Object.assign({color:"inherit"},{children:null!==(e=o.toastText)&&void 0!==e?e:i})):t.jsx(f,Object.assign({color:"inherit"},{children:null!==(n=o.toastText)&&void 0!==n?n:i})),o.subText&&t.jsx("div",Object.assign({style:{marginTop:2}},{children:t.jsx(j,Object.assign({color:v.content.secondary},{children:o.subText}))}))]})})),o.showButton&&t.jsx("div",Object.assign({style:{display:"flex",flexDirection:"column",alignSelf:"center",padding:"6px 4px",marginRight:{showSecondButton:4,showButton:0}[o.showSecondButton?"showSecondButton":"showButton"]}},{children:t.jsx(g,{buttonText:o.buttonText,buttonType:"tertiaryGray",color:v.content.secondary,onClick:o.onButtonClick})})),o.showSecondButton&&t.jsx("div",Object.assign({style:{display:"flex",flexDirection:"column",alignSelf:"center",padding:"6px 4px"}},{children:t.jsx(g,{buttonText:o.secondButtonText,buttonType:"tertiaryGray",color:v.content.secondary,onClick:o.onSecondButtonClick})})),o.showButton||o.showSecondButton?t.jsx("div",{style:{height:28,alignSelf:"center",marginLeft:8,marginRight:8,borderRight:`1px solid ${s}`,borderRadius:1}}):null]}))})},w=n=>{const r=l(n.toastId||"default-toast"),[a,g]=c(n.text),[b,f]=c(n.duration||0),j=p({enter:"Toastify__slide-enter",exit:"Toastify__slide-exit"}),m="default"===n.type?null:"success"===n.type?t.jsx(e,{width:20,height:20,color:v.content.positive}):"error"===n.type?t.jsx(s,{width:20,height:20,color:v.content.negative}):"warning"===n.type?t.jsx(o,{width:20,height:20,color:v.content.warning}):t.jsx(i,{width:20,height:20,color:v.content.brand});d((()=>{r.current&&r.current===n.toastId?(g(n.text),x.update(r.current,{autoClose:n.autoClose})):r.current&&r.current!==n.toastId&&w(n.text)}),[n.toastId,n.text]),d((()=>{if(!n.duration)return;f(n.duration);const t=setInterval((()=>{f((o=>{const e=o-1;return e<=0?(clearInterval(t),0):e}))}),1e3);return()=>clearInterval(t)}),[n.duration]);const w=o=>{var e,s,i,l,c,d,a,u,p,h,g,y;void 0!==n.hideLeftIcon||n.leftIcon?x(t.jsx(B,{toastText:o,type:n.type||"info",buttonText:null===(e=n.buttonProps)||void 0===e?void 0:e.buttonText,secondButtonText:null===(s=n.secondButtonProps)||void 0===s?void 0:s.buttonText,showButton:null===(i=n.buttonProps)||void 0===i?void 0:i.showButton,showSecondButton:null===(l=n.secondButtonProps)||void 0===l?void 0:l.showButton,onButtonClick:null===(c=n.buttonProps)||void 0===c?void 0:c.onButtonClick,onSecondButtonClick:null===(d=n.secondButtonProps)||void 0===d?void 0:d.onButtonClick,subText:n.subText}),{onClose:n.onCloseToast?n.onCloseToast:()=>({}),icon:!0!==n.hideLeftIcon&&(n.leftIcon?n.leftIcon:"default"!==n.type&&t.jsx("div",Object.assign({style:{display:"flex",alignItems:"flex-start"}},{children:m}))),type:n.type,closeButton:t.jsx(T,{type:n.type||"default",timer:b}),toastId:n.toastId||"default-toast",transition:j}):r.current=x(t.jsx(B,{toastText:o,type:n.type||"info",buttonText:null===(a=n.buttonProps)||void 0===a?void 0:a.buttonText,secondButtonText:null===(u=n.secondButtonProps)||void 0===u?void 0:u.buttonText,showButton:null===(p=n.buttonProps)||void 0===p?void 0:p.showButton,showSecondButton:null===(h=n.secondButtonProps)||void 0===h?void 0:h.showButton,onButtonClick:null===(g=n.buttonProps)||void 0===g?void 0:g.onButtonClick,onSecondButtonClick:null===(y=n.secondButtonProps)||void 0===y?void 0:y.onButtonClick,subText:n.subText}),{onClose:n.onCloseToast?n.onCloseToast:()=>({}),type:n.type,icon:"default"!==n.type&&t.jsx("div",Object.assign({style:{display:"flex",alignItems:"flex-start"}},{children:m})),closeButton:t.jsx(T,{type:n.type||"default",timer:b}),toastId:n.toastId||"default-toast",transition:j})};return d((()=>{w()}),[]),u.createPortal(t.jsx(y,Object.assign({width:n.width,height:n.height,zIndex:n.zIndex,isSubTextIncluded:!!n.subText,type:n.type},{children:t.jsx(k.Provider,Object.assign({value:{toasterText:a,timerValue:b}},{children:t.jsx(h,{position:n.position||"top-right",closeOnClick:n.closeOnClick||!1,hideProgressBar:n.hideProgressBar||!1,draggable:!1,autoClose:n.autoClose||!1,theme:"colored"})}))})),document.body)},k=r.createContext({toasterText:"",timerValue:0});export{w as Toaster};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import c from"../../node_modules/@emotion/styled/base/dist/emotion-styled-base.esm.js";import{COLORS as t}from"../../constants/Theme.js";import{ComponentZindex as
|
|
1
|
+
import c from"../../node_modules/@emotion/styled/base/dist/emotion-styled-base.esm.js";import{COLORS as t}from"../../constants/Theme.js";import{ComponentZindex as l}from"../../constants/zindex.js";const b=c("div","production"===process.env.NODE_ENV?{target:"e1tdeuzc0"}:{target:"e1tdeuzc0",label:"ToasterStyled"})("--toastify-color-light:#fff;--toastify-color-dark:#121212;--toastify-text-color-success:",t.content.primary,";--toastify-text-color-error:",t.content.primary,";--toastify-text-color-warning:",t.content.primary,";--toastify-text-color-info:",t.content.primary,";--toastify-color-info:",t.background.brandLight,";--toastify-color-success:",t.background.positive.light,";--toastify-color-error:",t.background.negative.light,";--toastify-color-warning:",t.background.warning.light,";--toastify-text-color-light:",t.content.primary,";--toastify-toast-width:fit-content;--toastify-toast-min-height:",(c=>c.height||(c.isSubTextIncluded?"70px":"56px")),";--toastify-toast-max-height:",(c=>c.height||"fit-content"),";font-family:inherit;z-index:",(c=>c.zIndex||l.TOASTER),";.custom-position{position:relative;}.Toastify__toast-container{padding:0;overflow:visible;}.Toastify__toast{position:relative;overflow:visible;}.Toastify__toast--success{border:1px solid ",t.stroke.positive.lightAlt,";}.Toastify__toast--info{border:1px solid ",t.stroke.brandLightAlt,";}.Toastify__toast--default{border:1px solid ",t.stroke.primary,";}.Toastify__toast--error{border:1px solid ",t.stroke.negative.lightAlt,";}.Toastify__toast--warning{border:1px solid ",t.stroke.warning.lightAlt,";}.Toastify__toast{padding:",(c=>c.isSubTextIncluded?"16px":"12px"),";max-width:",(c=>c.width),";border-radius:8px;}.Toastify__progress-bar{height:4px;}.Toastify__close-button{display:block;margin:auto;}.Toastify__toast-icon{align-self:center;margin-inline-end:12px;height:",(c=>c.isSubTextIncluded?"38px":"20px"),";}.Toastify__toast-body{padding:0;}.Toastify__progress-bar-theme--colored.Toastify__progress-bar--default{background:",t.content.brand,";}.Toastify__progress-bar-theme--colored.Toastify__progress-bar--info{background:",t.content.brand,";}.Toastify__progress-bar-theme--colored.Toastify__progress-bar--warning{background:",t.content.warning,";}.Toastify__progress-bar-theme--colored.Toastify__progress-bar--success{background:",t.content.positive,";}.Toastify__progress-bar-theme--colored.Toastify__progress-bar--error{background:",t.content.negative,";}.Toastify__toast-body>div:last-child{display:flex;}.Toastify__slide-enter{animation:slideIn 1s ease forwards,bounce cubic-bezier(0.68, -0.55, 0.27, 1.55) 0.5s both;}.Toastify__slide-exit{animation:slideOut 0.5s ease-in-out forwards;}@keyframes bounce{0%,20%,50%,80%,100%{transform:translateY(0);}40%{transform:translateX(-20px);}60%{transform:translateX(20px);}}@keyframes slideIn{0%{transform:translateX(-100%);opacity:0;}100%{transform:translateX(0);opacity:1;}}@keyframes slideOut{0%{transform:translateX(0);opacity:1;}100%{transform:translateX(100%);opacity:0;}}"+("production"===process.env.NODE_ENV?"":"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIlRvYXN0ZXIuc3R5bGVkLnRzeCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFHd0MiLCJmaWxlIjoiVG9hc3Rlci5zdHlsZWQudHN4Iiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHN0eWxlZCBmcm9tICdAZW1vdGlvbi9zdHlsZWQnO1xyXG5pbXBvcnQgeyBDT0xPUlMgfSBmcm9tIFwiLi4vLi4vY29uc3RhbnRzL1RoZW1lXCI7XHJcbmltcG9ydCB7IENvbXBvbmVudFppbmRleCB9IGZyb20gXCIuLi8uLi9jb25zdGFudHMvemluZGV4XCI7XHJcbmV4cG9ydCBjb25zdCBUb2FzdGVyU3R5bGVkID0gc3R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x0XHRcdHRyYW5zZm9ybTogdHJhbnNsYXRlWCgtMjBweCk7IC8qIEJvdW5jaW5nIHVwICovXG5cdFx0fVxuXHRcdDYwJSB7XG5cdFx0XHR0cmFuc2Zvcm06IHRyYW5zbGF0ZVgoMjBweCk7IC8qIFNtYWxsIGJvdW5jZSBiZWZvcmUgc2V0dGxpbmcgKi9cblx0XHR9XG5cdH1cblx0QGtleWZyYW1lcyBzbGlkZUluIHtcblx0XHQwJSB7XG5cdFx0XHR0cmFuc2Zvcm06IHRyYW5zbGF0ZVgoLTEwMCUpOyAvKiBTdGFydCBvZmYtc2NyZWVuIHRvIHRoZSBsZWZ0ICovXG5cdFx0XHRvcGFjaXR5OiAwO1xuXHRcdH1cblx0XHQxMDAlIHtcblx0XHRcdHRyYW5zZm9ybTogdHJhbnNsYXRlWCgwKTsgLyogRW5kIGF0IHRoZSBvcmlnaW5hbCBwb3NpdGlvbiAqL1xuXHRcdFx0b3BhY2l0eTogMTtcblx0XHR9XG5cdH1cblx0QGtleWZyYW1lcyBzbGlkZU91dCB7XG5cdFx0MCUge1xuXHRcdFx0dHJhbnNmb3JtOiB0cmFuc2xhdGVYKDApOyAvKiBTdGFydCBmcm9tIHRoZSBvcmlnaW5hbCBwb3NpdGlvbiAqL1xuXHRcdFx0b3BhY2l0eTogMTtcblx0XHR9XG5cdFx0MTAwJSB7XG5cdFx0XHR0cmFuc2Zvcm06IHRyYW5zbGF0ZVgoMTAwJSk7IC8qIFNsaWRlIG91dCB0byB0aGUgcmlnaHQgKi9cblx0XHRcdG9wYWNpdHk6IDA7XG5cdFx0fVxuXHR9XG5gO1xyXG4vLyMgc291cmNlTWFwcGluZ1VSTD1Ub2FzdGVyLnN0eWxlZC5qcy5tYXAiXX0= */"));export{b as ToasterStyled};
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var e;Object.defineProperty(exports,"__esModule",{value:!0}),exports.GRAPH_ORIENTATION=void 0,(e=exports.GRAPH_ORIENTATION||(exports.GRAPH_ORIENTATION={})).VERTICAL="vertical",e.HORIZONTAL="horizontal";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var o;!function(o){o.VERTICAL="vertical",o.HORIZONTAL="horizontal"}(o||(o={}));export{o as GRAPH_ORIENTATION};
|