@bikdotai/bik-component-library 0.0.209 → 0.0.210-beta.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/components/QueryBuilder/components/Connectors/Components/InTheLast.js +1 -1
- package/dist/cjs/components/QueryBuilder/components/Connectors/Components/InTwoLast.d.ts +4 -0
- package/dist/cjs/components/QueryBuilder/components/Connectors/Components/InTwoLast.js +1 -0
- package/dist/cjs/components/QueryBuilder/components/Connectors/Connector.js +1 -1
- package/dist/cjs/components/QueryBuilder/constants/DATE_OPERATORS_OPTIONS.d.ts +2 -0
- package/dist/cjs/components/QueryBuilder/constants/DATE_OPERATORS_OPTIONS.js +1 -0
- package/dist/cjs/components/QueryBuilder/constants/connector.d.ts +16 -7
- package/dist/cjs/components/QueryBuilder/constants/connector.js +1 -1
- package/dist/cjs/components/QueryBuilder/helpers/Connector.helper.d.ts +2 -0
- package/dist/cjs/components/QueryBuilder/helpers/Connector.helper.js +1 -1
- package/dist/cjs/components/QueryBuilder/types/QueryBuilderConnector.type.d.ts +1 -1
- package/dist/cjs/components/QueryBuilder/types/QueryBuilderOperator.type.d.ts +15 -7
- package/dist/cjs/components/QueryBuilder/types/QueryBuilderOperator.type.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 +1 -0
- package/dist/cjs/components/country-code-picker/CountryCodePicker.js +1 -1
- package/dist/cjs/components/custom-date-time/CustomDateTime.js +1 -1
- package/dist/cjs/components/discount-modal/DiscountModal.js +1 -1
- package/dist/cjs/components/discount-modal/DynamicCoupon/DynamicCoupon.js +1 -1
- package/dist/cjs/components/dropdown/DropdownPopover/index.d.ts +1 -1
- package/dist/cjs/components/dropdown/MenuItem/MenuItem.js +1 -1
- package/dist/cjs/components/dropdown/index.d.ts +2 -1
- package/dist/cjs/components/dropdown-button/DropdownButton.d.ts +2 -2
- package/dist/cjs/components/dropdown-button/DropdownButton.js +1 -1
- package/dist/cjs/components/stepper/WorkingStepper.d.ts +1 -0
- package/dist/cjs/index.js +1 -1
- package/dist/esm/components/QueryBuilder/components/Connectors/Components/InTheLast.js +1 -1
- package/dist/esm/components/QueryBuilder/components/Connectors/Components/InTwoLast.d.ts +4 -0
- package/dist/esm/components/QueryBuilder/components/Connectors/Components/InTwoLast.js +1 -0
- package/dist/esm/components/QueryBuilder/components/Connectors/Connector.js +1 -1
- package/dist/esm/components/QueryBuilder/constants/DATE_OPERATORS_OPTIONS.d.ts +2 -0
- package/dist/esm/components/QueryBuilder/constants/DATE_OPERATORS_OPTIONS.js +1 -0
- package/dist/esm/components/QueryBuilder/constants/connector.d.ts +16 -7
- package/dist/esm/components/QueryBuilder/constants/connector.js +1 -1
- package/dist/esm/components/QueryBuilder/helpers/Connector.helper.d.ts +2 -0
- package/dist/esm/components/QueryBuilder/helpers/Connector.helper.js +1 -1
- package/dist/esm/components/QueryBuilder/types/QueryBuilderConnector.type.d.ts +1 -1
- package/dist/esm/components/QueryBuilder/types/QueryBuilderOperator.type.d.ts +15 -7
- package/dist/esm/components/QueryBuilder/types/QueryBuilderOperator.type.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 +1 -0
- package/dist/esm/components/country-code-picker/CountryCodePicker.js +1 -1
- package/dist/esm/components/custom-date-time/CustomDateTime.js +1 -1
- package/dist/esm/components/discount-modal/DiscountModal.js +1 -1
- package/dist/esm/components/discount-modal/DynamicCoupon/DynamicCoupon.js +1 -1
- package/dist/esm/components/dropdown/DropdownPopover/index.d.ts +1 -1
- package/dist/esm/components/dropdown/MenuItem/MenuItem.js +1 -1
- package/dist/esm/components/dropdown/index.d.ts +2 -1
- package/dist/esm/components/dropdown-button/DropdownButton.d.ts +2 -2
- package/dist/esm/components/dropdown-button/DropdownButton.js +1 -1
- package/dist/esm/components/stepper/WorkingStepper.d.ts +1 -0
- package/dist/esm/index.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@emotion/styled/base"),I=require("react/jsx-runtime"),d=require("react")
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@emotion/styled/base"),I=require("react/jsx-runtime"),d=require("react");require("../../../../dropdown/DropdownPopover/index.js");var g=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("../../../../dropdown/OpenedDropdown/components/menu/SelectAllMenu.js"),require("../../../../button/Button.js"),require("../../../../dropdown/OpenedDropdown/components/multiSelect/MultiSelectDropdownBottomBar.styled.js"),require("../../../../dropdown/OpenedDropdown/components/OpennedDropdown.styled.js");var l=require("../../../../input/Input.js"),c=require("../../../../input/context/InputStyleProvider.js");require("../../../../dropdown/MenuItem/MenuItem.js");var n=require("../../InputLoader.js");function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}const u=o(e).default("div","production"===process.env.NODE_ENV?{target:"e18hgh550"}:{target:"e18hgh550",label:"Container"})("production"===process.env.NODE_ENV?{name:"180p6fo",styles:"display:flex;flex-direction:row;gap:12px"}:{name:"180p6fo",styles:"display:flex;flex-direction:row;gap:12px",map:"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkluVGhlTGFzdC50c3giXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBTzZCIiwiZmlsZSI6I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B7IGRpc2FibGVkOiBkaXNhYmxlZCwgcGxhY2VIb2xkZXI6IFwiVGltZVwiLCB3aWR0aDogXCIxMDhweFwiLCBzaXplOiBcInNtYWxsXCIsIG9wdGlvbnM6IG9wdGlvbnMsIG9uU2VsZWN0OiAob3B0aW9uKSA9PiB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIG9uQ2hhbmdlID09PSBudWxsIHx8IG9uQ2hhbmdlID09PSB2b2lkIDAgPyB2b2lkIDAgOiBvbkNoYW5nZShbbnVtLCBvcHRpb24udmFsdWVdKTtcclxuICAgICAgICAgICAgICAgICAgICB9IH0pXSB9KSB9KSkpO1xyXG59O1xyXG4vLyBlc2xpbnQtZGlzYWJsZS1uZXh0LWxpbmUgcmVhY3QvZGlzcGxheS1uYW1lXHJcbmV4cG9ydCBkZWZhdWx0IChwcm9wcykgPT4gX2pzeChJblRoZUxhc3QsIE9iamVjdC5hc3NpZ24oe30sIHByb3BzKSk7XHJcbi8vIyBzb3VyY2VNYXBwaW5nVVJMPUluVGhlTGFzdC5qcy5tYXAiXX0= */",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)."}}),s=[{label:"day(s)",value:"days"},{label:"minute(s)",value:"minutes"},{label:"hour(s)",value:"hours"}],i=e=>{let{val:o,onChange:i,errors:t,isLoading:C,disabled:b}=e;var r,p;const[A,B]=d.useState(s),a=null!==(r=null==o?void 0:o[1])&&void 0!==r?r:"days",y=null!==(p=null==o?void 0:o[0])&&void 0!==p?p:"1";return d.useEffect((()=>{var e;const I=null!==(e=null==o?void 0:o[1])&&void 0!==e?e:"days";B((e=>e.map((e=>Object.assign(Object.assign({},e),{selected:I===e.value})))))}),[o]),d.useEffect((()=>{var e;if(void 0===(null==o?void 0:o[0])){const I=null!==(e=null==o?void 0:o[1])&&void 0!==e?e:"days";null==i||i(["1",I])}}),[]),C?I.jsx("div",Object.assign({style:{width:200}},{children:I.jsx(n.default,{containerStyle:{padding:"5px 8px"}})})):I.jsx(c.InputStyleContext.Provider,Object.assign({value:{InputWrapper:{width:104}}},{children:I.jsxs(u,{children:[I.jsx(l.Input,{type:"number",variant:"small",state:b?"disabled":"none",errorMessage:null==t?void 0:t.val,value:y,onChangeText:e=>null==i?void 0:i([e,a])}),I.jsx(g.Dropdown,{disabled:b,placeHolder:"Time",width:"108px",size:"small",options:A,onSelect:e=>{null==i||i([y,e.value])}})]})}))};exports.default=e=>I.jsx(i,Object.assign({},e));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var I=require("@emotion/styled/base"),g=require("react/jsx-runtime"),C=require("react");require("../../../../dropdown/DropdownPopover/index.js");var e=require("../../../../dropdown/Dropdown.js");require("../../../../zeroState/ZeroState.js");var d=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("../../../../dropdown/OpenedDropdown/components/menu/SelectAllMenu.js"),require("../../../../button/Button.js"),require("../../../../dropdown/OpenedDropdown/components/multiSelect/MultiSelectDropdownBottomBar.styled.js"),require("../../../../dropdown/OpenedDropdown/components/OpennedDropdown.styled.js");var A=require("../../../../input/Input.js"),l=require("../../../../input/context/InputStyleProvider.js");require("../../../../dropdown/MenuItem/MenuItem.js");var c=require("../../InputLoader.js");function n(I){return I&&"object"==typeof I&&"default"in I?I:{default:I}}const i=n(I).default("div","production"===process.env.NODE_ENV?{target:"eqv4pu00"}:{target:"eqv4pu00",label:"Container"})("production"===process.env.NODE_ENV?{name:"1d5jh9x",styles:"display:flex;flex-direction:row;gap:12px;align-items:center"}:{name:"1d5jh9x",styles:"display:flex;flex-direction:row;gap:12px;align-items:center",map:"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkluVHdvTGFzdC50c3giXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBUTZCIiwiZmlsZSI6IkluVHdvTGFzdC50c3giLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBqc3ggYXMgX2pzeCwganN4cyBhcyBfanN4cyB9IGZyb20gXCJyZWFjdC9qc3gtcnVudGltZVwiO1xyXG5pbXBvcnQgc3R5bGVkIGZyb20gJ0BlbW90aW9uL3N0eWxlZCc7XHJcbmltcG9ydCB7IHVzZUVmZmVjdCwgdXNlU3RhdGUgfSBmcm9tICdyZWFjdCc7XHJcbmltcG9ydCB7IERyb3Bkb3duIH0gZnJvbSBcIi4uLy4uLy4uLy4uL2Ryb3Bkb3duXCI7XHJcbmltcG9ydCB7IElucHV0IH0gZnJvbSBcIi4uLy4uLy4uLy4uL2lucHV0XCI7XHJcbmltcG9ydCB7IElucHV0U3R5bGVDb250ZXh0IH0gZnJvbSBcIi4uLy4uLy4uLy4uL2lucHV0L2NvbnRleHQvSW5wdXRTdHlsZVByb3ZpZGVyXCI7XHJcbmltcG9ydCB7IEJvZHlTZWNvbmRhcnkgfSBmcm9tIFwiLi4vLi4vLi4vLi4vVHlwb2dyYXBoeVN0eWxlXCI7XHJcbmltcG9ydCBJbnB1dExvYWRlciBmcm9tICcuLi8uLi9JbnB1dExvYWRlcic7XHJcbmNvbnN0IENvbnRhaW5lciA9IHN0eWxlZC5kaXYgYFxuXHRkaXNwbGF5OiBmbGV4O1xuXHRmbGV4LWRpcmVjdGlvbjogcm93O1xuXHRnYXA6IDEycHg7XG5cdGFsaWduLWl0ZW1zOiBjZW50ZXI7XG5gO1xyXG5jb25zdCB0aW1lT3B0aW9ucyA9IFtcclxuICAgIHtcclxuICAgICAgICBsYWJlbDogJ2RheShzKScsXH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ICAgICAgICAgICAgfSkgfSksIF9qc3goXCJkaXZcIiwgeyBjaGlsZHJlbjogX2pzeChCb2R5U2Vjb25kYXJ5LCB7IGNoaWxkcmVuOiBcInRvXCIgfSkgfSksIF9qc3goSW5wdXQsIHsgdHlwZTogXCJudW1iZXJcIiwgdmFyaWFudDogXCJzbWFsbFwiLCBzdGF0ZTogZGlzYWJsZWQgPyAnZGlzYWJsZWQnIDogJ25vbmUnLCBlcnJvck1lc3NhZ2U6IGVycm9ycyA9PT0gbnVsbCB8fCBlcnJvcnMgPT09IHZvaWQgMCA/IHZvaWQgMCA6IGVycm9ycy52YWwsIHZhbHVlOiBzdGFydC50b1N0cmluZygpLCBvbkNoYW5nZVRleHQ6ICh0ZXh0KSA9PiBvbkNoYW5nZSA9PT0gbnVsbCB8fCBvbkNoYW5nZSA9PT0gdm9pZCAwID8gdm9pZCAwIDogb25DaGFuZ2Uoe1xyXG4gICAgICAgICAgICAgICAgICAgICAgICB0eXBlLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICBzdGFydDogdGV4dCxcclxuICAgICAgICAgICAgICAgICAgICAgICAgb2Zmc2V0LFxyXG4gICAgICAgICAgICAgICAgICAgIH0pIH0pLCBfanN4KERyb3Bkb3duLCB7IGRpc2FibGVkOiBkaXNhYmxlZCwgcGxhY2VIb2xkZXI6IFwiVGltZVwiLCB3aWR0aDogXCIxMDhweFwiLCBzaXplOiBcInNtYWxsXCIsIG9wdGlvbnM6IG9wdGlvbnMsIG9uU2VsZWN0OiAob3B0aW9uKSA9PiB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIG9uQ2hhbmdlID09PSBudWxsIHx8IG9uQ2hhbmdlID09PSB2b2lkIDAgPyB2b2lkIDAgOiBvbkNoYW5nZSh7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0eXBlOiBvcHRpb24udmFsdWUsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdGFydCxcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9mZnNldCxcclxuICAgICAgICAgICAgICAgICAgICAgICAgfSk7XHJcbiAgICAgICAgICAgICAgICAgICAgfSB9KV0gfSkgfSkpKTtcclxufTtcclxuLy8gZXNsaW50LWRpc2FibGUtbmV4dC1saW5lIEB0eXBlc2NyaXB0LWVzbGludC9iYW4tdHMtY29tbWVudFxyXG4vLyBAdHMtaWdub3JlXHJcbi8vIGVzbGludC1kaXNhYmxlLW5leHQtbGluZSByZWFjdC9kaXNwbGF5LW5hbWVcclxuZXhwb3J0IGRlZmF1bHQgKHByb3BzKSA9PiBfanN4KEluVHdvTGFzdCwgT2JqZWN0LmFzc2lnbih7fSwgcHJvcHMpKTtcclxuLy8jIHNvdXJjZU1hcHBpbmdVUkw9SW5Ud29MYXN0LmpzLm1hcCJdfQ== */",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)."}}),t=[{label:"day(s)",value:"days"},{label:"minute(s)",value:"minutes"},{label:"hour(s)",value:"hours"}],o=I=>{let{val:n,onChange:o,errors:s,isLoading:b,disabled:u}=I;var B,a,r;const[y,m]=C.useState(t),p=null!==(B=null==n?void 0:n.type)&&void 0!==B?B:"days",X=null!==(a=null==n?void 0:n.start)&&void 0!==a?a:"1",Z=null!==(r=null==n?void 0:n.offset)&&void 0!==r?r:"2";return C.useEffect((()=>{var I;const g=null!==(I=null==n?void 0:n.type)&&void 0!==I?I:"days";m((I=>I.map((I=>Object.assign(Object.assign({},I),{selected:g===I.value})))))}),[n]),C.useEffect((()=>{var I,g,C;if(void 0===(null==n?void 0:n.start)){const e=null!==(I=null==n?void 0:n.type)&&void 0!==I?I:"days",d=null!==(g=null==n?void 0:n.start)&&void 0!==g?g:"1",A=null!==(C=null==n?void 0:n.offset)&&void 0!==C?C:"2";null==o||o({type:e,start:d,offset:A})}}),[]),b?g.jsx("div",Object.assign({style:{width:200}},{children:g.jsx(c.default,{containerStyle:{padding:"5px 8px"}})})):g.jsx(l.InputStyleContext.Provider,Object.assign({value:{InputWrapper:{width:104}}},{children:g.jsxs(i,{children:[g.jsx(A.Input,{type:"number",variant:"small",state:u?"disabled":"none",errorMessage:null==s?void 0:s.val,value:Z.toString(),onChangeText:I=>null==o?void 0:o({type:p,start:X,offset:I})}),g.jsx("div",{children:g.jsx(d.BodySecondary,{children:"to"})}),g.jsx(A.Input,{type:"number",variant:"small",state:u?"disabled":"none",errorMessage:null==s?void 0:s.val,value:X.toString(),onChangeText:I=>null==o?void 0:o({type:p,start:I,offset:Z})}),g.jsx(e.Dropdown,{disabled:u,placeHolder:"Time",width:"108px",size:"small",options:y,onSelect:I=>{null==o||o({type:I.value,start:X,offset:Z})}})]})}))};exports.default=I=>g.jsx(o,Object.assign({},I));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("react"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("react"),n=require("../../constants/connectorPosition.js"),t=require("../../helpers/Connector.helper.js"),o=require("../../types/QueryBuilder.type.js"),i=require("../DropdownWrapper.js"),l=require("./Components/EmojiPicker.js"),s=require("./Components/FreeText.js"),u=require("./Components/FrequencyIntegerPositiveSingle.js"),a=require("./Components/IgPicker.js"),d=require("./Components/IntegerPositiveSingle.js"),p=require("./Components/IntegerSingleValue.js"),c=require("./Components/InTheLast.js"),g=require("./Components/InTwoLast.js"),C=require("./Components/MultiselectDropdownFreeText.js"),j=require("./Components/NoInput.js"),m=require("./Components/NumberTime.js"),f=require("./Components/SingleDate.js"),q=require("./Components/SingleselectDropdownFreeText.js"),v=require("./Components/StringSingleValue.js"),S=require("./Components/TwoDate.js"),I=require("./Components/TwoNumberInputsSeperatedByAnd.js"),T=require("./Connector.styled.js");const P={FreeText:s.default,IntegerPositiveSingle:d.default,IntegerSingleValue:p.default,StringSingleValue:v.default,MultiselectDropdownFreeText:C.default,SingleselectDropdownFreeText:q.default,NoInput:j.default,SingleDate:f.default,TwoNumberInputsSeperatedByAnd:I.default,FrequencyIntegerPositiveSingle:u.default,TwoDate:S.default,NumberTime:m.default,PostIgPicker:a.PostIgPicker,ReelIgPicker:a.ReelIgPicker,StoryIgPicker:a.StoryIgPicker,EmojiPicker:l.default,InTheLast:c.default,InTwoLast:g.default};exports.default=l=>{let{isLoading:s,noDefault:u,connectorType:a,defaultConnector:d,onOperatorChange:p,onValueChange:c,connectorVal:g,extra:C,errors:j,disabled:m}=l;var f,q,v;const[S,I]=r.useState(null),[y,w]=r.useState(!1);console.log({connectorType:a,defaultConnector:d});const x=t.ConnectorHelper.getDropdownOptionFromDataType(a,d);function D(e){let r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];w(!0);const n=t.ConnectorHelper.getConnectorComponent(a,e.value);void 0!==n?a===o.QueryBuilderConnectorType.frequency&&"IntegerPositiveSingle"===n?I("FrequencyIntegerPositiveSingle"):I(n):I(null),r||p(e.value),setTimeout((()=>{w(!1)}),5)}return r.useEffect((()=>{u||(d?D({value:d,label:d},!0):(null==x?void 0:x[0])&&D(x[0]))}),[d]),e.jsxs(T.Container,{children:[e.jsx("div",{children:!(null===(f=null===n.disableOperatorDropdown||void 0===n.disableOperatorDropdown?void 0:n.disableOperatorDropdown[a])||void 0===f?void 0:f[d])&&e.jsx(i.default,{isSearchable:!0,disabled:m,width:"200px",isLoading:y,options:x,defaultOption:null===(q=x.filter((e=>e.selected)))||void 0===q?void 0:q[0],onSelect:D})}),null!==S&&!y&&(null===(v=P[S])||void 0===v?void 0:v.call(P,{disabled:m,val:g,onChange:c,extra:C,errors:j,isLoading:s}))]})};
|
|
@@ -0,0 +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 7 days",label:"Last 7 days"},{selected:!1,value:"last 30 days",label:"Last 30 days"},{selected:!1,value:"this week",label:"This week"},{selected:!1,value:"last week",label:"Last week"},{selected:!1,value:"this month",label:"This month"},{selected:!0,value:"last month",label:"Last month"}]},{label:"Relative",options:[{selected:!1,value:"exactly",label:"Exactly"},{selected:!1,value:"not exactly",label:"Not exactly"},{selected:!1,value:"in the last",label:"In the last"},{selected:!1,value:"not in the last",label:"Not in the last"},{selected:!1,value:"in between last",label:"In between last"},{selected:!1,value:"not in between last",label:"Not in between 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"}]}];
|
|
@@ -20,7 +20,8 @@ export declare enum CONNECTOR_VALUE_COMPONENT_TYPES {
|
|
|
20
20
|
ReelIgPicker = "ReelIgPicker",
|
|
21
21
|
StoryIgPicker = "StoryIgPicker",
|
|
22
22
|
EmojiPicker = "EmojiPicker",
|
|
23
|
-
InTheLast = "InTheLast"
|
|
23
|
+
InTheLast = "InTheLast",
|
|
24
|
+
InTwoLast = "InTwoLast"
|
|
24
25
|
}
|
|
25
26
|
export declare const INTEGER_OPERATORS_COMPONENT: {
|
|
26
27
|
is: CONNECTOR_VALUE_COMPONENT_TYPES;
|
|
@@ -59,18 +60,26 @@ export declare const REACTION_OPERATORS_COMPONENT: {
|
|
|
59
60
|
contains: CONNECTOR_VALUE_COMPONENT_TYPES;
|
|
60
61
|
};
|
|
61
62
|
export declare const DATE_OPERATORS_COMPONENT: {
|
|
63
|
+
today: CONNECTOR_VALUE_COMPONENT_TYPES;
|
|
64
|
+
yesterday: CONNECTOR_VALUE_COMPONENT_TYPES;
|
|
65
|
+
"last 30 days": CONNECTOR_VALUE_COMPONENT_TYPES;
|
|
66
|
+
"last 7 days": CONNECTOR_VALUE_COMPONENT_TYPES;
|
|
67
|
+
"this month": CONNECTOR_VALUE_COMPONENT_TYPES;
|
|
68
|
+
"this week": CONNECTOR_VALUE_COMPONENT_TYPES;
|
|
69
|
+
"last month": CONNECTOR_VALUE_COMPONENT_TYPES;
|
|
70
|
+
"last week": CONNECTOR_VALUE_COMPONENT_TYPES;
|
|
71
|
+
exactly: CONNECTOR_VALUE_COMPONENT_TYPES;
|
|
72
|
+
"not exactly": CONNECTOR_VALUE_COMPONENT_TYPES;
|
|
73
|
+
"in the last": CONNECTOR_VALUE_COMPONENT_TYPES;
|
|
74
|
+
"not in the last": CONNECTOR_VALUE_COMPONENT_TYPES;
|
|
75
|
+
"in between last": CONNECTOR_VALUE_COMPONENT_TYPES;
|
|
76
|
+
"not in between last": CONNECTOR_VALUE_COMPONENT_TYPES;
|
|
62
77
|
on: CONNECTOR_VALUE_COMPONENT_TYPES;
|
|
63
78
|
notOn: CONNECTOR_VALUE_COMPONENT_TYPES;
|
|
64
79
|
inBetween: CONNECTOR_VALUE_COMPONENT_TYPES;
|
|
65
80
|
notInBetween: CONNECTOR_VALUE_COMPONENT_TYPES;
|
|
66
81
|
before: CONNECTOR_VALUE_COMPONENT_TYPES;
|
|
67
82
|
after: CONNECTOR_VALUE_COMPONENT_TYPES;
|
|
68
|
-
today: CONNECTOR_VALUE_COMPONENT_TYPES;
|
|
69
|
-
yesterday: CONNECTOR_VALUE_COMPONENT_TYPES;
|
|
70
|
-
"last week": CONNECTOR_VALUE_COMPONENT_TYPES;
|
|
71
|
-
"last month": CONNECTOR_VALUE_COMPONENT_TYPES;
|
|
72
|
-
"last quarter": CONNECTOR_VALUE_COMPONENT_TYPES;
|
|
73
|
-
"in the last": CONNECTOR_VALUE_COMPONENT_TYPES;
|
|
74
83
|
};
|
|
75
84
|
export declare const SPECIFIC_IG_POST_OPERATORS_COMPONENT: {
|
|
76
85
|
in: CONNECTOR_VALUE_COMPONENT_TYPES;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../types/QueryBuilder.type.js"),O=require("../types/QueryBuilderOperator.type.js");const E={[e.QueryBuilderConnectorType.boolean]:O.BOOLEAN_OPERATORS,[e.QueryBuilderConnectorType.string]:O.STRING_OPERATORS,[e.QueryBuilderConnectorType.integer]:O.INTEGER_OPERATORS,[e.QueryBuilderConnectorType.frequency]:O.FREQUENCY_OPERATORS,[e.QueryBuilderConnectorType.date]:O.DATE_OPERATORS,[e.QueryBuilderConnectorType.specificPost]:O.SPECIFIC_IG_OPERATORS,[e.QueryBuilderConnectorType.specificReel]:O.SPECIFIC_IG_OPERATORS,[e.QueryBuilderConnectorType.specificStory]:O.SPECIFIC_IG_OPERATORS,[e.QueryBuilderConnectorType.anyIg]:O.ANY_IG_OPERATORS,[e.QueryBuilderConnectorType.reaction]:O.REACTION_OPERATORS,[e.QueryBuilderConnectorType.activityString]:O.IG_STRING_OPERATORS,[e.QueryBuilderConnectorType.anyAd]:O.ANY_AD_OPERATORS,[e.QueryBuilderConnectorType.specificAd]:O.AD_STRING_OPERATORS,[e.QueryBuilderConnectorType.iceBreaker]:O.ICE_BREAKER_OPERATORS};var T;exports.CONNECTOR_VALUE_COMPONENT_TYPES=void 0,(T=exports.CONNECTOR_VALUE_COMPONENT_TYPES||(exports.CONNECTOR_VALUE_COMPONENT_TYPES={})).FreeText="FreeText",T.NoInput="NoInput",T.IntegerSingleValue="IntegerSingleValue",T.StringSingleValue="StringSingleValue",T.TwoNumberInputsSeperatedByAnd="TwoNumberInputsSeperatedByAnd",T.MultiselectDropdownFreeText="MultiselectDropdownFreeText",T.SingleselectDropdownFreeText="SingleselectDropdownFreeText",T.SingleDate="SingleDate",T.TwoDate="TwoDate",T.IntegerPositiveSingle="IntegerPositiveSingle",T.NumberTime="NumberTime",T.PostIgPicker="PostIgPicker",T.ReelIgPicker="ReelIgPicker",T.StoryIgPicker="StoryIgPicker",T.EmojiPicker="EmojiPicker",T.InTheLast="InTheLast";const N={[O.INTEGER_OPERATORS.is]:exports.CONNECTOR_VALUE_COMPONENT_TYPES.FreeText,[O.INTEGER_OPERATORS.isNot]:exports.CONNECTOR_VALUE_COMPONENT_TYPES.FreeText,[O.INTEGER_OPERATORS.exists]:exports.CONNECTOR_VALUE_COMPONENT_TYPES.NoInput,[O.INTEGER_OPERATORS.doesntExist]:exports.CONNECTOR_VALUE_COMPONENT_TYPES.NoInput,[O.INTEGER_OPERATORS.lessThan]:exports.CONNECTOR_VALUE_COMPONENT_TYPES.IntegerSingleValue,[O.INTEGER_OPERATORS.lessThanOrEqualTo]:exports.CONNECTOR_VALUE_COMPONENT_TYPES.IntegerSingleValue,[O.INTEGER_OPERATORS.greaterThan]:exports.CONNECTOR_VALUE_COMPONENT_TYPES.IntegerSingleValue,[O.INTEGER_OPERATORS.greaterThanOrEqualTo]:exports.CONNECTOR_VALUE_COMPONENT_TYPES.IntegerSingleValue},_={[O.STRING_OPERATORS.is]:exports.CONNECTOR_VALUE_COMPONENT_TYPES.MultiselectDropdownFreeText,[O.STRING_OPERATORS.isNot]:exports.CONNECTOR_VALUE_COMPONENT_TYPES.MultiselectDropdownFreeText,[O.STRING_OPERATORS.contains]:exports.CONNECTOR_VALUE_COMPONENT_TYPES.FreeText,[O.STRING_OPERATORS.doesntContain]:exports.CONNECTOR_VALUE_COMPONENT_TYPES.FreeText,[O.STRING_OPERATORS.startsWith]:exports.CONNECTOR_VALUE_COMPONENT_TYPES.FreeText,[O.STRING_OPERATORS.endsWith]:exports.CONNECTOR_VALUE_COMPONENT_TYPES.FreeText,[O.STRING_OPERATORS.exists]:exports.CONNECTOR_VALUE_COMPONENT_TYPES.NoInput,[O.STRING_OPERATORS.doesntExist]:exports.CONNECTOR_VALUE_COMPONENT_TYPES.NoInput},t={[O.IG_STRING_OPERATORS.any]:exports.CONNECTOR_VALUE_COMPONENT_TYPES.NoInput,[O.IG_STRING_OPERATORS.is]:exports.CONNECTOR_VALUE_COMPONENT_TYPES.MultiselectDropdownFreeText,[O.IG_STRING_OPERATORS.contains]:exports.CONNECTOR_VALUE_COMPONENT_TYPES.FreeText,[O.IG_STRING_OPERATORS.startsWith]:exports.CONNECTOR_VALUE_COMPONENT_TYPES.FreeText,[O.IG_STRING_OPERATORS.endsWith]:exports.CONNECTOR_VALUE_COMPONENT_TYPES.FreeText},
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../types/QueryBuilder.type.js"),O=require("../types/QueryBuilderOperator.type.js");const E={[e.QueryBuilderConnectorType.boolean]:O.BOOLEAN_OPERATORS,[e.QueryBuilderConnectorType.string]:O.STRING_OPERATORS,[e.QueryBuilderConnectorType.integer]:O.INTEGER_OPERATORS,[e.QueryBuilderConnectorType.frequency]:O.FREQUENCY_OPERATORS,[e.QueryBuilderConnectorType.date]:O.DATE_OPERATORS,[e.QueryBuilderConnectorType.specificPost]:O.SPECIFIC_IG_OPERATORS,[e.QueryBuilderConnectorType.specificReel]:O.SPECIFIC_IG_OPERATORS,[e.QueryBuilderConnectorType.specificStory]:O.SPECIFIC_IG_OPERATORS,[e.QueryBuilderConnectorType.anyIg]:O.ANY_IG_OPERATORS,[e.QueryBuilderConnectorType.reaction]:O.REACTION_OPERATORS,[e.QueryBuilderConnectorType.activityString]:O.IG_STRING_OPERATORS,[e.QueryBuilderConnectorType.anyAd]:O.ANY_AD_OPERATORS,[e.QueryBuilderConnectorType.specificAd]:O.AD_STRING_OPERATORS,[e.QueryBuilderConnectorType.iceBreaker]:O.ICE_BREAKER_OPERATORS};var T;exports.CONNECTOR_VALUE_COMPONENT_TYPES=void 0,(T=exports.CONNECTOR_VALUE_COMPONENT_TYPES||(exports.CONNECTOR_VALUE_COMPONENT_TYPES={})).FreeText="FreeText",T.NoInput="NoInput",T.IntegerSingleValue="IntegerSingleValue",T.StringSingleValue="StringSingleValue",T.TwoNumberInputsSeperatedByAnd="TwoNumberInputsSeperatedByAnd",T.MultiselectDropdownFreeText="MultiselectDropdownFreeText",T.SingleselectDropdownFreeText="SingleselectDropdownFreeText",T.SingleDate="SingleDate",T.TwoDate="TwoDate",T.IntegerPositiveSingle="IntegerPositiveSingle",T.NumberTime="NumberTime",T.PostIgPicker="PostIgPicker",T.ReelIgPicker="ReelIgPicker",T.StoryIgPicker="StoryIgPicker",T.EmojiPicker="EmojiPicker",T.InTheLast="InTheLast",T.InTwoLast="InTwoLast";const N={[O.INTEGER_OPERATORS.is]:exports.CONNECTOR_VALUE_COMPONENT_TYPES.FreeText,[O.INTEGER_OPERATORS.isNot]:exports.CONNECTOR_VALUE_COMPONENT_TYPES.FreeText,[O.INTEGER_OPERATORS.exists]:exports.CONNECTOR_VALUE_COMPONENT_TYPES.NoInput,[O.INTEGER_OPERATORS.doesntExist]:exports.CONNECTOR_VALUE_COMPONENT_TYPES.NoInput,[O.INTEGER_OPERATORS.lessThan]:exports.CONNECTOR_VALUE_COMPONENT_TYPES.IntegerSingleValue,[O.INTEGER_OPERATORS.lessThanOrEqualTo]:exports.CONNECTOR_VALUE_COMPONENT_TYPES.IntegerSingleValue,[O.INTEGER_OPERATORS.greaterThan]:exports.CONNECTOR_VALUE_COMPONENT_TYPES.IntegerSingleValue,[O.INTEGER_OPERATORS.greaterThanOrEqualTo]:exports.CONNECTOR_VALUE_COMPONENT_TYPES.IntegerSingleValue},_={[O.STRING_OPERATORS.is]:exports.CONNECTOR_VALUE_COMPONENT_TYPES.MultiselectDropdownFreeText,[O.STRING_OPERATORS.isNot]:exports.CONNECTOR_VALUE_COMPONENT_TYPES.MultiselectDropdownFreeText,[O.STRING_OPERATORS.contains]:exports.CONNECTOR_VALUE_COMPONENT_TYPES.FreeText,[O.STRING_OPERATORS.doesntContain]:exports.CONNECTOR_VALUE_COMPONENT_TYPES.FreeText,[O.STRING_OPERATORS.startsWith]:exports.CONNECTOR_VALUE_COMPONENT_TYPES.FreeText,[O.STRING_OPERATORS.endsWith]:exports.CONNECTOR_VALUE_COMPONENT_TYPES.FreeText,[O.STRING_OPERATORS.exists]:exports.CONNECTOR_VALUE_COMPONENT_TYPES.NoInput,[O.STRING_OPERATORS.doesntExist]:exports.CONNECTOR_VALUE_COMPONENT_TYPES.NoInput},t={[O.IG_STRING_OPERATORS.any]:exports.CONNECTOR_VALUE_COMPONENT_TYPES.NoInput,[O.IG_STRING_OPERATORS.is]:exports.CONNECTOR_VALUE_COMPONENT_TYPES.MultiselectDropdownFreeText,[O.IG_STRING_OPERATORS.contains]:exports.CONNECTOR_VALUE_COMPONENT_TYPES.FreeText,[O.IG_STRING_OPERATORS.startsWith]:exports.CONNECTOR_VALUE_COMPONENT_TYPES.FreeText,[O.IG_STRING_OPERATORS.endsWith]:exports.CONNECTOR_VALUE_COMPONENT_TYPES.FreeText},R={[O.AD_STRING_OPERATORS.is]:exports.CONNECTOR_VALUE_COMPONENT_TYPES.SingleselectDropdownFreeText},r={[O.ICE_BREAKER_OPERATORS.is]:exports.CONNECTOR_VALUE_COMPONENT_TYPES.MultiselectDropdownFreeText},C={[O.REACTION_OPERATORS.contains]:exports.CONNECTOR_VALUE_COMPONENT_TYPES.EmojiPicker},P={[O.DATE_OPERATORS.today]:exports.CONNECTOR_VALUE_COMPONENT_TYPES.NoInput,[O.DATE_OPERATORS.yesterday]:exports.CONNECTOR_VALUE_COMPONENT_TYPES.NoInput,[O.DATE_OPERATORS["last 30 days"]]:exports.CONNECTOR_VALUE_COMPONENT_TYPES.NoInput,[O.DATE_OPERATORS["last 7 days"]]:exports.CONNECTOR_VALUE_COMPONENT_TYPES.NoInput,[O.DATE_OPERATORS["this month"]]:exports.CONNECTOR_VALUE_COMPONENT_TYPES.NoInput,[O.DATE_OPERATORS["this week"]]:exports.CONNECTOR_VALUE_COMPONENT_TYPES.NoInput,[O.DATE_OPERATORS["last month"]]:exports.CONNECTOR_VALUE_COMPONENT_TYPES.NoInput,[O.DATE_OPERATORS["last week"]]:exports.CONNECTOR_VALUE_COMPONENT_TYPES.NoInput,[O.DATE_OPERATORS.exactly]:exports.CONNECTOR_VALUE_COMPONENT_TYPES.InTheLast,[O.DATE_OPERATORS["not exactly"]]:exports.CONNECTOR_VALUE_COMPONENT_TYPES.InTheLast,[O.DATE_OPERATORS["in the last"]]:exports.CONNECTOR_VALUE_COMPONENT_TYPES.InTheLast,[O.DATE_OPERATORS["not in the last"]]:exports.CONNECTOR_VALUE_COMPONENT_TYPES.InTheLast,[O.DATE_OPERATORS["in between last"]]:exports.CONNECTOR_VALUE_COMPONENT_TYPES.InTwoLast,[O.DATE_OPERATORS["not in between last"]]:exports.CONNECTOR_VALUE_COMPONENT_TYPES.InTwoLast,[O.DATE_OPERATORS.on]:exports.CONNECTOR_VALUE_COMPONENT_TYPES.SingleDate,[O.DATE_OPERATORS.notOn]:exports.CONNECTOR_VALUE_COMPONENT_TYPES.SingleDate,[O.DATE_OPERATORS.inBetween]:exports.CONNECTOR_VALUE_COMPONENT_TYPES.TwoDate,[O.DATE_OPERATORS.notInBetween]:exports.CONNECTOR_VALUE_COMPONENT_TYPES.TwoDate,[O.DATE_OPERATORS.before]:exports.CONNECTOR_VALUE_COMPONENT_TYPES.SingleDate,[O.DATE_OPERATORS.after]:exports.CONNECTOR_VALUE_COMPONENT_TYPES.SingleDate},o={[O.SPECIFIC_IG_OPERATORS.in]:exports.CONNECTOR_VALUE_COMPONENT_TYPES.PostIgPicker},S={[O.SPECIFIC_IG_OPERATORS.in]:exports.CONNECTOR_VALUE_COMPONENT_TYPES.ReelIgPicker},n={[O.SPECIFIC_IG_OPERATORS.in]:exports.CONNECTOR_VALUE_COMPONENT_TYPES.StoryIgPicker},A={[O.ANY_IG_OPERATORS.in]:exports.CONNECTOR_VALUE_COMPONENT_TYPES.NoInput},s={[O.ANY_AD_OPERATORS.in]:exports.CONNECTOR_VALUE_COMPONENT_TYPES.NoInput},i={[O.BOOLEAN_OPERATORS.isTrue]:exports.CONNECTOR_VALUE_COMPONENT_TYPES.NoInput,[O.BOOLEAN_OPERATORS.isFalse]:exports.CONNECTOR_VALUE_COMPONENT_TYPES.NoInput,[O.BOOLEAN_OPERATORS.exists]:exports.CONNECTOR_VALUE_COMPONENT_TYPES.NoInput,[O.BOOLEAN_OPERATORS.doesntExist]:exports.CONNECTOR_VALUE_COMPONENT_TYPES.NoInput},p={[O.FREQUENCY_OPERATORS.exactly]:exports.CONNECTOR_VALUE_COMPONENT_TYPES.IntegerPositiveSingle,[O.FREQUENCY_OPERATORS.atleast]:exports.CONNECTOR_VALUE_COMPONENT_TYPES.IntegerPositiveSingle,[O.FREQUENCY_OPERATORS.atMost]:exports.CONNECTOR_VALUE_COMPONENT_TYPES.IntegerPositiveSingle},I={[e.QueryBuilderConnectorType.boolean]:i,[e.QueryBuilderConnectorType.string]:_,[e.QueryBuilderConnectorType.integer]:N,[e.QueryBuilderConnectorType.frequency]:p,[e.QueryBuilderConnectorType.date]:P,[e.QueryBuilderConnectorType.specificPost]:o,[e.QueryBuilderConnectorType.specificReel]:S,[e.QueryBuilderConnectorType.specificStory]:n,[e.QueryBuilderConnectorType.anyIg]:A,[e.QueryBuilderConnectorType.reaction]:C,[e.QueryBuilderConnectorType.activityString]:t,[e.QueryBuilderConnectorType.anyAd]:s,[e.QueryBuilderConnectorType.specificAd]:R,[e.QueryBuilderConnectorType.iceBreaker]:r};exports.AD_STRING_OPERATORS_COMPONENT=R,exports.ANY_AD_OPERATORS_COMPONENT=s,exports.ANY_IG_OPERATORS_COMPONENT=A,exports.BOOLEAN_OPERATORS_COMPONENT=i,exports.CONNECTOR_TYPE_TO_COMPONENT_MAP=I,exports.CONNECTOR_TYPE_TO_OPERATORS=E,exports.DATE_OPERATORS_COMPONENT=P,exports.FREQUENCY_OPERATORS_COMPONENT=p,exports.ICE_BREAKER_OPERATORS_COMPONENT=r,exports.IG_STRING_OPERATORS_COMPONENT=t,exports.INTEGER_OPERATORS_COMPONENT=N,exports.REACTION_OPERATORS_COMPONENT=C,exports.SPECIFIC_IG_POST_OPERATORS_COMPONENT=o,exports.SPECIFIC_IG_REEL_OPERATORS_COMPONENT=S,exports.SPECIFIC_IG_STORY_OPERATORS_COMPONENT=n,exports.STRING_OPERATORS_COMPONENT=_;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import { DropdownOption } from "../../dropdown/type";
|
|
1
2
|
import { QueryBuilderConnectorType } from '../types/QueryBuilder.type';
|
|
2
3
|
import { CONNECTOR_OPERATORS } from '../types/QueryBuilderOperator.type';
|
|
3
4
|
export declare class ConnectorHelper {
|
|
4
5
|
static getConnectorType(datatype: QueryBuilderConnectorType): string[];
|
|
6
|
+
static getDropdownOptionFromDataType(datatype: QueryBuilderConnectorType, defaultConnector: CONNECTOR_OPERATORS | undefined): DropdownOption[];
|
|
5
7
|
static getConnectorComponent(dataType: QueryBuilderConnectorType, connectorType: CONNECTOR_OPERATORS): "FreeText" | "NoInput" | "IntegerSingleValue" | "StringSingleValue" | "TwoNumberInputsSeperatedByAnd" | "MultiselectDropdownFreeText" | "SingleselectDropdownFreeText" | "SingleDate" | "TwoDate" | "IntegerPositiveSingle" | "NumberTime" | null;
|
|
6
8
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../constants/connector.js");exports.ConnectorHelper=class{static getConnectorType(
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../utils/unCamelCase.js"),t=require("../constants/connector.js"),s=require("../constants/DATE_OPERATORS_OPTIONS.js"),r=require("../types/QueryBuilder.type.js");exports.ConnectorHelper=class{static getConnectorType(e){const s=t.CONNECTOR_TYPE_TO_OPERATORS[e];return s?Object.keys(s):[]}static getDropdownOptionFromDataType(t,n){const o=this.getConnectorType(t);return t===r.QueryBuilderConnectorType.date?s.DATE_OPERATORS_OPTIONS.map((e=>Object.assign(Object.assign({},e),{options:e.options.map((e=>Object.assign(Object.assign({},e),{selected:e.value===n})))}))):o.map((t=>({selected:t===n,value:t,label:e.unCamelCaseWithFirstUppercase(t)})))}static getConnectorComponent(e,s){if(t.CONNECTOR_TYPE_TO_OPERATORS[e]){return t.CONNECTOR_TYPE_TO_COMPONENT_MAP[e][s]}return null}};
|
|
@@ -39,7 +39,7 @@ export type ConnectorProps = {
|
|
|
39
39
|
testID?: string;
|
|
40
40
|
disabled?: boolean;
|
|
41
41
|
};
|
|
42
|
-
export type CONNECTOR_VALUE_TYPE = string[] | number | Date[] | Date | number[] | number | undefined | /** for multiselect */ QueryBuilderAPIData[] | IG_VALUE[];
|
|
42
|
+
export type CONNECTOR_VALUE_TYPE = object | string[] | number | Date[] | Date | number[] | number | undefined | /** for multiselect */ QueryBuilderAPIData[] | IG_VALUE[];
|
|
43
43
|
type IG_VALUE = {
|
|
44
44
|
imageUrl: string;
|
|
45
45
|
redirectionUrl: string;
|
|
@@ -48,18 +48,26 @@ export declare enum REACTION_OPERATORS {
|
|
|
48
48
|
contains = "contains"
|
|
49
49
|
}
|
|
50
50
|
export declare enum DATE_OPERATORS {
|
|
51
|
+
today = "today",
|
|
52
|
+
yesterday = "yesterday",
|
|
53
|
+
'last 7 days' = "last 7 days",
|
|
54
|
+
'last 30 days' = "last 30 days",
|
|
55
|
+
'this week' = "this week",
|
|
56
|
+
'last week' = "last week",
|
|
57
|
+
'this month' = "this month",
|
|
58
|
+
'last month' = "last month",
|
|
59
|
+
'exactly' = "exactly",
|
|
60
|
+
'not exactly' = "not exactly",
|
|
61
|
+
'in the last' = "in the last",
|
|
62
|
+
'not in the last' = "not in the last",
|
|
63
|
+
'in between last' = "in between last",
|
|
64
|
+
'not in between last' = "not in between last",
|
|
51
65
|
on = "on",
|
|
52
66
|
notOn = "notOn",
|
|
53
67
|
inBetween = "inBetween",
|
|
54
68
|
notInBetween = "notInBetween",
|
|
55
69
|
before = "before",
|
|
56
|
-
after = "after"
|
|
57
|
-
today = "today",
|
|
58
|
-
yesterday = "yesterday",
|
|
59
|
-
'last week' = "last week",
|
|
60
|
-
'last month' = "last month",
|
|
61
|
-
'last quarter' = "last quarter",
|
|
62
|
-
'in the last' = "in the last"
|
|
70
|
+
after = "after"
|
|
63
71
|
}
|
|
64
72
|
export declare enum BOOLEAN_OPERATORS {
|
|
65
73
|
isTrue = "isTrue",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e,t,s,o,
|
|
1
|
+
"use strict";var e,t,s,o,n,i,R;Object.defineProperty(exports,"__esModule",{value:!0}),exports.INTEGER_OPERATORS=void 0,(e=exports.INTEGER_OPERATORS||(exports.INTEGER_OPERATORS={})).is="is",e.isNot="isNot",e.exists="exists",e.doesntExist="doesntExist",e.lessThan="lessThan",e.lessThanOrEqualTo="lessThanOrEqualTo",e.greaterThan="greaterThan",e.greaterThanOrEqualTo="greaterThanOrEqualTo",exports.STRING_OPERATORS=void 0,(t=exports.STRING_OPERATORS||(exports.STRING_OPERATORS={})).is="is",t.isNot="isNot",t.contains="contains",t.doesntContain="doesntContain",t.startsWith="startsWith",t.endsWith="endsWith",t.exists="exists",t.doesntExist="doesntExist",exports.IG_STRING_OPERATORS=void 0,(s=exports.IG_STRING_OPERATORS||(exports.IG_STRING_OPERATORS={})).any="any",s.is="is",s.contains="contains",s.startsWith="startsWith",s.endsWith="endsWith",exports.AD_STRING_OPERATORS=void 0,(exports.AD_STRING_OPERATORS||(exports.AD_STRING_OPERATORS={})).is="is",exports.SPECIFIC_IG_OPERATORS=void 0,(exports.SPECIFIC_IG_OPERATORS||(exports.SPECIFIC_IG_OPERATORS={})).in="in",exports.ICE_BREAKER_OPERATORS=void 0,(exports.ICE_BREAKER_OPERATORS||(exports.ICE_BREAKER_OPERATORS={})).is="is",exports.ANY_IG_OPERATORS=void 0,(exports.ANY_IG_OPERATORS||(exports.ANY_IG_OPERATORS={})).in="in",exports.ANY_AD_OPERATORS=void 0,(exports.ANY_AD_OPERATORS||(exports.ANY_AD_OPERATORS={})).in="in",exports.REACTION_OPERATORS=void 0,(exports.REACTION_OPERATORS||(exports.REACTION_OPERATORS={})).contains="contains",exports.DATE_OPERATORS=void 0,(o=exports.DATE_OPERATORS||(exports.DATE_OPERATORS={})).today="today",o.yesterday="yesterday",o["last 7 days"]="last 7 days",o["last 30 days"]="last 30 days",o["this week"]="this week",o["last week"]="last week",o["this month"]="this month",o["last month"]="last month",o.exactly="exactly",o["not exactly"]="not exactly",o["in the last"]="in the last",o["not in the last"]="not in the last",o["in between last"]="in between last",o["not in between last"]="not in between last",o.on="on",o.notOn="notOn",o.inBetween="inBetween",o.notInBetween="notInBetween",o.before="before",o.after="after",exports.BOOLEAN_OPERATORS=void 0,(n=exports.BOOLEAN_OPERATORS||(exports.BOOLEAN_OPERATORS={})).isTrue="isTrue",n.isFalse="isFalse",n.exists="exists",n.doesntExist="doesntExist",exports.FREQUENCY_OPERATORS=void 0,(i=exports.FREQUENCY_OPERATORS||(exports.FREQUENCY_OPERATORS={})).exactly="exactly",i.atleast="atleast",i.atMost="atMost",exports.EVENT_VALUES=void 0,(R=exports.EVENT_VALUES||(exports.EVENT_VALUES={})).FreeText="FreeText",R.NoInput="NoInput",R.IntegerSingleValue="IntegerSingleValue",R.StringSingleValue="StringSingleValue",R.TwoNumberInputsSeperatedByAnd="TwoNumberInputsSeperatedByAnd",R.MultiselectDropdownFreeText="MultiselectDropdownFreeText",R.SingleselectDropdownFreeText="SingleselectDropdownFreeText",R.SingleDate="SingleDate",R.TwoDate="TwoDate",R.IntegerPositiveSingle="IntegerPositiveSingle",R.NumberTime="NumberTime";
|
|
@@ -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"),I=require("../../../../constants/Theme.js"),t=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("../../../dropdown/OpenedDropdown/components/menu/SelectAllMenu.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("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("../../../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");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=>I.COLORS.surface.standard),";border:1px solid ",(e=>I.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(d,Object.assign({style:{padding:24}},{children:e.children})),exports.PieChartAnalytics=e=>{let{title:I,slices:s,size:o}=e;const[A,d]=t.useState([]),[u,n]=t.useState();return t.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:[I&&r.jsx(i.TitleMedium,Object.assign({style:{marginBottom:16}},{children:I})),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("../../../dropdown/OpenedDropdown/components/menu/SelectAllMenu.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("../../../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");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,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIlBpZUNoYXJ0QW5hbHl0aWNzLnRzeCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFzQzhCIiwiZmlsZSI6IlBpZUNoYXJ0QW5hbHl0aWNzLnRzeCIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IGpzeCBhcyBfanN4LCBGcmFnbWVudCBhcyBfRnJhZ21lbnQsIGpzeHMgYXMgX2pzeHMgfSBmcm9tIFwicmVhY3QvanN4LXJ1bnRpbWVcIjtcclxuaW1wb3J0IHN0eWxlZCBmcm9tICdAZW1vdGlvbi9zdHlsZWQnO1xyXG5pbXBvcnQgeyBTdHJpbmdVdGlscyB9IGZyb20gXCIuLi8uLi8uLi8uLi9pbmRleFwiO1xyXG5pbXBvcnQgeyBBcmNFbGVtZW50LCBDaGFydCBhcyBDaGFydEpTLCBMZWdlbmQgfSBmcm9tICdjaGFydC5qcyc7XHJcbmltcG9ydCB7IHVzZUVmZmVjdCwgdXNlU3RhdGUgfSBmcm9tICdyZWFjdCc7XHJcbmltcG9ydCB7IERvdWdobnV0IH0gZnJv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QgdXBkYXRlZFNsaWNlc1dpdGhDb2xvciA9IFtdO1xyXG4gICAgICAgIHVwZGF0ZWRTbGljZXNXaXRoQ29sb3IgPSBPYmplY3Qua2V5cyhzbGljZXMpLm1hcCgoa2V5LCBpbmRleCkgPT4gKE9iamVjdC5hc3NpZ24oeyBjb2xvcjogR1JBUEhfQ09MT1JTW2luZGV4ICUgR1JBUEhfQ09MT1JTLmxlbmd0aF0gfSwgc2xpY2VzW2tleV0pKSk7XHJcbiAgICAgICAgc2V0U2xpY2VzV2l0aENvbG9yKFsuLi51cGRhdGVkU2xpY2VzV2l0aENvbG9yXSk7XHJcbiAgICAgICAgaWYgKHRvdGFsU3VtID09PSAwKSB7XHJcbiAgICAgICAgICAgIGNvbnN0IGRhdGFTZXQgPSB7XHJcbiAgICAgICAgICAgICAgICBkYXRhc2V0czogW1xyXG4gICAgICAgICAgICAgICAgICAgIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgZGF0YTogWzEwMF0sXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGJhY2tncm91bmRDb2xvcjogWycjRjBGMEYwJ10sXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGJvcmRlcldpZHRoOiAwLFxyXG4gICAgICAgICAgICAgICAgICAgIH0sXHJcbiAgICAgICAgICAgICAgICBdLFxyXG4gICAgICAgICAgICB9O1xyXG4gICAgICAgICAgICBzZXREYXRhKGRhdGFTZXQpO1xyXG4gICAgICAgIH1cclxuICAgICAgICBlbHNlIHtcclxuICAgICAgICAgICAgY29uc3QgZGF0YVNldCA9IHtcclxuICAgICAgICAgICAgICAgIGxhYmVsczogc2xpY2VzLm1hcCgoc2xpY2UpID0+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([]),[n,u]=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){u({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}]};u(e)}}),[s]),n?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:n,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 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),o=require("../../assets/icons/chevronDown.svg.js"),r=require("react"),t=require("./CountryCodePicker.modal.js"),n=require("./CountryCodePicker.styled.js")
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),o=require("../../assets/icons/chevronDown.svg.js"),r=require("react"),t=require("./CountryCodePicker.modal.js"),n=require("./CountryCodePicker.styled.js"),s=require("../dropdown/DropdownPopover/index.js");require("../dropdown/Dropdown.js"),require("../zeroState/ZeroState.js");var d=require("../TypographyStyle.js"),i=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("../dropdown/OpenedDropdown/components/menu/SelectAllMenu.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");exports.CountryCodePicker=c=>{var l,u,p,a,m,j;const[y,w]=r.useState(null!==(l=c.selectedCountry)&&void 0!==l?l:{name:"India",dial:"+91",code:"IN"}),v=`https://flagcdn.com/${null===(u=y.code)||void 0===u?void 0:u.toLowerCase()}.svg`;r.useEffect((()=>{c.selectedCountry&&w(c.selectedCountry)}),[null===(p=c.selectedCountry)||void 0===p?void 0:p.code]);return e.jsx(s.DropdownPopover,Object.assign({isSearchable:!0,width:null!==(a=c.popoverWidth)&&void 0!==a?a:"200px",placement:null!==(m=c.placement)&&void 0!==m?m:"bottom-start",strategy:null!==(j=c.placementStrategy)&&void 0!==j?j:"absolute",options:t.CountriesData.map((o=>{var r;const t=`https://flagcdn.com/${null===(r=o.code)||void 0===r?void 0:r.toLowerCase()}.svg`;return{value:o.code,label:o.dial,searchKey:o.name,customComponent:e.jsxs(n.StyledCountryPickerOption,{children:[e.jsx("img",{src:t,className:"country-flag__option",alt:o.name}),e.jsxs(d.BodySecondary,{children:[o.code," ",o.dial]})]}),selected:y.code===o.code}})),onSelect:e=>{const o=t.CountriesData.filter((o=>o.code===e.value));w(o[0]),c.onCountrySelect(o[0])}},{children:e.jsxs(n.StyledCountryPickerWrapper,Object.assign({height:c.height},{children:[e.jsxs("div",Object.assign({className:"content__wrapper"},{children:[e.jsx("img",{src:v,className:"country-flag__selected-option",alt:y.name}),e.jsx(d.BodySecondary,{children:y.dial})]})),e.jsx(o.default,{width:24,height:24,color:i.COLORS.content.primary})]}))}))};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("date-fns"),t=require("react"),o=require("./DateSelector/DateSelector.js")
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("date-fns"),t=require("react"),o=require("./DateSelector/DateSelector.js"),s=require("../dropdown/DropdownPopover/index.js");require("../dropdown/Dropdown.js"),require("../zeroState/ZeroState.js");var n=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("../dropdown/OpenedDropdown/components/menu/SelectAllMenu.js"),require("../button/Button.js"),require("../dropdown/OpenedDropdown/components/multiSelect/MultiSelectDropdownBottomBar.styled.js"),require("../dropdown/OpenedDropdown/components/OpennedDropdown.styled.js");var i=require("../input/Input.js");require("../dropdown/MenuItem/MenuItem.js");var d=require("../../utils/DateUtils.js"),u=require("../../assets/icons/chevronDown.svg.js"),l=require("../../assets/icons/clock.svg.js"),a=require("./CustomDateTime.styled.js");const c=()=>{const e=[];for(let r=0;r<2;r++)for(let t=0;t<12;t++){let o;o=0===t?"12":t<10?`0${t}`:`${t}`;const s=`${o}:00 ${0===r?"AM":"PM"}`,n=`${o}:30 ${0===r?"AM":"PM"}`;e.push({label:s,value:s,selected:!1},{label:n,value:n,selected:!1})}return e};exports.CustomDateTime=p=>{const[m,j]=t.useState(p.time),[D,w]=t.useState(p.date);t.useEffect((()=>{p.setError(void 0);const e=d.default.convert12HourTimeTo24Hour(m),t=r.format(new Date,"HH:mm:ss");if(r.isToday(D)&&e<t)return void p.setError("Selected time should be later than current time");p.setError(void 0);const[o,s]=e.split(":"),n=new Date(D.getTime());n.setHours(+o,+s),p.onChange(n)}),[D,m]);return e.jsxs(a.CustomDateTimeStyle,{children:[e.jsxs("div",Object.assign({style:{display:"flex",gap:16}},{children:[e.jsx("div",Object.assign({style:{flex:1}},{children:e.jsx(o.default,{customDate:D,setCustomDate:w,placement:p.placement,minDate:p.minDate})})),e.jsx("div",Object.assign({style:{flex:1}},{children:e.jsx(s.DropdownPopover,Object.assign({options:c(),onSelect:e=>{j(e.value)}},{children:e.jsx(i.Input,{value:m,leftIcon:{icon:l.default},rightIcon:{icon:u.default},onChangeText:e=>(e=>{if(d.default.timeFormatValidation(e)){const t=d.default.convert12HourTimeTo24Hour(e),o=r.format(new Date,"HH:mm:ss");if(r.isToday(D)&&t<o)return void p.setError("Selected time should be later than current time");p.setError(void 0),j(e)}else p.setError('Format of time should be "HH:MM AM" or "HH:MM PM"')})(e)})}))}))]})),p.error&&e.jsx(n.BodySecondary,Object.assign({style:{paddingTop:8}},{children:p.error}))]})};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),o=require("./type.js")
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),o=require("./type.js");require("../dropdown/DropdownPopover/index.js");var i=require("../dropdown/Dropdown.js");require("../zeroState/ZeroState.js");var n=require("../TypographyStyle.js"),r=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("../dropdown/OpenedDropdown/components/menu/SelectAllMenu.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 s=require("../modals/styledModal.js"),d=require("../product-picker/ProductPickerModal.js"),a=require("../tag/Tag.js"),u=require("../tooltips/Tooltip.js"),c=require("../../assets/icons/triangle_error.svg.js"),l=require("./DiscountModal.styled.js"),T=require("./DiscountUtils.js"),p=require("./DynamicCoupon/DynamicCoupon.js"),E=require("./StaticCoupon/StaticCoupon.js");exports.DiscountModal=S=>{var C,I,P,_;const[y,O]=t.useState(),[b,D]=t.useState(null!==(C=S.data)&&void 0!==C?C:{}),[N,j]=t.useState(((null===(I=S.data)||void 0===I?void 0:I.isStaticCoupon)||S.allowStaticCoupon)&&!(null===(P=S.data)||void 0===P?void 0:P.targetSelection)),[v,U]=t.useState(!0),[g,m]=t.useState(),[q,h]=t.useState(o.MIN_PURCHASE_REQUIREMENT.NA),[A,x]=t.useState([]),[Y,L]=t.useState([]),[w,G]=t.useState(0);t.useEffect((()=>{let e;S.hideProbability||(e=M()),U(T.validateDiscountData(b,q,g,S.hideProbability||!1,e,N)),S.hideProbability||M()}),[]),t.useEffect((()=>{let e;S.hideProbability||(e=M()),U(T.validateDiscountData(b,q,g,S.hideProbability||!1,e,N))}),[N,b,w,g,q]),t.useEffect((()=>{var e,t;if(S.products){if(null===(e=S.data)||void 0===e?void 0:e.entitledProductIds){const e=S.products.filter((e=>{var t,o;return null===(o=null===(t=S.data)||void 0===t?void 0:t.entitledProductIds)||void 0===o?void 0:o.includes(parseInt(e.id))}));L(e)}if(null===(t=S.data)||void 0===t?void 0:t.prerequisiteProductIds){const e=S.products.filter((e=>{var t,o;return null===(o=null===(t=S.data)||void 0===t?void 0:t.prerequisiteProductIds)||void 0===o?void 0:o.includes(parseInt(e.id))}));x(e)}}}),[]),t.useEffect((()=>{const e=Y.map((e=>parseInt(e.id)));D(Object.assign(Object.assign({},b),{entitledProductIds:e}))}),[Y]),t.useEffect((()=>{const e=A.map((e=>parseInt(e.id)));D(Object.assign(Object.assign({},b),{prerequisiteProductIds:e}))}),[A]),t.useEffect((()=>{b.targetType===o.DISCOUNT_TARGET_TYPES.SHIPPING_LINE?m(o.DISCOUNT_TYPES.FREE_SHIPPING):b.targetSelection===o.DISCOUNT_TARGET_SELECTION.ENTITLED?m(o.DISCOUNT_TYPES.BUY_X_GET_Y):b.valueType===o.DISCOUNT_VALUE_TYPES.FIXED_AMOUNT?m(o.DISCOUNT_TYPES.FIXED_AMOUNT):b.valueType===o.DISCOUNT_VALUE_TYPES.PERCENTAGE&&m(o.DISCOUNT_TYPES.PERCENTAGE)}),[]);const R=[{value:o.DISCOUNT_TYPES.FIXED_AMOUNT,label:"Fixed Amount",selected:g===o.DISCOUNT_TYPES.FIXED_AMOUNT},{value:o.DISCOUNT_TYPES.PERCENTAGE,label:"Percentage",selected:g===o.DISCOUNT_TYPES.PERCENTAGE},{value:o.DISCOUNT_TYPES.BUY_X_GET_Y,label:"Buy X Get Y FREE",selected:g===o.DISCOUNT_TYPES.BUY_X_GET_Y},{value:o.DISCOUNT_TYPES.FREE_SHIPPING,label:"Free shipping",selected:g===o.DISCOUNT_TYPES.FREE_SHIPPING}],M=()=>{if(!S.quadrant||!S.probability)return;const e=[...S.probability];let t=[];e.length>=S.quadrant&&e.splice(S.quadrant-1,1),t=e;const o=t.reduce(((e,t)=>e+t),0)+(b.probability||0);return G(o),o},f=e=>{const t=e.value;m(t),t===o.DISCOUNT_TYPES.FREE_SHIPPING?(x([]),L([]),D(Object.assign(Object.assign({},b),{value:100,targetSelection:o.DISCOUNT_TARGET_SELECTION.ALL,targetType:o.DISCOUNT_TARGET_TYPES.SHIPPING_LINE,valueType:o.DISCOUNT_VALUE_TYPES.PERCENTAGE,entitledQuantity:void 0,prerequisiteQuantity:void 0,entitledProductIds:void 0,prerequisiteProductIds:void 0}))):t===o.DISCOUNT_TYPES.BUY_X_GET_Y?D(Object.assign(Object.assign({},b),{targetSelection:o.DISCOUNT_TARGET_SELECTION.ENTITLED,targetType:o.DISCOUNT_TARGET_TYPES.LINE_ITEM,valueType:o.DISCOUNT_VALUE_TYPES.PERCENTAGE})):t===o.DISCOUNT_TYPES.PERCENTAGE?(x([]),L([]),D(Object.assign(Object.assign({},b),{targetSelection:o.DISCOUNT_TARGET_SELECTION.ALL,targetType:o.DISCOUNT_TARGET_TYPES.LINE_ITEM,valueType:o.DISCOUNT_VALUE_TYPES.PERCENTAGE,entitledQuantity:void 0,prerequisiteQuantity:void 0,entitledProductIds:void 0,prerequisiteProductIds:void 0}))):t===o.DISCOUNT_TYPES.FIXED_AMOUNT&&(x([]),L([]),D(Object.assign(Object.assign({},b),{targetSelection:o.DISCOUNT_TARGET_SELECTION.ALL,targetType:o.DISCOUNT_TARGET_TYPES.LINE_ITEM,valueType:o.DISCOUNT_VALUE_TYPES.FIXED_AMOUNT,entitledQuantity:void 0,prerequisiteQuantity:void 0,entitledProductIds:void 0,prerequisiteProductIds:void 0})))};return e.jsxs(s.StyledModal,Object.assign({open:S.isOpen,headingTitle:y?"Select Products":S.title,headingSubtitle:y?void 0:S.subTitle,footerLeftCustomElement:!S.quadrant||S.hideProbability?e.jsx(e.Fragment,{}):w<=1?e.jsx(a.Tag,{theme:"light",tagText:`Current probability sum: ${w}`,type:"white"}):e.jsx(u.Tooltip,Object.assign({body:"Probability sum should not exceed 1",placement:"top"},{children:e.jsx("div",{children:e.jsx(a.Tag,{style:{cursor:"pointer"},theme:"light",tagText:`Current probability sum: ${w}`,type:"negative",LeadingIcon:c.default})})})),headerRightCustomElement:S.allowStaticCoupon||y?void 0:e.jsx(i.Dropdown,{options:R,width:"200px",placement:"bottom-start",size:"small",onSelect:e=>{f(e)}}),onClose:S.onClose,footerShadow:!0,primaryButton:y?{buttonType:"primary",onClick:()=>{O(void 0)},buttonText:"Add"}:{buttonType:"primary",buttonText:"Add code",disabled:v,onClick:()=>{b.isStaticCoupon?S.onSaveClicked({quadrant:b.quadrant,couponCode:b.couponCode,description:b.description,isStaticCoupon:b.isStaticCoupon,probability:b.probability,title:b.title}):S.onSaveClicked(b),D({})}},secondaryButton:y?{buttonType:"tertiaryGray",onClick:()=>{O(void 0)},buttonText:"Back"}:{buttonType:"tertiaryGray",onClick:S.onClose,buttonText:"Close"}},{children:[!y&&e.jsxs(l.StyledDiscountDialogueContainer,{children:[S.allowStaticCoupon&&!y&&e.jsxs(l.CouponTypeContainerStyled,Object.assign({selectedDiv:N?1:2},{children:[e.jsxs("div",Object.assign({className:"coupon-type__container",onClick:()=>{j(!0),D({isStaticCoupon:!0,couponCode:b.couponCode,description:b.description,quadrant:b.quadrant})}},{children:[e.jsx(n.TitleSmall,Object.assign({style:N?{color:r.DEFAULT_THEME.colorsV2.content.brand}:{}},{children:"Static code"})),e.jsx(n.BodyCaption,Object.assign({style:N?{color:r.DEFAULT_THEME.colorsV2.content.brand}:{}},{children:"One static code for all customers"}))]})),e.jsxs("div",Object.assign({className:"coupon-type__container",onClick:()=>{D(Object.assign(Object.assign({},b),{isStaticCoupon:!1})),j(!1)}},{children:[e.jsx(n.TitleSmall,Object.assign({style:N?{}:{color:r.DEFAULT_THEME.colorsV2.content.brand}},{children:"Dynamic code"})),e.jsx(n.BodyCaption,Object.assign({style:N?{}:{color:r.DEFAULT_THEME.colorsV2.content.brand}},{children:"New code generated for everyone"}))]}))]})),N&&!y&&e.jsx(E.default,{discountData:b,setDiscountData:D,hideProbability:S.hideProbability||!1,discountAdminUrl:S.discountAdminUrl}),!N&&!y&&e.jsx(p.default,{currency:S.currency,entitledProducts:Y,prerequisiteProducts:A,setEntitledProducts:L,setPrerequisiteProducts:x,discountData:b,productPickerOpen:y,setIsProductPickerOpen:O,setDiscountData:D,selectedCouponType:g,setSelectedCouponType:m,selectedMinimumRequirement:q,setSelectedMinimumRequirement:h,hideProbability:S.hideProbability||!1,hideExpiration:S.hideExpiration||!1,allowStaticCoupon:S.allowStaticCoupon,onChangeCouponType:f})]}),!!y&&e.jsx("div",Object.assign({style:{padding:"12px 0"}},{children:e.jsx(d.ProductPickerContent,{show:!0,onSave:()=>{},products:null!==(_=S.products)&&void 0!==_?_:[],title:"Select Products",onClose:()=>{O(void 0)},selectedProducts:y===p.DISCOUNT_PRODUCTS.ENTITLED?Y:A,setSelectedProducts:y===p.DISCOUNT_PRODUCTS.ENTITLED?L:x,onSearchKeyChange:S.onProductSearch})}))]}))};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),s=require("../../button/Button.js"),i=require("../type.js"),n=require("../../dropdown/Dropdown.js");require("../../dropdown/DropdownPopover/index.js"),require("../../zeroState/ZeroState.js");var a=require("../../TypographyStyle.js"),o=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("../../dropdown/OpenedDropdown/components/menu/SelectAllMenu.js"),require("../../dropdown/OpenedDropdown/components/multiSelect/MultiSelectDropdownBottomBar.styled.js"),require("../../dropdown/OpenedDropdown/components/OpennedDropdown.styled.js");var r=require("../../input/Input.js"),l=require("../../../assets/icons/cross.svg.js");require("../../dropdown/MenuItem/MenuItem.js"),require("../../modals/styledModal.js"),require("../../../node_modules/lodash.debounce/index.js"),require("../../bik-layout/CommonStyles.js"),require("../../product-picker/ProductPicker.styled.js"),require("../../../utils/DateUtils.js"),require("../../tag/Tag.js"),require("@tippyjs/react"),require("../../tooltips/TooltipInternal.js");var u=require("../DiscountModal.styled.js"),c=require("../CouponExpiration/CouponExpiration.js"),d=require("../../radioButton/RadioButton.js"),p=require("../../../assets/icons/cursor.svg.js"),j=require("../../../assets/icons/plus.svg.js");var T;function m(){return null}exports.DISCOUNT_PRODUCTS=void 0,(T=exports.DISCOUNT_PRODUCTS||(exports.DISCOUNT_PRODUCTS={})).ENTITLED="entitled",T.PREREQUISITE="prerequisite";exports.default=T=>{var D;t.useEffect((()=>{T.setDiscountData(Object.assign(Object.assign({},T.discountData),{isStaticCoupon:!1}))}),[]);const E=[{value:i.DISCOUNT_TYPES.FIXED_AMOUNT,label:"Fixed Amount",selected:T.selectedCouponType===i.DISCOUNT_TYPES.FIXED_AMOUNT},{value:i.DISCOUNT_TYPES.PERCENTAGE,label:"Percentage",selected:T.selectedCouponType===i.DISCOUNT_TYPES.PERCENTAGE},{value:i.DISCOUNT_TYPES.BUY_X_GET_Y,label:"Buy X Get Y FREE",selected:T.selectedCouponType===i.DISCOUNT_TYPES.BUY_X_GET_Y},{value:i.DISCOUNT_TYPES.FREE_SHIPPING,label:"Free shipping",selected:T.selectedCouponType===i.DISCOUNT_TYPES.FREE_SHIPPING}],x=[{selected:T.selectedMinimumRequirement===i.MIN_PURCHASE_REQUIREMENT.NA,label:"No minimum requirements",value:i.MIN_PURCHASE_REQUIREMENT.NA},{selected:T.selectedMinimumRequirement===i.MIN_PURCHASE_REQUIREMENT.AMOUNT,label:`Minimum purchase amount (${null!==(D=T.currency)&&void 0!==D?D:"₹"})`,value:i.MIN_PURCHASE_REQUIREMENT.AMOUNT},{selected:T.selectedMinimumRequirement===i.MIN_PURCHASE_REQUIREMENT.QUANTITY,label:"Minimum quantity of items",value:i.MIN_PURCHASE_REQUIREMENT.QUANTITY}],g=()=>{var t,s,o,l;return e.jsxs("div",Object.assign({className:"input__rows"},{children:[e.jsxs("div",Object.assign({className:"input__wrapper"},{children:[e.jsx(a.BodySecondary,Object.assign({style:{marginBottom:10}},{children:"Min purchase requirements"})),e.jsx(n.Dropdown,{options:x,placement:"bottom-start",onSelect:e=>{const t=e.value;T.setSelectedMinimumRequirement(t),T.setDiscountData(Object.assign(Object.assign({},T.discountData),{minQuantity:void 0,minAmount:void 0}))}})]})),e.jsx("div",Object.assign({className:"input__wrapper"},{children:T.selectedMinimumRequirement!==i.MIN_PURCHASE_REQUIREMENT.NA&&e.jsx(r.Input,{value:T.selectedMinimumRequirement===i.MIN_PURCHASE_REQUIREMENT.AMOUNT?null!==(s=null===(t=T.discountData.minAmount)||void 0===t?void 0:t.toString())&&void 0!==s?s:"":null!==(l=null===(o=T.discountData.minQuantity)||void 0===o?void 0:o.toString())&&void 0!==l?l:"",onChangeText:e=>{T.selectedMinimumRequirement===i.MIN_PURCHASE_REQUIREMENT.AMOUNT?T.setDiscountData(Object.assign(Object.assign({},T.discountData),{minAmount:parseInt(e)})):T.selectedMinimumRequirement===i.MIN_PURCHASE_REQUIREMENT.QUANTITY&&T.setDiscountData(Object.assign(Object.assign({},T.discountData),{minQuantity:parseInt(e)}))},labelText:T.selectedMinimumRequirement===i.MIN_PURCHASE_REQUIREMENT.AMOUNT?"Minimum purchase amount":"Minimum purchase quantity",type:"number",placeholder:T.selectedMinimumRequirement===i.MIN_PURCHASE_REQUIREMENT.AMOUNT?"1000.00":"2"})}))]}))},b=t=>{var i,n;const u=t===exports.DISCOUNT_PRODUCTS.ENTITLED?T.entitledProducts:T.prerequisiteProducts;return e.jsxs(e.Fragment,{children:[e.jsx(a.TitleRegular,{children:t===exports.DISCOUNT_PRODUCTS.PREREQUISITE?"Customer spends":"Customer gets"}),e.jsxs("div",Object.assign({className:"input__rows"},{children:[e.jsx("div",Object.assign({className:"input__wrapper"},{children:e.jsx(r.Input,{value:t===exports.DISCOUNT_PRODUCTS.ENTITLED?null===(i=T.discountData.entitledQuantity)||void 0===i?void 0:i.toString():null===(n=T.discountData.prerequisiteQuantity)||void 0===n?void 0:n.toString(),type:"number",onChangeText:e=>{t===exports.DISCOUNT_PRODUCTS.ENTITLED?T.setDiscountData(Object.assign(Object.assign({},T.discountData),{entitledQuantity:parseInt(e)})):T.setDiscountData(Object.assign(Object.assign({},T.discountData),{prerequisiteQuantity:parseInt(e)}))},labelText:"Add quantity",placeholder:"Add quantity"})})),e.jsx("div",{className:"input__wrapper"})]})),e.jsx("div",{children:e.jsx(s.Button,{buttonText:"Add product",buttonType:"tertiary",LeadingIcon:j.default,onClick:()=>{T.setIsProductPickerOpen(t)}})}),u.map((s=>e.jsxs("div",Object.assign({style:{padding:"20px 0 12px 0",borderBottom:`1px solid ${o.DEFAULT_THEME.colorsV2.stroke.primary}`,display:"flex"}},{children:[e.jsxs("div",Object.assign({style:{display:"flex",gap:16,alignItems:"center",flex:.8}},{children:[e.jsx("img",{src:s.image,onError:e=>{e.target.onerror=null,e.target.src="https://jkfenner.com/wp-content/uploads/2019/11/default.jpg"},style:{height:40,width:40,objectFit:"cover",borderRadius:4}}),e.jsx(a.TitleSmall,{children:s.name})]})),e.jsx("div",Object.assign({style:{flex:.2,display:"flex",justifyContent:"flex-end",alignItems:"center"}},{children:e.jsx("div",Object.assign({style:{cursor:"pointer"},onClick:()=>{const e=u.filter((e=>e.id!==s.id));t===exports.DISCOUNT_PRODUCTS.ENTITLED?T.setEntitledProducts(e):T.setPrerequisiteProducts(e)}},{children:e.jsx(l.default,{width:14,color:o.DEFAULT_THEME.colorsV2.content.primary})}))}))]}),s.id)))]})};return e.jsxs(u.DynamicCouponContainer,{children:[T.allowStaticCoupon&&e.jsxs("div",Object.assign({className:"input__rows"},{children:[e.jsx("div",Object.assign({className:"input__wrapper"},{children:e.jsx(n.Dropdown,{options:E,width:"290px",placement:"bottom-start",onSelect:e=>{T.onChangeCouponType(e)}})})),e.jsx("div",{className:"input__wrapper"})]})),(T.selectedCouponType===i.DISCOUNT_TYPES.PERCENTAGE||T.selectedCouponType===i.DISCOUNT_TYPES.FIXED_AMOUNT)&&(()=>{var t,s,n,a;return e.jsxs(e.Fragment,{children:[e.jsxs("div",Object.assign({className:"input__rows"},{children:[e.jsx("div",Object.assign({className:"input__wrapper"},{children:e.jsx(r.Input,{value:T.discountData.title,onChangeText:e=>{T.setDiscountData(Object.assign(Object.assign({},T.discountData),{title:e}))},maxCharLimit:18,labelText:"Code title",placeholder:"eg: Flat 50% Off"})})),e.jsx("div",Object.assign({className:"input__wrapper"},{children:e.jsx(r.Input,{value:null===(s=null===(t=T.discountData)||void 0===t?void 0:t.value)||void 0===s?void 0:s.toString(),labelText:"Discount code value",type:"number",onChangeText:e=>{T.setDiscountData(Object.assign(Object.assign({},T.discountData),{value:parseInt(e)}))},placeholder:T.selectedCouponType===i.DISCOUNT_TYPES.FIXED_AMOUNT?"0.00":"Enter a value",prefixText:T.selectedCouponType===i.DISCOUNT_TYPES.FIXED_AMOUNT?null!==(n=T.currency)&&void 0!==n?n:"₹":void 0,suffixText:T.selectedCouponType===i.DISCOUNT_TYPES.PERCENTAGE?"%":void 0})}))]})),g(),!T.hideProbability&&e.jsxs("div",Object.assign({className:"input__rows"},{children:[e.jsx("div",Object.assign({className:"input__wrapper"},{children:e.jsx(r.Input,{type:"number",value:null===(a=T.discountData.probability)||void 0===a?void 0:a.toString(),onChangeText:e=>{T.setDiscountData(Object.assign(Object.assign({},T.discountData),{probability:e.startsWith(".")?parseFloat(`0${e}`):parseFloat(e)}))},labelText:"Probability",placeholder:"Enter probability in decimals eg: 0.2, 0.5, 0.75"})})),e.jsx("div",{className:"input__wrapper"})]}))]})})(),T.selectedCouponType===i.DISCOUNT_TYPES.FREE_SHIPPING&&(()=>{var t;return e.jsxs(e.Fragment,{children:[e.jsxs("div",Object.assign({className:"input__rows"},{children:[e.jsx("div",Object.assign({className:"input__wrapper"},{children:e.jsx(r.Input,{value:T.discountData.title,onChangeText:e=>{T.setDiscountData(Object.assign(Object.assign({},T.discountData),{title:e}))},labelText:"Code title",placeholder:"eg: Flat 50% Off",maxCharLimit:18})})),e.jsx("div",Object.assign({className:"input__wrapper"},{children:!T.hideProbability&&e.jsx(r.Input,{value:null===(t=T.discountData.probability)||void 0===t?void 0:t.toString(),type:"number",onChangeText:e=>{T.setDiscountData(Object.assign(Object.assign({},T.discountData),{probability:e.startsWith(".")?parseFloat(`0${e}`):parseFloat(e)}))},labelText:"Probability",placeholder:"Enter probability in decimals eg: 0.2, 0.5, 0.75"})}))]})),g()]})})(),T.selectedCouponType===i.DISCOUNT_TYPES.BUY_X_GET_Y&&(()=>{var t;return e.jsxs(u.DynamicCouponContainer,{children:[e.jsx("div",Object.assign({className:"input__rows"},{children:e.jsxs("div",Object.assign({style:{display:"flex",flexDirection:"column",gap:20,flex:1}},{children:[e.jsx(r.Input,{value:T.discountData.title,onChangeText:e=>{T.setDiscountData(Object.assign(Object.assign({},T.discountData),{title:e}))},maxCharLimit:18,labelText:"Code title",placeholder:"eg: Flat 50% Off"}),!T.hideProbability&&e.jsx(r.Input,{value:null===(t=T.discountData.probability)||void 0===t?void 0:t.toString(),type:"number",onChangeText:e=>{T.setDiscountData(Object.assign(Object.assign({},T.discountData),{probability:e.startsWith(".")?parseFloat(`0${e}`):parseFloat(e)}))},labelText:"Probability",placeholder:"Enter probability in decimals eg: 0.2, 0.5, 0.75"})]}))})),e.jsx(m,{}),b(exports.DISCOUNT_PRODUCTS.PREREQUISITE),e.jsx(m,{}),b(exports.DISCOUNT_PRODUCTS.ENTITLED),e.jsx(m,{}),e.jsx(a.TitleRegular,{children:"At a discount value"}),e.jsxs("div",Object.assign({style:{display:"flex",gap:18,alignItems:"center"}},{children:[e.jsx(d.RadioButton,{isActive:100!==T.discountData.value,onValueChange:e=>{T.setDiscountData(Object.assign(Object.assign({},T.discountData),{value:void 0}))}}),e.jsx(a.BodySecondary,{children:"Percentage"}),100!==T.discountData.value&&e.jsx(r.Input,{variant:"small",onChangeText:e=>{T.setDiscountData(Object.assign(Object.assign({},T.discountData),{value:parseInt(e)}))},type:"number",placeholder:"Enter percentage eg: 10%",suffixText:"%",width:"238px"})]})),e.jsxs("div",Object.assign({style:{display:"flex",gap:18}},{children:[e.jsx(d.RadioButton,{isActive:100===T.discountData.value,onValueChange:e=>{e?T.setDiscountData(Object.assign(Object.assign({},T.discountData),{value:100})):T.setDiscountData(Object.assign(Object.assign({},T.discountData),{value:void 0}))}}),e.jsx(a.BodySecondary,{children:"Free"})]}))]})})(),T.selectedCouponType&&!T.hideExpiration&&e.jsxs(e.Fragment,{children:[e.jsx("div",{style:{height:6,borderTop:`1px solid ${o.DEFAULT_THEME.colorsV2.stroke.primary}`,marginTop:12}}),e.jsx(c.CouponExpiration,{discountData:T.discountData,setDiscountData:T.setDiscountData})]}),!T.selectedCouponType&&e.jsxs("div",Object.assign({style:{display:"flex",flexDirection:"column",gap:10,padding:"40px 0",justifyContent:"center",alignItems:"center"}},{children:[e.jsx("div",Object.assign({style:{height:52,width:52,backgroundColor:o.DEFAULT_THEME.colorsV2.background.inverse,borderRadius:"50%",display:"flex",justifyContent:"center",alignItems:"center"}},{children:e.jsx(p.default,{width:32,color:o.DEFAULT_THEME.colorsV2.content.primaryInverse})})),e.jsx(a.TitleMedium,{children:"No discount has been selected"}),e.jsx(a.BodyPrimary,{children:"Please select a discount type"})]}))]})};
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),s=require("../../button/Button.js"),i=require("../type.js");require("../../dropdown/DropdownPopover/index.js");var n=require("../../dropdown/Dropdown.js");require("../../zeroState/ZeroState.js");var a=require("../../TypographyStyle.js"),r=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("../../dropdown/OpenedDropdown/components/menu/SelectAllMenu.js"),require("../../dropdown/OpenedDropdown/components/multiSelect/MultiSelectDropdownBottomBar.styled.js"),require("../../dropdown/OpenedDropdown/components/OpennedDropdown.styled.js");var o=require("../../input/Input.js"),l=require("../../../assets/icons/cross.svg.js");require("../../dropdown/MenuItem/MenuItem.js"),require("../../modals/styledModal.js"),require("../../../node_modules/lodash.debounce/index.js"),require("../../bik-layout/CommonStyles.js"),require("../../product-picker/ProductPicker.styled.js"),require("../../../utils/DateUtils.js"),require("../../tag/Tag.js"),require("@tippyjs/react"),require("../../tooltips/TooltipInternal.js");var u=require("../DiscountModal.styled.js"),c=require("../CouponExpiration/CouponExpiration.js"),d=require("../../radioButton/RadioButton.js"),p=require("../../../assets/icons/cursor.svg.js"),j=require("../../../assets/icons/plus.svg.js");var T;function m(){return null}exports.DISCOUNT_PRODUCTS=void 0,(T=exports.DISCOUNT_PRODUCTS||(exports.DISCOUNT_PRODUCTS={})).ENTITLED="entitled",T.PREREQUISITE="prerequisite";exports.default=T=>{var D;t.useEffect((()=>{T.setDiscountData(Object.assign(Object.assign({},T.discountData),{isStaticCoupon:!1}))}),[]);const E=[{value:i.DISCOUNT_TYPES.FIXED_AMOUNT,label:"Fixed Amount",selected:T.selectedCouponType===i.DISCOUNT_TYPES.FIXED_AMOUNT},{value:i.DISCOUNT_TYPES.PERCENTAGE,label:"Percentage",selected:T.selectedCouponType===i.DISCOUNT_TYPES.PERCENTAGE},{value:i.DISCOUNT_TYPES.BUY_X_GET_Y,label:"Buy X Get Y FREE",selected:T.selectedCouponType===i.DISCOUNT_TYPES.BUY_X_GET_Y},{value:i.DISCOUNT_TYPES.FREE_SHIPPING,label:"Free shipping",selected:T.selectedCouponType===i.DISCOUNT_TYPES.FREE_SHIPPING}],x=[{selected:T.selectedMinimumRequirement===i.MIN_PURCHASE_REQUIREMENT.NA,label:"No minimum requirements",value:i.MIN_PURCHASE_REQUIREMENT.NA},{selected:T.selectedMinimumRequirement===i.MIN_PURCHASE_REQUIREMENT.AMOUNT,label:`Minimum purchase amount (${null!==(D=T.currency)&&void 0!==D?D:"₹"})`,value:i.MIN_PURCHASE_REQUIREMENT.AMOUNT},{selected:T.selectedMinimumRequirement===i.MIN_PURCHASE_REQUIREMENT.QUANTITY,label:"Minimum quantity of items",value:i.MIN_PURCHASE_REQUIREMENT.QUANTITY}],g=()=>{var t,s,r,l;return e.jsxs("div",Object.assign({className:"input__rows"},{children:[e.jsxs("div",Object.assign({className:"input__wrapper"},{children:[e.jsx(a.BodySecondary,Object.assign({style:{marginBottom:10}},{children:"Min purchase requirements"})),e.jsx(n.Dropdown,{options:x,placement:"bottom-start",onSelect:e=>{const t=e.value;T.setSelectedMinimumRequirement(t),T.setDiscountData(Object.assign(Object.assign({},T.discountData),{minQuantity:void 0,minAmount:void 0}))}})]})),e.jsx("div",Object.assign({className:"input__wrapper"},{children:T.selectedMinimumRequirement!==i.MIN_PURCHASE_REQUIREMENT.NA&&e.jsx(o.Input,{value:T.selectedMinimumRequirement===i.MIN_PURCHASE_REQUIREMENT.AMOUNT?null!==(s=null===(t=T.discountData.minAmount)||void 0===t?void 0:t.toString())&&void 0!==s?s:"":null!==(l=null===(r=T.discountData.minQuantity)||void 0===r?void 0:r.toString())&&void 0!==l?l:"",onChangeText:e=>{T.selectedMinimumRequirement===i.MIN_PURCHASE_REQUIREMENT.AMOUNT?T.setDiscountData(Object.assign(Object.assign({},T.discountData),{minAmount:parseInt(e)})):T.selectedMinimumRequirement===i.MIN_PURCHASE_REQUIREMENT.QUANTITY&&T.setDiscountData(Object.assign(Object.assign({},T.discountData),{minQuantity:parseInt(e)}))},labelText:T.selectedMinimumRequirement===i.MIN_PURCHASE_REQUIREMENT.AMOUNT?"Minimum purchase amount":"Minimum purchase quantity",type:"number",placeholder:T.selectedMinimumRequirement===i.MIN_PURCHASE_REQUIREMENT.AMOUNT?"1000.00":"2"})}))]}))},b=t=>{var i,n;const u=t===exports.DISCOUNT_PRODUCTS.ENTITLED?T.entitledProducts:T.prerequisiteProducts;return e.jsxs(e.Fragment,{children:[e.jsx(a.TitleRegular,{children:t===exports.DISCOUNT_PRODUCTS.PREREQUISITE?"Customer spends":"Customer gets"}),e.jsxs("div",Object.assign({className:"input__rows"},{children:[e.jsx("div",Object.assign({className:"input__wrapper"},{children:e.jsx(o.Input,{value:t===exports.DISCOUNT_PRODUCTS.ENTITLED?null===(i=T.discountData.entitledQuantity)||void 0===i?void 0:i.toString():null===(n=T.discountData.prerequisiteQuantity)||void 0===n?void 0:n.toString(),type:"number",onChangeText:e=>{t===exports.DISCOUNT_PRODUCTS.ENTITLED?T.setDiscountData(Object.assign(Object.assign({},T.discountData),{entitledQuantity:parseInt(e)})):T.setDiscountData(Object.assign(Object.assign({},T.discountData),{prerequisiteQuantity:parseInt(e)}))},labelText:"Add quantity",placeholder:"Add quantity"})})),e.jsx("div",{className:"input__wrapper"})]})),e.jsx("div",{children:e.jsx(s.Button,{buttonText:"Add product",buttonType:"tertiary",LeadingIcon:j.default,onClick:()=>{T.setIsProductPickerOpen(t)}})}),u.map((s=>e.jsxs("div",Object.assign({style:{padding:"20px 0 12px 0",borderBottom:`1px solid ${r.DEFAULT_THEME.colorsV2.stroke.primary}`,display:"flex"}},{children:[e.jsxs("div",Object.assign({style:{display:"flex",gap:16,alignItems:"center",flex:.8}},{children:[e.jsx("img",{src:s.image,onError:e=>{e.target.onerror=null,e.target.src="https://jkfenner.com/wp-content/uploads/2019/11/default.jpg"},style:{height:40,width:40,objectFit:"cover",borderRadius:4}}),e.jsx(a.TitleSmall,{children:s.name})]})),e.jsx("div",Object.assign({style:{flex:.2,display:"flex",justifyContent:"flex-end",alignItems:"center"}},{children:e.jsx("div",Object.assign({style:{cursor:"pointer"},onClick:()=>{const e=u.filter((e=>e.id!==s.id));t===exports.DISCOUNT_PRODUCTS.ENTITLED?T.setEntitledProducts(e):T.setPrerequisiteProducts(e)}},{children:e.jsx(l.default,{width:14,color:r.DEFAULT_THEME.colorsV2.content.primary})}))}))]}),s.id)))]})};return e.jsxs(u.DynamicCouponContainer,{children:[T.allowStaticCoupon&&e.jsxs("div",Object.assign({className:"input__rows"},{children:[e.jsx("div",Object.assign({className:"input__wrapper"},{children:e.jsx(n.Dropdown,{options:E,width:"290px",placement:"bottom-start",onSelect:e=>{T.onChangeCouponType(e)}})})),e.jsx("div",{className:"input__wrapper"})]})),(T.selectedCouponType===i.DISCOUNT_TYPES.PERCENTAGE||T.selectedCouponType===i.DISCOUNT_TYPES.FIXED_AMOUNT)&&(()=>{var t,s,n,a;return e.jsxs(e.Fragment,{children:[e.jsxs("div",Object.assign({className:"input__rows"},{children:[e.jsx("div",Object.assign({className:"input__wrapper"},{children:e.jsx(o.Input,{value:T.discountData.title,onChangeText:e=>{T.setDiscountData(Object.assign(Object.assign({},T.discountData),{title:e}))},maxCharLimit:18,labelText:"Code title",placeholder:"eg: Flat 50% Off"})})),e.jsx("div",Object.assign({className:"input__wrapper"},{children:e.jsx(o.Input,{value:null===(s=null===(t=T.discountData)||void 0===t?void 0:t.value)||void 0===s?void 0:s.toString(),labelText:"Discount code value",type:"number",onChangeText:e=>{T.setDiscountData(Object.assign(Object.assign({},T.discountData),{value:parseInt(e)}))},placeholder:T.selectedCouponType===i.DISCOUNT_TYPES.FIXED_AMOUNT?"0.00":"Enter a value",prefixText:T.selectedCouponType===i.DISCOUNT_TYPES.FIXED_AMOUNT?null!==(n=T.currency)&&void 0!==n?n:"₹":void 0,suffixText:T.selectedCouponType===i.DISCOUNT_TYPES.PERCENTAGE?"%":void 0})}))]})),g(),!T.hideProbability&&e.jsxs("div",Object.assign({className:"input__rows"},{children:[e.jsx("div",Object.assign({className:"input__wrapper"},{children:e.jsx(o.Input,{type:"number",value:null===(a=T.discountData.probability)||void 0===a?void 0:a.toString(),onChangeText:e=>{T.setDiscountData(Object.assign(Object.assign({},T.discountData),{probability:e.startsWith(".")?parseFloat(`0${e}`):parseFloat(e)}))},labelText:"Probability",placeholder:"Enter probability in decimals eg: 0.2, 0.5, 0.75"})})),e.jsx("div",{className:"input__wrapper"})]}))]})})(),T.selectedCouponType===i.DISCOUNT_TYPES.FREE_SHIPPING&&(()=>{var t;return e.jsxs(e.Fragment,{children:[e.jsxs("div",Object.assign({className:"input__rows"},{children:[e.jsx("div",Object.assign({className:"input__wrapper"},{children:e.jsx(o.Input,{value:T.discountData.title,onChangeText:e=>{T.setDiscountData(Object.assign(Object.assign({},T.discountData),{title:e}))},labelText:"Code title",placeholder:"eg: Flat 50% Off",maxCharLimit:18})})),e.jsx("div",Object.assign({className:"input__wrapper"},{children:!T.hideProbability&&e.jsx(o.Input,{value:null===(t=T.discountData.probability)||void 0===t?void 0:t.toString(),type:"number",onChangeText:e=>{T.setDiscountData(Object.assign(Object.assign({},T.discountData),{probability:e.startsWith(".")?parseFloat(`0${e}`):parseFloat(e)}))},labelText:"Probability",placeholder:"Enter probability in decimals eg: 0.2, 0.5, 0.75"})}))]})),g()]})})(),T.selectedCouponType===i.DISCOUNT_TYPES.BUY_X_GET_Y&&(()=>{var t;return e.jsxs(u.DynamicCouponContainer,{children:[e.jsx("div",Object.assign({className:"input__rows"},{children:e.jsxs("div",Object.assign({style:{display:"flex",flexDirection:"column",gap:20,flex:1}},{children:[e.jsx(o.Input,{value:T.discountData.title,onChangeText:e=>{T.setDiscountData(Object.assign(Object.assign({},T.discountData),{title:e}))},maxCharLimit:18,labelText:"Code title",placeholder:"eg: Flat 50% Off"}),!T.hideProbability&&e.jsx(o.Input,{value:null===(t=T.discountData.probability)||void 0===t?void 0:t.toString(),type:"number",onChangeText:e=>{T.setDiscountData(Object.assign(Object.assign({},T.discountData),{probability:e.startsWith(".")?parseFloat(`0${e}`):parseFloat(e)}))},labelText:"Probability",placeholder:"Enter probability in decimals eg: 0.2, 0.5, 0.75"})]}))})),e.jsx(m,{}),b(exports.DISCOUNT_PRODUCTS.PREREQUISITE),e.jsx(m,{}),b(exports.DISCOUNT_PRODUCTS.ENTITLED),e.jsx(m,{}),e.jsx(a.TitleRegular,{children:"At a discount value"}),e.jsxs("div",Object.assign({style:{display:"flex",gap:18,alignItems:"center"}},{children:[e.jsx(d.RadioButton,{isActive:100!==T.discountData.value,onValueChange:e=>{T.setDiscountData(Object.assign(Object.assign({},T.discountData),{value:void 0}))}}),e.jsx(a.BodySecondary,{children:"Percentage"}),100!==T.discountData.value&&e.jsx(o.Input,{variant:"small",onChangeText:e=>{T.setDiscountData(Object.assign(Object.assign({},T.discountData),{value:parseInt(e)}))},type:"number",placeholder:"Enter percentage eg: 10%",suffixText:"%",width:"238px"})]})),e.jsxs("div",Object.assign({style:{display:"flex",gap:18}},{children:[e.jsx(d.RadioButton,{isActive:100===T.discountData.value,onValueChange:e=>{e?T.setDiscountData(Object.assign(Object.assign({},T.discountData),{value:100})):T.setDiscountData(Object.assign(Object.assign({},T.discountData),{value:void 0}))}}),e.jsx(a.BodySecondary,{children:"Free"})]}))]})})(),T.selectedCouponType&&!T.hideExpiration&&e.jsxs(e.Fragment,{children:[e.jsx("div",{style:{height:6,borderTop:`1px solid ${r.DEFAULT_THEME.colorsV2.stroke.primary}`,marginTop:12}}),e.jsx(c.CouponExpiration,{discountData:T.discountData,setDiscountData:T.setDiscountData})]}),!T.selectedCouponType&&e.jsxs("div",Object.assign({style:{display:"flex",flexDirection:"column",gap:10,padding:"40px 0",justifyContent:"center",alignItems:"center"}},{children:[e.jsx("div",Object.assign({style:{height:52,width:52,backgroundColor:r.DEFAULT_THEME.colorsV2.background.inverse,borderRadius:"50%",display:"flex",justifyContent:"center",alignItems:"center"}},{children:e.jsx(p.default,{width:32,color:r.DEFAULT_THEME.colorsV2.content.primaryInverse})})),e.jsx(a.TitleMedium,{children:"No discount has been selected"}),e.jsx(a.BodyPrimary,{children:"Please select a discount type"})]}))]})};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("../../../assets/icons/horizontal_dots.svg.js"),o=require("../../../assets/icons/vertical_dots.svg.js"),n=require("styled-components")
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("../../../assets/icons/horizontal_dots.svg.js"),o=require("../../../assets/icons/vertical_dots.svg.js"),n=require("styled-components"),t=require("../DropdownPopover/index.js");require("../Dropdown.js"),require("react"),require("../../zeroState/ZeroState.js"),require("../../TypographyStyle.js");var s=require("../../../constants/Theme.js");require("../OpenedDropdown/components/description/Description.styled.js"),require("../../checkBox/CheckBox.styled.js"),require("../../list-item/ListItem.js"),require("../OpenedDropdown/components/menu/FreeFormMenu.styled.js"),require("../OpenedDropdown/components/menu/MenuItem.js"),require("../OpenedDropdown/components/menu/MenuList.styled.js"),require("../OpenedDropdown/components/menu/SelectAllMenu.js"),require("../../button/Button.js"),require("../OpenedDropdown/components/multiSelect/MultiSelectDropdownBottomBar.styled.js"),require("../OpenedDropdown/components/OpennedDropdown.styled.js"),require("../../input/Input.js");var u=require("../../icon-button/IconButton.js");function i(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}const d=i(n).default.div`
|
|
2
2
|
:hover {
|
|
3
3
|
background: ${s.COLORS.surface.subdued};
|
|
4
4
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { DropdownProps } from "../dropdown";
|
|
2
3
|
import { ButtonProps } from '../button/model';
|
|
3
|
-
import { DropdownPopoverProps } from '../dropdown/DropdownPopover';
|
|
4
4
|
export interface DropdownButtonProps {
|
|
5
|
-
dropdownProps:
|
|
5
|
+
dropdownProps: DropdownProps;
|
|
6
6
|
buttonProps: ButtonProps;
|
|
7
7
|
iconProps: React.FunctionComponent<React.SVGAttributes<SVGElement>>;
|
|
8
8
|
}
|
|
@@ -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("../dropdown/DropdownPopover/index.js");require("../dropdown/Dropdown.js"),require("react"),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("../dropdown/OpenedDropdown/components/menu/SelectAllMenu.js");var r=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("./DropdownButton.style.js");exports.DropdownButton=n=>e.jsxs(t.DropdownButtonStyle,Object.assign({type:n.buttonProps.buttonType,disabled:n.buttonProps.disabled},{children:[e.jsx(r.Button,Object.assign({},n.buttonProps,{style:{borderRadius:"0px",borderTopLeftRadius:"4px",borderBottomLeftRadius:"4px"}})),e.jsx("div",{className:"divider"}),e.jsx(o.DropdownPopover,Object.assign({},n.dropdownProps,{children:e.jsx(r.Button,Object.assign({},n.buttonProps,{buttonText:"",TrailingIcon:n.iconProps,style:{borderRadius:"0px",borderTopRightRadius:"4px",borderBottomRightRadius:"4px"}}))}))]}));
|