@progress/kendo-vue-inputs 9.1.0-develop.2 → 9.1.1-develop.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/NOTICE.txt +18 -40
- package/checkbox/Checkbox.js +1 -1
- package/checkbox/Checkbox.mjs +10 -10
- package/dist/cdn/js/kendo-vue-inputs.js +1 -1
- package/input/Input.js +1 -1
- package/input/Input.mjs +4 -4
- package/numerictextbox/NumericTextBox.js +1 -1
- package/numerictextbox/NumericTextBox.mjs +1 -1
- package/numerictextbox/utils/main.js +1 -1
- package/numerictextbox/utils/main.mjs +1 -1
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -2
- package/package.json +9 -9
- package/radiobutton/RadioButton.js +1 -1
- package/radiobutton/RadioButton.mjs +18 -18
package/input/Input.js
CHANGED
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("vue"),n=require("@progress/kendo-vue-common"),c=require("../package-metadata.js"),f=require("@progress/kendo-vue-labels");function y(t){return typeof t=="function"||Object.prototype.toString.call(t)==="[object Object]"&&!a.isVNode(t)}const m=a.defineComponent({model:{event:"changemodel"},emits:{input:t=>!0,change:t=>!0,changemodel:t=>!0,"update:modelValue":t=>!0,focus:t=>!0,blur:t=>!0,keyup:t=>!0,keydown:t=>!0,keypress:t=>!0},props:{modelValue:{type:[String,Number],default:void 0},disabled:{type:Boolean,default:void 0},defaultValue:{type:[String,Number],default:""},value:{type:[String,Number]},label:{type:String},placeholder:{type:String},required:{type:Boolean,default:!1},size:{type:String,validator:function(t){return["small","medium","large"].includes(t)}},rounded:{type:String,validator:function(t){return["none","small","medium","large","full"].includes(t)}},fillMode:{type:String,validator:function(t){return["solid","flat","outline"].includes(t)}},dir:{type:String},id:String,valid:{type:Boolean,default:void 0},validate:{type:Boolean},validationMessage:{type:String},validityStyles:{type:Boolean,default:!0},inputClass:String,tabIndex:Number,ariaLabel:String,ariaLabelledBy:String,ariaDescribedBy:String},data:function(){return{hasMounted:!1,autofill:!1,currentValue:"",valueDuringOnChange:"",focused:!1}},created(){n.validatePackage(c.packageMetadata),this._input=void 0,this._inputId=n.guid(),this.$data.valueDuringOnChange=void 0,this.$data.currentValue=this.$props.defaultValue},mounted(){this._input=this.inputRef,this.$data.hasMounted=!0,this.setValidity()},updated(){this.setValidity(),this.updateValidClass()},setup(){return{inputRef:a.ref(null)}},render(){const t=!this.$props.validityStyles||this.validity().valid,{label:e,id:i,required:l,tabIndex:u,ariaLabel:r,ariaLabelledBy:o,ariaDescribedBy:p}=this.$props,d=i||this._inputId,s=a.h("input",{...this.$attrs,placeholder:this.$props.placeholder,id:d,tabindex:u,required:l,
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("vue"),n=require("@progress/kendo-vue-common"),c=require("../package-metadata.js"),f=require("@progress/kendo-vue-labels");function y(t){return typeof t=="function"||Object.prototype.toString.call(t)==="[object Object]"&&!a.isVNode(t)}const m=a.defineComponent({model:{event:"changemodel"},emits:{input:t=>!0,change:t=>!0,changemodel:t=>!0,"update:modelValue":t=>!0,focus:t=>!0,blur:t=>!0,keyup:t=>!0,keydown:t=>!0,keypress:t=>!0},props:{modelValue:{type:[String,Number],default:void 0},disabled:{type:Boolean,default:void 0},defaultValue:{type:[String,Number],default:""},value:{type:[String,Number]},label:{type:String},placeholder:{type:String},required:{type:Boolean,default:!1},size:{type:String,validator:function(t){return["small","medium","large"].includes(t)}},rounded:{type:String,validator:function(t){return["none","small","medium","large","full"].includes(t)}},fillMode:{type:String,validator:function(t){return["solid","flat","outline"].includes(t)}},dir:{type:String},id:String,valid:{type:Boolean,default:void 0},validate:{type:Boolean},validationMessage:{type:String},validityStyles:{type:Boolean,default:!0},inputClass:String,tabIndex:Number,ariaLabel:String,ariaLabelledBy:String,ariaDescribedBy:String},data:function(){return{hasMounted:!1,autofill:!1,currentValue:"",valueDuringOnChange:"",focused:!1}},created(){n.validatePackage(c.packageMetadata),this._input=void 0,this._inputId=n.guid(),this.$data.valueDuringOnChange=void 0,this.$data.currentValue=this.$props.defaultValue},mounted(){this._input=this.inputRef,this.$data.hasMounted=!0,this.setValidity()},updated(){this.setValidity(),this.updateValidClass()},setup(){return{inputRef:a.ref(null)}},render(){const t=!this.$props.validityStyles||this.validity().valid,{label:e,id:i,required:l,tabIndex:u,ariaLabel:r,ariaLabelledBy:o,ariaDescribedBy:p}=this.$props,d=i||this._inputId,s=a.h("input",{...this.$attrs,placeholder:this.$props.placeholder,id:d,tabindex:u,required:l,"aria-label":r,"aria-labelledby":o,"aria-describedby":p,"aria-disabled":this.$props.disabled,disabled:this.$props.disabled,value:this.computedValue,class:this.inputInnerClass,ref:h=>{this.inputRef=h},onKeydown:this.handleKeydown,onKeyup:this.handleKeyup,onKeypress:this.handleKeypress,onChange:this.handleChange,onFocus:this.emitFocus,onBlur:this.emitBlur,onInput:this.handleInput,onAnimationstart:this.handleAutoFill,onAnimationend:this.handleAutoFillEnd});return e?a.createVNode(f.FloatingLabel,{label:e,editorId:d,editorValue:this.computedValue,editorValid:t,editorDisabled:this.$props.disabled,editorPlaceholder:this.$data.focused?this.$props.placeholder:"",dir:this.$props.dir},y(s)?s:{default:()=>[s]}):s},methods:{updateValidClass(){this._input.classList.toggle("k-invalid",!this.validity().valid)},emitFocus(t){this.$emit("focus",{event:t}),this.$data.focused=!0},emitBlur(t){this.$emit("blur",{event:t}),this.$data.focused=!1},handleKeydown(t){this.$emit("keydown",t)},handleKeyup(t){this.$emit("keyup",t)},handleKeypress(t){this.$emit("keypress",t)},clearClick(t){this.emitUpdate(t,"change","")},focus(){this._input&&this._input.focus()},validity(){const t={badInput:this._input?this._input.validity.badInput:!1,patternMismatch:this._input?this._input.validity.patternMismatch:!1,rangeOverflow:this._input?this._input.validity.rangeOverflow:!1,rangeUnderflow:this._input?this._input.validity.rangeUnderflow:!1,stepMismatch:this._input?this._input.validity.stepMismatch:!1,tooLong:this._input?this._input.validity.tooLong:!1,tooShort:this._input?this._input.validity.tooShort:!1,typeMismatch:this._input?this._input.validity.typeMismatch:!1,valueMissing:this._input?this._input.validity.valueMissing:!1};return{...t,customError:this.$props.validationMessage!==void 0,valid:this.$props.valid!==void 0?this.$props.valid:this._input?!this.isInvalid(t):!0}},isInvalid(t){let e=!1;for(let i in t)t.hasOwnProperty(i)&&(e=e||t[i]);return e},setValidity(){this._input&&this._input.setCustomValidity&&this._input.setCustomValidity(this.validity().valid?"":this.$props.validationMessage||"")},handleInput(t){this.emitUpdate(t,"input",t.target.value)},handleChange(t){this.emitUpdate(t,"change",t.target.value)},emitUpdate(t,e,i){this.disabled||(this.$data.currentValue=i,this.$data.valueDuringOnChange=i,this.$nextTick(()=>{this.$emit("changemodel",i),this.$emit("update:modelValue",i),this.$emit(e,{event:t,value:i,component:this,target:t.target,validity:this.validity()}),this.$data.valueDuringOnChange=void 0}))},handleAutoFill(t){if(t.animationName==="autoFillStart"){let e=t.target.parentNode;e&&e.classList.contains("k-empty")&&(this.$data.autofill=!0,e.classList.remove("k-empty"))}},handleAutoFillEnd(t){t.animationName==="autoFillEnd"&&t.target.parentNode&&(this.$data.autofill=!1)},name:function(){return this.$props.name}},computed:{spanClassNames(){const t=!this.$data.hasMounted||!this.$props.validityStyles||this.validity().valid;return{"k-floating-label-container":!0,"k-focus":this.$data.focused,"k-empty":!(this.computedValue===0||this.computedValue||this.$props.placeholder||this.$data.autofill),"k-autofill":this.$data.autofill,"k-invalid":!t&&t!==void 0,"k-rtl":this.$props.dir==="rtl"}},inputInnerClass(){const{size:t,fillMode:e,rounded:i}=this.$props,l=!this.$data.hasMounted||!this.$props.validityStyles||this.validity().valid;return{"k-input":!0,[`k-input-${n.kendoThemeMaps.sizeMap[t]||t}`]:t,[`k-input-${e}`]:e,[`k-rounded-${n.kendoThemeMaps.roundedMap[i]||i}`]:i,"k-invalid":!l,"k-required":this.required,"k-disabled":this.$props.disabled,[this.inputClass]:this.inputClass}},computedValue(){return this.$data.valueDuringOnChange!==void 0?this.$data.valueDuringOnChange:this.$props.value!==void 0?this.$props.value:this.$props.modelValue!==void 0?this.$props.modelValue:this.$data.currentValue}}});exports.Input=m;
|
package/input/Input.mjs
CHANGED
|
@@ -133,10 +133,10 @@ const M = /* @__PURE__ */ h({
|
|
|
133
133
|
id: n,
|
|
134
134
|
tabindex: d,
|
|
135
135
|
required: s,
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
136
|
+
"aria-label": u,
|
|
137
|
+
"aria-labelledby": r,
|
|
138
|
+
"aria-describedby": o,
|
|
139
|
+
"aria-disabled": this.$props.disabled,
|
|
140
140
|
disabled: this.$props.disabled,
|
|
141
141
|
value: this.computedValue,
|
|
142
142
|
class: this.inputInnerClass,
|
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("vue"),i=require("@progress/kendo-vue-common"),$=require("@progress/kendo-vue-intl"),g=require("@progress/kendo-vue-buttons"),r=require("../messages/main.js"),a=require("./utils/main.js"),S=require("../package-metadata.js"),h=require("@progress/kendo-svg-icons"),k="Please enter a valid value!",y=s.defineComponent({model:{event:"changemodel"},emits:{change:t=>!0,changemodel:t=>!0,"update:modelValue":t=>!0,focus:t=>!0,blur:t=>!0},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,validator:function(t){return["small","medium","large"].includes(t)}},rounded:{type:String,validator:function(t){return["none","small","medium","large","full"].includes(t)}},fillMode:{type:String,validator:function(t){return["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,inputAttributes:Object},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(){i.validatePackage(S.packageMetadata),this._textBeforeInput="",this._inputId=i.guid(),this.$data.currentLooseValue=null,this.$data.valueDuringOnChange=void 0,this._intl=$.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=i.getRef(this,"input"),this._elementWrapper=this.elementWrapperRef,this.$data.hasMounted=!0,this._input&&(this._textBeforeInput=this._input.value),this.setValidity()},updated(){!(i.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 a.formatValue(this.$data.focused?this.$data.currentLooseValue:a.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:d}=this.$props,u=!this.$props.validityStyles||this.validity().valid;return{"k-input":!0,"k-numerictextbox":!0,[`k-input-${i.kendoThemeMaps.sizeMap[t]||t}`]:t,[`k-input-${e}`]:e,[`k-rounded-${i.kendoThemeMaps.roundedMap[n]||n}`]:n,"k-invalid":!u,"k-required":l,"k-disabled":d,"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",{event:t})},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",{event:t})},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||k)},getCurrentState(){return{eventValue:a.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,a.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=a.formatValue(a.rangeValue(e.eventValue,this.$props.min,this.$props.max),this.$props.format,this._intl),l=a.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 u=this._elementWrapper;u&&u.className.indexOf("k-invalid")===-1&&(this.$data.isInvalid=!0,setTimeout(()=>{this.$data.isInvalid=!1},50))}const d=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,d&&(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();a.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();a.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){!i.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,d,u;const c=this.parseNumber(String(e.currentLooseValue));if(e.selectionEnd>e.selectionStart&&e.selectionEnd-e.selectionStart===String(e.currentLooseValue).length){const o=this._intl.numberSymbols(),p=o&&t.key===o.minusSign,m=o&&t.key===o.decimal;this.$data.isPaste=!p&&!m;return}switch(t.keyCode){case 38:a.increaseValue(c,e,this.$props.step,this.$props.min,this.$props.max,this.$props.format,this._intl);break;case 40:a.decreaseValue(c,e,this.$props.step,this.$props.min,this.$props.max,this.$props.format,this._intl);break;case 13:n=a.formatValue(a.rangeValue(c,this.$props.min,this.$props.max),this.$props.format,this._intl),l=a.rangeValue(this.parseNumber(n),this.$props.min,this.$props.max),e.eventValue=l,e.currentLooseValue=a.formatValue(l,this.$props.format,this._intl),e.selectionStart=e.selectionEnd=e.currentLooseValue.length;break;case 110:d=this._input,u=this._intl.numberSymbols(),d&&(e.currentLooseValue=e.currentLooseValue.slice(0,e.selectionStart)+u.decimal+e.currentLooseValue.slice(e.selectionEnd),e.selectionStart=e.selectionEnd=e.selectionStart+1,e=a.sanitizeNumber(e,this.$props.format,this._intl));break;default:return}t.preventDefault(),this.triggerChange(t,e)},spinnersWrapperMouseDown(t){i.canUseDOM&&this._input&&(t.preventDefault(),document.activeElement!==this._input&&this._input.focus())}},setup(){const t=s.ref(null),e=s.ref(null),n=s.inject("kendoLocalizationService",{}),l=s.inject("kendoIntlService",{});return{inputRef:t,elementWrapperRef:e,kendoLocalizationService:n,kendoIntlService:l}},render(){const{iconName:t,showValidationIcon:e,showLoadingIcon:n,showClearButton:l,inputAttributes:d}=this.$props,u=this.$props.id||this._inputId,c=i.getDefaultSlots(this),o=$.provideLocalizationService(this),p=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 m=i.templateRendering.call(this,this.$props.inputPrefix,i.getListeners.call(this)),V=i.templateRendering.call(this,this.$props.inputSuffix,i.getListeners.call(this)),v=i.getTemplate.call(this,{h:s.h,template:m,additionalProps:{value:this.computedValue,valid:p}}),b=i.getTemplate.call(this,{h:s.h,template:V,additionalProps:{value:this.computedValue,valid:p}}),f=s.createVNode("span",{dir:this.$props.dir,class:this.wrapperClassNames,style:this.$attrs.style},[t&&s.createVNode(i.Icon,{name:t,class:"k-input-icon"},null),this.$props.inputPrefix&&s.createVNode("span",{class:"k-input-prefix"},[v]),s.createVNode("input",s.mergeProps({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:i.setRef(this,"input")},d),null),this.$props.inputSuffix&&s.createVNode("span",{class:"k-input-suffix"},[b]),e&&p&&s.createVNode(i.Icon,{name:"check",icon:h.checkIcon,class:"k-input-validation-icon"},null),e&&!p&&s.createVNode(i.Icon,{name:"exclamation-circle",icon:h.exclamationCircleIcon,class:"k-input-validation-icon"},null),n&&s.createVNode(i.Icon,{name:"loading",class:"k-input-loading-icon"},null),l&&this.computedValue!==void 0&&this.computedValue!==null&&s.createVNode("span",{onClick:this.clearClick,class:"k-clear-value"},[s.createVNode(i.Icon,{name:"x",icon:h.xIcon},null)]),c,this.$props.spinners&&s.createVNode("span",{class:"k-input-spinner k-spin-button",onMousedown:this.spinnersWrapperMouseDown},[s.createVNode(g.Button,{type:"button",tabIndex:-1,icon:"chevron-up",svgIcon:h.chevronUpIcon,class:"k-spinner-increase",rounded:null,disabled:this.$props.disabled,"aria-label":o.toLanguageString(r.numericIncreaseValue,r.messages[r.numericIncreaseValue]),title:o.toLanguageString(r.numericIncreaseValue,r.messages[r.numericIncreaseValue]),onClick:this.increase},null),s.createVNode(g.Button,{type:"button",tabIndex:-1,class:"k-spinner-decrease",icon:"chevron-down",svgIcon:h.chevronDownIcon,rounded:null,disabled:this.$props.disabled,"aria-label":o.toLanguageString(r.numericDecreaseValue,r.messages[r.numericDecreaseValue]),title:o.toLanguageString(r.numericDecreaseValue,r.messages[r.numericDecreaseValue]),onClick:this.decrease},null)])]);return this.$props.label?s.createVNode("span",{class:this.spanClassNames,onFocusin:this.handleFocus,onFocusout:this.handleBlur,dir:this.$props.dir},[f,this.$props.label?u?s.createVNode("label",{for:u,class:"k-floating-label"},[this.$props.label]):s.createVNode("span",{class:"k-label"},[this.$props.label]):null]):f}});exports.NumericTextBox=y;
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("vue"),i=require("@progress/kendo-vue-common"),$=require("@progress/kendo-vue-intl"),g=require("@progress/kendo-vue-buttons"),r=require("../messages/main.js"),a=require("./utils/main.js"),S=require("../package-metadata.js"),h=require("@progress/kendo-svg-icons"),k="Please enter a valid value!",y=s.defineComponent({model:{event:"changemodel"},emits:{change:t=>!0,changemodel:t=>!0,"update:modelValue":t=>!0,focus:t=>!0,blur:t=>!0},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,validator:function(t){return["small","medium","large"].includes(t)}},rounded:{type:String,validator:function(t){return["none","small","medium","large","full"].includes(t)}},fillMode:{type:String,validator:function(t){return["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,inputAttributes:Object},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(){i.validatePackage(S.packageMetadata),this._textBeforeInput="",this._inputId=i.guid(),this.$data.currentLooseValue=null,this.$data.valueDuringOnChange=void 0,this._intl=$.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=i.getRef(this,"input"),this._elementWrapper=this.elementWrapperRef,this.$data.hasMounted=!0,this._input&&(this._textBeforeInput=this._input.value),this.setValidity()},updated(){!(i.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 a.formatValue(this.$data.focused?this.$data.currentLooseValue:a.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:d}=this.$props,u=!this.$props.validityStyles||this.validity().valid;return{"k-input":!0,"k-numerictextbox":!0,[`k-input-${i.kendoThemeMaps.sizeMap[t]||t}`]:t,[`k-input-${e}`]:e,[`k-rounded-${i.kendoThemeMaps.roundedMap[n]||n}`]:n,"k-invalid":!u,"k-required":l,"k-disabled":d,"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",{event:t})},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",{event:t})},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||k)},getCurrentState(){return{eventValue:a.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,a.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=a.formatValue(a.rangeValue(e.eventValue,this.$props.min,this.$props.max),this.$props.format,this._intl),l=a.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 u=this._elementWrapper;u&&u.className.indexOf("k-invalid")===-1&&(this.$data.isInvalid=!0,setTimeout(()=>{this.$data.isInvalid=!1},50))}const d=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,d&&(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();a.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();a.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){!i.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,d,u;const c=this.parseNumber(String(e.currentLooseValue));if(e.selectionEnd>e.selectionStart&&e.selectionEnd-e.selectionStart===String(e.currentLooseValue).length){const o=this._intl.numberSymbols(),p=o&&t.key===o.minusSign,m=o&&t.key===o.decimal;this.$data.isPaste=!p&&!m;return}switch(t.keyCode){case 38:a.increaseValue(c,e,this.$props.step,this.$props.min,this.$props.max,this.$props.format,this._intl);break;case 40:a.decreaseValue(c,e,this.$props.step,this.$props.min,this.$props.max,this.$props.format,this._intl);break;case 13:n=a.formatValue(a.rangeValue(c,this.$props.min,this.$props.max),this.$props.format,this._intl),l=a.rangeValue(this.parseNumber(n),this.$props.min,this.$props.max),e.eventValue=l,e.currentLooseValue=a.formatValue(l,this.$props.format,this._intl),e.selectionStart=e.selectionEnd=e.currentLooseValue.length;break;case 110:d=this._input,u=this._intl.numberSymbols(),d&&(e.currentLooseValue=e.currentLooseValue.slice(0,e.selectionStart)+u.decimal+e.currentLooseValue.slice(e.selectionEnd),e.selectionStart=e.selectionEnd=e.selectionStart+1,e=a.sanitizeNumber(e,this.$props.format,this._intl));break;default:return}t.preventDefault(),this.triggerChange(t,e)},spinnersWrapperMouseDown(t){i.canUseDOM&&this._input&&(t.preventDefault(),document.activeElement!==this._input&&this._input.focus())}},setup(){const t=s.ref(null),e=s.ref(null),n=s.inject("kendoLocalizationService",{}),l=s.inject("kendoIntlService",{});return{inputRef:t,elementWrapperRef:e,kendoLocalizationService:n,kendoIntlService:l}},render(){const{iconName:t,showValidationIcon:e,showLoadingIcon:n,showClearButton:l,inputAttributes:d}=this.$props,u=this.$props.id||this._inputId,c=i.getDefaultSlots(this),o=$.provideLocalizationService(this),p=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.looseValue;const m=i.templateRendering.call(this,this.$props.inputPrefix,i.getListeners.call(this)),V=i.templateRendering.call(this,this.$props.inputSuffix,i.getListeners.call(this)),v=i.getTemplate.call(this,{h:s.h,template:m,additionalProps:{value:this.computedValue,valid:p}}),b=i.getTemplate.call(this,{h:s.h,template:V,additionalProps:{value:this.computedValue,valid:p}}),f=s.createVNode("span",{dir:this.$props.dir,class:this.wrapperClassNames,style:this.$attrs.style},[t&&s.createVNode(i.Icon,{name:t,class:"k-input-icon"},null),this.$props.inputPrefix&&s.createVNode("span",{class:"k-input-prefix"},[v]),s.createVNode("input",s.mergeProps({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:i.setRef(this,"input")},d),null),this.$props.inputSuffix&&s.createVNode("span",{class:"k-input-suffix"},[b]),e&&p&&s.createVNode(i.Icon,{name:"check",icon:h.checkIcon,class:"k-input-validation-icon"},null),e&&!p&&s.createVNode(i.Icon,{name:"exclamation-circle",icon:h.exclamationCircleIcon,class:"k-input-validation-icon"},null),n&&s.createVNode(i.Icon,{name:"loading",class:"k-input-loading-icon"},null),l&&this.computedValue!==void 0&&this.computedValue!==null&&s.createVNode("span",{onClick:this.clearClick,class:"k-clear-value"},[s.createVNode(i.Icon,{name:"x",icon:h.xIcon},null)]),c,this.$props.spinners&&s.createVNode("span",{class:"k-input-spinner k-spin-button",onMousedown:this.spinnersWrapperMouseDown},[s.createVNode(g.Button,{type:"button",tabIndex:-1,icon:"chevron-up",svgIcon:h.chevronUpIcon,class:"k-spinner-increase",rounded:null,disabled:this.$props.disabled,"aria-label":o.toLanguageString(r.numericIncreaseValue,r.messages[r.numericIncreaseValue]),title:o.toLanguageString(r.numericIncreaseValue,r.messages[r.numericIncreaseValue]),onClick:this.increase},null),s.createVNode(g.Button,{type:"button",tabIndex:-1,class:"k-spinner-decrease",icon:"chevron-down",svgIcon:h.chevronDownIcon,rounded:null,disabled:this.$props.disabled,"aria-label":o.toLanguageString(r.numericDecreaseValue,r.messages[r.numericDecreaseValue]),title:o.toLanguageString(r.numericDecreaseValue,r.messages[r.numericDecreaseValue]),onClick:this.decrease},null)])]);return this.$props.label?s.createVNode("span",{class:this.spanClassNames,onFocusin:this.handleFocus,onFocusout:this.handleBlur,dir:this.$props.dir},[f,this.$props.label?u?s.createVNode("label",{for:u,class:"k-floating-label"},[this.$props.label]):s.createVNode("span",{class:"k-label"},[this.$props.label]):null]):f}});exports.NumericTextBox=y;
|
|
@@ -323,7 +323,7 @@ const G = "Please enter a valid value!", ae = /* @__PURE__ */ B({
|
|
|
323
323
|
showClearButton: a,
|
|
324
324
|
inputAttributes: r
|
|
325
325
|
} = this.$props, n = this.$props.id || this._inputId, o = w(this), l = U(this), u = this.validity().valid;
|
|
326
|
-
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
|
|
326
|
+
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.looseValue;
|
|
327
327
|
const $ = _.call(this, this.$props.inputPrefix, k.call(this)), N = _.call(this, this.$props.inputSuffix, k.call(this)), E = y.call(this, {
|
|
328
328
|
h: V,
|
|
329
329
|
template: $,
|
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const S=11111111111111e-7,he=.31111111111111117,Le=1,ee=1,ne=0,V=/\d/,te=15,Ie=(t,n)=>t!==void 0?t:n,m=(t,n,r)=>t
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const S=11111111111111e-7,he=.31111111111111117,Le=1,ee=1,ne=0,V=/\d/,te=15,Ie=(t,n)=>t!==void 0?t:n,m=(t,n,r)=>t==null?"":typeof t=="string"?t:r.formatNumber(t,n),$=t=>(String(t).split(".")[1]||"").length,re=(t,n)=>Math.max($(t),$(n)),oe=t=>Math.min(t,te),U=(t,n)=>{const r=oe(n);return parseFloat(t.toFixed(r))},Ne=(t,n,r,e,u,o,a)=>{const s=re(t||0,r||0),c=X(U((t||0)+(r||0),s),e,u);n.eventValue=c,n.currentLooseValue=m(c,o,a),n.selectionStart=n.selectionEnd=N(n.currentLooseValue,V)},Pe=(t,n,r,e,u,o,a)=>{const s=re(t||0,r||0),c=X(U((t||0)-(r||0),s),e,u);n.eventValue=c,n.currentLooseValue=m(c,o,a),n.selectionStart=n.selectionEnd=N(n.currentLooseValue,V)},X=(t,n,r)=>t==null?t:!(t>1||t<1||t===1)||r!==void 0&&n!==void 0&&r<n?null:(r!==void 0&&t>r&&(t=r),n!==void 0&&t<n&&(t=n),t),se=(t,n)=>{const r=n.findIndex(([u,o])=>!!o&&t.indexOf(o)===t.length-o.length);if(r===-1)return-1;const e=n[r][1];return t.length-e.length},ue=(t,n)=>{const r=n.findIndex(([u,o])=>!!u&&t.indexOf(u)===0);return r===-1?-1:n[r][0].length},ie=(t,n,r)=>{const e=se(t,n);if(e!==-1&&r.selectionStart>e){r.selectionStart=r.selectionEnd=e;return}r.selectionStart>t.length&&(r.selectionStart=r.selectionEnd=t.length);const u=ue(t,n);u!==-1&&r.selectionStart<u&&(r.selectionStart=r.selectionEnd=u),r.selectionStart===-1&&(r.selectionStart=r.selectionEnd=0)},x=(t,n,r,e)=>{t.selectionStart=t.selectionEnd=n,ie(r,e,t)},M=(t,n,r,e)=>{t.eventValue=e.parseNumber(t.prevLooseValue,n),t.currentLooseValue=t.prevLooseValue,t.valueIsCorrected=!0,x(t,t.selectionStart,t.currentLooseValue,r)},T=(t,n,r)=>n.split(t).length!==r.split(t).length&&n.length===r.length+t.length,ce=(t,n)=>{const r=String(t.currentLooseValue),e=String(t.prevLooseValue);return T(n.minusSign,r,e)||T("-",r,e)||T("−",r,e)},le=(t,n)=>{const r=String(t.currentLooseValue),e=String(t.prevLooseValue);return r.indexOf(n.minusSign)===-1&&e.indexOf(n.minusSign)!==-1},ae=(t,n)=>String(t.currentLooseValue).split(n.decimal).length>2,de=(t,n)=>{const r=n.formatNumber(S,t),e=n.formatNumber(-S,t),u=n.formatNumber(ne,t),o=n.formatNumber(ee,t),a=D(r),s=D(e),c=D(u),l=D(o),P=O(r),C=O(e),b=O(u),h=O(o);return{positiveInfo:[a,P],negativeInfo:[s,C],zeroInfo:[c,b],oneInfo:[l,h]}},ge=(t,n)=>{const r=n.formatNumber(S,t),e=n.formatNumber(-S,t),u=n.formatNumber(ne,t),o=n.formatNumber(ee,t),a=n.numberSymbols(),s=new RegExp(`[\\d\\${a.decimal}${a.group}]`,"g");return[r,e,u,o].map(l=>l.replace(s,"")).join("").split("").filter((l,P,C)=>C.indexOf(l)===P).join("")},y=(t,n)=>{const r=t.indexOf(n.decimal);return r>-1?r:N(t,V)},z=t=>t.split("").reverse().join(""),N=(t,n)=>t.length-z(t).search(n),D=t=>t.split(t[t.search(V)])[0],O=t=>{const n=z(t);return z(n.split(n[n.search(V)])[0])},F=(t,n)=>t.search(n),j=(t,n)=>{const r=t.indexOf(n);return r>-1?t.length-r-1:0},G=(t,n,r,e,u)=>{const o=t.replace(u,"")[0]==="0",a=n.replace(u,"")[0]==="0";if(o&&!a)return r-1;if(a&&e)return r+1;let s=0;for(let l=0;l<r;l++)V.test(t.charAt(l))&&s++;let c=0;for(;s>0&&n.length>c;)V.test(n.charAt(c))&&s--,c++;return c},Ce=(t,n,r)=>{const e={...t},{prevLooseValue:u}=e,o=r.numberSymbols(),a=ge(n,r),s=String(e.currentLooseValue),c=String(u),l=new RegExp(`[^\\d\\${o.decimal}]`,"g"),P=new RegExp(`[^\\d\\${o.decimal}\\${o.group}]`,"g"),C=new RegExp(`[\\d\\${o.decimal}\\${o.group}]`),b=s.replace(l,""),h=F(s,V),E=h===-1?-1:N(s,V),fe=s.indexOf(o.decimal),Z=(s.substring(0,h)+s.substring(h,E).replace(P,"")+s.substring(E,s.length)).split("").filter(p=>a.indexOf(p)!==-1||p.search(C)!==-1).join(""),W=r.formatNumber(he,n).replace(l,""),k=W.indexOf(o.decimal),I=k>-1?W.length-k-1:0,q=r.formatNumber(Le,n).replace(l,""),H=q.indexOf(o.decimal),R=H>-1?q.length-H-1:0,{positiveInfo:me,negativeInfo:Ve,zeroInfo:pe,oneInfo:xe}=de(n,r),g=[me,Ve,pe,xe],be=g.findIndex(p=>p.findIndex(L=>!!L)!==-1)!==1,A=s.length>0&&s.length<c.length,J=typeof n=="string"&&n[0]==="p"&&s&&s.indexOf(o.percentSign)===-1;if(!e.isPaste){if(s==="")return e.eventValue=null,e.currentLooseValue="",e;if(e.currentLooseValue===o.minusSign&&r.formatNumber(-0,n)!==c)return e.eventValue=-0,e.currentLooseValue=m(e.eventValue,n,r),x(e,y(e.currentLooseValue,o),e.currentLooseValue,g),e;if(e.currentLooseValue===o.decimal){e.eventValue=0;const f=m(e.eventValue,n,r);if(R===0&&I>0){const i=N(f,V);e.currentLooseValue=f.substring(0,i)+o.decimal+f.substring(i)}else e.currentLooseValue=f;return x(e,y(e.currentLooseValue,o)+1,e.currentLooseValue,g),e}if(ce(e,o)){const f=r.parseNumber(u,n);e.eventValue=-(f!==null?f:0),e.currentLooseValue=m(e.eventValue,n,r);const i=F(e.currentLooseValue,V),d=F(c,V);return x(e,e.selectionEnd-1+(i-d),e.currentLooseValue,g),e}if(le(e,o))return e.eventValue=r.parseNumber(e.currentLooseValue,n),x(e,e.selectionStart,e.currentLooseValue,g),e;if(ae(e,o))return M(e,n,g,r),e;if(J)return e.eventValue=r.parseNumber(s,n)/100,e.currentLooseValue=m(e.eventValue,n,r),e;if(String(e.currentLooseValue).replace(/[^\d]/g,"").length>te||b!==s&&s&&be&&g.findIndex(([i,d])=>{const B=s.indexOf(i),v=s.indexOf(d),K=B===0,Q=v===s.length-d.length,Y=B+i.length!==h&&h!==-1&&s[B+i.length]!==o.decimal,w=v!==E&&E!==-1&&s[v-1]!==o.decimal;return i&&d?Y||w?!1:K&&Q:i?Y?!1:K:d?w?!1:Q:!1})===-1)return M(e,n,g,r),e;if(b[b.length-1]===o.decimal&&I>0)return e.eventValue=r.parseNumber(s,n),e.currentLooseValue=Z,e;if(e.currentLooseValue&&u&&(a+o.decimal+o.group).split("").findIndex(i=>s.split("").filter(d=>d===i).length<c.split("").filter(d=>d===i).length&&s.length+1===c.length?!(i===o.decimal&&j(c.replace(l,""),o.decimal)===0):!1)>-1)return e.eventValue=r.parseNumber(t.prevLooseValue,n),e.currentLooseValue=t.prevLooseValue,e;const L=j(b,o.decimal),_=b[b.length-1]==="0";if(A&&_&&L<R)return e.eventValue=r.parseNumber(e.currentLooseValue,n),e.currentLooseValue=m(e.eventValue,n,r),e;if(L>0){const f=s.substring(0,fe);if(_&&(!f||c.indexOf(f)!==0)){e.eventValue=r.parseNumber(e.currentLooseValue,n);const i=m(e.eventValue,n,r);return x(e,G(s,i,e.selectionEnd,A,l),i,g),e.currentLooseValue=i,e}if(L>I){const i=s.indexOf(o.decimal),d=s.substring(0,i)+s.substring(i,i+1+I)+s.substring(E,String(e.currentLooseValue).length);return e.eventValue=r.parseNumber(d,n),e.currentLooseValue=d,x(e,e.selectionStart,d,g),e}if(R!==I&&L<=I&&_)return e.eventValue=r.parseNumber(e.currentLooseValue,n),e.currentLooseValue=Z,e;if(L<R)return e.eventValue=r.parseNumber(e.currentLooseValue,n),e.currentLooseValue=m(e.eventValue,n,r),e}}if(e.eventValue=r.parseNumber(e.currentLooseValue,n),J&&(e.eventValue=e.eventValue/100),typeof e.eventValue=="number"){const p=m(e.eventValue,n,r);s.length===1?x(e,y(p,o),p,g):x(e,G(s,p,e.selectionEnd,A,l),p,g),e.currentLooseValue=p}else e.currentLooseValue=m(r.parseNumber(b),n,r);return e};exports.changeBasedSelection=G;exports.decreaseValue=Pe;exports.formatValue=m;exports.fractionLength=$;exports.getDecimalCount=j;exports.getFirstNumberIndex=F;exports.getFormatPrefixSufix=de;exports.getFormatSymbols=ge;exports.getInitialPosition=y;exports.getLastNumberIndex=N;exports.getMaxCursorPosition=se;exports.getMinCursorPosition=ue;exports.getPrefix=D;exports.getStateOrPropsValue=Ie;exports.getSuffix=O;exports.increaseValue=Ne;exports.isDecimalDuplicated=ae;exports.isMinusSymbolAdded=ce;exports.isMinusSymbolRemoved=le;exports.limitPrecision=oe;exports.rangeSelection=ie;exports.rangeValue=X;exports.reverseString=z;exports.sanitizeNumber=Ce;exports.setInvalid=M;exports.setSelection=x;exports.toFixedPrecision=U;
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
const M = 11111111111111e-7, ae = 0.31111111111111117, de = 1, Y = 1, w = 0, m = /\d/, ee = 15, Ne = (t, n) => t !== void 0 ? t : n, p = (t, n, r) => t
|
|
8
|
+
const M = 11111111111111e-7, ae = 0.31111111111111117, de = 1, Y = 1, w = 0, m = /\d/, ee = 15, Ne = (t, n) => t !== void 0 ? t : n, p = (t, n, r) => t == null ? "" : typeof t == "string" ? t : r.formatNumber(t, n), J = (t) => (String(t).split(".")[1] || "").length, ne = (t, n) => Math.max(J(t), J(n)), ge = (t) => Math.min(t, ee), te = (t, n) => {
|
|
9
9
|
const r = ge(n);
|
|
10
10
|
return parseFloat(t.toFixed(r));
|
|
11
11
|
}, Ie = (t, n, r, e, u, o, a) => {
|
package/package-metadata.js
CHANGED
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e={name:"@progress/kendo-vue-inputs",productName:"Kendo UI for Vue",productCode:"KENDOUIVUE",productCodes:["KENDOUIVUE"],publishDate:
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e={name:"@progress/kendo-vue-inputs",productName:"Kendo UI for Vue",productCode:"KENDOUIVUE",productCodes:["KENDOUIVUE"],publishDate: 1784787396,version:"9.1.1-develop.1",licensingDocsUrl:"https://www.telerik.com/kendo-vue-ui/my-license/?utm_medium=product&utm_source=kendovue&utm_campaign=kendo-ui-vue-purchase-license-keys-warning"};exports.packageMetadata=e;
|
package/package-metadata.mjs
CHANGED
|
@@ -10,8 +10,8 @@ const e = {
|
|
|
10
10
|
productName: "Kendo UI for Vue",
|
|
11
11
|
productCode: "KENDOUIVUE",
|
|
12
12
|
productCodes: ["KENDOUIVUE"],
|
|
13
|
-
publishDate:
|
|
14
|
-
version: "9.1.
|
|
13
|
+
publishDate: 1784787396,
|
|
14
|
+
version: "9.1.1-develop.1",
|
|
15
15
|
licensingDocsUrl: "https://www.telerik.com/kendo-vue-ui/my-license/?utm_medium=product&utm_source=kendovue&utm_campaign=kendo-ui-vue-purchase-license-keys-warning"
|
|
16
16
|
};
|
|
17
17
|
export {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@progress/kendo-vue-inputs",
|
|
3
|
-
"version": "9.1.
|
|
3
|
+
"version": "9.1.1-develop.1",
|
|
4
4
|
"description": "TODO",
|
|
5
5
|
"author": "Progress",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
@@ -26,13 +26,13 @@
|
|
|
26
26
|
"peerDependencies": {
|
|
27
27
|
"@progress/kendo-drawing": "^1.21.1",
|
|
28
28
|
"@progress/kendo-licensing": "^1.7.2",
|
|
29
|
-
"@progress/kendo-vue-animation": "9.1.
|
|
30
|
-
"@progress/kendo-vue-buttons": "9.1.
|
|
31
|
-
"@progress/kendo-vue-common": "9.1.
|
|
32
|
-
"@progress/kendo-vue-dialogs": "9.1.
|
|
33
|
-
"@progress/kendo-vue-intl": "9.1.
|
|
34
|
-
"@progress/kendo-vue-labels": "9.1.
|
|
35
|
-
"@progress/kendo-vue-popup": "9.1.
|
|
29
|
+
"@progress/kendo-vue-animation": "9.1.1-develop.1",
|
|
30
|
+
"@progress/kendo-vue-buttons": "9.1.1-develop.1",
|
|
31
|
+
"@progress/kendo-vue-common": "9.1.1-develop.1",
|
|
32
|
+
"@progress/kendo-vue-dialogs": "9.1.1-develop.1",
|
|
33
|
+
"@progress/kendo-vue-intl": "9.1.1-develop.1",
|
|
34
|
+
"@progress/kendo-vue-labels": "9.1.1-develop.1",
|
|
35
|
+
"@progress/kendo-vue-popup": "9.1.1-develop.1",
|
|
36
36
|
"@progress/kendo-svg-icons": "^4.9.0 || ^5.0.0",
|
|
37
37
|
"vue": "^3.0.2"
|
|
38
38
|
},
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"package": {
|
|
56
56
|
"productName": "Kendo UI for Vue",
|
|
57
57
|
"productCode": "KENDOUIVUE",
|
|
58
|
-
"publishDate":
|
|
58
|
+
"publishDate": 1784787396,
|
|
59
59
|
"licensingDocsUrl": "https://www.telerik.com/kendo-vue-ui/my-license/?utm_medium=product&utm_source=kendovue&utm_campaign=kendo-ui-vue-purchase-license-keys-warning"
|
|
60
60
|
}
|
|
61
61
|
},
|
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("vue"),t=require("@progress/kendo-vue-common"),B=require("../package-metadata.js"),N=a.defineComponent({name:"KendoRadioButton",props:{ariaDescribedBy:String,checked:Boolean,disabled:Boolean,className:String,content:[String,Number,Boolean,Object],dataItem:Object,id:String,label:String,labelRender:[String,Number,Boolean,Object],item:[String,Number,Boolean,Object],labelPlacement:String,name:String,index:Number,tag:{type:String,default:"div"},size:{type:String,validator:function(e){return["small","medium","large"].includes(e)}},tabIndex:Number,value:[String,Number,Object],valid:{type:Boolean,default:void 0},role:String},emits:{change:e=>!0,focus:e=>!0,blur:e=>!0},created(){this.calculatedId=t.guid(),t.validatePackage(B.packageMetadata)},mounted(){this.input=t.getRef(this,"input")},computed:{inputClassName(){return{"k-radio":!0,[`k-radio-${t.kendoThemeMaps.sizeMap[this.$props.size]}`]:this.$props.size,"k-invalid":this.$props.valid===!1,[this.$props.className]:this.$props.className}}},methods:{focusElement(){this.input&&this.input.focus()},handleChange(e){this.$emit("change",{event:e,value:this.$props.value})},handleFocus(e){this.$props.disabled||this.$emit("focus",{event:e,target:this})},handleBlur(e){this.$props.disabled||this.$emit("blur",{event:e,target:this})}},setup(){return{inputRef:a.ref(null)}},render(){const e=t.getDefaultSlots(this),{ariaDescribedBy:h,checked:p,disabled:
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("vue"),t=require("@progress/kendo-vue-common"),B=require("../package-metadata.js"),N=a.defineComponent({name:"KendoRadioButton",props:{ariaDescribedBy:String,checked:Boolean,disabled:Boolean,className:String,content:[String,Number,Boolean,Object],dataItem:Object,id:String,label:String,labelRender:[String,Number,Boolean,Object],item:[String,Number,Boolean,Object],labelPlacement:String,name:String,index:Number,tag:{type:String,default:"div"},size:{type:String,validator:function(e){return["small","medium","large"].includes(e)}},tabIndex:Number,value:[String,Number,Object],valid:{type:Boolean,default:void 0},role:String},emits:{change:e=>!0,focus:e=>!0,blur:e=>!0},created(){this.calculatedId=t.guid(),t.validatePackage(B.packageMetadata)},mounted(){this.input=t.getRef(this,"input")},computed:{inputClassName(){return{"k-radio":!0,[`k-radio-${t.kendoThemeMaps.sizeMap[this.$props.size]}`]:this.$props.size,"k-invalid":this.$props.valid===!1,[this.$props.className]:this.$props.className}}},methods:{focusElement(){this.input&&this.input.focus()},handleChange(e){this.$emit("change",{event:e,value:this.$props.value})},handleFocus(e){this.$props.disabled||this.$emit("focus",{event:e,target:this})},handleBlur(e){this.$props.disabled||this.$emit("blur",{event:e,target:this})}},setup(){return{inputRef:a.ref(null)}},render(){const e=t.getDefaultSlots(this),{ariaDescribedBy:h,checked:p,disabled:n,id:l,label:s,labelRender:r,labelPlacement:m,name:b,tabIndex:g,value:f,tag:d,role:S}=this.$props;let i=s;if(r){const v=t.templateRendering.call(this,r,t.getListeners.call(this));i=t.getTemplate.call(this,{h:a.h,template:v})}const o=t.getTemplate.call(this,{h:a.h,template:this.$props.content}),u=i!==void 0?a.createVNode("label",{class:"k-radio-label",for:l||this.calculatedId,style:{userSelect:"none"},"aria-label":s},[i]):null,c=a.createVNode("input",{role:S,type:"radio",id:l||this.calculatedId,name:b,class:this.inputClassName,ref:t.setRef(this,"input"),disabled:n,tabindex:t.getTabIndex(g,n),checked:p,style:this.$attrs.style,"aria-describedby":h,value:f,onChange:this.handleChange,onFocus:this.handleFocus,onBlur:this.handleBlur},null),$=m==="before"?a.h(d,[u,c,o,e]):a.h(d,[c,u,o,e]);return t.getTemplate.call(this,{h:a.h,template:this.$props.item,defaultRendering:$,defaultSlots:e,additionalListeners:{change:this.handleChange,focus:this.handleFocus,blur:this.handleBlur},additionalProps:{dataItem:this.$props.dataItem}})}});exports.RadioButton=N;
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
8
|
import { defineComponent as N, h as t, createVNode as h, ref as R } from "vue";
|
|
9
|
-
import { getDefaultSlots as k, templateRendering as y, getListeners as I, getTemplate as
|
|
9
|
+
import { getDefaultSlots as k, templateRendering as y, getListeners as I, getTemplate as i, getTabIndex as C, setRef as x, kendoThemeMaps as j, getRef as O, guid as z, validatePackage as F } from "@progress/kendo-vue-common";
|
|
10
10
|
import { packageMetadata as L } from "../package-metadata.mjs";
|
|
11
11
|
const M = /* @__PURE__ */ N({
|
|
12
12
|
name: "KendoRadioButton",
|
|
@@ -95,10 +95,10 @@ const M = /* @__PURE__ */ N({
|
|
|
95
95
|
const e = k(this), {
|
|
96
96
|
ariaDescribedBy: p,
|
|
97
97
|
checked: m,
|
|
98
|
-
disabled:
|
|
99
|
-
id:
|
|
100
|
-
label:
|
|
101
|
-
labelRender:
|
|
98
|
+
disabled: l,
|
|
99
|
+
id: n,
|
|
100
|
+
label: s,
|
|
101
|
+
labelRender: r,
|
|
102
102
|
labelPlacement: b,
|
|
103
103
|
name: g,
|
|
104
104
|
tabIndex: f,
|
|
@@ -106,33 +106,33 @@ const M = /* @__PURE__ */ N({
|
|
|
106
106
|
tag: d,
|
|
107
107
|
role: $
|
|
108
108
|
} = this.$props;
|
|
109
|
-
let
|
|
110
|
-
if (
|
|
111
|
-
const v =
|
|
112
|
-
|
|
109
|
+
let a = s;
|
|
110
|
+
if (r) {
|
|
111
|
+
const v = y.call(this, r, I.call(this));
|
|
112
|
+
a = i.call(this, {
|
|
113
113
|
h: t,
|
|
114
114
|
template: v
|
|
115
115
|
});
|
|
116
116
|
}
|
|
117
|
-
const o =
|
|
117
|
+
const o = i.call(this, {
|
|
118
118
|
h: t,
|
|
119
119
|
template: this.$props.content
|
|
120
|
-
}), u =
|
|
120
|
+
}), u = a !== void 0 ? h("label", {
|
|
121
121
|
class: "k-radio-label",
|
|
122
|
-
for:
|
|
122
|
+
for: n || this.calculatedId,
|
|
123
123
|
style: {
|
|
124
124
|
userSelect: "none"
|
|
125
125
|
},
|
|
126
|
-
"aria-label":
|
|
127
|
-
}, [
|
|
126
|
+
"aria-label": s
|
|
127
|
+
}, [a]) : null, c = h("input", {
|
|
128
128
|
role: $,
|
|
129
129
|
type: "radio",
|
|
130
|
-
id:
|
|
130
|
+
id: n || this.calculatedId,
|
|
131
131
|
name: g,
|
|
132
132
|
class: this.inputClassName,
|
|
133
133
|
ref: x(this, "input"),
|
|
134
|
-
disabled:
|
|
135
|
-
tabindex: C(f,
|
|
134
|
+
disabled: l,
|
|
135
|
+
tabindex: C(f, l),
|
|
136
136
|
checked: m,
|
|
137
137
|
style: this.$attrs.style,
|
|
138
138
|
"aria-describedby": p,
|
|
@@ -141,7 +141,7 @@ const M = /* @__PURE__ */ N({
|
|
|
141
141
|
onFocus: this.handleFocus,
|
|
142
142
|
onBlur: this.handleBlur
|
|
143
143
|
}, null), B = b === "before" ? t(d, [u, c, o, e]) : t(d, [c, u, o, e]);
|
|
144
|
-
return
|
|
144
|
+
return i.call(this, {
|
|
145
145
|
h: t,
|
|
146
146
|
template: this.$props.item,
|
|
147
147
|
defaultRendering: B,
|