@ikas/storefront 0.0.14 → 0.0.16-0.alpha-1
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/build/__generated__/global-types.d.ts +214 -8
- package/build/analytics/analytics.d.ts +22 -0
- package/build/analytics/facebookPixel.d.ts +15 -0
- package/build/analytics/googleTagManager.d.ts +201 -0
- package/build/analytics/head/index.d.ts +7 -0
- package/build/analytics/index.d.ts +2 -0
- package/build/api/blog/__generated__/getBlog.d.ts +83 -0
- package/build/api/blog/__generated__/listBlog.d.ts +86 -0
- package/build/api/blog/__generated__/listBlogCategory.d.ts +38 -0
- package/build/api/blog/__generated__/listBlogMetaData.d.ts +29 -0
- package/build/api/blog/index.d.ts +32 -0
- package/build/api/brand/__generated__/listProductBrand.d.ts +3 -2
- package/build/api/brand/index.d.ts +1 -0
- package/build/api/cart/__generated__/getCart.d.ts +7 -3
- package/build/api/cart/__generated__/saveItemToCart.d.ts +6 -3
- package/build/api/category/__generated__/listCategory.d.ts +4 -2
- package/build/api/category/__generated__/listCategoryPaths.d.ts +23 -0
- package/build/api/category/index.d.ts +3 -0
- package/build/api/checkout/__generated__/checkStocks.d.ts +3 -3
- package/build/api/checkout/__generated__/getCheckoutByCartId.d.ts +1 -1
- package/build/api/checkout/__generated__/getCheckoutById.d.ts +5 -4
- package/build/api/checkout/__generated__/listCheckoutSettings.d.ts +26 -0
- package/build/api/checkout/__generated__/listPaymentGateway.d.ts +14 -2
- package/build/api/checkout/__generated__/saveCheckout.d.ts +1 -1
- package/build/api/checkout/index.d.ts +11 -3
- package/build/api/city/__generated__/listCity.d.ts +1 -1
- package/build/api/contact-form/__generated__/sendContactFormToMerchant.d.ts +9 -0
- package/build/api/contact-form/index.d.ts +10 -0
- package/build/api/country/__generated__/getAvailableShippingCountries.d.ts +3 -0
- package/build/api/country/__generated__/getMyCountry.d.ts +3 -0
- package/build/api/country/__generated__/listCountry.d.ts +8 -1
- package/build/api/country/index.d.ts +3 -2
- package/build/api/customer/__generated__/createCustomerEmailSubscription.d.ts +11 -0
- package/build/api/customer/__generated__/createOrderRefundRequest.d.ts +215 -0
- package/build/api/customer/__generated__/customerLogin.d.ts +5 -3
- package/build/api/customer/__generated__/getCustomerOrders.d.ts +3 -4
- package/build/api/customer/__generated__/getLastViewedProducts.d.ts +15 -0
- package/build/api/customer/__generated__/getMyCustomer.d.ts +3 -2
- package/build/api/customer/__generated__/listOrderTransactions.d.ts +1 -1
- package/build/api/customer/__generated__/registerCustomer.d.ts +2 -2
- package/build/api/customer/__generated__/saveLastViewedProducts.d.ts +11 -0
- package/build/api/customer/__generated__/saveMyCustomer.d.ts +3 -2
- package/build/api/customer/index.d.ts +15 -0
- package/build/api/district/__generated__/listDistrict.d.ts +1 -1
- package/build/api/favorite-product/__generated__/isFavoriteProduct.d.ts +6 -0
- package/build/api/favorite-product/__generated__/listFavoriteProducts.d.ts +12 -0
- package/build/api/favorite-product/__generated__/saveFavoriteProduct.d.ts +7 -0
- package/build/api/favorite-product/index.d.ts +6 -0
- package/build/api/html-meta-data/__generated__/listHTMLMetaData.d.ts +2 -1
- package/build/api/html-meta-data/index.d.ts +1 -1
- package/build/api/index.d.ts +4 -3
- package/build/api/merchant/__generated__/listMerchantSettings.d.ts +1 -1
- package/build/api/product-attribute/__generated__/listProductAttribute.d.ts +2 -2
- package/build/api/product-search/__generated__/getProductFilterData.d.ts +50 -0
- package/build/api/product-search/__generated__/searchProducts.d.ts +26 -0
- package/build/api/product-search/index.d.ts +20 -0
- package/build/api/state/__generated__/listState.d.ts +1 -1
- package/build/api/stock-location/__generated__/listStockLocation.d.ts +1 -1
- package/build/api/storefront/__generated__/getStorefront.d.ts +41 -12
- package/build/api/storefront/index.d.ts +1 -1
- package/build/api/variant-type/__generated__/listVariantType.d.ts +2 -2
- package/build/components/checkout/components/address-form/index.d.ts +3 -0
- package/build/components/checkout/components/address-form/model.d.ts +13 -2
- package/build/components/checkout/components/button/index.d.ts +4 -1
- package/build/components/checkout/components/cart-summary/cross.d.ts +6 -0
- package/build/components/checkout/components/cart-summary/tag.d.ts +6 -0
- package/build/components/checkout/components/checkbox/index.d.ts +2 -1
- package/build/components/checkout/components/error-container/customer-login-required-error/index.d.ts +6 -0
- package/build/components/checkout/components/error-container/payment-error/index.d.ts +2 -0
- package/build/components/checkout/components/form-item/model.d.ts +11 -2
- package/build/components/checkout/index.d.ts +5 -0
- package/build/components/checkout/model.d.ts +23 -10
- package/build/components/hoc/ThemeComponent.d.ts +2 -2
- package/build/components/image/index.d.ts +35 -0
- package/build/components/index.d.ts +1 -2
- package/build/components/page/head.d.ts +5 -0
- package/build/components/page/index.d.ts +6 -1
- package/build/components/page-editor/model.d.ts +6 -2
- package/build/index.d.ts +1 -0
- package/build/index.es.js +17677 -9251
- package/build/index.js +18351 -9889
- package/build/models/data/blog/index.d.ts +67 -0
- package/build/models/data/brand/index.d.ts +1 -1
- package/build/models/data/cart/index.d.ts +9 -0
- package/build/models/data/category/index.d.ts +22 -1
- package/build/models/data/checkout/index.d.ts +5 -0
- package/build/models/data/checkout-settings/index.d.ts +18 -0
- package/build/models/data/contact-form/index.d.ts +7 -0
- package/build/models/data/country/index.d.ts +2 -0
- package/build/models/data/customer/index.d.ts +7 -0
- package/build/models/data/favorite-product/index.d.ts +6 -0
- package/build/models/data/image/index.d.ts +1 -0
- package/build/models/data/index.d.ts +5 -1
- package/build/models/data/order/address/index.d.ts +6 -0
- package/build/models/data/order/index.d.ts +19 -1
- package/build/models/data/order/line-item/index.d.ts +18 -0
- package/build/models/data/order/refund/index.d.ts +6 -0
- package/build/models/data/order/refund/refund-line-item/index.d.ts +5 -0
- package/build/models/data/payment-gateway/index.d.ts +26 -2
- package/build/models/data/product/attribute-value/index.d.ts +15 -1
- package/build/models/data/product/index.d.ts +2 -1
- package/build/models/data/product/variant/index.d.ts +1 -0
- package/build/models/data/product/variant/price/index.d.ts +2 -0
- package/build/models/data/product-attribute/index.d.ts +5 -2
- package/build/models/data/product-attribute/product-attribute-table-cell/index.d.ts +5 -0
- package/build/models/data/product-attribute/product-attribute-table-template/index.d.ts +6 -0
- package/build/models/data/product-filter/index.d.ts +102 -0
- package/build/models/data/product-tag/index.d.ts +5 -0
- package/build/models/data/sales-channel/index.d.ts +18 -0
- package/build/models/data/simple-product/index.d.ts +135 -0
- package/build/models/data/storefront/{storefront-domain → domain}/index.d.ts +1 -0
- package/build/models/data/storefront/index.d.ts +17 -6
- package/build/models/data/storefront/localization/index.d.ts +7 -0
- package/build/models/data/storefront/routing/index.d.ts +9 -0
- package/build/models/data/storefront/theme/index.d.ts +13 -0
- package/build/models/data/storefront/theme-localization/index.d.ts +12 -0
- package/build/models/data/variant-type/variant-value/index.d.ts +1 -1
- package/build/models/theme/component/prop/index.d.ts +17 -1
- package/build/models/theme/custom-data/index.d.ts +24 -0
- package/build/models/theme/index.d.ts +4 -0
- package/build/models/theme/page/component/prop-value/attribute-list.d.ts +7 -0
- package/build/models/theme/page/component/prop-value/attribute.d.ts +7 -0
- package/build/models/theme/page/component/prop-value/blog-list.d.ts +9 -0
- package/build/models/theme/page/component/prop-value/blog.d.ts +5 -0
- package/build/models/theme/page/component/prop-value/product-list.d.ts +2 -0
- package/build/models/theme/page/index.d.ts +14 -1
- package/build/models/theme/settings/index.d.ts +7 -0
- package/build/models/theme/settings/prop/color/index.d.ts +7 -0
- package/build/models/theme/settings/prop/favicon/index.d.ts +4 -0
- package/build/models/theme/theme.d.ts +4 -0
- package/build/models/ui/blog-list/index.d.ts +56 -0
- package/build/models/ui/brand-list/index.d.ts +3 -0
- package/build/models/ui/category-list/index.d.ts +3 -0
- package/build/models/ui/component-renderer/index.d.ts +7 -0
- package/build/models/ui/index.d.ts +12 -2
- package/build/models/ui/product-detail/index.d.ts +14 -3
- package/build/models/ui/product-list/index.d.ts +62 -14
- package/build/models/ui/validator/form/account-info.d.ts +40 -0
- package/build/models/ui/validator/form/address.d.ts +75 -0
- package/build/models/ui/validator/form/contact-form.d.ts +45 -0
- package/build/models/ui/validator/form/forgot-password.d.ts +29 -0
- package/build/models/ui/validator/form/login.d.ts +35 -0
- package/build/models/ui/validator/form/recover-password.d.ts +36 -0
- package/build/models/ui/validator/form/register.d.ts +45 -0
- package/build/models/ui/validator/index.d.ts +27 -0
- package/build/models/ui/validator/rules/index.d.ts +87 -0
- package/build/pages/404.d.ts +13 -0
- package/build/pages/[slug]/index.d.ts +9 -3
- package/build/pages/account/addresses.d.ts +2 -0
- package/build/pages/account/favorite-products.d.ts +12 -0
- package/build/pages/account/forgot-password.d.ts +3 -0
- package/build/pages/account/index.d.ts +2 -0
- package/build/pages/account/login.d.ts +3 -0
- package/build/pages/account/orders/[id].d.ts +2 -0
- package/build/pages/account/orders/index.d.ts +2 -0
- package/build/pages/account/recover-password.d.ts +3 -0
- package/build/pages/account/register.d.ts +3 -0
- package/build/pages/blog/[slug].d.ts +18 -0
- package/build/pages/blog/index.d.ts +13 -0
- package/build/pages/cart.d.ts +12 -0
- package/build/pages/checkout/[id].d.ts +5 -0
- package/build/pages/home.d.ts +3 -0
- package/build/pages/index.d.ts +8 -2
- package/build/pages/{[slug]/[secondSlug].d.ts → pages/[slug].d.ts} +2 -0
- package/build/pages/search.d.ts +13 -0
- package/build/store/base.d.ts +17 -0
- package/build/store/customer.d.ts +31 -1
- package/build/storefront/index.d.ts +29 -3
- package/build/utils/helper.d.ts +1 -0
- package/build/utils/index.d.ts +1 -0
- package/build/utils/providers/page-data.d.ts +62 -5
- package/build/utils/providers/placeholders.d.ts +5 -0
- package/build/utils/providers/prop-value/attribute-list.d.ts +9 -0
- package/build/utils/providers/prop-value/attribute.d.ts +9 -0
- package/build/utils/providers/prop-value/blog-list.d.ts +9 -0
- package/build/utils/providers/prop-value/blog.d.ts +8 -0
- package/build/utils/providers/prop-value/boolean.d.ts +1 -1
- package/build/utils/providers/prop-value/category.d.ts +2 -2
- package/build/utils/providers/prop-value/color.d.ts +6 -0
- package/build/utils/providers/prop-value/custom.d.ts +40 -0
- package/build/utils/providers/prop-value/product-detail.d.ts +2 -2
- package/build/utils/providers/prop-value/product-list.d.ts +1 -3
- package/build/utils/providers/prop-value/rich-text.d.ts +6 -0
- package/build/utils/settings.d.ts +168 -0
- package/package.json +3 -3
- package/build/api/product/__generated__/listProduct.d.ts +0 -90
- package/build/api/product/index.d.ts +0 -15
- package/build/api/product-stock-location/__generated__/listProductStockLocation.d.ts +0 -13
- package/build/api/product-stock-location/index.d.ts +0 -4
- package/build/api/theme/index.d.ts +0 -4
- package/build/components/gtm/functions.d.ts +0 -164
- package/build/components/gtm/index.d.ts +0 -7
- package/build/models/data/storefront/stockfront-location/index.d.ts +0 -5
- package/build/models/data/storefront/stockfront-route/index.d.ts +0 -5
- package/build/models/data/storefront/storefront-region/index.d.ts +0 -18
- package/build/models/ui/product-list/filter.d.ts +0 -18
|
@@ -1,60 +1,107 @@
|
|
|
1
|
-
import { IkasProductListPropValue } from "../../theme/index";
|
|
1
|
+
import { IkasProductListPropValue, IkasThemePageType } from "../../theme/index";
|
|
2
2
|
import { IkasProductDetail } from "../product-detail/index";
|
|
3
|
-
import {
|
|
3
|
+
import { IkasProductFilter } from "../../data/product-filter/index";
|
|
4
|
+
import { NextRouter } from "next/router";
|
|
5
|
+
import { IkasFilterCategory } from "../../data/category/index";
|
|
4
6
|
export declare class IkasProductList {
|
|
5
7
|
data: IkasProductDetail[];
|
|
8
|
+
filters?: IkasProductFilter[] | null;
|
|
9
|
+
private _filterCategories?;
|
|
6
10
|
private _type;
|
|
11
|
+
private _pageType;
|
|
7
12
|
private _sort;
|
|
8
13
|
private _limit;
|
|
9
14
|
private _page;
|
|
15
|
+
private _infiniteScrollPage;
|
|
10
16
|
private _count;
|
|
17
|
+
private _searchKeyword;
|
|
11
18
|
private _initialized;
|
|
12
19
|
private _minPage?;
|
|
13
20
|
private _productListPropValue;
|
|
14
|
-
private
|
|
21
|
+
private _filterBrandId?;
|
|
22
|
+
private _filterCategoryId?;
|
|
15
23
|
private _recommendFor?;
|
|
16
24
|
private _isLoading;
|
|
17
|
-
|
|
25
|
+
private _fetchRequestTime;
|
|
26
|
+
private router?;
|
|
27
|
+
constructor(data: IkasProductListParams, router?: NextRouter);
|
|
18
28
|
get sort(): IkasProductListSortType;
|
|
19
29
|
get limit(): number;
|
|
30
|
+
get pageType(): IkasThemePageType;
|
|
20
31
|
get page(): number;
|
|
32
|
+
get minPage(): number;
|
|
21
33
|
get count(): number;
|
|
34
|
+
get pageCount(): number;
|
|
35
|
+
get searchKeyword(): string;
|
|
36
|
+
set searchKeyword(value: string);
|
|
22
37
|
get isInitialized(): boolean;
|
|
38
|
+
get isFilterable(): boolean;
|
|
39
|
+
get isFiltered(): boolean | undefined;
|
|
23
40
|
get isStatic(): boolean;
|
|
24
41
|
get isDiscounted(): boolean;
|
|
25
42
|
get isRecommended(): boolean;
|
|
43
|
+
get isLastViewed(): boolean;
|
|
44
|
+
get isSearch(): boolean;
|
|
26
45
|
get hasPrev(): boolean;
|
|
27
46
|
get hasNext(): boolean;
|
|
28
47
|
get isLoading(): boolean;
|
|
29
|
-
|
|
48
|
+
get filterQueryParams(): string;
|
|
49
|
+
get filterCategories(): IkasFilterCategory[] | undefined;
|
|
50
|
+
get hasAppliedfilter(): boolean | undefined;
|
|
51
|
+
private getSortParams;
|
|
52
|
+
private searchProducts;
|
|
53
|
+
private getFilters;
|
|
54
|
+
private applyQueryParamFilters;
|
|
55
|
+
private applyFacets;
|
|
56
|
+
private applyFilters;
|
|
57
|
+
clearFilters(): void;
|
|
58
|
+
private getInitial;
|
|
30
59
|
getPrev: () => Promise<void>;
|
|
31
60
|
getNext: () => Promise<void>;
|
|
32
61
|
getPage: (page: number) => Promise<void>;
|
|
33
|
-
|
|
62
|
+
setSortType(sortType: IkasProductListSortType): Promise<void>;
|
|
63
|
+
onFilterCategoryClick(filterCategory: IkasFilterCategory, disableRoute?: boolean): Promise<void>;
|
|
34
64
|
toJSON(): {
|
|
35
65
|
data: IkasProductDetail[];
|
|
36
66
|
type: IkasProductListType;
|
|
67
|
+
pageType: IkasThemePageType;
|
|
37
68
|
sort: IkasProductListSortType;
|
|
38
69
|
limit: number;
|
|
39
70
|
page: number;
|
|
40
71
|
count: number;
|
|
72
|
+
searchKeyword: string;
|
|
41
73
|
initialized: boolean;
|
|
42
74
|
minPage: number | null | undefined;
|
|
43
|
-
|
|
75
|
+
filterBrandId: string | null | undefined;
|
|
76
|
+
filterCategoryId: string | null | undefined;
|
|
77
|
+
filterCategories: IkasFilterCategory[] | null | undefined;
|
|
78
|
+
filters: IkasProductFilter[] | null | undefined;
|
|
44
79
|
recommendFor: string | null | undefined;
|
|
45
80
|
productListPropValue: IkasProductListPropValue;
|
|
46
81
|
};
|
|
82
|
+
setVisibleInfiniteScrollPage: (page: number) => void;
|
|
83
|
+
private restoreInfiniteScrollPage;
|
|
84
|
+
private getQueryParams;
|
|
85
|
+
private isBrowser;
|
|
86
|
+
private waitForCustomerStoreInit;
|
|
87
|
+
private searchDebouncer;
|
|
88
|
+
private analyticsDebouncer;
|
|
47
89
|
}
|
|
48
90
|
export declare type IkasProductListParams = {
|
|
49
91
|
data?: IkasProductDetail[];
|
|
50
92
|
type?: IkasProductListType;
|
|
93
|
+
pageType: IkasThemePageType;
|
|
51
94
|
sort?: IkasProductListSortType;
|
|
52
95
|
limit?: number;
|
|
53
96
|
page?: number;
|
|
54
97
|
count?: number;
|
|
98
|
+
searchKeyword?: string;
|
|
55
99
|
initialized?: boolean;
|
|
56
100
|
minPage?: number;
|
|
57
|
-
|
|
101
|
+
filterBrandId?: string;
|
|
102
|
+
filterCategoryId?: string;
|
|
103
|
+
filters?: IkasProductFilter[];
|
|
104
|
+
filterCategories?: IkasFilterCategory[];
|
|
58
105
|
recommendFor?: string;
|
|
59
106
|
productListPropValue: IkasProductListPropValue;
|
|
60
107
|
};
|
|
@@ -62,15 +109,16 @@ export declare enum IkasProductListType {
|
|
|
62
109
|
ALL = "ALL",
|
|
63
110
|
STATIC = "STATIC",
|
|
64
111
|
DISCOUNTED = "DISCOUNTED",
|
|
65
|
-
RECOMMENDED = "RECOMMENDED"
|
|
112
|
+
RECOMMENDED = "RECOMMENDED",
|
|
113
|
+
CATEGORY = "CATEGORY",
|
|
114
|
+
SEARCH = "SEARCH",
|
|
115
|
+
LAST_VIEWED = "LAST_VIEWED"
|
|
66
116
|
}
|
|
67
117
|
export declare enum IkasProductListSortType {
|
|
68
|
-
MOST_SOLD = "MOST_SOLD",
|
|
69
|
-
FEATURED = "FEATURED",
|
|
70
118
|
INCREASING_PRICE = "INCREASING_PRICE",
|
|
71
119
|
DECREASING_PRICE = "DECREASING_PRICE",
|
|
72
|
-
A_Z = "A_Z",
|
|
73
|
-
Z_A = "Z_A",
|
|
74
120
|
LAST_ADDED = "LAST_ADDED",
|
|
75
|
-
FIRST_ADDED = "FIRST_ADDED"
|
|
121
|
+
FIRST_ADDED = "FIRST_ADDED",
|
|
122
|
+
INCREASING_DISCOUNT = "INCREASING_DISCOUNT",
|
|
123
|
+
DECRASING_DISCOUNT = "DECRASING_DISCOUNT"
|
|
76
124
|
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { PhoneRule, RequiredRule } from "../rules/index";
|
|
2
|
+
import { IkasBaseStore } from "../../../../store/index";
|
|
3
|
+
import { IkasCustomer } from "../../../index";
|
|
4
|
+
declare type AccountInfoFormPropsValidatorMessage<T> = {
|
|
5
|
+
requiredRule: ((model: T) => string) | string;
|
|
6
|
+
phoneRule?: ((model: T) => string) | string;
|
|
7
|
+
};
|
|
8
|
+
declare type AccountInfoFormProps<T> = {
|
|
9
|
+
message: AccountInfoFormPropsValidatorMessage<T>;
|
|
10
|
+
customer: IkasCustomer;
|
|
11
|
+
store: IkasBaseStore;
|
|
12
|
+
};
|
|
13
|
+
export declare class AccountInfoForm {
|
|
14
|
+
private customer;
|
|
15
|
+
private validator;
|
|
16
|
+
private store;
|
|
17
|
+
private message;
|
|
18
|
+
constructor(props: AccountInfoFormProps<IkasCustomer>);
|
|
19
|
+
validatorRules: (includePhoneRule?: boolean) => (RequiredRule<IkasCustomer> | PhoneRule<IkasCustomer>)[];
|
|
20
|
+
get hasError(): boolean;
|
|
21
|
+
get email(): string;
|
|
22
|
+
get firstName(): string;
|
|
23
|
+
set firstName(value: string);
|
|
24
|
+
get lastName(): string;
|
|
25
|
+
set lastName(value: string);
|
|
26
|
+
get phone(): string;
|
|
27
|
+
set phone(value: string);
|
|
28
|
+
get firstNameErrorMessage(): string | undefined;
|
|
29
|
+
get lastNameErrorMessage(): string | undefined;
|
|
30
|
+
get phoneErrorMessage(): string | undefined;
|
|
31
|
+
onFirstNameChange: (value: string) => void;
|
|
32
|
+
onLastNameChange: (value: string) => void;
|
|
33
|
+
onPhoneChange: (value: string) => void;
|
|
34
|
+
validateAll(): Promise<boolean>;
|
|
35
|
+
submit(): Promise<{
|
|
36
|
+
isFormError: boolean;
|
|
37
|
+
isSuccess: boolean;
|
|
38
|
+
}>;
|
|
39
|
+
}
|
|
40
|
+
export {};
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { IkasCity, IkasCountry, IkasCustomerAddress, IkasDistrict, IkasState } from "../../../data/index";
|
|
2
|
+
import { IkasBaseStore } from "../../../../store/index";
|
|
3
|
+
import { PhoneRule, RequiredRule } from "../rules/index";
|
|
4
|
+
declare type AddressFormPropsValidatorMessage<T> = {
|
|
5
|
+
requiredRule: ((model: T) => string) | string;
|
|
6
|
+
phoneRule?: ((model: T) => string) | string;
|
|
7
|
+
};
|
|
8
|
+
declare type AddressFormProps<T> = {
|
|
9
|
+
message: AddressFormPropsValidatorMessage<T>;
|
|
10
|
+
address: IkasCustomerAddress;
|
|
11
|
+
store: IkasBaseStore;
|
|
12
|
+
};
|
|
13
|
+
export declare class AddressForm {
|
|
14
|
+
address: IkasCustomerAddress;
|
|
15
|
+
countries: IkasCountry[];
|
|
16
|
+
states: IkasState[];
|
|
17
|
+
cities: IkasCity[];
|
|
18
|
+
districts: IkasDistrict[];
|
|
19
|
+
private _isCountriesPending;
|
|
20
|
+
private _isStatesPending;
|
|
21
|
+
private _isCitiesPending;
|
|
22
|
+
private _isDistrictsPending;
|
|
23
|
+
private store;
|
|
24
|
+
private validator;
|
|
25
|
+
private message;
|
|
26
|
+
constructor(props: AddressFormProps<IkasCustomerAddress>);
|
|
27
|
+
validatorRules: (includePhoneRule?: boolean) => (RequiredRule<IkasCustomerAddress> | PhoneRule<IkasCustomerAddress>)[];
|
|
28
|
+
onTitleChange: (value: string) => void;
|
|
29
|
+
onFirstNameChange: (value: string) => void;
|
|
30
|
+
onLastNameChange: (value: string) => void;
|
|
31
|
+
onPhoneChange: (value: string) => void;
|
|
32
|
+
onAddressLine1Change: (value: string) => void;
|
|
33
|
+
onAddressLine2Change: (value: string) => void;
|
|
34
|
+
onAddressPostalCodeChange: (value: string) => void;
|
|
35
|
+
onCountryChange: (countryId: string) => void;
|
|
36
|
+
onStateChange: (stateId: string) => void;
|
|
37
|
+
onCityChange: (cityId: string) => void;
|
|
38
|
+
onDistrictChange: (districtId: string) => void;
|
|
39
|
+
onDistrictInputChange: (value: string) => void;
|
|
40
|
+
listCountries: () => Promise<void>;
|
|
41
|
+
listStates: () => Promise<void>;
|
|
42
|
+
listCities: () => Promise<void>;
|
|
43
|
+
listDistricts: () => Promise<void>;
|
|
44
|
+
get isEdit(): boolean;
|
|
45
|
+
private get editingAddressIndex();
|
|
46
|
+
get countryOptions(): {
|
|
47
|
+
label: string;
|
|
48
|
+
value: string;
|
|
49
|
+
}[];
|
|
50
|
+
get stateOptions(): {
|
|
51
|
+
label: string;
|
|
52
|
+
value: string;
|
|
53
|
+
}[];
|
|
54
|
+
get cityOptions(): {
|
|
55
|
+
label: string;
|
|
56
|
+
value: string;
|
|
57
|
+
}[];
|
|
58
|
+
get districtOptions(): {
|
|
59
|
+
label: string;
|
|
60
|
+
value: string;
|
|
61
|
+
}[];
|
|
62
|
+
get hasState(): boolean;
|
|
63
|
+
get isCountriesPending(): boolean;
|
|
64
|
+
get isStatesPending(): boolean;
|
|
65
|
+
get isCitiesPending(): boolean;
|
|
66
|
+
get isDistrictsPending(): boolean;
|
|
67
|
+
get hasValidatorError(): boolean;
|
|
68
|
+
get results(): import("../index").ValidationResults;
|
|
69
|
+
validateAll: () => Promise<boolean>;
|
|
70
|
+
submit: () => Promise<{
|
|
71
|
+
isFormError: boolean;
|
|
72
|
+
isSuccess: boolean;
|
|
73
|
+
}>;
|
|
74
|
+
}
|
|
75
|
+
export {};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { IkasBaseStore } from "../../../../store/index";
|
|
2
|
+
declare type ContactFormProps<T> = {
|
|
3
|
+
message: {
|
|
4
|
+
requiredRule: ((model: T) => string) | string;
|
|
5
|
+
emailRule: ((model: T) => string) | string;
|
|
6
|
+
minRule: ((model: T) => string) | string;
|
|
7
|
+
};
|
|
8
|
+
store: IkasBaseStore;
|
|
9
|
+
};
|
|
10
|
+
declare type ContactFormModel = {
|
|
11
|
+
firstName: string;
|
|
12
|
+
lastName: string;
|
|
13
|
+
email: string;
|
|
14
|
+
message: string;
|
|
15
|
+
};
|
|
16
|
+
export declare class ContactForm {
|
|
17
|
+
private model;
|
|
18
|
+
private validator;
|
|
19
|
+
private store;
|
|
20
|
+
constructor(props: ContactFormProps<ContactFormModel>);
|
|
21
|
+
get firstName(): string;
|
|
22
|
+
set firstName(value: string);
|
|
23
|
+
get lastName(): string;
|
|
24
|
+
set lastName(value: string);
|
|
25
|
+
get email(): string;
|
|
26
|
+
set email(value: string);
|
|
27
|
+
get message(): string;
|
|
28
|
+
set message(value: string);
|
|
29
|
+
get hasError(): boolean;
|
|
30
|
+
get firstNameErrorMessage(): string | undefined;
|
|
31
|
+
get lastNameErrorMessage(): string | undefined;
|
|
32
|
+
get emailErrorMessage(): string | undefined;
|
|
33
|
+
get messageErrorMessage(): string | undefined;
|
|
34
|
+
get redirect(): string | null | undefined;
|
|
35
|
+
onFirstNameChange: (value: string) => void;
|
|
36
|
+
onLastNameChange: (value: string) => void;
|
|
37
|
+
onEmailChange: (value: string) => void;
|
|
38
|
+
onMessageChange: (value: string) => void;
|
|
39
|
+
validateAll(): Promise<boolean>;
|
|
40
|
+
saveContactForm(): Promise<{
|
|
41
|
+
isFormError: boolean;
|
|
42
|
+
isSuccess: boolean;
|
|
43
|
+
}>;
|
|
44
|
+
}
|
|
45
|
+
export {};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { IkasBaseStore } from "../../../../store/index";
|
|
2
|
+
declare type ForgotPasswordProps<T> = {
|
|
3
|
+
message: {
|
|
4
|
+
requiredRule: ((model: T) => string) | string;
|
|
5
|
+
emailRule: ((model: T) => string) | string;
|
|
6
|
+
};
|
|
7
|
+
store: IkasBaseStore;
|
|
8
|
+
};
|
|
9
|
+
declare type ForgotPasswordFormModel = {
|
|
10
|
+
email: string;
|
|
11
|
+
};
|
|
12
|
+
export declare class ForgotPasswordForm {
|
|
13
|
+
private model;
|
|
14
|
+
private validator;
|
|
15
|
+
private store;
|
|
16
|
+
constructor(props: ForgotPasswordProps<ForgotPasswordFormModel>);
|
|
17
|
+
get email(): string;
|
|
18
|
+
set email(value: string);
|
|
19
|
+
onEmailChange: (value: string) => void;
|
|
20
|
+
get hasValidatorError(): boolean;
|
|
21
|
+
get emailErrorMessage(): string | undefined;
|
|
22
|
+
get redirect(): string | null | undefined;
|
|
23
|
+
validateAll(): Promise<boolean>;
|
|
24
|
+
submit(): Promise<{
|
|
25
|
+
isFormError: boolean;
|
|
26
|
+
isSuccess: boolean;
|
|
27
|
+
}>;
|
|
28
|
+
}
|
|
29
|
+
export {};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { IkasBaseStore } from "../../../../store/index";
|
|
2
|
+
declare type LoginFormProps<T> = {
|
|
3
|
+
message: {
|
|
4
|
+
requiredRule: ((model: T) => string) | string;
|
|
5
|
+
emailRule: ((model: T) => string) | string;
|
|
6
|
+
minRule: ((model: T) => string) | string;
|
|
7
|
+
};
|
|
8
|
+
store: IkasBaseStore;
|
|
9
|
+
};
|
|
10
|
+
declare type LoginFormModel = {
|
|
11
|
+
email: string;
|
|
12
|
+
password: string;
|
|
13
|
+
};
|
|
14
|
+
export declare class LoginForm {
|
|
15
|
+
private model;
|
|
16
|
+
private validator;
|
|
17
|
+
private store;
|
|
18
|
+
constructor(props: LoginFormProps<LoginFormModel>);
|
|
19
|
+
get hasError(): boolean;
|
|
20
|
+
get email(): string;
|
|
21
|
+
set email(value: string);
|
|
22
|
+
get password(): string;
|
|
23
|
+
set password(value: string);
|
|
24
|
+
get emailErrorMessage(): string | undefined;
|
|
25
|
+
get passwordErrorMessage(): string | undefined;
|
|
26
|
+
get redirect(): string | null | undefined;
|
|
27
|
+
onEmailChange: (value: string) => void;
|
|
28
|
+
onPasswordChange: (value: string) => void;
|
|
29
|
+
validateAll(): Promise<boolean>;
|
|
30
|
+
logIn(): Promise<{
|
|
31
|
+
isFormError: boolean;
|
|
32
|
+
isSuccess: boolean;
|
|
33
|
+
}>;
|
|
34
|
+
}
|
|
35
|
+
export {};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { IkasBaseStore } from "../../../../store/index";
|
|
2
|
+
declare type RecoverPasswordFormProps<T> = {
|
|
3
|
+
message: {
|
|
4
|
+
requiredRule: ((model: T) => string) | string;
|
|
5
|
+
minRule: ((model: T) => string) | string;
|
|
6
|
+
equalsRule: ((model: T) => string) | string;
|
|
7
|
+
};
|
|
8
|
+
store: IkasBaseStore;
|
|
9
|
+
};
|
|
10
|
+
declare type RecoverPasswordFormModel = {
|
|
11
|
+
password: string;
|
|
12
|
+
passwordAgain: string;
|
|
13
|
+
};
|
|
14
|
+
export declare class RecoverPasswordForm {
|
|
15
|
+
private model;
|
|
16
|
+
private validator;
|
|
17
|
+
private store;
|
|
18
|
+
constructor(props: RecoverPasswordFormProps<RecoverPasswordFormModel>);
|
|
19
|
+
resetModel(): void;
|
|
20
|
+
get password(): string;
|
|
21
|
+
set password(value: string);
|
|
22
|
+
get passwordAgain(): string;
|
|
23
|
+
set passwordAgain(value: string);
|
|
24
|
+
get hasError(): boolean;
|
|
25
|
+
get passwordErrorMessage(): string | undefined;
|
|
26
|
+
get passwordAgainErrorMessage(): string | undefined;
|
|
27
|
+
get redirect(): string | null | undefined;
|
|
28
|
+
onPasswordChange: (value: string) => void;
|
|
29
|
+
onPasswordAgainChange: (value: string) => void;
|
|
30
|
+
validateAll(): Promise<boolean>;
|
|
31
|
+
submit(): Promise<{
|
|
32
|
+
isFormError: boolean;
|
|
33
|
+
isSuccess: boolean;
|
|
34
|
+
}>;
|
|
35
|
+
}
|
|
36
|
+
export {};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { IkasBaseStore } from "../../../../store/index";
|
|
2
|
+
declare type RegisterFormProps<T> = {
|
|
3
|
+
message: {
|
|
4
|
+
requiredRule: ((model: T) => string) | string;
|
|
5
|
+
emailRule: ((model: T) => string) | string;
|
|
6
|
+
minRule: ((model: T) => string) | string;
|
|
7
|
+
};
|
|
8
|
+
store: IkasBaseStore;
|
|
9
|
+
};
|
|
10
|
+
declare type RegisterFormModel = {
|
|
11
|
+
firstName: string;
|
|
12
|
+
lastName: string;
|
|
13
|
+
email: string;
|
|
14
|
+
password: string;
|
|
15
|
+
};
|
|
16
|
+
export declare class RegisterForm {
|
|
17
|
+
private model;
|
|
18
|
+
private validator;
|
|
19
|
+
private store;
|
|
20
|
+
constructor(props: RegisterFormProps<RegisterFormModel>);
|
|
21
|
+
get firstName(): string;
|
|
22
|
+
set firstName(value: string);
|
|
23
|
+
get lastName(): string;
|
|
24
|
+
set lastName(value: string);
|
|
25
|
+
get email(): string;
|
|
26
|
+
set email(value: string);
|
|
27
|
+
get password(): string;
|
|
28
|
+
set password(value: string);
|
|
29
|
+
get hasError(): boolean;
|
|
30
|
+
get firstNameErrorMessage(): string | undefined;
|
|
31
|
+
get lastNameErrorMessage(): string | undefined;
|
|
32
|
+
get emailErrorMessage(): string | undefined;
|
|
33
|
+
get passwordErrorMessage(): string | undefined;
|
|
34
|
+
get redirect(): string | null | undefined;
|
|
35
|
+
onFirstNameChange: (value: string) => void;
|
|
36
|
+
onLastNameChange: (value: string) => void;
|
|
37
|
+
onEmailChange: (value: string) => void;
|
|
38
|
+
onPasswordChange: (value: string) => void;
|
|
39
|
+
validateAll(): Promise<boolean>;
|
|
40
|
+
register(): Promise<{
|
|
41
|
+
isFormError: boolean;
|
|
42
|
+
isSuccess: boolean;
|
|
43
|
+
}>;
|
|
44
|
+
}
|
|
45
|
+
export {};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { ValidatorErrorType, ValidationRule } from "./rules/index";
|
|
2
|
+
export declare type ValidationResults = {
|
|
3
|
+
[fieldKey: string]: ValidationResult;
|
|
4
|
+
};
|
|
5
|
+
export declare type ValidationStatus = "success" | "warning" | "error" | "validating";
|
|
6
|
+
export declare class Validator<T = any> {
|
|
7
|
+
model: T;
|
|
8
|
+
rules: ValidationRule[];
|
|
9
|
+
results: ValidationResults;
|
|
10
|
+
constructor(model: T, rules: ValidationRule[]);
|
|
11
|
+
get hasError(): boolean;
|
|
12
|
+
onValueChange: (validationRule: ValidationRule) => void;
|
|
13
|
+
setRules(rules: ValidationRule[]): void;
|
|
14
|
+
validateAll(): Promise<boolean>;
|
|
15
|
+
validateFieldRules(fieldKey: string): Promise<void>;
|
|
16
|
+
private runRules;
|
|
17
|
+
}
|
|
18
|
+
declare class ValidationResult {
|
|
19
|
+
fieldKey: string;
|
|
20
|
+
status?: ValidationStatus;
|
|
21
|
+
messages: string[];
|
|
22
|
+
errorTypes: ValidatorErrorType[];
|
|
23
|
+
constructor(fieldKey: string, status?: ValidationStatus, messages?: string[], errorTypes?: ValidatorErrorType[]);
|
|
24
|
+
get errorMessage(): string | undefined;
|
|
25
|
+
get errorType(): ValidatorErrorType | undefined;
|
|
26
|
+
}
|
|
27
|
+
export {};
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
export declare enum ValidatorErrorType {
|
|
2
|
+
"REQUIRED_RULE" = "REQUIRED_RULE",
|
|
3
|
+
"EMAIl_RULE" = "EMAIl_RULE",
|
|
4
|
+
"MIN_RULE" = "MIN_RULE"
|
|
5
|
+
}
|
|
6
|
+
declare type ValueGetter<T> = (model: T) => any;
|
|
7
|
+
declare type ValuePath<T> = string | ValueGetter<T>;
|
|
8
|
+
export interface IValidationRuleParams<T = any> {
|
|
9
|
+
model?: T;
|
|
10
|
+
fieldKey: string;
|
|
11
|
+
fieldName?: string;
|
|
12
|
+
message?: ((model: T) => string) | string;
|
|
13
|
+
errorType?: ValidatorErrorType;
|
|
14
|
+
valuePath: ValuePath<T>;
|
|
15
|
+
onValueChange?: (rule: ValidationRule) => void;
|
|
16
|
+
}
|
|
17
|
+
export declare abstract class ValidationRule<T = any> {
|
|
18
|
+
model?: T;
|
|
19
|
+
fieldKey: string;
|
|
20
|
+
fieldName?: string;
|
|
21
|
+
message?: ((model: T) => string) | string;
|
|
22
|
+
errorType?: ValidatorErrorType;
|
|
23
|
+
valuePath: ValuePath<T>;
|
|
24
|
+
onValueChange?: (rule: ValidationRule) => void;
|
|
25
|
+
disposer?: () => void;
|
|
26
|
+
constructor(data: IValidationRuleParams<T>);
|
|
27
|
+
get value(): any;
|
|
28
|
+
protected getValue(valuePath: ValuePath<T>): any;
|
|
29
|
+
abstract run(): Promise<boolean>;
|
|
30
|
+
abstract get errorMessage(): string;
|
|
31
|
+
}
|
|
32
|
+
export interface IMinRuleParams<T> extends IValidationRuleParams<T> {
|
|
33
|
+
minValue: number;
|
|
34
|
+
}
|
|
35
|
+
export declare class MinRule<T> extends ValidationRule<T> {
|
|
36
|
+
minValue: number;
|
|
37
|
+
errorType: ValidatorErrorType;
|
|
38
|
+
constructor(data: IMinRuleParams<T>);
|
|
39
|
+
get errorMessage(): string;
|
|
40
|
+
run(): Promise<boolean>;
|
|
41
|
+
}
|
|
42
|
+
export interface IMaxRuleParams extends IValidationRuleParams {
|
|
43
|
+
maxValue: number;
|
|
44
|
+
}
|
|
45
|
+
export declare class MaxRule<T> extends ValidationRule<T> {
|
|
46
|
+
maxValue: number;
|
|
47
|
+
constructor(data: IMaxRuleParams);
|
|
48
|
+
get errorMessage(): string;
|
|
49
|
+
run(): Promise<boolean>;
|
|
50
|
+
}
|
|
51
|
+
export declare class RequiredRule<T> extends ValidationRule<T> {
|
|
52
|
+
constructor(data: IValidationRuleParams<T>);
|
|
53
|
+
get errorMessage(): string;
|
|
54
|
+
run(): Promise<boolean>;
|
|
55
|
+
}
|
|
56
|
+
interface ILessThanRuleParams<T> extends IValidationRuleParams<T> {
|
|
57
|
+
otherFieldValuePath: ValuePath<T>;
|
|
58
|
+
otherFieldName?: string;
|
|
59
|
+
}
|
|
60
|
+
export declare class LessThanRule<T> extends ValidationRule<T> {
|
|
61
|
+
otherFieldName?: string;
|
|
62
|
+
otherFieldValuePath: ValuePath<T>;
|
|
63
|
+
constructor(data: ILessThanRuleParams<T>);
|
|
64
|
+
get otherValue(): any;
|
|
65
|
+
get errorMessage(): string;
|
|
66
|
+
run(): Promise<boolean>;
|
|
67
|
+
}
|
|
68
|
+
export declare class EmailRule<T> extends ValidationRule<T> {
|
|
69
|
+
errorType: ValidatorErrorType;
|
|
70
|
+
get errorMessage(): string;
|
|
71
|
+
run(): Promise<boolean>;
|
|
72
|
+
}
|
|
73
|
+
export declare class PhoneRule<T> extends ValidationRule<T> {
|
|
74
|
+
get errorMessage(): string;
|
|
75
|
+
run(): Promise<boolean>;
|
|
76
|
+
}
|
|
77
|
+
export interface IEqualsRuleParams<T> extends IValidationRuleParams<T> {
|
|
78
|
+
equalsValuePath: ValuePath<T>;
|
|
79
|
+
}
|
|
80
|
+
export declare class EqualsRule<T> extends ValidationRule<T> {
|
|
81
|
+
equalsValuePath: ValuePath<T>;
|
|
82
|
+
constructor(data: IEqualsRuleParams<T>);
|
|
83
|
+
get equalsValue(): any;
|
|
84
|
+
get errorMessage(): string;
|
|
85
|
+
run(): Promise<boolean>;
|
|
86
|
+
}
|
|
87
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { GetStaticProps } from "next";
|
|
3
|
+
import { IkasThemePage } from "../models/index";
|
|
4
|
+
declare type Props = {
|
|
5
|
+
propValuesStr: string;
|
|
6
|
+
page: IkasThemePage;
|
|
7
|
+
settingsStr: string;
|
|
8
|
+
merchantSettings: string;
|
|
9
|
+
configJson: Record<string, any>;
|
|
10
|
+
};
|
|
11
|
+
declare const Page: React.FC<Props>;
|
|
12
|
+
export default Page;
|
|
13
|
+
export declare const getStaticProps: GetStaticProps;
|
|
@@ -1,12 +1,18 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
1
2
|
import * as React from "react";
|
|
2
|
-
import {
|
|
3
|
+
import { GetStaticPaths, GetStaticProps } from "next";
|
|
3
4
|
import { IkasThemePage } from "../../models/index";
|
|
5
|
+
import { ParsedUrlQuery } from "querystring";
|
|
4
6
|
declare type Props = {
|
|
5
7
|
propValuesStr: string;
|
|
6
8
|
pageSpecificDataStr: string;
|
|
7
9
|
page: IkasThemePage;
|
|
10
|
+
queryParams?: ParsedUrlQuery;
|
|
11
|
+
settingsStr: string;
|
|
12
|
+
merchantSettings: string;
|
|
13
|
+
configJson: Record<string, any>;
|
|
8
14
|
};
|
|
9
|
-
declare const
|
|
10
|
-
export default
|
|
15
|
+
declare const _default: React.FunctionComponent<Props>;
|
|
16
|
+
export default _default;
|
|
11
17
|
export declare const getStaticPaths: GetStaticPaths;
|
|
12
18
|
export declare const getStaticProps: GetStaticProps;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { GetStaticProps } from "next";
|
|
3
|
+
import { IkasThemePage } from "../../models/index";
|
|
4
|
+
declare type Props = {
|
|
5
|
+
propValuesStr: string;
|
|
6
|
+
page: IkasThemePage;
|
|
7
|
+
settingsStr: string;
|
|
8
|
+
configJson: Record<string, any>;
|
|
9
|
+
};
|
|
10
|
+
declare const Page: React.FC<Props>;
|
|
11
|
+
export default Page;
|
|
12
|
+
export declare const getStaticProps: GetStaticProps;
|
|
@@ -4,6 +4,9 @@ import { IkasThemePage } from "../../models/index";
|
|
|
4
4
|
declare type Props = {
|
|
5
5
|
propValuesStr: string;
|
|
6
6
|
page: IkasThemePage;
|
|
7
|
+
settingsStr: string;
|
|
8
|
+
merchantSettings: string;
|
|
9
|
+
configJson: Record<string, any>;
|
|
7
10
|
};
|
|
8
11
|
declare const Page: React.FC<Props>;
|
|
9
12
|
export default Page;
|
|
@@ -4,6 +4,9 @@ import { IkasThemePage } from "../../models/index";
|
|
|
4
4
|
declare type Props = {
|
|
5
5
|
propValuesStr: string;
|
|
6
6
|
page: IkasThemePage;
|
|
7
|
+
settingsStr: string;
|
|
8
|
+
merchantSettings: string;
|
|
9
|
+
configJson: Record<string, any>;
|
|
7
10
|
};
|
|
8
11
|
declare const Page: React.FC<Props>;
|
|
9
12
|
export default Page;
|