vue-input-facade
Advanced tools
Comparing version 3.0.0-beta.1 to 3.0.0-beta.2
@@ -689,3 +689,3 @@ module.exports = | ||
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--13-0!./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--1-1!./src/component.vue?vue&type=template&id=5206c29e | ||
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--13-0!./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--1-1!./src/component.vue?vue&type=template&id=7a2fb97a | ||
@@ -705,3 +705,3 @@ const _hoisted_1 = ["value"]; | ||
} | ||
// CONCATENATED MODULE: ./src/component.vue?vue&type=template&id=5206c29e | ||
// CONCATENATED MODULE: ./src/component.vue?vue&type=template&id=7a2fb97a | ||
@@ -785,3 +785,3 @@ // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--13-0!./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--1-1!./src/component.vue?vue&type=script&lang=js | ||
return { | ||
maskedValue: this.value, | ||
maskedValue: this.modelValue, | ||
unmaskedValue: null | ||
@@ -788,0 +788,0 @@ }; |
@@ -698,3 +698,3 @@ (function webpackUniversalModuleDefinition(root, factory) { | ||
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--13-0!./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--1-1!./src/component.vue?vue&type=template&id=5206c29e | ||
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--13-0!./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--1-1!./src/component.vue?vue&type=template&id=7a2fb97a | ||
@@ -714,3 +714,3 @@ const _hoisted_1 = ["value"]; | ||
} | ||
// CONCATENATED MODULE: ./src/component.vue?vue&type=template&id=5206c29e | ||
// CONCATENATED MODULE: ./src/component.vue?vue&type=template&id=7a2fb97a | ||
@@ -794,3 +794,3 @@ // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--13-0!./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--1-1!./src/component.vue?vue&type=script&lang=js | ||
return { | ||
maskedValue: this.value, | ||
maskedValue: this.modelValue, | ||
unmaskedValue: null | ||
@@ -797,0 +797,0 @@ }; |
@@ -1,1 +0,1 @@ | ||
(function(e,t){"object"===typeof exports&&"object"===typeof module?module.exports=t(require("vue")):"function"===typeof define&&define.amd?define([],t):"object"===typeof exports?exports["vue-input-facade"]=t(require("vue")):e["vue-input-facade"]=t(e["Vue"])})("undefined"!==typeof self?self:this,(function(e){return function(e){var t={};function n(o){if(t[o])return t[o].exports;var i=t[o]={i:o,l:!1,exports:{}};return e[o].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},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 o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(o,i,function(t){return e[t]}.bind(null,i));return o},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")}({"8bbf":function(t,n){t.exports=e},d959:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=(e,t)=>{const n=e.__vccOpts||e;for(const[o,i]of t)n[o]=i;return n}},fb15:function(e,t,n){"use strict";if(n.r(t),n.d(t,"InputFacade",(function(){return S})),n.d(t,"facade",(function(){return V})),n.d(t,"tokens",(function(){return a})),n.d(t,"masker",(function(){return y})),n.d(t,"filter",(function(){return M})),"undefined"!==typeof window){var o=window.document.currentScript,i=o&&o.src.match(/(.+\/)[^/]+\.js(\?.*)?$/);i&&(n.p=i[1])}var a={"#":{pattern:/\d/},X:{pattern:/[0-9a-z]/i},S:{pattern:/[a-z]/i},A:{pattern:/[a-z]/i,transform:e=>e.toLocaleUpperCase()},a:{pattern:/[a-z]/i,transform:e=>e.toLocaleLowerCase()},"\\":{escape:!0},"?":{optional:!0},"*":{repeat:!0},"|":{pipe:!0}};const r="__input-facade__";function s(e){this.masked=this.unmasked=e||""}function u(){return new CustomEvent("input",{bubbles:!0,cancelable:!0,detail:{facade:!0}})}function l(e,t){return(Array.isArray(e)||"string"===typeof e)&&(e={mask:e}),Object.assign(e||{},t)}function d(e){const t=e instanceof HTMLInputElement?e:e.querySelector("input");if(!t)throw new Error("facade directive requires an input element");return t}function c(e){const{target:t,detail:n,inputType:o}=e;if(null!==n&&void 0!==n&&n.facade)return!1;if(e.stopPropagation(),["insertCompositionText","insertFromComposition"].includes(o))return!1;const i=t.value,a=t.selectionEnd,{oldValue:s}=t[r];p(t,null,{emit:!1},e),f(e,i,a),s!==t.value&&t.dispatchEvent(u())}function f(e,t,n){const{target:o}=e,i=["text","tel","search",null].includes(o.getAttribute("type")),a=o[r]&&o[r].config;if(o!==document.activeElement||!i||!a.mask&&!a.masked)return;const s=e.inputType||"insertText",u=["insertText","insertFromPaste"].includes(s),l=u&&n==t.length;let d=u&&t[n-1];const c=o.value.toLocaleLowerCase();let f=n;if(l)f=c.length;else if(d){d=d.toLocaleLowerCase();let e=f;while(e<=c.length&&c.charAt(e-1)!==d)e++;f=e<=c.length?e:f-1}o.setSelectionRange(f,f),setTimeout((function(){o.setSelectionRange(f,f)}),0)}function p(e,t,{emit:n=!0,force:o=!1}={},i){var a,s;let{config:l,oldValue:d,isComposing:c}=e[r],f=(null===t||void 0===t||null===(a=t.data)||void 0===a||null===(s=a.model)||void 0===s?void 0:s.value)||e.value;if(!c&&(d=d||"",f=f||"",o||d!==f)){["deleteByCut","deleteContent","deleteContentBackward","deleteContentForward"].includes(null===i||void 0===i?void 0:i.inputType)&&(l={...l,short:!0});let t=y(f,l);if(i&&"function"===typeof l.formatter){const n=l.formatter(t,i);if("string"===typeof n)t=y(n,l);else if(!1===n)return void(e.value=d)}e[r].oldValue=t.masked,e.unmaskedValue=t.unmasked,e.value!==t.masked&&(e.value=t.masked),n&&e.dispatchEvent(u())}}let m=a,v=!1;try{"a".localeCompare("b","i")}catch(A){v="RangeError"===A.name}function h(e){e&&(m=e)}function k(e,t){const n=t.masks.slice().sort((e,t)=>e.length-t.length),o=e=>Object.assign({},t,e),i=(t,n)=>{const i=g(e,o({mask:n})),a=t.unmasked.length,r=i.unmasked.length;return r>a?i:t};if(!n.length)return new s;const a=n.shift();let r=g(e,o({mask:a}));while(n.length){const e=n.shift();r=i(r,e)}return r}function g(e,t){let{mask:n="",tokens:o,prefill:i=!1,short:a=!1}=t;o=o?Object.assign({},m,o):m;let r=new s,u=!1,l=0,d=0,c="";function f(e){const t=n[d+1],i=o[t];return{escape:!(null===e||void 0===e||!e.escape),optional:!(null===i||void 0===i||!i.optional),repeat:!(null===i||void 0===i||!i.repeat),...(null===i||void 0===i?void 0:i.pipe)&&{pipe:n.substring(d).match(/^(.\|)+./g)[0].split("|")}}}while(d<n.length){const t=n[d],i=o[t];let a=e[l];const s=f(i);if(!i||u||s.pipe)if(s.pipe){if(!a)break;const e=s.pipe.find(b.bind(null,a));e&&(r.unmasked+=e,r.masked+=c+e,d+=2*s.pipe.length-1,c=""),l++}else b(a,t)?(r.masked+=c+t,l++,c="",s.optional&&(r.unmasked+=t)):s.optional||(c+=t),u=!1,d+=s.optional?2:1;else{var p,v;if(s.escape){u=!0,d++;continue}if(!a)break;if(null!==(p=i.pattern)&&void 0!==p&&p.test(a))a=(null===(v=i.transform)||void 0===v?void 0:v.call(i,a))||a,r.unmasked+=a,r.masked+=c+a,c="",s.repeat||(d+=s.optional?2:1);else if(s.optional||s.repeat){d+=2;continue}l++}}return(i&&!r.unmasked||!a&&r.unmasked)&&(r.masked+=c),r}function b(e,t){return v?0===(null===e||void 0===e?void 0:e.localeCompare(t,void 0,{sensitivity:"base"})):(null===e||void 0===e?void 0:e.toLocaleLowerCase())===(null===t||void 0===t?void 0:t.toLocaleLowerCase())}function y(e,t){return e=(e||"").toString(),t=l(t),t.mask?Array.isArray(t.mask)?k(e,Object.assign({},t,{masks:t.mask})):g(e,t):new s(e)}const w=r;var V={beforeMount:(e,{value:t,modifiers:n},o)=>{e=d(e);const i=l(t,n);e[w]={config:i},p(e,o,{force:i.prefill})},mounted:e=>{e=d(e);const t=e[w],n=e.parentElement||e,o=t=>{t.target===e&&c(t,e)},i=t=>{t.target===e&&("compositionend"===t.type?(e[w].isComposing=!1,c(t,e)):e[w].isComposing=!0)};n.addEventListener("input",o,!0),n.addEventListener("compositionstart",i,!0),n.addEventListener("compositionupdate",i,!0),n.addEventListener("compositionend",i,!0),t.cleanup=()=>{n.removeEventListener("input",o,!0),n.removeEventListener("compositionstart",i,!0),n.removeEventListener("compositionend",i,!0),n.removeEventListener("compositionupdate",i,!0)}},updated:(e,{value:t,oldValue:n,modifiers:o},i)=>{e=d(e),t!==n?(e[w].config=l(t,o),p(e,i,{force:!0})):p(e,i)},unmounted:e=>{d(e)[w].cleanup()}},C=n("8bbf");const j=["value"];function L(e,t,n,o,i,a){const r=Object(C["resolveDirective"])("facade");return Object(C["withDirectives"])((Object(C["openBlock"])(),Object(C["createElementBlock"])("input",{type:"text",value:i.maskedValue,onInput:t[0]||(t[0]=(...e)=>a.onInput&&a.onInput(...e)),onChange:t[1]||(t[1]=(...e)=>a.onChange&&a.onChange(...e)),onBlur:t[2]||(t[2]=t=>e.$emit("blur")),onFocus:t[3]||(t[3]=t=>e.$emit("focus"))},null,40,j)),[[r,a.config]])}var E={name:"InputFacade",props:{formatter:Function,mask:[String,Array],masked:{type:Boolean,default:!1},prefill:{type:Boolean,default:!1},short:{type:Boolean,default:!1},tokens:Object,modelValue:[String,Number],modelModifiers:{default:()=>({})}},directives:{facade:V},data(){return{maskedValue:this.value,unmaskedValue:null}},watch:{modelValue(e){e!==this.emittedValue&&(this.maskedValue=e)},mask:{deep:!0,handler(e){e||this.masked||(this.maskedValue=this.unmaskedValue)}},masked(){this.emitInput()}},computed:{config(){return{mask:this.mask,masked:this.masked,tokens:this.tokens,formatter:this.formatter,prefill:this.prefill,short:this.short}},emittedValue(){return this.mask&&this.masked?this.maskedValue:this.unmaskedValue}},methods:{onInput({target:e}){this.maskedValue=e.value,this.unmaskedValue=e.unmaskedValue,this.modelModifiers.lazy||this.emitInput()},onChange(){this.$emit("change",this.emittedValue),this.modelModifiers.lazy&&this.emitInput()},emitInput(){this.$emit("update:modelValue",this.emittedValue)}}},O=n("d959"),x=n.n(O);const _=x()(E,[["render",L]]);var S=_;function I(e,t={}){t.tokens&&h(t.tokens),e.component(S.name,S),e.directive(t.name||"facade",V),e.filter(t.name||"facade",M)}function M(e,t){return y(e,t).masked}var T=I;"undefined"!==typeof window&&window.Vue&&window.Vue.use(I);t["default"]=T}})})); | ||
(function(e,t){"object"===typeof exports&&"object"===typeof module?module.exports=t(require("vue")):"function"===typeof define&&define.amd?define([],t):"object"===typeof exports?exports["vue-input-facade"]=t(require("vue")):e["vue-input-facade"]=t(e["Vue"])})("undefined"!==typeof self?self:this,(function(e){return function(e){var t={};function n(o){if(t[o])return t[o].exports;var i=t[o]={i:o,l:!1,exports:{}};return e[o].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},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 o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(o,i,function(t){return e[t]}.bind(null,i));return o},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")}({"8bbf":function(t,n){t.exports=e},d959:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=(e,t)=>{const n=e.__vccOpts||e;for(const[o,i]of t)n[o]=i;return n}},fb15:function(e,t,n){"use strict";if(n.r(t),n.d(t,"InputFacade",(function(){return S})),n.d(t,"facade",(function(){return V})),n.d(t,"tokens",(function(){return a})),n.d(t,"masker",(function(){return y})),n.d(t,"filter",(function(){return M})),"undefined"!==typeof window){var o=window.document.currentScript,i=o&&o.src.match(/(.+\/)[^/]+\.js(\?.*)?$/);i&&(n.p=i[1])}var a={"#":{pattern:/\d/},X:{pattern:/[0-9a-z]/i},S:{pattern:/[a-z]/i},A:{pattern:/[a-z]/i,transform:e=>e.toLocaleUpperCase()},a:{pattern:/[a-z]/i,transform:e=>e.toLocaleLowerCase()},"\\":{escape:!0},"?":{optional:!0},"*":{repeat:!0},"|":{pipe:!0}};const r="__input-facade__";function s(e){this.masked=this.unmasked=e||""}function u(){return new CustomEvent("input",{bubbles:!0,cancelable:!0,detail:{facade:!0}})}function l(e,t){return(Array.isArray(e)||"string"===typeof e)&&(e={mask:e}),Object.assign(e||{},t)}function d(e){const t=e instanceof HTMLInputElement?e:e.querySelector("input");if(!t)throw new Error("facade directive requires an input element");return t}function c(e){const{target:t,detail:n,inputType:o}=e;if(null!==n&&void 0!==n&&n.facade)return!1;if(e.stopPropagation(),["insertCompositionText","insertFromComposition"].includes(o))return!1;const i=t.value,a=t.selectionEnd,{oldValue:s}=t[r];p(t,null,{emit:!1},e),f(e,i,a),s!==t.value&&t.dispatchEvent(u())}function f(e,t,n){const{target:o}=e,i=["text","tel","search",null].includes(o.getAttribute("type")),a=o[r]&&o[r].config;if(o!==document.activeElement||!i||!a.mask&&!a.masked)return;const s=e.inputType||"insertText",u=["insertText","insertFromPaste"].includes(s),l=u&&n==t.length;let d=u&&t[n-1];const c=o.value.toLocaleLowerCase();let f=n;if(l)f=c.length;else if(d){d=d.toLocaleLowerCase();let e=f;while(e<=c.length&&c.charAt(e-1)!==d)e++;f=e<=c.length?e:f-1}o.setSelectionRange(f,f),setTimeout((function(){o.setSelectionRange(f,f)}),0)}function p(e,t,{emit:n=!0,force:o=!1}={},i){var a,s;let{config:l,oldValue:d,isComposing:c}=e[r],f=(null===t||void 0===t||null===(a=t.data)||void 0===a||null===(s=a.model)||void 0===s?void 0:s.value)||e.value;if(!c&&(d=d||"",f=f||"",o||d!==f)){["deleteByCut","deleteContent","deleteContentBackward","deleteContentForward"].includes(null===i||void 0===i?void 0:i.inputType)&&(l={...l,short:!0});let t=y(f,l);if(i&&"function"===typeof l.formatter){const n=l.formatter(t,i);if("string"===typeof n)t=y(n,l);else if(!1===n)return void(e.value=d)}e[r].oldValue=t.masked,e.unmaskedValue=t.unmasked,e.value!==t.masked&&(e.value=t.masked),n&&e.dispatchEvent(u())}}let m=a,v=!1;try{"a".localeCompare("b","i")}catch(A){v="RangeError"===A.name}function h(e){e&&(m=e)}function k(e,t){const n=t.masks.slice().sort((e,t)=>e.length-t.length),o=e=>Object.assign({},t,e),i=(t,n)=>{const i=g(e,o({mask:n})),a=t.unmasked.length,r=i.unmasked.length;return r>a?i:t};if(!n.length)return new s;const a=n.shift();let r=g(e,o({mask:a}));while(n.length){const e=n.shift();r=i(r,e)}return r}function g(e,t){let{mask:n="",tokens:o,prefill:i=!1,short:a=!1}=t;o=o?Object.assign({},m,o):m;let r=new s,u=!1,l=0,d=0,c="";function f(e){const t=n[d+1],i=o[t];return{escape:!(null===e||void 0===e||!e.escape),optional:!(null===i||void 0===i||!i.optional),repeat:!(null===i||void 0===i||!i.repeat),...(null===i||void 0===i?void 0:i.pipe)&&{pipe:n.substring(d).match(/^(.\|)+./g)[0].split("|")}}}while(d<n.length){const t=n[d],i=o[t];let a=e[l];const s=f(i);if(!i||u||s.pipe)if(s.pipe){if(!a)break;const e=s.pipe.find(b.bind(null,a));e&&(r.unmasked+=e,r.masked+=c+e,d+=2*s.pipe.length-1,c=""),l++}else b(a,t)?(r.masked+=c+t,l++,c="",s.optional&&(r.unmasked+=t)):s.optional||(c+=t),u=!1,d+=s.optional?2:1;else{var p,v;if(s.escape){u=!0,d++;continue}if(!a)break;if(null!==(p=i.pattern)&&void 0!==p&&p.test(a))a=(null===(v=i.transform)||void 0===v?void 0:v.call(i,a))||a,r.unmasked+=a,r.masked+=c+a,c="",s.repeat||(d+=s.optional?2:1);else if(s.optional||s.repeat){d+=2;continue}l++}}return(i&&!r.unmasked||!a&&r.unmasked)&&(r.masked+=c),r}function b(e,t){return v?0===(null===e||void 0===e?void 0:e.localeCompare(t,void 0,{sensitivity:"base"})):(null===e||void 0===e?void 0:e.toLocaleLowerCase())===(null===t||void 0===t?void 0:t.toLocaleLowerCase())}function y(e,t){return e=(e||"").toString(),t=l(t),t.mask?Array.isArray(t.mask)?k(e,Object.assign({},t,{masks:t.mask})):g(e,t):new s(e)}const w=r;var V={beforeMount:(e,{value:t,modifiers:n},o)=>{e=d(e);const i=l(t,n);e[w]={config:i},p(e,o,{force:i.prefill})},mounted:e=>{e=d(e);const t=e[w],n=e.parentElement||e,o=t=>{t.target===e&&c(t,e)},i=t=>{t.target===e&&("compositionend"===t.type?(e[w].isComposing=!1,c(t,e)):e[w].isComposing=!0)};n.addEventListener("input",o,!0),n.addEventListener("compositionstart",i,!0),n.addEventListener("compositionupdate",i,!0),n.addEventListener("compositionend",i,!0),t.cleanup=()=>{n.removeEventListener("input",o,!0),n.removeEventListener("compositionstart",i,!0),n.removeEventListener("compositionend",i,!0),n.removeEventListener("compositionupdate",i,!0)}},updated:(e,{value:t,oldValue:n,modifiers:o},i)=>{e=d(e),t!==n?(e[w].config=l(t,o),p(e,i,{force:!0})):p(e,i)},unmounted:e=>{d(e)[w].cleanup()}},C=n("8bbf");const j=["value"];function L(e,t,n,o,i,a){const r=Object(C["resolveDirective"])("facade");return Object(C["withDirectives"])((Object(C["openBlock"])(),Object(C["createElementBlock"])("input",{type:"text",value:i.maskedValue,onInput:t[0]||(t[0]=(...e)=>a.onInput&&a.onInput(...e)),onChange:t[1]||(t[1]=(...e)=>a.onChange&&a.onChange(...e)),onBlur:t[2]||(t[2]=t=>e.$emit("blur")),onFocus:t[3]||(t[3]=t=>e.$emit("focus"))},null,40,j)),[[r,a.config]])}var E={name:"InputFacade",props:{formatter:Function,mask:[String,Array],masked:{type:Boolean,default:!1},prefill:{type:Boolean,default:!1},short:{type:Boolean,default:!1},tokens:Object,modelValue:[String,Number],modelModifiers:{default:()=>({})}},directives:{facade:V},data(){return{maskedValue:this.modelValue,unmaskedValue:null}},watch:{modelValue(e){e!==this.emittedValue&&(this.maskedValue=e)},mask:{deep:!0,handler(e){e||this.masked||(this.maskedValue=this.unmaskedValue)}},masked(){this.emitInput()}},computed:{config(){return{mask:this.mask,masked:this.masked,tokens:this.tokens,formatter:this.formatter,prefill:this.prefill,short:this.short}},emittedValue(){return this.mask&&this.masked?this.maskedValue:this.unmaskedValue}},methods:{onInput({target:e}){this.maskedValue=e.value,this.unmaskedValue=e.unmaskedValue,this.modelModifiers.lazy||this.emitInput()},onChange(){this.$emit("change",this.emittedValue),this.modelModifiers.lazy&&this.emitInput()},emitInput(){this.$emit("update:modelValue",this.emittedValue)}}},O=n("d959"),x=n.n(O);const _=x()(E,[["render",L]]);var S=_;function I(e,t={}){t.tokens&&h(t.tokens),e.component(S.name,S),e.directive(t.name||"facade",V),e.filter(t.name||"facade",M)}function M(e,t){return y(e,t).masked}var T=I;"undefined"!==typeof window&&window.Vue&&window.Vue.use(I);t["default"]=T}})})); |
{ | ||
"name": "vue-input-facade", | ||
"version": "3.0.0-beta.1", | ||
"version": "3.0.0-beta.2", | ||
"description": "A lightweight and dependency free input masking library created specific for Vue", | ||
@@ -5,0 +5,0 @@ "author": "Ronald Jerez <dlanor@gmail.com> (https://github.com/RonaldJerez/)", |
@@ -5,3 +5,3 @@ <div align="center" markdown="1" style="text-align:center"> | ||
A lightweight and dependency free input masking library created specific for Vue | ||
A lightweight and dependency free input masking library created specific for Vue 3.x | ||
@@ -26,7 +26,7 @@ [![Build Status](https://travis-ci.org/RonaldJerez/vue-input-facade.svg?branch=master)](https://travis-ci.org/RonaldJerez/vue-input-facade) | ||
```bash | ||
npm i vue-input-facade | ||
npm i vue-input-facade@beta | ||
``` | ||
```bash | ||
yarn add vue-input-facade | ||
yarn add vue-input-facade@beta | ||
``` | ||
@@ -42,3 +42,3 @@ | ||
import InputFacade from 'vue-input-facade' | ||
Vue.use(InputFacade) | ||
app.use(InputFacade) | ||
``` | ||
@@ -45,0 +45,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
74159