@bikdotai/bik-component-library 0.0.384-beta.28 → 0.0.385
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/components/analytics-chips-and-dropdowns/chart/Pie/PieChartAnalytics.js +1 -1
- package/dist/cjs/components/discount-modal/DynamicCoupon/DynamicCoupon.js +1 -1
- package/dist/cjs/components/product-picker-v2/helpers/ProductHelper.d.ts +1 -13
- package/dist/cjs/components/product-picker-v2/helpers/ProductHelper.js +1 -1
- package/dist/cjs/components/product-picker-v2/modal.d.ts +2 -16
- package/dist/cjs/components/product-picker-v2/modal.js +1 -1
- package/dist/cjs/components/product-picker-v2/style.d.ts +0 -3
- package/dist/cjs/components/product-picker-v2/style.js +11 -43
- package/dist/cjs/constants/Theme.d.ts +19 -0
- package/dist/cjs/constants/Theme.js +1 -1
- package/dist/cjs/index.js +1 -1
- package/dist/esm/components/analytics-chips-and-dropdowns/chart/Pie/PieChartAnalytics.js +1 -1
- package/dist/esm/components/discount-modal/DynamicCoupon/DynamicCoupon.js +1 -1
- package/dist/esm/components/product-picker-v2/helpers/ProductHelper.d.ts +1 -13
- package/dist/esm/components/product-picker-v2/helpers/ProductHelper.js +1 -1
- package/dist/esm/components/product-picker-v2/modal.d.ts +2 -16
- package/dist/esm/components/product-picker-v2/modal.js +1 -1
- package/dist/esm/components/product-picker-v2/style.d.ts +0 -3
- package/dist/esm/components/product-picker-v2/style.js +9 -41
- package/dist/esm/constants/Theme.d.ts +19 -0
- package/dist/esm/constants/Theme.js +1 -1
- package/dist/esm/index.js +1 -1
- package/package.json +1 -2
- package/dist/cjs/assets/icons/drag_handle.svg.js +0 -1
- package/dist/cjs/components/product-picker-v2/rearrangeScreen.d.ts +0 -18
- package/dist/cjs/components/product-picker-v2/rearrangeScreen.js +0 -1
- package/dist/cjs/components/product-picker-v2/variant.d.ts +0 -32
- package/dist/cjs/components/product-picker-v2/variant.js +0 -1
- package/dist/cjs/components/product-picker-v2/variantComponents.d.ts +0 -21
- package/dist/cjs/components/product-picker-v2/variantComponents.js +0 -1
- package/dist/esm/assets/icons/drag_handle.svg.js +0 -1
- package/dist/esm/components/product-picker-v2/rearrangeScreen.d.ts +0 -18
- package/dist/esm/components/product-picker-v2/rearrangeScreen.js +0 -1
- package/dist/esm/components/product-picker-v2/variant.d.ts +0 -32
- package/dist/esm/components/product-picker-v2/variant.js +0 -1
- package/dist/esm/components/product-picker-v2/variantComponents.d.ts +0 -21
- package/dist/esm/components/product-picker-v2/variantComponents.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@emotion/styled/base"),r=require("react/jsx-runtime"),i=require("../../../../utils/StringUtils.js"),t=require("../../../../constants/Theme.js");require("../../../../constants/zindex.js");var g=require("react");require("../../../checkBox/CheckBox.styled.js");var s=require("../../../TypographyStyle.js");require("../../../list-item/ListItem.js"),require("../../../pagination/Pagination.js"),require("../../../radioButton/RadioButton.styled.js"),require("react-dom"),require("react-toastify"),require("../../../toaster/Toaster.styled.js"),require("@tippyjs/react"),require("../../../tooltips/TooltipInternal.js"),require("../../../spinner/Spinner.js"),require("../../../stepper/Stepper.styled.js"),require("../../../tag/Tag.js"),require("../../../icon-button/IconButton.js"),require("../../../template-preview/TemplatePreview.js"),require("../../../template-preview/WhatsApp/WhatsAppLikePreview.js"),require("../../../template-preview/WhatsApp/WhatsAppLikePreviewV2.js"),require("../../../template-preview/models/TemplateMeta.js"),require("../../../modals/styledModal.js"),require("../../../template-preview/models/Channels.js"),require("../../../template-context-mapper/context/templateModalContext.js"),require("../../../template-context-mapper/modalElements/Footer.js"),require("../../../template-context-mapper/modalElements/Body.js"),require("../../../template-context-mapper/modalElements/Header.js"),require("../../../zeroState/ZeroState.js"),require("../../../dropdown/OpenedDropdown/components/description/Description.styled.js"),require("../../../dropdown/OpenedDropdown/components/menu/FreeFormMenu.styled.js"),require("../../../dropdown/OpenedDropdown/components/menu/MenuItem.js"),require("../../../dropdown/OpenedDropdown/components/menu/MenuList.styled.js"),require("../../../button/Button.js"),require("../../../dropdown/OpenedDropdown/components/multiSelect/MultiSelectDropdownBottomBar.styled.js"),require("../../../dropdown/OpenedDropdown/components/OpennedDropdown.styled.js"),require("../../../input/Input.js"),require("react-bootstrap"),require("../../../floating-action-button/FloatingActionButton.styles.js"),require("../../../image-compress/ImageCompress.js"),require("../../../progress-bar/ProgressBarComponent.js"),require("../../../QueryBuilder/QueryBuilder.js"),require("../../../QueryBuilder/components/QueryBuilderNode/Base/BaseQueryBuilderNode.js"),require("../../../QueryBuilder/constants/connectorPosition.js"),require("../../../QueryBuilder/constants/connector.js"),require("../../../QueryBuilder/types/QueryBuilder.type.js"),require("../../../dropdown/Dropdown.js"),require("../../../QueryBuilder/components/InputLoader.js"),require("../../../QueryBuilder/components/Connectors/Components/EmojiPicker.js"),require("react-chips"),require("../../../input/ChipInput.styled.js"),require("../../../QueryBuilder/components/Connectors/Components/FrequencyIntegerPositiveSingle.js"),require("../../../QueryBuilder/components/Connectors/Components/IgPicker.js"),require("../../../QueryBuilder/components/Connectors/Components/InTheLast.js"),require("../../../QueryBuilder/components/Connectors/Components/InTwoLast.js"),require("react-calendar"),require("../../../../utils/DateUtils.js"),require("../../../datePicker/DatePickerWrapper.styled.js"),require("../../../QueryBuilder/components/Connectors/Connector.styled.js"),require("../../../QueryBuilder/components/QueryBuilderNode/Property/PropertyNode.styled.js"),require("../../../QueryBuilder/components/QueryBuilderNode/Property/PropertyNodeUIWrapper.styled.js"),require("../../../QueryBuilder/redux/queryBuilder.reducer.js"),require("../../../QueryBuilder/redux/queryBuilderCache.reducer.js"),require("../../../QueryBuilder/types/QueryBuilderOperator.type.js"),require("../../../dropdown/DropdownPopover/index.js"),require("../../../dropdown/ChipDropdown.js"),require("../../../dropdown/MenuItem/MenuItem.js"),require("../../../shimmer/ShimmerComponent/ShimmerStyled.js"),require("../../../analytics-card/AnalyticsCard.styled.js"),require("../../CommonStyles.js"),require("../../../datePicker/DatePicker.styled.js"),require("../../AnalyticsMetric.js"),require("../LineChart/LineChart.js"),require("../linearChipGroupedChart/LinearChipGroupedChart.styled.js");var I=require("./PieChart.js");require("../HorizontalBarGraph/HorizontalGraph.js"),require("../StackedBarChart/StackedBarChart.js"),require("../VerticalBarGraph/VerticalGraph.js"),require("../heatmap/HeatMap.js"),require("../VerticalBarAndLinearGraph/VerticalBarAndLinearGraph.js"),require("../../../avatar/Avatar.js"),require("../../../avatar/AvatarHelper.js"),require("../../../alerts/Alert.styled.js"),require("../../../alerts/AlertHelper.js"),require("../../../thumbnail/Thumbnail.js"),require("../../../curtain/Curtain.styled.js"),require("../../../curtain/CurtainHelper.js"),require("../../../switch/Switch.js"),require("../../../plans/SubscriptionPlanStyled.js"),require("../../../plans/SubscriptionPlanSelector.js"),require("../../../plans/SubscriptionPlansCollected.js"),require("../../../tabs/Tabs.js"),require("../../../TablePagination/TablePagination.styled.js"),require("../../../TablePagination/TablePaginationCard.js"),require("../../../states/StateComponent.js"),require("../../../../_virtual/_tslib.js"),require("../../../WhatsAppTextEditor/WhatsAppTextEditor.js"),require("../../../WhatsAppTextEditor/WhatsAppTextEditorHeader.js"),require("../../../card-selection-modal/CardSelectionModal.styled.js"),require("react-image-crop"),require("../../../buttonGroup/ButtonGroupStyle.js"),require("../../../accordion/Accordion.style.js"),require("../../../accordion/AccordionArrow.js"),require("../../../file-uploader/FileUploaderStyle.js"),require("../../../colourInput/ColourInput.styled.js"),require("../../../bik-layout/CommonStyles.js"),require("../../../navigation-hyperlink/NavigationHyperlink.js"),require("../../../bik-layout/SidebarStyles.js"),require("date-fns"),require("react-popper"),require("../../../dropdown/Common.styled.js"),require("../../../custom-date-time/CustomDateTime.styled.js"),require("../../../../node_modules/lodash.debounce/index.js"),require("../../../product-picker/ProductPicker.styled.js"),require("../../../discount-modal/type.js"),require("../../../product-picker-v2/modal.js"),require("../../../discount-modal/DiscountModal.styled.js"),require("../../../discount-modal/DynamicCoupon/DynamicCoupon.js"),require("../../../discount-modal/CouponExpiration/CouponExpiration.js"),require("../../../country-code-picker/CountryCodePicker.styled.js"),require("../../../carousel/carousel.js"),require("../../../carousel-secondary/CarouselSecondary.style.js"),require("../../../access-token-troubleshoot-dialog/AccessTokenTroubleshootDialog.styles.js"),require("../../../radioList/RadioList.styled.js"),require("../../../checkList/CheckList.styled.js"),require("../../../postPicker/postPicker.js"),require("../../../dropdown-button/DropdownButton.style.js"),require("../../../side-modal/SideModal.style.js"),require("../../../add-variableV2/AddVariableV2.styled.js"),require("../../../SearchFilter/types/SearchFilter.type.js"),require("../../../SearchFilter/components/DatePickerButton.js"),require("../../../SearchFilter/components/DateRangeOnlyButton.js"),require("../../../input-with-vars/InputWithVariables.js"),require("../../../star-rating/StarRating.js"),require("../../../dashboard-review-popup/components/FiveStar.styled.js"),require("../../../dashboard-review-popup/components/Form.styled.js"),require("../../../dashboard-review-popup/components/ZeroState.js"),require("../../../dashboard-review-popup/DashboardReviewPopUp.styled.js"),require("../../../testimonial-card/TestimonialCard.style.js"),require("../../../slider/slider.js");var C=require("chart.js"),o=require("react-chartjs-2");function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var a=c(e);C.Chart.register(C.ArcElement,C.Legend);const l={plugins:{legend:{display:!1},tooltip:{enabled:!0,callbacks:{label:e=>{if(!e.label)return" 0%";const r=e.dataset.data.reduce(((e,r)=>e+r),0),i=parseFloat((e.raw/r*100).toFixed(1));return` ${e.label}: ${i}%`}}}}},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,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIlBpZUNoYXJ0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ICAgICAgY2FsbGJhY2tzOiB7XHJcbiAgICAgICAgICAgICAgICBsYWJlbDogKHRvb2x0aXBJdGVtKSA9PiB7XHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKCF0b29sdGlwSXRlbS5sYWJlbCkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gYCAwJWA7XHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IHRvdGFsID0gdG9vbHRpcEl0ZW0uZGF0YXNldC5kYXRhLnJlZHVjZSgoYWNjLCBjdXIpID0+IGFjYyArIGN1ciwgMCk7XHJcbiAgICAgICAgICAgICAgICAgICAgY29uc3QgcGVyY2VudGFnZSA9IHBhcnNlRmxvYXQoKCh0b29sdGlwSXRlbS5yYXcgLyB0b3RhbCkgKiAxMDApLnRvRml4ZWQoMSkpO1xyXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBgICR7dG9vbHRpcEl0ZW0ubGFiZWx9OiAke3BlcmNlbnRhZ2V9JWA7XHJcbiAgICAgICAgICAgICAgICB9LFxyXG4gICAgICAgICAgICB9LFxyXG4gICAgICAgIH0sXHJcbiAgICB9LFxyXG59O1xyXG5jb25zdCBHUkFQSF9DT0xPUlMgPSBbXHJcbiAgICAnIzVFMDdCQicsXHJcbiAgICAnIzlFNzdFRCcsXHJcbiAgICAnI0QyQUVGRicsXHJcbiAgICAnI0NERTFGRicsXHJcbiAgICAnIzkyQUZGQScsXHJcbiAgICAnIzM5MzVFMScsXHJcbl07XHJcbmNvbnN0IENhcnRTdHlsZWQgPSBzdHlsZWQuZGl2IGBcblx0YmFja2dyb3VuZDogJHsocHJvcHMpID0+IENPTE9SUy5zdXJmYWNlLnN0YW5kYXJkfTtcblx0Ym9yZGVyOiAxcHggc29saWQgJHsocHJvcHMpID0+IENPTE9SUy5zdHJva2UucHJpbWFyeX07XG5cdGJvcmRlci1yYWRpdXM6IDRweDtcbmA7XHJcbmV4cG9ydCBjb25z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gICAgICAgZGF0YTogWzEwMF0sXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGJhY2tncm91bmRDb2xvcjogWycjRjBGMEYwJ10sXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGJvcmRlcldpZHRoOiAwLFxyXG4gICAgICAgICAgICAgICAgICAgIH0sXHJcbiAgICAgICAgICAgICAgICBdLFxyXG4gICAgICAgICAgICB9O1xyXG4gICAgICAgICAgICBzZXREYXRhKGRhdGFTZXQpO1xyXG4gICAgICAgIH1cclxuICAgICAgICBlbHNlIHtcclxuICAgICAgICAgICAgY29uc3QgZGF0YVNldCA9IHtcclxuICAgICAgICAgICAgICAgIGxhYmVsczogc2xpY2VzLm1hcCgoc2xpY2UpID0+IFN0cmluZ1V0aWxzLmNhcGl0YWxpemUoc2xpY2UubmFtZSkpLFxyXG4gICAgICAgICAgICAgICAgZGF0YXNldHM6IFtcclxuICAgICAgICAgICAgICAgICAgICB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGRhdGE6IHNsaWNlcy5tYXAoKHNsaWNlKSA9PiBzbGljZS5jb3VudCksXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGJhY2tncm91bmRDb2xvcjogc2xpY2VzLm1hcCgoc2xpY2UsIGluZGV4KSA9PiB7IHZhciBfYTsgcmV0dXJuIChfYSA9IHNsaWNlLmNvbG9yKSAhPT0gbnVsbCAmJiBfYSAhPT0gdm9pZCAwID8gX2EgOiBHUkFQSF9DT0xPUlNbaW5kZXggJSBHUkFQSF9DT0xPUlMubGVuZ3RoXTsgfSksXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGJvcmRlckNvbG9yOiBbJ3doaXRlJywgJ3doaXRlJywgJ3doaXRlJywgJ3doaXRlJywgJ3doaXRlJywgJ3doaXRlJ10sXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGJvcmRlcldpZHRoOiA0LFxyXG4gICAgICAgICAgICAgICAgICAgICAgICBib3JkZXJSYWRpdXM6IDgsXHJcbiAgICAgICAgICAgICAgICAgICAgfSxcclxuICAgICAgICAgICAgICAgIF0sXHJcbiAgICAgICAgICAgIH07XHJcbiAgICAgICAgICAgIHNldERhdGEoZGF0YVNldCk7XHJcbiAgICAgICAgfVxyXG4gICAgfSwgW3NsaWNlc10pO1xyXG4gICAgaWYgKCFkYXRhKSB7XHJcbiAgICAgICAgcmV0dXJuIF9qc3goX0ZyYWdtZW50LCB7fSk7XHJcbiAgICB9XHJcbiAgICByZXR1cm4gKF9qc3hzKF9GcmFnbWVudCwgeyBjaGlsZHJlbjogW3RpdGxlICYmIChfanN4KFRpdGxlTWVkaXVtLCBPYmplY3QuYXNzaWduKHsgc3R5bGU6IHtcclxuICAgICAgICAgICAgICAgICAgICBtYXJnaW5Cb3R0b206IDE2LFxyXG4gICAgICAgICAgICAgICAgfSB9LCB7IGNoaWxkcmVuOiB0aXRsZSB9KSkpLCBfanN4cyhcImRpdlwiLCBPYmplY3QuYXNzaWduKHsgY2xhc3NOYW1lOiAncm93JyB9LCB7IGNoaWxkcmVuOiBbX2pzeChcImRpdlwiLCBPYmplY3QuYXNzaWduKHsgY2xhc3NOYW1lOiAnY29sLTYnIH0sIHsgY2hpbGRyZW46IF9qc3goXCJkaXZcIiwgT2JqZWN0LmFzc2lnbih7IHN0eWxlOiB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd2lkdGg6IHNpemUsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGVpZ2h0OiBzaXplLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSB9LCB7IGNoaWxkcmVuOiBfanN4KERvdWdobnV0LCB7IGRhdGE6IGRhdGEsIG9wdGlvbnM6IE9iamVjdC5hc3NpZ24oT2JqZWN0LmFzc2lnbih7fSwgb3B0aW9ucyksIHsgbWFpbnRhaW5Bc3BlY3RSYXRpbzogc2l6ZSA/IGZhbHNlIDogdHJ1ZSB9KSB9KSB9KSkgfSkpLCBfanN4KFwiZGl2XCIsIE9iamVjdC5hc3NpZ24oeyBjbGFzc05hbWU6ICdjb2wtNicsIHN0eWxlOiB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYWRkaW5nTGVmdDogNDgsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkaXNwbGF5OiAnZmxleCcsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBmbGV4RGlyZWN0aW9uOiAnY29sdW1uJyxcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGp1c3RpZnlDb250ZW50OiAnY2VudGVyJyxcclxuICAgICAgICAgICAgICAgICAgICAgICAgfSB9LCB7IGNoaWxkcmVuOiBfanN4KFBpZUNoYXJ0LCB7IHNsaWNlczogc2xpY2VzV2l0aENvbG9yIH0pIH0pKV0gfSkpXSB9KSk7XHJcbn07XHJcbi8vIyBzb3VyY2VNYXBwaW5nVVJMPVBpZUNoYXJ0QW5hbHl0aWNzLmpzLm1hcCJdfQ== */"));exports.Card=e=>r.jsx(d,Object.assign({style:{padding:24}},{children:e.children})),exports.PieChartAnalytics=e=>{let{title:t,slices:C,size:c}=e;const[a,d]=g.useState([]),[n,u]=g.useState();return g.useEffect((()=>{const e=C.reduce(((e,r)=>e+r.count),0);let r=[];if(r=Object.keys(C).map(((e,r)=>Object.assign({color:A[r%A.length]},C[e]))),d([...r]),0===e){u({datasets:[{data:[100],backgroundColor:["#F0F0F0"],borderWidth:0}]})}else{const e={labels:C.map((e=>i.default.capitalize(e.name))),datasets:[{data:C.map((e=>e.count)),backgroundColor:C.map(((e,r)=>{var i;return null!==(i=e.color)&&void 0!==i?i:A[r%A.length]})),borderColor:["white","white","white","white","white","white"],borderWidth:4,borderRadius:8}]};u(e)}}),[C]),n?r.jsxs(r.Fragment,{children:[t&&r.jsx(s.TitleMedium,Object.assign({style:{marginBottom:16}},{children:t})),r.jsxs("div",Object.assign({className:"row"},{children:[r.jsx("div",Object.assign({className:"col-6"},{children:r.jsx("div",Object.assign({style:{width:c,height:c}},{children:r.jsx(o.Doughnut,{data:n,options:Object.assign(Object.assign({},l),{maintainAspectRatio:!c})})}))})),r.jsx("div",Object.assign({className:"col-6",style:{paddingLeft:48,display:"flex",flexDirection:"column",justifyContent:"center"}},{children:r.jsx(I.PieChart,{slices:a})}))]}))]}):r.jsx(r.Fragment,{})};
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@emotion/styled/base"),r=require("react/jsx-runtime"),i=require("../../../../utils/StringUtils.js"),t=require("../../../../constants/Theme.js");require("../../../../constants/zindex.js");var g=require("react");require("../../../checkBox/CheckBox.styled.js");var s=require("../../../TypographyStyle.js");require("../../../list-item/ListItem.js"),require("../../../pagination/Pagination.js"),require("../../../radioButton/RadioButton.styled.js"),require("react-dom"),require("react-toastify"),require("../../../toaster/Toaster.styled.js"),require("@tippyjs/react"),require("../../../tooltips/TooltipInternal.js"),require("../../../spinner/Spinner.js"),require("../../../stepper/Stepper.styled.js"),require("../../../tag/Tag.js"),require("../../../icon-button/IconButton.js"),require("../../../template-preview/TemplatePreview.js"),require("../../../template-preview/WhatsApp/WhatsAppLikePreview.js"),require("../../../template-preview/WhatsApp/WhatsAppLikePreviewV2.js"),require("../../../template-preview/models/TemplateMeta.js"),require("../../../modals/styledModal.js"),require("../../../template-preview/models/Channels.js"),require("../../../template-context-mapper/context/templateModalContext.js"),require("../../../template-context-mapper/modalElements/Footer.js"),require("../../../template-context-mapper/modalElements/Body.js"),require("../../../template-context-mapper/modalElements/Header.js"),require("../../../zeroState/ZeroState.js"),require("../../../dropdown/OpenedDropdown/components/description/Description.styled.js"),require("../../../dropdown/OpenedDropdown/components/menu/FreeFormMenu.styled.js"),require("../../../dropdown/OpenedDropdown/components/menu/MenuItem.js"),require("../../../dropdown/OpenedDropdown/components/menu/MenuList.styled.js"),require("../../../button/Button.js"),require("../../../dropdown/OpenedDropdown/components/multiSelect/MultiSelectDropdownBottomBar.styled.js"),require("../../../dropdown/OpenedDropdown/components/OpennedDropdown.styled.js"),require("../../../input/Input.js"),require("react-bootstrap"),require("../../../floating-action-button/FloatingActionButton.styles.js"),require("../../../image-compress/ImageCompress.js"),require("../../../progress-bar/ProgressBarComponent.js"),require("../../../QueryBuilder/QueryBuilder.js"),require("../../../QueryBuilder/components/QueryBuilderNode/Base/BaseQueryBuilderNode.js"),require("../../../QueryBuilder/constants/connectorPosition.js"),require("../../../QueryBuilder/constants/connector.js"),require("../../../QueryBuilder/types/QueryBuilder.type.js"),require("../../../dropdown/Dropdown.js"),require("../../../QueryBuilder/components/InputLoader.js"),require("../../../QueryBuilder/components/Connectors/Components/EmojiPicker.js"),require("react-chips"),require("../../../input/ChipInput.styled.js"),require("../../../QueryBuilder/components/Connectors/Components/FrequencyIntegerPositiveSingle.js"),require("../../../QueryBuilder/components/Connectors/Components/IgPicker.js"),require("../../../QueryBuilder/components/Connectors/Components/InTheLast.js"),require("../../../QueryBuilder/components/Connectors/Components/InTwoLast.js"),require("react-calendar"),require("../../../../utils/DateUtils.js"),require("../../../datePicker/DatePickerWrapper.styled.js"),require("../../../QueryBuilder/components/Connectors/Connector.styled.js"),require("../../../QueryBuilder/components/QueryBuilderNode/Property/PropertyNode.styled.js"),require("../../../QueryBuilder/components/QueryBuilderNode/Property/PropertyNodeUIWrapper.styled.js"),require("../../../QueryBuilder/redux/queryBuilder.reducer.js"),require("../../../QueryBuilder/redux/queryBuilderCache.reducer.js"),require("../../../QueryBuilder/types/QueryBuilderOperator.type.js"),require("../../../dropdown/DropdownPopover/index.js"),require("../../../dropdown/ChipDropdown.js"),require("../../../dropdown/MenuItem/MenuItem.js"),require("../../../shimmer/ShimmerComponent/ShimmerStyled.js"),require("../../../analytics-card/AnalyticsCard.styled.js"),require("../../CommonStyles.js"),require("../../../datePicker/DatePicker.styled.js"),require("../../AnalyticsMetric.js"),require("../LineChart/LineChart.js"),require("../linearChipGroupedChart/LinearChipGroupedChart.styled.js");var I=require("./PieChart.js");require("../HorizontalBarGraph/HorizontalGraph.js"),require("../StackedBarChart/StackedBarChart.js"),require("../VerticalBarGraph/VerticalGraph.js"),require("../heatmap/HeatMap.js"),require("../VerticalBarAndLinearGraph/VerticalBarAndLinearGraph.js"),require("../../../avatar/Avatar.js"),require("../../../avatar/AvatarHelper.js"),require("../../../alerts/Alert.styled.js"),require("../../../alerts/AlertHelper.js"),require("../../../thumbnail/Thumbnail.js"),require("../../../curtain/Curtain.styled.js"),require("../../../curtain/CurtainHelper.js"),require("../../../switch/Switch.js"),require("../../../plans/SubscriptionPlanStyled.js"),require("../../../plans/SubscriptionPlanSelector.js"),require("../../../plans/SubscriptionPlansCollected.js"),require("../../../tabs/Tabs.js"),require("../../../TablePagination/TablePagination.styled.js"),require("../../../TablePagination/TablePaginationCard.js"),require("../../../states/StateComponent.js"),require("../../../../_virtual/_tslib.js"),require("../../../WhatsAppTextEditor/WhatsAppTextEditor.js"),require("../../../WhatsAppTextEditor/WhatsAppTextEditorHeader.js"),require("../../../card-selection-modal/CardSelectionModal.styled.js"),require("react-image-crop"),require("../../../buttonGroup/ButtonGroupStyle.js"),require("../../../accordion/Accordion.style.js"),require("../../../accordion/AccordionArrow.js"),require("../../../file-uploader/FileUploaderStyle.js"),require("../../../colourInput/ColourInput.styled.js"),require("../../../bik-layout/CommonStyles.js"),require("../../../navigation-hyperlink/NavigationHyperlink.js"),require("../../../bik-layout/SidebarStyles.js"),require("date-fns"),require("react-popper"),require("../../../dropdown/Common.styled.js"),require("../../../custom-date-time/CustomDateTime.styled.js"),require("../../../../node_modules/lodash.debounce/index.js"),require("../../../product-picker/ProductPicker.styled.js"),require("../../../discount-modal/type.js"),require("../../../product-picker-v2/emptyState.js"),require("../../../product-picker-v2/style.js"),require("lodash"),require("../../../product-picker-v2/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("../../../carousel/carousel.js"),require("../../../carousel-secondary/CarouselSecondary.style.js"),require("../../../access-token-troubleshoot-dialog/AccessTokenTroubleshootDialog.styles.js"),require("../../../radioList/RadioList.styled.js"),require("../../../checkList/CheckList.styled.js"),require("../../../postPicker/postPicker.js"),require("../../../dropdown-button/DropdownButton.style.js"),require("../../../side-modal/SideModal.style.js"),require("../../../add-variableV2/AddVariableV2.styled.js"),require("../../../SearchFilter/types/SearchFilter.type.js"),require("../../../SearchFilter/components/DatePickerButton.js"),require("../../../SearchFilter/components/DateRangeOnlyButton.js"),require("../../../input-with-vars/InputWithVariables.js"),require("../../../star-rating/StarRating.js"),require("../../../dashboard-review-popup/components/FiveStar.styled.js"),require("../../../dashboard-review-popup/components/Form.styled.js"),require("../../../dashboard-review-popup/components/ZeroState.js"),require("../../../dashboard-review-popup/DashboardReviewPopUp.styled.js"),require("../../../testimonial-card/TestimonialCard.style.js"),require("../../../slider/slider.js");var C=require("chart.js"),o=require("react-chartjs-2");function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var a=c(e);C.Chart.register(C.ArcElement,C.Legend);const l={plugins:{legend:{display:!1},tooltip:{enabled:!0,callbacks:{label:e=>{if(!e.label)return" 0%";const r=e.dataset.data.reduce(((e,r)=>e+r),0),i=parseFloat((e.raw/r*100).toFixed(1));return` ${e.label}: ${i}%`}}}}},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,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIlBpZUNoYXJ0QW5hbHl0aWNzLnRzeCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFzQzhCIiwiZmlsZSI6IlBpZUNoYXJ0QW5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XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGJvcmRlcldpZHRoOiAwLFxyXG4gICAgICAgICAgICAgICAgICAgIH0sXHJcbiAgICAgICAgICAgICAgICBdLFxyXG4gICAgICAgICAgICB9O1xyXG4gICAgICAgICAgICBzZXREYXRhKGRhdGFTZXQpO1xyXG4gICAgICAgIH1cclxuICAgICAgICBlbHNlIHtcclxuICAgICAgICAgICAgY29uc3QgZGF0YVNldCA9IHtcclxuICAgICAgICAgICAgICAgIGxhYmVsczogc2xpY2VzLm1hcCgoc2xpY2UpID0+IFN0cmluZ1V0aWxzLmNhcGl0YWxpemUoc2xpY2UubmFtZSkpLFxyXG4gICAgICAgICAgICAgICAgZGF0YXNldHM6IFtcclxuICAgICAgICAgICAgICAgICAgICB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGRhdGE6IHNsaWNlcy5tYXAoKHNsaWNlKSA9PiBzbGljZS5jb3VudCksXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGJhY2tncm91bmRDb2xvcjogc2xpY2VzLm1hcCgoc2xpY2UsIGluZGV4KSA9PiB7IHZhciBfYTsgcmV0dXJuIChfYSA9IHNsaWNlLmNvbG9yKSAhPT0gbnVsbCAmJiBfYSAhPT0gdm9pZCAwID8gX2EgOiBHUkFQSF9DT0xPUlNbaW5kZXggJSBHUkFQSF9DT0xPUlMubGVuZ3RoXTsgfSksXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGJvcmRlckNvbG9yOiBbJ3doaXRlJywgJ3doaXRlJywgJ3doaXRlJywgJ3doaXRlJywgJ3doaXRlJywgJ3doaXRlJ10sXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGJvcmRlcldpZHRoOiA0LFxyXG4gICAgICAgICAgICAgICAgICAgICAgICBib3JkZXJSYWRpdXM6IDgsXHJcbiAgICAgICAgICAgICAgICAgICAgfSxcclxuICAgICAgICAgICAgICAgIF0sXHJcbiAgICAgICAgICAgIH07XHJcbiAgICAgICAgICAgIHNldER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gICAgICBwYWRkaW5nTGVmdDogNDgsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkaXNwbGF5OiAnZmxleCcsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBmbGV4RGlyZWN0aW9uOiAnY29sdW1uJyxcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGp1c3RpZnlDb250ZW50OiAnY2VudGVyJyxcclxuICAgICAgICAgICAgICAgICAgICAgICAgfSB9LCB7IGNoaWxkcmVuOiBfanN4KFBpZUNoYXJ0LCB7IHNsaWNlczogc2xpY2VzV2l0aENvbG9yIH0pIH0pKV0gfSkpXSB9KSk7XHJcbn07XHJcbi8vIyBzb3VyY2VNYXBwaW5nVVJMPVBpZUNoYXJ0QW5hbHl0aWNzLmpzLm1hcCJdfQ== */"));exports.Card=e=>r.jsx(d,Object.assign({style:{padding:24}},{children:e.children})),exports.PieChartAnalytics=e=>{let{title:t,slices:C,size:c}=e;const[a,d]=g.useState([]),[u,n]=g.useState();return g.useEffect((()=>{const e=C.reduce(((e,r)=>e+r.count),0);let r=[];if(r=Object.keys(C).map(((e,r)=>Object.assign({color:A[r%A.length]},C[e]))),d([...r]),0===e){n({datasets:[{data:[100],backgroundColor:["#F0F0F0"],borderWidth:0}]})}else{const e={labels:C.map((e=>i.default.capitalize(e.name))),datasets:[{data:C.map((e=>e.count)),backgroundColor:C.map(((e,r)=>{var i;return null!==(i=e.color)&&void 0!==i?i:A[r%A.length]})),borderColor:["white","white","white","white","white","white"],borderWidth:4,borderRadius:8}]};n(e)}}),[C]),u?r.jsxs(r.Fragment,{children:[t&&r.jsx(s.TitleMedium,Object.assign({style:{marginBottom:16}},{children:t})),r.jsxs("div",Object.assign({className:"row"},{children:[r.jsx("div",Object.assign({className:"col-6"},{children:r.jsx("div",Object.assign({style:{width:c,height:c}},{children:r.jsx(o.Doughnut,{data:u,options:Object.assign(Object.assign({},l),{maintainAspectRatio:!c})})}))})),r.jsx("div",Object.assign({className:"col-6",style:{paddingLeft:48,display:"flex",flexDirection:"column",justifyContent:"center"}},{children:r.jsx(I.PieChart,{slices:a})}))]}))]}):r.jsx(r.Fragment,{})};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("lodash"),s=require("../../button/Button.js");require("react");var i=require("../type.js");require("../../dropdown/DropdownPopover/index.js");var n=require("../../dropdown/Dropdown.js");require("../../dropdown/ChipDropdown.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/multiSelect/MultiSelectDropdownBottomBar.styled.js"),require("../../dropdown/OpenedDropdown/components/OpennedDropdown.styled.js");var l=require("../../input/Input.js"),r=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"),require("../../product-picker-v2/modal.js");var d=require("../DiscountModal.styled.js"),u=require("../CouponExpiration/CouponExpiration.js"),c=require("../../radioButton/RadioButton.js"),p=require("../../../assets/icons/cursor.svg.js"),T=require("../../../assets/icons/plus.svg.js");const j="https://jkfenner.com/wp-content/uploads/2019/11/default.jpg";var D;function x(){return null}exports.DISCOUNT_PRODUCTS=void 0,(D=exports.DISCOUNT_PRODUCTS||(exports.DISCOUNT_PRODUCTS={})).ENTITLED="entitled",D.PREREQUISITE="prerequisite";exports.default=D=>{var v;const E=[{value:i.DISCOUNT_TYPES.AMOUNT_OFF_ORDER,label:"Amount off on order",selected:D.selectedCouponType===i.DISCOUNT_TYPES.AMOUNT_OFF_ORDER},{value:i.DISCOUNT_TYPES.AMOUNT_OFF_PRODUCTS,label:"Amount off on products",selected:D.selectedCouponType===i.DISCOUNT_TYPES.AMOUNT_OFF_PRODUCTS},{value:i.DISCOUNT_TYPES.BUY_X_GET_Y,label:"Buy X Get Y FREE",selected:D.selectedCouponType===i.DISCOUNT_TYPES.BUY_X_GET_Y},{value:i.DISCOUNT_TYPES.FREE_SHIPPING,label:"Free shipping",selected:D.selectedCouponType===i.DISCOUNT_TYPES.FREE_SHIPPING}],O=[{selected:D.selectedMinimumRequirement===i.MIN_PURCHASE_REQUIREMENT.NA,label:"No minimum requirements",value:i.MIN_PURCHASE_REQUIREMENT.NA},{selected:D.selectedMinimumRequirement===i.MIN_PURCHASE_REQUIREMENT.AMOUNT,label:`Minimum purchase amount (${null!==(v=D.currency)&&void 0!==v?v:"₹"})`,value:i.MIN_PURCHASE_REQUIREMENT.AMOUNT},{selected:D.selectedMinimumRequirement===i.MIN_PURCHASE_REQUIREMENT.QUANTITY,label:"Minimum quantity of items",value:i.MIN_PURCHASE_REQUIREMENT.QUANTITY}],m=()=>{var e,t,s,n,a;if(D.discountData.valueType===i.DISCOUNT_VALUE_TYPES.FIXED_AMOUNT){if((null===(e=D.discountData)||void 0===e?void 0:e.value)&&(null===(t=D.discountData)||void 0===t?void 0:t.value)<=0)return"Enter a valid input"}else if((null===(s=D.discountData)||void 0===s?void 0:s.value)&&((null===(n=D.discountData)||void 0===n?void 0:n.value)<=0||(null===(a=D.discountData)||void 0===a?void 0:a.value)>100))return"Enter a valid input"},g=()=>{var t,s,o,r,d;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:O,placement:"bottom-start",onSelect:e=>{const t=e.value;D.setSelectedMinimumRequirement(t),D.setDiscountData(Object.assign(Object.assign({},D.discountData),{minQuantity:void 0,minAmount:void 0}))}})]})),e.jsx("div",Object.assign({className:"input__wrapper"},{children:D.selectedMinimumRequirement!==i.MIN_PURCHASE_REQUIREMENT.NA&&e.jsx(l.Input,{value:D.selectedMinimumRequirement===i.MIN_PURCHASE_REQUIREMENT.AMOUNT?null!==(s=null===(t=D.discountData.minAmount)||void 0===t?void 0:t.toString())&&void 0!==s?s:"":null!==(r=null===(o=D.discountData.minQuantity)||void 0===o?void 0:o.toString())&&void 0!==r?r:"",onChangeText:e=>{D.selectedMinimumRequirement===i.MIN_PURCHASE_REQUIREMENT.AMOUNT?D.setDiscountData(Object.assign(Object.assign({},D.discountData),{minAmount:parseInt(e)})):D.selectedMinimumRequirement===i.MIN_PURCHASE_REQUIREMENT.QUANTITY&&D.setDiscountData(Object.assign(Object.assign({},D.discountData),{minQuantity:parseInt(e)}))},labelText:D.selectedMinimumRequirement===i.MIN_PURCHASE_REQUIREMENT.AMOUNT?"Minimum purchase amount":"Minimum purchase quantity",prefixText:D.selectedMinimumRequirement===i.MIN_PURCHASE_REQUIREMENT.AMOUNT?null!==(d=D.currency)&&void 0!==d?d:"₹":void 0,type:"number",placeholder:D.selectedMinimumRequirement===i.MIN_PURCHASE_REQUIREMENT.AMOUNT?"1000.00":"2"})}))]}))},b=(i,n)=>{var d,u,c,p;let x=[],v=[],E={},O={};return D.useNewPicker?(E=i===exports.DISCOUNT_PRODUCTS.ENTITLED?D.entitledProducts:D.prerequisiteProducts,O=null!==(d=i===exports.DISCOUNT_PRODUCTS.ENTITLED?D.entitledCollections:D.prerequisiteCollections)&&void 0!==d?d:[],(null==E?void 0:E.isCustom)&&delete E.isCustom,(null==O?void 0:O.isCustom)&&delete O.isCustom,Object.values(E).forEach((e=>{Object.keys(e.products).forEach((t=>{x.push({id:t,name:e.products[t].name,image:e.products[t].image})}))})),Object.keys(O).forEach((e=>{"isCustom"!==e&&v.push({id:e,name:O[e].name,image:O[e].image})}))):(x=i===exports.DISCOUNT_PRODUCTS.ENTITLED?D.entitledProducts:D.prerequisiteProducts,v=null!==(u=i===exports.DISCOUNT_PRODUCTS.ENTITLED?D.entitledCollections:D.prerequisiteCollections)&&void 0!==u?u:[]),e.jsxs(e.Fragment,{children:[!n&&e.jsxs(e.Fragment,{children:[e.jsx(a.TitleRegular,{children:i===exports.DISCOUNT_PRODUCTS.PREREQUISITE?"Customer buys":"Customer gets"}),e.jsxs("div",Object.assign({className:"input__rows"},{children:[e.jsx("div",Object.assign({className:"input__wrapper"},{children:e.jsx(l.Input,{value:i===exports.DISCOUNT_PRODUCTS.ENTITLED?null===(c=D.discountData.entitledQuantity)||void 0===c?void 0:c.toString():null===(p=D.discountData.prerequisiteQuantity)||void 0===p?void 0:p.toString(),type:"number",onChangeText:e=>{i===exports.DISCOUNT_PRODUCTS.ENTITLED?D.setDiscountData(Object.assign(Object.assign({},D.discountData),{entitledQuantity:parseInt(e)})):D.setDiscountData(Object.assign(Object.assign({},D.discountData),{prerequisiteQuantity:parseInt(e)}))},labelText:"Add quantity",placeholder:"Add quantity"})})),e.jsx("div",{className:"input__wrapper"})]}))]}),e.jsxs("div",Object.assign({style:{display:"flex",gap:18}},{children:[!(null==v?void 0:v.length)&&e.jsx(s.Button,{buttonText:"Add product",buttonType:"tertiary",LeadingIcon:T.default,onClick:()=>{D.setIsProductPickerOpen(i)}}),!(null==x?void 0:x.length)&&e.jsx(s.Button,{buttonText:"Add collection",buttonType:"tertiary",LeadingIcon:T.default,onClick:()=>{D.setIsCollectionPickerOpen(i)}})]})),!!x.length&&e.jsxs("div",Object.assign({style:{margin:"8px 0"}},{children:[e.jsx(a.TitleSmall,{children:"Products"}),x.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=j},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:()=>{if(D.useNewPicker){const e=t.cloneDeep(E);Object.values(e).forEach((e=>{var t,i;(null===(t=null==e?void 0:e.products)||void 0===t?void 0:t[s.id])&&(null===(i=null==e?void 0:e.products)||void 0===i||delete i[s.id])})),i===exports.DISCOUNT_PRODUCTS.ENTITLED?D.setEntitledProducts(e):D.setPrerequisiteProducts(e)}else{const e=x.filter((e=>e.id!==s.id));i===exports.DISCOUNT_PRODUCTS.ENTITLED?D.setEntitledProducts(e):D.setPrerequisiteProducts(e)}}},{children:e.jsx(r.default,{width:14,color:o.DEFAULT_THEME.colorsV2.content.primary})}))}))]}),s.id)))]})),!!v.length&&e.jsxs("div",Object.assign({style:{margin:"8px 0"}},{children:[e.jsx(a.TitleSmall,{children:"Collections"}),v.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=j},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:()=>{if(D.useNewPicker){const e=t.cloneDeep(O);delete e[s.id],i===exports.DISCOUNT_PRODUCTS.ENTITLED?D.setEntitledCollections(e):D.setPrerequisiteCollections(e)}else{const e=v.filter((e=>e.id!==s.id));i===exports.DISCOUNT_PRODUCTS.ENTITLED?D.setEntitledCollections(e):D.setPrerequisiteCollections(e)}}},{children:e.jsx(r.default,{width:14,color:o.DEFAULT_THEME.colorsV2.content.primary})}))}))]}),s.id)))]}))]})};return e.jsxs(d.DynamicCouponContainer,{children:[D.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:"338px",placement:"bottom-start",onSelect:e=>{D.onChangeCouponType(e)}})})),e.jsx("div",Object.assign({className:"input__wrapper",style:{display:"flex",alignItems:"center",gap:8}},{children:(D.selectedCouponType===i.DISCOUNT_TYPES.AMOUNT_OFF_PRODUCTS||D.selectedCouponType===i.DISCOUNT_TYPES.AMOUNT_OFF_ORDER)&&e.jsxs(e.Fragment,{children:[e.jsx(c.RadioButton,{isActive:D.discountData.valueType===i.DISCOUNT_VALUE_TYPES.FIXED_AMOUNT,onValueChange:()=>{D.setDiscountData(Object.assign(Object.assign({},D.discountData),{valueType:i.DISCOUNT_VALUE_TYPES.FIXED_AMOUNT,value:void 0}))},label:"Fixed amount"}),e.jsx(c.RadioButton,{isActive:D.discountData.valueType===i.DISCOUNT_VALUE_TYPES.PERCENTAGE,onValueChange:()=>{D.setDiscountData(Object.assign(Object.assign({},D.discountData),{valueType:i.DISCOUNT_VALUE_TYPES.PERCENTAGE,value:void 0}))},label:"Percentage"})]})}))]})),D.selectedCouponType===i.DISCOUNT_TYPES.AMOUNT_OFF_ORDER&&(()=>{var t,s,n,a,o;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(l.Input,{value:D.discountData.title,onChangeText:e=>{D.setDiscountData(Object.assign(Object.assign({},D.discountData),{title:e.trim()}))},maxCharLimit:18,labelText:"Code title",placeholder:"eg: Flat 50% Off"})})),e.jsx("div",Object.assign({className:"input__wrapper"},{children:e.jsx(l.Input,{value:null!==(n=null===(s=null===(t=D.discountData)||void 0===t?void 0:t.value)||void 0===s?void 0:s.toString())&&void 0!==n?n:"",labelText:"Discount code value",type:"number",errorMessage:m(),onChangeText:e=>{D.setDiscountData(Object.assign(Object.assign({},D.discountData),{value:parseInt(e)}))},placeholder:D.discountData.valueType===i.DISCOUNT_VALUE_TYPES.FIXED_AMOUNT?"0.00":"Enter a value",prefixText:D.discountData.valueType===i.DISCOUNT_VALUE_TYPES.FIXED_AMOUNT?null!==(a=D.currency)&&void 0!==a?a:"₹":void 0,suffixText:D.discountData.valueType===i.DISCOUNT_VALUE_TYPES.PERCENTAGE?"%":void 0})}))]})),g(),!D.hideProbability&&e.jsxs("div",Object.assign({className:"input__rows"},{children:[e.jsx("div",Object.assign({className:"input__wrapper"},{children:e.jsx(l.Input,{type:"number",value:null===(o=D.discountData.probability)||void 0===o?void 0:o.toString(),onChangeText:e=>{D.setDiscountData(Object.assign(Object.assign({},D.discountData),{probability:e.startsWith(".")?parseFloat(parseFloat(`0${e}`).toFixed(2)):parseFloat(parseFloat(e).toFixed(2))}))},labelText:"Probability",placeholder:"Enter probability in decimals (0 - 1)"})})),e.jsx("div",{className:"input__wrapper"})]}))]})})(),D.selectedCouponType===i.DISCOUNT_TYPES.AMOUNT_OFF_PRODUCTS&&(()=>{var t,s,n,a,o;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(l.Input,{value:D.discountData.title,onChangeText:e=>{D.setDiscountData(Object.assign(Object.assign({},D.discountData),{title:e.trim()}))},maxCharLimit:18,labelText:"Code title",placeholder:"eg: Flat 50% Off"})})),e.jsx("div",Object.assign({className:"input__wrapper"},{children:e.jsx(l.Input,{value:null!==(n=null===(s=null===(t=D.discountData)||void 0===t?void 0:t.value)||void 0===s?void 0:s.toString())&&void 0!==n?n:"",labelText:"Discount code value",type:"number",errorMessage:m(),onChangeText:e=>{D.setDiscountData(Object.assign(Object.assign({},D.discountData),{value:parseInt(e)}))},placeholder:D.discountData.valueType===i.DISCOUNT_VALUE_TYPES.FIXED_AMOUNT?"0.00":"Enter a value",prefixText:D.discountData.valueType===i.DISCOUNT_VALUE_TYPES.FIXED_AMOUNT?null!==(a=D.currency)&&void 0!==a?a:"₹":void 0,suffixText:D.discountData.valueType===i.DISCOUNT_VALUE_TYPES.PERCENTAGE?"%":void 0})}))]})),b(exports.DISCOUNT_PRODUCTS.ENTITLED,!0),!D.hideProbability&&e.jsxs("div",Object.assign({className:"input__rows"},{children:[e.jsx("div",Object.assign({className:"input__wrapper"},{children:e.jsx(l.Input,{type:"number",value:null===(o=D.discountData.probability)||void 0===o?void 0:o.toString(),onChangeText:e=>{D.setDiscountData(Object.assign(Object.assign({},D.discountData),{probability:e.startsWith(".")?parseFloat(parseFloat(`0${e}`).toFixed(2)):parseFloat(parseFloat(e).toFixed(2))}))},labelText:"Probability",placeholder:"Enter probability in decimals (0 - 1)"})})),e.jsx("div",{className:"input__wrapper"})]}))]})})(),D.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(l.Input,{value:D.discountData.title,onChangeText:e=>{D.setDiscountData(Object.assign(Object.assign({},D.discountData),{title:e.trim()}))},labelText:"Code title",placeholder:"eg: Flat 50% Off",maxCharLimit:18})})),e.jsx("div",Object.assign({className:"input__wrapper"},{children:!D.hideProbability&&e.jsx(l.Input,{value:null===(t=D.discountData.probability)||void 0===t?void 0:t.toString(),type:"number",onChangeText:e=>{D.setDiscountData(Object.assign(Object.assign({},D.discountData),{probability:e.startsWith(".")?parseFloat(parseFloat(`0${e}`).toFixed(2)):parseFloat(parseFloat(e).toFixed(2))}))},labelText:"Probability",placeholder:"Enter probability in decimals (0 - 1)"})}))]})),g()]})})(),D.selectedCouponType===i.DISCOUNT_TYPES.BUY_X_GET_Y&&(()=>{var t,s,i,n;return e.jsxs(d.DynamicCouponContainer,{children:[e.jsx("div",Object.assign({className:"input__rows"},{children:e.jsxs("div",Object.assign({style:{display:"flex",gap:20,flex:1}},{children:[e.jsx("div",Object.assign({style:{flex:1}},{children:e.jsx(l.Input,{value:D.discountData.title,onChangeText:e=>{D.setDiscountData(Object.assign(Object.assign({},D.discountData),{title:e.trim()}))},maxCharLimit:18,labelText:"Code title",placeholder:"eg: Flat 50% Off"})})),!D.hideProbability&&e.jsx("div",Object.assign({style:{flex:1}},{children:e.jsx(l.Input,{value:null===(t=D.discountData.probability)||void 0===t?void 0:t.toString(),type:"number",onChangeText:e=>{D.setDiscountData(Object.assign(Object.assign({},D.discountData),{probability:e.startsWith(".")?parseFloat(parseFloat(`0${e}`).toFixed(2)):parseFloat(parseFloat(e).toFixed(2))}))},labelText:"Probability",placeholder:"Enter probability in decimals (0 - 1)"})}))]}))})),e.jsx(x,{}),b(exports.DISCOUNT_PRODUCTS.PREREQUISITE),e.jsx(x,{}),b(exports.DISCOUNT_PRODUCTS.ENTITLED),e.jsx(x,{}),e.jsx(a.TitleRegular,{children:"At a discount value"}),e.jsxs("div",Object.assign({style:{display:"flex",gap:18,alignItems:"flex-start"}},{children:[e.jsx(c.RadioButton,{label:"Percentage",isActive:100!==D.discountData.value,onValueChange:()=>{D.setDiscountData(Object.assign(Object.assign({},D.discountData),{value:void 0}))}}),100!==D.discountData.value&&e.jsx(l.Input,{variant:"small",value:null!==(n=null===(i=null===(s=D.discountData)||void 0===s?void 0:s.value)||void 0===i?void 0:i.toString())&&void 0!==n?n:"",onChangeText:e=>{D.setDiscountData(Object.assign(Object.assign({},D.discountData),{value:parseInt(e)}))},errorMessage:m(),type:"number",placeholder:"Enter percentage eg: 10%",suffixText:"%",width:"238px"})]})),e.jsx("div",{children:e.jsx(c.RadioButton,{label:"Free",isActive:100===D.discountData.value,onValueChange:e=>{e?D.setDiscountData(Object.assign(Object.assign({},D.discountData),{value:100})):D.setDiscountData(Object.assign(Object.assign({},D.discountData),{value:void 0}))}})})]})})(),D.selectedCouponType&&!D.hideExpiration&&e.jsxs(e.Fragment,{children:[e.jsx("div",{style:D.selectedCouponType!==i.DISCOUNT_TYPES.BUY_X_GET_Y&&D.selectedCouponType!==i.DISCOUNT_TYPES.AMOUNT_OFF_PRODUCTS||!D.hideProbability?{height:6,borderTop:`1px solid ${o.DEFAULT_THEME.colorsV2.stroke.primary}`,marginTop:12}:{}}),e.jsx(u.CouponExpiration,{discountData:D.discountData,setDiscountData:D.setDiscountData})]}),!D.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("lodash"),s=require("../../button/Button.js");require("react");var i=require("../type.js");require("../../dropdown/DropdownPopover/index.js");var n=require("../../dropdown/Dropdown.js");require("../../dropdown/ChipDropdown.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/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"),require("../../spinner/Spinner.js"),require("../../icon-button/IconButton.js"),require("../../shimmer/ShimmerComponent/ShimmerStyled.js"),require("../../product-picker-v2/emptyState.js"),require("../../product-picker-v2/style.js"),require("../../product-picker-v2/type.js");var d=require("../DiscountModal.styled.js"),u=require("../CouponExpiration/CouponExpiration.js"),c=require("../../radioButton/RadioButton.js"),p=require("../../../assets/icons/cursor.svg.js"),T=require("../../../assets/icons/plus.svg.js");const j="https://jkfenner.com/wp-content/uploads/2019/11/default.jpg";var D;function m(){return null}exports.DISCOUNT_PRODUCTS=void 0,(D=exports.DISCOUNT_PRODUCTS||(exports.DISCOUNT_PRODUCTS={})).ENTITLED="entitled",D.PREREQUISITE="prerequisite";exports.default=D=>{var v;const x=[{value:i.DISCOUNT_TYPES.AMOUNT_OFF_ORDER,label:"Amount off on order",selected:D.selectedCouponType===i.DISCOUNT_TYPES.AMOUNT_OFF_ORDER},{value:i.DISCOUNT_TYPES.AMOUNT_OFF_PRODUCTS,label:"Amount off on products",selected:D.selectedCouponType===i.DISCOUNT_TYPES.AMOUNT_OFF_PRODUCTS},{value:i.DISCOUNT_TYPES.BUY_X_GET_Y,label:"Buy X Get Y FREE",selected:D.selectedCouponType===i.DISCOUNT_TYPES.BUY_X_GET_Y},{value:i.DISCOUNT_TYPES.FREE_SHIPPING,label:"Free shipping",selected:D.selectedCouponType===i.DISCOUNT_TYPES.FREE_SHIPPING}],E=[{selected:D.selectedMinimumRequirement===i.MIN_PURCHASE_REQUIREMENT.NA,label:"No minimum requirements",value:i.MIN_PURCHASE_REQUIREMENT.NA},{selected:D.selectedMinimumRequirement===i.MIN_PURCHASE_REQUIREMENT.AMOUNT,label:`Minimum purchase amount (${null!==(v=D.currency)&&void 0!==v?v:"₹"})`,value:i.MIN_PURCHASE_REQUIREMENT.AMOUNT},{selected:D.selectedMinimumRequirement===i.MIN_PURCHASE_REQUIREMENT.QUANTITY,label:"Minimum quantity of items",value:i.MIN_PURCHASE_REQUIREMENT.QUANTITY}],O=()=>{var e,t,s,n,a;if(D.discountData.valueType===i.DISCOUNT_VALUE_TYPES.FIXED_AMOUNT){if((null===(e=D.discountData)||void 0===e?void 0:e.value)&&(null===(t=D.discountData)||void 0===t?void 0:t.value)<=0)return"Enter a valid input"}else if((null===(s=D.discountData)||void 0===s?void 0:s.value)&&((null===(n=D.discountData)||void 0===n?void 0:n.value)<=0||(null===(a=D.discountData)||void 0===a?void 0:a.value)>100))return"Enter a valid input"},g=()=>{var t,s,o,l,d;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:E,placement:"bottom-start",onSelect:e=>{const t=e.value;D.setSelectedMinimumRequirement(t),D.setDiscountData(Object.assign(Object.assign({},D.discountData),{minQuantity:void 0,minAmount:void 0}))}})]})),e.jsx("div",Object.assign({className:"input__wrapper"},{children:D.selectedMinimumRequirement!==i.MIN_PURCHASE_REQUIREMENT.NA&&e.jsx(r.Input,{value:D.selectedMinimumRequirement===i.MIN_PURCHASE_REQUIREMENT.AMOUNT?null!==(s=null===(t=D.discountData.minAmount)||void 0===t?void 0:t.toString())&&void 0!==s?s:"":null!==(l=null===(o=D.discountData.minQuantity)||void 0===o?void 0:o.toString())&&void 0!==l?l:"",onChangeText:e=>{D.selectedMinimumRequirement===i.MIN_PURCHASE_REQUIREMENT.AMOUNT?D.setDiscountData(Object.assign(Object.assign({},D.discountData),{minAmount:parseInt(e)})):D.selectedMinimumRequirement===i.MIN_PURCHASE_REQUIREMENT.QUANTITY&&D.setDiscountData(Object.assign(Object.assign({},D.discountData),{minQuantity:parseInt(e)}))},labelText:D.selectedMinimumRequirement===i.MIN_PURCHASE_REQUIREMENT.AMOUNT?"Minimum purchase amount":"Minimum purchase quantity",prefixText:D.selectedMinimumRequirement===i.MIN_PURCHASE_REQUIREMENT.AMOUNT?null!==(d=D.currency)&&void 0!==d?d:"₹":void 0,type:"number",placeholder:D.selectedMinimumRequirement===i.MIN_PURCHASE_REQUIREMENT.AMOUNT?"1000.00":"2"})}))]}))},b=(i,n)=>{var d,u,c,p;let m=[],v=[],x={},E={};return D.useNewPicker?(x=i===exports.DISCOUNT_PRODUCTS.ENTITLED?D.entitledProducts:D.prerequisiteProducts,E=null!==(d=i===exports.DISCOUNT_PRODUCTS.ENTITLED?D.entitledCollections:D.prerequisiteCollections)&&void 0!==d?d:[],(null==x?void 0:x.isCustom)&&delete x.isCustom,(null==E?void 0:E.isCustom)&&delete E.isCustom,Object.values(x).forEach((e=>{Object.keys(e.products).forEach((t=>{m.push({id:t,name:e.products[t].name,image:e.products[t].image})}))})),Object.keys(E).forEach((e=>{"isCustom"!==e&&v.push({id:e,name:E[e].name,image:E[e].image})}))):(m=i===exports.DISCOUNT_PRODUCTS.ENTITLED?D.entitledProducts:D.prerequisiteProducts,v=null!==(u=i===exports.DISCOUNT_PRODUCTS.ENTITLED?D.entitledCollections:D.prerequisiteCollections)&&void 0!==u?u:[]),e.jsxs(e.Fragment,{children:[!n&&e.jsxs(e.Fragment,{children:[e.jsx(a.TitleRegular,{children:i===exports.DISCOUNT_PRODUCTS.PREREQUISITE?"Customer buys":"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:i===exports.DISCOUNT_PRODUCTS.ENTITLED?null===(c=D.discountData.entitledQuantity)||void 0===c?void 0:c.toString():null===(p=D.discountData.prerequisiteQuantity)||void 0===p?void 0:p.toString(),type:"number",onChangeText:e=>{i===exports.DISCOUNT_PRODUCTS.ENTITLED?D.setDiscountData(Object.assign(Object.assign({},D.discountData),{entitledQuantity:parseInt(e)})):D.setDiscountData(Object.assign(Object.assign({},D.discountData),{prerequisiteQuantity:parseInt(e)}))},labelText:"Add quantity",placeholder:"Add quantity"})})),e.jsx("div",{className:"input__wrapper"})]}))]}),e.jsxs("div",Object.assign({style:{display:"flex",gap:18}},{children:[!(null==v?void 0:v.length)&&e.jsx(s.Button,{buttonText:"Add product",buttonType:"tertiary",LeadingIcon:T.default,onClick:()=>{D.setIsProductPickerOpen(i)}}),!(null==m?void 0:m.length)&&e.jsx(s.Button,{buttonText:"Add collection",buttonType:"tertiary",LeadingIcon:T.default,onClick:()=>{D.setIsCollectionPickerOpen(i)}})]})),!!m.length&&e.jsxs("div",Object.assign({style:{margin:"8px 0"}},{children:[e.jsx(a.TitleSmall,{children:"Products"}),m.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=j},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:()=>{if(D.useNewPicker){const e=t.cloneDeep(x);Object.values(e).forEach((e=>{var t,i;(null===(t=null==e?void 0:e.products)||void 0===t?void 0:t[s.id])&&(null===(i=null==e?void 0:e.products)||void 0===i||delete i[s.id])})),i===exports.DISCOUNT_PRODUCTS.ENTITLED?D.setEntitledProducts(e):D.setPrerequisiteProducts(e)}else{const e=m.filter((e=>e.id!==s.id));i===exports.DISCOUNT_PRODUCTS.ENTITLED?D.setEntitledProducts(e):D.setPrerequisiteProducts(e)}}},{children:e.jsx(l.default,{width:14,color:o.DEFAULT_THEME.colorsV2.content.primary})}))}))]}),s.id)))]})),!!v.length&&e.jsxs("div",Object.assign({style:{margin:"8px 0"}},{children:[e.jsx(a.TitleSmall,{children:"Collections"}),v.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=j},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:()=>{if(D.useNewPicker){const e=t.cloneDeep(E);delete e[s.id],i===exports.DISCOUNT_PRODUCTS.ENTITLED?D.setEntitledCollections(e):D.setPrerequisiteCollections(e)}else{const e=v.filter((e=>e.id!==s.id));i===exports.DISCOUNT_PRODUCTS.ENTITLED?D.setEntitledCollections(e):D.setPrerequisiteCollections(e)}}},{children:e.jsx(l.default,{width:14,color:o.DEFAULT_THEME.colorsV2.content.primary})}))}))]}),s.id)))]}))]})};return e.jsxs(d.DynamicCouponContainer,{children:[D.allowStaticCoupon&&e.jsxs("div",Object.assign({className:"input__rows"},{children:[e.jsx("div",Object.assign({className:"input__wrapper"},{children:e.jsx(n.Dropdown,{options:x,width:"338px",placement:"bottom-start",onSelect:e=>{D.onChangeCouponType(e)}})})),e.jsx("div",Object.assign({className:"input__wrapper",style:{display:"flex",alignItems:"center",gap:8}},{children:(D.selectedCouponType===i.DISCOUNT_TYPES.AMOUNT_OFF_PRODUCTS||D.selectedCouponType===i.DISCOUNT_TYPES.AMOUNT_OFF_ORDER)&&e.jsxs(e.Fragment,{children:[e.jsx(c.RadioButton,{isActive:D.discountData.valueType===i.DISCOUNT_VALUE_TYPES.FIXED_AMOUNT,onValueChange:()=>{D.setDiscountData(Object.assign(Object.assign({},D.discountData),{valueType:i.DISCOUNT_VALUE_TYPES.FIXED_AMOUNT,value:void 0}))},label:"Fixed amount"}),e.jsx(c.RadioButton,{isActive:D.discountData.valueType===i.DISCOUNT_VALUE_TYPES.PERCENTAGE,onValueChange:()=>{D.setDiscountData(Object.assign(Object.assign({},D.discountData),{valueType:i.DISCOUNT_VALUE_TYPES.PERCENTAGE,value:void 0}))},label:"Percentage"})]})}))]})),D.selectedCouponType===i.DISCOUNT_TYPES.AMOUNT_OFF_ORDER&&(()=>{var t,s,n,a,o;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:D.discountData.title,onChangeText:e=>{D.setDiscountData(Object.assign(Object.assign({},D.discountData),{title:e.trim()}))},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!==(n=null===(s=null===(t=D.discountData)||void 0===t?void 0:t.value)||void 0===s?void 0:s.toString())&&void 0!==n?n:"",labelText:"Discount code value",type:"number",errorMessage:O(),onChangeText:e=>{D.setDiscountData(Object.assign(Object.assign({},D.discountData),{value:parseInt(e)}))},placeholder:D.discountData.valueType===i.DISCOUNT_VALUE_TYPES.FIXED_AMOUNT?"0.00":"Enter a value",prefixText:D.discountData.valueType===i.DISCOUNT_VALUE_TYPES.FIXED_AMOUNT?null!==(a=D.currency)&&void 0!==a?a:"₹":void 0,suffixText:D.discountData.valueType===i.DISCOUNT_VALUE_TYPES.PERCENTAGE?"%":void 0})}))]})),g(),!D.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===(o=D.discountData.probability)||void 0===o?void 0:o.toString(),onChangeText:e=>{D.setDiscountData(Object.assign(Object.assign({},D.discountData),{probability:e.startsWith(".")?parseFloat(parseFloat(`0${e}`).toFixed(2)):parseFloat(parseFloat(e).toFixed(2))}))},labelText:"Probability",placeholder:"Enter probability in decimals (0 - 1)"})})),e.jsx("div",{className:"input__wrapper"})]}))]})})(),D.selectedCouponType===i.DISCOUNT_TYPES.AMOUNT_OFF_PRODUCTS&&(()=>{var t,s,n,a,o;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:D.discountData.title,onChangeText:e=>{D.setDiscountData(Object.assign(Object.assign({},D.discountData),{title:e.trim()}))},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!==(n=null===(s=null===(t=D.discountData)||void 0===t?void 0:t.value)||void 0===s?void 0:s.toString())&&void 0!==n?n:"",labelText:"Discount code value",type:"number",errorMessage:O(),onChangeText:e=>{D.setDiscountData(Object.assign(Object.assign({},D.discountData),{value:parseInt(e)}))},placeholder:D.discountData.valueType===i.DISCOUNT_VALUE_TYPES.FIXED_AMOUNT?"0.00":"Enter a value",prefixText:D.discountData.valueType===i.DISCOUNT_VALUE_TYPES.FIXED_AMOUNT?null!==(a=D.currency)&&void 0!==a?a:"₹":void 0,suffixText:D.discountData.valueType===i.DISCOUNT_VALUE_TYPES.PERCENTAGE?"%":void 0})}))]})),b(exports.DISCOUNT_PRODUCTS.ENTITLED,!0),!D.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===(o=D.discountData.probability)||void 0===o?void 0:o.toString(),onChangeText:e=>{D.setDiscountData(Object.assign(Object.assign({},D.discountData),{probability:e.startsWith(".")?parseFloat(parseFloat(`0${e}`).toFixed(2)):parseFloat(parseFloat(e).toFixed(2))}))},labelText:"Probability",placeholder:"Enter probability in decimals (0 - 1)"})})),e.jsx("div",{className:"input__wrapper"})]}))]})})(),D.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:D.discountData.title,onChangeText:e=>{D.setDiscountData(Object.assign(Object.assign({},D.discountData),{title:e.trim()}))},labelText:"Code title",placeholder:"eg: Flat 50% Off",maxCharLimit:18})})),e.jsx("div",Object.assign({className:"input__wrapper"},{children:!D.hideProbability&&e.jsx(r.Input,{value:null===(t=D.discountData.probability)||void 0===t?void 0:t.toString(),type:"number",onChangeText:e=>{D.setDiscountData(Object.assign(Object.assign({},D.discountData),{probability:e.startsWith(".")?parseFloat(parseFloat(`0${e}`).toFixed(2)):parseFloat(parseFloat(e).toFixed(2))}))},labelText:"Probability",placeholder:"Enter probability in decimals (0 - 1)"})}))]})),g()]})})(),D.selectedCouponType===i.DISCOUNT_TYPES.BUY_X_GET_Y&&(()=>{var t,s,i,n;return e.jsxs(d.DynamicCouponContainer,{children:[e.jsx("div",Object.assign({className:"input__rows"},{children:e.jsxs("div",Object.assign({style:{display:"flex",gap:20,flex:1}},{children:[e.jsx("div",Object.assign({style:{flex:1}},{children:e.jsx(r.Input,{value:D.discountData.title,onChangeText:e=>{D.setDiscountData(Object.assign(Object.assign({},D.discountData),{title:e.trim()}))},maxCharLimit:18,labelText:"Code title",placeholder:"eg: Flat 50% Off"})})),!D.hideProbability&&e.jsx("div",Object.assign({style:{flex:1}},{children:e.jsx(r.Input,{value:null===(t=D.discountData.probability)||void 0===t?void 0:t.toString(),type:"number",onChangeText:e=>{D.setDiscountData(Object.assign(Object.assign({},D.discountData),{probability:e.startsWith(".")?parseFloat(parseFloat(`0${e}`).toFixed(2)):parseFloat(parseFloat(e).toFixed(2))}))},labelText:"Probability",placeholder:"Enter probability in decimals (0 - 1)"})}))]}))})),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:"flex-start"}},{children:[e.jsx(c.RadioButton,{label:"Percentage",isActive:100!==D.discountData.value,onValueChange:()=>{D.setDiscountData(Object.assign(Object.assign({},D.discountData),{value:void 0}))}}),100!==D.discountData.value&&e.jsx(r.Input,{variant:"small",value:null!==(n=null===(i=null===(s=D.discountData)||void 0===s?void 0:s.value)||void 0===i?void 0:i.toString())&&void 0!==n?n:"",onChangeText:e=>{D.setDiscountData(Object.assign(Object.assign({},D.discountData),{value:parseInt(e)}))},errorMessage:O(),type:"number",placeholder:"Enter percentage eg: 10%",suffixText:"%",width:"238px"})]})),e.jsx("div",{children:e.jsx(c.RadioButton,{label:"Free",isActive:100===D.discountData.value,onValueChange:e=>{e?D.setDiscountData(Object.assign(Object.assign({},D.discountData),{value:100})):D.setDiscountData(Object.assign(Object.assign({},D.discountData),{value:void 0}))}})})]})})(),D.selectedCouponType&&!D.hideExpiration&&e.jsxs(e.Fragment,{children:[e.jsx("div",{style:D.selectedCouponType!==i.DISCOUNT_TYPES.BUY_X_GET_Y&&D.selectedCouponType!==i.DISCOUNT_TYPES.AMOUNT_OFF_PRODUCTS||!D.hideProbability?{height:6,borderTop:`1px solid ${o.DEFAULT_THEME.colorsV2.stroke.primary}`,marginTop:12}:{}}),e.jsx(u.CouponExpiration,{discountData:D.discountData,setDiscountData:D.setDiscountData})]}),!D.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,6 +1,5 @@
|
|
|
1
|
-
import { Product, ProductVariant
|
|
1
|
+
import { Product, ProductVariant } from '../modal';
|
|
2
2
|
import { OUT_OF_STOCK_ACTION } from '../type';
|
|
3
|
-
import { ProductVariantForRearrange } from '../variant';
|
|
4
3
|
export declare class ProductHelper {
|
|
5
4
|
/**
|
|
6
5
|
* how to know if a product is out of stock? currentCombination.quantity === 0 (OOS)
|
|
@@ -32,14 +31,3 @@ export declare class ProductHelper {
|
|
|
32
31
|
*/
|
|
33
32
|
static getProductLabels(productVariant: Product | ProductVariant, outOfStockAction?: OUT_OF_STOCK_ACTION): string | null;
|
|
34
33
|
}
|
|
35
|
-
/**
|
|
36
|
-
* Loops through each collection, each product, each variant.
|
|
37
|
-
* For each variant, adds a displayOrder if not already there.
|
|
38
|
-
* For each variant, additional parameters are added from ProductVariantForRearrange
|
|
39
|
-
* in order to display the variant card.
|
|
40
|
-
* After converting to array, sorts the array based on displayOrder and returns.
|
|
41
|
-
*
|
|
42
|
-
* @param selectedCollections - Collections in object format
|
|
43
|
-
* @returns Selected Varaints in array format, sorted based on displayOrder.
|
|
44
|
-
*/
|
|
45
|
-
export declare const parseSelectedVariantsToArray: (selectedCollections: SelectedItems) => ProductVariantForRearrange[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var n=require("../type.js");const t={NORMAL:null,NOT_SYNCED:"Hidden",OUT_OF_STOCK:"Out of Stock"};exports.ProductHelper=class{static getProductLabels(i){let u=arguments.length>1&&void 0!==arguments[1]?arguments[1]:n.OUT_OF_STOCK_ACTION.NORMAL,l="NORMAL";if(i.variants)return t[l];const O=i;return u===n.OUT_OF_STOCK_ACTION.HIDE&&(!O.skipSync||0!==(null==O?void 0:O.quantity)&&-2!==(null==O?void 0:O.quantity)||(l="NOT_SYNCED"),O.skipSync&&0!==(null==O?void 0:O.quantity)&&-2!==(null==O?void 0:O.quantity)&&(l="NOT_SYNCED"),O.skipSync||0!==(null==O?void 0:O.quantity)&&-2!==(null==O?void 0:O.quantity)||(l="NOT_SYNCED"),O.skipSync||0===(null==O?void 0:O.quantity)||-2===(null==O?void 0:O.quantity)||(l="NORMAL")),u===n.OUT_OF_STOCK_ACTION.BLUR&&(!O.skipSync||0!==(null==O?void 0:O.quantity)&&-2!==(null==O?void 0:O.quantity)||(l="NOT_SYNCED"),O.skipSync&&0!==(null==O?void 0:O.quantity)&&-2!==(null==O?void 0:O.quantity)&&(l="NOT_SYNCED"),O.skipSync||0!==(null==O?void 0:O.quantity)&&-2!==(null==O?void 0:O.quantity)||(l="OUT_OF_STOCK"),O.skipSync||0===(null==O?void 0:O.quantity)||-2===(null==O?void 0:O.quantity)||(l="NORMAL")),u===n.OUT_OF_STOCK_ACTION.NORMAL&&(!O.skipSync||0!==(null==O?void 0:O.quantity)&&-2!==(null==O?void 0:O.quantity)||(l="NOT_SYNCED"),O.skipSync&&0!==(null==O?void 0:O.quantity)&&-2!==(null==O?void 0:O.quantity)&&(l="NOT_SYNCED"),O.skipSync||0!==(null==O?void 0:O.quantity)&&-2!==(null==O?void 0:O.quantity)||(l="NORMAL"),O.skipSync||0===(null==O?void 0:O.quantity)||-2===(null==O?void 0:O.quantity)||(l="NORMAL")),t[l]}};
|
|
@@ -6,7 +6,6 @@ export interface ProductVariant {
|
|
|
6
6
|
image: string;
|
|
7
7
|
quantity: number;
|
|
8
8
|
skipSync?: boolean;
|
|
9
|
-
displayOrder?: number | null;
|
|
10
9
|
}
|
|
11
10
|
export interface Product {
|
|
12
11
|
name: string;
|
|
@@ -38,14 +37,7 @@ export type CollectionFetcherReturn = Promise<{
|
|
|
38
37
|
export type ProductFetcherReturn = Promise<{
|
|
39
38
|
[key: string]: Product;
|
|
40
39
|
}>;
|
|
41
|
-
export
|
|
42
|
-
Collections = "collections",
|
|
43
|
-
RearrangeProducts = "rearrange",
|
|
44
|
-
SelectedProducts = "view",
|
|
45
|
-
SearchProducts = "searchProducts",
|
|
46
|
-
Products = "products"
|
|
47
|
-
}
|
|
48
|
-
export type ProductPickerInterface = {
|
|
40
|
+
export interface ProductPickerInterface {
|
|
49
41
|
hideGlobalSearch?: boolean;
|
|
50
42
|
hideInCollectionSearch?: boolean;
|
|
51
43
|
customCollectionRestriction?: boolean;
|
|
@@ -69,11 +61,5 @@ export type ProductPickerInterface = {
|
|
|
69
61
|
title?: string;
|
|
70
62
|
postHeader?: React.ReactNode;
|
|
71
63
|
width?: string;
|
|
72
|
-
|
|
73
|
-
} & ({
|
|
74
|
-
startupScreen: ScreenName.RearrangeProducts;
|
|
75
|
-
rearrangeEnabled: true;
|
|
76
|
-
} | {
|
|
77
|
-
startupScreen?: Exclude<ScreenName, ScreenName.RearrangeProducts>;
|
|
78
|
-
});
|
|
64
|
+
}
|
|
79
65
|
export declare const ProductPickerModal: (props: ProductPickerInterface) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("../../assets/icons/search.svg.js"),o=require("react"),c=require("../../constants/Theme.js"),s=require("../button/Button.js"),r=require("../input/Input.js"),l=require("../modals/styledModal.js"),i=require("../spinner/Spinner.js"),n=require("../tag/Tag.js"),d=require("./collectionScreen.js"),a=require("./productScreen.js"),u=require("./reducers.js"),h=require("./searchScreen.js"),p=require("./selectedScreen.js"),C=require("./style.js"),j=require("./type.js");exports.ProductPickerModal=S=>{const{storeId:x,selectedItems:g,onClose:b,visible:v,zIndex:y,limit:m,hideCollectionCheckbox:f,hideProductCheckbox:O,outOfStockAction:P=j.OUT_OF_STOCK_ACTION.BLUR,hideVariantCheckbox:I,selectProductsFromCustomCollection:k,hideSelectionCount:q,title:T,width:F}=S,[E,R]=o.useReducer(u.collectionsReducer,{}),[D,w]=o.useState("collections"),[B,A]=o.useState(""),[L,_]=o.useState(0),[M,z]=o.useState(!1),[G,H]=o.useState(0),[$,K]=o.useState(""),[U,V]=o.useState(!1),[N,Y]=o.useState(!1),[J,Q]=o.useState(),[W,X]=o.useReducer(u.selectedColectionsReducer,Object.keys(g).length>0?g:{});o.useEffect((()=>{z(!0),Y(!0),S.collectionFetcher(L,x).then((e=>{R({type:"fetched",data:(null==e?void 0:e.collections)||{}}),z(!1),_((e=>e+1)),Y(!1)})).catch()}),[]),o.useEffect((()=>{let e=0;Object.keys(W||[]).forEach((t=>{var o;Object.keys((null===(o=W[t])||void 0===o?void 0:o.products)||[]).forEach((o=>{var c,s;Object.keys((null===(s=null===(c=W[t].products)||void 0===c?void 0:c[o])||void 0===s?void 0:s.variants)||[]).forEach((()=>{e+=1}))}))})),H(e)})),o.useEffect((()=>{var e;B&&!(null===(e=null==E?void 0:E[B])||void 0===e?void 0:e.products)&&(z(!0),S.productFetcher(B,x).then((e=>{Object.keys(e).length&&R({type:"productsFetched",data:{collectionId:B,products:e}}),z(!1)})).catch())}),[B]),o.useEffect((()=>{const e=setTimeout((()=>{$.length?(V(!0),S.searchFetcher(x,$).then((e=>{Q(Object.assign({},e)),w("searchProducts"),z(!1),V(!1)}))):w("collections")}),800);return()=>clearTimeout(e)}),[$]);const Z=()=>{X({type:"reset",data:{}})};return e.jsx(l.StyledModal,Object.assign({zIndex:y,open:v,onClose:()=>{b(),Z()},headingTitle:T||("collections"===D||"products"===D?"Select Products":"view"===D?"Selected Products":"searchProducts"===D?"Searched Products":void 0),footerShadow:!0,centralContainerStyles:{width:F||"480px"},primaryButton:{buttonText:M?"Loading...":"Add",disabled:M||G<1||m&&G>m||!1,onClick:()=>{S.onAdd(W,G),Z()}},footerLeftCustomElement:q?e.jsx(e.Fragment,{}):m&&G>m?e.jsx(n.Tag,{tagText:`You can only select ${m} products`,type:"negative"}):G>0?e.jsx(s.Button,{onClick:()=>{w("view")},buttonText:`${G} products selected`,buttonType:"tertiaryGray"}):e.jsx(s.Button,{disabled:!0,buttonText:`${G} products selected`,buttonType:"tertiaryGray"})},{children:e.jsxs(C.ContainerStyle,{children:[S.postHeader&&e.jsx("div",Object.assign({style:{padding:"0 24px"}},{children:S.postHeader})),!S.hideGlobalSearch&&e.jsx(e.Fragment,{children:("collections"===D||"searchProducts"===D)&&e.jsx("div",Object.assign({style:{padding:"12px 24px",borderBottom:"1px solid #E0E0E0"}},{children:e.jsx(r.Input,{noKeyDownChange:!0,noErrorHint:!0,rightIcon:{icon:()=>U?e.jsx(i.Spinner,{size:"small",color:c.COLORS.content.primary}):e.jsx(t.default,{})},id:"listInput",height:"24px",type:"text",value:$,onChangeText:e=>{e.length&&e.trim().length?K(e):K("")}})}))}),e.jsxs(C.ScrollContainerStyle,{children:["collections"===D&&e.jsx(d.CollectionsScreen,{customCollectionRestriction:S.customCollectionRestriction,dataLoading:N,collections:E,selectedCollectionsDispatch:X,setCollectionId:A,setScreen:w,selectedCollections:W,collectionFetcher:S.collectionFetcher,storeId:x,collectionsDispatch:R,setSaveDisabled:z,pagingControls:{curPage:L,setCurPage:_},hideCollectionCheckbox:f}),"products"===D&&B&&e.jsx(u.CollectionIdContext.Provider,Object.assign({value:B},{children:e.jsx(a.ProductsScreen,{hideInCollectionSearch:S.hideInCollectionSearch,customCollectionRestriction:S.customCollectionRestriction,productFetcher:S.productFetcher,setScreen:w,storeId:x,data:E[B],collectionsDispatch:R,selectedCollectionsDispatch:X,selectedData:W,setSaveDisabled:z,searchInCollectionFetcher:S.searchInCollectionFetcher,hideProductCheckbox:O,outOfStockAction:P,hideVariantCheckbox:I,selectProductsFromCustomCollection:k})})),"view"===D&&e.jsx(p.SelectedScreen,{selectedCollections:W||{},selectedCollectionsDispatch:X,setScreen:w,collections:E}),"searchProducts"===D&&e.jsx(h.SearchScreen,{customCollectionRestriction:S.customCollectionRestriction,selectedCollections:W||{},searchedCollections:J||{},selectedCollectionsDispatch:X,setScreen:w,collections:E,onBackPress:()=>{K(""),Q({})}})]})]})}))};
|
|
@@ -12,6 +12,3 @@ export declare const ProductCardStyle: import("styled-components").StyledCompone
|
|
|
12
12
|
}, never>;
|
|
13
13
|
export declare const SelectedScreenHeader: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
14
14
|
export declare const CollectionNameHolder: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
15
|
-
export declare const VariantCardListStyle: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
16
|
-
export declare const VariantCardGridStyle: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
17
|
-
export declare const StyledHeaderRightIcon: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("styled-components"),t=require("../../constants/Theme.js");function
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("styled-components"),t=require("../../constants/Theme.js");function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var i=o(e);const l=i.default.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
background-color: white;
|
|
4
4
|
max-height: 600px;
|
|
5
5
|
min-height: 600px;
|
|
6
6
|
flex-direction: column;
|
|
7
|
-
`,r=
|
|
7
|
+
`,r=i.default.div`
|
|
8
8
|
overflow-y: scroll;
|
|
9
9
|
overflow-x: hidden;
|
|
10
|
-
`,
|
|
10
|
+
`,n=i.default.div`
|
|
11
11
|
height: 64px;
|
|
12
12
|
background-color: ${e=>e.isDisabled?"#F0F0F0":"white"};
|
|
13
13
|
border-bottom: 1px solid #e0e0e0;
|
|
@@ -17,17 +17,17 @@
|
|
|
17
17
|
column-gap: 16px;
|
|
18
18
|
justify-content: space-between;
|
|
19
19
|
align-items: center;
|
|
20
|
-
`,
|
|
20
|
+
`,d=i.default.div`
|
|
21
21
|
display: flex;
|
|
22
22
|
flex-direction: row;
|
|
23
23
|
justify-content: center;
|
|
24
24
|
align-items: center;
|
|
25
25
|
column-gap: 18px;
|
|
26
|
-
`,a=
|
|
26
|
+
`,a=i.default.div`
|
|
27
27
|
display: flex;
|
|
28
28
|
flex-direction: column;
|
|
29
29
|
justify-content: center;
|
|
30
|
-
`,
|
|
30
|
+
`,c=i.default.div`
|
|
31
31
|
display: flex;
|
|
32
32
|
flex-direction: row;
|
|
33
33
|
max-height: 32px;
|
|
@@ -37,14 +37,14 @@
|
|
|
37
37
|
align-items: center;
|
|
38
38
|
padding: 8px 16px;
|
|
39
39
|
margin-top: 16px;
|
|
40
|
-
`,x=
|
|
40
|
+
`,x=i.default.div`
|
|
41
41
|
display: flex;
|
|
42
42
|
flex-direction: row;
|
|
43
43
|
column-gap: 16px;
|
|
44
44
|
padding: 12px 16px;
|
|
45
45
|
border-bottom: 1px solid #e0e0e0;
|
|
46
46
|
align-items: center;
|
|
47
|
-
`,
|
|
47
|
+
`,p=i.default.div`
|
|
48
48
|
height: 64px;
|
|
49
49
|
background-color: white;
|
|
50
50
|
border-bottom: 1px solid #e0e0e0;
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
justify-content: flex-start;
|
|
56
56
|
align-items: center;
|
|
57
57
|
padding-left: ${e=>e.isVariant?"42px":"16px"};
|
|
58
|
-
`,s=
|
|
58
|
+
`,s=i.default.div`
|
|
59
59
|
display: flex;
|
|
60
60
|
flex-direction: row;
|
|
61
61
|
max-height: 32px;
|
|
@@ -64,39 +64,7 @@
|
|
|
64
64
|
justify-content: flex-start;
|
|
65
65
|
align-items: center;
|
|
66
66
|
padding: 8px 16px;
|
|
67
|
-
`,f=
|
|
67
|
+
`,f=i.default.div`
|
|
68
68
|
display: flex;
|
|
69
69
|
flex-direction: column;
|
|
70
|
-
|
|
71
|
-
height: 72px;
|
|
72
|
-
background: white;
|
|
73
|
-
padding: 12px 16px;
|
|
74
|
-
display: flex;
|
|
75
|
-
flex-direction: row;
|
|
76
|
-
gap: 16px;
|
|
77
|
-
align-items: center;
|
|
78
|
-
justify-content: center;
|
|
79
|
-
|
|
80
|
-
.tooltip-title-tag {
|
|
81
|
-
display: flex;
|
|
82
|
-
flex: 1;
|
|
83
|
-
flex-direction: column;
|
|
84
|
-
gap: 2px;
|
|
85
|
-
}
|
|
86
|
-
`,g=l.default.div`
|
|
87
|
-
height: 72px;
|
|
88
|
-
width: 72px;
|
|
89
|
-
display: flex;
|
|
90
|
-
align-items: center;
|
|
91
|
-
justify-content: center;
|
|
92
|
-
margin: 16px;
|
|
93
|
-
`;l.default.div`
|
|
94
|
-
display: flex;
|
|
95
|
-
width: 32px;
|
|
96
|
-
height: 32px;
|
|
97
|
-
padding: 6px;
|
|
98
|
-
justify-content: center;
|
|
99
|
-
align-items: center;
|
|
100
|
-
border: 1px solid ${t.COLORS.stroke.primary};
|
|
101
|
-
border-radius: 4px;
|
|
102
|
-
`,exports.CollectionCardDetailStyle=a,exports.CollectionCardInfoStyle=n,exports.CollectionCardStyle=d,exports.CollectionNameHolder=f,exports.ContainerStyle=o,exports.ProductCardStyle=c,exports.ProductScreenCollectionCardStyle=x,exports.ProductScreenHeader=p,exports.ScrollContainerStyle=r,exports.SelectedScreenHeader=s,exports.VariantCardGridStyle=g,exports.VariantCardListStyle=u;
|
|
70
|
+
`;exports.CollectionCardDetailStyle=a,exports.CollectionCardInfoStyle=d,exports.CollectionCardStyle=n,exports.CollectionNameHolder=f,exports.ContainerStyle=l,exports.ProductCardStyle=p,exports.ProductScreenCollectionCardStyle=x,exports.ProductScreenHeader=c,exports.ScrollContainerStyle=r,exports.SelectedScreenHeader=s;
|
|
@@ -36,6 +36,11 @@ export declare const BASE_COLORS: {
|
|
|
36
36
|
100: string;
|
|
37
37
|
50: string;
|
|
38
38
|
};
|
|
39
|
+
bikAi: {
|
|
40
|
+
500: string;
|
|
41
|
+
100: string;
|
|
42
|
+
50: string;
|
|
43
|
+
};
|
|
39
44
|
};
|
|
40
45
|
export declare const COLORS: {
|
|
41
46
|
background: {
|
|
@@ -73,6 +78,8 @@ export declare const COLORS: {
|
|
|
73
78
|
subdued: string;
|
|
74
79
|
hovered: string;
|
|
75
80
|
grey: string;
|
|
81
|
+
ai: string;
|
|
82
|
+
aiLight: string;
|
|
76
83
|
};
|
|
77
84
|
content: {
|
|
78
85
|
primary: string;
|
|
@@ -86,6 +93,7 @@ export declare const COLORS: {
|
|
|
86
93
|
warning: string;
|
|
87
94
|
positive: string;
|
|
88
95
|
blue: string;
|
|
96
|
+
ai: string;
|
|
89
97
|
};
|
|
90
98
|
stroke: {
|
|
91
99
|
primary: string;
|
|
@@ -106,6 +114,10 @@ export declare const COLORS: {
|
|
|
106
114
|
blue: {
|
|
107
115
|
lightAlt: string;
|
|
108
116
|
};
|
|
117
|
+
ai: {
|
|
118
|
+
lightAlt: string;
|
|
119
|
+
vibrant: string;
|
|
120
|
+
};
|
|
109
121
|
};
|
|
110
122
|
special: {
|
|
111
123
|
whatsapp: {
|
|
@@ -355,6 +367,8 @@ export declare const DEFAULT_THEME: {
|
|
|
355
367
|
subdued: string;
|
|
356
368
|
hovered: string;
|
|
357
369
|
grey: string;
|
|
370
|
+
ai: string;
|
|
371
|
+
aiLight: string;
|
|
358
372
|
};
|
|
359
373
|
content: {
|
|
360
374
|
primary: string;
|
|
@@ -368,6 +382,7 @@ export declare const DEFAULT_THEME: {
|
|
|
368
382
|
warning: string;
|
|
369
383
|
positive: string;
|
|
370
384
|
blue: string;
|
|
385
|
+
ai: string;
|
|
371
386
|
};
|
|
372
387
|
stroke: {
|
|
373
388
|
primary: string;
|
|
@@ -388,6 +403,10 @@ export declare const DEFAULT_THEME: {
|
|
|
388
403
|
blue: {
|
|
389
404
|
lightAlt: string;
|
|
390
405
|
};
|
|
406
|
+
ai: {
|
|
407
|
+
lightAlt: string;
|
|
408
|
+
vibrant: string;
|
|
409
|
+
};
|
|
391
410
|
};
|
|
392
411
|
special: {
|
|
393
412
|
whatsapp: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const e={brand:{900:"#28034E",800:"#4B1583",500:"#731DCF",50:"#EFE6F9",10:"#F9F3FF"},grayscale:{900:"#212121",700:"#616161",500:"#9E9E9E",400:"#BDBDBD",200:"#E0E0E0",100:"#F0F0F0",70:"#F7F7F7",50:"#FAFAFA",white:"#FFFFFF",alpha:"#00000088"},negative:{900:"#B92321",700:"#D53434",100:"#FFCED4",50:"#FFEBEF"},warning:{900:"#99631B",500:"#FEC02D",100:"#FFEABE",50:"#FFF7E5"},positive:{900:"#00580E",700:"#1A872C",100:"#C3E4C4",50:"#E6F4E7"}},t={background:{inactive:e.grayscale[200],base:e.grayscale[100],inverse:e.brand[900],inverseLight:e.brand[800],brand:e.brand[500],brandLight:e.brand[50],brandVeryLight:e.brand[10],negative:{vibrant:e.negative[700],light:e.negative[50]},warning:{vibrant:e.warning[500],light:e.warning[50]},positive:{vibrant:e.positive[700],light:e.positive[50]},blue:{light:"#E5F2FF"}},icon:{placeholder:"#9E9E9E"},scrim:{standard:"#00000099"},surface:{standard:e.grayscale.white,subdued:e.grayscale[50],hovered:e.grayscale[100],grey:e.grayscale[70]},content:{primary:e.grayscale[900],secondary:e.grayscale[700],placeholder:e.grayscale[500],inactive:e.grayscale[400],brand:e.brand[500],primaryInverse:e.grayscale.white,secondaryInverse:"#ffffffcc",negative:e.negative[900],warning:e.warning[900],positive:e.positive[900],blue:"#28458F"},stroke:{primary:e.grayscale[200],brand:e.brand[500],negative:{lightAlt:e.negative[100],vibrant:e.negative[700]},warning:{lightAlt:e.warning[100],vibrant:e.warning[500]},positive:{lightAlt:e.positive[100],vibrant:e.positive[700]},brandLightAlt:"#DDCCF0",blue:{lightAlt:"#C3D5E5"}},special:{whatsapp:{brand:"#25D366",gradient:"linear-gradient(360deg, #20B038 0%, #60D66A 100%)",dark:"#455A64",gradientArr:["#20B038","#60D66A"]},brand:{google:"#DD4B39",facebook:"#1877F2"}},text:{primary:e.grayscale[900],secondary:e.grayscale[700],placeholder:e.grayscale[500],disabled:e.grayscale[400],white:e.grayscale.white,brand:e.brand[500],altPrimary:e.brand[900],altSecondary:e.brand[800]}},i={display:{fontWeight:"400",fontSize:32,lineHeight:40,letterSpacing:0},titleXLarge:{fontWeight:"600",fontSize:32,lineHeight:40,letterSpacing:0},titleLarge:{fontWeight:"600",fontSize:28,lineHeight:40,letterSpacing:0},titleMedium:{fontWeight:"600",fontSize:20,lineHeight:28,letterSpacing:0},titleRegular:{fontWeight:"600",fontSize:16,lineHeight:24,letterSpacing:0},titleSmall:{fontWeight:"600",fontSize:14,lineHeight:20,letterSpacing:0},bodyPrimary:{fontWeight:"400",fontSize:16,lineHeight:24,letterSpacing:0},bodyLarge:{fontWeight:"400",fontSize:20,lineHeight:28,letterSpacing:0},bodySecondary:{fontWeight:"400",fontSize:14,lineHeight:20,letterSpacing:0},caption:{fontWeight:"400",fontSize:12,lineHeight:16,letterSpacing:0},tiny:{fontWeight:"400",fontSize:10,lineHeight:12,letterSpacing:0},subHeading:{fontWeight:"600",fontSize:10,lineHeight:12,letterSpacing:0},title1:{fontWeight:"600",fontSize:24,lineHeight:32,letterSpacing:0},title1Mobile:{fontWeight:"600",fontSize:20,lineHeight:30,letterSpacing:0},title2:{fontWeight:"600",fontSize:20,lineHeight:28,letterSpacing:0},title2Mobile:{fontWeight:"600",fontSize:18,lineHeight:24,letterSpacing:0},title3:{fontWeight:"600",fontSize:16,lineHeight:24,letterSpacing:0},title3Mobile:{fontWeight:"500",fontSize:14,lineHeight:20,letterSpacing:0},title4:{fontWeight:"400",fontSize:14,lineHeight:20,letterSpacing:0},textPlaceholder:{fontWeight:"400",fontSize:12,lineHeight:16,letterSpacing:0},title4Mobile:{fontWeight:"400",fontSize:10,lineHeight:16,letterSpacing:0},bodyRegularMobile:{fontWeight:"400",fontSize:14,lineHeight:18,letterSpacing:0},bodyRegular:{fontWeight:"400",fontSize:16,lineHeight:24,letterSpacing:0},bodySmall:{fontWeight:"400",fontSize:10,lineHeight:12,letterSpacing:0},buttonLarge:{fontWeight:"600",fontSize:16,lineHeight:20,letterSpacing:0},buttonRegular:{fontWeight:"600",fontSize:14,lineHeight:20,letterSpacing:0},captionMobile:{fontWeight:"500",fontSize:10,lineHeight:12,letterSpacing:0},captionBold:{fontWeight:"700",fontSize:12,lineHeight:16,letterSpacing:0},text1Bold:{fontWeight:"700",fontSize:10,lineHeight:14,letterSpacing:0},toast:{fontWeight:"400",fontSize:16,lineHeight:24,letterSpacing:0},toastMobile:{fontWeight:"400",fontSize:10,lineHeight:12,letterSpacing:0}},n={colorsV2:t,fonts:i};exports.BASE_COLORS=e,exports.COLORS=t,exports.DEFAULT_THEME=n,exports.FONTS=i;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const e={brand:{900:"#28034E",800:"#4B1583",500:"#731DCF",50:"#EFE6F9",10:"#F9F3FF"},grayscale:{900:"#212121",700:"#616161",500:"#9E9E9E",400:"#BDBDBD",200:"#E0E0E0",100:"#F0F0F0",70:"#F7F7F7",50:"#FAFAFA",white:"#FFFFFF",alpha:"#00000088"},negative:{900:"#B92321",700:"#D53434",100:"#FFCED4",50:"#FFEBEF"},warning:{900:"#99631B",500:"#FEC02D",100:"#FFEABE",50:"#FFF7E5"},positive:{900:"#00580E",700:"#1A872C",100:"#C3E4C4",50:"#E6F4E7"},bikAi:{500:"linear-gradient(93deg, #FF166A 0.37%, #FB5F08 100%)",100:"linear-gradient(93deg, #FEBAD2 0.37%, #FDD1B9 100%)",50:"linear-gradient(93deg, #FFE6EE 0.37%, #FFF0E7 100%)"}},t={background:{inactive:e.grayscale[200],base:e.grayscale[100],inverse:e.brand[900],inverseLight:e.brand[800],brand:e.brand[500],brandLight:e.brand[50],brandVeryLight:e.brand[10],negative:{vibrant:e.negative[700],light:e.negative[50]},warning:{vibrant:e.warning[500],light:e.warning[50]},positive:{vibrant:e.positive[700],light:e.positive[50]},blue:{light:"#E5F2FF"}},icon:{placeholder:"#9E9E9E"},scrim:{standard:"#00000099"},surface:{standard:e.grayscale.white,subdued:e.grayscale[50],hovered:e.grayscale[100],grey:e.grayscale[70],ai:e.bikAi[500],aiLight:e.bikAi[50]},content:{primary:e.grayscale[900],secondary:e.grayscale[700],placeholder:e.grayscale[500],inactive:e.grayscale[400],brand:e.brand[500],primaryInverse:e.grayscale.white,secondaryInverse:"#ffffffcc",negative:e.negative[900],warning:e.warning[900],positive:e.positive[900],blue:"#28458F",ai:e.bikAi[500]},stroke:{primary:e.grayscale[200],brand:e.brand[500],negative:{lightAlt:e.negative[100],vibrant:e.negative[700]},warning:{lightAlt:e.warning[100],vibrant:e.warning[500]},positive:{lightAlt:e.positive[100],vibrant:e.positive[700]},brandLightAlt:"#DDCCF0",blue:{lightAlt:"#C3D5E5"},ai:{lightAlt:e.bikAi[100],vibrant:e.bikAi[500]}},special:{whatsapp:{brand:"#25D366",gradient:"linear-gradient(360deg, #20B038 0%, #60D66A 100%)",dark:"#455A64",gradientArr:["#20B038","#60D66A"]},brand:{google:"#DD4B39",facebook:"#1877F2"}},text:{primary:e.grayscale[900],secondary:e.grayscale[700],placeholder:e.grayscale[500],disabled:e.grayscale[400],white:e.grayscale.white,brand:e.brand[500],altPrimary:e.brand[900],altSecondary:e.brand[800]}},i={display:{fontWeight:"400",fontSize:32,lineHeight:40,letterSpacing:0},titleXLarge:{fontWeight:"600",fontSize:32,lineHeight:40,letterSpacing:0},titleLarge:{fontWeight:"600",fontSize:28,lineHeight:40,letterSpacing:0},titleMedium:{fontWeight:"600",fontSize:20,lineHeight:28,letterSpacing:0},titleRegular:{fontWeight:"600",fontSize:16,lineHeight:24,letterSpacing:0},titleSmall:{fontWeight:"600",fontSize:14,lineHeight:20,letterSpacing:0},bodyPrimary:{fontWeight:"400",fontSize:16,lineHeight:24,letterSpacing:0},bodyLarge:{fontWeight:"400",fontSize:20,lineHeight:28,letterSpacing:0},bodySecondary:{fontWeight:"400",fontSize:14,lineHeight:20,letterSpacing:0},caption:{fontWeight:"400",fontSize:12,lineHeight:16,letterSpacing:0},tiny:{fontWeight:"400",fontSize:10,lineHeight:12,letterSpacing:0},subHeading:{fontWeight:"600",fontSize:10,lineHeight:12,letterSpacing:0},title1:{fontWeight:"600",fontSize:24,lineHeight:32,letterSpacing:0},title1Mobile:{fontWeight:"600",fontSize:20,lineHeight:30,letterSpacing:0},title2:{fontWeight:"600",fontSize:20,lineHeight:28,letterSpacing:0},title2Mobile:{fontWeight:"600",fontSize:18,lineHeight:24,letterSpacing:0},title3:{fontWeight:"600",fontSize:16,lineHeight:24,letterSpacing:0},title3Mobile:{fontWeight:"500",fontSize:14,lineHeight:20,letterSpacing:0},title4:{fontWeight:"400",fontSize:14,lineHeight:20,letterSpacing:0},textPlaceholder:{fontWeight:"400",fontSize:12,lineHeight:16,letterSpacing:0},title4Mobile:{fontWeight:"400",fontSize:10,lineHeight:16,letterSpacing:0},bodyRegularMobile:{fontWeight:"400",fontSize:14,lineHeight:18,letterSpacing:0},bodyRegular:{fontWeight:"400",fontSize:16,lineHeight:24,letterSpacing:0},bodySmall:{fontWeight:"400",fontSize:10,lineHeight:12,letterSpacing:0},buttonLarge:{fontWeight:"600",fontSize:16,lineHeight:20,letterSpacing:0},buttonRegular:{fontWeight:"600",fontSize:14,lineHeight:20,letterSpacing:0},captionMobile:{fontWeight:"500",fontSize:10,lineHeight:12,letterSpacing:0},captionBold:{fontWeight:"700",fontSize:12,lineHeight:16,letterSpacing:0},text1Bold:{fontWeight:"700",fontSize:10,lineHeight:14,letterSpacing:0},toast:{fontWeight:"400",fontSize:16,lineHeight:24,letterSpacing:0},toastMobile:{fontWeight:"400",fontSize:10,lineHeight:12,letterSpacing:0}},n={colorsV2:t,fonts:i};exports.BASE_COLORS=e,exports.COLORS=t,exports.DEFAULT_THEME=n,exports.FONTS=i;
|