@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.
Files changed (145) hide show
  1. package/api/createCustomerAddress/createCustomerAddress.d.ts +4 -0
  2. package/api/createCustomerAddress/graphql/createCustomerAddress.graphql.d.ts +2 -0
  3. package/api/createCustomerAddress/index.d.ts +2 -0
  4. package/api/fetch-graphql/fetch-graphql.d.ts +8 -0
  5. package/api/fetch-graphql/index.d.ts +2 -0
  6. package/api/getAttributesForm/getAttributesForm.d.ts +4 -0
  7. package/api/getAttributesForm/graphql/getAttributesForm.graphql.d.ts +3 -0
  8. package/api/getAttributesForm/index.d.ts +2 -0
  9. package/api/getCountries/getCountries.d.ts +9 -0
  10. package/api/getCountries/graphql/getCountries.graphql.d.ts +2 -0
  11. package/api/getCountries/index.d.ts +2 -0
  12. package/api/getCustomer/getCustomer.d.ts +4 -0
  13. package/api/getCustomer/graphql/getCustomer.graphql.d.ts +2 -0
  14. package/api/getCustomer/index.d.ts +2 -0
  15. package/api/getCustomerAddress/getCustomerAddress.d.ts +4 -0
  16. package/api/getCustomerAddress/graphql/getCustomerAddress.graphql.d.ts +2 -0
  17. package/api/getCustomerAddress/index.d.ts +2 -0
  18. package/api/getOrderHistoryList/getOrderHistoryList.d.ts +4 -0
  19. package/api/getOrderHistoryList/graphql/customerAddressFragment.graphql.d.ts +2 -0
  20. package/api/getOrderHistoryList/graphql/getOrderHistoryList.graphql.d.ts +2 -0
  21. package/api/getOrderHistoryList/graphql/orderSummaryFragment.graphql.d.ts +2 -0
  22. package/api/getOrderHistoryList/index.d.ts +2 -0
  23. package/api/getRegions/getRegions.d.ts +5 -0
  24. package/api/getRegions/graphql/getRegions.graphql.d.ts +2 -0
  25. package/api/getRegions/index.d.ts +2 -0
  26. package/api/index.d.ts +12 -0
  27. package/api/initialize/index.d.ts +2 -0
  28. package/api/initialize/initialize.d.ts +14 -0
  29. package/api/removeCustomerAddress/graphql/removeCustomerAddress.graphql.d.ts +2 -0
  30. package/api/removeCustomerAddress/index.d.ts +2 -0
  31. package/api/removeCustomerAddress/removeCustomerAddress.d.ts +2 -0
  32. package/api/updateCustomerAddress/graphql/updateCustomerAddress.graphql.d.ts +2 -0
  33. package/api/updateCustomerAddress/index.d.ts +2 -0
  34. package/api/updateCustomerAddress/updateCustomerAddress.d.ts +8 -0
  35. package/api.d.ts +1 -0
  36. package/api.js +9 -0
  37. package/chunks/AddressFormWrapper.js +1 -0
  38. package/chunks/getOrderHistoryList.js +113 -0
  39. package/chunks/removeCustomerAddress.js +116 -0
  40. package/components/AccountLoaders/AccountLoaders.d.ts +8 -0
  41. package/components/AccountLoaders/index.d.ts +3 -0
  42. package/components/AddressActions/AddressActions.d.ts +5 -0
  43. package/components/AddressActions/index.d.ts +3 -0
  44. package/components/AddressCard/AddressCard.d.ts +5 -0
  45. package/components/AddressCard/index.d.ts +3 -0
  46. package/components/AddressFormWrapper/AddressFormWrapper.d.ts +5 -0
  47. package/components/AddressFormWrapper/index.d.ts +3 -0
  48. package/components/AddressModal/AddressModal.d.ts +5 -0
  49. package/components/AddressModal/index.d.ts +3 -0
  50. package/components/AddressesWrapper/AddressesWrapper.d.ts +5 -0
  51. package/components/AddressesWrapper/index.d.ts +3 -0
  52. package/components/EmptyList/EmptyList.d.ts +5 -0
  53. package/components/EmptyList/index.d.ts +3 -0
  54. package/components/Form/Form.d.ts +6 -0
  55. package/components/Form/FormInputs/FormInputs.d.ts +5 -0
  56. package/components/Form/FormInputs/index.d.ts +3 -0
  57. package/components/Form/index.d.ts +3 -0
  58. package/components/OrdersListAction/OrdersListAction.d.ts +5 -0
  59. package/components/OrdersListAction/index.d.ts +3 -0
  60. package/components/OrdersListCard/OrdersListCard.d.ts +5 -0
  61. package/components/OrdersListCard/index.d.ts +3 -0
  62. package/components/OrdersListWrapper/OrdersListWrapper.d.ts +5 -0
  63. package/components/OrdersListWrapper/index.d.ts +3 -0
  64. package/components/index.d.ts +13 -0
  65. package/configs/addressField.config.d.ts +39 -0
  66. package/configs/defaultAttributePreset.config.d.ts +2 -0
  67. package/configs/mockDefaultAddress.config.d.ts +184 -0
  68. package/configs/mockOrdersList.config.d.ts +203 -0
  69. package/containers/AddressForm/AddressForm.d.ts +5 -0
  70. package/containers/AddressForm/index.d.ts +3 -0
  71. package/containers/AddressForm.d.ts +3 -0
  72. package/containers/AddressForm.js +1 -0
  73. package/containers/Addresses/Addresses.d.ts +5 -0
  74. package/containers/Addresses/index.d.ts +3 -0
  75. package/containers/Addresses.d.ts +3 -0
  76. package/containers/Addresses.js +1 -0
  77. package/containers/OrdersList/OrdersList.d.ts +5 -0
  78. package/containers/OrdersList/index.d.ts +3 -0
  79. package/containers/OrdersList.d.ts +3 -0
  80. package/containers/OrdersList.js +1 -0
  81. package/containers/index.d.ts +4 -0
  82. package/data/models/attributes-form.d.ts +46 -0
  83. package/data/models/country.d.ts +5 -0
  84. package/data/models/customer-address.d.ts +21 -0
  85. package/data/models/customer.d.ts +6 -0
  86. package/data/models/index.d.ts +6 -0
  87. package/data/models/order-history-list.d.ts +78 -0
  88. package/data/models/region.d.ts +11 -0
  89. package/data/transforms/index.d.ts +7 -0
  90. package/data/transforms/transform-attributes-form.d.ts +6 -0
  91. package/data/transforms/transform-countries.d.ts +10 -0
  92. package/data/transforms/transform-customer-address.d.ts +8 -0
  93. package/data/transforms/transform-customer.d.ts +5 -0
  94. package/data/transforms/transform-order-history-list.d.ts +5 -0
  95. package/data/transforms/transform-regions.d.ts +6 -0
  96. package/hooks/components/useForm.d.ts +13 -0
  97. package/hooks/containers/useAddressForm.d.ts +30 -0
  98. package/hooks/containers/useAddresses.d.ts +24 -0
  99. package/hooks/containers/useOrderSelectList.d.ts +12 -0
  100. package/hooks/containers/useOrdersList.d.ts +13 -0
  101. package/hooks/useDebounce.d.ts +3 -0
  102. package/hooks/useIsMobile.d.ts +2 -0
  103. package/i18n/en_US.json.d.ts +119 -0
  104. package/lib/areRequiredFieldsValid.d.ts +6 -0
  105. package/lib/checkIsFunction.d.ts +2 -0
  106. package/lib/convertCase.d.ts +4 -0
  107. package/lib/convertToBoolean.d.ts +2 -0
  108. package/lib/convertToInputDateFormat.d.ts +2 -0
  109. package/lib/fetch-error.d.ts +5 -0
  110. package/lib/formatDateToLocale.d.ts +31 -0
  111. package/lib/getDateRange.d.ts +10 -0
  112. package/lib/getFieldsConfig.d.ts +4 -0
  113. package/lib/getFormValues.d.ts +2 -0
  114. package/lib/getFormValuesFromRef.d.ts +5 -0
  115. package/lib/initializeFormDataAndErrors.d.ts +10 -0
  116. package/lib/manageAddressDeletion.d.ts +9 -0
  117. package/lib/network-error.d.ts +6 -0
  118. package/lib/normalizeAttributes.d.ts +2 -0
  119. package/lib/normalizeGetAddressData.d.ts +6 -0
  120. package/lib/prepareNormalizedData.d.ts +21 -0
  121. package/lib/serializeAddressForm.d.ts +4 -0
  122. package/lib/sortingAddressesList.d.ts +5 -0
  123. package/lib/transformSessionData.d.ts +6 -0
  124. package/lib/validationFields.d.ts +33 -0
  125. package/package.json +1 -0
  126. package/render/Provider.d.ts +8 -0
  127. package/render/index.d.ts +2 -0
  128. package/render/render.d.ts +4 -0
  129. package/render.d.ts +1 -0
  130. package/render.js +3 -0
  131. package/types/addressForm.types.d.ts +45 -0
  132. package/types/addresses.types.d.ts +88 -0
  133. package/types/api/createCustomerAddress.types.d.ts +47 -0
  134. package/types/api/getAttributesForm.types.d.ts +31 -0
  135. package/types/api/getCountries.types.d.ts +19 -0
  136. package/types/api/getCustomer.types.d.ts +13 -0
  137. package/types/api/getCustomerAddress.type.d.ts +36 -0
  138. package/types/api/getOrderHistoryList.types.d.ts +77 -0
  139. package/types/api/getRegions.types.d.ts +16 -0
  140. package/types/api/removeCustomerAddress.types.d.ts +9 -0
  141. package/types/api/updateCustomerAddress.types.d.ts +11 -0
  142. package/types/emptyList.types.d.ts +8 -0
  143. package/types/form.types.d.ts +51 -0
  144. package/types/index.d.ts +15 -0
  145. package/types/ordersList.types.d.ts +52 -0
@@ -0,0 +1,5 @@
1
+ import { FunctionComponent } from 'preact';
2
+ import { AddressModalProps } from '../../types';
3
+
4
+ export declare const AddressModal: FunctionComponent<AddressModalProps>;
5
+ //# sourceMappingURL=AddressModal.d.ts.map
@@ -0,0 +1,3 @@
1
+ export * from './AddressModal';
2
+ export { AddressModal as default } from './AddressModal';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,5 @@
1
+ import { FunctionComponent } from 'preact';
2
+ import { AddressesWrapperProps } from '../../types';
3
+
4
+ export declare const AddressesWrapper: FunctionComponent<AddressesWrapperProps>;
5
+ //# sourceMappingURL=AddressesWrapper.d.ts.map
@@ -0,0 +1,3 @@
1
+ export * from './AddressesWrapper';
2
+ export { AddressesWrapper as default } from './AddressesWrapper';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,5 @@
1
+ import { FunctionComponent } from 'preact';
2
+ import { EmptyListProps } from '../../types';
3
+
4
+ export declare const EmptyList: FunctionComponent<EmptyListProps>;
5
+ //# sourceMappingURL=EmptyList.d.ts.map
@@ -0,0 +1,3 @@
1
+ export * from './EmptyList';
2
+ export { EmptyList as default } from './EmptyList';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,6 @@
1
+ import { FormProps, FormRef } from '../../types';
2
+
3
+ export declare const Form: import('preact').FunctionComponent<import('preact/compat').PropsWithoutRef<FormProps> & {
4
+ ref?: import('preact').Ref<FormRef> | undefined;
5
+ }>;
6
+ //# sourceMappingURL=Form.d.ts.map
@@ -0,0 +1,5 @@
1
+ import { FunctionComponent } from 'preact';
2
+ import { FormInputsProps } from '../../../types';
3
+
4
+ export declare const FormInputs: FunctionComponent<FormInputsProps>;
5
+ //# sourceMappingURL=FormInputs.d.ts.map
@@ -0,0 +1,3 @@
1
+ export * from './FormInputs';
2
+ export { FormInputs as default } from './FormInputs';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,3 @@
1
+ export * from './Form';
2
+ export { Form as default } from './Form';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,5 @@
1
+ import { FunctionComponent } from 'preact';
2
+ import { OrdersListActionProps } from '../../types';
3
+
4
+ export declare const OrdersListAction: FunctionComponent<OrdersListActionProps>;
5
+ //# sourceMappingURL=OrdersListAction.d.ts.map
@@ -0,0 +1,3 @@
1
+ export * from './OrdersListAction';
2
+ export { OrdersListAction as default } from './OrdersListAction';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,5 @@
1
+ import { FunctionComponent } from 'preact';
2
+ import { OrdersListCardProps } from '../../types';
3
+
4
+ export declare const OrdersListCard: FunctionComponent<OrdersListCardProps>;
5
+ //# sourceMappingURL=OrdersListCard.d.ts.map
@@ -0,0 +1,3 @@
1
+ export * from './OrdersListCard';
2
+ export { OrdersListCard as default } from './OrdersListCard';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,5 @@
1
+ import { Container } from '@dropins/tools/types/elsie/src/lib';
2
+ import { OrdersListWrapperProps } from '../../types';
3
+
4
+ export declare const OrdersListWrapper: Container<OrdersListWrapperProps>;
5
+ //# sourceMappingURL=OrdersListWrapper.d.ts.map
@@ -0,0 +1,3 @@
1
+ export * from './OrdersListWrapper';
2
+ export { OrdersListWrapper as default } from './OrdersListWrapper';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -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,2 @@
1
+ export declare const defaultAttributePreset: string[];
2
+ //# sourceMappingURL=defaultAttributePreset.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,5 @@
1
+ import { Container } from '@dropins/tools/types/elsie/src/lib';
2
+ import { AddressFormProps } from '../../types';
3
+
4
+ export declare const AddressForm: Container<AddressFormProps>;
5
+ //# sourceMappingURL=AddressForm.d.ts.map
@@ -0,0 +1,3 @@
1
+ export * from './AddressForm';
2
+ export { AddressForm as default } from './AddressForm';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,3 @@
1
+ export * from './AddressForm/index'
2
+ import _default from './AddressForm/index'
3
+ export default _default
@@ -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,5 @@
1
+ import { Container } from '@dropins/tools/types/elsie/src/lib';
2
+ import { AddressesProps } from '../../types';
3
+
4
+ export declare const Addresses: Container<AddressesProps>;
5
+ //# sourceMappingURL=Addresses.d.ts.map
@@ -0,0 +1,3 @@
1
+ export * from './Addresses';
2
+ export { Addresses as default } from './Addresses';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,3 @@
1
+ export * from './Addresses/index'
2
+ import _default from './Addresses/index'
3
+ export default _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,5 @@
1
+ import { Container } from '@dropins/tools/types/elsie/src/lib';
2
+ import { OrdersListProps } from '../../types';
3
+
4
+ export declare const OrdersList: Container<OrdersListProps>;
5
+ //# sourceMappingURL=OrdersList.d.ts.map
@@ -0,0 +1,3 @@
1
+ export * from './OrdersList';
2
+ export { OrdersList as default } from './OrdersList';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,3 @@
1
+ export * from './OrdersList/index'
2
+ import _default from './OrdersList/index'
3
+ export default _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};
@@ -0,0 +1,4 @@
1
+ export * from './AddressForm';
2
+ export * from './Addresses';
3
+ export * from './OrdersList';
4
+ //# sourceMappingURL=index.d.ts.map