@bikdotai/bik-component-library 0.0.763-beta.5 → 0.0.763-beta.55
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/Filters/CustomField/components/CustomField.js +1 -1
- package/dist/cjs/components/QueryBuilder/Filters/Event/components/EventFilter.js +1 -1
- package/dist/cjs/components/QueryBuilder/Filters/UserProperty/components/UserPropertyFilter.js +1 -1
- package/dist/cjs/components/QueryBuilder/Triggers/components/BaseTriggerQueryBuilderNode.js +1 -1
- package/dist/cjs/components/QueryBuilder/components/Connectors/Components/InTheLast.js +1 -1
- package/dist/cjs/components/QueryBuilder/components/Connectors/Components/InTwoLast.js +1 -1
- package/dist/cjs/components/QueryBuilder/helpers/SegmentValidator.d.ts +6 -26
- package/dist/cjs/components/SearchFilter/components/DatePickerButton.js +1 -1
- package/dist/cjs/components/SearchFilter/components/DateRangeOnlyButton.js +1 -1
- package/dist/cjs/components/SearchFilter/components/SearchFilterItem.js +1 -1
- package/dist/cjs/components/TablePagination/TablePagination.js +1 -1
- package/dist/cjs/components/TablePagination/TablePaginationCard.d.ts +1 -1
- package/dist/cjs/components/WhatsAppTextEditor/CustomEditor.styled.d.ts +3 -3
- package/dist/cjs/components/WhatsAppTextEditor/WhatsAppTextEditorHeader.d.ts +1 -1
- package/dist/cjs/components/analytics-card/AnalyticsCard.styled.d.ts +2 -2
- package/dist/cjs/components/analytics-chips-and-dropdowns/AnalyticsDropdown.js +1 -1
- package/dist/cjs/components/analytics-chips-and-dropdowns/CommonStyles.d.ts +5 -5
- package/dist/cjs/components/analytics-chips-and-dropdowns/chart/HorizontalBarGraph/HorizontalGraph.js +1 -1
- package/dist/cjs/components/analytics-chips-and-dropdowns/chart/LineChart/LineChart.styled.d.ts +3 -3
- package/dist/cjs/components/analytics-chips-and-dropdowns/chart/heatmap/HeatMap.d.ts +0 -4
- package/dist/cjs/components/analytics-chips-and-dropdowns/chart/heatmap/HeatMap.js +1 -1
- package/dist/cjs/components/analytics-chips-and-dropdowns/chart/heatmap/HeatMapStyled.d.ts +8 -8
- package/dist/cjs/components/analytics-chips-and-dropdowns/chart/heatmap/HeatMapVertical.d.ts +1 -1
- package/dist/cjs/components/analytics-chips-and-dropdowns/chart/linearChipGroupedChart/LinearChipGroupedChart.styled.d.ts +5 -5
- package/dist/cjs/components/analytics-chips-and-dropdowns/chart/scoreBlock/ScoreBlock.styled.d.ts +5 -5
- package/dist/cjs/components/banner/Banner.styled.d.ts +20 -20
- package/dist/cjs/components/bik-layout/CommonStyles.d.ts +17 -17
- package/dist/cjs/components/bik-layout/CommonStyles.js +1 -1
- package/dist/cjs/components/button/Button.styled.d.ts +1 -1
- package/dist/cjs/components/card-selection-modal/CardSelectionModal.styled.d.ts +2 -2
- package/dist/cjs/components/carousel-secondary/CarouselSecondary.style.d.ts +6 -6
- package/dist/cjs/components/checkList/CheckList.styled.d.ts +1 -1
- package/dist/cjs/components/code-block/CodeBlock.js +1 -1
- package/dist/cjs/components/colourInput/ColourInput.styled.d.ts +2 -2
- package/dist/cjs/components/country-code-picker/CountryCodePicker.js +1 -1
- package/dist/cjs/components/country-code-picker/CountryCodePicker.styled.d.ts +2 -2
- package/dist/cjs/components/country-code-picker/CountryPicker.js +1 -1
- package/dist/cjs/components/country-code-picker/CountryPicker.styled.d.ts +2 -2
- package/dist/cjs/components/custom-date-time/CustomDateTime.js +1 -1
- package/dist/cjs/components/custom-date-time/CustomDateTime.styled.d.ts +1 -1
- package/dist/cjs/components/custom-date-time/DateSelector/DateSelector.js +1 -1
- package/dist/cjs/components/dashboard-review-popup/DashboardReviewPopUp.styled.d.ts +2 -2
- package/dist/cjs/components/dashboard-review-popup/components/FiveStar.styled.d.ts +2 -2
- package/dist/cjs/components/dashboard-review-popup/components/Form.styled.d.ts +6 -6
- package/dist/cjs/components/datePicker/DatePicker.styled.d.ts +4 -4
- package/dist/cjs/components/datePicker/TimePicker.js +1 -1
- package/dist/cjs/components/discount-modal/CouponExpiration/CouponExpiration.js +1 -1
- package/dist/cjs/components/discount-modal/DiscountModal.js +1 -1
- package/dist/cjs/components/discount-modal/DiscountModal.styled.d.ts +5 -5
- package/dist/cjs/components/discount-modal/DynamicCoupon/DynamicCoupon.js +1 -1
- package/dist/cjs/components/discount-modal/DynamicCoupon/MinimumRequirementComponent.js +1 -1
- package/dist/cjs/components/dropdown/Dropdown.d.ts +1 -0
- package/dist/cjs/components/dropdown/Dropdown.js +1 -1
- package/dist/cjs/components/dropdown/DropdownPopover/index.js +1 -1
- package/dist/cjs/components/dropdown/OpenedDropdown/components/OpennedDropdown.js +1 -1
- package/dist/cjs/components/dropdown/OpenedDropdown/components/menu/MenuItem.d.ts +6 -0
- package/dist/cjs/components/dropdown/OpenedDropdown/components/menu/MenuItem.js +34 -4
- package/dist/cjs/components/dropdown/OpenedDropdown/components/menu/MenuList.d.ts +2 -0
- package/dist/cjs/components/dropdown/OpenedDropdown/components/menu/MenuList.js +1 -1
- package/dist/cjs/components/dropdown/OpenedDropdown/components/multiSelect/MultiSelectDropdownBottomBar.d.ts +1 -0
- package/dist/cjs/components/dropdown/OpenedDropdown/components/multiSelect/MultiSelectDropdownBottomBar.js +1 -1
- package/dist/cjs/components/dropdown/hooks/useDropdown.js +1 -1
- package/dist/cjs/components/dropdown/type.d.ts +6 -0
- package/dist/cjs/components/dropdown-button/DropdownButton.js +1 -1
- package/dist/cjs/components/input/Input.styled.d.ts +4 -4
- package/dist/cjs/components/keywords-input/KeywordsInput.styled.d.ts +1 -1
- package/dist/cjs/components/list-item/ListItem.styled.d.ts +1 -1
- package/dist/cjs/components/modals/modal.styled.d.ts +4 -4
- package/dist/cjs/components/pagination/Pagination.styled.d.ts +1 -1
- package/dist/cjs/components/plans/DurationSelectorStyles.d.ts +1 -1
- package/dist/cjs/components/plans/SubscriptionPlanSelector.d.ts +2 -2
- package/dist/cjs/components/plans/SubscriptionPlanStyled.d.ts +2 -2
- package/dist/cjs/components/product-picker/ProductPicker.styled.d.ts +2 -2
- package/dist/cjs/components/progress-bar/ProgressBarComponent.d.ts +1 -1
- package/dist/cjs/components/radioList/RadioList.styled.d.ts +1 -1
- package/dist/cjs/components/sample-button/SampleButton.styled.d.ts +1 -1
- package/dist/cjs/components/shimmer/ShimmerComponent/ShimmerStyled.d.ts +2 -2
- package/dist/cjs/components/switch/Switch.d.ts +3 -3
- package/dist/cjs/components/tabs/Tabs.styles.d.ts +5 -5
- package/dist/cjs/components/tag/Tag.styled.d.ts +1 -1
- package/dist/cjs/components/testimonial-card/TestimonialCard.style.d.ts +9 -9
- package/dist/cjs/components/toaster/Toaster.js +1 -1
- package/dist/cjs/components/toaster/Toaster.styled.d.ts +1 -1
- package/dist/esm/components/QueryBuilder/Filters/CustomField/components/CustomField.js +1 -1
- package/dist/esm/components/QueryBuilder/Filters/Event/components/EventFilter.js +1 -1
- package/dist/esm/components/QueryBuilder/Filters/UserProperty/components/UserPropertyFilter.js +1 -1
- package/dist/esm/components/QueryBuilder/Triggers/components/BaseTriggerQueryBuilderNode.js +1 -1
- package/dist/esm/components/QueryBuilder/components/Connectors/Components/InTheLast.js +1 -1
- package/dist/esm/components/QueryBuilder/components/Connectors/Components/InTwoLast.js +1 -1
- package/dist/esm/components/QueryBuilder/helpers/SegmentValidator.d.ts +6 -26
- package/dist/esm/components/SearchFilter/components/DatePickerButton.js +1 -1
- package/dist/esm/components/SearchFilter/components/DateRangeOnlyButton.js +1 -1
- package/dist/esm/components/SearchFilter/components/SearchFilterItem.js +1 -1
- package/dist/esm/components/TablePagination/TablePagination.js +1 -1
- package/dist/esm/components/TablePagination/TablePaginationCard.d.ts +1 -1
- package/dist/esm/components/WhatsAppTextEditor/CustomEditor.styled.d.ts +3 -3
- package/dist/esm/components/WhatsAppTextEditor/WhatsAppTextEditorHeader.d.ts +1 -1
- package/dist/esm/components/analytics-card/AnalyticsCard.styled.d.ts +2 -2
- package/dist/esm/components/analytics-chips-and-dropdowns/AnalyticsDropdown.js +1 -1
- package/dist/esm/components/analytics-chips-and-dropdowns/CommonStyles.d.ts +5 -5
- package/dist/esm/components/analytics-chips-and-dropdowns/chart/HorizontalBarGraph/HorizontalGraph.js +1 -1
- package/dist/esm/components/analytics-chips-and-dropdowns/chart/LineChart/LineChart.styled.d.ts +3 -3
- package/dist/esm/components/analytics-chips-and-dropdowns/chart/heatmap/HeatMap.d.ts +0 -4
- package/dist/esm/components/analytics-chips-and-dropdowns/chart/heatmap/HeatMap.js +1 -1
- package/dist/esm/components/analytics-chips-and-dropdowns/chart/heatmap/HeatMapStyled.d.ts +8 -8
- package/dist/esm/components/analytics-chips-and-dropdowns/chart/heatmap/HeatMapVertical.d.ts +1 -1
- package/dist/esm/components/analytics-chips-and-dropdowns/chart/linearChipGroupedChart/LinearChipGroupedChart.styled.d.ts +5 -5
- package/dist/esm/components/analytics-chips-and-dropdowns/chart/scoreBlock/ScoreBlock.styled.d.ts +5 -5
- package/dist/esm/components/banner/Banner.styled.d.ts +20 -20
- package/dist/esm/components/bik-layout/CommonStyles.d.ts +17 -17
- package/dist/esm/components/bik-layout/CommonStyles.js +1 -1
- package/dist/esm/components/button/Button.styled.d.ts +1 -1
- package/dist/esm/components/card-selection-modal/CardSelectionModal.styled.d.ts +2 -2
- package/dist/esm/components/carousel-secondary/CarouselSecondary.style.d.ts +6 -6
- package/dist/esm/components/checkList/CheckList.styled.d.ts +1 -1
- package/dist/esm/components/code-block/CodeBlock.js +1 -1
- package/dist/esm/components/colourInput/ColourInput.styled.d.ts +2 -2
- package/dist/esm/components/country-code-picker/CountryCodePicker.js +1 -1
- package/dist/esm/components/country-code-picker/CountryCodePicker.styled.d.ts +2 -2
- package/dist/esm/components/country-code-picker/CountryPicker.js +1 -1
- package/dist/esm/components/country-code-picker/CountryPicker.styled.d.ts +2 -2
- package/dist/esm/components/custom-date-time/CustomDateTime.js +1 -1
- package/dist/esm/components/custom-date-time/CustomDateTime.styled.d.ts +1 -1
- package/dist/esm/components/custom-date-time/DateSelector/DateSelector.js +1 -1
- package/dist/esm/components/dashboard-review-popup/DashboardReviewPopUp.styled.d.ts +2 -2
- package/dist/esm/components/dashboard-review-popup/components/FiveStar.styled.d.ts +2 -2
- package/dist/esm/components/dashboard-review-popup/components/Form.styled.d.ts +6 -6
- package/dist/esm/components/datePicker/DatePicker.styled.d.ts +4 -4
- package/dist/esm/components/datePicker/TimePicker.js +1 -1
- package/dist/esm/components/discount-modal/CouponExpiration/CouponExpiration.js +1 -1
- package/dist/esm/components/discount-modal/DiscountModal.js +1 -1
- package/dist/esm/components/discount-modal/DiscountModal.styled.d.ts +5 -5
- package/dist/esm/components/discount-modal/DynamicCoupon/DynamicCoupon.js +1 -1
- package/dist/esm/components/discount-modal/DynamicCoupon/MinimumRequirementComponent.js +1 -1
- package/dist/esm/components/dropdown/Dropdown.d.ts +1 -0
- package/dist/esm/components/dropdown/Dropdown.js +1 -1
- package/dist/esm/components/dropdown/DropdownPopover/index.js +1 -1
- package/dist/esm/components/dropdown/OpenedDropdown/components/OpennedDropdown.js +1 -1
- package/dist/esm/components/dropdown/OpenedDropdown/components/menu/MenuItem.d.ts +6 -0
- package/dist/esm/components/dropdown/OpenedDropdown/components/menu/MenuItem.js +36 -6
- package/dist/esm/components/dropdown/OpenedDropdown/components/menu/MenuList.d.ts +2 -0
- package/dist/esm/components/dropdown/OpenedDropdown/components/menu/MenuList.js +1 -1
- package/dist/esm/components/dropdown/OpenedDropdown/components/multiSelect/MultiSelectDropdownBottomBar.d.ts +1 -0
- package/dist/esm/components/dropdown/OpenedDropdown/components/multiSelect/MultiSelectDropdownBottomBar.js +1 -1
- package/dist/esm/components/dropdown/hooks/useDropdown.js +1 -1
- package/dist/esm/components/dropdown/type.d.ts +6 -0
- package/dist/esm/components/dropdown-button/DropdownButton.js +1 -1
- package/dist/esm/components/input/Input.styled.d.ts +4 -4
- package/dist/esm/components/keywords-input/KeywordsInput.styled.d.ts +1 -1
- package/dist/esm/components/list-item/ListItem.styled.d.ts +1 -1
- package/dist/esm/components/modals/modal.styled.d.ts +4 -4
- package/dist/esm/components/pagination/Pagination.styled.d.ts +1 -1
- package/dist/esm/components/plans/DurationSelectorStyles.d.ts +1 -1
- package/dist/esm/components/plans/SubscriptionPlanSelector.d.ts +2 -2
- package/dist/esm/components/plans/SubscriptionPlanStyled.d.ts +2 -2
- package/dist/esm/components/product-picker/ProductPicker.styled.d.ts +2 -2
- package/dist/esm/components/progress-bar/ProgressBarComponent.d.ts +1 -1
- package/dist/esm/components/radioList/RadioList.styled.d.ts +1 -1
- package/dist/esm/components/sample-button/SampleButton.styled.d.ts +1 -1
- package/dist/esm/components/shimmer/ShimmerComponent/ShimmerStyled.d.ts +2 -2
- package/dist/esm/components/switch/Switch.d.ts +3 -3
- package/dist/esm/components/tabs/Tabs.styles.d.ts +5 -5
- package/dist/esm/components/tag/Tag.styled.d.ts +1 -1
- package/dist/esm/components/testimonial-card/TestimonialCard.style.d.ts +9 -9
- package/dist/esm/components/toaster/Toaster.js +1 -1
- package/dist/esm/components/toaster/Toaster.styled.d.ts +1 -1
- package/package.json +1 -1
- package/dist/cjs/components/QueryBuilder/helpers/SegmentValidator.js +0 -1
- package/dist/esm/components/QueryBuilder/helpers/SegmentValidator.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__rest as e}from"../../../_virtual/_tslib.js";import{jsxs as i,jsx as t,Fragment as o}from"react/jsx-runtime";import n from"../../../assets/icons/info.svg.js";import{Alert as l}from"../../alerts/Alert.js";import{ALERT_TYPES as s,CONTENT_POSITION as r}from"../../alerts/AlertHelper.js";import{Button as a}from"../../button/Button.js";import{CheckBox as d}from"../../checkBox/CheckBox.js";import{DISCOUNT_APPLIES_TO as c,OFFER_APPLIES_TO as u,DISCOUNT_TYPES as p,COUPON_EXPIRATION as m,DISCOUNT_VALUE_TYPES as C,DISCOUNT_TARGET_TYPES as E,DISCOUNT_TARGET_SELECTION as v}from"../type.js";import"../../dropdown/DropdownPopover/index.js";import{Dropdown as D}from"../../dropdown/Dropdown.js";import"../../dropdown/ChipDropdown.js";import"react";import"../../zeroState/ZeroState.js";import"lodash/debounce";import{BodySecondary as b,TitleRegular as g,TitleSmall as T}from"../../TypographyStyle.js";import{DEFAULT_THEME as h}from"../../../constants/Theme.js";import"../../dropdown/OpenedDropdown/components/description/Description.styled.js";import"../../list-item/ListItem.js";import"../../dropdown/OpenedDropdown/components/menu/FreeFormMenu.styled.js";import"../../dropdown/OpenedDropdown/components/menu/MenuItem.js";import"../../dropdown/OpenedDropdown/components/menu/MenuList.styled.js";import"../../dropdown/OpenedDropdown/components/multiSelect/MultiSelectDropdownBottomBar.styled.js";import"../../dropdown/OpenedDropdown/components/OpennedDropdown.styled.js";import"../../icon-button/IconButton.js";import{Input as y}from"../../input/Input.js";import O from"../../../assets/icons/cross.svg.js";import"../../dropdown/MenuItem/MenuItem.js";import{RadioButton as P}from"../../radioButton/RadioButton.js";import I from"../../../assets/icons/cubeIcon.svg.js";import V from"../../../assets/icons/delete.svg.js";import S from"../../../assets/icons/edit.svg.js";import j from"../../../assets/icons/plus.svg.js";import{CouponExpiration as f}from"../CouponExpiration/CouponExpiration.js";import{DynamicCouponContainer as x}from"../DiscountModal.styled.js";import{DiscountOptionsContainer as R,DiscountDetailsOption as _,AddProductButtonsContainer as N,ProductCollectionCard as A,CubeIconContainer as F,IconContainer as L,ProductVariableCard as w}from"./DynamicCoupon.styled.js";import q from"./MinimumRequirementComponent.js";import U from"./ZeroState.js";var k;!function(e){e.ENTITLED="entitled",e.PREREQUISITE="prerequisite"}(k||(k={}));const B=B=>{var M,G,Q,X,Y,$,W,z;const Z=[{selected:B.discountCouponAppliesTo===c.ENTIRE_ORDER,label:"Entire Order",value:c.ENTIRE_ORDER},{selected:B.discountCouponAppliesTo===c.SPECIFIC_PRODUCTS,label:"Specific Product",value:c.SPECIFIC_PRODUCTS},{selected:B.discountCouponAppliesTo===c.SPECIFIC_COLLECTIONS,label:"Specific Collections",value:c.SPECIFIC_COLLECTIONS}],H=[{selected:B.offerAppliesToBuy===u.SPECIFIC_PRODUCTS,label:"Specific Product",value:u.SPECIFIC_PRODUCTS},{selected:B.offerAppliesToBuy===u.SPECIFIC_COLLECTIONS,label:"Specific Collections",value:u.SPECIFIC_COLLECTIONS}],J=[{selected:B.offerAppliesToGet===u.SPECIFIC_PRODUCTS,label:"Specific Product",value:u.SPECIFIC_PRODUCTS},{selected:B.offerAppliesToGet===u.SPECIFIC_COLLECTIONS,label:"Specific Collections",value:u.SPECIFIC_COLLECTIONS}],K=(e,d,u)=>{var p,m,C,E,v,D,g,y,P,f,x,R;let _=[],q=[],U={},M={};B.useNewPicker?(U=d===k.ENTITLED?B.entitledProducts:B.prerequisiteProducts,M=null!==(p=d===k.ENTITLED?B.entitledCollections:B.prerequisiteCollections)&&void 0!==p?p:[],(null==U?void 0:U.isCustom)&&delete U.isCustom,(null==M?void 0:M.isCustom)&&delete M.isCustom,Object.values(U).forEach((e=>{Object.keys(e.products).forEach((i=>{_.push({id:i,name:e.products[i].name,image:e.products[i].image})}))})),Object.keys(M).forEach((e=>{"isCustom"!==e&&q.push({id:e,name:M[e].name,image:M[e].image})}))):(_=d===k.ENTITLED?B.entitledProducts:B.prerequisiteProducts,q=null!==(m=d===k.ENTITLED?B.entitledCollections:B.prerequisiteCollections)&&void 0!==m?m:[]);const G=[null===(C=B.dynamicDiscountValidationError)||void 0===C?void 0:C.inValidProductSelection,null===(E=B.dynamicDiscountValidationError)||void 0===E?void 0:E.inValidProductVariableSelection,null===(v=B.dynamicDiscountValidationError)||void 0===v?void 0:v.inValidCollectionSelection],Q=[null===(D=B.dynamicDiscountValidationError)||void 0===D?void 0:D.inValidBuyXCollectionSelection,null===(g=B.dynamicDiscountValidationError)||void 0===g?void 0:g.inValidBuyXProductSelection,null===(y=B.dynamicDiscountValidationError)||void 0===y?void 0:y.inValidBuyXProductVariableSelection],X=[null===(P=B.dynamicDiscountValidationError)||void 0===P?void 0:P.inValidGetYCollectionSelection,null===(f=B.dynamicDiscountValidationError)||void 0===f?void 0:f.inValidGetYProductSelection,null===(x=B.dynamicDiscountValidationError)||void 0===x?void 0:x.inValidGetYProductVariableSelection];let Y=!1;return"couponAppliesTo"===u&&(Y=G.some(Boolean)),"buyX"===u&&(Y=Q.some(Boolean)),"getY"===u&&(Y=X.some(Boolean)),i(o,{children:[i("div",Object.assign({style:{display:"flex",gap:18}},{children:[e===c.SPECIFIC_PRODUCTS&&0===_.length&&(d===k.ENTITLED&&!B.entitledProductVariable||d===k.PREREQUISITE&&!B.preRequisiteProductVariable)&&!(null==q?void 0:q.length)&&i(N,{children:[t("div",Object.assign({style:{width:B.isProductVariableSupported?"284px":"300px",display:"flex"}},{children:t(a,{buttonText:"Add Product(s)",buttonType:"dashRegular",LeadingIcon:j,matchParentWidth:!0,onClick:()=>{B.setIsProductPickerOpen(d)},error:Y})})),B.isProductVariableSupported&&B.productVariableList&&i(o,{children:[t(b,Object.assign({color:h.colorsV2.content.placeholder},{children:"OR"})),t(a,{buttonText:"Add Product(s) Variable",buttonType:"dashRegular",LeadingIcon:j,matchParentWidth:!0,onClick:()=>{B.setIsProductVariablePickerOpen(d)},error:Y})]})]}),e===c.SPECIFIC_COLLECTIONS&&0===q.length&&!(null==_?void 0:_.length)&&t("div",Object.assign({style:{width:"300px",display:"flex"}},{children:t(a,{buttonText:"Add collection(s)",buttonType:"dashRegular",LeadingIcon:j,matchParentWidth:!0,onClick:()=>{B.setIsCollectionPickerOpen(d)},style:{marginTop:"16px"},error:Y})}))]})),Y&&t("div",Object.assign({style:{margin:"8px 0 0"}},{children:t(l,{type:s.NEGATIVE,text:"Required Field",contentPosition:r.START,icon:()=>t(n,{width:16,height:16,color:h.colorsV2.content.negative})})})),_.length||q.length?i("div",{children:[t(b,Object.assign({style:{margin:"8px 0"}},{children:e===c.SPECIFIC_COLLECTIONS?"Collection(s)":"Product(s)"})),i(A,{children:[t(F,{children:t(I,{width:20,height:20,color:h.colorsV2.content.secondary})}),i(T,{children:[e===c.SPECIFIC_PRODUCTS?_.length:q.length," ",e===c.SPECIFIC_PRODUCTS?"Product(s)":"Collection(s)"," ","added"]}),i("div",Object.assign({style:{display:"flex",gap:4}},{children:[t(L,Object.assign({onClick:()=>{e===c.SPECIFIC_PRODUCTS?B.setIsProductPickerOpen(d):B.setIsCollectionPickerOpen(d)}},{children:t(S,{width:24,height:24,color:h.colorsV2.content.placeholder})})),t(L,Object.assign({onClick:()=>{e===c.SPECIFIC_PRODUCTS?d===k.ENTITLED?B.setEntitledProducts([]):B.setPrerequisiteProducts([]):d===k.ENTITLED?B.setEntitledCollections([]):B.setPrerequisiteCollections([])}},{children:t(V,{width:24,height:24,color:h.colorsV2.content.placeholder})}))]}))]})]}):d===k.ENTITLED&&B.entitledProductVariable?i("div",{children:[t(b,Object.assign({style:{margin:"16px 0 8px"}},{children:"Product Variable"})),i(w,{children:[t(T,{children:B.entitledProductVariable.displayName}),t("div",Object.assign({style:{display:"flex",gap:4}},{children:t(L,Object.assign({onClick:()=>{B.setEntitledProductVariable(void 0)}},{children:t(O,{width:24,height:24,color:h.colorsV2.content.primary})}))}))]})]}):d===k.PREREQUISITE&&(null===(R=B.preRequisiteProductVariable)||void 0===R?void 0:R.displayName)?i("div",{children:[t(b,Object.assign({style:{margin:"16px 0 8px"}},{children:"Product Variable"})),i(w,{children:[t(T,{children:B.preRequisiteProductVariable.displayName}),t("div",Object.assign({style:{display:"flex",gap:4}},{children:t(L,Object.assign({onClick:()=>{B.setPreRequisiteProductVariable(void 0)}},{children:t(O,{width:24,height:24,color:h.colorsV2.content.primary})}))}))]})]}):t(o,{children:" "})]})},ee=(e,o)=>{var n,l,s,r,a,d,p,m,C,E;let v=[],g=[],h={},O={};B.useNewPicker?(h=e===k.ENTITLED?B.entitledProducts:B.prerequisiteProducts,O=null!==(n=e===k.ENTITLED?B.entitledCollections:B.prerequisiteCollections)&&void 0!==n?n:[],(null==h?void 0:h.isCustom)&&delete h.isCustom,(null==O?void 0:O.isCustom)&&delete O.isCustom,Object.values(h).forEach((e=>{Object.keys(e.products).forEach((i=>{v.push({id:i,name:e.products[i].name,image:e.products[i].image})}))})),Object.keys(O).forEach((e=>{"isCustom"!==e&&g.push({id:e,name:O[e].name,image:O[e].image})}))):(v=e===k.ENTITLED?B.entitledProducts:B.prerequisiteProducts,g=null!==(l=e===k.ENTITLED?B.entitledCollections:B.prerequisiteCollections)&&void 0!==l?l:[]);const P=e===k.PREREQUISITE?B.offerAppliesToBuy:B.offerAppliesToGet,I=e===k.PREREQUISITE?k.PREREQUISITE:k.ENTITLED,V=P===u.SPECIFIC_PRODUCTS?c.SPECIFIC_PRODUCTS:c.SPECIFIC_COLLECTIONS;return i("div",{children:[t(T,Object.assign({style:{marginBottom:16}},{children:e===k.PREREQUISITE?"Customer buys":"Customer gets"})),i("div",Object.assign({style:{display:"flex"}},{children:[!o&&t("div",{children:i("div",Object.assign({className:"input__rows"},{children:[t("div",Object.assign({className:"input__wrapper"},{children:t(y,{value:e===k.ENTITLED?null!==(r=null===(s=B.discountData.entitledQuantity)||void 0===s?void 0:s.toString())&&void 0!==r?r:"":null!==(d=null===(a=B.discountData.prerequisiteQuantity)||void 0===a?void 0:a.toString())&&void 0!==d?d:"",type:"number",onChangeText:i=>{e===k.ENTITLED?B.setDiscountData(Object.assign(Object.assign({},B.discountData),{entitledQuantity:parseInt(i)})):B.setDiscountData(Object.assign(Object.assign({},B.discountData),{prerequisiteQuantity:parseInt(i)}))},labelText:"Quantity of products",placeholder:"Eg. 2",width:"300px",errorMessage:e===k.PREREQUISITE&&(null===(p=B.dynamicDiscountValidationError)||void 0===p?void 0:p.inValidBuyXValue)||e===k.ENTITLED&&(null===(m=B.dynamicDiscountValidationError)||void 0===m?void 0:m.inValidGetYValue)?"Required Field":"",state:e===k.PREREQUISITE&&(null===(C=B.dynamicDiscountValidationError)||void 0===C?void 0:C.inValidBuyXValue)||e===k.ENTITLED&&(null===(E=B.dynamicDiscountValidationError)||void 0===E?void 0:E.inValidGetYValue)?"invalid":"none"})})),t("div",{className:"input__wrapper"})]}))}),i("div",{children:[t(b,Object.assign({style:{marginBottom:8}},{children:"Any items from"})),e===k.PREREQUISITE&&t(D,{width:"244px",options:H,placement:"bottom-start",onSelect:e=>{var i,t,o;B.setOfferAppliesToBuy(e.value),B.setPrerequisiteProducts([]),B.setPrerequisiteCollections([]),B.setPreRequisiteProductVariable(void 0),B.setDynamicDiscountValidationError((e=>Object.assign(Object.assign({},e),{inValidBuyXCollectionSelection:!1,inValidBuyXProductSelection:!1,inValidBuyXProductVariableSelection:!1}))),B.setDiscountData(Object.assign(Object.assign({},B.discountData),{prerequisiteCollectionIds:[],prerequisiteProductIds:[],collectionsConf:{entitledCollections:null===(i=B.discountData.collectionsConf)||void 0===i?void 0:i.entitledCollections,prerequisiteCollections:{}},productsConf:{entitledProducts:null===(t=B.discountData.productsConf)||void 0===t?void 0:t.entitledProducts,prerequisiteProducts:{}},productVariableConf:{entitledProductVariable:null===(o=B.discountData.productVariableConf)||void 0===o?void 0:o.entitledProductVariable,prerequisiteProductVariable:{}}}))}}),e===k.ENTITLED&&t(D,{width:"244px",options:J,placement:"bottom-start",onSelect:e=>{var i,t,o;B.setOfferAppliesToGet(e.value),B.setEntitledProducts([]),B.setEntitledCollections([]),B.setEntitledProductVariable(void 0),B.setDynamicDiscountValidationError((e=>Object.assign(Object.assign({},e),{inValidGetYCollectionSelection:!1,inValidGetYProductSelection:!1,inValidGetYProductVariableSelection:!1}))),B.setDiscountData(Object.assign(Object.assign({},B.discountData),{entitledCollectionIds:[],entitledProductIds:[],collectionsConf:{entitledCollections:{},prerequisiteCollections:null===(i=B.discountData.collectionsConf)||void 0===i?void 0:i.prerequisiteCollections},productsConf:{entitledProducts:{},prerequisiteProducts:null===(t=B.discountData.productsConf)||void 0===t?void 0:t.prerequisiteProducts},productVariableConf:{entitledProductVariable:{},prerequisiteProductVariable:null===(o=B.discountData.productVariableConf)||void 0===o?void 0:o.prerequisiteProductVariable}}))}})]})]})),K(V,I,e===k.PREREQUISITE?"buyX":"getY")]})};return i(x,Object.assign({style:B.noTopMargin?{marginTop:0}:{}},{children:[i("div",{children:[i("div",Object.assign({style:{display:"flex",gap:16}},{children:[t("div",Object.assign({className:"input__wrapper"},{children:t(y,{value:null!==(M=B.discountData.title)&&void 0!==M?M:"",onChangeText:e=>{var i;B.setDiscountData(Object.assign(Object.assign({},B.discountData),{title:null!==(i=null==e?void 0:e.trim())&&void 0!==i?i:""}))},maxCharLimit:30,labelText:"Discount Coupon Title",placeholder:`Eg. “Flat ${null!==(G=B.currency)&&void 0!==G?G:""} 15 Off”`,hintText:"Will be same for everyone. Can’t be changed later",width:"300px",isRequired:!0,errorMessage:(null===(Q=B.dynamicDiscountValidationError)||void 0===Q?void 0:Q.invalidCouponTitle)?"Required Field":"",state:(null===(X=B.dynamicDiscountValidationError)||void 0===X?void 0:X.invalidCouponTitle)?"invalid":"none"})})),!B.hideProbability&&t(y,{value:null!==($=null===(Y=B.discountData.probability)||void 0===Y?void 0:Y.toString())&&void 0!==$?$:"",type:"number",onChangeText:e=>{B.setDiscountData(Object.assign(Object.assign({},B.discountData),{probability:e.startsWith(".")?parseFloat(parseFloat(`0${e}`).toFixed(2)):parseFloat(parseFloat(e).toFixed(2))}))},labelText:"Probability of getting coupon ",hintText:"Enter a decimal value between 0-1",placeholder:"Eg. 0.5",maxCharLimit:4,width:"300px",isRequired:!0,errorMessage:(null===(W=B.dynamicDiscountValidationError)||void 0===W?void 0:W.inValidProbability)?"Required Field":"",state:(null===(z=B.dynamicDiscountValidationError)||void 0===z?void 0:z.inValidProbability)?"invalid":"none"})]})),t("div",{style:{height:"1px",width:"100%",background:h.colorsV2.stroke.primary,margin:"24px 0 8px"}})]}),B.allowStaticCoupon&&t((()=>i("div",{children:[t(g,{children:"Discount Details"}),t(R,{children:B.discountDetailsOptions.map((t=>{return i(_,Object.assign({selected:B.selectedDiscountDetails.id===t.id,onClick:()=>(i=>{if(B.selectedDiscountDetails.id!==i.id)if(B.resetValidationErrors(),B.setValidationErrorMessage(""),B.setDiscountCouponAppliesTo(c.ENTIRE_ORDER),B.setSelectedDiscountDetails(i),B.setDiscountData(Object.assign(Object.assign({},B.discountData),{value:void 0})),B.setPreRequisiteProductVariable(void 0),B.setEntitledProductVariable(void 0),["percentage","amount"].includes(i.value)){B.onChangeCouponType({label:"Amount off on order",selected:!0,value:p.AMOUNT_OFF_ORDER});const t=Object.assign(Object.assign({},B.discountData),{valueType:"percentage"===i.value?C.PERCENTAGE:C.FIXED_AMOUNT,value:void 0,targetType:E.LINE_ITEM,targetSelection:v.ALL,entitledCollectionIds:[],entitledProductIds:[],prerequisiteCollectionIds:[],prerequisiteProductIds:[],collectionsConf:{entitledCollections:{},prerequisiteCollections:{}},productsConf:{entitledProducts:{},prerequisiteProducts:{}},productVariableConf:{entitledProductVariable:{},prerequisiteProductVariable:{}}}),o=e(t,["entitledQuantity","prerequisiteQuantity"]);B.setDiscountData(o)}else B.onChangeCouponType({label:i.label,selected:!0,value:i.value})})(t)},{children:[t.icon((o=t.id,B.selectedDiscountDetails.id===o?h.colorsV2.stroke.brand:h.colorsV2.text.secondary)),t.label]}),t.id);var o}))})]})),{}),(B.selectedCouponType===p.AMOUNT_OFF_ORDER||B.selectedCouponType===p.AMOUNT_OFF_PRODUCTS)&&(()=>{var e,n,l,s,r,a;return i(o,{children:[t("div",Object.assign({className:"input__rows"},{children:t("div",Object.assign({className:"input__wrapper"},{children:t(y,{value:null!==(l=null===(n=null===(e=B.discountData)||void 0===e?void 0:e.value)||void 0===n?void 0:n.toString())&&void 0!==l?l:"",labelText:"Discount amount",type:"number",width:"300px",onChangeText:e=>{B.setDiscountData(Object.assign(Object.assign({},B.discountData),{value:parseInt(e)}))},placeholder:"15",prefixText:B.discountData.valueType===C.FIXED_AMOUNT?null!==(s=B.currency)&&void 0!==s?s:"":void 0,suffixText:B.discountData.valueType===C.PERCENTAGE?"%":void 0,errorMessage:(null===(r=B.dynamicDiscountValidationError)||void 0===r?void 0:r.inValidDiscountAmount)?"Required Field":"",state:(null===(a=B.dynamicDiscountValidationError)||void 0===a?void 0:a.inValidDiscountAmount)?"invalid":"none"})}))})),t("div",Object.assign({style:{paddingTop:"24px",marginTop:16,borderTop:`1px solid ${h.colorsV2.stroke.primary}`}},{children:i("div",Object.assign({className:"input__wrapper"},{children:[t(g,Object.assign({style:{marginBottom:10}},{children:"Applies to"})),t("div",Object.assign({style:{display:"flex",flexGrow:0,flexShrink:0,flexBasis:"auto"}},{children:t(D,{width:"300px",options:Z,placement:"bottom-start",onSelect:e=>{const i="value"in e&&e.value===c.ENTIRE_ORDER?{label:"Amount off on order",selected:!0,value:p.AMOUNT_OFF_ORDER}:{label:"Amount off on products",selected:!0,value:p.AMOUNT_OFF_PRODUCTS};B.onChangeCouponType(i),B.setDiscountCouponAppliesTo(e.value),B.setEntitledProductVariable(void 0),B.setDynamicDiscountValidationError((e=>Object.assign(Object.assign({},e),{inValidProductVariableSelection:!1,inValidProductSelection:!1,inValidCollectionSelection:!1})))}})})),(B.discountCouponAppliesTo===c.SPECIFIC_PRODUCTS||B.discountCouponAppliesTo===c.SPECIFIC_COLLECTIONS)&&K(B.discountCouponAppliesTo,k.ENTITLED,"couponAppliesTo")]}))}))]})})(),B.selectedCouponType===p.BUY_X_GET_Y&&(()=>{var e,o,n,l,s;return i(x,Object.assign({style:{border:`1px solid ${h.colorsV2.stroke.primary}`,padding:"16px",borderRadius:"4px",margin:0}},{children:[ee(k.PREREQUISITE),t("div",{style:{width:"100%",height:"1px",backgroundColor:h.colorsV2.stroke.primary,margin:"8px 0"}}),ee(k.ENTITLED),t(b,Object.assign({style:{marginTop:"8px"}},{children:"At a discounted value"})),t("div",{children:t(P,{label:"Free",isActive:100===B.discountData.value,onValueChange:e=>{e?B.setDiscountData(Object.assign(Object.assign({},B.discountData),{value:100})):B.setDiscountData(Object.assign(Object.assign({},B.discountData),{value:void 0}))}})}),i("div",Object.assign({style:{display:"flex",flexDirection:"column"}},{children:[t(P,{label:"Percentage off",isActive:100!==B.discountData.value,onValueChange:()=>{B.setDiscountData(Object.assign(Object.assign({},B.discountData),{value:void 0}))}}),100!==B.discountData.value&&t("div",Object.assign({style:{marginTop:8}},{children:t(y,{value:null!==(n=null===(o=null===(e=B.discountData)||void 0===e?void 0:e.value)||void 0===o?void 0:o.toString())&&void 0!==n?n:"",onChangeText:e=>{B.setDiscountData(Object.assign(Object.assign({},B.discountData),{value:parseInt(e)}))},type:"number",placeholder:"Eg. 50",suffixText:"%",width:"300px",errorMessage:(null===(l=B.dynamicDiscountValidationError)||void 0===l?void 0:l.inValidDiscountAmount)?"Required Field":"",state:(null===(s=B.dynamicDiscountValidationError)||void 0===s?void 0:s.inValidDiscountAmount)?"invalid":"none"})}))]}))]}))})(),!B.selectedCouponType&&t(U,{}),B.allowStaticCoupon&&B.selectedCouponType!==p.BUY_X_GET_Y&&t("div",Object.assign({style:{padding:"24px 0 16px",marginTop:16,borderTop:`1px solid ${h.colorsV2.stroke.primary}`}},{children:t(q,{selectedMinimumRequirement:B.selectedMinimumRequirement,setSelectedMinimumRequirement:B.setSelectedMinimumRequirement,discountData:B.discountData,setDiscountData:B.setDiscountData,currency:B.currency,dynamicDiscountValidationError:B.dynamicDiscountValidationError})})),B.selectedCouponType&&!B.hideExpiration&&i("div",Object.assign({style:{padding:B.selectedCouponType!==p.BUY_X_GET_Y?"24px 0 16px":"8px 0",borderTop:B.selectedCouponType!==p.BUY_X_GET_Y?`1px solid ${h.colorsV2.stroke.primary}`:"none"}},{children:[t(d,{label:"Add expiration",isDisabled:!!B.makeExpiryMandatory,isChecked:B.isAddExpirationChecked,onValueChange:e=>{B.setIsAddExpirationChecked(e),B.setDiscountData(Object.assign(Object.assign({},B.discountData),{expireAfter:void 0,expireAt:void 0})),B.setSelectedExpiration(B.isUsageFromStatic?m.FIXED_EXPIRATION:m.DYNAMIC_EXPIRATION)},boldOnChecked:!0,labelSize:"DEFAULT"}),t(b,Object.assign({style:{color:h.colorsV2.text.secondary,marginLeft:28}},{children:"Make coupon only valid till a certain time"})),B.isAddExpirationChecked&&t(f,{discountData:B.discountData,setDiscountData:B.setDiscountData,isAddExpirationChecked:B.isAddExpirationChecked,inValidCouponExpiry:B.dynamicDiscountValidationError.inValidCouponExpiry,selectedExpiration:B.selectedExpiration,setSelectedExpiration:B.setSelectedExpiration,hideExpirationOptions:B.isUsageFromStatic})]}))]}))};export{k as DISCOUNT_PRODUCTS,B as default};
|
|
1
|
+
import{__rest as e}from"../../../_virtual/_tslib.js";import{jsxs as i,jsx as t,Fragment as o}from"react/jsx-runtime";import n from"../../../assets/icons/info.svg.js";import{Alert as l}from"../../alerts/Alert.js";import{ALERT_TYPES as s,CONTENT_POSITION as r}from"../../alerts/AlertHelper.js";import{Button as a}from"../../button/Button.js";import{CheckBox as d}from"../../checkBox/CheckBox.js";import{DISCOUNT_APPLIES_TO as c,OFFER_APPLIES_TO as u,DISCOUNT_TYPES as p,COUPON_EXPIRATION as m,DISCOUNT_VALUE_TYPES as C,DISCOUNT_TARGET_TYPES as E,DISCOUNT_TARGET_SELECTION as v}from"../type.js";import"../../dropdown/DropdownPopover/index.js";import{Dropdown as D}from"../../dropdown/Dropdown.js";import"../../dropdown/ChipDropdown.js";import"react";import"../../zeroState/ZeroState.js";import{BodySecondary as b,TitleRegular as g,TitleSmall as T}from"../../TypographyStyle.js";import{DEFAULT_THEME as h}from"../../../constants/Theme.js";import"../../dropdown/OpenedDropdown/components/description/Description.styled.js";import"../../list-item/ListItem.js";import"../../dropdown/OpenedDropdown/components/menu/FreeFormMenu.styled.js";import"../../dropdown/OpenedDropdown/components/menu/MenuItem.js";import"../../dropdown/OpenedDropdown/components/menu/MenuList.styled.js";import"../../dropdown/OpenedDropdown/components/multiSelect/MultiSelectDropdownBottomBar.styled.js";import"../../dropdown/OpenedDropdown/components/OpennedDropdown.styled.js";import"../../icon-button/IconButton.js";import{Input as y}from"../../input/Input.js";import O from"../../../assets/icons/cross.svg.js";import"../../dropdown/MenuItem/MenuItem.js";import{RadioButton as P}from"../../radioButton/RadioButton.js";import I from"../../../assets/icons/cubeIcon.svg.js";import V from"../../../assets/icons/delete.svg.js";import S from"../../../assets/icons/edit.svg.js";import j from"../../../assets/icons/plus.svg.js";import{CouponExpiration as f}from"../CouponExpiration/CouponExpiration.js";import{DynamicCouponContainer as x}from"../DiscountModal.styled.js";import{DiscountOptionsContainer as R,DiscountDetailsOption as _,AddProductButtonsContainer as N,ProductCollectionCard as A,CubeIconContainer as F,IconContainer as L,ProductVariableCard as w}from"./DynamicCoupon.styled.js";import q from"./MinimumRequirementComponent.js";import U from"./ZeroState.js";var k;!function(e){e.ENTITLED="entitled",e.PREREQUISITE="prerequisite"}(k||(k={}));const B=B=>{var M,G,Q,X,Y,$,W,z;const Z=[{selected:B.discountCouponAppliesTo===c.ENTIRE_ORDER,label:"Entire Order",value:c.ENTIRE_ORDER},{selected:B.discountCouponAppliesTo===c.SPECIFIC_PRODUCTS,label:"Specific Product",value:c.SPECIFIC_PRODUCTS},{selected:B.discountCouponAppliesTo===c.SPECIFIC_COLLECTIONS,label:"Specific Collections",value:c.SPECIFIC_COLLECTIONS}],H=[{selected:B.offerAppliesToBuy===u.SPECIFIC_PRODUCTS,label:"Specific Product",value:u.SPECIFIC_PRODUCTS},{selected:B.offerAppliesToBuy===u.SPECIFIC_COLLECTIONS,label:"Specific Collections",value:u.SPECIFIC_COLLECTIONS}],J=[{selected:B.offerAppliesToGet===u.SPECIFIC_PRODUCTS,label:"Specific Product",value:u.SPECIFIC_PRODUCTS},{selected:B.offerAppliesToGet===u.SPECIFIC_COLLECTIONS,label:"Specific Collections",value:u.SPECIFIC_COLLECTIONS}],K=(e,d,u)=>{var p,m,C,E,v,D,g,y,P,f,x,R;let _=[],q=[],U={},M={};B.useNewPicker?(U=d===k.ENTITLED?B.entitledProducts:B.prerequisiteProducts,M=null!==(p=d===k.ENTITLED?B.entitledCollections:B.prerequisiteCollections)&&void 0!==p?p:[],(null==U?void 0:U.isCustom)&&delete U.isCustom,(null==M?void 0:M.isCustom)&&delete M.isCustom,Object.values(U).forEach((e=>{Object.keys(e.products).forEach((i=>{_.push({id:i,name:e.products[i].name,image:e.products[i].image})}))})),Object.keys(M).forEach((e=>{"isCustom"!==e&&q.push({id:e,name:M[e].name,image:M[e].image})}))):(_=d===k.ENTITLED?B.entitledProducts:B.prerequisiteProducts,q=null!==(m=d===k.ENTITLED?B.entitledCollections:B.prerequisiteCollections)&&void 0!==m?m:[]);const G=[null===(C=B.dynamicDiscountValidationError)||void 0===C?void 0:C.inValidProductSelection,null===(E=B.dynamicDiscountValidationError)||void 0===E?void 0:E.inValidProductVariableSelection,null===(v=B.dynamicDiscountValidationError)||void 0===v?void 0:v.inValidCollectionSelection],Q=[null===(D=B.dynamicDiscountValidationError)||void 0===D?void 0:D.inValidBuyXCollectionSelection,null===(g=B.dynamicDiscountValidationError)||void 0===g?void 0:g.inValidBuyXProductSelection,null===(y=B.dynamicDiscountValidationError)||void 0===y?void 0:y.inValidBuyXProductVariableSelection],X=[null===(P=B.dynamicDiscountValidationError)||void 0===P?void 0:P.inValidGetYCollectionSelection,null===(f=B.dynamicDiscountValidationError)||void 0===f?void 0:f.inValidGetYProductSelection,null===(x=B.dynamicDiscountValidationError)||void 0===x?void 0:x.inValidGetYProductVariableSelection];let Y=!1;return"couponAppliesTo"===u&&(Y=G.some(Boolean)),"buyX"===u&&(Y=Q.some(Boolean)),"getY"===u&&(Y=X.some(Boolean)),i(o,{children:[i("div",Object.assign({style:{display:"flex",gap:18}},{children:[e===c.SPECIFIC_PRODUCTS&&0===_.length&&(d===k.ENTITLED&&!B.entitledProductVariable||d===k.PREREQUISITE&&!B.preRequisiteProductVariable)&&!(null==q?void 0:q.length)&&i(N,{children:[t("div",Object.assign({style:{width:B.isProductVariableSupported?"284px":"300px",display:"flex"}},{children:t(a,{buttonText:"Add Product(s)",buttonType:"dashRegular",LeadingIcon:j,matchParentWidth:!0,onClick:()=>{B.setIsProductPickerOpen(d)},error:Y})})),B.isProductVariableSupported&&B.productVariableList&&i(o,{children:[t(b,Object.assign({color:h.colorsV2.content.placeholder},{children:"OR"})),t(a,{buttonText:"Add Product(s) Variable",buttonType:"dashRegular",LeadingIcon:j,matchParentWidth:!0,onClick:()=>{B.setIsProductVariablePickerOpen(d)},error:Y})]})]}),e===c.SPECIFIC_COLLECTIONS&&0===q.length&&!(null==_?void 0:_.length)&&t("div",Object.assign({style:{width:"300px",display:"flex"}},{children:t(a,{buttonText:"Add collection(s)",buttonType:"dashRegular",LeadingIcon:j,matchParentWidth:!0,onClick:()=>{B.setIsCollectionPickerOpen(d)},style:{marginTop:"16px"},error:Y})}))]})),Y&&t("div",Object.assign({style:{margin:"8px 0 0"}},{children:t(l,{type:s.NEGATIVE,text:"Required Field",contentPosition:r.START,icon:()=>t(n,{width:16,height:16,color:h.colorsV2.content.negative})})})),_.length||q.length?i("div",{children:[t(b,Object.assign({style:{margin:"8px 0"}},{children:e===c.SPECIFIC_COLLECTIONS?"Collection(s)":"Product(s)"})),i(A,{children:[t(F,{children:t(I,{width:20,height:20,color:h.colorsV2.content.secondary})}),i(T,{children:[e===c.SPECIFIC_PRODUCTS?_.length:q.length," ",e===c.SPECIFIC_PRODUCTS?"Product(s)":"Collection(s)"," ","added"]}),i("div",Object.assign({style:{display:"flex",gap:4}},{children:[t(L,Object.assign({onClick:()=>{e===c.SPECIFIC_PRODUCTS?B.setIsProductPickerOpen(d):B.setIsCollectionPickerOpen(d)}},{children:t(S,{width:24,height:24,color:h.colorsV2.content.placeholder})})),t(L,Object.assign({onClick:()=>{e===c.SPECIFIC_PRODUCTS?d===k.ENTITLED?B.setEntitledProducts([]):B.setPrerequisiteProducts([]):d===k.ENTITLED?B.setEntitledCollections([]):B.setPrerequisiteCollections([])}},{children:t(V,{width:24,height:24,color:h.colorsV2.content.placeholder})}))]}))]})]}):d===k.ENTITLED&&B.entitledProductVariable?i("div",{children:[t(b,Object.assign({style:{margin:"16px 0 8px"}},{children:"Product Variable"})),i(w,{children:[t(T,{children:B.entitledProductVariable.displayName}),t("div",Object.assign({style:{display:"flex",gap:4}},{children:t(L,Object.assign({onClick:()=>{B.setEntitledProductVariable(void 0)}},{children:t(O,{width:24,height:24,color:h.colorsV2.content.primary})}))}))]})]}):d===k.PREREQUISITE&&(null===(R=B.preRequisiteProductVariable)||void 0===R?void 0:R.displayName)?i("div",{children:[t(b,Object.assign({style:{margin:"16px 0 8px"}},{children:"Product Variable"})),i(w,{children:[t(T,{children:B.preRequisiteProductVariable.displayName}),t("div",Object.assign({style:{display:"flex",gap:4}},{children:t(L,Object.assign({onClick:()=>{B.setPreRequisiteProductVariable(void 0)}},{children:t(O,{width:24,height:24,color:h.colorsV2.content.primary})}))}))]})]}):t(o,{children:" "})]})},ee=(e,o)=>{var n,l,s,r,a,d,p,m,C,E;let v=[],g=[],h={},O={};B.useNewPicker?(h=e===k.ENTITLED?B.entitledProducts:B.prerequisiteProducts,O=null!==(n=e===k.ENTITLED?B.entitledCollections:B.prerequisiteCollections)&&void 0!==n?n:[],(null==h?void 0:h.isCustom)&&delete h.isCustom,(null==O?void 0:O.isCustom)&&delete O.isCustom,Object.values(h).forEach((e=>{Object.keys(e.products).forEach((i=>{v.push({id:i,name:e.products[i].name,image:e.products[i].image})}))})),Object.keys(O).forEach((e=>{"isCustom"!==e&&g.push({id:e,name:O[e].name,image:O[e].image})}))):(v=e===k.ENTITLED?B.entitledProducts:B.prerequisiteProducts,g=null!==(l=e===k.ENTITLED?B.entitledCollections:B.prerequisiteCollections)&&void 0!==l?l:[]);const P=e===k.PREREQUISITE?B.offerAppliesToBuy:B.offerAppliesToGet,I=e===k.PREREQUISITE?k.PREREQUISITE:k.ENTITLED,V=P===u.SPECIFIC_PRODUCTS?c.SPECIFIC_PRODUCTS:c.SPECIFIC_COLLECTIONS;return i("div",{children:[t(T,Object.assign({style:{marginBottom:16}},{children:e===k.PREREQUISITE?"Customer buys":"Customer gets"})),i("div",Object.assign({style:{display:"flex"}},{children:[!o&&t("div",{children:i("div",Object.assign({className:"input__rows"},{children:[t("div",Object.assign({className:"input__wrapper"},{children:t(y,{value:e===k.ENTITLED?null!==(r=null===(s=B.discountData.entitledQuantity)||void 0===s?void 0:s.toString())&&void 0!==r?r:"":null!==(d=null===(a=B.discountData.prerequisiteQuantity)||void 0===a?void 0:a.toString())&&void 0!==d?d:"",type:"number",onChangeText:i=>{e===k.ENTITLED?B.setDiscountData(Object.assign(Object.assign({},B.discountData),{entitledQuantity:parseInt(i)})):B.setDiscountData(Object.assign(Object.assign({},B.discountData),{prerequisiteQuantity:parseInt(i)}))},labelText:"Quantity of products",placeholder:"Eg. 2",width:"300px",errorMessage:e===k.PREREQUISITE&&(null===(p=B.dynamicDiscountValidationError)||void 0===p?void 0:p.inValidBuyXValue)||e===k.ENTITLED&&(null===(m=B.dynamicDiscountValidationError)||void 0===m?void 0:m.inValidGetYValue)?"Required Field":"",state:e===k.PREREQUISITE&&(null===(C=B.dynamicDiscountValidationError)||void 0===C?void 0:C.inValidBuyXValue)||e===k.ENTITLED&&(null===(E=B.dynamicDiscountValidationError)||void 0===E?void 0:E.inValidGetYValue)?"invalid":"none"})})),t("div",{className:"input__wrapper"})]}))}),i("div",{children:[t(b,Object.assign({style:{marginBottom:8}},{children:"Any items from"})),e===k.PREREQUISITE&&t(D,{width:"244px",options:H,placement:"bottom-start",onSelect:e=>{var i,t,o;B.setOfferAppliesToBuy(e.value),B.setPrerequisiteProducts([]),B.setPrerequisiteCollections([]),B.setPreRequisiteProductVariable(void 0),B.setDynamicDiscountValidationError((e=>Object.assign(Object.assign({},e),{inValidBuyXCollectionSelection:!1,inValidBuyXProductSelection:!1,inValidBuyXProductVariableSelection:!1}))),B.setDiscountData(Object.assign(Object.assign({},B.discountData),{prerequisiteCollectionIds:[],prerequisiteProductIds:[],collectionsConf:{entitledCollections:null===(i=B.discountData.collectionsConf)||void 0===i?void 0:i.entitledCollections,prerequisiteCollections:{}},productsConf:{entitledProducts:null===(t=B.discountData.productsConf)||void 0===t?void 0:t.entitledProducts,prerequisiteProducts:{}},productVariableConf:{entitledProductVariable:null===(o=B.discountData.productVariableConf)||void 0===o?void 0:o.entitledProductVariable,prerequisiteProductVariable:{}}}))}}),e===k.ENTITLED&&t(D,{width:"244px",options:J,placement:"bottom-start",onSelect:e=>{var i,t,o;B.setOfferAppliesToGet(e.value),B.setEntitledProducts([]),B.setEntitledCollections([]),B.setEntitledProductVariable(void 0),B.setDynamicDiscountValidationError((e=>Object.assign(Object.assign({},e),{inValidGetYCollectionSelection:!1,inValidGetYProductSelection:!1,inValidGetYProductVariableSelection:!1}))),B.setDiscountData(Object.assign(Object.assign({},B.discountData),{entitledCollectionIds:[],entitledProductIds:[],collectionsConf:{entitledCollections:{},prerequisiteCollections:null===(i=B.discountData.collectionsConf)||void 0===i?void 0:i.prerequisiteCollections},productsConf:{entitledProducts:{},prerequisiteProducts:null===(t=B.discountData.productsConf)||void 0===t?void 0:t.prerequisiteProducts},productVariableConf:{entitledProductVariable:{},prerequisiteProductVariable:null===(o=B.discountData.productVariableConf)||void 0===o?void 0:o.prerequisiteProductVariable}}))}})]})]})),K(V,I,e===k.PREREQUISITE?"buyX":"getY")]})};return i(x,Object.assign({style:B.noTopMargin?{marginTop:0}:{}},{children:[i("div",{children:[i("div",Object.assign({style:{display:"flex",gap:16}},{children:[t("div",Object.assign({className:"input__wrapper"},{children:t(y,{value:null!==(M=B.discountData.title)&&void 0!==M?M:"",onChangeText:e=>{var i;B.setDiscountData(Object.assign(Object.assign({},B.discountData),{title:null!==(i=null==e?void 0:e.trim())&&void 0!==i?i:""}))},maxCharLimit:30,labelText:"Discount Coupon Title",placeholder:`Eg. “Flat ${null!==(G=B.currency)&&void 0!==G?G:""} 15 Off”`,hintText:"Will be same for everyone. Can’t be changed later",width:"300px",isRequired:!0,errorMessage:(null===(Q=B.dynamicDiscountValidationError)||void 0===Q?void 0:Q.invalidCouponTitle)?"Required Field":"",state:(null===(X=B.dynamicDiscountValidationError)||void 0===X?void 0:X.invalidCouponTitle)?"invalid":"none"})})),!B.hideProbability&&t(y,{value:null!==($=null===(Y=B.discountData.probability)||void 0===Y?void 0:Y.toString())&&void 0!==$?$:"",type:"number",onChangeText:e=>{B.setDiscountData(Object.assign(Object.assign({},B.discountData),{probability:e.startsWith(".")?parseFloat(parseFloat(`0${e}`).toFixed(2)):parseFloat(parseFloat(e).toFixed(2))}))},labelText:"Probability of getting coupon ",hintText:"Enter a decimal value between 0-1",placeholder:"Eg. 0.5",maxCharLimit:4,width:"300px",isRequired:!0,errorMessage:(null===(W=B.dynamicDiscountValidationError)||void 0===W?void 0:W.inValidProbability)?"Required Field":"",state:(null===(z=B.dynamicDiscountValidationError)||void 0===z?void 0:z.inValidProbability)?"invalid":"none"})]})),t("div",{style:{height:"1px",width:"100%",background:h.colorsV2.stroke.primary,margin:"24px 0 8px"}})]}),B.allowStaticCoupon&&t((()=>i("div",{children:[t(g,{children:"Discount Details"}),t(R,{children:B.discountDetailsOptions.map((t=>{return i(_,Object.assign({selected:B.selectedDiscountDetails.id===t.id,onClick:()=>(i=>{if(B.selectedDiscountDetails.id!==i.id)if(B.resetValidationErrors(),B.setValidationErrorMessage(""),B.setDiscountCouponAppliesTo(c.ENTIRE_ORDER),B.setSelectedDiscountDetails(i),B.setDiscountData(Object.assign(Object.assign({},B.discountData),{value:void 0})),B.setPreRequisiteProductVariable(void 0),B.setEntitledProductVariable(void 0),["percentage","amount"].includes(i.value)){B.onChangeCouponType({label:"Amount off on order",selected:!0,value:p.AMOUNT_OFF_ORDER});const t=Object.assign(Object.assign({},B.discountData),{valueType:"percentage"===i.value?C.PERCENTAGE:C.FIXED_AMOUNT,value:void 0,targetType:E.LINE_ITEM,targetSelection:v.ALL,entitledCollectionIds:[],entitledProductIds:[],prerequisiteCollectionIds:[],prerequisiteProductIds:[],collectionsConf:{entitledCollections:{},prerequisiteCollections:{}},productsConf:{entitledProducts:{},prerequisiteProducts:{}},productVariableConf:{entitledProductVariable:{},prerequisiteProductVariable:{}}}),o=e(t,["entitledQuantity","prerequisiteQuantity"]);B.setDiscountData(o)}else B.onChangeCouponType({label:i.label,selected:!0,value:i.value})})(t)},{children:[t.icon((o=t.id,B.selectedDiscountDetails.id===o?h.colorsV2.stroke.brand:h.colorsV2.text.secondary)),t.label]}),t.id);var o}))})]})),{}),(B.selectedCouponType===p.AMOUNT_OFF_ORDER||B.selectedCouponType===p.AMOUNT_OFF_PRODUCTS)&&(()=>{var e,n,l,s,r,a;return i(o,{children:[t("div",Object.assign({className:"input__rows"},{children:t("div",Object.assign({className:"input__wrapper"},{children:t(y,{value:null!==(l=null===(n=null===(e=B.discountData)||void 0===e?void 0:e.value)||void 0===n?void 0:n.toString())&&void 0!==l?l:"",labelText:"Discount amount",type:"number",width:"300px",onChangeText:e=>{B.setDiscountData(Object.assign(Object.assign({},B.discountData),{value:parseInt(e)}))},placeholder:"15",prefixText:B.discountData.valueType===C.FIXED_AMOUNT?null!==(s=B.currency)&&void 0!==s?s:"":void 0,suffixText:B.discountData.valueType===C.PERCENTAGE?"%":void 0,errorMessage:(null===(r=B.dynamicDiscountValidationError)||void 0===r?void 0:r.inValidDiscountAmount)?"Required Field":"",state:(null===(a=B.dynamicDiscountValidationError)||void 0===a?void 0:a.inValidDiscountAmount)?"invalid":"none"})}))})),t("div",Object.assign({style:{paddingTop:"24px",marginTop:16,borderTop:`1px solid ${h.colorsV2.stroke.primary}`}},{children:i("div",Object.assign({className:"input__wrapper"},{children:[t(g,Object.assign({style:{marginBottom:10}},{children:"Applies to"})),t("div",Object.assign({style:{display:"flex",flexGrow:0,flexShrink:0,flexBasis:"auto"}},{children:t(D,{width:"300px",options:Z,placement:"bottom-start",onSelect:e=>{const i="value"in e&&e.value===c.ENTIRE_ORDER?{label:"Amount off on order",selected:!0,value:p.AMOUNT_OFF_ORDER}:{label:"Amount off on products",selected:!0,value:p.AMOUNT_OFF_PRODUCTS};B.onChangeCouponType(i),B.setDiscountCouponAppliesTo(e.value),B.setEntitledProductVariable(void 0),B.setDynamicDiscountValidationError((e=>Object.assign(Object.assign({},e),{inValidProductVariableSelection:!1,inValidProductSelection:!1,inValidCollectionSelection:!1})))}})})),(B.discountCouponAppliesTo===c.SPECIFIC_PRODUCTS||B.discountCouponAppliesTo===c.SPECIFIC_COLLECTIONS)&&K(B.discountCouponAppliesTo,k.ENTITLED,"couponAppliesTo")]}))}))]})})(),B.selectedCouponType===p.BUY_X_GET_Y&&(()=>{var e,o,n,l,s;return i(x,Object.assign({style:{border:`1px solid ${h.colorsV2.stroke.primary}`,padding:"16px",borderRadius:"4px",margin:0}},{children:[ee(k.PREREQUISITE),t("div",{style:{width:"100%",height:"1px",backgroundColor:h.colorsV2.stroke.primary,margin:"8px 0"}}),ee(k.ENTITLED),t(b,Object.assign({style:{marginTop:"8px"}},{children:"At a discounted value"})),t("div",{children:t(P,{label:"Free",isActive:100===B.discountData.value,onValueChange:e=>{e?B.setDiscountData(Object.assign(Object.assign({},B.discountData),{value:100})):B.setDiscountData(Object.assign(Object.assign({},B.discountData),{value:void 0}))}})}),i("div",Object.assign({style:{display:"flex",flexDirection:"column"}},{children:[t(P,{label:"Percentage off",isActive:100!==B.discountData.value,onValueChange:()=>{B.setDiscountData(Object.assign(Object.assign({},B.discountData),{value:void 0}))}}),100!==B.discountData.value&&t("div",Object.assign({style:{marginTop:8}},{children:t(y,{value:null!==(n=null===(o=null===(e=B.discountData)||void 0===e?void 0:e.value)||void 0===o?void 0:o.toString())&&void 0!==n?n:"",onChangeText:e=>{B.setDiscountData(Object.assign(Object.assign({},B.discountData),{value:parseInt(e)}))},type:"number",placeholder:"Eg. 50",suffixText:"%",width:"300px",errorMessage:(null===(l=B.dynamicDiscountValidationError)||void 0===l?void 0:l.inValidDiscountAmount)?"Required Field":"",state:(null===(s=B.dynamicDiscountValidationError)||void 0===s?void 0:s.inValidDiscountAmount)?"invalid":"none"})}))]}))]}))})(),!B.selectedCouponType&&t(U,{}),B.allowStaticCoupon&&B.selectedCouponType!==p.BUY_X_GET_Y&&t("div",Object.assign({style:{padding:"24px 0 16px",marginTop:16,borderTop:`1px solid ${h.colorsV2.stroke.primary}`}},{children:t(q,{selectedMinimumRequirement:B.selectedMinimumRequirement,setSelectedMinimumRequirement:B.setSelectedMinimumRequirement,discountData:B.discountData,setDiscountData:B.setDiscountData,currency:B.currency,dynamicDiscountValidationError:B.dynamicDiscountValidationError})})),B.selectedCouponType&&!B.hideExpiration&&i("div",Object.assign({style:{padding:B.selectedCouponType!==p.BUY_X_GET_Y?"24px 0 16px":"8px 0",borderTop:B.selectedCouponType!==p.BUY_X_GET_Y?`1px solid ${h.colorsV2.stroke.primary}`:"none"}},{children:[t(d,{label:"Add expiration",isDisabled:!!B.makeExpiryMandatory,isChecked:B.isAddExpirationChecked,onValueChange:e=>{B.setIsAddExpirationChecked(e),B.setDiscountData(Object.assign(Object.assign({},B.discountData),{expireAfter:void 0,expireAt:void 0})),B.setSelectedExpiration(B.isUsageFromStatic?m.FIXED_EXPIRATION:m.DYNAMIC_EXPIRATION)},boldOnChecked:!0,labelSize:"DEFAULT"}),t(b,Object.assign({style:{color:h.colorsV2.text.secondary,marginLeft:28}},{children:"Make coupon only valid till a certain time"})),B.isAddExpirationChecked&&t(f,{discountData:B.discountData,setDiscountData:B.setDiscountData,isAddExpirationChecked:B.isAddExpirationChecked,inValidCouponExpiry:B.dynamicDiscountValidationError.inValidCouponExpiry,selectedExpiration:B.selectedExpiration,setSelectedExpiration:B.setSelectedExpiration,hideExpirationOptions:B.isUsageFromStatic})]}))]}))};export{k as DISCOUNT_PRODUCTS,B as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as e,Fragment as t,jsx as n}from"react/jsx-runtime";import{CheckBox as i}from"../../checkBox/CheckBox.js";import"../../dropdown/DropdownPopover/index.js";import{Dropdown as o}from"../../dropdown/Dropdown.js";import"../../dropdown/ChipDropdown.js";import"react";import"../../zeroState/ZeroState.js";import
|
|
1
|
+
import{jsxs as e,Fragment as t,jsx as n}from"react/jsx-runtime";import{CheckBox as i}from"../../checkBox/CheckBox.js";import"../../dropdown/DropdownPopover/index.js";import{Dropdown as o}from"../../dropdown/Dropdown.js";import"../../dropdown/ChipDropdown.js";import"react";import"../../zeroState/ZeroState.js";import{BodySecondary as m}from"../../TypographyStyle.js";import{DEFAULT_THEME as s}from"../../../constants/Theme.js";import"../../dropdown/OpenedDropdown/components/description/Description.styled.js";import"../../list-item/ListItem.js";import"../../dropdown/OpenedDropdown/components/menu/FreeFormMenu.styled.js";import"../../dropdown/OpenedDropdown/components/menu/MenuItem.js";import"../../dropdown/OpenedDropdown/components/menu/MenuList.styled.js";import"../../button/Button.js";import"../../dropdown/OpenedDropdown/components/multiSelect/MultiSelectDropdownBottomBar.styled.js";import"../../dropdown/OpenedDropdown/components/OpennedDropdown.styled.js";import"../../icon-button/IconButton.js";import{Input as r}from"../../input/Input.js";import"../../dropdown/MenuItem/MenuItem.js";import{MIN_PURCHASE_REQUIREMENT as d}from"../type.js";const u=u=>{var a,c,l,p,M,j,v,D,O;const b=[{selected:u.selectedMinimumRequirement===d.AMOUNT,label:"Minimum order value",value:d.AMOUNT},{selected:u.selectedMinimumRequirement===d.QUANTITY,label:"Minimum number of items",value:d.QUANTITY}];return e(t,{children:[n(i,{label:"Minimum Purchase Requirements",isChecked:u.selectedMinimumRequirement!==d.NA,onValueChange:e=>{e?(u.setSelectedMinimumRequirement(d.AMOUNT),u.setDiscountData(Object.assign(Object.assign({},u.discountData),{minQuantity:void 0,minAmount:void 0}))):(u.setSelectedMinimumRequirement(d.NA),u.setDiscountData(Object.assign(Object.assign({},u.discountData),{minQuantity:void 0,minAmount:void 0})))},boldOnChecked:!0,labelSize:"DEFAULT"}),n(m,Object.assign({style:{color:s.colorsV2.text.secondary,marginLeft:28}},{children:"Enable coupon only after a minimum order value"})),u.selectedMinimumRequirement!==d.NA&&e("div",Object.assign({style:{margin:"16px 0 0 28px"},className:"input__rows"},{children:[e("div",Object.assign({className:"input__wrapper"},{children:[n(m,Object.assign({style:{marginBottom:10}},{children:"Requirements"})),n(o,{options:b,placement:"bottom-start",onSelect:e=>{const t=e.value;u.setSelectedMinimumRequirement(t),u.setDiscountData(Object.assign(Object.assign({},u.discountData),{minQuantity:void 0,minAmount:void 0}))},truncatedText:!1,width:"272px"})]})),n("div",Object.assign({className:"input__wrapper"},{children:n(r,{value:u.selectedMinimumRequirement===d.AMOUNT?null!==(c=null===(a=u.discountData.minAmount)||void 0===a?void 0:a.toString())&&void 0!==c?c:"":null!==(p=null===(l=u.discountData.minQuantity)||void 0===l?void 0:l.toString())&&void 0!==p?p:"",onChangeText:e=>{u.selectedMinimumRequirement===d.AMOUNT?u.setDiscountData(Object.assign(Object.assign({},u.discountData),{minAmount:parseInt(e)})):u.selectedMinimumRequirement===d.QUANTITY&&u.setDiscountData(Object.assign(Object.assign({},u.discountData),{minQuantity:parseInt(e)}))},labelText:u.selectedMinimumRequirement===d.AMOUNT?"Minimum amount":"Minimum no. of items",prefixText:u.selectedMinimumRequirement===d.AMOUNT?null!==(M=u.currency)&&void 0!==M?M:"":void 0,type:"number",placeholder:u.selectedMinimumRequirement===d.AMOUNT?"Eg. 5000":"Eg. 5",errorMessage:(null===(j=u.dynamicDiscountValidationError)||void 0===j?void 0:j.inValidMinimumAmount)||(null===(v=u.dynamicDiscountValidationError)||void 0===v?void 0:v.inValidMinimumQuantity)?"Required Field":"",state:(null===(D=u.dynamicDiscountValidationError)||void 0===D?void 0:D.inValidMinimumAmount)||(null===(O=u.dynamicDiscountValidationError)||void 0===O?void 0:O.inValidMinimumQuantity)?"invalid":"none"})}))]}))]})};export{u as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__rest as e}from"../../_virtual/_tslib.js";import{
|
|
1
|
+
import{__rest as e}from"../../_virtual/_tslib.js";import{jsxs as o,Fragment as n,jsx as l}from"react/jsx-runtime";import{useState as t,useRef as i,useEffect as r}from"react";import{COLORS as s}from"../../constants/Theme.js";import a from"../../assets/icons/chevronDown.svg.js";import{Input as d}from"../input/Input.js";import{InputStyleContext as c}from"../input/context/InputStyleProvider.js";import p from"./ChipInput.js";import{DropdownPopover as u}from"./DropdownPopover/index.js";import{getSelectedOptionsAsText as h}from"./OpenedDropdown/utils/iterationOnOptions.js";function m(){}const v=v=>{var f,g,x,b,w,{placeHolder:j,size:y,onSelect:I,defaultOptions:O,disabled:S,noErrorHint:H,placeHolderHeight:C,showPlaceholderWhenSelected:E=!1,inputStyle:T={},inputType:D="default",onDeleteChip:P,truncatedText:W,showLeadingIconInPlaceholder:M=!1,showTrailingIconPlaceholder:L=!1,showLabelsOnMoreHover:z=!1,value:k}=v,A=e(v,["placeHolder","size","onSelect","defaultOptions","disabled","noErrorHint","placeHolderHeight","showPlaceholderWhenSelected","inputStyle","inputType","onDeleteChip","truncatedText","showLeadingIconInPlaceholder","showTrailingIconPlaceholder","showLabelsOnMoreHover","value"]);const[_,F]=t(!1),[N,U]=t(!1),V=null!=y?y:"default",$=i(),[q,B]=t(null!=O?O:[]),G=i(null),[J,K]=t(null);r((()=>{var e;const o=[];null===(e=null==A?void 0:A.options)||void 0===e||e.forEach((e=>{e.options?e.options.forEach((e=>{e.selected&&o.push(Object.assign(Object.assign({},e),{label:e.label}))})):e.selected&&o.push(e)})),B([...o])}),[A.options]),r((()=>{O&&B([...O])}),[O]);const Q=h(q),R=E?j:null!==(f=null!=Q?Q:j)&&void 0!==f?f:"Select an option";r((()=>{if(G.current){const e=G.current.scrollWidth;K(e+("x-small"===V?16:"small"===V?20:24)+2*("x-small"===V?16:12)+8+2)}}),[R,V]);const X=null!==(x=null!==(g=A.buttonWidth)&&void 0!==g?g:A.inputWidth)&&void 0!==x?x:"100%",Y=J?`${J}px`:X;return o(n,{children:[l("span",Object.assign({ref:G,style:{position:"absolute",visibility:"hidden",whiteSpace:"nowrap",fontSize:"x-small"===V?"12px":"small"===V?"14px":"16px",fontFamily:"Inter"}},{children:R})),l(c.Provider,Object.assign({value:{InputWrapper:Object.assign({height:C||("x-small"===V?24:"small"===V?32:48),width:Y,maxWidth:X,zIndex:1,cursor:"pointer",padding:"x-small"===V?"4px 8px":"6px 8px",backgroundColor:void 0!==k?"#C3E4C4":N?"#E0E0E0":"#ffffff",transition:"backgroundColor 0.3s ease"},T),input:{minHeight:"100%",maxWidth:"100%",color:void 0!==k?"#00580E":"inherit"}}},{children:l(u,Object.assign({"data-test":A["data-test"],ref:$,onSelect:function(e){Array.isArray(e)?B([...e]):B([e]),null==I||I(e)},disabled:S,onDropdownVisbilityChange:e=>F(e)},A,{children:o("div",Object.assign({onMouseEnter:()=>U(!0),onMouseLeave:()=>U(!1)},{children:["default"==D&&l(d,{version:A.version,noErrorHint:H,state:S?"disabled":"none",value:void 0===k?R:k,errorMessage:A.error,variant:V,placeholder:null!=j?j:"Select an option",onChangeText:m,leftIcon:M&&(null===(b=q[0])||void 0===b?void 0:b.leadingIcon)?{icon:()=>{var e;return l(n,{children:null===(e=q[0])||void 0===e?void 0:e.leadingIcon})}}:void 0,rightIcon:{icon:()=>{var e;return o("div",Object.assign({style:{display:"flex"}},{children:[L&&(null===(e=q[0])||void 0===e?void 0:e.trailingIcon),l(a,{style:{transform:_?"rotate(180deg)":"rotate(0deg)"},onClick:m,width:"x-small"===V?16:"small"===V?20:24,height:"x-small"===V?16:"small"===V?20:24,color:s.content.primary})]}))}},truncateText:null==W||W}),"chip"==D&&l(p,{placeholder:null!=j?j:"Select options",chips:q,onDeleteChip:e=>{null==P||P(e)},errorMessage:A.error,isDropdownOpened:_,sizeToUse:V,containerStyle:{width:null!==(w=A.width)&&void 0!==w?w:"100%",cursor:"pointer"},showLabelsOnMoreHover:z})]}))}))}))]})};v.displayName="Dropdown";export{v as Dropdown};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__rest as o}from"../../../_virtual/_tslib.js";import{jsx as e,Fragment as t,jsxs as
|
|
1
|
+
import{__rest as o}from"../../../_virtual/_tslib.js";import{jsx as e,Fragment as t,jsxs as n}from"react/jsx-runtime";import l,{useState as i,useRef as r,useImperativeHandle as s,useEffect as a}from"react";import{usePopper as d}from"react-popper";import{DropShadow as p}from"../../dropShadow/DropShadow.js";import{Tooltip as c}from"../../tooltips/Tooltip.js";import{OverLapAbs as v,OpenDropdownContainer as m}from"../Common.styled.js";import{OpenedDropdown as u}from"../OpenedDropdown/components/OpennedDropdown.js";const h=l.forwardRef(((l,h)=>{var{children:w,onDropdownVisbilityChange:b,version:g="1.0",tooltipContent:f,tooltipDirection:O,showTooltipArrow:j,isChildLoading:D,forceOpen:y}=l,C=o(l,["children","onDropdownVisbilityChange","version","tooltipContent","tooltipDirection","showTooltipArrow","isChildLoading","forceOpen"]);const S=h,[R,z]=i(!1),[E,x]=i(null),[A,L]=i(null),T=r(null),{styles:M,attributes:V}=d(E,A,{placement:C.placement,strategy:C.strategy}),_=o=>{var e,t;"2.0"===g&&C.isMultiSelect&&o&&(null===(e=C.onSelect)||void 0===e||e.call(C,[...o])),z(!1),null===(t=null==C?void 0:C.onClose)||void 0===t||t.call(C)};s(S,(()=>({openDropdown:R})),[]),a((()=>{(null==S?void 0:S.current)&&(S.current.openDropdown=R)}),[R]),a((()=>{null==b||b(R)}),[R]);const k=()=>n(t,{children:[n("div",Object.assign({style:{position:"relative"},ref:x},{children:[e(v,Object.assign({ref:T,allowEvents:C.allowEvents,disabled:C.disabled,onClick:o=>{var e;null===(e=C.onDropdownOpen)||void 0===e||e.call(C),R?(z(!1),o.preventDefault()):C.disabled||z(!0)},isChildLoading:D},{children:C.allowEvents?w:null})),C.allowEvents?null:w]})),(R||y)&&e(m,Object.assign({ref:L,style:Object.assign(Object.assign({},M.popper),{zIndex:3})},V.popper,{"data-test":C["data-test"]},{children:e(p,Object.assign({level:"z2",position:"down",style:{borderRadius:8}},{children:e(u,Object.assign({},C,{onSelect:o=>{var e;"2.0"===g&&C.isMultiSelect||(null===(e=C.onSelect)||void 0===e||e.call(C,o),z(!1))},onClose:_,version:g,headerRef:T,zeroState:null==C?void 0:C.zeroState,isDraggable:C.isDraggable,onOptionsReorder:C.onOptionsReorder}))}))}))]});return e(t,{children:R||y||void 0===f?k():e(c,Object.assign({body:f,placement:O,hideArrow:!j},{children:e("div",Object.assign({"data-test":C["data-test"]},{children:k()}))}))})}));h.displayName="DropdownPopover";export{h as DropdownPopover};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as e,jsx as t}from"react/jsx-runtime";import{
|
|
1
|
+
import{jsxs as e,jsx as t}from"react/jsx-runtime";import{useCallback as o,useState as n,useRef as r,useEffect as i}from"react";import{ZeroState as s}from"../../../zeroState/ZeroState.js";import{useOutside as l}from"../../../../hooks/useOutside.js";import{useDropdown as c}from"../../hooks/useDropdown.js";import{Description as u}from"./description/Description.js";import{FreeFormMenu as a}from"./menu/FreeFormMenu.js";import{MenuList as d}from"./menu/MenuList.js";import{SelectAllMenu as p}from"./menu/SelectAllMenu.js";import h from"./multiSelect/MultiSelectDropdownBottomBar.js";import{OpennedDropdownContainer as f,MenuListContainer as m}from"./OpennedDropdown.styled.js";import{SearchBox as b}from"./searchbox/SearchBox.js";import{SearchZeroState as g}from"./searchbox/SearchZeroState.js";const S=304,v=290,j=j=>{let{options:O,isSearchable:w,isMultiSelect:y,maxSelections:x,width:C,allowFreeForm:D,height:k,onClose:L,onSelect:M,onSearch:I,version:A,skipSorting:T,headerRef:E,hideSelectAll:B,primaryButtonText:F,onInfiniteScroll:H,onMultiSelectClear:R,onDropdownItemClick:q,buttonOptions:z,isSearchLoading:V,disableSearchOptions:W,disableSearchedOptionExcept:Z,useDefaultCursor:$,containerStyle:K={},zeroState:N,isDraggable:P=!1,onOptionsReorder:U,hideClearButton:G=!1}=j;const J=o((e=>{if(!P||!y)return e;const t=[],o=[];return e.forEach((e=>{if(e.options)o.push(e);else{e.selected?t.push(e):o.push(e)}})),[...t,...o]}),[P,y]),[Q,X]=n((()=>J(O))),Y=r(Q),_=r(!1),ee=r(U);i((()=>{X(J(O))}),[O,J]),i((()=>{Y.current=Q}),[Q]),i((()=>{ee.current=U}),[U]),i((()=>()=>{_.current&&ee.current&&ee.current(Y.current)}),[]);const te=o((e=>{const t=J(e);X(t),"2.0"===A?null==U||U(t):_.current=!0}),[U,J,A]),oe=P?Q:O,{dropdownOptions:ne,search:re,searchedString:ie,searchedOptions:se,onApplyHandler:le,selectAllHandler:ce,onMultiSelectClear:ue,onFreeFormSelect:ae,onMultiSelectApply:de,latestDropdownOptionsRef:pe,getSelectedOptions:he,getCurrentSelectionCount:fe}=c(A,oe,M,T||P,y,I,W,Z,x),[me,be]=n(null!=C?C:v),[ge,Se]=n(null),[ve,je]=n(-1),Oe=r(null),we=r([]),ye=r(null);l(Oe,(()=>{if(Se(null),y&&"2.0"===A){const e=he(pe.current);null==L||L(e)}else null==L||L(ne)}),[E,we]),i((()=>{const e=setTimeout((()=>{Oe.current&&Oe.current.focus({preventScroll:!0})}),0);return()=>clearTimeout(e)}),[]);i((()=>{const e=e=>{const t=(e=>{const t=[];return e.forEach((e=>{if(e.options)e.options.forEach((e=>{e.disabled||t.push(e)}));else{const o=e;o.disabled||t.push(o)}})),t})(ie&&I?se:ne);if(0!==t.length)if("ArrowDown"===e.key)e.preventDefault(),je((e=>{const o=e<t.length-1?e+1:0;return setTimeout((()=>{var e;const t=null===(e=ye.current)||void 0===e?void 0:e.querySelector(`[data-option-index="${o}"]`);t&&t.scrollIntoView({block:"nearest",behavior:"smooth"})}),0),o}));else if("ArrowUp"===e.key)e.preventDefault(),je((e=>{const o=e>0?e-1:t.length-1;return setTimeout((()=>{var e;const t=null===(e=ye.current)||void 0===e?void 0:e.querySelector(`[data-option-index="${o}"]`);t&&t.scrollIntoView({block:"nearest",behavior:"smooth"})}),0),o}));else if("Enter"===e.key&&ve>=0){e.preventDefault();const o=t[ve];o&&(le(Object.assign(Object.assign({},o),{selected:!o.selected})),q&&q(o))}},t=Oe.current;if(t)return t.addEventListener("keydown",e),()=>{t.removeEventListener("keydown",e)}}),[ve,ie,se,ne,I,le,q]);const xe=null!=k?k:S,Ce="number"==typeof xe?w&&y?xe-96:w&&!y||!w&&y?xe-48:xe:xe;i((()=>{const e=null!=C?C:v;if(null===ge)be(e);else if("number"==typeof e)be(2*e);else if("string"==typeof e&&e.endsWith("px")){const t=2*parseInt(e.replace("px",""));be(t)}}),[ge]);const De=[],ke=(e=>{if(!y||!x&&0!==x)return e;const t=fe(e)>=x;return t?e.map((e=>{if(e.options)return Object.assign(Object.assign({},e),{options:e.options.map((e=>Object.assign(Object.assign({},e),{disabled:e.disabled||!e.selected&&t})))});{const o=e;return Object.assign(Object.assign({},o),{disabled:o.disabled||!o.selected&&t})}})):e})((ie&&I?se:ne).map((e=>{var t,o;if(ie&&!I){if(e.options){const t=Object.assign({},e);return t.options=t.options.filter((e=>{var t;return!!(null===(t=e.label)||void 0===t?void 0:t.toLowerCase().includes(ie.toLowerCase()))&&(De.push(!ie||e.label===ie),!0)})),t.options.length>0?t:null}return(null===(t=e.label)||void 0===t?void 0:t.toLowerCase().includes(ie.toLowerCase()))||(null===(o=e.searchKey)||void 0===o?void 0:o.toLowerCase().includes(ie.toLowerCase()))?(De.push(!ie||e.label===ie),e):null}return e})).filter((e=>null!==e))),Le=!!w&&ie&&0===ke.length;return e(f,Object.assign({version:A,ref:Oe,tabIndex:-1,style:Object.assign(Object.assign({width:me},K),{outline:"none"})},{children:[e("div",Object.assign({style:{width:ge?"50%":"100%",display:"flex",flexDirection:"column",background:"white"}},{children:[!!w&&t(b,{onSearch:re,version:A}),ke.length||ie?e(m,Object.assign({minHeight:xe,maxHeight:Ce,ref:ye},{children:[!!y&&!Le&&!B&&t(p,{version:A,options:ie&&I?se:ne,onSelect:ce}),!D&&Le&&t(g,{isLoading:V,height:Ce,searchedString:ie,containerWidth:C}),D&&(Le||!!De.length&&De.every((e=>!1===e)))&&t(a,{version:A,isMultiSelect:y,onSelect:ae,searchedString:ie}),t(d,{onInfiniteScroll:H,onDropdownItemClick:q,version:A,onSelect:le,showDescription:function(e,t){Se(e&&t?{title:e,description:t}:null)},isMultiSelect:y,options:ke,useDefaultCursor:$,ref:we,focusedIndex:ve,isDraggable:P,onOptionsReorder:te})]})):t("div",Object.assign({style:{height:xe,display:"flex"}},{children:t(s,Object.assign({},N,{title:(null==N?void 0:N.title)||"No results found",subTitle:(null==N?void 0:N.subTitle)||"Please try again later or contact us at support@bik.ai if you require further assistance."}))})),!!y&&!(!ke.length&&!ie)&&"2.0"!==A&&t(h,{onClear:()=>{ue(),null==R||R()},onApply:de,list:ie&&I?se:ne,buttonText:F,buttonOptions:z,hideClearButton:G})]})),!!ge&&t(u,{title:ge.title,description:ge.description,version:A})]}))};export{j as OpenedDropdown};
|
|
@@ -11,6 +11,12 @@ interface MenuItemProps {
|
|
|
11
11
|
useDefaultCursor?: boolean;
|
|
12
12
|
isFocused?: boolean;
|
|
13
13
|
dataIndex?: number;
|
|
14
|
+
isDraggable?: boolean;
|
|
15
|
+
onDragStart?: (e: React.DragEvent<HTMLDivElement>) => void;
|
|
16
|
+
onDragOver?: (e: React.DragEvent<HTMLDivElement>) => void;
|
|
17
|
+
onDrop?: (e: React.DragEvent<HTMLDivElement>) => void;
|
|
18
|
+
onDragEnd?: (e: React.DragEvent<HTMLDivElement>) => void;
|
|
19
|
+
isDraggedOver?: boolean;
|
|
14
20
|
}
|
|
15
21
|
export declare const MenuItem: import("react").ForwardRefExoticComponent<MenuItemProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
16
22
|
export {};
|
|
@@ -1,13 +1,43 @@
|
|
|
1
|
-
import{jsx as e,Fragment as
|
|
1
|
+
import{jsx as e,Fragment as n,jsxs as o}from"react/jsx-runtime";import t from"../../../../../assets/icons/chevronRight.svg.js";import{forwardRef as r,useState as i}from"react";import l from"styled-components";import{CheckBox as a}from"../../../../checkBox/CheckBox.js";import{ListItem as s}from"../../../../list-item/ListItem.js";import{Tooltip as d}from"../../../../tooltips/Tooltip.js";import{BodyCaption as c}from"../../../../TypographyStyle.js";import{DEFAULT_THEME as p,COLORS as g}from"../../../../../constants/Theme.js";import{FreeFormContainer as m}from"./FreeFormMenu.styled.js";const u=l(s)`
|
|
2
2
|
padding: ${e=>"2.0"===e.version?"8px 12px":"14px 16px"} !important;
|
|
3
3
|
cursor: pointer;
|
|
4
4
|
margin-top: ${e=>"2.0"===e.version?"2px":"0"};
|
|
5
|
-
`,v=
|
|
5
|
+
`,v=l.div`
|
|
6
6
|
box-shadow: 0px 2px 8px 0px rgba(0, 0, 0, 0.12);
|
|
7
|
-
border-radius: ${e=>{let{version:
|
|
8
|
-
padding: ${e=>{let{version:
|
|
7
|
+
border-radius: ${e=>{let{version:n}=e;return"1.0"===n?"0":"8px"}};
|
|
8
|
+
padding: ${e=>{let{version:n}=e;return"1.0"===n?"0":"4px"}};
|
|
9
9
|
min-width: 148px;
|
|
10
|
-
border: ${e=>{let{version:
|
|
10
|
+
border: ${e=>{let{version:n}=e;return"1.0"===n?`1px solid ${p.colorsV2.stroke.primary}`:"none"}};
|
|
11
11
|
max-height: 248px;
|
|
12
12
|
overflow-y: auto;
|
|
13
|
-
`,h=
|
|
13
|
+
`,h=l.div`
|
|
14
|
+
display: grid;
|
|
15
|
+
grid-template-columns: repeat(2, 2.86px);
|
|
16
|
+
grid-template-rows: repeat(3, 2.86px);
|
|
17
|
+
column-gap: 3.8px;
|
|
18
|
+
row-gap: 4px;
|
|
19
|
+
margin-right: 8px;
|
|
20
|
+
cursor: move;
|
|
21
|
+
flex-shrink: 0;
|
|
22
|
+
align-self: center;
|
|
23
|
+
height: fit-content;
|
|
24
|
+
min-height: 18px;
|
|
25
|
+
`,x=l.div`
|
|
26
|
+
width: 2.86px;
|
|
27
|
+
height: 2.86px;
|
|
28
|
+
border-radius: 50%;
|
|
29
|
+
background-color: ${g.content.inactive};
|
|
30
|
+
flex-shrink: 0;
|
|
31
|
+
`,b=l.div`
|
|
32
|
+
display: flex;
|
|
33
|
+
align-content: center;
|
|
34
|
+
justify-content: center;
|
|
35
|
+
gap: 8px;
|
|
36
|
+
`,f=l.div`
|
|
37
|
+
margin-right: -4px;
|
|
38
|
+
`,D=l.div`
|
|
39
|
+
display: flex;
|
|
40
|
+
align-items: center;
|
|
41
|
+
flex-direction: column;
|
|
42
|
+
flex: 1;
|
|
43
|
+
`,j=n=>{let{onDragStart:t,onDragEnd:r}=n;return o(h,Object.assign({draggable:!0,onDragStart:t,onDragEnd:r},{children:[e(x,{}),e(x,{}),e(x,{}),e(x,{}),e(x,{}),e(x,{})]}))},y=r(((r,l)=>{let{option:s,isMultiSelect:h,showDescription:x,onSelect:y,last:I,version:O,onDropdownItemClick:C,useDefaultCursor:k,isFocused:w=!1,dataIndex:T=-1,isDraggable:$=!1,onDragStart:S,onDragOver:E,onDrop:F,onDragEnd:M,isDraggedOver:L=!1}=r;var B;const[A,V]=i(s.selected),z=(e,n)=>{if(!e.children){R(!e.selected);const o=n?Object.assign(Object.assign({},e),{parent:n}):e;null==C||C(o)}},R=e=>{s.disabled||y(Object.assign(Object.assign({},s),{selected:e}))},U=k?{cursor:"default"}:{};return e(n,{children:e(d,Object.assign({body:"",tooltipContent:s.children?e("div",Object.assign({style:{backgroundColor:p.colorsV2.surface.standard},ref:l,onMouseEnter:()=>V(!0),onMouseLeave:()=>V(!1)},{children:e(v,Object.assign({version:null!=O?O:"2.0"},{children:s.children.map((n=>{var o;return e(u,{version:O,style:"1.0"!==O&&(null!==(o=null==s?void 0:s.children)&&void 0!==o?o:[]).length-1?{borderBottom:0}:{},onClick:e=>{e.preventDefault(),z(n,s)},listItem:{value:n.value,label:n.label},subText:n.subText,leadingIcon:n.leadingIcon||void 0,customComponent:n.customComponent,trailingIcon:n.trailingIcon||void 0,variant:s.disabled?"inactive":n.selected?"selected":"default"},n.value)}))}))})):e(n,{}),placement:"right-start",hideArrow:!0},{children:e(u,{version:O,style:I?Object.assign(Object.assign({borderBottom:0},U),L?{borderTop:`2px solid ${g.content.brand}`,opacity:.5}:{}):Object.assign(Object.assign({},U),L?{borderTop:`2px solid ${g.content.brand}`,opacity:.5}:{}),onClick:e=>{e.preventDefault(),z(s)},onMouseOver:()=>{s.description?x(s.label,s.description):x()},listItem:{value:s.value,label:s.label},subText:s.subText,"data-option-index":T,role:"option",id:`dropdown-option-${T}`,"aria-selected":!!s.selected,onDragOver:$?E:void 0,onDrop:$?F:void 0,leadingIcon:h?o(b,{children:[$&&e(j,{onDragStart:S,onDragEnd:M}),e(a,{size:"2.0"===O?"SMALL":"DEFAULT",isDisabled:null!==(B=s.disabled)&&void 0!==B&&B,isChecked:!!s.selected,onValueChange:R}),e(f,{children:s.leadingIcon})]}):$?o(D,{children:[e(j,{onDragStart:S,onDragEnd:M}),s.leadingIcon&&e("div",{children:s.leadingIcon})]}):s.leadingIcon?e(n,{children:s.leadingIcon}):void 0,customComponent:s.customComponent,trailingIcon:s.isFreeForm?e(m,{children:e(c,Object.assign({style:{color:g.content.secondary}},{children:"Freeform"}))}):s.children?e(t,{width:12,height:12}):s.trailingIcon?e(n,{children:s.trailingIcon}):void 0,variant:s.disabled?"inactive":w||s.selected||!h&&A?"selected":"default"})}))})}));export{y as MenuItem};
|
|
@@ -10,6 +10,8 @@ interface MenuListProps {
|
|
|
10
10
|
onDropdownItemClick?: (option: DropdownOption) => void;
|
|
11
11
|
useDefaultCursor?: boolean;
|
|
12
12
|
focusedIndex?: number;
|
|
13
|
+
isDraggable?: boolean;
|
|
14
|
+
onOptionsReorder?: (reorderedOptions: DropdownOption[]) => void;
|
|
13
15
|
}
|
|
14
16
|
export declare const MenuList: import("react").ForwardRefExoticComponent<MenuListProps & import("react").RefAttributes<HTMLDivElement[]>>;
|
|
15
17
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e,Fragment as n,jsxs as t}from"react/jsx-runtime";import{forwardRef as r,useRef as o,
|
|
1
|
+
import{jsx as e,Fragment as n,jsxs as t}from"react/jsx-runtime";import{forwardRef as r,useRef as o,useState as s,useCallback as l,useEffect as i}from"react";import{MenuItem as c}from"./MenuItem.js";import{StyledGroupedLabel as a}from"./MenuList.styled.js";const u=r(((r,u)=>{let{options:d,isMultiSelect:p,showDescription:f,onSelect:g,version:m,onInfiniteScroll:D,onDropdownItemClick:b,useDefaultCursor:v,focusedIndex:h=-1,isDraggable:I=!1,onOptionsReorder:w}=r;const j=o(null),S=o(null),[O,C]=s(null),[M,x]=s(null),y=l((()=>{j.current&&j.current.disconnect(),j.current=new IntersectionObserver((e=>{e[0].isIntersecting&&(null==D||D())})),S.current&&j.current.observe(S.current)}),[D]);i((()=>(y(),()=>{j.current&&j.current.disconnect()})),[y,d]);const E=l((e=>n=>{I&&(C(e),n.dataTransfer.effectAllowed="move")}),[I]),k=l((e=>n=>{I&&(n.preventDefault(),n.dataTransfer.dropEffect="move",x(e))}),[I]),T=l((e=>n=>{if(I&&null!==O){if(n.preventDefault(),O!==e){const n=[...d],t=n[O],r=n[e];if(t.selected===r.selected){const[t]=n.splice(O,1);n.splice(e,0,t),null==w||w(n)}}C(null),x(null)}}),[I,O,d,w]),F=l((()=>{C(null),x(null)}),[]),R=new Map;let $=-1;return d.forEach((e=>{if(e.options)e.options.forEach((e=>{e.disabled||($++,R.set(e,$))}));else{const n=e;n.disabled||($++,R.set(n,$))}})),e(n,{children:d.map(((n,r)=>{const o=r===d.length-1;if(n.options){const s=n;return t("div",Object.assign({style:{marginTop:"2.0"===m?2:0}},{children:[t(a,Object.assign({version:m},{children:[s.leadingIcon?e("span",Object.assign({style:{marginRight:8}},{children:s.leadingIcon})):null,s.label]})),s.options.map(((n,t)=>{const o=R.get(n),l=o===h&&!n.disabled;return e(c,{version:m,last:t===s.options.length-1,onSelect:g,showDescription:f,onDropdownItemClick:b,isMultiSelect:p,option:n,useDefaultCursor:v,isFocused:l,dataIndex:o,isDraggable:!1,ref:e=>{u&&"object"==typeof u&&u.current&&e&&e&&e&&e&&(u.current[r]=e)}},`${r}-${t}`)})),o?e("span",{ref:S}):null]}),r)}const s=n,l=R.get(s),i=l===h&&!s.disabled;return t("div",{children:[e(c,{version:m,last:o,onSelect:g,showDescription:f,onDropdownItemClick:b,isMultiSelect:p,option:s,useDefaultCursor:v,isFocused:i,dataIndex:l,isDraggable:I,onDragStart:E(r),onDragOver:k(r),onDrop:T(r),onDragEnd:F,isDraggedOver:M===r,ref:e=>{u&&"object"==typeof u&&u.current&&e&&(u.current[r]=e)}},s.value),o?e("span",{ref:S}):null]},r)}))})}));export{u as MenuList};
|
|
@@ -6,6 +6,7 @@ interface MultiSelectDropdownBottomBarProps {
|
|
|
6
6
|
list: DropdownOption[];
|
|
7
7
|
buttonText?: string;
|
|
8
8
|
buttonOptions?: ButtonOptions;
|
|
9
|
+
hideClearButton?: boolean;
|
|
9
10
|
}
|
|
10
11
|
declare const MultiSelectDropdownBottomBar: React.FC<MultiSelectDropdownBottomBarProps>;
|
|
11
12
|
export default MultiSelectDropdownBottomBar;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as t,jsx as e}from"react/jsx-runtime";import{Button as o}from"../../../../button/Button.js";import{BodySecondary as n}from"../../../../TypographyStyle.js";import{COLORS as r}from"../../../../../constants/Theme.js";import{BottomBarContainer as s}from"./MultiSelectDropdownBottomBar.styled.js";const l=l=>{const{onClear:i,onApply:p,list:a,buttonText:c,buttonOptions:y}=l,{primaryButtonText:
|
|
1
|
+
import{jsxs as t,jsx as e}from"react/jsx-runtime";import{Button as o}from"../../../../button/Button.js";import{BodySecondary as n}from"../../../../TypographyStyle.js";import{COLORS as r}from"../../../../../constants/Theme.js";import{BottomBarContainer as s}from"./MultiSelectDropdownBottomBar.styled.js";const l=l=>{const{onClear:i,onApply:p,list:a,buttonText:c,buttonOptions:u,hideClearButton:y}=l,{primaryButtonText:m,primaryButtonType:d,secondaryButtonText:f,secondaryButtonType:b}=null!=u?u:{},T=a.reduce(((t,e)=>{if(e.options){return t+e.options.filter((t=>!0===t.selected)).length}return e.selected?t+1:t}),0);return t(s,Object.assign({style:{justifyContent:"space-between"}},{children:[e(n,Object.assign({style:{flex:1,color:r.content.primary}},{children:T?`${T} selected`:""})),t("div",Object.assign({style:{flexDirection:"row",display:"flex",gap:12}},{children:[!y&&e(o,{size:"small",buttonType:b||"primary",buttonText:f||"Clear",onClick:i}),e(o,{size:"small",buttonText:m||c||"Apply",buttonType:d||"primary",onClick:()=>{p()}})]}))]}))};export{l as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import{useState as e,useRef as t,useEffect as s}from"react";import{iterateOnOptionsRaw as l,iterateOnOptions as n}from"../OpenedDropdown/utils/iterationOnOptions.js";const c=function(){let c=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"1.0",i=arguments.length>1?arguments[1]:void 0,o=arguments.length>2?arguments[2]:void 0,a=arguments.length>3?arguments[3]:void 0,r=arguments.length>4?arguments[4]:void 0,d=arguments.length>5?arguments[5]:void 0,u=arguments.length>6?arguments[6]:void 0,v=arguments.length>7&&void 0!==arguments[7]?arguments[7]:[],f=arguments.length>8?arguments[8]:void 0;const[p,g]=e(null!=i?i:[]),[b,O]=e([]),[j,h]=e(""),m=t(p);s((()=>{if(m.current=p,b.length&&j&&d){let e=[...b];const t=p.map((e=>{if(e.options)return e.options.map((e=>({value:e.value,selected:e.selected})));const t=e;return{value:t.value,selected:t.selected}})).flat();e=e.map((e=>{const s=t.find((t=>e.value===t.value));return s?Object.assign(Object.assign({},e),{selected:s.selected}):e})),u&&(e=e.map((e=>Object.assign(Object.assign({},e),{disabled:!v.includes(e.value)})))),O(r&&!a?[...e.sort((e=>e.selected?-1:1))]:[...e])}}),[p]),s((()=>{if(i){const e=[...i];g(r&&!a?[...e.sort((e=>e.selected?-1:1))]:[...e])}}),[i]);const w=e=>{const t=[];return e.forEach((e=>{if(e.options){const s=e.options.filter((e=>!0===e.selected));t.push(Object.assign(Object.assign({},e),{options:[...s]}))}else e.selected&&t.push(Object.assign({},e))})),t},C=e=>{let t=0;return e.forEach((e=>{e.options?t+=e.options.filter((e=>!0===e.selected)).length:e.selected&&t++})),t},S=e=>!(!r||!f&&0!==f)&&C(e)>=f;function F(e,t){if(r){if(e.selected&&f&&S(p))return;if(b.length&&j&&d)if(e.selected){if(f&&S(p))return;let s=!1;const l=n(p,{selected:e.selected},(t=>t.value===e.value&&(s=!0,!0)));if(s||l.push(e),t)return[...l];g([...l]),"2.0"===c&&L(l)}else{let s=!1,l=n(p,{selected:e.selected},(t=>t.value===e.value&&(s=!0,!0)));if(s&&(l=l.filter((t=>t.value!==e.value))),t)return[...l];g([...l]),"2.0"===c&&L(l)}else{const s=n(p,{selected:e.selected},(t=>t.value===e.value));if(t)return[...s];g([...s]),"2.0"===c&&L(s)}}else null==o||o(e)}function L(e){const t=w(null!=e?e:m.current);null==o||o([...t])}return{latestDropdownOptionsRef:m,dropdownOptions:p,search:function(e){if(h(e),O([]),e&&d){const t=[];l(p,(e=>{e.selected&&!t.includes(e.value)&&t.push(e.value)})),d(e).then((e=>{if(e){const s=e.map((e=>{if(e.options){const s=e;return Object.assign(Object.assign({},s),{options:s.options.map((e=>Object.assign(Object.assign({},e),{selected:t.includes(e.value)})))})}return Object.assign(Object.assign({},e),{selected:t.includes(e.value)})}));O([...s])}}))}},searchedString:j,searchedOptions:b,onApplyHandler:F,selectAllHandler:function(e){if(b.length&&j&&d)"selectAll"===e?function(e){let t=[...p];if(e&&f&&f>0){const e=C(t),s=f-e;if(s<=0)return;let l=0;b.forEach((e=>{if(l>=s)return;let n=!1;t=t.map((t=>{const s=e;return t.selected||t.disabled?t:void 0!==s.value&&s.value===t.value?(n=!0,l++,Object.assign(Object.assign({},t),{selected:!0})):t})),!n&&l<s&&(e.disabled||(t.push(Object.assign(Object.assign({},e),{selected:!0})),l++))})),g([...t]),"2.0"===c&&L(t)}}(!0):function(e){let t=[...p];e?b.forEach((e=>{let s=!1;t=t.map((t=>{const l=e;return void 0!==l.value&&l.value===t.value?(s=!0,Object.assign(Object.assign({},t),{selected:!0})):t})),s||t.push(Object.assign(Object.assign({},e),{selected:!0}))})):b.forEach((e=>{t=t.map((t=>{const s=e;return void 0!==s.value&&s.value===t.value?Object.assign(Object.assign({},t),{selected:!1}):t}))})),g([...t]),"2.0"===c&&L(t)}(!1);else if("selectAll"===e)if(f&&f>0){const e=C(p),t=f-e;if(t<=0)return;let s=0;const l=p.map((e=>{var l;if(e.options){const l=e;return Object.assign(Object.assign({},l),{options:l.options.map((e=>{var l;return e.disabled||e.selected||j&&!(null===(l=e.label)||void 0===l?void 0:l.toLowerCase().includes(j.toLowerCase()))?e:s<t?(s++,Object.assign(Object.assign({},e),{selected:!0})):e}))})}{const n=e;return n.disabled||(n.selected||j&&!(null===(l=n.label)||void 0===l?void 0:l.toLowerCase().includes(j.toLowerCase())))?e:s<t?(s++,Object.assign(Object.assign({},e),{selected:!0})):e}}));g([...l]),"2.0"===c&&L(l)}else{const e=n(p,{selected:!0},(e=>{var t;return j?(null===(t=e.label)||void 0===t?void 0:t.toLowerCase().includes(j.toLowerCase()))&&!e.disabled:!e.disabled}));g([...e]),"2.0"===c&&L(e)}else if("notSelected"===e){const e=n(p,{selected:!1},(e=>!e.disabled));g([...e]),"2.0"===c&&L(e)}},onMultiSelectClear:function(){const e=n(p,{selected:!1});g([...e]),"2.0"===c&&L(e)},onFreeFormSelect:function(e){if(!r)return void F({label:j,value:j,isFreeForm:!0,selected:!0});const t=p.map((t=>t.options?t:Object.assign(Object.assign({},t),{selected:t.label===j&&t.value===j?e:t.selected})));e&&(t.some((e=>e.label===j&&e.value===j))||t.unshift({label:j,value:j,isFreeForm:!0,selected:!0})),g([...t]),"2.0"===c&&L(t)},onMultiSelectApply:L,getSelectedOptions:w,getCurrentSelectionCount:C,isMaxSelectionsReached:S,maxSelections:f}};export{c as useDropdown};
|
|
@@ -8,6 +8,7 @@ export interface OpenDropdownProps {
|
|
|
8
8
|
error?: string;
|
|
9
9
|
isMultiSelect?: boolean;
|
|
10
10
|
maxSelections?: number;
|
|
11
|
+
inputWidth?: string;
|
|
11
12
|
width?: string;
|
|
12
13
|
height?: number | string;
|
|
13
14
|
allowFreeForm?: boolean;
|
|
@@ -39,6 +40,11 @@ export interface OpenDropdownProps {
|
|
|
39
40
|
title: string;
|
|
40
41
|
subTitle?: string;
|
|
41
42
|
};
|
|
43
|
+
/** Enable drag-and-drop reordering of options */
|
|
44
|
+
isDraggable?: boolean;
|
|
45
|
+
hideClearButton?: boolean;
|
|
46
|
+
/** Callback when options are reordered via drag-and-drop */
|
|
47
|
+
onOptionsReorder?: (reorderedOptions: DropdownOption[]) => void;
|
|
42
48
|
}
|
|
43
49
|
export type GroupedOption = {
|
|
44
50
|
label?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__rest as o}from"../../_virtual/_tslib.js";import{jsxs as t,jsx as n}from"react/jsx-runtime";import{DropdownPopover as r}from"../dropdown/DropdownPopover/index.js";import"../dropdown/Dropdown.js";import"../dropdown/ChipDropdown.js";import"react";import"../zeroState/ZeroState.js";import"
|
|
1
|
+
import{__rest as o}from"../../_virtual/_tslib.js";import{jsxs as t,jsx as n}from"react/jsx-runtime";import{DropdownPopover as r}from"../dropdown/DropdownPopover/index.js";import"../dropdown/Dropdown.js";import"../dropdown/ChipDropdown.js";import"react";import"../zeroState/ZeroState.js";import"../TypographyStyle.js";import"../../constants/Theme.js";import"../dropdown/OpenedDropdown/components/description/Description.styled.js";import"../checkBox/CheckBox.styled.js";import"../list-item/ListItem.js";import"../dropdown/OpenedDropdown/components/menu/FreeFormMenu.styled.js";import"../dropdown/OpenedDropdown/components/menu/MenuItem.js";import"../dropdown/OpenedDropdown/components/menu/MenuList.styled.js";import{Button as e}from"../button/Button.js";import"../dropdown/OpenedDropdown/components/multiSelect/MultiSelectDropdownBottomBar.styled.js";import"../dropdown/OpenedDropdown/components/OpennedDropdown.styled.js";import"../icon-button/IconButton.js";import"../input/Input.js";import"../dropdown/MenuItem/MenuItem.js";import{SpinnerColorMap as p}from"../button/themes.js";import{Spinner as s}from"../spinner/Spinner.js";import{DropdownButtonStyle as i,LoaderContainer as d}from"./DropdownButton.style.js";const m=m=>{var u,l;const a=m.buttonProps,c=o(a,["onClick"]);return t(i,Object.assign({type:m.buttonProps.buttonType,disabled:m.buttonProps.disabled},{children:[(null===(u=m.buttonProps)||void 0===u?void 0:u.isLoading)&&n(d,{children:n(s,{className:"spinner",size:"small",color:p(m.buttonProps.buttonType||"primary",m.buttonProps.inverse)})}),n(e,Object.assign({},m.buttonProps,{isLoading:!1,style:{borderRadius:"0px",borderTopLeftRadius:"4px",borderBottomLeftRadius:"4px",borderRight:"0px"}})),n("div",{className:"dd-button-divider"}),n(r,Object.assign({},m.dropdownProps,{isChildLoading:null===(l=m.buttonProps)||void 0===l?void 0:l.isLoading},{children:n(e,Object.assign({},c,{isLoading:!1,buttonText:"",TrailingIcon:m.iconProps,style:{borderRadius:"0px",borderTopRightRadius:"4px",borderBottomRightRadius:"4px"}}))}))]}))};export{m as DropdownButton};
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { InputStateI, InputTypeI, InputVariant } from "./Input";
|
|
3
3
|
export declare const InputWrapper: import("@emotion/styled").StyledComponent<{
|
|
4
4
|
theme?: import("@emotion/react").Theme | undefined;
|
|
5
|
-
as?: import("react").ElementType<any
|
|
5
|
+
as?: import("react").ElementType<any> | undefined;
|
|
6
6
|
} & {
|
|
7
7
|
width?: string | undefined;
|
|
8
8
|
height?: string | undefined;
|
|
@@ -16,7 +16,7 @@ export declare const InputWrapper: import("@emotion/styled").StyledComponent<{
|
|
|
16
16
|
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
17
17
|
export declare const IconHolder: import("@emotion/styled").StyledComponent<{
|
|
18
18
|
theme?: import("@emotion/react").Theme | undefined;
|
|
19
|
-
as?: import("react").ElementType<any
|
|
19
|
+
as?: import("react").ElementType<any> | undefined;
|
|
20
20
|
} & {
|
|
21
21
|
isLeft?: boolean | undefined;
|
|
22
22
|
iconSize?: string | undefined;
|
|
@@ -57,7 +57,7 @@ export declare const InputContainerSmall: import("@emotion/styled").StyledCompon
|
|
|
57
57
|
}, {}, {}>;
|
|
58
58
|
export declare const InputHeader: import("@emotion/styled").StyledComponent<{
|
|
59
59
|
theme?: import("@emotion/react").Theme | undefined;
|
|
60
|
-
as?: import("react").ElementType<any
|
|
60
|
+
as?: import("react").ElementType<any> | undefined;
|
|
61
61
|
} & {
|
|
62
62
|
invalid?: boolean | undefined;
|
|
63
63
|
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
@@ -91,7 +91,7 @@ export declare const InputFooter: import("@emotion/styled").StyledComponent<{
|
|
|
91
91
|
}, {}, {}>;
|
|
92
92
|
export declare const RootContainer: import("@emotion/styled").StyledComponent<{
|
|
93
93
|
theme?: import("@emotion/react").Theme | undefined;
|
|
94
|
-
as?: import("react").ElementType<any
|
|
94
|
+
as?: import("react").ElementType<any> | undefined;
|
|
95
95
|
} & {
|
|
96
96
|
width?: string | undefined;
|
|
97
97
|
height?: string | undefined;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
export declare const ChipStyle: import("@emotion/styled").StyledComponent<{
|
|
3
3
|
theme?: import("@emotion/react").Theme | undefined;
|
|
4
|
-
as?: import("react").ElementType<any
|
|
4
|
+
as?: import("react").ElementType<any> | undefined;
|
|
5
5
|
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import type { Variant } from './ListItem';
|
|
3
3
|
export declare const ListItem: import("@emotion/styled").StyledComponent<{
|
|
4
4
|
theme?: import("@emotion/react").Theme | undefined;
|
|
5
|
-
as?: import("react").ElementType<any
|
|
5
|
+
as?: import("react").ElementType<any> | undefined;
|
|
6
6
|
} & {
|
|
7
7
|
variant: Variant;
|
|
8
8
|
borderBottom?: string | undefined;
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
export declare const RootContainer: import("@emotion/styled").StyledComponent<{
|
|
3
3
|
theme?: import("@emotion/react").Theme | undefined;
|
|
4
|
-
as?: import("react").ElementType<any
|
|
4
|
+
as?: import("react").ElementType<any> | undefined;
|
|
5
5
|
} & {
|
|
6
6
|
zIndex?: number | undefined;
|
|
7
7
|
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
8
8
|
export declare const CentralContainer: import("@emotion/styled").StyledComponent<{
|
|
9
9
|
theme?: import("@emotion/react").Theme | undefined;
|
|
10
|
-
as?: import("react").ElementType<any
|
|
10
|
+
as?: import("react").ElementType<any> | undefined;
|
|
11
11
|
} & {
|
|
12
12
|
width?: string | undefined;
|
|
13
13
|
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
14
14
|
export declare const CloseButtonContainer: import("@emotion/styled").StyledComponent<{
|
|
15
15
|
theme?: import("@emotion/react").Theme | undefined;
|
|
16
|
-
as?: import("react").ElementType<any
|
|
16
|
+
as?: import("react").ElementType<any> | undefined;
|
|
17
17
|
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
18
18
|
export declare const CloseButtonWithTimer: import("@emotion/styled").StyledComponent<{
|
|
19
19
|
theme?: import("@emotion/react").Theme | undefined;
|
|
20
|
-
as?: import("react").ElementType<any
|
|
20
|
+
as?: import("react").ElementType<any> | undefined;
|
|
21
21
|
} & {
|
|
22
22
|
timerExists?: boolean | undefined;
|
|
23
23
|
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
export declare const Pagination: import("@emotion/styled").StyledComponent<{
|
|
3
3
|
theme?: import("@emotion/react").Theme | undefined;
|
|
4
|
-
as?: import("react").ElementType<any
|
|
4
|
+
as?: import("react").ElementType<any> | undefined;
|
|
5
5
|
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
export declare const DurationSelectorStyled: import("@emotion/styled").StyledComponent<{
|
|
3
3
|
theme?: import("@emotion/react").Theme | undefined;
|
|
4
|
-
as?: import("react").ElementType<any
|
|
4
|
+
as?: import("react").ElementType<any> | undefined;
|
|
5
5
|
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
@@ -30,11 +30,11 @@ type Props = {
|
|
|
30
30
|
};
|
|
31
31
|
export declare const HeaderWrapper: import("@emotion/styled").StyledComponent<{
|
|
32
32
|
theme?: import("@emotion/react").Theme | undefined;
|
|
33
|
-
as?: import("react").ElementType<any
|
|
33
|
+
as?: import("react").ElementType<any> | undefined;
|
|
34
34
|
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
35
35
|
export declare const BottomWrapper: import("@emotion/styled").StyledComponent<{
|
|
36
36
|
theme?: import("@emotion/react").Theme | undefined;
|
|
37
|
-
as?: import("react").ElementType<any
|
|
37
|
+
as?: import("react").ElementType<any> | undefined;
|
|
38
38
|
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
39
39
|
export declare const defaultTabs: {
|
|
40
40
|
key: string;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
export declare const SubscriptionPlanStyled: import("@emotion/styled").StyledComponent<{
|
|
3
3
|
theme?: import("@emotion/react").Theme | undefined;
|
|
4
|
-
as?: import("react").ElementType<any
|
|
4
|
+
as?: import("react").ElementType<any> | undefined;
|
|
5
5
|
} & {
|
|
6
6
|
isSelected: boolean;
|
|
7
7
|
isManifestPlan?: boolean | undefined;
|
|
8
8
|
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
9
9
|
export declare const NewSubscriptionStyled: import("@emotion/styled").StyledComponent<{
|
|
10
10
|
theme?: import("@emotion/react").Theme | undefined;
|
|
11
|
-
as?: import("react").ElementType<any
|
|
11
|
+
as?: import("react").ElementType<any> | undefined;
|
|
12
12
|
} & {
|
|
13
13
|
showMostPopularChip: boolean;
|
|
14
14
|
height?: string | undefined;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
export declare const StyledZeroState: import("@emotion/styled").StyledComponent<{
|
|
3
3
|
theme?: import("@emotion/react").Theme | undefined;
|
|
4
|
-
as?: import("react").ElementType<any
|
|
4
|
+
as?: import("react").ElementType<any> | undefined;
|
|
5
5
|
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
6
6
|
export declare const StyledProductPickerContainer: import("@emotion/styled").StyledComponent<{
|
|
7
7
|
theme?: import("@emotion/react").Theme | undefined;
|
|
8
|
-
as?: import("react").ElementType<any
|
|
8
|
+
as?: import("react").ElementType<any> | undefined;
|
|
9
9
|
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
@@ -8,7 +8,7 @@ export interface ProgressBarProps {
|
|
|
8
8
|
export declare const ProgressBarComponent: (props: ProgressBarProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
9
|
export declare const ProgressCompletedBar: import("@emotion/styled").StyledComponent<{
|
|
10
10
|
theme?: import("@emotion/react").Theme | undefined;
|
|
11
|
-
as?: import("react").ElementType<any
|
|
11
|
+
as?: import("react").ElementType<any> | undefined;
|
|
12
12
|
} & {
|
|
13
13
|
color: string;
|
|
14
14
|
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|