@ikas/storefront 4.1.2 → 4.1.3

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.
@@ -1 +1 @@
1
- import{__awaiter as e,__generator as t}from'./../../../../ext/tslib/tslib.es6.js';import"../../../../models/data/blog/category/index.js";import"../../../../models/data/blog/content/index.js";import"../../../../models/data/blog/meta-data/index.js";import"../../../../models/data/blog/tag/index.js";import"../../../../models/data/blog/index.js";import"../../../../models/data/brand/index.js";import"@ikas/storefront-models";import{makeAutoObservable as s}from"mobx";import"../../../../models/data/campaign-offer/index.js";import"../../../../models/data/cart/campaign-offer/index.js";import"../../../../models/data/cart/index.js";import"../../../../models/data/category/path-item/index.js";import"../../../../models/data/category/index.js";import"../../../../models/data/checkout/index.js";import"../../../../models/data/checkout-settings/index.js";import"../../../../models/data/city/index.js";import"../../../../models/data/country/index.js";import{IkasCustomerAddress as i}from"../../../../models/data/customer/address/index.js";import"../../../../models/data/customer/attribute/index.js";import"../../../../models/data/customer/review/summary/index.js";import"../../../../models/data/customer/review/index.js";import"../../../../models/data/customer/index.js";import"../../../../models/data/district/index.js";import"../../../../models/data/favorite-product/index.js";import"../../../../models/data/filter-category/index.js";import"../../../../models/data/html-meta-data/index.js";import"../../../../models/data/image/index.js";import"../../../../models/data/order/address/index.js";import"../../../../models/data/order/line-item/option/value/index.js";import"../../../../models/data/order/line-item/variant/value/index.js";import"../../../../models/data/order/line-item/variant/index.js";import"../../../../models/data/order/line-item/index.js";import"../../../../models/data/order/package/index.js";import"../../../../models/data/order/index.js";import"../../../../models/data/payment-gateway/index.js";import"../../../../models/data/product/attribute-value/index.js";import"../../../../models/data/product/filter/index.js";import"../../../../models/data/product/option-set/option/index.js";import"../../../../models/data/product/option-set/index.js";import"../../../../models/data/product/variant/price/index.js";import"../../../../models/data/product/variant/index.js";import"../../../../models/data/variant-type/index.js";import"../../../../models/data/product/index.js";import"../../../../models/data/raffle/index.js";import"../../../../models/data/state/index.js";import"../../../../models/data/theme-json/index.js";import"../../../../models/data/theme-json/custom-data/index.js";import"../../../../models/data/variant-type/variant-value/index.js";import"../../../../models/ui/blog-list/index.js";import"../../../../models/ui/blog-category-list/index.js";import"../../../../models/ui/brand-list/index.js";import"../../../../models/ui/category-list/index.js";import"../../../../models/ui/product-list/index.js";import"../../../../models/ui/product-attribute-detail/index.js";import"../../../../models/ui/product-attribute-list/index.js";import"../../../../models/ui/customer-review-list/index.js";import"../../../../models/ui/customer-review-summary-list/index.js";import"../../../../models/ui/validator/index.js";import"../../../../models/ui/validator/rules/index.js";import"../../../../models/ui/validator/form/login.js";import"../../../../models/ui/validator/form/address.js";import"../../../../models/ui/validator/form/register.js";import"../../../../models/ui/validator/form/contact-form.js";import"../../../../models/ui/validator/form/forgot-password.js";import"../../../../models/ui/validator/form/recover-password.js";import"../../../../models/ui/validator/form/account-info.js";import"../../../../models/ui/validator/form/raffle-form.js";import"../../../../models/ui/validator/form/customer-review.js";import"../../../../models/ui/raffle-list/index.js";import d from"lodash/cloneDeep";var o=function(){function o(o,r){var a=this;this.editingCustomerAddress=null,this.isDeleteAddressLoading=!1,this.isEditAddressLoading=!1,this.isEditAddressErrorsVisible=!1,this.onAddressSelect=function(e){("shipping"===a.addressType?a.vm.onSelectedShippingAddressIdChange:a.vm.onSelectedBillingAddressIdChange)((null==e?void 0:e.id)||"-1")},this.onEditAddressClick=function(e){var t=new i(d(e));t.checkoutSettings=a.vm.checkoutSettings,a.editingCustomerAddress=t},this.onCancelEditAddressClick=function(){a.isDeleteAddressLoading||a.isEditAddressLoading||(a.editingCustomerAddress=null)},this.onDeleteAddressClick=function(){return e(a,void 0,void 0,(function(){var e,s,i,o,r,a=this;return t(this,(function(t){switch(t.label){case 0:if(-1===(e=null===(o=null===(i=this.vm.store.customerStore.customer)||void 0===i?void 0:i.addresses)||void 0===o?void 0:o.findIndex((function(e){var t;return e.id===(null===(t=a.editingCustomerAddress)||void 0===t?void 0:t.id)})))||void 0===e)return[3,5];s=d(this.vm.store.customerStore.customer),null===(r=s.addresses)||void 0===r||r.splice(e,1),t.label=1;case 1:return t.trys.push([1,3,4,5]),this.isDeleteAddressLoading=!0,[4,this.vm.store.customerStore.saveCustomer(s)];case 2:return t.sent()&&(this.editingCustomerAddress=null),[3,5];case 3:return t.sent(),[3,5];case 4:return this.isDeleteAddressLoading=!1,[7];case 5:return[2]}}))}))},this.onSaveAddressClick=function(){return e(a,void 0,void 0,(function(){var e,s,i,o,r,a=this;return t(this,(function(t){switch(t.label){case 0:if(this.isDeleteAddressLoading||this.isEditAddressLoading)return[2];if(!(null===(i=this.editingCustomerAddress)||void 0===i?void 0:i.isValid))return this.isEditAddressErrorsVisible=!0,[2];if(-1===(e=null===(r=null===(o=this.vm.store.customerStore.customer)||void 0===o?void 0:o.addresses)||void 0===r?void 0:r.findIndex((function(e){var t;return e.id===(null===(t=a.editingCustomerAddress)||void 0===t?void 0:t.id)})))||void 0===e)return[3,5];(s=d(this.vm.store.customerStore.customer)).addresses[e]=this.editingCustomerAddress,t.label=1;case 1:return t.trys.push([1,3,4,5]),this.isEditAddressLoading=!0,[4,this.vm.store.customerStore.saveCustomer(s)];case 2:return t.sent()&&(this.onAddressSelect(this.editingCustomerAddress),this.editingCustomerAddress=null,this.isEditAddressErrorsVisible=!1),[3,5];case 3:return t.sent(),[3,5];case 4:return this.isEditAddressLoading=!1,[7];case 5:return[2]}}))}))},this.firstNameChangeCallback=function(e){(!a.vm.checkout.hasCustomer&&"shipping"===a.addressType||a.vm.isDigitalOnly)&&(a.vm.checkout.customer.firstName=e)},this.lastNameChangeCallback=function(e){(!a.vm.checkout.hasCustomer&&"shipping"===a.addressType||a.vm.isDigitalOnly)&&(a.vm.checkout.customer.lastName=e)},this.vm=o,this.addressType=r,s(this)}return Object.defineProperty(o.prototype,"address",{get:function(){return"shipping"===this.addressType?this.vm.checkout.shippingAddress:this.vm.checkout.billingAddress},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"selectedAddressId",{get:function(){return"shipping"===this.addressType?this.vm.selectedShippingAddressId:this.vm.selectedBillingAddressId},enumerable:!1,configurable:!0}),o}();export{o as default};
1
+ import{__awaiter as e,__generator as t}from'./../../../../ext/tslib/tslib.es6.js';import"../../../../models/data/blog/category/index.js";import"../../../../models/data/blog/content/index.js";import"../../../../models/data/blog/meta-data/index.js";import"../../../../models/data/blog/tag/index.js";import"../../../../models/data/blog/index.js";import"../../../../models/data/brand/index.js";import"@ikas/storefront-models";import{makeAutoObservable as s}from"mobx";import"../../../../models/data/campaign-offer/index.js";import"../../../../models/data/cart/campaign-offer/index.js";import"../../../../models/data/cart/index.js";import"../../../../models/data/category/path-item/index.js";import"../../../../models/data/category/index.js";import"../../../../models/data/checkout/index.js";import"../../../../models/data/checkout-settings/index.js";import"../../../../models/data/city/index.js";import"../../../../models/data/country/index.js";import{IkasCustomerAddress as i}from"../../../../models/data/customer/address/index.js";import"../../../../models/data/customer/attribute/index.js";import"../../../../models/data/customer/review/summary/index.js";import"../../../../models/data/customer/review/index.js";import"../../../../models/data/customer/index.js";import"../../../../models/data/district/index.js";import"../../../../models/data/favorite-product/index.js";import"../../../../models/data/filter-category/index.js";import"../../../../models/data/html-meta-data/index.js";import"../../../../models/data/image/index.js";import"../../../../models/data/order/address/index.js";import"../../../../models/data/order/line-item/option/value/index.js";import"../../../../models/data/order/line-item/variant/value/index.js";import"../../../../models/data/order/line-item/variant/index.js";import"../../../../models/data/order/line-item/index.js";import"../../../../models/data/order/package/index.js";import"../../../../models/data/order/index.js";import"../../../../models/data/payment-gateway/index.js";import"../../../../models/data/product/attribute-value/index.js";import"../../../../models/data/product/filter/index.js";import"../../../../models/data/product/option-set/option/index.js";import"../../../../models/data/product/option-set/index.js";import"../../../../models/data/product/variant/price/index.js";import"../../../../models/data/product/variant/index.js";import"../../../../models/data/variant-type/index.js";import"../../../../models/data/product/index.js";import"../../../../models/data/raffle/index.js";import"../../../../models/data/state/index.js";import"../../../../models/data/theme-json/index.js";import"../../../../models/data/theme-json/custom-data/index.js";import"../../../../models/data/variant-type/variant-value/index.js";import"../../../../models/ui/blog-list/index.js";import"../../../../models/ui/blog-category-list/index.js";import"../../../../models/ui/brand-list/index.js";import"../../../../models/ui/category-list/index.js";import"../../../../models/ui/product-list/index.js";import"../../../../models/ui/product-attribute-detail/index.js";import"../../../../models/ui/product-attribute-list/index.js";import"../../../../models/ui/customer-review-list/index.js";import"../../../../models/ui/customer-review-summary-list/index.js";import"../../../../models/ui/validator/index.js";import"../../../../models/ui/validator/rules/index.js";import"../../../../models/ui/validator/form/login.js";import"../../../../models/ui/validator/form/address.js";import"../../../../models/ui/validator/form/register.js";import"../../../../models/ui/validator/form/contact-form.js";import"../../../../models/ui/validator/form/forgot-password.js";import"../../../../models/ui/validator/form/recover-password.js";import"../../../../models/ui/validator/form/account-info.js";import"../../../../models/ui/validator/form/raffle-form.js";import"../../../../models/ui/validator/form/customer-review.js";import"../../../../models/ui/raffle-list/index.js";import d from"lodash/cloneDeep";var o=function(){function o(o,r){var a=this;this.editingCustomerAddress=null,this.isDeleteAddressLoading=!1,this.isEditAddressLoading=!1,this.isEditAddressErrorsVisible=!1,this.onAddressSelect=function(e){("shipping"===a.addressType?a.vm.onSelectedShippingAddressIdChange:a.vm.onSelectedBillingAddressIdChange)((null==e?void 0:e.id)||"-1")},this.onEditAddressClick=function(e){var t=new i(d(e));t.checkoutSettings=a.vm.checkoutSettings,a.editingCustomerAddress=t},this.onCancelEditAddressClick=function(){a.isDeleteAddressLoading||a.isEditAddressLoading||(a.editingCustomerAddress=null)},this.onDeleteAddressClick=function(){return e(a,void 0,void 0,(function(){var e,s,i,o,r,a=this;return t(this,(function(t){switch(t.label){case 0:if(-1===(e=null===(o=null===(i=this.vm.store.customerStore.customer)||void 0===i?void 0:i.addresses)||void 0===o?void 0:o.findIndex((function(e){var t;return e.id===(null===(t=a.editingCustomerAddress)||void 0===t?void 0:t.id)})))||void 0===e)return[3,5];s=d(this.vm.store.customerStore.customer),null===(r=s.addresses)||void 0===r||r.splice(e,1),t.label=1;case 1:return t.trys.push([1,3,4,5]),this.isDeleteAddressLoading=!0,[4,this.vm.store.customerStore.saveCustomer(s)];case 2:return t.sent()&&(this.editingCustomerAddress=null),[3,5];case 3:return t.sent(),[3,5];case 4:return this.isDeleteAddressLoading=!1,[7];case 5:return[2]}}))}))},this.onSaveAddressClick=function(){return e(a,void 0,void 0,(function(){var e,s,i,o,r,a,m,n=this;return t(this,(function(t){switch(t.label){case 0:if(this.isDeleteAddressLoading||this.isEditAddressLoading)return[2];if(!(null===(i=this.editingCustomerAddress)||void 0===i?void 0:i.isValid))return this.isEditAddressErrorsVisible=!0,[2];if(-1===(e=null===(r=null===(o=this.vm.store.customerStore.customer)||void 0===o?void 0:o.addresses)||void 0===r?void 0:r.findIndex((function(e){var t;return e.id===(null===(t=n.editingCustomerAddress)||void 0===t?void 0:t.id)})))||void 0===e)return[3,5];(s=d(this.vm.store.customerStore.customer)).addresses[e]=this.editingCustomerAddress,t.label=1;case 1:return t.trys.push([1,3,4,5]),this.isEditAddressLoading=!0,[4,this.vm.store.customerStore.saveCustomer(s)];case 2:return t.sent()&&(null===(m=null===(a=this.vm.store.customerStore.customer)||void 0===a?void 0:a.addresses)||void 0===m||m.forEach((function(e){return e.checkoutSettings=n.vm.checkoutSettings})),this.onAddressSelect(this.editingCustomerAddress),this.editingCustomerAddress=null,this.isEditAddressErrorsVisible=!1),[3,5];case 3:return t.sent(),[3,5];case 4:return this.isEditAddressLoading=!1,[7];case 5:return[2]}}))}))},this.firstNameChangeCallback=function(e){(!a.vm.checkout.hasCustomer&&"shipping"===a.addressType||a.vm.isDigitalOnly)&&(a.vm.checkout.customer.firstName=e)},this.lastNameChangeCallback=function(e){(!a.vm.checkout.hasCustomer&&"shipping"===a.addressType||a.vm.isDigitalOnly)&&(a.vm.checkout.customer.lastName=e)},this.vm=o,this.addressType=r,s(this)}return Object.defineProperty(o.prototype,"address",{get:function(){return"shipping"===this.addressType?this.vm.checkout.shippingAddress:this.vm.checkout.billingAddress},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"selectedAddressId",{get:function(){return"shipping"===this.addressType?this.vm.selectedShippingAddressId:this.vm.selectedBillingAddressId},enumerable:!1,configurable:!0}),o}();export{o as default};
@@ -1 +1 @@
1
- import{__awaiter as e,__generator as t}from'./../../../../ext/tslib/tslib.es6.js';import*as a from"react";import{observer as r}from"mobx-react-lite";import l,{formatIncompletePhoneNumber as n,getCountryCallingCode as s,parseIncompletePhoneNumber as o}from"libphonenumber-js";import c from"./get-countries.js";import u from"./style.module.scss.js";var i=r((function(r){var i=r.defaultCountry,m=r.disabled,v=void 0!==m&&m,f=r.placeholder,d=r.value,g=r.onChange,p=a.useState([]),b=p[0],E=p[1],h=a.useState(i||"TR"),y=h[0],N=h[1],C=a.useState(""),F=C[0],S=C[1];a.useEffect((function(){j();var e=y;if(d){var t=l(d);t&&t.country&&(e=t.country),S(n(d,e))}else x(e);N(e)}),[]);var j=function(){return e(void 0,void 0,void 0,(function(){var e;return t(this,(function(t){switch(t.label){case 0:return[4,c()];case 1:return e=t.sent(),E(e),[2]}}))}))},x=function(e){var t=s(e);S("+".concat(t))},k=function(e){return n(e,y)};return a.createElement(a.Fragment,null,a.createElement("div",{className:u.SelectFlag},a.createElement("div",{className:u.FlagContainer},a.createElement("div",{className:u.Flag},a.createElement("img",{className:u.FlagImage,alt:y,src:"https://cdn.myikas.com/sf/assets/flags/3x2/".concat(y,".svg")}),a.createElement("div",{className:u.Arrow})),a.createElement("select",{className:u.Select,value:y,onChange:function(e){if(e.target.value){var t=e.target.value;N(t),x(t)}},disabled:v},b.map((function(e){return a.createElement("option",{key:e.value,value:e.value},e.label)}))))),a.createElement("input",{type:"tel",autoComplete:"tel",className:u.Input,value:F,onChange:function(e){var t=k(e.target.value);S(t),g(t?o(t):e.target.value)},placeholder:f,disabled:v}))}));export{i as PhoneNumberInput};
1
+ import{__awaiter as e,__generator as t}from'./../../../../ext/tslib/tslib.es6.js';import*as a from"react";import{observer as r}from"mobx-react-lite";import n,{formatIncompletePhoneNumber as l,getCountryCallingCode as o,parseIncompletePhoneNumber as s}from"libphonenumber-js";import c from"./get-countries.js";import u from"./style.module.scss.js";var i=r((function(r){var i=r.defaultCountry,m=r.disabled,v=void 0!==m&&m,f=r.placeholder,d=r.value,g=r.onChange,p=a.useState([]),b=p[0],E=p[1],h=a.useState(i||"TR"),y=h[0],N=h[1],C=a.useState(""),F=C[0],S=C[1];a.useEffect((function(){j();var e=y;if(d){var t=n(d);t&&t.country&&(e=t.country),S(l(d,e))}else x(e);N(e)}),[]);var j=function(){return e(void 0,void 0,void 0,(function(){var e;return t(this,(function(t){switch(t.label){case 0:return[4,c()];case 1:return e=t.sent(),E(e),[2]}}))}))},x=function(e){var t=o(e);S("+".concat(t))},k=function(e){return l(e,y)};return a.createElement(a.Fragment,null,a.createElement("div",{className:u.SelectFlag},a.createElement("div",{className:u.FlagContainer},a.createElement("div",{className:u.Flag},a.createElement("img",{className:u.FlagImage,alt:y,src:"https://cdn.myikas.com/sf/assets/flags/3x2/".concat(y,".svg")}),a.createElement("div",{className:u.Arrow})),a.createElement("select",{className:u.Select,value:y,onChange:function(e){if(e.target.value){var t=e.target.value;N(t),x(t)}},disabled:v},b.map((function(e){return a.createElement("option",{key:e.value,value:e.value},e.label)}))))),a.createElement("input",{type:"tel",autoComplete:"tel",className:u.Input,value:F,onChange:function(e){var t=b.find((function(t){var a;return t.value===(null===(a=n(e.target.value))||void 0===a?void 0:a.country)}));t&&N(t.value);var a=k(e.target.value);S(a),g(a?s(a):e.target.value)},placeholder:f,disabled:v}))}));export{i as PhoneNumberInput};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ikas/storefront",
3
- "version": "4.1.2",
3
+ "version": "4.1.3",
4
4
  "description": "Storefront functionality for ikas storefront themes.",
5
5
  "author": "ikas",
6
6
  "license": "ISC",
@@ -18,11 +18,11 @@
18
18
  },
19
19
  "dependencies": {},
20
20
  "devDependencies": {
21
- "@ikas/storefront-api": "^4.1.2",
22
- "@ikas/storefront-config": "^4.1.2",
23
- "@ikas/storefront-model-functions": "^4.1.2",
24
- "@ikas/storefront-models": "^4.1.2",
25
- "@ikas/storefront-providers": "^4.1.2",
21
+ "@ikas/storefront-api": "^4.1.3",
22
+ "@ikas/storefront-config": "^4.1.3",
23
+ "@ikas/storefront-model-functions": "^4.1.3",
24
+ "@ikas/storefront-models": "^4.1.3",
25
+ "@ikas/storefront-providers": "^4.1.3",
26
26
  "@rollup/plugin-commonjs": "^22.0.0",
27
27
  "@rollup/plugin-json": "^4.1.0",
28
28
  "@rollup/plugin-node-resolve": "^13.3.0",
@@ -52,11 +52,11 @@
52
52
  "libphonenumber-js": "^1.10.6"
53
53
  },
54
54
  "peerDependencies": {
55
- "@ikas/storefront-api": "^4.1.2",
56
- "@ikas/storefront-config": "^4.1.2",
57
- "@ikas/storefront-model-functions": "^4.1.2",
58
- "@ikas/storefront-models": "^4.1.2",
59
- "@ikas/storefront-providers": "^4.1.2",
55
+ "@ikas/storefront-api": "^4.1.3",
56
+ "@ikas/storefront-config": "^4.1.3",
57
+ "@ikas/storefront-model-functions": "^4.1.3",
58
+ "@ikas/storefront-models": "^4.1.3",
59
+ "@ikas/storefront-providers": "^4.1.3",
60
60
  "mobx": "^6.1.3",
61
61
  "mobx-react-lite": "^3.1.5",
62
62
  "next": "12.2.0",