@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,19 @@
|
|
|
1
|
+
import { OrderDataModel } from '../data/models';
|
|
2
|
+
|
|
3
|
+
export interface SignUpContext {
|
|
4
|
+
inputsDefaultValueSet: DefaultValues;
|
|
5
|
+
addressesData: any[];
|
|
6
|
+
}
|
|
7
|
+
type DefaultValues = {
|
|
8
|
+
code: string;
|
|
9
|
+
defaultValue: string;
|
|
10
|
+
}[];
|
|
11
|
+
export interface OrderHeaderProps {
|
|
12
|
+
handleEmailAvailability?: (email: string) => Promise<boolean>;
|
|
13
|
+
handleSignUpClick?: (ctx: SignUpContext) => void;
|
|
14
|
+
orderData?: OrderDataModel;
|
|
15
|
+
}
|
|
16
|
+
export interface UseOrderHeaderProps extends OrderHeaderProps {
|
|
17
|
+
}
|
|
18
|
+
export {};
|
|
19
|
+
//# sourceMappingURL=orderHeader.types.d.ts.map
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { OrderDataModel, OrderItemModel } from '../data/models';
|
|
2
|
+
|
|
3
|
+
type options = Record<string, string | number | boolean>;
|
|
4
|
+
export type TaxTypes = {
|
|
5
|
+
taxIncluded: boolean;
|
|
6
|
+
taxExcluded: boolean;
|
|
7
|
+
};
|
|
8
|
+
export interface OrderProductListProps {
|
|
9
|
+
orderData?: OrderDataModel;
|
|
10
|
+
className?: string;
|
|
11
|
+
withHeader?: boolean;
|
|
12
|
+
showConfigurableOptions?: (options: options | {}) => options;
|
|
13
|
+
routeProductDetails?: (product: any) => string;
|
|
14
|
+
}
|
|
15
|
+
export interface OrderProductListContentProps extends Omit<OrderProductListProps, 'className'> {
|
|
16
|
+
placeholderImage: string;
|
|
17
|
+
order?: OrderDataModel;
|
|
18
|
+
taxConfig: TaxTypes;
|
|
19
|
+
loading: boolean;
|
|
20
|
+
}
|
|
21
|
+
export interface CartSummaryItemProps {
|
|
22
|
+
placeholderImage?: string;
|
|
23
|
+
disabledIncrementer?: boolean;
|
|
24
|
+
loading: boolean;
|
|
25
|
+
itemType: string;
|
|
26
|
+
translations: Record<string, string>;
|
|
27
|
+
product: OrderItemModel;
|
|
28
|
+
taxConfig: TaxTypes;
|
|
29
|
+
onQuantity?: (value: number) => void;
|
|
30
|
+
showConfigurableOptions?: (options: options | {}) => options;
|
|
31
|
+
routeProductDetails?: (product: any) => string;
|
|
32
|
+
}
|
|
33
|
+
export interface UseOrderProductListProps extends Omit<OrderProductListProps, 'className' | 'withHeader' | 'showConfigurableOptions'> {
|
|
34
|
+
}
|
|
35
|
+
export {};
|
|
36
|
+
//# sourceMappingURL=orderProductList.types.d.ts.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { OrderDataModel } from '../data/models';
|
|
1
|
+
import { OrderDataModel, OrdersReturnPropsModel } from '../data/models';
|
|
3
2
|
import { SlotProps } from '@dropins/tools/types/elsie/src/lib';
|
|
3
|
+
import { UserInputErrorProps } from '.';
|
|
4
4
|
|
|
5
5
|
export declare enum StatusEnumProps {
|
|
6
6
|
PENDING = "pending",
|
|
@@ -15,24 +15,32 @@ export declare enum StatusEnumProps {
|
|
|
15
15
|
type DefaultSlotContext = {
|
|
16
16
|
orderData?: OrderDataModel;
|
|
17
17
|
};
|
|
18
|
-
export interface OrderStatusProps
|
|
18
|
+
export interface OrderStatusProps {
|
|
19
|
+
className?: string;
|
|
19
20
|
orderData?: OrderDataModel;
|
|
20
21
|
statusTitle?: string;
|
|
21
22
|
status?: StatusEnumProps;
|
|
22
23
|
slots?: {
|
|
23
24
|
OrderActions: SlotProps<DefaultSlotContext>;
|
|
24
25
|
};
|
|
26
|
+
routeCreateReturn?: (orderReturn: OrdersReturnPropsModel) => string;
|
|
27
|
+
routeOnSuccess?: () => string;
|
|
28
|
+
onError?: (errorInformation: UserInputErrorProps[] | string) => void;
|
|
25
29
|
}
|
|
26
30
|
export interface OrderStatusContentProps extends Omit<OrderStatusProps, 'statusTitle' | 'orderData' | 'status'> {
|
|
27
31
|
title?: string;
|
|
28
32
|
status?: StatusEnumProps;
|
|
29
33
|
orderData?: OrderDataModel;
|
|
30
34
|
}
|
|
31
|
-
export interface OrderActionsProps
|
|
35
|
+
export interface OrderActionsProps {
|
|
36
|
+
className?: string;
|
|
32
37
|
orderData?: OrderDataModel;
|
|
33
38
|
slots?: {
|
|
34
39
|
OrderActions: SlotProps<DefaultSlotContext>;
|
|
35
40
|
};
|
|
41
|
+
routeCreateReturn?: (orderReturn: OrdersReturnPropsModel) => string;
|
|
42
|
+
routeOnSuccess?: () => string;
|
|
43
|
+
onError?: (errorInformation: UserInputErrorProps[] | string) => void;
|
|
36
44
|
}
|
|
37
45
|
export interface UseOrderStatusProps {
|
|
38
46
|
orderData?: OrderDataModel;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { OrderDataModel } from '../data/models';
|
|
2
|
+
import { UserInputErrorProps } from '.';
|
|
3
|
+
|
|
4
|
+
export interface ReorderProps {
|
|
5
|
+
orderData?: OrderDataModel;
|
|
6
|
+
routeOnSuccess?: () => string;
|
|
7
|
+
onError?: (errorInformation: UserInputErrorProps[] | string) => void;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=reorder.types.d.ts.map
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { SlotProps } from '@dropins/tools/types/elsie/src/src/lib';
|
|
2
|
+
import { OrderDataModel, OrderItemModel, OrdersReturnItemsPropsModel, OrdersReturnPropsModel, PageInfoProps } from '../data/models';
|
|
3
|
+
|
|
4
|
+
export interface IconConfig {
|
|
5
|
+
size: '12' | '16' | '24' | '32' | '64' | '80' | undefined;
|
|
6
|
+
stroke: '4' | '1' | '2' | '3' | undefined;
|
|
7
|
+
}
|
|
8
|
+
type routeTrackingProps = {
|
|
9
|
+
carrier: string;
|
|
10
|
+
title: string;
|
|
11
|
+
number: string;
|
|
12
|
+
};
|
|
13
|
+
export interface ReturnsListProps {
|
|
14
|
+
slots?: {
|
|
15
|
+
ReturnItemsDetails?: SlotProps<{
|
|
16
|
+
items: OrdersReturnItemsPropsModel[];
|
|
17
|
+
}>;
|
|
18
|
+
DetailsActionParams?: SlotProps<{
|
|
19
|
+
returnOrderItem: OrdersReturnPropsModel;
|
|
20
|
+
}>;
|
|
21
|
+
};
|
|
22
|
+
returnPageSize?: number;
|
|
23
|
+
withReturnsListButton?: boolean;
|
|
24
|
+
returnsInMinifiedView?: number;
|
|
25
|
+
className?: string;
|
|
26
|
+
minifiedView?: boolean;
|
|
27
|
+
withHeader?: boolean;
|
|
28
|
+
routeReturnDetails?: ({ returnNumber, token, orderNumber, }: {
|
|
29
|
+
returnNumber: string;
|
|
30
|
+
token: string;
|
|
31
|
+
orderNumber: string;
|
|
32
|
+
}) => string;
|
|
33
|
+
routeOrderDetails?: ({ token, orderNumber, }: {
|
|
34
|
+
token: string;
|
|
35
|
+
orderNumber: string;
|
|
36
|
+
}) => string;
|
|
37
|
+
routeTracking?: (track: routeTrackingProps) => string;
|
|
38
|
+
routeReturnsList?: () => string;
|
|
39
|
+
routeProductDetails?: (orderItem?: OrderItemModel) => string;
|
|
40
|
+
withThumbnails?: boolean;
|
|
41
|
+
}
|
|
42
|
+
export interface ReturnsListContentProps extends Omit<ReturnsListProps, 'className' | 'returnPageSize'> {
|
|
43
|
+
placeholderImage?: string;
|
|
44
|
+
minifiedViewKey: 'minifiedView' | 'fullSizeView';
|
|
45
|
+
orderReturns?: OrdersReturnPropsModel[] | [];
|
|
46
|
+
translations: Record<string, string>;
|
|
47
|
+
isMobile: boolean;
|
|
48
|
+
pageInfo: PageInfoProps;
|
|
49
|
+
selectedPage?: number;
|
|
50
|
+
handleSetSelectPage?: (value: number) => void;
|
|
51
|
+
withOrderNumber?: boolean;
|
|
52
|
+
withReturnNumber?: boolean;
|
|
53
|
+
loading: boolean;
|
|
54
|
+
}
|
|
55
|
+
export interface UseReturnsListProps {
|
|
56
|
+
returnPageSize?: number;
|
|
57
|
+
}
|
|
58
|
+
export interface OrderReturnsProps {
|
|
59
|
+
slots?: {
|
|
60
|
+
ReturnItemsDetails?: SlotProps<{
|
|
61
|
+
items: OrdersReturnItemsPropsModel[];
|
|
62
|
+
}>;
|
|
63
|
+
DetailsActionParams?: SlotProps<{
|
|
64
|
+
returnOrderItem: OrdersReturnPropsModel;
|
|
65
|
+
}>;
|
|
66
|
+
};
|
|
67
|
+
withThumbnails?: boolean;
|
|
68
|
+
withHeader?: boolean;
|
|
69
|
+
className?: string;
|
|
70
|
+
orderData?: OrderDataModel;
|
|
71
|
+
routeReturnDetails?: ({ token, orderNumber, }: {
|
|
72
|
+
token: string;
|
|
73
|
+
orderNumber: string;
|
|
74
|
+
}) => string;
|
|
75
|
+
routeProductDetails?: (product: any) => string;
|
|
76
|
+
routeTracking?: (track: routeTrackingProps) => string;
|
|
77
|
+
}
|
|
78
|
+
export interface UseOrderReturnsProps {
|
|
79
|
+
orderData?: OrderDataModel;
|
|
80
|
+
}
|
|
81
|
+
export {};
|
|
82
|
+
//# sourceMappingURL=returnsList.types.d.ts.map
|
|
@@ -1,18 +1,49 @@
|
|
|
1
1
|
import { HTMLAttributes } from 'preact/compat';
|
|
2
2
|
import { SlotProps } from '@dropins/tools/types/elsie/src/lib';
|
|
3
|
-
import { OrderDataModel } from '../data/models';
|
|
3
|
+
import { OrderDataModel, OrdersReturnPropsModel } from '../data/models';
|
|
4
4
|
|
|
5
|
+
type routeOrderDetailsTypes = {
|
|
6
|
+
returnNumber?: string;
|
|
7
|
+
token?: string;
|
|
8
|
+
orderNumber?: string;
|
|
9
|
+
};
|
|
10
|
+
type routeTrackingProps = {
|
|
11
|
+
carrier: string;
|
|
12
|
+
title: string;
|
|
13
|
+
number: string;
|
|
14
|
+
};
|
|
5
15
|
export interface ShippingStatusProps extends HTMLAttributes<HTMLDivElement> {
|
|
6
16
|
orderData?: OrderDataModel;
|
|
7
17
|
collapseThreshold?: number;
|
|
8
18
|
slots?: {
|
|
9
19
|
DeliveryTimeLine?: SlotProps;
|
|
10
20
|
DeliveryTrackActions?: SlotProps;
|
|
21
|
+
ReturnItemsDetails?: SlotProps;
|
|
11
22
|
};
|
|
23
|
+
routeOrderDetails?: ({ returnNumber, token, orderNumber, }: routeOrderDetailsTypes) => string;
|
|
24
|
+
routeTracking?: (track: routeTrackingProps) => string;
|
|
25
|
+
routeProductDetails?: (product: any) => string;
|
|
12
26
|
}
|
|
13
27
|
export interface UseShippingStatusProps {
|
|
14
28
|
orderData?: OrderDataModel;
|
|
15
29
|
}
|
|
16
|
-
export interface ShippingStatusCardProps
|
|
30
|
+
export interface ShippingStatusCardProps {
|
|
31
|
+
placeholderImage: string;
|
|
32
|
+
translations: Record<string, string>;
|
|
33
|
+
slots?: {
|
|
34
|
+
DeliveryTimeLine?: SlotProps;
|
|
35
|
+
DeliveryTrackActions?: SlotProps;
|
|
36
|
+
ReturnItemsDetails?: SlotProps;
|
|
37
|
+
};
|
|
38
|
+
orderData?: OrderDataModel;
|
|
39
|
+
collapseThreshold?: number;
|
|
40
|
+
routeOrderDetails?: ({ returnNumber, token, orderNumber, }: routeOrderDetailsTypes) => string;
|
|
41
|
+
routeProductDetails?: (product: any) => string;
|
|
42
|
+
routeTracking?: (track: routeTrackingProps) => string;
|
|
43
|
+
}
|
|
44
|
+
export interface ShippingStatusReturnCardProps extends ShippingStatusCardProps {
|
|
45
|
+
collapseThreshold: number;
|
|
46
|
+
returnData: OrdersReturnPropsModel;
|
|
17
47
|
}
|
|
48
|
+
export {};
|
|
18
49
|
//# sourceMappingURL=shippingStatus.types.d.ts.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
export declare const ADDRESS = "\nfragment AddressesList 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}";
|
|
2
|
-
//# sourceMappingURL=customerAddressFragment.graphql.d.ts.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
export declare const ORDER_ITEMS = "\nfragment OrderItems on OrderItem {\n __typename\n status\n product_name\n id\n quantity_ordered\n quantity_shipped\n quantity_canceled\n quantity_invoiced\n quantity_refunded\n quantity_returned\n product_sale_price {\n value\n currency\n }\n selected_options {\n label\n value\n }\n product {\n __typename\n canonical_url\n uid\n name\n sku\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
|
-
//# sourceMappingURL=orderItemsFragment.graphql.d.ts.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
export declare const ORDER_SUMMARY = "\nfragment OrderSummary on OrderTotal {\n grand_total {\n value\n currency\n }\n subtotal {\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}";
|
|
2
|
-
//# sourceMappingURL=orderSummaryFragment.graphql.d.ts.map
|
package/chunks/getCustomer.js
DELETED
|
@@ -1,185 +0,0 @@
|
|
|
1
|
-
import{d as w,f as $,h as B,a as Q}from"./fetch-graphql.js";const L=`
|
|
2
|
-
fragment OrderSummary on OrderTotal {
|
|
3
|
-
grand_total {
|
|
4
|
-
value
|
|
5
|
-
currency
|
|
6
|
-
}
|
|
7
|
-
subtotal {
|
|
8
|
-
currency
|
|
9
|
-
value
|
|
10
|
-
}
|
|
11
|
-
taxes {
|
|
12
|
-
amount {
|
|
13
|
-
currency
|
|
14
|
-
value
|
|
15
|
-
}
|
|
16
|
-
rate
|
|
17
|
-
title
|
|
18
|
-
}
|
|
19
|
-
total_tax {
|
|
20
|
-
currency
|
|
21
|
-
value
|
|
22
|
-
}
|
|
23
|
-
total_shipping {
|
|
24
|
-
currency
|
|
25
|
-
value
|
|
26
|
-
}
|
|
27
|
-
discounts {
|
|
28
|
-
amount {
|
|
29
|
-
currency
|
|
30
|
-
value
|
|
31
|
-
}
|
|
32
|
-
label
|
|
33
|
-
}
|
|
34
|
-
}`,F=`
|
|
35
|
-
fragment AddressesList on OrderAddress {
|
|
36
|
-
city
|
|
37
|
-
company
|
|
38
|
-
country_code
|
|
39
|
-
fax
|
|
40
|
-
firstname
|
|
41
|
-
lastname
|
|
42
|
-
middlename
|
|
43
|
-
postcode
|
|
44
|
-
prefix
|
|
45
|
-
region
|
|
46
|
-
region_id
|
|
47
|
-
street
|
|
48
|
-
suffix
|
|
49
|
-
telephone
|
|
50
|
-
vat_id
|
|
51
|
-
}`,K=`
|
|
52
|
-
fragment OrderItems on OrderItem {
|
|
53
|
-
__typename
|
|
54
|
-
status
|
|
55
|
-
product_name
|
|
56
|
-
id
|
|
57
|
-
quantity_ordered
|
|
58
|
-
quantity_shipped
|
|
59
|
-
quantity_canceled
|
|
60
|
-
quantity_invoiced
|
|
61
|
-
quantity_refunded
|
|
62
|
-
quantity_returned
|
|
63
|
-
product_sale_price {
|
|
64
|
-
value
|
|
65
|
-
currency
|
|
66
|
-
}
|
|
67
|
-
selected_options {
|
|
68
|
-
label
|
|
69
|
-
value
|
|
70
|
-
}
|
|
71
|
-
product {
|
|
72
|
-
__typename
|
|
73
|
-
canonical_url
|
|
74
|
-
uid
|
|
75
|
-
name
|
|
76
|
-
sku
|
|
77
|
-
thumbnail {
|
|
78
|
-
label
|
|
79
|
-
url
|
|
80
|
-
}
|
|
81
|
-
price_range {
|
|
82
|
-
maximum_price {
|
|
83
|
-
regular_price {
|
|
84
|
-
currency
|
|
85
|
-
value
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
}`,P=n=>n||0,Y=n=>{var a,u,i;return{canonicalUrl:(n==null?void 0:n.canonical_url)||"",id:(n==null?void 0:n.uid)||"",name:(n==null?void 0:n.name)||"",sku:(n==null?void 0:n.sku)||"",image:((a=n==null?void 0:n.image)==null?void 0:a.url)||"",productType:(n==null?void 0:n.__typename)||"",thumbnail:{label:((u=n==null?void 0:n.thumbnail)==null?void 0:u.label)||"",url:((i=n==null?void 0:n.thumbnail)==null?void 0:i.url)||""}}},j=n=>{if(!n||!("selected_options"in n))return;const a={};for(const u of n.selected_options)a[u.label]=u.value;return a},z=n=>n==null?void 0:n.map(a=>{var u,i,c,t,l,_,y,s,g,f,e,h,O,p,b,q,E,T,G,R,C,S,x,k,N,A,U,D,M;return{type:a==null?void 0:a.__typename,productName:a.product_name,quantityCanceled:a==null?void 0:a.quantity_canceled,quantityInvoiced:a==null?void 0:a.quantity_invoiced,quantityOrdered:a==null?void 0:a.quantity_ordered,quantityRefunded:a==null?void 0:a.quantity_refunded,quantityReturned:a==null?void 0:a.quantity_returned,quantityShipped:a==null?void 0:a.quantity_shipped,id:a==null?void 0:a.id,discounted:((t=(c=(i=(u=a==null?void 0:a.product)==null?void 0:u.price_range)==null?void 0:i.maximum_price)==null?void 0:c.regular_price)==null?void 0:t.value)*(a==null?void 0:a.quantity_ordered)!==((l=a==null?void 0:a.product_sale_price)==null?void 0:l.value)*(a==null?void 0:a.quantity_ordered),total:{value:((_=a==null?void 0:a.product_sale_price)==null?void 0:_.value)*(a==null?void 0:a.quantity_ordered),currency:(y=a==null?void 0:a.product_sale_price)==null?void 0:y.currency},totalInclTax:{value:((s=a==null?void 0:a.product_sale_price)==null?void 0:s.value)*(a==null?void 0:a.quantity_ordered),currency:(g=a==null?void 0:a.product_sale_price)==null?void 0:g.currency},price:{value:(f=a==null?void 0:a.product_sale_price)==null?void 0:f.value,currency:(e=a==null?void 0:a.product_sale_price)==null?void 0:e.currency},priceInclTax:{value:(h=a==null?void 0:a.product_sale_price)==null?void 0:h.value,currency:(O=a==null?void 0:a.product_sale_price)==null?void 0:O.currency},totalQuantity:P(a==null?void 0:a.quantity_ordered),regularPrice:{value:(E=(q=(b=(p=a==null?void 0:a.product)==null?void 0:p.price_range)==null?void 0:b.maximum_price)==null?void 0:q.regular_price)==null?void 0:E.value,currency:(C=(R=(G=(T=a==null?void 0:a.product)==null?void 0:T.price_range)==null?void 0:G.maximum_price)==null?void 0:R.regular_price)==null?void 0:C.currency},product:Y(a==null?void 0:a.product),thumbnail:{label:((x=(S=a==null?void 0:a.product)==null?void 0:S.thumbnail)==null?void 0:x.label)||"",url:((N=(k=a==null?void 0:a.product)==null?void 0:k.thumbnail)==null?void 0:N.url)||""},giftCard:(a==null?void 0:a.__typename)==="GiftCardOrderItem"?{senderName:((A=a.gift_card)==null?void 0:A.sender_name)||"",senderEmail:((U=a.gift_card)==null?void 0:U.sender_email)||"",recipientEmail:((D=a.gift_card)==null?void 0:D.recipient_email)||"",recipientName:((M=a.gift_card)==null?void 0:M.recipient_name)||""}:void 0,configurableOptions:j(a)}}),v=n=>{var s,g,f,e,h;const a=z(n.items),{total:u,...i}=w({...n,items:a},"camelCase",{applied_coupons:"coupons",__typename:"__typename",firstname:"firstName",middlename:"middleName",lastname:"lastName",postcode:"postCode",payment_methods:"payments"}),c=(s=n==null?void 0:n.payment_methods)==null?void 0:s[0],t=(c==null?void 0:c.type)||"",l=(c==null?void 0:c.name)||"",_=(g=i==null?void 0:i.items)==null?void 0:g.reduce((O,p)=>O+p.totalQuantity,0);return{...u,...i,totalQuantity:_,shipping:{amount:((f=i==null?void 0:i.total)==null?void 0:f.totalShipping.value)??0,currency:((h=(e=i.total)==null?void 0:e.totalShipping)==null?void 0:h.currency)||"",code:i.shippingMethod??""},payments:[{code:t,name:l}]}},m=(n,a)=>{var u,i,c,t,l,_,y;if((t=(c=(i=(u=a==null?void 0:a.data)==null?void 0:u.customer)==null?void 0:i.orders)==null?void 0:c.items)!=null&&t.length&&n==="orderData"){const s=(y=(_=(l=a==null?void 0:a.data)==null?void 0:l.customer)==null?void 0:_.orders)==null?void 0:y.items[0];return v(s)}return null},H=n=>{var u,i;if(!((u=n==null?void 0:n.data)!=null&&u.guestOrder))return null;const a=(i=n==null?void 0:n.data)==null?void 0:i.guestOrder;return v(a)},d=n=>{var u,i;if(!((u=n==null?void 0:n.data)!=null&&u.guestOrderByToken))return null;const a=(i=n==null?void 0:n.data)==null?void 0:i.guestOrderByToken;return v(a)},J=n=>{var a,u,i,c,t,l;return{email:((u=(a=n==null?void 0:n.data)==null?void 0:a.customer)==null?void 0:u.email)||"",firstname:((c=(i=n==null?void 0:n.data)==null?void 0:i.customer)==null?void 0:c.firstname)||"",lastname:((l=(t=n==null?void 0:n.data)==null?void 0:t.customer)==null?void 0:l.lastname)||""}},V=`
|
|
91
|
-
fragment guestOrderData on CustomerOrder {
|
|
92
|
-
email
|
|
93
|
-
id
|
|
94
|
-
number
|
|
95
|
-
order_date
|
|
96
|
-
status
|
|
97
|
-
token
|
|
98
|
-
carrier
|
|
99
|
-
shipping_method
|
|
100
|
-
printed_card_included
|
|
101
|
-
gift_receipt_included
|
|
102
|
-
available_actions
|
|
103
|
-
is_virtual
|
|
104
|
-
payment_methods {
|
|
105
|
-
name
|
|
106
|
-
type
|
|
107
|
-
}
|
|
108
|
-
applied_coupons {
|
|
109
|
-
code
|
|
110
|
-
}
|
|
111
|
-
shipments {
|
|
112
|
-
id
|
|
113
|
-
tracking {
|
|
114
|
-
title
|
|
115
|
-
number
|
|
116
|
-
carrier
|
|
117
|
-
}
|
|
118
|
-
comments {
|
|
119
|
-
message
|
|
120
|
-
timestamp
|
|
121
|
-
}
|
|
122
|
-
items {
|
|
123
|
-
id
|
|
124
|
-
product_sku
|
|
125
|
-
product_name
|
|
126
|
-
order_item {
|
|
127
|
-
...OrderItems
|
|
128
|
-
... on GiftCardOrderItem {
|
|
129
|
-
gift_card {
|
|
130
|
-
recipient_name
|
|
131
|
-
recipient_email
|
|
132
|
-
sender_name
|
|
133
|
-
sender_email
|
|
134
|
-
message
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
payment_methods {
|
|
141
|
-
name
|
|
142
|
-
type
|
|
143
|
-
}
|
|
144
|
-
shipping_address {
|
|
145
|
-
...AddressesList
|
|
146
|
-
}
|
|
147
|
-
billing_address {
|
|
148
|
-
...AddressesList
|
|
149
|
-
}
|
|
150
|
-
items {
|
|
151
|
-
...OrderItems
|
|
152
|
-
... on GiftCardOrderItem {
|
|
153
|
-
__typename
|
|
154
|
-
gift_card {
|
|
155
|
-
recipient_name
|
|
156
|
-
recipient_email
|
|
157
|
-
sender_name
|
|
158
|
-
sender_email
|
|
159
|
-
message
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
total {
|
|
164
|
-
...OrderSummary
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
${L}
|
|
168
|
-
${F}
|
|
169
|
-
${K}
|
|
170
|
-
`,W=`
|
|
171
|
-
query GET_GUEST_ORDER($input: OrderInformationInput!) {
|
|
172
|
-
guestOrder(input:$input) {
|
|
173
|
-
...guestOrderData
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
${V}
|
|
177
|
-
`,r=async n=>await $(W,{method:"GET",cache:"no-cache",variables:{input:n}}).then(a=>{var u;return(u=a.errors)!=null&&u.length?B(a.errors):H(a)}).catch(Q),X=`
|
|
178
|
-
query GET_CUSTOMER {
|
|
179
|
-
customer {
|
|
180
|
-
firstname
|
|
181
|
-
lastname
|
|
182
|
-
email
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
`,o=async()=>await $(X,{method:"GET",cache:"force-cache"}).then(n=>{var a;return(a=n.errors)!=null&&a.length?B(n.errors):J(n)}).catch(Q);export{F as A,L as O,K as a,d as b,o as c,r as g,m as t};
|