@commercelayer/react-components 3.13.0-beta.1 → 3.13.0-beta.4
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/AddToCartButton.d.ts +27 -1
- package/lib/components/Address.d.ts +13 -1
- package/lib/components/AddressCountrySelector.d.ts +9 -1
- package/lib/components/AddressField.d.ts +15 -1
- package/lib/components/AddressInput.d.ts +7 -1
- package/lib/components/AddressStateSelector.d.ts +11 -1
- package/lib/components/AddressesContainer.d.ts +8 -1
- package/lib/components/AdjustmentAmount.d.ts +4 -1
- package/lib/components/AdyenPayment.d.ts +25 -1
- package/lib/components/AvailabilityContainer.d.ts +7 -1
- package/lib/components/AvailabilityTemplate.d.ts +15 -1
- package/lib/components/BillingAddressContainer.d.ts +6 -1
- package/lib/components/BillingAddressForm.d.ts +8 -1
- package/lib/components/BraintreePayment.d.ts +30 -1
- package/lib/components/CheckoutComPayment.d.ts +23 -1
- package/lib/components/CheckoutLink.d.ts +13 -1
- package/lib/components/CommerceLayer.d.ts +8 -1
- package/lib/components/CustomerContainer.d.ts +7 -1
- package/lib/components/CustomerInput.d.ts +11 -1
- package/lib/components/DeliveryLeadTime.d.ts +10 -1
- package/lib/components/DiscountAmount.d.ts +4 -1
- package/lib/components/Errors.d.ts +5 -1
- package/lib/components/ExternalFunction.d.ts +7 -1
- package/lib/components/GiftCard.d.ts +8 -1
- package/lib/components/GiftCardAmount.d.ts +4 -1
- package/lib/components/GiftCardContainer.d.ts +6 -1
- package/lib/components/GiftCardCurrencySelector.d.ts +7 -1
- package/lib/components/GiftCardInput.d.ts +7 -1
- package/lib/components/GiftCardOrCouponCode.d.ts +17 -1
- package/lib/components/GiftCardOrCouponCode.js +1 -1
- package/lib/components/GiftCardOrCouponForm.d.ts +10 -1
- package/lib/components/GiftCardOrCouponInput.d.ts +10 -1
- package/lib/components/GiftCardOrCouponRemoveButton.d.ts +18 -1
- package/lib/components/GiftCardOrCouponSubmit.d.ts +9 -1
- package/lib/components/ItemContainer.d.ts +11 -1
- package/lib/components/KlarnaPayment.d.ts +9 -1
- package/lib/components/LineItem.d.ts +8 -1
- package/lib/components/LineItem.js +1 -1
- package/lib/components/LineItemAmount.d.ts +7 -1
- package/lib/components/LineItemCode.d.ts +12 -1
- package/lib/components/LineItemImage.d.ts +16 -1
- package/lib/components/LineItemImage.js +1 -1
- package/lib/components/LineItemName.d.ts +11 -1
- package/lib/components/LineItemOption.d.ts +19 -1
- package/lib/components/LineItemOptions.d.ts +16 -1
- package/lib/components/LineItemQuantity.d.ts +14 -1
- package/lib/components/LineItemRemoveLink.d.ts +12 -1
- package/lib/components/LineItemsContainer.d.ts +8 -1
- package/lib/components/LineItemsCount.d.ts +12 -1
- package/lib/components/LineItemsEmpty.d.ts +12 -1
- package/lib/components/MetadataInput.d.ts +5 -1
- package/lib/components/OrderContainer.d.ts +12 -1
- package/lib/components/OrderNumber.d.ts +5 -1
- package/lib/components/OrderStorage.d.ts +8 -1
- package/lib/components/PaymentGateway.d.ts +16 -1
- package/lib/components/PaymentMethod.d.ts +16 -1
- package/lib/components/PaymentMethodAmount.d.ts +4 -1
- package/lib/components/PaymentMethodName.d.ts +9 -1
- package/lib/components/PaymentMethodPrice.d.ts +9 -1
- package/lib/components/PaymentMethodRadioButton.d.ts +12 -1
- package/lib/components/PaymentMethodsContainer.d.ts +8 -1
- package/lib/components/PaymentSource.d.ts +19 -1
- package/lib/components/PaymentSourceBrandIcon.d.ts +15 -1
- package/lib/components/PaymentSourceBrandName.d.ts +12 -1
- package/lib/components/PaymentSourceDetail.d.ts +12 -1
- package/lib/components/PaymentSourceEditButton.d.ts +9 -1
- package/lib/components/PaypalPayment.d.ts +12 -1
- package/lib/components/PlaceOrderButton.d.ts +14 -1
- package/lib/components/PlaceOrderContainer.d.ts +8 -1
- package/lib/components/Price.d.ts +16 -1
- package/lib/components/PricesContainer.d.ts +11 -1
- package/lib/components/PrivacyAndTermsCheckbox.d.ts +4 -1
- package/lib/components/QuantitySelector.d.ts +17 -1
- package/lib/components/SaveAddressesButton.d.ts +10 -1
- package/lib/components/SaveCustomerButton.d.ts +13 -1
- package/lib/components/Shipment.d.ts +15 -1
- package/lib/components/Shipment.js +1 -1
- package/lib/components/ShipmentField.d.ts +12 -1
- package/lib/components/ShipmentsContainer.d.ts +6 -1
- package/lib/components/ShipmentsContainer.js +1 -1
- package/lib/components/ShippingAddressContainer.d.ts +6 -1
- package/lib/components/ShippingAddressForm.d.ts +8 -1
- package/lib/components/ShippingAmount.d.ts +4 -1
- package/lib/components/ShippingMethod.d.ts +8 -1
- package/lib/components/ShippingMethodName.d.ts +11 -1
- package/lib/components/ShippingMethodPrice.d.ts +13 -1
- package/lib/components/ShippingMethodRadioButton.d.ts +13 -1
- package/lib/components/ShippingMethodRadioButton.js +1 -1
- package/lib/components/SkuField.d.ts +9 -1
- package/lib/components/SkuList.d.ts +7 -1
- package/lib/components/SkuListsContainer.d.ts +6 -1
- package/lib/components/SkuOption.d.ts +7 -1
- package/lib/components/SkuOptionInput.d.ts +5 -1
- package/lib/components/SkuOptionsContainer.d.ts +7 -1
- package/lib/components/Skus.d.ts +11 -1
- package/lib/components/SkusContainer.d.ts +14 -1
- package/lib/components/StockTransfer.d.ts +6 -1
- package/lib/components/StockTransfer.js +1 -1
- package/lib/components/StockTransferField.d.ts +9 -1
- package/lib/components/StripePayment.d.ts +18 -1
- package/lib/components/SubTotalAmount.d.ts +4 -1
- package/lib/components/SubmitButton.d.ts +9 -1
- package/lib/components/TaxesAmount.d.ts +4 -1
- package/lib/components/TotalAmount.d.ts +4 -1
- package/lib/components/VariantSelector.d.ts +29 -1
- package/lib/components/VariantsContainer.d.ts +8 -1
- package/lib/components/WireTransferPayment.d.ts +10 -1
- package/lib/components/gateways/AdyenGateway.d.ts +4 -1
- package/lib/components/gateways/BraintreeGateway.d.ts +4 -1
- package/lib/components/gateways/CheckoutComGateway.d.ts +4 -1
- package/lib/components/gateways/KlarnaGateway.d.ts +4 -1
- package/lib/components/gateways/PaypalGateway.d.ts +4 -1
- package/lib/components/gateways/StripeGateway.d.ts +4 -1
- package/lib/components/gateways/WireTransferGateway.d.ts +4 -1
- package/lib/components/utils/AddressCardsTemplate.d.ts +26 -1
- package/lib/components/utils/BaseField.d.ts +8 -1
- package/lib/components/utils/BaseInput.d.ts +5 -1
- package/lib/components/utils/BaseInput.js +1 -1
- package/lib/components/utils/BaseOrderPrice.d.ts +6 -1
- package/lib/components/utils/BaseSelect.d.ts +5 -1
- package/lib/components/utils/GenericFieldComponent.d.ts +37 -1
- package/lib/components/utils/GenericFieldComponent.js +1 -1
- package/lib/components/utils/Parent.d.ts +6 -1
- package/lib/components/utils/Parent.js +1 -1
- package/lib/components/utils/PaymentCardsTemplate.d.ts +22 -1
- package/lib/components/utils/PriceTemplate.d.ts +8 -1
- package/lib/components/utils/VariantTemplate.d.ts +36 -1
- package/lib/components/utils/getAllErrors.d.ts +17 -1
- package/lib/config/components.d.ts +913 -1
- package/lib/config/currency.d.ts +5 -1
- package/lib/context/AddressChildrenContext.d.ts +6 -1
- package/lib/context/AddressContext.d.ts +16 -1
- package/lib/context/AvailabilityContext.d.ts +2 -1
- package/lib/context/BillingAddressContext.d.ts +11 -1
- package/lib/context/BillingAddressFormContext.d.ts +19 -1
- package/lib/context/CommerceLayerContext.d.ts +6 -1
- package/lib/context/CouponAndGiftCardFormContext.d.ts +9 -1
- package/lib/context/CustomerContext.d.ts +15 -1
- package/lib/context/ExternalFunctionContext.d.ts +11 -1
- package/lib/context/GiftCardContext.d.ts +10 -1
- package/lib/context/ItemContext.d.ts +12 -1
- package/lib/context/LineItemChildrenContext.d.ts +8 -1
- package/lib/context/LineItemContext.d.ts +7 -1
- package/lib/context/LineItemOptionChildrenContext.d.ts +7 -1
- package/lib/context/OrderContext.d.ts +29 -1
- package/lib/context/OrderStorageContext.d.ts +10 -1
- package/lib/context/PaymentMethodChildrenContext.d.ts +9 -1
- package/lib/context/PaymentMethodContext.d.ts +22 -1
- package/lib/context/PaymentSourceContext.d.ts +13 -1
- package/lib/context/PlaceOrderContext.d.ts +17 -1
- package/lib/context/PricesContext.d.ts +6 -1
- package/lib/context/ShipmentChildrenContext.d.ts +12 -1
- package/lib/context/ShipmentContext.d.ts +11 -1
- package/lib/context/ShippingAddressContext.d.ts +9 -1
- package/lib/context/ShippingAddressFormContext.d.ts +3 -1
- package/lib/context/ShippingMethodChildrenContext.d.ts +9 -1
- package/lib/context/SkuChildrenContext.d.ts +8 -1
- package/lib/context/SkuContext.d.ts +8 -1
- package/lib/context/SkuListsContext.d.ts +5 -1
- package/lib/context/SkuOptionChildrenContext.d.ts +7 -1
- package/lib/context/SkuOptionsContext.d.ts +2 -1
- package/lib/context/StockTransferChildrenContext.d.ts +6 -1
- package/lib/context/VariantsContext.d.ts +2 -1
- package/lib/index.d.ts +102 -1
- package/lib/reducers/AddressReducer.d.ts +59 -1
- package/lib/reducers/AvailabilityReducer.d.ts +61 -1
- package/lib/reducers/BillingAddressReducer.d.ts +31 -1
- package/lib/reducers/CustomerReducer.d.ts +50 -1
- package/lib/reducers/GiftCardReducer.d.ts +76 -1
- package/lib/reducers/ItemReducer.d.ts +69 -1
- package/lib/reducers/LineItemReducer.d.ts +52 -1
- package/lib/reducers/OrderReducer.d.ts +132 -2
- package/lib/reducers/PaymentMethodReducer.d.ts +151 -1
- package/lib/reducers/PlaceOrderReducer.d.ts +59 -1
- package/lib/reducers/PriceReducer.d.ts +44 -1
- package/lib/reducers/ShipmentReducer.d.ts +40 -1
- package/lib/reducers/ShippingAddressReducer.d.ts +32 -1
- package/lib/reducers/SkuListsReducer.d.ts +21 -1
- package/lib/reducers/SkuOptionsReducer.d.ts +26 -1
- package/lib/reducers/SkuReducer.d.ts +21 -1
- package/lib/reducers/VariantReducer.d.ts +71 -1
- package/lib/typings/errors.d.ts +42 -1
- package/lib/typings/index.d.ts +137 -1
- package/lib/utils/PropsType.d.ts +33 -1
- package/lib/utils/addressesManager.d.ts +28 -1
- package/lib/utils/baseReducer.d.ts +3 -1
- package/lib/utils/browserInfo.d.ts +9 -1
- package/lib/utils/checkIncludeResource.d.ts +8 -1
- package/lib/utils/childrenTypes.d.ts +9 -1
- package/lib/utils/compareObjAttribute.d.ts +7 -1
- package/lib/utils/countryStateCity.d.ts +9 -1
- package/lib/utils/customMessages.d.ts +8 -1
- package/lib/utils/customerOrderOptions.d.ts +3 -1
- package/lib/utils/getAmount.d.ts +9 -1
- package/lib/utils/getCardDetails.d.ts +15 -1
- package/lib/utils/getCurrentItemKey.d.ts +6 -1
- package/lib/utils/getErrors.d.ts +11 -1
- package/lib/utils/getLineItemsCount.d.ts +12 -1
- package/lib/utils/getLoaderComponent.d.ts +2 -1
- package/lib/utils/getPrices.d.ts +17 -1
- package/lib/utils/getSdk.d.ts +3 -1
- package/lib/utils/getSkus.d.ts +3 -1
- package/lib/utils/hooks/useExternalScript.d.ts +1 -1
- package/lib/utils/isEmptyStates.d.ts +1 -1
- package/lib/utils/isJSON.d.ts +1 -1
- package/lib/utils/jwt.d.ts +27 -1
- package/lib/utils/localStorage.d.ts +17 -1
- package/lib/utils/organization.d.ts +6 -1
- package/lib/utils/paypalPayment.d.ts +3 -1
- package/lib/utils/placeholderImages.d.ts +2 -0
- package/lib/utils/placeholderImages.js +1 -0
- package/lib/utils/promisify.d.ts +1 -1
- package/lib/utils/shipments.d.ts +3 -1
- package/lib/utils/validateFormFields.d.ts +22 -1
- package/package.json +2 -2
|
@@ -1 +1,8 @@
|
|
|
1
|
-
import{FunctionComponent,ReactNode}from'react';
|
|
1
|
+
import { FunctionComponent, ReactNode } from 'react';
|
|
2
|
+
declare type ShippingMethodProps = {
|
|
3
|
+
children: ReactNode;
|
|
4
|
+
readonly?: boolean;
|
|
5
|
+
emptyText?: string;
|
|
6
|
+
};
|
|
7
|
+
declare const ShippingMethod: FunctionComponent<ShippingMethodProps>;
|
|
8
|
+
export default ShippingMethod;
|
|
@@ -1 +1,11 @@
|
|
|
1
|
-
import{FunctionComponent,ReactNode
|
|
1
|
+
import { FunctionComponent, ReactNode } from 'react';
|
|
2
|
+
import { ShippingMethod } from '@commercelayer/sdk';
|
|
3
|
+
declare type LineItemNameChildrenProps = Omit<LineItemNameProps, 'children'> & {
|
|
4
|
+
label: string;
|
|
5
|
+
shippingMethod: ShippingMethod;
|
|
6
|
+
};
|
|
7
|
+
declare type LineItemNameProps = {
|
|
8
|
+
children?: (props: LineItemNameChildrenProps) => ReactNode;
|
|
9
|
+
} & JSX.IntrinsicElements['label'];
|
|
10
|
+
declare const ShippingMethodName: FunctionComponent<LineItemNameProps>;
|
|
11
|
+
export default ShippingMethodName;
|
|
@@ -1 +1,13 @@
|
|
|
1
|
-
import{FunctionComponent}from'react';
|
|
1
|
+
import { FunctionComponent } from 'react';
|
|
2
|
+
import { BaseAmountComponent } from '../typings/index';
|
|
3
|
+
export declare type ShippingMethodPriceProps = BaseAmountComponent & {
|
|
4
|
+
labelFreeOver?: string;
|
|
5
|
+
} & ({
|
|
6
|
+
type?: 'amount';
|
|
7
|
+
base?: 'freeOver';
|
|
8
|
+
} | {
|
|
9
|
+
type?: 'amount' | 'amountForShipment';
|
|
10
|
+
base?: 'price';
|
|
11
|
+
});
|
|
12
|
+
declare const ShippingMethodPrice: FunctionComponent<ShippingMethodPriceProps>;
|
|
13
|
+
export default ShippingMethodPrice;
|
|
@@ -1 +1,13 @@
|
|
|
1
|
-
import{FunctionComponent,ReactNode
|
|
1
|
+
import { FunctionComponent, ReactNode } from 'react';
|
|
2
|
+
import type { ShippingMethod } from '@commercelayer/sdk';
|
|
3
|
+
export declare type ShippingMethodRadioButtonType = Omit<ShippingMethodRadioButtonProps, 'children'> & {
|
|
4
|
+
shippingMethod: ShippingMethod;
|
|
5
|
+
shipmentId: string;
|
|
6
|
+
};
|
|
7
|
+
export declare type ShippingMethodRadioButtonOnChangeType = (shippingMethod: ShippingMethod, shipmentId: string) => void;
|
|
8
|
+
declare type ShippingMethodRadioButtonProps = {
|
|
9
|
+
children?: (props: ShippingMethodRadioButtonType) => ReactNode;
|
|
10
|
+
onChange?: ShippingMethodRadioButtonOnChangeType;
|
|
11
|
+
} & Omit<JSX.IntrinsicElements['input'], 'onChange'>;
|
|
12
|
+
declare const ShippingMethodRadioButton: FunctionComponent<ShippingMethodRadioButtonProps>;
|
|
13
|
+
export default ShippingMethodRadioButton;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__rest}from"tslib";import{jsx as _jsx}from"react/jsx-runtime";import{useContext}from"react";import ShippingMethodChildrenContext from"../context/ShippingMethodChildrenContext";import Parent from"./utils/Parent";import components from"../config/components";import ShipmentContext from"../context/ShipmentContext";const propTypes=components.ShippingMethodRadioButton.propTypes,displayName=components.ShippingMethodRadioButton.displayName,ShippingMethodRadioButton=props=>{const{onChange}=props,p=__rest(props,["onChange"]),{shippingMethod,currentShippingMethodId,shipmentId}=useContext(ShippingMethodChildrenContext),{setShippingMethod}=useContext(ShipmentContext),shippingMethodId=shippingMethod==null?void 0:shippingMethod.id,name=`shipment-${shipmentId}`,id=`${name}-${shippingMethodId}
|
|
1
|
+
import{__rest}from"tslib";import{jsx as _jsx}from"react/jsx-runtime";import{useContext,useEffect,useState}from"react";import ShippingMethodChildrenContext from"../context/ShippingMethodChildrenContext";import Parent from"./utils/Parent";import components from"../config/components";import ShipmentContext from"../context/ShipmentContext";const propTypes=components.ShippingMethodRadioButton.propTypes,displayName=components.ShippingMethodRadioButton.displayName,ShippingMethodRadioButton=props=>{const{onChange}=props,p=__rest(props,["onChange"]),[checked,setChecked]=useState(!1),{shippingMethod,currentShippingMethodId,shipmentId}=useContext(ShippingMethodChildrenContext),{setShippingMethod}=useContext(ShipmentContext),shippingMethodId=shippingMethod==null?void 0:shippingMethod.id,name=`shipment-${shipmentId}`,id=`${name}-${shippingMethodId}`;useEffect(()=>(setChecked(shippingMethodId===currentShippingMethodId),()=>{setChecked(!1)}),[currentShippingMethodId]);const handleOnChange=async()=>{shipmentId&&shippingMethodId&&(setChecked(!0),await setShippingMethod(shipmentId,shippingMethodId),shippingMethod&&onChange&&onChange(shippingMethod,shipmentId))},parentProps=Object.assign({shippingMethod,shipmentId,handleOnChange,name,id},props);return props.children?_jsx(Parent,Object.assign({},parentProps,{children:props.children})):_jsx("input",Object.assign({type:"radio",name,id,onChange:handleOnChange,checked},p))};ShippingMethodRadioButton.propTypes=propTypes,ShippingMethodRadioButton.displayName=displayName;export default ShippingMethodRadioButton;
|
|
@@ -1,2 +1,10 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import{ConditionalElement}from'../typings/index';
|
|
2
|
+
import { ConditionalElement } from '../typings/index';
|
|
3
|
+
import { TResources } from './utils/GenericFieldComponent';
|
|
4
|
+
declare type SkuFieldChildrenProps = Omit<Props, 'children' | 'attribute' | 'element'>;
|
|
5
|
+
declare type TCondition = ConditionalElement<Exclude<TResources['Sku'], 'resource'>>;
|
|
6
|
+
declare type Props = {
|
|
7
|
+
children?: (props: SkuFieldChildrenProps) => JSX.Element;
|
|
8
|
+
} & TCondition;
|
|
9
|
+
export default function SkuField<P extends Props>(props: P): JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
import{FunctionComponent,ReactNode}from'react';
|
|
1
|
+
import { FunctionComponent, ReactNode } from 'react';
|
|
2
|
+
declare type SkuListProp = {
|
|
3
|
+
children: ReactNode;
|
|
4
|
+
id: string;
|
|
5
|
+
};
|
|
6
|
+
declare const SkuList: FunctionComponent<SkuListProp>;
|
|
7
|
+
export default SkuList;
|
|
@@ -1 +1,6 @@
|
|
|
1
|
-
import{FunctionComponent,ReactNode}from'react';
|
|
1
|
+
import { FunctionComponent, ReactNode } from 'react';
|
|
2
|
+
declare type SkuListsContainerProp = {
|
|
3
|
+
children: ReactNode;
|
|
4
|
+
};
|
|
5
|
+
declare const SkuListsContainer: FunctionComponent<SkuListsContainerProp>;
|
|
6
|
+
export default SkuListsContainer;
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
import{FunctionComponent,ReactNode}from'react';
|
|
1
|
+
import { FunctionComponent, ReactNode } from 'react';
|
|
2
|
+
export declare type SkuOptionProps = {
|
|
3
|
+
children: ReactNode;
|
|
4
|
+
id: string;
|
|
5
|
+
};
|
|
6
|
+
declare const SkuOption: FunctionComponent<SkuOptionProps>;
|
|
7
|
+
export default SkuOption;
|
|
@@ -1 +1,5 @@
|
|
|
1
|
-
import{FunctionComponent}from'react';
|
|
1
|
+
import { FunctionComponent } from 'react';
|
|
2
|
+
import { BaseInputComponentProps } from '../typings/index';
|
|
3
|
+
declare type SkuOptionInputProps = BaseInputComponentProps & JSX.IntrinsicElements['input'] & JSX.IntrinsicElements['textarea'];
|
|
4
|
+
declare const SkuOptionInput: FunctionComponent<SkuOptionInputProps>;
|
|
5
|
+
export default SkuOptionInput;
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
import{FunctionComponent,ReactNode}from'react';
|
|
1
|
+
import { FunctionComponent, ReactNode } from 'react';
|
|
2
|
+
declare type SkuOptionsContainerProp = {
|
|
3
|
+
children: ReactNode;
|
|
4
|
+
skuCode?: string;
|
|
5
|
+
};
|
|
6
|
+
declare const SkuOptionsContainer: FunctionComponent<SkuOptionsContainerProp>;
|
|
7
|
+
export default SkuOptionsContainer;
|
package/lib/components/Skus.d.ts
CHANGED
|
@@ -1 +1,11 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
declare type Props = {
|
|
3
|
+
children: ReactNode;
|
|
4
|
+
};
|
|
5
|
+
declare function Skus<P extends Props>({ children }: P): JSX.Element;
|
|
6
|
+
declare namespace Skus {
|
|
7
|
+
var propTypes: {
|
|
8
|
+
children: import("prop-types").Validator<boolean | import("react").ReactChild | import("react").ReactFragment | import("react").ReactPortal | (() => ReactNode)>;
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
export default Skus;
|
|
@@ -1 +1,14 @@
|
|
|
1
|
-
import{QueryParamsList}from'@commercelayer/sdk';
|
|
1
|
+
import { QueryParamsList } from '@commercelayer/sdk';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
declare type Props = {
|
|
4
|
+
skus: string[];
|
|
5
|
+
children: ReactNode;
|
|
6
|
+
queryParams?: QueryParamsList;
|
|
7
|
+
};
|
|
8
|
+
declare function SkusContainer<P extends Props>(props: P): JSX.Element;
|
|
9
|
+
declare namespace SkusContainer {
|
|
10
|
+
var propTypes: {
|
|
11
|
+
children: import("prop-types").Validator<boolean | import("react").ReactChild | import("react").ReactFragment | import("react").ReactPortal | (() => ReactNode)>;
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
export default SkusContainer;
|
|
@@ -1 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { ReactNode, FunctionComponent } from 'react';
|
|
2
|
+
declare type StockTransferProps = {
|
|
3
|
+
children: ReactNode;
|
|
4
|
+
} & JSX.IntrinsicElements['p'];
|
|
5
|
+
declare const StockTransfer: FunctionComponent<StockTransferProps>;
|
|
6
|
+
export default StockTransfer;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as _jsx}from"react/jsx-runtime";import{useContext
|
|
1
|
+
import{jsx as _jsx,Fragment as _Fragment}from"react/jsx-runtime";import{useContext}from"react";import components from"../config/components";import ShipmentChildrenContext from"../context/ShipmentChildrenContext";import StockTransferChildrenContext from"../context/StockTransferChildrenContext";const propTypes=components.StockTransfer.propTypes,displayName=components.StockTransfer.displayName,StockTransfer=props=>{const{children}=props,{stockTransfers,lineItems}=useContext(ShipmentChildrenContext),components2=stockTransfers==null?void 0:stockTransfers.filter(st=>!!(lineItems==null?void 0:lineItems.find(l=>l.sku_code!==st.sku_code))).map((stockTransfer,k)=>{const stockTransferProps={stockTransfer:stockTransfer.type==="line_items"?stockTransfer:stockTransfer==null?void 0:stockTransfer.line_item};return _jsx(StockTransferChildrenContext.Provider,Object.assign({value:stockTransferProps},{children}),k)});return _jsx(_Fragment,{children:components2})};StockTransfer.propTypes=propTypes,StockTransfer.displayName=displayName;export default StockTransfer;
|
|
@@ -1,2 +1,10 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import{ConditionalElement}from'../typings/index';
|
|
2
|
+
import { ConditionalElement } from '../typings/index';
|
|
3
|
+
import { TResources } from './utils/GenericFieldComponent';
|
|
4
|
+
declare type StockTransferFieldChildrenProps = Omit<Props, 'children' | 'attribute' | 'element'>;
|
|
5
|
+
declare type TCondition = ConditionalElement<Exclude<TResources['StockTransfer'], 'resource'>>;
|
|
6
|
+
declare type Props = {
|
|
7
|
+
children?: (props: StockTransferFieldChildrenProps) => JSX.Element;
|
|
8
|
+
} & TCondition;
|
|
9
|
+
export default function StockTransferField<P extends Props>(props: P): JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -1 +1,18 @@
|
|
|
1
|
-
import React from'react';
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { StripeCardElementOptions, StripeElementLocale } from '@stripe/stripe-js';
|
|
3
|
+
import { PaymentMethodConfig } from '../reducers/PaymentMethodReducer';
|
|
4
|
+
import { PaymentSourceProps } from './PaymentSource';
|
|
5
|
+
export declare type StripeConfig = {
|
|
6
|
+
containerClassName?: string;
|
|
7
|
+
hintLabel?: string;
|
|
8
|
+
name?: string;
|
|
9
|
+
options?: StripeCardElementOptions;
|
|
10
|
+
[key: string]: any;
|
|
11
|
+
};
|
|
12
|
+
declare type StripePaymentProps = PaymentMethodConfig['stripePayment'] & JSX.IntrinsicElements['div'] & Partial<PaymentSourceProps['templateCustomerSaveToWallet']> & {
|
|
13
|
+
show?: boolean;
|
|
14
|
+
publishableKey: string;
|
|
15
|
+
locale?: StripeElementLocale;
|
|
16
|
+
};
|
|
17
|
+
declare const StripePayment: React.FunctionComponent<StripePaymentProps>;
|
|
18
|
+
export default StripePayment;
|
|
@@ -1 +1,4 @@
|
|
|
1
|
-
import{FunctionComponent}from'react';
|
|
1
|
+
import { FunctionComponent } from 'react';
|
|
2
|
+
import { BaseAmountComponent } from '../typings/index';
|
|
3
|
+
declare const SubTotalAmount: FunctionComponent<BaseAmountComponent>;
|
|
4
|
+
export default SubTotalAmount;
|
|
@@ -1 +1,9 @@
|
|
|
1
|
-
import{FunctionComponent,ReactNode}from'react';
|
|
1
|
+
import { FunctionComponent, ReactNode } from 'react';
|
|
2
|
+
import { FunctionChildren } from '../typings/index';
|
|
3
|
+
declare type SubmitButtonChildrenProps = FunctionChildren<Omit<SubmitButtonProps, 'children'>>;
|
|
4
|
+
declare type SubmitButtonProps = {
|
|
5
|
+
children?: SubmitButtonChildrenProps;
|
|
6
|
+
label?: string | ReactNode;
|
|
7
|
+
} & JSX.IntrinsicElements['button'];
|
|
8
|
+
declare const SubmitButton: FunctionComponent<SubmitButtonProps>;
|
|
9
|
+
export default SubmitButton;
|
|
@@ -1 +1,4 @@
|
|
|
1
|
-
import{FunctionComponent}from'react';
|
|
1
|
+
import { FunctionComponent } from 'react';
|
|
2
|
+
import { BaseAmountComponent } from '../typings/index';
|
|
3
|
+
declare const TaxesAmount: FunctionComponent<BaseAmountComponent>;
|
|
4
|
+
export default TaxesAmount;
|
|
@@ -1 +1,4 @@
|
|
|
1
|
-
import{FunctionComponent}from'react';
|
|
1
|
+
import { FunctionComponent } from 'react';
|
|
2
|
+
import { BaseAmountComponent } from '../typings/index';
|
|
3
|
+
declare const TotalAmount: FunctionComponent<BaseAmountComponent>;
|
|
4
|
+
export default TotalAmount;
|
|
@@ -1 +1,29 @@
|
|
|
1
|
-
import{FunctionComponent,ReactNode
|
|
1
|
+
import { FunctionComponent, ReactNode } from 'react';
|
|
2
|
+
import { VariantHandleCallback } from './utils/VariantTemplate';
|
|
3
|
+
import { BaseSelectorType } from '../typings/index';
|
|
4
|
+
import { FunctionChildren } from '../typings/index';
|
|
5
|
+
import { VariantsObject, SetSkuCode } from '../reducers/VariantReducer';
|
|
6
|
+
export interface VariantOption {
|
|
7
|
+
label: string;
|
|
8
|
+
code: string;
|
|
9
|
+
lineItem?: {
|
|
10
|
+
name: string;
|
|
11
|
+
imageUrl?: string | null;
|
|
12
|
+
} | null;
|
|
13
|
+
}
|
|
14
|
+
declare type VariantSelectorChildrenProps = FunctionChildren<Omit<VariantSelectorProps, 'children'> & {
|
|
15
|
+
variants: VariantsObject;
|
|
16
|
+
handleSelect: SetSkuCode;
|
|
17
|
+
loading: boolean;
|
|
18
|
+
}>;
|
|
19
|
+
declare type VariantSelectorProps = {
|
|
20
|
+
children?: VariantSelectorChildrenProps;
|
|
21
|
+
options: VariantOption[];
|
|
22
|
+
type?: BaseSelectorType;
|
|
23
|
+
loader?: ReactNode;
|
|
24
|
+
placeholder?: string;
|
|
25
|
+
skuCode?: string;
|
|
26
|
+
handleCallback?: VariantHandleCallback;
|
|
27
|
+
} & JSX.IntrinsicElements['input'] & JSX.IntrinsicElements['select'];
|
|
28
|
+
declare const VariantSelector: FunctionComponent<VariantSelectorProps>;
|
|
29
|
+
export default VariantSelector;
|
|
@@ -1 +1,8 @@
|
|
|
1
|
-
import React,{ReactNode}from'react';
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
|
+
declare type VariantsContainerProps = {
|
|
3
|
+
children: ReactNode;
|
|
4
|
+
filters?: Record<string, any>;
|
|
5
|
+
skuCode?: string;
|
|
6
|
+
};
|
|
7
|
+
declare const VariantsContainer: React.FunctionComponent<VariantsContainerProps>;
|
|
8
|
+
export default VariantsContainer;
|
|
@@ -1 +1,10 @@
|
|
|
1
|
-
import{FunctionComponent,ReactNode
|
|
1
|
+
import { FunctionComponent, ReactNode } from 'react';
|
|
2
|
+
export declare type WireTransferConfig = {
|
|
3
|
+
infoMessage?: {
|
|
4
|
+
text?: string | ReactNode;
|
|
5
|
+
className?: string;
|
|
6
|
+
};
|
|
7
|
+
};
|
|
8
|
+
declare type Props = WireTransferConfig & JSX.IntrinsicElements['div'];
|
|
9
|
+
declare const WireTransferPayment: FunctionComponent<Props>;
|
|
10
|
+
export default WireTransferPayment;
|
|
@@ -1,2 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import{GatewayBaseType}from'../PaymentGateway';
|
|
2
|
+
import { GatewayBaseType } from '../PaymentGateway';
|
|
3
|
+
declare type AdyenGateway = GatewayBaseType;
|
|
4
|
+
export default function AdyenGateway(props: AdyenGateway): JSX.Element | null;
|
|
5
|
+
export {};
|
|
@@ -1,2 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import{GatewayBaseType}from'../PaymentGateway';
|
|
2
|
+
import { GatewayBaseType } from '../PaymentGateway';
|
|
3
|
+
declare type BraintreeGateway = GatewayBaseType;
|
|
4
|
+
export default function BraintreeGateway(props: BraintreeGateway): JSX.Element | null;
|
|
5
|
+
export {};
|
|
@@ -1,2 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import{GatewayBaseType}from'../PaymentGateway';
|
|
2
|
+
import { GatewayBaseType } from '../PaymentGateway';
|
|
3
|
+
declare type CheckoutComGateway = GatewayBaseType;
|
|
4
|
+
export default function CheckoutComGateway(props: CheckoutComGateway): JSX.Element | null;
|
|
5
|
+
export {};
|
|
@@ -1,2 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import{GatewayBaseType}from'../PaymentGateway';
|
|
2
|
+
import { GatewayBaseType } from '../PaymentGateway';
|
|
3
|
+
declare type KlarnaGateway = GatewayBaseType;
|
|
4
|
+
export default function KlarnaGateway(props: KlarnaGateway): JSX.Element | null;
|
|
5
|
+
export {};
|
|
@@ -1,2 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import{GatewayBaseType}from'../PaymentGateway';
|
|
2
|
+
import { GatewayBaseType } from '../PaymentGateway';
|
|
3
|
+
declare type PaypalGateway = Partial<GatewayBaseType>;
|
|
4
|
+
export default function PaypalGateway(props: PaypalGateway): JSX.Element | null;
|
|
5
|
+
export {};
|
|
@@ -1,2 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import{GatewayBaseType}from'../PaymentGateway';
|
|
2
|
+
import { GatewayBaseType } from '../PaymentGateway';
|
|
3
|
+
declare type StripeGateway = GatewayBaseType;
|
|
4
|
+
export default function StripeGateway(props: StripeGateway): JSX.Element | null;
|
|
5
|
+
export {};
|
|
@@ -1,2 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import{GatewayBaseType}from'../PaymentGateway';
|
|
2
|
+
import { GatewayBaseType } from '../PaymentGateway';
|
|
3
|
+
declare type WireTransferGateway = GatewayBaseType;
|
|
4
|
+
export default function WireTransferGateway(props: WireTransferGateway): JSX.Element | null;
|
|
5
|
+
export {};
|
|
@@ -1,2 +1,27 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import{Address}from'@commercelayer/sdk';
|
|
2
|
+
import { Address } from '@commercelayer/sdk';
|
|
3
|
+
import AddressChildrenContext from '../../context/AddressChildrenContext';
|
|
4
|
+
import { FunctionChildren } from '../../typings/index';
|
|
5
|
+
declare type ChildrenProps = Pick<Props, 'customerAddresses' | 'className'> & {
|
|
6
|
+
AddressProvider: typeof AddressChildrenContext.Provider;
|
|
7
|
+
};
|
|
8
|
+
export declare type CustomerAddress = Address & {
|
|
9
|
+
onClick: () => void;
|
|
10
|
+
handleSelect?: () => void;
|
|
11
|
+
};
|
|
12
|
+
export declare type AddressCardsTemplateChildren = FunctionChildren<ChildrenProps>;
|
|
13
|
+
export declare type AddressCardsType = ChildrenProps;
|
|
14
|
+
export declare type HandleSelect = (k: number, addressId: string, customerAddressId: string, disabled: boolean, address: Address) => void;
|
|
15
|
+
declare type Props = {
|
|
16
|
+
customerAddresses: CustomerAddress[];
|
|
17
|
+
countryLock?: string;
|
|
18
|
+
children: AddressCardsTemplateChildren;
|
|
19
|
+
selectedClassName?: string;
|
|
20
|
+
disabledClassName?: string;
|
|
21
|
+
deselect?: boolean;
|
|
22
|
+
selected?: number | null;
|
|
23
|
+
className?: string;
|
|
24
|
+
handleSelect: HandleSelect;
|
|
25
|
+
};
|
|
26
|
+
export default function AddressCardsTemplate({ customerAddresses, children, deselect, countryLock, selected, selectedClassName, className, disabledClassName, handleSelect, }: Props): JSX.Element;
|
|
27
|
+
export {};
|
|
@@ -1 +1,8 @@
|
|
|
1
|
-
import{FunctionComponent,ReactNode}from'react';
|
|
1
|
+
import { FunctionComponent, ReactNode } from 'react';
|
|
2
|
+
declare type BaseFieldChildren = Omit<BaseFieldProps, 'children'>;
|
|
3
|
+
export declare type BaseFieldProps = {
|
|
4
|
+
attribute: 'number' | 'id';
|
|
5
|
+
children?: (props: BaseFieldChildren) => ReactNode;
|
|
6
|
+
} & JSX.IntrinsicElements['span'];
|
|
7
|
+
declare const BaseField: FunctionComponent<BaseFieldProps>;
|
|
8
|
+
export default BaseField;
|
|
@@ -1 +1,5 @@
|
|
|
1
|
-
import React from'react';
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { BaseInputComponentProps } from '../../typings/index';
|
|
3
|
+
export declare type BaseInputProps = BaseInputComponentProps & JSX.IntrinsicElements['input'] & JSX.IntrinsicElements['textarea'];
|
|
4
|
+
declare const _default: React.ForwardRefExoticComponent<Pick<BaseInputProps, "children" | "form" | "slot" | "style" | "title" | "pattern" | "resource" | "id" | "value" | "placeholder" | "className" | "required" | "name" | "onChange" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "lang" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "min" | "max" | "type" | "disabled" | "width" | "height" | "src" | "list" | "step" | "accept" | "alt" | "autoComplete" | "autoFocus" | "capture" | "checked" | "crossOrigin" | "enterKeyHint" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "maxLength" | "minLength" | "multiple" | "readOnly" | "size" | "cols" | "dirName" | "rows" | "wrap"> & React.RefAttributes<any>>;
|
|
5
|
+
export default _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__rest}from"tslib";import{jsx as _jsx}from"react/jsx-runtime";import React from"react";import Parent from"./Parent";const BaseInput=(props,ref)=>{const{children}=props,p=__rest(props,["children"]),input=props.type==="textarea"?_jsx("textarea",Object.assign({ref},p)):_jsx("input",Object.assign({ref},p));return children?_jsx(Parent,Object.assign({},p,{children})):input};export default React.forwardRef(BaseInput);
|
|
1
|
+
import{__rest}from"tslib";import{jsx as _jsx}from"react/jsx-runtime";import React from"react";import Parent from"./Parent";const BaseInput=(props,ref)=>{const{children}=props,p=__rest(props,["children"]),input=props.type==="textarea"?_jsx("textarea",Object.assign({ref},p)):_jsx("input",Object.assign({ref},p));return children?_jsx(Parent,Object.assign({parentRef:ref},p,{children})):input};export default React.forwardRef(BaseInput);
|
|
@@ -1 +1,6 @@
|
|
|
1
|
-
import{FunctionComponent}from'react';
|
|
1
|
+
import { FunctionComponent } from 'react';
|
|
2
|
+
import { PropsType } from '../../utils/PropsType';
|
|
3
|
+
import { baseOrderPricePropTypes } from '../../typings/index';
|
|
4
|
+
export declare type BaseOrderPriceProps = PropsType<typeof baseOrderPricePropTypes> & JSX.IntrinsicElements['span'];
|
|
5
|
+
declare const BaseOrderPrice: FunctionComponent<BaseOrderPriceProps>;
|
|
6
|
+
export default BaseOrderPrice;
|
|
@@ -1 +1,5 @@
|
|
|
1
|
-
import React from'react';
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { BaseSelectComponentProps } from '../../typings/index';
|
|
3
|
+
export declare type BaseSelectProps = BaseSelectComponentProps;
|
|
4
|
+
declare const _default: React.ForwardRefExoticComponent<BaseSelectComponentProps & React.RefAttributes<any>>;
|
|
5
|
+
export default _default;
|
|
@@ -1 +1,37 @@
|
|
|
1
|
-
import{InitialSkuContext}from'../../context/SkuChildrenContext';
|
|
1
|
+
import { InitialSkuContext } from '../../context/SkuChildrenContext';
|
|
2
|
+
import { InitialStockTransferContext } from '../../context/StockTransferChildrenContext';
|
|
3
|
+
import { LineItem, Sku } from '@commercelayer/sdk';
|
|
4
|
+
import { InitialLineItemContext } from '../../context/LineItemChildrenContext';
|
|
5
|
+
import { Context } from 'react';
|
|
6
|
+
export declare type TResources = {
|
|
7
|
+
StockTransfer: LineItem & {
|
|
8
|
+
resource: 'stock_transfers';
|
|
9
|
+
};
|
|
10
|
+
Sku: Sku & {
|
|
11
|
+
resource: 'skus';
|
|
12
|
+
};
|
|
13
|
+
LineItem: LineItem & {
|
|
14
|
+
resource: 'line_items';
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
export declare type TResourceKey = {
|
|
18
|
+
[K in keyof TResources]: K;
|
|
19
|
+
};
|
|
20
|
+
declare type ChildrenProps<E extends TResources[keyof TResources]> = Omit<Props<E>, 'children' | 'attribute'> & {
|
|
21
|
+
element: E[keyof E];
|
|
22
|
+
};
|
|
23
|
+
declare type ResourceContext = {
|
|
24
|
+
stock_transfers: InitialStockTransferContext;
|
|
25
|
+
skus: InitialSkuContext;
|
|
26
|
+
line_items: InitialLineItemContext;
|
|
27
|
+
};
|
|
28
|
+
declare type GenericContext<K extends keyof ResourceContext> = Context<ResourceContext[K]>;
|
|
29
|
+
declare type Props<E extends TResources[keyof TResources]> = {
|
|
30
|
+
children?: (props: ChildrenProps<E>) => JSX.Element;
|
|
31
|
+
resource: E['resource'];
|
|
32
|
+
attribute: keyof E;
|
|
33
|
+
tagElement: keyof JSX.IntrinsicElements;
|
|
34
|
+
context: GenericContext<E['resource']>;
|
|
35
|
+
};
|
|
36
|
+
export default function GenericFieldComponent<R extends keyof TResources>(props: Props<TResources[R]>): JSX.Element;
|
|
37
|
+
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__rest}from"tslib";import{jsx as _jsx}from"react/jsx-runtime";import Parent from"./Parent";import{useContext}from"react";export default function GenericFieldComponent(props){const{children,tagElement,attribute,context}=props,p=__rest(props,["children","tagElement","attribute","context"]),resourceContext=useContext(context);let element;for(const key in resourceContext)Object.prototype.hasOwnProperty.call(resourceContext,key)&&(element=resourceContext[key][attribute]);const Tag=tagElement||"span";if(Tag==="img"&&!children)return _jsx("img",Object.assign({alt:"",src:element},p));const parentProps=Object.assign({element,tagElement},p);return children?_jsx(Parent,Object.assign({},parentProps,{children})):_jsx(Tag,Object.assign({},p,{children:element}))}
|
|
1
|
+
import{__rest}from"tslib";import{jsx as _jsx}from"react/jsx-runtime";import Parent from"./Parent";import{useContext}from"react";import{defaultImgUrl}from"../../utils/placeholderImages";export default function GenericFieldComponent(props){const{children,tagElement,attribute,context}=props,p=__rest(props,["children","tagElement","attribute","context"]),resourceContext=useContext(context);let element;for(const key in resourceContext)Object.prototype.hasOwnProperty.call(resourceContext,key)&&(element=resourceContext[key][attribute]);const Tag=tagElement||"span";if(Tag==="img"&&!children)return _jsx("img",Object.assign({alt:"",src:element||defaultImgUrl},p));const parentProps=Object.assign({element,tagElement},p);return children?_jsx(Parent,Object.assign({},parentProps,{children})):_jsx(Tag,Object.assign({},p,{children:element}))}
|
|
@@ -1 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { ForwardedRef, FunctionComponent } from 'react';
|
|
2
|
+
export declare type ParentProps = {
|
|
3
|
+
parentRef?: ForwardedRef<any>;
|
|
4
|
+
};
|
|
5
|
+
declare const Parent: FunctionComponent<ParentProps>;
|
|
6
|
+
export default Parent;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as _jsx}from"react/jsx-runtime";
|
|
1
|
+
import{__rest}from"tslib";import{jsx as _jsx}from"react/jsx-runtime";const Parent=_a=>{var{children}=_a,p=__rest(_a,["children"]);const Child=children;return Child?_jsx(Child,Object.assign({},p)):null};export default Parent;
|
|
@@ -1,2 +1,23 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import{PaymentResource,PaymentSourceType}from'../../reducers/PaymentMethodReducer';
|
|
2
|
+
import { PaymentResource, PaymentSourceType } from '../../reducers/PaymentMethodReducer';
|
|
3
|
+
import PaymentSourceContext, { IconBrand } from '../../context/PaymentSourceContext';
|
|
4
|
+
import { FunctionChildren } from '../../typings/index';
|
|
5
|
+
declare type ChildrenProps = Pick<Props, 'customerPayments'> & {
|
|
6
|
+
PaymentSourceProvider: typeof PaymentSourceContext.Provider;
|
|
7
|
+
};
|
|
8
|
+
declare type CustomerPayment = PaymentSourceType & {
|
|
9
|
+
card?: {
|
|
10
|
+
brand?: IconBrand;
|
|
11
|
+
last4?: string;
|
|
12
|
+
};
|
|
13
|
+
handleClick?: () => void;
|
|
14
|
+
};
|
|
15
|
+
export declare type CustomerCardsTemplateChildren = FunctionChildren<ChildrenProps>;
|
|
16
|
+
export declare type CustomerCardsType = ChildrenProps;
|
|
17
|
+
declare type Props = {
|
|
18
|
+
customerPayments: CustomerPayment[];
|
|
19
|
+
children: CustomerCardsTemplateChildren;
|
|
20
|
+
paymentResource: PaymentResource;
|
|
21
|
+
};
|
|
22
|
+
export default function PaymentCardsTemplate({ customerPayments, children, paymentResource, }: Props): JSX.Element;
|
|
23
|
+
export {};
|
|
@@ -1 +1,8 @@
|
|
|
1
|
-
import React from'react';
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { PriceProps } from '../Price';
|
|
3
|
+
export declare type PTemplateProps = {
|
|
4
|
+
formattedAmount?: string;
|
|
5
|
+
formattedCompare?: string;
|
|
6
|
+
} & Omit<PriceProps, 'children'>;
|
|
7
|
+
declare const PriceTemplate: React.FunctionComponent<PTemplateProps>;
|
|
8
|
+
export default PriceTemplate;
|