@dropins/storefront-order 0.1.0-alpha9 → 1.0.0-beta2
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/api/cancelOrder/cancelOrder.d.ts +2 -0
- package/api/cancelOrder/graphql/cancelOrderMutation.d.ts +2 -0
- package/api/cancelOrder/index.d.ts +2 -0
- package/api/confirmCancelOrder/confirmCancelOrder.d.ts +16 -0
- package/api/confirmCancelOrder/graphql/ConfirmCancelOrder.d.ts +16 -0
- package/api/confirmCancelOrder/index.d.ts +16 -0
- package/api/confirmGuestReturn/confirmGuestReturn.d.ts +2 -0
- package/api/confirmGuestReturn/graphql/confirmGuestReturn.graphql.d.ts +2 -0
- package/api/confirmGuestReturn/index.d.ts +2 -0
- package/api/fragments.d.ts +7 -0
- package/api/getAttributesForm/graphql/getAttributesForm.graphql.d.ts +1 -1
- package/api/getAttributesList/getAttributesList.d.ts +5 -0
- package/api/getAttributesList/graphql/getAttributesList.graphql.d.ts +2 -0
- package/api/getAttributesList/index.d.ts +2 -0
- package/api/getCustomer/graphql/getCustomer.graphql.d.ts +1 -1
- package/api/getCustomerOrdersReturn/getCustomerOrdersReturn.d.ts +4 -0
- package/api/getCustomerOrdersReturn/graphql/getCustomerOrdersReturn.graphql.d.ts +2 -0
- package/api/getCustomerOrdersReturn/index.d.ts +2 -0
- package/api/getGuestOrder/getGuestOrder.d.ts +1 -1
- package/api/getGuestOrder/graphql/getGuestOrder.graphql.d.ts +0 -1
- package/api/getGuestOrder/graphql/index.d.ts +2 -0
- package/api/getOrderDetailsById/getOrderDetailsById.d.ts +2 -1
- package/api/getStoreConfig/getStoreConfig.d.ts +4 -0
- package/api/getStoreConfig/graphql/StoreConfigQuery.d.ts +2 -0
- package/api/getStoreConfig/index.d.ts +2 -0
- package/api/graphql/CustomerAddressFragment.graphql.d.ts +2 -0
- package/api/graphql/GurestOrderFragment.graphql.d.ts +2 -0
- package/api/graphql/OrderItemsFragment.graphql.d.ts +6 -0
- package/api/graphql/OrderSummaryFragment.graphql.d.ts +2 -0
- package/api/graphql/RequestReturnOrderFragment.graphql.d.ts +2 -0
- package/api/graphql/ReturnsFragment.graphql.d.ts +2 -0
- package/api/guestOrderByToken/guestOrderByToken.d.ts +1 -1
- package/api/index.d.ts +15 -4
- package/api/initialize/initialize.d.ts +7 -1
- package/api/placeOrder/graphql/placeOrderMutation.d.ts +2 -0
- package/api/placeOrder/index.d.ts +2 -0
- package/api/placeOrder/placeOrder.d.ts +4 -0
- package/api/reorderItems/graphql/reorderItems.graphql.d.ts +2 -0
- package/api/reorderItems/index.d.ts +2 -0
- package/api/reorderItems/reorderItems.d.ts +4 -0
- package/api/requestGuestOrderCancel/graphql/requestGuestOrderCancelMutation.d.ts +2 -0
- package/api/requestGuestOrderCancel/index.d.ts +2 -0
- package/api/requestGuestOrderCancel/requestGuestOrderCancel.d.ts +2 -0
- package/api/requestGuestReturn/graphql/requestGuestReturn.graphql.d.ts +2 -0
- package/api/requestGuestReturn/index.d.ts +2 -0
- package/api/requestGuestReturn/requestGuestReturn.d.ts +9 -0
- package/api/requestReturn/graphql/requestReturn.graphql.d.ts +2 -0
- package/api/requestReturn/index.d.ts +2 -0
- package/api/requestReturn/requestReturn.d.ts +5 -0
- package/api.js +56 -129
- package/chunks/CartSummaryItem.js +3 -0
- package/chunks/OrderCancelForm.js +3 -0
- package/chunks/OrderLoaders.js +3 -1
- package/chunks/ReturnsListContent.js +3 -0
- package/chunks/{CustomerDetailsContent.js → ShippingStatusCard.js} +3 -1
- package/chunks/capitalizeFirst.js +3 -0
- package/chunks/confirmCancelOrder.js +56 -0
- package/chunks/fetch-graphql.js +3 -1
- package/chunks/formatDateToLocale.js +3 -0
- package/chunks/getAttributesForm.js +6 -4
- package/chunks/getCustomerOrdersReturn.js +21 -0
- package/chunks/getFormValues.js +3 -0
- package/chunks/getGuestOrder.js +18 -0
- package/chunks/getQueryParam.js +3 -0
- package/chunks/getStoreConfig.js +19 -0
- package/chunks/initialize.js +212 -0
- package/chunks/network-error.js +3 -0
- package/chunks/redirectTo.js +3 -0
- package/chunks/requestGuestOrderCancel.js +102 -0
- package/chunks/requestGuestReturn.js +54 -0
- package/chunks/returnOrdersHelper.js +3 -0
- package/chunks/setTaxStatus.js +3 -0
- package/chunks/transform-attributes-form.js +3 -0
- package/chunks/useGetStoreConfig.js +3 -0
- package/chunks/useIsMobile.js +3 -0
- package/components/EmptyList/EmptyList.d.ts +5 -0
- package/components/EmptyList/index.d.ts +3 -0
- package/components/OrderCancel/OrderCancel.d.ts +5 -0
- package/components/OrderCancel/index.d.ts +3 -0
- package/components/OrderCostSummaryContent/Blocks.d.ts +39 -0
- package/components/OrderCostSummaryContent/OrderCostSummaryContent.d.ts +5 -0
- package/components/OrderCostSummaryContent/index.d.ts +3 -0
- package/components/OrderHeader/OrderHeader.d.ts +9 -0
- package/components/OrderHeader/index.d.ts +2 -0
- package/components/OrderLoaders/OrderLoaders.d.ts +3 -0
- package/components/OrderProductListContent/CartSummaryItem.d.ts +5 -0
- package/components/OrderProductListContent/OrderProductListContent.d.ts +5 -0
- package/components/OrderProductListContent/index.d.ts +4 -0
- package/components/Reorder/Reorder.d.ts +5 -0
- package/components/Reorder/index.d.ts +3 -0
- package/components/ReturnOrderMessage/ReturnOrderMessage.d.ts +5 -0
- package/components/ReturnOrderMessage/index.d.ts +3 -0
- package/components/ReturnOrderProductList/ReturnOrderProductList.d.ts +5 -0
- package/components/ReturnOrderProductList/index.d.ts +3 -0
- package/components/ReturnReasonForm/ReturnReasonForm.d.ts +5 -0
- package/components/ReturnReasonForm/index.d.ts +3 -0
- package/components/ReturnsListContent/ReturnsListContent.d.ts +5 -0
- package/components/ReturnsListContent/index.d.ts +3 -0
- package/components/ShippingStatusCard/ShippingStatusCard.d.ts +1 -1
- package/components/ShippingStatusCard/ShippingStatusReturnCard.d.ts +5 -0
- package/components/ShippingStatusCard/index.d.ts +1 -0
- package/components/index.d.ts +14 -4
- package/configs/mock.config.d.ts +2823 -19
- package/containers/CreateReturn/CreateReturn.d.ts +5 -0
- package/containers/CreateReturn/index.d.ts +3 -0
- package/containers/CreateReturn.d.ts +3 -0
- package/containers/CreateReturn.js +3 -0
- package/containers/CustomerDetails.js +3 -1
- package/containers/OrderCancelForm/OrderCancelForm.d.ts +5 -0
- package/containers/OrderCancelForm/index.d.ts +3 -0
- package/containers/OrderCancelForm.d.ts +3 -0
- package/containers/OrderCancelForm.js +3 -0
- package/containers/OrderCostSummary/OrderCostSummary.d.ts +5 -0
- package/containers/OrderCostSummary/index.d.ts +3 -0
- package/containers/OrderCostSummary.d.ts +3 -0
- package/containers/OrderCostSummary.js +3 -0
- package/containers/OrderHeader/OrderHeader.d.ts +5 -0
- package/containers/OrderHeader/index.d.ts +3 -0
- package/containers/OrderHeader.d.ts +3 -0
- package/containers/OrderHeader.js +3 -0
- package/containers/OrderProductList/OrderProductList.d.ts +5 -0
- package/containers/OrderProductList/index.d.ts +3 -0
- package/containers/OrderProductList.d.ts +3 -0
- package/containers/OrderProductList.js +3 -0
- package/containers/OrderReturns/OrderReturns.d.ts +5 -0
- package/containers/OrderReturns/index.d.ts +3 -0
- package/containers/OrderReturns.d.ts +3 -0
- package/containers/OrderReturns.js +3 -0
- package/containers/OrderSearch.js +3 -1
- package/containers/OrderStatus.js +3 -1
- package/containers/ReturnsList/ReturnsList.d.ts +5 -0
- package/containers/ReturnsList/index.d.ts +3 -0
- package/containers/ReturnsList.d.ts +3 -0
- package/containers/ReturnsList.js +3 -0
- package/containers/ShippingStatus.js +3 -1
- package/containers/index.d.ts +8 -1
- package/data/models/acdl.d.ts +99 -0
- package/data/models/attributes-form.d.ts +2 -21
- package/data/models/customer-orders-return.d.ts +38 -0
- package/data/models/index.d.ts +5 -1
- package/data/models/order-details.d.ts +64 -9
- package/data/models/request-return.d.ts +7 -0
- package/data/models/store-config.d.ts +15 -0
- package/data/transforms/index.d.ts +8 -2
- package/data/transforms/transform-acdl.d.ts +5 -0
- package/data/transforms/transform-attributes-form.d.ts +3 -2
- package/data/transforms/transform-customer-address-input.d.ts +22 -0
- package/data/transforms/transform-customer-orders-returns.d.ts +5 -0
- package/data/transforms/transform-guest-order.d.ts +2 -2
- package/data/transforms/transform-order-details.d.ts +13 -3
- package/data/transforms/transform-place-order.d.ts +5 -0
- package/data/transforms/transform-request-return.d.ts +5 -0
- package/data/transforms/transform-store-config.d.ts +4 -0
- package/fragments.d.ts +1 -0
- package/fragments.js +306 -0
- package/hooks/api/useGetStoreConfig.d.ts +4 -0
- package/hooks/containers/useCreateReturn.d.ts +65 -0
- package/hooks/containers/useCustomerDetails.d.ts +2 -2
- package/hooks/containers/useOrderActions.d.ts +12 -0
- package/hooks/containers/useOrderCostSummary.d.ts +9 -0
- package/hooks/containers/useOrderHeader.d.ts +8 -0
- package/hooks/containers/useOrderProductList.d.ts +8 -0
- package/hooks/containers/useOrderReturns.d.ts +8 -0
- package/hooks/containers/useReturnsList.d.ts +15 -0
- package/hooks/containers/useShippingStatus.d.ts +2 -0
- package/hooks/index.d.ts +10 -1
- package/hooks/useInLineAlert.d.ts +7 -0
- package/hooks/useIsMobile.d.ts +2 -0
- package/i18n/en_US.json.d.ts +268 -13
- package/lib/acdl.d.ts +18 -0
- package/lib/capitalizeFirst.d.ts +2 -0
- package/lib/categorizeProducts.d.ts +66 -0
- package/lib/formatDateToLocale.d.ts +31 -0
- package/lib/getQueryParam.d.ts +1 -1
- package/lib/redirectTo.d.ts +1 -1
- package/lib/removeQueryParams.d.ts +2 -0
- package/lib/returnOrdersHelper.d.ts +36 -0
- package/lib/setTaxStatus.d.ts +4 -0
- package/package.json +1 -1
- package/render.js +5 -2
- package/types/api/confirmGuestReturn.types.d.ts +18 -0
- package/types/api/getAttributesList.types.d.ts +28 -0
- package/types/api/getCustomerOrdersReturn.types.d.ts +21 -0
- package/types/api/getOrderDetails.types.d.ts +69 -11
- package/types/api/placeOrder.types.d.ts +19 -0
- package/types/api/reorderItems.types.d.ts +27 -0
- package/types/api/requestReturn.types.d.ts +47 -0
- package/types/createReturn.types.d.ts +71 -0
- package/types/customerDetails.types.d.ts +10 -3
- package/types/emptyList.types.d.ts +7 -0
- package/types/form.types.d.ts +1 -1
- package/types/index.d.ts +21 -5
- package/types/notification.types.d.ts +14 -0
- package/types/orderCancel.types.d.ts +16 -0
- package/types/orderCostSummary.types.d.ts +29 -0
- package/types/orderEmailActionHandler.types.d.ts +4 -0
- package/types/orderHeader.types.d.ts +19 -0
- package/types/orderProductList.types.d.ts +36 -0
- package/types/orderStatus.types.d.ts +12 -4
- package/types/reorder.types.d.ts +9 -0
- package/types/returnsList.types.d.ts +82 -0
- package/types/shippingStatus.types.d.ts +33 -2
- package/api/getOrderDetailsById/graphql/customerAddressFragment.graphql.d.ts +0 -2
- package/api/getOrderDetailsById/graphql/index.d.ts +0 -5
- package/api/getOrderDetailsById/graphql/orderItemsFragment.graphql.d.ts +0 -2
- package/api/getOrderDetailsById/graphql/orderSummaryFragment.graphql.d.ts +0 -2
- package/chunks/getCustomer.js +0 -185
- package/lib/convertToInputDateFormat.d.ts +0 -3
- package/lib/formatAddressFields.d.ts +0 -6
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/********************************************************************
|
|
2
|
+
*
|
|
3
|
+
* Copyright 2024 Adobe
|
|
4
|
+
* All Rights Reserved.
|
|
5
|
+
*
|
|
6
|
+
* NOTICE: All information contained herein is, and remains
|
|
7
|
+
* the property of Adobe and its suppliers, if any. The intellectual
|
|
8
|
+
* and technical concepts contained herein are proprietary to Adobe
|
|
9
|
+
* and its suppliers and are protected by all applicable intellectual
|
|
10
|
+
* property laws, including trade secret and copyright laws.
|
|
11
|
+
* Dissemination of this information or reproduction of this material
|
|
12
|
+
* is strictly forbidden unless prior written permission is obtained
|
|
13
|
+
* from Adobe.
|
|
14
|
+
*******************************************************************/
|
|
15
|
+
export declare const confirmCancelOrder: (orderId: string, confirmationKey: string) => Promise<any>;
|
|
16
|
+
//# sourceMappingURL=confirmCancelOrder.d.ts.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/********************************************************************
|
|
2
|
+
*
|
|
3
|
+
* Copyright 2024 Adobe
|
|
4
|
+
* All Rights Reserved.
|
|
5
|
+
*
|
|
6
|
+
* NOTICE: All information contained herein is, and remains
|
|
7
|
+
* the property of Adobe and its suppliers, if any. The intellectual
|
|
8
|
+
* and technical concepts contained herein are proprietary to Adobe
|
|
9
|
+
* and its suppliers and are protected by all applicable intellectual
|
|
10
|
+
* property laws, including trade secret and copyright laws.
|
|
11
|
+
* Dissemination of this information or reproduction of this material
|
|
12
|
+
* is strictly forbidden unless prior written permission is obtained
|
|
13
|
+
* from Adobe.
|
|
14
|
+
*******************************************************************/
|
|
15
|
+
export declare const CONFIRM_CANCEL_ORDER_MUTATION: string;
|
|
16
|
+
//# sourceMappingURL=ConfirmCancelOrder.d.ts.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/********************************************************************
|
|
2
|
+
*
|
|
3
|
+
* Copyright 2024 Adobe
|
|
4
|
+
* All Rights Reserved.
|
|
5
|
+
*
|
|
6
|
+
* NOTICE: All information contained herein is, and remains
|
|
7
|
+
* the property of Adobe and its suppliers, if any. The intellectual
|
|
8
|
+
* and technical concepts contained herein are proprietary to Adobe
|
|
9
|
+
* and its suppliers and are protected by all applicable intellectual
|
|
10
|
+
* property laws, including trade secret and copyright laws.
|
|
11
|
+
* Dissemination of this information or reproduction of this material
|
|
12
|
+
* is strictly forbidden unless prior written permission is obtained
|
|
13
|
+
* from Adobe.
|
|
14
|
+
*******************************************************************/
|
|
15
|
+
export * from './confirmCancelOrder';
|
|
16
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { REQUEST_RETURN_ORDER_FRAGMENT } from './graphql/RequestReturnOrderFragment.graphql';
|
|
2
|
+
export { ADDRESS_FRAGMENT } from './graphql/CustomerAddressFragment.graphql';
|
|
3
|
+
export { PRODUCT_DETAILS_FRAGMENT, PRICE_DETAILS_FRAGMENT, GIFT_CARD_DETAILS_FRAGMENT, ORDER_ITEM_DETAILS_FRAGMENT, BUNDLE_ORDER_ITEM_DETAILS_FRAGMENT, } from './graphql/OrderItemsFragment.graphql';
|
|
4
|
+
export { ORDER_SUMMARY_FRAGMENT } from './graphql/OrderSummaryFragment.graphql';
|
|
5
|
+
export { RETURNS_FRAGMENT } from './graphql/ReturnsFragment.graphql';
|
|
6
|
+
export { GUEST_ORDER_FRAGMENT } from './graphql/GurestOrderFragment.graphql';
|
|
7
|
+
//# sourceMappingURL=fragments.d.ts.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export declare const GET_ATTRIBUTES_FORM = "\n query GET_ATTRIBUTES_FORM($formCode: String!) {\n attributesForm(formCode: $formCode) {\n items {\n code\n default_value\n entity_type\n frontend_class\n frontend_input\n is_required\n is_unique\n label\n options {\n is_default\n label\n value\n }\n ... on CustomerAttributeMetadata {\n multiline_count\n sort_order\n validate_rules {\n name\n value\n }\n }\n }\n errors {\n type\n message\n }\n }\n }\n";
|
|
2
|
-
export declare const GET_ATTRIBUTES_FORM_SHORT = "\n query GET_ATTRIBUTES_FORM_SHORT {\n
|
|
2
|
+
export declare const GET_ATTRIBUTES_FORM_SHORT = "\n query GET_ATTRIBUTES_FORM_SHORT {\n attributesForm(formCode: \"customer_register_address\") {\n items {\n frontend_input\n label\n code\n ... on CustomerAttributeMetadata {\n multiline_count\n sort_order\n }\n }\n }\n }\n";
|
|
3
3
|
//# sourceMappingURL=getAttributesForm.graphql.d.ts.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export declare const GET_ATTRIBUTES_LIST = "\n query GET_ATTRIBUTES_LIST($entityType: AttributeEntityTypeEnum!) {\n attributesList(entityType: $entityType) {\n items {\n ... on CustomerAttributeMetadata {\n multiline_count\n sort_order\n validate_rules {\n name\n value\n }\n }\n ... on ReturnItemAttributeMetadata {\n sort_order\n }\n code\n label\n default_value\n frontend_input\n is_unique\n is_required\n options {\n is_default\n label\n value\n }\n }\n errors {\n type\n message\n }\n }\n }\n";
|
|
2
|
+
//# sourceMappingURL=getAttributesList.graphql.d.ts.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const GET_CUSTOMER = "\n query GET_CUSTOMER {\n customer {\n
|
|
1
|
+
export declare const GET_CUSTOMER = "\n query GET_CUSTOMER {\n customer {\n firstname\n lastname\n email\n }\n }\n";
|
|
2
2
|
//# sourceMappingURL=getCustomer.graphql.d.ts.map
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
+
import { GetOrderDetailsByIdProps } from '../../types';
|
|
1
2
|
import { TransformedData } from '../../data/models';
|
|
2
3
|
|
|
3
|
-
export declare const getOrderDetailsById: <T extends "orderData">(orderId
|
|
4
|
+
export declare const getOrderDetailsById: <T extends "orderData">({ orderId, returnRef, queryType, returnsPageSize, }: GetOrderDetailsByIdProps) => Promise<TransformedData<T>>;
|
|
4
5
|
//# sourceMappingURL=getOrderDetailsById.d.ts.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export declare const STORE_CONFIG_QUERY = "\n query STORE_CONFIG_QUERY {\n storeConfig {\n order_cancellation_enabled\n order_cancellation_reasons {\n description\n }\n base_media_url\n orders_invoices_credit_memos_display_price\n orders_invoices_credit_memos_display_shipping_amount\n orders_invoices_credit_memos_display_subtotal\n orders_invoices_credit_memos_display_grandtotal\n orders_invoices_credit_memos_display_full_summary\n orders_invoices_credit_memos_display_zero_tax\n }\n }\n";
|
|
2
|
+
//# sourceMappingURL=StoreConfigQuery.d.ts.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export declare const ADDRESS_FRAGMENT = "\n fragment ADDRESS_FRAGMENT on OrderAddress {\n city\n company\n country_code\n fax\n firstname\n lastname\n middlename\n postcode\n prefix\n region\n region_id\n street\n suffix\n telephone\n vat_id\n }\n";
|
|
2
|
+
//# sourceMappingURL=CustomerAddressFragment.graphql.d.ts.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const PRODUCT_DETAILS_FRAGMENT = "\n fragment PRODUCT_DETAILS_FRAGMENT on ProductInterface {\n __typename\n canonical_url\n url_key\n uid\n name\n sku\n only_x_left_in_stock\n stock_status\n thumbnail {\n label\n url\n }\n price_range {\n maximum_price {\n regular_price {\n currency\n value\n }\n }\n }\n }\n";
|
|
2
|
+
export declare const PRICE_DETAILS_FRAGMENT = "\n fragment PRICE_DETAILS_FRAGMENT on OrderItemInterface {\n prices {\n price_including_tax {\n value\n currency\n }\n original_price {\n value\n currency\n }\n original_price_including_tax {\n value\n currency\n }\n price {\n value\n currency\n }\n }\n }\n";
|
|
3
|
+
export declare const GIFT_CARD_DETAILS_FRAGMENT = "\n fragment GIFT_CARD_DETAILS_FRAGMENT on GiftCardOrderItem {\n ...PRICE_DETAILS_FRAGMENT\n gift_message {\n message\n }\n gift_card {\n recipient_name\n recipient_email\n sender_name\n sender_email\n message\n }\n }\n";
|
|
4
|
+
export declare const ORDER_ITEM_DETAILS_FRAGMENT = "\n fragment ORDER_ITEM_DETAILS_FRAGMENT on OrderItemInterface {\n __typename\n status\n product_sku\n eligible_for_return\n product_name\n product_url_key\n id\n quantity_ordered\n quantity_shipped\n quantity_canceled\n quantity_invoiced\n quantity_refunded\n quantity_return_requested\n product_sale_price {\n value\n currency\n }\n selected_options {\n label\n value\n }\n product {\n ...PRODUCT_DETAILS_FRAGMENT\n }\n ...PRICE_DETAILS_FRAGMENT\n }\n";
|
|
5
|
+
export declare const BUNDLE_ORDER_ITEM_DETAILS_FRAGMENT = "\n fragment BUNDLE_ORDER_ITEM_DETAILS_FRAGMENT on BundleOrderItem {\n ...PRICE_DETAILS_FRAGMENT\n bundle_options {\n uid\n label\n values {\n uid\n product_name\n }\n }\n }\n";
|
|
6
|
+
//# sourceMappingURL=OrderItemsFragment.graphql.d.ts.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export declare const ORDER_SUMMARY_FRAGMENT = "\n fragment ORDER_SUMMARY_FRAGMENT on OrderTotal {\n grand_total {\n value\n currency\n }\n total_giftcard {\n currency\n value\n }\n subtotal_excl_tax {\n currency\n value\n }\n subtotal_incl_tax {\n currency\n value\n }\n taxes {\n amount {\n currency\n value\n }\n rate\n title\n }\n total_tax {\n currency\n value\n }\n total_shipping {\n currency\n value\n }\n discounts {\n amount {\n currency\n value\n }\n label\n }\n }\n";
|
|
2
|
+
//# sourceMappingURL=OrderSummaryFragment.graphql.d.ts.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export declare const RETURNS_FRAGMENT = "\n fragment RETURNS_FRAGMENT on Returns {\n __typename\n items {\n number\n status\n created_at\n shipping {\n tracking {\n status {\n text\n type\n }\n carrier {\n uid\n label\n }\n tracking_number\n }\n }\n order {\n number\n token\n }\n items {\n uid\n quantity\n status\n request_quantity\n order_item {\n ...ORDER_ITEM_DETAILS_FRAGMENT\n ... on GiftCardOrderItem {\n ...GIFT_CARD_DETAILS_FRAGMENT\n product {\n ...PRODUCT_DETAILS_FRAGMENT\n }\n }\n }\n }\n }\n }\n";
|
|
2
|
+
//# sourceMappingURL=ReturnsFragment.graphql.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { OrderDataModel } from '../../data/models';
|
|
2
2
|
|
|
3
|
-
export declare const guestOrderByToken: (token?: string) => Promise<OrderDataModel | null>;
|
|
3
|
+
export declare const guestOrderByToken: (token?: string, returnRef?: string) => Promise<OrderDataModel | null>;
|
|
4
4
|
//# sourceMappingURL=guestOrderByToken.d.ts.map
|
package/api/index.d.ts
CHANGED
|
@@ -1,8 +1,19 @@
|
|
|
1
|
-
export * from './
|
|
1
|
+
export * from './cancelOrder';
|
|
2
2
|
export * from './fetch-graphql';
|
|
3
|
-
export * from './getOrderDetailsById';
|
|
4
|
-
export * from './getGuestOrder';
|
|
5
|
-
export * from './guestOrderByToken';
|
|
6
3
|
export * from './getAttributesForm';
|
|
4
|
+
export * from './getAttributesList';
|
|
7
5
|
export * from './getCustomer';
|
|
6
|
+
export * from './getCustomerOrdersReturn';
|
|
7
|
+
export * from './getGuestOrder';
|
|
8
|
+
export * from './getOrderDetailsById';
|
|
9
|
+
export * from './getStoreConfig';
|
|
10
|
+
export * from './guestOrderByToken';
|
|
11
|
+
export * from './initialize';
|
|
12
|
+
export * from './placeOrder';
|
|
13
|
+
export * from './reorderItems';
|
|
14
|
+
export * from './requestGuestOrderCancel';
|
|
15
|
+
export * from './requestReturn';
|
|
16
|
+
export * from './requestGuestReturn';
|
|
17
|
+
export * from './confirmGuestReturn';
|
|
18
|
+
export * from './confirmCancelOrder';
|
|
8
19
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,8 +1,14 @@
|
|
|
1
|
-
import { Initializer } from '@dropins/tools/types/elsie/src/lib';
|
|
1
|
+
import { Initializer, Model } from '@dropins/tools/types/elsie/src/lib';
|
|
2
2
|
import { Lang } from '@dropins/tools/types/elsie/src/i18n';
|
|
3
|
+
import { CustomerOrdersReturnModel, OrderDataModel, RequestReturnModel } from '../../data/models';
|
|
3
4
|
|
|
4
5
|
type ConfigProps = {
|
|
5
6
|
langDefinitions?: Lang;
|
|
7
|
+
models?: {
|
|
8
|
+
OrderDataModel?: Model<OrderDataModel>;
|
|
9
|
+
CustomerOrdersReturnModel?: Model<CustomerOrdersReturnModel>;
|
|
10
|
+
RequestReturnModel?: Model<RequestReturnModel>;
|
|
11
|
+
};
|
|
6
12
|
};
|
|
7
13
|
export declare const initialize: Initializer<ConfigProps>;
|
|
8
14
|
export declare const config: import('@dropins/tools/types/elsie/src/lib').Config<ConfigProps>;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export declare const REORDER_ITEMS_MUTATION = "\n mutation REORDER_ITEMS_MUTATION($orderNumber: String!) {\n reorderItems(orderNumber: $orderNumber) {\n cart {\n itemsV2 {\n items {\n uid\n }\n }\n }\n userInputErrors {\n code\n message\n path\n }\n }\n }\n";
|
|
2
|
+
//# sourceMappingURL=reorderItems.graphql.d.ts.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { RequestGuestReturnProps } from '../../types';
|
|
2
|
+
|
|
3
|
+
export declare const requestGuestReturn: (form: RequestGuestReturnProps) => Promise<{
|
|
4
|
+
uid: string;
|
|
5
|
+
number: string;
|
|
6
|
+
status: string;
|
|
7
|
+
createdAt: string;
|
|
8
|
+
}>;
|
|
9
|
+
//# sourceMappingURL=requestGuestReturn.d.ts.map
|
package/api.js
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
/*! Copyright 2024 Adobe
|
|
2
|
+
All Rights Reserved. */
|
|
3
|
+
import{c as H,r as q}from"./chunks/requestGuestOrderCancel.js";import{f as E,h as _}from"./chunks/fetch-graphql.js";import{g as V,r as Y,s as z,a as j,b as J}from"./chunks/fetch-graphql.js";import{g as W}from"./chunks/getAttributesForm.js";import{g as ee,a as te,r as re}from"./chunks/requestGuestReturn.js";import{g as oe,a as ne}from"./chunks/getGuestOrder.js";import{g as ie}from"./chunks/getCustomerOrdersReturn.js";import{a as T}from"./chunks/initialize.js";import{c as ce,g as ue,b as de,i as le}from"./chunks/initialize.js";import{g as Ee}from"./chunks/getStoreConfig.js";import{h as R}from"./chunks/network-error.js";import{events as u}from"@dropins/tools/event-bus.js";import{PRODUCT_DETAILS_FRAGMENT as D,PRICE_DETAILS_FRAGMENT as A,GIFT_CARD_DETAILS_FRAGMENT as g,ORDER_ITEM_DETAILS_FRAGMENT as O,BUNDLE_ORDER_ITEM_DETAILS_FRAGMENT as h,ORDER_SUMMARY_FRAGMENT as f,ADDRESS_FRAGMENT as C}from"./fragments.js";import{a as Te,c as Re,r as De}from"./chunks/confirmCancelOrder.js";import"@dropins/tools/fetch-graphql.js";import"./chunks/transform-attributes-form.js";import"@dropins/tools/lib.js";const G=(t,r)=>({id:t,totalQuantity:r.totalQuantity,possibleOnepageCheckout:!0,items:r.items.map(e=>{var a,o,n,s,i,p;return{canApplyMsrp:!0,formattedPrice:"",id:e.id,quantity:e.totalQuantity,product:{canonicalUrl:((a=e.product)==null?void 0:a.canonicalUrl)??"",mainImageUrl:((o=e.product)==null?void 0:o.image)??"",name:((n=e.product)==null?void 0:n.name)??"",productId:0,productType:(s=e.product)==null?void 0:s.productType,sku:((i=e.product)==null?void 0:i.sku)??""},prices:{price:{value:e.price.value,currency:e.price.currency}},configurableOptions:((p=e.selectedOptions)==null?void 0:p.map(c=>({optionLabel:c.label,valueLabel:c.value})))||[]}})}),M=t=>{var a,o,n;const r=t.coupons[0],e=(a=t.payments)==null?void 0:a[0];return{appliedCouponCode:(r==null?void 0:r.code)??"",email:t.email,grandTotal:t.grandTotal.value,orderId:t.number,orderType:"checkout",otherTax:0,salesTax:t.totalTax.value,shipping:{shippingMethod:((o=t.shipping)==null?void 0:o.code)??"",shippingAmount:((n=t.shipping)==null?void 0:n.amount)??0},subtotalExcludingTax:t.subtotal.value,subtotalIncludingTax:0,payments:e?[{paymentMethodCode:(e==null?void 0:e.code)||"",paymentMethodName:(e==null?void 0:e.name)||"",total:t.grandTotal.value}]:[]}},N=t=>{var e,a;const r=(a=(e=t==null?void 0:t.data)==null?void 0:e.placeOrder)==null?void 0:a.orderV2;return r?T(r):null},d={SHOPPING_CART_CONTEXT:"shoppingCartContext",ORDER_CONTEXT:"orderContext"},b={PLACE_ORDER:"place-order"};function m(){return window.adobeDataLayer=window.adobeDataLayer||[],window.adobeDataLayer}function l(t,r){const e=m();e.push({[t]:null}),e.push({[t]:r})}function I(t,r){m().push(a=>{const o=a.getState?a.getState():{};a.push({event:t,eventInfo:{...o,...r}})})}function L(t,r){const e=M(r),a=G(t,r);l(d.ORDER_CONTEXT,{...e}),l(d.SHOPPING_CART_CONTEXT,{...a}),I(b.PLACE_ORDER)}const S=`
|
|
4
|
+
mutation PLACE_ORDER_MUTATION($cartId: String!) {
|
|
5
|
+
placeOrder(input: { cart_id: $cartId }) {
|
|
6
|
+
errors {
|
|
7
|
+
code
|
|
8
|
+
message
|
|
9
|
+
}
|
|
10
|
+
orderV2 {
|
|
8
11
|
email
|
|
9
12
|
available_actions
|
|
10
13
|
status
|
|
@@ -18,148 +21,72 @@ query ORDER_BY_NUMBER($orderNumber: String!) {
|
|
|
18
21
|
code
|
|
19
22
|
}
|
|
20
23
|
shipments {
|
|
21
|
-
id
|
|
22
|
-
number
|
|
23
|
-
tracking {
|
|
24
|
-
title
|
|
25
|
-
number
|
|
26
|
-
carrier
|
|
27
|
-
}
|
|
28
|
-
comments {
|
|
29
|
-
message
|
|
30
|
-
timestamp
|
|
31
|
-
}
|
|
32
|
-
items {
|
|
33
24
|
id
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
25
|
+
number
|
|
26
|
+
tracking {
|
|
27
|
+
title
|
|
28
|
+
number
|
|
29
|
+
carrier
|
|
30
|
+
}
|
|
31
|
+
comments {
|
|
32
|
+
message
|
|
33
|
+
timestamp
|
|
34
|
+
}
|
|
35
|
+
items {
|
|
36
|
+
id
|
|
37
|
+
product_sku
|
|
38
|
+
product_name
|
|
39
|
+
order_item {
|
|
40
|
+
...ORDER_ITEM_DETAILS_FRAGMENT
|
|
41
|
+
... on GiftCardOrderItem {
|
|
42
|
+
...GIFT_CARD_DETAILS_FRAGMENT
|
|
43
|
+
product {
|
|
44
|
+
...PRODUCT_DETAILS_FRAGMENT
|
|
45
|
+
}
|
|
45
46
|
}
|
|
46
47
|
}
|
|
47
48
|
}
|
|
48
|
-
|
|
49
|
-
}
|
|
49
|
+
}
|
|
50
50
|
payment_methods {
|
|
51
51
|
name
|
|
52
52
|
type
|
|
53
53
|
}
|
|
54
54
|
shipping_address {
|
|
55
|
-
|
|
55
|
+
...ADDRESS_FRAGMENT
|
|
56
56
|
}
|
|
57
57
|
billing_address {
|
|
58
|
-
|
|
58
|
+
...ADDRESS_FRAGMENT
|
|
59
59
|
}
|
|
60
60
|
items {
|
|
61
|
-
...
|
|
61
|
+
...ORDER_ITEM_DETAILS_FRAGMENT
|
|
62
|
+
... on BundleOrderItem {
|
|
63
|
+
...BUNDLE_ORDER_ITEM_DETAILS_FRAGMENT
|
|
64
|
+
}
|
|
62
65
|
... on GiftCardOrderItem {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
recipient_email
|
|
67
|
-
sender_name
|
|
68
|
-
sender_email
|
|
69
|
-
message
|
|
66
|
+
...GIFT_CARD_DETAILS_FRAGMENT
|
|
67
|
+
product {
|
|
68
|
+
...PRODUCT_DETAILS_FRAGMENT
|
|
70
69
|
}
|
|
71
70
|
}
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
${c}
|
|
81
|
-
${_}
|
|
82
|
-
${p}
|
|
83
|
-
`,g=async(e,r)=>await n(y,{method:"GET",cache:"force-cache",variables:{orderNumber:e}}).then(t=>{var a;return(a=t.errors)!=null&&a.length?m(t.errors):h(r??"orderData",t)}).catch(o),R=`
|
|
84
|
-
query ORDER_BY_TOKEN($token: String!) {
|
|
85
|
-
guestOrderByToken(input: { token: $token }) {
|
|
86
|
-
email
|
|
87
|
-
id
|
|
88
|
-
number
|
|
89
|
-
order_date
|
|
90
|
-
status
|
|
91
|
-
token
|
|
92
|
-
carrier
|
|
93
|
-
shipping_method
|
|
94
|
-
printed_card_included
|
|
95
|
-
gift_receipt_included
|
|
96
|
-
available_actions
|
|
97
|
-
is_virtual
|
|
98
|
-
payment_methods {
|
|
99
|
-
name
|
|
100
|
-
type
|
|
101
|
-
}
|
|
102
|
-
applied_coupons {
|
|
103
|
-
code
|
|
104
|
-
}
|
|
105
|
-
shipments {
|
|
106
|
-
id
|
|
107
|
-
tracking {
|
|
108
|
-
title
|
|
109
|
-
number
|
|
110
|
-
carrier
|
|
111
|
-
}
|
|
112
|
-
comments {
|
|
113
|
-
message
|
|
114
|
-
timestamp
|
|
115
|
-
}
|
|
116
|
-
items {
|
|
117
|
-
id
|
|
118
|
-
product_sku
|
|
119
|
-
product_name
|
|
120
|
-
order_item {
|
|
121
|
-
...OrderItems
|
|
122
|
-
... on GiftCardOrderItem {
|
|
123
|
-
gift_card {
|
|
124
|
-
recipient_name
|
|
125
|
-
recipient_email
|
|
126
|
-
sender_name
|
|
127
|
-
sender_email
|
|
128
|
-
message
|
|
71
|
+
... on DownloadableOrderItem {
|
|
72
|
+
product_name
|
|
73
|
+
downloadable_links {
|
|
74
|
+
sort_order
|
|
75
|
+
title
|
|
129
76
|
}
|
|
130
77
|
}
|
|
131
78
|
}
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
payment_methods {
|
|
135
|
-
name
|
|
136
|
-
type
|
|
137
|
-
}
|
|
138
|
-
shipping_address {
|
|
139
|
-
...AddressesList
|
|
140
|
-
}
|
|
141
|
-
billing_address {
|
|
142
|
-
...AddressesList
|
|
143
|
-
}
|
|
144
|
-
items {
|
|
145
|
-
...OrderItems
|
|
146
|
-
... on GiftCardOrderItem {
|
|
147
|
-
__typename
|
|
148
|
-
gift_card {
|
|
149
|
-
recipient_name
|
|
150
|
-
recipient_email
|
|
151
|
-
sender_name
|
|
152
|
-
sender_email
|
|
153
|
-
message
|
|
79
|
+
total {
|
|
80
|
+
...ORDER_SUMMARY_FRAGMENT
|
|
154
81
|
}
|
|
155
82
|
}
|
|
156
83
|
}
|
|
157
|
-
total {
|
|
158
|
-
...OrderSummary
|
|
159
|
-
}
|
|
160
84
|
}
|
|
161
|
-
}
|
|
162
|
-
${
|
|
163
|
-
${
|
|
164
|
-
${
|
|
165
|
-
|
|
85
|
+
${D}
|
|
86
|
+
${A}
|
|
87
|
+
${g}
|
|
88
|
+
${O}
|
|
89
|
+
${h}
|
|
90
|
+
${f}
|
|
91
|
+
${C}
|
|
92
|
+
`,k=async t=>{if(!t)throw new Error("No cart ID found");return E(S,{variables:{cartId:t}}).then(r=>{var a;(a=r.errors)!=null&&a.length&&_(r.errors);const e=N(r);return e&&(u.emit("order/placed",e),u.emit("cart/reset",void 0),L(t,e)),e}).catch(R)};export{H as cancelOrder,ce as config,Te as confirmCancelOrder,Re as confirmGuestReturn,E as fetchGraphQl,W as getAttributesForm,ee as getAttributesList,V as getConfig,oe as getCustomer,ie as getCustomerOrdersReturn,ne as getGuestOrder,ue as getOrderDetailsById,Ee as getStoreConfig,de as guestOrderByToken,le as initialize,k as placeOrder,Y as removeFetchGraphQlHeader,De as reorderItems,q as requestGuestOrderCancel,te as requestGuestReturn,re as requestReturn,z as setEndpoint,j as setFetchGraphQlHeader,J as setFetchGraphQlHeaders};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
/*! Copyright 2024 Adobe
|
|
2
|
+
All Rights Reserved. */
|
|
3
|
+
import{jsx as v,jsxs as S,Fragment as _}from"@dropins/tools/preact-jsx-runtime.js";import{Price as P,Image as T,CartItem as g,Icon as u,Incrementer as o}from"@dropins/tools/components.js";import{useCallback as G}from"@dropins/tools/preact-hooks.js";import{classes as J}from"@dropins/tools/lib.js";import{O as r}from"./OrderLoaders.js";import*as M from"@dropins/tools/preact-compat.js";const c=k=>M.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...k},M.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M0.75 12C0.75 5.78421 5.78421 0.75 12 0.75C18.2158 0.75 23.25 5.78421 23.25 12C23.25 18.2158 18.2158 23.25 12 23.25C5.78421 23.25 0.75 18.2158 0.75 12Z",stroke:"currentColor"}),M.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M11.75 5.88423V4.75H12.25V5.88423L12.0485 13.0713H11.9515L11.75 5.88423ZM11.7994 18.25V16.9868H12.2253V18.25H11.7994Z",stroke:"currentColor"})),se=({placeholderImage:k="",loading:X,product:e,itemType:Y,taxConfig:D,translations:h,disabledIncrementer:i,onQuantity:E,showConfigurableOptions:V,routeProductDetails:w})=>{var q,x,O,W,$,z,B,F,K,R,U;const{taxExcluded:f,taxIncluded:L}=D,t=G((m,H,b)=>v(P,{amount:m,currency:H,weight:"normal",...b}),[]),Z=G(m=>{var b,A;const H=(b=m==null?void 0:m.product)!=null&&b.thumbnail.url.length?(A=m==null?void 0:m.product)==null?void 0:A.thumbnail.url:k;return v(T,{src:H,alt:m==null?void 0:m.productName,loading:"lazy",width:"90",height:"120"})},[k]);if(!e)return v(r,{});let N={};const Q=Y==="cancelled",C=(x=(q=e==null?void 0:e.product)==null?void 0:q.stockStatus)==null?void 0:x.includes("IN_STOCK"),l=e==null?void 0:e.giftCard,a=(O=e==null?void 0:e.itemPrices)==null?void 0:O.priceIncludingTax,s=(W=e==null?void 0:e.itemPrices)==null?void 0:W.originalPrice,n=($=e==null?void 0:e.itemPrices)==null?void 0:$.price,I=e.totalQuantity>1?{quantity:e.totalQuantity}:{},y=e.discounted&&((z=e.price)==null?void 0:z.value)!==(s==null?void 0:s.value)*(e==null?void 0:e.totalQuantity),j={...(e==null?void 0:e.configurableOptions)||{},...(e==null?void 0:e.bundleOptions)||{},...l!=null&&l.senderName?{[h.sender]:l==null?void 0:l.senderName}:{},...l!=null&&l.senderEmail?{[h.sender]:l==null?void 0:l.senderEmail}:{},...l!=null&&l.senderName?{[h.sender]:l==null?void 0:l.senderName}:{},...l!=null&&l.recipientEmail?{[h.recipient]:l==null?void 0:l.recipientEmail}:{},...l!=null&&l.message?{[h.message]:l==null?void 0:l.message}:{},...e!=null&&e.downloadableLinks?{[`${(B=e==null?void 0:e.downloadableLinks)==null?void 0:B.count} ${h.downloadableCount}`]:(F=e==null?void 0:e.downloadableLinks)==null?void 0:F.result}:{}};if(L&&f){const m=y?s==null?void 0:s.value:(a==null?void 0:a.value)*(e==null?void 0:e.totalQuantity);N={taxExcluded:!0,taxIncluded:void 0,price:t(s==null?void 0:s.value,s==null?void 0:s.currency),total:S(_,{children:[t(m,s==null?void 0:s.currency,{variant:e.discounted&&(a==null?void 0:a.value)!==m?"strikethrough":"default"}),e.discounted&&(a==null?void 0:a.value)!==m?t(a==null?void 0:a.value,a==null?void 0:a.currency,{sale:!0,weight:"bold"}):null]}),totalExcludingTax:t((n==null?void 0:n.value)*e.totalQuantity,n==null?void 0:n.currency)}}else if(!L&&f)N={taxExcluded:void 0,taxIncluded:void 0,price:t(s==null?void 0:s.value,s==null?void 0:s.currency),total:S(_,{children:[t((s==null?void 0:s.value)*(e==null?void 0:e.totalQuantity),a==null?void 0:a.currency,{variant:y?"strikethrough":"default"}),y?t((K=e.price)==null?void 0:K.value,(R=e.price)==null?void 0:R.currency,{sale:!0,weight:"bold"}):null]}),totalExcludingTax:t((n==null?void 0:n.value)*(e==null?void 0:e.totalQuantity),n==null?void 0:n.currency)};else if(L&&!f){const m=y?s.value:a.value*e.totalQuantity;N={taxExcluded:void 0,taxIncluded:!0,price:t(a==null?void 0:a.value,a==null?void 0:a.currency),total:S(_,{children:[t(m,a==null?void 0:a.currency,{variant:y?"strikethrough":"default",weight:"bold"}),y?t(a==null?void 0:a.value,a==null?void 0:a.currency,{sale:!0,weight:"bold"}):null]})}}return v(g,{loading:X,alert:Q&&C?S("span",{children:[v(u,{source:c}),h.outOfStock]}):v(_,{}),configurations:(V==null?void 0:V(j))??j,title:w?v("a",{"data-testid":"product-name",className:J(["cart-summary-item__title",["cart-summary-item__title--strikethrough",Q]]),href:w(e),children:e==null?void 0:e.productName}):v("div",{"data-testid":"product-name",className:J(["cart-summary-item__title",["cart-summary-item__title--strikethrough",Q]]),children:e==null?void 0:e.productName}),sku:v("div",{children:(U=e==null?void 0:e.product)==null?void 0:U.sku}),...I,image:w?v("a",{href:w(e),children:Z(e)}):Z(e),...N,footer:E&&!i?v(o,{value:1,min:1,max:e==null?void 0:e.totalQuantity,onValue:m=>E==null?void 0:E(Number(m)),name:"quantity","data-testid":"returnIncrementer",readonly:!0}):void 0})};export{se as C,c as S};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
/*! Copyright 2024 Adobe
|
|
2
|
+
All Rights Reserved. */
|
|
3
|
+
import{jsxs as g,jsx as r}from"@dropins/tools/preact-jsx-runtime.js";import{InLineAlert as v,Picker as x,Button as F}from"@dropins/tools/components.js";import{F as S}from"./ShippingStatusCard.js";import"@dropins/tools/lib.js";import{useState as n}from"@dropins/tools/preact-hooks.js";import"@dropins/tools/preact-compat.js";import"@dropins/tools/preact.js";import{events as d}from"@dropins/tools/event-bus.js";import{r as E,c as _}from"./requestGuestOrderCancel.js";import{useText as D,Text as l}from"@dropins/tools/i18n.js";const k=({orderRef:a,pickerProps:m,submitButtonProps:u,cancelReasons:t})=>{const o=D({ErrorHeading:"Order.OrderCancelForm.errorHeading",ErrorDescription:"Order.OrderCancelForm.errorDescription",orderCancellationLabel:"Order.OrderCancelForm.label"}),[i,p]=n(0),[f,O]=n(!1),[b,h]=n(!1);d.on("authenticated",e=>{e&&h(!0)},{eager:!0});const C=e=>{e.preventDefault();const s=Number(e.target.value);p(s)};return g(S,{onSubmit:async e=>(e.preventDefault(),(a.length>20?E:_)(a,t[i].text,c=>{b||(c.status="guest order cancellation requested"),d.emit("order/data",c)},()=>{O(!0)})),"data-testid":"order-order-cancel-reasons-form__text",children:[f&&r(v,{heading:o.ErrorHeading,description:o.ErrorDescription}),r("div",{className:"order-order-cancel-reasons-form__text",children:r(l,{id:"Order.OrderCancelForm.description"})}),r(x,{name:"cancellationReasons",floatingLabel:o.orderCancellationLabel,defaultOption:t[0],variant:"primary",options:t,value:String(i),handleSelect:C,required:!0,"data-testid":"order-cancellation-reasons-selector",...m}),r("div",{className:"order-order-cancel-reasons-form__button-container",children:r(F,{variant:"primary","data-testid":"order-cancel-submit-button",...u,children:r(l,{id:"Order.OrderCancelForm.button"})})})]})};export{k as O};
|
package/chunks/OrderLoaders.js
CHANGED
|
@@ -1 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
/*! Copyright 2024 Adobe
|
|
2
|
+
All Rights Reserved. */
|
|
3
|
+
import{jsx as e,jsxs as a}from"@dropins/tools/preact-jsx-runtime.js";import"./ShippingStatusCard.js";import{Card as d,Skeleton as i,SkeletonRow as r,CartItemSkeleton as t}from"@dropins/tools/components.js";import{classes as m}from"@dropins/tools/lib.js";const z=({testId:s,withCard:n=!0})=>{const l=a(i,{"data-testid":s??"skeletonLoader",children:[e(r,{variant:"heading",size:"xlarge",fullWidth:!1,lines:1}),e(r,{variant:"heading",size:"xlarge",fullWidth:!0,lines:1}),e(r,{variant:"heading",size:"xlarge",fullWidth:!0,lines:1})]});return n?l:e(d,{variant:"secondary",className:m(["order-order-loaders","order-order-loaders--card-loader"]),children:l})},v=s=>e(d,{variant:"secondary",...s,children:a(i,{"data-testid":"order-details-skeleton",children:[e(r,{variant:"heading",size:"medium",fullWidth:!0}),e(r,{size:"medium"}),e(r,{variant:"empty",size:"medium"}),e(r,{size:"xlarge"}),e(r,{size:"xlarge"}),e(r,{size:"xlarge"}),e(r,{size:"xlarge"})]})}),g=()=>a(i,{"data-testid":"order-product-list-skeleton",style:{gridTemplateColumns:"1fr"},children:[e(r,{variant:"heading",fullWidth:!0,size:"medium"}),e(t,{}),e(t,{}),e(t,{}),e(t,{}),e(t,{})]}),p=()=>a(i,{"data-testid":"order-cost-summary-content-skeleton",className:"order-cost-summary-content",children:[e(r,{variant:"heading",size:"small"}),e(r,{variant:"empty",size:"small"}),e(r,{variant:"empty",size:"small"}),e(r,{variant:"empty",size:"small"}),e(r,{variant:"heading",size:"small",fullWidth:!0,lines:3})]}),f=()=>a(i,{"data-testid":"order-header-skeleton",className:"order-header",children:[e(r,{variant:"empty",size:"xlarge",fullWidth:!0}),e(r,{variant:"empty",size:"medium"}),e(r,{variant:"empty",size:"medium"}),e(r,{variant:"empty",size:"medium"}),e(r,{variant:"empty",size:"medium"}),e(r,{variant:"empty",size:"medium"}),e(r,{size:"small",fullWidth:!0}),e(r,{variant:"heading",size:"xsmall",fullWidth:!0})]});export{z as C,v as D,p as O,g as a,f as b};
|