@bikdotai/bik-component-library 0.0.271-0 → 0.0.271-1
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/back_icon.svg.js +1 -0
- package/dist/cjs/assets/icons/chevronDownOutline.svg.js +1 -0
- package/dist/cjs/assets/icons/chevronRightAlt.svg.js +1 -0
- package/dist/cjs/assets/icons/chevronUpOutline.svg.js +1 -0
- package/dist/cjs/assets/icons/undo.svg.js +1 -0
- package/dist/cjs/components/QueryBuilder/Filters/UserProperty/components/UserPropertyFilter.js +1 -1
- package/dist/cjs/components/QueryBuilder/constants/DATE_OPERATORS_OPTIONS.js +1 -1
- package/dist/cjs/components/QueryBuilder/helpers/MetaCustomProcessor.d.ts +1 -1
- package/dist/cjs/components/SearchFilter/SearchFilterItem.d.ts +7 -0
- package/dist/cjs/components/SearchFilter/SearchFilterItem.js +1 -0
- package/dist/cjs/components/SearchFilter/components/ChipDropdown.d.ts +3 -0
- package/dist/cjs/components/SearchFilter/components/ChipDropdown.js +1 -0
- package/dist/cjs/components/SearchFilter/components/DatePickerButton.d.ts +7 -0
- package/dist/cjs/components/SearchFilter/components/DatePickerButton.js +1 -0
- package/dist/cjs/components/SearchFilter/index.d.ts +3 -0
- package/dist/cjs/components/SearchFilter/index.js +1 -0
- package/dist/cjs/components/SearchFilter/types/SearchFilter.type.d.ts +31 -0
- package/dist/cjs/components/SearchFilter/types/SearchFilter.type.js +1 -0
- package/dist/cjs/components/add-variableV2/AddVariableV2.d.ts +41 -0
- package/dist/cjs/components/add-variableV2/AddVariableV2.js +1 -0
- package/dist/cjs/components/add-variableV2/AddVariableV2.styled.d.ts +6 -0
- package/dist/cjs/components/add-variableV2/AddVariableV2.styled.js +161 -0
- package/dist/cjs/components/add-variableV2/AddVariableV2SideModal.d.ts +15 -0
- package/dist/cjs/components/add-variableV2/AddVariableV2SideModal.js +1 -0
- package/dist/cjs/components/add-variableV2/index.d.ts +1 -0
- package/dist/cjs/components/analytics-chips-and-dropdowns/AnalyticsDropdown.d.ts +1 -0
- package/dist/cjs/components/analytics-chips-and-dropdowns/AnalyticsDropdown.js +1 -1
- package/dist/cjs/components/analytics-chips-and-dropdowns/chart/Pie/PieChartAnalytics.js +1 -1
- package/dist/cjs/components/bik-layout/MockMenus.d.ts +0 -1
- package/dist/cjs/components/side-modal/SideModal.style.js +1 -1
- package/dist/cjs/components/stepper/WorkingStepper.d.ts +0 -1
- package/dist/cjs/components/template-context-mapper/TemplateContextMapper.d.ts +4 -1
- package/dist/cjs/components/template-context-mapper/TemplateContextMapper.js +1 -1
- package/dist/cjs/components/template-context-mapper/modalElements/Body.d.ts +3 -0
- package/dist/cjs/components/template-context-mapper/modalElements/Body.js +2 -2
- package/dist/cjs/components/template-context-mapper/modalElements/EditWhatsAppTemplateV2.d.ts +4 -1
- package/dist/cjs/components/template-context-mapper/modalElements/EditWhatsAppTemplateV2.js +1 -1
- package/dist/cjs/components/template-context-mapper/modalElements/TemplateSelectModalContent.d.ts +4 -1
- package/dist/cjs/components/template-context-mapper/modalElements/TemplateSelectModalContent.js +1 -1
- package/dist/cjs/components/template-context-mapper/modalElements/VariableConnector.d.ts +4 -1
- package/dist/cjs/components/template-context-mapper/modalElements/VariableConnector.js +3 -3
- package/dist/cjs/components/template-context-mapper/modalElements/VariableConnectorWhatsApp.d.ts +4 -1
- package/dist/cjs/components/template-context-mapper/modalElements/VariableConnectorWhatsApp.js +1 -1
- package/dist/cjs/components/template-context-mapper/modalElements/VariableConnectorsPanel.d.ts +4 -1
- package/dist/cjs/components/template-context-mapper/modalElements/VariableConnectorsPanel.js +2 -2
- package/dist/cjs/index.d.ts +2 -0
- package/dist/cjs/index.js +1 -1
- package/dist/esm/assets/icons/back_icon.svg.js +1 -0
- package/dist/esm/assets/icons/chevronDownOutline.svg.js +1 -0
- package/dist/esm/assets/icons/chevronRightAlt.svg.js +1 -0
- package/dist/esm/assets/icons/chevronUpOutline.svg.js +1 -0
- package/dist/esm/assets/icons/undo.svg.js +1 -0
- package/dist/esm/components/QueryBuilder/Filters/UserProperty/components/UserPropertyFilter.js +1 -1
- package/dist/esm/components/QueryBuilder/constants/DATE_OPERATORS_OPTIONS.js +1 -1
- package/dist/esm/components/QueryBuilder/helpers/MetaCustomProcessor.d.ts +1 -1
- package/dist/esm/components/SearchFilter/SearchFilterItem.d.ts +7 -0
- package/dist/esm/components/SearchFilter/SearchFilterItem.js +1 -0
- package/dist/esm/components/SearchFilter/components/ChipDropdown.d.ts +3 -0
- package/dist/esm/components/SearchFilter/components/ChipDropdown.js +1 -0
- package/dist/esm/components/SearchFilter/components/DatePickerButton.d.ts +7 -0
- package/dist/esm/components/SearchFilter/components/DatePickerButton.js +1 -0
- package/dist/esm/components/SearchFilter/index.d.ts +3 -0
- package/dist/esm/components/SearchFilter/index.js +1 -0
- package/dist/esm/components/SearchFilter/types/SearchFilter.type.d.ts +31 -0
- package/dist/esm/components/SearchFilter/types/SearchFilter.type.js +1 -0
- package/dist/esm/components/add-variableV2/AddVariableV2.d.ts +41 -0
- package/dist/esm/components/add-variableV2/AddVariableV2.js +1 -0
- package/dist/esm/components/add-variableV2/AddVariableV2.styled.d.ts +6 -0
- package/dist/esm/components/add-variableV2/AddVariableV2.styled.js +161 -0
- package/dist/esm/components/add-variableV2/AddVariableV2SideModal.d.ts +15 -0
- package/dist/esm/components/add-variableV2/AddVariableV2SideModal.js +1 -0
- package/dist/esm/components/add-variableV2/index.d.ts +1 -0
- package/dist/esm/components/analytics-chips-and-dropdowns/AnalyticsDropdown.d.ts +1 -0
- package/dist/esm/components/analytics-chips-and-dropdowns/AnalyticsDropdown.js +1 -1
- package/dist/esm/components/analytics-chips-and-dropdowns/chart/Pie/PieChartAnalytics.js +1 -1
- package/dist/esm/components/bik-layout/MockMenus.d.ts +0 -1
- package/dist/esm/components/side-modal/SideModal.style.js +1 -1
- package/dist/esm/components/stepper/WorkingStepper.d.ts +0 -1
- package/dist/esm/components/template-context-mapper/TemplateContextMapper.d.ts +4 -1
- package/dist/esm/components/template-context-mapper/TemplateContextMapper.js +1 -1
- package/dist/esm/components/template-context-mapper/modalElements/Body.d.ts +3 -0
- package/dist/esm/components/template-context-mapper/modalElements/Body.js +5 -5
- package/dist/esm/components/template-context-mapper/modalElements/EditWhatsAppTemplateV2.d.ts +4 -1
- package/dist/esm/components/template-context-mapper/modalElements/EditWhatsAppTemplateV2.js +1 -1
- package/dist/esm/components/template-context-mapper/modalElements/TemplateSelectModalContent.d.ts +4 -1
- package/dist/esm/components/template-context-mapper/modalElements/TemplateSelectModalContent.js +1 -1
- package/dist/esm/components/template-context-mapper/modalElements/VariableConnector.d.ts +4 -1
- package/dist/esm/components/template-context-mapper/modalElements/VariableConnector.js +3 -3
- package/dist/esm/components/template-context-mapper/modalElements/VariableConnectorWhatsApp.d.ts +4 -1
- package/dist/esm/components/template-context-mapper/modalElements/VariableConnectorWhatsApp.js +1 -1
- package/dist/esm/components/template-context-mapper/modalElements/VariableConnectorsPanel.d.ts +4 -1
- package/dist/esm/components/template-context-mapper/modalElements/VariableConnectorsPanel.js +2 -2
- package/dist/esm/index.d.ts +2 -0
- package/dist/esm/index.js +1 -1
- package/package.json +1 -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 l=e=>r.createElement("svg",n({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},e),t||(t=r.createElement("path",{fill:"currentColor",fillRule:"evenodd",d:"M12.707 4.293a1 1 0 0 1 0 1.414L7.414 11H19a1 1 0 1 1 0 2H7.414l5.293 5.293a1 1 0 0 1-1.414 1.414l-7-7a1 1 0 0 1 0-1.414l7-7a1 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 l=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",fillRule:"evenodd",d:"M3.529 5.529c.26-.26.682-.26.942 0L8 9.057l3.528-3.528a.667.667 0 1 1 .943.942l-4 4a.667.667 0 0 1-.942 0l-4-4a.667.667 0 0 1 0-.942Z",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:"M6 5.61a.667.667 0 0 1 1.138-.472l2.39 2.39c.26.26.26.683 0 .943l-2.39 2.39A.667.667 0 0 1 6 10.392V5.608Z"})));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 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 16 16"},e),t||(t=r.createElement("path",{fill:"currentColor",fillRule:"evenodd",d:"M12.473 10.47a.667.667 0 0 1-.943 0L8 6.943l-3.528 3.529a.667.667 0 0 1-.943-.943l4-4c.26-.26.682-.26.943 0l4 4c.26.26.26.682 0 .943Z",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 20 20"},e),t||(t=r.createElement("path",{fill:"#616161",fillRule:"evenodd",d:"M6.423 3.578a.833.833 0 0 1 0 1.178L5.345 5.833H12.5a5 5 0 0 1 0 10H6.667a.833.833 0 1 1 0-1.666H12.5a3.333 3.333 0 0 0 0-6.667H5.345l1.078 1.078a.833.833 0 1 1-1.179 1.178l-2.5-2.5a.833.833 0 0 1 0-1.178l2.5-2.5a.833.833 0 0 1 1.179 0Z",clipRule:"evenodd"})));exports.default=a;
|
package/dist/cjs/components/QueryBuilder/Filters/UserProperty/components/UserPropertyFilter.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../../../_virtual/_tslib.js"),r=require("react/jsx-runtime"),o=require("../../../components/AllowedListDropdown.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../../../_virtual/_tslib.js"),r=require("react/jsx-runtime"),o=require("../../../components/AllowedListDropdown.js"),t=require("../../../components/QueryBuilderNode/Property/PropertyNode.js"),i=require("../../../hooks/useQueryBuilder.js"),s=require("../../../hooks/useQueryBuilderCache.js"),d=require("../../../components/QueryBuilderNode/Base/BaseQueryBuilderNode.js");exports.default=a=>{let{node:l,allowedNodes:u,apiHandler:n,mode:p,selectorKey:c}=a;var y;const{selectType:v,createProperty:j,updateProperty:P}=i.useQueryBuilder(c),{cacheWrap:_}=s.useQueryBuilderCache(),f=e=>_((()=>n({query:{propertyName:e}})),`USER_PROPERTIES-${e}`);return r.jsx(d.BaseQueryBuilderNode,Object.assign({node:l,mode:p},{children:r.jsxs("div",Object.assign({style:{flexDirection:"row",display:"flex",gap:12,alignItems:"flex-start"}},{children:[r.jsx(o.default,{disabled:"view"===p,selectedType:l.type,allowedList:u,onSelect:e=>v(e.value,l._id)}),r.jsx(t.PropertyNodeHeadless,{mode:p,property:null===(y=null==l?void 0:l.properties)||void 0===y?void 0:y[0],fetchPropertyData:()=>_((()=>n({})),"USER_PROPERTIES"),onPropertyNameSelect:function(r){var o,t;return e.__awaiter(this,void 0,void 0,(function*(){if((null===(o=l.properties)||void 0===o?void 0:o[0])?P(Object.assign(Object.assign({},null===(t=l.properties)||void 0===t?void 0:t[0]),{name:r.id,dataType:r.type,operator:void 0,value:void 0,error:{}}),l._id):j({name:r.id,dataType:r.type},l._id),r.needValuesRetrieval){const e=yield f(r.id);return null!=e?e:[]}return[]}))},onPropertyOperatorChange:function(e){P(Object.assign(Object.assign({},l.properties[0]),{operator:e,value:void 0,error:{}}),l._id)},onPropertyValueChange:function(e){P(Object.assign(Object.assign({},l.properties[0]),{value:e,error:{}}),l._id)}})]}))}))};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.DATE_OPERATORS_OPTIONS=[{label:"Commonly used",options:[{selected:!1,value:"today",label:"Today"},{selected:!1,value:"yesterday",label:"Yesterday"},{selected:!1,value:"last
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.DATE_OPERATORS_OPTIONS=[{label:"Commonly used",options:[{selected:!1,value:"today",label:"Today"},{selected:!1,value:"yesterday",label:"Yesterday"},{selected:!1,value:"last week",label:"Last week"},{selected:!0,value:"last month",label:"Last month"}]},{label:"Relative",options:[{selected:!1,value:"in the last",label:"In the last"}]},{label:"Absolute",options:[{selected:!1,value:"on",label:"On"},{selected:!1,value:"notOn",label:"Not On"},{selected:!1,value:"inBetween",label:"In Between"},{selected:!1,value:"notInBetween",label:"Not In Between"},{selected:!1,value:"before",label:"Before"},{selected:!1,value:"after",label:"After"}]}];
|
|
@@ -36,7 +36,7 @@ export declare class MetaCustomProcessor {
|
|
|
36
36
|
value: {
|
|
37
37
|
operator: string;
|
|
38
38
|
dataType: import("../types").QueryBuilderConnectorType;
|
|
39
|
-
value?: string | number |
|
|
39
|
+
value?: string | number | Date | Date[] | string[] | number[] | undefined;
|
|
40
40
|
};
|
|
41
41
|
key: string;
|
|
42
42
|
refresh?: boolean | undefined;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { InputVariant } from '../input';
|
|
3
|
+
import { FilterSchema, FilterValueType } from './types/SearchFilter.type';
|
|
4
|
+
export declare const SearchFilterItem: React.FC<FilterSchema & {
|
|
5
|
+
variant: InputVariant;
|
|
6
|
+
onChange: (val: FilterValueType) => void;
|
|
7
|
+
}>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime");require("@tippyjs/react"),require("react"),require("../tooltips/TooltipInternal.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("../analytics-chips-and-dropdowns/AnalyticsMetric.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/VerticalBarGraph/VerticalGraph.js"),require("../analytics-chips-and-dropdowns/chart/heatmap/HeatMap.js"),require("../analytics-chips-and-dropdowns/chart/VerticalBarAndLinearGraph/VerticalBarAndLinearGraph.js"),require("../dropdown/DropdownPopover/index.js");var t=require("../dropdown/Dropdown.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("./components/ChipDropdown.js"),o=require("./components/DatePickerButton.js"),a=require("./types/SearchFilter.type.js");const i=[{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=s=>{var d,p,l;return s.type===a.FilterType.Date?e.jsx(o.DatePickerButton,Object.assign({},s,{variant:s.variant,onSelect:e=>s.onChange(e)})):s.type===a.FilterType.DateRange?e.jsx(r.AnalyticsDropdown,{variant:s.variant,placeholder:s.text,options:s.preset?i:null!==(d=s.options)&&void 0!==d?d:[],onOptionSelected:function(e){var r,t;e.selectedRange&&s.onChange([null===(r=e.selectedRange)||void 0===r?void 0:r[0],null===(t=e.selectedRange)||void 0===t?void 0:t[1]])}},s.id):"small"===s.variant?e.jsx(n.ChipDropdown,{isMultiSelect:s.type===a.FilterType.Multiple,options:null!==(p=s.options)&&void 0!==p?p:[],defaultOptions:s.defaultValue,onSelect:s.onChange,placeHolder:s.text}):e.jsx(t.Dropdown,{isMultiSelect:s.type===a.FilterType.Multiple,size:"small",options:null!==(l=s.options)&&void 0!==l?l:[],defaultOptions:s.defaultValue,onSelect:s.onChange,placeHolder:s.text,width:10*s.text.length+"px"})};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../_virtual/_tslib.js"),r=require("react/jsx-runtime"),o=require("react"),n=require("../../dropdown/DropdownPopover/index.js");require("../../dropdown/Dropdown.js"),require("../../zeroState/ZeroState.js"),require("../../TypographyStyle.js"),require("../../../constants/Theme.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 t=require("../../tag/Tag.js"),s=require("../../../assets/icons/chevronDownOutline.svg.js"),i=require("../../../assets/icons/chevronUpOutline.svg.js");const d=d=>{var{placeHolder:p,onSelect:u}=d,l=e.__rest(d,["placeHolder","onSelect"]);const[c,a]=o.useState(!1),j=o.useRef();return r.jsx(n.DropdownPopover,Object.assign({ref:j,onDropdownVisbilityChange:e=>a(e),onSelect:function(e){null==u||u(e)}},l,{children:r.jsx(t.Tag,{tagText:null!=p?p:"",theme:"light",type:"neutral",variant:"regular",TrailingIcon:c?s.default:i.default})}))};d.displayName="ChipDropdown",exports.ChipDropdown=d;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../_virtual/_tslib.js"),t=require("react/jsx-runtime"),i=require("react"),r=require("../../datePicker/DatePicker.js"),n=require("../../input/Input.js"),a=require("../../input/context/InputStyleProvider.js"),s=require("../../tag/Tag.js"),o=require("../../../constants/Theme.js"),l=require("../../../assets/icons/chevronDown.svg.js"),c=require("../../../assets/icons/chevronDownOutline.svg.js");const u=u=>{var d,g,{text:p,onSelect:h,variant:v}=u,x=e.__rest(u,["text","onSelect","variant"]);const[j,S]=i.useState(!1),[y,D]=i.useState(null),q=(null===(d=x.width)||void 0===d?void 0:d.toString())?null===(g=x.width)||void 0===g?void 0:g.toString():y?12*(null==y?void 0:y.toDateString().length)+"px":12*p.length+"px";return t.jsxs("div",Object.assign({style:{position:"relative"}},{children:[t.jsx("div",Object.assign({onClick:()=>S((e=>!e)),style:{cursor:"pointer",width:"100%",height:"100%"}},{children:"small"===v?t.jsx(s.Tag,{tagText:y?y.toDateString():null!=p?p:"",theme:"light",type:"neutral",variant:"regular",TrailingIcon:c.default}):t.jsx(a.InputStyleContext.Provider,Object.assign({value:{InputWrapper:{height:32,width:"100%",zIndex:1,cursor:"pointer",padding:"6px 8px",backgroundColor:"#fff"},RootContainer:{opacity:1},input:{minHeight:"100%"}}},{children:t.jsx(n.Input,{state:"disabled",value:y?y.toDateString():void 0,variant:"small",placeholder:null!=p?p:"Select a date",width:q,onChangeText:()=>{},rightIcon:{icon:()=>t.jsx(l.default,{style:{transform:j?"rotate(180deg)":"rotate(0deg)"},onClick:()=>{},width:20,height:20,color:o.DEFAULT_THEME.colorsV2.content.primary})}})}))})),j&&t.jsx("div",Object.assign({style:{position:"absolute",top:"calc(100% + 8px)"}},{children:t.jsx(r.DatePicker,{selectRange:!1,onSelectDate:e=>{D(e),S(!1),h(e)}})}))]}))};u.displayName="DatePickerButton",exports.DatePickerButton=u;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),r=require("react/jsx-runtime"),t=require("../searchBar/searchBar.js"),a=require("./SearchFilterItem.js"),i=require("./types/SearchFilter.type.js");exports.SearchFilter=l=>{let{direction:n="row",schema:s,variant:c}=l;var u,d,o;const p=e.useRef(null!==(u=null==s?void 0:s.map((e=>({id:e.id,value:e.defaultValue,type:e.type}))))&&void 0!==u?u:[]),v=s.find((e=>e.type===i.FilterType.Search)),h=e=>{var r;v&&p.current&&(p.current=null===(r=p.current)||void 0===r?void 0:r.map((r=>r.type===i.FilterType.Search?Object.assign(Object.assign({},r),{value:e}):r)),v.onChange(e,p.current))};return r.jsxs("div",Object.assign({style:{display:"flex",flexDirection:n,gap:8,flexWrap:"wrap",alignItems:"row"===n?"center":"self-start"}},{children:[v&&r.jsx(t.SearchBar,{width:null!==(o=null===(d=v.width)||void 0===d?void 0:d.toString())&&void 0!==o?o:"100%",isEnabled:!0,onChange:h,onEnter:h,placeholder:v.text,variant:"small"}),r.jsx("div",Object.assign({style:{display:"flex",flexDirection:"row",gap:8,flexWrap:"wrap",alignItems:"row"===n?"center":"self-start"}},{children:s.filter((e=>e.type!==i.FilterType.Search)).map(((r,t)=>e.createElement(a.SearchFilterItem,Object.assign({},r,{key:t,variant:c,onChange:e=>{var t;p.current=null===(t=p.current)||void 0===t?void 0:t.map((t=>t.id===r.id?Object.assign(Object.assign({},t),{value:e}):t)),r.onChange(e,p.current)}}))))}))]}))};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { DropdownOptions } from "../../analytics-chips-and-dropdowns";
|
|
2
|
+
import { DropdownOption } from "../../dropdown/type";
|
|
3
|
+
import { InputVariant } from "../../input";
|
|
4
|
+
export declare enum FilterType {
|
|
5
|
+
Date = "Date",
|
|
6
|
+
DateRange = "DateRange",
|
|
7
|
+
Multiple = "Multiple",
|
|
8
|
+
Single = "Single",
|
|
9
|
+
Search = "Search"
|
|
10
|
+
}
|
|
11
|
+
export type FilterValueType = DropdownOption | DropdownOption[] | Date | Date[] | string;
|
|
12
|
+
export type SearchFilterOutputState = {
|
|
13
|
+
id: string;
|
|
14
|
+
type: FilterType;
|
|
15
|
+
value: FilterValueType;
|
|
16
|
+
};
|
|
17
|
+
export type FilterSchema = {
|
|
18
|
+
id: string;
|
|
19
|
+
type: FilterType;
|
|
20
|
+
text: string;
|
|
21
|
+
onChange: (value: FilterValueType, completeState: SearchFilterOutputState[]) => void;
|
|
22
|
+
options?: DropdownOption[] | DropdownOptions[];
|
|
23
|
+
preset?: boolean;
|
|
24
|
+
defaultValue?: FilterValueType;
|
|
25
|
+
width?: number | string;
|
|
26
|
+
};
|
|
27
|
+
export type SearchFilterProps = {
|
|
28
|
+
variant: InputVariant;
|
|
29
|
+
direction: 'row' | 'column';
|
|
30
|
+
schema: FilterSchema[];
|
|
31
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var e;Object.defineProperty(exports,"__esModule",{value:!0}),exports.FilterType=void 0,(e=exports.FilterType||(exports.FilterType={})).Date="Date",e.DateRange="DateRange",e.Multiple="Multiple",e.Single="Single",e.Search="Search";
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface VariableListInterfaceV2 {
|
|
3
|
+
payloadVariables: PayloadVariables;
|
|
4
|
+
}
|
|
5
|
+
export interface PayloadVariables {
|
|
6
|
+
displayName: string;
|
|
7
|
+
description: string;
|
|
8
|
+
orderId: number;
|
|
9
|
+
variables?: any;
|
|
10
|
+
}
|
|
11
|
+
export interface Variable {
|
|
12
|
+
description?: string;
|
|
13
|
+
displayName: string;
|
|
14
|
+
actualValue: string;
|
|
15
|
+
variableType: string;
|
|
16
|
+
isAvailable: boolean;
|
|
17
|
+
isSubHeader?: boolean;
|
|
18
|
+
variables?: {
|
|
19
|
+
[key: string]: Variable;
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
export interface AddVariableProps {
|
|
23
|
+
data: VariableListInterfaceV2[];
|
|
24
|
+
showVariable: any;
|
|
25
|
+
setShowVariable: any;
|
|
26
|
+
variableValue?: any;
|
|
27
|
+
setVariableValue?: any;
|
|
28
|
+
placeholder: string;
|
|
29
|
+
customTrigger?: any;
|
|
30
|
+
isSearchRequired?: boolean;
|
|
31
|
+
leftPosition?: number;
|
|
32
|
+
pickerSize?: string;
|
|
33
|
+
}
|
|
34
|
+
type Props = AddVariableProps;
|
|
35
|
+
export interface VariableBoxProps {
|
|
36
|
+
item: Variable;
|
|
37
|
+
raw?: string;
|
|
38
|
+
parentKey?: string;
|
|
39
|
+
}
|
|
40
|
+
declare const AddVariableV2: React.FC<Props>;
|
|
41
|
+
export default AddVariableV2;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var a=require("react/jsx-runtime"),e=require("../../assets/icons/back_icon.svg.js"),s=require("../../assets/icons/chevronRightAlt.svg.js"),i=require("../../assets/icons/cross.svg.js"),l=require("../../assets/icons/plus.svg.js"),r=require("../../assets/icons/undo.svg.js"),t=require("react"),n=require("./AddVariableV2.styled.js"),d=require("../button/Button.js"),c=require("../icon-button/IconButton.js"),o=require("../searchBar/searchBar.js"),b=require("../TypographyStyle.js");exports.default=j=>{const{data:v}=j,[u,p]=t.useState({}),[g,y]=t.useState(),[m,h]=t.useState(""),[x,O]=t.useState(""),[V,f]=t.useState(!0);t.useEffect((()=>{const a={};v.forEach((e=>{a[e.payloadVariables.displayName]=[]})),y(a)}),[v]),t.useEffect((()=>{if(x){j.data.filter((a=>Object.keys(a.payloadVariables.variables).filter((e=>{var s;return(null===(s=a.payloadVariables.variables[e].displayName)||void 0===s?void 0:s.toLowerCase().includes(x.toLowerCase()))||_(a.payloadVariables.variables[e])})).length>0)).length>0?f(!0):f(!1)}else f(!0)}),[x]);const N=(a,e)=>{const s=v.find((a=>a.payloadVariables.displayName===e));if(s){let i=s.payloadVariables;a.forEach(((a,e)=>{i=i.variables[a]})),p((a=>Object.assign(Object.assign({},a),{[e]:i})))}},_=a=>{let e=!1;if(a.isSubHeader&&a.variables){const s=Object.keys(a.variables);for(let i=0;i<s.length;i++){const l=s[i];if(a.variables&&a.variables[l].displayName.toLowerCase().includes(x.toLowerCase())){e=!0;break}}}return e},C=e=>a.jsx(d.Button,{disabled:!1,size:"chip",LeadingIcon:e.item.isSubHeader?void 0:l.default,TrailingIcon:()=>e.item.isSubHeader?a.jsx("div",Object.assign({className:"icon-trailing",style:{display:"flex"}},{children:a.jsx(s.default,{})})):a.jsx(a.Fragment,{}),buttonText:e.item.displayName}),S=(e,s)=>a.jsx("div",Object.assign({onClick:e.isSubHeader?()=>{const a=[...g[m],s];N(a,m),y((e=>Object.assign(Object.assign({},e),{[m]:a})))}:()=>{j.customTrigger?(j.customTrigger(e),j.setShowVariable(!1)):j.setVariableValue(e.actualValue)}},{children:a.jsx(C,{item:e})})),k=(a,e)=>{const s=[...g[a.payloadVariables.displayName],e];N(s,a.payloadVariables.displayName),y((e=>Object.assign(Object.assign({},e),{[a.payloadVariables.displayName]:s}))),h(a.payloadVariables.displayName)},w=(a,e)=>{j.customTrigger?(j.customTrigger(a.payloadVariables.variables[e]),j.setShowVariable(!1)):j.setVariableValue(a.payloadVariables.variables[e].actualValue)};return a.jsx(n.AddVariableStyled,Object.assign({id:"varList",onClick:a=>{a.stopPropagation()},pickerSize:j.pickerSize||"large"},{children:j.showVariable&&a.jsxs("div",Object.assign({className:"popup"},{children:[a.jsxs("div",Object.assign({className:"sticky__bar"},{children:[a.jsxs("div",Object.assign({className:"header__bar"},{children:[a.jsx("div",Object.assign({className:"add__variable"},{children:"Add a new variable"})),a.jsx("div",Object.assign({onClick:()=>{j.setShowVariable(!1)},style:{display:"flex",alignItems:"center",justifyContent:"center"}},{children:a.jsx(c.IconButton,{iconButtonType:"default",Icon:i.default})}))]})),a.jsx("div",Object.assign({className:"search__bar"},{children:a.jsx(o.SearchBar,{width:"100%",isEnabled:!0,onChange:a=>{O(a)},onEnter:()=>{},placeholder:"Search...",variant:"default"})})),!V&&a.jsxs("div",Object.assign({style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",marginTop:16}},{children:[a.jsx(b.TitleSmall,{children:"No results found!"}),a.jsx(b.BodyCaption,{children:`Sorry we could not find any results for "${x}"`})]})),m&&g[m].length>0&&a.jsxs("div",Object.assign({className:"nav__bar",style:{marginTop:8}},{children:[a.jsxs("div",Object.assign({className:"left__nav"},{children:[a.jsx(c.IconButton,{Icon:e.default,style:{color:"#919191",display:"flex"},onClick:()=>{const a=g[m].slice(0,-1);N(a,m),y((e=>Object.assign(Object.assign({},e),{[m]:a}))),a.length||h("")}}),a.jsxs("div",Object.assign({className:"block"},{children:[a.jsx(b.TitleSmall,{children:u[m].displayName}),u[m].description&&a.jsx(b.BodyCaption,{children:u[m].description})]}))]})),a.jsxs("div",Object.assign({className:"right__nav"},{children:[a.jsx(c.IconButton,{Icon:r.default,style:{display:"flex"},onClick:()=>{N([],m),y((a=>Object.assign(Object.assign({},a),{[m]:[]}))),h("")}}),a.jsx("div",{children:"First page"})]}))]}))]})),a.jsx("div",Object.assign({className:"wrapper"},{children:a.jsx("div",Object.assign({className:"list__map"},{children:a.jsxs("div",Object.assign({className:"items"},{children:[!m&&j.data.map((e=>{var s,i,l,r;let t=[];return x&&(t=Object.keys(e.payloadVariables.variables).filter((a=>{var s;return(null===(s=e.payloadVariables.variables[a].displayName)||void 0===s?void 0:s.toLowerCase().includes(x.toLowerCase()))||_(e.payloadVariables.variables[a])}))),a.jsxs(a.Fragment,{children:[x?t.length>0?a.jsxs("div",Object.assign({className:"block"},{children:[a.jsx("div",Object.assign({className:"heading__font"},{children:null===(s=null==e?void 0:e.payloadVariables)||void 0===s?void 0:s.displayName})),a.jsx(b.BodyCaption,Object.assign({style:{marginBottom:8,color:"#616161"}},{children:null===(i=null==e?void 0:e.payloadVariables)||void 0===i?void 0:i.description}))]})):a.jsx(a.Fragment,{}):a.jsxs("div",Object.assign({className:"block"},{children:[a.jsx("div",Object.assign({className:"heading__font"},{children:null===(l=null==e?void 0:e.payloadVariables)||void 0===l?void 0:l.displayName})),a.jsx(b.BodyCaption,Object.assign({style:{marginBottom:8,color:"#616161"}},{children:null===(r=null==e?void 0:e.payloadVariables)||void 0===r?void 0:r.description}))]})),Object.keys(e.payloadVariables.variables).map((s=>{var i;return x?(null===(i=e.payloadVariables.variables[s].displayName)||void 0===i?void 0:i.toLowerCase().includes(x.toLowerCase()))||_(e.payloadVariables.variables[s])?a.jsx("div",Object.assign({onClick:e.payloadVariables.variables[s].isSubHeader?()=>k(e,s):()=>w(e,s)},{children:a.jsx(C,{item:e.payloadVariables.variables[s]})})):a.jsx(a.Fragment,{}):a.jsx("div",Object.assign({onClick:e.payloadVariables.variables[s].isSubHeader?()=>k(e,s):()=>w(e,s)},{children:a.jsx(C,{item:e.payloadVariables.variables[s]})}))}))]})})),m&&a.jsx("div",Object.assign({className:"list__map"},{children:a.jsx("div",Object.assign({className:"items",style:{marginTop:16}},{children:Object.keys(u[m].variables).map(((e,s)=>{var i;return x?(null===(i=u[m].variables[e].displayName)||void 0===i?void 0:i.toLowerCase().includes(x.toLowerCase()))||_(u[m].variables[e])?S(u[m].variables[e],e):a.jsx(a.Fragment,{}):S(u[m].variables[e],e)}))}))}))]}))}))})),a.jsx("div",{className:"bottom__padding"})]}))}))};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const AddVariableStyled: import("styled-components").StyledComponent<"div", any, {
|
|
2
|
+
pickerSize: string;
|
|
3
|
+
}, never>;
|
|
4
|
+
export declare const VariableBoxStyled: import("styled-components").StyledComponent<"div", any, {
|
|
5
|
+
isAvailable?: boolean | undefined;
|
|
6
|
+
}, never>;
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}Object.defineProperty(exports,"__esModule",{value:!0});var o=e(require("styled-components"));const t=o.default.div`
|
|
2
|
+
position: fixed;
|
|
3
|
+
z-index: 250;
|
|
4
|
+
*::-webkit-scrollbar {
|
|
5
|
+
display: none;
|
|
6
|
+
}
|
|
7
|
+
* {
|
|
8
|
+
-ms-overflow-style: none;
|
|
9
|
+
scrollbar-width: none;
|
|
10
|
+
}
|
|
11
|
+
.popup {
|
|
12
|
+
background: white;
|
|
13
|
+
width: 566px;
|
|
14
|
+
height: 100vh;
|
|
15
|
+
border-radius: 8px;
|
|
16
|
+
overflow-y: scroll;
|
|
17
|
+
.sticky__bar {
|
|
18
|
+
z-index: 10;
|
|
19
|
+
position: sticky;
|
|
20
|
+
top: 0;
|
|
21
|
+
background: white;
|
|
22
|
+
|
|
23
|
+
.header__bar {
|
|
24
|
+
display: flex;
|
|
25
|
+
justify-content: space-between;
|
|
26
|
+
align-items: center;
|
|
27
|
+
padding: 24px 24px 16px 24px;
|
|
28
|
+
border-bottom: 1px solid var(--stroke-color-stroke-primary, #e0e0e0);
|
|
29
|
+
.add__variable {
|
|
30
|
+
font-family: 'Inter';
|
|
31
|
+
font-style: normal;
|
|
32
|
+
font-weight: 600;
|
|
33
|
+
font-size: 20px;
|
|
34
|
+
line-height: 24px;
|
|
35
|
+
|
|
36
|
+
color: #212121;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.search__bar {
|
|
41
|
+
padding: 24px 24px 8px 24px;
|
|
42
|
+
}
|
|
43
|
+
.nav__bar {
|
|
44
|
+
display: flex;
|
|
45
|
+
justify-content: space-between;
|
|
46
|
+
align-items: center;
|
|
47
|
+
border-bottom: 1px solid var(--stroke-color-stroke-primary, #e0e0e0);
|
|
48
|
+
background: var(--surface-color-surface-hovered, #f0f0f0);
|
|
49
|
+
padding: 10px 24px;
|
|
50
|
+
|
|
51
|
+
font-family: Inter;
|
|
52
|
+
font-size: 14px;
|
|
53
|
+
font-style: normal;
|
|
54
|
+
|
|
55
|
+
line-height: 20px;
|
|
56
|
+
|
|
57
|
+
.left__nav {
|
|
58
|
+
display: flex;
|
|
59
|
+
align-items: center;
|
|
60
|
+
gap: 8px;
|
|
61
|
+
color: var(--content-color-content-primary, #212121);
|
|
62
|
+
cursor: pointer;
|
|
63
|
+
}
|
|
64
|
+
.right__nav {
|
|
65
|
+
display: flex;
|
|
66
|
+
align-items: center;
|
|
67
|
+
gap: 8px;
|
|
68
|
+
font-weight: 400;
|
|
69
|
+
color: var(--content-color-content-secondary, #616161);
|
|
70
|
+
cursor: pointer;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
hr {
|
|
75
|
+
margin: 0;
|
|
76
|
+
border: 0.2px solid #e0e0e0;
|
|
77
|
+
}
|
|
78
|
+
.wrapper {
|
|
79
|
+
padding: 4px 24px 16px 24px;
|
|
80
|
+
.search__bar {
|
|
81
|
+
padding-bottom: 16px;
|
|
82
|
+
input {
|
|
83
|
+
width: 100%;
|
|
84
|
+
padding: 6px 8px;
|
|
85
|
+
border: 1px solid #e0e0e0;
|
|
86
|
+
border-radius: 4px;
|
|
87
|
+
background-image: url('https://firebasestorage.googleapis.com/v0/b/bikayi-chat.appspot.com/o/images-uid%2F5bc8962e-af88-4692-80f1-631ac4a5c6c7?alt=media&token=7931b07d-cb55-43aa-be75-9ddac4b8ddad');
|
|
88
|
+
background-repeat: no-repeat;
|
|
89
|
+
background-position: 95% 50%;
|
|
90
|
+
background-size: 20px 20px;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
.heading__font {
|
|
94
|
+
font-family: 'Inter';
|
|
95
|
+
font-style: normal;
|
|
96
|
+
font-weight: 600;
|
|
97
|
+
font-size: 16px;
|
|
98
|
+
line-height: 24px;
|
|
99
|
+
padding: 12px 0 0 0;
|
|
100
|
+
color: #212121;
|
|
101
|
+
}
|
|
102
|
+
.sub_heading__font {
|
|
103
|
+
font-family: 'Inter';
|
|
104
|
+
font-style: normal;
|
|
105
|
+
font-size: 12px;
|
|
106
|
+
line-height: 24px;
|
|
107
|
+
color: #212121;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.items {
|
|
111
|
+
display: flex;
|
|
112
|
+
flex-wrap: wrap;
|
|
113
|
+
grid-gap: 8px;
|
|
114
|
+
.block {
|
|
115
|
+
display: block;
|
|
116
|
+
min-width: 100%;
|
|
117
|
+
flex-wrap: nowrap;
|
|
118
|
+
width: 430px;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
position: relative;
|
|
123
|
+
|
|
124
|
+
.bottom__padding {
|
|
125
|
+
background: white;
|
|
126
|
+
min-height: 30px;
|
|
127
|
+
width: 100%;
|
|
128
|
+
position: sticky;
|
|
129
|
+
z-index: 10;
|
|
130
|
+
bottom: 0px;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
`;o.default.div`
|
|
134
|
+
.box {
|
|
135
|
+
display: flex;
|
|
136
|
+
align-items: center;
|
|
137
|
+
cursor: pointer;
|
|
138
|
+
padding: 6px 12px 6px 8px;
|
|
139
|
+
gap: 8px;
|
|
140
|
+
width: auto;
|
|
141
|
+
height: 32px;
|
|
142
|
+
|
|
143
|
+
background: ${e=>(null==e?void 0:e.isAvailable)?"#f0f0f0":"#fafafa"};
|
|
144
|
+
|
|
145
|
+
border: 1px solid #e0e0e0;
|
|
146
|
+
border-radius: 4px;
|
|
147
|
+
.icon {
|
|
148
|
+
color: ${e=>(null==e?void 0:e.isAvailable)?"#212121":"#bdbdbd"};
|
|
149
|
+
display: flex;
|
|
150
|
+
align-items: center;
|
|
151
|
+
}
|
|
152
|
+
.variable__name {
|
|
153
|
+
font-family: 'Inter';
|
|
154
|
+
font-style: normal;
|
|
155
|
+
font-weight: 400;
|
|
156
|
+
font-size: 14px;
|
|
157
|
+
line-height: 20px;
|
|
158
|
+
color: ${e=>(null==e?void 0:e.isAvailable)?"#212121":"#bdbdbd"};
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
`,exports.AddVariableStyled=t;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { VariableListInterfaceV2 } from "./AddVariableV2";
|
|
3
|
+
export interface VariableV2SideModalProps {
|
|
4
|
+
data: VariableListInterfaceV2[];
|
|
5
|
+
showVariable: any;
|
|
6
|
+
setShowVariable: any;
|
|
7
|
+
variableValue?: any;
|
|
8
|
+
setVariableValue?: any;
|
|
9
|
+
placeholder: string;
|
|
10
|
+
customTrigger?: any;
|
|
11
|
+
isSearchRequired?: boolean;
|
|
12
|
+
leftPosition?: number;
|
|
13
|
+
pickerSize?: string;
|
|
14
|
+
}
|
|
15
|
+
export declare const AddVariableV2SideModal: React.FC<VariableV2SideModalProps>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),a=require("react-dom"),r=require("./AddVariableV2.js"),d=require("../side-modal/SideModal.style.js");function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var i=t(a);exports.AddVariableV2SideModal=a=>i.default.createPortal(e.jsx(d.SideModalStyle,{children:e.jsx(d.SideModalContainer,{children:e.jsx(r.default,{data:a.data,showVariable:a.showVariable,setShowVariable:a.setShowVariable,placeholder:"Add a variable",customTrigger:a.customTrigger})})}),document.body);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './AddVariableV2SideModal';
|
|
@@ -28,6 +28,7 @@ export interface AnalyticsDropdownInterface {
|
|
|
28
28
|
offsetSkid?: number;
|
|
29
29
|
offsetDistance?: number;
|
|
30
30
|
};
|
|
31
|
+
variant?: 'small' | 'default';
|
|
31
32
|
}
|
|
32
33
|
export declare const AnalyticsDropdown: React.FC<AnalyticsDropdownInterface>;
|
|
33
34
|
export declare const EachItem: React.FC<{
|
|
@@ -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"),o=require("react"),t=require("react-bootstrap"),n=require("../../constants/Theme.js"),s=require("../datePicker/DatePicker.js"),i=require("../TypographyStyle.js"),l=require("./CommonStyles.js");const a=o=>{let{eachOption:t,selectedOption:s,selectedDate:a,onClickingEachItem:c,rangeSelection:r}=o;return e.jsxs(l.ItemMenuContainer,Object.assign({onClick:()=>c(t),isSelected:t.isCustom?t.key==(null==s?void 0:s.key)&&!!a:t.key==(null==s?void 0:s.key)},{children:[e.jsx(i.BodySecondary,Object.assign({color:t.key==(null==s?void 0:s.key)?n.BASE_COLORS.positive[900]:n.BASE_COLORS.grayscale[900]},{children:t.label})),a&&(null==s?void 0:s.isCustom)&&t.key==(null==s?void 0:s.key)&&e.jsx(i.BodyCaption,{children:r?`${d(a[0])} to ${d(a[1])}`:`${d(a[0])}`})]}),t.key)},d=e=>e.toLocaleString("default",{day:"numeric",month:"short",year:"numeric"});exports.AnalyticsDropdown=c=>{let{options:r,placeholder:u="Select an option",selected:g,onOptionSelected:p,resetDropdown:v,maxHeight:O,backgroundColor:m,calendarPopperConfig:j,variant:D="default"}=c;var y,S,b;const[h,x]=o.useState(!1),[f,k]=o.useState(g),[w,C]=o.useState(),[R,E]=o.useState(!1),T=()=>{!h&&E(!R)},[A,M]=o.useState(g),q="small"===D?i.Caption:i.BodySecondary;return o.useEffect((()=>{v&&k(void 0)}),[v]),o.useEffect((()=>{var e;(null==g?void 0:g.isCustom)&&(null===(e=g.dateRangeSelectionOptions)||void 0===e?void 0:e.selectedDates)?C(g.dateRangeSelectionOptions.selectedDates):g&&k(g)}),[g]),e.jsx(e.Fragment,{children:e.jsxs(l.MainDropdown,Object.assign({drop:"down",show:R,onToggle:T,backgroundColor:m},{children:[e.jsx(t.Dropdown.Toggle,Object.assign({id:"dropdown-autoclose-outside",className:"main--dropdown",style:"small"===D?{display:"flex",alignItems:"center",gap:6,padding:"4px 8px",backgroundColor:"#FAFAFA",borderRadius:4,border:`1px solid ${n.DEFAULT_THEME.colorsV2.stroke.primary}`}:void 0},{children:e.jsx(q,Object.assign({style:"small"===D?{color:n.DEFAULT_THEME.colorsV2.content.secondary}:void 0},{children:(null==f?void 0:f.isCustom)?w?d(w[0])===d(w[1])?`${d(w[0])}`:`${d(w[0])} to ${d(w[1])}`:null==A?void 0:A.label:f?null==f?void 0:f.label:u}))})),e.jsx(t.Dropdown.Menu,Object.assign({className:"main--dropdown"},{children:e.jsxs(l.MainDropdown,Object.assign({drop:"end",id:"sub--dropdown",show:h,onToggle:e=>{!e&&E(!1),x(!h)}},{children:[e.jsx("div",Object.assign({style:{maxHeight:O||"auto",overflowY:"scroll"}},{children:r.map((o=>{var n;return e.jsx("div",{children:(null==o?void 0:o.isCustom)?e.jsx(t.Dropdown.Toggle,Object.assign({className:"sub--dropdown"},{children:e.jsx(a,{eachOption:o,selectedOption:f,selectedDate:w,onClickingEachItem:e=>{k(e),x(!0)},rangeSelection:!!(null===(n=null==o?void 0:o.dateRangeSelectionOptions)||void 0===n?void 0:n.selectRange)})})):e.jsx(a,{eachOption:o,selectedOption:f,selectedDate:w,onClickingEachItem:e=>{if(k(e),M(e),T(),!e.noOfDays)return void p(e);const o=new Date,t=new Date;t.setDate(o.getDate()-e.noOfDays),p(Object.assign(Object.assign({},e),{selectedRange:[t,o]}))}})},null==o?void 0:o.key)}))})),e.jsx(t.Dropdown.Menu,Object.assign({className:"sub--dropdown",popperConfig:{modifiers:[{name:"offset",options:{offset:[(null==j?void 0:j.offsetSkid)||0,(null==j?void 0:j.offsetDistance)||0]}}]}},{children:e.jsx(s.DatePicker,{selectRange:(null===(y=null==f?void 0:f.dateRangeSelectionOptions)||void 0===y?void 0:y.selectRange)||!1,maxDate:null===(S=null==f?void 0:f.dateRangeSelectionOptions)||void 0===S?void 0:S.maxDate,minDate:null===(b=null==f?void 0:f.dateRangeSelectionOptions)||void 0===b?void 0:b.minDate,selectedDates:w,onSelectRange:(e,o)=>{const t=[e,o];(null==f?void 0:f.dateRangeSelectionOptions)&&(f.dateRangeSelectionOptions.selectedDates=t,p(Object.assign(Object.assign({},f),{selectedRange:[e,o]}))),M(f),x(!1),C(t),E(!R)},onSelectDate:e=>{(null==f?void 0:f.dateRangeSelectionOptions)&&(f.dateRangeSelectionOptions.selectedDates=[e,e],p(Object.assign(Object.assign({},f),{selectedRange:[e,e]}))),M(f),x(!1),C([e,e]),E(!R)}})}))]}))}))]}))})},exports.EachItem=a,exports.formatDate=d;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@emotion/styled/base"),r=require("react/jsx-runtime"),g=require("../../../../utils/StringUtils.js"),t=require("../../../../constants/Theme.js"),i=require("react");require("../../../checkBox/CheckBox.styled.js");var I=require("../../../TypographyStyle.js");require("../../../list-item/ListItem.js"),require("../../../pagination/Pagination.js"),require("../../../radioButton/RadioButton.styled.js"),require("react-toastify"),require("../../../toaster/Toaster.styled.js"),require("@tippyjs/react"),require("../../../tooltips/TooltipInternal.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("../../../template-preview/models/TemplateMeta.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/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 C=require("./PieChart.js");require("../HorizontalBarGraph/HorizontalGraph.js"),require("../StackedBarChart/StackedBarChart.js"),require("../VerticalBarGraph/VerticalGraph.js"),require("../heatmap/HeatMap.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("../../../curtain/CurtainHelper.js"),require("../../../switch/Switch.js"),require("../../../plans/SubscriptionPlanStyled.js"),require("../../../plans/SubscriptionPlanSelector.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("../../../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("../../../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("../../../product-picker-v2/emptyState.js"),require("../../../product-picker-v2/style.js"),require("lodash"),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("react-dom"),require("../../../side-modal/SideModal.style.js");var s=require("chart.js"),c=require("react-chartjs-2");function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var A=o(e);s.Chart.register(s.ArcElement,s.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),g=parseFloat((e.raw/r*100).toFixed(1));return` ${e.label}: ${g}%`}}}}},a=["#5E07BB","#9E77ED","#D2AEFF","#CDE1FF","#92AFFA","#3935E1"],d=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,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIlBpZUNoYXJ0QW5hbHl0aWNzLnRzeCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFzQzhCIiwiZmlsZSI6IlBpZUNoYXJ0QW5hbHl0aWNzLnRzeCIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IGpzeCBhcyBfanN4LCBGcmFnbWVudCBhcyBfRnJhZ21lbnQsIGpzeHMgYXMgX2pzeHMgfSBmcm9tIFwicmVhY3QvanN4LXJ1bnRpbWVcIjtcclxuaW1wb3J0IHN0eWxlZCBmcm9tICdAZW1vdGlvbi9zdHlsZWQnO1xyXG5pbXBvcnQgeyBTdHJpbmdVdGlscyB9IGZyb20gXCIuLi8uLi8uLi8uLi9pbmRleFwiO1xyXG5pbXBvcnQgeyBBcmNFbGVtZW50LCBDaGFydCBhcyBDaGFydEpTLCBMZWdlbmQgfSBmcm9tICdjaGFydC5qcyc7XHJcbmltcG9ydCB7IHVzZUVmZmVjdCwgdXNlU3RhdGUgfSBmcm9tICdyZWFjdCc7XHJcbmltcG9ydCB7IERvdWdobnV0IH0gZnJvbSAncmVhY3QtY2hhcnRqcy0yJztcclxuaW1wb3J0IHsgVGl0bGVNZWRpdW0gfSBmcm9tIFwiLi4vLi4vLi4vVHlwb2dyYXBoeVN0eWxlXCI7XHJcbmltcG9ydCB7IENPTE9SUyB9IGZyb20gXCIuLi8uLi8uLi8uLi9jb25zdGFudHMvVGhlbWVcIjtcclxuaW1wb3J0IHsgUGllQ2hhcnQgfSBmcm9tICcuL1BpZUNoYXJ0JztcclxuQ2hhcnRKUy5yZWdpc3RlcihBcmNFbGVtZW50LCBMZWdlbmQpO1xyXG5jb25zdCBvcHRpb25zID0ge1xyXG4gICAgcGx1Z2luczoge1xyXG4gICAgICAgIGxlZ2VuZDoge1xyXG4gICAgICAgICAgICBkaXNwbGF5OiBmYWxzZSxcclxuICAgICAgICB9LFxyXG4gICAgICAgIHRvb2x0aXA6IHtcclxuICAgICAgICAgICAgZW5hYmxlZDogdHJ1ZSxcclxuICAgICAgICAgICAgY2FsbGJhY2tzOiB7XHJcbiAgICAgICAgICAgICAgICBsYWJlbDogKHRvb2x0aXBJdGVtKSA9PiB7XHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKCF0b29sdGlwSXRlbS5sYWJlbCkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gYCAwJWA7XHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IHRvdGFsID0gdG9vbHRpcEl0ZW0uZGF0YXNldC5kYXRhLnJlZHVjZSgoYWNjLCBjdXIpID0+IGFjYyArIGN1ciwgMCk7XHJcbiAgICAgICAgICAgICAgICAgICAgY29uc3QgcGVyY2VudGFnZSA9IHBhcnNlRmxvYXQoKCh0b29sdGlwSXRlbS5yYXcgLyB0b3RhbCkgKiAxMDApLnRvRml4ZWQoMSkpO1xyXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBgICR7dG9vbHRpcEl0ZW0ubGFiZWx9OiAke3BlcmNlbnRhZ2V9JWA7XHJcbiAgICAgICAgICAgICAgICB9LFxyXG4gICAgICAgICAgICB9LFxyXG4gICAgICAgIH0sXHJcbiAgICB9LFxyXG59O1xyXG5jb25zdCBHUkFQSF9DT0xPUlMgPSBbXHJcbiAgICAnIzVFMDdCQicsXHJcbiAgICAnIzlFNzdFRCcsXHJcbiAgICAnI0QyQUVGRicsXHJcbiAgICAnI0NERTFGRicsXHJcbiAgICAnIzkyQUZGQScsXHJcbiAgICAnIzM5MzVFMScsXHJcbl07XHJcbmNvbnN0IENhcnRTdHlsZWQgPSBzdHlsZWQuZGl2IGBcblx0YmFja2dyb3VuZDogJHsocHJvcHMpID0+IENPTE9SUy5zdXJmYWNlLnN0YW5kYXJkfTtcblx0Ym9yZGVyOiAxcHggc29saWQgJHsocHJvcHMpID0+IENPTE9SUy5zdHJva2UucHJpbWFyeX07XG5cdGJvcmRlci1yYWRpdXM6IDRweDtcbmA7XHJcbmV4cG9ydCBjb25zdCBDYXJkID0gKHByb3BzKSA9PiB7XHJcbiAgICByZXR1cm4gX2pzeChDYXJ0U3R5bGVkLCBPYmplY3QuYXNzaWduKHsgc3R5bGU6IHsgcGFkZGluZzogMjQgfSB9LCB7IGNoaWxkcmVuOiBwcm9wcy5jaGlsZHJlbiB9KSk7XHJcbn07XHJcbmV4cG9ydCBjb25zdCBQaWVDaGFydEFuYWx5dGljcyA9ICh7IHRpdGxlLCBzbGljZXMsIHNpemUsIH0pID0+IHtcclxuICAgIGNvbnN0IFtzbGljZXNXaXRoQ29sb3IsIHNldFNsaWNlc1dpdGhDb2xvcl0gPSB1c2VTdGF0ZShbXSk7XHJcbiAgICBjb25zdCBbZGF0YSwgc2V0RGF0YV0gPSB1c2VTdGF0ZSgpO1xyXG4gICAgdXNlRWZmZWN0KCgpID0+IHtcclxuICAgICAgICBjb25zdCB0b3RhbFN1bSA9IHNsaWNlcy5yZWR1Y2UoKHN1bSwgc2xpY2UpID0+IHN1bSArIHNsaWNlLmNvdW50LCAwKTtcclxuICAgICAgICBsZXQgdXBkYXRlZFNsaWNlc1dpdGhDb2xvciA9IFtdO1xyXG4gICAgICAgIHVwZGF0ZWRTbGljZXNXaXRoQ29sb3IgPSBPYmplY3Qua2V5cyhzbGljZXMpLm1hcCgoa2V5LCBpbmRleCkgPT4gKE9iamVjdC5hc3NpZ24oeyBjb2xvcjogR1JBUEhfQ09MT1JTW2luZGV4ICUgR1JBUEhfQ09MT1JTLmxlbmd0aF0gfSwgc2xpY2VzW2tleV0pKSk7XHJcbiAgICAgICAgc2V0U2xpY2VzV2l0aENvbG9yKFsuLi51cGRhdGVkU2xpY2VzV2l0aENvbG9yXSk7XHJcbiAgICAgICAgaWYgKHRvdGFsU3VtID09PSAwKSB7XHJcbiAgICAgICAgICAgIGNvbnN0IGRhdGFTZXQgPSB7XHJcbiAgICAgICAgICAgICAgICBkYXRhc2V0czogW1xyXG4gICAgICAgICAgICAgICAgICAgIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgZGF0YTogWzEwMF0sXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGJhY2tncm91bmRDb2xvcjogWycjRjBGMEYwJ10sXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGJvcmRlcldpZHRoOiAwLFxyXG4gICAgICAgICAgICAgICAgICAgIH0sXHJcbiAgICAgICAgICAgICAgICBdLFxyXG4gICAgICAgICAgICB9O1xyXG4gICAgICAgICAgICBzZXREYXRhKGRhdGFTZXQpO1xyXG4gICAgICAgIH1cclxuICAgICAgICBlbHNlIHtcclxuICAgICAgICAgICAgY29uc3QgZGF0YVNldCA9IHtcclxuICAgICAgICAgICAgICAgIGxhYmVsczogc2xpY2VzLm1hcCgoc2xpY2UpID0+IFN0cmluZ1V0aWxzLmNhcGl0YWxpemUoc2xpY2UubmFtZSkpLFxyXG4gICAgICAgICAgICAgICAgZGF0YXNldHM6IFtcclxuICAgICAgICAgICAgICAgICAgICB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGRhdGE6IHNsaWNlcy5tYXAoKHNsaWNlKSA9PiBzbGljZS5jb3VudCksXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGJhY2tncm91bmRDb2xvcjogc2xpY2VzLm1hcCgoc2xpY2UsIGluZGV4KSA9PiB7IHZhciBfYTsgcmV0dXJuIChfYSA9IHNsaWNlLmNvbG9yKSAhPT0gbnVsbCAmJiBfYSAhPT0gdm9pZCAwID8gX2EgOiBHUkFQSF9DT0xPUlNbaW5kZXggJSBHUkFQSF9DT0xPUlMubGVuZ3RoXTsgfSksXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGJvcmRlckNvbG9yOiBbJ3doaXRlJywgJ3doaXRlJywgJ3doaXRlJywgJ3doaXRlJywgJ3doaXRlJywgJ3doaXRlJ10sXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGJvcmRlcldpZHRoOiA0LFxyXG4gICAgICAgICAgICAgICAgICAgICAgICBib3JkZXJSYWRpdXM6IDgsXHJcbiAgICAgICAgICAgICAgICAgICAgfSxcclxuICAgICAgICAgICAgICAgIF0sXHJcbiAgICAgICAgICAgIH07XHJcbiAgICAgICAgICAgIHNldERhdGEoZGF0YVNldCk7XHJcbiAgICAgICAgfVxyXG4gICAgfSwgW3NsaWNlc10pO1xyXG4gICAgaWYgKCFkYXRhKSB7XHJcbiAgICAgICAgcmV0dXJuIF9qc3goX0ZyYWdtZW50LCB7fSk7XHJcbiAgICB9XHJcbiAgICByZXR1cm4gKF9qc3hzKF9GcmFnbWVudCwgeyBjaGlsZHJlbjogW3RpdGxlICYmIChfanN4KFRpdGxlTWVkaXVtLCBPYmplY3QuYXNzaWduKHsgc3R5bGU6IHtcclxuICAgICAgICAgICAgICAgICAgICBtYXJnaW5Cb3R0b206IDE2LFxyXG4gICAgICAgICAgICAgICAgfSB9LCB7IGNoaWxkcmVuOiB0aXRsZSB9KSkpLCBfanN4cyhcImRpdlwiLCBPYmplY3QuYXNzaWduKHsgY2xhc3NOYW1lOiAncm93JyB9LCB7IGNoaWxkcmVuOiBbX2pzeChcImRpdlwiLCBPYmplY3QuYXNzaWduKHsgY2xhc3NOYW1lOiAnY29sLTYnIH0sIHsgY2hpbGRyZW46IF9qc3goXCJkaXZcIiwgT2JqZWN0LmFzc2lnbih7IHN0eWxlOiB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd2lkdGg6IHNpemUsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGVpZ2h0OiBzaXplLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSB9LCB7IGNoaWxkcmVuOiBfanN4KERvdWdobnV0LCB7IGRhdGE6IGRhdGEsIG9wdGlvbnM6IE9iamVjdC5hc3NpZ24oT2JqZWN0LmFzc2lnbih7fSwgb3B0aW9ucyksIHsgbWFpbnRhaW5Bc3BlY3RSYXRpbzogc2l6ZSA/IGZhbHNlIDogdHJ1ZSB9KSB9KSB9KSkgfSkpLCBfanN4KFwiZGl2XCIsIE9iamVjdC5hc3NpZ24oeyBjbGFzc05hbWU6ICdjb2wtNicsIHN0eWxlOiB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYWRkaW5nTGVmdDogNDgsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkaXNwbGF5OiAnZmxleCcsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBmbGV4RGlyZWN0aW9uOiAnY29sdW1uJyxcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGp1c3RpZnlDb250ZW50OiAnY2VudGVyJyxcclxuICAgICAgICAgICAgICAgICAgICAgICAgfSB9LCB7IGNoaWxkcmVuOiBfanN4KFBpZUNoYXJ0LCB7IHNsaWNlczogc2xpY2VzV2l0aENvbG9yIH0pIH0pKV0gfSkpXSB9KSk7XHJcbn07XHJcbi8vIyBzb3VyY2VNYXBwaW5nVVJMPVBpZUNoYXJ0QW5hbHl0aWNzLmpzLm1hcCJdfQ== */"));exports.Card=e=>r.jsx(d,Object.assign({style:{padding:24}},{children:e.children})),exports.PieChartAnalytics=e=>{let{title:t,slices:s,size:o}=e;const[A,d]=i.useState([]),[u,n]=i.useState();return i.useEffect((()=>{const e=s.reduce(((e,r)=>e+r.count),0);let r=[];if(r=Object.keys(s).map(((e,r)=>Object.assign({color:a[r%a.length]},s[e]))),d([...r]),0===e){n({datasets:[{data:[100],backgroundColor:["#F0F0F0"],borderWidth:0}]})}else{const e={labels:s.map((e=>g.default.capitalize(e.name))),datasets:[{data:s.map((e=>e.count)),backgroundColor:s.map(((e,r)=>{var g;return null!==(g=e.color)&&void 0!==g?g:a[r%a.length]})),borderColor:["white","white","white","white","white","white"],borderWidth:4,borderRadius:8}]};n(e)}}),[s]),u?r.jsxs(r.Fragment,{children:[t&&r.jsx(I.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:o,height:o}},{children:r.jsx(c.Doughnut,{data:u,options:Object.assign(Object.assign({},l),{maintainAspectRatio:!o})})}))})),r.jsx("div",Object.assign({className:"col-6",style:{paddingLeft:48,display:"flex",flexDirection:"column",justifyContent:"center"}},{children:r.jsx(C.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"),g=require("../../../../utils/StringUtils.js"),t=require("../../../../constants/Theme.js"),i=require("react");require("../../../checkBox/CheckBox.styled.js");var I=require("../../../TypographyStyle.js");require("../../../list-item/ListItem.js"),require("../../../pagination/Pagination.js"),require("../../../radioButton/RadioButton.styled.js"),require("react-toastify"),require("../../../toaster/Toaster.styled.js"),require("@tippyjs/react"),require("../../../tooltips/TooltipInternal.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("../../../template-preview/models/TemplateMeta.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/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 C=require("./PieChart.js");require("../HorizontalBarGraph/HorizontalGraph.js"),require("../StackedBarChart/StackedBarChart.js"),require("../VerticalBarGraph/VerticalGraph.js"),require("../heatmap/HeatMap.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("../../../curtain/CurtainHelper.js"),require("../../../switch/Switch.js"),require("../../../plans/SubscriptionPlanStyled.js"),require("../../../plans/SubscriptionPlanSelector.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("../../../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("../../../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("../../../product-picker-v2/emptyState.js"),require("../../../product-picker-v2/style.js"),require("lodash"),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("react-dom"),require("../../../side-modal/SideModal.style.js"),require("../../../add-variableV2/AddVariableV2.styled.js"),require("../../../SearchFilter/components/ChipDropdown.js"),require("../../../SearchFilter/components/DatePickerButton.js"),require("../../../SearchFilter/types/SearchFilter.type.js");var s=require("chart.js"),c=require("react-chartjs-2");function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var A=o(e);s.Chart.register(s.ArcElement,s.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),g=parseFloat((e.raw/r*100).toFixed(1));return` ${e.label}: ${g}%`}}}}},a=["#5E07BB","#9E77ED","#D2AEFF","#CDE1FF","#92AFFA","#3935E1"],d=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,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIlBpZUNoYXJ0QW5hbHl0aWNzLnRzeCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFzQzhCIiwiZmlsZSI6IlBpZUNoYXJ0QW5hbHl0aWNzLnRzeCIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IGpzeCBhcyBfanN4LCBGcmFnbWVudCBhcyBfRnJhZ21lbnQsIGpzeHMgYXMgX2pzeHMgfSBmcm9tIFwicmVhY3QvanN4LXJ1bnRpbWVcIjtcclxuaW1wb3J0IHN0eWxlZCBmcm9tICdAZW1vdGlvbi9zdHlsZWQnO1xyXG5pbXBvcnQgeyBTdHJpbmdVdGlscyB9IGZyb20gXCIuLi8uLi8uLi8uLi9pbmRleFwiO1xyXG5pbXBvcnQgeyBBcmNFbGVtZW50LCBDaGFydCBhcyBDaGFydEpTLCBMZWdlbmQgfSBmcm9tICdjaGFydC5qcyc7XHJcbmltcG9ydCB7IHVzZUVmZmVjdCwgdXNlU3RhdGUgfSBmcm9tICdyZWFjdCc7XHJcbmltcG9ydCB7IERvdWdobnV0IH0gZnJvbSAncmVhY3QtY2hhcnRqcy0yJztcclxuaW1wb3J0IHsgVGl0bGVNZWRpdW0gfSBmcm9tIFwiLi4vLi4vLi4vVHlwb2dyYXBoeVN0eWxlXCI7XHJcbmltcG9ydCB7IENPTE9SUyB9IGZyb20gXCIuLi8uLi8uLi8uLi9jb25zdGFudHMvVGhlbWVcIjtcclxuaW1wb3J0IHsgUGllQ2hhcnQgfSBmcm9tICcuL1BpZUNoYXJ0JztcclxuQ2hhcnRKUy5yZWdpc3RlcihBcmNFbGVtZW50LCBMZWdlbmQpO1xyXG5jb25zdCBvcHRpb25zID0ge1xyXG4gICAgcGx1Z2luczoge1xyXG4gICAgICAgIGxlZ2VuZDoge1xyXG4gICAgICAgICAgICBkaXNwbGF5OiBmYWxzZSxcclxuICAgICAgICB9LFxyXG4gICAgICAgIHRvb2x0aXA6IHtcclxuICAgICAgICAgICAgZW5hYmxlZDogdHJ1ZSxcclxuICAgICAgICAgICAgY2FsbGJhY2tzOiB7XHJcbiAgICAgICAgICAgICAgICBsYWJlbDogKHRvb2x0aXBJdGVtKSA9PiB7XHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKCF0b29sdGlwSXRlbS5sYWJlbCkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gYCAwJWA7XHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IHRvdGFsID0gdG9vbHRpcEl0ZW0uZGF0YXNldC5kYXRhLnJlZHVjZSgoYWNjLCBjdXIpID0+IGFjYyArIGN1ciwgMCk7XHJcbiAgICAgICAgICAgICAgICAgICAgY29uc3QgcGVyY2VudGFnZSA9IHBhcnNlRmxvYXQoKCh0b29sdGlwSXRlbS5yYXcgLyB0b3RhbCkgKiAxMDApLnRvRml4ZWQoMSkpO1xyXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBgICR7dG9vbHRpcEl0ZW0ubGFiZWx9OiAke3BlcmNlbnRhZ2V9JWA7XHJcbiAgICAgICAgICAgICAgICB9LFxyXG4gICAgICAgICAgICB9LFxyXG4gICAgICAgIH0sXHJcbiAgICB9LFxyXG59O1xyXG5jb25zdCBHUkFQSF9DT0xPUlMgPSBbXHJcbiAgICAnIzVFMDdCQicsXHJcbiAgICAnIzlFNzdFRCcsXHJcbiAgICAnI0QyQUVGRicsXHJcbiAgICAnI0NERTFGRicsXHJcbiAgICAnIzkyQUZGQScsXHJcbiAgICAnIzM5MzVFMScsXHJcbl07XHJcbmNvbnN0IENhcnRTdHlsZWQgPSBzdHlsZWQuZGl2IGBcblx0YmFja2dyb3VuZDogJHsocHJvcHMpID0+IENPTE9SUy5zdXJmYWNlLnN0YW5kYXJkfTtcblx0Ym9yZGVyOiAxcHggc29saWQgJHsocHJvcHMpID0+IENPTE9SUy5zdHJva2UucHJpbWFyeX07XG5cdGJvcmRlci1yYWRpdXM6IDRweDtcbmA7XHJcbmV4cG9ydCBjb25zdCBDYXJkID0gKHByb3BzKSA9PiB7XHJcbiAgICByZXR1cm4gX2pzeChDYXJ0U3R5bGVkLCBPYmplY3QuYXNzaWduKHsgc3R5bGU6IHsgcGFkZGluZzogMjQgfSB9LCB7IGNoaWxkcmVuOiBwcm9wcy5jaGlsZHJlbiB9KSk7XHJcbn07XHJcbmV4cG9ydCBjb25zdCBQaWVDaGFydEFuYWx5dGljcyA9ICh7IHRpdGxlLCBzbGljZXMsIHNpemUsIH0pID0+IHtcclxuICAgIGNvbnN0IFtzbGljZXNXaXRoQ29sb3IsIHNldFNsaWNlc1dpdGhDb2xvcl0gPSB1c2VTdGF0ZShbXSk7XHJcbiAgICBjb25zdCBbZGF0YSwgc2V0RGF0YV0gPSB1c2VTdGF0ZSgpO1xyXG4gICAgdXNlRWZmZWN0KCgpID0+IHtcclxuICAgICAgICBjb25zdCB0b3RhbFN1bSA9IHNsaWNlcy5yZWR1Y2UoKHN1bSwgc2xpY2UpID0+IHN1bSArIHNsaWNlLmNvdW50LCAwKTtcclxuICAgICAgICBsZXQgdXBkYXRlZFNsaWNlc1dpdGhDb2xvciA9IFtdO1xyXG4gICAgICAgIHVwZGF0ZWRTbGljZXNXaXRoQ29sb3IgPSBPYmplY3Qua2V5cyhzbGljZXMpLm1hcCgoa2V5LCBpbmRleCkgPT4gKE9iamVjdC5hc3NpZ24oeyBjb2xvcjogR1JBUEhfQ09MT1JTW2luZGV4ICUgR1JBUEhfQ09MT1JTLmxlbmd0aF0gfSwgc2xpY2VzW2tleV0pKSk7XHJcbiAgICAgICAgc2V0U2xpY2VzV2l0aENvbG9yKFsuLi51cGRhdGVkU2xpY2VzV2l0aENvbG9yXSk7XHJcbiAgICAgICAgaWYgKHRvdGFsU3VtID09PSAwKSB7XHJcbiAgICAgICAgICAgIGNvbnN0IGRhdGFTZXQgPSB7XHJcbiAgICAgICAgICAgICAgICBkYXRhc2V0czogW1xyXG4gICAgICAgICAgICAgICAgICAgIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgZGF0YTogWzEwMF0sXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGJhY2tncm91bmRDb2xvcjogWycjRjBGMEYwJ10sXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGJvcmRlcldpZHRoOiAwLFxyXG4gICAgICAgICAgICAgICAgICAgIH0sXHJcbiAgICAgICAgICAgICAgICBdLFxyXG4gICAgICAgICAgICB9O1xyXG4gICAgICAgICAgICBzZXREYXRhKGRhdGFTZXQpO1xyXG4gICAgICAgIH1cclxuICAgICAgICBlbHNlIHtcclxuICAgICAgICAgICAgY29uc3QgZGF0YVNldCA9IHtcclxuICAgICAgICAgICAgICAgIGxhYmVsczogc2xpY2VzLm1hcCgoc2xpY2UpID0+IFN0cmluZ1V0aWxzLmNhcGl0YWxpemUoc2xpY2UubmFtZSkpLFxyXG4gICAgICAgICAgICAgICAgZGF0YXNldHM6IFtcclxuICAgICAgICAgICAgICAgICAgICB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGRhdGE6IHNsaWNlcy5tYXAoKHNsaWNlKSA9PiBzbGljZS5jb3VudCksXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGJhY2tncm91bmRDb2xvcjogc2xpY2VzLm1hcCgoc2xpY2UsIGluZGV4KSA9PiB7IHZhciBfYTsgcmV0dXJuIChfYSA9IHNsaWNlLmNvbG9yKSAhPT0gbnVsbCAmJiBfYSAhPT0gdm9pZCAwID8gX2EgOiBHUkFQSF9DT0xPUlNbaW5kZXggJSBHUkFQSF9DT0xPUlMubGVuZ3RoXTsgfSksXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGJvcmRlckNvbG9yOiBbJ3doaXRlJywgJ3doaXRlJywgJ3doaXRlJywgJ3doaXRlJywgJ3doaXRlJywgJ3doaXRlJ10sXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGJvcmRlcldpZHRoOiA0LFxyXG4gICAgICAgICAgICAgICAgICAgICAgICBib3JkZXJSYWRpdXM6IDgsXHJcbiAgICAgICAgICAgICAgICAgICAgfSxcclxuICAgICAgICAgICAgICAgIF0sXHJcbiAgICAgICAgICAgIH07XHJcbiAgICAgICAgICAgIHNldERhdGEoZGF0YVNldCk7XHJcbiAgICAgICAgfVxyXG4gICAgfSwgW3NsaWNlc10pO1xyXG4gICAgaWYgKCFkYXRhKSB7XHJcbiAgICAgICAgcmV0dXJuIF9qc3goX0ZyYWdtZW50LCB7fSk7XHJcbiAgICB9XHJcbiAgICByZXR1cm4gKF9qc3hzKF9GcmFnbWVudCwgeyBjaGlsZHJlbjogW3RpdGxlICYmIChfanN4KFRpdGxlTWVkaXVtLCBPYmplY3QuYXNzaWduKHsgc3R5bGU6IHtcclxuICAgICAgICAgICAgICAgICAgICBtYXJnaW5Cb3R0b206IDE2LFxyXG4gICAgICAgICAgICAgICAgfSB9LCB7IGNoaWxkcmVuOiB0aXRsZSB9KSkpLCBfanN4cyhcImRpdlwiLCBPYmplY3QuYXNzaWduKHsgY2xhc3NOYW1lOiAncm93JyB9LCB7IGNoaWxkcmVuOiBbX2pzeChcImRpdlwiLCBPYmplY3QuYXNzaWduKHsgY2xhc3NOYW1lOiAnY29sLTYnIH0sIHsgY2hpbGRyZW46IF9qc3goXCJkaXZcIiwgT2JqZWN0LmFzc2lnbih7IHN0eWxlOiB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd2lkdGg6IHNpemUsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGVpZ2h0OiBzaXplLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSB9LCB7IGNoaWxkcmVuOiBfanN4KERvdWdobnV0LCB7IGRhdGE6IGRhdGEsIG9wdGlvbnM6IE9iamVjdC5hc3NpZ24oT2JqZWN0LmFzc2lnbih7fSwgb3B0aW9ucyksIHsgbWFpbnRhaW5Bc3BlY3RSYXRpbzogc2l6ZSA/IGZhbHNlIDogdHJ1ZSB9KSB9KSB9KSkgfSkpLCBfanN4KFwiZGl2XCIsIE9iamVjdC5hc3NpZ24oeyBjbGFzc05hbWU6ICdjb2wtNicsIHN0eWxlOiB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYWRkaW5nTGVmdDogNDgsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkaXNwbGF5OiAnZmxleCcsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBmbGV4RGlyZWN0aW9uOiAnY29sdW1uJyxcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGp1c3RpZnlDb250ZW50OiAnY2VudGVyJyxcclxuICAgICAgICAgICAgICAgICAgICAgICAgfSB9LCB7IGNoaWxkcmVuOiBfanN4KFBpZUNoYXJ0LCB7IHNsaWNlczogc2xpY2VzV2l0aENvbG9yIH0pIH0pKV0gfSkpXSB9KSk7XHJcbn07XHJcbi8vIyBzb3VyY2VNYXBwaW5nVVJMPVBpZUNoYXJ0QW5hbHl0aWNzLmpzLm1hcCJdfQ== */"));exports.Card=e=>r.jsx(d,Object.assign({style:{padding:24}},{children:e.children})),exports.PieChartAnalytics=e=>{let{title:t,slices:s,size:o}=e;const[A,d]=i.useState([]),[u,n]=i.useState();return i.useEffect((()=>{const e=s.reduce(((e,r)=>e+r.count),0);let r=[];if(r=Object.keys(s).map(((e,r)=>Object.assign({color:a[r%a.length]},s[e]))),d([...r]),0===e){n({datasets:[{data:[100],backgroundColor:["#F0F0F0"],borderWidth:0}]})}else{const e={labels:s.map((e=>g.default.capitalize(e.name))),datasets:[{data:s.map((e=>e.count)),backgroundColor:s.map(((e,r)=>{var g;return null!==(g=e.color)&&void 0!==g?g:a[r%a.length]})),borderColor:["white","white","white","white","white","white"],borderWidth:4,borderRadius:8}]};n(e)}}),[s]),u?r.jsxs(r.Fragment,{children:[t&&r.jsx(I.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:o,height:o}},{children:r.jsx(c.Doughnut,{data:u,options:Object.assign(Object.assign({},l),{maintainAspectRatio:!o})})}))})),r.jsx("div",Object.assign({className:"col-6",style:{paddingLeft:48,display:"flex",flexDirection:"column",justifyContent:"center"}},{children:r.jsx(C.PieChart,{slices:A})}))]}))]}):r.jsx(r.Fragment,{})};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
import { VariableListInterfaceV2 } from "../add-variableV2/AddVariableV2";
|
|
2
3
|
import { CHANNEL_TYPE } from '../template-preview/models/Channels';
|
|
3
4
|
import { EmailTemplateType } from '../template-preview/models/EmailTemplate';
|
|
4
5
|
import { SMSTemplateType } from '../template-preview/models/SmsTemplate';
|
|
@@ -18,5 +19,7 @@ export interface TemplateContextMapperProps {
|
|
|
18
19
|
onTemplateSelect?(template: EmailTemplateType | SMSTemplateType | WhatsAppTemplate, variables: CUSTOM_VARIABLE[] | WhatsAppTemplateVariables, display_content?: string): string | void;
|
|
19
20
|
whatsappSpecificPickerMeta?: WhatsAppPickerMeta;
|
|
20
21
|
zIndex?: number;
|
|
22
|
+
showVariableModal?: boolean;
|
|
23
|
+
variableList?: VariableListInterfaceV2[];
|
|
21
24
|
}
|
|
22
|
-
export declare const TemplateContextMapper: ({ selectedTemplate, closeDialog, showVariableMapping, channel, htmlContent, templateVariables, onTemplateSelect, globalPlaceholders, showOnlyContent, whatsappSpecificPickerMeta, zIndex, }: TemplateContextMapperProps) => JSX.Element;
|
|
25
|
+
export declare const TemplateContextMapper: ({ selectedTemplate, closeDialog, showVariableMapping, channel, htmlContent, templateVariables, onTemplateSelect, globalPlaceholders, showOnlyContent, whatsappSpecificPickerMeta, zIndex, showVariableModal, variableList, }: TemplateContextMapperProps) => JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),l=require("../../utils/StringUtils.js"),a=require("../modals/styledModal.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),l=require("../../utils/StringUtils.js"),a=require("../modals/styledModal.js"),i=require("../template-preview/models/Channels.js"),r=require("./context/templateModalContext.js"),s=require("./modalElements/Footer.js"),o=require("./modalElements/TemplateSelectModalContent.js"),n=require("./utils/convertPlaceholdersToBikDropdown.js");exports.TemplateContextMapper=d=>{let{selectedTemplate:c,closeDialog:u,showVariableMapping:p,channel:m,htmlContent:h,templateVariables:g,onTemplateSelect:S,globalPlaceholders:v,showOnlyContent:b,whatsappSpecificPickerMeta:j,zIndex:M,showVariableModal:T,variableList:E}=d;var x,C;t.useEffect((()=>{w(h)}),[h]);const[P,L]=t.useState(m===i.CHANNEL_TYPE.EMAIL?"desktop":"mobile"),[f,w]=t.useState(h),[q,y]=t.useState(!1),[A,N]=t.useState(c),[V,_]=t.useState(null!=g?g:[]),[H,I]=t.useState(!1);const O=t.useMemo((()=>n.convertPlaceholdersToBikDropdown(v)),[v]);return e.jsx(r.TemplateModalContext.Provider,Object.assign({value:{template:A,setTemplate:N,device:P,setDevice:L,display_content:f,setDisplayContent:w,originalVariableList:V,setOriginalVariableList:_,isError:q,setIsError:y,channel:m,globalNormalizedPlaceholders:O,templateSelectionTriggered:H,setTemplateSelectionTriggered:I}},{children:b?e.jsx(o.default,{channel:i.CHANNEL_TYPE.EMAIL,hideHeader:!0}):e.jsxs(a.StyledModal,Object.assign({zIndex:M,centralContainerStyles:{width:m===i.CHANNEL_TYPE.EMAIL&&p?1e3:650},open:!0,onClose:()=>{null==u||u()},headingTitle:null==A?void 0:A.label,headingSubtitle:m===i.CHANNEL_TYPE.WHATSAPP?`${l.default.capitaliseFirstLetterOfString(null!==(x=null==A?void 0:A.category)&&void 0!==x?x:"")} • ${null!==(C=null==A?void 0:A.templateCategory)&&void 0!==C?C:""}`:""},{children:[e.jsx(o.default,{showVariableMapping:p,channel:m,whatsappSpecificPickerMeta:j,showVariableModal:T,variableList:E}),S?e.jsx(s.default,{onSelect:function(){const e=null==S?void 0:S(A,V,null!=f?f:"");e?y(!!e):I(!0)}}):e.jsx(e.Fragment,{})]}))}))};
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
import { VariableListInterfaceV2 } from "../../add-variableV2/AddVariableV2";
|
|
2
3
|
import { WhatsAppPickerMeta } from "../../template-preview/models/WhatsAppTemplate";
|
|
3
4
|
export interface BodyProps {
|
|
4
5
|
showVariableMapping: boolean;
|
|
5
6
|
showOnlyContent?: boolean;
|
|
6
7
|
whatsappSpecificPickerMeta?: WhatsAppPickerMeta;
|
|
8
|
+
showVariableModal?: boolean;
|
|
9
|
+
variableList?: VariableListInterfaceV2[];
|
|
7
10
|
}
|
|
8
11
|
declare const Body: (props: BodyProps) => JSX.Element;
|
|
9
12
|
export default Body;
|