@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,46 @@
|
|
|
1
|
+
export declare enum FieldEnumList {
|
|
2
|
+
BOOLEAN = "BOOLEAN",
|
|
3
|
+
DATE = "DATE",
|
|
4
|
+
DATETIME = "DATETIME",
|
|
5
|
+
DROPDOWN = "DROPDOWN",
|
|
6
|
+
FILE = "FILE",
|
|
7
|
+
GALLERY = "GALLERY",
|
|
8
|
+
HIDDEN = "HIDDEN",
|
|
9
|
+
IMAGE = "IMAGE",
|
|
10
|
+
MEDIA_IMAGE = "MEDIA_IMAGE",
|
|
11
|
+
MULTILINE = "MULTILINE",
|
|
12
|
+
MULTISELECT = "MULTISELECT",
|
|
13
|
+
PRICE = "PRICE",
|
|
14
|
+
SELECT = "SELECT",
|
|
15
|
+
TEXT = "TEXT",
|
|
16
|
+
TEXTAREA = "TEXTAREA",
|
|
17
|
+
UNDEFINED = "UNDEFINED",
|
|
18
|
+
VISUAL = "VISUAL",
|
|
19
|
+
WEIGHT = "WEIGHT",
|
|
20
|
+
EMPTY = ""
|
|
21
|
+
}
|
|
22
|
+
export interface AttributesFormItemsProps {
|
|
23
|
+
code?: string;
|
|
24
|
+
name?: string;
|
|
25
|
+
id?: string;
|
|
26
|
+
required?: boolean;
|
|
27
|
+
label?: string;
|
|
28
|
+
options?: {
|
|
29
|
+
is_default: boolean;
|
|
30
|
+
label: string;
|
|
31
|
+
value: string;
|
|
32
|
+
}[];
|
|
33
|
+
entityType?: string;
|
|
34
|
+
className?: string;
|
|
35
|
+
defaultValue?: string | boolean | number;
|
|
36
|
+
fieldType?: FieldEnumList;
|
|
37
|
+
multilineCount?: number;
|
|
38
|
+
isUnique?: boolean;
|
|
39
|
+
orderNumber: number;
|
|
40
|
+
isHidden?: boolean;
|
|
41
|
+
customUpperCode: string;
|
|
42
|
+
validateRules: Record<string, string>[];
|
|
43
|
+
}
|
|
44
|
+
export interface AttributesFormModel extends AttributesFormItemsProps {
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=attributes-form.d.ts.map
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export interface CustomerAddressesModel {
|
|
2
|
+
firstName?: string;
|
|
3
|
+
lastName?: string;
|
|
4
|
+
city?: string;
|
|
5
|
+
company?: string;
|
|
6
|
+
countryCode?: string;
|
|
7
|
+
region?: {
|
|
8
|
+
region: string;
|
|
9
|
+
regionCode: string;
|
|
10
|
+
regionId: string | number;
|
|
11
|
+
};
|
|
12
|
+
telephone?: string;
|
|
13
|
+
id?: string;
|
|
14
|
+
vatId?: string;
|
|
15
|
+
postcode?: string;
|
|
16
|
+
street?: string;
|
|
17
|
+
streetMultiline_2?: string;
|
|
18
|
+
defaultShipping?: boolean;
|
|
19
|
+
defaultBilling?: boolean;
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=customer-address.d.ts.map
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { CustomerAddressesModel } from './customer-address';
|
|
2
|
+
|
|
3
|
+
export type ProductImage = {
|
|
4
|
+
url: string;
|
|
5
|
+
};
|
|
6
|
+
export type Product = {
|
|
7
|
+
smallImage: ProductImage;
|
|
8
|
+
};
|
|
9
|
+
export type OrderItem = {
|
|
10
|
+
quantityOrdered?: number;
|
|
11
|
+
quantityShipped?: number;
|
|
12
|
+
quantityInvoiced?: number;
|
|
13
|
+
status: string;
|
|
14
|
+
productName: string;
|
|
15
|
+
id: string;
|
|
16
|
+
product: Product;
|
|
17
|
+
};
|
|
18
|
+
export type PaymentMethod = {
|
|
19
|
+
name: string;
|
|
20
|
+
};
|
|
21
|
+
export type MoneyAmount = {
|
|
22
|
+
value: number;
|
|
23
|
+
currency: string;
|
|
24
|
+
};
|
|
25
|
+
export type Discount = {
|
|
26
|
+
amount: MoneyAmount;
|
|
27
|
+
label: string;
|
|
28
|
+
};
|
|
29
|
+
export type Tax = {
|
|
30
|
+
amount: MoneyAmount;
|
|
31
|
+
rate: number;
|
|
32
|
+
title: string;
|
|
33
|
+
};
|
|
34
|
+
export type OrderTotals = {
|
|
35
|
+
discounts: Discount[];
|
|
36
|
+
grandTotal: MoneyAmount;
|
|
37
|
+
subtotal: MoneyAmount;
|
|
38
|
+
taxes: Tax[];
|
|
39
|
+
totalTax: MoneyAmount;
|
|
40
|
+
totalShipping: MoneyAmount;
|
|
41
|
+
};
|
|
42
|
+
export type ShipmentsTracingModel = {
|
|
43
|
+
carrier: string;
|
|
44
|
+
number: string;
|
|
45
|
+
title: string;
|
|
46
|
+
};
|
|
47
|
+
export type ShipmentsModel = {
|
|
48
|
+
id: string;
|
|
49
|
+
number: string;
|
|
50
|
+
tracking: ShipmentsTracingModel[];
|
|
51
|
+
};
|
|
52
|
+
export type OrderDetails = {
|
|
53
|
+
status: string;
|
|
54
|
+
token: string;
|
|
55
|
+
carrier: string;
|
|
56
|
+
email: string;
|
|
57
|
+
id: string;
|
|
58
|
+
number: string;
|
|
59
|
+
orderDate: string;
|
|
60
|
+
items: OrderItem[];
|
|
61
|
+
shipments: ShipmentsModel[];
|
|
62
|
+
paymentMethods: PaymentMethod[];
|
|
63
|
+
shippingAddress: CustomerAddressesModel;
|
|
64
|
+
billingAddress: CustomerAddressesModel;
|
|
65
|
+
total: OrderTotals;
|
|
66
|
+
};
|
|
67
|
+
export type PaginationInfo = {
|
|
68
|
+
currentPage: number;
|
|
69
|
+
pageSize: number;
|
|
70
|
+
totalPages: number;
|
|
71
|
+
};
|
|
72
|
+
export interface OrderHistory {
|
|
73
|
+
items: OrderDetails[];
|
|
74
|
+
pageInfo: PaginationInfo;
|
|
75
|
+
totalCount: number;
|
|
76
|
+
dateOfFirstOrder: string;
|
|
77
|
+
}
|
|
78
|
+
//# sourceMappingURL=order-history-list.d.ts.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export * from './transform-attributes-form';
|
|
2
|
+
export * from './transform-customer-address';
|
|
3
|
+
export * from './transform-customer';
|
|
4
|
+
export * from './transform-countries';
|
|
5
|
+
export * from './transform-regions';
|
|
6
|
+
export * from './transform-order-history-list';
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { GetAttributesFormResponse, ResponseAttributesFormItemsProps } from '../../types';
|
|
2
|
+
import { AttributesFormModel } from '../models';
|
|
3
|
+
|
|
4
|
+
export declare const cloneArrayIfExists: (fields: ResponseAttributesFormItemsProps[]) => any;
|
|
5
|
+
export declare const transformAttributesForm: (response: GetAttributesFormResponse) => AttributesFormModel[];
|
|
6
|
+
//# sourceMappingURL=transform-attributes-form.d.ts.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { CountriesFormResponse } from '../../types';
|
|
2
|
+
import { Country } from '../models';
|
|
3
|
+
|
|
4
|
+
export declare const transformCountries: (response: CountriesFormResponse) => {
|
|
5
|
+
availableCountries: Country[] | [
|
|
6
|
+
];
|
|
7
|
+
countriesWithRequiredRegion: string[];
|
|
8
|
+
optionalZipCountries: string[];
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=transform-countries.d.ts.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { CustomerAddressesModel } from '../models';
|
|
2
|
+
import { AddressResponse, UserAddressesProps } from '../../types';
|
|
3
|
+
|
|
4
|
+
export declare const expandArraysInObject: (inputObject: UserAddressesProps) => Record<string, unknown>;
|
|
5
|
+
export declare const transformSingleAddress: (addressData: UserAddressesProps) => CustomerAddressesModel;
|
|
6
|
+
export declare const transformMultipleAddresses: (response: AddressResponse) => CustomerAddressesModel[] | [
|
|
7
|
+
];
|
|
8
|
+
//# sourceMappingURL=transform-customer-address.d.ts.map
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { getCustomerShortResponse } from '../../types';
|
|
2
|
+
import { CustomerDataModelShort } from '../models/customer';
|
|
3
|
+
|
|
4
|
+
export declare const transformCustomer: (response: getCustomerShortResponse) => CustomerDataModelShort;
|
|
5
|
+
//# sourceMappingURL=transform-customer.d.ts.map
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { OrderHistoryListResponse } from '../../types';
|
|
2
|
+
import { OrderHistory } from '../models';
|
|
3
|
+
|
|
4
|
+
export declare const transformOrderHistoryList: (response: OrderHistoryListResponse) => OrderHistory | null;
|
|
5
|
+
//# sourceMappingURL=transform-order-history-list.d.ts.map
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { useFormProps } from '../../types';
|
|
2
|
+
|
|
3
|
+
export declare const useForm: ({ fieldsConfig, onSubmit, onChange, setInputChange, formName, }: useFormProps) => {
|
|
4
|
+
formData: Record<string, string | number>;
|
|
5
|
+
errors: Record<string, string>;
|
|
6
|
+
formRef: import('preact').RefObject<HTMLFormElement>;
|
|
7
|
+
handleInputChange: (event: Event) => void;
|
|
8
|
+
onFocus: (event: Event) => void;
|
|
9
|
+
handleBlur: (event: Event) => void;
|
|
10
|
+
handleSubmit: (event: SubmitEvent) => void;
|
|
11
|
+
handleValidationSubmit: (disableShowError?: boolean) => boolean;
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=useForm.d.ts.map
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { CustomerAddressesModel, RegionTransform } from '../../data/models';
|
|
2
|
+
import { useAddressFormProps } from '../../types';
|
|
3
|
+
import { VNode } from 'preact';
|
|
4
|
+
import { HTMLAttributes } from 'preact/compat';
|
|
5
|
+
|
|
6
|
+
export declare const findNonEmptyObject: (obj1: Record<string, unknown> | undefined, obj2: CustomerAddressesModel | undefined) => CustomerAddressesModel | Record<string, unknown>;
|
|
7
|
+
export declare const useAddressForm: ({ showFormLoader, showSaveCheckBox, saveCheckBoxValue, addressFormId, billingCheckBoxValue, shippingCheckBoxValue, showShippingCheckBox, showBillingCheckBox, inputsDefaultValueSet, onCloseBtnClick, onSuccess, onError, formName, }: useAddressFormProps) => {
|
|
8
|
+
regionOptions: [] | RegionTransform[];
|
|
9
|
+
saveCheckBoxAddress: boolean;
|
|
10
|
+
inLineAlert: {
|
|
11
|
+
text: string;
|
|
12
|
+
type: 'success' | 'warning' | 'error';
|
|
13
|
+
icon?: VNode<HTMLAttributes<SVGSVGElement>> | undefined;
|
|
14
|
+
};
|
|
15
|
+
addressId: string;
|
|
16
|
+
submitLoading: boolean;
|
|
17
|
+
normalizeFieldsConfig: {
|
|
18
|
+
customUpperCode: string;
|
|
19
|
+
defaultValue?: string | number | boolean | undefined;
|
|
20
|
+
options?: any[] | undefined;
|
|
21
|
+
required?: boolean | undefined;
|
|
22
|
+
disabled?: boolean | undefined;
|
|
23
|
+
}[];
|
|
24
|
+
handleSaveCheckBoxAddress: (event: Event) => void;
|
|
25
|
+
handleUpdateAddress: (event: Event, valid: boolean) => Promise<null | undefined>;
|
|
26
|
+
handleCreateAddress: (event: Event, valid: boolean) => Promise<void>;
|
|
27
|
+
handleOnCloseForm: () => void;
|
|
28
|
+
handleInputChange: (values: Record<string, string | number | boolean>) => void;
|
|
29
|
+
};
|
|
30
|
+
//# sourceMappingURL=useAddressForm.d.ts.map
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { CustomerAddressesModel } from '../../data/models';
|
|
2
|
+
import { KeysSortOrderProps, useAddressesProps } from '../../types';
|
|
3
|
+
|
|
4
|
+
export declare const useAddresses: ({ selectShipping, selectBilling, defaultSelectAddressId, onAddressData, minifiedView, routeAddressesPage, onSuccess, }: useAddressesProps) => {
|
|
5
|
+
keysSortOrder: [] | KeysSortOrderProps[];
|
|
6
|
+
submitLoading: boolean;
|
|
7
|
+
isModalRendered: boolean;
|
|
8
|
+
isFormRendered: boolean;
|
|
9
|
+
loading: boolean;
|
|
10
|
+
addNewAddress: boolean;
|
|
11
|
+
addressesList: CustomerAddressesModel[];
|
|
12
|
+
addressId: string;
|
|
13
|
+
handleRenderForm: () => void;
|
|
14
|
+
handleRenderModal: () => void;
|
|
15
|
+
removeAddress: () => Promise<void>;
|
|
16
|
+
onCloseBtnClick: () => void;
|
|
17
|
+
setEditingAddressId: (id: string) => void;
|
|
18
|
+
closeNewAddressForm: () => void;
|
|
19
|
+
redirectToAddressesRoute: () => void;
|
|
20
|
+
handleOnSuccess: () => Promise<void>;
|
|
21
|
+
handleSelectAddressOption: (event: Event, item?: {} | CustomerAddressesModel | undefined) => void;
|
|
22
|
+
selectedAddressOption: string;
|
|
23
|
+
};
|
|
24
|
+
//# sourceMappingURL=useAddresses.d.ts.map
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare const useOrderSelectList: () => {
|
|
2
|
+
selectableDateList: {
|
|
3
|
+
value: string;
|
|
4
|
+
text: string;
|
|
5
|
+
}[];
|
|
6
|
+
selectedDate: string;
|
|
7
|
+
selectedPage: number;
|
|
8
|
+
handleSelectDate: (event: Event) => void;
|
|
9
|
+
setSelectedPage: import('preact/hooks').Dispatch<import('preact/hooks').StateUpdater<number>>;
|
|
10
|
+
handleSetFirstOrderDate: (date: string) => void;
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=useOrderSelectList.d.ts.map
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { OrderDetails } from '../../data/models';
|
|
2
|
+
import { UseOrdersListProps } from '../../types';
|
|
3
|
+
|
|
4
|
+
export declare const useOrdersList: ({ ordersInMinifiedView, minifiedView, pageSize, selectedDate, selectedPage, handleSetFirstOrderDate, }: UseOrdersListProps) => {
|
|
5
|
+
loading: boolean;
|
|
6
|
+
orderHistoryListItems: OrderDetails[];
|
|
7
|
+
pageInfo: {
|
|
8
|
+
totalPages: number;
|
|
9
|
+
currentPage: number;
|
|
10
|
+
pageSize: number;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=useOrdersList.d.ts.map
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
"Account": {
|
|
3
|
+
"minifiedView": {
|
|
4
|
+
"Addresses": {
|
|
5
|
+
"containerTitle": "Addresses",
|
|
6
|
+
"editAddressFormTitle": "Edit address",
|
|
7
|
+
"differentAddressFormTitle": "Deliver to new address",
|
|
8
|
+
"viewAllAddressesButton": "View address list",
|
|
9
|
+
"differentAddressButton": "Use a different address",
|
|
10
|
+
"addressCard": {
|
|
11
|
+
"actionRemove": "Remove",
|
|
12
|
+
"actionEdit": "Edit",
|
|
13
|
+
"cardLabelShipping": "Shipping",
|
|
14
|
+
"cardLabelBilling": "Billing",
|
|
15
|
+
"defaultLabelText": "DEFAULT"
|
|
16
|
+
},
|
|
17
|
+
"removeAddressModal": {
|
|
18
|
+
"title": "Remove address",
|
|
19
|
+
"description": "Are you sure you would like to remove this address?",
|
|
20
|
+
"actionCancel": "Cancel",
|
|
21
|
+
"actionConfirm": "Remove"
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
"OrdersList": {
|
|
25
|
+
"containerTitle": "Recent orders",
|
|
26
|
+
"viewAllOrdersButton": "View all orders",
|
|
27
|
+
"ariaLabelLink": "Redirect to full order information",
|
|
28
|
+
"OrdersListCard": {
|
|
29
|
+
"orderNumber": "Order number:",
|
|
30
|
+
"itemsAmount": "items",
|
|
31
|
+
"carrier": "Carrier:",
|
|
32
|
+
"orderDate": "Placed on"
|
|
33
|
+
},
|
|
34
|
+
"OrdersListSelectDate": {
|
|
35
|
+
"pastSixMonths": "Past 6 months",
|
|
36
|
+
"currentYear": "Current year",
|
|
37
|
+
"viewAll": "View all"
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
"EmptyList": {
|
|
41
|
+
"Addresses": {
|
|
42
|
+
"message": "No saved addresses"
|
|
43
|
+
},
|
|
44
|
+
"OrdersList": {
|
|
45
|
+
"message": "No orders"
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
"fullSizeView": {
|
|
50
|
+
"Addresses": {
|
|
51
|
+
"containerTitle": "Addresses",
|
|
52
|
+
"editAddressFormTitle": "Edit address",
|
|
53
|
+
"differentAddressFormTitle": "Deliver to new address",
|
|
54
|
+
"newAddressFormTitle": "Add address",
|
|
55
|
+
"addNewAddressButton": "Create new",
|
|
56
|
+
"differentAddressButton": "Use a different address",
|
|
57
|
+
"addressCard": {
|
|
58
|
+
"actionRemove": "Remove",
|
|
59
|
+
"actionEdit": "Edit",
|
|
60
|
+
"cardLabelShipping": "Shipping",
|
|
61
|
+
"cardLabelBilling": "Billing",
|
|
62
|
+
"defaultLabelText": "DEFAULT"
|
|
63
|
+
},
|
|
64
|
+
"removeAddressModal": {
|
|
65
|
+
"title": "Remove address",
|
|
66
|
+
"description": "Are you sure you would like to remove this address?",
|
|
67
|
+
"actionCancel": "Cancel",
|
|
68
|
+
"actionConfirm": "Remove"
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
"OrdersList": {
|
|
72
|
+
"containerTitle": "Your orders",
|
|
73
|
+
"ariaLabelLink": "Redirect to full order information",
|
|
74
|
+
"OrdersListCard": {
|
|
75
|
+
"orderNumber": "Order number:",
|
|
76
|
+
"itemsAmount": "items",
|
|
77
|
+
"carrier": "Carrier:",
|
|
78
|
+
"orderDate": "Placed on"
|
|
79
|
+
},
|
|
80
|
+
"OrdersListSelectDate": {
|
|
81
|
+
"pastSixMonths": "Past 6 months",
|
|
82
|
+
"currentYear": "Current year",
|
|
83
|
+
"viewAll": "View all"
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
"EmptyList": {
|
|
87
|
+
"Addresses": {
|
|
88
|
+
"message": "No saved addresses"
|
|
89
|
+
},
|
|
90
|
+
"OrdersList": {
|
|
91
|
+
"message": "No orders"
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
"AddressForm": {
|
|
96
|
+
"formText": {
|
|
97
|
+
"secondaryButton": "Cancel",
|
|
98
|
+
"primaryButton": "Save",
|
|
99
|
+
"defaultShippingLabel": "Set as default shipping address",
|
|
100
|
+
"defaultBillingLabel": "Set as default billing address",
|
|
101
|
+
"saveAddressBook": "Save in address book"
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
"FormText": {
|
|
105
|
+
"requiredFieldError": "This is a required field.",
|
|
106
|
+
"numericError": "Only numeric values are allowed.",
|
|
107
|
+
"alphaNumWithSpacesError": "Only alphanumeric characters and spaces are allowed.",
|
|
108
|
+
"alphaNumericError": "Only alphanumeric characters are allowed.",
|
|
109
|
+
"alphaError": "Only alphabetic characters are allowed.",
|
|
110
|
+
"emailError": "Please enter a valid email address.",
|
|
111
|
+
"dateError": "Please enter a valid date.",
|
|
112
|
+
"dateLengthError": "Date must be between {min} and {max}.",
|
|
113
|
+
"urlError": "Please enter a valid URL, e.g., http://www.adobe.com.",
|
|
114
|
+
"lengthTextError": "Text length must be between {min} and {max} characters."
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
export default _default;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const convertToCamelCase: (key: string) => string;
|
|
2
|
+
export declare const convertToSnakeCase: (key: string) => string;
|
|
3
|
+
export declare const convertKeysCase: (data: any, type: 'snakeCase' | 'camelCase', dictionary?: Record<string, string>) => any;
|
|
4
|
+
//# sourceMappingURL=convertCase.d.ts.map
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Formats a date string according to a specified locale and options.
|
|
3
|
+
* Returns "Invalid Date" if the input date string is invalid.
|
|
4
|
+
*
|
|
5
|
+
* @param {string} date - The date string to be formatted.
|
|
6
|
+
* @param {string} [locale='en-US'] - The locale to use for formatting. Defaults to 'en-US'.
|
|
7
|
+
* @param {Intl.DateTimeFormatOptions} [options={}] - Optional formatting options to customize the output.
|
|
8
|
+
* @returns {string} The formatted date string, or "Invalid Date" if the input is invalid.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* // Default formatting (en-US locale, MM/DD/YYYY)
|
|
12
|
+
* console.log(formatDateToLocale('2023-08-29'));
|
|
13
|
+
* // Output: "08/29/2023"
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* // Formatting with a specified locale (e.g., en-GB for DD/MM/YYYY)
|
|
17
|
+
* console.log(formatDateToLocale('2023-08-29', 'en-GB'));
|
|
18
|
+
* // Output: "29/08/2023"
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* // Formatting with a specified locale and custom options (e.g., de-DE with long month format)
|
|
22
|
+
* console.log(formatDateToLocale('2023-08-29', 'de-DE', { month: 'long', year: 'numeric' }));
|
|
23
|
+
* // Output: "29. August 2023"
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* // Handling an invalid date string
|
|
27
|
+
* console.log(formatDateToLocale('invalid-date'));
|
|
28
|
+
* // Output: "Invalid Date"
|
|
29
|
+
*/
|
|
30
|
+
export declare const formatDateToLocale: (date: string, locale?: string, options?: Intl.DateTimeFormatOptions) => string;
|
|
31
|
+
//# sourceMappingURL=formatDateToLocale.d.ts.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export interface FilterDateProps {
|
|
2
|
+
from: string;
|
|
3
|
+
to: string;
|
|
4
|
+
}
|
|
5
|
+
export declare const getDateRange: (key: 'sixMonthsAgo' | 'oneYearAgo' | '', numberRange?: number) => FilterDateProps | '';
|
|
6
|
+
export declare const addYearsToList: (startYear: number) => {
|
|
7
|
+
value: string;
|
|
8
|
+
text: string;
|
|
9
|
+
}[];
|
|
10
|
+
//# sourceMappingURL=getDateRange.d.ts.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
declare const _default: (fieldsConfig: Array<{
|
|
2
|
+
customUpperCode?: string;
|
|
3
|
+
required?: boolean;
|
|
4
|
+
defaultValue?: unknown;
|
|
5
|
+
}>) => {
|
|
6
|
+
initialData: Record<string, unknown>;
|
|
7
|
+
errorList: Record<string, string>;
|
|
8
|
+
};
|
|
9
|
+
export default _default;
|
|
10
|
+
//# sourceMappingURL=initializeFormDataAndErrors.d.ts.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { CustomerAddressesModel } from '../data/models';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
|
|
5
|
+
Manages the deletion of an address from a list. If the address is the last one in the list, it removes any default properties before deletion. If the address is not the last, it ensures that no default properties are set on the item, transfers them if necessary to another address, and then deletes the address.
|
|
6
|
+
|
|
7
|
+
*/
|
|
8
|
+
export declare const manageAddressDeletion: (removeId: string, addressesList: CustomerAddressesModel[]) => Promise<boolean>;
|
|
9
|
+
//# sourceMappingURL=manageAddressDeletion.d.ts.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
declare const dictionary: Record<string, string>;
|
|
2
|
+
export declare const groupMultilineFields: (inputObj: Record<string, any>) => Record<string, any>;
|
|
3
|
+
export declare const separateKeys: (inputData: Record<string, any>) => Record<keyof typeof dictionary, unknown>;
|
|
4
|
+
declare const _default: (fields?: Record<string, any>, isForm?: boolean) => Record<string, unknown>;
|
|
5
|
+
export default _default;
|
|
6
|
+
//# sourceMappingURL=normalizeGetAddressData.d.ts.map
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Country, RegionTransform } from '../data/models';
|
|
2
|
+
|
|
3
|
+
type Field = {
|
|
4
|
+
customUpperCode: string;
|
|
5
|
+
defaultValue?: string | boolean | number;
|
|
6
|
+
options?: any[];
|
|
7
|
+
required?: boolean;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
};
|
|
10
|
+
interface ProcessFieldsProps {
|
|
11
|
+
fields: Field[];
|
|
12
|
+
countryOptions: Country[];
|
|
13
|
+
regionOptions: RegionTransform[];
|
|
14
|
+
isRequiredRegion: boolean;
|
|
15
|
+
isRequiredPostCode: boolean;
|
|
16
|
+
disableField: boolean;
|
|
17
|
+
addressId?: string | number;
|
|
18
|
+
}
|
|
19
|
+
declare const _default: ({ fields, addressId, countryOptions, disableField, regionOptions, isRequiredRegion, isRequiredPostCode, }: ProcessFieldsProps) => Field[];
|
|
20
|
+
export default _default;
|
|
21
|
+
//# sourceMappingURL=prepareNormalizedData.d.ts.map
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { CustomerAddressesModel } from '../data/models';
|
|
2
|
+
|
|
3
|
+
declare const _default: (data: CustomerAddressesModel[], selectShipping: boolean, selectBilling: boolean) => CustomerAddressesModel[];
|
|
4
|
+
export default _default;
|
|
5
|
+
//# sourceMappingURL=sortingAddressesList.d.ts.map
|