@commercelayer/react-components 4.21.0-beta.2 → 4.22.0-beta.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/cjs/components/ExternalFunction.d.ts +7 -0
- package/lib/cjs/components/ExternalFunction.js +2 -0
- package/lib/cjs/components/MetadataInput.d.ts +5 -0
- package/lib/cjs/components/MetadataInput.js +2 -0
- package/lib/cjs/components/SubmitButton.d.ts +10 -0
- package/lib/cjs/components/SubmitButton.js +2 -0
- package/lib/cjs/components/addresses/Address.d.ts +31 -0
- package/lib/cjs/components/addresses/Address.js +2 -0
- package/lib/cjs/components/addresses/AddressCountrySelector.d.ts +34 -0
- package/lib/cjs/components/addresses/AddressCountrySelector.js +2 -0
- package/lib/cjs/components/addresses/AddressField.d.ts +61 -0
- package/lib/cjs/components/addresses/AddressField.js +2 -0
- package/lib/cjs/components/addresses/AddressInput.d.ts +34 -0
- package/lib/cjs/components/addresses/AddressInput.js +2 -0
- package/lib/cjs/components/addresses/AddressInputSelect.d.ts +29 -0
- package/lib/cjs/components/addresses/AddressInputSelect.js +2 -0
- package/lib/cjs/components/addresses/AddressStateSelector.d.ts +50 -0
- package/lib/cjs/components/addresses/AddressStateSelector.js +2 -0
- package/lib/cjs/components/addresses/AddressesContainer.d.ts +40 -0
- package/lib/cjs/components/addresses/AddressesContainer.js +2 -0
- package/lib/cjs/components/addresses/AddressesEmpty.d.ts +26 -0
- package/lib/cjs/components/addresses/AddressesEmpty.js +2 -0
- package/lib/cjs/components/addresses/BillingAddressContainer.d.ts +6 -0
- package/lib/cjs/components/addresses/BillingAddressContainer.js +2 -0
- package/lib/cjs/components/addresses/BillingAddressForm.d.ts +34 -0
- package/lib/cjs/components/addresses/BillingAddressForm.js +2 -0
- package/lib/cjs/components/addresses/SaveAddressesButton.d.ts +18 -0
- package/lib/cjs/components/addresses/SaveAddressesButton.js +2 -0
- package/lib/cjs/components/addresses/ShippingAddressContainer.d.ts +7 -0
- package/lib/cjs/components/addresses/ShippingAddressContainer.js +2 -0
- package/lib/cjs/components/addresses/ShippingAddressForm.d.ts +31 -0
- package/lib/cjs/components/addresses/ShippingAddressForm.js +2 -0
- package/lib/cjs/components/auth/CommerceLayer.d.ts +25 -0
- package/lib/cjs/components/auth/CommerceLayer.js +2 -0
- package/lib/cjs/components/customers/CustomerAddressForm.d.ts +13 -0
- package/lib/cjs/components/customers/CustomerAddressForm.js +2 -0
- package/lib/cjs/components/customers/CustomerContainer.d.ts +38 -0
- package/lib/cjs/components/customers/CustomerContainer.js +2 -0
- package/lib/cjs/components/customers/CustomerField.d.ts +25 -0
- package/lib/cjs/components/customers/CustomerField.js +2 -0
- package/lib/cjs/components/customers/CustomerInput.d.ts +11 -0
- package/lib/cjs/components/customers/CustomerInput.js +2 -0
- package/lib/cjs/components/customers/CustomerPaymentSource.d.ts +11 -0
- package/lib/cjs/components/customers/CustomerPaymentSource.js +2 -0
- package/lib/cjs/components/customers/CustomerPaymentSourceEmpty.d.ts +14 -0
- package/lib/cjs/components/customers/CustomerPaymentSourceEmpty.js +2 -0
- package/lib/cjs/components/customers/MyAccountLink.d.ts +38 -0
- package/lib/cjs/components/customers/MyAccountLink.js +2 -0
- package/lib/cjs/components/customers/MyIdentityLink.d.ts +59 -0
- package/lib/cjs/components/customers/MyIdentityLink.js +2 -0
- package/lib/cjs/components/customers/SaveCustomerButton.d.ts +12 -0
- package/lib/cjs/components/customers/SaveCustomerButton.js +2 -0
- package/lib/cjs/components/errors/Errors.d.ts +31 -0
- package/lib/cjs/components/errors/Errors.js +2 -0
- package/lib/cjs/components/gift_cards/GiftCard.d.ts +10 -0
- package/lib/cjs/components/gift_cards/GiftCard.js +2 -0
- package/lib/cjs/components/gift_cards/GiftCardContainer.d.ts +6 -0
- package/lib/cjs/components/gift_cards/GiftCardContainer.js +2 -0
- package/lib/cjs/components/gift_cards/GiftCardCurrencySelector.d.ts +7 -0
- package/lib/cjs/components/gift_cards/GiftCardCurrencySelector.js +2 -0
- package/lib/cjs/components/gift_cards/GiftCardInput.d.ts +7 -0
- package/lib/cjs/components/gift_cards/GiftCardInput.js +2 -0
- package/lib/cjs/components/gift_cards/GiftCardOrCouponCode.d.ts +16 -0
- package/lib/cjs/components/gift_cards/GiftCardOrCouponCode.js +2 -0
- package/lib/cjs/components/gift_cards/GiftCardOrCouponForm.d.ts +15 -0
- package/lib/cjs/components/gift_cards/GiftCardOrCouponForm.js +2 -0
- package/lib/cjs/components/gift_cards/GiftCardOrCouponInput.d.ts +11 -0
- package/lib/cjs/components/gift_cards/GiftCardOrCouponInput.js +2 -0
- package/lib/cjs/components/gift_cards/GiftCardOrCouponRemoveButton.d.ts +20 -0
- package/lib/cjs/components/gift_cards/GiftCardOrCouponRemoveButton.js +2 -0
- package/lib/cjs/components/gift_cards/GiftCardOrCouponSubmit.d.ts +10 -0
- package/lib/cjs/components/gift_cards/GiftCardOrCouponSubmit.js +2 -0
- package/lib/cjs/components/gift_cards/GiftCardRecipientInput.d.ts +0 -0
- package/lib/cjs/components/gift_cards/GiftCardRecipientInput.js +2 -0
- package/lib/cjs/components/in_stock_subscriptions/InStockSubscriptionButton.d.ts +36 -0
- package/lib/cjs/components/in_stock_subscriptions/InStockSubscriptionButton.js +2 -0
- package/lib/cjs/components/in_stock_subscriptions/InStockSubscriptionsContainer.d.ts +10 -0
- package/lib/cjs/components/in_stock_subscriptions/InStockSubscriptionsContainer.js +2 -0
- package/lib/cjs/components/line_items/LineItem.d.ts +8 -0
- package/lib/cjs/components/line_items/LineItem.js +2 -0
- package/lib/cjs/components/line_items/LineItemAmount.d.ts +7 -0
- package/lib/cjs/components/line_items/LineItemAmount.js +2 -0
- package/lib/cjs/components/line_items/LineItemCode.d.ts +13 -0
- package/lib/cjs/components/line_items/LineItemCode.js +2 -0
- package/lib/cjs/components/line_items/LineItemField.d.ts +14 -0
- package/lib/cjs/components/line_items/LineItemField.js +2 -0
- package/lib/cjs/components/line_items/LineItemImage.d.ts +17 -0
- package/lib/cjs/components/line_items/LineItemImage.js +2 -0
- package/lib/cjs/components/line_items/LineItemName.d.ts +12 -0
- package/lib/cjs/components/line_items/LineItemName.js +2 -0
- package/lib/cjs/components/line_items/LineItemOption.d.ts +19 -0
- package/lib/cjs/components/line_items/LineItemOption.js +2 -0
- package/lib/cjs/components/line_items/LineItemOptions.d.ts +16 -0
- package/lib/cjs/components/line_items/LineItemOptions.js +2 -0
- package/lib/cjs/components/line_items/LineItemQuantity.d.ts +21 -0
- package/lib/cjs/components/line_items/LineItemQuantity.js +2 -0
- package/lib/cjs/components/line_items/LineItemRemoveLink.d.ts +14 -0
- package/lib/cjs/components/line_items/LineItemRemoveLink.js +2 -0
- package/lib/cjs/components/line_items/LineItemsContainer.d.ts +9 -0
- package/lib/cjs/components/line_items/LineItemsContainer.js +2 -0
- package/lib/cjs/components/line_items/LineItemsCount.d.ts +12 -0
- package/lib/cjs/components/line_items/LineItemsCount.js +2 -0
- package/lib/cjs/components/line_items/LineItemsEmpty.d.ts +12 -0
- package/lib/cjs/components/line_items/LineItemsEmpty.js +2 -0
- package/lib/cjs/components/orders/AddToCartButton.d.ts +95 -0
- package/lib/cjs/components/orders/AddToCartButton.js +2 -0
- package/lib/cjs/components/orders/AdjustmentAmount.d.ts +4 -0
- package/lib/cjs/components/orders/AdjustmentAmount.js +2 -0
- package/lib/cjs/components/orders/CartLink.d.ts +47 -0
- package/lib/cjs/components/orders/CartLink.js +2 -0
- package/lib/cjs/components/orders/CheckoutLink.d.ts +28 -0
- package/lib/cjs/components/orders/CheckoutLink.js +2 -0
- package/lib/cjs/components/orders/DiscountAmount.d.ts +4 -0
- package/lib/cjs/components/orders/DiscountAmount.js +2 -0
- package/lib/cjs/components/orders/GiftCardAmount.d.ts +4 -0
- package/lib/cjs/components/orders/GiftCardAmount.js +2 -0
- package/lib/cjs/components/orders/HostedCart.d.ts +58 -0
- package/lib/cjs/components/orders/HostedCart.js +2 -0
- package/lib/cjs/components/orders/OrderContainer.d.ts +62 -0
- package/lib/cjs/components/orders/OrderContainer.js +2 -0
- package/lib/cjs/components/orders/OrderList.d.ts +83 -0
- package/lib/cjs/components/orders/OrderList.js +2 -0
- package/lib/cjs/components/orders/OrderListEmpty.d.ts +17 -0
- package/lib/cjs/components/orders/OrderListEmpty.js +2 -0
- package/lib/cjs/components/orders/OrderListPaginationButtons.d.ts +48 -0
- package/lib/cjs/components/orders/OrderListPaginationButtons.js +2 -0
- package/lib/cjs/components/orders/OrderListPaginationInfo.d.ts +29 -0
- package/lib/cjs/components/orders/OrderListPaginationInfo.js +2 -0
- package/lib/cjs/components/orders/OrderListRow.d.ts +29 -0
- package/lib/cjs/components/orders/OrderListRow.js +2 -0
- package/lib/cjs/components/orders/OrderNumber.d.ts +5 -0
- package/lib/cjs/components/orders/OrderNumber.js +2 -0
- package/lib/cjs/components/orders/OrderStorage.d.ts +31 -0
- package/lib/cjs/components/orders/OrderStorage.js +2 -0
- package/lib/cjs/components/orders/PaymentMethodAmount.d.ts +4 -0
- package/lib/cjs/components/orders/PaymentMethodAmount.js +2 -0
- package/lib/cjs/components/orders/PlaceOrderButton.d.ts +35 -0
- package/lib/cjs/components/orders/PlaceOrderButton.js +2 -0
- package/lib/cjs/components/orders/PlaceOrderContainer.d.ts +8 -0
- package/lib/cjs/components/orders/PlaceOrderContainer.js +2 -0
- package/lib/cjs/components/orders/PrivacyAndTermsCheckbox.d.ts +4 -0
- package/lib/cjs/components/orders/PrivacyAndTermsCheckbox.js +2 -0
- package/lib/cjs/components/orders/ShippingAmount.d.ts +4 -0
- package/lib/cjs/components/orders/ShippingAmount.js +2 -0
- package/lib/cjs/components/orders/SubTotalAmount.d.ts +4 -0
- package/lib/cjs/components/orders/SubTotalAmount.js +2 -0
- package/lib/cjs/components/orders/TaxesAmount.d.ts +4 -0
- package/lib/cjs/components/orders/TaxesAmount.js +2 -0
- package/lib/cjs/components/orders/TotalAmount.d.ts +4 -0
- package/lib/cjs/components/orders/TotalAmount.js +2 -0
- package/lib/cjs/components/parcels/ParcelField.d.ts +14 -0
- package/lib/cjs/components/parcels/ParcelField.js +2 -0
- package/lib/cjs/components/parcels/ParcelLineItem.d.ts +7 -0
- package/lib/cjs/components/parcels/ParcelLineItem.js +2 -0
- package/lib/cjs/components/parcels/ParcelLineItemField.d.ts +14 -0
- package/lib/cjs/components/parcels/ParcelLineItemField.js +2 -0
- package/lib/cjs/components/parcels/ParcelLineItemsCount.d.ts +18 -0
- package/lib/cjs/components/parcels/ParcelLineItemsCount.js +2 -0
- package/lib/cjs/components/parcels/Parcels.d.ts +7 -0
- package/lib/cjs/components/parcels/Parcels.js +2 -0
- package/lib/cjs/components/parcels/ParcelsCount.d.ts +18 -0
- package/lib/cjs/components/parcels/ParcelsCount.js +2 -0
- package/lib/cjs/components/payment_gateways/AdyenGateway.d.ts +5 -0
- package/lib/cjs/components/payment_gateways/AdyenGateway.js +2 -0
- package/lib/cjs/components/payment_gateways/BraintreeGateway.d.ts +5 -0
- package/lib/cjs/components/payment_gateways/BraintreeGateway.js +2 -0
- package/lib/cjs/components/payment_gateways/CheckoutComGateway.d.ts +5 -0
- package/lib/cjs/components/payment_gateways/CheckoutComGateway.js +2 -0
- package/lib/cjs/components/payment_gateways/ExternalGateway.d.ts +5 -0
- package/lib/cjs/components/payment_gateways/ExternalGateway.js +2 -0
- package/lib/cjs/components/payment_gateways/KlarnaGateway.d.ts +5 -0
- package/lib/cjs/components/payment_gateways/KlarnaGateway.js +2 -0
- package/lib/cjs/components/payment_gateways/PaymentGateway.d.ts +16 -0
- package/lib/cjs/components/payment_gateways/PaymentGateway.js +2 -0
- package/lib/cjs/components/payment_gateways/PaypalGateway.d.ts +5 -0
- package/lib/cjs/components/payment_gateways/PaypalGateway.js +2 -0
- package/lib/cjs/components/payment_gateways/StripeGateway.d.ts +5 -0
- package/lib/cjs/components/payment_gateways/StripeGateway.js +2 -0
- package/lib/cjs/components/payment_gateways/WireTransferGateway.d.ts +5 -0
- package/lib/cjs/components/payment_gateways/WireTransferGateway.js +2 -0
- package/lib/cjs/components/payment_methods/PaymentMethod.d.ts +45 -0
- package/lib/cjs/components/payment_methods/PaymentMethod.js +2 -0
- package/lib/cjs/components/payment_methods/PaymentMethodName.d.ts +10 -0
- package/lib/cjs/components/payment_methods/PaymentMethodName.js +2 -0
- package/lib/cjs/components/payment_methods/PaymentMethodPrice.d.ts +8 -0
- package/lib/cjs/components/payment_methods/PaymentMethodPrice.js +2 -0
- package/lib/cjs/components/payment_methods/PaymentMethodRadioButton.d.ts +17 -0
- package/lib/cjs/components/payment_methods/PaymentMethodRadioButton.js +2 -0
- package/lib/cjs/components/payment_methods/PaymentMethodsContainer.d.ts +8 -0
- package/lib/cjs/components/payment_methods/PaymentMethodsContainer.js +2 -0
- package/lib/cjs/components/payment_source/AdyenPayment.d.ts +66 -0
- package/lib/cjs/components/payment_source/AdyenPayment.js +2 -0
- package/lib/cjs/components/payment_source/BraintreePayment.d.ts +32 -0
- package/lib/cjs/components/payment_source/BraintreePayment.js +2 -0
- package/lib/cjs/components/payment_source/CheckoutComPayment.d.ts +23 -0
- package/lib/cjs/components/payment_source/CheckoutComPayment.js +2 -0
- package/lib/cjs/components/payment_source/ExternalPayment.d.ts +24 -0
- package/lib/cjs/components/payment_source/ExternalPayment.js +2 -0
- package/lib/cjs/components/payment_source/KlarnaPayment.d.ts +10 -0
- package/lib/cjs/components/payment_source/KlarnaPayment.js +2 -0
- package/lib/cjs/components/payment_source/PaymentSource.d.ts +19 -0
- package/lib/cjs/components/payment_source/PaymentSource.js +2 -0
- package/lib/cjs/components/payment_source/PaymentSourceBrandIcon.d.ts +15 -0
- package/lib/cjs/components/payment_source/PaymentSourceBrandIcon.js +2 -0
- package/lib/cjs/components/payment_source/PaymentSourceBrandName.d.ts +12 -0
- package/lib/cjs/components/payment_source/PaymentSourceBrandName.js +2 -0
- package/lib/cjs/components/payment_source/PaymentSourceDetail.d.ts +15 -0
- package/lib/cjs/components/payment_source/PaymentSourceDetail.js +2 -0
- package/lib/cjs/components/payment_source/PaymentSourceEditButton.d.ts +10 -0
- package/lib/cjs/components/payment_source/PaymentSourceEditButton.js +2 -0
- package/lib/cjs/components/payment_source/PaypalPayment.d.ts +12 -0
- package/lib/cjs/components/payment_source/PaypalPayment.js +2 -0
- package/lib/cjs/components/payment_source/StripeExpressPayment.d.ts +6 -0
- package/lib/cjs/components/payment_source/StripeExpressPayment.js +2 -0
- package/lib/cjs/components/payment_source/StripePayment.d.ts +22 -0
- package/lib/cjs/components/payment_source/StripePayment.js +2 -0
- package/lib/cjs/components/payment_source/WireTransferPayment.d.ts +12 -0
- package/lib/cjs/components/payment_source/WireTransferPayment.js +2 -0
- package/lib/cjs/components/prices/Price.d.ts +35 -0
- package/lib/cjs/components/prices/Price.js +2 -0
- package/lib/cjs/components/prices/PricesContainer.d.ts +41 -0
- package/lib/cjs/components/prices/PricesContainer.js +2 -0
- package/lib/cjs/components/shipments/Shipment.d.ts +10 -0
- package/lib/cjs/components/shipments/Shipment.js +2 -0
- package/lib/cjs/components/shipments/ShipmentField.d.ts +12 -0
- package/lib/cjs/components/shipments/ShipmentField.js +2 -0
- package/lib/cjs/components/shipments/ShipmentsContainer.d.ts +6 -0
- package/lib/cjs/components/shipments/ShipmentsContainer.js +2 -0
- package/lib/cjs/components/shipments/ShipmentsCount.d.ts +18 -0
- package/lib/cjs/components/shipments/ShipmentsCount.js +2 -0
- package/lib/cjs/components/shipping_methods/ShippingMethod.d.ts +8 -0
- package/lib/cjs/components/shipping_methods/ShippingMethod.js +2 -0
- package/lib/cjs/components/shipping_methods/ShippingMethodName.d.ts +11 -0
- package/lib/cjs/components/shipping_methods/ShippingMethodName.js +2 -0
- package/lib/cjs/components/shipping_methods/ShippingMethodPrice.d.ts +20 -0
- package/lib/cjs/components/shipping_methods/ShippingMethodPrice.js +2 -0
- package/lib/cjs/components/shipping_methods/ShippingMethodRadioButton.d.ts +17 -0
- package/lib/cjs/components/shipping_methods/ShippingMethodRadioButton.js +2 -0
- package/lib/cjs/components/skus/AvailabilityContainer.d.ts +34 -0
- package/lib/cjs/components/skus/AvailabilityContainer.js +2 -0
- package/lib/cjs/components/skus/AvailabilityTemplate.d.ts +52 -0
- package/lib/cjs/components/skus/AvailabilityTemplate.js +2 -0
- package/lib/cjs/components/skus/DeliveryLeadTime.d.ts +10 -0
- package/lib/cjs/components/skus/DeliveryLeadTime.js +2 -0
- package/lib/cjs/components/skus/SkuField.d.ts +25 -0
- package/lib/cjs/components/skus/SkuField.js +2 -0
- package/lib/cjs/components/skus/SkuList.d.ts +10 -0
- package/lib/cjs/components/skus/SkuList.js +2 -0
- package/lib/cjs/components/skus/SkuListsContainer.d.ts +6 -0
- package/lib/cjs/components/skus/SkuListsContainer.js +2 -0
- package/lib/cjs/components/skus/Skus.d.ts +18 -0
- package/lib/cjs/components/skus/Skus.js +2 -0
- package/lib/cjs/components/skus/SkusContainer.d.ts +31 -0
- package/lib/cjs/components/skus/SkusContainer.js +2 -0
- package/lib/cjs/components/stock_transfers/StockTransfer.d.ts +7 -0
- package/lib/cjs/components/stock_transfers/StockTransfer.js +2 -0
- package/lib/cjs/components/stock_transfers/StockTransferField.d.ts +10 -0
- package/lib/cjs/components/stock_transfers/StockTransferField.js +2 -0
- package/lib/cjs/components/utils/AddressCardsTemplate.d.ts +26 -0
- package/lib/cjs/components/utils/AddressCardsTemplate.js +2 -0
- package/lib/cjs/components/utils/BaseField.d.ts +8 -0
- package/lib/cjs/components/utils/BaseField.js +2 -0
- package/lib/cjs/components/utils/BaseInput.d.ts +5 -0
- package/lib/cjs/components/utils/BaseInput.js +2 -0
- package/lib/cjs/components/utils/BaseOrderPrice.d.ts +6 -0
- package/lib/cjs/components/utils/BaseOrderPrice.js +2 -0
- package/lib/cjs/components/utils/BaseSelect.d.ts +5 -0
- package/lib/cjs/components/utils/BaseSelect.js +2 -0
- package/lib/cjs/components/utils/ErrorBoundary.d.ts +14 -0
- package/lib/cjs/components/utils/ErrorBoundary.js +2 -0
- package/lib/cjs/components/utils/GenericFieldComponent.d.ts +58 -0
- package/lib/cjs/components/utils/GenericFieldComponent.js +2 -0
- package/lib/cjs/components/utils/Parent.d.ts +6 -0
- package/lib/cjs/components/utils/Parent.js +2 -0
- package/lib/cjs/components/utils/PaymentCardsTemplate.d.ts +41 -0
- package/lib/cjs/components/utils/PaymentCardsTemplate.js +2 -0
- package/lib/cjs/components/utils/PriceTemplate.d.ts +8 -0
- package/lib/cjs/components/utils/PriceTemplate.js +2 -0
- package/lib/cjs/components/utils/getAllErrors.d.ts +16 -0
- package/lib/cjs/components/utils/getAllErrors.js +2 -0
- package/lib/cjs/config/currency.d.ts +5 -0
- package/lib/cjs/config/currency.js +2 -0
- package/lib/cjs/context/AddressChildrenContext.d.ts +6 -0
- package/lib/cjs/context/AddressChildrenContext.js +2 -0
- package/lib/cjs/context/AddressContext.d.ts +18 -0
- package/lib/cjs/context/AddressContext.js +2 -0
- package/lib/cjs/context/AvailabilityContext.d.ts +2 -0
- package/lib/cjs/context/AvailabilityContext.js +2 -0
- package/lib/cjs/context/BillingAddressContext.d.ts +9 -0
- package/lib/cjs/context/BillingAddressContext.js +2 -0
- package/lib/cjs/context/BillingAddressFormContext.d.ts +22 -0
- package/lib/cjs/context/BillingAddressFormContext.js +2 -0
- package/lib/cjs/context/CommerceLayerContext.d.ts +6 -0
- package/lib/cjs/context/CommerceLayerContext.js +2 -0
- package/lib/cjs/context/CouponAndGiftCardFormContext.d.ts +8 -0
- package/lib/cjs/context/CouponAndGiftCardFormContext.js +2 -0
- package/lib/cjs/context/CustomerAddressFormContext.d.ts +17 -0
- package/lib/cjs/context/CustomerAddressFormContext.js +2 -0
- package/lib/cjs/context/CustomerContext.d.ts +29 -0
- package/lib/cjs/context/CustomerContext.js +2 -0
- package/lib/cjs/context/CustomerPaymentSourceContext.d.ts +11 -0
- package/lib/cjs/context/CustomerPaymentSourceContext.js +2 -0
- package/lib/cjs/context/ExternalFunctionContext.d.ts +11 -0
- package/lib/cjs/context/ExternalFunctionContext.js +2 -0
- package/lib/cjs/context/GiftCardContext.d.ts +10 -0
- package/lib/cjs/context/GiftCardContext.js +2 -0
- package/lib/cjs/context/InStockSubscriptionContext.d.ts +6 -0
- package/lib/cjs/context/InStockSubscriptionContext.js +2 -0
- package/lib/cjs/context/LineItemChildrenContext.d.ts +8 -0
- package/lib/cjs/context/LineItemChildrenContext.js +2 -0
- package/lib/cjs/context/LineItemContext.d.ts +7 -0
- package/lib/cjs/context/LineItemContext.js +2 -0
- package/lib/cjs/context/LineItemOptionChildrenContext.d.ts +9 -0
- package/lib/cjs/context/LineItemOptionChildrenContext.js +2 -0
- package/lib/cjs/context/OrderContext.d.ts +30 -0
- package/lib/cjs/context/OrderContext.js +2 -0
- package/lib/cjs/context/OrderListChildrenContext.d.ts +73 -0
- package/lib/cjs/context/OrderListChildrenContext.js +2 -0
- package/lib/cjs/context/OrderListPaginationContext.d.ts +15 -0
- package/lib/cjs/context/OrderListPaginationContext.js +2 -0
- package/lib/cjs/context/OrderStorageContext.d.ts +10 -0
- package/lib/cjs/context/OrderStorageContext.js +2 -0
- package/lib/cjs/context/ParcelChildrenContext.d.ts +6 -0
- package/lib/cjs/context/ParcelChildrenContext.js +2 -0
- package/lib/cjs/context/ParcelLineItemChildrenContext.d.ts +6 -0
- package/lib/cjs/context/ParcelLineItemChildrenContext.js +2 -0
- package/lib/cjs/context/PaymentMethodChildrenContext.d.ts +10 -0
- package/lib/cjs/context/PaymentMethodChildrenContext.js +2 -0
- package/lib/cjs/context/PaymentMethodContext.d.ts +13 -0
- package/lib/cjs/context/PaymentMethodContext.js +2 -0
- package/lib/cjs/context/PaymentSourceContext.d.ts +14 -0
- package/lib/cjs/context/PaymentSourceContext.js +2 -0
- package/lib/cjs/context/PlaceOrderContext.d.ts +12 -0
- package/lib/cjs/context/PlaceOrderContext.js +2 -0
- package/lib/cjs/context/PricesContext.d.ts +6 -0
- package/lib/cjs/context/PricesContext.js +2 -0
- package/lib/cjs/context/ShipmentChildrenContext.d.ts +13 -0
- package/lib/cjs/context/ShipmentChildrenContext.js +2 -0
- package/lib/cjs/context/ShipmentContext.d.ts +10 -0
- package/lib/cjs/context/ShipmentContext.js +2 -0
- package/lib/cjs/context/ShippingAddressContext.d.ts +9 -0
- package/lib/cjs/context/ShippingAddressContext.js +2 -0
- package/lib/cjs/context/ShippingAddressFormContext.d.ts +3 -0
- package/lib/cjs/context/ShippingAddressFormContext.js +2 -0
- package/lib/cjs/context/ShippingMethodChildrenContext.d.ts +9 -0
- package/lib/cjs/context/ShippingMethodChildrenContext.js +2 -0
- package/lib/cjs/context/SkuChildrenContext.d.ts +8 -0
- package/lib/cjs/context/SkuChildrenContext.js +2 -0
- package/lib/cjs/context/SkuContext.d.ts +8 -0
- package/lib/cjs/context/SkuContext.js +2 -0
- package/lib/cjs/context/SkuListsContext.d.ts +5 -0
- package/lib/cjs/context/SkuListsContext.js +2 -0
- package/lib/cjs/context/StockTransferChildrenContext.d.ts +6 -0
- package/lib/cjs/context/StockTransferChildrenContext.js +2 -0
- package/lib/cjs/hooks/useCommerceLayer.d.ts +12 -0
- package/lib/cjs/hooks/useCommerceLayer.js +2 -0
- package/lib/cjs/hooks/useCustomerContainer.d.ts +12 -0
- package/lib/cjs/hooks/useCustomerContainer.js +2 -0
- package/lib/cjs/hooks/useOrderContainer.d.ts +16 -0
- package/lib/cjs/hooks/useOrderContainer.js +2 -0
- package/lib/cjs/index.d.ts +107 -0
- package/lib/cjs/index.js +2 -0
- package/lib/cjs/reducers/AddressReducer.d.ts +80 -0
- package/lib/cjs/reducers/AddressReducer.js +2 -0
- package/lib/cjs/reducers/AvailabilityReducer.d.ts +53 -0
- package/lib/cjs/reducers/AvailabilityReducer.js +2 -0
- package/lib/cjs/reducers/BillingAddressReducer.d.ts +31 -0
- package/lib/cjs/reducers/BillingAddressReducer.js +2 -0
- package/lib/cjs/reducers/CustomerReducer.d.ts +183 -0
- package/lib/cjs/reducers/CustomerReducer.js +2 -0
- package/lib/cjs/reducers/GiftCardReducer.d.ts +66 -0
- package/lib/cjs/reducers/GiftCardReducer.js +2 -0
- package/lib/cjs/reducers/InStockSubscriptionReducer.d.ts +33 -0
- package/lib/cjs/reducers/InStockSubscriptionReducer.js +2 -0
- package/lib/cjs/reducers/LineItemReducer.d.ts +47 -0
- package/lib/cjs/reducers/LineItemReducer.js +2 -0
- package/lib/cjs/reducers/OrderReducer.d.ts +171 -0
- package/lib/cjs/reducers/OrderReducer.js +2 -0
- package/lib/cjs/reducers/PaymentMethodReducer.d.ts +161 -0
- package/lib/cjs/reducers/PaymentMethodReducer.js +2 -0
- package/lib/cjs/reducers/PlaceOrderReducer.d.ts +72 -0
- package/lib/cjs/reducers/PlaceOrderReducer.js +2 -0
- package/lib/cjs/reducers/PriceReducer.d.ts +35 -0
- package/lib/cjs/reducers/PriceReducer.js +2 -0
- package/lib/cjs/reducers/ShipmentReducer.d.ts +41 -0
- package/lib/cjs/reducers/ShipmentReducer.js +2 -0
- package/lib/cjs/reducers/ShippingAddressReducer.d.ts +32 -0
- package/lib/cjs/reducers/ShippingAddressReducer.js +2 -0
- package/lib/cjs/reducers/SkuListsReducer.d.ts +21 -0
- package/lib/cjs/reducers/SkuListsReducer.js +2 -0
- package/lib/cjs/reducers/SkuReducer.d.ts +21 -0
- package/lib/cjs/reducers/SkuReducer.js +2 -0
- package/lib/cjs/typings/errors.d.ts +15 -0
- package/lib/cjs/typings/errors.js +2 -0
- package/lib/cjs/typings/globals.d.ts +6 -0
- package/lib/cjs/typings/globals.js +2 -0
- package/lib/cjs/typings/index.d.ts +117 -0
- package/lib/cjs/typings/index.js +2 -0
- package/lib/cjs/utils/PropsType.d.ts +33 -0
- package/lib/cjs/utils/PropsType.js +2 -0
- package/lib/cjs/utils/addressesManager.d.ts +64 -0
- package/lib/cjs/utils/addressesManager.js +2 -0
- package/lib/cjs/utils/adyen/manageGiftCard.d.ts +16 -0
- package/lib/cjs/utils/adyen/manageGiftCard.js +2 -0
- package/lib/cjs/utils/baseReducer.d.ts +3 -0
- package/lib/cjs/utils/baseReducer.js +2 -0
- package/lib/cjs/utils/browserInfo.d.ts +12 -0
- package/lib/cjs/utils/browserInfo.js +2 -0
- package/lib/cjs/utils/canPlaceOrder.d.ts +5 -0
- package/lib/cjs/utils/canPlaceOrder.js +2 -0
- package/lib/cjs/utils/checkIncludeResource.d.ts +8 -0
- package/lib/cjs/utils/checkIncludeResource.js +2 -0
- package/lib/cjs/utils/compareObjAttribute.d.ts +7 -0
- package/lib/cjs/utils/compareObjAttribute.js +2 -0
- package/lib/cjs/utils/countryStateCity.d.ts +801 -0
- package/lib/cjs/utils/countryStateCity.js +2 -0
- package/lib/cjs/utils/customMessages.d.ts +2 -0
- package/lib/cjs/utils/customMessages.js +2 -0
- package/lib/cjs/utils/customerOrderOptions.d.ts +3 -0
- package/lib/cjs/utils/customerOrderOptions.js +2 -0
- package/lib/cjs/utils/events.d.ts +5 -0
- package/lib/cjs/utils/events.js +2 -0
- package/lib/cjs/utils/expressPaymentHelper.d.ts +92 -0
- package/lib/cjs/utils/expressPaymentHelper.js +2 -0
- package/lib/cjs/utils/filterChildren.d.ts +12 -0
- package/lib/cjs/utils/filterChildren.js +2 -0
- package/lib/cjs/utils/formCleaner.d.ts +4 -0
- package/lib/cjs/utils/formCleaner.js +2 -0
- package/lib/cjs/utils/getAmount.d.ts +7 -0
- package/lib/cjs/utils/getAmount.js +2 -0
- package/lib/cjs/utils/getApplicationLink.d.ts +35 -0
- package/lib/cjs/utils/getApplicationLink.js +2 -0
- package/lib/cjs/utils/getCardDetails.d.ts +16 -0
- package/lib/cjs/utils/getCardDetails.js +2 -0
- package/lib/cjs/utils/getCustomerIdByToken.d.ts +6 -0
- package/lib/cjs/utils/getCustomerIdByToken.js +2 -0
- package/lib/cjs/utils/getDomain.d.ts +4 -0
- package/lib/cjs/utils/getDomain.js +2 -0
- package/lib/cjs/utils/getErrors.d.ts +19 -0
- package/lib/cjs/utils/getErrors.js +2 -0
- package/lib/cjs/utils/getLineItemsCount.d.ts +10 -0
- package/lib/cjs/utils/getLineItemsCount.js +2 -0
- package/lib/cjs/utils/getLoaderComponent.d.ts +3 -0
- package/lib/cjs/utils/getLoaderComponent.js +2 -0
- package/lib/cjs/utils/getPaymentAttributes.d.ts +17 -0
- package/lib/cjs/utils/getPaymentAttributes.js +2 -0
- package/lib/cjs/utils/getPrices.d.ts +6 -0
- package/lib/cjs/utils/getPrices.js +2 -0
- package/lib/cjs/utils/getPublicIp.d.ts +1 -0
- package/lib/cjs/utils/getPublicIp.js +2 -0
- package/lib/cjs/utils/getSdk.d.ts +3 -0
- package/lib/cjs/utils/getSdk.js +2 -0
- package/lib/cjs/utils/getSkus.d.ts +3 -0
- package/lib/cjs/utils/getSkus.js +2 -0
- package/lib/cjs/utils/hasSubscriptions.d.ts +7 -0
- package/lib/cjs/utils/hasSubscriptions.js +2 -0
- package/lib/cjs/utils/hooks/useCustomContext.d.ts +21 -0
- package/lib/cjs/utils/hooks/useCustomContext.js +2 -0
- package/lib/cjs/utils/hooks/useExternalScript.d.ts +1 -0
- package/lib/cjs/utils/hooks/useExternalScript.js +2 -0
- package/lib/cjs/utils/icons.d.ts +2 -0
- package/lib/cjs/utils/icons.js +2 -0
- package/lib/cjs/utils/isDate.d.ts +1 -0
- package/lib/cjs/utils/isDate.js +2 -0
- package/lib/cjs/utils/isEmpty.d.ts +1 -0
- package/lib/cjs/utils/isEmpty.js +2 -0
- package/lib/cjs/utils/isGuestToken.d.ts +6 -0
- package/lib/cjs/utils/isGuestToken.js +2 -0
- package/lib/cjs/utils/isJSON.d.ts +1 -0
- package/lib/cjs/utils/isJSON.js +2 -0
- package/lib/cjs/utils/jwt.d.ts +27 -0
- package/lib/cjs/utils/jwt.js +2 -0
- package/lib/cjs/utils/localStorage.d.ts +11 -0
- package/lib/cjs/utils/localStorage.js +2 -0
- package/lib/cjs/utils/omit.d.ts +1 -0
- package/lib/cjs/utils/omit.js +2 -0
- package/lib/cjs/utils/organization.d.ts +18 -0
- package/lib/cjs/utils/organization.js +2 -0
- package/lib/cjs/utils/payment-methods/sortPaymentMethods.d.ts +2 -0
- package/lib/cjs/utils/payment-methods/sortPaymentMethods.js +2 -0
- package/lib/cjs/utils/pick.d.ts +1 -0
- package/lib/cjs/utils/pick.js +2 -0
- package/lib/cjs/utils/placeholderImages.d.ts +2 -0
- package/lib/cjs/utils/placeholderImages.js +2 -0
- package/lib/cjs/utils/promisify.d.ts +1 -0
- package/lib/cjs/utils/promisify.js +2 -0
- package/lib/cjs/utils/replace.d.ts +2 -0
- package/lib/cjs/utils/replace.js +2 -0
- package/lib/cjs/utils/scrollbarWidth.d.ts +1 -0
- package/lib/cjs/utils/scrollbarWidth.js +2 -0
- package/lib/cjs/utils/shipments.d.ts +3 -0
- package/lib/cjs/utils/shipments.js +2 -0
- package/lib/cjs/utils/snakeToCamelCase.d.ts +5 -0
- package/lib/cjs/utils/snakeToCamelCase.js +2 -0
- package/lib/cjs/utils/stripe/retrievePaymentIntent.d.ts +14 -0
- package/lib/cjs/utils/stripe/retrievePaymentIntent.js +2 -0
- package/lib/cjs/utils/triggerAttributeHelper.d.ts +31 -0
- package/lib/cjs/utils/triggerAttributeHelper.js +2 -0
- package/lib/cjs/utils/updateOrderSubscriptionCustomerPaymentSource.d.ts +8 -0
- package/lib/cjs/utils/updateOrderSubscriptionCustomerPaymentSource.js +2 -0
- package/lib/cjs/utils/validateFormFields.d.ts +16 -0
- package/lib/cjs/utils/validateFormFields.js +2 -0
- package/lib/esm/components/ExternalFunction.d.ts +7 -0
- package/lib/esm/components/ExternalFunction.js +2 -0
- package/lib/esm/components/MetadataInput.d.ts +5 -0
- package/lib/esm/components/MetadataInput.js +2 -0
- package/lib/esm/components/SubmitButton.d.ts +10 -0
- package/lib/esm/components/SubmitButton.js +2 -0
- package/lib/esm/components/addresses/Address.d.ts +31 -0
- package/lib/esm/components/addresses/Address.js +2 -0
- package/lib/esm/components/addresses/AddressCountrySelector.d.ts +34 -0
- package/lib/esm/components/addresses/AddressCountrySelector.js +2 -0
- package/lib/esm/components/addresses/AddressField.d.ts +61 -0
- package/lib/esm/components/addresses/AddressField.js +2 -0
- package/lib/esm/components/addresses/AddressInput.d.ts +34 -0
- package/lib/esm/components/addresses/AddressInput.js +2 -0
- package/lib/esm/components/addresses/AddressInputSelect.d.ts +29 -0
- package/lib/esm/components/addresses/AddressInputSelect.js +2 -0
- package/lib/esm/components/addresses/AddressStateSelector.d.ts +50 -0
- package/lib/esm/components/addresses/AddressStateSelector.js +2 -0
- package/lib/esm/components/addresses/AddressesContainer.d.ts +40 -0
- package/lib/esm/components/addresses/AddressesContainer.js +2 -0
- package/lib/esm/components/addresses/AddressesEmpty.d.ts +26 -0
- package/lib/esm/components/addresses/AddressesEmpty.js +2 -0
- package/lib/esm/components/addresses/BillingAddressContainer.d.ts +6 -0
- package/lib/esm/components/addresses/BillingAddressContainer.js +2 -0
- package/lib/esm/components/addresses/BillingAddressForm.d.ts +34 -0
- package/lib/esm/components/addresses/BillingAddressForm.js +2 -0
- package/lib/esm/components/addresses/SaveAddressesButton.d.ts +18 -0
- package/lib/esm/components/addresses/SaveAddressesButton.js +2 -0
- package/lib/esm/components/addresses/ShippingAddressContainer.d.ts +7 -0
- package/lib/esm/components/addresses/ShippingAddressContainer.js +2 -0
- package/lib/esm/components/addresses/ShippingAddressForm.d.ts +31 -0
- package/lib/esm/components/addresses/ShippingAddressForm.js +2 -0
- package/lib/esm/components/auth/CommerceLayer.d.ts +25 -0
- package/lib/esm/components/auth/CommerceLayer.js +2 -0
- package/lib/esm/components/customers/CustomerAddressForm.d.ts +13 -0
- package/lib/esm/components/customers/CustomerAddressForm.js +2 -0
- package/lib/esm/components/customers/CustomerContainer.d.ts +38 -0
- package/lib/esm/components/customers/CustomerContainer.js +2 -0
- package/lib/esm/components/customers/CustomerField.d.ts +25 -0
- package/lib/esm/components/customers/CustomerField.js +2 -0
- package/lib/esm/components/customers/CustomerInput.d.ts +11 -0
- package/lib/esm/components/customers/CustomerInput.js +2 -0
- package/lib/esm/components/customers/CustomerPaymentSource.d.ts +11 -0
- package/lib/esm/components/customers/CustomerPaymentSource.js +2 -0
- package/lib/esm/components/customers/CustomerPaymentSourceEmpty.d.ts +14 -0
- package/lib/esm/components/customers/CustomerPaymentSourceEmpty.js +2 -0
- package/lib/esm/components/customers/MyAccountLink.d.ts +38 -0
- package/lib/esm/components/customers/MyAccountLink.js +2 -0
- package/lib/esm/components/customers/MyIdentityLink.d.ts +59 -0
- package/lib/esm/components/customers/MyIdentityLink.js +2 -0
- package/lib/esm/components/customers/SaveCustomerButton.d.ts +12 -0
- package/lib/esm/components/customers/SaveCustomerButton.js +2 -0
- package/lib/esm/components/errors/Errors.d.ts +31 -0
- package/lib/esm/components/errors/Errors.js +2 -0
- package/lib/esm/components/gift_cards/GiftCard.d.ts +10 -0
- package/lib/esm/components/gift_cards/GiftCard.js +2 -0
- package/lib/esm/components/gift_cards/GiftCardContainer.d.ts +6 -0
- package/lib/esm/components/gift_cards/GiftCardContainer.js +2 -0
- package/lib/esm/components/gift_cards/GiftCardCurrencySelector.d.ts +7 -0
- package/lib/esm/components/gift_cards/GiftCardCurrencySelector.js +2 -0
- package/lib/esm/components/gift_cards/GiftCardInput.d.ts +7 -0
- package/lib/esm/components/gift_cards/GiftCardInput.js +2 -0
- package/lib/esm/components/gift_cards/GiftCardOrCouponCode.d.ts +16 -0
- package/lib/esm/components/gift_cards/GiftCardOrCouponCode.js +2 -0
- package/lib/esm/components/gift_cards/GiftCardOrCouponForm.d.ts +15 -0
- package/lib/esm/components/gift_cards/GiftCardOrCouponForm.js +2 -0
- package/lib/esm/components/gift_cards/GiftCardOrCouponInput.d.ts +11 -0
- package/lib/esm/components/gift_cards/GiftCardOrCouponInput.js +2 -0
- package/lib/esm/components/gift_cards/GiftCardOrCouponRemoveButton.d.ts +20 -0
- package/lib/esm/components/gift_cards/GiftCardOrCouponRemoveButton.js +2 -0
- package/lib/esm/components/gift_cards/GiftCardOrCouponSubmit.d.ts +10 -0
- package/lib/esm/components/gift_cards/GiftCardOrCouponSubmit.js +2 -0
- package/lib/esm/components/gift_cards/GiftCardRecipientInput.d.ts +0 -0
- package/lib/esm/components/gift_cards/GiftCardRecipientInput.js +2 -0
- package/lib/esm/components/in_stock_subscriptions/InStockSubscriptionButton.d.ts +36 -0
- package/lib/esm/components/in_stock_subscriptions/InStockSubscriptionButton.js +2 -0
- package/lib/esm/components/in_stock_subscriptions/InStockSubscriptionsContainer.d.ts +10 -0
- package/lib/esm/components/in_stock_subscriptions/InStockSubscriptionsContainer.js +2 -0
- package/lib/esm/components/line_items/LineItem.d.ts +8 -0
- package/lib/esm/components/line_items/LineItem.js +2 -0
- package/lib/esm/components/line_items/LineItemAmount.d.ts +7 -0
- package/lib/esm/components/line_items/LineItemAmount.js +2 -0
- package/lib/esm/components/line_items/LineItemCode.d.ts +13 -0
- package/lib/esm/components/line_items/LineItemCode.js +2 -0
- package/lib/esm/components/line_items/LineItemField.d.ts +14 -0
- package/lib/esm/components/line_items/LineItemField.js +2 -0
- package/lib/esm/components/line_items/LineItemImage.d.ts +17 -0
- package/lib/esm/components/line_items/LineItemImage.js +2 -0
- package/lib/esm/components/line_items/LineItemName.d.ts +12 -0
- package/lib/esm/components/line_items/LineItemName.js +2 -0
- package/lib/esm/components/line_items/LineItemOption.d.ts +19 -0
- package/lib/esm/components/line_items/LineItemOption.js +2 -0
- package/lib/esm/components/line_items/LineItemOptions.d.ts +16 -0
- package/lib/esm/components/line_items/LineItemOptions.js +2 -0
- package/lib/esm/components/line_items/LineItemQuantity.d.ts +21 -0
- package/lib/esm/components/line_items/LineItemQuantity.js +2 -0
- package/lib/esm/components/line_items/LineItemRemoveLink.d.ts +14 -0
- package/lib/esm/components/line_items/LineItemRemoveLink.js +2 -0
- package/lib/esm/components/line_items/LineItemsContainer.d.ts +9 -0
- package/lib/esm/components/line_items/LineItemsContainer.js +2 -0
- package/lib/esm/components/line_items/LineItemsCount.d.ts +12 -0
- package/lib/esm/components/line_items/LineItemsCount.js +2 -0
- package/lib/esm/components/line_items/LineItemsEmpty.d.ts +12 -0
- package/lib/esm/components/line_items/LineItemsEmpty.js +2 -0
- package/lib/esm/components/orders/AddToCartButton.d.ts +95 -0
- package/lib/esm/components/orders/AddToCartButton.js +2 -0
- package/lib/esm/components/orders/AdjustmentAmount.d.ts +4 -0
- package/lib/esm/components/orders/AdjustmentAmount.js +2 -0
- package/lib/esm/components/orders/CartLink.d.ts +47 -0
- package/lib/esm/components/orders/CartLink.js +2 -0
- package/lib/esm/components/orders/CheckoutLink.d.ts +28 -0
- package/lib/esm/components/orders/CheckoutLink.js +2 -0
- package/lib/esm/components/orders/DiscountAmount.d.ts +4 -0
- package/lib/esm/components/orders/DiscountAmount.js +2 -0
- package/lib/esm/components/orders/GiftCardAmount.d.ts +4 -0
- package/lib/esm/components/orders/GiftCardAmount.js +2 -0
- package/lib/esm/components/orders/HostedCart.d.ts +58 -0
- package/lib/esm/components/orders/HostedCart.js +2 -0
- package/lib/esm/components/orders/OrderContainer.d.ts +62 -0
- package/lib/esm/components/orders/OrderContainer.js +2 -0
- package/lib/esm/components/orders/OrderList.d.ts +83 -0
- package/lib/esm/components/orders/OrderList.js +2 -0
- package/lib/esm/components/orders/OrderListEmpty.d.ts +17 -0
- package/lib/esm/components/orders/OrderListEmpty.js +2 -0
- package/lib/esm/components/orders/OrderListPaginationButtons.d.ts +48 -0
- package/lib/esm/components/orders/OrderListPaginationButtons.js +2 -0
- package/lib/esm/components/orders/OrderListPaginationInfo.d.ts +29 -0
- package/lib/esm/components/orders/OrderListPaginationInfo.js +2 -0
- package/lib/esm/components/orders/OrderListRow.d.ts +29 -0
- package/lib/esm/components/orders/OrderListRow.js +2 -0
- package/lib/esm/components/orders/OrderNumber.d.ts +5 -0
- package/lib/esm/components/orders/OrderNumber.js +2 -0
- package/lib/esm/components/orders/OrderStorage.d.ts +31 -0
- package/lib/esm/components/orders/OrderStorage.js +2 -0
- package/lib/esm/components/orders/PaymentMethodAmount.d.ts +4 -0
- package/lib/esm/components/orders/PaymentMethodAmount.js +2 -0
- package/lib/esm/components/orders/PlaceOrderButton.d.ts +35 -0
- package/lib/esm/components/orders/PlaceOrderButton.js +2 -0
- package/lib/esm/components/orders/PlaceOrderContainer.d.ts +8 -0
- package/lib/esm/components/orders/PlaceOrderContainer.js +2 -0
- package/lib/esm/components/orders/PrivacyAndTermsCheckbox.d.ts +4 -0
- package/lib/esm/components/orders/PrivacyAndTermsCheckbox.js +2 -0
- package/lib/esm/components/orders/ShippingAmount.d.ts +4 -0
- package/lib/esm/components/orders/ShippingAmount.js +2 -0
- package/lib/esm/components/orders/SubTotalAmount.d.ts +4 -0
- package/lib/esm/components/orders/SubTotalAmount.js +2 -0
- package/lib/esm/components/orders/TaxesAmount.d.ts +4 -0
- package/lib/esm/components/orders/TaxesAmount.js +2 -0
- package/lib/esm/components/orders/TotalAmount.d.ts +4 -0
- package/lib/esm/components/orders/TotalAmount.js +2 -0
- package/lib/esm/components/parcels/ParcelField.d.ts +14 -0
- package/lib/esm/components/parcels/ParcelField.js +2 -0
- package/lib/esm/components/parcels/ParcelLineItem.d.ts +7 -0
- package/lib/esm/components/parcels/ParcelLineItem.js +2 -0
- package/lib/esm/components/parcels/ParcelLineItemField.d.ts +14 -0
- package/lib/esm/components/parcels/ParcelLineItemField.js +2 -0
- package/lib/esm/components/parcels/ParcelLineItemsCount.d.ts +18 -0
- package/lib/esm/components/parcels/ParcelLineItemsCount.js +2 -0
- package/lib/esm/components/parcels/Parcels.d.ts +7 -0
- package/lib/esm/components/parcels/Parcels.js +2 -0
- package/lib/esm/components/parcels/ParcelsCount.d.ts +18 -0
- package/lib/esm/components/parcels/ParcelsCount.js +2 -0
- package/lib/esm/components/payment_gateways/AdyenGateway.d.ts +5 -0
- package/lib/esm/components/payment_gateways/AdyenGateway.js +2 -0
- package/lib/esm/components/payment_gateways/BraintreeGateway.d.ts +5 -0
- package/lib/esm/components/payment_gateways/BraintreeGateway.js +2 -0
- package/lib/esm/components/payment_gateways/CheckoutComGateway.d.ts +5 -0
- package/lib/esm/components/payment_gateways/CheckoutComGateway.js +2 -0
- package/lib/esm/components/payment_gateways/ExternalGateway.d.ts +5 -0
- package/lib/esm/components/payment_gateways/ExternalGateway.js +2 -0
- package/lib/esm/components/payment_gateways/KlarnaGateway.d.ts +5 -0
- package/lib/esm/components/payment_gateways/KlarnaGateway.js +2 -0
- package/lib/esm/components/payment_gateways/PaymentGateway.d.ts +16 -0
- package/lib/esm/components/payment_gateways/PaymentGateway.js +2 -0
- package/lib/esm/components/payment_gateways/PaypalGateway.d.ts +5 -0
- package/lib/esm/components/payment_gateways/PaypalGateway.js +2 -0
- package/lib/esm/components/payment_gateways/StripeGateway.d.ts +5 -0
- package/lib/esm/components/payment_gateways/StripeGateway.js +2 -0
- package/lib/esm/components/payment_gateways/WireTransferGateway.d.ts +5 -0
- package/lib/esm/components/payment_gateways/WireTransferGateway.js +2 -0
- package/lib/esm/components/payment_methods/PaymentMethod.d.ts +45 -0
- package/lib/esm/components/payment_methods/PaymentMethod.js +2 -0
- package/lib/esm/components/payment_methods/PaymentMethodName.d.ts +10 -0
- package/lib/esm/components/payment_methods/PaymentMethodName.js +2 -0
- package/lib/esm/components/payment_methods/PaymentMethodPrice.d.ts +8 -0
- package/lib/esm/components/payment_methods/PaymentMethodPrice.js +2 -0
- package/lib/esm/components/payment_methods/PaymentMethodRadioButton.d.ts +17 -0
- package/lib/esm/components/payment_methods/PaymentMethodRadioButton.js +2 -0
- package/lib/esm/components/payment_methods/PaymentMethodsContainer.d.ts +8 -0
- package/lib/esm/components/payment_methods/PaymentMethodsContainer.js +2 -0
- package/lib/esm/components/payment_source/AdyenPayment.d.ts +66 -0
- package/lib/esm/components/payment_source/AdyenPayment.js +2 -0
- package/lib/esm/components/payment_source/BraintreePayment.d.ts +32 -0
- package/lib/esm/components/payment_source/BraintreePayment.js +2 -0
- package/lib/esm/components/payment_source/CheckoutComPayment.d.ts +23 -0
- package/lib/esm/components/payment_source/CheckoutComPayment.js +2 -0
- package/lib/esm/components/payment_source/ExternalPayment.d.ts +24 -0
- package/lib/esm/components/payment_source/ExternalPayment.js +2 -0
- package/lib/esm/components/payment_source/KlarnaPayment.d.ts +10 -0
- package/lib/esm/components/payment_source/KlarnaPayment.js +2 -0
- package/lib/esm/components/payment_source/PaymentSource.d.ts +19 -0
- package/lib/esm/components/payment_source/PaymentSource.js +2 -0
- package/lib/esm/components/payment_source/PaymentSourceBrandIcon.d.ts +15 -0
- package/lib/esm/components/payment_source/PaymentSourceBrandIcon.js +2 -0
- package/lib/esm/components/payment_source/PaymentSourceBrandName.d.ts +12 -0
- package/lib/esm/components/payment_source/PaymentSourceBrandName.js +2 -0
- package/lib/esm/components/payment_source/PaymentSourceDetail.d.ts +15 -0
- package/lib/esm/components/payment_source/PaymentSourceDetail.js +2 -0
- package/lib/esm/components/payment_source/PaymentSourceEditButton.d.ts +10 -0
- package/lib/esm/components/payment_source/PaymentSourceEditButton.js +2 -0
- package/lib/esm/components/payment_source/PaypalPayment.d.ts +12 -0
- package/lib/esm/components/payment_source/PaypalPayment.js +2 -0
- package/lib/esm/components/payment_source/StripeExpressPayment.d.ts +6 -0
- package/lib/esm/components/payment_source/StripeExpressPayment.js +2 -0
- package/lib/esm/components/payment_source/StripePayment.d.ts +22 -0
- package/lib/esm/components/payment_source/StripePayment.js +2 -0
- package/lib/esm/components/payment_source/WireTransferPayment.d.ts +12 -0
- package/lib/esm/components/payment_source/WireTransferPayment.js +2 -0
- package/lib/esm/components/prices/Price.d.ts +35 -0
- package/lib/esm/components/prices/Price.js +2 -0
- package/lib/esm/components/prices/PricesContainer.d.ts +41 -0
- package/lib/esm/components/prices/PricesContainer.js +2 -0
- package/lib/esm/components/shipments/Shipment.d.ts +10 -0
- package/lib/esm/components/shipments/Shipment.js +2 -0
- package/lib/esm/components/shipments/ShipmentField.d.ts +12 -0
- package/lib/esm/components/shipments/ShipmentField.js +2 -0
- package/lib/esm/components/shipments/ShipmentsContainer.d.ts +6 -0
- package/lib/esm/components/shipments/ShipmentsContainer.js +2 -0
- package/lib/esm/components/shipments/ShipmentsCount.d.ts +18 -0
- package/lib/esm/components/shipments/ShipmentsCount.js +2 -0
- package/lib/esm/components/shipping_methods/ShippingMethod.d.ts +8 -0
- package/lib/esm/components/shipping_methods/ShippingMethod.js +2 -0
- package/lib/esm/components/shipping_methods/ShippingMethodName.d.ts +11 -0
- package/lib/esm/components/shipping_methods/ShippingMethodName.js +2 -0
- package/lib/esm/components/shipping_methods/ShippingMethodPrice.d.ts +20 -0
- package/lib/esm/components/shipping_methods/ShippingMethodPrice.js +2 -0
- package/lib/esm/components/shipping_methods/ShippingMethodRadioButton.d.ts +17 -0
- package/lib/esm/components/shipping_methods/ShippingMethodRadioButton.js +2 -0
- package/lib/esm/components/skus/AvailabilityContainer.d.ts +34 -0
- package/lib/esm/components/skus/AvailabilityContainer.js +2 -0
- package/lib/esm/components/skus/AvailabilityTemplate.d.ts +52 -0
- package/lib/esm/components/skus/AvailabilityTemplate.js +2 -0
- package/lib/esm/components/skus/DeliveryLeadTime.d.ts +10 -0
- package/lib/esm/components/skus/DeliveryLeadTime.js +2 -0
- package/lib/esm/components/skus/SkuField.d.ts +25 -0
- package/lib/esm/components/skus/SkuField.js +2 -0
- package/lib/esm/components/skus/SkuList.d.ts +10 -0
- package/lib/esm/components/skus/SkuList.js +2 -0
- package/lib/esm/components/skus/SkuListsContainer.d.ts +6 -0
- package/lib/esm/components/skus/SkuListsContainer.js +2 -0
- package/lib/esm/components/skus/Skus.d.ts +18 -0
- package/lib/esm/components/skus/Skus.js +2 -0
- package/lib/esm/components/skus/SkusContainer.d.ts +31 -0
- package/lib/esm/components/skus/SkusContainer.js +2 -0
- package/lib/esm/components/stock_transfers/StockTransfer.d.ts +7 -0
- package/lib/esm/components/stock_transfers/StockTransfer.js +2 -0
- package/lib/esm/components/stock_transfers/StockTransferField.d.ts +10 -0
- package/lib/esm/components/stock_transfers/StockTransferField.js +2 -0
- package/lib/esm/components/utils/AddressCardsTemplate.d.ts +26 -0
- package/lib/esm/components/utils/AddressCardsTemplate.js +2 -0
- package/lib/esm/components/utils/BaseField.d.ts +8 -0
- package/lib/esm/components/utils/BaseField.js +2 -0
- package/lib/esm/components/utils/BaseInput.d.ts +5 -0
- package/lib/esm/components/utils/BaseInput.js +2 -0
- package/lib/esm/components/utils/BaseOrderPrice.d.ts +6 -0
- package/lib/esm/components/utils/BaseOrderPrice.js +2 -0
- package/lib/esm/components/utils/BaseSelect.d.ts +5 -0
- package/lib/esm/components/utils/BaseSelect.js +2 -0
- package/lib/esm/components/utils/ErrorBoundary.d.ts +14 -0
- package/lib/esm/components/utils/ErrorBoundary.js +2 -0
- package/lib/esm/components/utils/GenericFieldComponent.d.ts +58 -0
- package/lib/esm/components/utils/GenericFieldComponent.js +2 -0
- package/lib/esm/components/utils/Parent.d.ts +6 -0
- package/lib/esm/components/utils/Parent.js +2 -0
- package/lib/esm/components/utils/PaymentCardsTemplate.d.ts +41 -0
- package/lib/esm/components/utils/PaymentCardsTemplate.js +2 -0
- package/lib/esm/components/utils/PriceTemplate.d.ts +8 -0
- package/lib/esm/components/utils/PriceTemplate.js +2 -0
- package/lib/esm/components/utils/getAllErrors.d.ts +16 -0
- package/lib/esm/components/utils/getAllErrors.js +2 -0
- package/lib/esm/config/currency.d.ts +5 -0
- package/lib/esm/config/currency.js +2 -0
- package/lib/esm/context/AddressChildrenContext.d.ts +6 -0
- package/lib/esm/context/AddressChildrenContext.js +2 -0
- package/lib/esm/context/AddressContext.d.ts +18 -0
- package/lib/esm/context/AddressContext.js +2 -0
- package/lib/esm/context/AvailabilityContext.d.ts +2 -0
- package/lib/esm/context/AvailabilityContext.js +2 -0
- package/lib/esm/context/BillingAddressContext.d.ts +9 -0
- package/lib/esm/context/BillingAddressContext.js +2 -0
- package/lib/esm/context/BillingAddressFormContext.d.ts +22 -0
- package/lib/esm/context/BillingAddressFormContext.js +2 -0
- package/lib/esm/context/CommerceLayerContext.d.ts +6 -0
- package/lib/esm/context/CommerceLayerContext.js +2 -0
- package/lib/esm/context/CouponAndGiftCardFormContext.d.ts +8 -0
- package/lib/esm/context/CouponAndGiftCardFormContext.js +2 -0
- package/lib/esm/context/CustomerAddressFormContext.d.ts +17 -0
- package/lib/esm/context/CustomerAddressFormContext.js +2 -0
- package/lib/esm/context/CustomerContext.d.ts +29 -0
- package/lib/esm/context/CustomerContext.js +2 -0
- package/lib/esm/context/CustomerPaymentSourceContext.d.ts +11 -0
- package/lib/esm/context/CustomerPaymentSourceContext.js +2 -0
- package/lib/esm/context/ExternalFunctionContext.d.ts +11 -0
- package/lib/esm/context/ExternalFunctionContext.js +2 -0
- package/lib/esm/context/GiftCardContext.d.ts +10 -0
- package/lib/esm/context/GiftCardContext.js +2 -0
- package/lib/esm/context/InStockSubscriptionContext.d.ts +6 -0
- package/lib/esm/context/InStockSubscriptionContext.js +2 -0
- package/lib/esm/context/LineItemChildrenContext.d.ts +8 -0
- package/lib/esm/context/LineItemChildrenContext.js +2 -0
- package/lib/esm/context/LineItemContext.d.ts +7 -0
- package/lib/esm/context/LineItemContext.js +2 -0
- package/lib/esm/context/LineItemOptionChildrenContext.d.ts +9 -0
- package/lib/esm/context/LineItemOptionChildrenContext.js +2 -0
- package/lib/esm/context/OrderContext.d.ts +30 -0
- package/lib/esm/context/OrderContext.js +2 -0
- package/lib/esm/context/OrderListChildrenContext.d.ts +73 -0
- package/lib/esm/context/OrderListChildrenContext.js +2 -0
- package/lib/esm/context/OrderListPaginationContext.d.ts +15 -0
- package/lib/esm/context/OrderListPaginationContext.js +2 -0
- package/lib/esm/context/OrderStorageContext.d.ts +10 -0
- package/lib/esm/context/OrderStorageContext.js +2 -0
- package/lib/esm/context/ParcelChildrenContext.d.ts +6 -0
- package/lib/esm/context/ParcelChildrenContext.js +2 -0
- package/lib/esm/context/ParcelLineItemChildrenContext.d.ts +6 -0
- package/lib/esm/context/ParcelLineItemChildrenContext.js +2 -0
- package/lib/esm/context/PaymentMethodChildrenContext.d.ts +10 -0
- package/lib/esm/context/PaymentMethodChildrenContext.js +2 -0
- package/lib/esm/context/PaymentMethodContext.d.ts +13 -0
- package/lib/esm/context/PaymentMethodContext.js +2 -0
- package/lib/esm/context/PaymentSourceContext.d.ts +14 -0
- package/lib/esm/context/PaymentSourceContext.js +2 -0
- package/lib/esm/context/PlaceOrderContext.d.ts +12 -0
- package/lib/esm/context/PlaceOrderContext.js +2 -0
- package/lib/esm/context/PricesContext.d.ts +6 -0
- package/lib/esm/context/PricesContext.js +2 -0
- package/lib/esm/context/ShipmentChildrenContext.d.ts +13 -0
- package/lib/esm/context/ShipmentChildrenContext.js +2 -0
- package/lib/esm/context/ShipmentContext.d.ts +10 -0
- package/lib/esm/context/ShipmentContext.js +2 -0
- package/lib/esm/context/ShippingAddressContext.d.ts +9 -0
- package/lib/esm/context/ShippingAddressContext.js +2 -0
- package/lib/esm/context/ShippingAddressFormContext.d.ts +3 -0
- package/lib/esm/context/ShippingAddressFormContext.js +2 -0
- package/lib/esm/context/ShippingMethodChildrenContext.d.ts +9 -0
- package/lib/esm/context/ShippingMethodChildrenContext.js +2 -0
- package/lib/esm/context/SkuChildrenContext.d.ts +8 -0
- package/lib/esm/context/SkuChildrenContext.js +2 -0
- package/lib/esm/context/SkuContext.d.ts +8 -0
- package/lib/esm/context/SkuContext.js +2 -0
- package/lib/esm/context/SkuListsContext.d.ts +5 -0
- package/lib/esm/context/SkuListsContext.js +2 -0
- package/lib/esm/context/StockTransferChildrenContext.d.ts +6 -0
- package/lib/esm/context/StockTransferChildrenContext.js +2 -0
- package/lib/esm/hooks/useCommerceLayer.d.ts +12 -0
- package/lib/esm/hooks/useCommerceLayer.js +2 -0
- package/lib/esm/hooks/useCustomerContainer.d.ts +12 -0
- package/lib/esm/hooks/useCustomerContainer.js +2 -0
- package/lib/esm/hooks/useOrderContainer.d.ts +16 -0
- package/lib/esm/hooks/useOrderContainer.js +2 -0
- package/lib/esm/index.d.ts +107 -0
- package/lib/esm/index.js +2 -0
- package/lib/esm/reducers/AddressReducer.d.ts +80 -0
- package/lib/esm/reducers/AddressReducer.js +2 -0
- package/lib/esm/reducers/AvailabilityReducer.d.ts +53 -0
- package/lib/esm/reducers/AvailabilityReducer.js +2 -0
- package/lib/esm/reducers/BillingAddressReducer.d.ts +31 -0
- package/lib/esm/reducers/BillingAddressReducer.js +2 -0
- package/lib/esm/reducers/CustomerReducer.d.ts +183 -0
- package/lib/esm/reducers/CustomerReducer.js +2 -0
- package/lib/esm/reducers/GiftCardReducer.d.ts +66 -0
- package/lib/esm/reducers/GiftCardReducer.js +2 -0
- package/lib/esm/reducers/InStockSubscriptionReducer.d.ts +33 -0
- package/lib/esm/reducers/InStockSubscriptionReducer.js +2 -0
- package/lib/esm/reducers/LineItemReducer.d.ts +47 -0
- package/lib/esm/reducers/LineItemReducer.js +2 -0
- package/lib/esm/reducers/OrderReducer.d.ts +171 -0
- package/lib/esm/reducers/OrderReducer.js +2 -0
- package/lib/esm/reducers/PaymentMethodReducer.d.ts +161 -0
- package/lib/esm/reducers/PaymentMethodReducer.js +2 -0
- package/lib/esm/reducers/PlaceOrderReducer.d.ts +72 -0
- package/lib/esm/reducers/PlaceOrderReducer.js +2 -0
- package/lib/esm/reducers/PriceReducer.d.ts +35 -0
- package/lib/esm/reducers/PriceReducer.js +2 -0
- package/lib/esm/reducers/ShipmentReducer.d.ts +41 -0
- package/lib/esm/reducers/ShipmentReducer.js +2 -0
- package/lib/esm/reducers/ShippingAddressReducer.d.ts +32 -0
- package/lib/esm/reducers/ShippingAddressReducer.js +2 -0
- package/lib/esm/reducers/SkuListsReducer.d.ts +21 -0
- package/lib/esm/reducers/SkuListsReducer.js +2 -0
- package/lib/esm/reducers/SkuReducer.d.ts +21 -0
- package/lib/esm/reducers/SkuReducer.js +2 -0
- package/lib/esm/typings/errors.d.ts +15 -0
- package/lib/esm/typings/errors.js +2 -0
- package/lib/esm/typings/globals.d.ts +6 -0
- package/lib/esm/typings/globals.js +2 -0
- package/lib/esm/typings/index.d.ts +117 -0
- package/lib/esm/typings/index.js +2 -0
- package/lib/esm/utils/PropsType.d.ts +33 -0
- package/lib/esm/utils/PropsType.js +2 -0
- package/lib/esm/utils/addressesManager.d.ts +64 -0
- package/lib/esm/utils/addressesManager.js +2 -0
- package/lib/esm/utils/adyen/manageGiftCard.d.ts +16 -0
- package/lib/esm/utils/adyen/manageGiftCard.js +2 -0
- package/lib/esm/utils/baseReducer.d.ts +3 -0
- package/lib/esm/utils/baseReducer.js +2 -0
- package/lib/esm/utils/browserInfo.d.ts +12 -0
- package/lib/esm/utils/browserInfo.js +2 -0
- package/lib/esm/utils/canPlaceOrder.d.ts +5 -0
- package/lib/esm/utils/canPlaceOrder.js +2 -0
- package/lib/esm/utils/checkIncludeResource.d.ts +8 -0
- package/lib/esm/utils/checkIncludeResource.js +2 -0
- package/lib/esm/utils/compareObjAttribute.d.ts +7 -0
- package/lib/esm/utils/compareObjAttribute.js +2 -0
- package/lib/esm/utils/countryStateCity.d.ts +801 -0
- package/lib/esm/utils/countryStateCity.js +2 -0
- package/lib/esm/utils/customMessages.d.ts +2 -0
- package/lib/esm/utils/customMessages.js +2 -0
- package/lib/esm/utils/customerOrderOptions.d.ts +3 -0
- package/lib/esm/utils/customerOrderOptions.js +2 -0
- package/lib/esm/utils/events.d.ts +5 -0
- package/lib/esm/utils/events.js +2 -0
- package/lib/esm/utils/expressPaymentHelper.d.ts +92 -0
- package/lib/esm/utils/expressPaymentHelper.js +2 -0
- package/lib/esm/utils/filterChildren.d.ts +12 -0
- package/lib/esm/utils/filterChildren.js +2 -0
- package/lib/esm/utils/formCleaner.d.ts +4 -0
- package/lib/esm/utils/formCleaner.js +2 -0
- package/lib/esm/utils/getAmount.d.ts +7 -0
- package/lib/esm/utils/getAmount.js +2 -0
- package/lib/esm/utils/getApplicationLink.d.ts +35 -0
- package/lib/esm/utils/getApplicationLink.js +2 -0
- package/lib/esm/utils/getCardDetails.d.ts +16 -0
- package/lib/esm/utils/getCardDetails.js +2 -0
- package/lib/esm/utils/getCustomerIdByToken.d.ts +6 -0
- package/lib/esm/utils/getCustomerIdByToken.js +2 -0
- package/lib/esm/utils/getDomain.d.ts +4 -0
- package/lib/esm/utils/getDomain.js +2 -0
- package/lib/esm/utils/getErrors.d.ts +19 -0
- package/lib/esm/utils/getErrors.js +2 -0
- package/lib/esm/utils/getLineItemsCount.d.ts +10 -0
- package/lib/esm/utils/getLineItemsCount.js +2 -0
- package/lib/esm/utils/getLoaderComponent.d.ts +3 -0
- package/lib/esm/utils/getLoaderComponent.js +2 -0
- package/lib/esm/utils/getPaymentAttributes.d.ts +17 -0
- package/lib/esm/utils/getPaymentAttributes.js +2 -0
- package/lib/esm/utils/getPrices.d.ts +6 -0
- package/lib/esm/utils/getPrices.js +2 -0
- package/lib/esm/utils/getPublicIp.d.ts +1 -0
- package/lib/esm/utils/getPublicIp.js +2 -0
- package/lib/esm/utils/getSdk.d.ts +3 -0
- package/lib/esm/utils/getSdk.js +2 -0
- package/lib/esm/utils/getSkus.d.ts +3 -0
- package/lib/esm/utils/getSkus.js +2 -0
- package/lib/esm/utils/hasSubscriptions.d.ts +7 -0
- package/lib/esm/utils/hasSubscriptions.js +2 -0
- package/lib/esm/utils/hooks/useCustomContext.d.ts +21 -0
- package/lib/esm/utils/hooks/useCustomContext.js +2 -0
- package/lib/esm/utils/hooks/useExternalScript.d.ts +1 -0
- package/lib/esm/utils/hooks/useExternalScript.js +2 -0
- package/lib/esm/utils/icons.d.ts +2 -0
- package/lib/esm/utils/icons.js +2 -0
- package/lib/esm/utils/isDate.d.ts +1 -0
- package/lib/esm/utils/isDate.js +2 -0
- package/lib/esm/utils/isEmpty.d.ts +1 -0
- package/lib/esm/utils/isEmpty.js +2 -0
- package/lib/esm/utils/isGuestToken.d.ts +6 -0
- package/lib/esm/utils/isGuestToken.js +2 -0
- package/lib/esm/utils/isJSON.d.ts +1 -0
- package/lib/esm/utils/isJSON.js +2 -0
- package/lib/esm/utils/jwt.d.ts +27 -0
- package/lib/esm/utils/jwt.js +2 -0
- package/lib/esm/utils/localStorage.d.ts +11 -0
- package/lib/esm/utils/localStorage.js +2 -0
- package/lib/esm/utils/omit.d.ts +1 -0
- package/lib/esm/utils/omit.js +2 -0
- package/lib/esm/utils/organization.d.ts +18 -0
- package/lib/esm/utils/organization.js +2 -0
- package/lib/esm/utils/payment-methods/sortPaymentMethods.d.ts +2 -0
- package/lib/esm/utils/payment-methods/sortPaymentMethods.js +2 -0
- package/lib/esm/utils/pick.d.ts +1 -0
- package/lib/esm/utils/pick.js +2 -0
- package/lib/esm/utils/placeholderImages.d.ts +2 -0
- package/lib/esm/utils/placeholderImages.js +2 -0
- package/lib/esm/utils/promisify.d.ts +1 -0
- package/lib/esm/utils/promisify.js +2 -0
- package/lib/esm/utils/replace.d.ts +2 -0
- package/lib/esm/utils/replace.js +2 -0
- package/lib/esm/utils/scrollbarWidth.d.ts +1 -0
- package/lib/esm/utils/scrollbarWidth.js +2 -0
- package/lib/esm/utils/shipments.d.ts +3 -0
- package/lib/esm/utils/shipments.js +2 -0
- package/lib/esm/utils/snakeToCamelCase.d.ts +5 -0
- package/lib/esm/utils/snakeToCamelCase.js +2 -0
- package/lib/esm/utils/stripe/retrievePaymentIntent.d.ts +14 -0
- package/lib/esm/utils/stripe/retrievePaymentIntent.js +2 -0
- package/lib/esm/utils/triggerAttributeHelper.d.ts +31 -0
- package/lib/esm/utils/triggerAttributeHelper.js +2 -0
- package/lib/esm/utils/updateOrderSubscriptionCustomerPaymentSource.d.ts +8 -0
- package/lib/esm/utils/updateOrderSubscriptionCustomerPaymentSource.js +2 -0
- package/lib/esm/utils/validateFormFields.d.ts +16 -0
- package/lib/esm/utils/validateFormFields.js +2 -0
- package/lib/tsconfig.prod.esm.tsbuildinfo +1 -0
- package/lib/tsconfig.prod.tsbuildinfo +1 -0
- package/package.json +170 -35
- package/dist/index.cjs +0 -3
- package/dist/index.cjs.map +0 -1
- package/dist/index.d.cts +0 -3271
- package/dist/index.d.ts +0 -3271
- package/dist/index.js +0 -3
- package/dist/index.js.map +0 -1
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type JSX } from "react";
|
|
2
|
+
import type { PaymentMethodConfig } from "../../reducers/PaymentMethodReducer";
|
|
3
|
+
import type { PaymentSourceProps } from "./PaymentSource";
|
|
4
|
+
type KlarnaPaymentProps = PaymentMethodConfig["klarnaPayment"] & JSX.IntrinsicElements["div"] & Partial<PaymentSourceProps["templateCustomerSaveToWallet"]> & {
|
|
5
|
+
show?: boolean;
|
|
6
|
+
clientToken: string;
|
|
7
|
+
locale?: string | null;
|
|
8
|
+
};
|
|
9
|
+
export default function KlarnaPayment({ clientToken, placeOrderCallback, locale, ...p }: KlarnaPaymentProps): JSX.Element | null;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=KlarnaPayment;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),react_1=require("react"),PaymentMethodContext_1=tslib_1.__importDefault(require("../../context/PaymentMethodContext")),OrderContext_1=tslib_1.__importDefault(require("../../context/OrderContext")),useExternalScript_1=tslib_1.__importDefault(require("../../utils/hooks/useExternalScript"));function typeOfLine(lineItemType){switch(lineItemType){case"percentage_discount_promotions":return"discount";case"shipments":return"shipping_fee";case"skus":return"physical";case"payment_methods":default:return null}}function klarnaOrderLines(lineItems){return lineItems?lineItems?.map(item=>{const type=item.item_type?typeOfLine(item.item_type):null;return{quantity:item.quantity,total_amount:item.total_amount_cents,unit_price:item.unit_amount_cents,type}}):[]}function KlarnaPayment(_a){var{clientToken,placeOrderCallback,locale="EN"}=_a,p=tslib_1.__rest(_a,["clientToken","placeOrderCallback","locale"]);const ref=(0,react_1.useRef)(null),{paymentSource,currentPaymentMethodType,setPaymentRef,setPaymentSource}=(0,react_1.useContext)(PaymentMethodContext_1.default),{order}=(0,react_1.useContext)(OrderContext_1.default),loaded=(0,useExternalScript_1.default)("https://x.klarnacdn.net/kp/lib/v1/api.js"),[klarna,setKlarna]=(0,react_1.useState)(),{containerClassName}=p,divProps=tslib_1.__rest(p,["containerClassName"]);(0,react_1.useEffect)(()=>{loaded&&window?.Klarna!==void 0&&setKlarna(window.Klarna)},[loaded,window.Klarna]),(0,react_1.useEffect)(()=>(ref.current&&paymentSource&¤tPaymentMethodType&&loaded&&klarna&&(ref.current.onsubmit=props=>tslib_1.__awaiter(this,void 0,void 0,function*(){handleClick(klarna,props)}),setPaymentRef({ref})),()=>{setPaymentRef({ref:{current:null}})}),[ref,paymentSource,currentPaymentMethodType,loaded,klarna]);const handleClick=(kl,props)=>{var _a2,_b,_c,_d,_e,_f,_g,_h,_j,_k,_l,_m,_o,_p,_q,_r;const[first]=paymentSource?.payment_methods||void 0,paymentMethodCategories=first?.identifier,billingAddress={given_name:(_a2=order?.billing_address)===null||_a2===void 0?void 0:_a2.first_name,family_name:(_b=order?.billing_address)===null||_b===void 0?void 0:_b.last_name,email:order?.customer_email,street_address:(_c=order?.billing_address)===null||_c===void 0?void 0:_c.line_1,street_address2:null,organization_name:null,postal_code:(_d=order?.billing_address)===null||_d===void 0?void 0:_d.zip_code,city:(_e=order?.billing_address)===null||_e===void 0?void 0:_e.city,region:(_f=order?.billing_address)===null||_f===void 0?void 0:_f.state_code,phone:(_g=order?.billing_address)===null||_g===void 0?void 0:_g.phone,country:(_h=order?.billing_address)===null||_h===void 0?void 0:_h.country_code},shippingAddress={given_name:(_j=order?.shipping_address)===null||_j===void 0?void 0:_j.first_name,family_name:(_k=order?.shipping_address)===null||_k===void 0?void 0:_k.last_name,email:order?.customer_email,street_address:(_l=order?.shipping_address)===null||_l===void 0?void 0:_l.line_1,street_address2:null,postal_code:(_m=order?.shipping_address)===null||_m===void 0?void 0:_m.zip_code,organization_name:null,city:(_o=order?.shipping_address)===null||_o===void 0?void 0:_o.city,region:(_p=order?.shipping_address)===null||_p===void 0?void 0:_p.state_code,phone:(_q=order?.shipping_address)===null||_q===void 0?void 0:_q.phone,country:(_r=order?.shipping_address)===null||_r===void 0?void 0:_r.country_code},klarnaData={merchant_data:order?.id,purchase_country:order?.country_code,purchase_currency:order?.currency_code,locale,shipping_address:shippingAddress,billing_address:billingAddress,order_amount:order?.total_amount_cents,order_lines:klarnaOrderLines(order?.line_items),order_tax_amount:order?.total_tax_amount_cents};kl.Payments.authorize(Object.assign({payment_method_category:paymentMethodCategories},klarnaData),res=>tslib_1.__awaiter(this,void 0,void 0,function*(){if(res.approved&&paymentSource&¤tPaymentMethodType){const ps=yield setPaymentSource({paymentSourceId:paymentSource.id,paymentResource:currentPaymentMethodType,attributes:{auth_token:res.authorization_token}});if(props.setPlaceOrder!=null){const placed=yield props.setPlaceOrder({paymentSource:ps});placed&&props.onclickCallback!=null&&props.onclickCallback(placed)}}}))};if(klarna&&clientToken){const[first]=paymentSource?.payment_methods||void 0;klarna.Payments.init({client_token:clientToken}),klarna.Payments.load({container:"#klarna-payments-container",payment_method_category:first?.identifier})}return(0,jsx_runtime_1.jsx)("form",{ref,children:(0,jsx_runtime_1.jsx)("div",Object.assign({className:containerClassName},divProps,{children:(0,jsx_runtime_1.jsx)("div",{id:"klarna-payments-container"})}))})}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type JSX } from "react";
|
|
2
|
+
import type { LoaderType } from "../../typings/index";
|
|
3
|
+
import type { CustomerCardsTemplateChildren } from "../utils/PaymentCardsTemplate";
|
|
4
|
+
export interface CustomerCardsProps {
|
|
5
|
+
handleClick: () => void;
|
|
6
|
+
}
|
|
7
|
+
export interface CustomerSaveToWalletProps {
|
|
8
|
+
name: "save_payment_source_to_customer_wallet";
|
|
9
|
+
}
|
|
10
|
+
export interface PaymentSourceProps extends Omit<JSX.IntrinsicElements["div"], "children"> {
|
|
11
|
+
children?: JSX.Element | JSX.Element[];
|
|
12
|
+
readonly?: boolean;
|
|
13
|
+
templateCustomerCards?: CustomerCardsTemplateChildren;
|
|
14
|
+
onClickCustomerCards?: () => void;
|
|
15
|
+
templateCustomerSaveToWallet?: (props: CustomerSaveToWalletProps) => JSX.Element;
|
|
16
|
+
loader?: LoaderType;
|
|
17
|
+
}
|
|
18
|
+
export declare function PaymentSource(props: PaymentSourceProps): JSX.Element;
|
|
19
|
+
export default PaymentSource;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.PaymentSource=PaymentSource;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),react_1=require("react"),PaymentMethodChildrenContext_1=tslib_1.__importDefault(require("../../context/PaymentMethodChildrenContext")),PaymentMethodContext_1=tslib_1.__importDefault(require("../../context/PaymentMethodContext")),CustomerContext_1=tslib_1.__importDefault(require("../../context/CustomerContext")),PaymentGateway_1=tslib_1.__importDefault(require("../payment_gateways/PaymentGateway")),getCardDetails_1=tslib_1.__importDefault(require("../../utils/getCardDetails")),OrderContext_1=tslib_1.__importDefault(require("../../context/OrderContext"));function PaymentSource(props){const{readonly}=props,{payment,expressPayments}=(0,react_1.useContext)(PaymentMethodChildrenContext_1.default),{order}=(0,react_1.useContext)(OrderContext_1.default),{payments}=(0,react_1.useContext)(CustomerContext_1.default),{currentPaymentMethodId,paymentSource,destroyPaymentSource,currentPaymentMethodType,currentCustomerPaymentSourceId}=(0,react_1.useContext)(PaymentMethodContext_1.default),[show,setShow]=(0,react_1.useState)(!1),[showCard,setShowCard]=(0,react_1.useState)(!1);(0,react_1.useEffect)(()=>{const isCustomerPaymentSource=currentCustomerPaymentSourceId!=null&¤tCustomerPaymentSourceId===paymentSource?.id;if(readonly)setShow(!0),setShowCard(!0);else if((payment?.id===currentPaymentMethodId||isCustomerPaymentSource)&&!expressPayments){const card=(0,getCardDetails_1.default)({paymentType:payment?.payment_source_type,customerPayment:{payment_source:paymentSource}});isCustomerPaymentSource&&card.brand===""&&(card.brand=card.issuer_type!=null&&card.issuer_type!==""?card.issuer_type:"credit-card"),card.brand&&setShowCard(!0),setShow(!0)}else expressPayments&¤tPaymentMethodType==="stripe_payments"&&setShow(!0);return()=>{setShow(!1),setShowCard(!1)}},[currentPaymentMethodId,paymentSource?.id,payments!=null,payment!=null,readonly,order?.status,expressPayments]);const handleEditClick=e=>tslib_1.__awaiter(this,void 0,void 0,function*(){if(e.stopPropagation(),paymentSource){const paymentSourceId=paymentSource?.id;yield destroyPaymentSource({paymentSourceId,paymentResource:payment?.payment_source_type})}setShowCard(!showCard),setShow(!0)}),gatewayProps=Object.assign(Object.assign({},props),{show,showCard,handleEditClick,readonly});return(0,jsx_runtime_1.jsx)(PaymentGateway_1.default,Object.assign({},gatewayProps))}exports.default=PaymentSource;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type IconBrand } from '../../context/PaymentSourceContext';
|
|
2
|
+
import { type JSX } from 'react';
|
|
3
|
+
import type { ChildrenFunction } from '../../typings/index';
|
|
4
|
+
interface ChildrenProps extends Omit<Props, 'children'> {
|
|
5
|
+
brand: IconBrand;
|
|
6
|
+
defaultSrc: string;
|
|
7
|
+
url: string;
|
|
8
|
+
}
|
|
9
|
+
interface Props extends Omit<JSX.IntrinsicElements['img'], 'children'> {
|
|
10
|
+
children?: ChildrenFunction<ChildrenProps>;
|
|
11
|
+
width?: number;
|
|
12
|
+
height?: number;
|
|
13
|
+
}
|
|
14
|
+
export declare function PaymentSourceBrandIcon({ src, width, children, ...p }: Props): JSX.Element;
|
|
15
|
+
export default PaymentSourceBrandIcon;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.PaymentSourceBrandIcon=PaymentSourceBrandIcon;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),PaymentSourceContext_1=tslib_1.__importDefault(require("../../context/PaymentSourceContext")),react_1=require("react"),Parent_1=tslib_1.__importDefault(require("../utils/Parent")),CustomerPaymentSourceContext_1=tslib_1.__importDefault(require("../../context/CustomerPaymentSourceContext"));function PaymentSourceBrandIcon(_a){var _b,_c,{src,width=32,children}=_a,p=tslib_1.__rest(_a,["src","width","children"]);const{brand,issuer_type:issuerType}=(0,react_1.useContext)(PaymentSourceContext_1.default),{brand:customerCardBrand,issuer_type:customerIssuerType}=(0,react_1.useContext)(CustomerPaymentSourceContext_1.default),cardBrand=(_c=(_b=brand??customerCardBrand)!==null&&_b!==void 0?_b:issuerType)!==null&&_c!==void 0?_c:customerIssuerType,ref=(0,react_1.useRef)(null),defaultSrc="//data.commercelayer.app/assets/images/icons/credit-cards/color/credit-card.svg",url=src||`//data.commercelayer.app/assets/images/icons/credit-cards/color/${cardBrand??"credit-card"}.svg`,handleError=()=>{ref.current&&(ref.current.src=defaultSrc)},parentProps=Object.assign({brand:cardBrand,defaultSrc,url,width},p);return children?(0,jsx_runtime_1.jsx)(Parent_1.default,Object.assign({},parentProps,{children})):(0,jsx_runtime_1.jsx)("img",Object.assign({ref,src:url,onError:handleError,width},p))}exports.default=PaymentSourceBrandIcon;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type IconBrand } from '../../context/PaymentSourceContext';
|
|
2
|
+
import { type JSX } from 'react';
|
|
3
|
+
import type { ChildrenFunction } from '../../typings/index';
|
|
4
|
+
interface CustomComponent extends Omit<Props, 'children'> {
|
|
5
|
+
brand: IconBrand;
|
|
6
|
+
}
|
|
7
|
+
interface Props extends Omit<JSX.IntrinsicElements['span'], 'children'> {
|
|
8
|
+
children?: ChildrenFunction<CustomComponent>;
|
|
9
|
+
label?: string;
|
|
10
|
+
}
|
|
11
|
+
export declare function PaymentSourceBrandName({ children, label, ...props }: Props): JSX.Element;
|
|
12
|
+
export default PaymentSourceBrandName;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.PaymentSourceBrandName=PaymentSourceBrandName;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),PaymentSourceContext_1=tslib_1.__importDefault(require("../../context/PaymentSourceContext")),capitalize_1=tslib_1.__importDefault(require("lodash/capitalize")),react_1=require("react"),Parent_1=tslib_1.__importDefault(require("../utils/Parent")),CustomerPaymentSourceContext_1=tslib_1.__importDefault(require("../../context/CustomerPaymentSourceContext"));function PaymentSourceBrandName(_a){var{children,label}=_a,props=tslib_1.__rest(_a,["children","label"]);const{brand}=(0,react_1.useContext)(PaymentSourceContext_1.default),{brand:customerCardBrand}=(0,react_1.useContext)(CustomerPaymentSourceContext_1.default),cardBrand=brand??customerCardBrand,brandName=cardBrand&&(0,capitalize_1.default)(cardBrand.replace(/_|-/gm," ")),parentProps=Object.assign({brand:brandName,label},props);return children?(0,jsx_runtime_1.jsx)(Parent_1.default,Object.assign({},parentProps,{children})):(0,jsx_runtime_1.jsx)("span",Object.assign({},props,{children:label||(0,capitalize_1.default)(brandName)}))}exports.default=PaymentSourceBrandName;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type JSX } from 'react';
|
|
2
|
+
import type { ChildrenFunction } from '../../typings/index';
|
|
3
|
+
export type PaymentSourceDetailType = 'last4' | 'exp_year' | 'exp_month';
|
|
4
|
+
interface ChildrenProps extends Omit<Props, 'children'> {
|
|
5
|
+
text: string;
|
|
6
|
+
}
|
|
7
|
+
interface Props extends Omit<JSX.IntrinsicElements['span'], 'children'> {
|
|
8
|
+
children?: ChildrenFunction<ChildrenProps>;
|
|
9
|
+
/**
|
|
10
|
+
* Type of detail to display
|
|
11
|
+
*/
|
|
12
|
+
type: PaymentSourceDetailType;
|
|
13
|
+
}
|
|
14
|
+
export declare function PaymentSourceDetail({ type, children, ...p }: Props): JSX.Element;
|
|
15
|
+
export default PaymentSourceDetail;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.PaymentSourceDetail=PaymentSourceDetail;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),PaymentSourceContext_1=tslib_1.__importDefault(require("../../context/PaymentSourceContext")),react_1=require("react"),Parent_1=tslib_1.__importDefault(require("../utils/Parent")),CustomerPaymentSourceContext_1=tslib_1.__importDefault(require("../../context/CustomerPaymentSourceContext"));function PaymentSourceDetail(_a){var{type,children}=_a,p=tslib_1.__rest(_a,["type","children"]);const card=(0,react_1.useContext)(PaymentSourceContext_1.default),customerCard=(0,react_1.useContext)(CustomerPaymentSourceContext_1.default),cardObj=Object.keys(card).length>0?card:customerCard,text=type in cardObj&&cardObj[type]!=null?cardObj[type]:type==="last4"?"****":"**",parentProps=Object.assign({type,text},p);return children?(0,jsx_runtime_1.jsx)(Parent_1.default,Object.assign({},parentProps,{children})):(0,jsx_runtime_1.jsx)("span",Object.assign({},p,{children:text}))}exports.default=PaymentSourceDetail;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type ReactNode, type JSX } from 'react';
|
|
2
|
+
import type { ChildrenFunction } from '../../typings/index';
|
|
3
|
+
interface CustomComponent extends Omit<Props, 'children'> {
|
|
4
|
+
}
|
|
5
|
+
type Props = {
|
|
6
|
+
children?: ChildrenFunction<CustomComponent>;
|
|
7
|
+
label?: string | ReactNode;
|
|
8
|
+
} & Omit<JSX.IntrinsicElements['button'], 'onClick'>;
|
|
9
|
+
export declare function PaymentSourceEditButton({ children, label, ...props }: Props): JSX.Element | null;
|
|
10
|
+
export default PaymentSourceEditButton;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.PaymentSourceEditButton=PaymentSourceEditButton;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),PaymentSourceContext_1=tslib_1.__importDefault(require("../../context/PaymentSourceContext")),react_1=require("react"),Parent_1=tslib_1.__importDefault(require("../utils/Parent"));function PaymentSourceEditButton(_a){var{children,label="Edit"}=_a,props=tslib_1.__rest(_a,["children","label"]);const{showCard,handleEditClick,readonly}=(0,react_1.useContext)(PaymentSourceContext_1.default),parentProps=Object.assign({showCard,label,handleEditClick},props);return children?(0,jsx_runtime_1.jsx)(Parent_1.default,Object.assign({},parentProps,{children})):readonly?null:(0,jsx_runtime_1.jsx)("button",Object.assign({},props,{onClick:handleEditClick,children:label}))}exports.default=PaymentSourceEditButton;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type ReactNode, type JSX } from 'react';
|
|
2
|
+
export interface PaypalConfig {
|
|
3
|
+
return_url: string;
|
|
4
|
+
cancel_url: string;
|
|
5
|
+
infoMessage?: {
|
|
6
|
+
text?: string | ReactNode;
|
|
7
|
+
className?: string;
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
type Props = Omit<PaypalConfig, 'return_url' | 'cancel_url'> & JSX.IntrinsicElements['div'];
|
|
11
|
+
export declare function PaypalPayment({ infoMessage, ...p }: Props): JSX.Element | null;
|
|
12
|
+
export default PaypalPayment;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.PaypalPayment=PaypalPayment;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),PaymentMethodContext_1=tslib_1.__importDefault(require("../../context/PaymentMethodContext")),isFunction_1=tslib_1.__importDefault(require("lodash/isFunction")),react_1=require("react"),defaultMessage="by placing the order, you will be redirected to the PayPal website to sign in and authorize the payment";function PaypalPayment(_a){var{infoMessage}=_a,p=tslib_1.__rest(_a,["infoMessage"]);const ref=(0,react_1.useRef)(null),{setPaymentSource,paymentSource,currentPaymentMethodType,setPaymentRef}=(0,react_1.useContext)(PaymentMethodContext_1.default);(0,react_1.useEffect)(()=>(ref.current&&paymentSource&¤tPaymentMethodType&&paymentSource?.approval_url&&(ref.current.onsubmit=()=>tslib_1.__awaiter(this,void 0,void 0,function*(){return yield handleClick()}),setPaymentRef({ref})),()=>{setPaymentRef({ref:{current:null}})}),[ref,paymentSource,currentPaymentMethodType]);const handleClick=()=>tslib_1.__awaiter(this,void 0,void 0,function*(){if(paymentSource&¤tPaymentMethodType)try{return yield setPaymentSource({paymentSourceId:paymentSource.id,paymentResource:currentPaymentMethodType,attributes:{metadata:{card:{id:paymentSource.id,brand:"paypal",last4:""}}}}),!0}catch{return!1}return!1});return(0,jsx_runtime_1.jsx)("form",{ref,children:(0,jsx_runtime_1.jsx)("div",Object.assign({},p,{children:(0,jsx_runtime_1.jsx)("span",{className:infoMessage?.className,children:(0,isFunction_1.default)(infoMessage?.text)?infoMessage?.text():infoMessage?.text||defaultMessage})}))})}exports.default=PaypalPayment;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.StripeExpressPayment=StripeExpressPayment;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),CommerceLayerContext_1=tslib_1.__importDefault(require("../../context/CommerceLayerContext")),OrderContext_1=tslib_1.__importDefault(require("../../context/OrderContext")),PaymentMethodContext_1=tslib_1.__importDefault(require("../../context/PaymentMethodContext")),expressPaymentHelper_1=require("../../utils/expressPaymentHelper"),isEmpty_1=require("../../utils/isEmpty"),react_stripe_js_1=require("@stripe/react-stripe-js"),react_1=require("react");function StripeExpressPayment({clientSecret}){const stripe=(0,react_stripe_js_1.useStripe)(),[paymentRequest,setPaymentRequest]=(0,react_1.useState)(null),{accessToken,endpoint}=(0,react_1.useContext)(CommerceLayerContext_1.default),{order}=(0,react_1.useContext)(OrderContext_1.default),{paymentMethods,paymentSource}=(0,react_1.useContext)(PaymentMethodContext_1.default);return(0,react_1.useEffect)(()=>{var _a,_b,_c,_d,_e;if(stripe==null||order==null)return;const pr=stripe.paymentRequest({country:(_a=order?.country_code)!==null&&_a!==void 0?_a:"US",currency:(_c=(_b=order?.currency_code)===null||_b===void 0?void 0:_b.toLowerCase())!==null&&_c!==void 0?_c:"",total:{label:`#${(_d=order?.number)!==null&&_d!==void 0?_d:""}`,amount:(_e=order?.total_amount_with_taxes_cents)!==null&&_e!==void 0?_e:0},requestPayerName:!0,requestPayerEmail:!0,requestPayerPhone:!0,requestShipping:!0});pr.canMakePayment().then(result=>{result&&setPaymentRequest(pr)}).catch(err=>{console.error("Can make payment:",err)})},[(0,isEmpty_1.isEmpty)(stripe),(0,isEmpty_1.isEmpty)(order)]),paymentRequest!=null&&stripe!=null?(paymentRequest.on("shippingaddresschange",ev=>tslib_1.__awaiter(this,void 0,void 0,function*(){var _a,_b,_c,_d,_e,_f,_g;if(order!=null&&accessToken!=null&&endpoint!=null){const requiresBillingInfo=(_a=order?.requires_billing_info)!==null&&_a!==void 0?_a:!1,orderWithShipments=yield(0,expressPaymentHelper_1.setExpressFakeAddress)({orderId:order.id,config:{accessToken,endpoint},address:{first_name:"Fake name",last_name:"Fake lastname",country_code:(_b=ev.shippingAddress.country)!==null&&_b!==void 0?_b:"",line_1:"Fake street 123",city:(_c=ev.shippingAddress.city)!==null&&_c!==void 0?_c:"Fake city",zip_code:(_d=ev.shippingAddress.postalCode)!==null&&_d!==void 0?_d:"12345",state_code:(_e=ev.shippingAddress.region)!==null&&_e!==void 0?_e:"Fake state",phone:"1234567890",billing_info:requiresBillingInfo?"Fake billing info":void 0}}),shippingOptions=(0,expressPaymentHelper_1.getExpressShippingMethods)(orderWithShipments);shippingOptions!=null&&!(0,isEmpty_1.isEmpty)(shippingOptions)?ev.updateWith({status:"success",shippingOptions,total:{label:`#${(_f=orderWithShipments?.number)!==null&&_f!==void 0?_f:""}`,amount:(_g=orderWithShipments?.total_amount_with_taxes_cents)!==null&&_g!==void 0?_g:0}}):ev.updateWith({status:"invalid_shipping_address"})}else ev.updateWith({status:"fail"})})),paymentRequest.on("shippingoptionchange",ev=>tslib_1.__awaiter(this,void 0,void 0,function*(){var _a,_b;if(order!=null&&accessToken!=null&&endpoint!=null){const updatedOrder=yield(0,expressPaymentHelper_1.setExpressShippingMethod)({orderId:order.id,config:{accessToken,endpoint},selectFirst:!1,selectedShippingMethodId:ev.shippingOption.id,params:{include:["shipments.available_shipping_methods"]}});ev.updateWith({status:"success",total:{label:`#${(_a=updatedOrder?.number)!==null&&_a!==void 0?_a:""}`,amount:(_b=updatedOrder?.total_amount_with_taxes_cents)!==null&&_b!==void 0?_b:0}})}else ev.updateWith({status:"fail"})})),paymentRequest.on("paymentmethod",ev=>tslib_1.__awaiter(this,void 0,void 0,function*(){var _a,_b,_c,_d,_e,_f,_g,_h,_j,_k,_l,_m,_o,_p,_q,_r;if(order?.id==null)throw new Error("Order is null");if(paymentMethods==null)throw new Error("Payment methods are null");const[paymentMethod]=(0,expressPaymentHelper_1.getAvailableExpressPayments)(paymentMethods);if(paymentMethod==null)throw new Error("Payment method is null");if(paymentSource==null)throw new Error("Payment source is null");const requiresBillingInfo=(_a=order?.requires_billing_info)!==null&&_a!==void 0?_a:!1,paymentResource=paymentMethod?.payment_source_type;if(accessToken!=null&&endpoint!=null){const[firstName,lastName]=(_c=(_b=ev.payerName)===null||_b===void 0?void 0:_b.split(" "))!==null&&_c!==void 0?_c:[],[line]=(_e=(_d=ev.shippingAddress)===null||_d===void 0?void 0:_d.addressLine)!==null&&_e!==void 0?_e:"",email=(_f=ev.payerEmail)!==null&&_f!==void 0?_f:"";yield(0,expressPaymentHelper_1.setExpressFakeAddress)({orderId:order.id,config:{accessToken,endpoint},address:{first_name:firstName??"Fake name",last_name:lastName??"Fake lastname",country_code:(_h=(_g=ev?.shippingAddress)===null||_g===void 0?void 0:_g.country)!==null&&_h!==void 0?_h:"",line_1:line??"Fake street 123",city:(_k=(_j=ev?.shippingAddress)===null||_j===void 0?void 0:_j.city)!==null&&_k!==void 0?_k:"Fake city",zip_code:(_m=(_l=ev?.shippingAddress)===null||_l===void 0?void 0:_l.postalCode)!==null&&_m!==void 0?_m:"12345",state_code:(_p=(_o=ev?.shippingAddress)===null||_o===void 0?void 0:_o.region)!==null&&_p!==void 0?_p:"Fake state",phone:(_q=ev?.payerPhone)!==null&&_q!==void 0?_q:"1234567890",billing_info:requiresBillingInfo?"Fake billing info":void 0},email}),yield(0,expressPaymentHelper_1.setExpressShippingMethod)({orderId:order.id,config:{accessToken,endpoint},selectFirst:!1,selectedShippingMethodId:(_r=ev?.shippingOption)===null||_r===void 0?void 0:_r.id,params:{include:["shipments.available_shipping_methods"]}});const placeOrderParams={config:{accessToken,endpoint},orderId:order?.id,paymentResource,paymentSourceId:paymentSource?.id};yield(0,expressPaymentHelper_1.setExpressPlaceOrder)(placeOrderParams);const{paymentIntent,error:confirmError}=yield stripe.confirmCardPayment(clientSecret,{payment_method:ev.paymentMethod.id},{handleActions:!1});if(confirmError)ev.complete("fail"),console.error("Confirm card payment:",confirmError);else if(ev.complete("success"),paymentIntent.status==="requires_action"){const{error}=yield stripe.confirmCardPayment(clientSecret);if(error)console.error("Confirm card payment:",error);else{const placeOrderParams2={config:{accessToken,endpoint},orderId:order?.id,placeTheOrder:!0};try{const order2=yield(0,expressPaymentHelper_1.setExpressPlaceOrder)(placeOrderParams2);ev.complete("success"),yield(0,expressPaymentHelper_1.expressRedirectUrl)({order:order2,config:{accessToken,endpoint}})}catch(err){console.error("Place order:",err),ev.complete("fail")}}}else{const placeOrderParams2={config:{accessToken,endpoint},orderId:order?.id,placeTheOrder:!0};try{const order2=yield(0,expressPaymentHelper_1.setExpressPlaceOrder)(placeOrderParams2);ev.complete("success"),yield(0,expressPaymentHelper_1.expressRedirectUrl)({order:order2,config:{accessToken,endpoint}})}catch(err){console.error("Place order:",err),ev.complete("fail")}}}})),(0,jsx_runtime_1.jsx)(jsx_runtime_1.Fragment,{children:(0,jsx_runtime_1.jsx)(react_stripe_js_1.PaymentRequestButtonElement,{className:"",options:{paymentRequest}})})):null}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type JSX } from "react";
|
|
2
|
+
import type { StripeElementLocale, StripeElementsOptions, StripePaymentElementOptions } from "@stripe/stripe-js";
|
|
3
|
+
import type { PaymentMethodConfig } from "../../reducers/PaymentMethodReducer";
|
|
4
|
+
import type { PaymentSourceProps } from "./PaymentSource";
|
|
5
|
+
export interface StripeConfig {
|
|
6
|
+
containerClassName?: string;
|
|
7
|
+
hintLabel?: string;
|
|
8
|
+
name?: string;
|
|
9
|
+
options?: StripePaymentElementOptions;
|
|
10
|
+
appearance?: StripeElementsOptions["appearance"];
|
|
11
|
+
[key: string]: any;
|
|
12
|
+
}
|
|
13
|
+
type Props = PaymentMethodConfig["stripePayment"] & Omit<JSX.IntrinsicElements["div"], "ref"> & Partial<PaymentSourceProps["templateCustomerSaveToWallet"]> & {
|
|
14
|
+
show?: boolean;
|
|
15
|
+
publishableKey: string;
|
|
16
|
+
locale?: StripeElementLocale;
|
|
17
|
+
clientSecret: string;
|
|
18
|
+
expressPayments?: boolean;
|
|
19
|
+
connectedAccount?: string;
|
|
20
|
+
};
|
|
21
|
+
export declare function StripePayment({ publishableKey, show, options, clientSecret, locale, expressPayments, connectedAccount, ...p }: Props): JSX.Element | null;
|
|
22
|
+
export default StripePayment;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.StripePayment=StripePayment;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),react_1=require("react"),PaymentMethodContext_1=tslib_1.__importDefault(require("../../context/PaymentMethodContext")),react_stripe_js_1=require("@stripe/react-stripe-js"),Parent_1=tslib_1.__importDefault(require("../utils/Parent")),localStorage_1=require("../../utils/localStorage"),OrderContext_1=tslib_1.__importDefault(require("../../context/OrderContext")),StripeExpressPayment_1=require("./StripeExpressPayment"),defaultOptions={layout:{type:"accordion",defaultCollapsed:!1,radios:!0,spacedAccordionItems:!1},fields:{billingDetails:"never"}},defaultAppearance={theme:"stripe",variables:{colorText:"#32325d",fontFamily:'"Helvetica Neue", Helvetica, sans-serif'}};function StripePaymentForm({options=defaultOptions,templateCustomerSaveToWallet,stripe}){const ref=(0,react_1.useRef)(null),{currentPaymentMethodType,setPaymentMethodErrors,setPaymentRef}=(0,react_1.useContext)(PaymentMethodContext_1.default),{order}=(0,react_1.useContext)(OrderContext_1.default),elements=(0,react_stripe_js_1.useElements)();(0,react_1.useEffect)(()=>(ref.current&&stripe&&elements&&(ref.current.onsubmit=()=>tslib_1.__awaiter(this,void 0,void 0,function*(){return yield onSubmit({event:ref.current,stripe,elements})}),setPaymentRef({ref})),()=>{setPaymentRef({ref:{current:null}})}),[ref,stripe,elements]);const onSubmit=_a=>tslib_1.__awaiter(this,[_a],void 0,function*({event,stripe:stripe2,elements:elements2}){var _b,_c,_d,_e,_f,_g,_h;if(!stripe2)return!1;const savePaymentSourceToCustomerWallet=(_c=(_b=event?.elements)===null||_b===void 0?void 0:_b.save_payment_source_to_customer_wallet)===null||_c===void 0?void 0:_c.checked;if(savePaymentSourceToCustomerWallet&&(0,localStorage_1.setCustomerOrderParam)("_save_payment_source_to_customer_wallet",savePaymentSourceToCustomerWallet),elements2!=null){const billingInfo=order?.billing_address,email=(_d=order?.customer_email)!==null&&_d!==void 0?_d:"",billingDetails={name:(_e=billingInfo?.full_name)!==null&&_e!==void 0?_e:"",email,phone:billingInfo?.phone,address:{city:billingInfo?.city,country:billingInfo?.country_code,line1:billingInfo?.line_1,line2:(_f=billingInfo?.line_2)!==null&&_f!==void 0?_f:"",postal_code:(_g=billingInfo?.zip_code)!==null&&_g!==void 0?_g:"",state:billingInfo?.state_code}},url=new URL(window.location.href),cleanUrl=`${url.origin}${url.pathname}?accessToken=${url.searchParams.get("accessToken")}`,{error}=yield stripe2.confirmPayment({elements:elements2,confirmParams:{return_url:cleanUrl,payment_method_data:{billing_details:billingDetails}},redirect:"if_required"});return error?(console.error(error),setPaymentMethodErrors([{code:"PAYMENT_INTENT_AUTHENTICATION_FAILURE",resource:"payment_methods",field:currentPaymentMethodType,message:(_h=error.message)!==null&&_h!==void 0?_h:""}]),!1):!0}return!1});return(0,jsx_runtime_1.jsxs)("form",{ref,children:[(0,jsx_runtime_1.jsx)(react_stripe_js_1.PaymentElement,{id:"payment-element",options:Object.assign(Object.assign({},defaultOptions),options)}),templateCustomerSaveToWallet&&(0,jsx_runtime_1.jsx)(Parent_1.default,{name:"save_payment_source_to_customer_wallet",children:templateCustomerSaveToWallet})]})}function StripePayment(_a){var{publishableKey,show,options,clientSecret,locale="auto",expressPayments=!1,connectedAccount}=_a,p=tslib_1.__rest(_a,["publishableKey","show","options","clientSecret","locale","expressPayments","connectedAccount"]);const[isLoaded,setIsLoaded]=(0,react_1.useState)(!1),[stripe,setStripe]=(0,react_1.useState)(null),{containerClassName,templateCustomerSaveToWallet,fonts=[],appearance}=p,divProps=tslib_1.__rest(p,["containerClassName","templateCustomerSaveToWallet","fonts","appearance"]);(0,react_1.useEffect)(()=>(show&&publishableKey&&Promise.resolve().then(()=>tslib_1.__importStar(require("@stripe/stripe-js"))).then(({loadStripe})=>{(()=>tslib_1.__awaiter(this,void 0,void 0,function*(){const options2=Object.assign({locale},connectedAccount?{stripeAccount:connectedAccount}:{}),res=yield loadStripe(publishableKey,options2);res!=null&&(setStripe(res),setIsLoaded(!0))}))()}),()=>{setIsLoaded(!1)}),[show,publishableKey,connectedAccount]);const elementsOptions={clientSecret,appearance:Object.assign(Object.assign({},defaultAppearance),appearance),fonts};return isLoaded&&stripe!=null&&clientSecret!=null?(0,jsx_runtime_1.jsx)("div",Object.assign({className:containerClassName},divProps,{children:(0,jsx_runtime_1.jsx)(react_stripe_js_1.Elements,{stripe,options:elementsOptions,children:expressPayments?(0,jsx_runtime_1.jsx)(StripeExpressPayment_1.StripeExpressPayment,{clientSecret}):(0,jsx_runtime_1.jsx)(StripePaymentForm,{stripe,options,templateCustomerSaveToWallet})})})):null}exports.default=StripePayment;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type JSX } from 'react';
|
|
2
|
+
export interface WireTransferConfig {
|
|
3
|
+
infoMessage?: {
|
|
4
|
+
text?: string | JSX.Element[];
|
|
5
|
+
className?: string;
|
|
6
|
+
};
|
|
7
|
+
}
|
|
8
|
+
type Props = WireTransferConfig & JSX.IntrinsicElements['div'] & {
|
|
9
|
+
'data-testid'?: string;
|
|
10
|
+
};
|
|
11
|
+
export declare function WireTransferPayment({ infoMessage, ...p }: Props): JSX.Element;
|
|
12
|
+
export default WireTransferPayment;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.WireTransferPayment=WireTransferPayment;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),PaymentMethodContext_1=tslib_1.__importDefault(require("../../context/PaymentMethodContext")),react_1=require("react"),defaultMessage="after placing the order, you will need to manually complete the payment with your bank";function WireTransferPayment(_a){var _b,{infoMessage}=_a,p=tslib_1.__rest(_a,["infoMessage"]);const{className,"data-testid":dataTestId}=p,ref=(0,react_1.useRef)(null),{setPaymentSource,paymentSource,currentPaymentMethodType,setPaymentRef}=(0,react_1.useContext)(PaymentMethodContext_1.default);(0,react_1.useEffect)(()=>(ref.current&&paymentSource&¤tPaymentMethodType&&(ref.current.onsubmit=()=>tslib_1.__awaiter(this,void 0,void 0,function*(){return yield handleClick()}),setPaymentRef({ref})),()=>{setPaymentRef({ref:{current:null}})}),[ref,paymentSource,currentPaymentMethodType]);const handleClick=()=>tslib_1.__awaiter(this,void 0,void 0,function*(){if(paymentSource&¤tPaymentMethodType)try{return yield setPaymentSource({paymentSourceId:paymentSource.id,paymentResource:currentPaymentMethodType,attributes:{metadata:{card:{id:paymentSource.id,brand:"wire-transfer",last4:""}}}}),!0}catch{return!1}return!1});return(0,jsx_runtime_1.jsx)("form",{ref,children:(0,jsx_runtime_1.jsx)("div",{className,"data-testid":dataTestId,children:(0,jsx_runtime_1.jsx)("span",{className:infoMessage?.className,children:(_b=infoMessage?.text)!==null&&_b!==void 0?_b:defaultMessage})})})}exports.default=WireTransferPayment;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { type JSX } from 'react';
|
|
2
|
+
import type { Price as PriceType } from '@commercelayer/sdk';
|
|
3
|
+
import type { ChildrenFunction, LoaderType } from '../../typings/index';
|
|
4
|
+
interface PriceChildrenProps extends Omit<PriceProps, 'children'> {
|
|
5
|
+
loading: boolean;
|
|
6
|
+
loader: LoaderType;
|
|
7
|
+
prices: PriceType[];
|
|
8
|
+
}
|
|
9
|
+
export interface PriceProps extends Omit<JSX.IntrinsicElements['span'], 'children' | 'ref'> {
|
|
10
|
+
children?: ChildrenFunction<PriceChildrenProps>;
|
|
11
|
+
/**
|
|
12
|
+
* CSS class name to be added for the compare price
|
|
13
|
+
*/
|
|
14
|
+
compareClassName?: string;
|
|
15
|
+
/**
|
|
16
|
+
* When `false` the compare_at price will not be displayed
|
|
17
|
+
* @default true
|
|
18
|
+
*/
|
|
19
|
+
showCompare?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* The `sku_code` of the price to be fetched
|
|
22
|
+
*/
|
|
23
|
+
skuCode?: string | null;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* To display the price of your products with localized currency, discounts, and personalization rules, as shown in the code snippets below.
|
|
27
|
+
*
|
|
28
|
+
* Each price has an amount (the actual selling price) and an optional compare-at amount (the full price that you want to display to the customer — typically with a strikethrough).
|
|
29
|
+
* This component is the owner of the price information. It fetches the price of the specified SKU and dispatches it to the cl-price-amount children.
|
|
30
|
+
* <span type='info'>
|
|
31
|
+
* By default it shows the `formatted_amount` and `formatted_compare_at_amount` of the first price object, but it also allows to access to the full `Price`object via children props.
|
|
32
|
+
* </span>
|
|
33
|
+
*/
|
|
34
|
+
export declare function Price(props: PriceProps): JSX.Element;
|
|
35
|
+
export default Price;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.Price=Price;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),Parent_1=tslib_1.__importDefault(require("../utils/Parent")),PricesContext_1=tslib_1.__importDefault(require("../../context/PricesContext")),react_1=require("react"),getPrices_1=require("../../utils/getPrices"),SkuChildrenContext_1=tslib_1.__importDefault(require("../../context/SkuChildrenContext"));function Price(props){const{children,skuCode=""}=props,{prices,skuCode:pricesSkuCode,loading,skuCodes,setSkuCodes,loader}=(0,react_1.useContext)(PricesContext_1.default),{sku}=(0,react_1.useContext)(SkuChildrenContext_1.default),[skuPrices,setSkuPrices]=(0,react_1.useState)([]),sCode=pricesSkuCode||skuCode||sku?.code||"";(0,react_1.useEffect)(()=>(prices!=null&&`${sCode}`in prices?setSkuPrices(prices[sCode]):sCode&&!skuCodes.includes(sCode)&&(skuCodes.push(sCode),setSkuCodes&&setSkuCodes({skuCodes})),()=>{setSkuPrices([])}),[prices,sCode]);const parentProps=Object.assign({loading,loader,prices:skuPrices},props),pricesComponent=prices==null||skuPrices==null?null:(0,getPrices_1.getPricesComponent)(skuPrices,props);return children?(0,jsx_runtime_1.jsx)(Parent_1.default,Object.assign({},parentProps,{children})):(0,jsx_runtime_1.jsx)(jsx_runtime_1.Fragment,{children:loading||pricesComponent==null?loader:pricesComponent})}exports.default=Price;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { type JSX } from 'react';
|
|
2
|
+
import type { LoaderType } from '../../typings/index';
|
|
3
|
+
import type { QueryPageSize } from '@commercelayer/sdk';
|
|
4
|
+
interface Props {
|
|
5
|
+
/**
|
|
6
|
+
* Any valid JSX.Element(s).
|
|
7
|
+
* A single `<Price>` component or a list of them is expected to render the prices.
|
|
8
|
+
*/
|
|
9
|
+
children: JSX.Element | JSX.Element[];
|
|
10
|
+
/**
|
|
11
|
+
* SDK query filter to fetch the prices when multiple prices are requested.
|
|
12
|
+
*/
|
|
13
|
+
filters?: object;
|
|
14
|
+
/**
|
|
15
|
+
* Loader component or string to be rendered while the prices are being fetched.
|
|
16
|
+
* @default 'Loading...'
|
|
17
|
+
*/
|
|
18
|
+
loader?: LoaderType;
|
|
19
|
+
/**
|
|
20
|
+
* Prices per page to be fetched
|
|
21
|
+
*/
|
|
22
|
+
perPage?: QueryPageSize;
|
|
23
|
+
/**
|
|
24
|
+
* SKU code to fetch the prices for. If not provided, the `sku_code` will be retrieved from the `<Price>` component(s) nested as children.
|
|
25
|
+
*/
|
|
26
|
+
skuCode?: string;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Main container for the Prices components. It stores the prices context.
|
|
30
|
+
*
|
|
31
|
+
* It can be used to fetch the prices for a specific `sku_code` passed as prop
|
|
32
|
+
* or for the `sku_code` retrieved from all `<Price>` components nested as children.
|
|
33
|
+
* <span title='Requirements' type='warning'>
|
|
34
|
+
* Must be a child of the `<CommerceLayer>` component.
|
|
35
|
+
* </span>
|
|
36
|
+
* <span title='Children' type='info'>
|
|
37
|
+
* `<Price>`
|
|
38
|
+
* </span>
|
|
39
|
+
*/
|
|
40
|
+
export declare function PricesContainer(props: Props): JSX.Element;
|
|
41
|
+
export default PricesContainer;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.PricesContainer=PricesContainer;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),react_1=require("react"),CommerceLayerContext_1=tslib_1.__importDefault(require("../../context/CommerceLayerContext")),PriceReducer_1=tslib_1.__importStar(require("../../reducers/PriceReducer")),PricesContext_1=tslib_1.__importDefault(require("../../context/PricesContext")),SkuContext_1=tslib_1.__importDefault(require("../../context/SkuContext"));function PricesContainer(props){const{children,skuCode="",loader="Loading...",perPage=10,filters={}}=props,[state,dispatch]=(0,react_1.useReducer)(PriceReducer_1.default,PriceReducer_1.priceInitialState),config=(0,react_1.useContext)(CommerceLayerContext_1.default),{skuCodes}=(0,react_1.useContext)(SkuContext_1.default);!state.skuCodes.includes(skuCode)&&skuCode&&state.skuCodes.push(skuCode);const sCode=skuCodes&&skuCodes?.length>0?"":skuCode??"";(0,react_1.useEffect)(()=>{state.skuCodes.length===0&&skuCodes!=null&&skuCodes.length>0&&state.setSkuCodes!=null&&state.setSkuCodes({skuCodes,dispatch}),config.accessToken&&(state.skuCodes.length>0||sCode)&&(0,PriceReducer_1.getSkusPrice)(sCode&&[sCode]||state.skuCodes,{config,dispatch,perPage,filters})},[config.accessToken,sCode,state.skuCodes.length]);const priceValue=Object.assign(Object.assign({},state),{skuCode:sCode,loader,setSkuCodes:params=>{(0,PriceReducer_1.setSkuCodes)(Object.assign(Object.assign({},params),{dispatch}))}});return(0,jsx_runtime_1.jsx)(PricesContext_1.default.Provider,{value:priceValue,children})}exports.default=PricesContainer;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type ReactNode, type JSX } from 'react';
|
|
2
|
+
import type { LoaderType } from '../../typings/index';
|
|
3
|
+
import type { Order } from '@commercelayer/sdk';
|
|
4
|
+
interface ShipmentProps {
|
|
5
|
+
children: ReactNode;
|
|
6
|
+
loader?: LoaderType;
|
|
7
|
+
autoSelectSingleShippingMethod?: boolean | ((order?: Order) => void);
|
|
8
|
+
}
|
|
9
|
+
export declare function Shipment({ children, loader, autoSelectSingleShippingMethod }: ShipmentProps): JSX.Element;
|
|
10
|
+
export default Shipment;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.Shipment=Shipment;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),react_1=require("react"),ShipmentContext_1=tslib_1.__importDefault(require("../../context/ShipmentContext")),ShipmentChildrenContext_1=tslib_1.__importDefault(require("../../context/ShipmentChildrenContext")),getLoaderComponent_1=tslib_1.__importDefault(require("../../utils/getLoaderComponent")),OrderContext_1=tslib_1.__importDefault(require("../../context/OrderContext"));function Shipment({children,loader="Loading...",autoSelectSingleShippingMethod=!1}){const[loading,setLoading]=(0,react_1.useState)(!0),{shipments,deliveryLeadTimes,setShippingMethod}=(0,react_1.useContext)(ShipmentContext_1.default),{order}=(0,react_1.useContext)(OrderContext_1.default);(0,react_1.useEffect)(()=>(shipments!=null&&(autoSelectSingleShippingMethod?tslib_1.__awaiter(this,void 0,void 0,function*(){var _a;for(const shipment of shipments){const isSingle=((_a=shipment?.available_shipping_methods)===null||_a===void 0?void 0:_a.length)===1;if(!shipment?.shipping_method&&isSingle){const[shippingMethod]=shipment?.available_shipping_methods||[];if(shippingMethod&&setShippingMethod!=null){const{success,order:order2}=yield setShippingMethod(shipment.id,shippingMethod.id);typeof autoSelectSingleShippingMethod=="function"&&success&&autoSelectSingleShippingMethod(order2)}}else setTimeout(()=>{setLoading(!1)},200)}}):setLoading(!1)),()=>{setLoading(!0)}),[shipments!=null,shipments?.length,order?.gift_card_or_coupon_code]);const components=shipments?.map((shipment,k)=>{var _a,_b;const shipmentLineItems=shipment.stock_line_items,lineItems=shipmentLineItems?.map(shipmentLineItem=>{const l=shipmentLineItem.line_item;return l&&(l.quantity=shipmentLineItem.quantity),l}),shippingMethods=shipment.available_shipping_methods,currentShippingMethodId=autoSelectSingleShippingMethod&&shippingMethods&&shippingMethods.length===1?(_a=shippingMethods[0])===null||_a===void 0?void 0:_a.id:(_b=shipment.shipping_method)===null||_b===void 0?void 0:_b.id,stockTransfers=shipment.stock_transfers,parcels=shipment.parcels,times=deliveryLeadTimes?.filter(time=>{var _a2,_b2;return((_a2=time.stock_location)===null||_a2===void 0?void 0:_a2.id)===((_b2=shipment.stock_location)===null||_b2===void 0?void 0:_b2.id)}),shipmentProps={parcels,lineItems,shippingMethods,currentShippingMethodId,stockTransfers,deliveryLeadTimes:times,shipment,keyNumber:shipment?.id};return(0,jsx_runtime_1.jsx)(ShipmentChildrenContext_1.default.Provider,{value:shipmentProps,children},k)});return loading?(0,getLoaderComponent_1.default)(loader):(0,jsx_runtime_1.jsx)(jsx_runtime_1.Fragment,{children:components})}exports.default=Shipment;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type JSX } from 'react';
|
|
2
|
+
import type { Shipment } from '@commercelayer/sdk';
|
|
3
|
+
type ShipmentFieldChildrenProps = Omit<Props, 'children'> & {
|
|
4
|
+
shipment: Shipment;
|
|
5
|
+
};
|
|
6
|
+
export type ShipmentAttribute = 'number' | 'currency_code' | 'status' | 'cost_amount_cents' | 'cost_amount_float' | 'formatted_cost_amount' | 'key_number';
|
|
7
|
+
interface Props extends Omit<JSX.IntrinsicElements['span'], 'children' | 'ref'> {
|
|
8
|
+
children?: (props: ShipmentFieldChildrenProps) => JSX.Element;
|
|
9
|
+
name: ShipmentAttribute;
|
|
10
|
+
}
|
|
11
|
+
export declare function ShipmentField(props: Props): JSX.Element;
|
|
12
|
+
export default ShipmentField;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.ShipmentField=ShipmentField;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),react_1=require("react"),Parent_1=tslib_1.__importDefault(require("../utils/Parent")),get_1=tslib_1.__importDefault(require("lodash/get")),ShipmentChildrenContext_1=tslib_1.__importDefault(require("../../context/ShipmentChildrenContext"));function ShipmentField(props){const{name}=props,{shipment,keyNumber}=(0,react_1.useContext)(ShipmentChildrenContext_1.default),key=name,text=key!=="key_number"?(0,get_1.default)(shipment,key):keyNumber,parentProps=Object.assign({shipment},props);return props.children?(0,jsx_runtime_1.jsx)(Parent_1.default,Object.assign({},parentProps,{children:props.children})):(0,jsx_runtime_1.jsx)("span",Object.assign({},props,{children:text}))}exports.default=ShipmentField;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.ShipmentsContainer=ShipmentsContainer;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),ShipmentContext_1=tslib_1.__importStar(require("../../context/ShipmentContext")),react_1=require("react"),ShipmentReducer_1=tslib_1.__importStar(require("../../reducers/ShipmentReducer")),OrderContext_1=tslib_1.__importDefault(require("../../context/OrderContext")),CommerceLayerContext_1=tslib_1.__importDefault(require("../../context/CommerceLayerContext")),isEmpty_1=tslib_1.__importDefault(require("lodash/isEmpty"));function ShipmentsContainer(props){const{children}=props,[state,dispatch]=(0,react_1.useReducer)(ShipmentReducer_1.default,ShipmentReducer_1.shipmentInitialState),{order,getOrder,include,addResourceToInclude,includeLoaded}=(0,react_1.useContext)(OrderContext_1.default),config=(0,react_1.useContext)(CommerceLayerContext_1.default);(0,react_1.useEffect)(()=>{include?.includes("shipments.available_shipping_methods")?includeLoaded?.["shipments.available_shipping_methods"]||addResourceToInclude({newResourceLoaded:{"shipments.available_shipping_methods":!0,"shipments.stock_line_items.line_item":!0,"shipments.shipping_method":!0,"shipments.stock_transfers.line_item":!0,"shipments.stock_location":!0,"shipments.parcels.parcel_line_items":!0}}):addResourceToInclude({newResource:["shipments.available_shipping_methods","shipments.stock_line_items.line_item","shipments.shipping_method","shipments.stock_transfers.line_item","shipments.stock_location","shipments.parcels.parcel_line_items"]})},[include?.length,includeLoaded!=null]),(0,react_1.useEffect)(()=>{order!=null&&!(0,isEmpty_1.default)(config)&&order.shipments&&(0,ShipmentReducer_1.getShipments)({order,dispatch,config})},[order?.shipments]),(0,react_1.useEffect)(()=>(order&&(order.shipments&&order.shipments.length>0&&order.shipments.map(shipment=>shipment.available_shipping_methods&&shipment.available_shipping_methods.length>0).includes(!1)&&(0,ShipmentReducer_1.setShipmentErrors)([...state.errors||[],{code:"NO_SHIPPING_METHODS",message:"No shipping methods",resource:"shipments"}],dispatch),order.line_items&&order.line_items.length>0&&order.line_items.filter(({item_type:itemType})=>itemType==="skus").map(lineItem=>{var _a,_b,_c,_d;return!!(((_a=lineItem.item)===null||_a===void 0?void 0:_a.do_not_ship)||((_b=lineItem.item)===null||_b===void 0?void 0:_b.do_not_track)||((_d=(_c=lineItem.item)===null||_c===void 0?void 0:_c.inventory)===null||_d===void 0?void 0:_d.quantity)>=lineItem?.quantity)}).includes(!1)&&(0,ShipmentReducer_1.setShipmentErrors)([...state.errors||[],{code:"OUT_OF_STOCK",message:"No stock available",resource:"line_items"}],dispatch)),()=>{(0,ShipmentReducer_1.setShipmentErrors)([],dispatch)}),[order?.shipments]);const contextValue=(0,react_1.useMemo)(()=>Object.assign(Object.assign({},state),{setShipmentErrors:errors=>{ShipmentContext_1.defaultShipmentContext.setShipmentErrors(errors,dispatch)},setShippingMethod:(shipmentId,shippingMethodId)=>tslib_1.__awaiter(this,void 0,void 0,function*(){return yield(0,ShipmentReducer_1.setShippingMethod)({shippingMethodId,shipmentId,config,getOrder,order})})}),[state]);return(0,jsx_runtime_1.jsx)(ShipmentContext_1.default.Provider,{value:contextValue,children})}exports.default=ShipmentsContainer;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { ChildrenFunction } from '../../typings/index';
|
|
2
|
+
import type { Shipment } from '@commercelayer/sdk';
|
|
3
|
+
import type { JSX } from "react";
|
|
4
|
+
interface ChildrenProps extends Omit<Props, 'children'> {
|
|
5
|
+
/**
|
|
6
|
+
* Shipments of the current order
|
|
7
|
+
*/
|
|
8
|
+
shipments?: Shipment[] | null;
|
|
9
|
+
/**
|
|
10
|
+
* Quantity of the shipments
|
|
11
|
+
*/
|
|
12
|
+
quantity: number;
|
|
13
|
+
}
|
|
14
|
+
interface Props extends Omit<JSX.IntrinsicElements['span'], 'children' | 'ref'> {
|
|
15
|
+
children?: ChildrenFunction<ChildrenProps>;
|
|
16
|
+
}
|
|
17
|
+
export declare function ShipmentsCount({ children, ...p }: Props): JSX.Element;
|
|
18
|
+
export default ShipmentsCount;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.ShipmentsCount=ShipmentsCount;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),Parent_1=tslib_1.__importDefault(require("../utils/Parent")),ShipmentContext_1=tslib_1.__importDefault(require("../../context/ShipmentContext")),useCustomContext_1=tslib_1.__importDefault(require("../../utils/hooks/useCustomContext"));function ShipmentsCount(_a){var _b,{children}=_a,p=tslib_1.__rest(_a,["children"]);const{shipments}=(0,useCustomContext_1.default)({context:ShipmentContext_1.default,contextComponentName:"ShipmentsContainer",currentComponentName:"ShipmentsCount",key:"shipments"}),quantity=(_b=shipments?.length)!==null&&_b!==void 0?_b:0,childrenProps=Object.assign(Object.assign({},p),{quantity,shipments});return children?(0,jsx_runtime_1.jsx)(Parent_1.default,Object.assign({},childrenProps,{children})):(0,jsx_runtime_1.jsx)("span",Object.assign({},p,{children:quantity}))}exports.default=ShipmentsCount;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.ShippingMethod=ShippingMethod;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),react_1=require("react"),ShippingMethodChildrenContext_1=tslib_1.__importDefault(require("../../context/ShippingMethodChildrenContext")),ShipmentChildrenContext_1=tslib_1.__importDefault(require("../../context/ShipmentChildrenContext")),isEmpty_1=tslib_1.__importDefault(require("lodash/isEmpty"));function ShippingMethod(props){const{children,readonly,emptyText="There are not any shipping method available"}=props,{shippingMethods,currentShippingMethodId,deliveryLeadTimes,shipment}=(0,react_1.useContext)(ShipmentChildrenContext_1.default),[items,setItems]=(0,react_1.useState)([]);(0,react_1.useEffect)(()=>{const methods=shippingMethods?.filter(s=>readonly?s.id===currentShippingMethodId:!0).map((shippingMethod,k)=>{var _a;const[deliveryLeadTimeForShipment]=(_a=deliveryLeadTimes?.filter(delivery=>{var _a2;const deliveryShippingMethodId=(_a2=delivery.shipping_method)===null||_a2===void 0?void 0:_a2.id;return shippingMethod.id===deliveryShippingMethodId}))!==null&&_a!==void 0?_a:[],shippingProps={shipmentId:shipment?.id,shippingMethod,currentShippingMethodId,deliveryLeadTimeForShipment};return(0,jsx_runtime_1.jsx)(ShippingMethodChildrenContext_1.default.Provider,{value:shippingProps,children},k)});return methods&&setItems(methods),()=>{setItems([])}},[currentShippingMethodId,deliveryLeadTimes,shippingMethods]);const components=!(0,isEmpty_1.default)(items)&&items||emptyText;return(0,jsx_runtime_1.jsx)(jsx_runtime_1.Fragment,{children:components})}exports.default=ShippingMethod;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type JSX } from 'react';
|
|
2
|
+
import type { ShippingMethod } from '@commercelayer/sdk';
|
|
3
|
+
type ChildrenProps = Omit<Props, 'children'> & {
|
|
4
|
+
label: string;
|
|
5
|
+
shippingMethod: ShippingMethod;
|
|
6
|
+
};
|
|
7
|
+
interface Props extends Omit<JSX.IntrinsicElements['label'], 'children' | 'ref'> {
|
|
8
|
+
children?: (props: ChildrenProps) => JSX.Element;
|
|
9
|
+
}
|
|
10
|
+
export declare function ShippingMethodName(props: Props): JSX.Element;
|
|
11
|
+
export default ShippingMethodName;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.ShippingMethodName=ShippingMethodName;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),react_1=require("react"),ShippingMethodChildrenContext_1=tslib_1.__importDefault(require("../../context/ShippingMethodChildrenContext")),Parent_1=tslib_1.__importDefault(require("../utils/Parent"));function ShippingMethodName(props){var _a;const{shippingMethod,deliveryLeadTimeForShipment,shipmentId}=(0,react_1.useContext)(ShippingMethodChildrenContext_1.default),htmlFor=`shipment-${shipmentId??""}-${(_a=shippingMethod?.id)!==null&&_a!==void 0?_a:""}`||"",labelName=shippingMethod?.name,parentProps=Object.assign({shippingMethod,deliveryLeadTimeForShipment,label:labelName,htmlFor},props);return props.children?(0,jsx_runtime_1.jsx)(Parent_1.default,Object.assign({},parentProps,{children:props.children})):(0,jsx_runtime_1.jsx)("label",Object.assign({htmlFor},props,{children:labelName}))}exports.default=ShippingMethodName;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type JSX } from 'react';
|
|
2
|
+
import type { BaseAmountComponent } from '../../typings/index';
|
|
3
|
+
type Props = BaseAmountComponent & {
|
|
4
|
+
/**
|
|
5
|
+
* The label to show when the price is free
|
|
6
|
+
*/
|
|
7
|
+
labelFreeOver?: string;
|
|
8
|
+
/**
|
|
9
|
+
* The label to show when the price is external
|
|
10
|
+
*/
|
|
11
|
+
labelExternal?: string;
|
|
12
|
+
} & ({
|
|
13
|
+
type?: 'amount';
|
|
14
|
+
base?: 'freeOver';
|
|
15
|
+
} | {
|
|
16
|
+
type?: 'amount' | 'amountForShipment';
|
|
17
|
+
base?: 'price';
|
|
18
|
+
});
|
|
19
|
+
export declare function ShippingMethodPrice(props: Props): JSX.Element;
|
|
20
|
+
export default ShippingMethodPrice;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.ShippingMethodPrice=ShippingMethodPrice;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),react_1=require("react"),getAmount_1=tslib_1.__importDefault(require("../../utils/getAmount")),ShippingMethodChildrenContext_1=tslib_1.__importDefault(require("../../context/ShippingMethodChildrenContext")),Parent_1=tslib_1.__importDefault(require("../utils/Parent"));function ShippingMethodPrice(props){const{base="price_amount",type="for_shipment",format="formatted",labelFreeOver="Free",labelExternal="Price estimates after the shipping method selection"}=props,p=tslib_1.__rest(props,["base","type","format","labelFreeOver","labelExternal"]),{shippingMethod}=(0,react_1.useContext)(ShippingMethodChildrenContext_1.default),[price,setPrice]=(0,react_1.useState)(""),[priceCents,setPriceCents]=(0,react_1.useState)(0),scheme=shippingMethod?.scheme;(0,react_1.useEffect)(()=>{if(shippingMethod){const p2=(0,getAmount_1.default)({base,type,format,obj:shippingMethod});setPrice(p2);const pCents=(0,getAmount_1.default)({base:"price_amount",type:"for_shipment",format:"cents",obj:shippingMethod});setPriceCents(pCents)}return()=>{setPrice(""),setPriceCents(0)}},[shippingMethod]);const parentProps=Object.assign({price,scheme},p),finalPrice=priceCents===0?labelFreeOver:price;return props.children?(0,jsx_runtime_1.jsx)(Parent_1.default,Object.assign({},parentProps,{children:props.children})):(0,jsx_runtime_1.jsx)("span",Object.assign({},p,{children:scheme==="external"?labelExternal:finalPrice}))}exports.default=ShippingMethodPrice;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type JSX } from 'react';
|
|
2
|
+
import type { Order, ShippingMethod } from '@commercelayer/sdk';
|
|
3
|
+
interface ShippingMethodRadioButtonType extends Omit<Props, 'children'> {
|
|
4
|
+
shippingMethod: ShippingMethod;
|
|
5
|
+
shipmentId: string;
|
|
6
|
+
}
|
|
7
|
+
interface TOnChange {
|
|
8
|
+
shippingMethod: ShippingMethod;
|
|
9
|
+
shipmentId: string;
|
|
10
|
+
order?: Order;
|
|
11
|
+
}
|
|
12
|
+
type Props = {
|
|
13
|
+
children?: (props: ShippingMethodRadioButtonType) => JSX.Element;
|
|
14
|
+
onChange?: (params: TOnChange) => void;
|
|
15
|
+
} & Omit<JSX.IntrinsicElements['input'], 'onChange' | 'ref' | 'children'>;
|
|
16
|
+
export declare function ShippingMethodRadioButton(props: Props): JSX.Element;
|
|
17
|
+
export default ShippingMethodRadioButton;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.ShippingMethodRadioButton=ShippingMethodRadioButton;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),react_1=require("react"),ShippingMethodChildrenContext_1=tslib_1.__importDefault(require("../../context/ShippingMethodChildrenContext")),Parent_1=tslib_1.__importDefault(require("../utils/Parent")),ShipmentContext_1=tslib_1.__importDefault(require("../../context/ShipmentContext"));function ShippingMethodRadioButton(props){const{onChange,children}=props,p=tslib_1.__rest(props,["onChange","children"]),[checked,setChecked]=(0,react_1.useState)(!1),[disabled,setDisabled]=(0,react_1.useState)(!1),{shippingMethod,currentShippingMethodId,shipmentId}=(0,react_1.useContext)(ShippingMethodChildrenContext_1.default),{setShippingMethod}=(0,react_1.useContext)(ShipmentContext_1.default),shippingMethodId=shippingMethod?.id,name=`shipment-${shipmentId??""}`,id=`${name}-${shippingMethodId??""}`;(0,react_1.useEffect)(()=>(setChecked(shippingMethodId===currentShippingMethodId),()=>{setChecked(!1)}),[currentShippingMethodId,shippingMethodId]);const handleOnChange=()=>tslib_1.__awaiter(this,void 0,void 0,function*(){if(setDisabled(!0),shipmentId&&shippingMethodId&&setShippingMethod!=null){const{order}=yield setShippingMethod(shipmentId,shippingMethodId);shippingMethod&&onChange!=null&&onChange({shippingMethod,shipmentId,order})}setDisabled(!1)}),parentProps=Object.assign({shippingMethod,shipmentId,handleOnChange,name,id,disabled},props);return children?(0,jsx_runtime_1.jsx)(Parent_1.default,Object.assign({},parentProps,{children})):(0,jsx_runtime_1.jsx)("input",Object.assign({disabled,type:"radio",name,id,onChange:e=>{e.preventDefault(),e.stopPropagation(),handleOnChange()},checked},p))}exports.default=ShippingMethodRadioButton;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { type ReactNode, type JSX } from 'react';
|
|
2
|
+
interface Props {
|
|
3
|
+
/**
|
|
4
|
+
* The children component
|
|
5
|
+
*/
|
|
6
|
+
children: ReactNode;
|
|
7
|
+
/**
|
|
8
|
+
* The sku code
|
|
9
|
+
*/
|
|
10
|
+
skuCode?: string;
|
|
11
|
+
/**
|
|
12
|
+
* The sku id. If you use this prop, the skuCode will be ignored and the sku will be fetched by id improving the performance
|
|
13
|
+
*/
|
|
14
|
+
skuId?: string;
|
|
15
|
+
/**
|
|
16
|
+
* Callback called when the quantity is updated
|
|
17
|
+
*/
|
|
18
|
+
getQuantity?: (quantity: number) => void;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Main container for the Availability components.
|
|
22
|
+
* It stores - in its context - the sku quantity returned from the `inventory_model` and the `delivery_lead_time` for the first shipping method found in the inventory model.
|
|
23
|
+
*
|
|
24
|
+
* It can be used to fetch the quantities for a specific `sku_code` passed as prop.
|
|
25
|
+
* <span title='Requirements' type='warning'>
|
|
26
|
+
* Must be a child of the `<CommerceLayer>` component. <br/>
|
|
27
|
+
* Can be a child of the `<SkusContainer>` component and receive the `sku_code` from its context.
|
|
28
|
+
* </span>
|
|
29
|
+
* <span title='Children' type='info'>
|
|
30
|
+
* `<AvailabilityTemplate>`
|
|
31
|
+
* </span>
|
|
32
|
+
*/
|
|
33
|
+
export declare function AvailabilityContainer({ children, skuCode, skuId, getQuantity }: Props): JSX.Element;
|
|
34
|
+
export default AvailabilityContainer;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.AvailabilityContainer=AvailabilityContainer;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),react_1=require("react"),AvailabilityReducer_1=tslib_1.__importStar(require("../../reducers/AvailabilityReducer")),AvailabilityContext_1=tslib_1.__importDefault(require("../../context/AvailabilityContext")),CommerceLayerContext_1=tslib_1.__importDefault(require("../../context/CommerceLayerContext")),LineItemChildrenContext_1=tslib_1.__importDefault(require("../../context/LineItemChildrenContext")),SkuChildrenContext_1=tslib_1.__importDefault(require("../../context/SkuChildrenContext")),useCustomContext_1=tslib_1.__importDefault(require("../../utils/hooks/useCustomContext"));function AvailabilityContainer({children,skuCode,skuId,getQuantity}){const{lineItem}=(0,react_1.useContext)(LineItemChildrenContext_1.default),{sku}=(0,react_1.useContext)(SkuChildrenContext_1.default),{accessToken,endpoint}=(0,useCustomContext_1.default)({context:CommerceLayerContext_1.default,contextComponentName:"CommerceLayer",currentComponentName:"AvailabilityContainer",key:"accessToken"}),[state,dispatch]=(0,react_1.useReducer)(AvailabilityReducer_1.default,AvailabilityReducer_1.availabilityInitialState),sCode=skuCode||lineItem?.sku_code||sku?.code;(0,react_1.useEffect)(()=>{if(accessToken!=null&&accessToken!==""){const config={accessToken,endpoint};(sCode!=null||skuId!=null)&&(0,AvailabilityReducer_1.getAvailability)({skuCode:sCode,skuId,config,dispatch})}return()=>{dispatch({type:"setAvailability",payload:{}})}},[accessToken,sCode,skuId]),(0,react_1.useEffect)(()=>{getQuantity!=null&&state?.quantity!=null&&getQuantity(state?.quantity)},[state.quantity]);const memoized=(0,react_1.useMemo)(()=>Object.assign(Object.assign({},state),{parent:!0}),[state]);return(0,jsx_runtime_1.jsx)(AvailabilityContext_1.default.Provider,{value:memoized,children})}exports.default=AvailabilityContainer;
|