@progress/kendo-vue-inputs
Advanced tools
Comparing version 0.4.7 to 0.4.8-dev.202003160658
@@ -1,2 +0,2 @@ | ||
!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=3)}([function(e,n){e.exports=t},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); | ||
!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(){},v=n(0),m=(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 m(e,t),e}(n.n(v).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,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:{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.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},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); | ||
/** | ||
@@ -7,2 +7,2 @@ * vue-class-component v7.2.3 | ||
*/ | ||
function o(t){return(o="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 s(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function a(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){p(t,e),Object.getOwnPropertyNames(e.prototype).forEach((function(n){p(t.prototype,e.prototype,n)})),Object.getOwnPropertyNames(e).forEach((function(n){p(t,e,n)}))}function p(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 c={__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 y=["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(y.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 s({},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 o=Object.getPrototypeOf(t.prototype),a=o instanceof r.a?o.constructor:r.a,p=a.extend(e);return g(p,t,a),u()&&l(p,t),p}var m={prototype:!0,arguments:!0,callee:!0,caller:!0};function g(t,e,n){Object.getOwnPropertyNames(e).forEach((function(i){if(!m[i]){var r=Object.getOwnPropertyDescriptor(t,i);if(!r||r.configurable){var s,a,u=Object.getOwnPropertyDescriptor(e,i);if(!c){if("cid"===i)return;var l=Object.getOwnPropertyDescriptor(n,i);if(s=u.value,a=o(s),null!=s&&("object"===a||"function"===a)&&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){y.push.apply(y,a(t))},e.default=b},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 o})),n.d(e,"noop",(function(){return f})),n.d(e,"canUseDOM",(function(){return s})),n.d(e,"focusFirstFocusableChild",(function(){return a})),n.d(e,"clone",(function(){return l})),n.d(e,"cloneArray",(function(){return d})),n.d(e,"cloneValue",(function(){return c})),n.d(e,"cloneObject",(function(){return p})),n.d(e,"cloneDate",(function(){return u})),n.d(e,"VueComponent",(function(){return m})),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},o={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),a=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 p(t,e),e}function p(t,e){for(var n in t)if(t.hasOwnProperty(n)){var i=t[n];e[n]=c(i,e[n])}}function c(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 p(t,n),n}return t}function d(t){return t.map((function(t){return c(t,void 0)}))}var h,f=function(){},y=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)}),m=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return v(e,t),e}(n.n(y).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(4)),i(n(5))},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},o=(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)}),s=function(){return(s=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)},a=function(t,e,n,i){var o,s=arguments.length,a=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"===("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(o=t[u])&&(a=(s<3?o(a):s>3?o(e,n,a):o(e,n))||a);return s>3&&a&&Object.defineProperty(e,n,a),a},u=function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var l=u(n(1)),p=n(2),c=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.hasMounted=!1,e.isEmpty=!1,e.currentValue="",e.valueDuringOnChange="",e.inputId=p.guid(),e.focused=!1,e}return o(e,t),e.prototype.created=function(){this.valueDuringOnChange=void 0,this.currentValue=this.$props.defaultValue},e.prototype.mounted=function(){this.input=this.$refs.input,this.hasMounted=!0},e.prototype.updated=function(){this.setValidity()},e.prototype.handleFocus=function(t){this.focused=!0},e.prototype.handleBlur=function(t){this.focused=!1},e.prototype.focus=function(){this.input&&this.input.focus()},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}),e.prototype.inputClassNames=function(){var t=!this.hasMounted||!this.$props.validityStyles||this.validity().valid;return{"k-textbox":!0,"k-state-invalid":!t&&void 0!==t}},Object.defineProperty(e.prototype,"computedValue",{get:function(){return void 0!==this.valueDuringOnChange?this.valueDuringOnChange:void 0!==this.$props.value?this.$props.value:this.currentValue},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"name",{get:function(){return this.$props.name},enumerable:!0,configurable:!0}),e.prototype.validity=function(){var t={badInput:!!this.input&&this.input.validity.badInput,patternMismatch:!!this.input&&this.input.validity.patternMismatch,rangeOverflow:!!this.input&&this.input.validity.rangeOverflow,rangeUnderflow:!!this.input&&this.input.validity.rangeUnderflow,stepMismatch:!!this.input&&this.input.validity.stepMismatch,tooLong:!!this.input&&this.input.validity.tooLong,typeMismatch:!!this.input&&this.input.validity.typeMismatch,valueMissing:!!this.input&&this.input.validity.valueMissing};return s(s({},t),{customError:void 0!==this.$props.validationMessage,valid:void 0!==this.$props.valid?this.$props.valid:!this.input||!this.isInvalid(t)})},e.prototype.render=function(t){var e=this.$props,n=e.label,i=e.id,r=e.required,o=i||this.inputId,a=t("input",{domProps:s(s({},this.$attrs),{placeholder:this.$props.placeholder,id:o,required:r,value:this.computedValue}),class:s({},this.inputClassNames()),ref:"input",on:{change:this.handleChange,input:this.$listeners.input||this.$listeners.changemodel?this.handleInput:p.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}},[a,n?i?t("label",{attrs:{for:i},class:"k-label"},[n]):t("span",{class:"k-label"},[n]):null]):a},e.prototype.isInvalid=function(t){var e=!1;for(var n in t)t.hasOwnProperty(n)&&(e=e||t[n]);return e},e.prototype.setValidity=function(){this.input&&this.input.setCustomValidity&&this.input.setCustomValidity(this.validity().valid?"":this.$props.validationMessage||"")},e.prototype.handleInput=function(t){this.currentValue=t.target.value,this.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.valueDuringOnChange=void 0}))},e.prototype.handleChange=function(t){this.currentValue=t.target.value,this.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.valueDuringOnChange=void 0}))},e.prototype.handleAutoFill=function(t){if("autoFillStart"===t.animationName){var e=t.target.parentNode;e&&e.classList.contains("k-state-empty")&&(this.isEmpty=!0)}},e.prototype.handleAutoFillEnd=function(t){"autoFillEnd"===t.animationName&&(t.target.parentNode&&(this.isEmpty=!1))},e=a([l.default({model:{event:"changemodel"},inheritAttrs:!1,props:{defaultValue:{type:String,default:""},value:{type:String},label:{type:String},placeholder:String,required:{type:Boolean,default:!1},dir:String,valid:{type:Boolean,default:void 0},validate:{type:Boolean},validationMessage:{type:String},validityStyles:{type:Boolean,default:!0}}})],e)}(p.VueComponent);e.Input=c},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},o=(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)}),s=function(t,e,n,i){var o,s=arguments.length,a=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"===("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(o=t[u])&&(a=(s<3?o(a):s>3?o(e,n,a):o(e,n))||a);return s>3&&a&&Object.defineProperty(e,n,a),a},a=function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var u=a(n(1)),l=n(6),p=n(2),c=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=p.guid(),e}return o(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.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},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(c.numericIncreaseValue,c.messages[c.numericIncreaseValue]),title:n.toLanguageString(c.numericIncreaseValue,c.messages[c.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(c.numericDecreaseValue,c.messages[c.numericDecreaseValue]),title:n.toLanguageString(c.numericDecreaseValue,c.messages[c.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,o=this.symbols.minusSign;if(r===o)return i.value=null,void this.triggerChange(i,t);if(r.split(o).length!==this.textBeforeInput.split(o).length&&r.length===this.textBeforeInput.length+o.length)return i.value=-this.parseNumber(this.textBeforeInput),void this.triggerChange(i,t);var s=this.symbols.decimal;if(r.split(RegExp("\\"+s)).length>2)return i.decimalSelect=!0,void this.triggerChange(i,t);if(r.length>1&&-1===r.indexOf(s)&&this.textBeforeInput.indexOf(s)>=0&&r.length+s.length===this.textBeforeInput.length)return i.decimalSelect=!0,void this.triggerChange(i,t);var a=this.parseNumber(r);if(a===this.currentValue&&r.length>0&&r[r.length-1]===s&&(this.formatNumber(1.1)||"").toString().indexOf(s)>-1)return i.looselyFormattedText=r,void this.triggerChange(i,t);var u=(null===a||isNaN(a))&&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=a,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=s([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)}(p.VueComponent);e.NumericTextBox=d},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 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 v=["data","beforeCreate","created","beforeMount","mounted","beforeDestroy","destroyed","beforeUpdate","updated","activated","deactivated","render","errorCaptured","serverPrefetch"];function m(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(v.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?m(t):function(e){return m(e,t)}}b.registerHooks=function(t){v.push.apply(v,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)}])})); |
@@ -1,3 +0,8 @@ | ||
import { VNode } from 'vue'; | ||
import { VueComponent, FormComponentProps, FormComponentValidity } from '@progress/kendo-vue-common'; | ||
import Vue from 'vue'; | ||
import { FormComponentProps } from '@progress/kendo-vue-common'; | ||
import { RecordPropsDefinition, ComponentOptions } from 'vue/types/options'; | ||
declare type DefaultData<V> = object | ((this: V) => InputData); | ||
declare type DefaultMethods<V> = { | ||
[key: string]: (this: V, ...args: any[]) => any; | ||
}; | ||
/** | ||
@@ -7,3 +12,3 @@ * Represents the props of the [KendoVue Input component]({% slug overview_textbox_native %}). | ||
*/ | ||
export interface InputProps extends HTMLElement, FormComponentProps { | ||
export interface InputProps extends FormComponentProps { | ||
/** | ||
@@ -14,3 +19,5 @@ * Renders a floating label for the Input component. | ||
value?: string | string[] | number; | ||
defaultValue?: string | string[]; | ||
defaultValue?: string | string[] | number | undefined; | ||
validate?: boolean; | ||
dir?: string; | ||
onChange?: Element; | ||
@@ -24,70 +31,31 @@ onFocus?: (event: any) => void; | ||
} | ||
/** | ||
* @hidden | ||
*/ | ||
export declare class Input extends VueComponent<InputProps> { | ||
private hasMounted; | ||
private isEmpty; | ||
private currentValue?; | ||
private valueDuringOnChange?; | ||
private input; | ||
private inputId; | ||
private focused; | ||
created(): void; | ||
/** | ||
* @hidden | ||
*/ | ||
mounted(): void; | ||
/** | ||
* @hidden | ||
*/ | ||
updated(): void; | ||
handleFocus(_: any): void; | ||
handleBlur(_: any): void; | ||
/** | ||
* @hidden | ||
*/ | ||
focus(): void; | ||
get spanClassNames(): { | ||
'k-textbox-container': boolean; | ||
'k-state-focused': Boolean; | ||
'k-state-empty': boolean; | ||
'k-state-invalid': boolean; | ||
'k-rtl': boolean; | ||
}; | ||
inputClassNames(): { | ||
'k-textbox': boolean; | ||
'k-state-invalid': boolean; | ||
}; | ||
/** | ||
* Gets the value of the Input. | ||
*/ | ||
get computedValue(): string | string[] | number | undefined; | ||
/** | ||
* Gets the `name` property of the Input. | ||
*/ | ||
get name(): string | undefined; | ||
/** | ||
* Represents the validity state into which the Input is set. | ||
*/ | ||
validity(): FormComponentValidity; | ||
/** | ||
* @hidden | ||
*/ | ||
render(h: any): VNode; | ||
protected isInvalid(state: Object): boolean; | ||
/** | ||
* @hidden | ||
*/ | ||
protected setValidity(): void; | ||
private handleInput; | ||
private handleChange; | ||
/** | ||
* @hidden | ||
*/ | ||
private handleAutoFill; | ||
/** | ||
* @hidden | ||
*/ | ||
private handleAutoFillEnd; | ||
export interface InputData { | ||
hasMounted?: boolean; | ||
autofill?: boolean; | ||
currentValue?: string | string[] | number; | ||
valueDuringOnChange?: string; | ||
input?: any; | ||
inputId?: string; | ||
focused?: boolean; | ||
} | ||
export interface InputMethods { | ||
handleBlur?: (_: any) => void; | ||
handleFocus?: (_: any) => void; | ||
focus?: () => void; | ||
inputClassNames: () => any; | ||
validity: () => any; | ||
isInvalid: (state: any) => any; | ||
setValidity: () => void; | ||
handleInput?: () => void; | ||
handleChange?: (event: any) => void; | ||
handleAutoFill?: (e: any) => void; | ||
handleAutoFillEnd?: (e: any) => void; | ||
} | ||
export interface InputComputed { | ||
computedValue?: any; | ||
spanClassNames?: any; | ||
} | ||
export interface InputAllMethods extends Vue, InputMethods, InputComputed { | ||
} | ||
declare let Input: ComponentOptions<InputAllMethods, DefaultData<InputData>, DefaultMethods<InputAllMethods>, InputComputed, RecordPropsDefinition<InputProps>>; | ||
export { Input }; |
@@ -1,29 +0,1 @@ | ||
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 __assign = this && this.__assign || function () { | ||
@@ -45,147 +17,67 @@ __assign = Object.assign || function (t) { | ||
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 { VueComponent, guid, noop } from '@progress/kendo-vue-common'; | ||
/** | ||
* @hidden | ||
*/ | ||
// @ts-ignore | ||
var Input = | ||
/** @class */ | ||
function (_super) { | ||
__extends(Input, _super); | ||
function Input() { | ||
var _this = _super !== null && _super.apply(this, arguments) || this; | ||
_this.hasMounted = false; | ||
_this.isEmpty = false; | ||
_this.currentValue = ''; | ||
_this.valueDuringOnChange = ''; | ||
_this.inputId = guid(); | ||
_this.focused = false; | ||
return _this; | ||
} | ||
Input.prototype.created = function () { | ||
this.valueDuringOnChange = undefined; | ||
this.currentValue = this.$props.defaultValue; | ||
}; | ||
/** | ||
* @hidden | ||
*/ | ||
Input.prototype.mounted = function () { | ||
// @ts-ignore | ||
this.input = this.$refs.input; | ||
this.hasMounted = true; | ||
}; | ||
/** | ||
* @hidden | ||
*/ | ||
Input.prototype.updated = function () { | ||
this.setValidity(); | ||
}; | ||
Input.prototype.handleFocus = function (_) { | ||
this.focused = true; | ||
}; | ||
Input.prototype.handleBlur = function (_) { | ||
this.focused = false; | ||
}; | ||
/** | ||
* @hidden | ||
*/ | ||
Input.prototype.focus = function () { | ||
if (this.input) { | ||
this.input.focus(); | ||
} | ||
}; | ||
Object.defineProperty(Input.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' | ||
}; | ||
import { guid, noop } from '@progress/kendo-vue-common'; | ||
var Input = { | ||
model: { | ||
event: 'changemodel' | ||
}, | ||
inheritAttrs: false, | ||
props: { | ||
defaultValue: { | ||
type: [String, Number], | ||
default: '' | ||
}, | ||
enumerable: true, | ||
configurable: true | ||
}); | ||
Input.prototype.inputClassNames = function () { | ||
var isValid = !this.hasMounted || !this.$props.validityStyles || this.validity().valid; | ||
return { | ||
'k-textbox': true, | ||
'k-state-invalid': !isValid && isValid !== undefined | ||
}; | ||
}; | ||
Object.defineProperty(Input.prototype, "computedValue", { | ||
/** | ||
* Gets the value of the Input. | ||
*/ | ||
get: function get() { | ||
return this.valueDuringOnChange !== undefined ? this.valueDuringOnChange : this.$props.value !== undefined ? this.$props.value : this.currentValue; | ||
value: { | ||
type: [String, Number] | ||
}, | ||
enumerable: true, | ||
configurable: true | ||
}); | ||
Object.defineProperty(Input.prototype, "name", { | ||
/** | ||
* Gets the `name` property of the Input. | ||
*/ | ||
get: function get() { | ||
return this.$props.name; | ||
label: { | ||
type: String | ||
}, | ||
enumerable: true, | ||
configurable: true | ||
}); | ||
/** | ||
* Represents the validity state into which the Input is set. | ||
*/ | ||
Input.prototype.validity = function () { | ||
var result = { | ||
badInput: this.input ? this.input.validity.badInput : false, | ||
patternMismatch: this.input ? this.input.validity.patternMismatch : false, | ||
rangeOverflow: this.input ? this.input.validity.rangeOverflow : false, | ||
rangeUnderflow: this.input ? this.input.validity.rangeUnderflow : false, | ||
stepMismatch: this.input ? this.input.validity.stepMismatch : false, | ||
tooLong: this.input ? this.input.validity.tooLong : false, | ||
typeMismatch: this.input ? this.input.validity.typeMismatch : false, | ||
valueMissing: this.input ? this.input.validity.valueMissing : false | ||
placeholder: { | ||
type: String | ||
}, | ||
required: { | ||
type: Boolean, | ||
default: false | ||
}, | ||
dir: { | ||
type: String | ||
}, | ||
valid: { | ||
type: Boolean, | ||
default: undefined | ||
}, | ||
validate: { | ||
type: Boolean | ||
}, | ||
validationMessage: { | ||
type: String | ||
}, | ||
validityStyles: { | ||
type: Boolean, | ||
default: true | ||
} | ||
}, | ||
data: function data() { | ||
return { | ||
hasMounted: false, | ||
autofill: false, | ||
currentValue: '', | ||
valueDuringOnChange: '', | ||
input: null, | ||
inputId: guid(), | ||
focused: false | ||
}; | ||
return __assign(__assign({}, result), { | ||
customError: this.$props.validationMessage !== undefined, | ||
valid: this.$props.valid !== undefined ? this.$props.valid : this.input ? !this.isInvalid(result) : true | ||
}); | ||
}; | ||
/** | ||
* @hidden | ||
*/ | ||
// @ts-ignore | ||
Input.prototype.render = function (h) { | ||
}, | ||
created: function created() { | ||
this.$data.valueDuringOnChange = undefined; | ||
this.$data.currentValue = this.$props.defaultValue; | ||
}, | ||
mounted: function mounted() { | ||
this.$data.input = this.$refs.input; | ||
this.$data.hasMounted = true; | ||
}, | ||
updated: function updated() { | ||
this.setValidity(); | ||
}, | ||
render: function render(h) { | ||
var _a = this.$props, | ||
@@ -195,3 +87,3 @@ label = _a.label, | ||
required = _a.required; | ||
var inputId = id || this.inputId; | ||
var inputId = id || this.$data.inputId; | ||
var textbox = h('input', { | ||
@@ -230,127 +122,127 @@ domProps: __assign(__assign({}, this.$attrs), { | ||
}, [label]) : null]) : textbox; | ||
}; | ||
}, | ||
methods: { | ||
handleBlur: function handleBlur(_) { | ||
this.$data.focused = false; | ||
}, | ||
handleFocus: function handleFocus(_) { | ||
this.$data.focused = true; | ||
}, | ||
focus: function focus() { | ||
if (this.$data.input) { | ||
this.$data.input.focus(); | ||
} | ||
}, | ||
inputClassNames: function inputClassNames() { | ||
var isValid = !this.$data.hasMounted || !this.$props.validityStyles || this.validity().valid; | ||
return { | ||
'k-textbox': true, | ||
'k-state-invalid': !isValid && isValid !== undefined | ||
}; | ||
}, | ||
validity: function validity() { | ||
var result = { | ||
badInput: this.$data.input ? this.$data.input.validity.badInput : false, | ||
patternMismatch: this.$data.input ? this.$data.input.validity.patternMismatch : false, | ||
rangeOverflow: this.$data.input ? this.$data.input.validity.rangeOverflow : false, | ||
rangeUnderflow: this.$data.input ? this.$data.input.validity.rangeUnderflow : false, | ||
stepMismatch: this.$data.input ? this.$data.input.validity.stepMismatch : false, | ||
tooLong: this.$data.input ? this.$data.input.validity.tooLong : false, | ||
typeMismatch: this.$data.input ? this.$data.input.validity.typeMismatch : false, | ||
valueMissing: this.$data.input ? this.$data.input.validity.valueMissing : false | ||
}; | ||
return __assign(__assign({}, result), { | ||
customError: this.$props.validationMessage !== undefined, | ||
valid: this.$props.valid !== undefined ? this.$props.valid : this.$data.input ? !this.isInvalid(result) : true | ||
}); | ||
}, | ||
isInvalid: function isInvalid(state) { | ||
var result = false; | ||
Input.prototype.isInvalid = function (state) { | ||
var result = false; | ||
for (var prop in state) { | ||
if (state.hasOwnProperty(prop)) { | ||
result = result || state[prop]; | ||
} | ||
} | ||
for (var prop in state) { | ||
if (state.hasOwnProperty(prop)) { | ||
result = result || state[prop]; | ||
return result; | ||
}, | ||
setValidity: function setValidity() { | ||
if (this.$data.input && this.$data.input.setCustomValidity) { | ||
this.$data.input.setCustomValidity(this.validity().valid ? '' : this.$props.validationMessage || ''); | ||
} | ||
} | ||
return result; | ||
}; | ||
/** | ||
* @hidden | ||
*/ | ||
Input.prototype.setValidity = function () { | ||
if (this.input && this.input.setCustomValidity) { | ||
this.input.setCustomValidity(this.validity().valid ? '' : this.$props.validationMessage || ''); | ||
} | ||
}; | ||
Input.prototype.handleInput = function (event) { | ||
this.currentValue = event.target.value; | ||
this.valueDuringOnChange = event.target.value; | ||
this.$nextTick(function () { | ||
this.$emit('input', { | ||
event: event, | ||
value: event.target.value, | ||
component: this, | ||
target: event.target, | ||
validity: this.validity() | ||
}, | ||
handleInput: function handleInput(event) { | ||
this.$data.currentValue = event.target.value; | ||
this.$data.valueDuringOnChange = event.target.value; | ||
this.$nextTick(function () { | ||
this.$emit('input', { | ||
event: event, | ||
value: event.target.value, | ||
component: this, | ||
target: event.target, | ||
validity: this.validity() | ||
}); | ||
this.$emit('changemodel', event.target.value); | ||
this.$data.valueDuringOnChange = undefined; | ||
}); | ||
this.$emit('changemodel', event.target.value); | ||
this.valueDuringOnChange = undefined; | ||
}); | ||
}; | ||
Input.prototype.handleChange = function (event) { | ||
this.currentValue = event.target.value; | ||
this.valueDuringOnChange = event.target.value; | ||
this.$nextTick(function () { | ||
this.$emit('change', { | ||
event: event, | ||
value: event.target.value, | ||
component: this, | ||
target: event.target, | ||
validity: this.validity() | ||
}, | ||
handleChange: function handleChange(event) { | ||
this.$data.currentValue = event.target.value; | ||
this.$data.valueDuringOnChange = event.target.value; | ||
this.$nextTick(function () { | ||
this.$emit('change', { | ||
event: event, | ||
value: event.target.value, | ||
component: this, | ||
target: event.target, | ||
validity: this.validity() | ||
}); | ||
this.$emit('changemodel', event.target.value); | ||
this.$data.valueDuringOnChange = undefined; | ||
}); | ||
this.$emit('changemodel', event.target.value); | ||
this.valueDuringOnChange = undefined; | ||
}); | ||
}; | ||
/** | ||
* @hidden | ||
*/ | ||
}, | ||
handleAutoFill: function handleAutoFill(e) { | ||
if (e.animationName === 'autoFillStart') { | ||
var parent_1 = e.target.parentNode; | ||
if (parent_1 && parent_1.classList.contains('k-state-empty')) { | ||
this.$data.autofill = true; | ||
} | ||
} | ||
}, | ||
handleAutoFillEnd: function handleAutoFillEnd(e) { | ||
if (e.animationName === 'autoFillEnd') { | ||
var parent_2 = e.target.parentNode; | ||
Input.prototype.handleAutoFill = function (e) { | ||
if (e.animationName === 'autoFillStart') { | ||
var parent_1 = e.target.parentNode; | ||
if (parent_1 && parent_1.classList.contains('k-state-empty')) { | ||
this.isEmpty = true; | ||
if (parent_2) { | ||
this.$data.autofill = false; | ||
} | ||
} | ||
}, | ||
name: function name() { | ||
return this.$props.name; | ||
} | ||
}; | ||
/** | ||
* @hidden | ||
*/ | ||
Input.prototype.handleAutoFillEnd = function (e) { | ||
if (e.animationName === 'autoFillEnd') { | ||
var parent_2 = e.target.parentNode; | ||
if (parent_2) { | ||
this.isEmpty = false; | ||
}, | ||
computed: { | ||
spanClassNames: { | ||
get: function get() { | ||
var isValid = !this.$data.hasMounted || !this.$props.validityStyles || this.validity().valid; | ||
return { | ||
'k-floating-label-container': true, | ||
'k-state-focused': this.$data.focused, | ||
'k-state-empty': !((this.computedValue === 0 ? true : this.computedValue) || this.$props.placeholder || this.$data.autofill), | ||
'k-autofill': this.$data.autofill, | ||
'k-state-invalid': !isValid && isValid !== undefined, | ||
'k-rtl': this.$props.dir === 'rtl' | ||
}; | ||
} | ||
} | ||
}; | ||
Input = __decorate([Component({ | ||
model: { | ||
event: 'changemodel' | ||
}, | ||
inheritAttrs: false, | ||
props: { | ||
defaultValue: { | ||
type: String, | ||
default: '' | ||
}, | ||
value: { | ||
type: String | ||
}, | ||
label: { | ||
type: String | ||
}, | ||
placeholder: String, | ||
required: { | ||
type: Boolean, | ||
default: false | ||
}, | ||
dir: String, | ||
valid: { | ||
type: Boolean, | ||
default: undefined | ||
}, | ||
validate: { | ||
type: Boolean | ||
}, | ||
validationMessage: { | ||
type: String | ||
}, | ||
validityStyles: { | ||
type: Boolean, | ||
default: true | ||
computedValue: { | ||
get: function get() { | ||
return this.$data.valueDuringOnChange !== undefined ? this.$data.valueDuringOnChange : this.$props.value !== undefined ? this.$props.value : this.$data.currentValue; | ||
} | ||
} | ||
})], Input); | ||
return Input; | ||
}(VueComponent); | ||
} | ||
}; | ||
export { Input }; |
@@ -1,3 +0,8 @@ | ||
import { VNode } from 'vue'; | ||
import { VueComponent, FormComponentProps, FormComponentValidity } from '@progress/kendo-vue-common'; | ||
import Vue from 'vue'; | ||
import { FormComponentProps } from '@progress/kendo-vue-common'; | ||
import { RecordPropsDefinition, ComponentOptions } from 'vue/types/options'; | ||
declare type DefaultData<V> = object | ((this: V) => InputData); | ||
declare type DefaultMethods<V> = { | ||
[key: string]: (this: V, ...args: any[]) => any; | ||
}; | ||
/** | ||
@@ -7,3 +12,3 @@ * Represents the props of the [KendoVue Input component]({% slug overview_textbox_native %}). | ||
*/ | ||
export interface InputProps extends HTMLElement, FormComponentProps { | ||
export interface InputProps extends FormComponentProps { | ||
/** | ||
@@ -14,3 +19,5 @@ * Renders a floating label for the Input component. | ||
value?: string | string[] | number; | ||
defaultValue?: string | string[]; | ||
defaultValue?: string | string[] | number | undefined; | ||
validate?: boolean; | ||
dir?: string; | ||
onChange?: Element; | ||
@@ -24,70 +31,31 @@ onFocus?: (event: any) => void; | ||
} | ||
/** | ||
* @hidden | ||
*/ | ||
export declare class Input extends VueComponent<InputProps> { | ||
private hasMounted; | ||
private isEmpty; | ||
private currentValue?; | ||
private valueDuringOnChange?; | ||
private input; | ||
private inputId; | ||
private focused; | ||
created(): void; | ||
/** | ||
* @hidden | ||
*/ | ||
mounted(): void; | ||
/** | ||
* @hidden | ||
*/ | ||
updated(): void; | ||
handleFocus(_: any): void; | ||
handleBlur(_: any): void; | ||
/** | ||
* @hidden | ||
*/ | ||
focus(): void; | ||
get spanClassNames(): { | ||
'k-textbox-container': boolean; | ||
'k-state-focused': Boolean; | ||
'k-state-empty': boolean; | ||
'k-state-invalid': boolean; | ||
'k-rtl': boolean; | ||
}; | ||
inputClassNames(): { | ||
'k-textbox': boolean; | ||
'k-state-invalid': boolean; | ||
}; | ||
/** | ||
* Gets the value of the Input. | ||
*/ | ||
get computedValue(): string | string[] | number | undefined; | ||
/** | ||
* Gets the `name` property of the Input. | ||
*/ | ||
get name(): string | undefined; | ||
/** | ||
* Represents the validity state into which the Input is set. | ||
*/ | ||
validity(): FormComponentValidity; | ||
/** | ||
* @hidden | ||
*/ | ||
render(h: any): VNode; | ||
protected isInvalid(state: Object): boolean; | ||
/** | ||
* @hidden | ||
*/ | ||
protected setValidity(): void; | ||
private handleInput; | ||
private handleChange; | ||
/** | ||
* @hidden | ||
*/ | ||
private handleAutoFill; | ||
/** | ||
* @hidden | ||
*/ | ||
private handleAutoFillEnd; | ||
export interface InputData { | ||
hasMounted?: boolean; | ||
autofill?: boolean; | ||
currentValue?: string | string[] | number; | ||
valueDuringOnChange?: string; | ||
input?: any; | ||
inputId?: string; | ||
focused?: boolean; | ||
} | ||
export interface InputMethods { | ||
handleBlur?: (_: any) => void; | ||
handleFocus?: (_: any) => void; | ||
focus?: () => void; | ||
inputClassNames: () => any; | ||
validity: () => any; | ||
isInvalid: (state: any) => any; | ||
setValidity: () => void; | ||
handleInput?: () => void; | ||
handleChange?: (event: any) => void; | ||
handleAutoFill?: (e: any) => void; | ||
handleAutoFillEnd?: (e: any) => void; | ||
} | ||
export interface InputComputed { | ||
computedValue?: any; | ||
spanClassNames?: any; | ||
} | ||
export interface InputAllMethods extends Vue, InputMethods, InputComputed { | ||
} | ||
declare let Input: ComponentOptions<InputAllMethods, DefaultData<InputData>, DefaultMethods<InputAllMethods>, InputComputed, RecordPropsDefinition<InputProps>>; | ||
export { Input }; |
"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 __assign = undefined && undefined.__assign || function () { | ||
@@ -47,12 +19,2 @@ __assign = Object.assign || function (t) { | ||
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", { | ||
@@ -62,139 +24,68 @@ value: true | ||
var vue_class_component_1 = require("vue-class-component"); | ||
var kendo_vue_common_1 = require("@progress/kendo-vue-common"); | ||
/** | ||
* @hidden | ||
*/ | ||
// @ts-ignore | ||
var Input = | ||
/** @class */ | ||
function (_super) { | ||
__extends(Input, _super); | ||
function Input() { | ||
var _this = _super !== null && _super.apply(this, arguments) || this; | ||
_this.hasMounted = false; | ||
_this.isEmpty = false; | ||
_this.currentValue = ''; | ||
_this.valueDuringOnChange = ''; | ||
_this.inputId = kendo_vue_common_1.guid(); | ||
_this.focused = false; | ||
return _this; | ||
} | ||
Input.prototype.created = function () { | ||
this.valueDuringOnChange = undefined; | ||
this.currentValue = this.$props.defaultValue; | ||
}; | ||
/** | ||
* @hidden | ||
*/ | ||
Input.prototype.mounted = function () { | ||
// @ts-ignore | ||
this.input = this.$refs.input; | ||
this.hasMounted = true; | ||
}; | ||
/** | ||
* @hidden | ||
*/ | ||
Input.prototype.updated = function () { | ||
this.setValidity(); | ||
}; | ||
Input.prototype.handleFocus = function (_) { | ||
this.focused = true; | ||
}; | ||
Input.prototype.handleBlur = function (_) { | ||
this.focused = false; | ||
}; | ||
/** | ||
* @hidden | ||
*/ | ||
Input.prototype.focus = function () { | ||
if (this.input) { | ||
this.input.focus(); | ||
} | ||
}; | ||
Object.defineProperty(Input.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' | ||
}; | ||
var Input = { | ||
model: { | ||
event: 'changemodel' | ||
}, | ||
inheritAttrs: false, | ||
props: { | ||
defaultValue: { | ||
type: [String, Number], | ||
default: '' | ||
}, | ||
enumerable: true, | ||
configurable: true | ||
}); | ||
Input.prototype.inputClassNames = function () { | ||
var isValid = !this.hasMounted || !this.$props.validityStyles || this.validity().valid; | ||
return { | ||
'k-textbox': true, | ||
'k-state-invalid': !isValid && isValid !== undefined | ||
}; | ||
}; | ||
Object.defineProperty(Input.prototype, "computedValue", { | ||
/** | ||
* Gets the value of the Input. | ||
*/ | ||
get: function get() { | ||
return this.valueDuringOnChange !== undefined ? this.valueDuringOnChange : this.$props.value !== undefined ? this.$props.value : this.currentValue; | ||
value: { | ||
type: [String, Number] | ||
}, | ||
enumerable: true, | ||
configurable: true | ||
}); | ||
Object.defineProperty(Input.prototype, "name", { | ||
/** | ||
* Gets the `name` property of the Input. | ||
*/ | ||
get: function get() { | ||
return this.$props.name; | ||
label: { | ||
type: String | ||
}, | ||
enumerable: true, | ||
configurable: true | ||
}); | ||
/** | ||
* Represents the validity state into which the Input is set. | ||
*/ | ||
Input.prototype.validity = function () { | ||
var result = { | ||
badInput: this.input ? this.input.validity.badInput : false, | ||
patternMismatch: this.input ? this.input.validity.patternMismatch : false, | ||
rangeOverflow: this.input ? this.input.validity.rangeOverflow : false, | ||
rangeUnderflow: this.input ? this.input.validity.rangeUnderflow : false, | ||
stepMismatch: this.input ? this.input.validity.stepMismatch : false, | ||
tooLong: this.input ? this.input.validity.tooLong : false, | ||
typeMismatch: this.input ? this.input.validity.typeMismatch : false, | ||
valueMissing: this.input ? this.input.validity.valueMissing : false | ||
placeholder: { | ||
type: String | ||
}, | ||
required: { | ||
type: Boolean, | ||
default: false | ||
}, | ||
dir: { | ||
type: String | ||
}, | ||
valid: { | ||
type: Boolean, | ||
default: undefined | ||
}, | ||
validate: { | ||
type: Boolean | ||
}, | ||
validationMessage: { | ||
type: String | ||
}, | ||
validityStyles: { | ||
type: Boolean, | ||
default: true | ||
} | ||
}, | ||
data: function data() { | ||
return { | ||
hasMounted: false, | ||
autofill: false, | ||
currentValue: '', | ||
valueDuringOnChange: '', | ||
input: null, | ||
inputId: kendo_vue_common_1.guid(), | ||
focused: false | ||
}; | ||
return __assign(__assign({}, result), { | ||
customError: this.$props.validationMessage !== undefined, | ||
valid: this.$props.valid !== undefined ? this.$props.valid : this.input ? !this.isInvalid(result) : true | ||
}); | ||
}; | ||
/** | ||
* @hidden | ||
*/ | ||
// @ts-ignore | ||
Input.prototype.render = function (h) { | ||
}, | ||
created: function created() { | ||
this.$data.valueDuringOnChange = undefined; | ||
this.$data.currentValue = this.$props.defaultValue; | ||
}, | ||
mounted: function mounted() { | ||
this.$data.input = this.$refs.input; | ||
this.$data.hasMounted = true; | ||
}, | ||
updated: function updated() { | ||
this.setValidity(); | ||
}, | ||
render: function render(h) { | ||
var _a = this.$props, | ||
@@ -204,3 +95,3 @@ label = _a.label, | ||
required = _a.required; | ||
var inputId = id || this.inputId; | ||
var inputId = id || this.$data.inputId; | ||
var textbox = h('input', { | ||
@@ -239,127 +130,127 @@ domProps: __assign(__assign({}, this.$attrs), { | ||
}, [label]) : null]) : textbox; | ||
}; | ||
}, | ||
methods: { | ||
handleBlur: function handleBlur(_) { | ||
this.$data.focused = false; | ||
}, | ||
handleFocus: function handleFocus(_) { | ||
this.$data.focused = true; | ||
}, | ||
focus: function focus() { | ||
if (this.$data.input) { | ||
this.$data.input.focus(); | ||
} | ||
}, | ||
inputClassNames: function inputClassNames() { | ||
var isValid = !this.$data.hasMounted || !this.$props.validityStyles || this.validity().valid; | ||
return { | ||
'k-textbox': true, | ||
'k-state-invalid': !isValid && isValid !== undefined | ||
}; | ||
}, | ||
validity: function validity() { | ||
var result = { | ||
badInput: this.$data.input ? this.$data.input.validity.badInput : false, | ||
patternMismatch: this.$data.input ? this.$data.input.validity.patternMismatch : false, | ||
rangeOverflow: this.$data.input ? this.$data.input.validity.rangeOverflow : false, | ||
rangeUnderflow: this.$data.input ? this.$data.input.validity.rangeUnderflow : false, | ||
stepMismatch: this.$data.input ? this.$data.input.validity.stepMismatch : false, | ||
tooLong: this.$data.input ? this.$data.input.validity.tooLong : false, | ||
typeMismatch: this.$data.input ? this.$data.input.validity.typeMismatch : false, | ||
valueMissing: this.$data.input ? this.$data.input.validity.valueMissing : false | ||
}; | ||
return __assign(__assign({}, result), { | ||
customError: this.$props.validationMessage !== undefined, | ||
valid: this.$props.valid !== undefined ? this.$props.valid : this.$data.input ? !this.isInvalid(result) : true | ||
}); | ||
}, | ||
isInvalid: function isInvalid(state) { | ||
var result = false; | ||
Input.prototype.isInvalid = function (state) { | ||
var result = false; | ||
for (var prop in state) { | ||
if (state.hasOwnProperty(prop)) { | ||
result = result || state[prop]; | ||
} | ||
} | ||
for (var prop in state) { | ||
if (state.hasOwnProperty(prop)) { | ||
result = result || state[prop]; | ||
return result; | ||
}, | ||
setValidity: function setValidity() { | ||
if (this.$data.input && this.$data.input.setCustomValidity) { | ||
this.$data.input.setCustomValidity(this.validity().valid ? '' : this.$props.validationMessage || ''); | ||
} | ||
} | ||
return result; | ||
}; | ||
/** | ||
* @hidden | ||
*/ | ||
Input.prototype.setValidity = function () { | ||
if (this.input && this.input.setCustomValidity) { | ||
this.input.setCustomValidity(this.validity().valid ? '' : this.$props.validationMessage || ''); | ||
} | ||
}; | ||
Input.prototype.handleInput = function (event) { | ||
this.currentValue = event.target.value; | ||
this.valueDuringOnChange = event.target.value; | ||
this.$nextTick(function () { | ||
this.$emit('input', { | ||
event: event, | ||
value: event.target.value, | ||
component: this, | ||
target: event.target, | ||
validity: this.validity() | ||
}, | ||
handleInput: function handleInput(event) { | ||
this.$data.currentValue = event.target.value; | ||
this.$data.valueDuringOnChange = event.target.value; | ||
this.$nextTick(function () { | ||
this.$emit('input', { | ||
event: event, | ||
value: event.target.value, | ||
component: this, | ||
target: event.target, | ||
validity: this.validity() | ||
}); | ||
this.$emit('changemodel', event.target.value); | ||
this.$data.valueDuringOnChange = undefined; | ||
}); | ||
this.$emit('changemodel', event.target.value); | ||
this.valueDuringOnChange = undefined; | ||
}); | ||
}; | ||
Input.prototype.handleChange = function (event) { | ||
this.currentValue = event.target.value; | ||
this.valueDuringOnChange = event.target.value; | ||
this.$nextTick(function () { | ||
this.$emit('change', { | ||
event: event, | ||
value: event.target.value, | ||
component: this, | ||
target: event.target, | ||
validity: this.validity() | ||
}, | ||
handleChange: function handleChange(event) { | ||
this.$data.currentValue = event.target.value; | ||
this.$data.valueDuringOnChange = event.target.value; | ||
this.$nextTick(function () { | ||
this.$emit('change', { | ||
event: event, | ||
value: event.target.value, | ||
component: this, | ||
target: event.target, | ||
validity: this.validity() | ||
}); | ||
this.$emit('changemodel', event.target.value); | ||
this.$data.valueDuringOnChange = undefined; | ||
}); | ||
this.$emit('changemodel', event.target.value); | ||
this.valueDuringOnChange = undefined; | ||
}); | ||
}; | ||
/** | ||
* @hidden | ||
*/ | ||
}, | ||
handleAutoFill: function handleAutoFill(e) { | ||
if (e.animationName === 'autoFillStart') { | ||
var parent_1 = e.target.parentNode; | ||
if (parent_1 && parent_1.classList.contains('k-state-empty')) { | ||
this.$data.autofill = true; | ||
} | ||
} | ||
}, | ||
handleAutoFillEnd: function handleAutoFillEnd(e) { | ||
if (e.animationName === 'autoFillEnd') { | ||
var parent_2 = e.target.parentNode; | ||
Input.prototype.handleAutoFill = function (e) { | ||
if (e.animationName === 'autoFillStart') { | ||
var parent_1 = e.target.parentNode; | ||
if (parent_1 && parent_1.classList.contains('k-state-empty')) { | ||
this.isEmpty = true; | ||
if (parent_2) { | ||
this.$data.autofill = false; | ||
} | ||
} | ||
}, | ||
name: function name() { | ||
return this.$props.name; | ||
} | ||
}; | ||
/** | ||
* @hidden | ||
*/ | ||
Input.prototype.handleAutoFillEnd = function (e) { | ||
if (e.animationName === 'autoFillEnd') { | ||
var parent_2 = e.target.parentNode; | ||
if (parent_2) { | ||
this.isEmpty = false; | ||
}, | ||
computed: { | ||
spanClassNames: { | ||
get: function get() { | ||
var isValid = !this.$data.hasMounted || !this.$props.validityStyles || this.validity().valid; | ||
return { | ||
'k-floating-label-container': true, | ||
'k-state-focused': this.$data.focused, | ||
'k-state-empty': !((this.computedValue === 0 ? true : this.computedValue) || this.$props.placeholder || this.$data.autofill), | ||
'k-autofill': this.$data.autofill, | ||
'k-state-invalid': !isValid && isValid !== undefined, | ||
'k-rtl': this.$props.dir === 'rtl' | ||
}; | ||
} | ||
} | ||
}; | ||
Input = __decorate([vue_class_component_1.default({ | ||
model: { | ||
event: 'changemodel' | ||
}, | ||
inheritAttrs: false, | ||
props: { | ||
defaultValue: { | ||
type: String, | ||
default: '' | ||
}, | ||
value: { | ||
type: String | ||
}, | ||
label: { | ||
type: String | ||
}, | ||
placeholder: String, | ||
required: { | ||
type: Boolean, | ||
default: false | ||
}, | ||
dir: String, | ||
valid: { | ||
type: Boolean, | ||
default: undefined | ||
}, | ||
validate: { | ||
type: Boolean | ||
}, | ||
validationMessage: { | ||
type: String | ||
}, | ||
validityStyles: { | ||
type: Boolean, | ||
default: true | ||
computedValue: { | ||
get: function get() { | ||
return this.$data.valueDuringOnChange !== undefined ? this.$data.valueDuringOnChange : this.$props.value !== undefined ? this.$props.value : this.$data.currentValue; | ||
} | ||
} | ||
})], Input); | ||
return Input; | ||
}(kendo_vue_common_1.VueComponent); | ||
} | ||
}; | ||
exports.Input = Input; |
@@ -1,1 +0,1 @@ | ||
System.register("@progress/kendo-vue-inputs",["vue-class-component","@progress/kendo-vue-common","@progress/kendo-vue-intl"],function(s){var o,a,l;function e(t){return t.__useDefault?t.default:t}return{setters:[function(t){o=e(t)},function(t){a=e(t)},function(t){l=e(t)}],execute:function(){function r(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,r),e.l=!0,e.exports}var i,n;n={},r.m=i=[function(t,e){t.exports=o},function(t,e){t.exports=a},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(3)),n(e(4)),function(t){for(var e in t)s(e,t[e])}(i)},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},r=(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)}),a=function(){return(a=Object.assign||function(t){for(var e,i=1,n=arguments.length;i<n;i++)for(var r in e=arguments[i])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0});var s,o,u=(o=i(0))&&o.__esModule?o:{default:o},p=i(1),h=(s=p.VueComponent,r(c,s),c.prototype.created=function(){this.valueDuringOnChange=void 0,this.currentValue=this.$props.defaultValue},c.prototype.mounted=function(){this.input=this.$refs.input,this.hasMounted=!0},c.prototype.updated=function(){this.setValidity()},c.prototype.handleFocus=function(t){this.focused=!0},c.prototype.handleBlur=function(t){this.focused=!1},c.prototype.focus=function(){this.input&&this.input.focus()},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}),c.prototype.inputClassNames=function(){var t=!this.hasMounted||!this.$props.validityStyles||this.validity().valid;return{"k-textbox":!0,"k-state-invalid":!t&&void 0!==t}},Object.defineProperty(c.prototype,"computedValue",{get:function(){return void 0!==this.valueDuringOnChange?this.valueDuringOnChange:void 0!==this.$props.value?this.$props.value:this.currentValue},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"name",{get:function(){return this.$props.name},enumerable:!0,configurable:!0}),c.prototype.validity=function(){var t={badInput:!!this.input&&this.input.validity.badInput,patternMismatch:!!this.input&&this.input.validity.patternMismatch,rangeOverflow:!!this.input&&this.input.validity.rangeOverflow,rangeUnderflow:!!this.input&&this.input.validity.rangeUnderflow,stepMismatch:!!this.input&&this.input.validity.stepMismatch,tooLong:!!this.input&&this.input.validity.tooLong,typeMismatch:!!this.input&&this.input.validity.typeMismatch,valueMissing:!!this.input&&this.input.validity.valueMissing};return a(a({},t),{customError:void 0!==this.$props.validationMessage,valid:void 0!==this.$props.valid?this.$props.valid:!this.input||!this.isInvalid(t)})},c.prototype.render=function(t){var e=this.$props,i=e.label,n=e.id,r=e.required,s=n||this.inputId,o=t("input",{domProps:a(a({},this.$attrs),{placeholder:this.$props.placeholder,id:s,required:r,value:this.computedValue}),class:a({},this.inputClassNames()),ref:"input",on:{change:this.handleChange,input:this.$listeners.input||this.$listeners.changemodel?this.handleInput:p.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}},[o,i?n?t("label",{attrs:{for:n},class:"k-label"},[i]):t("span",{class:"k-label"},[i]):null]):o},c.prototype.isInvalid=function(t){var e=!1;for(var i in t)t.hasOwnProperty(i)&&(e=e||t[i]);return e},c.prototype.setValidity=function(){this.input&&this.input.setCustomValidity&&this.input.setCustomValidity(!this.validity().valid&&this.$props.validationMessage||"")},c.prototype.handleInput=function(t){this.currentValue=t.target.value,this.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.valueDuringOnChange=void 0})},c.prototype.handleChange=function(t){this.currentValue=t.target.value,this.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.valueDuringOnChange=void 0})},c.prototype.handleAutoFill=function(t){if("autoFillStart"===t.animationName){var e=t.target.parentNode;e&&e.classList.contains("k-state-empty")&&(this.isEmpty=!0)}},c.prototype.handleAutoFillEnd=function(t){"autoFillEnd"===t.animationName&&t.target.parentNode&&(this.isEmpty=!1)},function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"===("undefined"==typeof Reflect?"undefined":l(Reflect))&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;0<=a;a--)(r=t[a])&&(o=(s<3?r(o):3<s?r(e,i,o):r(e,i))||o);return 3<s&&o&&Object.defineProperty(e,i,o),o}([u.default({model:{event:"changemodel"},inheritAttrs:!1,props:{defaultValue:{type:String,default:""},value:{type:String},label:{type:String},placeholder:String,required:{type:Boolean,default:!1},dir:String,valid:{type:Boolean,default:void 0},validate:{type:Boolean},validationMessage:{type:String},validityStyles:{type:Boolean,default:!0}}})],c));function c(){var t=null!==s&&s.apply(this,arguments)||this;return t.hasMounted=!1,t.isEmpty=!1,t.currentValue="",t.valueDuringOnChange="",t.inputId=p.guid(),t.focused=!1,t}e.Input=h},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},r=(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,o,a=(o=i(0))&&o.__esModule?o:{default:o},u=i(5),p=i(1),h=i(6),c=(s=p.VueComponent,r(d,s),d.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},d.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(d.prototype,"computedValue",{get:function(){return void 0!==this.valueDuringOnChange?this.valueDuringOnChange:this.currentValue},enumerable:!0,configurable:!0}),d.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}},d.prototype.focus=function(){this.input&&this.input.focus()},d.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(d.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}),d.prototype.handleFocus=function(t){this.focused=!0},d.prototype.handleBlur=function(t){this.focused=!1},Object.defineProperty(d.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(d.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}),d.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},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},d.prototype.setValidity=function(){this.input&&this.input.setCustomValidity&&this.input.setCustomValidity(this.validity().valid?"":this.$props.validationMessage||"Please enter a valid value!")},d.prototype.formatNumber=function(t){return null==t?"":this.intl.formatNumber(t,this.$props.format).toString()},d.prototype.parseNumber=function(t){return this.intl.parseNumber(t,this.$props.format)},d.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},r=i.value,s=this.symbols.minusSign;if(r===s)return n.value=null,void this.triggerChange(n,t);if(r.split(s).length!==this.textBeforeInput.split(s).length&&r.length===this.textBeforeInput.length+s.length)return n.value=-this.parseNumber(this.textBeforeInput),void this.triggerChange(n,t);var o=this.symbols.decimal;if(2<r.split(RegExp("\\"+o)).length)return n.decimalSelect=!0,void this.triggerChange(n,t);if(1<r.length&&-1===r.indexOf(o)&&0<=this.textBeforeInput.indexOf(o)&&r.length+o.length===this.textBeforeInput.length)return n.decimalSelect=!0,void this.triggerChange(n,t);var a=this.parseNumber(r);if(a===this.currentValue&&0<r.length&&r[r.length-1]===o&&-1<(this.formatNumber(1.1)||"").toString().indexOf(o))return n.looselyFormattedText=r,void this.triggerChange(n,t);var l=(null===a||isNaN(a))&&0<r.length&&r!==this.symbols.minusSign,u=this.elementWrapper;if(r.length>this.textBeforeInput.length&&this.parseNumber(r)===this.parseNumber(r.slice(0,i.selectionStart))&&(null===this.parseNumber(r.slice(i.selectionStart-1))||isNaN(this.parseNumber(r.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=a,this.triggerChange(n,t)}},d.prototype.nonInputActions=function(t,e){var i={value:t,looselyFormattedText:null,selectionStart:0,selectionEnd:0,decimalSelect:!1};this.triggerChange(i,e)},d.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}},d.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)},d.prototype.increase=function(t){this.nonInputActions((this.currentValue||0)+(this.$props.step||0),t)},d.prototype.decrease=function(t){this.nonInputActions((this.currentValue||0)-(this.$props.step||0),t)},d.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)))},d.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,r=e.selectionEnd;e.value=i.slice(0,n)+this.symbols.decimal+i.slice(r),e.selectionStart=e.selectionEnd=n+1,this.elementChange(t)}break;default:return}t.preventDefault()},d.prototype.spinnersWrapperMouseDown=function(t){document&&this.input&&(t.preventDefault(),document.activeElement!==this.input&&this.input.focus())},function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"===("undefined"==typeof Reflect?"undefined":l(Reflect))&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;0<=a;a--)(r=t[a])&&(o=(s<3?r(o):3<s?r(e,i,o):r(e,i))||o);return 3<s&&o&&Object.defineProperty(e,i,o),o}([a.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}}})],d));function d(){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=c},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)}],r.c=n,r.d=function(t,e,i){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(r.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)r.d(i,n,function(t){return e[t]}.bind(null,n));return i},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=2)}}}); | ||
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,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:{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.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},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)}}}); |
{ | ||
"name": "@progress/kendo-vue-inputs", | ||
"description": "KendoVue Input package", | ||
"version": "0.4.7", | ||
"version": "0.4.8-dev.202003160658", | ||
"repository": { | ||
@@ -41,6 +41,6 @@ "type": "git", | ||
"dependencies": { | ||
"@progress/kendo-vue-common": "0.4.7" | ||
"@progress/kendo-vue-common": "0.4.8-dev.202003160658" | ||
}, | ||
"devDependencies": { | ||
"@progress/kendo-vue-intl": "0.4.7", | ||
"@progress/kendo-vue-intl": "0.4.8-dev.202003160658", | ||
"cldr-core": "^34.0.0", | ||
@@ -47,0 +47,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
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
295525
5210
+ Added@progress/kendo-vue-common@0.4.8-dev.202003160658(transitive)
- Removed@progress/kendo-vue-common@0.4.7(transitive)