Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@progress/kendo-vue-inputs

Package Overview
Dependencies
Maintainers
0
Versions
554
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 6.0.0-develop.3 to 6.0.0-develop.4

2

numerictextbox/NumericTextBox.js

@@ -8,2 +8,2 @@ /**

*/
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("vue"),s=require("@progress/kendo-vue-common"),m=require("@progress/kendo-vue-intl"),f=require("@progress/kendo-vue-buttons"),r=require("../messages/main.js"),i=require("./utils/main.js"),S=require("../package-metadata.js"),p=require("@progress/kendo-svg-icons"),b="Please enter a valid value!",k=a.defineComponent({model:{event:"changemodel"},emits:{change:null,changemodel:null,"update:modelValue":null,focus:null,blur:null},props:{modelValue:Number,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},size:{type:String,default:"medium",validator:function(t){return[null,"small","medium","large"].includes(t)}},rounded:{type:String,default:"medium",validator:function(t){return[null,"small","medium","large","full"].includes(t)}},fillMode:{type:String,default:"solid",validator:function(t){return[null,"solid","flat","outline"].includes(t)}},required:{type:Boolean,default:!1},id:String,ariaLabel:String,iconName:String,inputPrefix:[String,Function],inputSuffix:[String,Function],showValidationIcon:Boolean,showLoadingIcon:Boolean,showClearButton:Boolean,inputClass:String,inputType:{type:String,default:"tel"},wrapperClass:String},inject:{kendoIntlService:{default:null},kendoLocalizationService:{default:null}},data(){return{hasMounted:!1,isInvalid:!1,isEmpty:!1,currentValue:0,valueDuringOnChange:0,currentLooseValue:"",selectionStart:0,selectionEnd:0,decimalSelect:!1,focused:!1,forceUpdate:!1}},created(){s.validatePackage(S.packageMetadata),this._textBeforeInput="",this._inputId=s.guid(),this.$data.currentLooseValue=null,this.$data.valueDuringOnChange=void 0,this._intl=m.provideIntlService(this),this._symbols=this._intl.numberSymbols(),this.$props.value!==void 0?this.$data.currentValue=this.$props.value:this.$props.modelValue!==void 0?this.$data.currentValue=this.$props.modelValue:this.$props.defaultValue!==void 0?this.$data.currentValue=this.$props.defaultValue:this.$data.currentValue=null},mounted(){this._input=s.getRef(this,"input"),this._elementWrapper=this.elementWrapperRef,this.$data.hasMounted=!0,this._input&&(this._textBeforeInput=this._input.value),this.setValidity()},updated(){!(s.canUseDOM&&document.activeElement!==this._input||!this._input)&&this.$data.currentLooseValue!==null&&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(){return this.$data.valueDuringOnChange!==void 0?this.$data.valueDuringOnChange:this.$data.currentValue},looseValue(){return i.formatValue(this.$data.focused?this.$data.currentLooseValue:i.getStateOrPropsValue(this.$props.value,this.$data.currentValue),this.$props.format,this._intl)},spanClassNames(){const t=!this.$data.hasMounted||!this.$props.validityStyles||this.validity().valid,e=this.computedValue;return{"k-floating-label-container":!0,"k-focus":this.$data.focused,"k-empty":!(e===0||e||this.$props.placeholder),"k-invalid":!t&&t!==void 0,"k-rtl":this.$props.dir==="rtl",[this.inputClass]:this.inputClass}},wrapperClassNames(){const{size:t,fillMode:e,rounded:n,required:l,disabled:u}=this.$props,o=!this.$props.validityStyles||this.validity().valid;return{"k-input":!0,"k-numerictextbox":!0,[`k-input-${s.kendoThemeMaps.sizeMap[t]||t}`]:t,[`k-input-${e}`]:e,[`k-rounded-${s.kendoThemeMaps.roundedMap[n]||n}`]:n,"k-invalid":!o,"k-required":l,"k-disabled":u,"k-loading":this.showLoadingIcon,[this.wrapperClass]:this.wrapperClass}},inputInnerClass(){return{"k-input-inner":!0,[this.inputClass]:this.inputClass}}},methods:{validity(){const t=this.$props.validationMessage!==void 0,e=!this.$data.valueIsOutOfRange&&(!this.$props.required||this.computedValue!==null),n=this.$props.valid!==void 0?this.$props.valid:e;return{customError:t,valid:n,valueMissing:this.computedValue===null}},clearClick(t){this.$props.value!==void 0?this.$data.currentValue=this.$props.value:this.$props.modelValue!==void 0?this.$data.currentValue=this.$props.modelValue:this.$data.currentValue=null,this.$emit("changemodel",null),this.$emit("update:modelValue",null),this.$emit("change",{event:t,value:null,component:this,target:{name:this.$props.name,value:null},validity:this.validity()})},focus(){this._input&&this._input.focus()},emitFocus(t){this.$data.currentLooseValue=this._prevLooseValue,this.$data.focused=!0,this.$emit("focus",t),this.$data.forceUpdate=!0},emitBlur(t){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",t),this.$data.forceUpdate=!0},handleFocus(t){this.$data.focused=!0},handleBlur(t){this.$data.focused=!1},setValidity(){this._input&&this._input.setCustomValidity&&this._input.setCustomValidity(this.validity().valid?"":this.$props.validationMessage||b)},getCurrentState(){return{eventValue:i.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(t){return this._intl.parseNumber(t,this.$props.format)},elementChange(t){const e=this.getCurrentState();this._isPaste=!1,this.triggerChange(t,i.sanitizeNumber(e,this.$props.format,this._intl))},triggerChange(t,e){if(this.$props.disabled)return;this.$data.valueDuringOnChange=e.eventValue,this.$data.currentValue=e.eventValue;const n=i.formatValue(i.rangeValue(e.eventValue,this.$props.min,this.$props.max),this.$props.format,this._intl),l=i.rangeValue(this.parseNumber(n),this.$props.min,this.$props.max);if(l!==e.eventValue&&(e.valueIsOutOfRange=!0,e.eventValue=l,this.$data.valueDuringOnChange=l,this.$data.currentValue=l),e.valueIsCorrected){const o=this._elementWrapper;o&&o.className.indexOf("k-invalid")===-1&&(this.$data.isInvalid=!0,setTimeout(()=>{this.$data.isInvalid=!1},50))}const u=this.$props.value!==e.eventValue;this.$props.value!==void 0?this.$data.currentValue=this.$props.value:this.$props.modelValue!==void 0?this.$data.currentValue=this.$props.modelValue:this.$data.currentValue=this.$data.valueDuringOnChange,this.$data.prevLooseValue=e.prevLooseValue,this.$data.currentLooseValue=void 0,this.$data.currentLooseValue=e.currentLooseValue,this.$data.selectionStart=e.selectionStart,this.$data.selectionEnd=e.selectionEnd,this.$data.decimalSelect=e.decimalSelect,this.$data.valueIsCorrected=e.valueIsCorrected,this.$data.valueIsOutOfRange=e.valueIsOutOfRange,this.$data.focused=e.focused,this.$data.isPaste=e.isPaste,this.$data.forceUpdate=!this.$data.forceUpdate,u&&(this.$emit("changemodel",this.$data.valueDuringOnChange),this.$emit("update:modelValue",this.$data.valueDuringOnChange),this.$emit("change",{event:t,value:this.$data.valueDuringOnChange,component:this,target:{name:this.$props.name,value:this.$data.valueDuringOnChange},validity:this.validity()})),this.$data.valueDuringOnChange=void 0},onPasteHandler(t){this._isPaste=!0},increase(t){const e=this.getCurrentState();i.increaseValue(this.parseNumber(String(e.currentLooseValue)),e,this.$props.step,this.$props.min,this.$props.max,this.$props.format,this._intl),this.triggerChange(t,e)},decrease(t){const e=this.getCurrentState();i.decreaseValue(this.parseNumber(String(e.currentLooseValue)),e,this.$props.step,this.$props.min,this.$props.max,this.$props.format,this._intl),this.triggerChange(t,e)},wheel(t){!s.canUseDOM||document.activeElement!==this._input||!this._input||(t.deltaY<0&&(t.preventDefault(),this.increase(t)),t.deltaY>0&&(t.preventDefault(),this.decrease(t)))},keyDown(t){let e=this.getCurrentState(),n,l,u,o;const d=this.parseNumber(String(e.currentLooseValue));if(!(e.selectionEnd>e.selectionStart&&e.selectionEnd-e.selectionStart===String(e.currentLooseValue).length)){switch(t.keyCode){case 38:i.increaseValue(d,e,this.$props.step,this.$props.min,this.$props.max,this.$props.format,this._intl);break;case 40:i.decreaseValue(d,e,this.$props.step,this.$props.min,this.$props.max,this.$props.format,this._intl);break;case 13:n=i.formatValue(i.rangeValue(d,this.$props.min,this.$props.max),this.$props.format,this._intl),l=i.rangeValue(this.parseNumber(n),this.$props.min,this.$props.max),e.eventValue=l,e.currentLooseValue=i.formatValue(l,this.$props.format,this._intl),e.selectionStart=e.selectionEnd=e.currentLooseValue.length;break;case 110:u=this._input,o=this._intl.numberSymbols(),u&&(e.currentLooseValue=e.currentLooseValue.slice(0,e.selectionStart)+o.decimal+e.currentLooseValue.slice(e.selectionEnd),e.selectionStart=e.selectionEnd=e.selectionStart+1,e=i.sanitizeNumber(e,this.$props.format,this._intl));break;default:return}t.preventDefault(),this.triggerChange(t,e)}},spinnersWrapperMouseDown(t){s.canUseDOM&&this._input&&(t.preventDefault(),document.activeElement!==this._input&&this._input.focus())}},setup(){const t=a.ref(null),e=a.ref(null),n=a.inject("kendoLocalizationService",{}),l=a.inject("kendoIntlService",{});return{inputRef:t,elementWrapperRef:e,kendoLocalizationService:n,kendoIntlService:l}},render(){const{iconName:t,showValidationIcon:e,showLoadingIcon:n,showClearButton:l}=this.$props,u=this.$props.id||this._inputId,o=s.getDefaultSlots(this),d=m.provideLocalizationService(this),c=this.validity().valid;this.$props.value!==void 0&&this.$props.value!==this.$data.currentValue?this.$data.currentValue=this.$props.value:this.$props.modelValue!==void 0&&this.$props.modelValue!==this.$data.currentValue&&(this.$data.currentValue=this.$props.modelValue),this._prevLooseValue=this.$data.currentLooseValue?this.looseValue:this.looseValue;const $=s.templateRendering.call(this,this.$props.inputPrefix,s.getListeners.call(this)),V=s.templateRendering.call(this,this.$props.inputSuffix,s.getListeners.call(this)),g=s.getTemplate.call(this,{h:a.h,template:$,additionalProps:{value:this.computedValue,valid:c}}),v=s.getTemplate.call(this,{h:a.h,template:V,additionalProps:{value:this.computedValue,valid:c}}),h=a.createVNode("span",{dir:this.$props.dir,class:this.wrapperClassNames,style:this.$attrs.style},[t&&a.createVNode(s.Icon,{name:t,class:"k-input-icon"},null),this.$props.inputPrefix&&a.createVNode("span",{class:"k-input-prefix"},[g]),a.createVNode("input",{tabindex:this.$props.tabIndex,accesskey:this.$props.accessKey,disabled:this.$props.disabled,title:this.$props.title,"aria-label":this.$props.ariaLabel,"aria-valuemin":this.$props.min,"aria-valuemax":this.$props.max,"aria-disabled":this.$props.disabled?"true":void 0,placeholder:this.$props.placeholder,type:this.$props.inputType,spellcheck:!1,autocomplete:"off",autocorrect:"off",class:this.inputInnerClass,id:u,role:"spinbutton",value:this.looseValue,name:this.$props.name,onWheel:this.wheel,onKeydown:this.keyDown,onInput:this.elementChange,onFocus:this.emitFocus,onBlur:this.emitBlur,onPaste:this.onPasteHandler,ref:s.setRef(this,"input")},null),this.$props.inputSuffix&&a.createVNode("span",{class:"k-input-suffix"},[v]),e&&c&&a.createVNode(s.Icon,{name:"check",icon:p.checkIcon,class:"k-input-validation-icon"},null),e&&!c&&a.createVNode(s.Icon,{name:"exclamation-circle",icon:p.exclamationCircleIcon,class:"k-input-validation-icon"},null),n&&a.createVNode(s.Icon,{name:"loading",class:"k-input-loading-icon"},null),l&&this.computedValue!==void 0&&this.computedValue!==null&&a.createVNode("span",{onClick:this.clearClick,class:"k-clear-value"},[a.createVNode(s.Icon,{name:"x",icon:p.xIcon},null)]),o,this.$props.spinners&&a.createVNode("span",{class:"k-input-spinner k-spin-button",onMousedown:this.spinnersWrapperMouseDown},[a.createVNode(f.Button,{type:"button",tabIndex:-1,icon:"caret-alt-up",svgIcon:p.caretAltUpIcon,class:"k-spinner-increase",rounded:null,"aria-label":d.toLanguageString(r.numericIncreaseValue,r.messages[r.numericIncreaseValue]),title:d.toLanguageString(r.numericIncreaseValue,r.messages[r.numericIncreaseValue]),onClick:this.increase},null),a.createVNode(f.Button,{type:"button",tabIndex:-1,class:"k-spinner-decrease",icon:"caret-alt-down",svgIcon:p.caretAltDownIcon,rounded:null,"aria-label":d.toLanguageString(r.numericDecreaseValue,r.messages[r.numericDecreaseValue]),title:d.toLanguageString(r.numericDecreaseValue,r.messages[r.numericDecreaseValue]),onClick:this.decrease},null)])]);return this.$props.label?a.createVNode("span",{class:this.spanClassNames,onFocusin:this.handleFocus,onFocusout:this.handleBlur,dir:this.$props.dir},[h,this.$props.label?u?a.createVNode("label",{for:u,class:"k-floating-label"},[this.$props.label]):a.createVNode("span",{class:"k-label"},[this.$props.label]):null]):h}});exports.NumericTextBox=k;
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("vue"),s=require("@progress/kendo-vue-common"),m=require("@progress/kendo-vue-intl"),f=require("@progress/kendo-vue-buttons"),r=require("../messages/main.js"),i=require("./utils/main.js"),S=require("../package-metadata.js"),p=require("@progress/kendo-svg-icons"),b="Please enter a valid value!",k=a.defineComponent({model:{event:"changemodel"},emits:{change:null,changemodel:null,"update:modelValue":null,focus:null,blur:null},props:{modelValue:Number,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},size:{type:String,default:"medium",validator:function(t){return[null,"small","medium","large"].includes(t)}},rounded:{type:String,default:"medium",validator:function(t){return[null,"small","medium","large","full"].includes(t)}},fillMode:{type:String,default:"solid",validator:function(t){return[null,"solid","flat","outline"].includes(t)}},required:{type:Boolean,default:!1},id:String,ariaLabel:String,iconName:String,inputPrefix:[String,Function],inputSuffix:[String,Function],showValidationIcon:Boolean,showLoadingIcon:Boolean,showClearButton:Boolean,inputClass:String,inputType:{type:String,default:"tel"},wrapperClass:String},inject:{kendoIntlService:{default:null},kendoLocalizationService:{default:null}},data(){return{hasMounted:!1,isInvalid:!1,isEmpty:!1,currentValue:0,valueDuringOnChange:0,currentLooseValue:"",selectionStart:0,selectionEnd:0,decimalSelect:!1,focused:!1,forceUpdate:!1}},created(){s.validatePackage(S.packageMetadata),this._textBeforeInput="",this._inputId=s.guid(),this.$data.currentLooseValue=null,this.$data.valueDuringOnChange=void 0,this._intl=m.provideIntlService(this),this._symbols=this._intl.numberSymbols(),this.$props.value!==void 0?this.$data.currentValue=this.$props.value:this.$props.modelValue!==void 0?this.$data.currentValue=this.$props.modelValue:this.$props.defaultValue!==void 0?this.$data.currentValue=this.$props.defaultValue:this.$data.currentValue=null},mounted(){this._input=s.getRef(this,"input"),this._elementWrapper=this.elementWrapperRef,this.$data.hasMounted=!0,this._input&&(this._textBeforeInput=this._input.value),this.setValidity()},updated(){!(s.canUseDOM&&document.activeElement!==this._input||!this._input)&&this.$data.currentLooseValue!==null&&this.$data.forceUpdate&&this._input.type!=="number"&&(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(){return this.$data.valueDuringOnChange!==void 0?this.$data.valueDuringOnChange:this.$data.currentValue},looseValue(){return i.formatValue(this.$data.focused?this.$data.currentLooseValue:i.getStateOrPropsValue(this.$props.value,this.$data.currentValue),this.$props.format,this._intl)},spanClassNames(){const t=!this.$data.hasMounted||!this.$props.validityStyles||this.validity().valid,e=this.computedValue;return{"k-floating-label-container":!0,"k-focus":this.$data.focused,"k-empty":!(e===0||e||this.$props.placeholder),"k-invalid":!t&&t!==void 0,"k-rtl":this.$props.dir==="rtl",[this.inputClass]:this.inputClass}},wrapperClassNames(){const{size:t,fillMode:e,rounded:n,required:l,disabled:u}=this.$props,o=!this.$props.validityStyles||this.validity().valid;return{"k-input":!0,"k-numerictextbox":!0,[`k-input-${s.kendoThemeMaps.sizeMap[t]||t}`]:t,[`k-input-${e}`]:e,[`k-rounded-${s.kendoThemeMaps.roundedMap[n]||n}`]:n,"k-invalid":!o,"k-required":l,"k-disabled":u,"k-loading":this.showLoadingIcon,[this.wrapperClass]:this.wrapperClass}},inputInnerClass(){return{"k-input-inner":!0,[this.inputClass]:this.inputClass}}},methods:{validity(){const t=this.$props.validationMessage!==void 0,e=!this.$data.valueIsOutOfRange&&(!this.$props.required||this.computedValue!==null),n=this.$props.valid!==void 0?this.$props.valid:e;return{customError:t,valid:n,valueMissing:this.computedValue===null}},clearClick(t){this.$props.value!==void 0?this.$data.currentValue=this.$props.value:this.$props.modelValue!==void 0?this.$data.currentValue=this.$props.modelValue:this.$data.currentValue=null,this.$emit("changemodel",null),this.$emit("update:modelValue",null),this.$emit("change",{event:t,value:null,component:this,target:{name:this.$props.name,value:null},validity:this.validity()})},focus(){this._input&&this._input.focus()},emitFocus(t){this.$data.currentLooseValue=this._prevLooseValue,this.$data.focused=!0,this.$emit("focus",t),this.$data.forceUpdate=!0},emitBlur(t){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",t),this.$data.forceUpdate=!0},handleFocus(t){this.$data.focused=!0},handleBlur(t){this.$data.focused=!1},setValidity(){this._input&&this._input.setCustomValidity&&this._input.setCustomValidity(this.validity().valid?"":this.$props.validationMessage||b)},getCurrentState(){return{eventValue:i.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(t){return this._intl.parseNumber(t,this.$props.format)},elementChange(t){const e=this.getCurrentState();this._isPaste=!1,this.triggerChange(t,i.sanitizeNumber(e,this.$props.format,this._intl))},triggerChange(t,e){if(this.$props.disabled)return;this.$data.valueDuringOnChange=e.eventValue,this.$data.currentValue=e.eventValue;const n=i.formatValue(i.rangeValue(e.eventValue,this.$props.min,this.$props.max),this.$props.format,this._intl),l=i.rangeValue(this.parseNumber(n),this.$props.min,this.$props.max);if(l!==e.eventValue&&(e.valueIsOutOfRange=!0,e.eventValue=l,this.$data.valueDuringOnChange=l,this.$data.currentValue=l),e.valueIsCorrected){const o=this._elementWrapper;o&&o.className.indexOf("k-invalid")===-1&&(this.$data.isInvalid=!0,setTimeout(()=>{this.$data.isInvalid=!1},50))}const u=this.$props.value!==e.eventValue;this.$props.value!==void 0?this.$data.currentValue=this.$props.value:this.$props.modelValue!==void 0?this.$data.currentValue=this.$props.modelValue:this.$data.currentValue=this.$data.valueDuringOnChange,this.$data.prevLooseValue=e.prevLooseValue,this.$data.currentLooseValue=void 0,this.$data.currentLooseValue=e.currentLooseValue,this.$data.selectionStart=e.selectionStart,this.$data.selectionEnd=e.selectionEnd,this.$data.decimalSelect=e.decimalSelect,this.$data.valueIsCorrected=e.valueIsCorrected,this.$data.valueIsOutOfRange=e.valueIsOutOfRange,this.$data.focused=e.focused,this.$data.isPaste=e.isPaste,this.$data.forceUpdate=!this.$data.forceUpdate,u&&(this.$emit("changemodel",this.$data.valueDuringOnChange),this.$emit("update:modelValue",this.$data.valueDuringOnChange),this.$emit("change",{event:t,value:this.$data.valueDuringOnChange,component:this,target:{name:this.$props.name,value:this.$data.valueDuringOnChange},validity:this.validity()})),this.$data.valueDuringOnChange=void 0},onPasteHandler(t){this._isPaste=!0},increase(t){const e=this.getCurrentState();i.increaseValue(this.parseNumber(String(e.currentLooseValue)),e,this.$props.step,this.$props.min,this.$props.max,this.$props.format,this._intl),this.triggerChange(t,e)},decrease(t){const e=this.getCurrentState();i.decreaseValue(this.parseNumber(String(e.currentLooseValue)),e,this.$props.step,this.$props.min,this.$props.max,this.$props.format,this._intl),this.triggerChange(t,e)},wheel(t){!s.canUseDOM||document.activeElement!==this._input||!this._input||(t.deltaY<0&&(t.preventDefault(),this.increase(t)),t.deltaY>0&&(t.preventDefault(),this.decrease(t)))},keyDown(t){let e=this.getCurrentState(),n,l,u,o;const d=this.parseNumber(String(e.currentLooseValue));if(!(e.selectionEnd>e.selectionStart&&e.selectionEnd-e.selectionStart===String(e.currentLooseValue).length)){switch(t.keyCode){case 38:i.increaseValue(d,e,this.$props.step,this.$props.min,this.$props.max,this.$props.format,this._intl);break;case 40:i.decreaseValue(d,e,this.$props.step,this.$props.min,this.$props.max,this.$props.format,this._intl);break;case 13:n=i.formatValue(i.rangeValue(d,this.$props.min,this.$props.max),this.$props.format,this._intl),l=i.rangeValue(this.parseNumber(n),this.$props.min,this.$props.max),e.eventValue=l,e.currentLooseValue=i.formatValue(l,this.$props.format,this._intl),e.selectionStart=e.selectionEnd=e.currentLooseValue.length;break;case 110:u=this._input,o=this._intl.numberSymbols(),u&&(e.currentLooseValue=e.currentLooseValue.slice(0,e.selectionStart)+o.decimal+e.currentLooseValue.slice(e.selectionEnd),e.selectionStart=e.selectionEnd=e.selectionStart+1,e=i.sanitizeNumber(e,this.$props.format,this._intl));break;default:return}t.preventDefault(),this.triggerChange(t,e)}},spinnersWrapperMouseDown(t){s.canUseDOM&&this._input&&(t.preventDefault(),document.activeElement!==this._input&&this._input.focus())}},setup(){const t=a.ref(null),e=a.ref(null),n=a.inject("kendoLocalizationService",{}),l=a.inject("kendoIntlService",{});return{inputRef:t,elementWrapperRef:e,kendoLocalizationService:n,kendoIntlService:l}},render(){const{iconName:t,showValidationIcon:e,showLoadingIcon:n,showClearButton:l}=this.$props,u=this.$props.id||this._inputId,o=s.getDefaultSlots(this),d=m.provideLocalizationService(this),c=this.validity().valid;this.$props.value!==void 0&&this.$props.value!==this.$data.currentValue?this.$data.currentValue=this.$props.value:this.$props.modelValue!==void 0&&this.$props.modelValue!==this.$data.currentValue&&(this.$data.currentValue=this.$props.modelValue),this._prevLooseValue=this.$data.currentLooseValue?this.looseValue:this.looseValue;const $=s.templateRendering.call(this,this.$props.inputPrefix,s.getListeners.call(this)),V=s.templateRendering.call(this,this.$props.inputSuffix,s.getListeners.call(this)),g=s.getTemplate.call(this,{h:a.h,template:$,additionalProps:{value:this.computedValue,valid:c}}),v=s.getTemplate.call(this,{h:a.h,template:V,additionalProps:{value:this.computedValue,valid:c}}),h=a.createVNode("span",{dir:this.$props.dir,class:this.wrapperClassNames,style:this.$attrs.style},[t&&a.createVNode(s.Icon,{name:t,class:"k-input-icon"},null),this.$props.inputPrefix&&a.createVNode("span",{class:"k-input-prefix"},[g]),a.createVNode("input",{tabindex:this.$props.tabIndex,accesskey:this.$props.accessKey,disabled:this.$props.disabled,title:this.$props.title,"aria-label":this.$props.ariaLabel,"aria-valuemin":this.$props.min,"aria-valuemax":this.$props.max,"aria-disabled":this.$props.disabled?"true":void 0,placeholder:this.$props.placeholder,type:this.$props.inputType,spellcheck:!1,autocomplete:"off",autocorrect:"off",class:this.inputInnerClass,id:u,role:"spinbutton",value:this.looseValue,name:this.$props.name,onWheel:this.wheel,onKeydown:this.keyDown,onInput:this.elementChange,onFocus:this.emitFocus,onBlur:this.emitBlur,onPaste:this.onPasteHandler,ref:s.setRef(this,"input")},null),this.$props.inputSuffix&&a.createVNode("span",{class:"k-input-suffix"},[v]),e&&c&&a.createVNode(s.Icon,{name:"check",icon:p.checkIcon,class:"k-input-validation-icon"},null),e&&!c&&a.createVNode(s.Icon,{name:"exclamation-circle",icon:p.exclamationCircleIcon,class:"k-input-validation-icon"},null),n&&a.createVNode(s.Icon,{name:"loading",class:"k-input-loading-icon"},null),l&&this.computedValue!==void 0&&this.computedValue!==null&&a.createVNode("span",{onClick:this.clearClick,class:"k-clear-value"},[a.createVNode(s.Icon,{name:"x",icon:p.xIcon},null)]),o,this.$props.spinners&&a.createVNode("span",{class:"k-input-spinner k-spin-button",onMousedown:this.spinnersWrapperMouseDown},[a.createVNode(f.Button,{type:"button",tabIndex:-1,icon:"caret-alt-up",svgIcon:p.caretAltUpIcon,class:"k-spinner-increase",rounded:null,"aria-label":d.toLanguageString(r.numericIncreaseValue,r.messages[r.numericIncreaseValue]),title:d.toLanguageString(r.numericIncreaseValue,r.messages[r.numericIncreaseValue]),onClick:this.increase},null),a.createVNode(f.Button,{type:"button",tabIndex:-1,class:"k-spinner-decrease",icon:"caret-alt-down",svgIcon:p.caretAltDownIcon,rounded:null,"aria-label":d.toLanguageString(r.numericDecreaseValue,r.messages[r.numericDecreaseValue]),title:d.toLanguageString(r.numericDecreaseValue,r.messages[r.numericDecreaseValue]),onClick:this.decrease},null)])]);return this.$props.label?a.createVNode("span",{class:this.spanClassNames,onFocusin:this.handleFocus,onFocusout:this.handleBlur,dir:this.$props.dir},[h,this.$props.label?u?a.createVNode("label",{for:u,class:"k-floating-label"},[this.$props.label]):a.createVNode("span",{class:"k-label"},[this.$props.label]):null]):h}});exports.NumericTextBox=k;
{
"name": "@progress/kendo-vue-inputs",
"version": "6.0.0-develop.3",
"version": "6.0.0-develop.4",
"description": "TODO",

@@ -19,3 +19,3 @@ "author": "Progress",

"@progress/kendo-licensing": "^1.3.4",
"@progress/kendo-vue-common": "6.0.0-develop.3",
"@progress/kendo-vue-common": "6.0.0-develop.4",
"vue": "^3.0.2"

@@ -22,0 +22,0 @@ },

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

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