@ikas/storefront 4.0.0-alpha.49 → 4.0.0-alpha.5

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 (85) hide show
  1. package/package.json +13 -13
  2. package/src/analytics/analytics.ts +1 -2
  3. package/src/analytics/googleUniversal.ts +2 -12
  4. package/src/analytics/head/index.tsx +2 -1
  5. package/src/analytics/ikas.ts +7 -25
  6. package/src/components/checkout/components/address-form/index.tsx +1 -1
  7. package/src/components/checkout/components/address-form/model.ts +0 -1
  8. package/src/components/checkout/components/button/style.module.scss +2 -2
  9. package/src/components/checkout/components/cart-summary/cart-item/index.tsx +29 -16
  10. package/src/components/checkout/components/cart-summary/cart-item/style.module.scss +23 -60
  11. package/src/components/checkout/components/cart-summary/index.tsx +27 -58
  12. package/src/components/checkout/components/cart-summary/style.module.scss +3 -48
  13. package/src/components/checkout/components/customer-addresses/index.tsx +2 -7
  14. package/src/components/checkout/components/customer-addresses/model.ts +8 -16
  15. package/src/components/checkout/components/error/index.tsx +1 -1
  16. package/src/components/checkout/components/error/unknown-error/index.tsx +2 -4
  17. package/src/components/checkout/components/form-item/index.tsx +11 -9
  18. package/src/components/checkout/components/master-pass/credit-card-form/index.tsx +0 -2
  19. package/src/components/checkout/components/offer-product/index.tsx +19 -16
  20. package/src/components/checkout/components/offer-product/style.module.scss +3 -1
  21. package/src/components/checkout/components/phone-number-input/get-countries.ts +5 -37
  22. package/src/components/checkout/components/phone-number-input/index.tsx +10 -15
  23. package/src/components/checkout/components/phone-number-input/locale/en.ts +257 -0
  24. package/src/components/checkout/index.tsx +19 -28
  25. package/src/components/checkout/model.ts +91 -214
  26. package/src/components/checkout/modelMasterPass.ts +2 -2
  27. package/src/components/checkout/steps/step-info/index.tsx +3 -9
  28. package/src/components/checkout/steps/step-payment/billing-address/index.tsx +1 -1
  29. package/src/components/checkout/steps/step-payment/index.tsx +2 -11
  30. package/src/components/checkout/steps/step-payment/payment-gateways/index.tsx +3 -12
  31. package/src/components/checkout/steps/step-payment/payment-gateways/installments/index.tsx +3 -5
  32. package/src/components/checkout/steps/step-payment/style.module.scss +0 -5
  33. package/src/components/checkout/steps/step-shipping/index.tsx +4 -9
  34. package/src/components/checkout/steps/step-success/index.tsx +7 -15
  35. package/src/components/page/head.tsx +0 -12
  36. package/src/components/page/index.tsx +9 -10
  37. package/src/components/page-editor/ThemeComponentEditor.tsx +8 -19
  38. package/src/components/page-editor/model.ts +107 -44
  39. package/src/models/data/cart/campaign-offer/index.ts +2 -13
  40. package/src/models/data/cart/index.ts +1 -1
  41. package/src/models/data/category/init.ts +33 -0
  42. package/src/models/data/category/path-item/index.ts +0 -4
  43. package/src/models/data/checkout/index.ts +4 -36
  44. package/src/models/data/checkout-settings/price/index.ts +0 -2
  45. package/src/models/data/country/index.ts +0 -4
  46. package/src/models/data/index.ts +0 -3
  47. package/src/models/data/merchant-settings/index.ts +0 -9
  48. package/src/models/data/order/index.ts +32 -51
  49. package/src/models/data/order/line-item/index.ts +18 -76
  50. package/src/models/data/order/line-item/variant/index.ts +0 -8
  51. package/src/models/data/order/line-item/variant/price/index.ts +0 -2
  52. package/src/models/data/order/line-item/variant/value/index.ts +1 -1
  53. package/src/models/data/order/transaction/index.ts +5 -2
  54. package/src/models/data/product/attribute-value/index.ts +0 -40
  55. package/src/models/data/product/filter/index.ts +13 -4
  56. package/src/models/data/product/index.ts +7 -45
  57. package/src/models/data/product/option-set/index.ts +3 -8
  58. package/src/models/data/product/option-set/option/index.ts +13 -36
  59. package/src/models/data/product/variant/index.ts +1 -26
  60. package/src/models/data/product/variant/price/index.ts +9 -25
  61. package/src/models/data/product/variant-type/index.ts +0 -2
  62. package/src/models/data/raffle/index.ts +7 -9
  63. package/src/models/data/state/index.ts +2 -6
  64. package/src/models/data/storefront/index.ts +0 -2
  65. package/src/models/data/storefront/routing/index.tsx +0 -4
  66. package/src/models/ui/product-list/index.ts +17 -26
  67. package/src/models/ui/raffle-list/index.ts +1 -1
  68. package/src/models/ui/validator/form/raffle-form.ts +3 -16
  69. package/src/models/ui/validator/rules/index.ts +13 -14
  70. package/src/page-data-init/index.ts +404 -159
  71. package/src/pages/checkout.tsx +1 -2
  72. package/src/pages/editor.tsx +2 -5
  73. package/src/store/base.ts +2 -2
  74. package/src/store/cart/index.ts +2 -2
  75. package/src/store/customer/index.ts +17 -7
  76. package/src/store/index.ts +0 -2
  77. package/src/store/raffle/index.ts +10 -7
  78. package/src/utils/constants.ts +1 -1
  79. package/src/utils/currency.ts +183 -9
  80. package/src/models/data/country/location-translations/index.ts +0 -15
  81. package/src/models/data/order/line-item/base-unit/index.ts +0 -22
  82. package/src/models/data/order/line-item/base-unit/unit-type/index.ts +0 -14
  83. package/src/models/data/order/line-item/variant/unit/index.ts +0 -17
  84. package/src/models/data/product/base-unit/index.ts +0 -32
  85. package/src/models/data/product/variant/unit/index.ts +0 -17
@@ -0,0 +1,257 @@
1
+ export default {
2
+ "AB": "Abkhazia",
3
+ "AC": "Ascension Island",
4
+ "AD": "Andorra",
5
+ "AE": "United Arab Emirates",
6
+ "AF": "Afghanistan",
7
+ "AG": "Antigua and Barbuda",
8
+ "AI": "Anguilla",
9
+ "AL": "Albania",
10
+ "AM": "Armenia",
11
+ "AO": "Angola",
12
+ "AQ": "Antarctica",
13
+ "AR": "Argentina",
14
+ "AS": "American Samoa",
15
+ "AT": "Austria",
16
+ "AU": "Australia",
17
+ "AW": "Aruba",
18
+ "AX": "Åland Islands",
19
+ "AZ": "Azerbaijan",
20
+ "BA": "Bosnia and Herzegovina",
21
+ "BB": "Barbados",
22
+ "BD": "Bangladesh",
23
+ "BE": "Belgium",
24
+ "BF": "Burkina Faso",
25
+ "BG": "Bulgaria",
26
+ "BH": "Bahrain",
27
+ "BI": "Burundi",
28
+ "BJ": "Benin",
29
+ "BL": "Saint Barthélemy",
30
+ "BM": "Bermuda",
31
+ "BN": "Brunei Darussalam",
32
+ "BO": "Bolivia",
33
+ "BQ": "Bonaire, Sint Eustatius and Saba",
34
+ "BR": "Brazil",
35
+ "BS": "Bahamas",
36
+ "BT": "Bhutan",
37
+ "BV": "Bouvet Island",
38
+ "BW": "Botswana",
39
+ "BY": "Belarus",
40
+ "BZ": "Belize",
41
+ "CA": "Canada",
42
+ "CC": "Cocos (Keeling) Islands",
43
+ "CD": "Congo, Democratic Republic of the",
44
+ "CF": "Central African Republic",
45
+ "CG": "Congo",
46
+ "CH": "Switzerland",
47
+ "CI": "Cote d'Ivoire",
48
+ "CK": "Cook Islands",
49
+ "CL": "Chile",
50
+ "CM": "Cameroon",
51
+ "CN": "China",
52
+ "CO": "Colombia",
53
+ "CR": "Costa Rica",
54
+ "CU": "Cuba",
55
+ "CV": "Cape Verde",
56
+ "CW": "Curaçao",
57
+ "CX": "Christmas Island",
58
+ "CY": "Cyprus",
59
+ "CZ": "Czech Republic",
60
+ "DE": "Germany",
61
+ "DJ": "Djibouti",
62
+ "DK": "Denmark",
63
+ "DM": "Dominica",
64
+ "DO": "Dominican Republic",
65
+ "DZ": "Algeria",
66
+ "EC": "Ecuador",
67
+ "EE": "Estonia",
68
+ "EG": "Egypt",
69
+ "EH": "Western Sahara",
70
+ "ER": "Eritrea",
71
+ "ES": "Spain",
72
+ "ET": "Ethiopia",
73
+ "FI": "Finland",
74
+ "FJ": "Fiji",
75
+ "FK": "Falkland Islands",
76
+ "FM": "Federated States of Micronesia",
77
+ "FO": "Faroe Islands",
78
+ "FR": "France",
79
+ "GA": "Gabon",
80
+ "GB": "United Kingdom",
81
+ "GD": "Grenada",
82
+ "GE": "Georgia",
83
+ "GF": "French Guiana",
84
+ "GG": "Guernsey",
85
+ "GH": "Ghana",
86
+ "GI": "Gibraltar",
87
+ "GL": "Greenland",
88
+ "GM": "Gambia",
89
+ "GN": "Guinea",
90
+ "GP": "Guadeloupe",
91
+ "GQ": "Equatorial Guinea",
92
+ "GR": "Greece",
93
+ "GS": "South Georgia and the South Sandwich Islands",
94
+ "GT": "Guatemala",
95
+ "GU": "Guam",
96
+ "GW": "Guinea-Bissau",
97
+ "GY": "Guyana",
98
+ "HK": "Hong Kong",
99
+ "HM": "Heard Island and McDonald Islands",
100
+ "HN": "Honduras",
101
+ "HR": "Croatia",
102
+ "HT": "Haiti",
103
+ "HU": "Hungary",
104
+ "ID": "Indonesia",
105
+ "IE": "Ireland",
106
+ "IL": "Israel",
107
+ "IM": "Isle of Man",
108
+ "IN": "India",
109
+ "IO": "British Indian Ocean Territory",
110
+ "IQ": "Iraq",
111
+ "IR": "Iran",
112
+ "IS": "Iceland",
113
+ "IT": "Italy",
114
+ "JE": "Jersey",
115
+ "JM": "Jamaica",
116
+ "JO": "Jordan",
117
+ "JP": "Japan",
118
+ "KE": "Kenya",
119
+ "KG": "Kyrgyzstan",
120
+ "KH": "Cambodia",
121
+ "KI": "Kiribati",
122
+ "KM": "Comoros",
123
+ "KN": "Saint Kitts and Nevis",
124
+ "KP": "North Korea",
125
+ "KR": "South Korea",
126
+ "KW": "Kuwait",
127
+ "KY": "Cayman Islands",
128
+ "KZ": "Kazakhstan",
129
+ "LA": "Laos",
130
+ "LB": "Lebanon",
131
+ "LC": "Saint Lucia",
132
+ "LI": "Liechtenstein",
133
+ "LK": "Sri Lanka",
134
+ "LR": "Liberia",
135
+ "LS": "Lesotho",
136
+ "LT": "Lithuania",
137
+ "LU": "Luxembourg",
138
+ "LV": "Latvia",
139
+ "LY": "Libya",
140
+ "MA": "Morocco",
141
+ "MC": "Monaco",
142
+ "MD": "Moldova",
143
+ "ME": "Montenegro",
144
+ "MF": "Saint Martin (French Part)",
145
+ "MG": "Madagascar",
146
+ "MH": "Marshall Islands",
147
+ "MK": "North Macedonia",
148
+ "ML": "Mali",
149
+ "MM": "Burma",
150
+ "MN": "Mongolia",
151
+ "MO": "Macao",
152
+ "MP": "Northern Mariana Islands",
153
+ "MQ": "Martinique",
154
+ "MR": "Mauritania",
155
+ "MS": "Montserrat",
156
+ "MT": "Malta",
157
+ "MU": "Mauritius",
158
+ "MV": "Maldives",
159
+ "MW": "Malawi",
160
+ "MX": "Mexico",
161
+ "MY": "Malaysia",
162
+ "MZ": "Mozambique",
163
+ "NA": "Namibia",
164
+ "NC": "New Caledonia",
165
+ "NE": "Niger",
166
+ "NF": "Norfolk Island",
167
+ "NG": "Nigeria",
168
+ "NI": "Nicaragua",
169
+ "NL": "Netherlands",
170
+ "NO": "Norway",
171
+ "NP": "Nepal",
172
+ "NR": "Nauru",
173
+ "NU": "Niue",
174
+ "NZ": "New Zealand",
175
+ "OM": "Oman",
176
+ "OS": "South Ossetia",
177
+ "PA": "Panama",
178
+ "PE": "Peru",
179
+ "PF": "French Polynesia",
180
+ "PG": "Papua New Guinea",
181
+ "PH": "Philippines",
182
+ "PK": "Pakistan",
183
+ "PL": "Poland",
184
+ "PM": "Saint Pierre and Miquelon",
185
+ "PN": "Pitcairn",
186
+ "PR": "Puerto Rico",
187
+ "PS": "Palestine",
188
+ "PT": "Portugal",
189
+ "PW": "Palau",
190
+ "PY": "Paraguay",
191
+ "QA": "Qatar",
192
+ "RE": "Reunion",
193
+ "RO": "Romania",
194
+ "RS": "Serbia",
195
+ "RU": "Russia",
196
+ "RW": "Rwanda",
197
+ "SA": "Saudi Arabia",
198
+ "SB": "Solomon Islands",
199
+ "SC": "Seychelles",
200
+ "SD": "Sudan",
201
+ "SE": "Sweden",
202
+ "SG": "Singapore",
203
+ "SH": "Saint Helena",
204
+ "SI": "Slovenia",
205
+ "SJ": "Svalbard and Jan Mayen",
206
+ "SK": "Slovakia",
207
+ "SL": "Sierra Leone",
208
+ "SM": "San Marino",
209
+ "SN": "Senegal",
210
+ "SO": "Somalia",
211
+ "SR": "Suriname",
212
+ "SS": "South Sudan",
213
+ "ST": "Sao Tome and Principe",
214
+ "SV": "El Salvador",
215
+ "SX": "Sint Maarten",
216
+ "SY": "Syria",
217
+ "SZ": "Swaziland",
218
+ "TA": "Tristan da Cunha",
219
+ "TC": "Turks and Caicos Islands",
220
+ "TD": "Chad",
221
+ "TF": "French Southern Territories",
222
+ "TG": "Togo",
223
+ "TH": "Thailand",
224
+ "TJ": "Tajikistan",
225
+ "TK": "Tokelau",
226
+ "TL": "Timor-Leste",
227
+ "TM": "Turkmenistan",
228
+ "TN": "Tunisia",
229
+ "TO": "Tonga",
230
+ "TR": "Turkey",
231
+ "TT": "Trinidad and Tobago",
232
+ "TV": "Tuvalu",
233
+ "TW": "Taiwan",
234
+ "TZ": "Tanzania",
235
+ "UA": "Ukraine",
236
+ "UG": "Uganda",
237
+ "UM": "United States Minor Outlying Islands",
238
+ "US": "United States",
239
+ "UY": "Uruguay",
240
+ "UZ": "Uzbekistan",
241
+ "VA": "Holy See (Vatican City State)",
242
+ "VC": "Saint Vincent and the Grenadines",
243
+ "VE": "Venezuela",
244
+ "VG": "Virgin Islands, British",
245
+ "VI": "Virgin Islands, U.S.",
246
+ "VN": "Vietnam",
247
+ "VU": "Vanuatu",
248
+ "WF": "Wallis and Futuna",
249
+ "WS": "Samoa",
250
+ "XK": "Kosovo",
251
+ "YE": "Yemen",
252
+ "YT": "Mayotte",
253
+ "ZA": "South Africa",
254
+ "ZM": "Zambia",
255
+ "ZW": "Zimbabwe",
256
+ "ZZ": "International"
257
+ }
@@ -7,7 +7,7 @@ import ReactTooltip from "react-tooltip";
7
7
  import CheckoutViewModel, { CheckoutStep } from "./model";
8
8
  import { IkasCheckoutSettings } from "../../models/data/checkout-settings";
9
9
  import { IkasCheckout } from "../../models/data/checkout";
10
- import { formatCurrency, useTranslation } from "../../utils";
10
+ import { formatMoney, useTranslation } from "../../utils";
11
11
 
12
12
  import CheckoutStepInfo from "./steps/step-info";
13
13
  import { CheckoutStepShipping } from "./steps/step-shipping";
@@ -355,7 +355,7 @@ const Steps: React.FC<CommonProps> = observer(({ vm }) => {
355
355
  ),
356
356
  ];
357
357
 
358
- if (vm.deliveryMethod === "address" && !vm.isDigitalOnly) {
358
+ if (vm.deliveryMethod === "address") {
359
359
  steps.splice(
360
360
  1,
361
361
  0,
@@ -366,16 +366,15 @@ const Steps: React.FC<CommonProps> = observer(({ vm }) => {
366
366
  vm.step === CheckoutStep.PAYMENT ? (
367
367
  <div className={styles.AdressStepInfo}>
368
368
  <StepSummaryShipping vm={vm} />
369
- {((vm.checkout.availableShippingMethods &&
370
- vm.checkout.availableShippingMethods.length > 1) ||
371
- vm.checkoutSettings.isGiftPackageEnabled) && (
372
- <div
373
- className={styles.EditBtn}
374
- onClick={vm.onBackToShippingClick}
375
- >
376
- {t("checkout-page:actions.edit")}
377
- </div>
378
- )}
369
+ {vm.checkout.availableShippingMethods &&
370
+ vm.checkout.availableShippingMethods.length > 1 && (
371
+ <div
372
+ className={styles.EditBtn}
373
+ onClick={vm.onBackToShippingClick}
374
+ >
375
+ {t("checkout-page:actions.edit")}
376
+ </div>
377
+ )}
379
378
  </div>
380
379
  ) : undefined,
381
380
  vm.step === CheckoutStep.PAYMENT ? (
@@ -393,13 +392,10 @@ const Steps: React.FC<CommonProps> = observer(({ vm }) => {
393
392
  const StepSummaryAddress: React.FC<CommonProps> = observer(({ vm }) => {
394
393
  const { t } = useTranslation();
395
394
 
396
- const customerName = vm.isDigitalOnly
397
- ? (vm.checkout.billingAddress?.firstName || "") +
398
- " " +
399
- (vm.checkout.billingAddress?.lastName || "")
400
- : (vm.checkout.shippingAddress?.firstName || "") +
401
- " " +
402
- (vm.checkout.shippingAddress?.lastName || "");
395
+ const customerName =
396
+ (vm.checkout.shippingAddress?.firstName || "") +
397
+ " " +
398
+ (vm.checkout.shippingAddress?.lastName || "");
403
399
 
404
400
  return (
405
401
  <div className={styles.Address}>
@@ -418,9 +414,7 @@ const StepSummaryAddress: React.FC<CommonProps> = observer(({ vm }) => {
418
414
  )}
419
415
 
420
416
  <div className={[styles.Text, styles.Gray].join(" ")}>
421
- {vm.isDigitalOnly
422
- ? vm.checkout.billingAddress?.phone
423
- : vm.checkout.shippingAddress?.phone}
417
+ {vm.checkout.shippingAddress?.phone}
424
418
  </div>
425
419
 
426
420
  {vm.deliveryMethod === "in-store" && (
@@ -431,9 +425,7 @@ const StepSummaryAddress: React.FC<CommonProps> = observer(({ vm }) => {
431
425
  </>
432
426
  )}
433
427
  <div className={[styles.Text, styles.Gray].join(" ")}>
434
- {vm.isDigitalOnly
435
- ? vm.checkout.billingAddress?.addressText
436
- : vm.checkout.shippingAddress?.addressText}
428
+ {vm.checkout.shippingAddress?.addressText}
437
429
  </div>
438
430
  </div>
439
431
  );
@@ -451,10 +443,9 @@ const StepSummaryShipping: React.FC<CommonProps> = observer(({ vm }) => {
451
443
  {" / " +
452
444
  (vm.checkout.shippingLines[0].price === 0
453
445
  ? t("checkout-page:free")
454
- : formatCurrency(
446
+ : formatMoney(
455
447
  vm.checkout.shippingLines[0].price,
456
- vm.checkout!.currencyCode,
457
- vm.checkout.currencySymbol
448
+ vm.checkout!.currencyCode
458
449
  ))}
459
450
  </span>
460
451
  </React.Fragment>