@ikas/storefront 0.0.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.
Files changed (197) hide show
  1. package/build/__generated__/global-types.d.ts +343 -0
  2. package/build/api/apollo.d.ts +10 -0
  3. package/build/api/brand/__generated__/listProductBrand.d.ts +30 -0
  4. package/build/api/brand/index.d.ts +15 -0
  5. package/build/api/cart/__generated__/getCart.d.ts +67 -0
  6. package/build/api/cart/__generated__/saveItemToCart.d.ts +65 -0
  7. package/build/api/cart/index.d.ts +5 -0
  8. package/build/api/category/__generated__/listCategory.d.ts +34 -0
  9. package/build/api/category/index.d.ts +15 -0
  10. package/build/api/checkout/__generated__/checkStocks.d.ts +18 -0
  11. package/build/api/checkout/__generated__/createSaleTransactionWithCheckout.d.ts +22 -0
  12. package/build/api/checkout/__generated__/getCheckoutByCartId.d.ts +10 -0
  13. package/build/api/checkout/__generated__/getCheckoutById.d.ts +206 -0
  14. package/build/api/checkout/__generated__/listPaymentGateway.d.ts +17 -0
  15. package/build/api/checkout/__generated__/retrieveInstallmentInfo.d.ts +23 -0
  16. package/build/api/checkout/__generated__/saveCheckout.d.ts +11 -0
  17. package/build/api/checkout/index.d.ts +19 -0
  18. package/build/api/city/__generated__/listCity.d.ts +14 -0
  19. package/build/api/city/index.d.ts +4 -0
  20. package/build/api/country/__generated__/getAvailableShippingCountries.d.ts +3 -0
  21. package/build/api/country/__generated__/listCountry.d.ts +16 -0
  22. package/build/api/country/index.d.ts +5 -0
  23. package/build/api/customer/__generated__/checkCustomerEmail.d.ts +10 -0
  24. package/build/api/customer/__generated__/customerForgotPassword.d.ts +6 -0
  25. package/build/api/customer/__generated__/customerLogin.d.ts +68 -0
  26. package/build/api/customer/__generated__/customerRecoverPassword.d.ts +8 -0
  27. package/build/api/customer/__generated__/customerRefreshToken.d.ts +11 -0
  28. package/build/api/customer/__generated__/getCustomerOrders.d.ts +216 -0
  29. package/build/api/customer/__generated__/getMyCustomer.d.ts +58 -0
  30. package/build/api/customer/__generated__/listOrderTransactions.d.ts +53 -0
  31. package/build/api/customer/__generated__/registerCustomer.d.ts +70 -0
  32. package/build/api/customer/__generated__/saveMyCustomer.d.ts +61 -0
  33. package/build/api/customer/index.d.ts +28 -0
  34. package/build/api/district/__generated__/listDistrict.d.ts +13 -0
  35. package/build/api/district/index.d.ts +4 -0
  36. package/build/api/html-meta-data/__generated__/listHTMLMetaData.d.ts +17 -0
  37. package/build/api/html-meta-data/index.d.ts +4 -0
  38. package/build/api/index.d.ts +17 -0
  39. package/build/api/merchant/__generated__/listMerchantSettings.d.ts +13 -0
  40. package/build/api/merchant/index.d.ts +4 -0
  41. package/build/api/product/__generated__/listProduct.d.ts +91 -0
  42. package/build/api/product/index.d.ts +15 -0
  43. package/build/api/product-attribute/__generated__/listProductAttribute.d.ts +26 -0
  44. package/build/api/product-attribute/index.d.ts +4 -0
  45. package/build/api/product-stock-location/__generated__/listProductStockLocation.d.ts +13 -0
  46. package/build/api/product-stock-location/index.d.ts +4 -0
  47. package/build/api/state/__generated__/listState.d.ts +13 -0
  48. package/build/api/state/index.d.ts +4 -0
  49. package/build/api/stock-location/__generated__/listStockLocation.d.ts +7 -0
  50. package/build/api/stock-location/index.d.ts +4 -0
  51. package/build/api/storefront/__generated__/getStorefront.d.ts +23 -0
  52. package/build/api/storefront/index.d.ts +4 -0
  53. package/build/api/theme/index.d.ts +4 -0
  54. package/build/api/variant-type/__generated__/listVariantType.d.ts +27 -0
  55. package/build/api/variant-type/index.d.ts +4 -0
  56. package/build/components/checkout/components/address-form/index.d.ts +12 -0
  57. package/build/components/checkout/components/address-form/model.d.ts +76 -0
  58. package/build/components/checkout/components/arrow-left.d.ts +6 -0
  59. package/build/components/checkout/components/breadcrumbs/index.d.ts +7 -0
  60. package/build/components/checkout/components/button/index.d.ts +8 -0
  61. package/build/components/checkout/components/cart-summary/arrow-down.d.ts +6 -0
  62. package/build/components/checkout/components/cart-summary/arrow-right.d.ts +6 -0
  63. package/build/components/checkout/components/cart-summary/cart-item/index.d.ts +8 -0
  64. package/build/components/checkout/components/cart-summary/index.d.ts +8 -0
  65. package/build/components/checkout/components/cart-summary/shopping-cart.d.ts +6 -0
  66. package/build/components/checkout/components/checkbox/check.d.ts +6 -0
  67. package/build/components/checkout/components/checkbox/index.d.ts +8 -0
  68. package/build/components/checkout/components/credit-card-form/index.d.ts +7 -0
  69. package/build/components/checkout/components/credit-card-form/model.d.ts +26 -0
  70. package/build/components/checkout/components/cross.d.ts +6 -0
  71. package/build/components/checkout/components/error-container/index.d.ts +6 -0
  72. package/build/components/checkout/components/error-container/no-shipping-error/index.d.ts +6 -0
  73. package/build/components/checkout/components/error-container/payment-error/index.d.ts +6 -0
  74. package/build/components/checkout/components/error-container/stock-error/index.d.ts +8 -0
  75. package/build/components/checkout/components/error-container/unknown-error/index.d.ts +6 -0
  76. package/build/components/checkout/components/expandable-list/index.d.ts +13 -0
  77. package/build/components/checkout/components/form-item/caret-down.d.ts +6 -0
  78. package/build/components/checkout/components/form-item/index.d.ts +3 -0
  79. package/build/components/checkout/components/form-item/model.d.ts +34 -0
  80. package/build/components/checkout/components/info-box/index.d.ts +8 -0
  81. package/build/components/checkout/components/policy-modal/index.d.ts +8 -0
  82. package/build/components/checkout/components/step-action-buttons/index.d.ts +10 -0
  83. package/build/components/checkout/components/text-button/index.d.ts +7 -0
  84. package/build/components/checkout/components/toggle/index.d.ts +7 -0
  85. package/build/components/checkout/index.d.ts +10 -0
  86. package/build/components/checkout/model.d.ts +101 -0
  87. package/build/components/checkout/steps/step-info/index.d.ts +7 -0
  88. package/build/components/checkout/steps/step-payment/billing-address/index.d.ts +7 -0
  89. package/build/components/checkout/steps/step-payment/index.d.ts +7 -0
  90. package/build/components/checkout/steps/step-payment/payment-gateways/index.d.ts +7 -0
  91. package/build/components/checkout/steps/step-payment/payment-gateways/installments/index.d.ts +7 -0
  92. package/build/components/checkout/steps/step-shipping/index.d.ts +7 -0
  93. package/build/components/checkout/steps/step-success/index.d.ts +7 -0
  94. package/build/components/error/index.d.ts +5 -0
  95. package/build/components/gtm/functions.d.ts +164 -0
  96. package/build/components/gtm/index.d.ts +7 -0
  97. package/build/components/hoc/ThemeComponent.d.ts +9 -0
  98. package/build/components/hoc/ThemeComponentEditor.d.ts +9 -0
  99. package/build/components/index.d.ts +6 -0
  100. package/build/components/page/head.d.ts +7 -0
  101. package/build/components/page/index.d.ts +9 -0
  102. package/build/components/page-editor/index.d.ts +2 -0
  103. package/build/components/page-editor/model.d.ts +59 -0
  104. package/build/index.d.ts +7 -0
  105. package/build/index.es.js +23583 -0
  106. package/build/index.js +23655 -0
  107. package/build/models/data/brand/index.d.ts +10 -0
  108. package/build/models/data/cart/index.d.ts +30 -0
  109. package/build/models/data/category/index.d.ts +11 -0
  110. package/build/models/data/checkout/index.d.ts +87 -0
  111. package/build/models/data/city/index.d.ts +4 -0
  112. package/build/models/data/country/index.d.ts +6 -0
  113. package/build/models/data/customer/address/index.d.ts +44 -0
  114. package/build/models/data/customer/index.d.ts +19 -0
  115. package/build/models/data/district/index.d.ts +4 -0
  116. package/build/models/data/html-meta-data/index.d.ts +15 -0
  117. package/build/models/data/image/index.d.ts +7 -0
  118. package/build/models/data/index.d.ts +25 -0
  119. package/build/models/data/installment-info/index.d.ts +30 -0
  120. package/build/models/data/merchant-settings/index.d.ts +8 -0
  121. package/build/models/data/order/address/index.d.ts +41 -0
  122. package/build/models/data/order/adjustment/index.d.ts +16 -0
  123. package/build/models/data/order/index.d.ts +109 -0
  124. package/build/models/data/order/line-item/discount/index.d.ts +11 -0
  125. package/build/models/data/order/line-item/index.d.ts +19 -0
  126. package/build/models/data/order/line-item/variant/index.d.ts +25 -0
  127. package/build/models/data/order/shipping-line/index.d.ts +7 -0
  128. package/build/models/data/order-transaction/index.d.ts +72 -0
  129. package/build/models/data/payment-gateway/index.d.ts +20 -0
  130. package/build/models/data/product/attribute-value/index.d.ts +6 -0
  131. package/build/models/data/product/index.d.ts +29 -0
  132. package/build/models/data/product/variant/index.d.ts +16 -0
  133. package/build/models/data/product/variant/price/index.d.ts +8 -0
  134. package/build/models/data/product/variant-type/index.d.ts +6 -0
  135. package/build/models/data/product-attribute/index.d.ts +17 -0
  136. package/build/models/data/product-attribute/product-attribute-option/index.d.ts +5 -0
  137. package/build/models/data/state/index.d.ts +5 -0
  138. package/build/models/data/storefront/index.d.ts +12 -0
  139. package/build/models/data/storefront/stockfront-location/index.d.ts +5 -0
  140. package/build/models/data/storefront/stockfront-route/index.d.ts +5 -0
  141. package/build/models/data/storefront/storefront-domain/index.d.ts +7 -0
  142. package/build/models/data/storefront/storefront-region/index.d.ts +18 -0
  143. package/build/models/data/variant-type/index.d.ts +14 -0
  144. package/build/models/data/variant-type/variant-value/index.d.ts +11 -0
  145. package/build/models/index.d.ts +3 -0
  146. package/build/models/theme/component/index.d.ts +10 -0
  147. package/build/models/theme/component/prop/index.d.ts +19 -0
  148. package/build/models/theme/component/prop/value/index.d.ts +14 -0
  149. package/build/models/theme/index.d.ts +10 -0
  150. package/build/models/theme/page/component/index.d.ts +6 -0
  151. package/build/models/theme/page/component/prop-value/brand-list.d.ts +9 -0
  152. package/build/models/theme/page/component/prop-value/brand.d.ts +5 -0
  153. package/build/models/theme/page/component/prop-value/link.d.ts +19 -0
  154. package/build/models/theme/page/component/prop-value/product-detail.d.ts +6 -0
  155. package/build/models/theme/page/component/prop-value/product-list.d.ts +15 -0
  156. package/build/models/theme/page/index.d.ts +26 -0
  157. package/build/models/theme/theme.d.ts +10 -0
  158. package/build/models/ui/brand-list/index.d.ts +58 -0
  159. package/build/models/ui/index.d.ts +6 -0
  160. package/build/models/ui/navigation-link/index.d.ts +7 -0
  161. package/build/models/ui/product-detail/index.d.ts +13 -0
  162. package/build/models/ui/product-list/filter.d.ts +18 -0
  163. package/build/models/ui/product-list/index.d.ts +76 -0
  164. package/build/pages/[slug]/[secondSlug].d.ts +11 -0
  165. package/build/pages/[slug]/index.d.ts +12 -0
  166. package/build/pages/account/addresses.d.ts +10 -0
  167. package/build/pages/account/forgot-password.d.ts +10 -0
  168. package/build/pages/account/index.d.ts +10 -0
  169. package/build/pages/account/login.d.ts +10 -0
  170. package/build/pages/account/orders/[id].d.ts +10 -0
  171. package/build/pages/account/orders/index.d.ts +10 -0
  172. package/build/pages/account/recover-password.d.ts +10 -0
  173. package/build/pages/account/register.d.ts +10 -0
  174. package/build/pages/api/getComponentDirs.d.ts +3 -0
  175. package/build/pages/api/getTheme.d.ts +3 -0
  176. package/build/pages/api/updateTheme.d.ts +10 -0
  177. package/build/pages/api/uploadTheme.d.ts +3 -0
  178. package/build/pages/checkout/[id].d.ts +11 -0
  179. package/build/pages/editor.d.ts +5 -0
  180. package/build/pages/home.d.ts +10 -0
  181. package/build/pages/index.d.ts +14 -0
  182. package/build/store/base.d.ts +7 -0
  183. package/build/store/cart.d.ts +25 -0
  184. package/build/store/customer.d.ts +32 -0
  185. package/build/store/index.d.ts +1 -0
  186. package/build/storefront/index.d.ts +9 -0
  187. package/build/utils/currency.d.ts +1 -0
  188. package/build/utils/helper.d.ts +4 -0
  189. package/build/utils/index.d.ts +3 -0
  190. package/build/utils/providers/page-data.d.ts +35 -0
  191. package/build/utils/providers/prop-value/brand-list.d.ts +7 -0
  192. package/build/utils/providers/prop-value/brand.d.ts +8 -0
  193. package/build/utils/providers/prop-value/index.d.ts +3 -0
  194. package/build/utils/providers/prop-value/link.d.ts +9 -0
  195. package/build/utils/providers/prop-value/product-detail.d.ts +8 -0
  196. package/build/utils/providers/prop-value/product-list.d.ts +11 -0
  197. package/package.json +118 -0
@@ -0,0 +1,76 @@
1
+ import { IkasOrderAddress } from "../../../../models/data/order/address/index";
2
+ import { IkasCountry, IkasState, IkasCity, IkasDistrict, IkasCheckoutCustomer } from "../../../../models/index";
3
+ export default class AddressFormViewModel {
4
+ address: IkasOrderAddress;
5
+ customer?: IkasCheckoutCustomer;
6
+ countries: IkasCountry[];
7
+ states: IkasState[];
8
+ cities: IkasCity[];
9
+ districts: IkasDistrict[];
10
+ allowedCountryIds?: string[];
11
+ constructor(data: AddressFormViewModelParams);
12
+ get firstName(): string;
13
+ get lastName(): string;
14
+ get phone(): string;
15
+ get country(): {
16
+ id?: string;
17
+ name?: string;
18
+ code?: string;
19
+ };
20
+ get state(): {
21
+ id?: string;
22
+ name?: string;
23
+ code?: string;
24
+ };
25
+ get city(): {
26
+ id?: string;
27
+ name?: string;
28
+ code?: string;
29
+ };
30
+ get district(): {
31
+ id?: string;
32
+ name?: string;
33
+ code?: string;
34
+ };
35
+ get countryOptions(): {
36
+ label: string;
37
+ value: string;
38
+ }[];
39
+ get stateOptions(): {
40
+ label: string;
41
+ value: string;
42
+ }[];
43
+ get cityOptions(): {
44
+ label: string;
45
+ value: string;
46
+ }[];
47
+ get districtOptions(): {
48
+ label: string;
49
+ value: string;
50
+ }[];
51
+ get hasState(): boolean;
52
+ fillDropdownOptions: () => Promise<void>;
53
+ listCountries: () => Promise<void>;
54
+ listStates: () => Promise<void>;
55
+ listCities: () => Promise<void>;
56
+ listDistricts: () => Promise<void>;
57
+ modelToOption: (model: IkasCountry | IkasState | IkasCity | IkasDistrict) => {
58
+ label: string;
59
+ value: string;
60
+ };
61
+ onFirstNameChange: (value: string) => void;
62
+ onLastNameChange: (value: string) => void;
63
+ onPhoneChange: (value: string) => void;
64
+ onAddressLine1Change: (value: string) => void;
65
+ onAddressLine2Change: (value: string) => void;
66
+ onAddressPostalCodeChange: (value: string) => void;
67
+ onCountryChange: (countryId: string) => void;
68
+ onStateChange: (stateId: string) => void;
69
+ onCityChange: (cityId: string) => void;
70
+ onDistrictChange: (districtId: string) => void;
71
+ onDistrictInputChange: (value: string) => void;
72
+ }
73
+ interface AddressFormViewModelParams extends Partial<AddressFormViewModel> {
74
+ address: IkasOrderAddress;
75
+ }
76
+ export {};
@@ -0,0 +1,6 @@
1
+ import * as React from "react";
2
+ declare type Props = {
3
+ className?: string;
4
+ };
5
+ declare const SVGArrowLeft: React.FC<Props>;
6
+ export default SVGArrowLeft;
@@ -0,0 +1,7 @@
1
+ import * as React from "react";
2
+ import CheckoutViewModel from "../../model";
3
+ declare type Props = {
4
+ vm: CheckoutViewModel;
5
+ };
6
+ export declare const Breadcrumbs: React.FC<Props>;
7
+ export {};
@@ -0,0 +1,8 @@
1
+ import * as React from "react";
2
+ declare type Props = {
3
+ text: string;
4
+ isLoading?: boolean;
5
+ onClick: () => void;
6
+ };
7
+ export declare const Button: React.FC<Props>;
8
+ export {};
@@ -0,0 +1,6 @@
1
+ import * as React from "react";
2
+ declare type Props = {
3
+ className?: string;
4
+ };
5
+ declare const SVGArrowDown: React.FC<Props>;
6
+ export default SVGArrowDown;
@@ -0,0 +1,6 @@
1
+ import * as React from "react";
2
+ declare type Props = {
3
+ className?: string;
4
+ };
5
+ declare const SVGArrowRight: React.FC<Props>;
6
+ export default SVGArrowRight;
@@ -0,0 +1,8 @@
1
+ import * as React from "react";
2
+ import { IkasOrderLineItem } from "../../../../../models/index";
3
+ declare type Props = {
4
+ currencyCode: string;
5
+ cartItem: IkasOrderLineItem;
6
+ };
7
+ export declare const CartItem: React.FC<Props>;
8
+ export {};
@@ -0,0 +1,8 @@
1
+ import * as React from "react";
2
+ import CheckoutViewModel from "../../model";
3
+ declare type Props = {
4
+ vm: CheckoutViewModel;
5
+ allowExpand?: boolean;
6
+ };
7
+ export declare const CartSummary: React.FC<Props>;
8
+ export {};
@@ -0,0 +1,6 @@
1
+ import * as React from "react";
2
+ declare type Props = {
3
+ className?: string;
4
+ };
5
+ declare const SVGShoppingBag: React.FC<Props>;
6
+ export default SVGShoppingBag;
@@ -0,0 +1,6 @@
1
+ import * as React from "react";
2
+ declare type Props = {
3
+ className?: string;
4
+ };
5
+ declare const SVGCheck: React.FC<Props>;
6
+ export default SVGCheck;
@@ -0,0 +1,8 @@
1
+ import * as React from "react";
2
+ declare type Props = {
3
+ value: boolean;
4
+ label?: string;
5
+ onChange: (value: boolean) => void;
6
+ };
7
+ export declare const Checkbox: React.FC<Props>;
8
+ export {};
@@ -0,0 +1,7 @@
1
+ import * as React from "react";
2
+ import CheckoutViewModel from "../../model";
3
+ declare type Props = {
4
+ vm: CheckoutViewModel;
5
+ };
6
+ export declare const CreditCardForm: React.FC<Props>;
7
+ export {};
@@ -0,0 +1,26 @@
1
+ export default class CreditCardData {
2
+ cardNumber?: string;
3
+ cardHolderName?: string;
4
+ expirationDate?: string;
5
+ cvv?: string;
6
+ installmentCount: number;
7
+ threeDSecure: boolean;
8
+ constructor(data?: Partial<CreditCardData>);
9
+ get validationResult(): CreditCardDataValidation;
10
+ get isValid(): boolean;
11
+ toInput: () => {
12
+ cardNumber: string;
13
+ cardHolderName: string;
14
+ cvv: string;
15
+ expiredMonth: number;
16
+ expiredYear: number;
17
+ installmentCount: number;
18
+ threeDSecure: boolean;
19
+ };
20
+ }
21
+ export declare type CreditCardDataValidation = {
22
+ cardNumber: boolean;
23
+ cardHolderName: boolean;
24
+ expirationDate: boolean;
25
+ cvv: boolean;
26
+ };
@@ -0,0 +1,6 @@
1
+ import * as React from "react";
2
+ declare type Props = {
3
+ className?: string;
4
+ };
5
+ declare const SVGHamburger: React.FC<Props>;
6
+ export default SVGHamburger;
@@ -0,0 +1,6 @@
1
+ import * as React from "react";
2
+ declare type Props = {
3
+ onClose: () => void;
4
+ };
5
+ export declare const ErrorContainer: React.FC<Props>;
6
+ export {};
@@ -0,0 +1,6 @@
1
+ import * as React from "react";
2
+ declare type Props = {
3
+ onClose: () => void;
4
+ };
5
+ export declare const NoShippingError: React.FC<Props>;
6
+ export {};
@@ -0,0 +1,6 @@
1
+ import * as React from "react";
2
+ declare type Props = {
3
+ onClose: () => void;
4
+ };
5
+ export declare const PaymentError: React.FC<Props>;
6
+ export {};
@@ -0,0 +1,8 @@
1
+ import * as React from "react";
2
+ import { CheckoutError } from "../../../model";
3
+ declare type Props = {
4
+ error: CheckoutError;
5
+ onClose: () => void;
6
+ };
7
+ export declare const StockError: React.FC<Props>;
8
+ export {};
@@ -0,0 +1,6 @@
1
+ import * as React from "react";
2
+ declare type Props = {
3
+ onClose: () => void;
4
+ };
5
+ export declare const UnknownError: React.FC<Props>;
6
+ export {};
@@ -0,0 +1,13 @@
1
+ import * as React from "react";
2
+ declare type Props = {
3
+ options: ExpandableListOption[];
4
+ selectedIndex: number;
5
+ onRowSelect: (index: number) => void;
6
+ };
7
+ export declare type ExpandableListOption = {
8
+ leftContent: React.ReactElement;
9
+ rightContent?: React.ReactElement;
10
+ expandContent?: React.ReactElement;
11
+ };
12
+ export declare const ExpandableList: React.FC<Props>;
13
+ export {};
@@ -0,0 +1,6 @@
1
+ import * as React from "react";
2
+ declare type Props = {
3
+ className?: string;
4
+ };
5
+ declare const SVGCaretDown: React.FC<Props>;
6
+ export default SVGCaretDown;
@@ -0,0 +1,3 @@
1
+ import * as React from "react";
2
+ import { Props } from "./model";
3
+ export declare const FormItem: React.FC<Props>;
@@ -0,0 +1,34 @@
1
+ export default class FormItemViewModel implements Props {
2
+ type: FormItemType;
3
+ options?: FormItemSelectOption[];
4
+ label: string;
5
+ value?: string;
6
+ hasError?: boolean;
7
+ errorText?: string;
8
+ onChange: (value: string) => void;
9
+ constructor(props: Props);
10
+ get formItemStyle(): string;
11
+ get labelStyle(): string;
12
+ get inputStyle(): string;
13
+ onValueChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
14
+ onSelectChange: (e: React.ChangeEvent<HTMLSelectElement>) => void;
15
+ }
16
+ export interface Props {
17
+ type: FormItemType;
18
+ options?: FormItemSelectOption[];
19
+ label: string;
20
+ value?: string;
21
+ hasError?: boolean;
22
+ errorText?: string;
23
+ autocomplete?: string;
24
+ onChange: (value: string) => void;
25
+ }
26
+ export declare enum FormItemType {
27
+ TEXT = 0,
28
+ SELECT = 1,
29
+ TEL = 2
30
+ }
31
+ export declare type FormItemSelectOption = {
32
+ value: string;
33
+ label: string;
34
+ };
@@ -0,0 +1,8 @@
1
+ import * as React from "react";
2
+ import CheckoutViewModel from "../../model";
3
+ declare type Props = {
4
+ vm: CheckoutViewModel;
5
+ showShipping: boolean;
6
+ };
7
+ export declare const InfoBox: React.FC<Props>;
8
+ export {};
@@ -0,0 +1,8 @@
1
+ import * as React from "react";
2
+ declare type Props = {
3
+ title: string;
4
+ modalContent: string;
5
+ onClose: () => void;
6
+ };
7
+ export declare const PolicyModal: React.FC<Props>;
8
+ export {};
@@ -0,0 +1,10 @@
1
+ import * as React from "react";
2
+ declare type Props = {
3
+ mainBtnText: string;
4
+ mainBtnOnClick: () => void;
5
+ backBtnText?: string;
6
+ backBtnOnClick?: () => void;
7
+ isLoading?: boolean;
8
+ };
9
+ export declare const StepActionButtons: React.FC<Props>;
10
+ export {};
@@ -0,0 +1,7 @@
1
+ import * as React from "react";
2
+ declare type Props = {
3
+ text: string;
4
+ leftIcon?: React.ReactElement;
5
+ };
6
+ export declare const TextButton: React.FC<Props>;
7
+ export {};
@@ -0,0 +1,7 @@
1
+ import * as React from "react";
2
+ declare type Props = {
3
+ value: boolean;
4
+ onChange?: (value: boolean) => void;
5
+ };
6
+ export declare const Toggle: React.FC<Props>;
7
+ export {};
@@ -0,0 +1,10 @@
1
+ /// <reference types="node" />
2
+ import * as React from "react";
3
+ import { ParsedUrlQuery } from "querystring";
4
+ import { IkasCheckout } from "../../models/index";
5
+ declare type Props = {
6
+ checkout: IkasCheckout;
7
+ queryParams: ParsedUrlQuery;
8
+ };
9
+ export declare const IkasCheckoutPage: React.FC<Props>;
10
+ export {};
@@ -0,0 +1,101 @@
1
+ /// <reference types="node" />
2
+ import { NextRouter } from "next/router";
3
+ import { ParsedUrlQuery } from "querystring";
4
+ import { IkasCheckout, IkasInstallmentInfo, IkasInstallmentInfoInput, IkasMerchantSettings, IkasAvailableShippingMethod } from "../../models/index";
5
+ import { IkasPaymentGateway } from "../../models/data/payment-gateway/index";
6
+ import { IkasOrderLineVariant } from "../../models/data/order/line-item/variant/index";
7
+ import { IkasStorefront } from "../../models/data/storefront/index";
8
+ import { IkasCustomerStore } from "../../store/customer";
9
+ import CreditCardData from "./components/credit-card-form/model";
10
+ export default class CheckoutViewModel {
11
+ checkout: IkasCheckout;
12
+ storefront?: IkasStorefront;
13
+ customerStore: IkasCustomerStore;
14
+ router: NextRouter;
15
+ isCheckoutLoaded: boolean;
16
+ isErrorsVisible: boolean;
17
+ isStepLoading: boolean;
18
+ step: CheckoutStep;
19
+ merchantSettings?: IkasMerchantSettings;
20
+ cardData?: CreditCardData;
21
+ paymentGatewayId?: string;
22
+ paymentGateways: IkasPaymentGateway[];
23
+ installmentInfo?: IkasInstallmentInfo;
24
+ useDifferentAddress: boolean;
25
+ shouldSaveAddress: boolean;
26
+ addressTitle: string;
27
+ shippingCountryIds?: string[];
28
+ selectedShippingAddressId?: string;
29
+ selectedBillingAddressId?: string;
30
+ error?: CheckoutError | null;
31
+ constructor(checkout: IkasCheckout, queryParams: ParsedUrlQuery, router: NextRouter);
32
+ init: (queryParams: ParsedUrlQuery) => Promise<void>;
33
+ get cart(): import("../../models/data/cart/index").IkasCart;
34
+ get storefrontRegion(): import("../../models/data/storefront/storefront-region/index").IkasStorefrontRegion;
35
+ get selectedPaymentGatewayIndex(): number;
36
+ get selectedInstallmentIndex(): number;
37
+ get checkoutUrl(): string;
38
+ get customerAddressOptions(): {
39
+ label: string;
40
+ value: string;
41
+ }[];
42
+ get installmentPrice(): number;
43
+ get installmentExtraPrice(): number;
44
+ get canProceedToShipping(): boolean;
45
+ get canProceedToPayment(): boolean;
46
+ get canPerformPayment(): boolean;
47
+ saveCheckout: () => Promise<void>;
48
+ checkStocks: () => Promise<void>;
49
+ getShippingCountries: () => Promise<void>;
50
+ checkShippingCountries: () => void;
51
+ initialStockCheck: () => Promise<void>;
52
+ listPaymentGateways: () => Promise<void>;
53
+ retrieveInstallmentInfo: (input: IkasInstallmentInfoInput) => Promise<void>;
54
+ getStorefront: () => Promise<void>;
55
+ createCustomer: () => void;
56
+ createShippingAddress: () => void;
57
+ createBillingAddress: () => void;
58
+ onEmailChange: (value: string) => void;
59
+ onShippingMethodChange: (shippingMethod: IkasAvailableShippingMethod) => Promise<void>;
60
+ onCouponCodeChange: (value: string) => void;
61
+ onSelectedShippingAddressIdChange: (value: string) => void;
62
+ onSelectedBillingAddressIdChange: (value: string) => void;
63
+ onCardNumberChange: (value: string) => void;
64
+ onCardHolderNameChange: (value: string) => void;
65
+ onExpirationDateChange: (value: string) => void;
66
+ onCvcChange: (value: string) => void;
67
+ onBackToShoppingClick: () => void;
68
+ onProceedToShippingClick: () => Promise<void>;
69
+ onProceedToPaymentClick: () => Promise<void>;
70
+ performPayment: () => Promise<void>;
71
+ onBackToInfoClick: () => void;
72
+ onBackToShippingClick: () => void;
73
+ setUseDifferentAddress: (value: boolean) => void;
74
+ setShouldSaveAddress: (value: boolean) => void;
75
+ setAddressTitle: (value: string) => void;
76
+ setPaymentGateway: (index: number) => void;
77
+ setInstallmentCount: (count: number) => void;
78
+ changeStep: (step: CheckoutStep) => void;
79
+ logout: () => Promise<void>;
80
+ }
81
+ export declare enum CheckoutStep {
82
+ INFO = "info",
83
+ SHIPPING = "shipping",
84
+ PAYMENT = "payment",
85
+ SUCCESS = "success"
86
+ }
87
+ export declare enum ErrorType {
88
+ UNKNOWN = 0,
89
+ API_ERROR = 1,
90
+ STOCK_ERROR = 2,
91
+ PAYMENT_ERROR = 3,
92
+ NO_SHIPPING_ERROR = 4
93
+ }
94
+ export declare type CheckoutError = {
95
+ type: ErrorType;
96
+ data?: any;
97
+ };
98
+ export declare type StockErrorData = {
99
+ variant: IkasOrderLineVariant;
100
+ availableQuantity: number;
101
+ };
@@ -0,0 +1,7 @@
1
+ import * as React from "react";
2
+ import CheckoutViewModel from "../../model";
3
+ declare type Props = {
4
+ vm: CheckoutViewModel;
5
+ };
6
+ export declare const CheckoutStepInfo: React.FC<Props>;
7
+ export {};
@@ -0,0 +1,7 @@
1
+ import * as React from "react";
2
+ import CheckoutViewModel from "../../../model";
3
+ declare type Props = {
4
+ vm: CheckoutViewModel;
5
+ };
6
+ export declare const BillingAddress: React.FC<Props>;
7
+ export {};
@@ -0,0 +1,7 @@
1
+ import * as React from "react";
2
+ import CheckoutViewModel from "../../model";
3
+ declare type Props = {
4
+ vm: CheckoutViewModel;
5
+ };
6
+ export declare const CheckoutStepPayment: React.FC<Props>;
7
+ export {};
@@ -0,0 +1,7 @@
1
+ import * as React from "react";
2
+ import CheckoutViewModel from "../../../model";
3
+ declare type Props = {
4
+ vm: CheckoutViewModel;
5
+ };
6
+ export declare const PaymentGateways: React.FC<Props>;
7
+ export {};
@@ -0,0 +1,7 @@
1
+ import * as React from "react";
2
+ import CheckoutViewModel from "../../../../model";
3
+ declare type Props = {
4
+ vm: CheckoutViewModel;
5
+ };
6
+ export declare const Installments: React.FC<Props>;
7
+ export {};
@@ -0,0 +1,7 @@
1
+ import * as React from "react";
2
+ import CheckoutViewModel from "../../model";
3
+ declare type Props = {
4
+ vm: CheckoutViewModel;
5
+ };
6
+ export declare const CheckoutStepShipping: React.FC<Props>;
7
+ export {};
@@ -0,0 +1,7 @@
1
+ import * as React from "react";
2
+ import CheckoutViewModel from "../../model";
3
+ declare type Props = {
4
+ vm: CheckoutViewModel;
5
+ };
6
+ export declare const StepSuccess: React.FC<Props>;
7
+ export {};
@@ -0,0 +1,5 @@
1
+ /// <reference types="react" />
2
+ declare function ErrorComponent({ name }?: {
3
+ name?: string;
4
+ }): JSX.Element;
5
+ export default ErrorComponent;