@dropins/storefront-account 0.1.0-alpha10
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/createCustomerAddress/createCustomerAddress.d.ts +4 -0
- package/api/createCustomerAddress/graphql/createCustomerAddress.graphql.d.ts +2 -0
- package/api/createCustomerAddress/index.d.ts +2 -0
- package/api/fetch-graphql/fetch-graphql.d.ts +8 -0
- package/api/fetch-graphql/index.d.ts +2 -0
- package/api/getAttributesForm/getAttributesForm.d.ts +4 -0
- package/api/getAttributesForm/graphql/getAttributesForm.graphql.d.ts +3 -0
- package/api/getAttributesForm/index.d.ts +2 -0
- package/api/getCountries/getCountries.d.ts +9 -0
- package/api/getCountries/graphql/getCountries.graphql.d.ts +2 -0
- package/api/getCountries/index.d.ts +2 -0
- package/api/getCustomer/getCustomer.d.ts +4 -0
- package/api/getCustomer/graphql/getCustomer.graphql.d.ts +2 -0
- package/api/getCustomer/index.d.ts +2 -0
- package/api/getCustomerAddress/getCustomerAddress.d.ts +4 -0
- package/api/getCustomerAddress/graphql/getCustomerAddress.graphql.d.ts +2 -0
- package/api/getCustomerAddress/index.d.ts +2 -0
- package/api/getOrderHistoryList/getOrderHistoryList.d.ts +4 -0
- package/api/getOrderHistoryList/graphql/customerAddressFragment.graphql.d.ts +2 -0
- package/api/getOrderHistoryList/graphql/getOrderHistoryList.graphql.d.ts +2 -0
- package/api/getOrderHistoryList/graphql/orderSummaryFragment.graphql.d.ts +2 -0
- package/api/getOrderHistoryList/index.d.ts +2 -0
- package/api/getRegions/getRegions.d.ts +5 -0
- package/api/getRegions/graphql/getRegions.graphql.d.ts +2 -0
- package/api/getRegions/index.d.ts +2 -0
- package/api/index.d.ts +12 -0
- package/api/initialize/index.d.ts +2 -0
- package/api/initialize/initialize.d.ts +14 -0
- package/api/removeCustomerAddress/graphql/removeCustomerAddress.graphql.d.ts +2 -0
- package/api/removeCustomerAddress/index.d.ts +2 -0
- package/api/removeCustomerAddress/removeCustomerAddress.d.ts +2 -0
- package/api/updateCustomerAddress/graphql/updateCustomerAddress.graphql.d.ts +2 -0
- package/api/updateCustomerAddress/index.d.ts +2 -0
- package/api/updateCustomerAddress/updateCustomerAddress.d.ts +8 -0
- package/api.d.ts +1 -0
- package/api.js +9 -0
- package/chunks/AddressFormWrapper.js +1 -0
- package/chunks/getOrderHistoryList.js +113 -0
- package/chunks/removeCustomerAddress.js +116 -0
- package/components/AccountLoaders/AccountLoaders.d.ts +8 -0
- package/components/AccountLoaders/index.d.ts +3 -0
- package/components/AddressActions/AddressActions.d.ts +5 -0
- package/components/AddressActions/index.d.ts +3 -0
- package/components/AddressCard/AddressCard.d.ts +5 -0
- package/components/AddressCard/index.d.ts +3 -0
- package/components/AddressFormWrapper/AddressFormWrapper.d.ts +5 -0
- package/components/AddressFormWrapper/index.d.ts +3 -0
- package/components/AddressModal/AddressModal.d.ts +5 -0
- package/components/AddressModal/index.d.ts +3 -0
- package/components/AddressesWrapper/AddressesWrapper.d.ts +5 -0
- package/components/AddressesWrapper/index.d.ts +3 -0
- package/components/EmptyList/EmptyList.d.ts +5 -0
- package/components/EmptyList/index.d.ts +3 -0
- package/components/Form/Form.d.ts +6 -0
- package/components/Form/FormInputs/FormInputs.d.ts +5 -0
- package/components/Form/FormInputs/index.d.ts +3 -0
- package/components/Form/index.d.ts +3 -0
- package/components/OrdersListAction/OrdersListAction.d.ts +5 -0
- package/components/OrdersListAction/index.d.ts +3 -0
- package/components/OrdersListCard/OrdersListCard.d.ts +5 -0
- package/components/OrdersListCard/index.d.ts +3 -0
- package/components/OrdersListWrapper/OrdersListWrapper.d.ts +5 -0
- package/components/OrdersListWrapper/index.d.ts +3 -0
- package/components/index.d.ts +13 -0
- package/configs/addressField.config.d.ts +39 -0
- package/configs/defaultAttributePreset.config.d.ts +2 -0
- package/configs/mockDefaultAddress.config.d.ts +184 -0
- package/configs/mockOrdersList.config.d.ts +203 -0
- package/containers/AddressForm/AddressForm.d.ts +5 -0
- package/containers/AddressForm/index.d.ts +3 -0
- package/containers/AddressForm.d.ts +3 -0
- package/containers/AddressForm.js +1 -0
- package/containers/Addresses/Addresses.d.ts +5 -0
- package/containers/Addresses/index.d.ts +3 -0
- package/containers/Addresses.d.ts +3 -0
- package/containers/Addresses.js +1 -0
- package/containers/OrdersList/OrdersList.d.ts +5 -0
- package/containers/OrdersList/index.d.ts +3 -0
- package/containers/OrdersList.d.ts +3 -0
- package/containers/OrdersList.js +1 -0
- package/containers/index.d.ts +4 -0
- package/data/models/attributes-form.d.ts +46 -0
- package/data/models/country.d.ts +5 -0
- package/data/models/customer-address.d.ts +21 -0
- package/data/models/customer.d.ts +6 -0
- package/data/models/index.d.ts +6 -0
- package/data/models/order-history-list.d.ts +78 -0
- package/data/models/region.d.ts +11 -0
- package/data/transforms/index.d.ts +7 -0
- package/data/transforms/transform-attributes-form.d.ts +6 -0
- package/data/transforms/transform-countries.d.ts +10 -0
- package/data/transforms/transform-customer-address.d.ts +8 -0
- package/data/transforms/transform-customer.d.ts +5 -0
- package/data/transforms/transform-order-history-list.d.ts +5 -0
- package/data/transforms/transform-regions.d.ts +6 -0
- package/hooks/components/useForm.d.ts +13 -0
- package/hooks/containers/useAddressForm.d.ts +30 -0
- package/hooks/containers/useAddresses.d.ts +24 -0
- package/hooks/containers/useOrderSelectList.d.ts +12 -0
- package/hooks/containers/useOrdersList.d.ts +13 -0
- package/hooks/useDebounce.d.ts +3 -0
- package/hooks/useIsMobile.d.ts +2 -0
- package/i18n/en_US.json.d.ts +119 -0
- package/lib/areRequiredFieldsValid.d.ts +6 -0
- package/lib/checkIsFunction.d.ts +2 -0
- package/lib/convertCase.d.ts +4 -0
- package/lib/convertToBoolean.d.ts +2 -0
- package/lib/convertToInputDateFormat.d.ts +2 -0
- package/lib/fetch-error.d.ts +5 -0
- package/lib/formatDateToLocale.d.ts +31 -0
- package/lib/getDateRange.d.ts +10 -0
- package/lib/getFieldsConfig.d.ts +4 -0
- package/lib/getFormValues.d.ts +2 -0
- package/lib/getFormValuesFromRef.d.ts +5 -0
- package/lib/initializeFormDataAndErrors.d.ts +10 -0
- package/lib/manageAddressDeletion.d.ts +9 -0
- package/lib/network-error.d.ts +6 -0
- package/lib/normalizeAttributes.d.ts +2 -0
- package/lib/normalizeGetAddressData.d.ts +6 -0
- package/lib/prepareNormalizedData.d.ts +21 -0
- package/lib/serializeAddressForm.d.ts +4 -0
- package/lib/sortingAddressesList.d.ts +5 -0
- package/lib/transformSessionData.d.ts +6 -0
- package/lib/validationFields.d.ts +33 -0
- package/package.json +1 -0
- package/render/Provider.d.ts +8 -0
- package/render/index.d.ts +2 -0
- package/render/render.d.ts +4 -0
- package/render.d.ts +1 -0
- package/render.js +3 -0
- package/types/addressForm.types.d.ts +45 -0
- package/types/addresses.types.d.ts +88 -0
- package/types/api/createCustomerAddress.types.d.ts +47 -0
- package/types/api/getAttributesForm.types.d.ts +31 -0
- package/types/api/getCountries.types.d.ts +19 -0
- package/types/api/getCustomer.types.d.ts +13 -0
- package/types/api/getCustomerAddress.type.d.ts +36 -0
- package/types/api/getOrderHistoryList.types.d.ts +77 -0
- package/types/api/getRegions.types.d.ts +16 -0
- package/types/api/removeCustomerAddress.types.d.ts +9 -0
- package/types/api/updateCustomerAddress.types.d.ts +11 -0
- package/types/emptyList.types.d.ts +8 -0
- package/types/form.types.d.ts +51 -0
- package/types/index.d.ts +15 -0
- package/types/ordersList.types.d.ts +52 -0
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export * from '../containers/AddressForm';
|
|
2
|
+
export * from './Form';
|
|
3
|
+
export * from './Form/FormInputs';
|
|
4
|
+
export * from './AddressCard';
|
|
5
|
+
export * from './AddressActions';
|
|
6
|
+
export * from './AddressModal';
|
|
7
|
+
export * from './EmptyList';
|
|
8
|
+
export * from './OrdersListAction';
|
|
9
|
+
export * from './OrdersListCard';
|
|
10
|
+
export * from './AccountLoaders';
|
|
11
|
+
export * from './AddressesWrapper';
|
|
12
|
+
export * from './AddressFormWrapper';
|
|
13
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { FieldEnumList } from '../data/models';
|
|
2
|
+
|
|
3
|
+
export declare const defaultShippingCheckBox: {
|
|
4
|
+
label: string;
|
|
5
|
+
name: string;
|
|
6
|
+
id: string;
|
|
7
|
+
code: string;
|
|
8
|
+
customUpperCode: string;
|
|
9
|
+
entityType: string;
|
|
10
|
+
isUnique: boolean;
|
|
11
|
+
options: never[];
|
|
12
|
+
multilineCount: number;
|
|
13
|
+
validateRules: never[];
|
|
14
|
+
defaultValue: boolean;
|
|
15
|
+
fieldType: FieldEnumList;
|
|
16
|
+
className: string;
|
|
17
|
+
required: boolean;
|
|
18
|
+
orderNumber: number;
|
|
19
|
+
isHidden: boolean;
|
|
20
|
+
};
|
|
21
|
+
export declare const defaultBillingCheckBox: {
|
|
22
|
+
label: string;
|
|
23
|
+
name: string;
|
|
24
|
+
id: string;
|
|
25
|
+
code: string;
|
|
26
|
+
customUpperCode: string;
|
|
27
|
+
entityType: string;
|
|
28
|
+
isUnique: boolean;
|
|
29
|
+
options: never[];
|
|
30
|
+
multilineCount: number;
|
|
31
|
+
validateRules: never[];
|
|
32
|
+
defaultValue: boolean;
|
|
33
|
+
fieldType: FieldEnumList;
|
|
34
|
+
className: string;
|
|
35
|
+
required: boolean;
|
|
36
|
+
orderNumber: number;
|
|
37
|
+
isHidden: boolean;
|
|
38
|
+
};
|
|
39
|
+
//# sourceMappingURL=addressField.config.d.ts.map
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
export declare const mockResponseInputFieldsList: ({
|
|
2
|
+
default_value: null;
|
|
3
|
+
entity_type: string;
|
|
4
|
+
frontend_class: null;
|
|
5
|
+
frontend_input: string;
|
|
6
|
+
required: boolean;
|
|
7
|
+
is_unique: boolean;
|
|
8
|
+
label: string;
|
|
9
|
+
options: never[];
|
|
10
|
+
multiline_count: number;
|
|
11
|
+
sort_order: number;
|
|
12
|
+
validate_rules: never[];
|
|
13
|
+
name: string;
|
|
14
|
+
id: string;
|
|
15
|
+
code: string;
|
|
16
|
+
isHidden?: undefined;
|
|
17
|
+
} | {
|
|
18
|
+
default_value: boolean;
|
|
19
|
+
entity_type: string;
|
|
20
|
+
is_unique: boolean;
|
|
21
|
+
options: never[];
|
|
22
|
+
multiline_count: number;
|
|
23
|
+
validate_rules: never[];
|
|
24
|
+
frontend_input: string;
|
|
25
|
+
frontend_class: string;
|
|
26
|
+
required: boolean;
|
|
27
|
+
sort_order: number;
|
|
28
|
+
isHidden: boolean;
|
|
29
|
+
label: string;
|
|
30
|
+
name: string;
|
|
31
|
+
id: string;
|
|
32
|
+
code: string;
|
|
33
|
+
})[];
|
|
34
|
+
export declare const mockInputFieldsList: ({
|
|
35
|
+
defaultValue: null;
|
|
36
|
+
entityType: string;
|
|
37
|
+
className: null;
|
|
38
|
+
fieldType: string;
|
|
39
|
+
required: boolean;
|
|
40
|
+
isUnique: boolean;
|
|
41
|
+
label: string;
|
|
42
|
+
options: never[];
|
|
43
|
+
multilineCount: number;
|
|
44
|
+
orderNumber: number;
|
|
45
|
+
validateRules: never[];
|
|
46
|
+
name: string;
|
|
47
|
+
id: string;
|
|
48
|
+
code: string;
|
|
49
|
+
customUpperCode: string;
|
|
50
|
+
isHidden?: undefined;
|
|
51
|
+
} | {
|
|
52
|
+
entityType: string;
|
|
53
|
+
isUnique: boolean;
|
|
54
|
+
options: never[];
|
|
55
|
+
multilineCount: number;
|
|
56
|
+
validateRules: never[];
|
|
57
|
+
defaultValue: boolean;
|
|
58
|
+
fieldType: string;
|
|
59
|
+
className: string;
|
|
60
|
+
required: boolean;
|
|
61
|
+
orderNumber: number;
|
|
62
|
+
isHidden: boolean;
|
|
63
|
+
label: string;
|
|
64
|
+
name: string;
|
|
65
|
+
id: string;
|
|
66
|
+
code: string;
|
|
67
|
+
customUpperCode: string;
|
|
68
|
+
})[];
|
|
69
|
+
export declare const mockKeysSortOrder: ({
|
|
70
|
+
name: string;
|
|
71
|
+
orderNumber: number;
|
|
72
|
+
label: null;
|
|
73
|
+
} | {
|
|
74
|
+
name: string;
|
|
75
|
+
orderNumber: number;
|
|
76
|
+
label: string;
|
|
77
|
+
})[];
|
|
78
|
+
export declare const mockDefaultAddress: {
|
|
79
|
+
firstname: string;
|
|
80
|
+
lastname: string;
|
|
81
|
+
city: string;
|
|
82
|
+
company: string;
|
|
83
|
+
countryCode: string;
|
|
84
|
+
region: {
|
|
85
|
+
region: string;
|
|
86
|
+
regionCode: string;
|
|
87
|
+
regionId: number;
|
|
88
|
+
};
|
|
89
|
+
telephone: string;
|
|
90
|
+
id: string;
|
|
91
|
+
vatId: string;
|
|
92
|
+
postcode: string;
|
|
93
|
+
street: string;
|
|
94
|
+
streetMultiline_2: string;
|
|
95
|
+
defaultShipping: boolean;
|
|
96
|
+
defaultBilling: boolean;
|
|
97
|
+
};
|
|
98
|
+
export declare const mockResponseAddressWithText: {
|
|
99
|
+
firstname: string;
|
|
100
|
+
lastname: string;
|
|
101
|
+
city: string;
|
|
102
|
+
company: string;
|
|
103
|
+
country_code: string;
|
|
104
|
+
region: {
|
|
105
|
+
region: string;
|
|
106
|
+
region_code: string;
|
|
107
|
+
region_id: number;
|
|
108
|
+
};
|
|
109
|
+
telephone: string;
|
|
110
|
+
id: string;
|
|
111
|
+
vat_id: string;
|
|
112
|
+
postcode: string;
|
|
113
|
+
street: string[];
|
|
114
|
+
default_shipping: boolean;
|
|
115
|
+
default_billing: boolean;
|
|
116
|
+
custom_attributesV2: never[];
|
|
117
|
+
};
|
|
118
|
+
export declare const mockResponseAddressEmpty: {
|
|
119
|
+
firstname: string;
|
|
120
|
+
lastname: string;
|
|
121
|
+
city: string;
|
|
122
|
+
company: string;
|
|
123
|
+
country_code: string;
|
|
124
|
+
region: {
|
|
125
|
+
region: string;
|
|
126
|
+
region_code: string;
|
|
127
|
+
region_id: string;
|
|
128
|
+
};
|
|
129
|
+
telephone: string;
|
|
130
|
+
id: string;
|
|
131
|
+
vat_id: string;
|
|
132
|
+
postcode: string;
|
|
133
|
+
street: string[];
|
|
134
|
+
default_shipping: boolean;
|
|
135
|
+
default_billing: boolean;
|
|
136
|
+
custom_attributesV2: never[];
|
|
137
|
+
};
|
|
138
|
+
export declare const mockDefaultAddressEmpty: {
|
|
139
|
+
firstname: string;
|
|
140
|
+
lastname: string;
|
|
141
|
+
city: string;
|
|
142
|
+
company: string;
|
|
143
|
+
countryCode: string;
|
|
144
|
+
region: {
|
|
145
|
+
region: string;
|
|
146
|
+
regionCode: string;
|
|
147
|
+
regionId: string;
|
|
148
|
+
};
|
|
149
|
+
telephone: string;
|
|
150
|
+
id: string;
|
|
151
|
+
vatId: string;
|
|
152
|
+
postcode: string;
|
|
153
|
+
street: string;
|
|
154
|
+
defaultShipping: boolean;
|
|
155
|
+
defaultBilling: boolean;
|
|
156
|
+
};
|
|
157
|
+
export declare const mockResponseCountries: {
|
|
158
|
+
two_letter_abbreviation: string;
|
|
159
|
+
full_name_locale: string;
|
|
160
|
+
}[];
|
|
161
|
+
export declare const mockResponseCountriesEmpty: {
|
|
162
|
+
two_letter_abbreviation: null;
|
|
163
|
+
full_name_locale: null;
|
|
164
|
+
}[];
|
|
165
|
+
export declare const mockDefaultCountries: {
|
|
166
|
+
value: string;
|
|
167
|
+
text: string;
|
|
168
|
+
}[];
|
|
169
|
+
export declare const mockResponseRegions: {
|
|
170
|
+
id: number;
|
|
171
|
+
code: string;
|
|
172
|
+
name: string;
|
|
173
|
+
}[];
|
|
174
|
+
export declare const mockResponseRegionsEmpty: {
|
|
175
|
+
id: null;
|
|
176
|
+
code: null;
|
|
177
|
+
name: null;
|
|
178
|
+
}[];
|
|
179
|
+
export declare const mockDefaultRegions: {
|
|
180
|
+
id: number;
|
|
181
|
+
value: string;
|
|
182
|
+
text: string;
|
|
183
|
+
}[];
|
|
184
|
+
//# sourceMappingURL=mockDefaultAddress.config.d.ts.map
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
export declare const mockOrdersListResponse: {
|
|
2
|
+
customer: {
|
|
3
|
+
orders: {
|
|
4
|
+
page_info: {
|
|
5
|
+
page_size: number;
|
|
6
|
+
total_pages: number;
|
|
7
|
+
current_page: number;
|
|
8
|
+
};
|
|
9
|
+
total_count: number;
|
|
10
|
+
date_of_first_order: string;
|
|
11
|
+
items: ({
|
|
12
|
+
token: string;
|
|
13
|
+
email: string;
|
|
14
|
+
shipping_method: string;
|
|
15
|
+
shipping_address: {
|
|
16
|
+
firstname: string;
|
|
17
|
+
lastname: string;
|
|
18
|
+
city: string;
|
|
19
|
+
company: string;
|
|
20
|
+
country_code: string;
|
|
21
|
+
region: {
|
|
22
|
+
region: string;
|
|
23
|
+
region_code: string;
|
|
24
|
+
region_id: string;
|
|
25
|
+
};
|
|
26
|
+
shipments: never[];
|
|
27
|
+
telephone: string;
|
|
28
|
+
id: string;
|
|
29
|
+
vat_id: string;
|
|
30
|
+
postcode: string;
|
|
31
|
+
street: string[];
|
|
32
|
+
default_shipping: boolean;
|
|
33
|
+
default_billing: boolean;
|
|
34
|
+
custom_attributesV2: never[];
|
|
35
|
+
};
|
|
36
|
+
billing_address: {
|
|
37
|
+
firstname: string;
|
|
38
|
+
lastname: string;
|
|
39
|
+
city: string;
|
|
40
|
+
company: string;
|
|
41
|
+
country_code: string;
|
|
42
|
+
region: {
|
|
43
|
+
region: string;
|
|
44
|
+
region_code: string;
|
|
45
|
+
region_id: string;
|
|
46
|
+
};
|
|
47
|
+
telephone: string;
|
|
48
|
+
id: string;
|
|
49
|
+
vat_id: string;
|
|
50
|
+
postcode: string;
|
|
51
|
+
street: string[];
|
|
52
|
+
default_shipping: boolean;
|
|
53
|
+
default_billing: boolean;
|
|
54
|
+
custom_attributesV2: never[];
|
|
55
|
+
};
|
|
56
|
+
payment_methods: {
|
|
57
|
+
name: string;
|
|
58
|
+
}[];
|
|
59
|
+
number: string;
|
|
60
|
+
id: string;
|
|
61
|
+
order_date: string;
|
|
62
|
+
carrier: string;
|
|
63
|
+
status: string;
|
|
64
|
+
items: {
|
|
65
|
+
status: string;
|
|
66
|
+
product_name: string;
|
|
67
|
+
id: string;
|
|
68
|
+
product: {
|
|
69
|
+
small_image: {
|
|
70
|
+
url: string;
|
|
71
|
+
};
|
|
72
|
+
};
|
|
73
|
+
}[];
|
|
74
|
+
total: {
|
|
75
|
+
grand_total: {
|
|
76
|
+
value: number;
|
|
77
|
+
currency: string;
|
|
78
|
+
};
|
|
79
|
+
subtotal: {
|
|
80
|
+
currency: string;
|
|
81
|
+
value: number;
|
|
82
|
+
};
|
|
83
|
+
taxes: never[];
|
|
84
|
+
total_tax: {
|
|
85
|
+
currency: string;
|
|
86
|
+
value: number;
|
|
87
|
+
};
|
|
88
|
+
total_shipping: {
|
|
89
|
+
currency: string;
|
|
90
|
+
value: number;
|
|
91
|
+
};
|
|
92
|
+
discounts: never[];
|
|
93
|
+
};
|
|
94
|
+
shipments?: undefined;
|
|
95
|
+
quantityInvoiced?: undefined;
|
|
96
|
+
} | {
|
|
97
|
+
token: string;
|
|
98
|
+
email: string;
|
|
99
|
+
shipping_method: string;
|
|
100
|
+
shipments: {
|
|
101
|
+
id: string;
|
|
102
|
+
tracking: {
|
|
103
|
+
title: string;
|
|
104
|
+
number: string;
|
|
105
|
+
carrier: string;
|
|
106
|
+
}[];
|
|
107
|
+
}[];
|
|
108
|
+
shipping_address: {
|
|
109
|
+
firstname: string;
|
|
110
|
+
lastname: string;
|
|
111
|
+
city: string;
|
|
112
|
+
company: string;
|
|
113
|
+
country_code: string;
|
|
114
|
+
region: {
|
|
115
|
+
region: string;
|
|
116
|
+
region_code: string;
|
|
117
|
+
region_id: string;
|
|
118
|
+
};
|
|
119
|
+
telephone: string;
|
|
120
|
+
id: string;
|
|
121
|
+
vat_id: string;
|
|
122
|
+
postcode: string;
|
|
123
|
+
street: string[];
|
|
124
|
+
default_shipping: boolean;
|
|
125
|
+
default_billing: boolean;
|
|
126
|
+
custom_attributesV2: never[];
|
|
127
|
+
shipments?: undefined;
|
|
128
|
+
};
|
|
129
|
+
billing_address: {
|
|
130
|
+
firstname: string;
|
|
131
|
+
lastname: string;
|
|
132
|
+
city: string;
|
|
133
|
+
company: string;
|
|
134
|
+
country_code: string;
|
|
135
|
+
region: {
|
|
136
|
+
region: string;
|
|
137
|
+
region_code: string;
|
|
138
|
+
region_id: string;
|
|
139
|
+
};
|
|
140
|
+
telephone: string;
|
|
141
|
+
id: string;
|
|
142
|
+
vat_id: string;
|
|
143
|
+
postcode: string;
|
|
144
|
+
street: string[];
|
|
145
|
+
default_shipping: boolean;
|
|
146
|
+
default_billing: boolean;
|
|
147
|
+
custom_attributesV2: never[];
|
|
148
|
+
};
|
|
149
|
+
payment_methods: {
|
|
150
|
+
name: string;
|
|
151
|
+
}[];
|
|
152
|
+
number: string;
|
|
153
|
+
quantityInvoiced: number;
|
|
154
|
+
id: string;
|
|
155
|
+
order_date: string;
|
|
156
|
+
carrier: string;
|
|
157
|
+
status: string;
|
|
158
|
+
items: ({
|
|
159
|
+
status: string;
|
|
160
|
+
product_name: string;
|
|
161
|
+
id: string;
|
|
162
|
+
product: {
|
|
163
|
+
small_image: {
|
|
164
|
+
url: string;
|
|
165
|
+
};
|
|
166
|
+
};
|
|
167
|
+
quantityInvoiced?: undefined;
|
|
168
|
+
} | {
|
|
169
|
+
status: string;
|
|
170
|
+
quantityInvoiced: number;
|
|
171
|
+
product_name: string;
|
|
172
|
+
id: string;
|
|
173
|
+
product: {
|
|
174
|
+
small_image: {
|
|
175
|
+
url: string;
|
|
176
|
+
};
|
|
177
|
+
};
|
|
178
|
+
})[];
|
|
179
|
+
total: {
|
|
180
|
+
grand_total: {
|
|
181
|
+
value: number;
|
|
182
|
+
currency: string;
|
|
183
|
+
};
|
|
184
|
+
subtotal: {
|
|
185
|
+
currency: string;
|
|
186
|
+
value: number;
|
|
187
|
+
};
|
|
188
|
+
taxes: never[];
|
|
189
|
+
total_tax: {
|
|
190
|
+
currency: string;
|
|
191
|
+
value: number;
|
|
192
|
+
};
|
|
193
|
+
total_shipping: {
|
|
194
|
+
currency: string;
|
|
195
|
+
value: number;
|
|
196
|
+
};
|
|
197
|
+
discounts: never[];
|
|
198
|
+
};
|
|
199
|
+
})[];
|
|
200
|
+
};
|
|
201
|
+
};
|
|
202
|
+
};
|
|
203
|
+
//# sourceMappingURL=mockOrdersList.config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{A as l,A as u}from"../chunks/AddressFormWrapper.js";import"@dropins/tools/preact-jsx-runtime.js";import"@dropins/tools/lib.js";import"@dropins/tools/components.js";import"@dropins/tools/preact-hooks.js";import"../chunks/removeCustomerAddress.js";import"@dropins/tools/event-bus.js";import"@dropins/tools/fetch-graphql.js";import"@dropins/tools/i18n.js";import"@dropins/tools/preact-compat.js";import"@dropins/tools/preact.js";export{l as AddressForm,u as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as s}from"@dropins/tools/preact-jsx-runtime.js";import{classes as y}from"@dropins/tools/lib.js";import{a as z}from"../chunks/AddressFormWrapper.js";import"@dropins/tools/preact-compat.js";import"@dropins/tools/components.js";import"@dropins/tools/preact-hooks.js";import"@dropins/tools/event-bus.js";import"../chunks/removeCustomerAddress.js";import"@dropins/tools/fetch-graphql.js";import"@dropins/tools/i18n.js";import"@dropins/tools/preact.js";const M=({slots:t,title:o,addressFormTitle:i,defaultSelectAddressId:d,showFormLoader:e,forwardFormRef:p,showSaveCheckBox:m,saveCheckBoxValue:a,selectShipping:f,selectBilling:n,selectable:c,className:r,withHeader:l,minifiedView:u,withActionsInMinifiedView:x,withActionsInFullSizeView:A,inputsDefaultValueSet:h,showShippingCheckBox:j,showBillingCheckBox:v,shippingCheckBoxValue:W,billingCheckBoxValue:b,onAddressData:g,routeAddressesPage:k,onSuccess:q,onError:w})=>s("div",{className:y(["dropin-addresses",r]),"data-testid":"addressesid",children:s(z,{slots:t,title:o,addressFormTitle:i,defaultSelectAddressId:d,showFormLoader:e,onAddressData:g,forwardFormRef:p,selectShipping:f,selectBilling:n,showSaveCheckBox:m,saveCheckBoxValue:a,selectable:c,className:r,withHeader:l,minifiedView:u,withActionsInMinifiedView:x,withActionsInFullSizeView:A,inputsDefaultValueSet:h,billingCheckBoxValue:b,shippingCheckBoxValue:W,showBillingCheckBox:v,showShippingCheckBox:j,routeAddressesPage:k,onSuccess:q,onError:w})});export{M as Addresses,M as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as e,jsxs as h,Fragment as w}from"@dropins/tools/preact-jsx-runtime.js";import{classes as b,Slot as T}from"@dropins/tools/lib.js";import{S as P,c as B,E as F,C as V}from"../chunks/AddressFormWrapper.js";import"@dropins/tools/preact-compat.js";import{Card as H,Icon as k,ContentGrid as _,Image as K,Header as q,Picker as J,Pagination as W}from"@dropins/tools/components.js";import{useText as m}from"@dropins/tools/i18n.js";import{useState as v,useEffect as M,useMemo as j,useCallback as z}from"@dropins/tools/preact-hooks.js";import"@dropins/tools/event-bus.js";import{g as G}from"../chunks/getOrderHistoryList.js";import"../chunks/removeCustomerAddress.js";import"@dropins/tools/fetch-graphql.js";import"@dropins/tools/preact.js";const Y={size:"32",stroke:"2"},E=({minifiedView:i,orderNumber:r,orderToken:t,routeOrdersList:s,routeOrderDetails:n})=>{const d=i?"minifiedView":"fullSizeView",l=m({viewAllOrdersButton:`Account.${d}.OrdersList.viewAllOrdersButton`,ariaLabelLink:`Account.${d}.OrdersList.ariaLabelLink`});return s?e("a",{className:b(["dropin-orders-list-action",["dropin-orders-list-action--minifiedView",i]]),"data-testid":"ordersListActionButtonMinifiedView",href:s(),children:e(H,{"data-testid":"ordersListActionMinifiedView",variant:"secondary",children:h("div",{className:"dropin-orders-list-action__card-wrapper",children:[e("p",{children:l.viewAllOrdersButton}),e(k,{source:P,...Y})]})})}):e("a",{"aria-label":`${l.ariaLabelLink} ${r??t}`,href:B(n)?n(r,t):"#",className:"dropin-orders-list-action","data-testid":"ordersListActionButton",children:e(k,{source:P,...Y})})},R=()=>{const[i,r]=v(window.innerWidth<768);return M(()=>{const t=()=>{r(window.innerWidth<768)};return window.addEventListener("resize",t),()=>{window.removeEventListener("resize",t)}},[]),i},U=({minifiedView:i,item:r,withThumbnails:t,children:s,slots:n,routeTracking:d,...l})=>{var o,f,c,C,y,N;const u=i?"minifiedView":"fullSizeView",p=m({orderNumber:`Account.${u}.OrdersList.OrdersListCard.orderNumber`,itemsAmount:`Account.${u}.OrdersList.OrdersListCard.itemsAmount`,carrier:`Account.${u}.OrdersList.OrdersListCard.carrier`,deliveryDateText:`Account.${u}.OrdersList.OrdersListCard.orderDate`}),O=R();return h(H,{variant:"secondary",...l,className:b(["dropin-orders-list-card",["dropin-orders-list-card--full",((o=r==null?void 0:r.items)==null?void 0:o.length)>6]]),children:[e("div",{className:"dropin-orders-list-card--content",children:n!=null&&n.OrdersListCard?e(T,{"data-testid":`ordersListCard${r.id}`,name:"OrdersListCard",slot:n==null?void 0:n.OrdersListCard,context:{orderHistoryListItem:r}}):h(w,{children:[e("div",{children:r==null?void 0:r.status}),h("p",{children:[p.deliveryDateText," ",r==null?void 0:r.orderDate]}),h("p",{children:[p.orderNumber," ",r.number]}),(f=r==null?void 0:r.shipments)==null?void 0:f.map(a=>{var L;return(L=a==null?void 0:a.tracking)==null?void 0:L.map(A=>h("p",{"data-testid":A.number,children:[e("span",{children:`${p.carrier} ${A.carrier.toLocaleUpperCase()} `}),e("a",{href:(d==null?void 0:d(A))??"",className:"dropin-orders-list-card--content--track_number",children:A.number})]},a.id))}),h("p",{children:["$",(c=r==null?void 0:r.total)==null?void 0:c.grandTotal.value]}),h("p",{"data-testid":"itemsAmount",children:[((C=r==null?void 0:r.items)==null?void 0:C.length)??0," ",p.itemsAmount]}),(y=r==null?void 0:r.items)==null?void 0:y.map((a,L)=>{if(L>=0&&L<10)return h("p",{className:"dropin-orders-list-card--content--product-name",children:[h("span",{className:"dropin-orders-list-card--content--quantity",children:[(a==null?void 0:a.quantityOrdered)>1?a==null?void 0:a.quantityOrdered:null," "]}),a==null?void 0:a.productName.replaceAll("-"," ")]},`${L}_${a.id}`);if(L===11)return e("p",{children:"..."},"ellipsis")})]})}),t&&((N=r==null?void 0:r.items)!=null&&N.length)?e(_,{maxColumns:O?3:9,emptyGridContent:e(w,{}),className:b(["dropin-orders-list-card--images",["dropin-orders-list-card--images-3",O]]),"data-testid":"ordersListCardImages",children:r.items.map((a,L)=>{var $;const A=($=a==null?void 0:a.product)==null?void 0:$.smallImage.url,g=a==null?void 0:a.productName;return e(K,{src:A,width:65,height:65,alt:g},a.id+L)})}):null,e("div",{className:"dropin-orders-list-card--actions",children:s})]})},Q=({ordersInMinifiedView:i,minifiedView:r,pageSize:t,selectedDate:s,selectedPage:n,handleSetFirstOrderDate:d})=>{const[l,u]=v([]),[p,O]=v({totalPages:1,currentPage:1,pageSize:1}),[o,f]=v(!1);return M(()=>{f(!0),G(r?i:t,s,n).then(c=>{!c||!c.items||(O(c.pageInfo),u(c.items),d==null||d(c.dateOfFirstOrder))}).finally(()=>{f(!1)})},[d,r,i,t,s,n]),{loading:o,orderHistoryListItems:l,pageInfo:p}},D=(i,r=1)=>{const t=new Date,s=new Date(t);switch(i){case"sixMonthsAgo":{s.setMonth(s.getMonth()-r);break}case"oneYearAgo":{s.setFullYear(s.getFullYear()-r);break}default:return""}return{from:s==null?void 0:s.toISOString().split("T")[0],to:`${t==null?void 0:t.toISOString().split("T")[0]} 23:59:59`}},X=i=>{const r=[],t=new Date().getFullYear();for(let s=i;s<=t-1;s++)r.push({value:`{"from":"${s}-01-01","to":"${s+1}-01-01 23:59:59"}`,text:s.toString()});return r},Z=()=>{const i=m({pastSixMonths:"Account.fullSizeView.OrdersList.OrdersListSelectDate.pastSixMonths",currentYear:"Account.fullSizeView.OrdersList.OrdersListSelectDate.currentYear",viewAll:"Account.fullSizeView.OrdersList.OrdersListSelectDate.viewAll"}),[r,t]=v(),[s,n]=v(JSON.stringify(D("sixMonthsAgo",6))),[d,l]=v(1);M(()=>{window==null||window.scrollTo({top:100,behavior:"smooth"})},[d]);const u=j(()=>{const o=[{value:JSON.stringify(D("sixMonthsAgo",6)),text:i.pastSixMonths},{value:JSON.stringify(D("oneYearAgo",1)),text:i.currentYear},{value:"viewAll",text:i.viewAll}];if(r){const c=new Date(r).getFullYear();o==null||o.splice(2,0,...X(c))}return o},[i,r]),p=z(o=>{t(o)},[]),O=z(o=>{const c=o.target.value;n(c),l(1)},[]);return{selectableDateList:u,selectedDate:s,selectedPage:d,handleSelectDate:O,setSelectedPage:l,handleSetFirstOrderDate:p}},rr=({className:i,withHeader:r=!0,minifiedView:t=!1,withThumbnails:s=!0,withFilter:n=!0,ordersInMinifiedView:d=1,pageSize:l=10,routeOrdersList:u,routeOrderDetails:p,routeTracking:O,slots:o})=>{const c=m({containerTitle:`Account.${t?"minifiedView":"fullSizeView"}.OrdersList.containerTitle`}),{selectableDateList:C,selectedDate:y,handleSelectDate:N,selectedPage:a,setSelectedPage:L,handleSetFirstOrderDate:A}=Z(),{pageInfo:g,loading:$,orderHistoryListItems:x}=Q({minifiedView:t,pageSize:l,ordersInMinifiedView:d,selectedDate:y,selectedPage:a,handleSetFirstOrderDate:A});return h("div",{children:[r?e(q,{"aria-label":c.containerTitle,role:"region",title:c.containerTitle,divider:!t,className:t?"dropin-orders-list-header":""}):null,h("div",{className:b(["dropin-orders-list",i]),children:[!t&&n?e("div",{className:"dropin-orders-list--date-select",children:e(J,{value:y,name:"orderDatePicker",options:C,handleSelect:N})}):null,$?e(w,{children:Array.from(Array(g==null?void 0:g.pageSize).keys()).map(S=>e(V,{testId:"orderSkeletonLoader",withCard:!1},S))}):e(w,{children:x.length?e(w,{children:x.map((S,I)=>e(U,{routeTracking:O,minifiedView:t,item:S,withThumbnails:s,slots:o,children:o!=null&&o.OrdersListAction?e(T,{"data-testid":`ordersListActionSlot_${I}`,name:"OrdersListAction",slot:o==null?void 0:o.OrdersListAction,context:{orderHistoryListItem:S}}):e(E,{minifiedView:t,orderNumber:S.number,orderToken:S.token,routeOrderDetails:p})},I))}):e(F,{isEmpty:!x.length,typeList:"orders",minifiedView:t})}),(g==null?void 0:g.totalPages)>1?e(W,{totalPages:g==null?void 0:g.totalPages,currentPage:a,onChange:L}):null,t?e(E,{minifiedView:t,routeOrdersList:u}):null]})]})},hr=({className:i,withHeader:r,minifiedView:t,withThumbnails:s,withFilter:n,ordersInMinifiedView:d,pageSize:l,routeOrdersList:u,routeOrderDetails:p,routeTracking:O,slots:o})=>e("div",{className:b(["dropin-orders-list",i]),"data-testid":"ordersListId",children:e(rr,{className:i,withHeader:r,minifiedView:t,withThumbnails:s,withFilter:n,ordersInMinifiedView:d,pageSize:l,routeOrdersList:u,routeOrderDetails:p,routeTracking:O,slots:o})});export{hr as OrdersList,hr as default};
|