@commercelayer/react-components 4.0.1 → 4.1.0-beta.2
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 +2 -9
- package/lib/cjs/components/ExternalFunction.js +1 -1
- package/lib/cjs/components/MetadataInput.d.ts +1 -11
- package/lib/cjs/components/MetadataInput.js +1 -1
- package/lib/cjs/components/addresses/AddressCountrySelector.d.ts +1 -17
- package/lib/cjs/components/addresses/AddressCountrySelector.js +1 -1
- package/lib/cjs/components/addresses/AddressField.d.ts +2 -2
- package/lib/cjs/components/addresses/AddressInput.d.ts +1 -1
- package/lib/cjs/components/addresses/AddressStateSelector.d.ts +1 -17
- package/lib/cjs/components/addresses/AddressStateSelector.js +1 -1
- package/lib/cjs/components/addresses/BillingAddressContainer.d.ts +1 -1
- package/lib/cjs/components/addresses/BillingAddressForm.d.ts +1 -6
- package/lib/cjs/components/addresses/BillingAddressForm.js +1 -1
- package/lib/cjs/components/addresses/ShippingAddressContainer.d.ts +4 -9
- package/lib/cjs/components/addresses/ShippingAddressContainer.js +1 -1
- package/lib/cjs/components/addresses/ShippingAddressForm.d.ts +2 -7
- package/lib/cjs/components/addresses/ShippingAddressForm.js +1 -1
- package/lib/cjs/components/customers/CustomerAddressForm.d.ts +2 -7
- package/lib/cjs/components/customers/CustomerAddressForm.js +1 -1
- package/lib/cjs/components/customers/CustomerField.d.ts +3 -3
- package/lib/cjs/components/customers/CustomerInput.d.ts +2 -14
- package/lib/cjs/components/customers/CustomerInput.js +1 -1
- package/lib/cjs/components/errors/Errors.d.ts +5 -0
- package/lib/cjs/components/errors/Errors.js +1 -0
- package/lib/cjs/components/gift_cards/GiftCard.d.ts +2 -12
- package/lib/cjs/components/gift_cards/GiftCard.js +1 -1
- package/lib/cjs/components/gift_cards/GiftCardContainer.d.ts +2 -8
- package/lib/cjs/components/gift_cards/GiftCardContainer.js +1 -1
- package/lib/cjs/components/gift_cards/GiftCardCurrencySelector.d.ts +1 -16
- package/lib/cjs/components/gift_cards/GiftCardCurrencySelector.js +1 -1
- package/lib/cjs/components/gift_cards/GiftCardInput.d.ts +2 -11
- package/lib/cjs/components/gift_cards/GiftCardInput.js +1 -1
- package/lib/cjs/components/gift_cards/GiftCardOrCouponForm.d.ts +1 -6
- package/lib/cjs/components/gift_cards/GiftCardOrCouponForm.js +1 -1
- package/lib/cjs/components/gift_cards/GiftCardOrCouponInput.d.ts +2 -11
- package/lib/cjs/components/gift_cards/GiftCardOrCouponInput.js +1 -1
- package/lib/cjs/components/gift_cards/GiftCardOrCouponRemoveButton.d.ts +1 -1
- package/lib/cjs/components/line_items/LineItem.js +1 -1
- package/lib/cjs/components/line_items/LineItemAmount.d.ts +1 -1
- package/lib/cjs/components/line_items/LineItemField.d.ts +3 -3
- package/lib/cjs/components/line_items/LineItemImage.d.ts +1 -1
- package/lib/cjs/components/line_items/LineItemOptions.d.ts +1 -1
- package/lib/cjs/components/line_items/LineItemQuantity.d.ts +2 -2
- package/lib/cjs/components/line_items/LineItemsCount.d.ts +1 -1
- package/lib/cjs/components/orders/AddToCartButton.d.ts +4 -4
- package/lib/cjs/components/orders/OrderContainer.d.ts +12 -0
- package/lib/cjs/components/orders/OrderList.d.ts +24 -7
- package/lib/cjs/components/orders/OrderList.js +1 -1
- package/lib/cjs/components/orders/OrderListPaginationButtons.d.ts +44 -0
- package/lib/cjs/components/orders/OrderListPaginationButtons.js +1 -0
- package/lib/cjs/components/orders/OrderListPaginationInfo.d.ts +29 -0
- package/lib/cjs/components/orders/OrderListPaginationInfo.js +1 -0
- package/lib/cjs/components/orders/OrderListRow.d.ts +3 -0
- package/lib/cjs/components/orders/OrderListRow.js +1 -1
- package/lib/cjs/components/orders/OrderNumber.d.ts +1 -7
- package/lib/cjs/components/orders/OrderNumber.js +1 -1
- package/lib/cjs/components/orders/OrderStorage.d.ts +2 -10
- package/lib/cjs/components/orders/OrderStorage.js +1 -1
- package/lib/cjs/components/parcels/ParcelField.d.ts +3 -3
- package/lib/cjs/components/parcels/ParcelLineItemField.d.ts +3 -3
- package/lib/cjs/components/payment_gateways/AdyenGateway.d.ts +1 -1
- package/lib/cjs/components/payment_gateways/BraintreeGateway.d.ts +1 -1
- package/lib/cjs/components/payment_gateways/CheckoutComGateway.d.ts +1 -1
- package/lib/cjs/components/payment_gateways/KlarnaGateway.d.ts +1 -1
- package/lib/cjs/components/payment_gateways/PaymentGateway.d.ts +2 -2
- package/lib/cjs/components/payment_gateways/PaypalGateway.d.ts +1 -1
- package/lib/cjs/components/payment_gateways/StripeGateway.d.ts +1 -1
- package/lib/cjs/components/payment_gateways/WireTransferGateway.d.ts +1 -1
- package/lib/cjs/components/payment_methods/PaymentMethod.d.ts +1 -1
- package/lib/cjs/components/payment_methods/PaymentMethodRadioButton.d.ts +1 -1
- package/lib/cjs/components/payment_source/AdyenPayment.d.ts +2 -2
- package/lib/cjs/components/payment_source/BraintreePayment.d.ts +3 -3
- package/lib/cjs/components/payment_source/CheckoutComPayment.d.ts +2 -2
- package/lib/cjs/components/payment_source/KlarnaPayment.d.ts +1 -1
- package/lib/cjs/components/payment_source/PaymentSourceDetail.d.ts +1 -1
- package/lib/cjs/components/payment_source/PaymentSourceEditButton.d.ts +1 -1
- package/lib/cjs/components/payment_source/PaypalPayment.d.ts +2 -2
- package/lib/cjs/components/payment_source/StripePayment.d.ts +2 -2
- package/lib/cjs/components/payment_source/WireTransferPayment.d.ts +2 -2
- package/lib/cjs/components/shipments/ShipmentField.d.ts +2 -2
- package/lib/cjs/components/shipping_methods/ShippingMethodName.d.ts +1 -1
- package/lib/cjs/components/shipping_methods/ShippingMethodPrice.d.ts +1 -13
- package/lib/cjs/components/shipping_methods/ShippingMethodPrice.js +1 -1
- package/lib/cjs/components/shipping_methods/ShippingMethodRadioButton.d.ts +3 -9
- package/lib/cjs/components/shipping_methods/ShippingMethodRadioButton.js +1 -1
- package/lib/cjs/components/skus/AvailabilityTemplate.d.ts +2 -2
- package/lib/cjs/components/skus/DeliveryLeadTime.d.ts +3 -10
- package/lib/cjs/components/skus/DeliveryLeadTime.js +1 -1
- package/lib/cjs/components/skus/SkuField.d.ts +3 -3
- package/lib/cjs/components/skus/SkuList.d.ts +5 -9
- package/lib/cjs/components/skus/SkuList.js +1 -1
- package/lib/cjs/components/skus/SkuListsContainer.d.ts +2 -8
- package/lib/cjs/components/skus/SkuListsContainer.js +1 -1
- package/lib/cjs/components/skus/Skus.d.ts +2 -7
- package/lib/cjs/components/skus/Skus.js +1 -1
- package/lib/cjs/components/stock_transfers/StockTransferField.d.ts +3 -3
- package/lib/cjs/components/utils/AddressCardsTemplate.d.ts +2 -2
- package/lib/cjs/components/utils/BaseField.d.ts +1 -1
- package/lib/cjs/components/utils/BaseInput.d.ts +2 -2
- package/lib/cjs/components/utils/BaseOrderPrice.d.ts +1 -1
- package/lib/cjs/components/utils/BaseSelect.d.ts +1 -1
- package/lib/cjs/components/utils/GenericFieldComponent.d.ts +3 -3
- package/lib/cjs/components/utils/Parent.d.ts +1 -1
- package/lib/cjs/components/utils/PaymentCardsTemplate.d.ts +4 -4
- package/lib/cjs/components/utils/PriceTemplate.d.ts +1 -1
- package/lib/cjs/components/utils/getAllErrors.d.ts +1 -1
- package/lib/cjs/context/AddressContext.d.ts +1 -1
- package/lib/cjs/context/BillingAddressContext.d.ts +1 -1
- package/lib/cjs/context/BillingAddressFormContext.d.ts +1 -1
- package/lib/cjs/context/CouponAndGiftCardFormContext.d.ts +1 -1
- package/lib/cjs/context/CustomerAddressFormContext.d.ts +1 -1
- package/lib/cjs/context/CustomerContext.d.ts +1 -1
- package/lib/cjs/context/ExternalFunctionContext.d.ts +1 -1
- package/lib/cjs/context/LineItemChildrenContext.d.ts +1 -1
- package/lib/cjs/context/OrderListChildrenContext.d.ts +1 -1
- package/lib/cjs/context/OrderListPaginationContext.d.ts +19 -0
- package/lib/cjs/context/OrderListPaginationContext.js +1 -0
- package/lib/cjs/context/PaymentMethodContext.d.ts +1 -1
- package/lib/cjs/context/PaymentSourceContext.d.ts +2 -2
- package/lib/cjs/context/PlaceOrderContext.d.ts +1 -1
- package/lib/cjs/context/ShipmentContext.d.ts +1 -1
- package/lib/cjs/context/ShippingAddressContext.d.ts +1 -1
- package/lib/cjs/context/SkuChildrenContext.d.ts +1 -1
- package/lib/cjs/context/SkuContext.d.ts +1 -1
- package/lib/cjs/hooks/useOrderContainer.d.ts +6 -0
- package/lib/cjs/hooks/useOrderContainer.js +1 -0
- package/lib/cjs/index.d.ts +1 -1
- package/lib/cjs/index.js +1 -1
- package/lib/cjs/reducers/AddressReducer.d.ts +10 -10
- package/lib/cjs/reducers/AvailabilityReducer.d.ts +4 -4
- package/lib/cjs/reducers/BillingAddressReducer.d.ts +4 -4
- package/lib/cjs/reducers/CustomerReducer.d.ts +6 -6
- package/lib/cjs/reducers/GiftCardReducer.d.ts +12 -22
- package/lib/cjs/reducers/GiftCardReducer.js +1 -1
- package/lib/cjs/reducers/LineItemReducer.d.ts +4 -4
- package/lib/cjs/reducers/OrderReducer.d.ts +19 -19
- package/lib/cjs/reducers/OrderReducer.js +1 -1
- package/lib/cjs/reducers/PaymentMethodReducer.d.ts +17 -17
- package/lib/cjs/reducers/PlaceOrderReducer.d.ts +5 -5
- package/lib/cjs/reducers/PriceReducer.d.ts +3 -3
- package/lib/cjs/reducers/ShipmentReducer.d.ts +6 -6
- package/lib/cjs/reducers/ShippingAddressReducer.d.ts +4 -4
- package/lib/cjs/reducers/SkuListsReducer.d.ts +3 -3
- package/lib/cjs/reducers/SkuReducer.d.ts +3 -3
- package/lib/cjs/typings/errors.d.ts +5 -5
- package/lib/cjs/typings/index.d.ts +25 -25
- package/lib/cjs/utils/PropsType.d.ts +4 -4
- package/lib/cjs/utils/addressesManager.d.ts +3 -3
- package/lib/cjs/utils/checkIncludeResource.d.ts +1 -1
- package/lib/cjs/utils/compareObjAttribute.d.ts +2 -2
- package/lib/cjs/utils/filterChildren.d.ts +8 -0
- package/lib/cjs/utils/filterChildren.js +1 -0
- package/lib/cjs/utils/getCardDetails.d.ts +2 -2
- package/lib/cjs/utils/getCartLink.d.ts +1 -1
- package/lib/cjs/utils/getErrors.d.ts +1 -1
- package/lib/cjs/utils/getLineItemsCount.d.ts +1 -1
- package/lib/cjs/utils/hooks/useCustomContext.js +1 -1
- package/lib/cjs/utils/jwt.d.ts +1 -1
- package/lib/cjs/utils/localStorage.d.ts +1 -1
- package/lib/cjs/utils/omit.d.ts +1 -0
- package/lib/cjs/utils/omit.js +1 -0
- package/lib/esm/components/ExternalFunction.d.ts +2 -9
- package/lib/esm/components/ExternalFunction.js +1 -1
- package/lib/esm/components/MetadataInput.d.ts +1 -11
- package/lib/esm/components/MetadataInput.js +1 -1
- package/lib/esm/components/addresses/AddressCountrySelector.d.ts +1 -17
- package/lib/esm/components/addresses/AddressCountrySelector.js +1 -1
- package/lib/esm/components/addresses/AddressField.d.ts +2 -2
- package/lib/esm/components/addresses/AddressInput.d.ts +1 -1
- package/lib/esm/components/addresses/AddressStateSelector.d.ts +1 -17
- package/lib/esm/components/addresses/AddressStateSelector.js +1 -1
- package/lib/esm/components/addresses/BillingAddressContainer.d.ts +1 -1
- package/lib/esm/components/addresses/BillingAddressForm.d.ts +1 -6
- package/lib/esm/components/addresses/BillingAddressForm.js +1 -1
- package/lib/esm/components/addresses/ShippingAddressContainer.d.ts +4 -9
- package/lib/esm/components/addresses/ShippingAddressContainer.js +1 -1
- package/lib/esm/components/addresses/ShippingAddressForm.d.ts +2 -7
- package/lib/esm/components/addresses/ShippingAddressForm.js +1 -1
- package/lib/esm/components/customers/CustomerAddressForm.d.ts +2 -7
- package/lib/esm/components/customers/CustomerAddressForm.js +1 -1
- package/lib/esm/components/customers/CustomerField.d.ts +3 -3
- package/lib/esm/components/customers/CustomerInput.d.ts +2 -14
- package/lib/esm/components/customers/CustomerInput.js +1 -1
- package/lib/esm/components/errors/Errors.d.ts +5 -0
- package/lib/esm/components/errors/Errors.js +1 -0
- package/lib/esm/components/gift_cards/GiftCard.d.ts +2 -12
- package/lib/esm/components/gift_cards/GiftCard.js +1 -1
- package/lib/esm/components/gift_cards/GiftCardContainer.d.ts +2 -8
- package/lib/esm/components/gift_cards/GiftCardContainer.js +1 -1
- package/lib/esm/components/gift_cards/GiftCardCurrencySelector.d.ts +1 -16
- package/lib/esm/components/gift_cards/GiftCardCurrencySelector.js +1 -1
- package/lib/esm/components/gift_cards/GiftCardInput.d.ts +2 -11
- package/lib/esm/components/gift_cards/GiftCardInput.js +1 -1
- package/lib/esm/components/gift_cards/GiftCardOrCouponForm.d.ts +1 -6
- package/lib/esm/components/gift_cards/GiftCardOrCouponForm.js +1 -1
- package/lib/esm/components/gift_cards/GiftCardOrCouponInput.d.ts +2 -11
- package/lib/esm/components/gift_cards/GiftCardOrCouponInput.js +1 -1
- package/lib/esm/components/gift_cards/GiftCardOrCouponRemoveButton.d.ts +1 -1
- package/lib/esm/components/line_items/LineItem.js +1 -1
- package/lib/esm/components/line_items/LineItemAmount.d.ts +1 -1
- package/lib/esm/components/line_items/LineItemField.d.ts +3 -3
- package/lib/esm/components/line_items/LineItemImage.d.ts +1 -1
- package/lib/esm/components/line_items/LineItemOptions.d.ts +1 -1
- package/lib/esm/components/line_items/LineItemQuantity.d.ts +2 -2
- package/lib/esm/components/line_items/LineItemsCount.d.ts +1 -1
- package/lib/esm/components/orders/AddToCartButton.d.ts +4 -4
- package/lib/esm/components/orders/OrderContainer.d.ts +12 -0
- package/lib/esm/components/orders/OrderList.d.ts +24 -7
- package/lib/esm/components/orders/OrderList.js +1 -1
- package/lib/esm/components/orders/OrderListPaginationButtons.d.ts +44 -0
- package/lib/esm/components/orders/OrderListPaginationButtons.js +1 -0
- package/lib/esm/components/orders/OrderListPaginationInfo.d.ts +29 -0
- package/lib/esm/components/orders/OrderListPaginationInfo.js +1 -0
- package/lib/esm/components/orders/OrderListRow.d.ts +3 -0
- package/lib/esm/components/orders/OrderListRow.js +1 -1
- package/lib/esm/components/orders/OrderNumber.d.ts +1 -7
- package/lib/esm/components/orders/OrderNumber.js +1 -1
- package/lib/esm/components/orders/OrderStorage.d.ts +2 -10
- package/lib/esm/components/orders/OrderStorage.js +1 -1
- package/lib/esm/components/parcels/ParcelField.d.ts +3 -3
- package/lib/esm/components/parcels/ParcelLineItemField.d.ts +3 -3
- package/lib/esm/components/payment_gateways/AdyenGateway.d.ts +1 -1
- package/lib/esm/components/payment_gateways/BraintreeGateway.d.ts +1 -1
- package/lib/esm/components/payment_gateways/CheckoutComGateway.d.ts +1 -1
- package/lib/esm/components/payment_gateways/KlarnaGateway.d.ts +1 -1
- package/lib/esm/components/payment_gateways/PaymentGateway.d.ts +2 -2
- package/lib/esm/components/payment_gateways/PaypalGateway.d.ts +1 -1
- package/lib/esm/components/payment_gateways/StripeGateway.d.ts +1 -1
- package/lib/esm/components/payment_gateways/WireTransferGateway.d.ts +1 -1
- package/lib/esm/components/payment_methods/PaymentMethod.d.ts +1 -1
- package/lib/esm/components/payment_methods/PaymentMethodRadioButton.d.ts +1 -1
- package/lib/esm/components/payment_source/AdyenPayment.d.ts +2 -2
- package/lib/esm/components/payment_source/BraintreePayment.d.ts +3 -3
- package/lib/esm/components/payment_source/CheckoutComPayment.d.ts +2 -2
- package/lib/esm/components/payment_source/KlarnaPayment.d.ts +1 -1
- package/lib/esm/components/payment_source/PaymentSourceDetail.d.ts +1 -1
- package/lib/esm/components/payment_source/PaymentSourceEditButton.d.ts +1 -1
- package/lib/esm/components/payment_source/PaypalPayment.d.ts +2 -2
- package/lib/esm/components/payment_source/StripePayment.d.ts +2 -2
- package/lib/esm/components/payment_source/WireTransferPayment.d.ts +2 -2
- package/lib/esm/components/shipments/ShipmentField.d.ts +2 -2
- package/lib/esm/components/shipping_methods/ShippingMethodName.d.ts +1 -1
- package/lib/esm/components/shipping_methods/ShippingMethodPrice.d.ts +1 -13
- package/lib/esm/components/shipping_methods/ShippingMethodPrice.js +1 -1
- package/lib/esm/components/shipping_methods/ShippingMethodRadioButton.d.ts +3 -9
- package/lib/esm/components/shipping_methods/ShippingMethodRadioButton.js +1 -1
- package/lib/esm/components/skus/AvailabilityTemplate.d.ts +2 -2
- package/lib/esm/components/skus/DeliveryLeadTime.d.ts +3 -10
- package/lib/esm/components/skus/DeliveryLeadTime.js +1 -1
- package/lib/esm/components/skus/SkuField.d.ts +3 -3
- package/lib/esm/components/skus/SkuList.d.ts +5 -9
- package/lib/esm/components/skus/SkuList.js +1 -1
- package/lib/esm/components/skus/SkuListsContainer.d.ts +2 -8
- package/lib/esm/components/skus/SkuListsContainer.js +1 -1
- package/lib/esm/components/skus/Skus.d.ts +2 -7
- package/lib/esm/components/skus/Skus.js +1 -1
- package/lib/esm/components/stock_transfers/StockTransferField.d.ts +3 -3
- package/lib/esm/components/utils/AddressCardsTemplate.d.ts +2 -2
- package/lib/esm/components/utils/BaseField.d.ts +1 -1
- package/lib/esm/components/utils/BaseInput.d.ts +2 -2
- package/lib/esm/components/utils/BaseOrderPrice.d.ts +1 -1
- package/lib/esm/components/utils/BaseSelect.d.ts +1 -1
- package/lib/esm/components/utils/GenericFieldComponent.d.ts +3 -3
- package/lib/esm/components/utils/Parent.d.ts +1 -1
- package/lib/esm/components/utils/PaymentCardsTemplate.d.ts +4 -4
- package/lib/esm/components/utils/PriceTemplate.d.ts +1 -1
- package/lib/esm/components/utils/getAllErrors.d.ts +1 -1
- package/lib/esm/context/AddressContext.d.ts +1 -1
- package/lib/esm/context/BillingAddressContext.d.ts +1 -1
- package/lib/esm/context/BillingAddressFormContext.d.ts +1 -1
- package/lib/esm/context/CouponAndGiftCardFormContext.d.ts +1 -1
- package/lib/esm/context/CustomerAddressFormContext.d.ts +1 -1
- package/lib/esm/context/CustomerContext.d.ts +1 -1
- package/lib/esm/context/ExternalFunctionContext.d.ts +1 -1
- package/lib/esm/context/LineItemChildrenContext.d.ts +1 -1
- package/lib/esm/context/OrderListChildrenContext.d.ts +1 -1
- package/lib/esm/context/OrderListPaginationContext.d.ts +19 -0
- package/lib/esm/context/OrderListPaginationContext.js +1 -0
- package/lib/esm/context/PaymentMethodContext.d.ts +1 -1
- package/lib/esm/context/PaymentSourceContext.d.ts +2 -2
- package/lib/esm/context/PlaceOrderContext.d.ts +1 -1
- package/lib/esm/context/ShipmentContext.d.ts +1 -1
- package/lib/esm/context/ShippingAddressContext.d.ts +1 -1
- package/lib/esm/context/SkuChildrenContext.d.ts +1 -1
- package/lib/esm/context/SkuContext.d.ts +1 -1
- package/lib/esm/hooks/useOrderContainer.d.ts +6 -0
- package/lib/esm/hooks/useOrderContainer.js +1 -0
- package/lib/esm/index.d.ts +1 -1
- package/lib/esm/index.js +1 -1
- package/lib/esm/reducers/AddressReducer.d.ts +10 -10
- package/lib/esm/reducers/AvailabilityReducer.d.ts +4 -4
- package/lib/esm/reducers/BillingAddressReducer.d.ts +4 -4
- package/lib/esm/reducers/CustomerReducer.d.ts +6 -6
- package/lib/esm/reducers/GiftCardReducer.d.ts +12 -22
- package/lib/esm/reducers/GiftCardReducer.js +1 -1
- package/lib/esm/reducers/LineItemReducer.d.ts +4 -4
- package/lib/esm/reducers/OrderReducer.d.ts +19 -19
- package/lib/esm/reducers/OrderReducer.js +1 -1
- package/lib/esm/reducers/PaymentMethodReducer.d.ts +17 -17
- package/lib/esm/reducers/PlaceOrderReducer.d.ts +5 -5
- package/lib/esm/reducers/PriceReducer.d.ts +3 -3
- package/lib/esm/reducers/ShipmentReducer.d.ts +6 -6
- package/lib/esm/reducers/ShippingAddressReducer.d.ts +4 -4
- package/lib/esm/reducers/SkuListsReducer.d.ts +3 -3
- package/lib/esm/reducers/SkuReducer.d.ts +3 -3
- package/lib/esm/typings/errors.d.ts +5 -5
- package/lib/esm/typings/index.d.ts +25 -25
- package/lib/esm/utils/PropsType.d.ts +4 -4
- package/lib/esm/utils/addressesManager.d.ts +3 -3
- package/lib/esm/utils/checkIncludeResource.d.ts +1 -1
- package/lib/esm/utils/compareObjAttribute.d.ts +2 -2
- package/lib/esm/utils/filterChildren.d.ts +8 -0
- package/lib/esm/utils/filterChildren.js +1 -0
- package/lib/esm/utils/getCardDetails.d.ts +2 -2
- package/lib/esm/utils/getCartLink.d.ts +1 -1
- package/lib/esm/utils/getErrors.d.ts +1 -1
- package/lib/esm/utils/getLineItemsCount.d.ts +1 -1
- package/lib/esm/utils/hooks/useCustomContext.js +1 -1
- package/lib/esm/utils/jwt.d.ts +1 -1
- package/lib/esm/utils/localStorage.d.ts +1 -1
- package/lib/esm/utils/omit.d.ts +1 -0
- package/lib/esm/utils/omit.js +1 -0
- package/lib/tsconfig.prod.esm.tsbuildinfo +1 -1
- package/lib/tsconfig.prod.tsbuildinfo +1 -1
- package/package.json +45 -81
- package/README.md +0 -302
- package/lib/cjs/components/Errors.d.ts +0 -5
- package/lib/cjs/components/Errors.js +0 -1
- package/lib/cjs/config/components.d.ts +0 -860
- package/lib/cjs/config/components.js +0 -1
- package/lib/cjs/utils/childrenTypes.d.ts +0 -9
- package/lib/cjs/utils/childrenTypes.js +0 -1
- package/lib/esm/components/Errors.d.ts +0 -5
- package/lib/esm/components/Errors.js +0 -1
- package/lib/esm/config/components.d.ts +0 -860
- package/lib/esm/config/components.js +0 -1
- package/lib/esm/utils/childrenTypes.d.ts +0 -9
- package/lib/esm/utils/childrenTypes.js +0 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { Shipment } from '@commercelayer/sdk';
|
|
3
|
-
|
|
3
|
+
type ShipmentFieldChildrenProps = Omit<Props, 'children'> & {
|
|
4
4
|
shipment: Shipment;
|
|
5
5
|
};
|
|
6
|
-
export
|
|
6
|
+
export type ShipmentAttribute = 'number' | 'currency_code' | 'status' | 'cost_amount_cents' | 'cost_amount_float' | 'formatted_cost_amount' | 'key_number';
|
|
7
7
|
interface Props extends Omit<JSX.IntrinsicElements['span'], 'children'> {
|
|
8
8
|
children?: (props: ShipmentFieldChildrenProps) => JSX.Element;
|
|
9
9
|
name: ShipmentAttribute;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { BaseAmountComponent } from '../../typings/index';
|
|
3
|
-
|
|
3
|
+
type Props = BaseAmountComponent & {
|
|
4
4
|
labelFreeOver?: string;
|
|
5
5
|
} & ({
|
|
6
6
|
type?: 'amount';
|
|
@@ -10,16 +10,4 @@ declare type Props = BaseAmountComponent & {
|
|
|
10
10
|
base?: 'price';
|
|
11
11
|
});
|
|
12
12
|
export declare function ShippingMethodPrice(props: Props): JSX.Element;
|
|
13
|
-
export declare namespace ShippingMethodPrice {
|
|
14
|
-
var propTypes: {
|
|
15
|
-
type: import("prop-types").Requireable<"amount">;
|
|
16
|
-
id: import("prop-types").Requireable<string>;
|
|
17
|
-
className: import("prop-types").Requireable<string>;
|
|
18
|
-
style: import("prop-types").Requireable<object>;
|
|
19
|
-
name: import("prop-types").Requireable<string>;
|
|
20
|
-
children: import("prop-types").Requireable<(...args: any[]) => any>;
|
|
21
|
-
format: import("prop-types").Requireable<import("../../typings/index").BaseFormatPrice>;
|
|
22
|
-
};
|
|
23
|
-
var displayName: string;
|
|
24
|
-
}
|
|
25
13
|
export default ShippingMethodPrice;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.ShippingMethodPrice=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")),ShippingMethodChildrenContext_1=tslib_1.__importDefault(require("../../context/ShippingMethodChildrenContext")),Parent_1=tslib_1.__importDefault(require("../utils/Parent"))
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.ShippingMethodPrice=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")),ShippingMethodChildrenContext_1=tslib_1.__importDefault(require("../../context/ShippingMethodChildrenContext")),Parent_1=tslib_1.__importDefault(require("../utils/Parent"));function ShippingMethodPrice(props){const{base="price_amount",type="for_shipment",format="formatted",labelFreeOver="Free",...p}=props,{shippingMethod}=(0,react_1.useContext)(ShippingMethodChildrenContext_1.default),[price,setPrice]=(0,react_1.useState)(""),[priceCents,setPriceCents]=(0,react_1.useState)(0);(0,react_1.useEffect)(()=>{if(shippingMethod){const p2=(0,getAmount_1.default)({base,type,format,obj:shippingMethod});setPrice(p2);const pCents=(0,getAmount_1.default)({base:"price_amount",type:"for_shipment",format:"cents",obj:shippingMethod});setPriceCents(pCents)}return()=>{setPrice(""),setPriceCents(0)}},[shippingMethod]);const parentProps={price,...p},finalPrice=priceCents===0?labelFreeOver:price;return props.children?(0,jsx_runtime_1.jsx)(Parent_1.default,{...parentProps,children:props.children}):(0,jsx_runtime_1.jsx)("span",{...p,children:finalPrice})}exports.ShippingMethodPrice=ShippingMethodPrice,exports.default=ShippingMethodPrice;
|
|
@@ -1,19 +1,13 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { ShippingMethod } from '@commercelayer/sdk';
|
|
3
|
-
export
|
|
3
|
+
export type ShippingMethodRadioButtonType = Omit<Props, 'children'> & {
|
|
4
4
|
shippingMethod: ShippingMethod;
|
|
5
5
|
shipmentId: string;
|
|
6
6
|
};
|
|
7
|
-
export
|
|
8
|
-
|
|
7
|
+
export type ShippingMethodRadioButtonOnChangeType = (shippingMethod: ShippingMethod, shipmentId: string) => void;
|
|
8
|
+
type Props = {
|
|
9
9
|
children?: (props: ShippingMethodRadioButtonType) => JSX.Element;
|
|
10
10
|
onChange?: ShippingMethodRadioButtonOnChangeType;
|
|
11
11
|
} & Omit<JSX.IntrinsicElements['input'], 'onChange'>;
|
|
12
12
|
export declare function ShippingMethodRadioButton(props: Props): JSX.Element;
|
|
13
|
-
export declare namespace ShippingMethodRadioButton {
|
|
14
|
-
var propTypes: {
|
|
15
|
-
children: import("prop-types").Requireable<(...args: any[]) => any>;
|
|
16
|
-
};
|
|
17
|
-
var displayName: string;
|
|
18
|
-
}
|
|
19
13
|
export default ShippingMethodRadioButton;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.ShippingMethodRadioButton=void 0;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),react_1=require("react"),ShippingMethodChildrenContext_1=tslib_1.__importDefault(require("../../context/ShippingMethodChildrenContext")),Parent_1=tslib_1.__importDefault(require("../utils/Parent")),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.ShippingMethodRadioButton=void 0;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),react_1=require("react"),ShippingMethodChildrenContext_1=tslib_1.__importDefault(require("../../context/ShippingMethodChildrenContext")),Parent_1=tslib_1.__importDefault(require("../utils/Parent")),ShipmentContext_1=tslib_1.__importDefault(require("../../context/ShipmentContext"));function ShippingMethodRadioButton(props){const{onChange,...p}=props,[checked,setChecked]=(0,react_1.useState)(!1),{shippingMethod,currentShippingMethodId,shipmentId}=(0,react_1.useContext)(ShippingMethodChildrenContext_1.default),{setShippingMethod}=(0,react_1.useContext)(ShipmentContext_1.default),shippingMethodId=shippingMethod?.id,name=`shipment-${shipmentId??""}`,id=`${name}-${shippingMethodId??""}`;(0,react_1.useEffect)(()=>(setChecked(shippingMethodId===currentShippingMethodId),()=>{setChecked(!1)}),[currentShippingMethodId]);const handleOnChange=async()=>{shipmentId&&shippingMethodId&&(setChecked(!0),await setShippingMethod(shipmentId,shippingMethodId),shippingMethod&&onChange&&onChange(shippingMethod,shipmentId))},parentProps={shippingMethod,shipmentId,handleOnChange,name,id,...props};return props.children?(0,jsx_runtime_1.jsx)(Parent_1.default,{...parentProps,children:props.children}):(0,jsx_runtime_1.jsx)("input",{type:"radio",name,id,onChange:()=>{handleOnChange()},checked,...p})}exports.ShippingMethodRadioButton=ShippingMethodRadioButton,exports.default=ShippingMethodRadioButton;
|
|
@@ -5,7 +5,7 @@ interface AvailabilityTemplateChildrenProps extends Omit<Props, 'children'>, Del
|
|
|
5
5
|
text: string;
|
|
6
6
|
quantity: number;
|
|
7
7
|
}
|
|
8
|
-
|
|
8
|
+
type FormatRules = {
|
|
9
9
|
/**
|
|
10
10
|
* Set time format for shipping method
|
|
11
11
|
*/
|
|
@@ -27,7 +27,7 @@ declare type FormatRules = {
|
|
|
27
27
|
showShippingMethodName?: boolean;
|
|
28
28
|
showShippingMethodPrice: true;
|
|
29
29
|
};
|
|
30
|
-
|
|
30
|
+
type Props = {
|
|
31
31
|
children?: ChildrenFunction<AvailabilityTemplateChildrenProps>;
|
|
32
32
|
} & Omit<JSX.IntrinsicElements['span'], 'children'> & FormatRules;
|
|
33
33
|
export declare function AvailabilityTemplate(props: Props): JSX.Element;
|
|
@@ -1,17 +1,10 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
|
|
2
|
+
export type DeliveryLeadTimeField = 'min_hours' | 'max_hours' | 'min_days' | 'max_days';
|
|
3
|
+
export type DeliveryLeadTimeComponentChildren = Omit<Props, 'children'>;
|
|
4
|
+
type Props = Partial<JSX.IntrinsicElements['span']> & {
|
|
5
5
|
children?: (props: DeliveryLeadTimeComponentChildren) => JSX.Element;
|
|
6
6
|
type: DeliveryLeadTimeField;
|
|
7
7
|
text?: string;
|
|
8
8
|
};
|
|
9
9
|
export declare function DeliveryLeadTime(props: Props): JSX.Element;
|
|
10
|
-
export declare namespace DeliveryLeadTime {
|
|
11
|
-
var propTypes: {
|
|
12
|
-
type: import("prop-types").Validator<NonNullable<DeliveryLeadTimeField>>;
|
|
13
|
-
children: import("prop-types").Requireable<(...args: any[]) => any>;
|
|
14
|
-
};
|
|
15
|
-
var displayName: string;
|
|
16
|
-
}
|
|
17
10
|
export default DeliveryLeadTime;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.DeliveryLeadTime=void 0;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),react_1=require("react"),ShippingMethodChildrenContext_1=tslib_1.__importDefault(require("../../context/ShippingMethodChildrenContext")),Parent_1=tslib_1.__importDefault(require("../utils/Parent"))
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.DeliveryLeadTime=void 0;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),react_1=require("react"),ShippingMethodChildrenContext_1=tslib_1.__importDefault(require("../../context/ShippingMethodChildrenContext")),Parent_1=tslib_1.__importDefault(require("../utils/Parent"));function DeliveryLeadTime(props){const{type,...p}=props,[text,setText]=(0,react_1.useState)(),{deliveryLeadTimeForShipment}=(0,react_1.useContext)(ShippingMethodChildrenContext_1.default);(0,react_1.useEffect)(()=>(deliveryLeadTimeForShipment?.[type]&&setText(deliveryLeadTimeForShipment[type]),()=>{setText("")}),[deliveryLeadTimeForShipment]);const parentProps={text,...p};return props.children?(0,jsx_runtime_1.jsx)(Parent_1.default,{...parentProps,children:props.children}):(0,jsx_runtime_1.jsx)("span",{...p,children:text})}exports.DeliveryLeadTime=DeliveryLeadTime,exports.default=DeliveryLeadTime;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { ConditionalElement } from '../../typings/index';
|
|
3
3
|
import { TGenericChildrenProps, TResources } from '../utils/GenericFieldComponent';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
type SkuFieldChildrenProps = TGenericChildrenProps<TResources['Sku']>;
|
|
5
|
+
type TCondition = ConditionalElement<Exclude<TResources['Sku'], 'resource'>>;
|
|
6
|
+
type Props = {
|
|
7
7
|
children?: (props: SkuFieldChildrenProps) => JSX.Element;
|
|
8
8
|
} & TCondition;
|
|
9
9
|
/**
|
|
@@ -1,14 +1,10 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
-
|
|
2
|
+
interface Props {
|
|
3
3
|
children: ReactNode;
|
|
4
|
+
/**
|
|
5
|
+
* ID of the SKU list.
|
|
6
|
+
*/
|
|
4
7
|
id: string;
|
|
5
|
-
};
|
|
6
|
-
export declare function SkuList(props: Props): JSX.Element;
|
|
7
|
-
export declare namespace SkuList {
|
|
8
|
-
var propTypes: {
|
|
9
|
-
children: import("prop-types").Validator<NonNullable<ReactNode | (() => JSX.Element)>>;
|
|
10
|
-
id: import("prop-types").Validator<string>;
|
|
11
|
-
};
|
|
12
|
-
var displayName: string;
|
|
13
8
|
}
|
|
9
|
+
export declare function SkuList(props: Props): JSX.Element;
|
|
14
10
|
export default SkuList;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.SkuList=void 0;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),react_1=require("react"),SkuListsContext_1=tslib_1.__importDefault(require("../../context/SkuListsContext"))
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.SkuList=void 0;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),react_1=require("react"),SkuListsContext_1=tslib_1.__importDefault(require("../../context/SkuListsContext"));function SkuList(props){const{id,children}=props,{listIds}=(0,react_1.useContext)(SkuListsContext_1.default);return(0,react_1.useEffect)(()=>{listIds&&!listIds.includes(id)&&listIds.push(id)},[]),(0,jsx_runtime_1.jsx)(jsx_runtime_1.Fragment,{children})}exports.SkuList=SkuList,exports.default=SkuList;
|
|
@@ -1,12 +1,6 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
-
|
|
2
|
+
interface Props {
|
|
3
3
|
children: ReactNode;
|
|
4
|
-
};
|
|
5
|
-
export declare function SkuListsContainer(props: Props): JSX.Element;
|
|
6
|
-
export declare namespace SkuListsContainer {
|
|
7
|
-
var propTypes: {
|
|
8
|
-
children: import("prop-types").Validator<NonNullable<ReactNode | (() => JSX.Element)>>;
|
|
9
|
-
};
|
|
10
|
-
var displayName: string;
|
|
11
4
|
}
|
|
5
|
+
export declare function SkuListsContainer(props: Props): JSX.Element;
|
|
12
6
|
export default SkuListsContainer;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.SkuListsContainer=void 0;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),react_1=require("react"),SkuListsContext_1=tslib_1.__importDefault(require("../../context/SkuListsContext")),CommerceLayerContext_1=tslib_1.__importDefault(require("../../context/CommerceLayerContext")),SkuListsReducer_1=tslib_1.__importStar(require("../../reducers/SkuListsReducer"))
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.SkuListsContainer=void 0;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),react_1=require("react"),SkuListsContext_1=tslib_1.__importDefault(require("../../context/SkuListsContext")),CommerceLayerContext_1=tslib_1.__importDefault(require("../../context/CommerceLayerContext")),SkuListsReducer_1=tslib_1.__importStar(require("../../reducers/SkuListsReducer"));function SkuListsContainer(props){const{children}=props,[state,dispatch]=(0,react_1.useReducer)(SkuListsReducer_1.default,SkuListsReducer_1.skuListsInitialState),config=(0,react_1.useContext)(CommerceLayerContext_1.default);return(0,react_1.useEffect)(()=>{state.listIds&&state.listIds.length>0&&config.accessToken&&(0,SkuListsReducer_1.getSkuList)({listIds:state.listIds,dispatch,config,state})},[config.accessToken]),(0,jsx_runtime_1.jsx)(SkuListsContext_1.default.Provider,{value:state,children})}exports.SkuListsContainer=SkuListsContainer,exports.default=SkuListsContainer;
|
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
-
|
|
2
|
+
interface Props {
|
|
3
3
|
children: ReactNode;
|
|
4
|
-
};
|
|
5
|
-
export declare function Skus<P extends Props>({ children }: P): JSX.Element;
|
|
6
|
-
export declare namespace Skus {
|
|
7
|
-
var propTypes: {
|
|
8
|
-
children: import("prop-types").Validator<NonNullable<ReactNode | (() => JSX.Element)>>;
|
|
9
|
-
};
|
|
10
4
|
}
|
|
5
|
+
export declare function Skus<P extends Props>({ children }: P): JSX.Element;
|
|
11
6
|
export default Skus;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.Skus=void 0;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.Skus=void 0;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),SkuChildrenContext_1=tslib_1.__importDefault(require("../../context/SkuChildrenContext")),SkuContext_1=tslib_1.__importDefault(require("../../context/SkuContext")),react_1=require("react");function Skus({children}){const{skus}=(0,react_1.useContext)(SkuContext_1.default),components=skus?.map((sku,key)=>{const value={sku};return(0,jsx_runtime_1.jsx)(SkuChildrenContext_1.default.Provider,{value,children},key)});return(0,jsx_runtime_1.jsx)(jsx_runtime_1.Fragment,{children:components})}exports.Skus=Skus,exports.default=Skus;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { ConditionalElement } from '../../typings/index';
|
|
3
3
|
import { TGenericChildrenProps, TResources } from '../utils/GenericFieldComponent';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
type StockTransferFieldChildrenProps = TGenericChildrenProps<TResources['StockTransfer']>;
|
|
5
|
+
type TCondition = ConditionalElement<Exclude<TResources['StockTransfer'], 'resource'>>;
|
|
6
|
+
type Props = {
|
|
7
7
|
children?: (props: StockTransferFieldChildrenProps) => JSX.Element;
|
|
8
8
|
} & TCondition;
|
|
9
9
|
export declare function StockTransferField<P extends Props>(props: P): JSX.Element;
|
|
@@ -9,8 +9,8 @@ export interface CustomerAddress extends Address {
|
|
|
9
9
|
onClick: () => void;
|
|
10
10
|
handleSelect?: () => void;
|
|
11
11
|
}
|
|
12
|
-
export
|
|
13
|
-
export
|
|
12
|
+
export type AddressCardsTemplateChildren = ChildrenFunction<TAddressCards>;
|
|
13
|
+
export type HandleSelect = (k: number, addressId: string, customerAddressId: string, disabled: boolean, address: Address) => Promise<void>;
|
|
14
14
|
interface Props {
|
|
15
15
|
customerAddresses: CustomerAddress[];
|
|
16
16
|
countryLock?: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FunctionComponent } from 'react';
|
|
2
|
-
|
|
2
|
+
type BaseFieldChildren = Omit<BaseFieldProps, 'children'>;
|
|
3
3
|
export interface BaseFieldProps extends Omit<JSX.IntrinsicElements['span'], 'children'> {
|
|
4
4
|
attribute: 'number' | 'id';
|
|
5
5
|
children?: (props: BaseFieldChildren) => JSX.Element;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { BaseInputComponentProps } from '../../typings/index';
|
|
3
|
-
export
|
|
4
|
-
declare const _default: React.ForwardRefExoticComponent<Pick<BaseInputProps, "children" | "form" | "slot" | "style" | "title" | "pattern" | "resource" | "id" | "value" | "placeholder" | "className" | "required" | "name" | "onChange" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "lang" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "
|
|
3
|
+
export type BaseInputProps = BaseInputComponentProps & Omit<JSX.IntrinsicElements['input'], 'children'> & Omit<JSX.IntrinsicElements['textarea'], 'children'>;
|
|
4
|
+
declare const _default: React.ForwardRefExoticComponent<Pick<BaseInputProps, "children" | "form" | "slot" | "style" | "title" | "pattern" | "resource" | "id" | "value" | "placeholder" | "className" | "required" | "name" | "onChange" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "lang" | "nonce" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onResize" | "onResizeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "height" | "max" | "min" | "type" | "width" | "crossOrigin" | "alt" | "src" | "autoFocus" | "disabled" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "autoComplete" | "accept" | "capture" | "checked" | "enterKeyHint" | "list" | "maxLength" | "minLength" | "multiple" | "readOnly" | "size" | "step" | "cols" | "dirName" | "rows" | "wrap"> & React.RefAttributes<any>>;
|
|
5
5
|
export default _default;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { PropsType } from '../../utils/PropsType';
|
|
3
3
|
import { baseOrderPricePropTypes } from '../../typings/index';
|
|
4
|
-
export
|
|
4
|
+
export type BaseOrderPriceProps = PropsType<typeof baseOrderPricePropTypes> & Omit<JSX.IntrinsicElements['span'], 'children'>;
|
|
5
5
|
export declare function BaseOrderPrice(props: BaseOrderPriceProps): JSX.Element;
|
|
6
6
|
export default BaseOrderPrice;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { BaseSelectComponentProps } from '../../typings/index';
|
|
3
|
-
export
|
|
3
|
+
export type BaseSelectProps = BaseSelectComponentProps;
|
|
4
4
|
declare const _default: React.ForwardRefExoticComponent<BaseSelectComponentProps & React.RefAttributes<any>>;
|
|
5
5
|
export default _default;
|
|
@@ -26,10 +26,10 @@ export interface TResources {
|
|
|
26
26
|
resource: 'parcelLineItem';
|
|
27
27
|
};
|
|
28
28
|
}
|
|
29
|
-
export
|
|
29
|
+
export type TResourceKey = {
|
|
30
30
|
[K in keyof TResources]: K;
|
|
31
31
|
};
|
|
32
|
-
export
|
|
32
|
+
export type TGenericChildrenProps<E extends TResources[keyof TResources]> = Omit<Props<E>, 'children' | 'attribute' | 'context' | 'tagElement'> & {
|
|
33
33
|
attributeValue: E[keyof E];
|
|
34
34
|
};
|
|
35
35
|
interface ResourceContext {
|
|
@@ -40,7 +40,7 @@ interface ResourceContext {
|
|
|
40
40
|
parcel: InitialParcelContext;
|
|
41
41
|
parcelLineItem: InitialParcelLineItemContext;
|
|
42
42
|
}
|
|
43
|
-
|
|
43
|
+
type GenericContext<K extends keyof ResourceContext> = Context<ResourceContext[K]>;
|
|
44
44
|
interface Props<E extends TResources[keyof TResources]> {
|
|
45
45
|
children?: (props: TGenericChildrenProps<E>) => JSX.Element;
|
|
46
46
|
resource: E['resource'];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Component, ForwardedRef } from 'react';
|
|
2
2
|
export interface ParentProps {
|
|
3
3
|
parentRef?: ForwardedRef<any>;
|
|
4
|
-
children?: typeof Component | ((P: any) => JSX.Element);
|
|
4
|
+
children?: typeof Component | ((P: any) => JSX.Element | null);
|
|
5
5
|
}
|
|
6
6
|
export default function Parent({ children, ...p }: ParentProps): JSX.Element | null;
|
|
@@ -2,18 +2,18 @@
|
|
|
2
2
|
import { PaymentResource, PaymentSourceType } from '../../reducers/PaymentMethodReducer';
|
|
3
3
|
import PaymentSourceContext, { IconBrand } from '../../context/PaymentSourceContext';
|
|
4
4
|
import { ChildrenFunction } from '../../typings/index';
|
|
5
|
-
|
|
5
|
+
type ChildrenProps = Pick<Props, 'customerPayments'> & {
|
|
6
6
|
PaymentSourceProvider: typeof PaymentSourceContext.Provider;
|
|
7
7
|
};
|
|
8
|
-
|
|
8
|
+
type CustomerPayment = PaymentSourceType & {
|
|
9
9
|
card?: {
|
|
10
10
|
brand?: IconBrand;
|
|
11
11
|
last4?: string;
|
|
12
12
|
};
|
|
13
13
|
handleClick?: () => void;
|
|
14
14
|
};
|
|
15
|
-
export
|
|
16
|
-
export
|
|
15
|
+
export type CustomerCardsTemplateChildren = ChildrenFunction<ChildrenProps>;
|
|
16
|
+
export type CustomerCardsType = ChildrenProps;
|
|
17
17
|
interface Props {
|
|
18
18
|
customerPayments: CustomerPayment[];
|
|
19
19
|
children: CustomerCardsTemplateChildren;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { LineItem } from '@commercelayer/sdk';
|
|
3
3
|
import { BaseError, ResourceErrorType } from '../../typings/errors';
|
|
4
|
-
export
|
|
4
|
+
export type AllErrorsParams = {
|
|
5
5
|
allErrors: BaseError[];
|
|
6
6
|
messages: BaseError[];
|
|
7
7
|
field?: string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { AddressState, SetAddress, AddressResource } from '../reducers/AddressReducer';
|
|
3
3
|
import { BaseError } from '../typings/errors';
|
|
4
|
-
|
|
4
|
+
type DefaultContext = {
|
|
5
5
|
saveAddresses: () => void;
|
|
6
6
|
setCloneAddress: (id: string, resource: AddressResource) => void;
|
|
7
7
|
setAddress: SetAddress;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { Address } from '@commercelayer/sdk';
|
|
3
|
-
export
|
|
3
|
+
export type AddressValuesKeys = `${keyof Address}` | `billing_address_${keyof Address}` | `shipping_address_${keyof Address}`;
|
|
4
4
|
export interface DefaultContextAddress {
|
|
5
5
|
validation?: void;
|
|
6
6
|
setValue?: (name: AddressValuesKeys, value: string | number | readonly string[]) => void;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { AddressCountrySelectName, AddressInputName } from '../typings/index';
|
|
3
3
|
import { AddressField } from '../reducers/AddressReducer';
|
|
4
|
-
export
|
|
4
|
+
export type DefaultContextAddress = {
|
|
5
5
|
validation?: void;
|
|
6
6
|
setValue?: (name: AddressField | AddressInputName | AddressCountrySelectName, value: any) => void;
|
|
7
7
|
errors?: {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { SetCustomerErrors, deleteCustomerAddress, CustomerState, GetCustomerAddresses, getCustomerPaymentSources, setCustomerEmail, TCustomerAddress } from '../reducers/CustomerReducer';
|
|
3
|
-
export
|
|
3
|
+
export type InitialCustomerContext = Partial<{
|
|
4
4
|
saveCustomerUser: (customerEmail: string) => Promise<void>;
|
|
5
5
|
setCustomerErrors: SetCustomerErrors;
|
|
6
6
|
setCustomerEmail: typeof setCustomerEmail;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { LineItem } from '@commercelayer/sdk';
|
|
3
|
-
export
|
|
3
|
+
export type InitialLineItemContext = Partial<{
|
|
4
4
|
lineItem: LineItem;
|
|
5
5
|
}>;
|
|
6
6
|
declare const LineItemChildrenContext: import("react").Context<Partial<{
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { Row } from 'react-table';
|
|
3
|
+
export interface OrderListPaginationContext {
|
|
4
|
+
canNextPage: boolean;
|
|
5
|
+
canPreviousPage: boolean;
|
|
6
|
+
gotoPage: (page: number) => void;
|
|
7
|
+
nextPage: () => void;
|
|
8
|
+
page: Row[];
|
|
9
|
+
pageCount: number;
|
|
10
|
+
pageIndex: number;
|
|
11
|
+
pageNumber: number;
|
|
12
|
+
pageOptions: number[];
|
|
13
|
+
pageSize: number;
|
|
14
|
+
previousPage: () => void;
|
|
15
|
+
setPageSize: (pageCount: number) => void;
|
|
16
|
+
totalRows: number;
|
|
17
|
+
}
|
|
18
|
+
declare const ctx: import("react").Context<OrderListPaginationContext | null>;
|
|
19
|
+
export default ctx;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const react_1=require("react"),ctx=(0,react_1.createContext)(null);exports.default=ctx;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { UpdatePaymentSource, PaymentMethodState, SetPaymentMethodErrors, SetPaymentSource, SetPaymentMethod, DestroyPaymentSource, SetPaymentRef, setLoading } from '../reducers/PaymentMethodReducer';
|
|
3
|
-
|
|
3
|
+
type DefaultContext = {
|
|
4
4
|
setPaymentMethodErrors: SetPaymentMethodErrors;
|
|
5
5
|
setPaymentMethod: SetPaymentMethod;
|
|
6
6
|
setPaymentSource: SetPaymentSource;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
export
|
|
3
|
-
|
|
2
|
+
export type IconBrand = 'visa' | 'credit-card' | 'amex' | 'mastercard' | 'jcb' | 'wire-transfer' | 'maestro' | 'cirrus' | 'paypal';
|
|
3
|
+
type DefaultContext = {
|
|
4
4
|
brand?: IconBrand | string;
|
|
5
5
|
exp_month?: number | string;
|
|
6
6
|
exp_year?: number | string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { RefObject } from 'react';
|
|
2
2
|
import { PlaceOrderOptions, PlaceOrderState, SetPlaceOrderErrors } from '../reducers/PlaceOrderReducer';
|
|
3
3
|
import { PaymentSourceType } from '../reducers/PaymentMethodReducer';
|
|
4
|
-
|
|
4
|
+
type DefaultContext = {
|
|
5
5
|
setPlaceOrderErrors?: SetPlaceOrderErrors;
|
|
6
6
|
setPlaceOrder?: ({ paymentSource, }: {
|
|
7
7
|
paymentSource?: PaymentSourceType;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { ShipmentState, SetShipmentErrors } from '../reducers/ShipmentReducer';
|
|
3
|
-
|
|
3
|
+
type DefaultContext = {
|
|
4
4
|
setShipmentErrors: SetShipmentErrors;
|
|
5
5
|
setShippingMethod: (shipmentId: string, shippingMethodId: string) => Promise<void>;
|
|
6
6
|
} & ShipmentState;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { ShippingAddressState } from '../reducers/ShippingAddressReducer';
|
|
3
|
-
|
|
3
|
+
type DefaultContext = {
|
|
4
4
|
setShippingAddress?: (id: string, options?: {
|
|
5
5
|
customerAddressId: string;
|
|
6
6
|
}) => Promise<void>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { SkuState } from '../reducers/SkuReducer';
|
|
3
|
-
export
|
|
3
|
+
export type SkuContextValue = SkuState;
|
|
4
4
|
declare const SkuContext: import("react").Context<Partial<{
|
|
5
5
|
skus: import("@commercelayer/sdk/lib/cjs/resources/skus").Sku[];
|
|
6
6
|
loading: boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.useOrderContainer=void 0;const tslib_1=require("tslib"),OrderContext_1=tslib_1.__importDefault(require("../context/OrderContext")),react_1=require("react");function useOrderContainer(){const ctx=(0,react_1.useContext)(OrderContext_1.default);if("order"in ctx)return{order:ctx.order,reloadOrder:async()=>{if(ctx?.order?.id)return await ctx?.getOrder(ctx?.order?.id)}};throw new Error("Cannot use `useOrderContainer` outside of <OrderContainer/>")}exports.useOrderContainer=useOrderContainer,exports.default=useOrderContainer;
|
package/lib/cjs/index.d.ts
CHANGED