@commercelayer/react-components 3.8.0 → 3.9.0
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/lib/components/BillingAddressForm.js +1 -1
- package/lib/components/LineItem.d.ts +1 -1
- package/lib/components/ShipmentsContainer.js +1 -1
- package/lib/components/ShippingAddressForm.js +1 -1
- package/lib/components/SkuContainer.d.ts +1 -0
- package/lib/components/SkuContainer.js +1 -0
- package/lib/components/SkuField.d.ts +2 -0
- package/lib/components/SkuField.js +1 -0
- package/lib/components/Skus.d.ts +1 -0
- package/lib/components/Skus.js +1 -0
- package/lib/components/VariantsContainer.d.ts +1 -1
- package/lib/config/components.d.ts +1 -1
- package/lib/config/components.js +1 -1
- package/lib/context/SkuChildrenContext.d.ts +2 -0
- package/lib/context/SkuChildrenContext.js +1 -0
- package/lib/context/SkuContext.d.ts +2 -0
- package/lib/context/SkuContext.js +1 -0
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/reducers/SkuReducer.d.ts +1 -0
- package/lib/reducers/SkuReducer.js +1 -0
- package/lib/typings/index.d.ts +1 -1
- package/package.json +17 -17
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__rest}from"tslib";import{jsx as _jsx}from"react/jsx-runtime";import AddressesContext from"../context/AddressContext";import useRapidForm from"rapid-form";import{useContext,useEffect,useRef}from"react";import BillingAddressFormContext from"../context/BillingAddressFormContext";import{isEmpty}from"lodash";import components from"../config/components";import OrderContext from"../context/OrderContext";import{getSaveBillingAddressToAddressBook}from"../utils/localStorage";import{businessMandatoryField}from"../utils/validateFormFields";const propTypes=components.BillingAddressForm.propTypes,BillingAddressForm=props=>{const{children,errorClassName,autoComplete="on",reset=!1}=props,p=__rest(props,["children","errorClassName","autoComplete","reset"]),{validation,values,errors,reset:resetForm}=useRapidForm(),{setAddressErrors,setAddress,isBusiness}=useContext(AddressesContext),{saveAddressToCustomerAddressBook,order,include,addResourceToInclude,includeLoaded}=useContext(OrderContext),ref=useRef(null);useEffect(()=>{var _a,_b,_c;if((include==null?void 0:include.includes("billing_address"))?(includeLoaded==null?void 0:includeLoaded.billing_address)||addResourceToInclude({newResourceLoaded:{billing_address:!0}}):addResourceToInclude({newResource:"billing_address"}),isEmpty(errors)){if(!isEmpty(values)){setAddressErrors([],"billing_address");for(const name in values){const field=values[name];businessMandatoryField(name,isBusiness)||delete values[name],((field==null?void 0:field.value)||(field==null?void 0:field.required)===!1)&&(values[name.replace("billing_address_","")]=field.value,delete values[name]),(field==null?void 0:field.type)==="checkbox"&&(delete values[name],saveAddressToCustomerAddressBook({type:"billing_address",value:field.checked}))}setAddress({values:Object.assign(Object.assign({},values),isBusiness&&{business:isBusiness}),resource:"billing_address"})}}else{const formErrors=[];for(const fieldName in errors){const{code,message}=errors[fieldName];["billing_address_state_code"].includes(fieldName)?isEmpty(values.state_code)?delete errors[fieldName]:formErrors.push({code,message,resource:"billing_address",field:fieldName}):formErrors.push({code,message,resource:"billing_address",field:fieldName})}setAddressErrors(formErrors,"billing_address")}const checkboxChecked=((_b=(_a=ref.current)===null||_a===void 0?void 0:_a.querySelector('[name="billing_address_save_to_customer_book"]'))===null||_b===void 0?void 0:_b.checked)||getSaveBillingAddressToAddressBook();reset&&(!isEmpty(values)||!isEmpty(errors)||checkboxChecked)&&(saveAddressToCustomerAddressBook&&saveAddressToCustomerAddressBook({type:"billing_address",value:!1}),ref&&((_c=ref.current)===null||_c===void 0||_c.reset(),resetForm({target:ref.current}),setAddressErrors([],"billing_address"),setAddress({values:{},resource:"billing_address"})))},[errors,values,reset,include,includeLoaded,isBusiness]);const providerValues={isBusiness,values,validation,setValue:(name,value)=>{const field={[name.replace("billing_address_","")]:value};setAddress({values:Object.assign(Object.assign(Object.assign({},values),field),isBusiness&&{business:isBusiness}),resource:"billing_address"})},errorClassName,requiresBillingInfo:(order==null?void 0:order.requires_billing_info)||!1,errors,resetField:name=>resetForm({currentTarget:ref.current},name)};return _jsx(BillingAddressFormContext.Provider,Object.assign({value:providerValues},{children:_jsx("form",Object.assign({ref,autoComplete},p,{children}))}))};BillingAddressForm.propTypes=propTypes;export default BillingAddressForm;
|
|
1
|
+
import{__rest}from"tslib";import{jsx as _jsx}from"react/jsx-runtime";import AddressesContext from"../context/AddressContext";import useRapidForm from"rapid-form";import{useContext,useEffect,useRef}from"react";import BillingAddressFormContext from"../context/BillingAddressFormContext";import{isEmpty}from"lodash";import components from"../config/components";import OrderContext from"../context/OrderContext";import{getSaveBillingAddressToAddressBook}from"../utils/localStorage";import{businessMandatoryField}from"../utils/validateFormFields";const propTypes=components.BillingAddressForm.propTypes,BillingAddressForm=props=>{const{children,errorClassName,autoComplete="on",reset=!1}=props,p=__rest(props,["children","errorClassName","autoComplete","reset"]),{validation,values,errors,reset:resetForm}=useRapidForm(),{setAddressErrors,setAddress,isBusiness}=useContext(AddressesContext),{saveAddressToCustomerAddressBook,order,include,addResourceToInclude,includeLoaded}=useContext(OrderContext),ref=useRef(null);useEffect(()=>{var _a,_b,_c;if((include==null?void 0:include.includes("billing_address"))?(includeLoaded==null?void 0:includeLoaded.billing_address)||addResourceToInclude({newResourceLoaded:{billing_address:!0}}):addResourceToInclude({newResource:"billing_address"}),isEmpty(errors)){if(!isEmpty(values)){setAddressErrors([],"billing_address");for(const name in values){const field=values[name];businessMandatoryField(name,isBusiness)||delete values[name],((field==null?void 0:field.value)||(field==null?void 0:field.required)===!1&&(field==null?void 0:field.type)!=="checkbox")&&(values[name.replace("billing_address_","")]=field.value,delete values[name]),(field==null?void 0:field.type)==="checkbox"&&(delete values[name],saveAddressToCustomerAddressBook({type:"billing_address",value:field.checked}))}setAddress({values:Object.assign(Object.assign({},values),isBusiness&&{business:isBusiness}),resource:"billing_address"})}}else{const formErrors=[];for(const fieldName in errors){const{code,message}=errors[fieldName];["billing_address_state_code"].includes(fieldName)?isEmpty(values.state_code)?delete errors[fieldName]:formErrors.push({code,message,resource:"billing_address",field:fieldName}):formErrors.push({code,message,resource:"billing_address",field:fieldName})}setAddressErrors(formErrors,"billing_address")}const checkboxChecked=((_b=(_a=ref.current)===null||_a===void 0?void 0:_a.querySelector('[name="billing_address_save_to_customer_book"]'))===null||_b===void 0?void 0:_b.checked)||getSaveBillingAddressToAddressBook();reset&&(!isEmpty(values)||!isEmpty(errors)||checkboxChecked)&&(saveAddressToCustomerAddressBook&&saveAddressToCustomerAddressBook({type:"billing_address",value:!1}),ref&&((_c=ref.current)===null||_c===void 0||_c.reset(),resetForm({target:ref.current}),setAddressErrors([],"billing_address"),setAddress({values:{},resource:"billing_address"})))},[errors,values,reset,include,includeLoaded,isBusiness]);const providerValues={isBusiness,values,validation,setValue:(name,value)=>{const field={[name.replace("billing_address_","")]:value};setAddress({values:Object.assign(Object.assign(Object.assign({},values),field),isBusiness&&{business:isBusiness}),resource:"billing_address"})},errorClassName,requiresBillingInfo:(order==null?void 0:order.requires_billing_info)||!1,errors,resetField:name=>resetForm({currentTarget:ref.current},name)};return _jsx(BillingAddressFormContext.Provider,Object.assign({value:providerValues},{children:_jsx("form",Object.assign({ref,autoComplete},p,{children}))}))};BillingAddressForm.propTypes=propTypes;export default BillingAddressForm;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import React,{ReactNode}from'react';import{LineItemType}from'../typings/index';declare type LineItemProps={children:ReactNode;type?:LineItemType;};declare const LineItem:React.FunctionComponent<LineItemProps>;export default LineItem;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__rest}from"tslib";import{jsx as _jsx}from"react/jsx-runtime";import ShipmentContext,{defaultShipmentContext}from"../context/ShipmentContext";import{useContext,useEffect,useReducer}from"react";import shipmentReducer,{shipmentInitialState,setShipmentErrors,getShipments,setShippingMethod}from"../reducers/ShipmentReducer";import OrderContext from"../context/OrderContext";import CommerceLayerContext from"../context/CommerceLayerContext";import components from"../config/components";import{isEmpty}from"lodash";const propTypes=components.ShipmentsContainer.propTypes,displayName=components.ShipmentsContainer.displayName,ShipmentsContainer=props=>{const{children}=props,p=__rest(props,["children"]),[state,dispatch]=useReducer(shipmentReducer,shipmentInitialState),{order,getOrder,include,addResourceToInclude,includeLoaded}=useContext(OrderContext),config=useContext(CommerceLayerContext);useEffect(()=>{(include==null?void 0:include.includes("shipments.available_shipping_methods"))?(includeLoaded==null?void 0:includeLoaded["shipments.available_shipping_methods"])||addResourceToInclude({newResourceLoaded:{"shipments.available_shipping_methods":!0,"shipments.shipment_line_items.line_item":!0,"shipments.shipping_method":!0,"shipments.stock_transfers":!0,"shipments.stock_location":!0}}):addResourceToInclude({newResource:["shipments.available_shipping_methods","shipments.shipment_line_items.line_item","shipments.shipping_method","shipments.stock_transfers","shipments.stock_location"]}),(include==null?void 0:include.includes("line_items.item"))?(includeLoaded==null?void 0:includeLoaded["line_items.item"])||addResourceToInclude({newResourceLoaded:{"line_items.item":!0}}):addResourceToInclude({newResource:["line_items.item"]}),order&&!isEmpty(config)&&order.shipments&&getShipments({order,dispatch,config})},[order,include,includeLoaded]),useEffect(()=>(order&&(order.shipments&&order.shipments.length>0&&order.shipments.map(shipment=>shipment.available_shipping_methods&&shipment.available_shipping_methods.length>0).includes(!1)&&setShipmentErrors([...state.errors||[],{code:"NO_SHIPPING_METHODS",message:"No shipping methods",resource:"shipments"}],dispatch),order.line_items&&order.line_items.length>0&&order.line_items.map(
|
|
1
|
+
import{__rest}from"tslib";import{jsx as _jsx}from"react/jsx-runtime";import ShipmentContext,{defaultShipmentContext}from"../context/ShipmentContext";import{useContext,useEffect,useReducer}from"react";import shipmentReducer,{shipmentInitialState,setShipmentErrors,getShipments,setShippingMethod}from"../reducers/ShipmentReducer";import OrderContext from"../context/OrderContext";import CommerceLayerContext from"../context/CommerceLayerContext";import components from"../config/components";import{isEmpty}from"lodash";const propTypes=components.ShipmentsContainer.propTypes,displayName=components.ShipmentsContainer.displayName,ShipmentsContainer=props=>{const{children}=props,p=__rest(props,["children"]),[state,dispatch]=useReducer(shipmentReducer,shipmentInitialState),{order,getOrder,include,addResourceToInclude,includeLoaded}=useContext(OrderContext),config=useContext(CommerceLayerContext);useEffect(()=>{(include==null?void 0:include.includes("shipments.available_shipping_methods"))?(includeLoaded==null?void 0:includeLoaded["shipments.available_shipping_methods"])||addResourceToInclude({newResourceLoaded:{"shipments.available_shipping_methods":!0,"shipments.shipment_line_items.line_item":!0,"shipments.shipping_method":!0,"shipments.stock_transfers":!0,"shipments.stock_location":!0}}):addResourceToInclude({newResource:["shipments.available_shipping_methods","shipments.shipment_line_items.line_item","shipments.shipping_method","shipments.stock_transfers","shipments.stock_location"]}),(include==null?void 0:include.includes("line_items.item"))?(includeLoaded==null?void 0:includeLoaded["line_items.item"])||addResourceToInclude({newResourceLoaded:{"line_items.item":!0}}):addResourceToInclude({newResource:["line_items.item"]}),order&&!isEmpty(config)&&order.shipments&&getShipments({order,dispatch,config})},[order,include,includeLoaded]),useEffect(()=>(order&&(order.shipments&&order.shipments.length>0&&order.shipments.map(shipment=>shipment.available_shipping_methods&&shipment.available_shipping_methods.length>0).includes(!1)&&setShipmentErrors([...state.errors||[],{code:"NO_SHIPPING_METHODS",message:"No shipping methods",resource:"shipments"}],dispatch),order.line_items&&order.line_items.length>0&&order.line_items.filter(({item_type})=>item_type==="skus").map(lineItem=>{var _a,_b,_c,_d,_e;return((_b=(_a=lineItem.item)===null||_a===void 0?void 0:_a.inventory)===null||_b===void 0?void 0:_b.quantity)>=(lineItem==null?void 0:lineItem.quantity)?((_c=lineItem.item)===null||_c===void 0?void 0:_c.do_not_ship)||((_e=(_d=lineItem.item)===null||_d===void 0?void 0:_d.inventory)===null||_e===void 0?void 0:_e.available):!1}).includes(!1)&&setShipmentErrors([...state.errors||[],{code:"OUT_OF_STOCK",message:"No stock available",resource:"line_items"}],dispatch)),()=>{setShipmentErrors([],dispatch)}),[order]);const contextValue=Object.assign(Object.assign({},state),{setShipmentErrors:errors=>defaultShipmentContext.setShipmentErrors(errors,dispatch),setShippingMethod:async(shipmentId,shippingMethodId)=>await setShippingMethod({shippingMethodId,shipmentId,config,getOrder,order})});return _jsx(ShipmentContext.Provider,Object.assign({value:contextValue},{children}))};ShipmentsContainer.propTypes=propTypes,ShipmentsContainer.displayName=displayName;export default ShipmentsContainer;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__rest}from"tslib";import{jsx as _jsx}from"react/jsx-runtime";import AddressesContext from"../context/AddressContext";import useRapidForm from"rapid-form";import{useContext,useEffect,useRef}from"react";import ShippingAddressFormContext from"../context/ShippingAddressFormContext";import{isEmpty}from"lodash";import components from"../config/components";import OrderContext from"../context/OrderContext";import{getSaveShippingAddressToAddressBook}from"../utils/localStorage";import{businessMandatoryField}from"../utils/validateFormFields";const propTypes=components.ShippingAddressForm.propTypes,ShippingAddressForm=props=>{const{children,errorClassName,autoComplete="on",reset=!1}=props,p=__rest(props,["children","errorClassName","autoComplete","reset"]),{validation,values,errors,reset:resetForm}=useRapidForm(),{setAddressErrors,setAddress,shipToDifferentAddress,isBusiness}=useContext(AddressesContext),{saveAddressToCustomerAddressBook,include,addResourceToInclude,includeLoaded}=useContext(OrderContext),ref=useRef(null);useEffect(()=>{var _a,_b,_c;if((include==null?void 0:include.includes("shipping_address"))?(includeLoaded==null?void 0:includeLoaded.shipping_address)||addResourceToInclude({newResourceLoaded:{shipping_address:!0}}):addResourceToInclude({newResource:"shipping_address"}),isEmpty(errors)){if(!isEmpty(values)&&shipToDifferentAddress){setAddressErrors([],"shipping_address");for(const name in values){const field=values[name];businessMandatoryField(name,isBusiness)||delete values[name],((field==null?void 0:field.value)||(field==null?void 0:field.required)===!1)&&(values[name.replace("shipping_address_","")]=field.value,delete values[name]),(field==null?void 0:field.type)==="checkbox"&&(delete values[name],saveAddressToCustomerAddressBook({type:"shipping_address",value:field.checked}))}setAddress({values:Object.assign(Object.assign({},values),isBusiness&&{business:isBusiness}),resource:"shipping_address"})}}else{const formErrors=[];for(const fieldName in errors){const{code,message}=errors[fieldName];["shipping_address_state_code"].includes(fieldName)?isEmpty(values.state_code)?delete errors[fieldName]:formErrors.push({code,message,resource:"shipping_address",field:fieldName}):formErrors.push({code,message,resource:"shipping_address",field:fieldName})}shipToDifferentAddress&&setAddressErrors(formErrors,"shipping_address")}const checkboxChecked=((_b=(_a=ref.current)===null||_a===void 0?void 0:_a.querySelector('[name="shipping_address_save_to_customer_book"]'))===null||_b===void 0?void 0:_b.checked)||getSaveShippingAddressToAddressBook();reset&&(!isEmpty(values)||!isEmpty(errors)||checkboxChecked)&&(saveAddressToCustomerAddressBook&&saveAddressToCustomerAddressBook({type:"shipping_address",value:!1}),ref&&((_c=ref.current)===null||_c===void 0||_c.reset(),resetForm({target:ref.current}),setAddressErrors([],"shipping_address"),setAddress({values:{},resource:"shipping_address"})))},[values,errors,shipToDifferentAddress,reset,include,includeLoaded,isBusiness]);const providerValues={values,validation,setValue:(name,value)=>{const field={[name.replace("shipping_address_","")]:value};setAddress({values:Object.assign(Object.assign(Object.assign({},values),field),isBusiness&&{business:isBusiness}),resource:"shipping_address"})},errorClassName,errors,resetField:name=>resetForm({currentTarget:ref.current},name)};return _jsx(ShippingAddressFormContext.Provider,Object.assign({value:providerValues},{children:_jsx("form",Object.assign({ref,autoComplete},p,{children}))}))};ShippingAddressForm.propTypes=propTypes;export default ShippingAddressForm;
|
|
1
|
+
import{__rest}from"tslib";import{jsx as _jsx}from"react/jsx-runtime";import AddressesContext from"../context/AddressContext";import useRapidForm from"rapid-form";import{useContext,useEffect,useRef}from"react";import ShippingAddressFormContext from"../context/ShippingAddressFormContext";import{isEmpty}from"lodash";import components from"../config/components";import OrderContext from"../context/OrderContext";import{getSaveShippingAddressToAddressBook}from"../utils/localStorage";import{businessMandatoryField}from"../utils/validateFormFields";const propTypes=components.ShippingAddressForm.propTypes,ShippingAddressForm=props=>{const{children,errorClassName,autoComplete="on",reset=!1}=props,p=__rest(props,["children","errorClassName","autoComplete","reset"]),{validation,values,errors,reset:resetForm}=useRapidForm(),{setAddressErrors,setAddress,shipToDifferentAddress,isBusiness}=useContext(AddressesContext),{saveAddressToCustomerAddressBook,include,addResourceToInclude,includeLoaded}=useContext(OrderContext),ref=useRef(null);useEffect(()=>{var _a,_b,_c;if((include==null?void 0:include.includes("shipping_address"))?(includeLoaded==null?void 0:includeLoaded.shipping_address)||addResourceToInclude({newResourceLoaded:{shipping_address:!0}}):addResourceToInclude({newResource:"shipping_address"}),isEmpty(errors)){if(!isEmpty(values)&&shipToDifferentAddress){setAddressErrors([],"shipping_address");for(const name in values){const field=values[name];businessMandatoryField(name,isBusiness)||delete values[name],((field==null?void 0:field.value)||(field==null?void 0:field.required)===!1&&(field==null?void 0:field.type)!=="checkbox")&&(values[name.replace("shipping_address_","")]=field.value,delete values[name]),(field==null?void 0:field.type)==="checkbox"&&(delete values[name],saveAddressToCustomerAddressBook({type:"shipping_address",value:field.checked}))}setAddress({values:Object.assign(Object.assign({},values),isBusiness&&{business:isBusiness}),resource:"shipping_address"})}}else{const formErrors=[];for(const fieldName in errors){const{code,message}=errors[fieldName];["shipping_address_state_code"].includes(fieldName)?isEmpty(values.state_code)?delete errors[fieldName]:formErrors.push({code,message,resource:"shipping_address",field:fieldName}):formErrors.push({code,message,resource:"shipping_address",field:fieldName})}shipToDifferentAddress&&setAddressErrors(formErrors,"shipping_address")}const checkboxChecked=((_b=(_a=ref.current)===null||_a===void 0?void 0:_a.querySelector('[name="shipping_address_save_to_customer_book"]'))===null||_b===void 0?void 0:_b.checked)||getSaveShippingAddressToAddressBook();reset&&(!isEmpty(values)||!isEmpty(errors)||checkboxChecked)&&(saveAddressToCustomerAddressBook&&saveAddressToCustomerAddressBook({type:"shipping_address",value:!1}),ref&&((_c=ref.current)===null||_c===void 0||_c.reset(),resetForm({target:ref.current}),setAddressErrors([],"shipping_address"),setAddress({values:{},resource:"shipping_address"})))},[values,errors,shipToDifferentAddress,reset,include,includeLoaded,isBusiness]);const providerValues={values,validation,setValue:(name,value)=>{const field={[name.replace("shipping_address_","")]:value};setAddress({values:Object.assign(Object.assign(Object.assign({},values),field),isBusiness&&{business:isBusiness}),resource:"shipping_address"})},errorClassName,errors,resetField:name=>resetForm({currentTarget:ref.current},name)};return _jsx(ShippingAddressFormContext.Provider,Object.assign({value:providerValues},{children:_jsx("form",Object.assign({ref,autoComplete},p,{children}))}))};ShippingAddressForm.propTypes=propTypes;export default ShippingAddressForm;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{QueryParamsList}from'@commercelayer/sdk';import{ReactNode}from'react';declare type Props={skus:string[];children:ReactNode;queryParams?:QueryParamsList;};declare function SkuContainer<P extends Props>(props:P):JSX.Element;declare namespace SkuContainer{var propTypes:{children:import("prop-types").Validator<boolean|import("react").ReactChild|import("react").ReactFragment|import("react").ReactPortal|(()=>ReactNode)>;};}export default SkuContainer;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as _jsx}from"react/jsx-runtime";import components from"../config/components";import CommerceLayerContext from"../context/CommerceLayerContext";import SkuContext from"../context/SkuContext";import skuReducer,{getSku,skuInitialState}from"../reducers/SkuReducer";import{useContext,useEffect,useMemo,useReducer}from"react";export default function SkuContainer(props){const{skus,children,queryParams}=props,[state,dispatch]=useReducer(skuReducer,skuInitialState),config=useContext(CommerceLayerContext),loadSkus=async()=>await getSku({config,dispatch,skus,queryParams});useEffect(()=>(config.accessToken&&(state==null?void 0:state.skus)&&(state==null?void 0:state.skus.length)===0&&loadSkus(),()=>{dispatch({type:"setLoading",payload:{loading:!0}})}),[config,skus]);const contextValue=useMemo(()=>state,[state]);return _jsx(SkuContext.Provider,Object.assign({value:contextValue},{children}))}SkuContainer.propTypes=components.SkuContainer.propTypes;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import{Sku}from'@commercelayer/sdk';declare type ExcludeTag<T extends keyof JSX.IntrinsicElements>=Exclude<keyof JSX.IntrinsicElements,T>;declare type Conditional=({attribute:'image_url';tagElement:'img';}&JSX.IntrinsicElements['img'])|({attribute:Exclude<keyof Sku,'image_url'>;tagElement:ExcludeTag<'img'>;}&JSX.IntrinsicElements[ExcludeTag<'img'>]);declare type ChildrenProps=Omit<Props,'children'|'attribute'>&{element:Sku[keyof Sku];};declare type Props={children?:(props:ChildrenProps)=>JSX.Element;}&Conditional;declare function SkuField<P extends Props>({attribute,tagElement,children,...p}:P):JSX.Element;declare namespace SkuField{var propTypes:{children:import("prop-types").Requireable<(...args:any[])=>any>;attribute:import("prop-types").Requireable<string>;tagElement:import("prop-types").Requireable<string>;};}export default SkuField;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{__rest}from"tslib";import{jsx as _jsx}from"react/jsx-runtime";import SkuChildrenContext from"../context/SkuChildrenContext";import{useContext}from"react";import Parent from"./utils/Parent";import components from"../config/components";export default function SkuField(_a){var{attribute,tagElement,children}=_a,p=__rest(_a,["attribute","tagElement","children"]);const{sku}=useContext(SkuChildrenContext),element=sku&&sku[attribute]||"",Tag=tagElement;if(Tag==="img"){const src=element,name=sku==null?void 0:sku.name;return _jsx("img",Object.assign({alt:name,src},p))}const parentProps=Object.assign({element,tagElement},p);return children?_jsx(Parent,Object.assign({},parentProps,{children})):_jsx(Tag,{children:element})}SkuField.propTypes=components.SkuField.propTypes;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{ReactNode}from'react';declare type Props={children:ReactNode;};declare function Skus<P extends Props>({children}:P):JSX.Element;declare namespace Skus{var propTypes:{children:import("prop-types").Validator<boolean|import("react").ReactChild|import("react").ReactFragment|import("react").ReactPortal|(()=>ReactNode)>;};}export default Skus;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as _jsx,Fragment as _Fragment}from"react/jsx-runtime";import components from"../config/components";import SkuChildrenContext from"../context/SkuChildrenContext";import SkuContext from"../context/SkuContext";import{useContext}from"react";export default function Skus({children}){const{skus}=useContext(SkuContext),components2=skus&&skus.map((sku,key)=>{const value={sku};return _jsx(SkuChildrenContext.Provider,Object.assign({value},{children}),key)});return _jsx(_Fragment,{children:components2})}Skus.propTypes=components.Skus.propTypes;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import React,{ReactNode}from'react';declare type VariantsContainerProps={children:ReactNode;filters?:Record<string,any>;skuCode?:string;};declare const VariantsContainer:React.FunctionComponent<VariantsContainerProps>;export default VariantsContainer;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import PropTypes from'prop-types';import{TimeFormat,BaseInputType,GiftCardInputName,LineItemType,BasePriceType,BaseFormatPrice,BaseSelectorType,AddressInputName,AddressCountrySelectName,AddressStateSelectName}from'../typings/index';import{DeliveryLeadTimeField}from'../components/DeliveryLeadTime';import{StockTransferFieldType}from'../components/StockTransferField';import{PaymentSourceDetailType}from'../components/PaymentSourceDetail';import{CodeType}from'../reducers/OrderReducer';import{ShipmentAttribute}from'../components/ShipmentField';declare const components:{Address:{permittedChildren:string[];displayName:string;propTypes:{children:PropTypes.Validator<boolean|import("react").ReactChild|import("react").ReactFragment|import("react").ReactPortal|(()=>import("react").ReactNode)>;};};AddressCountrySelector:{displayName:string;propTypes:{children:PropTypes.Requireable<(...args:any[])=>any>;placeholder:PropTypes.Requireable<PropTypes.InferProps<{label:PropTypes.Validator<string>;value:PropTypes.Validator<string|number>;}>>;value:PropTypes.Requireable<string>;name:PropTypes.Validator<AddressCountrySelectName>;required:PropTypes.Requireable<boolean>;};defaultProps:{required:boolean;};};AddressStateSelector:{displayName:string;propTypes:{children:PropTypes.Requireable<(...args:any[])=>any>;placeholder:PropTypes.Requireable<PropTypes.InferProps<{label:PropTypes.Validator<string>;value:PropTypes.Validator<string|number>;}>>;value:PropTypes.Requireable<string>;name:PropTypes.Validator<AddressStateSelectName>;required:PropTypes.Requireable<boolean>;};defaultProps:{required:boolean;};};AddressField:{displayName:string;propTypes:{children:PropTypes.Requireable<(...args:any[])=>any>;};};AddressInput:{displayName:string;propTypes:{children:PropTypes.Requireable<(...args:any[])=>any>;name:PropTypes.Validator<AddressInputName>;type:PropTypes.Validator<BaseInputType>;placeholder:PropTypes.Requireable<string>;disabled:PropTypes.Requireable<boolean>;required:PropTypes.Requireable<boolean>;};defaultProps:{required:boolean;};};AdjustmentAmount:{displayName:string;propTypes:{id:PropTypes.Requireable<string>;className:PropTypes.Requireable<string>;style:PropTypes.Requireable<object>;name:PropTypes.Requireable<string>;children:PropTypes.Requireable<(...args:any[])=>any>;format:PropTypes.Requireable<BaseFormatPrice>;};defaultProps:{format:BaseFormatPrice;};};AddToCartButton:{displayName:string;propTypes:{children:PropTypes.Requireable<(...args:any[])=>any>;label:PropTypes.Requireable<string|PropTypes.ReactElementLike>;skuCode:PropTypes.Requireable<string>;disabled:PropTypes.Requireable<boolean>;lineItem:PropTypes.Requireable<PropTypes.InferProps<{name:PropTypes.Validator<string>;imageUrl:PropTypes.Requireable<string>;}>>;};defaultProps:{label:string;};};AddressesContainer:{displayName:string;permittedChildren:string[];propTypes:{children:PropTypes.Validator<boolean|import("react").ReactChild|import("react").ReactFragment|import("react").ReactPortal|(()=>import("react").ReactNode)>;shipToDifferentAddress:PropTypes.Requireable<boolean>;};};AvailabilityContainer:{displayName:string;permittedChildren:string[];propTypes:{children:PropTypes.Validator<boolean|import("react").ReactChild|import("react").ReactFragment|import("react").ReactPortal|(()=>import("react").ReactNode)>;skuCode:PropTypes.Requireable<string>;};};AvailabilityTemplate:{displayName:string;propTypes:{timeFormat:PropTypes.Requireable<TimeFormat>;showShippingMethodName:PropTypes.Requireable<boolean>;children:PropTypes.Requireable<(...args:any[])=>any>;};defaultProps:{timeFormat:string;showShippingMethodName:boolean;};};BillingAddressContainer:{permittedChildren:string[];propTypes:{children:PropTypes.Validator<boolean|import("react").ReactChild|import("react").ReactFragment|import("react").ReactPortal|(()=>import("react").ReactNode)>;};};BillingAddressForm:{permittedChildren:string[];propTypes:{children:PropTypes.Validator<boolean|import("react").ReactChild|import("react").ReactFragment|import("react").ReactPortal|(()=>import("react").ReactNode)>;};};CheckoutLink:{displayName:string;propTypes:{children:PropTypes.Requireable<(...args:any[])=>any>;label:PropTypes.Requireable<string>;};defaultProps:{label:string;};};CommerceLayer:{permittedChildren:string[];propTypes:{children:PropTypes.Validator<boolean|import("react").ReactChild|import("react").ReactFragment|import("react").ReactPortal|(()=>import("react").ReactNode)>;accessToken:PropTypes.Validator<string>;endpoint:PropTypes.Validator<string>;};};CustomerContainer:{displayName:string;permittedChildren:string[];propTypes:{children:PropTypes.Validator<boolean|import("react").ReactChild|import("react").ReactFragment|import("react").ReactPortal|(()=>import("react").ReactNode)>;isGuest:PropTypes.Requireable<boolean>;};};CustomerInput:{displayName:string;propTypes:{children:PropTypes.Requireable<(...args:any[])=>any>;name:PropTypes.Requireable<string>;type:PropTypes.Requireable<string>;placeholder:PropTypes.Requireable<string>;disabled:PropTypes.Requireable<boolean>;required:PropTypes.Requireable<boolean>;saveOnBlur:PropTypes.Requireable<boolean>;};defaultProps:{required:boolean;};};DeliveryLeadTime:{displayName:string;propTypes:{type:PropTypes.Validator<DeliveryLeadTimeField>;children:PropTypes.Requireable<(...args:any[])=>any>;};};DiscountAmount:{displayName:string;propTypes:{id:PropTypes.Requireable<string>;className:PropTypes.Requireable<string>;style:PropTypes.Requireable<object>;name:PropTypes.Requireable<string>;children:PropTypes.Requireable<(...args:any[])=>any>;format:PropTypes.Requireable<BaseFormatPrice>;};defaultProps:{format:BaseFormatPrice;};};Errors:{displayName:string;propTypes:{resource:PropTypes.Validator<import("../typings/errors").ResourceErrorType>;children:PropTypes.Requireable<(...args:any[])=>any>;field:PropTypes.Requireable<string>;};defaultProps:{messages:never[];field:string;};};ExternalFunction:{displayName:string;permittedChildren:string[];propTypes:{children:PropTypes.Validator<boolean|import("react").ReactChild|import("react").ReactFragment|import("react").ReactPortal|(()=>import("react").ReactNode)>;url:PropTypes.Validator<string>;};};GiftCard:{permittedChildren:string[];displayName:string;propTypes:{children:PropTypes.Validator<boolean|import("react").ReactChild|import("react").ReactFragment|import("react").ReactPortal|(()=>import("react").ReactNode)>;onSubmit:PropTypes.Requireable<(...args:any[])=>any>;};defaultProps:{onSubmit:undefined;};};GiftCardAmount:{displayName:string;propTypes:{id:PropTypes.Requireable<string>;className:PropTypes.Requireable<string>;style:PropTypes.Requireable<object>;name:PropTypes.Requireable<string>;children:PropTypes.Requireable<(...args:any[])=>any>;format:PropTypes.Requireable<BaseFormatPrice>;};};GiftCardContainer:{permittedChildren:string[];displayName:string;propTypes:{children:PropTypes.Validator<boolean|import("react").ReactChild|import("react").ReactFragment|import("react").ReactPortal|(()=>import("react").ReactNode)>;};};GiftCardCurrencySelector:{displayName:string;propTypes:{children:PropTypes.Requireable<(...args:any[])=>any>;placeholder:PropTypes.Requireable<PropTypes.InferProps<{value:PropTypes.Validator<string|number>;label:PropTypes.Validator<string>;}>>;value:PropTypes.Requireable<string>;required:PropTypes.Requireable<boolean>;};defaultProps:{required:boolean;};};GiftCardInput:{displayName:string;propTypes:{type:PropTypes.Validator<BaseInputType>;name:PropTypes.Validator<GiftCardInputName>;children:PropTypes.Requireable<(...args:any[])=>any>;placeholder:PropTypes.Requireable<string>;};};GiftCardOrCouponForm:{permittedChildren:string[];propTypes:{children:PropTypes.Validator<boolean|import("react").ReactChild|import("react").ReactFragment|import("react").ReactPortal|(()=>import("react").ReactNode)>;};};GiftCardOrCouponInput:{displayName:string;propTypes:{children:PropTypes.Requireable<(...args:any[])=>any>;placeholder:PropTypes.Requireable<string>;disabled:PropTypes.Requireable<boolean>;required:PropTypes.Requireable<boolean>;};};GiftCardOrCouponSubmit:{displayName:string;propTypes:{children:PropTypes.Requireable<(...args:any[])=>any>;label:PropTypes.Requireable<string|object>;};};GiftCardOrCouponCode:{displayName:string;propTypes:{children:PropTypes.Requireable<(...args:any[])=>any>;type:PropTypes.Requireable<CodeType>;};};GiftCardOrCouponRemoveButton:{displayName:string;propTypes:{children:PropTypes.Requireable<(...args:any[])=>any>;type:PropTypes.Requireable<CodeType>;label:PropTypes.Requireable<string|object>;};};ItemContainer:{permittedChildren:string[];displayName:string;propTypes:{children:PropTypes.Validator<boolean|import("react").ReactChild|import("react").ReactFragment|import("react").ReactPortal|(()=>import("react").ReactNode)>;skuCode:PropTypes.Requireable<string>;lineItem:PropTypes.Requireable<PropTypes.InferProps<{name:PropTypes.Validator<string>;imageUrl:PropTypes.Requireable<string>;}>>;};};LineItem:{permittedChildren:string[];displayName:string;propTypes:{children:PropTypes.Validator<boolean|import("react").ReactChild|import("react").ReactFragment|import("react").ReactPortal|(()=>import("react").ReactNode)>;type:PropTypes.Requireable<LineItemType>;};defaultProps:{type:string;};};LineItemAmount:{displayName:string;propTypes:{type:PropTypes.Requireable<BasePriceType>;id:PropTypes.Requireable<string>;className:PropTypes.Requireable<string>;style:PropTypes.Requireable<object>;name:PropTypes.Requireable<string>;children:PropTypes.Requireable<(...args:any[])=>any>;format:PropTypes.Requireable<BaseFormatPrice>;};defaultProps:{format:string;type:string;};};LineItemImage:{displayName:string;propTypes:{width:PropTypes.Requireable<number>;children:PropTypes.Requireable<(...args:any[])=>any>;};};LineItemName:{displayName:string;propTypes:{children:PropTypes.Requireable<(...args:any[])=>any>;};};LineItemCode:{displayName:string;propTypes:{children:PropTypes.Requireable<(...args:any[])=>any>;};};LineItemOption:{displayName:string;propTypes:{name:PropTypes.Requireable<string>;children:PropTypes.Requireable<(...args:any[])=>any>;valueClassName:PropTypes.Requireable<string>;className:PropTypes.Requireable<string>;id:PropTypes.Requireable<string>;style:PropTypes.Requireable<object>;};};LineItemOptions:{permittedChildren:string[];displayName:string;propTypes:{children:PropTypes.Validator<boolean|import("react").ReactChild|import("react").ReactFragment|import("react").ReactPortal|(()=>import("react").ReactNode)>;title:PropTypes.Requireable<string>;showName:PropTypes.Requireable<boolean>;skuOptionId:PropTypes.Requireable<string>;};};LineItemQuantity:{displayName:string;propTypes:{children:PropTypes.Requireable<(...args:any[])=>any>;max:PropTypes.Requireable<number>;disabled:PropTypes.Requireable<boolean>;readonly:PropTypes.Requireable<boolean>;};defaultProps:{max:number;};};LineItemRemoveLink:{displayName:string;propTypes:{children:PropTypes.Requireable<(...args:any[])=>any>;label:PropTypes.Requireable<string>;};defaultProps:{label:string;};};LineItemsContainer:{permittedChildren:string[];displayName:string;propTypes:{children:PropTypes.Validator<boolean|import("react").ReactChild|import("react").ReactFragment|import("react").ReactPortal|(()=>import("react").ReactNode)>;filters:PropTypes.Requireable<object>;loader:PropTypes.Requireable<string|PropTypes.ReactElementLike>;};defaultProps:{filters:{};loader:string;};};LineItemsCount:{displayName:string;propTypes:{children:PropTypes.Requireable<(...args:any[])=>any>;id:PropTypes.Requireable<string>;className:PropTypes.Requireable<string>;name:PropTypes.Requireable<string>;style:PropTypes.Requireable<object>;};};LineItemsEmpty:{displayName:string;propTypes:{children:PropTypes.Requireable<(...args:any[])=>any>;id:PropTypes.Requireable<string>;className:PropTypes.Requireable<string>;name:PropTypes.Requireable<string>;style:PropTypes.Requireable<object>;text:PropTypes.Requireable<string>;};};MetadataInput:{displayName:string;propTypes:{children:PropTypes.Requireable<(...args:any[])=>any>;name:PropTypes.Validator<string>;type:PropTypes.Validator<BaseInputType>;onChange:PropTypes.Requireable<(...args:any[])=>any>;placeholder:PropTypes.Requireable<string>;};};OrderContainer:{permittedChildren:string[];displayName:string;propTypes:{children:PropTypes.Validator<boolean|import("react").ReactChild|import("react").ReactFragment|import("react").ReactPortal|(()=>import("react").ReactNode)>;orderId:PropTypes.Requireable<string>;metadata:PropTypes.Requireable<{[x:string]:string|null|undefined;}>;attributes:PropTypes.Requireable<object>;};defaultProps:{metadata:{};};};OrderNumber:{displayName:string;propTypes:{className:PropTypes.Requireable<string>;};defaultProps:{format:BaseFormatPrice;};};OrderStorage:{permittedChildren:string[];displayName:string;propTypes:{children:PropTypes.Validator<boolean|import("react").ReactChild|import("react").ReactFragment|import("react").ReactPortal|(()=>import("react").ReactNode)>;clearWhenPlaced:PropTypes.Requireable<boolean>;persistKey:PropTypes.Validator<string>;};};PaymentMethod:{permittedChildren:string[];displayName:string;propTypes:{children:PropTypes.Validator<boolean|import("react").ReactChild|import("react").ReactFragment|import("react").ReactPortal|(()=>import("react").ReactNode)>;};};PaymentMethodAmount:{displayName:string;propTypes:{id:PropTypes.Requireable<string>;className:PropTypes.Requireable<string>;style:PropTypes.Requireable<object>;name:PropTypes.Requireable<string>;children:PropTypes.Requireable<(...args:any[])=>any>;format:PropTypes.Requireable<BaseFormatPrice>;};defaultProps:{format:BaseFormatPrice;};};PaymentMethodName:{displayName:string;propTypes:{children:PropTypes.Requireable<(...args:any[])=>any>;};};PaymentMethodPrice:{displayName:string;propTypes:{type:PropTypes.Requireable<"amount">;id:PropTypes.Requireable<string>;className:PropTypes.Requireable<string>;style:PropTypes.Requireable<object>;name:PropTypes.Requireable<string>;children:PropTypes.Requireable<(...args:any[])=>any>;format:PropTypes.Requireable<BaseFormatPrice>;};};PaymentMethodRadioButton:{displayName:string;propTypes:{children:PropTypes.Requireable<(...args:any[])=>any>;};};PaymentMethodsContainer:{displayName:string;permittedChildren:string[];propTypes:{children:PropTypes.Validator<boolean|import("react").ReactChild|import("react").ReactFragment|import("react").ReactPortal|(()=>import("react").ReactNode)>;};};PaymentSource:{displayName:string;permittedChildren:string[];propTypes:{children:PropTypes.Requireable<import("react").ReactNode|(()=>import("react").ReactNode)>;readonly:PropTypes.Requireable<boolean>;};};PaymentSourceBrandIcon:{displayName:string;propTypes:{children:PropTypes.Requireable<(...args:any[])=>any>;width:PropTypes.Requireable<number>;height:PropTypes.Requireable<number>;src:PropTypes.Requireable<string>;className:PropTypes.Requireable<string>;};};PaymentSourceBrandName:{displayName:string;propTypes:{children:PropTypes.Requireable<(...args:any[])=>any>;label:PropTypes.Requireable<string>;};};PaymentSourceEditButton:{displayName:string;propTypes:{children:PropTypes.Requireable<(...args:any[])=>any>;label:PropTypes.Requireable<string|PropTypes.ReactElementLike>;};};PaymentSourceDetail:{displayName:string;propTypes:{type:PropTypes.Validator<PaymentSourceDetailType>;};};PlaceOrderButton:{displayName:string;propTypes:{children:PropTypes.Requireable<(...args:any[])=>any>;label:PropTypes.Requireable<string|PropTypes.ReactElementLike>;};defaultProps:{label:string;};};PlaceOrderContainer:{displayName:string;permittedChildren:string[];propTypes:{children:PropTypes.Validator<boolean|import("react").ReactChild|import("react").ReactFragment|import("react").ReactPortal|(()=>import("react").ReactNode)>;};};Price:{displayName:string;propTypes:{children:PropTypes.Requireable<(...args:any[])=>any>;compareClassName:PropTypes.Requireable<string>;skuCode:PropTypes.Requireable<string>;showCompare:PropTypes.Requireable<boolean>;};defaultProps:{skuCode:string;};};PricesContainer:{permittedChildren:string[];displayName:string;propTypes:{children:PropTypes.Validator<boolean|import("react").ReactChild|import("react").ReactFragment|import("react").ReactPortal|(()=>import("react").ReactNode)>;skuCode:PropTypes.Requireable<string>;loader:PropTypes.Requireable<string|PropTypes.ReactElementLike>;perPage:PropTypes.Requireable<number>;filters:PropTypes.Requireable<object>;};defaultProps:{perPage:number;filters:{};loader:string;skuCode:string;};};PrivacyAndTermsCheckbox:{displayName:string;propTypes:{children:PropTypes.Requireable<(...args:any[])=>any>;};};QuantitySelector:{displayName:string;propTypes:{children:PropTypes.Requireable<(...args:any[])=>any>;min:PropTypes.Requireable<number>;max:PropTypes.Requireable<number>;value:PropTypes.Requireable<string>;skuCode:PropTypes.Requireable<string>;disabled:PropTypes.Requireable<boolean>;};defaultProps:{min:number;};};SaveAddressesButton:{displayName:string;propTypes:{children:PropTypes.Requireable<(...args:any[])=>any>;label:PropTypes.Requireable<string|PropTypes.ReactElementLike>;onClick:PropTypes.Requireable<(...args:any[])=>any>;disabled:PropTypes.Requireable<boolean>;};defaultProps:{label:string;};};Shipment:{permittedChildren:string[];displayName:string;propTypes:{children:PropTypes.Validator<boolean|import("react").ReactChild|import("react").ReactFragment|import("react").ReactPortal|(()=>import("react").ReactNode)>;};};ShipmentField:{displayName:string;propTypes:{children:PropTypes.Requireable<(...args:any[])=>any>;name:PropTypes.Validator<ShipmentAttribute>;};};ShipmentsContainer:{displayName:string;permittedChildren:string[];propTypes:{children:PropTypes.Validator<boolean|import("react").ReactChild|import("react").ReactFragment|import("react").ReactPortal|(()=>import("react").ReactNode)>;};};ShippingAddressContainer:{permittedChildren:string[];propTypes:{children:PropTypes.Validator<boolean|import("react").ReactChild|import("react").ReactFragment|import("react").ReactPortal|(()=>import("react").ReactNode)>;};};SaveCustomerButton:{displayName:string;propTypes:{children:PropTypes.Requireable<(...args:any[])=>any>;label:PropTypes.Requireable<string|PropTypes.ReactElementLike>;onClick:PropTypes.Requireable<(...args:any[])=>any>;};defaultProps:{label:string;};};ShippingAddressForm:{permittedChildren:string[];propTypes:{children:PropTypes.Validator<boolean|import("react").ReactChild|import("react").ReactFragment|import("react").ReactPortal|(()=>import("react").ReactNode)>;};};ShippingAmount:{displayName:string;propTypes:{id:PropTypes.Requireable<string>;className:PropTypes.Requireable<string>;style:PropTypes.Requireable<object>;name:PropTypes.Requireable<string>;children:PropTypes.Requireable<(...args:any[])=>any>;format:PropTypes.Requireable<BaseFormatPrice>;};};ShippingMethod:{permittedChildren:string[];displayName:string;propTypes:{children:PropTypes.Validator<boolean|import("react").ReactChild|import("react").ReactFragment|import("react").ReactPortal|(()=>import("react").ReactNode)>;readonly:PropTypes.Requireable<boolean>;};};ShippingMethodName:{displayName:string;propTypes:{children:PropTypes.Requireable<(...args:any[])=>any>;};};ShippingMethodRadioButton:{displayName:string;propTypes:{children:PropTypes.Requireable<(...args:any[])=>any>;};};ShippingMethodPrice:{displayName:string;propTypes:{type:PropTypes.Requireable<"amount">;id:PropTypes.Requireable<string>;className:PropTypes.Requireable<string>;style:PropTypes.Requireable<object>;name:PropTypes.Requireable<string>;children:PropTypes.Requireable<(...args:any[])=>any>;format:PropTypes.Requireable<BaseFormatPrice>;};defaultProps:{format:string;type:string;};};SkuList:{permittedChildren:string[];displayName:string;propTypes:{children:PropTypes.Validator<boolean|import("react").ReactChild|import("react").ReactFragment|import("react").ReactPortal|(()=>import("react").ReactNode)>;id:PropTypes.Validator<string>;};};SkuListsContainer:{permittedChildren:string[];displayName:string;propTypes:{children:PropTypes.Validator<boolean|import("react").ReactChild|import("react").ReactFragment|import("react").ReactPortal|(()=>import("react").ReactNode)>;};};SkuOption:{permittedChildren:string[];displayName:string;propTypes:{children:PropTypes.Validator<boolean|import("react").ReactChild|import("react").ReactFragment|import("react").ReactPortal|(()=>import("react").ReactNode)>;id:PropTypes.Validator<string>;};};SkuOptionInput:{displayName:string;propTypes:{children:PropTypes.Requireable<(...args:any[])=>any>;name:PropTypes.Validator<string>;type:PropTypes.Validator<BaseInputType>;onChange:PropTypes.Requireable<(...args:any[])=>any>;placeholder:PropTypes.Requireable<string>;};};SkuOptionsContainer:{permittedChildren:string[];displayName:string;propTypes:{children:PropTypes.Validator<boolean|import("react").ReactChild|import("react").ReactFragment|import("react").ReactPortal|(()=>import("react").ReactNode)>;skuCode:PropTypes.Requireable<string>;};};StockTransfer:{permittedChildren:string[];displayName:string;propTypes:{children:PropTypes.Validator<boolean|import("react").ReactChild|import("react").ReactFragment|import("react").ReactPortal|(()=>import("react").ReactNode)>;};};StockTransferField:{displayName:string;propTypes:{children:PropTypes.Requireable<(...args:any[])=>any>;type:PropTypes.Validator<StockTransferFieldType>;};};SubmitButton:{displayName:string;propTypes:{children:PropTypes.Requireable<(...args:any[])=>any>;label:PropTypes.Requireable<string|PropTypes.ReactElementLike>;};defaultProps:{label:string;};};SubTotalAmount:{displayName:string;propTypes:{id:PropTypes.Requireable<string>;className:PropTypes.Requireable<string>;style:PropTypes.Requireable<object>;name:PropTypes.Requireable<string>;children:PropTypes.Requireable<(...args:any[])=>any>;format:PropTypes.Requireable<BaseFormatPrice>;};defaultProps:{format:BaseFormatPrice;};};TaxesAmount:{displayName:string;propTypes:{id:PropTypes.Requireable<string>;className:PropTypes.Requireable<string>;style:PropTypes.Requireable<object>;name:PropTypes.Requireable<string>;children:PropTypes.Requireable<(...args:any[])=>any>;format:PropTypes.Requireable<BaseFormatPrice>;};defaultProps:{format:BaseFormatPrice;};};TotalAmount:{displayName:string;propTypes:{id:PropTypes.Requireable<string>;className:PropTypes.Requireable<string>;style:PropTypes.Requireable<object>;name:PropTypes.Requireable<string>;children:PropTypes.Requireable<(...args:any[])=>any>;format:PropTypes.Requireable<BaseFormatPrice>;};defaultProps:{format:BaseFormatPrice;};};VariantsContainer:{permittedChildren:string[];displayName:string;propTypes:{children:PropTypes.Validator<boolean|import("react").ReactChild|import("react").ReactFragment|import("react").ReactPortal|(()=>import("react").ReactNode)>;skuCode:PropTypes.Requireable<string>;filters:PropTypes.Requireable<object>;};defaultProps:{skuCode:string;filters:{};};};VariantSelector:{displayName:string;propTypes:{options:PropTypes.Validator<PropTypes.InferProps<{label:PropTypes.Validator<string>;code:PropTypes.Validator<string>;lineItem:PropTypes.Requireable<PropTypes.InferProps<{name:PropTypes.Validator<string>;imageUrl:PropTypes.Requireable<string>;}>>;}>[]>;name:PropTypes.Requireable<string>;children:PropTypes.Requireable<(...args:any[])=>any>;type:PropTypes.Requireable<BaseSelectorType>;loader:PropTypes.Requireable<PropTypes.ReactElementLike>;placeholder:PropTypes.Requireable<string>;skuCode:PropTypes.Requireable<string>;};defaultProps:{placeholder:string;type:BaseSelectorType;};};};export default components;
|
|
2
|
+
import PropTypes from'prop-types';import{TimeFormat,BaseInputType,GiftCardInputName,LineItemType,BasePriceType,BaseFormatPrice,BaseSelectorType,AddressInputName,AddressCountrySelectName,AddressStateSelectName}from'../typings/index';import{DeliveryLeadTimeField}from'../components/DeliveryLeadTime';import{StockTransferFieldType}from'../components/StockTransferField';import{PaymentSourceDetailType}from'../components/PaymentSourceDetail';import{CodeType}from'../reducers/OrderReducer';import{ShipmentAttribute}from'../components/ShipmentField';declare const components:{Address:{permittedChildren:string[];displayName:string;propTypes:{children:PropTypes.Validator<boolean|import("react").ReactChild|import("react").ReactFragment|import("react").ReactPortal|(()=>import("react").ReactNode)>;};};AddressCountrySelector:{displayName:string;propTypes:{children:PropTypes.Requireable<(...args:any[])=>any>;placeholder:PropTypes.Requireable<PropTypes.InferProps<{label:PropTypes.Validator<string>;value:PropTypes.Validator<string|number>;}>>;value:PropTypes.Requireable<string>;name:PropTypes.Validator<AddressCountrySelectName>;required:PropTypes.Requireable<boolean>;};defaultProps:{required:boolean;};};AddressStateSelector:{displayName:string;propTypes:{children:PropTypes.Requireable<(...args:any[])=>any>;placeholder:PropTypes.Requireable<PropTypes.InferProps<{label:PropTypes.Validator<string>;value:PropTypes.Validator<string|number>;}>>;value:PropTypes.Requireable<string>;name:PropTypes.Validator<AddressStateSelectName>;required:PropTypes.Requireable<boolean>;};defaultProps:{required:boolean;};};AddressField:{displayName:string;propTypes:{children:PropTypes.Requireable<(...args:any[])=>any>;};};AddressInput:{displayName:string;propTypes:{children:PropTypes.Requireable<(...args:any[])=>any>;name:PropTypes.Validator<AddressInputName>;type:PropTypes.Validator<BaseInputType>;placeholder:PropTypes.Requireable<string>;disabled:PropTypes.Requireable<boolean>;required:PropTypes.Requireable<boolean>;};defaultProps:{required:boolean;};};AdjustmentAmount:{displayName:string;propTypes:{id:PropTypes.Requireable<string>;className:PropTypes.Requireable<string>;style:PropTypes.Requireable<object>;name:PropTypes.Requireable<string>;children:PropTypes.Requireable<(...args:any[])=>any>;format:PropTypes.Requireable<BaseFormatPrice>;};defaultProps:{format:BaseFormatPrice;};};AddToCartButton:{displayName:string;propTypes:{children:PropTypes.Requireable<(...args:any[])=>any>;label:PropTypes.Requireable<string|PropTypes.ReactElementLike>;skuCode:PropTypes.Requireable<string>;disabled:PropTypes.Requireable<boolean>;lineItem:PropTypes.Requireable<PropTypes.InferProps<{name:PropTypes.Validator<string>;imageUrl:PropTypes.Requireable<string>;}>>;};defaultProps:{label:string;};};AddressesContainer:{displayName:string;permittedChildren:string[];propTypes:{children:PropTypes.Validator<boolean|import("react").ReactChild|import("react").ReactFragment|import("react").ReactPortal|(()=>import("react").ReactNode)>;shipToDifferentAddress:PropTypes.Requireable<boolean>;};};AvailabilityContainer:{displayName:string;permittedChildren:string[];propTypes:{children:PropTypes.Validator<boolean|import("react").ReactChild|import("react").ReactFragment|import("react").ReactPortal|(()=>import("react").ReactNode)>;skuCode:PropTypes.Requireable<string>;};};AvailabilityTemplate:{displayName:string;propTypes:{timeFormat:PropTypes.Requireable<TimeFormat>;showShippingMethodName:PropTypes.Requireable<boolean>;children:PropTypes.Requireable<(...args:any[])=>any>;};defaultProps:{timeFormat:string;showShippingMethodName:boolean;};};BillingAddressContainer:{permittedChildren:string[];propTypes:{children:PropTypes.Validator<boolean|import("react").ReactChild|import("react").ReactFragment|import("react").ReactPortal|(()=>import("react").ReactNode)>;};};BillingAddressForm:{permittedChildren:string[];propTypes:{children:PropTypes.Validator<boolean|import("react").ReactChild|import("react").ReactFragment|import("react").ReactPortal|(()=>import("react").ReactNode)>;};};CheckoutLink:{displayName:string;propTypes:{children:PropTypes.Requireable<(...args:any[])=>any>;label:PropTypes.Requireable<string>;};defaultProps:{label:string;};};CommerceLayer:{permittedChildren:string[];propTypes:{children:PropTypes.Validator<boolean|import("react").ReactChild|import("react").ReactFragment|import("react").ReactPortal|(()=>import("react").ReactNode)>;accessToken:PropTypes.Validator<string>;endpoint:PropTypes.Validator<string>;};};CustomerContainer:{displayName:string;permittedChildren:string[];propTypes:{children:PropTypes.Validator<boolean|import("react").ReactChild|import("react").ReactFragment|import("react").ReactPortal|(()=>import("react").ReactNode)>;isGuest:PropTypes.Requireable<boolean>;};};CustomerInput:{displayName:string;propTypes:{children:PropTypes.Requireable<(...args:any[])=>any>;name:PropTypes.Requireable<string>;type:PropTypes.Requireable<string>;placeholder:PropTypes.Requireable<string>;disabled:PropTypes.Requireable<boolean>;required:PropTypes.Requireable<boolean>;saveOnBlur:PropTypes.Requireable<boolean>;};defaultProps:{required:boolean;};};DeliveryLeadTime:{displayName:string;propTypes:{type:PropTypes.Validator<DeliveryLeadTimeField>;children:PropTypes.Requireable<(...args:any[])=>any>;};};DiscountAmount:{displayName:string;propTypes:{id:PropTypes.Requireable<string>;className:PropTypes.Requireable<string>;style:PropTypes.Requireable<object>;name:PropTypes.Requireable<string>;children:PropTypes.Requireable<(...args:any[])=>any>;format:PropTypes.Requireable<BaseFormatPrice>;};defaultProps:{format:BaseFormatPrice;};};Errors:{displayName:string;propTypes:{resource:PropTypes.Validator<import("../typings/errors").ResourceErrorType>;children:PropTypes.Requireable<(...args:any[])=>any>;field:PropTypes.Requireable<string>;};defaultProps:{messages:never[];field:string;};};ExternalFunction:{displayName:string;permittedChildren:string[];propTypes:{children:PropTypes.Validator<boolean|import("react").ReactChild|import("react").ReactFragment|import("react").ReactPortal|(()=>import("react").ReactNode)>;url:PropTypes.Validator<string>;};};GiftCard:{permittedChildren:string[];displayName:string;propTypes:{children:PropTypes.Validator<boolean|import("react").ReactChild|import("react").ReactFragment|import("react").ReactPortal|(()=>import("react").ReactNode)>;onSubmit:PropTypes.Requireable<(...args:any[])=>any>;};defaultProps:{onSubmit:undefined;};};GiftCardAmount:{displayName:string;propTypes:{id:PropTypes.Requireable<string>;className:PropTypes.Requireable<string>;style:PropTypes.Requireable<object>;name:PropTypes.Requireable<string>;children:PropTypes.Requireable<(...args:any[])=>any>;format:PropTypes.Requireable<BaseFormatPrice>;};};GiftCardContainer:{permittedChildren:string[];displayName:string;propTypes:{children:PropTypes.Validator<boolean|import("react").ReactChild|import("react").ReactFragment|import("react").ReactPortal|(()=>import("react").ReactNode)>;};};GiftCardCurrencySelector:{displayName:string;propTypes:{children:PropTypes.Requireable<(...args:any[])=>any>;placeholder:PropTypes.Requireable<PropTypes.InferProps<{value:PropTypes.Validator<string|number>;label:PropTypes.Validator<string>;}>>;value:PropTypes.Requireable<string>;required:PropTypes.Requireable<boolean>;};defaultProps:{required:boolean;};};GiftCardInput:{displayName:string;propTypes:{type:PropTypes.Validator<BaseInputType>;name:PropTypes.Validator<GiftCardInputName>;children:PropTypes.Requireable<(...args:any[])=>any>;placeholder:PropTypes.Requireable<string>;};};GiftCardOrCouponForm:{permittedChildren:string[];propTypes:{children:PropTypes.Validator<boolean|import("react").ReactChild|import("react").ReactFragment|import("react").ReactPortal|(()=>import("react").ReactNode)>;};};GiftCardOrCouponInput:{displayName:string;propTypes:{children:PropTypes.Requireable<(...args:any[])=>any>;placeholder:PropTypes.Requireable<string>;disabled:PropTypes.Requireable<boolean>;required:PropTypes.Requireable<boolean>;};};GiftCardOrCouponSubmit:{displayName:string;propTypes:{children:PropTypes.Requireable<(...args:any[])=>any>;label:PropTypes.Requireable<string|object>;};};GiftCardOrCouponCode:{displayName:string;propTypes:{children:PropTypes.Requireable<(...args:any[])=>any>;type:PropTypes.Requireable<CodeType>;};};GiftCardOrCouponRemoveButton:{displayName:string;propTypes:{children:PropTypes.Requireable<(...args:any[])=>any>;type:PropTypes.Requireable<CodeType>;label:PropTypes.Requireable<string|object>;};};ItemContainer:{permittedChildren:string[];displayName:string;propTypes:{children:PropTypes.Validator<boolean|import("react").ReactChild|import("react").ReactFragment|import("react").ReactPortal|(()=>import("react").ReactNode)>;skuCode:PropTypes.Requireable<string>;lineItem:PropTypes.Requireable<PropTypes.InferProps<{name:PropTypes.Validator<string>;imageUrl:PropTypes.Requireable<string>;}>>;};};LineItem:{permittedChildren:string[];displayName:string;propTypes:{children:PropTypes.Validator<boolean|import("react").ReactChild|import("react").ReactFragment|import("react").ReactPortal|(()=>import("react").ReactNode)>;type:PropTypes.Requireable<LineItemType>;};defaultProps:{type:string;};};LineItemAmount:{displayName:string;propTypes:{type:PropTypes.Requireable<BasePriceType>;id:PropTypes.Requireable<string>;className:PropTypes.Requireable<string>;style:PropTypes.Requireable<object>;name:PropTypes.Requireable<string>;children:PropTypes.Requireable<(...args:any[])=>any>;format:PropTypes.Requireable<BaseFormatPrice>;};defaultProps:{format:string;type:string;};};LineItemImage:{displayName:string;propTypes:{width:PropTypes.Requireable<number>;children:PropTypes.Requireable<(...args:any[])=>any>;};};LineItemName:{displayName:string;propTypes:{children:PropTypes.Requireable<(...args:any[])=>any>;};};LineItemCode:{displayName:string;propTypes:{children:PropTypes.Requireable<(...args:any[])=>any>;};};LineItemOption:{displayName:string;propTypes:{name:PropTypes.Requireable<string>;children:PropTypes.Requireable<(...args:any[])=>any>;valueClassName:PropTypes.Requireable<string>;className:PropTypes.Requireable<string>;id:PropTypes.Requireable<string>;style:PropTypes.Requireable<object>;};};LineItemOptions:{permittedChildren:string[];displayName:string;propTypes:{children:PropTypes.Validator<boolean|import("react").ReactChild|import("react").ReactFragment|import("react").ReactPortal|(()=>import("react").ReactNode)>;title:PropTypes.Requireable<string>;showName:PropTypes.Requireable<boolean>;skuOptionId:PropTypes.Requireable<string>;};};LineItemQuantity:{displayName:string;propTypes:{children:PropTypes.Requireable<(...args:any[])=>any>;max:PropTypes.Requireable<number>;disabled:PropTypes.Requireable<boolean>;readonly:PropTypes.Requireable<boolean>;};defaultProps:{max:number;};};LineItemRemoveLink:{displayName:string;propTypes:{children:PropTypes.Requireable<(...args:any[])=>any>;label:PropTypes.Requireable<string>;};defaultProps:{label:string;};};LineItemsContainer:{permittedChildren:string[];displayName:string;propTypes:{children:PropTypes.Validator<boolean|import("react").ReactChild|import("react").ReactFragment|import("react").ReactPortal|(()=>import("react").ReactNode)>;filters:PropTypes.Requireable<object>;loader:PropTypes.Requireable<string|PropTypes.ReactElementLike>;};defaultProps:{filters:{};loader:string;};};LineItemsCount:{displayName:string;propTypes:{children:PropTypes.Requireable<(...args:any[])=>any>;id:PropTypes.Requireable<string>;className:PropTypes.Requireable<string>;name:PropTypes.Requireable<string>;style:PropTypes.Requireable<object>;};};LineItemsEmpty:{displayName:string;propTypes:{children:PropTypes.Requireable<(...args:any[])=>any>;id:PropTypes.Requireable<string>;className:PropTypes.Requireable<string>;name:PropTypes.Requireable<string>;style:PropTypes.Requireable<object>;text:PropTypes.Requireable<string>;};};MetadataInput:{displayName:string;propTypes:{children:PropTypes.Requireable<(...args:any[])=>any>;name:PropTypes.Validator<string>;type:PropTypes.Validator<BaseInputType>;onChange:PropTypes.Requireable<(...args:any[])=>any>;placeholder:PropTypes.Requireable<string>;};};OrderContainer:{permittedChildren:string[];displayName:string;propTypes:{children:PropTypes.Validator<boolean|import("react").ReactChild|import("react").ReactFragment|import("react").ReactPortal|(()=>import("react").ReactNode)>;orderId:PropTypes.Requireable<string>;metadata:PropTypes.Requireable<{[x:string]:string|null|undefined;}>;attributes:PropTypes.Requireable<object>;};defaultProps:{metadata:{};};};OrderNumber:{displayName:string;propTypes:{className:PropTypes.Requireable<string>;};defaultProps:{format:BaseFormatPrice;};};OrderStorage:{permittedChildren:string[];displayName:string;propTypes:{children:PropTypes.Validator<boolean|import("react").ReactChild|import("react").ReactFragment|import("react").ReactPortal|(()=>import("react").ReactNode)>;clearWhenPlaced:PropTypes.Requireable<boolean>;persistKey:PropTypes.Validator<string>;};};PaymentMethod:{permittedChildren:string[];displayName:string;propTypes:{children:PropTypes.Validator<boolean|import("react").ReactChild|import("react").ReactFragment|import("react").ReactPortal|(()=>import("react").ReactNode)>;};};PaymentMethodAmount:{displayName:string;propTypes:{id:PropTypes.Requireable<string>;className:PropTypes.Requireable<string>;style:PropTypes.Requireable<object>;name:PropTypes.Requireable<string>;children:PropTypes.Requireable<(...args:any[])=>any>;format:PropTypes.Requireable<BaseFormatPrice>;};defaultProps:{format:BaseFormatPrice;};};PaymentMethodName:{displayName:string;propTypes:{children:PropTypes.Requireable<(...args:any[])=>any>;};};PaymentMethodPrice:{displayName:string;propTypes:{type:PropTypes.Requireable<"amount">;id:PropTypes.Requireable<string>;className:PropTypes.Requireable<string>;style:PropTypes.Requireable<object>;name:PropTypes.Requireable<string>;children:PropTypes.Requireable<(...args:any[])=>any>;format:PropTypes.Requireable<BaseFormatPrice>;};};PaymentMethodRadioButton:{displayName:string;propTypes:{children:PropTypes.Requireable<(...args:any[])=>any>;};};PaymentMethodsContainer:{displayName:string;permittedChildren:string[];propTypes:{children:PropTypes.Validator<boolean|import("react").ReactChild|import("react").ReactFragment|import("react").ReactPortal|(()=>import("react").ReactNode)>;};};PaymentSource:{displayName:string;permittedChildren:string[];propTypes:{children:PropTypes.Requireable<import("react").ReactNode|(()=>import("react").ReactNode)>;readonly:PropTypes.Requireable<boolean>;};};PaymentSourceBrandIcon:{displayName:string;propTypes:{children:PropTypes.Requireable<(...args:any[])=>any>;width:PropTypes.Requireable<number>;height:PropTypes.Requireable<number>;src:PropTypes.Requireable<string>;className:PropTypes.Requireable<string>;};};PaymentSourceBrandName:{displayName:string;propTypes:{children:PropTypes.Requireable<(...args:any[])=>any>;label:PropTypes.Requireable<string>;};};PaymentSourceEditButton:{displayName:string;propTypes:{children:PropTypes.Requireable<(...args:any[])=>any>;label:PropTypes.Requireable<string|PropTypes.ReactElementLike>;};};PaymentSourceDetail:{displayName:string;propTypes:{type:PropTypes.Validator<PaymentSourceDetailType>;};};PlaceOrderButton:{displayName:string;propTypes:{children:PropTypes.Requireable<(...args:any[])=>any>;label:PropTypes.Requireable<string|PropTypes.ReactElementLike>;};defaultProps:{label:string;};};PlaceOrderContainer:{displayName:string;permittedChildren:string[];propTypes:{children:PropTypes.Validator<boolean|import("react").ReactChild|import("react").ReactFragment|import("react").ReactPortal|(()=>import("react").ReactNode)>;};};Price:{displayName:string;propTypes:{children:PropTypes.Requireable<(...args:any[])=>any>;compareClassName:PropTypes.Requireable<string>;skuCode:PropTypes.Requireable<string>;showCompare:PropTypes.Requireable<boolean>;};defaultProps:{skuCode:string;};};PricesContainer:{permittedChildren:string[];displayName:string;propTypes:{children:PropTypes.Validator<boolean|import("react").ReactChild|import("react").ReactFragment|import("react").ReactPortal|(()=>import("react").ReactNode)>;skuCode:PropTypes.Requireable<string>;loader:PropTypes.Requireable<string|PropTypes.ReactElementLike>;perPage:PropTypes.Requireable<number>;filters:PropTypes.Requireable<object>;};defaultProps:{perPage:number;filters:{};loader:string;skuCode:string;};};PrivacyAndTermsCheckbox:{displayName:string;propTypes:{children:PropTypes.Requireable<(...args:any[])=>any>;};};QuantitySelector:{displayName:string;propTypes:{children:PropTypes.Requireable<(...args:any[])=>any>;min:PropTypes.Requireable<number>;max:PropTypes.Requireable<number>;value:PropTypes.Requireable<string>;skuCode:PropTypes.Requireable<string>;disabled:PropTypes.Requireable<boolean>;};defaultProps:{min:number;};};SaveAddressesButton:{displayName:string;propTypes:{children:PropTypes.Requireable<(...args:any[])=>any>;label:PropTypes.Requireable<string|PropTypes.ReactElementLike>;onClick:PropTypes.Requireable<(...args:any[])=>any>;disabled:PropTypes.Requireable<boolean>;};defaultProps:{label:string;};};Shipment:{permittedChildren:string[];displayName:string;propTypes:{children:PropTypes.Validator<boolean|import("react").ReactChild|import("react").ReactFragment|import("react").ReactPortal|(()=>import("react").ReactNode)>;};};ShipmentField:{displayName:string;propTypes:{children:PropTypes.Requireable<(...args:any[])=>any>;name:PropTypes.Validator<ShipmentAttribute>;};};ShipmentsContainer:{displayName:string;permittedChildren:string[];propTypes:{children:PropTypes.Validator<boolean|import("react").ReactChild|import("react").ReactFragment|import("react").ReactPortal|(()=>import("react").ReactNode)>;};};ShippingAddressContainer:{permittedChildren:string[];propTypes:{children:PropTypes.Validator<boolean|import("react").ReactChild|import("react").ReactFragment|import("react").ReactPortal|(()=>import("react").ReactNode)>;};};SaveCustomerButton:{displayName:string;propTypes:{children:PropTypes.Requireable<(...args:any[])=>any>;label:PropTypes.Requireable<string|PropTypes.ReactElementLike>;onClick:PropTypes.Requireable<(...args:any[])=>any>;};defaultProps:{label:string;};};ShippingAddressForm:{permittedChildren:string[];propTypes:{children:PropTypes.Validator<boolean|import("react").ReactChild|import("react").ReactFragment|import("react").ReactPortal|(()=>import("react").ReactNode)>;};};ShippingAmount:{displayName:string;propTypes:{id:PropTypes.Requireable<string>;className:PropTypes.Requireable<string>;style:PropTypes.Requireable<object>;name:PropTypes.Requireable<string>;children:PropTypes.Requireable<(...args:any[])=>any>;format:PropTypes.Requireable<BaseFormatPrice>;};};ShippingMethod:{permittedChildren:string[];displayName:string;propTypes:{children:PropTypes.Validator<boolean|import("react").ReactChild|import("react").ReactFragment|import("react").ReactPortal|(()=>import("react").ReactNode)>;readonly:PropTypes.Requireable<boolean>;};};ShippingMethodName:{displayName:string;propTypes:{children:PropTypes.Requireable<(...args:any[])=>any>;};};ShippingMethodRadioButton:{displayName:string;propTypes:{children:PropTypes.Requireable<(...args:any[])=>any>;};};ShippingMethodPrice:{displayName:string;propTypes:{type:PropTypes.Requireable<"amount">;id:PropTypes.Requireable<string>;className:PropTypes.Requireable<string>;style:PropTypes.Requireable<object>;name:PropTypes.Requireable<string>;children:PropTypes.Requireable<(...args:any[])=>any>;format:PropTypes.Requireable<BaseFormatPrice>;};defaultProps:{format:string;type:string;};};SkuContainer:{displayName:string;permittedChildren:string[];propTypes:{children:PropTypes.Validator<boolean|import("react").ReactChild|import("react").ReactFragment|import("react").ReactPortal|(()=>import("react").ReactNode)>;};};Skus:{displayName:string;permittedChildren:string[];propTypes:{children:PropTypes.Validator<boolean|import("react").ReactChild|import("react").ReactFragment|import("react").ReactPortal|(()=>import("react").ReactNode)>;};};SkuField:{displayName:string;propTypes:{children:PropTypes.Requireable<(...args:any[])=>any>;attribute:PropTypes.Requireable<string>;tagElement:PropTypes.Requireable<string>;};};SkuList:{permittedChildren:string[];displayName:string;propTypes:{children:PropTypes.Validator<boolean|import("react").ReactChild|import("react").ReactFragment|import("react").ReactPortal|(()=>import("react").ReactNode)>;id:PropTypes.Validator<string>;};};SkuListsContainer:{permittedChildren:string[];displayName:string;propTypes:{children:PropTypes.Validator<boolean|import("react").ReactChild|import("react").ReactFragment|import("react").ReactPortal|(()=>import("react").ReactNode)>;};};SkuOption:{permittedChildren:string[];displayName:string;propTypes:{children:PropTypes.Validator<boolean|import("react").ReactChild|import("react").ReactFragment|import("react").ReactPortal|(()=>import("react").ReactNode)>;id:PropTypes.Validator<string>;};};SkuOptionInput:{displayName:string;propTypes:{children:PropTypes.Requireable<(...args:any[])=>any>;name:PropTypes.Validator<string>;type:PropTypes.Validator<BaseInputType>;onChange:PropTypes.Requireable<(...args:any[])=>any>;placeholder:PropTypes.Requireable<string>;};};SkuOptionsContainer:{permittedChildren:string[];displayName:string;propTypes:{children:PropTypes.Validator<boolean|import("react").ReactChild|import("react").ReactFragment|import("react").ReactPortal|(()=>import("react").ReactNode)>;skuCode:PropTypes.Requireable<string>;};};StockTransfer:{permittedChildren:string[];displayName:string;propTypes:{children:PropTypes.Validator<boolean|import("react").ReactChild|import("react").ReactFragment|import("react").ReactPortal|(()=>import("react").ReactNode)>;};};StockTransferField:{displayName:string;propTypes:{children:PropTypes.Requireable<(...args:any[])=>any>;type:PropTypes.Validator<StockTransferFieldType>;};};SubmitButton:{displayName:string;propTypes:{children:PropTypes.Requireable<(...args:any[])=>any>;label:PropTypes.Requireable<string|PropTypes.ReactElementLike>;};defaultProps:{label:string;};};SubTotalAmount:{displayName:string;propTypes:{id:PropTypes.Requireable<string>;className:PropTypes.Requireable<string>;style:PropTypes.Requireable<object>;name:PropTypes.Requireable<string>;children:PropTypes.Requireable<(...args:any[])=>any>;format:PropTypes.Requireable<BaseFormatPrice>;};defaultProps:{format:BaseFormatPrice;};};TaxesAmount:{displayName:string;propTypes:{id:PropTypes.Requireable<string>;className:PropTypes.Requireable<string>;style:PropTypes.Requireable<object>;name:PropTypes.Requireable<string>;children:PropTypes.Requireable<(...args:any[])=>any>;format:PropTypes.Requireable<BaseFormatPrice>;};defaultProps:{format:BaseFormatPrice;};};TotalAmount:{displayName:string;propTypes:{id:PropTypes.Requireable<string>;className:PropTypes.Requireable<string>;style:PropTypes.Requireable<object>;name:PropTypes.Requireable<string>;children:PropTypes.Requireable<(...args:any[])=>any>;format:PropTypes.Requireable<BaseFormatPrice>;};defaultProps:{format:BaseFormatPrice;};};VariantsContainer:{permittedChildren:string[];displayName:string;propTypes:{children:PropTypes.Validator<boolean|import("react").ReactChild|import("react").ReactFragment|import("react").ReactPortal|(()=>import("react").ReactNode)>;skuCode:PropTypes.Requireable<string>;filters:PropTypes.Requireable<object>;};defaultProps:{skuCode:string;filters:{};};};VariantSelector:{displayName:string;propTypes:{options:PropTypes.Validator<PropTypes.InferProps<{label:PropTypes.Validator<string>;code:PropTypes.Validator<string>;lineItem:PropTypes.Requireable<PropTypes.InferProps<{name:PropTypes.Validator<string>;imageUrl:PropTypes.Requireable<string>;}>>;}>[]>;name:PropTypes.Requireable<string>;children:PropTypes.Requireable<(...args:any[])=>any>;type:PropTypes.Requireable<BaseSelectorType>;loader:PropTypes.Requireable<PropTypes.ReactElementLike>;placeholder:PropTypes.Requireable<string>;skuCode:PropTypes.Requireable<string>;};defaultProps:{placeholder:string;type:BaseSelectorType;};};};export default components;
|
package/lib/config/components.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import PropTypes from"prop-types";import childrenTypes from"../utils/childrenTypes";import{baseOrderComponentPricePropTypes,PTLoader,BMObject}from"../typings/index";import{ErrorPropTypes}from"../typings/errors";import{BaseInputComponentPropTypes}from"../typings/index";const components={Address:{permittedChildren:["AddressField","ReactNode"],displayName:"Address",propTypes:{children:childrenTypes.isRequired}},AddressCountrySelector:{displayName:"AddressCountrySelector",propTypes:{children:PropTypes.func,placeholder:PropTypes.shape({label:PropTypes.string.isRequired,value:PropTypes.oneOfType([PropTypes.string,PropTypes.number]).isRequired}),value:PropTypes.string,name:PropTypes.oneOf(["billing_address_country_code","shipping_address_country_code"]).isRequired,required:PropTypes.bool},defaultProps:{required:!0}},AddressStateSelector:{displayName:"AddressStateSelector",propTypes:{children:PropTypes.func,placeholder:PropTypes.shape({label:PropTypes.string.isRequired,value:PropTypes.oneOfType([PropTypes.string,PropTypes.number]).isRequired}),value:PropTypes.string,name:PropTypes.oneOf(["billing_address_state_code","shipping_address_state_code"]).isRequired,required:PropTypes.bool},defaultProps:{required:!0}},AddressField:{displayName:"AddressField",propTypes:{children:PropTypes.func}},AddressInput:{displayName:"AddressInput",propTypes:{children:PropTypes.func,name:PropTypes.oneOf(["billing_address_city","billing_address_company","billing_address_email","billing_address_first_name","billing_address_last_name","billing_address_line_1","billing_address_line_2","billing_address_phone","billing_address_state_code","billing_address_zip_code","billing_address_billing_info","billing_address_save_to_customer_book","shipping_address_city","shipping_address_company","shipping_address_email","shipping_address_first_name","shipping_address_last_name","shipping_address_line_1","shipping_address_line_2","shipping_address_phone","shipping_address_state_code","shipping_address_zip_code","shipping_address_save_to_customer_book"]).isRequired,type:PropTypes.oneOf(["checkbox","date","email","number","tel","text","textarea"]).isRequired,placeholder:PropTypes.string,disabled:PropTypes.bool,required:PropTypes.bool},defaultProps:{required:!0}},AdjustmentAmount:{displayName:"AdjustmentAmount",propTypes:baseOrderComponentPricePropTypes,defaultProps:{format:"formatted"}},AddToCartButton:{displayName:"AddToCartButton",propTypes:{children:PropTypes.func,label:PropTypes.oneOfType([PropTypes.string,PropTypes.element]),skuCode:PropTypes.string,disabled:PropTypes.bool,lineItem:PropTypes.shape({name:PropTypes.string.isRequired,imageUrl:PropTypes.string})},defaultProps:{label:"Add to cart"}},AddressesContainer:{displayName:"AddressesContainer",permittedChildren:["BillingAddressForm","BillingAddressContainer","ShippingAddressForm","ShippingAddressContainer","SaveAddressesButton","ReactNode"],propTypes:{children:childrenTypes.isRequired,shipToDifferentAddress:PropTypes.bool}},AvailabilityContainer:{displayName:"AvailabilityContainer",permittedChildren:["AvailabilityTemplate","ReactNode"],propTypes:{children:childrenTypes.isRequired,skuCode:PropTypes.string}},AvailabilityTemplate:{displayName:"AvailabilityTemplate",propTypes:{timeFormat:PropTypes.oneOf(["days","hours"]),showShippingMethodName:PropTypes.bool,children:PropTypes.func},defaultProps:{timeFormat:"days",showShippingMethodName:!1}},BillingAddressContainer:{permittedChildren:["Address","ReactNode"],propTypes:{children:childrenTypes.isRequired}},BillingAddressForm:{permittedChildren:["AddressInput","ReactNode","Errors"],propTypes:{children:childrenTypes.isRequired}},CheckoutLink:{displayName:"CheckoutLink",propTypes:{children:PropTypes.func,label:PropTypes.string},defaultProps:{label:"Checkout"}},CommerceLayer:{permittedChildren:["OrderContainer","OrderStorage","PricesContainer","GiftCardContainer","ReactNode"],propTypes:{children:childrenTypes.isRequired,accessToken:PropTypes.string.isRequired,endpoint:PropTypes.string.isRequired}},CustomerContainer:{displayName:"CustomerContainer",permittedChildren:["CustomerInput","SaveCustomerButton","AddressesContainer","PaymentMethodsContainer","ShipmentsContainer","ReactNode"],propTypes:{children:childrenTypes.isRequired,isGuest:PropTypes.bool}},CustomerInput:{displayName:"CustomerInput",propTypes:{children:PropTypes.func,name:PropTypes.oneOf(["customerEmail"]),type:PropTypes.oneOf(["email"]),placeholder:PropTypes.string,disabled:PropTypes.bool,required:PropTypes.bool,saveOnBlur:PropTypes.bool},defaultProps:{required:!0}},DeliveryLeadTime:{displayName:"DeliveryLeadTime",propTypes:{type:PropTypes.oneOf(["max_days","max_hours","min_days","min_hours"]).isRequired,children:PropTypes.func}},DiscountAmount:{displayName:"DiscountAmount",propTypes:baseOrderComponentPricePropTypes,defaultProps:{format:"formatted"}},Errors:{displayName:"Errors",propTypes:ErrorPropTypes,defaultProps:{messages:[],field:"base"}},ExternalFunction:{displayName:"ExternalFunction",permittedChildren:["AddToCartButton","ReactNode"],propTypes:{children:childrenTypes.isRequired,url:PropTypes.string.isRequired}},GiftCard:{permittedChildren:["GiftCardCurrencySelector","GiftCardInput","Errors","MetadataInput","SubmitButton","ReactNode"],displayName:"GiftCard",propTypes:{children:childrenTypes.isRequired,onSubmit:PropTypes.func},defaultProps:{onSubmit:void 0}},GiftCardAmount:{displayName:"GiftCardAmount",propTypes:baseOrderComponentPricePropTypes},GiftCardContainer:{permittedChildren:["GiftCard","Errors","ReactNode"],displayName:"GiftCardContainer",propTypes:{children:childrenTypes.isRequired}},GiftCardCurrencySelector:{displayName:"GiftCardCurrencySelector",propTypes:{children:PropTypes.func,placeholder:PropTypes.shape({value:PropTypes.oneOfType([PropTypes.string,PropTypes.number]).isRequired,label:PropTypes.string.isRequired}),value:PropTypes.string,required:PropTypes.bool},defaultProps:{required:!0}},GiftCardInput:{displayName:"GiftCardInput",propTypes:{type:PropTypes.oneOf(["text","email","number","date","checkbox"]).isRequired,name:PropTypes.oneOf(["balanceCents","balanceMaxCents","singleUse","rechargeable","imageUrl","expiresAt","referenceOrigin","email","firstName","lastName","reference"]).isRequired,children:PropTypes.func,placeholder:PropTypes.string}},GiftCardOrCouponForm:{permittedChildren:["GiftCardOrCouponInput","GiftCardOrCouponSubmit","ReactNode"],propTypes:{children:childrenTypes.isRequired}},GiftCardOrCouponInput:{displayName:"GiftCardOrCouponInput",propTypes:{children:PropTypes.func,placeholder:PropTypes.string,disabled:PropTypes.bool,required:PropTypes.bool}},GiftCardOrCouponSubmit:{displayName:"GiftCardOrCouponSubmit",propTypes:{children:PropTypes.func,label:PropTypes.oneOfType([PropTypes.string,PropTypes.object])}},GiftCardOrCouponCode:{displayName:"GiftCardOrCouponCode",propTypes:{children:PropTypes.func,type:PropTypes.oneOf(["coupon","gift_card"])}},GiftCardOrCouponRemoveButton:{displayName:"GiftCardOrCouponRemoveButton",propTypes:{children:PropTypes.func,type:PropTypes.oneOf(["coupon","gift_card"]),label:PropTypes.oneOfType([PropTypes.string,PropTypes.object])}},ItemContainer:{permittedChildren:["PricesContainer","VariantsContainer","SkuOptionContainer","QuantitySelector","AddToCartButton","AvailabilityContainer","SkuListsContainer","ReactNode"],displayName:"ItemContainer",propTypes:{children:childrenTypes.isRequired,skuCode:PropTypes.string,lineItem:PropTypes.shape({name:PropTypes.string.isRequired,imageUrl:PropTypes.string})}},LineItem:{permittedChildren:["AvailabilityContainer","LineItemImage","LineItemName","LineItemOptions","LineItemQuantity","LineItemAmount","LineItemRemoveLink","StockTransfer","Errors","ReactNode"],displayName:"LineItem",propTypes:{children:childrenTypes.isRequired,type:PropTypes.oneOf(["skus","gift_cards","shipments","payment_methods","promotions","adjustments","bundles"])},defaultProps:{type:"skus"}},LineItemAmount:{displayName:"LineItemAmount",propTypes:Object.assign(Object.assign({},baseOrderComponentPricePropTypes),{type:PropTypes.oneOf(["total","unit","option"])}),defaultProps:{format:"formatted",type:"total"}},LineItemImage:{displayName:"LineItemImage",propTypes:{width:PropTypes.number,children:PropTypes.func}},LineItemName:{displayName:"LineItemName",propTypes:{children:PropTypes.func}},LineItemCode:{displayName:"LineItemCode",propTypes:{children:PropTypes.func}},LineItemOption:{displayName:"LineItemOption",propTypes:{name:PropTypes.string,children:PropTypes.func,valueClassName:PropTypes.string,className:PropTypes.string,id:PropTypes.string,style:PropTypes.object}},LineItemOptions:{permittedChildren:["LineItemOption","ReactNode"],displayName:"LineItemOptions",propTypes:{children:childrenTypes.isRequired,title:PropTypes.string,showName:PropTypes.bool,skuOptionId:PropTypes.string}},LineItemQuantity:{displayName:"LineItemQuantity",propTypes:{children:PropTypes.func,max:PropTypes.number,disabled:PropTypes.bool,readonly:PropTypes.bool},defaultProps:{max:50}},LineItemRemoveLink:{displayName:"LineItemRemoveLink",propTypes:{children:PropTypes.func,label:PropTypes.string},defaultProps:{label:"Remove"}},LineItemsContainer:{permittedChildren:["LineItemsCount","LineItemsEmpty","LineItem","ReactNode"],displayName:"LineItemsContainer",propTypes:{children:childrenTypes.isRequired,filters:PropTypes.object,loader:PTLoader},defaultProps:{filters:{},loader:"Loading..."}},LineItemsCount:{displayName:"LineItemsCount",propTypes:{children:PropTypes.func,id:PropTypes.string,className:PropTypes.string,name:PropTypes.string,style:PropTypes.object}},LineItemsEmpty:{displayName:"LineItemsEmpty",propTypes:{children:PropTypes.func,id:PropTypes.string,className:PropTypes.string,name:PropTypes.string,style:PropTypes.object,text:PropTypes.string}},MetadataInput:{displayName:"MetadataInput",propTypes:BaseInputComponentPropTypes},OrderContainer:{permittedChildren:["AddressesContainer","CustomerContainer","ItemContainer","LineItemsContainer","SubTotalAmount","DiscountAmount","AdjustmentAmount","ShippingAmount","TaxesAmount","GiftCardAmount","TotalAmount","CheckoutLink","GiftCardContainer","ShipmentsContainer","PaymentMethodsContainer","PaymentMethodAmount","GiftCardOrCouponForm","GiftCardOrCouponCode","GiftCardOrCouponRemoveButton","Errors","OrderNumber","ReactNode"],displayName:"OrderContainer",propTypes:{children:childrenTypes.isRequired,orderId:PropTypes.string,metadata:BMObject,attributes:PropTypes.object},defaultProps:{metadata:{}}},OrderNumber:{displayName:"OrderNumber",propTypes:{className:PropTypes.string},defaultProps:{format:"formatted"}},OrderStorage:{permittedChildren:["OrderContainer","ReactNode"],displayName:"OrderStorage",propTypes:{children:childrenTypes.isRequired,clearWhenPlaced:PropTypes.bool,persistKey:PropTypes.string.isRequired}},PaymentMethod:{permittedChildren:["PaymentMethodName","PaymentMethodRadioButton","PaymentMethodPrice","PaymentSource","ReactNode","Errors"],displayName:"PaymentMethod",propTypes:{children:childrenTypes.isRequired}},PaymentMethodAmount:{displayName:"PaymentMethodAmount",propTypes:baseOrderComponentPricePropTypes,defaultProps:{format:"formatted"}},PaymentMethodName:{displayName:"PaymentMethodName",propTypes:{children:PropTypes.func}},PaymentMethodPrice:{displayName:"PaymentMethodPrice",propTypes:Object.assign(Object.assign({},baseOrderComponentPricePropTypes),{type:PropTypes.oneOf(["amount"])})},PaymentMethodRadioButton:{displayName:"PaymentMethodRadioButton",propTypes:{children:PropTypes.func}},PaymentMethodsContainer:{displayName:"PaymentMethodsContainer",permittedChildren:["PaymentSource","ReactNode","PlaceOrderContainer"],propTypes:{children:childrenTypes.isRequired}},PaymentSource:{displayName:"PaymentSource",permittedChildren:["PaymentSourceBrandIcon","PaymentSourceBrandName","PaymentSourceEditButton","PaymentSourceDetail","ReactNode"],propTypes:{children:childrenTypes,readonly:PropTypes.bool}},PaymentSourceBrandIcon:{displayName:"PaymentSourceBrandIcon",propTypes:{children:PropTypes.func,width:PropTypes.number,height:PropTypes.number,src:PropTypes.string,className:PropTypes.string}},PaymentSourceBrandName:{displayName:"PaymentSourceBrandName",propTypes:{children:PropTypes.func,label:PropTypes.string}},PaymentSourceEditButton:{displayName:"PaymentSourceEditButton",propTypes:{children:PropTypes.func,label:PropTypes.oneOfType([PropTypes.string,PropTypes.element])}},PaymentSourceDetail:{displayName:"PaymentSourceDetail",propTypes:{type:PropTypes.oneOf(["last4","exp_year","exp_month"]).isRequired}},PlaceOrderButton:{displayName:"PlaceOrderButton",propTypes:{children:PropTypes.func,label:PropTypes.oneOfType([PropTypes.string,PropTypes.element])},defaultProps:{label:"Place order"}},PlaceOrderContainer:{displayName:"PlaceOrderContainer",permittedChildren:["PaymentMethod","PlaceOrderButton","PrivacyAndTermsCheckbox","ReactNode"],propTypes:{children:childrenTypes.isRequired}},Price:{displayName:"Price",propTypes:{children:PropTypes.func,compareClassName:PropTypes.string,skuCode:PropTypes.string,showCompare:PropTypes.bool},defaultProps:{skuCode:""}},PricesContainer:{permittedChildren:["Price","ReactNode"],displayName:"PricesContainer",propTypes:{children:childrenTypes.isRequired,skuCode:PropTypes.string,loader:PTLoader,perPage:PropTypes.number,filters:PropTypes.object},defaultProps:{perPage:10,filters:{},loader:"Loading...",skuCode:""}},PrivacyAndTermsCheckbox:{displayName:"PrivacyAndTermsCheckbox",propTypes:{children:PropTypes.func}},QuantitySelector:{displayName:"QuantitySelector",propTypes:{children:PropTypes.func,min:PropTypes.number,max:PropTypes.number,value:PropTypes.string,skuCode:PropTypes.string,disabled:PropTypes.bool},defaultProps:{min:1}},SaveAddressesButton:{displayName:"SaveAddressesButton",propTypes:{children:PropTypes.func,label:PropTypes.oneOfType([PropTypes.string,PropTypes.element]),onClick:PropTypes.func,disabled:PropTypes.bool},defaultProps:{label:"Continue to delivery"}},Shipment:{permittedChildren:["LineItemsContainer","LineItem","ShippingMethod","ReactNode"],displayName:"Shipment",propTypes:{children:childrenTypes.isRequired}},ShipmentField:{displayName:"ShipmentField",propTypes:{children:PropTypes.func,name:PropTypes.oneOf(["cost_amount_cents","cost_amount_float","currency_code","formatted_cost_amount","number","status","key_number"]).isRequired}},ShipmentsContainer:{displayName:"ShipmentsContainer",permittedChildren:["Shipment","ReactNode","Errors"],propTypes:{children:childrenTypes.isRequired}},ShippingAddressContainer:{permittedChildren:["Address","ReactNode"],propTypes:{children:childrenTypes.isRequired}},SaveCustomerButton:{displayName:"SaveCustomerButton",propTypes:{children:PropTypes.func,label:PropTypes.oneOfType([PropTypes.string,PropTypes.element]),onClick:PropTypes.func},defaultProps:{label:"Save"}},ShippingAddressForm:{permittedChildren:["AddressInput","ReactNode"],propTypes:{children:childrenTypes.isRequired}},ShippingAmount:{displayName:"ShippingAmount",propTypes:baseOrderComponentPricePropTypes},ShippingMethod:{permittedChildren:["ShippingMethodName","ShippingMethodPrice","ShippingMethodRadioButton","DeliveryLeadTime","ReactNode"],displayName:"ShippingMethod",propTypes:{children:childrenTypes.isRequired,readonly:PropTypes.bool}},ShippingMethodName:{displayName:"ShippingMethodName",propTypes:{children:PropTypes.func}},ShippingMethodRadioButton:{displayName:"ShippingMethodRadioButton",propTypes:{children:PropTypes.func}},ShippingMethodPrice:{displayName:"ShippingMethodPrice",propTypes:Object.assign(Object.assign({},baseOrderComponentPricePropTypes),{type:PropTypes.oneOf(["amount"])}),defaultProps:{format:"formatted",type:"amount"}},SkuList:{permittedChildren:["AddToCartButton","QuantitySelector","ReactNode"],displayName:"SkuList",propTypes:{children:childrenTypes.isRequired,id:PropTypes.string.isRequired}},SkuListsContainer:{permittedChildren:["SkuList","ReactNode"],displayName:"SkuListsContainer",propTypes:{children:childrenTypes.isRequired}},SkuOption:{permittedChildren:["SkuOptionInput","ReactNode"],displayName:"SkuOption",propTypes:{children:childrenTypes.isRequired,id:PropTypes.string.isRequired}},SkuOptionInput:{displayName:"SkuOptionInput",propTypes:BaseInputComponentPropTypes},SkuOptionsContainer:{permittedChildren:["SkuOption","ReactNode"],displayName:"SkuOptionsContainer",propTypes:{children:childrenTypes.isRequired,skuCode:PropTypes.string}},StockTransfer:{permittedChildren:["StockTransferField","ReactNode"],displayName:"StockTransfer",propTypes:{children:childrenTypes.isRequired}},StockTransferField:{displayName:"StockTransferField",propTypes:{children:PropTypes.func,type:PropTypes.oneOf(["quantity","sku_code"]).isRequired}},SubmitButton:{displayName:"SubmitButton",propTypes:{children:PropTypes.func,label:PropTypes.oneOfType([PropTypes.string,PropTypes.element])},defaultProps:{label:"Submit"}},SubTotalAmount:{displayName:"SubTotalAmount",propTypes:baseOrderComponentPricePropTypes,defaultProps:{format:"formatted"}},TaxesAmount:{displayName:"TaxesAmount",propTypes:baseOrderComponentPricePropTypes,defaultProps:{format:"formatted"}},TotalAmount:{displayName:"TotalAmount",propTypes:baseOrderComponentPricePropTypes,defaultProps:{format:"formatted"}},VariantsContainer:{permittedChildren:["VariantSelector","ReactNode"],displayName:"VariantsContainer",propTypes:{children:childrenTypes.isRequired,skuCode:PropTypes.string,filters:PropTypes.object},defaultProps:{skuCode:"",filters:{}}},VariantSelector:{displayName:"VariantSelector",propTypes:{options:PropTypes.arrayOf(PropTypes.shape({label:PropTypes.string.isRequired,code:PropTypes.string.isRequired,lineItem:PropTypes.shape({name:PropTypes.string.isRequired,imageUrl:PropTypes.string})}).isRequired).isRequired,name:PropTypes.string,children:PropTypes.func,type:PropTypes.oneOf(["select","radio"]),loader:PropTypes.element,placeholder:PropTypes.string,skuCode:PropTypes.string},defaultProps:{placeholder:"Select a variant",type:"select"}}};export default components;
|
|
1
|
+
import PropTypes from"prop-types";import childrenTypes from"../utils/childrenTypes";import{baseOrderComponentPricePropTypes,PTLoader,BMObject}from"../typings/index";import{ErrorPropTypes}from"../typings/errors";import{BaseInputComponentPropTypes}from"../typings/index";const components={Address:{permittedChildren:["AddressField","ReactNode"],displayName:"Address",propTypes:{children:childrenTypes.isRequired}},AddressCountrySelector:{displayName:"AddressCountrySelector",propTypes:{children:PropTypes.func,placeholder:PropTypes.shape({label:PropTypes.string.isRequired,value:PropTypes.oneOfType([PropTypes.string,PropTypes.number]).isRequired}),value:PropTypes.string,name:PropTypes.oneOf(["billing_address_country_code","shipping_address_country_code"]).isRequired,required:PropTypes.bool},defaultProps:{required:!0}},AddressStateSelector:{displayName:"AddressStateSelector",propTypes:{children:PropTypes.func,placeholder:PropTypes.shape({label:PropTypes.string.isRequired,value:PropTypes.oneOfType([PropTypes.string,PropTypes.number]).isRequired}),value:PropTypes.string,name:PropTypes.oneOf(["billing_address_state_code","shipping_address_state_code"]).isRequired,required:PropTypes.bool},defaultProps:{required:!0}},AddressField:{displayName:"AddressField",propTypes:{children:PropTypes.func}},AddressInput:{displayName:"AddressInput",propTypes:{children:PropTypes.func,name:PropTypes.oneOf(["billing_address_city","billing_address_company","billing_address_email","billing_address_first_name","billing_address_last_name","billing_address_line_1","billing_address_line_2","billing_address_phone","billing_address_state_code","billing_address_zip_code","billing_address_billing_info","billing_address_save_to_customer_book","shipping_address_city","shipping_address_company","shipping_address_email","shipping_address_first_name","shipping_address_last_name","shipping_address_line_1","shipping_address_line_2","shipping_address_phone","shipping_address_state_code","shipping_address_zip_code","shipping_address_save_to_customer_book"]).isRequired,type:PropTypes.oneOf(["checkbox","date","email","number","tel","text","textarea"]).isRequired,placeholder:PropTypes.string,disabled:PropTypes.bool,required:PropTypes.bool},defaultProps:{required:!0}},AdjustmentAmount:{displayName:"AdjustmentAmount",propTypes:baseOrderComponentPricePropTypes,defaultProps:{format:"formatted"}},AddToCartButton:{displayName:"AddToCartButton",propTypes:{children:PropTypes.func,label:PropTypes.oneOfType([PropTypes.string,PropTypes.element]),skuCode:PropTypes.string,disabled:PropTypes.bool,lineItem:PropTypes.shape({name:PropTypes.string.isRequired,imageUrl:PropTypes.string})},defaultProps:{label:"Add to cart"}},AddressesContainer:{displayName:"AddressesContainer",permittedChildren:["BillingAddressForm","BillingAddressContainer","ShippingAddressForm","ShippingAddressContainer","SaveAddressesButton","ReactNode"],propTypes:{children:childrenTypes.isRequired,shipToDifferentAddress:PropTypes.bool}},AvailabilityContainer:{displayName:"AvailabilityContainer",permittedChildren:["AvailabilityTemplate","ReactNode"],propTypes:{children:childrenTypes.isRequired,skuCode:PropTypes.string}},AvailabilityTemplate:{displayName:"AvailabilityTemplate",propTypes:{timeFormat:PropTypes.oneOf(["days","hours"]),showShippingMethodName:PropTypes.bool,children:PropTypes.func},defaultProps:{timeFormat:"days",showShippingMethodName:!1}},BillingAddressContainer:{permittedChildren:["Address","ReactNode"],propTypes:{children:childrenTypes.isRequired}},BillingAddressForm:{permittedChildren:["AddressInput","ReactNode","Errors"],propTypes:{children:childrenTypes.isRequired}},CheckoutLink:{displayName:"CheckoutLink",propTypes:{children:PropTypes.func,label:PropTypes.string},defaultProps:{label:"Checkout"}},CommerceLayer:{permittedChildren:["OrderContainer","OrderStorage","PricesContainer","GiftCardContainer","ReactNode"],propTypes:{children:childrenTypes.isRequired,accessToken:PropTypes.string.isRequired,endpoint:PropTypes.string.isRequired}},CustomerContainer:{displayName:"CustomerContainer",permittedChildren:["CustomerInput","SaveCustomerButton","AddressesContainer","PaymentMethodsContainer","ShipmentsContainer","ReactNode"],propTypes:{children:childrenTypes.isRequired,isGuest:PropTypes.bool}},CustomerInput:{displayName:"CustomerInput",propTypes:{children:PropTypes.func,name:PropTypes.oneOf(["customerEmail"]),type:PropTypes.oneOf(["email"]),placeholder:PropTypes.string,disabled:PropTypes.bool,required:PropTypes.bool,saveOnBlur:PropTypes.bool},defaultProps:{required:!0}},DeliveryLeadTime:{displayName:"DeliveryLeadTime",propTypes:{type:PropTypes.oneOf(["max_days","max_hours","min_days","min_hours"]).isRequired,children:PropTypes.func}},DiscountAmount:{displayName:"DiscountAmount",propTypes:baseOrderComponentPricePropTypes,defaultProps:{format:"formatted"}},Errors:{displayName:"Errors",propTypes:ErrorPropTypes,defaultProps:{messages:[],field:"base"}},ExternalFunction:{displayName:"ExternalFunction",permittedChildren:["AddToCartButton","ReactNode"],propTypes:{children:childrenTypes.isRequired,url:PropTypes.string.isRequired}},GiftCard:{permittedChildren:["GiftCardCurrencySelector","GiftCardInput","Errors","MetadataInput","SubmitButton","ReactNode"],displayName:"GiftCard",propTypes:{children:childrenTypes.isRequired,onSubmit:PropTypes.func},defaultProps:{onSubmit:void 0}},GiftCardAmount:{displayName:"GiftCardAmount",propTypes:baseOrderComponentPricePropTypes},GiftCardContainer:{permittedChildren:["GiftCard","Errors","ReactNode"],displayName:"GiftCardContainer",propTypes:{children:childrenTypes.isRequired}},GiftCardCurrencySelector:{displayName:"GiftCardCurrencySelector",propTypes:{children:PropTypes.func,placeholder:PropTypes.shape({value:PropTypes.oneOfType([PropTypes.string,PropTypes.number]).isRequired,label:PropTypes.string.isRequired}),value:PropTypes.string,required:PropTypes.bool},defaultProps:{required:!0}},GiftCardInput:{displayName:"GiftCardInput",propTypes:{type:PropTypes.oneOf(["text","email","number","date","checkbox"]).isRequired,name:PropTypes.oneOf(["balanceCents","balanceMaxCents","singleUse","rechargeable","imageUrl","expiresAt","referenceOrigin","email","firstName","lastName","reference"]).isRequired,children:PropTypes.func,placeholder:PropTypes.string}},GiftCardOrCouponForm:{permittedChildren:["GiftCardOrCouponInput","GiftCardOrCouponSubmit","ReactNode"],propTypes:{children:childrenTypes.isRequired}},GiftCardOrCouponInput:{displayName:"GiftCardOrCouponInput",propTypes:{children:PropTypes.func,placeholder:PropTypes.string,disabled:PropTypes.bool,required:PropTypes.bool}},GiftCardOrCouponSubmit:{displayName:"GiftCardOrCouponSubmit",propTypes:{children:PropTypes.func,label:PropTypes.oneOfType([PropTypes.string,PropTypes.object])}},GiftCardOrCouponCode:{displayName:"GiftCardOrCouponCode",propTypes:{children:PropTypes.func,type:PropTypes.oneOf(["coupon","gift_card"])}},GiftCardOrCouponRemoveButton:{displayName:"GiftCardOrCouponRemoveButton",propTypes:{children:PropTypes.func,type:PropTypes.oneOf(["coupon","gift_card"]),label:PropTypes.oneOfType([PropTypes.string,PropTypes.object])}},ItemContainer:{permittedChildren:["PricesContainer","VariantsContainer","SkuOptionContainer","QuantitySelector","AddToCartButton","AvailabilityContainer","SkuListsContainer","ReactNode"],displayName:"ItemContainer",propTypes:{children:childrenTypes.isRequired,skuCode:PropTypes.string,lineItem:PropTypes.shape({name:PropTypes.string.isRequired,imageUrl:PropTypes.string})}},LineItem:{permittedChildren:["AvailabilityContainer","LineItemImage","LineItemName","LineItemOptions","LineItemQuantity","LineItemAmount","LineItemRemoveLink","StockTransfer","Errors","ReactNode"],displayName:"LineItem",propTypes:{children:childrenTypes.isRequired,type:PropTypes.oneOf(["skus","gift_cards","shipments","payment_methods","promotions","adjustments","bundles"])},defaultProps:{type:"skus"}},LineItemAmount:{displayName:"LineItemAmount",propTypes:Object.assign(Object.assign({},baseOrderComponentPricePropTypes),{type:PropTypes.oneOf(["total","unit","option"])}),defaultProps:{format:"formatted",type:"total"}},LineItemImage:{displayName:"LineItemImage",propTypes:{width:PropTypes.number,children:PropTypes.func}},LineItemName:{displayName:"LineItemName",propTypes:{children:PropTypes.func}},LineItemCode:{displayName:"LineItemCode",propTypes:{children:PropTypes.func}},LineItemOption:{displayName:"LineItemOption",propTypes:{name:PropTypes.string,children:PropTypes.func,valueClassName:PropTypes.string,className:PropTypes.string,id:PropTypes.string,style:PropTypes.object}},LineItemOptions:{permittedChildren:["LineItemOption","ReactNode"],displayName:"LineItemOptions",propTypes:{children:childrenTypes.isRequired,title:PropTypes.string,showName:PropTypes.bool,skuOptionId:PropTypes.string}},LineItemQuantity:{displayName:"LineItemQuantity",propTypes:{children:PropTypes.func,max:PropTypes.number,disabled:PropTypes.bool,readonly:PropTypes.bool},defaultProps:{max:50}},LineItemRemoveLink:{displayName:"LineItemRemoveLink",propTypes:{children:PropTypes.func,label:PropTypes.string},defaultProps:{label:"Remove"}},LineItemsContainer:{permittedChildren:["LineItemsCount","LineItemsEmpty","LineItem","ReactNode"],displayName:"LineItemsContainer",propTypes:{children:childrenTypes.isRequired,filters:PropTypes.object,loader:PTLoader},defaultProps:{filters:{},loader:"Loading..."}},LineItemsCount:{displayName:"LineItemsCount",propTypes:{children:PropTypes.func,id:PropTypes.string,className:PropTypes.string,name:PropTypes.string,style:PropTypes.object}},LineItemsEmpty:{displayName:"LineItemsEmpty",propTypes:{children:PropTypes.func,id:PropTypes.string,className:PropTypes.string,name:PropTypes.string,style:PropTypes.object,text:PropTypes.string}},MetadataInput:{displayName:"MetadataInput",propTypes:BaseInputComponentPropTypes},OrderContainer:{permittedChildren:["AddressesContainer","CustomerContainer","ItemContainer","LineItemsContainer","SubTotalAmount","DiscountAmount","AdjustmentAmount","ShippingAmount","TaxesAmount","GiftCardAmount","TotalAmount","CheckoutLink","GiftCardContainer","ShipmentsContainer","PaymentMethodsContainer","PaymentMethodAmount","GiftCardOrCouponForm","GiftCardOrCouponCode","GiftCardOrCouponRemoveButton","Errors","OrderNumber","ReactNode"],displayName:"OrderContainer",propTypes:{children:childrenTypes.isRequired,orderId:PropTypes.string,metadata:BMObject,attributes:PropTypes.object},defaultProps:{metadata:{}}},OrderNumber:{displayName:"OrderNumber",propTypes:{className:PropTypes.string},defaultProps:{format:"formatted"}},OrderStorage:{permittedChildren:["OrderContainer","ReactNode"],displayName:"OrderStorage",propTypes:{children:childrenTypes.isRequired,clearWhenPlaced:PropTypes.bool,persistKey:PropTypes.string.isRequired}},PaymentMethod:{permittedChildren:["PaymentMethodName","PaymentMethodRadioButton","PaymentMethodPrice","PaymentSource","ReactNode","Errors"],displayName:"PaymentMethod",propTypes:{children:childrenTypes.isRequired}},PaymentMethodAmount:{displayName:"PaymentMethodAmount",propTypes:baseOrderComponentPricePropTypes,defaultProps:{format:"formatted"}},PaymentMethodName:{displayName:"PaymentMethodName",propTypes:{children:PropTypes.func}},PaymentMethodPrice:{displayName:"PaymentMethodPrice",propTypes:Object.assign(Object.assign({},baseOrderComponentPricePropTypes),{type:PropTypes.oneOf(["amount"])})},PaymentMethodRadioButton:{displayName:"PaymentMethodRadioButton",propTypes:{children:PropTypes.func}},PaymentMethodsContainer:{displayName:"PaymentMethodsContainer",permittedChildren:["PaymentSource","ReactNode","PlaceOrderContainer"],propTypes:{children:childrenTypes.isRequired}},PaymentSource:{displayName:"PaymentSource",permittedChildren:["PaymentSourceBrandIcon","PaymentSourceBrandName","PaymentSourceEditButton","PaymentSourceDetail","ReactNode"],propTypes:{children:childrenTypes,readonly:PropTypes.bool}},PaymentSourceBrandIcon:{displayName:"PaymentSourceBrandIcon",propTypes:{children:PropTypes.func,width:PropTypes.number,height:PropTypes.number,src:PropTypes.string,className:PropTypes.string}},PaymentSourceBrandName:{displayName:"PaymentSourceBrandName",propTypes:{children:PropTypes.func,label:PropTypes.string}},PaymentSourceEditButton:{displayName:"PaymentSourceEditButton",propTypes:{children:PropTypes.func,label:PropTypes.oneOfType([PropTypes.string,PropTypes.element])}},PaymentSourceDetail:{displayName:"PaymentSourceDetail",propTypes:{type:PropTypes.oneOf(["last4","exp_year","exp_month"]).isRequired}},PlaceOrderButton:{displayName:"PlaceOrderButton",propTypes:{children:PropTypes.func,label:PropTypes.oneOfType([PropTypes.string,PropTypes.element])},defaultProps:{label:"Place order"}},PlaceOrderContainer:{displayName:"PlaceOrderContainer",permittedChildren:["PaymentMethod","PlaceOrderButton","PrivacyAndTermsCheckbox","ReactNode"],propTypes:{children:childrenTypes.isRequired}},Price:{displayName:"Price",propTypes:{children:PropTypes.func,compareClassName:PropTypes.string,skuCode:PropTypes.string,showCompare:PropTypes.bool},defaultProps:{skuCode:""}},PricesContainer:{permittedChildren:["Price","ReactNode"],displayName:"PricesContainer",propTypes:{children:childrenTypes.isRequired,skuCode:PropTypes.string,loader:PTLoader,perPage:PropTypes.number,filters:PropTypes.object},defaultProps:{perPage:10,filters:{},loader:"Loading...",skuCode:""}},PrivacyAndTermsCheckbox:{displayName:"PrivacyAndTermsCheckbox",propTypes:{children:PropTypes.func}},QuantitySelector:{displayName:"QuantitySelector",propTypes:{children:PropTypes.func,min:PropTypes.number,max:PropTypes.number,value:PropTypes.string,skuCode:PropTypes.string,disabled:PropTypes.bool},defaultProps:{min:1}},SaveAddressesButton:{displayName:"SaveAddressesButton",propTypes:{children:PropTypes.func,label:PropTypes.oneOfType([PropTypes.string,PropTypes.element]),onClick:PropTypes.func,disabled:PropTypes.bool},defaultProps:{label:"Continue to delivery"}},Shipment:{permittedChildren:["LineItemsContainer","LineItem","ShippingMethod","ReactNode"],displayName:"Shipment",propTypes:{children:childrenTypes.isRequired}},ShipmentField:{displayName:"ShipmentField",propTypes:{children:PropTypes.func,name:PropTypes.oneOf(["cost_amount_cents","cost_amount_float","currency_code","formatted_cost_amount","number","status","key_number"]).isRequired}},ShipmentsContainer:{displayName:"ShipmentsContainer",permittedChildren:["Shipment","ReactNode","Errors"],propTypes:{children:childrenTypes.isRequired}},ShippingAddressContainer:{permittedChildren:["Address","ReactNode"],propTypes:{children:childrenTypes.isRequired}},SaveCustomerButton:{displayName:"SaveCustomerButton",propTypes:{children:PropTypes.func,label:PropTypes.oneOfType([PropTypes.string,PropTypes.element]),onClick:PropTypes.func},defaultProps:{label:"Save"}},ShippingAddressForm:{permittedChildren:["AddressInput","ReactNode"],propTypes:{children:childrenTypes.isRequired}},ShippingAmount:{displayName:"ShippingAmount",propTypes:baseOrderComponentPricePropTypes},ShippingMethod:{permittedChildren:["ShippingMethodName","ShippingMethodPrice","ShippingMethodRadioButton","DeliveryLeadTime","ReactNode"],displayName:"ShippingMethod",propTypes:{children:childrenTypes.isRequired,readonly:PropTypes.bool}},ShippingMethodName:{displayName:"ShippingMethodName",propTypes:{children:PropTypes.func}},ShippingMethodRadioButton:{displayName:"ShippingMethodRadioButton",propTypes:{children:PropTypes.func}},ShippingMethodPrice:{displayName:"ShippingMethodPrice",propTypes:Object.assign(Object.assign({},baseOrderComponentPricePropTypes),{type:PropTypes.oneOf(["amount"])}),defaultProps:{format:"formatted",type:"amount"}},SkuContainer:{displayName:"SkuContainer",permittedChildren:["Skus","ReactNode"],propTypes:{children:childrenTypes.isRequired}},Skus:{displayName:"Skus",permittedChildren:["SkuField","ReactNode"],propTypes:{children:childrenTypes.isRequired}},SkuField:{displayName:"SkuField",propTypes:{children:PropTypes.func,attribute:PropTypes.string,tagElement:PropTypes.string}},SkuList:{permittedChildren:["AddToCartButton","QuantitySelector","ReactNode"],displayName:"SkuList",propTypes:{children:childrenTypes.isRequired,id:PropTypes.string.isRequired}},SkuListsContainer:{permittedChildren:["SkuList","ReactNode"],displayName:"SkuListsContainer",propTypes:{children:childrenTypes.isRequired}},SkuOption:{permittedChildren:["SkuOptionInput","ReactNode"],displayName:"SkuOption",propTypes:{children:childrenTypes.isRequired,id:PropTypes.string.isRequired}},SkuOptionInput:{displayName:"SkuOptionInput",propTypes:BaseInputComponentPropTypes},SkuOptionsContainer:{permittedChildren:["SkuOption","ReactNode"],displayName:"SkuOptionsContainer",propTypes:{children:childrenTypes.isRequired,skuCode:PropTypes.string}},StockTransfer:{permittedChildren:["StockTransferField","ReactNode"],displayName:"StockTransfer",propTypes:{children:childrenTypes.isRequired}},StockTransferField:{displayName:"StockTransferField",propTypes:{children:PropTypes.func,type:PropTypes.oneOf(["quantity","sku_code"]).isRequired}},SubmitButton:{displayName:"SubmitButton",propTypes:{children:PropTypes.func,label:PropTypes.oneOfType([PropTypes.string,PropTypes.element])},defaultProps:{label:"Submit"}},SubTotalAmount:{displayName:"SubTotalAmount",propTypes:baseOrderComponentPricePropTypes,defaultProps:{format:"formatted"}},TaxesAmount:{displayName:"TaxesAmount",propTypes:baseOrderComponentPricePropTypes,defaultProps:{format:"formatted"}},TotalAmount:{displayName:"TotalAmount",propTypes:baseOrderComponentPricePropTypes,defaultProps:{format:"formatted"}},VariantsContainer:{permittedChildren:["VariantSelector","ReactNode"],displayName:"VariantsContainer",propTypes:{children:childrenTypes.isRequired,skuCode:PropTypes.string,filters:PropTypes.object},defaultProps:{skuCode:"",filters:{}}},VariantSelector:{displayName:"VariantSelector",propTypes:{options:PropTypes.arrayOf(PropTypes.shape({label:PropTypes.string.isRequired,code:PropTypes.string.isRequired,lineItem:PropTypes.shape({name:PropTypes.string.isRequired,imageUrl:PropTypes.string})}).isRequired).isRequired,name:PropTypes.string,children:PropTypes.func,type:PropTypes.oneOf(["select","radio"]),loader:PropTypes.element,placeholder:PropTypes.string,skuCode:PropTypes.string},defaultProps:{placeholder:"Select a variant",type:"select"}}};export default components;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createContext}from"react";const initial={},SkuChildrenContext=createContext(initial);export default SkuChildrenContext;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import{SkuState}from'../reducers/SkuReducer';export declare type SkuContextValue=SkuState;declare const SkuContext:import("react").Context<Partial<{skus:import("@commercelayer/sdk/lib/cjs/resources/skus").Sku[];loading:boolean;}>>;export default SkuContext;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createContext}from"react";const SkuContext=createContext({});export default SkuContext;
|
package/lib/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{default as AddToCartButton}from'./components/AddToCartButton';export{default as Address}from'./components/Address';export{default as AddressCountrySelector}from'./components/AddressCountrySelector';export{default as AddressField}from'./components/AddressField';export{default as AddressInput}from'./components/AddressInput';export{default as AddressStateSelector}from'./components/AddressStateSelector';export{default as AddressesContainer}from'./components/AddressesContainer';export{default as AdjustmentAmount}from'./components/AdjustmentAmount';export{default as AvailabilityContainer}from'./components/AvailabilityContainer';export{default as AvailabilityTemplate}from'./components/AvailabilityTemplate';export{default as BillingAddressContainer}from'./components/BillingAddressContainer';export{default as BillingAddressForm}from'./components/BillingAddressForm';export{default as CheckoutLink}from'./components/CheckoutLink';export{default as CommerceLayer}from'./components/CommerceLayer';export{default as CustomerContainer}from'./components/CustomerContainer';export{default as CustomerInput}from'./components/CustomerInput';export{default as DeliveryLeadTime}from'./components/DeliveryLeadTime';export{default as DiscountAmount}from'./components/DiscountAmount';export{default as Errors}from'./components/Errors';export{default as ExternalFunction}from'./components/ExternalFunction';export{default as GiftCard}from'./components/GiftCard';export{default as GiftCardAmount}from'./components/GiftCardAmount';export{default as GiftCardContainer}from'./components/GiftCardContainer';export{default as GiftCardCurrencySelector}from'./components/GiftCardCurrencySelector';export{default as GiftCardInput}from'./components/GiftCardInput';export{default as GiftCardOrCouponCode}from'./components/GiftCardOrCouponCode';export{default as GiftCardOrCouponForm}from'./components/GiftCardOrCouponForm';export{default as GiftCardOrCouponInput}from'./components/GiftCardOrCouponInput';export{default as GiftCardOrCouponRemoveButton}from'./components/GiftCardOrCouponRemoveButton';export{default as GiftCardOrCouponSubmit}from'./components/GiftCardOrCouponSubmit';export{default as ItemContainer}from'./components/ItemContainer';export{default as LineItem}from'./components/LineItem';export{default as LineItemAmount}from'./components/LineItemAmount';export{default as LineItemCode}from'./components/LineItemCode';export{default as LineItemImage}from'./components/LineItemImage';export{default as LineItemName}from'./components/LineItemName';export{default as LineItemOption}from'./components/LineItemOption';export{default as LineItemOptions}from'./components/LineItemOptions';export{default as LineItemQuantity}from'./components/LineItemQuantity';export{default as LineItemRemoveLink}from'./components/LineItemRemoveLink';export{default as LineItemsContainer}from'./components/LineItemsContainer';export{default as LineItemsCount}from'./components/LineItemsCount';export{default as LineItemsEmpty}from'./components/LineItemsEmpty';export{default as MetadataInput}from'./components/MetadataInput';export{default as OrderContainer}from'./components/OrderContainer';export{default as OrderNumber}from'./components/OrderNumber';export{default as OrderStorage}from'./components/OrderStorage';export{default as PaymentMethod}from'./components/PaymentMethod';export{default as PaymentMethodAmount}from'./components/PaymentMethodAmount';export{default as PaymentMethodName}from'./components/PaymentMethodName';export{default as PaymentMethodPrice}from'./components/PaymentMethodPrice';export{default as PaymentMethodRadioButton}from'./components/PaymentMethodRadioButton';export{default as PaymentMethodsContainer}from'./components/PaymentMethodsContainer';export{default as PaymentSource}from'./components/PaymentSource';export{default as PaymentSourceBrandIcon}from'./components/PaymentSourceBrandIcon';export{default as PaymentSourceBrandName}from'./components/PaymentSourceBrandName';export{default as PaymentSourceDetail}from'./components/PaymentSourceDetail';export{default as PaymentSourceEditButton}from'./components/PaymentSourceEditButton';export{default as PlaceOrderButton}from'./components/PlaceOrderButton';export{default as PlaceOrderContainer}from'./components/PlaceOrderContainer';export{default as Price}from'./components/Price';export{default as PricesContainer}from'./components/PricesContainer';export{default as PrivacyAndTermsCheckbox}from'./components/PrivacyAndTermsCheckbox';export{default as QuantitySelector}from'./components/QuantitySelector';export{default as SaveAddressesButton}from'./components/SaveAddressesButton';export{default as SaveCustomerButton}from'./components/SaveCustomerButton';export{default as Shipment}from'./components/Shipment';export{default as ShipmentField}from'./components/ShipmentField';export{default as ShipmentsContainer}from'./components/ShipmentsContainer';export{default as ShippingAddressContainer}from'./components/ShippingAddressContainer';export{default as ShippingAddressForm}from'./components/ShippingAddressForm';export{default as ShippingAmount}from'./components/ShippingAmount';export{default as ShippingMethod}from'./components/ShippingMethod';export{default as ShippingMethodName}from'./components/ShippingMethodName';export{default as ShippingMethodPrice}from'./components/ShippingMethodPrice';export{default as ShippingMethodRadioButton}from'./components/ShippingMethodRadioButton';export{default as SkuList}from'./components/SkuList';export{default as SkuListsContainer}from'./components/SkuListsContainer';export{default as SkuOption}from'./components/SkuOption';export{default as SkuOptionInput}from'./components/SkuOptionInput';export{default as SkuOptionsContainer}from'./components/SkuOptionsContainer';export{default as StockTransfer}from'./components/StockTransfer';export{default as StockTransferField}from'./components/StockTransferField';export{default as SubTotalAmount}from'./components/SubTotalAmount';export{default as SubmitButton}from'./components/SubmitButton';export{default as TaxesAmount}from'./components/TaxesAmount';export{default as TotalAmount}from'./components/TotalAmount';export{default as VariantSelector}from'./components/VariantSelector';export{default as VariantsContainer}from'./components/VariantsContainer';export type{CustomerCardsType}from'./components/utils/PaymentCardsTemplate';export type{AddressCardsType}from'./components/utils/AddressCardsTemplate';export type{AddToCartButtonType}from'./components/AddToCartButton';export type{ShippingMethodRadioButtonType,ShippingMethodRadioButtonOnChangeType,}from'./components/ShippingMethodRadioButton';export type{LineItemCodeType}from'./components/LineItemCode';export type{LineItemNameType}from'./components/LineItemName';export type{LineItemImageType}from'./components/LineItemImage';export type{LineItemType}from'./typings/index';export type{ErrorComponentProps,ResourceErrorType}from'./typings/errors';export type{AddressCountrySelectName,AddressInputName,AddressStateSelectName,BaseInputType,}from'./typings/index';
|
|
1
|
+
export{default as AddToCartButton}from'./components/AddToCartButton';export{default as Address}from'./components/Address';export{default as AddressCountrySelector}from'./components/AddressCountrySelector';export{default as AddressField}from'./components/AddressField';export{default as AddressInput}from'./components/AddressInput';export{default as AddressStateSelector}from'./components/AddressStateSelector';export{default as AddressesContainer}from'./components/AddressesContainer';export{default as AdjustmentAmount}from'./components/AdjustmentAmount';export{default as AvailabilityContainer}from'./components/AvailabilityContainer';export{default as AvailabilityTemplate}from'./components/AvailabilityTemplate';export{default as BillingAddressContainer}from'./components/BillingAddressContainer';export{default as BillingAddressForm}from'./components/BillingAddressForm';export{default as CheckoutLink}from'./components/CheckoutLink';export{default as CommerceLayer}from'./components/CommerceLayer';export{default as CustomerContainer}from'./components/CustomerContainer';export{default as CustomerInput}from'./components/CustomerInput';export{default as DeliveryLeadTime}from'./components/DeliveryLeadTime';export{default as DiscountAmount}from'./components/DiscountAmount';export{default as Errors}from'./components/Errors';export{default as ExternalFunction}from'./components/ExternalFunction';export{default as GiftCard}from'./components/GiftCard';export{default as GiftCardAmount}from'./components/GiftCardAmount';export{default as GiftCardContainer}from'./components/GiftCardContainer';export{default as GiftCardCurrencySelector}from'./components/GiftCardCurrencySelector';export{default as GiftCardInput}from'./components/GiftCardInput';export{default as GiftCardOrCouponCode}from'./components/GiftCardOrCouponCode';export{default as GiftCardOrCouponForm}from'./components/GiftCardOrCouponForm';export{default as GiftCardOrCouponInput}from'./components/GiftCardOrCouponInput';export{default as GiftCardOrCouponRemoveButton}from'./components/GiftCardOrCouponRemoveButton';export{default as GiftCardOrCouponSubmit}from'./components/GiftCardOrCouponSubmit';export{default as ItemContainer}from'./components/ItemContainer';export{default as LineItem}from'./components/LineItem';export{default as LineItemAmount}from'./components/LineItemAmount';export{default as LineItemCode}from'./components/LineItemCode';export{default as LineItemImage}from'./components/LineItemImage';export{default as LineItemName}from'./components/LineItemName';export{default as LineItemOption}from'./components/LineItemOption';export{default as LineItemOptions}from'./components/LineItemOptions';export{default as LineItemQuantity}from'./components/LineItemQuantity';export{default as LineItemRemoveLink}from'./components/LineItemRemoveLink';export{default as LineItemsContainer}from'./components/LineItemsContainer';export{default as LineItemsCount}from'./components/LineItemsCount';export{default as LineItemsEmpty}from'./components/LineItemsEmpty';export{default as MetadataInput}from'./components/MetadataInput';export{default as OrderContainer}from'./components/OrderContainer';export{default as OrderNumber}from'./components/OrderNumber';export{default as OrderStorage}from'./components/OrderStorage';export{default as PaymentMethod}from'./components/PaymentMethod';export{default as PaymentMethodAmount}from'./components/PaymentMethodAmount';export{default as PaymentMethodName}from'./components/PaymentMethodName';export{default as PaymentMethodPrice}from'./components/PaymentMethodPrice';export{default as PaymentMethodRadioButton}from'./components/PaymentMethodRadioButton';export{default as PaymentMethodsContainer}from'./components/PaymentMethodsContainer';export{default as PaymentSource}from'./components/PaymentSource';export{default as PaymentSourceBrandIcon}from'./components/PaymentSourceBrandIcon';export{default as PaymentSourceBrandName}from'./components/PaymentSourceBrandName';export{default as PaymentSourceDetail}from'./components/PaymentSourceDetail';export{default as PaymentSourceEditButton}from'./components/PaymentSourceEditButton';export{default as PlaceOrderButton}from'./components/PlaceOrderButton';export{default as PlaceOrderContainer}from'./components/PlaceOrderContainer';export{default as Price}from'./components/Price';export{default as PricesContainer}from'./components/PricesContainer';export{default as PrivacyAndTermsCheckbox}from'./components/PrivacyAndTermsCheckbox';export{default as QuantitySelector}from'./components/QuantitySelector';export{default as SaveAddressesButton}from'./components/SaveAddressesButton';export{default as SaveCustomerButton}from'./components/SaveCustomerButton';export{default as Shipment}from'./components/Shipment';export{default as ShipmentField}from'./components/ShipmentField';export{default as ShipmentsContainer}from'./components/ShipmentsContainer';export{default as ShippingAddressContainer}from'./components/ShippingAddressContainer';export{default as ShippingAddressForm}from'./components/ShippingAddressForm';export{default as ShippingAmount}from'./components/ShippingAmount';export{default as ShippingMethod}from'./components/ShippingMethod';export{default as ShippingMethodName}from'./components/ShippingMethodName';export{default as ShippingMethodPrice}from'./components/ShippingMethodPrice';export{default as ShippingMethodRadioButton}from'./components/ShippingMethodRadioButton';export{default as Skus}from'./components/Skus';export{default as SkuContainer}from'./components/SkuContainer';export{default as SkuField}from'./components/SkuField';export{default as SkuList}from'./components/SkuList';export{default as SkuListsContainer}from'./components/SkuListsContainer';export{default as SkuOption}from'./components/SkuOption';export{default as SkuOptionInput}from'./components/SkuOptionInput';export{default as SkuOptionsContainer}from'./components/SkuOptionsContainer';export{default as StockTransfer}from'./components/StockTransfer';export{default as StockTransferField}from'./components/StockTransferField';export{default as SubTotalAmount}from'./components/SubTotalAmount';export{default as SubmitButton}from'./components/SubmitButton';export{default as TaxesAmount}from'./components/TaxesAmount';export{default as TotalAmount}from'./components/TotalAmount';export{default as VariantSelector}from'./components/VariantSelector';export{default as VariantsContainer}from'./components/VariantsContainer';export type{CustomerCardsType}from'./components/utils/PaymentCardsTemplate';export type{AddressCardsType}from'./components/utils/AddressCardsTemplate';export type{AddToCartButtonType}from'./components/AddToCartButton';export type{ShippingMethodRadioButtonType,ShippingMethodRadioButtonOnChangeType,}from'./components/ShippingMethodRadioButton';export type{LineItemCodeType}from'./components/LineItemCode';export type{LineItemNameType}from'./components/LineItemName';export type{LineItemImageType}from'./components/LineItemImage';export type{LineItemType}from'./typings/index';export type{ErrorComponentProps,ResourceErrorType}from'./typings/errors';export type{AddressCountrySelectName,AddressInputName,AddressStateSelectName,BaseInputType,}from'./typings/index';
|
package/lib/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{default as AddToCartButton}from"./components/AddToCartButton";export{default as Address}from"./components/Address";export{default as AddressCountrySelector}from"./components/AddressCountrySelector";export{default as AddressField}from"./components/AddressField";export{default as AddressInput}from"./components/AddressInput";export{default as AddressStateSelector}from"./components/AddressStateSelector";export{default as AddressesContainer}from"./components/AddressesContainer";export{default as AdjustmentAmount}from"./components/AdjustmentAmount";export{default as AvailabilityContainer}from"./components/AvailabilityContainer";export{default as AvailabilityTemplate}from"./components/AvailabilityTemplate";export{default as BillingAddressContainer}from"./components/BillingAddressContainer";export{default as BillingAddressForm}from"./components/BillingAddressForm";export{default as CheckoutLink}from"./components/CheckoutLink";export{default as CommerceLayer}from"./components/CommerceLayer";export{default as CustomerContainer}from"./components/CustomerContainer";export{default as CustomerInput}from"./components/CustomerInput";export{default as DeliveryLeadTime}from"./components/DeliveryLeadTime";export{default as DiscountAmount}from"./components/DiscountAmount";export{default as Errors}from"./components/Errors";export{default as ExternalFunction}from"./components/ExternalFunction";export{default as GiftCard}from"./components/GiftCard";export{default as GiftCardAmount}from"./components/GiftCardAmount";export{default as GiftCardContainer}from"./components/GiftCardContainer";export{default as GiftCardCurrencySelector}from"./components/GiftCardCurrencySelector";export{default as GiftCardInput}from"./components/GiftCardInput";export{default as GiftCardOrCouponCode}from"./components/GiftCardOrCouponCode";export{default as GiftCardOrCouponForm}from"./components/GiftCardOrCouponForm";export{default as GiftCardOrCouponInput}from"./components/GiftCardOrCouponInput";export{default as GiftCardOrCouponRemoveButton}from"./components/GiftCardOrCouponRemoveButton";export{default as GiftCardOrCouponSubmit}from"./components/GiftCardOrCouponSubmit";export{default as ItemContainer}from"./components/ItemContainer";export{default as LineItem}from"./components/LineItem";export{default as LineItemAmount}from"./components/LineItemAmount";export{default as LineItemCode}from"./components/LineItemCode";export{default as LineItemImage}from"./components/LineItemImage";export{default as LineItemName}from"./components/LineItemName";export{default as LineItemOption}from"./components/LineItemOption";export{default as LineItemOptions}from"./components/LineItemOptions";export{default as LineItemQuantity}from"./components/LineItemQuantity";export{default as LineItemRemoveLink}from"./components/LineItemRemoveLink";export{default as LineItemsContainer}from"./components/LineItemsContainer";export{default as LineItemsCount}from"./components/LineItemsCount";export{default as LineItemsEmpty}from"./components/LineItemsEmpty";export{default as MetadataInput}from"./components/MetadataInput";export{default as OrderContainer}from"./components/OrderContainer";export{default as OrderNumber}from"./components/OrderNumber";export{default as OrderStorage}from"./components/OrderStorage";export{default as PaymentMethod}from"./components/PaymentMethod";export{default as PaymentMethodAmount}from"./components/PaymentMethodAmount";export{default as PaymentMethodName}from"./components/PaymentMethodName";export{default as PaymentMethodPrice}from"./components/PaymentMethodPrice";export{default as PaymentMethodRadioButton}from"./components/PaymentMethodRadioButton";export{default as PaymentMethodsContainer}from"./components/PaymentMethodsContainer";export{default as PaymentSource}from"./components/PaymentSource";export{default as PaymentSourceBrandIcon}from"./components/PaymentSourceBrandIcon";export{default as PaymentSourceBrandName}from"./components/PaymentSourceBrandName";export{default as PaymentSourceDetail}from"./components/PaymentSourceDetail";export{default as PaymentSourceEditButton}from"./components/PaymentSourceEditButton";export{default as PlaceOrderButton}from"./components/PlaceOrderButton";export{default as PlaceOrderContainer}from"./components/PlaceOrderContainer";export{default as Price}from"./components/Price";export{default as PricesContainer}from"./components/PricesContainer";export{default as PrivacyAndTermsCheckbox}from"./components/PrivacyAndTermsCheckbox";export{default as QuantitySelector}from"./components/QuantitySelector";export{default as SaveAddressesButton}from"./components/SaveAddressesButton";export{default as SaveCustomerButton}from"./components/SaveCustomerButton";export{default as Shipment}from"./components/Shipment";export{default as ShipmentField}from"./components/ShipmentField";export{default as ShipmentsContainer}from"./components/ShipmentsContainer";export{default as ShippingAddressContainer}from"./components/ShippingAddressContainer";export{default as ShippingAddressForm}from"./components/ShippingAddressForm";export{default as ShippingAmount}from"./components/ShippingAmount";export{default as ShippingMethod}from"./components/ShippingMethod";export{default as ShippingMethodName}from"./components/ShippingMethodName";export{default as ShippingMethodPrice}from"./components/ShippingMethodPrice";export{default as ShippingMethodRadioButton}from"./components/ShippingMethodRadioButton";export{default as SkuList}from"./components/SkuList";export{default as SkuListsContainer}from"./components/SkuListsContainer";export{default as SkuOption}from"./components/SkuOption";export{default as SkuOptionInput}from"./components/SkuOptionInput";export{default as SkuOptionsContainer}from"./components/SkuOptionsContainer";export{default as StockTransfer}from"./components/StockTransfer";export{default as StockTransferField}from"./components/StockTransferField";export{default as SubTotalAmount}from"./components/SubTotalAmount";export{default as SubmitButton}from"./components/SubmitButton";export{default as TaxesAmount}from"./components/TaxesAmount";export{default as TotalAmount}from"./components/TotalAmount";export{default as VariantSelector}from"./components/VariantSelector";export{default as VariantsContainer}from"./components/VariantsContainer";
|
|
1
|
+
export{default as AddToCartButton}from"./components/AddToCartButton";export{default as Address}from"./components/Address";export{default as AddressCountrySelector}from"./components/AddressCountrySelector";export{default as AddressField}from"./components/AddressField";export{default as AddressInput}from"./components/AddressInput";export{default as AddressStateSelector}from"./components/AddressStateSelector";export{default as AddressesContainer}from"./components/AddressesContainer";export{default as AdjustmentAmount}from"./components/AdjustmentAmount";export{default as AvailabilityContainer}from"./components/AvailabilityContainer";export{default as AvailabilityTemplate}from"./components/AvailabilityTemplate";export{default as BillingAddressContainer}from"./components/BillingAddressContainer";export{default as BillingAddressForm}from"./components/BillingAddressForm";export{default as CheckoutLink}from"./components/CheckoutLink";export{default as CommerceLayer}from"./components/CommerceLayer";export{default as CustomerContainer}from"./components/CustomerContainer";export{default as CustomerInput}from"./components/CustomerInput";export{default as DeliveryLeadTime}from"./components/DeliveryLeadTime";export{default as DiscountAmount}from"./components/DiscountAmount";export{default as Errors}from"./components/Errors";export{default as ExternalFunction}from"./components/ExternalFunction";export{default as GiftCard}from"./components/GiftCard";export{default as GiftCardAmount}from"./components/GiftCardAmount";export{default as GiftCardContainer}from"./components/GiftCardContainer";export{default as GiftCardCurrencySelector}from"./components/GiftCardCurrencySelector";export{default as GiftCardInput}from"./components/GiftCardInput";export{default as GiftCardOrCouponCode}from"./components/GiftCardOrCouponCode";export{default as GiftCardOrCouponForm}from"./components/GiftCardOrCouponForm";export{default as GiftCardOrCouponInput}from"./components/GiftCardOrCouponInput";export{default as GiftCardOrCouponRemoveButton}from"./components/GiftCardOrCouponRemoveButton";export{default as GiftCardOrCouponSubmit}from"./components/GiftCardOrCouponSubmit";export{default as ItemContainer}from"./components/ItemContainer";export{default as LineItem}from"./components/LineItem";export{default as LineItemAmount}from"./components/LineItemAmount";export{default as LineItemCode}from"./components/LineItemCode";export{default as LineItemImage}from"./components/LineItemImage";export{default as LineItemName}from"./components/LineItemName";export{default as LineItemOption}from"./components/LineItemOption";export{default as LineItemOptions}from"./components/LineItemOptions";export{default as LineItemQuantity}from"./components/LineItemQuantity";export{default as LineItemRemoveLink}from"./components/LineItemRemoveLink";export{default as LineItemsContainer}from"./components/LineItemsContainer";export{default as LineItemsCount}from"./components/LineItemsCount";export{default as LineItemsEmpty}from"./components/LineItemsEmpty";export{default as MetadataInput}from"./components/MetadataInput";export{default as OrderContainer}from"./components/OrderContainer";export{default as OrderNumber}from"./components/OrderNumber";export{default as OrderStorage}from"./components/OrderStorage";export{default as PaymentMethod}from"./components/PaymentMethod";export{default as PaymentMethodAmount}from"./components/PaymentMethodAmount";export{default as PaymentMethodName}from"./components/PaymentMethodName";export{default as PaymentMethodPrice}from"./components/PaymentMethodPrice";export{default as PaymentMethodRadioButton}from"./components/PaymentMethodRadioButton";export{default as PaymentMethodsContainer}from"./components/PaymentMethodsContainer";export{default as PaymentSource}from"./components/PaymentSource";export{default as PaymentSourceBrandIcon}from"./components/PaymentSourceBrandIcon";export{default as PaymentSourceBrandName}from"./components/PaymentSourceBrandName";export{default as PaymentSourceDetail}from"./components/PaymentSourceDetail";export{default as PaymentSourceEditButton}from"./components/PaymentSourceEditButton";export{default as PlaceOrderButton}from"./components/PlaceOrderButton";export{default as PlaceOrderContainer}from"./components/PlaceOrderContainer";export{default as Price}from"./components/Price";export{default as PricesContainer}from"./components/PricesContainer";export{default as PrivacyAndTermsCheckbox}from"./components/PrivacyAndTermsCheckbox";export{default as QuantitySelector}from"./components/QuantitySelector";export{default as SaveAddressesButton}from"./components/SaveAddressesButton";export{default as SaveCustomerButton}from"./components/SaveCustomerButton";export{default as Shipment}from"./components/Shipment";export{default as ShipmentField}from"./components/ShipmentField";export{default as ShipmentsContainer}from"./components/ShipmentsContainer";export{default as ShippingAddressContainer}from"./components/ShippingAddressContainer";export{default as ShippingAddressForm}from"./components/ShippingAddressForm";export{default as ShippingAmount}from"./components/ShippingAmount";export{default as ShippingMethod}from"./components/ShippingMethod";export{default as ShippingMethodName}from"./components/ShippingMethodName";export{default as ShippingMethodPrice}from"./components/ShippingMethodPrice";export{default as ShippingMethodRadioButton}from"./components/ShippingMethodRadioButton";export{default as Skus}from"./components/Skus";export{default as SkuContainer}from"./components/SkuContainer";export{default as SkuField}from"./components/SkuField";export{default as SkuList}from"./components/SkuList";export{default as SkuListsContainer}from"./components/SkuListsContainer";export{default as SkuOption}from"./components/SkuOption";export{default as SkuOptionInput}from"./components/SkuOptionInput";export{default as SkuOptionsContainer}from"./components/SkuOptionsContainer";export{default as StockTransfer}from"./components/StockTransfer";export{default as StockTransferField}from"./components/StockTransferField";export{default as SubTotalAmount}from"./components/SubTotalAmount";export{default as SubmitButton}from"./components/SubmitButton";export{default as TaxesAmount}from"./components/TaxesAmount";export{default as TotalAmount}from"./components/TotalAmount";export{default as VariantSelector}from"./components/VariantSelector";export{default as VariantsContainer}from"./components/VariantsContainer";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{CommerceLayerConfig}from'../context/CommerceLayerContext';import{BaseAction}from'../typings/index';import{QueryParamsList,Sku}from'@commercelayer/sdk';import{Dispatch}from'react';declare type SkuActionType='getSkus'|'setLoading';declare type SkuAction=BaseAction<SkuActionType,SkuState>;export declare type SkuState=Partial<{skus:Sku[];loading:boolean;}>;export declare const skuInitialState:SkuState;declare type GetSku={config:CommerceLayerConfig;skus:string[];dispatch:Dispatch<SkuAction>;queryParams?:QueryParamsList;};export declare function getSku<T extends GetSku>({config,skus,dispatch,queryParams,}:T):Promise<void>;export default function skuReducer(state:SkuState,reducer:SkuAction):SkuState;export{};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import baseReducer from"../utils/baseReducer";import getSdk from"../utils/getSdk";const actionType=["getSkus"];export const skuInitialState={skus:[],loading:!0};export async function getSku({config,skus,dispatch,queryParams}){if(!config.accessToken||skus.length===0)return;const sdk=getSdk(config);let allSkus=[];const get=await sdk.skus.list(Object.assign(Object.assign({},queryParams),{filters:Object.assign(Object.assign({},queryParams==null?void 0:queryParams.filters),{code_in:skus.join(",")})}));allSkus=[...get];const meta=get.meta;if(meta.pageCount>1)for(let pageNumber=meta.currentPage+1;pageNumber<=meta.pageCount;pageNumber++){const getPage=await sdk.skus.list(Object.assign(Object.assign({},queryParams),{filters:Object.assign(Object.assign({},queryParams==null?void 0:queryParams.filters),{code_in:skus.join(",")}),pageNumber}));allSkus=[...allSkus,...getPage]}dispatch({type:"getSkus",payload:{skus:allSkus,loading:!1}})}export default function skuReducer(state,reducer){return baseReducer(state,reducer,actionType)}
|
package/lib/typings/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Dispatch,ReactNode,RefObject}from'react';import PropTypes,{InferProps}from'prop-types';import{BaseError}from'./errors';export declare const BC:{id:PropTypes.Requireable<string>;className:PropTypes.Requireable<string>;style:PropTypes.Requireable<object>;name:PropTypes.Requireable<string>;};export declare const PTLoader:PropTypes.Requireable<string|PropTypes.ReactElementLike>;export declare const BaseSelectComponentPropTypes:{children:PropTypes.Requireable<(...args:any[])=>any>;options:PropTypes.Validator<PropTypes.InferProps<{label:PropTypes.Validator<string>;value:PropTypes.Validator<string|number>;selected:PropTypes.Requireable<boolean>;}>[]>;placeholder:PropTypes.Requireable<PropTypes.InferProps<{label:PropTypes.Validator<string>;value:PropTypes.Validator<string|number>;}>>;value:PropTypes.Requireable<string>;name:PropTypes.Validator<string>;};export declare type SelectPlaceholder=Option;declare type BaseSelectChildrenComponentProps=Omit<BaseSelectComponentProps,'children'>;declare type Option={label:string;value:string|number;disabled?:boolean;};export interface BaseSelectComponentProps{children?:(props:BaseSelectChildrenComponentProps)=>ReactNode;options:Option[];placeholder?:Option;value?:string;className?:string;required?:boolean;name:string;onChange?:(event:React.ChangeEvent<HTMLSelectElement>)=>void;}export declare const BaseInputComponentPropTypes:{children:PropTypes.Requireable<(...args:any[])=>any>;name:PropTypes.Validator<string>;type:PropTypes.Validator<BaseInputType>;onChange:PropTypes.Requireable<(...args:any[])=>any>;placeholder:PropTypes.Requireable<string>;};declare type BaseInputChildrenComponentProps=Omit<BaseInputComponentProps,'children'>&{handleChange:(event:React.ChangeEvent<HTMLInputElement|HTMLTextAreaElement>)=>void;};export interface BaseInputComponentProps{ref?:()=>RefObject<any>;children?:(props:BaseInputChildrenComponentProps)=>ReactNode;name:string;onChange?:(event:React.ChangeEvent<HTMLInputElement|HTMLTextAreaElement>)=>void;placeholder?:string;}export declare type LineItemType='gift_cards'|'payment_methods'|'promotions'|'shipments'|'skus'|'bundles'|'adjustments';export declare type GiftCardInputName='balanceCents'|'balanceMaxCents'|'singleUse'|'rechargeable'|'imageUrl'|'expiresAt'|'referenceOrigin'|'email'|'firstName'|'lastName'|'reference';export declare type AddressInputName='billing_address_city'|'billing_address_company'|'billing_address_first_name'|'billing_address_email'|'billing_address_last_name'|'billing_address_line_1'|'billing_address_line_2'|'billing_address_phone'|'billing_address_state_code'|'billing_address_zip_code'|'billing_address_billing_info'|'billing_address_save_to_customer_book'|'shipping_address_city'|'shipping_address_company'|'shipping_address_email'|'shipping_address_first_name'|'shipping_address_last_name'|'shipping_address_line_1'|'shipping_address_line_2'|'shipping_address_phone'|'shipping_address_state_code'|'shipping_address_zip_code'|'shipping_address_save_to_customer_book';export declare type AddressCountrySelectName='billing_address_country_code'|'shipping_address_country_code';export declare type AddressStateSelectName='billing_address_state_code'|'shipping_address_state_code';export declare type BaseInputType='checkbox'|'date'|'email'|'number'|'tel'|'text'|'textarea';export declare type LoaderType=string|ReactNode;export declare const BMObject:PropTypes.Requireable<{[x:string]:string|null|undefined;}>;export declare type BaseMetadataObject={[key:string]:string|undefined|null;};export declare type TimeFormat='days'|'hours';export declare type BaseComponent=InferProps<typeof BC>;export interface BaseAction<A=string
|
|
1
|
+
import{Dispatch,ReactNode,RefObject}from'react';import PropTypes,{InferProps}from'prop-types';import{BaseError}from'./errors';export declare const BC:{id:PropTypes.Requireable<string>;className:PropTypes.Requireable<string>;style:PropTypes.Requireable<object>;name:PropTypes.Requireable<string>;};export declare const PTLoader:PropTypes.Requireable<string|PropTypes.ReactElementLike>;export declare const BaseSelectComponentPropTypes:{children:PropTypes.Requireable<(...args:any[])=>any>;options:PropTypes.Validator<PropTypes.InferProps<{label:PropTypes.Validator<string>;value:PropTypes.Validator<string|number>;selected:PropTypes.Requireable<boolean>;}>[]>;placeholder:PropTypes.Requireable<PropTypes.InferProps<{label:PropTypes.Validator<string>;value:PropTypes.Validator<string|number>;}>>;value:PropTypes.Requireable<string>;name:PropTypes.Validator<string>;};export declare type SelectPlaceholder=Option;declare type BaseSelectChildrenComponentProps=Omit<BaseSelectComponentProps,'children'>;declare type Option={label:string;value:string|number;disabled?:boolean;};export interface BaseSelectComponentProps{children?:(props:BaseSelectChildrenComponentProps)=>ReactNode;options:Option[];placeholder?:Option;value?:string;className?:string;required?:boolean;name:string;onChange?:(event:React.ChangeEvent<HTMLSelectElement>)=>void;}export declare const BaseInputComponentPropTypes:{children:PropTypes.Requireable<(...args:any[])=>any>;name:PropTypes.Validator<string>;type:PropTypes.Validator<BaseInputType>;onChange:PropTypes.Requireable<(...args:any[])=>any>;placeholder:PropTypes.Requireable<string>;};declare type BaseInputChildrenComponentProps=Omit<BaseInputComponentProps,'children'>&{handleChange:(event:React.ChangeEvent<HTMLInputElement|HTMLTextAreaElement>)=>void;};export interface BaseInputComponentProps{ref?:()=>RefObject<any>;children?:(props:BaseInputChildrenComponentProps)=>ReactNode;name:string;onChange?:(event:React.ChangeEvent<HTMLInputElement|HTMLTextAreaElement>)=>void;placeholder?:string;}export declare type LineItemType='gift_cards'|'payment_methods'|'promotions'|'shipments'|'skus'|'bundles'|'adjustments';export declare type GiftCardInputName='balanceCents'|'balanceMaxCents'|'singleUse'|'rechargeable'|'imageUrl'|'expiresAt'|'referenceOrigin'|'email'|'firstName'|'lastName'|'reference';export declare type AddressInputName='billing_address_city'|'billing_address_company'|'billing_address_first_name'|'billing_address_email'|'billing_address_last_name'|'billing_address_line_1'|'billing_address_line_2'|'billing_address_phone'|'billing_address_state_code'|'billing_address_zip_code'|'billing_address_billing_info'|'billing_address_save_to_customer_book'|'shipping_address_city'|'shipping_address_company'|'shipping_address_email'|'shipping_address_first_name'|'shipping_address_last_name'|'shipping_address_line_1'|'shipping_address_line_2'|'shipping_address_phone'|'shipping_address_state_code'|'shipping_address_zip_code'|'shipping_address_save_to_customer_book';export declare type AddressCountrySelectName='billing_address_country_code'|'shipping_address_country_code';export declare type AddressStateSelectName='billing_address_state_code'|'shipping_address_state_code';export declare type BaseInputType='checkbox'|'date'|'email'|'number'|'tel'|'text'|'textarea';export declare type LoaderType=string|ReactNode;export declare const BMObject:PropTypes.Requireable<{[x:string]:string|null|undefined;}>;export declare type BaseMetadataObject={[key:string]:string|undefined|null;};export declare type TimeFormat='days'|'hours';export declare type BaseComponent=InferProps<typeof BC>;export interface BaseAction<A=string,P=Record<string,any>>{type:A;payload:P;}export interface BaseState{[key:string]:any;errors?:BaseError[];}export declare type BaseActionType<T=string>=T[];export interface BFSetStateContainer<T>{<P extends T>(param:P):void;}export interface BaseReducer{<S extends BaseState,A extends BaseAction,T extends BaseActionType>(state:S,action:A,type:T):S;}export interface BaseUnsetState<A>{(dispatch:Dispatch<A>):void;}export interface BaseMetadata{[key:string]:string|undefined|null;}export declare type BaseFormatPrice='formatted'|'cents'|'float';export declare const baseOrderPricePropTypes:{id:PropTypes.Requireable<string>;className:PropTypes.Requireable<string>;style:PropTypes.Requireable<object>;name:PropTypes.Requireable<string>;base:PropTypes.Validator<string>;type:PropTypes.Validator<string>;children:PropTypes.Requireable<(...args:any[])=>any>;format:PropTypes.Requireable<BaseFormatPrice>;};export declare const baseOrderComponentPricePropTypes:{id:PropTypes.Requireable<string>;className:PropTypes.Requireable<string>;style:PropTypes.Requireable<object>;name:PropTypes.Requireable<string>;children:PropTypes.Requireable<(...args:any[])=>any>;format:PropTypes.Requireable<BaseFormatPrice>;};export declare type BasePriceType='total'|'option'|'unit';export declare type BaseSelectorType='select'|'radio';export declare type BaseAmountComponentChildren=Omit<BaseAmountComponent,'children'>;export declare type BaseAmountComponent={children?:(props:BaseAmountComponentChildren)=>ReactNode;format?:BaseFormatPrice;price?:string;priceCents?:number;labelFree?:string;}&JSX.IntrinsicElements['span'];export interface FunctionChildren<P=Record<string,any>>{(props:P):ReactNode;}export{};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@commercelayer/react-components",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.9.0",
|
|
4
4
|
"description": "The Official Commerce Layer React Components",
|
|
5
5
|
"module": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
@@ -84,11 +84,11 @@
|
|
|
84
84
|
"dependencies": {
|
|
85
85
|
"@ac-dev/countries-service": "^1.2.0",
|
|
86
86
|
"@ac-dev/states-service": "^1.1.0",
|
|
87
|
-
"@adyen/adyen-web": "^5.
|
|
87
|
+
"@adyen/adyen-web": "^5.12.0",
|
|
88
88
|
"@commercelayer/js-auth": "^3.0.0",
|
|
89
|
-
"@commercelayer/sdk": "^3.
|
|
89
|
+
"@commercelayer/sdk": "^3.7.0",
|
|
90
90
|
"@stripe/react-stripe-js": "^1.7.0",
|
|
91
|
-
"@stripe/stripe-js": "^1.
|
|
91
|
+
"@stripe/stripe-js": "^1.26.0",
|
|
92
92
|
"axios": "^0.26.1",
|
|
93
93
|
"braintree-web": "^3.85.2",
|
|
94
94
|
"frames-react": "^1.0.3",
|
|
@@ -102,7 +102,7 @@
|
|
|
102
102
|
"@babel/preset-env": "^7.16.11",
|
|
103
103
|
"@babel/preset-react": "^7.16.7",
|
|
104
104
|
"@babel/preset-typescript": "^7.16.7",
|
|
105
|
-
"@playwright/test": "^1.20.
|
|
105
|
+
"@playwright/test": "^1.20.1",
|
|
106
106
|
"@semantic-release/changelog": "^6.0.1",
|
|
107
107
|
"@semantic-release/commit-analyzer": "^9.0.2",
|
|
108
108
|
"@semantic-release/git": "^10.0.1",
|
|
@@ -116,32 +116,32 @@
|
|
|
116
116
|
"@types/braintree-web": "^3.75.19",
|
|
117
117
|
"@types/jest": "^27.4.1",
|
|
118
118
|
"@types/lodash": "^4.14.180",
|
|
119
|
-
"@types/node": "^17.0.
|
|
119
|
+
"@types/node": "^17.0.23",
|
|
120
120
|
"@types/prop-types": "^15.7.4",
|
|
121
|
-
"@types/react": "^17.0.
|
|
121
|
+
"@types/react": "^17.0.43",
|
|
122
122
|
"@types/react-test-renderer": "^17.0.1",
|
|
123
|
-
"@typescript-eslint/eslint-plugin": "^5.
|
|
124
|
-
"@typescript-eslint/parser": "^5.
|
|
123
|
+
"@typescript-eslint/eslint-plugin": "^5.17.0",
|
|
124
|
+
"@typescript-eslint/parser": "^5.17.0",
|
|
125
125
|
"@zeit/next-css": "^1.0.1",
|
|
126
126
|
"@zerollup/ts-transform-paths": "^1.7.18",
|
|
127
127
|
"autoprefixer": "^10.4.4",
|
|
128
128
|
"babel-jest": "^27.5.1",
|
|
129
|
-
"babel-loader": "^8.2.
|
|
129
|
+
"babel-loader": "^8.2.4",
|
|
130
130
|
"babel-plugin-istanbul": "^6.1.1",
|
|
131
131
|
"dotenv": "^16.0.0",
|
|
132
|
-
"eslint": "^8.
|
|
132
|
+
"eslint": "^8.12.0",
|
|
133
133
|
"eslint-config-prettier": "^8.5.0",
|
|
134
134
|
"eslint-config-react-app": "^7.0.0",
|
|
135
135
|
"eslint-plugin-react": "^7.29.4",
|
|
136
136
|
"eslint-plugin-react-hooks": "^4.3.0",
|
|
137
137
|
"jest": "^27.5.1",
|
|
138
138
|
"minimize-js": "^1.3.0",
|
|
139
|
-
"next": "^12.1.
|
|
139
|
+
"next": "^12.1.2",
|
|
140
140
|
"nyc": "^15.1.0",
|
|
141
|
-
"playwright": "^1.20.
|
|
141
|
+
"playwright": "^1.20.1",
|
|
142
142
|
"postcss": "^8.4.12",
|
|
143
143
|
"postcss-loader": "^6.2.1",
|
|
144
|
-
"prettier": "^2.6.
|
|
144
|
+
"prettier": "^2.6.1",
|
|
145
145
|
"prop-types": "^15.8.1",
|
|
146
146
|
"react": "^17.0.2",
|
|
147
147
|
"react-dom": "^17.0.2",
|
|
@@ -149,12 +149,12 @@
|
|
|
149
149
|
"rollup-plugin-babel": "^4.4.0",
|
|
150
150
|
"rollup-plugin-node-resolve": "^5.2.0",
|
|
151
151
|
"tailwindcss": "^3.0.23",
|
|
152
|
-
"ts-jest": "^27.1.
|
|
152
|
+
"ts-jest": "^27.1.4",
|
|
153
153
|
"ts-loader": "^9.2.8",
|
|
154
|
-
"tsc-alias": "^1.6.
|
|
154
|
+
"tsc-alias": "^1.6.5",
|
|
155
155
|
"tsconfig-paths-jest": "^0.0.1",
|
|
156
156
|
"ttypescript": "^1.5.13",
|
|
157
|
-
"typescript": "^4.6.
|
|
157
|
+
"typescript": "^4.6.3",
|
|
158
158
|
"v8-to-istanbul": "^8.1.1"
|
|
159
159
|
},
|
|
160
160
|
"peerDependencies": {
|