@commercelayer/react-components 2.53.0 → 2.53.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.
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),react_1=require("react"),LineItemContext_1=(0,tslib_1.__importDefault)(require("../context/LineItemContext")),LineItemChildrenContext_1=(0,tslib_1.__importDefault)(require("../context/LineItemChildrenContext")),components_1=(0,tslib_1.__importDefault)(require("../config/components")),ShipmentChildrenContext_1=(0,tslib_1.__importDefault)(require("../context/ShipmentChildrenContext")),lodash_1=require("lodash"),propTypes=components_1.default.LineItem.propTypes,displayName=components_1.default.LineItem.displayName,LineItem=props=>{const{type="skus",children}=props,{lineItems}=(0,react_1.useContext)(LineItemContext_1.default),{lineItems:shipmentLineItems}=(0,react_1.useContext)(ShipmentChildrenContext_1.default),items=(0,lodash_1.isEmpty)(shipmentLineItems)?lineItems:shipmentLineItems,components=items&&items.filter(l=>l.item_type===type).map((lineItem,k)=>{if(lineItem.item_type==="bundles"&&k>0)return null;const lineProps={lineItem};return(0,jsx_runtime_1.jsx)(LineItemChildrenContext_1.default.Provider,Object.assign({value:lineProps},{children}),k)});return(0,jsx_runtime_1.jsx)(react_1.Fragment,{children:components},void 0)};LineItem.propTypes=propTypes,LineItem.displayName=displayName,exports.default=LineItem;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),react_1=require("react"),LineItemContext_1=(0,tslib_1.__importDefault)(require("../context/LineItemContext")),LineItemChildrenContext_1=(0,tslib_1.__importDefault)(require("../context/LineItemChildrenContext")),components_1=(0,tslib_1.__importDefault)(require("../config/components")),ShipmentChildrenContext_1=(0,tslib_1.__importDefault)(require("../context/ShipmentChildrenContext")),lodash_1=require("lodash"),propTypes=components_1.default.LineItem.propTypes,displayName=components_1.default.LineItem.displayName,LineItem=props=>{const{type="skus",children}=props,{lineItems}=(0,react_1.useContext)(LineItemContext_1.default),{lineItems:shipmentLineItems}=(0,react_1.useContext)(ShipmentChildrenContext_1.default),items=(0,lodash_1.isEmpty)(shipmentLineItems)?lineItems:shipmentLineItems,components=items&&items.filter(l=>l.item_type===type).map((lineItem,k,check)=>{if(lineItem.item_type==="bundles"&&k>0&&check[k-1].bundle_code===lineItem.bundle_code)return null;const lineProps={lineItem};return(0,jsx_runtime_1.jsx)(LineItemChildrenContext_1.default.Provider,Object.assign({value:lineProps},{children}),k)});return(0,jsx_runtime_1.jsx)(react_1.Fragment,{children:components},void 0)};LineItem.propTypes=propTypes,LineItem.displayName=displayName,exports.default=LineItem;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as _jsx}from"react/jsx-runtime";import{Fragment,useContext}from"react";import LineItemContext from"../context/LineItemContext";import LineItemChildrenContext from"../context/LineItemChildrenContext";import components from"../config/components";import ShipmentChildrenContext from"../context/ShipmentChildrenContext";import{isEmpty}from"lodash";const propTypes=components.LineItem.propTypes,displayName=components.LineItem.displayName,LineItem=props=>{const{type="skus",children}=props,{lineItems}=useContext(LineItemContext),{lineItems:shipmentLineItems}=useContext(ShipmentChildrenContext),items=isEmpty(shipmentLineItems)?lineItems:shipmentLineItems,components2=items&&items.filter(l=>l.item_type===type).map((lineItem,k)=>{if(lineItem.item_type==="bundles"&&k>0)return null;const lineProps={lineItem};return _jsx(LineItemChildrenContext.Provider,Object.assign({value:lineProps},{children}),k)});return _jsx(Fragment,{children:components2},void 0)};LineItem.propTypes=propTypes,LineItem.displayName=displayName;export default LineItem;
|
|
1
|
+
import{jsx as _jsx}from"react/jsx-runtime";import{Fragment,useContext}from"react";import LineItemContext from"../context/LineItemContext";import LineItemChildrenContext from"../context/LineItemChildrenContext";import components from"../config/components";import ShipmentChildrenContext from"../context/ShipmentChildrenContext";import{isEmpty}from"lodash";const propTypes=components.LineItem.propTypes,displayName=components.LineItem.displayName,LineItem=props=>{const{type="skus",children}=props,{lineItems}=useContext(LineItemContext),{lineItems:shipmentLineItems}=useContext(ShipmentChildrenContext),items=isEmpty(shipmentLineItems)?lineItems:shipmentLineItems,components2=items&&items.filter(l=>l.item_type===type).map((lineItem,k,check)=>{if(lineItem.item_type==="bundles"&&k>0&&check[k-1].bundle_code===lineItem.bundle_code)return null;const lineProps={lineItem};return _jsx(LineItemChildrenContext.Provider,Object.assign({value:lineProps},{children}),k)});return _jsx(Fragment,{children:components2},void 0)};LineItem.propTypes=propTypes,LineItem.displayName=displayName;export default LineItem;
|