@bikdotai/bik-component-library 0.0.640-beta.8 → 0.0.640-beta.help-attr.5
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/assets/icons/ChartPie.svg.js +1 -0
- package/dist/cjs/assets/icons/click.svg.js +1 -0
- package/dist/cjs/assets/icons/send_template.svg.js +1 -0
- package/dist/cjs/assets/icons/tick.svg.js +1 -0
- package/dist/cjs/assets/icons/tick_double.svg.js +1 -0
- package/dist/cjs/components/analytics-chips-and-dropdowns/AnalyticsTrend.js +1 -1
- package/dist/cjs/components/analytics-chips-and-dropdowns/chart/Pie/PieChart.js +18 -4
- package/dist/cjs/components/analytics-chips-and-dropdowns/chart/Pie/PieChartAnalytics.js +1 -1
- package/dist/cjs/components/analytics-chips-and-dropdowns/chart/Pie/PieChartInputData.d.ts +2 -0
- 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 +0 -20
- package/dist/cjs/components/analytics-chips-and-dropdowns/chart/VerticalBarGraph/VerticalGraph.js +1 -1
- package/dist/cjs/components/bik-layout/MockMenus.d.ts +0 -1
- package/dist/cjs/components/dropdown/MenuItem/MenuItem.d.ts +1 -0
- package/dist/cjs/components/dropdown/MenuItem/MenuItem.js +17 -2
- package/dist/cjs/components/modals/styledModal.d.ts +1 -0
- package/dist/cjs/components/modals/styledModal.js +1 -1
- package/dist/cjs/components/template-context-mapper/TemplateContextMapper.d.ts +2 -2
- package/dist/cjs/components/template-context-mapper/TemplateContextMapper.js +1 -1
- package/dist/cjs/components/template-context-mapper/index.d.ts +2 -0
- package/dist/cjs/components/template-context-mapper/modalElements/TemplateAnalyticsComponent.d.ts +12 -0
- package/dist/cjs/components/template-context-mapper/modalElements/TemplateAnalyticsComponent.js +1 -0
- package/dist/cjs/components/template-context-mapper/modalElements/TemplateAnalyticsSkeleton.d.ts +3 -0
- package/dist/cjs/components/template-context-mapper/modalElements/TemplateAnalyticsSkeleton.js +1 -0
- package/dist/cjs/components/template-context-mapper/styles/TemplateAnalyticsStyles.d.ts +7 -0
- package/dist/cjs/components/template-context-mapper/styles/TemplateAnalyticsStyles.js +63 -0
- package/dist/cjs/components/template-context-mapper/utils/TemplateConstants.d.ts +44 -0
- package/dist/cjs/components/template-context-mapper/utils/TemplateConstants.js +1 -0
- package/dist/cjs/components/template-preview/models/WhatsAppTemplate.d.ts +31 -0
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/utils/StringUtils.d.ts +1 -0
- package/dist/cjs/utils/StringUtils.js +1 -1
- package/dist/esm/assets/icons/ChartPie.svg.js +1 -0
- package/dist/esm/assets/icons/click.svg.js +1 -0
- package/dist/esm/assets/icons/send_template.svg.js +1 -0
- package/dist/esm/assets/icons/tick.svg.js +1 -0
- package/dist/esm/assets/icons/tick_double.svg.js +1 -0
- package/dist/esm/components/analytics-chips-and-dropdowns/AnalyticsTrend.js +1 -1
- package/dist/esm/components/analytics-chips-and-dropdowns/chart/Pie/PieChart.js +18 -4
- package/dist/esm/components/analytics-chips-and-dropdowns/chart/Pie/PieChartAnalytics.js +1 -1
- package/dist/esm/components/analytics-chips-and-dropdowns/chart/Pie/PieChartInputData.d.ts +2 -0
- 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 +0 -20
- package/dist/esm/components/analytics-chips-and-dropdowns/chart/VerticalBarGraph/VerticalGraph.js +1 -1
- package/dist/esm/components/bik-layout/MockMenus.d.ts +0 -1
- package/dist/esm/components/dropdown/MenuItem/MenuItem.d.ts +1 -0
- package/dist/esm/components/dropdown/MenuItem/MenuItem.js +18 -3
- package/dist/esm/components/modals/styledModal.d.ts +1 -0
- package/dist/esm/components/modals/styledModal.js +1 -1
- package/dist/esm/components/template-context-mapper/TemplateContextMapper.d.ts +2 -2
- package/dist/esm/components/template-context-mapper/TemplateContextMapper.js +1 -1
- package/dist/esm/components/template-context-mapper/index.d.ts +2 -0
- package/dist/esm/components/template-context-mapper/modalElements/TemplateAnalyticsComponent.d.ts +12 -0
- package/dist/esm/components/template-context-mapper/modalElements/TemplateAnalyticsComponent.js +1 -0
- package/dist/esm/components/template-context-mapper/modalElements/TemplateAnalyticsSkeleton.d.ts +3 -0
- package/dist/esm/components/template-context-mapper/modalElements/TemplateAnalyticsSkeleton.js +1 -0
- package/dist/esm/components/template-context-mapper/styles/TemplateAnalyticsStyles.d.ts +7 -0
- package/dist/esm/components/template-context-mapper/styles/TemplateAnalyticsStyles.js +63 -0
- package/dist/esm/components/template-context-mapper/utils/TemplateConstants.d.ts +44 -0
- package/dist/esm/components/template-context-mapper/utils/TemplateConstants.js +1 -0
- package/dist/esm/components/template-preview/models/WhatsAppTemplate.d.ts +31 -0
- package/dist/esm/index.js +1 -1
- package/dist/esm/utils/StringUtils.d.ts +1 -0
- package/dist/esm/utils/StringUtils.js +1 -1
- package/package.json +1 -1
- package/dist/cjs/components/template-context-mapper/modalElements/QualityWarningModal.js +0 -1
- package/dist/esm/components/template-context-mapper/modalElements/QualityWarningModal.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";function e(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,Object.freeze(t)}Object.defineProperty(exports,"__esModule",{value:!0});var t,r=e(require("react"));function n(){return n=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},n.apply(this,arguments)}var a=e=>r.createElement("svg",n({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20"},e),t||(t=r.createElement("path",{fill:"#616161",stroke:"#616161",strokeWidth:.465,d:"M7.375 8.92a.75.75 0 0 0 .375-.65V1.52a.75.75 0 0 0-1-.704 9.756 9.756 0 0 0-6.338 10.97.75.75 0 0 0 1.113.513l5.85-3.38ZM6.25 2.655v5.18l-4.489 2.59c-.01-.14-.01-.283-.01-.422a8.261 8.261 0 0 1 4.5-7.348ZM10 .254a.75.75 0 0 0-.75.75v8.608l-7.388 4.304a.75.75 0 0 0-.27 1.031A9.75 9.75 0 1 0 10 .254Zm0 18a8.294 8.294 0 0 1-6.702-3.439l7.08-4.125a.75.75 0 0 0 .375-.649V1.788A8.25 8.25 0 0 1 10 18.254Z"})));exports.default=a;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";function e(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var a=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,a.get?a:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,Object.freeze(t)}Object.defineProperty(exports,"__esModule",{value:!0});var t,r,a=e(require("react"));function l(){return l=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},l.apply(this,arguments)}var n=e=>a.createElement("svg",l({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},e),t||(t=a.createElement("path",{fill:"currentColor",d:"M11.194 3.987a.796.796 0 0 0 .566-.23l2.401-2.4A.8.8 0 0 0 13.03.224l-2.401 2.4a.804.804 0 0 0 .566 1.362ZM3.63 3.848a.8.8 0 0 1-1.004-.09L.225 1.355A.8.8 0 0 1 1.356.225l2.401 2.4a.8.8 0 0 1-.126 1.223ZM2.391 7.993H.848a.8.8 0 0 1 0-1.6H2.39a.8.8 0 0 1 0 1.6ZM7.193 3.193a.8.8 0 0 0 .8-.8V.848a.8.8 0 0 0-1.6 0v1.543a.8.8 0 0 0 .8.8ZM1.096 14.332a.797.797 0 0 1-.744-.08.804.804 0 0 1-.127-1.222l2.4-2.401a.8.8 0 0 1 1.132 1.132l-2.4 2.4a.796.796 0 0 1-.26.171Z"})),r||(r=a.createElement("path",{fill:"currentColor",fillRule:"evenodd",d:"M12.064 23.712a1.733 1.733 0 0 1-.66-.823L5.707 7.934A1.705 1.705 0 0 1 6.1 6.1a1.707 1.707 0 0 1 1.835-.392l14.954 5.697a1.726 1.726 0 0 1-.119 3.265l-6.167 1.85a.124.124 0 0 0-.084.083l-1.85 6.168a1.704 1.704 0 0 1-1.59 1.228 1.733 1.733 0 0 1-1.015-.287ZM7.324 7.31l-.007-.003-.006.006-.004.004 5.697 14.957a.019.019 0 0 0 .018.012h.003l1.853-6.177a1.839 1.839 0 0 1 1.234-1.231l.004-.002 6.162-1.848a.012.012 0 0 0 .006-.004.012.012 0 0 0 .002-.007.01.01 0 0 0-.002-.006l-.001-.002-.005-.002L7.325 7.31Z",clipRule:"evenodd"})));exports.default=n;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";function e(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,Object.freeze(t)}Object.defineProperty(exports,"__esModule",{value:!0});var t,r=e(require("react"));function n(){return n=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},n.apply(this,arguments)}var l=e=>r.createElement("svg",n({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20"},e),t||(t=r.createElement("path",{fill:"#731DCF",fillRule:"evenodd",d:"M18.94 1.097a.83.83 0 0 0-.899-.209L1.39 6.717a.833.833 0 0 0-.063 1.548l7.208 3.203 3.203 7.207a.833.833 0 0 0 1.548-.063l5.827-16.65a.833.833 0 0 0-.174-.864Zm-3.778 2.565L3.926 7.595l5.056 2.247 6.18-6.18Zm-5.001 7.359 6.18-6.18-3.933 11.236-2.247-5.057Z",clipRule:"evenodd"})));exports.default=l;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";function e(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,Object.freeze(t)}Object.defineProperty(exports,"__esModule",{value:!0});var t,r=e(require("react"));function n(){return n=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},n.apply(this,arguments)}var l=e=>r.createElement("svg",n({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 18 13"},e),t||(t=r.createElement("path",{fill:"currentColor",fillRule:"evenodd",d:"M17.707.293a1 1 0 0 1 0 1.414l-11 11a1 1 0 0 1-1.414 0l-5-5a1 1 0 0 1 1.414-1.414L6 10.586 16.293.293a1 1 0 0 1 1.414 0Z",clipRule:"evenodd"})));exports.default=l;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";function e(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,Object.freeze(t)}Object.defineProperty(exports,"__esModule",{value:!0});var t,r=e(require("react"));function n(){return n=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},n.apply(this,arguments)}var a=e=>r.createElement("svg",n({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 16 16"},e),t||(t=r.createElement("path",{fill:"currentColor",d:"M11.805 4.471a.667.667 0 1 0-.943-.942L4 10.39 1.138 7.53a.667.667 0 1 0-.943.942l3.334 3.334c.26.26.682.26.942 0l7.334-7.334ZM15.805 4.471a.667.667 0 1 0-.943-.942L8 10.39l-.029-.028a.667.667 0 0 0-.942.943l.5.5c.26.26.682.26.942 0l7.334-7.334Z"})));exports.default=a;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),n=require("../shimmer/ShimmerComponent/ShimmerStyled.js"),i=require("../../utils/DateUtils.js"),r=require("../../constants/Theme.js"),s=require("../../assets/icons/arrow_down.svg.js"),a=require("../../assets/icons/arrow_up.svg.js"),l=require("../../assets/icons/info.svg.js"),o=require("../tag/Tag.js"),c=require("../tooltips/Tooltip.js"),d=require("../TypographyStyle.js"),g=require("./chart/utils/calcPercentage.js"),u=require("./CommonStyles.js");function h(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var y=h(t);const m=n=>{let{percent:l,direction:o,timeline:c,customRange:u,trendRaw:h,prefixSymbol:y,trendIconStyle:m,isInternationalStore:p}=n;const j="negative"===o?s.default:a.default,x="negative"===o?r.COLORS.background.negative.vibrant:"positive"===o?r.COLORS.background.positive.vibrant:r.COLORS.content.placeholder,[b,f]=t.useState("");t.useEffect((()=>{f("today"===c?"vs yesterday":"yesterday"===c?"vs 1 day before":"7 days"===c?"vs last 7 days":"30 days"===c?"vs last 30 days":"custom"===c&&u?i.default.getAnalyticsCustomDateTimelineText(u):"")}),[c,u]);const S=e=>{let t;return t=p?g.truncateValueForInternationalStore(Math.abs(e)):g.truncateValueForIndianStore(Math.abs(e)),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),n=require("../shimmer/ShimmerComponent/ShimmerStyled.js"),i=require("../../utils/DateUtils.js"),r=require("../../constants/Theme.js"),s=require("../../assets/icons/arrow_down.svg.js"),a=require("../../assets/icons/arrow_up.svg.js"),l=require("../../assets/icons/info.svg.js"),o=require("../tag/Tag.js"),c=require("../tooltips/Tooltip.js"),d=require("../TypographyStyle.js"),g=require("./chart/utils/calcPercentage.js"),u=require("./CommonStyles.js");function h(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var y=h(t);const m=n=>{let{percent:l,direction:o,timeline:c,customRange:u,trendRaw:h,prefixSymbol:y,trendIconStyle:m,isInternationalStore:p}=n;const j="negative"===o?s.default:a.default,x="negative"===o?r.COLORS.background.negative.vibrant:"positive"===o?r.COLORS.background.positive.vibrant:r.COLORS.content.placeholder,[b,f]=t.useState("");t.useEffect((()=>{f("today"===c?"vs yesterday":"yesterday"===c?"vs 1 day before":"7 days"===c?"vs last 7 days":"30 days"===c?"vs last 30 days":"custom"===c&&u?i.default.getAnalyticsCustomDateTimelineText(u):"")}),[c,u]);const S=e=>{let t;return t=p?g.truncateValueForInternationalStore(Math.abs(e)):g.truncateValueForIndianStore(Math.abs(e)),e<0?"-"+t:t},O=t.useRef((()=>{const e=((null!=h?h:0)>0?"+":"")+(null!=y?y:"");return void 0===h?"--":`${null!=e?e:""}${S(h)}`})());return e.jsxs("div",Object.assign({style:{display:"flex",alignItems:"center",flexDirection:"row",flexWrap:"wrap"}},{children:["number"==typeof l&&e.jsx(j,{color:x,height:16,width:16,style:Object.assign({marginRight:2},null!=m?m:{})}),"number"==typeof l&&o&&e.jsxs(d.Caption,Object.assign({style:{color:x}},{children:["neutral"===o?0:l<1e3?l:">999","%"]})),!!h&&e.jsx(d.Caption,Object.assign({style:{marginLeft:4,color:r.COLORS.content.placeholder}},{children:`(${O.current})`})),c&&e.jsx(d.Caption,Object.assign({style:{marginLeft:4,color:r.COLORS.content.placeholder}},{children:b}))]}))};exports.AnalyticsTrend=t=>{let{title:i,value:s,trendPercent:a,type:h="horizontal",timeline:p,customRange:j,tooltip:x,card:b=!0,rightSeparator:f=!1,size:S="big",share:O=!1,formatVal:v,prefixSymbol:C,trailingIcon:T,onTrailIconClick:R,iconTooltipBody:w,funnelPercent:I,isLoading:$,trendRaw:L,suffixText:q,trendStyle:D,trendContainerStyle:F,trendIconStyle:M,containerStyle:k,prevTrendDiff:P,relativePercentageDiff:V,isInternationalStore:z}=t;const _="big"===S?d.TitleLarge:d.TitleMedium,A=void 0!==a?a<0?"negative":0===a?"neutral":"positive":void 0,N=void 0!==a?O?Math.round(a):Math.abs(Math.round(a)):void 0;return e.jsx(u.AnalyticsTrendContainer,Object.assign({card:b,style:Object.assign({},k)},{children:e.jsxs("div",Object.assign({style:Object.assign({display:"flex",flexDirection:"row",gap:4,borderRightWidth:f?1:0,borderRightColor:r.COLORS.stroke.primary,borderRightStyle:"solid",paddingLeft:b?0:24,paddingRight:b?0:24,height:"100%",justifyContent:"space-between",alignItems:"center"},null!=F?F:{})},{children:[e.jsxs("div",Object.assign({style:Object.assign({display:"flex",flexDirection:"column",gap:4,height:"100%"},null!=D?D:{})},{children:[e.jsxs("div",Object.assign({style:{display:"flex",flexDirection:"row",gap:4,alignItems:"center"}},{children:[e.jsx(d.BodyCaption,Object.assign({style:{color:r.COLORS.content.secondary}},{children:i})),x&&e.jsx(c.Tooltip,Object.assign({body:x,placement:"right",width:300},{children:e.jsx("div",Object.assign({style:{display:"flex",cursor:"pointer",height:"100%"}},{children:e.jsx(l.default,{color:r.COLORS.content.primary,height:16,width:16})}))}))]})),e.jsxs("div",Object.assign({style:Object.assign({display:"flex",flexDirection:"row",gap:12,alignItems:"center"},O?{justifyContent:"space-between"}:{})},{children:[$&&e.jsx(n.ShimmerComponentStyled,{width:108,height:26}),!$&&e.jsx(_,Object.assign({style:{color:r.COLORS.content.primary}},{children:void 0===s?"--":"number"==typeof s&&v?s>999?z?`${null!=C?C:""}${g.truncateValueForInternationalStore(s)} ${null!=q?q:""}`:`${null!=C?C:""}${g.truncateValueForIndianStore(s)} ${null!=q?q:""}`:`${null!=C?C:""}${new Intl.NumberFormat("en-IN",{maximumFractionDigits:2}).format(s)} ${null!=q?q:""}`:`${null!=C?C:""}${s} ${null!=q?q:""}`})),"number"==typeof V&&e.jsx(o.Tag,{tagText:`${V}%`,theme:"light",type:"neutral"}),"horizontal"===h&&!$&&!O&&e.jsx(m,{timeline:p,customRange:j,percent:N,direction:A,trendRaw:L,prefixSymbol:C,trendIconStyle:M,isInternationalStore:z}),$&&!O&&"horizontal"===h&&e.jsx(n.ShimmerComponentStyled,{height:20,width:141,marginTop:6}),"vertical"===h&&!$&&void 0!==I&&e.jsx(o.Tag,{tagText:`${I} %`,theme:"light",type:"neutral"}),O&&!$&&void 0!==N&&e.jsx(o.Tag,{tagText:`${N} %`,theme:"light",type:"neutral"}),O||$||!P||0==P?e.jsx(e.Fragment,{}):e.jsx(o.Tag,{tagText:(e=>{const t=Math.abs(e);return t%1!=0?`${t.toFixed(1)} %`:`${t} %`})(P),theme:"light",type:"neutral"})]})),"vertical"===h&&!$&&!O&&e.jsx("div",Object.assign({style:{marginTop:10}},{children:e.jsx(m,{timeline:p,customRange:j,percent:N,direction:A,trendRaw:L,prefixSymbol:C,trendIconStyle:M,isInternationalStore:z})})),$&&"vertical"===h&&e.jsx(n.ShimmerComponentStyled,{height:20,width:141,marginTop:6})]})),w&&!$&&e.jsx(c.Tooltip,Object.assign({body:w,placement:"right"},{children:T&&e.jsx("div",Object.assign({className:"icon--holder",onClick:R},{children:y.default.createElement(T,{height:20,width:20,color:r.COLORS.content.secondary})}))}))]}))}))};
|
|
@@ -1,15 +1,29 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),r=require("styled-components"),s=require("../Legend/Legend.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),r=require("styled-components"),s=require("../Legend/Legend.js"),a=require("../../../TypographyStyle.js");function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}const i=l(r).default.div`
|
|
2
2
|
width: 100%;
|
|
3
3
|
display: flex;
|
|
4
4
|
flex-direction: column;
|
|
5
|
-
justify-content:
|
|
5
|
+
justify-content: flex-start;
|
|
6
6
|
gap: 24px;
|
|
7
7
|
|
|
8
8
|
.slice-row {
|
|
9
9
|
width: 100%;
|
|
10
10
|
display: flex;
|
|
11
|
-
.percentage
|
|
11
|
+
.percentage,
|
|
12
|
+
.raw-value {
|
|
12
13
|
margin-left: auto;
|
|
13
14
|
}
|
|
14
15
|
}
|
|
15
|
-
|
|
16
|
+
|
|
17
|
+
overflow: scroll;
|
|
18
|
+
|
|
19
|
+
::-webkit-scrollbar {
|
|
20
|
+
-webkit-appearance: none;
|
|
21
|
+
width: 7px;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
::-webkit-scrollbar-thumb {
|
|
25
|
+
border-radius: 4px;
|
|
26
|
+
background-color: #e0e0e0;
|
|
27
|
+
-webkit-box-shadow: 0 0 1px rgba(255, 255, 255, 0.5);
|
|
28
|
+
}
|
|
29
|
+
`;exports.PieChart=r=>{let{slices:l,size:n}=r;const[c,o]=t.useState(0);t.useEffect((()=>{let e=0;l.forEach((t=>{e+=t.count})),o(e)}),[l]);const d=n?{height:`${n}px`}:{};return e.jsx(i,Object.assign({style:d},{children:l.map((t=>{return e.jsxs("div",Object.assign({className:"slice-row"},{children:[e.jsx(s.Legend,{color:t.color,text:t.name},t.name),e.jsxs("div",Object.assign({style:{display:"flex",alignItems:"center",flexDirection:"column"}},{children:[e.jsxs(a.BodySecondary,Object.assign({className:"percentage"},{children:[(r=t.count,0===c?0:parseFloat((r/c*100).toFixed(1))),"%"]})),t.rawValue&&e.jsxs(a.BodyTiny,Object.assign({className:"raw-value"},{children:["(",t.rawValue,")"]}))]}))]}),t.name);var r}))}))};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@emotion/styled/base"),g=require("react/jsx-runtime"),I=require("../../../../assets/icons/ChartBar.svg.js"),C=require("../../../../assets/icons/maximize.svg.js");require("@amplitude/analytics-browser"),require("../../../../amplitude/model.js");var A=require("../../../../utils/StringUtils.js"),r=require("../../../../constants/Theme.js");require("../../../../constants/zindex.js");var i=require("react");require("../../../checkBox/CheckBox.styled.js");var l=require("../../../TypographyStyle.js");require("../../../list-item/ListItem.js"),require("../../../pagination/Pagination.js"),require("../../../radioButton/RadioButton.styled.js"),require("react-dom"),require("react-toastify"),require("../../../button/Button.js"),require("../../../toaster/Toaster.styled.js"),require("../../../tooltips/Tooltip.js"),require("../../../spinner/Spinner.js"),require("../../../stepper/Stepper.styled.js"),require("../../../tag/Tag.js");var s=require("../../../icon-button/IconButton.js");require("../../../template-preview/TemplatePreview.js"),require("../../../template-preview/WhatsApp/WhatsAppLikePreview.js"),require("../../../template-preview/WhatsApp/WhatsAppLikePreviewV2.js"),require("../../../curtain/CurtainHelper.js"),require("../../../variable-picker-v3/model.js"),require("../../../template-preview/models/TemplateMeta.js"),require("../../../template-preview/models/WhatsAppTemplate.js"),require("../../../template-preview/models/Channels.js"),require("lodash");var t=require("../../../modals/styledModal.js");require("../../../template-context-mapper/context/templateModalContext.js"),require("../../../template-context-mapper/modalElements/Footer.js"),require("../../../template-context-mapper/modalElements/Body.js"),require("../../../template-context-mapper/modalElements/Header.js"),require("../../../../_virtual/_tslib.js"),require("../../../zeroState/ZeroState.js"),require("../../../dropdown/OpenedDropdown/components/description/Description.styled.js"),require("../../../dropdown/OpenedDropdown/components/menu/FreeFormMenu.styled.js"),require("../../../dropdown/OpenedDropdown/components/menu/MenuItem.js"),require("../../../dropdown/OpenedDropdown/components/menu/MenuList.styled.js"),require("../../../dropdown/OpenedDropdown/components/multiSelect/MultiSelectDropdownBottomBar.styled.js"),require("../../../dropdown/OpenedDropdown/components/OpennedDropdown.styled.js"),require("../../../input/Input.js"),require("react-bootstrap"),require("../../../floating-action-button/FloatingActionButton.styles.js"),require("../../../image-compress/ImageCompress.js"),require("../../../progress-bar/ProgressBarComponent.js"),require("../../../progress-bar-v2/ProgressBarV2.js"),require("../../../QueryBuilder/QueryBuilder.js"),require("../../../QueryBuilder/components/QueryBuilderNode/Base/BaseQueryBuilderNode.js"),require("../../../QueryBuilder/constants/connectorPosition.js"),require("../../../QueryBuilder/constants/connector.js"),require("../../../QueryBuilder/types/QueryBuilder.type.js"),require("../../../dropdown/Dropdown.js"),require("../../../QueryBuilder/components/InputLoader.js"),require("../../../QueryBuilder/components/Connectors/Components/EmojiPicker.js"),require("react-chips"),require("../../../input/ChipInput.styled.js"),require("../../../QueryBuilder/components/Connectors/Components/FrequencyIntegerPositiveSingle.js"),require("../../../QueryBuilder/components/Connectors/Components/IgPicker.js"),require("../../../QueryBuilder/components/Connectors/Components/InTheLast.js"),require("../../../QueryBuilder/components/Connectors/Components/InTwoLast.js"),require("../../../datePicker/DatePickerWrapper.js"),require("../../../QueryBuilder/components/Connectors/Connector.styled.js"),require("../../../QueryBuilder/components/QueryBuilderNode/Property/PropertyNode.styled.js"),require("../../../QueryBuilder/components/QueryBuilderNode/Property/PropertyNodeUIWrapper.styled.js"),require("../../../QueryBuilder/redux/queryBuilder.reducer.js"),require("../../../QueryBuilder/redux/queryBuilderCache.reducer.js"),require("../../../QueryBuilder/types/QueryBuilderOperator.type.js"),require("../../../dropdown/DropdownPopover/index.js"),require("../../../dropdown/ChipDropdown.js"),require("../../../dropdown/MenuItem/MenuItem.js"),require("../../../shimmer/ShimmerComponent/ShimmerStyled.js"),require("../../../analytics-card/AnalyticsCard.styled.js"),require("../../CommonStyles.js"),require("react-calendar"),require("../../../datePicker/DatePicker.styled.js"),require("../../AnalyticsMetric.js"),require("../../../../utils/DateUtils.js"),require("../utils/calcPercentage.js"),require("../LineChart/LineChart.js"),require("../linearChipGroupedChart/LinearChipGroupedChart.styled.js");var c=require("./PieChart.js");require("../HorizontalBarGraph/HorizontalGraph.js"),require("../StackedBarChart/StackedBarChart.js"),require("../StackedBarChart/StackedBarDistributionChart.js"),require("../StackedBarChart/StackedBarDistributionChart.model.js");var a=require("../VerticalBarGraph/VerticalGraph.js");require("../VerticalBarGraph/FunnelVerticalBarGraph.js"),require("../heatmap/HeatMap.js"),require("../heatmap/HeatMapVertical.js"),require("../VerticalBarAndLinearGraph/VerticalBarAndLinearGraph.js"),require("../../../avatar/Avatar.js"),require("../../../avatar/AvatarHelper.js"),require("../../../alerts/Alert.styled.js"),require("../../../alerts/AlertHelper.js"),require("../../../thumbnail/Thumbnail.js"),require("../../../curtain/Curtain.styled.js"),require("../../../switch/Switch.js"),require("../../../plans/SubscriptionPlanStyled.js"),require("../../../plans/SubscriptionPlanSelector.js"),require("../../../plans/SubscriptionPlansCollected.js"),require("../../../tabs/Tabs.js"),require("../../../TablePagination/TablePagination.styled.js"),require("../../../TablePagination/TablePaginationCard.js"),require("../../../states/StateComponent.js"),require("../../../WhatsAppTextEditor/WhatsAppTextEditor.js"),require("../../../WhatsAppTextEditor/WhatsAppTextEditorHeader.js"),require("../../../card-selection-modal/CardSelectionModal.styled.js"),require("react-image-crop"),require("../../../buttonGroup/ButtonGroupStyle.js"),require("../../../accordion/Accordion.style.js"),require("../../../accordion/AccordionArrow.js"),require("../../../file-uploader/FileUploaderStyle.js"),require("../../../colourInput/ColourInput.styled.js"),require("../../../bik-layout/CommonStyles.js"),require("../../../navigation-hyperlink/NavigationHyperlink.js"),require("../../../bik-layout/SidebarStyles.js"),require("date-fns"),require("react-popper"),require("../../../dropdown/Common.styled.js"),require("../../../custom-date-time/CustomDateTime.styled.js"),require("../../../../node_modules/lodash.debounce/index.js"),require("../../../product-picker/ProductPicker.styled.js"),require("../../../discount-modal/type.js"),require("../../../product-picker-v2/modal.js"),require("../../../modals/modal.styled.js"),require("../../../variable-picker-v3/NoResult.js"),require("../../../variable-picker-v3/styles.js"),require("../../../discount-modal/DiscountModal.styled.js"),require("../../../discount-modal/DynamicCoupon/DynamicCoupon.js"),require("../../../country-code-picker/CountryCodePicker.styled.js"),require("../../../carousel/carousel.js"),require("../../../carousel-secondary/CarouselSecondary.js"),require("../../../access-token-troubleshoot-dialog/AccessTokenTroubleshootDialog.styles.js"),require("../../../radioList/RadioList.styled.js"),require("../../../checkList/CheckList.styled.js"),require("../../../postPicker/postPicker.js"),require("../../../dropdown-button/DropdownButton.style.js"),require("../../../side-modal/SideModal.style.js"),require("../../../add-variableV2/AddVariableV2.styled.js"),require("../../../SearchFilter/types/SearchFilter.type.js"),require("../../../SearchFilter/components/DatePickerButton.js"),require("../../../SearchFilter/components/DateRangeOnlyButton.js"),require("../../../input-with-vars/InputWithVariables.js"),require("../../../star-rating/StarRating.js"),require("../../../dashboard-review-popup/components/FiveStar.styled.js"),require("../../../dashboard-review-popup/components/Form.styled.js"),require("../../../dashboard-review-popup/components/ZeroState.js"),require("../../../dashboard-review-popup/DashboardReviewPopUp.styled.js"),require("../../../testimonial-card/TestimonialCard.style.js"),require("../../../slider/slider.js"),require("react-slick"),require("../../../carousel-preview/CarouselPreview.style.js"),require("../../../card-selector/CardSelector.styled.js"),require("../../../action-button/ActionButton.styled.js"),require("../../../floating-input-dropdown/FloatingInputDropdown.js"),require("../../../dropdown/MultilevelDropdownPopover/index.js"),require("../../../multi-level-dropdown/MultiLevelDropdown.styled.js");var o=require("chart.js"),d=require("react-chartjs-2");function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var u=n(e);o.Chart.register(o.ArcElement,o.Legend);const p={plugins:{legend:{display:!1},tooltip:{enabled:!0,callbacks:{label:e=>{if(!e.label)return" 0%";const g=e.dataset.data.reduce(((e,g)=>e+g),0),I=parseFloat((e.raw/g*100).toFixed(1));return[` ${e.label}`,` ${e.raw} (${I}% of ${g})`]}}}}},b=["#5E07BB","#9E77ED","#D2AEFF","#CDE1FF","#92AFFA","#3935E1"],G=u.default("div","production"===process.env.NODE_ENV?{target:"elaov7f0"}:{target:"elaov7f0",label:"CartStyled"})("background:",(e=>r.COLORS.surface.standard),";border:1px solid ",(e=>r.COLORS.stroke.primary),";border-radius:4px;"+("production"===process.env.NODE_ENV?"":"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIlBpZUNoYXJ0QW5hbHl0aWNzLnRzeCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFnRThCIiwiZmlsZSI6IlBpZUNoYXJ0QW5hbHl0aWNzLnRzeCIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IGpzeCBhcyBfanN4LCBGcmFnbWVudCBhcyBfRnJhZ21lbnQsIGpzeHMgYXMgX2pzeHMgfSBmcm9tIFwicmVhY3QvanN4LXJ1bnRpbWVcIjtcclxuaW1wb3J0IHN0eWxlZCBmcm9tICdAZW1vdGlvbi9zdHlsZWQnO1xyXG5pbXBvcnQgQmFyQ2hhcnRJY29uIGZyb20gJ0BzcmMvYXNzZXRzL2ljb25zL0NoYXJ0QmFyLnN2Zyc7XHJcbmltcG9ydCBNYXhpbWl6ZUljb24gZnJvbSAnQHNyYy9hc3NldHMvaWNvbnMvbWF4aW1pemUuc3ZnJztcclxuaW1wb3J0IHsgU3RyaW5nVXRpbHMgfSBmcm9tIFwiLi4vLi4vLi4vLi4vaW5kZXhcIjtcclxuaW1wb3J0IHsgQXJjRWxlbWVudCwgQ2hhcnQgYXMgQ2hhcnRKUywgTGVnZW5kIH0gZnJvbSAnY2hhcnQuanMnO1xyXG5pbXBvcnQgeyB1c2VFZmZlY3QsIHVzZVN0YXRlIH0gZnJvbSAncmVhY3QnO1xyXG5pbXBvcnQgeyBEb3VnaG51dCB9IGZyb20gJ3JlYWN0LWNoYXJ0anMtMic7XHJcbmltcG9ydCB7IEljb25CdXR0b24gfSBmcm9tIFwiLi4vLi4vLi4vaWNvbi1idXR0b25cIjtcclxuaW1wb3J0IHsgU3R5bGVkTW9kYWwgfSBmcm9tIFwiLi4vLi4vLi4vbW9kYWxzXCI7XHJcbmltcG9ydCB7IFRpdGxlTWVka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R0JBOiB7IHI6IDIxMCwgZzogMTc0LCBiOiAyNTUsIGE6IDEgfSxcclxuICAgIH07XHJcbiAgICByZXR1cm4gYmFyQ2hhcnREYXRhO1xyXG59O1xyXG5jb25zdCBvcHRpb25zID0ge1xyXG4gICAgcGx1Z2luczoge1xyXG4gICAgICAgIGxlZ2VuZDoge1xyXG4gICAgICAgICAgICBkaXNwbGF5OiBmYWxzZSxcclxuICAgICAgICB9LFxyXG4gICAgICAgIHRvb2x0aXA6IHtcclxuICAgICAgICAgICAgZW5hYmxlZDogdHJ1ZSxcclxuICAgICAgICAgICAgY2FsbGJhY2tzOiB7XHJcbiAgICAgICAgICAgICAgICBsYWJlbDogKHRvb2x0aXBJdGVtKSA9PiB7XHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKCF0b29sdGlwSXRlbS5sYWJlbCkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gYCAwJWA7XHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IHRvdGFsID0gdG9vbHRpcEl0ZW0uZGF0YXNldC5kYXRhLnJlZHVjZSgoYWNjLCBjdXIpID0+IGFjYyArIGN1ciwgMCk7XHJcbiAgICAgICAgICAgICAgICAgICAgY29uc3QgcGVyY2VudGFnZSA9IHBhcnNlRmxvYXQoKCh0b29sdGlwSXRlbS5yYXcgLyB0b3RhbCkgKiAxMDApLnRvRml4ZWQoMSkpO1xyXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBbXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGAgJHt0b29sdGlwSXRlbS5sYWJlbH1gLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICBgICR7dG9vbHRpcEl0ZW0ucmF3fSAoJHtwZXJjZW50YWdlfSUgb2YgJHt0b3RhbH0pYCxcclxuICAgICAgICAgICAgICAgICAgICBdO1xyXG4gICAgICAgICAgICAgICAgfSxcclxuICAgICAgICAgICAgfSxcclxuICAgICAg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ZGF0YTogWzEwMF0sXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGJhY2tncm91bmRDb2xvcjogWycjRjBGMEYwJ10sXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGJvcmRlcldpZHRoOiAwLFxyXG4gICAgICAgICAgICAgICAgICAgIH0sXHJcbiAgICAgICAgICAgICAgICBdLFxyXG4gICAgICAgICAgICB9O1xyXG4gICAgICAgICAgICBzZXREYXRhKGRhdGFTZXQpO1xyXG4gICAgICAgIH1cclxuICAgICAgICBlbHNlIHtcclxuICAgICAgICAgICAgY29uc3QgZGF0YVNldCA9IHtcclxuICAgICAgICAgICAgICAgIGxhYmVsczogc2xpY2VzLm1hcCgoc2xpY2UpID0+IFN0cmluZ1V0aWxzLmNhcGl0YWxpemUoc2xpY2UubmFtZSkpLFxyXG4gICAgICAgICAgICAgICAgZGF0YXNldHM6IFtcclxuICAgICAgICAgICAgICAgICAgICB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGRhdGE6IHNsaWNlcy5tYXAoKHNsaWNlKSA9PiBzbGljZS5jb3VudCksXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGJhY2tncm91bmRDb2xvcjogc2xpY2VzLm1hcCgoc2xpY2UsIGluZGV4KSA9PiB7IHZhciBfYTsgcmV0dXJuIChfYSA9IHNsaWNlLmNvbG9yKSAhPT0gbnVsbCAmJiBfYSAhPT0gdm9pZCAwID8gX2EgOiBHUkFQSF9DT0xPUlNbaW5kZXggJSBHUkFQSF9DT0xPUlMubGVuZ3RoXTsgfSksXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGJvcmRlckNvbG9yOiBbJ3doaXRlJywgJ3doaXRlJywgJ3doaXRlJywgJ3doaXRlJywgJ3doaXRlJywgJ3doaXRlJ10sXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGJvcmRlcldpZHRoOiA0LFxyXG4gICAgICAgICAgICAgICAgICAgICAgICBib3JkZXJSYWRpdXM6IDgsXHJcbiAgICAgICAgICAgICAgICAgICAgfSxcclxuICAgICAgICAgICAgICAgIF0sXHJcbiAgICAgICAgICAgIH07XHJcbiAgICAgICAgICAgIHNldERhdGEoZGF0YVNldCk7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGlmICh0cnVuY2F0ZVNsaWNlcyAmJiBzbGljZXMubGVuZ3RoID4gdHJ1bmNhdGVTbGljZXMpIHtcclxuICAgICAgICAgICAgY29uc3QgdHJ1bmNhdGVkU2xpY2VzID0gc2xpY2VzLnNsaWNlKDAsIHRydW5jYXRlU2xpY2VzKTtcclxuICAgICAgICAgICAgY29uc3Qgb3RoZXJTbGljZXMgPSBzbGljZXMuc2xpY2UodHJ1bmNhdGVTbGljZXMpO1xyXG4gICAgICAgICAgICBjb25zdCBvdGhlckNvdW50ID0gb3RoZXJTbGljZXMucmVkdWNlKChzdW0sIHNsaWNlKSA9PiBzdW0gKyBzbGljZS5jb3VudCwgMCk7XHJcbiAgICAgICAgICAgIHRydW5jYXRlZFNsaWNlcy5wdXNoKHsgbmFtZTogJ090aGVyJywgY291bnQ6IG90aGVyQ291bnQgfSk7XHJcbiAgICAgICAgICAgIGNvbnN0IHRydW5jYXRlZERhdGFTZXQgPSB7XHJcbiAgICAgICAgICAgICAgICBsYWJlbHM6IHRydW5jYXRlZFNsaWNlcy5tYXAoKHNsaWNlKSA9PiBTdHJpbmdVdGlscy5jYXBpdGFsaXplKHNsaWNlLm5hbWUpKSxcclxuICAgICAgICAgICAgICAgIGRhdGFzZXRzOiBbXHJcbiAgICAgICAgICAgICAgICAgICAge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBkYXRhOiB0cnVuY2F0ZWRTbGljZXMubWFwKChzbGljZSkgPT4gc2xpY2UuY291bnQpLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICBiYWNrZ3JvdW5kQ29sb3I6IHRydW5jYXRlZFNsaWNlcy5tYXAoKHNsaWNlLCBpbmRleCkgPT4geyB2YXIgX2E7IHJldHVybiAoX2EgPSBzbGljZS5jb2xvcikgIT09IG51bGwgJiYgX2EgIT09IHZvaWQgMCA/IF9hIDogR1JBUEhfQ09MT1JTW2luZGV4ICUgR1JBUEhfQ09MT1JTLmxlbmd0aF07IH0pLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICBib3JkZXJDb2xvcjogWyd3aGl0ZScsICd3aGl0ZScsICd3aGl0ZScsICd3aGl0ZScsICd3aGl0ZScsICd3aGl0ZSddLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICBib3JkZXJXaWR0aDogNCxcclxuICAgICAgICAgICAgICAgICAgICAgICAgYm9yZGVyUmFkaXVzOiA4LFxyXG4gICAgICAgICAgICAgICAgICAgIH0sXHJcbiAgICAgICAgICAgICAgICBdLFxyXG4gICAgICAgICAgICB9O1xyXG4gICAgICAgICAgICBzZXRUcnVuY2F0ZWREYXRhKHRydW5jYXRlZERhdGFTZXQpO1xyXG4gICAgICAgICAgICBjb25zdCB0cnVuY2F0ZWRTbGljZXNXaXRoQ29sb3IgPSB0cnVuY2F0ZWRTbGljZXMubWFwKChzbGljZSwgaW5kZXgpID0+IChPYmplY3QuYXNzaWduKHsgY29sb3I6IEdSQVBIX0NPTE9SU1tpbmRleCAlIEdSQVBIX0NPTE9SUy5sZW5ndGhdIH0sIHNsaWNlKSkpO1xyXG4gICAgICAgICAgICBzZXRUcnVuY2F0ZWRTbGljZXNXaXRoQ29sb3IodHJ1bmNhdGVkU2xpY2VzV2l0aENvbG9yKTtcclxuICAgICAgICB9XHJcbiAgICAgICAgaWYgKHNob3dDb252ZXJ0VG9CYXJDaGFydCkge1xyXG4gICAgICAgICAgICBzZXRCYXJDaGFydERhdGEoY29udmVydFRvQmFyQ2hhcnREYXRhKHNsaWNlcywgYmFyQ2hhcnRYQXhpc1RpdGxlLCBiYXJDaGFydFlBeGlzVGl0bGUpKTtcclxuICAgICAgICB9XHJcbiAgICB9LCBbc2xpY2VzLCB0cnVuY2F0ZVNsaWNlc10pO1xyXG4gICAgaWYgKCFkYXRhKSB7XHJcbiAgICAgICAgcmV0dXJuIF9qc3goX0ZyYWdtZW50LCB7fSk7XHJcbiAgICB9XHJcbiAgICByZXR1cm4gKF9qc3hzKF9GcmFnbWVudCwgeyBjaGlsZHJlbjogW19qc3hzKFwiZGl2XCIsIE9iamVjdC5hc3NpZ24oeyBzdHlsZToge1xyXG4gICAgICAgICAgICAgICAgICAgIGRpc3BsYXk6ICdmbGV4JyxcclxuICAgICAgICAgICAgICAgICAgICBqdXN0aWZ5Q29udGVudDogaGlkZVRpdGxlIHx8ICh0aXRsZSA9PT0gbnVsbCB8fCB0aXRsZSA9PT0gdm9pZCAwID8gdm9pZCAwIDogdGl0bGUubGVuZ3RoKSA9PT0gMCA/ICdmbGV4LWVuZCcgOiAnc3BhY2UtYmV0d2VlbicsXHJcbiAgICAgICAgICAgICAgICB9IH0sIHsgY2hpbGRyZW46IFshaGlkZVRpdGxlICYmIHRpdGxlICYmIChfanN4KFRpdGxlTWVkaXVtLCBPYmplY3QuYXNzaWduKHsgc3R5bGU6IHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1hcmdpbkJvdHRvbTogMTYsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gfSwgeyBjaGlsZHJlbjogdGl0bGUgfSkpKSwgX2pzeHMoXCJkaXZcIiwgeyBjaGlsZHJlbjogW3Nob3dDb252ZXJ0VG9CYXJDaGFydCAmJiAoX2pzeChJY29uQnV0dG9uLCB7IEljb246IEJhckNoYXJ0SWNvbiwgb25DbGljazogKCkgPT4ge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZXRTaG93QmFyQ2hhcnQodHJ1ZSk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSB9KSksIGFsbG93Q2hhcnRQb3B1cCAmJiAoX2pzeChJY29uQnV0dG9uLCB7IEljb246IE1heGltaXplSWNvbiwgb25DbGljazogKCkgPT4ge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZXRTaG93UG9wdXAodHJ1ZSk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSB9KSldIH0pXSB9KSksIF9qc3hzKFwiZGl2XCIsIE9iamVjdC5hc3NpZ24oeyBjbGFzc05hbWU6ICdyb3cnIH0sIHsgY2hpbGRyZW46IFtfanN4KFwiZGl2XCIsIE9iamVjdC5hc3NpZ24oeyBjbGFzc05hbWU6ICdjb2wtNicgfSwgeyBjaGlsZHJlbjogX2pzeChcImRpdlwiLCBPYmplY3QuYXNzaWduKHsgc3R5bGU6IHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3aWR0aDogc2l6ZSxcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoZWlnaHQ6IHNpemUsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IH0sIHsgY2hpbGRyZW46IF9qc3goRG91Z2hudXQsIHsgZGF0YTogKHRydW5jYXRlU2xpY2VzID8gdHJ1bmNhdGVkRGF0YSA6IGRhdGEpLCBvcHRpb25zOiBPYmplY3QuYXNzaWduKE9iamVjdC5hc3NpZ24oe30sIG9wdGlvbnMpLCB7IG1haW50YWluQXNwZWN0UmF0aW86IHNpemUgPyBmYWxzZSA6IHRydWUgfSkgfSkgfSkpIH0pKSwgX2pzeChcImRpdlwiLCBPYmplY3QuYXNzaWduKHsgY2xhc3NOYW1lOiAnY29sLTYnLCBzdHlsZToge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFkZGluZ0xlZnQ6IDQ4LFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZGlzcGxheTogJ2ZsZXgnLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZmxleERpcmVjdGlvbjogJ2NvbHVtbicsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBqdXN0aWZ5Q29udGVudDogJ2NlbnRlcicsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gfSwgeyBjaGlsZHJlbjogX2pzeChQaWVDaGFydCwgeyBzbGljZXM6IHRydW5jYXRlU2xpY2VzID8gdHJ1bmNhdGVkU2xpY2VzV2l0aENvbG9yIDogc2xpY2VzV2l0aENvbG9yIH0pIH0pKV0gfSkpLCBzaG93UG9wdXAgJiYgKF9qc3goU3R5bGVkTW9kYWwsIE9iamVjdC5hc3NpZ24oeyBvcGVuOiBzaG93UG9wdXAsIG9uQ2xvc2U6ICgpID0+IHNldFNob3dQb3B1cChmYWxzZSksIGNsb3NlT25PdXRzaWRlQ2xpY2s6IHRydWUsIGhlYWRpbmdUaXRsZTogdGl0bGUsIHdpZHRoOiBcIjc1JVwiIH0sIHsgY2hpbGRyZW46IF9qc3hzKFwiZGl2XCIsIE9iamVjdC5hc3NpZ24oeyBzdHlsZToge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBwYWRkaW5nOiAyNCxcclxuICAgICAgICAgICAgICAgICAgICAgICAgZGlzcGxheTogJ2ZsZXgnLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICBqdXN0aWZ5Q29udGVudDogJ3NwYWNlLWJldHdlZW4nLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICBoZWlnaHQ6ICc4MHZoJyxcclxuICAgICAgICAgICAgICAgICAgICB9IH0sIHsgY2hpbGRyZW46IFtfanN4KFwiZGl2XCIsIE9iamVjdC5hc3NpZ24oeyBzdHlsZTogeyB3aWR0aDogJzU1JScsIG1hcmdpbkxlZnQ6ICc0JScgfSB9LCB7IGNoaWxkcmVuOiBfanN4KFwiZGl2XCIsIE9iamVjdC5hc3NpZ24oeyBzdHlsZToge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3aWR0aDogJzEwMCUnLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoZWlnaHQ6ICcxMDAlJyxcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGlzcGxheTogJ2ZsZXgnLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhbGlnbkl0ZW1zOiAnY2VudGVyJyxcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAganVzdGlmeUNvbnRlbnQ6ICdjZW50ZXInLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gfSwgeyBjaGlsZHJlbjogX2pzeChEb3VnaG51dCwgeyBkYXRhOiBkYXRhLCBvcHRpb25zOiBPYmplY3QuYXNzaWduKE9iamVjdC5hc3NpZ24oe30sIG9wdGlvbnMpLCB7IG1haW50YWluQXNwZWN0UmF0aW86IHNpemUgPyBmYWxzZSA6IHRydWUgfSkgfSkgfSkpIH0pKSwgX2pzeChcImRpdlwiLCBPYmplY3QuYXNzaWduKHsgc3R5bGU6IHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3aWR0aDogJzMwJScsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGVpZ2h0OiAnMTAwJScsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb3ZlcmZsb3dZOiAnYXV0bycsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IH0sIHsgY2hpbGRyZW46IF9qc3goUGllQ2hhcnQsIHsgc2xpY2VzOiBzbGljZXNXaXRoQ29sb3IgfSkgfSkpXSB9KSkgfSkpKSwgc2hvd0JhckNoYXJ0ICYmIGJhckNoYXJ0RGF0YSAmJiAoX2pzeChTdHlsZWRNb2RhbCwgT2JqZWN0LmFzc2lnbih7IG9wZW46IHNob3dCYXJDaGFydCwgb25DbG9zZTogKCkgPT4gc2V0U2hvd0JhckNoYXJ0KGZhbHNlKSwgY2xvc2VPbk91dHNpZGVDbGljazogdHJ1ZSwgaGVhZGluZ1RpdGxlOiB0aXRsZSwgd2lkdGg6IFwiODUlXCIgfSwgeyBjaGlsZHJlbjogX2pzeChcImRpdlwiLCBPYmplY3QuYXNzaWduKHsgc3R5bGU6IHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgcGFkZGluZzogJzI0cHggMCcsXHJcbiAgICAgICAgICAgICAgICAgICAgfSB9LCB7IGNoaWxkcmVuOiBfanN4KFZlcnRpY2FsR3JhcGgsIHsgeEF4aXM6IGJhckNoYXJ0RGF0YS54QXhpcywgeUF4aXM6IGJhckNoYXJ0RGF0YS55QXhpcywgYmFyQ29sb3JSR0JBOiBiYXJDaGFydERhdGEgPT09IG51bGwgfHwgYmFyQ2hhcnREYXRhID09PSB2b2lkIDAgPyB2b2lkIDAgOiBiYXJDaGFydERhdGEuYmFyQ29sb3JSR0JBIH0pIH0pKSB9KSkpXSB9KSk7XHJcbn07XHJcbi8vIyBzb3VyY2VNYXBwaW5nVVJMPVBpZUNoYXJ0QW5hbHl0aWNzLmpzLm1hcCJdfQ== */"));exports.Card=e=>g.jsx(G,Object.assign({style:{padding:24}},{children:e.children})),exports.PieChartAnalytics=e=>{let{title:r,slices:o,size:n,allowChartPopup:u,showConvertToBarChart:G,truncateSlices:X,barChartXAxisTitle:y,barChartYAxisTitle:h,hideTitle:B=!1}=e;const[m,j]=i.useState(!1),[x,Z]=i.useState(!1),[R,H]=i.useState([]),[Y,J]=i.useState(),[N,W]=i.useState(),[S,F]=i.useState([]),[V,w]=i.useState(null);return i.useEffect((()=>{const e=o.reduce(((e,g)=>e+g.count),0);let g=[];if(g=Object.keys(o).map(((e,g)=>Object.assign({color:b[g%b.length]},o[e]))),H([...g]),0===e){J({datasets:[{data:[100],backgroundColor:["#F0F0F0"],borderWidth:0}]})}else{const e={labels:o.map((e=>A.default.capitalize(e.name))),datasets:[{data:o.map((e=>e.count)),backgroundColor:o.map(((e,g)=>{var I;return null!==(I=e.color)&&void 0!==I?I:b[g%b.length]})),borderColor:["white","white","white","white","white","white"],borderWidth:4,borderRadius:8}]};J(e)}if(X&&o.length>X){const e=o.slice(0,X),g=o.slice(X).reduce(((e,g)=>e+g.count),0);e.push({name:"Other",count:g});const I={labels:e.map((e=>A.default.capitalize(e.name))),datasets:[{data:e.map((e=>e.count)),backgroundColor:e.map(((e,g)=>{var I;return null!==(I=e.color)&&void 0!==I?I:b[g%b.length]})),borderColor:["white","white","white","white","white","white"],borderWidth:4,borderRadius:8}]};W(I);const C=e.map(((e,g)=>Object.assign({color:b[g%b.length]},e)));F(C)}G&&w(((e,g,I)=>({xAxis:{data:e.map((e=>e.name)),title:null!=g?g:""},yAxis:{data:e.map((e=>e.count)),title:null!=I?I:""},barColorRGBA:{r:210,g:174,b:255,a:1}}))(o,y,h))}),[o,X]),Y?g.jsxs(g.Fragment,{children:[g.jsxs("div",Object.assign({style:{display:"flex",justifyContent:B||0===(null==r?void 0:r.length)?"flex-end":"space-between"}},{children:[!B&&r&&g.jsx(l.TitleMedium,Object.assign({style:{marginBottom:16}},{children:r})),g.jsxs("div",{children:[G&&g.jsx(s.IconButton,{Icon:I.default,onClick:()=>{Z(!0)}}),u&&g.jsx(s.IconButton,{Icon:C.default,onClick:()=>{j(!0)}})]})]})),g.jsxs("div",Object.assign({className:"row"},{children:[g.jsx("div",Object.assign({className:"col-6"},{children:g.jsx("div",Object.assign({style:{width:n,height:n}},{children:g.jsx(d.Doughnut,{data:X?N:Y,options:Object.assign(Object.assign({},p),{maintainAspectRatio:!n})})}))})),g.jsx("div",Object.assign({className:"col-6",style:{paddingLeft:48,display:"flex",flexDirection:"column",justifyContent:"center"}},{children:g.jsx(c.PieChart,{slices:X?S:R})}))]})),m&&g.jsx(t.StyledModal,Object.assign({open:m,onClose:()=>j(!1),closeOnOutsideClick:!0,headingTitle:r,width:"75%"},{children:g.jsxs("div",Object.assign({style:{padding:24,display:"flex",justifyContent:"space-between",height:"80vh"}},{children:[g.jsx("div",Object.assign({style:{width:"55%",marginLeft:"4%"}},{children:g.jsx("div",Object.assign({style:{width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center"}},{children:g.jsx(d.Doughnut,{data:Y,options:Object.assign(Object.assign({},p),{maintainAspectRatio:!n})})}))})),g.jsx("div",Object.assign({style:{width:"30%",height:"100%",overflowY:"auto"}},{children:g.jsx(c.PieChart,{slices:R})}))]}))})),x&&V&&g.jsx(t.StyledModal,Object.assign({open:x,onClose:()=>Z(!1),closeOnOutsideClick:!0,headingTitle:r,width:"85%"},{children:g.jsx("div",Object.assign({style:{padding:"24px 0"}},{children:g.jsx(a.VerticalGraph,{xAxis:V.xAxis,yAxis:V.yAxis,barColorRGBA:null==V?void 0:V.barColorRGBA})}))}))]}):g.jsx(g.Fragment,{})};
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@emotion/styled/base"),g=require("react/jsx-runtime"),I=require("../../../../assets/icons/ChartBar.svg.js"),C=require("../../../../assets/icons/maximize.svg.js");require("@amplitude/analytics-browser"),require("../../../../amplitude/model.js");var A=require("../../../../utils/StringUtils.js"),r=require("../../../../constants/Theme.js");require("../../../../constants/zindex.js");var i=require("react");require("../../../checkBox/CheckBox.styled.js");var c=require("../../../TypographyStyle.js");require("../../../list-item/ListItem.js"),require("../../../pagination/Pagination.js"),require("../../../radioButton/RadioButton.styled.js"),require("react-dom"),require("react-toastify"),require("../../../button/Button.js"),require("../../../toaster/Toaster.styled.js"),require("../../../tooltips/Tooltip.js"),require("../../../spinner/Spinner.js"),require("../../../stepper/Stepper.styled.js"),require("../../../tag/Tag.js");var l=require("../../../icon-button/IconButton.js");require("../../../template-preview/TemplatePreview.js"),require("../../../template-preview/WhatsApp/WhatsAppLikePreview.js"),require("../../../template-preview/WhatsApp/WhatsAppLikePreviewV2.js"),require("../../../curtain/CurtainHelper.js"),require("../../../variable-picker-v3/model.js"),require("../../../template-preview/models/TemplateMeta.js"),require("../../../template-preview/models/WhatsAppTemplate.js"),require("../../../template-preview/models/Channels.js"),require("lodash");var t=require("../../../modals/styledModal.js");require("../../../template-context-mapper/context/templateModalContext.js"),require("../../../template-context-mapper/modalElements/Footer.js"),require("../../../template-context-mapper/styles/TemplateAnalyticsStyles.js"),require("../../../template-context-mapper/utils/TemplateConstants.js"),require("../../../shimmer/ShimmerComponent/ShimmerStyled.js"),require("../../../template-context-mapper/modalElements/Body.js"),require("../../../template-context-mapper/modalElements/Header.js"),require("../../../../_virtual/_tslib.js"),require("../../../zeroState/ZeroState.js"),require("../../../dropdown/OpenedDropdown/components/description/Description.styled.js"),require("../../../dropdown/OpenedDropdown/components/menu/FreeFormMenu.styled.js"),require("../../../dropdown/OpenedDropdown/components/menu/MenuItem.js"),require("../../../dropdown/OpenedDropdown/components/menu/MenuList.styled.js"),require("../../../dropdown/OpenedDropdown/components/multiSelect/MultiSelectDropdownBottomBar.styled.js"),require("../../../dropdown/OpenedDropdown/components/OpennedDropdown.styled.js"),require("../../../input/Input.js"),require("react-bootstrap"),require("../../../floating-action-button/FloatingActionButton.styles.js"),require("../../../image-compress/ImageCompress.js"),require("../../../progress-bar/ProgressBarComponent.js"),require("../../../progress-bar-v2/ProgressBarV2.js"),require("../../../QueryBuilder/QueryBuilder.js"),require("../../../QueryBuilder/components/QueryBuilderNode/Base/BaseQueryBuilderNode.js"),require("../../../QueryBuilder/constants/connectorPosition.js"),require("../../../QueryBuilder/constants/connector.js"),require("../../../QueryBuilder/types/QueryBuilder.type.js"),require("../../../dropdown/Dropdown.js"),require("../../../QueryBuilder/components/InputLoader.js"),require("../../../QueryBuilder/components/Connectors/Components/EmojiPicker.js"),require("react-chips"),require("../../../input/ChipInput.styled.js"),require("../../../QueryBuilder/components/Connectors/Components/FrequencyIntegerPositiveSingle.js"),require("../../../QueryBuilder/components/Connectors/Components/IgPicker.js"),require("../../../QueryBuilder/components/Connectors/Components/InTheLast.js"),require("../../../QueryBuilder/components/Connectors/Components/InTwoLast.js"),require("../../../datePicker/DatePickerWrapper.js"),require("../../../QueryBuilder/components/Connectors/Connector.styled.js"),require("../../../QueryBuilder/components/QueryBuilderNode/Property/PropertyNode.styled.js"),require("../../../QueryBuilder/components/QueryBuilderNode/Property/PropertyNodeUIWrapper.styled.js"),require("../../../QueryBuilder/redux/queryBuilder.reducer.js"),require("../../../QueryBuilder/redux/queryBuilderCache.reducer.js"),require("../../../QueryBuilder/types/QueryBuilderOperator.type.js"),require("../../../dropdown/DropdownPopover/index.js"),require("../../../dropdown/ChipDropdown.js"),require("../../../dropdown/MenuItem/MenuItem.js"),require("../../../analytics-card/AnalyticsCard.styled.js"),require("../../CommonStyles.js"),require("react-calendar"),require("../../../datePicker/DatePicker.styled.js"),require("../../AnalyticsMetric.js"),require("../../../../utils/DateUtils.js"),require("../utils/calcPercentage.js"),require("../LineChart/LineChart.js"),require("../linearChipGroupedChart/LinearChipGroupedChart.styled.js");var s=require("./PieChart.js");require("../HorizontalBarGraph/HorizontalGraph.js"),require("../StackedBarChart/StackedBarChart.js"),require("../StackedBarChart/StackedBarDistributionChart.js"),require("../StackedBarChart/StackedBarDistributionChart.model.js");var a=require("../VerticalBarGraph/VerticalGraph.js");require("../VerticalBarGraph/FunnelVerticalBarGraph.js"),require("../heatmap/HeatMap.js"),require("../heatmap/HeatMapVertical.js"),require("../VerticalBarAndLinearGraph/VerticalBarAndLinearGraph.js"),require("../../../avatar/Avatar.js"),require("../../../avatar/AvatarHelper.js"),require("../../../alerts/Alert.styled.js"),require("../../../alerts/AlertHelper.js"),require("../../../thumbnail/Thumbnail.js"),require("../../../curtain/Curtain.styled.js"),require("../../../switch/Switch.js"),require("../../../plans/SubscriptionPlanStyled.js"),require("../../../plans/SubscriptionPlanSelector.js"),require("../../../plans/SubscriptionPlansCollected.js"),require("../../../tabs/Tabs.js"),require("../../../TablePagination/TablePagination.styled.js"),require("../../../TablePagination/TablePaginationCard.js"),require("../../../states/StateComponent.js"),require("../../../WhatsAppTextEditor/WhatsAppTextEditor.js"),require("../../../WhatsAppTextEditor/WhatsAppTextEditorHeader.js"),require("../../../card-selection-modal/CardSelectionModal.styled.js"),require("react-image-crop"),require("../../../buttonGroup/ButtonGroupStyle.js"),require("../../../accordion/Accordion.style.js"),require("../../../accordion/AccordionArrow.js"),require("../../../file-uploader/FileUploaderStyle.js"),require("../../../colourInput/ColourInput.styled.js"),require("../../../bik-layout/CommonStyles.js"),require("../../../navigation-hyperlink/NavigationHyperlink.js"),require("../../../bik-layout/SidebarStyles.js"),require("date-fns"),require("react-popper"),require("../../../dropdown/Common.styled.js"),require("../../../custom-date-time/CustomDateTime.styled.js"),require("../../../../node_modules/lodash.debounce/index.js"),require("../../../product-picker/ProductPicker.styled.js"),require("../../../discount-modal/type.js"),require("../../../product-picker-v2/modal.js"),require("../../../modals/modal.styled.js"),require("../../../variable-picker-v3/NoResult.js"),require("../../../variable-picker-v3/styles.js"),require("../../../discount-modal/DiscountModal.styled.js"),require("../../../discount-modal/DynamicCoupon/DynamicCoupon.js"),require("../../../country-code-picker/CountryCodePicker.styled.js"),require("../../../carousel/carousel.js"),require("../../../carousel-secondary/CarouselSecondary.js"),require("../../../access-token-troubleshoot-dialog/AccessTokenTroubleshootDialog.styles.js"),require("../../../radioList/RadioList.styled.js"),require("../../../checkList/CheckList.styled.js"),require("../../../postPicker/postPicker.js"),require("../../../dropdown-button/DropdownButton.style.js"),require("../../../side-modal/SideModal.style.js"),require("../../../add-variableV2/AddVariableV2.styled.js"),require("../../../SearchFilter/types/SearchFilter.type.js"),require("../../../SearchFilter/components/DatePickerButton.js"),require("../../../SearchFilter/components/DateRangeOnlyButton.js"),require("../../../input-with-vars/InputWithVariables.js"),require("../../../star-rating/StarRating.js"),require("../../../dashboard-review-popup/components/FiveStar.styled.js"),require("../../../dashboard-review-popup/components/Form.styled.js"),require("../../../dashboard-review-popup/components/ZeroState.js"),require("../../../dashboard-review-popup/DashboardReviewPopUp.styled.js"),require("../../../testimonial-card/TestimonialCard.style.js"),require("../../../slider/slider.js"),require("react-slick"),require("../../../carousel-preview/CarouselPreview.style.js"),require("../../../card-selector/CardSelector.styled.js"),require("../../../action-button/ActionButton.styled.js"),require("../../../floating-input-dropdown/FloatingInputDropdown.js"),require("../../../dropdown/MultilevelDropdownPopover/index.js"),require("../../../multi-level-dropdown/MultiLevelDropdown.styled.js");var d=require("chart.js"),o=require("react-chartjs-2");function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var u=n(e);d.Chart.register(d.ArcElement,d.Legend);const p=e=>({plugins:{legend:{display:!1},tooltip:{enabled:!0,callbacks:{label:g=>{if(!g.label)return" 0%";const I=g.dataset.data.reduce(((e,g)=>e+g),0),C=parseFloat((g.raw/I*100).toFixed(1));return[` ${g.label}`,` ${null!=e?e:""}${g.raw} (${C}% of ${I})`]}}}}}),b=["#5E07BB","#9E77ED","#D2AEFF","#CDE1FF","#92AFFA","#3935E1"],G=u.default("div","production"===process.env.NODE_ENV?{target:"elaov7f0"}:{target:"elaov7f0",label:"CartStyled"})("background:",(e=>r.COLORS.surface.standard),";border:1px solid ",(e=>r.COLORS.stroke.primary),";border-radius:4px;"+("production"===process.env.NODE_ENV?"":"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIlBpZUNoYXJ0QW5hbHl0aWNzLnRzeCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFnRThCIiwiZmlsZSI6IlBpZUNoYXJ0QW5hbHl0aWNzLnRzeCIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IGpzeCBhcyBfanN4LCBGcmFnbWVudCBhcyBfRnJhZ21lbnQsIGpzeHMgYXMgX2pzeHMgfSBmcm9tIFwicmVhY3QvanN4LXJ1bnRpbWVcIjtcclxuaW1wb3J0IHN0eWxlZCBmcm9tICdAZW1vdGlvbi9zdHlsZWQnO1xyXG5pbXBvcnQgQmFyQ2hhcnRJY29uIGZyb20gJ0BzcmMvYXNzZXRzL2ljb25zL0NoYXJ0QmFyLnN2Zyc7XHJcbmltcG9ydCBNYXhpbWl6ZUljb24gZnJvbSAnQHNyYy9hc3NldHMvaWNvbnMvbWF4aW1pemUuc3ZnJztcclxuaW1wb3J0IHsgU3RyaW5nVXRpbHMgfSBmcm9tIFwiLi4vLi4vLi4vLi4vaW5k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0aXRsZTogeEF4aXNUaXRsZSAhPT0gbnVsbCAmJiB4QXhpc1RpdGxlICE9PSB2b2lkIDAgPyB4QXhpc1RpdGxlIDogJycsXHJcbiAgICB9O1xyXG4gICAgY29uc3QgeUF4aXMgPSB7XHJcbiAgICAgICAgZGF0YTogeUF4aXNEYXRhLFxyXG4gICAgICAgIHRpdGxlOiB5QXhpc1RpdGxlICE9PSBudWxsICYmIHlBeGlzVGl0bGUgIT09IHZvaWQgMCA/IHlBeGlzVGl0bGUgOiAnJyxcclxuICAgIH07XHJcbiAgICBjb25zdCBiYXJDaGFydERhdGEgPSB7XHJcbiAgICAgICAgeEF4aXMsXHJcbiAgICAgICAgeUF4aXMsXHJcbiAgICAgICAgYmFyQ29sb3JSR0JBOiB7IHI6IDIxMCwgZzogMTc0LCBiOiAyNTUsIGE6IDEgfSxcclxuICAgIH07XHJcbiAgICByZXR1cm4gYmFyQ2hhcnREYXRhO1xyXG59O1xyXG5jb25zdCBvcHRpb25zID0gKHByZWZpeCkgPT4gKHtcclxuICAgIHBsdWdpbnM6IHtcclxuICAgICAgICBsZWdlbmQ6IHtcclxuICAgICAgICAgICAgZGlzcGxheTogZmFsc2UsXHJcbiAgICAgICAgfSxcclxuICAgICAgICB0b29sdGlwOiB7XHJcbiAgICAgICAgICAgIGVuYWJsZWQ6IHRydWUsXHJcbiAgICAgICAgICAgIGNhbGxiYWNrczoge1xyXG4gICAgICAgICAgICAgICAgbGFiZWw6ICh0b29sdGlwSXRlbSkgPT4ge1xyXG4gICAgICAgICAgICAgICAgICAgIGlmICghdG9vbHRpcEl0ZW0ubGFiZWwpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGAgMCVgO1xyXG4gICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICBjb25zdCB0b3RhbCA9IHRvb2x0aXBJdGVtLmRhdGFzZXQuZGF0YS5yZWR1Y2UoKGFjYywgY3VyKSA9PiBhY2MgKyBjdXIsIDAp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vciA9IFtdO1xyXG4gICAgICAgIHVwZGF0ZWRTbGljZXNXaXRoQ29sb3IgPSBPYmplY3Qua2V5cyhzbGljZXMpLm1hcCgoa2V5LCBpbmRleCkgPT4gKE9iamVjdC5hc3NpZ24oeyBjb2xvcjogR1JBUEhfQ09MT1JTW2luZGV4ICUgR1JBUEhfQ09MT1JTLmxlbmd0aF0gfSwgc2xpY2VzW2tleV0pKSk7XHJcbiAgICAgICAgc2V0U2xpY2VzV2l0aENvbG9yKFsuLi51cGRhdGVkU2xpY2VzV2l0aENvbG9yXSk7XHJcbiAgICAgICAgaWYgKHRvdGFsU3VtID09PSAwKSB7XHJcbiAgICAgICAgICAgIGNvbnN0IGRhdGFTZXQgPSB7XHJcbiAgICAgICAgICAgICAgICBkYXRhc2V0czogW1xyXG4gICAgICAgICAgICAgICAgICAgIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgZGF0YTogWzEwMF0sXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGJhY2tncm91bmRDb2xvcjogWycjRjBGMEYwJ10sXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGJvcmRlcldpZHRoOiAwLFxyXG4gICAgICAgICAgICAgICAgICAgIH0sXHJcbiAgICAgICAgICAgICAgICBdLFxyXG4gICAgICAgICAgICAgICAgbGFiZWxzOiBbXSwgLy8gZml4IGZvciAwIHN0YXRlXHJcbiAgICAgICAgICAgIH07XHJcbiAgICAgICAgICAgIHNldERhdGEoZGF0YVNldCk7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGVsc2Uge1xyXG4gICAgICAgICAgICBjb25zdCBkYXRhU2V0ID0ge1xyXG4gICAgICAgICAgICAgICAgbGFiZWxzOiBzbGljZXMubWFwKChzbGljZSkgPT4gU3RyaW5nVXRpbHMuY2FwaXRhbGl6ZUVhY2hXb3JkKHNsaWNlLm5hbWUpKSxcclxuICAgICAgICAgICAgICAgIGRhdGFzZXRzOiBbXHJcbiAgICAgICAgICAgICAgICAgICAge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBkYXRhOiBzbGljZXMubWFwKChzbGljZSkgPT4gc2xpY2UuY291bnQpLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICBiYWNrZ3JvdW5kQ29sb3I6IHNsaWNlcy5tYXAoKHNsaWNlLCBpbmRleCkgPT4geyB2YXIgX2E7IHJldHVybiAoX2EgPSBzbGljZS5jb2xvcikgIT09IG51bGwgJiYgX2EgIT09IHZvaWQgMCA/IF9hIDogR1JBUEhfQ09MT1JTW2luZGV4ICUgR1JBUEhfQ09MT1JTLmxlbmd0aF07IH0pLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICBib3JkZXJDb2xvcjogWyd3aGl0ZScsICd3aGl0ZScsICd3aGl0ZScsICd3aGl0ZScsICd3aGl0ZScsICd3aGl0ZSddLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICBib3JkZXJXaWR0aDogNCxcclxuICAgICAgICAgICAgICAgICAgICAgICAgYm9yZGVyUmFkaXVzOiA4LFxyXG4gICAgICAgICAgICAgICAgICAgIH0sXHJcbiAgICAgICAgICAgICAgICBdLFxyXG4gICAgICAgICAgICB9O1xyXG4gICAgICAgICAgICBzZXREYXRhKGRhdGFTZXQpO1xyXG4gICAgICAgIH1cclxuICAgICAgICBpZiAodHJ1bmNhdGVTbGljZXMgJiYgc2xpY2VzLmxlbmd0aCA+IHRydW5jYXRlU2xpY2VzKSB7XHJcbiAgICAgICAgICAgIGNvbnN0IHRydW5jYXRlZFNsaWNlcyA9IHNsaWNlcy5zbGljZSgwLCB0cnVuY2F0ZVNsaWNlcyk7XHJcbiAgICAgICAgICAgIGNvbnN0IG90aGVyU2xpY2VzID0gc2xpY2VzLnNsaWNlKHRydW5jYXRlU2xpY2VzKTtcclxuICAgICAgICAgICAgY29uc3Qgb3RoZXJDb3VudCA9IG90aGVyU2xpY2VzLnJlZHVjZSgoc3VtLCBzbGljZSkgPT4gc3VtICsgc2xpY2UuY291bnQsIDApO1xyXG4gICAgICAgICAgICB0cnVuY2F0ZWRTbGljZXMucHVzaCh7IG5hbWU6ICdPdGhlcicsIGNvdW50OiBvdGhlckNvdW50IH0pO1xyXG4gICAgICAgICAgICBjb25zdCB0cnVuY2F0ZWREYXRhU2V0ID0ge1xyXG4gICAgICAgICAgICAgICAgbGFiZWxzOiB0cnVuY2F0ZWRTbGljZXMubWFwKChzbGljZSkgPT4gU3RyaW5nVXRpbHMuY2FwaXRhbGl6ZShzbGljZS5uYW1lKSksXHJcbiAgICAgICAgICAgICAgICBkYXRhc2V0czogW1xyXG4gICAgICAgICAgICAgICAgICAgIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgZGF0YTogdHJ1bmNhdGVkU2xpY2VzLm1hcCgoc2xpY2UpID0+IHNsaWNlLmNvdW50KSxcclxuICAgICAgICAgICAgICAgICAgICAgICAgYmFja2dyb3VuZENvbG9yOiB0cnVuY2F0ZWRTbGljZXMubWFwKChzbGljZSwgaW5kZXgpID0+IHsgdmFyIF9hOyByZXR1cm4gKF9hID0gc2xpY2UuY29sb3IpICE9PSBudWxsICYmIF9hICE9PSB2b2lkIDAgPyBfYSA6IEdSQVBIX0NPTE9SU1tpbmRleCAlIEdSQVBIX0NPTE9SUy5sZW5ndGhdOyB9KSxcclxuICAgICAgICAgICAgICAgICAgICAgICAgYm9yZGVyQ29sb3I6IFsnd2hpdGUnLCAnd2hpdGUnLCAnd2hpdGUnLCAnd2hpdGUnLCAnd2hpdGUnLCAnd2hpdGUnXSxcclxuICAgICAgICAgICAgICAgICAgICAgICAgYm9yZGVyV2lkdGg6IDQsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGJvcmRlclJhZGl1czogOCxcclxuICAgICAgICAgICAgICAgICAgICB9LFxyXG4gICAgICAgICAgICAgICAgXSxcclxuICAgICAgICAgICAgfTtcclxuICAgICAgICAgICAgc2V0VHJ1bmNhdGVkRGF0YSh0cnVuY2F0ZWREYXRhU2V0KTtcclxuICAgICAgICAgICAgY29uc3QgdHJ1bmNhdGVk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ZGl1bSwgT2JqZWN0LmFzc2lnbih7IHN0eWxlOiB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBtYXJnaW5Cb3R0b206IDE2LFxyXG4gICAgICAgICAgICAgICAgICAgICAgICB9IH0sIHsgY2hpbGRyZW46IHRpdGxlIH0pKSksIF9qc3hzKFwiZGl2XCIsIHsgY2hpbGRyZW46IFtzaG93Q29udmVydFRvQmFyQ2hhcnQgJiYgKF9qc3goSWNvbkJ1dHRvbiwgeyBJY29uOiBCYXJDaGFydEljb24sIG9uQ2xpY2s6ICgpID0+IHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2V0U2hvd0JhckNoYXJ0KHRydWUpO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gfSkpLCBhbGxvd0NoYXJ0UG9wdXAgJiYgKF9qc3goSWNvbkJ1dHRvbiwgeyBJY29uOiBNYXhpbWl6ZUljb24sIG9uQ2xpY2s6ICgpID0+IHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2V0U2hvd1BvcHVwKHRydWUpO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gfSkpXSB9KV0gfSkpLCBfanN4cyhcImRpdlwiLCBPYmplY3QuYXNzaWduKHsgY2xhc3NOYW1lOiAncm93JyB9LCB7IGNoaWxkcmVuOiBbX2pzeChcImRpdlwiLCBPYmplY3QuYXNzaWduKHsgY2xhc3NOYW1lOiAnY29sLTYnIH0sIHsgY2hpbGRyZW46IF9qc3goXCJkaXZcIiwgT2JqZWN0LmFzc2lnbih7IHN0eWxlOiB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd2lkdGg6IHNpemUsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGVpZ2h0OiBzaXplLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSB9LCB7IGNoaWxkcmVuOiBfanN4KERvdWdobnV0LCB7IGRhdGE6ICh0cnVuY2F0ZVNsaWNlcyA/IHRydW5jYXRlZERhdGEgOiBkYXRhKSwgb3B0aW9uczogT2JqZWN0LmFzc2lnbihPYmplY3QuYXNzaWduKHt9LCBvcHRpb25zKHByZWZpeCkpLCB7IG1haW50YWluQXNwZWN0UmF0aW86IHNpemUgPyBmYWxzZSA6IHRydWUgfSkgfSkgfSkpIH0pKSwgX2pzeChcImRpdlwiLCBPYmplY3QuYXNzaWduKHsgY2xhc3NOYW1lOiAnY29sLTYnLCBzdHlsZToge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFkZGluZ0xlZnQ6IDQ4LFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZGlzcGxheTogJ2ZsZXgnLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZmxleERpcmVjdGlvbjogJ2NvbHVtbicsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBqdXN0aWZ5Q29udGVudDogc2xpY2VzLnJlZHVjZSgoc3VtLCBzbGljZSkgPT4gc3VtICsgc2xpY2UuY291bnQsIDApID09PSAwICYmXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2xpY2VzLmxlbmd0aCA9PT0gMVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gJ2NlbnRlcidcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6ICdmbGV4LXN0YXJ0JyxcclxuICAgICAgICAgICAgICAgICAgICAgICAgfSB9LCB7IGNoaWxkcmVuOiBfanN4KFBpZUNoYXJ0LCB7IHNsaWNlczogdHJ1bmNhdGVTbGljZXMgPyB0cnVuY2F0ZWRTbGljZXNXaXRoQ29sb3IgOiBzbGljZXNXaXRoQ29sb3IsIHNpemU6IHNpemUgfSkgfSkpXSB9KSksIHNob3dQb3B1cCAmJiAoX2pzeChTdHlsZWRNb2RhbCwgT2JqZWN0LmFzc2lnbih7IG9wZW46IHNob3dQb3B1cCwgb25DbG9zZTogKCkgPT4gc2V0U2hvd1BvcHVwKGZhbHNlKSwgY2xvc2VPbk91dHNpZGVDbGljazogdHJ1ZSwgaGVhZGluZ1RpdGxlOiB0aXRsZSwgd2lkdGg6IFwiNzUlXCIgfSwgeyBjaGlsZHJlbjogX2pzeHMoXCJkaXZcIiwgT2JqZWN0LmFzc2lnbih7IHN0eWxlOiB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHBhZGRpbmc6IDI0LFxyXG4gICAgICAgICAgICAgICAgICAgICAgICBkaXNwbGF5OiAnZmxleCcsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGp1c3RpZnlDb250ZW50OiAnc3BhY2UtYmV0d2VlbicsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGhlaWdodDogJzgwdmgnLFxyXG4gICAgICAgICAgICAgICAgICAgIH0gfSwgeyBjaGlsZHJlbjogW19qc3goXCJkaXZcIiwgT2JqZWN0LmFzc2lnbih7IHN0eWxlOiB7IHdpZHRoOiAnNTUlJywgbWFyZ2luTGVmdDogJzQlJyB9IH0sIHsgY2hpbGRyZW46IF9qc3goXCJkaXZcIiwgT2JqZWN0LmFzc2lnbih7IHN0eWxlOiB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdpZHRoOiAnMTAwJScsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhlaWdodDogJzEwMCUnLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkaXNwbGF5OiAnZmxleCcsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFsaWduSXRlbXM6ICdjZW50ZXInLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqdXN0aWZ5Q29udGVudDogJ2NlbnRlcicsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSB9LCB7IGNoaWxkcmVuOiBfanN4KERvdWdobnV0LCB7IG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vbG9yUkdCQTogYmFyQ2hhcnREYXRhID09PSBudWxsIHx8IGJhckNoYXJ0RGF0YSA9PT0gdm9pZCAwID8gdm9pZCAwIDogYmFyQ2hhcnREYXRhLmJhckNvbG9yUkdCQSB9KSB9KSkgfSkpKV0gfSkpO1xyXG59O1xyXG4vLyMgc291cmNlTWFwcGluZ1VSTD1QaWVDaGFydEFuYWx5dGljcy5qcy5tYXAiXX0= */"));exports.Card=e=>g.jsx(G,Object.assign({style:{padding:24}},{children:e.children})),exports.PieChartAnalytics=e=>{let{title:r,slices:d,size:n,allowChartPopup:u,showConvertToBarChart:G,truncateSlices:h,barChartXAxisTitle:y,barChartYAxisTitle:X,hideTitle:m=!1,prefix:x}=e;const[B,j]=i.useState(!1),[Z,H]=i.useState(!1),[N,W]=i.useState([]),[R,Y]=i.useState(),[J,F]=i.useState(),[S,V]=i.useState([]),[w,v]=i.useState(null);return i.useEffect((()=>{const e=d.reduce(((e,g)=>e+g.count),0);let g=[];if(g=Object.keys(d).map(((e,g)=>Object.assign({color:b[g%b.length]},d[e]))),W([...g]),0===e){Y({datasets:[{data:[100],backgroundColor:["#F0F0F0"],borderWidth:0}],labels:[]})}else{const e={labels:d.map((e=>A.default.capitalizeEachWord(e.name))),datasets:[{data:d.map((e=>e.count)),backgroundColor:d.map(((e,g)=>{var I;return null!==(I=e.color)&&void 0!==I?I:b[g%b.length]})),borderColor:["white","white","white","white","white","white"],borderWidth:4,borderRadius:8}]};Y(e)}if(h&&d.length>h){const e=d.slice(0,h),g=d.slice(h).reduce(((e,g)=>e+g.count),0);e.push({name:"Other",count:g});const I={labels:e.map((e=>A.default.capitalize(e.name))),datasets:[{data:e.map((e=>e.count)),backgroundColor:e.map(((e,g)=>{var I;return null!==(I=e.color)&&void 0!==I?I:b[g%b.length]})),borderColor:["white","white","white","white","white","white"],borderWidth:4,borderRadius:8}]};F(I);const C=e.map(((e,g)=>Object.assign({color:b[g%b.length]},e)));V(C)}G&&v(((e,g,I)=>({xAxis:{data:e.map((e=>e.name)),title:null!=g?g:""},yAxis:{data:e.map((e=>e.count)),title:null!=I?I:""},barColorRGBA:{r:210,g:174,b:255,a:1}}))(d,y,X))}),[d,h]),R?g.jsxs(g.Fragment,{children:[g.jsxs("div",Object.assign({style:{display:"flex",justifyContent:m||0===(null==r?void 0:r.length)?"flex-end":"space-between"}},{children:[!m&&r&&g.jsx(c.TitleMedium,Object.assign({style:{marginBottom:16}},{children:r})),g.jsxs("div",{children:[G&&g.jsx(l.IconButton,{Icon:I.default,onClick:()=>{H(!0)}}),u&&g.jsx(l.IconButton,{Icon:C.default,onClick:()=>{j(!0)}})]})]})),g.jsxs("div",Object.assign({className:"row"},{children:[g.jsx("div",Object.assign({className:"col-6"},{children:g.jsx("div",Object.assign({style:{width:n,height:n}},{children:g.jsx(o.Doughnut,{data:h?J:R,options:Object.assign(Object.assign({},p(x)),{maintainAspectRatio:!n})})}))})),g.jsx("div",Object.assign({className:"col-6",style:{paddingLeft:48,display:"flex",flexDirection:"column",justifyContent:0===d.reduce(((e,g)=>e+g.count),0)&&1===d.length?"center":"flex-start"}},{children:g.jsx(s.PieChart,{slices:h?S:N,size:n})}))]})),B&&g.jsx(t.StyledModal,Object.assign({open:B,onClose:()=>j(!1),closeOnOutsideClick:!0,headingTitle:r,width:"75%"},{children:g.jsxs("div",Object.assign({style:{padding:24,display:"flex",justifyContent:"space-between",height:"80vh"}},{children:[g.jsx("div",Object.assign({style:{width:"55%",marginLeft:"4%"}},{children:g.jsx("div",Object.assign({style:{width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center"}},{children:g.jsx(o.Doughnut,{data:R,options:Object.assign(Object.assign({},p(x)),{maintainAspectRatio:!n})})}))})),g.jsx("div",Object.assign({style:{width:"30%",height:"100%",overflowY:"auto"}},{children:g.jsx(s.PieChart,{slices:N})}))]}))})),Z&&w&&g.jsx(t.StyledModal,Object.assign({open:Z,onClose:()=>H(!1),closeOnOutsideClick:!0,headingTitle:r,width:"85%"},{children:g.jsx("div",Object.assign({style:{padding:"24px 0"}},{children:g.jsx(a.VerticalGraph,{xAxis:w.xAxis,yAxis:w.yAxis,barColorRGBA:null==w?void 0:w.barColorRGBA})}))}))]}):g.jsx(g.Fragment,{})};
|
|
@@ -2,6 +2,7 @@ export interface PieChartInput {
|
|
|
2
2
|
name: string;
|
|
3
3
|
count: number;
|
|
4
4
|
color?: string;
|
|
5
|
+
rawValue?: string;
|
|
5
6
|
}
|
|
6
7
|
export interface PieChartInputData {
|
|
7
8
|
slices: PieChartInput[];
|
|
@@ -13,4 +14,5 @@ export interface PieChartInputData {
|
|
|
13
14
|
barChartXAxisTitle?: string;
|
|
14
15
|
barChartYAxisTitle?: string;
|
|
15
16
|
hideTitle?: boolean;
|
|
17
|
+
prefix?: string;
|
|
16
18
|
}
|
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("react/jsx-runtime"),t=require("../../../../assets/icons/maximize.svg.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("../../../../assets/icons/maximize.svg.js"),a=require("chart.js"),o=require("chartjs-plugin-datalabels"),i=require("react"),n=require("react-chartjs-2"),l=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"),O=require("./StackedBarChart.styles.js");function p(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var g=p(o);a.Chart.register(a.CategoryScale,a.LinearScale,a.BarElement,a.Tooltip,a.Legend,g.default);exports.StackedBarChart=a=>{var o,p,g,v,x,A,h,y,b,T,R,C,I,N,S,f,j,m,H,L,E,k,F,P,_,B,G,D,w,Z,z,q,V,M,W,Y;const[J,K]=i.useState(!1),Q=[250,1e3,800,1500,300,600],U=0===a.yAxis.data.length,X=void 0===a.customColourScaleBrand||void 0===a.customColourScalePastel?a.colorSchema===u.COLOR_SCHEMA.PASTEL?["#E6C7FF","#FEC6C6","#FEDEF3","#DEEFFF","#FFD8B1","#C7E5FF","#FFD3E6","#C9FFE5","#FFE3C7","#D9D9FF"]:["#5E07BB","#9E77ED","#D2AEFF","#F7D7FF","#CDE1FF","#92AFFA","#3935E1"]:a.colorSchema===u.COLOR_SCHEMA.PASTEL?a.customColourScalePastel:a.customColourScaleBrand,$=a.customHoverColour,ee={barPercentage:.4,categoryPercentage:1,pointStyle:"circle",barWidth:a.barWidth},te={};a.yAxis.data.map((e=>{e.map((e=>{te[e.name]?te[e.name].push(e.value):te[e.name]=[e.value]}))}));const ae=Object.keys(te).map(((e,t)=>Object.assign({label:e,data:te[e],backgroundColor:X[t],hoverBackgroundColor:void 0===$?void 0:$[t]},ee)));let oe=a.xAxis.data.map((e=>"string"==typeof e?e:e.name)),ie=ae;if(a.truncateBars){const e=((e,t,a)=>{if(t.length<=a)return{truncatedData:e,truncatedLabels:t,originalData:e,originalLabels:t};const o=e.map((e=>e.slice(0,a))),i=e.map((e=>e.slice(a).reduce(((e,t)=>e+t),0)));o.forEach(((e,t)=>e.push(i[t])));const n=t.slice(0,a);return n.push("Others"),{truncatedData:o,truncatedLabels:n,originalData:e,originalLabels:t}})(ae.map((e=>e.data)),oe,a.truncateBars);ae.forEach(((t,a)=>t.data=e.truncatedData[a])),oe=e.truncatedLabels,ie=e.originalData.map(((e,t)=>Object.assign(Object.assign({},ae[t]),{data:e})))}const ne={plugins:{legend:{display:!U&&!a.customLegend,labels:{usePointStyle:!0,fontSize:2}},tooltip:{enabled:!U,callbacks:{label:null===(o=a.tooltipConfig)||void 0===o?void 0:o.labelCallback,footer:null===(p=a.tooltipConfig)||void 0===p?void 0:p.footerCallback},footerFont:null===(v=null===(g=a.tooltipConfig)||void 0===g?void 0:g.footerStyles)||void 0===v?void 0:v.footerFont},datalabels:{display:null!==(x=a.showTotal)&&void 0!==x&&x,anchor:"end",align:"end",clamp:!0,formatter:(e,t)=>{var a;const o=t.datasetIndex,i=t.chart.data.datasets;if(o!==i.length-1)return"";const n=t.dataIndex;let l=0;for(let e=0;e<i.length;e++)l+=null!==(a=i[e].data[n])&&void 0!==a?a:0;return l?l<1e3?l:(l/1e3).toString().substring(0,4)+"k":""},color:d.COLORS.content.secondary}},layout:{padding:{right:a.showTotal&&a.orientation===u.GRAPH_ORIENTATION.HORIZONTAL?50:0,top:a.showTotal&&a.orientation!=u.GRAPH_ORIENTATION.HORIZONTAL?50:0}},responsive:!0,maintainAspectRatio:!1,legend:{display:!a.customLegend,labels:{usePointStyle:!0}},indexAxis:a.orientation===u.GRAPH_ORIENTATION.HORIZONTAL?"y":"x",scales:{x:{title:{display:!!(a.orientation===u.GRAPH_ORIENTATION.HORIZONTAL?null===(A=a.yAxis)||void 0===A?void 0:A.title:null===(h=a.xAxis)||void 0===h?void 0:h.title),text:a.orientation===u.GRAPH_ORIENTATION.HORIZONTAL?null===(y=a.yAxis)||void 0===y?void 0:y.title:null===(b=a.xAxis)||void 0===b?void 0:b.title,color:null!==(C=a.orientation===u.GRAPH_ORIENTATION.HORIZONTAL?null===(T=a.yAxis)||void 0===T?void 0:T.titleColor:null===(R=a.xAxis)||void 0===R?void 0:R.titleColor)&&void 0!==C?C:d.COLORS.content.secondary,font:{size:d.FONTS.caption.fontSize}},grid:{display:a.orientation===u.GRAPH_ORIENTATION.HORIZONTAL,color:d.COLORS.background.base},ticks:{fontSize:d.FONTS.caption.fontSize,color:null!==(I=a.yAxis.labelColor)&&void 0!==I?I:d.COLORS.content.secondary,callback:a.orientation===u.GRAPH_ORIENTATION.HORIZONTAL?a.isInternationalStore?c.truncateValueForInternationalStore:c.truncateValueForIndianStore:void 0},stacked:a.orientation===u.GRAPH_ORIENTATION.HORIZONTAL?"boolean"!=typeof(null===(N=a.yAxis)||void 0===N?void 0:N.stacked)||(null===(S=a.yAxis)||void 0===S?void 0:S.stacked):"boolean"!=typeof(null===(f=a.xAxis)||void 0===f?void 0:f.stacked)||(null===(j=a.xAxis)||void 0===j?void 0:j.stacked)},y:{title:{display:!!(a.orientation===u.GRAPH_ORIENTATION.HORIZONTAL?null===(m=a.xAxis)||void 0===m?void 0:m.title:null===(H=a.yAxis)||void 0===H?void 0:H.title),text:a.orientation===u.GRAPH_ORIENTATION.HORIZONTAL?null===(L=a.xAxis)||void 0===L?void 0:L.title:null===(E=a.yAxis)||void 0===E?void 0:E.title,color:null!==(P=a.orientation===u.GRAPH_ORIENTATION.HORIZONTAL?null===(k=a.xAxis)||void 0===k?void 0:k.titleColor:null===(F=a.yAxis)||void 0===F?void 0:F.titleColor)&&void 0!==P?P:d.COLORS.content.secondary,font:{size:d.FONTS.caption.fontSize}},grid:{display:a.orientation!==u.GRAPH_ORIENTATION.HORIZONTAL,color:d.COLORS.background.base},ticks:Object.assign(Object.assign({stepSize:a.orientation===u.GRAPH_ORIENTATION.HORIZONTAL?null===(_=a.xAxis)||void 0===_?void 0:_.stepSize:null===(B=a.yAxis)||void 0===B?void 0:B.stepSize,fontSize:d.FONTS.caption.fontSize,color:null!==(G=a.xAxis.labelColor)&&void 0!==G?G:d.COLORS.content.secondary},U?{min:0,max:2e3,stepSize:200}:{}),{callback:a.orientation!==u.GRAPH_ORIENTATION.VERTICAL?a.isInternationalStore?c.truncateValueForInternationalStore:c.truncateValueForIndianStore:void 0}),stacked:a.orientation===u.GRAPH_ORIENTATION.HORIZONTAL?"boolean"!=typeof(null===(D=a.xAxis)||void 0===D?void 0:D.stacked)||(null===(w=a.xAxis)||void 0===w?void 0:w.stacked):"boolean"!=typeof(null===(Z=a.yAxis)||void 0===Z?void 0:Z.stacked)||(null===(z=a.yAxis)||void 0===z?void 0:z.stacked)}},onClick:(e,t)=>{if(!a.onBarClick)return;const o=t[0].datasetIndex,i=t[0].index,n=e.chart.data.datasets[o].label,l=e.chart.data.labels[i];a.onBarClick(l,n)},onHover:(e,t)=>{a.onBarClick&&t.length&&(e.native.target.style.cursor="pointer")}};a.orientation&&a.orientation!==u.GRAPH_ORIENTATION.VERTICAL?delete ne.scales.y.ticks.callback:delete ne.scales.x.ticks.callback;const le={labels:oe,datasets:U?[{data:Q,backgroundColor:"rgba(0,0,0,0)"}]:ae},se={labels:a.xAxis.data.map((e=>"string"==typeof e?e:e.name)),datasets:U?[{data:Q,backgroundColor:"rgba(0,0,0,0)"}]:ie},re=function(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return e.jsx("div",Object.assign({style:{overflowY:"scroll",display:"flex",flexDirection:"row",gap:"10px",padding:"0px 24px 12px 24px",justifyContent:a.allowChartPopup&&!t?"flex-start":"flex-end"}},{children:ae.map((t=>e.jsxs("div",Object.assign({style:{display:"flex",alignItems:"center",gap:"8px",marginTop:"4px"}},{children:[e.jsx("div",{style:{backgroundColor:t.backgroundColor,width:"16px",height:"16px",borderRadius:"2px"}}),e.jsx(r.BodyTiny,Object.assign({color:d.COLORS.content.secondary},{children:t.label}))]}),t.label.replace(" ","_"))))}))};return e.jsxs(O.GraphContainerWrapper,Object.assign({style:null!==(q=a.wrapperStyle)&&void 0!==q?q:{},padding:a.outerPadding,customLegend:a.customLegend},{children:[a.chartHeading&&e.jsxs("div",Object.assign({style:{marginBottom:24,display:"flex",justifyContent:a.hideHeading?"flex-end":"space-between"}},{children:[!0!==a.hideHeading&&e.jsx(r.TitleRegular,Object.assign({color:null!==(V=a.chartHeading.color)&&void 0!==V?V:d.COLORS.content.secondary},{children:a.chartHeading.heading})),a.allowChartPopup&&e.jsx("div",Object.assign({style:{display:"flex",justifyContent:"flex-end"}},{children:e.jsx("div",{children:e.jsx(l.IconButton,{Icon:t.default,onClick:()=>{K(!0)}})})}))]})),a.customLegend&&re(),e.jsx("div",Object.assign({className:"graph__wrapper"},{children:e.jsx("div",Object.assign({style:{height:null!==(M=a.graphCanvasHeight)&&void 0!==M?M:500,width:null!==(W=a.graphCanvasWidth)&&void 0!==W?W:"auto"}},{children:e.jsx(n.Bar,{options:ne,data:le})}))})),J&&e.jsx(s.StyledModal,Object.assign({open:J,onClose:()=>K(!1),closeOnOutsideClick:!0,headingTitle:null===(Y=a.chartHeading)||void 0===Y?void 0:Y.heading,width:"85%"},{children:e.jsxs("div",Object.assign({className:"graph__wrapper",style:{padding:"8px"}},{children:[a.customLegend&&re(!0),e.jsx("div",Object.assign({style:{height:"70vh",width:"100%",padding:"16px",borderRadius:"8px"}},{children:e.jsx(n.Bar,{options:ne,data:se})}))]}))}))]}))};
|
|
@@ -62,24 +62,4 @@ export interface StackedBarGraphI {
|
|
|
62
62
|
truncateBars?: number;
|
|
63
63
|
allowChartPopup?: boolean;
|
|
64
64
|
hideHeading?: boolean;
|
|
65
|
-
borderRadius?: number | {
|
|
66
|
-
topLeft?: number;
|
|
67
|
-
topRight?: number;
|
|
68
|
-
bottomLeft?: number;
|
|
69
|
-
bottomRight?: number;
|
|
70
|
-
};
|
|
71
|
-
showGridLines?: {
|
|
72
|
-
x?: boolean;
|
|
73
|
-
y?: boolean;
|
|
74
|
-
};
|
|
75
|
-
equalHeight?: {
|
|
76
|
-
flag: boolean;
|
|
77
|
-
max: number;
|
|
78
|
-
};
|
|
79
|
-
barPercentage?: number;
|
|
80
|
-
addBarGap?: {
|
|
81
|
-
flag: boolean;
|
|
82
|
-
value: number;
|
|
83
|
-
};
|
|
84
|
-
ticksCallback?: (value: number) => string;
|
|
85
65
|
}
|
package/dist/cjs/components/analytics-chips-and-dropdowns/chart/VerticalBarGraph/VerticalGraph.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("react/jsx-runtime"),e=require("../../../../assets/icons/ChartBar.svg.js"),i=require("../../../../assets/icons/ChartPie.svg.js"),o=require("../../../../assets/icons/maximize.svg.js"),a=require("chart.js"),l=require("react"),s=require("react-chartjs-2"),n=require("../Pie/PieChartAnalytics.js"),r=require("../../../icon-button/IconButton.js"),d=require("../../../modals/styledModal.js"),c=require("../../../TypographyStyle.js"),p=require("../../../../constants/Theme.js"),u=require("./VerticalGraph.styles.js");a.Chart.register(a.CategoryScale,a.LinearScale,a.BarElement,a.Tooltip);exports.VerticalGraph=a=>{var x,g,v,b,h,y,C,S,A,f,j,O,k,m,z,$,D,T,R,q,P,B,F;const[L,I]=l.useState(!1),[N,w]=l.useState(!1),[E,H]=l.useState();l.useEffect((()=>{var t;const e=[];N&&(null===(t=a.popupData)||void 0===t||t.xAxis.data.forEach(((t,i)=>{var o;e.push({name:t.toString(),count:Number(null===(o=a.popupData)||void 0===o?void 0:o.yAxis.data[i])||0})})),H(e))}),[N,null===(x=a.popupData)||void 0===x?void 0:x.xAxis.data,null===(g=a.popupData)||void 0===g?void 0:g.yAxis.data]);const G=[250,1e3,800,1500,300,600],M=-1===a.yAxis.data.findIndex((t=>0!==t)),V=-1===(null===(v=a.popupData)||void 0===v?void 0:v.yAxis.data.findIndex((t=>0!==t))),_={min:0,max:2e3,stepSize:200},W={responsive:!0,plugins:{legend:{display:!1},tooltip:{enabled:!M,callbacks:{label:a.yAxis.toolTipCallback}}},scales:{x:{title:{display:!!a.xAxis.title,text:a.xAxis.title,color:a.xAxis.titleColor,font:{size:p.FONTS.caption.fontSize}},grid:{display:!1,borderColor:p.COLORS.background.base},ticks:{fontSize:p.FONTS.caption.fontSize,color:null!==(b=a.yAxis.labelColor)&&void 0!==b?b:p.COLORS.content.secondary}},y:{title:{display:!!a.yAxis.title,text:a.yAxis.title,color:a.yAxis.titleColor,font:{size:p.FONTS.caption.fontSize}},grid:{borderColor:"white",color:p.COLORS.background.base},ticks:Object.assign({callback:a.yAxis.ticksCallback,fontSize:p.FONTS.caption.fontSize,color:null!==(h=a.xAxis.labelColor)&&void 0!==h?h:p.COLORS.content.secondary},M?_:{})}},maintainAspectRatio:!1},J={responsive:!0,plugins:{legend:{display:!1},tooltip:{enabled:!V,callbacks:{label:a.yAxis.toolTipCallback}}},scales:{x:{title:{display:!!(null===(y=a.popupData)||void 0===y?void 0:y.xAxis.title),text:null===(C=a.popupData)||void 0===C?void 0:C.xAxis.title,color:null===(S=a.popupData)||void 0===S?void 0:S.xAxis.titleColor,font:{size:p.FONTS.caption.fontSize}},grid:{display:!1,borderColor:p.COLORS.background.base},ticks:{fontSize:p.FONTS.caption.fontSize,color:null!==(f=null===(A=a.popupData)||void 0===A?void 0:A.yAxis.labelColor)&&void 0!==f?f:p.COLORS.content.secondary}},y:{title:{display:!!(null===(j=a.popupData)||void 0===j?void 0:j.yAxis.title),text:null===(O=a.popupData)||void 0===O?void 0:O.yAxis.title,color:null===(k=a.popupData)||void 0===k?void 0:k.yAxis.titleColor,font:{size:p.FONTS.caption.fontSize}},grid:{borderColor:"white",color:p.COLORS.background.base},ticks:Object.assign({callback:null===(m=a.popupData)||void 0===m?void 0:m.yAxis.ticksCallback,fontSize:p.FONTS.caption.fontSize,color:null!==($=null===(z=a.popupData)||void 0===z?void 0:z.xAxis.labelColor)&&void 0!==$?$:p.COLORS.content.secondary},V?_:{})}},maintainAspectRatio:!1},K={labels:a.xAxis.data.map((t=>t.toString())),datasets:[{data:M?G:a.yAxis.data,backgroundColor:t=>{var e;const i=a.barColorRGBA;let o=[];const l=a.xAxis.data.length;if(M)return"rgba(0,0,0,0)";if(a.isFunnel){let t=+(l>10?.1:(1/l).toFixed(2));const e=`rgba(${i.r}, ${i.g}, ${i.b}`;for(let i=1;i<l+1;i++){let a="";i>10?a=`${e},1)`:(a=`${e},${t})`,t+=.1),o.push(a)}}else{const t=`rgba(${i.r}, ${i.g}, ${i.b}, ${null!==(e=i.a)&&void 0!==e?e:"1"})`;o=Array(l).fill(t)}return o},barPercentage:.4,categoryPercentage:1,borderRadius:4}]},Q={labels:null===(D=a.popupData)||void 0===D?void 0:D.xAxis.data.map((t=>t.toString())),datasets:[{data:V?G:null===(T=a.popupData)||void 0===T?void 0:T.yAxis.data,backgroundColor:t=>{var e,i;const o=a.barColorRGBA;let l=[];const s=(null===(e=a.popupData)||void 0===e?void 0:e.xAxis.data.length)||0;if(M)return"rgba(0,0,0,0)";if(a.isFunnel){let t=+(s>10?.1:(1/s).toFixed(2));const e=`rgba(${o.r}, ${o.g}, ${o.b}`;for(let i=1;i<s+1;i++){let o="";i>10?o=`${e},1)`:(o=`${e},${t})`,t+=.1),l.push(o)}}else{const t=`rgba(${o.r}, ${o.g}, ${o.b}, ${null!==(i=o.a)&&void 0!==i?i:"1"})`;l=Array(s).fill(t)}return l},barPercentage:.4,categoryPercentage:1,borderRadius:4}]};return t.jsxs(u.GraphContainerWrapper,Object.assign({padding:a.outerPadding},{children:[a.chartHeading&&t.jsx("div",Object.assign({style:{marginBottom:24}},{children:t.jsx(c.TitleMedium,Object.assign({color:null!==(R=a.chartHeading.color)&&void 0!==R?R:p.COLORS.content.secondary},{children:a.chartHeading.heading}))})),t.jsxs("div",Object.assign({style:{display:"flex",justifyContent:"flex-end"}},{children:[a.showConvertToPieChart&&t.jsx(r.IconButton,{Icon:i.default,onClick:()=>{w(!0),I(!0)}}),a.allowChartPopup&&t.jsx(r.IconButton,{Icon:o.default,onClick:()=>{I(!0)}})]})),t.jsx("div",Object.assign({style:{height:null!==(q=a.graphCanvasHeight)&&void 0!==q?q:500}},{children:t.jsx(s.Bar,{options:W,data:K})})),L&&t.jsxs(d.StyledModal,Object.assign({open:L,onClose:()=>{I(!1),w(!1)},closeOnOutsideClick:!0,headingTitle:null===(P=a.popupData)||void 0===P?void 0:P.chartHeading,width:"75%",headerRightCustomElement:a.showConvertToPieChart?N?t.jsx(r.IconButton,{Icon:e.default,onClick:()=>{w(!1)}}):t.jsx(r.IconButton,{Icon:i.default,onClick:()=>{w(!0)}}):null,headerLeftCustomElement:null===(B=a.popupData)||void 0===B?void 0:B.headerLeftCustomElement},{children:[N&&E&&t.jsx("div",Object.assign({style:{padding:"24px"}},{children:t.jsx(n.PieChartAnalytics,{slices:E,size:a.pieChartSize,hideTitle:!0})})),!N&&t.jsx("div",Object.assign({style:{height:null!==(F=a.graphCanvasHeight)&&void 0!==F?F:500}},{children:t.jsx(s.Bar,{options:J,data:Q})}))]}))]}))};
|
|
@@ -1,5 +1,20 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("../../../assets/icons/horizontal_dots.svg.js"),o=require("../../../assets/icons/vertical_dots.svg.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("../../../assets/icons/horizontal_dots.svg.js"),o=require("../../../assets/icons/vertical_dots.svg.js"),t=require("styled-components"),n=require("../DropdownPopover/index.js");require("../Dropdown.js"),require("../ChipDropdown.js"),require("react"),require("../../zeroState/ZeroState.js"),require("../../TypographyStyle.js");var s=require("../../../constants/Theme.js");require("../OpenedDropdown/components/description/Description.styled.js"),require("../../checkBox/CheckBox.styled.js"),require("../../list-item/ListItem.js"),require("../OpenedDropdown/components/menu/FreeFormMenu.styled.js"),require("../OpenedDropdown/components/menu/MenuItem.js"),require("../OpenedDropdown/components/menu/MenuList.styled.js"),require("../../button/Button.js"),require("../OpenedDropdown/components/multiSelect/MultiSelectDropdownBottomBar.styled.js"),require("../OpenedDropdown/components/OpennedDropdown.styled.js");var i=require("../../icon-button/IconButton.js");function d(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}require("../../input/Input.js");const u=d(t).default.div`
|
|
2
2
|
:hover {
|
|
3
3
|
background: ${s.COLORS.surface.subdued};
|
|
4
4
|
}
|
|
5
|
-
|
|
5
|
+
position: ${e=>e.isNewTag?"relative":""};
|
|
6
|
+
.new--tag {
|
|
7
|
+
box-sizing: border-box;
|
|
8
|
+
position: absolute;
|
|
9
|
+
right: -8px;
|
|
10
|
+
top: -5px;
|
|
11
|
+
border-radius: 50%;
|
|
12
|
+
width: 14px;
|
|
13
|
+
height: 14px;
|
|
14
|
+
background: ${s.COLORS.background.negative.vibrant};
|
|
15
|
+
border: 1.25px solid ${s.COLORS.surface.standard};
|
|
16
|
+
display: flex;
|
|
17
|
+
justify-content: center;
|
|
18
|
+
align-items: center;
|
|
19
|
+
}
|
|
20
|
+
`,p=t=>e.jsx(u,Object.assign({isNewTag:t.isNewTag},{children:e.jsxs(n.DropdownPopover,Object.assign({},t,{children:[e.jsx("div",{children:e.jsx(i.IconButton,{Icon:t.isHorizontal?r.default:o.default,bordered:!(null==t?void 0:t.hideBorder)})}),t.isNewTag?e.jsx("div",{className:"new--tag"}):null]}))}));p.displayName="MenuItemDropdown",exports.MenuItemDropdown=p;
|
|
@@ -14,6 +14,7 @@ export declare const StyledModal: React.FC<{
|
|
|
14
14
|
secondaryButton?: ButtonProps;
|
|
15
15
|
footerShadow?: boolean;
|
|
16
16
|
footerLeftCustomElement?: React.ReactNode;
|
|
17
|
+
headerLeftCustomElement?: React.ReactNode;
|
|
17
18
|
headerRightCustomElement?: React.ReactNode;
|
|
18
19
|
zIndex?: number;
|
|
19
20
|
hideCrossButton?: boolean;
|