@commercelayer/react-components 4.0.0-alpha.3 → 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/ExternalFunction.d.ts +9 -2
- package/lib/cjs/components/ExternalFunction.js +1 -1
- package/lib/cjs/components/MetadataInput.d.ts +10 -0
- package/lib/cjs/components/MetadataInput.js +1 -1
- package/lib/cjs/components/SubmitButton.d.ts +12 -2
- package/lib/cjs/components/SubmitButton.js +1 -1
- package/lib/cjs/components/addresses/Address.d.ts +7 -2
- package/lib/cjs/components/addresses/Address.js +1 -1
- package/lib/cjs/components/addresses/AddressCountrySelector.d.ts +16 -0
- package/lib/cjs/components/addresses/AddressCountrySelector.js +1 -1
- package/lib/cjs/components/addresses/AddressField.d.ts +6 -0
- package/lib/cjs/components/addresses/AddressField.js +1 -1
- package/lib/cjs/components/addresses/AddressInput.d.ts +11 -0
- package/lib/cjs/components/addresses/AddressInput.js +1 -1
- package/lib/cjs/components/addresses/AddressStateSelector.d.ts +16 -0
- package/lib/cjs/components/addresses/AddressStateSelector.js +1 -1
- package/lib/cjs/components/addresses/AddressesContainer.d.ts +9 -2
- package/lib/cjs/components/addresses/AddressesContainer.js +1 -1
- package/lib/cjs/components/addresses/BillingAddressContainer.d.ts +2 -2
- package/lib/cjs/components/addresses/BillingAddressForm.d.ts +7 -2
- package/lib/cjs/components/addresses/BillingAddressForm.js +1 -1
- package/lib/cjs/components/addresses/SaveAddressesButton.d.ts +2 -2
- package/lib/cjs/components/addresses/ShippingAddressContainer.d.ts +7 -2
- package/lib/cjs/components/addresses/ShippingAddressContainer.js +1 -1
- package/lib/cjs/components/addresses/ShippingAddressForm.d.ts +7 -2
- package/lib/cjs/components/addresses/ShippingAddressForm.js +1 -1
- package/lib/cjs/components/auth/CommerceLayer.d.ts +9 -2
- package/lib/cjs/components/auth/CommerceLayer.js +1 -1
- package/lib/cjs/components/customers/CustomerAddressForm.d.ts +7 -2
- package/lib/cjs/components/customers/CustomerAddressForm.js +1 -1
- package/lib/cjs/components/customers/CustomerContainer.d.ts +2 -2
- package/lib/cjs/components/customers/CustomerInput.d.ts +12 -0
- package/lib/cjs/components/customers/CustomerInput.js +1 -1
- package/lib/cjs/components/customers/SaveCustomerButton.d.ts +3 -3
- package/lib/cjs/components/gift_cards/GiftCard.d.ts +12 -2
- package/lib/cjs/components/gift_cards/GiftCard.js +1 -1
- package/lib/cjs/components/gift_cards/GiftCardContainer.d.ts +8 -2
- package/lib/cjs/components/gift_cards/GiftCardContainer.js +1 -1
- package/lib/cjs/components/gift_cards/GiftCardCurrencySelector.d.ts +15 -0
- package/lib/cjs/components/gift_cards/GiftCardCurrencySelector.js +1 -1
- package/lib/cjs/components/gift_cards/GiftCardInput.d.ts +9 -0
- package/lib/cjs/components/gift_cards/GiftCardInput.js +1 -1
- package/lib/cjs/components/gift_cards/GiftCardOrCouponCode.d.ts +7 -0
- package/lib/cjs/components/gift_cards/GiftCardOrCouponCode.js +1 -1
- package/lib/cjs/components/gift_cards/GiftCardOrCouponForm.d.ts +7 -2
- package/lib/cjs/components/gift_cards/GiftCardOrCouponForm.js +1 -1
- package/lib/cjs/components/gift_cards/GiftCardOrCouponInput.d.ts +9 -0
- package/lib/cjs/components/gift_cards/GiftCardOrCouponInput.js +1 -1
- package/lib/cjs/components/gift_cards/GiftCardOrCouponRemoveButton.d.ts +10 -2
- package/lib/cjs/components/gift_cards/GiftCardOrCouponRemoveButton.js +1 -1
- package/lib/cjs/components/gift_cards/GiftCardOrCouponSubmit.d.ts +9 -2
- package/lib/cjs/components/gift_cards/GiftCardOrCouponSubmit.js +1 -1
- package/lib/cjs/components/line_items/LineItem.d.ts +9 -2
- package/lib/cjs/components/line_items/LineItem.js +1 -1
- package/lib/cjs/components/line_items/LineItemAmount.d.ts +13 -0
- package/lib/cjs/components/line_items/LineItemAmount.js +1 -1
- package/lib/cjs/components/line_items/LineItemCode.d.ts +6 -0
- package/lib/cjs/components/line_items/LineItemCode.js +1 -1
- package/lib/cjs/components/line_items/LineItemImage.d.ts +7 -0
- package/lib/cjs/components/line_items/LineItemImage.js +1 -1
- package/lib/cjs/components/line_items/LineItemName.d.ts +6 -0
- package/lib/cjs/components/line_items/LineItemName.js +1 -1
- package/lib/cjs/components/line_items/LineItemOption.d.ts +11 -0
- package/lib/cjs/components/line_items/LineItemOption.js +1 -1
- package/lib/cjs/components/line_items/LineItemOptions.d.ts +5 -2
- package/lib/cjs/components/line_items/LineItemOptions.js +1 -1
- package/lib/cjs/components/line_items/LineItemQuantity.d.ts +12 -0
- package/lib/cjs/components/line_items/LineItemQuantity.js +1 -1
- package/lib/cjs/components/line_items/LineItemRemoveLink.d.ts +10 -0
- package/lib/cjs/components/line_items/LineItemRemoveLink.js +1 -1
- package/lib/cjs/components/line_items/LineItemsContainer.d.ts +15 -3
- package/lib/cjs/components/line_items/LineItemsContainer.js +1 -1
- package/lib/cjs/components/line_items/LineItemsCount.d.ts +10 -0
- package/lib/cjs/components/line_items/LineItemsCount.js +1 -1
- package/lib/cjs/components/line_items/LineItemsEmpty.d.ts +11 -0
- package/lib/cjs/components/line_items/LineItemsEmpty.js +1 -1
- package/lib/cjs/components/orders/AddToCartButton.js +1 -1
- package/lib/cjs/components/orders/AdjustmentAmount.d.ts +2 -2
- package/lib/cjs/components/orders/AdjustmentAmount.js +1 -1
- package/lib/cjs/components/orders/CartLink.d.ts +2 -2
- package/lib/cjs/components/orders/DiscountAmount.d.ts +14 -0
- package/lib/cjs/components/orders/DiscountAmount.js +1 -1
- package/lib/cjs/components/orders/GiftCardAmount.d.ts +11 -0
- package/lib/cjs/components/orders/GiftCardAmount.js +1 -1
- package/lib/cjs/components/orders/ItemContainer.d.ts +13 -2
- package/lib/cjs/components/orders/ItemContainer.js +1 -1
- package/lib/cjs/components/orders/OrderContainer.d.ts +16 -2
- package/lib/cjs/components/orders/OrderContainer.js +1 -1
- package/lib/cjs/components/orders/OrderList.d.ts +26 -21
- package/lib/cjs/components/orders/OrderList.js +1 -1
- package/lib/cjs/components/orders/OrderNumber.d.ts +6 -0
- package/lib/cjs/components/orders/OrderNumber.js +1 -1
- package/lib/cjs/components/orders/OrderStorage.d.ts +10 -2
- package/lib/cjs/components/orders/OrderStorage.js +1 -1
- package/lib/cjs/components/orders/PlaceOrderButton.d.ts +12 -2
- package/lib/cjs/components/orders/PlaceOrderButton.js +1 -1
- package/lib/cjs/components/orders/PlaceOrderContainer.d.ts +8 -2
- package/lib/cjs/components/orders/PlaceOrderContainer.js +1 -1
- package/lib/cjs/components/orders/PrivacyAndTermsCheckbox.d.ts +6 -0
- package/lib/cjs/components/orders/PrivacyAndTermsCheckbox.js +1 -1
- package/lib/cjs/components/orders/ShippingAmount.d.ts +11 -0
- package/lib/cjs/components/orders/ShippingAmount.js +1 -1
- package/lib/cjs/components/orders/SubTotalAmount.d.ts +14 -0
- package/lib/cjs/components/orders/SubTotalAmount.js +1 -1
- package/lib/cjs/components/orders/TaxesAmount.d.ts +14 -0
- package/lib/cjs/components/orders/TaxesAmount.js +1 -1
- package/lib/cjs/components/orders/TotalAmount.d.ts +14 -0
- package/lib/cjs/components/orders/TotalAmount.js +1 -1
- package/lib/cjs/components/payment_gateways/AdyenGateway.js +1 -1
- package/lib/cjs/components/payment_gateways/BraintreeGateway.js +1 -1
- package/lib/cjs/components/payment_gateways/CheckoutComGateway.js +1 -1
- package/lib/cjs/components/payment_gateways/KlarnaGateway.js +1 -1
- package/lib/cjs/components/payment_gateways/PaymentGateway.d.ts +1 -1
- package/lib/cjs/components/payment_gateways/PaypalGateway.js +1 -1
- package/lib/cjs/components/payment_gateways/StripeGateway.js +1 -1
- package/lib/cjs/components/payment_gateways/WireTransferGateway.js +1 -1
- package/lib/cjs/components/payment_methods/PaymentMethod.d.ts +16 -10
- package/lib/cjs/components/payment_methods/PaymentMethod.js +1 -1
- package/lib/cjs/components/payment_methods/PaymentMethodAmount.d.ts +14 -0
- package/lib/cjs/components/payment_methods/PaymentMethodAmount.js +1 -1
- package/lib/cjs/components/payment_methods/PaymentMethodName.d.ts +6 -0
- package/lib/cjs/components/payment_methods/PaymentMethodName.js +1 -1
- package/lib/cjs/components/payment_methods/PaymentMethodPrice.d.ts +12 -0
- package/lib/cjs/components/payment_methods/PaymentMethodPrice.js +1 -1
- package/lib/cjs/components/payment_methods/PaymentMethodRadioButton.d.ts +6 -0
- package/lib/cjs/components/payment_methods/PaymentMethodRadioButton.js +1 -1
- package/lib/cjs/components/payment_methods/PaymentMethodsContainer.d.ts +8 -2
- package/lib/cjs/components/payment_methods/PaymentMethodsContainer.js +1 -1
- package/lib/cjs/components/{payment_sources → payment_source}/AdyenPayment.d.ts +0 -0
- package/lib/cjs/components/{payment_sources → payment_source}/AdyenPayment.js +0 -0
- package/lib/cjs/components/{payment_sources → payment_source}/BraintreePayment.d.ts +0 -0
- package/lib/cjs/components/{payment_sources → payment_source}/BraintreePayment.js +0 -0
- package/lib/cjs/components/{payment_sources → payment_source}/CheckoutComPayment.d.ts +0 -0
- package/lib/cjs/components/{payment_sources → payment_source}/CheckoutComPayment.js +0 -0
- package/lib/cjs/components/{payment_sources → payment_source}/KlarnaPayment.d.ts +0 -0
- package/lib/cjs/components/{payment_sources → payment_source}/KlarnaPayment.js +0 -0
- package/lib/{esm/components/payment_sources → cjs/components/payment_source}/PaymentSource.d.ts +9 -2
- package/lib/cjs/components/payment_source/PaymentSource.js +1 -0
- package/lib/cjs/components/{payment_sources → payment_source}/PaymentSourceBrandIcon.d.ts +10 -0
- package/lib/cjs/components/payment_source/PaymentSourceBrandIcon.js +1 -0
- package/lib/{esm/components/payment_sources → cjs/components/payment_source}/PaymentSourceBrandName.d.ts +7 -0
- package/lib/cjs/components/payment_source/PaymentSourceBrandName.js +1 -0
- package/lib/cjs/components/{payment_sources → payment_source}/PaymentSourceDetail.d.ts +6 -0
- package/lib/cjs/components/payment_source/PaymentSourceDetail.js +1 -0
- package/lib/{esm/components/payment_sources → cjs/components/payment_source}/PaymentSourceEditButton.d.ts +9 -2
- package/lib/cjs/components/payment_source/PaymentSourceEditButton.js +1 -0
- package/lib/{esm/components/payment_sources → cjs/components/payment_source}/PaypalPayment.d.ts +2 -2
- package/lib/cjs/components/{payment_sources → payment_source}/PaypalPayment.js +0 -0
- package/lib/cjs/components/{payment_sources → payment_source}/StripePayment.d.ts +0 -0
- package/lib/cjs/components/{payment_sources → payment_source}/StripePayment.js +0 -0
- package/lib/{esm/components/payment_sources → cjs/components/payment_source}/WireTransferPayment.d.ts +2 -2
- package/lib/cjs/components/{payment_sources → payment_source}/WireTransferPayment.js +0 -0
- package/lib/cjs/components/prices/Price.d.ts +12 -0
- package/lib/cjs/components/prices/Price.js +1 -1
- package/lib/cjs/components/prices/PricesContainer.d.ts +18 -2
- package/lib/cjs/components/prices/PricesContainer.js +1 -1
- package/lib/cjs/components/shipments/Shipment.d.ts +8 -2
- package/lib/cjs/components/shipments/Shipment.js +1 -1
- package/lib/cjs/components/shipments/ShipmentField.d.ts +7 -0
- package/lib/cjs/components/shipments/ShipmentField.js +1 -1
- package/lib/cjs/components/shipments/ShipmentsContainer.d.ts +8 -2
- package/lib/cjs/components/shipments/ShipmentsContainer.js +1 -1
- package/lib/cjs/components/shipping_methods/ShippingMethod.d.ts +9 -2
- package/lib/cjs/components/shipping_methods/ShippingMethod.js +1 -1
- package/lib/cjs/components/shipping_methods/ShippingMethodName.d.ts +6 -0
- package/lib/cjs/components/shipping_methods/ShippingMethodName.js +1 -1
- package/lib/cjs/components/shipping_methods/ShippingMethodPrice.d.ts +12 -0
- package/lib/cjs/components/shipping_methods/ShippingMethodPrice.js +1 -1
- package/lib/cjs/components/shipping_methods/ShippingMethodRadioButton.d.ts +6 -0
- package/lib/cjs/components/shipping_methods/ShippingMethodRadioButton.js +1 -1
- package/lib/cjs/components/skus/AvailabilityContainer.d.ts +9 -2
- package/lib/cjs/components/skus/AvailabilityContainer.js +1 -1
- package/lib/cjs/components/skus/AvailabilityTemplate.d.ts +9 -0
- package/lib/cjs/components/skus/AvailabilityTemplate.js +1 -1
- package/lib/cjs/components/skus/DeliveryLeadTime.d.ts +7 -0
- package/lib/cjs/components/skus/DeliveryLeadTime.js +1 -1
- package/lib/cjs/components/skus/QuantitySelector.d.ts +14 -0
- package/lib/cjs/components/skus/QuantitySelector.js +1 -1
- package/lib/cjs/components/skus/SkuField.d.ts +6 -2
- package/lib/cjs/components/skus/SkuField.js +1 -1
- package/lib/cjs/components/skus/SkuList.d.ts +9 -2
- package/lib/cjs/components/skus/SkuList.js +1 -1
- package/lib/cjs/components/skus/SkuListsContainer.d.ts +8 -2
- package/lib/cjs/components/skus/SkuListsContainer.js +1 -1
- package/lib/cjs/components/skus/SkuOption.d.ts +9 -2
- package/lib/cjs/components/skus/SkuOption.js +1 -1
- package/lib/cjs/components/skus/SkuOptionInput.d.ts +10 -0
- package/lib/cjs/components/skus/SkuOptionInput.js +1 -1
- package/lib/cjs/components/skus/SkuOptionsContainer.d.ts +9 -2
- package/lib/cjs/components/skus/SkuOptionsContainer.js +1 -1
- package/lib/cjs/components/skus/Skus.d.ts +7 -2
- package/lib/cjs/components/skus/Skus.js +1 -1
- package/lib/cjs/components/skus/SkusContainer.d.ts +11 -2
- package/lib/cjs/components/skus/VariantSelector.d.ts +25 -2
- package/lib/cjs/components/skus/VariantSelector.js +1 -1
- package/lib/cjs/components/skus/VariantsContainer.d.ts +14 -2
- package/lib/cjs/components/skus/VariantsContainer.js +1 -1
- package/lib/cjs/components/stock_transfers/StockTransfer.d.ts +8 -2
- package/lib/cjs/components/stock_transfers/StockTransfer.js +1 -1
- package/lib/cjs/components/utils/PriceTemplate.js +1 -1
- package/lib/cjs/components/utils/VariantTemplate.d.ts +21 -2
- package/lib/cjs/components/utils/VariantTemplate.js +1 -1
- package/lib/cjs/components/utils/getAllErrors.d.ts +1 -1
- package/lib/cjs/config/components.d.ts +934 -0
- package/lib/cjs/config/components.js +1 -0
- package/lib/cjs/index.d.ts +7 -7
- package/lib/cjs/index.js +1 -1
- package/lib/cjs/reducers/PaymentMethodReducer.d.ts +6 -6
- package/lib/cjs/typings/index.d.ts +3 -3
- package/lib/cjs/utils/childrenTypes.d.ts +9 -0
- package/lib/cjs/utils/childrenTypes.js +1 -0
- package/lib/cjs/utils/getCardDetails.js +1 -1
- package/lib/cjs/utils/getPrices.d.ts +2 -2
- package/lib/cjs/utils/paypalPayment.d.ts +1 -1
- package/lib/cjs/utils/validateFormFields.js +1 -1
- package/lib/esm/components/ExternalFunction.d.ts +9 -2
- package/lib/esm/components/ExternalFunction.js +1 -1
- package/lib/esm/components/MetadataInput.d.ts +10 -0
- package/lib/esm/components/MetadataInput.js +1 -1
- package/lib/esm/components/SubmitButton.d.ts +12 -2
- package/lib/esm/components/SubmitButton.js +1 -1
- package/lib/esm/components/addresses/Address.d.ts +7 -2
- package/lib/esm/components/addresses/Address.js +1 -1
- package/lib/esm/components/addresses/AddressCountrySelector.d.ts +16 -0
- package/lib/esm/components/addresses/AddressCountrySelector.js +1 -1
- package/lib/esm/components/addresses/AddressField.d.ts +6 -0
- package/lib/esm/components/addresses/AddressField.js +1 -1
- package/lib/esm/components/addresses/AddressInput.d.ts +11 -0
- package/lib/esm/components/addresses/AddressInput.js +1 -1
- package/lib/esm/components/addresses/AddressStateSelector.d.ts +16 -0
- package/lib/esm/components/addresses/AddressStateSelector.js +1 -1
- package/lib/esm/components/addresses/AddressesContainer.d.ts +9 -2
- package/lib/esm/components/addresses/AddressesContainer.js +1 -1
- package/lib/esm/components/addresses/BillingAddressContainer.d.ts +2 -2
- package/lib/esm/components/addresses/BillingAddressForm.d.ts +7 -2
- package/lib/esm/components/addresses/BillingAddressForm.js +1 -1
- package/lib/esm/components/addresses/SaveAddressesButton.d.ts +2 -2
- package/lib/esm/components/addresses/ShippingAddressContainer.d.ts +7 -2
- package/lib/esm/components/addresses/ShippingAddressContainer.js +1 -1
- package/lib/esm/components/addresses/ShippingAddressForm.d.ts +7 -2
- package/lib/esm/components/addresses/ShippingAddressForm.js +1 -1
- package/lib/esm/components/auth/CommerceLayer.d.ts +9 -2
- package/lib/esm/components/auth/CommerceLayer.js +1 -1
- package/lib/esm/components/customers/CustomerAddressForm.d.ts +7 -2
- package/lib/esm/components/customers/CustomerAddressForm.js +1 -1
- package/lib/esm/components/customers/CustomerContainer.d.ts +2 -2
- package/lib/esm/components/customers/CustomerInput.d.ts +12 -0
- package/lib/esm/components/customers/CustomerInput.js +1 -1
- package/lib/esm/components/customers/SaveCustomerButton.d.ts +3 -3
- package/lib/esm/components/gift_cards/GiftCard.d.ts +12 -2
- package/lib/esm/components/gift_cards/GiftCard.js +1 -1
- package/lib/esm/components/gift_cards/GiftCardContainer.d.ts +8 -2
- package/lib/esm/components/gift_cards/GiftCardContainer.js +1 -1
- package/lib/esm/components/gift_cards/GiftCardCurrencySelector.d.ts +15 -0
- package/lib/esm/components/gift_cards/GiftCardCurrencySelector.js +1 -1
- package/lib/esm/components/gift_cards/GiftCardInput.d.ts +9 -0
- package/lib/esm/components/gift_cards/GiftCardInput.js +1 -1
- package/lib/esm/components/gift_cards/GiftCardOrCouponCode.d.ts +7 -0
- package/lib/esm/components/gift_cards/GiftCardOrCouponCode.js +1 -1
- package/lib/esm/components/gift_cards/GiftCardOrCouponForm.d.ts +7 -2
- package/lib/esm/components/gift_cards/GiftCardOrCouponForm.js +1 -1
- package/lib/esm/components/gift_cards/GiftCardOrCouponInput.d.ts +9 -0
- package/lib/esm/components/gift_cards/GiftCardOrCouponInput.js +1 -1
- package/lib/esm/components/gift_cards/GiftCardOrCouponRemoveButton.d.ts +10 -2
- package/lib/esm/components/gift_cards/GiftCardOrCouponRemoveButton.js +1 -1
- package/lib/esm/components/gift_cards/GiftCardOrCouponSubmit.d.ts +9 -2
- package/lib/esm/components/gift_cards/GiftCardOrCouponSubmit.js +1 -1
- package/lib/esm/components/line_items/LineItem.d.ts +9 -2
- package/lib/esm/components/line_items/LineItem.js +1 -1
- package/lib/esm/components/line_items/LineItemAmount.d.ts +13 -0
- package/lib/esm/components/line_items/LineItemAmount.js +1 -1
- package/lib/esm/components/line_items/LineItemCode.d.ts +6 -0
- package/lib/esm/components/line_items/LineItemCode.js +1 -1
- package/lib/esm/components/line_items/LineItemImage.d.ts +7 -0
- package/lib/esm/components/line_items/LineItemImage.js +1 -1
- package/lib/esm/components/line_items/LineItemName.d.ts +6 -0
- package/lib/esm/components/line_items/LineItemName.js +1 -1
- package/lib/esm/components/line_items/LineItemOption.d.ts +11 -0
- package/lib/esm/components/line_items/LineItemOption.js +1 -1
- package/lib/esm/components/line_items/LineItemOptions.d.ts +5 -2
- package/lib/esm/components/line_items/LineItemOptions.js +1 -1
- package/lib/esm/components/line_items/LineItemQuantity.d.ts +12 -0
- package/lib/esm/components/line_items/LineItemQuantity.js +1 -1
- package/lib/esm/components/line_items/LineItemRemoveLink.d.ts +10 -0
- package/lib/esm/components/line_items/LineItemRemoveLink.js +1 -1
- package/lib/esm/components/line_items/LineItemsContainer.d.ts +15 -3
- package/lib/esm/components/line_items/LineItemsContainer.js +1 -1
- package/lib/esm/components/line_items/LineItemsCount.d.ts +10 -0
- package/lib/esm/components/line_items/LineItemsCount.js +1 -1
- package/lib/esm/components/line_items/LineItemsEmpty.d.ts +11 -0
- package/lib/esm/components/line_items/LineItemsEmpty.js +1 -1
- package/lib/esm/components/orders/AddToCartButton.js +1 -1
- package/lib/esm/components/orders/AdjustmentAmount.d.ts +2 -2
- package/lib/esm/components/orders/AdjustmentAmount.js +1 -1
- package/lib/esm/components/orders/CartLink.d.ts +2 -2
- package/lib/esm/components/orders/DiscountAmount.d.ts +14 -0
- package/lib/esm/components/orders/DiscountAmount.js +1 -1
- package/lib/esm/components/orders/GiftCardAmount.d.ts +11 -0
- package/lib/esm/components/orders/GiftCardAmount.js +1 -1
- package/lib/esm/components/orders/ItemContainer.d.ts +13 -2
- package/lib/esm/components/orders/ItemContainer.js +1 -1
- package/lib/esm/components/orders/OrderContainer.d.ts +16 -2
- package/lib/esm/components/orders/OrderContainer.js +1 -1
- package/lib/esm/components/orders/OrderList.d.ts +26 -21
- package/lib/esm/components/orders/OrderList.js +1 -1
- package/lib/esm/components/orders/OrderNumber.d.ts +6 -0
- package/lib/esm/components/orders/OrderNumber.js +1 -1
- package/lib/esm/components/orders/OrderStorage.d.ts +10 -2
- package/lib/esm/components/orders/OrderStorage.js +1 -1
- package/lib/esm/components/orders/PlaceOrderButton.d.ts +12 -2
- package/lib/esm/components/orders/PlaceOrderButton.js +1 -1
- package/lib/esm/components/orders/PlaceOrderContainer.d.ts +8 -2
- package/lib/esm/components/orders/PlaceOrderContainer.js +1 -1
- package/lib/esm/components/orders/PrivacyAndTermsCheckbox.d.ts +6 -0
- package/lib/esm/components/orders/PrivacyAndTermsCheckbox.js +1 -1
- package/lib/esm/components/orders/ShippingAmount.d.ts +11 -0
- package/lib/esm/components/orders/ShippingAmount.js +1 -1
- package/lib/esm/components/orders/SubTotalAmount.d.ts +14 -0
- package/lib/esm/components/orders/SubTotalAmount.js +1 -1
- package/lib/esm/components/orders/TaxesAmount.d.ts +14 -0
- package/lib/esm/components/orders/TaxesAmount.js +1 -1
- package/lib/esm/components/orders/TotalAmount.d.ts +14 -0
- package/lib/esm/components/orders/TotalAmount.js +1 -1
- package/lib/esm/components/payment_gateways/AdyenGateway.js +1 -1
- package/lib/esm/components/payment_gateways/BraintreeGateway.js +1 -1
- package/lib/esm/components/payment_gateways/CheckoutComGateway.js +1 -1
- package/lib/esm/components/payment_gateways/KlarnaGateway.js +1 -1
- package/lib/esm/components/payment_gateways/PaymentGateway.d.ts +1 -1
- package/lib/esm/components/payment_gateways/PaypalGateway.js +1 -1
- package/lib/esm/components/payment_gateways/StripeGateway.js +1 -1
- package/lib/esm/components/payment_gateways/WireTransferGateway.js +1 -1
- package/lib/esm/components/payment_methods/PaymentMethod.d.ts +16 -10
- package/lib/esm/components/payment_methods/PaymentMethod.js +1 -1
- package/lib/esm/components/payment_methods/PaymentMethodAmount.d.ts +14 -0
- package/lib/esm/components/payment_methods/PaymentMethodAmount.js +1 -1
- package/lib/esm/components/payment_methods/PaymentMethodName.d.ts +6 -0
- package/lib/esm/components/payment_methods/PaymentMethodName.js +1 -1
- package/lib/esm/components/payment_methods/PaymentMethodPrice.d.ts +12 -0
- package/lib/esm/components/payment_methods/PaymentMethodPrice.js +1 -1
- package/lib/esm/components/payment_methods/PaymentMethodRadioButton.d.ts +6 -0
- package/lib/esm/components/payment_methods/PaymentMethodRadioButton.js +1 -1
- package/lib/esm/components/payment_methods/PaymentMethodsContainer.d.ts +8 -2
- package/lib/esm/components/payment_methods/PaymentMethodsContainer.js +1 -1
- package/lib/esm/components/{payment_sources → payment_source}/AdyenPayment.d.ts +0 -0
- package/lib/esm/components/{payment_sources → payment_source}/AdyenPayment.js +0 -0
- package/lib/esm/components/{payment_sources → payment_source}/BraintreePayment.d.ts +0 -0
- package/lib/esm/components/{payment_sources → payment_source}/BraintreePayment.js +0 -0
- package/lib/esm/components/{payment_sources → payment_source}/CheckoutComPayment.d.ts +0 -0
- package/lib/esm/components/{payment_sources → payment_source}/CheckoutComPayment.js +0 -0
- package/lib/esm/components/{payment_sources → payment_source}/KlarnaPayment.d.ts +0 -0
- package/lib/esm/components/{payment_sources → payment_source}/KlarnaPayment.js +0 -0
- package/lib/{cjs/components/payment_sources → esm/components/payment_source}/PaymentSource.d.ts +9 -2
- package/lib/esm/components/payment_source/PaymentSource.js +1 -0
- package/lib/esm/components/{payment_sources → payment_source}/PaymentSourceBrandIcon.d.ts +10 -0
- package/lib/esm/components/payment_source/PaymentSourceBrandIcon.js +1 -0
- package/lib/{cjs/components/payment_sources → esm/components/payment_source}/PaymentSourceBrandName.d.ts +7 -0
- package/lib/esm/components/payment_source/PaymentSourceBrandName.js +1 -0
- package/lib/esm/components/{payment_sources → payment_source}/PaymentSourceDetail.d.ts +6 -0
- package/lib/esm/components/payment_source/PaymentSourceDetail.js +1 -0
- package/lib/{cjs/components/payment_sources → esm/components/payment_source}/PaymentSourceEditButton.d.ts +9 -2
- package/lib/esm/components/payment_source/PaymentSourceEditButton.js +1 -0
- package/lib/{cjs/components/payment_sources → esm/components/payment_source}/PaypalPayment.d.ts +2 -2
- package/lib/esm/components/{payment_sources → payment_source}/PaypalPayment.js +0 -0
- package/lib/esm/components/{payment_sources → payment_source}/StripePayment.d.ts +0 -0
- package/lib/esm/components/{payment_sources → payment_source}/StripePayment.js +0 -0
- package/lib/{cjs/components/payment_sources → esm/components/payment_source}/WireTransferPayment.d.ts +2 -2
- package/lib/esm/components/{payment_sources → payment_source}/WireTransferPayment.js +0 -0
- package/lib/esm/components/prices/Price.d.ts +12 -0
- package/lib/esm/components/prices/Price.js +1 -1
- package/lib/esm/components/prices/PricesContainer.d.ts +18 -2
- package/lib/esm/components/prices/PricesContainer.js +1 -1
- package/lib/esm/components/shipments/Shipment.d.ts +8 -2
- package/lib/esm/components/shipments/Shipment.js +1 -1
- package/lib/esm/components/shipments/ShipmentField.d.ts +7 -0
- package/lib/esm/components/shipments/ShipmentField.js +1 -1
- package/lib/esm/components/shipments/ShipmentsContainer.d.ts +8 -2
- package/lib/esm/components/shipments/ShipmentsContainer.js +1 -1
- package/lib/esm/components/shipping_methods/ShippingMethod.d.ts +9 -2
- package/lib/esm/components/shipping_methods/ShippingMethod.js +1 -1
- package/lib/esm/components/shipping_methods/ShippingMethodName.d.ts +6 -0
- package/lib/esm/components/shipping_methods/ShippingMethodName.js +1 -1
- package/lib/esm/components/shipping_methods/ShippingMethodPrice.d.ts +12 -0
- package/lib/esm/components/shipping_methods/ShippingMethodPrice.js +1 -1
- package/lib/esm/components/shipping_methods/ShippingMethodRadioButton.d.ts +6 -0
- package/lib/esm/components/shipping_methods/ShippingMethodRadioButton.js +1 -1
- package/lib/esm/components/skus/AvailabilityContainer.d.ts +9 -2
- package/lib/esm/components/skus/AvailabilityContainer.js +1 -1
- package/lib/esm/components/skus/AvailabilityTemplate.d.ts +9 -0
- package/lib/esm/components/skus/AvailabilityTemplate.js +1 -1
- package/lib/esm/components/skus/DeliveryLeadTime.d.ts +7 -0
- package/lib/esm/components/skus/DeliveryLeadTime.js +1 -1
- package/lib/esm/components/skus/QuantitySelector.d.ts +14 -0
- package/lib/esm/components/skus/QuantitySelector.js +1 -1
- package/lib/esm/components/skus/SkuField.d.ts +6 -2
- package/lib/esm/components/skus/SkuField.js +1 -1
- package/lib/esm/components/skus/SkuList.d.ts +9 -2
- package/lib/esm/components/skus/SkuList.js +1 -1
- package/lib/esm/components/skus/SkuListsContainer.d.ts +8 -2
- package/lib/esm/components/skus/SkuListsContainer.js +1 -1
- package/lib/esm/components/skus/SkuOption.d.ts +9 -2
- package/lib/esm/components/skus/SkuOption.js +1 -1
- package/lib/esm/components/skus/SkuOptionInput.d.ts +10 -0
- package/lib/esm/components/skus/SkuOptionInput.js +1 -1
- package/lib/esm/components/skus/SkuOptionsContainer.d.ts +9 -2
- package/lib/esm/components/skus/SkuOptionsContainer.js +1 -1
- package/lib/esm/components/skus/Skus.d.ts +7 -2
- package/lib/esm/components/skus/Skus.js +1 -1
- package/lib/esm/components/skus/SkusContainer.d.ts +11 -2
- package/lib/esm/components/skus/VariantSelector.d.ts +25 -2
- package/lib/esm/components/skus/VariantSelector.js +1 -1
- package/lib/esm/components/skus/VariantsContainer.d.ts +14 -2
- package/lib/esm/components/skus/VariantsContainer.js +1 -1
- package/lib/esm/components/stock_transfers/StockTransfer.d.ts +8 -2
- package/lib/esm/components/stock_transfers/StockTransfer.js +1 -1
- package/lib/esm/components/utils/PriceTemplate.js +1 -1
- package/lib/esm/components/utils/VariantTemplate.d.ts +21 -2
- package/lib/esm/components/utils/VariantTemplate.js +1 -1
- package/lib/esm/components/utils/getAllErrors.d.ts +1 -1
- package/lib/esm/config/components.d.ts +934 -0
- package/lib/esm/config/components.js +1 -0
- package/lib/esm/index.d.ts +7 -7
- package/lib/esm/index.js +1 -1
- package/lib/esm/reducers/PaymentMethodReducer.d.ts +6 -6
- package/lib/esm/typings/index.d.ts +3 -3
- package/lib/esm/utils/childrenTypes.d.ts +9 -0
- package/lib/esm/utils/childrenTypes.js +1 -0
- package/lib/esm/utils/getCardDetails.js +1 -1
- package/lib/esm/utils/getPrices.d.ts +2 -2
- package/lib/esm/utils/paypalPayment.d.ts +1 -1
- package/lib/esm/utils/validateFormFields.js +1 -1
- package/lib/tsconfig.prod.esm.tsbuildinfo +1 -1
- package/lib/tsconfig.prod.tsbuildinfo +1 -1
- package/package.json +26 -26
- package/lib/cjs/components/payment_sources/PaymentSource.js +0 -1
- package/lib/cjs/components/payment_sources/PaymentSourceBrandIcon.js +0 -1
- package/lib/cjs/components/payment_sources/PaymentSourceBrandName.js +0 -1
- package/lib/cjs/components/payment_sources/PaymentSourceDetail.js +0 -1
- package/lib/cjs/components/payment_sources/PaymentSourceEditButton.js +0 -1
- package/lib/esm/components/payment_sources/PaymentSource.js +0 -1
- package/lib/esm/components/payment_sources/PaymentSourceBrandIcon.js +0 -1
- package/lib/esm/components/payment_sources/PaymentSourceBrandName.js +0 -1
- package/lib/esm/components/payment_sources/PaymentSourceDetail.js +0 -1
- package/lib/esm/components/payment_sources/PaymentSourceEditButton.js +0 -1
|
@@ -1 +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"));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,exports.default=GiftCardContainer;
|
|
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;
|
|
@@ -4,4 +4,19 @@ declare type Props = Omit<BaseSelectComponentProps, 'options' | 'name'> & {
|
|
|
4
4
|
required?: boolean;
|
|
5
5
|
} & Pick<JSX.IntrinsicElements['select'], 'className' | 'id' | 'style'>;
|
|
6
6
|
export declare function GiftCardCurrencySelector(props: Props): JSX.Element;
|
|
7
|
+
export declare namespace GiftCardCurrencySelector {
|
|
8
|
+
var propTypes: {
|
|
9
|
+
children: import("prop-types").Requireable<(...args: any[]) => any>;
|
|
10
|
+
placeholder: import("prop-types").Requireable<import("prop-types").InferProps<{
|
|
11
|
+
value: import("prop-types").Validator<NonNullable<NonNullable<string | number | null | undefined>>>;
|
|
12
|
+
label: import("prop-types").Validator<string>;
|
|
13
|
+
}>>;
|
|
14
|
+
value: import("prop-types").Requireable<string>;
|
|
15
|
+
required: import("prop-types").Requireable<boolean>;
|
|
16
|
+
};
|
|
17
|
+
var defaultProps: {
|
|
18
|
+
required: boolean;
|
|
19
|
+
};
|
|
20
|
+
var displayName: string;
|
|
21
|
+
}
|
|
7
22
|
export default GiftCardCurrencySelector;
|
|
@@ -1 +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"));function GiftCardCurrencySelector(props){return(0,jsx_runtime_1.jsx)(BaseSelect_1.default,{options:currency_1.default,name:"currencyCode",...props})}exports.GiftCardCurrencySelector=GiftCardCurrencySelector,exports.default=GiftCardCurrencySelector;
|
|
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;
|
|
@@ -4,4 +4,13 @@ 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
|
+
export declare namespace GiftCardInput {
|
|
8
|
+
var propTypes: {
|
|
9
|
+
type: import("prop-types").Validator<NonNullable<import("../../typings/index").BaseInputType>>;
|
|
10
|
+
name: import("prop-types").Validator<NonNullable<GiftCardInputName>>;
|
|
11
|
+
children: import("prop-types").Requireable<(...args: any[]) => any>;
|
|
12
|
+
placeholder: import("prop-types").Requireable<string>;
|
|
13
|
+
};
|
|
14
|
+
var displayName: string;
|
|
15
|
+
}
|
|
7
16
|
export default GiftCardInput;
|
|
@@ -1 +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"));function GiftCardInput(props){const{placeholder="",...p}=props;return(0,jsx_runtime_1.jsx)(BaseInput_1.default,{placeholder,...p})}exports.GiftCardInput=GiftCardInput,exports.default=GiftCardInput;
|
|
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;
|
|
@@ -14,4 +14,11 @@ declare type Props = {
|
|
|
14
14
|
children?: GiftCardOrCouponCodeChildrenProps;
|
|
15
15
|
} & JSX.IntrinsicElements['span'];
|
|
16
16
|
export declare function GiftCardOrCouponCode({ children, type, ...props }: Props): JSX.Element | null;
|
|
17
|
+
export declare namespace GiftCardOrCouponCode {
|
|
18
|
+
var propTypes: {
|
|
19
|
+
children: import("prop-types").Requireable<(...args: any[]) => any>;
|
|
20
|
+
type: import("prop-types").Requireable<CodeType>;
|
|
21
|
+
};
|
|
22
|
+
var displayName: string;
|
|
23
|
+
}
|
|
17
24
|
export default GiftCardOrCouponCode;
|
|
@@ -1 +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"),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"));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,exports.default=GiftCardOrCouponCode;
|
|
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;
|
|
@@ -1,10 +1,15 @@
|
|
|
1
|
-
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
2
|
declare type Props = {
|
|
3
|
-
children:
|
|
3
|
+
children: ReactNode;
|
|
4
4
|
onSubmit?: (response: {
|
|
5
5
|
success: boolean;
|
|
6
6
|
value: string;
|
|
7
7
|
}) => void;
|
|
8
8
|
} & Omit<JSX.IntrinsicElements['form'], 'onSubmit'>;
|
|
9
9
|
export declare function GiftCardOrCouponForm(props: Props): JSX.Element | null;
|
|
10
|
+
export declare namespace GiftCardOrCouponForm {
|
|
11
|
+
var propTypes: {
|
|
12
|
+
children: import("prop-types").Validator<NonNullable<ReactNode | (() => JSX.Element)>>;
|
|
13
|
+
};
|
|
14
|
+
}
|
|
10
15
|
export default GiftCardOrCouponForm;
|
|
@@ -1 +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")),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");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,exports.default=GiftCardOrCouponForm;
|
|
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;
|
|
@@ -7,4 +7,13 @@ declare type Props = {
|
|
|
7
7
|
placeholderTranslation?: (codeType: OrderCodeType) => string;
|
|
8
8
|
} & Omit<BaseInputComponentProps, 'name' | 'type'> & JSX.IntrinsicElements['input'] & JSX.IntrinsicElements['textarea'];
|
|
9
9
|
export declare function GiftCardOrCouponInput(props: Props): JSX.Element;
|
|
10
|
+
export declare namespace GiftCardOrCouponInput {
|
|
11
|
+
var propTypes: {
|
|
12
|
+
children: import("prop-types").Requireable<(...args: any[]) => any>;
|
|
13
|
+
placeholder: import("prop-types").Requireable<string>;
|
|
14
|
+
disabled: import("prop-types").Requireable<boolean>;
|
|
15
|
+
required: import("prop-types").Requireable<boolean>;
|
|
16
|
+
};
|
|
17
|
+
var displayName: string;
|
|
18
|
+
}
|
|
10
19
|
export default GiftCardOrCouponInput;
|
|
@@ -1 +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"),BaseInput_1=tslib_1.__importDefault(require("../utils/BaseInput")),CouponAndGiftCardFormContext_1=tslib_1.__importDefault(require("../../context/CouponAndGiftCardFormContext"));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,exports.default=GiftCardOrCouponInput;
|
|
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,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
2
|
import { FunctionChildren } from '../../typings/index';
|
|
3
3
|
import { CodeType, OrderCodeType } from '../../reducers/OrderReducer';
|
|
4
4
|
declare type GiftCardOrCouponRemoveButtonChildrenProps = FunctionChildren<Omit<Props, 'children'> & {
|
|
@@ -9,10 +9,18 @@ declare type GiftCardOrCouponRemoveButtonChildrenProps = FunctionChildren<Omit<P
|
|
|
9
9
|
declare type Props = {
|
|
10
10
|
type?: CodeType;
|
|
11
11
|
children?: GiftCardOrCouponRemoveButtonChildrenProps;
|
|
12
|
-
label?: string |
|
|
12
|
+
label?: string | ReactNode;
|
|
13
13
|
onClick?: (response: {
|
|
14
14
|
success: boolean;
|
|
15
15
|
}) => void;
|
|
16
16
|
} & Omit<JSX.IntrinsicElements['button'], 'type'>;
|
|
17
17
|
export declare function GiftCardOrCouponRemoveButton(props: Props): JSX.Element | null;
|
|
18
|
+
export declare namespace GiftCardOrCouponRemoveButton {
|
|
19
|
+
var propTypes: {
|
|
20
|
+
children: import("prop-types").Requireable<(...args: any[]) => any>;
|
|
21
|
+
type: import("prop-types").Requireable<CodeType>;
|
|
22
|
+
label: import("prop-types").Requireable<NonNullable<string | object | null | undefined>>;
|
|
23
|
+
};
|
|
24
|
+
var displayName: string;
|
|
25
|
+
}
|
|
18
26
|
export default GiftCardOrCouponRemoveButton;
|
|
@@ -1 +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")),OrderContext_1=tslib_1.__importDefault(require("../../context/OrderContext")),lodash_1=require("lodash");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,exports.default=GiftCardOrCouponRemoveButton;
|
|
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;
|
|
@@ -1,9 +1,16 @@
|
|
|
1
|
-
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
2
|
import { FunctionChildren } from '../../typings/index';
|
|
3
3
|
declare type GiftCardOrCouponSubmitChildrenProps = FunctionChildren<Omit<Props, 'children'>>;
|
|
4
4
|
declare type Props = {
|
|
5
5
|
children?: GiftCardOrCouponSubmitChildrenProps;
|
|
6
|
-
label?: string |
|
|
6
|
+
label?: string | ReactNode;
|
|
7
7
|
} & JSX.IntrinsicElements['button'];
|
|
8
8
|
export declare function GiftCardOrCouponSubmit(props: Props): JSX.Element;
|
|
9
|
+
export declare namespace GiftCardOrCouponSubmit {
|
|
10
|
+
var propTypes: {
|
|
11
|
+
children: import("prop-types").Requireable<(...args: any[]) => any>;
|
|
12
|
+
label: import("prop-types").Requireable<NonNullable<string | object | null | undefined>>;
|
|
13
|
+
};
|
|
14
|
+
var displayName: string;
|
|
15
|
+
}
|
|
9
16
|
export default GiftCardOrCouponSubmit;
|
|
@@ -1 +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"));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,exports.default=GiftCardOrCouponSubmit;
|
|
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;
|
|
@@ -1,8 +1,15 @@
|
|
|
1
|
-
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
2
|
import { LineItemType } from '../../typings/index';
|
|
3
3
|
declare type Props = {
|
|
4
|
-
children:
|
|
4
|
+
children: ReactNode;
|
|
5
5
|
type?: LineItemType;
|
|
6
6
|
};
|
|
7
7
|
export declare function LineItem(props: Props): JSX.Element;
|
|
8
|
+
export declare namespace LineItem {
|
|
9
|
+
var propTypes: {
|
|
10
|
+
children: import("prop-types").Validator<NonNullable<ReactNode | (() => JSX.Element)>>;
|
|
11
|
+
type: import("prop-types").Requireable<LineItemType>;
|
|
12
|
+
};
|
|
13
|
+
var displayName: string;
|
|
14
|
+
}
|
|
8
15
|
export default LineItem;
|
|
@@ -1 +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")),ShipmentChildrenContext_1=tslib_1.__importDefault(require("../../context/ShipmentChildrenContext"));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,exports.default=LineItem;
|
|
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;
|
|
@@ -4,4 +4,17 @@ declare type Props = BaseAmountComponent & {
|
|
|
4
4
|
type?: BasePriceType;
|
|
5
5
|
};
|
|
6
6
|
export declare function LineItemAmount(props: Props): JSX.Element;
|
|
7
|
+
export declare namespace LineItemAmount {
|
|
8
|
+
var propTypes: {
|
|
9
|
+
type: import("prop-types").Requireable<BasePriceType>;
|
|
10
|
+
id: import("prop-types").Requireable<string>;
|
|
11
|
+
className: import("prop-types").Requireable<string>;
|
|
12
|
+
style: import("prop-types").Requireable<object>;
|
|
13
|
+
name: import("prop-types").Requireable<string>;
|
|
14
|
+
children: import("prop-types").Requireable<(...args: any[]) => any>;
|
|
15
|
+
format: import("prop-types").Requireable<import("../../typings/index").BaseFormatPrice>;
|
|
16
|
+
};
|
|
17
|
+
var defaultProps: Props;
|
|
18
|
+
var displayName: string;
|
|
19
|
+
}
|
|
7
20
|
export default LineItemAmount;
|
|
@@ -1 +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"));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,exports.default=LineItemAmount;
|
|
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;
|
|
@@ -9,4 +9,10 @@ declare type Props = {
|
|
|
9
9
|
type?: 'sku_code' | 'bundle_code';
|
|
10
10
|
} & JSX.IntrinsicElements['p'];
|
|
11
11
|
export declare function LineItemCode({ type, children, ...p }: Props): JSX.Element;
|
|
12
|
+
export declare namespace LineItemCode {
|
|
13
|
+
var propTypes: {
|
|
14
|
+
children: import("prop-types").Requireable<(...args: any[]) => any>;
|
|
15
|
+
};
|
|
16
|
+
var displayName: string;
|
|
17
|
+
}
|
|
12
18
|
export default LineItemCode;
|
|
@@ -1 +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"));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,exports.default=LineItemCode;
|
|
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;
|
|
@@ -13,4 +13,11 @@ declare type Props = {
|
|
|
13
13
|
};
|
|
14
14
|
} & Omit<JSX.IntrinsicElements['img'], 'src' | 'srcSet' | 'placeholder'>;
|
|
15
15
|
export declare function LineItemImage(props: Props): JSX.Element | null;
|
|
16
|
+
export declare namespace LineItemImage {
|
|
17
|
+
var propTypes: {
|
|
18
|
+
width: import("prop-types").Requireable<number>;
|
|
19
|
+
children: import("prop-types").Requireable<(...args: any[]) => any>;
|
|
20
|
+
};
|
|
21
|
+
var displayName: string;
|
|
22
|
+
}
|
|
16
23
|
export default LineItemImage;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.LineItemImage=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")),LineItemChildrenContext_1=tslib_1.__importDefault(require("../../context/LineItemChildrenContext")),placeholderImages_1=require("../../utils/placeholderImages");function LineItemImage(props){const{placeholder,children,...p}=props,{lineItem}=(0,react_1.useContext)(LineItemChildrenContext_1.default),itemType=lineItem?.item_type;let src=lineItem?.image_url;src||(placeholder?.[itemType]?src=placeholder?.[itemType]:src=itemType==="gift_cards"?placeholderImages_1.defaultGiftCardImgUrl:placeholderImages_1.defaultImgUrl);const parenProps={lineItem,src,placeholder,...p};return children?(0,jsx_runtime_1.jsx)(Parent_1.default,{...parenProps,children}):src?(0,jsx_runtime_1.jsx)("img",{alt:"",src,...p}):null}exports.LineItemImage=LineItemImage,exports.default=LineItemImage;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.LineItemImage=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")),LineItemChildrenContext_1=tslib_1.__importDefault(require("../../context/LineItemChildrenContext")),components_1=tslib_1.__importDefault(require("../../config/components")),placeholderImages_1=require("../../utils/placeholderImages"),propTypes=components_1.default.LineItemImage.propTypes,displayName=components_1.default.LineItemImage.displayName;function LineItemImage(props){const{placeholder,children,...p}=props,{lineItem}=(0,react_1.useContext)(LineItemChildrenContext_1.default),itemType=lineItem?.item_type;let src=lineItem?.image_url;src||(placeholder?.[itemType]?src=placeholder?.[itemType]:src=itemType==="gift_cards"?placeholderImages_1.defaultGiftCardImgUrl:placeholderImages_1.defaultImgUrl);const parenProps={lineItem,src,placeholder,...p};return children?(0,jsx_runtime_1.jsx)(Parent_1.default,{...parenProps,children}):src?(0,jsx_runtime_1.jsx)("img",{alt:"",src,...p}):null}exports.LineItemImage=LineItemImage,LineItemImage.propTypes=propTypes,LineItemImage.displayName=displayName,exports.default=LineItemImage;
|
|
@@ -8,4 +8,10 @@ declare type Props = {
|
|
|
8
8
|
children?: (props: LineItemNameType) => JSX.Element;
|
|
9
9
|
} & JSX.IntrinsicElements['p'];
|
|
10
10
|
export declare function LineItemName(props: Props): JSX.Element;
|
|
11
|
+
export declare namespace LineItemName {
|
|
12
|
+
var propTypes: {
|
|
13
|
+
children: import("prop-types").Requireable<(...args: any[]) => any>;
|
|
14
|
+
};
|
|
15
|
+
var displayName: string;
|
|
16
|
+
}
|
|
11
17
|
export default LineItemName;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.LineItemName=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"));function LineItemName(props){const{lineItem}=(0,react_1.useContext)(LineItemChildrenContext_1.default),label=lineItem?.name,parentProps={label,lineItem,...props};return props.children?(0,jsx_runtime_1.jsx)(Parent_1.default,{...parentProps,children:props.children}):(0,jsx_runtime_1.jsx)("p",{...props,children:label})}exports.LineItemName=LineItemName,exports.default=LineItemName;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.LineItemName=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.LineItemName.propTypes,displayName=components_1.default.LineItemName.displayName;function LineItemName(props){const{lineItem}=(0,react_1.useContext)(LineItemChildrenContext_1.default),label=lineItem?.name,parentProps={label,lineItem,...props};return props.children?(0,jsx_runtime_1.jsx)(Parent_1.default,{...parentProps,children:props.children}):(0,jsx_runtime_1.jsx)("p",{...props,children:label})}exports.LineItemName=LineItemName,LineItemName.propTypes=propTypes,LineItemName.displayName=displayName,exports.default=LineItemName;
|
|
@@ -16,4 +16,15 @@ declare type Props = {
|
|
|
16
16
|
tagContainer?: keyof JSX.IntrinsicElements;
|
|
17
17
|
};
|
|
18
18
|
export declare function LineItemOption(props: Props): JSX.Element;
|
|
19
|
+
export declare namespace LineItemOption {
|
|
20
|
+
var propTypes: {
|
|
21
|
+
name: import("prop-types").Requireable<string>;
|
|
22
|
+
children: import("prop-types").Requireable<(...args: any[]) => any>;
|
|
23
|
+
valueClassName: import("prop-types").Requireable<string>;
|
|
24
|
+
className: import("prop-types").Requireable<string>;
|
|
25
|
+
id: import("prop-types").Requireable<string>;
|
|
26
|
+
style: import("prop-types").Requireable<object>;
|
|
27
|
+
};
|
|
28
|
+
var displayName: string;
|
|
29
|
+
}
|
|
19
30
|
export default LineItemOption;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.LineItemOption=void 0;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),react_1=require("react"),LineItemOptionChildrenContext_1=tslib_1.__importDefault(require("../../context/LineItemOptionChildrenContext")),get_1=tslib_1.__importDefault(require("lodash/get")),has_1=tslib_1.__importDefault(require("lodash/has")),map_1=tslib_1.__importDefault(require("lodash/map")),Parent_1=tslib_1.__importDefault(require("../utils/Parent")),isJSON_1=tslib_1.__importDefault(require("../../utils/isJSON"));function LineItemOption(props){const{name,children,valueClassName,key,tagElement="li",tagContainer="ul",...p}=props,{lineItemOption,showAll}=(0,react_1.useContext)(LineItemOptionChildrenContext_1.default),parentProps={...props,lineItemOption},TagElement=tagElement,TagContainer=tagContainer,components=showAll&&(0,isJSON_1.default)(JSON.stringify(lineItemOption?.options))?(0,map_1.default)(lineItemOption?.options,(value,key2)=>(0,jsx_runtime_1.jsxs)(TagElement,{...p,children:[`${key2}:`,(0,jsx_runtime_1.jsx)("span",{className:valueClassName,children:`${value}`})]},key2)):(0,has_1.default)(lineItemOption,`options.${name}`)?(0,jsx_runtime_1.jsxs)(TagElement,{...p,children:[`${name}:`,(0,jsx_runtime_1.jsx)("span",{className:valueClassName,...p,children:`${(0,get_1.default)(lineItemOption,`options.${name}`)}`})]},key):null;return children?(0,jsx_runtime_1.jsx)(Parent_1.default,{...parentProps,children:props.children}):(0,jsx_runtime_1.jsx)(TagContainer,{children:components})}exports.LineItemOption=LineItemOption,exports.default=LineItemOption;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.LineItemOption=void 0;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),react_1=require("react"),LineItemOptionChildrenContext_1=tslib_1.__importDefault(require("../../context/LineItemOptionChildrenContext")),get_1=tslib_1.__importDefault(require("lodash/get")),has_1=tslib_1.__importDefault(require("lodash/has")),map_1=tslib_1.__importDefault(require("lodash/map")),Parent_1=tslib_1.__importDefault(require("../utils/Parent")),components_1=tslib_1.__importDefault(require("../../config/components")),isJSON_1=tslib_1.__importDefault(require("../../utils/isJSON")),propTypes=components_1.default.LineItemOption.propTypes,displayName=components_1.default.LineItemOption.displayName;function LineItemOption(props){const{name,children,valueClassName,key,tagElement="li",tagContainer="ul",...p}=props,{lineItemOption,showAll}=(0,react_1.useContext)(LineItemOptionChildrenContext_1.default),parentProps={...props,lineItemOption},TagElement=tagElement,TagContainer=tagContainer,components=showAll&&(0,isJSON_1.default)(JSON.stringify(lineItemOption?.options))?(0,map_1.default)(lineItemOption?.options,(value,key2)=>(0,jsx_runtime_1.jsxs)(TagElement,{...p,children:[`${key2}:`,(0,jsx_runtime_1.jsx)("span",{className:valueClassName,children:`${value}`})]},key2)):(0,has_1.default)(lineItemOption,`options.${name}`)?(0,jsx_runtime_1.jsxs)(TagElement,{...p,children:[`${name}:`,(0,jsx_runtime_1.jsx)("span",{className:valueClassName,...p,children:`${(0,get_1.default)(lineItemOption,`options.${name}`)}`})]},key):null;return children?(0,jsx_runtime_1.jsx)(Parent_1.default,{...parentProps,children:props.children}):(0,jsx_runtime_1.jsx)(TagContainer,{children:components})}exports.LineItemOption=LineItemOption,LineItemOption.propTypes=propTypes,LineItemOption.displayName=displayName,exports.default=LineItemOption;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
2
|
declare type Props = JSX.IntrinsicElements['div'] & {
|
|
3
|
-
children:
|
|
3
|
+
children: ReactNode;
|
|
4
4
|
title?: string;
|
|
5
5
|
showName?: boolean;
|
|
6
6
|
titleTagElement?: keyof JSX.IntrinsicElements;
|
|
@@ -13,4 +13,7 @@ declare type Props = JSX.IntrinsicElements['div'] & {
|
|
|
13
13
|
showAll: true;
|
|
14
14
|
});
|
|
15
15
|
export declare function LineItemOptions(props: Props): JSX.Element;
|
|
16
|
+
export declare namespace LineItemOptions {
|
|
17
|
+
var displayName: string;
|
|
18
|
+
}
|
|
16
19
|
export default LineItemOptions;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.LineItemOptions=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")),LineItemOptionChildrenContext_1=tslib_1.__importDefault(require("../../context/LineItemOptionChildrenContext")),lodash_1=require("lodash");function LineItemOptions(props){const{skuOptionId,title,children,showName=!0,showAll,className,titleTagElement="h6",titleClassName,...p}=props,{lineItem}=(0,react_1.useContext)(LineItemChildrenContext_1.default),lineItemOptions=(0,lodash_1.isEmpty)(lineItem)?[]:lineItem?.line_item_options||[],TitleTagElement=titleTagElement,options=lineItemOptions.filter(o=>showAll?!0:o.skuOption().id===skuOptionId).map((o,k)=>{const showTitle=showName?(0,jsx_runtime_1.jsx)(TitleTagElement,{className:titleClassName,children:title||o.name}):null,valueProps={lineItemOption:o,showAll};return(0,jsx_runtime_1.jsxs)("div",{className,...p,children:[showTitle,(0,jsx_runtime_1.jsx)(LineItemOptionChildrenContext_1.default.Provider,{value:valueProps,children})]},k)});return(0,jsx_runtime_1.jsx)(jsx_runtime_1.Fragment,{children:options})}exports.LineItemOptions=LineItemOptions,exports.default=LineItemOptions;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.LineItemOptions=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")),LineItemOptionChildrenContext_1=tslib_1.__importDefault(require("../../context/LineItemOptionChildrenContext")),lodash_1=require("lodash"),components_1=tslib_1.__importDefault(require("../../config/components")),displayName=components_1.default.LineItemOptions.displayName;function LineItemOptions(props){const{skuOptionId,title,children,showName=!0,showAll,className,titleTagElement="h6",titleClassName,...p}=props,{lineItem}=(0,react_1.useContext)(LineItemChildrenContext_1.default),lineItemOptions=(0,lodash_1.isEmpty)(lineItem)?[]:lineItem?.line_item_options||[],TitleTagElement=titleTagElement,options=lineItemOptions.filter(o=>showAll?!0:o.skuOption().id===skuOptionId).map((o,k)=>{const showTitle=showName?(0,jsx_runtime_1.jsx)(TitleTagElement,{className:titleClassName,children:title||o.name}):null,valueProps={lineItemOption:o,showAll};return(0,jsx_runtime_1.jsxs)("div",{className,...p,children:[showTitle,(0,jsx_runtime_1.jsx)(LineItemOptionChildrenContext_1.default.Provider,{value:valueProps,children})]},k)});return(0,jsx_runtime_1.jsx)(jsx_runtime_1.Fragment,{children:options})}exports.LineItemOptions=LineItemOptions,LineItemOptions.displayName=displayName,exports.default=LineItemOptions;
|
|
@@ -11,4 +11,16 @@ declare type Props = {
|
|
|
11
11
|
readonly?: boolean;
|
|
12
12
|
} & (JSX.IntrinsicElements['select'] & JSX.IntrinsicElements['span']);
|
|
13
13
|
export declare function LineItemQuantity(props: Props): JSX.Element;
|
|
14
|
+
export declare namespace LineItemQuantity {
|
|
15
|
+
var propTypes: {
|
|
16
|
+
children: import("prop-types").Requireable<(...args: any[]) => any>;
|
|
17
|
+
max: import("prop-types").Requireable<number>;
|
|
18
|
+
disabled: import("prop-types").Requireable<boolean>;
|
|
19
|
+
readonly: import("prop-types").Requireable<boolean>;
|
|
20
|
+
};
|
|
21
|
+
var defaultProps: {
|
|
22
|
+
max: number;
|
|
23
|
+
};
|
|
24
|
+
var displayName: string;
|
|
25
|
+
}
|
|
14
26
|
export default LineItemQuantity;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.LineItemQuantity=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")),LineItemContext_1=tslib_1.__importDefault(require("../../context/LineItemContext")),Parent_1=tslib_1.__importDefault(require("../utils/Parent"));function LineItemQuantity(props){const{max=50,readonly=!1,...p}=props,{lineItem}=(0,react_1.useContext)(LineItemChildrenContext_1.default),{updateLineItem}=(0,react_1.useContext)(LineItemContext_1.default),options=[];for(let i=1;i<=max;i++)options.push((0,jsx_runtime_1.jsx)("option",{value:`${i}`,children:i},i));const handleChange=e=>{const quantity2=Number(e.target.value);updateLineItem&&lineItem&&updateLineItem(lineItem.id,quantity2)},quantity=lineItem?.quantity,parentProps={handleChange,quantity,...props};return props.children?(0,jsx_runtime_1.jsx)(Parent_1.default,{...parentProps,children:props.children}):readonly?(0,jsx_runtime_1.jsx)("span",{...p,children:quantity}):(0,jsx_runtime_1.jsx)("select",{title:lineItem?.name,value:quantity,onChange:handleChange,...p,children:options})}exports.LineItemQuantity=LineItemQuantity,exports.default=LineItemQuantity;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.LineItemQuantity=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")),LineItemContext_1=tslib_1.__importDefault(require("../../context/LineItemContext")),Parent_1=tslib_1.__importDefault(require("../utils/Parent")),components_1=tslib_1.__importDefault(require("../../config/components")),propTypes=components_1.default.LineItemQuantity.propTypes,defaultProps=components_1.default.LineItemQuantity.defaultProps,displayName=components_1.default.LineItemQuantity.displayName;function LineItemQuantity(props){const{max=50,readonly=!1,...p}=props,{lineItem}=(0,react_1.useContext)(LineItemChildrenContext_1.default),{updateLineItem}=(0,react_1.useContext)(LineItemContext_1.default),options=[];for(let i=1;i<=max;i++)options.push((0,jsx_runtime_1.jsx)("option",{value:`${i}`,children:i},i));const handleChange=e=>{const quantity2=Number(e.target.value);updateLineItem&&lineItem&&updateLineItem(lineItem.id,quantity2)},quantity=lineItem?.quantity,parentProps={handleChange,quantity,...props};return props.children?(0,jsx_runtime_1.jsx)(Parent_1.default,{...parentProps,children:props.children}):readonly?(0,jsx_runtime_1.jsx)("span",{...p,children:quantity}):(0,jsx_runtime_1.jsx)("select",{title:lineItem?.name,value:quantity,onChange:handleChange,...p,children:options})}exports.LineItemQuantity=LineItemQuantity,LineItemQuantity.propTypes=propTypes,LineItemQuantity.defaultProps=defaultProps,LineItemQuantity.displayName=displayName,exports.default=LineItemQuantity;
|
|
@@ -9,4 +9,14 @@ declare type Props = {
|
|
|
9
9
|
label?: string;
|
|
10
10
|
} & PropsWithoutRef<JSX.IntrinsicElements['a']>;
|
|
11
11
|
export declare function LineItemRemoveLink(props: Props): JSX.Element;
|
|
12
|
+
export declare namespace LineItemRemoveLink {
|
|
13
|
+
var propTypes: {
|
|
14
|
+
children: import("prop-types").Requireable<(...args: any[]) => any>;
|
|
15
|
+
label: import("prop-types").Requireable<string>;
|
|
16
|
+
};
|
|
17
|
+
var defaultProps: {
|
|
18
|
+
label: string;
|
|
19
|
+
};
|
|
20
|
+
var displayName: string;
|
|
21
|
+
}
|
|
12
22
|
export default LineItemRemoveLink;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.LineItemRemoveLink=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")),LineItemContext_1=tslib_1.__importDefault(require("../../context/LineItemContext")),Parent_1=tslib_1.__importDefault(require("../utils/Parent"));function LineItemRemoveLink(props){const{label="Remove"}=props,{lineItem}=(0,react_1.useContext)(LineItemChildrenContext_1.default),{deleteLineItem}=(0,react_1.useContext)(LineItemContext_1.default),handleRemove=e=>{e.preventDefault(),deleteLineItem&&lineItem&&deleteLineItem(lineItem.id)},parentProps={handleRemove,...props};return props.children?(0,jsx_runtime_1.jsx)(Parent_1.default,{...parentProps,children:props.children}):(0,jsx_runtime_1.jsx)("a",{...props,href:"#",onClick:handleRemove,children:label})}exports.LineItemRemoveLink=LineItemRemoveLink,exports.default=LineItemRemoveLink;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.LineItemRemoveLink=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")),LineItemContext_1=tslib_1.__importDefault(require("../../context/LineItemContext")),Parent_1=tslib_1.__importDefault(require("../utils/Parent")),components_1=tslib_1.__importDefault(require("../../config/components")),propTypes=components_1.default.LineItemRemoveLink.propTypes,defaultProps=components_1.default.LineItemRemoveLink.defaultProps,displayName=components_1.default.LineItemRemoveLink.displayName;function LineItemRemoveLink(props){const{label="Remove"}=props,{lineItem}=(0,react_1.useContext)(LineItemChildrenContext_1.default),{deleteLineItem}=(0,react_1.useContext)(LineItemContext_1.default),handleRemove=e=>{e.preventDefault(),deleteLineItem&&lineItem&&deleteLineItem(lineItem.id)},parentProps={handleRemove,...props};return props.children?(0,jsx_runtime_1.jsx)(Parent_1.default,{...parentProps,children:props.children}):(0,jsx_runtime_1.jsx)("a",{...props,href:"#",onClick:handleRemove,children:label})}exports.LineItemRemoveLink=LineItemRemoveLink,LineItemRemoveLink.propTypes=propTypes,LineItemRemoveLink.defaultProps=defaultProps,LineItemRemoveLink.displayName=displayName,exports.default=LineItemRemoveLink;
|
|
@@ -1,8 +1,20 @@
|
|
|
1
|
-
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
2
|
declare type Props = {
|
|
3
|
-
children:
|
|
3
|
+
children: ReactNode;
|
|
4
4
|
filters?: Record<string, any>;
|
|
5
|
-
loader?:
|
|
5
|
+
loader?: ReactNode;
|
|
6
6
|
};
|
|
7
7
|
export declare function LineItemsContainer(props: Props): JSX.Element;
|
|
8
|
+
export declare namespace LineItemsContainer {
|
|
9
|
+
var propTypes: {
|
|
10
|
+
children: import("prop-types").Validator<NonNullable<ReactNode | (() => JSX.Element)>>;
|
|
11
|
+
filters: import("prop-types").Requireable<object>;
|
|
12
|
+
loader: import("prop-types").Requireable<NonNullable<string | import("prop-types").ReactElementLike | null | undefined>>;
|
|
13
|
+
};
|
|
14
|
+
var defaultProps: {
|
|
15
|
+
filters: {};
|
|
16
|
+
loader: string;
|
|
17
|
+
};
|
|
18
|
+
var displayName: string;
|
|
19
|
+
}
|
|
8
20
|
export default LineItemsContainer;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.LineItemsContainer=void 0;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),react_1=require("react"),LineItemReducer_1=tslib_1.__importStar(require("../../reducers/LineItemReducer")),OrderContext_1=tslib_1.__importDefault(require("../../context/OrderContext")),LineItemContext_1=tslib_1.__importDefault(require("../../context/LineItemContext")),CommerceLayerContext_1=tslib_1.__importDefault(require("../../context/CommerceLayerContext"));function LineItemsContainer(props){const{children,loader="Loading..."}=props,{order,addResourceToInclude,include,orderId,getOrder,includeLoaded}=(0,react_1.useContext)(OrderContext_1.default),config=(0,react_1.useContext)(CommerceLayerContext_1.default),[state,dispatch]=(0,react_1.useReducer)(LineItemReducer_1.default,LineItemReducer_1.lineItemInitialState);(0,react_1.useEffect)(()=>{include?.includes("line_items.line_item_options.sku_option")?includeLoaded?.["line_items.line_item_options.sku_option"]||addResourceToInclude({newResourceLoaded:{"line_items.line_item_options.sku_option":!0}}):addResourceToInclude({newResource:["line_items.line_item_options.sku_option"]}),include?.includes("line_items.item")?includeLoaded?.["line_items.item"]||addResourceToInclude({newResourceLoaded:{"line_items.item":!0}}):addResourceToInclude({newResource:["line_items.item"]})},[include,includeLoaded]),(0,react_1.useEffect)(()=>{order?.line_items&&dispatch({type:"setLineItems",payload:{lineItems:order.line_items}})},[order?.line_items]);const lineItemValue={...state,loader,updateLineItem:(lineItemId,quantity=1)=>(0,LineItemReducer_1.updateLineItem)({lineItemId,quantity,dispatch,config,getOrder,orderId,errors:state.errors}),deleteLineItem:lineItemId=>(0,LineItemReducer_1.deleteLineItem)({lineItemId,dispatch,config,getOrder,orderId,errors:state.errors})};return(0,jsx_runtime_1.jsx)(LineItemContext_1.default.Provider,{value:lineItemValue,children:state.loading?loader:children})}exports.LineItemsContainer=LineItemsContainer,exports.default=LineItemsContainer;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.LineItemsContainer=void 0;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),react_1=require("react"),LineItemReducer_1=tslib_1.__importStar(require("../../reducers/LineItemReducer")),OrderContext_1=tslib_1.__importDefault(require("../../context/OrderContext")),LineItemContext_1=tslib_1.__importDefault(require("../../context/LineItemContext")),CommerceLayerContext_1=tslib_1.__importDefault(require("../../context/CommerceLayerContext")),components_1=tslib_1.__importDefault(require("../../config/components")),propTypes=components_1.default.LineItemsContainer.propTypes,defaultProps=components_1.default.LineItemsContainer.defaultProps,displayName=components_1.default.LineItemsContainer.displayName;function LineItemsContainer(props){const{children,loader="Loading..."}=props,{order,addResourceToInclude,include,orderId,getOrder,includeLoaded}=(0,react_1.useContext)(OrderContext_1.default),config=(0,react_1.useContext)(CommerceLayerContext_1.default),[state,dispatch]=(0,react_1.useReducer)(LineItemReducer_1.default,LineItemReducer_1.lineItemInitialState);(0,react_1.useEffect)(()=>{include?.includes("line_items.line_item_options.sku_option")?includeLoaded?.["line_items.line_item_options.sku_option"]||addResourceToInclude({newResourceLoaded:{"line_items.line_item_options.sku_option":!0}}):addResourceToInclude({newResource:["line_items.line_item_options.sku_option"]}),include?.includes("line_items.item")?includeLoaded?.["line_items.item"]||addResourceToInclude({newResourceLoaded:{"line_items.item":!0}}):addResourceToInclude({newResource:["line_items.item"]})},[include,includeLoaded]),(0,react_1.useEffect)(()=>{order?.line_items&&dispatch({type:"setLineItems",payload:{lineItems:order.line_items}})},[order?.line_items]);const lineItemValue={...state,loader,updateLineItem:(lineItemId,quantity=1)=>(0,LineItemReducer_1.updateLineItem)({lineItemId,quantity,dispatch,config,getOrder,orderId,errors:state.errors}),deleteLineItem:lineItemId=>(0,LineItemReducer_1.deleteLineItem)({lineItemId,dispatch,config,getOrder,orderId,errors:state.errors})};return(0,jsx_runtime_1.jsx)(LineItemContext_1.default.Provider,{value:lineItemValue,children:state.loading?loader:children})}exports.LineItemsContainer=LineItemsContainer,LineItemsContainer.propTypes=propTypes,LineItemsContainer.defaultProps=defaultProps,LineItemsContainer.displayName=displayName,exports.default=LineItemsContainer;
|
|
@@ -9,4 +9,14 @@ declare type Props = {
|
|
|
9
9
|
typeAccepted?: TypeAccepted[];
|
|
10
10
|
} & JSX.IntrinsicElements['span'];
|
|
11
11
|
export declare function LineItemsCount(props: Props): JSX.Element;
|
|
12
|
+
export declare namespace LineItemsCount {
|
|
13
|
+
var propTypes: {
|
|
14
|
+
children: import("prop-types").Requireable<(...args: any[]) => any>;
|
|
15
|
+
id: import("prop-types").Requireable<string>;
|
|
16
|
+
className: import("prop-types").Requireable<string>;
|
|
17
|
+
name: import("prop-types").Requireable<string>;
|
|
18
|
+
style: import("prop-types").Requireable<object>;
|
|
19
|
+
};
|
|
20
|
+
var displayName: string;
|
|
21
|
+
}
|
|
12
22
|
export default LineItemsCount;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.LineItemsCount=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")),getLineItemsCount_1=tslib_1.__importDefault(require("../../utils/getLineItemsCount")),LineItemContext_1=tslib_1.__importDefault(require("../../context/LineItemContext"));function LineItemsCount(props){const{children,typeAccepted,...p}=props,{lineItems}=(0,react_1.useContext)(LineItemContext_1.default),[quantity,setQuantity]=(0,react_1.useState)(0);(0,react_1.useEffect)(()=>{if(lineItems&&lineItems.length>0){const qty=(0,getLineItemsCount_1.default)({lineItems:lineItems||[],typeAccepted});setQuantity(qty)}return()=>{setQuantity(0)}},[lineItems,typeAccepted]);const parentProps={quantity,typeAccepted,...p};return children?(0,jsx_runtime_1.jsx)(Parent_1.default,{...parentProps,children}):(0,jsx_runtime_1.jsx)("span",{...p,children:quantity})}exports.LineItemsCount=LineItemsCount,exports.default=LineItemsCount;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.LineItemsCount=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")),getLineItemsCount_1=tslib_1.__importDefault(require("../../utils/getLineItemsCount")),LineItemContext_1=tslib_1.__importDefault(require("../../context/LineItemContext")),components_1=tslib_1.__importDefault(require("../../config/components")),propTypes=components_1.default.LineItemsCount.propTypes,displayName=components_1.default.LineItemsCount.displayName;function LineItemsCount(props){const{children,typeAccepted,...p}=props,{lineItems}=(0,react_1.useContext)(LineItemContext_1.default),[quantity,setQuantity]=(0,react_1.useState)(0);(0,react_1.useEffect)(()=>{if(lineItems&&lineItems.length>0){const qty=(0,getLineItemsCount_1.default)({lineItems:lineItems||[],typeAccepted});setQuantity(qty)}return()=>{setQuantity(0)}},[lineItems,typeAccepted]);const parentProps={quantity,typeAccepted,...p};return children?(0,jsx_runtime_1.jsx)(Parent_1.default,{...parentProps,children}):(0,jsx_runtime_1.jsx)("span",{...p,children:quantity})}exports.LineItemsCount=LineItemsCount,LineItemsCount.propTypes=propTypes,LineItemsCount.displayName=displayName,exports.default=LineItemsCount;
|
|
@@ -9,4 +9,15 @@ declare type LineItemsCountProps = {
|
|
|
9
9
|
text?: string;
|
|
10
10
|
} & JSX.IntrinsicElements['span'];
|
|
11
11
|
export declare function LineItemsEmpty(props: LineItemsCountProps): JSX.Element | null;
|
|
12
|
+
export declare namespace LineItemsEmpty {
|
|
13
|
+
var propTypes: {
|
|
14
|
+
children: import("prop-types").Requireable<(...args: any[]) => any>;
|
|
15
|
+
id: import("prop-types").Requireable<string>;
|
|
16
|
+
className: import("prop-types").Requireable<string>;
|
|
17
|
+
name: import("prop-types").Requireable<string>;
|
|
18
|
+
style: import("prop-types").Requireable<object>;
|
|
19
|
+
text: import("prop-types").Requireable<string>;
|
|
20
|
+
};
|
|
21
|
+
var displayName: string;
|
|
22
|
+
}
|
|
12
23
|
export default LineItemsEmpty;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.LineItemsEmpty=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")),getLineItemsCount_1=tslib_1.__importDefault(require("../../utils/getLineItemsCount")),LineItemContext_1=tslib_1.__importDefault(require("../../context/LineItemContext"));function LineItemsEmpty(props){const{children,text="Your shopping bag is empty",...p}=props,{lineItems}=(0,react_1.useContext)(LineItemContext_1.default),[quantity,setQuantity]=(0,react_1.useState)(),emptyText=quantity===0?(0,jsx_runtime_1.jsx)("span",{...p,children:text}):null;(0,react_1.useEffect)(()=>{if(lineItems)if(lineItems.length>0){const qty=(0,getLineItemsCount_1.default)({lineItems:lineItems||[]});setQuantity(qty)}else setQuantity(0);return()=>{setQuantity(void 0)}},[lineItems]);const parentProps={quantity,text,...p};return children?(0,jsx_runtime_1.jsx)(Parent_1.default,{...parentProps,children}):emptyText}exports.LineItemsEmpty=LineItemsEmpty,exports.default=LineItemsEmpty;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.LineItemsEmpty=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")),getLineItemsCount_1=tslib_1.__importDefault(require("../../utils/getLineItemsCount")),LineItemContext_1=tslib_1.__importDefault(require("../../context/LineItemContext")),components_1=tslib_1.__importDefault(require("../../config/components")),propTypes=components_1.default.LineItemsEmpty.propTypes,displayName=components_1.default.LineItemsEmpty.displayName;function LineItemsEmpty(props){const{children,text="Your shopping bag is empty",...p}=props,{lineItems}=(0,react_1.useContext)(LineItemContext_1.default),[quantity,setQuantity]=(0,react_1.useState)(),emptyText=quantity===0?(0,jsx_runtime_1.jsx)("span",{...p,children:text}):null;(0,react_1.useEffect)(()=>{if(lineItems)if(lineItems.length>0){const qty=(0,getLineItemsCount_1.default)({lineItems:lineItems||[]});setQuantity(qty)}else setQuantity(0);return()=>{setQuantity(void 0)}},[lineItems]);const parentProps={quantity,text,...p};return children?(0,jsx_runtime_1.jsx)(Parent_1.default,{...parentProps,children}):emptyText}exports.LineItemsEmpty=LineItemsEmpty,LineItemsEmpty.propTypes=propTypes,LineItemsEmpty.displayName=displayName,exports.default=LineItemsEmpty;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.AddToCartButton=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")),OrderContext_1=tslib_1.__importDefault(require("../../context/OrderContext")),isEmpty_1=tslib_1.__importDefault(require("lodash/isEmpty")),has_1=tslib_1.__importDefault(require("lodash/has")),ItemContext_1=tslib_1.__importDefault(require("../../context/ItemContext")),getCurrentItemKey_1=tslib_1.__importDefault(require("../../utils/getCurrentItemKey")),SkuListsContext_1=tslib_1.__importDefault(require("../../context/SkuListsContext")),ExternalFunctionContext_1=tslib_1.__importDefault(require("../../context/ExternalFunctionContext")),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.AddToCartButton=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")),OrderContext_1=tslib_1.__importDefault(require("../../context/OrderContext")),isEmpty_1=tslib_1.__importDefault(require("lodash/isEmpty")),has_1=tslib_1.__importDefault(require("lodash/has")),ItemContext_1=tslib_1.__importDefault(require("../../context/ItemContext")),getCurrentItemKey_1=tslib_1.__importDefault(require("../../utils/getCurrentItemKey")),SkuListsContext_1=tslib_1.__importDefault(require("../../context/SkuListsContext")),ExternalFunctionContext_1=tslib_1.__importDefault(require("../../context/ExternalFunctionContext")),SkuChildrenContext_1=tslib_1.__importDefault(require("../../context/SkuChildrenContext")),getCartLink_1=tslib_1.__importDefault(require("../../utils/getCartLink")),CommerceLayerContext_1=tslib_1.__importDefault(require("../../context/CommerceLayerContext"));function AddToCartButton(props){const{label="Add to cart",children,skuCode,bundleCode,disabled,skuListId,lineItem,buyNowMode=!1,checkoutUrl,redirectToHostedCart,hostedCartUrl,...p}=props,{accessToken,endpoint}=(0,react_1.useContext)(CommerceLayerContext_1.default),{addToCart,orderId,getOrder,setOrderErrors}=(0,react_1.useContext)(OrderContext_1.default),{url,callExternalFunction}=(0,react_1.useContext)(ExternalFunctionContext_1.default),{item,items,quantity,option,prices,lineItems,lineItem:lineItemContext,skuCode:itemSkuCode}=(0,react_1.useContext)(ItemContext_1.default),{skuLists}=(0,react_1.useContext)(SkuListsContext_1.default),{sku}=(0,react_1.useContext)(SkuChildrenContext_1.default),[slug]=endpoint?endpoint.split(".commercelayer"):[""],sCode=!(0,isEmpty_1.default)(items)&&skuCode?items[skuCode]?.code:sku?.code||skuCode||(0,getCurrentItemKey_1.default)(item)||itemSkuCode,availabilityQuantity=item[sCode]?.inventory?.quantity,handleClick=async()=>{const qty=quantity[sCode],opt=option[sCode],customLineItem=(0,isEmpty_1.default)(lineItem||lineItemContext)?lineItems[sCode]:lineItem||lineItemContext;if(!(0,isEmpty_1.default)(skuLists)&&skuListId&&url){const slQty=quantity[skuListId]||1;if((0,has_1.default)(skuLists,skuListId)){const lineItems2=skuLists&&skuLists[skuListId].map(skuCode2=>({skuCode:skuCode2,quantity:slQty,_update_quantity:1}));return callExternalFunction({url,data:{resourceType:"orders",inputs:[{id:orderId,lineItems:lineItems2}]}}).then(async res=>(getOrder&&orderId&&await getOrder(orderId),res)).catch(({response})=>(setOrderErrors&&setOrderErrors(response.data),response))}}if(!url&&addToCart){const res=await addToCart({bundleCode,skuCode:sCode,skuId:item[sCode]?.id,quantity:qty,option:opt,lineItem:customLineItem,buyNowMode,checkoutUrl});if(redirectToHostedCart){const orderId2=res.orderId;hostedCartUrl?location.href=`https://${hostedCartUrl}/${orderId2}?accessToken=${accessToken}`:orderId2&&slug&&(location.href=(0,getCartLink_1.default)({orderId:orderId2,slug,accessToken}))}return res}else if(url)return callExternalFunction({url,data:{bundleCode,skuCode:sCode,skuId:item[sCode]?.id,quantity:qty,option:opt,lineItem:customLineItem,buyNowMode,checkoutUrl}}).then(async res=>(getOrder&&orderId&&await getOrder(orderId),res)).catch(({response})=>(setOrderErrors&&setOrderErrors(response.data),response))},autoDisabled=!(0,isEmpty_1.default)(skuLists)||skuListId?!1:disabled||!prices[sCode]||!sCode||availabilityQuantity===0,parentProps={handleClick,disabled:disabled||autoDisabled,label,...props};return children?(0,jsx_runtime_1.jsx)(Parent_1.default,{...parentProps,children}):(0,jsx_runtime_1.jsx)("button",{...p,disabled:autoDisabled,onClick:handleClick,children:label})}exports.AddToCartButton=AddToCartButton,exports.default=AddToCartButton;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import { FunctionComponent } from 'react';
|
|
2
2
|
import { BaseAmountComponent } from '../../typings/index';
|
|
3
|
-
|
|
3
|
+
declare const AdjustmentAmount: FunctionComponent<BaseAmountComponent>;
|
|
4
4
|
export default AdjustmentAmount;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0})
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),BaseOrderPrice_1=tslib_1.__importDefault(require("../utils/BaseOrderPrice")),AdjustmentAmount=props=>(0,jsx_runtime_1.jsx)(BaseOrderPrice_1.default,{base:"amount",type:"adjustment",...props});exports.default=AdjustmentAmount;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { MouseEvent } from 'react';
|
|
1
|
+
import { MouseEvent, ReactNode } from 'react';
|
|
2
2
|
import { FunctionChildren } from '../../typings/index';
|
|
3
3
|
declare type TChildren = FunctionChildren<Omit<Props, 'children'> & {
|
|
4
4
|
href: string;
|
|
@@ -6,7 +6,7 @@ declare type TChildren = FunctionChildren<Omit<Props, 'children'> & {
|
|
|
6
6
|
}>;
|
|
7
7
|
declare type Props = {
|
|
8
8
|
children?: TChildren;
|
|
9
|
-
label?: string |
|
|
9
|
+
label?: string | ReactNode;
|
|
10
10
|
} & JSX.IntrinsicElements['a'];
|
|
11
11
|
export declare function CartLink(props: Props): JSX.Element | null;
|
|
12
12
|
export default CartLink;
|