@bikdotai/bik-component-library 0.0.501 → 0.0.502
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/QueryBuilder/Triggers/EVENTS/components/EventsTrigger.d.ts +1 -1
- package/dist/cjs/components/QueryBuilder/Triggers/EVENTS/selectors/useIGTriggerNameCacheSelector.d.ts +1 -1
- package/dist/cjs/components/QueryBuilder/Triggers/IG/components/IGTrigger.d.ts +1 -1
- package/dist/cjs/components/QueryBuilder/Triggers/IG/selectors/useIGTriggerNameCacheSelector.d.ts +1 -1
- package/dist/cjs/components/QueryBuilder/Triggers/components/BaseTriggerQueryBuilderNode.d.ts +2 -2
- package/dist/cjs/components/SearchFilter/components/FilterChipListRenderer.js +1 -1
- package/dist/cjs/components/SearchFilter/components/SearchFilterItem.js +1 -1
- package/dist/cjs/components/analytics-chips-and-dropdowns/AnalyticsMetric.d.ts +3 -0
- package/dist/cjs/components/analytics-chips-and-dropdowns/AnalyticsMetric.js +1 -1
- package/dist/cjs/components/analytics-chips-and-dropdowns/AnalyticsTrend.d.ts +5 -0
- package/dist/cjs/components/analytics-chips-and-dropdowns/AnalyticsTrend.js +1 -1
- package/dist/cjs/components/analytics-chips-and-dropdowns/chart/HorizontalBarGraph/HorizontalGraph.js +1 -1
- package/dist/cjs/components/analytics-chips-and-dropdowns/chart/Pie/PieChartAnalytics.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 +15 -1
- package/dist/cjs/components/analytics-chips-and-dropdowns/chart/StackedBarChart/StackedBarChart.styles.d.ts +3 -0
- package/dist/cjs/components/analytics-chips-and-dropdowns/chart/StackedBarChart/StackedBarChart.styles.js +5 -2
- package/dist/cjs/components/analytics-chips-and-dropdowns/chart/StackedBarChart/StackedBarDistributionChart.js +1 -1
- package/dist/cjs/components/analytics-chips-and-dropdowns/chart/StackedBarChart/StackedBarDistributionChart.model.d.ts +20 -3
- package/dist/cjs/components/analytics-chips-and-dropdowns/chart/utils/calcPercentage.d.ts +1 -0
- package/dist/cjs/components/analytics-chips-and-dropdowns/chart/utils/calcPercentage.js +1 -1
- package/dist/cjs/components/analytics-chips-and-dropdowns/index.d.ts +2 -0
- package/dist/cjs/components/bik-layout/MockMenus.d.ts +0 -1
- package/dist/cjs/components/dropdown/Dropdown.d.ts +1 -0
- package/dist/cjs/components/dropdown/Dropdown.js +1 -1
- package/dist/cjs/components/dynamic-tabs/DynamicTabs.d.ts +4 -0
- package/dist/cjs/components/dynamic-tabs/DynamicTabs.js +1 -1
- package/dist/cjs/components/postPicker/postPicker.js +1 -1
- package/dist/cjs/index.js +1 -1
- package/dist/esm/components/QueryBuilder/Triggers/EVENTS/components/EventsTrigger.d.ts +1 -1
- package/dist/esm/components/QueryBuilder/Triggers/EVENTS/selectors/useIGTriggerNameCacheSelector.d.ts +1 -1
- package/dist/esm/components/QueryBuilder/Triggers/IG/components/IGTrigger.d.ts +1 -1
- package/dist/esm/components/QueryBuilder/Triggers/IG/selectors/useIGTriggerNameCacheSelector.d.ts +1 -1
- package/dist/esm/components/QueryBuilder/Triggers/components/BaseTriggerQueryBuilderNode.d.ts +2 -2
- package/dist/esm/components/SearchFilter/components/FilterChipListRenderer.js +1 -1
- package/dist/esm/components/SearchFilter/components/SearchFilterItem.js +1 -1
- package/dist/esm/components/analytics-chips-and-dropdowns/AnalyticsMetric.d.ts +3 -0
- package/dist/esm/components/analytics-chips-and-dropdowns/AnalyticsMetric.js +1 -1
- package/dist/esm/components/analytics-chips-and-dropdowns/AnalyticsTrend.d.ts +5 -0
- package/dist/esm/components/analytics-chips-and-dropdowns/AnalyticsTrend.js +1 -1
- package/dist/esm/components/analytics-chips-and-dropdowns/chart/HorizontalBarGraph/HorizontalGraph.js +1 -1
- package/dist/esm/components/analytics-chips-and-dropdowns/chart/Pie/PieChartAnalytics.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 +15 -1
- package/dist/esm/components/analytics-chips-and-dropdowns/chart/StackedBarChart/StackedBarChart.styles.d.ts +3 -0
- package/dist/esm/components/analytics-chips-and-dropdowns/chart/StackedBarChart/StackedBarChart.styles.js +7 -4
- package/dist/esm/components/analytics-chips-and-dropdowns/chart/StackedBarChart/StackedBarDistributionChart.js +1 -1
- package/dist/esm/components/analytics-chips-and-dropdowns/chart/StackedBarChart/StackedBarDistributionChart.model.d.ts +20 -3
- package/dist/esm/components/analytics-chips-and-dropdowns/chart/utils/calcPercentage.d.ts +1 -0
- package/dist/esm/components/analytics-chips-and-dropdowns/chart/utils/calcPercentage.js +1 -1
- package/dist/esm/components/analytics-chips-and-dropdowns/index.d.ts +2 -0
- package/dist/esm/components/bik-layout/MockMenus.d.ts +0 -1
- package/dist/esm/components/dropdown/Dropdown.d.ts +1 -0
- package/dist/esm/components/dropdown/Dropdown.js +1 -1
- package/dist/esm/components/dynamic-tabs/DynamicTabs.d.ts +4 -0
- package/dist/esm/components/dynamic-tabs/DynamicTabs.js +1 -1
- package/dist/esm/components/postPicker/postPicker.js +1 -1
- package/dist/esm/index.js +1 -1
- package/package.json +2 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { QueryBuilderNodeProps } from "../../../
|
|
2
|
+
import { QueryBuilderNodeProps } from "../../../types/QueryBuilderNodeProps.type";
|
|
3
3
|
declare const EventsTrigger: React.FC<QueryBuilderNodeProps>;
|
|
4
4
|
export default EventsTrigger;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { QueryBuilderAPIData } from "../../../
|
|
1
|
+
import { QueryBuilderAPIData } from "../../../types/QueryBuilderAPI.type";
|
|
2
2
|
export declare const useIGTriggerNameCacheSelector: () => QueryBuilderAPIData[];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { QueryBuilderNodeProps } from "../../../
|
|
2
|
+
import { QueryBuilderNodeProps } from "../../../types/QueryBuilderNodeProps.type";
|
|
3
3
|
declare const IGTrigger: React.FC<QueryBuilderNodeProps>;
|
|
4
4
|
export default IGTrigger;
|
package/dist/cjs/components/QueryBuilder/Triggers/IG/selectors/useIGTriggerNameCacheSelector.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { QueryBuilderAPIData } from "../../../
|
|
1
|
+
import { QueryBuilderAPIData } from "../../../types/QueryBuilderAPI.type";
|
|
2
2
|
export declare const useIGTriggerNameCacheSelector: () => QueryBuilderAPIData[];
|
package/dist/cjs/components/QueryBuilder/Triggers/components/BaseTriggerQueryBuilderNode.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { DropdownOption } from "../../../dropdown/type";
|
|
3
|
-
import { QueryBuilderProperty } from "../../
|
|
4
|
-
import { QueryBuilderNodeProps } from "../../
|
|
3
|
+
import { QueryBuilderProperty } from "../../types/QueryBuilder.type";
|
|
4
|
+
import { QueryBuilderNodeProps } from "../../types/QueryBuilderNodeProps.type";
|
|
5
5
|
declare const BaseTriggerQueryBuilderNode: React.FC<QueryBuilderNodeProps & {
|
|
6
6
|
cacheKey: string;
|
|
7
7
|
propertyAddBtnText: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime");require("../../tooltips/Tooltip.js"),require("../../../constants/Theme.js"),require("../../TypographyStyle.js"),require("../../analytics-chips-and-dropdowns/CommonStyles.js");var r=require("../../analytics-chips-and-dropdowns/AnalyticsDropdown.js");require("react"),require("../../analytics-chips-and-dropdowns/AnalyticsMetric.js"),require("../../shimmer/ShimmerComponent/ShimmerStyled.js"),require("../../../utils/DateUtils.js");var a=require("../../tag/Tag.js");require("../../analytics-chips-and-dropdowns/chart/LineChart/LineChart.js"),require("react-bootstrap"),require("../../analytics-chips-and-dropdowns/chart/linearChipGroupedChart/LinearChipGroupedChart.styled.js"),require("../../analytics-chips-and-dropdowns/chart/Pie/PieChartAnalytics.js"),require("../../analytics-chips-and-dropdowns/chart/Pie/PieChart.js"),require("../../analytics-chips-and-dropdowns/chart/HorizontalBarGraph/HorizontalGraph.js"),require("../../analytics-chips-and-dropdowns/chart/StackedBarChart/StackedBarChart.js"),require("../../analytics-chips-and-dropdowns/chart/StackedBarChart/StackedBarDistributionChart.js"),require("../../analytics-chips-and-dropdowns/chart/VerticalBarGraph/VerticalGraph.js"),require("../../analytics-chips-and-dropdowns/chart/heatmap/HeatMap.js"),require("../../analytics-chips-and-dropdowns/chart/heatmap/HeatMapVertical.js"),require("../../analytics-chips-and-dropdowns/chart/VerticalBarAndLinearGraph/VerticalBarAndLinearGraph.js");var i=require("../../../assets/icons/cross.svg.js"),t=require("../types/SearchFilter.type.js");exports.FilterChipListRenderer=
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime");require("../../tooltips/Tooltip.js"),require("../../../constants/Theme.js"),require("../../TypographyStyle.js"),require("../../analytics-chips-and-dropdowns/CommonStyles.js");var r=require("../../analytics-chips-and-dropdowns/AnalyticsDropdown.js");require("react"),require("../../analytics-chips-and-dropdowns/AnalyticsMetric.js"),require("../../shimmer/ShimmerComponent/ShimmerStyled.js"),require("../../../utils/DateUtils.js");var a=require("../../tag/Tag.js");require("../../analytics-chips-and-dropdowns/chart/LineChart/LineChart.js"),require("react-bootstrap"),require("../../analytics-chips-and-dropdowns/chart/linearChipGroupedChart/LinearChipGroupedChart.styled.js"),require("../../analytics-chips-and-dropdowns/chart/Pie/PieChartAnalytics.js"),require("../../analytics-chips-and-dropdowns/chart/Pie/PieChart.js"),require("../../analytics-chips-and-dropdowns/chart/HorizontalBarGraph/HorizontalGraph.js"),require("../../analytics-chips-and-dropdowns/chart/StackedBarChart/StackedBarChart.js"),require("../../analytics-chips-and-dropdowns/chart/StackedBarChart/StackedBarDistributionChart.js"),require("../../analytics-chips-and-dropdowns/chart/StackedBarChart/StackedBarDistributionChart.model.js"),require("../../analytics-chips-and-dropdowns/chart/VerticalBarGraph/VerticalGraph.js"),require("../../analytics-chips-and-dropdowns/chart/heatmap/HeatMap.js"),require("../../analytics-chips-and-dropdowns/chart/heatmap/HeatMapVertical.js"),require("../../analytics-chips-and-dropdowns/chart/VerticalBarAndLinearGraph/VerticalBarAndLinearGraph.js");var i=require("../../../assets/icons/cross.svg.js"),t=require("../types/SearchFilter.type.js");exports.FilterChipListRenderer=n=>{let{selectedState:l,onDeSelect:s}=n;return e.jsx(e.Fragment,{children:l.map((n=>{var l,o,d,c,u,p,h,y,v,g,j;if(n.type===t.FilterType.Multiple)return e.jsx(e.Fragment,{children:null===(l=n.value)||void 0===l?void 0:l.map((r=>{var t,l;return e.jsx(a.Tag,{onTrailingIconClicked:()=>s(n.id,r),style:{cursor:"pointer"},tagText:null!==(l=null===(t=r.label)||void 0===t?void 0:t.slice(0,10))&&void 0!==l?l:"",type:"neutral",theme:"light",TrailingIcon:i.default},`${n.id}-${r.value}`)}))});if(n.type===t.FilterType.Date)return e.jsx(a.Tag,{onTrailingIconClicked:()=>s(n.id,n.value),style:{cursor:"pointer"},tagText:r.formatDate(n.value),type:"neutral",theme:"light",TrailingIcon:i.default},n.id);if(n.type===t.FilterType.DateRange)return e.jsx(a.Tag,{onTrailingIconClicked:()=>s(n.id,n.value),style:{cursor:"pointer"},tagText:`${r.formatDate(null===(o=n.value)||void 0===o?void 0:o[0])} to ${r.formatDate(null===(d=n.value)||void 0===d?void 0:d[1])}`,type:"neutral",theme:"light",TrailingIcon:i.default},n.id);return(n.type===t.FilterType.Single?null!==(u=null===(c=n.value)||void 0===c?void 0:c.label)&&void 0!==u?u:"":null!==(h=null===(p=n.value)||void 0===p?void 0:p.toString())&&void 0!==h?h:"")?e.jsx(a.Tag,{onTrailingIconClicked:()=>s(n.id,n.value),style:{cursor:"pointer"},tagText:n.type===t.FilterType.Single?null!==(v=null===(y=n.value)||void 0===y?void 0:y.label)&&void 0!==v?v:"":null!==(j=null===(g=n.value)||void 0===g?void 0:g.toString())&&void 0!==j?j:"",type:"neutral",theme:"light",TrailingIcon:i.default},n.id):e.jsx(e.Fragment,{})}))})};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime");require("../../tooltips/Tooltip.js"),require("../../../constants/Theme.js"),require("../../TypographyStyle.js"),require("../../analytics-chips-and-dropdowns/CommonStyles.js");var r=require("../../analytics-chips-and-dropdowns/AnalyticsDropdown.js");require("react"),require("../../analytics-chips-and-dropdowns/AnalyticsMetric.js"),require("../../shimmer/ShimmerComponent/ShimmerStyled.js"),require("../../../utils/DateUtils.js"),require("../../tag/Tag.js"),require("../../analytics-chips-and-dropdowns/chart/LineChart/LineChart.js"),require("react-bootstrap"),require("../../analytics-chips-and-dropdowns/chart/linearChipGroupedChart/LinearChipGroupedChart.styled.js"),require("../../analytics-chips-and-dropdowns/chart/Pie/PieChartAnalytics.js"),require("../../analytics-chips-and-dropdowns/chart/Pie/PieChart.js"),require("../../analytics-chips-and-dropdowns/chart/HorizontalBarGraph/HorizontalGraph.js"),require("../../analytics-chips-and-dropdowns/chart/StackedBarChart/StackedBarChart.js"),require("../../analytics-chips-and-dropdowns/chart/StackedBarChart/StackedBarDistributionChart.js"),require("../../analytics-chips-and-dropdowns/chart/VerticalBarGraph/VerticalGraph.js"),require("../../analytics-chips-and-dropdowns/chart/heatmap/HeatMap.js"),require("../../analytics-chips-and-dropdowns/chart/heatmap/HeatMapVertical.js"),require("../../analytics-chips-and-dropdowns/chart/VerticalBarAndLinearGraph/VerticalBarAndLinearGraph.js"),require("../../dropdown/DropdownPopover/index.js");var t=require("../../dropdown/Dropdown.js"),a=require("../../dropdown/ChipDropdown.js");require("../../zeroState/ZeroState.js"),require("../../dropdown/OpenedDropdown/components/description/Description.styled.js"),require("../../checkBox/CheckBox.styled.js"),require("../../list-item/ListItem.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("../../button/Button.js"),require("../../dropdown/OpenedDropdown/components/multiSelect/MultiSelectDropdownBottomBar.styled.js"),require("../../dropdown/OpenedDropdown/components/OpennedDropdown.styled.js"),require("../../input/Input.js"),require("../../dropdown/MenuItem/MenuItem.js");var n=require("../types/SearchFilter.type.js"),o=require("./DatePickerButton.js"),i=require("./DateRangeOnlyButton.js");const s=[{label:"Last 7 days",value:"7 days",key:7,noOfDays:7},{label:"Last 30 days",value:"30 days",key:30,noOfDays:30},{label:"Custom range",value:"calender",key:"custom",isCustom:!0,dateRangeSelectionOptions:{selectRange:!0}}];exports.SearchFilterItem=d=>{var p,l,c;return d.type===n.FilterType.Date?e.jsx(o.DatePickerButton,Object.assign({},d,{variant:d.variant,onSelect:e=>d.onChange(e)})):d.type===n.FilterType.DateRange?d.rangePickerDateOnly?e.jsx(i.DateRangeOnlyButton,Object.assign({},d,{variant:d.variant,onSelect:e=>d.onChange(e)})):e.jsx(r.AnalyticsDropdown,{datePickerPlacement:d.datePickerPlacement,variant:d.variant,placeholder:d.text,options:d.preset?s:null!==(p=d.options)&&void 0!==p?p:[],onOptionSelected:function(e){var r,t;e.selectedRange&&d.onChange([null===(r=e.selectedRange)||void 0===r?void 0:r[0],null===(t=e.selectedRange)||void 0===t?void 0:t[1]])}},d.id):"small"===d.variant?e.jsx(a.ChipDropdown,{isMultiSelect:d.type===n.FilterType.Multiple,options:null!==(l=d.options)&&void 0!==l?l:[],defaultOptions:d.defaultValue,onSelect:d.onChange,placeHolder:d.text}):e.jsx(t.Dropdown,{isMultiSelect:d.type===n.FilterType.Multiple,size:"small",options:null!==(c=d.options)&&void 0!==c?c:[],defaultOptions:d.defaultValue,onSelect:d.onChange,placeHolder:d.text,width:10*d.text.length+"px"})};
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime");require("../../tooltips/Tooltip.js"),require("../../../constants/Theme.js"),require("../../TypographyStyle.js"),require("../../analytics-chips-and-dropdowns/CommonStyles.js");var r=require("../../analytics-chips-and-dropdowns/AnalyticsDropdown.js");require("react"),require("../../analytics-chips-and-dropdowns/AnalyticsMetric.js"),require("../../shimmer/ShimmerComponent/ShimmerStyled.js"),require("../../../utils/DateUtils.js"),require("../../tag/Tag.js"),require("../../analytics-chips-and-dropdowns/chart/LineChart/LineChart.js"),require("react-bootstrap"),require("../../analytics-chips-and-dropdowns/chart/linearChipGroupedChart/LinearChipGroupedChart.styled.js"),require("../../analytics-chips-and-dropdowns/chart/Pie/PieChartAnalytics.js"),require("../../analytics-chips-and-dropdowns/chart/Pie/PieChart.js"),require("../../analytics-chips-and-dropdowns/chart/HorizontalBarGraph/HorizontalGraph.js"),require("../../analytics-chips-and-dropdowns/chart/StackedBarChart/StackedBarChart.js"),require("../../analytics-chips-and-dropdowns/chart/StackedBarChart/StackedBarDistributionChart.js"),require("../../analytics-chips-and-dropdowns/chart/StackedBarChart/StackedBarDistributionChart.model.js"),require("../../analytics-chips-and-dropdowns/chart/VerticalBarGraph/VerticalGraph.js"),require("../../analytics-chips-and-dropdowns/chart/heatmap/HeatMap.js"),require("../../analytics-chips-and-dropdowns/chart/heatmap/HeatMapVertical.js"),require("../../analytics-chips-and-dropdowns/chart/VerticalBarAndLinearGraph/VerticalBarAndLinearGraph.js"),require("../../dropdown/DropdownPopover/index.js");var t=require("../../dropdown/Dropdown.js"),a=require("../../dropdown/ChipDropdown.js");require("../../zeroState/ZeroState.js"),require("../../dropdown/OpenedDropdown/components/description/Description.styled.js"),require("../../checkBox/CheckBox.styled.js"),require("../../list-item/ListItem.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("../../button/Button.js"),require("../../dropdown/OpenedDropdown/components/multiSelect/MultiSelectDropdownBottomBar.styled.js"),require("../../dropdown/OpenedDropdown/components/OpennedDropdown.styled.js"),require("../../input/Input.js"),require("../../dropdown/MenuItem/MenuItem.js");var n=require("../types/SearchFilter.type.js"),o=require("./DatePickerButton.js"),i=require("./DateRangeOnlyButton.js");const s=[{label:"Last 7 days",value:"7 days",key:7,noOfDays:7},{label:"Last 30 days",value:"30 days",key:30,noOfDays:30},{label:"Custom range",value:"calender",key:"custom",isCustom:!0,dateRangeSelectionOptions:{selectRange:!0}}];exports.SearchFilterItem=d=>{var p,l,c;return d.type===n.FilterType.Date?e.jsx(o.DatePickerButton,Object.assign({},d,{variant:d.variant,onSelect:e=>d.onChange(e)})):d.type===n.FilterType.DateRange?d.rangePickerDateOnly?e.jsx(i.DateRangeOnlyButton,Object.assign({},d,{variant:d.variant,onSelect:e=>d.onChange(e)})):e.jsx(r.AnalyticsDropdown,{datePickerPlacement:d.datePickerPlacement,variant:d.variant,placeholder:d.text,options:d.preset?s:null!==(p=d.options)&&void 0!==p?p:[],onOptionSelected:function(e){var r,t;e.selectedRange&&d.onChange([null===(r=e.selectedRange)||void 0===r?void 0:r[0],null===(t=e.selectedRange)||void 0===t?void 0:t[1]])}},d.id):"small"===d.variant?e.jsx(a.ChipDropdown,{isMultiSelect:d.type===n.FilterType.Multiple,options:null!==(l=d.options)&&void 0!==l?l:[],defaultOptions:d.defaultValue,onSelect:d.onChange,placeHolder:d.text}):e.jsx(t.Dropdown,{isMultiSelect:d.type===n.FilterType.Multiple,size:"small",options:null!==(c=d.options)&&void 0!==c?c:[],defaultOptions:d.defaultValue,onSelect:d.onChange,placeHolder:d.text,width:10*d.text.length+"px"})};
|
|
@@ -5,6 +5,9 @@ export declare const AnalyticsMetric: React.FC<{
|
|
|
5
5
|
RightHeaderComponent?: React.ReactElement;
|
|
6
6
|
trends: AnalyticsTrendInterface[];
|
|
7
7
|
containerStyle?: React.CSSProperties;
|
|
8
|
+
trendStyle?: React.CSSProperties;
|
|
9
|
+
trendContainerStyle?: React.CSSProperties;
|
|
10
|
+
trendIconStyle?: React.CSSProperties;
|
|
8
11
|
titleSize?: 'large' | 'small';
|
|
9
12
|
titleColor?: string;
|
|
10
13
|
perRow?: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var g=require("@emotion/styled/base"),I=require("react/jsx-runtime"),C=require("../../constants/Theme.js"),A=require("../TypographyStyle.js"),l=require("./AnalyticsTrend.js");function e(g){return g&&"object"==typeof g&&"default"in g?g:{default:g}}const c=e(g).default("div","production"===process.env.NODE_ENV?{target:"e1bel8cf0"}:{target:"e1bel8cf0",label:"TrendContainer"})("production"===process.env.NODE_ENV?{name:"jovua5",styles:"display:flex;flex-direction:row;flex-wrap:wrap"}:{name:"jovua5",styles:"display:flex;flex-direction:row;flex-wrap:wrap",map:"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var g=require("@emotion/styled/base"),I=require("react/jsx-runtime"),C=require("../../constants/Theme.js"),A=require("../TypographyStyle.js"),l=require("./AnalyticsTrend.js");function e(g){return g&&"object"==typeof g&&"default"in g?g:{default:g}}const c=e(g).default("div","production"===process.env.NODE_ENV?{target:"e1bel8cf0"}:{target:"e1bel8cf0",label:"TrendContainer"})("production"===process.env.NODE_ENV?{name:"jovua5",styles:"display:flex;flex-direction:row;flex-wrap:wrap"}:{name:"jovua5",styles:"display:flex;flex-direction:row;flex-wrap:wrap",map:"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkFuYWx5dGljc01ldHJpYy50c3giXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBS2tDIiwiZmlsZSI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PSAwID8gMyA6IDQpO1xyXG4gICAgY29uc3Qgcm93cyA9IE1hdGguY2VpbCh0cmVuZHMubGVuZ3RoIC8gcGVyUm93TG9jYWwpO1xyXG4gICAgcmV0dXJuIChfanN4cyhcImRpdlwiLCBPYmplY3QuYXNzaWduKHsgc3R5bGU6IE9iamVjdC5hc3NpZ24oeyBwYWRkaW5nVG9wOiAyNCwgcGFkZGluZ0JvdHRvbTogMjQgfSwgKGNvbnRhaW5lclN0eWxlICE9PSBudWxsICYmIGNvbnRhaW5lclN0eWxlICE9PSB2b2lkIDAgPyBjb250YWluZXJTdHlsZSA6IHt9KSkgfSwgeyBjaGlsZHJlbjogW19qc3hzKFwiZGl2XCIsIE9iamVjdC5hc3NpZ24oeyBzdHlsZToge1xyXG4gICAgICAgICAgICAgICAgICAgIGRpc3BsYXk6ICdmbGV4JyxcclxuICAgICAgICAgICAgICAgICAgICBmbGV4RGlyZWN0aW9uOiAncm93JyxcclxuICAgICAgICAgICAgICAgICAgICBqdXN0aWZ5Q29udGVudDogJ3NwYWNlLWJldHdlZW4nLFxyXG4gICAgICAgICAgICAgICAgICAgIHBhZGRpbmdCb3R0b206IDEyLFxyXG4gICAgICAgICAgICAgICAgfSB9LCB7IGNoaWxkcmVuOiBbdGl0bGUgJiYgKF9qc3goVHlwbywgT2JqZWN0LmFzc2lnbih7IGNvbG9yOiB0aXRsZUNvbG9yICE9PSBudWxsICYmIHRpdGxlQ29sb3IgIT09IHZvaWQgMCA/IHRpdGxlQ29sb3IgOiBDT0xPUlMuY29udGVudC5zZWNvbmRhcnksIHN0eWxlOiB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYWRkaW5nTGVmdDogMjQsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYWRkaW5nUmlnaHQ6IDI0LFxyXG4gICAgICAgICAgICAgICAgICAgICAgICB9IH0sIHsgY2hpbGRyZW46IHRpdGxlIH0pKSksIFJpZ2h0SGVhZGVyQ29tcG9uZW50XSB9KSksIF9qc3goVHJlbmRDb250YWluZXIsIHsgY2hpbGRyZW46IEFycmF5LmZyb20oeyBsZW5ndGg6IHJvd3MgfSkubWFwKChfLCByb3dJbmRleCkgPT4gKF9qc3goX0ZyYWdtZW50LCB7IGNoaWxkcmVuOiBfanN4KFwiZGl2XCIsIE9iamVjdC5hc3NpZ24oeyBzdHlsZToge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZGlzcGxheTogJ2ZsZXgnLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgd2lkdGg6ICcxMDAlJyxcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1hcmdpblRvcDogcm93SW5kZXggPT09IDAgPyAwIDogMTYsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gfSwgeyBjaGlsZHJlbjogdHJlbmRzXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAuc2xpY2Uocm93SW5kZXggKiBwZXJSb3dMb2NhbCwgKHJvd0luZGV4ICsgMSkgKiBwZXJSb3dMb2NhbClcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5tYXAoKHRyZW5kLCBpKSA9PiB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgX2E7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gKF9qc3goXCJkaXZcIiwgT2JqZWN0LmFzc2lnbih7IHN0eWxlOiB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZsZXg6IDEsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1heFdpZHRoOiB0cmVuZHMubGVuZ3RoID09PSAxID8gJzEwMCUnIDogJzUwJScsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSB9LCB7IGNoaWxkcmVuOiBfanN4KEFuYWx5dGljc1RyZW5kLCBPYmplY3QuYXNzaWduKHt9LCB0cmVuZCwgeyBpc0xvYWRpbmc6IGlzTG9hZGluZywgY2FyZDogZmFsc2UsIHNpemU6IChfYSA9IHRyZW5kLnNpemUpICE9PSBudWxsICYmIF9hICE9PSB2b2lkIDAgPyBfYSA6ICdzbWFsbCcsIHJpZ2h0U2VwYXJhdG9yOiBpICsgcm93SW5kZXggKiBwZXJSb3dMb2NhbCA8XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBNYXRoLm1pbigocm93SW5kZXggKyAxKSAqIHBlclJvd0xvY2FsIC0gMSwgdHJlbmRzLmxlbmd0aCAtIDEpLCB0cmVuZFN0eWxlOiB0cmVuZFN0eWxlLCB0cmVuZEljb25TdHlsZTogdHJlbmRJY29uU3R5bGUsIHRyZW5kQ29udGFpbmVyU3R5bGU6IHRyZW5kQ29udGFpbmVyU3R5bGUgfSkpIH0pLCBpKSk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pIH0pLCByb3dJbmRleCkgfSkpKSB9KV0gfSkpKTtcclxufTtcclxuLy8jIHNvdXJjZU1hcHBpbmdVUkw9QW5hbHl0aWNzTWV0cmljLmpzLm1hcCJdfQ== */",toString:function(){return"You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."}});exports.AnalyticsMetric=g=>{let{title:e,trends:t,RightHeaderComponent:d,containerStyle:s,titleSize:i,titleColor:n,perRow:b,isLoading:a,trendStyle:y,trendContainerStyle:Z,trendIconStyle:u}=g;const o="large"===i?A.TitleMedium:A.TitleRegular,G=b||(t.length<=4?t.length:t.length%3==0?3:4),p=Math.ceil(t.length/G);return I.jsxs("div",Object.assign({style:Object.assign({paddingTop:24,paddingBottom:24},null!=s?s:{})},{children:[I.jsxs("div",Object.assign({style:{display:"flex",flexDirection:"row",justifyContent:"space-between",paddingBottom:12}},{children:[e&&I.jsx(o,Object.assign({color:null!=n?n:C.COLORS.content.secondary,style:{paddingLeft:24,paddingRight:24}},{children:e})),d]})),I.jsx(c,{children:Array.from({length:p}).map(((g,C)=>I.jsx(I.Fragment,{children:I.jsx("div",Object.assign({style:{display:"flex",width:"100%",marginTop:0===C?0:16}},{children:t.slice(C*G,(C+1)*G).map(((g,A)=>{var e;return I.jsx("div",Object.assign({style:{flex:1,maxWidth:1===t.length?"100%":"50%"}},{children:I.jsx(l.AnalyticsTrend,Object.assign({},g,{isLoading:a,card:!1,size:null!==(e=g.size)&&void 0!==e?e:"small",rightSeparator:A+C*G<Math.min((C+1)*G-1,t.length-1),trendStyle:y,trendIconStyle:u,trendContainerStyle:Z}))}),A)}))}),C)})))})]}))};
|
|
@@ -3,6 +3,7 @@ export interface AnalyticsTrendInterface {
|
|
|
3
3
|
title: string;
|
|
4
4
|
value?: number | string;
|
|
5
5
|
trendPercent?: number;
|
|
6
|
+
trendRaw?: number;
|
|
6
7
|
formatVal?: boolean;
|
|
7
8
|
timeline?: 'today' | 'yesterday' | '7 days' | '30 days' | 'custom';
|
|
8
9
|
customRange?: Date[];
|
|
@@ -18,5 +19,9 @@ export interface AnalyticsTrendInterface {
|
|
|
18
19
|
iconTooltipBody?: string;
|
|
19
20
|
funnelPercent?: number;
|
|
20
21
|
isLoading?: boolean;
|
|
22
|
+
suffixText?: string;
|
|
23
|
+
trendStyle?: React.CSSProperties;
|
|
24
|
+
trendContainerStyle?: React.CSSProperties;
|
|
25
|
+
trendIconStyle?: React.CSSProperties;
|
|
21
26
|
}
|
|
22
27
|
export declare const AnalyticsTrend: React.FC<AnalyticsTrendInterface>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),i=require("../shimmer/ShimmerComponent/ShimmerStyled.js"),n=require("../../utils/DateUtils.js"),r=require("../../constants/Theme.js"),s=require("../../assets/icons/arrow_down.svg.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),i=require("../shimmer/ShimmerComponent/ShimmerStyled.js"),n=require("../../utils/DateUtils.js"),r=require("../../constants/Theme.js"),s=require("../../assets/icons/arrow_down.svg.js"),l=require("../../assets/icons/arrow_up.svg.js"),o=require("../../assets/icons/info.svg.js"),a=require("../tag/Tag.js"),c=require("../tooltips/Tooltip.js"),d=require("../TypographyStyle.js"),g=require("./CommonStyles.js");function h(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var u=h(t);const y=i=>{let{percent:o,direction:a,timeline:c,customRange:g,trendRaw:h,prefixSymbol:u,trendIconStyle:y}=i;const m="negative"===a?s.default:l.default,p="negative"===a?r.COLORS.background.negative.vibrant:"positive"===a?r.COLORS.background.positive.vibrant:r.COLORS.content.placeholder,j=t.useRef("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&&g?n.default.getAnalyticsCustomDateTimelineText(g):""),x=t.useRef((()=>{const e=((null!=h?h:0)>0?"+":"")+(null!=u?u:"");return void 0===h?"--":`${null!=e?e:""}${Math.round(100*(h+Number.EPSILON))/100}`})());return e.jsxs("div",Object.assign({style:{display:"flex",alignItems:"center",flexDirection:"row",flexWrap:"wrap"}},{children:["number"==typeof o&&e.jsx(m,{color:p,height:20,width:20,style:Object.assign({marginRight:2},null!=y?y:{})}),"number"==typeof o&&a&&e.jsxs(d.TitleSmall,Object.assign({style:{color:p}},{children:["neutral"===a?0:o<1e3?o:">999","%"]})),!!h&&e.jsx(d.Caption,Object.assign({style:{marginLeft:4,color:r.COLORS.content.placeholder}},{children:`(${x.current})`})),c&&e.jsx(d.Caption,Object.assign({style:{marginLeft:4,color:r.COLORS.content.placeholder}},{children:j.current}))]}))};exports.AnalyticsTrend=t=>{let{title:n,value:s,trendPercent:l,type:h="horizontal",timeline:m,customRange:p,tooltip:j,card:x=!0,rightSeparator:b=!1,size:f="big",share:O=!1,formatVal:v,prefixSymbol:S,trailingIcon:C,onTrailIconClick:R,iconTooltipBody:T,funnelPercent:w,isLoading:L,trendRaw:I,suffixText:q,trendStyle:$,trendContainerStyle:D,trendIconStyle:M}=t;const k="big"===f?d.TitleLarge:d.TitleMedium,N=void 0!==l?l<0?"negative":0===l?"neutral":"positive":void 0,z=void 0!==l?O?Math.round(l):Math.abs(Math.round(l)):void 0;return e.jsx(g.AnalyticsTrendContainer,Object.assign({card:x},{children:e.jsxs("div",Object.assign({style:Object.assign({display:"flex",flexDirection:"row",gap:4,borderRightWidth:b?1:0,borderRightColor:r.COLORS.stroke.primary,borderRightStyle:"solid",paddingLeft:x?0:24,paddingRight:x?0:24,height:"100%",justifyContent:"space-between",alignItems:"center"},null!=D?D:{})},{children:[e.jsxs("div",Object.assign({style:Object.assign({display:"flex",flexDirection:"column",gap:4,height:"100%"},null!=$?$:{})},{children:[e.jsxs("div",Object.assign({style:{display:"flex",flexDirection:"row",gap:4,alignItems:"center"}},{children:[e.jsx(d.BodySecondary,Object.assign({style:{color:r.COLORS.content.secondary}},{children:n})),j&&e.jsx(c.Tooltip,Object.assign({body:j,placement:"right",width:300},{children:e.jsx("div",Object.assign({style:{display:"flex",alignItems:"center",cursor:"pointer"}},{children:e.jsx(o.default,{color:r.COLORS.content.inactive,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:[L&&e.jsx(i.ShimmerComponentStyled,{width:108,height:26}),!L&&e.jsx(k,Object.assign({style:{color:r.COLORS.content.primary}},{children:void 0===s?"--":"number"==typeof s&&v?`${null!=S?S:""}${new Intl.NumberFormat("en-IN",{}).format(s)} ${null!=q?q:""}`:`${null!=S?S:""}${s} ${null!=q?q:""}`})),"horizontal"===h&&!L&&!O&&e.jsx(y,{timeline:m,customRange:p,percent:z,direction:N,trendRaw:I,prefixSymbol:S,trendIconStyle:M}),L&&!O&&"horizontal"===h&&e.jsx(i.ShimmerComponentStyled,{height:20,width:141,marginTop:6}),"vertical"===h&&!L&&void 0!==w&&e.jsx(a.Tag,{tagText:`${w} %`,theme:"light",type:"neutral"}),O&&!L&&void 0!==z&&e.jsx(a.Tag,{tagText:`${z} %`,theme:"light",type:"neutral"})]})),"vertical"===h&&!L&&!O&&e.jsx("div",Object.assign({style:{marginTop:10}},{children:e.jsx(y,{timeline:m,customRange:p,percent:z,direction:N,trendRaw:I,prefixSymbol:S,trendIconStyle:M})})),L&&"vertical"===h&&e.jsx(i.ShimmerComponentStyled,{height:20,width:141,marginTop:6})]})),T&&!L&&e.jsx(c.Tooltip,Object.assign({body:T,placement:"right"},{children:C&&e.jsx("div",Object.assign({className:"icon--holder",onClick:R},{children:u.default.createElement(C,{height:20,width:20,color:r.COLORS.content.secondary})}))}))]}))}))};
|
|
@@ -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("chart.js"),a=require("chartjs-plugin-datalabels"),o=require("react-chartjs-2"),i=require("../../../TypographyStyle.js"),r=require("../../../../constants/Theme.js"),l=require("./HorizontalGraph.styles.js");function n(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var s=n(a);e.Chart.register(e.CategoryScale,e.LinearScale,e.BarElement,e.Tooltip,s.default);exports.HorizontalGraph=e=>{var a,n,s,d,c,x,p,g,u;const b=-1===e.xAxis.data.findIndex((t=>0!==t)),h={min:0,max:2e3,stepSize:null!==(a=e.xAxis.stepSize)&&void 0!==a?a:200},y={indexAxis:"y",elements:{},responsive:!0,maintainAspectRatio:e.maintainAspectRatio,layout:{padding:{right:e.showTotal?50:0}},plugins:{legend:{display:!1},tooltip:{enabled:!b,callbacks:{label:e.xAxis.toolTipCallback,footer:null===(n=e.tooltipConfig)||void 0===n?void 0:n.footerCallback},footerFont:null===(d=null===(s=e.tooltipConfig)||void 0===s?void 0:s.footerStyles)||void 0===d?void 0:d.footerFont},datalabels:{display:null!==(c=!b&&e.showTotal)&&void 0!==c&&c,anchor:"end",align:"end",clamp:!0,formatter:(t,e)=>{var a;const o=e.datasetIndex,i=e.chart.data.datasets;if(o!==i.length-1)return"";const r=e.dataIndex;let l=0;for(let t=0;t<i.length;t++)l+=null!==(a=i[t].data[r])&&void 0!==a?a:0;return l?l<1e3?l:(l/1e3).toString().substring(0,4)+"k":""},color:r.COLORS.content.secondary}},scales:{y:{title:{display:!!e.yAxis.title,text:e.yAxis.title,color:e.yAxis.titleColor,font:{size:r.FONTS.caption.fontSize,color:e.yAxis.titleColor},padding:{bottom:10}},grid:{display:!1,borderColor:r.COLORS.background.base},ticks:{fontSize:r.FONTS.caption.fontSize,color:null!==(x=e.yAxis.labelColor)&&void 0!==x?x:r.COLORS.content.secondary}},x:{title:{display:!!e.xAxis.title,text:e.xAxis.title,color:e.xAxis.titleColor,font:{size:r.FONTS.caption.fontSize},padding:{top:10}},grid:{borderColor:"white",color:r.COLORS.background.base},ticks:Object.assign({callback:e.xAxis.ticksCallback,fontSize:r.FONTS.caption.fontSize,color:null!==(p=e.xAxis.labelColor)&&void 0!==p?p:r.COLORS.content.secondary},b?h:{max:e.xAxis.max,stepSize:e.xAxis.stepSize})}}},S={labels:e.yAxis.data.map((t=>t.toString())),datasets:[{data:b?[250,1e3,800,1500,300,600]:e.xAxis.data,backgroundColor:t=>(t=>{var a;const o=t.chart.ctx.createLinearGradient(0,0,0,200);let i="";if(b)i="rgba(0,0,0,0)";else if(e.barColorRGBA){const t=e.barColorRGBA;i=`rgba(${t.r}, ${t.g}, ${t.b}, ${null!==(a=t.a)&&void 0!==a?a:"0.3"})`}return o.addColorStop(0,i||"rgba(146, 96, 237, 0.3)"),o.addColorStop(1,i||"rgba(146, 96, 237, 0.3)"),o})(t),barPercentage:.4,categoryPercentage:1,borderRadius:4}]};return t.jsxs(l.GraphContainerWrapper,Object.assign({padding:e.outerPadding},{children:[e.chartHeading&&t.jsx(i.TitleRegular,Object.assign({color:null!==(g=e.chartHeading.color)&&void 0!==g?g:r.COLORS.content.secondary},{children:e.chartHeading.heading})),t.jsx("div",Object.assign({style:{height:e.maintainAspectRatio?void 0:null!==(u=e.graphCanvasHeight)&&void 0!==u?u:500}},{children:t.jsx(o.Bar,{options:y,data:S})}))]}))};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@emotion/styled/base"),r=require("react/jsx-runtime"),i=require("../../../../utils/StringUtils.js"),t=require("../../../../constants/Theme.js");require("../../../../constants/zindex.js");var s=require("react");require("../../../checkBox/CheckBox.styled.js");var g=require("../../../TypographyStyle.js");require("../../../list-item/ListItem.js"),require("../../../pagination/Pagination.js"),require("../../../radioButton/RadioButton.styled.js"),require("react-dom"),require("react-toastify"),require("../../../toaster/Toaster.styled.js"),require("../../../tooltips/Tooltip.js"),require("../../../spinner/Spinner.js"),require("../../../stepper/Stepper.styled.js"),require("../../../tag/Tag.js"),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("../../../template-preview/models/TemplateMeta.js"),require("../../../template-preview/models/WhatsAppTemplate.js"),require("../../../modals/styledModal.js"),require("../../../template-preview/models/Channels.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("../../../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("../../../button/Button.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("../../../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("react-calendar"),require("../../../../utils/DateUtils.js"),require("../../../datePicker/DatePickerWrapper.styled.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("../../../datePicker/DatePicker.styled.js"),require("../../AnalyticsMetric.js"),require("../LineChart/LineChart.js"),require("../linearChipGroupedChart/LinearChipGroupedChart.styled.js");var I=require("./PieChart.js");require("../HorizontalBarGraph/HorizontalGraph.js"),require("../StackedBarChart/StackedBarChart.js"),require("../StackedBarChart/StackedBarDistributionChart.js"),require("../VerticalBarGraph/VerticalGraph.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("../../../../_virtual/_tslib.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("../../../discount-modal/DiscountModal.styled.js"),require("../../../discount-modal/DynamicCoupon/DynamicCoupon.js"),require("../../../discount-modal/CouponExpiration/CouponExpiration.js"),require("../../../country-code-picker/CountryCodePicker.styled.js"),require("../../../carousel/carousel.js"),require("../../../carousel-secondary/CarouselSecondary.style.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("../../../modals/modal.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("pure-react-carousel"),require("../../../carousel-preview/CarouselPreview.style.js"),require("../../../card-selector/CardSelector.styled.js");var C=require("chart.js"),o=require("react-chartjs-2");function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var a=c(e);C.Chart.register(C.ArcElement,C.Legend);const l={plugins:{legend:{display:!1},tooltip:{enabled:!0,callbacks:{label:e=>{if(!e.label)return" 0%";const r=e.dataset.data.reduce(((e,r)=>e+r),0),i=parseFloat((e.raw/r*100).toFixed(1));return` ${e.label}: ${i}%`}}}}},d=["#5E07BB","#9E77ED","#D2AEFF","#CDE1FF","#92AFFA","#3935E1"],u=a.default("div","production"===process.env.NODE_ENV?{target:"elaov7f0"}:{target:"elaov7f0",label:"CartStyled"})("background:",(e=>t.COLORS.surface.standard),";border:1px solid ",(e=>t.COLORS.stroke.primary),";border-radius:4px;"+("production"===process.env.NODE_ENV?"":"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIlBpZUNoYXJ0QW5hbHl0aWNzLnRze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zOiB7XHJcbiAgICAgICAgICAgICAgICBsYWJlbDogKHRvb2x0aXBJdGVtKSA9PiB7XHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKCF0b29sdGlwSXRlbS5sYWJlbCkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gYCAwJWA7XHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IHRvdGFsID0gdG9vbHRpcEl0ZW0uZGF0YXNldC5kYXRhLnJlZHVjZSgoYWNjLCBjdXIpID0+IGFjYyArIGN1ciwgMCk7XHJcbiAgICAgICAgICAgICAgICAgICAgY29uc3QgcGVyY2VudGFnZSA9IHBhcnNlRmxvYXQoKCh0b29sdGlwSXRlbS5yYXcgLyB0b3RhbCkgKiAxMDApLnRvRml4ZWQoMSkpO1xyXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBgICR7dG9vbHRpcEl0ZW0ubGFiZWx9OiAke3BlcmNlbnRhZ2V9JWA7XHJcbiAgICAgICAgICAgICAgICB9LFxyXG4gICAgICAgICAgICB9LFxyXG4gICAgICAgIH0sXHJcbiAgICB9LFxyXG59O1xyXG5jb25zdCBHUkFQSF9DT0xPUlMgPSBbXHJcbiAgICAnIzVFMDdCQicsXHJcbiAgICAnIzlFNzdFRCcsXHJcbiAgICAnI0QyQUVGRicsXHJcbiAgICAnI0NERTFGRicsXHJcbiAgICAnIzkyQUZGQScsXHJcbiAgICAnIzM5MzVFMScsXHJcbl07XHJcbmNvbnN0IENhcnRTdHlsZWQgPSBzdHlsZWQuZGl2IGBcblx0YmFja2dyb3VuZDogJHsocHJvcHMpID0+IENPTE9SUy5zdXJmYWNlLnN0YW5kYXJkfTtcblx0Ym9yZGVyOiAxcHggc29saWQgJHsocHJvcHMpID0+IENPTE9SUy5zdHJva2UucHJpbWFyeX07XG5cdGJvcmRlci1yYWRpdXM6IDRweDtcbmA7XHJcbmV4cG9ydCBjb25zdCBDYXJkID0gKHByb3B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wMF0sXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGJhY2tncm91bmRDb2xvcjogWycjRjBGMEYwJ10sXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGJvcmRlcldpZHRoOiAwLFxyXG4gICAgICAgICAgICAgICAgICAgIH0sXHJcbiAgICAgICAgICAgICAgICBdLFxyXG4gICAgICAgICAgICB9O1xyXG4gICAgICAgICAgICBzZXREYXRhKGRhdGFTZXQpO1xyXG4gICAgICAgIH1cclxuICAgICAgICBlbHNlIHtcclxuICAgICAgICAgICAgY29uc3QgZGF0YVNldCA9IHtcclxuICAgICAgICAgICAgICAgIGxhYmVsczogc2xpY2VzLm1hcCgoc2xpY2UpID0+IFN0cmluZ1V0aWxzLmNhcGl0YWxpemUoc2xpY2UubmFtZSkpLFxyXG4gICAgICAgICAgICAgICAgZGF0YXNldHM6IFtcclxuICAgICAgICAgICAgICAgICAgICB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGRhdGE6IHNsaWNlcy5tYXAoKHNsaWNlKSA9PiBzbGljZS5jb3VudCksXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGJhY2tncm91bmRDb2xvcjogc2xpY2VzLm1hcCgoc2xpY2UsIGluZGV4KSA9PiB7IHZhciBfYTsgcmV0dXJuIChfYSA9IHNsaWNlLmNvbG9yKSAhPT0gbnVsbCAmJiBfYSAhPT0gdm9pZCAwID8gX2EgOiBHUkFQSF9DT0xPUlNbaW5kZXggJSBHUkFQSF9DT0xPUlMubGVuZ3RoXTsgfSksXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGJvcmRlckNvbG9yOiBbJ3doaXRlJywgJ3doaXRlJywgJ3doaXRlJywgJ3doaXRlJywgJ3doaXRlJywgJ3doaXRlJ10sXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGJvcmRlcldpZHRoOiA0LFxyXG4gICAgICAgICAgICAgICAgICAgICAgICBib3JkZXJSYWRpdXM6IDgsXHJcbiAgICAgICAgICAgICAgICAgIC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Z24oeyBjbGFzc05hbWU6ICdjb2wtNicsIHN0eWxlOiB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYWRkaW5nTGVmdDogNDgsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkaXNwbGF5OiAnZmxleCcsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBmbGV4RGlyZWN0aW9uOiAnY29sdW1uJyxcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGp1c3RpZnlDb250ZW50OiAnY2VudGVyJyxcclxuICAgICAgICAgICAgICAgICAgICAgICAgfSB9LCB7IGNoaWxkcmVuOiBfanN4KFBpZUNoYXJ0LCB7IHNsaWNlczogc2xpY2VzV2l0aENvbG9yIH0pIH0pKV0gfSkpXSB9KSk7XHJcbn07XHJcbi8vIyBzb3VyY2VNYXBwaW5nVVJMPVBpZUNoYXJ0QW5hbHl0aWNzLmpzLm1hcCJdfQ== */"));exports.Card=e=>r.jsx(u,Object.assign({style:{padding:24}},{children:e.children})),exports.PieChartAnalytics=e=>{let{title:t,slices:C,size:c}=e;const[a,u]=s.useState([]),[A,n]=s.useState();return s.useEffect((()=>{const e=C.reduce(((e,r)=>e+r.count),0);let r=[];if(r=Object.keys(C).map(((e,r)=>Object.assign({color:d[r%d.length]},C[e]))),u([...r]),0===e){n({datasets:[{data:[100],backgroundColor:["#F0F0F0"],borderWidth:0}]})}else{const e={labels:C.map((e=>i.default.capitalize(e.name))),datasets:[{data:C.map((e=>e.count)),backgroundColor:C.map(((e,r)=>{var i;return null!==(i=e.color)&&void 0!==i?i:d[r%d.length]})),borderColor:["white","white","white","white","white","white"],borderWidth:4,borderRadius:8}]};n(e)}}),[C]),A?r.jsxs(r.Fragment,{children:[t&&r.jsx(g.TitleMedium,Object.assign({style:{marginBottom:16}},{children:t})),r.jsxs("div",Object.assign({className:"row"},{children:[r.jsx("div",Object.assign({className:"col-6"},{children:r.jsx("div",Object.assign({style:{width:c,height:c}},{children:r.jsx(o.Doughnut,{data:A,options:Object.assign(Object.assign({},l),{maintainAspectRatio:!c})})}))})),r.jsx("div",Object.assign({className:"col-6",style:{paddingLeft:48,display:"flex",flexDirection:"column",justifyContent:"center"}},{children:r.jsx(I.PieChart,{slices:a})}))]}))]}):r.jsx(r.Fragment,{})};
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@emotion/styled/base"),r=require("react/jsx-runtime"),i=require("../../../../utils/StringUtils.js"),t=require("../../../../constants/Theme.js");require("../../../../constants/zindex.js");var s=require("react");require("../../../checkBox/CheckBox.styled.js");var g=require("../../../TypographyStyle.js");require("../../../list-item/ListItem.js"),require("../../../pagination/Pagination.js"),require("../../../radioButton/RadioButton.styled.js"),require("react-dom"),require("react-toastify"),require("../../../toaster/Toaster.styled.js"),require("../../../tooltips/Tooltip.js"),require("../../../spinner/Spinner.js"),require("../../../stepper/Stepper.styled.js"),require("../../../tag/Tag.js"),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("../../../template-preview/models/TemplateMeta.js"),require("../../../template-preview/models/WhatsAppTemplate.js"),require("../../../modals/styledModal.js"),require("../../../template-preview/models/Channels.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("../../../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("../../../button/Button.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("../../../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("react-calendar"),require("../../../../utils/DateUtils.js"),require("../../../datePicker/DatePickerWrapper.styled.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("../../../datePicker/DatePicker.styled.js"),require("../../AnalyticsMetric.js"),require("../LineChart/LineChart.js"),require("../linearChipGroupedChart/LinearChipGroupedChart.styled.js");var I=require("./PieChart.js");require("../HorizontalBarGraph/HorizontalGraph.js"),require("../StackedBarChart/StackedBarChart.js"),require("../StackedBarChart/StackedBarDistributionChart.js"),require("../StackedBarChart/StackedBarDistributionChart.model.js"),require("../VerticalBarGraph/VerticalGraph.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("../../../../_virtual/_tslib.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("../../../discount-modal/DiscountModal.styled.js"),require("../../../discount-modal/DynamicCoupon/DynamicCoupon.js"),require("../../../discount-modal/CouponExpiration/CouponExpiration.js"),require("../../../country-code-picker/CountryCodePicker.styled.js"),require("../../../carousel/carousel.js"),require("../../../carousel-secondary/CarouselSecondary.style.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("../../../modals/modal.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("pure-react-carousel"),require("../../../carousel-preview/CarouselPreview.style.js"),require("../../../card-selector/CardSelector.styled.js");var C=require("chart.js"),o=require("react-chartjs-2");function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var a=c(e);C.Chart.register(C.ArcElement,C.Legend);const l={plugins:{legend:{display:!1},tooltip:{enabled:!0,callbacks:{label:e=>{if(!e.label)return" 0%";const r=e.dataset.data.reduce(((e,r)=>e+r),0),i=parseFloat((e.raw/r*100).toFixed(1));return` ${e.label}: ${i}%`}}}}},d=["#5E07BB","#9E77ED","#D2AEFF","#CDE1FF","#92AFFA","#3935E1"],u=a.default("div","production"===process.env.NODE_ENV?{target:"elaov7f0"}:{target:"elaov7f0",label:"CartStyled"})("background:",(e=>t.COLORS.surface.standard),";border:1px solid ",(e=>t.COLORS.stroke.primary),";border-radius:4px;"+("production"===process.env.NODE_ENV?"":"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpb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ZSxcclxuICAgICAgICAgICAgY2FsbGJhY2tzOiB7XHJcbiAgICAgICAgICAgICAgICBsYWJlbDogKHRvb2x0aXBJdGVtKSA9PiB7XHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKCF0b29sdGlwSXRlbS5sYWJlbCkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gYCAwJWA7XHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IHRvdGFsID0gdG9vbHRpcEl0ZW0uZGF0YXNldC5kYXRhLnJlZHVjZSgoYWNjLCBjdXIpID0+IGFjYyArIGN1ciwgMCk7XHJcbiAgICAgICAgICAgICAgICAgICAgY29uc3QgcGVyY2VudGFnZSA9IHBhcnNlRmxvYXQoKCh0b29sdGlwSXRlbS5yYXcgLyB0b3RhbCkgKiAxMDApLnRvRml4ZWQoMSkpO1xyXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBgICR7dG9vbHRpcEl0ZW0ubGFiZWx9OiAke3BlcmNlbnRhZ2V9JWA7XHJcbiAgICAgICAgICAgICAgICB9LFxyXG4gICAgICAgICAgICB9LFxyXG4gICAgICAgIH0sXHJcbiAgICB9LFxyXG59O1xyXG5jb25zdCBHUkFQSF9DT0xPUlMgPSBbXHJcbiAgICAnIzVFMDdCQicsXHJcbiAgICAnIzlFNzdFRCcsXHJcbiAgICAnI0QyQUVGRicsXHJcbiAgICAnI0NERTFGRicsXHJcbiAgICAnIzkyQUZGQScsXHJcbiAgICAnIzM5MzVFMScsXHJcbl07XHJcbmNvbnN0IENhcnRTdHlsZWQgPSBzdHlsZWQuZGl2IGBcblx0YmFja2dyb3VuZDogJHsocHJvcHMpID0+IENPTE9SUy5zdXJmYWNlLnN0YW5kYXJkfTtcblx0Ym9yZGVyOiAxcHggc29saWQgJHsocHJvcHMpID0+IENPTE9SUy5zdHJva2UucHJpbWFyeX07XG5cdGJvcmRlci1yYWRpdXM6IDRweDtcbmA7XHJcbm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AgICAgICAgICAgICAgICAgICAgZGF0YTogWzEwMF0sXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGJhY2tncm91bmRDb2xvcjogWycjRjBGMEYwJ10sXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGJvcmRlcldpZHRoOiAwLFxyXG4gICAgICAgICAgICAgICAgICAgIH0sXHJcbiAgICAgICAgICAgICAgICBdLFxyXG4gICAgICAgICAgICB9O1xyXG4gICAgICAgICAgICBzZXREYXRhKGRhdGFTZXQpO1xyXG4gICAgICAgIH1cclxuICAgICAgICBlbHNlIHtcclxuICAgICAgICAgICAgY29uc3QgZGF0YVNldCA9IHtcclxuICAgICAgICAgICAgICAgIGxhYmVsczogc2xpY2VzLm1hcCgoc2xpY2UpID0+IFN0cmluZ1V0aWxzLmNhcGl0YWxpemUoc2xpY2UubmFtZSkpLFxyXG4gICAgICAgICAgICAgICAgZGF0YXNldHM6IFtcclxuICAgICAgICAgICAgICAgICAgICB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGRhdGE6IHNsaWNlcy5tYXAoKHNsaWNlKSA9PiBzbGljZS5jb3VudCksXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGJhY2tncm91bmRDb2xvcjogc2xpY2VzLm1hcCgoc2xpY2UsIGluZGV4KSA9PiB7IHZhciBfYTsgcmV0dXJuIChfYSA9IHNsaWNlLmNvbG9yKSAhPT0gbnVsbCAmJiBfYSAhPT0gdm9pZCAwID8gX2EgOiBHUkFQSF9DT0xPUlNbaW5kZXggJSBHUkFQSF9DT0xPUlMubGVuZ3RoXTsgfSksXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGJvcmRlckNvbG9yOiBbJ3doaXRlJywgJ3doaXRlJywgJ3doaXRlJywgJ3doaXRlJywgJ3doaXRlJywgJ3doaXRlJ10sXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGJvcmRlcldpZHRoOiA0LFxyXG4gICAgICAgICAgICAgICAgICAgICAgICBib3JkZXJSYWRpdX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anN4KFwiZGl2XCIsIE9iamVjdC5hc3NpZ24oeyBjbGFzc05hbWU6ICdjb2wtNicsIHN0eWxlOiB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYWRkaW5nTGVmdDogNDgsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkaXNwbGF5OiAnZmxleCcsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBmbGV4RGlyZWN0aW9uOiAnY29sdW1uJyxcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGp1c3RpZnlDb250ZW50OiAnY2VudGVyJyxcclxuICAgICAgICAgICAgICAgICAgICAgICAgfSB9LCB7IGNoaWxkcmVuOiBfanN4KFBpZUNoYXJ0LCB7IHNsaWNlczogc2xpY2VzV2l0aENvbG9yIH0pIH0pKV0gfSkpXSB9KSk7XHJcbn07XHJcbi8vIyBzb3VyY2VNYXBwaW5nVVJMPVBpZUNoYXJ0QW5hbHl0aWNzLmpzLm1hcCJdfQ== */"));exports.Card=e=>r.jsx(u,Object.assign({style:{padding:24}},{children:e.children})),exports.PieChartAnalytics=e=>{let{title:t,slices:C,size:c}=e;const[a,u]=s.useState([]),[A,n]=s.useState();return s.useEffect((()=>{const e=C.reduce(((e,r)=>e+r.count),0);let r=[];if(r=Object.keys(C).map(((e,r)=>Object.assign({color:d[r%d.length]},C[e]))),u([...r]),0===e){n({datasets:[{data:[100],backgroundColor:["#F0F0F0"],borderWidth:0}]})}else{const e={labels:C.map((e=>i.default.capitalize(e.name))),datasets:[{data:C.map((e=>e.count)),backgroundColor:C.map(((e,r)=>{var i;return null!==(i=e.color)&&void 0!==i?i:d[r%d.length]})),borderColor:["white","white","white","white","white","white"],borderWidth:4,borderRadius:8}]};n(e)}}),[C]),A?r.jsxs(r.Fragment,{children:[t&&r.jsx(g.TitleMedium,Object.assign({style:{marginBottom:16}},{children:t})),r.jsxs("div",Object.assign({className:"row"},{children:[r.jsx("div",Object.assign({className:"col-6"},{children:r.jsx("div",Object.assign({style:{width:c,height:c}},{children:r.jsx(o.Doughnut,{data:A,options:Object.assign(Object.assign({},l),{maintainAspectRatio:!c})})}))})),r.jsx("div",Object.assign({className:"col-6",style:{paddingLeft:48,display:"flex",flexDirection:"column",justifyContent:"center"}},{children:r.jsx(I.PieChart,{slices:a})}))]}))]}):r.jsx(r.Fragment,{})};
|
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
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("chart.js"),o=require("chartjs-plugin-datalabels"),i=require("react-chartjs-2"),a=require("../../../TypographyStyle.js"),l=require("../../../../constants/Theme.js"),n=require("../utils/calcPercentage.js"),s=require("./StackedBarChart.model.js"),r=require("./StackedBarChart.styles.js");function d(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var c=d(o);t.Chart.register(t.CategoryScale,t.LinearScale,t.BarElement,t.Tooltip,t.Legend,c.default);exports.StackedBarChart=t=>{var o,d,c,O,u,A,v,x,g,T,p,R,y,N,I,b,C,h,S,E,H,k,f,F,L,j,m,_,P,G,Z,z,B,D,q;const w=0===t.yAxis.data.length,V=t.colorSchema===s.COLOR_SCHEMA.PASTEL?["#E6C7FF","#FEC6C6","#FEDEF3","#DEEFFF","#FFD8B1","#C7E5FF","#FFD3E6","#C9FFE5","#FFE3C7","#D9D9FF"]:["#5E07BB","#9E77ED","#D2AEFF","#F7D7FF","#CDE1FF","#92AFFA","#3935E1"],W={barPercentage:.4,categoryPercentage:1,pointStyle:"circle",barWidth:t.barWidth},K={};t.yAxis.data.map((e=>{e.map((e=>{K[e.name]?K[e.name].push(e.value):K[e.name]=[e.value]}))}));const M=Object.keys(K).map(((e,t)=>Object.assign({label:e,data:K[e],backgroundColor:V[t]},W))),Y={plugins:{legend:{display:!w&&!t.customLegend,labels:{usePointStyle:!0,fontSize:2}},tooltip:{enabled:!w,callbacks:{label:null===(o=t.tooltipConfig)||void 0===o?void 0:o.labelCallback,footer:null===(d=t.tooltipConfig)||void 0===d?void 0:d.footerCallback},footerFont:null===(O=null===(c=t.tooltipConfig)||void 0===c?void 0:c.footerStyles)||void 0===O?void 0:O.footerFont},datalabels:{display:null!==(u=t.showTotal)&&void 0!==u&&u,anchor:"end",align:"end",clamp:!0,formatter:(e,t)=>{var o;const i=t.datasetIndex,a=t.chart.data.datasets;if(i!==a.length-1)return"";const l=t.dataIndex;let n=0;for(let e=0;e<a.length;e++)n+=null!==(o=a[e].data[l])&&void 0!==o?o:0;return n?n<1e3?n:(n/1e3).toString().substring(0,4)+"k":""},color:l.COLORS.content.secondary}},layout:{padding:{right:t.showTotal&&t.orientation===s.GRAPH_ORIENTATION.HORIZONTAL?50:0,top:t.showTotal&&t.orientation!=s.GRAPH_ORIENTATION.HORIZONTAL?50:0}},responsive:!0,maintainAspectRatio:!1,legend:{display:!t.customLegend,labels:{usePointStyle:!0}},indexAxis:t.orientation===s.GRAPH_ORIENTATION.HORIZONTAL?"y":"x",scales:{x:{title:{display:!!(t.orientation===s.GRAPH_ORIENTATION.HORIZONTAL?null===(A=t.yAxis)||void 0===A?void 0:A.title:null===(v=t.xAxis)||void 0===v?void 0:v.title),text:t.orientation===s.GRAPH_ORIENTATION.HORIZONTAL?null===(x=t.yAxis)||void 0===x?void 0:x.title:null===(g=t.xAxis)||void 0===g?void 0:g.title,color:null!==(R=t.orientation===s.GRAPH_ORIENTATION.HORIZONTAL?null===(T=t.yAxis)||void 0===T?void 0:T.titleColor:null===(p=t.xAxis)||void 0===p?void 0:p.titleColor)&&void 0!==R?R:l.COLORS.content.secondary,font:{size:l.FONTS.caption.fontSize}},grid:{display:t.orientation===s.GRAPH_ORIENTATION.HORIZONTAL,color:l.COLORS.background.base},ticks:{fontSize:l.FONTS.caption.fontSize,color:null!==(y=t.yAxis.labelColor)&&void 0!==y?y:l.COLORS.content.secondary,callback:t.orientation===s.GRAPH_ORIENTATION.HORIZONTAL?n.truncateValueToK:void 0},stacked:t.orientation===s.GRAPH_ORIENTATION.HORIZONTAL?"boolean"!=typeof(null===(N=t.yAxis)||void 0===N?void 0:N.stacked)||(null===(I=t.yAxis)||void 0===I?void 0:I.stacked):"boolean"!=typeof(null===(b=t.xAxis)||void 0===b?void 0:b.stacked)||(null===(C=t.xAxis)||void 0===C?void 0:C.stacked)},y:{title:{display:!!(t.orientation===s.GRAPH_ORIENTATION.HORIZONTAL?null===(h=t.xAxis)||void 0===h?void 0:h.title:null===(S=t.yAxis)||void 0===S?void 0:S.title),text:t.orientation===s.GRAPH_ORIENTATION.HORIZONTAL?null===(E=t.xAxis)||void 0===E?void 0:E.title:null===(H=t.yAxis)||void 0===H?void 0:H.title,color:null!==(F=t.orientation===s.GRAPH_ORIENTATION.HORIZONTAL?null===(k=t.xAxis)||void 0===k?void 0:k.titleColor:null===(f=t.yAxis)||void 0===f?void 0:f.titleColor)&&void 0!==F?F:l.COLORS.content.secondary,font:{size:l.FONTS.caption.fontSize}},grid:{display:t.orientation!==s.GRAPH_ORIENTATION.HORIZONTAL,color:l.COLORS.background.base},ticks:Object.assign(Object.assign({stepSize:t.orientation===s.GRAPH_ORIENTATION.HORIZONTAL?null===(L=t.xAxis)||void 0===L?void 0:L.stepSize:null===(j=t.yAxis)||void 0===j?void 0:j.stepSize,fontSize:l.FONTS.caption.fontSize,color:null!==(m=t.xAxis.labelColor)&&void 0!==m?m:l.COLORS.content.secondary},w?{min:0,max:2e3,stepSize:200}:{}),{callback:t.orientation!==s.GRAPH_ORIENTATION.VERTICAL?n.truncateValueToK:void 0}),stacked:t.orientation===s.GRAPH_ORIENTATION.HORIZONTAL?"boolean"!=typeof(null===(_=t.xAxis)||void 0===_?void 0:_.stacked)||(null===(P=t.xAxis)||void 0===P?void 0:P.stacked):"boolean"!=typeof(null===(G=t.yAxis)||void 0===G?void 0:G.stacked)||(null===(Z=t.yAxis)||void 0===Z?void 0:Z.stacked)}},onClick:(e,o)=>{if(!t.onBarClick)return;const i=o[0].datasetIndex,a=o[0].index,l=e.chart.data.datasets[i].label,n=e.chart.data.labels[a];t.onBarClick(n,l)},onHover:(e,o)=>{t.onBarClick&&o.length&&(e.native.target.style.cursor="pointer")}};t.orientation&&t.orientation!==s.GRAPH_ORIENTATION.VERTICAL?delete Y.scales.y.ticks.callback:delete Y.scales.x.ticks.callback;const J={labels:t.xAxis.data.map((e=>"string"==typeof e?e:e.name)),datasets:w?[{data:[250,1e3,800,1500,300,600],backgroundColor:"rgba(0,0,0,0)"}]:M};return e.jsxs(r.GraphContainerWrapper,Object.assign({style:null!==(z=t.wrapperStyle)&&void 0!==z?z:{},padding:t.outerPadding,customLegend:t.customLegend},{children:[t.chartHeading&&e.jsx("div",Object.assign({style:{marginBottom:24}},{children:e.jsx(a.TitleRegular,Object.assign({color:null!==(B=t.chartHeading.color)&&void 0!==B?B:l.COLORS.content.secondary},{children:t.chartHeading.heading}))})),t.customLegend&&e.jsx("div",Object.assign({style:{overflowY:"scroll",display:"flex",flexDirection:"row",gap:"10px",padding:"24px"}},{children:M.map((t=>e.jsxs("div",Object.assign({className:"legend__row"},{children:[e.jsx("div",{className:"legend__palette",style:{backgroundColor:t.backgroundColor}}),e.jsx(a.BodyTiny,Object.assign({color:l.COLORS.content.secondary},{children:t.label}))]}),t.label.replace(" ","_"))))})),e.jsx("div",Object.assign({className:"graph__wrapper"},{children:e.jsx("div",Object.assign({style:{height:null!==(D=t.graphCanvasHeight)&&void 0!==D?D:500,width:null!==(q=t.graphCanvasWidth)&&void 0!==q?q:"auto"}},{children:e.jsx(i.Bar,{options:Y,data:J})}))}))]}))};
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { FontSpec, TooltipItem } from 'chart.js';
|
|
1
3
|
export interface AxisDetailsI {
|
|
2
4
|
title?: string;
|
|
3
5
|
titleColor?: string;
|
|
@@ -29,7 +31,8 @@ export declare enum GRAPH_ORIENTATION {
|
|
|
29
31
|
HORIZONTAL = "horizontal"
|
|
30
32
|
}
|
|
31
33
|
export interface StackedBarGraphI {
|
|
32
|
-
graphCanvasHeight?: number;
|
|
34
|
+
graphCanvasHeight?: number | string;
|
|
35
|
+
graphCanvasWidth?: string;
|
|
33
36
|
tickColor?: string;
|
|
34
37
|
labelColor?: string;
|
|
35
38
|
chartHeading?: ChartHeadingI;
|
|
@@ -41,4 +44,15 @@ export interface StackedBarGraphI {
|
|
|
41
44
|
colorSchema?: COLOR_SCHEMA;
|
|
42
45
|
orientation?: GRAPH_ORIENTATION;
|
|
43
46
|
barWidth?: number;
|
|
47
|
+
wrapperStyle?: React.CSSProperties;
|
|
48
|
+
customLegend?: boolean;
|
|
49
|
+
showTotal?: boolean;
|
|
50
|
+
tooltipConfig?: {
|
|
51
|
+
titleCallback?: (toolTipItems: TooltipItem<'bar'>[]) => string | string[];
|
|
52
|
+
labelCallback?: (toolTipItem: TooltipItem<'bar'>) => string | string[];
|
|
53
|
+
footerCallback?: (toolTipItems: TooltipItem<'bar'>[]) => string | string[];
|
|
54
|
+
footerStyles?: {
|
|
55
|
+
footerFont?: Partial<FontSpec>;
|
|
56
|
+
};
|
|
57
|
+
};
|
|
44
58
|
}
|
|
@@ -1,12 +1,15 @@
|
|
|
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
|
|
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: ${e=>{var r;return null!==(r=e.padding)&&void 0!==r?r:"24px"}};
|
|
4
4
|
border: none;
|
|
5
|
+
width: 100%;
|
|
5
6
|
|
|
6
7
|
.graph__wrapper {
|
|
7
8
|
width: 100%;
|
|
8
9
|
display: flex;
|
|
9
10
|
gap: 24px;
|
|
11
|
+
height: ${e=>{var r;return null!==(r=e.chartWrapperHeight)&&void 0!==r?r:"100%"}};
|
|
12
|
+
flex-direction: ${e=>e.isFunnel||e.customLegend?"column":"row"};
|
|
10
13
|
}
|
|
11
14
|
|
|
12
15
|
.legend__palette {
|
|
@@ -25,4 +28,4 @@
|
|
|
25
28
|
.legend__set {
|
|
26
29
|
margin-top: 16px;
|
|
27
30
|
}
|
|
28
|
-
`;exports.GraphContainerWrapper=
|
|
31
|
+
`;exports.GraphContainerWrapper=n;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),l=require("chart.js"),a=require("chartjs-plugin-datalabels"),t=require("react"),o=require("react-chartjs-2"),i=require("../../../TypographyStyle.js"),n=require("../../../../constants/Theme.js"),r=require("./StackedBarChart.styles.js"),s=require("./StackedBarDistributionChart.model.js");function d(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var c=d(a);l.Chart.register(l.CategoryScale,l.LinearScale,l.BarElement,l.Tooltip,l.Legend,c.default),l.Chart.defaults.plugins.datalabels.display=!1;exports.StackedBarDistributionChart=l=>{var a,d,c,u,O,v,g,T,b,h,p,A,R,N,I,y,C,f,j,S,x,H,F,E,_,L,m,k,P,G,Z,D;const[w,B]=t.useState([]),[z,q]=t.useState(),M=!l.data.filter((e=>!!e.value)).length,W=l.colorMatrix&&l.colorMatrix.length?l.colorMatrix:[["#09A35B","#33D2A1","#A8E5C0","#075E54","#128C7E","#25D366","#DCF8C6"],["#FC4183","#FCA0C2","#FEE3EF","#F5016C","#F972AD","#FCAACE","#FEE3EF"],["#1B95D6","#74B2E5","#A0D1F1","#0078D5","#55A5E3","#8EC3EC","#C6E1F6"],["#FF4F52","#FFA3A4","#FFD9DA","#FF0012","#FF797D","#FFC4C5","#F9DFDF"]],V={min:0,max:200,stepSize:20},Y={min:l.minValue,max:l.maxValue,stepSize:l.valuesStepSize},U={barPercentage:.4,categoryPercentage:1,pointStyle:"circle",barThickness:M?0:null!==(a=l.barThickness)&&void 0!==a?a:100},$={plugins:{legend:{display:!1},tooltip:{enabled:!M,callbacks:{label:null===(d=l.tooltipConfig)||void 0===d?void 0:d.labelCallback,footer:null===(c=l.tooltipConfig)||void 0===c?void 0:c.footerCallback},footerFont:null===(O=null===(u=l.tooltipConfig)||void 0===u?void 0:u.footerStyles)||void 0===O?void 0:O.footerFont},datalabels:{display:null!==(v=!M&&l.showTotal)&&void 0!==v&&v,anchor:"end",align:"end",clamp:!0,formatter:(e,l)=>{var a;const t=l.datasetIndex,o=l.chart.data.datasets;if(t!==o.length-1)return"";const i=l.dataIndex;let n=0;for(let e=0;e<o.length;e++)n+=null!==(a=o[e].data[i])&&void 0!==a?a:0;return n?n<1e3?n:(n/1e3).toString().substring(0,4)+"k":""},color:n.COLORS.content.secondary}},responsive:!0,maintainAspectRatio:!1,legend:{display:!1},indexAxis:l.orientation===s.GRAPH_ORIENTATION.HORIZONTAL?"y":"x",layout:{padding:{right:l.showTotal&&l.orientation===s.GRAPH_ORIENTATION.HORIZONTAL?50:0,top:l.showTotal&&l.orientation!=s.GRAPH_ORIENTATION.HORIZONTAL?25:0}},scales:{x:{title:{display:!!(l.orientation===s.GRAPH_ORIENTATION.HORIZONTAL?null===(g=l.valueTitle)||void 0===g?void 0:g.heading:null===(T=l.labelTitle)||void 0===T?void 0:T.heading),text:l.orientation===s.GRAPH_ORIENTATION.HORIZONTAL?null===(b=l.valueTitle)||void 0===b?void 0:b.heading:null===(h=l.labelTitle)||void 0===h?void 0:h.heading,color:null!==(R=l.orientation===s.GRAPH_ORIENTATION.HORIZONTAL?null===(p=l.valueTitle)||void 0===p?void 0:p.color:null===(A=l.labelTitle)||void 0===A?void 0:A.color)&&void 0!==R?R:n.COLORS.content.secondary,font:{size:n.FONTS.bodySecondary.fontSize}},grid:{display:l.orientation===s.GRAPH_ORIENTATION.HORIZONTAL,color:n.COLORS.background.base},ticks:Object.assign(Object.assign({stepSize:30,fontSize:n.FONTS.caption.fontSize,color:null!==(y=l.orientation===s.GRAPH_ORIENTATION.HORIZONTAL?null===(N=l.labelTitle)||void 0===N?void 0:N.color:null===(I=l.valueTitle)||void 0===I?void 0:I.color)&&void 0!==y?y:n.COLORS.content.secondary},l.orientation===s.GRAPH_ORIENTATION.HORIZONTAL?M?V:Y:{}),{callback:(e,a)=>{var t,o;return l.orientation!==s.GRAPH_ORIENTATION.HORIZONTAL?null!==(o=null===(t=null==z?void 0:z.labels)||void 0===t?void 0:t[a])&&void 0!==o?o:"":"number"!=typeof e||e<1e3?e:(e/1e3).toString().substring(0,4)+"k"}}),stacked:!0},y:{title:{display:!!(l.orientation===s.GRAPH_ORIENTATION.HORIZONTAL?null===(C=l.labelTitle)||void 0===C?void 0:C.heading:null===(f=l.valueTitle)||void 0===f?void 0:f.heading),text:l.orientation===s.GRAPH_ORIENTATION.HORIZONTAL?null===(j=l.labelTitle)||void 0===j?void 0:j.heading:null===(S=l.valueTitle)||void 0===S?void 0:S.heading,color:null!==(F=l.orientation===s.GRAPH_ORIENTATION.HORIZONTAL?null===(x=l.labelTitle)||void 0===x?void 0:x.color:null===(H=l.valueTitle)||void 0===H?void 0:H.color)&&void 0!==F?F:n.COLORS.content.secondary,font:{size:n.FONTS.bodySecondary.fontSize}},grid:{display:l.orientation!==s.GRAPH_ORIENTATION.HORIZONTAL,color:n.COLORS.background.base},ticks:Object.assign(Object.assign({fontSize:n.FONTS.caption.fontSize,color:null!==(L=l.orientation===s.GRAPH_ORIENTATION.HORIZONTAL?null===(E=l.valueTitle)||void 0===E?void 0:E.color:null===(_=l.labelTitle)||void 0===_?void 0:_.color)&&void 0!==L?L:n.COLORS.content.secondary},l.orientation===s.GRAPH_ORIENTATION.HORIZONTAL?{}:M?V:Y),{callback:(e,a)=>{var t,o;return l.orientation===s.GRAPH_ORIENTATION.HORIZONTAL?null!==(o=null===(t=null==z?void 0:z.labels)||void 0===t?void 0:t[a])&&void 0!==o?o:"":"number"!=typeof e||e<1e3?e:(e/1e3).toString().substring(0,2)+"k"}}),stacked:!0}},onClick:(e,a)=>{if(!l.onBarClick)return;const t=a[0].datasetIndex,o=a[0].index,i=e.chart.data.datasets[t].label,n=e.chart.data.labels[o];l.onBarClick(n,i)},onHover:(e,a)=>{l.onBarClick&&a.length&&(e.native.target.style.cursor="pointer")}},J=Array.from(new Set(l.data.map((e=>e.label)))),K={labels:(Q=J,Q.map((e=>e.length>0?e.charAt(0).toUpperCase()+e.slice(1):e))),datasets:M?[{data:[10,20,30,40,50,60,80,100,120],backgroundColor:"rgba(0,0,0,0)"}]:[]};var Q;t.useEffect((()=>{const e=[];J.forEach(((a,t)=>{const o=[],i=l.data.filter((e=>e.label===a));l.isFunnel||i.sort(((e,l)=>l.value-e.value)),i.forEach(((e,l)=>{const a=((e,l,a)=>W[e].slice(-a)[l])(t,l,i.length);o.push({color:a,label:e.stackLabel});const n=Object.assign({label:e.stackLabel,backgroundColor:a,data:Array(J.length).fill(0)},U);n.data[t]=e.value,K.datasets.push(n)})),e.push(o)})),B(e),q(K)}),[l.data]);const X=t.useCallback((()=>e.jsx("div",Object.assign({style:{overflowY:"scroll",display:"flex",flexDirection:"row",gap:"10px"}},{children:ee().map((l=>e.jsxs("div",Object.assign({className:"legend__row"},{children:[e.jsx("div",{className:"legend__palette",style:{backgroundColor:l.color}}),e.jsx(i.BodyTiny,Object.assign({color:n.COLORS.content.secondary},{children:l.label}))]}),l.label.replace(" ","_"))))}))),[w]),ee=()=>{const e=[];return w.forEach(((l,a)=>{e.push({color:l[0].color,label:J[a]})})),e};if(!z)return e.jsx(e.Fragment,{});return e.jsxs(r.GraphContainerWrapper,Object.assign({style:null!==(m=l.wrapperStyle)&&void 0!==m?m:{},padding:l.outerPadding,chartWrapperHeight:l.chartWrapperHeight,isFunnel:l.isFunnel},{children:[l.chartHeading&&e.jsx("div",Object.assign({style:{marginBottom:24}},{children:e.jsx(i.TitleRegular,Object.assign({color:null!==(k=l.chartHeading.color)&&void 0!==k?k:n.COLORS.content.secondary},{children:l.chartHeading.heading}))})),e.jsxs("div",Object.assign({className:"graph__wrapper"},{children:[(null===(P=l.showLegend)||void 0===P||P)&&l.isFunnel&&X(),e.jsx("div",Object.assign({style:{height:null!==(G=l.graphCanvasHeight)&&void 0!==G?G:500,width:null!==(Z=l.graphCanvasWidth)&&void 0!==Z?Z:"100%",flex:1}},{children:e.jsx(o.Bar,{options:$,data:z})})),(null===(D=l.showLegend)||void 0===D||D)&&!l.isFunnel&&e.jsx("div",Object.assign({style:{overflowY:"scroll",display:"flex",flexDirection:"column"}},{children:w.map(((l,a)=>e.jsx("div",Object.assign({className:"legend__set"},{children:l.map((l=>e.jsxs("div",Object.assign({className:"legend__row"},{children:[e.jsx("div",{className:"legend__palette",style:{backgroundColor:l.color}}),e.jsx(i.BodyTiny,Object.assign({color:n.COLORS.content.secondary},{children:l.label}))]}),l.label.replace(" ","_"))))}),`Legend_set_${a}`)))}))]}))]}))};
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { FontSpec, TooltipItem } from 'chart.js';
|
|
1
3
|
export interface ChartHeadingI {
|
|
2
4
|
heading: string;
|
|
3
5
|
color?: string;
|
|
@@ -6,13 +8,14 @@ export declare enum GRAPH_ORIENTATION {
|
|
|
6
8
|
VERTICAL = "vertical",
|
|
7
9
|
HORIZONTAL = "horizontal"
|
|
8
10
|
}
|
|
9
|
-
interface StackedBarDistributionGraphDataI {
|
|
11
|
+
export interface StackedBarDistributionGraphDataI {
|
|
10
12
|
label: string;
|
|
11
13
|
value: number;
|
|
12
14
|
stackLabel: string;
|
|
13
15
|
}
|
|
14
16
|
export interface StackedBarDistributionGraphI {
|
|
15
|
-
graphCanvasHeight?: number;
|
|
17
|
+
graphCanvasHeight?: number | string;
|
|
18
|
+
graphCanvasWidth?: string;
|
|
16
19
|
tickColor?: string;
|
|
17
20
|
labelColor?: string;
|
|
18
21
|
chartHeading?: ChartHeadingI;
|
|
@@ -26,5 +29,19 @@ export interface StackedBarDistributionGraphI {
|
|
|
26
29
|
valuesStepSize?: number;
|
|
27
30
|
minValue?: number;
|
|
28
31
|
maxValue?: number;
|
|
32
|
+
chartWrapperHeight?: string;
|
|
33
|
+
showLegend?: boolean;
|
|
34
|
+
isFunnel?: boolean;
|
|
35
|
+
colorMatrix?: string[][];
|
|
36
|
+
wrapperStyle?: React.CSSProperties;
|
|
37
|
+
showTotal?: boolean;
|
|
38
|
+
skipSortingByLabels?: boolean;
|
|
39
|
+
tooltipConfig?: {
|
|
40
|
+
titleCallback?: (toolTipItems: TooltipItem<'bar'>[]) => string | string[];
|
|
41
|
+
labelCallback?: (toolTipItem: TooltipItem<'bar'>) => string | string[];
|
|
42
|
+
footerCallback?: (toolTipItems: TooltipItem<'bar'>[]) => string | string[];
|
|
43
|
+
footerStyles?: {
|
|
44
|
+
footerFont?: Partial<FontSpec>;
|
|
45
|
+
};
|
|
46
|
+
};
|
|
29
47
|
}
|
|
30
|
-
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0})
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.calculatePercentage=function(e,t,r){const n=e+t+r;return[e/n*100||0,t/n*100||0,r/n*100||0]},exports.truncateValueToK=e=>e<1e3?e.toString():(e/1e3).toString().substring(0,4)+"k";
|
|
@@ -10,7 +10,9 @@ export * from './chart/Pie/PieChart';
|
|
|
10
10
|
export * from './chart/HorizontalBarGraph/HorizontalGraph';
|
|
11
11
|
export * from './chart/StackedBarChart/StackedBarChart';
|
|
12
12
|
export * from './chart/StackedBarChart/StackedBarDistributionChart';
|
|
13
|
+
export * from './chart/StackedBarChart/StackedBarDistributionChart.model';
|
|
13
14
|
export * from './chart/VerticalBarGraph/VerticalGraph';
|
|
14
15
|
export * from './chart/heatmap/HeatMap';
|
|
15
16
|
export * from './chart/heatmap/HeatMapVertical';
|
|
16
17
|
export * from './chart/VerticalBarAndLinearGraph/VerticalBarAndLinearGraph';
|
|
18
|
+
export * from './chart/utils/calcPercentage';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../_virtual/_tslib.js"),t=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../_virtual/_tslib.js"),t=require("react/jsx-runtime"),r=require("react"),n=require("../../constants/Theme.js"),o=require("../../assets/icons/chevronDown.svg.js"),i=require("../input/Input.js"),l=require("../input/context/InputStyleProvider.js"),s=require("./DropdownPopover/index.js");function a(){}const d=d=>{var u,c,p,{placeHolder:h,size:v,onSelect:g,defaultOptions:j,disabled:f,noErrorHint:b,placeHolderHeight:x}=d,w=e.__rest(d,["placeHolder","size","onSelect","defaultOptions","disabled","noErrorHint","placeHolderHeight"]);const[m,H]=r.useState(!1),y=null!=v?v:"default",O=r.useRef(),[S,q]=r.useState(null!=j?j:[]);r.useEffect((()=>{var e;const t=[];null===(e=null==w?void 0:w.options)||void 0===e||e.forEach((e=>{e.options?e.options.forEach((e=>{e.selected&&t.push(Object.assign(Object.assign({},e),{label:e.label}))})):e.selected&&t.push(e)})),q([...t])}),[w.options]),r.useEffect((()=>{j&&q([...j])}),[j]);const E=S.length?S.map((e=>e.label)).join(", "):void 0;return t.jsx(l.InputStyleContext.Provider,Object.assign({value:{InputWrapper:{height:x||("small"===y?32:48),width:null!==(c=null!==(u=w.buttonWidth)&&void 0!==u?u:w.width)&&void 0!==c?c:"100%",zIndex:1,cursor:"pointer",padding:"6px 8px"},input:{minHeight:"100%"}}},{children:t.jsx(s.DropdownPopover,Object.assign({ref:O,onSelect:function(e){Array.isArray(e)?q([...e]):q([e]),null==g||g(e)},disabled:f,onDropdownVisbilityChange:e=>H(e)},w,{children:t.jsx(i.Input,{version:w.version,noErrorHint:b,state:f?"disabled":"none",value:null!=E?E:"",errorMessage:w.error,variant:y,placeholder:null!=h?h:"Select an option",width:null!==(p=w.width)&&void 0!==p?p:"100%",onChangeText:a,rightIcon:{icon:()=>t.jsx(o.default,{style:{transform:m?"rotate(180deg)":"rotate(0deg)"},onClick:a,width:"small"===y?20:24,height:"small"===y?20:24,color:n.COLORS.content.primary})}})}))}))};d.displayName="Dropdown",exports.Dropdown=d;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
export interface DynamicTabsDetails {
|
|
2
3
|
id: number;
|
|
3
4
|
text: string;
|
|
@@ -6,6 +7,7 @@ export interface DynamicTabsDetails {
|
|
|
6
7
|
}
|
|
7
8
|
export interface DynamicTabsStyleDetails {
|
|
8
9
|
type: 'SQUARE' | 'CAPSULE';
|
|
10
|
+
size?: 'REGULAR' | 'SMALL';
|
|
9
11
|
style?: {
|
|
10
12
|
[property: string]: string | number;
|
|
11
13
|
};
|
|
@@ -14,5 +16,7 @@ export interface DynamicTabsProps {
|
|
|
14
16
|
tabsInfo: DynamicTabsDetails[];
|
|
15
17
|
tabStyleInfo: DynamicTabsStyleDetails;
|
|
16
18
|
selectedTabId?: number;
|
|
19
|
+
wrapperStyle?: React.CSSProperties;
|
|
20
|
+
tabWidth?: string;
|
|
17
21
|
}
|
|
18
22
|
export declare const DynamicTabs: (props: DynamicTabsProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),o=require("react"),r=require("../../constants/Theme.js"),t=require("../TypographyStyle.js");exports.DynamicTabs=d=>{const[
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),o=require("react"),r=require("../../constants/Theme.js"),t=require("../TypographyStyle.js");exports.DynamicTabs=d=>{var s;const[i,l]=o.useState(0),{tabsInfo:n,tabStyleInfo:a}=d;return o.useEffect((()=>{void 0!==d.selectedTabId&&null!==d.selectedTabId&&l(d.selectedTabId)}),[d.selectedTabId]),e.jsx("div",Object.assign({style:null!==(s=d.wrapperStyle)&&void 0!==s?s:{}},{children:e.jsx("div",Object.assign({style:{display:"flex",alignItems:"center",borderColor:r.DEFAULT_THEME.colorsV2.stroke.primary,backgroundColor:"SMALL"===(null==a?void 0:a.size)?"unset":r.DEFAULT_THEME.colorsV2.surface.standard}},{children:n.map(((o,s)=>{var c,u,p,b,y,T,E,L;const v="CAPSULE"===a.type?null!==(u=null===(c=a.style)||void 0===c?void 0:c.borderTopLeftRadius)&&void 0!==u?u:20:0===s&&"SQUARE"===a.type?(null===(p=a.style)||void 0===p?void 0:p.borderTopLeftRadius)?a.style.borderTopLeftRadius:4:0,x="CAPSULE"===a.type?null!==(y=null===(b=a.style)||void 0===b?void 0:b.borderTopLeftRadius)&&void 0!==y?y:20:s===n.length-1&&"SQUARE"===a.type?(null===(T=a.style)||void 0===T?void 0:T.borderTopLeftRadius)?a.style.borderTopLeftRadius:4:0,f=o.id===i?r.DEFAULT_THEME.colorsV2.content.brand:r.DEFAULT_THEME.colorsV2.stroke.primary;return e.jsx("div",Object.assign({onClick:()=>{(e=>{l(e.id),e.action(e.text)})(o)},style:{cursor:"pointer",display:"flex",flex:1,width:null!==(E=d.tabWidth)&&void 0!==E?E:"110px",borderTop:`1px solid ${f}`,borderBottom:`1px solid ${f}`,borderLeft:`1px solid ${f}`,borderRight:`${s===n.length-1&&"SQUARE"===a.type||"CAPSULE"===a.type||o.id===i?1:0}px solid ${f}`,backgroundColor:o.id===i?r.DEFAULT_THEME.colorsV2.background.brandLight:r.DEFAULT_THEME.colorsV2.surface.standard,borderTopLeftRadius:v,borderBottomLeftRadius:v,borderTopRightRadius:x,borderBottomRightRadius:x,padding:"SMALL"===(null==a?void 0:a.size)?"2px 14px":"8px 24px",marginRight:null===(L=a.style)||void 0===L?void 0:L.marginRight,justifyContent:"space-around"}},{children:e.jsx(t.BodySecondary,Object.assign({style:{color:o.id===i?r.DEFAULT_THEME.colorsV2.content.brand:r.DEFAULT_THEME.colorsV2.content.secondary}},{children:o.text}))}),o.id)}))}))}))};
|