@bikdotai/bik-component-library 0.0.455-beta.13 → 0.0.455-beta.ppi-1
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/analytics-chips-and-dropdowns/AnalyticsTrend.js +1 -1
- package/dist/cjs/components/product-picker-v2/ProductPickerTag.d.ts +8 -0
- package/dist/cjs/components/product-picker-v2/ProductPickerTag.js +1 -0
- package/dist/cjs/components/product-picker-v2/collectionScreen.d.ts +19 -0
- package/dist/cjs/components/product-picker-v2/collectionScreen.js +1 -1
- package/dist/cjs/components/product-picker-v2/helpers/ProductHelper.d.ts +2 -0
- package/dist/cjs/components/product-picker-v2/helpers/ProductHelper.js +1 -1
- package/dist/cjs/components/product-picker-v2/modal.d.ts +16 -3
- package/dist/cjs/components/product-picker-v2/modal.js +1 -1
- package/dist/cjs/components/product-picker-v2/productInfoOverlay.d.ts +11 -0
- package/dist/cjs/components/product-picker-v2/productInfoOverlay.js +39 -0
- package/dist/cjs/components/product-picker-v2/productScreen.d.ts +10 -3
- package/dist/cjs/components/product-picker-v2/productScreen.js +1 -1
- package/dist/cjs/components/product-picker-v2/rearrangeScreen.d.ts +3 -1
- package/dist/cjs/components/product-picker-v2/rearrangeScreen.js +1 -1
- package/dist/cjs/components/product-picker-v2/reducers.d.ts +7 -1
- package/dist/cjs/components/product-picker-v2/reducers.js +1 -1
- package/dist/cjs/components/product-picker-v2/searchScreen.d.ts +10 -3
- package/dist/cjs/components/product-picker-v2/searchScreen.js +1 -1
- package/dist/cjs/components/product-picker-v2/selectedScreen.d.ts +5 -1
- package/dist/cjs/components/product-picker-v2/selectedScreen.js +1 -1
- package/dist/cjs/components/product-picker-v2/style.d.ts +1 -0
- package/dist/cjs/components/product-picker-v2/style.js +13 -8
- package/dist/cjs/components/product-picker-v2/utility.d.ts +12 -0
- 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/template-context-mapper/utils/getFormattedMonthDate.js +1 -0
- package/dist/esm/components/analytics-chips-and-dropdowns/AnalyticsTrend.js +1 -1
- package/dist/esm/components/product-picker-v2/ProductPickerTag.d.ts +8 -0
- package/dist/esm/components/product-picker-v2/ProductPickerTag.js +1 -0
- package/dist/esm/components/product-picker-v2/collectionScreen.d.ts +19 -0
- package/dist/esm/components/product-picker-v2/collectionScreen.js +1 -1
- package/dist/esm/components/product-picker-v2/helpers/ProductHelper.d.ts +2 -0
- package/dist/esm/components/product-picker-v2/helpers/ProductHelper.js +1 -1
- package/dist/esm/components/product-picker-v2/modal.d.ts +16 -3
- package/dist/esm/components/product-picker-v2/modal.js +1 -1
- package/dist/esm/components/product-picker-v2/productInfoOverlay.d.ts +11 -0
- package/dist/esm/components/product-picker-v2/productInfoOverlay.js +39 -0
- package/dist/esm/components/product-picker-v2/productScreen.d.ts +10 -3
- package/dist/esm/components/product-picker-v2/productScreen.js +1 -1
- package/dist/esm/components/product-picker-v2/rearrangeScreen.d.ts +3 -1
- package/dist/esm/components/product-picker-v2/rearrangeScreen.js +1 -1
- package/dist/esm/components/product-picker-v2/reducers.d.ts +7 -1
- package/dist/esm/components/product-picker-v2/reducers.js +1 -1
- package/dist/esm/components/product-picker-v2/searchScreen.d.ts +10 -3
- package/dist/esm/components/product-picker-v2/searchScreen.js +1 -1
- package/dist/esm/components/product-picker-v2/selectedScreen.d.ts +5 -1
- package/dist/esm/components/product-picker-v2/selectedScreen.js +1 -1
- package/dist/esm/components/product-picker-v2/style.d.ts +1 -0
- package/dist/esm/components/product-picker-v2/style.js +13 -8
- package/dist/esm/components/product-picker-v2/utility.d.ts +12 -0
- 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/template-context-mapper/utils/getFormattedMonthDate.js +1 -0
- package/package.json +1 -1
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { Collection, SelectedItems } from '.';
|
|
3
|
-
import { SelectedCollectionsActions } from './reducers';
|
|
2
|
+
import { Collection, FbStatusFetcherReturn, SearchedItems, SelectedItems } from '.';
|
|
3
|
+
import { SearchReducerActions, SelectedCollectionsActions } from './reducers';
|
|
4
4
|
interface SearchScreenInterface {
|
|
5
5
|
customCollectionRestriction?: boolean;
|
|
6
6
|
selectedCollections: SelectedItems;
|
|
7
|
-
searchedCollections:
|
|
7
|
+
searchedCollections: SearchedItems;
|
|
8
|
+
searchedCollectionsDispatch: React.Dispatch<SearchReducerActions>;
|
|
8
9
|
selectedCollectionsDispatch: React.Dispatch<SelectedCollectionsActions>;
|
|
9
10
|
setScreen: React.Dispatch<React.SetStateAction<string>>;
|
|
11
|
+
setCollectionId: React.Dispatch<React.SetStateAction<string>>;
|
|
12
|
+
setSelectedCollectionId: React.Dispatch<React.SetStateAction<string>>;
|
|
10
13
|
collections: {
|
|
11
14
|
[key: string]: Collection;
|
|
12
15
|
};
|
|
@@ -15,6 +18,10 @@ interface SearchScreenInterface {
|
|
|
15
18
|
pickerType?: 'COLLECTION' | 'PRODUCT';
|
|
16
19
|
hideProductVariants?: boolean;
|
|
17
20
|
hideProductCheckbox?: boolean;
|
|
21
|
+
storeId: string;
|
|
22
|
+
fbStatusFetcher?: (storeId: string, variantIds: string[]) => FbStatusFetcherReturn;
|
|
23
|
+
hideCollectionCheckbox?: boolean;
|
|
24
|
+
renderWithoutModal?: boolean;
|
|
18
25
|
}
|
|
19
26
|
export declare const SearchScreen: (props: SearchScreenInterface) => import("react/jsx-runtime").JSX.Element;
|
|
20
27
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as o,jsx as
|
|
1
|
+
import{jsxs as o,jsx as e,Fragment as t}from"react/jsx-runtime";import l from"../../assets/icons/arrow_left.svg.js";import{useEffect as i}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;i((()=>{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 l=0,i=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=>l+=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=>i+=1))})),!(l<=0&&i>0)&&(i>0&&l!==i)}return!1},W=(o,e)=>{var t,l,i,c,d,r,s,n,u;let v=0,a=0;return!!((null===(l=null===(t=null==m?void 0:m[o])||void 0===t?void 0:t.products)||void 0===l?void 0:l[e])&&(null===(r=Object.keys((null===(d=null===(c=null===(i=null==f?void 0:f[o])||void 0===i?void 0:i.products)||void 0===c?void 0:c[e])||void 0===d?void 0:d.variants)||[]))||void 0===r||r.forEach((()=>a++)),Object.keys((null===(u=null===(n=null===(s=null==m?void 0:m[o])||void 0===s?void 0:s.products)||void 0===n?void 0:n[e])||void 0===u?void 0:u.variants)||[]).forEach((()=>v++)),v>0&&a!==v))};return o("div",{children:[o(u,{children:[e(c,{Icon:l,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=>{var t;return e(r,{customCollectionRestriction:h,data:null===(t=null==C?void 0:C.collections)||void 0===t?void 0:t[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,l;return Object.keys((null===(l=null===(t=null==C?void 0:C.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==C?void 0:C.products)||void 0===l?void 0:l.isCustom)&&(c=!0),e(n,{collectionId:o,upliftAdditions:(e,t)=>((o,e,t)=>{var l;const i=a(t,null===(l=null==C?void 0:C.products)||void 0===l?void 0:l[o]);y({type:e,data:Object.assign(Object.assign({},i),{isRestricted:h})})})(o,e,t),productId:t,data:(null===(i=null==C?void 0:C.products)||void 0===i?void 0:i[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};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { Collection, SelectedItems } from '.';
|
|
2
|
+
import { Collection, FbStatusFetcherReturn, SelectedItems } from '.';
|
|
3
3
|
import { SelectedCollectionsActions } from './reducers';
|
|
4
|
+
import { OUT_OF_STOCK_ACTION } from './type';
|
|
4
5
|
interface SelectedScreenInterface {
|
|
5
6
|
selectedCollections: SelectedItems;
|
|
6
7
|
selectedCollectionsDispatch: React.Dispatch<SelectedCollectionsActions>;
|
|
@@ -8,6 +9,9 @@ interface SelectedScreenInterface {
|
|
|
8
9
|
collections: {
|
|
9
10
|
[key: string]: Collection;
|
|
10
11
|
};
|
|
12
|
+
outOfStockAction?: OUT_OF_STOCK_ACTION;
|
|
13
|
+
storeId: string;
|
|
14
|
+
fbStatusFetcher?: (storeId: string, variantIds: string[]) => FbStatusFetcherReturn;
|
|
11
15
|
}
|
|
12
16
|
export declare const SelectedScreen: (props: SelectedScreenInterface) => import("react/jsx-runtime").JSX.Element;
|
|
13
17
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as
|
|
1
|
+
import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import r from"../../assets/icons/arrow_left.svg.js";import{useRef as l,useReducer as n,useEffect as c}from"react";import{IconButton as i}from"../icon-button/IconButton.js";import{BodyCaption as s}from"../TypographyStyle.js";import{EmptyState as d}from"./emptyState.js";import{ProductGroup as u}from"./productScreen.js";import{paginationReducer as a}from"./reducers.js";import{SelectedScreenHeader as v}from"./style.js";import{paginateSelectedItems as p,fetchFbStatusCollection as m}from"./utility.js";const f=f=>{const{selectedCollections:j,selectedCollectionsDispatch:g,setScreen:h,collections:y,outOfStockAction:b,storeId:S,fbStatusFetcher:k}=f,O=l(0),C=l(null),[I,P]=n(a,{});c((()=>{O.current=0;const e=p(j,10,0);P({type:"paginate",data:e}),m(e,S,P,k,"set"),O.current+=1}),[]),c((()=>{P({type:"filter",data:j})}),[j]),c((()=>{console.log("vj: observertarget",C.current);const e=new IntersectionObserver((e=>{if(console.log("vj: observertargetinside",e),e[0].isIntersecting&&(console.log("vj: nextPageRef",O.current),O.current>0)){const e=p(j,10,O.current);console.log("paginated inside observer target",{paginatedProducts:e,selectedCollections:j,curScreenData:I}),P({type:"paginate",data:e}),m(e,S,P,k,"update"),O.current+=1}}),{threshold:1});return C.current&&e.observe(C.current),()=>{C.current&&e.unobserve(C.current)}}),[C,j]);const w=(e,t)=>{var o,r,l,n,c,i,s,d,u;let a=0,v=0;return!!((null===(r=null===(o=null==j?void 0:j[e])||void 0===o?void 0:o.products)||void 0===r?void 0:r[t])&&(null===(i=Object.keys((null===(c=null===(n=null===(l=null==y?void 0:y[e])||void 0===l?void 0:l.products)||void 0===n?void 0:n[t])||void 0===c?void 0:c.variants)||[]))||void 0===i||i.forEach((()=>v++)),Object.keys((null===(u=null===(d=null===(s=null==j?void 0:j[e])||void 0===s?void 0:s.products)||void 0===d?void 0:d[t])||void 0===u?void 0:u.variants)||[]).forEach((()=>a++)),a>0&&v!==a))};return e("div",{children:[e(v,{children:[t(i,{Icon:r,onClick:()=>{h("collections")}}),t(s,{children:"Selected Products"})]}),e("div",{children:[Object.keys(I).length>0?t(o,{children:Object.keys(I).map((e=>{var o;return Object.keys((null===(o=null==I?void 0:I[e])||void 0===o?void 0:o.products)||[]).map((o=>{let r=!1;return(null==I?void 0:I.isCustom)&&(r=!0),t(u,{upliftAdditions:null,collectionId:e,productId:o,data:I[e].products[o],isProductPartiallyChecked:w(e,o),selectedData:j,selectedCollectionsDispatch:g,viewOnly:r,outOfStockAction:b},o)}))}))}):t(d,{title:"No Products Selected",subtitle:"Select products will appear here"}),t("div",{ref:C})]})]})};export{f as SelectedScreen};
|
|
@@ -3,6 +3,7 @@ export declare const ScrollContainerStyle: import("styled-components").StyledCom
|
|
|
3
3
|
export declare const CollectionCardStyle: import("styled-components").StyledComponent<"div", any, {
|
|
4
4
|
isDisabled: boolean;
|
|
5
5
|
isActive: boolean;
|
|
6
|
+
usedInSearch: boolean;
|
|
6
7
|
}, never>;
|
|
7
8
|
export declare const CollectionCardInfoStyle: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
8
9
|
export declare const CollectionCardDetailStyle: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import e from"styled-components";import{COLORS as i}from"../../constants/Theme.js";const t=e.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
background-color: white;
|
|
4
|
-
|
|
5
|
-
min-height: 600px;
|
|
4
|
+
height: 600px;
|
|
6
5
|
flex-direction: column;
|
|
7
6
|
`,o=e.div`
|
|
8
7
|
overflow-y: scroll;
|
|
@@ -11,7 +10,7 @@ import e from"styled-components";import{COLORS as i}from"../../constants/Theme.j
|
|
|
11
10
|
height: 64px;
|
|
12
11
|
background-color: ${e=>e.isDisabled?"#F0F0F0":e.isActive?i.background.positive.light:"white"};
|
|
13
12
|
border-bottom: 1px solid #e0e0e0;
|
|
14
|
-
padding: 12px 24px;
|
|
13
|
+
padding: ${e=>e.usedInSearch?"12px 16px":"12px 24px"};
|
|
15
14
|
display: flex;
|
|
16
15
|
flex-direction: row;
|
|
17
16
|
column-gap: 16px;
|
|
@@ -31,7 +30,7 @@ import e from"styled-components";import{COLORS as i}from"../../constants/Theme.j
|
|
|
31
30
|
display: flex;
|
|
32
31
|
flex-direction: column;
|
|
33
32
|
justify-content: center;
|
|
34
|
-
`,
|
|
33
|
+
`,p=e.div`
|
|
35
34
|
display: flex;
|
|
36
35
|
flex-direction: row;
|
|
37
36
|
max-height: 32px;
|
|
@@ -41,7 +40,10 @@ import e from"styled-components";import{COLORS as i}from"../../constants/Theme.j
|
|
|
41
40
|
align-items: center;
|
|
42
41
|
padding: 8px 16px;
|
|
43
42
|
margin-top: 16px;
|
|
44
|
-
|
|
43
|
+
position: sticky;
|
|
44
|
+
top: 0;
|
|
45
|
+
z-index: 10;
|
|
46
|
+
`,l=e.div`
|
|
45
47
|
display: flex;
|
|
46
48
|
flex-direction: row;
|
|
47
49
|
column-gap: 16px;
|
|
@@ -49,7 +51,7 @@ import e from"styled-components";import{COLORS as i}from"../../constants/Theme.j
|
|
|
49
51
|
border-bottom: 1px solid #e0e0e0;
|
|
50
52
|
align-items: center;
|
|
51
53
|
`,x=e.div`
|
|
52
|
-
height: 64px;
|
|
54
|
+
min-height: 64px;
|
|
53
55
|
background-color: ${e=>e.isActive?i.background.positive.light:"white"};
|
|
54
56
|
border-bottom: 1px solid #e0e0e0;
|
|
55
57
|
padding: 12px 16px;
|
|
@@ -72,11 +74,14 @@ import e from"styled-components";import{COLORS as i}from"../../constants/Theme.j
|
|
|
72
74
|
justify-content: flex-start;
|
|
73
75
|
align-items: center;
|
|
74
76
|
padding: 8px 16px;
|
|
77
|
+
position: sticky;
|
|
78
|
+
top: 0;
|
|
79
|
+
z-index: 10;
|
|
75
80
|
`,a=e.div`
|
|
76
81
|
display: flex;
|
|
77
82
|
flex-direction: column;
|
|
78
83
|
`,s=e.div`
|
|
79
|
-
height: 72px;
|
|
84
|
+
min-height: 72px;
|
|
80
85
|
background: white;
|
|
81
86
|
padding: 12px 16px;
|
|
82
87
|
display: flex;
|
|
@@ -107,4 +112,4 @@ import e from"styled-components";import{COLORS as i}from"../../constants/Theme.j
|
|
|
107
112
|
align-items: center;
|
|
108
113
|
border: 1px solid ${i.stroke.primary};
|
|
109
114
|
border-radius: 4px;
|
|
110
|
-
`;export{d as CollectionCardDetailStyle,r as CollectionCardInfoStyle,n as CollectionCardStyle,a as CollectionNameHolder,t as ContainerStyle,x as ProductCardStyle,
|
|
115
|
+
`;export{d as CollectionCardDetailStyle,r as CollectionCardInfoStyle,n as CollectionCardStyle,a as CollectionNameHolder,t as ContainerStyle,x as ProductCardStyle,l as ProductScreenCollectionCardStyle,p as ProductScreenHeader,o as ScrollContainerStyle,c as SelectedScreenHeader,g as VariantCardGridStyle,s as VariantCardListStyle};
|
|
@@ -1 +1,13 @@
|
|
|
1
|
+
import { Collection, FbStatusFetcherReturn, Product, SelectedItems } from './modal';
|
|
2
|
+
import { CollectionsActions } from './reducers';
|
|
1
3
|
export declare const liftTheStateUp: (payload: any, data: any) => any;
|
|
4
|
+
export declare function paginateSelectedItems(selectedItems: SelectedItems, limit: number, offset: number): {
|
|
5
|
+
[key: string]: Collection;
|
|
6
|
+
};
|
|
7
|
+
export declare const fetchFbStatusCollection: (data: SelectedItems, storeId: string, dispatcher: any, fbStatusFetcher?: ((storeId: string, variantIds: string[]) => FbStatusFetcherReturn) | undefined, dispatchType?: string) => void;
|
|
8
|
+
export declare const getVariantIdsToFetchAtProductLevel: (products: {
|
|
9
|
+
[key: string]: Product;
|
|
10
|
+
}, globalData?: Collection) => string[];
|
|
11
|
+
export declare const markVariantsAsApprovedProductsLevel: (products: {
|
|
12
|
+
[key: string]: Product;
|
|
13
|
+
}, dispatcher: React.Dispatch<CollectionsActions>, collectionId: string, curScreenData?: Collection, setCurScreenData?: React.Dispatch<React.SetStateAction<Collection>>) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{cloneDeep as
|
|
1
|
+
import{cloneDeep as o}from"lodash";const t=(t,l)=>{const n=o(l);if(delete n.products,(t=Object.assign(Object.assign({},t),{catalogOnlyData:n})).productId&&l.products){const d=o(l.products[t.productId]);(null==d?void 0:d.variants)&&delete d.variants,t=Object.assign(Object.assign({},t),{catalogOnlyData:n,productOnlyData:d})}return t};function l(o,t,l){var d;const i={};let v=0;console.log("paginated offset",l);for(const s in o)if(Object.prototype.hasOwnProperty.call(o,s)){const c=o[s],a=n(c.products,t,l-v);a&&Object.keys(a).length>0&&(i[s]=Object.assign(Object.assign({},c),{products:a})),v+=Object.keys(null!==(d=c.products)&&void 0!==d?d:{}).length}return i}function n(o,t,l){if(!o)return{};const n=Object.keys(o).slice(l,l+t),d={};return n.forEach((t=>{d[t]=o[t]})),d}const d=(o,t,l)=>{Object.keys(o).forEach((t=>{var l,n;const d=null!==(n=null===(l=o[t])||void 0===l?void 0:l.products)&&void 0!==n?n:{};Object.keys(d).forEach((l=>{var n,d,i,v;const s=null!==(v=null===(i=null===(d=null===(n=o[t])||void 0===n?void 0:n.products)||void 0===d?void 0:d[l])||void 0===i?void 0:i.variants)&&void 0!==v?v:{};Object.keys(s).forEach((n=>{var d,i,v,s;const c=null===(s=null===(v=null===(i=null===(d=o[t])||void 0===d?void 0:d.products)||void 0===i?void 0:i[l])||void 0===v?void 0:v.variants)||void 0===s?void 0:s[n];c&&!c.fbStatus&&(c.fbStatus="APPROVED")}))}))})),t({type:l,data:o})},i=function(o,t,l,n){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"paged";n||d(o,l,i);const v=(o=>{const t=[];return Object.keys(o).forEach((l=>{var n,d;const i=null!==(d=null===(n=o[l])||void 0===n?void 0:n.products)&&void 0!==d?d:{};Object.keys(i).forEach((n=>{var d,i,v,s;const c=null!==(s=null===(v=null===(i=null===(d=o[l])||void 0===d?void 0:d.products)||void 0===i?void 0:i[n])||void 0===v?void 0:v.variants)&&void 0!==s?s:{};Object.keys(c).forEach((d=>{var i,v,s,c;const a=null===(c=null===(s=null===(v=null===(i=o[l])||void 0===i?void 0:i.products)||void 0===v?void 0:v[n])||void 0===s?void 0:s.variants)||void 0===c?void 0:c[d];(null==a?void 0:a.fbStatus)||t.push(d)}))}))})),t})(o);console.log("vj: variantids",v),v.length>0&&n&&n(t,v).then((t=>{const n=Object.assign({},o);Object.keys(n).forEach((o=>{var l,d;const i=null!==(d=null===(l=n[o])||void 0===l?void 0:l.products)&&void 0!==d?d:{};Object.keys(i).forEach((l=>{var d,i,v,s;const c=null!==(s=null===(v=null===(i=null===(d=n[o])||void 0===d?void 0:d.products)||void 0===i?void 0:i[l])||void 0===v?void 0:v.variants)&&void 0!==s?s:{};Object.keys(c).forEach((d=>{var i,v,s,c;const a=null===(c=null===(s=null===(v=null===(i=n[o])||void 0===i?void 0:i.products)||void 0===v?void 0:v[l])||void 0===s?void 0:s.variants)||void 0===c?void 0:c[d];a&&"REJECTED"===t[d]?a.fbStatus="REJECTED":a&&"APPROVED"===t[d]&&(a.fbStatus="APPROVED")}))}))})),console.log("updated data",n,i),l({type:i,data:n})})).catch((t=>{console.error("Error in fbStatusFetcher",t),d(o,l,i)}))},v=(o,t)=>{const l=[];return Object.keys(null!=o?o:{}).forEach((n=>{var d,i;const v=null!==(i=null===(d=null==o?void 0:o[n])||void 0===d?void 0:d.variants)&&void 0!==i?i:{};Object.keys(v).forEach((d=>{var i,v,s,c,a;let u;u=t?null===(s=null===(v=null===(i=null==t?void 0:t.products)||void 0===i?void 0:i[n])||void 0===v?void 0:v.variants)||void 0===s?void 0:s[d]:null===(a=null===(c=null==o?void 0:o[n])||void 0===c?void 0:c.variants)||void 0===a?void 0:a[d],(null==u?void 0:u.fbStatus)||l.push(d)}))})),l},s=(o,t,l,n,d)=>{const i=Object.assign({},o);if(Object.keys(o).forEach((t=>{var l,n;Object.keys(null!==(n=null===(l=null==o?void 0:o[t])||void 0===l?void 0:l.variants)&&void 0!==n?n:{}).forEach((l=>{var n,d;const v=null===(n=null==o?void 0:o[t].variants)||void 0===n?void 0:n[l];v&&(v.fbStatus="APPROVED");const s=null===(d=null==i?void 0:i[t])||void 0===d?void 0:d.variants;s&&s[l]&&(s[l]=v)}))})),n&&d){const o=Object.assign({},n);o.products=i,d(o)}else t({type:"productsPaged",data:{collectionId:l,products:i}})};export{i as fetchFbStatusCollection,v as getVariantIdsToFetchAtProductLevel,t as liftTheStateUp,s as markVariantsAsApprovedProductsLevel,l as paginateSelectedItems};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as t,jsx as e
|
|
1
|
+
import{jsxs as t,jsx as e}from"react/jsx-runtime";import o from"../../assets/icons/delete.svg.js";import i from"../../assets/icons/drag_handle.svg.js";import{COLORS as r}from"../../constants/Theme.js";import{IconButton as a}from"../icon-button/IconButton.js";import{ShimmerImage as n}from"../shimmer-image/ShimmerImage.js";import{TitleRegular as c}from"../TypographyStyle.js";import{truncate as m}from"./collectionScreen.js";import{ProductPickerTag as s}from"./ProductPickerTag.js";import{VariantCardListStyle as l,VariantCardGridStyle as d}from"./style.js";import{Tooltip as h}from"../tooltips/Tooltip.js";const p=d=>{const{data:p,selectedCollectionsDispatch:g,outOfStockAction:u}=d,j=t=>{let e;return e=p.name.includes(p.productName)?p.name:`${p.productName} ${p.name}`,t?m(e,34,!0):e};return t(l,{children:[e(i,{width:24,height:24,color:r.content.placeholder}),e("div",{children:e(n,{width:40,height:40,imageUrl:p.image,alt:"Item",borderRadius:4},p.variantId)}),t("div",Object.assign({className:"tooltip-title-tag"},{children:[e(h,Object.assign({body:j(!1),placement:"bottom",delay:400},{children:e(c,{children:j(!0)})})),e(s,{isVariant:!0,data:p,outOfStockAction:u})]})),e(a,{Icon:()=>e(o,{width:24,height:24,color:r.content.placeholder}),onClick:()=>{g&&g({type:"variantUnselected",data:{productId:p.productId,variantId:p.variantId,collectionId:p.collectionId}}),d.onDelete&&d.onDelete()}})]})},g=t=>{const{data:o}=t;return e(d,{children:e(h,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{g as VariantCardGridView,p as VariantCardListView};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const t=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function e(e){if("string"==typeof e)return e;const n=t[e.getMonth()],r=e.getDate();return`${n} ${r<10?"0":""}${r}`}export{e as getFormattedMonthDate};
|