UNPKG

vue-thailand-address

Version:
15 lines 22.1 kB
/*! * Vue Thailand Address v3.4.2 * Created by Saran Tanpituckpong * Released under the MIT License. * * Address database from jquery.Thailand.js by Thanarat Kuawattanaphan */ window.VueThailandAddress=function(t){function e(e){for(var r,c,u=e[0],a=e[1],s=e[2],l=0,f=[];l<u.length;l++)c=u[l],Object.prototype.hasOwnProperty.call(o,c)&&o[c]&&f.push(o[c][0]),o[c]=0;for(r in a)Object.prototype.hasOwnProperty.call(a,r)&&(t[r]=a[r]);for(p&&p(e);f.length;)f.shift()();return i.push.apply(i,s||[]),n()}function n(){for(var t,e=0;e<i.length;e++){for(var n=i[e],r=!0,u=1;u<n.length;u++){var a=n[u];0!==o[a]&&(r=!1)}r&&(i.splice(e--,1),t=c(c.s=n[0]))}return t}var r={},o={1:0},i=[];function c(e){if(r[e])return r[e].exports;var n=r[e]={i:e,l:!1,exports:{}};return t[e].call(n.exports,n,n.exports,c),n.l=!0,n.exports}c.m=t,c.c=r,c.d=function(t,e,n){c.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},c.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},c.t=function(t,e){if(1&e&&(t=c(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(c.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)c.d(n,r,function(e){return t[e]}.bind(null,r));return n},c.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return c.d(e,"a",e),e},c.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},c.p="";var u=window.webpackJsonpVueThailandAddress=window.webpackJsonpVueThailandAddress||[],a=u.push.bind(u);u.push=e,u=u.slice();for(var s=0;s<u.length;s++)e(u[s]);var p=a;return i.push([7,0]),n()}([function(t,e){t.exports=window.Vue},function(t,e,n){"use strict";const r=[],o=[],i=(t,e)=>{if(t===e)return 0;const n=t;t.length>e.length&&(t=e,e=n);let i=t.length,c=e.length;for(;i>0&&t.charCodeAt(~-i)===e.charCodeAt(~-c);)i--,c--;let u,a,s,p,l=0;for(;l<i&&t.charCodeAt(l)===e.charCodeAt(l);)l++;if(i-=l,c-=l,0===i)return c;let f=0,d=0;for(;f<i;)o[f]=t.charCodeAt(l+f),r[f]=++f;for(;d<c;)for(u=e.charCodeAt(l+d),s=d++,a=d,f=0;f<i;f++)p=u===o[f]?s:s+1,s=r[f],a=r[f]=s>a?p>a?a+1:p:p>s?s+1:p;return a};t.exports=i,t.exports.default=i},function(t,e,n){},function(t,e,n){},function(t,e,n){},function(t,e,n){(function(e){var n="object"==typeof e&&e&&e.Object===Object&&e,r="object"==typeof self&&self&&self.Object===Object&&self,o=n||r||Function("return this")();function i(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}function c(t,e){for(var n=-1,r=e.length,o=t.length;++n<r;)t[o+n]=e[n];return t}var u=Object.prototype,a=u.hasOwnProperty,s=u.toString,p=o.Symbol,l=u.propertyIsEnumerable,f=p?p.isConcatSpreadable:void 0,d=Math.max;function y(t){return v(t)||function(t){return function(t){return b(t)&&function(t){return null!=t&&function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}(t.length)&&!function(t){var e=function(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}(t)?s.call(t):"";return"[object Function]"==e||"[object GeneratorFunction]"==e}(t)}(t)}(t)&&a.call(t,"callee")&&(!l.call(t,"callee")||"[object Arguments]"==s.call(t))}(t)||!!(f&&t&&t[f])}function h(t){if("string"==typeof t||function(t){return"symbol"==typeof t||b(t)&&"[object Symbol]"==s.call(t)}(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}var v=Array.isArray;function b(t){return!!t&&"object"==typeof t}var m,g,O=(m=function(t,e){return null==t?{}:function(t,e){return function(t,e,n){for(var r=-1,o=e.length,i={};++r<o;){var c=e[r],u=t[c];n(u,c)&&(i[c]=u)}return i}(t=Object(t),e,(function(e,n){return n in t}))}(t,function(t,e){for(var n=-1,r=t?t.length:0,o=Array(r);++n<r;)o[n]=e(t[n],n,t);return o}(function t(e,n,r,o,i){var u=-1,a=e.length;for(r||(r=y),i||(i=[]);++u<a;){var s=e[u];n>0&&r(s)?n>1?t(s,n-1,r,o,i):c(i,s):o||(i[i.length]=s)}return i}(e,1),h))},g=d(void 0===g?m.length-1:g,0),function(){for(var t=arguments,e=-1,n=d(t.length-g,0),r=Array(n);++e<n;)r[e]=t[g+e];e=-1;for(var o=Array(g+1);++e<g;)o[e]=t[e];return o[g]=r,i(m,this,o)});t.exports=O}).call(this,n(8))},,function(t,e,n){t.exports=n(12)},function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e,n){"use strict";n(2)},function(t,e,n){"use strict";n(3)},function(t,e,n){"use strict";n(4)},function(t,e,n){"use strict";n.r(e),n.d(e,"SubDistrictInput",(function(){return ut})),n.d(e,"DistrictInput",(function(){return it})),n.d(e,"ProvinceInput",(function(){return ct})),n.d(e,"ZipCodeInput",(function(){return at})),n.d(e,"DataStore",(function(){return M})),n.d(e,"defaultStore",(function(){return D}));var r=n(0),o=n.n(r); /** * vue-class-component v7.2.6 * (c) 2015-present Evan You * @license MIT */ function i(t){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function c(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function u(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e<t.length;e++)n[e]=t[e];return n}}(t)||function(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function a(){return"undefined"!=typeof Reflect&&Reflect.defineMetadata&&Reflect.getOwnMetadataKeys}function s(t,e){p(t,e),Object.getOwnPropertyNames(e.prototype).forEach((function(n){p(t.prototype,e.prototype,n)})),Object.getOwnPropertyNames(e).forEach((function(n){p(t,e,n)}))}function p(t,e,n){(n?Reflect.getOwnMetadataKeys(e,n):Reflect.getOwnMetadataKeys(e)).forEach((function(r){var o=n?Reflect.getOwnMetadata(r,e,n):Reflect.getOwnMetadata(r,e);n?Reflect.defineMetadata(r,o,t,n):Reflect.defineMetadata(r,o,t)}))}var l={__proto__:[]}instanceof Array;function f(t){return function(e,n,r){var o="function"==typeof e?e:e.constructor;o.__decorators__||(o.__decorators__=[]),"number"!=typeof r&&(r=void 0),o.__decorators__.push((function(e){return t(e,n,r)}))}}function d(t,e){var n=e.prototype._init;e.prototype._init=function(){var e=this,n=Object.getOwnPropertyNames(t);if(t.$options.props)for(var r in t.$options.props)t.hasOwnProperty(r)||n.push(r);n.forEach((function(n){Object.defineProperty(e,n,{get:function(){return t[n]},set:function(e){t[n]=e},configurable:!0})}))};var r=new e;e.prototype._init=n;var o={};return Object.keys(r).forEach((function(t){void 0!==r[t]&&(o[t]=r[t])})),o}var y=["data","beforeCreate","created","beforeMount","mounted","beforeDestroy","destroyed","beforeUpdate","updated","activated","deactivated","render","errorCaptured","serverPrefetch"];function h(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e.name=e.name||t._componentTag||t.name;var n=t.prototype;Object.getOwnPropertyNames(n).forEach((function(t){if("constructor"!==t)if(y.indexOf(t)>-1)e[t]=n[t];else{var r=Object.getOwnPropertyDescriptor(n,t);void 0!==r.value?"function"==typeof r.value?(e.methods||(e.methods={}))[t]=r.value:(e.mixins||(e.mixins=[])).push({data:function(){return c({},t,r.value)}}):(r.get||r.set)&&((e.computed||(e.computed={}))[t]={get:r.get,set:r.set})}})),(e.mixins||(e.mixins=[])).push({data:function(){return d(this,t)}});var r=t.__decorators__;r&&(r.forEach((function(t){return t(e)})),delete t.__decorators__);var i=Object.getPrototypeOf(t.prototype),u=i instanceof o.a?i.constructor:o.a,p=u.extend(e);return b(p,t,u),a()&&s(p,t),p}var v={prototype:!0,arguments:!0,callee:!0,caller:!0};function b(t,e,n){Object.getOwnPropertyNames(e).forEach((function(r){if(!v[r]){var o=Object.getOwnPropertyDescriptor(t,r);if(!o||o.configurable){var c,u,a=Object.getOwnPropertyDescriptor(e,r);if(!l){if("cid"===r)return;var s=Object.getOwnPropertyDescriptor(n,r);if(c=a.value,u=i(c),null!=c&&("object"===u||"function"===u)&&s&&s.value===a.value)return}0,Object.defineProperty(t,r,a)}}}))}function m(t){return"function"==typeof t?h(t):function(e){return h(e,t)}}m.registerHooks=function(t){y.push.apply(y,u(t))};var g=m;var O="undefined"!=typeof Reflect&&void 0!==Reflect.getMetadata;function _(t,e,n){if(O&&!Array.isArray(t)&&"function"!=typeof t&&!t.hasOwnProperty("type")&&void 0===t.type){var r=Reflect.getMetadata("design:type",e,n);r!==Object&&(t.type=r)}}function w(t){return void 0===t&&(t={}),function(e,n){_(t,e,n),f((function(e,n){(e.props||(e.props={}))[n]=t}))(e,n)}}function j(t,e){void 0===e&&(e={});var n=e.deep,r=void 0!==n&&n,o=e.immediate,i=void 0!==o&&o;return f((function(e,n){"object"!=typeof e.watch&&(e.watch=Object.create(null));var o=e.watch;"object"!=typeof o[t]||Array.isArray(o[t])?void 0===o[t]&&(o[t]=[]):o[t]=[o[t]],o[t].push({handler:n,deep:r,immediate:i})}))}var x=n(5),P=n.n(x),C=n(6);var S,A,I,k,T,E,R=(A=[],I=[],k=[],T=!1,E=function(t){return T?("number"==typeof t&&(t=A[t]),t.replace(/[A-Z]/gi,(function(t){var e=t.charCodeAt(0);return I[e<97?e-65:26+e-97]}))):t},(S=C).lookup&&S.words&&(T=!0,A=S.lookup.split("|"),I=S.words.split("|"),S=S.data),S[0].length?(S.map((function(t){var e=1;3===t.length&&(e=2),t[e].map((function(n){n[e].map((function(r){r[e]=r[e]instanceof Array?r[e]:[r[e]],r[e].map((function(o){var i={district:E(r[0]),amphoe:E(n[0]),province:E(t[0]),zipcode:o};2===e&&(i.district_code=r[1]||!1,i.amphoe_code=n[1]||!1,i.province_code=t[1]||!1),k.push(i)}))}))}))})),k):S).map(Object.freeze),$=function(){function t(){this.resetValue(),this._valueChangeHandlers=[]}return t.validateValue=function(t){return"object"==typeof t&&Object.prototype.hasOwnProperty.call(t,"district")&&Object.prototype.hasOwnProperty.call(t,"subdistrict")&&Object.prototype.hasOwnProperty.call(t,"province")&&Object.prototype.hasOwnProperty.call(t,"zipcode")},Object.defineProperty(t.prototype,"dataSource",{get:function(){return R},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"value",{get:function(){return this._currentValue},set:function(e){if(!t.validateValue(e))throw new TypeError("Invalid address model.");this._currentValue=e,this._valueChangeHandlers.forEach((function(t){return t(e)}))},enumerable:!1,configurable:!0}),t.prototype.resetValue=function(){this._currentValue={district:"",subdistrict:"",province:"",zipcode:""}},t.prototype.setValueProp=function(t,e){this._currentValue[t]=e},t.prototype.onValueChange=function(t){"function"==typeof t&&this._valueChangeHandlers.push(t)},t}(),M=$,D=new $,V=["autofocus","disabled","form","id","inputmode","list","maxlength","minlength","name","pattern","placeholder","readonly","required","required","size","spellcheck","tabindex","title"],H=n(1),z=n.n(H);var N=function(t,e){var n=e.district,r=e.amphoe,o=e.province,i=e.zipcode,c=[z()(t,n),z()(t,r),z()(t,o),z()(t,""+i)];return Math.min.apply(Math,c)};function q(t){return"subdistrict"===t?"district":"district"===t?"amphoe":t}var L=function(t,e,n){var r=t.slice(0),o=q(e),i=r.filter((function(t){return!!t[o]&&(""+t[o]).startsWith(n)}));return i.sort((function(t,e){var r=N(n,t);return N(n,e)-r})),i};function U(t,e,n){var r=Object.assign({},t),o={subdistrict:r.district,district:r.amphoe,province:r.province,zipcode:""+r.zipcode},i=q(e);return r[i]&&(o[e]=function(t,e){return e.length>0?e.replace(new RegExp(t,"ig"),(function(t){return"<b>"+t+"</b>"})):e}(n,""+r[i])),[o.subdistrict,o.district,o.province,o.zipcode].join(" » ")}var F,K=(F=function(t,e){return(F=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}F(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),J=function(t,e,n,r){var o,i=arguments.length,c=i<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)c=Reflect.decorate(t,e,n,r);else for(var u=t.length-1;u>=0;u--)(o=t[u])&&(c=(i<3?o(c):i>3?o(e,n,c):o(e,n))||c);return i>3&&c&&Object.defineProperty(e,n,c),c},X=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return K(e,t),e.prototype.onSelectedIndexChange=function(t){if(-1!==t){if(this.$el&&this.$refs["autocomplete-item"]&&this.$refs["autocomplete-item"][t]){var e=this.$el,n=this.$refs["autocomplete-item"][t],r=n.offsetTop+n.offsetHeight;n.offsetTop<e.scrollTop?e.scrollTop=n.offsetTop:r-e.scrollTop>e.offsetHeight&&(e.scrollTop=n.offsetTop-(e.offsetHeight-n.offsetHeight))}}else this.$el&&(this.$el.scrollTop=0)},Object.defineProperty(e.prototype,"autocompleteStyle",{get:function(){return{maxHeight:this.maxHeight+"px",listStyle:"none",margin:0,overflowY:"auto",padding:0,position:"absolute",width:"100%",zIndex:1}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"autocompleteListStyle",{get:function(){return{height:this.maxHeight/this.itemCount+"px",cursor:"pointer"}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hasData",{get:function(){return this.items&&this.items.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"itemList",{get:function(){var t=this;return this.items.map((function(e){return{data:Object.assign({},e),text:U(e,t.target,t.query)}}))},enumerable:!1,configurable:!0}),e.prototype.onItemClick=function(t){this.$emit("itemclick",t)},e.prototype.changeSelectedIndex=function(t){t>=0&&t<this.itemList.length&&this.$emit("update:selectedIndex",t)},J([w(String)],e.prototype,"query",void 0),J([w(Array)],e.prototype,"items",void 0),J([w({type:String,required:!0})],e.prototype,"target",void 0),J([w({type:Number,required:!0})],e.prototype,"maxHeight",void 0),J([w({type:Number,required:!0})],e.prototype,"itemCount",void 0),J([w({type:Number,default:-1})],e.prototype,"selectedIndex",void 0),J([j("selectedIndex")],e.prototype,"onSelectedIndexChange",null),e=J([g({name:"Autocomplete"})],e)}(o.a);n(9);function Z(t,e,n,r,o,i,c,u){var a,s="function"==typeof t?t.options:t;if(e&&(s.render=e,s.staticRenderFns=n,s._compiled=!0),r&&(s.functional=!0),i&&(s._scopeId="data-v-"+i),c?(a=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),o&&o.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(c)},s._ssrRegister=a):o&&(a=u?function(){o.call(this,(s.functional?this.parent:this).$root.$options.shadowRoot)}:o),a)if(s.functional){s._injectStyles=a;var p=s.render;s.render=function(t,e){return a.call(e),p(t,e)}}else{var l=s.beforeCreate;s.beforeCreate=l?[].concat(l,a):[a]}return{exports:t,options:s}}var B=Z(X,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("ul",{directives:[{name:"show",rawName:"v-show",value:t.hasData,expression:"hasData"}],staticClass:"th-address-autocomplete",style:t.autocompleteStyle},t._l(t.itemList,(function(e,r){return n("li",{key:e.text,ref:"autocomplete-item",refInFor:!0,class:{active:t.selectedIndex===r},style:t.autocompleteListStyle,domProps:{innerHTML:t._s(e.text)},on:{click:function(n){return t.onItemClick(e.data)},mouseenter:function(e){return t.changeSelectedIndex(r)}}})})),0)}),[],!1,null,null,null).exports,G=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),W=function(t,e,n,r){var o,i=arguments.length,c=i<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)c=Reflect.decorate(t,e,n,r);else for(var u=t.length-1;u>=0;u--)(o=t[u])&&(c=(i<3?o(c):i>3?o(e,n,c):o(e,n))||c);return i>3&&c&&Object.defineProperty(e,n,c),c},Y=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.possibles=[],e.selectedIndex=-1,e}var n,r;return G(e,t),e.prototype.created=function(){var t=this;this.store.setValueProp(this.target,this.value),this.store.onValueChange((function(e){var n=e[t.target];t.$emit("addressinput",n)}))},Object.defineProperty(e.prototype,"inputType",{get:function(){return this.numbered&&"zipcode"===this.target?"number":"text"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"containerStyle",{get:function(){return{position:"relative"}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"filteredAttrs",{get:function(){return P()(this.$attrs,V)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"inputClassList",{get:function(){return this.inputClass&&this.inputClass.trim()?this.inputClass.split(/\s+/):null},enumerable:!1,configurable:!0}),e.prototype.search=function(t){if(t&&t.length>0){var e=this.store.dataSource;this.possibles=L(e,this.target,t),this.possibles.length>0&&(this.selectedIndex=0)}else this.clearAutocomplete();this.$emit("addressinput",t)},e.prototype.closeAutocomplete=function(){var t=this;setTimeout((function(){return t.clearAutocomplete()}),250)},e.prototype.clearAutocomplete=function(){this.selectedIndex=-1,this.possibles=[]},e.prototype.moveUp=function(){0!==this.possibles.length&&(this.selectedIndex-1>=0?this.selectedIndex-=1:this.selectedIndex=this.possibles.length-1)},e.prototype.moveDown=function(){0!==this.possibles.length?this.selectedIndex+1<this.possibles.length?this.selectedIndex+=1:this.selectedIndex=0:this.search(this.value)},e.prototype.pickCurrentItem=function(){if(this.possibles[this.selectedIndex]){var t=Object.assign({},this.possibles[this.selectedIndex]);this.commitItem(t)}this.clearAutocomplete()},e.prototype.commitItem=function(t){var e,n={district:(e=t).amphoe,subdistrict:e.district,province:e.province,zipcode:""+e.zipcode};this.store.value=n,this.$emit("itemselect",n)},W([(n="addressinput",r={type:String,default:""},void 0===r&&(r={}),function(t,e){_(r,t,e),f((function(t,e){(t.props||(t.props={}))[e]=r,t.model={prop:e,event:n||e}}))(t,e)})],e.prototype,"value",void 0),W([w({type:M,default:function(){return D}})],e.prototype,"store",void 0),W([w({type:String,required:!0})],e.prototype,"target",void 0),W([w({type:Number,default:200})],e.prototype,"autocompleteMaxHeight",void 0),W([w({type:Number,default:5})],e.prototype,"autocompleteItemCount",void 0),W([w({type:String,default:""})],e.prototype,"inputClass",void 0),W([w({type:Boolean,default:!1})],e.prototype,"numbered",void 0),e=W([g({name:"TypeaheadInput",components:{Autocomplete:B},inheritAttrs:!1})],e)}(o.a),Q=(n(10),Z(Y,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"th-address-container",style:t.containerStyle},[n("input",t._g(t._b({staticClass:"th-address-input",class:t.inputClassList,attrs:{type:t.inputType,autocomplete:"off"},domProps:{value:t.value},on:{input:function(e){return t.search(e.target.value)},blur:t.closeAutocomplete,keydown:[function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"esc",27,e.key,["Esc","Escape"])?null:t.clearAutocomplete.apply(null,arguments)},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"up",38,e.key,["Up","ArrowUp"])?null:(e.preventDefault(),t.moveUp.apply(null,arguments))},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"down",40,e.key,["Down","ArrowDown"])?null:(e.preventDefault(),t.moveDown.apply(null,arguments))},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:(e.preventDefault(),t.pickCurrentItem.apply(null,arguments))}]}},"input",t.filteredAttrs,!1),t.$listeners)),n("autocomplete",{attrs:{query:t.value,items:t.possibles,target:t.target,maxHeight:t.autocompleteMaxHeight,itemCount:t.autocompleteItemCount,selectedIndex:t.selectedIndex},on:{"update:selectedIndex":function(e){t.selectedIndex=e},"update:selected-index":function(e){t.selectedIndex=e},itemclick:t.commitItem}})],1)}),[],!1,null,null,null).exports),tt=function(){return(tt=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},et=o.a.extend({name:"InputContainer",functional:!0,props:{label:String},render:function(t,e){var n=e.props,r=e.data,o=n.label,i=null!=o&&o.length>0,c=t(Q,tt(tt({},r),{on:{addressinput:function(t){r.on&&"function"==typeof r.on.input&&r.on.input(t)}}}));return t("div",{class:"th-address"},[i?t("label",{class:"th-address-label"},[t("div",{class:"label-text"},o),c]):c])}}),nt=(n(11),Z(et,void 0,void 0,!1,null,null,null).exports),rt=function(){return(rt=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};function ot(t,e){return o.a.extend({functional:!0,props:{label:{type:String,default:e}},render:function(e,n){return e(nt,rt(rt({},n.data),{props:{label:n.props.label,target:t}}))}})}var it=ot("district","อำเภอ/เขต"),ct=ot("province","จังหวัด"),ut=ot("subdistrict","ตำบล/แขวง"),at=ot("zipcode","รหัสไปรษณีย์"),st=function(t){t.component("addressinput-subdistrict",ut),t.component("addressinput-district",it),t.component("addressinput-province",ct),t.component("addressinput-zipcode",at)};"undefined"!=typeof window&&window.Vue&&st(window.Vue);var pt={install:st};e.default=pt}]).default; //# sourceMappingURL=vue-thailand-address.web.min.js.map