@ikas/storefront 2.0.29-alpha.2 → 2.0.29-alpha.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.
- package/build/components/checkout/components/address-form/index.js +1 -1
- package/build/components/checkout/components/address-form/model.d.ts +1 -1
- package/build/components/checkout/components/address-form/model.js +1 -1
- package/build/ikas.js +1 -1
- package/build/models/ui/validator/form/address.d.ts +3 -0
- package/build/models/ui/validator/form/address.js +1 -1
- package/build/utils/constants.d.ts +1 -0
- package/build/utils/constants.js +1 -0
- package/package.json +1 -1
|
@@ -35,12 +35,15 @@ export declare class AddressForm {
|
|
|
35
35
|
onCountryChange: (countryId: string) => void;
|
|
36
36
|
onStateChange: (stateId: string) => void;
|
|
37
37
|
onCityChange: (cityId: string) => void;
|
|
38
|
+
onCityInputChange: (value: string) => void;
|
|
38
39
|
onDistrictChange: (districtId: string) => void;
|
|
39
40
|
onDistrictInputChange: (value: string) => void;
|
|
40
41
|
listCountries: () => Promise<void>;
|
|
41
42
|
listStates: () => Promise<void>;
|
|
42
43
|
listCities: () => Promise<void>;
|
|
43
44
|
listDistricts: () => Promise<void>;
|
|
45
|
+
get isFreeTextCity(): boolean;
|
|
46
|
+
get isFreeTextDistrict(): boolean;
|
|
44
47
|
get isEdit(): boolean;
|
|
45
48
|
private get editingAddressIndex();
|
|
46
49
|
get countryOptions(): {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__spreadArray as t,__awaiter as e,__generator as i}from'../../../../ext/tslib/tslib.es6.js';import{makeObservable as s,computed as r,observable as n,action as d}from"mobx";import o from'../../../../ext/lodash/cloneDeep.js';import"../../../../api/blog/index.js";import"../../../../api/brand/index.js";import"../../../../api/cart/index.js";import"../../../../api/category/index.js";import"../../../../api/checkout/index.js";import{IkasCityAPI as a}from"../../../../api/city/index.js";import{IkasCountryAPI as u}from"../../../../api/country/index.js";import"../../../../api/customer/index.js";import"../../../../api/customer-review/index.js";import{IkasDistrictAPI as c}from"../../../../api/district/index.js";import"../../../../api/html-meta-data/index.js";import"../../../../api/merchant/index.js";import"../../../../api/product-search/index.js";import"../../../data/blog/index.js";import"../../../data/brand/index.js";import"../../../data/category/index.js";import"../../../data/checkout/index.js";import"../../../data/customer/address/index.js";import"../../../data/customer/index.js";import"../../../data/customer-review/index.js";import"../../../data/html-meta-data/index.js";import"../../../data/image/index.js";import"../../../data/installment-info/index.js";import"../../../data/order/index.js";import"../../../data/order/line-item/index.js";import"../../../../api/product-option-file/index.js";import"../../../data/product/index.js";import"../../../data/variant-type/index.js";import"../../../data/product/variant/index.js";import"../../../data/product/variant/price/index.js";import"../../../data/product-attribute/index.js";import"../../../data/product/attribute-value/index.js";import"../../../data/product-filter/index.js";import"../../../data/variant-type/variant-value/index.js";import"../../../data/order-transaction/index.js";import"../../../data/product-option-set/index.js";import"../../../data/raffle/index.js";import"../../../data/product-campaing/campaign/index.js";import"../../../theme/theme.js";import"../../../theme/page/index.js";import"../../../theme/component/prop/index.js";import"../../../theme/page/component/prop-value/link.js";import"../../brand-list/index.js";import"../../blog-list/index.js";import"../../blog-category-list/index.js";import"../../category-list/index.js";import"../../product-detail/index.js";import"../../product-list/index.js";import"../../product-attribute-detail/index.js";import"../../product-attribute-list/index.js";import"../../customer-review-list/index.js";import{Validator as l}from"../index.js";import{PhoneRule as p,RequiredRule as m}from"../rules/index.js";import"./login.js";import"./register.js";import"./contact-form.js";import"./forgot-password.js";import"./recover-password.js";import"./account-info.js";import"./raffle-form.js";import"./customer-review.js";import"../../raffle-list/index.js";import"../../../theme/settings/index.js";import"../../../theme/custom-data/index.js";import"../../../../api/apollo.js";import"../../../../api/favorite-product/index.js";import"../../../../api/contact-form/index.js";import{IkasStateAPI as h}from"../../../../api/state/index.js";import"../../../../api/product-option-set/index.js";import"../../../../api/raffle/index.js";import"../../../../api/back-in-stock-reminder/index.js";import"../../../../api/product-campaign/index.js";import{IkasStorefrontConfig as f}from"../../../../storefront/index.js";var g=function(t){return t.sort((function(t,e){return t.label.localeCompare(e.label)}))},v=function(t){return{label:t.name,value:t.id+""}},j=function(){function j(g){var v=this;this.countries=[],this.states=[],this.cities=[],this.districts=[],this._isCountriesPending=!0,this._isStatesPending=!1,this._isCitiesPending=!1,this._isDistrictsPending=!1,this.validatorRules=function(e){return void 0===e&&(e=!1),t([new m({model:v.address,fieldKey:"firstName",valuePath:"firstName",message:v.message.requiredRule}),new m({model:v.address,fieldKey:"lastName",valuePath:"lastName",message:v.message.requiredRule}),new m({model:v.address,fieldKey:"addressLine1",valuePath:"addressLine1",message:v.message.requiredRule}),new m({model:v.address,fieldKey:"country",valuePath:"country",message:v.message.requiredRule}),new m({model:v.address,fieldKey:"state",valuePath:"state",message:v.message.requiredRule}),new m({model:v.address,fieldKey:"city",valuePath:"city",message:v.message.requiredRule}),new m({model:v.address,fieldKey:"title",valuePath:"title",message:v.message.requiredRule})],e?[new p({model:v.address,fieldKey:"phone",valuePath:"phone",message:v.message.phoneRule})]:[],!0)},this.onTitleChange=function(t){v.address.title=t},this.onFirstNameChange=function(t){v.address.firstName=t},this.onLastNameChange=function(t){v.address.lastName=t},this.onPhoneChange=function(t){v.address.phone=t,t||v.validator.setRules(v.validatorRules())},this.onAddressLine1Change=function(t){v.address.addressLine1=t},this.onAddressLine2Change=function(t){v.address.addressLine2=t},this.onAddressPostalCodeChange=function(t){v.address.postalCode=t},this.onCountryChange=function(t){var e;if((null===(e=v.address.country)||void 0===e?void 0:e.id)!==t){var i=v.countries.find((function(e){return e.id===t}));v.address.country={id:null==i?void 0:i.id,name:null==i?void 0:i.name,code:null==i?void 0:i.iso3},v.address.state=void 0,v.address.city=void 0,v.address.district=void 0,v.states=[],v.cities=[],v.districts=[],v.listStates()}},this.onStateChange=function(t){var e;if((null===(e=v.address.state)||void 0===e?void 0:e.id)!==t){var i=v.states.find((function(e){return e.id===t}));v.address.state={id:i.id,name:null==i?void 0:i.name,code:null==i?void 0:i.stateCode},v.address.city=void 0,v.address.district=void 0,v.cities=[],v.districts=[],v.listCities()}},this.onCityChange=function(t){var e;if((null===(e=v.address.city)||void 0===e?void 0:e.id)!==t){var i=v.cities.find((function(e){return e.id===t}));v.address.city={id:i.id,name:i.name},v.address.district=void 0,v.districts=[],v.listDistricts()}},this.onDistrictChange=function(t){var e;if((null===(e=v.address.district)||void 0===e?void 0:e.id)!==t){var i=v.districts.find((function(e){return e.id===t}));v.address.district={id:i.id,name:i.name}}},this.onDistrictInputChange=function(t){v.address.district={id:void 0,name:t}},this.listCountries=function(){return e(v,void 0,void 0,(function(){var t,e,s;return i(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,3,4]),this._isCountriesPending=!0,[4,u.listCountries()];case 1:return t=i.sent(),e=f.routings.find((function(t){return t.id===f.storefrontRoutingId})),(null===(s=null==e?void 0:e.countryCodes)||void 0===s?void 0:s.length)&&(t=t.filter((function(t){var i;return t.iso2&&(null===(i=e.countryCodes)||void 0===i?void 0:i.includes(t.iso2))}))),this.countries=t,1!==this.countries.length||this.address.country||this.onCountryChange(this.countries[0].id),this.countries=t,[3,4];case 2:return i.sent(),[3,4];case 3:return this._isCountriesPending=!1,[7];case 4:return[2]}}))}))},this.listStates=function(){return e(v,void 0,void 0,(function(){var t,e;return i(this,(function(i){switch(i.label){case 0:if(!(null===(e=this.address.country)||void 0===e?void 0:e.id))return[2];i.label=1;case 1:return i.trys.push([1,3,4,5]),this._isStatesPending=!0,[4,h.listStates(this.address.country.id)];case 2:return t=i.sent(),this.states=t,this.hasState||this.onStateChange(this.states[0].id),[3,5];case 3:return i.sent(),[3,5];case 4:return this._isStatesPending=!1,[7];case 5:return[2]}}))}))},this.listCities=function(){return e(v,void 0,void 0,(function(){var t,e,s;return i(this,(function(i){switch(i.label){case 0:if(!(null===(e=this.address.state)||void 0===e?void 0:e.id))return[2];i.label=1;case 1:return i.trys.push([1,3,4,5]),this._isCitiesPending=!0,[4,a.listCities(this.address.state.id,null===(s=this.address.country)||void 0===s?void 0:s.id)];case 2:return t=i.sent(),this.cities=t,[3,5];case 3:return i.sent(),[3,5];case 4:return this._isCitiesPending=!1,[7];case 5:return[2]}}))}))},this.listDistricts=function(){return e(v,void 0,void 0,(function(){var t,e,s;return i(this,(function(i){switch(i.label){case 0:if(!(null===(e=this.address.city)||void 0===e?void 0:e.id))return[2];i.label=1;case 1:return i.trys.push([1,3,4,5]),this._isDistrictsPending=!0,[4,c.listDistricts(this.address.city.id,null===(s=this.address.state)||void 0===s?void 0:s.id)];case 2:return t=i.sent(),this.districts=t,[3,5];case 3:return i.sent(),[3,5];case 4:return this._isDistrictsPending=!1,[7];case 5:return[2]}}))}))},this.validateAll=function(){return v.validator.validateAll()},this.submit=function(){return e(v,void 0,void 0,(function(){var t,e;return i(this,(function(i){switch(i.label){case 0:return t={isFormError:!1,isSuccess:!1},this.address.phone&&this.validator.setRules(this.validatorRules(!0)),[4,this.validateAll()];case 1:if(i.sent())return t.isFormError=!0,[2,t];if(!this.store.customerStore.customer||!this.address)return[2,t];e=o(this.store.customerStore.customer),this.isEdit?e.addresses[this.editingAddressIndex]=this.address:e.addresses.push(this.address),i.label=2;case 2:return i.trys.push([2,4,,5]),[4,this.store.customerStore.saveCustomer(e)];case 3:return i.sent()&&(t.isSuccess=!0),[2,t];case 4:return i.sent(),[2,t];case 5:return[2]}}))}))},s(this,{hasValidatorError:r,isEdit:r,results:r,editingAddressIndex:r,countries:n,states:n,cities:n,districts:n,_isCountriesPending:n,_isStatesPending:n,_isCitiesPending:n,_isDistrictsPending:n,isCountriesPending:r,isStatesPending:r,isCitiesPending:r,isDistrictsPending:r,onCountryChange:d,validateAll:d,submit:d}),this.address=g.address,this.message=g.message,this.store=g.store,this.validator=new l(this.address,this.validatorRules()),this.listCountries(),this.address.state&&this.listStates(),this.address.country&&this.listCities(),this.address.city&&this.listDistricts()}return Object.defineProperty(j.prototype,"isEdit",{get:function(){return-1!==this.editingAddressIndex},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"editingAddressIndex",{get:function(){var t,e,i=this;return null!==(e=null===(t=this.store.customerStore.customer)||void 0===t?void 0:t.addresses.findIndex((function(t){return t.id===i.address.id})))&&void 0!==e?e:-1},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"countryOptions",{get:function(){var t=this.countries.map(v);return g(t)},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"stateOptions",{get:function(){var t=this.states.map(v);return g(t)},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"cityOptions",{get:function(){var t=this.cities.map(v);return g(t)},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"districtOptions",{get:function(){var t=this.districts.map(v);return g(t)},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"hasState",{get:function(){return this.states.length>1},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"isCountriesPending",{get:function(){return this._isCountriesPending},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"isStatesPending",{get:function(){return this.isCountriesPending||this._isStatesPending},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"isCitiesPending",{get:function(){return this.isStatesPending||this._isCitiesPending},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"isDistrictsPending",{get:function(){return this.isCitiesPending||this._isDistrictsPending},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"hasValidatorError",{get:function(){return this.validator.hasError},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"results",{get:function(){return this.validator.results},enumerable:!1,configurable:!0}),j}();export{j as AddressForm};
|
|
1
|
+
import{__spreadArray as t,__awaiter as e,__generator as i}from'../../../../ext/tslib/tslib.es6.js';import{makeObservable as s,computed as r,observable as n,action as d}from"mobx";import o from'../../../../ext/lodash/cloneDeep.js';import"../../../../api/blog/index.js";import"../../../../api/brand/index.js";import"../../../../api/cart/index.js";import"../../../../api/category/index.js";import"../../../../api/checkout/index.js";import{IkasCityAPI as a}from"../../../../api/city/index.js";import{IkasCountryAPI as u}from"../../../../api/country/index.js";import"../../../../api/customer/index.js";import"../../../../api/customer-review/index.js";import{IkasDistrictAPI as c}from"../../../../api/district/index.js";import"../../../../api/html-meta-data/index.js";import"../../../../api/merchant/index.js";import"../../../../api/product-search/index.js";import"../../../data/blog/index.js";import"../../../data/brand/index.js";import"../../../data/category/index.js";import"../../../data/checkout/index.js";import"../../../data/customer/address/index.js";import"../../../data/customer/index.js";import"../../../data/customer-review/index.js";import"../../../data/html-meta-data/index.js";import"../../../data/image/index.js";import"../../../data/installment-info/index.js";import"../../../data/order/index.js";import"../../../data/order/line-item/index.js";import"../../../../api/product-option-file/index.js";import"../../../data/product/index.js";import"../../../data/variant-type/index.js";import"../../../data/product/variant/index.js";import"../../../data/product/variant/price/index.js";import"../../../data/product-attribute/index.js";import"../../../data/product/attribute-value/index.js";import"../../../data/product-filter/index.js";import"../../../data/variant-type/variant-value/index.js";import"../../../data/order-transaction/index.js";import"../../../data/product-option-set/index.js";import"../../../data/raffle/index.js";import"../../../data/product-campaing/campaign/index.js";import"../../../theme/theme.js";import"../../../theme/page/index.js";import"../../../theme/component/prop/index.js";import"../../../theme/page/component/prop-value/link.js";import"../../brand-list/index.js";import"../../blog-list/index.js";import"../../blog-category-list/index.js";import"../../category-list/index.js";import"../../product-detail/index.js";import"../../product-list/index.js";import"../../product-attribute-detail/index.js";import"../../product-attribute-list/index.js";import"../../customer-review-list/index.js";import{Validator as l}from"../index.js";import{PhoneRule as p,RequiredRule as m}from"../rules/index.js";import"./login.js";import"./register.js";import"./contact-form.js";import"./forgot-password.js";import"./recover-password.js";import"./account-info.js";import"./raffle-form.js";import"./customer-review.js";import"../../raffle-list/index.js";import"../../../theme/settings/index.js";import"../../../theme/custom-data/index.js";import"../../../../api/apollo.js";import"../../../../api/favorite-product/index.js";import"../../../../api/contact-form/index.js";import{IkasStateAPI as h}from"../../../../api/state/index.js";import"../../../../api/product-option-set/index.js";import"../../../../api/raffle/index.js";import"../../../../api/back-in-stock-reminder/index.js";import"../../../../api/product-campaign/index.js";import{IkasStorefrontConfig as f}from"../../../../storefront/index.js";import{FREE_TEXT_CITY_COUNTRY_LIST as g}from"../../../../utils/constants.js";var v=function(t){return t.sort((function(t,e){return t.label.localeCompare(e.label)}))},j=function(t){return{label:t.name,value:t.id+""}},y=function(){function y(g){var v=this;this.countries=[],this.states=[],this.cities=[],this.districts=[],this._isCountriesPending=!0,this._isStatesPending=!1,this._isCitiesPending=!1,this._isDistrictsPending=!1,this.validatorRules=function(e){return void 0===e&&(e=!1),t([new m({model:v.address,fieldKey:"firstName",valuePath:"firstName",message:v.message.requiredRule}),new m({model:v.address,fieldKey:"lastName",valuePath:"lastName",message:v.message.requiredRule}),new m({model:v.address,fieldKey:"addressLine1",valuePath:"addressLine1",message:v.message.requiredRule}),new m({model:v.address,fieldKey:"country",valuePath:"country",message:v.message.requiredRule}),new m({model:v.address,fieldKey:"state",valuePath:"state",message:v.message.requiredRule}),new m({model:v.address,fieldKey:"city",valuePath:"city",message:v.message.requiredRule}),new m({model:v.address,fieldKey:"title",valuePath:"title",message:v.message.requiredRule})],e?[new p({model:v.address,fieldKey:"phone",valuePath:"phone",message:v.message.phoneRule})]:[],!0)},this.onTitleChange=function(t){v.address.title=t},this.onFirstNameChange=function(t){v.address.firstName=t},this.onLastNameChange=function(t){v.address.lastName=t},this.onPhoneChange=function(t){v.address.phone=t,t||v.validator.setRules(v.validatorRules())},this.onAddressLine1Change=function(t){v.address.addressLine1=t},this.onAddressLine2Change=function(t){v.address.addressLine2=t},this.onAddressPostalCodeChange=function(t){v.address.postalCode=t},this.onCountryChange=function(t){var e;if((null===(e=v.address.country)||void 0===e?void 0:e.id)!==t){var i=v.countries.find((function(e){return e.id===t}));v.address.country={id:null==i?void 0:i.id,name:null==i?void 0:i.name,code:null==i?void 0:i.iso3},v.address.state=void 0,v.address.city=void 0,v.address.district=void 0,v.states=[],v.cities=[],v.districts=[],v.listStates()}},this.onStateChange=function(t){var e;if((null===(e=v.address.state)||void 0===e?void 0:e.id)!==t){var i=v.states.find((function(e){return e.id===t}));v.address.state={id:i.id,name:null==i?void 0:i.name,code:null==i?void 0:i.stateCode},v.address.city=void 0,v.address.district=void 0,v.cities=[],v.districts=[],v.listCities()}},this.onCityChange=function(t){var e;if((null===(e=v.address.city)||void 0===e?void 0:e.id)!==t){var i=v.cities.find((function(e){return e.id===t}));v.address.city={id:i.id,name:i.name},v.address.district=void 0,v.districts=[],v.listDistricts()}},this.onCityInputChange=function(t){v.districts=[],v.address.city={id:void 0,name:t}},this.onDistrictChange=function(t){var e;if((null===(e=v.address.district)||void 0===e?void 0:e.id)!==t){var i=v.districts.find((function(e){return e.id===t}));v.address.district={id:i.id,name:i.name}}},this.onDistrictInputChange=function(t){v.address.district={id:void 0,name:t}},this.listCountries=function(){return e(v,void 0,void 0,(function(){var t,e,s;return i(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,3,4]),this._isCountriesPending=!0,[4,u.listCountries()];case 1:return t=i.sent(),e=f.routings.find((function(t){return t.id===f.storefrontRoutingId})),(null===(s=null==e?void 0:e.countryCodes)||void 0===s?void 0:s.length)&&(t=t.filter((function(t){var i;return t.iso2&&(null===(i=e.countryCodes)||void 0===i?void 0:i.includes(t.iso2))}))),this.countries=t,1!==this.countries.length||this.address.country||this.onCountryChange(this.countries[0].id),this.countries=t,[3,4];case 2:return i.sent(),[3,4];case 3:return this._isCountriesPending=!1,[7];case 4:return[2]}}))}))},this.listStates=function(){return e(v,void 0,void 0,(function(){var t,e;return i(this,(function(i){switch(i.label){case 0:if(!(null===(e=this.address.country)||void 0===e?void 0:e.id))return[2];i.label=1;case 1:return i.trys.push([1,3,4,5]),this._isStatesPending=!0,[4,h.listStates(this.address.country.id)];case 2:return t=i.sent(),this.states=t,this.hasState||this.onStateChange(this.states[0].id),[3,5];case 3:return i.sent(),[3,5];case 4:return this._isStatesPending=!1,[7];case 5:return[2]}}))}))},this.listCities=function(){return e(v,void 0,void 0,(function(){var t,e,s;return i(this,(function(i){switch(i.label){case 0:if(!(null===(e=this.address.state)||void 0===e?void 0:e.id))return[2];i.label=1;case 1:return i.trys.push([1,3,4,5]),this._isCitiesPending=!0,[4,a.listCities(this.address.state.id,null===(s=this.address.country)||void 0===s?void 0:s.id)];case 2:return t=i.sent(),this.cities=t,[3,5];case 3:return i.sent(),[3,5];case 4:return this._isCitiesPending=!1,[7];case 5:return[2]}}))}))},this.listDistricts=function(){return e(v,void 0,void 0,(function(){var t,e,s;return i(this,(function(i){switch(i.label){case 0:if(!(null===(e=this.address.city)||void 0===e?void 0:e.id))return[2];i.label=1;case 1:return i.trys.push([1,3,4,5]),this._isDistrictsPending=!0,[4,c.listDistricts(this.address.city.id,null===(s=this.address.state)||void 0===s?void 0:s.id)];case 2:return t=i.sent(),this.districts=t,[3,5];case 3:return i.sent(),[3,5];case 4:return this._isDistrictsPending=!1,[7];case 5:return[2]}}))}))},this.validateAll=function(){return v.validator.validateAll()},this.submit=function(){return e(v,void 0,void 0,(function(){var t,e;return i(this,(function(i){switch(i.label){case 0:return t={isFormError:!1,isSuccess:!1},this.address.phone&&this.validator.setRules(this.validatorRules(!0)),[4,this.validateAll()];case 1:if(i.sent())return t.isFormError=!0,[2,t];if(!this.store.customerStore.customer||!this.address)return[2,t];e=o(this.store.customerStore.customer),this.isEdit?e.addresses[this.editingAddressIndex]=this.address:e.addresses.push(this.address),i.label=2;case 2:return i.trys.push([2,4,,5]),[4,this.store.customerStore.saveCustomer(e)];case 3:return i.sent()&&(t.isSuccess=!0),[2,t];case 4:return i.sent(),[2,t];case 5:return[2]}}))}))},s(this,{hasValidatorError:r,isEdit:r,results:r,editingAddressIndex:r,isFreeTextCity:r,isFreeTextDistrict:r,countries:n,states:n,cities:n,districts:n,_isCountriesPending:n,_isStatesPending:n,_isCitiesPending:n,_isDistrictsPending:n,isCountriesPending:r,isStatesPending:r,isCitiesPending:r,isDistrictsPending:r,onCountryChange:d,validateAll:d,submit:d}),this.address=g.address,this.message=g.message,this.store=g.store,this.validator=new l(this.address,this.validatorRules()),this.listCountries(),this.address.state&&this.listStates(),this.address.country&&this.listCities(),this.address.city&&this.listDistricts()}return Object.defineProperty(y.prototype,"isFreeTextCity",{get:function(){var t=this;return g.some((function(e){var i,s;return(null===(s=null===(i=t.address.country)||void 0===i?void 0:i.iso2)||void 0===s?void 0:s.toLowerCase())===e}))},enumerable:!1,configurable:!0}),Object.defineProperty(y.prototype,"isFreeTextDistrict",{get:function(){return!!this.districtOptions.length},enumerable:!1,configurable:!0}),Object.defineProperty(y.prototype,"isEdit",{get:function(){return-1!==this.editingAddressIndex},enumerable:!1,configurable:!0}),Object.defineProperty(y.prototype,"editingAddressIndex",{get:function(){var t,e,i=this;return null!==(e=null===(t=this.store.customerStore.customer)||void 0===t?void 0:t.addresses.findIndex((function(t){return t.id===i.address.id})))&&void 0!==e?e:-1},enumerable:!1,configurable:!0}),Object.defineProperty(y.prototype,"countryOptions",{get:function(){var t=this.countries.map(j);return v(t)},enumerable:!1,configurable:!0}),Object.defineProperty(y.prototype,"stateOptions",{get:function(){var t=this.states.map(j);return v(t)},enumerable:!1,configurable:!0}),Object.defineProperty(y.prototype,"cityOptions",{get:function(){var t=this.cities.map(j);return v(t)},enumerable:!1,configurable:!0}),Object.defineProperty(y.prototype,"districtOptions",{get:function(){var t=this.districts.map(j);return v(t)},enumerable:!1,configurable:!0}),Object.defineProperty(y.prototype,"hasState",{get:function(){return this.states.length>1},enumerable:!1,configurable:!0}),Object.defineProperty(y.prototype,"isCountriesPending",{get:function(){return this._isCountriesPending},enumerable:!1,configurable:!0}),Object.defineProperty(y.prototype,"isStatesPending",{get:function(){return this.isCountriesPending||this._isStatesPending},enumerable:!1,configurable:!0}),Object.defineProperty(y.prototype,"isCitiesPending",{get:function(){return this.isStatesPending||this._isCitiesPending},enumerable:!1,configurable:!0}),Object.defineProperty(y.prototype,"isDistrictsPending",{get:function(){return this.isCitiesPending||this._isDistrictsPending},enumerable:!1,configurable:!0}),Object.defineProperty(y.prototype,"hasValidatorError",{get:function(){return this.validator.hasError},enumerable:!1,configurable:!0}),Object.defineProperty(y.prototype,"results",{get:function(){return this.validator.results},enumerable:!1,configurable:!0}),y}();export{y as AddressForm};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const FREE_TEXT_CITY_COUNTRY_LIST: string[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var r=["DE"];export{r as FREE_TEXT_CITY_COUNTRY_LIST};
|