@dropins/storefront-account 0.1.0-alpha4 → 0.1.0-alpha6
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/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 +5 -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/getOrderHistoryList.graphql.d.ts +2 -0
- package/api/getOrderHistoryList/index.d.ts +2 -0
- package/api/getRegions/getRegions.d.ts +2 -0
- package/api/getRegions/graphql/getRegions.graphql.d.ts +2 -0
- package/api/getRegions/index.d.ts +2 -0
- package/api/index.d.ts +9 -0
- package/api/initialize/initialize.d.ts +4 -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.js +9 -1
- package/chunks/AddressFormWrapper.js +1 -0
- package/chunks/AddressFormWrapper2.js +1 -0
- package/chunks/checkIsFunction.js +1 -0
- package/chunks/convertCase.js +1 -0
- package/chunks/getOrderHistoryList.js +90 -0
- package/chunks/removeCustomerAddress.js +35 -0
- package/chunks/transform-customer-address.js +1 -0
- package/chunks/updateCustomerAddress.js +78 -0
- package/components/AccountLoaders/AccountLoaders.d.ts +7 -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 +5 -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 +96 -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 +45 -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 +5 -1
- package/data/models/order-history-list.d.ts +63 -0
- package/data/models/region.d.ts +10 -0
- package/data/transforms/index.d.ts +6 -1
- package/data/transforms/transform-attributes-form.d.ts +6 -0
- package/data/transforms/transform-countries.d.ts +6 -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/api/useCountryRegionOptions.d.ts +7 -0
- package/hooks/components/useForm.d.ts +12 -0
- package/hooks/containers/useAddressForm.d.ts +20 -0
- package/hooks/containers/useAddresses.d.ts +22 -0
- package/hooks/containers/useOrdersList.d.ts +11 -0
- package/hooks/useDebounce.d.ts +3 -0
- package/i18n/en_US.json.d.ts +85 -1
- 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/getFieldsConfig.d.ts +24 -0
- package/lib/getFormValues.d.ts +2 -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/serializeAddressForm.d.ts +4 -0
- package/package.json +1 -1
- package/render.js +3 -1
- package/types/addressForm.types.d.ts +41 -0
- package/types/addresses.types.d.ts +56 -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 +15 -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 +73 -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 +40 -0
- package/types/index.d.ts +16 -0
- package/types/ordersList.types.d.ts +49 -0
- package/types/translations.types.d.ts +9 -0
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export interface RegionsFormResponse {
|
|
2
|
+
data: {
|
|
3
|
+
country: {
|
|
4
|
+
id: string;
|
|
5
|
+
available_regions: {
|
|
6
|
+
id: number;
|
|
7
|
+
code: string;
|
|
8
|
+
name: string;
|
|
9
|
+
}[];
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
errors?: {
|
|
13
|
+
message: string;
|
|
14
|
+
}[];
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=getRegions.types.d.ts.map
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { SlotProps } from '@dropins/tools/types/elsie/src/src/lib';
|
|
2
|
+
import { AttributesFormModel, Country, FieldEnumList } from '../data/models';
|
|
3
|
+
|
|
4
|
+
export interface FieldsProps extends Omit<AttributesFormModel, 'options'> {
|
|
5
|
+
className?: string;
|
|
6
|
+
fieldType: FieldEnumList;
|
|
7
|
+
id: string;
|
|
8
|
+
options: Country[];
|
|
9
|
+
}
|
|
10
|
+
interface AddressFormInputsContext {
|
|
11
|
+
formActions: {
|
|
12
|
+
handleChange: (event: Event) => void;
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
export interface FormProps {
|
|
16
|
+
fieldsConfig: FieldsProps[] | [];
|
|
17
|
+
name?: string;
|
|
18
|
+
className?: string;
|
|
19
|
+
children?: any;
|
|
20
|
+
loading?: boolean;
|
|
21
|
+
onSubmit?: (event: SubmitEvent, isValid: boolean) => Promise<void | null | undefined>;
|
|
22
|
+
handleSetCountryCode: (value: string) => void;
|
|
23
|
+
slots?: {
|
|
24
|
+
AddressFormInputs?: SlotProps<AddressFormInputsContext>;
|
|
25
|
+
};
|
|
26
|
+
onChange?: (values: Record<string, FormDataEntryValue>, inputValue: Record<string, string>, event: Event) => void;
|
|
27
|
+
}
|
|
28
|
+
export interface useFormProps extends Omit<FormProps, 'children' | 'className' | 'name'> {
|
|
29
|
+
}
|
|
30
|
+
export interface FormInputsProps {
|
|
31
|
+
className?: string;
|
|
32
|
+
errors?: Record<string, string>;
|
|
33
|
+
values?: Record<string, string | number | boolean>;
|
|
34
|
+
fields?: any;
|
|
35
|
+
loading?: boolean;
|
|
36
|
+
onChange?: (event: Event) => void;
|
|
37
|
+
onBlur?: (event: Event) => void;
|
|
38
|
+
}
|
|
39
|
+
export {};
|
|
40
|
+
//# sourceMappingURL=form.types.d.ts.map
|
package/types/index.d.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export * from './addresses.types';
|
|
2
|
+
export * from './addressForm.types';
|
|
3
|
+
export * from './form.types';
|
|
4
|
+
export * from './api/createCustomerAddress.types';
|
|
5
|
+
export * from './api/getAttributesForm.types';
|
|
6
|
+
export * from './api/getCustomerAddress.type';
|
|
7
|
+
export * from './api/getCountries.types';
|
|
8
|
+
export * from './api/getRegions.types';
|
|
9
|
+
export * from './api/updateCustomerAddress.types';
|
|
10
|
+
export * from './api/getCustomer.types';
|
|
11
|
+
export * from './api/removeCustomerAddress.types';
|
|
12
|
+
export * from './api/getOrderHistoryList.types';
|
|
13
|
+
export * from './ordersList.types';
|
|
14
|
+
export * from './translations.types';
|
|
15
|
+
export * from './emptyList.types';
|
|
16
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { SlotProps } from '@dropins/tools/types/elsie/src/lib';
|
|
2
|
+
import { HTMLAttributes } from 'preact/compat';
|
|
3
|
+
import { OrderDetails } from '../data/models';
|
|
4
|
+
|
|
5
|
+
export interface OrdersListActionContext {
|
|
6
|
+
orderHistoryListItem: OrderDetails;
|
|
7
|
+
handleSelectId: (id: string) => void;
|
|
8
|
+
}
|
|
9
|
+
export interface OrdersListCardContext {
|
|
10
|
+
orderHistoryListItem: OrderDetails;
|
|
11
|
+
}
|
|
12
|
+
export interface OrdersListProps extends HTMLAttributes<HTMLDivElement> {
|
|
13
|
+
minifiedView?: boolean;
|
|
14
|
+
withHeader?: boolean;
|
|
15
|
+
withThumbnails?: boolean;
|
|
16
|
+
slots?: {
|
|
17
|
+
OrdersListAction?: SlotProps<OrdersListActionContext>;
|
|
18
|
+
OrdersListCard?: SlotProps<OrdersListCardContext>;
|
|
19
|
+
};
|
|
20
|
+
routeOrdersList?: () => string;
|
|
21
|
+
routeOrderDetails?: () => string;
|
|
22
|
+
withFilter?: boolean;
|
|
23
|
+
ordersInMinifiedView?: 1 | 2 | 3;
|
|
24
|
+
pageSize: number;
|
|
25
|
+
}
|
|
26
|
+
export interface OrdersListWrapperProps extends OrdersListProps {
|
|
27
|
+
}
|
|
28
|
+
export interface OrdersListCardProps extends HTMLAttributes<HTMLDivElement> {
|
|
29
|
+
minifiedView: boolean;
|
|
30
|
+
item: OrderDetails;
|
|
31
|
+
withThumbnails: boolean;
|
|
32
|
+
slots?: {
|
|
33
|
+
OrdersListCard?: SlotProps<OrdersListCardContext>;
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
export interface OrdersListActionProps {
|
|
37
|
+
minifiedView: boolean;
|
|
38
|
+
orderId?: string;
|
|
39
|
+
orderToken?: string;
|
|
40
|
+
onSelectId?: (id: string) => void;
|
|
41
|
+
routeOrdersList?: () => string;
|
|
42
|
+
routeOrderDetails?: (orderId?: string, orderToken?: string) => string;
|
|
43
|
+
}
|
|
44
|
+
export interface useOrdersListProps {
|
|
45
|
+
minifiedView?: boolean;
|
|
46
|
+
pageSize: number;
|
|
47
|
+
ordersInMinifiedView: number;
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=ordersList.types.d.ts.map
|