@commercelayer/react-components 2.48.0 → 2.49.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/AddToCartButton.js +1 -1
- package/lib/cjs/components/Address.js +1 -1
- package/lib/cjs/components/AddressCountrySelector.js +1 -1
- package/lib/cjs/components/AddressField.js +1 -1
- package/lib/cjs/components/AddressInput.js +1 -1
- package/lib/cjs/components/AddressStateSelector.js +1 -1
- package/lib/cjs/components/AddressesContainer.js +1 -1
- package/lib/cjs/components/AdyenPayment.js +1 -1
- package/lib/cjs/components/AvailabilityContainer.js +1 -1
- package/lib/cjs/components/AvailabilityTemplate.d.ts +5 -1
- package/lib/cjs/components/AvailabilityTemplate.js +1 -1
- package/lib/cjs/components/BillingAddressContainer.js +1 -1
- package/lib/cjs/components/BillingAddressForm.js +1 -1
- package/lib/cjs/components/BraintreePayment.js +1 -1
- package/lib/cjs/components/CheckoutLink.js +1 -1
- package/lib/cjs/components/CommerceLayer.js +1 -1
- package/lib/cjs/components/CustomerContainer.js +1 -1
- package/lib/cjs/components/CustomerInput.js +1 -1
- package/lib/cjs/components/DeliveryLeadTime.js +1 -1
- package/lib/cjs/components/DiscountAmount.js +1 -1
- package/lib/cjs/components/Errors.js +1 -1
- package/lib/cjs/components/ExternalFunction.js +1 -1
- package/lib/cjs/components/GiftCard.js +1 -1
- package/lib/cjs/components/GiftCardAmount.js +1 -1
- package/lib/cjs/components/GiftCardContainer.js +1 -1
- package/lib/cjs/components/GiftCardCurrencySelector.js +1 -1
- package/lib/cjs/components/GiftCardInput.js +1 -1
- package/lib/cjs/components/GiftCardOrCouponCode.js +1 -1
- package/lib/cjs/components/GiftCardOrCouponForm.js +1 -1
- package/lib/cjs/components/GiftCardOrCouponInput.js +1 -1
- package/lib/cjs/components/GiftCardOrCouponRemoveButton.js +1 -1
- package/lib/cjs/components/GiftCardOrCouponSubmit.js +1 -1
- package/lib/cjs/components/ItemContainer.js +1 -1
- package/lib/cjs/components/LineItem.js +1 -1
- package/lib/cjs/components/LineItemAmount.js +1 -1
- package/lib/cjs/components/LineItemCode.js +1 -1
- package/lib/cjs/components/LineItemImage.js +1 -1
- package/lib/cjs/components/LineItemName.js +1 -1
- package/lib/cjs/components/LineItemOption.js +1 -1
- package/lib/cjs/components/LineItemOptions.js +1 -1
- package/lib/cjs/components/LineItemQuantity.js +1 -1
- package/lib/cjs/components/LineItemRemoveLink.js +1 -1
- package/lib/cjs/components/LineItemsContainer.js +1 -1
- package/lib/cjs/components/LineItemsCount.js +1 -1
- package/lib/cjs/components/MetadataInput.js +1 -1
- package/lib/cjs/components/OrderContainer.js +1 -1
- package/lib/cjs/components/OrderNumber.js +1 -1
- package/lib/cjs/components/OrderStorage.js +1 -1
- package/lib/cjs/components/PaymentGateway.js +1 -1
- package/lib/cjs/components/PaymentMethod.js +1 -1
- package/lib/cjs/components/PaymentMethodAmount.js +1 -1
- package/lib/cjs/components/PaymentMethodName.js +1 -1
- package/lib/cjs/components/PaymentMethodPrice.js +1 -1
- package/lib/cjs/components/PaymentMethodRadioButton.js +1 -1
- package/lib/cjs/components/PaymentMethodsContainer.js +1 -1
- package/lib/cjs/components/PaymentSource.js +1 -1
- package/lib/cjs/components/PaymentSourceBrandIcon.js +1 -1
- package/lib/cjs/components/PaymentSourceBrandName.js +1 -1
- package/lib/cjs/components/PaymentSourceDetail.js +1 -1
- package/lib/cjs/components/PaymentSourceEditButton.js +1 -1
- package/lib/cjs/components/PaypalPayment.js +1 -1
- package/lib/cjs/components/PlaceOrderButton.js +1 -1
- package/lib/cjs/components/PlaceOrderContainer.js +1 -1
- package/lib/cjs/components/Price.js +1 -1
- package/lib/cjs/components/PricesContainer.js +1 -1
- package/lib/cjs/components/PrivacyAndTermsCheckbox.js +1 -1
- package/lib/cjs/components/QuantitySelector.js +1 -1
- package/lib/cjs/components/SaveAddressesButton.js +1 -1
- package/lib/cjs/components/SaveCustomerButton.js +1 -1
- package/lib/cjs/components/Shipment.js +1 -1
- package/lib/cjs/components/ShipmentField.js +1 -1
- package/lib/cjs/components/ShipmentsContainer.js +1 -1
- package/lib/cjs/components/ShippingAddressContainer.js +1 -1
- package/lib/cjs/components/ShippingAddressForm.js +1 -1
- package/lib/cjs/components/ShippingAmount.js +1 -1
- package/lib/cjs/components/ShippingMethod.js +1 -1
- package/lib/cjs/components/ShippingMethodName.js +1 -1
- package/lib/cjs/components/ShippingMethodPrice.js +1 -1
- package/lib/cjs/components/ShippingMethodRadioButton.js +1 -1
- package/lib/cjs/components/SkuList.js +1 -1
- package/lib/cjs/components/SkuListsContainer.js +1 -1
- package/lib/cjs/components/SkuOption.js +1 -1
- package/lib/cjs/components/SkuOptionInput.js +1 -1
- package/lib/cjs/components/SkuOptionsContainer.js +1 -1
- package/lib/cjs/components/StockTransfer.js +1 -1
- package/lib/cjs/components/StockTransferField.js +1 -1
- package/lib/cjs/components/StripePayment.js +1 -1
- package/lib/cjs/components/SubTotalAmount.js +1 -1
- package/lib/cjs/components/SubmitButton.js +1 -1
- package/lib/cjs/components/TaxesAmount.js +1 -1
- package/lib/cjs/components/TotalAmount.js +1 -1
- package/lib/cjs/components/VariantSelector.js +1 -1
- package/lib/cjs/components/VariantsContainer.js +1 -1
- package/lib/cjs/components/WireTransferPayment.js +1 -1
- package/lib/cjs/components/gateways/AdyenGateway.js +1 -1
- package/lib/cjs/components/gateways/BraintreeGateway.js +1 -1
- package/lib/cjs/components/gateways/PaypalGateway.js +1 -1
- package/lib/cjs/components/gateways/StripeGateway.js +1 -1
- package/lib/cjs/components/gateways/WireTransferGateway.js +1 -1
- package/lib/cjs/components/utils/AddressCardsTemplate.js +1 -1
- package/lib/cjs/components/utils/BaseField.js +1 -1
- package/lib/cjs/components/utils/BaseInput.js +1 -1
- package/lib/cjs/components/utils/BaseOrderPrice.js +1 -1
- package/lib/cjs/components/utils/BaseSelect.js +1 -1
- package/lib/cjs/components/utils/Parent.js +1 -1
- package/lib/cjs/components/utils/PaymentCardsTemplate.js +1 -1
- package/lib/cjs/components/utils/PriceTemplate.js +1 -1
- package/lib/cjs/components/utils/VariantTemplate.js +1 -1
- package/lib/cjs/components/utils/getAllErrors.js +1 -1
- package/lib/cjs/config/components.js +1 -1
- package/lib/cjs/config/currency.js +1 -1
- package/lib/cjs/context/AddressChildrenContext.js +1 -1
- package/lib/cjs/context/AddressContext.js +1 -1
- package/lib/cjs/context/AvailabilityContext.js +1 -1
- package/lib/cjs/context/BillingAddressContext.js +1 -1
- package/lib/cjs/context/BillingAddressFormContext.js +1 -1
- package/lib/cjs/context/CommerceLayerContext.js +1 -1
- package/lib/cjs/context/CouponAndGiftCardFormContext.js +1 -1
- package/lib/cjs/context/CustomerContext.js +1 -1
- package/lib/cjs/context/ExternalFunctionContext.js +1 -1
- package/lib/cjs/context/GiftCardContext.js +1 -1
- package/lib/cjs/context/ItemContext.js +1 -1
- package/lib/cjs/context/LineItemChildrenContext.js +1 -1
- package/lib/cjs/context/LineItemContext.js +1 -1
- package/lib/cjs/context/LineItemOptionChildrenContext.js +1 -1
- package/lib/cjs/context/OrderContext.js +1 -1
- package/lib/cjs/context/OrderStorageContext.js +1 -1
- package/lib/cjs/context/PaymentMethodChildrenContext.js +1 -1
- package/lib/cjs/context/PaymentMethodContext.js +1 -1
- package/lib/cjs/context/PaymentSourceContext.js +1 -1
- package/lib/cjs/context/PlaceOrderContext.js +1 -1
- package/lib/cjs/context/PricesContext.js +1 -1
- package/lib/cjs/context/ShipmentChildrenContext.js +1 -1
- package/lib/cjs/context/ShipmentContext.js +1 -1
- package/lib/cjs/context/ShippingAddressContext.js +1 -1
- package/lib/cjs/context/ShippingAddressFormContext.js +1 -1
- package/lib/cjs/context/ShippingMethodChildrenContext.js +1 -1
- package/lib/cjs/context/SkuListsContext.js +1 -1
- package/lib/cjs/context/SkuOptionChildrenContext.js +1 -1
- package/lib/cjs/context/SkuOptionsContext.js +1 -1
- package/lib/cjs/context/StockTransferChildrenContext.js +1 -1
- package/lib/cjs/context/VariantsContext.js +1 -1
- package/lib/cjs/index.js +1 -1
- package/lib/cjs/reducers/AddressReducer.js +1 -1
- package/lib/cjs/reducers/AvailabilityReducer.js +1 -1
- package/lib/cjs/reducers/BillingAddressReducer.js +1 -1
- package/lib/cjs/reducers/CustomerReducer.js +1 -1
- package/lib/cjs/reducers/GiftCardReducer.js +1 -1
- package/lib/cjs/reducers/ItemReducer.js +1 -1
- package/lib/cjs/reducers/LineItemReducer.js +1 -1
- package/lib/cjs/reducers/OrderReducer.js +1 -1
- package/lib/cjs/reducers/PaymentMethodReducer.js +1 -1
- package/lib/cjs/reducers/PlaceOrderReducer.js +1 -1
- package/lib/cjs/reducers/PriceReducer.js +1 -1
- package/lib/cjs/reducers/ShipmentReducer.js +1 -1
- package/lib/cjs/reducers/ShippingAddressReducer.js +1 -1
- package/lib/cjs/reducers/SkuListsReducer.js +1 -1
- package/lib/cjs/reducers/SkuOptionsReducer.js +1 -1
- package/lib/cjs/reducers/VariantReducer.js +1 -1
- package/lib/cjs/typings/errors.js +1 -1
- package/lib/cjs/typings/index.js +1 -1
- package/lib/cjs/utils/PropsType.js +1 -1
- package/lib/cjs/utils/addressesManager.js +1 -1
- package/lib/cjs/utils/baseReducer.js +1 -1
- package/lib/cjs/utils/browserInfo.js +1 -1
- package/lib/cjs/utils/childrenTypes.js +1 -1
- package/lib/cjs/utils/countryStateCity.js +1 -1
- package/lib/cjs/utils/customMessages.js +1 -1
- package/lib/cjs/utils/customerOrderOptions.js +1 -1
- package/lib/cjs/utils/getAmount.js +1 -1
- package/lib/cjs/utils/getCurrentItemKey.js +1 -1
- package/lib/cjs/utils/getErrors.js +1 -1
- package/lib/cjs/utils/getLineItemsCount.js +1 -1
- package/lib/cjs/utils/getLoaderComponent.js +1 -1
- package/lib/cjs/utils/getPrices.js +1 -1
- package/lib/cjs/utils/getSdk.js +1 -1
- package/lib/cjs/utils/getSkus.js +1 -1
- package/lib/cjs/utils/isEmptyStates.js +1 -1
- package/lib/cjs/utils/isJSON.js +1 -1
- package/lib/cjs/utils/jwt.js +1 -1
- package/lib/cjs/utils/localStorage.js +1 -1
- package/lib/cjs/utils/organization.js +1 -1
- package/lib/cjs/utils/paypalPayment.js +1 -1
- package/lib/cjs/utils/promisify.js +1 -1
- package/lib/cjs/utils/shipments.js +1 -1
- package/lib/cjs/utils/validateFormFields.js +1 -1
- package/lib/esm/components/AddToCartButton.js +1 -1
- package/lib/esm/components/Address.js +1 -1
- package/lib/esm/components/AddressCountrySelector.js +1 -1
- package/lib/esm/components/AddressField.js +1 -1
- package/lib/esm/components/AddressInput.js +1 -1
- package/lib/esm/components/AddressStateSelector.js +1 -1
- package/lib/esm/components/AddressesContainer.js +1 -1
- package/lib/esm/components/AdyenPayment.js +1 -1
- package/lib/esm/components/AvailabilityContainer.js +1 -1
- package/lib/esm/components/AvailabilityTemplate.d.ts +5 -1
- package/lib/esm/components/AvailabilityTemplate.js +1 -1
- package/lib/esm/components/BillingAddressContainer.js +1 -1
- package/lib/esm/components/BillingAddressForm.js +1 -1
- package/lib/esm/components/BraintreePayment.js +1 -1
- package/lib/esm/components/CheckoutLink.js +1 -1
- package/lib/esm/components/CommerceLayer.js +1 -1
- package/lib/esm/components/CustomerContainer.js +1 -1
- package/lib/esm/components/CustomerInput.js +1 -1
- package/lib/esm/components/DeliveryLeadTime.js +1 -1
- package/lib/esm/components/DiscountAmount.js +1 -1
- package/lib/esm/components/Errors.js +1 -1
- package/lib/esm/components/ExternalFunction.js +1 -1
- package/lib/esm/components/GiftCard.js +1 -1
- package/lib/esm/components/GiftCardAmount.js +1 -1
- package/lib/esm/components/GiftCardContainer.js +1 -1
- package/lib/esm/components/GiftCardCurrencySelector.js +1 -1
- package/lib/esm/components/GiftCardInput.js +1 -1
- package/lib/esm/components/GiftCardOrCouponCode.js +1 -1
- package/lib/esm/components/GiftCardOrCouponForm.js +1 -1
- package/lib/esm/components/GiftCardOrCouponInput.js +1 -1
- package/lib/esm/components/GiftCardOrCouponRemoveButton.js +1 -1
- package/lib/esm/components/GiftCardOrCouponSubmit.js +1 -1
- package/lib/esm/components/ItemContainer.js +1 -1
- package/lib/esm/components/LineItem.js +1 -1
- package/lib/esm/components/LineItemAmount.js +1 -1
- package/lib/esm/components/LineItemCode.js +1 -1
- package/lib/esm/components/LineItemImage.js +1 -1
- package/lib/esm/components/LineItemName.js +1 -1
- package/lib/esm/components/LineItemOption.js +1 -1
- package/lib/esm/components/LineItemOptions.js +1 -1
- package/lib/esm/components/LineItemQuantity.js +1 -1
- package/lib/esm/components/LineItemRemoveLink.js +1 -1
- package/lib/esm/components/LineItemsContainer.js +1 -1
- package/lib/esm/components/LineItemsCount.js +1 -1
- package/lib/esm/components/MetadataInput.js +1 -1
- package/lib/esm/components/OrderContainer.js +1 -1
- package/lib/esm/components/OrderNumber.js +1 -1
- package/lib/esm/components/OrderStorage.js +1 -1
- package/lib/esm/components/PaymentGateway.js +1 -1
- package/lib/esm/components/PaymentMethod.js +1 -1
- package/lib/esm/components/PaymentMethodAmount.js +1 -1
- package/lib/esm/components/PaymentMethodName.js +1 -1
- package/lib/esm/components/PaymentMethodPrice.js +1 -1
- package/lib/esm/components/PaymentMethodRadioButton.js +1 -1
- package/lib/esm/components/PaymentMethodsContainer.js +1 -1
- package/lib/esm/components/PaymentSource.js +1 -1
- package/lib/esm/components/PaymentSourceBrandIcon.js +1 -1
- package/lib/esm/components/PaymentSourceBrandName.js +1 -1
- package/lib/esm/components/PaymentSourceDetail.js +1 -1
- package/lib/esm/components/PaymentSourceEditButton.js +1 -1
- package/lib/esm/components/PaypalPayment.js +1 -1
- package/lib/esm/components/PlaceOrderButton.js +1 -1
- package/lib/esm/components/PlaceOrderContainer.js +1 -1
- package/lib/esm/components/Price.js +1 -1
- package/lib/esm/components/PricesContainer.js +1 -1
- package/lib/esm/components/PrivacyAndTermsCheckbox.js +1 -1
- package/lib/esm/components/QuantitySelector.js +1 -1
- package/lib/esm/components/SaveAddressesButton.js +1 -1
- package/lib/esm/components/SaveCustomerButton.js +1 -1
- package/lib/esm/components/Shipment.js +1 -1
- package/lib/esm/components/ShipmentField.js +1 -1
- package/lib/esm/components/ShipmentsContainer.js +1 -1
- package/lib/esm/components/ShippingAddressContainer.js +1 -1
- package/lib/esm/components/ShippingAddressForm.js +1 -1
- package/lib/esm/components/ShippingAmount.js +1 -1
- package/lib/esm/components/ShippingMethod.js +1 -1
- package/lib/esm/components/ShippingMethodName.js +1 -1
- package/lib/esm/components/ShippingMethodPrice.js +1 -1
- package/lib/esm/components/ShippingMethodRadioButton.js +1 -1
- package/lib/esm/components/SkuList.js +1 -1
- package/lib/esm/components/SkuListsContainer.js +1 -1
- package/lib/esm/components/SkuOption.js +1 -1
- package/lib/esm/components/SkuOptionInput.js +1 -1
- package/lib/esm/components/SkuOptionsContainer.js +1 -1
- package/lib/esm/components/StockTransfer.js +1 -1
- package/lib/esm/components/StockTransferField.js +1 -1
- package/lib/esm/components/StripePayment.js +1 -1
- package/lib/esm/components/SubTotalAmount.js +1 -1
- package/lib/esm/components/SubmitButton.js +1 -1
- package/lib/esm/components/TaxesAmount.js +1 -1
- package/lib/esm/components/TotalAmount.js +1 -1
- package/lib/esm/components/VariantSelector.js +1 -1
- package/lib/esm/components/VariantsContainer.js +1 -1
- package/lib/esm/components/WireTransferPayment.js +1 -1
- package/lib/esm/components/gateways/AdyenGateway.js +1 -1
- package/lib/esm/components/gateways/BraintreeGateway.js +1 -1
- package/lib/esm/components/gateways/PaypalGateway.js +1 -1
- package/lib/esm/components/gateways/StripeGateway.js +1 -1
- package/lib/esm/components/gateways/WireTransferGateway.js +1 -1
- package/lib/esm/components/utils/AddressCardsTemplate.js +1 -1
- package/lib/esm/components/utils/BaseField.js +1 -1
- package/lib/esm/components/utils/BaseInput.js +1 -1
- package/lib/esm/components/utils/BaseOrderPrice.js +1 -1
- package/lib/esm/components/utils/BaseSelect.js +1 -1
- package/lib/esm/components/utils/Parent.js +1 -1
- package/lib/esm/components/utils/PaymentCardsTemplate.js +1 -1
- package/lib/esm/components/utils/PriceTemplate.js +1 -1
- package/lib/esm/components/utils/VariantTemplate.js +1 -1
- package/lib/esm/components/utils/getAllErrors.js +1 -1
- package/lib/esm/config/components.js +1 -1
- package/lib/esm/context/AddressChildrenContext.js +1 -1
- package/lib/esm/context/AddressContext.js +1 -1
- package/lib/esm/context/AvailabilityContext.js +1 -1
- package/lib/esm/context/BillingAddressContext.js +1 -1
- package/lib/esm/context/BillingAddressFormContext.js +1 -1
- package/lib/esm/context/CommerceLayerContext.js +1 -1
- package/lib/esm/context/CouponAndGiftCardFormContext.js +1 -1
- package/lib/esm/context/CustomerContext.js +1 -1
- package/lib/esm/context/ExternalFunctionContext.js +1 -1
- package/lib/esm/context/GiftCardContext.js +1 -1
- package/lib/esm/context/ItemContext.js +1 -1
- package/lib/esm/context/LineItemChildrenContext.js +1 -1
- package/lib/esm/context/LineItemContext.js +1 -1
- package/lib/esm/context/LineItemOptionChildrenContext.js +1 -1
- package/lib/esm/context/OrderContext.js +1 -1
- package/lib/esm/context/OrderStorageContext.js +1 -1
- package/lib/esm/context/PaymentMethodChildrenContext.js +1 -1
- package/lib/esm/context/PaymentMethodContext.js +1 -1
- package/lib/esm/context/PaymentSourceContext.js +1 -1
- package/lib/esm/context/PlaceOrderContext.js +1 -1
- package/lib/esm/context/PricesContext.js +1 -1
- package/lib/esm/context/ShipmentChildrenContext.js +1 -1
- package/lib/esm/context/ShipmentContext.js +1 -1
- package/lib/esm/context/ShippingAddressContext.js +1 -1
- package/lib/esm/context/ShippingAddressFormContext.js +1 -1
- package/lib/esm/context/ShippingMethodChildrenContext.js +1 -1
- package/lib/esm/context/SkuListsContext.js +1 -1
- package/lib/esm/context/SkuOptionChildrenContext.js +1 -1
- package/lib/esm/context/SkuOptionsContext.js +1 -1
- package/lib/esm/context/StockTransferChildrenContext.js +1 -1
- package/lib/esm/context/VariantsContext.js +1 -1
- package/lib/esm/reducers/AddressReducer.js +1 -1
- package/lib/esm/reducers/AvailabilityReducer.js +1 -1
- package/lib/esm/reducers/BillingAddressReducer.js +1 -1
- package/lib/esm/reducers/CustomerReducer.js +1 -1
- package/lib/esm/reducers/GiftCardReducer.js +1 -1
- package/lib/esm/reducers/ItemReducer.js +1 -1
- package/lib/esm/reducers/LineItemReducer.js +1 -1
- package/lib/esm/reducers/OrderReducer.js +1 -1
- package/lib/esm/reducers/PaymentMethodReducer.js +1 -1
- package/lib/esm/reducers/PlaceOrderReducer.js +1 -1
- package/lib/esm/reducers/PriceReducer.js +1 -1
- package/lib/esm/reducers/ShipmentReducer.js +1 -1
- package/lib/esm/reducers/ShippingAddressReducer.js +1 -1
- package/lib/esm/reducers/SkuListsReducer.js +1 -1
- package/lib/esm/reducers/SkuOptionsReducer.js +1 -1
- package/lib/esm/reducers/VariantReducer.js +1 -1
- package/lib/esm/typings/errors.js +1 -1
- package/lib/esm/typings/index.js +1 -1
- package/lib/esm/utils/addressesManager.js +1 -1
- package/lib/esm/utils/baseReducer.js +1 -1
- package/lib/esm/utils/browserInfo.js +1 -1
- package/lib/esm/utils/childrenTypes.js +1 -1
- package/lib/esm/utils/countryStateCity.js +1 -1
- package/lib/esm/utils/customMessages.js +1 -1
- package/lib/esm/utils/customerOrderOptions.js +1 -1
- package/lib/esm/utils/getAmount.js +1 -1
- package/lib/esm/utils/getCurrentItemKey.js +1 -1
- package/lib/esm/utils/getErrors.js +1 -1
- package/lib/esm/utils/getLineItemsCount.js +1 -1
- package/lib/esm/utils/getLoaderComponent.js +1 -1
- package/lib/esm/utils/getPrices.js +1 -1
- package/lib/esm/utils/getSdk.js +1 -1
- package/lib/esm/utils/getSkus.js +1 -1
- package/lib/esm/utils/isEmptyStates.js +1 -1
- package/lib/esm/utils/isJSON.js +1 -1
- package/lib/esm/utils/jwt.js +1 -1
- package/lib/esm/utils/localStorage.js +1 -1
- package/lib/esm/utils/organization.js +1 -1
- package/lib/esm/utils/paypalPayment.js +1 -1
- package/lib/esm/utils/promisify.js +1 -1
- package/lib/esm/utils/shipments.js +1 -1
- package/lib/esm/utils/validateFormFields.js +1 -1
- package/lib/tsconfig.prod.esm.tsbuildinfo +1 -1
- package/lib/tsconfig.prod.tsbuildinfo +1 -1
- package/package.json +17 -17
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__rest}from"tslib";import{jsx as
|
|
1
|
+
import{__rest as v}from"tslib";import{jsx as e}from"react/jsx-runtime";import{Fragment as c,useContext as x,useEffect as S}from"react";import V from"./utils/VariantTemplate";import j from"./utils/Parent";import P from"../context/VariantsContext";import r from"../config/components";const T=r.VariantSelector.propTypes,b=r.VariantSelector.defaultProps,N=r.VariantSelector.displayName,a=t=>{const{children:s,type:m,placeholder:u,skuCode:f,name:C,options:n}=t,h=v(t,["children","type","placeholder","skuCode","name","options"]),{setSkuCode:i,skuCode:g,loading:d,variants:l,setSkuCodes:o}=x(P);S(()=>(o&&o(n),()=>{o&&o([])}),[n]);const p=g||f||"",y=()=>d?e(c,{children:t.loader||"Loading..."},void 0):e(V,Object.assign({variants:l,type:m,placeholder:u,skuCode:p,options:n,handleChange:i,name:C},h),void 0),k=Object.assign({variants:l,loading:!!d,handleSelect:i,skuCode:p},t);return s?e(j,Object.assign({},k,{children:s}),void 0):e(c,{children:e(y,{},void 0)},void 0)};a.propTypes=T,a.defaultProps=b,a.displayName=N;export default a;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as I}from"react/jsx-runtime";import{useEffect as j,useReducer as S,useContext as C}from"react";import b,{variantInitialState as h,unsetVariantState as O,setSkuCode as L,getVariants as P}from"../reducers/VariantReducer";import R from"../context/CommerceLayerContext";import T from"../context/VariantsContext";import{setVariantSkuCodes as E}from"../reducers/VariantReducer";import{isEmpty as i,isEqual as N}from"lodash";import K from"../utils/getCurrentItemKey";import q from"../context/ItemContext";import m from"../config/components";const _=m.VariantsContainer.propTypes,w=m.VariantsContainer.defaultProps,z=m.VariantsContainer.displayName,o=f=>{const{children:l,skuCode:g="",filters:x={}}=f,r=C(R),{setItem:c,setItems:u,items:a,item:y,setCustomLineItems:n,skuCode:k}=C(q),[t,s]=S(b,h),d=K(y)||g||t.skuCode||k||"";j(()=>{if(!i(a)&&!i(t.variants)&&!N(a,t.variants)){const e=Object.assign(Object.assign({},a),t.variants);u&&u(e)}return t.skuCodes.length>=1&&r.accessToken&&(s({type:"setLoading",payload:{loading:!0}}),P({config:r,state:t,dispatch:s,setItem:c,skuCode:d,filters:x})),()=>O(s)},[r]);const V=Object.assign(Object.assign({},t),{skuCode:d,setSkuCode:(e,v,p={})=>{i(p)||n&&n({[e]:p}),L({code:e,id:v,config:r,setItem:c,dispatch:s})},setSkuCodes:e=>E({skuCodes:e,dispatch:s,setCustomLineItems:n})});return I(T.Provider,Object.assign({value:V},{children:l}),void 0)};o.propTypes=_,o.defaultProps=w,o.displayName=z;export default o;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__rest}from"tslib";import{jsx as
|
|
1
|
+
import{__rest as l}from"tslib";import{jsx as o}from"react/jsx-runtime";import d from"../context/PaymentMethodContext";import m from"lodash/isFunction";import{useContext as f,useEffect as y,useRef as p}from"react";const v="after placing the order, you will need to manually complete the payment with your bank",h=a=>{var{infoMessage:e}=a,s=l(a,["infoMessage"]);const t=p(null),{setPaymentSource:c,paymentSource:r,currentPaymentMethodType:n,setPaymentRef:i}=f(d);y(()=>(t.current&&r&&n&&(t.current.onsubmit=()=>u(),i({ref:t})),()=>{i({ref:{current:null}})}),[t,r,n]);const u=async()=>{if(r&&n)try{return await c({paymentSourceId:r.id,paymentResource:n,attributes:{metadata:{card:{id:r.id,brand:"wire-transfer",last4:""}}}}),!0}catch{return!1}return!1};return o("form",Object.assign({ref:t},{children:o("div",Object.assign({},s,{children:o("span",Object.assign({className:e==null?void 0:e.className},{children:m(e==null?void 0:e.text)?e==null?void 0:e.text():(e==null?void 0:e.text)||v}),void 0)}),void 0)}),void 0)};export default h;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__rest}from"tslib";import{jsx as
|
|
1
|
+
import{__rest as E}from"tslib";import{jsx as o,jsxs as A}from"react/jsx-runtime";import K from"../../context/CommerceLayerContext";import W from"../../context/CustomerContext";import G from"../../context/OrderContext";import L from"../../context/PaymentMethodChildrenContext";import N from"../../context/PaymentMethodContext";import R from"../../context/PaymentSourceContext";import{getPaymentConfig as q}from"../../reducers/PaymentMethodReducer";import c from"lodash/isEmpty";import{Fragment as F,useContext as n}from"react";import P from"../AdyenPayment";import I from"../utils/PaymentCardsTemplate";import z from"../../utils/jwt";export default function B(u){var i;const{readonly:s,showCard:y,handleEditClick:j,children:b,templateCustomerCards:C,show:D,loading:p,onClickCustomerCards:H,loaderComponent:v,templateCustomerSaveToWallet:w}=u,O=E(u,["readonly","showCard","handleEditClick","children","templateCustomerCards","show","loading","onClickCustomerCards","loaderComponent","templateCustomerSaveToWallet"]),{order:l}=n(G),{accessToken:k}=n(K),{payment:d}=n(L),{payments:r,isGuest:M}=n(W),{currentPaymentMethodId:S,config:f,paymentSource:e}=n(N),x="adyen_payments",h=l==null?void 0:l.language_code;if(!s&&(d==null?void 0:d.id)!==S)return null;const a=e==null?void 0:e.public_key,T=z(k).test?"test":"live",g=f?q(x,f):{};console.log("payments",r);const _=!c(r)&&r?r.filter(m=>{var t;return((t=m.payment_source)===null||t===void 0?void 0:t.type)==="adyen_payments"}):[];if(s||y){const m=(i=e==null?void 0:e.payment_request_data)===null||i===void 0?void 0:i.payment_method,t=Object.assign(Object.assign({},m),{showCard:y,handleEditClick:j,readonly:s});return c(m)?null:o(R.Provider,Object.assign({value:t},{children:b}),void 0)}return!M&&C?a&&!p&&(e==null?void 0:e.payment_methods)?A(F,{children:[c(_)?null:o("div",Object.assign({className:O.className},{children:o(I,Object.assign({},{paymentResource:x,customerPayments:_},{children:C}),void 0)}),void 0),o(P,{templateCustomerSaveToWallet:w,clientKey:a,locale:h,environment:T,config:g},void 0)]},void 0):v:a&&!p&&(e==null?void 0:e.payment_methods)?o(P,{clientKey:a,locale:h,config:g},void 0):v}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__rest}from"tslib";import{jsx as
|
|
1
|
+
import{__rest as w}from"tslib";import{jsx as o,jsxs as T}from"react/jsx-runtime";import _ from"../BraintreePayment";import E from"../../context/CustomerContext";import z from"../../context/OrderContext";import B from"../../context/PaymentMethodChildrenContext";import W from"../../context/PaymentMethodContext";import G from"../../context/PaymentSourceContext";import{getPaymentConfig as N}from"../../reducers/PaymentMethodReducer";import c from"lodash/isEmpty";import{Fragment as R,useContext as a}from"react";import F from"../utils/PaymentCardsTemplate";export default function I(u){var i;const{readonly:s,showCard:C,handleEditClick:j,children:b,templateCustomerCards:p,show:q,loading:v,onClickCustomerCards:A,loaderComponent:y,templateCustomerSaveToWallet:O}=u,M=w(u,["readonly","showCard","handleEditClick","children","templateCustomerCards","show","loading","onClickCustomerCards","loaderComponent","templateCustomerSaveToWallet"]),{order:m}=a(z),{payment:l}=a(B),{payments:d,isGuest:S}=a(E),{currentPaymentMethodId:k,config:h,paymentSource:t}=a(W),f="braintree_payments",x=m==null?void 0:m.language_code;if(!s&&(l==null?void 0:l.id)!==k)return null;const n=t==null?void 0:t.client_token,g=h?N(f,h):{},P=!c(d)&&d?d.filter(r=>{var e;return((e=r.payment_source)===null||e===void 0?void 0:e.type)==="braintree_payments"}):[];if(s||C){const r=(i=t==null?void 0:t.options)===null||i===void 0?void 0:i.card,e=Object.assign(Object.assign({},r),{showCard:C,handleEditClick:j,readonly:s});return c(r)?null:o(G.Provider,Object.assign({value:e},{children:b}),void 0)}return!S&&p?n&&!v?T(R,{children:[c(P)?null:o("div",Object.assign({className:M.className},{children:o(F,Object.assign({},{paymentResource:f,customerPayments:P},{children:p}),void 0)}),void 0),o(_,{templateCustomerSaveToWallet:O,authorization:n,locale:x,config:g},void 0)]},void 0):y:n&&!v?o(_,{locale:x,authorization:n,config:g},void 0):y}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__rest}from"tslib";import{jsx as
|
|
1
|
+
import{__rest as h}from"tslib";import{jsx as s}from"react/jsx-runtime";import P from"../PaypalPayment";import x from"../../context/PaymentMethodChildrenContext";import g from"../../context/PaymentMethodContext";import M from"../../context/PaymentSourceContext";import{getPaymentConfig as j}from"../../reducers/PaymentMethodReducer";import b from"lodash/isEmpty";import{useContext as c}from"react";export default function _(i){var e,o;const{readonly:n,showCard:d,handleEditClick:u,children:p,templateCustomerCards:w,show:S,loading:k,onClickCustomerCards:E,loaderComponent:O,templateCustomerSaveToWallet:R}=i,C=h(i,["readonly","showCard","handleEditClick","children","templateCustomerCards","show","loading","onClickCustomerCards","loaderComponent","templateCustomerSaveToWallet"]),{payment:a}=c(x),{currentPaymentMethodId:y,config:l,paymentSource:t}=c(g),v="paypal_payments";if(!n&&(a==null?void 0:a.id)!==y)return null;if(n||d){const m=((e=t==null?void 0:t.options)===null||e===void 0?void 0:e.card)||((o=t==null?void 0:t.metadata)===null||o===void 0?void 0:o.card),f=Object.assign(Object.assign({},m),{showCard:d,handleEditClick:u,readonly:n});return b(m)?null:s(M.Provider,Object.assign({value:f},{children:p}),void 0)}const r=l&&j(v,l);return s(P,Object.assign({},C,{infoMessage:r==null?void 0:r.infoMessage}),void 0)}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__rest}from"tslib";import{jsx as
|
|
1
|
+
import{__rest as T}from"tslib";import{jsx as o,jsxs as E}from"react/jsx-runtime";import g from"../StripePayment";import K from"../../context/CustomerContext";import W from"../../context/OrderContext";import G from"../../context/PaymentMethodChildrenContext";import N from"../../context/PaymentMethodContext";import R from"../../context/PaymentSourceContext";import{getPaymentConfig as F}from"../../reducers/PaymentMethodReducer";import c from"lodash/isEmpty";import{Fragment as I,useContext as r}from"react";import q from"../utils/PaymentCardsTemplate";export default function z(u){var a;const{readonly:s,showCard:p,handleEditClick:P,children:j,templateCustomerCards:C,show:y,loading:_,onClickCustomerCards:A,loaderComponent:O,templateCustomerSaveToWallet:S}=u,w=T(u,["readonly","showCard","handleEditClick","children","templateCustomerCards","show","loading","onClickCustomerCards","loaderComponent","templateCustomerSaveToWallet"]),{order:i}=r(W),{payment:l}=r(G),{payments:m,isGuest:M}=r(K),{currentPaymentMethodId:k,config:h,paymentSource:e}=r(N),v="stripe_payments",x=i==null?void 0:i.language_code;if(!s&&(l==null?void 0:l.id)!==k)return null;const d=e==null?void 0:e.publishable_key,f=h?F(v,h):{},b=!c(m)&&m?m.filter(n=>{var t;return((t=n.payment_source)===null||t===void 0?void 0:t.type)==="stripe_payments"}):[];if(s||p){const n=(a=e==null?void 0:e.options)===null||a===void 0?void 0:a.card,t=Object.assign(Object.assign({},n),{showCard:p,handleEditClick:P,readonly:s});return c(n)?null:o(R.Provider,Object.assign({value:t},{children:j}),void 0)}return!M&&C?E(I,{children:[c(b)?null:o("div",Object.assign({className:w.className},{children:o(q,Object.assign({},{paymentResource:v,customerPayments:b},{children:C}),void 0)}),void 0),o(g,Object.assign({show:y,templateCustomerSaveToWallet:S,publishableKey:d,locale:x},f),void 0)]},void 0):d&&!_?o(g,Object.assign({show:y,publishableKey:d,locale:x},f),void 0):O}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__rest}from"tslib";import{jsx as
|
|
1
|
+
import{__rest as v}from"tslib";import{jsx as l}from"react/jsx-runtime";import x from"../WireTransferPayment";import P from"../../context/PaymentMethodChildrenContext";import g from"../../context/PaymentMethodContext";import j from"../../context/PaymentSourceContext";import{getPaymentConfig as w}from"../../reducers/PaymentMethodReducer";import b from"lodash/isEmpty";import{useContext as c}from"react";export default function M(a){var t,o;const{readonly:r,showCard:i,handleEditClick:u,children:C,templateCustomerCards:T,show:_,loading:S,onClickCustomerCards:W,loaderComponent:k,templateCustomerSaveToWallet:E}=a,f=v(a,["readonly","showCard","handleEditClick","children","templateCustomerCards","show","loading","onClickCustomerCards","loaderComponent","templateCustomerSaveToWallet"]),{payment:n}=c(P),{currentPaymentMethodId:p,config:d,paymentSource:e}=c(g),m="wire_transfers";if(!r&&(n==null?void 0:n.id)!==p)return null;if(r||i){const s=((t=e==null?void 0:e.options)===null||t===void 0?void 0:t.card)||((o=e==null?void 0:e.metadata)===null||o===void 0?void 0:o.card),h=Object.assign(Object.assign({},s),{showCard:i,handleEditClick:u,readonly:r});return b(s)?null:l(j.Provider,Object.assign({value:h},{children:C}),void 0)}const y=d&&m?w(m,d):{};return l(x,Object.assign({},f,y),void 0)}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as h}from"react/jsx-runtime";import j from"../utils/Parent";import{useContext as v}from"react";import b from"../../context/AddressChildrenContext";import P from"../../context/ShippingAddressContext";export default function S({customerAddresses:o,children:d,deselect:i,countryLock:t,selected:c,selectedClassName:l,className:s,disabledClassName:a,handleSelect:m}){const{setShippingAddress:p}=v(P),C={customerAddresses:o.map((e,r)=>{const u=e,n=p&&t&&t!==e.country_code||!1,x=c===r?`${s} ${i?"":l}`:s,f=n?`${s} ${a}`:x,A=(e==null?void 0:e.reference)||"",g=()=>m(r,e.id,A,n);return Object.assign(Object.assign({},u),{className:f,onClick:g})}),AddressProvider:b.Provider};return h(j,Object.assign({},C,{children:d}),void 0)}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__rest}from"tslib";import{jsx as
|
|
1
|
+
import{__rest as d}from"tslib";import{jsx as a}from"react/jsx-runtime";import m from"../../context/OrderContext";import{useContext as f,useEffect as p,useState as u}from"react";import l from"./Parent";const x=e=>{var{children:r,attribute:i}=e,n=d(e,["children","attribute"]);const{order:t}=f(m),[o,s]=u("");p(()=>(t&&i in t&&s(t[i]),()=>{s("")}),[t]);const c=Object.assign({attribute:o},n);return r?a(l,Object.assign({},c,{children:r}),void 0):a("span",Object.assign({},n,{children:o}),void 0)};export default x;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__rest}from"tslib";import{jsx as
|
|
1
|
+
import{__rest as o}from"tslib";import{jsx as r}from"react/jsx-runtime";import s from"react";import c from"./Parent";const m=(t,i)=>{const{children:a}=t,e=o(t,["children"]),n=t.type==="textarea"?r("textarea",Object.assign({ref:i},e),void 0):r("input",Object.assign({ref:i},e),void 0);return a?r(c,Object.assign({},e,{children:a}),void 0):n};export default s.forwardRef(m);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__rest}from"tslib";import{jsx as
|
|
1
|
+
import{__rest as O}from"tslib";import{jsx as m}from"react/jsx-runtime";import P from"../../context/OrderContext";import p from"../../utils/getAmount";import g from"./Parent";import{useState as a,useEffect as y,useContext as h}from"react";import{baseOrderPricePropTypes as C}from"../../typings/index";import{isEmpty as _}from"lodash";const f=e=>{const{format:d="formatted",base:r,type:o,children:s}=e,n=O(e,["format","base","type","children"]),{order:t}=h(P),[i,c]=a(""),[u,b]=a(0);y(()=>{const j=p({base:r,type:o,format:d,obj:t||{}}),l=p({base:r,type:o,format:"cents",obj:t||{}});return c(j),b(l),()=>{_(t)&&c("")}},[t]);const x=Object.assign({priceCents:u,price:i},n);return s?m(g,Object.assign({},x,{children:s}),void 0):m("span",Object.assign({},n,{children:i}),void 0)};f.propTypes=C;export default f;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__rest}from"tslib";import{jsx as
|
|
1
|
+
import{__rest as s}from"tslib";import{jsx as o}from"react/jsx-runtime";import h from"react";import b from"./Parent";import{findIndex as j}from"lodash";const v=(r,n)=>{const{options:e=[],children:a,placeholder:t={label:"Select an option",value:""},value:c=""}=r,i=s(r,["options","children","placeholder","value"]);j(e,t)===-1?e.unshift(t):e[0]=t;const p=e.map((l,f)=>{const{label:m}=l,u=s(l,["label"]);return o("option",Object.assign({},u,{children:m}),f)}),d=Object.assign({options:e,ref:n},i);return a?o(b,Object.assign({},d,{children:a}),void 0):o("select",Object.assign({ref:n,defaultValue:c},i,{children:p}),void 0)};export default h.forwardRef(v);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as o}from"react/jsx-runtime";import s from"prop-types";const n={children:s.func},e=r=>{const t=r.children;return t?o(t,Object.assign({},r),void 0):null};e.propTypes=n;export default e;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as x}from"react/jsx-runtime";import _ from"../utils/Parent";import{useContext as f}from"react";import y from"../../context/PaymentMethodContext";import C from"../../context/PaymentSourceContext";export default function j({customerPayments:d,children:r,paymentResource:l}){const{setPaymentSource:s}=f(y),c={customerPayments:d.map(t=>{var o,e,n,i,a;const v=t,p=((o=t==null?void 0:t.payment_source.options)===null||o===void 0?void 0:o.card)||((n=(e=t==null?void 0:t.payment_source)===null||e===void 0?void 0:e.payment_request_data)===null||n===void 0?void 0:n.paymentMethod)||((a=(i=t==null?void 0:t.payment_source)===null||i===void 0?void 0:i.metadata)===null||a===void 0?void 0:a.card),u=async m=>{m.stopPropagation(),await s({paymentResource:l,customerPaymentSourceId:t.id})};return Object.assign(Object.assign({},v),{card:p,handleClick:u})}),PaymentSourceProvider:C.Provider};return x(_,Object.assign({},c,{children:r}),void 0)}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__rest}from"tslib";import{jsx as
|
|
1
|
+
import{__rest as c}from"tslib";import{jsx as s,jsxs as i}from"react/jsx-runtime";import{Fragment as f}from"react";import r from"prop-types";const l={formattedAmount:r.string,formattedCompare:r.string},u={formattedAmount:"",formattedCompare:""},e=o=>{const{showCompare:a,formattedCompare:m,compareClassName:p,className:n,formattedAmount:d,skuCode:C}=o,t=c(o,["showCompare","formattedCompare","compareClassName","className","formattedAmount","skuCode"]);return i(f,{children:[s("span",Object.assign({className:n},t,{children:d}),void 0),a&&s("span",Object.assign({className:p||""},t,{children:m}),void 0)]},void 0)};e.propTypes=l,e.defaultProps=u;export default e;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__rest}from"tslib";import{jsx as
|
|
1
|
+
import{__rest as x}from"tslib";import{jsx as d,jsxs as y}from"react/jsx-runtime";import{Fragment as C}from"react";import{keys as v}from"lodash";import e from"prop-types";export const propTypes={variants:e.any.isRequired,onChange:e.func,options:e.arrayOf(e.shape({label:e.string.isRequired,code:e.string.isRequired,lineItem:e.shape({name:e.string.isRequired,imageUrl:e.string})}).isRequired).isRequired,name:e.string,children:e.func,type:e.oneOf(["select","radio"]),loader:e.element,placeholder:e.string,skuCode:e.string};const j=u=>{const{id:l,variants:a,type:g,placeholder:k,options:h,skuCode:c,handleChange:n,handleCallback:r}=u,m=x(u,["id","variants","type","placeholder","options","skuCode","handleChange","handleCallback"]),b=v(a).map((t,i)=>{const o=c===t,s=h.length>0?h[i].label:a[t].name;return g==="select"?d("option",Object.assign({"data-sku-id":a[t].id,"data-label":s,value:a[t].code},{children:s}),a[t].id):y(C,{children:[d("input",Object.assign({id:l&&`${l}-${i}`,defaultChecked:o,type:"radio",value:a[t].code,onChange:p=>{const f=p.target.value;n&&n(f,a[t].id),r&&r({code:f,label:s})}},m),void 0),s]},a[t].id)});return g==="select"?y("select",Object.assign({id:l,title:"Variant selector",onChange:t=>{const i=t.target.value,o=t.target.selectedIndex,s=t.target[o].dataset.skuId,p=t.target[o].dataset.label;n&&n(i,s),r&&r({code:i,label:p})},value:c||""},m,{children:[d("option",Object.assign({disabled:!!c},{children:k}),void 0),b]}),void 0):d(C,{children:b},void 0)};j.propTypes=propTypes;export default j;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as l}from"react/jsx-runtime";import f from"../../utils/customMessages";const g=u=>{const{allErrors:m,messages:d,field:r,props:t,lineItem:a,resource:c,returnHtml:i=!0}=u;return m.map((e,n)=>{const o=f(d,e),s=(o==null?void 0:o.message)||e.message||`${e.title} - ${e.detail}`;if(r){if(e.resource==="line_items"&&a&&e.id===a.id)return i?l("span",Object.assign({},t,{children:s}),n):s;if(r===e.field&&c===e.resource)return i?l("span",Object.assign({},t,{children:s}),n):s}if(c===e.resource&&!r)return i?l("span",Object.assign({},t,{children:s}),n):s})};export default g;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import PropTypes from"prop-types";import childrenTypes from"../utils/childrenTypes";import{baseOrderComponentPricePropTypes,PTLoader,BMObject}from"../typings/index";import{ErrorPropTypes}from"../typings/errors";import{BaseInputComponentPropTypes}from"../typings/index";const components={Address:{permittedChildren:["AddressField","ReactNode"],displayName:"Address",propTypes:{children:childrenTypes.isRequired}},AddressCountrySelector:{displayName:"AddressCountrySelector",propTypes:{children:PropTypes.func,placeholder:PropTypes.shape({label:PropTypes.string.isRequired,value:PropTypes.oneOfType([PropTypes.string,PropTypes.number]).isRequired}),value:PropTypes.string,name:PropTypes.oneOf(["billing_address_country_code","shipping_address_country_code"]).isRequired,required:PropTypes.bool},defaultProps:{required:true}},AddressStateSelector:{displayName:"AddressStateSelector",propTypes:{children:PropTypes.func,placeholder:PropTypes.shape({label:PropTypes.string.isRequired,value:PropTypes.oneOfType([PropTypes.string,PropTypes.number]).isRequired}),value:PropTypes.string,name:PropTypes.oneOf(["billing_address_state_code","shipping_address_state_code"]).isRequired,required:PropTypes.bool},defaultProps:{required:true}},AddressField:{displayName:"AddressField",propTypes:{children:PropTypes.func}},AddressInput:{displayName:"AddressInput",propTypes:{children:PropTypes.func,name:PropTypes.oneOf(["billing_address_city","billing_address_company","billing_address_email","billing_address_first_name","billing_address_last_name","billing_address_line_1","billing_address_line_2","billing_address_phone","billing_address_state_code","billing_address_zip_code","billing_address_billing_info","billing_address_save_to_customer_book","shipping_address_city","shipping_address_company","shipping_address_email","shipping_address_first_name","shipping_address_last_name","shipping_address_line_1","shipping_address_line_2","shipping_address_phone","shipping_address_state_code","shipping_address_zip_code","shipping_address_save_to_customer_book"]).isRequired,type:PropTypes.oneOf(["checkbox","date","email","number","tel","text","textarea"]).isRequired,placeholder:PropTypes.string,disabled:PropTypes.bool,required:PropTypes.bool},defaultProps:{required:true}},AddToCartButton:{displayName:"AddToCartButton",propTypes:{children:PropTypes.func,label:PropTypes.oneOfType([PropTypes.string,PropTypes.element]),skuCode:PropTypes.string,disabled:PropTypes.bool,lineItem:PropTypes.shape({name:PropTypes.string.isRequired,imageUrl:PropTypes.string})},defaultProps:{label:"Add to cart"}},AddressesContainer:{displayName:"AddressesContainer",permittedChildren:["BillingAddressForm","BillingAddressContainer","ShippingAddressForm","ShippingAddressContainer","SaveAddressesButton","ReactNode"],propTypes:{children:childrenTypes.isRequired,shipToDifferentAddress:PropTypes.bool}},AvailabilityContainer:{displayName:"AvailabilityContainer",permittedChildren:["AvailabilityTemplate","ReactNode"],propTypes:{children:childrenTypes.isRequired,skuCode:PropTypes.string}},AvailabilityTemplate:{displayName:"AvailabilityTemplate",propTypes:{timeFormat:PropTypes.oneOf(["days","hours"]),showShippingMethodName:PropTypes.bool,children:PropTypes.func},defaultProps:{timeFormat:"days",showShippingMethodName:false}},BillingAddressContainer:{permittedChildren:["Address","ReactNode"],propTypes:{children:childrenTypes.isRequired}},BillingAddressForm:{permittedChildren:["AddressInput","ReactNode"],propTypes:{children:childrenTypes.isRequired}},CheckoutLink:{displayName:"CheckoutLink",propTypes:{children:PropTypes.func,label:PropTypes.string},defaultProps:{label:"Checkout"}},CommerceLayer:{permittedChildren:["OrderContainer","OrderStorage","PricesContainer","GiftCardContainer","ReactNode"],propTypes:{children:childrenTypes.isRequired,accessToken:PropTypes.string.isRequired,endpoint:PropTypes.string.isRequired}},CustomerContainer:{displayName:"CustomerContainer",permittedChildren:["CustomerInput","SaveCustomerButton","AddressesContainer","PaymentMethodsContainer","ReactNode"],propTypes:{children:childrenTypes.isRequired,isGuest:PropTypes.bool}},CustomerInput:{displayName:"CustomerInput",propTypes:{children:PropTypes.func,name:PropTypes.oneOf(["customerEmail"]),type:PropTypes.oneOf(["email"]),placeholder:PropTypes.string,disabled:PropTypes.bool,required:PropTypes.bool,saveOnBlur:PropTypes.bool},defaultProps:{required:true}},DeliveryLeadTime:{displayName:"DeliveryLeadTime",propTypes:{type:PropTypes.oneOf(["max_days","max_hours","min_days","min_hours"]).isRequired,children:PropTypes.func}},DiscountAmount:{displayName:"DiscountAmount",propTypes:baseOrderComponentPricePropTypes,defaultProps:{format:"formatted"}},Errors:{displayName:"Errors",propTypes:ErrorPropTypes,defaultProps:{messages:[],field:"base"}},ExternalFunction:{displayName:"ExternalFunction",permittedChildren:["AddToCartButton","ReactNode"],propTypes:{children:childrenTypes.isRequired,url:PropTypes.string.isRequired}},GiftCard:{permittedChildren:["GiftCardCurrencySelector","GiftCardInput","Errors","MetadataInput","SubmitButton","ReactNode"],displayName:"GiftCard",propTypes:{children:childrenTypes.isRequired,onSubmit:PropTypes.func},defaultProps:{onSubmit:undefined}},GiftCardAmount:{displayName:"GiftCardAmount",propTypes:baseOrderComponentPricePropTypes},GiftCardContainer:{permittedChildren:["GiftCard","Errors","ReactNode"],displayName:"GiftCardContainer",propTypes:{children:childrenTypes.isRequired}},GiftCardCurrencySelector:{displayName:"GiftCardCurrencySelector",propTypes:{children:PropTypes.func,placeholder:PropTypes.shape({value:PropTypes.oneOfType([PropTypes.string,PropTypes.number]).isRequired,label:PropTypes.string.isRequired}),value:PropTypes.string,required:PropTypes.bool},defaultProps:{required:true}},GiftCardInput:{displayName:"GiftCardInput",propTypes:{type:PropTypes.oneOf(["text","email","number","date","checkbox"]).isRequired,name:PropTypes.oneOf(["balanceCents","balanceMaxCents","singleUse","rechargeable","imageUrl","expiresAt","referenceOrigin","email","firstName","lastName","reference"]).isRequired,children:PropTypes.func,placeholder:PropTypes.string}},GiftCardOrCouponForm:{permittedChildren:["GiftCardOrCouponInput","GiftCardOrCouponSubmit","ReactNode"],propTypes:{children:childrenTypes.isRequired}},GiftCardOrCouponInput:{displayName:"GiftCardOrCouponInput",propTypes:{children:PropTypes.func,placeholder:PropTypes.string,disabled:PropTypes.bool,required:PropTypes.bool}},GiftCardOrCouponSubmit:{displayName:"GiftCardOrCouponSubmit",propTypes:{children:PropTypes.func,label:PropTypes.oneOfType([PropTypes.string,PropTypes.object])}},GiftCardOrCouponCode:{displayName:"GiftCardOrCouponCode",propTypes:{children:PropTypes.func,type:PropTypes.oneOf(["coupon","gift_card"])}},GiftCardOrCouponRemoveButton:{displayName:"GiftCardOrCouponRemoveButton",propTypes:{children:PropTypes.func,type:PropTypes.oneOf(["coupon","gift_card"]),label:PropTypes.oneOfType([PropTypes.string,PropTypes.object])}},ItemContainer:{permittedChildren:["PricesContainer","VariantsContainer","SkuOptionContainer","QuantitySelector","AddToCartButton","AvailabilityContainer","SkuListsContainer","ReactNode"],displayName:"ItemContainer",propTypes:{children:childrenTypes.isRequired,skuCode:PropTypes.string,lineItem:PropTypes.shape({name:PropTypes.string.isRequired,imageUrl:PropTypes.string})}},LineItem:{permittedChildren:["AvailabilityContainer","LineItemImage","LineItemName","LineItemOptions","LineItemQuantity","LineItemAmount","LineItemRemoveLink","StockTransfer","Errors","ReactNode"],displayName:"LineItem",propTypes:{children:childrenTypes.isRequired,type:PropTypes.oneOf(["skus","gift_cards","shipments","payment_methods","promotions","adjustments","bundles"])},defaultProps:{type:"skus"}},LineItemAmount:{displayName:"LineItemAmount",propTypes:Object.assign(Object.assign({},baseOrderComponentPricePropTypes),{type:PropTypes.oneOf(["total","unit","option"])}),defaultProps:{format:"formatted",type:"total"}},LineItemImage:{displayName:"LineItemImage",propTypes:{width:PropTypes.number,children:PropTypes.func}},LineItemName:{displayName:"LineItemName",propTypes:{children:PropTypes.func}},LineItemCode:{displayName:"LineItemCode",propTypes:{children:PropTypes.func}},LineItemOption:{displayName:"LineItemOption",propTypes:{name:PropTypes.string,children:PropTypes.func,valueClassName:PropTypes.string,className:PropTypes.string,id:PropTypes.string,style:PropTypes.object}},LineItemOptions:{permittedChildren:["LineItemOption","ReactNode"],displayName:"LineItemOptions",propTypes:{children:childrenTypes.isRequired,title:PropTypes.string,showName:PropTypes.bool,skuOptionId:PropTypes.string}},LineItemQuantity:{displayName:"LineItemQuantity",propTypes:{children:PropTypes.func,max:PropTypes.number,disabled:PropTypes.bool,readonly:PropTypes.bool},defaultProps:{max:50}},LineItemRemoveLink:{displayName:"LineItemRemoveLink",propTypes:{children:PropTypes.func,label:PropTypes.string},defaultProps:{label:"Remove"}},LineItemsContainer:{permittedChildren:["LineItemsCount","LineItem","ReactNode"],displayName:"LineItemsContainer",propTypes:{children:childrenTypes.isRequired,filters:PropTypes.object,loader:PTLoader},defaultProps:{filters:{},loader:"Loading..."}},LineItemsCount:{displayName:"LineItemsCount",propTypes:{children:PropTypes.func,id:PropTypes.string,className:PropTypes.string,name:PropTypes.string,style:PropTypes.object}},MetadataInput:{displayName:"MetadataInput",propTypes:BaseInputComponentPropTypes},OrderContainer:{permittedChildren:["AddressesContainer","CustomerContainer","ItemContainer","LineItemsContainer","SubTotalAmount","DiscountAmount","ShippingAmount","TaxesAmount","GiftCardAmount","TotalAmount","CheckoutLink","GiftCardContainer","ShipmentsContainer","PaymentMethodsContainer","PaymentMethodAmount","GiftCardOrCouponForm","GiftCardOrCouponCode","GiftCardOrCouponRemoveButton","Errors","OrderNumber","ReactNode"],displayName:"OrderContainer",propTypes:{children:childrenTypes.isRequired,orderId:PropTypes.string,metadata:BMObject,attributes:PropTypes.object},defaultProps:{metadata:{}}},OrderNumber:{displayName:"OrderNumber",propTypes:{className:PropTypes.string},defaultProps:{format:"formatted"}},OrderStorage:{permittedChildren:["OrderContainer","ReactNode"],displayName:"OrderStorage",propTypes:{children:childrenTypes.isRequired,clearWhenPlaced:PropTypes.bool,persistKey:PropTypes.string.isRequired}},PaymentMethod:{permittedChildren:["PaymentMethodName","PaymentMethodRadioButton","PaymentMethodPrice","PaymentSource","ReactNode","Errors"],displayName:"PaymentMethod",propTypes:{children:childrenTypes.isRequired}},PaymentMethodAmount:{displayName:"PaymentMethodAmount",propTypes:baseOrderComponentPricePropTypes,defaultProps:{format:"formatted"}},PaymentMethodName:{displayName:"PaymentMethodName",propTypes:{children:PropTypes.func}},PaymentMethodPrice:{displayName:"PaymentMethodPrice",propTypes:Object.assign(Object.assign({},baseOrderComponentPricePropTypes),{type:PropTypes.oneOf(["amount"])})},PaymentMethodRadioButton:{displayName:"PaymentMethodRadioButton",propTypes:{children:PropTypes.func}},PaymentMethodsContainer:{displayName:"PaymentMethodsContainer",permittedChildren:["PaymentSource","ReactNode","PlaceOrderContainer"],propTypes:{children:childrenTypes.isRequired}},PaymentSource:{displayName:"PaymentSource",permittedChildren:["PaymentSourceBrandIcon","PaymentSourceBrandName","PaymentSourceEditButton","PaymentSourceDetail","ReactNode"],propTypes:{children:childrenTypes,readonly:PropTypes.bool}},PaymentSourceBrandIcon:{displayName:"PaymentSourceBrandIcon",propTypes:{children:PropTypes.func,width:PropTypes.number,height:PropTypes.number,src:PropTypes.string,className:PropTypes.string}},PaymentSourceBrandName:{displayName:"PaymentSourceBrandName",propTypes:{children:PropTypes.func,label:PropTypes.string}},PaymentSourceEditButton:{displayName:"PaymentSourceEditButton",propTypes:{children:PropTypes.func,label:PropTypes.oneOfType([PropTypes.string,PropTypes.element])}},PaymentSourceDetail:{displayName:"PaymentSourceDetail",propTypes:{type:PropTypes.oneOf(["last4","expYear","expMonth"]).isRequired}},PlaceOrderButton:{displayName:"PlaceOrderButton",propTypes:{children:PropTypes.func,label:PropTypes.oneOfType([PropTypes.string,PropTypes.element])},defaultProps:{label:"Place order"}},PlaceOrderContainer:{displayName:"PlaceOrderContainer",permittedChildren:["PaymentMethod","PlaceOrderButton","PrivacyAndTermsCheckbox","ReactNode"],propTypes:{children:childrenTypes.isRequired}},Price:{displayName:"Price",propTypes:{children:PropTypes.func,compareClassName:PropTypes.string,skuCode:PropTypes.string,showCompare:PropTypes.bool},defaultProps:{skuCode:""}},PricesContainer:{permittedChildren:["Price","ReactNode"],displayName:"PricesContainer",propTypes:{children:childrenTypes.isRequired,skuCode:PropTypes.string,loader:PTLoader,perPage:PropTypes.number,filters:PropTypes.object},defaultProps:{perPage:10,filters:{},loader:"Loading...",skuCode:""}},PrivacyAndTermsCheckbox:{displayName:"PrivacyAndTermsCheckbox",propTypes:{children:PropTypes.func}},QuantitySelector:{displayName:"QuantitySelector",propTypes:{children:PropTypes.func,min:PropTypes.number,max:PropTypes.number,value:PropTypes.string,skuCode:PropTypes.string,disabled:PropTypes.bool},defaultProps:{min:1}},SaveAddressesButton:{displayName:"SaveAddressesButton",propTypes:{children:PropTypes.func,label:PropTypes.oneOfType([PropTypes.string,PropTypes.element]),onClick:PropTypes.func,disabled:PropTypes.bool},defaultProps:{label:"Continue to delivery"}},Shipment:{permittedChildren:["LineItemsContainer","LineItem","ShippingMethod","ReactNode"],displayName:"Shipment",propTypes:{children:childrenTypes.isRequired}},ShipmentField:{displayName:"ShipmentField",propTypes:{children:PropTypes.func,name:PropTypes.oneOf(["cost_amount_cents","cost_amount_float","currency_code","formatted_cost_amount","number","status","key_number"]).isRequired}},ShipmentsContainer:{displayName:"ShipmentsContainer",permittedChildren:["Shipment","ReactNode"],propTypes:{children:childrenTypes.isRequired}},ShippingAddressContainer:{permittedChildren:["Address","ReactNode"],propTypes:{children:childrenTypes.isRequired}},SaveCustomerButton:{displayName:"SaveCustomerButton",propTypes:{children:PropTypes.func,label:PropTypes.oneOfType([PropTypes.string,PropTypes.element]),onClick:PropTypes.func},defaultProps:{label:"Save"}},ShippingAddressForm:{permittedChildren:["AddressInput","ReactNode"],propTypes:{children:childrenTypes.isRequired}},ShippingAmount:{displayName:"ShippingAmount",propTypes:baseOrderComponentPricePropTypes},ShippingMethod:{permittedChildren:["ShippingMethodName","ShippingMethodPrice","ShippingMethodRadioButton","DeliveryLeadTime","ReactNode"],displayName:"ShippingMethod",propTypes:{children:childrenTypes.isRequired,readonly:PropTypes.bool}},ShippingMethodName:{displayName:"ShippingMethodName",propTypes:{children:PropTypes.func}},ShippingMethodRadioButton:{displayName:"ShippingMethodRadioButton",propTypes:{children:PropTypes.func}},ShippingMethodPrice:{displayName:"ShippingMethodPrice",propTypes:Object.assign(Object.assign({},baseOrderComponentPricePropTypes),{type:PropTypes.oneOf(["amount"])}),defaultProps:{format:"formatted",type:"amount"}},SkuList:{permittedChildren:["AddToCartButton","QuantitySelector","ReactNode"],displayName:"SkuList",propTypes:{children:childrenTypes.isRequired,id:PropTypes.string.isRequired}},SkuListsContainer:{permittedChildren:["SkuList","ReactNode"],displayName:"SkuListsContainer",propTypes:{children:childrenTypes.isRequired}},SkuOption:{permittedChildren:["SkuOptionInput","ReactNode"],displayName:"SkuOption",propTypes:{children:childrenTypes.isRequired,id:PropTypes.string.isRequired}},SkuOptionInput:{displayName:"SkuOptionInput",propTypes:BaseInputComponentPropTypes},SkuOptionsContainer:{permittedChildren:["SkuOption","ReactNode"],displayName:"SkuOptionsContainer",propTypes:{children:childrenTypes.isRequired,skuCode:PropTypes.string}},StockTransfer:{permittedChildren:["StockTransferField","ReactNode"],displayName:"StockTransfer",propTypes:{children:childrenTypes.isRequired}},StockTransferField:{displayName:"StockTransferField",propTypes:{children:PropTypes.func,type:PropTypes.oneOf(["quantity","sku_code"]).isRequired}},SubmitButton:{displayName:"SubmitButton",propTypes:{children:PropTypes.func,label:PropTypes.oneOfType([PropTypes.string,PropTypes.element])},defaultProps:{label:"Submit"}},SubTotalAmount:{displayName:"SubTotalAmount",propTypes:baseOrderComponentPricePropTypes,defaultProps:{format:"formatted"}},TaxesAmount:{displayName:"TaxesAmount",propTypes:baseOrderComponentPricePropTypes,defaultProps:{format:"formatted"}},TotalAmount:{displayName:"TotalAmount",propTypes:baseOrderComponentPricePropTypes,defaultProps:{format:"formatted"}},VariantsContainer:{permittedChildren:["VariantSelector","ReactNode"],displayName:"VariantsContainer",propTypes:{children:childrenTypes.isRequired,skuCode:PropTypes.string,filters:PropTypes.object},defaultProps:{skuCode:"",filters:{}}},VariantSelector:{displayName:"VariantSelector",propTypes:{options:PropTypes.arrayOf(PropTypes.shape({label:PropTypes.string.isRequired,code:PropTypes.string.isRequired,lineItem:PropTypes.shape({name:PropTypes.string.isRequired,imageUrl:PropTypes.string})}).isRequired).isRequired,name:PropTypes.string,children:PropTypes.func,type:PropTypes.oneOf(["select","radio"]),loader:PropTypes.element,placeholder:PropTypes.string,skuCode:PropTypes.string},defaultProps:{placeholder:"Select a variant",type:"select"}}};export default components;
|
|
1
|
+
import e from"prop-types";import i from"../utils/childrenTypes";import{baseOrderComponentPricePropTypes as r,PTLoader as t,BMObject as a}from"../typings/index";import{ErrorPropTypes as d}from"../typings/errors";import{BaseInputComponentPropTypes as n}from"../typings/index";const o={Address:{permittedChildren:["AddressField","ReactNode"],displayName:"Address",propTypes:{children:i.isRequired}},AddressCountrySelector:{displayName:"AddressCountrySelector",propTypes:{children:e.func,placeholder:e.shape({label:e.string.isRequired,value:e.oneOfType([e.string,e.number]).isRequired}),value:e.string,name:e.oneOf(["billing_address_country_code","shipping_address_country_code"]).isRequired,required:e.bool},defaultProps:{required:!0}},AddressStateSelector:{displayName:"AddressStateSelector",propTypes:{children:e.func,placeholder:e.shape({label:e.string.isRequired,value:e.oneOfType([e.string,e.number]).isRequired}),value:e.string,name:e.oneOf(["billing_address_state_code","shipping_address_state_code"]).isRequired,required:e.bool},defaultProps:{required:!0}},AddressField:{displayName:"AddressField",propTypes:{children:e.func}},AddressInput:{displayName:"AddressInput",propTypes:{children:e.func,name:e.oneOf(["billing_address_city","billing_address_company","billing_address_email","billing_address_first_name","billing_address_last_name","billing_address_line_1","billing_address_line_2","billing_address_phone","billing_address_state_code","billing_address_zip_code","billing_address_billing_info","billing_address_save_to_customer_book","shipping_address_city","shipping_address_company","shipping_address_email","shipping_address_first_name","shipping_address_last_name","shipping_address_line_1","shipping_address_line_2","shipping_address_phone","shipping_address_state_code","shipping_address_zip_code","shipping_address_save_to_customer_book"]).isRequired,type:e.oneOf(["checkbox","date","email","number","tel","text","textarea"]).isRequired,placeholder:e.string,disabled:e.bool,required:e.bool},defaultProps:{required:!0}},AddToCartButton:{displayName:"AddToCartButton",propTypes:{children:e.func,label:e.oneOfType([e.string,e.element]),skuCode:e.string,disabled:e.bool,lineItem:e.shape({name:e.string.isRequired,imageUrl:e.string})},defaultProps:{label:"Add to cart"}},AddressesContainer:{displayName:"AddressesContainer",permittedChildren:["BillingAddressForm","BillingAddressContainer","ShippingAddressForm","ShippingAddressContainer","SaveAddressesButton","ReactNode"],propTypes:{children:i.isRequired,shipToDifferentAddress:e.bool}},AvailabilityContainer:{displayName:"AvailabilityContainer",permittedChildren:["AvailabilityTemplate","ReactNode"],propTypes:{children:i.isRequired,skuCode:e.string}},AvailabilityTemplate:{displayName:"AvailabilityTemplate",propTypes:{timeFormat:e.oneOf(["days","hours"]),showShippingMethodName:e.bool,children:e.func},defaultProps:{timeFormat:"days",showShippingMethodName:!1}},BillingAddressContainer:{permittedChildren:["Address","ReactNode"],propTypes:{children:i.isRequired}},BillingAddressForm:{permittedChildren:["AddressInput","ReactNode"],propTypes:{children:i.isRequired}},CheckoutLink:{displayName:"CheckoutLink",propTypes:{children:e.func,label:e.string},defaultProps:{label:"Checkout"}},CommerceLayer:{permittedChildren:["OrderContainer","OrderStorage","PricesContainer","GiftCardContainer","ReactNode"],propTypes:{children:i.isRequired,accessToken:e.string.isRequired,endpoint:e.string.isRequired}},CustomerContainer:{displayName:"CustomerContainer",permittedChildren:["CustomerInput","SaveCustomerButton","AddressesContainer","PaymentMethodsContainer","ReactNode"],propTypes:{children:i.isRequired,isGuest:e.bool}},CustomerInput:{displayName:"CustomerInput",propTypes:{children:e.func,name:e.oneOf(["customerEmail"]),type:e.oneOf(["email"]),placeholder:e.string,disabled:e.bool,required:e.bool,saveOnBlur:e.bool},defaultProps:{required:!0}},DeliveryLeadTime:{displayName:"DeliveryLeadTime",propTypes:{type:e.oneOf(["max_days","max_hours","min_days","min_hours"]).isRequired,children:e.func}},DiscountAmount:{displayName:"DiscountAmount",propTypes:r,defaultProps:{format:"formatted"}},Errors:{displayName:"Errors",propTypes:d,defaultProps:{messages:[],field:"base"}},ExternalFunction:{displayName:"ExternalFunction",permittedChildren:["AddToCartButton","ReactNode"],propTypes:{children:i.isRequired,url:e.string.isRequired}},GiftCard:{permittedChildren:["GiftCardCurrencySelector","GiftCardInput","Errors","MetadataInput","SubmitButton","ReactNode"],displayName:"GiftCard",propTypes:{children:i.isRequired,onSubmit:e.func},defaultProps:{onSubmit:void 0}},GiftCardAmount:{displayName:"GiftCardAmount",propTypes:r},GiftCardContainer:{permittedChildren:["GiftCard","Errors","ReactNode"],displayName:"GiftCardContainer",propTypes:{children:i.isRequired}},GiftCardCurrencySelector:{displayName:"GiftCardCurrencySelector",propTypes:{children:e.func,placeholder:e.shape({value:e.oneOfType([e.string,e.number]).isRequired,label:e.string.isRequired}),value:e.string,required:e.bool},defaultProps:{required:!0}},GiftCardInput:{displayName:"GiftCardInput",propTypes:{type:e.oneOf(["text","email","number","date","checkbox"]).isRequired,name:e.oneOf(["balanceCents","balanceMaxCents","singleUse","rechargeable","imageUrl","expiresAt","referenceOrigin","email","firstName","lastName","reference"]).isRequired,children:e.func,placeholder:e.string}},GiftCardOrCouponForm:{permittedChildren:["GiftCardOrCouponInput","GiftCardOrCouponSubmit","ReactNode"],propTypes:{children:i.isRequired}},GiftCardOrCouponInput:{displayName:"GiftCardOrCouponInput",propTypes:{children:e.func,placeholder:e.string,disabled:e.bool,required:e.bool}},GiftCardOrCouponSubmit:{displayName:"GiftCardOrCouponSubmit",propTypes:{children:e.func,label:e.oneOfType([e.string,e.object])}},GiftCardOrCouponCode:{displayName:"GiftCardOrCouponCode",propTypes:{children:e.func,type:e.oneOf(["coupon","gift_card"])}},GiftCardOrCouponRemoveButton:{displayName:"GiftCardOrCouponRemoveButton",propTypes:{children:e.func,type:e.oneOf(["coupon","gift_card"]),label:e.oneOfType([e.string,e.object])}},ItemContainer:{permittedChildren:["PricesContainer","VariantsContainer","SkuOptionContainer","QuantitySelector","AddToCartButton","AvailabilityContainer","SkuListsContainer","ReactNode"],displayName:"ItemContainer",propTypes:{children:i.isRequired,skuCode:e.string,lineItem:e.shape({name:e.string.isRequired,imageUrl:e.string})}},LineItem:{permittedChildren:["AvailabilityContainer","LineItemImage","LineItemName","LineItemOptions","LineItemQuantity","LineItemAmount","LineItemRemoveLink","StockTransfer","Errors","ReactNode"],displayName:"LineItem",propTypes:{children:i.isRequired,type:e.oneOf(["skus","gift_cards","shipments","payment_methods","promotions","adjustments","bundles"])},defaultProps:{type:"skus"}},LineItemAmount:{displayName:"LineItemAmount",propTypes:Object.assign(Object.assign({},r),{type:e.oneOf(["total","unit","option"])}),defaultProps:{format:"formatted",type:"total"}},LineItemImage:{displayName:"LineItemImage",propTypes:{width:e.number,children:e.func}},LineItemName:{displayName:"LineItemName",propTypes:{children:e.func}},LineItemCode:{displayName:"LineItemCode",propTypes:{children:e.func}},LineItemOption:{displayName:"LineItemOption",propTypes:{name:e.string,children:e.func,valueClassName:e.string,className:e.string,id:e.string,style:e.object}},LineItemOptions:{permittedChildren:["LineItemOption","ReactNode"],displayName:"LineItemOptions",propTypes:{children:i.isRequired,title:e.string,showName:e.bool,skuOptionId:e.string}},LineItemQuantity:{displayName:"LineItemQuantity",propTypes:{children:e.func,max:e.number,disabled:e.bool,readonly:e.bool},defaultProps:{max:50}},LineItemRemoveLink:{displayName:"LineItemRemoveLink",propTypes:{children:e.func,label:e.string},defaultProps:{label:"Remove"}},LineItemsContainer:{permittedChildren:["LineItemsCount","LineItem","ReactNode"],displayName:"LineItemsContainer",propTypes:{children:i.isRequired,filters:e.object,loader:t},defaultProps:{filters:{},loader:"Loading..."}},LineItemsCount:{displayName:"LineItemsCount",propTypes:{children:e.func,id:e.string,className:e.string,name:e.string,style:e.object}},MetadataInput:{displayName:"MetadataInput",propTypes:n},OrderContainer:{permittedChildren:["AddressesContainer","CustomerContainer","ItemContainer","LineItemsContainer","SubTotalAmount","DiscountAmount","ShippingAmount","TaxesAmount","GiftCardAmount","TotalAmount","CheckoutLink","GiftCardContainer","ShipmentsContainer","PaymentMethodsContainer","PaymentMethodAmount","GiftCardOrCouponForm","GiftCardOrCouponCode","GiftCardOrCouponRemoveButton","Errors","OrderNumber","ReactNode"],displayName:"OrderContainer",propTypes:{children:i.isRequired,orderId:e.string,metadata:a,attributes:e.object},defaultProps:{metadata:{}}},OrderNumber:{displayName:"OrderNumber",propTypes:{className:e.string},defaultProps:{format:"formatted"}},OrderStorage:{permittedChildren:["OrderContainer","ReactNode"],displayName:"OrderStorage",propTypes:{children:i.isRequired,clearWhenPlaced:e.bool,persistKey:e.string.isRequired}},PaymentMethod:{permittedChildren:["PaymentMethodName","PaymentMethodRadioButton","PaymentMethodPrice","PaymentSource","ReactNode","Errors"],displayName:"PaymentMethod",propTypes:{children:i.isRequired}},PaymentMethodAmount:{displayName:"PaymentMethodAmount",propTypes:r,defaultProps:{format:"formatted"}},PaymentMethodName:{displayName:"PaymentMethodName",propTypes:{children:e.func}},PaymentMethodPrice:{displayName:"PaymentMethodPrice",propTypes:Object.assign(Object.assign({},r),{type:e.oneOf(["amount"])})},PaymentMethodRadioButton:{displayName:"PaymentMethodRadioButton",propTypes:{children:e.func}},PaymentMethodsContainer:{displayName:"PaymentMethodsContainer",permittedChildren:["PaymentSource","ReactNode","PlaceOrderContainer"],propTypes:{children:i.isRequired}},PaymentSource:{displayName:"PaymentSource",permittedChildren:["PaymentSourceBrandIcon","PaymentSourceBrandName","PaymentSourceEditButton","PaymentSourceDetail","ReactNode"],propTypes:{children:i,readonly:e.bool}},PaymentSourceBrandIcon:{displayName:"PaymentSourceBrandIcon",propTypes:{children:e.func,width:e.number,height:e.number,src:e.string,className:e.string}},PaymentSourceBrandName:{displayName:"PaymentSourceBrandName",propTypes:{children:e.func,label:e.string}},PaymentSourceEditButton:{displayName:"PaymentSourceEditButton",propTypes:{children:e.func,label:e.oneOfType([e.string,e.element])}},PaymentSourceDetail:{displayName:"PaymentSourceDetail",propTypes:{type:e.oneOf(["last4","expYear","expMonth"]).isRequired}},PlaceOrderButton:{displayName:"PlaceOrderButton",propTypes:{children:e.func,label:e.oneOfType([e.string,e.element])},defaultProps:{label:"Place order"}},PlaceOrderContainer:{displayName:"PlaceOrderContainer",permittedChildren:["PaymentMethod","PlaceOrderButton","PrivacyAndTermsCheckbox","ReactNode"],propTypes:{children:i.isRequired}},Price:{displayName:"Price",propTypes:{children:e.func,compareClassName:e.string,skuCode:e.string,showCompare:e.bool},defaultProps:{skuCode:""}},PricesContainer:{permittedChildren:["Price","ReactNode"],displayName:"PricesContainer",propTypes:{children:i.isRequired,skuCode:e.string,loader:t,perPage:e.number,filters:e.object},defaultProps:{perPage:10,filters:{},loader:"Loading...",skuCode:""}},PrivacyAndTermsCheckbox:{displayName:"PrivacyAndTermsCheckbox",propTypes:{children:e.func}},QuantitySelector:{displayName:"QuantitySelector",propTypes:{children:e.func,min:e.number,max:e.number,value:e.string,skuCode:e.string,disabled:e.bool},defaultProps:{min:1}},SaveAddressesButton:{displayName:"SaveAddressesButton",propTypes:{children:e.func,label:e.oneOfType([e.string,e.element]),onClick:e.func,disabled:e.bool},defaultProps:{label:"Continue to delivery"}},Shipment:{permittedChildren:["LineItemsContainer","LineItem","ShippingMethod","ReactNode"],displayName:"Shipment",propTypes:{children:i.isRequired}},ShipmentField:{displayName:"ShipmentField",propTypes:{children:e.func,name:e.oneOf(["cost_amount_cents","cost_amount_float","currency_code","formatted_cost_amount","number","status","key_number"]).isRequired}},ShipmentsContainer:{displayName:"ShipmentsContainer",permittedChildren:["Shipment","ReactNode"],propTypes:{children:i.isRequired}},ShippingAddressContainer:{permittedChildren:["Address","ReactNode"],propTypes:{children:i.isRequired}},SaveCustomerButton:{displayName:"SaveCustomerButton",propTypes:{children:e.func,label:e.oneOfType([e.string,e.element]),onClick:e.func},defaultProps:{label:"Save"}},ShippingAddressForm:{permittedChildren:["AddressInput","ReactNode"],propTypes:{children:i.isRequired}},ShippingAmount:{displayName:"ShippingAmount",propTypes:r},ShippingMethod:{permittedChildren:["ShippingMethodName","ShippingMethodPrice","ShippingMethodRadioButton","DeliveryLeadTime","ReactNode"],displayName:"ShippingMethod",propTypes:{children:i.isRequired,readonly:e.bool}},ShippingMethodName:{displayName:"ShippingMethodName",propTypes:{children:e.func}},ShippingMethodRadioButton:{displayName:"ShippingMethodRadioButton",propTypes:{children:e.func}},ShippingMethodPrice:{displayName:"ShippingMethodPrice",propTypes:Object.assign(Object.assign({},r),{type:e.oneOf(["amount"])}),defaultProps:{format:"formatted",type:"amount"}},SkuList:{permittedChildren:["AddToCartButton","QuantitySelector","ReactNode"],displayName:"SkuList",propTypes:{children:i.isRequired,id:e.string.isRequired}},SkuListsContainer:{permittedChildren:["SkuList","ReactNode"],displayName:"SkuListsContainer",propTypes:{children:i.isRequired}},SkuOption:{permittedChildren:["SkuOptionInput","ReactNode"],displayName:"SkuOption",propTypes:{children:i.isRequired,id:e.string.isRequired}},SkuOptionInput:{displayName:"SkuOptionInput",propTypes:n},SkuOptionsContainer:{permittedChildren:["SkuOption","ReactNode"],displayName:"SkuOptionsContainer",propTypes:{children:i.isRequired,skuCode:e.string}},StockTransfer:{permittedChildren:["StockTransferField","ReactNode"],displayName:"StockTransfer",propTypes:{children:i.isRequired}},StockTransferField:{displayName:"StockTransferField",propTypes:{children:e.func,type:e.oneOf(["quantity","sku_code"]).isRequired}},SubmitButton:{displayName:"SubmitButton",propTypes:{children:e.func,label:e.oneOfType([e.string,e.element])},defaultProps:{label:"Submit"}},SubTotalAmount:{displayName:"SubTotalAmount",propTypes:r,defaultProps:{format:"formatted"}},TaxesAmount:{displayName:"TaxesAmount",propTypes:r,defaultProps:{format:"formatted"}},TotalAmount:{displayName:"TotalAmount",propTypes:r,defaultProps:{format:"formatted"}},VariantsContainer:{permittedChildren:["VariantSelector","ReactNode"],displayName:"VariantsContainer",propTypes:{children:i.isRequired,skuCode:e.string,filters:e.object},defaultProps:{skuCode:"",filters:{}}},VariantSelector:{displayName:"VariantSelector",propTypes:{options:e.arrayOf(e.shape({label:e.string.isRequired,code:e.string.isRequired,lineItem:e.shape({name:e.string.isRequired,imageUrl:e.string})}).isRequired).isRequired,name:e.string,children:e.func,type:e.oneOf(["select","radio"]),loader:e.element,placeholder:e.string,skuCode:e.string},defaultProps:{placeholder:"Select a variant",type:"select"}}};export default o;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createContext}from"react";const
|
|
1
|
+
import{createContext as t}from"react";const e={address:{}},r=t(e);export default r;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createContext}from"react";import{setAddress}from"../reducers/AddressReducer";export const defaultAddressContext={saveAddresses:()=>{},setCloneAddress:()=>{},setAddress:
|
|
1
|
+
import{createContext as e}from"react";import{setAddress as r}from"../reducers/AddressReducer";export const defaultAddressContext={saveAddresses:()=>{},setCloneAddress:()=>{},setAddress:r,setAddressErrors:()=>{}};const s=e(defaultAddressContext);export default s;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createContext}from"react";import{availabilityInitialState}from"../reducers/AvailabilityReducer";const
|
|
1
|
+
import{createContext as t}from"react";import{availabilityInitialState as i}from"../reducers/AvailabilityReducer";const a=t(i);export default a;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createContext}from"react";export const defaultBillingAddressContext={setBillingAddress:()=>{}};const
|
|
1
|
+
import{createContext as t}from"react";export const defaultBillingAddressContext={setBillingAddress:()=>{}};const e=t(defaultBillingAddressContext);export default e;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createContext}from"react";const
|
|
1
|
+
import{createContext as t}from"react";const e=t({});export default e;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createContext}from"react";const
|
|
1
|
+
import{createContext as e}from"react";const t={accessToken:"",endpoint:""},o=e(t);export default o;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createContext}from"react";const
|
|
1
|
+
import{createContext as t}from"react";const o=t({});export default o;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{setCustomerErrors,setCustomerEmail}from"../reducers/CustomerReducer";import{createContext}from"react";export const defaultCustomerContext={saveCustomerUser:async()=>{},getCustomerPaymentSources:async()=>{},setCustomerErrors:
|
|
1
|
+
import{setCustomerErrors as e,setCustomerEmail as t}from"../reducers/CustomerReducer";import{createContext as r}from"react";export const defaultCustomerContext={saveCustomerUser:async()=>{},getCustomerPaymentSources:async()=>{},setCustomerErrors:e,setCustomerEmail:t};const o=r(defaultCustomerContext);export default o;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createContext}from"react";import
|
|
1
|
+
import{createContext as n}from"react";import r from"axios";export const callExternalFunction=async({url:t,data:o})=>r.post(t,o);const e=n({url:null,callExternalFunction});export default e;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createContext}from"react";import{giftCardInitialState}from"../reducers/GiftCardReducer";const
|
|
1
|
+
import{createContext as t}from"react";import{giftCardInitialState as r}from"../reducers/GiftCardReducer";const e=t(r);export default e;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createContext}from"react";export const initialItemContext={item:{},items:{},quantity:{},option:{},prices:{},lineItems:{}};const
|
|
1
|
+
import{createContext as t}from"react";export const initialItemContext={item:{},items:{},quantity:{},option:{},prices:{},lineItems:{}};const e=t(initialItemContext);export default e;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createContext}from"react";const
|
|
1
|
+
import{createContext as t}from"react";const e={},n=t(e);export default n;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createContext}from"react";const
|
|
1
|
+
import{createContext as t}from"react";const e={lineItems:[]},n=t(e);export default n;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createContext}from"react";const
|
|
1
|
+
import{createContext as t}from"react";const e={lineItemOption:{}},n=t(e);export default n;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createContext}from"react";import{addToCart,setOrderErrors,createOrder,setGiftCardOrCouponCode,removeGiftCardOrCouponCode,saveAddressToCustomerAddressBook,addResourceToInclude,updateOrder}from"../reducers/OrderReducer";export const defaultOrderContext={addToCart:
|
|
1
|
+
import{createContext as r}from"react";import{addToCart as e,setOrderErrors as d,createOrder as o,setGiftCardOrCouponCode as t,removeGiftCardOrCouponCode as s,saveAddressToCustomerAddressBook as a,addResourceToInclude as u,updateOrder as C}from"../reducers/OrderReducer";export const defaultOrderContext={addToCart:e,createOrder:o,setOrderErrors:d,setGiftCardOrCouponCode:t,removeGiftCardOrCouponCode:s,saveAddressToCustomerAddressBook:a,addResourceToInclude:u,getOrder:async n=>{},updateOrder:C};const c=r(defaultOrderContext);export default c;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createContext}from"react";import{getLocalOrder,setLocalOrder,deleteLocalOrder}from"../utils/localStorage";const
|
|
1
|
+
import{createContext as e}from"react";import{getLocalOrder as t,setLocalOrder as r,deleteLocalOrder as o}from"../utils/localStorage";const a={persistKey:"",clearWhenPlaced:!0,getLocalOrder:t,setLocalOrder:r,deleteLocalOrder:o},l=e(a);export default l;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createContext}from"react";const
|
|
1
|
+
import{createContext as t}from"react";const e={},o=t(e);export default o;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createContext}from"react";import{updatePaymentSource}from"../reducers/PaymentMethodReducer";import{setPaymentMethodErrors,setPaymentSource,setPaymentMethod,destroyPaymentSource,setPaymentRef,setLoading}from"../reducers/PaymentMethodReducer";export const defaultPaymentMethodContext={setPaymentMethodErrors:
|
|
1
|
+
import{createContext as e}from"react";import{updatePaymentSource as t}from"../reducers/PaymentMethodReducer";import{setPaymentMethodErrors as o,setPaymentSource as r,setPaymentMethod as a,destroyPaymentSource as m,setPaymentRef as n,setLoading as d}from"../reducers/PaymentMethodReducer";export const defaultPaymentMethodContext={setPaymentMethodErrors:o,setPaymentMethod:a,setPaymentSource:r,setPaymentRef:n,destroyPaymentSource:m,updatePaymentSource:t,setLoading:d};const c=e(defaultPaymentMethodContext);export default c;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createContext}from"react";export const defaultPaymentSourceContext={};const
|
|
1
|
+
import{createContext as t}from"react";export const defaultPaymentSourceContext={};const e=t(defaultPaymentSourceContext);export default e;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createContext}from"react";import{setPlaceOrderErrors}from"../reducers/PlaceOrderReducer";export const defaultPlaceOrderContext={setPlaceOrderErrors:
|
|
1
|
+
import{createContext as e}from"react";import{setPlaceOrderErrors as r}from"../reducers/PlaceOrderReducer";export const defaultPlaceOrderContext={setPlaceOrderErrors:r};const t=e(defaultPlaceOrderContext);export default t;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createContext}from"react";import{priceInitialState}from"../reducers/PriceReducer";const
|
|
1
|
+
import{createContext as e}from"react";import{priceInitialState as t}from"../reducers/PriceReducer";const r=e(t);export default r;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createContext}from"react";const
|
|
1
|
+
import{createContext as t}from"react";const e={lineItems:[],shippingMethods:[],stockTransfers:[],keyNumber:0},n=t(e);export default n;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createContext}from"react";import{setShipmentErrors}from"../reducers/ShipmentReducer";export const defaultShipmentContext={setShipmentErrors:
|
|
1
|
+
import{createContext as t}from"react";import{setShipmentErrors as e}from"../reducers/ShipmentReducer";export const defaultShipmentContext={setShipmentErrors:e,setShippingMethod:async()=>{}};const r=t(defaultShipmentContext);export default r;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createContext}from"react";export const defaultShippingAddressContext={};const
|
|
1
|
+
import{createContext as t}from"react";export const defaultShippingAddressContext={};const e=t(defaultShippingAddressContext);export default e;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createContext}from"react";const
|
|
1
|
+
import{createContext as t}from"react";const e=t({});export default e;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createContext}from"react";const
|
|
1
|
+
import{createContext as t}from"react";const e={},o=t(e);export default o;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createContext}from"react";import{skuListsInitialState}from"../reducers/SkuListsReducer";export const SkuListsContext=
|
|
1
|
+
import{createContext as t}from"react";import{skuListsInitialState as e}from"../reducers/SkuListsReducer";export const SkuListsContext=t(e);export default SkuListsContext;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createContext}from"react";const
|
|
1
|
+
import{createContext as t}from"react";const e={skuCode:""},o=t(e);export default o;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createContext}from"react";import{skuOptionsInitialState}from"../reducers/SkuOptionsReducer";const
|
|
1
|
+
import{createContext as t}from"react";import{skuOptionsInitialState as e}from"../reducers/SkuOptionsReducer";const o=t(e);export default o;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createContext}from"react";const
|
|
1
|
+
import{createContext as t}from"react";const e={},o=t(e);export default o;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createContext}from"react";import{variantInitialState}from"../reducers/VariantReducer";const
|
|
1
|
+
import{createContext as t}from"react";import{variantInitialState as r}from"../reducers/VariantReducer";const e=t(r);export default e;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import m from"../utils/baseReducer";import g from"lodash/isEmpty";import v from"../utils/getSdk";import y from"lodash/camelCase";export const addressFields=["city","company","country_code","first_name","last_name","line_1","line_2","phone","state_code","zip_code"],addressInitialState={errors:[]},setAddressErrors=({errors:t,dispatch:i,currentErrors:s=[],resource:l})=>{const f=l==="billing_address"?t.filter(d=>d.resource===l):s.filter(d=>d.resource==="billing_address"),r=l==="shipping_address"?t.filter(d=>d.resource===l):s.filter(d=>d.resource==="shipping_address"),a=[...f,...r];i&&i({type:"setErrors",payload:{errors:a}})},setAddress=({values:t,resource:i,dispatch:s})=>{s&&s({type:"setAddress",payload:{[`${i}`]:t}})},setCloneAddress=(t,i,s)=>{s({type:"setCloneAddress",payload:{[`${y(i)}Id`]:t}})},saveAddresses=async({config:t,updateOrder:i,order:s,state:l,dispatch:f})=>{var r,a,d;const{shipToDifferentAddress:b,billing_address:o,shipping_address:_,billingAddressId:p,shippingAddressId:h}=l;try{const n=v(t);if(s){const u=(r=s==null?void 0:s.billing_address)===null||r===void 0?void 0:r.reference,e={id:s==null?void 0:s.id,_billing_address_clone_id:p,_shipping_address_clone_id:p};if(u===p&&(e._billing_address_clone_id=(a=s==null?void 0:s.billing_address)===null||a===void 0?void 0:a.id,e._shipping_address_clone_id=(d=s==null?void 0:s.shipping_address)===null||d===void 0?void 0:d.id),!g(o)&&o){delete e._billing_address_clone_id,delete e._shipping_address_clone_id,e._shipping_address_same_as_billing=!0;const c=await n.addresses.create(o);e.billing_address=n.addresses.relationship(c.id)}if(b&&(delete e._shipping_address_same_as_billing,h&&(e._shipping_address_clone_id=h),!g(_)&&_)){delete e._shipping_address_clone_id;const c=await n.addresses.create(_);e.shipping_address=n.addresses.relationship(c.id)}!g(e)&&i&&await i({id:s.id,attributes:e})}}catch(n){console.error(n)}};const A=["setErrors","setAddress","setShipToDifferentAddress","setCloneAddress","cleanup"],x=(t,i)=>m(t,i,A);export default x;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import d from"../utils/baseReducer";import y from"../utils/getSdk";export const availabilityInitialState={quantity:null,min:{days:0,hours:0},max:{days:0,hours:0},errors:[]},getAvailability=async({skuCode:t,dispatch:i,config:r})=>{var e;const l=y(r);try{const[s]=await l.skus.list({fields:{skus:["id"]},filters:{code_in:t}}),o=await l.skus.retrieve(s.id,{fields:{skus:["inventory"]}}),[a]=((e=o.inventory)===null||e===void 0?void 0:e.levels)||[],[n]=(a==null?void 0:a.delivery_lead_times)||[];i({type:"setAvailability",payload:Object.assign(Object.assign({},n),{quantity:o.inventory.quantity})})}catch(s){console.error("Get SKU availability",s)}};const c=["setAvailability","setErrors"],u=(t,i)=>d(t,i,c);export default u;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import i from"../utils/baseReducer";import n from"../utils/getSdk";export const billingAddressInitialState={_billing_address_clone_id:""},setBillingAddress=async(s,e)=>{try{if(e==null?void 0:e.order){if(e.customerAddressId){const d=n(e.config),r={id:s,reference:e.customerAddressId};await d.addresses.update(r)}e.dispatch({type:"setBillingAddress",payload:{_billing_address_clone_id:s}})}}catch(d){console.error("Set billing address",d)}},setBillingCustomerAddressId=async({dispatch:s,order:e,setCloneAddress:d})=>{var r;const l=(r=e==null?void 0:e.billing_address)===null||r===void 0?void 0:r.reference;try{l&&(s({type:"setBillingCustomerAddressId",payload:{billingCustomerAddressId:l}}),d(l,"billing_address"))}catch(t){console.error("error",t)}};const o=["setBillingAddress","setBillingCustomerAddressId","cleanup"],c=(s,e)=>i(s,e,o);export default c;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import a from"../utils/baseReducer";import d from"../utils/getSdk";import m from"../utils/getErrors";export const saveCustomerUser=async({customerEmail:e,order:s,updateOrder:t})=>{if(s){const r={customer_email:e,id:s.id};await t({id:s.id,attributes:r})}},setCustomerErrors=(e,s)=>{s&&s({type:"setErrors",payload:{errors:e}})},setCustomerEmail=(e,s)=>{s&&s({type:"setCustomerEmail",payload:{customerEmail:e}})},getCustomerAddresses=async({config:e,dispatch:s})=>{try{const t=[];(await d(e).customer_addresses.list({include:["address"]})).forEach(o=>{o.address&&t.push(o.address)}),s({type:"setAddresses",payload:{addresses:t}})}catch(t){const r=m(t,"addresses");s({type:"setErrors",payload:{errors:r}})}},getCustomerPaymentSources=async({dispatch:e,order:s})=>{(s==null?void 0:s.available_customer_payment_sources)&&e({type:"setPayments",payload:{payments:s.available_customer_payment_sources}})},customerInitialState={errors:[],addresses:[],payments:[]};const c=["setErrors","setCustomerEmail","setAddresses","setPayments"],u=(e,s)=>a(e,s,c);export default u;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__rest}from"tslib";import
|
|
1
|
+
import{__rest as G}from"tslib";import b from"../utils/baseReducer";import{isEmpty as R}from"lodash";import x from"../utils/getErrors";import m from"../utils/getSdk";export const giftCardInitialState={currencyCode:"",balanceCent:0,singleUse:!1,rechargeable:!0,loading:!1,expiresAt:null,errors:[]},addGiftCardRecipient=async(t,e,i)=>{try{const s=await m(e).gift_card_recipients.create(t);i({type:"setGiftCardRecipient",payload:{giftCardRecipient:s}})}catch(a){console.error(a)}},addGiftCardLoading=(t,e)=>{e({type:"setGiftCardLoading",payload:{loading:t}})},addGiftCard=async(t,{config:e,dispatch:i,getOrder:a,createOrder:s,order:f})=>{var n;try{const r=m(e);addGiftCardLoading(!0,i);const{firstName:o,lastName:l,email:y}=t,C=G(t,["firstName","lastName","email"]),p=Object.assign({recipient_email:y},C),g=await r.gift_cards.create(p,{include:["gift_card_recipient"]}),d={id:(n=g.gift_card_recipient)===null||n===void 0?void 0:n.id};if(o&&(d.first_name=o),l&&(d.last_name=l),R(d)||await r.gift_card_recipients.update(d),s&&a){const c=f?f.id:await s();if(c){const _=r.orders.relationship(c),u=r.gift_cards.relationship(g.id);await r.line_items.create({quantity:1,order:_,item:u}),a&&a(c)}}i({type:"setGiftCardRecipient",payload:Object.assign({},p)}),addGiftCardLoading(!1,i)}catch(r){const o=x(r,"gift_cards");i({type:"setGiftCardErrors",payload:{errors:o}}),addGiftCardLoading(!1,i)}},addGiftCardError=(t,e)=>{e({type:"setGiftCardErrors",payload:{errors:t}})};const E=["setAvailability","setGiftCardRecipient","setGiftCardErrors","setGiftCardLoading"],k=(t,e)=>b(t,e,E);export default k;
|