Comparing version 0.6.0 to 0.7.0
@@ -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.FPMoney=t():e.FPMoney=t()}(window,function(){return function(e){var t={};function n(i){if(t[i])return t[i].exports;var r=t[i]={i:i,l:!1,exports:{}};return e[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},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 i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(i,r,function(t){return e[t]}.bind(null,r));return i},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=4)}([function(e,t,n){"use strict";function i(e,t){void 0===t&&(t=2),""===(e=e.toString())&&(e="0");for(var n="1",i=0;i<t;i++)n+="0";var r=parseInt(n,10);return-1!==e.indexOf(".")&&(e=(parseFloat(e)*r).toString()),0===t?parseInt(e,10):parseFloat((parseInt(e,10)/r).toFixed(t))}function r(){return void 0!==navigator.languages?navigator.languages[0]:navigator.language?navigator.language:"en-US"}t.__esModule=!0,t.currencies={USD:{symbol:"$",fraction:2},EUR:{symbol:"€",fraction:2},GBP:{symbol:"£",fraction:2},INR:{symbol:"₹",fraction:2},CRC:{symbol:"₡",fraction:2},VND:{symbol:"₫",fraction:0},HUF:{symbol:"Ft",fraction:2},ILS:{symbol:"₪",fraction:2},CNY:{symbol:"¥",fraction:2},KRW:{symbol:"₩",fraction:0},NGN:{symbol:"₦",fraction:2},PYG:{symbol:"₲",fraction:0},PHP:{symbol:"₱",fraction:2},PLN:{symbol:"zł",fraction:2},THB:{symbol:"฿",fraction:2},UAH:{symbol:"₴",fraction:2},JPY:{symbol:"¥",fraction:0}},t.intToFraction=i,t.fractionToInt=function(e,t){void 0===t&&(t=2);for(var n=e.toString(),i="1",r=0;r<t;r++)i+="0";var o=parseInt(i,10),s=Math.round(parseFloat(n)*o).toString();return parseInt(s,10)},t.displayValue=function(e,t,n,o){return void 0===o&&(o=r()),new Intl.NumberFormat(o,{localeMatcher:"best fit",style:"currency",currency:t.toUpperCase(),currencyDisplay:"symbol",minimumFractionDigits:n,maximumFractionDigits:n}).format(i(e,n))},t.getLocale=r},function(e,t,n){"use strict";t.__esModule=!0;var i=n(0);!function(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}(n(0));var r=function(){function e(e){var t;this.value="",this.display="",this.format="",this.currencies=JSON.parse(JSON.stringify(i.currencies)),this.currency="",this.locale=i.getLocale(),this.maxValue=0,this.showSelection=!0,this.validate(e),t="string"==typeof e.container?document.querySelector(e.container):e.container,this.container=t,e.currencies&&(this.currencies=e.currencies),e.currency?this.currency=e.currency.toUpperCase():this.currency=Object.keys(this.currencies)[0],e.locale&&(this.locale=e.locale),e.value&&(this.value=i.fractionToInt(e.value,this.currencies[this.currency].fraction).toString()),e.maxValue&&(this.maxValue=i.fractionToInt(e.maxValue,this.currencies[this.currency].fraction)),void 0!==e.showSelection&&(this.showSelection=e.showSelection),this.onChange=e.onChange?this.onChange=e.onChange:function(){},this.currencyDiv=document.createElement("div"),this.input=document.createElement("input"),this.select=document.createElement("select"),this.render(),this.setCurrency(this.currency)}return e.prototype.setCurrency=function(e){e=e.toUpperCase(),this.currency=e,this.currencyDiv.innerHTML=this.currencies[e].symbol;for(var t=this.currencies[e].fraction,n="",i=0;i<t;i++)n+="0";this.input.placeholder="0"+(0===t?"":"."+n),this.select.value=e,this.updateOutput()},e.prototype.setLocale=function(e){this.locale=e,this.updateOutput()},e.prototype.destroy=function(){this.container.innerHTML=""},e.prototype.validate=function(e){if(!("string"==typeof e.container?document.querySelector(e.container):e.container))throw new Error("Could not find container")},e.prototype.updateOutput=function(){if(""!==this.value){var e=parseInt(this.value,10);0!==this.maxValue&&e>this.maxValue&&(e=this.maxValue),this.value=e.toString()}this.format=i.intToFraction(this.value,this.currencies[this.currency].fraction).toFixed(this.currencies[this.currency].fraction),this.display=i.displayValue(this.value,this.currency,this.currencies[this.currency].fraction,this.locale),this.updateInputDisplay(),this.onChange({value:this.value,display:this.display,format:this.format,currency:this.currency,locale:this.locale})},e.prototype.updateInputDisplay=function(){if(""!==this.value){var e=this.display.replace(this.currencies[this.currency.toUpperCase()].symbol,""),t=this.currency;e=e.replace(t,""),t.split("").forEach(function(n,i){e=e.replace(t.substring(0,t.length-i),"")}),e=e.trim(),this.input.value=e}else this.input.value=""},e.prototype.render=function(){var e=this;for(var t in this.container.classList.add("fpm"),this.currencyDiv.classList.add("fpm-currency"),this.input.classList.add("fpm-value"),this.select.classList.add("fpm-select"),this.input.addEventListener("keydown",function(t){e.inputKeydown(t)},!1),this.input.addEventListener("click",function(t){e.input.focus(),e.moveCursorToEnd(e.input)},!1),this.currencies)if(this.currencies.hasOwnProperty(t)){var n=document.createElement("option");n.value=t,n.text=t.toUpperCase(),this.select.appendChild(n)}this.select.addEventListener("change",function(){e.setCurrency(e.select.value)}),this.container.appendChild(this.currencyDiv),this.container.appendChild(this.input),this.showSelection&&this.container.appendChild(this.select)},e.prototype.inputKeydown=function(e){var t=e.keyCode||e.which;8===t||46===t?(e.preventDefault(),this.value=this.value.substring(0,this.value.length-1),this.updateOutput()):t>=48&&t<=57||t>=96&&t<=105?(e.preventDefault(),this.value+=e.key,this.updateOutput()):9===t||13===t||e.preventDefault()},e.prototype.moveCursorToEnd=function(e){if("number"==typeof e.selectionStart)e.selectionStart=e.selectionEnd=e.value.length;else if(void 0!==e.createTextRange){e.focus();var t=e.createTextRange();t.collapse(!1),t.select()}},e}();t.default=r},,,function(e,t,n){"use strict";n.r(t);var i=function(){var e=this.$createElement;return(this._self._c||e)("div",{ref:"fpmoney"})};i._withStripped=!0;var r=n(1),o=n.n(r);var s=function(e,t,n,i,r,o,s,c){var a,u="function"==typeof e?e.options:e;if(t&&(u.render=t,u.staticRenderFns=n,u._compiled=!0),i&&(u.functional=!0),o&&(u._scopeId="data-v-"+o),s?(a=function(e){(e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),r&&r.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(s)},u._ssrRegister=a):r&&(a=c?function(){r.call(this,this.$root.$options.shadowRoot)}:r),a)if(u.functional){u._injectStyles=a;var l=u.render;u.render=function(e,t){return a.call(t),l(e,t)}}else{var h=u.beforeCreate;u.beforeCreate=h?[].concat(h,a):[a]}return{exports:e,options:u}}({name:"fp-money",props:{value:[String,Number],currencies:Object,currency:String,locale:String,maxValue:Number,onChange:Function,showSelection:{type:Boolean,default:!0}},data:()=>({fpmoney:null}),mounted(){this.init()},updated(){this.fpmoney&&this.fpmoney.destroy(),this.init()},methods:{init(){const e={container:this.$refs.fpmoney};this.value&&(e.value=this.value),this.currencies&&(e.currencies=this.currencies),this.currency&&(e.currency=this.currency),this.locale&&(e.locale=this.locale),this.maxValue&&(e.maxValue=this.maxValue),e.showSelection=this.showSelection,this.onChange&&(e.onChange=this.onChange),this.fpmoney=new o.a(e)}}},i,[],!1,null,null,null);s.options.__file="component.vue";t.default=s.exports}])}); | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.FPMoney=e():t.FPMoney=e()}(window,function(){return function(t){var e={};function n(i){if(e[i])return e[i].exports;var r=e[i]={i:i,l:!1,exports:{}};return t[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)n.d(i,r,function(e){return t[e]}.bind(null,r));return i},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=4)}([function(t,e,n){"use strict";function i(t,e){void 0===e&&(e=2),""===(t=t.toString())&&(t="0");for(var n="1",i=0;i<e;i++)n+="0";var r=parseInt(n,10);return-1!==t.indexOf(".")&&(t=(parseFloat(t)*r).toString()),0===e?parseInt(t,10):parseFloat((parseInt(t,10)/r).toFixed(e))}function r(){return void 0!==navigator.languages?navigator.languages[0]:navigator.language?navigator.language:"en-US"}e.__esModule=!0,e.currencies={USD:{symbol:"$",fraction:2},EUR:{symbol:"€",fraction:2},GBP:{symbol:"£",fraction:2},INR:{symbol:"₹",fraction:2},CRC:{symbol:"₡",fraction:2},VND:{symbol:"₫",fraction:0},HUF:{symbol:"Ft",fraction:2},ILS:{symbol:"₪",fraction:2},CNY:{symbol:"¥",fraction:2},KRW:{symbol:"₩",fraction:0},NGN:{symbol:"₦",fraction:2},PYG:{symbol:"₲",fraction:0},PHP:{symbol:"₱",fraction:2},PLN:{symbol:"zł",fraction:2},THB:{symbol:"฿",fraction:2},UAH:{symbol:"₴",fraction:2},JPY:{symbol:"¥",fraction:0}},e.intToFraction=i,e.fractionToInt=function(t,e){void 0===e&&(e=2);for(var n=t.toString(),i="1",r=0;r<e;r++)i+="0";var o=parseInt(i,10),s=Math.round(parseFloat(n)*o).toString();return parseInt(s,10)},e.displayValue=function(t,e,n,o){return void 0===o&&(o=r()),new Intl.NumberFormat(o,{localeMatcher:"best fit",style:"currency",currency:e.toUpperCase(),currencyDisplay:"symbol",minimumFractionDigits:n,maximumFractionDigits:n}).format(i(t,n))},e.getLocale=r},function(t,e,n){"use strict";e.__esModule=!0;var i=n(0);!function(t){for(var n in t)e.hasOwnProperty(n)||(e[n]=t[n])}(n(0));var r=function(){function t(t){var e;this.value="",this.display="",this.format="",this.currencies=JSON.parse(JSON.stringify(i.currencies)),this.currency="",this.locale=i.getLocale(),this.maxValue=0,this.showSelection=!0,this.validate(t),e="string"==typeof t.container?document.querySelector(t.container):t.container,this.container=e,t.currencies&&(this.currencies=t.currencies),t.currency?this.currency=t.currency.toUpperCase():this.currency=Object.keys(this.currencies)[0],t.locale&&(this.locale=t.locale),t.value&&(this.value=i.fractionToInt(t.value,this.currencies[this.currency].fraction).toString()),t.maxValue&&(this.maxValue=i.fractionToInt(t.maxValue,this.currencies[this.currency].fraction)),void 0!==t.showSelection&&(this.showSelection=t.showSelection),this.onChange=t.onChange?this.onChange=t.onChange:function(){},this.currencyDiv=document.createElement("div"),this.input=document.createElement("input"),this.select=document.createElement("select"),this.render(),this.setCurrency(this.currency)}return t.prototype.setCurrency=function(t){t=t.toUpperCase(),this.currency=t,this.currencyDiv.innerHTML=this.currencies[t].symbol;for(var e=this.currencies[t].fraction,n="",i=0;i<e;i++)n+="0";this.input.placeholder="0"+(0===e?"":"."+n),this.select.value=t,this.updateOutput()},t.prototype.setLocale=function(t){this.locale=t,this.updateOutput()},t.prototype.destroy=function(){this.container.innerHTML=""},t.prototype.validate=function(t){if(!("string"==typeof t.container?document.querySelector(t.container):t.container))throw new Error("Could not find container")},t.prototype.updateOutput=function(){if(""!==this.value){var t=parseInt(this.value,10);0!==this.maxValue&&t>this.maxValue&&(t=this.maxValue),this.value=t.toString()}this.format=i.intToFraction(this.value,this.currencies[this.currency].fraction).toFixed(this.currencies[this.currency].fraction),this.display=i.displayValue(this.value,this.currency,this.currencies[this.currency].fraction,this.locale),this.updateInputDisplay(),this.onChange({value:this.value,display:this.display,format:this.format,currency:this.currency,locale:this.locale})},t.prototype.updateInputDisplay=function(){if(""!==this.value){var t=this.display.replace(this.currencies[this.currency.toUpperCase()].symbol,""),e=this.currency;t=t.replace(e,""),e.split("").forEach(function(n,i){t=t.replace(e.substring(0,e.length-i),"")}),t=t.trim(),this.input.value=t}else this.input.value=""},t.prototype.render=function(){var t=this;for(var e in this.container.classList.add("fpm"),this.currencyDiv.classList.add("fpm-currency"),this.input.classList.add("fpm-value"),this.select.classList.add("fpm-select"),this.input.addEventListener("keydown",function(e){t.inputKeydown(e)},!1),this.input.addEventListener("click",function(e){t.input.focus(),t.moveCursorToEnd(t.input)},!1),this.currencies)if(this.currencies.hasOwnProperty(e)){var n=document.createElement("option");n.value=e,n.text=e.toUpperCase(),this.select.appendChild(n)}this.select.addEventListener("change",function(){t.setCurrency(t.select.value)}),this.container.appendChild(this.currencyDiv),this.container.appendChild(this.input),this.showSelection&&this.container.appendChild(this.select)},t.prototype.inputKeydown=function(t){var e=t.keyCode||t.which;8===e||46===e?(t.preventDefault(),this.value=this.value.substring(0,this.value.length-1),this.updateOutput()):e>=48&&e<=57||e>=96&&e<=105?(t.preventDefault(),this.value+=t.key,this.updateOutput()):9===e||13===e||t.preventDefault()},t.prototype.moveCursorToEnd=function(t){if("number"==typeof t.selectionStart)t.selectionStart=t.selectionEnd=t.value.length;else if(void 0!==t.createTextRange){t.focus();var e=t.createTextRange();e.collapse(!1),e.select()}},t}();e.default=r},,,function(t,e,n){"use strict";n.r(e);var i=function(){var t=this.$createElement;return(this._self._c||t)("div",{ref:"fpmoney"})};i._withStripped=!0;var r=n(1),o=n.n(r);var s=function(t,e,n,i,r,o,s,a){var c,u="function"==typeof t?t.options:t;if(e&&(u.render=e,u.staticRenderFns=n,u._compiled=!0),i&&(u.functional=!0),o&&(u._scopeId="data-v-"+o),s?(c=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__),r&&r.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(s)},u._ssrRegister=c):r&&(c=a?function(){r.call(this,this.$root.$options.shadowRoot)}:r),c)if(u.functional){u._injectStyles=c;var l=u.render;u.render=function(t,e){return c.call(e),l(t,e)}}else{var h=u.beforeCreate;u.beforeCreate=h?[].concat(h,c):[c]}return{exports:t,options:u}}({name:"fp-money",props:{value:[String,Number],currencies:Object,currency:String,locale:String,maxValue:Number,onChange:Function,showSelection:{type:Boolean,default:!0}},data:()=>({fpmoney:null,values:{value:"",format:"",display:"",currency:""}}),mounted(){this.init()},updated(){this.fpmoney&&this.fpmoney.destroy(),this.init()},methods:{init(){const t={container:this.$refs.fpmoney,onChange:t=>{this.values=t,this.$emit("input",this.values.format),this.$emit("update:value",this.values.value),this.$emit("update:format",this.values.format),this.$emit("update:display",this.values.display),this.$emit("update:currency",this.values.currency),this.onChange&&this.onChange(t)}};this.value&&(t.value=this.value),this.currencies&&(t.currencies=this.currencies),this.currency&&(t.currency=this.currency),this.locale&&(t.locale=this.locale),this.maxValue&&(t.maxValue=this.maxValue),t.showSelection=this.showSelection,this.fpmoney=new o.a(t)}}},i,[],!1,null,null,null);s.options.__file="component.vue";e.default=s.exports}])}); |
@@ -1,2 +0,2 @@ | ||
(function(e){function t(t){for(var i,o,c=t[0],s=t[1],l=t[2],p=0,h=[];p<c.length;p++)o=c[p],a[o]&&h.push(a[o][0]),a[o]=0;for(i in s)Object.prototype.hasOwnProperty.call(s,i)&&(e[i]=s[i]);u&&u(t);while(h.length)h.shift()();return r.push.apply(r,l||[]),n()}function n(){for(var e,t=0;t<r.length;t++){for(var n=r[t],i=!0,c=1;c<n.length;c++){var s=n[c];0!==a[s]&&(i=!1)}i&&(r.splice(t--,1),e=o(o.s=n[0]))}return e}var i={},a={app:0},r=[];function o(t){if(i[t])return i[t].exports;var n=i[t]={i:t,l:!1,exports:{}};return e[t].call(n.exports,n,n.exports,o),n.l=!0,n.exports}o.m=e,o.c=i,o.d=function(e,t,n){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},o.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)o.d(n,i,function(t){return e[t]}.bind(null,i));return n},o.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="/";var c=window["webpackJsonp"]=window["webpackJsonp"]||[],s=c.push.bind(c);c.push=t,c=c.slice();for(var l=0;l<c.length;l++)t(c[l]);var u=s;r.push([0,"chunk-vendors"]),n()})({0:function(e,t,n){e.exports=n("cd49")},"078e":function(e,t,n){"use strict";var i=n("b13f"),a=n.n(i);a.a},"0df1":function(e,t,n){"use strict";var i=n("e637"),a=n.n(i);a.a},"3b63":function(e,t,n){},4286:function(e,t,n){},8325:function(e,t){e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyRpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNiAoTWFjaW50b3NoKSIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDpFNTE3OEEyQTk5QTAxMUUyOUExNUJDMTA0NkE4OTA0RCIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDpFNTE3OEEyQjk5QTAxMUUyOUExNUJDMTA0NkE4OTA0RCI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOkU1MTc4QTI4OTlBMDExRTI5QTE1QkMxMDQ2QTg5MDREIiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOkU1MTc4QTI5OTlBMDExRTI5QTE1QkMxMDQ2QTg5MDREIi8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+m4QGuQAAAyRJREFUeNrEl21ojWEYx895TDPbMNlBK46IUiNmPvHBSUjaqc0H8pF5+aDUKPEBqU2NhRQpX5Rv5jWlDIWlMCv7MMSWsWwmb3tpXub4XXWdPHvc9/Gc41nu+nedc7/8r/99PffLdYdDPsvkwsgkTBwsA/PADJCnzX2gHTwBt8Hl7p537/3whn04XoDZDcpBlk+9P8AFcAghzRkJwPF4zGGw0Y9QS0mAM2AnQj77FqCzrtcwB1Hk81SYojHK4DyGuQ6mhIIrBWB9Xm7ug/6B/nZrBHBegrkFxoVGpnwBMSLR9EcEcC4qb8pP14BWcBcUgewMnF3T34VqhWMFkThLJAalwnENOAKiHpJq1FZgI2AT6HZtuxZwR9GidSHtI30jOrbawxlVX78/AbNfhHlomEUJJI89O2MqeE79T8/nk8nMBm/dK576hZgmA3cp/R4l9/UeSxiHLVIlNm4nFfT0bxyuIj7LHRTKai+zdJobwMKzcZSJb0ePV5PKN+BqAAKE47UlMnERELMM3EdYP/yrd+XYb2mOiYBiQ8OQnoRBlXrl9JZix7D1pHTazu4MoyBcnYamqAjIMTR8G4FT8LuhLsexXYYjICBiqhQBvYb6fLZIJCjPypVvaOoVAW2WcasCnL2Nq82xHJNSqlCeFcDshaPK0twkAhosjZL31QYw+1rlMpWGMArl23SBsZZO58F2tlJXmjOXS+s4WGvpMiBJT/I2PInZ6lIs9/hBsNS1hS6BG0DSqmYEDRlCXQrmy50P1oDRKTSegmNbUsA0zDMwRhPJXeCE3vWLPQMvan6X8AgIa1vcR4AkGZkDR4ejJ1UHpsaVI0g2LInpOsNFUud1rhxSV+fzC9Woz2EZkWQuja7/B+jUrgtIMpy9YCW4n4K41YfzRneW5E1KJTe4B2Zq1Q5EHEtj4U3AfEzR5SVY4l7QYQPJdN2as7RKBF0BPZqqH4VgMAMBL8Byxr7y8zCZiDlnOcEKIPmUpgB5Z2ww5RdOiiRiNajUmWda5IG6WbhsyY2fx6m8gLcoJDJFkH219M3We1+cnda93pfycZpIJEL/s/wSYADmOAwAQgdpBAAAAABJRU5ErkJggg=="},"94b9":function(e,t,n){"use strict";var i=n("3b63"),a=n.n(i);a.a},b13f:function(e,t,n){},bc8c:function(e,t,n){},c30d:function(e,t,n){"use strict";var i=n("4286"),a=n.n(i);a.a},cd49:function(e,t,n){"use strict";n.r(t);n("cadf"),n("551c"),n("097d"),n("dc22");var i=n("2b0e"),a=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"container"},[n("div",{staticClass:"bluebar"}),n("div",{staticClass:"greenbar"}),n("div",{staticClass:"orangebar"}),n("div",{staticClass:"app"},[n("Header"),n("transition",{attrs:{mode:"out-in",name:"slide-left"}},[n("router-view")],1)],1)])},r=[],o=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"header"},[i("div",{staticClass:"title"},[e._v("FluidPay Money Formatter")]),i("div",{staticClass:"menu"},[i("router-link",{attrs:{to:"/"}},[e._v("Home")]),i("router-link",{attrs:{to:"/functions"}},[e._v("Functions")]),i("router-link",{attrs:{to:"/vue"}},[e._v("Vue")]),i("a",{attrs:{target:"_blank",href:"http://github.com/fluidpay/fp-money"}},[i("img",{attrs:{height:"20",alt:"Github Logomark",src:n("8325")}})])],1)])},c=[],s=i["a"].extend({}),l=s,u=(n("0df1"),n("2877")),p=Object(u["a"])(l,o,c,!1,null,null,null);p.options.__file="header.vue";var h=p.exports,f=i["a"].extend({name:"app",components:{Header:h}}),v=f,d=(n("c30d"),Object(u["a"])(v,a,r,!1,null,null,null));d.options.__file="App.vue";var m=d.exports,y=n("8c4f"),g=function(){var e=this,t=e.$createElement;e._self._c;return e._m(0)},b=[function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"basic"},[n("div",{attrs:{id:"example"}}),n("pre",[e._v(" "),n("code",{staticClass:"language-bash"},[e._v("\n npm install fp-money\n ")]),e._v("\n ")]),n("pre",[e._v(" "),n("code",{staticClass:"language-html"},[e._v('\n <div id="example"></div>\n ')]),e._v("\n ")]),n("pre",[e._v(" "),n("code",{staticClass:"language-javascript"},[e._v("\n import FPMoney from 'fp-money'\n import 'fp-money/dist/fp-money.css'\n\n new FPMoney({\n container: document.querySelector('#example'),\n // value: 86753.09, // optional - default ''\n // currencies: Object // optional - {USD: {symbol: '$', fraction:2}}\n // currency: 'USD', // optional - default 'USD'\n // locale: 'en-us', // optional - default navigator.language\n // maxValue: 999, // optional - default no limit\n // showSelection: true, // optional - default true\n\n onChange: (values) => {\n console.log(values)\n // {\n // value: \"8675309\",\n // display: \"$86,753.09\",\n // format: \"86753.09\",\n // currency: \"USD\",\n // locale: \"en-US\"\n // }\n }\n })\n ")]),e._v("\n ")])])}],A=(n("28a5"),n("a481"),n("6b54"),n("ac6a"),n("456d"),n("c665")),S=n("aa9a"),C={USD:{symbol:"$",fraction:2},EUR:{symbol:"€",fraction:2},GBP:{symbol:"£",fraction:2},INR:{symbol:"₹",fraction:2},CRC:{symbol:"₡",fraction:2},VND:{symbol:"₫",fraction:0},HUF:{symbol:"Ft",fraction:2},ILS:{symbol:"₪",fraction:2},CNY:{symbol:"¥",fraction:2},KRW:{symbol:"₩",fraction:0},NGN:{symbol:"₦",fraction:2},PYG:{symbol:"₲",fraction:0},PHP:{symbol:"₱",fraction:2},PLN:{symbol:"zł",fraction:2},THB:{symbol:"฿",fraction:2},UAH:{symbol:"₴",fraction:2},JPY:{symbol:"¥",fraction:0}};function E(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;e=e.toString(),""===e&&(e="0");for(var n="1",i=0;i<t;i++)n+="0";var a=parseInt(n,10);return-1!==e.indexOf(".")&&(e=(parseFloat(e)*a).toString()),0===t?parseInt(e,10):parseFloat((parseInt(e,10)/a).toFixed(t))}function w(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2,n=e.toString(),i="1",a=0;a<t;a++)i+="0";var r=parseInt(i,10),o=Math.round(parseFloat(n)*r).toString();return parseInt(o,10)}function _(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:x(),a=new Intl.NumberFormat(i,{localeMatcher:"best fit",style:"currency",currency:t.toUpperCase(),currencyDisplay:"symbol",minimumFractionDigits:n,maximumFractionDigits:n});return a.format(E(e,n))}function x(){return void 0!==navigator.languages?navigator.languages[0]:navigator.language?navigator.language:"en-US"}var I=function(){function e(t){var n;Object(A["a"])(this,e),this.value="",this.display="",this.format="",this.currencies=JSON.parse(JSON.stringify(C)),this.currency="",this.locale=x(),this.maxValue=0,this.showSelection=!0,this.validate(t),n="string"===typeof t.container?document.querySelector(t.container):t.container,this.container=n,t.currencies&&(this.currencies=t.currencies),t.currency?this.currency=t.currency.toUpperCase():this.currency=Object.keys(this.currencies)[0],t.locale&&(this.locale=t.locale),t.value&&(this.value=w(t.value,this.currencies[this.currency].fraction).toString()),t.maxValue&&(this.maxValue=w(t.maxValue,this.currencies[this.currency].fraction)),void 0!==t.showSelection&&(this.showSelection=t.showSelection),this.onChange=t.onChange?this.onChange=t.onChange:function(){},this.currencyDiv=document.createElement("div"),this.input=document.createElement("input"),this.select=document.createElement("select"),this.render(),this.setCurrency(this.currency)}return Object(S["a"])(e,[{key:"setCurrency",value:function(e){e=e.toUpperCase(),this.currency=e,this.currencyDiv.innerHTML=this.currencies[e].symbol;for(var t=this.currencies[e].fraction,n="",i=0;i<t;i++)n+="0";this.input.placeholder="0"+(0===t?"":"."+n),this.select.value=e,this.updateOutput()}},{key:"setLocale",value:function(e){this.locale=e,this.updateOutput()}},{key:"destroy",value:function(){this.container.innerHTML=""}},{key:"validate",value:function(e){var t;if(t="string"===typeof e.container?document.querySelector(e.container):e.container,!t)throw new Error("Could not find container")}},{key:"updateOutput",value:function(){if(""!==this.value){var e=parseInt(this.value,10);0!==this.maxValue&&e>this.maxValue&&(e=this.maxValue),this.value=e.toString()}this.format=E(this.value,this.currencies[this.currency].fraction).toFixed(this.currencies[this.currency].fraction),this.display=_(this.value,this.currency,this.currencies[this.currency].fraction,this.locale),this.updateInputDisplay(),this.onChange({value:this.value,display:this.display,format:this.format,currency:this.currency,locale:this.locale})}},{key:"updateInputDisplay",value:function(){if(""!==this.value){var e=this.display.replace(this.currencies[this.currency.toUpperCase()].symbol,""),t=this.currency;e=e.replace(t,""),t.split("").forEach(function(n,i){e=e.replace(t.substring(0,t.length-i),"")}),e=e.trim(),this.input.value=e}else this.input.value=""}},{key:"render",value:function(){var e=this;for(var t in this.container.classList.add("fpm"),this.currencyDiv.classList.add("fpm-currency"),this.input.classList.add("fpm-value"),this.select.classList.add("fpm-select"),this.input.addEventListener("keydown",function(t){e.inputKeydown(t)},!1),this.input.addEventListener("click",function(t){e.input.focus(),e.moveCursorToEnd(e.input)},!1),this.currencies)if(this.currencies.hasOwnProperty(t)){var n=document.createElement("option");n.value=t,n.text=t.toUpperCase(),this.select.appendChild(n)}this.select.addEventListener("change",function(){e.setCurrency(e.select.value)}),this.container.appendChild(this.currencyDiv),this.container.appendChild(this.input),this.showSelection&&this.container.appendChild(this.select)}},{key:"inputKeydown",value:function(e){var t=e.keyCode||e.which;8===t||46===t?(e.preventDefault(),this.value=this.value.substring(0,this.value.length-1),this.updateOutput()):t>=48&&t<=57||t>=96&&t<=105?(e.preventDefault(),this.value+=e.key,this.updateOutput()):9===t||13===t||e.preventDefault()}},{key:"moveCursorToEnd",value:function(e){if("number"===typeof e.selectionStart)e.selectionStart=e.selectionEnd=e.value.length;else if("undefined"!==typeof e.createTextRange){e.focus();var t=e.createTextRange();t.collapse(!1),t.select()}}}]),e}(),M=i["a"].extend({mounted:function(){new I({container:document.querySelector("#example"),value:86753.09,onChange:function(e){console.log(e)}})}}),T=M,D=(n("078e"),Object(u["a"])(T,g,b,!1,null,null,null));D.options.__file="home.vue";var j=D.exports,k=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"main functions"},[e._m(0),n("div",{staticClass:"section"},[n("div",{staticClass:"item"},[e._v("fractionToInt(value, fraction): 86753.09 - "+e._s(e.fractionToInt(86753.09,2)))]),n("div",{staticClass:"item"},[e._v("intToFraction(value, fraction): 8675309 - "+e._s(e.intToFraction(8675309,2)))]),n("div",{staticClass:"item"},[e._v("displayValue(value, currency, fraction, locale): 86753.09 - "+e._s(e.displayValue(86753.09,"usd",2,"en-us")))]),n("div",{staticClass:"item"},[e._v("getLocale(): "+e._s(e.getLocale()))])])])},R=[function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("pre",[e._v(" "),n("code",{staticClass:"language-javascript"},[e._v("\n import {\n currencies, // Array of object currencies\n fractionToInt, \n intToFraction, \n displayValue, \n getLocale // Will output a string based upon your local language\n } from 'fp-money'\n ")]),e._v("\n ")])}],O=i["a"].extend({data:function(){return{}},methods:{fractionToInt:function(e,t){return w(e,t)},intToFraction:function(e,t){return E(e,t)},displayValue:function(e,t,n,i){return _(e,t,n,i)},getLocale:function(){return x()}}}),B=O,U=(n("94b9"),Object(u["a"])(B,k,R,!1,null,null,null));U.options.__file="functions.vue";var J=U.exports,N=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"vue"},[n("fpmoney",{attrs:{id:"example",value:"85555",onChange:e.change}}),e._m(0),e._m(1)],1)},Z=[function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("pre",[e._v(" "),n("code",{staticClass:"language-javascript"},[e._v("\n import fpmoney from 'fp-money/dist/fp-money-vue.js'\n\n export default {\n components: { fpmoney },\n methods: {\n change(values: Values) {\n console.log(values)\n }\n }\n }\n ")]),e._v("\n ")])},function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("pre",[e._v(" "),n("code",{staticClass:"language-html"},[e._v('\n <fpmoney value="85555" :onChange="change" />\n ')]),e._v("\n ")])}],L=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{ref:"fpmoney"})},F=[],P=(n("c5f6"),{name:"fp-money",props:{value:[String,Number],currencies:Object,currency:String,locale:String,maxValue:Number,onChange:Function,showSelection:{type:Boolean,default:!0}},data:function(){return{fpmoney:null}},mounted:function(){this.init()},updated:function(){this.fpmoney&&this.fpmoney.destroy(),this.init()},methods:{init:function(){var e={container:this.$refs.fpmoney};this.value&&(e.value=this.value),this.currencies&&(e.currencies=this.currencies),this.currency&&(e.currency=this.currency),this.locale&&(e.locale=this.locale),this.maxValue&&(e.maxValue=this.maxValue),e.showSelection=this.showSelection,this.onChange&&(e.onChange=this.onChange),this.fpmoney=new I(e)}}}),G=P,W=Object(u["a"])(G,L,F,!1,null,null,null);W.options.__file="component.vue";var Y=W.exports,V=i["a"].extend({components:{fpmoney:Y},methods:{change:function(e){console.log(e)}}}),H=V,Q=(n("d57a"),Object(u["a"])(H,N,Z,!1,null,null,null));Q.options.__file="vue.vue";var X=Q.exports;i["a"].use(y["a"]);var z=new y["a"]({mode:"history",routes:[{path:"/",component:j},{path:"/functions",component:J},{path:"/vue",component:X}]}),q=n("c197"),K=n.n(q),$=n("6f35"),ee=n.n($);n("e391"),n("7362");new ee.a({"remove-trailing":!0,"remove-indent":!0,"left-trim":!0,"right-trim":!0}),i["a"].mixin({updated:function(){K.a.highlightAll()}}),i["a"].config.productionTip=!1,new i["a"]({router:z,render:function(e){return e(m)}}).$mount("#app")},d57a:function(e,t,n){"use strict";var i=n("bc8c"),a=n.n(i);a.a},dc22:function(e,t,n){},e637:function(e,t,n){}}); | ||
(function(e){function t(t){for(var a,c,o=t[0],s=t[1],u=t[2],p=0,f=[];p<o.length;p++)c=o[p],i[c]&&f.push(i[c][0]),i[c]=0;for(a in s)Object.prototype.hasOwnProperty.call(s,a)&&(e[a]=s[a]);l&&l(t);while(f.length)f.shift()();return r.push.apply(r,u||[]),n()}function n(){for(var e,t=0;t<r.length;t++){for(var n=r[t],a=!0,o=1;o<n.length;o++){var s=n[o];0!==i[s]&&(a=!1)}a&&(r.splice(t--,1),e=c(c.s=n[0]))}return e}var a={},i={app:0},r=[];function c(t){if(a[t])return a[t].exports;var n=a[t]={i:t,l:!1,exports:{}};return e[t].call(n.exports,n,n.exports,c),n.l=!0,n.exports}c.m=e,c.c=a,c.d=function(e,t,n){c.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},c.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},c.t=function(e,t){if(1&t&&(e=c(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(c.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)c.d(n,a,function(t){return e[t]}.bind(null,a));return n},c.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return c.d(t,"a",t),t},c.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},c.p="/";var o=window["webpackJsonp"]=window["webpackJsonp"]||[],s=o.push.bind(o);o.push=t,o=o.slice();for(var u=0;u<o.length;u++)t(o[u]);var l=s;r.push([0,"chunk-vendors"]),n()})({0:function(e,t,n){e.exports=n("cd49")},"078e":function(e,t,n){"use strict";var a=n("b13f"),i=n.n(a);i.a},"0df1":function(e,t,n){"use strict";var a=n("e637"),i=n.n(a);i.a},"3b63":function(e,t,n){},4286:function(e,t,n){},8325:function(e,t){e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyRpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNiAoTWFjaW50b3NoKSIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDpFNTE3OEEyQTk5QTAxMUUyOUExNUJDMTA0NkE4OTA0RCIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDpFNTE3OEEyQjk5QTAxMUUyOUExNUJDMTA0NkE4OTA0RCI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOkU1MTc4QTI4OTlBMDExRTI5QTE1QkMxMDQ2QTg5MDREIiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOkU1MTc4QTI5OTlBMDExRTI5QTE1QkMxMDQ2QTg5MDREIi8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+m4QGuQAAAyRJREFUeNrEl21ojWEYx895TDPbMNlBK46IUiNmPvHBSUjaqc0H8pF5+aDUKPEBqU2NhRQpX5Rv5jWlDIWlMCv7MMSWsWwmb3tpXub4XXWdPHvc9/Gc41nu+nedc7/8r/99PffLdYdDPsvkwsgkTBwsA/PADJCnzX2gHTwBt8Hl7p537/3whn04XoDZDcpBlk+9P8AFcAghzRkJwPF4zGGw0Y9QS0mAM2AnQj77FqCzrtcwB1Hk81SYojHK4DyGuQ6mhIIrBWB9Xm7ug/6B/nZrBHBegrkFxoVGpnwBMSLR9EcEcC4qb8pP14BWcBcUgewMnF3T34VqhWMFkThLJAalwnENOAKiHpJq1FZgI2AT6HZtuxZwR9GidSHtI30jOrbawxlVX78/AbNfhHlomEUJJI89O2MqeE79T8/nk8nMBm/dK576hZgmA3cp/R4l9/UeSxiHLVIlNm4nFfT0bxyuIj7LHRTKai+zdJobwMKzcZSJb0ePV5PKN+BqAAKE47UlMnERELMM3EdYP/yrd+XYb2mOiYBiQ8OQnoRBlXrl9JZix7D1pHTazu4MoyBcnYamqAjIMTR8G4FT8LuhLsexXYYjICBiqhQBvYb6fLZIJCjPypVvaOoVAW2WcasCnL2Nq82xHJNSqlCeFcDshaPK0twkAhosjZL31QYw+1rlMpWGMArl23SBsZZO58F2tlJXmjOXS+s4WGvpMiBJT/I2PInZ6lIs9/hBsNS1hS6BG0DSqmYEDRlCXQrmy50P1oDRKTSegmNbUsA0zDMwRhPJXeCE3vWLPQMvan6X8AgIa1vcR4AkGZkDR4ejJ1UHpsaVI0g2LInpOsNFUud1rhxSV+fzC9Woz2EZkWQuja7/B+jUrgtIMpy9YCW4n4K41YfzRneW5E1KJTe4B2Zq1Q5EHEtj4U3AfEzR5SVY4l7QYQPJdN2as7RKBF0BPZqqH4VgMAMBL8Byxr7y8zCZiDlnOcEKIPmUpgB5Z2ww5RdOiiRiNajUmWda5IG6WbhsyY2fx6m8gLcoJDJFkH219M3We1+cnda93pfycZpIJEL/s/wSYADmOAwAQgdpBAAAAABJRU5ErkJggg=="},"94b9":function(e,t,n){"use strict";var a=n("3b63"),i=n.n(a);i.a},b13f:function(e,t,n){},bc8c:function(e,t,n){},c30d:function(e,t,n){"use strict";var a=n("4286"),i=n.n(a);i.a},cd49:function(e,t,n){"use strict";n.r(t);n("cadf"),n("551c"),n("097d"),n("dc22");var a=n("2b0e"),i=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"container"},[n("div",{staticClass:"bluebar"}),n("div",{staticClass:"greenbar"}),n("div",{staticClass:"orangebar"}),n("div",{staticClass:"app"},[n("Header"),n("transition",{attrs:{mode:"out-in",name:"slide-left"}},[n("router-view")],1)],1)])},r=[],c=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"header"},[a("div",{staticClass:"title"},[e._v("FluidPay Money Formatter")]),a("div",{staticClass:"menu"},[a("router-link",{attrs:{to:"/"}},[e._v("Home")]),a("router-link",{attrs:{to:"/functions"}},[e._v("Functions")]),a("router-link",{attrs:{to:"/vue"}},[e._v("Vue")]),a("a",{attrs:{target:"_blank",href:"http://github.com/fluidpay/fp-money"}},[a("img",{attrs:{height:"20",alt:"Github Logomark",src:n("8325")}})])],1)])},o=[],s=a["a"].extend({}),u=s,l=(n("0df1"),n("2877")),p=Object(l["a"])(u,c,o,!1,null,null,null);p.options.__file="header.vue";var f=p.exports,v=a["a"].extend({name:"app",components:{Header:f}}),d=v,h=(n("c30d"),Object(l["a"])(d,i,r,!1,null,null,null));h.options.__file="App.vue";var m=h.exports,y=n("8c4f"),g=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"basic"},[n("div",{attrs:{id:"example"}}),n("div",{staticClass:"outputs"},[e._v("\n Value: "+e._s(e.value)),n("br"),e._v("\n Format: "+e._s(e.format)),n("br"),e._v("\n Display: "+e._s(e.display)),n("br"),e._v("\n Currency: "+e._s(e.currency)+"\n ")]),e._m(0),e._m(1),e._m(2)])},b=[function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("pre",[e._v(" "),n("code",{staticClass:"language-bash"},[e._v("\n npm install fp-money\n ")]),e._v("\n ")])},function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("pre",[e._v(" "),n("code",{staticClass:"language-html"},[e._v('\n <div id="example"></div>\n ')]),e._v("\n ")])},function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("pre",[e._v(" "),n("code",{staticClass:"language-javascript"},[e._v("\n import FPMoney from 'fp-money'\n import 'fp-money/dist/fp-money.css'\n\n new FPMoney({\n container: document.querySelector('#example'),\n // value: 86753.09, // optional - default ''\n // currencies: Object // optional - {USD: {symbol: '$', fraction:2}}\n // currency: 'USD', // optional - default 'USD'\n // locale: 'en-us', // optional - default navigator.language\n // maxValue: 999, // optional - default no limit\n // showSelection: true, // optional - default true\n\n onChange: (values) => {\n console.log(values)\n // {\n // value: \"8675309\",\n // display: \"$86,753.09\",\n // format: \"86753.09\",\n // currency: \"USD\",\n // locale: \"en-US\"\n // }\n }\n })\n ")]),e._v("\n ")])}],_=(n("28a5"),n("a481"),n("6b54"),n("ac6a"),n("456d"),n("c665")),A=n("aa9a"),C={USD:{symbol:"$",fraction:2},EUR:{symbol:"€",fraction:2},GBP:{symbol:"£",fraction:2},INR:{symbol:"₹",fraction:2},CRC:{symbol:"₡",fraction:2},VND:{symbol:"₫",fraction:0},HUF:{symbol:"Ft",fraction:2},ILS:{symbol:"₪",fraction:2},CNY:{symbol:"¥",fraction:2},KRW:{symbol:"₩",fraction:0},NGN:{symbol:"₦",fraction:2},PYG:{symbol:"₲",fraction:0},PHP:{symbol:"₱",fraction:2},PLN:{symbol:"zł",fraction:2},THB:{symbol:"฿",fraction:2},UAH:{symbol:"₴",fraction:2},JPY:{symbol:"¥",fraction:0}};function E(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;e=e.toString(),""===e&&(e="0");for(var n="1",a=0;a<t;a++)n+="0";var i=parseInt(n,10);return-1!==e.indexOf(".")&&(e=(parseFloat(e)*i).toString()),0===t?parseInt(e,10):parseFloat((parseInt(e,10)/i).toFixed(t))}function S(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2,n=e.toString(),a="1",i=0;i<t;i++)a+="0";var r=parseInt(a,10),c=Math.round(parseFloat(n)*r).toString();return parseInt(c,10)}function w(e,t,n){var a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:x(),i=new Intl.NumberFormat(a,{localeMatcher:"best fit",style:"currency",currency:t.toUpperCase(),currencyDisplay:"symbol",minimumFractionDigits:n,maximumFractionDigits:n});return i.format(E(e,n))}function x(){return void 0!==navigator.languages?navigator.languages[0]:navigator.language?navigator.language:"en-US"}var I=function(){function e(t){var n;Object(_["a"])(this,e),this.value="",this.display="",this.format="",this.currencies=JSON.parse(JSON.stringify(C)),this.currency="",this.locale=x(),this.maxValue=0,this.showSelection=!0,this.validate(t),n="string"===typeof t.container?document.querySelector(t.container):t.container,this.container=n,t.currencies&&(this.currencies=t.currencies),t.currency?this.currency=t.currency.toUpperCase():this.currency=Object.keys(this.currencies)[0],t.locale&&(this.locale=t.locale),t.value&&(this.value=S(t.value,this.currencies[this.currency].fraction).toString()),t.maxValue&&(this.maxValue=S(t.maxValue,this.currencies[this.currency].fraction)),void 0!==t.showSelection&&(this.showSelection=t.showSelection),this.onChange=t.onChange?this.onChange=t.onChange:function(){},this.currencyDiv=document.createElement("div"),this.input=document.createElement("input"),this.select=document.createElement("select"),this.render(),this.setCurrency(this.currency)}return Object(A["a"])(e,[{key:"setCurrency",value:function(e){e=e.toUpperCase(),this.currency=e,this.currencyDiv.innerHTML=this.currencies[e].symbol;for(var t=this.currencies[e].fraction,n="",a=0;a<t;a++)n+="0";this.input.placeholder="0"+(0===t?"":"."+n),this.select.value=e,this.updateOutput()}},{key:"setLocale",value:function(e){this.locale=e,this.updateOutput()}},{key:"destroy",value:function(){this.container.innerHTML=""}},{key:"validate",value:function(e){var t;if(t="string"===typeof e.container?document.querySelector(e.container):e.container,!t)throw new Error("Could not find container")}},{key:"updateOutput",value:function(){if(""!==this.value){var e=parseInt(this.value,10);0!==this.maxValue&&e>this.maxValue&&(e=this.maxValue),this.value=e.toString()}this.format=E(this.value,this.currencies[this.currency].fraction).toFixed(this.currencies[this.currency].fraction),this.display=w(this.value,this.currency,this.currencies[this.currency].fraction,this.locale),this.updateInputDisplay(),this.onChange({value:this.value,display:this.display,format:this.format,currency:this.currency,locale:this.locale})}},{key:"updateInputDisplay",value:function(){if(""!==this.value){var e=this.display.replace(this.currencies[this.currency.toUpperCase()].symbol,""),t=this.currency;e=e.replace(t,""),t.split("").forEach(function(n,a){e=e.replace(t.substring(0,t.length-a),"")}),e=e.trim(),this.input.value=e}else this.input.value=""}},{key:"render",value:function(){var e=this;for(var t in this.container.classList.add("fpm"),this.currencyDiv.classList.add("fpm-currency"),this.input.classList.add("fpm-value"),this.select.classList.add("fpm-select"),this.input.addEventListener("keydown",function(t){e.inputKeydown(t)},!1),this.input.addEventListener("click",function(t){e.input.focus(),e.moveCursorToEnd(e.input)},!1),this.currencies)if(this.currencies.hasOwnProperty(t)){var n=document.createElement("option");n.value=t,n.text=t.toUpperCase(),this.select.appendChild(n)}this.select.addEventListener("change",function(){e.setCurrency(e.select.value)}),this.container.appendChild(this.currencyDiv),this.container.appendChild(this.input),this.showSelection&&this.container.appendChild(this.select)}},{key:"inputKeydown",value:function(e){var t=e.keyCode||e.which;8===t||46===t?(e.preventDefault(),this.value=this.value.substring(0,this.value.length-1),this.updateOutput()):t>=48&&t<=57||t>=96&&t<=105?(e.preventDefault(),this.value+=e.key,this.updateOutput()):9===t||13===t||e.preventDefault()}},{key:"moveCursorToEnd",value:function(e){if("number"===typeof e.selectionStart)e.selectionStart=e.selectionEnd=e.value.length;else if("undefined"!==typeof e.createTextRange){e.focus();var t=e.createTextRange();t.collapse(!1),t.select()}}}]),e}(),M=a["a"].extend({data:function(){return{value:"",format:"",display:"",currency:""}},mounted:function(){var e=this;new I({container:document.querySelector("#example"),value:86753.09,onChange:function(t){e.value=t.value,e.format=t.format,e.display=t.display,e.currency=t.currency}})}}),D=M,T=(n("078e"),Object(l["a"])(D,g,b,!1,null,null,null));T.options.__file="home.vue";var j=T.exports,k=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"main functions"},[e._m(0),n("div",{staticClass:"section"},[n("div",{staticClass:"item"},[e._v("fractionToInt(value, fraction): 86753.09 - "+e._s(e.fractionToInt(86753.09,2)))]),n("div",{staticClass:"item"},[e._v("intToFraction(value, fraction): 8675309 - "+e._s(e.intToFraction(8675309,2)))]),n("div",{staticClass:"item"},[e._v("displayValue(value, currency, fraction, locale): 86753.09 - "+e._s(e.displayValue(86753.09,"usd",2,"en-us")))]),n("div",{staticClass:"item"},[e._v("getLocale(): "+e._s(e.getLocale()))])])])},R=[function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("pre",[e._v(" "),n("code",{staticClass:"language-javascript"},[e._v("\n import {\n currencies, // Array of object currencies\n fractionToInt, \n intToFraction, \n displayValue, \n getLocale // Will output a string based upon your local language\n } from 'fp-money'\n ")]),e._v("\n ")])}],O=a["a"].extend({data:function(){return{}},methods:{fractionToInt:function(e,t){return S(e,t)},intToFraction:function(e,t){return E(e,t)},displayValue:function(e,t,n,a){return w(e,t,n,a)},getLocale:function(){return x()}}}),B=O,U=(n("94b9"),Object(l["a"])(B,k,R,!1,null,null,null));U.options.__file="functions.vue";var J=U.exports,N=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"vue"},[n("fpmoney",{attrs:{id:"example",value:e.int,format:e.format,display:e.display,currency:e.currency,onChange:e.change},on:{"update:value":function(t){e.int=t},"update:format":function(t){e.format=t},"update:display":function(t){e.display=t},"update:currency":function(t){e.currency=t}},model:{value:e.value,callback:function(t){e.value=t},expression:"value"}}),n("div",{staticClass:"outputs"},[e._v("\n Value: "+e._s(e.value)),n("br"),e._v("\n Format: "+e._s(e.format)),n("br"),e._v("\n Display: "+e._s(e.display)),n("br"),e._v("\n Currency: "+e._s(e.currency)+"\n ")]),e._m(0),e._m(1)],1)},Z=[function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("pre",[e._v(" "),n("code",{staticClass:"language-javascript"},[e._v("\n import fpmoney from 'fp-money/dist/fp-money-vue.js'\n\n export default {\n components: { fpmoney },\n data() {\n return {\n value: 86753.09,\n int: '',\n format: '',\n display: '',\n currency: ''\n }\n },\n methods: {\n change(values) {\n console.log(values)\n }\n }\n }\n ")]),e._v("\n ")])},function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("pre",[e._v(" "),n("code",{staticClass:"language-html"},[e._v('\n <fpmoney id="example" \n v-model="value" \n :value.sync="int" \n :format.sync="format" \n :display.sync="display"\n :currency.sync="currency"\n :onChange="change" />\n ')]),e._v("\n ")])}],F=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{ref:"fpmoney"})},L=[],P=(n("c5f6"),{name:"fp-money",props:{value:[String,Number],currencies:Object,currency:String,locale:String,maxValue:Number,onChange:Function,showSelection:{type:Boolean,default:!0}},data:function(){return{fpmoney:null,values:{value:"",format:"",display:"",currency:""}}},mounted:function(){this.init()},updated:function(){this.fpmoney&&this.fpmoney.destroy(),this.init()},methods:{init:function(){var e=this,t={container:this.$refs.fpmoney,onChange:function(t){e.values=t,e.$emit("input",e.values.format),e.$emit("update:value",e.values.value),e.$emit("update:format",e.values.format),e.$emit("update:display",e.values.display),e.$emit("update:currency",e.values.currency),e.onChange&&e.onChange(t)}};this.value&&(t.value=this.value),this.currencies&&(t.currencies=this.currencies),this.currency&&(t.currency=this.currency),this.locale&&(t.locale=this.locale),this.maxValue&&(t.maxValue=this.maxValue),t.showSelection=this.showSelection,this.fpmoney=new I(t)}}}),G=P,V=Object(l["a"])(G,F,L,!1,null,null,null);V.options.__file="component.vue";var W=V.exports,Y=a["a"].extend({components:{fpmoney:W},data:function(){return{value:86753.09,int:"",format:"",display:"",currency:""}},methods:{change:function(e){console.log(e)}}}),H=Y,Q=(n("d57a"),Object(l["a"])(H,N,Z,!1,null,null,null));Q.options.__file="vue.vue";var X=Q.exports;a["a"].use(y["a"]);var z=new y["a"]({mode:"history",routes:[{path:"/",component:j},{path:"/functions",component:J},{path:"/vue",component:X}]}),$=n("c197"),q=n.n($),K=n("6f35"),ee=n.n(K);n("e391"),n("7362");new ee.a({"remove-trailing":!0,"remove-indent":!0,"left-trim":!0,"right-trim":!0}),a["a"].mixin({updated:function(){q.a.highlightAll()}}),a["a"].config.productionTip=!1,new a["a"]({router:z,render:function(e){return e(m)}}).$mount("#app")},d57a:function(e,t,n){"use strict";var a=n("bc8c"),i=n.n(a);i.a},dc22:function(e,t,n){},e637:function(e,t,n){}}); | ||
//# sourceMappingURL=app.js.map |
{ | ||
"name": "fp-money", | ||
"version": "0.6.0", | ||
"version": "0.7.0", | ||
"private": false, | ||
@@ -5,0 +5,0 @@ "description": "FluidPay input formatter and currency selector", |
@@ -6,2 +6,8 @@ # fp-money | ||
 | ||
 | ||
 | ||
## Vue | ||
 |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
5390809
53
3194
12