New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

vue-currency-input

Package Overview
Dependencies
Maintainers
1
Versions
91
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vue-currency-input - npm Package Compare versions

Comparing version 1.2.0 to 1.3.0

CHANGELOG.md

2

dist/vue-currency-input.umd.min.js

@@ -1,1 +0,1 @@

(function(e,t){"object"===typeof exports&&"object"===typeof module?module.exports=t():"function"===typeof define&&define.amd?define([],t):"object"===typeof exports?exports["vue-currency-input"]=t():e["vue-currency-input"]=t()})("undefined"!==typeof self?self:this,function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s="fb15")}({"028b":function(e,t,n){var r=n("c259"),o=n("add2"),i=n("b8b4"),u=n("f27f"),a=n("3a89"),c=n("8fdf"),f=Object.getOwnPropertyDescriptor;t.f=n("14c4")?f:function(e,t){if(e=i(e),t=u(t,!0),c)try{return f(e,t)}catch(n){}if(a(e,t))return o(!r.f.call(e,t),e[t])}},"0785":function(e,t,n){var r=n("9758");e.exports=function(e,t,n){if(r(e),void 0===t)return e;switch(n){case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,o){return e.call(t,n,r,o)}}return function(){return e.apply(t,arguments)}}},"0a75":function(e,t,n){e.exports=n("8237")},"0b13":function(e,t){e.exports=function(e){try{return!!e()}catch(t){return!0}}},"0ba9":function(e,t,n){var r=n("cf92");e.exports=Array.isArray||function(e){return"Array"==r(e)}},"10e7":function(e,t,n){n("1927"),e.exports=n("8a84").Object.getOwnPropertySymbols},"14c4":function(e,t,n){e.exports=!n("0b13")(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},1927:function(e,t,n){"use strict";var r=n("f46f"),o=n("3a89"),i=n("14c4"),u=n("4874"),a=n("f9c0"),c=n("5e97").KEY,f=n("0b13"),l=n("4d2b"),s=n("f3a9"),p=n("f471"),d=n("888e"),h=n("5e1d"),m=n("4f68"),v=n("e025"),b=n("0ba9"),y=n("fcfe"),g=n("9d0f"),x=n("b8b4"),w=n("f27f"),O=n("add2"),S=n("8bb6"),C=n("71e6"),E=n("028b"),P=n("571d"),j=n("f830"),_=E.f,k=P.f,N=C.f,T=r.Symbol,V=r.JSON,F=V&&V.stringify,$="prototype",M=d("_hidden"),I=d("toPrimitive"),R={}.propertyIsEnumerable,A=l("symbol-registry"),D=l("symbols"),L=l("op-symbols"),W=Object[$],J="function"==typeof T,q=r.QObject,B=!q||!q[$]||!q[$].findChild,U=i&&f(function(){return 7!=S(k({},"a",{get:function(){return k(this,"a",{value:7}).a}})).a})?function(e,t,n){var r=_(W,t);r&&delete W[t],k(e,t,n),r&&e!==W&&k(W,t,r)}:k,z=function(e){var t=D[e]=S(T[$]);return t._k=e,t},G=J&&"symbol"==typeof T.iterator?function(e){return"symbol"==typeof e}:function(e){return e instanceof T},K=function(e,t,n){return e===W&&K(L,t,n),y(e),t=w(t,!0),y(n),o(D,t)?(n.enumerable?(o(e,M)&&e[M][t]&&(e[M][t]=!1),n=S(n,{enumerable:O(0,!1)})):(o(e,M)||k(e,M,O(1,{})),e[M][t]=!0),U(e,t,n)):k(e,t,n)},X=function(e,t){y(e);var n,r=v(t=x(t)),o=0,i=r.length;while(i>o)K(e,n=r[o++],t[n]);return e},Y=function(e,t){return void 0===t?S(e):X(S(e),t)},Q=function(e){var t=R.call(this,e=w(e,!0));return!(this===W&&o(D,e)&&!o(L,e))&&(!(t||!o(this,e)||!o(D,e)||o(this,M)&&this[M][e])||t)},Z=function(e,t){if(e=x(e),t=w(t,!0),e!==W||!o(D,t)||o(L,t)){var n=_(e,t);return!n||!o(D,t)||o(e,M)&&e[M][t]||(n.enumerable=!0),n}},H=function(e){var t,n=N(x(e)),r=[],i=0;while(n.length>i)o(D,t=n[i++])||t==M||t==c||r.push(t);return r},ee=function(e){var t,n=e===W,r=N(n?L:x(e)),i=[],u=0;while(r.length>u)!o(D,t=r[u++])||n&&!o(W,t)||i.push(D[t]);return i};J||(T=function(){if(this instanceof T)throw TypeError("Symbol is not a constructor!");var e=p(arguments.length>0?arguments[0]:void 0),t=function(n){this===W&&t.call(L,n),o(this,M)&&o(this[M],e)&&(this[M][e]=!1),U(this,e,O(1,n))};return i&&B&&U(W,e,{configurable:!0,set:t}),z(e)},a(T[$],"toString",function(){return this._k}),E.f=Z,P.f=K,n("3041").f=C.f=H,n("c259").f=Q,n("5f32").f=ee,i&&!n("ffab")&&a(W,"propertyIsEnumerable",Q,!0),h.f=function(e){return z(d(e))}),u(u.G+u.W+u.F*!J,{Symbol:T});for(var te="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),ne=0;te.length>ne;)d(te[ne++]);for(var re=j(d.store),oe=0;re.length>oe;)m(re[oe++]);u(u.S+u.F*!J,"Symbol",{for:function(e){return o(A,e+="")?A[e]:A[e]=T(e)},keyFor:function(e){if(!G(e))throw TypeError(e+" is not a symbol!");for(var t in A)if(A[t]===e)return t},useSetter:function(){B=!0},useSimple:function(){B=!1}}),u(u.S+u.F*!J,"Object",{create:Y,defineProperty:K,defineProperties:X,getOwnPropertyDescriptor:Z,getOwnPropertyNames:H,getOwnPropertySymbols:ee}),V&&u(u.S+u.F*(!J||f(function(){var e=T();return"[null]"!=F([e])||"{}"!=F({a:e})||"{}"!=F(Object(e))})),"JSON",{stringify:function(e){var t,n,r=[e],o=1;while(arguments.length>o)r.push(arguments[o++]);if(n=t=r[1],(g(t)||void 0!==e)&&!G(e))return b(t)||(t=function(e,t){if("function"==typeof n&&(t=n.call(this,e,t)),!G(t))return t}),r[1]=t,F.apply(V,r)}}),T[$][I]||n("b226")(T[$],I,T[$].valueOf),s(T,"Symbol"),s(Math,"Math",!0),s(r.JSON,"JSON",!0)},"1b9e":function(e,t,n){var r=n("df06"),o=Math.min;e.exports=function(e){return e>0?o(r(e),9007199254740991):0}},"28b9":function(e,t,n){var r=n("df06"),o=Math.max,i=Math.min;e.exports=function(e,t){return e=r(e),e<0?o(e+t,0):i(e,t)}},3041:function(e,t,n){var r=n("ae0b"),o=n("b1d2").concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return r(e,o)}},"31d6":function(e,t){e.exports=function(e){if(void 0==e)throw TypeError("Can't call method on "+e);return e}},"3a89":function(e,t){var n={}.hasOwnProperty;e.exports=function(e,t){return n.call(e,t)}},"3f3e":function(e,t,n){var r=n("9d0f"),o=n("f46f").document,i=r(o)&&r(o.createElement);e.exports=function(e){return i?o.createElement(e):{}}},"3ff3":function(e,t,n){var r=n("b8b4"),o=n("028b").f;n("8138")("getOwnPropertyDescriptor",function(){return function(e,t){return o(r(e),t)}})},"468d":function(e,t,n){var r=n("cf92");e.exports=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==r(e)?e.split(""):Object(e)}},4874:function(e,t,n){var r=n("f46f"),o=n("8a84"),i=n("0785"),u=n("b226"),a=n("3a89"),c="prototype",f=function(e,t,n){var l,s,p,d=e&f.F,h=e&f.G,m=e&f.S,v=e&f.P,b=e&f.B,y=e&f.W,g=h?o:o[t]||(o[t]={}),x=g[c],w=h?r:m?r[t]:(r[t]||{})[c];for(l in h&&(n=t),n)s=!d&&w&&void 0!==w[l],s&&a(g,l)||(p=s?w[l]:n[l],g[l]=h&&"function"!=typeof w[l]?n[l]:b&&s?i(p,r):y&&w[l]==p?function(e){var t=function(t,n,r){if(this instanceof e){switch(arguments.length){case 0:return new e;case 1:return new e(t);case 2:return new e(t,n)}return new e(t,n,r)}return e.apply(this,arguments)};return t[c]=e[c],t}(p):v&&"function"==typeof p?i(Function.call,p):p,v&&((g.virtual||(g.virtual={}))[l]=p,e&f.R&&x&&!x[l]&&u(x,l,p)))};f.F=1,f.G=2,f.S=4,f.P=8,f.B=16,f.W=32,f.U=64,f.R=128,e.exports=f},"4cb6":function(e,t,n){var r=n("b8b4"),o=n("1b9e"),i=n("28b9");e.exports=function(e){return function(t,n,u){var a,c=r(t),f=o(c.length),l=i(u,f);if(e&&n!=n){while(f>l)if(a=c[l++],a!=a)return!0}else for(;f>l;l++)if((e||l in c)&&c[l]===n)return e||l||0;return!e&&-1}}},"4d2b":function(e,t,n){var r=n("8a84"),o=n("f46f"),i="__core-js_shared__",u=o[i]||(o[i]={});(e.exports=function(e,t){return u[e]||(u[e]=void 0!==t?t:{})})("versions",[]).push({version:r.version,mode:n("ffab")?"pure":"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"})},"4f68":function(e,t,n){var r=n("f46f"),o=n("8a84"),i=n("ffab"),u=n("5e1d"),a=n("571d").f;e.exports=function(e){var t=o.Symbol||(o.Symbol=i?{}:r.Symbol||{});"_"==e.charAt(0)||e in t||a(t,e,{value:u.f(e)})}},"53b1":function(e,t,n){n("3ff3");var r=n("8a84").Object;e.exports=function(e,t){return r.getOwnPropertyDescriptor(e,t)}},"571d":function(e,t,n){var r=n("fcfe"),o=n("8fdf"),i=n("f27f"),u=Object.defineProperty;t.f=n("14c4")?Object.defineProperty:function(e,t,n){if(r(e),t=i(t,!0),r(n),o)try{return u(e,t,n)}catch(a){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(e[t]=n.value),e}},"5e1d":function(e,t,n){t.f=n("888e")},"5e97":function(e,t,n){var r=n("f471")("meta"),o=n("9d0f"),i=n("3a89"),u=n("571d").f,a=0,c=Object.isExtensible||function(){return!0},f=!n("0b13")(function(){return c(Object.preventExtensions({}))}),l=function(e){u(e,r,{value:{i:"O"+ ++a,w:{}}})},s=function(e,t){if(!o(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!i(e,r)){if(!c(e))return"F";if(!t)return"E";l(e)}return e[r].i},p=function(e,t){if(!i(e,r)){if(!c(e))return!0;if(!t)return!1;l(e)}return e[r].w},d=function(e){return f&&h.NEED&&c(e)&&!i(e,r)&&l(e),e},h=e.exports={KEY:r,NEED:!1,fastKey:s,getWeak:p,onFreeze:d}},"5f32":function(e,t){t.f=Object.getOwnPropertySymbols},"71e6":function(e,t,n){var r=n("b8b4"),o=n("3041").f,i={}.toString,u="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],a=function(e){try{return o(e)}catch(t){return u.slice()}};e.exports.f=function(e){return u&&"[object Window]"==i.call(e)?a(e):o(r(e))}},"75ac":function(e,t,n){n("ea90"),e.exports=n("8a84").Object.keys},"7aa7":function(e,t,n){var r=n("571d"),o=n("fcfe"),i=n("f830");e.exports=n("14c4")?Object.defineProperties:function(e,t){o(e);var n,u=i(t),a=u.length,c=0;while(a>c)r.f(e,n=u[c++],t[n]);return e}},8138:function(e,t,n){var r=n("4874"),o=n("8a84"),i=n("0b13");e.exports=function(e,t){var n=(o.Object||{})[e]||Object[e],u={};u[e]=t(n),r(r.S+r.F*i(function(){n(1)}),"Object",u)}},8237:function(e,t,n){n("af98");var r=n("8a84").Object;e.exports=function(e,t,n){return r.defineProperty(e,t,n)}},"888e":function(e,t,n){var r=n("4d2b")("wks"),o=n("f471"),i=n("f46f").Symbol,u="function"==typeof i,a=e.exports=function(e){return r[e]||(r[e]=u&&i[e]||(u?i:o)("Symbol."+e))};a.store=r},"895c":function(e,t,n){e.exports=n("75ac")},"8a84":function(e,t){var n=e.exports={version:"2.6.5"};"number"==typeof __e&&(__e=n)},"8bb6":function(e,t,n){var r=n("fcfe"),o=n("7aa7"),i=n("b1d2"),u=n("e556")("IE_PROTO"),a=function(){},c="prototype",f=function(){var e,t=n("3f3e")("iframe"),r=i.length,o="<",u=">";t.style.display="none",n("a109").appendChild(t),t.src="javascript:",e=t.contentWindow.document,e.open(),e.write(o+"script"+u+"document.F=Object"+o+"/script"+u),e.close(),f=e.F;while(r--)delete f[c][i[r]];return f()};e.exports=Object.create||function(e,t){var n;return null!==e?(a[c]=r(e),n=new a,a[c]=null,n[u]=e):n=f(),void 0===t?n:o(n,t)}},"8f5a":function(e,t,n){e.exports=n("53b1")},"8fdf":function(e,t,n){e.exports=!n("14c4")&&!n("0b13")(function(){return 7!=Object.defineProperty(n("3f3e")("div"),"a",{get:function(){return 7}}).a})},9758:function(e,t){e.exports=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e}},"9d0f":function(e,t){e.exports=function(e){return"object"===typeof e?null!==e:"function"===typeof e}},a109:function(e,t,n){var r=n("f46f").document;e.exports=r&&r.documentElement},add2:function(e,t){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},ae0b:function(e,t,n){var r=n("3a89"),o=n("b8b4"),i=n("4cb6")(!1),u=n("e556")("IE_PROTO");e.exports=function(e,t){var n,a=o(e),c=0,f=[];for(n in a)n!=u&&r(a,n)&&f.push(n);while(t.length>c)r(a,n=t[c++])&&(~i(f,n)||f.push(n));return f}},af98:function(e,t,n){var r=n("4874");r(r.S+r.F*!n("14c4"),"Object",{defineProperty:n("571d").f})},afdb:function(e,t,n){e.exports=n("10e7")},b1d2:function(e,t){e.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},b226:function(e,t,n){var r=n("571d"),o=n("add2");e.exports=n("14c4")?function(e,t,n){return r.f(e,t,o(1,n))}:function(e,t,n){return e[t]=n,e}},b42e:function(e,t,n){var r=n("31d6");e.exports=function(e){return Object(r(e))}},b8b4:function(e,t,n){var r=n("468d"),o=n("31d6");e.exports=function(e){return r(o(e))}},c259:function(e,t){t.f={}.propertyIsEnumerable},cf92:function(e,t){var n={}.toString;e.exports=function(e){return n.call(e).slice(8,-1)}},df06:function(e,t){var n=Math.ceil,r=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?r:n)(e)}},e025:function(e,t,n){var r=n("f830"),o=n("5f32"),i=n("c259");e.exports=function(e){var t=r(e),n=o.f;if(n){var u,a=n(e),c=i.f,f=0;while(a.length>f)c.call(e,u=a[f++])&&t.push(u)}return t}},e556:function(e,t,n){var r=n("4d2b")("keys"),o=n("f471");e.exports=function(e){return r[e]||(r[e]=o(e))}},ea90:function(e,t,n){var r=n("b42e"),o=n("f830");n("8138")("keys",function(){return function(e){return o(r(e))}})},f27f:function(e,t,n){var r=n("9d0f");e.exports=function(e,t){if(!r(e))return e;var n,o;if(t&&"function"==typeof(n=e.toString)&&!r(o=n.call(e)))return o;if("function"==typeof(n=e.valueOf)&&!r(o=n.call(e)))return o;if(!t&&"function"==typeof(n=e.toString)&&!r(o=n.call(e)))return o;throw TypeError("Can't convert object to primitive value")}},f3a9:function(e,t,n){var r=n("571d").f,o=n("3a89"),i=n("888e")("toStringTag");e.exports=function(e,t,n){e&&!o(e=n?e:e.prototype,i)&&r(e,i,{configurable:!0,value:t})}},f46f:function(e,t){var n=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},f471:function(e,t){var n=0,r=Math.random();e.exports=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++n+r).toString(36))}},f830:function(e,t,n){var r=n("ae0b"),o=n("b1d2");e.exports=Object.keys||function(e){return r(e,o)}},f9c0:function(e,t,n){e.exports=n("b226")},fb15:function(e,t,n){"use strict";var r;(n.r(t),"undefined"!==typeof window)&&((r=window.document.currentScript)&&(r=r.src.match(/(.+\/)[^\/]+\.js(\?.*)?$/))&&(n.p=r[1]));var o=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("input",{directives:[{name:"currency",rawName:"v-currency",value:{locale:e.locale,currency:e.currency,distractionFree:e.distractionFree,min:e.min,max:e.max},expression:"{locale, currency, distractionFree, min, max}"}],domProps:{value:e.formattedValue},on:{change:e.handleChange}})},i=[],u=n("8f5a"),a=n.n(u),c=n("afdb"),f=n.n(c),l=n("895c"),s=n.n(l),p=n("0a75"),d=n.n(p);function h(e,t,n){return t in e?d()(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function m(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=s()(n);"function"===typeof f.a&&(r=r.concat(f()(n).filter(function(e){return a()(n,e).enumerable}))),r.forEach(function(t){h(e,t,n[t])})}return e}var v=function(e){var t=e.locale,n=e.currency,r=new Intl.NumberFormat(t,{style:"currency",currency:n}),o=r.format(1234),i=(o.match(/0/g)||[]).length,u=i>0?o.substr(o.indexOf("4")+1,1):null,a=null!==u,c=o.substring(0,o.indexOf("1")),f=o.substring(o.lastIndexOf(i>0?"0":"4")+1),l=o.substr(o.indexOf("1")+1,1);return{prefix:c,suffix:f,thousandsSeparatorSymbol:l,decimalSymbol:u,decimalLimit:i,allowDecimal:a}},b=function(e){return e.replace(/\D+/g,"")},y=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.decimalSymbol,r=t.allowNegative,o=void 0===r||r;if("number"===typeof e)return e;if(e&&"string"===typeof e&&e.trim().length){var i=e.startsWith("-")&&o,u=e.split(n),a=b(u[0]);if(i&&(a="-"+a),2===u.length&&(a+="."+b(u[1])),a)return a=Number(a),Number.isNaN(a)?null:a}return null};const g=[],x="";function w({previousConformedValue:e=x,previousPlaceholder:t=x,currentCaretPosition:n=0,conformedValue:r,rawValue:o,placeholderChar:i,placeholder:u,indexesOfPipedChars:a=g,caretTrapIndexes:c=g}){if(0===n||!o.length)return 0;const f=o.length,l=e.length,s=u.length,p=r.length,d=f-l,h=d>0,m=0===l,v=d>1&&!h&&!m;if(v)return n;const b=h&&(e===r||r===u);let y,w,O=0;if(b)O=n-d;else{const e=r.toLowerCase(),c=o.toLowerCase(),f=c.substr(0,n).split(x),l=f.filter(t=>-1!==e.indexOf(t));w=l[l.length-1];const s=t.substr(0,l.length).split(x).filter(e=>e!==i).length,d=u.substr(0,l.length).split(x).filter(e=>e!==i).length,m=d!==s,v=void 0!==t[l.length-1]&&void 0!==u[l.length-2]&&t[l.length-1]!==i&&t[l.length-1]!==u[l.length-1]&&t[l.length-1]===u[l.length-2];!h&&(m||v)&&s>0&&u.indexOf(w)>-1&&void 0!==o[n]&&(y=!0,w=o[n]);const b=a.map(t=>e[t]),g=b.filter(e=>e===w).length,S=l.filter(e=>e===w).length,C=u.substr(0,u.indexOf(i)).split(x).filter((e,t)=>e===w&&o[t]!==e).length,E=C+S+g+(y?1:0);let P=0;for(let t=0;t<p;t++){const n=e[t];if(O=t+1,n===w&&P++,P>=E)break}}if(h){let e=O;for(let t=O;t<=s;t++)if(u[t]===i&&(e=t),u[t]===i||-1!==c.indexOf(t)||t===s)return e}else if(y){for(let g=O-1;g>=0;g--)if(r[g]===w||-1!==c.indexOf(g)||0===g)return g}else for(let g=O;g>=0;g--)if(u[g-1]===i||-1!==c.indexOf(g)||0===g)return g}const O="_",S="function",C=[];function E(e=C,t=O){if(!P(e))throw new Error("Text-mask:convertMaskToPlaceholder; The mask property must be an array.");if(-1!==e.indexOf(t))throw new Error("Placeholder character must not be used as part of the mask. Please specify a character that is not present in your mask as your placeholder character.\n\n"+`The placeholder character that was received is: ${JSON.stringify(t)}\n\n`+`The mask that was received is: ${JSON.stringify(e)}`);return e.map(e=>{return e instanceof RegExp?t:e}).join("")}function P(e){return Array.isArray&&Array.isArray(e)||e instanceof Array}function j(e){return"string"===typeof e||e instanceof String}function _(e){return"number"===typeof e&&void 0===e.length&&!isNaN(e)}const k="[]";function N(e){const t=[];let n;while(n=e.indexOf(k),-1!==n)t.push(n),e.splice(n,1);return{maskWithoutCaretTraps:e,indexes:t}}const T=[],V="";function F(e=V,t=T,n={}){if(!P(t)){if(typeof t!==S)throw new Error("Text-mask:conformToMask; The mask property must be an array.");t=t(e,n),t=N(t).maskWithoutCaretTraps}const{guide:r=!0,previousConformedValue:o=V,placeholderChar:i=O,placeholder:u=E(t,i),currentCaretPosition:a,keepCharPositions:c}=n,f=!1===r&&void 0!==o,l=e.length,s=o.length,p=u.length,d=t.length,h=l-s,m=h>0,v=a+(m?-h:0),b=v+Math.abs(h);if(!0===c&&!m){let t=V;for(let e=v;e<b;e++)u[e]===i&&(t+=i);e=e.slice(0,v)+t+e.slice(v,l)}const y=e.split(V).map((e,t)=>({char:e,isNew:t>=v&&t<b}));for(let w=l-1;w>=0;w--){const{char:e}=y[w];if(e!==i){const t=w>=v&&s===d;e===u[t?w-h:w]&&y.splice(w,1)}}let g=V,x=!1;e:for(let w=0;w<p;w++){const e=u[w];if(e===i){if(y.length>0)while(y.length>0){const{char:e,isNew:n}=y.shift();if(e===i&&!0!==f){g+=i;continue e}if(t[w].test(e)){if(!0===c&&!1!==n&&o!==V&&!1!==r&&m){const t=y.length;let n=null;for(let e=0;e<t;e++){const t=y[e];if(t.char!==i&&!1===t.isNew)break;if(t.char===i){n=e;break}}null!==n?(g+=e,y.splice(n,1)):w--}else g+=e;continue e}x=!0}!1===f&&(g+=u.substr(w,p));break}g+=e}if(f&&!1===m){let e=null;for(let t=0;t<g.length;t++)u[t]===i&&(e=t);g=null!==e?g.substr(0,e+1):V}return{conformedValue:g,meta:{someCharsRejected:x}}}const $="",M="none",I="object",R="undefined"!==typeof navigator&&/Android/i.test(navigator.userAgent),A="undefined"!==typeof requestAnimationFrame?requestAnimationFrame:setTimeout;function D(e){const t={previousConformedValue:void 0,previousPlaceholder:void 0};return{state:t,update(n,{inputElement:r,mask:o,guide:i,pipe:u,placeholderChar:a=O,keepCharPositions:c=!1,showMask:f=!1}=e){if("undefined"===typeof n&&(n=r.value),n===t.previousConformedValue)return;let l,s;if(typeof o===I&&void 0!==o.pipe&&void 0!==o.mask&&(u=o.pipe,o=o.mask),o instanceof Array&&(l=E(o,a)),!1===o)return;const p=W(n),{selectionEnd:d}=r,{previousConformedValue:h,previousPlaceholder:m}=t;let v;if(typeof o===S){if(s=o(p,{currentCaretPosition:d,previousConformedValue:h,placeholderChar:a}),!1===s)return;const{maskWithoutCaretTraps:e,indexes:t}=N(s);s=e,v=t,l=E(s,a)}else s=o;const b={previousConformedValue:h,guide:i,placeholderChar:a,pipe:u,placeholder:l,currentCaretPosition:d,keepCharPositions:c},{conformedValue:y}=F(p,s,b),g=typeof u===S;let x={};g&&(x=u(y,{rawValue:p,...b}),!1===x?x={value:h,rejected:!0}:j(x)&&(x={value:x}));const C=g?x.value:y,P=w({previousConformedValue:h,previousPlaceholder:m,conformedValue:C,placeholder:l,rawValue:p,currentCaretPosition:d,placeholderChar:a,indexesOfPipedChars:x.indexesOfPipedChars,caretTrapIndexes:v}),_=C===l&&0===P,k=f?l:$,T=_?k:C;t.previousConformedValue=T,t.previousPlaceholder=l,r.value!==T&&(r.value=T,L(r,P))}}}function L(e,t){document.activeElement===e&&(R?A(()=>e.setSelectionRange(t,t,M),0):e.setSelectionRange(t,t,M))}function W(e){if(j(e))return e;if(_(e))return String(e);if(void 0===e||null===e)return $;throw new Error("The 'value' provided to Text Mask needs to be a string or a number. The value "+`received was:\n\n ${JSON.stringify(e)}`)}const J="$",q="",B=",",U=".",z="-",G=/-/,K=/\D+/g,X="number",Y=/\d/,Q="[]";function Z({prefix:e=J,suffix:t=q,includeThousandsSeparator:n=!0,thousandsSeparatorSymbol:r=B,allowDecimal:o=!1,decimalSymbol:i=U,decimalLimit:u=2,requireDecimal:a=!1,allowNegative:c=!1,allowLeadingZeroes:f=!1,integerLimit:l=null}={}){const s=e&&e.length||0,p=t&&t.length||0,d=r&&r.length||0;function h(h=q){const m=h.length;if(h===q||h[0]===e[0]&&1===m)return e.split(q).concat([Y]).concat(t.split(q));if(h===i&&o)return e.split(q).concat(["0",i,Y]).concat(t.split(q));const v=h[0]===z&&c;v&&(h=h.toString().substr(1));const b=h.lastIndexOf(i),y=-1!==b;let g,x,w;if(h.slice(-1*p)===t&&(h=h.slice(0,-1*p)),y&&(o||a)?(g=h.slice(h.slice(0,s)===e?s:0,b),x=h.slice(b+1,m),x=H(x.replace(K,q))):g=h.slice(0,s)===e?h.slice(s):h,l&&typeof l===X){const e="."===r?"[.]":`${r}`,t=(g.match(new RegExp(e,"g"))||[]).length;g=g.slice(0,l+t*d)}return g=g.replace(K,q),f||(g=g.replace(/^0+(0$|[^0])/,"$1")),g=n?ee(g,r):g,w=H(g),(y&&o||!0===a)&&(h[b-1]!==i&&w.push(Q),w.push(i,Q),x&&(typeof u===X&&(x=x.slice(0,u)),w=w.concat(x)),!0===a&&h[b-1]===i&&w.push(Y)),s>0&&(w=e.split(q).concat(w)),v&&(w.length===s&&w.push(Y),w=[G].concat(w)),t.length>0&&(w=w.concat(t.split(q))),w}return h.instanceOf="createNumberMask",h}function H(e){return e.split(q).map(e=>Y.test(e)?Y:e)}function ee(e,t){return e.replace(/\B(?=(\d{3})+(?!\d))/g,t)}var te={bind:function(e,t){var n=oe(e,t.value);ie(n),n.addEventListener("input",function(t){var r=t.detail;ue(n,r?r.value:n.value),e.dispatchEvent(new CustomEvent("change",{detail:{numberValue:n.$ci.numberValue,formattedValue:n.value}}))},{capture:!0}),n.addEventListener("focus",function(){var e=n.$ci,t=e.options,r=e.currencyFormatConfig;n.$ci.focus=!0,t.distractionFree&&setTimeout(function(){var e=ae(n);ue(n,y(n.value,r)),n.setSelectionRange(e,e)},0)}),n.addEventListener("blur",function(){n.$ci.focus=!1,ie(n)})},componentUpdated:function(e,t){if(re(t.oldValue,t.value)){var n=oe(e,t.value);ie(n,n.$ci.numberValue)}}},ne={locale:void 0,currency:null,distractionFree:!0,min:null,max:null},re=function(e,t){return Object.keys(ne).some(function(n){return e[n]!==t[n]})},oe=function(e,t){var n=e.matches("input")?e:e.querySelector("input"),r=m({},ne,t);null!==r.min&&null!==r.max&&r.min>r.max&&(console.warn("Ignoring invalid number range"),r.min=ne.min,r.max=ne.max);var o=v(r),i=D({inputElement:n,mask:[]});return n.$ci=m({},n.$ci||{},{options:r,currencyFormatConfig:o,textMaskInputElement:i}),n},ie=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:y(e.value,e.$ci.currencyFormatConfig);ue(e,t),e.dispatchEvent(new Event("input")),e.dispatchEvent(new CustomEvent("change",{detail:{numberValue:e.$ci.numberValue,formattedValue:e.value}}))},ue=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.value,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.$ci,r=n.options,o=n.currencyFormatConfig,i=n.textMaskInputElement,u=n.focus,a=u&&r.distractionFree;"number"===typeof t&&(null!==r.min&&t<r.min&&(t=r.min),null!==r.max&&t>r.max&&(t=r.max),t=new Intl.NumberFormat(r.locale,{minimumFractionDigits:a?0:o.decimalLimit}).format(t)),i.update(t,{inputElement:e,guide:!1,mask:Z(m({},o,{prefix:a?"":o.prefix,suffix:a?"":o.suffix,thousandsSeparatorSymbol:a?"":o.thousandsSeparatorSymbol,allowNegative:null===r.min&&null===r.max||r.min<0||r.max<0}))}),e.$ci.numberValue=y(e.value,o)},ae=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.$ci.currencyFormatConfig,n=t.prefix,r=t.thousandsSeparatorSymbol;return Math.max(0,e.selectionStart-n.length-(e.value.substring(0,e.selectionStart).match(new RegExp("."===r?"\\.":r,"g"))||[]).length)},ce={name:"CurrencyInput",directives:{currency:te},props:{value:{type:Number,default:null},locale:{type:String,default:void 0},currency:{type:String,required:!0},distractionFree:{type:Boolean,default:!0},min:{type:Number,default:null},max:{type:Number,default:null}},data:function(){return{formattedValue:this.value}},watch:{value:function(e){this.$el.$ci.focus||this.$el.dispatchEvent(new CustomEvent("input",{detail:{value:e}}))}},methods:{handleChange:function(e){var t=e.detail;t&&(this.$emit("input",t.numberValue),this.formattedValue=t.formattedValue)}}},fe=ce;function le(e,t,n,r,o,i,u,a){var c,f="function"===typeof e?e.options:e;if(t&&(f.render=t,f.staticRenderFns=n,f._compiled=!0),r&&(f.functional=!0),i&&(f._scopeId="data-v-"+i),u?(c=function(e){e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,e||"undefined"===typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),o&&o.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(u)},f._ssrRegister=c):o&&(c=a?function(){o.call(this,this.$root.$options.shadowRoot)}:o),c)if(f.functional){f._injectStyles=c;var l=f.render;f.render=function(e,t){return c.call(t),l(e,t)}}else{var s=f.beforeCreate;f.beforeCreate=s?[].concat(s,c):[c]}return{exports:e,options:f}}var se=le(fe,o,i,!1,null,null,null),pe=se.exports,de={install:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.componentName,r=t.directiveName;e.component(n||pe.name,pe),e.directive(r||"currency",te)}},he=de;"undefined"!==typeof window&&window.Vue&&window.Vue.use(de),n.d(t,"CurrencyInput",function(){return pe}),n.d(t,"CurrencyDirective",function(){return te});t["default"]=he},fcfe:function(e,t,n){var r=n("9d0f");e.exports=function(e){if(!r(e))throw TypeError(e+" is not an object!");return e}},ffab:function(e,t){e.exports=!0}})});
(function(e,t){"object"===typeof exports&&"object"===typeof module?module.exports=t():"function"===typeof define&&define.amd?define([],t):"object"===typeof exports?exports["vue-currency-input"]=t():e["vue-currency-input"]=t()})("undefined"!==typeof self?self:this,function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s="fb15")}({"014b":function(e,t,n){"use strict";var r=n("e53d"),o=n("07e3"),i=n("8e60"),u=n("63b6"),a=n("9138"),c=n("ebfd").KEY,f=n("294c"),l=n("dbdb"),s=n("45f2"),p=n("62a0"),d=n("5168"),v=n("ccb9"),h=n("6718"),m=n("47ee"),b=n("9003"),y=n("e4ae"),g=n("f772"),x=n("36c3"),w=n("1bc3"),O=n("aebd"),S=n("a159"),C=n("0395"),E=n("bf0b"),P=n("d9f6"),j=n("c3a1"),_=E.f,k=P.f,N=C.f,T=r.Symbol,V=r.JSON,F=V&&V.stringify,$="prototype",I=d("_hidden"),M=d("toPrimitive"),R={}.propertyIsEnumerable,A=l("symbol-registry"),W=l("symbols"),D=l("op-symbols"),L=Object[$],J="function"==typeof T,B=r.QObject,U=!B||!B[$]||!B[$].findChild,q=i&&f(function(){return 7!=S(k({},"a",{get:function(){return k(this,"a",{value:7}).a}})).a})?function(e,t,n){var r=_(L,t);r&&delete L[t],k(e,t,n),r&&e!==L&&k(L,t,r)}:k,z=function(e){var t=W[e]=S(T[$]);return t._k=e,t},G=J&&"symbol"==typeof T.iterator?function(e){return"symbol"==typeof e}:function(e){return e instanceof T},K=function(e,t,n){return e===L&&K(D,t,n),y(e),t=w(t,!0),y(n),o(W,t)?(n.enumerable?(o(e,I)&&e[I][t]&&(e[I][t]=!1),n=S(n,{enumerable:O(0,!1)})):(o(e,I)||k(e,I,O(1,{})),e[I][t]=!0),q(e,t,n)):k(e,t,n)},X=function(e,t){y(e);var n,r=m(t=x(t)),o=0,i=r.length;while(i>o)K(e,n=r[o++],t[n]);return e},Y=function(e,t){return void 0===t?S(e):X(S(e),t)},Q=function(e){var t=R.call(this,e=w(e,!0));return!(this===L&&o(W,e)&&!o(D,e))&&(!(t||!o(this,e)||!o(W,e)||o(this,I)&&this[I][e])||t)},H=function(e,t){if(e=x(e),t=w(t,!0),e!==L||!o(W,t)||o(D,t)){var n=_(e,t);return!n||!o(W,t)||o(e,I)&&e[I][t]||(n.enumerable=!0),n}},Z=function(e){var t,n=N(x(e)),r=[],i=0;while(n.length>i)o(W,t=n[i++])||t==I||t==c||r.push(t);return r},ee=function(e){var t,n=e===L,r=N(n?D:x(e)),i=[],u=0;while(r.length>u)!o(W,t=r[u++])||n&&!o(L,t)||i.push(W[t]);return i};J||(T=function(){if(this instanceof T)throw TypeError("Symbol is not a constructor!");var e=p(arguments.length>0?arguments[0]:void 0),t=function(n){this===L&&t.call(D,n),o(this,I)&&o(this[I],e)&&(this[I][e]=!1),q(this,e,O(1,n))};return i&&U&&q(L,e,{configurable:!0,set:t}),z(e)},a(T[$],"toString",function(){return this._k}),E.f=H,P.f=K,n("6abf").f=C.f=Z,n("355d").f=Q,n("9aa9").f=ee,i&&!n("b8e3")&&a(L,"propertyIsEnumerable",Q,!0),v.f=function(e){return z(d(e))}),u(u.G+u.W+u.F*!J,{Symbol:T});for(var te="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),ne=0;te.length>ne;)d(te[ne++]);for(var re=j(d.store),oe=0;re.length>oe;)h(re[oe++]);u(u.S+u.F*!J,"Symbol",{for:function(e){return o(A,e+="")?A[e]:A[e]=T(e)},keyFor:function(e){if(!G(e))throw TypeError(e+" is not a symbol!");for(var t in A)if(A[t]===e)return t},useSetter:function(){U=!0},useSimple:function(){U=!1}}),u(u.S+u.F*!J,"Object",{create:Y,defineProperty:K,defineProperties:X,getOwnPropertyDescriptor:H,getOwnPropertyNames:Z,getOwnPropertySymbols:ee}),V&&u(u.S+u.F*(!J||f(function(){var e=T();return"[null]"!=F([e])||"{}"!=F({a:e})||"{}"!=F(Object(e))})),"JSON",{stringify:function(e){var t,n,r=[e],o=1;while(arguments.length>o)r.push(arguments[o++]);if(n=t=r[1],(g(t)||void 0!==e)&&!G(e))return b(t)||(t=function(e,t){if("function"==typeof n&&(t=n.call(this,e,t)),!G(t))return t}),r[1]=t,F.apply(V,r)}}),T[$][M]||n("35e8")(T[$],M,T[$].valueOf),s(T,"Symbol"),s(Math,"Math",!0),s(r.JSON,"JSON",!0)},"0395":function(e,t,n){var r=n("36c3"),o=n("6abf").f,i={}.toString,u="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],a=function(e){try{return o(e)}catch(t){return u.slice()}};e.exports.f=function(e){return u&&"[object Window]"==i.call(e)?a(e):o(r(e))}},"07e3":function(e,t){var n={}.hasOwnProperty;e.exports=function(e,t){return n.call(e,t)}},"0fc9":function(e,t,n){var r=n("3a38"),o=Math.max,i=Math.min;e.exports=function(e,t){return e=r(e),e<0?o(e+t,0):i(e,t)}},"11a6":function(e,t,n){e.exports=n("454f")},1691:function(e,t){e.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},"1bc3":function(e,t,n){var r=n("f772");e.exports=function(e,t){if(!r(e))return e;var n,o;if(t&&"function"==typeof(n=e.toString)&&!r(o=n.call(e)))return o;if("function"==typeof(n=e.valueOf)&&!r(o=n.call(e)))return o;if(!t&&"function"==typeof(n=e.toString)&&!r(o=n.call(e)))return o;throw TypeError("Can't convert object to primitive value")}},"1ec9":function(e,t,n){var r=n("f772"),o=n("e53d").document,i=r(o)&&r(o.createElement);e.exports=function(e){return i?o.createElement(e):{}}},"241e":function(e,t,n){var r=n("25eb");e.exports=function(e){return Object(r(e))}},"25eb":function(e,t){e.exports=function(e){if(void 0==e)throw TypeError("Can't call method on "+e);return e}},"294c":function(e,t){e.exports=function(e){try{return!!e()}catch(t){return!0}}},"32a6":function(e,t,n){var r=n("241e"),o=n("c3a1");n("ce7e")("keys",function(){return function(e){return o(r(e))}})},"32fc":function(e,t,n){var r=n("e53d").document;e.exports=r&&r.documentElement},"335c":function(e,t,n){var r=n("6b4c");e.exports=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==r(e)?e.split(""):Object(e)}},"355d":function(e,t){t.f={}.propertyIsEnumerable},"35e8":function(e,t,n){var r=n("d9f6"),o=n("aebd");e.exports=n("8e60")?function(e,t,n){return r.f(e,t,o(1,n))}:function(e,t,n){return e[t]=n,e}},"36c3":function(e,t,n){var r=n("335c"),o=n("25eb");e.exports=function(e){return r(o(e))}},"3a38":function(e,t){var n=Math.ceil,r=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?r:n)(e)}},4521:function(e,t,n){e.exports=n("ed33")},"454f":function(e,t,n){n("46a7");var r=n("584a").Object;e.exports=function(e,t,n){return r.defineProperty(e,t,n)}},"45f2":function(e,t,n){var r=n("d9f6").f,o=n("07e3"),i=n("5168")("toStringTag");e.exports=function(e,t,n){e&&!o(e=n?e:e.prototype,i)&&r(e,i,{configurable:!0,value:t})}},"46a7":function(e,t,n){var r=n("63b6");r(r.S+r.F*!n("8e60"),"Object",{defineProperty:n("d9f6").f})},"47ee":function(e,t,n){var r=n("c3a1"),o=n("9aa9"),i=n("355d");e.exports=function(e){var t=r(e),n=o.f;if(n){var u,a=n(e),c=i.f,f=0;while(a.length>f)c.call(e,u=a[f++])&&t.push(u)}return t}},5168:function(e,t,n){var r=n("dbdb")("wks"),o=n("62a0"),i=n("e53d").Symbol,u="function"==typeof i,a=e.exports=function(e){return r[e]||(r[e]=u&&i[e]||(u?i:o)("Symbol."+e))};a.store=r},5559:function(e,t,n){var r=n("dbdb")("keys"),o=n("62a0");e.exports=function(e){return r[e]||(r[e]=o(e))}},"584a":function(e,t){var n=e.exports={version:"2.5.7"};"number"==typeof __e&&(__e=n)},"5b4e":function(e,t,n){var r=n("36c3"),o=n("b447"),i=n("0fc9");e.exports=function(e){return function(t,n,u){var a,c=r(t),f=o(c.length),l=i(u,f);if(e&&n!=n){while(f>l)if(a=c[l++],a!=a)return!0}else for(;f>l;l++)if((e||l in c)&&c[l]===n)return e||l||0;return!e&&-1}}},"5f2d":function(e,t,n){e.exports=n("8aae")},"62a0":function(e,t){var n=0,r=Math.random();e.exports=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++n+r).toString(36))}},"63b6":function(e,t,n){var r=n("e53d"),o=n("584a"),i=n("d864"),u=n("35e8"),a=n("07e3"),c="prototype",f=function(e,t,n){var l,s,p,d=e&f.F,v=e&f.G,h=e&f.S,m=e&f.P,b=e&f.B,y=e&f.W,g=v?o:o[t]||(o[t]={}),x=g[c],w=v?r:h?r[t]:(r[t]||{})[c];for(l in v&&(n=t),n)s=!d&&w&&void 0!==w[l],s&&a(g,l)||(p=s?w[l]:n[l],g[l]=v&&"function"!=typeof w[l]?n[l]:b&&s?i(p,r):y&&w[l]==p?function(e){var t=function(t,n,r){if(this instanceof e){switch(arguments.length){case 0:return new e;case 1:return new e(t);case 2:return new e(t,n)}return new e(t,n,r)}return e.apply(this,arguments)};return t[c]=e[c],t}(p):m&&"function"==typeof p?i(Function.call,p):p,m&&((g.virtual||(g.virtual={}))[l]=p,e&f.R&&x&&!x[l]&&u(x,l,p)))};f.F=1,f.G=2,f.S=4,f.P=8,f.B=16,f.W=32,f.U=64,f.R=128,e.exports=f},6718:function(e,t,n){var r=n("e53d"),o=n("584a"),i=n("b8e3"),u=n("ccb9"),a=n("d9f6").f;e.exports=function(e){var t=o.Symbol||(o.Symbol=i?{}:r.Symbol||{});"_"==e.charAt(0)||e in t||a(t,e,{value:u.f(e)})}},"6abf":function(e,t,n){var r=n("e6f3"),o=n("1691").concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return r(e,o)}},"6b4c":function(e,t){var n={}.toString;e.exports=function(e){return n.call(e).slice(8,-1)}},"794b":function(e,t,n){e.exports=!n("8e60")&&!n("294c")(function(){return 7!=Object.defineProperty(n("1ec9")("div"),"a",{get:function(){return 7}}).a})},"79aa":function(e,t){e.exports=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e}},"7e90":function(e,t,n){var r=n("d9f6"),o=n("e4ae"),i=n("c3a1");e.exports=n("8e60")?Object.defineProperties:function(e,t){o(e);var n,u=i(t),a=u.length,c=0;while(a>c)r.f(e,n=u[c++],t[n]);return e}},"8aae":function(e,t,n){n("32a6"),e.exports=n("584a").Object.keys},"8e60":function(e,t,n){e.exports=!n("294c")(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},9003:function(e,t,n){var r=n("6b4c");e.exports=Array.isArray||function(e){return"Array"==r(e)}},9138:function(e,t,n){e.exports=n("35e8")},"9aa9":function(e,t){t.f=Object.getOwnPropertySymbols},a159:function(e,t,n){var r=n("e4ae"),o=n("7e90"),i=n("1691"),u=n("5559")("IE_PROTO"),a=function(){},c="prototype",f=function(){var e,t=n("1ec9")("iframe"),r=i.length,o="<",u=">";t.style.display="none",n("32fc").appendChild(t),t.src="javascript:",e=t.contentWindow.document,e.open(),e.write(o+"script"+u+"document.F=Object"+o+"/script"+u),e.close(),f=e.F;while(r--)delete f[c][i[r]];return f()};e.exports=Object.create||function(e,t){var n;return null!==e?(a[c]=r(e),n=new a,a[c]=null,n[u]=e):n=f(),void 0===t?n:o(n,t)}},aebd:function(e,t){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},b447:function(e,t,n){var r=n("3a38"),o=Math.min;e.exports=function(e){return e>0?o(r(e),9007199254740991):0}},b8e3:function(e,t){e.exports=!0},bf0b:function(e,t,n){var r=n("355d"),o=n("aebd"),i=n("36c3"),u=n("1bc3"),a=n("07e3"),c=n("794b"),f=Object.getOwnPropertyDescriptor;t.f=n("8e60")?f:function(e,t){if(e=i(e),t=u(t,!0),c)try{return f(e,t)}catch(n){}if(a(e,t))return o(!r.f.call(e,t),e[t])}},bf90:function(e,t,n){var r=n("36c3"),o=n("bf0b").f;n("ce7e")("getOwnPropertyDescriptor",function(){return function(e,t){return o(r(e),t)}})},c3a1:function(e,t,n){var r=n("e6f3"),o=n("1691");e.exports=Object.keys||function(e){return r(e,o)}},ccb9:function(e,t,n){t.f=n("5168")},ccd8:function(e,t,n){e.exports=n("fde4")},ce7e:function(e,t,n){var r=n("63b6"),o=n("584a"),i=n("294c");e.exports=function(e,t){var n=(o.Object||{})[e]||Object[e],u={};u[e]=t(n),r(r.S+r.F*i(function(){n(1)}),"Object",u)}},d864:function(e,t,n){var r=n("79aa");e.exports=function(e,t,n){if(r(e),void 0===t)return e;switch(n){case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,o){return e.call(t,n,r,o)}}return function(){return e.apply(t,arguments)}}},d9f6:function(e,t,n){var r=n("e4ae"),o=n("794b"),i=n("1bc3"),u=Object.defineProperty;t.f=n("8e60")?Object.defineProperty:function(e,t,n){if(r(e),t=i(t,!0),r(n),o)try{return u(e,t,n)}catch(a){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(e[t]=n.value),e}},dbdb:function(e,t,n){var r=n("584a"),o=n("e53d"),i="__core-js_shared__",u=o[i]||(o[i]={});(e.exports=function(e,t){return u[e]||(u[e]=void 0!==t?t:{})})("versions",[]).push({version:r.version,mode:n("b8e3")?"pure":"global",copyright:"© 2018 Denis Pushkarev (zloirock.ru)"})},e4ae:function(e,t,n){var r=n("f772");e.exports=function(e){if(!r(e))throw TypeError(e+" is not an object!");return e}},e53d:function(e,t){var n=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},e6f3:function(e,t,n){var r=n("07e3"),o=n("36c3"),i=n("5b4e")(!1),u=n("5559")("IE_PROTO");e.exports=function(e,t){var n,a=o(e),c=0,f=[];for(n in a)n!=u&&r(a,n)&&f.push(n);while(t.length>c)r(a,n=t[c++])&&(~i(f,n)||f.push(n));return f}},ebfd:function(e,t,n){var r=n("62a0")("meta"),o=n("f772"),i=n("07e3"),u=n("d9f6").f,a=0,c=Object.isExtensible||function(){return!0},f=!n("294c")(function(){return c(Object.preventExtensions({}))}),l=function(e){u(e,r,{value:{i:"O"+ ++a,w:{}}})},s=function(e,t){if(!o(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!i(e,r)){if(!c(e))return"F";if(!t)return"E";l(e)}return e[r].i},p=function(e,t){if(!i(e,r)){if(!c(e))return!0;if(!t)return!1;l(e)}return e[r].w},d=function(e){return f&&v.NEED&&c(e)&&!i(e,r)&&l(e),e},v=e.exports={KEY:r,NEED:!1,fastKey:s,getWeak:p,onFreeze:d}},ed33:function(e,t,n){n("014b"),e.exports=n("584a").Object.getOwnPropertySymbols},f772:function(e,t){e.exports=function(e){return"object"===typeof e?null!==e:"function"===typeof e}},fb15:function(e,t,n){"use strict";var r;(n.r(t),"undefined"!==typeof window)&&((r=window.document.currentScript)&&(r=r.src.match(/(.+\/)[^\/]+\.js(\?.*)?$/))&&(n.p=r[1]));var o=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("input",{directives:[{name:"currency",rawName:"v-currency",value:{locale:e.locale,currency:e.currency,distractionFree:e.distractionFree,min:e.min,max:e.max,validateOnInput:e.validateOnInput},expression:"{locale, currency, distractionFree, min, max, validateOnInput}"}],domProps:{value:e.formattedValue},on:{change:e.handleChange}})},i=[],u=n("ccd8"),a=n.n(u),c=n("4521"),f=n.n(c),l=n("5f2d"),s=n.n(l),p=n("11a6"),d=n.n(p);function v(e,t,n){return t in e?d()(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function h(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=s()(n);"function"===typeof f.a&&(r=r.concat(f()(n).filter(function(e){return a()(n,e).enumerable}))),r.forEach(function(t){v(e,t,n[t])})}return e}var m=function(e){var t=e.locale,n=e.currency,r=new Intl.NumberFormat(t,{style:"currency",currency:n}),o=r.format(1234),i=(o.match(/0/g)||[]).length,u=i>0?o.substr(o.indexOf("4")+1,1):null,a=null!==u,c=o.substring(0,o.indexOf("1")),f=o.substring(o.lastIndexOf(i>0?"0":"4")+1),l=o.substr(o.indexOf("1")+1,1);return{prefix:c,suffix:f,thousandsSeparatorSymbol:l,decimalSymbol:u,decimalLimit:i,allowDecimal:a}},b=function(e){return e.replace(/\D+/g,"")},y=function(e,t){return t&&e.startsWith(t)?e.substr(t.length):e},g=function(e,t){return t&&e.endsWith(t)?e.slice(0,-1*t.length):e},x=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.decimalSymbol,r=t.allowNegative,o=void 0===r||r;if("number"===typeof e)return e;if(e&&"string"===typeof e&&e.trim().length){var i=e.startsWith("-")&&o,u=e.split(n),a=b(u[0]);if(i&&(a="-"+a),2===u.length&&(a+="."+b(u[1])),a)return a=Number(a),Number.isNaN(a)?null:a}return null};const w=[],O="";function S({previousConformedValue:e=O,previousPlaceholder:t=O,currentCaretPosition:n=0,conformedValue:r,rawValue:o,placeholderChar:i,placeholder:u,indexesOfPipedChars:a=w,caretTrapIndexes:c=w}){if(0===n||!o.length)return 0;const f=o.length,l=e.length,s=u.length,p=r.length,d=f-l,v=d>0,h=0===l,m=d>1&&!v&&!h;if(m)return n;const b=v&&(e===r||r===u);let y,g,x=0;if(b)x=n-d;else{const e=r.toLowerCase(),c=o.toLowerCase(),f=c.substr(0,n).split(O),l=f.filter(t=>-1!==e.indexOf(t));g=l[l.length-1];const s=t.substr(0,l.length).split(O).filter(e=>e!==i).length,d=u.substr(0,l.length).split(O).filter(e=>e!==i).length,h=d!==s,m=void 0!==t[l.length-1]&&void 0!==u[l.length-2]&&t[l.length-1]!==i&&t[l.length-1]!==u[l.length-1]&&t[l.length-1]===u[l.length-2];!v&&(h||m)&&s>0&&u.indexOf(g)>-1&&void 0!==o[n]&&(y=!0,g=o[n]);const b=a.map(t=>e[t]),w=b.filter(e=>e===g).length,S=l.filter(e=>e===g).length,C=u.substr(0,u.indexOf(i)).split(O).filter((e,t)=>e===g&&o[t]!==e).length,E=C+S+w+(y?1:0);let P=0;for(let t=0;t<p;t++){const n=e[t];if(x=t+1,n===g&&P++,P>=E)break}}if(v){let e=x;for(let t=x;t<=s;t++)if(u[t]===i&&(e=t),u[t]===i||-1!==c.indexOf(t)||t===s)return e}else if(y){for(let w=x-1;w>=0;w--)if(r[w]===g||-1!==c.indexOf(w)||0===w)return w}else for(let w=x;w>=0;w--)if(u[w-1]===i||-1!==c.indexOf(w)||0===w)return w}const C="_",E="function",P=[];function j(e=P,t=C){if(!_(e))throw new Error("Text-mask:convertMaskToPlaceholder; The mask property must be an array.");if(-1!==e.indexOf(t))throw new Error("Placeholder character must not be used as part of the mask. Please specify a character that is not present in your mask as your placeholder character.\n\n"+`The placeholder character that was received is: ${JSON.stringify(t)}\n\n`+`The mask that was received is: ${JSON.stringify(e)}`);return e.map(e=>{return e instanceof RegExp?t:e}).join("")}function _(e){return Array.isArray&&Array.isArray(e)||e instanceof Array}function k(e){return"string"===typeof e||e instanceof String}function N(e){return"number"===typeof e&&void 0===e.length&&!isNaN(e)}const T="[]";function V(e){const t=[];let n;while(n=e.indexOf(T),-1!==n)t.push(n),e.splice(n,1);return{maskWithoutCaretTraps:e,indexes:t}}const F=[],$="";function I(e=$,t=F,n={}){if(!_(t)){if(typeof t!==E)throw new Error("Text-mask:conformToMask; The mask property must be an array.");t=t(e,n),t=V(t).maskWithoutCaretTraps}const{guide:r=!0,previousConformedValue:o=$,placeholderChar:i=C,placeholder:u=j(t,i),currentCaretPosition:a,keepCharPositions:c}=n,f=!1===r&&void 0!==o,l=e.length,s=o.length,p=u.length,d=t.length,v=l-s,h=v>0,m=a+(h?-v:0),b=m+Math.abs(v);if(!0===c&&!h){let t=$;for(let e=m;e<b;e++)u[e]===i&&(t+=i);e=e.slice(0,m)+t+e.slice(m,l)}const y=e.split($).map((e,t)=>({char:e,isNew:t>=m&&t<b}));for(let w=l-1;w>=0;w--){const{char:e}=y[w];if(e!==i){const t=w>=m&&s===d;e===u[t?w-v:w]&&y.splice(w,1)}}let g=$,x=!1;e:for(let w=0;w<p;w++){const e=u[w];if(e===i){if(y.length>0)while(y.length>0){const{char:e,isNew:n}=y.shift();if(e===i&&!0!==f){g+=i;continue e}if(t[w].test(e)){if(!0===c&&!1!==n&&o!==$&&!1!==r&&h){const t=y.length;let n=null;for(let e=0;e<t;e++){const t=y[e];if(t.char!==i&&!1===t.isNew)break;if(t.char===i){n=e;break}}null!==n?(g+=e,y.splice(n,1)):w--}else g+=e;continue e}x=!0}!1===f&&(g+=u.substr(w,p));break}g+=e}if(f&&!1===h){let e=null;for(let t=0;t<g.length;t++)u[t]===i&&(e=t);g=null!==e?g.substr(0,e+1):$}return{conformedValue:g,meta:{someCharsRejected:x}}}const M="",R="none",A="object",W="undefined"!==typeof navigator&&/Android/i.test(navigator.userAgent),D="undefined"!==typeof requestAnimationFrame?requestAnimationFrame:setTimeout;function L(e){const t={previousConformedValue:void 0,previousPlaceholder:void 0};return{state:t,update(n,{inputElement:r,mask:o,guide:i,pipe:u,placeholderChar:a=C,keepCharPositions:c=!1,showMask:f=!1}=e){if("undefined"===typeof n&&(n=r.value),n===t.previousConformedValue)return;let l,s;if(typeof o===A&&void 0!==o.pipe&&void 0!==o.mask&&(u=o.pipe,o=o.mask),o instanceof Array&&(l=j(o,a)),!1===o)return;const p=B(n),{selectionEnd:d}=r,{previousConformedValue:v,previousPlaceholder:h}=t;let m;if(typeof o===E){if(s=o(p,{currentCaretPosition:d,previousConformedValue:v,placeholderChar:a}),!1===s)return;const{maskWithoutCaretTraps:e,indexes:t}=V(s);s=e,m=t,l=j(s,a)}else s=o;const b={previousConformedValue:v,guide:i,placeholderChar:a,pipe:u,placeholder:l,currentCaretPosition:d,keepCharPositions:c},{conformedValue:y}=I(p,s,b),g=typeof u===E;let x={};g&&(x=u(y,{rawValue:p,...b}),!1===x?x={value:v,rejected:!0}:k(x)&&(x={value:x}));const w=g?x.value:y,O=S({previousConformedValue:v,previousPlaceholder:h,conformedValue:w,placeholder:l,rawValue:p,currentCaretPosition:d,placeholderChar:a,indexesOfPipedChars:x.indexesOfPipedChars,caretTrapIndexes:m}),P=w===l&&0===O,_=f?l:M,N=P?_:w;t.previousConformedValue=N,t.previousPlaceholder=l,r.value!==N&&(r.value=N,J(r,O))}}}function J(e,t){document.activeElement===e&&(W?D(()=>e.setSelectionRange(t,t,R),0):e.setSelectionRange(t,t,R))}function B(e){if(k(e))return e;if(N(e))return String(e);if(void 0===e||null===e)return M;throw new Error("The 'value' provided to Text Mask needs to be a string or a number. The value "+`received was:\n\n ${JSON.stringify(e)}`)}var U={locale:void 0,currency:"EUR",distractionFree:!0,min:null,max:null,validateOnInput:!1},q=/\d/,z="[]",G=function(e){return e.split("").map(function(e){return q.test(e)?q:e})},K=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.prefix,n=e.suffix,r=e.thousandsSeparatorSymbol,o=e.allowDecimal,i=e.allowNegative,u=e.decimalSymbol,a=e.decimalLimit,c=t?t.length:0,f=n?n.length:0;return function(){var e,l,s=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",p=s.indexOf(u),d=-1!==p,v=s.startsWith("-")&&i;if(s=y(s,"-"),s=y(s,t),s=g(s,n),d&&o){var h=s.split(u);e=h[0],l=G(b(h[1]))}else e=s;e=b(e),e=e.replace(/^0+(0$|[^0])/,"$1"),e=e.replace(/\B(?=(\d{3})+(?!\d))/g,r);var m=G(e);return d&&o&&(m.push(z,u,z),l&&("number"===typeof a&&(l=l.slice(0,a)),m=m.concat(l))),c>0&&(m=t.split("").concat(m)),v&&(m=[/-/].concat(m)),f>0&&(m=m.concat(n.split(""))),m}},X={bind:function(e,t){var n=Q(e,t.value);H(n),n.addEventListener("input",function(t){var r=t.detail;Z(n,r?r.value:n.value),e.dispatchEvent(new CustomEvent("change",{detail:{numberValue:n.$ci.numberValue,formattedValue:n.value}}))},{capture:!0}),n.addEventListener("focus",function(){var e=n.$ci,t=e.options,r=e.currencyFormatConfig;n.$ci.focus=!0,t.distractionFree&&setTimeout(function(){var e=ee(n);Z(n,x(n.value,r)),n.setSelectionRange(e,e)},0)}),n.addEventListener("blur",function(){n.$ci.focus=!1,H(n)})},componentUpdated:function(e,t){if(Y(t.oldValue,t.value)){var n=Q(e,t.value);H(n,n.$ci.numberValue)}}},Y=function(e,t){return Object.keys(U).some(function(n){return e[n]!==t[n]})},Q=function(e,t){var n=e.matches("input")?e:e.querySelector("input");if(!n)throw new Error("The directive must be applied on an element consists of an input element");var r=h({},U,t);if(null!=r.min&&null!=r.max&&r.min>r.max)throw new Error("Invalid number range");var o=m(r),i=L({inputElement:n,mask:[]});return n.$ci=h({},n.$ci||{},{options:r,currencyFormatConfig:o,textMaskInputElement:i}),n},H=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:x(e.value,e.$ci.currencyFormatConfig);Z(e,t),e.dispatchEvent(new Event("input")),e.dispatchEvent(new CustomEvent("change",{detail:{numberValue:e.$ci.numberValue,formattedValue:e.value}}))},Z=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.value,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.$ci,r=n.options,o=n.currencyFormatConfig,i=n.textMaskInputElement,u=n.focus,a=u&&r.distractionFree;"number"===typeof t&&(null!=r.min&&t<r.min&&(t=r.min),null!=r.max&&t>r.max&&(t=r.max),t=new Intl.NumberFormat(r.locale,{minimumFractionDigits:a?0:o.decimalLimit}).format(t)),i.update(t,{inputElement:e,pipe:function(e,t){var n=t.previousConformedValue;if(r.validateOnInput){if(null!=r.min&&x(e,o)<r.min)return n;if(null!=r.max&&x(e,o)>r.max)return n}return e},mask:K(h({},o,{prefix:a?"":o.prefix,suffix:a?"":o.suffix,thousandsSeparatorSymbol:a?"":o.thousandsSeparatorSymbol,allowNegative:null===r.min&&null===r.max||r.min<0||r.max<0}))}),e.$ci.numberValue=x(e.value,o)},ee=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.$ci.currencyFormatConfig,n=t.prefix,r=t.thousandsSeparatorSymbol;return Math.max(0,e.selectionStart-n.length-(e.value.substring(0,e.selectionStart).match(new RegExp("."===r?"\\.":r,"g"))||[]).length)},te={name:"CurrencyInput",directives:{currency:X},props:{value:{type:Number,default:null},locale:{type:String,default:U.locale},currency:{type:String,required:!0},distractionFree:{type:Boolean,default:U.distractionFree},min:{type:Number,default:U.min},max:{type:Number,default:U.max},validateOnInput:{type:Boolean,default:U.validateOnInput}},data:function(){return{formattedValue:this.value}},watch:{value:function(e){this.$el.$ci.focus||this.$el.dispatchEvent(new CustomEvent("input",{detail:{value:e}}))}},methods:{handleChange:function(e){var t=e.detail;t&&(this.$emit("input",t.numberValue),this.formattedValue=t.formattedValue)}}},ne=te;function re(e,t,n,r,o,i,u,a){var c,f="function"===typeof e?e.options:e;if(t&&(f.render=t,f.staticRenderFns=n,f._compiled=!0),r&&(f.functional=!0),i&&(f._scopeId="data-v-"+i),u?(c=function(e){e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,e||"undefined"===typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),o&&o.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(u)},f._ssrRegister=c):o&&(c=a?function(){o.call(this,this.$root.$options.shadowRoot)}:o),c)if(f.functional){f._injectStyles=c;var l=f.render;f.render=function(e,t){return c.call(t),l(e,t)}}else{var s=f.beforeCreate;f.beforeCreate=s?[].concat(s,c):[c]}return{exports:e,options:f}}var oe=re(ne,o,i,!1,null,null,null),ie=oe.exports,ue={install:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.componentName,r=void 0===n?ie.name:n,o=t.directiveName,i=void 0===o?"currency":o;e.component(r,ie),e.directive(i,X)}},ae=ue;"undefined"!==typeof window&&window.Vue&&window.Vue.use(ue),n.d(t,"CurrencyInput",function(){return ie}),n.d(t,"CurrencyDirective",function(){return X});t["default"]=ae},fde4:function(e,t,n){n("bf90");var r=n("584a").Object;e.exports=function(e,t){return r.getOwnPropertyDescriptor(e,t)}}})});
{
"name": "vue-currency-input",
"description": "A component for Vue.js proving an easy input of currency formatted numbers.",
"version": "1.2.0",
"description": "Easy input of currency formatted numbers for Vue.js.",
"version": "1.3.0",
"license": "MIT",

@@ -31,3 +31,3 @@ "unpkg": "dist/vue-currency-input.umd.min.js",

"lint": "vue-cli-service lint",
"test:unit": "vue-cli-service test:unit",
"test:unit": "vue-cli-service test:unit --silent",
"docs:dev": "vuepress dev docs",

@@ -37,3 +37,2 @@ "docs:build": "vuepress build docs"

"dependencies": {
"text-mask-addons": "^3.8.0",
"text-mask-core": "^5.1.2",

@@ -52,2 +51,4 @@ "vue": "^2.6.8"

"intl": "^1.2.5",
"node-sass": "^4.11.0",
"sass-loader": "^7.1.0",
"vue-template-compiler": "^2.6.8",

@@ -54,0 +55,0 @@ "vuepress": "^0.14.9"

@@ -6,4 +6,6 @@ [![Build Status](https://travis-ci.com/dm4t2/vue-currency-input.svg?branch=master)](https://travis-ci.com/dm4t2/vue-currency-input)

# Vue Currency Input
The Vue Currency Input plugin provides a standalone component (`<currency-input>`) and a directive (`v-currency`) allowing an easy input of currency formatted numbers.
The Vue Currency Input plugin allows an easy input of currency formatted numbers. It provides both a standalone component (`<currency-input>`) and a custom Vue directive (`v-currency`) for decorating existing input components with currency format capabilities.
[Read the guide](https://dm4t2.github.io/vue-currency-input/guide/) to getting started or check out the [demo page](https://dm4t2.github.io/vue-currency-input/demo/) to see it in action.
## Features

@@ -19,4 +21,5 @@ ### Format as you type

## Live Demo
[See it in action](https://dm4t2.github.io/vue-currency-input/demo/)
## Support me
If you find this plugin helpful or you want to support the development, buy me a coffee:
[![ko-fi](https://www.ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/D1D6SXEA)
import getCurrencyFormatConfig from './utils/currencyFormatConfig'
import { parse } from './utils/formatHelper'
import createTextMaskInputElement from 'text-mask-core/src/createTextMaskInputElement'
import createNumberMask from 'text-mask-addons/src/createNumberMask'
import defaultOptions from './defaultOptions'
import createCurrencyMask from './utils/createCurrencyMask'

@@ -46,12 +47,4 @@ export default {

const DEFAULT_OPTIONS = {
locale: undefined,
currency: null,
distractionFree: true,
min: null,
max: null
}
const optionsChanged = (oldOptions, newOptions) => {
return Object.keys(DEFAULT_OPTIONS).some((key) => oldOptions[key] !== newOptions[key])
return Object.keys(defaultOptions).some((key) => oldOptions[key] !== newOptions[key])
}

@@ -61,8 +54,9 @@

const inputElement = el.matches('input') ? el : el.querySelector('input')
const options = { ...DEFAULT_OPTIONS, ...optionsFromBinding }
if (options.min !== null && options.max !== null && options.min > options.max) {
console.warn('Ignoring invalid number range')
options.min = DEFAULT_OPTIONS.min
options.max = DEFAULT_OPTIONS.max
if (!inputElement) {
throw new Error('The directive must be applied on an element consists of an input element')
}
const options = { ...defaultOptions, ...optionsFromBinding }
if (options.min != null && options.max != null && options.min > options.max) {
throw new Error('Invalid number range')
}
const currencyFormatConfig = getCurrencyFormatConfig(options)

@@ -93,6 +87,6 @@ const textMaskInputElement = createTextMaskInputElement({ inputElement, mask: [] })

if (typeof value === 'number') {
if (options.min !== null && value < options.min) {
if (options.min != null && value < options.min) {
value = options.min
}
if (options.max !== null && value > options.max) {
if (options.max != null && value > options.max) {
value = options.max

@@ -104,4 +98,14 @@ }

inputElement: el,
guide: false,
mask: createNumberMask({
pipe: (conformedValue, { previousConformedValue }) => {
if (options.validateOnInput) {
if (options.min != null && parse(conformedValue, currencyFormatConfig) < options.min) {
return previousConformedValue
}
if (options.max != null && parse(conformedValue, currencyFormatConfig) > options.max) {
return previousConformedValue
}
}
return conformedValue
},
mask: createCurrencyMask({
...currencyFormatConfig,

@@ -108,0 +112,0 @@ prefix: hideFormatting ? '' : currencyFormatConfig.prefix,

@@ -5,5 +5,5 @@ import component from './CurrencyInput'

const plugin = {
install (Vue, { componentName, directiveName } = {}) {
Vue.component(componentName || component.name, component)
Vue.directive(directiveName || 'currency', directive)
install (Vue, { componentName = component.name, directiveName = 'currency' } = {}) {
Vue.component(componentName, component)
Vue.directive(directiveName, directive)
}

@@ -10,0 +10,0 @@ }

export const onlyDigits = (str) => str.replace(/\D+/g, '')
export const removePrefix = (str, prefix) => {
if (prefix && str.startsWith(prefix)) {
return str.substr(prefix.length)
}
return str
}
export const removeSuffix = (str, suffix) => {
if (suffix && str.endsWith(suffix)) {
return str.slice(0, suffix.length * -1)
}
return str
}
export const parse = (str, { decimalSymbol, allowNegative = true } = {}) => {

@@ -4,0 +18,0 @@ if (typeof str === 'number') {

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc