@bikdotai/bik-component-library 0.0.382-beta.5 → 0.0.382-beta.6
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 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("../../assets/icons/arrow_left.svg.js"),
|
|
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"),n=require("../icon-button/IconButton.js"),c=require("../TypographyStyle.js"),i=require("./emptyState.js"),o=require("./helpers/ProductHelper.js"),l=require("./style.js"),a=require("./variantComponents.js");exports.RearrangeScreen=d=>{const{selectedCollections:u,selectedCollectionsDispatch:p,setScreen:j,rearrangeViewType:S}=d;console.log("vj: inside rearrangeScreen",u);const[g,x]=r.useState(o.parseSelectedVariantsToArray(u));console.log("vj: selected variants",g),console.log("vj: selected Collections",u),r.useEffect((()=>{x(o.parseSelectedVariantsToArray(u))}),[u]);return e.jsxs(s.DragDropContext,Object.assign({onDragEnd:e=>{if(!e.destination)return;const t=g,[r]=t.splice(e.source.index,1);t.splice(e.destination.index,0,r),t.forEach(((e,t)=>{e.displayOrder=t})),console.log("vj: drag ended",t),x(t)}},{children:[e.jsxs(l.SelectedScreenHeader,{children:[e.jsx(n.IconButton,{Icon:t.default,onClick:()=>{j("collections")}}),e.jsx(c.BodyCaption,{children:"All Products"})]}),Object.keys(u).length>0?"list"===S?e.jsx(a.VariantsList,{selectedVariants:g,setSelectedVariants:x,selectedCollectionsDispatch:p}):e.jsx(a.VariantsGrid,{selectedVariants:g,setSelectedVariants:x,selectedCollectionsDispatch:p}):e.jsx(i.EmptyState,{title:"No Products Selected",subtitle:"Select products will appear here"})]}))};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as e,jsx as t}from"react/jsx-runtime";import o from"../../assets/icons/arrow_left.svg.js";import{useState as r}from"react";import{DragDropContext as
|
|
1
|
+
import{jsxs as e,jsx as t}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 n}from"react-beautiful-dnd";import{IconButton as c}from"../icon-button/IconButton.js";import{BodyCaption as l}from"../TypographyStyle.js";import{EmptyState as i}from"./emptyState.js";import{parseSelectedVariantsToArray as a}from"./helpers/ProductHelper.js";import{SelectedScreenHeader as d}from"./style.js";import{VariantsList as p,VariantsGrid as m}from"./variantComponents.js";const f=f=>{const{selectedCollections:j,selectedCollectionsDispatch:u,setScreen:g,rearrangeViewType:h}=f;console.log("vj: inside rearrangeScreen",j);const[y,v]=r(a(j));console.log("vj: selected variants",y),console.log("vj: selected Collections",j),s((()=>{v(a(j))}),[j]);return e(n,Object.assign({onDragEnd:e=>{if(!e.destination)return;const t=y,[o]=t.splice(e.source.index,1);t.splice(e.destination.index,0,o),t.forEach(((e,t)=>{e.displayOrder=t})),console.log("vj: drag ended",t),v(t)}},{children:[e(d,{children:[t(c,{Icon:o,onClick:()=>{g("collections")}}),t(l,{children:"All Products"})]}),Object.keys(j).length>0?t("list"===h?p:m,{selectedVariants:y,setSelectedVariants:v,selectedCollectionsDispatch:u}):t(i,{title:"No Products Selected",subtitle:"Select products will appear here"})]}))};export{f as RearrangeScreen};
|