@bikdotai/bik-component-library 0.0.662-0 → 0.0.662-2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/components/QueryBuilder/components/QueryBuilderNodes.js +1 -1
- package/dist/cjs/components/ai-assist/AiAssist.d.ts +19 -0
- package/dist/cjs/components/ai-assist/AiAssist.style.d.ts +6 -0
- package/dist/cjs/components/ai-assist/Components/SelectionModal.d.ts +13 -0
- package/dist/cjs/components/ai-assist/constants.d.ts +3 -0
- package/dist/cjs/components/ai-assist/model.d.ts +41 -0
- package/dist/cjs/components/analytics-chips-and-dropdowns/chart/LineChart/LineChart.d.ts +0 -2
- package/dist/cjs/components/analytics-chips-and-dropdowns/chart/LineChart/LineChart.js +1 -1
- package/dist/cjs/components/analytics-chips-and-dropdowns/chart/Pie/PieChartAnalytics.js +1 -1
- package/dist/cjs/components/analytics-chips-and-dropdowns/chart/StackedBarChart/StackedBarChart.js +1 -1
- package/dist/cjs/components/analytics-chips-and-dropdowns/chart/StackedBarChart/StackedBarChart.model.d.ts +0 -2
- package/dist/cjs/components/analytics-chips-and-dropdowns/chart/StackedBarChart/StackedBarChart.styles.d.ts +0 -1
- package/dist/cjs/components/analytics-chips-and-dropdowns/chart/StackedBarChart/StackedBarChart.styles.js +2 -6
- package/dist/cjs/components/buttonGroup/ButtonGroup.d.ts +2 -0
- package/dist/cjs/components/buttonGroup/ButtonGroup.js +1 -1
- package/dist/cjs/components/buttonGroup/ButtonGroupStyle.d.ts +2 -0
- package/dist/cjs/components/buttonGroup/ButtonGroupStyle.js +2 -2
- package/dist/cjs/components/plans/NewSubscriptionPlan.js +1 -1
- package/dist/cjs/components/plans/SubscriptionPlan.d.ts +0 -1
- package/dist/cjs/components/plans/SubscriptionPlan.js +1 -1
- package/dist/cjs/components/product-picker-v2/modal.d.ts +0 -1
- package/dist/cjs/components/product-picker-v2/modal.js +1 -1
- package/dist/cjs/components/product-picker-v2/product.js +1 -1
- package/dist/cjs/components/product-picker-v2/productInfoOverlay.js +7 -7
- package/dist/cjs/components/product-picker-v2/productScreen.js +1 -1
- package/dist/cjs/components/product-picker-v2/style.d.ts +0 -11
- package/dist/cjs/components/product-picker-v2/style.js +18 -53
- package/dist/cjs/components/product-picker-v2/utility.d.ts +0 -1
- package/dist/cjs/components/product-picker-v2/utility.js +1 -1
- package/dist/cjs/components/product-picker-v2/variant.js +1 -1
- package/dist/cjs/components/side-modal/SideModal.d.ts +1 -0
- package/dist/cjs/components/side-modal/SideModal.js +1 -1
- package/dist/cjs/components/side-modal/SideModal.style.d.ts +1 -0
- package/dist/cjs/components/side-modal/SideModal.style.js +5 -5
- package/dist/cjs/components/text-picker/TextPickerCategoryCard.d.ts +13 -0
- package/dist/cjs/components/text-picker/TextPickerCategoryCard.js +13 -0
- package/dist/cjs/components/text-picker/TextPickerFooter.d.ts +6 -0
- package/dist/cjs/components/text-picker/TextPickerFooter.js +15 -0
- package/dist/cjs/components/text-picker/TextPickerItemRow.d.ts +11 -0
- package/dist/cjs/components/text-picker/TextPickerItemRow.js +17 -0
- package/dist/cjs/components/text-picker/TextPickerModal.d.ts +30 -0
- package/dist/cjs/components/text-picker/TextPickerModal.js +25 -0
- package/dist/cjs/components/text-picker/TextPickerSelectAllRow.d.ts +7 -0
- package/dist/cjs/components/text-picker/TextPickerSelectAllRow.js +17 -0
- package/dist/cjs/components/text-picker/index.d.ts +1 -0
- package/dist/cjs/index.d.ts +1 -0
- package/dist/cjs/index.js +1 -1
- package/dist/esm/components/QueryBuilder/components/QueryBuilderNodes.js +1 -1
- package/dist/esm/components/ai-assist/AiAssist.d.ts +19 -0
- package/dist/esm/components/ai-assist/AiAssist.style.d.ts +6 -0
- package/dist/esm/components/ai-assist/Components/SelectionModal.d.ts +13 -0
- package/dist/esm/components/ai-assist/constants.d.ts +3 -0
- package/dist/esm/components/ai-assist/model.d.ts +41 -0
- package/dist/esm/components/analytics-chips-and-dropdowns/chart/LineChart/LineChart.d.ts +0 -2
- package/dist/esm/components/analytics-chips-and-dropdowns/chart/LineChart/LineChart.js +1 -1
- package/dist/esm/components/analytics-chips-and-dropdowns/chart/Pie/PieChartAnalytics.js +1 -1
- package/dist/esm/components/analytics-chips-and-dropdowns/chart/StackedBarChart/StackedBarChart.js +1 -1
- package/dist/esm/components/analytics-chips-and-dropdowns/chart/StackedBarChart/StackedBarChart.model.d.ts +0 -2
- package/dist/esm/components/analytics-chips-and-dropdowns/chart/StackedBarChart/StackedBarChart.styles.d.ts +0 -1
- package/dist/esm/components/analytics-chips-and-dropdowns/chart/StackedBarChart/StackedBarChart.styles.js +1 -5
- package/dist/esm/components/buttonGroup/ButtonGroup.d.ts +2 -0
- package/dist/esm/components/buttonGroup/ButtonGroup.js +1 -1
- package/dist/esm/components/buttonGroup/ButtonGroupStyle.d.ts +2 -0
- package/dist/esm/components/buttonGroup/ButtonGroupStyle.js +12 -12
- package/dist/esm/components/plans/NewSubscriptionPlan.js +1 -1
- package/dist/esm/components/plans/SubscriptionPlan.d.ts +0 -1
- package/dist/esm/components/plans/SubscriptionPlan.js +1 -1
- package/dist/esm/components/product-picker-v2/modal.d.ts +0 -1
- package/dist/esm/components/product-picker-v2/modal.js +1 -1
- package/dist/esm/components/product-picker-v2/product.js +1 -1
- package/dist/esm/components/product-picker-v2/productInfoOverlay.js +7 -7
- package/dist/esm/components/product-picker-v2/productScreen.js +1 -1
- package/dist/esm/components/product-picker-v2/style.d.ts +0 -11
- package/dist/esm/components/product-picker-v2/style.js +16 -51
- package/dist/esm/components/product-picker-v2/utility.d.ts +0 -1
- package/dist/esm/components/product-picker-v2/utility.js +1 -1
- package/dist/esm/components/product-picker-v2/variant.js +1 -1
- package/dist/esm/components/side-modal/SideModal.d.ts +1 -0
- package/dist/esm/components/side-modal/SideModal.js +1 -1
- package/dist/esm/components/side-modal/SideModal.style.d.ts +1 -0
- package/dist/esm/components/side-modal/SideModal.style.js +16 -16
- package/dist/esm/components/text-picker/TextPickerCategoryCard.d.ts +13 -0
- package/dist/esm/components/text-picker/TextPickerCategoryCard.js +13 -0
- package/dist/esm/components/text-picker/TextPickerFooter.d.ts +6 -0
- package/dist/esm/components/text-picker/TextPickerFooter.js +15 -0
- package/dist/esm/components/text-picker/TextPickerItemRow.d.ts +11 -0
- package/dist/esm/components/text-picker/TextPickerItemRow.js +17 -0
- package/dist/esm/components/text-picker/TextPickerModal.d.ts +30 -0
- package/dist/esm/components/text-picker/TextPickerModal.js +25 -0
- package/dist/esm/components/text-picker/TextPickerSelectAllRow.d.ts +7 -0
- package/dist/esm/components/text-picker/TextPickerSelectAllRow.js +17 -0
- package/dist/esm/components/text-picker/index.d.ts +1 -0
- package/dist/esm/index.d.ts +1 -0
- package/dist/esm/index.js +1 -1
- package/package.json +1 -1
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import
|
|
1
|
+
import i from"styled-components";import{COLORS as e}from"../../constants/Theme.js";const t={small:"8px 12px",medium:"10px 12px",large:"14px 12px"},o={small:"36px",medium:"40px",large:"48px"},n=i.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
flex-direction: row;
|
|
4
|
-
width: ${
|
|
5
|
-
height: ${
|
|
6
|
-
gap: ${
|
|
7
|
-
`,r=
|
|
4
|
+
width: ${i=>i.width||"100%"};
|
|
5
|
+
height: ${i=>i.height?i.height:i.size?o[i.size]:"36px"};
|
|
6
|
+
gap: ${i=>i.gap||"12px"};
|
|
7
|
+
`,r=i.div`
|
|
8
8
|
display: flex;
|
|
9
|
-
flex-direction: ${
|
|
10
|
-
flex: ${
|
|
9
|
+
flex-direction: ${i=>"top"!==i.iconPosition?"left"===i.iconPosition?"row":"row-reverse":"column"};
|
|
10
|
+
flex: ${i=>i.matchParentWidth?1:"unset"};
|
|
11
11
|
height: 100%;
|
|
12
|
-
background: ${
|
|
12
|
+
background: ${i=>i.isActive?e.background.brandLight:i.backgroundColor};
|
|
13
13
|
border: 1px solid
|
|
14
|
-
${
|
|
15
|
-
border-radius: ${
|
|
14
|
+
${i=>i.isActive?e.background.inverseLight:e.stroke.primary};
|
|
15
|
+
border-radius: ${i=>i.borderRadius};
|
|
16
16
|
align-items: center;
|
|
17
17
|
justify-content: center;
|
|
18
|
-
padding: ${
|
|
19
|
-
gap: ${
|
|
18
|
+
padding: ${i=>i.size?t[i.size]:"8px 10px"};
|
|
19
|
+
gap: ${i=>i.iconGap?i.iconGap:i.iconPosition&&"top"!==i.iconPosition?"10px":"2px"};
|
|
20
20
|
.button {
|
|
21
21
|
align-items: center;
|
|
22
22
|
justify-content: center;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e,jsxs as t,Fragment as s}from"react/jsx-runtime";import i from"../../assets/icons/check.svg.js";import a from"../../assets/icons/checkCircle.svg.js";import n from"../../assets/icons/quotes.svg.js";import o from"../../assets/icons/WhiteStarFilled.svg.js";import{Button as r}from"../button/Button.js";import{NewSubscriptionStyled as l}from"./SubscriptionPlanStyled.js";import{Caption as c,TitleRegular as d,BodyCaption as h,TitleLarge as m,TitleSmall as p}from"../TypographyStyle.js";import{useCurrency as g}from"../../hooks/useCurreny.js";import{COLORS as b}from"../../constants/Theme.js";import{Tag as u}from"../tag/Tag.js";import{Tooltip as y}from"../tooltips/Tooltip.js";const j=j=>{var O;const{formatCurrency:f}=g(),v=j.showMonthlyOptions?j.features:j.annualFeatures||[],T=j.showMonthlyOptions?j.monthlyPlan:j.yearlyPlan,N=!j.isDisabled&&j.isMostPopular,x=j.showMonthlyOptions?j.code:null!==(O=j.yearlyCode)&&void 0!==O?O:j.code,{planName:P,isSelected:
|
|
1
|
+
import{jsx as e,jsxs as t,Fragment as s}from"react/jsx-runtime";import i from"../../assets/icons/check.svg.js";import a from"../../assets/icons/checkCircle.svg.js";import n from"../../assets/icons/quotes.svg.js";import o from"../../assets/icons/WhiteStarFilled.svg.js";import{Button as r}from"../button/Button.js";import{NewSubscriptionStyled as l}from"./SubscriptionPlanStyled.js";import{Caption as c,TitleRegular as d,BodyCaption as h,TitleLarge as m,TitleSmall as p}from"../TypographyStyle.js";import{useCurrency as g}from"../../hooks/useCurreny.js";import{COLORS as b}from"../../constants/Theme.js";import{Tag as u}from"../tag/Tag.js";import{Tooltip as y}from"../tooltips/Tooltip.js";const j=j=>{var O;const{formatCurrency:f}=g(),v=j.showMonthlyOptions?j.features:j.annualFeatures||[],T=j.showMonthlyOptions?j.monthlyPlan:j.yearlyPlan,N=!j.isDisabled&&j.isMostPopular,x=j.showMonthlyOptions?j.code:null!==(O=j.yearlyCode)&&void 0!==O?O:j.code,{planName:P,isSelected:S=!1,isDisabled:k=!1,onPlanSelect:C,oldPrice:M,hideMonthYearTag:w,planDescription:D,planDescriptionDiscount:L,showTrialOptions:F,freeTrialMessages:$,extraBlockMessage:z,isLoading:B,buttonText:H,bottomDescription:W,showMonthlyOptions:_,popularTestimony:I,skipRadioSelection:U=!1,includeText:Y,height:q,showFeaturesButton:A,businessDescription:R,isPlanSelected:E=!1,onClickShowAllFeatures:G,showSelectedPlanChip:J=!1,perMonthForYearly:K=!1,minHeightOfFeatures:Q,hoverTooltip:V}=j,X=e=>K&&!_?0==e?"$0":f(Math.round(e/12),"USD"):0==e?"$0":f(e,"USD");return e(y,Object.assign({body:V},{children:t(l,Object.assign({height:q,showMostPopularChip:N||!1,onClick:()=>C(x)},{children:[N&&t("div",Object.assign({className:"most-popular-chip"},{children:[e(c,Object.assign({className:"popular-text"},{children:"Most popular "})),e(o,{height:12,width:12})]})),t("div",Object.assign({className:`box ${k?"disabled":""} \n\t\t\t\t`},{children:[t("div",Object.assign({className:"radio-flex"},{children:[!U&&e("input",{type:"radio",id:"html",name:"fav_language",value:"HTML",disabled:null!=k&&k,onChange:()=>C(x),className:"radio-button",checked:E}),e(d,Object.assign({style:{color:b.content.secondary,marginBottom:4}},{children:P})),J&&e("div",Object.assign({style:{marginLeft:"auto"}},{children:e(u,{tagText:"Current plan",type:"positive",theme:"dark"})}))]})),t("div",Object.assign({className:"price-block"},{children:[M?e(h,Object.assign({className:"old--price"},{children:X(T.price)})):e(s,{}),e(m,Object.assign({style:{color:b.content.primary}},{children:X(M||T.price)})),e(c,Object.assign({style:{color:b.content.secondary,marginLeft:4}},{children:w?"":"/ "+(_?"month":K?"month billed annually":"year")}))]})),D&&t("div",Object.assign({className:"per-message-price"},{children:[e(h,Object.assign({style:{color:b.content.secondary}},{children:D})),L&&e(h,Object.assign({style:{color:b.background.positive.vibrant,marginLeft:4}},{children:L}))]})),R&&R.length&&e("div",Object.assign({style:{marginTop:4}},{children:R.map(((t,s)=>e(h,{style:{color:b.content.secondary},dangerouslySetInnerHTML:{__html:t}},s)))})),F&&t(c,Object.assign({className:"trial "+(S?"selected":"")},{children:["7 day free trial with ",$," messages"]})),z&&e(c,Object.assign({className:"trial "+(S?"selected":"")},{children:z})),e(p,Object.assign({className:"extra-include-margin",style:{height:Y?"":"20px"}},{children:Y||""})),e("div",Object.assign({className:"features",style:{minHeight:Q}},{children:v.map(((s,i)=>t("div",Object.assign({className:"feature"},{children:[e("div",{children:e(a,{height:20,width:20,color:b.content.primary})}),e(h,Object.assign({className:"feature-text"},{children:s.detail}),i)]}),s.detail)))})),A&&e(r,{isLoading:!1,buttonType:"tertiary",buttonText:"See all features",size:"small",onClick:e=>{e.stopPropagation(),G&&G()}}),U&&e("div",Object.assign({className:"button-box"},{children:B?e(r,{isLoading:!0,buttonType:"primary",buttonText:"Choose plan",size:"medium",matchParentWidth:!0}):t(s,{children:[S&&e(r,{disabled:k,LeadingIcon:i,buttonType:"tertiary",size:"medium",matchParentWidth:!0,buttonText:H||"Selected Plan"}),!S&&!k&&e(r,{buttonType:"primary",size:"medium",onClick:e=>{e.stopPropagation(),C(x)},matchParentWidth:!0,buttonText:H||"Choose plan"})]})})),I&&t("div",Object.assign({className:"popular-testimony"},{children:[e(n,{height:26,width:70}),e("div",Object.assign({className:"testimony-text"},{children:e("i",{children:I})}))]}))]})),W&&e("div",Object.assign({className:`plan-bottom-information\n\t\t\t\t\t${k?"disabled":""}\n\t\t\t\t\t${S?"selected":""}\n\t\t\t\t`},{children:e(c,Object.assign({className:"text",style:{color:b.background.inverse}},{children:W}))}))]}))}))};export{j as NewSubscriptionPlan};
|
|
@@ -31,7 +31,6 @@ export interface SubscriptionPlanProps {
|
|
|
31
31
|
hideMonthYearTag?: boolean;
|
|
32
32
|
buttonText?: string;
|
|
33
33
|
hoverTooltip?: string;
|
|
34
|
-
hidePriceBlock?: boolean;
|
|
35
34
|
}
|
|
36
35
|
type Props = SubscriptionPlanProps;
|
|
37
36
|
export declare const SubscriptionPlan: FunctionComponent<Props>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as e,jsx as t,Fragment as s}from"react/jsx-runtime";import i from"../../assets/icons/check.svg.js";import{Button as n}from"../button/Button.js";import{SubscriptionPlanStyled as a}from"./SubscriptionPlanStyled.js";import{Caption as c,TitleRegular as o,BodyCaption as r,TitleMedium as l,BodyPrimary as d}from"../TypographyStyle.js";import{useCurrency as m}from"../../hooks/useCurreny.js";import{COLORS as h}from"../../constants/Theme.js";const p=p=>{const{formatCurrency:b}=m(),g=p.showMonthlyOptions?p.features:p.annualFeatures||[],u=p.showMonthlyOptions?p.monthlyPlan:p.yearlyPlan,y=!p.isDisabled&&p.isMostPopular,j=e=>0==e?"$0":b(e,"USD");return e(a,Object.assign({isManifestPlan:!0,isSelected:p.isSelected||!1,style:{marginTop:y?0:24}},{children:[y&&t("div",Object.assign({className:"most-popular"},{children:t(c,Object.assign({className:"text"},{children:"Most popular ⭐️"}))})),e("div",Object.assign({className:`box ${p.isSelected?"selected":""} ${p.isDisabled?"disabled":""} ${y?"":"rounded-corners"}\n\t\t\t\t`},{children:[e("div",{children:[t(o,Object.assign({style:{color:h.content.secondary,marginBottom:4}},{children:p.planName})),
|
|
1
|
+
import{jsxs as e,jsx as t,Fragment as s}from"react/jsx-runtime";import i from"../../assets/icons/check.svg.js";import{Button as n}from"../button/Button.js";import{SubscriptionPlanStyled as a}from"./SubscriptionPlanStyled.js";import{Caption as c,TitleRegular as o,BodyCaption as r,TitleMedium as l,BodyPrimary as d}from"../TypographyStyle.js";import{useCurrency as m}from"../../hooks/useCurreny.js";import{COLORS as h}from"../../constants/Theme.js";const p=p=>{const{formatCurrency:b}=m(),g=p.showMonthlyOptions?p.features:p.annualFeatures||[],u=p.showMonthlyOptions?p.monthlyPlan:p.yearlyPlan,y=!p.isDisabled&&p.isMostPopular,j=e=>0==e?"$0":b(e,"USD");return e(a,Object.assign({isManifestPlan:!0,isSelected:p.isSelected||!1,style:{marginTop:y?0:24}},{children:[y&&t("div",Object.assign({className:"most-popular"},{children:t(c,Object.assign({className:"text"},{children:"Most popular ⭐️"}))})),e("div",Object.assign({className:`box ${p.isSelected?"selected":""} ${p.isDisabled?"disabled":""} ${y?"":"rounded-corners"}\n\t\t\t\t`},{children:[e("div",{children:[t(o,Object.assign({style:{color:h.content.secondary,marginBottom:4}},{children:p.planName})),e("div",Object.assign({className:"price-block"},{children:[p.oldPrice?t(r,Object.assign({className:"old--price"},{children:j(u.price)})):t(s,{}),t(l,Object.assign({style:{color:h.content.primary}},{children:p.oldPrice?j(p.oldPrice):j(u.price)})),t(d,Object.assign({style:{color:h.content.secondary,marginLeft:4}},{children:p.hideMonthYearTag?"":"/ "+(p.showMonthlyOptions?"month":"year")}))]})),e("div",Object.assign({className:"per-message-price"},{children:[p.planDescription&&t(r,Object.assign({style:{color:h.content.secondary}},{children:p.planDescription})),p.planDescriptionDiscount&&t(r,Object.assign({style:{color:h.background.positive.vibrant,marginLeft:4}},{children:p.planDescriptionDiscount}))]})),p.showTrialOptions&&e(c,Object.assign({className:"trial "+(p.isSelected?"selected":"")},{children:["7 day free trial with ",p.freeTrialMessages," messages"]})),p.extraBlockMessage&&t(c,Object.assign({className:"trial "+(p.isSelected?"selected":"")},{children:p.extraBlockMessage})),t("div",Object.assign({className:"features"},{children:g.map(((s,n)=>e("div",Object.assign({className:"feature"},{children:[t("div",{children:t(i,{height:12,width:12,color:h.content.primary})}),t(r,Object.assign({className:"feature-text"},{children:s.detail}),n)]}),s.detail)))}))]}),t("div",Object.assign({className:"button-box"},{children:p.isLoading?t(n,{isLoading:!0,buttonType:"primary",buttonText:"Choose plan",size:"medium",matchParentWidth:!0}):e(s,{children:[p.isSelected&&t(n,{disabled:p.isDisabled,LeadingIcon:i,buttonType:"tertiary",size:"medium",matchParentWidth:!0,buttonText:p.buttonText||"Selected Plan"}),!p.isSelected&&!p.isDisabled&&t(n,{buttonType:"primary",size:"medium",onClick:()=>p.onPlanSelect(p.code),matchParentWidth:!0,buttonText:p.buttonText||"Choose plan"})]})}))]})),p.bottomDescription&&t("div",Object.assign({className:`plan-bottom-information\n\t\t\t\t\t${p.isDisabled?"disabled":""}\n\t\t\t\t\t${p.isSelected?"selected":""}\n\t\t\t\t`},{children:t(c,Object.assign({className:"text",style:{color:h.background.inverse}},{children:p.bottomDescription}))}))]}))};export{p as SubscriptionPlan};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import c from"../../assets/icons/search.svg.js";import{useReducer as r,useState as s,useRef as i,useEffect as n}from"react";import{COLORS as l}from"../../constants/Theme.js";import d from"../../assets/icons/cross.svg.js";import{Button as a}from"../button/Button.js";import{Input as u}from"../input/Input.js";import{StyledModal as h}from"../modals/styledModal.js";import{Spinner as p}from"../spinner/Spinner.js";import{Tag as m}from"../tag/Tag.js";import{CollectionsScreen as
|
|
1
|
+
import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import c from"../../assets/icons/search.svg.js";import{useReducer as r,useState as s,useRef as i,useEffect as n}from"react";import{COLORS as l}from"../../constants/Theme.js";import d from"../../assets/icons/cross.svg.js";import{Button as a}from"../button/Button.js";import{Input as u}from"../input/Input.js";import{StyledModal as h}from"../modals/styledModal.js";import{Spinner as p}from"../spinner/Spinner.js";import{Tag as m}from"../tag/Tag.js";import{CollectionsScreen as C}from"./collectionScreen.js";import{ProductInfoOverlay as g}from"./productInfoOverlay.js";import{ProductsScreen as f}from"./productScreen.js";import{RearrangeScreen as y}from"./rearrangeScreen.js";import{collectionsReducer as b,searchReducer as S,selectedColectionsReducer as v,CollectionIdContext as k}from"./reducers.js";import{SearchScreen as j}from"./searchScreen.js";import{SelectedScreen as I}from"./selectedScreen.js";import{ContainerStyle as x,ScrollContainerStyle as P,StyledFooterForNonModal as O}from"./style.js";import{OUT_OF_STOCK_ACTION as D}from"./type.js";import{updateAllVariantsForSelectedProducts as F}from"./utility.js";var T;!function(e){e.Collections="collections",e.RearrangeProducts="rearrange",e.SelectedProducts="view",e.SearchProducts="searchProducts",e.Products="products"}(T||(T={}));const R=R=>{const{storeId:w,selectedItems:A,onClose:B,visible:E,zIndex:L,exactLimit:z,limit:V,hideCollectionCheckbox:$,hideProductCheckbox:M,outOfStockAction:H=D.BLUR,hideVariantCheckbox:W,selectProductsFromCustomCollection:G,hideSelectionCount:N,title:Y,width:K,left:U,renderWithoutModal:q,onClickSave:J,pickerType:Q,hideProductVariants:X=!1,startupScreen:Z=T.Collections,rearrangeEnabled:_,selectSingleItem:ee=!1,showProductDetails:te,containerStyle:oe,crossButtonInsideHeader:ce=!1,footerForNonModal:re={},primaryButton:se,secondaryButton:ie,subtitle:ne}=R,[le,de]=r(b,{}),[ae,ue]=s([T.Collections,T.RearrangeProducts].includes(Z)?Z:T.Collections),[he,pe]=s("grid"),[me,Ce]=s(""),[ge,fe]=s(""),[ye,be]=s(0),[Se,ve]=s(!1),[ke,je]=s(0),[Ie,xe]=s(""),[Pe,Oe]=s(!1),[De,Fe]=s(!1),[Te,Re]=r(S,{collections:{},products:{}}),[we,Ae]=r(v,Object.keys(A).length>0?A:{}),Be=i(null),[Ee,Le]=s(!1),[ze,Ve]=s();n((()=>{ve(!0),Fe(!0),R.collectionFetcher(ye,w).then((e=>{de({type:"fetched",data:(null==e?void 0:e.collections)||{}}),ve(!1),be((e=>e+1)),Fe(!1)})).catch()}),[]),n((()=>{let e=0;X?Object.keys(we||[]).forEach((t=>{var o;Object.keys((null===(o=we[t])||void 0===o?void 0:o.products)||[]).forEach((o=>{var c;"-1"!==t&&we[-1]&&(null===(c=we[-1].products)||void 0===c?void 0:c[o])||(e+=1)}))})):Object.keys(we||[]).forEach((t=>{var o;Object.keys((null===(o=we[t])||void 0===o?void 0:o.products)||[]).forEach((o=>{var c,r;Object.keys((null===(r=null===(c=we[t].products)||void 0===c?void 0:c[o])||void 0===r?void 0:r.variants)||[]).forEach((()=>{e+=1}))}))})),je(e)}),[le,we,X]),n((()=>{ge&&(ve(!0),R.productFetcher(ge,w).then((e=>{Object.keys(e).length&&de({type:"productsFetched",data:{collectionId:ge,products:e}}),ve(!1)})).catch())}),[ge]),n((()=>{const e=setTimeout((()=>{"rearrange"!==ae&&(Ie.length||"collections"!==ae)&&(Ie.length?(Oe(!0),R.searchFetcher(w,Ie).then((e=>{"collections"in e&&"products"in e?(Re({type:"set",data:e}),de({type:"searched",data:e.collections})):(Re({type:"set",data:{collections:{},products:e}}),de({type:"searched",data:e})),ue("searchProducts"),ve(!1),Oe(!1)}))):ue("collections"))}),800);return()=>clearTimeout(e)}),[Ie]),n((()=>{J&&(R.onAdd(we,ke),$e())}),[J]),n((()=>{ee&&Object.keys(we||{}).length&&ke&&(R.onAdd(we,ke),$e())}),[ee,we,ke]);const $e=()=>{Ae({type:"reset",data:{}})},Me=()=>z&&ke>z?t(m,{tagText:`You can only select ${z} products`,type:"negative"}):V&&ke>V?t(m,{tagText:`You can only select ${V} products`,type:"negative"}):t(a,ke>0?{onClick:()=>{ue(_?T.RearrangeProducts:T.SelectedProducts)},buttonText:z?`${ke}/${z} products selected`:`${ke} products selected`,buttonType:["rearrange","view"].includes(ae)?"tertiaryGray":"tertiary",disabled:["rearrange","view"].includes(ae)}:{disabled:!0,buttonText:z?`${ke}/${z} products selected`:`${ke} products selected`,buttonType:"tertiaryGray"}),He=e=>Se?"Loading...":ae===T.RearrangeProducts?null!=e?e:"Done":null!=e?e:"Add",We=e(x,Object.assign({style:null!=oe?oe:{}},{children:[R.postHeader&&t("div",Object.assign({style:{padding:"0 24px"}},{children:R.postHeader})),!R.hideGlobalSearch&&t(o,{children:("collections"===ae||"searchProducts"===ae)&&t("div",Object.assign({style:{padding:q?"8px 16px":"12px 24px",borderBottom:"1px solid #E0E0E0"}},{children:t(u,{placeholder:"Search for collections and products, or type a product ID",noKeyDownChange:!0,noErrorHint:!0,rightIcon:{icon:()=>Pe?t(p,{size:"small",color:l.content.primary}):t(c,{})},id:"listInput",height:"24px",type:"text",value:Ie,onChangeText:e=>{e.length&&e.trim().length?xe(e):xe("")}})}))}),e(P,Object.assign({ref:Be,screenName:ae},{children:["collections"===ae&&t(C,{customCollectionRestriction:R.customCollectionRestriction,dataLoading:De,collections:le,selectedCollectionsDispatch:Ae,setCollectionId:Ce,setSelectedCollectionId:fe,setScreen:ue,selectedCollections:we,collectionFetcher:R.collectionFetcher,storeId:w,collectionsDispatch:de,setSaveDisabled:ve,pagingControls:{curPage:ye,setCurPage:be},hideCollectionCheckbox:$,renderWithoutModal:q,pickerType:Q,scrollContainerRef:Be}),"products"===ae&&me&&t(k.Provider,Object.assign({value:me},{children:t(f,{hideInCollectionSearch:R.hideInCollectionSearch,customCollectionRestriction:R.customCollectionRestriction,productFetcher:R.productFetcher,setScreen:ue,storeId:w,data:le[me],collectionsDispatch:de,selectedCollectionsDispatch:Ae,selectedData:we,setSaveDisabled:ve,searchInCollectionFetcher:R.searchInCollectionFetcher,hideProductCheckbox:M,outOfStockAction:H,hideVariantCheckbox:W,selectProductsFromCustomCollection:G,renderWithoutModal:q,pickerType:Q,hideProductVariants:X,fbStatusFetcher:R.fbStatusFetcher,onProductDetailClick:e=>{Le(!0),Ve(e)},showProductDetailInfoIcon:te,scrollContainerRef:Be})})),"view"===ae&&t(I,{selectedCollections:we||{},selectedCollectionsDispatch:Ae,setScreen:ue,collections:le,hideProductVariants:X,outOfStockAction:H,storeId:w,fbStatusFetcher:R.fbStatusFetcher}),"rearrange"===ae&&t(y,{selectedCollections:we||{},selectedCollectionsDispatch:Ae,setScreen:ue,outOfStockAction:H,rearrangeViewType:"grid"===he?"list":"grid",scrollContainerRef:Be,storeId:w,fbStatusFetcher:R.fbStatusFetcher}),"searchProducts"===ae&&t(j,{customCollectionRestriction:R.customCollectionRestriction,selectedCollections:we||{},searchedCollections:Te||{},searchedCollectionsDispatch:Re,selectedCollectionsDispatch:Ae,setScreen:ue,collections:le,onBackPress:()=>{xe(""),Re({type:"set",data:{collections:{},products:{}}})},pickerType:Q,hideProductCheckbox:M,hideProductVariants:X,hideVariantCheckbox:W,storeId:w,fbStatusFetcher:R.fbStatusFetcher,setCollectionId:Ce,setSelectedCollectionId:fe,renderWithoutModal:q,hideCollectionCheckbox:$,outOfStockAction:H})]}))]}));return t(o,{children:q?e(o,{children:[We,re.renderFooter?e(O,{children:[Me(),t(a,{buttonText:He(re.primaryButtonText),disabled:!re.isLoading&&(Se||ke<1||z&&ke<z||!z&&V&&ke>V)||re.primaryButtonDisabled,isLoading:re.isLoading,onClick:()=>{R.onAdd(we,ke),$e(),ue([T.Collections,T.RearrangeProducts].includes(Z)?Z:T.Collections)}})]}):t(o,{}),Ee&&ze?t(g,{productData:ze,outOfStockAction:H,useDynamicInfoImageSize:R.useDynamicInfoImageSize,onClose:()=>{Le(!1)}}):t(o,{})]}):e(h,Object.assign({zIndex:L,open:E,onClose:()=>{null==B||B(),$e()},headingTitle:Y||("collections"===ae||"products"===ae?"Select Products":"view"===ae?"Selected Products":"searchProducts"===ae?"Searched Results":"rearrange"===ae?"Rearrange Products":void 0),headingSubtitle:ne,footerShadow:!0,centralContainerStyles:{width:K||"600px",left:U||"auto"},headerRightCustomElement:ce?t("div",Object.assign({style:{cursor:"pointer",display:"flex"},onClick:B},{children:t(d,{width:20,height:20,color:l.content.secondary})})):t(o,{}),footerContainerStyle:R.stickyFooter?{position:"absolute",bottom:0,left:0,width:"100%",zIndex:9,background:l.surface.standard}:void 0,primaryButton:se?(e=>Object.assign(Object.assign({},e),{disabled:!e.isLoading&&(Se||ke<1||z&&ke<z||!z&&V&&ke>V)||e.disabled,onClick:()=>{R.onAdd(we,ke),$e(),ue([T.Collections,T.RearrangeProducts].includes(Z)?Z:T.Collections)}}))(se):{buttonText:He(),disabled:Se||ke<1||z&&ke<z||!z&&V&&ke>V||!1,onClick:()=>{R.onAdd(we,ke),$e()}},secondaryButton:ie?(e=>Object.assign(Object.assign({},e),{disabled:Se||ke<1||z&&ke<z||!z&&V&&ke>V||!1,onClick:()=>{const e=F(we,le,Te);R.onAdd(e,ke,!0)}}))(ie):void 0,wrapperStyle:R.stickyFooter?{height:"calc(100vh - 168px)"}:void 0,footerLeftCustomElement:N?t(o,{}):Me(),hideCrossButton:Ee||ce},{children:[We,Ee&&ze?t(g,{productData:ze,useDynamicInfoImageSize:R.useDynamicInfoImageSize,outOfStockAction:H,onClose:()=>{Le(!1)}}):t(o,{})]}))})};export{R as ProductPickerModal,T as ScreenName};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as t,jsx as i,Fragment as o}from"react/jsx-runtime";import{COLORS as e}from"../../constants/Theme.js";import c from"../../assets/icons/info.svg.js";import{CheckBox as d}from"../checkBox/CheckBox.js";import{IconButton as n}from"../icon-button/IconButton.js";import{ShimmerImage as r}from"../shimmer-image/ShimmerImage.js";import{Tooltip as l}from"../tooltips/Tooltip.js";import{TitleSmall as a,BodyCaption as s}from"../TypographyStyle.js";import{CurrencySymbols as u}from"./constants.js";import{ProductHelper as v}from"./helpers/ProductHelper.js";import{ProductPickerTag as p}from"./ProductPickerTag.js";import{ProductCardStyle as h
|
|
1
|
+
import{jsxs as t,jsx as i,Fragment as o}from"react/jsx-runtime";import{COLORS as e}from"../../constants/Theme.js";import c from"../../assets/icons/info.svg.js";import{CheckBox as d}from"../checkBox/CheckBox.js";import{IconButton as n}from"../icon-button/IconButton.js";import{ShimmerImage as r}from"../shimmer-image/ShimmerImage.js";import{Tooltip as l}from"../tooltips/Tooltip.js";import{TitleSmall as a,BodyCaption as s}from"../TypographyStyle.js";import{CurrencySymbols as u}from"./constants.js";import{ProductHelper as v}from"./helpers/ProductHelper.js";import{ProductPickerTag as p}from"./ProductPickerTag.js";import{ProductCardStyle as h}from"./style.js";import{shouldShowVariant as m}from"./utility.js";const I=o=>{var e,c,d,n,r,l,a,s,v;const{collectionId:p,productId:h,data:I,selectedData:P,selectedCollectionsDispatch:f,viewOnly:k,upliftAdditions:g,isProductPartiallyChecked:C,hideProductCheckbox:b,outOfStockAction:j,hideVariantCheckbox:O,hideProductVariants:x,pickerType:D,onProductDetailClick:T,showProductDetailInfoIcon:S}=o,V=t=>{var i,o,e,c,d,n;if(!(null===(o=null===(i=null==P?void 0:P[p])||void 0===i?void 0:i.products)||void 0===o?void 0:o[h]))return!1;return!!(null===(n=null===(d=null===(c=null===(e=null==P?void 0:P[p])||void 0===e?void 0:e.products)||void 0===c?void 0:c[h])||void 0===d?void 0:d.variants)||void 0===n?void 0:n[t])},A=x||!m(I)?`${I.currency&&null!==(e=u[I.currency])&&void 0!==e?e:""}${null!==(v=null!==(r=null===(n=null===(d=Object.values(null!==(c=I.variants)&&void 0!==c?c:{}))||void 0===d?void 0:d[0])||void 0===n?void 0:n.price)&&void 0!==r?r:null===(s=null===(a=Object.values(null!==(l=I.variants)&&void 0!==l?l:{}))||void 0===a?void 0:a[0])||void 0===s?void 0:s.actualPrice)&&void 0!==v?v:""}`:"";return t("div",{children:[i(y,{isVariant:!1,data:I,productId:h,collectionId:p,isSelected:(()=>{var t,i;return!!(null===(i=null===(t=null==P?void 0:P[p])||void 0===t?void 0:t.products)||void 0===i?void 0:i[h])})(),isPartiallyChecked:C,selectedCollectionsDispatch:f,upliftAdditions:g,viewOnly:k,hideProductCheckbox:b,hideVariantCheckbox:O,hideProductVariants:x,pickerType:D,outOfStockAction:j,onProductDetailClick:T,showProductDetailInfoIcon:S,currencyAndPrice:A},h),x?null:m(I)&&Object.keys(I.variants||[]).map((t=>{var o,e,c,d,n,r,l;const a=`${I.currency&&null!==(o=u[I.currency])&&void 0!==o?o:""}${null!==(l=null!==(d=null===(c=null===(e=I.variants)||void 0===e?void 0:e[t])||void 0===c?void 0:c.price)&&void 0!==d?d:null===(r=null===(n=I.variants)||void 0===n?void 0:n[t])||void 0===r?void 0:r.actualPrice)&&void 0!==l?l:""}`;return i(y,{isVariant:!0,hideVariantCheckbox:O,data:Object.assign(Object.assign({},I.variants[t]),{currency:I.currency}),variantId:t,productId:h,viewOnly:k,upliftAdditions:g,collectionId:p,isSelected:V(t),selectedCollectionsDispatch:f,outOfStockAction:j,onProductDetailClick:T,showProductDetailInfoIcon:S,currencyAndPrice:a},t)}))]})},y=u=>{const{isVariant:m,data:I,productId:y,collectionId:P,variantId:f,isSelected:k,selectedCollectionsDispatch:g,viewOnly:C,upliftAdditions:b,isPartiallyChecked:j,hideProductCheckbox:O,outOfStockAction:x,hideVariantCheckbox:D,hideProductVariants:T,pickerType:S="PRODUCT",onProductDetailClick:V,showProductDetailInfoIcon:A,currencyAndPrice:w}=u,{isVariantForProductPickerTag:U,dataForProductPickerTag:$,tagText:B,tagType:F}=v.getDataForProductPickerTag(I,m,x);return t(h,Object.assign({isVariant:m,onClick:t=>{if(t.stopPropagation(),"PRODUCT"===S&&(O||D)){const t=Object.keys(I.variants);T?k?g({type:"productUnselected",data:{productId:y,collectionId:P}}):b("productSelected",{productId:y,variantId:f,collectionId:P,product:I}):k?g({type:"variantUnselected",data:{productId:y,variantId:f,collectionId:P}}):b("variantSelected",{productId:y,variantId:f||t[0],collectionId:P,variant:I})}},isActive:k},{children:[m&&!C&&!D||!m&&!C&&!O?i(d,{isChecked:k,isPartiallyChecked:j||!1,onValueChange:function(t,i,o){null==o||o.stopPropagation(),m?t?b(T?"productSelected":"variantSelected",{productId:y,variantId:f,collectionId:P,variant:I}):g({type:T?"productUnselected":"variantUnselected",data:{productId:y,variantId:f,collectionId:P}}):t?b("productSelected",{productId:y,collectionId:P,product:I}):g({type:"productUnselected",data:{productId:y,collectionId:P}})}}):i(o,{}),i("div",{children:i(r,{width:40,height:40,imageUrl:I.image,alt:"Item",borderRadius:4})}),t("div",Object.assign({style:{display:"flex",flexDirection:"column",flex:1}},{children:[t("div",Object.assign({style:{display:"flex",alignItems:"center",justifyContent:"space-between"}},{children:[i(l,Object.assign({variant:"light",body:I.name,placement:"bottom",delay:400},{children:i(a,Object.assign({numberOfLines:1},{children:I.name}))})),A&&i(n,{onClick:()=>{null==V||V(I)},Icon:()=>i(c,{width:20,height:20,color:e.content.placeholder})})]})),i(p,{isVariant:U,data:$,tagText:B,tagType:F}),i(s,Object.assign({color:e.content.secondary},{children:!(null==$?void 0:$.fbStatus)&&U||B?null:w}))]}))]}))};export{y as ProductCard,I as ProductGroup};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{jsxs as o,jsx as t}from"react/jsx-runtime";import i from"styled-components";import{COLORS as r}from"../../constants/Theme.js";import a from"../../assets/icons/cross.svg.js";import{IconButton as e}from"../icon-button/IconButton.js";import{ShimmerImage as n}from"../shimmer-image/ShimmerImage.js";import{
|
|
1
|
+
import{jsxs as o,jsx as t}from"react/jsx-runtime";import i from"styled-components";import{COLORS as r}from"../../constants/Theme.js";import a from"../../assets/icons/cross.svg.js";import{IconButton as e}from"../icon-button/IconButton.js";import{ShimmerImage as n}from"../shimmer-image/ShimmerImage.js";import{TitleRegular as c,BodyCaption as d}from"../TypographyStyle.js";import{CurrencySymbols as l}from"./constants.js";import{ProductHelper as s}from"./helpers/ProductHelper.js";import{ProductPickerTag as u}from"./ProductPickerTag.js";import{shouldShowVariant as p}from"./utility.js";const m=i=>o(g,{children:[t(f,{}),t(x,{children:t(e,{className:"close-button",onClick:i.onClose,Icon:a,width:20,height:20})}),t(v,{productData:i.productData,outOfStockAction:i.outOfStockAction,useDynamicInfoImageSize:i.useDynamicInfoImageSize})]}),v=i=>{var a,e,m,v,g,f,x,D,j,k,I,P,T,S,w,O;const $=void 0===i.productData.variants;let z;if($)z=`${i.productData.currency&&null!==(a=l[i.productData.currency])&&void 0!==a?a:""}${null!==(g=null!==(m=null===(e=i.productData)||void 0===e?void 0:e.price)&&void 0!==m?m:null===(v=i.productData)||void 0===v?void 0:v.actualPrice)&&void 0!==g?g:""}`;else{const o=null===(f=i.productData)||void 0===f?void 0:f.currency;z=`${o&&null!==(x=l[o])&&void 0!==x?x:""}${null!==(w=null!==(I=null===(k=null===(j=Object.values(null!==(D=i.productData.variants)&&void 0!==D?D:{}))||void 0===j?void 0:j[0])||void 0===k?void 0:k.price)&&void 0!==I?I:null===(S=null===(T=Object.values(null!==(P=i.productData.variants)&&void 0!==P?P:{}))||void 0===T?void 0:T[0])||void 0===S?void 0:S.actualPrice)&&void 0!==w?w:""}`}const{isVariantForProductPickerTag:A,dataForProductPickerTag:F,tagText:C,tagType:H}=s.getDataForProductPickerTag(i.productData,$,i.outOfStockAction);return o(y,{children:[t(h,{children:t(n,{useDynamicInfoImageSize:i.useDynamicInfoImageSize,imageUrl:i.productData.image,width:200,height:200,borderRadius:4})}),o(b,{children:[t(c,Object.assign({style:{display:"flex"}},{children:i.productData.name})),t(d,Object.assign({color:r.content.secondary},{children:`Product ID: ${i.productData.id}`})),t(d,{className:"overlay-description",dangerouslySetInnerHTML:{__html:null!==(O=i.productData.description)&&void 0!==O?O:""}}),t(d,Object.assign({color:r.content.secondary},{children:$?z:p(i.productData)?null:z})),t(u,{isVariant:A,data:F,tagText:C,tagType:H})]})]})},g=i.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
flex: 1;
|
|
4
4
|
background: rgba(0, 0, 0, 0.5);
|
|
@@ -17,11 +17,11 @@ import{jsxs as o,jsx as t}from"react/jsx-runtime";import i from"styled-component
|
|
|
17
17
|
word-break: break-word;
|
|
18
18
|
margin-top: 8px;
|
|
19
19
|
}
|
|
20
|
-
`,
|
|
20
|
+
`,f=i.div`
|
|
21
21
|
display: flex;
|
|
22
22
|
flex: 1;
|
|
23
23
|
background: rgba(0, 0, 0, 0.5);
|
|
24
|
-
`,
|
|
24
|
+
`,x=i.div`
|
|
25
25
|
position: relative;
|
|
26
26
|
|
|
27
27
|
.close-button {
|
|
@@ -32,21 +32,21 @@ import{jsxs as o,jsx as t}from"react/jsx-runtime";import i from"styled-component
|
|
|
32
32
|
background: ${r.surface.standard};
|
|
33
33
|
border-radius: 50%;
|
|
34
34
|
}
|
|
35
|
-
`,
|
|
35
|
+
`,y=i.div`
|
|
36
36
|
display: flex;
|
|
37
37
|
background: white;
|
|
38
38
|
padding: 24px;
|
|
39
39
|
gap: 24px;
|
|
40
40
|
border-radius: 8px 8px 0px 0px;
|
|
41
|
-
`,
|
|
41
|
+
`,h=i.div`
|
|
42
42
|
display: flex;
|
|
43
43
|
max-width: min(50%, 200px);
|
|
44
44
|
flex-direction: column;
|
|
45
45
|
justify-content: center;
|
|
46
46
|
align-items: center;
|
|
47
|
-
`,
|
|
47
|
+
`,b=i.div`
|
|
48
48
|
display: flex;
|
|
49
49
|
flex: 1;
|
|
50
50
|
flex-direction: column;
|
|
51
51
|
gap: 4px;
|
|
52
|
-
`;export{
|
|
52
|
+
`;export{v as ProductInfoCard,m as ProductInfoOverlay};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as t,jsx as e}from"react/jsx-runtime";import o from"../../assets/icons/arrow_left.svg.js";import c from"../../assets/icons/box.svg.js";import
|
|
1
|
+
import{jsxs as t,jsx as e}from"react/jsx-runtime";import o from"../../assets/icons/arrow_left.svg.js";import c from"../../assets/icons/box.svg.js";import r from"../../assets/icons/search.svg.js";import{cloneDeep as n}from"lodash";import{useContext as i,useRef as s,useState as l,useEffect as d}from"react";import{COLORS as a}from"../../constants/Theme.js";import{CheckBox as u}from"../checkBox/CheckBox.js";import{IconButton as h}from"../icon-button/IconButton.js";import{InfiniteScroll as p}from"../InfiniteScroll/InfiniteScroll.js";import{Input as m}from"../input/Input.js";import{Spinner as g}from"../spinner/Spinner.js";import{BodyCaption as j,TitleRegular as f}from"../TypographyStyle.js";import{EmptyState as v}from"./emptyState.js";import{ProductGroup as b}from"./product.js";import{ProductPickerShimmer as y}from"./ProductPickerShimmer.js";import{CollectionIdContext as O}from"./reducers.js";import{ProductScreenHeader as k,ProductScreenCollectionCardStyle as C}from"./style.js";import{OUT_OF_STOCK_ACTION as P}from"./type.js";import{getVariantIdsToFetchAtProductLevel as I,markVariantsAsApprovedProductsLevel as D,isCollectionPartiallyChecked as S,isProductPartiallyChecked as x,liftTheStateUp as E}from"./utility.js";const R=R=>{var T,w;const{data:V,collectionsDispatch:A,selectedData:B,selectedCollectionsDispatch:F,productFetcher:J,storeId:M,setScreen:W,setSaveDisabled:z,hideInCollectionSearch:H,customCollectionRestriction:K,hideProductCheckbox:L,outOfStockAction:N=P.BLUR,hideVariantCheckbox:U=!1,selectProductsFromCustomCollection:_=!1,pickerType:q,hideProductVariants:G,fbStatusFetcher:Q,onProductDetailClick:X,showProductDetailInfoIcon:Y,scrollContainerRef:Z}=R,$=i(O),tt=s(0),et=s(!1),[ot,ct]=l(""),[rt,nt]=l(!1),[it,st]=l(V),lt=s(!0),dt=s(!1);d((()=>{if(lt.current)return void(lt.current=!1);const t=setTimeout((()=>{ot.length?(nt(!0),R.searchInCollectionFetcher(M,$,ot).then((t=>{const e=n(V);e.products=t,st(e);const o=I(null!=t?t:{});ut(o,null!=t?t:{},!0),z(!1),nt(!1)}))):st(V)}),800);return()=>clearTimeout(t)}),[ot]);d((()=>{var t,e,o,c;dt.current=!1,tt.current=Math.floor((null===(e=Object.keys(null!==(t=V.products)&&void 0!==t?t:{}))||void 0===e?void 0:e.length)/10);const r=I(null!==(o=V.products)&&void 0!==o?o:{});ut(r,null!==(c=V.products)&&void 0!==c?c:{})}),[$]);const at=!!K&&V.isSmartCollection;d((()=>{(null==V?void 0:V.products)||ht(10)}),[]);const ut=(t,e,o)=>{Q||(o?D(e,A,$,it,st):D(e,A,$)),t.length>0&&Q&&Q(M,t).then((t=>{const c=Object.assign({},e);Object.keys(e).forEach((o=>{var r,n;Object.keys(null!==(n=null===(r=null==e?void 0:e[o])||void 0===r?void 0:r.variants)&&void 0!==n?n:{}).forEach((r=>{var n,i;const s=null===(n=null==e?void 0:e[o].variants)||void 0===n?void 0:n[r];s&&"REJECTED"===t[r]?s.fbStatus="REJECTED":s&&"APPROVED"===t[r]&&(s.fbStatus="APPROVED");const l=null===(i=null==c?void 0:c[o])||void 0===i?void 0:i.variants;l&&l[r]&&(l[r]=s)}))})),o?(st((t=>{const e=Object.assign({},t);return e.products=c,e})),A({type:"productsPaged",data:{collectionId:$,products:c}})):A({type:"productsPaged",data:{collectionId:$,products:c}})})).catch((t=>{o?D(e,A,$,it,st):D(e,A,$)}))},ht=t=>{z(!0),nt(!0),J($,M,t,0).then((e=>{if(Object.keys(e).length||(dt.current=!0),Object.keys(e).length){st(Object.assign(Object.assign({},it),{products:e}));const t=I(e);ut(t,e),tt.current=1}t||F({type:"selected",data:{id:$,val:Object.assign(Object.assign({},V),{products:e})}}),z(!1),nt(!1)})).catch()},pt=(t,e)=>{const o=E(e,V);F({type:t,data:Object.assign(Object.assign({},o),{isRestricted:K})})},mt=!!(null==B?void 0:B[$])&&!!Object.keys(null!==(w=null===(T=null==B?void 0:B[$])||void 0===T?void 0:T.products)&&void 0!==w?w:{}).length;return t("div",{children:[t(k,{children:[e(h,{Icon:o,height:16,onClick:()=>{W("collections")}}),e(j,Object.assign({style:{color:a.content.secondary}},{children:V.name}))]}),!H&&e("div",Object.assign({style:{padding:16,height:"76px",borderBottom:"1px solid #E0E0E0"}},{children:e(m,{noKeyDownChange:!0,noErrorHint:!0,rightIcon:{icon:()=>rt&&ot.length?e(g,{size:"small",color:a.content.primary}):e(r,{})},id:"listInput",height:"24px",type:"text",value:ot,onChangeText:t=>{t.length&&t.trim().length?ct(t):ct("")},placeholder:"Search for a product or type a product ID"})})),Object.keys((null==it?void 0:it.products)||[]).length>0&&!at&&!ot.length&&!L&&"-1"!==$&&t(C,{children:[e(u,{isChecked:mt,isPartiallyChecked:S($,it,B,G),onValueChange:function(t){t?ht():F({type:"unselected",data:{id:$}})}}),e("div",Object.assign({style:{width:40,height:40}},{children:e(c,{})})),e(f,{children:"All Products"})]}),e(p,Object.assign({hasData:!(Object.keys((null==it?void 0:it.products)||[]).length<10)&&!!Object.keys((null==it?void 0:it.products)||[]).length,fetchMore:()=>(et.current=!0,J($,M,10,tt.current).then((t=>{let e=!1;if(Object.keys(t).length||(e=!0),Object.keys(t).length){const e=it;e.products=Object.assign(Object.assign({},it.products),t),st(Object.assign({},e));const o=I(t);ut(o,t)}return z(!1),et.current=!1,tt.current+=1,e}))),containerRef:Z},{children:Object.keys((null==it?void 0:it.products)||[]).length?Object.keys(it.products||[]).map((t=>e(b,{outOfStockAction:N,collectionId:$,isProductPartiallyChecked:x($,t,B,it,G),productId:t,data:it.products[t],selectedData:B,selectedCollectionsDispatch:F,viewOnly:!_&&!!at,upliftAdditions:pt,hideProductCheckbox:L,hideVariantCheckbox:U,hideProductVariants:G,pickerType:q,onProductDetailClick:X,showProductDetailInfoIcon:Y},t))):rt?e(y,{limit:10}):e(v,{title:"No products to show",subtitle:ot.length?"We couldn't find the product you were looking for":"We couldn’t find any product in this collection."})}))]})};export{R as ProductsScreen};
|
|
@@ -23,14 +23,3 @@ export declare const VariantCardListStyle: import("styled-components").StyledCom
|
|
|
23
23
|
export declare const VariantCardGridStyle: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
24
24
|
export declare const StyledHeaderRightIcon: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
25
25
|
export declare const StyledFooterForNonModal: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
26
|
-
export declare const SKUIDBadge: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
27
|
-
export declare const EllipsedBodyTiny: import("styled-components").StyledComponent<"div", any, {
|
|
28
|
-
numberOfLines?: number | undefined;
|
|
29
|
-
color?: string | undefined;
|
|
30
|
-
}, never>;
|
|
31
|
-
export declare const ProductSubTitle: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
32
|
-
export declare const ProductInfo: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
33
|
-
export declare const StyledTitleSmall: import("styled-components").StyledComponent<"div", any, {
|
|
34
|
-
numberOfLines?: number | undefined;
|
|
35
|
-
color?: string | undefined;
|
|
36
|
-
}, never>;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import e from"styled-components";import{COLORS as i}from"../../constants/Theme.js";import{
|
|
1
|
+
import e from"styled-components";import{COLORS as i}from"../../constants/Theme.js";import{ScreenName as t}from"./modal.js";const o=e.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
background-color: white;
|
|
4
4
|
height: ${e=>e.renderWithoutModal?"90%":"75vh"};
|
|
5
5
|
flex-direction: column;
|
|
6
|
-
`,
|
|
6
|
+
`,n=e.div`
|
|
7
7
|
overflow-y: scroll;
|
|
8
8
|
overflow-x: hidden;
|
|
9
9
|
|
|
@@ -13,10 +13,10 @@ import e from"styled-components";import{COLORS as i}from"../../constants/Theme.j
|
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
::-webkit-scrollbar-thumb {
|
|
16
|
-
background-color: ${e=>e.screenName!==
|
|
16
|
+
background-color: ${e=>e.screenName!==t.RearrangeProducts?"#888":"#fff"};
|
|
17
17
|
border-radius: 8px;
|
|
18
18
|
}
|
|
19
|
-
`,
|
|
19
|
+
`,r=e.div`
|
|
20
20
|
height: 64px;
|
|
21
21
|
background-color: ${e=>e.isDisabled?"#F0F0F0":e.isActive?i.background.positive.light:"white"};
|
|
22
22
|
border-bottom: 1px solid #e0e0e0;
|
|
@@ -30,17 +30,17 @@ import e from"styled-components";import{COLORS as i}from"../../constants/Theme.j
|
|
|
30
30
|
cursor: pointer;
|
|
31
31
|
background-color: ${i.surface.hovered};
|
|
32
32
|
}
|
|
33
|
-
`,
|
|
33
|
+
`,d=e.div`
|
|
34
34
|
display: flex;
|
|
35
35
|
flex-direction: row;
|
|
36
36
|
justify-content: center;
|
|
37
37
|
align-items: center;
|
|
38
38
|
column-gap: 18px;
|
|
39
|
-
`,
|
|
39
|
+
`,p=e.div`
|
|
40
40
|
display: flex;
|
|
41
41
|
flex-direction: column;
|
|
42
42
|
justify-content: center;
|
|
43
|
-
`,
|
|
43
|
+
`,l=e.div`
|
|
44
44
|
display: flex;
|
|
45
45
|
flex-direction: row;
|
|
46
46
|
max-height: 32px;
|
|
@@ -53,14 +53,14 @@ import e from"styled-components";import{COLORS as i}from"../../constants/Theme.j
|
|
|
53
53
|
position: sticky;
|
|
54
54
|
top: 0;
|
|
55
55
|
z-index: 10;
|
|
56
|
-
`,
|
|
56
|
+
`,c=e.div`
|
|
57
57
|
display: flex;
|
|
58
58
|
flex-direction: row;
|
|
59
59
|
column-gap: 16px;
|
|
60
60
|
padding: 12px 16px;
|
|
61
61
|
border-bottom: 1px solid #e0e0e0;
|
|
62
62
|
align-items: center;
|
|
63
|
-
`,
|
|
63
|
+
`,a=e.div`
|
|
64
64
|
min-height: 64px;
|
|
65
65
|
background-color: ${e=>e.isActive?i.background.positive.light:"white"};
|
|
66
66
|
border-bottom: 1px solid #e0e0e0;
|
|
@@ -75,7 +75,7 @@ import e from"styled-components";import{COLORS as i}from"../../constants/Theme.j
|
|
|
75
75
|
cursor: pointer;
|
|
76
76
|
background-color: ${i.surface.hovered};
|
|
77
77
|
}
|
|
78
|
-
`,
|
|
78
|
+
`,s=e.div`
|
|
79
79
|
display: flex;
|
|
80
80
|
flex-direction: row;
|
|
81
81
|
max-height: 32px;
|
|
@@ -87,10 +87,10 @@ import e from"styled-components";import{COLORS as i}from"../../constants/Theme.j
|
|
|
87
87
|
position: sticky;
|
|
88
88
|
top: 0;
|
|
89
89
|
z-index: 10;
|
|
90
|
-
`,
|
|
90
|
+
`,x=e.div`
|
|
91
91
|
display: flex;
|
|
92
92
|
flex-direction: column;
|
|
93
|
-
`,
|
|
93
|
+
`,g=e.div`
|
|
94
94
|
min-height: 72px;
|
|
95
95
|
background: white;
|
|
96
96
|
padding: 12px 16px;
|
|
@@ -101,24 +101,17 @@ import e from"styled-components";import{COLORS as i}from"../../constants/Theme.j
|
|
|
101
101
|
|
|
102
102
|
.text-container {
|
|
103
103
|
display: flex;
|
|
104
|
+
justify-content: space-between;
|
|
104
105
|
gap: 16px;
|
|
105
|
-
flex: 1;
|
|
106
106
|
}
|
|
107
107
|
|
|
108
108
|
.tooltip-title-tag {
|
|
109
109
|
display: flex;
|
|
110
110
|
flex: 1;
|
|
111
|
-
align-items: center;
|
|
112
|
-
justify-content: space-between;
|
|
113
|
-
width: 100%;
|
|
114
|
-
gap: 16px;
|
|
115
|
-
}
|
|
116
|
-
.info-container {
|
|
117
|
-
display: flex;
|
|
118
111
|
flex-direction: column;
|
|
119
|
-
|
|
112
|
+
gap: 2px;
|
|
120
113
|
}
|
|
121
|
-
`,
|
|
114
|
+
`,f=e.div`
|
|
122
115
|
height: 72px;
|
|
123
116
|
width: 72px;
|
|
124
117
|
display: flex;
|
|
@@ -141,32 +134,4 @@ import e from"styled-components";import{COLORS as i}from"../../constants/Theme.j
|
|
|
141
134
|
justify-content: space-between;
|
|
142
135
|
margin-top: auto;
|
|
143
136
|
width: 100%;
|
|
144
|
-
|
|
145
|
-
width: fit-content;
|
|
146
|
-
background: ${i.background.brandLight};
|
|
147
|
-
padding: 2px 6px;
|
|
148
|
-
border-radius: 14px;
|
|
149
|
-
`,y=e(t)`
|
|
150
|
-
white-space: nowrap;
|
|
151
|
-
overflow: hidden;
|
|
152
|
-
text-overflow: ellipsis;
|
|
153
|
-
max-width: 196px;
|
|
154
|
-
display: block;
|
|
155
|
-
color: ${i.background.inverseLight};
|
|
156
|
-
`,w=e.div`
|
|
157
|
-
display: flex;
|
|
158
|
-
flex-direction: row;
|
|
159
|
-
align-items: center;
|
|
160
|
-
gap: 5px;
|
|
161
|
-
`,v=e.div`
|
|
162
|
-
display: flex;
|
|
163
|
-
flex-direction: row;
|
|
164
|
-
align-items: center;
|
|
165
|
-
gap: 8px;
|
|
166
|
-
min-width: 0;
|
|
167
|
-
`;e(o)`
|
|
168
|
-
overflow: hidden;
|
|
169
|
-
white-space: nowrap;
|
|
170
|
-
text-overflow: ellipsis;
|
|
171
|
-
display: block;
|
|
172
|
-
`;export{a as CollectionCardDetailStyle,p as CollectionCardInfoStyle,l as CollectionCardStyle,f as CollectionNameHolder,r as ContainerStyle,y as EllipsedBodyTiny,x as ProductCardStyle,v as ProductInfo,s as ProductScreenCollectionCardStyle,c as ProductScreenHeader,w as ProductSubTitle,b as SKUIDBadge,d as ScrollContainerStyle,g as SelectedScreenHeader,u as StyledFooterForNonModal,m as VariantCardGridStyle,h as VariantCardListStyle};
|
|
137
|
+
`;export{p as CollectionCardDetailStyle,d as CollectionCardInfoStyle,r as CollectionCardStyle,x as CollectionNameHolder,o as ContainerStyle,a as ProductCardStyle,c as ProductScreenCollectionCardStyle,l as ProductScreenHeader,n as ScrollContainerStyle,s as SelectedScreenHeader,u as StyledFooterForNonModal,f as VariantCardGridStyle,g as VariantCardListStyle};
|
|
@@ -48,4 +48,3 @@ export declare const updateAllVariantsForSelectedProducts: (selectedItems: {
|
|
|
48
48
|
} | undefined;
|
|
49
49
|
};
|
|
50
50
|
}, collections: Collection, searchedProducts: SearchedItems) => Record<string, any>;
|
|
51
|
-
export declare const getSkuId: (product: Product | ProductVariant, isVariant: boolean) => string | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{cloneDeep as o}from"lodash";const l=(l,i)=>{const n=o(i);if(delete n.products,(l=Object.assign(Object.assign({},l),{catalogOnlyData:n})).productId&&i.products){const t=o(i.products[l.productId]);(null==t?void 0:t.variants)&&delete t.variants,l=Object.assign(Object.assign({},l),{catalogOnlyData:n,productOnlyData:t})}return l};function i(o,l,i){var t;const d={};let v=0;for(const s in o)if(Object.prototype.hasOwnProperty.call(o,s)){const u=o[s],c=n(u.products,l,i-v);c&&Object.keys(c).length>0&&(d[s]=Object.assign(Object.assign({},u),{products:c})),v+=Object.keys(null!==(t=u.products)&&void 0!==t?t:{}).length}return d}function n(o,l,i){if(!o)return{};const n=Object.keys(o).slice(i,i+l),t={};return n.forEach((l=>{t[l]=o[l]})),t}const t=(o,l,i)=>{Object.keys(o).forEach((l=>{var i,n;const t=null!==(n=null===(i=o[l])||void 0===i?void 0:i.products)&&void 0!==n?n:{};Object.keys(t).forEach((i=>{var n,t,d,v;const s=null!==(v=null===(d=null===(t=null===(n=o[l])||void 0===n?void 0:n.products)||void 0===t?void 0:t[i])||void 0===d?void 0:d.variants)&&void 0!==v?v:{};Object.keys(s).forEach((n=>{var t,d,v,s;const u=null===(s=null===(v=null===(d=null===(t=o[l])||void 0===t?void 0:t.products)||void 0===d?void 0:d[i])||void 0===v?void 0:v.variants)||void 0===s?void 0:s[n];u&&!u.fbStatus&&(u.fbStatus="APPROVED")}))}))})),l({type:i,data:o})},d=function(o,l,i,n){let d=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"paged";n||t(o,i,d);const v=(o=>{const l=[];return Object.keys(o).forEach((i=>{var n,t;const d=null!==(t=null===(n=o[i])||void 0===n?void 0:n.products)&&void 0!==t?t:{};Object.keys(d).forEach((n=>{var t,d,v,s;const u=null!==(s=null===(v=null===(d=null===(t=o[i])||void 0===t?void 0:t.products)||void 0===d?void 0:d[n])||void 0===v?void 0:v.variants)&&void 0!==s?s:{};Object.keys(u).forEach((t=>{var d,v,s,u;const c=null===(u=null===(s=null===(v=null===(d=o[i])||void 0===d?void 0:d.products)||void 0===v?void 0:v[n])||void 0===s?void 0:s.variants)||void 0===u?void 0:u[t];(null==c?void 0:c.fbStatus)||l.push(t)}))}))})),l})(o);v.length>0&&n&&n(l,v).then((l=>{const n=Object.assign({},o);Object.keys(n).forEach((o=>{var i,t;const d=null!==(t=null===(i=n[o])||void 0===i?void 0:i.products)&&void 0!==t?t:{};Object.keys(d).forEach((i=>{var t,d,v,s;const u=null!==(s=null===(v=null===(d=null===(t=n[o])||void 0===t?void 0:t.products)||void 0===d?void 0:d[i])||void 0===v?void 0:v.variants)&&void 0!==s?s:{};Object.keys(u).forEach((t=>{var d,v,s,u;const c=null===(u=null===(s=null===(v=null===(d=n[o])||void 0===d?void 0:d.products)||void 0===v?void 0:v[i])||void 0===s?void 0:s.variants)||void 0===u?void 0:u[t];c&&"REJECTED"===l[t]?c.fbStatus="REJECTED":c&&"APPROVED"===l[t]&&(c.fbStatus="APPROVED")}))}))})),i({type:d,data:n})})).catch((l=>{console.error("Error in fbStatusFetcher",l),t(o,i,d)}))},v=(o,l)=>{const i=[];return Object.keys(null!=o?o:{}).forEach((n=>{var t,d;const v=null!==(d=null===(t=null==o?void 0:o[n])||void 0===t?void 0:t.variants)&&void 0!==d?d:{};Object.keys(v).forEach((t=>{var d,v,s,u,c;let r;r=l?null===(s=null===(v=null===(d=null==l?void 0:l.products)||void 0===d?void 0:d[n])||void 0===v?void 0:v.variants)||void 0===s?void 0:s[t]:null===(c=null===(u=null==o?void 0:o[n])||void 0===u?void 0:u.variants)||void 0===c?void 0:c[t],(null==r?void 0:r.fbStatus)||i.push(t)}))})),i},s=(o,l,i,n,t)=>{const d=Object.assign({},o);if(Object.keys(o).forEach((l=>{var i,n;Object.keys(null!==(n=null===(i=null==o?void 0:o[l])||void 0===i?void 0:i.variants)&&void 0!==n?n:{}).forEach((i=>{var n,t;const v=null===(n=null==o?void 0:o[l].variants)||void 0===n?void 0:n[i];v&&(v.fbStatus="APPROVED");const s=null===(t=null==d?void 0:d[l])||void 0===t?void 0:t.variants;s&&s[i]&&(s[i]=v)}))})),n&&t){const o=Object.assign({},n);o.products=d,t(o),l({type:"productsPaged",data:{collectionId:i,products:d}})}else l({type:"productsPaged",data:{collectionId:i,products:d}})},u=o=>{const l=Object.keys(o.variants||[]);let i=!1;return!(l.length<=1)||(l.forEach((l=>{var n,t;i=null!==(t=null===(n=o.variants)||void 0===n?void 0:n[l].name.includes(o.name))&&void 0!==t&&t})),!i)},c=(o,l,i,n,t)=>{var d,v,s,u,c,r,a,e,p,b,O,f,j,h,y,g,
|
|
1
|
+
import{cloneDeep as o}from"lodash";const l=(l,i)=>{const n=o(i);if(delete n.products,(l=Object.assign(Object.assign({},l),{catalogOnlyData:n})).productId&&i.products){const t=o(i.products[l.productId]);(null==t?void 0:t.variants)&&delete t.variants,l=Object.assign(Object.assign({},l),{catalogOnlyData:n,productOnlyData:t})}return l};function i(o,l,i){var t;const d={};let v=0;for(const s in o)if(Object.prototype.hasOwnProperty.call(o,s)){const u=o[s],c=n(u.products,l,i-v);c&&Object.keys(c).length>0&&(d[s]=Object.assign(Object.assign({},u),{products:c})),v+=Object.keys(null!==(t=u.products)&&void 0!==t?t:{}).length}return d}function n(o,l,i){if(!o)return{};const n=Object.keys(o).slice(i,i+l),t={};return n.forEach((l=>{t[l]=o[l]})),t}const t=(o,l,i)=>{Object.keys(o).forEach((l=>{var i,n;const t=null!==(n=null===(i=o[l])||void 0===i?void 0:i.products)&&void 0!==n?n:{};Object.keys(t).forEach((i=>{var n,t,d,v;const s=null!==(v=null===(d=null===(t=null===(n=o[l])||void 0===n?void 0:n.products)||void 0===t?void 0:t[i])||void 0===d?void 0:d.variants)&&void 0!==v?v:{};Object.keys(s).forEach((n=>{var t,d,v,s;const u=null===(s=null===(v=null===(d=null===(t=o[l])||void 0===t?void 0:t.products)||void 0===d?void 0:d[i])||void 0===v?void 0:v.variants)||void 0===s?void 0:s[n];u&&!u.fbStatus&&(u.fbStatus="APPROVED")}))}))})),l({type:i,data:o})},d=function(o,l,i,n){let d=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"paged";n||t(o,i,d);const v=(o=>{const l=[];return Object.keys(o).forEach((i=>{var n,t;const d=null!==(t=null===(n=o[i])||void 0===n?void 0:n.products)&&void 0!==t?t:{};Object.keys(d).forEach((n=>{var t,d,v,s;const u=null!==(s=null===(v=null===(d=null===(t=o[i])||void 0===t?void 0:t.products)||void 0===d?void 0:d[n])||void 0===v?void 0:v.variants)&&void 0!==s?s:{};Object.keys(u).forEach((t=>{var d,v,s,u;const c=null===(u=null===(s=null===(v=null===(d=o[i])||void 0===d?void 0:d.products)||void 0===v?void 0:v[n])||void 0===s?void 0:s.variants)||void 0===u?void 0:u[t];(null==c?void 0:c.fbStatus)||l.push(t)}))}))})),l})(o);v.length>0&&n&&n(l,v).then((l=>{const n=Object.assign({},o);Object.keys(n).forEach((o=>{var i,t;const d=null!==(t=null===(i=n[o])||void 0===i?void 0:i.products)&&void 0!==t?t:{};Object.keys(d).forEach((i=>{var t,d,v,s;const u=null!==(s=null===(v=null===(d=null===(t=n[o])||void 0===t?void 0:t.products)||void 0===d?void 0:d[i])||void 0===v?void 0:v.variants)&&void 0!==s?s:{};Object.keys(u).forEach((t=>{var d,v,s,u;const c=null===(u=null===(s=null===(v=null===(d=n[o])||void 0===d?void 0:d.products)||void 0===v?void 0:v[i])||void 0===s?void 0:s.variants)||void 0===u?void 0:u[t];c&&"REJECTED"===l[t]?c.fbStatus="REJECTED":c&&"APPROVED"===l[t]&&(c.fbStatus="APPROVED")}))}))})),i({type:d,data:n})})).catch((l=>{console.error("Error in fbStatusFetcher",l),t(o,i,d)}))},v=(o,l)=>{const i=[];return Object.keys(null!=o?o:{}).forEach((n=>{var t,d;const v=null!==(d=null===(t=null==o?void 0:o[n])||void 0===t?void 0:t.variants)&&void 0!==d?d:{};Object.keys(v).forEach((t=>{var d,v,s,u,c;let r;r=l?null===(s=null===(v=null===(d=null==l?void 0:l.products)||void 0===d?void 0:d[n])||void 0===v?void 0:v.variants)||void 0===s?void 0:s[t]:null===(c=null===(u=null==o?void 0:o[n])||void 0===u?void 0:u.variants)||void 0===c?void 0:c[t],(null==r?void 0:r.fbStatus)||i.push(t)}))})),i},s=(o,l,i,n,t)=>{const d=Object.assign({},o);if(Object.keys(o).forEach((l=>{var i,n;Object.keys(null!==(n=null===(i=null==o?void 0:o[l])||void 0===i?void 0:i.variants)&&void 0!==n?n:{}).forEach((i=>{var n,t;const v=null===(n=null==o?void 0:o[l].variants)||void 0===n?void 0:n[i];v&&(v.fbStatus="APPROVED");const s=null===(t=null==d?void 0:d[l])||void 0===t?void 0:t.variants;s&&s[i]&&(s[i]=v)}))})),n&&t){const o=Object.assign({},n);o.products=d,t(o),l({type:"productsPaged",data:{collectionId:i,products:d}})}else l({type:"productsPaged",data:{collectionId:i,products:d}})},u=o=>{const l=Object.keys(o.variants||[]);let i=!1;return!(l.length<=1)||(l.forEach((l=>{var n,t;i=null!==(t=null===(n=o.variants)||void 0===n?void 0:n[l].name.includes(o.name))&&void 0!==t&&t})),!i)},c=(o,l,i,n,t)=>{var d,v,s,u,c,r,a,e,p,b,O,f,j,h,y,E,g,k,P;let D=0,V=0;if(null===(v=null===(d=null==i?void 0:i[o])||void 0===d?void 0:d.products)||void 0===v?void 0:v[l]){if(t)return!1;const d=(null===(c=null===(u=null===(s=null==i?void 0:i[o])||void 0===s?void 0:s.products)||void 0===u?void 0:u[l])||void 0===c?void 0:c.variants)||[];if(1===Object.keys(d).length)for(const n in d){const t=null===(a=null===(r=null==i?void 0:i[o])||void 0===r?void 0:r.products)||void 0===a?void 0:a[l],d=null===(O=null===(b=null===(p=null===(e=null==i?void 0:i[o])||void 0===e?void 0:e.products)||void 0===p?void 0:p[l])||void 0===b?void 0:b.variants)||void 0===O?void 0:O[n];if(null===(f=null==d?void 0:d.name)||void 0===f?void 0:f.includes(null!==(j=null==t?void 0:t.name)&&void 0!==j?j:""))return!1}if(null===(E=Object.keys((null===(y=null===(h=null==n?void 0:n.products)||void 0===h?void 0:h[l])||void 0===y?void 0:y.variants)||[]))||void 0===E||E.forEach((()=>V++)),Object.keys((null===(P=null===(k=null===(g=null==i?void 0:i[o])||void 0===g?void 0:g.products)||void 0===k?void 0:k[l])||void 0===P?void 0:P.variants)||[]).forEach((()=>D++)),D>0&&V!==D)return!0}return!1},r=function(o,l,i){var n,t,d,v;let s=0,u=0;if(arguments.length>3&&void 0!==arguments[3]&&arguments[3]){const v=null!==(n=null==l?void 0:l.products)&&void 0!==n?n:{};s=Object.keys(v).length;const c=null!==(d=null===(t=i[o])||void 0===t?void 0:t.products)&&void 0!==d?d:{};u=Object.keys(c).length}else if(i[o]){const n=null==l?void 0:l.products;n&&Object.keys(n).forEach((o=>{var l;const i=null===(l=n[o])||void 0===l?void 0:l.variants;i&&Object.keys(i).forEach((o=>s+=1))}));const t=null===(v=i[o])||void 0===v?void 0:v.products;if(t&&Object.keys(t).forEach((o=>{var l;const i=null===(l=t[o])||void 0===l?void 0:l.variants;i&&Object.keys(i).forEach((o=>u+=1))})),s<=0&&u>0)return!1}return u>0&&s!==u},a=(l,i,n)=>Object.keys(l).reduce(((t,d)=>{var v;return d in i?(t[d]=Object.assign(Object.assign({},l[d]),{products:Object.keys(null!==(v=l[d].products)&&void 0!==v?v:{}).reduce(((t,v)=>{var s,u,c,r,a,e,p,b,O,f;const j=null===(s=i[d].products)||void 0===s?void 0:s[v],h=null===(r=null===(c=null===(u=null==n?void 0:n.products)||void 0===u?void 0:u[d])||void 0===c?void 0:c.products)||void 0===r?void 0:r[v];return j?t[v]=Object.assign(Object.assign({},(null===(a=l[d].products)||void 0===a?void 0:a[v])||{}),{allVariants:o(j.variants)}):h?t[v]=Object.assign(Object.assign({},(null===(e=l[d].products)||void 0===e?void 0:e[v])||{}),{allVariants:o(h.variants)}):(null===(b=null===(p=l[d].products)||void 0===p?void 0:p[v])||void 0===b?void 0:b.allVariants)&&(t[v]=Object.assign(Object.assign({},(null===(O=l[d].products)||void 0===O?void 0:O[v])||{}),{allVariants:o(null===(f=l[d].products)||void 0===f?void 0:f[v].allVariants)})),t}),{})}),t):t}),{});export{d as fetchFbStatusCollection,v as getVariantIdsToFetchAtProductLevel,r as isCollectionPartiallyChecked,c as isProductPartiallyChecked,l as liftTheStateUp,s as markVariantsAsApprovedProductsLevel,i as paginateSelectedItems,u as shouldShowVariant,a as updateAllVariantsForSelectedProducts};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{jsxs as t,jsx as e}from"react/jsx-runtime";import o from"../../assets/icons/delete.svg.js";import r from"../../assets/icons/drag_handle.svg.js";import{COLORS as i}from"../../constants/Theme.js";import{IconButton as a}from"../icon-button/IconButton.js";import{ShimmerImage as n}from"../shimmer-image/ShimmerImage.js";import{TitleSmall as c,BodyCaption as l}from"../TypographyStyle.js";import{CurrencySymbols as s}from"./constants.js";import{ProductHelper as d}from"./helpers/ProductHelper.js";import{ProductPickerTag as m}from"./ProductPickerTag.js";import{VariantCardListStyle as p,VariantCardGridStyle as h}from"./style.js";import{Tooltip as g}from"../tooltips/Tooltip.js";const u=h=>{var u,j,b;const{data:v,selectedCollectionsDispatch:f,outOfStockAction:y}=h,I=()=>{let t;return t=v.name.includes(v.productName)?v.name:`${v.productName} ${v.name}`,t},{dataForProductPickerTag:T,tagText:O,tagType:P}=d.getDataForProductPickerTag(v,!0,y),k=`${v.currency&&null!==(u=s[v.currency])&&void 0!==u?u:""}${null!==(b=null!==(j=v.price)&&void 0!==j?j:v.actualPrice)&&void 0!==b?b:""}`;return t(p,{children:[t("div",Object.assign({className:"text-container"},{children:[e(r,{width:24,height:24,color:i.content.placeholder}),e("div",{children:e(n,{width:40,height:40,imageUrl:v.image,alt:"Item",borderRadius:4},v.variantId)}),t("div",Object.assign({className:"tooltip-title-tag"},{children:[e(g,Object.assign({body:I(),placement:"bottom",delay:400,variant:"light"},{children:e(c,Object.assign({numberOfLines:1},{children:I()}))})),e(m,{isVariant:!0,data:T,tagText:O,tagType:P}),e(l,Object.assign({color:i.content.secondary},{children:!(null==T?void 0:T.fbStatus)||O?null:k}))]}))]})),e(a,{Icon:()=>e(o,{width:24,height:24,color:i.content.placeholder}),onClick:()=>{f&&f({type:"variantUnselected",data:{productId:v.productId,variantId:v.variantId,collectionId:v.collectionId}}),h.onDelete&&h.onDelete()}})]})},j=t=>{const{data:o}=t;return e(h,{children:e(g,Object.assign({body:o.name,alwaysVisible:!1,variant:"dark",placement:"bottom"},{children:e(n,{width:72,height:72,imageUrl:o.image,alt:"Item",borderRadius:4})}))})};export{j as VariantCardGridView,u as VariantCardListView};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as o,jsxs as t,Fragment as e}from"react/jsx-runtime";import r from"react-dom";import n from"../../assets/icons/cross.svg.js";import{Button as s}from"../button/Button.js";import{TitleMedium as i}from"../TypographyStyle.js";import{SideModalStyle as c,SideModalContainer as d,SideModalHeader as l,SideModalBody as a,SideModalFooter as h,FooterButtonWrapper as m}from"./SideModal.style.js";const p=p=>{var u;return r.createPortal(o(c,Object.assign({zIndex:p.zIndex,position:p.position},{children:t(d,Object.assign({width:p.width},{children:[t(l,Object.assign({headerStyle:Object.assign({},p.headerStyle)},{children:[(null==p?void 0:p.headerCustomComponent)||o(i,{children:p.header}),!p.hideCrossButton&&o(n,{width:24,height:24,onClick:p.onClose})]})),o(a,Object.assign({hideFooter:p.hideFooter,bodyStyle:Object.assign({},p.bodyStyle)},{children:p.children})),!0===p.hideFooter?null:t(h,Object.assign({footerDirection:p.footerDirection,footerStyle:Object.assign({},p.footerStyle)},{children:[(p.saveButtonProps||p.cancelButtonProps)&&t(m,Object.assign({footerDirection:p.footerDirection},{children:[p.saveButtonProps&&o(s,Object.assign({},p.saveButtonProps)),p.cancelButtonProps&&o(s,Object.assign({},p.cancelButtonProps))]})),p.footerCustomComponent?p.footerCustomComponent:o(e,{})]}))]}))})),null!==(u=p.element)&&void 0!==u?u:document.body)};export{p as SideModal};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export declare const SideModalStyle: import("styled-components").StyledComponent<"div", any, {
|
|
2
2
|
zIndex?: number | undefined;
|
|
3
|
+
position?: "left" | "right" | undefined;
|
|
3
4
|
}, never>;
|
|
4
5
|
export declare const SideModalContainer: import("styled-components").StyledComponent<"div", any, {
|
|
5
6
|
width?: string | undefined;
|