@bikdotai/bik-component-library 0.0.455-beta.ppi-23 → 0.0.455-beta.ppi-25
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/product-picker-v2/rearrangeScreen.js +1 -1
- package/dist/cjs/components/product-picker-v2/searchScreen.js +1 -1
- package/dist/esm/components/product-picker-v2/rearrangeScreen.js +1 -1
- package/dist/esm/components/product-picker-v2/searchScreen.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("../../assets/icons/arrow_left.svg.js"),r=require("react"),s=require("react-beautiful-dnd"),c=require("../../constants/Theme.js"),o=require("../icon-button/IconButton.js"),i=require("../TypographyStyle.js"),n=require("./emptyState.js"),a=require("./helpers/ProductHelper.js"),l=require("./style.js"),d=require("./utility.js"),u=require("./variantComponents.js");exports.RearrangeScreen=p=>{const{selectedCollections:j,selectedCollectionsDispatch:S,setScreen:h,rearrangeViewType:y,outOfStockAction:f,scrollContainerRef:x,storeId:q,fbStatusFetcher:C}=p,[O,g]=r.useState(a.parseSelectedVariantsToArray(j));r.useEffect((()=>{
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("../../assets/icons/arrow_left.svg.js"),r=require("react"),s=require("react-beautiful-dnd"),c=require("../../constants/Theme.js"),o=require("../icon-button/IconButton.js"),i=require("../TypographyStyle.js"),n=require("./emptyState.js"),a=require("./helpers/ProductHelper.js"),l=require("./style.js"),d=require("./utility.js"),u=require("./variantComponents.js");exports.RearrangeScreen=p=>{const{selectedCollections:j,selectedCollectionsDispatch:S,setScreen:h,rearrangeViewType:y,outOfStockAction:f,scrollContainerRef:x,storeId:q,fbStatusFetcher:C}=p,[O,g]=r.useState(a.parseSelectedVariantsToArray(j));r.useEffect((()=>{g(a.parseSelectedVariantsToArray(j))}),[j]),r.useEffect((()=>{var e;null===(e=null==x?void 0:x.current)||void 0===e||e.scrollTo({top:0}),d.fetchFbStatusCollection(j,q,S,C,"update")}),[]);return e.jsxs(s.DragDropContext,Object.assign({onDragEnd:e=>{if(!e.destination)return;const t=O,[r]=t.splice(e.source.index,1);t.splice(e.destination.index,0,r),t.forEach(((e,t)=>{e.displayOrder=t})),g(t)}},{children:[e.jsxs(l.SelectedScreenHeader,{children:[e.jsx(o.IconButton,{Icon:t.default,width:16,height:16,color:c.COLORS.content.secondary,onClick:()=>{h("collections")}}),e.jsx(i.BodyCaption,Object.assign({color:c.COLORS.content.secondary},{children:"All Products"}))]}),Object.keys(j).length>0?"list"===y?e.jsx(u.VariantsList,{selectedVariants:O,setSelectedVariants:g,selectedCollectionsDispatch:S,outOfStockAction:f}):e.jsx(u.VariantsGrid,{selectedVariants:O,setSelectedVariants:g,selectedCollectionsDispatch:S}):e.jsx(n.EmptyState,{title:"No Products Selected",subtitle:"Selected products will appear here"})]}))};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),o=require("../../assets/icons/arrow_left.svg.js"),t=require("react"),l=require("../icon-button/IconButton.js"),i=require("../TypographyStyle.js"),c=require("./collectionScreen.js"),d=require("./emptyState.js"),s=require("./productScreen.js"),r=require("./style.js"),n=require("./utility.js");exports.SearchScreen=u=>{const{customCollectionRestriction:a,selectedCollections:v,searchedCollections:h,searchedCollectionsDispatch:p,selectedCollectionsDispatch:j,setScreen:C,collections:y,onBackPress:k,hideVariantCheckbox:b,pickerType:x,hideProductVariants:f,hideProductCheckbox:S,storeId:O,fbStatusFetcher:m,setCollectionId:P,setSelectedCollectionId:I,hideCollectionCheckbox:g,renderWithoutModal:q}=u;t.useEffect((()=>{var e;n.fetchFbStatusCollection(null!==(e=h.products)&&void 0!==e?e:{},O,p,m,"setProducts")}),[null==h?void 0:h.products]);const E=!!a&&(null==v?void 0:v.isCustom),D=e=>{var o,t;let l=0,i=0;if(v[e]){const c=null===(o=y[e])||void 0===o?void 0:o.products;c&&Object.keys(c).forEach((e=>{var o;const t=null===(o=c[e])||void 0===o?void 0:o.variants;t&&Object.keys(t).forEach((e=>l+=1))}));const d=null===(t=v[e])||void 0===t?void 0:t.products;return d&&Object.keys(d).forEach((e=>{var o;const t=null===(o=d[e])||void 0===o?void 0:o.variants;t&&Object.keys(t).forEach((e=>i+=1))})),!(l<=0&&i>0)&&(i>0&&l!==i)}return!1},F=(e,o)=>{var t,l,i,c,d,s,r,n,u,a;let p=0,j=0;return!!((null===(l=null===(t=null==v?void 0:v[e])||void 0===t?void 0:t.products)||void 0===l?void 0:l[o])&&(null===(r=Object.keys((null===(s=null===(d=null===(c=null===(i=h.products)||void 0===i?void 0:i[e])||void 0===c?void 0:c.products)||void 0===d?void 0:d[o])||void 0===s?void 0:s.variants)||[]))||void 0===r||r.forEach((()=>j++)),Object.keys((null===(a=null===(u=null===(n=null==v?void 0:v[e])||void 0===n?void 0:n.products)||void 0===u?void 0:u[o])||void 0===a?void 0:a.variants)||[]).forEach((()=>p++)),p>0&&j!==p))};return e.jsxs("div",{children:[e.jsxs(r.SelectedScreenHeader,{children:[e.jsx(l.IconButton,{Icon:o.default,onClick:()=>{C("collections"),k()}}),e.jsx(i.BodyCaption,{children:"Searched Products"})]}),e.jsx("div",{children:Object.keys(null==h?void 0:h.products).length||Object.keys(null==h?void 0:h.collections).length?e.jsxs(e.Fragment,{children:[e.jsx(e.Fragment,{children:Object.keys(null==h?void 0:h.collections).map((o=>e.jsx(c.CollectionCard,{customCollectionRestriction:a,data:null==y?void 0:y[o],isDisabled:E&&!(null==v?void 0:v[o]),isChecked:!!(null==v?void 0:v[o]),isPartiallyChecked:D(o),selectedCollectionsDispatch:j,setCollectionId:P,setSelectedCollectionId:I,setScreen:C,id:o,hideCollectionCheckbox:g||"-1"===o,selectedCollections:v,renderWithoutModal:q,pickerType:x,usedInSearch:!0},o)))}),e.jsx(e.Fragment,{children:Object.keys(null==h?void 0:h.products).map((o=>{var t,l;return Object.keys((null===(l=null===(t=null==h?void 0:h.products)||void 0===t?void 0:t[o])||void 0===l?void 0:l.products)||[]).map((t=>{var l,i;let c=!1;return(null===(l=null==h?void 0:h.products)||void 0===l?void 0:l.isCustom)&&(c=!0),e.jsx(s.ProductGroup,{collectionId:o,upliftAdditions:(e,t)=>((e,o,t)=>{var l;const i=n.liftTheStateUp(t,null===(l=null==h?void 0:h.products)||void 0===l?void 0:l[e]);j({type:o,data:Object.assign(Object.assign({},i),{isRestricted:a})})})(o,e,t),productId:t,data:(null===(i=null==h?void 0:h.products)||void 0===i?void 0:i[o].products)[t],isProductPartiallyChecked:F(o,t),selectedData:v,selectedCollectionsDispatch:j,viewOnly:c,hideProductCheckbox:S,hideVariantCheckbox:b,hideProductVariants:f,pickerType:x},t)}))}))})]}):e.jsx(d.EmptyState,{title:"No search results found",subtitle:"We couldn’t find the product you were looking for."})})]})};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as t,jsx as e}from"react/jsx-runtime";import o from"../../assets/icons/arrow_left.svg.js";import{useState as r,useEffect as s}from"react";import{DragDropContext as c}from"react-beautiful-dnd";import{COLORS as i}from"../../constants/Theme.js";import{IconButton as n}from"../icon-button/IconButton.js";import{BodyCaption as l}from"../TypographyStyle.js";import{EmptyState as a}from"./emptyState.js";import{parseSelectedVariantsToArray as d}from"./helpers/ProductHelper.js";import{SelectedScreenHeader as p}from"./style.js";import{fetchFbStatusCollection as m}from"./utility.js";import{VariantsList as u,VariantsGrid as f}from"./variantComponents.js";const h=h=>{const{selectedCollections:j,selectedCollectionsDispatch:y,setScreen:S,rearrangeViewType:g,outOfStockAction:b,scrollContainerRef:C,storeId:O,fbStatusFetcher:v}=h,[V,k]=r(d(j));s((()=>{
|
|
1
|
+
import{jsxs as t,jsx as e}from"react/jsx-runtime";import o from"../../assets/icons/arrow_left.svg.js";import{useState as r,useEffect as s}from"react";import{DragDropContext as c}from"react-beautiful-dnd";import{COLORS as i}from"../../constants/Theme.js";import{IconButton as n}from"../icon-button/IconButton.js";import{BodyCaption as l}from"../TypographyStyle.js";import{EmptyState as a}from"./emptyState.js";import{parseSelectedVariantsToArray as d}from"./helpers/ProductHelper.js";import{SelectedScreenHeader as p}from"./style.js";import{fetchFbStatusCollection as m}from"./utility.js";import{VariantsList as u,VariantsGrid as f}from"./variantComponents.js";const h=h=>{const{selectedCollections:j,selectedCollectionsDispatch:y,setScreen:S,rearrangeViewType:g,outOfStockAction:b,scrollContainerRef:C,storeId:O,fbStatusFetcher:v}=h,[V,k]=r(d(j));s((()=>{k(d(j))}),[j]),s((()=>{var t;null===(t=null==C?void 0:C.current)||void 0===t||t.scrollTo({top:0}),m(j,O,y,v,"update")}),[]);return t(c,Object.assign({onDragEnd:t=>{if(!t.destination)return;const e=V,[o]=e.splice(t.source.index,1);e.splice(t.destination.index,0,o),e.forEach(((t,e)=>{t.displayOrder=e})),k(e)}},{children:[t(p,{children:[e(n,{Icon:o,width:16,height:16,color:i.content.secondary,onClick:()=>{S("collections")}}),e(l,Object.assign({color:i.content.secondary},{children:"All Products"}))]}),Object.keys(j).length>0?"list"===g?e(u,{selectedVariants:V,setSelectedVariants:k,selectedCollectionsDispatch:y,outOfStockAction:b}):e(f,{selectedVariants:V,setSelectedVariants:k,selectedCollectionsDispatch:y}):e(a,{title:"No Products Selected",subtitle:"Selected products will appear here"})]}))};export{h as RearrangeScreen};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as o,jsx as e,Fragment as t}from"react/jsx-runtime";import
|
|
1
|
+
import{jsxs as o,jsx as e,Fragment as t}from"react/jsx-runtime";import i from"../../assets/icons/arrow_left.svg.js";import{useEffect as l}from"react";import{IconButton as c}from"../icon-button/IconButton.js";import{BodyCaption as d}from"../TypographyStyle.js";import{CollectionCard as r}from"./collectionScreen.js";import{EmptyState as s}from"./emptyState.js";import{ProductGroup as n}from"./productScreen.js";import{SelectedScreenHeader as u}from"./style.js";import{fetchFbStatusCollection as v,liftTheStateUp as a}from"./utility.js";const p=p=>{const{customCollectionRestriction:h,selectedCollections:m,searchedCollections:C,searchedCollectionsDispatch:k,selectedCollectionsDispatch:y,setScreen:b,collections:f,onBackPress:j,hideVariantCheckbox:O,pickerType:S,hideProductVariants:I,hideProductCheckbox:P,storeId:x,fbStatusFetcher:g,setCollectionId:D,setSelectedCollectionId:E,hideCollectionCheckbox:T,renderWithoutModal:V}=p;l((()=>{var o;v(null!==(o=C.products)&&void 0!==o?o:{},x,k,g,"setProducts")}),[null==C?void 0:C.products]);const w=!!h&&(null==m?void 0:m.isCustom),R=o=>{var e,t;let i=0,l=0;if(m[o]){const c=null===(e=f[o])||void 0===e?void 0:e.products;c&&Object.keys(c).forEach((o=>{var e;const t=null===(e=c[o])||void 0===e?void 0:e.variants;t&&Object.keys(t).forEach((o=>i+=1))}));const d=null===(t=m[o])||void 0===t?void 0:t.products;return d&&Object.keys(d).forEach((o=>{var e;const t=null===(e=d[o])||void 0===e?void 0:e.variants;t&&Object.keys(t).forEach((o=>l+=1))})),!(i<=0&&l>0)&&(l>0&&i!==l)}return!1},W=(o,e)=>{var t,i,l,c,d,r,s,n,u,v;let a=0,p=0;return!!((null===(i=null===(t=null==m?void 0:m[o])||void 0===t?void 0:t.products)||void 0===i?void 0:i[e])&&(null===(s=Object.keys((null===(r=null===(d=null===(c=null===(l=C.products)||void 0===l?void 0:l[o])||void 0===c?void 0:c.products)||void 0===d?void 0:d[e])||void 0===r?void 0:r.variants)||[]))||void 0===s||s.forEach((()=>p++)),Object.keys((null===(v=null===(u=null===(n=null==m?void 0:m[o])||void 0===n?void 0:n.products)||void 0===u?void 0:u[e])||void 0===v?void 0:v.variants)||[]).forEach((()=>a++)),a>0&&p!==a))};return o("div",{children:[o(u,{children:[e(c,{Icon:i,onClick:()=>{b("collections"),j()}}),e(d,{children:"Searched Products"})]}),e("div",{children:Object.keys(null==C?void 0:C.products).length||Object.keys(null==C?void 0:C.collections).length?o(t,{children:[e(t,{children:Object.keys(null==C?void 0:C.collections).map((o=>e(r,{customCollectionRestriction:h,data:null==f?void 0:f[o],isDisabled:w&&!(null==m?void 0:m[o]),isChecked:!!(null==m?void 0:m[o]),isPartiallyChecked:R(o),selectedCollectionsDispatch:y,setCollectionId:D,setSelectedCollectionId:E,setScreen:b,id:o,hideCollectionCheckbox:T||"-1"===o,selectedCollections:m,renderWithoutModal:V,pickerType:S,usedInSearch:!0},o)))}),e(t,{children:Object.keys(null==C?void 0:C.products).map((o=>{var t,i;return Object.keys((null===(i=null===(t=null==C?void 0:C.products)||void 0===t?void 0:t[o])||void 0===i?void 0:i.products)||[]).map((t=>{var i,l;let c=!1;return(null===(i=null==C?void 0:C.products)||void 0===i?void 0:i.isCustom)&&(c=!0),e(n,{collectionId:o,upliftAdditions:(e,t)=>((o,e,t)=>{var i;const l=a(t,null===(i=null==C?void 0:C.products)||void 0===i?void 0:i[o]);y({type:e,data:Object.assign(Object.assign({},l),{isRestricted:h})})})(o,e,t),productId:t,data:(null===(l=null==C?void 0:C.products)||void 0===l?void 0:l[o].products)[t],isProductPartiallyChecked:W(o,t),selectedData:m,selectedCollectionsDispatch:y,viewOnly:c,hideProductCheckbox:P,hideVariantCheckbox:O,hideProductVariants:I,pickerType:S},t)}))}))})]}):e(s,{title:"No search results found",subtitle:"We couldn’t find the product you were looking for."})})]})};export{p as SearchScreen};
|