@bikdotai/bik-component-library 0.0.455-beta.ppif-4 → 0.0.455
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/collectionScreen.d.ts +0 -19
- package/dist/cjs/components/product-picker-v2/collectionScreen.js +1 -1
- package/dist/cjs/components/product-picker-v2/helpers/ProductHelper.d.ts +0 -5
- package/dist/cjs/components/product-picker-v2/helpers/ProductHelper.js +1 -1
- package/dist/cjs/components/product-picker-v2/modal.d.ts +3 -16
- package/dist/cjs/components/product-picker-v2/modal.js +1 -1
- package/dist/cjs/components/product-picker-v2/productScreen.d.ts +37 -6
- package/dist/cjs/components/product-picker-v2/productScreen.js +1 -1
- package/dist/cjs/components/product-picker-v2/rearrangeScreen.d.ts +1 -3
- package/dist/cjs/components/product-picker-v2/rearrangeScreen.js +1 -1
- package/dist/cjs/components/product-picker-v2/reducers.d.ts +1 -25
- package/dist/cjs/components/product-picker-v2/reducers.js +1 -1
- package/dist/cjs/components/product-picker-v2/searchScreen.d.ts +3 -10
- package/dist/cjs/components/product-picker-v2/searchScreen.js +1 -1
- package/dist/cjs/components/product-picker-v2/selectedScreen.d.ts +1 -5
- package/dist/cjs/components/product-picker-v2/selectedScreen.js +1 -1
- package/dist/cjs/components/product-picker-v2/style.d.ts +0 -1
- package/dist/cjs/components/product-picker-v2/style.js +12 -32
- package/dist/cjs/components/product-picker-v2/utility.d.ts +0 -37
- package/dist/cjs/components/product-picker-v2/utility.js +1 -1
- package/dist/cjs/components/product-picker-v2/variant.js +1 -1
- package/dist/esm/components/product-picker-v2/collectionScreen.d.ts +0 -19
- package/dist/esm/components/product-picker-v2/collectionScreen.js +1 -1
- package/dist/esm/components/product-picker-v2/helpers/ProductHelper.d.ts +0 -5
- package/dist/esm/components/product-picker-v2/helpers/ProductHelper.js +1 -1
- package/dist/esm/components/product-picker-v2/modal.d.ts +3 -16
- package/dist/esm/components/product-picker-v2/modal.js +1 -1
- package/dist/esm/components/product-picker-v2/productScreen.d.ts +37 -6
- package/dist/esm/components/product-picker-v2/productScreen.js +1 -1
- package/dist/esm/components/product-picker-v2/rearrangeScreen.d.ts +1 -3
- package/dist/esm/components/product-picker-v2/rearrangeScreen.js +1 -1
- package/dist/esm/components/product-picker-v2/reducers.d.ts +1 -25
- package/dist/esm/components/product-picker-v2/reducers.js +1 -1
- package/dist/esm/components/product-picker-v2/searchScreen.d.ts +3 -10
- package/dist/esm/components/product-picker-v2/searchScreen.js +1 -1
- package/dist/esm/components/product-picker-v2/selectedScreen.d.ts +1 -5
- package/dist/esm/components/product-picker-v2/selectedScreen.js +1 -1
- package/dist/esm/components/product-picker-v2/style.d.ts +0 -1
- package/dist/esm/components/product-picker-v2/style.js +12 -32
- package/dist/esm/components/product-picker-v2/utility.d.ts +0 -37
- package/dist/esm/components/product-picker-v2/utility.js +1 -1
- package/dist/esm/components/product-picker-v2/variant.js +1 -1
- package/package.json +1 -1
- package/dist/cjs/components/product-picker-v2/ProductPickerShimmer.d.ts +0 -3
- package/dist/cjs/components/product-picker-v2/ProductPickerShimmer.js +0 -1
- package/dist/cjs/components/product-picker-v2/ProductPickerTag.d.ts +0 -19
- package/dist/cjs/components/product-picker-v2/ProductPickerTag.js +0 -1
- package/dist/cjs/components/product-picker-v2/product.d.ts +0 -43
- package/dist/cjs/components/product-picker-v2/product.js +0 -1
- package/dist/cjs/components/product-picker-v2/productInfoOverlay.d.ts +0 -17
- package/dist/cjs/components/product-picker-v2/productInfoOverlay.js +0 -39
- package/dist/esm/components/product-picker-v2/ProductPickerShimmer.d.ts +0 -3
- package/dist/esm/components/product-picker-v2/ProductPickerShimmer.js +0 -1
- package/dist/esm/components/product-picker-v2/ProductPickerTag.d.ts +0 -19
- package/dist/esm/components/product-picker-v2/ProductPickerTag.js +0 -1
- package/dist/esm/components/product-picker-v2/product.d.ts +0 -43
- package/dist/esm/components/product-picker-v2/product.js +0 -1
- package/dist/esm/components/product-picker-v2/productInfoOverlay.d.ts +0 -17
- package/dist/esm/components/product-picker-v2/productInfoOverlay.js +0 -39
|
@@ -1,26 +1,17 @@
|
|
|
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
|
-
height: 600px;
|
|
4
|
+
max-height: 600px;
|
|
5
|
+
min-height: 600px;
|
|
5
6
|
flex-direction: column;
|
|
6
7
|
`,o=e.div`
|
|
7
8
|
overflow-y: scroll;
|
|
8
9
|
overflow-x: hidden;
|
|
9
|
-
|
|
10
|
-
::-webkit-scrollbar {
|
|
11
|
-
display: block;
|
|
12
|
-
width: 8px;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
::-webkit-scrollbar-thumb {
|
|
16
|
-
background-color: #888;
|
|
17
|
-
border-radius: 8px;
|
|
18
|
-
}
|
|
19
10
|
`,n=e.div`
|
|
20
11
|
height: 64px;
|
|
21
12
|
background-color: ${e=>e.isDisabled?"#F0F0F0":e.isActive?i.background.positive.light:"white"};
|
|
22
13
|
border-bottom: 1px solid #e0e0e0;
|
|
23
|
-
padding:
|
|
14
|
+
padding: 12px 24px;
|
|
24
15
|
display: flex;
|
|
25
16
|
flex-direction: row;
|
|
26
17
|
column-gap: 16px;
|
|
@@ -40,7 +31,7 @@ import e from"styled-components";import{COLORS as i}from"../../constants/Theme.j
|
|
|
40
31
|
display: flex;
|
|
41
32
|
flex-direction: column;
|
|
42
33
|
justify-content: center;
|
|
43
|
-
`,
|
|
34
|
+
`,l=e.div`
|
|
44
35
|
display: flex;
|
|
45
36
|
flex-direction: row;
|
|
46
37
|
max-height: 32px;
|
|
@@ -50,18 +41,15 @@ import e from"styled-components";import{COLORS as i}from"../../constants/Theme.j
|
|
|
50
41
|
align-items: center;
|
|
51
42
|
padding: 8px 16px;
|
|
52
43
|
margin-top: 16px;
|
|
53
|
-
|
|
54
|
-
top: 0;
|
|
55
|
-
z-index: 10;
|
|
56
|
-
`,l=e.div`
|
|
44
|
+
`,p=e.div`
|
|
57
45
|
display: flex;
|
|
58
46
|
flex-direction: row;
|
|
59
47
|
column-gap: 16px;
|
|
60
48
|
padding: 12px 16px;
|
|
61
49
|
border-bottom: 1px solid #e0e0e0;
|
|
62
50
|
align-items: center;
|
|
63
|
-
`,
|
|
64
|
-
|
|
51
|
+
`,x=e.div`
|
|
52
|
+
height: 64px;
|
|
65
53
|
background-color: ${e=>e.isActive?i.background.positive.light:"white"};
|
|
66
54
|
border-bottom: 1px solid #e0e0e0;
|
|
67
55
|
padding: 12px 16px;
|
|
@@ -75,7 +63,7 @@ import e from"styled-components";import{COLORS as i}from"../../constants/Theme.j
|
|
|
75
63
|
cursor: pointer;
|
|
76
64
|
background-color: ${i.surface.hovered};
|
|
77
65
|
}
|
|
78
|
-
`,
|
|
66
|
+
`,c=e.div`
|
|
79
67
|
display: flex;
|
|
80
68
|
flex-direction: row;
|
|
81
69
|
max-height: 32px;
|
|
@@ -84,26 +72,18 @@ import e from"styled-components";import{COLORS as i}from"../../constants/Theme.j
|
|
|
84
72
|
justify-content: flex-start;
|
|
85
73
|
align-items: center;
|
|
86
74
|
padding: 8px 16px;
|
|
87
|
-
position: sticky;
|
|
88
|
-
top: 0;
|
|
89
|
-
z-index: 10;
|
|
90
75
|
`,a=e.div`
|
|
91
76
|
display: flex;
|
|
92
77
|
flex-direction: column;
|
|
93
78
|
`,s=e.div`
|
|
94
|
-
|
|
79
|
+
height: 72px;
|
|
95
80
|
background: white;
|
|
96
81
|
padding: 12px 16px;
|
|
97
82
|
display: flex;
|
|
98
83
|
flex-direction: row;
|
|
84
|
+
gap: 16px;
|
|
99
85
|
align-items: center;
|
|
100
|
-
justify-content:
|
|
101
|
-
|
|
102
|
-
.text-container {
|
|
103
|
-
display: flex;
|
|
104
|
-
justify-content: space-between;
|
|
105
|
-
gap: 16px;
|
|
106
|
-
}
|
|
86
|
+
justify-content: center;
|
|
107
87
|
|
|
108
88
|
.tooltip-title-tag {
|
|
109
89
|
display: flex;
|
|
@@ -127,4 +107,4 @@ import e from"styled-components";import{COLORS as i}from"../../constants/Theme.j
|
|
|
127
107
|
align-items: center;
|
|
128
108
|
border: 1px solid ${i.stroke.primary};
|
|
129
109
|
border-radius: 4px;
|
|
130
|
-
`;export{d as CollectionCardDetailStyle,r as CollectionCardInfoStyle,n as CollectionCardStyle,a as CollectionNameHolder,t as ContainerStyle,
|
|
110
|
+
`;export{d as CollectionCardDetailStyle,r as CollectionCardInfoStyle,n as CollectionCardStyle,a as CollectionNameHolder,t as ContainerStyle,x as ProductCardStyle,p as ProductScreenCollectionCardStyle,l as ProductScreenHeader,o as ScrollContainerStyle,c as SelectedScreenHeader,g as VariantCardGridStyle,s as VariantCardListStyle};
|
|
@@ -1,38 +1 @@
|
|
|
1
|
-
import { Collection, FbStatusFetcherReturn, Product, SelectedItems } from './modal';
|
|
2
|
-
import { CollectionsActions } from './reducers';
|
|
3
1
|
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
|
-
/**
|
|
8
|
-
* 3 scenarios.
|
|
9
|
-
* 1. If no api is provided -> marks everything as approved.
|
|
10
|
-
* 2. If api is success -> sets the status
|
|
11
|
-
* 3. If api is failure -> marks everything as approved.
|
|
12
|
-
*
|
|
13
|
-
* We first get the variant ids to fetch and only if we have variant ids, we call api.
|
|
14
|
-
*/
|
|
15
|
-
export declare const fetchFbStatusCollection: (data: SelectedItems, storeId: string, dispatcher: any, fbStatusFetcher?: ((storeId: string, variantIds: string[]) => FbStatusFetcherReturn) | undefined, dispatchType?: string) => void;
|
|
16
|
-
/**
|
|
17
|
-
* Instead of collection level, we do it product level.
|
|
18
|
-
*
|
|
19
|
-
* For more info refer @function getVariantIdsToFetch
|
|
20
|
-
*/
|
|
21
|
-
export declare const getVariantIdsToFetchAtProductLevel: (products: {
|
|
22
|
-
[key: string]: Product;
|
|
23
|
-
}, globalData?: Collection) => string[];
|
|
24
|
-
/**
|
|
25
|
-
* Instead of collection level, we do it product level.
|
|
26
|
-
*
|
|
27
|
-
* For more info refer @function markVariantsAsApproved
|
|
28
|
-
*/
|
|
29
|
-
export declare const markVariantsAsApprovedProductsLevel: (products: {
|
|
30
|
-
[key: string]: Product;
|
|
31
|
-
}, dispatcher: React.Dispatch<CollectionsActions>, collectionId: string, curScreenData?: Collection, setCurScreenData?: React.Dispatch<React.SetStateAction<Collection>>) => void;
|
|
32
|
-
/**
|
|
33
|
-
* If product has only one variant and variant name has product name, returns false.
|
|
34
|
-
* Other cases returns true.
|
|
35
|
-
*/
|
|
36
|
-
export declare const shouldShowVariant: (data: Product) => boolean;
|
|
37
|
-
export declare const isProductPartiallyChecked: (collectionId: string, productId: string, selectedData: SelectedItems, currentCollection: Collection) => boolean;
|
|
38
|
-
export declare const isCollectionPartiallyChecked: (collectionId: string, collection: Collection, selectedCollections: SelectedItems) => boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{cloneDeep as
|
|
1
|
+
import{cloneDeep as t}from"lodash";const a=(a,s)=>{const o=t(s);if(delete o.products,(a=Object.assign(Object.assign({},a),{catalogOnlyData:o})).productId&&s.products){const c=t(s.products[a.productId]);(null==c?void 0:c.variants)&&delete c.variants,a=Object.assign(Object.assign({},a),{catalogOnlyData:o,productOnlyData:c})}return a};export{a as liftTheStateUp};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as t,jsx as e}from"react/jsx-runtime";import
|
|
1
|
+
import{jsxs as t,jsx as e,Fragment as o}from"react/jsx-runtime";import i from"../../assets/icons/delete.svg.js";import r from"../../assets/icons/drag_handle.svg.js";import{COLORS as a}from"../../constants/Theme.js";import{IconButton as n}from"../icon-button/IconButton.js";import{ShimmerImage as l}from"../shimmer-image/ShimmerImage.js";import{TitleRegular as s}from"../TypographyStyle.js";import{truncate as c}from"./collectionScreen.js";import{ProductHelper as m}from"./helpers/ProductHelper.js";import{VariantCardListStyle as d,VariantCardGridStyle as h}from"./style.js";import{Tooltip as p}from"../tooltips/Tooltip.js";import{Tag as g}from"../tag/Tag.js";const j=h=>{const{data:j,selectedCollectionsDispatch:u,outOfStockAction:f}=h,b=m.getProductLabels(j,f),y=t=>{let e;return e=j.name.includes(j.productName)?j.name:`${j.productName} ${j.name}`,t?c(e,34,!0):e};return t(d,{children:[e(r,{width:24,height:24,color:a.content.placeholder}),e("div",{children:e(l,{width:40,height:40,imageUrl:j.image,alt:"Item",borderRadius:4},j.variantId)}),t("div",Object.assign({className:"tooltip-title-tag"},{children:[e(p,Object.assign({body:y(!1),placement:"bottom",delay:400},{children:e(s,{children:y(!0)})})),b?e("div",Object.assign({style:{width:90,display:"flex"}},{children:e(g,{tagText:b,type:"warning",theme:"light"})})):e(o,{})]})),e(n,{Icon:()=>e(i,{width:24,height:24,color:a.content.placeholder}),onClick:()=>{u&&u({type:"variantUnselected",data:{productId:j.productId,variantId:j.variantId,collectionId:j.collectionId}}),h.onDelete&&h.onDelete()}})]})},u=t=>{const{data:o}=t;return e(h,{children:e(p,Object.assign({body:o.name,alwaysVisible:!1,variant:"dark",placement:"bottom"},{children:e(l,{width:72,height:72,imageUrl:o.image,alt:"Item",borderRadius:4})}))})};export{u as VariantCardGridView,j as VariantCardListView};
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("../shimmer/ShimmerComponent/BikShimmer.js");exports.ProductPickerShimmer=i=>{const{limit:t}=i;return e.jsx(e.Fragment,{children:Array.from({length:null!=t?t:5}).map(((i,t)=>e.jsx("div",Object.assign({style:{borderBottom:"1px solid #E0E0E0"}},{children:e.jsx(r.BikShimmer,{boxes:[{height:"64px",width:"100%",marginTop:"0px"}]})}),t)))})};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { Product, ProductVariant } from './modal';
|
|
2
|
-
import { OUT_OF_STOCK_ACTION } from './type';
|
|
3
|
-
export type ProductPickerTagType = {
|
|
4
|
-
isVariant: boolean;
|
|
5
|
-
data: Product | ProductVariant;
|
|
6
|
-
outOfStockAction?: OUT_OF_STOCK_ACTION;
|
|
7
|
-
};
|
|
8
|
-
/**
|
|
9
|
-
* Used in Product Screen, Search Screen, Selected Screen and Rearrange Screen.
|
|
10
|
-
* Wherever product card is shown, we use this component.
|
|
11
|
-
*
|
|
12
|
-
* New logic: When product has only one variant and variant name is same as product name,
|
|
13
|
-
* we consider that a variant and do operations as variant.
|
|
14
|
-
*
|
|
15
|
-
* Note: If there is no Fb rejected tag in the variant, we show a shimmer,
|
|
16
|
-
* meanwhile hit the API to get FB status.
|
|
17
|
-
*
|
|
18
|
-
*/
|
|
19
|
-
export declare const ProductPickerTag: (props: ProductPickerTagType) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("../shimmer/ShimmerComponent/BikShimmer.js"),r=require("../tag/Tag.js"),i=require("./helpers/ProductHelper.js");exports.ProductPickerTag=s=>{var l,a;const{isVariant:n,data:o,outOfStockAction:u}=s;let d=o,c=n;1===Object.keys(null!==(l=null==o?void 0:o.variants)&&void 0!==l?l:{}).length&&(d=Object.values(null!==(a=null==o?void 0:o.variants)&&void 0!==a?a:{})[0],c=!0);const p=i.ProductHelper.getProductLabels(d,u),g=i.ProductHelper.getTagType(null!=p?p:"");return e.jsx("div",Object.assign({style:{display:"flex"}},{children:!(null==d?void 0:d.fbStatus)&&c?e.jsx(t.BikShimmer,{boxes:[{height:"24px",width:"100px",marginTop:"0px"}]}):p?e.jsx("div",Object.assign({style:{display:"flex"}},{children:e.jsx(r.Tag,{tagText:p,type:g,theme:"light"})})):e.jsx(e.Fragment,{})}))};
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { Product, ProductVariant, SelectedItems } from './modal';
|
|
3
|
-
import { SelectedCollectionsActions } from './reducers';
|
|
4
|
-
import { OUT_OF_STOCK_ACTION } from './type';
|
|
5
|
-
interface ProductGroupInterface {
|
|
6
|
-
collectionId: string;
|
|
7
|
-
productId: string;
|
|
8
|
-
data: Product;
|
|
9
|
-
selectedData: SelectedItems;
|
|
10
|
-
selectedCollectionsDispatch: React.Dispatch<SelectedCollectionsActions>;
|
|
11
|
-
viewOnly: boolean;
|
|
12
|
-
isProductPartiallyChecked?: boolean;
|
|
13
|
-
upliftAdditions: any;
|
|
14
|
-
hideProductCheckbox?: boolean;
|
|
15
|
-
outOfStockAction?: OUT_OF_STOCK_ACTION;
|
|
16
|
-
hideVariantCheckbox?: boolean;
|
|
17
|
-
hideProductVariants?: boolean;
|
|
18
|
-
showProductDetailInfoIcon?: boolean;
|
|
19
|
-
pickerType?: 'COLLECTION' | 'PRODUCT';
|
|
20
|
-
onProductDetailClick?: (productData: Product | ProductVariant) => void;
|
|
21
|
-
}
|
|
22
|
-
export declare const ProductGroup: (props: ProductGroupInterface) => import("react/jsx-runtime").JSX.Element;
|
|
23
|
-
interface ProductCardInterface {
|
|
24
|
-
isVariant: boolean;
|
|
25
|
-
data: Product | ProductVariant;
|
|
26
|
-
productId: string;
|
|
27
|
-
collectionId: string;
|
|
28
|
-
variantId?: string;
|
|
29
|
-
isSelected: boolean;
|
|
30
|
-
selectedCollectionsDispatch: React.Dispatch<SelectedCollectionsActions>;
|
|
31
|
-
viewOnly: boolean;
|
|
32
|
-
isPartiallyChecked?: boolean;
|
|
33
|
-
upliftAdditions: any;
|
|
34
|
-
hideProductCheckbox?: boolean;
|
|
35
|
-
outOfStockAction?: OUT_OF_STOCK_ACTION;
|
|
36
|
-
hideVariantCheckbox?: boolean;
|
|
37
|
-
hideProductVariants?: boolean;
|
|
38
|
-
showProductDetailInfoIcon?: boolean;
|
|
39
|
-
pickerType?: 'COLLECTION' | 'PRODUCT';
|
|
40
|
-
onProductDetailClick?: (productData: Product | ProductVariant) => void;
|
|
41
|
-
}
|
|
42
|
-
export declare const ProductCard: (props: ProductCardInterface) => import("react/jsx-runtime").JSX.Element;
|
|
43
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("../../constants/Theme.js"),i=require("../../assets/icons/info.svg.js"),o=require("../checkBox/CheckBox.js"),c=require("../icon-button/IconButton.js"),d=require("../shimmer-image/ShimmerImage.js"),r=require("../tooltips/Tooltip.js"),a=require("../TypographyStyle.js"),n=require("./ProductPickerTag.js"),l=require("./style.js"),s=require("./utility.js");const u=s=>{const{isVariant:u,data:h,productId:p,collectionId:v,variantId:I,isSelected:j,selectedCollectionsDispatch:k,viewOnly:x,upliftAdditions:y,isPartiallyChecked:C,hideProductCheckbox:P,outOfStockAction:f,hideVariantCheckbox:m,hideProductVariants:b,pickerType:g,onProductDetailClick:O,showProductDetailInfoIcon:S}=s;return e.jsxs(l.ProductCardStyle,Object.assign({isVariant:u,onClick:e=>{"PRODUCT"===g&&b&&(e.stopPropagation(),k({type:"reset",data:{}}),y("variantSelected",{productId:p,variantId:I||Object.keys(h.variants)[0],collectionId:v,variant:h}))},isActive:j},{children:[u&&!x&&!m||!u&&!x&&!P?e.jsx(o.CheckBox,{isChecked:j,isPartiallyChecked:C||!1,onValueChange:function(e){u?e?y("variantSelected",{productId:p,variantId:I,collectionId:v,variant:h}):k({type:"variantUnselected",data:{productId:p,variantId:I,collectionId:v}}):e?y("productSelected",{productId:p,collectionId:v,product:h}):k({type:"productUnselected",data:{productId:p,collectionId:v}})}}):e.jsx(e.Fragment,{}),e.jsx("div",{children:e.jsx(d.ShimmerImage,{width:40,height:40,imageUrl:h.image,alt:"Item",borderRadius:4})}),e.jsxs("div",Object.assign({style:{display:"flex",flexDirection:"column",flex:1}},{children:[e.jsxs("div",Object.assign({style:{display:"flex",alignItems:"center",justifyContent:"space-between"}},{children:[e.jsx(r.Tooltip,Object.assign({variant:"light",body:h.name,placement:"bottom",delay:400},{children:e.jsx(a.BodyPrimary,Object.assign({numberOfLines:1},{children:h.name}))})),S&&e.jsx(c.IconButton,{onClick:()=>{null==O||O(h)},Icon:()=>e.jsx(i.default,{width:20,height:20,color:t.COLORS.content.placeholder})})]})),e.jsx(n.ProductPickerTag,{isVariant:u,data:h,outOfStockAction:f})]}))]}))};exports.ProductCard=u,exports.ProductGroup=t=>{const{collectionId:i,productId:o,data:c,selectedData:d,selectedCollectionsDispatch:r,viewOnly:a,upliftAdditions:n,isProductPartiallyChecked:l,hideProductCheckbox:h,outOfStockAction:p,hideVariantCheckbox:v,hideProductVariants:I,pickerType:j,onProductDetailClick:k,showProductDetailInfoIcon:x}=t,y=e=>{var t,c,r,a,n,l;if(!(null===(c=null===(t=null==d?void 0:d[i])||void 0===t?void 0:t.products)||void 0===c?void 0:c[o]))return!1;return!!(null===(l=null===(n=null===(a=null===(r=null==d?void 0:d[i])||void 0===r?void 0:r.products)||void 0===a?void 0:a[o])||void 0===n?void 0:n.variants)||void 0===l?void 0:l[e])};return e.jsxs("div",{children:[e.jsx(u,{isVariant:!1,data:c,productId:o,collectionId:i,isSelected:!!(null===(P=null===(C=null==d?void 0:d[i])||void 0===C?void 0:C.products)||void 0===P?void 0:P[o]),isPartiallyChecked:l,selectedCollectionsDispatch:r,upliftAdditions:n,viewOnly:a,hideProductCheckbox:h,hideVariantCheckbox:v,hideProductVariants:I,pickerType:j,outOfStockAction:p,onProductDetailClick:k,showProductDetailInfoIcon:x},o),I?null:s.shouldShowVariant(c)&&Object.keys(c.variants||[]).map((t=>e.jsx(u,{isVariant:!0,hideVariantCheckbox:v,data:c.variants[t],variantId:t,productId:o,viewOnly:a,upliftAdditions:n,collectionId:i,isSelected:y(t),selectedCollectionsDispatch:r,outOfStockAction:p,onProductDetailClick:k,showProductDetailInfoIcon:x},t)))]});var C,P};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { Product, ProductVariant } from './modal';
|
|
2
|
-
import { OUT_OF_STOCK_ACTION } from './type';
|
|
3
|
-
/**
|
|
4
|
-
* When user presses i icon on a product, we show the overlay.
|
|
5
|
-
* In case of a product, contains products image, product name & description
|
|
6
|
-
* In case of a variant, contains variant image, variant name,
|
|
7
|
-
* description as product name, variant tag
|
|
8
|
-
*/
|
|
9
|
-
export declare const ProductInfoOverlay: (props: {
|
|
10
|
-
productData: Product | ProductVariant;
|
|
11
|
-
onClose: () => void;
|
|
12
|
-
outOfStockAction?: OUT_OF_STOCK_ACTION;
|
|
13
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
14
|
-
export declare const ProductInfoCard: (props: {
|
|
15
|
-
productData: Product | ProductVariant;
|
|
16
|
-
outOfStockAction?: OUT_OF_STOCK_ACTION;
|
|
17
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("styled-components"),o=require("../../constants/Theme.js"),r=require("../../assets/icons/cross.svg.js"),i=require("../icon-button/IconButton.js"),a=require("../shimmer-image/ShimmerImage.js"),s=require("../TypographyStyle.js"),d=require("./ProductPickerTag.js");function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l=n(t);const c=t=>{var o;const r=void 0===t.productData.variants;return e.jsxs(f,{children:[e.jsx(g,{children:e.jsx(a.ShimmerImage,{imageUrl:t.productData.image,width:"200px",height:200,borderRadius:4})}),e.jsxs(h,{children:[e.jsx(s.TitleSmall,Object.assign({style:{display:"flex"}},{children:t.productData.name})),e.jsx(s.BodyCaption,{style:{display:"flex",flexDirection:"column"},dangerouslySetInnerHTML:{__html:null!==(o=t.productData.description)&&void 0!==o?o:""}}),e.jsx(d.ProductPickerTag,{isVariant:r,data:t.productData,outOfStockAction:t.outOfStockAction})]})]})},u=l.default.div`
|
|
2
|
-
display: flex;
|
|
3
|
-
flex: 1;
|
|
4
|
-
background: rgba(0, 0, 0, 0.5);
|
|
5
|
-
flex-direction: column;
|
|
6
|
-
width: 100%;
|
|
7
|
-
height: 100%;
|
|
8
|
-
position: absolute;
|
|
9
|
-
bottom: 0;
|
|
10
|
-
z-index: 10;
|
|
11
|
-
`,p=l.default.div`
|
|
12
|
-
display: flex;
|
|
13
|
-
flex: 1;
|
|
14
|
-
background: rgba(0, 0, 0, 0.5);
|
|
15
|
-
`,x=l.default.div`
|
|
16
|
-
position: relative;
|
|
17
|
-
|
|
18
|
-
.close-button {
|
|
19
|
-
position: absolute;
|
|
20
|
-
top: -50px;
|
|
21
|
-
right: 0px;
|
|
22
|
-
margin: 10px;
|
|
23
|
-
background: ${o.COLORS.surface.standard};
|
|
24
|
-
border-radius: 50%;
|
|
25
|
-
}
|
|
26
|
-
`,f=l.default.div`
|
|
27
|
-
display: flex;
|
|
28
|
-
background: white;
|
|
29
|
-
padding: 24px;
|
|
30
|
-
gap: 24px;
|
|
31
|
-
border-radius: 8px 8px 0px 0px;
|
|
32
|
-
`,g=l.default.div`
|
|
33
|
-
display: flex;
|
|
34
|
-
`,h=l.default.div`
|
|
35
|
-
display: flex;
|
|
36
|
-
flex: 1;
|
|
37
|
-
flex-direction: column;
|
|
38
|
-
gap: 10px;
|
|
39
|
-
`;exports.ProductInfoCard=c,exports.ProductInfoOverlay=t=>e.jsxs(u,{children:[e.jsx(p,{}),e.jsx(x,{children:e.jsx(i.IconButton,{className:"close-button",onClick:t.onClose,Icon:r.default,width:20,height:20})}),e.jsx(c,{productData:t.productData,outOfStockAction:t.outOfStockAction})]});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{jsx as r,Fragment as i}from"react/jsx-runtime";import{BikShimmer as m}from"../shimmer/ShimmerComponent/BikShimmer.js";const t=t=>{const{limit:e}=t;return r(i,{children:Array.from({length:null!=e?e:5}).map(((i,t)=>r("div",Object.assign({style:{borderBottom:"1px solid #E0E0E0"}},{children:r(m,{boxes:[{height:"64px",width:"100%",marginTop:"0px"}]})}),t)))})};export{t as ProductPickerShimmer};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { Product, ProductVariant } from './modal';
|
|
2
|
-
import { OUT_OF_STOCK_ACTION } from './type';
|
|
3
|
-
export type ProductPickerTagType = {
|
|
4
|
-
isVariant: boolean;
|
|
5
|
-
data: Product | ProductVariant;
|
|
6
|
-
outOfStockAction?: OUT_OF_STOCK_ACTION;
|
|
7
|
-
};
|
|
8
|
-
/**
|
|
9
|
-
* Used in Product Screen, Search Screen, Selected Screen and Rearrange Screen.
|
|
10
|
-
* Wherever product card is shown, we use this component.
|
|
11
|
-
*
|
|
12
|
-
* New logic: When product has only one variant and variant name is same as product name,
|
|
13
|
-
* we consider that a variant and do operations as variant.
|
|
14
|
-
*
|
|
15
|
-
* Note: If there is no Fb rejected tag in the variant, we show a shimmer,
|
|
16
|
-
* meanwhile hit the API to get FB status.
|
|
17
|
-
*
|
|
18
|
-
*/
|
|
19
|
-
export declare const ProductPickerTag: (props: ProductPickerTagType) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{jsx as t,Fragment as e}from"react/jsx-runtime";import{BikShimmer as i}from"../shimmer/ShimmerComponent/BikShimmer.js";import{Tag as l}from"../tag/Tag.js";import{ProductHelper as r}from"./helpers/ProductHelper.js";const o=o=>{var s,n;const{isVariant:a,data:m,outOfStockAction:p}=o;let d=m,c=a;1===Object.keys(null!==(s=null==m?void 0:m.variants)&&void 0!==s?s:{}).length&&(d=Object.values(null!==(n=null==m?void 0:m.variants)&&void 0!==n?n:{})[0],c=!0);const u=r.getProductLabels(d,p),g=r.getTagType(null!=u?u:"");return t("div",Object.assign({style:{display:"flex"}},{children:!(null==d?void 0:d.fbStatus)&&c?t(i,{boxes:[{height:"24px",width:"100px",marginTop:"0px"}]}):u?t("div",Object.assign({style:{display:"flex"}},{children:t(l,{tagText:u,type:g,theme:"light"})})):t(e,{})}))};export{o as ProductPickerTag};
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { Product, ProductVariant, SelectedItems } from './modal';
|
|
3
|
-
import { SelectedCollectionsActions } from './reducers';
|
|
4
|
-
import { OUT_OF_STOCK_ACTION } from './type';
|
|
5
|
-
interface ProductGroupInterface {
|
|
6
|
-
collectionId: string;
|
|
7
|
-
productId: string;
|
|
8
|
-
data: Product;
|
|
9
|
-
selectedData: SelectedItems;
|
|
10
|
-
selectedCollectionsDispatch: React.Dispatch<SelectedCollectionsActions>;
|
|
11
|
-
viewOnly: boolean;
|
|
12
|
-
isProductPartiallyChecked?: boolean;
|
|
13
|
-
upliftAdditions: any;
|
|
14
|
-
hideProductCheckbox?: boolean;
|
|
15
|
-
outOfStockAction?: OUT_OF_STOCK_ACTION;
|
|
16
|
-
hideVariantCheckbox?: boolean;
|
|
17
|
-
hideProductVariants?: boolean;
|
|
18
|
-
showProductDetailInfoIcon?: boolean;
|
|
19
|
-
pickerType?: 'COLLECTION' | 'PRODUCT';
|
|
20
|
-
onProductDetailClick?: (productData: Product | ProductVariant) => void;
|
|
21
|
-
}
|
|
22
|
-
export declare const ProductGroup: (props: ProductGroupInterface) => import("react/jsx-runtime").JSX.Element;
|
|
23
|
-
interface ProductCardInterface {
|
|
24
|
-
isVariant: boolean;
|
|
25
|
-
data: Product | ProductVariant;
|
|
26
|
-
productId: string;
|
|
27
|
-
collectionId: string;
|
|
28
|
-
variantId?: string;
|
|
29
|
-
isSelected: boolean;
|
|
30
|
-
selectedCollectionsDispatch: React.Dispatch<SelectedCollectionsActions>;
|
|
31
|
-
viewOnly: boolean;
|
|
32
|
-
isPartiallyChecked?: boolean;
|
|
33
|
-
upliftAdditions: any;
|
|
34
|
-
hideProductCheckbox?: boolean;
|
|
35
|
-
outOfStockAction?: OUT_OF_STOCK_ACTION;
|
|
36
|
-
hideVariantCheckbox?: boolean;
|
|
37
|
-
hideProductVariants?: boolean;
|
|
38
|
-
showProductDetailInfoIcon?: boolean;
|
|
39
|
-
pickerType?: 'COLLECTION' | 'PRODUCT';
|
|
40
|
-
onProductDetailClick?: (productData: Product | ProductVariant) => void;
|
|
41
|
-
}
|
|
42
|
-
export declare const ProductCard: (props: ProductCardInterface) => import("react/jsx-runtime").JSX.Element;
|
|
43
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
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 l}from"../shimmer-image/ShimmerImage.js";import{Tooltip as a}from"../tooltips/Tooltip.js";import{BodyPrimary as r}from"../TypographyStyle.js";import{ProductPickerTag as s}from"./ProductPickerTag.js";import{ProductCardStyle as u}from"./style.js";import{shouldShowVariant as p}from"./utility.js";const h=o=>{const{collectionId:e,productId:c,data:d,selectedData:n,selectedCollectionsDispatch:l,viewOnly:a,upliftAdditions:r,isProductPartiallyChecked:s,hideProductCheckbox:u,outOfStockAction:h,hideVariantCheckbox:m,hideProductVariants:I,pickerType:f,onProductDetailClick:k,showProductDetailInfoIcon:y}=o,C=t=>{var i,o,d,l,a,r;if(!(null===(o=null===(i=null==n?void 0:n[e])||void 0===i?void 0:i.products)||void 0===o?void 0:o[c]))return!1;return!!(null===(r=null===(a=null===(l=null===(d=null==n?void 0:n[e])||void 0===d?void 0:d.products)||void 0===l?void 0:l[c])||void 0===a?void 0:a.variants)||void 0===r?void 0:r[t])};return t("div",{children:[i(v,{isVariant:!1,data:d,productId:c,collectionId:e,isSelected:!!(null===(b=null===(P=null==n?void 0:n[e])||void 0===P?void 0:P.products)||void 0===b?void 0:b[c]),isPartiallyChecked:s,selectedCollectionsDispatch:l,upliftAdditions:r,viewOnly:a,hideProductCheckbox:u,hideVariantCheckbox:m,hideProductVariants:I,pickerType:f,outOfStockAction:h,onProductDetailClick:k,showProductDetailInfoIcon:y},c),I?null:p(d)&&Object.keys(d.variants||[]).map((t=>i(v,{isVariant:!0,hideVariantCheckbox:m,data:d.variants[t],variantId:t,productId:c,viewOnly:a,upliftAdditions:r,collectionId:e,isSelected:C(t),selectedCollectionsDispatch:l,outOfStockAction:h,onProductDetailClick:k,showProductDetailInfoIcon:y},t)))]});var P,b},v=p=>{const{isVariant:h,data:v,productId:m,collectionId:I,variantId:f,isSelected:k,selectedCollectionsDispatch:y,viewOnly:C,upliftAdditions:P,isPartiallyChecked:b,hideProductCheckbox:j,outOfStockAction:g,hideVariantCheckbox:O,hideProductVariants:x,pickerType:D,onProductDetailClick:S,showProductDetailInfoIcon:V}=p;return t(u,Object.assign({isVariant:h,onClick:t=>{"PRODUCT"===D&&x&&(t.stopPropagation(),y({type:"reset",data:{}}),P("variantSelected",{productId:m,variantId:f||Object.keys(v.variants)[0],collectionId:I,variant:v}))},isActive:k},{children:[h&&!C&&!O||!h&&!C&&!j?i(d,{isChecked:k,isPartiallyChecked:b||!1,onValueChange:function(t){h?t?P("variantSelected",{productId:m,variantId:f,collectionId:I,variant:v}):y({type:"variantUnselected",data:{productId:m,variantId:f,collectionId:I}}):t?P("productSelected",{productId:m,collectionId:I,product:v}):y({type:"productUnselected",data:{productId:m,collectionId:I}})}}):i(o,{}),i("div",{children:i(l,{width:40,height:40,imageUrl:v.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(a,Object.assign({variant:"light",body:v.name,placement:"bottom",delay:400},{children:i(r,Object.assign({numberOfLines:1},{children:v.name}))})),V&&i(n,{onClick:()=>{null==S||S(v)},Icon:()=>i(c,{width:20,height:20,color:e.content.placeholder})})]})),i(s,{isVariant:h,data:v,outOfStockAction:g})]}))]}))};export{v as ProductCard,h as ProductGroup};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { Product, ProductVariant } from './modal';
|
|
2
|
-
import { OUT_OF_STOCK_ACTION } from './type';
|
|
3
|
-
/**
|
|
4
|
-
* When user presses i icon on a product, we show the overlay.
|
|
5
|
-
* In case of a product, contains products image, product name & description
|
|
6
|
-
* In case of a variant, contains variant image, variant name,
|
|
7
|
-
* description as product name, variant tag
|
|
8
|
-
*/
|
|
9
|
-
export declare const ProductInfoOverlay: (props: {
|
|
10
|
-
productData: Product | ProductVariant;
|
|
11
|
-
onClose: () => void;
|
|
12
|
-
outOfStockAction?: OUT_OF_STOCK_ACTION;
|
|
13
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
14
|
-
export declare const ProductInfoCard: (props: {
|
|
15
|
-
productData: Product | ProductVariant;
|
|
16
|
-
outOfStockAction?: OUT_OF_STOCK_ACTION;
|
|
17
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,39 +0,0 @@
|
|
|
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 e from"../../assets/icons/cross.svg.js";import{IconButton as a}from"../icon-button/IconButton.js";import{ShimmerImage as n}from"../shimmer-image/ShimmerImage.js";import{TitleSmall as d,BodyCaption as s}from"../TypographyStyle.js";import{ProductPickerTag as c}from"./ProductPickerTag.js";const l=i=>o(m,{children:[t(u,{}),t(x,{children:t(a,{className:"close-button",onClick:i.onClose,Icon:e,width:20,height:20})}),t(p,{productData:i.productData,outOfStockAction:i.outOfStockAction})]}),p=i=>{var r;const e=void 0===i.productData.variants;return o(f,{children:[t(g,{children:t(n,{imageUrl:i.productData.image,width:"200px",height:200,borderRadius:4})}),o(h,{children:[t(d,Object.assign({style:{display:"flex"}},{children:i.productData.name})),t(s,{style:{display:"flex",flexDirection:"column"},dangerouslySetInnerHTML:{__html:null!==(r=i.productData.description)&&void 0!==r?r:""}}),t(c,{isVariant:e,data:i.productData,outOfStockAction:i.outOfStockAction})]})]})},m=i.div`
|
|
2
|
-
display: flex;
|
|
3
|
-
flex: 1;
|
|
4
|
-
background: rgba(0, 0, 0, 0.5);
|
|
5
|
-
flex-direction: column;
|
|
6
|
-
width: 100%;
|
|
7
|
-
height: 100%;
|
|
8
|
-
position: absolute;
|
|
9
|
-
bottom: 0;
|
|
10
|
-
z-index: 10;
|
|
11
|
-
`,u=i.div`
|
|
12
|
-
display: flex;
|
|
13
|
-
flex: 1;
|
|
14
|
-
background: rgba(0, 0, 0, 0.5);
|
|
15
|
-
`,x=i.div`
|
|
16
|
-
position: relative;
|
|
17
|
-
|
|
18
|
-
.close-button {
|
|
19
|
-
position: absolute;
|
|
20
|
-
top: -50px;
|
|
21
|
-
right: 0px;
|
|
22
|
-
margin: 10px;
|
|
23
|
-
background: ${r.surface.standard};
|
|
24
|
-
border-radius: 50%;
|
|
25
|
-
}
|
|
26
|
-
`,f=i.div`
|
|
27
|
-
display: flex;
|
|
28
|
-
background: white;
|
|
29
|
-
padding: 24px;
|
|
30
|
-
gap: 24px;
|
|
31
|
-
border-radius: 8px 8px 0px 0px;
|
|
32
|
-
`,g=i.div`
|
|
33
|
-
display: flex;
|
|
34
|
-
`,h=i.div`
|
|
35
|
-
display: flex;
|
|
36
|
-
flex: 1;
|
|
37
|
-
flex-direction: column;
|
|
38
|
-
gap: 10px;
|
|
39
|
-
`;export{p as ProductInfoCard,l as ProductInfoOverlay};
|