@commercelayer/react-components 2.46.3 → 2.47.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/{dist → lib/cjs}/components/AddToCartButton.d.ts +20 -17
- package/lib/cjs/components/AddToCartButton.js +1 -0
- package/{dist → lib/cjs}/components/Address.d.ts +13 -13
- package/lib/cjs/components/Address.js +1 -0
- package/{dist → lib/cjs}/components/AddressCountrySelector.d.ts +9 -9
- package/lib/cjs/components/AddressCountrySelector.js +1 -0
- package/{dist → lib/cjs}/components/AddressField.d.ts +15 -15
- package/lib/cjs/components/AddressField.js +1 -0
- package/{dist → lib/cjs}/components/AddressInput.d.ts +7 -7
- package/lib/cjs/components/AddressInput.js +1 -0
- package/{dist → lib/cjs}/components/AddressStateSelector.d.ts +11 -11
- package/lib/cjs/components/AddressStateSelector.js +1 -0
- package/{dist → lib/cjs}/components/AddressesContainer.d.ts +7 -7
- package/lib/cjs/components/AddressesContainer.js +1 -0
- package/{dist → lib/cjs}/components/AdyenPayment.d.ts +25 -25
- package/lib/cjs/components/AdyenPayment.js +1 -0
- package/{dist → lib/cjs}/components/AvailabilityContainer.d.ts +7 -7
- package/lib/cjs/components/AvailabilityContainer.js +1 -0
- package/{dist → lib/cjs}/components/AvailabilityTemplate.d.ts +11 -16
- package/lib/cjs/components/AvailabilityTemplate.js +1 -0
- package/{dist → lib/cjs}/components/BillingAddressContainer.d.ts +6 -6
- package/lib/cjs/components/BillingAddressContainer.js +1 -0
- package/{dist → lib/cjs}/components/BillingAddressForm.d.ts +8 -8
- package/lib/cjs/components/BillingAddressForm.js +1 -0
- package/{dist → lib/cjs}/components/BraintreePayment.d.ts +30 -30
- package/lib/cjs/components/BraintreePayment.js +1 -0
- package/{dist → lib/cjs}/components/CheckoutLink.d.ts +11 -11
- package/lib/cjs/components/CheckoutLink.js +1 -0
- package/{dist → lib/cjs}/components/CommerceLayer.d.ts +8 -9
- package/lib/cjs/components/CommerceLayer.js +1 -0
- package/{dist → lib/cjs}/components/CustomerContainer.d.ts +7 -7
- package/lib/cjs/components/CustomerContainer.js +1 -0
- package/{dist → lib/cjs}/components/CustomerInput.d.ts +11 -11
- package/lib/cjs/components/CustomerInput.js +1 -0
- package/{dist → lib/cjs}/components/DeliveryLeadTime.d.ts +10 -10
- package/lib/cjs/components/DeliveryLeadTime.js +1 -0
- package/{dist → lib/cjs}/components/DiscountAmount.d.ts +4 -4
- package/lib/cjs/components/DiscountAmount.js +1 -0
- package/{dist → lib/cjs}/components/Errors.d.ts +5 -5
- package/lib/cjs/components/Errors.js +1 -0
- package/{dist → lib/cjs}/components/ExternalFunction.d.ts +7 -7
- package/lib/cjs/components/ExternalFunction.js +1 -0
- package/{dist → lib/cjs}/components/GiftCard.d.ts +8 -8
- package/lib/cjs/components/GiftCard.js +1 -0
- package/{dist → lib/cjs}/components/GiftCardAmount.d.ts +4 -4
- package/lib/cjs/components/GiftCardAmount.js +1 -0
- package/{dist → lib/cjs}/components/GiftCardContainer.d.ts +6 -6
- package/lib/cjs/components/GiftCardContainer.js +1 -0
- package/{dist → lib/cjs}/components/GiftCardCurrencySelector.d.ts +7 -7
- package/lib/cjs/components/GiftCardCurrencySelector.js +1 -0
- package/{dist → lib/cjs}/components/GiftCardInput.d.ts +7 -7
- package/lib/cjs/components/GiftCardInput.js +1 -0
- package/{dist → lib/cjs}/components/GiftCardOrCouponCode.d.ts +13 -13
- package/lib/cjs/components/GiftCardOrCouponCode.js +1 -0
- package/{dist → lib/cjs}/components/GiftCardOrCouponForm.d.ts +10 -10
- package/lib/cjs/components/GiftCardOrCouponForm.js +1 -0
- package/{dist → lib/cjs}/components/GiftCardOrCouponInput.d.ts +8 -8
- package/lib/cjs/components/GiftCardOrCouponInput.js +1 -0
- package/{dist → lib/cjs}/components/GiftCardOrCouponRemoveButton.d.ts +16 -16
- package/lib/cjs/components/GiftCardOrCouponRemoveButton.js +1 -0
- package/{dist → lib/cjs}/components/GiftCardOrCouponSubmit.d.ts +9 -9
- package/lib/cjs/components/GiftCardOrCouponSubmit.js +1 -0
- package/{dist → lib/cjs}/components/GiftCardRecipient.d.ts +0 -0
- package/lib/cjs/components/GiftCardRecipient.js +1 -0
- package/{dist → lib/cjs}/components/GiftCardRecipientInput.d.ts +0 -0
- package/lib/cjs/components/GiftCardRecipientInput.js +1 -0
- package/{dist → lib/cjs}/components/ItemContainer.d.ts +11 -11
- package/lib/cjs/components/ItemContainer.js +1 -0
- package/{dist → lib/cjs}/components/LineItem.d.ts +8 -8
- package/lib/cjs/components/LineItem.js +1 -0
- package/{dist → lib/cjs}/components/LineItemAmount.d.ts +7 -7
- package/lib/cjs/components/LineItemAmount.js +1 -0
- package/{dist/components/LineItemSkuCode.d.ts → lib/cjs/components/LineItemCode.d.ts} +8 -7
- package/lib/cjs/components/LineItemCode.js +1 -0
- package/{dist → lib/cjs}/components/LineItemImage.d.ts +10 -10
- package/lib/cjs/components/LineItemImage.js +1 -0
- package/{dist → lib/cjs}/components/LineItemName.d.ts +9 -7
- package/lib/cjs/components/LineItemName.js +1 -0
- package/{dist → lib/cjs}/components/LineItemOption.d.ts +19 -19
- package/lib/cjs/components/LineItemOption.js +1 -0
- package/{dist → lib/cjs}/components/LineItemOptions.d.ts +14 -14
- package/lib/cjs/components/LineItemOptions.js +1 -0
- package/{dist → lib/cjs}/components/LineItemQuantity.d.ts +14 -14
- package/lib/cjs/components/LineItemQuantity.js +1 -0
- package/{dist → lib/cjs}/components/LineItemRemoveLink.d.ts +12 -12
- package/lib/cjs/components/LineItemRemoveLink.js +1 -0
- package/{dist → lib/cjs}/components/LineItemsContainer.d.ts +8 -8
- package/lib/cjs/components/LineItemsContainer.js +1 -0
- package/{dist → lib/cjs}/components/LineItemsCount.d.ts +10 -10
- package/lib/cjs/components/LineItemsCount.js +1 -0
- package/{dist → lib/cjs}/components/MetadataInput.d.ts +5 -5
- package/lib/cjs/components/MetadataInput.js +1 -0
- package/{dist → lib/cjs}/components/OrderContainer.d.ts +11 -10
- package/lib/cjs/components/OrderContainer.js +1 -0
- package/{dist → lib/cjs}/components/OrderNumber.d.ts +5 -5
- package/lib/cjs/components/OrderNumber.js +1 -0
- package/{dist → lib/cjs}/components/OrderStorage.d.ts +8 -8
- package/lib/cjs/components/OrderStorage.js +1 -0
- package/{dist → lib/cjs}/components/PaymentGateway.d.ts +16 -16
- package/lib/cjs/components/PaymentGateway.js +1 -0
- package/{dist → lib/cjs}/components/PaymentMethod.d.ts +16 -16
- package/lib/cjs/components/PaymentMethod.js +1 -0
- package/{dist → lib/cjs}/components/PaymentMethodAmount.d.ts +4 -4
- package/lib/cjs/components/PaymentMethodAmount.js +1 -0
- package/{dist → lib/cjs}/components/PaymentMethodName.d.ts +9 -9
- package/lib/cjs/components/PaymentMethodName.js +1 -0
- package/{dist → lib/cjs}/components/PaymentMethodPrice.d.ts +9 -9
- package/lib/cjs/components/PaymentMethodPrice.js +1 -0
- package/{dist → lib/cjs}/components/PaymentMethodRadioButton.d.ts +11 -11
- package/lib/cjs/components/PaymentMethodRadioButton.js +1 -0
- package/{dist → lib/cjs}/components/PaymentMethodsContainer.d.ts +8 -8
- package/lib/cjs/components/PaymentMethodsContainer.js +1 -0
- package/{dist → lib/cjs}/components/PaymentSource.d.ts +19 -19
- package/lib/cjs/components/PaymentSource.js +1 -0
- package/{dist → lib/cjs}/components/PaymentSourceBrandIcon.d.ts +15 -15
- package/lib/cjs/components/PaymentSourceBrandIcon.js +1 -0
- package/{dist → lib/cjs}/components/PaymentSourceBrandName.d.ts +12 -12
- package/lib/cjs/components/PaymentSourceBrandName.js +1 -0
- package/{dist → lib/cjs}/components/PaymentSourceDetail.d.ts +12 -12
- package/lib/cjs/components/PaymentSourceDetail.js +1 -0
- package/{dist → lib/cjs}/components/PaymentSourceEditButton.d.ts +9 -9
- package/lib/cjs/components/PaymentSourceEditButton.js +1 -0
- package/{dist → lib/cjs}/components/PaypalPayment.d.ts +12 -12
- package/lib/cjs/components/PaypalPayment.js +1 -0
- package/{dist → lib/cjs}/components/PlaceOrderButton.d.ts +12 -12
- package/lib/cjs/components/PlaceOrderButton.js +1 -0
- package/{dist → lib/cjs}/components/PlaceOrderContainer.d.ts +8 -8
- package/lib/cjs/components/PlaceOrderContainer.js +1 -0
- package/{dist → lib/cjs}/components/Price.d.ts +14 -14
- package/lib/cjs/components/Price.js +1 -0
- package/{dist → lib/cjs}/components/PricesContainer.d.ts +11 -11
- package/lib/cjs/components/PricesContainer.js +1 -0
- package/{dist → lib/cjs}/components/PrivacyAndTermsCheckbox.d.ts +4 -4
- package/lib/cjs/components/PrivacyAndTermsCheckbox.js +1 -0
- package/{dist → lib/cjs}/components/QuantitySelector.d.ts +17 -17
- package/lib/cjs/components/QuantitySelector.js +1 -0
- package/{dist → lib/cjs}/components/SaveAddressesButton.d.ts +10 -10
- package/lib/cjs/components/SaveAddressesButton.js +1 -0
- package/{dist → lib/cjs}/components/SaveCustomerButton.d.ts +13 -13
- package/lib/cjs/components/SaveCustomerButton.js +1 -0
- package/{dist → lib/cjs}/components/Shipment.d.ts +8 -8
- package/lib/cjs/components/Shipment.js +1 -0
- package/{dist → lib/cjs}/components/ShipmentField.d.ts +12 -12
- package/lib/cjs/components/ShipmentField.js +1 -0
- package/{dist → lib/cjs}/components/ShipmentsContainer.d.ts +6 -6
- package/lib/cjs/components/ShipmentsContainer.js +1 -0
- package/{dist → lib/cjs}/components/ShippingAddressContainer.d.ts +6 -6
- package/lib/cjs/components/ShippingAddressContainer.js +1 -0
- package/{dist → lib/cjs}/components/ShippingAddressForm.d.ts +8 -8
- package/lib/cjs/components/ShippingAddressForm.js +1 -0
- package/{dist → lib/cjs}/components/ShippingAmount.d.ts +4 -4
- package/lib/cjs/components/ShippingAmount.js +1 -0
- package/{dist → lib/cjs}/components/ShippingMethod.d.ts +8 -8
- package/lib/cjs/components/ShippingMethod.js +1 -0
- package/{dist → lib/cjs}/components/ShippingMethodName.d.ts +11 -7
- package/lib/cjs/components/ShippingMethodName.js +1 -0
- package/{dist → lib/cjs}/components/ShippingMethodPrice.d.ts +13 -13
- package/lib/cjs/components/ShippingMethodPrice.js +1 -0
- package/{dist → lib/cjs}/components/ShippingMethodRadioButton.d.ts +9 -9
- package/lib/cjs/components/ShippingMethodRadioButton.js +1 -0
- package/{dist → lib/cjs}/components/SkuList.d.ts +7 -7
- package/lib/cjs/components/SkuList.js +1 -0
- package/{dist → lib/cjs}/components/SkuListsContainer.d.ts +6 -6
- package/lib/cjs/components/SkuListsContainer.js +1 -0
- package/{dist → lib/cjs}/components/SkuOption.d.ts +7 -7
- package/lib/cjs/components/SkuOption.js +1 -0
- package/{dist → lib/cjs}/components/SkuOptionInput.d.ts +5 -5
- package/lib/cjs/components/SkuOptionInput.js +1 -0
- package/{dist → lib/cjs}/components/SkuOptionsContainer.d.ts +7 -7
- package/lib/cjs/components/SkuOptionsContainer.js +1 -0
- package/{dist → lib/cjs}/components/StockTransfer.d.ts +6 -6
- package/lib/cjs/components/StockTransfer.js +1 -0
- package/{dist → lib/cjs}/components/StockTransferField.d.ts +9 -9
- package/lib/cjs/components/StockTransferField.js +1 -0
- package/{dist → lib/cjs}/components/StripePayment.d.ts +18 -18
- package/lib/cjs/components/StripePayment.js +1 -0
- package/{dist → lib/cjs}/components/SubTotalAmount.d.ts +4 -4
- package/lib/cjs/components/SubTotalAmount.js +1 -0
- package/{dist → lib/cjs}/components/SubmitButton.d.ts +9 -9
- package/lib/cjs/components/SubmitButton.js +1 -0
- package/{dist → lib/cjs}/components/TaxesAmount.d.ts +4 -4
- package/lib/cjs/components/TaxesAmount.js +1 -0
- package/{dist → lib/cjs}/components/TotalAmount.d.ts +4 -4
- package/lib/cjs/components/TotalAmount.js +1 -0
- package/{dist → lib/cjs}/components/VariantSelector.d.ts +27 -27
- package/lib/cjs/components/VariantSelector.js +1 -0
- package/{dist → lib/cjs}/components/VariantsContainer.d.ts +8 -8
- package/lib/cjs/components/VariantsContainer.js +1 -0
- package/{dist → lib/cjs}/components/WireTransferPayment.d.ts +10 -10
- package/lib/cjs/components/WireTransferPayment.js +1 -0
- package/{dist → lib/cjs}/components/gateways/AdyenGateway.d.ts +5 -5
- package/lib/cjs/components/gateways/AdyenGateway.js +1 -0
- package/{dist → lib/cjs}/components/gateways/BraintreeGateway.d.ts +5 -5
- package/lib/cjs/components/gateways/BraintreeGateway.js +1 -0
- package/{dist → lib/cjs}/components/gateways/PaypalGateway.d.ts +5 -5
- package/lib/cjs/components/gateways/PaypalGateway.js +1 -0
- package/{dist → lib/cjs}/components/gateways/StripeGateway.d.ts +5 -5
- package/lib/cjs/components/gateways/StripeGateway.js +1 -0
- package/{dist → lib/cjs}/components/gateways/WireTransferGateway.d.ts +5 -5
- package/lib/cjs/components/gateways/WireTransferGateway.js +1 -0
- package/{dist → lib/cjs}/components/utils/AddressCardsTemplate.d.ts +27 -27
- package/lib/cjs/components/utils/AddressCardsTemplate.js +1 -0
- package/{dist → lib/cjs}/components/utils/BaseField.d.ts +8 -8
- package/lib/cjs/components/utils/BaseField.js +1 -0
- package/lib/cjs/components/utils/BaseInput.d.ts +5 -0
- package/lib/cjs/components/utils/BaseInput.js +1 -0
- package/{dist → lib/cjs}/components/utils/BaseOrderPrice.d.ts +6 -6
- package/lib/cjs/components/utils/BaseOrderPrice.js +1 -0
- package/{dist → lib/cjs}/components/utils/BaseSelect.d.ts +5 -5
- package/lib/cjs/components/utils/BaseSelect.js +1 -0
- package/{dist → lib/cjs}/components/utils/Parent.d.ts +8 -8
- package/lib/cjs/components/utils/Parent.js +1 -0
- package/{dist → lib/cjs}/components/utils/PaymentCardsTemplate.d.ts +23 -24
- package/lib/cjs/components/utils/PaymentCardsTemplate.js +1 -0
- package/{dist → lib/cjs}/components/utils/PriceTemplate.d.ts +8 -8
- package/lib/cjs/components/utils/PriceTemplate.js +1 -0
- package/{dist → lib/cjs}/components/utils/VariantTemplate.d.ts +34 -34
- package/lib/cjs/components/utils/VariantTemplate.js +1 -0
- package/{dist → lib/cjs}/components/utils/getAllErrors.d.ts +17 -17
- package/lib/cjs/components/utils/getAllErrors.js +1 -0
- package/{dist → lib/cjs}/config/components.d.ts +867 -867
- package/lib/cjs/config/components.js +1 -0
- package/lib/cjs/config/currency.json +1 -0
- package/{dist → lib/cjs}/context/AddressChildrenContext.d.ts +7 -7
- package/lib/cjs/context/AddressChildrenContext.js +1 -0
- package/{dist → lib/cjs}/context/AddressContext.d.ts +17 -17
- package/lib/cjs/context/AddressContext.js +1 -0
- package/{dist → lib/cjs}/context/AvailabilityContext.d.ts +3 -3
- package/lib/cjs/context/AvailabilityContext.js +1 -0
- package/{dist → lib/cjs}/context/BillingAddressContext.d.ts +12 -12
- package/lib/cjs/context/BillingAddressContext.js +1 -0
- package/{dist → lib/cjs}/context/BillingAddressFormContext.d.ts +18 -18
- package/lib/cjs/context/BillingAddressFormContext.js +1 -0
- package/{dist → lib/cjs}/context/CommerceLayerContext.d.ts +7 -8
- package/lib/cjs/context/CommerceLayerContext.js +1 -0
- package/{dist → lib/cjs}/context/CouponAndGiftCardFormContext.d.ts +7 -7
- package/lib/cjs/context/CouponAndGiftCardFormContext.js +1 -0
- package/{dist → lib/cjs}/context/CustomerContext.d.ts +16 -16
- package/lib/cjs/context/CustomerContext.js +1 -0
- package/{dist → lib/cjs}/context/ExternalFunctionContext.d.ts +12 -12
- package/lib/cjs/context/ExternalFunctionContext.js +1 -0
- package/{dist → lib/cjs}/context/GiftCardContext.d.ts +11 -11
- package/lib/cjs/context/GiftCardContext.js +1 -0
- package/{dist → lib/cjs}/context/ItemContext.d.ts +13 -13
- package/lib/cjs/context/ItemContext.js +1 -0
- package/lib/cjs/context/LineItemChildrenContext.d.ts +9 -0
- package/lib/cjs/context/LineItemChildrenContext.js +1 -0
- package/{dist → lib/cjs}/context/LineItemContext.d.ts +8 -8
- package/lib/cjs/context/LineItemContext.js +1 -0
- package/{dist → lib/cjs}/context/LineItemOptionChildrenContext.d.ts +8 -8
- package/lib/cjs/context/LineItemOptionChildrenContext.js +1 -0
- package/lib/cjs/context/OrderContext.d.ts +26 -0
- package/lib/cjs/context/OrderContext.js +1 -0
- package/{dist → lib/cjs}/context/OrderStorageContext.d.ts +11 -11
- package/lib/cjs/context/OrderStorageContext.js +1 -0
- package/{dist → lib/cjs}/context/PaymentMethodChildrenContext.d.ts +10 -10
- package/lib/cjs/context/PaymentMethodChildrenContext.js +1 -0
- package/{dist → lib/cjs}/context/PaymentMethodContext.d.ts +23 -23
- package/lib/cjs/context/PaymentMethodContext.js +1 -0
- package/{dist → lib/cjs}/context/PaymentSourceContext.d.ts +14 -14
- package/lib/cjs/context/PaymentSourceContext.js +1 -0
- package/{dist → lib/cjs}/context/PlaceOrderContext.d.ts +16 -16
- package/lib/cjs/context/PlaceOrderContext.js +1 -0
- package/{dist → lib/cjs}/context/PricesContext.d.ts +7 -7
- package/lib/cjs/context/PricesContext.js +1 -0
- package/lib/cjs/context/ShipmentChildrenContext.d.ts +13 -0
- package/lib/cjs/context/ShipmentChildrenContext.js +1 -0
- package/{dist → lib/cjs}/context/ShipmentContext.d.ts +12 -12
- package/lib/cjs/context/ShipmentContext.js +1 -0
- package/{dist → lib/cjs}/context/ShippingAddressContext.d.ts +10 -10
- package/lib/cjs/context/ShippingAddressContext.js +1 -0
- package/{dist → lib/cjs}/context/ShippingAddressFormContext.d.ts +4 -4
- package/lib/cjs/context/ShippingAddressFormContext.js +1 -0
- package/lib/cjs/context/ShippingMethodChildrenContext.d.ts +10 -0
- package/lib/cjs/context/ShippingMethodChildrenContext.js +1 -0
- package/lib/cjs/context/SkuListsContext.d.ts +6 -0
- package/lib/cjs/context/SkuListsContext.js +1 -0
- package/{dist → lib/cjs}/context/SkuOptionChildrenContext.d.ts +8 -8
- package/lib/cjs/context/SkuOptionChildrenContext.js +1 -0
- package/{dist → lib/cjs}/context/SkuOptionsContext.d.ts +3 -3
- package/lib/cjs/context/SkuOptionsContext.js +1 -0
- package/{dist → lib/cjs}/context/StockTransferChildrenContext.d.ts +7 -7
- package/lib/cjs/context/StockTransferChildrenContext.js +1 -0
- package/{dist → lib/cjs}/context/VariantsContext.d.ts +3 -3
- package/lib/cjs/context/VariantsContext.js +1 -0
- package/lib/cjs/index.d.ts +90 -0
- package/lib/cjs/index.js +1 -0
- package/{dist → lib/cjs}/reducers/AddressReducer.d.ts +58 -57
- package/lib/cjs/reducers/AddressReducer.js +1 -0
- package/lib/cjs/reducers/AvailabilityReducer.d.ts +53 -0
- package/lib/cjs/reducers/AvailabilityReducer.js +1 -0
- package/{dist → lib/cjs}/reducers/BillingAddressReducer.d.ts +31 -32
- package/lib/cjs/reducers/BillingAddressReducer.js +1 -0
- package/{dist → lib/cjs}/reducers/CustomerReducer.d.ts +50 -51
- package/lib/cjs/reducers/CustomerReducer.js +1 -0
- package/{dist → lib/cjs}/reducers/GiftCardReducer.d.ts +76 -75
- package/lib/cjs/reducers/GiftCardReducer.js +1 -0
- package/{dist → lib/cjs}/reducers/ItemReducer.d.ts +69 -68
- package/lib/cjs/reducers/ItemReducer.js +1 -0
- package/{dist → lib/cjs}/reducers/LineItemReducer.d.ts +52 -52
- package/lib/cjs/reducers/LineItemReducer.js +1 -0
- package/lib/cjs/reducers/OrderReducer.d.ts +127 -0
- package/lib/cjs/reducers/OrderReducer.js +1 -0
- package/{dist → lib/cjs}/reducers/PaymentMethodReducer.d.ts +105 -106
- package/lib/cjs/reducers/PaymentMethodReducer.js +1 -0
- package/{dist → lib/cjs}/reducers/PlaceOrderReducer.d.ts +48 -50
- package/lib/cjs/reducers/PlaceOrderReducer.js +1 -0
- package/{dist → lib/cjs}/reducers/PriceReducer.d.ts +44 -45
- package/lib/cjs/reducers/PriceReducer.js +1 -0
- package/{dist → lib/cjs}/reducers/ShipmentReducer.d.ts +40 -37
- package/lib/cjs/reducers/ShipmentReducer.js +1 -0
- package/{dist → lib/cjs}/reducers/ShippingAddressReducer.d.ts +32 -31
- package/lib/cjs/reducers/ShippingAddressReducer.js +1 -0
- package/{dist → lib/cjs}/reducers/SkuListsReducer.d.ts +21 -22
- package/lib/cjs/reducers/SkuListsReducer.js +1 -0
- package/{dist → lib/cjs}/reducers/SkuOptionsReducer.d.ts +26 -26
- package/lib/cjs/reducers/SkuOptionsReducer.js +1 -0
- package/{dist → lib/cjs}/reducers/VariantReducer.d.ts +71 -71
- package/lib/cjs/reducers/VariantReducer.js +1 -0
- package/{dist → lib/cjs}/typings/errors.d.ts +42 -40
- package/lib/cjs/typings/errors.js +1 -0
- package/{dist → lib/cjs}/typings/index.d.ts +126 -126
- package/lib/cjs/typings/index.js +1 -0
- package/lib/cjs/utils/PropsType.d.ts +33 -0
- package/lib/cjs/utils/PropsType.js +1 -0
- package/{dist → lib/cjs}/utils/addressesManager.d.ts +28 -27
- package/lib/cjs/utils/addressesManager.js +1 -0
- package/{dist → lib/cjs}/utils/baseReducer.d.ts +3 -3
- package/lib/cjs/utils/baseReducer.js +1 -0
- package/{dist → lib/cjs}/utils/browserInfo.d.ts +9 -9
- package/lib/cjs/utils/browserInfo.js +1 -0
- package/{dist → lib/cjs}/utils/childrenTypes.d.ts +9 -9
- package/lib/cjs/utils/childrenTypes.js +1 -0
- package/{dist → lib/cjs}/utils/countryStateCity.d.ts +9 -9
- package/lib/cjs/utils/countryStateCity.js +1 -0
- package/{dist → lib/cjs}/utils/customMessages.d.ts +8 -8
- package/lib/cjs/utils/customMessages.js +1 -0
- package/lib/cjs/utils/customerOrderOptions.d.ts +3 -0
- package/lib/cjs/utils/customerOrderOptions.js +1 -0
- package/{dist → lib/cjs}/utils/getAmount.d.ts +9 -9
- package/lib/cjs/utils/getAmount.js +1 -0
- package/{dist → lib/cjs}/utils/getCurrentItemKey.d.ts +6 -6
- package/lib/cjs/utils/getCurrentItemKey.js +1 -0
- package/lib/cjs/utils/getErrors.d.ts +11 -0
- package/lib/cjs/utils/getErrors.js +1 -0
- package/{dist → lib/cjs}/utils/getLineItemsCount.d.ts +6 -6
- package/lib/cjs/utils/getLineItemsCount.js +1 -0
- package/{dist → lib/cjs}/utils/getLoaderComponent.d.ts +3 -3
- package/lib/cjs/utils/getLoaderComponent.js +1 -0
- package/lib/cjs/utils/getPrices.d.ts +17 -0
- package/lib/cjs/utils/getPrices.js +1 -0
- package/lib/cjs/utils/getSdk.d.ts +3 -0
- package/lib/cjs/utils/getSdk.js +1 -0
- package/lib/cjs/utils/getSkus.d.ts +3 -0
- package/lib/cjs/utils/getSkus.js +1 -0
- package/{dist → lib/cjs}/utils/isEmptyStates.d.ts +1 -1
- package/lib/cjs/utils/isEmptyStates.js +1 -0
- package/{dist → lib/cjs}/utils/isJSON.d.ts +1 -1
- package/lib/cjs/utils/isJSON.js +1 -0
- package/lib/cjs/utils/jwt.d.ts +27 -0
- package/lib/cjs/utils/jwt.js +1 -0
- package/{dist → lib/cjs}/utils/localStorage.d.ts +18 -18
- package/lib/cjs/utils/localStorage.js +1 -0
- package/lib/cjs/utils/organization.d.ts +6 -0
- package/lib/cjs/utils/organization.js +1 -0
- package/lib/cjs/utils/paypalPayment.d.ts +3 -0
- package/lib/cjs/utils/paypalPayment.js +1 -0
- package/{dist → lib/cjs}/utils/promisify.d.ts +1 -1
- package/lib/cjs/utils/promisify.js +1 -0
- package/lib/cjs/utils/shipments.d.ts +2 -0
- package/lib/cjs/utils/shipments.js +1 -0
- package/{dist → lib/cjs}/utils/validateFormFields.d.ts +20 -19
- package/lib/cjs/utils/validateFormFields.js +1 -0
- package/lib/esm/components/AddToCartButton.d.ts +20 -0
- package/lib/esm/components/AddToCartButton.js +1 -0
- package/lib/esm/components/Address.d.ts +13 -0
- package/lib/esm/components/Address.js +1 -0
- package/lib/esm/components/AddressCountrySelector.d.ts +9 -0
- package/lib/esm/components/AddressCountrySelector.js +1 -0
- package/lib/esm/components/AddressField.d.ts +15 -0
- package/lib/esm/components/AddressField.js +1 -0
- package/lib/esm/components/AddressInput.d.ts +7 -0
- package/lib/esm/components/AddressInput.js +1 -0
- package/lib/esm/components/AddressStateSelector.d.ts +11 -0
- package/lib/esm/components/AddressStateSelector.js +1 -0
- package/lib/esm/components/AddressesContainer.d.ts +7 -0
- package/lib/esm/components/AddressesContainer.js +1 -0
- package/lib/esm/components/AdyenPayment.d.ts +25 -0
- package/lib/esm/components/AdyenPayment.js +1 -0
- package/lib/esm/components/AvailabilityContainer.d.ts +7 -0
- package/lib/esm/components/AvailabilityContainer.js +1 -0
- package/lib/esm/components/AvailabilityTemplate.d.ts +11 -0
- package/lib/esm/components/AvailabilityTemplate.js +1 -0
- package/lib/esm/components/BillingAddressContainer.d.ts +6 -0
- package/lib/esm/components/BillingAddressContainer.js +1 -0
- package/lib/esm/components/BillingAddressForm.d.ts +8 -0
- package/lib/esm/components/BillingAddressForm.js +1 -0
- package/lib/esm/components/BraintreePayment.d.ts +30 -0
- package/lib/esm/components/BraintreePayment.js +1 -0
- package/lib/esm/components/CheckoutLink.d.ts +11 -0
- package/lib/esm/components/CheckoutLink.js +1 -0
- package/lib/esm/components/CommerceLayer.d.ts +8 -0
- package/lib/esm/components/CommerceLayer.js +1 -0
- package/lib/esm/components/CustomerContainer.d.ts +7 -0
- package/lib/esm/components/CustomerContainer.js +1 -0
- package/lib/esm/components/CustomerInput.d.ts +11 -0
- package/lib/esm/components/CustomerInput.js +1 -0
- package/lib/esm/components/DeliveryLeadTime.d.ts +10 -0
- package/lib/esm/components/DeliveryLeadTime.js +1 -0
- package/lib/esm/components/DiscountAmount.d.ts +4 -0
- package/lib/esm/components/DiscountAmount.js +1 -0
- package/lib/esm/components/Errors.d.ts +5 -0
- package/lib/esm/components/Errors.js +1 -0
- package/lib/esm/components/ExternalFunction.d.ts +7 -0
- package/lib/esm/components/ExternalFunction.js +1 -0
- package/lib/esm/components/GiftCard.d.ts +8 -0
- package/lib/esm/components/GiftCard.js +1 -0
- package/lib/esm/components/GiftCardAmount.d.ts +4 -0
- package/lib/esm/components/GiftCardAmount.js +1 -0
- package/lib/esm/components/GiftCardContainer.d.ts +6 -0
- package/lib/esm/components/GiftCardContainer.js +1 -0
- package/lib/esm/components/GiftCardCurrencySelector.d.ts +7 -0
- package/lib/esm/components/GiftCardCurrencySelector.js +1 -0
- package/lib/esm/components/GiftCardInput.d.ts +7 -0
- package/lib/esm/components/GiftCardInput.js +1 -0
- package/lib/esm/components/GiftCardOrCouponCode.d.ts +13 -0
- package/lib/esm/components/GiftCardOrCouponCode.js +1 -0
- package/lib/esm/components/GiftCardOrCouponForm.d.ts +10 -0
- package/lib/esm/components/GiftCardOrCouponForm.js +1 -0
- package/lib/esm/components/GiftCardOrCouponInput.d.ts +8 -0
- package/lib/esm/components/GiftCardOrCouponInput.js +1 -0
- package/lib/esm/components/GiftCardOrCouponRemoveButton.d.ts +16 -0
- package/lib/esm/components/GiftCardOrCouponRemoveButton.js +1 -0
- package/lib/esm/components/GiftCardOrCouponSubmit.d.ts +9 -0
- package/lib/esm/components/GiftCardOrCouponSubmit.js +1 -0
- package/lib/esm/components/GiftCardRecipient.d.ts +0 -0
- package/lib/esm/components/GiftCardRecipient.js +1 -0
- package/lib/esm/components/GiftCardRecipientInput.d.ts +0 -0
- package/lib/esm/components/GiftCardRecipientInput.js +1 -0
- package/lib/esm/components/ItemContainer.d.ts +11 -0
- package/lib/esm/components/ItemContainer.js +1 -0
- package/lib/esm/components/LineItem.d.ts +8 -0
- package/lib/esm/components/LineItem.js +1 -0
- package/lib/esm/components/LineItemAmount.d.ts +7 -0
- package/lib/esm/components/LineItemAmount.js +1 -0
- package/lib/esm/components/LineItemCode.d.ts +8 -0
- package/lib/esm/components/LineItemCode.js +1 -0
- package/lib/esm/components/LineItemImage.d.ts +10 -0
- package/lib/esm/components/LineItemImage.js +1 -0
- package/lib/esm/components/LineItemName.d.ts +9 -0
- package/lib/esm/components/LineItemName.js +1 -0
- package/lib/esm/components/LineItemOption.d.ts +19 -0
- package/lib/esm/components/LineItemOption.js +1 -0
- package/lib/esm/components/LineItemOptions.d.ts +14 -0
- package/lib/esm/components/LineItemOptions.js +1 -0
- package/lib/esm/components/LineItemQuantity.d.ts +14 -0
- package/lib/esm/components/LineItemQuantity.js +1 -0
- package/lib/esm/components/LineItemRemoveLink.d.ts +12 -0
- package/lib/esm/components/LineItemRemoveLink.js +1 -0
- package/lib/esm/components/LineItemsContainer.d.ts +8 -0
- package/lib/esm/components/LineItemsContainer.js +1 -0
- package/lib/esm/components/LineItemsCount.d.ts +10 -0
- package/lib/esm/components/LineItemsCount.js +1 -0
- package/lib/esm/components/MetadataInput.d.ts +5 -0
- package/lib/esm/components/MetadataInput.js +1 -0
- package/lib/esm/components/OrderContainer.d.ts +11 -0
- package/lib/esm/components/OrderContainer.js +1 -0
- package/lib/esm/components/OrderNumber.d.ts +5 -0
- package/lib/esm/components/OrderNumber.js +1 -0
- package/lib/esm/components/OrderStorage.d.ts +8 -0
- package/lib/esm/components/OrderStorage.js +1 -0
- package/lib/esm/components/PaymentGateway.d.ts +16 -0
- package/lib/esm/components/PaymentGateway.js +1 -0
- package/lib/esm/components/PaymentMethod.d.ts +16 -0
- package/lib/esm/components/PaymentMethod.js +1 -0
- package/lib/esm/components/PaymentMethodAmount.d.ts +4 -0
- package/lib/esm/components/PaymentMethodAmount.js +1 -0
- package/lib/esm/components/PaymentMethodName.d.ts +9 -0
- package/lib/esm/components/PaymentMethodName.js +1 -0
- package/lib/esm/components/PaymentMethodPrice.d.ts +9 -0
- package/lib/esm/components/PaymentMethodPrice.js +1 -0
- package/lib/esm/components/PaymentMethodRadioButton.d.ts +11 -0
- package/lib/esm/components/PaymentMethodRadioButton.js +1 -0
- package/lib/esm/components/PaymentMethodsContainer.d.ts +8 -0
- package/lib/esm/components/PaymentMethodsContainer.js +1 -0
- package/lib/esm/components/PaymentSource.d.ts +19 -0
- package/lib/esm/components/PaymentSource.js +1 -0
- package/lib/esm/components/PaymentSourceBrandIcon.d.ts +15 -0
- package/lib/esm/components/PaymentSourceBrandIcon.js +1 -0
- package/lib/esm/components/PaymentSourceBrandName.d.ts +12 -0
- package/lib/esm/components/PaymentSourceBrandName.js +1 -0
- package/lib/esm/components/PaymentSourceDetail.d.ts +12 -0
- package/lib/esm/components/PaymentSourceDetail.js +1 -0
- package/lib/esm/components/PaymentSourceEditButton.d.ts +9 -0
- package/lib/esm/components/PaymentSourceEditButton.js +1 -0
- package/lib/esm/components/PaypalPayment.d.ts +12 -0
- package/lib/esm/components/PaypalPayment.js +1 -0
- package/lib/esm/components/PlaceOrderButton.d.ts +12 -0
- package/lib/esm/components/PlaceOrderButton.js +1 -0
- package/lib/esm/components/PlaceOrderContainer.d.ts +8 -0
- package/lib/esm/components/PlaceOrderContainer.js +1 -0
- package/lib/esm/components/Price.d.ts +14 -0
- package/lib/esm/components/Price.js +1 -0
- package/lib/esm/components/PricesContainer.d.ts +11 -0
- package/lib/esm/components/PricesContainer.js +1 -0
- package/lib/esm/components/PrivacyAndTermsCheckbox.d.ts +4 -0
- package/lib/esm/components/PrivacyAndTermsCheckbox.js +1 -0
- package/lib/esm/components/QuantitySelector.d.ts +17 -0
- package/lib/esm/components/QuantitySelector.js +1 -0
- package/lib/esm/components/SaveAddressesButton.d.ts +10 -0
- package/lib/esm/components/SaveAddressesButton.js +1 -0
- package/lib/esm/components/SaveCustomerButton.d.ts +13 -0
- package/lib/esm/components/SaveCustomerButton.js +1 -0
- package/lib/esm/components/Shipment.d.ts +8 -0
- package/lib/esm/components/Shipment.js +1 -0
- package/lib/esm/components/ShipmentField.d.ts +12 -0
- package/lib/esm/components/ShipmentField.js +1 -0
- package/lib/esm/components/ShipmentsContainer.d.ts +6 -0
- package/lib/esm/components/ShipmentsContainer.js +1 -0
- package/lib/esm/components/ShippingAddressContainer.d.ts +6 -0
- package/lib/esm/components/ShippingAddressContainer.js +1 -0
- package/lib/esm/components/ShippingAddressForm.d.ts +8 -0
- package/lib/esm/components/ShippingAddressForm.js +1 -0
- package/lib/esm/components/ShippingAmount.d.ts +4 -0
- package/lib/esm/components/ShippingAmount.js +1 -0
- package/lib/esm/components/ShippingMethod.d.ts +8 -0
- package/lib/esm/components/ShippingMethod.js +1 -0
- package/lib/esm/components/ShippingMethodName.d.ts +11 -0
- package/lib/esm/components/ShippingMethodName.js +1 -0
- package/lib/esm/components/ShippingMethodPrice.d.ts +13 -0
- package/lib/esm/components/ShippingMethodPrice.js +1 -0
- package/lib/esm/components/ShippingMethodRadioButton.d.ts +9 -0
- package/lib/esm/components/ShippingMethodRadioButton.js +1 -0
- package/lib/esm/components/SkuList.d.ts +7 -0
- package/lib/esm/components/SkuList.js +1 -0
- package/lib/esm/components/SkuListsContainer.d.ts +6 -0
- package/lib/esm/components/SkuListsContainer.js +1 -0
- package/lib/esm/components/SkuOption.d.ts +7 -0
- package/lib/esm/components/SkuOption.js +1 -0
- package/lib/esm/components/SkuOptionInput.d.ts +5 -0
- package/lib/esm/components/SkuOptionInput.js +1 -0
- package/lib/esm/components/SkuOptionsContainer.d.ts +7 -0
- package/lib/esm/components/SkuOptionsContainer.js +1 -0
- package/lib/esm/components/StockTransfer.d.ts +6 -0
- package/lib/esm/components/StockTransfer.js +1 -0
- package/lib/esm/components/StockTransferField.d.ts +9 -0
- package/lib/esm/components/StockTransferField.js +1 -0
- package/lib/esm/components/StripePayment.d.ts +18 -0
- package/lib/esm/components/StripePayment.js +1 -0
- package/lib/esm/components/SubTotalAmount.d.ts +4 -0
- package/lib/esm/components/SubTotalAmount.js +1 -0
- package/lib/esm/components/SubmitButton.d.ts +9 -0
- package/lib/esm/components/SubmitButton.js +1 -0
- package/lib/esm/components/TaxesAmount.d.ts +4 -0
- package/lib/esm/components/TaxesAmount.js +1 -0
- package/lib/esm/components/TotalAmount.d.ts +4 -0
- package/lib/esm/components/TotalAmount.js +1 -0
- package/lib/esm/components/VariantSelector.d.ts +27 -0
- package/lib/esm/components/VariantSelector.js +1 -0
- package/lib/esm/components/VariantsContainer.d.ts +8 -0
- package/lib/esm/components/VariantsContainer.js +1 -0
- package/lib/esm/components/WireTransferPayment.d.ts +10 -0
- package/lib/esm/components/WireTransferPayment.js +1 -0
- package/lib/esm/components/gateways/AdyenGateway.d.ts +5 -0
- package/lib/esm/components/gateways/AdyenGateway.js +1 -0
- package/lib/esm/components/gateways/BraintreeGateway.d.ts +5 -0
- package/lib/esm/components/gateways/BraintreeGateway.js +1 -0
- package/lib/esm/components/gateways/PaypalGateway.d.ts +5 -0
- package/lib/esm/components/gateways/PaypalGateway.js +1 -0
- package/lib/esm/components/gateways/StripeGateway.d.ts +5 -0
- package/lib/esm/components/gateways/StripeGateway.js +1 -0
- package/lib/esm/components/gateways/WireTransferGateway.d.ts +5 -0
- package/lib/esm/components/gateways/WireTransferGateway.js +1 -0
- package/lib/esm/components/utils/AddressCardsTemplate.d.ts +27 -0
- package/lib/esm/components/utils/AddressCardsTemplate.js +1 -0
- package/lib/esm/components/utils/BaseField.d.ts +8 -0
- package/lib/esm/components/utils/BaseField.js +1 -0
- package/lib/esm/components/utils/BaseInput.d.ts +5 -0
- package/lib/esm/components/utils/BaseInput.js +1 -0
- package/lib/esm/components/utils/BaseOrderPrice.d.ts +6 -0
- package/lib/esm/components/utils/BaseOrderPrice.js +1 -0
- package/lib/esm/components/utils/BaseSelect.d.ts +5 -0
- package/lib/esm/components/utils/BaseSelect.js +1 -0
- package/lib/esm/components/utils/Parent.d.ts +8 -0
- package/lib/esm/components/utils/Parent.js +1 -0
- package/lib/esm/components/utils/PaymentCardsTemplate.d.ts +23 -0
- package/lib/esm/components/utils/PaymentCardsTemplate.js +1 -0
- package/lib/esm/components/utils/PriceTemplate.d.ts +8 -0
- package/lib/esm/components/utils/PriceTemplate.js +1 -0
- package/lib/esm/components/utils/VariantTemplate.d.ts +34 -0
- package/lib/esm/components/utils/VariantTemplate.js +1 -0
- package/lib/esm/components/utils/getAllErrors.d.ts +17 -0
- package/lib/esm/components/utils/getAllErrors.js +1 -0
- package/lib/esm/config/components.d.ts +867 -0
- package/lib/esm/config/components.js +1 -0
- package/lib/esm/config/currency.json +1 -0
- package/lib/esm/context/AddressChildrenContext.d.ts +7 -0
- package/lib/esm/context/AddressChildrenContext.js +1 -0
- package/lib/esm/context/AddressContext.d.ts +17 -0
- package/lib/esm/context/AddressContext.js +1 -0
- package/lib/esm/context/AvailabilityContext.d.ts +3 -0
- package/lib/esm/context/AvailabilityContext.js +1 -0
- package/lib/esm/context/BillingAddressContext.d.ts +12 -0
- package/lib/esm/context/BillingAddressContext.js +1 -0
- package/lib/esm/context/BillingAddressFormContext.d.ts +18 -0
- package/lib/esm/context/BillingAddressFormContext.js +1 -0
- package/lib/esm/context/CommerceLayerContext.d.ts +7 -0
- package/lib/esm/context/CommerceLayerContext.js +1 -0
- package/lib/esm/context/CouponAndGiftCardFormContext.d.ts +7 -0
- package/lib/esm/context/CouponAndGiftCardFormContext.js +1 -0
- package/lib/esm/context/CustomerContext.d.ts +16 -0
- package/lib/esm/context/CustomerContext.js +1 -0
- package/lib/esm/context/ExternalFunctionContext.d.ts +12 -0
- package/lib/esm/context/ExternalFunctionContext.js +1 -0
- package/lib/esm/context/GiftCardContext.d.ts +11 -0
- package/lib/esm/context/GiftCardContext.js +1 -0
- package/lib/esm/context/ItemContext.d.ts +13 -0
- package/lib/esm/context/ItemContext.js +1 -0
- package/lib/esm/context/LineItemChildrenContext.d.ts +9 -0
- package/lib/esm/context/LineItemChildrenContext.js +1 -0
- package/lib/esm/context/LineItemContext.d.ts +8 -0
- package/lib/esm/context/LineItemContext.js +1 -0
- package/lib/esm/context/LineItemOptionChildrenContext.d.ts +8 -0
- package/lib/esm/context/LineItemOptionChildrenContext.js +1 -0
- package/lib/esm/context/OrderContext.d.ts +26 -0
- package/lib/esm/context/OrderContext.js +1 -0
- package/lib/esm/context/OrderStorageContext.d.ts +11 -0
- package/lib/esm/context/OrderStorageContext.js +1 -0
- package/lib/esm/context/PaymentMethodChildrenContext.d.ts +10 -0
- package/lib/esm/context/PaymentMethodChildrenContext.js +1 -0
- package/lib/esm/context/PaymentMethodContext.d.ts +23 -0
- package/lib/esm/context/PaymentMethodContext.js +1 -0
- package/lib/esm/context/PaymentSourceContext.d.ts +14 -0
- package/lib/esm/context/PaymentSourceContext.js +1 -0
- package/lib/esm/context/PlaceOrderContext.d.ts +16 -0
- package/lib/esm/context/PlaceOrderContext.js +1 -0
- package/lib/esm/context/PricesContext.d.ts +7 -0
- package/lib/esm/context/PricesContext.js +1 -0
- package/lib/esm/context/ShipmentChildrenContext.d.ts +13 -0
- package/lib/esm/context/ShipmentChildrenContext.js +1 -0
- package/lib/esm/context/ShipmentContext.d.ts +12 -0
- package/lib/esm/context/ShipmentContext.js +1 -0
- package/lib/esm/context/ShippingAddressContext.d.ts +10 -0
- package/lib/esm/context/ShippingAddressContext.js +1 -0
- package/lib/esm/context/ShippingAddressFormContext.d.ts +4 -0
- package/lib/esm/context/ShippingAddressFormContext.js +1 -0
- package/lib/esm/context/ShippingMethodChildrenContext.d.ts +10 -0
- package/lib/esm/context/ShippingMethodChildrenContext.js +1 -0
- package/lib/esm/context/SkuListsContext.d.ts +6 -0
- package/lib/esm/context/SkuListsContext.js +1 -0
- package/lib/esm/context/SkuOptionChildrenContext.d.ts +8 -0
- package/lib/esm/context/SkuOptionChildrenContext.js +1 -0
- package/lib/esm/context/SkuOptionsContext.d.ts +3 -0
- package/lib/esm/context/SkuOptionsContext.js +1 -0
- package/lib/esm/context/StockTransferChildrenContext.d.ts +7 -0
- package/lib/esm/context/StockTransferChildrenContext.js +1 -0
- package/lib/esm/context/VariantsContext.d.ts +3 -0
- package/lib/esm/context/VariantsContext.js +1 -0
- package/lib/esm/index.d.ts +90 -0
- package/lib/esm/index.js +1 -0
- package/lib/esm/reducers/AddressReducer.d.ts +58 -0
- package/lib/esm/reducers/AddressReducer.js +1 -0
- package/lib/esm/reducers/AvailabilityReducer.d.ts +53 -0
- package/lib/esm/reducers/AvailabilityReducer.js +1 -0
- package/lib/esm/reducers/BillingAddressReducer.d.ts +31 -0
- package/lib/esm/reducers/BillingAddressReducer.js +1 -0
- package/lib/esm/reducers/CustomerReducer.d.ts +50 -0
- package/lib/esm/reducers/CustomerReducer.js +1 -0
- package/lib/esm/reducers/GiftCardReducer.d.ts +76 -0
- package/lib/esm/reducers/GiftCardReducer.js +1 -0
- package/lib/esm/reducers/ItemReducer.d.ts +69 -0
- package/lib/esm/reducers/ItemReducer.js +1 -0
- package/lib/esm/reducers/LineItemReducer.d.ts +52 -0
- package/lib/esm/reducers/LineItemReducer.js +1 -0
- package/lib/esm/reducers/OrderReducer.d.ts +127 -0
- package/lib/esm/reducers/OrderReducer.js +1 -0
- package/lib/esm/reducers/PaymentMethodReducer.d.ts +105 -0
- package/lib/esm/reducers/PaymentMethodReducer.js +1 -0
- package/lib/esm/reducers/PlaceOrderReducer.d.ts +48 -0
- package/lib/esm/reducers/PlaceOrderReducer.js +1 -0
- package/lib/esm/reducers/PriceReducer.d.ts +44 -0
- package/lib/esm/reducers/PriceReducer.js +1 -0
- package/lib/esm/reducers/ShipmentReducer.d.ts +40 -0
- package/lib/esm/reducers/ShipmentReducer.js +1 -0
- package/lib/esm/reducers/ShippingAddressReducer.d.ts +32 -0
- package/lib/esm/reducers/ShippingAddressReducer.js +1 -0
- package/lib/esm/reducers/SkuListsReducer.d.ts +21 -0
- package/lib/esm/reducers/SkuListsReducer.js +1 -0
- package/lib/esm/reducers/SkuOptionsReducer.d.ts +26 -0
- package/lib/esm/reducers/SkuOptionsReducer.js +1 -0
- package/lib/esm/reducers/VariantReducer.d.ts +71 -0
- package/lib/esm/reducers/VariantReducer.js +1 -0
- package/lib/esm/typings/errors.d.ts +42 -0
- package/lib/esm/typings/errors.js +1 -0
- package/lib/esm/typings/index.d.ts +126 -0
- package/lib/esm/typings/index.js +1 -0
- package/lib/esm/utils/PropsType.d.ts +33 -0
- package/lib/esm/utils/PropsType.js +1 -0
- package/lib/esm/utils/addressesManager.d.ts +28 -0
- package/lib/esm/utils/addressesManager.js +1 -0
- package/lib/esm/utils/baseReducer.d.ts +3 -0
- package/lib/esm/utils/baseReducer.js +1 -0
- package/lib/esm/utils/browserInfo.d.ts +9 -0
- package/lib/esm/utils/browserInfo.js +1 -0
- package/lib/esm/utils/childrenTypes.d.ts +9 -0
- package/lib/esm/utils/childrenTypes.js +1 -0
- package/lib/esm/utils/countryStateCity.d.ts +9 -0
- package/lib/esm/utils/countryStateCity.js +1 -0
- package/lib/esm/utils/customMessages.d.ts +8 -0
- package/lib/esm/utils/customMessages.js +1 -0
- package/lib/esm/utils/customerOrderOptions.d.ts +3 -0
- package/lib/esm/utils/customerOrderOptions.js +1 -0
- package/lib/esm/utils/getAmount.d.ts +9 -0
- package/lib/esm/utils/getAmount.js +1 -0
- package/lib/esm/utils/getCurrentItemKey.d.ts +6 -0
- package/lib/esm/utils/getCurrentItemKey.js +1 -0
- package/lib/esm/utils/getErrors.d.ts +11 -0
- package/lib/esm/utils/getErrors.js +1 -0
- package/lib/esm/utils/getLineItemsCount.d.ts +6 -0
- package/lib/esm/utils/getLineItemsCount.js +1 -0
- package/lib/esm/utils/getLoaderComponent.d.ts +3 -0
- package/lib/esm/utils/getLoaderComponent.js +1 -0
- package/lib/esm/utils/getPrices.d.ts +17 -0
- package/lib/esm/utils/getPrices.js +1 -0
- package/lib/esm/utils/getSdk.d.ts +3 -0
- package/lib/esm/utils/getSdk.js +1 -0
- package/lib/esm/utils/getSkus.d.ts +3 -0
- package/lib/esm/utils/getSkus.js +1 -0
- package/lib/esm/utils/isEmptyStates.d.ts +1 -0
- package/lib/esm/utils/isEmptyStates.js +1 -0
- package/lib/esm/utils/isJSON.d.ts +1 -0
- package/lib/esm/utils/isJSON.js +1 -0
- package/lib/esm/utils/jwt.d.ts +27 -0
- package/lib/esm/utils/jwt.js +1 -0
- package/lib/esm/utils/localStorage.d.ts +18 -0
- package/lib/esm/utils/localStorage.js +1 -0
- package/lib/esm/utils/organization.d.ts +6 -0
- package/lib/esm/utils/organization.js +1 -0
- package/lib/esm/utils/paypalPayment.d.ts +3 -0
- package/lib/esm/utils/paypalPayment.js +1 -0
- package/lib/esm/utils/promisify.d.ts +1 -0
- package/lib/esm/utils/promisify.js +1 -0
- package/lib/esm/utils/shipments.d.ts +2 -0
- package/lib/esm/utils/shipments.js +1 -0
- package/lib/esm/utils/validateFormFields.d.ts +20 -0
- package/lib/esm/utils/validateFormFields.js +1 -0
- package/lib/tsconfig.prod.esm.tsbuildinfo +1 -0
- package/lib/tsconfig.prod.tsbuildinfo +1 -0
- package/package.json +71 -52
- package/dist/components/utils/BaseInput.d.ts +0 -5
- package/dist/context/LineItemChildrenContext.d.ts +0 -7
- package/dist/context/OrderContext.d.ts +0 -4
- package/dist/context/ShipmentChildrenContext.d.ts +0 -13
- package/dist/context/ShippingMethodChildrenContext.d.ts +0 -9
- package/dist/context/SkuListsContext.d.ts +0 -3
- package/dist/index.d.ts +0 -89
- package/dist/index.js +0 -8
- package/dist/react-components.cjs.development.js +0 -12869
- package/dist/react-components.cjs.development.js.map +0 -1
- package/dist/react-components.cjs.production.min.js +0 -2
- package/dist/react-components.cjs.production.min.js.map +0 -1
- package/dist/react-components.esm.js +0 -12775
- package/dist/react-components.esm.js.map +0 -1
- package/dist/reducers/AvailabilityReducer.d.ts +0 -40
- package/dist/reducers/OrderReducer.d.ts +0 -131
- package/dist/utils/PropsType.d.ts +0 -8
- package/dist/utils/customerOrderOptions.d.ts +0 -4
- package/dist/utils/dynamicNaming.d.ts +0 -5
- package/dist/utils/getErrorsByCollection.d.ts +0 -11
- package/dist/utils/getPrices.d.ts +0 -18
- package/dist/utils/getSkus.d.ts +0 -3
- package/dist/utils/paypalPayment.d.ts +0 -3
- package/dist/utils/shipments.d.ts +0 -5
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { FunctionComponent, ReactNode } from 'react';
|
|
2
|
+
import { FunctionChildren } from '../typings/index';
|
|
3
|
+
declare type SubmitButtonChildrenProps = FunctionChildren<Omit<SubmitButtonProps, 'children'>>;
|
|
4
|
+
declare type SubmitButtonProps = {
|
|
5
|
+
children?: SubmitButtonChildrenProps;
|
|
6
|
+
label?: string | ReactNode;
|
|
7
|
+
} & JSX.IntrinsicElements['button'];
|
|
8
|
+
declare const SubmitButton: FunctionComponent<SubmitButtonProps>;
|
|
9
|
+
export default SubmitButton;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{__rest}from"tslib";import{jsx as _jsx}from"react/jsx-runtime";import Parent from"./utils/Parent";import components from"../config/components";import isFunction from"lodash/isFunction";const propTypes=components.SubmitButton.propTypes;const defaultProps=components.SubmitButton.defaultProps;const displayName=components.SubmitButton.displayName;const SubmitButton=t=>{const{children:o,label:s="Submit"}=t,n=__rest(t,["children","label"]);const e=Object.assign(Object.assign({},n),{label:s});return o?_jsx(Parent,Object.assign({},e,{children:o}),void 0):_jsx("button",Object.assign({type:"submit"},n,{children:isFunction(s)?s():s}),void 0)};SubmitButton.propTypes=propTypes;SubmitButton.defaultProps=defaultProps;SubmitButton.displayName=displayName;export default SubmitButton;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as _jsx}from"react/jsx-runtime";import BaseOrderPrice from"./utils/BaseOrderPrice";import components from"../config/components";const propTypes=components.TaxesAmount.propTypes;const defaultProps=components.TaxesAmount.defaultProps;const displayName=components.TaxesAmount.displayName;const TaxesAmount=e=>_jsx(BaseOrderPrice,Object.assign({base:"amount",type:"total_tax"},e),void 0);TaxesAmount.propTypes=propTypes;TaxesAmount.defaultProps=defaultProps;TaxesAmount.displayName=displayName;export default TaxesAmount;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as _jsx}from"react/jsx-runtime";import BaseOrderPrice from"./utils/BaseOrderPrice";import components from"../config/components";const propTypes=components.TotalAmount.propTypes;const defaultProps=components.TotalAmount.defaultProps;const displayName=components.TotalAmount.displayName;const TotalAmount=o=>_jsx(BaseOrderPrice,Object.assign({base:"total_amount",type:"with_taxes"},o),void 0);TotalAmount.propTypes=propTypes;TotalAmount.defaultProps=defaultProps;TotalAmount.displayName=displayName;export default TotalAmount;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { FunctionComponent, ReactNode } from 'react';
|
|
2
|
+
import { BaseSelectorType } from '../typings/index';
|
|
3
|
+
import { FunctionChildren } from '../typings/index';
|
|
4
|
+
import { VariantsObject, SetSkuCode } from '../reducers/VariantReducer';
|
|
5
|
+
export interface VariantOptions {
|
|
6
|
+
label: string;
|
|
7
|
+
code: string;
|
|
8
|
+
lineItem?: {
|
|
9
|
+
name: string;
|
|
10
|
+
imageUrl?: string | null;
|
|
11
|
+
} | null;
|
|
12
|
+
}
|
|
13
|
+
declare type VariantSelectorChildrenProps = FunctionChildren<Omit<VariantSelectorProps, 'children'> & {
|
|
14
|
+
variants: VariantsObject;
|
|
15
|
+
handleSelect: SetSkuCode;
|
|
16
|
+
loading: boolean;
|
|
17
|
+
}>;
|
|
18
|
+
declare type VariantSelectorProps = {
|
|
19
|
+
children?: VariantSelectorChildrenProps;
|
|
20
|
+
options: VariantOptions[];
|
|
21
|
+
type?: BaseSelectorType;
|
|
22
|
+
loader?: ReactNode;
|
|
23
|
+
placeholder?: string;
|
|
24
|
+
skuCode?: string;
|
|
25
|
+
} & JSX.IntrinsicElements['input'] & JSX.IntrinsicElements['select'];
|
|
26
|
+
declare const VariantSelector: FunctionComponent<VariantSelectorProps>;
|
|
27
|
+
export default VariantSelector;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{__rest}from"tslib";import{jsx as _jsx}from"react/jsx-runtime";import{Fragment,useContext,useEffect}from"react";import VariantTemplate from"./utils/VariantTemplate";import Parent from"./utils/Parent";import VariantsContext from"../context/VariantsContext";import components from"../config/components";const propTypes=components.VariantSelector.propTypes;const defaultProps=components.VariantSelector.defaultProps;const displayName=components.VariantSelector.displayName;const VariantSelector=e=>{const{children:t,type:o,placeholder:a,skuCode:n,name:r,options:s}=e,i=__rest(e,["children","type","placeholder","skuCode","name","options"]);const{setSkuCode:p,skuCode:c,loading:l,variants:d,setSkuCodes:m}=useContext(VariantsContext);useEffect((()=>{m&&m(s);return()=>{m&&m([])}}),[s]);const u=c||n||"";const f=()=>l?_jsx(Fragment,{children:e.loader||"Loading..."},void 0):_jsx(VariantTemplate,Object.assign({variants:d,type:o,placeholder:a,skuCode:u,options:s,handleChange:p,name:r},i),void 0);const x=Object.assign({variants:d,loading:!!l,handleSelect:p,skuCode:u},e);return t?_jsx(Parent,Object.assign({},x,{children:t}),void 0):_jsx(Fragment,{children:_jsx(f,{},void 0)},void 0)};VariantSelector.propTypes=propTypes;VariantSelector.defaultProps=defaultProps;VariantSelector.displayName=displayName;export default VariantSelector;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { FunctionComponent, ReactNode } from 'react';
|
|
2
|
+
declare type VariantsContainerProps = {
|
|
3
|
+
children: ReactNode;
|
|
4
|
+
filters?: Record<string, any>;
|
|
5
|
+
skuCode?: string;
|
|
6
|
+
};
|
|
7
|
+
declare const VariantsContainer: FunctionComponent<VariantsContainerProps>;
|
|
8
|
+
export default VariantsContainer;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as _jsx}from"react/jsx-runtime";import{useEffect,useReducer,useContext}from"react";import variantReducer,{variantInitialState,unsetVariantState,setSkuCode,getVariants}from"../reducers/VariantReducer";import CommerceLayerContext from"../context/CommerceLayerContext";import VariantsContext from"../context/VariantsContext";import{setVariantSkuCodes}from"../reducers/VariantReducer";import{isEmpty,isEqual}from"lodash";import getCurrentItemKey from"../utils/getCurrentItemKey";import ItemContext from"../context/ItemContext";import components from"../config/components";const propTypes=components.VariantsContainer.propTypes;const defaultProps=components.VariantsContainer.defaultProps;const displayName=components.VariantsContainer.displayName;const VariantsContainer=t=>{const{children:e,skuCode:s="",filters:n={}}=t;const a=useContext(CommerceLayerContext);const{setItem:o,setItems:r,items:i,item:m,setCustomLineItems:c,skuCode:u}=useContext(ItemContext);const[p,d]=useReducer(variantReducer,variantInitialState);const C=getCurrentItemKey(m)||s||p.skuCode||u||"";useEffect((()=>{if(!isEmpty(i)&&!isEmpty(p.variants)){if(!isEqual(i,p.variants)){const t=Object.assign(Object.assign({},i),p.variants);r&&r(t)}}if(p.skuCodes.length>=1&&a.accessToken){d({type:"setLoading",payload:{loading:true}});getVariants({config:a,state:p,dispatch:d,setItem:o,skuCode:C,filters:n})}return()=>unsetVariantState(d)}),[a]);const f=Object.assign(Object.assign({},p),{skuCode:C,setSkuCode:(t,e,s={})=>{if(!isEmpty(s)){c&&c({[t]:s})}setSkuCode({code:t,id:e,config:a,setItem:o,dispatch:d})},setSkuCodes:t=>setVariantSkuCodes({skuCodes:t,dispatch:d,setCustomLineItems:c})});return _jsx(VariantsContext.Provider,Object.assign({value:f},{children:e}),void 0)};VariantsContainer.propTypes=propTypes;VariantsContainer.defaultProps=defaultProps;VariantsContainer.displayName=displayName;export default VariantsContainer;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { FunctionComponent, ReactNode } from 'react';
|
|
2
|
+
export declare type WireTransferConfig = {
|
|
3
|
+
infoMessage?: {
|
|
4
|
+
text?: string | ReactNode;
|
|
5
|
+
className?: string;
|
|
6
|
+
};
|
|
7
|
+
};
|
|
8
|
+
declare type Props = WireTransferConfig & JSX.IntrinsicElements['div'];
|
|
9
|
+
declare const WireTransferPayment: FunctionComponent<Props>;
|
|
10
|
+
export default WireTransferPayment;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{__rest}from"tslib";import{jsx as _jsx}from"react/jsx-runtime";import PaymentMethodContext from"../context/PaymentMethodContext";import isFunction from"lodash/isFunction";import{useContext,useEffect,useRef}from"react";const defaultMessage="after placing the order, you will need to manually complete the payment with your bank";const WireTransferPayment=e=>{var{infoMessage:t}=e,n=__rest(e,["infoMessage"]);const r=useRef(null);const{setPaymentSource:s,paymentSource:o,currentPaymentMethodType:a,setPaymentRef:i}=useContext(PaymentMethodContext);useEffect((()=>{if(r.current&&o&&a){r.current.onsubmit=()=>u();i({ref:r})}return()=>{i({ref:{current:null}})}}),[r,o,a]);const u=async()=>{if(o&&a){try{await s({paymentSourceId:o.id,paymentResource:a,attributes:{metadata:{card:{id:o.id,brand:"wire-transfer",last4:""}}}});return true}catch(e){return false}}return false};return _jsx("form",Object.assign({ref:r},{children:_jsx("div",Object.assign({},n,{children:_jsx("span",Object.assign({className:t===null||t===void 0?void 0:t.className},{children:isFunction(t===null||t===void 0?void 0:t.text)?t===null||t===void 0?void 0:t.text():(t===null||t===void 0?void 0:t.text)||defaultMessage}),void 0)}),void 0)}),void 0)};export default WireTransferPayment;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{__rest}from"tslib";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";import CommerceLayerContext from"../../context/CommerceLayerContext";import CustomerContext from"../../context/CustomerContext";import OrderContext from"../../context/OrderContext";import PaymentMethodChildrenContext from"../../context/PaymentMethodChildrenContext";import PaymentMethodContext from"../../context/PaymentMethodContext";import PaymentSourceContext from"../../context/PaymentSourceContext";import{getPaymentConfig}from"../../reducers/PaymentMethodReducer";import isEmpty from"lodash/isEmpty";import{Fragment,useContext}from"react";import AdyenPayment from"../AdyenPayment";import PaymentCardsTemplate from"../utils/PaymentCardsTemplate";import jwt from"../../utils/jwt";export default function AdyenGateway(e){var t;const{readonly:o,showCard:n,handleEditClick:r,children:m,templateCustomerCards:s,show:a,loading:i,onClickCustomerCards:d,loaderComponent:l,templateCustomerSaveToWallet:c}=e,C=__rest(e,["readonly","showCard","handleEditClick","children","templateCustomerCards","show","loading","onClickCustomerCards","loaderComponent","templateCustomerSaveToWallet"]);const{order:y}=useContext(OrderContext);const{accessToken:u}=useContext(CommerceLayerContext);const{payment:p}=useContext(PaymentMethodChildrenContext);const{payments:x,isGuest:v}=useContext(CustomerContext);const{currentPaymentMethodId:h,config:f,paymentSource:P}=useContext(PaymentMethodContext);const _="adyen_payments";const g=y===null||y===void 0?void 0:y.language_code;if(!o&&(p===null||p===void 0?void 0:p.id)!==h)return null;const j=P===null||P===void 0?void 0:P.public_key;const w=jwt(u).test?"test":"live";const E=f?getPaymentConfig(_,f):{};console.log(`payments`,x);const M=!isEmpty(x)&&x?x.filter((e=>{var t;return((t=e.payment_source)===null||t===void 0?void 0:t.type)==="adyen_payments"})):[];if(o||n){const e=(t=P===null||P===void 0?void 0:P.payment_request_data)===null||t===void 0?void 0:t.payment_method;const s=Object.assign(Object.assign({},e),{showCard:n,handleEditClick:r,readonly:o});return isEmpty(e)?null:_jsx(PaymentSourceContext.Provider,Object.assign({value:s},{children:m}),void 0)}if(!v&&s){return j&&!i&&(P===null||P===void 0?void 0:P.payment_methods)?_jsxs(Fragment,{children:[isEmpty(M)?null:_jsx("div",Object.assign({className:C.className},{children:_jsx(PaymentCardsTemplate,Object.assign({},{paymentResource:_,customerPayments:M},{children:s}),void 0)}),void 0),_jsx(AdyenPayment,{templateCustomerSaveToWallet:c,clientKey:j,locale:g,environment:w,config:E},void 0)]},void 0):l}return j&&!i&&(P===null||P===void 0?void 0:P.payment_methods)?_jsx(AdyenPayment,{clientKey:j,locale:g,config:E},void 0):l}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{__rest}from"tslib";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";import BraintreePayment from"../BraintreePayment";import CustomerContext from"../../context/CustomerContext";import OrderContext from"../../context/OrderContext";import PaymentMethodChildrenContext from"../../context/PaymentMethodChildrenContext";import PaymentMethodContext from"../../context/PaymentMethodContext";import PaymentSourceContext from"../../context/PaymentSourceContext";import{getPaymentConfig}from"../../reducers/PaymentMethodReducer";import isEmpty from"lodash/isEmpty";import{Fragment,useContext}from"react";import PaymentCardsTemplate from"../utils/PaymentCardsTemplate";export default function BraintreeGateway(t){var e;const{readonly:o,showCard:n,handleEditClick:r,children:a,templateCustomerCards:s,show:i,loading:m,onClickCustomerCards:d,loaderComponent:l,templateCustomerSaveToWallet:c}=t,C=__rest(t,["readonly","showCard","handleEditClick","children","templateCustomerCards","show","loading","onClickCustomerCards","loaderComponent","templateCustomerSaveToWallet"]);const{order:u}=useContext(OrderContext);const{payment:y}=useContext(PaymentMethodChildrenContext);const{payments:p,isGuest:x}=useContext(CustomerContext);const{currentPaymentMethodId:h,config:v,paymentSource:f}=useContext(PaymentMethodContext);const P="braintree_payments";const g=u===null||u===void 0?void 0:u.language_code;if(!o&&(y===null||y===void 0?void 0:y.id)!==h)return null;const _=f===null||f===void 0?void 0:f.client_token;const j=v?getPaymentConfig(P,v):{};const b=!isEmpty(p)&&p?p.filter((t=>{var e;return((e=t.payment_source)===null||e===void 0?void 0:e.type)==="braintree_payments"})):[];if(o||n){const t=(e=f===null||f===void 0?void 0:f.options)===null||e===void 0?void 0:e.card;const s=Object.assign(Object.assign({},t),{showCard:n,handleEditClick:r,readonly:o});return isEmpty(t)?null:_jsx(PaymentSourceContext.Provider,Object.assign({value:s},{children:a}),void 0)}if(!x&&s){return _&&!m?_jsxs(Fragment,{children:[isEmpty(b)?null:_jsx("div",Object.assign({className:C.className},{children:_jsx(PaymentCardsTemplate,Object.assign({},{paymentResource:P,customerPayments:b},{children:s}),void 0)}),void 0),_jsx(BraintreePayment,{templateCustomerSaveToWallet:c,authorization:_,locale:g,config:j},void 0)]},void 0):l}return _&&!m?_jsx(BraintreePayment,{locale:g,authorization:_,config:j},void 0):l}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{__rest}from"tslib";import{jsx as _jsx}from"react/jsx-runtime";import PaypalPayment from"../PaypalPayment";import PaymentMethodChildrenContext from"../../context/PaymentMethodChildrenContext";import PaymentMethodContext from"../../context/PaymentMethodContext";import PaymentSourceContext from"../../context/PaymentSourceContext";import{getPaymentConfig}from"../../reducers/PaymentMethodReducer";import isEmpty from"lodash/isEmpty";import{useContext}from"react";export default function PaypalGateway(t){var e,o;const{readonly:n,showCard:a,handleEditClick:r,children:i,templateCustomerCards:d,show:l,loading:m,onClickCustomerCards:s,loaderComponent:C,templateCustomerSaveToWallet:c}=t,u=__rest(t,["readonly","showCard","handleEditClick","children","templateCustomerCards","show","loading","onClickCustomerCards","loaderComponent","templateCustomerSaveToWallet"]);const{payment:y}=useContext(PaymentMethodChildrenContext);const{currentPaymentMethodId:p,config:h,paymentSource:x}=useContext(PaymentMethodContext);const P="paypal_payments";if(!n&&(y===null||y===void 0?void 0:y.id)!==p)return null;if(n||a){const t=((e=x===null||x===void 0?void 0:x.options)===null||e===void 0?void 0:e.card)||((o=x===null||x===void 0?void 0:x.metadata)===null||o===void 0?void 0:o.card);const d=Object.assign(Object.assign({},t),{showCard:a,handleEditClick:r,readonly:n});return isEmpty(t)?null:_jsx(PaymentSourceContext.Provider,Object.assign({value:d},{children:i}),void 0)}const v=h&&getPaymentConfig(P,h);return _jsx(PaypalPayment,Object.assign({},u,{infoMessage:v===null||v===void 0?void 0:v.infoMessage}),void 0)}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{__rest}from"tslib";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";import StripePayment from"../StripePayment";import CustomerContext from"../../context/CustomerContext";import OrderContext from"../../context/OrderContext";import PaymentMethodChildrenContext from"../../context/PaymentMethodChildrenContext";import PaymentMethodContext from"../../context/PaymentMethodContext";import PaymentSourceContext from"../../context/PaymentSourceContext";import{getPaymentConfig}from"../../reducers/PaymentMethodReducer";import isEmpty from"lodash/isEmpty";import{Fragment,useContext}from"react";import PaymentCardsTemplate from"../utils/PaymentCardsTemplate";export default function StripeGateway(t){var e;const{readonly:o,showCard:n,handleEditClick:r,children:s,templateCustomerCards:a,show:i,loading:m,onClickCustomerCards:l,loaderComponent:d,templateCustomerSaveToWallet:c}=t,C=__rest(t,["readonly","showCard","handleEditClick","children","templateCustomerCards","show","loading","onClickCustomerCards","loaderComponent","templateCustomerSaveToWallet"]);const{order:u}=useContext(OrderContext);const{payment:p}=useContext(PaymentMethodChildrenContext);const{payments:y,isGuest:x}=useContext(CustomerContext);const{currentPaymentMethodId:h,config:v,paymentSource:P}=useContext(PaymentMethodContext);const f="stripe_payments";const g=u===null||u===void 0?void 0:u.language_code;if(!o&&(p===null||p===void 0?void 0:p.id)!==h)return null;const j=P===null||P===void 0?void 0:P.publishable_key;const _=v?getPaymentConfig(f,v):{};const b=!isEmpty(y)&&y?y.filter((t=>{var e;return((e=t.payment_source)===null||e===void 0?void 0:e.type)==="stripe_payments"})):[];if(o||n){const t=(e=P===null||P===void 0?void 0:P.options)===null||e===void 0?void 0:e.card;const a=Object.assign(Object.assign({},t),{showCard:n,handleEditClick:r,readonly:o});return isEmpty(t)?null:_jsx(PaymentSourceContext.Provider,Object.assign({value:a},{children:s}),void 0)}if(!x&&a){return _jsxs(Fragment,{children:[isEmpty(b)?null:_jsx("div",Object.assign({className:C.className},{children:_jsx(PaymentCardsTemplate,Object.assign({},{paymentResource:f,customerPayments:b},{children:a}),void 0)}),void 0),_jsx(StripePayment,Object.assign({show:i,templateCustomerSaveToWallet:c,publishableKey:j,locale:g},_),void 0)]},void 0)}return j&&!m?_jsx(StripePayment,Object.assign({show:i,publishableKey:j,locale:g},_),void 0):d}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{__rest}from"tslib";import{jsx as _jsx}from"react/jsx-runtime";import WireTransferPayment from"../WireTransferPayment";import PaymentMethodChildrenContext from"../../context/PaymentMethodChildrenContext";import PaymentMethodContext from"../../context/PaymentMethodContext";import PaymentSourceContext from"../../context/PaymentSourceContext";import{getPaymentConfig}from"../../reducers/PaymentMethodReducer";import isEmpty from"lodash/isEmpty";import{useContext}from"react";export default function WireTransferGateway(t){var e,o;const{readonly:n,showCard:r,handleEditClick:a,children:i,templateCustomerCards:d,show:s,loading:m,onClickCustomerCards:l,loaderComponent:C,templateCustomerSaveToWallet:c}=t,u=__rest(t,["readonly","showCard","handleEditClick","children","templateCustomerCards","show","loading","onClickCustomerCards","loaderComponent","templateCustomerSaveToWallet"]);const{payment:y}=useContext(PaymentMethodChildrenContext);const{currentPaymentMethodId:h,config:p,paymentSource:f}=useContext(PaymentMethodContext);const x="wire_transfers";if(!n&&(y===null||y===void 0?void 0:y.id)!==h)return null;if(n||r){const t=((e=f===null||f===void 0?void 0:f.options)===null||e===void 0?void 0:e.card)||((o=f===null||f===void 0?void 0:f.metadata)===null||o===void 0?void 0:o.card);const d=Object.assign(Object.assign({},t),{showCard:r,handleEditClick:a,readonly:n});return isEmpty(t)?null:_jsx(PaymentSourceContext.Provider,Object.assign({value:d},{children:i}),void 0)}const v=p&&x?getPaymentConfig(x,p):{};return _jsx(WireTransferPayment,Object.assign({},u,v),void 0)}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { Address } from '@commercelayer/sdk';
|
|
3
|
+
import AddressChildrenContext from '../../context/AddressChildrenContext';
|
|
4
|
+
import { FunctionChildren } from '../../typings/index';
|
|
5
|
+
declare type ChildrenProps = Pick<Props, 'customerAddresses' | 'className'> & {
|
|
6
|
+
AddressProvider: typeof AddressChildrenContext.Provider;
|
|
7
|
+
};
|
|
8
|
+
export declare type CustomerAddress = Address & {
|
|
9
|
+
onClick: () => void;
|
|
10
|
+
handleSelect?: () => void;
|
|
11
|
+
};
|
|
12
|
+
export declare type AddressCardsTemplateChildren = FunctionChildren<ChildrenProps>;
|
|
13
|
+
export declare type AddressCardsTemplate = ChildrenProps;
|
|
14
|
+
declare type HandleSelect = (k: number, addressId: string, customerAddressId: string, disabled: boolean) => void;
|
|
15
|
+
declare type Props = {
|
|
16
|
+
customerAddresses: CustomerAddress[];
|
|
17
|
+
countryLock?: string;
|
|
18
|
+
children: AddressCardsTemplateChildren;
|
|
19
|
+
selectedClassName?: string;
|
|
20
|
+
disabledClassName?: string;
|
|
21
|
+
deselect?: boolean;
|
|
22
|
+
selected?: number | null;
|
|
23
|
+
className?: string;
|
|
24
|
+
handleSelect: HandleSelect;
|
|
25
|
+
};
|
|
26
|
+
export default function AddressCardsTemplate({ customerAddresses, children, deselect, countryLock, selected, selectedClassName, className, disabledClassName, handleSelect, }: Props): JSX.Element;
|
|
27
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as _jsx}from"react/jsx-runtime";import Parent from"../utils/Parent";import{useContext}from"react";import AddressChildrenContext from"../../context/AddressChildrenContext";import ShippingAddressContext from"../../context/ShippingAddressContext";export default function AddressCardsTemplate({customerAddresses:e,children:s,deselect:t,countryLock:r,selected:n,selectedClassName:o,className:d,disabledClassName:c,handleSelect:i}){const{setShippingAddress:a}=useContext(ShippingAddressContext);const l=e.map(((e,s)=>{const l=e;const m=a&&r&&r!==e.country_code||false;const p=t?"":o;const x=n===s?`${d} ${p}`:d;const C=m?`${d} ${c}`:x;const u=(e===null||e===void 0?void 0:e.reference)||"";const A=()=>i(s,e.id,u,m);return Object.assign(Object.assign({},l),{className:C,onClick:A})}));const m={customerAddresses:l,AddressProvider:AddressChildrenContext.Provider};return _jsx(Parent,Object.assign({},m,{children:s}),void 0)}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { FunctionComponent, ReactNode } from 'react';
|
|
2
|
+
declare type BaseFieldChildren = Omit<BaseFieldProps, 'children'>;
|
|
3
|
+
export declare type BaseFieldProps = {
|
|
4
|
+
attribute: 'number' | 'id';
|
|
5
|
+
children?: (props: BaseFieldChildren) => ReactNode;
|
|
6
|
+
} & JSX.IntrinsicElements['span'];
|
|
7
|
+
declare const BaseField: FunctionComponent<BaseFieldProps>;
|
|
8
|
+
export default BaseField;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{__rest}from"tslib";import{jsx as _jsx}from"react/jsx-runtime";import OrderContext from"../../context/OrderContext";import{useContext,useEffect,useState}from"react";import Parent from"./Parent";const BaseField=t=>{var{children:e,attribute:r}=t,s=__rest(t,["children","attribute"]);const{order:n}=useContext(OrderContext);const[o,i]=useState("");useEffect((()=>{if(n&&r in n)i(n[r]);return()=>{i("")}}),[n]);const a=Object.assign({attribute:o},s);return e?_jsx(Parent,Object.assign({},a,{children:e}),void 0):_jsx("span",Object.assign({},s,{children:o}),void 0)};export default BaseField;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { BaseInputComponentProps } from '../../typings/index';
|
|
3
|
+
export declare type BaseInputProps = BaseInputComponentProps & JSX.IntrinsicElements['input'] & JSX.IntrinsicElements['textarea'];
|
|
4
|
+
declare const _default: React.ForwardRefExoticComponent<Pick<BaseInputProps, "children" | "form" | "slot" | "style" | "title" | "pattern" | "type" | "key" | "resource" | "id" | "value" | "placeholder" | "className" | "required" | "name" | "onChange" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "lang" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "min" | "max" | "disabled" | "width" | "height" | "src" | "list" | "step" | "accept" | "alt" | "autoComplete" | "autoFocus" | "capture" | "checked" | "crossOrigin" | "enterKeyHint" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "maxLength" | "minLength" | "multiple" | "readOnly" | "size" | "cols" | "dirName" | "rows" | "wrap"> & React.RefAttributes<any>>;
|
|
5
|
+
export default _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{__rest}from"tslib";import{jsx as _jsx}from"react/jsx-runtime";import React from"react";import Parent from"./Parent";const BaseInput=(t,e)=>{const{children:r}=t,s=__rest(t,["children"]);const a=t.type==="textarea"?_jsx("textarea",Object.assign({ref:e},s),void 0):_jsx("input",Object.assign({ref:e},s),void 0);return r?_jsx(Parent,Object.assign({},s,{children:r}),void 0):a};export default React.forwardRef(BaseInput);
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { FunctionComponent } from 'react';
|
|
2
|
+
import { PropsType } from '../../utils/PropsType';
|
|
3
|
+
import { baseOrderPricePropTypes } from '../../typings/index';
|
|
4
|
+
export declare type BaseOrderPriceProps = PropsType<typeof baseOrderPricePropTypes> & JSX.IntrinsicElements['span'];
|
|
5
|
+
declare const BaseOrderPrice: FunctionComponent<BaseOrderPriceProps>;
|
|
6
|
+
export default BaseOrderPrice;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{__rest}from"tslib";import{jsx as _jsx}from"react/jsx-runtime";import OrderContext from"../../context/OrderContext";import getAmount from"../../utils/getAmount";import Parent from"./Parent";import{useState,useEffect,useContext}from"react";import{baseOrderPricePropTypes}from"../../typings/index";import{isEmpty}from"lodash";const BaseOrderPrice=e=>{const{format:t="formatted",base:r,type:s,children:o}=e,n=__rest(e,["format","base","type","children"]);const{order:i}=useContext(OrderContext);const[a,c]=useState("");const[m,p]=useState(0);useEffect((()=>{const e=getAmount({base:r,type:s,format:t,obj:i||{}});const o=getAmount({base:r,type:s,format:"cents",obj:i||{}});c(e);p(o);return()=>{if(isEmpty(i)){c("")}}}),[i]);const d=Object.assign({priceCents:m,price:a},n);return o?_jsx(Parent,Object.assign({},d,{children:o}),void 0):_jsx("span",Object.assign({},n,{children:a}),void 0)};BaseOrderPrice.propTypes=baseOrderPricePropTypes;export default BaseOrderPrice;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { BaseSelectComponentProps } from '../../typings/index';
|
|
3
|
+
export declare type BaseSelectProps = BaseSelectComponentProps;
|
|
4
|
+
declare const _default: React.ForwardRefExoticComponent<BaseSelectComponentProps & React.RefAttributes<any>>;
|
|
5
|
+
export default _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{__rest}from"tslib";import{jsx as _jsx}from"react/jsx-runtime";import React from"react";import Parent from"./Parent";import{findIndex}from"lodash";const BaseSelect=(e,t)=>{const{options:r=[],children:s,placeholder:o={label:"Select an option",value:""},value:n=""}=e,a=__rest(e,["options","children","placeholder","value"]);if(findIndex(r,o)===-1){r.unshift(o)}else{r[0]=o}const l=r.map(((e,t)=>{const{label:r}=e,s=__rest(e,["label"]);return _jsx("option",Object.assign({},s,{children:r}),t)}));const i=Object.assign({options:r,ref:t},a);return s?_jsx(Parent,Object.assign({},i,{children:s}),void 0):_jsx("select",Object.assign({ref:t,defaultValue:n},a,{children:l}),void 0)};export default React.forwardRef(BaseSelect);
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import PropTypes, { InferProps } from 'prop-types';
|
|
2
|
+
import { FunctionComponent } from 'react';
|
|
3
|
+
declare const PProps: {
|
|
4
|
+
children: PropTypes.Requireable<(...args: any[]) => any>;
|
|
5
|
+
};
|
|
6
|
+
export declare type ParentProps = InferProps<typeof PProps>;
|
|
7
|
+
declare const Parent: FunctionComponent<ParentProps>;
|
|
8
|
+
export default Parent;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as _jsx}from"react/jsx-runtime";import PropTypes from"prop-types";const PProps={children:PropTypes.func};const Parent=r=>{const s=r.children;return s?_jsx(s,Object.assign({},r),void 0):null};Parent.propTypes=PProps;export default Parent;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { PaymentResource, PaymentSourceType } from '../../reducers/PaymentMethodReducer';
|
|
3
|
+
import PaymentSourceContext, { iconBrand } from '../../context/PaymentSourceContext';
|
|
4
|
+
import { FunctionChildren } from '../../typings/index';
|
|
5
|
+
declare type ChildrenProps = Pick<Props, 'customerPayments'> & {
|
|
6
|
+
PaymentSourceProvider: typeof PaymentSourceContext.Provider;
|
|
7
|
+
};
|
|
8
|
+
declare type CustomerPayment = PaymentSourceType & {
|
|
9
|
+
card?: {
|
|
10
|
+
brand?: iconBrand;
|
|
11
|
+
last4?: string;
|
|
12
|
+
};
|
|
13
|
+
handleClick?: () => void;
|
|
14
|
+
};
|
|
15
|
+
export declare type CustomerCardsTemplateChildren = FunctionChildren<ChildrenProps>;
|
|
16
|
+
export declare type CustomerCardsTemplate = ChildrenProps;
|
|
17
|
+
declare type Props = {
|
|
18
|
+
customerPayments: CustomerPayment[];
|
|
19
|
+
children: CustomerCardsTemplateChildren;
|
|
20
|
+
paymentResource: PaymentResource;
|
|
21
|
+
};
|
|
22
|
+
export default function PaymentCardsTemplate({ customerPayments, children, paymentResource, }: Props): JSX.Element;
|
|
23
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as _jsx}from"react/jsx-runtime";import Parent from"../utils/Parent";import{useContext}from"react";import PaymentMethodContext from"../../context/PaymentMethodContext";import PaymentSourceContext from"../../context/PaymentSourceContext";export default function PaymentCardsTemplate({customerPayments:t,children:e,paymentResource:o}){const{setPaymentSource:n}=useContext(PaymentMethodContext);const r=t.map((t=>{var e,r,a,i,m;const s=t;const c=((e=t===null||t===void 0?void 0:t.payment_source.options)===null||e===void 0?void 0:e.card)||((a=(r=t===null||t===void 0?void 0:t.payment_source)===null||r===void 0?void 0:r.payment_request_data)===null||a===void 0?void 0:a.paymentMethod)||((m=(i=t===null||t===void 0?void 0:t.payment_source)===null||i===void 0?void 0:i.metadata)===null||m===void 0?void 0:m.card);const d=async e=>{e.stopPropagation();await n({paymentResource:o,customerPaymentSourceId:t.id})};return Object.assign(Object.assign({},s),{card:c,handleClick:d})}));const a={customerPayments:r,PaymentSourceProvider:PaymentSourceContext.Provider};return _jsx(Parent,Object.assign({},a,{children:e}),void 0)}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { FunctionComponent } from 'react';
|
|
2
|
+
import { PriceProps } from '../Price';
|
|
3
|
+
export declare type PTemplateProps = {
|
|
4
|
+
formattedAmount?: string;
|
|
5
|
+
formattedCompare?: string;
|
|
6
|
+
} & Omit<PriceProps, 'children'>;
|
|
7
|
+
declare const PriceTemplate: FunctionComponent<PTemplateProps>;
|
|
8
|
+
export default PriceTemplate;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{__rest}from"tslib";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";import{Fragment}from"react";import PropTypes from"prop-types";const propTypes={formattedAmount:PropTypes.string,formattedCompare:PropTypes.string};const defaultProps={formattedAmount:"",formattedCompare:""};const PriceTemplate=e=>{const{showCompare:s,formattedCompare:r,compareClassName:t,className:o,formattedAmount:a,skuCode:m}=e,p=__rest(e,["showCompare","formattedCompare","compareClassName","className","formattedAmount","skuCode"]);return _jsxs(Fragment,{children:[_jsx("span",Object.assign({className:o},p,{children:a}),void 0),s&&_jsx("span",Object.assign({className:t||""},p,{children:r}),void 0)]},void 0)};PriceTemplate.propTypes=propTypes;PriceTemplate.defaultProps=defaultProps;export default PriceTemplate;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { FunctionComponent, ReactNode } from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import { BaseSelectorType } from '../../typings/index';
|
|
4
|
+
import { VariantsObject, SetSkuCode } from '../../reducers/VariantReducer';
|
|
5
|
+
import { VariantOptions } from '../VariantSelector';
|
|
6
|
+
export declare const propTypes: {
|
|
7
|
+
variants: PropTypes.Validator<any>;
|
|
8
|
+
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
9
|
+
options: PropTypes.Validator<PropTypes.InferProps<{
|
|
10
|
+
label: PropTypes.Validator<string>;
|
|
11
|
+
code: PropTypes.Validator<string>;
|
|
12
|
+
lineItem: PropTypes.Requireable<PropTypes.InferProps<{
|
|
13
|
+
name: PropTypes.Validator<string>;
|
|
14
|
+
imageUrl: PropTypes.Requireable<string>;
|
|
15
|
+
}>>;
|
|
16
|
+
}>[]>;
|
|
17
|
+
name: PropTypes.Requireable<string>;
|
|
18
|
+
children: PropTypes.Requireable<(...args: any[]) => any>;
|
|
19
|
+
type: PropTypes.Requireable<BaseSelectorType>;
|
|
20
|
+
loader: PropTypes.Requireable<PropTypes.ReactElementLike>;
|
|
21
|
+
placeholder: PropTypes.Requireable<string>;
|
|
22
|
+
skuCode: PropTypes.Requireable<string>;
|
|
23
|
+
};
|
|
24
|
+
export declare type VariantTemplateProps = {
|
|
25
|
+
variants: VariantsObject | Record<string, any>;
|
|
26
|
+
handleChange?: SetSkuCode;
|
|
27
|
+
options: VariantOptions[];
|
|
28
|
+
type?: BaseSelectorType;
|
|
29
|
+
loader?: ReactNode;
|
|
30
|
+
placeholder?: string;
|
|
31
|
+
skuCode?: string;
|
|
32
|
+
} & JSX.IntrinsicElements['input'] & JSX.IntrinsicElements['select'];
|
|
33
|
+
declare const VariantTemplate: FunctionComponent<VariantTemplateProps>;
|
|
34
|
+
export default VariantTemplate;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{__rest}from"tslib";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";import{Fragment}from"react";import{keys}from"lodash";import PropTypes from"prop-types";export const propTypes={variants:PropTypes.any.isRequired,onChange:PropTypes.func,options:PropTypes.arrayOf(PropTypes.shape({label:PropTypes.string.isRequired,code:PropTypes.string.isRequired,lineItem:PropTypes.shape({name:PropTypes.string.isRequired,imageUrl:PropTypes.string})}).isRequired).isRequired,name:PropTypes.string,children:PropTypes.func,type:PropTypes.oneOf(["select","radio"]),loader:PropTypes.element,placeholder:PropTypes.string,skuCode:PropTypes.string};const VariantTemplate=e=>{const{id:s,variants:r,type:t,placeholder:o,options:a,skuCode:p,handleChange:i}=e,n=__rest(e,["id","variants","type","placeholder","options","skuCode","handleChange"]);const d=keys(r).map(((e,o)=>{const d=p===e;return t==="select"?_jsx("option",Object.assign({"data-sku-id":r[e].id,value:r[e].code},{children:a.length>0?a[o].label:r[e].name}),r[e].id):_jsxs(Fragment,{children:[_jsx("input",Object.assign({id:s&&`${s}-${o}`,defaultChecked:d,type:"radio",value:r[e].code,onChange:s=>i&&i(s.target.value,r[e].id)},n),void 0),a.length>0?a[o].label:r[e].name]},r[e].id)}));if(t==="select"){return _jsxs("select",Object.assign({id:s,onChange:e=>{const s=e.target.value;const r=e.target.selectedIndex;const t=e.target[r].dataset.skuId;i&&i(s,t)},value:p||""},n,{children:[_jsx("option",Object.assign({disabled:!!p},{children:o}),void 0),d]}),void 0)}return _jsx(Fragment,{children:d},void 0)};VariantTemplate.propTypes=propTypes;export default VariantTemplate;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { LineItem } from '@commercelayer/sdk';
|
|
3
|
+
import { BaseError, ResourceErrorType } from '../../typings/errors';
|
|
4
|
+
export declare type AllErrorsParams = {
|
|
5
|
+
allErrors: BaseError[];
|
|
6
|
+
messages: BaseError[];
|
|
7
|
+
field?: string;
|
|
8
|
+
props: JSX.IntrinsicElements['span'];
|
|
9
|
+
lineItem?: LineItem;
|
|
10
|
+
resource?: ResourceErrorType;
|
|
11
|
+
returnHtml?: boolean;
|
|
12
|
+
};
|
|
13
|
+
export interface GetAllErrors {
|
|
14
|
+
<P extends AllErrorsParams>(params: P): ReactNode;
|
|
15
|
+
}
|
|
16
|
+
declare const getAllErrors: GetAllErrors;
|
|
17
|
+
export default getAllErrors;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as _jsx}from"react/jsx-runtime";import customMessages from"../../utils/customMessages";const getAllErrors=s=>{const{allErrors:e,messages:r,field:t,props:i,lineItem:n,resource:o,returnHtml:l=true}=s;return e.map(((s,e)=>{const a=customMessages(r,s);const c=(a===null||a===void 0?void 0:a.message)||s.message||`${s.title} - ${s.detail}`;if(t){if(s.resource==="line_items"){if(n&&s.id===n["id"]){return l?_jsx("span",Object.assign({},i,{children:c}),e):c}}if(t===s.field&&o===s.resource){return l?_jsx("span",Object.assign({},i,{children:c}),e):c}}if(o===s.resource&&!t){return l?_jsx("span",Object.assign({},i,{children:c}),e):c}}))};export default getAllErrors;
|