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

@progress/kendo-vue-inputs

Package Overview
Dependencies
Maintainers
1
Versions
564
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@progress/kendo-vue-inputs - npm Package Compare versions

Comparing version 0.5.0 to 0.5.1-dev.202003241010

dist/es/numerictextbox/interfaces/NumericTextBoxData.d.ts

8

dist/cdn/js/kendo-vue-inputs.js

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

!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("vue"),require("@progress/kendo-vue-intl")):"function"==typeof define&&define.amd?define(["vue","@progress/kendo-vue-intl"],e):"object"==typeof exports?exports.KendoVueInputs=e(require("vue"),require("@progress/kendo-vue-intl")):t.KendoVueInputs=e(t.Vue,t.KendoVueIntl)}(window,(function(t,e){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=2)}([function(e,n){e.exports=t},function(t,e,n){"use strict";n.r(e),n.d(e,"classNames",(function(){return i})),n.d(e,"guid",(function(){return r})),n.d(e,"Keys",(function(){return a})),n.d(e,"noop",(function(){return f})),n.d(e,"canUseDOM",(function(){return o})),n.d(e,"focusFirstFocusableChild",(function(){return s})),n.d(e,"clone",(function(){return l})),n.d(e,"cloneArray",(function(){return d})),n.d(e,"cloneValue",(function(){return p})),n.d(e,"cloneObject",(function(){return c})),n.d(e,"cloneDate",(function(){return u})),n.d(e,"VueComponent",(function(){return y})),n.d(e,"templateRendering",(function(){return g}));var i=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return t.filter((function(t){return!0!==t&&!!t})).map((function(t){return Array.isArray(t)?i.apply(void 0,t):"object"==typeof t?Object.keys(t).map((function(e,n){return t[n]||t[e]&&e||null})).filter((function(t){return null!==t})).join(" "):t})).filter((function(t){return!!t})).join(" ")},r=function(){var t,e,n="";for(t=0;t<32;t++)e=16*Math.random()|0,8!==t&&12!==t&&16!==t&&20!==t||(n+="-"),n+=(12===t?4:16===t?3&e|8:e).toString(16);return n},a={backspace:8,tab:9,enter:13,shift:16,esc:27,space:32,pageUp:33,pageDown:34,end:35,home:36,left:37,up:38,right:39,down:40,delete:46},o=Boolean("undefined"!=typeof window&&window.document&&window.document.createElement),s=function(t){if(t){var e=t.querySelectorAll('input, [tabindex]:not([tabindex="-1"])');e.length&&e[0].focus&&e[0].focus()}},u=function(t){return t?new Date(t.getTime()):null};function l(t){var e={};return c(t,e),e}function c(t,e){for(var n in t)if(t.hasOwnProperty(n)){var i=t[n];e[n]=p(i,e[n])}}function p(t,e){if(Array.isArray(t))return d(t);if(t instanceof Date)return u(t);if(t&&"object"==typeof t){var n=e||{};return c(t,n),n}return t}function d(t){return t.map((function(t){return p(t,void 0)}))}var h,f=function(){},m=n(0),v=(h=function(t,e){return(h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}h(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),y=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return v(e,t),e}(n.n(m).a);function g(t,e){if(!t)return null;var n=this.$scopedSlots[t]||(t.toLowerCase?this.$scopedSlots[t.toLowerCase()]:null);return"string"==typeof t&&n?{type:"slot",render:n,listeners:e}:"string"==typeof t||"object"==typeof t||"function"==typeof t&&t.component?{type:"component",render:t,listeners:e}:{type:"renderFunction",render:t,listeners:e}}},function(t,e,n){"use strict";function i(t){for(var n in t)e.hasOwnProperty(n)||(e[n]=t[n])}Object.defineProperty(e,"__esModule",{value:!0}),i(n(3)),i(n(4))},function(t,e,n){"use strict";var i=function(){return(i=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0});var r=n(1),a={model:{event:"changemodel"},inheritAttrs:!1,props:{defaultValue:{type:[String,Number],default:""},value:{type:[String,Number]},label:{type:String},placeholder:{type:String},required:{type:Boolean,default:!1},dir:{type:String},valid:{type:Boolean,default:void 0},validate:{type:Boolean},validationMessage:{type:String},validityStyles:{type:Boolean,default:!0}},data:function(){return{hasMounted:!1,autofill:!1,currentValue:"",valueDuringOnChange:"",input:null,inputId:r.guid(),focused:!1}},created:function(){this.$data.valueDuringOnChange=void 0,this.$data.currentValue=this.$props.defaultValue},mounted:function(){this.$data.input=this.$refs.input,this.$data.hasMounted=!0},updated:function(){this.setValidity()},render:function(t){var e=this.$props,n=e.label,a=e.id,o=e.required,s=a||this.$data.inputId,u=t("input",{domProps:i(i({},this.$attrs),{placeholder:this.$props.placeholder,id:s,required:o,value:this.computedValue}),class:i({},this.inputClassNames()),ref:"input",on:{change:this.handleChange,focus:this.emitFocus,blur:this.emitBlur,input:this.$listeners.input||this.$listeners.changemodel?this.handleInput:r.noop,animationstart:this.handleAutoFill,animationend:this.handleAutoFillEnd}});return n?t("span",{class:this.spanClassNames,on:{focusin:this.handleFocus,focusout:this.handleBlur},attrs:{dir:this.$props.dir}},[u,n?a?t("label",{attrs:{for:a},class:"k-label"},[n]):t("span",{class:"k-label"},[n]):null]):u},methods:{emitFocus:function(t){this.$emit("focus",t)},emitBlur:function(t){this.$emit("blur",t)},handleBlur:function(t){this.$data.focused=!1},handleFocus:function(t){this.$data.focused=!0},focus:function(){this.$data.input&&this.$data.input.focus()},inputClassNames:function(){var t=!this.$data.hasMounted||!this.$props.validityStyles||this.validity().valid;return{"k-textbox":!0,"k-state-invalid":!t&&void 0!==t}},validity:function(){var t={badInput:!!this.$data.input&&this.$data.input.validity.badInput,patternMismatch:!!this.$data.input&&this.$data.input.validity.patternMismatch,rangeOverflow:!!this.$data.input&&this.$data.input.validity.rangeOverflow,rangeUnderflow:!!this.$data.input&&this.$data.input.validity.rangeUnderflow,stepMismatch:!!this.$data.input&&this.$data.input.validity.stepMismatch,tooLong:!!this.$data.input&&this.$data.input.validity.tooLong,typeMismatch:!!this.$data.input&&this.$data.input.validity.typeMismatch,valueMissing:!!this.$data.input&&this.$data.input.validity.valueMissing};return i(i({},t),{customError:void 0!==this.$props.validationMessage,valid:void 0!==this.$props.valid?this.$props.valid:!this.$data.input||!this.isInvalid(t)})},isInvalid:function(t){var e=!1;for(var n in t)t.hasOwnProperty(n)&&(e=e||t[n]);return e},setValidity:function(){this.$data.input&&this.$data.input.setCustomValidity&&this.$data.input.setCustomValidity(this.validity().valid?"":this.$props.validationMessage||"")},handleInput:function(t){this.$data.currentValue=t.target.value,this.$data.valueDuringOnChange=t.target.value,this.$nextTick((function(){this.$emit("input",{event:t,value:t.target.value,component:this,target:t.target,validity:this.validity()}),this.$emit("changemodel",t.target.value),this.$data.valueDuringOnChange=void 0}))},handleChange:function(t){this.$data.currentValue=t.target.value,this.$data.valueDuringOnChange=t.target.value,this.$nextTick((function(){this.$emit("change",{event:t,value:t.target.value,component:this,target:t.target,validity:this.validity()}),this.$emit("changemodel",t.target.value),this.$data.valueDuringOnChange=void 0}))},handleAutoFill:function(t){if("autoFillStart"===t.animationName){var e=t.target.parentNode;e&&e.classList.contains("k-state-empty")&&(this.$data.autofill=!0)}},handleAutoFillEnd:function(t){"autoFillEnd"===t.animationName&&(t.target.parentNode&&(this.$data.autofill=!1))},name:function(){return this.$props.name}},computed:{spanClassNames:{get:function(){var t=!this.$data.hasMounted||!this.$props.validityStyles||this.validity().valid;return{"k-floating-label-container":!0,"k-state-focused":this.$data.focused,"k-state-empty":!(0===this.computedValue||this.computedValue||this.$props.placeholder||this.$data.autofill),"k-autofill":this.$data.autofill,"k-state-invalid":!t&&void 0!==t,"k-rtl":"rtl"===this.$props.dir}}},computedValue:{get:function(){return void 0!==this.$data.valueDuringOnChange?this.$data.valueDuringOnChange:void 0!==this.$props.value?this.$props.value:this.$data.currentValue}}}};e.Input=a},function(t,e,n){"use strict";var i,r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},a=(i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),o=function(t,e,n,i){var a,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"===("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(a=t[u])&&(s=(o<3?a(s):o>3?a(e,n,s):a(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},s=function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var u=s(n(5)),l=n(6),c=n(1),p=n(7),d=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.hasMounted=!1,e.isInvalid=!1,e.isEmpty=!1,e.currentValue=0,e.valueDuringOnChange=0,e.looselyFormattedText="",e.selectionStart=0,e.selectionEnd=0,e.decimalSelect=!1,e.focused=!1,e.textBeforeInput="",e._inputId=c.guid(),e}return a(e,t),e.prototype.created=function(){this.looselyFormattedText=null,this.valueDuringOnChange=void 0,void 0!==this.$props.value?this.currentValue=this.$props.value:void 0!==this.$props.defaultValue?this.currentValue=this.$props.defaultValue:this.currentValue=null},e.prototype.mounted=function(){this.input=this.$refs.input,this.elementWrapper=this.$refs.elementWrapper,this.hasMounted=!0,this.input&&(this.textBeforeInput=this.input.value),this.setValidity()},Object.defineProperty(e.prototype,"computedValue",{get:function(){return void 0!==this.valueDuringOnChange?this.valueDuringOnChange:this.currentValue},enumerable:!0,configurable:!0}),e.prototype.validity=function(){var t=void 0!==this.$props.validationMessage,e=!this.$props.required||null!==this.computedValue;return{customError:t,valid:void 0!==this.$props.valid?this.$props.valid:e,valueMissing:null===this.computedValue}},e.prototype.focus=function(){this.input&&this.input.focus()},e.prototype.updated=function(){if((!document||document.activeElement===this.input)&&this.input&&null!==this.looselyFormattedText)if(this.input.value!==this.looselyFormattedText)this.input.selectionStart=this.selectionStart,this.input.selectionEnd=this.selectionEnd;else{var t=void 0,e=this.looselyFormattedText.indexOf(this.symbols.decimal);t=e>=0&&e<this.selectionStart?this.selectionEnd:this.selectionEnd-(this.looselyFormattedText.length-this.input.value.length);var n=this.input.value.indexOf(this.symbols.decimal);(this.decimalSelect||null===this.currentValue&&n>=0||-1===e&&n>=0)&&(t=this.selectionStart<n+2&&e>=0?n+1:n),this.decimalSelect||(t=this.selectionEnd-(this.looselyFormattedText.length-this.input.value.length)),this.looselyFormattedText[0]===this.symbols.decimal&&(t=void 0!==this.currentValue?this.formatNumber(this.currentValue).length:0),this.input.selectionStart=this.input.selectionEnd=t}this.input&&(this.textBeforeInput=this.input.value),this.setValidity()},Object.defineProperty(e.prototype,"valueAsLocalString",{get:function(){return this.intl=l.provideIntlService(this),this.symbols=this.intl.numberSymbols(),null!==this.looselyFormattedText&&!this.decimalSelect&&this.parseNumber(this.looselyFormattedText)===this.currentValue&&this.formatNumber(this.currentValue).length<this.looselyFormattedText.length&&0===this.looselyFormattedText.indexOf(this.formatNumber(this.currentValue))?this.looselyFormattedText:this.formatNumber(this.currentValue)},enumerable:!0,configurable:!0}),e.prototype.emitFocus=function(t){this.$emit("focus",t)},e.prototype.emitBlur=function(t){this.$emit("blur",t)},e.prototype.handleFocus=function(t){this.focused=!0},e.prototype.handleBlur=function(t){this.focused=!1},Object.defineProperty(e.prototype,"spanClassNames",{get:function(){var t=!this.hasMounted||!this.$props.validityStyles||this.validity().valid;return{"k-textbox-container":!0,"k-state-focused":this.focused,"k-state-empty":!(this.computedValue||this.$props.placeholder||this.isEmpty),"k-state-invalid":!t&&void 0!==t,"k-rtl":"rtl"===this.$props.dir}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"wrapperClassNames",{get:function(){var t=!this.$props.validityStyles||this.validity().valid;return{"k-numeric-wrap":!0,"k-state-disabled":this.$props.disabled,"k-state-invalid":!t||this.isInvalid}},enumerable:!0,configurable:!0}),e.prototype.render=function(t){var e=this.$props.id||this._inputId,n=l.provideLocalizationService(this);void 0!==this.$props.value&&this.$props.value!==this.currentValue&&(this.currentValue=this.$props.value);var i=t("span",{attrs:{dir:this.$props.dir,"aria-disabled":this.$props.disabled?"true":void 0},class:"k-widget k-numerictextbox"},[t("span",{class:this.wrapperClassNames,ref:"elementWrapper"},[t("input",{attrs:{tabIndex:this.$props.tabIndex,accessKey:this.$props.accessKey,disabled:this.$props.disabled,title:this.$props.title,"aria-valuemin":this.$props.min,"aria-valuemax":this.$props.max,placeholder:this.$props.placeholder,type:this.$props.inputType||"tel",spellCheck:!1,autoComplete:"off",autoCorrect:"off",id:e,"aria-valuenow":null!==this.currentValue?this.currentValue:void 0,name:this.$props.name},class:"k-input k-formatted-value",domProps:{value:this.valueAsLocalString},on:{wheel:this.wheel,keydown:this.keyDown,input:this.elementChange,focus:this.emitFocus,blur:this.emitBlur},ref:"input"}),this.$slots.default,this.$props.spinners&&t("span",{class:"k-select",on:{mousedown:this.spinnersWrapperMouseDown}},[t("span",{class:"k-link k-link-increase",attrs:{"aria-label":n.toLanguageString(p.numericIncreaseValue,p.messages[p.numericIncreaseValue]),title:n.toLanguageString(p.numericIncreaseValue,p.messages[p.numericIncreaseValue])},on:{click:this.increase}},[t("span",{class:"k-icon k-i-arrow-n"})]),t("span",{class:"k-link k-link-decrease",attrs:{"aria-label":n.toLanguageString(p.numericDecreaseValue,p.messages[p.numericDecreaseValue]),title:n.toLanguageString(p.numericDecreaseValue,p.messages[p.numericDecreaseValue])},on:{click:this.decrease}},[t("span",{class:"k-icon k-i-arrow-s"})])])])]);return this.$props.label?t("span",{class:this.spanClassNames,on:{focusin:this.handleFocus,focusout:this.handleBlur},attrs:{dir:this.$props.dir}},[i,this.$props.label?this.$props.id?t("label",{attrs:{for:this.$props.id},class:"k-label"},[this.$props.label]):t("span",{class:"k-label"},[this.$props.label]):null]):i},e.prototype.setValidity=function(){this.input&&this.input.setCustomValidity&&this.input.setCustomValidity(this.validity().valid?"":this.$props.validationMessage||"Please enter a valid value!")},e.prototype.formatNumber=function(t){return null==t?"":this.intl.formatNumber(t,this.$props.format).toString()},e.prototype.parseNumber=function(t){return this.intl.parseNumber(t,this.$props.format)},e.prototype.elementChange=function(t){var e=this;if(this.input){var n=this.input,i={value:this.currentValue,looselyFormattedText:n.value,selectionStart:this.input.selectionStart,selectionEnd:this.input.selectionEnd,decimalSelect:!1},r=n.value,a=this.symbols.minusSign;if(r===a)return i.value=null,void this.triggerChange(i,t);if(r.split(a).length!==this.textBeforeInput.split(a).length&&r.length===this.textBeforeInput.length+a.length)return i.value=-this.parseNumber(this.textBeforeInput),void this.triggerChange(i,t);var o=this.symbols.decimal;if(r.split(RegExp("\\"+o)).length>2)return i.decimalSelect=!0,void this.triggerChange(i,t);if(r.length>1&&-1===r.indexOf(o)&&this.textBeforeInput.indexOf(o)>=0&&r.length+o.length===this.textBeforeInput.length)return i.decimalSelect=!0,void this.triggerChange(i,t);var s=this.parseNumber(r);if(s===this.currentValue&&r.length>0&&r[r.length-1]===o&&(this.formatNumber(1.1)||"").toString().indexOf(o)>-1)return i.looselyFormattedText=r,void this.triggerChange(i,t);var u=(null===s||isNaN(s))&&r.length>0&&r!==this.symbols.minusSign,l=this.elementWrapper;if(r.length>this.textBeforeInput.length&&this.parseNumber(r)===this.parseNumber(r.slice(0,n.selectionStart))&&(null===this.parseNumber(r.slice(n.selectionStart-1))||isNaN(this.parseNumber(r.slice(n.selectionStart-1))))&&(u=!0),u)return l&&-1===l.className.indexOf("k-state-invalid")&&(this.isInvalid=!0,setTimeout((function(){e.isInvalid=!1}),50)),i.looselyFormattedText=this.textBeforeInput,i.selectionStart=i.selectionEnd=n.selectionEnd+this.textBeforeInput.length-n.value.length,void this.triggerChange(i,t);i.value=s,this.triggerChange(i,t)}},e.prototype.nonInputActions=function(t,e){var n={value:t,looselyFormattedText:null,selectionStart:0,selectionEnd:0,decimalSelect:!1};this.triggerChange(n,e)},e.prototype.triggerChange=function(t,e){if(!this.$props.disabled){this.valueDuringOnChange=this.ranged(this.parseNumber(this.formatNumber(this.ranged(t.value))));var n=this.valueDuringOnChange!==this.currentValue;void 0!==this.$props.value?this.currentValue=this.$props.value:this.currentValue=this.valueDuringOnChange,this.looselyFormattedText=t.looselyFormattedText,this.selectionStart=t.selectionStart,this.selectionEnd=t.selectionEnd,this.decimalSelect=t.decimalSelect,n&&(this.$emit("change",{event:e,value:this.valueDuringOnChange,component:this,target:{name:this.$props.name,value:this.valueDuringOnChange},validity:this.validity()}),this.$emit("changemodel",this.valueDuringOnChange)),this.valueDuringOnChange=void 0}},e.prototype.ranged=function(t){return null==t?t:t>1||t<1||1===t?void 0!==this.$props.max&&void 0!==this.$props.min&&this.$props.max<this.$props.min?null:(void 0!==this.$props.max&&t>this.$props.max&&(t=this.$props.max),void 0!==this.$props.min&&t<this.$props.min&&(t=this.$props.min),t):null},e.prototype.increase=function(t){this.nonInputActions((this.currentValue||0)+(this.$props.step||0),t)},e.prototype.decrease=function(t){this.nonInputActions((this.currentValue||0)-(this.$props.step||0),t)},e.prototype.wheel=function(t){document&&document.activeElement===this.input&&this.input&&(t.deltaY<0&&(t.preventDefault(),this.increase(t)),t.deltaY>0&&(t.preventDefault(),this.decrease(t)))},e.prototype.keyDown=function(t){switch(t.keyCode){case 38:this.increase(t);break;case 40:this.decrease(t);break;case 110:var e=this.input;if(e){var n=e.value,i=e.selectionStart,r=e.selectionEnd;e.value=n.slice(0,i)+this.symbols.decimal+n.slice(r),e.selectionStart=e.selectionEnd=i+1,this.elementChange(t)}break;default:return}t.preventDefault()},e.prototype.spinnersWrapperMouseDown=function(t){document&&this.input&&(t.preventDefault(),document.activeElement!==this.input&&this.input.focus())},e=o([u.default({model:{event:"changemodel"},inheritAttrs:!1,props:{value:Number,defaultValue:Number,step:{type:Number,default:1},format:[String,Object],tabIndex:Number,accessKey:String,title:String,placeholder:String,min:Number,max:Number,spinners:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},dir:String,name:String,label:String,validationMessage:String,validityStyles:{type:Boolean,default:!0},valid:{type:Boolean,default:void 0},required:{type:Boolean,default:!1},id:String},inject:{kendoIntlService:{default:null},kendoLocalizationService:{default:null}}})],e)}(c.VueComponent);e.NumericTextBox=d},function(t,e,n){"use strict";n.r(e),n.d(e,"createDecorator",(function(){return d})),n.d(e,"mixins",(function(){return h}));var i=n(0),r=n.n(i);
/**
* vue-class-component v7.2.3
* (c) 2015-present Evan You
* @license MIT
*/
function a(t){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function s(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e<t.length;e++)n[e]=t[e];return n}}(t)||function(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function u(){return"undefined"!=typeof Reflect&&Reflect.defineMetadata&&Reflect.getOwnMetadataKeys}function l(t,e){c(t,e),Object.getOwnPropertyNames(e.prototype).forEach((function(n){c(t.prototype,e.prototype,n)})),Object.getOwnPropertyNames(e).forEach((function(n){c(t,e,n)}))}function c(t,e,n){(n?Reflect.getOwnMetadataKeys(e,n):Reflect.getOwnMetadataKeys(e)).forEach((function(i){var r=n?Reflect.getOwnMetadata(i,e,n):Reflect.getOwnMetadata(i,e);n?Reflect.defineMetadata(i,r,t,n):Reflect.defineMetadata(i,r,t)}))}var p={__proto__:[]}instanceof Array;function d(t){return function(e,n,i){var r="function"==typeof e?e:e.constructor;r.__decorators__||(r.__decorators__=[]),"number"!=typeof i&&(i=void 0),r.__decorators__.push((function(e){return t(e,n,i)}))}}function h(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return r.a.extend({mixins:e})}function f(t,e){var n=e.prototype._init;e.prototype._init=function(){var e=this,n=Object.getOwnPropertyNames(t);if(t.$options.props)for(var i in t.$options.props)t.hasOwnProperty(i)||n.push(i);n.forEach((function(n){"_"!==n.charAt(0)&&Object.defineProperty(e,n,{get:function(){return t[n]},set:function(e){t[n]=e},configurable:!0})}))};var i=new e;e.prototype._init=n;var r={};return Object.keys(i).forEach((function(t){void 0!==i[t]&&(r[t]=i[t])})),r}var m=["data","beforeCreate","created","beforeMount","mounted","beforeDestroy","destroyed","beforeUpdate","updated","activated","deactivated","render","errorCaptured","serverPrefetch"];function v(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e.name=e.name||t._componentTag||t.name;var n=t.prototype;Object.getOwnPropertyNames(n).forEach((function(t){if("constructor"!==t)if(m.indexOf(t)>-1)e[t]=n[t];else{var i=Object.getOwnPropertyDescriptor(n,t);void 0!==i.value?"function"==typeof i.value?(e.methods||(e.methods={}))[t]=i.value:(e.mixins||(e.mixins=[])).push({data:function(){return o({},t,i.value)}}):(i.get||i.set)&&((e.computed||(e.computed={}))[t]={get:i.get,set:i.set})}})),(e.mixins||(e.mixins=[])).push({data:function(){return f(this,t)}});var i=t.__decorators__;i&&(i.forEach((function(t){return t(e)})),delete t.__decorators__);var a=Object.getPrototypeOf(t.prototype),s=a instanceof r.a?a.constructor:r.a,c=s.extend(e);return g(c,t,s),u()&&l(c,t),c}var y={prototype:!0,arguments:!0,callee:!0,caller:!0};function g(t,e,n){Object.getOwnPropertyNames(e).forEach((function(i){if(!y[i]){var r=Object.getOwnPropertyDescriptor(t,i);if(!r||r.configurable){var o,s,u=Object.getOwnPropertyDescriptor(e,i);if(!p){if("cid"===i)return;var l=Object.getOwnPropertyDescriptor(n,i);if(o=u.value,s=a(o),null!=o&&("object"===s||"function"===s)&&l&&l.value===u.value)return}0,Object.defineProperty(t,i,u)}}}))}function b(t){return"function"==typeof t?v(t):function(e){return v(e,t)}}b.registerHooks=function(t){m.push.apply(m,s(t))},e.default=b},function(t,n){t.exports=e},function(t,e,n){"use strict";var i;Object.defineProperty(e,"__esModule",{value:!0}),e.numericIncreaseValue="numerictextbox.increment",e.numericDecreaseValue="numerictextbox.decrement",e.sliderIncreaseValue="slider.increment",e.sliderDecreaseValue="slider.decrement",e.sliderDragTitle="slider.dragTitle",e.colorGradientR="colorGradient.r",e.colorGradientG="colorGradient.g",e.colorGradientB="colorGradient.b",e.colorGradientA="colorGradient.a",e.colorGradientHex="colorGradient.hex",e.messages=((i={})[e.numericIncreaseValue]="Increase value",i[e.numericDecreaseValue]="Decrease value",i[e.sliderIncreaseValue]="Increase",i[e.sliderDecreaseValue]="Decrease",i[e.sliderDragTitle]="Drag",i[e.colorGradientR]="r",i[e.colorGradientG]="g",i[e.colorGradientB]="b",i[e.colorGradientA]="a",i[e.colorGradientHex]="hex",i)}])}));
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("vue"),require("@progress/kendo-vue-intl")):"function"==typeof define&&define.amd?define(["vue","@progress/kendo-vue-intl"],t):"object"==typeof exports?exports.KendoVueInputs=t(require("vue"),require("@progress/kendo-vue-intl")):e.KendoVueInputs=t(e.Vue,e.KendoVueIntl)}(window,(function(e,t){return function(e){var t={};function n(i){if(t[i])return t[i].exports;var a=t[i]={i:i,l:!1,exports:{}};return e[i].call(a.exports,a,a.exports,n),a.l=!0,a.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 a in e)n.d(i,a,function(t){return e[t]}.bind(null,a));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=2)}([function(e,t,n){"use strict";n.r(t),n.d(t,"classNames",(function(){return i})),n.d(t,"guid",(function(){return a})),n.d(t,"Keys",(function(){return r})),n.d(t,"noop",(function(){return f})),n.d(t,"canUseDOM",(function(){return s})),n.d(t,"focusFirstFocusableChild",(function(){return u})),n.d(t,"clone",(function(){return l})),n.d(t,"cloneArray",(function(){return p})),n.d(t,"cloneValue",(function(){return d})),n.d(t,"cloneObject",(function(){return c})),n.d(t,"cloneDate",(function(){return o})),n.d(t,"VueComponent",(function(){return g})),n.d(t,"templateRendering",(function(){return $}));var i=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.filter((function(e){return!0!==e&&!!e})).map((function(e){return Array.isArray(e)?i.apply(void 0,e):"object"==typeof e?Object.keys(e).map((function(t,n){return e[n]||e[t]&&t||null})).filter((function(e){return null!==e})).join(" "):e})).filter((function(e){return!!e})).join(" ")},a=function(){var e,t,n="";for(e=0;e<32;e++)t=16*Math.random()|0,8!==e&&12!==e&&16!==e&&20!==e||(n+="-"),n+=(12===e?4:16===e?3&t|8:t).toString(16);return n},r={backspace:8,tab:9,enter:13,shift:16,esc:27,space:32,pageUp:33,pageDown:34,end:35,home:36,left:37,up:38,right:39,down:40,delete:46},s=Boolean("undefined"!=typeof window&&window.document&&window.document.createElement),u=function(e){if(e){var t=e.querySelectorAll('input, [tabindex]:not([tabindex="-1"])');t.length&&t[0].focus&&t[0].focus()}},o=function(e){return e?new Date(e.getTime()):null};function l(e){var t={};return c(e,t),t}function c(e,t){for(var n in e)if(e.hasOwnProperty(n)){var i=e[n];t[n]=d(i,t[n])}}function d(e,t){if(Array.isArray(e))return p(e);if(e instanceof Date)return o(e);if(e&&"object"==typeof e){var n=t||{};return c(e,n),n}return e}function p(e){return e.map((function(e){return d(e,void 0)}))}var h,f=function(){},v=n(1),m=(h=function(e,t){return(h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}h(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),g=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return m(t,e),t}(n.n(v).a);function $(e,t){if(!e)return null;var n=this.$scopedSlots[e]||(e.toLowerCase?this.$scopedSlots[e.toLowerCase()]:null);return"string"==typeof e&&n?{type:"slot",render:n,listeners:t}:"string"==typeof e||"object"==typeof e||"function"==typeof e&&e.component?{type:"component",render:e,listeners:t}:{type:"renderFunction",render:e,listeners:t}}},function(t,n){t.exports=e},function(e,t,n){"use strict";function i(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}Object.defineProperty(t,"__esModule",{value:!0}),i(n(3)),i(n(4))},function(e,t,n){"use strict";var i=function(){return(i=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var a in t=arguments[n])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e}).apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0});var a=n(0),r={model:{event:"changemodel"},inheritAttrs:!1,props:{defaultValue:{type:[String,Number],default:""},value:{type:[String,Number]},label:{type:String},placeholder:{type:String},required:{type:Boolean,default:!1},dir:{type:String},valid:{type:Boolean,default:void 0},validate:{type:Boolean},validationMessage:{type:String},validityStyles:{type:Boolean,default:!0}},data:function(){return{hasMounted:!1,autofill:!1,currentValue:"",valueDuringOnChange:"",input:null,inputId:a.guid(),focused:!1}},created:function(){this.$data.valueDuringOnChange=void 0,this.$data.currentValue=this.$props.defaultValue},mounted:function(){this.$data.input=this.$refs.input,this.$data.hasMounted=!0},updated:function(){this.setValidity()},render:function(e){var t=this.$props,n=t.label,r=t.id,s=t.required,u=r||this.$data.inputId,o=e("input",{domProps:i(i({},this.$attrs),{placeholder:this.$props.placeholder,id:u,required:s,value:this.computedValue}),class:i({},this.inputClassNames()),ref:"input",on:{change:this.handleChange,focus:this.emitFocus,blur:this.emitBlur,input:this.$listeners.input||this.$listeners.changemodel?this.handleInput:a.noop,animationstart:this.handleAutoFill,animationend:this.handleAutoFillEnd}});return n?e("span",{class:this.spanClassNames,on:{focusin:this.handleFocus,focusout:this.handleBlur},attrs:{dir:this.$props.dir}},[o,n?r?e("label",{attrs:{for:r},class:"k-label"},[n]):e("span",{class:"k-label"},[n]):null]):o},methods:{emitFocus:function(e){this.$emit("focus",e)},emitBlur:function(e){this.$emit("blur",e)},handleBlur:function(e){this.$data.focused=!1},handleFocus:function(e){this.$data.focused=!0},focus:function(){this.$data.input&&this.$data.input.focus()},inputClassNames:function(){var e=!this.$data.hasMounted||!this.$props.validityStyles||this.validity().valid;return{"k-textbox":!0,"k-state-invalid":!e&&void 0!==e}},validity:function(){var e={badInput:!!this.$data.input&&this.$data.input.validity.badInput,patternMismatch:!!this.$data.input&&this.$data.input.validity.patternMismatch,rangeOverflow:!!this.$data.input&&this.$data.input.validity.rangeOverflow,rangeUnderflow:!!this.$data.input&&this.$data.input.validity.rangeUnderflow,stepMismatch:!!this.$data.input&&this.$data.input.validity.stepMismatch,tooLong:!!this.$data.input&&this.$data.input.validity.tooLong,typeMismatch:!!this.$data.input&&this.$data.input.validity.typeMismatch,valueMissing:!!this.$data.input&&this.$data.input.validity.valueMissing};return i(i({},e),{customError:void 0!==this.$props.validationMessage,valid:void 0!==this.$props.valid?this.$props.valid:!this.$data.input||!this.isInvalid(e)})},isInvalid:function(e){var t=!1;for(var n in e)e.hasOwnProperty(n)&&(t=t||e[n]);return t},setValidity:function(){this.$data.input&&this.$data.input.setCustomValidity&&this.$data.input.setCustomValidity(this.validity().valid?"":this.$props.validationMessage||"")},handleInput:function(e){this.$data.currentValue=e.target.value,this.$data.valueDuringOnChange=e.target.value,this.$nextTick((function(){this.$emit("input",{event:e,value:e.target.value,component:this,target:e.target,validity:this.validity()}),this.$emit("changemodel",e.target.value),this.$data.valueDuringOnChange=void 0}))},handleChange:function(e){this.$data.currentValue=e.target.value,this.$data.valueDuringOnChange=e.target.value,this.$nextTick((function(){this.$emit("change",{event:e,value:e.target.value,component:this,target:e.target,validity:this.validity()}),this.$emit("changemodel",e.target.value),this.$data.valueDuringOnChange=void 0}))},handleAutoFill:function(e){if("autoFillStart"===e.animationName){var t=e.target.parentNode;t&&t.classList.contains("k-state-empty")&&(this.$data.autofill=!0)}},handleAutoFillEnd:function(e){"autoFillEnd"===e.animationName&&(e.target.parentNode&&(this.$data.autofill=!1))},name:function(){return this.$props.name}},computed:{spanClassNames:{get:function(){var e=!this.$data.hasMounted||!this.$props.validityStyles||this.validity().valid;return{"k-floating-label-container":!0,"k-state-focused":this.$data.focused,"k-state-empty":!(0===this.computedValue||this.computedValue||this.$props.placeholder||this.$data.autofill),"k-autofill":this.$data.autofill,"k-state-invalid":!e&&void 0!==e,"k-rtl":"rtl"===this.$props.dir}}},computedValue:{get:function(){return void 0!==this.$data.valueDuringOnChange?this.$data.valueDuringOnChange:void 0!==this.$props.value?this.$props.value:this.$data.currentValue}}}};t.Input=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(5),a=n(0),r=n(6),s=n(7),u={model:{event:"changemodel"},inheritAttrs:!1,props:{value:Number,defaultValue:Number,step:{type:Number,default:1},format:[String,Object],tabIndex:Number,accessKey:String,title:String,placeholder:String,min:Number,max:Number,spinners:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},dir:String,name:String,label:String,validationMessage:String,validityStyles:{type:Boolean,default:!0},valid:{type:Boolean,default:void 0},required:{type:Boolean,default:!1},id:String},inject:{kendoIntlService:{default:null},kendoLocalizationService:{default:null}},data:function(){return{hasMounted:!1,isInvalid:!1,isEmpty:!1,currentValue:0,valueDuringOnChange:0,currentLooseValue:"",selectionStart:0,selectionEnd:0,decimalSelect:!1,focused:!1,forceUpdate:!1}},created:function(){this._textBeforeInput="",this._inputId=a.guid(),this.$data.currentLooseValue=null,this.$data.valueDuringOnChange=void 0,this._intl=i.provideIntlService(this),this._symbols=this._intl.numberSymbols(),void 0!==this.$props.value?this.$data.currentValue=this.$props.value:void 0!==this.$props.defaultValue?this.$data.currentValue=this.$props.defaultValue:this.$data.currentValue=null},mounted:function(){this._input=this.$refs.input,this._elementWrapper=this.$refs.elementWrapper,this.$data.hasMounted=!0,this._input&&(this._textBeforeInput=this._input.value),this.setValidity()},updated:function(){document&&document.activeElement!==this._input||!this._input||null===this.$data.currentLooseValue||this.$data.forceUpdate&&(this._input.selectionStart=this.$data.selectionStart,this._input.selectionEnd=this.$data.selectionEnd,this.$data.forceUpdate=!1),this._input&&(this._textBeforeInput=this._input.value),this.setValidity()},computed:{computedValue:{get:function(){return void 0!==this.$data.valueDuringOnChange?this.$data.valueDuringOnChange:this.$data.currentValue}},looseValue:{get:function(){return s.formatValue(this.$data.focused?this.$data.currentLooseValue:s.getStateOrPropsValue(this.$props.value,this.$data.currentValue),this.$props.format,this._intl)}},spanClassNames:{get:function(){var e=!this.$data.hasMounted||!this.$props.validityStyles||this.validity().valid;return{"k-textbox-container":!0,"k-state-focused":this.$data.focused,"k-state-empty":!(this.computedValue||this.$props.placeholder||this.$data.isEmpty),"k-state-invalid":!e&&void 0!==e,"k-rtl":"rtl"===this.$props.dir}}},wrapperClassNames:{get:function(){var e=!this.$props.validityStyles||this.validity().valid;return{"k-numeric-wrap":!0,"k-state-disabled":this.$props.disabled,"k-state-invalid":!e||this.$data.isInvalid}}}},methods:{validity:function(){var e=void 0!==this.$props.validationMessage,t=!this.$props.required||null!==this.computedValue;return{customError:e,valid:void 0!==this.$props.valid?this.$props.valid:t,valueMissing:null===this.computedValue}},focus:function(){this._input&&this._input.focus()},emitFocus:function(e){this.$data.currentLooseValue=this._prevLooseValue,this.$data.focused=!0,this.$emit("focus",e),this.$data.forceUpdate=!0},emitBlur:function(e){this.$data.eventValue=null,this.$data.prevLooseValue="",this.$data.currentLooseValue="",this.$data.focused=!1,this.$data.selectionStart=void 0,this.$data.selectionEnd=void 0,this.$data.decimalSelect=!1,this.$data.valueIsCorrected=!1,this.$data.valueIsOutOfRange=!1,this.$emit("blur",e),this.$data.forceUpdate=!0},handleFocus:function(e){this.$data.focused=!0},handleBlur:function(e){this.$data.focused=!1},setValidity:function(){this._input&&this._input.setCustomValidity&&this._input.setCustomValidity(this.validity().valid?"":this.$props.validationMessage||"Please enter a valid value!")},getCurrentState:function(){return{eventValue:s.getStateOrPropsValue(this.$props.value,this.$data.currentValue),prevLooseValue:this._prevLooseValue,currentLooseValue:this._input.value,selectionStart:this._input.selectionStart,selectionEnd:this._input.selectionEnd,decimalSelect:!1,valueIsCorrected:!1,valueIsOutOfRange:!1,isPaste:this._isPaste,focused:this.$data.focused}},parseNumber:function(e){return this._intl.parseNumber(e,this.$props.format)},elementChange:function(e){var t=this.getCurrentState();this._isPaste=!1,this.triggerChange(e,s.sanitizeNumber(t,this.$props.format,this._intl))},triggerChange:function(e,t){var n=this;if(!this.$props.disabled){this.$data.valueDuringOnChange=t.eventValue,this.$data.currentValue=t.eventValue;var i=s.formatValue(s.rangeValue(t.eventValue,this.$props.min,this.$props.max),this.$props.format,this._intl),a=s.rangeValue(this.parseNumber(i),this.$props.min,this.$props.max);if(a!==t.eventValue&&(t.valueIsOutOfRange=!0,t.eventValue=a),t.valueIsCorrected){var r=this._elementWrapper;r&&-1===r.className.indexOf("k-state-invalid")&&(this.$data.isInvalid=!0,setTimeout((function(){n.$data.isInvalid=!1}),50))}var u=this.$props.value!==t.eventValue;void 0!==this.$props.value?this.$data.currentValue=this.$props.value:this.$data.currentValue=this.$data.valueDuringOnChange,this.$data.prevLooseValue=t.prevLooseValue,this.$data.currentLooseValue=t.currentLooseValue,this.$data.selectionStart=t.selectionStart,this.$data.selectionEnd=t.selectionEnd,this.$data.decimalSelect=t.decimalSelect,this.$data.valueIsCorrected=t.valueIsCorrected,this.$data.valueIsOutOfRange=t.valueIsOutOfRange,this.$data.focused=t.focused,this.$data.isPaste=t.isPaste,this.$data.forceUpdate=!this.$data.forceUpdate,u&&(this.$emit("change",{event:e,value:this.$data.valueDuringOnChange,component:this,target:{name:this.$props.name,value:this.$data.valueDuringOnChange},validity:this.validity()}),this.$emit("changemodel",this.$data.valueDuringOnChange)),this.$data.valueDuringOnChange=void 0}},onPasteHandler:function(e){this._isPaste=!0},increase:function(e){var t=this.getCurrentState();s.increaseValue(this.parseNumber(String(t.currentLooseValue)),t,this.$props.step,this.$props.min,this.$props.max,this.$props.format,this._intl),this.triggerChange(e,t)},decrease:function(e){var t=this.getCurrentState();s.decreaseValue(this.parseNumber(String(t.currentLooseValue)),t,this.$props.step,this.$props.min,this.$props.max,this.$props.format,this._intl),this.triggerChange(e,t)},wheel:function(e){document&&document.activeElement===this._input&&this._input&&(e.deltaY<0&&(e.preventDefault(),this.increase(e)),e.deltaY>0&&(e.preventDefault(),this.decrease(e)))},keyDown:function(e){var t=this.getCurrentState(),n=this.parseNumber(String(t.currentLooseValue));if(!(t.selectionEnd>t.selectionStart&&t.selectionEnd-t.selectionStart===String(t.currentLooseValue).length)){switch(e.keyCode){case 38:s.increaseValue(n,t,this.$props.step,this.$props.min,this.$props.max,this.$props.format,this._intl);break;case 40:s.decreaseValue(n,t,this.$props.step,this.$props.min,this.$props.max,this.$props.format,this._intl);break;case 13:var i=s.formatValue(s.rangeValue(n,this.$props.min,this.$props.max),this.$props.format,this._intl),a=s.rangeValue(this.parseNumber(i),this.$props.min,this.$props.max);t.eventValue=a,t.currentLooseValue=s.formatValue(a,this.$props.format,this._intl),t.selectionStart=t.selectionEnd=t.currentLooseValue.length;break;case 110:var r=this._input,u=this._intl.numberSymbols();r&&(t.currentLooseValue=t.currentLooseValue.slice(0,t.selectionStart)+u.decimal+t.currentLooseValue.slice(t.selectionEnd),t.selectionStart=t.selectionEnd=t.selectionStart+1,t=s.sanitizeNumber(t,this.$props.format,this._intl));break;default:return}e.preventDefault(),this.triggerChange(e,t)}},spinnersWrapperMouseDown:function(e){document&&this._input&&(e.preventDefault(),document.activeElement!==this._input&&this._input.focus())}},render:function(e){var t=this.$props.id||this._inputId,n=i.provideLocalizationService(this);void 0!==this.$props.value&&this.$props.value!==this.$data.currentValue&&(this.$data.currentValue=this.$props.value),this._prevLooseValue=this.looseValue;var a=e("span",{attrs:{dir:this.$props.dir,"aria-disabled":this.$props.disabled?"true":void 0},class:"k-widget k-numerictextbox"},[e("span",{class:this.wrapperClassNames,ref:"elementWrapper"},[e("input",{attrs:{tabIndex:this.$props.tabIndex,accessKey:this.$props.accessKey,disabled:this.$props.disabled,title:this.$props.title,"aria-valuemin":this.$props.min,"aria-valuemax":this.$props.max,placeholder:this.$props.placeholder,type:this.$props.inputType||"tel",spellCheck:!1,autoComplete:"off",autoCorrect:"off",id:t,"aria-valuenow":null!==this.$data.currentValue?this.$data.currentValue:void 0,name:this.$props.name},class:"k-input k-formatted-value",domProps:{value:this.looseValue},on:{wheel:this.wheel,keydown:this.keyDown,input:this.elementChange,focus:this.emitFocus,blur:this.emitBlur,paste:this.onPasteHandler},ref:"input"}),this.$slots.default,this.$props.spinners&&e("span",{class:"k-select",on:{mousedown:this.spinnersWrapperMouseDown}},[e("span",{class:"k-link k-link-increase",attrs:{"aria-label":n.toLanguageString(r.numericIncreaseValue,r.messages[r.numericIncreaseValue]),title:n.toLanguageString(r.numericIncreaseValue,r.messages[r.numericIncreaseValue])},on:{click:this.increase}},[e("span",{class:"k-icon k-i-arrow-n"})]),e("span",{class:"k-link k-link-decrease",attrs:{"aria-label":n.toLanguageString(r.numericDecreaseValue,r.messages[r.numericDecreaseValue]),title:n.toLanguageString(r.numericDecreaseValue,r.messages[r.numericDecreaseValue])},on:{click:this.decrease}},[e("span",{class:"k-icon k-i-arrow-s"})])])])]);return this.$props.label?e("span",{class:this.spanClassNames,on:{focusin:this.handleFocus,focusout:this.handleBlur},attrs:{dir:this.$props.dir}},[a,this.$props.label?this.$props.id?e("label",{attrs:{for:this.$props.id},class:"k-label"},[this.$props.label]):e("span",{class:"k-label"},[this.$props.label]):null]):a}};t.NumericTextBox=u},function(e,n){e.exports=t},function(e,t,n){"use strict";var i;Object.defineProperty(t,"__esModule",{value:!0}),t.numericIncreaseValue="numerictextbox.increment",t.numericDecreaseValue="numerictextbox.decrement",t.sliderIncreaseValue="slider.increment",t.sliderDecreaseValue="slider.decrement",t.sliderDragTitle="slider.dragTitle",t.colorGradientR="colorGradient.r",t.colorGradientG="colorGradient.g",t.colorGradientB="colorGradient.b",t.colorGradientA="colorGradient.a",t.colorGradientHex="colorGradient.hex",t.messages=((i={})[t.numericIncreaseValue]="Increase value",i[t.numericDecreaseValue]="Decrease value",i[t.sliderIncreaseValue]="Increase",i[t.sliderDecreaseValue]="Decrease",i[t.sliderDragTitle]="Drag",i[t.colorGradientR]="r",i[t.colorGradientG]="g",i[t.colorGradientB]="b",i[t.colorGradientA]="a",i[t.colorGradientHex]="hex",i)},function(e,t,n){"use strict";var i=function(){return(i=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var a in t=arguments[n])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e}).apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0});var a=/\d/;t.getInitialState=function(){return{eventValue:null,prevLooseValue:"",currentLooseValue:"",focused:!1,selectionStart:void 0,selectionEnd:void 0,decimalSelect:!1,valueIsCorrected:!1,valueIsOutOfRange:!1}},t.getStateOrPropsValue=function(e,t){return void 0!==e?e:t},t.formatValue=function(e,t,n){return null===e&&void 0===e?"":"string"==typeof e?e:n.formatNumber(e,t)},t.increaseValue=function(e,n,i,r,s,u,o){var l=t.rangeValue((e||0)+(i||0),r,s);n.eventValue=l,n.currentLooseValue=t.formatValue(l,u,o),n.selectionStart=n.selectionEnd=t.getLastNumberIndex(n.currentLooseValue,a)},t.decreaseValue=function(e,n,i,r,s,u,o){var l=t.rangeValue((e||0)-(i||0),r,s);n.eventValue=l,n.currentLooseValue=t.formatValue(l,u,o),n.selectionStart=n.selectionEnd=t.getLastNumberIndex(n.currentLooseValue,a)},t.rangeValue=function(e,t,n){return null==e?e:e>1||e<1||1===e?void 0!==n&&void 0!==t&&n<t?null:(void 0!==n&&e>n&&(e=n),void 0!==t&&e<t&&(e=t),e):null},t.getMaxCursorPosition=function(e,t){var n=t.findIndex((function(t){t[0];var n=t[1];return Boolean(n)&&e.indexOf(n)===e.length-n.length}));if(-1===n)return-1;var i=t[n][1];return e.length-i.length},t.getMinCursorPosition=function(e,t){var n=t.findIndex((function(t){var n=t[0];t[1];return Boolean(n)&&0===e.indexOf(n)}));return-1===n?-1:t[n][0].length},t.rangeSelection=function(e,n,i){var a=t.getMaxCursorPosition(e,n);if(-1!==a&&i.selectionStart>a)i.selectionStart=i.selectionEnd=a;else{i.selectionStart>e.length&&(i.selectionStart=i.selectionEnd=e.length);var r=t.getMinCursorPosition(e,n);-1!==r&&i.selectionStart<r&&(i.selectionStart=i.selectionEnd=r),-1===i.selectionStart&&(i.selectionStart=i.selectionEnd=0)}},t.setSelection=function(e,n,i,a){e.selectionStart=e.selectionEnd=n,t.rangeSelection(i,a,e)},t.setInvalid=function(e,n,i,a){e.eventValue=a.parseNumber(e.prevLooseValue,n),e.currentLooseValue=e.prevLooseValue,e.valueIsCorrected=!0,t.setSelection(e,e.selectionStart,e.currentLooseValue,i)},t.isMinusSymbolAdded=function(e,t){var n=String(e.currentLooseValue),i=String(e.prevLooseValue);return n.split(t.minusSign).length!==i.split(t.minusSign).length&&n.length===i.length+t.minusSign.length},t.isDecimalDuplicated=function(e,t){return String(e.currentLooseValue).split(t.decimal).length>2},t.getFormatPrefixSufix=function(e,n){var i=n.formatNumber(1111111.1111111,e),a=n.formatNumber(-1111111.1111111,e),r=n.formatNumber(0,e),s=n.formatNumber(1,e),u=t.getPrefix(i),o=t.getPrefix(a),l=t.getPrefix(r),c=t.getPrefix(s);return{positiveInfo:[u,t.getSuffix(i)],negativeInfo:[o,t.getSuffix(a)],zeroInfo:[l,t.getSuffix(r)],oneInfo:[c,t.getSuffix(s)]}},t.getFormatSymbols=function(e,t){var n=t.formatNumber(1111111.1111111,e),i=t.formatNumber(-1111111.1111111,e),a=t.formatNumber(0,e),r=t.formatNumber(1,e),s=t.numberSymbols(),u=new RegExp("[\\d\\"+s.decimal+s.group+"]","g");return[n,i,a,r].map((function(e){return e.replace(u,"")})).join("").split("").filter((function(e,t,n){return n.indexOf(e)===t})).join("")},t.getInitialPosition=function(e,n){var i=e.indexOf(n.decimal);return i>-1?i:t.getLastNumberIndex(e,a)},t.reverseString=function(e){return e.split("").reverse().join("")},t.getLastNumberIndex=function(e,n){return e.length-t.reverseString(e).search(n)},t.getPrefix=function(e){return e.split(e[e.search(a)])[0]},t.getSuffix=function(e){var n=t.reverseString(e);return t.reverseString(n.split(n[n.search(a)])[0])},t.getFirstNumberIndex=function(e,t){return e.search(t)},t.getDecimalCount=function(e,t){var n=e.indexOf(t);return n>-1?e.length-n-1:0},t.changeBasedSelection=function(e,t,n,i,r){var s="0"===e.replace(r,"")[0],u="0"===t.replace(r,"")[0];if(s&&!u)return n-1;if(u&&i)return n+1;for(var o=0,l=0;l<n;l++)a.test(e.charAt(l))&&o++;for(var c=0;o>0&&t.length>c;)a.test(t.charAt(c))&&o--,c++;return c},t.sanitizeNumber=function(e,n,r){var s=i({},e),u=s.prevLooseValue,o=r.numberSymbols(),l=t.getFormatSymbols(n,r),c=String(s.currentLooseValue),d=String(u),p=new RegExp("[^\\d\\"+o.decimal+"]","g"),h=new RegExp("[^\\d\\"+o.decimal+"\\"+o.group+"]","g"),f=new RegExp("[\\d\\"+o.decimal+"\\"+o.group+"]"),v=c.replace(p,""),m=t.getFirstNumberIndex(c,a),g=-1===m?-1:t.getLastNumberIndex(c,a),$=c.indexOf(o.decimal),V=(c.substring(0,m)+c.substring(m,g).replace(h,"")+c.substring(g,c.length)).split("").filter((function(e){return-1!==l.indexOf(e)||-1!==e.search(f)})).join(""),b=r.formatNumber(.31111111111111117,n).replace(p,""),y=b.indexOf(o.decimal),S=y>-1?b.length-y-1:0,x=r.formatNumber(1,n).replace(p,""),L=x.indexOf(o.decimal),I=L>-1?x.length-L-1:0,O=t.getFormatPrefixSufix(n,r),_=[O.positiveInfo,O.negativeInfo,O.zeroInfo,O.oneInfo],N=1!==_.findIndex((function(e){return-1!==e.findIndex((function(e){return Boolean(e)}))})),C=c.length>0&&c.length<d.length;if(!s.isPaste){if(""===c)return s.eventValue=null,s.currentLooseValue="",s;if(s.currentLooseValue===o.minusSign&&r.formatNumber(-0,n)!==d)return s.eventValue=-0,s.currentLooseValue=t.formatValue(s.eventValue,n,r),t.setSelection(s,t.getInitialPosition(s.currentLooseValue,o),s.currentLooseValue,_),s;if(t.isMinusSymbolAdded(s,o)){var k=r.parseNumber(u,n);s.eventValue=-(null!==k?k:0),s.currentLooseValue=t.formatValue(s.eventValue,n,r);var D=t.getFirstNumberIndex(s.currentLooseValue,a),P=t.getFirstNumberIndex(d,a);return t.setSelection(s,s.selectionEnd-1+(D-P),s.currentLooseValue,_),s}if(s.currentLooseValue===o.decimal){s.eventValue=0;var w=t.formatValue(s.eventValue,n,r);if(0===I&&S>0){var M=t.getLastNumberIndex(w,a);s.currentLooseValue=w.substring(0,M)+o.decimal+w.substring(M)}else s.currentLooseValue=w;return t.setSelection(s,t.getInitialPosition(s.currentLooseValue,o)+1,s.currentLooseValue,_),s}if(t.isDecimalDuplicated(s,o))return t.setInvalid(s,n,_,r),s;if("p"===n&&c&&-1===c.indexOf(o.percentSign))return s.eventValue=r.parseNumber(c,n)/100,s.currentLooseValue=t.formatValue(s.eventValue,n,r),s;if(String(s.currentLooseValue).replace(/[^\d]/g,"").length>15)return t.setInvalid(s,n,_,r),s;if(v!==c&&c&&N)if(-1===_.findIndex((function(e){var t=e[0],n=e[1],i=c.indexOf(t),a=c.indexOf(n),r=0===i,s=a===c.length-n.length,u=i+t.length!==m&&-1!==m&&c[i+t.length]!==o.decimal,l=a!==g&&-1!==g&&c[a-1]!==o.decimal;return t&&n?!u&&!l&&(r&&s):t?!u&&r:!!n&&(!l&&s)})))return t.setInvalid(s,n,_,r),s;if(v[v.length-1]===o.decimal&&S>0)return s.eventValue=r.parseNumber(c,n),s.currentLooseValue=V,s;if(s.currentLooseValue&&u)if((l+o.decimal+o.group).split("").findIndex((function(e){return c.split("").filter((function(t){return t===e})).length<d.split("").filter((function(t){return t===e})).length&&c.length+1===d.length&&(e!==o.decimal||0!==t.getDecimalCount(d.replace(p,""),o.decimal))}))>-1)return s.eventValue=r.parseNumber(e.prevLooseValue,n),s.currentLooseValue=e.prevLooseValue,s;var E=t.getDecimalCount(v,o.decimal),j="0"===v[v.length-1];if(C&&j&&E<I)return s.eventValue=r.parseNumber(s.currentLooseValue,n),s.currentLooseValue=t.formatValue(s.eventValue,n,r),s;if(E>0){var B=c.substring(0,$);if(j&&(!B||0!==d.indexOf(B))){s.eventValue=r.parseNumber(s.currentLooseValue,n);var F=t.formatValue(s.eventValue,n,r);return t.setSelection(s,t.changeBasedSelection(c,F,s.selectionEnd,C,p),F,_),s.currentLooseValue=F,s}if(E>S){var A=c.indexOf(o.decimal),G=c.substring(0,A)+c.substring(A,A+1+S)+c.substring(g,String(s.currentLooseValue).length);return s.eventValue=r.parseNumber(G,n),s.currentLooseValue=G,t.setSelection(s,s.selectionStart,G,_),s}if(I!==S&&E<=S&&j)return s.eventValue=r.parseNumber(s.currentLooseValue,n),s.currentLooseValue=V,s;if(E<I)return s.eventValue=r.parseNumber(s.currentLooseValue,n),s.currentLooseValue=t.formatValue(s.eventValue,n,r),s}}if(s.eventValue=r.parseNumber(s.currentLooseValue,n),"number"==typeof s.eventValue){F=t.formatValue(s.eventValue,n,r);1===c.length?t.setSelection(s,t.getInitialPosition(F,o),F,_):t.setSelection(s,t.changeBasedSelection(c,F,s.selectionEnd,C,p),F,_),s.currentLooseValue=F}else s.currentLooseValue=t.formatValue(r.parseNumber(v),n,r);return s}}])}));

@@ -1,5 +0,10 @@

import { VNode } from 'vue';
import { NumberFormatOptions } from '@progress/kendo-vue-intl';
import { VueComponent, FormComponentProps, FormComponentValidity } from '@progress/kendo-vue-common';
declare type NumericTextBoxInputType = 'tel' | 'text';
import { RecordPropsDefinition, ComponentOptions } from 'vue/types/options';
import { NumericTextBoxData } from './interfaces/NumericTextBoxData';
import { NumericTextBoxProps } from './interfaces/NumericTextBoxProps';
declare type DefaultData<V> = object | ((this: V) => NumericTextBoxData);
declare type DefaultMethods<V> = {
[key: string]: (this: V, ...args: any[]) => any;
};
import { IntlService } from '@progress/kendo-vue-intl';
import { FormComponentValidity } from '@progress/kendo-vue-common';
/**

@@ -14,188 +19,42 @@ * The arguments for the `change` event of the NumericTextBox.

}
/**
* Represents the props of the [KendoVue NumericTextBox component]({% slug overview_numerictextbox %}).
*/
export interface NumericTextBoxProps extends FormComponentProps {
/**
* Specifies the value of the NumericTextBox.
*/
value?: number | null;
/**
* Specifies the initial value. Leaves the subsequent updates uncontrolled.
*/
defaultValue?: number | null;
/**
* Specifies the value that is used to increment or decrement the value of the NumericTextBox ([see example]({% slug predefinedsteps_numerictextbox_native %})).
*/
step?: number;
/**
* Specifies the number format which is used for formatting the value ([see example]({% slug formats_numerictextbox_native %})). If set to `null` or `undefined`, the default format will be used.
*/
format?: string | NumberFormatOptions;
/**
* Sets the `tabIndex` property of the NumericTextBox.
*/
tabIndex?: number;
/**
* Specifies the `accessKey` of the NumericTextBox.
*/
accessKey?: string;
/**
* Sets the title of the `input` element of the NumericTextBox.
*/
title?: string;
/**
* Specifies the input placeholder.
*/
placeholder?: string;
/**
* Specifies the smallest value that can be entered.
*/
min?: number;
/**
* Specifies the greatest value that can be entered.
*/
max?: number;
/**
* Specifies whether the **Up** and **Down** spin buttons will be rendered ([see example]({% slug spinbuttons_numerictextbox_native %})).
*/
spinners?: boolean;
/**
* Determines whether the NumericTextBox is disabled.
*/
disabled?: boolean;
/**
* Represents the `dir` HTML attribute.
*/
dir?: string;
/**
* Specifies the name of the `input` DOM element.
*/
name?: string;
/**
* Renders a floating label for the NumericTextBox.
*/
label?: string;
/**
* Sets the `id` of the `input` DOM element.
*/
id?: string;
/**
* Sets the `type` of the `input` DOM element.
*
* The available options are:
* - (Default) `tel`
* - `text`
*/
inputType?: NumericTextBoxInputType;
}
/**
* Represents the state of the NumericTextBox that is passed to the `input` element.
*/
export interface NumericTextBoxState {
/**
* Represents the current value of the NumericTextBox.
*/
value: number | null;
/**
* Represents the text that the user is currently typing. If valid, it will be applied the next time when the NumericTextBox is rendered.
*/
looselyFormattedText: string | null;
/**
* Represents the beginning of the selected portion of the input content that will be applied the next time when the NumericTextBox is rendered.
*/
selectionStart: number;
/**
* Represents the ending of the selected portion of the input content that will be applied the next time when the NumericTextBox is rendered.
*/
selectionEnd: number;
/**
* Specifies whether a decimal point will be selected the next time when the NumericTextBox is rendered.
*/
decimalSelect: boolean;
_intl: IntlService;
_symbols: any;
_input: any;
_elementWrapper: any;
_textBeforeInput: string;
_inputId: string;
_prevLooseValue?: string;
_isPaste: boolean;
}
/**
* @hidden
*/
export declare class NumericTextBox extends VueComponent<NumericTextBoxProps> {
private hasMounted;
private isInvalid;
private isEmpty;
private currentValue;
private valueDuringOnChange?;
private input;
private elementWrapper;
private looselyFormattedText;
private selectionStart;
private selectionEnd;
private decimalSelect;
private intl;
private focused;
private symbols;
private textBeforeInput;
private _inputId;
created(): void;
/**
* @hidden
*/
mounted(): void;
/**
* Gets the value of the NumericTextBox.
*/
get computedValue(): number | null;
/**
* Represents the validity state into which the NumericTextBox is set.
*/
validity(): FormComponentValidity;
/**
* @hidden
*/
focus(): void;
/**
* Gets the element of the NumericTextBox.
*
* @return - An `HTMLInputElement`.
*
*/
/**
* @hidden
*/
updated(): void;
/**
* @hidden
*/
get valueAsLocalString(): string;
emitFocus(e: any): void;
emitBlur(e: any): void;
handleFocus(_: any): void;
handleBlur(_: any): void;
get spanClassNames(): {
'k-textbox-container': boolean;
'k-state-focused': Boolean;
'k-state-empty': boolean;
'k-state-invalid': boolean;
'k-rtl': boolean;
};
get wrapperClassNames(): {
'k-numeric-wrap': boolean;
'k-state-disabled': boolean;
'k-state-invalid': boolean;
};
/**
* @hidden
*/
render(h: any): VNode;
private setValidity;
private formatNumber;
private parseNumber;
private elementChange;
private nonInputActions;
private triggerChange;
private ranged;
private increase;
private decrease;
private wheel;
private keyDown;
private spinnersWrapperMouseDown;
export interface NumericTextBoxMethods {
setValidity: () => void;
getCurrentState: () => NumericTextBoxData;
triggerChange: (newState: NumericTextBoxData, event: any) => void;
formatNumber: (value: number | null) => string;
parseNumber: (text: string) => number;
elementChange: (event: any) => void;
validity: () => FormComponentValidity;
ranged: (value: number | null) => number | null;
nonInputActions: (value: number, event: any) => void;
increase: (event: any) => void;
decrease: (event: any) => void;
wheel: (event: any) => void;
keyDown: (event: any) => void;
onPasteHandler: (event: any) => void;
spinnersWrapperMouseDown: (e: any) => void;
emitFocus: (e: any) => void;
emitBlur: (e: any) => void;
handleFocus: (e: any) => void;
handleBlur: (e: any) => void;
}
export {};
export interface NumericTextBoxComputed {
wrapperClassNames: any;
computedValue?: number;
looseValue?: string;
spanClassNames: any;
}
export interface NumericTextBoxAll extends Vue, NumericTextBoxMethods, NumericTextBoxComputed, NumericTextBoxState {
}
declare let NumericTextBox: ComponentOptions<NumericTextBoxAll, DefaultData<NumericTextBoxData>, DefaultMethods<NumericTextBoxAll>, NumericTextBoxComputed, RecordPropsDefinition<NumericTextBoxProps>>;
export { NumericTextBox };

@@ -1,280 +0,387 @@

function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function (_typeof2) { function _typeof(_x) { return _typeof2.apply(this, arguments); } _typeof.toString = function () { return _typeof2.toString(); }; return _typeof; }(function (obj) { return typeof obj; }); } else { _typeof = function (_typeof3) { function _typeof(_x2) { return _typeof3.apply(this, arguments); } _typeof.toString = function () { return _typeof3.toString(); }; return _typeof; }(function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }); } return _typeof(obj); }
var __extends = this && this.__extends || function () {
var _extendStatics = function extendStatics(d, b) {
_extendStatics = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function (d, b) {
d.__proto__ = b;
} || function (d, b) {
for (var p in b) {
if (b.hasOwnProperty(p)) d[p] = b[p];
}
};
return _extendStatics(d, b);
};
return function (d, b) {
_extendStatics(d, b);
function __() {
this.constructor = d;
}
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
}();
var __decorate = this && this.__decorate || function (decorators, target, key, desc) {
var c = arguments.length,
r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc,
d;
if ((typeof Reflect === "undefined" ? "undefined" : _typeof(Reflect)) === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; i >= 0; i--) {
if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
}
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
import Component from 'vue-class-component';
import { provideIntlService, provideLocalizationService } from '@progress/kendo-vue-intl';
import { VueComponent, guid } from '@progress/kendo-vue-common';
import { guid } from '@progress/kendo-vue-common';
import { messages, numericIncreaseValue, numericDecreaseValue } from './../messages';
var VALIDATION_MESSAGE = 'Please enter a valid value!'; // tslint:enable:max-line-length
import { formatValue, sanitizeNumber, rangeValue, increaseValue, decreaseValue, getStateOrPropsValue } from './utils';
var VALIDATION_MESSAGE = 'Please enter a valid value!';
var NumericTextBox = {
model: {
event: 'changemodel'
},
inheritAttrs: false,
props: {
value: Number,
defaultValue: Number,
step: {
type: Number,
default: 1
},
format: [String, Object],
tabIndex: Number,
accessKey: String,
title: String,
placeholder: String,
min: Number,
max: Number,
spinners: {
type: Boolean,
default: true
},
disabled: {
type: Boolean,
default: false
},
dir: String,
name: String,
label: String,
validationMessage: String,
validityStyles: {
type: Boolean,
default: true
},
valid: {
type: Boolean,
default: undefined
},
required: {
type: Boolean,
default: false
},
id: String
},
inject: {
kendoIntlService: {
default: null
},
kendoLocalizationService: {
default: null
}
},
data: function data() {
return {
hasMounted: false,
isInvalid: false,
isEmpty: false,
currentValue: 0,
valueDuringOnChange: 0,
currentLooseValue: '',
selectionStart: 0,
selectionEnd: 0,
decimalSelect: false,
focused: false,
forceUpdate: false
};
},
created: function created() {
this._textBeforeInput = '';
this._inputId = guid();
this.$data.currentLooseValue = null;
this.$data.valueDuringOnChange = undefined;
this._intl = provideIntlService(this);
this._symbols = this._intl.numberSymbols();
/**
* @hidden
*/
// @ts-ignore
var NumericTextBox =
/** @class */
function (_super) {
__extends(NumericTextBox, _super);
function NumericTextBox() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.hasMounted = false;
_this.isInvalid = false;
_this.isEmpty = false;
_this.currentValue = 0;
_this.valueDuringOnChange = 0;
_this.looselyFormattedText = '';
_this.selectionStart = 0;
_this.selectionEnd = 0;
_this.decimalSelect = false;
_this.focused = false;
_this.textBeforeInput = '';
_this._inputId = guid();
return _this;
}
NumericTextBox.prototype.created = function () {
this.looselyFormattedText = null;
this.valueDuringOnChange = undefined;
if (this.$props.value !== undefined) {
this.currentValue = this.$props.value;
this.$data.currentValue = this.$props.value;
} else if (this.$props.defaultValue !== undefined) {
this.currentValue = this.$props.defaultValue;
this.$data.currentValue = this.$props.defaultValue;
} else {
this.currentValue = null;
this.$data.currentValue = null;
}
};
/**
* @hidden
*/
},
mounted: function mounted() {
this._input = this.$refs.input;
this._elementWrapper = this.$refs.elementWrapper;
this.$data.hasMounted = true;
if (this._input) {
this._textBeforeInput = this._input.value;
}
NumericTextBox.prototype.mounted = function () {
this.input = this.$refs.input;
this.elementWrapper = this.$refs.elementWrapper;
this.hasMounted = true;
this.setValidity();
},
updated: function updated() {
if (!(document && document.activeElement !== this._input || !this._input) && this.$data.currentLooseValue !== null) {
if (this.$data.forceUpdate) {
this._input.selectionStart = this.$data.selectionStart;
this._input.selectionEnd = this.$data.selectionEnd;
this.$data.forceUpdate = false;
}
}
if (this.input) {
this.textBeforeInput = this.input.value;
if (this._input) {
this._textBeforeInput = this._input.value;
}
this.setValidity();
};
Object.defineProperty(NumericTextBox.prototype, "computedValue", {
/**
* Gets the value of the NumericTextBox.
*/
get: function get() {
if (this.valueDuringOnChange !== undefined) {
return this.valueDuringOnChange;
} else {
return this.currentValue;
},
computed: {
computedValue: {
get: function get() {
if (this.$data.valueDuringOnChange !== undefined) {
return this.$data.valueDuringOnChange;
} else {
return this.$data.currentValue;
}
}
},
enumerable: true,
configurable: true
});
/**
* Represents the validity state into which the NumericTextBox is set.
*/
looseValue: {
get: function get() {
return formatValue(this.$data.focused ? this.$data.currentLooseValue : getStateOrPropsValue(this.$props.value, this.$data.currentValue), this.$props.format, this._intl);
}
},
spanClassNames: {
get: function get() {
var isValid = !this.$data.hasMounted || !this.$props.validityStyles || this.validity().valid;
return {
'k-textbox-container': true,
'k-state-focused': this.$data.focused,
'k-state-empty': !(this.computedValue || this.$props.placeholder || this.$data.isEmpty),
'k-state-invalid': !isValid && isValid !== undefined,
'k-rtl': this.$props.dir === 'rtl'
};
}
},
wrapperClassNames: {
get: function get() {
var isValid = !this.$props.validityStyles || this.validity().valid;
return {
'k-numeric-wrap': true,
'k-state-disabled': this.$props.disabled,
'k-state-invalid': !isValid || this.$data.isInvalid
};
}
}
},
methods: {
validity: function validity() {
// The NumericTextBox currently autocorrect its' value,
// so the only invalid state is if it's required and
// the value is null!
var customError = this.$props.validationMessage !== undefined;
var isValid = !this.$props.required || this.computedValue !== null;
var valid = this.$props.valid !== undefined ? this.$props.valid : isValid;
return {
customError: customError,
valid: valid,
valueMissing: this.computedValue === null
};
},
focus: function focus() {
if (this._input) {
this._input.focus();
}
},
emitFocus: function emitFocus(e) {
this.$data.currentLooseValue = this._prevLooseValue;
this.$data.focused = true;
this.$emit('focus', e);
this.$data.forceUpdate = true;
},
emitBlur: function emitBlur(e) {
this.$data.eventValue = null;
this.$data.prevLooseValue = '';
this.$data.currentLooseValue = '';
this.$data.focused = false;
this.$data.selectionStart = undefined;
this.$data.selectionEnd = undefined;
this.$data.decimalSelect = false;
this.$data.valueIsCorrected = false;
this.$data.valueIsOutOfRange = false;
this.$emit('blur', e);
this.$data.forceUpdate = true;
},
handleFocus: function handleFocus(_) {
this.$data.focused = true;
},
handleBlur: function handleBlur(_) {
this.$data.focused = false;
},
setValidity: function setValidity() {
if (this._input && this._input.setCustomValidity) {
this._input.setCustomValidity(this.validity().valid ? '' : this.$props.validationMessage || VALIDATION_MESSAGE);
}
},
getCurrentState: function getCurrentState() {
return {
eventValue: getStateOrPropsValue(this.$props.value, this.$data.currentValue),
prevLooseValue: this._prevLooseValue,
currentLooseValue: this._input.value,
selectionStart: this._input.selectionStart,
selectionEnd: this._input.selectionEnd,
decimalSelect: false,
valueIsCorrected: false,
valueIsOutOfRange: false,
isPaste: this._isPaste,
focused: this.$data.focused
};
},
parseNumber: function parseNumber(text) {
return this._intl.parseNumber(text, this.$props.format);
},
elementChange: function elementChange(event) {
var newState = this.getCurrentState();
this._isPaste = false;
this.triggerChange(event, sanitizeNumber(newState, this.$props.format, this._intl));
},
triggerChange: function triggerChange(event, newState) {
var _this = this;
NumericTextBox.prototype.validity = function () {
// The NumericTextBox currently autocorrect its' value,
// so the only invalid state is if it's required and
// the value is null!
var customError = this.$props.validationMessage !== undefined;
var isValid = !this.$props.required || this.computedValue !== null;
var valid = this.$props.valid !== undefined ? this.$props.valid : isValid;
return {
customError: customError,
valid: valid,
valueMissing: this.computedValue === null
};
};
/**
* @hidden
*/
if (this.$props.disabled) {
return;
}
this.$data.valueDuringOnChange = newState.eventValue;
this.$data.currentValue = newState.eventValue;
var formattedValue = formatValue(rangeValue(newState.eventValue, this.$props.min, this.$props.max), this.$props.format, this._intl);
var rangedValue = rangeValue(this.parseNumber(formattedValue), this.$props.min, this.$props.max);
NumericTextBox.prototype.focus = function () {
if (this.input) {
this.input.focus();
}
};
/**
* Gets the element of the NumericTextBox.
*
* @return - An `HTMLInputElement`.
*
*/
if (rangedValue !== newState.eventValue) {
newState.valueIsOutOfRange = true;
newState.eventValue = rangedValue;
}
/**
* @hidden
*/
if (newState.valueIsCorrected) {
var wrapper = this._elementWrapper;
if (wrapper && wrapper.className.indexOf("k-state-invalid") === -1) {
this.$data.isInvalid = true;
setTimeout(function () {
_this.$data.isInvalid = false;
}, 50);
}
}
NumericTextBox.prototype.updated = function () {
if (!(document && document.activeElement !== this.input || !this.input) && this.looselyFormattedText !== null) {
// An IE related issue.
// When having multiple inputs and if selection is applied, the caret moves to the latest changed input.
// So, skip the application of the selection if the input is not focused.
if (this.input.value !== this.looselyFormattedText) {
// && this.currentValue === prevState.value
// culture is changed, typing was not valid or was ranged.
this.input.selectionStart = this.selectionStart;
this.input.selectionEnd = this.selectionEnd;
var shouldFireEvent = this.$props.value !== newState.eventValue;
if (this.$props.value !== undefined) {
// controlled
this.$data.currentValue = this.$props.value;
} else {
var position = void 0;
var indexOfDecimal = this.looselyFormattedText.indexOf(this.symbols.decimal);
// uncontrolled
this.$data.currentValue = this.$data.valueDuringOnChange;
}
if (indexOfDecimal >= 0 && indexOfDecimal < this.selectionStart) {
position = this.selectionEnd;
} else {
position = this.selectionEnd - (this.looselyFormattedText.length - this.input.value.length);
}
this.$data.prevLooseValue = newState.prevLooseValue;
this.$data.currentLooseValue = newState.currentLooseValue;
this.$data.selectionStart = newState.selectionStart;
this.$data.selectionEnd = newState.selectionEnd;
this.$data.decimalSelect = newState.decimalSelect;
this.$data.valueIsCorrected = newState.valueIsCorrected;
this.$data.valueIsOutOfRange = newState.valueIsOutOfRange;
this.$data.focused = newState.focused;
this.$data.isPaste = newState.isPaste;
this.$data.forceUpdate = !this.$data.forceUpdate;
var indexOfNewDecimal = this.input.value.indexOf(this.symbols.decimal);
if (shouldFireEvent) {
this.$emit('change', {
event: event,
value: this.$data.valueDuringOnChange,
component: this,
target: {
name: this.$props.name,
value: this.$data.valueDuringOnChange
},
validity: this.validity()
});
this.$emit('changemodel', this.$data.valueDuringOnChange);
}
if (this.decimalSelect || this.currentValue === null && indexOfNewDecimal >= 0 || indexOfDecimal === -1 && indexOfNewDecimal >= 0) {
if (this.selectionStart < indexOfNewDecimal + 2 && indexOfDecimal >= 0) {
position = indexOfNewDecimal + 1;
} else {
position = indexOfNewDecimal;
}
}
this.$data.valueDuringOnChange = undefined;
},
onPasteHandler: function onPasteHandler(_event) {
this._isPaste = true;
},
increase: function increase(event) {
var newState = this.getCurrentState();
increaseValue(this.parseNumber(String(newState.currentLooseValue)), newState, this.$props.step, this.$props.min, this.$props.max, this.$props.format, this._intl);
this.triggerChange(event, newState);
},
decrease: function decrease(event) {
var newState = this.getCurrentState();
decreaseValue(this.parseNumber(String(newState.currentLooseValue)), newState, this.$props.step, this.$props.min, this.$props.max, this.$props.format, this._intl);
this.triggerChange(event, newState);
},
wheel: function wheel(event) {
if (!document || document.activeElement !== this._input || !this._input) {
return;
}
if (!this.decimalSelect) {
// && (this.currentValue === prevState.value)
position = this.selectionEnd - (this.looselyFormattedText.length - this.input.value.length);
}
if (event.deltaY < 0) {
event.preventDefault();
this.increase(event);
}
if (this.looselyFormattedText[0] === this.symbols.decimal) {
// && prevState.looselyFormattedText === this.symbols.decimal
position = this.currentValue !== undefined ? this.formatNumber(this.currentValue).length : 0;
}
if (event.deltaY > 0) {
event.preventDefault();
this.decrease(event);
}
},
keyDown: function keyDown(event) {
var newState = this.getCurrentState();
var currentValue = this.parseNumber(String(newState.currentLooseValue)); // Select All
this.input.selectionStart = this.input.selectionEnd = position;
if (newState.selectionEnd > newState.selectionStart && newState.selectionEnd - newState.selectionStart === String(newState.currentLooseValue).length) {
return;
}
}
if (this.input) {
this.textBeforeInput = this.input.value;
}
switch (event.keyCode) {
case 38:
// Arrow up
increaseValue(currentValue, newState, this.$props.step, this.$props.min, this.$props.max, this.$props.format, this._intl);
break;
this.setValidity();
};
case 40:
// Arrow down
decreaseValue(currentValue, newState, this.$props.step, this.$props.min, this.$props.max, this.$props.format, this._intl);
break;
Object.defineProperty(NumericTextBox.prototype, "valueAsLocalString", {
/**
* @hidden
*/
get: function get() {
this.intl = provideIntlService(this);
this.symbols = this.intl.numberSymbols();
case 13:
// Enter - range values
var formattedValue = formatValue(rangeValue(currentValue, this.$props.min, this.$props.max), this.$props.format, this._intl);
var rangedValue = rangeValue(this.parseNumber(formattedValue), this.$props.min, this.$props.max);
newState.eventValue = rangedValue;
newState.currentLooseValue = formatValue(rangedValue, this.$props.format, this._intl);
newState.selectionStart = newState.selectionEnd = newState.currentLooseValue.length;
break;
if (this.looselyFormattedText !== null && !this.decimalSelect && this.parseNumber(this.looselyFormattedText) === this.currentValue && this.formatNumber(this.currentValue).length < this.looselyFormattedText.length && this.looselyFormattedText.indexOf(this.formatNumber(this.currentValue)) === 0) {
// the user is currently typing, do not interrupt them
return this.looselyFormattedText;
}
case 110:
// Numpad decimal key
var element = this._input;
return this.formatNumber(this.currentValue);
},
enumerable: true,
configurable: true
});
var symbols = this._intl.numberSymbols();
NumericTextBox.prototype.emitFocus = function (e) {
this.$emit('focus', e);
};
if (element) {
newState.currentLooseValue = newState.currentLooseValue.slice(0, newState.selectionStart) + symbols.decimal + newState.currentLooseValue.slice(newState.selectionEnd);
newState.selectionStart = newState.selectionEnd = newState.selectionStart + 1;
newState = sanitizeNumber(newState, this.$props.format, this._intl);
}
NumericTextBox.prototype.emitBlur = function (e) {
this.$emit('blur', e);
};
break;
NumericTextBox.prototype.handleFocus = function (_) {
this.focused = true;
};
default:
return;
}
NumericTextBox.prototype.handleBlur = function (_) {
this.focused = false;
};
event.preventDefault();
this.triggerChange(event, newState);
},
spinnersWrapperMouseDown: function spinnersWrapperMouseDown(e) {
if (document && this._input) {
e.preventDefault();
Object.defineProperty(NumericTextBox.prototype, "spanClassNames", {
get: function get() {
var isValid = !this.hasMounted || !this.$props.validityStyles || this.validity().valid;
return {
'k-textbox-container': true,
'k-state-focused': this.focused,
'k-state-empty': !(this.computedValue || this.$props.placeholder || this.isEmpty),
'k-state-invalid': !isValid && isValid !== undefined,
'k-rtl': this.$props.dir === 'rtl'
};
},
enumerable: true,
configurable: true
});
Object.defineProperty(NumericTextBox.prototype, "wrapperClassNames", {
get: function get() {
var isValid = !this.$props.validityStyles || this.validity().valid;
return {
'k-numeric-wrap': true,
'k-state-disabled': this.$props.disabled,
'k-state-invalid': !isValid || this.isInvalid
};
},
enumerable: true,
configurable: true
});
/**
* @hidden
*/
if (document.activeElement !== this._input) {
this._input.focus();
}
}
}
},
// @ts-ignore
NumericTextBox.prototype.render = function (h) {
render: function render(h) {
var inputId = this.$props.id || this._inputId;
var localizationService = provideLocalizationService(this);
if (this.$props.value !== undefined && this.$props.value !== this.currentValue) {
this.currentValue = this.$props.value;
if (this.$props.value !== undefined && this.$props.value !== this.$data.currentValue) {
this.$data.currentValue = this.$props.value;
}
this._prevLooseValue = this.looseValue;
var numerictextbox = h("span", {

@@ -303,3 +410,3 @@ attrs: {

id: inputId,
"aria-valuenow": this.currentValue !== null ? this.currentValue : undefined,
"aria-valuenow": this.$data.currentValue !== null ? this.$data.currentValue : undefined,
name: this.$props.name

@@ -309,3 +416,3 @@ },

domProps: {
"value": this.valueAsLocalString
"value": this.looseValue
},

@@ -317,3 +424,4 @@ on: {

"focus": this.emitFocus,
"blur": this.emitBlur
"blur": this.emitBlur,
"paste": this.onPasteHandler
},

@@ -366,311 +474,4 @@ ref: 'input'

}, [this.$props.label]) : null]) : numerictextbox;
};
NumericTextBox.prototype.setValidity = function () {
if (this.input && this.input.setCustomValidity) {
this.input.setCustomValidity(this.validity().valid ? '' : this.$props.validationMessage || VALIDATION_MESSAGE);
}
};
NumericTextBox.prototype.formatNumber = function (value) {
if (value == null) {
return '';
}
return this.intl.formatNumber(value, this.$props.format).toString(); // the second argument actually supports null/undefined
};
NumericTextBox.prototype.parseNumber = function (text) {
return this.intl.parseNumber(text, this.$props.format);
};
NumericTextBox.prototype.elementChange = function (event) {
var _this = this;
if (!this.input) {
return;
}
var element = this.input;
var newState = {
value: this.currentValue,
looselyFormattedText: element.value,
selectionStart: this.input.selectionStart,
selectionEnd: this.input.selectionEnd,
decimalSelect: false
};
var text = element.value; // do NOT use 'event.target.value', always use 'element.value'
var minusSign = this.symbols.minusSign;
if (text === minusSign) {
newState.value = null;
this.triggerChange(newState, event);
return;
}
if (text.split(minusSign).length !== this.textBeforeInput.split(minusSign).length && text.length === this.textBeforeInput.length + minusSign.length) {
// positive/negative change
newState.value = -this.parseNumber(this.textBeforeInput);
this.triggerChange(newState, event);
return;
}
var decimal = this.symbols.decimal;
if (text.split(RegExp('\\' + decimal)).length > 2) {
// prevent typing second decimal separator
newState.decimalSelect = true;
this.triggerChange(newState, event);
return;
}
if (text.length > 1 && text.indexOf(decimal) === -1 && this.textBeforeInput.indexOf(decimal) >= 0 && text.length + decimal.length === this.textBeforeInput.length) {
// prevent deleting of decimal separator on its own
newState.decimalSelect = true;
this.triggerChange(newState, event);
return;
}
var value = this.parseNumber(text);
if (value === this.currentValue && text.length > 0 && text[text.length - 1] === decimal) {
if ((this.formatNumber(1.1) || '').toString().indexOf(decimal) > -1) {
newState.looselyFormattedText = text;
this.triggerChange(newState, event);
return;
}
}
var invalid = (value === null || isNaN(value)) && text.length > 0 && text !== this.symbols.minusSign;
var wrapper = this.elementWrapper;
if (text.length > this.textBeforeInput.length && this.parseNumber(text) === this.parseNumber(text.slice(0, element.selectionStart)) && (this.parseNumber(text.slice(element.selectionStart - 1)) === null || isNaN(this.parseNumber(text.slice(element.selectionStart - 1))))) {
invalid = true;
}
if (invalid) {
// block typing of invalid characters
if (wrapper && wrapper.className.indexOf("k-state-invalid") === -1) {
this.isInvalid = true;
setTimeout(function () {
_this.isInvalid = false;
}, 50);
}
newState.looselyFormattedText = this.textBeforeInput;
newState.selectionStart = newState.selectionEnd = element.selectionEnd + this.textBeforeInput.length - element.value.length;
this.triggerChange(newState, event);
return;
}
newState.value = value;
this.triggerChange(newState, event);
};
NumericTextBox.prototype.nonInputActions = function (value, event) {
var newState = {
value: value,
looselyFormattedText: null,
selectionStart: 0,
selectionEnd: 0,
decimalSelect: false
};
this.triggerChange(newState, event);
};
NumericTextBox.prototype.triggerChange = function (newState, event) {
if (this.$props.disabled) {
return;
} // decimals ranging based on the format:
this.valueDuringOnChange = this.ranged(this.parseNumber(this.formatNumber(this.ranged(newState.value)))); // const value = newState.value;
var shouldFireEvent = this.valueDuringOnChange !== this.currentValue;
if (this.$props.value !== undefined) {
// controlled
this.currentValue = this.$props.value;
} else {
// uncontrolled
this.currentValue = this.valueDuringOnChange;
}
this.looselyFormattedText = newState.looselyFormattedText;
this.selectionStart = newState.selectionStart;
this.selectionEnd = newState.selectionEnd;
this.decimalSelect = newState.decimalSelect;
if (shouldFireEvent) {
this.$emit('change', {
event: event,
value: this.valueDuringOnChange,
component: this,
target: {
name: this.$props.name,
value: this.valueDuringOnChange
},
validity: this.validity()
});
this.$emit('changemodel', this.valueDuringOnChange);
}
this.valueDuringOnChange = undefined;
};
NumericTextBox.prototype.ranged = function (value) {
if (value == null) {
return value;
}
if (!(value > 1 || value < 1 || value === 1)) {
// null, undefined or NaN
return null;
}
if (this.$props.max !== undefined && this.$props.min !== undefined && this.$props.max < this.$props.min) {
return null;
} // TODO: This should be something improved like
// while (value < max) { value *= 10 }
// and the selection should be adjusted
// to get good experience when typing values in ranges like [222,11111]
if (this.$props.max !== undefined && value > this.$props.max) {
value = this.$props.max;
}
if (this.$props.min !== undefined && value < this.$props.min) {
value = this.$props.min;
}
return value;
};
NumericTextBox.prototype.increase = function (event) {
this.nonInputActions((this.currentValue || 0) + (this.$props.step || 0), event);
};
NumericTextBox.prototype.decrease = function (event) {
this.nonInputActions((this.currentValue || 0) - (this.$props.step || 0), event);
};
NumericTextBox.prototype.wheel = function (event) {
if (!document || document.activeElement !== this.input || !this.input) {
return;
}
if (event.deltaY < 0) {
event.preventDefault();
this.increase(event);
}
if (event.deltaY > 0) {
event.preventDefault();
this.decrease(event);
}
};
NumericTextBox.prototype.keyDown = function (event) {
switch (event.keyCode) {
case 38:
// arrow up
this.increase(event);
break;
case 40:
// arrow down
this.decrease(event);
break;
case 110:
// numpad decimal key
var element = this.input;
if (element) {
var text = element.value;
var selectionStart = element.selectionStart,
selectionEnd = element.selectionEnd;
element.value = text.slice(0, selectionStart) + this.symbols.decimal + text.slice(selectionEnd);
element.selectionStart = element.selectionEnd = selectionStart + 1;
this.elementChange(event); // TODO: remove this call (use triggerChange directly with custom state)
}
break;
default:
return;
}
event.preventDefault();
};
NumericTextBox.prototype.spinnersWrapperMouseDown = function (e) {
if (document && this.input) {
e.preventDefault();
if (document.activeElement !== this.input) {
this.input.focus();
}
}
};
NumericTextBox = __decorate([Component({
model: {
event: 'changemodel'
},
inheritAttrs: false,
props: {
value: Number,
defaultValue: Number,
step: {
type: Number,
default: 1
},
format: [String, Object],
tabIndex: Number,
accessKey: String,
title: String,
placeholder: String,
min: Number,
max: Number,
spinners: {
type: Boolean,
default: true
},
disabled: {
type: Boolean,
default: false
},
dir: String,
name: String,
label: String,
validationMessage: String,
validityStyles: {
type: Boolean,
default: true
},
valid: {
type: Boolean,
default: undefined
},
required: {
type: Boolean,
default: false
},
id: String
},
inject: {
kendoIntlService: {
default: null
},
kendoLocalizationService: {
default: null
}
}
})], NumericTextBox);
return NumericTextBox;
}(VueComponent);
}
};
export { NumericTextBox };

@@ -1,5 +0,10 @@

import { VNode } from 'vue';
import { NumberFormatOptions } from '@progress/kendo-vue-intl';
import { VueComponent, FormComponentProps, FormComponentValidity } from '@progress/kendo-vue-common';
declare type NumericTextBoxInputType = 'tel' | 'text';
import { RecordPropsDefinition, ComponentOptions } from 'vue/types/options';
import { NumericTextBoxData } from './interfaces/NumericTextBoxData';
import { NumericTextBoxProps } from './interfaces/NumericTextBoxProps';
declare type DefaultData<V> = object | ((this: V) => NumericTextBoxData);
declare type DefaultMethods<V> = {
[key: string]: (this: V, ...args: any[]) => any;
};
import { IntlService } from '@progress/kendo-vue-intl';
import { FormComponentValidity } from '@progress/kendo-vue-common';
/**

@@ -14,188 +19,42 @@ * The arguments for the `change` event of the NumericTextBox.

}
/**
* Represents the props of the [KendoVue NumericTextBox component]({% slug overview_numerictextbox %}).
*/
export interface NumericTextBoxProps extends FormComponentProps {
/**
* Specifies the value of the NumericTextBox.
*/
value?: number | null;
/**
* Specifies the initial value. Leaves the subsequent updates uncontrolled.
*/
defaultValue?: number | null;
/**
* Specifies the value that is used to increment or decrement the value of the NumericTextBox ([see example]({% slug predefinedsteps_numerictextbox_native %})).
*/
step?: number;
/**
* Specifies the number format which is used for formatting the value ([see example]({% slug formats_numerictextbox_native %})). If set to `null` or `undefined`, the default format will be used.
*/
format?: string | NumberFormatOptions;
/**
* Sets the `tabIndex` property of the NumericTextBox.
*/
tabIndex?: number;
/**
* Specifies the `accessKey` of the NumericTextBox.
*/
accessKey?: string;
/**
* Sets the title of the `input` element of the NumericTextBox.
*/
title?: string;
/**
* Specifies the input placeholder.
*/
placeholder?: string;
/**
* Specifies the smallest value that can be entered.
*/
min?: number;
/**
* Specifies the greatest value that can be entered.
*/
max?: number;
/**
* Specifies whether the **Up** and **Down** spin buttons will be rendered ([see example]({% slug spinbuttons_numerictextbox_native %})).
*/
spinners?: boolean;
/**
* Determines whether the NumericTextBox is disabled.
*/
disabled?: boolean;
/**
* Represents the `dir` HTML attribute.
*/
dir?: string;
/**
* Specifies the name of the `input` DOM element.
*/
name?: string;
/**
* Renders a floating label for the NumericTextBox.
*/
label?: string;
/**
* Sets the `id` of the `input` DOM element.
*/
id?: string;
/**
* Sets the `type` of the `input` DOM element.
*
* The available options are:
* - (Default) `tel`
* - `text`
*/
inputType?: NumericTextBoxInputType;
}
/**
* Represents the state of the NumericTextBox that is passed to the `input` element.
*/
export interface NumericTextBoxState {
/**
* Represents the current value of the NumericTextBox.
*/
value: number | null;
/**
* Represents the text that the user is currently typing. If valid, it will be applied the next time when the NumericTextBox is rendered.
*/
looselyFormattedText: string | null;
/**
* Represents the beginning of the selected portion of the input content that will be applied the next time when the NumericTextBox is rendered.
*/
selectionStart: number;
/**
* Represents the ending of the selected portion of the input content that will be applied the next time when the NumericTextBox is rendered.
*/
selectionEnd: number;
/**
* Specifies whether a decimal point will be selected the next time when the NumericTextBox is rendered.
*/
decimalSelect: boolean;
_intl: IntlService;
_symbols: any;
_input: any;
_elementWrapper: any;
_textBeforeInput: string;
_inputId: string;
_prevLooseValue?: string;
_isPaste: boolean;
}
/**
* @hidden
*/
export declare class NumericTextBox extends VueComponent<NumericTextBoxProps> {
private hasMounted;
private isInvalid;
private isEmpty;
private currentValue;
private valueDuringOnChange?;
private input;
private elementWrapper;
private looselyFormattedText;
private selectionStart;
private selectionEnd;
private decimalSelect;
private intl;
private focused;
private symbols;
private textBeforeInput;
private _inputId;
created(): void;
/**
* @hidden
*/
mounted(): void;
/**
* Gets the value of the NumericTextBox.
*/
get computedValue(): number | null;
/**
* Represents the validity state into which the NumericTextBox is set.
*/
validity(): FormComponentValidity;
/**
* @hidden
*/
focus(): void;
/**
* Gets the element of the NumericTextBox.
*
* @return - An `HTMLInputElement`.
*
*/
/**
* @hidden
*/
updated(): void;
/**
* @hidden
*/
get valueAsLocalString(): string;
emitFocus(e: any): void;
emitBlur(e: any): void;
handleFocus(_: any): void;
handleBlur(_: any): void;
get spanClassNames(): {
'k-textbox-container': boolean;
'k-state-focused': Boolean;
'k-state-empty': boolean;
'k-state-invalid': boolean;
'k-rtl': boolean;
};
get wrapperClassNames(): {
'k-numeric-wrap': boolean;
'k-state-disabled': boolean;
'k-state-invalid': boolean;
};
/**
* @hidden
*/
render(h: any): VNode;
private setValidity;
private formatNumber;
private parseNumber;
private elementChange;
private nonInputActions;
private triggerChange;
private ranged;
private increase;
private decrease;
private wheel;
private keyDown;
private spinnersWrapperMouseDown;
export interface NumericTextBoxMethods {
setValidity: () => void;
getCurrentState: () => NumericTextBoxData;
triggerChange: (newState: NumericTextBoxData, event: any) => void;
formatNumber: (value: number | null) => string;
parseNumber: (text: string) => number;
elementChange: (event: any) => void;
validity: () => FormComponentValidity;
ranged: (value: number | null) => number | null;
nonInputActions: (value: number, event: any) => void;
increase: (event: any) => void;
decrease: (event: any) => void;
wheel: (event: any) => void;
keyDown: (event: any) => void;
onPasteHandler: (event: any) => void;
spinnersWrapperMouseDown: (e: any) => void;
emitFocus: (e: any) => void;
emitBlur: (e: any) => void;
handleFocus: (e: any) => void;
handleBlur: (e: any) => void;
}
export {};
export interface NumericTextBoxComputed {
wrapperClassNames: any;
computedValue?: number;
looseValue?: string;
spanClassNames: any;
}
export interface NumericTextBoxAll extends Vue, NumericTextBoxMethods, NumericTextBoxComputed, NumericTextBoxState {
}
declare let NumericTextBox: ComponentOptions<NumericTextBoxAll, DefaultData<NumericTextBoxData>, DefaultMethods<NumericTextBoxAll>, NumericTextBoxComputed, RecordPropsDefinition<NumericTextBoxProps>>;
export { NumericTextBox };
"use strict";
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function (_typeof2) { function _typeof(_x) { return _typeof2.apply(this, arguments); } _typeof.toString = function () { return _typeof2.toString(); }; return _typeof; }(function (obj) { return typeof obj; }); } else { _typeof = function (_typeof3) { function _typeof(_x2) { return _typeof3.apply(this, arguments); } _typeof.toString = function () { return _typeof3.toString(); }; return _typeof; }(function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }); } return _typeof(obj); }
var __extends = undefined && undefined.__extends || function () {
var _extendStatics = function extendStatics(d, b) {
_extendStatics = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function (d, b) {
d.__proto__ = b;
} || function (d, b) {
for (var p in b) {
if (b.hasOwnProperty(p)) d[p] = b[p];
}
};
return _extendStatics(d, b);
};
return function (d, b) {
_extendStatics(d, b);
function __() {
this.constructor = d;
}
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
}();
var __decorate = undefined && undefined.__decorate || function (decorators, target, key, desc) {
var c = arguments.length,
r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc,
d;
if ((typeof Reflect === "undefined" ? "undefined" : _typeof(Reflect)) === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; i >= 0; i--) {
if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
}
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
Object.defineProperty(exports, "__esModule", {

@@ -45,4 +7,2 @@ value: true

var vue_class_component_1 = require("vue-class-component");
var kendo_vue_intl_1 = require("@progress/kendo-vue-intl");

@@ -54,239 +14,386 @@

var VALIDATION_MESSAGE = 'Please enter a valid value!'; // tslint:enable:max-line-length
var utils_1 = require("./utils");
/**
* @hidden
*/
// @ts-ignore
var VALIDATION_MESSAGE = 'Please enter a valid value!';
var NumericTextBox = {
model: {
event: 'changemodel'
},
inheritAttrs: false,
props: {
value: Number,
defaultValue: Number,
step: {
type: Number,
default: 1
},
format: [String, Object],
tabIndex: Number,
accessKey: String,
title: String,
placeholder: String,
min: Number,
max: Number,
spinners: {
type: Boolean,
default: true
},
disabled: {
type: Boolean,
default: false
},
dir: String,
name: String,
label: String,
validationMessage: String,
validityStyles: {
type: Boolean,
default: true
},
valid: {
type: Boolean,
default: undefined
},
required: {
type: Boolean,
default: false
},
id: String
},
inject: {
kendoIntlService: {
default: null
},
kendoLocalizationService: {
default: null
}
},
data: function data() {
return {
hasMounted: false,
isInvalid: false,
isEmpty: false,
currentValue: 0,
valueDuringOnChange: 0,
currentLooseValue: '',
selectionStart: 0,
selectionEnd: 0,
decimalSelect: false,
focused: false,
forceUpdate: false
};
},
created: function created() {
this._textBeforeInput = '';
this._inputId = kendo_vue_common_1.guid();
this.$data.currentLooseValue = null;
this.$data.valueDuringOnChange = undefined;
this._intl = kendo_vue_intl_1.provideIntlService(this);
this._symbols = this._intl.numberSymbols();
var NumericTextBox =
/** @class */
function (_super) {
__extends(NumericTextBox, _super);
function NumericTextBox() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.hasMounted = false;
_this.isInvalid = false;
_this.isEmpty = false;
_this.currentValue = 0;
_this.valueDuringOnChange = 0;
_this.looselyFormattedText = '';
_this.selectionStart = 0;
_this.selectionEnd = 0;
_this.decimalSelect = false;
_this.focused = false;
_this.textBeforeInput = '';
_this._inputId = kendo_vue_common_1.guid();
return _this;
}
NumericTextBox.prototype.created = function () {
this.looselyFormattedText = null;
this.valueDuringOnChange = undefined;
if (this.$props.value !== undefined) {
this.currentValue = this.$props.value;
this.$data.currentValue = this.$props.value;
} else if (this.$props.defaultValue !== undefined) {
this.currentValue = this.$props.defaultValue;
this.$data.currentValue = this.$props.defaultValue;
} else {
this.currentValue = null;
this.$data.currentValue = null;
}
};
/**
* @hidden
*/
},
mounted: function mounted() {
this._input = this.$refs.input;
this._elementWrapper = this.$refs.elementWrapper;
this.$data.hasMounted = true;
if (this._input) {
this._textBeforeInput = this._input.value;
}
NumericTextBox.prototype.mounted = function () {
this.input = this.$refs.input;
this.elementWrapper = this.$refs.elementWrapper;
this.hasMounted = true;
this.setValidity();
},
updated: function updated() {
if (!(document && document.activeElement !== this._input || !this._input) && this.$data.currentLooseValue !== null) {
if (this.$data.forceUpdate) {
this._input.selectionStart = this.$data.selectionStart;
this._input.selectionEnd = this.$data.selectionEnd;
this.$data.forceUpdate = false;
}
}
if (this.input) {
this.textBeforeInput = this.input.value;
if (this._input) {
this._textBeforeInput = this._input.value;
}
this.setValidity();
};
Object.defineProperty(NumericTextBox.prototype, "computedValue", {
/**
* Gets the value of the NumericTextBox.
*/
get: function get() {
if (this.valueDuringOnChange !== undefined) {
return this.valueDuringOnChange;
} else {
return this.currentValue;
},
computed: {
computedValue: {
get: function get() {
if (this.$data.valueDuringOnChange !== undefined) {
return this.$data.valueDuringOnChange;
} else {
return this.$data.currentValue;
}
}
},
enumerable: true,
configurable: true
});
/**
* Represents the validity state into which the NumericTextBox is set.
*/
looseValue: {
get: function get() {
return utils_1.formatValue(this.$data.focused ? this.$data.currentLooseValue : utils_1.getStateOrPropsValue(this.$props.value, this.$data.currentValue), this.$props.format, this._intl);
}
},
spanClassNames: {
get: function get() {
var isValid = !this.$data.hasMounted || !this.$props.validityStyles || this.validity().valid;
return {
'k-textbox-container': true,
'k-state-focused': this.$data.focused,
'k-state-empty': !(this.computedValue || this.$props.placeholder || this.$data.isEmpty),
'k-state-invalid': !isValid && isValid !== undefined,
'k-rtl': this.$props.dir === 'rtl'
};
}
},
wrapperClassNames: {
get: function get() {
var isValid = !this.$props.validityStyles || this.validity().valid;
return {
'k-numeric-wrap': true,
'k-state-disabled': this.$props.disabled,
'k-state-invalid': !isValid || this.$data.isInvalid
};
}
}
},
methods: {
validity: function validity() {
// The NumericTextBox currently autocorrect its' value,
// so the only invalid state is if it's required and
// the value is null!
var customError = this.$props.validationMessage !== undefined;
var isValid = !this.$props.required || this.computedValue !== null;
var valid = this.$props.valid !== undefined ? this.$props.valid : isValid;
return {
customError: customError,
valid: valid,
valueMissing: this.computedValue === null
};
},
focus: function focus() {
if (this._input) {
this._input.focus();
}
},
emitFocus: function emitFocus(e) {
this.$data.currentLooseValue = this._prevLooseValue;
this.$data.focused = true;
this.$emit('focus', e);
this.$data.forceUpdate = true;
},
emitBlur: function emitBlur(e) {
this.$data.eventValue = null;
this.$data.prevLooseValue = '';
this.$data.currentLooseValue = '';
this.$data.focused = false;
this.$data.selectionStart = undefined;
this.$data.selectionEnd = undefined;
this.$data.decimalSelect = false;
this.$data.valueIsCorrected = false;
this.$data.valueIsOutOfRange = false;
this.$emit('blur', e);
this.$data.forceUpdate = true;
},
handleFocus: function handleFocus(_) {
this.$data.focused = true;
},
handleBlur: function handleBlur(_) {
this.$data.focused = false;
},
setValidity: function setValidity() {
if (this._input && this._input.setCustomValidity) {
this._input.setCustomValidity(this.validity().valid ? '' : this.$props.validationMessage || VALIDATION_MESSAGE);
}
},
getCurrentState: function getCurrentState() {
return {
eventValue: utils_1.getStateOrPropsValue(this.$props.value, this.$data.currentValue),
prevLooseValue: this._prevLooseValue,
currentLooseValue: this._input.value,
selectionStart: this._input.selectionStart,
selectionEnd: this._input.selectionEnd,
decimalSelect: false,
valueIsCorrected: false,
valueIsOutOfRange: false,
isPaste: this._isPaste,
focused: this.$data.focused
};
},
parseNumber: function parseNumber(text) {
return this._intl.parseNumber(text, this.$props.format);
},
elementChange: function elementChange(event) {
var newState = this.getCurrentState();
this._isPaste = false;
this.triggerChange(event, utils_1.sanitizeNumber(newState, this.$props.format, this._intl));
},
triggerChange: function triggerChange(event, newState) {
var _this = this;
NumericTextBox.prototype.validity = function () {
// The NumericTextBox currently autocorrect its' value,
// so the only invalid state is if it's required and
// the value is null!
var customError = this.$props.validationMessage !== undefined;
var isValid = !this.$props.required || this.computedValue !== null;
var valid = this.$props.valid !== undefined ? this.$props.valid : isValid;
return {
customError: customError,
valid: valid,
valueMissing: this.computedValue === null
};
};
/**
* @hidden
*/
if (this.$props.disabled) {
return;
}
this.$data.valueDuringOnChange = newState.eventValue;
this.$data.currentValue = newState.eventValue;
var formattedValue = utils_1.formatValue(utils_1.rangeValue(newState.eventValue, this.$props.min, this.$props.max), this.$props.format, this._intl);
var rangedValue = utils_1.rangeValue(this.parseNumber(formattedValue), this.$props.min, this.$props.max);
NumericTextBox.prototype.focus = function () {
if (this.input) {
this.input.focus();
}
};
/**
* Gets the element of the NumericTextBox.
*
* @return - An `HTMLInputElement`.
*
*/
if (rangedValue !== newState.eventValue) {
newState.valueIsOutOfRange = true;
newState.eventValue = rangedValue;
}
/**
* @hidden
*/
if (newState.valueIsCorrected) {
var wrapper = this._elementWrapper;
if (wrapper && wrapper.className.indexOf("k-state-invalid") === -1) {
this.$data.isInvalid = true;
setTimeout(function () {
_this.$data.isInvalid = false;
}, 50);
}
}
NumericTextBox.prototype.updated = function () {
if (!(document && document.activeElement !== this.input || !this.input) && this.looselyFormattedText !== null) {
// An IE related issue.
// When having multiple inputs and if selection is applied, the caret moves to the latest changed input.
// So, skip the application of the selection if the input is not focused.
if (this.input.value !== this.looselyFormattedText) {
// && this.currentValue === prevState.value
// culture is changed, typing was not valid or was ranged.
this.input.selectionStart = this.selectionStart;
this.input.selectionEnd = this.selectionEnd;
var shouldFireEvent = this.$props.value !== newState.eventValue;
if (this.$props.value !== undefined) {
// controlled
this.$data.currentValue = this.$props.value;
} else {
var position = void 0;
var indexOfDecimal = this.looselyFormattedText.indexOf(this.symbols.decimal);
// uncontrolled
this.$data.currentValue = this.$data.valueDuringOnChange;
}
if (indexOfDecimal >= 0 && indexOfDecimal < this.selectionStart) {
position = this.selectionEnd;
} else {
position = this.selectionEnd - (this.looselyFormattedText.length - this.input.value.length);
}
this.$data.prevLooseValue = newState.prevLooseValue;
this.$data.currentLooseValue = newState.currentLooseValue;
this.$data.selectionStart = newState.selectionStart;
this.$data.selectionEnd = newState.selectionEnd;
this.$data.decimalSelect = newState.decimalSelect;
this.$data.valueIsCorrected = newState.valueIsCorrected;
this.$data.valueIsOutOfRange = newState.valueIsOutOfRange;
this.$data.focused = newState.focused;
this.$data.isPaste = newState.isPaste;
this.$data.forceUpdate = !this.$data.forceUpdate;
var indexOfNewDecimal = this.input.value.indexOf(this.symbols.decimal);
if (shouldFireEvent) {
this.$emit('change', {
event: event,
value: this.$data.valueDuringOnChange,
component: this,
target: {
name: this.$props.name,
value: this.$data.valueDuringOnChange
},
validity: this.validity()
});
this.$emit('changemodel', this.$data.valueDuringOnChange);
}
if (this.decimalSelect || this.currentValue === null && indexOfNewDecimal >= 0 || indexOfDecimal === -1 && indexOfNewDecimal >= 0) {
if (this.selectionStart < indexOfNewDecimal + 2 && indexOfDecimal >= 0) {
position = indexOfNewDecimal + 1;
} else {
position = indexOfNewDecimal;
}
}
this.$data.valueDuringOnChange = undefined;
},
onPasteHandler: function onPasteHandler(_event) {
this._isPaste = true;
},
increase: function increase(event) {
var newState = this.getCurrentState();
utils_1.increaseValue(this.parseNumber(String(newState.currentLooseValue)), newState, this.$props.step, this.$props.min, this.$props.max, this.$props.format, this._intl);
this.triggerChange(event, newState);
},
decrease: function decrease(event) {
var newState = this.getCurrentState();
utils_1.decreaseValue(this.parseNumber(String(newState.currentLooseValue)), newState, this.$props.step, this.$props.min, this.$props.max, this.$props.format, this._intl);
this.triggerChange(event, newState);
},
wheel: function wheel(event) {
if (!document || document.activeElement !== this._input || !this._input) {
return;
}
if (!this.decimalSelect) {
// && (this.currentValue === prevState.value)
position = this.selectionEnd - (this.looselyFormattedText.length - this.input.value.length);
}
if (event.deltaY < 0) {
event.preventDefault();
this.increase(event);
}
if (this.looselyFormattedText[0] === this.symbols.decimal) {
// && prevState.looselyFormattedText === this.symbols.decimal
position = this.currentValue !== undefined ? this.formatNumber(this.currentValue).length : 0;
}
if (event.deltaY > 0) {
event.preventDefault();
this.decrease(event);
}
},
keyDown: function keyDown(event) {
var newState = this.getCurrentState();
var currentValue = this.parseNumber(String(newState.currentLooseValue)); // Select All
this.input.selectionStart = this.input.selectionEnd = position;
if (newState.selectionEnd > newState.selectionStart && newState.selectionEnd - newState.selectionStart === String(newState.currentLooseValue).length) {
return;
}
}
if (this.input) {
this.textBeforeInput = this.input.value;
}
switch (event.keyCode) {
case 38:
// Arrow up
utils_1.increaseValue(currentValue, newState, this.$props.step, this.$props.min, this.$props.max, this.$props.format, this._intl);
break;
this.setValidity();
};
case 40:
// Arrow down
utils_1.decreaseValue(currentValue, newState, this.$props.step, this.$props.min, this.$props.max, this.$props.format, this._intl);
break;
Object.defineProperty(NumericTextBox.prototype, "valueAsLocalString", {
/**
* @hidden
*/
get: function get() {
this.intl = kendo_vue_intl_1.provideIntlService(this);
this.symbols = this.intl.numberSymbols();
case 13:
// Enter - range values
var formattedValue = utils_1.formatValue(utils_1.rangeValue(currentValue, this.$props.min, this.$props.max), this.$props.format, this._intl);
var rangedValue = utils_1.rangeValue(this.parseNumber(formattedValue), this.$props.min, this.$props.max);
newState.eventValue = rangedValue;
newState.currentLooseValue = utils_1.formatValue(rangedValue, this.$props.format, this._intl);
newState.selectionStart = newState.selectionEnd = newState.currentLooseValue.length;
break;
if (this.looselyFormattedText !== null && !this.decimalSelect && this.parseNumber(this.looselyFormattedText) === this.currentValue && this.formatNumber(this.currentValue).length < this.looselyFormattedText.length && this.looselyFormattedText.indexOf(this.formatNumber(this.currentValue)) === 0) {
// the user is currently typing, do not interrupt them
return this.looselyFormattedText;
}
case 110:
// Numpad decimal key
var element = this._input;
return this.formatNumber(this.currentValue);
},
enumerable: true,
configurable: true
});
var symbols = this._intl.numberSymbols();
NumericTextBox.prototype.emitFocus = function (e) {
this.$emit('focus', e);
};
if (element) {
newState.currentLooseValue = newState.currentLooseValue.slice(0, newState.selectionStart) + symbols.decimal + newState.currentLooseValue.slice(newState.selectionEnd);
newState.selectionStart = newState.selectionEnd = newState.selectionStart + 1;
newState = utils_1.sanitizeNumber(newState, this.$props.format, this._intl);
}
NumericTextBox.prototype.emitBlur = function (e) {
this.$emit('blur', e);
};
break;
NumericTextBox.prototype.handleFocus = function (_) {
this.focused = true;
};
default:
return;
}
NumericTextBox.prototype.handleBlur = function (_) {
this.focused = false;
};
event.preventDefault();
this.triggerChange(event, newState);
},
spinnersWrapperMouseDown: function spinnersWrapperMouseDown(e) {
if (document && this._input) {
e.preventDefault();
Object.defineProperty(NumericTextBox.prototype, "spanClassNames", {
get: function get() {
var isValid = !this.hasMounted || !this.$props.validityStyles || this.validity().valid;
return {
'k-textbox-container': true,
'k-state-focused': this.focused,
'k-state-empty': !(this.computedValue || this.$props.placeholder || this.isEmpty),
'k-state-invalid': !isValid && isValid !== undefined,
'k-rtl': this.$props.dir === 'rtl'
};
},
enumerable: true,
configurable: true
});
Object.defineProperty(NumericTextBox.prototype, "wrapperClassNames", {
get: function get() {
var isValid = !this.$props.validityStyles || this.validity().valid;
return {
'k-numeric-wrap': true,
'k-state-disabled': this.$props.disabled,
'k-state-invalid': !isValid || this.isInvalid
};
},
enumerable: true,
configurable: true
});
/**
* @hidden
*/
if (document.activeElement !== this._input) {
this._input.focus();
}
}
}
},
// @ts-ignore
NumericTextBox.prototype.render = function (h) {
render: function render(h) {
var inputId = this.$props.id || this._inputId;
var localizationService = kendo_vue_intl_1.provideLocalizationService(this);
if (this.$props.value !== undefined && this.$props.value !== this.currentValue) {
this.currentValue = this.$props.value;
if (this.$props.value !== undefined && this.$props.value !== this.$data.currentValue) {
this.$data.currentValue = this.$props.value;
}
this._prevLooseValue = this.looseValue;
var numerictextbox = h("span", {

@@ -315,3 +422,3 @@ attrs: {

id: inputId,
"aria-valuenow": this.currentValue !== null ? this.currentValue : undefined,
"aria-valuenow": this.$data.currentValue !== null ? this.$data.currentValue : undefined,
name: this.$props.name

@@ -321,3 +428,3 @@ },

domProps: {
"value": this.valueAsLocalString
"value": this.looseValue
},

@@ -329,3 +436,4 @@ on: {

"focus": this.emitFocus,
"blur": this.emitBlur
"blur": this.emitBlur,
"paste": this.onPasteHandler
},

@@ -378,311 +486,4 @@ ref: 'input'

}, [this.$props.label]) : null]) : numerictextbox;
};
NumericTextBox.prototype.setValidity = function () {
if (this.input && this.input.setCustomValidity) {
this.input.setCustomValidity(this.validity().valid ? '' : this.$props.validationMessage || VALIDATION_MESSAGE);
}
};
NumericTextBox.prototype.formatNumber = function (value) {
if (value == null) {
return '';
}
return this.intl.formatNumber(value, this.$props.format).toString(); // the second argument actually supports null/undefined
};
NumericTextBox.prototype.parseNumber = function (text) {
return this.intl.parseNumber(text, this.$props.format);
};
NumericTextBox.prototype.elementChange = function (event) {
var _this = this;
if (!this.input) {
return;
}
var element = this.input;
var newState = {
value: this.currentValue,
looselyFormattedText: element.value,
selectionStart: this.input.selectionStart,
selectionEnd: this.input.selectionEnd,
decimalSelect: false
};
var text = element.value; // do NOT use 'event.target.value', always use 'element.value'
var minusSign = this.symbols.minusSign;
if (text === minusSign) {
newState.value = null;
this.triggerChange(newState, event);
return;
}
if (text.split(minusSign).length !== this.textBeforeInput.split(minusSign).length && text.length === this.textBeforeInput.length + minusSign.length) {
// positive/negative change
newState.value = -this.parseNumber(this.textBeforeInput);
this.triggerChange(newState, event);
return;
}
var decimal = this.symbols.decimal;
if (text.split(RegExp('\\' + decimal)).length > 2) {
// prevent typing second decimal separator
newState.decimalSelect = true;
this.triggerChange(newState, event);
return;
}
if (text.length > 1 && text.indexOf(decimal) === -1 && this.textBeforeInput.indexOf(decimal) >= 0 && text.length + decimal.length === this.textBeforeInput.length) {
// prevent deleting of decimal separator on its own
newState.decimalSelect = true;
this.triggerChange(newState, event);
return;
}
var value = this.parseNumber(text);
if (value === this.currentValue && text.length > 0 && text[text.length - 1] === decimal) {
if ((this.formatNumber(1.1) || '').toString().indexOf(decimal) > -1) {
newState.looselyFormattedText = text;
this.triggerChange(newState, event);
return;
}
}
var invalid = (value === null || isNaN(value)) && text.length > 0 && text !== this.symbols.minusSign;
var wrapper = this.elementWrapper;
if (text.length > this.textBeforeInput.length && this.parseNumber(text) === this.parseNumber(text.slice(0, element.selectionStart)) && (this.parseNumber(text.slice(element.selectionStart - 1)) === null || isNaN(this.parseNumber(text.slice(element.selectionStart - 1))))) {
invalid = true;
}
if (invalid) {
// block typing of invalid characters
if (wrapper && wrapper.className.indexOf("k-state-invalid") === -1) {
this.isInvalid = true;
setTimeout(function () {
_this.isInvalid = false;
}, 50);
}
newState.looselyFormattedText = this.textBeforeInput;
newState.selectionStart = newState.selectionEnd = element.selectionEnd + this.textBeforeInput.length - element.value.length;
this.triggerChange(newState, event);
return;
}
newState.value = value;
this.triggerChange(newState, event);
};
NumericTextBox.prototype.nonInputActions = function (value, event) {
var newState = {
value: value,
looselyFormattedText: null,
selectionStart: 0,
selectionEnd: 0,
decimalSelect: false
};
this.triggerChange(newState, event);
};
NumericTextBox.prototype.triggerChange = function (newState, event) {
if (this.$props.disabled) {
return;
} // decimals ranging based on the format:
this.valueDuringOnChange = this.ranged(this.parseNumber(this.formatNumber(this.ranged(newState.value)))); // const value = newState.value;
var shouldFireEvent = this.valueDuringOnChange !== this.currentValue;
if (this.$props.value !== undefined) {
// controlled
this.currentValue = this.$props.value;
} else {
// uncontrolled
this.currentValue = this.valueDuringOnChange;
}
this.looselyFormattedText = newState.looselyFormattedText;
this.selectionStart = newState.selectionStart;
this.selectionEnd = newState.selectionEnd;
this.decimalSelect = newState.decimalSelect;
if (shouldFireEvent) {
this.$emit('change', {
event: event,
value: this.valueDuringOnChange,
component: this,
target: {
name: this.$props.name,
value: this.valueDuringOnChange
},
validity: this.validity()
});
this.$emit('changemodel', this.valueDuringOnChange);
}
this.valueDuringOnChange = undefined;
};
NumericTextBox.prototype.ranged = function (value) {
if (value == null) {
return value;
}
if (!(value > 1 || value < 1 || value === 1)) {
// null, undefined or NaN
return null;
}
if (this.$props.max !== undefined && this.$props.min !== undefined && this.$props.max < this.$props.min) {
return null;
} // TODO: This should be something improved like
// while (value < max) { value *= 10 }
// and the selection should be adjusted
// to get good experience when typing values in ranges like [222,11111]
if (this.$props.max !== undefined && value > this.$props.max) {
value = this.$props.max;
}
if (this.$props.min !== undefined && value < this.$props.min) {
value = this.$props.min;
}
return value;
};
NumericTextBox.prototype.increase = function (event) {
this.nonInputActions((this.currentValue || 0) + (this.$props.step || 0), event);
};
NumericTextBox.prototype.decrease = function (event) {
this.nonInputActions((this.currentValue || 0) - (this.$props.step || 0), event);
};
NumericTextBox.prototype.wheel = function (event) {
if (!document || document.activeElement !== this.input || !this.input) {
return;
}
if (event.deltaY < 0) {
event.preventDefault();
this.increase(event);
}
if (event.deltaY > 0) {
event.preventDefault();
this.decrease(event);
}
};
NumericTextBox.prototype.keyDown = function (event) {
switch (event.keyCode) {
case 38:
// arrow up
this.increase(event);
break;
case 40:
// arrow down
this.decrease(event);
break;
case 110:
// numpad decimal key
var element = this.input;
if (element) {
var text = element.value;
var selectionStart = element.selectionStart,
selectionEnd = element.selectionEnd;
element.value = text.slice(0, selectionStart) + this.symbols.decimal + text.slice(selectionEnd);
element.selectionStart = element.selectionEnd = selectionStart + 1;
this.elementChange(event); // TODO: remove this call (use triggerChange directly with custom state)
}
break;
default:
return;
}
event.preventDefault();
};
NumericTextBox.prototype.spinnersWrapperMouseDown = function (e) {
if (document && this.input) {
e.preventDefault();
if (document.activeElement !== this.input) {
this.input.focus();
}
}
};
NumericTextBox = __decorate([vue_class_component_1.default({
model: {
event: 'changemodel'
},
inheritAttrs: false,
props: {
value: Number,
defaultValue: Number,
step: {
type: Number,
default: 1
},
format: [String, Object],
tabIndex: Number,
accessKey: String,
title: String,
placeholder: String,
min: Number,
max: Number,
spinners: {
type: Boolean,
default: true
},
disabled: {
type: Boolean,
default: false
},
dir: String,
name: String,
label: String,
validationMessage: String,
validityStyles: {
type: Boolean,
default: true
},
valid: {
type: Boolean,
default: undefined
},
required: {
type: Boolean,
default: false
},
id: String
},
inject: {
kendoIntlService: {
default: null
},
kendoLocalizationService: {
default: null
}
}
})], NumericTextBox);
return NumericTextBox;
}(kendo_vue_common_1.VueComponent);
}
};
exports.NumericTextBox = NumericTextBox;

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

System.register("@progress/kendo-vue-inputs",["@progress/kendo-vue-common","vue-class-component","@progress/kendo-vue-intl"],function(s){var r,o,l;function e(t){return t.__useDefault?t.default:t}return{setters:[function(t){r=e(t)},function(t){o=e(t)},function(t){l=e(t)}],execute:function(){function a(t){if(n[t])return n[t].exports;var e=n[t]={i:t,l:!1,exports:{}};return i[t].call(e.exports,e,e.exports,a),e.l=!0,e.exports}var i,n;n={},a.m=i=[function(t,e){t.exports=r},function(t,i,e){"use strict";function n(t){for(var e in t)i.hasOwnProperty(e)||(i[e]=t[e])}Object.defineProperty(i,"__esModule",{value:!0}),n(e(2)),n(e(3)),function(t){for(var e in t)s(e,t[e])}(i)},function(t,e,i){"use strict";var o=function(){return(o=Object.assign||function(t){for(var e,i=1,n=arguments.length;i<n;i++)for(var a in e=arguments[i])Object.prototype.hasOwnProperty.call(e,a)&&(t[a]=e[a]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0});var l=i(0),n={model:{event:"changemodel"},inheritAttrs:!1,props:{defaultValue:{type:[String,Number],default:""},value:{type:[String,Number]},label:{type:String},placeholder:{type:String},required:{type:Boolean,default:!1},dir:{type:String},valid:{type:Boolean,default:void 0},validate:{type:Boolean},validationMessage:{type:String},validityStyles:{type:Boolean,default:!0}},data:function(){return{hasMounted:!1,autofill:!1,currentValue:"",valueDuringOnChange:"",input:null,inputId:l.guid(),focused:!1}},created:function(){this.$data.valueDuringOnChange=void 0,this.$data.currentValue=this.$props.defaultValue},mounted:function(){this.$data.input=this.$refs.input,this.$data.hasMounted=!0},updated:function(){this.setValidity()},render:function(t){var e=this.$props,i=e.label,n=e.id,a=e.required,s=n||this.$data.inputId,r=t("input",{domProps:o(o({},this.$attrs),{placeholder:this.$props.placeholder,id:s,required:a,value:this.computedValue}),class:o({},this.inputClassNames()),ref:"input",on:{change:this.handleChange,focus:this.emitFocus,blur:this.emitBlur,input:this.$listeners.input||this.$listeners.changemodel?this.handleInput:l.noop,animationstart:this.handleAutoFill,animationend:this.handleAutoFillEnd}});return i?t("span",{class:this.spanClassNames,on:{focusin:this.handleFocus,focusout:this.handleBlur},attrs:{dir:this.$props.dir}},[r,i?n?t("label",{attrs:{for:n},class:"k-label"},[i]):t("span",{class:"k-label"},[i]):null]):r},methods:{emitFocus:function(t){this.$emit("focus",t)},emitBlur:function(t){this.$emit("blur",t)},handleBlur:function(t){this.$data.focused=!1},handleFocus:function(t){this.$data.focused=!0},focus:function(){this.$data.input&&this.$data.input.focus()},inputClassNames:function(){var t=!this.$data.hasMounted||!this.$props.validityStyles||this.validity().valid;return{"k-textbox":!0,"k-state-invalid":!t&&void 0!==t}},validity:function(){var t={badInput:!!this.$data.input&&this.$data.input.validity.badInput,patternMismatch:!!this.$data.input&&this.$data.input.validity.patternMismatch,rangeOverflow:!!this.$data.input&&this.$data.input.validity.rangeOverflow,rangeUnderflow:!!this.$data.input&&this.$data.input.validity.rangeUnderflow,stepMismatch:!!this.$data.input&&this.$data.input.validity.stepMismatch,tooLong:!!this.$data.input&&this.$data.input.validity.tooLong,typeMismatch:!!this.$data.input&&this.$data.input.validity.typeMismatch,valueMissing:!!this.$data.input&&this.$data.input.validity.valueMissing};return o(o({},t),{customError:void 0!==this.$props.validationMessage,valid:void 0!==this.$props.valid?this.$props.valid:!this.$data.input||!this.isInvalid(t)})},isInvalid:function(t){var e=!1;for(var i in t)t.hasOwnProperty(i)&&(e=e||t[i]);return e},setValidity:function(){this.$data.input&&this.$data.input.setCustomValidity&&this.$data.input.setCustomValidity(!this.validity().valid&&this.$props.validationMessage||"")},handleInput:function(t){this.$data.currentValue=t.target.value,this.$data.valueDuringOnChange=t.target.value,this.$nextTick(function(){this.$emit("input",{event:t,value:t.target.value,component:this,target:t.target,validity:this.validity()}),this.$emit("changemodel",t.target.value),this.$data.valueDuringOnChange=void 0})},handleChange:function(t){this.$data.currentValue=t.target.value,this.$data.valueDuringOnChange=t.target.value,this.$nextTick(function(){this.$emit("change",{event:t,value:t.target.value,component:this,target:t.target,validity:this.validity()}),this.$emit("changemodel",t.target.value),this.$data.valueDuringOnChange=void 0})},handleAutoFill:function(t){if("autoFillStart"===t.animationName){var e=t.target.parentNode;e&&e.classList.contains("k-state-empty")&&(this.$data.autofill=!0)}},handleAutoFillEnd:function(t){"autoFillEnd"===t.animationName&&t.target.parentNode&&(this.$data.autofill=!1)},name:function(){return this.$props.name}},computed:{spanClassNames:{get:function(){var t=!this.$data.hasMounted||!this.$props.validityStyles||this.validity().valid;return{"k-floating-label-container":!0,"k-state-focused":this.$data.focused,"k-state-empty":!(0===this.computedValue||this.computedValue||this.$props.placeholder||this.$data.autofill),"k-autofill":this.$data.autofill,"k-state-invalid":!t&&void 0!==t,"k-rtl":"rtl"===this.$props.dir}}},computedValue:{get:function(){return void 0!==this.$data.valueDuringOnChange?this.$data.valueDuringOnChange:void 0!==this.$props.value?this.$props.value:this.$data.currentValue}}}};e.Input=n},function(t,e,i){"use strict";var n,l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},a=(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(t,e)},function(t,e){function i(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)});Object.defineProperty(e,"__esModule",{value:!0});var s,r,o=(r=i(4))&&r.__esModule?r:{default:r},u=i(5),p=i(0),h=i(6),d=(s=p.VueComponent,a(c,s),c.prototype.created=function(){this.looselyFormattedText=null,(this.valueDuringOnChange=void 0)!==this.$props.value?this.currentValue=this.$props.value:void 0!==this.$props.defaultValue?this.currentValue=this.$props.defaultValue:this.currentValue=null},c.prototype.mounted=function(){this.input=this.$refs.input,this.elementWrapper=this.$refs.elementWrapper,this.hasMounted=!0,this.input&&(this.textBeforeInput=this.input.value),this.setValidity()},Object.defineProperty(c.prototype,"computedValue",{get:function(){return void 0!==this.valueDuringOnChange?this.valueDuringOnChange:this.currentValue},enumerable:!0,configurable:!0}),c.prototype.validity=function(){var t=void 0!==this.$props.validationMessage,e=!this.$props.required||null!==this.computedValue;return{customError:t,valid:void 0!==this.$props.valid?this.$props.valid:e,valueMissing:null===this.computedValue}},c.prototype.focus=function(){this.input&&this.input.focus()},c.prototype.updated=function(){if((!document||document.activeElement===this.input)&&this.input&&null!==this.looselyFormattedText)if(this.input.value!==this.looselyFormattedText)this.input.selectionStart=this.selectionStart,this.input.selectionEnd=this.selectionEnd;else{var t=void 0,e=this.looselyFormattedText.indexOf(this.symbols.decimal);t=0<=e&&e<this.selectionStart?this.selectionEnd:this.selectionEnd-(this.looselyFormattedText.length-this.input.value.length);var i=this.input.value.indexOf(this.symbols.decimal);(this.decimalSelect||null===this.currentValue&&0<=i||-1===e&&0<=i)&&(t=this.selectionStart<i+2&&0<=e?i+1:i),this.decimalSelect||(t=this.selectionEnd-(this.looselyFormattedText.length-this.input.value.length)),this.looselyFormattedText[0]===this.symbols.decimal&&(t=void 0!==this.currentValue?this.formatNumber(this.currentValue).length:0),this.input.selectionStart=this.input.selectionEnd=t}this.input&&(this.textBeforeInput=this.input.value),this.setValidity()},Object.defineProperty(c.prototype,"valueAsLocalString",{get:function(){return this.intl=u.provideIntlService(this),this.symbols=this.intl.numberSymbols(),null!==this.looselyFormattedText&&!this.decimalSelect&&this.parseNumber(this.looselyFormattedText)===this.currentValue&&this.formatNumber(this.currentValue).length<this.looselyFormattedText.length&&0===this.looselyFormattedText.indexOf(this.formatNumber(this.currentValue))?this.looselyFormattedText:this.formatNumber(this.currentValue)},enumerable:!0,configurable:!0}),c.prototype.emitFocus=function(t){this.$emit("focus",t)},c.prototype.emitBlur=function(t){this.$emit("blur",t)},c.prototype.handleFocus=function(t){this.focused=!0},c.prototype.handleBlur=function(t){this.focused=!1},Object.defineProperty(c.prototype,"spanClassNames",{get:function(){var t=!this.hasMounted||!this.$props.validityStyles||this.validity().valid;return{"k-textbox-container":!0,"k-state-focused":this.focused,"k-state-empty":!(this.computedValue||this.$props.placeholder||this.isEmpty),"k-state-invalid":!t&&void 0!==t,"k-rtl":"rtl"===this.$props.dir}},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"wrapperClassNames",{get:function(){var t=!this.$props.validityStyles||this.validity().valid;return{"k-numeric-wrap":!0,"k-state-disabled":this.$props.disabled,"k-state-invalid":!t||this.isInvalid}},enumerable:!0,configurable:!0}),c.prototype.render=function(t){var e=this.$props.id||this._inputId,i=u.provideLocalizationService(this);void 0!==this.$props.value&&this.$props.value!==this.currentValue&&(this.currentValue=this.$props.value);var n=t("span",{attrs:{dir:this.$props.dir,"aria-disabled":this.$props.disabled?"true":void 0},class:"k-widget k-numerictextbox"},[t("span",{class:this.wrapperClassNames,ref:"elementWrapper"},[t("input",{attrs:{tabIndex:this.$props.tabIndex,accessKey:this.$props.accessKey,disabled:this.$props.disabled,title:this.$props.title,"aria-valuemin":this.$props.min,"aria-valuemax":this.$props.max,placeholder:this.$props.placeholder,type:this.$props.inputType||"tel",spellCheck:!1,autoComplete:"off",autoCorrect:"off",id:e,"aria-valuenow":null!==this.currentValue?this.currentValue:void 0,name:this.$props.name},class:"k-input k-formatted-value",domProps:{value:this.valueAsLocalString},on:{wheel:this.wheel,keydown:this.keyDown,input:this.elementChange,focus:this.emitFocus,blur:this.emitBlur},ref:"input"}),this.$slots.default,this.$props.spinners&&t("span",{class:"k-select",on:{mousedown:this.spinnersWrapperMouseDown}},[t("span",{class:"k-link k-link-increase",attrs:{"aria-label":i.toLanguageString(h.numericIncreaseValue,h.messages[h.numericIncreaseValue]),title:i.toLanguageString(h.numericIncreaseValue,h.messages[h.numericIncreaseValue])},on:{click:this.increase}},[t("span",{class:"k-icon k-i-arrow-n"})]),t("span",{class:"k-link k-link-decrease",attrs:{"aria-label":i.toLanguageString(h.numericDecreaseValue,h.messages[h.numericDecreaseValue]),title:i.toLanguageString(h.numericDecreaseValue,h.messages[h.numericDecreaseValue])},on:{click:this.decrease}},[t("span",{class:"k-icon k-i-arrow-s"})])])])]);return this.$props.label?t("span",{class:this.spanClassNames,on:{focusin:this.handleFocus,focusout:this.handleBlur},attrs:{dir:this.$props.dir}},[n,this.$props.label?this.$props.id?t("label",{attrs:{for:this.$props.id},class:"k-label"},[this.$props.label]):t("span",{class:"k-label"},[this.$props.label]):null]):n},c.prototype.setValidity=function(){this.input&&this.input.setCustomValidity&&this.input.setCustomValidity(this.validity().valid?"":this.$props.validationMessage||"Please enter a valid value!")},c.prototype.formatNumber=function(t){return null==t?"":this.intl.formatNumber(t,this.$props.format).toString()},c.prototype.parseNumber=function(t){return this.intl.parseNumber(t,this.$props.format)},c.prototype.elementChange=function(t){var e=this;if(this.input){var i=this.input,n={value:this.currentValue,looselyFormattedText:i.value,selectionStart:this.input.selectionStart,selectionEnd:this.input.selectionEnd,decimalSelect:!1},a=i.value,s=this.symbols.minusSign;if(a===s)return n.value=null,void this.triggerChange(n,t);if(a.split(s).length!==this.textBeforeInput.split(s).length&&a.length===this.textBeforeInput.length+s.length)return n.value=-this.parseNumber(this.textBeforeInput),void this.triggerChange(n,t);var r=this.symbols.decimal;if(2<a.split(RegExp("\\"+r)).length)return n.decimalSelect=!0,void this.triggerChange(n,t);if(1<a.length&&-1===a.indexOf(r)&&0<=this.textBeforeInput.indexOf(r)&&a.length+r.length===this.textBeforeInput.length)return n.decimalSelect=!0,void this.triggerChange(n,t);var o=this.parseNumber(a);if(o===this.currentValue&&0<a.length&&a[a.length-1]===r&&-1<(this.formatNumber(1.1)||"").toString().indexOf(r))return n.looselyFormattedText=a,void this.triggerChange(n,t);var l=(null===o||isNaN(o))&&0<a.length&&a!==this.symbols.minusSign,u=this.elementWrapper;if(a.length>this.textBeforeInput.length&&this.parseNumber(a)===this.parseNumber(a.slice(0,i.selectionStart))&&(null===this.parseNumber(a.slice(i.selectionStart-1))||isNaN(this.parseNumber(a.slice(i.selectionStart-1))))&&(l=!0),l)return u&&-1===u.className.indexOf("k-state-invalid")&&(this.isInvalid=!0,setTimeout(function(){e.isInvalid=!1},50)),n.looselyFormattedText=this.textBeforeInput,n.selectionStart=n.selectionEnd=i.selectionEnd+this.textBeforeInput.length-i.value.length,void this.triggerChange(n,t);n.value=o,this.triggerChange(n,t)}},c.prototype.nonInputActions=function(t,e){var i={value:t,looselyFormattedText:null,selectionStart:0,selectionEnd:0,decimalSelect:!1};this.triggerChange(i,e)},c.prototype.triggerChange=function(t,e){if(!this.$props.disabled){this.valueDuringOnChange=this.ranged(this.parseNumber(this.formatNumber(this.ranged(t.value))));var i=this.valueDuringOnChange!==this.currentValue;void 0!==this.$props.value?this.currentValue=this.$props.value:this.currentValue=this.valueDuringOnChange,this.looselyFormattedText=t.looselyFormattedText,this.selectionStart=t.selectionStart,this.selectionEnd=t.selectionEnd,this.decimalSelect=t.decimalSelect,i&&(this.$emit("change",{event:e,value:this.valueDuringOnChange,component:this,target:{name:this.$props.name,value:this.valueDuringOnChange},validity:this.validity()}),this.$emit("changemodel",this.valueDuringOnChange)),this.valueDuringOnChange=void 0}},c.prototype.ranged=function(t){return null==t?t:!(1<t||t<1||1===t)||void 0!==this.$props.max&&void 0!==this.$props.min&&this.$props.max<this.$props.min?null:(void 0!==this.$props.max&&t>this.$props.max&&(t=this.$props.max),void 0!==this.$props.min&&t<this.$props.min&&(t=this.$props.min),t)},c.prototype.increase=function(t){this.nonInputActions((this.currentValue||0)+(this.$props.step||0),t)},c.prototype.decrease=function(t){this.nonInputActions((this.currentValue||0)-(this.$props.step||0),t)},c.prototype.wheel=function(t){document&&document.activeElement===this.input&&this.input&&(t.deltaY<0&&(t.preventDefault(),this.increase(t)),0<t.deltaY&&(t.preventDefault(),this.decrease(t)))},c.prototype.keyDown=function(t){switch(t.keyCode){case 38:this.increase(t);break;case 40:this.decrease(t);break;case 110:var e=this.input;if(e){var i=e.value,n=e.selectionStart,a=e.selectionEnd;e.value=i.slice(0,n)+this.symbols.decimal+i.slice(a),e.selectionStart=e.selectionEnd=n+1,this.elementChange(t)}break;default:return}t.preventDefault()},c.prototype.spinnersWrapperMouseDown=function(t){document&&this.input&&(t.preventDefault(),document.activeElement!==this.input&&this.input.focus())},function(t,e,i,n){var a,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"===("undefined"==typeof Reflect?"undefined":l(Reflect))&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;0<=o;o--)(a=t[o])&&(r=(s<3?a(r):3<s?a(e,i,r):a(e,i))||r);return 3<s&&r&&Object.defineProperty(e,i,r),r}([o.default({model:{event:"changemodel"},inheritAttrs:!1,props:{value:Number,defaultValue:Number,step:{type:Number,default:1},format:[String,Object],tabIndex:Number,accessKey:String,title:String,placeholder:String,min:Number,max:Number,spinners:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},dir:String,name:String,label:String,validationMessage:String,validityStyles:{type:Boolean,default:!0},valid:{type:Boolean,default:void 0},required:{type:Boolean,default:!1},id:String},inject:{kendoIntlService:{default:null},kendoLocalizationService:{default:null}}})],c));function c(){var t=null!==s&&s.apply(this,arguments)||this;return t.hasMounted=!1,t.isInvalid=!1,t.isEmpty=!1,t.currentValue=0,t.valueDuringOnChange=0,t.looselyFormattedText="",t.selectionStart=0,t.selectionEnd=0,t.decimalSelect=!1,t.focused=!1,t.textBeforeInput="",t._inputId=p.guid(),t}e.NumericTextBox=d},function(t,e){t.exports=o},function(t,e){t.exports=l},function(t,e,i){"use strict";var n;Object.defineProperty(e,"__esModule",{value:!0}),e.numericIncreaseValue="numerictextbox.increment",e.numericDecreaseValue="numerictextbox.decrement",e.sliderIncreaseValue="slider.increment",e.sliderDecreaseValue="slider.decrement",e.sliderDragTitle="slider.dragTitle",e.colorGradientR="colorGradient.r",e.colorGradientG="colorGradient.g",e.colorGradientB="colorGradient.b",e.colorGradientA="colorGradient.a",e.colorGradientHex="colorGradient.hex",e.messages=((n={})[e.numericIncreaseValue]="Increase value",n[e.numericDecreaseValue]="Decrease value",n[e.sliderIncreaseValue]="Increase",n[e.sliderDecreaseValue]="Decrease",n[e.sliderDragTitle]="Drag",n[e.colorGradientR]="r",n[e.colorGradientG]="g",n[e.colorGradientB]="b",n[e.colorGradientA]="a",n[e.colorGradientHex]="hex",n)}],a.c=n,a.d=function(t,e,i){a.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},a.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},a.t=function(e,t){if(1&t&&(e=a(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(a.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)a.d(i,n,function(t){return e[t]}.bind(null,n));return i},a.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return a.d(e,"a",e),e},a.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},a.p="",a(a.s=1)}}});
System.register("@progress/kendo-vue-inputs",["@progress/kendo-vue-common","@progress/kendo-vue-intl"],function(r){var s,u;function t(e){return e.__useDefault?e.default:e}return{setters:[function(e){s=t(e)},function(e){u=t(e)}],execute:function(){function n(e){if(i[e])return i[e].exports;var t=i[e]={i:e,l:!1,exports:{}};return a[e].call(t.exports,t,t.exports,n),t.l=!0,t.exports}var a,i;i={},n.m=a=[function(e,t){e.exports=s},function(e,a,t){"use strict";function i(e){for(var t in e)a.hasOwnProperty(t)||(a[t]=e[t])}Object.defineProperty(a,"__esModule",{value:!0}),i(t(2)),i(t(3)),function(e){for(var t in e)r(t,e[t])}(a)},function(e,t,a){"use strict";var u=function(){return(u=Object.assign||function(e){for(var t,a=1,i=arguments.length;a<i;a++)for(var n in t=arguments[a])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}).apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0});var o=a(0),i={model:{event:"changemodel"},inheritAttrs:!1,props:{defaultValue:{type:[String,Number],default:""},value:{type:[String,Number]},label:{type:String},placeholder:{type:String},required:{type:Boolean,default:!1},dir:{type:String},valid:{type:Boolean,default:void 0},validate:{type:Boolean},validationMessage:{type:String},validityStyles:{type:Boolean,default:!0}},data:function(){return{hasMounted:!1,autofill:!1,currentValue:"",valueDuringOnChange:"",input:null,inputId:o.guid(),focused:!1}},created:function(){this.$data.valueDuringOnChange=void 0,this.$data.currentValue=this.$props.defaultValue},mounted:function(){this.$data.input=this.$refs.input,this.$data.hasMounted=!0},updated:function(){this.setValidity()},render:function(e){var t=this.$props,a=t.label,i=t.id,n=t.required,r=i||this.$data.inputId,s=e("input",{domProps:u(u({},this.$attrs),{placeholder:this.$props.placeholder,id:r,required:n,value:this.computedValue}),class:u({},this.inputClassNames()),ref:"input",on:{change:this.handleChange,focus:this.emitFocus,blur:this.emitBlur,input:this.$listeners.input||this.$listeners.changemodel?this.handleInput:o.noop,animationstart:this.handleAutoFill,animationend:this.handleAutoFillEnd}});return a?e("span",{class:this.spanClassNames,on:{focusin:this.handleFocus,focusout:this.handleBlur},attrs:{dir:this.$props.dir}},[s,a?i?e("label",{attrs:{for:i},class:"k-label"},[a]):e("span",{class:"k-label"},[a]):null]):s},methods:{emitFocus:function(e){this.$emit("focus",e)},emitBlur:function(e){this.$emit("blur",e)},handleBlur:function(e){this.$data.focused=!1},handleFocus:function(e){this.$data.focused=!0},focus:function(){this.$data.input&&this.$data.input.focus()},inputClassNames:function(){var e=!this.$data.hasMounted||!this.$props.validityStyles||this.validity().valid;return{"k-textbox":!0,"k-state-invalid":!e&&void 0!==e}},validity:function(){var e={badInput:!!this.$data.input&&this.$data.input.validity.badInput,patternMismatch:!!this.$data.input&&this.$data.input.validity.patternMismatch,rangeOverflow:!!this.$data.input&&this.$data.input.validity.rangeOverflow,rangeUnderflow:!!this.$data.input&&this.$data.input.validity.rangeUnderflow,stepMismatch:!!this.$data.input&&this.$data.input.validity.stepMismatch,tooLong:!!this.$data.input&&this.$data.input.validity.tooLong,typeMismatch:!!this.$data.input&&this.$data.input.validity.typeMismatch,valueMissing:!!this.$data.input&&this.$data.input.validity.valueMissing};return u(u({},e),{customError:void 0!==this.$props.validationMessage,valid:void 0!==this.$props.valid?this.$props.valid:!this.$data.input||!this.isInvalid(e)})},isInvalid:function(e){var t=!1;for(var a in e)e.hasOwnProperty(a)&&(t=t||e[a]);return t},setValidity:function(){this.$data.input&&this.$data.input.setCustomValidity&&this.$data.input.setCustomValidity(!this.validity().valid&&this.$props.validationMessage||"")},handleInput:function(e){this.$data.currentValue=e.target.value,this.$data.valueDuringOnChange=e.target.value,this.$nextTick(function(){this.$emit("input",{event:e,value:e.target.value,component:this,target:e.target,validity:this.validity()}),this.$emit("changemodel",e.target.value),this.$data.valueDuringOnChange=void 0})},handleChange:function(e){this.$data.currentValue=e.target.value,this.$data.valueDuringOnChange=e.target.value,this.$nextTick(function(){this.$emit("change",{event:e,value:e.target.value,component:this,target:e.target,validity:this.validity()}),this.$emit("changemodel",e.target.value),this.$data.valueDuringOnChange=void 0})},handleAutoFill:function(e){if("autoFillStart"===e.animationName){var t=e.target.parentNode;t&&t.classList.contains("k-state-empty")&&(this.$data.autofill=!0)}},handleAutoFillEnd:function(e){"autoFillEnd"===e.animationName&&e.target.parentNode&&(this.$data.autofill=!1)},name:function(){return this.$props.name}},computed:{spanClassNames:{get:function(){var e=!this.$data.hasMounted||!this.$props.validityStyles||this.validity().valid;return{"k-floating-label-container":!0,"k-state-focused":this.$data.focused,"k-state-empty":!(0===this.computedValue||this.computedValue||this.$props.placeholder||this.$data.autofill),"k-autofill":this.$data.autofill,"k-state-invalid":!e&&void 0!==e,"k-rtl":"rtl"===this.$props.dir}}},computedValue:{get:function(){return void 0!==this.$data.valueDuringOnChange?this.$data.valueDuringOnChange:void 0!==this.$props.value?this.$props.value:this.$data.currentValue}}}};t.Input=i},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=a(4),i=a(0),r=a(5),u=a(6),s={model:{event:"changemodel"},inheritAttrs:!1,props:{value:Number,defaultValue:Number,step:{type:Number,default:1},format:[String,Object],tabIndex:Number,accessKey:String,title:String,placeholder:String,min:Number,max:Number,spinners:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},dir:String,name:String,label:String,validationMessage:String,validityStyles:{type:Boolean,default:!0},valid:{type:Boolean,default:void 0},required:{type:Boolean,default:!1},id:String},inject:{kendoIntlService:{default:null},kendoLocalizationService:{default:null}},data:function(){return{hasMounted:!1,isInvalid:!1,isEmpty:!1,currentValue:0,valueDuringOnChange:0,currentLooseValue:"",selectionStart:0,selectionEnd:0,decimalSelect:!1,focused:!1,forceUpdate:!1}},created:function(){this._textBeforeInput="",this._inputId=i.guid(),this.$data.currentLooseValue=null,this.$data.valueDuringOnChange=void 0,this._intl=n.provideIntlService(this),this._symbols=this._intl.numberSymbols(),void 0!==this.$props.value?this.$data.currentValue=this.$props.value:void 0!==this.$props.defaultValue?this.$data.currentValue=this.$props.defaultValue:this.$data.currentValue=null},mounted:function(){this._input=this.$refs.input,this._elementWrapper=this.$refs.elementWrapper,this.$data.hasMounted=!0,this._input&&(this._textBeforeInput=this._input.value),this.setValidity()},updated:function(){document&&document.activeElement!==this._input||!this._input||null===this.$data.currentLooseValue||this.$data.forceUpdate&&(this._input.selectionStart=this.$data.selectionStart,this._input.selectionEnd=this.$data.selectionEnd,this.$data.forceUpdate=!1),this._input&&(this._textBeforeInput=this._input.value),this.setValidity()},computed:{computedValue:{get:function(){return void 0!==this.$data.valueDuringOnChange?this.$data.valueDuringOnChange:this.$data.currentValue}},looseValue:{get:function(){return u.formatValue(this.$data.focused?this.$data.currentLooseValue:u.getStateOrPropsValue(this.$props.value,this.$data.currentValue),this.$props.format,this._intl)}},spanClassNames:{get:function(){var e=!this.$data.hasMounted||!this.$props.validityStyles||this.validity().valid;return{"k-textbox-container":!0,"k-state-focused":this.$data.focused,"k-state-empty":!(this.computedValue||this.$props.placeholder||this.$data.isEmpty),"k-state-invalid":!e&&void 0!==e,"k-rtl":"rtl"===this.$props.dir}}},wrapperClassNames:{get:function(){var e=!this.$props.validityStyles||this.validity().valid;return{"k-numeric-wrap":!0,"k-state-disabled":this.$props.disabled,"k-state-invalid":!e||this.$data.isInvalid}}}},methods:{validity:function(){var e=void 0!==this.$props.validationMessage,t=!this.$props.required||null!==this.computedValue;return{customError:e,valid:void 0!==this.$props.valid?this.$props.valid:t,valueMissing:null===this.computedValue}},focus:function(){this._input&&this._input.focus()},emitFocus:function(e){this.$data.currentLooseValue=this._prevLooseValue,this.$data.focused=!0,this.$emit("focus",e),this.$data.forceUpdate=!0},emitBlur:function(e){this.$data.eventValue=null,this.$data.prevLooseValue="",this.$data.currentLooseValue="",this.$data.focused=!1,this.$data.selectionStart=void 0,this.$data.selectionEnd=void 0,this.$data.decimalSelect=!1,this.$data.valueIsCorrected=!1,this.$data.valueIsOutOfRange=!1,this.$emit("blur",e),this.$data.forceUpdate=!0},handleFocus:function(e){this.$data.focused=!0},handleBlur:function(e){this.$data.focused=!1},setValidity:function(){this._input&&this._input.setCustomValidity&&this._input.setCustomValidity(this.validity().valid?"":this.$props.validationMessage||"Please enter a valid value!")},getCurrentState:function(){return{eventValue:u.getStateOrPropsValue(this.$props.value,this.$data.currentValue),prevLooseValue:this._prevLooseValue,currentLooseValue:this._input.value,selectionStart:this._input.selectionStart,selectionEnd:this._input.selectionEnd,decimalSelect:!1,valueIsCorrected:!1,valueIsOutOfRange:!1,isPaste:this._isPaste,focused:this.$data.focused}},parseNumber:function(e){return this._intl.parseNumber(e,this.$props.format)},elementChange:function(e){var t=this.getCurrentState();this._isPaste=!1,this.triggerChange(e,u.sanitizeNumber(t,this.$props.format,this._intl))},triggerChange:function(e,t){var a=this;if(!this.$props.disabled){this.$data.valueDuringOnChange=t.eventValue,this.$data.currentValue=t.eventValue;var i=u.formatValue(u.rangeValue(t.eventValue,this.$props.min,this.$props.max),this.$props.format,this._intl),n=u.rangeValue(this.parseNumber(i),this.$props.min,this.$props.max);if(n!==t.eventValue&&(t.valueIsOutOfRange=!0,t.eventValue=n),t.valueIsCorrected){var r=this._elementWrapper;r&&-1===r.className.indexOf("k-state-invalid")&&(this.$data.isInvalid=!0,setTimeout(function(){a.$data.isInvalid=!1},50))}var s=this.$props.value!==t.eventValue;void 0!==this.$props.value?this.$data.currentValue=this.$props.value:this.$data.currentValue=this.$data.valueDuringOnChange,this.$data.prevLooseValue=t.prevLooseValue,this.$data.currentLooseValue=t.currentLooseValue,this.$data.selectionStart=t.selectionStart,this.$data.selectionEnd=t.selectionEnd,this.$data.decimalSelect=t.decimalSelect,this.$data.valueIsCorrected=t.valueIsCorrected,this.$data.valueIsOutOfRange=t.valueIsOutOfRange,this.$data.focused=t.focused,this.$data.isPaste=t.isPaste,this.$data.forceUpdate=!this.$data.forceUpdate,s&&(this.$emit("change",{event:e,value:this.$data.valueDuringOnChange,component:this,target:{name:this.$props.name,value:this.$data.valueDuringOnChange},validity:this.validity()}),this.$emit("changemodel",this.$data.valueDuringOnChange)),this.$data.valueDuringOnChange=void 0}},onPasteHandler:function(e){this._isPaste=!0},increase:function(e){var t=this.getCurrentState();u.increaseValue(this.parseNumber(String(t.currentLooseValue)),t,this.$props.step,this.$props.min,this.$props.max,this.$props.format,this._intl),this.triggerChange(e,t)},decrease:function(e){var t=this.getCurrentState();u.decreaseValue(this.parseNumber(String(t.currentLooseValue)),t,this.$props.step,this.$props.min,this.$props.max,this.$props.format,this._intl),this.triggerChange(e,t)},wheel:function(e){document&&document.activeElement===this._input&&this._input&&(e.deltaY<0&&(e.preventDefault(),this.increase(e)),0<e.deltaY&&(e.preventDefault(),this.decrease(e)))},keyDown:function(e){var t=this.getCurrentState(),a=this.parseNumber(String(t.currentLooseValue));if(!(t.selectionEnd>t.selectionStart&&t.selectionEnd-t.selectionStart===String(t.currentLooseValue).length)){switch(e.keyCode){case 38:u.increaseValue(a,t,this.$props.step,this.$props.min,this.$props.max,this.$props.format,this._intl);break;case 40:u.decreaseValue(a,t,this.$props.step,this.$props.min,this.$props.max,this.$props.format,this._intl);break;case 13:var i=u.formatValue(u.rangeValue(a,this.$props.min,this.$props.max),this.$props.format,this._intl),n=u.rangeValue(this.parseNumber(i),this.$props.min,this.$props.max);t.eventValue=n,t.currentLooseValue=u.formatValue(n,this.$props.format,this._intl),t.selectionStart=t.selectionEnd=t.currentLooseValue.length;break;case 110:var r=this._input,s=this._intl.numberSymbols();r&&(t.currentLooseValue=t.currentLooseValue.slice(0,t.selectionStart)+s.decimal+t.currentLooseValue.slice(t.selectionEnd),t.selectionStart=t.selectionEnd=t.selectionStart+1,t=u.sanitizeNumber(t,this.$props.format,this._intl));break;default:return}e.preventDefault(),this.triggerChange(e,t)}},spinnersWrapperMouseDown:function(e){document&&this._input&&(e.preventDefault(),document.activeElement!==this._input&&this._input.focus())}},render:function(e){var t=this.$props.id||this._inputId,a=n.provideLocalizationService(this);void 0!==this.$props.value&&this.$props.value!==this.$data.currentValue&&(this.$data.currentValue=this.$props.value),this._prevLooseValue=this.looseValue;var i=e("span",{attrs:{dir:this.$props.dir,"aria-disabled":this.$props.disabled?"true":void 0},class:"k-widget k-numerictextbox"},[e("span",{class:this.wrapperClassNames,ref:"elementWrapper"},[e("input",{attrs:{tabIndex:this.$props.tabIndex,accessKey:this.$props.accessKey,disabled:this.$props.disabled,title:this.$props.title,"aria-valuemin":this.$props.min,"aria-valuemax":this.$props.max,placeholder:this.$props.placeholder,type:this.$props.inputType||"tel",spellCheck:!1,autoComplete:"off",autoCorrect:"off",id:t,"aria-valuenow":null!==this.$data.currentValue?this.$data.currentValue:void 0,name:this.$props.name},class:"k-input k-formatted-value",domProps:{value:this.looseValue},on:{wheel:this.wheel,keydown:this.keyDown,input:this.elementChange,focus:this.emitFocus,blur:this.emitBlur,paste:this.onPasteHandler},ref:"input"}),this.$slots.default,this.$props.spinners&&e("span",{class:"k-select",on:{mousedown:this.spinnersWrapperMouseDown}},[e("span",{class:"k-link k-link-increase",attrs:{"aria-label":a.toLanguageString(r.numericIncreaseValue,r.messages[r.numericIncreaseValue]),title:a.toLanguageString(r.numericIncreaseValue,r.messages[r.numericIncreaseValue])},on:{click:this.increase}},[e("span",{class:"k-icon k-i-arrow-n"})]),e("span",{class:"k-link k-link-decrease",attrs:{"aria-label":a.toLanguageString(r.numericDecreaseValue,r.messages[r.numericDecreaseValue]),title:a.toLanguageString(r.numericDecreaseValue,r.messages[r.numericDecreaseValue])},on:{click:this.decrease}},[e("span",{class:"k-icon k-i-arrow-s"})])])])]);return this.$props.label?e("span",{class:this.spanClassNames,on:{focusin:this.handleFocus,focusout:this.handleBlur},attrs:{dir:this.$props.dir}},[i,this.$props.label?this.$props.id?e("label",{attrs:{for:this.$props.id},class:"k-label"},[this.$props.label]):e("span",{class:"k-label"},[this.$props.label]):null]):i}};t.NumericTextBox=s},function(e,t){e.exports=u},function(e,t,a){"use strict";var i;Object.defineProperty(t,"__esModule",{value:!0}),t.numericIncreaseValue="numerictextbox.increment",t.numericDecreaseValue="numerictextbox.decrement",t.sliderIncreaseValue="slider.increment",t.sliderDecreaseValue="slider.decrement",t.sliderDragTitle="slider.dragTitle",t.colorGradientR="colorGradient.r",t.colorGradientG="colorGradient.g",t.colorGradientB="colorGradient.b",t.colorGradientA="colorGradient.a",t.colorGradientHex="colorGradient.hex",t.messages=((i={})[t.numericIncreaseValue]="Increase value",i[t.numericDecreaseValue]="Decrease value",i[t.sliderIncreaseValue]="Increase",i[t.sliderDecreaseValue]="Decrease",i[t.sliderDragTitle]="Drag",i[t.colorGradientR]="r",i[t.colorGradientG]="g",i[t.colorGradientB]="b",i[t.colorGradientA]="a",i[t.colorGradientHex]="hex",i)},function(e,F,t){"use strict";var G=function(){return(G=Object.assign||function(e){for(var t,a=1,i=arguments.length;a<i;a++)for(var n in t=arguments[a])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}).apply(this,arguments)};Object.defineProperty(F,"__esModule",{value:!0});var A=/\d/;F.getInitialState=function(){return{eventValue:null,prevLooseValue:"",currentLooseValue:"",focused:!1,selectionStart:void 0,selectionEnd:void 0,decimalSelect:!1,valueIsCorrected:!1,valueIsOutOfRange:!1}},F.getStateOrPropsValue=function(e,t){return void 0!==e?e:t},F.formatValue=function(e,t,a){return null===e&&void 0===e?"":"string"==typeof e?e:a.formatNumber(e,t)},F.increaseValue=function(e,t,a,i,n,r,s){var u=F.rangeValue((e||0)+(a||0),i,n);t.eventValue=u,t.currentLooseValue=F.formatValue(u,r,s),t.selectionStart=t.selectionEnd=F.getLastNumberIndex(t.currentLooseValue,A)},F.decreaseValue=function(e,t,a,i,n,r,s){var u=F.rangeValue((e||0)-(a||0),i,n);t.eventValue=u,t.currentLooseValue=F.formatValue(u,r,s),t.selectionStart=t.selectionEnd=F.getLastNumberIndex(t.currentLooseValue,A)},F.rangeValue=function(e,t,a){return null==e?e:!(1<e||e<1||1===e)||void 0!==a&&void 0!==t&&a<t?null:(void 0!==a&&a<e&&(e=a),void 0!==t&&e<t&&(e=t),e)},F.getMaxCursorPosition=function(a,e){var t=e.findIndex(function(e){e[0];var t=e[1];return Boolean(t)&&a.indexOf(t)===a.length-t.length});if(-1===t)return-1;var i=e[t][1];return a.length-i.length},F.getMinCursorPosition=function(a,e){var t=e.findIndex(function(e){var t=e[0];return e[1],Boolean(t)&&0===a.indexOf(t)});return-1===t?-1:e[t][0].length},F.rangeSelection=function(e,t,a){var i=F.getMaxCursorPosition(e,t);if(-1!==i&&a.selectionStart>i)a.selectionStart=a.selectionEnd=i;else{a.selectionStart>e.length&&(a.selectionStart=a.selectionEnd=e.length);var n=F.getMinCursorPosition(e,t);-1!==n&&a.selectionStart<n&&(a.selectionStart=a.selectionEnd=n),-1===a.selectionStart&&(a.selectionStart=a.selectionEnd=0)}},F.setSelection=function(e,t,a,i){e.selectionStart=e.selectionEnd=t,F.rangeSelection(a,i,e)},F.setInvalid=function(e,t,a,i){e.eventValue=i.parseNumber(e.prevLooseValue,t),e.currentLooseValue=e.prevLooseValue,e.valueIsCorrected=!0,F.setSelection(e,e.selectionStart,e.currentLooseValue,a)},F.isMinusSymbolAdded=function(e,t){var a=String(e.currentLooseValue),i=String(e.prevLooseValue);return a.split(t.minusSign).length!==i.split(t.minusSign).length&&a.length===i.length+t.minusSign.length},F.isDecimalDuplicated=function(e,t){return 2<String(e.currentLooseValue).split(t.decimal).length},F.getFormatPrefixSufix=function(e,t){var a=t.formatNumber(1111111.1111111,e),i=t.formatNumber(-1111111.1111111,e),n=t.formatNumber(0,e),r=t.formatNumber(1,e),s=F.getPrefix(a),u=F.getPrefix(i),o=F.getPrefix(n),l=F.getPrefix(r);return{positiveInfo:[s,F.getSuffix(a)],negativeInfo:[u,F.getSuffix(i)],zeroInfo:[o,F.getSuffix(n)],oneInfo:[l,F.getSuffix(r)]}},F.getFormatSymbols=function(e,t){var a=t.formatNumber(1111111.1111111,e),i=t.formatNumber(-1111111.1111111,e),n=t.formatNumber(0,e),r=t.formatNumber(1,e),s=t.numberSymbols(),u=new RegExp("[\\d\\"+s.decimal+s.group+"]","g");return[a,i,n,r].map(function(e){return e.replace(u,"")}).join("").split("").filter(function(e,t,a){return a.indexOf(e)===t}).join("")},F.getInitialPosition=function(e,t){var a=e.indexOf(t.decimal);return-1<a?a:F.getLastNumberIndex(e,A)},F.reverseString=function(e){return e.split("").reverse().join("")},F.getLastNumberIndex=function(e,t){return e.length-F.reverseString(e).search(t)},F.getPrefix=function(e){return e.split(e[e.search(A)])[0]},F.getSuffix=function(e){var t=F.reverseString(e);return F.reverseString(t.split(t[t.search(A)])[0])},F.getFirstNumberIndex=function(e,t){return e.search(t)},F.getDecimalCount=function(e,t){var a=e.indexOf(t);return-1<a?e.length-a-1:0},F.changeBasedSelection=function(e,t,a,i,n){var r="0"===e.replace(n,"")[0],s="0"===t.replace(n,"")[0];if(r&&!s)return a-1;if(s&&i)return a+1;for(var u=0,o=0;o<a;o++)A.test(e.charAt(o))&&u++;for(var l=0;0<u&&t.length>l;)A.test(t.charAt(l))&&u--,l++;return l},F.sanitizeNumber=function(e,t,a){var i=G({},e),n=i.prevLooseValue,l=a.numberSymbols(),r=F.getFormatSymbols(t,a),d=String(i.currentLooseValue),s=String(n),u=new RegExp("[^\\d\\"+l.decimal+"]","g"),o=new RegExp("[^\\d\\"+l.decimal+"\\"+l.group+"]","g"),c=new RegExp("[\\d\\"+l.decimal+"\\"+l.group+"]"),p=d.replace(u,""),h=F.getFirstNumberIndex(d,A),f=-1===h?-1:F.getLastNumberIndex(d,A),v=d.indexOf(l.decimal),m=(d.substring(0,h)+d.substring(h,f).replace(o,"")+d.substring(f,d.length)).split("").filter(function(e){return-1!==r.indexOf(e)||-1!==e.search(c)}).join(""),g=a.formatNumber(.31111111111111117,t).replace(u,""),$=g.indexOf(l.decimal),V=-1<$?g.length-$-1:0,b=a.formatNumber(1,t).replace(u,""),S=b.indexOf(l.decimal),y=-1<S?b.length-S-1:0,x=F.getFormatPrefixSufix(t,a),L=[x.positiveInfo,x.negativeInfo,x.zeroInfo,x.oneInfo],I=1!==L.findIndex(function(e){return-1!==e.findIndex(function(e){return Boolean(e)})}),O=0<d.length&&d.length<s.length;if(!i.isPaste){if(""===d)return i.eventValue=null,i.currentLooseValue="",i;if(i.currentLooseValue===l.minusSign&&a.formatNumber(-0,t)!==s)return i.eventValue=-0,i.currentLooseValue=F.formatValue(i.eventValue,t,a),F.setSelection(i,F.getInitialPosition(i.currentLooseValue,l),i.currentLooseValue,L),i;if(F.isMinusSymbolAdded(i,l)){var _=a.parseNumber(n,t);i.eventValue=-(null!==_?_:0),i.currentLooseValue=F.formatValue(i.eventValue,t,a);var N=F.getFirstNumberIndex(i.currentLooseValue,A),C=F.getFirstNumberIndex(s,A);return F.setSelection(i,i.selectionEnd-1+(N-C),i.currentLooseValue,L),i}if(i.currentLooseValue===l.decimal){i.eventValue=0;var k=F.formatValue(i.eventValue,t,a);if(0==y&&0<V){var D=F.getLastNumberIndex(k,A);i.currentLooseValue=k.substring(0,D)+l.decimal+k.substring(D)}else i.currentLooseValue=k;return F.setSelection(i,F.getInitialPosition(i.currentLooseValue,l)+1,i.currentLooseValue,L),i}if(F.isDecimalDuplicated(i,l))return F.setInvalid(i,t,L,a),i;if("p"===t&&d&&-1===d.indexOf(l.percentSign))return i.eventValue=a.parseNumber(d,t)/100,i.currentLooseValue=F.formatValue(i.eventValue,t,a),i;if(15<String(i.currentLooseValue).replace(/[^\d]/g,"").length)return F.setInvalid(i,t,L,a),i;if(p!==d&&d&&I&&-1===L.findIndex(function(e){var t=e[0],a=e[1],i=d.indexOf(t),n=d.indexOf(a),r=0===i,s=n===d.length-a.length,u=i+t.length!==h&&-1!==h&&d[i+t.length]!==l.decimal,o=n!==f&&-1!==f&&d[n-1]!==l.decimal;return t&&a?!u&&!o&&r&&s:t?!u&&r:!!a&&!o&&s}))return F.setInvalid(i,t,L,a),i;if(p[p.length-1]===l.decimal&&0<V)return i.eventValue=a.parseNumber(d,t),i.currentLooseValue=m,i;if(i.currentLooseValue&&n&&-1<(r+l.decimal+l.group).split("").findIndex(function(t){return d.split("").filter(function(e){return e===t}).length<s.split("").filter(function(e){return e===t}).length&&d.length+1===s.length&&(t!==l.decimal||0!==F.getDecimalCount(s.replace(u,""),l.decimal))}))return i.eventValue=a.parseNumber(e.prevLooseValue,t),i.currentLooseValue=e.prevLooseValue,i;var P=F.getDecimalCount(p,l.decimal),M="0"===p[p.length-1];if(O&&M&&P<y)return i.eventValue=a.parseNumber(i.currentLooseValue,t),i.currentLooseValue=F.formatValue(i.eventValue,t,a),i;if(0<P){var E=d.substring(0,v);if(M&&(!E||0!==s.indexOf(E))){i.eventValue=a.parseNumber(i.currentLooseValue,t);var w=F.formatValue(i.eventValue,t,a);return F.setSelection(i,F.changeBasedSelection(d,w,i.selectionEnd,O,u),w,L),i.currentLooseValue=w,i}if(V<P){var B=d.indexOf(l.decimal),j=d.substring(0,B)+d.substring(B,B+1+V)+d.substring(f,String(i.currentLooseValue).length);return i.eventValue=a.parseNumber(j,t),i.currentLooseValue=j,F.setSelection(i,i.selectionStart,j,L),i}if(y!=V&&P<=V&&M)return i.eventValue=a.parseNumber(i.currentLooseValue,t),i.currentLooseValue=m,i;if(P<y)return i.eventValue=a.parseNumber(i.currentLooseValue,t),i.currentLooseValue=F.formatValue(i.eventValue,t,a),i}}return i.eventValue=a.parseNumber(i.currentLooseValue,t),"number"==typeof i.eventValue?(w=F.formatValue(i.eventValue,t,a),1===d.length?F.setSelection(i,F.getInitialPosition(w,l),w,L):F.setSelection(i,F.changeBasedSelection(d,w,i.selectionEnd,O,u),w,L),i.currentLooseValue=w):i.currentLooseValue=F.formatValue(a.parseNumber(p),t,a),i}}],n.c=i,n.d=function(e,t,a){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:a})},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(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var a=Object.create(null);if(n.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(a,i,function(e){return t[e]}.bind(null,i));return a},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=1)}}});

@@ -109,3 +109,2 @@ ---

* vue 2.6.11*
* vue-class-component 7.2.2*
* @progress/kendo-vue-intl

@@ -112,0 +111,0 @@

{
"name": "@progress/kendo-vue-inputs",
"description": "KendoVue Input package",
"version": "0.5.0",
"version": "0.5.1-dev.202003241010",
"repository": {

@@ -37,10 +37,9 @@ "type": "git",

"@progress/kendo-vue-intl": "0.4.4",
"vue": "^2.6.11",
"vue-class-component": "^7.2.2"
"vue": "^2.6.11"
},
"dependencies": {
"@progress/kendo-vue-common": "0.5.0"
"@progress/kendo-vue-common": "0.5.1-dev.202003241010"
},
"devDependencies": {
"@progress/kendo-vue-intl": "0.5.0",
"@progress/kendo-vue-intl": "0.5.1-dev.202003241010",
"cldr-core": "^34.0.0",

@@ -47,0 +46,0 @@ "cldr-dates-full": "^34.0.0",

Sorry, the diff of this file is not supported yet

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