@dropins/storefront-account 0.1.0-alpha2 → 0.1.0-alpha21
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/fragments/CustomerFragment.graphql.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/getStoreConfig/getStoreConfig.d.ts +4 -0
- package/api/getStoreConfig/graphql/getStoreConfig.graphql.d.ts +2 -0
- package/api/getStoreConfig/index.d.ts +2 -0
- package/api/index.d.ts +16 -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/updateCustomer/graphql/updateCustomer.graphql.d.ts +2 -0
- package/api/updateCustomer/index.d.ts +2 -0
- package/api/updateCustomer/updateCustomer.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/updateCustomerEmail/graphql/updateCustomerEmail.graphql.d.ts +2 -0
- package/api/updateCustomerEmail/index.d.ts +2 -0
- package/api/updateCustomerEmail/updateCustomerEmail.d.ts +5 -0
- package/api/updateCustomerPassword/graphql/updateCustomerPassword.graphql.d.ts +2 -0
- package/api/updateCustomerPassword/index.d.ts +2 -0
- package/api/updateCustomerPassword/updateCustomerPassword.d.ts +4 -0
- package/api.d.ts +1 -0
- package/api.js +1 -2
- package/chunks/CustomerInformationCard.js +1 -0
- package/chunks/getOrderHistoryList.js +124 -0
- package/chunks/removeCustomerAddress.js +120 -0
- package/chunks/updateCustomer.js +57 -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/ChangePassword/ChangePassword.d.ts +5 -0
- package/components/ChangePassword/index.d.ts +3 -0
- package/components/CustomerInformationCard/CustomerInformationCard.d.ts +5 -0
- package/components/CustomerInformationCard/index.d.ts +3 -0
- package/components/EditCustomerInformation/EditCustomerInformation.d.ts +5 -0
- package/components/EditCustomerInformation/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 +16 -0
- package/configs/addressField.config.d.ts +39 -0
- package/configs/defaultAttributePreset.config.d.ts +3 -0
- package/configs/mockDefaultAddress.config.d.ts +153 -0
- package/configs/mockOrdersList.config.d.ts +205 -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/CustomerInformation/CustomerInformation.d.ts +5 -0
- package/containers/CustomerInformation/index.d.ts +3 -0
- package/containers/CustomerInformation.d.ts +3 -0
- package/containers/CustomerInformation.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 +5 -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 +14 -0
- package/data/models/index.d.ts +7 -0
- package/data/models/order-history-list.d.ts +80 -0
- package/data/models/region.d.ts +11 -0
- package/data/models/store-config.d.ts +5 -0
- package/data/transforms/index.d.ts +8 -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 +7 -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/data/transforms/transform-store-config.d.ts +5 -0
- package/hooks/components/useChangePassword.d.ts +26 -0
- package/hooks/components/useForm.d.ts +14 -0
- package/hooks/components/usePasswordValidationMessage.d.ts +16 -0
- package/hooks/containers/useAddressForm.d.ts +31 -0
- package/hooks/containers/useAddresses.d.ts +24 -0
- package/hooks/containers/useCustomerInformation.d.ts +50 -0
- package/hooks/containers/useGetStoreConfigs.d.ts +7 -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/useInLineAlert.d.ts +7 -0
- package/hooks/useIsMobile.d.ts +2 -0
- package/i18n/en_US.json.d.ts +170 -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/transformDefaultValuesAddresses.d.ts +11 -0
- package/lib/transformSessionData.d.ts +6 -0
- package/lib/validationChangePassword.d.ts +17 -0
- package/lib/validationFields.d.ts +33 -0
- package/lib/validationUniqueSymbolsPassword.d.ts +2 -0
- package/package.json +1 -1
- 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 -2
- package/types/addressForm.types.d.ts +46 -0
- package/types/addresses.types.d.ts +90 -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 +24 -0
- package/types/api/getCustomerAddress.type.d.ts +40 -0
- package/types/api/getOrderHistoryList.types.d.ts +91 -0
- package/types/api/getRegions.types.d.ts +16 -0
- package/types/api/removeCustomerAddress.types.d.ts +9 -0
- package/types/api/storeConfig.types.d.ts +13 -0
- package/types/api/updateCustomerAddress.types.d.ts +11 -0
- package/types/api/updateCustomerPassword.types.d.ts +15 -0
- package/types/customerInformation.types.d.ts +61 -0
- package/types/emptyList.types.d.ts +8 -0
- package/types/form.types.d.ts +56 -0
- package/types/index.d.ts +19 -0
- package/types/notification.types.d.ts +19 -0
- package/types/ordersList.types.d.ts +64 -0
- package/api.js.map +0 -1
- package/render.js.map +0 -1
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { UseChangePasswordProps } from '../../types';
|
|
2
|
+
|
|
3
|
+
export declare const DEFAULT_ERRORS_STATE: {
|
|
4
|
+
currentPassword: string;
|
|
5
|
+
newPassword: string;
|
|
6
|
+
confirmPassword: string;
|
|
7
|
+
};
|
|
8
|
+
export declare const useChangePassword: ({ passwordConfigs, handleSetInLineAlert, handleHideChangePassword, }: UseChangePasswordProps) => {
|
|
9
|
+
hideChangePassword: () => void;
|
|
10
|
+
handleOnBlurPassword: (event: Event) => void;
|
|
11
|
+
handleConfirmPasswordChange: (value: string) => void;
|
|
12
|
+
handleNewPasswordChange: (value: string) => void;
|
|
13
|
+
handleCurrentPasswordChange: (value: string) => void;
|
|
14
|
+
mutationChangePassword: (event: Event) => void;
|
|
15
|
+
currentPassword: string;
|
|
16
|
+
newPassword: string;
|
|
17
|
+
confirmPassword: string;
|
|
18
|
+
passwordErrors: {
|
|
19
|
+
currentPassword: string;
|
|
20
|
+
newPassword: string;
|
|
21
|
+
confirmPassword: string;
|
|
22
|
+
};
|
|
23
|
+
submitLoading: boolean;
|
|
24
|
+
isClickSubmit: boolean;
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=useChangePassword.d.ts.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { useFormProps } from '../../types';
|
|
2
|
+
|
|
3
|
+
export declare const useForm: ({ fieldsConfig, onSubmit, onChange, setInputChange, formName, isWaitingForResponse, }: useFormProps) => {
|
|
4
|
+
isDataValid: boolean;
|
|
5
|
+
formData: Record<string, string | number>;
|
|
6
|
+
errors: Record<string, string>;
|
|
7
|
+
formRef: import('preact').RefObject<HTMLFormElement>;
|
|
8
|
+
handleInputChange: (event: Event, errorsProp: Record<string, string>) => void;
|
|
9
|
+
onFocus: (event: Event) => void;
|
|
10
|
+
handleBlur: (event: Event, errorsProp: Record<string, string>) => void;
|
|
11
|
+
handleSubmit: (event: SubmitEvent) => void;
|
|
12
|
+
handleValidationSubmit: (disableShowError?: boolean) => boolean;
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=useForm.d.ts.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ValidateLengthConfigProps, statusTypes } from '../../types';
|
|
2
|
+
|
|
3
|
+
interface UsePasswordValidationMessageProps {
|
|
4
|
+
passwordConfigs: {
|
|
5
|
+
minLength: number;
|
|
6
|
+
requiredCharacterClasses: number;
|
|
7
|
+
} | null;
|
|
8
|
+
isClickSubmit: boolean;
|
|
9
|
+
password: string;
|
|
10
|
+
}
|
|
11
|
+
export declare const usePasswordValidationMessage: ({ passwordConfigs, isClickSubmit, password, }: UsePasswordValidationMessageProps) => {
|
|
12
|
+
isValidUniqueSymbols: statusTypes;
|
|
13
|
+
defaultLengthMessage: ValidateLengthConfigProps | undefined;
|
|
14
|
+
};
|
|
15
|
+
export {};
|
|
16
|
+
//# sourceMappingURL=usePasswordValidationMessage.d.ts.map
|
|
@@ -0,0 +1,31 @@
|
|
|
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
|
+
isWaitingForResponse: boolean;
|
|
9
|
+
regionOptions: [] | RegionTransform[];
|
|
10
|
+
saveCheckBoxAddress: boolean;
|
|
11
|
+
inLineAlert: {
|
|
12
|
+
text: string;
|
|
13
|
+
type: 'success' | 'warning' | 'error';
|
|
14
|
+
icon?: VNode<HTMLAttributes<SVGSVGElement>> | undefined;
|
|
15
|
+
};
|
|
16
|
+
addressId: string;
|
|
17
|
+
submitLoading: boolean;
|
|
18
|
+
normalizeFieldsConfig: {
|
|
19
|
+
customUpperCode: string;
|
|
20
|
+
defaultValue?: string | number | boolean | undefined;
|
|
21
|
+
options?: any[] | undefined;
|
|
22
|
+
required?: boolean | undefined;
|
|
23
|
+
disabled?: boolean | undefined;
|
|
24
|
+
}[];
|
|
25
|
+
handleSaveCheckBoxAddress: (event: Event) => void;
|
|
26
|
+
handleUpdateAddress: (event: Event, valid: boolean) => Promise<void | null | undefined>;
|
|
27
|
+
handleCreateAddress: (event: Event, valid: boolean) => Promise<void | null | undefined>;
|
|
28
|
+
handleOnCloseForm: () => void;
|
|
29
|
+
handleInputChange: (values: Record<string, string | number | boolean>) => void;
|
|
30
|
+
};
|
|
31
|
+
//# 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,50 @@
|
|
|
1
|
+
import { UseCustomerInformationProps } from '../../types';
|
|
2
|
+
|
|
3
|
+
export declare const useCustomerInformation: ({ handleSetInLineAlert, }: UseCustomerInformationProps) => {
|
|
4
|
+
createdAt: string;
|
|
5
|
+
errorPasswordEmpty: boolean;
|
|
6
|
+
passwordValue: string;
|
|
7
|
+
showPasswordOnEmailChange: boolean;
|
|
8
|
+
orderedCustomerData: {
|
|
9
|
+
name: string;
|
|
10
|
+
orderNumber: number | undefined;
|
|
11
|
+
value: any;
|
|
12
|
+
label: string | null | undefined;
|
|
13
|
+
}[];
|
|
14
|
+
loading: boolean;
|
|
15
|
+
normalizeFieldsConfig: {
|
|
16
|
+
defaultValue: any;
|
|
17
|
+
code?: string | undefined;
|
|
18
|
+
name?: string | undefined;
|
|
19
|
+
id?: string | undefined;
|
|
20
|
+
required?: boolean | undefined;
|
|
21
|
+
label?: string | undefined;
|
|
22
|
+
options?: {
|
|
23
|
+
is_default: boolean;
|
|
24
|
+
label: string;
|
|
25
|
+
value: string;
|
|
26
|
+
}[] | undefined;
|
|
27
|
+
entityType?: string | undefined;
|
|
28
|
+
className?: string | undefined;
|
|
29
|
+
fieldType?: import('../../data/models').FieldEnumList | undefined;
|
|
30
|
+
multilineCount?: number | undefined;
|
|
31
|
+
isUnique?: boolean | undefined;
|
|
32
|
+
orderNumber: number;
|
|
33
|
+
isHidden?: boolean | undefined;
|
|
34
|
+
customUpperCode: string;
|
|
35
|
+
validateRules: Record<string, string>[];
|
|
36
|
+
}[];
|
|
37
|
+
submitLoading: boolean;
|
|
38
|
+
showEditForm: boolean;
|
|
39
|
+
showChangePassword: boolean;
|
|
40
|
+
handleShowChangePassword: () => void;
|
|
41
|
+
handleHideChangePassword: (clearStates?: () => void) => void;
|
|
42
|
+
handleShowEditForm: () => void;
|
|
43
|
+
handleHideEditForm: (clearStates?: () => void) => void;
|
|
44
|
+
handleUpdateCustomerInformation: (event: Event, valid: boolean) => Promise<void>;
|
|
45
|
+
handleInputChange: (value: Record<string, string | number | boolean>) => void;
|
|
46
|
+
handleSetPassword: (value: string) => void;
|
|
47
|
+
handleOnBlurPassword: (event: Event) => void;
|
|
48
|
+
renderAlertMessage: (type: 'success' | 'error', message?: string) => void;
|
|
49
|
+
};
|
|
50
|
+
//# sourceMappingURL=useCustomerInformation.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,170 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
"Account": {
|
|
3
|
+
"minifiedView": {
|
|
4
|
+
"CustomerInformation": {
|
|
5
|
+
"containerTitle": "Account settings",
|
|
6
|
+
"genderMale":"Male",
|
|
7
|
+
"genderFemale":"Female",
|
|
8
|
+
"changePassword": {
|
|
9
|
+
"passwordValidationMessage": {
|
|
10
|
+
"chartTwoSymbols": "Use characters and numbers or symbols",
|
|
11
|
+
"chartThreeSymbols": "Use characters, numbers and symbols",
|
|
12
|
+
"chartFourSymbols": "Use uppercase characters, lowercase characters, numbers and symbols",
|
|
13
|
+
"messageLengthPassword": "At least {minLength} characters long",
|
|
14
|
+
"passwordMismatch": "Passwords do not match. Please make sure both password fields are identical",
|
|
15
|
+
"incorrectCurrentPassword": "The current password you entered is incorrect. Please check and try again.",
|
|
16
|
+
"passwordUpdateMessage": "Your password has been updated"
|
|
17
|
+
},
|
|
18
|
+
"containerTitle": "Change password",
|
|
19
|
+
"currentPassword": {
|
|
20
|
+
"placeholder": "Password",
|
|
21
|
+
"floatingLabel": "Password"
|
|
22
|
+
},
|
|
23
|
+
"newPassword": {
|
|
24
|
+
"placeholder": "New Password",
|
|
25
|
+
"floatingLabel": "New Password"
|
|
26
|
+
},
|
|
27
|
+
"confirmPassword": {
|
|
28
|
+
"placeholder": "Confirm new password",
|
|
29
|
+
"floatingLabel": "Confirm new password"
|
|
30
|
+
},
|
|
31
|
+
"buttonSecondary": "Cancel",
|
|
32
|
+
"buttonPrimary": "Save"
|
|
33
|
+
},
|
|
34
|
+
"customerInformationCard": {
|
|
35
|
+
"buttonSecondary": "Change password",
|
|
36
|
+
"buttonPrimary": "Edit",
|
|
37
|
+
"accountCreation": "Account creation date"
|
|
38
|
+
},
|
|
39
|
+
"editCustomerInformation": {
|
|
40
|
+
"containerTitle": "Edit details",
|
|
41
|
+
"buttonSecondary": "Cancel",
|
|
42
|
+
"buttonPrimary": "Save",
|
|
43
|
+
"accountSuccess": "Your account information has been updated.",
|
|
44
|
+
"accountError": "Your account information has not been updated.",
|
|
45
|
+
"passwordField": {
|
|
46
|
+
"placeholder": "Password",
|
|
47
|
+
"floatingLabel": "Password"
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
"Addresses": {
|
|
52
|
+
"containerTitle": "Addresses",
|
|
53
|
+
"editAddressFormTitle": "Edit address",
|
|
54
|
+
"differentAddressFormTitle": "Deliver to new address",
|
|
55
|
+
"viewAllAddressesButton": "View address list",
|
|
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": "Recent orders",
|
|
73
|
+
"viewAllOrdersButton": "View all orders",
|
|
74
|
+
"ariaLabelLink": "Redirect to full order information",
|
|
75
|
+
"dateOrderPlaced": "Date order placed",
|
|
76
|
+
"OrdersListCard": {
|
|
77
|
+
"orderNumber": "Order number:",
|
|
78
|
+
"itemsAmount": "items",
|
|
79
|
+
"carrier": "Carrier:",
|
|
80
|
+
"returns": "Return(s):",
|
|
81
|
+
"orderDate": "Placed on"
|
|
82
|
+
},
|
|
83
|
+
"OrdersListSelectDate": {
|
|
84
|
+
"pastSixMonths": "Past 6 months",
|
|
85
|
+
"currentYear": "Current year",
|
|
86
|
+
"viewAll": "View all"
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
"EmptyList": {
|
|
90
|
+
"Addresses": {
|
|
91
|
+
"message": "No saved addresses"
|
|
92
|
+
},
|
|
93
|
+
"OrdersList": {
|
|
94
|
+
"message": "No orders"
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
},
|
|
98
|
+
"fullSizeView": {
|
|
99
|
+
"Addresses": {
|
|
100
|
+
"containerTitle": "Addresses",
|
|
101
|
+
"editAddressFormTitle": "Edit address",
|
|
102
|
+
"differentAddressFormTitle": "Deliver to new address",
|
|
103
|
+
"newAddressFormTitle": "Add address",
|
|
104
|
+
"addNewAddressButton": "Create new",
|
|
105
|
+
"differentAddressButton": "Use a different address",
|
|
106
|
+
"addressCard": {
|
|
107
|
+
"actionRemove": "Remove",
|
|
108
|
+
"actionEdit": "Edit",
|
|
109
|
+
"cardLabelShipping": "Shipping",
|
|
110
|
+
"cardLabelBilling": "Billing",
|
|
111
|
+
"defaultLabelText": "DEFAULT"
|
|
112
|
+
},
|
|
113
|
+
"removeAddressModal": {
|
|
114
|
+
"title": "Remove address",
|
|
115
|
+
"description": "Are you sure you would like to remove this address?",
|
|
116
|
+
"actionCancel": "Cancel",
|
|
117
|
+
"actionConfirm": "Remove"
|
|
118
|
+
}
|
|
119
|
+
},
|
|
120
|
+
"OrdersList": {
|
|
121
|
+
"containerTitle": "Your orders",
|
|
122
|
+
"ariaLabelLink": "Redirect to full order information",
|
|
123
|
+
"dateOrderPlaced": "Date order placed",
|
|
124
|
+
"OrdersListCard": {
|
|
125
|
+
"orderNumber": "Order number:",
|
|
126
|
+
"itemsAmount": "items",
|
|
127
|
+
"carrier": "Carrier:",
|
|
128
|
+
"returns": "Return(s):",
|
|
129
|
+
"orderDate": "Placed on"
|
|
130
|
+
},
|
|
131
|
+
"OrdersListSelectDate": {
|
|
132
|
+
"pastSixMonths": "Past 6 months",
|
|
133
|
+
"currentYear": "Current year",
|
|
134
|
+
"viewAll": "View all"
|
|
135
|
+
}
|
|
136
|
+
},
|
|
137
|
+
"EmptyList": {
|
|
138
|
+
"Addresses": {
|
|
139
|
+
"message": "No saved addresses"
|
|
140
|
+
},
|
|
141
|
+
"OrdersList": {
|
|
142
|
+
"message": "No orders"
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
},
|
|
146
|
+
"AddressForm": {
|
|
147
|
+
"formText": {
|
|
148
|
+
"secondaryButton": "Cancel",
|
|
149
|
+
"primaryButton": "Save",
|
|
150
|
+
"defaultShippingLabel": "Set as default shipping address",
|
|
151
|
+
"defaultBillingLabel": "Set as default billing address",
|
|
152
|
+
"saveAddressBook": "Save in address book"
|
|
153
|
+
}
|
|
154
|
+
},
|
|
155
|
+
"FormText": {
|
|
156
|
+
"requiredFieldError": "This is a required field.",
|
|
157
|
+
"numericError": "Only numeric values are allowed.",
|
|
158
|
+
"alphaNumWithSpacesError": "Only alphanumeric characters and spaces are allowed.",
|
|
159
|
+
"alphaNumericError": "Only alphanumeric characters are allowed.",
|
|
160
|
+
"alphaError": "Only alphabetic characters are allowed.",
|
|
161
|
+
"emailError": "Please enter a valid email address.",
|
|
162
|
+
"dateError": "Please enter a valid date.",
|
|
163
|
+
"dateLengthError": "Date must be between {min} and {max}.",
|
|
164
|
+
"urlError": "Please enter a valid URL, e.g., http://www.adobe.com.",
|
|
165
|
+
"lengthTextError": "Text length must be between {min} and {max} characters."
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
};
|
|
169
|
+
|
|
170
|
+
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
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { CustomerAddressesModel } from '../data/models';
|
|
2
|
+
|
|
3
|
+
type CustomAttributesType = {
|
|
4
|
+
customAttributes?: {
|
|
5
|
+
code: string;
|
|
6
|
+
value: string;
|
|
7
|
+
}[];
|
|
8
|
+
};
|
|
9
|
+
export declare const transformDefaultValuesAddresses: (address?: CustomerAddressesModel & CustomAttributesType) => CustomerAddressesModel;
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=transformDefaultValuesAddresses.d.ts.map
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
interface PasswordValidationParams {
|
|
2
|
+
currentPassword: string;
|
|
3
|
+
newPassword: string;
|
|
4
|
+
confirmPassword: string;
|
|
5
|
+
translations: Record<string, string>;
|
|
6
|
+
}
|
|
7
|
+
interface PasswordErrors {
|
|
8
|
+
currentPassword: string;
|
|
9
|
+
newPassword: string;
|
|
10
|
+
confirmPassword: string;
|
|
11
|
+
}
|
|
12
|
+
export declare const validationChangePassword: ({ currentPassword, newPassword, confirmPassword, translations, }: PasswordValidationParams) => {
|
|
13
|
+
isValid: boolean;
|
|
14
|
+
errors: PasswordErrors;
|
|
15
|
+
};
|
|
16
|
+
export {};
|
|
17
|
+
//# sourceMappingURL=validationChangePassword.d.ts.map
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
type TranslationList = Record<string, string>;
|
|
2
|
+
type ErrorsList = Record<string, string>;
|
|
3
|
+
export type ValidationFieldsConfig = {
|
|
4
|
+
validateRules: Record<string, string>[];
|
|
5
|
+
code?: string;
|
|
6
|
+
customUpperCode: string;
|
|
7
|
+
required: boolean;
|
|
8
|
+
};
|
|
9
|
+
export declare enum InputValidation {
|
|
10
|
+
Numeric = "numeric",
|
|
11
|
+
AlphanumWithSpaces = "alphanum-with-spaces",
|
|
12
|
+
Alphanumeric = "alphanumeric",
|
|
13
|
+
Alpha = "alpha",
|
|
14
|
+
Email = "email",
|
|
15
|
+
Length = "length",
|
|
16
|
+
Date = "date",
|
|
17
|
+
Url = "url"
|
|
18
|
+
}
|
|
19
|
+
export declare const validateNumeric: (value: string) => boolean;
|
|
20
|
+
export declare const validateAlphanumWithSpaces: (value: string) => boolean;
|
|
21
|
+
export declare const validateAlphanumeric: (value: string) => boolean;
|
|
22
|
+
export declare const validateAlpha: (value: string) => boolean;
|
|
23
|
+
export declare const validateEmail: (value: string) => boolean;
|
|
24
|
+
export declare const validateDate: (value: string) => boolean;
|
|
25
|
+
export declare const isDateWithinRange: (date: string, minTimestamp: number, maxTimestamp: number) => boolean;
|
|
26
|
+
export declare const convertTimestampToDate: (timestamp: string) => string;
|
|
27
|
+
export declare const validateUrl: (url: string) => boolean;
|
|
28
|
+
export declare const validateLength: (value: string, minLength: number, maxLength: number) => boolean;
|
|
29
|
+
export declare const validationFields: (value: string, configs: ValidationFieldsConfig, translations: TranslationList, errorsList: ErrorsList) => {
|
|
30
|
+
[x: string]: string;
|
|
31
|
+
};
|
|
32
|
+
export {};
|
|
33
|
+
//# sourceMappingURL=validationFields.d.ts.map
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name": "@dropins/storefront-account", "version": "0.1.0-
|
|
1
|
+
{"name": "@dropins/storefront-account", "version": "0.1.0-alpha21", "@dropins/elsie": "0.34.0"}
|