@ikas/storefront 0.1.19 → 0.1.21

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.
@@ -26,7 +26,7 @@ export default class AddressFormViewModel {
26
26
  states: IkasState[];
27
27
  cities: IkasCity[];
28
28
  districts: IkasDistrict[];
29
- myCountryCode?: string;
29
+ myCountryCode?: string | null;
30
30
  constructor(data: AddressFormViewModelParams);
31
31
  get firstName(): string | null | undefined;
32
32
  get lastName(): string | null | undefined;
package/build/index.css CHANGED
@@ -980,28 +980,6 @@
980
980
  color: var(--checkout-secondary-text-color);
981
981
  text-decoration: line-through;
982
982
  margin-right: 8px; }
983
- .style-module_CheckoutItem__2JjSt .style-module_Price__1Vw31 .style-module_DiscountIcon__39hOP {
984
- margin-left: 8px;
985
- position: relative;
986
- display: flex;
987
- align-items: center;
988
- justify-content: center; }
989
- .style-module_CheckoutItem__2JjSt .style-module_Price__1Vw31 .style-module_DiscountIcon__39hOP:hover .style-module_DiscountTooltip__2hO7z {
990
- display: block; }
991
- .style-module_CheckoutItem__2JjSt .style-module_Price__1Vw31 .style-module_DiscountIcon__39hOP .style-module_DiscountTooltip__2hO7z {
992
- display: none;
993
- position: absolute;
994
- bottom: 120%;
995
- margin: auto;
996
- padding: 12px;
997
- border-radius: 4px;
998
- background-color: white;
999
- box-shadow: 0px 4px 20px rgba(110, 113, 117, 0.12);
1000
- width: 200px; }
1001
- .style-module_CheckoutItem__2JjSt .style-module_Price__1Vw31 .style-module_DiscountIcon__39hOP .style-module_DiscountTooltip__2hO7z .style-module_DiscountAdjustment__3QUlC {
1002
- margin-bottom: 4px; }
1003
- .style-module_CheckoutItem__2JjSt .style-module_Price__1Vw31 .style-module_DiscountIcon__39hOP .style-module_DiscountTooltip__2hO7z .style-module_DiscountAdjustment__3QUlC:last-of-type {
1004
- margin-bottom: 0; }
1005
983
 
1006
984
  .style-module_TooltipContainer__1IW8v {
1007
985
  width: 16px;
@@ -980,28 +980,6 @@
980
980
  color: var(--checkout-secondary-text-color);
981
981
  text-decoration: line-through;
982
982
  margin-right: 8px; }
983
- .style-module_CheckoutItem__2JjSt .style-module_Price__1Vw31 .style-module_DiscountIcon__39hOP {
984
- margin-left: 8px;
985
- position: relative;
986
- display: flex;
987
- align-items: center;
988
- justify-content: center; }
989
- .style-module_CheckoutItem__2JjSt .style-module_Price__1Vw31 .style-module_DiscountIcon__39hOP:hover .style-module_DiscountTooltip__2hO7z {
990
- display: block; }
991
- .style-module_CheckoutItem__2JjSt .style-module_Price__1Vw31 .style-module_DiscountIcon__39hOP .style-module_DiscountTooltip__2hO7z {
992
- display: none;
993
- position: absolute;
994
- bottom: 120%;
995
- margin: auto;
996
- padding: 12px;
997
- border-radius: 4px;
998
- background-color: white;
999
- box-shadow: 0px 4px 20px rgba(110, 113, 117, 0.12);
1000
- width: 200px; }
1001
- .style-module_CheckoutItem__2JjSt .style-module_Price__1Vw31 .style-module_DiscountIcon__39hOP .style-module_DiscountTooltip__2hO7z .style-module_DiscountAdjustment__3QUlC {
1002
- margin-bottom: 4px; }
1003
- .style-module_CheckoutItem__2JjSt .style-module_Price__1Vw31 .style-module_DiscountIcon__39hOP .style-module_DiscountTooltip__2hO7z .style-module_DiscountAdjustment__3QUlC:last-of-type {
1004
- margin-bottom: 0; }
1005
983
 
1006
984
  .style-module_TooltipContainer__1IW8v {
1007
985
  width: 16px;
package/build/index.es.js CHANGED
@@ -68440,10 +68440,8 @@ var FormItem = observer(function (props) {
68440
68440
  });
68441
68441
  }, [props.onChange]);
68442
68442
  useEffect(function () {
68443
- console.log("currentCountry:", props.currentCountryCode);
68444
68443
  if (!vm.country && props.currentCountryCode) {
68445
- console.log("onchange");
68446
- vm.onPhoneChange(props.currentCountryCode);
68444
+ vm.onCountryChange(props.currentCountryCode);
68447
68445
  }
68448
68446
  }, [props.currentCountryCode]);
68449
68447
  return (createElement("div", { className: vm.formItemStyle, style: props.style },
@@ -68451,7 +68449,7 @@ var FormItem = observer(function (props) {
68451
68449
  createElement("div", { className: styles.FormItemInputWrapper },
68452
68450
  createElement("label", { className: vm.labelStyle }, vm.label),
68453
68451
  vm.type === FormItemType.TEXT && (createElement(Input$2, { vm: vm, autocomplete: props.autocomplete, name: props.name })),
68454
- vm.type === FormItemType.TEL && (createElement(PhoneInput, { defaultCountry: props.currentCountryCode, placeholder: t("checkout-page:enterPhoneNumber"), value: vm.value ? vm.value : "", onChange: vm.onPhoneChange, international: true, addInternationalOption: false })),
68452
+ vm.type === FormItemType.TEL && (createElement(PhoneInput, { key: props.currentCountryCode || "1", defaultCountry: props.currentCountryCode, placeholder: t("checkout-page:enterPhoneNumber"), value: vm.value ? vm.value : "", onChange: vm.onPhoneChange, international: true, addInternationalOption: false })),
68455
68453
  vm.type === FormItemType.TEXT_AREA && createElement(TextArea, { vm: vm }),
68456
68454
  vm.type === FormItemType.SELECT && (createElement(Select, { vm: vm, autocomplete: props.autocomplete }))),
68457
68455
  !!vm.hasError && (createElement("div", { className: styles.ErrorMsg }, vm.errorText || "")),
@@ -68699,6 +68697,7 @@ var AddressFormViewModel = /** @class */ (function () {
68699
68697
  this.states = [];
68700
68698
  this.cities = [];
68701
68699
  this.districts = [];
68700
+ this.myCountryCode = null;
68702
68701
  this.fillDropdownOptions = function () { return __awaiter(_this, void 0, void 0, function () {
68703
68702
  return __generator(this, function (_a) {
68704
68703
  switch (_a.label) {
@@ -69715,16 +69714,7 @@ var InputWithButton = function (_a) {
69715
69714
  };
69716
69715
  var InputWithButton$1 = observer(InputWithButton);
69717
69716
 
69718
- var styles$e = {"CheckoutItem":"style-module_CheckoutItem__2JjSt","ImageContainer":"style-module_ImageContainer__2K2RG","Image":"style-module_Image__w2Q_P","Right":"style-module_Right__2HN2l","Name":"style-module_Name__nPgw1","LightText":"style-module_LightText__2P69D","Price":"style-module_Price__1Vw31","GrayPrice":"style-module_GrayPrice__2wDyJ","DiscountIcon":"style-module_DiscountIcon__39hOP","DiscountTooltip":"style-module_DiscountTooltip__2hO7z","DiscountAdjustment":"style-module_DiscountAdjustment__3QUlC"};
69719
-
69720
- var SVGDiscount = function (_a) {
69721
- var className = _a.className;
69722
- return (createElement("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", className: className },
69723
- createElement("circle", { cx: "8", cy: "8", r: "8", fill: "#CFCED3" }),
69724
- createElement("path", { d: "M10.9167 5.08301L5.08334 10.9163", stroke: "white", "stroke-linecap": "square", "stroke-linejoin": "round" }),
69725
- createElement("path", { d: "M5.70832 6.75033C6.28362 6.75033 6.74999 6.28396 6.74999 5.70866C6.74999 5.13336 6.28362 4.66699 5.70832 4.66699C5.13303 4.66699 4.66666 5.13336 4.66666 5.70866C4.66666 6.28396 5.13303 6.75033 5.70832 6.75033Z", fill: "white" }),
69726
- createElement("path", { d: "M10.2917 11.3333C10.867 11.3333 11.3333 10.867 11.3333 10.2917C11.3333 9.71637 10.867 9.25 10.2917 9.25C9.71637 9.25 9.25 9.71637 9.25 10.2917C9.25 10.867 9.71637 11.3333 10.2917 11.3333Z", fill: "white" })));
69727
- };
69717
+ var styles$e = {"CheckoutItem":"style-module_CheckoutItem__2JjSt","ImageContainer":"style-module_ImageContainer__2K2RG","Image":"style-module_Image__w2Q_P","Right":"style-module_Right__2HN2l","Name":"style-module_Name__nPgw1","LightText":"style-module_LightText__2P69D","Price":"style-module_Price__1Vw31","GrayPrice":"style-module_GrayPrice__2wDyJ"};
69728
69718
 
69729
69719
  var CartItem = observer(function (_a) {
69730
69720
  var _b, _c;
@@ -69734,6 +69724,7 @@ var CartItem = observer(function (_a) {
69734
69724
  return a.appliedOrderLines &&
69735
69725
  a.appliedOrderLines.some(function (aol) { return aol.orderLineId === cartItem.id; });
69736
69726
  });
69727
+ var adjustmentTotal = (adjustments === null || adjustments === void 0 ? void 0 : adjustments.reduce(function (total, current) { return total + current.amount; }, 0)) || 0;
69737
69728
  return (createElement("div", { className: styles$e.CheckoutItem },
69738
69729
  createElement("div", { className: styles$e.ImageContainer },
69739
69730
  createElement("img", { className: styles$e.Image, src: (_c = cartItem.variant.mainImage) === null || _c === void 0 ? void 0 : _c.thumbnailSrc })),
@@ -69744,11 +69735,12 @@ var CartItem = observer(function (_a) {
69744
69735
  .map(function (vv) { return vv.variantValueName; })
69745
69736
  .join(" / ")),
69746
69737
  createElement("div", { className: styles$e.Price },
69747
- !!cartItem.overridenPriceWithQuantity && (createElement("span", { className: styles$e.GrayPrice }, formatMoney(cartItem.overridenPriceWithQuantity, currencyCode))),
69748
- formatMoney(cartItem.finalPriceWithQuantity, currencyCode),
69749
- !!(adjustments === null || adjustments === void 0 ? void 0 : adjustments.length) && (createElement("div", { className: styles$e.DiscountIcon, tabIndex: Date.now() },
69750
- createElement(SVGDiscount, null),
69751
- createElement("div", { className: styles$e.DiscountTooltip }, adjustments === null || adjustments === void 0 ? void 0 : adjustments.map(function (adjustment, index) { return (createElement("div", { key: index }, adjustment.name + " (-" + formatMoney(adjustment.amount, currencyCode) + ")")); }))))))));
69738
+ !!cartItem.overridenPriceWithQuantity && (createElement("span", { className: styles$e.GrayPrice }, !!adjustmentTotal
69739
+ ? formatMoney(cartItem.finalPriceWithQuantity, currencyCode)
69740
+ : formatMoney(cartItem.overridenPriceWithQuantity, currencyCode))),
69741
+ !!adjustmentTotal
69742
+ ? formatMoney(cartItem.finalPriceWithQuantity - adjustmentTotal, currencyCode)
69743
+ : formatMoney(cartItem.finalPriceWithQuantity, currencyCode)))));
69752
69744
  });
69753
69745
 
69754
69746
  var styles$f = {"TooltipContainer":"style-module_TooltipContainer__1IW8v","Tooltip":"style-module_Tooltip__1Pxw6","TooltipArrow":"style-module_TooltipArrow__1l6q_","Top":"style-module_Top__1_7C6","Bottom":"style-module_Bottom__2qCpQ","Left":"style-module_Left__1T6gj","Right":"style-module_Right__uCMMF"};
package/build/index.js CHANGED
@@ -68419,10 +68419,8 @@ var FormItem = mobxReactLite.observer(function (props) {
68419
68419
  });
68420
68420
  }, [props.onChange]);
68421
68421
  React.useEffect(function () {
68422
- console.log("currentCountry:", props.currentCountryCode);
68423
68422
  if (!vm.country && props.currentCountryCode) {
68424
- console.log("onchange");
68425
- vm.onPhoneChange(props.currentCountryCode);
68423
+ vm.onCountryChange(props.currentCountryCode);
68426
68424
  }
68427
68425
  }, [props.currentCountryCode]);
68428
68426
  return (React.createElement("div", { className: vm.formItemStyle, style: props.style },
@@ -68430,7 +68428,7 @@ var FormItem = mobxReactLite.observer(function (props) {
68430
68428
  React.createElement("div", { className: styles.FormItemInputWrapper },
68431
68429
  React.createElement("label", { className: vm.labelStyle }, vm.label),
68432
68430
  vm.type === FormItemType.TEXT && (React.createElement(Input$2, { vm: vm, autocomplete: props.autocomplete, name: props.name })),
68433
- vm.type === FormItemType.TEL && (React.createElement(PhoneInput, { defaultCountry: props.currentCountryCode, placeholder: t("checkout-page:enterPhoneNumber"), value: vm.value ? vm.value : "", onChange: vm.onPhoneChange, international: true, addInternationalOption: false })),
68431
+ vm.type === FormItemType.TEL && (React.createElement(PhoneInput, { key: props.currentCountryCode || "1", defaultCountry: props.currentCountryCode, placeholder: t("checkout-page:enterPhoneNumber"), value: vm.value ? vm.value : "", onChange: vm.onPhoneChange, international: true, addInternationalOption: false })),
68434
68432
  vm.type === FormItemType.TEXT_AREA && React.createElement(TextArea, { vm: vm }),
68435
68433
  vm.type === FormItemType.SELECT && (React.createElement(Select, { vm: vm, autocomplete: props.autocomplete }))),
68436
68434
  !!vm.hasError && (React.createElement("div", { className: styles.ErrorMsg }, vm.errorText || "")),
@@ -68678,6 +68676,7 @@ var AddressFormViewModel = /** @class */ (function () {
68678
68676
  this.states = [];
68679
68677
  this.cities = [];
68680
68678
  this.districts = [];
68679
+ this.myCountryCode = null;
68681
68680
  this.fillDropdownOptions = function () { return __awaiter(_this, void 0, void 0, function () {
68682
68681
  return __generator(this, function (_a) {
68683
68682
  switch (_a.label) {
@@ -69694,16 +69693,7 @@ var InputWithButton = function (_a) {
69694
69693
  };
69695
69694
  var InputWithButton$1 = mobxReactLite.observer(InputWithButton);
69696
69695
 
69697
- var styles$e = {"CheckoutItem":"style-module_CheckoutItem__2JjSt","ImageContainer":"style-module_ImageContainer__2K2RG","Image":"style-module_Image__w2Q_P","Right":"style-module_Right__2HN2l","Name":"style-module_Name__nPgw1","LightText":"style-module_LightText__2P69D","Price":"style-module_Price__1Vw31","GrayPrice":"style-module_GrayPrice__2wDyJ","DiscountIcon":"style-module_DiscountIcon__39hOP","DiscountTooltip":"style-module_DiscountTooltip__2hO7z","DiscountAdjustment":"style-module_DiscountAdjustment__3QUlC"};
69698
-
69699
- var SVGDiscount = function (_a) {
69700
- var className = _a.className;
69701
- return (React.createElement("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", className: className },
69702
- React.createElement("circle", { cx: "8", cy: "8", r: "8", fill: "#CFCED3" }),
69703
- React.createElement("path", { d: "M10.9167 5.08301L5.08334 10.9163", stroke: "white", "stroke-linecap": "square", "stroke-linejoin": "round" }),
69704
- React.createElement("path", { d: "M5.70832 6.75033C6.28362 6.75033 6.74999 6.28396 6.74999 5.70866C6.74999 5.13336 6.28362 4.66699 5.70832 4.66699C5.13303 4.66699 4.66666 5.13336 4.66666 5.70866C4.66666 6.28396 5.13303 6.75033 5.70832 6.75033Z", fill: "white" }),
69705
- React.createElement("path", { d: "M10.2917 11.3333C10.867 11.3333 11.3333 10.867 11.3333 10.2917C11.3333 9.71637 10.867 9.25 10.2917 9.25C9.71637 9.25 9.25 9.71637 9.25 10.2917C9.25 10.867 9.71637 11.3333 10.2917 11.3333Z", fill: "white" })));
69706
- };
69696
+ var styles$e = {"CheckoutItem":"style-module_CheckoutItem__2JjSt","ImageContainer":"style-module_ImageContainer__2K2RG","Image":"style-module_Image__w2Q_P","Right":"style-module_Right__2HN2l","Name":"style-module_Name__nPgw1","LightText":"style-module_LightText__2P69D","Price":"style-module_Price__1Vw31","GrayPrice":"style-module_GrayPrice__2wDyJ"};
69707
69697
 
69708
69698
  var CartItem = mobxReactLite.observer(function (_a) {
69709
69699
  var _b, _c;
@@ -69713,6 +69703,7 @@ var CartItem = mobxReactLite.observer(function (_a) {
69713
69703
  return a.appliedOrderLines &&
69714
69704
  a.appliedOrderLines.some(function (aol) { return aol.orderLineId === cartItem.id; });
69715
69705
  });
69706
+ var adjustmentTotal = (adjustments === null || adjustments === void 0 ? void 0 : adjustments.reduce(function (total, current) { return total + current.amount; }, 0)) || 0;
69716
69707
  return (React.createElement("div", { className: styles$e.CheckoutItem },
69717
69708
  React.createElement("div", { className: styles$e.ImageContainer },
69718
69709
  React.createElement("img", { className: styles$e.Image, src: (_c = cartItem.variant.mainImage) === null || _c === void 0 ? void 0 : _c.thumbnailSrc })),
@@ -69723,11 +69714,12 @@ var CartItem = mobxReactLite.observer(function (_a) {
69723
69714
  .map(function (vv) { return vv.variantValueName; })
69724
69715
  .join(" / ")),
69725
69716
  React.createElement("div", { className: styles$e.Price },
69726
- !!cartItem.overridenPriceWithQuantity && (React.createElement("span", { className: styles$e.GrayPrice }, formatMoney(cartItem.overridenPriceWithQuantity, currencyCode))),
69727
- formatMoney(cartItem.finalPriceWithQuantity, currencyCode),
69728
- !!(adjustments === null || adjustments === void 0 ? void 0 : adjustments.length) && (React.createElement("div", { className: styles$e.DiscountIcon, tabIndex: Date.now() },
69729
- React.createElement(SVGDiscount, null),
69730
- React.createElement("div", { className: styles$e.DiscountTooltip }, adjustments === null || adjustments === void 0 ? void 0 : adjustments.map(function (adjustment, index) { return (React.createElement("div", { key: index }, adjustment.name + " (-" + formatMoney(adjustment.amount, currencyCode) + ")")); }))))))));
69717
+ !!cartItem.overridenPriceWithQuantity && (React.createElement("span", { className: styles$e.GrayPrice }, !!adjustmentTotal
69718
+ ? formatMoney(cartItem.finalPriceWithQuantity, currencyCode)
69719
+ : formatMoney(cartItem.overridenPriceWithQuantity, currencyCode))),
69720
+ !!adjustmentTotal
69721
+ ? formatMoney(cartItem.finalPriceWithQuantity - adjustmentTotal, currencyCode)
69722
+ : formatMoney(cartItem.finalPriceWithQuantity, currencyCode)))));
69731
69723
  });
69732
69724
 
69733
69725
  var styles$f = {"TooltipContainer":"style-module_TooltipContainer__1IW8v","Tooltip":"style-module_Tooltip__1Pxw6","TooltipArrow":"style-module_TooltipArrow__1l6q_","Top":"style-module_Top__1_7C6","Bottom":"style-module_Bottom__2qCpQ","Left":"style-module_Left__1T6gj","Right":"style-module_Right__uCMMF"};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ikas/storefront",
3
- "version": "0.1.19",
3
+ "version": "0.1.21",
4
4
  "main": "./build/index.js",
5
5
  "module": "./build/index.es.js",
6
6
  "author": "Umut Ozan Yıldırım",