@bikdotai/bik-component-library 0.0.382-beta.7 → 0.0.382-beta.8

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.
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  export declare const Menus: ({
2
3
  displayName: string;
3
4
  key: number;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("../../assets/icons/search.svg.js"),o=require("react"),c=require("../../constants/Theme.js"),r=require("../button/Button.js"),s=require("../input/Input.js"),n=require("../modals/styledModal.js"),i=require("../spinner/Spinner.js"),l=require("../tag/Tag.js"),a=require("./collectionScreen.js"),d=require("./productScreen.js"),u=require("./rearrangeScreen.js"),h=require("./reducers.js"),p=require("./searchScreen.js"),C=require("./selectedScreen.js"),g=require("./style.js"),S=require("./type.js");exports.ProductPickerModal=j=>{const{storeId:x,selectedItems:y,onClose:b,visible:v,zIndex:m,limit:f,hideCollectionCheckbox:O,hideProductCheckbox:P,outOfStockAction:k=S.OUT_OF_STOCK_ACTION.BLUR,hideVariantCheckbox:I,selectProductsFromCustomCollection:q,hideSelectionCount:F,title:T,width:R,startupScreen:E="collections",rearrangeAfterSelectionEnabled:D}=j,[w,A]=o.useReducer(h.collectionsReducer,{}),[B,L]=o.useState(E),[_,M]=o.useState("grid"),[z,G]=o.useState(""),[H,V]=o.useState(0),[$,K]=o.useState(!1),[U,N]=o.useState(0),[Y,J]=o.useState(""),[Q,W]=o.useState(!1),[X,Z]=o.useState(!1),[ee,te]=o.useState(),[oe,ce]=o.useReducer(h.selectedColectionsReducer,Object.keys(y).length>0?y:{});o.useEffect((()=>{K(!0),Z(!0),j.collectionFetcher(H,x).then((e=>{A({type:"fetched",data:(null==e?void 0:e.collections)||{}}),K(!1),V((e=>e+1)),Z(!1)})).catch()}),[]),o.useEffect((()=>{let e=0;Object.keys(oe||[]).forEach((t=>{var o;Object.keys((null===(o=oe[t])||void 0===o?void 0:o.products)||[]).forEach((o=>{var c,r;Object.keys((null===(r=null===(c=oe[t].products)||void 0===c?void 0:c[o])||void 0===r?void 0:r.variants)||[]).forEach((()=>{e+=1}))}))})),N(e)})),o.useEffect((()=>{var e;z&&!(null===(e=null==w?void 0:w[z])||void 0===e?void 0:e.products)&&(K(!0),j.productFetcher(z,x).then((e=>{Object.keys(e).length&&A({type:"productsFetched",data:{collectionId:z,products:e}}),K(!1)})).catch())}),[z]),o.useEffect((()=>{const e=setTimeout((()=>{"rearrange"!==E&&(Y.length?(W(!0),j.searchFetcher(x,Y).then((e=>{te(Object.assign({},e)),L("searchProducts"),K(!1),W(!1)}))):L("collections"))}),800);return()=>clearTimeout(e)}),[Y]);const re=()=>{ce({type:"reset",data:{}})};return e.jsx(n.StyledModal,Object.assign({zIndex:m,open:v,onClose:()=>{b(),re()},headingTitle:T||("collections"===B||"products"===B?"Select Products":"view"===B?"Selected Products":"searchProducts"===B?"Searched Products":"rearrange"===B?"Rearrange Products":void 0),footerShadow:!0,centralContainerStyles:{width:R||"480px"},headerRightCustomElement:"rearrange"===B?(console.log("ignore:",M),e.jsx(e.Fragment,{})):e.jsx(e.Fragment,{}),primaryButton:{buttonText:$?"Loading...":"rearrange"===B?"Done":"Add",disabled:$||U<1||f&&U>f||!1,onClick:()=>{j.onAdd(oe,U),re()}},footerLeftCustomElement:F?e.jsx(e.Fragment,{}):f&&U>f?e.jsx(l.Tag,{tagText:`You can only select ${f} products`,type:"negative"}):U>0?e.jsx(r.Button,{onClick:()=>{L(D?"rearrange":"view")},buttonText:`${U} products selected`,buttonType:["rearrange","view"].includes(B)?"tertiaryGray":"tertiary"}):e.jsx(r.Button,{disabled:!0,buttonText:`${U} products selected`,buttonType:"tertiaryGray"})},{children:e.jsxs(g.ContainerStyle,{children:[j.postHeader&&e.jsx("div",Object.assign({style:{padding:"0 24px"}},{children:j.postHeader})),!j.hideGlobalSearch&&e.jsx(e.Fragment,{children:("collections"===B||"searchProducts"===B)&&e.jsx("div",Object.assign({style:{padding:"12px 24px",borderBottom:"1px solid #E0E0E0"}},{children:e.jsx(s.Input,{noKeyDownChange:!0,noErrorHint:!0,rightIcon:{icon:()=>Q?e.jsx(i.Spinner,{size:"small",color:c.COLORS.content.primary}):e.jsx(t.default,{})},id:"listInput",height:"24px",type:"text",value:Y,onChangeText:e=>{e.length&&e.trim().length?J(e):J("")}})}))}),e.jsxs(g.ScrollContainerStyle,{children:["collections"===B&&e.jsx(a.CollectionsScreen,{customCollectionRestriction:j.customCollectionRestriction,dataLoading:X,collections:w,selectedCollectionsDispatch:ce,setCollectionId:G,setScreen:L,selectedCollections:oe,collectionFetcher:j.collectionFetcher,storeId:x,collectionsDispatch:A,setSaveDisabled:K,pagingControls:{curPage:H,setCurPage:V},hideCollectionCheckbox:O}),"products"===B&&z&&e.jsx(h.CollectionIdContext.Provider,Object.assign({value:z},{children:e.jsx(d.ProductsScreen,{hideInCollectionSearch:j.hideInCollectionSearch,customCollectionRestriction:j.customCollectionRestriction,productFetcher:j.productFetcher,setScreen:L,storeId:x,data:w[z],collectionsDispatch:A,selectedCollectionsDispatch:ce,selectedData:oe,setSaveDisabled:K,searchInCollectionFetcher:j.searchInCollectionFetcher,hideProductCheckbox:P,outOfStockAction:k,hideVariantCheckbox:I,selectProductsFromCustomCollection:q})})),"view"===B&&e.jsx(C.SelectedScreen,{selectedCollections:oe||{},selectedCollectionsDispatch:ce,setScreen:L,collections:w}),"rearrange"===B&&e.jsx(u.RearrangeScreen,{selectedCollections:oe||{},selectedCollectionsDispatch:ce,setScreen:L,outOfStockAction:k,rearrangeViewType:"grid"===_?"list":"grid"}),"searchProducts"===B&&e.jsx(p.SearchScreen,{customCollectionRestriction:j.customCollectionRestriction,selectedCollections:oe||{},searchedCollections:ee||{},selectedCollectionsDispatch:ce,setScreen:L,collections:w,onBackPress:()=>{J(""),te({})}})]})]})}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("../../assets/icons/search.svg.js"),c=require("react"),o=require("../../constants/Theme.js"),r=require("../button/Button.js"),s=require("../input/Input.js"),n=require("../modals/styledModal.js"),i=require("../spinner/Spinner.js"),l=require("../tag/Tag.js"),a=require("./collectionScreen.js"),d=require("./productScreen.js"),u=require("./rearrangeScreen.js"),h=require("./reducers.js"),p=require("./searchScreen.js"),C=require("./selectedScreen.js"),S=require("./style.js"),g=require("./type.js");exports.ProductPickerModal=j=>{const{storeId:x,selectedItems:y,onClose:b,visible:v,zIndex:m,limit:f,hideCollectionCheckbox:O,hideProductCheckbox:P,outOfStockAction:k=g.OUT_OF_STOCK_ACTION.BLUR,hideVariantCheckbox:I,selectProductsFromCustomCollection:q,hideSelectionCount:F,title:T,width:R,startupScreen:E="collections",rearrangeAfterSelectionEnabled:D}=j,[w,A]=c.useReducer(h.collectionsReducer,{}),[B,L]=c.useState(E),[_,M]=c.useState("grid"),[z,G]=c.useState(""),[H,V]=c.useState(0),[$,K]=c.useState(!1),[U,N]=c.useState(0),[Y,J]=c.useState(""),[Q,W]=c.useState(!1),[X,Z]=c.useState(!1),[ee,te]=c.useState(),[ce,oe]=c.useReducer(h.selectedColectionsReducer,Object.keys(y).length>0?y:{});c.useEffect((()=>{K(!0),Z(!0),j.collectionFetcher(H,x).then((e=>{A({type:"fetched",data:(null==e?void 0:e.collections)||{}}),K(!1),V((e=>e+1)),Z(!1)})).catch()}),[]),c.useEffect((()=>{let e=0;Object.keys(ce||[]).forEach((t=>{var c;Object.keys((null===(c=ce[t])||void 0===c?void 0:c.products)||[]).forEach((c=>{var o,r;Object.keys((null===(r=null===(o=ce[t].products)||void 0===o?void 0:o[c])||void 0===r?void 0:r.variants)||[]).forEach((()=>{e+=1}))}))})),N(e)})),c.useEffect((()=>{var e;z&&!(null===(e=null==w?void 0:w[z])||void 0===e?void 0:e.products)&&(K(!0),j.productFetcher(z,x).then((e=>{Object.keys(e).length&&A({type:"productsFetched",data:{collectionId:z,products:e}}),K(!1)})).catch())}),[z]),c.useEffect((()=>{const e=setTimeout((()=>{"rearrange"!==E&&(Y.length?(W(!0),j.searchFetcher(x,Y).then((e=>{te(Object.assign({},e)),L("searchProducts"),K(!1),W(!1)}))):L("collections"))}),800);return()=>clearTimeout(e)}),[Y]);const re=()=>{oe({type:"reset",data:{}})};return e.jsx(n.StyledModal,Object.assign({zIndex:m,open:v,onClose:()=>{b(),re()},headingTitle:T||("collections"===B||"products"===B?"Select Products":"view"===B?"Selected Products":"searchProducts"===B?"Searched Products":"rearrange"===B?"Rearrange Products":void 0),footerShadow:!0,centralContainerStyles:{width:R||"480px"},headerRightCustomElement:"rearrange"===B?(M("grid"),e.jsx(e.Fragment,{})):e.jsx(e.Fragment,{}),primaryButton:{buttonText:$?"Loading...":"rearrange"===B?"Done":"Add",disabled:$||U<1||f&&U>f||!1,onClick:()=>{j.onAdd(ce,U),re()}},footerLeftCustomElement:F?e.jsx(e.Fragment,{}):f&&U>f?e.jsx(l.Tag,{tagText:`You can only select ${f} products`,type:"negative"}):U>0?e.jsx(r.Button,{onClick:()=>{L(D?"rearrange":"view")},buttonText:`${U} products selected`,buttonType:["rearrange","view"].includes(B)?"tertiaryGray":"tertiary"}):e.jsx(r.Button,{disabled:!0,buttonText:`${U} products selected`,buttonType:"tertiaryGray"})},{children:e.jsxs(S.ContainerStyle,{children:[j.postHeader&&e.jsx("div",Object.assign({style:{padding:"0 24px"}},{children:j.postHeader})),!j.hideGlobalSearch&&e.jsx(e.Fragment,{children:("collections"===B||"searchProducts"===B)&&e.jsx("div",Object.assign({style:{padding:"12px 24px",borderBottom:"1px solid #E0E0E0"}},{children:e.jsx(s.Input,{noKeyDownChange:!0,noErrorHint:!0,rightIcon:{icon:()=>Q?e.jsx(i.Spinner,{size:"small",color:o.COLORS.content.primary}):e.jsx(t.default,{})},id:"listInput",height:"24px",type:"text",value:Y,onChangeText:e=>{e.length&&e.trim().length?J(e):J("")}})}))}),e.jsxs(S.ScrollContainerStyle,{children:["collections"===B&&e.jsx(a.CollectionsScreen,{customCollectionRestriction:j.customCollectionRestriction,dataLoading:X,collections:w,selectedCollectionsDispatch:oe,setCollectionId:G,setScreen:L,selectedCollections:ce,collectionFetcher:j.collectionFetcher,storeId:x,collectionsDispatch:A,setSaveDisabled:K,pagingControls:{curPage:H,setCurPage:V},hideCollectionCheckbox:O}),"products"===B&&z&&e.jsx(h.CollectionIdContext.Provider,Object.assign({value:z},{children:e.jsx(d.ProductsScreen,{hideInCollectionSearch:j.hideInCollectionSearch,customCollectionRestriction:j.customCollectionRestriction,productFetcher:j.productFetcher,setScreen:L,storeId:x,data:w[z],collectionsDispatch:A,selectedCollectionsDispatch:oe,selectedData:ce,setSaveDisabled:K,searchInCollectionFetcher:j.searchInCollectionFetcher,hideProductCheckbox:P,outOfStockAction:k,hideVariantCheckbox:I,selectProductsFromCustomCollection:q})})),"view"===B&&e.jsx(C.SelectedScreen,{selectedCollections:ce||{},selectedCollectionsDispatch:oe,setScreen:L,collections:w}),"rearrange"===B&&e.jsx(u.RearrangeScreen,{selectedCollections:ce||{},selectedCollectionsDispatch:oe,setScreen:L,outOfStockAction:k,rearrangeViewType:"grid"===_?"list":"grid"}),"searchProducts"===B&&e.jsx(p.SearchScreen,{customCollectionRestriction:j.customCollectionRestriction,selectedCollections:ce||{},searchedCollections:ee||{},selectedCollectionsDispatch:oe,setScreen:L,collections:w,onBackPress:()=>{J(""),te({})}})]})]})}))};
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  export declare const Menus: ({
2
3
  displayName: string;
3
4
  key: number;
@@ -1 +1 @@
1
- import{jsx as e,Fragment as t,jsxs as o}from"react/jsx-runtime";import c from"../../assets/icons/search.svg.js";import{useReducer as r,useState as s,useEffect as i}from"react";import{COLORS as n}from"../../constants/Theme.js";import{Button as l}from"../button/Button.js";import{Input as d}from"../input/Input.js";import{StyledModal as a}from"../modals/styledModal.js";import{Spinner as h}from"../spinner/Spinner.js";import{Tag as u}from"../tag/Tag.js";import{CollectionsScreen as p}from"./collectionScreen.js";import{ProductsScreen as m}from"./productScreen.js";import{RearrangeScreen as g}from"./rearrangeScreen.js";import{collectionsReducer as C,selectedColectionsReducer as b,CollectionIdContext as v}from"./reducers.js";import{SearchScreen as f}from"./searchScreen.js";import{SelectedScreen as y}from"./selectedScreen.js";import{ContainerStyle as S,ScrollContainerStyle as j}from"./style.js";import{OUT_OF_STOCK_ACTION as x}from"./type.js";const k=k=>{const{storeId:P,selectedItems:I,onClose:O,visible:T,zIndex:D,limit:F,hideCollectionCheckbox:E,hideProductCheckbox:w,outOfStockAction:R=x.BLUR,hideVariantCheckbox:A,selectProductsFromCustomCollection:B,hideSelectionCount:L,title:z,width:G,startupScreen:H="collections",rearrangeAfterSelectionEnabled:V}=k,[$,K]=r(C,{}),[M,U]=s(H),[Y,q]=s("grid"),[J,N]=s(""),[Q,W]=s(0),[X,Z]=s(!1),[_,ee]=s(0),[te,oe]=s(""),[ce,re]=s(!1),[se,ie]=s(!1),[ne,le]=s(),[de,ae]=r(b,Object.keys(I).length>0?I:{});i((()=>{Z(!0),ie(!0),k.collectionFetcher(Q,P).then((e=>{K({type:"fetched",data:(null==e?void 0:e.collections)||{}}),Z(!1),W((e=>e+1)),ie(!1)})).catch()}),[]),i((()=>{let e=0;Object.keys(de||[]).forEach((t=>{var o;Object.keys((null===(o=de[t])||void 0===o?void 0:o.products)||[]).forEach((o=>{var c,r;Object.keys((null===(r=null===(c=de[t].products)||void 0===c?void 0:c[o])||void 0===r?void 0:r.variants)||[]).forEach((()=>{e+=1}))}))})),ee(e)})),i((()=>{var e;J&&!(null===(e=null==$?void 0:$[J])||void 0===e?void 0:e.products)&&(Z(!0),k.productFetcher(J,P).then((e=>{Object.keys(e).length&&K({type:"productsFetched",data:{collectionId:J,products:e}}),Z(!1)})).catch())}),[J]),i((()=>{const e=setTimeout((()=>{"rearrange"!==H&&(te.length?(re(!0),k.searchFetcher(P,te).then((e=>{le(Object.assign({},e)),U("searchProducts"),Z(!1),re(!1)}))):U("collections"))}),800);return()=>clearTimeout(e)}),[te]);const he=()=>{ae({type:"reset",data:{}})};return e(a,Object.assign({zIndex:D,open:T,onClose:()=>{O(),he()},headingTitle:z||("collections"===M||"products"===M?"Select Products":"view"===M?"Selected Products":"searchProducts"===M?"Searched Products":"rearrange"===M?"Rearrange Products":void 0),footerShadow:!0,centralContainerStyles:{width:G||"480px"},headerRightCustomElement:"rearrange"===M?(console.log("ignore:",q),e(t,{})):e(t,{}),primaryButton:{buttonText:X?"Loading...":"rearrange"===M?"Done":"Add",disabled:X||_<1||F&&_>F||!1,onClick:()=>{k.onAdd(de,_),he()}},footerLeftCustomElement:L?e(t,{}):F&&_>F?e(u,{tagText:`You can only select ${F} products`,type:"negative"}):e(l,_>0?{onClick:()=>{U(V?"rearrange":"view")},buttonText:`${_} products selected`,buttonType:["rearrange","view"].includes(M)?"tertiaryGray":"tertiary"}:{disabled:!0,buttonText:`${_} products selected`,buttonType:"tertiaryGray"})},{children:o(S,{children:[k.postHeader&&e("div",Object.assign({style:{padding:"0 24px"}},{children:k.postHeader})),!k.hideGlobalSearch&&e(t,{children:("collections"===M||"searchProducts"===M)&&e("div",Object.assign({style:{padding:"12px 24px",borderBottom:"1px solid #E0E0E0"}},{children:e(d,{noKeyDownChange:!0,noErrorHint:!0,rightIcon:{icon:()=>ce?e(h,{size:"small",color:n.content.primary}):e(c,{})},id:"listInput",height:"24px",type:"text",value:te,onChangeText:e=>{e.length&&e.trim().length?oe(e):oe("")}})}))}),o(j,{children:["collections"===M&&e(p,{customCollectionRestriction:k.customCollectionRestriction,dataLoading:se,collections:$,selectedCollectionsDispatch:ae,setCollectionId:N,setScreen:U,selectedCollections:de,collectionFetcher:k.collectionFetcher,storeId:P,collectionsDispatch:K,setSaveDisabled:Z,pagingControls:{curPage:Q,setCurPage:W},hideCollectionCheckbox:E}),"products"===M&&J&&e(v.Provider,Object.assign({value:J},{children:e(m,{hideInCollectionSearch:k.hideInCollectionSearch,customCollectionRestriction:k.customCollectionRestriction,productFetcher:k.productFetcher,setScreen:U,storeId:P,data:$[J],collectionsDispatch:K,selectedCollectionsDispatch:ae,selectedData:de,setSaveDisabled:Z,searchInCollectionFetcher:k.searchInCollectionFetcher,hideProductCheckbox:w,outOfStockAction:R,hideVariantCheckbox:A,selectProductsFromCustomCollection:B})})),"view"===M&&e(y,{selectedCollections:de||{},selectedCollectionsDispatch:ae,setScreen:U,collections:$}),"rearrange"===M&&e(g,{selectedCollections:de||{},selectedCollectionsDispatch:ae,setScreen:U,outOfStockAction:R,rearrangeViewType:"grid"===Y?"list":"grid"}),"searchProducts"===M&&e(f,{customCollectionRestriction:k.customCollectionRestriction,selectedCollections:de||{},searchedCollections:ne||{},selectedCollectionsDispatch:ae,setScreen:U,collections:$,onBackPress:()=>{oe(""),le({})}})]})]})}))};export{k as ProductPickerModal};
1
+ import{jsx as e,Fragment as t,jsxs as o}from"react/jsx-runtime";import c from"../../assets/icons/search.svg.js";import{useReducer as r,useState as i,useEffect as s}from"react";import{COLORS as n}from"../../constants/Theme.js";import{Button as l}from"../button/Button.js";import{Input as d}from"../input/Input.js";import{StyledModal as a}from"../modals/styledModal.js";import{Spinner as h}from"../spinner/Spinner.js";import{Tag as u}from"../tag/Tag.js";import{CollectionsScreen as p}from"./collectionScreen.js";import{ProductsScreen as m}from"./productScreen.js";import{RearrangeScreen as C}from"./rearrangeScreen.js";import{collectionsReducer as g,selectedColectionsReducer as b,CollectionIdContext as v}from"./reducers.js";import{SearchScreen as f}from"./searchScreen.js";import{SelectedScreen as y}from"./selectedScreen.js";import{ContainerStyle as S,ScrollContainerStyle as j}from"./style.js";import{OUT_OF_STOCK_ACTION as x}from"./type.js";const k=k=>{const{storeId:P,selectedItems:I,onClose:O,visible:T,zIndex:D,limit:F,hideCollectionCheckbox:E,hideProductCheckbox:w,outOfStockAction:R=x.BLUR,hideVariantCheckbox:A,selectProductsFromCustomCollection:B,hideSelectionCount:L,title:z,width:G,startupScreen:H="collections",rearrangeAfterSelectionEnabled:V}=k,[$,K]=r(g,{}),[M,U]=i(H),[Y,q]=i("grid"),[J,N]=i(""),[Q,W]=i(0),[X,Z]=i(!1),[_,ee]=i(0),[te,oe]=i(""),[ce,re]=i(!1),[ie,se]=i(!1),[ne,le]=i(),[de,ae]=r(b,Object.keys(I).length>0?I:{});s((()=>{Z(!0),se(!0),k.collectionFetcher(Q,P).then((e=>{K({type:"fetched",data:(null==e?void 0:e.collections)||{}}),Z(!1),W((e=>e+1)),se(!1)})).catch()}),[]),s((()=>{let e=0;Object.keys(de||[]).forEach((t=>{var o;Object.keys((null===(o=de[t])||void 0===o?void 0:o.products)||[]).forEach((o=>{var c,r;Object.keys((null===(r=null===(c=de[t].products)||void 0===c?void 0:c[o])||void 0===r?void 0:r.variants)||[]).forEach((()=>{e+=1}))}))})),ee(e)})),s((()=>{var e;J&&!(null===(e=null==$?void 0:$[J])||void 0===e?void 0:e.products)&&(Z(!0),k.productFetcher(J,P).then((e=>{Object.keys(e).length&&K({type:"productsFetched",data:{collectionId:J,products:e}}),Z(!1)})).catch())}),[J]),s((()=>{const e=setTimeout((()=>{"rearrange"!==H&&(te.length?(re(!0),k.searchFetcher(P,te).then((e=>{le(Object.assign({},e)),U("searchProducts"),Z(!1),re(!1)}))):U("collections"))}),800);return()=>clearTimeout(e)}),[te]);const he=()=>{ae({type:"reset",data:{}})};return e(a,Object.assign({zIndex:D,open:T,onClose:()=>{O(),he()},headingTitle:z||("collections"===M||"products"===M?"Select Products":"view"===M?"Selected Products":"searchProducts"===M?"Searched Products":"rearrange"===M?"Rearrange Products":void 0),footerShadow:!0,centralContainerStyles:{width:G||"480px"},headerRightCustomElement:"rearrange"===M?(q("grid"),e(t,{})):e(t,{}),primaryButton:{buttonText:X?"Loading...":"rearrange"===M?"Done":"Add",disabled:X||_<1||F&&_>F||!1,onClick:()=>{k.onAdd(de,_),he()}},footerLeftCustomElement:L?e(t,{}):F&&_>F?e(u,{tagText:`You can only select ${F} products`,type:"negative"}):e(l,_>0?{onClick:()=>{U(V?"rearrange":"view")},buttonText:`${_} products selected`,buttonType:["rearrange","view"].includes(M)?"tertiaryGray":"tertiary"}:{disabled:!0,buttonText:`${_} products selected`,buttonType:"tertiaryGray"})},{children:o(S,{children:[k.postHeader&&e("div",Object.assign({style:{padding:"0 24px"}},{children:k.postHeader})),!k.hideGlobalSearch&&e(t,{children:("collections"===M||"searchProducts"===M)&&e("div",Object.assign({style:{padding:"12px 24px",borderBottom:"1px solid #E0E0E0"}},{children:e(d,{noKeyDownChange:!0,noErrorHint:!0,rightIcon:{icon:()=>ce?e(h,{size:"small",color:n.content.primary}):e(c,{})},id:"listInput",height:"24px",type:"text",value:te,onChangeText:e=>{e.length&&e.trim().length?oe(e):oe("")}})}))}),o(j,{children:["collections"===M&&e(p,{customCollectionRestriction:k.customCollectionRestriction,dataLoading:ie,collections:$,selectedCollectionsDispatch:ae,setCollectionId:N,setScreen:U,selectedCollections:de,collectionFetcher:k.collectionFetcher,storeId:P,collectionsDispatch:K,setSaveDisabled:Z,pagingControls:{curPage:Q,setCurPage:W},hideCollectionCheckbox:E}),"products"===M&&J&&e(v.Provider,Object.assign({value:J},{children:e(m,{hideInCollectionSearch:k.hideInCollectionSearch,customCollectionRestriction:k.customCollectionRestriction,productFetcher:k.productFetcher,setScreen:U,storeId:P,data:$[J],collectionsDispatch:K,selectedCollectionsDispatch:ae,selectedData:de,setSaveDisabled:Z,searchInCollectionFetcher:k.searchInCollectionFetcher,hideProductCheckbox:w,outOfStockAction:R,hideVariantCheckbox:A,selectProductsFromCustomCollection:B})})),"view"===M&&e(y,{selectedCollections:de||{},selectedCollectionsDispatch:ae,setScreen:U,collections:$}),"rearrange"===M&&e(C,{selectedCollections:de||{},selectedCollectionsDispatch:ae,setScreen:U,outOfStockAction:R,rearrangeViewType:"grid"===Y?"list":"grid"}),"searchProducts"===M&&e(f,{customCollectionRestriction:k.customCollectionRestriction,selectedCollections:de||{},searchedCollections:ne||{},selectedCollectionsDispatch:ae,setScreen:U,collections:$,onBackPress:()=>{oe(""),le({})}})]})]})}))};export{k as ProductPickerModal};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bikdotai/bik-component-library",
3
- "version": "0.0.382-beta.7",
3
+ "version": "0.0.382-beta.8",
4
4
  "description": "Bik Component Library",
5
5
  "repository": {
6
6
  "type": "git",