@commercelayer/react-components 3.5.0 → 3.6.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/AddToCartButton.d.ts +1 -20
- package/lib/components/AddToCartButton.js +1 -1
- package/lib/components/Address.d.ts +1 -13
- package/lib/components/Address.js +1 -1
- package/lib/components/AddressCountrySelector.d.ts +1 -9
- package/lib/components/AddressCountrySelector.js +1 -1
- package/lib/components/AddressField.d.ts +1 -15
- package/lib/components/AddressField.js +1 -1
- package/lib/components/AddressInput.d.ts +1 -7
- package/lib/components/AddressInput.js +1 -1
- package/lib/components/AddressStateSelector.d.ts +1 -11
- package/lib/components/AddressStateSelector.js +1 -1
- package/lib/components/AddressesContainer.d.ts +1 -8
- package/lib/components/AddressesContainer.js +1 -1
- package/lib/components/AdjustmentAmount.d.ts +1 -4
- package/lib/components/AdjustmentAmount.js +1 -1
- package/lib/components/AdyenPayment.d.ts +1 -25
- package/lib/components/AdyenPayment.js +1 -1
- package/lib/components/AvailabilityContainer.d.ts +1 -7
- package/lib/components/AvailabilityContainer.js +1 -1
- package/lib/components/AvailabilityTemplate.d.ts +1 -15
- package/lib/components/AvailabilityTemplate.js +1 -1
- package/lib/components/BillingAddressContainer.d.ts +1 -6
- package/lib/components/BillingAddressContainer.js +1 -1
- package/lib/components/BillingAddressForm.d.ts +1 -8
- package/lib/components/BillingAddressForm.js +1 -1
- package/lib/components/BraintreePayment.d.ts +1 -30
- package/lib/components/BraintreePayment.js +1 -1
- package/lib/components/CheckoutComPayment.d.ts +1 -23
- package/lib/components/CheckoutComPayment.js +1 -1
- package/lib/components/CheckoutLink.d.ts +1 -13
- package/lib/components/CheckoutLink.js +1 -1
- package/lib/components/CommerceLayer.d.ts +1 -8
- package/lib/components/CommerceLayer.js +1 -1
- package/lib/components/CustomerContainer.d.ts +1 -7
- package/lib/components/CustomerContainer.js +1 -1
- package/lib/components/CustomerInput.d.ts +1 -11
- package/lib/components/CustomerInput.js +1 -1
- package/lib/components/DeliveryLeadTime.d.ts +1 -10
- package/lib/components/DeliveryLeadTime.js +1 -1
- package/lib/components/DiscountAmount.d.ts +1 -4
- package/lib/components/DiscountAmount.js +1 -1
- package/lib/components/Errors.d.ts +1 -5
- package/lib/components/Errors.js +1 -1
- package/lib/components/ExternalFunction.d.ts +1 -7
- package/lib/components/ExternalFunction.js +1 -1
- package/lib/components/GiftCard.d.ts +1 -8
- package/lib/components/GiftCard.js +1 -1
- package/lib/components/GiftCardAmount.d.ts +1 -4
- package/lib/components/GiftCardAmount.js +1 -1
- package/lib/components/GiftCardContainer.d.ts +1 -6
- package/lib/components/GiftCardContainer.js +1 -1
- package/lib/components/GiftCardCurrencySelector.d.ts +1 -7
- package/lib/components/GiftCardCurrencySelector.js +1 -1
- package/lib/components/GiftCardInput.d.ts +1 -7
- package/lib/components/GiftCardInput.js +1 -1
- package/lib/components/GiftCardOrCouponCode.d.ts +1 -13
- package/lib/components/GiftCardOrCouponCode.js +1 -1
- package/lib/components/GiftCardOrCouponForm.d.ts +1 -10
- package/lib/components/GiftCardOrCouponForm.js +1 -1
- package/lib/components/GiftCardOrCouponInput.d.ts +1 -8
- package/lib/components/GiftCardOrCouponInput.js +1 -1
- package/lib/components/GiftCardOrCouponRemoveButton.d.ts +1 -16
- package/lib/components/GiftCardOrCouponRemoveButton.js +1 -1
- package/lib/components/GiftCardOrCouponSubmit.d.ts +1 -9
- package/lib/components/GiftCardOrCouponSubmit.js +1 -1
- package/lib/components/ItemContainer.d.ts +1 -11
- package/lib/components/ItemContainer.js +1 -1
- package/lib/components/LineItem.d.ts +1 -8
- package/lib/components/LineItem.js +1 -1
- package/lib/components/LineItemAmount.d.ts +1 -7
- package/lib/components/LineItemAmount.js +1 -1
- package/lib/components/LineItemCode.d.ts +1 -12
- package/lib/components/LineItemCode.js +1 -1
- package/lib/components/LineItemImage.d.ts +1 -16
- package/lib/components/LineItemImage.js +1 -1
- package/lib/components/LineItemName.d.ts +1 -11
- package/lib/components/LineItemName.js +1 -1
- package/lib/components/LineItemOption.d.ts +1 -19
- package/lib/components/LineItemOption.js +1 -1
- package/lib/components/LineItemOptions.d.ts +1 -14
- package/lib/components/LineItemOptions.js +1 -1
- package/lib/components/LineItemQuantity.d.ts +1 -14
- package/lib/components/LineItemQuantity.js +1 -1
- package/lib/components/LineItemRemoveLink.d.ts +1 -12
- package/lib/components/LineItemRemoveLink.js +1 -1
- package/lib/components/LineItemsContainer.d.ts +1 -8
- package/lib/components/LineItemsContainer.js +1 -1
- package/lib/components/LineItemsCount.d.ts +1 -12
- package/lib/components/LineItemsCount.js +1 -1
- package/lib/components/LineItemsEmpty.d.ts +1 -12
- package/lib/components/LineItemsEmpty.js +1 -1
- package/lib/components/MetadataInput.d.ts +1 -5
- package/lib/components/MetadataInput.js +1 -1
- package/lib/components/OrderContainer.d.ts +1 -11
- package/lib/components/OrderContainer.js +1 -1
- package/lib/components/OrderNumber.d.ts +1 -5
- package/lib/components/OrderNumber.js +1 -1
- package/lib/components/OrderStorage.d.ts +1 -8
- package/lib/components/OrderStorage.js +1 -1
- package/lib/components/PaymentGateway.d.ts +1 -16
- package/lib/components/PaymentGateway.js +1 -1
- package/lib/components/PaymentMethod.d.ts +1 -16
- package/lib/components/PaymentMethod.js +1 -1
- package/lib/components/PaymentMethodAmount.d.ts +1 -4
- package/lib/components/PaymentMethodAmount.js +1 -1
- package/lib/components/PaymentMethodName.d.ts +1 -9
- package/lib/components/PaymentMethodName.js +1 -1
- package/lib/components/PaymentMethodPrice.d.ts +1 -9
- package/lib/components/PaymentMethodPrice.js +1 -1
- package/lib/components/PaymentMethodRadioButton.d.ts +1 -11
- package/lib/components/PaymentMethodRadioButton.js +1 -1
- package/lib/components/PaymentMethodsContainer.d.ts +1 -8
- package/lib/components/PaymentMethodsContainer.js +1 -1
- package/lib/components/PaymentSource.d.ts +1 -19
- package/lib/components/PaymentSource.js +1 -1
- package/lib/components/PaymentSourceBrandIcon.d.ts +1 -15
- package/lib/components/PaymentSourceBrandIcon.js +1 -1
- package/lib/components/PaymentSourceBrandName.d.ts +1 -12
- package/lib/components/PaymentSourceBrandName.js +1 -1
- package/lib/components/PaymentSourceDetail.d.ts +1 -12
- package/lib/components/PaymentSourceDetail.js +1 -1
- package/lib/components/PaymentSourceEditButton.d.ts +1 -9
- package/lib/components/PaymentSourceEditButton.js +1 -1
- package/lib/components/PaypalPayment.d.ts +1 -12
- package/lib/components/PaypalPayment.js +1 -1
- package/lib/components/PlaceOrderButton.d.ts +1 -12
- package/lib/components/PlaceOrderButton.js +1 -1
- package/lib/components/PlaceOrderContainer.d.ts +1 -8
- package/lib/components/PlaceOrderContainer.js +1 -1
- package/lib/components/Price.d.ts +1 -16
- package/lib/components/Price.js +1 -1
- package/lib/components/PricesContainer.d.ts +1 -11
- package/lib/components/PricesContainer.js +1 -1
- package/lib/components/PrivacyAndTermsCheckbox.d.ts +1 -4
- package/lib/components/PrivacyAndTermsCheckbox.js +1 -1
- package/lib/components/QuantitySelector.d.ts +1 -17
- package/lib/components/QuantitySelector.js +1 -1
- package/lib/components/SaveAddressesButton.d.ts +1 -10
- package/lib/components/SaveAddressesButton.js +1 -1
- package/lib/components/SaveCustomerButton.d.ts +1 -13
- package/lib/components/SaveCustomerButton.js +1 -1
- package/lib/components/Shipment.d.ts +1 -8
- package/lib/components/Shipment.js +1 -1
- package/lib/components/ShipmentField.d.ts +1 -12
- package/lib/components/ShipmentField.js +1 -1
- package/lib/components/ShipmentsContainer.d.ts +1 -6
- package/lib/components/ShipmentsContainer.js +1 -1
- package/lib/components/ShippingAddressContainer.d.ts +1 -6
- package/lib/components/ShippingAddressContainer.js +1 -1
- package/lib/components/ShippingAddressForm.d.ts +1 -8
- package/lib/components/ShippingAddressForm.js +1 -1
- package/lib/components/ShippingAmount.d.ts +1 -4
- package/lib/components/ShippingAmount.js +1 -1
- package/lib/components/ShippingMethod.d.ts +1 -8
- package/lib/components/ShippingMethod.js +1 -1
- package/lib/components/ShippingMethodName.d.ts +1 -11
- package/lib/components/ShippingMethodName.js +1 -1
- package/lib/components/ShippingMethodPrice.d.ts +1 -13
- package/lib/components/ShippingMethodPrice.js +1 -1
- package/lib/components/ShippingMethodRadioButton.d.ts +1 -13
- package/lib/components/ShippingMethodRadioButton.js +1 -1
- package/lib/components/SkuList.d.ts +1 -7
- package/lib/components/SkuList.js +1 -1
- package/lib/components/SkuListsContainer.d.ts +1 -6
- package/lib/components/SkuListsContainer.js +1 -1
- package/lib/components/SkuOption.d.ts +1 -7
- package/lib/components/SkuOption.js +1 -1
- package/lib/components/SkuOptionInput.d.ts +1 -5
- package/lib/components/SkuOptionInput.js +1 -1
- package/lib/components/SkuOptionsContainer.d.ts +1 -7
- package/lib/components/SkuOptionsContainer.js +1 -1
- package/lib/components/StockTransfer.d.ts +1 -6
- package/lib/components/StockTransfer.js +1 -1
- package/lib/components/StockTransferField.d.ts +1 -9
- package/lib/components/StockTransferField.js +1 -1
- package/lib/components/StripePayment.d.ts +1 -18
- package/lib/components/StripePayment.js +1 -1
- package/lib/components/SubTotalAmount.d.ts +1 -4
- package/lib/components/SubTotalAmount.js +1 -1
- package/lib/components/SubmitButton.d.ts +1 -9
- package/lib/components/SubmitButton.js +1 -1
- package/lib/components/TaxesAmount.d.ts +1 -4
- package/lib/components/TaxesAmount.js +1 -1
- package/lib/components/TotalAmount.d.ts +1 -4
- package/lib/components/TotalAmount.js +1 -1
- package/lib/components/VariantSelector.d.ts +1 -29
- package/lib/components/VariantSelector.js +1 -1
- package/lib/components/VariantsContainer.d.ts +1 -8
- package/lib/components/VariantsContainer.js +1 -1
- package/lib/components/WireTransferPayment.d.ts +1 -10
- package/lib/components/WireTransferPayment.js +1 -1
- package/lib/components/gateways/AdyenGateway.d.ts +1 -4
- package/lib/components/gateways/AdyenGateway.js +1 -1
- package/lib/components/gateways/BraintreeGateway.d.ts +1 -4
- package/lib/components/gateways/BraintreeGateway.js +1 -1
- package/lib/components/gateways/CheckoutComGateway.d.ts +1 -4
- package/lib/components/gateways/CheckoutComGateway.js +1 -1
- package/lib/components/gateways/PaypalGateway.d.ts +1 -4
- package/lib/components/gateways/PaypalGateway.js +1 -1
- package/lib/components/gateways/StripeGateway.d.ts +1 -4
- package/lib/components/gateways/StripeGateway.js +1 -1
- package/lib/components/gateways/WireTransferGateway.d.ts +1 -4
- package/lib/components/gateways/WireTransferGateway.js +1 -1
- package/lib/components/utils/AddressCardsTemplate.d.ts +1 -26
- package/lib/components/utils/AddressCardsTemplate.js +1 -1
- package/lib/components/utils/BaseField.d.ts +1 -8
- package/lib/components/utils/BaseField.js +1 -1
- package/lib/components/utils/BaseInput.d.ts +1 -5
- package/lib/components/utils/BaseInput.js +1 -1
- package/lib/components/utils/BaseOrderPrice.d.ts +1 -6
- package/lib/components/utils/BaseOrderPrice.js +1 -1
- package/lib/components/utils/BaseSelect.d.ts +1 -5
- package/lib/components/utils/BaseSelect.js +1 -1
- package/lib/components/utils/Parent.d.ts +1 -8
- package/lib/components/utils/Parent.js +1 -1
- package/lib/components/utils/PaymentCardsTemplate.d.ts +1 -22
- package/lib/components/utils/PaymentCardsTemplate.js +1 -1
- package/lib/components/utils/PriceTemplate.d.ts +1 -8
- package/lib/components/utils/PriceTemplate.js +1 -1
- package/lib/components/utils/VariantTemplate.d.ts +1 -36
- package/lib/components/utils/VariantTemplate.js +1 -1
- package/lib/components/utils/getAllErrors.d.ts +1 -17
- package/lib/config/components.d.ts +1 -891
- package/lib/config/currency.d.ts +1 -5
- package/lib/context/AddressChildrenContext.d.ts +1 -6
- package/lib/context/AddressContext.d.ts +1 -16
- package/lib/context/AvailabilityContext.d.ts +1 -2
- package/lib/context/BillingAddressContext.d.ts +1 -11
- package/lib/context/BillingAddressFormContext.d.ts +1 -19
- package/lib/context/CommerceLayerContext.d.ts +1 -6
- package/lib/context/CouponAndGiftCardFormContext.d.ts +1 -7
- package/lib/context/CustomerContext.d.ts +1 -15
- package/lib/context/ExternalFunctionContext.d.ts +1 -11
- package/lib/context/GiftCardContext.d.ts +1 -10
- package/lib/context/ItemContext.d.ts +1 -12
- package/lib/context/LineItemChildrenContext.d.ts +1 -8
- package/lib/context/LineItemContext.d.ts +1 -7
- package/lib/context/LineItemOptionChildrenContext.d.ts +1 -7
- package/lib/context/OrderContext.d.ts +1 -25
- package/lib/context/OrderStorageContext.d.ts +1 -10
- package/lib/context/PaymentMethodChildrenContext.d.ts +1 -9
- package/lib/context/PaymentMethodContext.d.ts +1 -22
- package/lib/context/PaymentSourceContext.d.ts +1 -13
- package/lib/context/PlaceOrderContext.d.ts +1 -17
- package/lib/context/PricesContext.d.ts +1 -6
- package/lib/context/ShipmentChildrenContext.d.ts +1 -12
- package/lib/context/ShipmentContext.d.ts +1 -11
- package/lib/context/ShippingAddressContext.d.ts +1 -9
- package/lib/context/ShippingAddressFormContext.d.ts +1 -3
- package/lib/context/ShippingMethodChildrenContext.d.ts +1 -9
- package/lib/context/SkuListsContext.d.ts +1 -5
- package/lib/context/SkuOptionChildrenContext.d.ts +1 -7
- package/lib/context/SkuOptionsContext.d.ts +1 -2
- package/lib/context/StockTransferChildrenContext.d.ts +1 -6
- package/lib/context/VariantsContext.d.ts +1 -2
- package/lib/index.d.ts +1 -99
- package/lib/reducers/AddressReducer.d.ts +1 -59
- package/lib/reducers/AvailabilityReducer.d.ts +1 -53
- package/lib/reducers/BillingAddressReducer.d.ts +1 -31
- package/lib/reducers/CustomerReducer.d.ts +1 -50
- package/lib/reducers/CustomerReducer.js +1 -1
- package/lib/reducers/GiftCardReducer.d.ts +1 -76
- package/lib/reducers/ItemReducer.d.ts +1 -69
- package/lib/reducers/LineItemReducer.d.ts +1 -52
- package/lib/reducers/OrderReducer.d.ts +2 -121
- package/lib/reducers/PaymentMethodReducer.d.ts +1 -145
- package/lib/reducers/PlaceOrderReducer.d.ts +1 -57
- package/lib/reducers/PriceReducer.d.ts +1 -44
- package/lib/reducers/ShipmentReducer.d.ts +1 -40
- package/lib/reducers/ShippingAddressReducer.d.ts +1 -32
- package/lib/reducers/SkuListsReducer.d.ts +1 -21
- package/lib/reducers/SkuOptionsReducer.d.ts +1 -26
- package/lib/reducers/VariantReducer.d.ts +1 -71
- package/lib/typings/errors.d.ts +1 -42
- package/lib/typings/index.d.ts +1 -127
- package/lib/utils/PropsType.d.ts +1 -33
- package/lib/utils/addressesManager.d.ts +1 -28
- package/lib/utils/baseReducer.d.ts +1 -3
- package/lib/utils/browserInfo.d.ts +1 -9
- package/lib/utils/childrenTypes.d.ts +1 -9
- package/lib/utils/countryStateCity.d.ts +1 -9
- package/lib/utils/customMessages.d.ts +1 -8
- package/lib/utils/customerOrderOptions.d.ts +1 -3
- package/lib/utils/getAmount.d.ts +1 -9
- package/lib/utils/getCardDetails.d.ts +1 -15
- package/lib/utils/getCurrentItemKey.d.ts +1 -6
- package/lib/utils/getErrors.d.ts +1 -11
- package/lib/utils/getLineItemsCount.d.ts +1 -12
- package/lib/utils/getLoaderComponent.d.ts +1 -2
- package/lib/utils/getLoaderComponent.js +1 -1
- package/lib/utils/getPrices.d.ts +1 -17
- package/lib/utils/getPrices.js +1 -1
- package/lib/utils/getSdk.d.ts +1 -3
- package/lib/utils/getSkus.d.ts +1 -3
- 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 +1 -27
- package/lib/utils/localStorage.d.ts +1 -17
- package/lib/utils/organization.d.ts +1 -6
- package/lib/utils/paypalPayment.d.ts +1 -3
- package/lib/utils/promisify.d.ts +1 -1
- package/lib/utils/shipments.d.ts +1 -2
- package/lib/utils/validateFormFields.d.ts +1 -22
- package/package.json +21 -21
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__rest}from"tslib";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";import{useContext,useEffect,useRef,useState}from"react";import PaymentMethodContext from"../context/PaymentMethodContext";import{CardElement,Elements,useElements,useStripe}from"@stripe/react-stripe-js";import Parent from"./utils/Parent";import OrderContext from"../context/OrderContext";import{setCustomerOrderParam}from"../utils/localStorage";const defaultOptions={style:{base:{fontSize:"16px",color:"#424770","::placeholder":{color:"#aab7c4"}},invalid:{color:"#9e2146"}},hidePostalCode:!0},StripePaymentForm=({options=defaultOptions,templateCustomerSaveToWallet})=>{const ref=useRef(null),{setPaymentSource,paymentSource,currentPaymentMethodType,setPaymentMethodErrors,setPaymentRef}=useContext(PaymentMethodContext),{order}=useContext(OrderContext),stripe=useStripe(),elements=useElements();useEffect(()=>(ref.current&&stripe&&elements&&(ref.current.onsubmit=()=>onSubmit(ref.current,stripe,elements),setPaymentRef({ref})),()=>{setPaymentRef({ref:{current:null}})}),[ref,stripe,elements]);const onSubmit=async(event,stripe2,elements2)=>{var _a,_b;if(!stripe2)return!1;const savePaymentSourceToCustomerWallet=(_b=(_a=event==null?void 0:event.elements)===null||_a===void 0?void 0:_a.save_payment_source_to_customer_wallet)===null||_b===void 0?void 0:_b.checked;savePaymentSourceToCustomerWallet&&setCustomerOrderParam("_save_payment_source_to_customer_wallet",savePaymentSourceToCustomerWallet);const cardElement=elements2&&elements2.getElement(CardElement);if(cardElement){const billingInfo=order==null?void 0:order.billing_address,email=order==null?void 0:order.customer_email,billing_details={name:billingInfo==null?void 0:billingInfo.full_name,email,phone:billingInfo==null?void 0:billingInfo.phone,address:{city:billingInfo==null?void 0:billingInfo.city,country:billingInfo==null?void 0:billingInfo.country_code,line1:billingInfo==null?void 0:billingInfo.line_1,postal_code:billingInfo==null?void 0:billingInfo.zip_code,state:billingInfo==null?void 0:billingInfo.state_code}},{paymentMethod}=await stripe2.createPaymentMethod({type:"card",card:cardElement,billing_details});if(paymentSource==null?void 0:paymentSource.client_secret){const{error,paymentIntent}=await stripe2.confirmCardPayment(paymentSource.client_secret,{payment_method:{card:cardElement,billing_details}});if(error)console.error(error),setPaymentMethodErrors([{code:"PAYMENT_INTENT_AUTHENTICATION_FAILURE",resource:"payment_methods",field:currentPaymentMethodType,message:error.message}]);else if(paymentIntent&&paymentMethod&&paymentSource&¤tPaymentMethodType)try{return await setPaymentSource({paymentSourceId:paymentSource.id,paymentResource:currentPaymentMethodType,attributes:{options:Object.assign(Object.assign({},paymentMethod),{setup_future_usage:"off_session"})}}),!0}catch{return!1}}}return!1};return _jsxs("form",Object.assign({ref,onSubmit:e=>onSubmit(e,stripe,elements)},{children:[_jsx(CardElement,{options:Object.assign(Object.assign({},defaultOptions),options)}
|
|
1
|
+
import{__rest}from"tslib";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";import{useContext,useEffect,useRef,useState}from"react";import PaymentMethodContext from"../context/PaymentMethodContext";import{CardElement,Elements,useElements,useStripe}from"@stripe/react-stripe-js";import Parent from"./utils/Parent";import OrderContext from"../context/OrderContext";import{setCustomerOrderParam}from"../utils/localStorage";const defaultOptions={style:{base:{fontSize:"16px",color:"#424770","::placeholder":{color:"#aab7c4"}},invalid:{color:"#9e2146"}},hidePostalCode:!0},StripePaymentForm=({options=defaultOptions,templateCustomerSaveToWallet})=>{const ref=useRef(null),{setPaymentSource,paymentSource,currentPaymentMethodType,setPaymentMethodErrors,setPaymentRef}=useContext(PaymentMethodContext),{order}=useContext(OrderContext),stripe=useStripe(),elements=useElements();useEffect(()=>(ref.current&&stripe&&elements&&(ref.current.onsubmit=()=>onSubmit(ref.current,stripe,elements),setPaymentRef({ref})),()=>{setPaymentRef({ref:{current:null}})}),[ref,stripe,elements]);const onSubmit=async(event,stripe2,elements2)=>{var _a,_b;if(!stripe2)return!1;const savePaymentSourceToCustomerWallet=(_b=(_a=event==null?void 0:event.elements)===null||_a===void 0?void 0:_a.save_payment_source_to_customer_wallet)===null||_b===void 0?void 0:_b.checked;savePaymentSourceToCustomerWallet&&setCustomerOrderParam("_save_payment_source_to_customer_wallet",savePaymentSourceToCustomerWallet);const cardElement=elements2&&elements2.getElement(CardElement);if(cardElement){const billingInfo=order==null?void 0:order.billing_address,email=order==null?void 0:order.customer_email,billing_details={name:billingInfo==null?void 0:billingInfo.full_name,email,phone:billingInfo==null?void 0:billingInfo.phone,address:{city:billingInfo==null?void 0:billingInfo.city,country:billingInfo==null?void 0:billingInfo.country_code,line1:billingInfo==null?void 0:billingInfo.line_1,postal_code:billingInfo==null?void 0:billingInfo.zip_code,state:billingInfo==null?void 0:billingInfo.state_code}},{paymentMethod}=await stripe2.createPaymentMethod({type:"card",card:cardElement,billing_details});if(paymentSource==null?void 0:paymentSource.client_secret){const{error,paymentIntent}=await stripe2.confirmCardPayment(paymentSource.client_secret,{payment_method:{card:cardElement,billing_details}});if(error)console.error(error),setPaymentMethodErrors([{code:"PAYMENT_INTENT_AUTHENTICATION_FAILURE",resource:"payment_methods",field:currentPaymentMethodType,message:error.message}]);else if(paymentIntent&&paymentMethod&&paymentSource&¤tPaymentMethodType)try{return await setPaymentSource({paymentSourceId:paymentSource.id,paymentResource:currentPaymentMethodType,attributes:{options:Object.assign(Object.assign({},paymentMethod),{setup_future_usage:"off_session"})}}),!0}catch{return!1}}}return!1};return _jsxs("form",Object.assign({ref,onSubmit:e=>onSubmit(e,stripe,elements)},{children:[_jsx(CardElement,{options:Object.assign(Object.assign({},defaultOptions),options)}),templateCustomerSaveToWallet&&_jsx(Parent,Object.assign({},{name:"save_payment_source_to_customer_wallet"},{children:templateCustomerSaveToWallet}))]}))},StripePayment=_a=>{var{publishableKey,show,options,locale="auto"}=_a,p=__rest(_a,["publishableKey","show","options","locale"]);const[isLoaded,setIsLoaded]=useState(!1),[stripe,setStripe]=useState(null),{containerClassName,templateCustomerSaveToWallet,fonts=[]}=p,divProps=__rest(p,["containerClassName","templateCustomerSaveToWallet","fonts"]);return useEffect(()=>{if(show&&publishableKey){const{loadStripe}=require("@stripe/stripe-js");(async()=>{const res=await loadStripe(publishableKey,{locale});setStripe(res),setIsLoaded(!0)})()}return()=>{setIsLoaded(!1)}},[show,publishableKey]),isLoaded&&stripe?_jsx("div",Object.assign({className:containerClassName},divProps,{children:_jsx(Elements,Object.assign({stripe,options:{fonts}},{children:_jsx(StripePaymentForm,{options,templateCustomerSaveToWallet})}))})):null};export default StripePayment;
|
|
@@ -1,4 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { BaseAmountComponent } from '../typings/index';
|
|
3
|
-
declare const SubTotalAmount: FunctionComponent<BaseAmountComponent>;
|
|
4
|
-
export default SubTotalAmount;
|
|
1
|
+
import{FunctionComponent}from'react';import{BaseAmountComponent}from'../typings/index';declare const SubTotalAmount:FunctionComponent<BaseAmountComponent>;export default SubTotalAmount;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as _jsx}from"react/jsx-runtime";import BaseOrderPrice from"./utils/BaseOrderPrice";import components from"../config/components";const propTypes=components.SubTotalAmount.propTypes,defaultProps=components.SubTotalAmount.defaultProps,displayName=components.SubTotalAmount.displayName,SubTotalAmount=props=>_jsx(BaseOrderPrice,Object.assign({base:"amount",type:"subtotal"},props)
|
|
1
|
+
import{jsx as _jsx}from"react/jsx-runtime";import BaseOrderPrice from"./utils/BaseOrderPrice";import components from"../config/components";const propTypes=components.SubTotalAmount.propTypes,defaultProps=components.SubTotalAmount.defaultProps,displayName=components.SubTotalAmount.displayName,SubTotalAmount=props=>_jsx(BaseOrderPrice,Object.assign({base:"amount",type:"subtotal"},props));SubTotalAmount.propTypes=propTypes,SubTotalAmount.defaultProps=defaultProps,SubTotalAmount.displayName=displayName;export default SubTotalAmount;
|
|
@@ -1,9 +1 @@
|
|
|
1
|
-
import
|
|
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
|
+
import{FunctionComponent,ReactNode}from'react';import{FunctionChildren}from'../typings/index';declare type SubmitButtonChildrenProps=FunctionChildren<Omit<SubmitButtonProps,'children'>>;declare type SubmitButtonProps={children?:SubmitButtonChildrenProps;label?:string|ReactNode;}&JSX.IntrinsicElements['button'];declare const SubmitButton:FunctionComponent<SubmitButtonProps>;export default SubmitButton;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__rest}from"tslib";import{jsx as _jsx}from"react/jsx-runtime";import Parent from"./utils/Parent";import components from"../config/components";import isFunction from"lodash/isFunction";const propTypes=components.SubmitButton.propTypes,defaultProps=components.SubmitButton.defaultProps,displayName=components.SubmitButton.displayName,SubmitButton=props=>{const{children,label="Submit"}=props,p=__rest(props,["children","label"]),parentProps=Object.assign(Object.assign({},p),{label});return children?_jsx(Parent,Object.assign({},parentProps,{children})
|
|
1
|
+
import{__rest}from"tslib";import{jsx as _jsx}from"react/jsx-runtime";import Parent from"./utils/Parent";import components from"../config/components";import isFunction from"lodash/isFunction";const propTypes=components.SubmitButton.propTypes,defaultProps=components.SubmitButton.defaultProps,displayName=components.SubmitButton.displayName,SubmitButton=props=>{const{children,label="Submit"}=props,p=__rest(props,["children","label"]),parentProps=Object.assign(Object.assign({},p),{label});return children?_jsx(Parent,Object.assign({},parentProps,{children})):_jsx("button",Object.assign({type:"submit"},p,{children:isFunction(label)?label():label}))};SubmitButton.propTypes=propTypes,SubmitButton.defaultProps=defaultProps,SubmitButton.displayName=displayName;export default SubmitButton;
|
|
@@ -1,4 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { BaseAmountComponent } from '../typings/index';
|
|
3
|
-
declare const TaxesAmount: FunctionComponent<BaseAmountComponent>;
|
|
4
|
-
export default TaxesAmount;
|
|
1
|
+
import{FunctionComponent}from'react';import{BaseAmountComponent}from'../typings/index';declare const TaxesAmount:FunctionComponent<BaseAmountComponent>;export default TaxesAmount;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as _jsx}from"react/jsx-runtime";import BaseOrderPrice from"./utils/BaseOrderPrice";import components from"../config/components";const propTypes=components.TaxesAmount.propTypes,defaultProps=components.TaxesAmount.defaultProps,displayName=components.TaxesAmount.displayName,TaxesAmount=props=>_jsx(BaseOrderPrice,Object.assign({base:"amount",type:"total_tax"},props)
|
|
1
|
+
import{jsx as _jsx}from"react/jsx-runtime";import BaseOrderPrice from"./utils/BaseOrderPrice";import components from"../config/components";const propTypes=components.TaxesAmount.propTypes,defaultProps=components.TaxesAmount.defaultProps,displayName=components.TaxesAmount.displayName,TaxesAmount=props=>_jsx(BaseOrderPrice,Object.assign({base:"amount",type:"total_tax"},props));TaxesAmount.propTypes=propTypes,TaxesAmount.defaultProps=defaultProps,TaxesAmount.displayName=displayName;export default TaxesAmount;
|
|
@@ -1,4 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { BaseAmountComponent } from '../typings/index';
|
|
3
|
-
declare const TotalAmount: FunctionComponent<BaseAmountComponent>;
|
|
4
|
-
export default TotalAmount;
|
|
1
|
+
import{FunctionComponent}from'react';import{BaseAmountComponent}from'../typings/index';declare const TotalAmount:FunctionComponent<BaseAmountComponent>;export default TotalAmount;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as _jsx}from"react/jsx-runtime";import BaseOrderPrice from"./utils/BaseOrderPrice";import components from"../config/components";const propTypes=components.TotalAmount.propTypes,defaultProps=components.TotalAmount.defaultProps,displayName=components.TotalAmount.displayName,TotalAmount=props=>_jsx(BaseOrderPrice,Object.assign({base:"total_amount",type:"with_taxes"},props)
|
|
1
|
+
import{jsx as _jsx}from"react/jsx-runtime";import BaseOrderPrice from"./utils/BaseOrderPrice";import components from"../config/components";const propTypes=components.TotalAmount.propTypes,defaultProps=components.TotalAmount.defaultProps,displayName=components.TotalAmount.displayName,TotalAmount=props=>_jsx(BaseOrderPrice,Object.assign({base:"total_amount",type:"with_taxes"},props));TotalAmount.propTypes=propTypes,TotalAmount.defaultProps=defaultProps,TotalAmount.displayName=displayName;export default TotalAmount;
|
|
@@ -1,29 +1 @@
|
|
|
1
|
-
import
|
|
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
|
+
import{FunctionComponent,ReactNode}from'react';import{VariantHandleCallback}from'./utils/VariantTemplate';import{BaseSelectorType}from'../typings/index';import{FunctionChildren}from'../typings/index';import{VariantsObject,SetSkuCode}from'../reducers/VariantReducer';export interface VariantOption{label:string;code:string;lineItem?:{name:string;imageUrl?:string|null;}|null;}declare type VariantSelectorChildrenProps=FunctionChildren<Omit<VariantSelectorProps,'children'>&{variants:VariantsObject;handleSelect:SetSkuCode;loading:boolean;}>;declare type VariantSelectorProps={children?:VariantSelectorChildrenProps;options:VariantOption[];type?:BaseSelectorType;loader?:ReactNode;placeholder?:string;skuCode?:string;handleCallback?:VariantHandleCallback;}&JSX.IntrinsicElements['input']&JSX.IntrinsicElements['select'];declare const VariantSelector:FunctionComponent<VariantSelectorProps>;export default VariantSelector;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__rest}from"tslib";import{jsx as _jsx}from"react/jsx-runtime";import{Fragment,useContext,useEffect}from"react";import VariantTemplate from"./utils/VariantTemplate";import Parent from"./utils/Parent";import VariantsContext from"../context/VariantsContext";import components from"../config/components";const propTypes=components.VariantSelector.propTypes,defaultProps=components.VariantSelector.defaultProps,displayName=components.VariantSelector.displayName,VariantSelector=props=>{const{children,type,placeholder,skuCode,name,options}=props,prs=__rest(props,["children","type","placeholder","skuCode","name","options"]),{setSkuCode,skuCode:variantSkuCode,loading,variants,setSkuCodes}=useContext(VariantsContext);useEffect(()=>(setSkuCodes&&setSkuCodes(options),()=>{setSkuCodes&&setSkuCodes([])}),[options]);const sCode=variantSkuCode||skuCode||"",DefaultTemplate=()=>loading?_jsx(Fragment,{children:props.loader||"Loading..."}
|
|
1
|
+
import{__rest}from"tslib";import{jsx as _jsx}from"react/jsx-runtime";import{Fragment,useContext,useEffect}from"react";import VariantTemplate from"./utils/VariantTemplate";import Parent from"./utils/Parent";import VariantsContext from"../context/VariantsContext";import components from"../config/components";const propTypes=components.VariantSelector.propTypes,defaultProps=components.VariantSelector.defaultProps,displayName=components.VariantSelector.displayName,VariantSelector=props=>{const{children,type,placeholder,skuCode,name,options}=props,prs=__rest(props,["children","type","placeholder","skuCode","name","options"]),{setSkuCode,skuCode:variantSkuCode,loading,variants,setSkuCodes}=useContext(VariantsContext);useEffect(()=>(setSkuCodes&&setSkuCodes(options),()=>{setSkuCodes&&setSkuCodes([])}),[options]);const sCode=variantSkuCode||skuCode||"",DefaultTemplate=()=>loading?_jsx(Fragment,{children:props.loader||"Loading..."}):_jsx(VariantTemplate,Object.assign({variants,type,placeholder,skuCode:sCode,options,handleChange:setSkuCode,name},prs)),parentProps=Object.assign({variants,loading:!!loading,handleSelect:setSkuCode,skuCode:sCode},props);return children?_jsx(Parent,Object.assign({},parentProps,{children})):_jsx(Fragment,{children:_jsx(DefaultTemplate,{})})};VariantSelector.propTypes=propTypes,VariantSelector.defaultProps=defaultProps,VariantSelector.displayName=displayName;export default VariantSelector;
|
|
@@ -1,8 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
declare type VariantsContainerProps = {
|
|
3
|
-
children: ReactNode;
|
|
4
|
-
filters?: Record<string, any>;
|
|
5
|
-
skuCode?: string;
|
|
6
|
-
};
|
|
7
|
-
declare const VariantsContainer: FunctionComponent<VariantsContainerProps>;
|
|
8
|
-
export default VariantsContainer;
|
|
1
|
+
import{FunctionComponent,ReactNode}from'react';declare type VariantsContainerProps={children:ReactNode;filters?:Record<string,any>;skuCode?:string;};declare const VariantsContainer:FunctionComponent<VariantsContainerProps>;export default VariantsContainer;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as _jsx}from"react/jsx-runtime";import{useEffect,useReducer,useContext}from"react";import variantReducer,{variantInitialState,unsetVariantState,setSkuCode,getVariants}from"../reducers/VariantReducer";import CommerceLayerContext from"../context/CommerceLayerContext";import VariantsContext from"../context/VariantsContext";import{setVariantSkuCodes}from"../reducers/VariantReducer";import{isEmpty,isEqual}from"lodash";import getCurrentItemKey from"../utils/getCurrentItemKey";import ItemContext from"../context/ItemContext";import components from"../config/components";const propTypes=components.VariantsContainer.propTypes,defaultProps=components.VariantsContainer.defaultProps,displayName=components.VariantsContainer.displayName,VariantsContainer=props=>{const{children,skuCode="",filters={}}=props,config=useContext(CommerceLayerContext),{setItem,setItems,items,item:currentItem,setCustomLineItems,skuCode:itemSkuCode}=useContext(ItemContext),[state,dispatch]=useReducer(variantReducer,variantInitialState),sCode=getCurrentItemKey(currentItem)||skuCode||state.skuCode||itemSkuCode||"";useEffect(()=>{if(!isEmpty(items)&&!isEmpty(state.variants)&&!isEqual(items,state.variants)){const mergeItems=Object.assign(Object.assign({},items),state.variants);setItems&&setItems(mergeItems)}return state.skuCodes.length>=1&&config.accessToken&&(dispatch({type:"setLoading",payload:{loading:!0}}),getVariants({config,state,dispatch,setItem,skuCode:sCode,filters})),()=>unsetVariantState(dispatch)},[config.accessToken]);const variantValue=Object.assign(Object.assign({},state),{skuCode:sCode,setSkuCode:(code,id,lineItem={})=>{isEmpty(lineItem)||setCustomLineItems&&setCustomLineItems({[code]:lineItem}),setSkuCode({code,id,config,setItem,dispatch})},setSkuCodes:skuCodes=>setVariantSkuCodes({skuCodes,dispatch,setCustomLineItems})});return _jsx(VariantsContext.Provider,Object.assign({value:variantValue},{children})
|
|
1
|
+
import{jsx as _jsx}from"react/jsx-runtime";import{useEffect,useReducer,useContext}from"react";import variantReducer,{variantInitialState,unsetVariantState,setSkuCode,getVariants}from"../reducers/VariantReducer";import CommerceLayerContext from"../context/CommerceLayerContext";import VariantsContext from"../context/VariantsContext";import{setVariantSkuCodes}from"../reducers/VariantReducer";import{isEmpty,isEqual}from"lodash";import getCurrentItemKey from"../utils/getCurrentItemKey";import ItemContext from"../context/ItemContext";import components from"../config/components";const propTypes=components.VariantsContainer.propTypes,defaultProps=components.VariantsContainer.defaultProps,displayName=components.VariantsContainer.displayName,VariantsContainer=props=>{const{children,skuCode="",filters={}}=props,config=useContext(CommerceLayerContext),{setItem,setItems,items,item:currentItem,setCustomLineItems,skuCode:itemSkuCode}=useContext(ItemContext),[state,dispatch]=useReducer(variantReducer,variantInitialState),sCode=getCurrentItemKey(currentItem)||skuCode||state.skuCode||itemSkuCode||"";useEffect(()=>{if(!isEmpty(items)&&!isEmpty(state.variants)&&!isEqual(items,state.variants)){const mergeItems=Object.assign(Object.assign({},items),state.variants);setItems&&setItems(mergeItems)}return state.skuCodes.length>=1&&config.accessToken&&(dispatch({type:"setLoading",payload:{loading:!0}}),getVariants({config,state,dispatch,setItem,skuCode:sCode,filters})),()=>unsetVariantState(dispatch)},[config.accessToken]);const variantValue=Object.assign(Object.assign({},state),{skuCode:sCode,setSkuCode:(code,id,lineItem={})=>{isEmpty(lineItem)||setCustomLineItems&&setCustomLineItems({[code]:lineItem}),setSkuCode({code,id,config,setItem,dispatch})},setSkuCodes:skuCodes=>setVariantSkuCodes({skuCodes,dispatch,setCustomLineItems})});return _jsx(VariantsContext.Provider,Object.assign({value:variantValue},{children}))};VariantsContainer.propTypes=propTypes,VariantsContainer.defaultProps=defaultProps,VariantsContainer.displayName=displayName;export default VariantsContainer;
|
|
@@ -1,10 +1 @@
|
|
|
1
|
-
import
|
|
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
|
+
import{FunctionComponent,ReactNode}from'react';export declare type WireTransferConfig={infoMessage?:{text?:string|ReactNode;className?:string;};};declare type Props=WireTransferConfig&JSX.IntrinsicElements['div'];declare const WireTransferPayment:FunctionComponent<Props>;export default WireTransferPayment;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__rest}from"tslib";import{jsx as _jsx}from"react/jsx-runtime";import PaymentMethodContext from"../context/PaymentMethodContext";import isFunction from"lodash/isFunction";import{useContext,useEffect,useRef}from"react";const defaultMessage="after placing the order, you will need to manually complete the payment with your bank",WireTransferPayment=_a=>{var{infoMessage}=_a,p=__rest(_a,["infoMessage"]);const ref=useRef(null),{setPaymentSource,paymentSource,currentPaymentMethodType,setPaymentRef}=useContext(PaymentMethodContext);useEffect(()=>(ref.current&&paymentSource&¤tPaymentMethodType&&(ref.current.onsubmit=()=>handleClick(),setPaymentRef({ref})),()=>{setPaymentRef({ref:{current:null}})}),[ref,paymentSource,currentPaymentMethodType]);const handleClick=async()=>{if(paymentSource&¤tPaymentMethodType)try{return await setPaymentSource({paymentSourceId:paymentSource.id,paymentResource:currentPaymentMethodType,attributes:{metadata:{card:{id:paymentSource.id,brand:"wire-transfer",last4:""}}}}),!0}catch{return!1}return!1};return _jsx("form",Object.assign({ref},{children:_jsx("div",Object.assign({},p,{children:_jsx("span",Object.assign({className:infoMessage==null?void 0:infoMessage.className},{children:isFunction(infoMessage==null?void 0:infoMessage.text)?infoMessage==null?void 0:infoMessage.text():(infoMessage==null?void 0:infoMessage.text)||defaultMessage})
|
|
1
|
+
import{__rest}from"tslib";import{jsx as _jsx}from"react/jsx-runtime";import PaymentMethodContext from"../context/PaymentMethodContext";import isFunction from"lodash/isFunction";import{useContext,useEffect,useRef}from"react";const defaultMessage="after placing the order, you will need to manually complete the payment with your bank",WireTransferPayment=_a=>{var{infoMessage}=_a,p=__rest(_a,["infoMessage"]);const ref=useRef(null),{setPaymentSource,paymentSource,currentPaymentMethodType,setPaymentRef}=useContext(PaymentMethodContext);useEffect(()=>(ref.current&&paymentSource&¤tPaymentMethodType&&(ref.current.onsubmit=()=>handleClick(),setPaymentRef({ref})),()=>{setPaymentRef({ref:{current:null}})}),[ref,paymentSource,currentPaymentMethodType]);const handleClick=async()=>{if(paymentSource&¤tPaymentMethodType)try{return await setPaymentSource({paymentSourceId:paymentSource.id,paymentResource:currentPaymentMethodType,attributes:{metadata:{card:{id:paymentSource.id,brand:"wire-transfer",last4:""}}}}),!0}catch{return!1}return!1};return _jsx("form",Object.assign({ref},{children:_jsx("div",Object.assign({},p,{children:_jsx("span",Object.assign({className:infoMessage==null?void 0:infoMessage.className},{children:isFunction(infoMessage==null?void 0:infoMessage.text)?infoMessage==null?void 0:infoMessage.text():(infoMessage==null?void 0:infoMessage.text)||defaultMessage}))}))}))};export default WireTransferPayment;
|
|
@@ -1,5 +1,2 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import
|
|
3
|
-
declare type AdyenGateway = GatewayBaseType;
|
|
4
|
-
export default function AdyenGateway(props: AdyenGateway): JSX.Element | null;
|
|
5
|
-
export {};
|
|
2
|
+
import{GatewayBaseType}from'../PaymentGateway';declare type AdyenGateway=GatewayBaseType;export default function AdyenGateway(props:AdyenGateway):JSX.Element|null;export{};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__rest}from"tslib";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";import CommerceLayerContext from"../../context/CommerceLayerContext";import CustomerContext from"../../context/CustomerContext";import OrderContext from"../../context/OrderContext";import PaymentMethodChildrenContext from"../../context/PaymentMethodChildrenContext";import PaymentMethodContext from"../../context/PaymentMethodContext";import PaymentSourceContext from"../../context/PaymentSourceContext";import{getPaymentConfig}from"../../reducers/PaymentMethodReducer";import isEmpty from"lodash/isEmpty";import{Fragment,useContext}from"react";import AdyenPayment from"../AdyenPayment";import PaymentCardsTemplate from"../utils/PaymentCardsTemplate";import jwt from"../../utils/jwt";export default function AdyenGateway(props){var _a;const{readonly,showCard,handleEditClick,children,templateCustomerCards,show,loading,onClickCustomerCards,loaderComponent,templateCustomerSaveToWallet}=props,p=__rest(props,["readonly","showCard","handleEditClick","children","templateCustomerCards","show","loading","onClickCustomerCards","loaderComponent","templateCustomerSaveToWallet"]),{order}=useContext(OrderContext),{accessToken}=useContext(CommerceLayerContext),{payment}=useContext(PaymentMethodChildrenContext),{payments,isGuest}=useContext(CustomerContext),{currentPaymentMethodId,config,paymentSource}=useContext(PaymentMethodContext),paymentResource="adyen_payments",locale=order==null?void 0:order.language_code;if(!readonly&&(payment==null?void 0:payment.id)!==currentPaymentMethodId)return null;const clientKey=paymentSource==null?void 0:paymentSource.public_key,environment=jwt(accessToken).test?"test":"live",adyenConfig=config?getPaymentConfig(paymentResource,config):{},customerPayments=!isEmpty(payments)&&payments?payments.filter(customerPayment=>{var _a2;return((_a2=customerPayment.payment_source)===null||_a2===void 0?void 0:_a2.type)==="adyen_payments"}):[];if(readonly||showCard){const card=(_a=paymentSource==null?void 0:paymentSource.payment_request_data)===null||_a===void 0?void 0:_a.payment_method,value=Object.assign(Object.assign({},card),{showCard,handleEditClick,readonly});return isEmpty(card)?null:_jsx(PaymentSourceContext.Provider,Object.assign({value},{children})
|
|
1
|
+
import{__rest}from"tslib";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";import CommerceLayerContext from"../../context/CommerceLayerContext";import CustomerContext from"../../context/CustomerContext";import OrderContext from"../../context/OrderContext";import PaymentMethodChildrenContext from"../../context/PaymentMethodChildrenContext";import PaymentMethodContext from"../../context/PaymentMethodContext";import PaymentSourceContext from"../../context/PaymentSourceContext";import{getPaymentConfig}from"../../reducers/PaymentMethodReducer";import isEmpty from"lodash/isEmpty";import{Fragment,useContext}from"react";import AdyenPayment from"../AdyenPayment";import PaymentCardsTemplate from"../utils/PaymentCardsTemplate";import jwt from"../../utils/jwt";export default function AdyenGateway(props){var _a;const{readonly,showCard,handleEditClick,children,templateCustomerCards,show,loading,onClickCustomerCards,loaderComponent,templateCustomerSaveToWallet}=props,p=__rest(props,["readonly","showCard","handleEditClick","children","templateCustomerCards","show","loading","onClickCustomerCards","loaderComponent","templateCustomerSaveToWallet"]),{order}=useContext(OrderContext),{accessToken}=useContext(CommerceLayerContext),{payment}=useContext(PaymentMethodChildrenContext),{payments,isGuest}=useContext(CustomerContext),{currentPaymentMethodId,config,paymentSource}=useContext(PaymentMethodContext),paymentResource="adyen_payments",locale=order==null?void 0:order.language_code;if(!readonly&&(payment==null?void 0:payment.id)!==currentPaymentMethodId)return null;const clientKey=paymentSource==null?void 0:paymentSource.public_key,environment=jwt(accessToken).test?"test":"live",adyenConfig=config?getPaymentConfig(paymentResource,config):{},customerPayments=!isEmpty(payments)&&payments?payments.filter(customerPayment=>{var _a2;return((_a2=customerPayment.payment_source)===null||_a2===void 0?void 0:_a2.type)==="adyen_payments"}):[];if(readonly||showCard){const card=(_a=paymentSource==null?void 0:paymentSource.payment_request_data)===null||_a===void 0?void 0:_a.payment_method,value=Object.assign(Object.assign({},card),{showCard,handleEditClick,readonly});return isEmpty(card)?null:_jsx(PaymentSourceContext.Provider,Object.assign({value},{children}))}return!isGuest&&templateCustomerCards?clientKey&&!loading&&(paymentSource==null?void 0:paymentSource.payment_methods)?_jsxs(Fragment,{children:[isEmpty(customerPayments)?null:_jsx("div",Object.assign({className:p.className},{children:_jsx(PaymentCardsTemplate,Object.assign({},{paymentResource,customerPayments},{children:templateCustomerCards}))})),_jsx(AdyenPayment,{templateCustomerSaveToWallet,clientKey,locale,environment,config:adyenConfig})]}):loaderComponent:clientKey&&!loading&&(paymentSource==null?void 0:paymentSource.payment_methods)?_jsx(AdyenPayment,{clientKey,locale,config:adyenConfig}):loaderComponent}
|
|
@@ -1,5 +1,2 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import
|
|
3
|
-
declare type BraintreeGateway = GatewayBaseType;
|
|
4
|
-
export default function BraintreeGateway(props: BraintreeGateway): JSX.Element | null;
|
|
5
|
-
export {};
|
|
2
|
+
import{GatewayBaseType}from'../PaymentGateway';declare type BraintreeGateway=GatewayBaseType;export default function BraintreeGateway(props:BraintreeGateway):JSX.Element|null;export{};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__rest}from"tslib";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";import BraintreePayment from"../BraintreePayment";import CustomerContext from"../../context/CustomerContext";import OrderContext from"../../context/OrderContext";import PaymentMethodChildrenContext from"../../context/PaymentMethodChildrenContext";import PaymentMethodContext from"../../context/PaymentMethodContext";import PaymentSourceContext from"../../context/PaymentSourceContext";import{getPaymentConfig}from"../../reducers/PaymentMethodReducer";import isEmpty from"lodash/isEmpty";import{Fragment,useContext}from"react";import PaymentCardsTemplate from"../utils/PaymentCardsTemplate";export default function BraintreeGateway(props){var _a;const{readonly,showCard,handleEditClick,children,templateCustomerCards,show,loading,onClickCustomerCards,loaderComponent,templateCustomerSaveToWallet}=props,p=__rest(props,["readonly","showCard","handleEditClick","children","templateCustomerCards","show","loading","onClickCustomerCards","loaderComponent","templateCustomerSaveToWallet"]),{order}=useContext(OrderContext),{payment}=useContext(PaymentMethodChildrenContext),{payments,isGuest}=useContext(CustomerContext),{currentPaymentMethodId,config,paymentSource}=useContext(PaymentMethodContext),paymentResource="braintree_payments",locale=order==null?void 0:order.language_code;if(!readonly&&(payment==null?void 0:payment.id)!==currentPaymentMethodId)return null;const authorization=paymentSource==null?void 0:paymentSource.client_token,braintreeConfig=config?getPaymentConfig(paymentResource,config):{},customerPayments=!isEmpty(payments)&&payments?payments.filter(customerPayment=>{var _a2;return((_a2=customerPayment.payment_source)===null||_a2===void 0?void 0:_a2.type)==="braintree_payments"}):[];if(readonly||showCard){const card=(_a=paymentSource==null?void 0:paymentSource.options)===null||_a===void 0?void 0:_a.card,value=Object.assign(Object.assign({},card),{showCard,handleEditClick,readonly});return isEmpty(card)?null:_jsx(PaymentSourceContext.Provider,Object.assign({value},{children})
|
|
1
|
+
import{__rest}from"tslib";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";import BraintreePayment from"../BraintreePayment";import CustomerContext from"../../context/CustomerContext";import OrderContext from"../../context/OrderContext";import PaymentMethodChildrenContext from"../../context/PaymentMethodChildrenContext";import PaymentMethodContext from"../../context/PaymentMethodContext";import PaymentSourceContext from"../../context/PaymentSourceContext";import{getPaymentConfig}from"../../reducers/PaymentMethodReducer";import isEmpty from"lodash/isEmpty";import{Fragment,useContext}from"react";import PaymentCardsTemplate from"../utils/PaymentCardsTemplate";export default function BraintreeGateway(props){var _a;const{readonly,showCard,handleEditClick,children,templateCustomerCards,show,loading,onClickCustomerCards,loaderComponent,templateCustomerSaveToWallet}=props,p=__rest(props,["readonly","showCard","handleEditClick","children","templateCustomerCards","show","loading","onClickCustomerCards","loaderComponent","templateCustomerSaveToWallet"]),{order}=useContext(OrderContext),{payment}=useContext(PaymentMethodChildrenContext),{payments,isGuest}=useContext(CustomerContext),{currentPaymentMethodId,config,paymentSource}=useContext(PaymentMethodContext),paymentResource="braintree_payments",locale=order==null?void 0:order.language_code;if(!readonly&&(payment==null?void 0:payment.id)!==currentPaymentMethodId)return null;const authorization=paymentSource==null?void 0:paymentSource.client_token,braintreeConfig=config?getPaymentConfig(paymentResource,config):{},customerPayments=!isEmpty(payments)&&payments?payments.filter(customerPayment=>{var _a2;return((_a2=customerPayment.payment_source)===null||_a2===void 0?void 0:_a2.type)==="braintree_payments"}):[];if(readonly||showCard){const card=(_a=paymentSource==null?void 0:paymentSource.options)===null||_a===void 0?void 0:_a.card,value=Object.assign(Object.assign({},card),{showCard,handleEditClick,readonly});return isEmpty(card)?null:_jsx(PaymentSourceContext.Provider,Object.assign({value},{children}))}return!isGuest&&templateCustomerCards?authorization&&!loading?_jsxs(Fragment,{children:[isEmpty(customerPayments)?null:_jsx("div",Object.assign({className:p.className},{children:_jsx(PaymentCardsTemplate,Object.assign({},{paymentResource,customerPayments},{children:templateCustomerCards}))})),_jsx(BraintreePayment,{templateCustomerSaveToWallet,authorization,locale,config:braintreeConfig})]}):loaderComponent:authorization&&!loading?_jsx(BraintreePayment,{locale,authorization,config:braintreeConfig}):loaderComponent}
|
|
@@ -1,5 +1,2 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import
|
|
3
|
-
declare type CheckoutComGateway = GatewayBaseType;
|
|
4
|
-
export default function CheckoutComGateway(props: CheckoutComGateway): JSX.Element | null;
|
|
5
|
-
export {};
|
|
2
|
+
import{GatewayBaseType}from'../PaymentGateway';declare type CheckoutComGateway=GatewayBaseType;export default function CheckoutComGateway(props:CheckoutComGateway):JSX.Element|null;export{};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__rest}from"tslib";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";import CheckoutComPayment from"../CheckoutComPayment";import CustomerContext from"../../context/CustomerContext";import OrderContext from"../../context/OrderContext";import PaymentMethodChildrenContext from"../../context/PaymentMethodChildrenContext";import PaymentMethodContext from"../../context/PaymentMethodContext";import PaymentSourceContext from"../../context/PaymentSourceContext";import{getPaymentConfig}from"../../reducers/PaymentMethodReducer";import isEmpty from"lodash/isEmpty";import{Fragment,useContext}from"react";import PaymentCardsTemplate from"../utils/PaymentCardsTemplate";import getCardDetails from"../../utils/getCardDetails";export default function CheckoutComGateway(props){const{readonly,showCard,handleEditClick,children,templateCustomerCards,show,loading,loaderComponent,templateCustomerSaveToWallet}=props,p=__rest(props,["readonly","showCard","handleEditClick","children","templateCustomerCards","show","loading","loaderComponent","templateCustomerSaveToWallet"]),{order}=useContext(OrderContext),{payment}=useContext(PaymentMethodChildrenContext),{payments,isGuest}=useContext(CustomerContext),{currentPaymentMethodId,config,paymentSource}=useContext(PaymentMethodContext),paymentResource="checkout_com_payments",locale=order==null?void 0:order.language_code;if(!readonly&&(payment==null?void 0:payment.id)!==currentPaymentMethodId)return null;const publicKey=paymentSource==null?void 0:paymentSource.public_key,paymentConfig=config?getPaymentConfig(paymentResource,config):{},customerPayments=!isEmpty(payments)&&payments?payments.filter(customerPayment=>{var _a;return((_a=customerPayment.payment_source)===null||_a===void 0?void 0:_a.type)===paymentResource}):[];if(readonly||showCard){const card=getCardDetails({customerPayment:{payment_source:paymentSource},paymentType:paymentResource}),value=Object.assign(Object.assign({},card),{showCard,handleEditClick,readonly});return card.brand?_jsx(PaymentSourceContext.Provider,Object.assign({value},{children})
|
|
1
|
+
import{__rest}from"tslib";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";import CheckoutComPayment from"../CheckoutComPayment";import CustomerContext from"../../context/CustomerContext";import OrderContext from"../../context/OrderContext";import PaymentMethodChildrenContext from"../../context/PaymentMethodChildrenContext";import PaymentMethodContext from"../../context/PaymentMethodContext";import PaymentSourceContext from"../../context/PaymentSourceContext";import{getPaymentConfig}from"../../reducers/PaymentMethodReducer";import isEmpty from"lodash/isEmpty";import{Fragment,useContext}from"react";import PaymentCardsTemplate from"../utils/PaymentCardsTemplate";import getCardDetails from"../../utils/getCardDetails";export default function CheckoutComGateway(props){const{readonly,showCard,handleEditClick,children,templateCustomerCards,show,loading,loaderComponent,templateCustomerSaveToWallet}=props,p=__rest(props,["readonly","showCard","handleEditClick","children","templateCustomerCards","show","loading","loaderComponent","templateCustomerSaveToWallet"]),{order}=useContext(OrderContext),{payment}=useContext(PaymentMethodChildrenContext),{payments,isGuest}=useContext(CustomerContext),{currentPaymentMethodId,config,paymentSource}=useContext(PaymentMethodContext),paymentResource="checkout_com_payments",locale=order==null?void 0:order.language_code;if(!readonly&&(payment==null?void 0:payment.id)!==currentPaymentMethodId)return null;const publicKey=paymentSource==null?void 0:paymentSource.public_key,paymentConfig=config?getPaymentConfig(paymentResource,config):{},customerPayments=!isEmpty(payments)&&payments?payments.filter(customerPayment=>{var _a;return((_a=customerPayment.payment_source)===null||_a===void 0?void 0:_a.type)===paymentResource}):[];if(readonly||showCard){const card=getCardDetails({customerPayment:{payment_source:paymentSource},paymentType:paymentResource}),value=Object.assign(Object.assign({},card),{showCard,handleEditClick,readonly});return card.brand?_jsx(PaymentSourceContext.Provider,Object.assign({value},{children})):null}return!isGuest&&templateCustomerCards?publicKey&&!loading?_jsxs(Fragment,{children:[isEmpty(customerPayments)?null:_jsx("div",Object.assign({className:p.className},{children:_jsx(PaymentCardsTemplate,Object.assign({},{paymentResource,customerPayments},{children:templateCustomerCards}))})),_jsx(CheckoutComPayment,Object.assign({show,templateCustomerSaveToWallet,publicKey,locale},paymentConfig))]}):loaderComponent:publicKey&&!loading?_jsx(CheckoutComPayment,Object.assign({show,publicKey,locale},paymentConfig)):loaderComponent}
|
|
@@ -1,5 +1,2 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import
|
|
3
|
-
declare type PaypalGateway = GatewayBaseType;
|
|
4
|
-
export default function PaypalGateway(props: PaypalGateway): JSX.Element | null;
|
|
5
|
-
export {};
|
|
2
|
+
import{GatewayBaseType}from'../PaymentGateway';declare type PaypalGateway=GatewayBaseType;export default function PaypalGateway(props:PaypalGateway):JSX.Element|null;export{};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__rest}from"tslib";import{jsx as _jsx}from"react/jsx-runtime";import PaypalPayment from"../PaypalPayment";import PaymentMethodChildrenContext from"../../context/PaymentMethodChildrenContext";import PaymentMethodContext from"../../context/PaymentMethodContext";import PaymentSourceContext from"../../context/PaymentSourceContext";import{getPaymentConfig}from"../../reducers/PaymentMethodReducer";import isEmpty from"lodash/isEmpty";import{useContext}from"react";export default function PaypalGateway(props){var _a,_b;const{readonly,showCard,handleEditClick,children,templateCustomerCards,show,loading,onClickCustomerCards,loaderComponent,templateCustomerSaveToWallet}=props,p=__rest(props,["readonly","showCard","handleEditClick","children","templateCustomerCards","show","loading","onClickCustomerCards","loaderComponent","templateCustomerSaveToWallet"]),{payment}=useContext(PaymentMethodChildrenContext),{currentPaymentMethodId,config,paymentSource}=useContext(PaymentMethodContext),paymentResource="paypal_payments";if(!readonly&&(payment==null?void 0:payment.id)!==currentPaymentMethodId)return null;if(readonly||showCard){const card=((_a=paymentSource==null?void 0:paymentSource.options)===null||_a===void 0?void 0:_a.card)||((_b=paymentSource==null?void 0:paymentSource.metadata)===null||_b===void 0?void 0:_b.card),value=Object.assign(Object.assign({},card),{showCard,handleEditClick,readonly});return isEmpty(card)?null:_jsx(PaymentSourceContext.Provider,Object.assign({value},{children})
|
|
1
|
+
import{__rest}from"tslib";import{jsx as _jsx}from"react/jsx-runtime";import PaypalPayment from"../PaypalPayment";import PaymentMethodChildrenContext from"../../context/PaymentMethodChildrenContext";import PaymentMethodContext from"../../context/PaymentMethodContext";import PaymentSourceContext from"../../context/PaymentSourceContext";import{getPaymentConfig}from"../../reducers/PaymentMethodReducer";import isEmpty from"lodash/isEmpty";import{useContext}from"react";export default function PaypalGateway(props){var _a,_b;const{readonly,showCard,handleEditClick,children,templateCustomerCards,show,loading,onClickCustomerCards,loaderComponent,templateCustomerSaveToWallet}=props,p=__rest(props,["readonly","showCard","handleEditClick","children","templateCustomerCards","show","loading","onClickCustomerCards","loaderComponent","templateCustomerSaveToWallet"]),{payment}=useContext(PaymentMethodChildrenContext),{currentPaymentMethodId,config,paymentSource}=useContext(PaymentMethodContext),paymentResource="paypal_payments";if(!readonly&&(payment==null?void 0:payment.id)!==currentPaymentMethodId)return null;if(readonly||showCard){const card=((_a=paymentSource==null?void 0:paymentSource.options)===null||_a===void 0?void 0:_a.card)||((_b=paymentSource==null?void 0:paymentSource.metadata)===null||_b===void 0?void 0:_b.card),value=Object.assign(Object.assign({},card),{showCard,handleEditClick,readonly});return isEmpty(card)?null:_jsx(PaymentSourceContext.Provider,Object.assign({value},{children}))}const paypalConfig=config&&getPaymentConfig(paymentResource,config);return _jsx(PaypalPayment,Object.assign({},p,{infoMessage:paypalConfig==null?void 0:paypalConfig.infoMessage}))}
|
|
@@ -1,5 +1,2 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import
|
|
3
|
-
declare type StripeGateway = GatewayBaseType;
|
|
4
|
-
export default function StripeGateway(props: StripeGateway): JSX.Element | null;
|
|
5
|
-
export {};
|
|
2
|
+
import{GatewayBaseType}from'../PaymentGateway';declare type StripeGateway=GatewayBaseType;export default function StripeGateway(props:StripeGateway):JSX.Element|null;export{};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__rest}from"tslib";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";import StripePayment from"../StripePayment";import CustomerContext from"../../context/CustomerContext";import OrderContext from"../../context/OrderContext";import PaymentMethodChildrenContext from"../../context/PaymentMethodChildrenContext";import PaymentMethodContext from"../../context/PaymentMethodContext";import PaymentSourceContext from"../../context/PaymentSourceContext";import{getPaymentConfig}from"../../reducers/PaymentMethodReducer";import isEmpty from"lodash/isEmpty";import{Fragment,useContext}from"react";import PaymentCardsTemplate from"../utils/PaymentCardsTemplate";export default function StripeGateway(props){var _a;const{readonly,showCard,handleEditClick,children,templateCustomerCards,show,loading,onClickCustomerCards,loaderComponent,templateCustomerSaveToWallet}=props,p=__rest(props,["readonly","showCard","handleEditClick","children","templateCustomerCards","show","loading","onClickCustomerCards","loaderComponent","templateCustomerSaveToWallet"]),{order}=useContext(OrderContext),{payment}=useContext(PaymentMethodChildrenContext),{payments,isGuest}=useContext(CustomerContext),{currentPaymentMethodId,config,paymentSource}=useContext(PaymentMethodContext),paymentResource="stripe_payments",locale=order==null?void 0:order.language_code;if(!readonly&&(payment==null?void 0:payment.id)!==currentPaymentMethodId)return null;const publishableKey=paymentSource==null?void 0:paymentSource.publishable_key,stripeConfig=config?getPaymentConfig(paymentResource,config):{},customerPayments=!isEmpty(payments)&&payments?payments.filter(customerPayment=>{var _a2;return((_a2=customerPayment.payment_source)===null||_a2===void 0?void 0:_a2.type)==="stripe_payments"}):[];if(readonly||showCard){const card=(_a=paymentSource==null?void 0:paymentSource.options)===null||_a===void 0?void 0:_a.card,value=Object.assign(Object.assign({},card),{showCard,handleEditClick,readonly});return isEmpty(card)?null:_jsx(PaymentSourceContext.Provider,Object.assign({value},{children})
|
|
1
|
+
import{__rest}from"tslib";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";import StripePayment from"../StripePayment";import CustomerContext from"../../context/CustomerContext";import OrderContext from"../../context/OrderContext";import PaymentMethodChildrenContext from"../../context/PaymentMethodChildrenContext";import PaymentMethodContext from"../../context/PaymentMethodContext";import PaymentSourceContext from"../../context/PaymentSourceContext";import{getPaymentConfig}from"../../reducers/PaymentMethodReducer";import isEmpty from"lodash/isEmpty";import{Fragment,useContext}from"react";import PaymentCardsTemplate from"../utils/PaymentCardsTemplate";export default function StripeGateway(props){var _a;const{readonly,showCard,handleEditClick,children,templateCustomerCards,show,loading,onClickCustomerCards,loaderComponent,templateCustomerSaveToWallet}=props,p=__rest(props,["readonly","showCard","handleEditClick","children","templateCustomerCards","show","loading","onClickCustomerCards","loaderComponent","templateCustomerSaveToWallet"]),{order}=useContext(OrderContext),{payment}=useContext(PaymentMethodChildrenContext),{payments,isGuest}=useContext(CustomerContext),{currentPaymentMethodId,config,paymentSource}=useContext(PaymentMethodContext),paymentResource="stripe_payments",locale=order==null?void 0:order.language_code;if(!readonly&&(payment==null?void 0:payment.id)!==currentPaymentMethodId)return null;const publishableKey=paymentSource==null?void 0:paymentSource.publishable_key,stripeConfig=config?getPaymentConfig(paymentResource,config):{},customerPayments=!isEmpty(payments)&&payments?payments.filter(customerPayment=>{var _a2;return((_a2=customerPayment.payment_source)===null||_a2===void 0?void 0:_a2.type)==="stripe_payments"}):[];if(readonly||showCard){const card=(_a=paymentSource==null?void 0:paymentSource.options)===null||_a===void 0?void 0:_a.card,value=Object.assign(Object.assign({},card),{showCard,handleEditClick,readonly});return isEmpty(card)?null:_jsx(PaymentSourceContext.Provider,Object.assign({value},{children}))}return!isGuest&&templateCustomerCards?_jsxs(Fragment,{children:[isEmpty(customerPayments)?null:_jsx("div",Object.assign({className:p.className},{children:_jsx(PaymentCardsTemplate,Object.assign({},{paymentResource,customerPayments},{children:templateCustomerCards}))})),_jsx(StripePayment,Object.assign({show,templateCustomerSaveToWallet,publishableKey,locale},stripeConfig))]}):publishableKey&&!loading?_jsx(StripePayment,Object.assign({show,publishableKey,locale},stripeConfig)):loaderComponent}
|
|
@@ -1,5 +1,2 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import
|
|
3
|
-
declare type WireTransferGateway = GatewayBaseType;
|
|
4
|
-
export default function WireTransferGateway(props: WireTransferGateway): JSX.Element | null;
|
|
5
|
-
export {};
|
|
2
|
+
import{GatewayBaseType}from'../PaymentGateway';declare type WireTransferGateway=GatewayBaseType;export default function WireTransferGateway(props:WireTransferGateway):JSX.Element|null;export{};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__rest}from"tslib";import{jsx as _jsx}from"react/jsx-runtime";import WireTransferPayment from"../WireTransferPayment";import PaymentMethodChildrenContext from"../../context/PaymentMethodChildrenContext";import PaymentMethodContext from"../../context/PaymentMethodContext";import PaymentSourceContext from"../../context/PaymentSourceContext";import{getPaymentConfig}from"../../reducers/PaymentMethodReducer";import isEmpty from"lodash/isEmpty";import{useContext}from"react";export default function WireTransferGateway(props){var _a,_b;const{readonly,showCard,handleEditClick,children,templateCustomerCards,show,loading,onClickCustomerCards,loaderComponent,templateCustomerSaveToWallet}=props,p=__rest(props,["readonly","showCard","handleEditClick","children","templateCustomerCards","show","loading","onClickCustomerCards","loaderComponent","templateCustomerSaveToWallet"]),{payment}=useContext(PaymentMethodChildrenContext),{currentPaymentMethodId,config,paymentSource}=useContext(PaymentMethodContext),paymentResource="wire_transfers";if(!readonly&&(payment==null?void 0:payment.id)!==currentPaymentMethodId)return null;if(readonly||showCard){const card=((_a=paymentSource==null?void 0:paymentSource.options)===null||_a===void 0?void 0:_a.card)||((_b=paymentSource==null?void 0:paymentSource.metadata)===null||_b===void 0?void 0:_b.card),value=Object.assign(Object.assign({},card),{showCard,handleEditClick,readonly});return isEmpty(card)?null:_jsx(PaymentSourceContext.Provider,Object.assign({value},{children})
|
|
1
|
+
import{__rest}from"tslib";import{jsx as _jsx}from"react/jsx-runtime";import WireTransferPayment from"../WireTransferPayment";import PaymentMethodChildrenContext from"../../context/PaymentMethodChildrenContext";import PaymentMethodContext from"../../context/PaymentMethodContext";import PaymentSourceContext from"../../context/PaymentSourceContext";import{getPaymentConfig}from"../../reducers/PaymentMethodReducer";import isEmpty from"lodash/isEmpty";import{useContext}from"react";export default function WireTransferGateway(props){var _a,_b;const{readonly,showCard,handleEditClick,children,templateCustomerCards,show,loading,onClickCustomerCards,loaderComponent,templateCustomerSaveToWallet}=props,p=__rest(props,["readonly","showCard","handleEditClick","children","templateCustomerCards","show","loading","onClickCustomerCards","loaderComponent","templateCustomerSaveToWallet"]),{payment}=useContext(PaymentMethodChildrenContext),{currentPaymentMethodId,config,paymentSource}=useContext(PaymentMethodContext),paymentResource="wire_transfers";if(!readonly&&(payment==null?void 0:payment.id)!==currentPaymentMethodId)return null;if(readonly||showCard){const card=((_a=paymentSource==null?void 0:paymentSource.options)===null||_a===void 0?void 0:_a.card)||((_b=paymentSource==null?void 0:paymentSource.metadata)===null||_b===void 0?void 0:_b.card),value=Object.assign(Object.assign({},card),{showCard,handleEditClick,readonly});return isEmpty(card)?null:_jsx(PaymentSourceContext.Provider,Object.assign({value},{children}))}const wireTransferConfig=config&&paymentResource?getPaymentConfig(paymentResource,config):{};return _jsx(WireTransferPayment,Object.assign({},p,wireTransferConfig))}
|
|
@@ -1,27 +1,2 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import
|
|
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 {};
|
|
2
|
+
import{Address}from'@commercelayer/sdk';import AddressChildrenContext from'../../context/AddressChildrenContext';import{FunctionChildren}from'../../typings/index';declare type ChildrenProps=Pick<Props,'customerAddresses'|'className'>&{AddressProvider:typeof AddressChildrenContext.Provider;};export declare type CustomerAddress=Address&{onClick:()=>void;handleSelect?:()=>void;};export declare type AddressCardsTemplateChildren=FunctionChildren<ChildrenProps>;export declare type AddressCardsType=ChildrenProps;export declare type HandleSelect=(k:number,addressId:string,customerAddressId:string,disabled:boolean,address:Address)=>void;declare type Props={customerAddresses:CustomerAddress[];countryLock?:string;children:AddressCardsTemplateChildren;selectedClassName?:string;disabledClassName?:string;deselect?:boolean;selected?:number|null;className?:string;handleSelect:HandleSelect;};export default function AddressCardsTemplate({customerAddresses,children,deselect,countryLock,selected,selectedClassName,className,disabledClassName,handleSelect,}:Props):JSX.Element;export{};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as _jsx}from"react/jsx-runtime";import Parent from"../utils/Parent";import{useContext}from"react";import AddressChildrenContext from"../../context/AddressChildrenContext";import ShippingAddressContext from"../../context/ShippingAddressContext";export default function AddressCardsTemplate({customerAddresses,children,deselect,countryLock,selected,selectedClassName,className,disabledClassName,handleSelect}){const{setShippingAddress}=useContext(ShippingAddressContext),value={customerAddresses:customerAddresses.map((address,k)=>{const attributes=address,disabled=setShippingAddress&&countryLock&&countryLock!==address.country_code||!1,addressSelectedClass=selected===k?`${className} ${deselect?"":selectedClassName}`:className,finalClassName=disabled?`${className} ${disabledClassName}`:addressSelectedClass,customerAddressId=(address==null?void 0:address.reference)||"",onClick=()=>handleSelect(k,address.id,customerAddressId,disabled,address);return Object.assign(Object.assign({},attributes),{className:finalClassName,onClick})}),AddressProvider:AddressChildrenContext.Provider};return _jsx(Parent,Object.assign({},value,{children})
|
|
1
|
+
import{jsx as _jsx}from"react/jsx-runtime";import Parent from"../utils/Parent";import{useContext}from"react";import AddressChildrenContext from"../../context/AddressChildrenContext";import ShippingAddressContext from"../../context/ShippingAddressContext";export default function AddressCardsTemplate({customerAddresses,children,deselect,countryLock,selected,selectedClassName,className,disabledClassName,handleSelect}){const{setShippingAddress}=useContext(ShippingAddressContext),value={customerAddresses:customerAddresses.map((address,k)=>{const attributes=address,disabled=setShippingAddress&&countryLock&&countryLock!==address.country_code||!1,addressSelectedClass=selected===k?`${className} ${deselect?"":selectedClassName}`:className,finalClassName=disabled?`${className} ${disabledClassName}`:addressSelectedClass,customerAddressId=(address==null?void 0:address.reference)||"",onClick=()=>handleSelect(k,address.id,customerAddressId,disabled,address);return Object.assign(Object.assign({},attributes),{className:finalClassName,onClick})}),AddressProvider:AddressChildrenContext.Provider};return _jsx(Parent,Object.assign({},value,{children}))}
|
|
@@ -1,8 +1 @@
|
|
|
1
|
-
import
|
|
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
|
+
import{FunctionComponent,ReactNode}from'react';declare type BaseFieldChildren=Omit<BaseFieldProps,'children'>;export declare type BaseFieldProps={attribute:'number'|'id';children?:(props:BaseFieldChildren)=>ReactNode;}&JSX.IntrinsicElements['span'];declare const BaseField:FunctionComponent<BaseFieldProps>;export default BaseField;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__rest}from"tslib";import{jsx as _jsx}from"react/jsx-runtime";import OrderContext from"../../context/OrderContext";import{useContext,useEffect,useState}from"react";import Parent from"./Parent";const BaseField=_a=>{var{children,attribute}=_a,p=__rest(_a,["children","attribute"]);const{order}=useContext(OrderContext),[field,setField]=useState("");useEffect(()=>(order&&attribute in order&&setField(order[attribute]),()=>{setField("")}),[order]);const parentProps=Object.assign({attribute:field},p);return children?_jsx(Parent,Object.assign({},parentProps,{children})
|
|
1
|
+
import{__rest}from"tslib";import{jsx as _jsx}from"react/jsx-runtime";import OrderContext from"../../context/OrderContext";import{useContext,useEffect,useState}from"react";import Parent from"./Parent";const BaseField=_a=>{var{children,attribute}=_a,p=__rest(_a,["children","attribute"]);const{order}=useContext(OrderContext),[field,setField]=useState("");useEffect(()=>(order&&attribute in order&&setField(order[attribute]),()=>{setField("")}),[order]);const parentProps=Object.assign({attribute:field},p);return children?_jsx(Parent,Object.assign({},parentProps,{children})):_jsx("span",Object.assign({},p,{children:field}))};export default BaseField;
|
|
@@ -1,5 +1 @@
|
|
|
1
|
-
import React from
|
|
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" | "type" | "key" | "resource" | "id" | "value" | "placeholder" | "className" | "required" | "name" | "onChange" | "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" | "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
|
+
import React from'react';import{BaseInputComponentProps}from'../../typings/index';export declare type BaseInputProps=BaseInputComponentProps&JSX.IntrinsicElements['input']&JSX.IntrinsicElements['textarea'];declare const _default:React.ForwardRefExoticComponent<Pick<BaseInputProps,"children"|"form"|"slot"|"style"|"title"|"pattern"|"type"|"key"|"resource"|"id"|"value"|"placeholder"|"className"|"required"|"name"|"onChange"|"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"|"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>>;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)
|
|
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,6 +1 @@
|
|
|
1
|
-
import
|
|
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
|
+
import{FunctionComponent}from'react';import{PropsType}from'../../utils/PropsType';import{baseOrderPricePropTypes}from'../../typings/index';export declare type BaseOrderPriceProps=PropsType<typeof baseOrderPricePropTypes>&JSX.IntrinsicElements['span'];declare const BaseOrderPrice:FunctionComponent<BaseOrderPriceProps>;export default BaseOrderPrice;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__rest}from"tslib";import{jsx as _jsx}from"react/jsx-runtime";import OrderContext from"../../context/OrderContext";import getAmount from"../../utils/getAmount";import Parent from"./Parent";import{useState,useEffect,useContext}from"react";import{baseOrderPricePropTypes}from"../../typings/index";import{isEmpty}from"lodash";const BaseOrderPrice=props=>{const{format="formatted",base,type,children}=props,p=__rest(props,["format","base","type","children"]),{order}=useContext(OrderContext),[price,setPrice]=useState(""),[cents,setCents]=useState(0);useEffect(()=>{const p2=getAmount({base,type,format,obj:order||{}}),c=getAmount({base,type,format:"cents",obj:order||{}});return setPrice(p2),setCents(c),()=>{isEmpty(order)&&setPrice("")}},[order]);const parentProps=Object.assign({priceCents:cents,price},p);return children?_jsx(Parent,Object.assign({},parentProps,{children})
|
|
1
|
+
import{__rest}from"tslib";import{jsx as _jsx}from"react/jsx-runtime";import OrderContext from"../../context/OrderContext";import getAmount from"../../utils/getAmount";import Parent from"./Parent";import{useState,useEffect,useContext}from"react";import{baseOrderPricePropTypes}from"../../typings/index";import{isEmpty}from"lodash";const BaseOrderPrice=props=>{const{format="formatted",base,type,children}=props,p=__rest(props,["format","base","type","children"]),{order}=useContext(OrderContext),[price,setPrice]=useState(""),[cents,setCents]=useState(0);useEffect(()=>{const p2=getAmount({base,type,format,obj:order||{}}),c=getAmount({base,type,format:"cents",obj:order||{}});return setPrice(p2),setCents(c),()=>{isEmpty(order)&&setPrice("")}},[order]);const parentProps=Object.assign({priceCents:cents,price},p);return children?_jsx(Parent,Object.assign({},parentProps,{children})):_jsx("span",Object.assign({},p,{children:price}))};BaseOrderPrice.propTypes=baseOrderPricePropTypes;export default BaseOrderPrice;
|
|
@@ -1,5 +1 @@
|
|
|
1
|
-
import React from
|
|
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
|
+
import React from'react';import{BaseSelectComponentProps}from'../../typings/index';export declare type BaseSelectProps=BaseSelectComponentProps;declare const _default:React.ForwardRefExoticComponent<BaseSelectComponentProps&React.RefAttributes<any>>;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";import{findIndex}from"lodash";const BaseSelect=(props,ref)=>{const{options=[],children,placeholder={label:"Select an option",value:""},value=""}=props,p=__rest(props,["options","children","placeholder","value"]);findIndex(options,placeholder)===-1?options.unshift(placeholder):options[0]=placeholder;const Options=options.map((o,k)=>{const{label}=o,option=__rest(o,["label"]);return _jsx("option",Object.assign({},option,{children:label}),k)}),parentProps=Object.assign({options,ref},p);return children?_jsx(Parent,Object.assign({},parentProps,{children})
|
|
1
|
+
import{__rest}from"tslib";import{jsx as _jsx}from"react/jsx-runtime";import React from"react";import Parent from"./Parent";import{findIndex}from"lodash";const BaseSelect=(props,ref)=>{const{options=[],children,placeholder={label:"Select an option",value:""},value=""}=props,p=__rest(props,["options","children","placeholder","value"]);findIndex(options,placeholder)===-1?options.unshift(placeholder):options[0]=placeholder;const Options=options.map((o,k)=>{const{label}=o,option=__rest(o,["label"]);return _jsx("option",Object.assign({},option,{children:label}),k)}),parentProps=Object.assign({options,ref},p);return children?_jsx(Parent,Object.assign({},parentProps,{children})):_jsx("select",Object.assign({ref,defaultValue:value},p,{children:Options}))};export default React.forwardRef(BaseSelect);
|
|
@@ -1,8 +1 @@
|
|
|
1
|
-
import PropTypes,
|
|
2
|
-
import { FunctionComponent } from 'react';
|
|
3
|
-
declare const PProps: {
|
|
4
|
-
children: PropTypes.Requireable<(...args: any[]) => any>;
|
|
5
|
-
};
|
|
6
|
-
export declare type ParentProps = InferProps<typeof PProps>;
|
|
7
|
-
declare const Parent: FunctionComponent<ParentProps>;
|
|
8
|
-
export default Parent;
|
|
1
|
+
import PropTypes,{InferProps}from'prop-types';import{FunctionComponent}from'react';declare const PProps:{children:PropTypes.Requireable<(...args:any[])=>any>;};export declare type ParentProps=InferProps<typeof PProps>;declare const Parent:FunctionComponent<ParentProps>;export default Parent;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as _jsx}from"react/jsx-runtime";import PropTypes from"prop-types";const PProps={children:PropTypes.func},Parent=props=>{const Child=props.children;return Child?_jsx(Child,Object.assign({},props)
|
|
1
|
+
import{jsx as _jsx}from"react/jsx-runtime";import PropTypes from"prop-types";const PProps={children:PropTypes.func},Parent=props=>{const Child=props.children;return Child?_jsx(Child,Object.assign({},props)):null};Parent.propTypes=PProps;export default Parent;
|
|
@@ -1,23 +1,2 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import
|
|
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 {};
|
|
2
|
+
import{PaymentResource,PaymentSourceType}from'../../reducers/PaymentMethodReducer';import PaymentSourceContext,{IconBrand}from'../../context/PaymentSourceContext';import{FunctionChildren}from'../../typings/index';declare type ChildrenProps=Pick<Props,'customerPayments'>&{PaymentSourceProvider:typeof PaymentSourceContext.Provider;};declare type CustomerPayment=PaymentSourceType&{card?:{brand?:IconBrand;last4?:string;};handleClick?:()=>void;};export declare type CustomerCardsTemplateChildren=FunctionChildren<ChildrenProps>;export declare type CustomerCardsType=ChildrenProps;declare type Props={customerPayments:CustomerPayment[];children:CustomerCardsTemplateChildren;paymentResource:PaymentResource;};export default function PaymentCardsTemplate({customerPayments,children,paymentResource,}:Props):JSX.Element;export{};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as _jsx}from"react/jsx-runtime";import Parent from"../utils/Parent";import{useContext}from"react";import PaymentMethodContext from"../../context/PaymentMethodContext";import PaymentSourceContext from"../../context/PaymentSourceContext";import getCardDetails from"../../utils/getCardDetails";export default function PaymentCardsTemplate({customerPayments,children,paymentResource}){const{setPaymentSource}=useContext(PaymentMethodContext),value={customerPayments:customerPayments.map(customerPayment=>{const attributes=customerPayment,card=getCardDetails({customerPayment,paymentType:paymentResource}),handleClick=async e=>{e.stopPropagation(),await setPaymentSource({paymentResource,customerPaymentSourceId:customerPayment.id})};return Object.assign(Object.assign({},attributes),{card,handleClick})}),PaymentSourceProvider:PaymentSourceContext.Provider};return _jsx(Parent,Object.assign({},value,{children})
|
|
1
|
+
import{jsx as _jsx}from"react/jsx-runtime";import Parent from"../utils/Parent";import{useContext}from"react";import PaymentMethodContext from"../../context/PaymentMethodContext";import PaymentSourceContext from"../../context/PaymentSourceContext";import getCardDetails from"../../utils/getCardDetails";export default function PaymentCardsTemplate({customerPayments,children,paymentResource}){const{setPaymentSource}=useContext(PaymentMethodContext),value={customerPayments:customerPayments.map(customerPayment=>{const attributes=customerPayment,card=getCardDetails({customerPayment,paymentType:paymentResource}),handleClick=async e=>{e.stopPropagation(),await setPaymentSource({paymentResource,customerPaymentSourceId:customerPayment.id})};return Object.assign(Object.assign({},attributes),{card,handleClick})}),PaymentSourceProvider:PaymentSourceContext.Provider};return _jsx(Parent,Object.assign({},value,{children}))}
|
|
@@ -1,8 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { PriceProps } from '../Price';
|
|
3
|
-
export declare type PTemplateProps = {
|
|
4
|
-
formattedAmount?: string;
|
|
5
|
-
formattedCompare?: string;
|
|
6
|
-
} & Omit<PriceProps, 'children'>;
|
|
7
|
-
declare const PriceTemplate: FunctionComponent<PTemplateProps>;
|
|
8
|
-
export default PriceTemplate;
|
|
1
|
+
import{FunctionComponent}from'react';import{PriceProps}from'../Price';export declare type PTemplateProps={formattedAmount?:string;formattedCompare?:string;}&Omit<PriceProps,'children'>;declare const PriceTemplate:FunctionComponent<PTemplateProps>;export default PriceTemplate;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__rest}from"tslib";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";import{Fragment}from"react";import PropTypes from"prop-types";const propTypes={formattedAmount:PropTypes.string,formattedCompare:PropTypes.string},defaultProps={formattedAmount:"",formattedCompare:""},PriceTemplate=props=>{const{showCompare,formattedCompare,compareClassName,className,formattedAmount,skuCode}=props,p=__rest(props,["showCompare","formattedCompare","compareClassName","className","formattedAmount","skuCode"]);return _jsxs(Fragment,{children:[_jsx("span",Object.assign({className},p,{children:formattedAmount})
|
|
1
|
+
import{__rest}from"tslib";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";import{Fragment}from"react";import PropTypes from"prop-types";const propTypes={formattedAmount:PropTypes.string,formattedCompare:PropTypes.string},defaultProps={formattedAmount:"",formattedCompare:""},PriceTemplate=props=>{const{showCompare,formattedCompare,compareClassName,className,formattedAmount,skuCode}=props,p=__rest(props,["showCompare","formattedCompare","compareClassName","className","formattedAmount","skuCode"]);return _jsxs(Fragment,{children:[_jsx("span",Object.assign({className},p,{children:formattedAmount})),showCompare&&_jsx("span",Object.assign({className:compareClassName||""},p,{children:formattedCompare}))]})};PriceTemplate.propTypes=propTypes,PriceTemplate.defaultProps=defaultProps;export default PriceTemplate;
|
|
@@ -1,36 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
import { BaseSelectorType } from '../../typings/index';
|
|
4
|
-
import { VariantsObject, SetSkuCode } from '../../reducers/VariantReducer';
|
|
5
|
-
import { VariantOption } from '../VariantSelector';
|
|
6
|
-
export declare const propTypes: {
|
|
7
|
-
variants: PropTypes.Validator<any>;
|
|
8
|
-
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
9
|
-
options: PropTypes.Validator<PropTypes.InferProps<{
|
|
10
|
-
label: PropTypes.Validator<string>;
|
|
11
|
-
code: PropTypes.Validator<string>;
|
|
12
|
-
lineItem: PropTypes.Requireable<PropTypes.InferProps<{
|
|
13
|
-
name: PropTypes.Validator<string>;
|
|
14
|
-
imageUrl: PropTypes.Requireable<string>;
|
|
15
|
-
}>>;
|
|
16
|
-
}>[]>;
|
|
17
|
-
name: PropTypes.Requireable<string>;
|
|
18
|
-
children: PropTypes.Requireable<(...args: any[]) => any>;
|
|
19
|
-
type: PropTypes.Requireable<BaseSelectorType>;
|
|
20
|
-
loader: PropTypes.Requireable<PropTypes.ReactElementLike>;
|
|
21
|
-
placeholder: PropTypes.Requireable<string>;
|
|
22
|
-
skuCode: PropTypes.Requireable<string>;
|
|
23
|
-
};
|
|
24
|
-
export declare type VariantHandleCallback = (variant: VariantOption) => void;
|
|
25
|
-
export declare type VariantTemplateProps = {
|
|
26
|
-
variants: VariantsObject | Record<string, any>;
|
|
27
|
-
handleChange?: SetSkuCode;
|
|
28
|
-
options: VariantOption[];
|
|
29
|
-
type?: BaseSelectorType;
|
|
30
|
-
loader?: ReactNode;
|
|
31
|
-
placeholder?: string;
|
|
32
|
-
skuCode?: string;
|
|
33
|
-
handleCallback?: VariantHandleCallback;
|
|
34
|
-
} & JSX.IntrinsicElements['input'] & JSX.IntrinsicElements['select'];
|
|
35
|
-
declare const VariantTemplate: FunctionComponent<VariantTemplateProps>;
|
|
36
|
-
export default VariantTemplate;
|
|
1
|
+
import{FunctionComponent,ReactNode}from'react';import PropTypes from'prop-types';import{BaseSelectorType}from'../../typings/index';import{VariantsObject,SetSkuCode}from'../../reducers/VariantReducer';import{VariantOption}from'../VariantSelector';export declare const propTypes:{variants:PropTypes.Validator<any>;onChange:PropTypes.Requireable<(...args:any[])=>any>;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>;};export declare type VariantHandleCallback=(variant:VariantOption)=>void;export declare type VariantTemplateProps={variants:VariantsObject|Record<string,any>;handleChange?:SetSkuCode;options:VariantOption[];type?:BaseSelectorType;loader?:ReactNode;placeholder?:string;skuCode?:string;handleCallback?:VariantHandleCallback;}&JSX.IntrinsicElements['input']&JSX.IntrinsicElements['select'];declare const VariantTemplate:FunctionComponent<VariantTemplateProps>;export default VariantTemplate;
|