@commercelayer/react-components 4.0.0-alpha.2 → 4.0.0-alpha.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/components/Errors.js +1 -1
- package/lib/cjs/components/ExternalFunction.d.ts +1 -1
- package/lib/cjs/components/MetadataInput.d.ts +1 -1
- package/lib/cjs/components/SubmitButton.d.ts +1 -1
- package/lib/cjs/components/addresses/Address.d.ts +1 -1
- package/lib/cjs/components/addresses/AddressCountrySelector.d.ts +2 -2
- package/lib/cjs/components/addresses/AddressField.d.ts +4 -4
- package/lib/cjs/components/addresses/AddressField.js +1 -1
- package/lib/cjs/components/addresses/AddressInput.d.ts +2 -2
- package/lib/cjs/components/addresses/AddressStateSelector.d.ts +2 -2
- package/lib/cjs/components/addresses/AddressesContainer.d.ts +1 -1
- package/lib/cjs/components/addresses/BillingAddressContainer.d.ts +6 -0
- package/lib/cjs/components/addresses/BillingAddressContainer.js +1 -0
- package/lib/{esm/components → cjs/components/addresses}/BillingAddressForm.d.ts +1 -1
- package/lib/cjs/components/addresses/BillingAddressForm.js +1 -0
- package/lib/cjs/components/addresses/SaveAddressesButton.d.ts +11 -0
- package/lib/cjs/components/addresses/SaveAddressesButton.js +1 -0
- package/lib/{esm/components → cjs/components/addresses}/ShippingAddressContainer.d.ts +1 -1
- package/lib/cjs/components/addresses/ShippingAddressContainer.js +1 -0
- package/lib/cjs/components/{ShippingAddressForm.d.ts → addresses/ShippingAddressForm.d.ts} +1 -1
- package/lib/cjs/components/addresses/ShippingAddressForm.js +1 -0
- package/lib/cjs/components/auth/CommerceLayer.d.ts +1 -1
- package/lib/cjs/components/customers/CustomerAddressForm.d.ts +1 -1
- package/lib/cjs/components/customers/CustomerAddressForm.js +1 -1
- package/lib/cjs/components/customers/SaveCustomerButton.d.ts +13 -0
- package/lib/cjs/components/{SaveCustomerButton.js → customers/SaveCustomerButton.js} +1 -1
- package/lib/cjs/components/{GiftCard.d.ts → gift_cards/GiftCard.d.ts} +2 -2
- package/lib/cjs/components/gift_cards/GiftCard.js +1 -0
- package/lib/{esm/components → cjs/components/gift_cards}/GiftCardContainer.d.ts +1 -1
- package/lib/cjs/components/gift_cards/GiftCardContainer.js +1 -0
- package/lib/cjs/components/{GiftCardCurrencySelector.d.ts → gift_cards/GiftCardCurrencySelector.d.ts} +2 -2
- package/lib/cjs/components/gift_cards/GiftCardCurrencySelector.js +1 -0
- package/lib/{esm/components → cjs/components/gift_cards}/GiftCardInput.d.ts +3 -3
- package/lib/cjs/components/gift_cards/GiftCardInput.js +1 -0
- package/lib/cjs/components/{GiftCardOrCouponCode.d.ts → gift_cards/GiftCardOrCouponCode.d.ts} +2 -2
- package/lib/cjs/components/gift_cards/GiftCardOrCouponCode.js +1 -0
- package/lib/{esm/components → cjs/components/gift_cards}/GiftCardOrCouponForm.d.ts +1 -1
- package/lib/cjs/components/gift_cards/GiftCardOrCouponForm.js +1 -0
- package/lib/cjs/components/{GiftCardOrCouponInput.d.ts → gift_cards/GiftCardOrCouponInput.d.ts} +2 -2
- package/lib/cjs/components/gift_cards/GiftCardOrCouponInput.js +1 -0
- package/lib/cjs/components/{GiftCardOrCouponRemoveButton.d.ts → gift_cards/GiftCardOrCouponRemoveButton.d.ts} +3 -3
- package/lib/cjs/components/gift_cards/GiftCardOrCouponRemoveButton.js +1 -0
- package/lib/cjs/components/{GiftCardOrCouponSubmit.d.ts → gift_cards/GiftCardOrCouponSubmit.d.ts} +2 -2
- package/lib/cjs/components/gift_cards/GiftCardOrCouponSubmit.js +1 -0
- package/lib/cjs/components/{GiftCardRecipient.d.ts → gift_cards/GiftCardRecipient.d.ts} +0 -0
- package/lib/cjs/components/{GiftCardRecipient.js → gift_cards/GiftCardRecipient.js} +0 -0
- package/lib/cjs/components/{GiftCardRecipientInput.d.ts → gift_cards/GiftCardRecipientInput.d.ts} +0 -0
- package/lib/cjs/components/{GiftCardRecipientInput.js → gift_cards/GiftCardRecipientInput.js} +0 -0
- package/lib/{esm/components → cjs/components/line_items}/LineItem.d.ts +2 -2
- package/lib/cjs/components/line_items/LineItem.js +1 -0
- package/lib/{esm/components → cjs/components/line_items}/LineItemAmount.d.ts +2 -2
- package/lib/cjs/components/line_items/LineItemAmount.js +1 -0
- package/lib/cjs/components/{LineItemCode.d.ts → line_items/LineItemCode.d.ts} +2 -2
- package/lib/cjs/components/line_items/LineItemCode.js +1 -0
- package/lib/cjs/components/{LineItemImage.d.ts → line_items/LineItemImage.d.ts} +3 -3
- package/lib/cjs/components/line_items/LineItemImage.js +1 -0
- package/lib/cjs/components/{LineItemName.d.ts → line_items/LineItemName.d.ts} +2 -2
- package/lib/cjs/components/line_items/LineItemName.js +1 -0
- package/lib/cjs/components/{LineItemOption.d.ts → line_items/LineItemOption.d.ts} +1 -1
- package/lib/cjs/components/line_items/LineItemOption.js +1 -0
- package/lib/cjs/components/{LineItemOptions.d.ts → line_items/LineItemOptions.d.ts} +0 -0
- package/lib/cjs/components/line_items/LineItemOptions.js +1 -0
- package/lib/{esm/components → cjs/components/line_items}/LineItemQuantity.d.ts +1 -1
- package/lib/cjs/components/line_items/LineItemQuantity.js +1 -0
- package/lib/cjs/components/{LineItemRemoveLink.d.ts → line_items/LineItemRemoveLink.d.ts} +1 -1
- package/lib/cjs/components/line_items/LineItemRemoveLink.js +1 -0
- package/lib/{esm/components → cjs/components/line_items}/LineItemsContainer.d.ts +2 -2
- package/lib/cjs/components/line_items/LineItemsContainer.js +1 -0
- package/lib/{esm/components → cjs/components/line_items}/LineItemsCount.d.ts +2 -2
- package/lib/cjs/components/line_items/LineItemsCount.js +1 -0
- package/lib/cjs/components/{LineItemsEmpty.d.ts → line_items/LineItemsEmpty.d.ts} +1 -1
- package/lib/cjs/components/line_items/LineItemsEmpty.js +1 -0
- package/lib/cjs/components/orders/AddToCartButton.d.ts +3 -3
- package/lib/cjs/components/orders/AddToCartButton.js +1 -1
- package/lib/cjs/components/orders/AdjustmentAmount.d.ts +2 -16
- package/lib/cjs/components/orders/AdjustmentAmount.js +1 -1
- package/lib/cjs/components/orders/CartLink.js +1 -1
- package/lib/cjs/components/{CheckoutLink.d.ts → orders/CheckoutLink.d.ts} +1 -11
- package/lib/cjs/components/orders/CheckoutLink.js +1 -0
- package/lib/cjs/components/{DiscountAmount.d.ts → orders/DiscountAmount.d.ts} +3 -3
- package/lib/cjs/components/orders/DiscountAmount.js +1 -0
- package/lib/{esm/components → cjs/components/orders}/ItemContainer.d.ts +1 -1
- package/lib/cjs/components/orders/ItemContainer.js +1 -0
- package/lib/cjs/components/orders/OrderContainer.d.ts +1 -1
- package/lib/cjs/components/orders/OrderList.d.ts +1 -1
- package/lib/cjs/components/orders/OrderListRow.d.ts +2 -2
- package/lib/cjs/components/orders/OrderStorage.d.ts +1 -1
- package/lib/cjs/components/orders/PlaceOrderButton.d.ts +1 -1
- package/lib/cjs/components/orders/PlaceOrderButton.js +1 -1
- package/lib/cjs/components/orders/PlaceOrderContainer.d.ts +1 -1
- package/lib/cjs/components/orders/PlaceOrderContainer.js +1 -1
- package/lib/{esm/components → cjs/components/orders}/ShippingAmount.d.ts +2 -2
- package/lib/cjs/components/orders/ShippingAmount.js +1 -0
- package/lib/cjs/components/{gateways → payment_gateways}/AdyenGateway.d.ts +1 -1
- package/lib/cjs/components/payment_gateways/AdyenGateway.js +1 -0
- package/lib/{esm/components/gateways → cjs/components/payment_gateways}/BraintreeGateway.d.ts +1 -1
- package/lib/cjs/components/payment_gateways/BraintreeGateway.js +1 -0
- package/lib/cjs/components/{gateways → payment_gateways}/CheckoutComGateway.d.ts +1 -1
- package/lib/cjs/components/payment_gateways/CheckoutComGateway.js +1 -0
- package/lib/{esm/components/gateways → cjs/components/payment_gateways}/KlarnaGateway.d.ts +1 -1
- package/lib/cjs/components/payment_gateways/KlarnaGateway.js +1 -0
- package/lib/cjs/components/{PaymentGateway.d.ts → payment_gateways/PaymentGateway.d.ts} +2 -2
- package/lib/cjs/components/payment_gateways/PaymentGateway.js +1 -0
- package/lib/cjs/components/{gateways → payment_gateways}/PaypalGateway.d.ts +1 -1
- package/lib/cjs/components/payment_gateways/PaypalGateway.js +1 -0
- package/lib/cjs/components/{gateways → payment_gateways}/StripeGateway.d.ts +1 -1
- package/lib/cjs/components/payment_gateways/StripeGateway.js +1 -0
- package/lib/cjs/components/{gateways → payment_gateways}/WireTransferGateway.d.ts +1 -1
- package/lib/cjs/components/payment_gateways/WireTransferGateway.js +1 -0
- package/lib/cjs/components/{PaymentMethod.d.ts → payment_methods/PaymentMethod.d.ts} +8 -3
- package/lib/cjs/components/payment_methods/PaymentMethod.js +1 -0
- package/lib/cjs/components/{PaymentMethodAmount.d.ts → payment_methods/PaymentMethodAmount.d.ts} +3 -3
- package/lib/cjs/components/payment_methods/PaymentMethodAmount.js +1 -0
- package/lib/{esm/components → cjs/components/payment_methods}/PaymentMethodName.d.ts +2 -2
- package/lib/cjs/components/payment_methods/PaymentMethodName.js +1 -0
- package/lib/cjs/components/{PaymentMethodPrice.d.ts → payment_methods/PaymentMethodPrice.d.ts} +2 -2
- package/lib/cjs/components/payment_methods/PaymentMethodPrice.js +1 -0
- package/lib/cjs/components/{PaymentMethodRadioButton.d.ts → payment_methods/PaymentMethodRadioButton.d.ts} +2 -2
- package/lib/cjs/components/payment_methods/PaymentMethodRadioButton.js +1 -0
- package/lib/{esm/components → cjs/components/payment_methods}/PaymentMethodsContainer.d.ts +2 -2
- package/lib/cjs/components/payment_methods/PaymentMethodsContainer.js +1 -0
- package/lib/cjs/components/payment_source/AdyenPayment.d.ts +55 -0
- package/lib/cjs/components/payment_source/AdyenPayment.js +1 -0
- package/lib/cjs/components/{BraintreePayment.d.ts → payment_source/BraintreePayment.d.ts} +0 -0
- package/lib/cjs/components/payment_source/BraintreePayment.js +1 -0
- package/lib/{esm/components → cjs/components/payment_source}/CheckoutComPayment.d.ts +1 -1
- package/lib/cjs/components/payment_source/CheckoutComPayment.js +1 -0
- package/lib/cjs/components/{KlarnaPayment.d.ts → payment_source/KlarnaPayment.d.ts} +1 -1
- package/lib/cjs/components/payment_source/KlarnaPayment.js +1 -0
- package/lib/cjs/components/{PaymentSource.d.ts → payment_source/PaymentSource.d.ts} +4 -4
- package/lib/cjs/components/payment_source/PaymentSource.js +1 -0
- package/lib/{esm/components → cjs/components/payment_source}/PaymentSourceBrandIcon.d.ts +2 -2
- package/lib/cjs/components/payment_source/PaymentSourceBrandIcon.js +1 -0
- package/lib/{esm/components → cjs/components/payment_source}/PaymentSourceBrandName.d.ts +2 -2
- package/lib/cjs/components/payment_source/PaymentSourceBrandName.js +1 -0
- package/lib/{esm/components → cjs/components/payment_source}/PaymentSourceDetail.d.ts +2 -2
- package/lib/cjs/components/payment_source/PaymentSourceDetail.js +1 -0
- package/lib/cjs/components/{PaymentSourceEditButton.d.ts → payment_source/PaymentSourceEditButton.d.ts} +2 -2
- package/lib/cjs/components/payment_source/PaymentSourceEditButton.js +1 -0
- package/lib/cjs/components/{PaypalPayment.d.ts → payment_source/PaypalPayment.d.ts} +0 -0
- package/lib/cjs/components/payment_source/PaypalPayment.js +1 -0
- package/lib/cjs/components/{StripePayment.d.ts → payment_source/StripePayment.d.ts} +1 -1
- package/lib/cjs/components/payment_source/StripePayment.js +1 -0
- package/lib/cjs/components/{WireTransferPayment.d.ts → payment_source/WireTransferPayment.d.ts} +3 -1
- package/lib/cjs/components/payment_source/WireTransferPayment.js +1 -0
- package/lib/cjs/components/{Price.d.ts → prices/Price.d.ts} +1 -1
- package/lib/cjs/components/prices/Price.js +1 -0
- package/lib/{esm/components → cjs/components/prices}/PricesContainer.d.ts +3 -3
- package/lib/cjs/components/prices/PricesContainer.js +1 -0
- package/lib/cjs/components/shipments/Shipment.d.ts +1 -1
- package/lib/cjs/components/shipments/ShipmentField.d.ts +3 -3
- package/lib/cjs/components/shipments/ShipmentsContainer.d.ts +1 -1
- package/lib/cjs/components/shipping_methods/ShippingMethod.d.ts +1 -1
- package/lib/cjs/components/shipping_methods/ShippingMethodName.d.ts +2 -2
- package/lib/cjs/components/shipping_methods/ShippingMethodRadioButton.d.ts +2 -2
- package/lib/cjs/components/{AvailabilityContainer.d.ts → skus/AvailabilityContainer.d.ts} +1 -1
- package/lib/cjs/components/skus/AvailabilityContainer.js +1 -0
- package/lib/{esm/components → cjs/components/skus}/AvailabilityTemplate.d.ts +2 -2
- package/lib/cjs/components/skus/AvailabilityTemplate.js +1 -0
- package/lib/{esm/components → cjs/components/skus}/DeliveryLeadTime.d.ts +3 -3
- package/lib/cjs/components/skus/DeliveryLeadTime.js +1 -0
- package/lib/cjs/components/{QuantitySelector.d.ts → skus/QuantitySelector.d.ts} +1 -1
- package/lib/cjs/components/skus/QuantitySelector.js +1 -0
- package/lib/cjs/components/skus/SkuList.d.ts +1 -1
- package/lib/cjs/components/skus/SkuListsContainer.d.ts +1 -1
- package/lib/cjs/components/skus/SkuOption.d.ts +1 -1
- package/lib/cjs/components/skus/SkuOptionInput.d.ts +1 -1
- package/lib/cjs/components/skus/SkuOptionsContainer.d.ts +1 -1
- package/lib/cjs/components/skus/Skus.d.ts +1 -1
- package/lib/cjs/components/skus/SkusContainer.d.ts +0 -5
- package/lib/cjs/components/skus/SkusContainer.js +1 -1
- package/lib/cjs/components/{VariantSelector.d.ts → skus/VariantSelector.d.ts} +6 -6
- package/lib/cjs/components/skus/VariantSelector.js +1 -0
- package/lib/cjs/components/{VariantsContainer.d.ts → skus/VariantsContainer.d.ts} +1 -1
- package/lib/cjs/components/skus/VariantsContainer.js +1 -0
- package/lib/{esm/components → cjs/components/stock_transfers}/StockTransfer.d.ts +1 -1
- package/lib/cjs/components/stock_transfers/StockTransfer.js +1 -0
- package/lib/{esm/components → cjs/components/stock_transfers}/StockTransferField.d.ts +2 -2
- package/lib/cjs/components/stock_transfers/StockTransferField.js +1 -0
- package/lib/cjs/components/utils/BaseField.d.ts +2 -2
- package/lib/cjs/components/utils/BaseOrderPrice.js +1 -1
- package/lib/cjs/components/utils/Parent.d.ts +5 -5
- package/lib/cjs/components/utils/Parent.js +1 -1
- package/lib/cjs/components/utils/PriceTemplate.d.ts +1 -1
- package/lib/cjs/components/utils/VariantTemplate.d.ts +3 -3
- package/lib/cjs/components/utils/VariantTemplate.js +1 -1
- package/lib/cjs/components/utils/getAllErrors.d.ts +2 -2
- package/lib/cjs/config/components.d.ts +66 -66
- package/lib/cjs/context/OrderListChildrenContext.d.ts +3 -3
- package/lib/cjs/context/PlaceOrderContext.d.ts +2 -1
- package/lib/cjs/index.d.ts +55 -55
- package/lib/cjs/index.js +1 -1
- package/lib/cjs/reducers/AddressReducer.d.ts +1 -0
- package/lib/cjs/reducers/PaymentMethodReducer.d.ts +7 -6
- package/lib/cjs/reducers/PlaceOrderReducer.d.ts +7 -4
- package/lib/cjs/reducers/PlaceOrderReducer.js +1 -1
- package/lib/cjs/reducers/VariantReducer.d.ts +1 -1
- package/lib/cjs/typings/errors.d.ts +2 -2
- package/lib/cjs/typings/index.d.ts +10 -10
- package/lib/cjs/utils/childrenTypes.d.ts +1 -1
- package/lib/cjs/utils/getCardDetails.js +1 -1
- package/lib/cjs/utils/getLoaderComponent.js +1 -1
- package/lib/cjs/utils/paypalPayment.d.ts +1 -1
- package/lib/esm/components/Errors.js +1 -1
- package/lib/esm/components/ExternalFunction.d.ts +1 -1
- package/lib/esm/components/MetadataInput.d.ts +1 -1
- package/lib/esm/components/SubmitButton.d.ts +1 -1
- package/lib/esm/components/addresses/Address.d.ts +1 -1
- package/lib/esm/components/addresses/AddressCountrySelector.d.ts +2 -2
- package/lib/esm/components/addresses/AddressField.d.ts +4 -4
- package/lib/esm/components/addresses/AddressField.js +1 -1
- package/lib/esm/components/addresses/AddressInput.d.ts +2 -2
- package/lib/esm/components/addresses/AddressStateSelector.d.ts +2 -2
- package/lib/esm/components/addresses/AddressesContainer.d.ts +1 -1
- package/lib/esm/components/addresses/BillingAddressContainer.d.ts +6 -0
- package/lib/esm/components/addresses/BillingAddressContainer.js +1 -0
- package/lib/{cjs/components → esm/components/addresses}/BillingAddressForm.d.ts +1 -1
- package/lib/esm/components/addresses/BillingAddressForm.js +1 -0
- package/lib/esm/components/addresses/SaveAddressesButton.d.ts +11 -0
- package/lib/esm/components/addresses/SaveAddressesButton.js +1 -0
- package/lib/{cjs/components → esm/components/addresses}/ShippingAddressContainer.d.ts +1 -1
- package/lib/esm/components/addresses/ShippingAddressContainer.js +1 -0
- package/lib/esm/components/{ShippingAddressForm.d.ts → addresses/ShippingAddressForm.d.ts} +1 -1
- package/lib/esm/components/addresses/ShippingAddressForm.js +1 -0
- package/lib/esm/components/auth/CommerceLayer.d.ts +1 -1
- package/lib/esm/components/customers/CustomerAddressForm.d.ts +1 -1
- package/lib/esm/components/customers/CustomerAddressForm.js +1 -1
- package/lib/esm/components/customers/SaveCustomerButton.d.ts +13 -0
- package/lib/esm/components/customers/SaveCustomerButton.js +1 -0
- package/lib/esm/components/{GiftCard.d.ts → gift_cards/GiftCard.d.ts} +2 -2
- package/lib/esm/components/gift_cards/GiftCard.js +1 -0
- package/lib/{cjs/components → esm/components/gift_cards}/GiftCardContainer.d.ts +1 -1
- package/lib/esm/components/gift_cards/GiftCardContainer.js +1 -0
- package/lib/esm/components/{GiftCardCurrencySelector.d.ts → gift_cards/GiftCardCurrencySelector.d.ts} +2 -2
- package/lib/esm/components/gift_cards/GiftCardCurrencySelector.js +1 -0
- package/lib/{cjs/components → esm/components/gift_cards}/GiftCardInput.d.ts +3 -3
- package/lib/esm/components/gift_cards/GiftCardInput.js +1 -0
- package/lib/esm/components/{GiftCardOrCouponCode.d.ts → gift_cards/GiftCardOrCouponCode.d.ts} +2 -2
- package/lib/esm/components/gift_cards/GiftCardOrCouponCode.js +1 -0
- package/lib/{cjs/components → esm/components/gift_cards}/GiftCardOrCouponForm.d.ts +1 -1
- package/lib/esm/components/gift_cards/GiftCardOrCouponForm.js +1 -0
- package/lib/esm/components/{GiftCardOrCouponInput.d.ts → gift_cards/GiftCardOrCouponInput.d.ts} +2 -2
- package/lib/esm/components/gift_cards/GiftCardOrCouponInput.js +1 -0
- package/lib/esm/components/{GiftCardOrCouponRemoveButton.d.ts → gift_cards/GiftCardOrCouponRemoveButton.d.ts} +3 -3
- package/lib/esm/components/gift_cards/GiftCardOrCouponRemoveButton.js +1 -0
- package/lib/esm/components/{GiftCardOrCouponSubmit.d.ts → gift_cards/GiftCardOrCouponSubmit.d.ts} +2 -2
- package/lib/esm/components/gift_cards/GiftCardOrCouponSubmit.js +1 -0
- package/lib/esm/components/{GiftCardRecipient.d.ts → gift_cards/GiftCardRecipient.d.ts} +0 -0
- package/lib/esm/components/{GiftCardRecipient.js → gift_cards/GiftCardRecipient.js} +0 -0
- package/lib/esm/components/{GiftCardRecipientInput.d.ts → gift_cards/GiftCardRecipientInput.d.ts} +0 -0
- package/lib/esm/components/{GiftCardRecipientInput.js → gift_cards/GiftCardRecipientInput.js} +0 -0
- package/lib/{cjs/components → esm/components/line_items}/LineItem.d.ts +2 -2
- package/lib/esm/components/line_items/LineItem.js +1 -0
- package/lib/{cjs/components → esm/components/line_items}/LineItemAmount.d.ts +2 -2
- package/lib/esm/components/line_items/LineItemAmount.js +1 -0
- package/lib/esm/components/{LineItemCode.d.ts → line_items/LineItemCode.d.ts} +2 -2
- package/lib/esm/components/line_items/LineItemCode.js +1 -0
- package/lib/esm/components/{LineItemImage.d.ts → line_items/LineItemImage.d.ts} +3 -3
- package/lib/esm/components/line_items/LineItemImage.js +1 -0
- package/lib/esm/components/{LineItemName.d.ts → line_items/LineItemName.d.ts} +2 -2
- package/lib/esm/components/line_items/LineItemName.js +1 -0
- package/lib/esm/components/{LineItemOption.d.ts → line_items/LineItemOption.d.ts} +1 -1
- package/lib/esm/components/line_items/LineItemOption.js +1 -0
- package/lib/esm/components/{LineItemOptions.d.ts → line_items/LineItemOptions.d.ts} +0 -0
- package/lib/esm/components/line_items/LineItemOptions.js +1 -0
- package/lib/{cjs/components → esm/components/line_items}/LineItemQuantity.d.ts +1 -1
- package/lib/esm/components/line_items/LineItemQuantity.js +1 -0
- package/lib/esm/components/{LineItemRemoveLink.d.ts → line_items/LineItemRemoveLink.d.ts} +1 -1
- package/lib/esm/components/line_items/LineItemRemoveLink.js +1 -0
- package/lib/{cjs/components → esm/components/line_items}/LineItemsContainer.d.ts +2 -2
- package/lib/esm/components/line_items/LineItemsContainer.js +1 -0
- package/lib/{cjs/components → esm/components/line_items}/LineItemsCount.d.ts +2 -2
- package/lib/esm/components/line_items/LineItemsCount.js +1 -0
- package/lib/esm/components/{LineItemsEmpty.d.ts → line_items/LineItemsEmpty.d.ts} +1 -1
- package/lib/esm/components/line_items/LineItemsEmpty.js +1 -0
- package/lib/esm/components/orders/AddToCartButton.d.ts +3 -3
- package/lib/esm/components/orders/AddToCartButton.js +1 -1
- package/lib/esm/components/orders/AdjustmentAmount.d.ts +2 -16
- package/lib/esm/components/orders/AdjustmentAmount.js +1 -1
- package/lib/esm/components/orders/CartLink.js +1 -1
- package/lib/esm/components/{CheckoutLink.d.ts → orders/CheckoutLink.d.ts} +1 -11
- package/lib/esm/components/orders/CheckoutLink.js +1 -0
- package/lib/esm/components/{DiscountAmount.d.ts → orders/DiscountAmount.d.ts} +3 -3
- package/lib/esm/components/orders/DiscountAmount.js +1 -0
- package/lib/{cjs/components → esm/components/orders}/ItemContainer.d.ts +1 -1
- package/lib/esm/components/orders/ItemContainer.js +1 -0
- package/lib/esm/components/orders/OrderContainer.d.ts +1 -1
- package/lib/esm/components/orders/OrderList.d.ts +1 -1
- package/lib/esm/components/orders/OrderListRow.d.ts +2 -2
- package/lib/esm/components/orders/OrderStorage.d.ts +1 -1
- package/lib/esm/components/orders/PlaceOrderButton.d.ts +1 -1
- package/lib/esm/components/orders/PlaceOrderButton.js +1 -1
- package/lib/esm/components/orders/PlaceOrderContainer.d.ts +1 -1
- package/lib/esm/components/orders/PlaceOrderContainer.js +1 -1
- package/lib/{cjs/components → esm/components/orders}/ShippingAmount.d.ts +2 -2
- package/lib/esm/components/orders/ShippingAmount.js +1 -0
- package/lib/esm/components/{gateways → payment_gateways}/AdyenGateway.d.ts +1 -1
- package/lib/esm/components/payment_gateways/AdyenGateway.js +1 -0
- package/lib/{cjs/components/gateways → esm/components/payment_gateways}/BraintreeGateway.d.ts +1 -1
- package/lib/esm/components/payment_gateways/BraintreeGateway.js +1 -0
- package/lib/esm/components/{gateways → payment_gateways}/CheckoutComGateway.d.ts +1 -1
- package/lib/esm/components/payment_gateways/CheckoutComGateway.js +1 -0
- package/lib/{cjs/components/gateways → esm/components/payment_gateways}/KlarnaGateway.d.ts +1 -1
- package/lib/esm/components/payment_gateways/KlarnaGateway.js +1 -0
- package/lib/esm/components/{PaymentGateway.d.ts → payment_gateways/PaymentGateway.d.ts} +2 -2
- package/lib/esm/components/payment_gateways/PaymentGateway.js +1 -0
- package/lib/esm/components/{gateways → payment_gateways}/PaypalGateway.d.ts +1 -1
- package/lib/esm/components/payment_gateways/PaypalGateway.js +1 -0
- package/lib/esm/components/{gateways → payment_gateways}/StripeGateway.d.ts +1 -1
- package/lib/esm/components/payment_gateways/StripeGateway.js +1 -0
- package/lib/esm/components/{gateways → payment_gateways}/WireTransferGateway.d.ts +1 -1
- package/lib/esm/components/payment_gateways/WireTransferGateway.js +1 -0
- package/lib/esm/components/{PaymentMethod.d.ts → payment_methods/PaymentMethod.d.ts} +8 -3
- package/lib/esm/components/payment_methods/PaymentMethod.js +1 -0
- package/lib/esm/components/{PaymentMethodAmount.d.ts → payment_methods/PaymentMethodAmount.d.ts} +3 -3
- package/lib/esm/components/payment_methods/PaymentMethodAmount.js +1 -0
- package/lib/{cjs/components → esm/components/payment_methods}/PaymentMethodName.d.ts +2 -2
- package/lib/esm/components/payment_methods/PaymentMethodName.js +1 -0
- package/lib/esm/components/{PaymentMethodPrice.d.ts → payment_methods/PaymentMethodPrice.d.ts} +2 -2
- package/lib/esm/components/payment_methods/PaymentMethodPrice.js +1 -0
- package/lib/esm/components/{PaymentMethodRadioButton.d.ts → payment_methods/PaymentMethodRadioButton.d.ts} +2 -2
- package/lib/esm/components/payment_methods/PaymentMethodRadioButton.js +1 -0
- package/lib/{cjs/components → esm/components/payment_methods}/PaymentMethodsContainer.d.ts +2 -2
- package/lib/esm/components/payment_methods/PaymentMethodsContainer.js +1 -0
- package/lib/esm/components/payment_source/AdyenPayment.d.ts +55 -0
- package/lib/esm/components/payment_source/AdyenPayment.js +1 -0
- package/lib/esm/components/{BraintreePayment.d.ts → payment_source/BraintreePayment.d.ts} +0 -0
- package/lib/esm/components/payment_source/BraintreePayment.js +1 -0
- package/lib/{cjs/components → esm/components/payment_source}/CheckoutComPayment.d.ts +1 -1
- package/lib/esm/components/payment_source/CheckoutComPayment.js +1 -0
- package/lib/esm/components/{KlarnaPayment.d.ts → payment_source/KlarnaPayment.d.ts} +1 -1
- package/lib/esm/components/payment_source/KlarnaPayment.js +1 -0
- package/lib/esm/components/{PaymentSource.d.ts → payment_source/PaymentSource.d.ts} +4 -4
- package/lib/esm/components/payment_source/PaymentSource.js +1 -0
- package/lib/{cjs/components → esm/components/payment_source}/PaymentSourceBrandIcon.d.ts +2 -2
- package/lib/esm/components/payment_source/PaymentSourceBrandIcon.js +1 -0
- package/lib/{cjs/components → esm/components/payment_source}/PaymentSourceBrandName.d.ts +2 -2
- package/lib/esm/components/payment_source/PaymentSourceBrandName.js +1 -0
- package/lib/{cjs/components → esm/components/payment_source}/PaymentSourceDetail.d.ts +2 -2
- package/lib/esm/components/payment_source/PaymentSourceDetail.js +1 -0
- package/lib/esm/components/{PaymentSourceEditButton.d.ts → payment_source/PaymentSourceEditButton.d.ts} +2 -2
- package/lib/esm/components/payment_source/PaymentSourceEditButton.js +1 -0
- package/lib/esm/components/{PaypalPayment.d.ts → payment_source/PaypalPayment.d.ts} +0 -0
- package/lib/esm/components/payment_source/PaypalPayment.js +1 -0
- package/lib/esm/components/{StripePayment.d.ts → payment_source/StripePayment.d.ts} +1 -1
- package/lib/esm/components/payment_source/StripePayment.js +1 -0
- package/lib/esm/components/{WireTransferPayment.d.ts → payment_source/WireTransferPayment.d.ts} +3 -1
- package/lib/esm/components/payment_source/WireTransferPayment.js +1 -0
- package/lib/esm/components/{Price.d.ts → prices/Price.d.ts} +1 -1
- package/lib/esm/components/prices/Price.js +1 -0
- package/lib/{cjs/components → esm/components/prices}/PricesContainer.d.ts +3 -3
- package/lib/esm/components/prices/PricesContainer.js +1 -0
- package/lib/esm/components/shipments/Shipment.d.ts +1 -1
- package/lib/esm/components/shipments/ShipmentField.d.ts +3 -3
- package/lib/esm/components/shipments/ShipmentsContainer.d.ts +1 -1
- package/lib/esm/components/shipping_methods/ShippingMethod.d.ts +1 -1
- package/lib/esm/components/shipping_methods/ShippingMethodName.d.ts +2 -2
- package/lib/esm/components/shipping_methods/ShippingMethodRadioButton.d.ts +2 -2
- package/lib/esm/components/{AvailabilityContainer.d.ts → skus/AvailabilityContainer.d.ts} +1 -1
- package/lib/esm/components/skus/AvailabilityContainer.js +1 -0
- package/lib/{cjs/components → esm/components/skus}/AvailabilityTemplate.d.ts +2 -2
- package/lib/esm/components/skus/AvailabilityTemplate.js +1 -0
- package/lib/{cjs/components → esm/components/skus}/DeliveryLeadTime.d.ts +3 -3
- package/lib/esm/components/skus/DeliveryLeadTime.js +1 -0
- package/lib/esm/components/{QuantitySelector.d.ts → skus/QuantitySelector.d.ts} +1 -1
- package/lib/esm/components/skus/QuantitySelector.js +1 -0
- package/lib/esm/components/skus/SkuList.d.ts +1 -1
- package/lib/esm/components/skus/SkuListsContainer.d.ts +1 -1
- package/lib/esm/components/skus/SkuOption.d.ts +1 -1
- package/lib/esm/components/skus/SkuOptionInput.d.ts +1 -1
- package/lib/esm/components/skus/SkuOptionsContainer.d.ts +1 -1
- package/lib/esm/components/skus/Skus.d.ts +1 -1
- package/lib/esm/components/skus/SkusContainer.d.ts +0 -5
- package/lib/esm/components/skus/SkusContainer.js +1 -1
- package/lib/esm/components/{VariantSelector.d.ts → skus/VariantSelector.d.ts} +6 -6
- package/lib/esm/components/skus/VariantSelector.js +1 -0
- package/lib/esm/components/{VariantsContainer.d.ts → skus/VariantsContainer.d.ts} +1 -1
- package/lib/esm/components/skus/VariantsContainer.js +1 -0
- package/lib/{cjs/components → esm/components/stock_transfers}/StockTransfer.d.ts +1 -1
- package/lib/esm/components/stock_transfers/StockTransfer.js +1 -0
- package/lib/{cjs/components → esm/components/stock_transfers}/StockTransferField.d.ts +2 -2
- package/lib/esm/components/stock_transfers/StockTransferField.js +1 -0
- package/lib/esm/components/utils/BaseField.d.ts +2 -2
- package/lib/esm/components/utils/BaseOrderPrice.js +1 -1
- package/lib/esm/components/utils/Parent.d.ts +5 -5
- package/lib/esm/components/utils/Parent.js +1 -1
- package/lib/esm/components/utils/PriceTemplate.d.ts +1 -1
- package/lib/esm/components/utils/VariantTemplate.d.ts +3 -3
- package/lib/esm/components/utils/VariantTemplate.js +1 -1
- package/lib/esm/components/utils/getAllErrors.d.ts +2 -2
- package/lib/esm/config/components.d.ts +66 -66
- package/lib/esm/context/OrderListChildrenContext.d.ts +3 -3
- package/lib/esm/context/PlaceOrderContext.d.ts +2 -1
- package/lib/esm/index.d.ts +55 -55
- package/lib/esm/index.js +1 -1
- package/lib/esm/reducers/AddressReducer.d.ts +1 -0
- package/lib/esm/reducers/PaymentMethodReducer.d.ts +7 -6
- package/lib/esm/reducers/PlaceOrderReducer.d.ts +7 -4
- package/lib/esm/reducers/PlaceOrderReducer.js +1 -1
- package/lib/esm/reducers/VariantReducer.d.ts +1 -1
- package/lib/esm/typings/errors.d.ts +2 -2
- package/lib/esm/typings/index.d.ts +10 -10
- package/lib/esm/utils/childrenTypes.d.ts +1 -1
- package/lib/esm/utils/getCardDetails.js +1 -1
- package/lib/esm/utils/getLoaderComponent.js +1 -1
- package/lib/esm/utils/paypalPayment.d.ts +1 -1
- package/lib/tsconfig.prod.esm.tsbuildinfo +1 -1
- package/lib/tsconfig.prod.tsbuildinfo +1 -1
- package/package.json +76 -20
- package/lib/cjs/components/AdjustmentAmount.d.ts +0 -4
- package/lib/cjs/components/AdjustmentAmount.js +0 -1
- package/lib/cjs/components/AdyenPayment.d.ts +0 -25
- package/lib/cjs/components/AdyenPayment.js +0 -1
- package/lib/cjs/components/AvailabilityContainer.js +0 -1
- package/lib/cjs/components/AvailabilityTemplate.js +0 -1
- package/lib/cjs/components/BillingAddressContainer.d.ts +0 -11
- package/lib/cjs/components/BillingAddressContainer.js +0 -1
- package/lib/cjs/components/BillingAddressForm.js +0 -1
- package/lib/cjs/components/BraintreePayment.js +0 -1
- package/lib/cjs/components/CartLink.d.ts +0 -12
- package/lib/cjs/components/CartLink.js +0 -1
- package/lib/cjs/components/CheckoutComPayment.js +0 -1
- package/lib/cjs/components/CheckoutLink.js +0 -1
- package/lib/cjs/components/DeliveryLeadTime.js +0 -1
- package/lib/cjs/components/DiscountAmount.js +0 -1
- package/lib/cjs/components/GiftCard.js +0 -1
- package/lib/cjs/components/GiftCardContainer.js +0 -1
- package/lib/cjs/components/GiftCardCurrencySelector.js +0 -1
- package/lib/cjs/components/GiftCardInput.js +0 -1
- package/lib/cjs/components/GiftCardOrCouponCode.js +0 -1
- package/lib/cjs/components/GiftCardOrCouponForm.js +0 -1
- package/lib/cjs/components/GiftCardOrCouponInput.js +0 -1
- package/lib/cjs/components/GiftCardOrCouponRemoveButton.js +0 -1
- package/lib/cjs/components/GiftCardOrCouponSubmit.js +0 -1
- package/lib/cjs/components/ItemContainer.js +0 -1
- package/lib/cjs/components/KlarnaPayment.js +0 -1
- package/lib/cjs/components/LineItem.js +0 -1
- package/lib/cjs/components/LineItemAmount.js +0 -1
- package/lib/cjs/components/LineItemCode.js +0 -1
- package/lib/cjs/components/LineItemImage.js +0 -1
- package/lib/cjs/components/LineItemName.js +0 -1
- package/lib/cjs/components/LineItemOption.js +0 -1
- package/lib/cjs/components/LineItemOptions.js +0 -1
- package/lib/cjs/components/LineItemQuantity.js +0 -1
- package/lib/cjs/components/LineItemRemoveLink.js +0 -1
- package/lib/cjs/components/LineItemsContainer.js +0 -1
- package/lib/cjs/components/LineItemsCount.js +0 -1
- package/lib/cjs/components/LineItemsEmpty.js +0 -1
- package/lib/cjs/components/PaymentGateway.js +0 -1
- package/lib/cjs/components/PaymentMethod.js +0 -1
- package/lib/cjs/components/PaymentMethodAmount.js +0 -1
- package/lib/cjs/components/PaymentMethodName.js +0 -1
- package/lib/cjs/components/PaymentMethodPrice.js +0 -1
- package/lib/cjs/components/PaymentMethodRadioButton.js +0 -1
- package/lib/cjs/components/PaymentMethodsContainer.js +0 -1
- package/lib/cjs/components/PaymentSource.js +0 -1
- package/lib/cjs/components/PaymentSourceBrandIcon.js +0 -1
- package/lib/cjs/components/PaymentSourceBrandName.js +0 -1
- package/lib/cjs/components/PaymentSourceDetail.js +0 -1
- package/lib/cjs/components/PaymentSourceEditButton.js +0 -1
- package/lib/cjs/components/PaypalPayment.js +0 -1
- package/lib/cjs/components/Price.js +0 -1
- package/lib/cjs/components/PricesContainer.js +0 -1
- package/lib/cjs/components/QuantitySelector.js +0 -1
- package/lib/cjs/components/SaveAddressesButton.d.ts +0 -23
- package/lib/cjs/components/SaveAddressesButton.js +0 -1
- package/lib/cjs/components/SaveCustomerButton.d.ts +0 -24
- package/lib/cjs/components/ShippingAddressContainer.js +0 -1
- package/lib/cjs/components/ShippingAddressForm.js +0 -1
- package/lib/cjs/components/ShippingAmount.js +0 -1
- package/lib/cjs/components/SkuField.d.ts +0 -10
- package/lib/cjs/components/SkuField.js +0 -1
- package/lib/cjs/components/Skus.d.ts +0 -11
- package/lib/cjs/components/Skus.js +0 -1
- package/lib/cjs/components/SkusContainer.d.ts +0 -14
- package/lib/cjs/components/SkusContainer.js +0 -1
- package/lib/cjs/components/StockTransfer.js +0 -1
- package/lib/cjs/components/StockTransferField.js +0 -1
- package/lib/cjs/components/StripePayment.js +0 -1
- package/lib/cjs/components/VariantSelector.js +0 -1
- package/lib/cjs/components/VariantsContainer.js +0 -1
- package/lib/cjs/components/WireTransferPayment.js +0 -1
- package/lib/cjs/components/gateways/AdyenGateway.js +0 -1
- package/lib/cjs/components/gateways/BraintreeGateway.js +0 -1
- package/lib/cjs/components/gateways/CheckoutComGateway.js +0 -1
- package/lib/cjs/components/gateways/KlarnaGateway.js +0 -1
- package/lib/cjs/components/gateways/PaypalGateway.js +0 -1
- package/lib/cjs/components/gateways/StripeGateway.js +0 -1
- package/lib/cjs/components/gateways/WireTransferGateway.js +0 -1
- package/lib/esm/components/AdjustmentAmount.d.ts +0 -4
- package/lib/esm/components/AdjustmentAmount.js +0 -1
- package/lib/esm/components/AdyenPayment.d.ts +0 -25
- package/lib/esm/components/AdyenPayment.js +0 -1
- package/lib/esm/components/AvailabilityContainer.js +0 -1
- package/lib/esm/components/AvailabilityTemplate.js +0 -1
- package/lib/esm/components/BillingAddressContainer.d.ts +0 -11
- package/lib/esm/components/BillingAddressContainer.js +0 -1
- package/lib/esm/components/BillingAddressForm.js +0 -1
- package/lib/esm/components/BraintreePayment.js +0 -1
- package/lib/esm/components/CartLink.d.ts +0 -12
- package/lib/esm/components/CartLink.js +0 -1
- package/lib/esm/components/CheckoutComPayment.js +0 -1
- package/lib/esm/components/CheckoutLink.js +0 -1
- package/lib/esm/components/DeliveryLeadTime.js +0 -1
- package/lib/esm/components/DiscountAmount.js +0 -1
- package/lib/esm/components/GiftCard.js +0 -1
- package/lib/esm/components/GiftCardContainer.js +0 -1
- package/lib/esm/components/GiftCardCurrencySelector.js +0 -1
- package/lib/esm/components/GiftCardInput.js +0 -1
- package/lib/esm/components/GiftCardOrCouponCode.js +0 -1
- package/lib/esm/components/GiftCardOrCouponForm.js +0 -1
- package/lib/esm/components/GiftCardOrCouponInput.js +0 -1
- package/lib/esm/components/GiftCardOrCouponRemoveButton.js +0 -1
- package/lib/esm/components/GiftCardOrCouponSubmit.js +0 -1
- package/lib/esm/components/ItemContainer.js +0 -1
- package/lib/esm/components/KlarnaPayment.js +0 -1
- package/lib/esm/components/LineItem.js +0 -1
- package/lib/esm/components/LineItemAmount.js +0 -1
- package/lib/esm/components/LineItemCode.js +0 -1
- package/lib/esm/components/LineItemImage.js +0 -1
- package/lib/esm/components/LineItemName.js +0 -1
- package/lib/esm/components/LineItemOption.js +0 -1
- package/lib/esm/components/LineItemOptions.js +0 -1
- package/lib/esm/components/LineItemQuantity.js +0 -1
- package/lib/esm/components/LineItemRemoveLink.js +0 -1
- package/lib/esm/components/LineItemsContainer.js +0 -1
- package/lib/esm/components/LineItemsCount.js +0 -1
- package/lib/esm/components/LineItemsEmpty.js +0 -1
- package/lib/esm/components/PaymentGateway.js +0 -1
- package/lib/esm/components/PaymentMethod.js +0 -1
- package/lib/esm/components/PaymentMethodAmount.js +0 -1
- package/lib/esm/components/PaymentMethodName.js +0 -1
- package/lib/esm/components/PaymentMethodPrice.js +0 -1
- package/lib/esm/components/PaymentMethodRadioButton.js +0 -1
- package/lib/esm/components/PaymentMethodsContainer.js +0 -1
- package/lib/esm/components/PaymentSource.js +0 -1
- package/lib/esm/components/PaymentSourceBrandIcon.js +0 -1
- package/lib/esm/components/PaymentSourceBrandName.js +0 -1
- package/lib/esm/components/PaymentSourceDetail.js +0 -1
- package/lib/esm/components/PaymentSourceEditButton.js +0 -1
- package/lib/esm/components/PaypalPayment.js +0 -1
- package/lib/esm/components/Price.js +0 -1
- package/lib/esm/components/PricesContainer.js +0 -1
- package/lib/esm/components/QuantitySelector.js +0 -1
- package/lib/esm/components/SaveAddressesButton.d.ts +0 -23
- package/lib/esm/components/SaveAddressesButton.js +0 -1
- package/lib/esm/components/SaveCustomerButton.d.ts +0 -24
- package/lib/esm/components/SaveCustomerButton.js +0 -1
- package/lib/esm/components/ShippingAddressContainer.js +0 -1
- package/lib/esm/components/ShippingAddressForm.js +0 -1
- package/lib/esm/components/ShippingAmount.js +0 -1
- package/lib/esm/components/SkuField.d.ts +0 -10
- package/lib/esm/components/SkuField.js +0 -1
- package/lib/esm/components/Skus.d.ts +0 -11
- package/lib/esm/components/Skus.js +0 -1
- package/lib/esm/components/SkusContainer.d.ts +0 -14
- package/lib/esm/components/SkusContainer.js +0 -1
- package/lib/esm/components/StockTransfer.js +0 -1
- package/lib/esm/components/StockTransferField.js +0 -1
- package/lib/esm/components/StripePayment.js +0 -1
- package/lib/esm/components/VariantSelector.js +0 -1
- package/lib/esm/components/VariantsContainer.js +0 -1
- package/lib/esm/components/WireTransferPayment.js +0 -1
- package/lib/esm/components/gateways/AdyenGateway.js +0 -1
- package/lib/esm/components/gateways/BraintreeGateway.js +0 -1
- package/lib/esm/components/gateways/CheckoutComGateway.js +0 -1
- package/lib/esm/components/gateways/KlarnaGateway.js +0 -1
- package/lib/esm/components/gateways/PaypalGateway.js +0 -1
- package/lib/esm/components/gateways/StripeGateway.js +0 -1
- package/lib/esm/components/gateways/WireTransferGateway.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.Errors=void 0;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),react_1=require("react"),Parent_1=tslib_1.__importDefault(require("./utils/Parent")),GiftCardContext_1=tslib_1.__importDefault(require("../context/GiftCardContext")),OrderContext_1=tslib_1.__importDefault(require("../context/OrderContext")),AddressContext_1=tslib_1.__importDefault(require("../context/AddressContext")),getAllErrors_1=tslib_1.__importDefault(require("./utils/getAllErrors")),LineItemContext_1=tslib_1.__importDefault(require("../context/LineItemContext")),LineItemChildrenContext_1=tslib_1.__importDefault(require("../context/LineItemChildrenContext")),CustomerContext_1=tslib_1.__importDefault(require("../context/CustomerContext")),PaymentMethodContext_1=tslib_1.__importDefault(require("../context/PaymentMethodContext")),PaymentMethodChildrenContext_1=tslib_1.__importDefault(require("../context/PaymentMethodChildrenContext")),ShipmentContext_1=tslib_1.__importDefault(require("../context/ShipmentContext"));function Errors(props){const{children,messages=[],resource,field,...p}=props,{payment}=(0,react_1.useContext)(PaymentMethodChildrenContext_1.default),{errors:orderErrors}=(0,react_1.useContext)(OrderContext_1.default),{errors:giftCardErrors}=(0,react_1.useContext)(GiftCardContext_1.default),{errors:lineItemErrors}=(0,react_1.useContext)(LineItemContext_1.default),{errors:addressErrors}=(0,react_1.useContext)(AddressContext_1.default),{errors:customerErrors}=(0,react_1.useContext)(CustomerContext_1.default),{errors:shipmentErrors}=(0,react_1.useContext)(ShipmentContext_1.default),{errors:paymentMethodErrors,currentPaymentMethodType,currentPaymentMethodId}=(0,react_1.useContext)(PaymentMethodContext_1.default),{lineItem}=(0,react_1.useContext)(LineItemChildrenContext_1.default),allErrors=(0,react_1.useMemo)(()=>[...giftCardErrors||[],...orderErrors||[],...lineItemErrors||[],...addressErrors||[],...customerErrors||[],...shipmentErrors||[],...paymentMethodErrors?.filter(v=>v.field===currentPaymentMethodType&&payment?.id===currentPaymentMethodId)||[]],[giftCardErrors,orderErrors,lineItemErrors,addressErrors,customerErrors,shipmentErrors,paymentMethodErrors]).filter((v,k,a)=>v?.code!==a[k-1]?.code),msgErrors=(0,getAllErrors_1.default)({allErrors,field,messages,props:p,lineItem,resource,returnHtml:!children})
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.Errors=void 0;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),react_1=require("react"),Parent_1=tslib_1.__importDefault(require("./utils/Parent")),GiftCardContext_1=tslib_1.__importDefault(require("../context/GiftCardContext")),OrderContext_1=tslib_1.__importDefault(require("../context/OrderContext")),AddressContext_1=tslib_1.__importDefault(require("../context/AddressContext")),getAllErrors_1=tslib_1.__importDefault(require("./utils/getAllErrors")),LineItemContext_1=tslib_1.__importDefault(require("../context/LineItemContext")),LineItemChildrenContext_1=tslib_1.__importDefault(require("../context/LineItemChildrenContext")),CustomerContext_1=tslib_1.__importDefault(require("../context/CustomerContext")),PaymentMethodContext_1=tslib_1.__importDefault(require("../context/PaymentMethodContext")),PaymentMethodChildrenContext_1=tslib_1.__importDefault(require("../context/PaymentMethodChildrenContext")),ShipmentContext_1=tslib_1.__importDefault(require("../context/ShipmentContext"));function Errors(props){const{children,messages=[],resource,field,...p}=props,{payment}=(0,react_1.useContext)(PaymentMethodChildrenContext_1.default),{errors:orderErrors}=(0,react_1.useContext)(OrderContext_1.default),{errors:giftCardErrors}=(0,react_1.useContext)(GiftCardContext_1.default),{errors:lineItemErrors}=(0,react_1.useContext)(LineItemContext_1.default),{errors:addressErrors}=(0,react_1.useContext)(AddressContext_1.default),{errors:customerErrors}=(0,react_1.useContext)(CustomerContext_1.default),{errors:shipmentErrors}=(0,react_1.useContext)(ShipmentContext_1.default),{errors:paymentMethodErrors,currentPaymentMethodType,currentPaymentMethodId}=(0,react_1.useContext)(PaymentMethodContext_1.default),{lineItem}=(0,react_1.useContext)(LineItemChildrenContext_1.default),allErrors=(0,react_1.useMemo)(()=>[...giftCardErrors||[],...orderErrors||[],...lineItemErrors||[],...addressErrors||[],...customerErrors||[],...shipmentErrors||[],...paymentMethodErrors?.filter(v=>v.field===currentPaymentMethodType&&payment?.id===currentPaymentMethodId)||[]],[giftCardErrors,orderErrors,lineItemErrors,addressErrors,customerErrors,shipmentErrors,paymentMethodErrors]).filter((v,k,a)=>v?.code!==a[k-1]?.code),msgErrors=(0,getAllErrors_1.default)({allErrors,field,messages,props:p,lineItem,resource,returnHtml:!children}),parentProps={messages,resource,field,errors:msgErrors,...p};return children?(0,jsx_runtime_1.jsx)(Parent_1.default,{...parentProps,children}):(0,jsx_runtime_1.jsx)(react_1.Fragment,{children:msgErrors})}exports.Errors=Errors,exports.default=Errors;
|
|
@@ -6,7 +6,7 @@ declare type Props = {
|
|
|
6
6
|
export declare function ExternalFunction({ children, url }: Props): JSX.Element;
|
|
7
7
|
export declare namespace ExternalFunction {
|
|
8
8
|
var propTypes: {
|
|
9
|
-
children: import("prop-types").Validator<
|
|
9
|
+
children: import("prop-types").Validator<NonNullable<ReactNode | (() => JSX.Element)>>;
|
|
10
10
|
url: import("prop-types").Validator<string>;
|
|
11
11
|
};
|
|
12
12
|
var displayName: string;
|
|
@@ -6,7 +6,7 @@ export declare namespace MetadataInput {
|
|
|
6
6
|
var propTypes: {
|
|
7
7
|
children: import("prop-types").Requireable<(...args: any[]) => any>;
|
|
8
8
|
name: import("prop-types").Validator<string>;
|
|
9
|
-
type: import("prop-types").Validator<import("../typings/index").BaseInputType
|
|
9
|
+
type: import("prop-types").Validator<NonNullable<import("../typings/index").BaseInputType>>;
|
|
10
10
|
onChange: import("prop-types").Requireable<(...args: any[]) => any>;
|
|
11
11
|
placeholder: import("prop-types").Requireable<string>;
|
|
12
12
|
};
|
|
@@ -9,7 +9,7 @@ export declare function SubmitButton(props: Props): JSX.Element;
|
|
|
9
9
|
export declare namespace SubmitButton {
|
|
10
10
|
var propTypes: {
|
|
11
11
|
children: import("prop-types").Requireable<(...args: any[]) => any>;
|
|
12
|
-
label: import("prop-types").Requireable<string | import("prop-types").ReactElementLike
|
|
12
|
+
label: import("prop-types").Requireable<NonNullable<string | import("prop-types").ReactElementLike | null | undefined>>;
|
|
13
13
|
};
|
|
14
14
|
var defaultProps: {
|
|
15
15
|
label: string;
|
|
@@ -12,7 +12,7 @@ declare type Props = {
|
|
|
12
12
|
export declare function Address(props: Props): JSX.Element;
|
|
13
13
|
export declare namespace Address {
|
|
14
14
|
var propTypes: {
|
|
15
|
-
children: import("prop-types").Validator<
|
|
15
|
+
children: import("prop-types").Validator<NonNullable<ReactNode | (() => JSX.Element)>>;
|
|
16
16
|
};
|
|
17
17
|
}
|
|
18
18
|
export default Address;
|
|
@@ -12,10 +12,10 @@ export declare namespace AddressCountrySelector {
|
|
|
12
12
|
children: import("prop-types").Requireable<(...args: any[]) => any>;
|
|
13
13
|
placeholder: import("prop-types").Requireable<import("prop-types").InferProps<{
|
|
14
14
|
label: import("prop-types").Validator<string>;
|
|
15
|
-
value: import("prop-types").Validator<string | number
|
|
15
|
+
value: import("prop-types").Validator<NonNullable<NonNullable<string | number | null | undefined>>>;
|
|
16
16
|
}>>;
|
|
17
17
|
value: import("prop-types").Requireable<string>;
|
|
18
|
-
name: import("prop-types").Validator<AddressCountrySelectName
|
|
18
|
+
name: import("prop-types").Validator<NonNullable<AddressCountrySelectName>>;
|
|
19
19
|
required: import("prop-types").Requireable<boolean>;
|
|
20
20
|
};
|
|
21
21
|
var defaultProps: {
|
|
@@ -8,28 +8,28 @@ declare type Props = {
|
|
|
8
8
|
type?: 'field';
|
|
9
9
|
label?: never;
|
|
10
10
|
onClick?: never;
|
|
11
|
-
children?: (props: AddressFieldChildrenProps) =>
|
|
11
|
+
children?: (props: AddressFieldChildrenProps) => JSX.Element;
|
|
12
12
|
name: AddressFieldView;
|
|
13
13
|
className?: string;
|
|
14
14
|
} | {
|
|
15
15
|
type?: 'edit';
|
|
16
16
|
label: string | ReactNode;
|
|
17
17
|
onClick: (address: Address) => void;
|
|
18
|
-
children?: (props: AddressFieldChildrenProps) =>
|
|
18
|
+
children?: (props: AddressFieldChildrenProps) => JSX.Element;
|
|
19
19
|
name?: AddressFieldView;
|
|
20
20
|
className?: string;
|
|
21
21
|
} | {
|
|
22
22
|
type?: 'delete';
|
|
23
23
|
label: string;
|
|
24
24
|
onClick: () => void;
|
|
25
|
-
children?: (props: AddressFieldChildrenProps) =>
|
|
25
|
+
children?: (props: AddressFieldChildrenProps) => JSX.Element;
|
|
26
26
|
name?: AddressFieldView;
|
|
27
27
|
className?: string;
|
|
28
28
|
} | {
|
|
29
29
|
type?: 'edit' | 'field' | 'delete';
|
|
30
30
|
label?: never;
|
|
31
31
|
onClick?: never;
|
|
32
|
-
children: (props: AddressFieldChildrenProps) =>
|
|
32
|
+
children: (props: AddressFieldChildrenProps) => JSX.Element;
|
|
33
33
|
name?: never;
|
|
34
34
|
className?: string;
|
|
35
35
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.AddressField=void 0;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),react_1=require("react"),AddressChildrenContext_1=tslib_1.__importDefault(require("../../context/AddressChildrenContext")),Parent_1=tslib_1.__importDefault(require("../utils/Parent")),components_1=tslib_1.__importDefault(require("../../config/components")),CustomerContext_1=tslib_1.__importDefault(require("../../context/CustomerContext")),propTypes=components_1.default.AddressField.propTypes,displayName=components_1.default.AddressField.displayName;function AddressField(props){const{name,type="field",label,onClick,...p}=props,{address}=(0,react_1.useContext)(AddressChildrenContext_1.default),text=name&&address?address?.[name]:"",{deleteCustomerAddress}=(0,react_1.useContext)(CustomerContext_1.default),handleClick=e=>{e.stopPropagation(),e.preventDefault(),type==="delete"&&deleteCustomerAddress&&address?.reference&&deleteCustomerAddress({customerAddressId:address?.reference}),address&&onClick&&onClick(address)},parentProps={address,...props};return props.children?(0,jsx_runtime_1.jsx)(Parent_1.default,{...parentProps,children:props.children}):type==="field"?(0,jsx_runtime_1.jsx)("p",{...p,name,children:text}):(0,jsx_runtime_1.jsx)("a",{...p,onClick:handleClick,children:
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.AddressField=void 0;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),react_1=require("react"),AddressChildrenContext_1=tslib_1.__importDefault(require("../../context/AddressChildrenContext")),Parent_1=tslib_1.__importDefault(require("../utils/Parent")),components_1=tslib_1.__importDefault(require("../../config/components")),CustomerContext_1=tslib_1.__importDefault(require("../../context/CustomerContext")),propTypes=components_1.default.AddressField.propTypes,displayName=components_1.default.AddressField.displayName;function AddressField(props){const{name,type="field",label,onClick,...p}=props,{address}=(0,react_1.useContext)(AddressChildrenContext_1.default),text=name&&address?address?.[name]:"",{deleteCustomerAddress}=(0,react_1.useContext)(CustomerContext_1.default),handleClick=e=>{e.stopPropagation(),e.preventDefault(),type==="delete"&&deleteCustomerAddress&&address?.reference&&deleteCustomerAddress({customerAddressId:address?.reference}),address&&onClick&&onClick(address)},parentProps={address,...props};return props.children?(0,jsx_runtime_1.jsx)(Parent_1.default,{...parentProps,children:props.children}):type==="field"?(0,jsx_runtime_1.jsx)("p",{...p,name,children:text}):(0,jsx_runtime_1.jsx)("a",{...p,onClick:handleClick,children:label})}exports.AddressField=AddressField,AddressField.propTypes=propTypes,AddressField.displayName=displayName,exports.default=AddressField;
|
|
@@ -8,8 +8,8 @@ export declare function AddressInput(props: Props): JSX.Element | null;
|
|
|
8
8
|
export declare namespace AddressInput {
|
|
9
9
|
var propTypes: {
|
|
10
10
|
children: import("prop-types").Requireable<(...args: any[]) => any>;
|
|
11
|
-
name: import("prop-types").Validator<AddressInputName
|
|
12
|
-
type: import("prop-types").Validator<import("../../typings/index").BaseInputType
|
|
11
|
+
name: import("prop-types").Validator<NonNullable<AddressInputName>>;
|
|
12
|
+
type: import("prop-types").Validator<NonNullable<import("../../typings/index").BaseInputType>>;
|
|
13
13
|
placeholder: import("prop-types").Requireable<string>;
|
|
14
14
|
disabled: import("prop-types").Requireable<boolean>;
|
|
15
15
|
required: import("prop-types").Requireable<boolean>;
|
|
@@ -13,10 +13,10 @@ export declare namespace AddressStateSelector {
|
|
|
13
13
|
children: import("prop-types").Requireable<(...args: any[]) => any>;
|
|
14
14
|
placeholder: import("prop-types").Requireable<import("prop-types").InferProps<{
|
|
15
15
|
label: import("prop-types").Validator<string>;
|
|
16
|
-
value: import("prop-types").Validator<string | number
|
|
16
|
+
value: import("prop-types").Validator<NonNullable<NonNullable<string | number | null | undefined>>>;
|
|
17
17
|
}>>;
|
|
18
18
|
value: import("prop-types").Requireable<string>;
|
|
19
|
-
name: import("prop-types").Validator<AddressStateSelectName
|
|
19
|
+
name: import("prop-types").Validator<NonNullable<AddressStateSelectName>>;
|
|
20
20
|
required: import("prop-types").Requireable<boolean>;
|
|
21
21
|
};
|
|
22
22
|
var defaultProps: {
|
|
@@ -7,7 +7,7 @@ declare type Props = {
|
|
|
7
7
|
export declare function AddressesContainer(props: Props): JSX.Element;
|
|
8
8
|
export declare namespace AddressesContainer {
|
|
9
9
|
var propTypes: {
|
|
10
|
-
children: import("prop-types").Validator<
|
|
10
|
+
children: import("prop-types").Validator<NonNullable<ReactNode | (() => JSX.Element)>>;
|
|
11
11
|
shipToDifferentAddress: import("prop-types").Requireable<boolean>;
|
|
12
12
|
};
|
|
13
13
|
var displayName: string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.BillingAddressContainer=void 0;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),BillingAddressContext_1=tslib_1.__importDefault(require("../../context/BillingAddressContext")),react_1=require("react"),BillingAddressReducer_1=tslib_1.__importStar(require("../../reducers/BillingAddressReducer")),CommerceLayerContext_1=tslib_1.__importDefault(require("../../context/CommerceLayerContext")),OrderContext_1=tslib_1.__importDefault(require("../../context/OrderContext")),AddressContext_1=tslib_1.__importDefault(require("../../context/AddressContext"));function BillingAddressContainer(props){const{children}=props,[state,dispatch]=(0,react_1.useReducer)(BillingAddressReducer_1.default,BillingAddressReducer_1.billingAddressInitialState),config=(0,react_1.useContext)(CommerceLayerContext_1.default),{order,include,addResourceToInclude}=(0,react_1.useContext)(OrderContext_1.default),{shipToDifferentAddress,setCloneAddress}=(0,react_1.useContext)(AddressContext_1.default);(0,react_1.useEffect)(()=>(include?.includes("billing_address")||addResourceToInclude({newResource:"billing_address",resourcesIncluded:include}),order&&config&&(0,BillingAddressReducer_1.setBillingCustomerAddressId)({dispatch,order,setCloneAddress}),()=>{dispatch({type:"cleanup",payload:{}})}),[order,include]);const contextValue={...state,setBillingAddress:async(id,options)=>{await(0,BillingAddressReducer_1.setBillingAddress)(id,{config,dispatch,order,shipToDifferentAddress,customerAddressId:options?.customerAddressId}),setCloneAddress(id,"billing_address")}};return(0,jsx_runtime_1.jsx)(BillingAddressContext_1.default.Provider,{value:contextValue,children})}exports.BillingAddressContainer=BillingAddressContainer,exports.default=BillingAddressContainer;
|
|
@@ -7,7 +7,7 @@ declare type Props = {
|
|
|
7
7
|
export declare function BillingAddressForm(props: Props): JSX.Element;
|
|
8
8
|
export declare namespace BillingAddressForm {
|
|
9
9
|
var propTypes: {
|
|
10
|
-
children: import("prop-types").Validator<
|
|
10
|
+
children: import("prop-types").Validator<NonNullable<ReactNode | (() => JSX.Element)>>;
|
|
11
11
|
};
|
|
12
12
|
}
|
|
13
13
|
export default BillingAddressForm;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.BillingAddressForm=void 0;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),AddressContext_1=tslib_1.__importDefault(require("../../context/AddressContext")),rapid_form_1=require("rapid-form"),react_1=require("react"),BillingAddressFormContext_1=tslib_1.__importDefault(require("../../context/BillingAddressFormContext")),lodash_1=require("lodash"),components_1=tslib_1.__importDefault(require("../../config/components")),OrderContext_1=tslib_1.__importDefault(require("../../context/OrderContext")),localStorage_1=require("../../utils/localStorage"),validateFormFields_1=require("../../utils/validateFormFields"),propTypes=components_1.default.BillingAddressForm.propTypes;function BillingAddressForm(props){const{children,errorClassName,autoComplete="on",reset=!1,...p}=props,{validation,values,errors,reset:resetForm}=(0,rapid_form_1.useRapidForm)(),{setAddressErrors,setAddress,isBusiness}=(0,react_1.useContext)(AddressContext_1.default),{saveAddressToCustomerAddressBook,order,include,addResourceToInclude,includeLoaded}=(0,react_1.useContext)(OrderContext_1.default),ref=(0,react_1.useRef)(null);(0,react_1.useEffect)(()=>{if(include?.includes("billing_address")?includeLoaded?.billing_address||addResourceToInclude({newResourceLoaded:{billing_address:!0}}):addResourceToInclude({newResource:"billing_address"}),(0,lodash_1.isEmpty)(errors)){if(values&&Object.keys(values).length>0){setAddressErrors([],"billing_address");for(const name in values){const field=values[name];(0,validateFormFields_1.businessMandatoryField)(name,isBusiness)||delete values[name],(field?.value||field?.required===!1&&field?.type!=="checkbox")&&(values[name.replace("billing_address_","")]=field.value,delete values[name]),field?.type==="checkbox"&&(delete values[name],saveAddressToCustomerAddressBook({type:"billing_address",value:field.checked}))}setAddress({values:{...values,...isBusiness&&{business:isBusiness}},resource:"billing_address"})}}else{const formErrors=[];for(const fieldName in errors){const code=errors[fieldName]?.code,message=errors[fieldName]?.message;["billing_address_state_code"].includes(fieldName)?values?.state_code?formErrors.push({code,message:message||"",resource:"billing_address",field:fieldName}):delete errors[fieldName]:formErrors.push({code,message:message||"",resource:"billing_address",field:fieldName})}setAddressErrors(formErrors,"billing_address")}const checkboxChecked=ref.current?.querySelector('[name="billing_address_save_to_customer_book"]')?.checked||(0,localStorage_1.getSaveBillingAddressToAddressBook)();reset&&(!(0,lodash_1.isEmpty)(values)||!(0,lodash_1.isEmpty)(errors)||checkboxChecked)&&(saveAddressToCustomerAddressBook&&saveAddressToCustomerAddressBook({type:"billing_address",value:!1}),ref&&(ref.current?.reset(),resetForm({target:ref.current}),setAddressErrors([],"billing_address"),setAddress({values:{},resource:"billing_address"})))},[errors,values,reset,include,includeLoaded,isBusiness]);const providerValues={isBusiness,values,validation,setValue:(name,value)=>{const field={[name.replace("billing_address_","")]:value};setAddress({values:{...values,...field,...isBusiness&&{business:isBusiness}},resource:"billing_address"})},errorClassName,requiresBillingInfo:order?.requires_billing_info||!1,errors,resetField:name=>resetForm({currentTarget:ref.current},name)};return(0,jsx_runtime_1.jsx)(BillingAddressFormContext_1.default.Provider,{value:providerValues,children:(0,jsx_runtime_1.jsx)("form",{ref,autoComplete,...p,children})})}exports.BillingAddressForm=BillingAddressForm,BillingAddressForm.propTypes=propTypes,exports.default=BillingAddressForm;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { FunctionChildren } from '../../typings/index';
|
|
3
|
+
declare type ChildrenProps = FunctionChildren<Omit<Props, 'children'>>;
|
|
4
|
+
declare type Props = {
|
|
5
|
+
children?: ChildrenProps;
|
|
6
|
+
label?: string | ReactNode;
|
|
7
|
+
onClick?: () => void;
|
|
8
|
+
addressId?: string;
|
|
9
|
+
} & JSX.IntrinsicElements['button'];
|
|
10
|
+
export declare function SaveAddressesButton(props: Props): JSX.Element;
|
|
11
|
+
export default SaveAddressesButton;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.SaveAddressesButton=void 0;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),react_1=require("react"),Parent_1=tslib_1.__importDefault(require("../utils/Parent")),AddressContext_1=tslib_1.__importDefault(require("../../context/AddressContext")),addressesManager_1=require("../../utils/addressesManager"),OrderContext_1=tslib_1.__importDefault(require("../../context/OrderContext")),CustomerContext_1=tslib_1.__importDefault(require("../../context/CustomerContext")),isFunction_1=tslib_1.__importDefault(require("lodash/isFunction"));function SaveAddressesButton(props){const{children,label="Continue to delivery",resource,disabled=!1,addressId,onClick,...p}=props,{errors,billing_address,shipToDifferentAddress,shipping_address,saveAddresses,billingAddressId,shippingAddressId}=(0,react_1.useContext)(AddressContext_1.default),{order}=(0,react_1.useContext)(OrderContext_1.default),{addresses,isGuest,createCustomerAddress}=(0,react_1.useContext)(CustomerContext_1.default),[forceDisable,setForceDisable]=(0,react_1.useState)(disabled),customerEmail=(isGuest===!0||typeof isGuest>"u")&&!order?.customer_email,billingDisable=(0,addressesManager_1.billingAddressController)({billing_address,errors,billingAddressId,requiresBillingInfo:order?.requires_billing_info}),shippingDisable=(0,addressesManager_1.shippingAddressController)({billingDisable,errors,shipToDifferentAddress,shipping_address,shippingAddressId}),countryLockDisable=(0,addressesManager_1.countryLockController)({countryCodeLock:order?.shipping_country_code_lock,addresses,shipToDifferentAddress,billingAddressId,billing_address,shipping_address,shippingAddressId}),disable=disabled||customerEmail||billingDisable||shippingDisable||countryLockDisable,handleClick=()=>{if(errors&&Object.keys(errors).length===0&&!disable){if(setForceDisable(!0),order)saveAddresses();else if(createCustomerAddress&&billing_address){const address={...billing_address};addressId&&(address.id=addressId),createCustomerAddress(address)}setForceDisable(!1),onClick&&onClick()}},parentProps={...p,label,resource,handleClick,disabled:disable};return children?(0,jsx_runtime_1.jsx)(Parent_1.default,{...parentProps,children}):(0,jsx_runtime_1.jsx)("button",{type:"button",disabled:disable||forceDisable,onClick:handleClick,...p,children:(0,isFunction_1.default)(label)?label():label})}exports.SaveAddressesButton=SaveAddressesButton,exports.default=SaveAddressesButton;
|
|
@@ -5,7 +5,7 @@ declare type Props = {
|
|
|
5
5
|
export declare function ShippingAddressContainer(props: Props): JSX.Element;
|
|
6
6
|
export declare namespace ShippingAddressContainer {
|
|
7
7
|
var propTypes: {
|
|
8
|
-
children: import("prop-types").Validator<
|
|
8
|
+
children: import("prop-types").Validator<NonNullable<ReactNode | (() => JSX.Element)>>;
|
|
9
9
|
};
|
|
10
10
|
}
|
|
11
11
|
export default ShippingAddressContainer;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.ShippingAddressContainer=void 0;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),ShippingAddressContext_1=tslib_1.__importDefault(require("../../context/ShippingAddressContext")),react_1=require("react"),ShippingAddressReducer_1=tslib_1.__importStar(require("../../reducers/ShippingAddressReducer")),CommerceLayerContext_1=tslib_1.__importDefault(require("../../context/CommerceLayerContext")),components_1=tslib_1.__importDefault(require("../../config/components")),OrderContext_1=tslib_1.__importDefault(require("../../context/OrderContext")),AddressContext_1=tslib_1.__importDefault(require("../../context/AddressContext")),propTypes=components_1.default.ShippingAddressContainer.propTypes;function ShippingAddressContainer(props){const{children}=props,[state,dispatch]=(0,react_1.useReducer)(ShippingAddressReducer_1.default,ShippingAddressReducer_1.shippingAddressInitialState),config=(0,react_1.useContext)(CommerceLayerContext_1.default),{order}=(0,react_1.useContext)(OrderContext_1.default),{setCloneAddress}=(0,react_1.useContext)(AddressContext_1.default);(0,react_1.useEffect)(()=>(order&&config&&(0,ShippingAddressReducer_1.setShippingCustomerAddressId)({dispatch,order,setCloneAddress}),()=>{dispatch({type:"cleanup",payload:{}})}),[config,order]);const contextValue={...state,setShippingAddress:async(id,options)=>{await(0,ShippingAddressReducer_1.setShippingAddress)(id,{config,dispatch,order,customerAddressId:options?.customerAddressId}),setCloneAddress(id,"shipping_address")}};return(0,jsx_runtime_1.jsx)(ShippingAddressContext_1.default.Provider,{value:contextValue,children})}exports.ShippingAddressContainer=ShippingAddressContainer,ShippingAddressContainer.propTypes=propTypes,exports.default=ShippingAddressContainer;
|
|
@@ -7,7 +7,7 @@ declare type Props = {
|
|
|
7
7
|
export declare function ShippingAddressForm(props: Props): JSX.Element;
|
|
8
8
|
export declare namespace ShippingAddressForm {
|
|
9
9
|
var propTypes: {
|
|
10
|
-
children: import("prop-types").Validator<
|
|
10
|
+
children: import("prop-types").Validator<NonNullable<ReactNode | (() => JSX.Element)>>;
|
|
11
11
|
};
|
|
12
12
|
}
|
|
13
13
|
export default ShippingAddressForm;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.ShippingAddressForm=void 0;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),AddressContext_1=tslib_1.__importDefault(require("../../context/AddressContext")),rapid_form_1=require("rapid-form"),react_1=require("react"),ShippingAddressFormContext_1=tslib_1.__importDefault(require("../../context/ShippingAddressFormContext")),lodash_1=require("lodash"),components_1=tslib_1.__importDefault(require("../../config/components")),OrderContext_1=tslib_1.__importDefault(require("../../context/OrderContext")),localStorage_1=require("../../utils/localStorage"),validateFormFields_1=require("../../utils/validateFormFields"),propTypes=components_1.default.ShippingAddressForm.propTypes;function ShippingAddressForm(props){const{children,errorClassName,autoComplete="on",reset=!1,...p}=props,{validation,values,errors,reset:resetForm}=(0,rapid_form_1.useRapidForm)(),{setAddressErrors,setAddress,shipToDifferentAddress,isBusiness}=(0,react_1.useContext)(AddressContext_1.default),{saveAddressToCustomerAddressBook,include,addResourceToInclude,includeLoaded}=(0,react_1.useContext)(OrderContext_1.default),ref=(0,react_1.useRef)(null);(0,react_1.useEffect)(()=>{if(include?.includes("shipping_address")?includeLoaded?.shipping_address||addResourceToInclude({newResourceLoaded:{shipping_address:!0}}):addResourceToInclude({newResource:"shipping_address"}),(0,lodash_1.isEmpty)(errors)){if(!(0,lodash_1.isEmpty)(values)&&shipToDifferentAddress){setAddressErrors([],"shipping_address");for(const name in values){const field=values[name];(0,validateFormFields_1.businessMandatoryField)(name,isBusiness)||delete values[name],(field?.value||field?.required===!1&&field?.type!=="checkbox")&&(values[name.replace("shipping_address_","")]=field.value,delete values[name]),field?.type==="checkbox"&&(delete values[name],saveAddressToCustomerAddressBook({type:"shipping_address",value:field.checked}))}setAddress({values:{...values,...isBusiness&&{business:isBusiness}},resource:"shipping_address"})}}else{const formErrors=[];for(const fieldName in errors){const code=errors[fieldName]?.code,message=errors[fieldName]?.message;["shipping_address_state_code"].includes(fieldName)?(0,lodash_1.isEmpty)(values.state_code)?delete errors[fieldName]:formErrors.push({code,message:message||"",resource:"shipping_address",field:fieldName}):formErrors.push({code,message:message||"",resource:"shipping_address",field:fieldName})}shipToDifferentAddress&&setAddressErrors(formErrors,"shipping_address")}const checkboxChecked=ref.current?.querySelector('[name="shipping_address_save_to_customer_book"]')?.checked||(0,localStorage_1.getSaveShippingAddressToAddressBook)();reset&&(!(0,lodash_1.isEmpty)(values)||!(0,lodash_1.isEmpty)(errors)||checkboxChecked)&&(saveAddressToCustomerAddressBook&&saveAddressToCustomerAddressBook({type:"shipping_address",value:!1}),ref&&(ref.current?.reset(),resetForm({target:ref.current}),setAddressErrors([],"shipping_address"),setAddress({values:{},resource:"shipping_address"})))},[values,errors,shipToDifferentAddress,reset,include,includeLoaded,isBusiness]);const providerValues={values,validation,setValue:(name,value)=>{const field={[name.replace("shipping_address_","")]:value};setAddress({values:{...values,...field,...isBusiness&&{business:isBusiness}},resource:"shipping_address"})},errorClassName,errors,resetField:name=>resetForm({currentTarget:ref.current},name)};return(0,jsx_runtime_1.jsx)(ShippingAddressFormContext_1.default.Provider,{value:providerValues,children:(0,jsx_runtime_1.jsx)("form",{ref,autoComplete,...p,children})})}exports.ShippingAddressForm=ShippingAddressForm,ShippingAddressForm.propTypes=propTypes,exports.default=ShippingAddressForm;
|
|
@@ -7,7 +7,7 @@ declare type Props = {
|
|
|
7
7
|
export declare function CommerceLayer(props: Props): JSX.Element;
|
|
8
8
|
export declare namespace CommerceLayer {
|
|
9
9
|
var propTypes: {
|
|
10
|
-
children: import("prop-types").Validator<
|
|
10
|
+
children: import("prop-types").Validator<NonNullable<ReactNode | (() => JSX.Element)>>;
|
|
11
11
|
accessToken: import("prop-types").Validator<string>;
|
|
12
12
|
endpoint: import("prop-types").Validator<string>;
|
|
13
13
|
};
|
|
@@ -7,7 +7,7 @@ declare type Props = {
|
|
|
7
7
|
export declare function CustomerAddressForm(props: Props): JSX.Element;
|
|
8
8
|
export declare namespace CustomerAddressForm {
|
|
9
9
|
var propTypes: {
|
|
10
|
-
children: import("prop-types").Validator<
|
|
10
|
+
children: import("prop-types").Validator<NonNullable<ReactNode | (() => JSX.Element)>>;
|
|
11
11
|
};
|
|
12
12
|
}
|
|
13
13
|
export default CustomerAddressForm;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.CustomerAddressForm=void 0;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),AddressContext_1=tslib_1.__importDefault(require("../../context/AddressContext")),rapid_form_1=require("rapid-form"),react_1=require("react"),CustomerAddressFormContext_1=tslib_1.__importDefault(require("../../context/CustomerAddressFormContext")),components_1=tslib_1.__importDefault(require("../../config/components")),OrderContext_1=tslib_1.__importDefault(require("../../context/OrderContext")),isEmptyStates_1=tslib_1.__importDefault(require("../../utils/isEmptyStates")),propTypes=components_1.default.CustomerAddressForm.propTypes;function CustomerAddressForm(props){const{children,errorClassName,autoComplete="on",reset=!1,...p}=props
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.CustomerAddressForm=void 0;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),AddressContext_1=tslib_1.__importDefault(require("../../context/AddressContext")),rapid_form_1=require("rapid-form"),react_1=require("react"),CustomerAddressFormContext_1=tslib_1.__importDefault(require("../../context/CustomerAddressFormContext")),components_1=tslib_1.__importDefault(require("../../config/components")),OrderContext_1=tslib_1.__importDefault(require("../../context/OrderContext")),isEmptyStates_1=tslib_1.__importDefault(require("../../utils/isEmptyStates")),propTypes=components_1.default.CustomerAddressForm.propTypes;function CustomerAddressForm(props){const{children,errorClassName,autoComplete="on",reset=!1,...p}=props;console.log(rapid_form_1.useRapidForm);debugger;const{validation,values,errors,reset:resetForm}=(0,rapid_form_1.useRapidForm)(),{setAddressErrors,setAddress}=(0,react_1.useContext)(AddressContext_1.default),{order}=(0,react_1.useContext)(OrderContext_1.default),ref=(0,react_1.useRef)(null);(0,react_1.useEffect)(()=>{if(Object.keys(errors).length>0){const formErrors=[];for(const fieldName in errors){const code=errors[fieldName]?.code,message=errors[fieldName]?.message||"";fieldName==="billing_address_state_code"?values.state_code?delete errors[fieldName]:formErrors.push({code,message,resource:"billing_address",field:fieldName}):formErrors.push({code,message,resource:"billing_address",field:fieldName})}setAddressErrors(formErrors,"billing_address")}else if(Object.keys(values).length>0){setAddressErrors([],"billing_address");for(const name in values){const field=values[name];if(field?.value&&(values[name.replace("billing_address_","")]=field.value,delete values[name]),["billing_address_state_code"].includes(name)){const countryCode=values.billing_address_country_code?.value||values.country_code;!(0,isEmptyStates_1.default)(countryCode)&&!field.value&&delete values.billing_address_state_code}}setAddress({values,resource:"billing_address"})}reset&&(Object.keys(values).length>0||Object.keys(errors).length>0)&&ref&&(ref.current?.reset(),resetForm({target:ref.current}),setAddressErrors([],"billing_address"),setAddress({values:{},resource:"billing_address"}))},[errors,values,reset]);const providerValues={values,validation,setValue:(name,value)=>{const field={[name.replace("billing_address_","")]:value};setAddress({values:{...values,...field},resource:"billing_address"})},errorClassName,requiresBillingInfo:order?.requiresBillingInfo||!1,errors,resetField:name=>resetForm({currentTarget:ref.current},name)};return(0,jsx_runtime_1.jsx)(CustomerAddressFormContext_1.default.Provider,{value:providerValues,children:(0,jsx_runtime_1.jsx)("form",{ref,autoComplete,...p,children})})}exports.CustomerAddressForm=CustomerAddressForm,CustomerAddressForm.propTypes=propTypes,exports.default=CustomerAddressForm;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { FunctionChildren } from '../../typings/index';
|
|
3
|
+
declare type ParentProps = {
|
|
4
|
+
handleClick: () => void;
|
|
5
|
+
};
|
|
6
|
+
declare type ChildrenProps = FunctionChildren<Omit<Props & ParentProps, 'children'>>;
|
|
7
|
+
declare type Props = {
|
|
8
|
+
children?: ChildrenProps;
|
|
9
|
+
label?: string | ReactNode;
|
|
10
|
+
onClick?: () => void;
|
|
11
|
+
} & JSX.IntrinsicElements['button'];
|
|
12
|
+
export declare function SaveCustomerButton(props: Props): JSX.Element;
|
|
13
|
+
export default SaveCustomerButton;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.SaveCustomerButton=void 0;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),react_1=require("react"),Parent_1=tslib_1.__importDefault(require("
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.SaveCustomerButton=void 0;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),react_1=require("react"),Parent_1=tslib_1.__importDefault(require("../utils/Parent")),lodash_1=require("lodash"),CustomerContext_1=tslib_1.__importDefault(require("../../context/CustomerContext"));function SaveCustomerButton(props){const{children,label="Save",resource,disabled,onClick,...p}=props,{errors,saveCustomerUser,customerEmail}=(0,react_1.useContext)(CustomerContext_1.default),disable=disabled||!(0,lodash_1.isEmpty)(errors)||(0,lodash_1.isEmpty)(customerEmail),handleClick=async()=>{(0,lodash_1.isEmpty)(errors)&&!disable&&(saveCustomerUser&&await saveCustomerUser(customerEmail),onClick&&onClick())},parentProps={...p,label,resource,handleClick,disabled:disable};return children?(0,jsx_runtime_1.jsx)(Parent_1.default,{...parentProps,children}):(0,jsx_runtime_1.jsx)("button",{type:"button",disabled:disable,onClick:void 0,...p,children:label})}exports.SaveCustomerButton=SaveCustomerButton,exports.default=SaveCustomerButton;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
-
import { BaseState } from '
|
|
2
|
+
import { BaseState } from '../../typings/index';
|
|
3
3
|
declare type Props = {
|
|
4
4
|
children: ReactNode;
|
|
5
5
|
onSubmit?: (values: BaseState) => void;
|
|
@@ -7,7 +7,7 @@ declare type Props = {
|
|
|
7
7
|
export declare function GiftCard(props: Props): JSX.Element;
|
|
8
8
|
export declare namespace GiftCard {
|
|
9
9
|
var propTypes: {
|
|
10
|
-
children: import("prop-types").Validator<
|
|
10
|
+
children: import("prop-types").Validator<NonNullable<ReactNode | (() => JSX.Element)>>;
|
|
11
11
|
onSubmit: import("prop-types").Requireable<(...args: any[]) => any>;
|
|
12
12
|
};
|
|
13
13
|
var defaultProps: {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.GiftCard=void 0;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),react_1=require("react"),validateFormFields_1=tslib_1.__importDefault(require("../../utils/validateFormFields")),lodash_1=require("lodash"),GiftCardContext_1=tslib_1.__importDefault(require("../../context/GiftCardContext")),components_1=tslib_1.__importDefault(require("../../config/components")),propTypes=components_1.default.GiftCard.propTypes,defaultProps=components_1.default.GiftCard.defaultProps,displayName=components_1.default.GiftCard.displayName;function GiftCard(props){const{children,onSubmit}=props,name="giftCardForm",ref=(0,react_1.useRef)(null),{addGiftCard,addGiftCardError}=(0,react_1.useContext)(GiftCardContext_1.default),handleSubmit=e=>{e.preventDefault();const currentForm=ref.current,elements=currentForm?.elements,{errors,values}=(0,validateFormFields_1.default)(elements,["currencyCode","balanceCents"],"gift_cards");(0,lodash_1.isEmpty)(errors)?(addGiftCard(values),currentForm?.reset(),onSubmit&&onSubmit(values)):addGiftCardError(errors)};return(0,jsx_runtime_1.jsx)(react_1.Fragment,{children:(0,jsx_runtime_1.jsx)("form",{name,ref,onSubmit:handleSubmit,children},name)})}exports.GiftCard=GiftCard,GiftCard.propTypes=propTypes,GiftCard.defaultProps=defaultProps,GiftCard.displayName=displayName,exports.default=GiftCard;
|
|
@@ -5,7 +5,7 @@ export declare type Props = {
|
|
|
5
5
|
export declare function GiftCardContainer(props: Props): JSX.Element;
|
|
6
6
|
export declare namespace GiftCardContainer {
|
|
7
7
|
var propTypes: {
|
|
8
|
-
children: import("prop-types").Validator<
|
|
8
|
+
children: import("prop-types").Validator<NonNullable<ReactNode | (() => JSX.Element)>>;
|
|
9
9
|
};
|
|
10
10
|
var displayName: string;
|
|
11
11
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.GiftCardContainer=void 0;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),react_1=require("react"),GiftCardContext_1=tslib_1.__importDefault(require("../../context/GiftCardContext")),CommerceLayerContext_1=tslib_1.__importDefault(require("../../context/CommerceLayerContext")),GiftCardReducer_1=tslib_1.__importStar(require("../../reducers/GiftCardReducer")),OrderContext_1=tslib_1.__importDefault(require("../../context/OrderContext")),components_1=tslib_1.__importDefault(require("../../config/components")),propTypes=components_1.default.GiftCardContainer.propTypes,displayName=components_1.default.GiftCardContainer.displayName;function GiftCardContainer(props){const{children}=props,[state,dispatch]=(0,react_1.useReducer)(GiftCardReducer_1.default,GiftCardReducer_1.giftCardInitialState),config=(0,react_1.useContext)(CommerceLayerContext_1.default),{getOrder,createOrder,order}=(0,react_1.useContext)(OrderContext_1.default),giftCardValue={...state,addGiftCardRecipient:values=>(0,GiftCardReducer_1.addGiftCardRecipient)(values,config,dispatch),addGiftCard:values=>(0,GiftCardReducer_1.addGiftCard)({...values},{config,dispatch,getOrder,createOrder,order}),addGiftCardError:errors=>(0,GiftCardReducer_1.addGiftCardError)(errors,dispatch),addGiftCardLoading:loading=>(0,GiftCardReducer_1.addGiftCardLoading)(loading,dispatch)};return(0,jsx_runtime_1.jsx)(GiftCardContext_1.default.Provider,{value:giftCardValue,children})}exports.GiftCardContainer=GiftCardContainer,GiftCardContainer.propTypes=propTypes,GiftCardContainer.displayName=displayName,exports.default=GiftCardContainer;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { BaseSelectComponentProps } from '
|
|
2
|
+
import { BaseSelectComponentProps } from '../../typings/index';
|
|
3
3
|
declare type Props = Omit<BaseSelectComponentProps, 'options' | 'name'> & {
|
|
4
4
|
required?: boolean;
|
|
5
5
|
} & Pick<JSX.IntrinsicElements['select'], 'className' | 'id' | 'style'>;
|
|
@@ -8,7 +8,7 @@ export declare namespace GiftCardCurrencySelector {
|
|
|
8
8
|
var propTypes: {
|
|
9
9
|
children: import("prop-types").Requireable<(...args: any[]) => any>;
|
|
10
10
|
placeholder: import("prop-types").Requireable<import("prop-types").InferProps<{
|
|
11
|
-
value: import("prop-types").Validator<string | number
|
|
11
|
+
value: import("prop-types").Validator<NonNullable<NonNullable<string | number | null | undefined>>>;
|
|
12
12
|
label: import("prop-types").Validator<string>;
|
|
13
13
|
}>>;
|
|
14
14
|
value: import("prop-types").Requireable<string>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.GiftCardCurrencySelector=void 0;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),BaseSelect_1=tslib_1.__importDefault(require("../utils/BaseSelect")),currency_1=tslib_1.__importDefault(require("../../config/currency")),components_1=tslib_1.__importDefault(require("../../config/components")),propTypes=components_1.default.GiftCardCurrencySelector.propTypes,defaultProps=components_1.default.GiftCardCurrencySelector.defaultProps,displayName=components_1.default.GiftCardCurrencySelector.displayName;function GiftCardCurrencySelector(props){return(0,jsx_runtime_1.jsx)(BaseSelect_1.default,{options:currency_1.default,name:"currencyCode",...props})}exports.GiftCardCurrencySelector=GiftCardCurrencySelector,GiftCardCurrencySelector.propTypes=propTypes,GiftCardCurrencySelector.defaultProps=defaultProps,GiftCardCurrencySelector.displayName=displayName,exports.default=GiftCardCurrencySelector;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { BaseInputComponentProps, GiftCardInputName } from '
|
|
2
|
+
import { BaseInputComponentProps, GiftCardInputName } from '../../typings/index';
|
|
3
3
|
declare type Props = {
|
|
4
4
|
name: GiftCardInputName;
|
|
5
5
|
} & Omit<BaseInputComponentProps, 'name'> & JSX.IntrinsicElements['input'] & JSX.IntrinsicElements['textarea'];
|
|
6
6
|
export declare function GiftCardInput(props: Props): JSX.Element;
|
|
7
7
|
export declare namespace GiftCardInput {
|
|
8
8
|
var propTypes: {
|
|
9
|
-
type: import("prop-types").Validator<import("
|
|
10
|
-
name: import("prop-types").Validator<GiftCardInputName
|
|
9
|
+
type: import("prop-types").Validator<NonNullable<import("../../typings/index").BaseInputType>>;
|
|
10
|
+
name: import("prop-types").Validator<NonNullable<GiftCardInputName>>;
|
|
11
11
|
children: import("prop-types").Requireable<(...args: any[]) => any>;
|
|
12
12
|
placeholder: import("prop-types").Requireable<string>;
|
|
13
13
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.GiftCardInput=void 0;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),BaseInput_1=tslib_1.__importDefault(require("../utils/BaseInput")),components_1=tslib_1.__importDefault(require("../../config/components")),propTypes=components_1.default.GiftCardInput.propTypes,displayName=components_1.default.GiftCardInput.displayName;function GiftCardInput(props){const{placeholder="",...p}=props;return(0,jsx_runtime_1.jsx)(BaseInput_1.default,{placeholder,...p})}exports.GiftCardInput=GiftCardInput,GiftCardInput.propTypes=propTypes,GiftCardInput.displayName=displayName,exports.default=GiftCardInput;
|
package/lib/cjs/components/{GiftCardOrCouponCode.d.ts → gift_cards/GiftCardOrCouponCode.d.ts}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { FunctionChildren } from '
|
|
3
|
-
import type { CodeType } from '
|
|
2
|
+
import { FunctionChildren } from '../../typings/index';
|
|
3
|
+
import type { CodeType } from '../../reducers/OrderReducer';
|
|
4
4
|
declare type ChildrenProps = Omit<Props, 'children'> & {
|
|
5
5
|
code?: string;
|
|
6
6
|
hide?: boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.GiftCardOrCouponCode=void 0;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),react_1=require("react"),components_1=tslib_1.__importDefault(require("../../config/components")),Parent_1=tslib_1.__importDefault(require("../utils/Parent")),OrderContext_1=tslib_1.__importDefault(require("../../context/OrderContext")),has_1=tslib_1.__importDefault(require("lodash/has")),isEmpty_1=tslib_1.__importDefault(require("lodash/isEmpty")),propTypes=components_1.default.GiftCardOrCouponCode.propTypes,displayName=components_1.default.GiftCardOrCouponCode.displayName;function GiftCardOrCouponCode({children,type,...props}){const{order}=(0,react_1.useContext)(OrderContext_1.default);let codeType=type&&`${type}_code`;!type&&order&&(0,has_1.default)(order,"coupon_code")&&!(0,isEmpty_1.default)(order.coupon_code)?codeType="coupon_code":type||(codeType="gift_card_code");const code=order&&codeType?order[codeType]:"",hide=!(order&&code),parentProps={...props,code,hide,discountAmountCents:order?.discount_amount_cents,discountAmountFloat:order?.discount_amount_float,formattedDiscountAmount:order?.formatted_discount_amount};return children?(0,jsx_runtime_1.jsx)(Parent_1.default,{...parentProps,children}):hide?null:(0,jsx_runtime_1.jsx)("span",{...props,children:code})}exports.GiftCardOrCouponCode=GiftCardOrCouponCode,GiftCardOrCouponCode.propTypes=propTypes,GiftCardOrCouponCode.displayName=displayName,exports.default=GiftCardOrCouponCode;
|
|
@@ -9,7 +9,7 @@ declare type Props = {
|
|
|
9
9
|
export declare function GiftCardOrCouponForm(props: Props): JSX.Element | null;
|
|
10
10
|
export declare namespace GiftCardOrCouponForm {
|
|
11
11
|
var propTypes: {
|
|
12
|
-
children: import("prop-types").Validator<
|
|
12
|
+
children: import("prop-types").Validator<NonNullable<ReactNode | (() => JSX.Element)>>;
|
|
13
13
|
};
|
|
14
14
|
}
|
|
15
15
|
export default GiftCardOrCouponForm;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.GiftCardOrCouponForm=void 0;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),rapid_form_1=require("rapid-form"),react_1=require("react"),CouponAndGiftCardFormContext_1=tslib_1.__importDefault(require("../../context/CouponAndGiftCardFormContext")),OrderContext_1=tslib_1.__importDefault(require("../../context/OrderContext")),isEmpty_1=tslib_1.__importDefault(require("lodash/isEmpty")),components_1=tslib_1.__importDefault(require("../../config/components")),camelCase_1=tslib_1.__importDefault(require("lodash/camelCase")),dropWhile_1=tslib_1.__importDefault(require("lodash/dropWhile")),has_1=tslib_1.__importDefault(require("lodash/has")),lodash_1=require("lodash"),propTypes=components_1.default.GiftCardOrCouponForm.propTypes;function GiftCardOrCouponForm(props){const{children,autoComplete="on",onSubmit,...p}=props,{validation,values,reset}=(0,rapid_form_1.useRapidForm)(),[codeType,setCodeType]=(0,react_1.useState)("gift_card_or_coupon_code"),{setGiftCardOrCouponCode,order,errors,setOrderErrors}=(0,react_1.useContext)(OrderContext_1.default),ref=(0,react_1.useRef)(null),inputName="gift_card_or_coupon_code";(0,react_1.useEffect)(()=>{if(values[inputName]?.value===""&&(0,lodash_1.findIndex)(errors,{field:(0,camelCase_1.default)(inputName)})!==-1){const err=(0,dropWhile_1.default)(errors,i=>i.field===(0,camelCase_1.default)(inputName));setOrderErrors(err),onSubmit&&onSubmit({value:values[inputName]?.value,success:!1})}values[inputName]?.value===""&&(setOrderErrors([]),onSubmit&&onSubmit({value:values[inputName]?.value,success:!1}))},[values]),(0,react_1.useEffect)(()=>{order?.gift_card_code&&!order?.coupon_code&&setCodeType("coupon_code"),!order?.gift_card_code&&order?.coupon_code&&setCodeType("gift_card_code"),!order?.gift_card_code&&!order?.coupon_code&&setCodeType("gift_card_or_coupon_code")},[order]);const handleSubmit=async e=>{e.preventDefault();const code=(0,has_1.default)(values,inputName)?values[inputName].value:void 0;if(code){const{success}=await setGiftCardOrCouponCode({code,codeType}),value=values[inputName]?.value;onSubmit&&onSubmit({success,value}),success&&reset(e)}};return order?.gift_card_code&&order?.coupon_code||(0,isEmpty_1.default)(order)?null:(0,jsx_runtime_1.jsx)(CouponAndGiftCardFormContext_1.default.Provider,{value:{validation,codeType},children:(0,jsx_runtime_1.jsx)("form",{ref,autoComplete,onSubmit:handleSubmit,...p,children})})}exports.GiftCardOrCouponForm=GiftCardOrCouponForm,GiftCardOrCouponForm.propTypes=propTypes,exports.default=GiftCardOrCouponForm;
|
package/lib/cjs/components/{GiftCardOrCouponInput.d.ts → gift_cards/GiftCardOrCouponInput.d.ts}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { BaseInputComponentProps } from '
|
|
3
|
-
import { OrderCodeType } from '
|
|
2
|
+
import { BaseInputComponentProps } from '../../typings/index';
|
|
3
|
+
import { OrderCodeType } from '../../reducers/OrderReducer';
|
|
4
4
|
declare type Props = {
|
|
5
5
|
name?: 'gift_card_or_coupon_code';
|
|
6
6
|
type?: 'text';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.GiftCardOrCouponInput=void 0;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),react_1=require("react"),components_1=tslib_1.__importDefault(require("../../config/components")),BaseInput_1=tslib_1.__importDefault(require("../utils/BaseInput")),CouponAndGiftCardFormContext_1=tslib_1.__importDefault(require("../../context/CouponAndGiftCardFormContext")),propTypes=components_1.default.GiftCardOrCouponInput.propTypes,displayName=components_1.default.GiftCardOrCouponInput.displayName;function GiftCardOrCouponInput(props){const{placeholder="",required,value,placeholderTranslation,...p}=props,{validation,codeType}=(0,react_1.useContext)(CouponAndGiftCardFormContext_1.default);let placeholderLabel=placeholder;return placeholderTranslation&&codeType&&(placeholderLabel=placeholderTranslation(codeType)),(0,jsx_runtime_1.jsx)(BaseInput_1.default,{type:"text",name:"gift_card_or_coupon_code",ref:validation,required:required!==void 0?required:!0,placeholder:placeholderLabel,defaultValue:value,...p})}exports.GiftCardOrCouponInput=GiftCardOrCouponInput,GiftCardOrCouponInput.propTypes=propTypes,GiftCardOrCouponInput.displayName=displayName,exports.default=GiftCardOrCouponInput;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
-
import { FunctionChildren } from '
|
|
3
|
-
import { CodeType, OrderCodeType } from '
|
|
2
|
+
import { FunctionChildren } from '../../typings/index';
|
|
3
|
+
import { CodeType, OrderCodeType } from '../../reducers/OrderReducer';
|
|
4
4
|
declare type GiftCardOrCouponRemoveButtonChildrenProps = FunctionChildren<Omit<Props, 'children'> & {
|
|
5
5
|
codeType?: OrderCodeType;
|
|
6
6
|
hide?: boolean;
|
|
@@ -19,7 +19,7 @@ export declare namespace GiftCardOrCouponRemoveButton {
|
|
|
19
19
|
var propTypes: {
|
|
20
20
|
children: import("prop-types").Requireable<(...args: any[]) => any>;
|
|
21
21
|
type: import("prop-types").Requireable<CodeType>;
|
|
22
|
-
label: import("prop-types").Requireable<string | object
|
|
22
|
+
label: import("prop-types").Requireable<NonNullable<string | object | null | undefined>>;
|
|
23
23
|
};
|
|
24
24
|
var displayName: string;
|
|
25
25
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.GiftCardOrCouponRemoveButton=void 0;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),react_1=require("react"),Parent_1=tslib_1.__importDefault(require("../utils/Parent")),components_1=tslib_1.__importDefault(require("../../config/components")),OrderContext_1=tslib_1.__importDefault(require("../../context/OrderContext")),lodash_1=require("lodash"),propTypes=components_1.default.GiftCardOrCouponRemoveButton.propTypes,displayName=components_1.default.GiftCardOrCouponRemoveButton.displayName;function GiftCardOrCouponRemoveButton(props){const{children,label="Remove",onClick,type,...p}=props,{order,removeGiftCardOrCouponCode}=(0,react_1.useContext)(OrderContext_1.default);let codeType=`${type}_code`;!type&&order&&(0,lodash_1.has)(order,"coupon_code")&&!(0,lodash_1.isEmpty)(order.coupon_code)?codeType="coupon_code":type||(codeType="gift_card_code");const code=order&&codeType?order[codeType]:"",hide=!(order&&code),handleClick=async()=>{const response=removeGiftCardOrCouponCode&&await removeGiftCardOrCouponCode({codeType});onClick&&onClick(response)},parentProps={...p,label,handleClick,codeType};return children?(0,jsx_runtime_1.jsx)(Parent_1.default,{...parentProps,children}):hide?null:(0,jsx_runtime_1.jsx)("button",{type:"button",onClick:handleClick,...p,children:label})}exports.GiftCardOrCouponRemoveButton=GiftCardOrCouponRemoveButton,GiftCardOrCouponRemoveButton.propTypes=propTypes,GiftCardOrCouponRemoveButton.displayName=displayName,exports.default=GiftCardOrCouponRemoveButton;
|
package/lib/cjs/components/{GiftCardOrCouponSubmit.d.ts → gift_cards/GiftCardOrCouponSubmit.d.ts}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
-
import { FunctionChildren } from '
|
|
2
|
+
import { FunctionChildren } from '../../typings/index';
|
|
3
3
|
declare type GiftCardOrCouponSubmitChildrenProps = FunctionChildren<Omit<Props, 'children'>>;
|
|
4
4
|
declare type Props = {
|
|
5
5
|
children?: GiftCardOrCouponSubmitChildrenProps;
|
|
@@ -9,7 +9,7 @@ export declare function GiftCardOrCouponSubmit(props: Props): JSX.Element;
|
|
|
9
9
|
export declare namespace GiftCardOrCouponSubmit {
|
|
10
10
|
var propTypes: {
|
|
11
11
|
children: import("prop-types").Requireable<(...args: any[]) => any>;
|
|
12
|
-
label: import("prop-types").Requireable<string | object
|
|
12
|
+
label: import("prop-types").Requireable<NonNullable<string | object | null | undefined>>;
|
|
13
13
|
};
|
|
14
14
|
var displayName: string;
|
|
15
15
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.GiftCardOrCouponSubmit=void 0;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),Parent_1=tslib_1.__importDefault(require("../utils/Parent")),components_1=tslib_1.__importDefault(require("../../config/components")),propTypes=components_1.default.GiftCardOrCouponSubmit.propTypes,displayName=components_1.default.GiftCardOrCouponSubmit.displayName;function GiftCardOrCouponSubmit(props){const{children,label="Submit",...p}=props,parentProps={...p,label};return children?(0,jsx_runtime_1.jsx)(Parent_1.default,{...parentProps,children}):(0,jsx_runtime_1.jsx)("button",{type:"submit",...p,children:label})}exports.GiftCardOrCouponSubmit=GiftCardOrCouponSubmit,GiftCardOrCouponSubmit.propTypes=propTypes,GiftCardOrCouponSubmit.displayName=displayName,exports.default=GiftCardOrCouponSubmit;
|
|
File without changes
|
|
File without changes
|
package/lib/cjs/components/{GiftCardRecipientInput.d.ts → gift_cards/GiftCardRecipientInput.d.ts}
RENAMED
|
File without changes
|
package/lib/cjs/components/{GiftCardRecipientInput.js → gift_cards/GiftCardRecipientInput.js}
RENAMED
|
File without changes
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
-
import { LineItemType } from '
|
|
2
|
+
import { LineItemType } from '../../typings/index';
|
|
3
3
|
declare type Props = {
|
|
4
4
|
children: ReactNode;
|
|
5
5
|
type?: LineItemType;
|
|
@@ -7,7 +7,7 @@ declare type Props = {
|
|
|
7
7
|
export declare function LineItem(props: Props): JSX.Element;
|
|
8
8
|
export declare namespace LineItem {
|
|
9
9
|
var propTypes: {
|
|
10
|
-
children: import("prop-types").Validator<
|
|
10
|
+
children: import("prop-types").Validator<NonNullable<ReactNode | (() => JSX.Element)>>;
|
|
11
11
|
type: import("prop-types").Requireable<LineItemType>;
|
|
12
12
|
};
|
|
13
13
|
var displayName: string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.LineItem=void 0;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),react_1=require("react"),LineItemContext_1=tslib_1.__importDefault(require("../../context/LineItemContext")),LineItemChildrenContext_1=tslib_1.__importDefault(require("../../context/LineItemChildrenContext")),components_1=tslib_1.__importDefault(require("../../config/components")),ShipmentChildrenContext_1=tslib_1.__importDefault(require("../../context/ShipmentChildrenContext")),propTypes=components_1.default.LineItem.propTypes,displayName=components_1.default.LineItem.displayName;function LineItem(props){const{type="skus",children}=props,{lineItems}=(0,react_1.useContext)(LineItemContext_1.default),{lineItems:shipmentLineItems}=(0,react_1.useContext)(ShipmentChildrenContext_1.default),items=shipmentLineItems&&shipmentLineItems?.length>0?shipmentLineItems:lineItems,components=items&&items.filter(l=>l.item_type===type).map((lineItem,k,check)=>{if(lineItem.item_type==="bundles"&&k>0&&check[k-1]?.bundle_code===lineItem.bundle_code||lineItem.item_type==="gift_cards"&&lineItem?.total_amount_cents&&lineItem?.total_amount_cents<=0)return null;const lineProps={lineItem};return(0,jsx_runtime_1.jsx)(LineItemChildrenContext_1.default.Provider,{value:lineProps,children},k)});return(0,jsx_runtime_1.jsx)(jsx_runtime_1.Fragment,{children:components})}exports.LineItem=LineItem,LineItem.propTypes=propTypes,LineItem.displayName=displayName,exports.default=LineItem;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { BaseAmountComponent, BasePriceType } from '
|
|
2
|
+
import { BaseAmountComponent, BasePriceType } from '../../typings/index';
|
|
3
3
|
declare type Props = BaseAmountComponent & {
|
|
4
4
|
type?: BasePriceType;
|
|
5
5
|
};
|
|
@@ -12,7 +12,7 @@ export declare namespace LineItemAmount {
|
|
|
12
12
|
style: import("prop-types").Requireable<object>;
|
|
13
13
|
name: import("prop-types").Requireable<string>;
|
|
14
14
|
children: import("prop-types").Requireable<(...args: any[]) => any>;
|
|
15
|
-
format: import("prop-types").Requireable<import("
|
|
15
|
+
format: import("prop-types").Requireable<import("../../typings/index").BaseFormatPrice>;
|
|
16
16
|
};
|
|
17
17
|
var defaultProps: Props;
|
|
18
18
|
var displayName: string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.LineItemAmount=void 0;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),react_1=require("react"),getAmount_1=tslib_1.__importDefault(require("../../utils/getAmount")),LineItemChildrenContext_1=tslib_1.__importDefault(require("../../context/LineItemChildrenContext")),Parent_1=tslib_1.__importDefault(require("../utils/Parent")),components_1=tslib_1.__importDefault(require("../../config/components")),propTypes=components_1.default.LineItemAmount.propTypes,defaultProps=components_1.default.LineItemAmount.defaultProps,displayName=components_1.default.LineItemAmount.displayName;function LineItemAmount(props){const{format="formatted",type="total",...p}=props,{lineItem}=(0,react_1.useContext)(LineItemChildrenContext_1.default),[price,setPrice]=(0,react_1.useState)("");(0,react_1.useEffect)(()=>{if(lineItem){const p2=(0,getAmount_1.default)({base:"amount",type,format,obj:lineItem});setPrice(p2)}return()=>{setPrice("")}},[lineItem]);const parentProps={price,...p};return props.children?(0,jsx_runtime_1.jsx)(Parent_1.default,{...parentProps,children:props.children}):(0,jsx_runtime_1.jsx)("span",{...p,children:price})}exports.LineItemAmount=LineItemAmount,LineItemAmount.propTypes=propTypes,LineItemAmount.defaultProps=defaultProps,LineItemAmount.displayName=displayName,exports.default=LineItemAmount;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
2
|
import { LineItem } from '@commercelayer/sdk';
|
|
3
3
|
export declare type LineItemCodeType = Omit<Props, 'children'> & {
|
|
4
4
|
lineItem: LineItem;
|
|
5
5
|
skuCode: string;
|
|
6
6
|
};
|
|
7
7
|
declare type Props = {
|
|
8
|
-
children?: (props: LineItemCodeType) =>
|
|
8
|
+
children?: (props: LineItemCodeType) => JSX.Element;
|
|
9
9
|
type?: 'sku_code' | 'bundle_code';
|
|
10
10
|
} & JSX.IntrinsicElements['p'];
|
|
11
11
|
export declare function LineItemCode({ type, children, ...p }: Props): JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.LineItemCode=void 0;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),react_1=require("react"),LineItemChildrenContext_1=tslib_1.__importDefault(require("../../context/LineItemChildrenContext")),Parent_1=tslib_1.__importDefault(require("../utils/Parent")),components_1=tslib_1.__importDefault(require("../../config/components")),propTypes=components_1.default.LineItemCode.propTypes,displayName=components_1.default.LineItemCode.displayName;function LineItemCode({type="sku_code",children,...p}){const{lineItem}=(0,react_1.useContext)(LineItemChildrenContext_1.default),labelName=lineItem?.[type],parentProps={lineItem,skuCode:labelName,...p};return children?(0,jsx_runtime_1.jsx)(Parent_1.default,{...parentProps,children}):(0,jsx_runtime_1.jsx)("p",{...p,children:labelName})}exports.LineItemCode=LineItemCode,LineItemCode.propTypes=propTypes,LineItemCode.displayName=displayName,exports.default=LineItemCode;
|