@bikdotai/bik-component-library 0.0.662-0 → 0.0.662-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/QueryBuilder/components/QueryBuilderNodes.js +1 -1
- package/dist/cjs/components/ai-assist/AiAssist.d.ts +19 -0
- package/dist/cjs/components/ai-assist/AiAssist.style.d.ts +6 -0
- package/dist/cjs/components/ai-assist/Components/SelectionModal.d.ts +13 -0
- package/dist/cjs/components/ai-assist/constants.d.ts +3 -0
- package/dist/cjs/components/ai-assist/model.d.ts +41 -0
- package/dist/cjs/components/analytics-chips-and-dropdowns/chart/LineChart/LineChart.d.ts +0 -2
- package/dist/cjs/components/analytics-chips-and-dropdowns/chart/LineChart/LineChart.js +1 -1
- package/dist/cjs/components/analytics-chips-and-dropdowns/chart/Pie/PieChartAnalytics.js +1 -1
- package/dist/cjs/components/analytics-chips-and-dropdowns/chart/StackedBarChart/StackedBarChart.js +1 -1
- package/dist/cjs/components/analytics-chips-and-dropdowns/chart/StackedBarChart/StackedBarChart.model.d.ts +0 -2
- package/dist/cjs/components/analytics-chips-and-dropdowns/chart/StackedBarChart/StackedBarChart.styles.d.ts +0 -1
- package/dist/cjs/components/analytics-chips-and-dropdowns/chart/StackedBarChart/StackedBarChart.styles.js +2 -6
- package/dist/cjs/components/buttonGroup/ButtonGroup.d.ts +2 -0
- package/dist/cjs/components/buttonGroup/ButtonGroup.js +1 -1
- package/dist/cjs/components/buttonGroup/ButtonGroupStyle.d.ts +2 -0
- package/dist/cjs/components/buttonGroup/ButtonGroupStyle.js +2 -2
- package/dist/cjs/components/plans/NewSubscriptionPlan.js +1 -1
- package/dist/cjs/components/plans/SubscriptionPlan.d.ts +0 -1
- package/dist/cjs/components/plans/SubscriptionPlan.js +1 -1
- package/dist/cjs/components/product-picker-v2/modal.d.ts +0 -1
- package/dist/cjs/components/product-picker-v2/modal.js +1 -1
- package/dist/cjs/components/product-picker-v2/product.js +1 -1
- package/dist/cjs/components/product-picker-v2/productInfoOverlay.js +7 -7
- package/dist/cjs/components/product-picker-v2/productScreen.js +1 -1
- package/dist/cjs/components/product-picker-v2/style.d.ts +0 -11
- package/dist/cjs/components/product-picker-v2/style.js +18 -53
- package/dist/cjs/components/product-picker-v2/utility.d.ts +0 -1
- 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/side-modal/SideModal.d.ts +1 -0
- package/dist/cjs/components/side-modal/SideModal.js +1 -1
- package/dist/cjs/components/side-modal/SideModal.style.d.ts +1 -0
- package/dist/cjs/components/side-modal/SideModal.style.js +5 -5
- package/dist/cjs/components/text-picker/TextPickerCategoryCard.d.ts +13 -0
- package/dist/cjs/components/text-picker/TextPickerCategoryCard.js +13 -0
- package/dist/cjs/components/text-picker/TextPickerFooter.d.ts +6 -0
- package/dist/cjs/components/text-picker/TextPickerFooter.js +15 -0
- package/dist/cjs/components/text-picker/TextPickerItemRow.d.ts +11 -0
- package/dist/cjs/components/text-picker/TextPickerItemRow.js +17 -0
- package/dist/cjs/components/text-picker/TextPickerModal.d.ts +30 -0
- package/dist/cjs/components/text-picker/TextPickerModal.js +25 -0
- package/dist/cjs/components/text-picker/TextPickerSelectAllRow.d.ts +7 -0
- package/dist/cjs/components/text-picker/TextPickerSelectAllRow.js +17 -0
- package/dist/cjs/components/text-picker/index.d.ts +1 -0
- package/dist/cjs/index.d.ts +1 -0
- package/dist/cjs/index.js +1 -1
- package/dist/esm/components/QueryBuilder/components/QueryBuilderNodes.js +1 -1
- package/dist/esm/components/ai-assist/AiAssist.d.ts +19 -0
- package/dist/esm/components/ai-assist/AiAssist.style.d.ts +6 -0
- package/dist/esm/components/ai-assist/Components/SelectionModal.d.ts +13 -0
- package/dist/esm/components/ai-assist/constants.d.ts +3 -0
- package/dist/esm/components/ai-assist/model.d.ts +41 -0
- package/dist/esm/components/analytics-chips-and-dropdowns/chart/LineChart/LineChart.d.ts +0 -2
- package/dist/esm/components/analytics-chips-and-dropdowns/chart/LineChart/LineChart.js +1 -1
- package/dist/esm/components/analytics-chips-and-dropdowns/chart/Pie/PieChartAnalytics.js +1 -1
- package/dist/esm/components/analytics-chips-and-dropdowns/chart/StackedBarChart/StackedBarChart.js +1 -1
- package/dist/esm/components/analytics-chips-and-dropdowns/chart/StackedBarChart/StackedBarChart.model.d.ts +0 -2
- package/dist/esm/components/analytics-chips-and-dropdowns/chart/StackedBarChart/StackedBarChart.styles.d.ts +0 -1
- package/dist/esm/components/analytics-chips-and-dropdowns/chart/StackedBarChart/StackedBarChart.styles.js +1 -5
- package/dist/esm/components/buttonGroup/ButtonGroup.d.ts +2 -0
- package/dist/esm/components/buttonGroup/ButtonGroup.js +1 -1
- package/dist/esm/components/buttonGroup/ButtonGroupStyle.d.ts +2 -0
- package/dist/esm/components/buttonGroup/ButtonGroupStyle.js +12 -12
- package/dist/esm/components/plans/NewSubscriptionPlan.js +1 -1
- package/dist/esm/components/plans/SubscriptionPlan.d.ts +0 -1
- package/dist/esm/components/plans/SubscriptionPlan.js +1 -1
- package/dist/esm/components/product-picker-v2/modal.d.ts +0 -1
- package/dist/esm/components/product-picker-v2/modal.js +1 -1
- package/dist/esm/components/product-picker-v2/product.js +1 -1
- package/dist/esm/components/product-picker-v2/productInfoOverlay.js +7 -7
- package/dist/esm/components/product-picker-v2/productScreen.js +1 -1
- package/dist/esm/components/product-picker-v2/style.d.ts +0 -11
- package/dist/esm/components/product-picker-v2/style.js +16 -51
- package/dist/esm/components/product-picker-v2/utility.d.ts +0 -1
- 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/side-modal/SideModal.d.ts +1 -0
- package/dist/esm/components/side-modal/SideModal.js +1 -1
- package/dist/esm/components/side-modal/SideModal.style.d.ts +1 -0
- package/dist/esm/components/side-modal/SideModal.style.js +16 -16
- package/dist/esm/components/text-picker/TextPickerCategoryCard.d.ts +13 -0
- package/dist/esm/components/text-picker/TextPickerCategoryCard.js +13 -0
- package/dist/esm/components/text-picker/TextPickerFooter.d.ts +6 -0
- package/dist/esm/components/text-picker/TextPickerFooter.js +15 -0
- package/dist/esm/components/text-picker/TextPickerItemRow.d.ts +11 -0
- package/dist/esm/components/text-picker/TextPickerItemRow.js +17 -0
- package/dist/esm/components/text-picker/TextPickerModal.d.ts +30 -0
- package/dist/esm/components/text-picker/TextPickerModal.js +25 -0
- package/dist/esm/components/text-picker/TextPickerSelectAllRow.d.ts +7 -0
- package/dist/esm/components/text-picker/TextPickerSelectAllRow.js +17 -0
- package/dist/esm/components/text-picker/index.d.ts +1 -0
- package/dist/esm/index.d.ts +1 -0
- package/dist/esm/index.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("../../constants/Theme.js"),i=require("../../assets/icons/info.svg.js"),o=require("../checkBox/CheckBox.js"),c=require("../icon-button/IconButton.js"),r=require("../shimmer-image/ShimmerImage.js"),d=require("../tooltips/Tooltip.js"),
|
|
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"),r=require("../shimmer-image/ShimmerImage.js"),d=require("../tooltips/Tooltip.js"),n=require("../TypographyStyle.js"),l=require("./constants.js"),a=require("./helpers/ProductHelper.js"),s=require("./ProductPickerTag.js"),u=require("./style.js"),v=require("./utility.js");const p=l=>{const{isVariant:v,data:p,productId:h,collectionId:y,variantId:I,isSelected:P,selectedCollectionsDispatch:j,viewOnly:x,upliftAdditions:k,isPartiallyChecked:C,hideProductCheckbox:g,outOfStockAction:b,hideVariantCheckbox:O,hideProductVariants:m,pickerType:f="PRODUCT",onProductDetailClick:S,showProductDetailInfoIcon:T,currencyAndPrice:D}=l,{isVariantForProductPickerTag:V,dataForProductPickerTag:q,tagText:w,tagType:A}=a.ProductHelper.getDataForProductPickerTag(p,v,b);return e.jsxs(u.ProductCardStyle,Object.assign({isVariant:v,onClick:e=>{if(e.stopPropagation(),"PRODUCT"===f&&(g||O)){const e=Object.keys(p.variants);m?P?j({type:"productUnselected",data:{productId:h,collectionId:y}}):k("productSelected",{productId:h,variantId:I,collectionId:y,product:p}):P?j({type:"variantUnselected",data:{productId:h,variantId:I,collectionId:y}}):k("variantSelected",{productId:h,variantId:I||e[0],collectionId:y,variant:p})}},isActive:P},{children:[v&&!x&&!O||!v&&!x&&!g?e.jsx(o.CheckBox,{isChecked:P,isPartiallyChecked:C||!1,onValueChange:function(e,t,i){null==i||i.stopPropagation(),v?e?k(m?"productSelected":"variantSelected",{productId:h,variantId:I,collectionId:y,variant:p}):j({type:m?"productUnselected":"variantUnselected",data:{productId:h,variantId:I,collectionId:y}}):e?k("productSelected",{productId:h,collectionId:y,product:p}):j({type:"productUnselected",data:{productId:h,collectionId:y}})}}):e.jsx(e.Fragment,{}),e.jsx("div",{children:e.jsx(r.ShimmerImage,{width:40,height:40,imageUrl:p.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(d.Tooltip,Object.assign({variant:"light",body:p.name,placement:"bottom",delay:400},{children:e.jsx(n.TitleSmall,Object.assign({numberOfLines:1},{children:p.name}))})),T&&e.jsx(c.IconButton,{onClick:()=>{null==S||S(p)},Icon:()=>e.jsx(i.default,{width:20,height:20,color:t.COLORS.content.placeholder})})]})),e.jsx(s.ProductPickerTag,{isVariant:V,data:q,tagText:w,tagType:A}),e.jsx(n.BodyCaption,Object.assign({color:t.COLORS.content.secondary},{children:!(null==q?void 0:q.fbStatus)&&V||w?null:D}))]}))]}))};exports.ProductCard=p,exports.ProductGroup=t=>{var i,o,c,r,d,n,a,s,u;const{collectionId:h,productId:y,data:I,selectedData:P,selectedCollectionsDispatch:j,viewOnly:x,upliftAdditions:k,isProductPartiallyChecked:C,hideProductCheckbox:g,outOfStockAction:b,hideVariantCheckbox:O,hideProductVariants:m,pickerType:f,onProductDetailClick:S,showProductDetailInfoIcon:T}=t,D=e=>{var t,i,o,c,r,d;if(!(null===(i=null===(t=null==P?void 0:P[h])||void 0===t?void 0:t.products)||void 0===i?void 0:i[y]))return!1;return!!(null===(d=null===(r=null===(c=null===(o=null==P?void 0:P[h])||void 0===o?void 0:o.products)||void 0===c?void 0:c[y])||void 0===r?void 0:r.variants)||void 0===d?void 0:d[e])},V=m||!v.shouldShowVariant(I)?`${I.currency&&null!==(i=l.CurrencySymbols[I.currency])&&void 0!==i?i:""}${null!==(u=null!==(d=null===(r=null===(c=Object.values(null!==(o=I.variants)&&void 0!==o?o:{}))||void 0===c?void 0:c[0])||void 0===r?void 0:r.price)&&void 0!==d?d:null===(s=null===(a=Object.values(null!==(n=I.variants)&&void 0!==n?n:{}))||void 0===a?void 0:a[0])||void 0===s?void 0:s.actualPrice)&&void 0!==u?u:""}`:"";return e.jsxs("div",{children:[e.jsx(p,{isVariant:!1,data:I,productId:y,collectionId:h,isSelected:(()=>{var e,t;return!!(null===(t=null===(e=null==P?void 0:P[h])||void 0===e?void 0:e.products)||void 0===t?void 0:t[y])})(),isPartiallyChecked:C,selectedCollectionsDispatch:j,upliftAdditions:k,viewOnly:x,hideProductCheckbox:g,hideVariantCheckbox:O,hideProductVariants:m,pickerType:f,outOfStockAction:b,onProductDetailClick:S,showProductDetailInfoIcon:T,currencyAndPrice:V},y),m?null:v.shouldShowVariant(I)&&Object.keys(I.variants||[]).map((t=>{var i,o,c,r,d,n,a;const s=`${I.currency&&null!==(i=l.CurrencySymbols[I.currency])&&void 0!==i?i:""}${null!==(a=null!==(r=null===(c=null===(o=I.variants)||void 0===o?void 0:o[t])||void 0===c?void 0:c.price)&&void 0!==r?r:null===(n=null===(d=I.variants)||void 0===d?void 0:d[t])||void 0===n?void 0:n.actualPrice)&&void 0!==a?a:""}`;return e.jsx(p,{isVariant:!0,hideVariantCheckbox:O,data:Object.assign(Object.assign({},I.variants[t]),{currency:I.currency}),variantId:t,productId:y,viewOnly:x,upliftAdditions:k,collectionId:h,isSelected:D(t),selectedCollectionsDispatch:j,outOfStockAction:b,onProductDetailClick:S,showProductDetailInfoIcon:T,currencyAndPrice:s},t)}))]})};
|
|
@@ -1,4 +1,4 @@
|
|
|
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"),
|
|
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"),n=require("../TypographyStyle.js"),d=require("./constants.js"),c=require("./helpers/ProductHelper.js"),l=require("./ProductPickerTag.js"),u=require("./utility.js");function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var p=s(t);const x=t=>{var r,i,s,p,x,v,g,f,h,b,D,P,I,S,O,k;const T=void 0===t.productData.variants;let q;if(T)q=`${t.productData.currency&&null!==(r=d.CurrencySymbols[t.productData.currency])&&void 0!==r?r:""}${null!==(x=null!==(s=null===(i=t.productData)||void 0===i?void 0:i.price)&&void 0!==s?s:null===(p=t.productData)||void 0===p?void 0:p.actualPrice)&&void 0!==x?x:""}`;else{const e=null===(v=t.productData)||void 0===v?void 0:v.currency;q=`${e&&null!==(g=d.CurrencySymbols[e])&&void 0!==g?g:""}${null!==(O=null!==(D=null===(b=null===(h=Object.values(null!==(f=t.productData.variants)&&void 0!==f?f:{}))||void 0===h?void 0:h[0])||void 0===b?void 0:b.price)&&void 0!==D?D:null===(S=null===(I=Object.values(null!==(P=t.productData.variants)&&void 0!==P?P:{}))||void 0===I?void 0:I[0])||void 0===S?void 0:S.actualPrice)&&void 0!==O?O:""}`}const{isVariantForProductPickerTag:C,dataForProductPickerTag:w,tagText:$,tagType:z}=c.ProductHelper.getDataForProductPickerTag(t.productData,T,t.outOfStockAction);return e.jsxs(m,{children:[e.jsx(y,{children:e.jsx(a.ShimmerImage,{useDynamicInfoImageSize:t.useDynamicInfoImageSize,imageUrl:t.productData.image,width:200,height:200,borderRadius:4})}),e.jsxs(j,{children:[e.jsx(n.TitleRegular,Object.assign({style:{display:"flex"}},{children:t.productData.name})),e.jsx(n.BodyCaption,Object.assign({color:o.COLORS.content.secondary},{children:`Product ID: ${t.productData.id}`})),e.jsx(n.BodyCaption,{className:"overlay-description",dangerouslySetInnerHTML:{__html:null!==(k=t.productData.description)&&void 0!==k?k:""}}),e.jsx(n.BodyCaption,Object.assign({color:o.COLORS.content.secondary},{children:T?q:u.shouldShowVariant(t.productData)?null:q})),e.jsx(l.ProductPickerTag,{isVariant:C,data:w,tagText:$,tagType:z})]})]})},v=p.default.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
flex: 1;
|
|
4
4
|
background: rgba(0, 0, 0, 0.5);
|
|
@@ -17,11 +17,11 @@
|
|
|
17
17
|
word-break: break-word;
|
|
18
18
|
margin-top: 8px;
|
|
19
19
|
}
|
|
20
|
-
`,
|
|
20
|
+
`,g=p.default.div`
|
|
21
21
|
display: flex;
|
|
22
22
|
flex: 1;
|
|
23
23
|
background: rgba(0, 0, 0, 0.5);
|
|
24
|
-
`,f=
|
|
24
|
+
`,f=p.default.div`
|
|
25
25
|
position: relative;
|
|
26
26
|
|
|
27
27
|
.close-button {
|
|
@@ -32,21 +32,21 @@
|
|
|
32
32
|
background: ${o.COLORS.surface.standard};
|
|
33
33
|
border-radius: 50%;
|
|
34
34
|
}
|
|
35
|
-
`,
|
|
35
|
+
`,m=p.default.div`
|
|
36
36
|
display: flex;
|
|
37
37
|
background: white;
|
|
38
38
|
padding: 24px;
|
|
39
39
|
gap: 24px;
|
|
40
40
|
border-radius: 8px 8px 0px 0px;
|
|
41
|
-
`,
|
|
41
|
+
`,y=p.default.div`
|
|
42
42
|
display: flex;
|
|
43
43
|
max-width: min(50%, 200px);
|
|
44
44
|
flex-direction: column;
|
|
45
45
|
justify-content: center;
|
|
46
46
|
align-items: center;
|
|
47
|
-
`,
|
|
47
|
+
`,j=p.default.div`
|
|
48
48
|
display: flex;
|
|
49
49
|
flex: 1;
|
|
50
50
|
flex-direction: column;
|
|
51
51
|
gap: 4px;
|
|
52
|
-
`;exports.ProductInfoCard=
|
|
52
|
+
`;exports.ProductInfoCard=x,exports.ProductInfoOverlay=t=>e.jsxs(v,{children:[e.jsx(g,{}),e.jsx(f,{children:e.jsx(i.IconButton,{className:"close-button",onClick:t.onClose,Icon:r.default,width:20,height:20})}),e.jsx(x,{productData:t.productData,outOfStockAction:t.outOfStockAction,useDynamicInfoImageSize:t.useDynamicInfoImageSize})]});
|
|
@@ -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("../../assets/icons/box.svg.js"),o=require("../../assets/icons/search.svg.js"),c=require("lodash"),s=require("react"),n=require("../../constants/Theme.js"),i=require("../checkBox/CheckBox.js"),l=require("../icon-button/IconButton.js"),d=require("../InfiniteScroll/InfiniteScroll.js"),u=require("../input/Input.js"),a=require("../spinner/Spinner.js"),h=require("../TypographyStyle.js"),p=require("./emptyState.js"),j=require("./product.js"),v=require("./ProductPickerShimmer.js"),g=require("./reducers.js"),y=require("./style.js"),O=require("./type.js"),b=require("./utility.js");exports.ProductsScreen=f=>{var k,C;const{data:P,collectionsDispatch:x,selectedData:S,selectedCollectionsDispatch:I,productFetcher:m,storeId:q,setScreen:A,setSaveDisabled:D,hideInCollectionSearch:E,customCollectionRestriction:T,hideProductCheckbox:R,outOfStockAction:V=O.OUT_OF_STOCK_ACTION.BLUR,hideVariantCheckbox:L=!1,selectProductsFromCustomCollection:F=!1,pickerType:w,hideProductVariants:B,fbStatusFetcher:_,onProductDetailClick:M,showProductDetailInfoIcon:U,scrollContainerRef:H}=f,J=s.useContext(g.CollectionIdContext),K=s.useRef(0),N=s.useRef(!1),[W,z]=s.useState(""),[G,Q]=s.useState(!1),[X,Y]=s.useState(P),Z=s.useRef(!0),$=s.useRef(!1);s.useEffect((()=>{if(Z.current)return void(Z.current=!1);const e=setTimeout((()=>{W.length?(Q(!0),f.searchInCollectionFetcher(q,J,W).then((e=>{const t=c.cloneDeep(P);t.products=e,Y(t);const r=b.getVariantIdsToFetchAtProductLevel(null!=e?e:{});te(r,null!=e?e:{},!0),D(!1),Q(!1)}))):Y(P)}),800);return()=>clearTimeout(e)}),[W]);s.useEffect((()=>{var e,t,r,o;$.current=!1,K.current=Math.floor((null===(t=Object.keys(null!==(e=P.products)&&void 0!==e?e:{}))||void 0===t?void 0:t.length)/10);const c=b.getVariantIdsToFetchAtProductLevel(null!==(r=P.products)&&void 0!==r?r:{});te(c,null!==(o=P.products)&&void 0!==o?o:{})}),[J]);const ee=!!T&&P.isSmartCollection;s.useEffect((()=>{(null==P?void 0:P.products)||re(10)}),[]);const te=(e,t,r)=>{_||(r?b.markVariantsAsApprovedProductsLevel(t,x,J,X,Y):b.markVariantsAsApprovedProductsLevel(t,x,J)),e.length>0&&_&&_(q,e).then((e=>{const o=Object.assign({},t);Object.keys(t).forEach((r=>{var c,s;Object.keys(null!==(s=null===(c=null==t?void 0:t[r])||void 0===c?void 0:c.variants)&&void 0!==s?s:{}).forEach((c=>{var s,n;const i=null===(s=null==t?void 0:t[r].variants)||void 0===s?void 0:s[c];i&&"REJECTED"===e[c]?i.fbStatus="REJECTED":i&&"APPROVED"===e[c]&&(i.fbStatus="APPROVED");const l=null===(n=null==o?void 0:o[r])||void 0===n?void 0:n.variants;l&&l[c]&&(l[c]=i)}))})),r?(Y((e=>{const t=Object.assign({},e);return t.products=o,t})),x({type:"productsPaged",data:{collectionId:J,products:o}})):x({type:"productsPaged",data:{collectionId:J,products:o}})})).catch((e=>{r?b.markVariantsAsApprovedProductsLevel(t,x,J,X,Y):b.markVariantsAsApprovedProductsLevel(t,x,J)}))},re=e=>{D(!0),Q(!0),m(J,q,e,0).then((t=>{if(Object.keys(t).length||($.current=!0),Object.keys(t).length){Y(Object.assign(Object.assign({},X),{products:t}));const e=b.getVariantIdsToFetchAtProductLevel(t);te(e,t),K.current=1}e||I({type:"selected",data:{id:J,val:Object.assign(Object.assign({},P),{products:t})}}),D(!1),Q(!1)})).catch()},oe=(e,t)=>{const r=b.liftTheStateUp(t,P);I({type:e,data:Object.assign(Object.assign({},r),{isRestricted:T})})},ce=!!(null==S?void 0:S[J])&&!!Object.keys(null!==(C=null===(k=null==S?void 0:S[J])||void 0===k?void 0:k.products)&&void 0!==C?C:{}).length;return e.jsxs("div",{children:[e.jsxs(y.ProductScreenHeader,{children:[e.jsx(l.IconButton,{Icon:t.default,height:16,onClick:()=>{A("collections")}}),e.jsx(h.BodyCaption,Object.assign({style:{color:n.COLORS.content.secondary}},{children:P.name}))]}),!E&&e.jsx("div",Object.assign({style:{padding:16,height:"76px",borderBottom:"1px solid #E0E0E0"}},{children:e.jsx(u.Input,{noKeyDownChange:!0,noErrorHint:!0,rightIcon:{icon:()=>G&&W.length?e.jsx(a.Spinner,{size:"small",color:n.COLORS.content.primary}):e.jsx(o.default,{})},id:"listInput",height:"24px",type:"text",value:W,onChangeText:e=>{e.length&&e.trim().length?z(e):z("")},placeholder:"Search for a product or type a product ID"})})),Object.keys((null==X?void 0:X.products)||[]).length>0&&!ee&&!W.length&&!R&&"-1"!==J&&e.jsxs(y.ProductScreenCollectionCardStyle,{children:[e.jsx(i.CheckBox,{isChecked:ce,isPartiallyChecked:b.isCollectionPartiallyChecked(J,X,S,B),onValueChange:function(e){e?re():I({type:"unselected",data:{id:J}})}}),e.jsx("div",Object.assign({style:{width:40,height:40}},{children:e.jsx(r.default,{})})),e.jsx(h.TitleRegular,{children:"All Products"})]}),e.jsx(d.InfiniteScroll,Object.assign({hasData:!(Object.keys((null==X?void 0:X.products)||[]).length<10)&&!!Object.keys((null==X?void 0:X.products)||[]).length,fetchMore:()=>(N.current=!0,m(J,q,10,K.current).then((e=>{let t=!1;if(Object.keys(e).length||(t=!0),Object.keys(e).length){const t=X;t.products=Object.assign(Object.assign({},X.products),e),Y(Object.assign({},t));const r=b.getVariantIdsToFetchAtProductLevel(e);te(r,e)}return D(!1),N.current=!1,K.current+=1,t}))),containerRef:H},{children:Object.keys((null==X?void 0:X.products)||[]).length?Object.keys(X.products||[]).map((t=>e.jsx(j.ProductGroup,{outOfStockAction:V,collectionId:J,isProductPartiallyChecked:b.isProductPartiallyChecked(J,t,S,X,B),productId:t,data:X.products[t],selectedData:S,selectedCollectionsDispatch:I,viewOnly:!F&&!!ee,upliftAdditions:oe,hideProductCheckbox:R,hideVariantCheckbox:L,hideProductVariants:B,pickerType:w,onProductDetailClick:M,showProductDetailInfoIcon:U},t))):G?e.jsx(v.ProductPickerShimmer,{limit:10}):e.jsx(p.EmptyState,{title:"No products to show",subtitle:W.length?"We couldn't find the product you were looking for":"We couldn’t find any product in this collection."})}))]})};
|
|
@@ -23,14 +23,3 @@ export declare const VariantCardListStyle: import("styled-components").StyledCom
|
|
|
23
23
|
export declare const VariantCardGridStyle: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
24
24
|
export declare const StyledHeaderRightIcon: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
25
25
|
export declare const StyledFooterForNonModal: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
26
|
-
export declare const SKUIDBadge: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
27
|
-
export declare const EllipsedBodyTiny: import("styled-components").StyledComponent<"div", any, {
|
|
28
|
-
numberOfLines?: number | undefined;
|
|
29
|
-
color?: string | undefined;
|
|
30
|
-
}, never>;
|
|
31
|
-
export declare const ProductSubTitle: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
32
|
-
export declare const ProductInfo: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
33
|
-
export declare const StyledTitleSmall: import("styled-components").StyledComponent<"div", any, {
|
|
34
|
-
numberOfLines?: number | undefined;
|
|
35
|
-
color?: string | undefined;
|
|
36
|
-
}, never>;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("styled-components"),t=require("../../constants/Theme.js"),i=require("
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("styled-components"),t=require("../../constants/Theme.js"),i=require("./modal.js");function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=o(e);const n=r.default.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
background-color: white;
|
|
4
4
|
height: ${e=>e.renderWithoutModal?"90%":"75vh"};
|
|
5
5
|
flex-direction: column;
|
|
6
|
-
`,
|
|
6
|
+
`,l=r.default.div`
|
|
7
7
|
overflow-y: scroll;
|
|
8
8
|
overflow-x: hidden;
|
|
9
9
|
|
|
@@ -13,10 +13,10 @@
|
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
::-webkit-scrollbar-thumb {
|
|
16
|
-
background-color: ${e=>e.screenName!==
|
|
16
|
+
background-color: ${e=>e.screenName!==i.ScreenName.RearrangeProducts?"#888":"#fff"};
|
|
17
17
|
border-radius: 8px;
|
|
18
18
|
}
|
|
19
|
-
`,
|
|
19
|
+
`,d=r.default.div`
|
|
20
20
|
height: 64px;
|
|
21
21
|
background-color: ${e=>e.isDisabled?"#F0F0F0":e.isActive?t.COLORS.background.positive.light:"white"};
|
|
22
22
|
border-bottom: 1px solid #e0e0e0;
|
|
@@ -30,17 +30,17 @@
|
|
|
30
30
|
cursor: pointer;
|
|
31
31
|
background-color: ${t.COLORS.surface.hovered};
|
|
32
32
|
}
|
|
33
|
-
`,
|
|
33
|
+
`,a=r.default.div`
|
|
34
34
|
display: flex;
|
|
35
35
|
flex-direction: row;
|
|
36
36
|
justify-content: center;
|
|
37
37
|
align-items: center;
|
|
38
38
|
column-gap: 18px;
|
|
39
|
-
`,
|
|
39
|
+
`,p=r.default.div`
|
|
40
40
|
display: flex;
|
|
41
41
|
flex-direction: column;
|
|
42
42
|
justify-content: center;
|
|
43
|
-
`,
|
|
43
|
+
`,c=r.default.div`
|
|
44
44
|
display: flex;
|
|
45
45
|
flex-direction: row;
|
|
46
46
|
max-height: 32px;
|
|
@@ -53,14 +53,14 @@
|
|
|
53
53
|
position: sticky;
|
|
54
54
|
top: 0;
|
|
55
55
|
z-index: 10;
|
|
56
|
-
`,
|
|
56
|
+
`,s=r.default.div`
|
|
57
57
|
display: flex;
|
|
58
58
|
flex-direction: row;
|
|
59
59
|
column-gap: 16px;
|
|
60
60
|
padding: 12px 16px;
|
|
61
61
|
border-bottom: 1px solid #e0e0e0;
|
|
62
62
|
align-items: center;
|
|
63
|
-
`,
|
|
63
|
+
`,x=r.default.div`
|
|
64
64
|
min-height: 64px;
|
|
65
65
|
background-color: ${e=>e.isActive?t.COLORS.background.positive.light:"white"};
|
|
66
66
|
border-bottom: 1px solid #e0e0e0;
|
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
cursor: pointer;
|
|
76
76
|
background-color: ${t.COLORS.surface.hovered};
|
|
77
77
|
}
|
|
78
|
-
`,u=
|
|
78
|
+
`,u=r.default.div`
|
|
79
79
|
display: flex;
|
|
80
80
|
flex-direction: row;
|
|
81
81
|
max-height: 32px;
|
|
@@ -87,10 +87,10 @@
|
|
|
87
87
|
position: sticky;
|
|
88
88
|
top: 0;
|
|
89
89
|
z-index: 10;
|
|
90
|
-
`,
|
|
90
|
+
`,f=r.default.div`
|
|
91
91
|
display: flex;
|
|
92
92
|
flex-direction: column;
|
|
93
|
-
`,
|
|
93
|
+
`,g=r.default.div`
|
|
94
94
|
min-height: 72px;
|
|
95
95
|
background: white;
|
|
96
96
|
padding: 12px 16px;
|
|
@@ -101,31 +101,24 @@
|
|
|
101
101
|
|
|
102
102
|
.text-container {
|
|
103
103
|
display: flex;
|
|
104
|
+
justify-content: space-between;
|
|
104
105
|
gap: 16px;
|
|
105
|
-
flex: 1;
|
|
106
106
|
}
|
|
107
107
|
|
|
108
108
|
.tooltip-title-tag {
|
|
109
109
|
display: flex;
|
|
110
110
|
flex: 1;
|
|
111
|
-
align-items: center;
|
|
112
|
-
justify-content: space-between;
|
|
113
|
-
width: 100%;
|
|
114
|
-
gap: 16px;
|
|
115
|
-
}
|
|
116
|
-
.info-container {
|
|
117
|
-
display: flex;
|
|
118
111
|
flex-direction: column;
|
|
119
|
-
|
|
112
|
+
gap: 2px;
|
|
120
113
|
}
|
|
121
|
-
`,
|
|
114
|
+
`,y=r.default.div`
|
|
122
115
|
height: 72px;
|
|
123
116
|
width: 72px;
|
|
124
117
|
display: flex;
|
|
125
118
|
align-items: center;
|
|
126
119
|
justify-content: center;
|
|
127
120
|
margin: 16px;
|
|
128
|
-
`;
|
|
121
|
+
`;r.default.div`
|
|
129
122
|
display: flex;
|
|
130
123
|
width: 32px;
|
|
131
124
|
height: 32px;
|
|
@@ -134,39 +127,11 @@
|
|
|
134
127
|
align-items: center;
|
|
135
128
|
border: 1px solid ${t.COLORS.stroke.primary};
|
|
136
129
|
border-radius: 4px;
|
|
137
|
-
`;const
|
|
130
|
+
`;const h=r.default.div`
|
|
138
131
|
padding: 16px 24px;
|
|
139
132
|
display: flex;
|
|
140
133
|
align-items: center;
|
|
141
134
|
justify-content: space-between;
|
|
142
135
|
margin-top: auto;
|
|
143
136
|
width: 100%;
|
|
144
|
-
|
|
145
|
-
width: fit-content;
|
|
146
|
-
background: ${t.COLORS.background.brandLight};
|
|
147
|
-
padding: 2px 6px;
|
|
148
|
-
border-radius: 14px;
|
|
149
|
-
`,w=l.default(i.BodyTiny)`
|
|
150
|
-
white-space: nowrap;
|
|
151
|
-
overflow: hidden;
|
|
152
|
-
text-overflow: ellipsis;
|
|
153
|
-
max-width: 196px;
|
|
154
|
-
display: block;
|
|
155
|
-
color: ${t.COLORS.background.inverseLight};
|
|
156
|
-
`,v=l.default.div`
|
|
157
|
-
display: flex;
|
|
158
|
-
flex-direction: row;
|
|
159
|
-
align-items: center;
|
|
160
|
-
gap: 5px;
|
|
161
|
-
`,S=l.default.div`
|
|
162
|
-
display: flex;
|
|
163
|
-
flex-direction: row;
|
|
164
|
-
align-items: center;
|
|
165
|
-
gap: 8px;
|
|
166
|
-
min-width: 0;
|
|
167
|
-
`;l.default(i.TitleSmall)`
|
|
168
|
-
overflow: hidden;
|
|
169
|
-
white-space: nowrap;
|
|
170
|
-
text-overflow: ellipsis;
|
|
171
|
-
display: block;
|
|
172
|
-
`,exports.CollectionCardDetailStyle=c,exports.CollectionCardInfoStyle=p,exports.CollectionCardStyle=a,exports.CollectionNameHolder=g,exports.ContainerStyle=d,exports.EllipsedBodyTiny=w,exports.ProductCardStyle=f,exports.ProductInfo=S,exports.ProductScreenCollectionCardStyle=x,exports.ProductScreenHeader=s,exports.ProductSubTitle=v,exports.SKUIDBadge=m,exports.ScrollContainerStyle=n,exports.SelectedScreenHeader=u,exports.StyledFooterForNonModal=b,exports.VariantCardGridStyle=h,exports.VariantCardListStyle=y;
|
|
137
|
+
`;exports.CollectionCardDetailStyle=p,exports.CollectionCardInfoStyle=a,exports.CollectionCardStyle=d,exports.CollectionNameHolder=f,exports.ContainerStyle=n,exports.ProductCardStyle=x,exports.ProductScreenCollectionCardStyle=s,exports.ProductScreenHeader=c,exports.ScrollContainerStyle=l,exports.SelectedScreenHeader=u,exports.StyledFooterForNonModal=h,exports.VariantCardGridStyle=y,exports.VariantCardListStyle=g;
|
|
@@ -48,4 +48,3 @@ export declare const updateAllVariantsForSelectedProducts: (selectedItems: {
|
|
|
48
48
|
} | undefined;
|
|
49
49
|
};
|
|
50
50
|
}, collections: Collection, searchedProducts: SearchedItems) => Record<string, any>;
|
|
51
|
-
export declare const getSkuId: (product: Product | ProductVariant, isVariant: boolean) => string | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var o=require("lodash");function l(o,l,t){if(!o)return{};const i=Object.keys(o).slice(t,t+l),n={};return i.forEach((l=>{n[l]=o[l]})),n}const t=(o,l,t)=>{Object.keys(o).forEach((l=>{var t,i;const n=null!==(i=null===(t=o[l])||void 0===t?void 0:t.products)&&void 0!==i?i:{};Object.keys(n).forEach((t=>{var i,n,d,v;const s=null!==(v=null===(d=null===(n=null===(i=o[l])||void 0===i?void 0:i.products)||void 0===n?void 0:n[t])||void 0===d?void 0:d.variants)&&void 0!==v?v:{};Object.keys(s).forEach((i=>{var n,d,v,s;const e=null===(s=null===(v=null===(d=null===(n=o[l])||void 0===n?void 0:n.products)||void 0===d?void 0:d[t])||void 0===v?void 0:v.variants)||void 0===s?void 0:s[i];e&&!e.fbStatus&&(e.fbStatus="APPROVED")}))}))})),l({type:t,data:o})};exports.fetchFbStatusCollection=function(o,l,i,n){let d=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"paged";n||t(o,i,d);const v=(o=>{const l=[];return Object.keys(o).forEach((t=>{var i,n;const d=null!==(n=null===(i=o[t])||void 0===i?void 0:i.products)&&void 0!==n?n:{};Object.keys(d).forEach((i=>{var n,d,v,s;const e=null!==(s=null===(v=null===(d=null===(n=o[t])||void 0===n?void 0:n.products)||void 0===d?void 0:d[i])||void 0===v?void 0:v.variants)&&void 0!==s?s:{};Object.keys(e).forEach((n=>{var d,v,s,e;const u=null===(e=null===(s=null===(v=null===(d=o[t])||void 0===d?void 0:d.products)||void 0===v?void 0:v[i])||void 0===s?void 0:s.variants)||void 0===e?void 0:e[n];(null==u?void 0:u.fbStatus)||l.push(n)}))}))})),l})(o);v.length>0&&n&&n(l,v).then((l=>{const t=Object.assign({},o);Object.keys(t).forEach((o=>{var i,n;const d=null!==(n=null===(i=t[o])||void 0===i?void 0:i.products)&&void 0!==n?n:{};Object.keys(d).forEach((i=>{var n,d,v,s;const e=null!==(s=null===(v=null===(d=null===(n=t[o])||void 0===n?void 0:n.products)||void 0===d?void 0:d[i])||void 0===v?void 0:v.variants)&&void 0!==s?s:{};Object.keys(e).forEach((n=>{var d,v,s,e;const u=null===(e=null===(s=null===(v=null===(d=t[o])||void 0===d?void 0:d.products)||void 0===v?void 0:v[i])||void 0===s?void 0:s.variants)||void 0===e?void 0:e[n];u&&"REJECTED"===l[n]?u.fbStatus="REJECTED":u&&"APPROVED"===l[n]&&(u.fbStatus="APPROVED")}))}))})),i({type:d,data:t})})).catch((l=>{console.error("Error in fbStatusFetcher",l),t(o,i,d)}))},exports.
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var o=require("lodash");function l(o,l,t){if(!o)return{};const i=Object.keys(o).slice(t,t+l),n={};return i.forEach((l=>{n[l]=o[l]})),n}const t=(o,l,t)=>{Object.keys(o).forEach((l=>{var t,i;const n=null!==(i=null===(t=o[l])||void 0===t?void 0:t.products)&&void 0!==i?i:{};Object.keys(n).forEach((t=>{var i,n,d,v;const s=null!==(v=null===(d=null===(n=null===(i=o[l])||void 0===i?void 0:i.products)||void 0===n?void 0:n[t])||void 0===d?void 0:d.variants)&&void 0!==v?v:{};Object.keys(s).forEach((i=>{var n,d,v,s;const e=null===(s=null===(v=null===(d=null===(n=o[l])||void 0===n?void 0:n.products)||void 0===d?void 0:d[t])||void 0===v?void 0:v.variants)||void 0===s?void 0:s[i];e&&!e.fbStatus&&(e.fbStatus="APPROVED")}))}))})),l({type:t,data:o})};exports.fetchFbStatusCollection=function(o,l,i,n){let d=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"paged";n||t(o,i,d);const v=(o=>{const l=[];return Object.keys(o).forEach((t=>{var i,n;const d=null!==(n=null===(i=o[t])||void 0===i?void 0:i.products)&&void 0!==n?n:{};Object.keys(d).forEach((i=>{var n,d,v,s;const e=null!==(s=null===(v=null===(d=null===(n=o[t])||void 0===n?void 0:n.products)||void 0===d?void 0:d[i])||void 0===v?void 0:v.variants)&&void 0!==s?s:{};Object.keys(e).forEach((n=>{var d,v,s,e;const u=null===(e=null===(s=null===(v=null===(d=o[t])||void 0===d?void 0:d.products)||void 0===v?void 0:v[i])||void 0===s?void 0:s.variants)||void 0===e?void 0:e[n];(null==u?void 0:u.fbStatus)||l.push(n)}))}))})),l})(o);v.length>0&&n&&n(l,v).then((l=>{const t=Object.assign({},o);Object.keys(t).forEach((o=>{var i,n;const d=null!==(n=null===(i=t[o])||void 0===i?void 0:i.products)&&void 0!==n?n:{};Object.keys(d).forEach((i=>{var n,d,v,s;const e=null!==(s=null===(v=null===(d=null===(n=t[o])||void 0===n?void 0:n.products)||void 0===d?void 0:d[i])||void 0===v?void 0:v.variants)&&void 0!==s?s:{};Object.keys(e).forEach((n=>{var d,v,s,e;const u=null===(e=null===(s=null===(v=null===(d=t[o])||void 0===d?void 0:d.products)||void 0===v?void 0:v[i])||void 0===s?void 0:s.variants)||void 0===e?void 0:e[n];u&&"REJECTED"===l[n]?u.fbStatus="REJECTED":u&&"APPROVED"===l[n]&&(u.fbStatus="APPROVED")}))}))})),i({type:d,data:t})})).catch((l=>{console.error("Error in fbStatusFetcher",l),t(o,i,d)}))},exports.getVariantIdsToFetchAtProductLevel=(o,l)=>{const t=[];return Object.keys(null!=o?o:{}).forEach((i=>{var n,d;const v=null!==(d=null===(n=null==o?void 0:o[i])||void 0===n?void 0:n.variants)&&void 0!==d?d:{};Object.keys(v).forEach((n=>{var d,v,s,e,u;let r;r=l?null===(s=null===(v=null===(d=null==l?void 0:l.products)||void 0===d?void 0:d[i])||void 0===v?void 0:v.variants)||void 0===s?void 0:s[n]:null===(u=null===(e=null==o?void 0:o[i])||void 0===e?void 0:e.variants)||void 0===u?void 0:u[n],(null==r?void 0:r.fbStatus)||t.push(n)}))})),t},exports.isCollectionPartiallyChecked=function(o,l,t){var i,n,d,v;let s=0,e=0;if(arguments.length>3&&void 0!==arguments[3]&&arguments[3]){const v=null!==(i=null==l?void 0:l.products)&&void 0!==i?i:{};s=Object.keys(v).length;const u=null!==(d=null===(n=t[o])||void 0===n?void 0:n.products)&&void 0!==d?d:{};e=Object.keys(u).length}else if(t[o]){const i=null==l?void 0:l.products;i&&Object.keys(i).forEach((o=>{var l;const t=null===(l=i[o])||void 0===l?void 0:l.variants;t&&Object.keys(t).forEach((o=>s+=1))}));const n=null===(v=t[o])||void 0===v?void 0:v.products;if(n&&Object.keys(n).forEach((o=>{var l;const t=null===(l=n[o])||void 0===l?void 0:l.variants;t&&Object.keys(t).forEach((o=>e+=1))})),s<=0&&e>0)return!1}return e>0&&s!==e},exports.isProductPartiallyChecked=(o,l,t,i,n)=>{var d,v,s,e,u,r,c,a,p,b,O,f,j,h,y,g,E,k,P;let D=0,S=0;if(null===(v=null===(d=null==t?void 0:t[o])||void 0===d?void 0:d.products)||void 0===v?void 0:v[l]){if(n)return!1;const d=(null===(u=null===(e=null===(s=null==t?void 0:t[o])||void 0===s?void 0:s.products)||void 0===e?void 0:e[l])||void 0===u?void 0:u.variants)||[];if(1===Object.keys(d).length)for(const i in d){const n=null===(c=null===(r=null==t?void 0:t[o])||void 0===r?void 0:r.products)||void 0===c?void 0:c[l],d=null===(O=null===(b=null===(p=null===(a=null==t?void 0:t[o])||void 0===a?void 0:a.products)||void 0===p?void 0:p[l])||void 0===b?void 0:b.variants)||void 0===O?void 0:O[i];if(null===(f=null==d?void 0:d.name)||void 0===f?void 0:f.includes(null!==(j=null==n?void 0:n.name)&&void 0!==j?j:""))return!1}if(null===(g=Object.keys((null===(y=null===(h=null==i?void 0:i.products)||void 0===h?void 0:h[l])||void 0===y?void 0:y.variants)||[]))||void 0===g||g.forEach((()=>S++)),Object.keys((null===(P=null===(k=null===(E=null==t?void 0:t[o])||void 0===E?void 0:E.products)||void 0===k?void 0:k[l])||void 0===P?void 0:P.variants)||[]).forEach((()=>D++)),D>0&&S!==D)return!0}return!1},exports.liftTheStateUp=(l,t)=>{const i=o.cloneDeep(t);if(delete i.products,(l=Object.assign(Object.assign({},l),{catalogOnlyData:i})).productId&&t.products){const n=o.cloneDeep(t.products[l.productId]);(null==n?void 0:n.variants)&&delete n.variants,l=Object.assign(Object.assign({},l),{catalogOnlyData:i,productOnlyData:n})}return l},exports.markVariantsAsApprovedProductsLevel=(o,l,t,i,n)=>{const d=Object.assign({},o);if(Object.keys(o).forEach((l=>{var t,i;Object.keys(null!==(i=null===(t=null==o?void 0:o[l])||void 0===t?void 0:t.variants)&&void 0!==i?i:{}).forEach((t=>{var i,n;const v=null===(i=null==o?void 0:o[l].variants)||void 0===i?void 0:i[t];v&&(v.fbStatus="APPROVED");const s=null===(n=null==d?void 0:d[l])||void 0===n?void 0:n.variants;s&&s[t]&&(s[t]=v)}))})),i&&n){const o=Object.assign({},i);o.products=d,n(o),l({type:"productsPaged",data:{collectionId:t,products:d}})}else l({type:"productsPaged",data:{collectionId:t,products:d}})},exports.paginateSelectedItems=function(o,t,i){var n;const d={};let v=0;for(const s in o)if(Object.prototype.hasOwnProperty.call(o,s)){const e=o[s],u=l(e.products,t,i-v);u&&Object.keys(u).length>0&&(d[s]=Object.assign(Object.assign({},e),{products:u})),v+=Object.keys(null!==(n=e.products)&&void 0!==n?n:{}).length}return d},exports.shouldShowVariant=o=>{const l=Object.keys(o.variants||[]);let t=!1;return!(l.length<=1)||(l.forEach((l=>{var i,n;t=null!==(n=null===(i=o.variants)||void 0===i?void 0:i[l].name.includes(o.name))&&void 0!==n&&n})),!t)},exports.updateAllVariantsForSelectedProducts=(l,t,i)=>Object.keys(l).reduce(((n,d)=>{var v;return d in t?(n[d]=Object.assign(Object.assign({},l[d]),{products:Object.keys(null!==(v=l[d].products)&&void 0!==v?v:{}).reduce(((n,v)=>{var s,e,u,r,c,a,p,b,O,f;const j=null===(s=t[d].products)||void 0===s?void 0:s[v],h=null===(r=null===(u=null===(e=null==i?void 0:i.products)||void 0===e?void 0:e[d])||void 0===u?void 0:u.products)||void 0===r?void 0:r[v];return j?n[v]=Object.assign(Object.assign({},(null===(c=l[d].products)||void 0===c?void 0:c[v])||{}),{allVariants:o.cloneDeep(j.variants)}):h?n[v]=Object.assign(Object.assign({},(null===(a=l[d].products)||void 0===a?void 0:a[v])||{}),{allVariants:o.cloneDeep(h.variants)}):(null===(b=null===(p=l[d].products)||void 0===p?void 0:p[v])||void 0===b?void 0:b.allVariants)&&(n[v]=Object.assign(Object.assign({},(null===(O=l[d].products)||void 0===O?void 0:O[v])||{}),{allVariants:o.cloneDeep(null===(f=l[d].products)||void 0===f?void 0:f[v].allVariants)})),n}),{})}),n):n}),{});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("../../assets/icons/delete.svg.js"),r=require("../../assets/icons/drag_handle.svg.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("../../assets/icons/delete.svg.js"),r=require("../../assets/icons/drag_handle.svg.js"),a=require("../../constants/Theme.js"),i=require("../icon-button/IconButton.js"),s=require("../shimmer-image/ShimmerImage.js"),n=require("../TypographyStyle.js"),o=require("./constants.js"),c=require("./helpers/ProductHelper.js"),l=require("./ProductPickerTag.js"),d=require("./style.js"),u=require("../tooltips/Tooltip.js");exports.VariantCardGridView=t=>{const{data:r}=t;return e.jsx(d.VariantCardGridStyle,{children:e.jsx(u.Tooltip,Object.assign({body:r.name,alwaysVisible:!1,variant:"dark",placement:"bottom"},{children:e.jsx(s.ShimmerImage,{width:72,height:72,imageUrl:r.image,alt:"Item",borderRadius:4})}))})},exports.VariantCardListView=m=>{var j,g,h;const{data:p,selectedCollectionsDispatch:x,outOfStockAction:y}=m,b=()=>{let e;return e=p.name.includes(p.productName)?p.name:`${p.productName} ${p.name}`,e},{dataForProductPickerTag:v,tagText:I,tagType:O}=c.ProductHelper.getDataForProductPickerTag(p,!0,y),T=`${p.currency&&null!==(j=o.CurrencySymbols[p.currency])&&void 0!==j?j:""}${null!==(h=null!==(g=p.price)&&void 0!==g?g:p.actualPrice)&&void 0!==h?h:""}`;return e.jsxs(d.VariantCardListStyle,{children:[e.jsxs("div",Object.assign({className:"text-container"},{children:[e.jsx(r.default,{width:24,height:24,color:a.COLORS.content.placeholder}),e.jsx("div",{children:e.jsx(s.ShimmerImage,{width:40,height:40,imageUrl:p.image,alt:"Item",borderRadius:4},p.variantId)}),e.jsxs("div",Object.assign({className:"tooltip-title-tag"},{children:[e.jsx(u.Tooltip,Object.assign({body:b(),placement:"bottom",delay:400,variant:"light"},{children:e.jsx(n.TitleSmall,Object.assign({numberOfLines:1},{children:b()}))})),e.jsx(l.ProductPickerTag,{isVariant:!0,data:v,tagText:I,tagType:O}),e.jsx(n.BodyCaption,Object.assign({color:a.COLORS.content.secondary},{children:!(null==v?void 0:v.fbStatus)||I?null:T}))]}))]})),e.jsx(i.IconButton,{Icon:()=>e.jsx(t.default,{width:24,height:24,color:a.COLORS.content.placeholder}),onClick:()=>{x&&x({type:"variantUnselected",data:{productId:p.productId,variantId:p.variantId,collectionId:p.collectionId}}),m.onDelete&&m.onDelete()}})]})};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react-dom"),o=require("../../assets/icons/cross.svg.js"),r=require("../button/Button.js"),s=require("../TypographyStyle.js"),n=require("./SideModal.style.js");function i(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var d=i(t);exports.SideModal=t=>{var i;return d.default.createPortal(e.jsx(n.SideModalStyle,Object.assign({zIndex:t.zIndex},{children:e.jsxs(n.SideModalContainer,Object.assign({width:t.width},{children:[e.jsxs(n.SideModalHeader,Object.assign({headerStyle:Object.assign({},t.headerStyle)},{children:[(null==t?void 0:t.headerCustomComponent)||e.jsx(s.TitleMedium,{children:t.header}),!t.hideCrossButton&&e.jsx(o.default,{width:24,height:24,onClick:t.onClose})]})),e.jsx(n.SideModalBody,Object.assign({hideFooter:t.hideFooter,bodyStyle:Object.assign({},t.bodyStyle)},{children:t.children})),!0===t.hideFooter?null:e.jsxs(n.SideModalFooter,Object.assign({footerDirection:t.footerDirection,footerStyle:Object.assign({},t.footerStyle)},{children:[(t.saveButtonProps||t.cancelButtonProps)&&e.jsxs(n.FooterButtonWrapper,Object.assign({footerDirection:t.footerDirection},{children:[t.saveButtonProps&&e.jsx(r.Button,Object.assign({},t.saveButtonProps)),t.cancelButtonProps&&e.jsx(r.Button,Object.assign({},t.cancelButtonProps))]})),t.footerCustomComponent?t.footerCustomComponent:e.jsx(e.Fragment,{})]}))]}))})),null!==(i=t.element)&&void 0!==i?i:document.body)};
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react-dom"),o=require("../../assets/icons/cross.svg.js"),r=require("../button/Button.js"),s=require("../TypographyStyle.js"),n=require("./SideModal.style.js");function i(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var d=i(t);exports.SideModal=t=>{var i;return d.default.createPortal(e.jsx(n.SideModalStyle,Object.assign({zIndex:t.zIndex,position:t.position},{children:e.jsxs(n.SideModalContainer,Object.assign({width:t.width},{children:[e.jsxs(n.SideModalHeader,Object.assign({headerStyle:Object.assign({},t.headerStyle)},{children:[(null==t?void 0:t.headerCustomComponent)||e.jsx(s.TitleMedium,{children:t.header}),!t.hideCrossButton&&e.jsx(o.default,{width:24,height:24,onClick:t.onClose})]})),e.jsx(n.SideModalBody,Object.assign({hideFooter:t.hideFooter,bodyStyle:Object.assign({},t.bodyStyle)},{children:t.children})),!0===t.hideFooter?null:e.jsxs(n.SideModalFooter,Object.assign({footerDirection:t.footerDirection,footerStyle:Object.assign({},t.footerStyle)},{children:[(t.saveButtonProps||t.cancelButtonProps)&&e.jsxs(n.FooterButtonWrapper,Object.assign({footerDirection:t.footerDirection},{children:[t.saveButtonProps&&e.jsx(r.Button,Object.assign({},t.saveButtonProps)),t.cancelButtonProps&&e.jsx(r.Button,Object.assign({},t.cancelButtonProps))]})),t.footerCustomComponent?t.footerCustomComponent:e.jsx(e.Fragment,{})]}))]}))})),null!==(i=t.element)&&void 0!==i?i:document.body)};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export declare const SideModalStyle: import("styled-components").StyledComponent<"div", any, {
|
|
2
2
|
zIndex?: number | undefined;
|
|
3
|
+
position?: "left" | "right" | undefined;
|
|
3
4
|
}, never>;
|
|
4
5
|
export declare const SideModalContainer: import("styled-components").StyledComponent<"div", any, {
|
|
5
6
|
width?: string | undefined;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("styled-components"),t=require("../../constants/Theme.js"),o=require("../../constants/zindex.js");function i(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=i(e);const d=r.default.div`
|
|
2
2
|
position: fixed;
|
|
3
|
+
${e=>"left"===e.position?"left":"right"}: 0;
|
|
3
4
|
top: 0;
|
|
4
|
-
left: 0;
|
|
5
5
|
z-index: ${e=>e.zIndex||o.ComponentZindex.SIDE_MODAL};
|
|
6
6
|
height: 100%;
|
|
7
7
|
width: 100%;
|
|
8
8
|
background-color: rgba(0, 0, 0, 0.4);
|
|
9
9
|
display: flex;
|
|
10
10
|
align-items: center;
|
|
11
|
-
justify-content: flex-end;
|
|
11
|
+
justify-content: ${e=>"left"===e.position?"flex-start":"flex-end"};
|
|
12
12
|
`,n=r.default.div`
|
|
13
13
|
height: 100%;
|
|
14
14
|
width: ${e=>e.width||"566px"};
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
${t=>{let{bodyStyle:o}=t;return e.css`
|
|
44
44
|
${Object.keys(o).map((e=>`${e}: ${o[e]};`)).join("\n")}
|
|
45
45
|
`}}
|
|
46
|
-
`,
|
|
46
|
+
`,l=r.default.div`
|
|
47
47
|
height: 60px;
|
|
48
48
|
width: 100%;
|
|
49
49
|
position: sticky;
|
|
@@ -58,8 +58,8 @@
|
|
|
58
58
|
${t=>{let{footerStyle:o}=t;return e.css`
|
|
59
59
|
${Object.keys(o).map((e=>`${e}: ${o[e]};`)).join("\n")}
|
|
60
60
|
`}}
|
|
61
|
-
`,
|
|
61
|
+
`,p=r.default.div`
|
|
62
62
|
display: flex;
|
|
63
63
|
flex-direction: ${e=>e.footerDirection||"row"};
|
|
64
64
|
gap: 8px;
|
|
65
|
-
`;exports.FooterButtonWrapper=
|
|
65
|
+
`;exports.FooterButtonWrapper=p,exports.SideModalBody=s,exports.SideModalContainer=n,exports.SideModalFooter=l,exports.SideModalHeader=a,exports.SideModalStyle=d;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface TextPickerCategoryCardProps {
|
|
3
|
+
id: string;
|
|
4
|
+
name: string;
|
|
5
|
+
itemsCount: number;
|
|
6
|
+
selectedCount: number;
|
|
7
|
+
isOneDimensional: boolean;
|
|
8
|
+
isChecked: boolean;
|
|
9
|
+
isPartiallyChecked: boolean;
|
|
10
|
+
onCheck: (checked: boolean, e?: React.MouseEvent) => void;
|
|
11
|
+
onClick: (e: React.MouseEvent) => void;
|
|
12
|
+
}
|
|
13
|
+
export declare const TextPickerCategoryCard: React.FC<TextPickerCategoryCardProps>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("../../assets/icons/chevronRight.svg.js"),i=require("styled-components"),r=require("../../constants/Theme.js"),s=require("../checkBox/CheckBox.js"),o=require("../icon-button/IconButton.js"),n=require("../tag/Tag.js"),c=require("../TypographyStyle.js");function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}const l=a(i).default.div`
|
|
2
|
+
height: 64px;
|
|
3
|
+
background-color: ${e=>{let{isSelected:t,isActive:i}=e;return t?r.COLORS.background.positive.light:i?r.COLORS.surface.hovered:r.COLORS.surface.standard}};
|
|
4
|
+
border-bottom: 1px solid ${r.COLORS.stroke.primary};
|
|
5
|
+
padding: 12px 24px;
|
|
6
|
+
display: flex;
|
|
7
|
+
align-items: center;
|
|
8
|
+
cursor: pointer;
|
|
9
|
+
transition: background 0.2s;
|
|
10
|
+
&:hover {
|
|
11
|
+
background-color: ${e=>{let{isSelected:t}=e;return t?r.COLORS.background.positive.light:r.COLORS.surface.hovered}};
|
|
12
|
+
}
|
|
13
|
+
`;exports.TextPickerCategoryCard=i=>{let{id:a,name:d,itemsCount:u,selectedCount:g,isChecked:h,isOneDimensional:x,isPartiallyChecked:p,onCheck:y,onClick:C}=i;return e.jsxs(l,Object.assign({isActive:h||p,isSelected:h,onClick:C},{children:[e.jsx(s.CheckBox,{isChecked:h||p,isPartiallyChecked:p&&!h,onValueChange:function(e,t,i){null==i||i.stopPropagation(),y(e,i)},style:{marginRight:16}}),e.jsxs("div",Object.assign({style:{flex:1,display:"flex",flexDirection:"column"}},{children:[e.jsx(c.BodyPrimary,{children:d}),!x&&e.jsxs(c.BodyCaption,Object.assign({style:{color:r.COLORS.text.secondary,fontSize:13}},{children:[u," document",1!==u?"s":""]}))]})),!!g&&e.jsx(n.Tag,{tagText:`${g} selected`,type:"positive",style:{marginLeft:12}}),!x&&e.jsx(o.IconButton,{Icon:t.default,height:16,width:16,style:{marginLeft:8}})]}))};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("../tag/Tag.js"),n=require("../TypographyStyle.js"),r=require("../../constants/Theme.js");function i(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=i(require("styled-components"));const o=s.default.div`
|
|
2
|
+
box-sizing: border-box;
|
|
3
|
+
width: 100%;
|
|
4
|
+
margin: 0;
|
|
5
|
+
display: flex;
|
|
6
|
+
justify-content: flex-start;
|
|
7
|
+
align-items: center;
|
|
8
|
+
`,c=s.default.div`
|
|
9
|
+
display: flex;
|
|
10
|
+
align-items: center;
|
|
11
|
+
`,a=s.default(n.BodyCaption)`
|
|
12
|
+
color: ${e=>{let{$isInactive:t}=e;return t?r.COLORS.content.inactive:r.COLORS.content.brand}};
|
|
13
|
+
font-weight: 600;
|
|
14
|
+
font-size: 18px;
|
|
15
|
+
`;exports.TextPickerFooter=n=>{let{totalSelected:r,maxDocuments:i}=n;const s=i!==1/0&&r>i;return e.jsx(o,{children:e.jsx(c,{children:s?e.jsx(t.Tag,{tagText:`You can only select ${i} documents`,type:"negative"}):e.jsx(a,Object.assign({$isInactive:0===r},{children:i!==1/0?`${r}/${i} documents selected`:`${r} documents selected`}))})})};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface TextPickerItemRowProps {
|
|
3
|
+
item: {
|
|
4
|
+
id: string;
|
|
5
|
+
name: string;
|
|
6
|
+
};
|
|
7
|
+
selected: boolean;
|
|
8
|
+
onCheck: (checked: boolean) => void;
|
|
9
|
+
onClick: () => void;
|
|
10
|
+
}
|
|
11
|
+
export declare const TextPickerItemRow: React.FC<TextPickerItemRowProps>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("styled-components"),t=require("../../constants/Theme.js"),i=require("../checkBox/CheckBox.js"),n=require("../TypographyStyle.js");function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var c=s(r);const o=c.default.div`
|
|
2
|
+
min-height: 48px;
|
|
3
|
+
background: ${e=>{let{selected:r}=e;return r?t.COLORS.surface.hovered:t.COLORS.surface.standard}};
|
|
4
|
+
border-bottom: 1px solid ${t.COLORS.stroke.primary};
|
|
5
|
+
padding: 12px 24px;
|
|
6
|
+
display: flex;
|
|
7
|
+
align-items: center;
|
|
8
|
+
cursor: pointer;
|
|
9
|
+
`,d=c.default.div`
|
|
10
|
+
margin-right: 16px;
|
|
11
|
+
display: flex;
|
|
12
|
+
flex-direction: column;
|
|
13
|
+
justify-content: center;
|
|
14
|
+
align-items: center;
|
|
15
|
+
`,l=c.default.div`
|
|
16
|
+
flex: 1;
|
|
17
|
+
`;exports.TextPickerItemRow=r=>{let{item:t,selected:s,onCheck:c,onClick:a}=r;return e.jsxs(o,Object.assign({selected:s,onClick:a},{children:[e.jsx(d,{children:e.jsx(i.CheckBox,{isChecked:s,onValueChange:c})}),e.jsx(l,{children:e.jsx(n.BodyPrimary,{children:t.name})})]}))};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { ButtonProps } from '../button/model';
|
|
3
|
+
export interface TextPickerCategory {
|
|
4
|
+
id: string;
|
|
5
|
+
name: string;
|
|
6
|
+
items: {
|
|
7
|
+
id: string;
|
|
8
|
+
name: string;
|
|
9
|
+
}[];
|
|
10
|
+
}
|
|
11
|
+
export interface TextPickerProps {
|
|
12
|
+
visible: boolean;
|
|
13
|
+
isOneDimensional?: boolean;
|
|
14
|
+
categories: TextPickerCategory[];
|
|
15
|
+
selectedItems: {
|
|
16
|
+
[categoryId: string]: string[];
|
|
17
|
+
};
|
|
18
|
+
onAdd: (selected: {
|
|
19
|
+
[categoryId: string]: string[];
|
|
20
|
+
}) => void;
|
|
21
|
+
onClose?: () => void;
|
|
22
|
+
title?: string;
|
|
23
|
+
subtitle?: string;
|
|
24
|
+
width?: string;
|
|
25
|
+
zIndex?: number;
|
|
26
|
+
maxDocuments?: number;
|
|
27
|
+
primaryButton?: ButtonProps;
|
|
28
|
+
secondaryButton?: ButtonProps;
|
|
29
|
+
}
|
|
30
|
+
export declare const TextPickerModal: React.FC<TextPickerProps>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("../../assets/icons/arrow_left.svg.js"),i=require("react"),n=require("styled-components"),r=require("../../constants/Theme.js"),s=require("../icon-button/IconButton.js"),o=require("../input/Input.js"),l=require("../modals/styledModal.js"),d=require("../TypographyStyle.js"),a=require("./TextPickerCategoryCard.js"),c=require("./TextPickerFooter.js"),u=require("./TextPickerItemRow.js"),h=require("./TextPickerSelectAllRow.js");function g(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var x=g(n);const m=x.default.div`
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
height: 100%;
|
|
5
|
+
`,p=x.default.div`
|
|
6
|
+
padding: 12px 24px;
|
|
7
|
+
border-bottom: 1px solid ${r.COLORS.stroke.primary};
|
|
8
|
+
`,j=x.default.div`
|
|
9
|
+
flex: 1;
|
|
10
|
+
overflow-y: auto;
|
|
11
|
+
`,v=x.default.div`
|
|
12
|
+
display: flex;
|
|
13
|
+
align-items: center;
|
|
14
|
+
padding: 0 24px;
|
|
15
|
+
background: ${r.COLORS.surface.subdued};
|
|
16
|
+
border-bottom: 1px solid ${r.COLORS.stroke.primary};
|
|
17
|
+
`,C=x.default.div`
|
|
18
|
+
flex: 1;
|
|
19
|
+
display: flex;
|
|
20
|
+
align-items: center;
|
|
21
|
+
justify-content: center;
|
|
22
|
+
color: ${r.COLORS.content.secondary};
|
|
23
|
+
text-align: center;
|
|
24
|
+
padding: 32px;
|
|
25
|
+
`;exports.TextPickerModal=n=>{var g,x;const{visible:b,isOneDimensional:y=!1,categories:f,selectedItems:O,onAdd:k,onClose:S,title:T="Select Text",subtitle:w,width:L="640px",zIndex:q}=n,P=null!==(g=n.maxDocuments)&&void 0!==g?g:1/0,[B,I]=i.useState("categories"),[R,A]=i.useState(""),[F,$]=i.useState(O),[D,M]=i.useState(null),z=f.filter((e=>e.name.toLowerCase().includes(R.toLowerCase()))),_=D?D.items.filter((e=>e.name.toLowerCase().includes(R.toLowerCase()))):[],N=Object.values(F).reduce(((e,t)=>e+t.length),0),E=w||"",G=e=>{var t;return e.items.length>0&&(null===(t=F[e.id])||void 0===t?void 0:t.length)===e.items.length},H=e=>{var t;return!!(null===(t=F[e.id])||void 0===t?void 0:t.length)&&F[e.id].length<e.items.length},J=()=>{var e;return!!D&&_.length>0&&(null===(e=F[D.id])||void 0===e?void 0:e.length)===_.length},K=(e,t)=>{D&&$((i=>{const n=i[D.id]||[];return t&&N>=P?i:t?n.includes(e)?i:Object.assign(Object.assign({},i),{[D.id]:[...n,e]}):Object.assign(Object.assign({},i),{[D.id]:n.filter((t=>t!==e))})}))};return e.jsx(l.StyledModal,Object.assign({open:b,onClose:S,headingTitle:T,headingSubtitle:E,centralContainerStyles:{width:L,zIndex:q},hideCrossButton:!1,primaryButton:n.primaryButton?Object.assign(Object.assign({},n.primaryButton),{buttonText:n.primaryButton.isLoading?"Loading...":n.primaryButton.buttonText||"Add",disabled:null!==(x=n.primaryButton.disabled)&&void 0!==x&&x||0===N||P!==1/0&&N>P,onClick:n.primaryButton.onClick||(()=>k(F))}):{buttonText:"Add",disabled:0===N||P!==1/0&&N>P,onClick:()=>k(F)},footerLeftCustomElement:e.jsx(c.TextPickerFooter,{totalSelected:N,maxDocuments:P}),footerContainerStyle:{borderTop:`1px solid ${r.COLORS.stroke.primary}`,position:"absolute",bottom:0,left:0,width:"100%",zIndex:9,background:r.COLORS.surface.standard},wrapperStyle:{height:"calc(100vh - 168px)"}},{children:e.jsx(m,{children:"categories"===B?e.jsxs(e.Fragment,{children:[e.jsx(p,{children:e.jsx(o.Input,{placeholder:"Search ...",value:R,onChangeText:A,height:"40px"})}),e.jsx(j,{children:0===z.length?e.jsx(C,{children:"No categories found. Try a different search."}):z.map((t=>{var i;return e.jsx(a.TextPickerCategoryCard,{id:t.id,name:t.name,itemsCount:t.items.length,selectedCount:(null===(i=F[t.id])||void 0===i?void 0:i.length)||0,isOneDimensional:y,isChecked:G(t),isPartiallyChecked:H(t)&&!G(t),onCheck:(e,i)=>((e,t,i)=>{i&&i.stopPropagation(),$((i=>Object.assign(Object.assign({},i),{[e.id]:t?e.items.map((e=>e.id)):[]})))})(t,e,i),onClick:()=>(e=>{y||(M(e),I("items"),A(""))})(t)},t.id)}))})]}):e.jsxs(e.Fragment,{children:[e.jsxs(v,{children:[e.jsx(s.IconButton,{Icon:t.default,height:16,width:16,onClick:()=>{I("categories"),M(null),A("")},style:{marginRight:8},"aria-label":"Back"}),e.jsx(d.BodyCaption,Object.assign({style:{color:r.COLORS.content.secondary}},{children:null==D?void 0:D.name}))]}),e.jsx(p,{children:e.jsx(o.Input,{placeholder:"Search ...",value:R,onChangeText:A,height:"40px"})}),e.jsx(j,{children:0===_.length?e.jsx(C,{children:"No items found. Try a different search."}):e.jsxs(e.Fragment,{children:[e.jsx(h.TextPickerSelectAllRow,{isChecked:J(),isPartiallyChecked:(()=>{var e;return!!D&&!!(null===(e=F[D.id])||void 0===e?void 0:e.length)&&F[D.id].length<_.length})()&&!J(),onCheck:e=>{D&&$((t=>e?Object.assign(Object.assign({},t),{[D.id]:_.map((e=>e.id))}):Object.assign(Object.assign({},t),{[D.id]:[]})))}}),_.map((t=>{var i;return e.jsx(u.TextPickerItemRow,{item:t,selected:!(!D||!(null===(i=F[D.id])||void 0===i?void 0:i.includes(t.id))),onCheck:e=>K(t.id,e),onClick:()=>{var e;return K(t.id,!!D&&!(null===(e=F[D.id])||void 0===e?void 0:e.includes(t.id)))}},t.id)}))]})})]})})}))};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("styled-components"),t=require("../../constants/Theme.js"),i=require("../checkBox/CheckBox.js"),s=require("../TypographyStyle.js");function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l=c(r);const d=l.default.div`
|
|
2
|
+
background: ${e=>{let{isActive:r}=e;return r?t.COLORS.surface.hovered:t.COLORS.surface.subdued}};
|
|
3
|
+
border-bottom: 1px solid ${t.COLORS.stroke.primary};
|
|
4
|
+
padding: 12px 24px;
|
|
5
|
+
display: flex;
|
|
6
|
+
align-items: center;
|
|
7
|
+
cursor: default;
|
|
8
|
+
flex-direction: row;
|
|
9
|
+
justify-content: center;
|
|
10
|
+
align-items: center;
|
|
11
|
+
|
|
12
|
+
`,n=l.default.div`
|
|
13
|
+
display: flex;
|
|
14
|
+
margin-right: 16px;
|
|
15
|
+
`,a=l.default.div`
|
|
16
|
+
flex: 1;
|
|
17
|
+
`;exports.TextPickerSelectAllRow=r=>{let{isChecked:t,isPartiallyChecked:c,onCheck:l}=r;return e.jsxs(d,Object.assign({isActive:t||c},{children:[e.jsx(n,{children:e.jsx(i.CheckBox,{isChecked:t||c,isPartiallyChecked:c&&!t,onValueChange:l})}),e.jsx(a,{children:e.jsx(s.BodyPrimary,{children:"Select All"})})]}))};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './TextPickerModal';
|